@datorama/core 22.12.8-beta.1 → 22.12.8-rc.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 (43) hide show
  1. package/bundle.scss +9 -0
  2. package/bundles/datorama-core.umd.js +93 -49
  3. package/bundles/datorama-core.umd.js.map +1 -1
  4. package/bundles/datorama-core.umd.min.js +31 -31
  5. package/bundles/datorama-core.umd.min.js.map +1 -1
  6. package/datorama-core.d.ts +1 -0
  7. package/datorama-core.metadata.json +1 -1
  8. package/esm2015/datorama-core.js +2 -1
  9. package/esm2015/lib/breadcrumbs/breadcrumbs.component.js +4 -2
  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 +5 -2
  12. package/esm2015/lib/grid-v2/grid-settings.js +2 -2
  13. package/esm2015/lib/grid-v2/grid-store/grid.service.js +11 -3
  14. package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +13 -1
  15. package/esm2015/lib/icon/icon.types.js +1 -1
  16. package/esm2015/lib/rich-text/rich-text.directive.js +20 -38
  17. package/esm2015/lib/rich-text/rich-text.service.js +50 -0
  18. package/esm2015/lib/select/select.component.js +4 -9
  19. package/esm2015/lib/version.js +2 -2
  20. package/esm5/datorama-core.js +2 -1
  21. package/esm5/lib/breadcrumbs/breadcrumbs.component.js +4 -2
  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 +5 -2
  24. package/esm5/lib/grid-v2/grid-settings.js +2 -2
  25. package/esm5/lib/grid-v2/grid-store/grid.service.js +11 -3
  26. package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +20 -1
  27. package/esm5/lib/icon/icon.types.js +1 -1
  28. package/esm5/lib/rich-text/rich-text.directive.js +21 -39
  29. package/esm5/lib/rich-text/rich-text.service.js +51 -0
  30. package/esm5/lib/select/select.component.js +4 -9
  31. package/esm5/lib/version.js +2 -2
  32. package/fesm2015/datorama-core.js +84 -49
  33. package/fesm2015/datorama-core.js.map +1 -1
  34. package/fesm5/datorama-core.js +93 -50
  35. package/fesm5/datorama-core.js.map +1 -1
  36. package/lib/grid-v2/grid/grid-v2.types.d.ts +1 -0
  37. package/lib/grid-v2/grid-settings.d.ts +2 -2
  38. package/lib/grid-v2/grid-store/grid.service.d.ts +4 -0
  39. package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +3 -0
  40. package/lib/icon/icon.types.d.ts +1 -1
  41. package/lib/rich-text/rich-text.directive.d.ts +4 -6
  42. package/lib/rich-text/rich-text.service.d.ts +10 -0
  43. package/package.json +2 -2
package/bundle.scss CHANGED
@@ -14324,6 +14324,10 @@ dato-input input:disabled:hover {
14324
14324
  background-color: themify(primary-50);
14325
14325
  }
14326
14326
 
14327
+ .dato-grid.pivot-style .ag-cell {
14328
+ color: themify(primary-500);
14329
+ }
14330
+
14327
14331
  .dato-grid.pivot-style .ag-cell .ag-row-group-leaf-indent {
14328
14332
  margin: 0 !important;
14329
14333
  }
@@ -14341,6 +14345,10 @@ dato-input input:disabled:hover {
14341
14345
  height: inherit;
14342
14346
  }
14343
14347
 
14348
+ .dato-grid.pivot-style .ag-header .ag-header-row .ag-header-cell dato-grid-column-header > div span {
14349
+ color: themify(primary-500);
14350
+ }
14351
+
14344
14352
  .dato-grid.pivot-style .ag-header .ag-header-row .ag-header-cell.top-border {
14345
14353
  border-top: 1px solid themify(primary-200);
14346
14354
  }
@@ -14364,6 +14372,7 @@ dato-input input:disabled:hover {
14364
14372
 
14365
14373
  .dato-grid.pivot-style .ag-header .ag-header-row .ag-header-group-cell .ag-header-group-cell-label span {
14366
14374
  height: auto;
14375
+ color: themify(primary-500);
14367
14376
  }
14368
14377
 
14369
14378
  .dato-grid.pivot-style .ag-header .ag-header-row .ag-header-group-cell.ag-header-group-cell-with-group {
@@ -8873,9 +8873,8 @@
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;
8877
8876
  this.markAsActive(this._model, { deselectAll: true });
8878
- overTheLimit && this.updateDisabledState();
8877
+ this.limitSelectedTo && this.updateDisabledState();
8879
8878
  }
8880
8879
  /** For later updates */
8881
8880
  this.cdr.markForCheck();
@@ -9003,7 +9002,6 @@
9003
9002
  };
9004
9003
  DatoSelectComponent.prototype.removeOption = function (option) {
9005
9004
  var _this = this;
9006
- var updateDisabled = this.limitSelectedTo && this._model.length === this.limitSelectedTo;
9007
9005
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== option[_this.idKey]; });
9008
9006
  var optionToRemove = this.options.find(function (datoOption) { return datoOption.option && datoOption.option[_this.idKey] === option[_this.idKey]; });
9009
9007
  /**
@@ -9013,7 +9011,7 @@
9013
9011
  if (optionToRemove) {
9014
9012
  optionToRemove.active = false;
9015
9013
  }
9016
- updateDisabled && this.updateDisabledState();
9014
+ this.limitSelectedTo && this.updateDisabledState();
9017
9015
  this.onChange(this._model);
9018
9016
  this.cdr.markForCheck();
9019
9017
  this.asyncUpdateDropdownPosition();
@@ -9361,9 +9359,6 @@
9361
9359
  if (!datoOption) {
9362
9360
  return;
9363
9361
  }
9364
- var modelLength = this._model.length;
9365
- var updateDisabled = this.limitSelectedTo &&
9366
- (modelLength === this.limitSelectedTo || (modelLength === this.limitSelectedTo - 1 && !datoOption.active));
9367
9362
  datoOption.active = !datoOption.active;
9368
9363
  var rawOption = datoOption.option;
9369
9364
  if (datoOption.active) {
@@ -9372,7 +9367,7 @@
9372
9367
  else {
9373
9368
  this._model = this._model.filter(function (current) { return current[_this.idKey] !== rawOption[_this.idKey]; });
9374
9369
  }
9375
- updateDisabled && this.updateDisabledState();
9370
+ this.limitSelectedTo && this.updateDisabledState();
9376
9371
  this.onChange(this._model);
9377
9372
  this.cdr.markForCheck();
9378
9373
  this.asyncUpdateDropdownPosition();
@@ -12108,7 +12103,7 @@
12108
12103
  return contextActions;
12109
12104
  }
12110
12105
 
12111
- var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_API');
12106
+ var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_AP');
12112
12107
 
12113
12108
  var defaultEditableColumnRenderer = function (params) {
12114
12109
  return params && params.value ? "<div class=\"value-wrapper ellipsis\">" + params.value + "</div>" : null;
@@ -14228,6 +14223,7 @@
14228
14223
  this.logger = logger;
14229
14224
  this.treeConfig = defaultGridTreeLabel;
14230
14225
  this.pageNumberToReturnAfterRefresh = -1;
14226
+ this.reloadGridActionsSubject = new rxjs.Subject();
14231
14227
  this.CHECKBOX_SELECTION_COL_ID = 'grid-checkbox-selection';
14232
14228
  }
14233
14229
  Object.defineProperty(GridService.prototype, "treeData", {
@@ -14260,6 +14256,12 @@
14260
14256
  ? context
14261
14257
  : deepmerge(this.gridRef.gridOptions.context || {}, context);
14262
14258
  };
14259
+ GridService.prototype.reloadGridActions = function () {
14260
+ this.reloadGridActionsSubject.next();
14261
+ };
14262
+ GridService.prototype.onReloadGridActions = function () {
14263
+ return this.reloadGridActionsSubject.asObservable();
14264
+ };
14263
14265
  /**
14264
14266
  * @deprecated use selectRows instead
14265
14267
  * @param row
@@ -14755,7 +14757,8 @@
14755
14757
  this.updateSettings({ gridAlignment: gridAlignment, columnsSizes: null });
14756
14758
  };
14757
14759
  GridService.prototype.saveSettingsToServer = function (settings) {
14758
- this.storageAPI.set(this.gridName, settings);
14760
+ var isGlobal = this.gridQuery.getGridOptions().isGlobalSettings;
14761
+ this.storageAPI.set(this.gridName, settings, isGlobal);
14759
14762
  };
14760
14763
  /**
14761
14764
  * @internal used to log grid events to the platform's logging service
@@ -15793,7 +15796,10 @@
15793
15796
  .pipe(operators.switchMap(function () {
15794
15797
  _this.gridOptions = _this.normalizeOptions();
15795
15798
  agGrid.gridOptions = _this.gridOptions;
15796
- var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
15799
+ var isGlobal = _this.gridOptions.isGlobalSettings;
15800
+ var settingsLoader = _this.gridOptions.saveSettings === false
15801
+ ? rxjs.of(null)
15802
+ : _this.storageAPI.get(_this.gridOptions.gridName, isGlobal);
15797
15803
  return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
15798
15804
  }), ngxTakeUntilDestroy.untilDestroyed(this))
15799
15805
  .subscribe(function (_a) {
@@ -17088,6 +17094,19 @@
17088
17094
  });
17089
17095
  this.registerGroupListeners();
17090
17096
  this.subscribeRowsSelectionData();
17097
+ this.subscribeReloadGridActions();
17098
+ };
17099
+ DatoGridV2ToolbarComponent.prototype.getCellValueChangeEvent = function () {
17100
+ var _this = this;
17101
+ return this.gridController.gridQuery.waitForGrid(function () {
17102
+ return _this.gridQuery.gridRef.cellValueChanged.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
17103
+ });
17104
+ };
17105
+ DatoGridV2ToolbarComponent.prototype.getRowDataUpdatedEvent = function () {
17106
+ var _this = this;
17107
+ return this.gridController.gridQuery.waitForGrid(function () {
17108
+ return _this.gridQuery.gridRef.rowDataUpdated.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
17109
+ });
17091
17110
  };
17092
17111
  DatoGridV2ToolbarComponent.prototype.onActionClick = function (action) {
17093
17112
  if (isFunction(action.onClick)) {
@@ -17343,6 +17362,12 @@
17343
17362
  _this.cdr.detectChanges();
17344
17363
  });
17345
17364
  };
17365
+ DatoGridV2ToolbarComponent.prototype.subscribeReloadGridActions = function () {
17366
+ var _this = this;
17367
+ this.gridService.onReloadGridActions().subscribe(function () {
17368
+ _this.initGridActions();
17369
+ });
17370
+ };
17346
17371
  DatoGridV2ToolbarComponent.prototype.selectAllPages = function () {
17347
17372
  if (this.gridQuery.isServerSide) {
17348
17373
  this.gridService.setServerSidePagination({ selectAllRowsEnabled: true, excludedFromSelectAll: [] });
@@ -21576,6 +21601,40 @@
21576
21601
  * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
21577
21602
  */
21578
21603
 
21604
+ var RichTextService = /** @class */ (function () {
21605
+ function RichTextService(http, config) {
21606
+ this.http = http;
21607
+ this.config = config;
21608
+ }
21609
+ RichTextService.prototype.getLib = function (appendScriptFunc, appendStyleFunc) {
21610
+ if (!this.richTextScript$) {
21611
+ this.initLib(appendScriptFunc, appendStyleFunc);
21612
+ }
21613
+ return this.richTextScript$;
21614
+ };
21615
+ RichTextService.prototype.initLib = function (appendScriptFunc, appendStyleFunc) {
21616
+ this.richTextScript$ = rxjs.combineLatest([
21617
+ this.http
21618
+ .get(this.config.paths.richText + "/index.js", { responseType: 'text' })
21619
+ .pipe(operators.tap(function (lib) { return appendScriptFunc(lib, 'rich-text-editor'); })),
21620
+ this.http
21621
+ .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21622
+ .pipe(operators.tap(function (style) { return appendStyleFunc(style, 'tinymce-autocomplete'); }))
21623
+ ]).pipe(operators.shareReplay(1));
21624
+ };
21625
+ RichTextService.ctorParameters = function () { return [
21626
+ { type: http.HttpClient },
21627
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21628
+ ]; };
21629
+ RichTextService.ɵprov = core.ɵɵdefineInjectable({ factory: function RichTextService_Factory() { return new RichTextService(core.ɵɵinject(http.HttpClient), core.ɵɵinject(DATO_CORE_CONFIG)); }, token: RichTextService, providedIn: "root" });
21630
+ RichTextService = __decorate([
21631
+ core.Injectable({ providedIn: 'root' }),
21632
+ __param(1, core.Inject(DATO_CORE_CONFIG)),
21633
+ __metadata("design:paramtypes", [http.HttpClient, Object])
21634
+ ], RichTextService);
21635
+ return RichTextService;
21636
+ }());
21637
+
21579
21638
  /**
21580
21639
  * @license
21581
21640
  * Copyright Datorama. All Rights Reserved.
@@ -21589,20 +21648,20 @@
21589
21648
  var ɵ0$3 = getTinymce;
21590
21649
  var DatoRichTextDirective = /** @class */ (function (_super) {
21591
21650
  __extends(DatoRichTextDirective, _super);
21592
- function DatoRichTextDirective(ngZone, http, host, config) {
21651
+ function DatoRichTextDirective(ngZone, richTextService, config, host) {
21593
21652
  var _this = _super.call(this) || this;
21594
21653
  _this.ngZone = ngZone;
21595
- _this.http = http;
21596
- _this.host = host;
21654
+ _this.richTextService = richTextService;
21597
21655
  _this.config = config;
21656
+ _this.host = host;
21598
21657
  _this.autocompleteOptions = {};
21599
21658
  _this.forcePlainTextPasting = false;
21600
21659
  _this.format = 'html';
21601
21660
  _this.isOneLine = false;
21602
21661
  _this.initialValue = '';
21603
- _this.defaultPlugins = 'link fullscreen textcolor colorpicker image lists table textpattern autocomplete';
21662
+ _this.defaultPlugins = 'link fullscreen image lists table autocomplete';
21604
21663
  _this.defaultToolbar = [
21605
- 'fontselect fontsizeselect forecolor backcolor bold italic underline link',
21664
+ 'fontfamily fontsize forecolor backcolor bold italic underline link',
21606
21665
  'alignleft aligncenter alignright alignjustify outdent indent | table numlist bullist | image fullscreen'
21607
21666
  ];
21608
21667
  return _this;
@@ -21628,28 +21687,11 @@
21628
21687
  base: this.config.paths.richText,
21629
21688
  query: ''
21630
21689
  };
21631
- /**
21632
- * We support only one instance in load time
21633
- */
21634
- if (window.tinymce) {
21635
- this.init.call(this);
21636
- }
21637
- else {
21638
- this.loadLib().subscribe(function (lib) {
21639
- appendScript(lib, 'rich-text-editor');
21640
- _this.init.call(_this);
21641
- _this.loadAutoCompleteStyle();
21642
- });
21643
- }
21644
- };
21645
- DatoRichTextDirective.prototype.loadLib = function () {
21646
- return this.http.get(this.config.paths.richText + "/index.js", { responseType: 'text' });
21647
- };
21648
- DatoRichTextDirective.prototype.loadAutoCompleteStyle = function () {
21649
- this.http
21650
- .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21651
- .subscribe(function (style) {
21652
- appendStyle(style, 'tinymce-autocomplete');
21690
+ this.richTextService
21691
+ .getLib(appendScript, appendStyle)
21692
+ .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
21693
+ .subscribe(function () {
21694
+ _this.init.call(_this);
21653
21695
  });
21654
21696
  };
21655
21697
  DatoRichTextDirective.prototype.initEditor = function (_, editor) {
@@ -21673,8 +21715,6 @@
21673
21715
  target: this.host.nativeElement,
21674
21716
  width: this.width || 600,
21675
21717
  height: this.height || 300,
21676
- force_br_newlines: true,
21677
- force_p_newlines: false,
21678
21718
  resize: 'both',
21679
21719
  branding: false,
21680
21720
  inline: this.inline,
@@ -21682,10 +21722,12 @@
21682
21722
  readonly: this.disabled,
21683
21723
  plugins: this.plugins || this.defaultPlugins,
21684
21724
  toolbar: isNil(this.toolbar) ? this.defaultToolbar : this.toolbar,
21685
- fontsize_formats: '8px 10px 12px 14px 18px 24px 36px',
21725
+ font_size_formats: '8px 10px 12px 14px 18px 24px 36px',
21686
21726
  min_width: 480,
21687
21727
  menubar: false,
21688
21728
  autocomplete: this.autocompleteOptions,
21729
+ suffix: '.min',
21730
+ skin: 'tinymce-5',
21689
21731
  setup: function (editor) {
21690
21732
  _this.editor = editor;
21691
21733
  editor.on('init', function (e) {
@@ -21742,9 +21784,9 @@
21742
21784
  var DatoRichTextDirective_1;
21743
21785
  DatoRichTextDirective.ctorParameters = function () { return [
21744
21786
  { type: core.NgZone },
21745
- { type: http.HttpClient },
21746
- { type: core.ElementRef },
21747
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21787
+ { type: RichTextService },
21788
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] },
21789
+ { type: core.ElementRef }
21748
21790
  ]; };
21749
21791
  __decorate([
21750
21792
  core.Input(),
@@ -21810,10 +21852,9 @@
21810
21852
  }
21811
21853
  ]
21812
21854
  }),
21813
- __param(3, core.Inject(DATO_CORE_CONFIG)),
21855
+ __param(2, core.Inject(DATO_CORE_CONFIG)),
21814
21856
  __metadata("design:paramtypes", [core.NgZone,
21815
- http.HttpClient,
21816
- core.ElementRef, Object])
21857
+ RichTextService, Object, core.ElementRef])
21817
21858
  ], DatoRichTextDirective);
21818
21859
  return DatoRichTextDirective;
21819
21860
  }(BaseCustomControl));
@@ -24336,7 +24377,9 @@
24336
24377
  };
24337
24378
  DatoBreadcrumbsComponent.prototype.initEditableHeader = function () {
24338
24379
  var _this = this;
24339
- this.headerControl.valueChanges.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (res) {
24380
+ this.headerControl.valueChanges
24381
+ .pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this))
24382
+ .subscribe(function (res) {
24340
24383
  _this.updateEditableText.emit(res);
24341
24384
  _this.cdr.detectChanges();
24342
24385
  });
@@ -25699,7 +25742,7 @@
25699
25742
  };
25700
25743
  }
25701
25744
 
25702
- window.coreVersion = '22.12.7';
25745
+ window.coreVersion = '22.13.7-rc.';
25703
25746
 
25704
25747
  exports.APP_TRANSLATE = APP_TRANSLATE;
25705
25748
  exports.AceService = AceService;
@@ -26143,6 +26186,7 @@
26143
26186
  exports.ɵl = DatoGridItemsCountCellComponent;
26144
26187
  exports.ɵm = DatoGridV2ToolbarMoreMenuComponent;
26145
26188
  exports.ɵn = DatoGridSearchBarComponent;
26189
+ exports.ɵo = RichTextService;
26146
26190
 
26147
26191
  Object.defineProperty(exports, '__esModule', { value: true });
26148
26192