@datorama/core 22.10.9-rc.5 → 22.11.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 (44) hide show
  1. package/bundle.scss +8 -1
  2. package/bundles/datorama-core.umd.js +70 -83
  3. package/bundles/datorama-core.umd.js.map +1 -1
  4. package/bundles/datorama-core.umd.min.js +27 -27
  5. package/bundles/datorama-core.umd.min.js.map +1 -1
  6. package/datorama-core.d.ts +0 -1
  7. package/datorama-core.metadata.json +1 -1
  8. package/esm2015/datorama-core.js +1 -2
  9. package/esm2015/lib/breadcrumbs/breadcrumbs.component.js +2 -4
  10. package/esm2015/lib/grid-v2/grid/grid-v2.types.js +1 -1
  11. package/esm2015/lib/grid-v2/grid-controller/grid-controller.component.js +2 -5
  12. package/esm2015/lib/grid-v2/grid-filter/grid-filter.component.js +2 -1
  13. package/esm2015/lib/grid-v2/grid-settings.js +2 -2
  14. package/esm2015/lib/grid-v2/grid-store/grid.query.js +2 -1
  15. package/esm2015/lib/grid-v2/grid-store/grid.service.js +21 -7
  16. package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -7
  17. package/esm2015/lib/rich-text/rich-text.directive.js +38 -20
  18. package/esm2015/lib/select/select.component.js +9 -4
  19. package/esm2015/lib/version.js +2 -2
  20. package/esm5/datorama-core.js +1 -2
  21. package/esm5/lib/breadcrumbs/breadcrumbs.component.js +2 -4
  22. package/esm5/lib/grid-v2/grid/grid-v2.types.js +1 -1
  23. package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +2 -5
  24. package/esm5/lib/grid-v2/grid-filter/grid-filter.component.js +2 -1
  25. package/esm5/lib/grid-v2/grid-settings.js +2 -2
  26. package/esm5/lib/grid-v2/grid-store/grid.query.js +2 -1
  27. package/esm5/lib/grid-v2/grid-store/grid.service.js +21 -7
  28. package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -13
  29. package/esm5/lib/rich-text/rich-text.directive.js +39 -21
  30. package/esm5/lib/select/select.component.js +9 -4
  31. package/esm5/lib/version.js +2 -2
  32. package/fesm2015/datorama-core.js +70 -75
  33. package/fesm2015/datorama-core.js.map +1 -1
  34. package/fesm5/datorama-core.js +71 -83
  35. package/fesm5/datorama-core.js.map +1 -1
  36. package/lib/grid-v2/grid/grid-v2.types.d.ts +0 -1
  37. package/lib/grid-v2/grid-settings.d.ts +2 -2
  38. package/lib/grid-v2/grid-store/grid.service.d.ts +1 -0
  39. package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +0 -2
  40. package/lib/rich-text/rich-text.directive.d.ts +6 -4
  41. package/package.json +1 -1
  42. package/esm2015/lib/rich-text/rich-text.service.js +0 -50
  43. package/esm5/lib/rich-text/rich-text.service.js +0 -51
  44. package/lib/rich-text/rich-text.service.d.ts +0 -10
package/bundle.scss CHANGED
@@ -14319,6 +14319,10 @@ dato-input input:disabled:hover {
14319
14319
  */
14320
14320
  }
14321
14321
 
14322
+ .dato-grid.pivot-mode .ag-row.ag-row-group .bottom-border {
14323
+ border-bottom: 1px solid themify(primary-200);
14324
+ }
14325
+
14322
14326
  .dato-grid.pivot-mode .ag-row.ag-row-group:not(.ag-row-hover) {
14323
14327
  background-color: themify(primary-50);
14324
14328
  }
@@ -14333,7 +14337,6 @@ dato-input input:disabled:hover {
14333
14337
 
14334
14338
  .dato-grid.pivot-mode .ag-header .ag-header-row .ag-header-cell {
14335
14339
  border: none;
14336
- border-top: 1px solid themify(primary-200);
14337
14340
  }
14338
14341
 
14339
14342
  .dato-grid.pivot-mode .ag-header .ag-header-row .ag-header-cell dato-grid-column-header {
@@ -14349,6 +14352,10 @@ dato-input input:disabled:hover {
14349
14352
  color: themify(primary-500);
14350
14353
  }
14351
14354
 
14355
+ .dato-grid.pivot-mode .ag-header .ag-header-row .ag-header-cell.top-border {
14356
+ border-top: 1px solid themify(primary-200);
14357
+ }
14358
+
14352
14359
  .dato-grid.pivot-mode .ag-header .ag-header-row .ag-header-cell-resize {
14353
14360
  height: 100%;
14354
14361
  margin: 0;
@@ -8748,8 +8748,9 @@
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;
8751
8752
  this.markAsActive(this._model, { deselectAll: true });
8752
- this.limitSelectedTo && this.updateDisabledState();
8753
+ overTheLimit && this.updateDisabledState();
8753
8754
  }
8754
8755
  /** For later updates */
8755
8756
  this.cdr.markForCheck();
@@ -8877,6 +8878,7 @@
8877
8878
  };
8878
8879
  DatoSelectComponent.prototype.removeOption = function (option) {
8879
8880
  var _this = this;
8881
+ var updateDisabled = this.limitSelectedTo && this._model.length === this.limitSelectedTo;
8880
8882
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== option[_this.idKey]; });
8881
8883
  var optionToRemove = this.options.find(function (datoOption) { return datoOption.option && datoOption.option[_this.idKey] === option[_this.idKey]; });
8882
8884
  /**
@@ -8886,7 +8888,7 @@
8886
8888
  if (optionToRemove) {
8887
8889
  optionToRemove.active = false;
8888
8890
  }
8889
- this.limitSelectedTo && this.updateDisabledState();
8891
+ updateDisabled && this.updateDisabledState();
8890
8892
  this.onChange(this._model);
8891
8893
  this.cdr.markForCheck();
8892
8894
  this.asyncUpdateDropdownPosition();
@@ -9234,6 +9236,9 @@
9234
9236
  if (!datoOption) {
9235
9237
  return;
9236
9238
  }
9239
+ var modelLength = this._model.length;
9240
+ var updateDisabled = this.limitSelectedTo &&
9241
+ (modelLength === this.limitSelectedTo || (modelLength === this.limitSelectedTo - 1 && !datoOption.active));
9237
9242
  datoOption.active = !datoOption.active;
9238
9243
  var rawOption = datoOption.option;
9239
9244
  if (datoOption.active) {
@@ -9242,7 +9247,7 @@
9242
9247
  else {
9243
9248
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== rawOption[_this.idKey]; });
9244
9249
  }
9245
- this.limitSelectedTo && this.updateDisabledState();
9250
+ updateDisabled && this.updateDisabledState();
9246
9251
  this.onChange(this._model);
9247
9252
  this.cdr.markForCheck();
9248
9253
  this.asyncUpdateDropdownPosition();
@@ -11717,6 +11722,7 @@
11717
11722
  return this.select(function (state) { return state.serverSidePagination.selectAllRowsEnabled; });
11718
11723
  };
11719
11724
  GridQuery.prototype.getSecondaryColumn = function (colId) {
11725
+ /** Use getPivotResultColumns from ver 28 */
11720
11726
  var secondaryColumns = this.api.columns.getSecondaryColumns();
11721
11727
  if (secondaryColumns) {
11722
11728
  return secondaryColumns.find(function (col) { return col.getColId() === colId; });
@@ -12047,7 +12053,7 @@
12047
12053
  return contextActions;
12048
12054
  }
12049
12055
 
12050
- var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_AP');
12056
+ var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_API');
12051
12057
 
12052
12058
  var defaultEditableColumnRenderer = function (params) {
12053
12059
  return params && params.value ? "<div class=\"value-wrapper ellipsis\">" + params.value + "</div>" : null;
@@ -12960,6 +12966,7 @@
12960
12966
  var filtersConfig = colDef.filtersConfig || this.colDef.filtersConfig || {};
12961
12967
  var colFilter = filter || colDef.filter;
12962
12968
  var filterOptions = DatoGridFilterOptionsMap[colFilter];
12969
+ /** Use getPivotResultColumn from ver 28 */
12963
12970
  this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
12964
12971
  this.inputConditionsOperator = filtersConfig.inputConditionsOperator;
12965
12972
  if (!isNil(filtersConfig.showClearFiltersButton)) {
@@ -14336,11 +14343,24 @@
14336
14343
  this.initPivotSecondaryColsProcess(params);
14337
14344
  params.gridOptions.enableV2_1 = true;
14338
14345
  params.gridOptions.saveSettings = false;
14339
- params.gridOptions.defaultColDef.cellClass = this.getPivotCellClass.bind(this);
14340
- params.gridOptions.autoGroupColumnDef.cellClass = this.getPivotCellClass.bind(this);
14346
+ params.gridOptions.defaultColDef = __assign(__assign({}, params.gridOptions.defaultColDef), { cellClass: this.getPivotCellClass.bind(this), headerClass: this.getPivotHeaderClass.bind(this) });
14347
+ params.gridOptions.autoGroupColumnDef = __assign(__assign({}, params.gridOptions.autoGroupColumnDef), { cellClass: this.getPivotCellClass.bind(this), headerClass: this.getPivotHeaderClass.bind(this) });
14341
14348
  }
14342
14349
  return params.gridOptions;
14343
14350
  };
14351
+ GridService.prototype.getPivotHeaderClass = function (params) {
14352
+ var gridQuery = params.colDef.headerComponentParams.gridQuery;
14353
+ var cellClass = '';
14354
+ if (gridQuery && gridQuery.api) {
14355
+ var columns = gridQuery.api.columns;
14356
+ /** Use getPivotResultColumns from ver 28 */
14357
+ var pivotColumns = columns.getSecondaryColumns();
14358
+ if (pivotColumns && pivotColumns.length > 0) {
14359
+ cellClass += 'top-border';
14360
+ }
14361
+ }
14362
+ return cellClass;
14363
+ };
14344
14364
  GridService.prototype.getPivotCellClass = function (params) {
14345
14365
  var _a = params.node, leafGroup = _a.leafGroup, childIndex = _a.childIndex, rowGroupIndex = _a.rowGroupIndex;
14346
14366
  var gridQuery = params.colDef.headerComponentParams.gridQuery;
@@ -14356,11 +14376,11 @@
14356
14376
  if (leafGroup) {
14357
14377
  if (childIndex % 2 === 0) {
14358
14378
  /** If row is even */
14359
- cellClass += ' primary-100-background-color';
14379
+ cellClass += ' primary-0-background-color';
14360
14380
  }
14361
14381
  }
14362
14382
  else {
14363
- cellClass += 'primary-0-background-color pointer dato-simple-bold';
14383
+ cellClass += 'bottom-border primary-100-background-color pointer dato-simple-bold';
14364
14384
  }
14365
14385
  }
14366
14386
  }
@@ -14669,8 +14689,7 @@
14669
14689
  this.updateSettings({ gridAlignment: gridAlignment, columnsSizes: null });
14670
14690
  };
14671
14691
  GridService.prototype.saveSettingsToServer = function (settings) {
14672
- var isGlobal = this.gridQuery.getGridOptions().isGlobalSettings;
14673
- this.storageAPI.set(this.gridName, settings, isGlobal);
14692
+ this.storageAPI.set(this.gridName, settings);
14674
14693
  };
14675
14694
  /**
14676
14695
  * @internal used to log grid events to the platform's logging service
@@ -15142,6 +15161,7 @@
15142
15161
  GridService.prototype.initPivotSecondaryColsProcess = function (_a) {
15143
15162
  var _this = this;
15144
15163
  var gridOptions = _a.gridOptions;
15164
+ /** Use processPivotResultColDef from ver 28 */
15145
15165
  gridOptions.processSecondaryColDef = function (colDef) {
15146
15166
  var userProvidedColDef = colDef.pivotValueColumn && colDef.pivotValueColumn.getUserProvidedColDef();
15147
15167
  if (userProvidedColDef) {
@@ -15154,6 +15174,7 @@
15154
15174
  });
15155
15175
  }
15156
15176
  };
15177
+ /** Use processPivotResultColGroupDe from ver 28 */
15157
15178
  gridOptions.processSecondaryColGroupDef = function (colGroupDef) {
15158
15179
  if (colGroupDef.headerName) {
15159
15180
  var parsedValue = tryParsePivotValue(colGroupDef.headerName);
@@ -15675,10 +15696,7 @@
15675
15696
  .pipe(operators.switchMap(function () {
15676
15697
  _this.gridOptions = _this.normalizeOptions();
15677
15698
  agGrid.gridOptions = _this.gridOptions;
15678
- var isGlobal = _this.gridOptions.isGlobalSettings;
15679
- var settingsLoader = _this.gridOptions.saveSettings === false
15680
- ? rxjs.of(null)
15681
- : _this.storageAPI.get(_this.gridOptions.gridName, isGlobal);
15699
+ var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
15682
15700
  return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
15683
15701
  }), ngxTakeUntilDestroy.untilDestroyed(this))
15684
15702
  .subscribe(function (_a) {
@@ -16973,18 +16991,6 @@
16973
16991
  this.registerGroupListeners();
16974
16992
  this.subscribeRowsSelectionData();
16975
16993
  };
16976
- DatoGridV2ToolbarComponent.prototype.getCellValueChangeEvent = function () {
16977
- var _this = this;
16978
- return this.gridController.gridQuery.waitForGrid(function () {
16979
- return _this.gridQuery.gridRef.cellValueChanged.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16980
- });
16981
- };
16982
- DatoGridV2ToolbarComponent.prototype.getRowDataUpdatedEvent = function () {
16983
- var _this = this;
16984
- return this.gridController.gridQuery.waitForGrid(function () {
16985
- return _this.gridQuery.gridRef.rowDataUpdated.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16986
- });
16987
- };
16988
16994
  DatoGridV2ToolbarComponent.prototype.onActionClick = function (action) {
16989
16995
  if (isFunction(action.onClick)) {
16990
16996
  var selectedRowsCount = this.gridController.gridQuery.getSelectedRowsCount();
@@ -21472,40 +21478,6 @@
21472
21478
  * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
21473
21479
  */
21474
21480
 
21475
- var RichTextService = /** @class */ (function () {
21476
- function RichTextService(http, config) {
21477
- this.http = http;
21478
- this.config = config;
21479
- }
21480
- RichTextService.prototype.getLib = function (appendScriptFunc, appendStyleFunc) {
21481
- if (!this.richTextScript$) {
21482
- this.initLib(appendScriptFunc, appendStyleFunc);
21483
- }
21484
- return this.richTextScript$;
21485
- };
21486
- RichTextService.prototype.initLib = function (appendScriptFunc, appendStyleFunc) {
21487
- this.richTextScript$ = rxjs.combineLatest([
21488
- this.http
21489
- .get(this.config.paths.richText + "/index.js", { responseType: 'text' })
21490
- .pipe(operators.tap(function (lib) { return appendScriptFunc(lib, 'rich-text-editor'); })),
21491
- this.http
21492
- .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21493
- .pipe(operators.tap(function (style) { return appendStyleFunc(style, 'tinymce-autocomplete'); }))
21494
- ]).pipe(operators.shareReplay(1));
21495
- };
21496
- RichTextService.ctorParameters = function () { return [
21497
- { type: http.HttpClient },
21498
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21499
- ]; };
21500
- RichTextService.ɵprov = core.ɵɵdefineInjectable({ factory: function RichTextService_Factory() { return new RichTextService(core.ɵɵinject(http.HttpClient), core.ɵɵinject(DATO_CORE_CONFIG)); }, token: RichTextService, providedIn: "root" });
21501
- RichTextService = __decorate([
21502
- core.Injectable({ providedIn: 'root' }),
21503
- __param(1, core.Inject(DATO_CORE_CONFIG)),
21504
- __metadata("design:paramtypes", [http.HttpClient, Object])
21505
- ], RichTextService);
21506
- return RichTextService;
21507
- }());
21508
-
21509
21481
  /**
21510
21482
  * @license
21511
21483
  * Copyright Datorama. All Rights Reserved.
@@ -21519,20 +21491,20 @@
21519
21491
  var ɵ0$3 = getTinymce;
21520
21492
  var DatoRichTextDirective = /** @class */ (function (_super) {
21521
21493
  __extends(DatoRichTextDirective, _super);
21522
- function DatoRichTextDirective(ngZone, richTextService, config, host) {
21494
+ function DatoRichTextDirective(ngZone, http, host, config) {
21523
21495
  var _this = _super.call(this) || this;
21524
21496
  _this.ngZone = ngZone;
21525
- _this.richTextService = richTextService;
21526
- _this.config = config;
21497
+ _this.http = http;
21527
21498
  _this.host = host;
21499
+ _this.config = config;
21528
21500
  _this.autocompleteOptions = {};
21529
21501
  _this.forcePlainTextPasting = false;
21530
21502
  _this.format = 'html';
21531
21503
  _this.isOneLine = false;
21532
21504
  _this.initialValue = '';
21533
- _this.defaultPlugins = 'link fullscreen image lists table autocomplete';
21505
+ _this.defaultPlugins = 'link fullscreen textcolor colorpicker image lists table textpattern autocomplete';
21534
21506
  _this.defaultToolbar = [
21535
- 'fontfamily fontsize forecolor backcolor bold italic underline link',
21507
+ 'fontselect fontsizeselect forecolor backcolor bold italic underline link',
21536
21508
  'alignleft aligncenter alignright alignjustify outdent indent | table numlist bullist | image fullscreen'
21537
21509
  ];
21538
21510
  return _this;
@@ -21558,11 +21530,28 @@
21558
21530
  base: this.config.paths.richText,
21559
21531
  query: ''
21560
21532
  };
21561
- this.richTextService
21562
- .getLib(appendScript, appendStyle)
21563
- .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
21564
- .subscribe(function () {
21565
- _this.init.call(_this);
21533
+ /**
21534
+ * We support only one instance in load time
21535
+ */
21536
+ if (window.tinymce) {
21537
+ this.init.call(this);
21538
+ }
21539
+ else {
21540
+ this.loadLib().subscribe(function (lib) {
21541
+ appendScript(lib, 'rich-text-editor');
21542
+ _this.init.call(_this);
21543
+ _this.loadAutoCompleteStyle();
21544
+ });
21545
+ }
21546
+ };
21547
+ DatoRichTextDirective.prototype.loadLib = function () {
21548
+ return this.http.get(this.config.paths.richText + "/index.js", { responseType: 'text' });
21549
+ };
21550
+ DatoRichTextDirective.prototype.loadAutoCompleteStyle = function () {
21551
+ this.http
21552
+ .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21553
+ .subscribe(function (style) {
21554
+ appendStyle(style, 'tinymce-autocomplete');
21566
21555
  });
21567
21556
  };
21568
21557
  DatoRichTextDirective.prototype.initEditor = function (_, editor) {
@@ -21586,6 +21575,8 @@
21586
21575
  target: this.host.nativeElement,
21587
21576
  width: this.width || 600,
21588
21577
  height: this.height || 300,
21578
+ force_br_newlines: true,
21579
+ force_p_newlines: false,
21589
21580
  resize: 'both',
21590
21581
  branding: false,
21591
21582
  inline: this.inline,
@@ -21593,12 +21584,10 @@
21593
21584
  readonly: this.disabled,
21594
21585
  plugins: this.plugins || this.defaultPlugins,
21595
21586
  toolbar: isNil(this.toolbar) ? this.defaultToolbar : this.toolbar,
21596
- font_size_formats: '8px 10px 12px 14px 18px 24px 36px',
21587
+ fontsize_formats: '8px 10px 12px 14px 18px 24px 36px',
21597
21588
  min_width: 480,
21598
21589
  menubar: false,
21599
21590
  autocomplete: this.autocompleteOptions,
21600
- suffix: '.min',
21601
- skin: 'tinymce-5',
21602
21591
  setup: function (editor) {
21603
21592
  _this.editor = editor;
21604
21593
  editor.on('init', function (e) {
@@ -21655,9 +21644,9 @@
21655
21644
  var DatoRichTextDirective_1;
21656
21645
  DatoRichTextDirective.ctorParameters = function () { return [
21657
21646
  { type: core.NgZone },
21658
- { type: RichTextService },
21659
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] },
21660
- { type: core.ElementRef }
21647
+ { type: http.HttpClient },
21648
+ { type: core.ElementRef },
21649
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21661
21650
  ]; };
21662
21651
  __decorate([
21663
21652
  core.Input(),
@@ -21723,9 +21712,10 @@
21723
21712
  }
21724
21713
  ]
21725
21714
  }),
21726
- __param(2, core.Inject(DATO_CORE_CONFIG)),
21715
+ __param(3, core.Inject(DATO_CORE_CONFIG)),
21727
21716
  __metadata("design:paramtypes", [core.NgZone,
21728
- RichTextService, Object, core.ElementRef])
21717
+ http.HttpClient,
21718
+ core.ElementRef, Object])
21729
21719
  ], DatoRichTextDirective);
21730
21720
  return DatoRichTextDirective;
21731
21721
  }(BaseCustomControl));
@@ -24248,9 +24238,7 @@
24248
24238
  };
24249
24239
  DatoBreadcrumbsComponent.prototype.initEditableHeader = function () {
24250
24240
  var _this = this;
24251
- this.headerControl.valueChanges
24252
- .pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this))
24253
- .subscribe(function (res) {
24241
+ this.headerControl.valueChanges.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (res) {
24254
24242
  _this.updateEditableText.emit(res);
24255
24243
  _this.cdr.detectChanges();
24256
24244
  });
@@ -25613,7 +25601,7 @@
25613
25601
  };
25614
25602
  }
25615
25603
 
25616
- window.coreVersion = '22.10.9-rc.';
25604
+ window.coreVersion = '22.11.1';
25617
25605
 
25618
25606
  exports.APP_TRANSLATE = APP_TRANSLATE;
25619
25607
  exports.AceService = AceService;
@@ -26055,7 +26043,6 @@
26055
26043
  exports.ɵl = DatoGridItemsCountCellComponent;
26056
26044
  exports.ɵm = DatoGridV2ToolbarMoreMenuComponent;
26057
26045
  exports.ɵn = DatoGridSearchBarComponent;
26058
- exports.ɵo = RichTextService;
26059
26046
 
26060
26047
  Object.defineProperty(exports, '__esModule', { value: true });
26061
26048