@datorama/core 22.10.9-rc.4 → 22.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.
Files changed (39) hide show
  1. package/bundles/datorama-core.umd.js +63 -104
  2. package/bundles/datorama-core.umd.js.map +1 -1
  3. package/bundles/datorama-core.umd.min.js +27 -27
  4. package/bundles/datorama-core.umd.min.js.map +1 -1
  5. package/datorama-core.d.ts +0 -1
  6. package/datorama-core.metadata.json +1 -1
  7. package/esm2015/datorama-core.js +1 -2
  8. package/esm2015/lib/breadcrumbs/breadcrumbs.component.js +2 -4
  9. package/esm2015/lib/grid-v2/grid/grid-v2.types.js +1 -1
  10. package/esm2015/lib/grid-v2/grid-controller/grid-controller.component.js +13 -30
  11. package/esm2015/lib/grid-v2/grid-settings.js +2 -2
  12. package/esm2015/lib/grid-v2/grid-store/grid.service.js +3 -4
  13. package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -7
  14. package/esm2015/lib/rich-text/rich-text.directive.js +38 -20
  15. package/esm2015/lib/select/select.component.js +9 -4
  16. package/esm2015/lib/version.js +2 -2
  17. package/esm5/datorama-core.js +1 -2
  18. package/esm5/lib/breadcrumbs/breadcrumbs.component.js +2 -4
  19. package/esm5/lib/grid-v2/grid/grid-v2.types.js +1 -1
  20. package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +15 -29
  21. package/esm5/lib/grid-v2/grid-settings.js +2 -2
  22. package/esm5/lib/grid-v2/grid-store/grid.service.js +3 -4
  23. package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -13
  24. package/esm5/lib/rich-text/rich-text.directive.js +39 -21
  25. package/esm5/lib/select/select.component.js +9 -4
  26. package/esm5/lib/version.js +2 -2
  27. package/fesm2015/datorama-core.js +61 -97
  28. package/fesm2015/datorama-core.js.map +1 -1
  29. package/fesm5/datorama-core.js +64 -104
  30. package/fesm5/datorama-core.js.map +1 -1
  31. package/lib/grid-v2/grid/grid-v2.types.d.ts +0 -1
  32. package/lib/grid-v2/grid-controller/grid-controller.component.d.ts +0 -1
  33. package/lib/grid-v2/grid-settings.d.ts +2 -2
  34. package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +0 -2
  35. package/lib/rich-text/rich-text.directive.d.ts +6 -4
  36. package/package.json +1 -1
  37. package/esm2015/lib/rich-text/rich-text.service.js +0 -50
  38. package/esm5/lib/rich-text/rich-text.service.js +0 -51
  39. package/lib/rich-text/rich-text.service.d.ts +0 -10
@@ -8748,8 +8748,9 @@
8748
8748
  DatoSelectComponent.prototype.writeValue = function (activeOptions) {
8749
8749
  this._model = activeOptions ? akita.coerceArray(activeOptions) : [];
8750
8750
  if (this.options) {
8751
+ var overTheLimit = this.limitSelectedTo && this.isMulti && this._model.length >= this.limitSelectedTo;
8751
8752
  this.markAsActive(this._model, { deselectAll: true });
8752
- this.limitSelectedTo && this.updateDisabledState();
8753
+ overTheLimit && this.updateDisabledState();
8753
8754
  }
8754
8755
  /** For later updates */
8755
8756
  this.cdr.markForCheck();
@@ -8877,6 +8878,7 @@
8877
8878
  };
8878
8879
  DatoSelectComponent.prototype.removeOption = function (option) {
8879
8880
  var _this = this;
8881
+ var updateDisabled = this.limitSelectedTo && this._model.length === this.limitSelectedTo;
8880
8882
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== option[_this.idKey]; });
8881
8883
  var optionToRemove = this.options.find(function (datoOption) { return datoOption.option && datoOption.option[_this.idKey] === option[_this.idKey]; });
8882
8884
  /**
@@ -8886,7 +8888,7 @@
8886
8888
  if (optionToRemove) {
8887
8889
  optionToRemove.active = false;
8888
8890
  }
8889
- this.limitSelectedTo && this.updateDisabledState();
8891
+ updateDisabled && this.updateDisabledState();
8890
8892
  this.onChange(this._model);
8891
8893
  this.cdr.markForCheck();
8892
8894
  this.asyncUpdateDropdownPosition();
@@ -9234,6 +9236,9 @@
9234
9236
  if (!datoOption) {
9235
9237
  return;
9236
9238
  }
9239
+ var modelLength = this._model.length;
9240
+ var updateDisabled = this.limitSelectedTo &&
9241
+ (modelLength === this.limitSelectedTo || (modelLength === this.limitSelectedTo - 1 && !datoOption.active));
9237
9242
  datoOption.active = !datoOption.active;
9238
9243
  var rawOption = datoOption.option;
9239
9244
  if (datoOption.active) {
@@ -9242,7 +9247,7 @@
9242
9247
  else {
9243
9248
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== rawOption[_this.idKey]; });
9244
9249
  }
9245
- this.limitSelectedTo && this.updateDisabledState();
9250
+ updateDisabled && this.updateDisabledState();
9246
9251
  this.onChange(this._model);
9247
9252
  this.cdr.markForCheck();
9248
9253
  this.asyncUpdateDropdownPosition();
@@ -12047,7 +12052,7 @@
12047
12052
  return contextActions;
12048
12053
  }
12049
12054
 
12050
- var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_AP');
12055
+ var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_API');
12051
12056
 
12052
12057
  var defaultEditableColumnRenderer = function (params) {
12053
12058
  return params && params.value ? "<div class=\"value-wrapper ellipsis\">" + params.value + "</div>" : null;
@@ -14345,7 +14350,7 @@
14345
14350
  var _a = params.node, leafGroup = _a.leafGroup, childIndex = _a.childIndex, rowGroupIndex = _a.rowGroupIndex;
14346
14351
  var gridQuery = params.colDef.headerComponentParams.gridQuery;
14347
14352
  var cellClass = "";
14348
- if (gridQuery) {
14353
+ if (gridQuery && gridQuery.api) {
14349
14354
  var columns = gridQuery.api.columns;
14350
14355
  var allDisplayedColumns = columns.getAllDisplayedColumns();
14351
14356
  var col = allDisplayedColumns.find(function (column) {
@@ -14669,8 +14674,7 @@
14669
14674
  this.updateSettings({ gridAlignment: gridAlignment, columnsSizes: null });
14670
14675
  };
14671
14676
  GridService.prototype.saveSettingsToServer = function (settings) {
14672
- var isGlobal = this.gridQuery.getGridOptions().isGlobalSettings;
14673
- this.storageAPI.set(this.gridName, settings, isGlobal);
14677
+ this.storageAPI.set(this.gridName, settings);
14674
14678
  };
14675
14679
  /**
14676
14680
  * @internal used to log grid events to the platform's logging service
@@ -15658,7 +15662,7 @@
15658
15662
  });
15659
15663
  DatoGridControllerComponent.prototype.ngOnDestroy = function () {
15660
15664
  this.contentInit.complete();
15661
- this.clearTooltip();
15665
+ this.tooltip && this.clearTooltip();
15662
15666
  this.rowHoverComponent && this.rowHoverComponent.destroy();
15663
15667
  this.rowHoverComponent = null;
15664
15668
  };
@@ -15675,10 +15679,7 @@
15675
15679
  .pipe(operators.switchMap(function () {
15676
15680
  _this.gridOptions = _this.normalizeOptions();
15677
15681
  agGrid.gridOptions = _this.gridOptions;
15678
- var isGlobal = _this.gridOptions.isGlobalSettings;
15679
- var settingsLoader = _this.gridOptions.saveSettings === false
15680
- ? rxjs.of(null)
15681
- : _this.storageAPI.get(_this.gridOptions.gridName, isGlobal);
15682
+ var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
15682
15683
  return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
15683
15684
  }), ngxTakeUntilDestroy.untilDestroyed(this))
15684
15685
  .subscribe(function (_a) {
@@ -15888,51 +15889,40 @@
15888
15889
  });
15889
15890
  this.addOnHoverElement();
15890
15891
  }
15891
- agGrid.cellMouseOver.pipe(ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (event) {
15892
- var node = event.node, column = event.column;
15893
- if (lastHoveredCell === node.id + "-" + column.getColId()) {
15894
- clearTimeout(_this.cellMouseOutTimer);
15895
- return;
15896
- }
15897
- lastHoveredCell = node.id + "-" + column.getColId();
15892
+ agGrid.cellMouseOver
15893
+ .pipe(operators.filter(function (_a) {
15894
+ var node = _a.node, column = _a.column;
15895
+ return lastHoveredCell !== node.id + "-" + column.getColId();
15896
+ }), ngxTakeUntilDestroy.untilDestroyed(this))
15897
+ .subscribe(function (event) {
15898
+ lastHoveredCell = event.node.id + "-" + event.column.getColId();
15898
15899
  _this.showTooltip(event);
15899
15900
  var row = event.event.target.parentElement;
15900
- if (onHoverEnabled && (node.group === false || isNil(node.group)) && _this.lastHoveredRow !== row) {
15901
+ if (onHoverEnabled && (event.node.group === false || isNil(event.node.group)) && _this.lastHoveredRow !== row) {
15901
15902
  var previousNode = _this.lastHoveredRow;
15902
15903
  _this.lastHoveredRow = row;
15903
15904
  _this.toggleRowHoverClass([previousNode, _this.lastHoveredRow]);
15904
15905
  _this.setOnHoverState(true, event);
15905
15906
  }
15906
15907
  });
15907
- var onTooltipOut = rxjs.merge(rxjs.fromEvent(bodyViewport, 'scroll'), rxjs.fromEvent(this.agGridEl, 'mouseleave'));
15908
- onTooltipOut.pipe(ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function () {
15909
- lastHoveredCell = null;
15910
- _this.clearTooltip();
15911
- });
15912
- agGrid.cellMouseOut
15908
+ var onTooltipOut = rxjs.merge(rxjs.fromEvent(bodyViewport, 'scroll'), rxjs.fromEvent(this.agGridEl, 'mouseleave'), agGrid.cellMouseOut);
15909
+ onTooltipOut
15913
15910
  .pipe(operators.filter(function () { return !isNil(_this.tooltip); }), ngxTakeUntilDestroy.untilDestroyed(this))
15914
15911
  .subscribe(function () {
15915
- _this.cellMouseOutTimer = window.setTimeout(function () { return _this.clearTooltip(); });
15912
+ _this.clearTooltip();
15916
15913
  });
15917
15914
  };
15918
15915
  /**
15919
15916
  * Dispose the tooltip
15920
15917
  */
15921
15918
  DatoGridControllerComponent.prototype.clearTooltip = function () {
15922
- this.tooltip && this.tooltip.dispose();
15919
+ this.tooltip.dispose();
15923
15920
  this.tooltip = null;
15924
15921
  };
15925
15922
  DatoGridControllerComponent.prototype.showTooltip = function (event) {
15926
15923
  var cell = event.event.target;
15927
- if (cell.tagName === 'SPAN' && cell.scrollWidth === 0) {
15928
- cell = cell.parentElement;
15929
- }
15930
- if (event.colDef.editable) {
15931
- cell = cell.querySelector('.value-wrapper') || cell;
15932
- }
15933
15924
  var textOverflow = cell.offsetWidth < cell.scrollWidth;
15934
15925
  if (textOverflow) {
15935
- clearTimeout(this.cellMouseOutTimer);
15936
15926
  var params = { cell: cell, value: cell.innerText };
15937
15927
  isNil(this.tooltip) ? this.createAndShowTooltip(params) : this.updateTooltip(params);
15938
15928
  }
@@ -16973,18 +16963,6 @@
16973
16963
  this.registerGroupListeners();
16974
16964
  this.subscribeRowsSelectionData();
16975
16965
  };
16976
- DatoGridV2ToolbarComponent.prototype.getCellValueChangeEvent = function () {
16977
- var _this = this;
16978
- return this.gridController.gridQuery.waitForGrid(function () {
16979
- return _this.gridQuery.gridRef.cellValueChanged.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16980
- });
16981
- };
16982
- DatoGridV2ToolbarComponent.prototype.getRowDataUpdatedEvent = function () {
16983
- var _this = this;
16984
- return this.gridController.gridQuery.waitForGrid(function () {
16985
- return _this.gridQuery.gridRef.rowDataUpdated.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16986
- });
16987
- };
16988
16966
  DatoGridV2ToolbarComponent.prototype.onActionClick = function (action) {
16989
16967
  if (isFunction(action.onClick)) {
16990
16968
  var selectedRowsCount = this.gridController.gridQuery.getSelectedRowsCount();
@@ -21472,40 +21450,6 @@
21472
21450
  * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
21473
21451
  */
21474
21452
 
21475
- var RichTextService = /** @class */ (function () {
21476
- function RichTextService(http, config) {
21477
- this.http = http;
21478
- this.config = config;
21479
- }
21480
- RichTextService.prototype.getLib = function (appendScriptFunc, appendStyleFunc) {
21481
- if (!this.richTextScript$) {
21482
- this.initLib(appendScriptFunc, appendStyleFunc);
21483
- }
21484
- return this.richTextScript$;
21485
- };
21486
- RichTextService.prototype.initLib = function (appendScriptFunc, appendStyleFunc) {
21487
- this.richTextScript$ = rxjs.combineLatest([
21488
- this.http
21489
- .get(this.config.paths.richText + "/index.js", { responseType: 'text' })
21490
- .pipe(operators.tap(function (lib) { return appendScriptFunc(lib, 'rich-text-editor'); })),
21491
- this.http
21492
- .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21493
- .pipe(operators.tap(function (style) { return appendStyleFunc(style, 'tinymce-autocomplete'); }))
21494
- ]).pipe(operators.shareReplay(1));
21495
- };
21496
- RichTextService.ctorParameters = function () { return [
21497
- { type: http.HttpClient },
21498
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21499
- ]; };
21500
- RichTextService.ɵprov = core.ɵɵdefineInjectable({ factory: function RichTextService_Factory() { return new RichTextService(core.ɵɵinject(http.HttpClient), core.ɵɵinject(DATO_CORE_CONFIG)); }, token: RichTextService, providedIn: "root" });
21501
- RichTextService = __decorate([
21502
- core.Injectable({ providedIn: 'root' }),
21503
- __param(1, core.Inject(DATO_CORE_CONFIG)),
21504
- __metadata("design:paramtypes", [http.HttpClient, Object])
21505
- ], RichTextService);
21506
- return RichTextService;
21507
- }());
21508
-
21509
21453
  /**
21510
21454
  * @license
21511
21455
  * Copyright Datorama. All Rights Reserved.
@@ -21519,20 +21463,20 @@
21519
21463
  var ɵ0$3 = getTinymce;
21520
21464
  var DatoRichTextDirective = /** @class */ (function (_super) {
21521
21465
  __extends(DatoRichTextDirective, _super);
21522
- function DatoRichTextDirective(ngZone, richTextService, config, host) {
21466
+ function DatoRichTextDirective(ngZone, http, host, config) {
21523
21467
  var _this = _super.call(this) || this;
21524
21468
  _this.ngZone = ngZone;
21525
- _this.richTextService = richTextService;
21526
- _this.config = config;
21469
+ _this.http = http;
21527
21470
  _this.host = host;
21471
+ _this.config = config;
21528
21472
  _this.autocompleteOptions = {};
21529
21473
  _this.forcePlainTextPasting = false;
21530
21474
  _this.format = 'html';
21531
21475
  _this.isOneLine = false;
21532
21476
  _this.initialValue = '';
21533
- _this.defaultPlugins = 'link fullscreen image lists table autocomplete';
21477
+ _this.defaultPlugins = 'link fullscreen textcolor colorpicker image lists table textpattern autocomplete';
21534
21478
  _this.defaultToolbar = [
21535
- 'fontfamily fontsize forecolor backcolor bold italic underline link',
21479
+ 'fontselect fontsizeselect forecolor backcolor bold italic underline link',
21536
21480
  'alignleft aligncenter alignright alignjustify outdent indent | table numlist bullist | image fullscreen'
21537
21481
  ];
21538
21482
  return _this;
@@ -21558,11 +21502,28 @@
21558
21502
  base: this.config.paths.richText,
21559
21503
  query: ''
21560
21504
  };
21561
- this.richTextService
21562
- .getLib(appendScript, appendStyle)
21563
- .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
21564
- .subscribe(function () {
21565
- _this.init.call(_this);
21505
+ /**
21506
+ * We support only one instance in load time
21507
+ */
21508
+ if (window.tinymce) {
21509
+ this.init.call(this);
21510
+ }
21511
+ else {
21512
+ this.loadLib().subscribe(function (lib) {
21513
+ appendScript(lib, 'rich-text-editor');
21514
+ _this.init.call(_this);
21515
+ _this.loadAutoCompleteStyle();
21516
+ });
21517
+ }
21518
+ };
21519
+ DatoRichTextDirective.prototype.loadLib = function () {
21520
+ return this.http.get(this.config.paths.richText + "/index.js", { responseType: 'text' });
21521
+ };
21522
+ DatoRichTextDirective.prototype.loadAutoCompleteStyle = function () {
21523
+ this.http
21524
+ .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21525
+ .subscribe(function (style) {
21526
+ appendStyle(style, 'tinymce-autocomplete');
21566
21527
  });
21567
21528
  };
21568
21529
  DatoRichTextDirective.prototype.initEditor = function (_, editor) {
@@ -21586,6 +21547,8 @@
21586
21547
  target: this.host.nativeElement,
21587
21548
  width: this.width || 600,
21588
21549
  height: this.height || 300,
21550
+ force_br_newlines: true,
21551
+ force_p_newlines: false,
21589
21552
  resize: 'both',
21590
21553
  branding: false,
21591
21554
  inline: this.inline,
@@ -21593,12 +21556,10 @@
21593
21556
  readonly: this.disabled,
21594
21557
  plugins: this.plugins || this.defaultPlugins,
21595
21558
  toolbar: isNil(this.toolbar) ? this.defaultToolbar : this.toolbar,
21596
- font_size_formats: '8px 10px 12px 14px 18px 24px 36px',
21559
+ fontsize_formats: '8px 10px 12px 14px 18px 24px 36px',
21597
21560
  min_width: 480,
21598
21561
  menubar: false,
21599
21562
  autocomplete: this.autocompleteOptions,
21600
- suffix: '.min',
21601
- skin: 'tinymce-5',
21602
21563
  setup: function (editor) {
21603
21564
  _this.editor = editor;
21604
21565
  editor.on('init', function (e) {
@@ -21655,9 +21616,9 @@
21655
21616
  var DatoRichTextDirective_1;
21656
21617
  DatoRichTextDirective.ctorParameters = function () { return [
21657
21618
  { type: core.NgZone },
21658
- { type: RichTextService },
21659
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] },
21660
- { type: core.ElementRef }
21619
+ { type: http.HttpClient },
21620
+ { type: core.ElementRef },
21621
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21661
21622
  ]; };
21662
21623
  __decorate([
21663
21624
  core.Input(),
@@ -21723,9 +21684,10 @@
21723
21684
  }
21724
21685
  ]
21725
21686
  }),
21726
- __param(2, core.Inject(DATO_CORE_CONFIG)),
21687
+ __param(3, core.Inject(DATO_CORE_CONFIG)),
21727
21688
  __metadata("design:paramtypes", [core.NgZone,
21728
- RichTextService, Object, core.ElementRef])
21689
+ http.HttpClient,
21690
+ core.ElementRef, Object])
21729
21691
  ], DatoRichTextDirective);
21730
21692
  return DatoRichTextDirective;
21731
21693
  }(BaseCustomControl));
@@ -24248,9 +24210,7 @@
24248
24210
  };
24249
24211
  DatoBreadcrumbsComponent.prototype.initEditableHeader = function () {
24250
24212
  var _this = this;
24251
- this.headerControl.valueChanges
24252
- .pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this))
24253
- .subscribe(function (res) {
24213
+ this.headerControl.valueChanges.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (res) {
24254
24214
  _this.updateEditableText.emit(res);
24255
24215
  _this.cdr.detectChanges();
24256
24216
  });
@@ -25613,7 +25573,7 @@
25613
25573
  };
25614
25574
  }
25615
25575
 
25616
- window.coreVersion = '22.10.9-rc.';
25576
+ window.coreVersion = '22.11.0';
25617
25577
 
25618
25578
  exports.APP_TRANSLATE = APP_TRANSLATE;
25619
25579
  exports.AceService = AceService;
@@ -26055,7 +26015,6 @@
26055
26015
  exports.ɵl = DatoGridItemsCountCellComponent;
26056
26016
  exports.ɵm = DatoGridV2ToolbarMoreMenuComponent;
26057
26017
  exports.ɵn = DatoGridSearchBarComponent;
26058
- exports.ɵo = RichTextService;
26059
26018
 
26060
26019
  Object.defineProperty(exports, '__esModule', { value: true });
26061
26020