@datorama/core 22.12.3 → 22.12.4-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 (40) hide show
  1. package/bundles/datorama-core.umd.js +85 -53
  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-filter/grid-filter.component.js +7 -5
  12. package/esm2015/lib/grid-v2/grid-settings.js +2 -2
  13. package/esm2015/lib/grid-v2/grid-store/grid.service.js +3 -2
  14. package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +7 -1
  15. package/esm2015/lib/rich-text/rich-text.directive.js +20 -38
  16. package/esm2015/lib/rich-text/rich-text.service.js +50 -0
  17. package/esm2015/lib/select/select.component.js +4 -9
  18. package/esm2015/lib/version.js +2 -2
  19. package/esm5/datorama-core.js +2 -1
  20. package/esm5/lib/breadcrumbs/breadcrumbs.component.js +4 -2
  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 +5 -2
  23. package/esm5/lib/grid-v2/grid-filter/grid-filter.component.js +7 -5
  24. package/esm5/lib/grid-v2/grid-settings.js +2 -2
  25. package/esm5/lib/grid-v2/grid-store/grid.service.js +3 -2
  26. package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +13 -1
  27. package/esm5/lib/rich-text/rich-text.directive.js +21 -39
  28. package/esm5/lib/rich-text/rich-text.service.js +51 -0
  29. package/esm5/lib/select/select.component.js +4 -9
  30. package/esm5/lib/version.js +2 -2
  31. package/fesm2015/datorama-core.js +77 -53
  32. package/fesm2015/datorama-core.js.map +1 -1
  33. package/fesm5/datorama-core.js +85 -54
  34. package/fesm5/datorama-core.js.map +1 -1
  35. package/lib/grid-v2/grid/grid-v2.types.d.ts +1 -0
  36. package/lib/grid-v2/grid-settings.d.ts +2 -2
  37. package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +2 -0
  38. package/lib/rich-text/rich-text.directive.d.ts +4 -6
  39. package/lib/rich-text/rich-text.service.d.ts +10 -0
  40. package/package.json +2 -2
@@ -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();
@@ -12105,7 +12100,7 @@
12105
12100
  return contextActions;
12106
12101
  }
12107
12102
 
12108
- var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_API');
12103
+ var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_AP');
12109
12104
 
12110
12105
  var defaultEditableColumnRenderer = function (params) {
12111
12106
  return params && params.value ? "<div class=\"value-wrapper ellipsis\">" + params.value + "</div>" : null;
@@ -13420,10 +13415,12 @@
13420
13415
  DatoGridFilterComponent.prototype.updateDateInput = function (_a) {
13421
13416
  var inRange = _a.inRange, index = _a.index;
13422
13417
  var control = this.conditions.at(index).get('value');
13423
- if (control.dirty) {
13424
- var value = control.value;
13425
- var newValue = inRange ? { from: value, to: value } : value.from;
13426
- control.patchValue(newValue);
13418
+ var value = control.value;
13419
+ if (inRange && typeof value === 'string') {
13420
+ control.patchValue({ from: value, to: value, id: 'CUSTOM' });
13421
+ }
13422
+ else if (!inRange && value && typeof value === 'object') {
13423
+ control.patchValue(value.from);
13427
13424
  }
13428
13425
  };
13429
13426
  DatoGridFilterComponent.prototype.updateNumberInput = function (_a) {
@@ -14767,7 +14764,8 @@
14767
14764
  this.updateSettings({ gridAlignment: gridAlignment, columnsSizes: null });
14768
14765
  };
14769
14766
  GridService.prototype.saveSettingsToServer = function (settings) {
14770
- this.storageAPI.set(this.gridName, settings);
14767
+ var isGlobal = this.gridQuery.getGridOptions().isGlobalSettings;
14768
+ this.storageAPI.set(this.gridName, settings, isGlobal);
14771
14769
  };
14772
14770
  /**
14773
14771
  * @internal used to log grid events to the platform's logging service
@@ -15777,7 +15775,10 @@
15777
15775
  .pipe(operators.switchMap(function () {
15778
15776
  _this.gridOptions = _this.normalizeOptions();
15779
15777
  agGrid.gridOptions = _this.gridOptions;
15780
- var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
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);
15781
15782
  return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
15782
15783
  }), ngxTakeUntilDestroy.untilDestroyed(this))
15783
15784
  .subscribe(function (_a) {
@@ -17072,6 +17073,18 @@
17072
17073
  this.registerGroupListeners();
17073
17074
  this.subscribeRowsSelectionData();
17074
17075
  };
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
+ };
17075
17088
  DatoGridV2ToolbarComponent.prototype.onActionClick = function (action) {
17076
17089
  if (isFunction(action.onClick)) {
17077
17090
  var selectedRowsCount = this.gridController.gridQuery.getSelectedRowsCount();
@@ -21559,6 +21572,40 @@
21559
21572
  * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
21560
21573
  */
21561
21574
 
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
+
21562
21609
  /**
21563
21610
  * @license
21564
21611
  * Copyright Datorama. All Rights Reserved.
@@ -21572,20 +21619,20 @@
21572
21619
  var ɵ0$3 = getTinymce;
21573
21620
  var DatoRichTextDirective = /** @class */ (function (_super) {
21574
21621
  __extends(DatoRichTextDirective, _super);
21575
- function DatoRichTextDirective(ngZone, http, host, config) {
21622
+ function DatoRichTextDirective(ngZone, richTextService, config, host) {
21576
21623
  var _this = _super.call(this) || this;
21577
21624
  _this.ngZone = ngZone;
21578
- _this.http = http;
21579
- _this.host = host;
21625
+ _this.richTextService = richTextService;
21580
21626
  _this.config = config;
21627
+ _this.host = host;
21581
21628
  _this.autocompleteOptions = {};
21582
21629
  _this.forcePlainTextPasting = false;
21583
21630
  _this.format = 'html';
21584
21631
  _this.isOneLine = false;
21585
21632
  _this.initialValue = '';
21586
- _this.defaultPlugins = 'link fullscreen textcolor colorpicker image lists table textpattern autocomplete';
21633
+ _this.defaultPlugins = 'link fullscreen image lists table autocomplete';
21587
21634
  _this.defaultToolbar = [
21588
- 'fontselect fontsizeselect forecolor backcolor bold italic underline link',
21635
+ 'fontfamily fontsize forecolor backcolor bold italic underline link',
21589
21636
  'alignleft aligncenter alignright alignjustify outdent indent | table numlist bullist | image fullscreen'
21590
21637
  ];
21591
21638
  return _this;
@@ -21611,28 +21658,11 @@
21611
21658
  base: this.config.paths.richText,
21612
21659
  query: ''
21613
21660
  };
21614
- /**
21615
- * We support only one instance in load time
21616
- */
21617
- if (window.tinymce) {
21618
- this.init.call(this);
21619
- }
21620
- else {
21621
- this.loadLib().subscribe(function (lib) {
21622
- appendScript(lib, 'rich-text-editor');
21623
- _this.init.call(_this);
21624
- _this.loadAutoCompleteStyle();
21625
- });
21626
- }
21627
- };
21628
- DatoRichTextDirective.prototype.loadLib = function () {
21629
- return this.http.get(this.config.paths.richText + "/index.js", { responseType: 'text' });
21630
- };
21631
- DatoRichTextDirective.prototype.loadAutoCompleteStyle = function () {
21632
- this.http
21633
- .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21634
- .subscribe(function (style) {
21635
- appendStyle(style, 'tinymce-autocomplete');
21661
+ this.richTextService
21662
+ .getLib(appendScript, appendStyle)
21663
+ .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
21664
+ .subscribe(function () {
21665
+ _this.init.call(_this);
21636
21666
  });
21637
21667
  };
21638
21668
  DatoRichTextDirective.prototype.initEditor = function (_, editor) {
@@ -21656,8 +21686,6 @@
21656
21686
  target: this.host.nativeElement,
21657
21687
  width: this.width || 600,
21658
21688
  height: this.height || 300,
21659
- force_br_newlines: true,
21660
- force_p_newlines: false,
21661
21689
  resize: 'both',
21662
21690
  branding: false,
21663
21691
  inline: this.inline,
@@ -21665,10 +21693,12 @@
21665
21693
  readonly: this.disabled,
21666
21694
  plugins: this.plugins || this.defaultPlugins,
21667
21695
  toolbar: isNil(this.toolbar) ? this.defaultToolbar : this.toolbar,
21668
- fontsize_formats: '8px 10px 12px 14px 18px 24px 36px',
21696
+ font_size_formats: '8px 10px 12px 14px 18px 24px 36px',
21669
21697
  min_width: 480,
21670
21698
  menubar: false,
21671
21699
  autocomplete: this.autocompleteOptions,
21700
+ suffix: '.min',
21701
+ skin: 'tinymce-5',
21672
21702
  setup: function (editor) {
21673
21703
  _this.editor = editor;
21674
21704
  editor.on('init', function (e) {
@@ -21725,9 +21755,9 @@
21725
21755
  var DatoRichTextDirective_1;
21726
21756
  DatoRichTextDirective.ctorParameters = function () { return [
21727
21757
  { type: core.NgZone },
21728
- { type: http.HttpClient },
21729
- { type: core.ElementRef },
21730
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21758
+ { type: RichTextService },
21759
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] },
21760
+ { type: core.ElementRef }
21731
21761
  ]; };
21732
21762
  __decorate([
21733
21763
  core.Input(),
@@ -21793,10 +21823,9 @@
21793
21823
  }
21794
21824
  ]
21795
21825
  }),
21796
- __param(3, core.Inject(DATO_CORE_CONFIG)),
21826
+ __param(2, core.Inject(DATO_CORE_CONFIG)),
21797
21827
  __metadata("design:paramtypes", [core.NgZone,
21798
- http.HttpClient,
21799
- core.ElementRef, Object])
21828
+ RichTextService, Object, core.ElementRef])
21800
21829
  ], DatoRichTextDirective);
21801
21830
  return DatoRichTextDirective;
21802
21831
  }(BaseCustomControl));
@@ -24319,7 +24348,9 @@
24319
24348
  };
24320
24349
  DatoBreadcrumbsComponent.prototype.initEditableHeader = function () {
24321
24350
  var _this = this;
24322
- this.headerControl.valueChanges.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (res) {
24351
+ this.headerControl.valueChanges
24352
+ .pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this))
24353
+ .subscribe(function (res) {
24323
24354
  _this.updateEditableText.emit(res);
24324
24355
  _this.cdr.detectChanges();
24325
24356
  });
@@ -25682,7 +25713,7 @@
25682
25713
  };
25683
25714
  }
25684
25715
 
25685
- window.coreVersion = '22.12.3';
25716
+ window.coreVersion = '22.13.3-rc.';
25686
25717
 
25687
25718
  exports.APP_TRANSLATE = APP_TRANSLATE;
25688
25719
  exports.AceService = AceService;
@@ -26126,6 +26157,7 @@
26126
26157
  exports.ɵl = DatoGridItemsCountCellComponent;
26127
26158
  exports.ɵm = DatoGridV2ToolbarMoreMenuComponent;
26128
26159
  exports.ɵn = DatoGridSearchBarComponent;
26160
+ exports.ɵo = RichTextService;
26129
26161
 
26130
26162
  Object.defineProperty(exports, '__esModule', { value: true });
26131
26163