@revolist/revogrid 4.0.37 → 4.0.40
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.
- package/dist/cjs/revo-grid.cjs.entry.js +56 -35
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
- package/dist/collection/components/revoGrid/revo-grid.js +56 -35
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
- package/dist/esm/revo-grid.entry.js +56 -35
- package/dist/esm/revo-grid.entry.js.map +1 -1
- package/dist/revo-grid/revo-grid.entry.js +1 -1
- package/dist/revo-grid/revo-grid.entry.js.map +1 -1
- package/dist/types/components/revoGrid/revo-grid.d.ts +12 -2
- package/hydrate/index.js +56 -35
- package/hydrate/index.mjs +56 -35
- package/package.json +5 -1
- package/standalone/revo-grid.js +56 -35
- package/standalone/revo-grid.js.map +1 -1
|
@@ -3212,6 +3212,7 @@ const RevoGridComponent = class {
|
|
|
3212
3212
|
// UUID required to support multiple grids in one page and avoid collision
|
|
3213
3213
|
this.uuid = null;
|
|
3214
3214
|
this.viewport = null;
|
|
3215
|
+
this.isInited = false;
|
|
3215
3216
|
/**
|
|
3216
3217
|
* Plugins
|
|
3217
3218
|
* Define plugins collection
|
|
@@ -3722,30 +3723,11 @@ const RevoGridComponent = class {
|
|
|
3722
3723
|
this.extraElements = [...this.extraElements, ...elements];
|
|
3723
3724
|
}
|
|
3724
3725
|
// #endregion
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
return Promise.all(this.jobsBeforeRender);
|
|
3731
|
-
}
|
|
3732
|
-
connectedCallback() {
|
|
3733
|
-
// #region Setup Providers
|
|
3734
|
-
this.viewportProvider = new ViewportProvider();
|
|
3735
|
-
this.themeService = new ThemeService({
|
|
3736
|
-
rowSize: this.rowSize,
|
|
3737
|
-
});
|
|
3738
|
-
this.dimensionProvider = new DimensionProvider(this.viewportProvider, {
|
|
3739
|
-
realSizeChanged: (k) => this.contentsizechanged.emit(k),
|
|
3740
|
-
});
|
|
3741
|
-
this.columnProvider = new ColumnDataProvider();
|
|
3742
|
-
this.selectionStoreConnector = new SelectionStoreConnector();
|
|
3743
|
-
this.dataProvider = new DataProvider(this.dimensionProvider);
|
|
3744
|
-
// #endregion
|
|
3745
|
-
// generate uuid for this grid
|
|
3746
|
-
this.uuid = `${new Date().getTime()}-rvgrid`;
|
|
3747
|
-
this.registerOutsideVNodes(this.registerVNode);
|
|
3748
|
-
// #region Plugins
|
|
3726
|
+
// #region Plugins
|
|
3727
|
+
setPlugins() {
|
|
3728
|
+
var _a;
|
|
3729
|
+
// remove old plugins if any
|
|
3730
|
+
this.removePlugins();
|
|
3749
3731
|
// pass data provider to plugins
|
|
3750
3732
|
const pluginData = {
|
|
3751
3733
|
data: this.dataProvider,
|
|
@@ -3776,12 +3758,43 @@ const RevoGridComponent = class {
|
|
|
3776
3758
|
this.internalPlugins.push(new ColumnPlugin(this.element, pluginData));
|
|
3777
3759
|
}
|
|
3778
3760
|
// register user plugins
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3761
|
+
(_a = this.plugins) === null || _a === void 0 ? void 0 : _a.forEach(p => this.internalPlugins.push(new p(this.element, pluginData)));
|
|
3762
|
+
}
|
|
3763
|
+
removePlugins() {
|
|
3764
|
+
this.internalPlugins.forEach(p => p.destroy());
|
|
3765
|
+
this.internalPlugins = [];
|
|
3766
|
+
}
|
|
3767
|
+
// #endregion
|
|
3768
|
+
// if reconnect to dom we need to set up plugins
|
|
3769
|
+
connectedCallback() {
|
|
3770
|
+
if (this.isInited) {
|
|
3771
|
+
this.setPlugins();
|
|
3783
3772
|
}
|
|
3773
|
+
}
|
|
3774
|
+
/**
|
|
3775
|
+
* Called once just after the component is first connected to the DOM.
|
|
3776
|
+
* Since this method is only called once, it's a good place to load data asynchronously and to setup the state
|
|
3777
|
+
* without triggering extra re-renders.
|
|
3778
|
+
* A promise can be returned, that can be used to wait for the first render().
|
|
3779
|
+
*/
|
|
3780
|
+
componentWillLoad() {
|
|
3781
|
+
// #region Setup Providers
|
|
3782
|
+
this.viewportProvider = new ViewportProvider();
|
|
3783
|
+
this.themeService = new ThemeService({
|
|
3784
|
+
rowSize: this.rowSize,
|
|
3785
|
+
});
|
|
3786
|
+
this.dimensionProvider = new DimensionProvider(this.viewportProvider, {
|
|
3787
|
+
realSizeChanged: (k) => this.contentsizechanged.emit(k),
|
|
3788
|
+
});
|
|
3789
|
+
this.columnProvider = new ColumnDataProvider();
|
|
3790
|
+
this.selectionStoreConnector = new SelectionStoreConnector();
|
|
3791
|
+
this.dataProvider = new DataProvider(this.dimensionProvider);
|
|
3784
3792
|
// #endregion
|
|
3793
|
+
// generate uuid for this grid
|
|
3794
|
+
this.uuid = `rv--${Math.random().toString(36).slice(2, 6)}-${Date.now()}`;
|
|
3795
|
+
this.registerOutsideVNodes(this.registerVNode);
|
|
3796
|
+
// init plugins
|
|
3797
|
+
this.setPlugins();
|
|
3785
3798
|
// set data
|
|
3786
3799
|
this.applyStretch(this.stretch);
|
|
3787
3800
|
this.themeChanged(this.theme, undefined, undefined, true);
|
|
@@ -3801,11 +3814,15 @@ const RevoGridComponent = class {
|
|
|
3801
3814
|
this.viewportscroll.emit(e);
|
|
3802
3815
|
});
|
|
3803
3816
|
this.aftergridinit.emit();
|
|
3817
|
+
// set inited flag for connectedCallback
|
|
3818
|
+
this.isInited = true;
|
|
3804
3819
|
}
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3820
|
+
componentWillRender() {
|
|
3821
|
+
const event = this.beforegridrender.emit();
|
|
3822
|
+
if (event.defaultPrevented) {
|
|
3823
|
+
return false;
|
|
3824
|
+
}
|
|
3825
|
+
return Promise.all(this.jobsBeforeRender);
|
|
3809
3826
|
}
|
|
3810
3827
|
render() {
|
|
3811
3828
|
const contentHeight = this.dimensionProvider.stores['rgRow'].store.get('realSize');
|
|
@@ -3843,7 +3860,7 @@ const RevoGridComponent = class {
|
|
|
3843
3860
|
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 });
|
|
3844
3861
|
// Column headers
|
|
3845
3862
|
const dataViews = [
|
|
3846
|
-
h("revogr-header", Object.assign({ key: '
|
|
3863
|
+
h("revogr-header", Object.assign({ key: '67b0af56acae99e5b999c0b338a279b076022171' }, headerProperties, { slot: HEADER_SLOT })),
|
|
3847
3864
|
];
|
|
3848
3865
|
// Render viewport data (vertical sections)
|
|
3849
3866
|
view.dataPorts.forEach(data => {
|
|
@@ -3865,11 +3882,15 @@ const RevoGridComponent = class {
|
|
|
3865
3882
|
const typeCol = 'rgCol';
|
|
3866
3883
|
const viewports = this.viewportProvider.stores;
|
|
3867
3884
|
const dimensions = this.dimensionProvider.stores;
|
|
3868
|
-
return (h(Host, { key: '
|
|
3885
|
+
return (h(Host, { key: '3837943944ca3c255083a2fa7fa125291442b98a', [`${UUID}`]: this.uuid }, this.hideAttribution ? null : (h("revogr-attribution", { class: "attribution" })), h("div", { key: '97e0e9cbd158c398945e0d5c0c43a93422c090f9', class: "main-viewport", onClick: (e) => {
|
|
3869
3886
|
if (e.currentTarget === e.target) {
|
|
3870
3887
|
this.viewport.clearEdit();
|
|
3871
3888
|
}
|
|
3872
|
-
} }, h("div", { key: '
|
|
3889
|
+
} }, h("div", { key: '9c77a61499d749aa2e786f593715d8bcacdb3ad0', class: "viewports" }, h("slot", { key: '8af1657ec8ec9b7f56afe957f589d64b55c53bcd', name: "viewport" }), viewportSections, h("revogr-scroll-virtual", { key: '1947f0706d5e9e552822a44a55504ae82c603ce7', 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: '6cf863db4b189cf9480d5aca1473832f0ee322b5', ref: e => (this.orderService = e) }))), h("revogr-scroll-virtual", { key: '542cc17558cc0cfa1def201870e0cac8f83ebd36', 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));
|
|
3890
|
+
}
|
|
3891
|
+
disconnectedCallback() {
|
|
3892
|
+
// Remove all plugins, to avoid memory leaks and unexpected behaviour when the component is removed
|
|
3893
|
+
this.removePlugins();
|
|
3873
3894
|
}
|
|
3874
3895
|
get element() { return getElement(this); }
|
|
3875
3896
|
static get watchers() { return {
|