@datorama/core 22.0.4 → 22.0.5-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 (39) hide show
  1. package/bundles/datorama-core.umd.js +87 -51
  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 +3 -2
  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 +16 -16
  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 +3 -2
  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 +17 -16
  28. package/esm5/lib/version.js +2 -2
  29. package/fesm2015/datorama-core.js +78 -51
  30. package/fesm2015/datorama-core.js.map +1 -1
  31. package/fesm5/datorama-core.js +87 -52
  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/lib/select/select.component.d.ts +1 -0
  39. package/package.json +2 -2
@@ -8629,9 +8629,8 @@
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;
8633
8632
  this.markAsActive(this._model, { deselectAll: true });
8634
- overTheLimit && this.updateDisabledState();
8633
+ this.limitSelectedTo && this.updateDisabledState();
8635
8634
  }
8636
8635
  /** For later updates */
8637
8636
  this.cdr.markForCheck();
@@ -8668,7 +8667,7 @@
8668
8667
  */
8669
8668
  if (this.hasValue && this._initialOpen) {
8670
8669
  this.markAsActive(this._model);
8671
- if (this.limitSelectedTo && this._model.length === this.limitSelectedTo) {
8670
+ if (this.limitSelectedTo) {
8672
8671
  this.updateDisabledState();
8673
8672
  }
8674
8673
  this._initialOpen = false;
@@ -8748,8 +8747,8 @@
8748
8747
  }
8749
8748
  }
8750
8749
  this.onChange(this._model);
8751
- this.datoOverlay.scheduleUpdate();
8752
8750
  this.cdr.markForCheck();
8751
+ this.asyncUpdateDropdownPosition();
8753
8752
  };
8754
8753
  DatoSelectComponent.prototype.reorderOptions = function (newOrder) {
8755
8754
  this._model = newOrder;
@@ -8757,7 +8756,6 @@
8757
8756
  };
8758
8757
  DatoSelectComponent.prototype.removeOption = function (option) {
8759
8758
  var _this = this;
8760
- var updateDisabled = this.limitSelectedTo && this._model.length === this.limitSelectedTo;
8761
8759
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== option[_this.idKey]; });
8762
8760
  var optionToRemove = this.options.find(function (datoOption) { return datoOption.option && datoOption.option[_this.idKey] === option[_this.idKey]; });
8763
8761
  /**
@@ -8767,12 +8765,10 @@
8767
8765
  if (optionToRemove) {
8768
8766
  optionToRemove.active = false;
8769
8767
  }
8770
- updateDisabled && this.updateDisabledState();
8768
+ this.limitSelectedTo && this.updateDisabledState();
8771
8769
  this.onChange(this._model);
8772
8770
  this.cdr.markForCheck();
8773
- if (this.datoOverlay.attached) {
8774
- this.datoOverlay.scheduleUpdate();
8775
- }
8771
+ this.asyncUpdateDropdownPosition();
8776
8772
  };
8777
8773
  DatoSelectComponent.prototype.preventBodyScroll = function (event) {
8778
8774
  if (isArrowUpDown(event)) {
@@ -9027,7 +9023,7 @@
9027
9023
  _this.searchTerm = value;
9028
9024
  _this.keyManager.setActiveItem(-1);
9029
9025
  _this.cdr.markForCheck();
9030
- _this.datoOverlay && _this.datoOverlay.scheduleUpdate();
9026
+ _this.asyncUpdateDropdownPosition();
9031
9027
  });
9032
9028
  };
9033
9029
  /**
@@ -9117,9 +9113,6 @@
9117
9113
  if (!datoOption) {
9118
9114
  return;
9119
9115
  }
9120
- var modelLength = this._model.length;
9121
- var updateDisabled = this.limitSelectedTo &&
9122
- (modelLength === this.limitSelectedTo || (modelLength === this.limitSelectedTo - 1 && !datoOption.active));
9123
9116
  datoOption.active = !datoOption.active;
9124
9117
  var rawOption = datoOption.option;
9125
9118
  if (datoOption.active) {
@@ -9128,10 +9121,10 @@
9128
9121
  else {
9129
9122
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== rawOption[_this.idKey]; });
9130
9123
  }
9131
- updateDisabled && this.updateDisabledState();
9124
+ this.limitSelectedTo && this.updateDisabledState();
9132
9125
  this.onChange(this._model);
9133
9126
  this.cdr.markForCheck();
9134
- this.datoOverlay.scheduleUpdate();
9127
+ this.asyncUpdateDropdownPosition();
9135
9128
  };
9136
9129
  DatoSelectComponent.prototype.activateInfiniteScroll = function () {
9137
9130
  var _this = this;
@@ -9184,6 +9177,14 @@
9184
9177
  finally { if (e_9) throw e_9.error; }
9185
9178
  }
9186
9179
  };
9180
+ // Make sure the overlay will be update AFTER Change Detection was done
9181
+ // So the items in the input (and its height) is update
9182
+ DatoSelectComponent.prototype.asyncUpdateDropdownPosition = function () {
9183
+ var _this = this;
9184
+ if (this.datoOverlay && this.datoOverlay.attached) {
9185
+ setTimeout(function () { return _this.datoOverlay.scheduleUpdate(); }, 0);
9186
+ }
9187
+ };
9187
9188
  DatoSelectComponent.ctorParameters = function () { return [
9188
9189
  { type: core.ChangeDetectorRef },
9189
9190
  { type: DatoTranslateService },
@@ -12015,7 +12016,7 @@
12015
12016
  return contextActions;
12016
12017
  }
12017
12018
 
12018
- var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_API');
12019
+ var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_AP');
12019
12020
 
12020
12021
  var defaultEditableColumnRenderer = function (params) {
12021
12022
  return params && params.value ? "<div class=\"value-wrapper ellipsis\">" + params.value + "</div>" : null;
@@ -14466,7 +14467,8 @@
14466
14467
  this.updateSettings({ gridAlignment: gridAlignment, columnsSizes: null });
14467
14468
  };
14468
14469
  GridService.prototype.saveSettingsToServer = function (settings) {
14469
- this.storageAPI.set(this.gridName, settings);
14470
+ var isGlobal = this.gridQuery.getGridOptions().isGlobalSettings;
14471
+ this.storageAPI.set(this.gridName, settings, isGlobal);
14470
14472
  };
14471
14473
  /**
14472
14474
  * @internal used to log grid events to the platform's logging service
@@ -15464,7 +15466,10 @@
15464
15466
  .pipe(operators.switchMap(function () {
15465
15467
  _this.gridOptions = _this.normalizeOptions();
15466
15468
  agGrid.gridOptions = _this.gridOptions;
15467
- var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
15469
+ var isGlobal = _this.gridOptions.isGlobalSettings;
15470
+ var settingsLoader = _this.gridOptions.saveSettings === false
15471
+ ? rxjs.of(null)
15472
+ : _this.storageAPI.get(_this.gridOptions.gridName, isGlobal);
15468
15473
  return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
15469
15474
  }), ngxTakeUntilDestroy.untilDestroyed(this))
15470
15475
  .subscribe(function (_a) {
@@ -16739,6 +16744,18 @@
16739
16744
  this.registerGroupListeners();
16740
16745
  this.subscribeRowsSelectionData();
16741
16746
  };
16747
+ DatoGridV2ToolbarComponent.prototype.getCellValueChangeEvent = function () {
16748
+ var _this = this;
16749
+ return this.gridController.gridQuery.waitForGrid(function () {
16750
+ return _this.gridQuery.gridRef.cellValueChanged.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16751
+ });
16752
+ };
16753
+ DatoGridV2ToolbarComponent.prototype.getRowDataUpdatedEvent = function () {
16754
+ var _this = this;
16755
+ return this.gridController.gridQuery.waitForGrid(function () {
16756
+ return _this.gridQuery.gridRef.rowDataUpdated.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16757
+ });
16758
+ };
16742
16759
  DatoGridV2ToolbarComponent.prototype.onActionClick = function (action) {
16743
16760
  if (isFunction(action.onClick)) {
16744
16761
  var selectedRowsCount = this.gridController.gridQuery.getSelectedRowsCount();
@@ -21214,6 +21231,40 @@
21214
21231
  * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
21215
21232
  */
21216
21233
 
21234
+ var RichTextService = /** @class */ (function () {
21235
+ function RichTextService(http, config) {
21236
+ this.http = http;
21237
+ this.config = config;
21238
+ }
21239
+ RichTextService.prototype.getLib = function (appendScriptFunc, appendStyleFunc) {
21240
+ if (!this.richTextScript$) {
21241
+ this.initLib(appendScriptFunc, appendStyleFunc);
21242
+ }
21243
+ return this.richTextScript$;
21244
+ };
21245
+ RichTextService.prototype.initLib = function (appendScriptFunc, appendStyleFunc) {
21246
+ this.richTextScript$ = rxjs.combineLatest([
21247
+ this.http
21248
+ .get(this.config.paths.richText + "/index.js", { responseType: 'text' })
21249
+ .pipe(operators.tap(function (lib) { return appendScriptFunc(lib, 'rich-text-editor'); })),
21250
+ this.http
21251
+ .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21252
+ .pipe(operators.tap(function (style) { return appendStyleFunc(style, 'tinymce-autocomplete'); }))
21253
+ ]).pipe(operators.shareReplay(1));
21254
+ };
21255
+ RichTextService.ctorParameters = function () { return [
21256
+ { type: http.HttpClient },
21257
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21258
+ ]; };
21259
+ RichTextService.ɵprov = core.ɵɵdefineInjectable({ factory: function RichTextService_Factory() { return new RichTextService(core.ɵɵinject(http.HttpClient), core.ɵɵinject(DATO_CORE_CONFIG)); }, token: RichTextService, providedIn: "root" });
21260
+ RichTextService = __decorate([
21261
+ core.Injectable({ providedIn: 'root' }),
21262
+ __param(1, core.Inject(DATO_CORE_CONFIG)),
21263
+ __metadata("design:paramtypes", [http.HttpClient, Object])
21264
+ ], RichTextService);
21265
+ return RichTextService;
21266
+ }());
21267
+
21217
21268
  /**
21218
21269
  * @license
21219
21270
  * Copyright Datorama. All Rights Reserved.
@@ -21227,12 +21278,12 @@
21227
21278
  var ɵ0$3 = getTinymce;
21228
21279
  var DatoRichTextDirective = /** @class */ (function (_super) {
21229
21280
  __extends(DatoRichTextDirective, _super);
21230
- function DatoRichTextDirective(ngZone, http, host, config) {
21281
+ function DatoRichTextDirective(ngZone, richTextService, config, host) {
21231
21282
  var _this = _super.call(this) || this;
21232
21283
  _this.ngZone = ngZone;
21233
- _this.http = http;
21234
- _this.host = host;
21284
+ _this.richTextService = richTextService;
21235
21285
  _this.config = config;
21286
+ _this.host = host;
21236
21287
  _this.autocompleteOptions = {};
21237
21288
  _this.forcePlainTextPasting = false;
21238
21289
  _this.format = 'html';
@@ -21266,28 +21317,11 @@
21266
21317
  base: this.config.paths.richText,
21267
21318
  query: ''
21268
21319
  };
21269
- /**
21270
- * We support only one instance in load time
21271
- */
21272
- if (window.tinymce) {
21273
- this.init.call(this);
21274
- }
21275
- else {
21276
- this.loadLib().subscribe(function (lib) {
21277
- appendScript(lib, 'rich-text-editor');
21278
- _this.init.call(_this);
21279
- _this.loadAutoCompleteStyle();
21280
- });
21281
- }
21282
- };
21283
- DatoRichTextDirective.prototype.loadLib = function () {
21284
- return this.http.get(this.config.paths.richText + "/index.js", { responseType: 'text' });
21285
- };
21286
- DatoRichTextDirective.prototype.loadAutoCompleteStyle = function () {
21287
- this.http
21288
- .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21289
- .subscribe(function (style) {
21290
- appendStyle(style, 'tinymce-autocomplete');
21320
+ this.richTextService
21321
+ .getLib(appendScript, appendStyle)
21322
+ .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
21323
+ .subscribe(function () {
21324
+ _this.init.call(_this);
21291
21325
  });
21292
21326
  };
21293
21327
  DatoRichTextDirective.prototype.initEditor = function (_, editor) {
@@ -21380,9 +21414,9 @@
21380
21414
  var DatoRichTextDirective_1;
21381
21415
  DatoRichTextDirective.ctorParameters = function () { return [
21382
21416
  { type: core.NgZone },
21383
- { type: http.HttpClient },
21384
- { type: core.ElementRef },
21385
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21417
+ { type: RichTextService },
21418
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] },
21419
+ { type: core.ElementRef }
21386
21420
  ]; };
21387
21421
  __decorate([
21388
21422
  core.Input(),
@@ -21448,10 +21482,9 @@
21448
21482
  }
21449
21483
  ]
21450
21484
  }),
21451
- __param(3, core.Inject(DATO_CORE_CONFIG)),
21485
+ __param(2, core.Inject(DATO_CORE_CONFIG)),
21452
21486
  __metadata("design:paramtypes", [core.NgZone,
21453
- http.HttpClient,
21454
- core.ElementRef, Object])
21487
+ RichTextService, Object, core.ElementRef])
21455
21488
  ], DatoRichTextDirective);
21456
21489
  return DatoRichTextDirective;
21457
21490
  }(BaseCustomControl));
@@ -23974,7 +24007,9 @@
23974
24007
  };
23975
24008
  DatoBreadcrumbsComponent.prototype.initEditableHeader = function () {
23976
24009
  var _this = this;
23977
- this.headerControl.valueChanges.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (res) {
24010
+ this.headerControl.valueChanges
24011
+ .pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this))
24012
+ .subscribe(function (res) {
23978
24013
  _this.updateEditableText.emit(res);
23979
24014
  _this.cdr.detectChanges();
23980
24015
  });
@@ -25337,7 +25372,7 @@
25337
25372
  };
25338
25373
  }
25339
25374
 
25340
- window.coreVersion = '22.0.4';
25375
+ window.coreVersion = '22.1.4-rc.';
25341
25376
 
25342
25377
  exports.APP_TRANSLATE = APP_TRANSLATE;
25343
25378
  exports.AceService = AceService;
@@ -25779,6 +25814,7 @@
25779
25814
  exports.ɵl = DatoGridItemsCountCellComponent;
25780
25815
  exports.ɵm = DatoGridV2ToolbarMoreMenuComponent;
25781
25816
  exports.ɵn = DatoGridSearchBarComponent;
25817
+ exports.ɵo = RichTextService;
25782
25818
 
25783
25819
  Object.defineProperty(exports, '__esModule', { value: true });
25784
25820