@datorama/core 22.12.4-rc.1 → 22.12.5-beta.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 (40) hide show
  1. package/bundles/datorama-core.umd.js +62 -83
  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 +15 -7
  13. package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -7
  14. package/esm2015/lib/icon/icon.types.js +1 -1
  15. package/esm2015/lib/rich-text/rich-text.directive.js +38 -20
  16. package/esm2015/lib/select/select.component.js +9 -4
  17. package/esm2015/lib/version.js +2 -2
  18. package/esm5/datorama-core.js +1 -2
  19. package/esm5/lib/breadcrumbs/breadcrumbs.component.js +2 -4
  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 +2 -5
  22. package/esm5/lib/grid-v2/grid-settings.js +2 -2
  23. package/esm5/lib/grid-v2/grid-store/grid.service.js +15 -7
  24. package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -13
  25. package/esm5/lib/icon/icon.types.js +1 -1
  26. package/esm5/lib/rich-text/rich-text.directive.js +39 -21
  27. package/esm5/lib/select/select.component.js +9 -4
  28. package/esm5/lib/version.js +2 -2
  29. package/fesm2015/datorama-core.js +62 -75
  30. package/fesm2015/datorama-core.js.map +1 -1
  31. package/fesm5/datorama-core.js +63 -83
  32. package/fesm5/datorama-core.js.map +1 -1
  33. package/lib/grid-v2/grid/grid-v2.types.d.ts +0 -1
  34. package/lib/grid-v2/grid-settings.d.ts +2 -2
  35. package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +0 -2
  36. package/lib/rich-text/rich-text.directive.d.ts +6 -4
  37. package/package.json +2 -2
  38. package/esm2015/lib/rich-text/rich-text.service.js +0 -50
  39. package/esm5/lib/rich-text/rich-text.service.js +0 -51
  40. package/lib/rich-text/rich-text.service.d.ts +0 -10
@@ -8873,8 +8873,9 @@
8873
8873
  DatoSelectComponent.prototype.writeValue = function (activeOptions) {
8874
8874
  this._model = activeOptions ? akita.coerceArray(activeOptions) : [];
8875
8875
  if (this.options) {
8876
+ var overTheLimit = this.limitSelectedTo && this.isMulti && this._model.length >= this.limitSelectedTo;
8876
8877
  this.markAsActive(this._model, { deselectAll: true });
8877
- this.limitSelectedTo && this.updateDisabledState();
8878
+ overTheLimit && this.updateDisabledState();
8878
8879
  }
8879
8880
  /** For later updates */
8880
8881
  this.cdr.markForCheck();
@@ -9002,6 +9003,7 @@
9002
9003
  };
9003
9004
  DatoSelectComponent.prototype.removeOption = function (option) {
9004
9005
  var _this = this;
9006
+ var updateDisabled = this.limitSelectedTo && this._model.length === this.limitSelectedTo;
9005
9007
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== option[_this.idKey]; });
9006
9008
  var optionToRemove = this.options.find(function (datoOption) { return datoOption.option && datoOption.option[_this.idKey] === option[_this.idKey]; });
9007
9009
  /**
@@ -9011,7 +9013,7 @@
9011
9013
  if (optionToRemove) {
9012
9014
  optionToRemove.active = false;
9013
9015
  }
9014
- this.limitSelectedTo && this.updateDisabledState();
9016
+ updateDisabled && this.updateDisabledState();
9015
9017
  this.onChange(this._model);
9016
9018
  this.cdr.markForCheck();
9017
9019
  this.asyncUpdateDropdownPosition();
@@ -9359,6 +9361,9 @@
9359
9361
  if (!datoOption) {
9360
9362
  return;
9361
9363
  }
9364
+ var modelLength = this._model.length;
9365
+ var updateDisabled = this.limitSelectedTo &&
9366
+ (modelLength === this.limitSelectedTo || (modelLength === this.limitSelectedTo - 1 && !datoOption.active));
9362
9367
  datoOption.active = !datoOption.active;
9363
9368
  var rawOption = datoOption.option;
9364
9369
  if (datoOption.active) {
@@ -9367,7 +9372,7 @@
9367
9372
  else {
9368
9373
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== rawOption[_this.idKey]; });
9369
9374
  }
9370
- this.limitSelectedTo && this.updateDisabledState();
9375
+ updateDisabled && this.updateDisabledState();
9371
9376
  this.onChange(this._model);
9372
9377
  this.cdr.markForCheck();
9373
9378
  this.asyncUpdateDropdownPosition();
@@ -12100,7 +12105,7 @@
12100
12105
  return contextActions;
12101
12106
  }
12102
12107
 
12103
- var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_AP');
12108
+ var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_API');
12104
12109
 
12105
12110
  var defaultEditableColumnRenderer = function (params) {
12106
12111
  return params && params.value ? "<div class=\"value-wrapper ellipsis\">" + params.value + "</div>" : null;
@@ -14439,11 +14444,20 @@
14439
14444
  var cellClass = "";
14440
14445
  if (gridQuery && gridQuery.api) {
14441
14446
  var columns = gridQuery.api.columns;
14442
- var allDisplayedColumns = columns.getAllDisplayedColumns();
14443
- var col = allDisplayedColumns.find(function (column) {
14444
- return column.getColId() === params.colDef.colId;
14447
+ var originalColumns = columns.getAllColumns();
14448
+ var originalColumn = originalColumns.find(function (col) {
14449
+ var _a = params.colDef, cellColumnGroupId = _a.showRowGroup, pivotValueColumn = _a.pivotValueColumn, colId = _a.colId;
14450
+ var cellPivotColumnId = pivotValueColumn && pivotValueColumn.getColId();
14451
+ var cellColumnId = cellColumnGroupId || cellPivotColumnId || colId;
14452
+ return col.getColId() === cellColumnId;
14445
14453
  });
14446
- var colIndex = allDisplayedColumns.indexOf(col);
14454
+ var allDisplayedColumns = columns.getAllDisplayedColumns();
14455
+ var displayedColumn = allDisplayedColumns.find(function (col) { return col.getColId() === params.colDef.colId; });
14456
+ var colIndex = allDisplayedColumns.indexOf(displayedColumn);
14457
+ var originalCellClass = originalColumn.getColDef().cellClass;
14458
+ if (originalCellClass && typeof originalCellClass === 'string') {
14459
+ cellClass += originalCellClass + " ";
14460
+ }
14447
14461
  if (rowGroupIndex <= colIndex) {
14448
14462
  if (leafGroup) {
14449
14463
  if (childIndex % 2 === 0) {
@@ -14764,8 +14778,7 @@
14764
14778
  this.updateSettings({ gridAlignment: gridAlignment, columnsSizes: null });
14765
14779
  };
14766
14780
  GridService.prototype.saveSettingsToServer = function (settings) {
14767
- var isGlobal = this.gridQuery.getGridOptions().isGlobalSettings;
14768
- this.storageAPI.set(this.gridName, settings, isGlobal);
14781
+ this.storageAPI.set(this.gridName, settings);
14769
14782
  };
14770
14783
  /**
14771
14784
  * @internal used to log grid events to the platform's logging service
@@ -15775,10 +15788,7 @@
15775
15788
  .pipe(operators.switchMap(function () {
15776
15789
  _this.gridOptions = _this.normalizeOptions();
15777
15790
  agGrid.gridOptions = _this.gridOptions;
15778
- var isGlobal = _this.gridOptions.isGlobalSettings;
15779
- var settingsLoader = _this.gridOptions.saveSettings === false
15780
- ? rxjs.of(null)
15781
- : _this.storageAPI.get(_this.gridOptions.gridName, isGlobal);
15791
+ var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
15782
15792
  return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
15783
15793
  }), ngxTakeUntilDestroy.untilDestroyed(this))
15784
15794
  .subscribe(function (_a) {
@@ -17073,18 +17083,6 @@
17073
17083
  this.registerGroupListeners();
17074
17084
  this.subscribeRowsSelectionData();
17075
17085
  };
17076
- DatoGridV2ToolbarComponent.prototype.getCellValueChangeEvent = function () {
17077
- var _this = this;
17078
- return this.gridController.gridQuery.waitForGrid(function () {
17079
- return _this.gridQuery.gridRef.cellValueChanged.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
17080
- });
17081
- };
17082
- DatoGridV2ToolbarComponent.prototype.getRowDataUpdatedEvent = function () {
17083
- var _this = this;
17084
- return this.gridController.gridQuery.waitForGrid(function () {
17085
- return _this.gridQuery.gridRef.rowDataUpdated.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
17086
- });
17087
- };
17088
17086
  DatoGridV2ToolbarComponent.prototype.onActionClick = function (action) {
17089
17087
  if (isFunction(action.onClick)) {
17090
17088
  var selectedRowsCount = this.gridController.gridQuery.getSelectedRowsCount();
@@ -21572,40 +21570,6 @@
21572
21570
  * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
21573
21571
  */
21574
21572
 
21575
- var RichTextService = /** @class */ (function () {
21576
- function RichTextService(http, config) {
21577
- this.http = http;
21578
- this.config = config;
21579
- }
21580
- RichTextService.prototype.getLib = function (appendScriptFunc, appendStyleFunc) {
21581
- if (!this.richTextScript$) {
21582
- this.initLib(appendScriptFunc, appendStyleFunc);
21583
- }
21584
- return this.richTextScript$;
21585
- };
21586
- RichTextService.prototype.initLib = function (appendScriptFunc, appendStyleFunc) {
21587
- this.richTextScript$ = rxjs.combineLatest([
21588
- this.http
21589
- .get(this.config.paths.richText + "/index.js", { responseType: 'text' })
21590
- .pipe(operators.tap(function (lib) { return appendScriptFunc(lib, 'rich-text-editor'); })),
21591
- this.http
21592
- .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21593
- .pipe(operators.tap(function (style) { return appendStyleFunc(style, 'tinymce-autocomplete'); }))
21594
- ]).pipe(operators.shareReplay(1));
21595
- };
21596
- RichTextService.ctorParameters = function () { return [
21597
- { type: http.HttpClient },
21598
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21599
- ]; };
21600
- RichTextService.ɵprov = core.ɵɵdefineInjectable({ factory: function RichTextService_Factory() { return new RichTextService(core.ɵɵinject(http.HttpClient), core.ɵɵinject(DATO_CORE_CONFIG)); }, token: RichTextService, providedIn: "root" });
21601
- RichTextService = __decorate([
21602
- core.Injectable({ providedIn: 'root' }),
21603
- __param(1, core.Inject(DATO_CORE_CONFIG)),
21604
- __metadata("design:paramtypes", [http.HttpClient, Object])
21605
- ], RichTextService);
21606
- return RichTextService;
21607
- }());
21608
-
21609
21573
  /**
21610
21574
  * @license
21611
21575
  * Copyright Datorama. All Rights Reserved.
@@ -21619,20 +21583,20 @@
21619
21583
  var ɵ0$3 = getTinymce;
21620
21584
  var DatoRichTextDirective = /** @class */ (function (_super) {
21621
21585
  __extends(DatoRichTextDirective, _super);
21622
- function DatoRichTextDirective(ngZone, richTextService, config, host) {
21586
+ function DatoRichTextDirective(ngZone, http, host, config) {
21623
21587
  var _this = _super.call(this) || this;
21624
21588
  _this.ngZone = ngZone;
21625
- _this.richTextService = richTextService;
21626
- _this.config = config;
21589
+ _this.http = http;
21627
21590
  _this.host = host;
21591
+ _this.config = config;
21628
21592
  _this.autocompleteOptions = {};
21629
21593
  _this.forcePlainTextPasting = false;
21630
21594
  _this.format = 'html';
21631
21595
  _this.isOneLine = false;
21632
21596
  _this.initialValue = '';
21633
- _this.defaultPlugins = 'link fullscreen image lists table autocomplete';
21597
+ _this.defaultPlugins = 'link fullscreen textcolor colorpicker image lists table textpattern autocomplete';
21634
21598
  _this.defaultToolbar = [
21635
- 'fontfamily fontsize forecolor backcolor bold italic underline link',
21599
+ 'fontselect fontsizeselect forecolor backcolor bold italic underline link',
21636
21600
  'alignleft aligncenter alignright alignjustify outdent indent | table numlist bullist | image fullscreen'
21637
21601
  ];
21638
21602
  return _this;
@@ -21658,11 +21622,28 @@
21658
21622
  base: this.config.paths.richText,
21659
21623
  query: ''
21660
21624
  };
21661
- this.richTextService
21662
- .getLib(appendScript, appendStyle)
21663
- .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
21664
- .subscribe(function () {
21665
- _this.init.call(_this);
21625
+ /**
21626
+ * We support only one instance in load time
21627
+ */
21628
+ if (window.tinymce) {
21629
+ this.init.call(this);
21630
+ }
21631
+ else {
21632
+ this.loadLib().subscribe(function (lib) {
21633
+ appendScript(lib, 'rich-text-editor');
21634
+ _this.init.call(_this);
21635
+ _this.loadAutoCompleteStyle();
21636
+ });
21637
+ }
21638
+ };
21639
+ DatoRichTextDirective.prototype.loadLib = function () {
21640
+ return this.http.get(this.config.paths.richText + "/index.js", { responseType: 'text' });
21641
+ };
21642
+ DatoRichTextDirective.prototype.loadAutoCompleteStyle = function () {
21643
+ this.http
21644
+ .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21645
+ .subscribe(function (style) {
21646
+ appendStyle(style, 'tinymce-autocomplete');
21666
21647
  });
21667
21648
  };
21668
21649
  DatoRichTextDirective.prototype.initEditor = function (_, editor) {
@@ -21686,6 +21667,8 @@
21686
21667
  target: this.host.nativeElement,
21687
21668
  width: this.width || 600,
21688
21669
  height: this.height || 300,
21670
+ force_br_newlines: true,
21671
+ force_p_newlines: false,
21689
21672
  resize: 'both',
21690
21673
  branding: false,
21691
21674
  inline: this.inline,
@@ -21693,12 +21676,10 @@
21693
21676
  readonly: this.disabled,
21694
21677
  plugins: this.plugins || this.defaultPlugins,
21695
21678
  toolbar: isNil(this.toolbar) ? this.defaultToolbar : this.toolbar,
21696
- font_size_formats: '8px 10px 12px 14px 18px 24px 36px',
21679
+ fontsize_formats: '8px 10px 12px 14px 18px 24px 36px',
21697
21680
  min_width: 480,
21698
21681
  menubar: false,
21699
21682
  autocomplete: this.autocompleteOptions,
21700
- suffix: '.min',
21701
- skin: 'tinymce-5',
21702
21683
  setup: function (editor) {
21703
21684
  _this.editor = editor;
21704
21685
  editor.on('init', function (e) {
@@ -21755,9 +21736,9 @@
21755
21736
  var DatoRichTextDirective_1;
21756
21737
  DatoRichTextDirective.ctorParameters = function () { return [
21757
21738
  { type: core.NgZone },
21758
- { type: RichTextService },
21759
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] },
21760
- { type: core.ElementRef }
21739
+ { type: http.HttpClient },
21740
+ { type: core.ElementRef },
21741
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21761
21742
  ]; };
21762
21743
  __decorate([
21763
21744
  core.Input(),
@@ -21823,9 +21804,10 @@
21823
21804
  }
21824
21805
  ]
21825
21806
  }),
21826
- __param(2, core.Inject(DATO_CORE_CONFIG)),
21807
+ __param(3, core.Inject(DATO_CORE_CONFIG)),
21827
21808
  __metadata("design:paramtypes", [core.NgZone,
21828
- RichTextService, Object, core.ElementRef])
21809
+ http.HttpClient,
21810
+ core.ElementRef, Object])
21829
21811
  ], DatoRichTextDirective);
21830
21812
  return DatoRichTextDirective;
21831
21813
  }(BaseCustomControl));
@@ -24348,9 +24330,7 @@
24348
24330
  };
24349
24331
  DatoBreadcrumbsComponent.prototype.initEditableHeader = function () {
24350
24332
  var _this = this;
24351
- this.headerControl.valueChanges
24352
- .pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this))
24353
- .subscribe(function (res) {
24333
+ this.headerControl.valueChanges.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (res) {
24354
24334
  _this.updateEditableText.emit(res);
24355
24335
  _this.cdr.detectChanges();
24356
24336
  });
@@ -25713,7 +25693,7 @@
25713
25693
  };
25714
25694
  }
25715
25695
 
25716
- window.coreVersion = '22.13.3-rc.';
25696
+ window.coreVersion = '22.12.4';
25717
25697
 
25718
25698
  exports.APP_TRANSLATE = APP_TRANSLATE;
25719
25699
  exports.AceService = AceService;
@@ -26157,7 +26137,6 @@
26157
26137
  exports.ɵl = DatoGridItemsCountCellComponent;
26158
26138
  exports.ɵm = DatoGridV2ToolbarMoreMenuComponent;
26159
26139
  exports.ɵn = DatoGridSearchBarComponent;
26160
- exports.ɵo = RichTextService;
26161
26140
 
26162
26141
  Object.defineProperty(exports, '__esModule', { value: true });
26163
26142