@revolist/revogrid 4.9.12 → 4.9.13

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/dist/cjs/revo-grid.cjs.entry.js +64 -6
  2. package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
  3. package/dist/cjs/revogr-attribution_6.cjs.entry.js +2 -2
  4. package/dist/cjs/revogr-data_4.cjs.entry.js +2 -2
  5. package/dist/cjs/revogr-filter-panel.cjs.entry.js +28 -19
  6. package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
  7. package/dist/collection/components/revoGrid/revo-grid.js +64 -6
  8. package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
  9. package/dist/collection/components/rowHeaders/revogr-row-headers.js +1 -1
  10. package/dist/collection/components/scroll/revogr-viewport-scroll.js +1 -1
  11. package/dist/collection/components/scrollable/revogr-scroll-virtual.js +1 -1
  12. package/dist/collection/components/vnode/vnode-converter.js +1 -1
  13. package/dist/collection/plugins/filter/filter.panel.js +28 -19
  14. package/dist/collection/plugins/filter/filter.panel.js.map +1 -1
  15. package/dist/esm/revo-grid.entry.js +64 -6
  16. package/dist/esm/revo-grid.entry.js.map +1 -1
  17. package/dist/esm/revogr-attribution_6.entry.js +2 -2
  18. package/dist/esm/revogr-data_4.entry.js +2 -2
  19. package/dist/esm/revogr-filter-panel.entry.js +28 -19
  20. package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
  21. package/dist/revo-grid/revo-grid.entry.js +1 -1
  22. package/dist/revo-grid/revo-grid.entry.js.map +1 -1
  23. package/dist/revo-grid/revogr-attribution_6.entry.js +1 -1
  24. package/dist/revo-grid/revogr-data_4.entry.js +1 -1
  25. package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
  26. package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
  27. package/dist/types/components/revoGrid/revo-grid.d.ts +2 -2
  28. package/hydrate/index.js +96 -29
  29. package/hydrate/index.mjs +96 -29
  30. package/package.json +1 -1
  31. package/standalone/revo-grid.js +64 -6
  32. package/standalone/revo-grid.js.map +1 -1
  33. package/standalone/revogr-filter-panel.js +28 -19
  34. package/standalone/revogr-filter-panel.js.map +1 -1
  35. package/standalone/revogr-row-headers2.js +1 -1
  36. package/standalone/revogr-scroll-virtual2.js +1 -1
  37. package/standalone/revogr-viewport-scroll2.js +1 -1
  38. package/standalone/vnode-converter.js +1 -1
package/hydrate/index.mjs CHANGED
@@ -3031,6 +3031,7 @@ var RevogrFilterPanelStyle0 = filterStyleCss;
3031
3031
  const defaultType = 'none';
3032
3032
  const FILTER_LIST_CLASS = 'multi-filter-list';
3033
3033
  const FILTER_LIST_CLASS_ACTION = 'multi-filter-list-action';
3034
+ const FILTER_ID = 'add-filter';
3034
3035
  /**
3035
3036
  * Filter panel for editing filters
3036
3037
  */
@@ -3068,22 +3069,27 @@ class FilterPanel {
3068
3069
  this.disableDynamicFiltering = false;
3069
3070
  }
3070
3071
  onMouseDown(e) {
3071
- if (this.changes && !e.defaultPrevented) {
3072
- const el = e.target;
3073
- const select = document.getElementById('add-filter');
3074
- if (select) {
3075
- select.value = defaultType;
3076
- }
3077
- this.currentFilterType = defaultType;
3078
- if (this.changes) {
3079
- this.changes.type = defaultType;
3080
- }
3081
- this.currentFilterId = -1;
3082
- const path = e.composedPath();
3083
- const isOutside = !path.includes(this.element);
3084
- if (isOutside && !isFilterBtn(el)) {
3085
- this.changes = undefined;
3072
+ // click on anything then select drops values to default
3073
+ if (!this.changes || e.defaultPrevented) {
3074
+ return;
3075
+ }
3076
+ const path = e.composedPath();
3077
+ const select = document.getElementById(FILTER_ID);
3078
+ if (select instanceof HTMLSelectElement) {
3079
+ // click on select should be skipped
3080
+ if (path.includes(select)) {
3081
+ return;
3086
3082
  }
3083
+ select.value = defaultType;
3084
+ }
3085
+ this.currentFilterType = defaultType;
3086
+ if (this.changes) {
3087
+ this.changes.type = defaultType;
3088
+ }
3089
+ this.currentFilterId = -1;
3090
+ const isOutside = !path.includes(this.element);
3091
+ if (e.target instanceof HTMLElement && isOutside && !isFilterBtn(e.target)) {
3092
+ this.changes = undefined;
3087
3093
  }
3088
3094
  }
3089
3095
  async show(newEntity) {
@@ -3165,19 +3171,22 @@ class FilterPanel {
3165
3171
  top: `${this.changes.y}px`,
3166
3172
  };
3167
3173
  const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
3168
- return (hAsync(Host, { style: style, ref: (el) => { var _a; ((_a = this.changes) === null || _a === void 0 ? void 0 : _a.autoCorrect) && this.autoCorrect(el); } }, hAsync("label", null, capts.title), hAsync("div", { class: "filter-holder" }, this.getFilterItemsList()), hAsync("div", { class: "add-filter" }, hAsync("select", { id: "add-filter", class: "select-css", onChange: e => this.onAddNewFilter(e) }, this.renderSelectOptions(this.currentFilterType))), hAsync("div", { class: "filter-actions" }, this.disableDynamicFiltering &&
3174
+ return (hAsync(Host, { style: style, ref: (el) => { var _a; ((_a = this.changes) === null || _a === void 0 ? void 0 : _a.autoCorrect) && this.autoCorrect(el); } }, hAsync("label", null, capts.title), hAsync("div", { class: "filter-holder" }, this.getFilterItemsList()), hAsync("div", { class: "add-filter" }, hAsync("select", { id: FILTER_ID, class: "select-css", onChange: e => this.onAddNewFilter(e) }, this.renderSelectOptions(this.currentFilterType))), hAsync("div", { class: "filter-actions" }, this.disableDynamicFiltering &&
3169
3175
  hAsync("button", { id: "revo-button-save", "aria-label": "save", class: "revo-button green", onClick: () => this.onSave() }, capts.save), hAsync("button", { id: "revo-button-reset", "aria-label": "reset", class: "revo-button light", onClick: () => this.onReset() }, capts.reset), hAsync("button", { id: "revo-button-cancel", "aria-label": "cancel", class: "revo-button light", onClick: () => this.onCancel() }, capts.cancel))));
3170
3176
  }
3171
3177
  onFilterTypeChange(e, prop, index) {
3172
- const el = e.target;
3173
- this.filterItems[prop][index].type = el.value;
3178
+ if (!(e.target instanceof HTMLSelectElement)) {
3179
+ return;
3180
+ }
3181
+ this.filterItems[prop][index].type = e.target.value;
3174
3182
  // this re-renders the input to know if we need extra input
3175
3183
  this.filterId++;
3176
3184
  // adding setTimeout will wait for the next tick DOM update then focus on input
3177
3185
  setTimeout(() => {
3178
3186
  const input = document.getElementById('filter-input-' + this.filterItems[prop][index].id);
3179
- if (input)
3187
+ if (input instanceof HTMLInputElement) {
3180
3188
  input.focus();
3189
+ }
3181
3190
  }, 0);
3182
3191
  if (!this.disableDynamicFiltering)
3183
3192
  this.debouncedApplyFilter();
@@ -14317,6 +14326,9 @@ class RevoGridComponent {
14317
14326
  * Can be specific part as rgRow or pinned rgRow or 'all' by default.
14318
14327
  */
14319
14328
  async refresh(type = 'all') {
14329
+ if (!this.dataProvider) {
14330
+ throw new Error('Not connected');
14331
+ }
14320
14332
  this.dataProvider.refresh(type);
14321
14333
  }
14322
14334
  /**
@@ -14335,6 +14347,9 @@ class RevoGridComponent {
14335
14347
  * Scrolls viewport to specified row by index.
14336
14348
  */
14337
14349
  async scrollToRow(coordinate = 0) {
14350
+ if (!this.dimensionProvider) {
14351
+ throw new Error('Not connected');
14352
+ }
14338
14353
  const y = this.dimensionProvider.getViewPortPos({
14339
14354
  coordinate,
14340
14355
  dimension: 'rgRow',
@@ -14345,6 +14360,9 @@ class RevoGridComponent {
14345
14360
  * Scrolls viewport to specified column by index.
14346
14361
  */
14347
14362
  async scrollToColumnIndex(coordinate = 0) {
14363
+ if (!this.dimensionProvider) {
14364
+ throw new Error('Not connected');
14365
+ }
14348
14366
  const x = this.dimensionProvider.getViewPortPos({
14349
14367
  coordinate,
14350
14368
  dimension: 'rgCol',
@@ -14355,6 +14373,9 @@ class RevoGridComponent {
14355
14373
  * Scrolls viewport to specified column by prop
14356
14374
  */
14357
14375
  async scrollToColumnProp(prop, dimension = 'rgCol') {
14376
+ if (!this.dimensionProvider) {
14377
+ throw new Error('Not connected');
14378
+ }
14358
14379
  const coordinate = this.columnProvider.getColumnIndexByProp(prop, dimension);
14359
14380
  if (coordinate < 0) {
14360
14381
  // already on the screen
@@ -14372,6 +14393,9 @@ class RevoGridComponent {
14372
14393
  }
14373
14394
  /** Add trimmed by type */
14374
14395
  async addTrimmed(trimmed, trimmedType = 'external', type = 'rgRow') {
14396
+ if (!this.dataProvider) {
14397
+ throw new Error('Not connected');
14398
+ }
14375
14399
  const event = this.beforetrimmed.emit({
14376
14400
  trimmed,
14377
14401
  trimmedType,
@@ -14407,6 +14431,9 @@ class RevoGridComponent {
14407
14431
  }
14408
14432
  /** Get data from source */
14409
14433
  async getSource(type = 'rgRow') {
14434
+ if (!this.dataProvider) {
14435
+ throw new Error('Not connected');
14436
+ }
14410
14437
  return this.dataProvider.stores[type].store.get('source');
14411
14438
  }
14412
14439
  /**
@@ -14415,6 +14442,9 @@ class RevoGridComponent {
14415
14442
  * @param type - type of source
14416
14443
  */
14417
14444
  async getVisibleSource(type = 'rgRow') {
14445
+ if (!this.dataProvider) {
14446
+ throw new Error('Not connected');
14447
+ }
14418
14448
  return getVisibleSourceItem(this.dataProvider.stores[type].store);
14419
14449
  }
14420
14450
  /**
@@ -14423,6 +14453,9 @@ class RevoGridComponent {
14423
14453
  * @param type - type of source
14424
14454
  */
14425
14455
  async getSourceStore(type = 'rgRow') {
14456
+ if (!this.dataProvider) {
14457
+ throw new Error('Not connected');
14458
+ }
14426
14459
  return this.dataProvider.stores[type].store;
14427
14460
  }
14428
14461
  /**
@@ -14486,6 +14519,9 @@ class RevoGridComponent {
14486
14519
  */
14487
14520
  async getContentSize() {
14488
14521
  var _a;
14522
+ if (!this.dimensionProvider) {
14523
+ throw new Error('Not connected');
14524
+ }
14489
14525
  return (_a = this.dimensionProvider) === null || _a === void 0 ? void 0 : _a.getFullSize();
14490
14526
  }
14491
14527
  /**
@@ -14555,11 +14591,12 @@ class RevoGridComponent {
14555
14591
  (_a = this.orderService) === null || _a === void 0 ? void 0 : _a.moveTip(e.detail);
14556
14592
  }
14557
14593
  async onCellEdit(e) {
14594
+ var _a;
14558
14595
  const { defaultPrevented, detail } = this.beforeedit.emit(e.detail);
14559
14596
  await timeout();
14560
14597
  // apply data
14561
14598
  if (!defaultPrevented) {
14562
- this.dataProvider.setCellData(detail);
14599
+ (_a = this.dataProvider) === null || _a === void 0 ? void 0 : _a.setCellData(detail);
14563
14600
  // @feature: incrimental update for cells
14564
14601
  // this.dataProvider.setCellData(detail, false);
14565
14602
  // await this.setDataAt({
@@ -14572,6 +14609,9 @@ class RevoGridComponent {
14572
14609
  }
14573
14610
  }
14574
14611
  onRangeEdit(e) {
14612
+ if (!this.dataProvider) {
14613
+ throw new Error('Not connected');
14614
+ }
14575
14615
  const { defaultPrevented, detail } = this.beforerangeedit.emit(e.detail);
14576
14616
  if (defaultPrevented) {
14577
14617
  e.preventDefault();
@@ -14616,6 +14656,9 @@ class RevoGridComponent {
14616
14656
  this.columnChanged(this.columns);
14617
14657
  }
14618
14658
  columnChanged(newVal = []) {
14659
+ if (!this.dimensionProvider) {
14660
+ return;
14661
+ }
14619
14662
  const columnGather = getColumns(newVal, 0, this.columnTypes);
14620
14663
  this.beforecolumnsset.emit(columnGather);
14621
14664
  this.dimensionProvider.applyNewColumns(columnGather.columns, this.disableVirtualX);
@@ -14633,11 +14676,17 @@ class RevoGridComponent {
14633
14676
  this.columnChanged(this.columns);
14634
14677
  }
14635
14678
  rowSizeChanged(s) {
14679
+ if (!this.dimensionProvider) {
14680
+ return;
14681
+ }
14636
14682
  // clear existing data
14637
14683
  this.dimensionProvider.setSettings({ originItemSize: s }, 'rgRow');
14638
14684
  this.rowDefChanged(this.rowDefinitions, this.rowDefinitions, 'rowSize', true);
14639
14685
  }
14640
14686
  themeChanged(t, _, __ = 'theme', init = false) {
14687
+ if (!this.dimensionProvider) {
14688
+ return;
14689
+ }
14641
14690
  this.themeService.register(t);
14642
14691
  this.dimensionProvider.setSettings({ originItemSize: this.themeService.rowSize }, 'rgRow');
14643
14692
  this.dimensionProvider.setSettings({ originItemSize: this.colSize }, 'rgCol');
@@ -14652,6 +14701,9 @@ class RevoGridComponent {
14652
14701
  this.afterthemechanged.emit(t);
14653
14702
  }
14654
14703
  dataSourceChanged(newVal = [], _, watchName) {
14704
+ if (!this.dataProvider) {
14705
+ return;
14706
+ }
14655
14707
  let type = 'rgRow';
14656
14708
  switch (watchName) {
14657
14709
  case 'pinnedBottomSource':
@@ -14695,6 +14747,10 @@ class RevoGridComponent {
14695
14747
  this.dataSourceChanged(this.source, this.source, 'source');
14696
14748
  }
14697
14749
  rowDefChanged(after, before, _watchName, forceUpdate = true) {
14750
+ // in firefox it's triggered before init
14751
+ if (!this.dimensionProvider || !this.dataProvider) {
14752
+ return;
14753
+ }
14698
14754
  const { detail: { vals: newVal, oldVals: oldVal }, } = this.beforerowdefinition.emit({
14699
14755
  vals: after,
14700
14756
  oldVals: before,
@@ -14723,8 +14779,9 @@ class RevoGridComponent {
14723
14779
  }
14724
14780
  }
14725
14781
  Object.entries(newRows).forEach(([k, r]) => {
14782
+ var _a;
14726
14783
  const type = k;
14727
- this.dimensionProvider.setCustomSizes(type, r.sizes || {});
14784
+ (_a = this.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setCustomSizes(type, r.sizes || {});
14728
14785
  });
14729
14786
  }
14730
14787
  trimmedRowsChanged(newVal = {}) {
@@ -14748,6 +14805,9 @@ class RevoGridComponent {
14748
14805
  * Stretch Plugin Apply
14749
14806
  */
14750
14807
  applyStretch(isStretch) {
14808
+ if (!this.dimensionProvider || !this.dataProvider) {
14809
+ return;
14810
+ }
14751
14811
  if (isStretch === 'false') {
14752
14812
  isStretch = false;
14753
14813
  }
@@ -14791,6 +14851,9 @@ class RevoGridComponent {
14791
14851
  // #region Plugins
14792
14852
  setPlugins() {
14793
14853
  var _a;
14854
+ if (!this.dimensionProvider || !this.dataProvider) {
14855
+ return;
14856
+ }
14794
14857
  // remove old plugins if any
14795
14858
  this.removePlugins();
14796
14859
  // pass data provider to plugins
@@ -14876,7 +14939,8 @@ class RevoGridComponent {
14876
14939
  this.groupingChanged(this.grouping);
14877
14940
  // init scrolling service
14878
14941
  this.scrollingService = new GridScrollingService((e) => {
14879
- this.dimensionProvider.setViewPortCoordinate({
14942
+ var _a;
14943
+ (_a = this.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setViewPortCoordinate({
14880
14944
  coordinate: e.coordinate,
14881
14945
  type: e.dimension,
14882
14946
  });
@@ -14894,6 +14958,9 @@ class RevoGridComponent {
14894
14958
  return Promise.all(this.jobsBeforeRender);
14895
14959
  }
14896
14960
  render() {
14961
+ if (!this.dimensionProvider || !this.dataProvider) {
14962
+ return;
14963
+ }
14897
14964
  const contentHeight = this.dimensionProvider.stores['rgRow'].store.get('realSize');
14898
14965
  // init viewport service helpers
14899
14966
  this.viewport = new ViewportService({
@@ -14929,7 +14996,7 @@ class RevoGridComponent {
14929
14996
  const headerProperties = Object.assign(Object.assign({}, view.headerProp), { type: view.type, additionalData: this.additionalData, viewportCol: view.viewportCol, selectionStore: view.columnSelectionStore, canResize: this.resize, readonly: this.readonly, columnFilter: !!this.filter });
14930
14997
  // Column headers
14931
14998
  const dataViews = [
14932
- hAsync("revogr-header", Object.assign({ key: '31f0cebc08d5e9222d058c138079ee1d6c228ed2' }, headerProperties, { slot: HEADER_SLOT })),
14999
+ hAsync("revogr-header", Object.assign({}, headerProperties, { slot: HEADER_SLOT })),
14933
15000
  ];
14934
15001
  // Render viewport data (vertical sections)
14935
15002
  view.dataPorts.forEach(data => {
@@ -14951,12 +15018,12 @@ class RevoGridComponent {
14951
15018
  const typeCol = 'rgCol';
14952
15019
  const viewports = this.viewportProvider.stores;
14953
15020
  const dimensions = this.dimensionProvider.stores;
14954
- return (hAsync(Host, { key: '2563091c11d20bef3e25706e64822040002fe5a4' }, this.hideAttribution ? null : (hAsync("revogr-attribution", { class: "attribution" })), hAsync("div", { key: '58fbfb9a4169e6640ad1c4b0f238c006e23d0059', class: "main-viewport", onClick: (e) => {
15021
+ return (hAsync(Host, null, this.hideAttribution ? null : (hAsync("revogr-attribution", { class: "attribution" })), hAsync("div", { class: "main-viewport", onClick: (e) => {
14955
15022
  var _a;
14956
15023
  if (e.currentTarget === e.target) {
14957
15024
  (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.clearEdit();
14958
15025
  }
14959
- } }, hAsync("div", { key: '028984ab42f98828aba4d5b37b831b832978133f', class: "viewports" }, hAsync("slot", { key: '521dacf842476ff8ed35ec4c87c6276c331c4316', name: "viewport" }), viewportSections, hAsync("revogr-scroll-virtual", { key: 'd4e7a0c3cdda8fcc9e64841c0d16f1e557a75144', class: "vertical", dimension: typeRow, viewportStore: viewports[typeRow].store, dimensionStore: dimensions[typeRow].store, ref: el => this.scrollingService.registerElement(el, 'rowScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), hAsync(OrderRenderer, { key: 'c49e93965594b38d6827f8f8c00e3004c8c392f8', ref: e => (this.orderService = e) }))), hAsync("revogr-scroll-virtual", { key: 'ccccd5bdfbd5ccd1dfb76727b7e903a95d262945', class: "horizontal", dimension: typeCol, viewportStore: viewports[typeCol].store, dimensionStore: dimensions[typeCol].store, ref: el => this.scrollingService.registerElement(el, 'colScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), this.extraElements));
15026
+ } }, hAsync("div", { class: "viewports" }, hAsync("slot", { name: "viewport" }), viewportSections, hAsync("revogr-scroll-virtual", { class: "vertical", dimension: typeRow, viewportStore: viewports[typeRow].store, dimensionStore: dimensions[typeRow].store, ref: el => this.scrollingService.registerElement(el, 'rowScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), hAsync(OrderRenderer, { ref: e => (this.orderService = e) }))), hAsync("revogr-scroll-virtual", { class: "horizontal", dimension: typeCol, viewportStore: viewports[typeCol].store, dimensionStore: dimensions[typeCol].store, ref: el => this.scrollingService.registerElement(el, 'colScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), this.extraElements));
14960
15027
  }
14961
15028
  disconnectedCallback() {
14962
15029
  // Remove all plugins, to avoid memory leaks and unexpected behaviour when the component is removed
@@ -16044,7 +16111,7 @@ class RevogrRowHeaders {
16044
16111
  const viewportHeader = Object.assign(Object.assign({}, this.headerProp), { colData: typeof this.rowHeaderColumn === 'object' ? [this.rowHeaderColumn] : [], viewportCol: viewport.store, canResize: false, type: ROW_HEADER_TYPE,
16045
16112
  // parent,
16046
16113
  slot: HEADER_SLOT });
16047
- return (hAsync(Host, { class: { [ROW_HEADER_TYPE]: true }, key: ROW_HEADER_TYPE }, hAsync("revogr-viewport-scroll", Object.assign({ key: '743c1dbaed3edf679c0616a2b79171a43d94806f' }, viewportScroll, { "row-header": true }), hAsync("revogr-header", Object.assign({ key: '53f1f64b1358d7828a5e45807915740ef198df21' }, viewportHeader)), dataViews)));
16114
+ return (hAsync(Host, { class: { [ROW_HEADER_TYPE]: true }, key: ROW_HEADER_TYPE }, hAsync("revogr-viewport-scroll", Object.assign({ key: 'a63769297e9f09edbdccc04012137f843ae92f17' }, viewportScroll, { "row-header": true }), hAsync("revogr-header", Object.assign({ key: '796e213166053e66dbd99298991d92e48e1f49cb' }, viewportHeader)), dataViews)));
16048
16115
  }
16049
16116
  static get cmpMeta() { return {
16050
16117
  "$flags$": 0,
@@ -16373,7 +16440,7 @@ class RevogrScrollVirtual {
16373
16440
  }
16374
16441
  render() {
16375
16442
  const sizeType = this.dimension === 'rgRow' ? 'height' : 'width';
16376
- return (hAsync(Host, { key: '1bf8d494d6d65ffd27f0a663f5c62c9b60cd35e1', onScroll: (e) => this.onScroll(e) }, hAsync("div", { key: '3f554ca3e7822c9bb20fe830fc4122a0d52919ee', style: {
16443
+ return (hAsync(Host, { key: '73aa9ba5bd17eea4d37eaecd63326fca29e4e231', onScroll: (e) => this.onScroll(e) }, hAsync("div", { key: 'c57e42d782f693dc2a93e98f157ef60ebe09398c', style: {
16377
16444
  [sizeType]: `${getContentSize(this.dimensionStore.get('realSize'), this.size, this.viewportStore.get('virtualSize'))}px`,
16378
16445
  } })));
16379
16446
  }
@@ -16629,7 +16696,7 @@ class RevogrViewportScroll {
16629
16696
  this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
16630
16697
  }
16631
16698
  render() {
16632
- return (hAsync(Host, { key: '8395ce30127f30fff81dc67bfe2f4c3b087b2007', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, hAsync("div", { key: 'efd2db0f5b22b394e93923926f86f2ab9bffb8e0', class: "inner-content-table", style: { width: `${this.contentWidth}px` } }, hAsync("div", { key: '2794c7187ec23ac45dab5f6cb3f20ba59102b2a7', class: "header-wrapper", ref: e => (this.header = e) }, hAsync("slot", { key: '1a344d7e5cf58d77818390e8d541de88a75399d0', name: HEADER_SLOT })), hAsync("div", { key: '2aeb56f4bf3f3fc60eaeaffd8c18565beaa127ca', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, hAsync("div", { key: '59482ef73d3c4617c2511b8613056bbc200cd089', class: "content-wrapper", style: { height: `${this.contentHeight}px` } }, hAsync("slot", { key: 'f318ab365e5f6eddcd2812a314f55cac0959c3b4', name: CONTENT_SLOT }))), hAsync("div", { key: '265c036107a8ed3d47b767fec10ae0225cc927cf', class: "footer-wrapper", ref: e => (this.footer = e) }, hAsync("slot", { key: '2aa7e178375b462e666cf067e075856f592714b6', name: FOOTER_SLOT })))));
16699
+ return (hAsync(Host, { key: '5a7d07c999e59a8b96a99c87e50103acb4f18406', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, hAsync("div", { key: '09ac58def608c3bc169ce12e09dd2dc2df1f90a2', class: "inner-content-table", style: { width: `${this.contentWidth}px` } }, hAsync("div", { key: 'c370a3b8d5d2f4925b77020ac85d5f4d06b876e0', class: "header-wrapper", ref: e => (this.header = e) }, hAsync("slot", { key: 'c5feeeaf90e42715bbf13619b2341d23257447fb', name: HEADER_SLOT })), hAsync("div", { key: '7c04ffd6e7893db57f883a736d0a4932743863ea', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, hAsync("div", { key: 'da5db752025ddaaf626411b445b3b90b5b81cdc8', class: "content-wrapper", style: { height: `${this.contentHeight}px` } }, hAsync("slot", { key: 'c5404f4628b68b4b18a6e9143c70e72c50616f9d', name: CONTENT_SLOT }))), hAsync("div", { key: 'ee9e1b5dd297f220aed3efef4b53b4dd74a11837', class: "footer-wrapper", ref: e => (this.footer = e) }, hAsync("slot", { key: '5ff132da3009d959a6e87fbbe3d22930f322c486', name: FOOTER_SLOT })))));
16633
16700
  }
16634
16701
  /**
16635
16702
  * Extra layer for scroll event monitoring, where MouseWheel event is not passing
@@ -16735,7 +16802,7 @@ class VNodeToHtml {
16735
16802
  render() {
16736
16803
  var _a, _b;
16737
16804
  this.vnodes = (_b = (_a = this.redraw) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : null;
16738
- return (hAsync(Host, { key: 'dcaa7c6bd2f1eef1dd9a7f95a723f8ec778681a0', style: { visibility: 'hidden', position: 'absolute' } }, this.vnodes));
16805
+ return (hAsync(Host, { key: '8d02c8cc7a2520cebce307c7f3e7e07107a0a494', style: { visibility: 'hidden', position: 'absolute' } }, this.vnodes));
16739
16806
  }
16740
16807
  get el() { return getElement(this); }
16741
16808
  static get cmpMeta() { return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revolist/revogrid",
3
- "version": "4.9.12",
3
+ "version": "4.9.13",
4
4
  "type": "module",
5
5
  "description": "Virtual reactive data grid spreadsheet component - RevoGrid.",
6
6
  "license": "MIT",
@@ -3501,6 +3501,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3501
3501
  * Can be specific part as rgRow or pinned rgRow or 'all' by default.
3502
3502
  */
3503
3503
  async refresh(type = 'all') {
3504
+ if (!this.dataProvider) {
3505
+ throw new Error('Not connected');
3506
+ }
3504
3507
  this.dataProvider.refresh(type);
3505
3508
  }
3506
3509
  /**
@@ -3519,6 +3522,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3519
3522
  * Scrolls viewport to specified row by index.
3520
3523
  */
3521
3524
  async scrollToRow(coordinate = 0) {
3525
+ if (!this.dimensionProvider) {
3526
+ throw new Error('Not connected');
3527
+ }
3522
3528
  const y = this.dimensionProvider.getViewPortPos({
3523
3529
  coordinate,
3524
3530
  dimension: 'rgRow',
@@ -3529,6 +3535,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3529
3535
  * Scrolls viewport to specified column by index.
3530
3536
  */
3531
3537
  async scrollToColumnIndex(coordinate = 0) {
3538
+ if (!this.dimensionProvider) {
3539
+ throw new Error('Not connected');
3540
+ }
3532
3541
  const x = this.dimensionProvider.getViewPortPos({
3533
3542
  coordinate,
3534
3543
  dimension: 'rgCol',
@@ -3539,6 +3548,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3539
3548
  * Scrolls viewport to specified column by prop
3540
3549
  */
3541
3550
  async scrollToColumnProp(prop, dimension = 'rgCol') {
3551
+ if (!this.dimensionProvider) {
3552
+ throw new Error('Not connected');
3553
+ }
3542
3554
  const coordinate = this.columnProvider.getColumnIndexByProp(prop, dimension);
3543
3555
  if (coordinate < 0) {
3544
3556
  // already on the screen
@@ -3556,6 +3568,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3556
3568
  }
3557
3569
  /** Add trimmed by type */
3558
3570
  async addTrimmed(trimmed, trimmedType = 'external', type = 'rgRow') {
3571
+ if (!this.dataProvider) {
3572
+ throw new Error('Not connected');
3573
+ }
3559
3574
  const event = this.beforetrimmed.emit({
3560
3575
  trimmed,
3561
3576
  trimmedType,
@@ -3591,6 +3606,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3591
3606
  }
3592
3607
  /** Get data from source */
3593
3608
  async getSource(type = 'rgRow') {
3609
+ if (!this.dataProvider) {
3610
+ throw new Error('Not connected');
3611
+ }
3594
3612
  return this.dataProvider.stores[type].store.get('source');
3595
3613
  }
3596
3614
  /**
@@ -3599,6 +3617,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3599
3617
  * @param type - type of source
3600
3618
  */
3601
3619
  async getVisibleSource(type = 'rgRow') {
3620
+ if (!this.dataProvider) {
3621
+ throw new Error('Not connected');
3622
+ }
3602
3623
  return getVisibleSourceItem(this.dataProvider.stores[type].store);
3603
3624
  }
3604
3625
  /**
@@ -3607,6 +3628,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3607
3628
  * @param type - type of source
3608
3629
  */
3609
3630
  async getSourceStore(type = 'rgRow') {
3631
+ if (!this.dataProvider) {
3632
+ throw new Error('Not connected');
3633
+ }
3610
3634
  return this.dataProvider.stores[type].store;
3611
3635
  }
3612
3636
  /**
@@ -3670,6 +3694,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3670
3694
  */
3671
3695
  async getContentSize() {
3672
3696
  var _a;
3697
+ if (!this.dimensionProvider) {
3698
+ throw new Error('Not connected');
3699
+ }
3673
3700
  return (_a = this.dimensionProvider) === null || _a === void 0 ? void 0 : _a.getFullSize();
3674
3701
  }
3675
3702
  /**
@@ -3739,11 +3766,12 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3739
3766
  (_a = this.orderService) === null || _a === void 0 ? void 0 : _a.moveTip(e.detail);
3740
3767
  }
3741
3768
  async onCellEdit(e) {
3769
+ var _a;
3742
3770
  const { defaultPrevented, detail } = this.beforeedit.emit(e.detail);
3743
3771
  await timeout();
3744
3772
  // apply data
3745
3773
  if (!defaultPrevented) {
3746
- this.dataProvider.setCellData(detail);
3774
+ (_a = this.dataProvider) === null || _a === void 0 ? void 0 : _a.setCellData(detail);
3747
3775
  // @feature: incrimental update for cells
3748
3776
  // this.dataProvider.setCellData(detail, false);
3749
3777
  // await this.setDataAt({
@@ -3756,6 +3784,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3756
3784
  }
3757
3785
  }
3758
3786
  onRangeEdit(e) {
3787
+ if (!this.dataProvider) {
3788
+ throw new Error('Not connected');
3789
+ }
3759
3790
  const { defaultPrevented, detail } = this.beforerangeedit.emit(e.detail);
3760
3791
  if (defaultPrevented) {
3761
3792
  e.preventDefault();
@@ -3800,6 +3831,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3800
3831
  this.columnChanged(this.columns);
3801
3832
  }
3802
3833
  columnChanged(newVal = []) {
3834
+ if (!this.dimensionProvider) {
3835
+ return;
3836
+ }
3803
3837
  const columnGather = getColumns(newVal, 0, this.columnTypes);
3804
3838
  this.beforecolumnsset.emit(columnGather);
3805
3839
  this.dimensionProvider.applyNewColumns(columnGather.columns, this.disableVirtualX);
@@ -3817,11 +3851,17 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3817
3851
  this.columnChanged(this.columns);
3818
3852
  }
3819
3853
  rowSizeChanged(s) {
3854
+ if (!this.dimensionProvider) {
3855
+ return;
3856
+ }
3820
3857
  // clear existing data
3821
3858
  this.dimensionProvider.setSettings({ originItemSize: s }, 'rgRow');
3822
3859
  this.rowDefChanged(this.rowDefinitions, this.rowDefinitions, 'rowSize', true);
3823
3860
  }
3824
3861
  themeChanged(t, _, __ = 'theme', init = false) {
3862
+ if (!this.dimensionProvider) {
3863
+ return;
3864
+ }
3825
3865
  this.themeService.register(t);
3826
3866
  this.dimensionProvider.setSettings({ originItemSize: this.themeService.rowSize }, 'rgRow');
3827
3867
  this.dimensionProvider.setSettings({ originItemSize: this.colSize }, 'rgCol');
@@ -3836,6 +3876,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3836
3876
  this.afterthemechanged.emit(t);
3837
3877
  }
3838
3878
  dataSourceChanged(newVal = [], _, watchName) {
3879
+ if (!this.dataProvider) {
3880
+ return;
3881
+ }
3839
3882
  let type = 'rgRow';
3840
3883
  switch (watchName) {
3841
3884
  case 'pinnedBottomSource':
@@ -3879,6 +3922,10 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3879
3922
  this.dataSourceChanged(this.source, this.source, 'source');
3880
3923
  }
3881
3924
  rowDefChanged(after, before, _watchName, forceUpdate = true) {
3925
+ // in firefox it's triggered before init
3926
+ if (!this.dimensionProvider || !this.dataProvider) {
3927
+ return;
3928
+ }
3882
3929
  const { detail: { vals: newVal, oldVals: oldVal }, } = this.beforerowdefinition.emit({
3883
3930
  vals: after,
3884
3931
  oldVals: before,
@@ -3907,8 +3954,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3907
3954
  }
3908
3955
  }
3909
3956
  Object.entries(newRows).forEach(([k, r]) => {
3957
+ var _a;
3910
3958
  const type = k;
3911
- this.dimensionProvider.setCustomSizes(type, r.sizes || {});
3959
+ (_a = this.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setCustomSizes(type, r.sizes || {});
3912
3960
  });
3913
3961
  }
3914
3962
  trimmedRowsChanged(newVal = {}) {
@@ -3932,6 +3980,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3932
3980
  * Stretch Plugin Apply
3933
3981
  */
3934
3982
  applyStretch(isStretch) {
3983
+ if (!this.dimensionProvider || !this.dataProvider) {
3984
+ return;
3985
+ }
3935
3986
  if (isStretch === 'false') {
3936
3987
  isStretch = false;
3937
3988
  }
@@ -3975,6 +4026,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
3975
4026
  // #region Plugins
3976
4027
  setPlugins() {
3977
4028
  var _a;
4029
+ if (!this.dimensionProvider || !this.dataProvider) {
4030
+ return;
4031
+ }
3978
4032
  // remove old plugins if any
3979
4033
  this.removePlugins();
3980
4034
  // pass data provider to plugins
@@ -4060,7 +4114,8 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
4060
4114
  this.groupingChanged(this.grouping);
4061
4115
  // init scrolling service
4062
4116
  this.scrollingService = new GridScrollingService((e) => {
4063
- this.dimensionProvider.setViewPortCoordinate({
4117
+ var _a;
4118
+ (_a = this.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setViewPortCoordinate({
4064
4119
  coordinate: e.coordinate,
4065
4120
  type: e.dimension,
4066
4121
  });
@@ -4078,6 +4133,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
4078
4133
  return Promise.all(this.jobsBeforeRender);
4079
4134
  }
4080
4135
  render() {
4136
+ if (!this.dimensionProvider || !this.dataProvider) {
4137
+ return;
4138
+ }
4081
4139
  const contentHeight = this.dimensionProvider.stores['rgRow'].store.get('realSize');
4082
4140
  // init viewport service helpers
4083
4141
  this.viewport = new ViewportService({
@@ -4113,7 +4171,7 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
4113
4171
  const headerProperties = Object.assign(Object.assign({}, view.headerProp), { type: view.type, additionalData: this.additionalData, viewportCol: view.viewportCol, selectionStore: view.columnSelectionStore, canResize: this.resize, readonly: this.readonly, columnFilter: !!this.filter });
4114
4172
  // Column headers
4115
4173
  const dataViews = [
4116
- h("revogr-header", Object.assign({ key: '31f0cebc08d5e9222d058c138079ee1d6c228ed2' }, headerProperties, { slot: HEADER_SLOT })),
4174
+ h("revogr-header", Object.assign({}, headerProperties, { slot: HEADER_SLOT })),
4117
4175
  ];
4118
4176
  // Render viewport data (vertical sections)
4119
4177
  view.dataPorts.forEach(data => {
@@ -4135,12 +4193,12 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
4135
4193
  const typeCol = 'rgCol';
4136
4194
  const viewports = this.viewportProvider.stores;
4137
4195
  const dimensions = this.dimensionProvider.stores;
4138
- return (h(Host, { key: '2563091c11d20bef3e25706e64822040002fe5a4' }, this.hideAttribution ? null : (h("revogr-attribution", { class: "attribution" })), h("div", { key: '58fbfb9a4169e6640ad1c4b0f238c006e23d0059', class: "main-viewport", onClick: (e) => {
4196
+ return (h(Host, null, this.hideAttribution ? null : (h("revogr-attribution", { class: "attribution" })), h("div", { class: "main-viewport", onClick: (e) => {
4139
4197
  var _a;
4140
4198
  if (e.currentTarget === e.target) {
4141
4199
  (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.clearEdit();
4142
4200
  }
4143
- } }, h("div", { key: '028984ab42f98828aba4d5b37b831b832978133f', class: "viewports" }, h("slot", { key: '521dacf842476ff8ed35ec4c87c6276c331c4316', name: "viewport" }), viewportSections, h("revogr-scroll-virtual", { key: 'd4e7a0c3cdda8fcc9e64841c0d16f1e557a75144', class: "vertical", dimension: typeRow, viewportStore: viewports[typeRow].store, dimensionStore: dimensions[typeRow].store, ref: el => this.scrollingService.registerElement(el, 'rowScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), h(OrderRenderer, { key: 'c49e93965594b38d6827f8f8c00e3004c8c392f8', ref: e => (this.orderService = e) }))), h("revogr-scroll-virtual", { key: 'ccccd5bdfbd5ccd1dfb76727b7e903a95d262945', class: "horizontal", dimension: typeCol, viewportStore: viewports[typeCol].store, dimensionStore: dimensions[typeCol].store, ref: el => this.scrollingService.registerElement(el, 'colScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), this.extraElements));
4201
+ } }, h("div", { class: "viewports" }, h("slot", { name: "viewport" }), viewportSections, h("revogr-scroll-virtual", { class: "vertical", dimension: typeRow, viewportStore: viewports[typeRow].store, dimensionStore: dimensions[typeRow].store, ref: el => this.scrollingService.registerElement(el, 'rowScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), h(OrderRenderer, { ref: e => (this.orderService = e) }))), h("revogr-scroll-virtual", { class: "horizontal", dimension: typeCol, viewportStore: viewports[typeCol].store, dimensionStore: dimensions[typeCol].store, ref: el => this.scrollingService.registerElement(el, 'colScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), this.extraElements));
4144
4202
  }
4145
4203
  disconnectedCallback() {
4146
4204
  // Remove all plugins, to avoid memory leaks and unexpected behaviour when the component is removed