@datorama/core 22.9.3 → 22.10.3-rc.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 (38) hide show
  1. package/bundles/datorama-core.umd.js +89 -57
  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 +20 -38
  15. package/esm2015/lib/rich-text/rich-text.service.js +50 -0
  16. package/esm2015/lib/select/select.component.js +14 -17
  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 +21 -39
  26. package/esm5/lib/rich-text/rich-text.service.js +51 -0
  27. package/esm5/lib/select/select.component.js +14 -17
  28. package/esm5/lib/version.js +2 -2
  29. package/fesm2015/datorama-core.js +81 -57
  30. package/fesm2015/datorama-core.js.map +1 -1
  31. package/fesm5/datorama-core.js +89 -58
  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();
@@ -8781,16 +8780,18 @@
8781
8780
  });
8782
8781
  this.datoOverlay.attach({ placement: this.placement }, this._dropdownClass);
8783
8782
  this.toggle();
8784
- /**
8785
- * When we first open the dropdown we need to mark the
8786
- * FormControl values as actives
8787
- */
8788
- if (this.hasValue && this._initialOpen) {
8789
- this.markAsActive(this._model);
8790
- if (this.limitSelectedTo && this._model.length === this.limitSelectedTo) {
8783
+ if (this.hasValue) {
8784
+ /**
8785
+ * When we first open the dropdown we need to mark the
8786
+ * FormControl values as actives
8787
+ */
8788
+ if (this._initialOpen) {
8789
+ this.markAsActive(this._model);
8790
+ this._initialOpen = false;
8791
+ }
8792
+ if (this.limitSelectedTo) {
8791
8793
  this.updateDisabledState();
8792
8794
  }
8793
- this._initialOpen = false;
8794
8795
  }
8795
8796
  if (this._withInfiniteScroll) {
8796
8797
  this.activateInfiniteScroll();
@@ -8876,7 +8877,6 @@
8876
8877
  };
8877
8878
  DatoSelectComponent.prototype.removeOption = function (option) {
8878
8879
  var _this = this;
8879
- var updateDisabled = this.limitSelectedTo && this._model.length === this.limitSelectedTo;
8880
8880
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== option[_this.idKey]; });
8881
8881
  var optionToRemove = this.options.find(function (datoOption) { return datoOption.option && datoOption.option[_this.idKey] === option[_this.idKey]; });
8882
8882
  /**
@@ -8886,7 +8886,7 @@
8886
8886
  if (optionToRemove) {
8887
8887
  optionToRemove.active = false;
8888
8888
  }
8889
- updateDisabled && this.updateDisabledState();
8889
+ this.limitSelectedTo && this.updateDisabledState();
8890
8890
  this.onChange(this._model);
8891
8891
  this.cdr.markForCheck();
8892
8892
  this.asyncUpdateDropdownPosition();
@@ -9234,9 +9234,6 @@
9234
9234
  if (!datoOption) {
9235
9235
  return;
9236
9236
  }
9237
- var modelLength = this._model.length;
9238
- var updateDisabled = this.limitSelectedTo &&
9239
- (modelLength === this.limitSelectedTo || (modelLength === this.limitSelectedTo - 1 && !datoOption.active));
9240
9237
  datoOption.active = !datoOption.active;
9241
9238
  var rawOption = datoOption.option;
9242
9239
  if (datoOption.active) {
@@ -9245,7 +9242,7 @@
9245
9242
  else {
9246
9243
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== rawOption[_this.idKey]; });
9247
9244
  }
9248
- updateDisabled && this.updateDisabledState();
9245
+ this.limitSelectedTo && this.updateDisabledState();
9249
9246
  this.onChange(this._model);
9250
9247
  this.cdr.markForCheck();
9251
9248
  this.asyncUpdateDropdownPosition();
@@ -12050,7 +12047,7 @@
12050
12047
  return contextActions;
12051
12048
  }
12052
12049
 
12053
- var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_API');
12050
+ var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_AP');
12054
12051
 
12055
12052
  var defaultEditableColumnRenderer = function (params) {
12056
12053
  return params && params.value ? "<div class=\"value-wrapper ellipsis\">" + params.value + "</div>" : null;
@@ -14582,7 +14579,8 @@
14582
14579
  this.updateSettings({ gridAlignment: gridAlignment, columnsSizes: null });
14583
14580
  };
14584
14581
  GridService.prototype.saveSettingsToServer = function (settings) {
14585
- this.storageAPI.set(this.gridName, settings);
14582
+ var isGlobal = this.gridQuery.getGridOptions().isGlobalSettings;
14583
+ this.storageAPI.set(this.gridName, settings, isGlobal);
14586
14584
  };
14587
14585
  /**
14588
14586
  * @internal used to log grid events to the platform's logging service
@@ -15587,7 +15585,10 @@
15587
15585
  .pipe(operators.switchMap(function () {
15588
15586
  _this.gridOptions = _this.normalizeOptions();
15589
15587
  agGrid.gridOptions = _this.gridOptions;
15590
- var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
15588
+ var isGlobal = _this.gridOptions.isGlobalSettings;
15589
+ var settingsLoader = _this.gridOptions.saveSettings === false
15590
+ ? rxjs.of(null)
15591
+ : _this.storageAPI.get(_this.gridOptions.gridName, isGlobal);
15591
15592
  return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
15592
15593
  }), ngxTakeUntilDestroy.untilDestroyed(this))
15593
15594
  .subscribe(function (_a) {
@@ -16869,6 +16870,18 @@
16869
16870
  this.registerGroupListeners();
16870
16871
  this.subscribeRowsSelectionData();
16871
16872
  };
16873
+ DatoGridV2ToolbarComponent.prototype.getCellValueChangeEvent = function () {
16874
+ var _this = this;
16875
+ return this.gridController.gridQuery.waitForGrid(function () {
16876
+ return _this.gridQuery.gridRef.cellValueChanged.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16877
+ });
16878
+ };
16879
+ DatoGridV2ToolbarComponent.prototype.getRowDataUpdatedEvent = function () {
16880
+ var _this = this;
16881
+ return this.gridController.gridQuery.waitForGrid(function () {
16882
+ return _this.gridQuery.gridRef.rowDataUpdated.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16883
+ });
16884
+ };
16872
16885
  DatoGridV2ToolbarComponent.prototype.onActionClick = function (action) {
16873
16886
  if (isFunction(action.onClick)) {
16874
16887
  var selectedRowsCount = this.gridController.gridQuery.getSelectedRowsCount();
@@ -21344,6 +21357,40 @@
21344
21357
  * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
21345
21358
  */
21346
21359
 
21360
+ var RichTextService = /** @class */ (function () {
21361
+ function RichTextService(http, config) {
21362
+ this.http = http;
21363
+ this.config = config;
21364
+ }
21365
+ RichTextService.prototype.getLib = function (appendScriptFunc, appendStyleFunc) {
21366
+ if (!this.richTextScript$) {
21367
+ this.initLib(appendScriptFunc, appendStyleFunc);
21368
+ }
21369
+ return this.richTextScript$;
21370
+ };
21371
+ RichTextService.prototype.initLib = function (appendScriptFunc, appendStyleFunc) {
21372
+ this.richTextScript$ = rxjs.combineLatest([
21373
+ this.http
21374
+ .get(this.config.paths.richText + "/index.js", { responseType: 'text' })
21375
+ .pipe(operators.tap(function (lib) { return appendScriptFunc(lib, 'rich-text-editor'); })),
21376
+ this.http
21377
+ .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21378
+ .pipe(operators.tap(function (style) { return appendStyleFunc(style, 'tinymce-autocomplete'); }))
21379
+ ]).pipe(operators.shareReplay(1));
21380
+ };
21381
+ RichTextService.ctorParameters = function () { return [
21382
+ { type: http.HttpClient },
21383
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21384
+ ]; };
21385
+ RichTextService.ɵprov = core.ɵɵdefineInjectable({ factory: function RichTextService_Factory() { return new RichTextService(core.ɵɵinject(http.HttpClient), core.ɵɵinject(DATO_CORE_CONFIG)); }, token: RichTextService, providedIn: "root" });
21386
+ RichTextService = __decorate([
21387
+ core.Injectable({ providedIn: 'root' }),
21388
+ __param(1, core.Inject(DATO_CORE_CONFIG)),
21389
+ __metadata("design:paramtypes", [http.HttpClient, Object])
21390
+ ], RichTextService);
21391
+ return RichTextService;
21392
+ }());
21393
+
21347
21394
  /**
21348
21395
  * @license
21349
21396
  * Copyright Datorama. All Rights Reserved.
@@ -21357,20 +21404,20 @@
21357
21404
  var ɵ0$3 = getTinymce;
21358
21405
  var DatoRichTextDirective = /** @class */ (function (_super) {
21359
21406
  __extends(DatoRichTextDirective, _super);
21360
- function DatoRichTextDirective(ngZone, http, host, config) {
21407
+ function DatoRichTextDirective(ngZone, richTextService, config, host) {
21361
21408
  var _this = _super.call(this) || this;
21362
21409
  _this.ngZone = ngZone;
21363
- _this.http = http;
21364
- _this.host = host;
21410
+ _this.richTextService = richTextService;
21365
21411
  _this.config = config;
21412
+ _this.host = host;
21366
21413
  _this.autocompleteOptions = {};
21367
21414
  _this.forcePlainTextPasting = false;
21368
21415
  _this.format = 'html';
21369
21416
  _this.isOneLine = false;
21370
21417
  _this.initialValue = '';
21371
- _this.defaultPlugins = 'link fullscreen textcolor colorpicker image lists table textpattern autocomplete';
21418
+ _this.defaultPlugins = 'link fullscreen image lists table autocomplete';
21372
21419
  _this.defaultToolbar = [
21373
- 'fontselect fontsizeselect forecolor backcolor bold italic underline link',
21420
+ 'fontfamily fontsize forecolor backcolor bold italic underline link',
21374
21421
  'alignleft aligncenter alignright alignjustify outdent indent | table numlist bullist | image fullscreen'
21375
21422
  ];
21376
21423
  return _this;
@@ -21396,28 +21443,11 @@
21396
21443
  base: this.config.paths.richText,
21397
21444
  query: ''
21398
21445
  };
21399
- /**
21400
- * We support only one instance in load time
21401
- */
21402
- if (window.tinymce) {
21403
- this.init.call(this);
21404
- }
21405
- else {
21406
- this.loadLib().subscribe(function (lib) {
21407
- appendScript(lib, 'rich-text-editor');
21408
- _this.init.call(_this);
21409
- _this.loadAutoCompleteStyle();
21410
- });
21411
- }
21412
- };
21413
- DatoRichTextDirective.prototype.loadLib = function () {
21414
- return this.http.get(this.config.paths.richText + "/index.js", { responseType: 'text' });
21415
- };
21416
- DatoRichTextDirective.prototype.loadAutoCompleteStyle = function () {
21417
- this.http
21418
- .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21419
- .subscribe(function (style) {
21420
- appendStyle(style, 'tinymce-autocomplete');
21446
+ this.richTextService
21447
+ .getLib(appendScript, appendStyle)
21448
+ .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
21449
+ .subscribe(function () {
21450
+ _this.init.call(_this);
21421
21451
  });
21422
21452
  };
21423
21453
  DatoRichTextDirective.prototype.initEditor = function (_, editor) {
@@ -21441,8 +21471,6 @@
21441
21471
  target: this.host.nativeElement,
21442
21472
  width: this.width || 600,
21443
21473
  height: this.height || 300,
21444
- force_br_newlines: true,
21445
- force_p_newlines: false,
21446
21474
  resize: 'both',
21447
21475
  branding: false,
21448
21476
  inline: this.inline,
@@ -21450,10 +21478,12 @@
21450
21478
  readonly: this.disabled,
21451
21479
  plugins: this.plugins || this.defaultPlugins,
21452
21480
  toolbar: isNil(this.toolbar) ? this.defaultToolbar : this.toolbar,
21453
- fontsize_formats: '8px 10px 12px 14px 18px 24px 36px',
21481
+ font_size_formats: '8px 10px 12px 14px 18px 24px 36px',
21454
21482
  min_width: 480,
21455
21483
  menubar: false,
21456
21484
  autocomplete: this.autocompleteOptions,
21485
+ suffix: '.min',
21486
+ skin: 'tinymce-5',
21457
21487
  setup: function (editor) {
21458
21488
  _this.editor = editor;
21459
21489
  editor.on('init', function (e) {
@@ -21510,9 +21540,9 @@
21510
21540
  var DatoRichTextDirective_1;
21511
21541
  DatoRichTextDirective.ctorParameters = function () { return [
21512
21542
  { type: core.NgZone },
21513
- { type: http.HttpClient },
21514
- { type: core.ElementRef },
21515
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21543
+ { type: RichTextService },
21544
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] },
21545
+ { type: core.ElementRef }
21516
21546
  ]; };
21517
21547
  __decorate([
21518
21548
  core.Input(),
@@ -21578,10 +21608,9 @@
21578
21608
  }
21579
21609
  ]
21580
21610
  }),
21581
- __param(3, core.Inject(DATO_CORE_CONFIG)),
21611
+ __param(2, core.Inject(DATO_CORE_CONFIG)),
21582
21612
  __metadata("design:paramtypes", [core.NgZone,
21583
- http.HttpClient,
21584
- core.ElementRef, Object])
21613
+ RichTextService, Object, core.ElementRef])
21585
21614
  ], DatoRichTextDirective);
21586
21615
  return DatoRichTextDirective;
21587
21616
  }(BaseCustomControl));
@@ -24104,7 +24133,9 @@
24104
24133
  };
24105
24134
  DatoBreadcrumbsComponent.prototype.initEditableHeader = function () {
24106
24135
  var _this = this;
24107
- this.headerControl.valueChanges.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (res) {
24136
+ this.headerControl.valueChanges
24137
+ .pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this))
24138
+ .subscribe(function (res) {
24108
24139
  _this.updateEditableText.emit(res);
24109
24140
  _this.cdr.detectChanges();
24110
24141
  });
@@ -25467,7 +25498,7 @@
25467
25498
  };
25468
25499
  }
25469
25500
 
25470
- window.coreVersion = '22.9.3';
25501
+ window.coreVersion = '22.10.3-rc.';
25471
25502
 
25472
25503
  exports.APP_TRANSLATE = APP_TRANSLATE;
25473
25504
  exports.AceService = AceService;
@@ -25909,6 +25940,7 @@
25909
25940
  exports.ɵl = DatoGridItemsCountCellComponent;
25910
25941
  exports.ɵm = DatoGridV2ToolbarMoreMenuComponent;
25911
25942
  exports.ɵn = DatoGridSearchBarComponent;
25943
+ exports.ɵo = RichTextService;
25912
25944
 
25913
25945
  Object.defineProperty(exports, '__esModule', { value: true });
25914
25946