@datorama/core 22.7.1 → 22.8.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.
Files changed (38) hide show
  1. package/bundles/datorama-core.umd.js +77 -46
  2. package/bundles/datorama-core.umd.js.map +1 -1
  3. package/bundles/datorama-core.umd.min.js +14 -14
  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 +1 -1
  10. package/esm2015/lib/grid-v2/grid-controller/grid-controller.component.js +5 -2
  11. package/esm2015/lib/grid-v2/grid-settings.js +2 -2
  12. package/esm2015/lib/grid-v2/grid-store/grid.service.js +5 -3
  13. package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +7 -1
  14. package/esm2015/lib/rich-text/rich-text.directive.js +15 -33
  15. package/esm2015/lib/rich-text/rich-text.service.js +50 -0
  16. package/esm2015/lib/select/select.component.js +5 -10
  17. package/esm2015/lib/version.js +2 -2
  18. package/esm5/datorama-core.js +2 -1
  19. package/esm5/lib/breadcrumbs/breadcrumbs.component.js +4 -2
  20. package/esm5/lib/grid-v2/grid/grid-v2.types.js +1 -1
  21. package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +5 -2
  22. package/esm5/lib/grid-v2/grid-settings.js +2 -2
  23. package/esm5/lib/grid-v2/grid-store/grid.service.js +5 -3
  24. package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +13 -1
  25. package/esm5/lib/rich-text/rich-text.directive.js +16 -34
  26. package/esm5/lib/rich-text/rich-text.service.js +51 -0
  27. package/esm5/lib/select/select.component.js +5 -10
  28. package/esm5/lib/version.js +2 -2
  29. package/fesm2015/datorama-core.js +69 -46
  30. package/fesm2015/datorama-core.js.map +1 -1
  31. package/fesm5/datorama-core.js +77 -47
  32. package/fesm5/datorama-core.js.map +1 -1
  33. package/lib/grid-v2/grid/grid-v2.types.d.ts +1 -0
  34. package/lib/grid-v2/grid-settings.d.ts +2 -2
  35. package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +2 -0
  36. package/lib/rich-text/rich-text.directive.d.ts +4 -6
  37. package/lib/rich-text/rich-text.service.d.ts +10 -0
  38. package/package.json +1 -1
@@ -8748,9 +8748,8 @@
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;
8752
8751
  this.markAsActive(this._model, { deselectAll: true });
8753
- overTheLimit && this.updateDisabledState();
8752
+ this.limitSelectedTo && this.updateDisabledState();
8754
8753
  }
8755
8754
  /** For later updates */
8756
8755
  this.cdr.markForCheck();
@@ -8787,7 +8786,7 @@
8787
8786
  */
8788
8787
  if (this.hasValue && this._initialOpen) {
8789
8788
  this.markAsActive(this._model);
8790
- if (this.limitSelectedTo && this._model.length === this.limitSelectedTo) {
8789
+ if (this.limitSelectedTo) {
8791
8790
  this.updateDisabledState();
8792
8791
  }
8793
8792
  this._initialOpen = false;
@@ -8876,7 +8875,6 @@
8876
8875
  };
8877
8876
  DatoSelectComponent.prototype.removeOption = function (option) {
8878
8877
  var _this = this;
8879
- var updateDisabled = this.limitSelectedTo && this._model.length === this.limitSelectedTo;
8880
8878
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== option[_this.idKey]; });
8881
8879
  var optionToRemove = this.options.find(function (datoOption) { return datoOption.option && datoOption.option[_this.idKey] === option[_this.idKey]; });
8882
8880
  /**
@@ -8886,7 +8884,7 @@
8886
8884
  if (optionToRemove) {
8887
8885
  optionToRemove.active = false;
8888
8886
  }
8889
- updateDisabled && this.updateDisabledState();
8887
+ this.limitSelectedTo && this.updateDisabledState();
8890
8888
  this.onChange(this._model);
8891
8889
  this.cdr.markForCheck();
8892
8890
  this.asyncUpdateDropdownPosition();
@@ -9234,9 +9232,6 @@
9234
9232
  if (!datoOption) {
9235
9233
  return;
9236
9234
  }
9237
- var modelLength = this._model.length;
9238
- var updateDisabled = this.limitSelectedTo &&
9239
- (modelLength === this.limitSelectedTo || (modelLength === this.limitSelectedTo - 1 && !datoOption.active));
9240
9235
  datoOption.active = !datoOption.active;
9241
9236
  var rawOption = datoOption.option;
9242
9237
  if (datoOption.active) {
@@ -9245,7 +9240,7 @@
9245
9240
  else {
9246
9241
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== rawOption[_this.idKey]; });
9247
9242
  }
9248
- updateDisabled && this.updateDisabledState();
9243
+ this.limitSelectedTo && this.updateDisabledState();
9249
9244
  this.onChange(this._model);
9250
9245
  this.cdr.markForCheck();
9251
9246
  this.asyncUpdateDropdownPosition();
@@ -12048,7 +12043,7 @@
12048
12043
  return contextActions;
12049
12044
  }
12050
12045
 
12051
- var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_API');
12046
+ var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_AP');
12052
12047
 
12053
12048
  var defaultEditableColumnRenderer = function (params) {
12054
12049
  return params && params.value ? "<div class=\"value-wrapper ellipsis\">" + params.value + "</div>" : null;
@@ -14477,7 +14472,8 @@
14477
14472
  if (isPivotColId || valueColumn) {
14478
14473
  /** Column is pivot value column, sort by index */
14479
14474
  var columnByIndex = gridColumns[sortIndex];
14480
- if (columnByIndex) {
14475
+ var valueColumnId = columnByIndex && columnByIndex.getColDef().pivotValueColumn.getColId();
14476
+ if (valueColumnId === colId_1) {
14481
14477
  sortToApply = { colId: columnByIndex.getColId(), sort: sort };
14482
14478
  }
14483
14479
  }
@@ -14551,7 +14547,8 @@
14551
14547
  this.updateSettings({ gridAlignment: gridAlignment, columnsSizes: null });
14552
14548
  };
14553
14549
  GridService.prototype.saveSettingsToServer = function (settings) {
14554
- this.storageAPI.set(this.gridName, settings);
14550
+ var isGlobal = this.gridQuery.getGridOptions().isGlobalSettings;
14551
+ this.storageAPI.set(this.gridName, settings, isGlobal);
14555
14552
  };
14556
14553
  /**
14557
14554
  * @internal used to log grid events to the platform's logging service
@@ -15556,7 +15553,10 @@
15556
15553
  .pipe(operators.switchMap(function () {
15557
15554
  _this.gridOptions = _this.normalizeOptions();
15558
15555
  agGrid.gridOptions = _this.gridOptions;
15559
- var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
15556
+ var isGlobal = _this.gridOptions.isGlobalSettings;
15557
+ var settingsLoader = _this.gridOptions.saveSettings === false
15558
+ ? rxjs.of(null)
15559
+ : _this.storageAPI.get(_this.gridOptions.gridName, isGlobal);
15560
15560
  return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
15561
15561
  }), ngxTakeUntilDestroy.untilDestroyed(this))
15562
15562
  .subscribe(function (_a) {
@@ -16838,6 +16838,18 @@
16838
16838
  this.registerGroupListeners();
16839
16839
  this.subscribeRowsSelectionData();
16840
16840
  };
16841
+ DatoGridV2ToolbarComponent.prototype.getCellValueChangeEvent = function () {
16842
+ var _this = this;
16843
+ return this.gridController.gridQuery.waitForGrid(function () {
16844
+ return _this.gridQuery.gridRef.cellValueChanged.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16845
+ });
16846
+ };
16847
+ DatoGridV2ToolbarComponent.prototype.getRowDataUpdatedEvent = function () {
16848
+ var _this = this;
16849
+ return this.gridController.gridQuery.waitForGrid(function () {
16850
+ return _this.gridQuery.gridRef.rowDataUpdated.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16851
+ });
16852
+ };
16841
16853
  DatoGridV2ToolbarComponent.prototype.onActionClick = function (action) {
16842
16854
  if (isFunction(action.onClick)) {
16843
16855
  var selectedRowsCount = this.gridController.gridQuery.getSelectedRowsCount();
@@ -21313,6 +21325,40 @@
21313
21325
  * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
21314
21326
  */
21315
21327
 
21328
+ var RichTextService = /** @class */ (function () {
21329
+ function RichTextService(http, config) {
21330
+ this.http = http;
21331
+ this.config = config;
21332
+ }
21333
+ RichTextService.prototype.getLib = function (appendScriptFunc, appendStyleFunc) {
21334
+ if (!this.richTextScript$) {
21335
+ this.initLib(appendScriptFunc, appendStyleFunc);
21336
+ }
21337
+ return this.richTextScript$;
21338
+ };
21339
+ RichTextService.prototype.initLib = function (appendScriptFunc, appendStyleFunc) {
21340
+ this.richTextScript$ = rxjs.combineLatest([
21341
+ this.http
21342
+ .get(this.config.paths.richText + "/index.js", { responseType: 'text' })
21343
+ .pipe(operators.tap(function (lib) { return appendScriptFunc(lib, 'rich-text-editor'); })),
21344
+ this.http
21345
+ .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21346
+ .pipe(operators.tap(function (style) { return appendStyleFunc(style, 'tinymce-autocomplete'); }))
21347
+ ]).pipe(operators.shareReplay(1));
21348
+ };
21349
+ RichTextService.ctorParameters = function () { return [
21350
+ { type: http.HttpClient },
21351
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21352
+ ]; };
21353
+ RichTextService.ɵprov = core.ɵɵdefineInjectable({ factory: function RichTextService_Factory() { return new RichTextService(core.ɵɵinject(http.HttpClient), core.ɵɵinject(DATO_CORE_CONFIG)); }, token: RichTextService, providedIn: "root" });
21354
+ RichTextService = __decorate([
21355
+ core.Injectable({ providedIn: 'root' }),
21356
+ __param(1, core.Inject(DATO_CORE_CONFIG)),
21357
+ __metadata("design:paramtypes", [http.HttpClient, Object])
21358
+ ], RichTextService);
21359
+ return RichTextService;
21360
+ }());
21361
+
21316
21362
  /**
21317
21363
  * @license
21318
21364
  * Copyright Datorama. All Rights Reserved.
@@ -21326,12 +21372,12 @@
21326
21372
  var ɵ0$3 = getTinymce;
21327
21373
  var DatoRichTextDirective = /** @class */ (function (_super) {
21328
21374
  __extends(DatoRichTextDirective, _super);
21329
- function DatoRichTextDirective(ngZone, http, host, config) {
21375
+ function DatoRichTextDirective(ngZone, richTextService, config, host) {
21330
21376
  var _this = _super.call(this) || this;
21331
21377
  _this.ngZone = ngZone;
21332
- _this.http = http;
21333
- _this.host = host;
21378
+ _this.richTextService = richTextService;
21334
21379
  _this.config = config;
21380
+ _this.host = host;
21335
21381
  _this.autocompleteOptions = {};
21336
21382
  _this.forcePlainTextPasting = false;
21337
21383
  _this.format = 'html';
@@ -21365,28 +21411,11 @@
21365
21411
  base: this.config.paths.richText,
21366
21412
  query: ''
21367
21413
  };
21368
- /**
21369
- * We support only one instance in load time
21370
- */
21371
- if (window.tinymce) {
21372
- this.init.call(this);
21373
- }
21374
- else {
21375
- this.loadLib().subscribe(function (lib) {
21376
- appendScript(lib, 'rich-text-editor');
21377
- _this.init.call(_this);
21378
- _this.loadAutoCompleteStyle();
21379
- });
21380
- }
21381
- };
21382
- DatoRichTextDirective.prototype.loadLib = function () {
21383
- return this.http.get(this.config.paths.richText + "/index.js", { responseType: 'text' });
21384
- };
21385
- DatoRichTextDirective.prototype.loadAutoCompleteStyle = function () {
21386
- this.http
21387
- .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21388
- .subscribe(function (style) {
21389
- appendStyle(style, 'tinymce-autocomplete');
21414
+ this.richTextService
21415
+ .getLib(appendScript, appendStyle)
21416
+ .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
21417
+ .subscribe(function () {
21418
+ _this.init.call(_this);
21390
21419
  });
21391
21420
  };
21392
21421
  DatoRichTextDirective.prototype.initEditor = function (_, editor) {
@@ -21479,9 +21508,9 @@
21479
21508
  var DatoRichTextDirective_1;
21480
21509
  DatoRichTextDirective.ctorParameters = function () { return [
21481
21510
  { type: core.NgZone },
21482
- { type: http.HttpClient },
21483
- { type: core.ElementRef },
21484
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21511
+ { type: RichTextService },
21512
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] },
21513
+ { type: core.ElementRef }
21485
21514
  ]; };
21486
21515
  __decorate([
21487
21516
  core.Input(),
@@ -21547,10 +21576,9 @@
21547
21576
  }
21548
21577
  ]
21549
21578
  }),
21550
- __param(3, core.Inject(DATO_CORE_CONFIG)),
21579
+ __param(2, core.Inject(DATO_CORE_CONFIG)),
21551
21580
  __metadata("design:paramtypes", [core.NgZone,
21552
- http.HttpClient,
21553
- core.ElementRef, Object])
21581
+ RichTextService, Object, core.ElementRef])
21554
21582
  ], DatoRichTextDirective);
21555
21583
  return DatoRichTextDirective;
21556
21584
  }(BaseCustomControl));
@@ -24073,7 +24101,9 @@
24073
24101
  };
24074
24102
  DatoBreadcrumbsComponent.prototype.initEditableHeader = function () {
24075
24103
  var _this = this;
24076
- this.headerControl.valueChanges.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (res) {
24104
+ this.headerControl.valueChanges
24105
+ .pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this))
24106
+ .subscribe(function (res) {
24077
24107
  _this.updateEditableText.emit(res);
24078
24108
  _this.cdr.detectChanges();
24079
24109
  });
@@ -25436,7 +25466,7 @@
25436
25466
  };
25437
25467
  }
25438
25468
 
25439
- window.coreVersion = '22.7.1';
25469
+ window.coreVersion = '22.8.1-rc.';
25440
25470
 
25441
25471
  exports.APP_TRANSLATE = APP_TRANSLATE;
25442
25472
  exports.AceService = AceService;
@@ -25878,6 +25908,7 @@
25878
25908
  exports.ɵl = DatoGridItemsCountCellComponent;
25879
25909
  exports.ɵm = DatoGridV2ToolbarMoreMenuComponent;
25880
25910
  exports.ɵn = DatoGridSearchBarComponent;
25911
+ exports.ɵo = RichTextService;
25881
25912
 
25882
25913
  Object.defineProperty(exports, '__esModule', { value: true });
25883
25914