@datorama/core 22.12.8-rc.1 → 22.12.8

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 (38) hide show
  1. package/bundles/datorama-core.umd.js +49 -79
  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 +2 -3
  13. package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -7
  14. package/esm2015/lib/rich-text/rich-text.directive.js +38 -20
  15. package/esm2015/lib/select/select.component.js +9 -4
  16. package/esm2015/lib/version.js +2 -2
  17. package/esm5/datorama-core.js +1 -2
  18. package/esm5/lib/breadcrumbs/breadcrumbs.component.js +2 -4
  19. package/esm5/lib/grid-v2/grid/grid-v2.types.js +1 -1
  20. package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +2 -5
  21. package/esm5/lib/grid-v2/grid-settings.js +2 -2
  22. package/esm5/lib/grid-v2/grid-store/grid.service.js +2 -3
  23. package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -13
  24. package/esm5/lib/rich-text/rich-text.directive.js +39 -21
  25. package/esm5/lib/select/select.component.js +9 -4
  26. package/esm5/lib/version.js +2 -2
  27. package/fesm2015/datorama-core.js +49 -71
  28. package/fesm2015/datorama-core.js.map +1 -1
  29. package/fesm5/datorama-core.js +50 -79
  30. package/fesm5/datorama-core.js.map +1 -1
  31. package/lib/grid-v2/grid/grid-v2.types.d.ts +0 -1
  32. package/lib/grid-v2/grid-settings.d.ts +2 -2
  33. package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +0 -2
  34. package/lib/rich-text/rich-text.directive.d.ts +6 -4
  35. package/package.json +2 -2
  36. package/esm2015/lib/rich-text/rich-text.service.js +0 -50
  37. package/esm5/lib/rich-text/rich-text.service.js +0 -51
  38. 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();
@@ -12103,7 +12108,7 @@
12103
12108
  return contextActions;
12104
12109
  }
12105
12110
 
12106
- var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_AP');
12111
+ var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_API');
12107
12112
 
12108
12113
  var defaultEditableColumnRenderer = function (params) {
12109
12114
  return params && params.value ? "<div class=\"value-wrapper ellipsis\">" + params.value + "</div>" : null;
@@ -14757,8 +14762,7 @@
14757
14762
  this.updateSettings({ gridAlignment: gridAlignment, columnsSizes: null });
14758
14763
  };
14759
14764
  GridService.prototype.saveSettingsToServer = function (settings) {
14760
- var isGlobal = this.gridQuery.getGridOptions().isGlobalSettings;
14761
- this.storageAPI.set(this.gridName, settings, isGlobal);
14765
+ this.storageAPI.set(this.gridName, settings);
14762
14766
  };
14763
14767
  /**
14764
14768
  * @internal used to log grid events to the platform's logging service
@@ -15796,10 +15800,7 @@
15796
15800
  .pipe(operators.switchMap(function () {
15797
15801
  _this.gridOptions = _this.normalizeOptions();
15798
15802
  agGrid.gridOptions = _this.gridOptions;
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);
15803
+ var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
15803
15804
  return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
15804
15805
  }), ngxTakeUntilDestroy.untilDestroyed(this))
15805
15806
  .subscribe(function (_a) {
@@ -17096,18 +17097,6 @@
17096
17097
  this.subscribeRowsSelectionData();
17097
17098
  this.subscribeReloadGridActions();
17098
17099
  };
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
- });
17110
- };
17111
17100
  DatoGridV2ToolbarComponent.prototype.onActionClick = function (action) {
17112
17101
  if (isFunction(action.onClick)) {
17113
17102
  var selectedRowsCount = this.gridController.gridQuery.getSelectedRowsCount();
@@ -21601,40 +21590,6 @@
21601
21590
  * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
21602
21591
  */
21603
21592
 
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
-
21638
21593
  /**
21639
21594
  * @license
21640
21595
  * Copyright Datorama. All Rights Reserved.
@@ -21648,20 +21603,20 @@
21648
21603
  var ɵ0$3 = getTinymce;
21649
21604
  var DatoRichTextDirective = /** @class */ (function (_super) {
21650
21605
  __extends(DatoRichTextDirective, _super);
21651
- function DatoRichTextDirective(ngZone, richTextService, config, host) {
21606
+ function DatoRichTextDirective(ngZone, http, host, config) {
21652
21607
  var _this = _super.call(this) || this;
21653
21608
  _this.ngZone = ngZone;
21654
- _this.richTextService = richTextService;
21655
- _this.config = config;
21609
+ _this.http = http;
21656
21610
  _this.host = host;
21611
+ _this.config = config;
21657
21612
  _this.autocompleteOptions = {};
21658
21613
  _this.forcePlainTextPasting = false;
21659
21614
  _this.format = 'html';
21660
21615
  _this.isOneLine = false;
21661
21616
  _this.initialValue = '';
21662
- _this.defaultPlugins = 'link fullscreen image lists table autocomplete';
21617
+ _this.defaultPlugins = 'link fullscreen textcolor colorpicker image lists table textpattern autocomplete';
21663
21618
  _this.defaultToolbar = [
21664
- 'fontfamily fontsize forecolor backcolor bold italic underline link',
21619
+ 'fontselect fontsizeselect forecolor backcolor bold italic underline link',
21665
21620
  'alignleft aligncenter alignright alignjustify outdent indent | table numlist bullist | image fullscreen'
21666
21621
  ];
21667
21622
  return _this;
@@ -21687,11 +21642,28 @@
21687
21642
  base: this.config.paths.richText,
21688
21643
  query: ''
21689
21644
  };
21690
- this.richTextService
21691
- .getLib(appendScript, appendStyle)
21692
- .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
21693
- .subscribe(function () {
21694
- _this.init.call(_this);
21645
+ /**
21646
+ * We support only one instance in load time
21647
+ */
21648
+ if (window.tinymce) {
21649
+ this.init.call(this);
21650
+ }
21651
+ else {
21652
+ this.loadLib().subscribe(function (lib) {
21653
+ appendScript(lib, 'rich-text-editor');
21654
+ _this.init.call(_this);
21655
+ _this.loadAutoCompleteStyle();
21656
+ });
21657
+ }
21658
+ };
21659
+ DatoRichTextDirective.prototype.loadLib = function () {
21660
+ return this.http.get(this.config.paths.richText + "/index.js", { responseType: 'text' });
21661
+ };
21662
+ DatoRichTextDirective.prototype.loadAutoCompleteStyle = function () {
21663
+ this.http
21664
+ .get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
21665
+ .subscribe(function (style) {
21666
+ appendStyle(style, 'tinymce-autocomplete');
21695
21667
  });
21696
21668
  };
21697
21669
  DatoRichTextDirective.prototype.initEditor = function (_, editor) {
@@ -21715,6 +21687,8 @@
21715
21687
  target: this.host.nativeElement,
21716
21688
  width: this.width || 600,
21717
21689
  height: this.height || 300,
21690
+ force_br_newlines: true,
21691
+ force_p_newlines: false,
21718
21692
  resize: 'both',
21719
21693
  branding: false,
21720
21694
  inline: this.inline,
@@ -21722,12 +21696,10 @@
21722
21696
  readonly: this.disabled,
21723
21697
  plugins: this.plugins || this.defaultPlugins,
21724
21698
  toolbar: isNil(this.toolbar) ? this.defaultToolbar : this.toolbar,
21725
- font_size_formats: '8px 10px 12px 14px 18px 24px 36px',
21699
+ fontsize_formats: '8px 10px 12px 14px 18px 24px 36px',
21726
21700
  min_width: 480,
21727
21701
  menubar: false,
21728
21702
  autocomplete: this.autocompleteOptions,
21729
- suffix: '.min',
21730
- skin: 'tinymce-5',
21731
21703
  setup: function (editor) {
21732
21704
  _this.editor = editor;
21733
21705
  editor.on('init', function (e) {
@@ -21784,9 +21756,9 @@
21784
21756
  var DatoRichTextDirective_1;
21785
21757
  DatoRichTextDirective.ctorParameters = function () { return [
21786
21758
  { type: core.NgZone },
21787
- { type: RichTextService },
21788
- { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] },
21789
- { type: core.ElementRef }
21759
+ { type: http.HttpClient },
21760
+ { type: core.ElementRef },
21761
+ { type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
21790
21762
  ]; };
21791
21763
  __decorate([
21792
21764
  core.Input(),
@@ -21852,9 +21824,10 @@
21852
21824
  }
21853
21825
  ]
21854
21826
  }),
21855
- __param(2, core.Inject(DATO_CORE_CONFIG)),
21827
+ __param(3, core.Inject(DATO_CORE_CONFIG)),
21856
21828
  __metadata("design:paramtypes", [core.NgZone,
21857
- RichTextService, Object, core.ElementRef])
21829
+ http.HttpClient,
21830
+ core.ElementRef, Object])
21858
21831
  ], DatoRichTextDirective);
21859
21832
  return DatoRichTextDirective;
21860
21833
  }(BaseCustomControl));
@@ -24377,9 +24350,7 @@
24377
24350
  };
24378
24351
  DatoBreadcrumbsComponent.prototype.initEditableHeader = function () {
24379
24352
  var _this = this;
24380
- this.headerControl.valueChanges
24381
- .pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this))
24382
- .subscribe(function (res) {
24353
+ this.headerControl.valueChanges.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (res) {
24383
24354
  _this.updateEditableText.emit(res);
24384
24355
  _this.cdr.detectChanges();
24385
24356
  });
@@ -25742,7 +25713,7 @@
25742
25713
  };
25743
25714
  }
25744
25715
 
25745
- window.coreVersion = '22.13.7-rc.';
25716
+ window.coreVersion = '22.12.8';
25746
25717
 
25747
25718
  exports.APP_TRANSLATE = APP_TRANSLATE;
25748
25719
  exports.AceService = AceService;
@@ -26186,7 +26157,6 @@
26186
26157
  exports.ɵl = DatoGridItemsCountCellComponent;
26187
26158
  exports.ɵm = DatoGridV2ToolbarMoreMenuComponent;
26188
26159
  exports.ɵn = DatoGridSearchBarComponent;
26189
- exports.ɵo = RichTextService;
26190
26160
 
26191
26161
  Object.defineProperty(exports, '__esModule', { value: true });
26192
26162