@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.
- package/dist/cjs/revo-grid.cjs.entry.js +64 -6
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-attribution_6.cjs.entry.js +2 -2
- package/dist/cjs/revogr-data_4.cjs.entry.js +2 -2
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +28 -19
- package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
- package/dist/collection/components/revoGrid/revo-grid.js +64 -6
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
- package/dist/collection/components/rowHeaders/revogr-row-headers.js +1 -1
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +1 -1
- package/dist/collection/components/scrollable/revogr-scroll-virtual.js +1 -1
- package/dist/collection/components/vnode/vnode-converter.js +1 -1
- package/dist/collection/plugins/filter/filter.panel.js +28 -19
- package/dist/collection/plugins/filter/filter.panel.js.map +1 -1
- package/dist/esm/revo-grid.entry.js +64 -6
- package/dist/esm/revo-grid.entry.js.map +1 -1
- package/dist/esm/revogr-attribution_6.entry.js +2 -2
- package/dist/esm/revogr-data_4.entry.js +2 -2
- package/dist/esm/revogr-filter-panel.entry.js +28 -19
- package/dist/esm/revogr-filter-panel.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/revo-grid/revogr-attribution_6.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +1 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
- package/dist/types/components/revoGrid/revo-grid.d.ts +2 -2
- package/hydrate/index.js +96 -29
- package/hydrate/index.mjs +96 -29
- package/package.json +1 -1
- package/standalone/revo-grid.js +64 -6
- package/standalone/revo-grid.js.map +1 -1
- package/standalone/revogr-filter-panel.js +28 -19
- package/standalone/revogr-filter-panel.js.map +1 -1
- package/standalone/revogr-row-headers2.js +1 -1
- package/standalone/revogr-scroll-virtual2.js +1 -1
- package/standalone/revogr-viewport-scroll2.js +1 -1
- package/standalone/vnode-converter.js +1 -1
|
@@ -1839,6 +1839,9 @@ const RevoGridComponent = class {
|
|
|
1839
1839
|
* Can be specific part as rgRow or pinned rgRow or 'all' by default.
|
|
1840
1840
|
*/
|
|
1841
1841
|
async refresh(type = 'all') {
|
|
1842
|
+
if (!this.dataProvider) {
|
|
1843
|
+
throw new Error('Not connected');
|
|
1844
|
+
}
|
|
1842
1845
|
this.dataProvider.refresh(type);
|
|
1843
1846
|
}
|
|
1844
1847
|
/**
|
|
@@ -1857,6 +1860,9 @@ const RevoGridComponent = class {
|
|
|
1857
1860
|
* Scrolls viewport to specified row by index.
|
|
1858
1861
|
*/
|
|
1859
1862
|
async scrollToRow(coordinate = 0) {
|
|
1863
|
+
if (!this.dimensionProvider) {
|
|
1864
|
+
throw new Error('Not connected');
|
|
1865
|
+
}
|
|
1860
1866
|
const y = this.dimensionProvider.getViewPortPos({
|
|
1861
1867
|
coordinate,
|
|
1862
1868
|
dimension: 'rgRow',
|
|
@@ -1867,6 +1873,9 @@ const RevoGridComponent = class {
|
|
|
1867
1873
|
* Scrolls viewport to specified column by index.
|
|
1868
1874
|
*/
|
|
1869
1875
|
async scrollToColumnIndex(coordinate = 0) {
|
|
1876
|
+
if (!this.dimensionProvider) {
|
|
1877
|
+
throw new Error('Not connected');
|
|
1878
|
+
}
|
|
1870
1879
|
const x = this.dimensionProvider.getViewPortPos({
|
|
1871
1880
|
coordinate,
|
|
1872
1881
|
dimension: 'rgCol',
|
|
@@ -1877,6 +1886,9 @@ const RevoGridComponent = class {
|
|
|
1877
1886
|
* Scrolls viewport to specified column by prop
|
|
1878
1887
|
*/
|
|
1879
1888
|
async scrollToColumnProp(prop, dimension = 'rgCol') {
|
|
1889
|
+
if (!this.dimensionProvider) {
|
|
1890
|
+
throw new Error('Not connected');
|
|
1891
|
+
}
|
|
1880
1892
|
const coordinate = this.columnProvider.getColumnIndexByProp(prop, dimension);
|
|
1881
1893
|
if (coordinate < 0) {
|
|
1882
1894
|
// already on the screen
|
|
@@ -1894,6 +1906,9 @@ const RevoGridComponent = class {
|
|
|
1894
1906
|
}
|
|
1895
1907
|
/** Add trimmed by type */
|
|
1896
1908
|
async addTrimmed(trimmed, trimmedType = 'external', type = 'rgRow') {
|
|
1909
|
+
if (!this.dataProvider) {
|
|
1910
|
+
throw new Error('Not connected');
|
|
1911
|
+
}
|
|
1897
1912
|
const event = this.beforetrimmed.emit({
|
|
1898
1913
|
trimmed,
|
|
1899
1914
|
trimmedType,
|
|
@@ -1929,6 +1944,9 @@ const RevoGridComponent = class {
|
|
|
1929
1944
|
}
|
|
1930
1945
|
/** Get data from source */
|
|
1931
1946
|
async getSource(type = 'rgRow') {
|
|
1947
|
+
if (!this.dataProvider) {
|
|
1948
|
+
throw new Error('Not connected');
|
|
1949
|
+
}
|
|
1932
1950
|
return this.dataProvider.stores[type].store.get('source');
|
|
1933
1951
|
}
|
|
1934
1952
|
/**
|
|
@@ -1937,6 +1955,9 @@ const RevoGridComponent = class {
|
|
|
1937
1955
|
* @param type - type of source
|
|
1938
1956
|
*/
|
|
1939
1957
|
async getVisibleSource(type = 'rgRow') {
|
|
1958
|
+
if (!this.dataProvider) {
|
|
1959
|
+
throw new Error('Not connected');
|
|
1960
|
+
}
|
|
1940
1961
|
return index.getVisibleSourceItem(this.dataProvider.stores[type].store);
|
|
1941
1962
|
}
|
|
1942
1963
|
/**
|
|
@@ -1945,6 +1966,9 @@ const RevoGridComponent = class {
|
|
|
1945
1966
|
* @param type - type of source
|
|
1946
1967
|
*/
|
|
1947
1968
|
async getSourceStore(type = 'rgRow') {
|
|
1969
|
+
if (!this.dataProvider) {
|
|
1970
|
+
throw new Error('Not connected');
|
|
1971
|
+
}
|
|
1948
1972
|
return this.dataProvider.stores[type].store;
|
|
1949
1973
|
}
|
|
1950
1974
|
/**
|
|
@@ -2008,6 +2032,9 @@ const RevoGridComponent = class {
|
|
|
2008
2032
|
*/
|
|
2009
2033
|
async getContentSize() {
|
|
2010
2034
|
var _a;
|
|
2035
|
+
if (!this.dimensionProvider) {
|
|
2036
|
+
throw new Error('Not connected');
|
|
2037
|
+
}
|
|
2011
2038
|
return (_a = this.dimensionProvider) === null || _a === void 0 ? void 0 : _a.getFullSize();
|
|
2012
2039
|
}
|
|
2013
2040
|
/**
|
|
@@ -2077,11 +2104,12 @@ const RevoGridComponent = class {
|
|
|
2077
2104
|
(_a = this.orderService) === null || _a === void 0 ? void 0 : _a.moveTip(e.detail);
|
|
2078
2105
|
}
|
|
2079
2106
|
async onCellEdit(e) {
|
|
2107
|
+
var _a;
|
|
2080
2108
|
const { defaultPrevented, detail } = this.beforeedit.emit(e.detail);
|
|
2081
2109
|
await index.timeout();
|
|
2082
2110
|
// apply data
|
|
2083
2111
|
if (!defaultPrevented) {
|
|
2084
|
-
this.dataProvider.setCellData(detail);
|
|
2112
|
+
(_a = this.dataProvider) === null || _a === void 0 ? void 0 : _a.setCellData(detail);
|
|
2085
2113
|
// @feature: incrimental update for cells
|
|
2086
2114
|
// this.dataProvider.setCellData(detail, false);
|
|
2087
2115
|
// await this.setDataAt({
|
|
@@ -2094,6 +2122,9 @@ const RevoGridComponent = class {
|
|
|
2094
2122
|
}
|
|
2095
2123
|
}
|
|
2096
2124
|
onRangeEdit(e) {
|
|
2125
|
+
if (!this.dataProvider) {
|
|
2126
|
+
throw new Error('Not connected');
|
|
2127
|
+
}
|
|
2097
2128
|
const { defaultPrevented, detail } = this.beforerangeedit.emit(e.detail);
|
|
2098
2129
|
if (defaultPrevented) {
|
|
2099
2130
|
e.preventDefault();
|
|
@@ -2138,6 +2169,9 @@ const RevoGridComponent = class {
|
|
|
2138
2169
|
this.columnChanged(this.columns);
|
|
2139
2170
|
}
|
|
2140
2171
|
columnChanged(newVal = []) {
|
|
2172
|
+
if (!this.dimensionProvider) {
|
|
2173
|
+
return;
|
|
2174
|
+
}
|
|
2141
2175
|
const columnGather = column_drag_plugin.getColumns(newVal, 0, this.columnTypes);
|
|
2142
2176
|
this.beforecolumnsset.emit(columnGather);
|
|
2143
2177
|
this.dimensionProvider.applyNewColumns(columnGather.columns, this.disableVirtualX);
|
|
@@ -2155,11 +2189,17 @@ const RevoGridComponent = class {
|
|
|
2155
2189
|
this.columnChanged(this.columns);
|
|
2156
2190
|
}
|
|
2157
2191
|
rowSizeChanged(s) {
|
|
2192
|
+
if (!this.dimensionProvider) {
|
|
2193
|
+
return;
|
|
2194
|
+
}
|
|
2158
2195
|
// clear existing data
|
|
2159
2196
|
this.dimensionProvider.setSettings({ originItemSize: s }, 'rgRow');
|
|
2160
2197
|
this.rowDefChanged(this.rowDefinitions, this.rowDefinitions, 'rowSize', true);
|
|
2161
2198
|
}
|
|
2162
2199
|
themeChanged(t, _, __ = 'theme', init = false) {
|
|
2200
|
+
if (!this.dimensionProvider) {
|
|
2201
|
+
return;
|
|
2202
|
+
}
|
|
2163
2203
|
this.themeService.register(t);
|
|
2164
2204
|
this.dimensionProvider.setSettings({ originItemSize: this.themeService.rowSize }, 'rgRow');
|
|
2165
2205
|
this.dimensionProvider.setSettings({ originItemSize: this.colSize }, 'rgCol');
|
|
@@ -2174,6 +2214,9 @@ const RevoGridComponent = class {
|
|
|
2174
2214
|
this.afterthemechanged.emit(t);
|
|
2175
2215
|
}
|
|
2176
2216
|
dataSourceChanged(newVal = [], _, watchName) {
|
|
2217
|
+
if (!this.dataProvider) {
|
|
2218
|
+
return;
|
|
2219
|
+
}
|
|
2177
2220
|
let type = 'rgRow';
|
|
2178
2221
|
switch (watchName) {
|
|
2179
2222
|
case 'pinnedBottomSource':
|
|
@@ -2217,6 +2260,10 @@ const RevoGridComponent = class {
|
|
|
2217
2260
|
this.dataSourceChanged(this.source, this.source, 'source');
|
|
2218
2261
|
}
|
|
2219
2262
|
rowDefChanged(after, before, _watchName, forceUpdate = true) {
|
|
2263
|
+
// in firefox it's triggered before init
|
|
2264
|
+
if (!this.dimensionProvider || !this.dataProvider) {
|
|
2265
|
+
return;
|
|
2266
|
+
}
|
|
2220
2267
|
const { detail: { vals: newVal, oldVals: oldVal }, } = this.beforerowdefinition.emit({
|
|
2221
2268
|
vals: after,
|
|
2222
2269
|
oldVals: before,
|
|
@@ -2245,8 +2292,9 @@ const RevoGridComponent = class {
|
|
|
2245
2292
|
}
|
|
2246
2293
|
}
|
|
2247
2294
|
Object.entries(newRows).forEach(([k, r]) => {
|
|
2295
|
+
var _a;
|
|
2248
2296
|
const type = k;
|
|
2249
|
-
this.dimensionProvider.setCustomSizes(type, r.sizes || {});
|
|
2297
|
+
(_a = this.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setCustomSizes(type, r.sizes || {});
|
|
2250
2298
|
});
|
|
2251
2299
|
}
|
|
2252
2300
|
trimmedRowsChanged(newVal = {}) {
|
|
@@ -2270,6 +2318,9 @@ const RevoGridComponent = class {
|
|
|
2270
2318
|
* Stretch Plugin Apply
|
|
2271
2319
|
*/
|
|
2272
2320
|
applyStretch(isStretch) {
|
|
2321
|
+
if (!this.dimensionProvider || !this.dataProvider) {
|
|
2322
|
+
return;
|
|
2323
|
+
}
|
|
2273
2324
|
if (isStretch === 'false') {
|
|
2274
2325
|
isStretch = false;
|
|
2275
2326
|
}
|
|
@@ -2313,6 +2364,9 @@ const RevoGridComponent = class {
|
|
|
2313
2364
|
// #region Plugins
|
|
2314
2365
|
setPlugins() {
|
|
2315
2366
|
var _a;
|
|
2367
|
+
if (!this.dimensionProvider || !this.dataProvider) {
|
|
2368
|
+
return;
|
|
2369
|
+
}
|
|
2316
2370
|
// remove old plugins if any
|
|
2317
2371
|
this.removePlugins();
|
|
2318
2372
|
// pass data provider to plugins
|
|
@@ -2398,7 +2452,8 @@ const RevoGridComponent = class {
|
|
|
2398
2452
|
this.groupingChanged(this.grouping);
|
|
2399
2453
|
// init scrolling service
|
|
2400
2454
|
this.scrollingService = new GridScrollingService((e) => {
|
|
2401
|
-
|
|
2455
|
+
var _a;
|
|
2456
|
+
(_a = this.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setViewPortCoordinate({
|
|
2402
2457
|
coordinate: e.coordinate,
|
|
2403
2458
|
type: e.dimension,
|
|
2404
2459
|
});
|
|
@@ -2416,6 +2471,9 @@ const RevoGridComponent = class {
|
|
|
2416
2471
|
return Promise.all(this.jobsBeforeRender);
|
|
2417
2472
|
}
|
|
2418
2473
|
render() {
|
|
2474
|
+
if (!this.dimensionProvider || !this.dataProvider) {
|
|
2475
|
+
return;
|
|
2476
|
+
}
|
|
2419
2477
|
const contentHeight = this.dimensionProvider.stores['rgRow'].store.get('realSize');
|
|
2420
2478
|
// init viewport service helpers
|
|
2421
2479
|
this.viewport = new ViewportService({
|
|
@@ -2451,7 +2509,7 @@ const RevoGridComponent = class {
|
|
|
2451
2509
|
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 });
|
|
2452
2510
|
// Column headers
|
|
2453
2511
|
const dataViews = [
|
|
2454
|
-
index$1.h("revogr-header", Object.assign({
|
|
2512
|
+
index$1.h("revogr-header", Object.assign({}, headerProperties, { slot: viewport_helpers.HEADER_SLOT })),
|
|
2455
2513
|
];
|
|
2456
2514
|
// Render viewport data (vertical sections)
|
|
2457
2515
|
view.dataPorts.forEach(data => {
|
|
@@ -2473,12 +2531,12 @@ const RevoGridComponent = class {
|
|
|
2473
2531
|
const typeCol = 'rgCol';
|
|
2474
2532
|
const viewports = this.viewportProvider.stores;
|
|
2475
2533
|
const dimensions = this.dimensionProvider.stores;
|
|
2476
|
-
return (index$1.h(index$1.Host,
|
|
2534
|
+
return (index$1.h(index$1.Host, null, this.hideAttribution ? null : (index$1.h("revogr-attribution", { class: "attribution" })), index$1.h("div", { class: "main-viewport", onClick: (e) => {
|
|
2477
2535
|
var _a;
|
|
2478
2536
|
if (e.currentTarget === e.target) {
|
|
2479
2537
|
(_a = this.viewport) === null || _a === void 0 ? void 0 : _a.clearEdit();
|
|
2480
2538
|
}
|
|
2481
|
-
} }, index$1.h("div", {
|
|
2539
|
+
} }, index$1.h("div", { class: "viewports" }, index$1.h("slot", { name: "viewport" }), viewportSections, index$1.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) }), index$1.h(OrderRenderer, { ref: e => (this.orderService = e) }))), index$1.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));
|
|
2482
2540
|
}
|
|
2483
2541
|
disconnectedCallback() {
|
|
2484
2542
|
// Remove all plugins, to avoid memory leaks and unexpected behaviour when the component is removed
|