@datorama/core 22.9.2-rc.6 → 22.9.5

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 (43) hide show
  1. package/bundles/datorama-core.umd.js +63 -89
  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-filter/grid-filter.component.js +2 -2
  12. package/esm2015/lib/grid-v2/grid-settings.js +2 -2
  13. package/esm2015/lib/grid-v2/grid-store/grid.service.js +2 -3
  14. package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -7
  15. package/esm2015/lib/icon/icon.types.js +1 -1
  16. package/esm2015/lib/rich-text/rich-text.directive.js +38 -20
  17. package/esm2015/lib/select/select.component.js +19 -13
  18. package/esm2015/lib/version.js +2 -2
  19. package/esm5/datorama-core.js +1 -2
  20. package/esm5/lib/breadcrumbs/breadcrumbs.component.js +2 -4
  21. package/esm5/lib/grid-v2/grid/grid-v2.types.js +1 -1
  22. package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +2 -5
  23. package/esm5/lib/grid-v2/grid-filter/grid-filter.component.js +5 -2
  24. package/esm5/lib/grid-v2/grid-settings.js +2 -2
  25. package/esm5/lib/grid-v2/grid-store/grid.service.js +2 -3
  26. package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -13
  27. package/esm5/lib/icon/icon.types.js +1 -1
  28. package/esm5/lib/rich-text/rich-text.directive.js +39 -21
  29. package/esm5/lib/select/select.component.js +19 -13
  30. package/esm5/lib/version.js +2 -2
  31. package/fesm2015/datorama-core.js +60 -81
  32. package/fesm2015/datorama-core.js.map +1 -1
  33. package/fesm5/datorama-core.js +64 -89
  34. package/fesm5/datorama-core.js.map +1 -1
  35. package/lib/grid-v2/grid/grid-v2.types.d.ts +0 -1
  36. package/lib/grid-v2/grid-settings.d.ts +2 -2
  37. package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +0 -2
  38. package/lib/icon/icon.types.d.ts +1 -1
  39. package/lib/rich-text/rich-text.directive.d.ts +6 -4
  40. package/package.json +1 -1
  41. package/esm2015/lib/rich-text/rich-text.service.js +0 -50
  42. package/esm5/lib/rich-text/rich-text.service.js +0 -51
  43. package/lib/rich-text/rich-text.service.d.ts +0 -10
@@ -8551,7 +8551,6 @@
8551
8551
  this.limitSelectedTo = limitSelectedTo;
8552
8552
  if (this.options) {
8553
8553
  this.updateDisabledState();
8554
- this.cdr.markForCheck();
8555
8554
  }
8556
8555
  },
8557
8556
  enumerable: true,
@@ -8749,8 +8748,9 @@
8749
8748
  DatoSelectComponent.prototype.writeValue = function (activeOptions) {
8750
8749
  this._model = activeOptions ? akita.coerceArray(activeOptions) : [];
8751
8750
  if (this.options) {
8751
+ var overTheLimit = this.limitSelectedTo && this.isMulti && this._model.length >= this.limitSelectedTo;
8752
8752
  this.markAsActive(this._model, { deselectAll: true });
8753
- this.limitSelectedTo && this.updateDisabledState();
8753
+ overTheLimit && this.updateDisabledState();
8754
8754
  }
8755
8755
  /** For later updates */
8756
8756
  this.cdr.markForCheck();
@@ -8781,16 +8781,18 @@
8781
8781
  });
8782
8782
  this.datoOverlay.attach({ placement: this.placement }, this._dropdownClass);
8783
8783
  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) {
8784
+ if (this.hasValue) {
8785
+ /**
8786
+ * When we first open the dropdown we need to mark the
8787
+ * FormControl values as actives
8788
+ */
8789
+ if (this._initialOpen) {
8790
+ this.markAsActive(this._model);
8791
+ this._initialOpen = false;
8792
+ }
8793
+ if (this.limitSelectedTo && this._model.length === this.limitSelectedTo) {
8791
8794
  this.updateDisabledState();
8792
8795
  }
8793
- this._initialOpen = false;
8794
8796
  }
8795
8797
  if (this._withInfiniteScroll) {
8796
8798
  this.activateInfiniteScroll();
@@ -8876,6 +8878,7 @@
8876
8878
  };
8877
8879
  DatoSelectComponent.prototype.removeOption = function (option) {
8878
8880
  var _this = this;
8881
+ var updateDisabled = this.limitSelectedTo && this._model.length === this.limitSelectedTo;
8879
8882
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== option[_this.idKey]; });
8880
8883
  var optionToRemove = this.options.find(function (datoOption) { return datoOption.option && datoOption.option[_this.idKey] === option[_this.idKey]; });
8881
8884
  /**
@@ -8885,7 +8888,7 @@
8885
8888
  if (optionToRemove) {
8886
8889
  optionToRemove.active = false;
8887
8890
  }
8888
- this.limitSelectedTo && this.updateDisabledState();
8891
+ updateDisabled && this.updateDisabledState();
8889
8892
  this.onChange(this._model);
8890
8893
  this.cdr.markForCheck();
8891
8894
  this.asyncUpdateDropdownPosition();
@@ -9233,6 +9236,9 @@
9233
9236
  if (!datoOption) {
9234
9237
  return;
9235
9238
  }
9239
+ var modelLength = this._model.length;
9240
+ var updateDisabled = this.limitSelectedTo &&
9241
+ (modelLength === this.limitSelectedTo || (modelLength === this.limitSelectedTo - 1 && !datoOption.active));
9236
9242
  datoOption.active = !datoOption.active;
9237
9243
  var rawOption = datoOption.option;
9238
9244
  if (datoOption.active) {
@@ -9241,7 +9247,7 @@
9241
9247
  else {
9242
9248
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== rawOption[_this.idKey]; });
9243
9249
  }
9244
- this.limitSelectedTo && this.updateDisabledState();
9250
+ updateDisabled && this.updateDisabledState();
9245
9251
  this.onChange(this._model);
9246
9252
  this.cdr.markForCheck();
9247
9253
  this.asyncUpdateDropdownPosition();
@@ -12046,7 +12052,7 @@
12046
12052
  return contextActions;
12047
12053
  }
12048
12054
 
12049
- 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');
12050
12056
 
12051
12057
  var defaultEditableColumnRenderer = function (params) {
12052
12058
  return params && params.value ? "<div class=\"value-wrapper ellipsis\">" + params.value + "</div>" : null;
@@ -12942,7 +12948,10 @@
12942
12948
  this.listOptions = rawValues.map(mapToListItem);
12943
12949
  }
12944
12950
  else {
12945
- var columnValues = this.getColumnValues();
12951
+ var columnValues = this.getColumnValues().filter(function (_a) {
12952
+ var value = _a.value;
12953
+ return !isNil(value);
12954
+ });
12946
12955
  this.columnValues = columnValues.map(function (_a) {
12947
12956
  var value = _a.value;
12948
12957
  return !isNil(_this.pivotColumn) && value ? value[_this.colField] : value;
@@ -14575,8 +14584,7 @@
14575
14584
  this.updateSettings({ gridAlignment: gridAlignment, columnsSizes: null });
14576
14585
  };
14577
14586
  GridService.prototype.saveSettingsToServer = function (settings) {
14578
- var isGlobal = this.gridQuery.getGridOptions().isGlobalSettings;
14579
- this.storageAPI.set(this.gridName, settings, isGlobal);
14587
+ this.storageAPI.set(this.gridName, settings);
14580
14588
  };
14581
14589
  /**
14582
14590
  * @internal used to log grid events to the platform's logging service
@@ -15581,10 +15589,7 @@
15581
15589
  .pipe(operators.switchMap(function () {
15582
15590
  _this.gridOptions = _this.normalizeOptions();
15583
15591
  agGrid.gridOptions = _this.gridOptions;
15584
- var isGlobal = _this.gridOptions.isGlobalSettings;
15585
- var settingsLoader = _this.gridOptions.saveSettings === false
15586
- ? rxjs.of(null)
15587
- : _this.storageAPI.get(_this.gridOptions.gridName, isGlobal);
15592
+ var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
15588
15593
  return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
15589
15594
  }), ngxTakeUntilDestroy.untilDestroyed(this))
15590
15595
  .subscribe(function (_a) {
@@ -16866,18 +16871,6 @@
16866
16871
  this.registerGroupListeners();
16867
16872
  this.subscribeRowsSelectionData();
16868
16873
  };
16869
- DatoGridV2ToolbarComponent.prototype.getCellValueChangeEvent = function () {
16870
- var _this = this;
16871
- return this.gridController.gridQuery.waitForGrid(function () {
16872
- return _this.gridQuery.gridRef.cellValueChanged.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16873
- });
16874
- };
16875
- DatoGridV2ToolbarComponent.prototype.getRowDataUpdatedEvent = function () {
16876
- var _this = this;
16877
- return this.gridController.gridQuery.waitForGrid(function () {
16878
- return _this.gridQuery.gridRef.rowDataUpdated.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16879
- });
16880
- };
16881
16874
  DatoGridV2ToolbarComponent.prototype.onActionClick = function (action) {
16882
16875
  if (isFunction(action.onClick)) {
16883
16876
  var selectedRowsCount = this.gridController.gridQuery.getSelectedRowsCount();
@@ -21353,40 +21346,6 @@
21353
21346
  * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
21354
21347
  */
21355
21348
 
21356
- var RichTextService = /** @class */ (function () {
21357
- function RichTextService(http, config) {
21358
- this.http = http;
21359
- this.config = config;
21360
- }
21361
- RichTextService.prototype.getLib = function (appendScriptFunc, appendStyleFunc) {
21362
- if (!this.richTextScript$) {
21363
- this.initLib(appendScriptFunc, appendStyleFunc);
21364
- }
21365
- return this.richTextScript$;
21366
- };
21367
- RichTextService.prototype.initLib = function (appendScriptFunc, appendStyleFunc) {
21368
- this.richTextScript$ = rxjs.combineLatest([
21369
- this.http
21370
- .get(this.config.paths.richText + "/index.js", { responseType: 'text' })
21371
- .pipe(operators.tap(function (lib) { return appendScriptFunc(lib, 'rich-text-editor'); })),
21372
- this.http
21373
- .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21374
- .pipe(operators.tap(function (style) { return appendStyleFunc(style, 'tinymce-autocomplete'); }))
21375
- ]).pipe(operators.shareReplay(1));
21376
- };
21377
- RichTextService.ctorParameters = function () { return [
21378
- { type: http.HttpClient },
21379
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21380
- ]; };
21381
- RichTextService.ɵprov = core.ɵɵdefineInjectable({ factory: function RichTextService_Factory() { return new RichTextService(core.ɵɵinject(http.HttpClient), core.ɵɵinject(DATO_CORE_CONFIG)); }, token: RichTextService, providedIn: "root" });
21382
- RichTextService = __decorate([
21383
- core.Injectable({ providedIn: 'root' }),
21384
- __param(1, core.Inject(DATO_CORE_CONFIG)),
21385
- __metadata("design:paramtypes", [http.HttpClient, Object])
21386
- ], RichTextService);
21387
- return RichTextService;
21388
- }());
21389
-
21390
21349
  /**
21391
21350
  * @license
21392
21351
  * Copyright Datorama. All Rights Reserved.
@@ -21400,20 +21359,20 @@
21400
21359
  var ɵ0$3 = getTinymce;
21401
21360
  var DatoRichTextDirective = /** @class */ (function (_super) {
21402
21361
  __extends(DatoRichTextDirective, _super);
21403
- function DatoRichTextDirective(ngZone, richTextService, config, host) {
21362
+ function DatoRichTextDirective(ngZone, http, host, config) {
21404
21363
  var _this = _super.call(this) || this;
21405
21364
  _this.ngZone = ngZone;
21406
- _this.richTextService = richTextService;
21407
- _this.config = config;
21365
+ _this.http = http;
21408
21366
  _this.host = host;
21367
+ _this.config = config;
21409
21368
  _this.autocompleteOptions = {};
21410
21369
  _this.forcePlainTextPasting = false;
21411
21370
  _this.format = 'html';
21412
21371
  _this.isOneLine = false;
21413
21372
  _this.initialValue = '';
21414
- _this.defaultPlugins = 'link fullscreen image lists table autocomplete';
21373
+ _this.defaultPlugins = 'link fullscreen textcolor colorpicker image lists table textpattern autocomplete';
21415
21374
  _this.defaultToolbar = [
21416
- 'fontfamily fontsize forecolor backcolor bold italic underline link',
21375
+ 'fontselect fontsizeselect forecolor backcolor bold italic underline link',
21417
21376
  'alignleft aligncenter alignright alignjustify outdent indent | table numlist bullist | image fullscreen'
21418
21377
  ];
21419
21378
  return _this;
@@ -21439,11 +21398,28 @@
21439
21398
  base: this.config.paths.richText,
21440
21399
  query: ''
21441
21400
  };
21442
- this.richTextService
21443
- .getLib(appendScript, appendStyle)
21444
- .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
21445
- .subscribe(function () {
21446
- _this.init.call(_this);
21401
+ /**
21402
+ * We support only one instance in load time
21403
+ */
21404
+ if (window.tinymce) {
21405
+ this.init.call(this);
21406
+ }
21407
+ else {
21408
+ this.loadLib().subscribe(function (lib) {
21409
+ appendScript(lib, 'rich-text-editor');
21410
+ _this.init.call(_this);
21411
+ _this.loadAutoCompleteStyle();
21412
+ });
21413
+ }
21414
+ };
21415
+ DatoRichTextDirective.prototype.loadLib = function () {
21416
+ return this.http.get(this.config.paths.richText + "/index.js", { responseType: 'text' });
21417
+ };
21418
+ DatoRichTextDirective.prototype.loadAutoCompleteStyle = function () {
21419
+ this.http
21420
+ .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21421
+ .subscribe(function (style) {
21422
+ appendStyle(style, 'tinymce-autocomplete');
21447
21423
  });
21448
21424
  };
21449
21425
  DatoRichTextDirective.prototype.initEditor = function (_, editor) {
@@ -21467,6 +21443,8 @@
21467
21443
  target: this.host.nativeElement,
21468
21444
  width: this.width || 600,
21469
21445
  height: this.height || 300,
21446
+ force_br_newlines: true,
21447
+ force_p_newlines: false,
21470
21448
  resize: 'both',
21471
21449
  branding: false,
21472
21450
  inline: this.inline,
@@ -21474,12 +21452,10 @@
21474
21452
  readonly: this.disabled,
21475
21453
  plugins: this.plugins || this.defaultPlugins,
21476
21454
  toolbar: isNil(this.toolbar) ? this.defaultToolbar : this.toolbar,
21477
- font_size_formats: '8px 10px 12px 14px 18px 24px 36px',
21455
+ fontsize_formats: '8px 10px 12px 14px 18px 24px 36px',
21478
21456
  min_width: 480,
21479
21457
  menubar: false,
21480
21458
  autocomplete: this.autocompleteOptions,
21481
- suffix: '.min',
21482
- skin: 'tinymce-5',
21483
21459
  setup: function (editor) {
21484
21460
  _this.editor = editor;
21485
21461
  editor.on('init', function (e) {
@@ -21536,9 +21512,9 @@
21536
21512
  var DatoRichTextDirective_1;
21537
21513
  DatoRichTextDirective.ctorParameters = function () { return [
21538
21514
  { type: core.NgZone },
21539
- { type: RichTextService },
21540
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] },
21541
- { type: core.ElementRef }
21515
+ { type: http.HttpClient },
21516
+ { type: core.ElementRef },
21517
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21542
21518
  ]; };
21543
21519
  __decorate([
21544
21520
  core.Input(),
@@ -21604,9 +21580,10 @@
21604
21580
  }
21605
21581
  ]
21606
21582
  }),
21607
- __param(2, core.Inject(DATO_CORE_CONFIG)),
21583
+ __param(3, core.Inject(DATO_CORE_CONFIG)),
21608
21584
  __metadata("design:paramtypes", [core.NgZone,
21609
- RichTextService, Object, core.ElementRef])
21585
+ http.HttpClient,
21586
+ core.ElementRef, Object])
21610
21587
  ], DatoRichTextDirective);
21611
21588
  return DatoRichTextDirective;
21612
21589
  }(BaseCustomControl));
@@ -24129,9 +24106,7 @@
24129
24106
  };
24130
24107
  DatoBreadcrumbsComponent.prototype.initEditableHeader = function () {
24131
24108
  var _this = this;
24132
- this.headerControl.valueChanges
24133
- .pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this))
24134
- .subscribe(function (res) {
24109
+ this.headerControl.valueChanges.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (res) {
24135
24110
  _this.updateEditableText.emit(res);
24136
24111
  _this.cdr.detectChanges();
24137
24112
  });
@@ -25494,7 +25469,7 @@
25494
25469
  };
25495
25470
  }
25496
25471
 
25497
- window.coreVersion = '22.10.1-rc.';
25472
+ window.coreVersion = '22.9.5';
25498
25473
 
25499
25474
  exports.APP_TRANSLATE = APP_TRANSLATE;
25500
25475
  exports.AceService = AceService;
@@ -25936,7 +25911,6 @@
25936
25911
  exports.ɵl = DatoGridItemsCountCellComponent;
25937
25912
  exports.ɵm = DatoGridV2ToolbarMoreMenuComponent;
25938
25913
  exports.ɵn = DatoGridSearchBarComponent;
25939
- exports.ɵo = RichTextService;
25940
25914
 
25941
25915
  Object.defineProperty(exports, '__esModule', { value: true });
25942
25916