@datorama/core 22.1.1-rc.2 → 22.2.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.
Files changed (59) hide show
  1. package/bundle.scss +13 -13
  2. package/bundles/datorama-core.umd.js +155 -125
  3. package/bundles/datorama-core.umd.js.map +1 -1
  4. package/bundles/datorama-core.umd.min.js +15 -15
  5. package/bundles/datorama-core.umd.min.js.map +1 -1
  6. package/datorama-core.d.ts +0 -1
  7. package/datorama-core.metadata.json +1 -1
  8. package/esm2015/datorama-core.js +1 -2
  9. package/esm2015/lib/breadcrumbs/breadcrumbs.component.js +2 -4
  10. package/esm2015/lib/grid-v2/grid/grid-v2.types.js +1 -1
  11. package/esm2015/lib/grid-v2/grid-controller/grid-controller.component.js +11 -6
  12. package/esm2015/lib/grid-v2/grid-filter/filter-validator.js +3 -1
  13. package/esm2015/lib/grid-v2/grid-filter/grid-filter.component.js +12 -4
  14. package/esm2015/lib/grid-v2/grid-filter/grid-filter.types.js +3 -1
  15. package/esm2015/lib/grid-v2/grid-pagination/grid-pagination.component.js +1 -4
  16. package/esm2015/lib/grid-v2/grid-settings.js +2 -2
  17. package/esm2015/lib/grid-v2/grid-store/grid.query.js +13 -14
  18. package/esm2015/lib/grid-v2/grid-store/grid.service.js +42 -21
  19. package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -7
  20. package/esm2015/lib/icon/icon.types.js +1 -1
  21. package/esm2015/lib/progress-bar/progress-bar.component.js +36 -16
  22. package/esm2015/lib/rich-text/rich-text.directive.js +33 -15
  23. package/esm2015/lib/select/select.component.js +10 -5
  24. package/esm2015/lib/version.js +2 -2
  25. package/esm5/datorama-core.js +1 -2
  26. package/esm5/lib/breadcrumbs/breadcrumbs.component.js +2 -4
  27. package/esm5/lib/grid-v2/grid/grid-v2.types.js +1 -1
  28. package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +11 -6
  29. package/esm5/lib/grid-v2/grid-filter/filter-validator.js +3 -1
  30. package/esm5/lib/grid-v2/grid-filter/grid-filter.component.js +12 -4
  31. package/esm5/lib/grid-v2/grid-filter/grid-filter.types.js +3 -1
  32. package/esm5/lib/grid-v2/grid-pagination/grid-pagination.component.js +1 -4
  33. package/esm5/lib/grid-v2/grid-settings.js +2 -2
  34. package/esm5/lib/grid-v2/grid-store/grid.query.js +13 -14
  35. package/esm5/lib/grid-v2/grid-store/grid.service.js +43 -21
  36. package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -13
  37. package/esm5/lib/icon/icon.types.js +1 -1
  38. package/esm5/lib/progress-bar/progress-bar.component.js +36 -16
  39. package/esm5/lib/rich-text/rich-text.directive.js +34 -16
  40. package/esm5/lib/select/select.component.js +10 -5
  41. package/esm5/lib/version.js +2 -2
  42. package/fesm2015/datorama-core.js +154 -117
  43. package/fesm2015/datorama-core.js.map +1 -1
  44. package/fesm5/datorama-core.js +156 -125
  45. package/fesm5/datorama-core.js.map +1 -1
  46. package/i18n/locale-en_US.json +2 -0
  47. package/lib/grid-v2/grid/grid-v2.types.d.ts +1 -2
  48. package/lib/grid-v2/grid-controller/grid-controller.component.d.ts +1 -0
  49. package/lib/grid-v2/grid-filter/grid-filter.types.d.ts +3 -1
  50. package/lib/grid-v2/grid-settings.d.ts +2 -2
  51. package/lib/grid-v2/grid-store/grid.service.d.ts +2 -1
  52. package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +0 -2
  53. package/lib/icon/icon.types.d.ts +1 -1
  54. package/lib/progress-bar/progress-bar.component.d.ts +8 -2
  55. package/lib/rich-text/rich-text.directive.d.ts +6 -4
  56. package/package.json +1 -1
  57. package/esm2015/lib/rich-text/rich-text.service.js +0 -50
  58. package/esm5/lib/rich-text/rich-text.service.js +0 -51
  59. package/lib/rich-text/rich-text.service.d.ts +0 -10
package/bundle.scss CHANGED
@@ -14300,6 +14300,19 @@ dato-grid-v2 .ag-cell {
14300
14300
  border-right: solid 1px themify(primary-300, 0.5);
14301
14301
  }
14302
14302
 
14303
+ dato-grid-v2 ag-grid-angular .ag-floating-bottom {
14304
+ border: none !important;
14305
+ }
14306
+
14307
+ dato-grid-v2 ag-grid-angular .ag-floating-bottom .ag-row {
14308
+ background-color: themify(primary-0) !important;
14309
+ border: 1px solid themify(primary-200);
14310
+ }
14311
+
14312
+ dato-grid-v2 ag-grid-angular .ag-floating-bottom .ag-row .ag-cell {
14313
+ border-right: none;
14314
+ }
14315
+
14303
14316
  dato-grid-v2 ag-grid-angular.enable-v2_1 {
14304
14317
  padding-top: 8px;
14305
14318
  }
@@ -14341,19 +14354,6 @@ dato-grid-v2 ag-grid-angular.pivot-mode .ag-row.ag-row-group:not(.ag-row-level-0
14341
14354
  font-weight: 400;
14342
14355
  }
14343
14356
 
14344
- dato-grid-v2 ag-grid-angular.pivot-mode .ag-floating-bottom {
14345
- border: none;
14346
- }
14347
-
14348
- dato-grid-v2 ag-grid-angular.pivot-mode .ag-floating-bottom .ag-row {
14349
- background-color: themify(primary-0);
14350
- border: 1px solid themify(primary-200);
14351
- }
14352
-
14353
- dato-grid-v2 ag-grid-angular.pivot-mode .ag-floating-bottom .ag-row .ag-cell {
14354
- border-right: none;
14355
- }
14356
-
14357
14357
  dato-grid-v2 ag-grid-angular.pivot-mode .ag-ltr .ag-row-group-leaf-indent {
14358
14358
  margin-left: 0;
14359
14359
  }
@@ -8629,8 +8629,9 @@
8629
8629
  DatoSelectComponent.prototype.writeValue = function (activeOptions) {
8630
8630
  this._model = activeOptions ? akita.coerceArray(activeOptions) : [];
8631
8631
  if (this.options) {
8632
+ var overTheLimit = this.limitSelectedTo && this.isMulti && this._model.length >= this.limitSelectedTo;
8632
8633
  this.markAsActive(this._model, { deselectAll: true });
8633
- this.limitSelectedTo && this.updateDisabledState();
8634
+ overTheLimit && this.updateDisabledState();
8634
8635
  }
8635
8636
  /** For later updates */
8636
8637
  this.cdr.markForCheck();
@@ -8667,7 +8668,7 @@
8667
8668
  */
8668
8669
  if (this.hasValue && this._initialOpen) {
8669
8670
  this.markAsActive(this._model);
8670
- if (this.limitSelectedTo) {
8671
+ if (this.limitSelectedTo && this._model.length === this.limitSelectedTo) {
8671
8672
  this.updateDisabledState();
8672
8673
  }
8673
8674
  this._initialOpen = false;
@@ -8756,6 +8757,7 @@
8756
8757
  };
8757
8758
  DatoSelectComponent.prototype.removeOption = function (option) {
8758
8759
  var _this = this;
8760
+ var updateDisabled = this.limitSelectedTo && this._model.length === this.limitSelectedTo;
8759
8761
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== option[_this.idKey]; });
8760
8762
  var optionToRemove = this.options.find(function (datoOption) { return datoOption.option && datoOption.option[_this.idKey] === option[_this.idKey]; });
8761
8763
  /**
@@ -8765,7 +8767,7 @@
8765
8767
  if (optionToRemove) {
8766
8768
  optionToRemove.active = false;
8767
8769
  }
8768
- this.limitSelectedTo && this.updateDisabledState();
8770
+ updateDisabled && this.updateDisabledState();
8769
8771
  this.onChange(this._model);
8770
8772
  this.cdr.markForCheck();
8771
8773
  if (this.datoOverlay.attached) {
@@ -9115,6 +9117,9 @@
9115
9117
  if (!datoOption) {
9116
9118
  return;
9117
9119
  }
9120
+ var modelLength = this._model.length;
9121
+ var updateDisabled = this.limitSelectedTo &&
9122
+ (modelLength === this.limitSelectedTo || (modelLength === this.limitSelectedTo - 1 && !datoOption.active));
9118
9123
  datoOption.active = !datoOption.active;
9119
9124
  var rawOption = datoOption.option;
9120
9125
  if (datoOption.active) {
@@ -9123,7 +9128,7 @@
9123
9128
  else {
9124
9129
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== rawOption[_this.idKey]; });
9125
9130
  }
9126
- this.limitSelectedTo && this.updateDisabledState();
9131
+ updateDisabled && this.updateDisabledState();
9127
9132
  this.onChange(this._model);
9128
9133
  this.cdr.markForCheck();
9129
9134
  this.datoOverlay.scheduleUpdate();
@@ -11578,20 +11583,17 @@
11578
11583
  if (this.gridRef.gridOptions.pivotMode) {
11579
11584
  var _a = this.api.grid.getSortModel().pop() || {}, sort = _a.sort, colId = _a.colId;
11580
11585
  var column = this.api.columns.getColumn(colId);
11581
- var pivotedColumn = this.getSecondaryColumn(colId);
11582
- if (pivotedColumn) {
11583
- var uniquePivotParents = uniq(this.api.columns.getSecondaryColumns().map(function (column) { return column.getParent(); }));
11584
- var secondaryColumn = this.getSecondaryColumn(pivotedColumn.getColId());
11585
- var pivotColIndex = uniquePivotParents.indexOf(secondaryColumn.getParent());
11586
- return { colId: getColField(pivotedColumn.getColDef()), sort: sort, pivotColIndex: pivotColIndex };
11586
+ if (column) {
11587
+ return { colId: colId, sort: sort, colField: getColField(column.getColDef()) };
11587
11588
  }
11588
- else if (column) {
11589
- return { colId: getColField(column.getColDef()), sort: sort };
11589
+ else {
11590
+ var secondaryColumn = this.getSecondaryColumn(colId);
11591
+ if (secondaryColumn) {
11592
+ return { colId: colId, sort: sort, colField: getColField(secondaryColumn.getColDef()) };
11593
+ }
11590
11594
  }
11591
11595
  }
11592
- else {
11593
- return this.api.grid.getSortModel().pop();
11594
- }
11596
+ return this.api.grid.getSortModel().pop();
11595
11597
  };
11596
11598
  GridQuery.prototype.selectSort = function () {
11597
11599
  return this.select(function (state) { return state.settings.sort; });
@@ -11688,7 +11690,10 @@
11688
11690
  };
11689
11691
  GridQuery.prototype.getSecondaryColumn = function (colId) {
11690
11692
  var secondaryColumns = this.api.columns.getSecondaryColumns();
11691
- return secondaryColumns && secondaryColumns.find(function (col) { return col.getColId() === colId; });
11693
+ if (secondaryColumns) {
11694
+ return secondaryColumns.find(function (col) { return col.getColId() === colId; });
11695
+ }
11696
+ return null;
11692
11697
  };
11693
11698
  GridQuery.prototype.filterCheckboxSelectionColumn = function (columns) {
11694
11699
  return columns.filter(function (column) { return !column.getUserProvidedColDef() || !column.getUserProvidedColDef().checkboxSelection; });
@@ -11740,6 +11745,8 @@
11740
11745
  DatoFilterConditions["NOT_IN_LIST"] = "NOT_IN_LIST";
11741
11746
  DatoFilterConditions["IS_EMPTY"] = "IS_EMPTY";
11742
11747
  DatoFilterConditions["NOT_EMPTY"] = "NOT_EMPTY";
11748
+ DatoFilterConditions["IS_NULL"] = "IS_NULL";
11749
+ DatoFilterConditions["NOT_NULL"] = "NOT_NULL";
11743
11750
  })(exports.DatoFilterConditions || (exports.DatoFilterConditions = {}));
11744
11751
  var DatoGridDateFilterOptions = [
11745
11752
  exports.DatoFilterConditions.IN_RANGE,
@@ -11823,8 +11830,10 @@
11823
11830
  case exports.DatoFilterConditions.IN_RANGE:
11824
11831
  return rowValue >= filterValue && rowValue <= parseFloat(rangeEnd);
11825
11832
  case exports.DatoFilterConditions.IS_EMPTY:
11833
+ case exports.DatoFilterConditions.IS_NULL:
11826
11834
  return isNil(rowValue);
11827
11835
  case exports.DatoFilterConditions.NOT_EMPTY:
11836
+ case exports.DatoFilterConditions.NOT_NULL:
11828
11837
  return !isNil(rowValue);
11829
11838
  }
11830
11839
  }
@@ -12010,7 +12019,7 @@
12010
12019
  return contextActions;
12011
12020
  }
12012
12021
 
12013
- var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_AP');
12022
+ var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_API');
12014
12023
 
12015
12024
  var defaultEditableColumnRenderer = function (params) {
12016
12025
  return params && params.value ? "<div class=\"value-wrapper ellipsis\">" + params.value + "</div>" : null;
@@ -12825,10 +12834,11 @@
12825
12834
  var _a;
12826
12835
  var _this = this;
12827
12836
  var _b = this.popover.data, gridService = _b.gridService, gridQuery = _b.gridQuery;
12828
- var _c = this.colDef, filter = _c.filter, _d = _c.filtersConfig, filtersConfig = _d === void 0 ? {} : _d, pivotValueColumn = _c.pivotValueColumn, pivotKeys = _c.pivotKeys;
12837
+ var _c = this.colDef, filter = _c.filter, pivotValueColumn = _c.pivotValueColumn, pivotKeys = _c.pivotKeys;
12829
12838
  var colDefs = gridQuery.api.columns.getAllColumns().map(function (column) { return column.getColDef(); });
12830
12839
  this.colField = getColField(this.colDef);
12831
12840
  var colDef = colDefs.find(function (colDef) { return colDef.field === _this.colField; });
12841
+ var filtersConfig = colDef.filtersConfig || this.colDef.filtersConfig || {};
12832
12842
  var colFilter = filter || colDef.filter;
12833
12843
  var filterOptions = DatoGridFilterOptionsMap[colFilter];
12834
12844
  this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
@@ -12850,7 +12860,11 @@
12850
12860
  if (this.filterSections.Conditional) {
12851
12861
  var filterConditions = filterOptions || DatoGridStringFilterOptions;
12852
12862
  if (filtersConfig.showEmptyConditions) {
12853
- filterConditions = __spread(filterConditions, [exports.DatoFilterConditions.IS_EMPTY, exports.DatoFilterConditions.NOT_EMPTY]);
12863
+ var emptyConditions = [exports.DatoFilterConditions.IS_EMPTY, exports.DatoFilterConditions.NOT_EMPTY];
12864
+ if (this.filterType === exports.DatoGridFilterTypes.Number) {
12865
+ emptyConditions = [exports.DatoFilterConditions.IS_NULL, exports.DatoFilterConditions.NOT_NULL];
12866
+ }
12867
+ filterConditions = __spread(filterConditions, emptyConditions);
12854
12868
  }
12855
12869
  this.conditionalFilterOptions = filterConditions.map(function (operand, id) { return ({
12856
12870
  id: id,
@@ -13241,7 +13255,10 @@
13241
13255
  valueControl.updateValueAndValidity();
13242
13256
  };
13243
13257
  DatoGridFilterComponent.prototype.isEmptyOperand = function (operand) {
13244
- return operand === exports.DatoFilterConditions.IS_EMPTY || operand === exports.DatoFilterConditions.NOT_EMPTY;
13258
+ return (operand === exports.DatoFilterConditions.IS_EMPTY ||
13259
+ operand === exports.DatoFilterConditions.NOT_EMPTY ||
13260
+ operand === exports.DatoFilterConditions.IS_NULL ||
13261
+ operand === exports.DatoFilterConditions.NOT_NULL);
13245
13262
  };
13246
13263
  DatoGridFilterComponent.prototype.isStringArray = function (value) {
13247
13264
  return isString(value[0]);
@@ -14388,11 +14405,13 @@
14388
14405
  var filter = filters_1_1.value.filter;
14389
14406
  var column = this.api.columns.getColumn(filter.colId);
14390
14407
  if (column) {
14391
- this.setColumnFilter(column, filter);
14408
+ this.setColumnFilter(column, filter, false);
14392
14409
  }
14393
14410
  else {
14394
- var pivotColumn = this.gridQuery.getSecondaryColumn(filter.colId);
14395
- this.setColumnFilter(pivotColumn, filter);
14411
+ var secondaryColumn = this.gridQuery.getSecondaryColumn(filter.colId);
14412
+ if (secondaryColumn) {
14413
+ this.setColumnFilter(secondaryColumn, filter, false);
14414
+ }
14396
14415
  }
14397
14416
  }
14398
14417
  }
@@ -14403,7 +14422,23 @@
14403
14422
  }
14404
14423
  finally { if (e_2) throw e_2.error; }
14405
14424
  }
14406
- this.notifyFilterUpdate();
14425
+ this.api.grid.onFilterChanged();
14426
+ }
14427
+ };
14428
+ GridService.prototype.setGridSort = function (_a) {
14429
+ var colId = _a.colId, sort = _a.sort;
14430
+ if (this.api) {
14431
+ var column = this.api.columns.getColumn(colId);
14432
+ if (column) {
14433
+ column.setSort(sort);
14434
+ }
14435
+ else {
14436
+ var secondaryColumn = this.gridQuery.getSecondaryColumn(colId);
14437
+ if (secondaryColumn) {
14438
+ secondaryColumn.setSort(sort);
14439
+ }
14440
+ }
14441
+ this.api.grid.onSortChanged();
14407
14442
  }
14408
14443
  };
14409
14444
  GridService.prototype.updateFilter = function (column, filter) {
@@ -14461,8 +14496,7 @@
14461
14496
  this.updateSettings({ gridAlignment: gridAlignment, columnsSizes: null });
14462
14497
  };
14463
14498
  GridService.prototype.saveSettingsToServer = function (settings) {
14464
- var isGlobal = this.gridQuery.getGridOptions().isGlobalSettings;
14465
- this.storageAPI.set(this.gridName, settings, isGlobal);
14499
+ this.storageAPI.set(this.gridName, settings);
14466
14500
  };
14467
14501
  /**
14468
14502
  * @internal used to log grid events to the platform's logging service
@@ -14869,6 +14903,13 @@
14869
14903
  column: column
14870
14904
  };
14871
14905
  }
14906
+ if (condition === exports.DatoFilterConditions.IS_NULL || condition === exports.DatoFilterConditions.NOT_NULL) {
14907
+ return {
14908
+ condition: exports.DatoFilterConditions.IS_NULL,
14909
+ value: condition === exports.DatoFilterConditions.IS_NULL ? 'true' : 'false',
14910
+ column: column
14911
+ };
14912
+ }
14872
14913
  return __assign(__assign({}, item), { column: column });
14873
14914
  })
14874
14915
  };
@@ -14932,13 +14973,12 @@
14932
14973
  if (userProvidedColDef) {
14933
14974
  colDef.filter = userProvidedColDef.filter;
14934
14975
  }
14935
- // if (colDef.pivotKeys) {
14936
- // colDef.pivotKeys = colDef.pivotKeys.map(key => {
14937
- // const parsedKey = tryParsePivotValue(key);
14938
- //
14939
- // return (parsedKey && parsedKey.value) || '';
14940
- // });
14941
- // }
14976
+ if (colDef.pivotKeys) {
14977
+ colDef.pivotKeys = colDef.pivotKeys.map(function (key) {
14978
+ var parsedKey = tryParsePivotValue(key);
14979
+ return (parsedKey && parsedKey.value) || '';
14980
+ });
14981
+ }
14942
14982
  };
14943
14983
  gridOptions.processSecondaryColGroupDef = function (colGroupDef) {
14944
14984
  if (colGroupDef.headerName) {
@@ -14963,13 +15003,12 @@
14963
15003
  else {
14964
15004
  colGroupDef.headerClass = ['empty-pivot-header'];
14965
15005
  }
14966
- // if (colGroupDef.pivotKeys) {
14967
- // colGroupDef.pivotKeys = colGroupDef.pivotKeys.map(key => {
14968
- // const parsedKey = tryParsePivotValue(key);
14969
- //
14970
- // return (parsedKey && parsedKey.value) || '';
14971
- // });
14972
- // }
15006
+ if (colGroupDef.pivotKeys) {
15007
+ colGroupDef.pivotKeys = colGroupDef.pivotKeys.map(function (key) {
15008
+ var parsedKey = tryParsePivotValue(key);
15009
+ return (parsedKey && parsedKey.value) || '';
15010
+ });
15011
+ }
14973
15012
  };
14974
15013
  };
14975
15014
  GridService.prototype.setPivotModeRows = function (data) {
@@ -15462,10 +15501,7 @@
15462
15501
  .pipe(operators.switchMap(function () {
15463
15502
  _this.gridOptions = _this.normalizeOptions();
15464
15503
  agGrid.gridOptions = _this.gridOptions;
15465
- var isGlobal = _this.gridOptions.isGlobalSettings;
15466
- var settingsLoader = _this.gridOptions.saveSettings === false
15467
- ? rxjs.of(null)
15468
- : _this.storageAPI.get(_this.gridOptions.gridName, isGlobal);
15504
+ var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
15469
15505
  return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
15470
15506
  }), ngxTakeUntilDestroy.untilDestroyed(this))
15471
15507
  .subscribe(function (_a) {
@@ -15473,6 +15509,11 @@
15473
15509
  if (!_this.gridOptions.rowData) {
15474
15510
  api.showLoadingOverlay();
15475
15511
  }
15512
+ if (!_this.gridOptions.statusBar) {
15513
+ /** Fix ag-grid bug that doesn't add ag-hidden class to the status bar, which only get fixed in later versions */
15514
+ var el = agGridEl.querySelector('.ag-status-bar');
15515
+ addClass(el, 'ag-hidden');
15516
+ }
15476
15517
  var gridApi = { grid: api, columns: columnApi };
15477
15518
  _this.gridService._setApi(gridApi, agGrid);
15478
15519
  _this.gridQuery._setApi(gridApi, agGrid);
@@ -15512,6 +15553,9 @@
15512
15553
  DatoGridControllerComponent.prototype.setGridFilters = function (filters) {
15513
15554
  this.gridService.setGridFilters(filters);
15514
15555
  };
15556
+ DatoGridControllerComponent.prototype.setGridSort = function (sort) {
15557
+ this.gridService.setGridSort(sort);
15558
+ };
15515
15559
  DatoGridControllerComponent.prototype.onFilterChanged = function () {
15516
15560
  return this.gridQuery.filterChanged();
15517
15561
  };
@@ -16425,9 +16469,6 @@
16425
16469
  DatoGridPaginationV2Component.prototype.toggleGroupsState = function () {
16426
16470
  this.isExpanded ? this.gridApi.collapseAll() : this.gridApi.expandAll();
16427
16471
  this.isExpanded = !this.isExpanded;
16428
- // this.gridApi.forEachNode((node: RowNode) => {
16429
- // node.setExpanded(this.isExpanded);
16430
- // });
16431
16472
  };
16432
16473
  DatoGridPaginationV2Component.prototype.autoFitGrid = function (type) {
16433
16474
  this.gridService.fitGrid(type);
@@ -16743,18 +16784,6 @@
16743
16784
  this.registerGroupListeners();
16744
16785
  this.subscribeRowsSelectionData();
16745
16786
  };
16746
- DatoGridV2ToolbarComponent.prototype.getCellValueChangeEvent = function () {
16747
- var _this = this;
16748
- return this.gridController.gridQuery.waitForGrid(function () {
16749
- return _this.gridQuery.gridRef.cellValueChanged.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16750
- });
16751
- };
16752
- DatoGridV2ToolbarComponent.prototype.getRowDataUpdatedEvent = function () {
16753
- var _this = this;
16754
- return this.gridController.gridQuery.waitForGrid(function () {
16755
- return _this.gridQuery.gridRef.rowDataUpdated.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16756
- });
16757
- };
16758
16787
  DatoGridV2ToolbarComponent.prototype.onActionClick = function (action) {
16759
16788
  if (isFunction(action.onClick)) {
16760
16789
  var selectedRowsCount = this.gridController.gridQuery.getSelectedRowsCount();
@@ -21230,40 +21259,6 @@
21230
21259
  * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
21231
21260
  */
21232
21261
 
21233
- var RichTextService = /** @class */ (function () {
21234
- function RichTextService(http, config) {
21235
- this.http = http;
21236
- this.config = config;
21237
- }
21238
- RichTextService.prototype.getLib = function (appendScriptFunc, appendStyleFunc) {
21239
- if (!this.richTextScript$) {
21240
- this.initLib(appendScriptFunc, appendStyleFunc);
21241
- }
21242
- return this.richTextScript$;
21243
- };
21244
- RichTextService.prototype.initLib = function (appendScriptFunc, appendStyleFunc) {
21245
- this.richTextScript$ = rxjs.combineLatest([
21246
- this.http
21247
- .get(this.config.paths.richText + "/index.js", { responseType: 'text' })
21248
- .pipe(operators.tap(function (lib) { return appendScriptFunc(lib, 'rich-text-editor'); })),
21249
- this.http
21250
- .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21251
- .pipe(operators.tap(function (style) { return appendStyleFunc(style, 'tinymce-autocomplete'); }))
21252
- ]).pipe(operators.shareReplay(1));
21253
- };
21254
- RichTextService.ctorParameters = function () { return [
21255
- { type: http.HttpClient },
21256
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21257
- ]; };
21258
- RichTextService.ɵprov = core.ɵɵdefineInjectable({ factory: function RichTextService_Factory() { return new RichTextService(core.ɵɵinject(http.HttpClient), core.ɵɵinject(DATO_CORE_CONFIG)); }, token: RichTextService, providedIn: "root" });
21259
- RichTextService = __decorate([
21260
- core.Injectable({ providedIn: 'root' }),
21261
- __param(1, core.Inject(DATO_CORE_CONFIG)),
21262
- __metadata("design:paramtypes", [http.HttpClient, Object])
21263
- ], RichTextService);
21264
- return RichTextService;
21265
- }());
21266
-
21267
21262
  /**
21268
21263
  * @license
21269
21264
  * Copyright Datorama. All Rights Reserved.
@@ -21277,12 +21272,12 @@
21277
21272
  var ɵ0$3 = getTinymce;
21278
21273
  var DatoRichTextDirective = /** @class */ (function (_super) {
21279
21274
  __extends(DatoRichTextDirective, _super);
21280
- function DatoRichTextDirective(ngZone, richTextService, config, host) {
21275
+ function DatoRichTextDirective(ngZone, http, host, config) {
21281
21276
  var _this = _super.call(this) || this;
21282
21277
  _this.ngZone = ngZone;
21283
- _this.richTextService = richTextService;
21284
- _this.config = config;
21278
+ _this.http = http;
21285
21279
  _this.host = host;
21280
+ _this.config = config;
21286
21281
  _this.autocompleteOptions = {};
21287
21282
  _this.forcePlainTextPasting = false;
21288
21283
  _this.format = 'html';
@@ -21316,11 +21311,28 @@
21316
21311
  base: this.config.paths.richText,
21317
21312
  query: ''
21318
21313
  };
21319
- this.richTextService
21320
- .getLib(appendScript, appendStyle)
21321
- .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
21322
- .subscribe(function () {
21323
- _this.init.call(_this);
21314
+ /**
21315
+ * We support only one instance in load time
21316
+ */
21317
+ if (window.tinymce) {
21318
+ this.init.call(this);
21319
+ }
21320
+ else {
21321
+ this.loadLib().subscribe(function (lib) {
21322
+ appendScript(lib, 'rich-text-editor');
21323
+ _this.init.call(_this);
21324
+ _this.loadAutoCompleteStyle();
21325
+ });
21326
+ }
21327
+ };
21328
+ DatoRichTextDirective.prototype.loadLib = function () {
21329
+ return this.http.get(this.config.paths.richText + "/index.js", { responseType: 'text' });
21330
+ };
21331
+ DatoRichTextDirective.prototype.loadAutoCompleteStyle = function () {
21332
+ this.http
21333
+ .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21334
+ .subscribe(function (style) {
21335
+ appendStyle(style, 'tinymce-autocomplete');
21324
21336
  });
21325
21337
  };
21326
21338
  DatoRichTextDirective.prototype.initEditor = function (_, editor) {
@@ -21413,9 +21425,9 @@
21413
21425
  var DatoRichTextDirective_1;
21414
21426
  DatoRichTextDirective.ctorParameters = function () { return [
21415
21427
  { type: core.NgZone },
21416
- { type: RichTextService },
21417
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] },
21418
- { type: core.ElementRef }
21428
+ { type: http.HttpClient },
21429
+ { type: core.ElementRef },
21430
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21419
21431
  ]; };
21420
21432
  __decorate([
21421
21433
  core.Input(),
@@ -21481,9 +21493,10 @@
21481
21493
  }
21482
21494
  ]
21483
21495
  }),
21484
- __param(2, core.Inject(DATO_CORE_CONFIG)),
21496
+ __param(3, core.Inject(DATO_CORE_CONFIG)),
21485
21497
  __metadata("design:paramtypes", [core.NgZone,
21486
- RichTextService, Object, core.ElementRef])
21498
+ http.HttpClient,
21499
+ core.ElementRef, Object])
21487
21500
  ], DatoRichTextDirective);
21488
21501
  return DatoRichTextDirective;
21489
21502
  }(BaseCustomControl));
@@ -24006,9 +24019,7 @@
24006
24019
  };
24007
24020
  DatoBreadcrumbsComponent.prototype.initEditableHeader = function () {
24008
24021
  var _this = this;
24009
- this.headerControl.valueChanges
24010
- .pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this))
24011
- .subscribe(function (res) {
24022
+ this.headerControl.valueChanges.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (res) {
24012
24023
  _this.updateEditableText.emit(res);
24013
24024
  _this.cdr.detectChanges();
24014
24025
  });
@@ -24697,22 +24708,17 @@
24697
24708
  }());
24698
24709
 
24699
24710
  var DatoProgressBarComponent = /** @class */ (function () {
24700
- function DatoProgressBarComponent() {
24711
+ function DatoProgressBarComponent(cdr) {
24712
+ this.cdr = cdr;
24701
24713
  this.barColor = 'primary-100';
24702
24714
  this.thresholds = [33, 66];
24703
24715
  }
24704
24716
  DatoProgressBarComponent.prototype.ngOnInit = function () {
24705
- if (!this.parts && this.percent) {
24706
- if (!this.color) {
24707
- this.initColor();
24708
- }
24709
- this.parts = [
24710
- {
24711
- percent: this.percent,
24712
- color: this.color,
24713
- tooltip: this.tooltip
24714
- }
24715
- ];
24717
+ if (!this.parts) {
24718
+ this.percent = this.percent || 0;
24719
+ this.isByPercent = true;
24720
+ this.hasInitialColor = !!this.color;
24721
+ this.initSinglePart();
24716
24722
  }
24717
24723
  else if (this.parts &&
24718
24724
  this.parts.every(function (part) { return part.weight >= 0; }) &&
@@ -24720,6 +24726,27 @@
24720
24726
  this.initPartsPercent();
24721
24727
  }
24722
24728
  };
24729
+ DatoProgressBarComponent.prototype.ngOnChanges = function (changes) {
24730
+ if (this.isByPercent &&
24731
+ ((changes.percent && !changes.percent.firstChange) ||
24732
+ (changes.color && !changes.color.firstChange) ||
24733
+ (changes.tooltip && !changes.tooltip.firstChange))) {
24734
+ this.initSinglePart();
24735
+ this.cdr.detectChanges();
24736
+ }
24737
+ };
24738
+ DatoProgressBarComponent.prototype.initSinglePart = function () {
24739
+ if (!this.color || !this.hasInitialColor) {
24740
+ this.initColor();
24741
+ }
24742
+ this.parts = [
24743
+ {
24744
+ percent: this.percent,
24745
+ color: this.color,
24746
+ tooltip: this.tooltip
24747
+ }
24748
+ ];
24749
+ };
24723
24750
  DatoProgressBarComponent.prototype.initColor = function () {
24724
24751
  if (isEmpty(this.thresholds)) {
24725
24752
  this.color = 'accent-400';
@@ -24760,6 +24787,9 @@
24760
24787
  }
24761
24788
  }
24762
24789
  };
24790
+ DatoProgressBarComponent.ctorParameters = function () { return [
24791
+ { type: core.ChangeDetectorRef }
24792
+ ]; };
24763
24793
  __decorate([
24764
24794
  core.Input(),
24765
24795
  __metadata("design:type", String)
@@ -24795,11 +24825,12 @@
24795
24825
  DatoProgressBarComponent = __decorate([
24796
24826
  core.Component({
24797
24827
  selector: 'dato-progress-bar',
24798
- template: "<div class=\"bar d-flex width-100 overflow-hidden\"\n [style.width]=\"width\"\n [class]=\"barColor + '-background-color'\">\n <div *ngFor=\"let part of parts; index as i\"\n class=\"part height-100\"\n [ngClass]=\"part.color ? part.color + '-background-color' : ''\"\n [style.width]=\"i > 0 ? 'calc(' + part.percent + '% + 8px)' : part.percent + '%'\"\n [style.z-index]=\"100 - i\"\n [datoTooltipV2]=\"part.tooltip\">\n </div>\n</div>\n\n<div *ngIf=\"showLegend\" class=\"d-flex mt-12\">\n <div *ngFor=\"let part of parts; index as i\" class=\"d-flex mr-16\">\n <div class=\"d-flex dato-note primary-400-color\">\n <div class=\"legend-color mr-6\" [ngClass]=\"part.color ? part.color + '-background-color' : ''\"></div>\n <div>{{ part.legendLabel || part.tooltip }}</div>\n </div>\n </div>\n</div>\n",
24828
+ template: "<div class=\"bar d-flex width-100 overflow-hidden\"\n [style.width]=\"width\"\n [class]=\"barColor + '-background-color'\">\n <div *ngFor=\"let part of parts; index as i\"\n class=\"part height-100\"\n [ngClass]=\"part.color ? part.color + '-background-color' : ''\"\n [style.width]=\"i > 0 ? 'calc(' + part.percent + '% + 8px)' : part.percent + '%'\"\n [style.z-index]=\"100 - i\"\n [datoTooltipV2]=\"part.tooltip\">\n </div>\n</div>\n\n<ng-content></ng-content>\n\n<div *ngIf=\"showLegend\" class=\"d-flex mt-12\">\n <div *ngFor=\"let part of parts; index as i\" class=\"d-flex mr-16\">\n <div class=\"d-flex dato-note primary-400-color\">\n <div class=\"legend-color mr-6\" [ngClass]=\"part.color ? part.color + '-background-color' : ''\"></div>\n <div>{{ part.legendLabel || part.tooltip }}</div>\n </div>\n </div>\n</div>\n",
24799
24829
  changeDetection: core.ChangeDetectionStrategy.OnPush,
24800
24830
  encapsulation: core.ViewEncapsulation.None,
24801
24831
  styles: ["dato-progress-bar .bar{height:8px;border-radius:4px}dato-progress-bar .part{border-radius:0 4px 4px 0}dato-progress-bar .part:not(:first-child){margin-left:-8px}dato-progress-bar .legend-color{width:16px;height:16px;min-width:16px;border-radius:50%}"]
24802
- })
24832
+ }),
24833
+ __metadata("design:paramtypes", [core.ChangeDetectorRef])
24803
24834
  ], DatoProgressBarComponent);
24804
24835
  return DatoProgressBarComponent;
24805
24836
  }());
@@ -25351,7 +25382,7 @@
25351
25382
  };
25352
25383
  }
25353
25384
 
25354
- window.coreVersion = '22.1.1-rc.';
25385
+ window.coreVersion = '22.2.0';
25355
25386
 
25356
25387
  exports.APP_TRANSLATE = APP_TRANSLATE;
25357
25388
  exports.AceService = AceService;
@@ -25793,7 +25824,6 @@
25793
25824
  exports.ɵl = DatoGridItemsCountCellComponent;
25794
25825
  exports.ɵm = DatoGridV2ToolbarMoreMenuComponent;
25795
25826
  exports.ɵn = DatoGridSearchBarComponent;
25796
- exports.ɵo = RichTextService;
25797
25827
 
25798
25828
  Object.defineProperty(exports, '__esModule', { value: true });
25799
25829