@datorama/core 22.0.4-rc.3 → 22.0.4

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 +45 -75
  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 +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 +2 -5
  11. package/esm2015/lib/grid-v2/grid-settings.js +2 -2
  12. package/esm2015/lib/grid-v2/grid-store/grid.service.js +2 -3
  13. package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -7
  14. package/esm2015/lib/rich-text/rich-text.directive.js +33 -15
  15. package/esm2015/lib/select/select.component.js +10 -5
  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 +2 -5
  21. package/esm5/lib/grid-v2/grid-settings.js +2 -2
  22. package/esm5/lib/grid-v2/grid-store/grid.service.js +2 -3
  23. package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -13
  24. package/esm5/lib/rich-text/rich-text.directive.js +34 -16
  25. package/esm5/lib/select/select.component.js +10 -5
  26. package/esm5/lib/version.js +2 -2
  27. package/fesm2015/datorama-core.js +45 -67
  28. package/fesm2015/datorama-core.js.map +1 -1
  29. package/fesm5/datorama-core.js +46 -75
  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-settings.d.ts +2 -2
  33. package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +0 -2
  34. package/lib/rich-text/rich-text.directive.d.ts +6 -4
  35. package/package.json +2 -2
  36. package/esm2015/lib/rich-text/rich-text.service.js +0 -50
  37. package/esm5/lib/rich-text/rich-text.service.js +0 -51
  38. package/lib/rich-text/rich-text.service.d.ts +0 -10
@@ -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();
@@ -12010,7 +12015,7 @@
12010
12015
  return contextActions;
12011
12016
  }
12012
12017
 
12013
- var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_AP');
12018
+ var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_API');
12014
12019
 
12015
12020
  var defaultEditableColumnRenderer = function (params) {
12016
12021
  return params && params.value ? "<div class=\"value-wrapper ellipsis\">" + params.value + "</div>" : null;
@@ -14461,8 +14466,7 @@
14461
14466
  this.updateSettings({ gridAlignment: gridAlignment, columnsSizes: null });
14462
14467
  };
14463
14468
  GridService.prototype.saveSettingsToServer = function (settings) {
14464
- var isGlobal = this.gridQuery.getGridOptions().isGlobalSettings;
14465
- this.storageAPI.set(this.gridName, settings, isGlobal);
14469
+ this.storageAPI.set(this.gridName, settings);
14466
14470
  };
14467
14471
  /**
14468
14472
  * @internal used to log grid events to the platform's logging service
@@ -15460,10 +15464,7 @@
15460
15464
  .pipe(operators.switchMap(function () {
15461
15465
  _this.gridOptions = _this.normalizeOptions();
15462
15466
  agGrid.gridOptions = _this.gridOptions;
15463
- var isGlobal = _this.gridOptions.isGlobalSettings;
15464
- var settingsLoader = _this.gridOptions.saveSettings === false
15465
- ? rxjs.of(null)
15466
- : _this.storageAPI.get(_this.gridOptions.gridName, isGlobal);
15467
+ var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
15467
15468
  return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
15468
15469
  }), ngxTakeUntilDestroy.untilDestroyed(this))
15469
15470
  .subscribe(function (_a) {
@@ -16738,18 +16739,6 @@
16738
16739
  this.registerGroupListeners();
16739
16740
  this.subscribeRowsSelectionData();
16740
16741
  };
16741
- DatoGridV2ToolbarComponent.prototype.getCellValueChangeEvent = function () {
16742
- var _this = this;
16743
- return this.gridController.gridQuery.waitForGrid(function () {
16744
- return _this.gridQuery.gridRef.cellValueChanged.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16745
- });
16746
- };
16747
- DatoGridV2ToolbarComponent.prototype.getRowDataUpdatedEvent = function () {
16748
- var _this = this;
16749
- return this.gridController.gridQuery.waitForGrid(function () {
16750
- return _this.gridQuery.gridRef.rowDataUpdated.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16751
- });
16752
- };
16753
16742
  DatoGridV2ToolbarComponent.prototype.onActionClick = function (action) {
16754
16743
  if (isFunction(action.onClick)) {
16755
16744
  var selectedRowsCount = this.gridController.gridQuery.getSelectedRowsCount();
@@ -21225,40 +21214,6 @@
21225
21214
  * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
21226
21215
  */
21227
21216
 
21228
- var RichTextService = /** @class */ (function () {
21229
- function RichTextService(http, config) {
21230
- this.http = http;
21231
- this.config = config;
21232
- }
21233
- RichTextService.prototype.getLib = function (appendScriptFunc, appendStyleFunc) {
21234
- if (!this.richTextScript$) {
21235
- this.initLib(appendScriptFunc, appendStyleFunc);
21236
- }
21237
- return this.richTextScript$;
21238
- };
21239
- RichTextService.prototype.initLib = function (appendScriptFunc, appendStyleFunc) {
21240
- this.richTextScript$ = rxjs.combineLatest([
21241
- this.http
21242
- .get(this.config.paths.richText + "/index.js", { responseType: 'text' })
21243
- .pipe(operators.tap(function (lib) { return appendScriptFunc(lib, 'rich-text-editor'); })),
21244
- this.http
21245
- .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21246
- .pipe(operators.tap(function (style) { return appendStyleFunc(style, 'tinymce-autocomplete'); }))
21247
- ]).pipe(operators.shareReplay(1));
21248
- };
21249
- RichTextService.ctorParameters = function () { return [
21250
- { type: http.HttpClient },
21251
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21252
- ]; };
21253
- RichTextService.ɵprov = core.ɵɵdefineInjectable({ factory: function RichTextService_Factory() { return new RichTextService(core.ɵɵinject(http.HttpClient), core.ɵɵinject(DATO_CORE_CONFIG)); }, token: RichTextService, providedIn: "root" });
21254
- RichTextService = __decorate([
21255
- core.Injectable({ providedIn: 'root' }),
21256
- __param(1, core.Inject(DATO_CORE_CONFIG)),
21257
- __metadata("design:paramtypes", [http.HttpClient, Object])
21258
- ], RichTextService);
21259
- return RichTextService;
21260
- }());
21261
-
21262
21217
  /**
21263
21218
  * @license
21264
21219
  * Copyright Datorama. All Rights Reserved.
@@ -21272,12 +21227,12 @@
21272
21227
  var ɵ0$3 = getTinymce;
21273
21228
  var DatoRichTextDirective = /** @class */ (function (_super) {
21274
21229
  __extends(DatoRichTextDirective, _super);
21275
- function DatoRichTextDirective(ngZone, richTextService, config, host) {
21230
+ function DatoRichTextDirective(ngZone, http, host, config) {
21276
21231
  var _this = _super.call(this) || this;
21277
21232
  _this.ngZone = ngZone;
21278
- _this.richTextService = richTextService;
21279
- _this.config = config;
21233
+ _this.http = http;
21280
21234
  _this.host = host;
21235
+ _this.config = config;
21281
21236
  _this.autocompleteOptions = {};
21282
21237
  _this.forcePlainTextPasting = false;
21283
21238
  _this.format = 'html';
@@ -21311,11 +21266,28 @@
21311
21266
  base: this.config.paths.richText,
21312
21267
  query: ''
21313
21268
  };
21314
- this.richTextService
21315
- .getLib(appendScript, appendStyle)
21316
- .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
21317
- .subscribe(function () {
21318
- _this.init.call(_this);
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');
21319
21291
  });
21320
21292
  };
21321
21293
  DatoRichTextDirective.prototype.initEditor = function (_, editor) {
@@ -21408,9 +21380,9 @@
21408
21380
  var DatoRichTextDirective_1;
21409
21381
  DatoRichTextDirective.ctorParameters = function () { return [
21410
21382
  { type: core.NgZone },
21411
- { type: RichTextService },
21412
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] },
21413
- { type: core.ElementRef }
21383
+ { type: http.HttpClient },
21384
+ { type: core.ElementRef },
21385
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21414
21386
  ]; };
21415
21387
  __decorate([
21416
21388
  core.Input(),
@@ -21476,9 +21448,10 @@
21476
21448
  }
21477
21449
  ]
21478
21450
  }),
21479
- __param(2, core.Inject(DATO_CORE_CONFIG)),
21451
+ __param(3, core.Inject(DATO_CORE_CONFIG)),
21480
21452
  __metadata("design:paramtypes", [core.NgZone,
21481
- RichTextService, Object, core.ElementRef])
21453
+ http.HttpClient,
21454
+ core.ElementRef, Object])
21482
21455
  ], DatoRichTextDirective);
21483
21456
  return DatoRichTextDirective;
21484
21457
  }(BaseCustomControl));
@@ -24001,9 +23974,7 @@
24001
23974
  };
24002
23975
  DatoBreadcrumbsComponent.prototype.initEditableHeader = function () {
24003
23976
  var _this = this;
24004
- this.headerControl.valueChanges
24005
- .pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this))
24006
- .subscribe(function (res) {
23977
+ this.headerControl.valueChanges.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (res) {
24007
23978
  _this.updateEditableText.emit(res);
24008
23979
  _this.cdr.detectChanges();
24009
23980
  });
@@ -25366,7 +25337,7 @@
25366
25337
  };
25367
25338
  }
25368
25339
 
25369
- window.coreVersion = '22.1.3-rc.';
25340
+ window.coreVersion = '22.0.4';
25370
25341
 
25371
25342
  exports.APP_TRANSLATE = APP_TRANSLATE;
25372
25343
  exports.AceService = AceService;
@@ -25808,7 +25779,6 @@
25808
25779
  exports.ɵl = DatoGridItemsCountCellComponent;
25809
25780
  exports.ɵm = DatoGridV2ToolbarMoreMenuComponent;
25810
25781
  exports.ɵn = DatoGridSearchBarComponent;
25811
- exports.ɵo = RichTextService;
25812
25782
 
25813
25783
  Object.defineProperty(exports, '__esModule', { value: true });
25814
25784