@cerberus-design/data-grid 0.25.3 → 1.0.0-rc.6

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 (34) hide show
  1. package/dist/column-helpers.cjs +55 -21
  2. package/dist/column-helpers.js +55 -17
  3. package/dist/components/cerby-data-grid.client.cjs +12 -11
  4. package/dist/components/cerby-data-grid.client.js +12 -7
  5. package/dist/components/count-menu.client.cjs +46 -49
  6. package/dist/components/count-menu.client.js +46 -45
  7. package/dist/components/data-grid.client.cjs +89 -82
  8. package/dist/components/data-grid.client.js +89 -78
  9. package/dist/components/features.client.cjs +72 -76
  10. package/dist/components/features.client.js +72 -72
  11. package/dist/components/grid.client.cjs +280 -309
  12. package/dist/components/grid.client.js +281 -303
  13. package/dist/components/pagination.client.cjs +90 -113
  14. package/dist/components/pagination.client.js +90 -109
  15. package/dist/components/pinned-items.client.cjs +60 -59
  16. package/dist/components/pinned-items.client.js +60 -55
  17. package/dist/components/sort-items.client.cjs +44 -49
  18. package/dist/components/sort-items.client.js +44 -45
  19. package/dist/const.cjs +32 -43
  20. package/dist/const.js +33 -31
  21. package/dist/context.client.cjs +12 -12
  22. package/dist/context.client.js +12 -8
  23. package/dist/hooks.client.cjs +13 -20
  24. package/dist/hooks.client.js +13 -16
  25. package/dist/index.cjs +9 -15
  26. package/dist/index.js +5 -4
  27. package/dist/panda.buildinfo.json +23 -0
  28. package/dist/store.cjs +241 -284
  29. package/dist/store.js +241 -280
  30. package/dist/utils.cjs +23 -45
  31. package/dist/utils.js +23 -41
  32. package/dist/virtualizer.client.cjs +63 -53
  33. package/dist/virtualizer.client.js +63 -49
  34. package/package.json +33 -27
package/dist/store.js CHANGED
@@ -1,283 +1,244 @@
1
- 'use client';
2
- import { createSignal, createComputed, batch } from '@cerberus-design/signals';
3
- import { determineRowHeight, determinePageIndex, determinePageSize, determinePageRange, determineInitialCount } from './utils.js';
4
- import { DEFAULT_PAGE_IDX } from './const.js';
5
-
1
+ "use client";
2
+ import { determineInitialCount, determinePageIndex, determinePageRange, determinePageSize, determineRowHeight } from "./utils.js";
3
+ import { batch, createComputed, createSignal } from "@cerberus-design/signals";
4
+ //#region src/store.ts
5
+ /**
6
+ * Internal signal-based Store engine driving the state. We expose this in
7
+ * the public Context API.
8
+ */
6
9
  function createGridStore(options) {
7
- const [containerWidth, setContainerWidth] = createSignal(0);
8
- const [rows, setRows] = createSignal(options.data);
9
- const [rowSize] = createSignal(determineRowHeight(options.rowSize));
10
- const [globalFilter, setGlobalFilter] = createSignal("");
11
- const [sorting, setSorting] = createSignal([]);
12
- const [pageIndex, setPageIndex] = createSignal(
13
- determinePageIndex(options.initialState?.pagination)
14
- );
15
- const [pageSize, setPageSize] = createSignal(
16
- determinePageSize(options.initialState?.pagination)
17
- );
18
- const [pageRange] = createSignal(
19
- determinePageRange(options.initialState?.pagination)
20
- );
21
- const [isServerPaginated] = createSignal(
22
- Boolean(determineInitialCount(options.initialState?.pagination))
23
- );
24
- const initialCols = options.columns.map((col) => {
25
- const pinnable = Boolean(col.features?.pinning);
26
- const filterable = Boolean(col.features?.filter);
27
- const sortable = Boolean(col.features?.sort);
28
- const hasFeatures = pinnable || filterable || sortable;
29
- const minWForFeatures = 100;
30
- let finalWidth = col.width ?? 150;
31
- if (hasFeatures && col.width && col.width < minWForFeatures) {
32
- finalWidth = minWForFeatures;
33
- }
34
- const [isVisible] = createSignal(true);
35
- const [isFlex, setFlex] = createSignal(col.width === void 0);
36
- const [pinned, setPinned] = createSignal(
37
- col.features?.pinning?.defaultPosition ?? false
38
- );
39
- const [width, setColWidth] = createSignal(finalWidth);
40
- return {
41
- id: col.id,
42
- isFlex,
43
- isVisible,
44
- original: col,
45
- pinned,
46
- width,
47
- getValue: col.accessor,
48
- // feature flags
49
- pinnable,
50
- filterable,
51
- sortable,
52
- // setters
53
- setFlex,
54
- setPinned,
55
- setColWidth
56
- };
57
- });
58
- const [columns] = createSignal(initialCols);
59
- const currentPageRange = createComputed(
60
- () => {
61
- const dataIdx = pageIndex() - 1;
62
- const isFirstPage = dataIdx === 0;
63
- const start = isFirstPage ? 0 : dataIdx * pageSize() - 1;
64
- return {
65
- start,
66
- end: pageIndex() * pageSize()
67
- };
68
- }
69
- );
70
- const processedRows = createComputed(() => {
71
- let result = [...rows()];
72
- const filter = globalFilter().toLowerCase();
73
- const sortState = sorting();
74
- if (filter) {
75
- result = result.filter((row) => {
76
- return columns().some((col) => {
77
- if (!col.filterable) return false;
78
- const val = String(col.getValue(row)).toLowerCase();
79
- return val.includes(filter);
80
- });
81
- });
82
- }
83
- if (sortState.length > 0) {
84
- result.sort((a, b) => {
85
- for (const sort of sortState) {
86
- const col = columns().find((c) => c.id === sort.id);
87
- if (!col) continue;
88
- const valA = col.getValue(a);
89
- const valB = col.getValue(b);
90
- if (valA === valB) continue;
91
- let comparison = 0;
92
- const customComparator = typeof col.original.features?.sort === "object" ? col.original.features.sort.comparator : void 0;
93
- if (customComparator) {
94
- comparison = customComparator(valA, valB);
95
- } else {
96
- comparison = valA > valB ? 1 : -1;
97
- }
98
- return sort.desc ? -comparison : comparison;
99
- }
100
- return 0;
101
- });
102
- }
103
- return result;
104
- });
105
- const rowCount = createComputed(
106
- () => determineInitialCount(options?.initialState?.pagination) ?? processedRows().length
107
- );
108
- const pageCount = createComputed(() => Math.ceil(rowCount() / pageSize()));
109
- const orderedColumns = createComputed(() => {
110
- const left = [];
111
- const center = [];
112
- const right = [];
113
- columns().forEach((col) => {
114
- const pin = col.pinned();
115
- if (pin === "left") left.push(col);
116
- else if (pin === "right") right.push(col);
117
- else center.push(col);
118
- });
119
- return [...left, ...center, ...right];
120
- });
121
- const visibleRows = createComputed(() => {
122
- if (pageSize() && pageCount() > 1) {
123
- const currentRange = currentPageRange();
124
- return processedRows().slice(currentRange.start, currentRange.end);
125
- }
126
- return processedRows();
127
- });
128
- const rootCssVars = createComputed(() => {
129
- const vars = {};
130
- const visibleCols = [];
131
- const cols = columns();
132
- const cWidth = containerWidth();
133
- let fixedSpace = 0;
134
- let flexCount = 0;
135
- for (let i = 0; i < cols.length; i++) {
136
- const col = cols[i];
137
- if (!col.isVisible()) continue;
138
- visibleCols.push(col);
139
- if (col.isFlex()) {
140
- flexCount++;
141
- } else {
142
- fixedSpace += col.width();
143
- }
144
- const order = orderedColumns().findIndex(
145
- (orderedCol) => orderedCol.id === col.id
146
- );
147
- vars[`--col-${col.id}-order`] = `${order}`;
148
- }
149
- const remainingSpace = Math.max(0, cWidth - fixedSpace);
150
- const flexWidth = flexCount > 0 ? remainingSpace / flexCount : 0;
151
- let leftOffset = 0;
152
- let totalW = 0;
153
- const computedWidths = new Float64Array(visibleCols.length);
154
- for (let i = 0; i < visibleCols.length; i++) {
155
- const col = visibleCols[i];
156
- let finalWidth = col.width();
157
- if (col.isFlex()) {
158
- finalWidth = Math.max(col.original.minWidth ?? 150, flexWidth);
159
- }
160
- computedWidths[i] = finalWidth;
161
- totalW += finalWidth;
162
- vars[`--col-${col.id}-width`] = `${finalWidth}px`;
163
- if (col.pinned() === "left") {
164
- vars[`--col-${col.id}-left`] = `${leftOffset}px`;
165
- leftOffset += finalWidth;
166
- }
167
- }
168
- let rightOffset = 0;
169
- for (let i = visibleCols.length - 1; i >= 0; i--) {
170
- const col = visibleCols[i];
171
- if (col.pinned() === "right") {
172
- vars[`--col-${col.id}-right`] = `${rightOffset}px`;
173
- rightOffset += computedWidths[i];
174
- }
175
- }
176
- vars["--total-grid-width"] = `${totalW}px`;
177
- vars["--row-height"] = `${rowSize()}px`;
178
- return vars;
179
- });
180
- const totalWidth = createComputed(
181
- () => columns().reduce((acc, c) => acc + c.width(), 0)
182
- );
183
- return {
184
- columns,
185
- rows,
186
- globalFilter,
187
- sorting,
188
- pageCount,
189
- pageIndex,
190
- pageSize,
191
- pageRange,
192
- currentPageRange,
193
- isServerPaginated,
194
- rootCssVars,
195
- rowCount,
196
- rowSize,
197
- totalWidth,
198
- visibleRows,
199
- // Actions
200
- updateData: (newData) => {
201
- setRows(newData);
202
- },
203
- setSort: (colId, direction, multi = false) => {
204
- if (direction === null) {
205
- setSorting(sorting().filter((s) => s.id !== colId));
206
- return;
207
- }
208
- const current = sorting();
209
- const newSort = { id: colId, desc: direction === "desc" };
210
- if (multi) {
211
- const existingIndex = current.findIndex((s) => s.id === colId);
212
- if (existingIndex >= 0) {
213
- const next = [...current];
214
- next[existingIndex] = newSort;
215
- setSorting(next);
216
- } else {
217
- setSorting([...current, newSort]);
218
- }
219
- } else {
220
- setSorting([newSort]);
221
- }
222
- },
223
- togglePinned: (colId, state) => {
224
- const col = columns().find((c) => c.id === colId);
225
- if (col) col.setPinned(state ?? false);
226
- },
227
- toggleSort: (colId, multi) => {
228
- const current = sorting();
229
- const exists = current.findIndex((s) => s.id === colId) !== -1;
230
- const updatedSort = current.map((s) => {
231
- if (s.id === colId) {
232
- return { ...s, desc: !s.desc };
233
- }
234
- return s;
235
- });
236
- if (exists) {
237
- setSorting(multi ? [...current, ...updatedSort] : [...updatedSort]);
238
- } else {
239
- const newSort = { id: colId, desc: true };
240
- setSorting(multi ? [...current, newSort] : [newSort]);
241
- }
242
- },
243
- setPage: (details) => {
244
- setPageIndex(details.page);
245
- options.onPageChange?.(details);
246
- },
247
- setPageSize: (size) => {
248
- if (isServerPaginated()) {
249
- setPageIndex(DEFAULT_PAGE_IDX);
250
- }
251
- setPageSize(size);
252
- },
253
- setGlobalFilter: (val) => {
254
- batch(() => {
255
- setGlobalFilter(val);
256
- setPageIndex(DEFAULT_PAGE_IDX);
257
- });
258
- },
259
- setContainerWidth: (w) => {
260
- setContainerWidth(w);
261
- },
262
- resizeColumn: (colId, delta) => {
263
- const col = columns().find((c) => c.id === colId);
264
- if (col) {
265
- if (col.isFlex()) {
266
- const fixedSpace = columns().filter((c) => !c.isFlex()).reduce((a, b) => a + b.width(), 0);
267
- const flexCount = columns().filter((c) => c.isFlex()).length;
268
- const currentFlexWidth = Math.max(
269
- col.original.minWidth ?? 150,
270
- (containerWidth() - fixedSpace) / flexCount
271
- );
272
- col.setColWidth(currentFlexWidth);
273
- col.setFlex(false);
274
- }
275
- col.setColWidth(
276
- Math.max(col.original.minWidth ?? 50, col.width() + delta)
277
- );
278
- }
279
- }
280
- };
10
+ const [containerWidth, setContainerWidth] = createSignal(0);
11
+ const [rows, setRows] = createSignal(options.data);
12
+ const [rowSize] = createSignal(determineRowHeight(options.rowSize));
13
+ const [globalFilter, setGlobalFilter] = createSignal("");
14
+ const [sorting, setSorting] = createSignal([]);
15
+ const [pageIndex, setPageIndex] = createSignal(determinePageIndex(options.initialState?.pagination));
16
+ const [pageSize, setPageSize] = createSignal(determinePageSize(options.initialState?.pagination));
17
+ const [pageRange] = createSignal(determinePageRange(options.initialState?.pagination));
18
+ const [isServerPaginated] = createSignal(Boolean(determineInitialCount(options.initialState?.pagination)));
19
+ const [columns] = createSignal(options.columns.map((col) => {
20
+ const pinnable = Boolean(col.features?.pinning);
21
+ const filterable = Boolean(col.features?.filter);
22
+ const sortable = Boolean(col.features?.sort);
23
+ const hasFeatures = pinnable || filterable || sortable;
24
+ const minWForFeatures = 100;
25
+ let finalWidth = col.width ?? 150;
26
+ if (hasFeatures && col.width && col.width < minWForFeatures) finalWidth = minWForFeatures;
27
+ const [isVisible] = createSignal(true);
28
+ const [isFlex, setFlex] = createSignal(col.width === void 0);
29
+ const [pinned, setPinned] = createSignal(col.features?.pinning?.defaultPosition ?? false);
30
+ const [width, setColWidth] = createSignal(finalWidth);
31
+ return {
32
+ id: col.id,
33
+ isFlex,
34
+ isVisible,
35
+ original: col,
36
+ pinned,
37
+ width,
38
+ getValue: col.accessor,
39
+ pinnable,
40
+ filterable,
41
+ sortable,
42
+ setFlex,
43
+ setPinned,
44
+ setColWidth
45
+ };
46
+ }));
47
+ const currentPageRange = createComputed(() => {
48
+ const dataIdx = pageIndex() - 1;
49
+ return {
50
+ start: dataIdx === 0 ? 0 : dataIdx * pageSize() - 1,
51
+ end: pageIndex() * pageSize()
52
+ };
53
+ });
54
+ const processedRows = createComputed(() => {
55
+ let result = [...rows()];
56
+ const filter = globalFilter().toLowerCase();
57
+ const sortState = sorting();
58
+ if (filter) result = result.filter((row) => {
59
+ return columns().some((col) => {
60
+ if (!col.filterable) return false;
61
+ return String(col.getValue(row)).toLowerCase().includes(filter);
62
+ });
63
+ });
64
+ if (sortState.length > 0) result.sort((a, b) => {
65
+ for (const sort of sortState) {
66
+ const col = columns().find((c) => c.id === sort.id);
67
+ if (!col) continue;
68
+ const valA = col.getValue(a);
69
+ const valB = col.getValue(b);
70
+ if (valA === valB) continue;
71
+ let comparison = 0;
72
+ const customComparator = typeof col.original.features?.sort === "object" ? col.original.features.sort.comparator : void 0;
73
+ if (customComparator) comparison = customComparator(valA, valB);
74
+ else comparison = valA > valB ? 1 : -1;
75
+ return sort.desc ? -comparison : comparison;
76
+ }
77
+ return 0;
78
+ });
79
+ return result;
80
+ });
81
+ const rowCount = createComputed(() => determineInitialCount(options?.initialState?.pagination) ?? processedRows().length);
82
+ const pageCount = createComputed(() => Math.ceil(rowCount() / pageSize()));
83
+ const orderedColumns = createComputed(() => {
84
+ const left = [];
85
+ const center = [];
86
+ const right = [];
87
+ columns().forEach((col) => {
88
+ const pin = col.pinned();
89
+ if (pin === "left") left.push(col);
90
+ else if (pin === "right") right.push(col);
91
+ else center.push(col);
92
+ });
93
+ return [
94
+ ...left,
95
+ ...center,
96
+ ...right
97
+ ];
98
+ });
99
+ const visibleRows = createComputed(() => {
100
+ if (pageSize() && pageCount() > 1) {
101
+ const currentRange = currentPageRange();
102
+ return processedRows().slice(currentRange.start, currentRange.end);
103
+ }
104
+ return processedRows();
105
+ });
106
+ return {
107
+ columns,
108
+ rows,
109
+ globalFilter,
110
+ sorting,
111
+ pageCount,
112
+ pageIndex,
113
+ pageSize,
114
+ pageRange,
115
+ currentPageRange,
116
+ isServerPaginated,
117
+ rootCssVars: createComputed(() => {
118
+ const vars = {};
119
+ const visibleCols = [];
120
+ const cols = columns();
121
+ const cWidth = containerWidth();
122
+ let fixedSpace = 0;
123
+ let flexCount = 0;
124
+ for (let i = 0; i < cols.length; i++) {
125
+ const col = cols[i];
126
+ if (!col.isVisible()) continue;
127
+ visibleCols.push(col);
128
+ if (col.isFlex()) flexCount++;
129
+ else fixedSpace += col.width();
130
+ const order = orderedColumns().findIndex((orderedCol) => orderedCol.id === col.id);
131
+ vars[`--col-${col.id}-order`] = `${order}`;
132
+ }
133
+ const remainingSpace = Math.max(0, cWidth - fixedSpace);
134
+ const flexWidth = flexCount > 0 ? remainingSpace / flexCount : 0;
135
+ let leftOffset = 0;
136
+ let totalW = 0;
137
+ const computedWidths = new Float64Array(visibleCols.length);
138
+ for (let i = 0; i < visibleCols.length; i++) {
139
+ const col = visibleCols[i];
140
+ let finalWidth = col.width();
141
+ if (col.isFlex()) finalWidth = Math.max(col.original.minWidth ?? 150, flexWidth);
142
+ computedWidths[i] = finalWidth;
143
+ totalW += finalWidth;
144
+ vars[`--col-${col.id}-width`] = `${finalWidth}px`;
145
+ if (col.pinned() === "left") {
146
+ vars[`--col-${col.id}-left`] = `${leftOffset}px`;
147
+ leftOffset += finalWidth;
148
+ }
149
+ }
150
+ let rightOffset = 0;
151
+ for (let i = visibleCols.length - 1; i >= 0; i--) {
152
+ const col = visibleCols[i];
153
+ if (col.pinned() === "right") {
154
+ vars[`--col-${col.id}-right`] = `${rightOffset}px`;
155
+ rightOffset += computedWidths[i];
156
+ }
157
+ }
158
+ vars["--total-grid-width"] = `${totalW}px`;
159
+ vars["--row-height"] = `${rowSize()}px`;
160
+ return vars;
161
+ }),
162
+ rowCount,
163
+ rowSize,
164
+ totalWidth: createComputed(() => columns().reduce((acc, c) => acc + c.width(), 0)),
165
+ visibleRows,
166
+ updateData: (newData) => {
167
+ setRows(newData);
168
+ },
169
+ setSort: (colId, direction, multi = false) => {
170
+ if (direction === null) {
171
+ setSorting(sorting().filter((s) => s.id !== colId));
172
+ return;
173
+ }
174
+ const current = sorting();
175
+ const newSort = {
176
+ id: colId,
177
+ desc: direction === "desc"
178
+ };
179
+ if (multi) {
180
+ const existingIndex = current.findIndex((s) => s.id === colId);
181
+ if (existingIndex >= 0) {
182
+ const next = [...current];
183
+ next[existingIndex] = newSort;
184
+ setSorting(next);
185
+ } else setSorting([...current, newSort]);
186
+ } else setSorting([newSort]);
187
+ },
188
+ togglePinned: (colId, state) => {
189
+ const col = columns().find((c) => c.id === colId);
190
+ if (col) col.setPinned(state ?? false);
191
+ },
192
+ toggleSort: (colId, multi) => {
193
+ const current = sorting();
194
+ const exists = current.findIndex((s) => s.id === colId) !== -1;
195
+ const updatedSort = current.map((s) => {
196
+ if (s.id === colId) return {
197
+ ...s,
198
+ desc: !s.desc
199
+ };
200
+ return s;
201
+ });
202
+ if (exists) setSorting(multi ? [...current, ...updatedSort] : [...updatedSort]);
203
+ else {
204
+ const newSort = {
205
+ id: colId,
206
+ desc: true
207
+ };
208
+ setSorting(multi ? [...current, newSort] : [newSort]);
209
+ }
210
+ },
211
+ setPage: (details) => {
212
+ setPageIndex(details.page);
213
+ options.onPageChange?.(details);
214
+ },
215
+ setPageSize: (size) => {
216
+ if (isServerPaginated()) setPageIndex(1);
217
+ setPageSize(size);
218
+ },
219
+ setGlobalFilter: (val) => {
220
+ batch(() => {
221
+ setGlobalFilter(val);
222
+ setPageIndex(1);
223
+ });
224
+ },
225
+ setContainerWidth: (w) => {
226
+ setContainerWidth(w);
227
+ },
228
+ resizeColumn: (colId, delta) => {
229
+ const col = columns().find((c) => c.id === colId);
230
+ if (col) {
231
+ if (col.isFlex()) {
232
+ const fixedSpace = columns().filter((c) => !c.isFlex()).reduce((a, b) => a + b.width(), 0);
233
+ const flexCount = columns().filter((c) => c.isFlex()).length;
234
+ const currentFlexWidth = Math.max(col.original.minWidth ?? 150, (containerWidth() - fixedSpace) / flexCount);
235
+ col.setColWidth(currentFlexWidth);
236
+ col.setFlex(false);
237
+ }
238
+ col.setColWidth(Math.max(col.original.minWidth ?? 50, col.width() + delta));
239
+ }
240
+ }
241
+ };
281
242
  }
282
-
243
+ //#endregion
283
244
  export { createGridStore };
package/dist/utils.cjs CHANGED
@@ -1,57 +1,35 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const _const = require('./const.cjs');
7
-
8
- function determineRowHeight(rowSize = _const.SM) {
9
- const prebuiltSizes = _const.ROW_SIZES.items;
10
- if (typeof rowSize === "number") {
11
- return rowSize;
12
- }
13
- if (prebuiltSizes.includes(rowSize)) {
14
- const size = _const.ROW_SIZES.results[rowSize];
15
- return size;
16
- }
17
- console.error(
18
- "Unknown row size provided to Data Grid. The rowSize prop requires a number to determine pixel-based value.",
19
- rowSize
20
- );
21
- return 0;
1
+ "use client";
2
+ const require_const = require("./const.cjs");
3
+ //#region src/utils.ts
4
+ function determineRowHeight(rowSize = "sm") {
5
+ const prebuiltSizes = require_const.ROW_SIZES.items;
6
+ if (typeof rowSize === "number") return rowSize;
7
+ if (prebuiltSizes.includes(rowSize)) return require_const.ROW_SIZES.results[rowSize];
8
+ console.error("Unknown row size provided to Data Grid. The rowSize prop requires a number to determine pixel-based value.", rowSize);
9
+ return 0;
22
10
  }
23
11
  function determinePageSize(options) {
24
- if (!options) return 0;
25
- if (typeof options === "boolean" && options === true) {
26
- return _const.SM_PAGE_SIZE;
27
- }
28
- if (options.customRange?.length) {
29
- return options.customRange[0];
30
- }
31
- return options.pageSize ?? _const.SM_PAGE_SIZE;
12
+ if (!options) return 0;
13
+ if (typeof options === "boolean" && options === true) return 25;
14
+ if (options.customRange?.length) return options.customRange[0];
15
+ return options.pageSize ?? 25;
32
16
  }
33
17
  function determinePageIndex(options) {
34
- if (!options) return _const.DEFAULT_PAGE_IDX;
35
- if (typeof options === "boolean" && options === true) {
36
- return _const.DEFAULT_PAGE_IDX;
37
- }
38
- return options.defaultPage ?? _const.DEFAULT_PAGE_IDX;
18
+ if (!options) return 1;
19
+ if (typeof options === "boolean" && options === true) return 1;
20
+ return options.defaultPage ?? 1;
39
21
  }
40
22
  function determinePageRange(options) {
41
- if (!options) return _const.DEFAULT_PAGE_SIZES;
42
- if (typeof options === "boolean" && options === true) {
43
- return _const.DEFAULT_PAGE_SIZES;
44
- }
45
- return options.customRange ?? _const.DEFAULT_PAGE_SIZES;
23
+ if (!options) return require_const.DEFAULT_PAGE_SIZES;
24
+ if (typeof options === "boolean" && options === true) return require_const.DEFAULT_PAGE_SIZES;
25
+ return options.customRange ?? require_const.DEFAULT_PAGE_SIZES;
46
26
  }
47
27
  function determineInitialCount(options) {
48
- if (!options) return void 0;
49
- if (typeof options === "boolean" && options === true) {
50
- return void 0;
51
- }
52
- return options?.count ?? void 0;
28
+ if (!options) return void 0;
29
+ if (typeof options === "boolean" && options === true) return;
30
+ return options?.count ?? void 0;
53
31
  }
54
-
32
+ //#endregion
55
33
  exports.determineInitialCount = determineInitialCount;
56
34
  exports.determinePageIndex = determinePageIndex;
57
35
  exports.determinePageRange = determinePageRange;