@genesislcap/grid-tabulator 15.96.0 → 15.96.2

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.
@@ -3822,7 +3822,63 @@
3822
3822
  "type": {
3823
3823
  "text": "Function"
3824
3824
  },
3825
- "description": "Allows grid data updates to be processed via and external function before applying in grid"
3825
+ "description": "Allows grid data updates to be processed via and external function before applying in grid."
3826
+ },
3827
+ {
3828
+ "kind": "field",
3829
+ "name": "serverRowsCount",
3830
+ "type": {
3831
+ "text": "number | undefined"
3832
+ },
3833
+ "description": "Total rows the resource holds on the server (`ROWS_COUNT` of the first stream message), or `undefined` when\nunknown. It ignores criteria, and is not adjusted for live inserts and deletes."
3834
+ },
3835
+ {
3836
+ "kind": "field",
3837
+ "name": "moreRows",
3838
+ "type": {
3839
+ "text": "boolean | undefined"
3840
+ },
3841
+ "description": "Whether the server holds more rows than were sent (`MORE_ROWS` of the first stream message), or `undefined`\nwhen unknown. It is true when `max-rows` capped the initial load."
3842
+ },
3843
+ {
3844
+ "kind": "field",
3845
+ "name": "pendingPages",
3846
+ "type": {
3847
+ "text": "number"
3848
+ },
3849
+ "privacy": "private",
3850
+ "default": "0",
3851
+ "description": "MORE_ROWS requests sent by `loadMore()` that have not been answered yet."
3852
+ },
3853
+ {
3854
+ "kind": "field",
3855
+ "name": "remainingPages",
3856
+ "type": {
3857
+ "text": "number"
3858
+ },
3859
+ "privacy": "private",
3860
+ "default": "0",
3861
+ "description": "Further pages a `loadMore()` call still has to request, one after each reply."
3862
+ },
3863
+ {
3864
+ "kind": "field",
3865
+ "name": "applyingPage",
3866
+ "type": {
3867
+ "text": "boolean"
3868
+ },
3869
+ "privacy": "private",
3870
+ "default": "false",
3871
+ "description": "Set while the rows of a `loadMore()` reply are being applied."
3872
+ },
3873
+ {
3874
+ "kind": "field",
3875
+ "name": "pagingStalled",
3876
+ "type": {
3877
+ "text": "boolean"
3878
+ },
3879
+ "privacy": "private",
3880
+ "default": "false",
3881
+ "description": "Set when a `loadMore()` reply had no rows while the server still reported more. Some GSF versions answer\nevery later request the same way, so paging stops."
3826
3882
  },
3827
3883
  {
3828
3884
  "kind": "field",
@@ -3991,6 +4047,111 @@
3991
4047
  ],
3992
4048
  "description": "Generate column definitions from the field metadata"
3993
4049
  },
4050
+ {
4051
+ "kind": "method",
4052
+ "name": "loadMore",
4053
+ "return": {
4054
+ "type": {
4055
+ "text": ""
4056
+ }
4057
+ },
4058
+ "parameters": [
4059
+ {
4060
+ "name": "pages",
4061
+ "default": "1"
4062
+ }
4063
+ ],
4064
+ "description": "Requests the next `pages` pages of rows from a data server subscription (`MORE_ROWS`), one after another.\nEach page holds up to `max-rows` rows; the server fixes that size when the subscription opens. The rows\narrive on the stream and reach the row mapper as a `'page'` operation, and `more-rows-changed` is emitted\nafter each reply. Requesting stops early when the server reports no more rows."
4065
+ },
4066
+ {
4067
+ "kind": "field",
4068
+ "name": "isLoadingMore",
4069
+ "type": {
4070
+ "text": "boolean"
4071
+ },
4072
+ "description": "Whether a `loadMore()` call is still waiting for pages.",
4073
+ "readonly": true
4074
+ },
4075
+ {
4076
+ "kind": "method",
4077
+ "name": "requestPage",
4078
+ "privacy": "private",
4079
+ "return": {
4080
+ "type": {
4081
+ "text": "boolean"
4082
+ }
4083
+ },
4084
+ "description": "Sends one MORE_ROWS request. The send is not awaited: the request has no reply of its own, the rows arrive\non the stream, so the returned promise only settles when sending fails."
4085
+ },
4086
+ {
4087
+ "kind": "method",
4088
+ "name": "isPageReply",
4089
+ "privacy": "private",
4090
+ "return": {
4091
+ "type": {
4092
+ "text": "boolean"
4093
+ }
4094
+ },
4095
+ "parameters": [
4096
+ {
4097
+ "name": "result",
4098
+ "type": {
4099
+ "text": "any"
4100
+ }
4101
+ }
4102
+ ],
4103
+ "description": "Whether a raw stream message answers a `loadMore()` request. Live updates never carry `MORE_ROWS`."
4104
+ },
4105
+ {
4106
+ "kind": "method",
4107
+ "name": "captureServerPaging",
4108
+ "privacy": "private",
4109
+ "parameters": [
4110
+ {
4111
+ "name": "result",
4112
+ "type": {
4113
+ "text": "any"
4114
+ }
4115
+ },
4116
+ {
4117
+ "name": "isPageReply",
4118
+ "default": "false"
4119
+ }
4120
+ ],
4121
+ "description": "Keeps `ROWS_COUNT` and `MORE_ROWS` from a raw stream message. The result filter drops them; the first\nmessage after the logon and every reply to `loadMore()` carry them."
4122
+ },
4123
+ {
4124
+ "kind": "field",
4125
+ "name": "canLoadMore",
4126
+ "type": {
4127
+ "text": "boolean"
4128
+ },
4129
+ "description": "Whether `loadMore()` can fetch another page now.",
4130
+ "readonly": true
4131
+ },
4132
+ {
4133
+ "kind": "method",
4134
+ "name": "setServerPaging",
4135
+ "privacy": "private",
4136
+ "parameters": [
4137
+ {
4138
+ "name": "rowsCount",
4139
+ "type": {
4140
+ "text": "number | undefined"
4141
+ }
4142
+ },
4143
+ {
4144
+ "name": "moreRows",
4145
+ "type": {
4146
+ "text": "boolean | undefined"
4147
+ }
4148
+ },
4149
+ {
4150
+ "name": "force",
4151
+ "default": "false"
4152
+ }
4153
+ ]
4154
+ },
3994
4155
  {
3995
4156
  "kind": "method",
3996
4157
  "name": "handleSnapshot",
@@ -4382,6 +4543,10 @@
4382
4543
  {
4383
4544
  "description": "Fired when layout size changes. detail: `GridTabulatorSizeChangedEventDetail`",
4384
4545
  "name": "sizeChanged"
4546
+ },
4547
+ {
4548
+ "description": "Fired when the server-reported `MORE_ROWS` or `ROWS_COUNT` changes, including when they are reset, and after every reply to `loadMore()`. detail: `GridTabulatorMoreRowsEventDetail`",
4549
+ "name": "more-rows-changed"
4385
4550
  }
4386
4551
  ],
4387
4552
  "attributes": [
@@ -39,6 +39,21 @@ export interface GridTabulatorSizeChangedEventDetail {
39
39
  value: number;
40
40
  oldValue: number;
41
41
  }
42
+ /**
43
+ * Detail payload for the `more-rows-changed` event.
44
+ * @alpha
45
+ */
46
+ export interface GridTabulatorMoreRowsEventDetail {
47
+ /** Whether the server holds more rows than were sent (`MORE_ROWS`). */
48
+ moreRows: boolean | undefined;
49
+ /** Total rows the resource holds on the server, ignoring criteria (`ROWS_COUNT`). */
50
+ rowsCount: number | undefined;
51
+ }
52
+ /**
53
+ * Kind of change a row data mapper is called with for a stream transaction.
54
+ * @alpha
55
+ */
56
+ export type GridTabulatorRowDataMapperOperation = 'add' | 'update' | 'remove' | 'page';
42
57
  declare const GridTabulatorClientSideDatasource_base: (new (...args: any[]) => {
43
58
  #_container: import("@genesislcap/foundation-utils").FoundationLayoutContainer | import("@genesislcap/foundation-utils").LayoutCacheContainer | import("@genesislcap/foundation-utils").DOMContainer;
44
59
  #_latestTokenCode: string;
@@ -86,12 +101,7 @@ declare const GridTabulatorClientSideDatasource_base: (new (...args: any[]) => {
86
101
  addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
87
102
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
88
103
  removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
89
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options
90
- /**
91
- * Returns whether the `row-id` attribute is the default one, depending on the resource type.
92
- * @internal
93
- */
94
- ?: boolean | EventListenerOptions): void;
104
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
95
105
  readonly attributes: NamedNodeMap;
96
106
  get classList(): DOMTokenList;
97
107
  set classList(value: string): any;
@@ -778,6 +788,7 @@ declare const GridTabulatorClientSideDatasource_base: (new (...args: any[]) => {
778
788
  * @fires gridTabulator:error - Fired when a datasource error occurs. detail: `GridTabulatorErrorEventDetail`
779
789
  * @fires dataInit - Fired when tabulator data is initialized
780
790
  * @fires sizeChanged - Fired when layout size changes. detail: `GridTabulatorSizeChangedEventDetail`
791
+ * @fires more-rows-changed - Fired when the server-reported `MORE_ROWS` or `ROWS_COUNT` changes, including when they are reset, and after every reply to `loadMore()`. detail: `GridTabulatorMoreRowsEventDetail`
781
792
  */
782
793
  export declare class GridTabulatorClientSideDatasource extends GridTabulatorClientSideDatasource_base {
783
794
  auth: Auth;
@@ -814,9 +825,36 @@ export declare class GridTabulatorClientSideDatasource extends GridTabulatorClie
814
825
  */
815
826
  keepColDefsOnClearRowData: boolean;
816
827
  /**
817
- * Allows grid data updates to be processed via and external function before applying in grid
828
+ * Allows grid data updates to be processed via and external function before applying in grid.
829
+ *
830
+ * @remarks
831
+ * The mapper is called with all rows (one argument) when the grid data is set. For stream transactions it is
832
+ * called with the changed rows, the datasource's current rows keyed by row id, and the operation
833
+ * (`'add'`, `'update'` or `'remove'`). Rows that arrive in reply to `loadMore()` are passed as `'page'`
834
+ * instead of `'add'`, as they are existing rows rather than new ones.
818
835
  */
819
836
  rowDataMapper: Function;
837
+ /**
838
+ * Total rows the resource holds on the server (`ROWS_COUNT` of the first stream message), or `undefined` when
839
+ * unknown. It ignores criteria, and is not adjusted for live inserts and deletes.
840
+ */
841
+ serverRowsCount: number | undefined;
842
+ /**
843
+ * Whether the server holds more rows than were sent (`MORE_ROWS` of the first stream message), or `undefined`
844
+ * when unknown. It is true when `max-rows` capped the initial load.
845
+ */
846
+ moreRows: boolean | undefined;
847
+ /** MORE_ROWS requests sent by `loadMore()` that have not been answered yet. */
848
+ private pendingPages;
849
+ /** Further pages a `loadMore()` call still has to request, one after each reply. */
850
+ private remainingPages;
851
+ /** Set while the rows of a `loadMore()` reply are being applied. */
852
+ private applyingPage;
853
+ /**
854
+ * Set when a `loadMore()` reply had no rows while the server still reported more. Some GSF versions answer
855
+ * every later request the same way, so paging stops.
856
+ */
857
+ private pagingStalled;
820
858
  private dataSub;
821
859
  private updateSub;
822
860
  private connectionSub;
@@ -905,6 +943,33 @@ export declare class GridTabulatorClientSideDatasource extends GridTabulatorClie
905
943
  * @internal
906
944
  */
907
945
  loadResourceData(withFullInit?: boolean): Promise<void>;
946
+ /**
947
+ * Requests the next `pages` pages of rows from a data server subscription (`MORE_ROWS`), one after another.
948
+ * Each page holds up to `max-rows` rows; the server fixes that size when the subscription opens. The rows
949
+ * arrive on the stream and reach the row mapper as a `'page'` operation, and `more-rows-changed` is emitted
950
+ * after each reply. Requesting stops early when the server reports no more rows.
951
+ *
952
+ * @returns Whether a request was sent. Nothing is sent for a request server, while a load is in progress,
953
+ * when the server reported no more rows, or after paging stalled.
954
+ */
955
+ loadMore(pages?: number): Promise<boolean>;
956
+ /** Whether a `loadMore()` call is still waiting for pages. */
957
+ get isLoadingMore(): boolean;
958
+ /**
959
+ * Sends one MORE_ROWS request. The send is not awaited: the request has no reply of its own, the rows arrive
960
+ * on the stream, so the returned promise only settles when sending fails.
961
+ */
962
+ private requestPage;
963
+ /** Whether a raw stream message answers a `loadMore()` request. Live updates never carry `MORE_ROWS`. */
964
+ private isPageReply;
965
+ /**
966
+ * Keeps `ROWS_COUNT` and `MORE_ROWS` from a raw stream message. The result filter drops them; the first
967
+ * message after the logon and every reply to `loadMore()` carry them.
968
+ */
969
+ private captureServerPaging;
970
+ /** Whether `loadMore()` can fetch another page now. */
971
+ get canLoadMore(): boolean;
972
+ private setServerPaging;
908
973
  private handleSnapshot;
909
974
  private datasourceOptions;
910
975
  private handleStreamResult;
@@ -1 +1 @@
1
- {"version":3,"file":"client-side.datasource.d.ts","sourceRoot":"","sources":["../../../src/datasource/client-side.datasource.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,OAAO,EAEP,UAAU,EAIV,gBAAgB,EAUjB,MAAM,+BAA+B,CAAC;AAMvC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAS3C;;;GAGG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;GAGG;AACH,eAAO,MAAM,YAAY,SAAS,CAAC;AAOnC;;;GAGG;AACH,MAAM,WAAW,kBAAkB,CAAC,KAAK,GAAG,GAAG;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3B,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,mBAAmB;IAuB3B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,aAAa;IAMd,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAK9C,YAAY,CAAC,SAAS,EAAE,MAAM;IAKrC,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,gBAAgB;CAGvE"}
@@ -8,7 +8,7 @@ import type { GridTabulatorCell as GridTabulatorCellWC } from './cell/cell';
8
8
  import type { GridTabulatorColumn as GridTabulatorColumnWC } from './column/column';
9
9
  import type { GridTabulatorClientSideDatasource as GridTabulatorClientSideDatasourceWC } from './datasource/client-side.datasource';
10
10
  import type { GridTabulator as GridTabulatorWC } from './grid-tabulator';
11
- import type { GridTabulatorErrorEventDetail, GridTabulatorSizeChangedEventDetail } from '@genesislcap/grid-tabulator';
11
+ import type { GridTabulatorErrorEventDetail, GridTabulatorMoreRowsEventDetail, GridTabulatorSizeChangedEventDetail } from '@genesislcap/grid-tabulator';
12
12
  import type { Tabulator } from 'tabulator-tables';
13
13
 
14
14
  /** @internal Maps a web component class to its public props only.
@@ -75,6 +75,7 @@ export declare const GridTabulatorClientSideDatasource: React.ForwardRefExoticCo
75
75
  onGridTabulatorError?: (event: CustomEvent<GridTabulatorErrorEventDetail>) => void;
76
76
  onDataInit?: (event: CustomEvent<unknown>) => void;
77
77
  onSizeChanged?: (event: CustomEvent<GridTabulatorSizeChangedEventDetail>) => void;
78
+ onMoreRowsChanged?: (event: CustomEvent<GridTabulatorMoreRowsEventDetail>) => void;
78
79
  }
79
80
  > & React.RefAttributes<GridTabulatorClientSideDatasourceWC>
80
81
  >;
@@ -27,6 +27,7 @@ const DEBOUNCE_INTERVAL_MS = 1000;
27
27
  * @fires gridTabulator:error - Fired when a datasource error occurs. detail: `GridTabulatorErrorEventDetail`
28
28
  * @fires dataInit - Fired when tabulator data is initialized
29
29
  * @fires sizeChanged - Fired when layout size changes. detail: `GridTabulatorSizeChangedEventDetail`
30
+ * @fires more-rows-changed - Fired when the server-reported `MORE_ROWS` or `ROWS_COUNT` changes, including when they are reset, and after every reply to `loadMore()`. detail: `GridTabulatorMoreRowsEventDetail`
30
31
  */
31
32
  let GridTabulatorClientSideDatasource = class GridTabulatorClientSideDatasource extends LifecycleMixin(DatasourceEventHandler(FoundationElement)) {
32
33
  constructor() {
@@ -46,6 +47,17 @@ let GridTabulatorClientSideDatasource = class GridTabulatorClientSideDatasource
46
47
  * Whether to keep column definitions when clearing row data
47
48
  */
48
49
  this.keepColDefsOnClearRowData = false;
50
+ /** MORE_ROWS requests sent by `loadMore()` that have not been answered yet. */
51
+ this.pendingPages = 0;
52
+ /** Further pages a `loadMore()` call still has to request, one after each reply. */
53
+ this.remainingPages = 0;
54
+ /** Set while the rows of a `loadMore()` reply are being applied. */
55
+ this.applyingPage = false;
56
+ /**
57
+ * Set when a `loadMore()` reply had no rows while the server still reported more. Some GSF versions answer
58
+ * every later request the same way, so paging stops.
59
+ */
60
+ this.pagingStalled = false;
49
61
  this.isRequestServer = false;
50
62
  this.requiresFullRowDataAndColDefs = true;
51
63
  this.dataSubWasLoggedOff = false;
@@ -220,6 +232,10 @@ let GridTabulatorClientSideDatasource = class GridTabulatorClientSideDatasource
220
232
  clearRowData(withColumnDefs = true) {
221
233
  var _a, _b, _c, _d;
222
234
  this.rows = new Map();
235
+ this.pendingPages = 0;
236
+ this.remainingPages = 0;
237
+ this.pagingStalled = false;
238
+ this.setServerPaging(undefined, undefined);
223
239
  if (withColumnDefs && !this.keepColDefsOnClearRowData) {
224
240
  (_b = (_a = this.gridTabulator) === null || _a === void 0 ? void 0 : _a.grid) === null || _b === void 0 ? void 0 : _b.setColumns([]);
225
241
  }
@@ -325,6 +341,8 @@ let GridTabulatorClientSideDatasource = class GridTabulatorClientSideDatasource
325
341
  this.dataSub = undefined;
326
342
  }
327
343
  this.clearRowData(withoutColumnDefs);
344
+ // The new subscription's first message is a full load, not live inserts into the old rows.
345
+ this.requiresFullRowDataAndColDefs = true;
328
346
  yield this.loadResourceData(withoutFullInit);
329
347
  });
330
348
  }
@@ -368,12 +386,20 @@ let GridTabulatorClientSideDatasource = class GridTabulatorClientSideDatasource
368
386
  return;
369
387
  }
370
388
  this.dataSubWasLoggedOff = false;
371
- if (result.ROW) {
372
- const nextMessage = dataServerResultFilter(result);
373
- this.handleStreamResult(nextMessage);
389
+ const isPageReply = this.isPageReply(result);
390
+ this.captureServerPaging(result, isPageReply);
391
+ this.applyingPage = isPageReply;
392
+ try {
393
+ if (result.ROW) {
394
+ const nextMessage = dataServerResultFilter(result);
395
+ this.handleStreamResult(nextMessage);
396
+ }
397
+ else {
398
+ this.handleStreamResult(result);
399
+ }
374
400
  }
375
- else {
376
- this.handleStreamResult(result);
401
+ finally {
402
+ this.applyingPage = false;
377
403
  }
378
404
  }, (error) => {
379
405
  logger.error('Stream error:', error);
@@ -390,6 +416,84 @@ let GridTabulatorClientSideDatasource = class GridTabulatorClientSideDatasource
390
416
  }
391
417
  });
392
418
  }
419
+ /**
420
+ * Requests the next `pages` pages of rows from a data server subscription (`MORE_ROWS`), one after another.
421
+ * Each page holds up to `max-rows` rows; the server fixes that size when the subscription opens. The rows
422
+ * arrive on the stream and reach the row mapper as a `'page'` operation, and `more-rows-changed` is emitted
423
+ * after each reply. Requesting stops early when the server reports no more rows.
424
+ *
425
+ * @returns Whether a request was sent. Nothing is sent for a request server, while a load is in progress,
426
+ * when the server reported no more rows, or after paging stalled.
427
+ */
428
+ loadMore() {
429
+ return __awaiter(this, arguments, void 0, function* (pages = 1) {
430
+ if (!this.canLoadMore || !this.sourceRef || pages < 1)
431
+ return false;
432
+ this.remainingPages = pages - 1;
433
+ return this.requestPage();
434
+ });
435
+ }
436
+ /** Whether a `loadMore()` call is still waiting for pages. */
437
+ get isLoadingMore() {
438
+ return this.pendingPages > 0 || this.remainingPages > 0;
439
+ }
440
+ /**
441
+ * Sends one MORE_ROWS request. The send is not awaited: the request has no reply of its own, the rows arrive
442
+ * on the stream, so the returned promise only settles when sending fails.
443
+ */
444
+ requestPage() {
445
+ this.pendingPages += 1;
446
+ Promise.resolve(this.connect.getMoreRows(this.sourceRef)).catch((error) => {
447
+ this.pendingPages = Math.max(0, this.pendingPages - 1);
448
+ this.remainingPages = 0;
449
+ logger.error(`Failed to load more rows for ${this.resourceName}`, error);
450
+ this.setServerPaging(this.serverRowsCount, this.moreRows, true);
451
+ });
452
+ return true;
453
+ }
454
+ /** Whether a raw stream message answers a `loadMore()` request. Live updates never carry `MORE_ROWS`. */
455
+ isPageReply(result) {
456
+ return (this.pendingPages > 0 &&
457
+ !this.requiresFullRowDataAndColDefs &&
458
+ !!result &&
459
+ 'MORE_ROWS' in result);
460
+ }
461
+ /**
462
+ * Keeps `ROWS_COUNT` and `MORE_ROWS` from a raw stream message. The result filter drops them; the first
463
+ * message after the logon and every reply to `loadMore()` carry them.
464
+ */
465
+ captureServerPaging(result, isPageReply = false) {
466
+ var _a;
467
+ if (isPageReply) {
468
+ this.pendingPages = Math.max(0, this.pendingPages - 1);
469
+ if (!((_a = result.ROW) === null || _a === void 0 ? void 0 : _a.length) && result.MORE_ROWS === true) {
470
+ this.pagingStalled = true;
471
+ logger.warn(`${this.resourceName}: a MORE_ROWS reply had no rows although more were reported, so paging stops`);
472
+ }
473
+ if (this.remainingPages > 0 && result.MORE_ROWS === true && !this.pagingStalled) {
474
+ this.remainingPages -= 1;
475
+ this.requestPage();
476
+ }
477
+ else {
478
+ this.remainingPages = 0;
479
+ }
480
+ }
481
+ if (!result || (!('ROWS_COUNT' in result) && !('MORE_ROWS' in result)))
482
+ return;
483
+ this.setServerPaging(typeof result.ROWS_COUNT === 'number' ? result.ROWS_COUNT : this.serverRowsCount, typeof result.MORE_ROWS === 'boolean' ? result.MORE_ROWS : this.moreRows, isPageReply);
484
+ }
485
+ /** Whether `loadMore()` can fetch another page now. */
486
+ get canLoadMore() {
487
+ return (!this.isRequestServer && this.moreRows === true && !this.pagingStalled && !this.isLoadingMore);
488
+ }
489
+ setServerPaging(rowsCount, moreRows, force = false) {
490
+ if (!force && rowsCount === this.serverRowsCount && moreRows === this.moreRows)
491
+ return;
492
+ this.serverRowsCount = rowsCount;
493
+ this.moreRows = moreRows;
494
+ const detail = { moreRows, rowsCount };
495
+ this.$emit('more-rows-changed', detail);
496
+ }
393
497
  handleSnapshot(result) {
394
498
  if (Array.isArray(result))
395
499
  return result;
@@ -525,7 +629,7 @@ let GridTabulatorClientSideDatasource = class GridTabulatorClientSideDatasource
525
629
  if (!this.rowDataMapper) {
526
630
  return transaction;
527
631
  }
528
- return Object.assign(Object.assign({}, transaction), { add: this.rowDataMapper(transaction.add, this.rows), update: this.rowDataMapper(transaction.update, this.rows), remove: this.rowDataMapper(transaction.remove, this.rows) });
632
+ return Object.assign(Object.assign({}, transaction), { add: this.rowDataMapper(transaction.add, this.rows, this.applyingPage ? 'page' : 'add'), update: this.rowDataMapper(transaction.update, this.rows, 'update'), remove: this.rowDataMapper(transaction.remove, this.rows, 'remove') });
529
633
  }
530
634
  handleStreamInserts(insertedRows) {
531
635
  insertedRows === null || insertedRows === void 0 ? void 0 : insertedRows.forEach((insertData) => {
@@ -659,6 +763,12 @@ __decorate([
659
763
  __decorate([
660
764
  observable
661
765
  ], GridTabulatorClientSideDatasource.prototype, "rowDataMapper", void 0);
766
+ __decorate([
767
+ observable
768
+ ], GridTabulatorClientSideDatasource.prototype, "serverRowsCount", void 0);
769
+ __decorate([
770
+ observable
771
+ ], GridTabulatorClientSideDatasource.prototype, "moreRows", void 0);
662
772
  GridTabulatorClientSideDatasource = __decorate([
663
773
  customElement({
664
774
  name: 'grid-tabulator-client-side-datasource',
@@ -4766,7 +4766,7 @@
4766
4766
  {
4767
4767
  "kind": "Class",
4768
4768
  "canonicalReference": "@genesislcap/grid-tabulator!GridTabulatorClientSideDatasource:class",
4769
- "docComment": "/**\n * The Genesis Datasource element, for client-side data fetching and used exclusively by the GridTabulator element.\n *\n * @fires\n *\n * gridTabulator:error - Fired when a datasource error occurs. detail: `GridTabulatorErrorEventDetail`\n *\n * @fires\n *\n * dataInit - Fired when tabulator data is initialized\n *\n * @fires\n *\n * sizeChanged - Fired when layout size changes. detail: `GridTabulatorSizeChangedEventDetail`\n *\n * @alpha\n */\n",
4769
+ "docComment": "/**\n * The Genesis Datasource element, for client-side data fetching and used exclusively by the GridTabulator element.\n *\n * @fires\n *\n * gridTabulator:error - Fired when a datasource error occurs. detail: `GridTabulatorErrorEventDetail`\n *\n * @fires\n *\n * dataInit - Fired when tabulator data is initialized\n *\n * @fires\n *\n * sizeChanged - Fired when layout size changes. detail: `GridTabulatorSizeChangedEventDetail`\n *\n * @fires\n *\n * more-rows-changed - Fired when the server-reported `MORE_ROWS` or `ROWS_COUNT` changes, including when they are reset, and after every reply to `loadMore()`. detail: `GridTabulatorMoreRowsEventDetail`\n *\n * @alpha\n */\n",
4770
4770
  "excerptTokens": [
4771
4771
  {
4772
4772
  "kind": "Content",
@@ -4819,6 +4819,36 @@
4819
4819
  "isProtected": false,
4820
4820
  "isAbstract": false
4821
4821
  },
4822
+ {
4823
+ "kind": "Property",
4824
+ "canonicalReference": "@genesislcap/grid-tabulator!GridTabulatorClientSideDatasource#canLoadMore:member",
4825
+ "docComment": "/**\n * Whether `loadMore()` can fetch another page now.\n */\n",
4826
+ "excerptTokens": [
4827
+ {
4828
+ "kind": "Content",
4829
+ "text": "get canLoadMore(): "
4830
+ },
4831
+ {
4832
+ "kind": "Content",
4833
+ "text": "boolean"
4834
+ },
4835
+ {
4836
+ "kind": "Content",
4837
+ "text": ";"
4838
+ }
4839
+ ],
4840
+ "isReadonly": true,
4841
+ "isOptional": false,
4842
+ "releaseTag": "Alpha",
4843
+ "name": "canLoadMore",
4844
+ "propertyTypeTokenRange": {
4845
+ "startIndex": 1,
4846
+ "endIndex": 2
4847
+ },
4848
+ "isStatic": false,
4849
+ "isProtected": false,
4850
+ "isAbstract": false
4851
+ },
4822
4852
  {
4823
4853
  "kind": "Property",
4824
4854
  "canonicalReference": "@genesislcap/grid-tabulator!GridTabulatorClientSideDatasource#connect:member",
@@ -5069,6 +5099,36 @@
5069
5099
  "isAbstract": false,
5070
5100
  "name": "init"
5071
5101
  },
5102
+ {
5103
+ "kind": "Property",
5104
+ "canonicalReference": "@genesislcap/grid-tabulator!GridTabulatorClientSideDatasource#isLoadingMore:member",
5105
+ "docComment": "/**\n * Whether a `loadMore()` call is still waiting for pages.\n */\n",
5106
+ "excerptTokens": [
5107
+ {
5108
+ "kind": "Content",
5109
+ "text": "get isLoadingMore(): "
5110
+ },
5111
+ {
5112
+ "kind": "Content",
5113
+ "text": "boolean"
5114
+ },
5115
+ {
5116
+ "kind": "Content",
5117
+ "text": ";"
5118
+ }
5119
+ ],
5120
+ "isReadonly": true,
5121
+ "isOptional": false,
5122
+ "releaseTag": "Alpha",
5123
+ "name": "isLoadingMore",
5124
+ "propertyTypeTokenRange": {
5125
+ "startIndex": 1,
5126
+ "endIndex": 2
5127
+ },
5128
+ "isStatic": false,
5129
+ "isProtected": false,
5130
+ "isAbstract": false
5131
+ },
5072
5132
  {
5073
5133
  "kind": "Property",
5074
5134
  "canonicalReference": "@genesislcap/grid-tabulator!GridTabulatorClientSideDatasource#isSnapshot:member",
@@ -5189,6 +5249,36 @@
5189
5249
  "isProtected": false,
5190
5250
  "isAbstract": false
5191
5251
  },
5252
+ {
5253
+ "kind": "Property",
5254
+ "canonicalReference": "@genesislcap/grid-tabulator!GridTabulatorClientSideDatasource#moreRows:member",
5255
+ "docComment": "/**\n * Whether the server holds more rows than were sent (`MORE_ROWS` of the first stream message), or `undefined` when unknown. It is true when `max-rows` capped the initial load.\n */\n",
5256
+ "excerptTokens": [
5257
+ {
5258
+ "kind": "Content",
5259
+ "text": "moreRows: "
5260
+ },
5261
+ {
5262
+ "kind": "Content",
5263
+ "text": "boolean | undefined"
5264
+ },
5265
+ {
5266
+ "kind": "Content",
5267
+ "text": ";"
5268
+ }
5269
+ ],
5270
+ "isReadonly": false,
5271
+ "isOptional": false,
5272
+ "releaseTag": "Alpha",
5273
+ "name": "moreRows",
5274
+ "propertyTypeTokenRange": {
5275
+ "startIndex": 1,
5276
+ "endIndex": 2
5277
+ },
5278
+ "isStatic": false,
5279
+ "isProtected": false,
5280
+ "isAbstract": false
5281
+ },
5192
5282
  {
5193
5283
  "kind": "Property",
5194
5284
  "canonicalReference": "@genesislcap/grid-tabulator!GridTabulatorClientSideDatasource#movingView:member",
@@ -5433,7 +5523,7 @@
5433
5523
  {
5434
5524
  "kind": "Property",
5435
5525
  "canonicalReference": "@genesislcap/grid-tabulator!GridTabulatorClientSideDatasource#rowDataMapper:member",
5436
- "docComment": "/**\n * Allows grid data updates to be processed via and external function before applying in grid\n */\n",
5526
+ "docComment": "/**\n * Allows grid data updates to be processed via and external function before applying in grid.\n *\n * @remarks\n *\n * The mapper is called with all rows (one argument) when the grid data is set. For stream transactions it is called with the changed rows, the datasource's current rows keyed by row id, and the operation (`'add'`, `'update'` or `'remove'`). Rows that arrive in reply to `loadMore()` are passed as `'page'` instead of `'add'`, as they are existing rows rather than new ones.\n */\n",
5437
5527
  "excerptTokens": [
5438
5528
  {
5439
5529
  "kind": "Content",
@@ -5490,6 +5580,36 @@
5490
5580
  "isStatic": false,
5491
5581
  "isProtected": false,
5492
5582
  "isAbstract": false
5583
+ },
5584
+ {
5585
+ "kind": "Property",
5586
+ "canonicalReference": "@genesislcap/grid-tabulator!GridTabulatorClientSideDatasource#serverRowsCount:member",
5587
+ "docComment": "/**\n * Total rows the resource holds on the server (`ROWS_COUNT` of the first stream message), or `undefined` when unknown. It ignores criteria, and is not adjusted for live inserts and deletes.\n */\n",
5588
+ "excerptTokens": [
5589
+ {
5590
+ "kind": "Content",
5591
+ "text": "serverRowsCount: "
5592
+ },
5593
+ {
5594
+ "kind": "Content",
5595
+ "text": "number | undefined"
5596
+ },
5597
+ {
5598
+ "kind": "Content",
5599
+ "text": ";"
5600
+ }
5601
+ ],
5602
+ "isReadonly": false,
5603
+ "isOptional": false,
5604
+ "releaseTag": "Alpha",
5605
+ "name": "serverRowsCount",
5606
+ "propertyTypeTokenRange": {
5607
+ "startIndex": 1,
5608
+ "endIndex": 2
5609
+ },
5610
+ "isStatic": false,
5611
+ "isProtected": false,
5612
+ "isAbstract": false
5493
5613
  }
5494
5614
  ],
5495
5615
  "extendsTokenRange": {
@@ -5763,6 +5883,104 @@
5763
5883
  "endIndex": 2
5764
5884
  }
5765
5885
  },
5886
+ {
5887
+ "kind": "Interface",
5888
+ "canonicalReference": "@genesislcap/grid-tabulator!GridTabulatorMoreRowsEventDetail:interface",
5889
+ "docComment": "/**\n * Detail payload for the `more-rows-changed` event.\n *\n * @alpha\n */\n",
5890
+ "excerptTokens": [
5891
+ {
5892
+ "kind": "Content",
5893
+ "text": "export interface GridTabulatorMoreRowsEventDetail "
5894
+ }
5895
+ ],
5896
+ "fileUrlPath": "src/datasource/client-side.datasource.ts",
5897
+ "releaseTag": "Alpha",
5898
+ "name": "GridTabulatorMoreRowsEventDetail",
5899
+ "preserveMemberOrder": false,
5900
+ "members": [
5901
+ {
5902
+ "kind": "PropertySignature",
5903
+ "canonicalReference": "@genesislcap/grid-tabulator!GridTabulatorMoreRowsEventDetail#moreRows:member",
5904
+ "docComment": "/**\n * Whether the server holds more rows than were sent (`MORE_ROWS`).\n */\n",
5905
+ "excerptTokens": [
5906
+ {
5907
+ "kind": "Content",
5908
+ "text": "moreRows: "
5909
+ },
5910
+ {
5911
+ "kind": "Content",
5912
+ "text": "boolean | undefined"
5913
+ },
5914
+ {
5915
+ "kind": "Content",
5916
+ "text": ";"
5917
+ }
5918
+ ],
5919
+ "isReadonly": false,
5920
+ "isOptional": false,
5921
+ "releaseTag": "Alpha",
5922
+ "name": "moreRows",
5923
+ "propertyTypeTokenRange": {
5924
+ "startIndex": 1,
5925
+ "endIndex": 2
5926
+ }
5927
+ },
5928
+ {
5929
+ "kind": "PropertySignature",
5930
+ "canonicalReference": "@genesislcap/grid-tabulator!GridTabulatorMoreRowsEventDetail#rowsCount:member",
5931
+ "docComment": "/**\n * Total rows the resource holds on the server, ignoring criteria (`ROWS_COUNT`).\n */\n",
5932
+ "excerptTokens": [
5933
+ {
5934
+ "kind": "Content",
5935
+ "text": "rowsCount: "
5936
+ },
5937
+ {
5938
+ "kind": "Content",
5939
+ "text": "number | undefined"
5940
+ },
5941
+ {
5942
+ "kind": "Content",
5943
+ "text": ";"
5944
+ }
5945
+ ],
5946
+ "isReadonly": false,
5947
+ "isOptional": false,
5948
+ "releaseTag": "Alpha",
5949
+ "name": "rowsCount",
5950
+ "propertyTypeTokenRange": {
5951
+ "startIndex": 1,
5952
+ "endIndex": 2
5953
+ }
5954
+ }
5955
+ ],
5956
+ "extendsTokenRanges": []
5957
+ },
5958
+ {
5959
+ "kind": "TypeAlias",
5960
+ "canonicalReference": "@genesislcap/grid-tabulator!GridTabulatorRowDataMapperOperation:type",
5961
+ "docComment": "/**\n * Kind of change a row data mapper is called with for a stream transaction.\n *\n * @alpha\n */\n",
5962
+ "excerptTokens": [
5963
+ {
5964
+ "kind": "Content",
5965
+ "text": "export type GridTabulatorRowDataMapperOperation = "
5966
+ },
5967
+ {
5968
+ "kind": "Content",
5969
+ "text": "'add' | 'update' | 'remove' | 'page'"
5970
+ },
5971
+ {
5972
+ "kind": "Content",
5973
+ "text": ";"
5974
+ }
5975
+ ],
5976
+ "fileUrlPath": "src/datasource/client-side.datasource.ts",
5977
+ "releaseTag": "Alpha",
5978
+ "name": "GridTabulatorRowDataMapperOperation",
5979
+ "typeTokenRange": {
5980
+ "startIndex": 1,
5981
+ "endIndex": 2
5982
+ }
5983
+ },
5766
5984
  {
5767
5985
  "kind": "Variable",
5768
5986
  "canonicalReference": "@genesislcap/grid-tabulator!gridTabulatorShadowOptions:var",
@@ -1128,6 +1128,7 @@ export declare enum GridTabulatorCellRendererTypes {
1128
1128
  * @fires gridTabulator:error - Fired when a datasource error occurs. detail: `GridTabulatorErrorEventDetail`
1129
1129
  * @fires dataInit - Fired when tabulator data is initialized
1130
1130
  * @fires sizeChanged - Fired when layout size changes. detail: `GridTabulatorSizeChangedEventDetail`
1131
+ * @fires more-rows-changed - Fired when the server-reported `MORE_ROWS` or `ROWS_COUNT` changes, including when they are reset, and after every reply to `loadMore()`. detail: `GridTabulatorMoreRowsEventDetail`
1131
1132
  */
1132
1133
  export declare class GridTabulatorClientSideDatasource extends GridTabulatorClientSideDatasource_base {
1133
1134
  auth: Auth;
@@ -1164,9 +1165,36 @@ export declare class GridTabulatorClientSideDatasource extends GridTabulatorClie
1164
1165
  */
1165
1166
  keepColDefsOnClearRowData: boolean;
1166
1167
  /**
1167
- * Allows grid data updates to be processed via and external function before applying in grid
1168
+ * Allows grid data updates to be processed via and external function before applying in grid.
1169
+ *
1170
+ * @remarks
1171
+ * The mapper is called with all rows (one argument) when the grid data is set. For stream transactions it is
1172
+ * called with the changed rows, the datasource's current rows keyed by row id, and the operation
1173
+ * (`'add'`, `'update'` or `'remove'`). Rows that arrive in reply to `loadMore()` are passed as `'page'`
1174
+ * instead of `'add'`, as they are existing rows rather than new ones.
1168
1175
  */
1169
1176
  rowDataMapper: Function;
1177
+ /**
1178
+ * Total rows the resource holds on the server (`ROWS_COUNT` of the first stream message), or `undefined` when
1179
+ * unknown. It ignores criteria, and is not adjusted for live inserts and deletes.
1180
+ */
1181
+ serverRowsCount: number | undefined;
1182
+ /**
1183
+ * Whether the server holds more rows than were sent (`MORE_ROWS` of the first stream message), or `undefined`
1184
+ * when unknown. It is true when `max-rows` capped the initial load.
1185
+ */
1186
+ moreRows: boolean | undefined;
1187
+ /** MORE_ROWS requests sent by `loadMore()` that have not been answered yet. */
1188
+ private pendingPages;
1189
+ /** Further pages a `loadMore()` call still has to request, one after each reply. */
1190
+ private remainingPages;
1191
+ /** Set while the rows of a `loadMore()` reply are being applied. */
1192
+ private applyingPage;
1193
+ /**
1194
+ * Set when a `loadMore()` reply had no rows while the server still reported more. Some GSF versions answer
1195
+ * every later request the same way, so paging stops.
1196
+ */
1197
+ private pagingStalled;
1170
1198
  private dataSub;
1171
1199
  private updateSub;
1172
1200
  private connectionSub;
@@ -1255,6 +1283,33 @@ export declare class GridTabulatorClientSideDatasource extends GridTabulatorClie
1255
1283
  * @internal
1256
1284
  */
1257
1285
  loadResourceData(withFullInit?: boolean): Promise<void>;
1286
+ /**
1287
+ * Requests the next `pages` pages of rows from a data server subscription (`MORE_ROWS`), one after another.
1288
+ * Each page holds up to `max-rows` rows; the server fixes that size when the subscription opens. The rows
1289
+ * arrive on the stream and reach the row mapper as a `'page'` operation, and `more-rows-changed` is emitted
1290
+ * after each reply. Requesting stops early when the server reports no more rows.
1291
+ *
1292
+ * @returns Whether a request was sent. Nothing is sent for a request server, while a load is in progress,
1293
+ * when the server reported no more rows, or after paging stalled.
1294
+ */
1295
+ loadMore(pages?: number): Promise<boolean>;
1296
+ /** Whether a `loadMore()` call is still waiting for pages. */
1297
+ get isLoadingMore(): boolean;
1298
+ /**
1299
+ * Sends one MORE_ROWS request. The send is not awaited: the request has no reply of its own, the rows arrive
1300
+ * on the stream, so the returned promise only settles when sending fails.
1301
+ */
1302
+ private requestPage;
1303
+ /** Whether a raw stream message answers a `loadMore()` request. Live updates never carry `MORE_ROWS`. */
1304
+ private isPageReply;
1305
+ /**
1306
+ * Keeps `ROWS_COUNT` and `MORE_ROWS` from a raw stream message. The result filter drops them; the first
1307
+ * message after the logon and every reply to `loadMore()` carry them.
1308
+ */
1309
+ private captureServerPaging;
1310
+ /** Whether `loadMore()` can fetch another page now. */
1311
+ get canLoadMore(): boolean;
1312
+ private setServerPaging;
1258
1313
  private handleSnapshot;
1259
1314
  private datasourceOptions;
1260
1315
  private handleStreamResult;
@@ -1322,12 +1377,7 @@ declare const GridTabulatorClientSideDatasource_base: (new (...args: any[]) => {
1322
1377
  addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1323
1378
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1324
1379
  removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1325
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options
1326
- /**
1327
- * Returns whether the `row-id` attribute is the default one, depending on the resource type.
1328
- * @internal
1329
- */
1330
- ?: boolean | EventListenerOptions): void;
1380
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
1331
1381
  readonly attributes: NamedNodeMap;
1332
1382
  get classList(): DOMTokenList;
1333
1383
  set classList(value: string): any;
@@ -2413,6 +2463,23 @@ export declare const gridTabulatorEventNames: {
2413
2463
  datasourceErrorClose: string;
2414
2464
  };
2415
2465
 
2466
+ /**
2467
+ * Detail payload for the `more-rows-changed` event.
2468
+ * @alpha
2469
+ */
2470
+ export declare interface GridTabulatorMoreRowsEventDetail {
2471
+ /** Whether the server holds more rows than were sent (`MORE_ROWS`). */
2472
+ moreRows: boolean | undefined;
2473
+ /** Total rows the resource holds on the server, ignoring criteria (`ROWS_COUNT`). */
2474
+ rowsCount: number | undefined;
2475
+ }
2476
+
2477
+ /**
2478
+ * Kind of change a row data mapper is called with for a stream transaction.
2479
+ * @alpha
2480
+ */
2481
+ export declare type GridTabulatorRowDataMapperOperation = 'add' | 'update' | 'remove' | 'page';
2482
+
2416
2483
  /**
2417
2484
  * The grid-tabulator component registration.
2418
2485
  * @public
package/dist/react.cjs CHANGED
@@ -48,7 +48,7 @@ const GridTabulatorColumn = React.forwardRef(function GridTabulatorColumn(props,
48
48
  });
49
49
 
50
50
  const GridTabulatorClientSideDatasource = React.forwardRef(function GridTabulatorClientSideDatasource(props, ref) {
51
- const { onGridTabulatorError, onDataInit, onSizeChanged, children, ...rest } = props;
51
+ const { onGridTabulatorError, onDataInit, onSizeChanged, onMoreRowsChanged, children, ...rest } = props;
52
52
  const _innerRef = React.useRef(null);
53
53
  const _onGridTabulatorErrorRef = React.useRef(onGridTabulatorError);
54
54
  _onGridTabulatorErrorRef.current = onGridTabulatorError;
@@ -56,6 +56,8 @@ const GridTabulatorClientSideDatasource = React.forwardRef(function GridTabulato
56
56
  _onDataInitRef.current = onDataInit;
57
57
  const _onSizeChangedRef = React.useRef(onSizeChanged);
58
58
  _onSizeChangedRef.current = onSizeChanged;
59
+ const _onMoreRowsChangedRef = React.useRef(onMoreRowsChanged);
60
+ _onMoreRowsChangedRef.current = onMoreRowsChanged;
59
61
  React.useLayoutEffect(() => {
60
62
  const el = _innerRef.current;
61
63
  if (!el) return;
@@ -65,10 +67,13 @@ const GridTabulatorClientSideDatasource = React.forwardRef(function GridTabulato
65
67
  el.addEventListener('dataInit', _onDataInitFn);
66
68
  const _onSizeChangedFn = (e) => _onSizeChangedRef.current?.(e);
67
69
  el.addEventListener('sizeChanged', _onSizeChangedFn);
70
+ const _onMoreRowsChangedFn = (e) => _onMoreRowsChangedRef.current?.(e);
71
+ el.addEventListener('more-rows-changed', _onMoreRowsChangedFn);
68
72
  return () => {
69
73
  el.removeEventListener('gridTabulator:error', _onGridTabulatorErrorFn);
70
74
  el.removeEventListener('dataInit', _onDataInitFn);
71
75
  el.removeEventListener('sizeChanged', _onSizeChangedFn);
76
+ el.removeEventListener('more-rows-changed', _onMoreRowsChangedFn);
72
77
  };
73
78
  }, []);
74
79
  return React.createElement(customElements.getName(GridTabulatorClientSideDatasourceWC) ?? 'grid-tabulator-client-side-datasource', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
package/dist/react.mjs CHANGED
@@ -46,7 +46,7 @@ export const GridTabulatorColumn = React.forwardRef(function GridTabulatorColumn
46
46
  });
47
47
 
48
48
  export const GridTabulatorClientSideDatasource = React.forwardRef(function GridTabulatorClientSideDatasource(props, ref) {
49
- const { onGridTabulatorError, onDataInit, onSizeChanged, children, ...rest } = props;
49
+ const { onGridTabulatorError, onDataInit, onSizeChanged, onMoreRowsChanged, children, ...rest } = props;
50
50
  const _innerRef = React.useRef(null);
51
51
  const _onGridTabulatorErrorRef = React.useRef(onGridTabulatorError);
52
52
  _onGridTabulatorErrorRef.current = onGridTabulatorError;
@@ -54,6 +54,8 @@ export const GridTabulatorClientSideDatasource = React.forwardRef(function GridT
54
54
  _onDataInitRef.current = onDataInit;
55
55
  const _onSizeChangedRef = React.useRef(onSizeChanged);
56
56
  _onSizeChangedRef.current = onSizeChanged;
57
+ const _onMoreRowsChangedRef = React.useRef(onMoreRowsChanged);
58
+ _onMoreRowsChangedRef.current = onMoreRowsChanged;
57
59
  React.useLayoutEffect(() => {
58
60
  const el = _innerRef.current;
59
61
  if (!el) return;
@@ -63,10 +65,13 @@ export const GridTabulatorClientSideDatasource = React.forwardRef(function GridT
63
65
  el.addEventListener('dataInit', _onDataInitFn);
64
66
  const _onSizeChangedFn = (e) => _onSizeChangedRef.current?.(e);
65
67
  el.addEventListener('sizeChanged', _onSizeChangedFn);
68
+ const _onMoreRowsChangedFn = (e) => _onMoreRowsChangedRef.current?.(e);
69
+ el.addEventListener('more-rows-changed', _onMoreRowsChangedFn);
66
70
  return () => {
67
71
  el.removeEventListener('gridTabulator:error', _onGridTabulatorErrorFn);
68
72
  el.removeEventListener('dataInit', _onDataInitFn);
69
73
  el.removeEventListener('sizeChanged', _onSizeChangedFn);
74
+ el.removeEventListener('more-rows-changed', _onMoreRowsChangedFn);
70
75
  };
71
76
  }, []);
72
77
  return React.createElement(customElements.getName(GridTabulatorClientSideDatasourceWC) ?? 'grid-tabulator-client-side-datasource', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/grid-tabulator",
3
3
  "description": "Genesis Foundation Grid Tabulator",
4
- "version": "15.96.0",
4
+ "version": "15.96.2",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -39,19 +39,19 @@
39
39
  }
40
40
  },
41
41
  "devDependencies": {
42
- "@genesislcap/foundation-testing": "15.96.0",
43
- "@genesislcap/genx": "15.96.0",
44
- "@genesislcap/ts-builder": "15.96.0",
45
- "@genesislcap/uvu-playwright-builder": "15.96.0",
46
- "@genesislcap/vite-builder": "15.96.0",
47
- "@genesislcap/webpack-builder": "15.96.0",
42
+ "@genesislcap/foundation-testing": "15.96.2",
43
+ "@genesislcap/genx": "15.96.2",
44
+ "@genesislcap/ts-builder": "15.96.2",
45
+ "@genesislcap/uvu-playwright-builder": "15.96.2",
46
+ "@genesislcap/vite-builder": "15.96.2",
47
+ "@genesislcap/webpack-builder": "15.96.2",
48
48
  "@types/tabulator-tables": "6.2.6"
49
49
  },
50
50
  "dependencies": {
51
- "@genesislcap/foundation-comms": "15.96.0",
52
- "@genesislcap/foundation-logger": "15.96.0",
53
- "@genesislcap/foundation-ui": "15.96.0",
54
- "@genesislcap/foundation-utils": "15.96.0",
51
+ "@genesislcap/foundation-comms": "15.96.2",
52
+ "@genesislcap/foundation-logger": "15.96.2",
53
+ "@genesislcap/foundation-ui": "15.96.2",
54
+ "@genesislcap/foundation-utils": "15.96.2",
55
55
  "@microsoft/fast-colors": "5.3.1",
56
56
  "@microsoft/fast-components": "2.30.6",
57
57
  "@microsoft/fast-element": "1.14.0",