@bizdoc/core 1.11.0-next.9 → 1.11.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.
@@ -5428,8 +5428,7 @@ class CubeService {
5428
5428
  this._type = _type;
5429
5429
  this._session = _session;
5430
5430
  this._cache = {};
5431
- this._exchangeRates = {};
5432
- this._cacheOr = (name, fn) => this._cache[name] || (this._cache[name] = fn());
5431
+ this._cacheOr = (name, fn) => this._cache[name] || (this._cache[name] = fn().pipe(shareReplay()));
5433
5432
  _config && _config.currencyCode && setCurrencyCode(_config.currencyCode);
5434
5433
  }
5435
5434
  /** system currency */
@@ -5627,7 +5626,7 @@ class CubeService {
5627
5626
  }
5628
5627
  /** get currencies */
5629
5628
  currencies() {
5630
- return this._cacheOr('currencies', () => this._http.get('api/cube/currencies').pipe(shareReplay()));
5629
+ return this._cacheOr('currencies', () => this._http.get('api/cube/currencies'));
5631
5630
  }
5632
5631
  /**
5633
5632
  * get exchange rate
@@ -5637,13 +5636,13 @@ class CubeService {
5637
5636
  exchangeRate(currencyCode, date) {
5638
5637
  if (this.currencyCode === currencyCode)
5639
5638
  return of(1);
5640
- const key = currencyCode + (date ? date.toJSON() : '');
5641
- if (this._exchangeRates[key])
5642
- return this._exchangeRates[key];
5643
- return this._exchangeRates[key] = this._http.get(`api/cube/exchangeRate/${currencyCode}`, {
5639
+ let key = currencyCode;
5640
+ if (date)
5641
+ key += date.toJSON();
5642
+ return this._cacheOr(key, () => this._http.get(`api/cube/exchangeRate/${currencyCode}`, {
5644
5643
  params: date ? { date: date.toJSON() } : null,
5645
5644
  headers: { 'no-progress': 'true' }
5646
- }).pipe(shareReplay());
5645
+ }));
5647
5646
  }
5648
5647
  /**
5649
5648
  * replaces * or # with origin axis at char place
@@ -8229,11 +8228,11 @@ class ComposeFormComponent {
8229
8228
  if (retry > -1)
8230
8229
  this.model.attachments.splice(retry, 1);
8231
8230
  const model = this._constructAttachment(f);
8232
- this.model.attachments.push(model);
8233
8231
  const observable = this._mailbox.upload(this.model.id, this.model.formId, this.model.version, f).
8234
8232
  pipe(tap((r) => {
8235
8233
  this._sb.toast(!exists ? 'UploadOk' : 'UploadVersionOk', f.name);
8236
8234
  Object.assign(model, r, { progress: null, });
8235
+ this.model.attachments.push(model);
8237
8236
  this.working = false;
8238
8237
  this.workingChange.emit(false);
8239
8238
  }), catchError(e => {
@@ -13964,7 +13963,7 @@ class TraceViewComponent extends TraceBase {
13964
13963
  }
13965
13964
  trace.push(step);
13966
13965
  }
13967
- this._data = trace;
13966
+ this._data = trace.sort((a, b) => a.time > b.time ? 1 : a.time === b.time ? 0 : -1);
13968
13967
  this._filter();
13969
13968
  }
13970
13969
  _filter() {
@@ -14870,7 +14869,7 @@ class CubeMatrixComponent {
14870
14869
  const cells = [{ index: 1, value: x.title, style: { bold: true } }];
14871
14870
  this.columns.forEach((c, j) => cells.push({
14872
14871
  index: j + 2,
14873
- value: data[c.key] !== undefined ? data[c.key] : 0
14872
+ value: data && data[c.key] !== undefined ? data[c.key] : 0
14874
14873
  }));
14875
14874
  rows.push({
14876
14875
  index: i + 1,
@@ -14879,18 +14878,18 @@ class CubeMatrixComponent {
14879
14878
  i++;
14880
14879
  });
14881
14880
  this.rows.forEach(r => {
14882
- const data = this._data[r.key], cells = [{ index: 1, value: r.value }];
14881
+ const data = this._data[r.key], cells = [{ index: 1, value: r.value, style: { bold: true } }];
14883
14882
  this.columns.forEach((c, j) => cells.push({
14884
14883
  type: 'number',
14885
- index: j + 1,
14886
- value: data[c.key] !== undefined ? data[c.key] : 0,
14884
+ index: j + 2,
14885
+ value: data && data[c.key] !== undefined ? data[c.key] : 0,
14887
14886
  style: {
14888
14887
  numberFormat,
14889
14888
  hAlign: 'right',
14890
14889
  }
14891
14890
  }));
14892
14891
  rows.push({
14893
- index: i + 2,
14892
+ index: i + 1,
14894
14893
  cells
14895
14894
  });
14896
14895
  i++;
@@ -14905,7 +14904,7 @@ class CubeMatrixComponent {
14905
14904
  },
14906
14905
  ],
14907
14906
  }, 'xlsx');
14908
- this._service.nameOf(this.filters, this.cube.name).subscribe(n => book.save(`${n}.xlsx`));
14907
+ this._service.nameOf(this.filters, this.cube.name).subscribe(n => book.save(`${n || this._translate.get('Matrix')}.xlsx`));
14909
14908
  }
14910
14909
  move(x, y) {
14911
14910
  let rowIndex = 0;
@@ -14938,10 +14937,10 @@ class CubeMatrixComponent {
14938
14937
  }
14939
14938
  }
14940
14939
  CubeMatrixComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CubeMatrixComponent, deps: [{ token: PromptService }, { token: CubeService }, { token: SessionService }, { token: TranslateService }, { token: DatasourceService }], target: i0.ɵɵFactoryTarget.Component });
14941
- CubeMatrixComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: CubeMatrixComponent, selector: "bizdoc-cube-matrix", inputs: { seriesTotalLabel: "seriesTotalLabel", xAxisTotalLabel: "xAxisTotalLabel", _cube: ["cube", "_cube"], _xAxis: ["xAxis", "_xAxis"], _series: ["series", "_series"], _indices: ["indices", "_indices"], scope: "scope", sum: "sum", filters: "filters", loading: "loading", interactive: "interactive" }, outputs: { onExplore: "explore", loadingChange: "loadingChange" }, viewQueries: [{ propertyName: "tableElement", first: true, predicate: ["table"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<table #table class=\"mat-table cube-table\" (mouseleave)=\"move(-1, -1)\" *ngIf=\"data\">\r\n <thead>\r\n <!-- headers -->\r\n <tr class=\"mat-row\">\r\n <th></th>\r\n <th *ngFor=\"let column of columns; let x = index\" (mouseenter)=\"move(x + 1, -2)\" class=\"mat-header-cell\">\r\n {{ column.value }}\r\n </th>\r\n <th class=\"mat-header-cell\">{{xAxisTotalLabel}}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <!-- indices -->\r\n <tr class=\"mat-row cube-index\" *ngFor=\"let index of indices; let y = index\">\r\n <th class=\"mat-header-cell\" (mouseenter)=\"move(0, y)\">{{index.title}}</th>\r\n <td *ngFor=\"let column of columns; let x = index\" class=\"mat-cell figure\" (mouseenter)=\"move(x + 1, y)\">\r\n {{ data[index.name][column.key] }}\r\n </td>\r\n <th class=\"mat-cell figure\" (mouseenter)=\"move(0, y)\">\r\n {{ data[index.name]['_total'] }}\r\n </th>\r\n </tr>\r\n </tbody>\r\n <tbody>\r\n <!-- rows -->\r\n <tr *ngFor=\"let row of rows; let y = index\" class=\"mat-row\">\r\n <th class=\"mat-header-cell\" (mouseenter)=\"move(-2, y + indices.length)\">{{ row.value }}</th>\r\n <td *ngFor=\"let column of columns; let x = index\" class=\"mat-cell figure\" (mouseenter)=\"move(x + 1, y + indices.length)\">\r\n <span [class.clickable]=\"interactive && column.explorable !== false && row.explorable !== false\" (click)=\"explore(column, row)\">\r\n {{ data[row.key][column.key] }}\r\n </span>\r\n </td>\r\n <th class=\"mat-cell figure\" (mouseenter)=\"move(-1, y + indices.length)\">\r\n <ng-container *ngIf=\"data[row.key]['_total'] !== undefined\">\r\n {{ data[row.key]['_total'] }}\r\n </ng-container>\r\n </th>\r\n </tr>\r\n </tbody>\r\n <tfoot>\r\n <!-- footer -->\r\n <tr class=\"mat-row\">\r\n <th class=\"mat-header-cell\">{{seriesTotalLabel}}</th>\r\n <td *ngFor=\"let column of columns; let x = index\" class=\"mat-cell figure\" (mouseenter)=\"move(x + 1, -2)\"\r\n [class.negative-figure]=\"totals[column.key].startsWith('-')\">\r\n <ng-container *ngIf=\"totals[column.key] !== undefined\">\r\n {{ totals[column.key] }}\r\n </ng-container>\r\n </td>\r\n <th class=\"mat-cell figure\">{{ totals['_grand'] }}</th>\r\n </tr>\r\n </tfoot>\r\n</table>\r\n", styles: [".clickable{cursor:pointer}.cube-table{width:100%;border-collapse:collapse;table-layout:fixed}.cube-table th{cursor:default}.cube-table th.figure{font-weight:500}.cube-table td{padding-right:4px}\n"], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], animations: [matrixAnimation] });
14940
+ CubeMatrixComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: CubeMatrixComponent, selector: "bizdoc-cube-matrix", inputs: { seriesTotalLabel: "seriesTotalLabel", xAxisTotalLabel: "xAxisTotalLabel", _cube: ["cube", "_cube"], _xAxis: ["xAxis", "_xAxis"], _series: ["series", "_series"], _indices: ["indices", "_indices"], scope: "scope", sum: "sum", filters: "filters", loading: "loading", interactive: "interactive" }, outputs: { onExplore: "explore", loadingChange: "loadingChange" }, viewQueries: [{ propertyName: "tableElement", first: true, predicate: ["table"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<table #table class=\"mat-table cube-table\" (mouseleave)=\"move(-1, -1)\" *ngIf=\"data\">\r\n <thead>\r\n <!-- headers -->\r\n <tr class=\"mat-row\">\r\n <th></th>\r\n <th *ngFor=\"let column of columns; let x = index\" (mouseenter)=\"move(x + 1, -2)\" class=\"mat-header-cell\">\r\n {{ column.value }}\r\n </th>\r\n <th class=\"mat-header-cell\">{{xAxisTotalLabel}}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <!-- indices -->\r\n <tr class=\"mat-row cube-index\" *ngFor=\"let index of indices; let y = index\">\r\n <th class=\"mat-header-cell\" (mouseenter)=\"move(0, y)\">{{index.title}}</th>\r\n <td *ngFor=\"let column of columns; let x = index\" class=\"mat-cell figure\" (mouseenter)=\"move(x + 1, y)\">\r\n {{ data[index.name][column.key] }}\r\n </td>\r\n <th class=\"mat-cell figure\" (mouseenter)=\"move(0, y)\">\r\n {{ data[index.name]['_total'] }}\r\n </th>\r\n </tr>\r\n </tbody>\r\n <tbody>\r\n <!-- rows -->\r\n <tr *ngFor=\"let row of rows; let y = index\" class=\"mat-row\">\r\n <th class=\"mat-header-cell\" (mouseenter)=\"move(-2, y + indices.length)\">{{ row.value }}</th>\r\n <td *ngFor=\"let column of columns; let x = index\" class=\"mat-cell figure\" (mouseenter)=\"move(x + 1, y + indices.length)\">\r\n <span [class.clickable]=\"interactive && column.explorable !== false && row.explorable !== false\" (click)=\"explore(column, row)\">\r\n {{ data[row.key][column.key] }}\r\n </span>\r\n </td>\r\n <th class=\"mat-cell figure\" (mouseenter)=\"move(-1, y + indices.length)\">\r\n <ng-container *ngIf=\"data[row.key]['_total'] !== undefined\">\r\n {{ data[row.key]['_total'] }}\r\n </ng-container>\r\n </th>\r\n </tr>\r\n </tbody>\r\n <tfoot>\r\n <!-- footer -->\r\n <tr class=\"mat-row\">\r\n <th class=\"mat-header-cell\">{{seriesTotalLabel}}</th>\r\n <td *ngFor=\"let column of columns; let x = index\" class=\"mat-cell figure\" (mouseenter)=\"move(x + 1, -2)\"\r\n [class.negative-figure]=\"totals[column.key].startsWith('-')\">\r\n <ng-container *ngIf=\"totals[column.key] !== undefined\">\r\n {{ totals[column.key] }}\r\n </ng-container>\r\n </td>\r\n <th class=\"mat-cell figure\">{{ totals['_grand'] }}</th>\r\n </tr>\r\n </tfoot>\r\n</table>\r\n", styles: [".clickable{cursor:pointer}.cube-table{width:100%;border-collapse:collapse;table-layout:fixed}.cube-table th{cursor:default}.cube-table th.figure{font-weight:500}.cube-table td,.cube-table th{padding-right:8px}\n"], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], animations: [matrixAnimation] });
14942
14941
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CubeMatrixComponent, decorators: [{
14943
14942
  type: Component,
14944
- args: [{ selector: 'bizdoc-cube-matrix', animations: [matrixAnimation], template: "<table #table class=\"mat-table cube-table\" (mouseleave)=\"move(-1, -1)\" *ngIf=\"data\">\r\n <thead>\r\n <!-- headers -->\r\n <tr class=\"mat-row\">\r\n <th></th>\r\n <th *ngFor=\"let column of columns; let x = index\" (mouseenter)=\"move(x + 1, -2)\" class=\"mat-header-cell\">\r\n {{ column.value }}\r\n </th>\r\n <th class=\"mat-header-cell\">{{xAxisTotalLabel}}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <!-- indices -->\r\n <tr class=\"mat-row cube-index\" *ngFor=\"let index of indices; let y = index\">\r\n <th class=\"mat-header-cell\" (mouseenter)=\"move(0, y)\">{{index.title}}</th>\r\n <td *ngFor=\"let column of columns; let x = index\" class=\"mat-cell figure\" (mouseenter)=\"move(x + 1, y)\">\r\n {{ data[index.name][column.key] }}\r\n </td>\r\n <th class=\"mat-cell figure\" (mouseenter)=\"move(0, y)\">\r\n {{ data[index.name]['_total'] }}\r\n </th>\r\n </tr>\r\n </tbody>\r\n <tbody>\r\n <!-- rows -->\r\n <tr *ngFor=\"let row of rows; let y = index\" class=\"mat-row\">\r\n <th class=\"mat-header-cell\" (mouseenter)=\"move(-2, y + indices.length)\">{{ row.value }}</th>\r\n <td *ngFor=\"let column of columns; let x = index\" class=\"mat-cell figure\" (mouseenter)=\"move(x + 1, y + indices.length)\">\r\n <span [class.clickable]=\"interactive && column.explorable !== false && row.explorable !== false\" (click)=\"explore(column, row)\">\r\n {{ data[row.key][column.key] }}\r\n </span>\r\n </td>\r\n <th class=\"mat-cell figure\" (mouseenter)=\"move(-1, y + indices.length)\">\r\n <ng-container *ngIf=\"data[row.key]['_total'] !== undefined\">\r\n {{ data[row.key]['_total'] }}\r\n </ng-container>\r\n </th>\r\n </tr>\r\n </tbody>\r\n <tfoot>\r\n <!-- footer -->\r\n <tr class=\"mat-row\">\r\n <th class=\"mat-header-cell\">{{seriesTotalLabel}}</th>\r\n <td *ngFor=\"let column of columns; let x = index\" class=\"mat-cell figure\" (mouseenter)=\"move(x + 1, -2)\"\r\n [class.negative-figure]=\"totals[column.key].startsWith('-')\">\r\n <ng-container *ngIf=\"totals[column.key] !== undefined\">\r\n {{ totals[column.key] }}\r\n </ng-container>\r\n </td>\r\n <th class=\"mat-cell figure\">{{ totals['_grand'] }}</th>\r\n </tr>\r\n </tfoot>\r\n</table>\r\n", styles: [".clickable{cursor:pointer}.cube-table{width:100%;border-collapse:collapse;table-layout:fixed}.cube-table th{cursor:default}.cube-table th.figure{font-weight:500}.cube-table td{padding-right:4px}\n"] }]
14943
+ args: [{ selector: 'bizdoc-cube-matrix', animations: [matrixAnimation], template: "<table #table class=\"mat-table cube-table\" (mouseleave)=\"move(-1, -1)\" *ngIf=\"data\">\r\n <thead>\r\n <!-- headers -->\r\n <tr class=\"mat-row\">\r\n <th></th>\r\n <th *ngFor=\"let column of columns; let x = index\" (mouseenter)=\"move(x + 1, -2)\" class=\"mat-header-cell\">\r\n {{ column.value }}\r\n </th>\r\n <th class=\"mat-header-cell\">{{xAxisTotalLabel}}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <!-- indices -->\r\n <tr class=\"mat-row cube-index\" *ngFor=\"let index of indices; let y = index\">\r\n <th class=\"mat-header-cell\" (mouseenter)=\"move(0, y)\">{{index.title}}</th>\r\n <td *ngFor=\"let column of columns; let x = index\" class=\"mat-cell figure\" (mouseenter)=\"move(x + 1, y)\">\r\n {{ data[index.name][column.key] }}\r\n </td>\r\n <th class=\"mat-cell figure\" (mouseenter)=\"move(0, y)\">\r\n {{ data[index.name]['_total'] }}\r\n </th>\r\n </tr>\r\n </tbody>\r\n <tbody>\r\n <!-- rows -->\r\n <tr *ngFor=\"let row of rows; let y = index\" class=\"mat-row\">\r\n <th class=\"mat-header-cell\" (mouseenter)=\"move(-2, y + indices.length)\">{{ row.value }}</th>\r\n <td *ngFor=\"let column of columns; let x = index\" class=\"mat-cell figure\" (mouseenter)=\"move(x + 1, y + indices.length)\">\r\n <span [class.clickable]=\"interactive && column.explorable !== false && row.explorable !== false\" (click)=\"explore(column, row)\">\r\n {{ data[row.key][column.key] }}\r\n </span>\r\n </td>\r\n <th class=\"mat-cell figure\" (mouseenter)=\"move(-1, y + indices.length)\">\r\n <ng-container *ngIf=\"data[row.key]['_total'] !== undefined\">\r\n {{ data[row.key]['_total'] }}\r\n </ng-container>\r\n </th>\r\n </tr>\r\n </tbody>\r\n <tfoot>\r\n <!-- footer -->\r\n <tr class=\"mat-row\">\r\n <th class=\"mat-header-cell\">{{seriesTotalLabel}}</th>\r\n <td *ngFor=\"let column of columns; let x = index\" class=\"mat-cell figure\" (mouseenter)=\"move(x + 1, -2)\"\r\n [class.negative-figure]=\"totals[column.key].startsWith('-')\">\r\n <ng-container *ngIf=\"totals[column.key] !== undefined\">\r\n {{ totals[column.key] }}\r\n </ng-container>\r\n </td>\r\n <th class=\"mat-cell figure\">{{ totals['_grand'] }}</th>\r\n </tr>\r\n </tfoot>\r\n</table>\r\n", styles: [".clickable{cursor:pointer}.cube-table{width:100%;border-collapse:collapse;table-layout:fixed}.cube-table th{cursor:default}.cube-table th.figure{font-weight:500}.cube-table td,.cube-table th{padding-right:8px}\n"] }]
14945
14944
  }], ctorParameters: function () { return [{ type: PromptService }, { type: CubeService }, { type: SessionService }, { type: TranslateService }, { type: DatasourceService }]; }, propDecorators: { tableElement: [{
14946
14945
  type: ViewChild,
14947
14946
  args: ['table']
@@ -22846,7 +22845,7 @@ class AddressInput {
22846
22845
  }
22847
22846
  get disabled() { return this._disabled; }
22848
22847
  set disabled(value) {
22849
- this._disabled = value || value === '';
22848
+ this._disabled = coerceBooleanProperty(value);
22850
22849
  if (this.control.disabled !== this._disabled) {
22851
22850
  if (value)
22852
22851
  this.control.disable();
@@ -22886,7 +22885,7 @@ class AddressInput {
22886
22885
  }
22887
22886
  onFocus() {
22888
22887
  this.focused = true;
22889
- this._onTouched();
22888
+ this._onTouched && this._onTouched();
22890
22889
  }
22891
22890
  onBlur() {
22892
22891
  this.focused = false;
@@ -24431,15 +24430,13 @@ class CubeBase {
24431
24430
  let i = 0;
24432
24431
  while (i < cube.axes.length) {
24433
24432
  let name = cube.axes[i].name, axis = e.axes[i], val = consolidate[e.cube][name];
24434
- if (!val)
24435
- consolidate[e.cube][name] = axis;
24436
- else if ((isString(val) && val !== axis) || (isArray(val) && val.indexOf(axis) < 0)) {
24437
- if (h && !Object.keys(h).every(a => e[a] === h[a]))
24438
- continue;
24439
- if (isArray(val))
24440
- val.push(axis);
24441
- else
24433
+ if (!h || !h[name] || h[name] === axis) {
24434
+ if (!val)
24435
+ consolidate[e.cube][name] = axis;
24436
+ else if (isString(val) && val !== axis)
24442
24437
  consolidate[e.cube][name] = [val, axis];
24438
+ else if (isArray(val) && val.indexOf(axis) < 0)
24439
+ val.push(axis);
24443
24440
  }
24444
24441
  i++;
24445
24442
  }