@datorama/core 22.12.7-beta.1 → 22.12.8-rc

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 (47) hide show
  1. package/bundles/datorama-core.umd.js +100 -57
  2. package/bundles/datorama-core.umd.js.map +1 -1
  3. package/bundles/datorama-core.umd.min.js +41 -41
  4. package/bundles/datorama-core.umd.min.js.map +1 -1
  5. package/datorama-core.d.ts +1 -0
  6. package/datorama-core.metadata.json +1 -1
  7. package/esm2015/datorama-core.js +2 -1
  8. package/esm2015/lib/breadcrumbs/breadcrumbs.component.js +4 -2
  9. package/esm2015/lib/grid-v2/grid/grid-v2.types.js +4 -4
  10. package/esm2015/lib/grid-v2/grid-controller/grid-controller.component.js +7 -6
  11. package/esm2015/lib/grid-v2/grid-settings.js +2 -2
  12. package/esm2015/lib/grid-v2/grid-store/grid.service.js +12 -6
  13. package/esm2015/lib/grid-v2/grid-store/util.js +4 -1
  14. package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +13 -1
  15. package/esm2015/lib/grid-v2/grid-v2.util.js +1 -1
  16. package/esm2015/lib/icon/icon.types.js +1 -1
  17. package/esm2015/lib/rich-text/rich-text.directive.js +20 -38
  18. package/esm2015/lib/rich-text/rich-text.service.js +50 -0
  19. package/esm2015/lib/select/select.component.js +4 -9
  20. package/esm2015/lib/version.js +2 -2
  21. package/esm5/datorama-core.js +2 -1
  22. package/esm5/lib/breadcrumbs/breadcrumbs.component.js +4 -2
  23. package/esm5/lib/grid-v2/grid/grid-v2.types.js +4 -4
  24. package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +7 -6
  25. package/esm5/lib/grid-v2/grid-settings.js +2 -2
  26. package/esm5/lib/grid-v2/grid-store/grid.service.js +12 -6
  27. package/esm5/lib/grid-v2/grid-store/util.js +4 -1
  28. package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +20 -1
  29. package/esm5/lib/grid-v2/grid-v2.util.js +1 -1
  30. package/esm5/lib/icon/icon.types.js +1 -1
  31. package/esm5/lib/rich-text/rich-text.directive.js +21 -39
  32. package/esm5/lib/rich-text/rich-text.service.js +51 -0
  33. package/esm5/lib/select/select.component.js +4 -9
  34. package/esm5/lib/version.js +2 -2
  35. package/fesm2015/datorama-core.js +91 -57
  36. package/fesm2015/datorama-core.js.map +1 -1
  37. package/fesm5/datorama-core.js +100 -58
  38. package/fesm5/datorama-core.js.map +1 -1
  39. package/lib/grid-v2/grid/grid-v2.types.d.ts +1 -0
  40. package/lib/grid-v2/grid-settings.d.ts +2 -2
  41. package/lib/grid-v2/grid-store/grid.service.d.ts +4 -0
  42. package/lib/grid-v2/grid-store/util.d.ts +2 -0
  43. package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +3 -0
  44. package/lib/grid-v2/grid-v2.util.d.ts +1 -1
  45. package/lib/rich-text/rich-text.directive.d.ts +4 -6
  46. package/lib/rich-text/rich-text.service.d.ts +10 -0
  47. package/package.json +2 -2
@@ -8873,9 +8873,8 @@
8873
8873
  DatoSelectComponent.prototype.writeValue = function (activeOptions) {
8874
8874
  this._model = activeOptions ? akita.coerceArray(activeOptions) : [];
8875
8875
  if (this.options) {
8876
- var overTheLimit = this.limitSelectedTo && this.isMulti && this._model.length >= this.limitSelectedTo;
8877
8876
  this.markAsActive(this._model, { deselectAll: true });
8878
- overTheLimit && this.updateDisabledState();
8877
+ this.limitSelectedTo && this.updateDisabledState();
8879
8878
  }
8880
8879
  /** For later updates */
8881
8880
  this.cdr.markForCheck();
@@ -9003,7 +9002,6 @@
9003
9002
  };
9004
9003
  DatoSelectComponent.prototype.removeOption = function (option) {
9005
9004
  var _this = this;
9006
- var updateDisabled = this.limitSelectedTo && this._model.length === this.limitSelectedTo;
9007
9005
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== option[_this.idKey]; });
9008
9006
  var optionToRemove = this.options.find(function (datoOption) { return datoOption.option && datoOption.option[_this.idKey] === option[_this.idKey]; });
9009
9007
  /**
@@ -9013,7 +9011,7 @@
9013
9011
  if (optionToRemove) {
9014
9012
  optionToRemove.active = false;
9015
9013
  }
9016
- updateDisabled && this.updateDisabledState();
9014
+ this.limitSelectedTo && this.updateDisabledState();
9017
9015
  this.onChange(this._model);
9018
9016
  this.cdr.markForCheck();
9019
9017
  this.asyncUpdateDropdownPosition();
@@ -9361,9 +9359,6 @@
9361
9359
  if (!datoOption) {
9362
9360
  return;
9363
9361
  }
9364
- var modelLength = this._model.length;
9365
- var updateDisabled = this.limitSelectedTo &&
9366
- (modelLength === this.limitSelectedTo || (modelLength === this.limitSelectedTo - 1 && !datoOption.active));
9367
9362
  datoOption.active = !datoOption.active;
9368
9363
  var rawOption = datoOption.option;
9369
9364
  if (datoOption.active) {
@@ -9372,7 +9367,7 @@
9372
9367
  else {
9373
9368
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== rawOption[_this.idKey]; });
9374
9369
  }
9375
- updateDisabled && this.updateDisabledState();
9370
+ this.limitSelectedTo && this.updateDisabledState();
9376
9371
  this.onChange(this._model);
9377
9372
  this.cdr.markForCheck();
9378
9373
  this.asyncUpdateDropdownPosition();
@@ -11554,6 +11549,9 @@
11554
11549
  }
11555
11550
  return value;
11556
11551
  }
11552
+ function isHtmlAllowedForCol(gridOptions, colDef) {
11553
+ return (!gridOptions.disabledHTMLRenderingFields || !gridOptions.disabledHTMLRenderingFields.includes(getColField(colDef)));
11554
+ }
11557
11555
 
11558
11556
  var GridQuery = /** @class */ (function (_super) {
11559
11557
  __extends(GridQuery, _super);
@@ -12105,7 +12103,7 @@
12105
12103
  return contextActions;
12106
12104
  }
12107
12105
 
12108
- var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_API');
12106
+ var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_AP');
12109
12107
 
12110
12108
  var defaultEditableColumnRenderer = function (params) {
12111
12109
  return params && params.value ? "<div class=\"value-wrapper ellipsis\">" + params.value + "</div>" : null;
@@ -12126,9 +12124,9 @@
12126
12124
  cellValue = DOMPurify.sanitize(cellValue);
12127
12125
  }
12128
12126
  searchTerm = (searchTerm || '').trim();
12129
- return searchTerm ?
12130
- cellValue.replace(new RegExp(searchTerm, 'gi'), function (str) { return "<span class=\"search-highlight\">" + str + "</span>"; }) :
12131
- cellValue;
12127
+ return searchTerm
12128
+ ? cellValue.replace(new RegExp(searchTerm, 'gi'), function (str) { return "<span class=\"search-highlight\">" + str + "</span>"; })
12129
+ : cellValue;
12132
12130
  };
12133
12131
 
12134
12132
  (function (GridMinWidths) {
@@ -14257,6 +14255,12 @@
14257
14255
  ? context
14258
14256
  : deepmerge(this.gridRef.gridOptions.context || {}, context);
14259
14257
  };
14258
+ GridService.prototype.updateGridActions = function () {
14259
+ this.updateGridActionsSubject.next(true);
14260
+ };
14261
+ GridService.prototype.getUpdateGridActionsStatus = function () {
14262
+ return this.updateGridActionsSubject.asObservable();
14263
+ };
14260
14264
  /**
14261
14265
  * @deprecated use selectRows instead
14262
14266
  * @param row
@@ -14487,8 +14491,7 @@
14487
14491
  !this.hasCellRenderer(normalized, gridOptions) &&
14488
14492
  gridOptions.enableSearchHighlight) {
14489
14493
  normalized.cellRenderer = function (params) {
14490
- var colField = getColField(params.colDef);
14491
- var allowHTML = !gridOptions.disabledHTMLRenderingFields || !gridOptions.disabledHTMLRenderingFields.includes(colField);
14494
+ var allowHTML = isHtmlAllowedForCol(gridOptions, params.colDef);
14492
14495
  var isEditable = (isFunction(normalized.editable) && normalized.editable(params)) ||
14493
14496
  (!isFunction(normalized.editable) && normalized.editable);
14494
14497
  return isEditable
@@ -14753,7 +14756,8 @@
14753
14756
  this.updateSettings({ gridAlignment: gridAlignment, columnsSizes: null });
14754
14757
  };
14755
14758
  GridService.prototype.saveSettingsToServer = function (settings) {
14756
- this.storageAPI.set(this.gridName, settings);
14759
+ var isGlobal = this.gridQuery.getGridOptions().isGlobalSettings;
14760
+ this.storageAPI.set(this.gridName, settings, isGlobal);
14757
14761
  };
14758
14762
  /**
14759
14763
  * @internal used to log grid events to the platform's logging service
@@ -15791,7 +15795,10 @@
15791
15795
  .pipe(operators.switchMap(function () {
15792
15796
  _this.gridOptions = _this.normalizeOptions();
15793
15797
  agGrid.gridOptions = _this.gridOptions;
15794
- var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
15798
+ var isGlobal = _this.gridOptions.isGlobalSettings;
15799
+ var settingsLoader = _this.gridOptions.saveSettings === false
15800
+ ? rxjs.of(null)
15801
+ : _this.storageAPI.get(_this.gridOptions.gridName, isGlobal);
15795
15802
  return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
15796
15803
  }), ngxTakeUntilDestroy.untilDestroyed(this))
15797
15804
  .subscribe(function (_a) {
@@ -15806,7 +15813,6 @@
15806
15813
  }
15807
15814
  var gridApi = { grid: api, columns: columnApi };
15808
15815
  _this.gridService._setApi(gridApi, agGrid);
15809
- debugger;
15810
15816
  _this.gridQuery._setApi(gridApi, agGrid);
15811
15817
  _this.gridService.initSettings(savedSettings || {});
15812
15818
  _this.registerSettingsListeners(gridApi, agGrid);
@@ -16047,8 +16053,7 @@
16047
16053
  var textOverflow = cell.offsetWidth < cell.scrollWidth;
16048
16054
  if (textOverflow) {
16049
16055
  clearTimeout(this.cellMouseOutTimer);
16050
- var colField = getColField(event.colDef);
16051
- var allowHTML = !this.gridOptions.disabledHTMLRenderingFields || !this.gridOptions.disabledHTMLRenderingFields.includes(colField);
16056
+ var allowHTML = isHtmlAllowedForCol(this.gridOptions, event.colDef);
16052
16057
  var params = { cell: cell, value: cell.innerText, allowHTML: allowHTML };
16053
16058
  isNil(this.tooltip) ? this.createAndShowTooltip(params) : this.updateTooltip(params);
16054
16059
  }
@@ -17088,6 +17093,19 @@
17088
17093
  });
17089
17094
  this.registerGroupListeners();
17090
17095
  this.subscribeRowsSelectionData();
17096
+ this.subscribeUpdateGridActions();
17097
+ };
17098
+ DatoGridV2ToolbarComponent.prototype.getCellValueChangeEvent = function () {
17099
+ var _this = this;
17100
+ return this.gridController.gridQuery.waitForGrid(function () {
17101
+ return _this.gridQuery.gridRef.cellValueChanged.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
17102
+ });
17103
+ };
17104
+ DatoGridV2ToolbarComponent.prototype.getRowDataUpdatedEvent = function () {
17105
+ var _this = this;
17106
+ return this.gridController.gridQuery.waitForGrid(function () {
17107
+ return _this.gridQuery.gridRef.rowDataUpdated.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
17108
+ });
17091
17109
  };
17092
17110
  DatoGridV2ToolbarComponent.prototype.onActionClick = function (action) {
17093
17111
  if (isFunction(action.onClick)) {
@@ -17343,6 +17361,12 @@
17343
17361
  _this.cdr.detectChanges();
17344
17362
  });
17345
17363
  };
17364
+ DatoGridV2ToolbarComponent.prototype.subscribeUpdateGridActions = function () {
17365
+ var _this = this;
17366
+ this.gridService.getUpdateGridActionsStatus().subscribe(function () {
17367
+ _this.initGridActions();
17368
+ });
17369
+ };
17346
17370
  DatoGridV2ToolbarComponent.prototype.selectAllPages = function () {
17347
17371
  if (this.gridQuery.isServerSide) {
17348
17372
  this.gridService.setServerSidePagination({ selectAllRowsEnabled: true, excludedFromSelectAll: [] });
@@ -21576,6 +21600,40 @@
21576
21600
  * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
21577
21601
  */
21578
21602
 
21603
+ var RichTextService = /** @class */ (function () {
21604
+ function RichTextService(http, config) {
21605
+ this.http = http;
21606
+ this.config = config;
21607
+ }
21608
+ RichTextService.prototype.getLib = function (appendScriptFunc, appendStyleFunc) {
21609
+ if (!this.richTextScript$) {
21610
+ this.initLib(appendScriptFunc, appendStyleFunc);
21611
+ }
21612
+ return this.richTextScript$;
21613
+ };
21614
+ RichTextService.prototype.initLib = function (appendScriptFunc, appendStyleFunc) {
21615
+ this.richTextScript$ = rxjs.combineLatest([
21616
+ this.http
21617
+ .get(this.config.paths.richText + "/index.js", { responseType: 'text' })
21618
+ .pipe(operators.tap(function (lib) { return appendScriptFunc(lib, 'rich-text-editor'); })),
21619
+ this.http
21620
+ .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21621
+ .pipe(operators.tap(function (style) { return appendStyleFunc(style, 'tinymce-autocomplete'); }))
21622
+ ]).pipe(operators.shareReplay(1));
21623
+ };
21624
+ RichTextService.ctorParameters = function () { return [
21625
+ { type: http.HttpClient },
21626
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21627
+ ]; };
21628
+ RichTextService.ɵprov = core.ɵɵdefineInjectable({ factory: function RichTextService_Factory() { return new RichTextService(core.ɵɵinject(http.HttpClient), core.ɵɵinject(DATO_CORE_CONFIG)); }, token: RichTextService, providedIn: "root" });
21629
+ RichTextService = __decorate([
21630
+ core.Injectable({ providedIn: 'root' }),
21631
+ __param(1, core.Inject(DATO_CORE_CONFIG)),
21632
+ __metadata("design:paramtypes", [http.HttpClient, Object])
21633
+ ], RichTextService);
21634
+ return RichTextService;
21635
+ }());
21636
+
21579
21637
  /**
21580
21638
  * @license
21581
21639
  * Copyright Datorama. All Rights Reserved.
@@ -21589,20 +21647,20 @@
21589
21647
  var ɵ0$3 = getTinymce;
21590
21648
  var DatoRichTextDirective = /** @class */ (function (_super) {
21591
21649
  __extends(DatoRichTextDirective, _super);
21592
- function DatoRichTextDirective(ngZone, http, host, config) {
21650
+ function DatoRichTextDirective(ngZone, richTextService, config, host) {
21593
21651
  var _this = _super.call(this) || this;
21594
21652
  _this.ngZone = ngZone;
21595
- _this.http = http;
21596
- _this.host = host;
21653
+ _this.richTextService = richTextService;
21597
21654
  _this.config = config;
21655
+ _this.host = host;
21598
21656
  _this.autocompleteOptions = {};
21599
21657
  _this.forcePlainTextPasting = false;
21600
21658
  _this.format = 'html';
21601
21659
  _this.isOneLine = false;
21602
21660
  _this.initialValue = '';
21603
- _this.defaultPlugins = 'link fullscreen textcolor colorpicker image lists table textpattern autocomplete';
21661
+ _this.defaultPlugins = 'link fullscreen image lists table autocomplete';
21604
21662
  _this.defaultToolbar = [
21605
- 'fontselect fontsizeselect forecolor backcolor bold italic underline link',
21663
+ 'fontfamily fontsize forecolor backcolor bold italic underline link',
21606
21664
  'alignleft aligncenter alignright alignjustify outdent indent | table numlist bullist | image fullscreen'
21607
21665
  ];
21608
21666
  return _this;
@@ -21628,28 +21686,11 @@
21628
21686
  base: this.config.paths.richText,
21629
21687
  query: ''
21630
21688
  };
21631
- /**
21632
- * We support only one instance in load time
21633
- */
21634
- if (window.tinymce) {
21635
- this.init.call(this);
21636
- }
21637
- else {
21638
- this.loadLib().subscribe(function (lib) {
21639
- appendScript(lib, 'rich-text-editor');
21640
- _this.init.call(_this);
21641
- _this.loadAutoCompleteStyle();
21642
- });
21643
- }
21644
- };
21645
- DatoRichTextDirective.prototype.loadLib = function () {
21646
- return this.http.get(this.config.paths.richText + "/index.js", { responseType: 'text' });
21647
- };
21648
- DatoRichTextDirective.prototype.loadAutoCompleteStyle = function () {
21649
- this.http
21650
- .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21651
- .subscribe(function (style) {
21652
- appendStyle(style, 'tinymce-autocomplete');
21689
+ this.richTextService
21690
+ .getLib(appendScript, appendStyle)
21691
+ .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
21692
+ .subscribe(function () {
21693
+ _this.init.call(_this);
21653
21694
  });
21654
21695
  };
21655
21696
  DatoRichTextDirective.prototype.initEditor = function (_, editor) {
@@ -21673,8 +21714,6 @@
21673
21714
  target: this.host.nativeElement,
21674
21715
  width: this.width || 600,
21675
21716
  height: this.height || 300,
21676
- force_br_newlines: true,
21677
- force_p_newlines: false,
21678
21717
  resize: 'both',
21679
21718
  branding: false,
21680
21719
  inline: this.inline,
@@ -21682,10 +21721,12 @@
21682
21721
  readonly: this.disabled,
21683
21722
  plugins: this.plugins || this.defaultPlugins,
21684
21723
  toolbar: isNil(this.toolbar) ? this.defaultToolbar : this.toolbar,
21685
- fontsize_formats: '8px 10px 12px 14px 18px 24px 36px',
21724
+ font_size_formats: '8px 10px 12px 14px 18px 24px 36px',
21686
21725
  min_width: 480,
21687
21726
  menubar: false,
21688
21727
  autocomplete: this.autocompleteOptions,
21728
+ suffix: '.min',
21729
+ skin: 'tinymce-5',
21689
21730
  setup: function (editor) {
21690
21731
  _this.editor = editor;
21691
21732
  editor.on('init', function (e) {
@@ -21742,9 +21783,9 @@
21742
21783
  var DatoRichTextDirective_1;
21743
21784
  DatoRichTextDirective.ctorParameters = function () { return [
21744
21785
  { type: core.NgZone },
21745
- { type: http.HttpClient },
21746
- { type: core.ElementRef },
21747
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21786
+ { type: RichTextService },
21787
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] },
21788
+ { type: core.ElementRef }
21748
21789
  ]; };
21749
21790
  __decorate([
21750
21791
  core.Input(),
@@ -21810,10 +21851,9 @@
21810
21851
  }
21811
21852
  ]
21812
21853
  }),
21813
- __param(3, core.Inject(DATO_CORE_CONFIG)),
21854
+ __param(2, core.Inject(DATO_CORE_CONFIG)),
21814
21855
  __metadata("design:paramtypes", [core.NgZone,
21815
- http.HttpClient,
21816
- core.ElementRef, Object])
21856
+ RichTextService, Object, core.ElementRef])
21817
21857
  ], DatoRichTextDirective);
21818
21858
  return DatoRichTextDirective;
21819
21859
  }(BaseCustomControl));
@@ -24336,7 +24376,9 @@
24336
24376
  };
24337
24377
  DatoBreadcrumbsComponent.prototype.initEditableHeader = function () {
24338
24378
  var _this = this;
24339
- this.headerControl.valueChanges.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (res) {
24379
+ this.headerControl.valueChanges
24380
+ .pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this))
24381
+ .subscribe(function (res) {
24340
24382
  _this.updateEditableText.emit(res);
24341
24383
  _this.cdr.detectChanges();
24342
24384
  });
@@ -25699,7 +25741,7 @@
25699
25741
  };
25700
25742
  }
25701
25743
 
25702
- window.coreVersion = '22.12.7';
25744
+ window.coreVersion = '22.13.7-rc.';
25703
25745
 
25704
25746
  exports.APP_TRANSLATE = APP_TRANSLATE;
25705
25747
  exports.AceService = AceService;
@@ -26143,6 +26185,7 @@
26143
26185
  exports.ɵl = DatoGridItemsCountCellComponent;
26144
26186
  exports.ɵm = DatoGridV2ToolbarMoreMenuComponent;
26145
26187
  exports.ɵn = DatoGridSearchBarComponent;
26188
+ exports.ɵo = RichTextService;
26146
26189
 
26147
26190
  Object.defineProperty(exports, '__esModule', { value: true });
26148
26191