@octane-xplat/table 0.0.1 → 0.11.0

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 (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +427 -3
  3. package/dist/native/ColumnDrag.tsrx.js +237 -0
  4. package/dist/native/DataGrid.tsrx.js +957 -0
  5. package/dist/native/GridControls.tsrx.js +424 -0
  6. package/dist/native/grid-accessibility.js +12 -0
  7. package/dist/native/grid-layout.js +43 -0
  8. package/dist/native/index.js +4 -0
  9. package/dist/native/octane-client-build.json +8 -0
  10. package/dist/native/table.js +56 -0
  11. package/dist/native/useTable.tsrx.js +24 -0
  12. package/dist/web/ColumnDrag.tsrx.js +85 -0
  13. package/dist/web/DataGrid.tsrx.js +242 -0
  14. package/dist/web/GridControls.tsrx.js +114 -0
  15. package/dist/web/grid-accessibility.js +12 -0
  16. package/dist/web/grid-layout.js +43 -0
  17. package/dist/web/index.js +4 -0
  18. package/dist/web/octane-client-build.json +8 -0
  19. package/dist/web/table.js +56 -0
  20. package/dist/web/useTable.tsrx.js +26 -0
  21. package/package.json +75 -3
  22. package/src/ColumnDrag.tsrx +123 -0
  23. package/src/DataGrid.mobile.test.tsrx +55 -0
  24. package/src/DataGrid.tsrx +350 -0
  25. package/src/DataGrid.web.test.tsrx +277 -0
  26. package/src/GridControls.tsrx +157 -0
  27. package/src/grid-accessibility.ts +14 -0
  28. package/src/grid-layout.test.ts +32 -0
  29. package/src/grid-layout.ts +52 -0
  30. package/src/index.macos.ts +8 -0
  31. package/src/index.ts +7 -0
  32. package/src/index.web.ts +8 -0
  33. package/src/props.ts +122 -0
  34. package/src/table.test.ts +114 -0
  35. package/src/table.ts +91 -0
  36. package/src/useTable.tsrx +34 -0
  37. package/types/index.d.ts +20 -0
  38. package/types/index.macos.d.ts +17 -0
  39. package/types/props.d.ts +96 -0
  40. package/types/table.d.ts +83 -0
@@ -0,0 +1,957 @@
1
+ import { useTable } from "./useTable.tsrx.js";
2
+ import { columnStyle } from "./grid-layout.js";
3
+ import { gridRowPosition } from "./grid-accessibility.js";
4
+ import { ColumnDrag } from "./ColumnDrag.tsrx.js";
5
+ import { GridControls, GridPagination } from "./GridControls.tsrx.js";
6
+ import { defineUniversalComponent, hookSlots, universalChildren, universalComponent, universalPlan, universalProps, universalValue, withSlot } from "@nativescript-community/octane";
7
+ import { CheckboxInput, HStack, Pressable, Text, TextInput, View, VirtualList } from "@octane-xplat/ui";
8
+ //#region src/DataGrid.tsrx
9
+ var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(1));
10
+ var __octaneUniversalPlan0 = universalPlan("nativescript", {
11
+ "kind": "slot",
12
+ "slot": 0
13
+ });
14
+ var __octaneUniversalPlan1 = universalPlan("nativescript", {
15
+ "kind": "range",
16
+ "children": [{
17
+ "kind": "slot",
18
+ "slot": 0
19
+ }, {
20
+ "kind": "slot",
21
+ "slot": 1
22
+ }]
23
+ });
24
+ var __octaneUniversalPlan2 = universalPlan("nativescript", {
25
+ "kind": "slot",
26
+ "slot": 0
27
+ });
28
+ var __octaneUniversalPlan3 = universalPlan("nativescript", {
29
+ "kind": "slot",
30
+ "slot": 0
31
+ });
32
+ var __octaneUniversalPlan4 = universalPlan("nativescript", {
33
+ "kind": "range",
34
+ "children": [{
35
+ "kind": "slot",
36
+ "slot": 0
37
+ }, {
38
+ "kind": "slot",
39
+ "slot": 1
40
+ }]
41
+ });
42
+ var __octaneUniversalPlan5 = universalPlan("nativescript", {
43
+ "kind": "range",
44
+ "children": [{
45
+ "kind": "slot",
46
+ "slot": 0
47
+ }]
48
+ });
49
+ var __octaneUniversalPlan6 = universalPlan("nativescript", {
50
+ "kind": "slot",
51
+ "slot": 0
52
+ });
53
+ var __octaneUniversalPlan7 = universalPlan("nativescript", {
54
+ "kind": "slot",
55
+ "slot": 0
56
+ });
57
+ var __octaneUniversalPlan8 = universalPlan("nativescript", {
58
+ "kind": "slot",
59
+ "slot": 0
60
+ });
61
+ var __octaneUniversalPlan9 = universalPlan("nativescript", {
62
+ "kind": "slot",
63
+ "slot": 0
64
+ });
65
+ var __octaneUniversalPlan10 = universalPlan("nativescript", {
66
+ "kind": "range",
67
+ "children": [
68
+ {
69
+ "kind": "slot",
70
+ "slot": 0
71
+ },
72
+ {
73
+ "kind": "slot",
74
+ "slot": 1
75
+ },
76
+ {
77
+ "kind": "slot",
78
+ "slot": 2
79
+ }
80
+ ]
81
+ });
82
+ var __octaneUniversalPlan11 = universalPlan("nativescript", {
83
+ "kind": "slot",
84
+ "slot": 0
85
+ });
86
+ var __octaneUniversalPlan12 = universalPlan("nativescript", {
87
+ "kind": "slot",
88
+ "slot": 0
89
+ });
90
+ var __octaneUniversalPlan13 = universalPlan("nativescript", {
91
+ "kind": "slot",
92
+ "slot": 0
93
+ });
94
+ var __octaneUniversalPlan14 = universalPlan("nativescript", {
95
+ "kind": "range",
96
+ "children": [{
97
+ "kind": "slot",
98
+ "slot": 0
99
+ }]
100
+ });
101
+ var __octaneUniversalPlan15 = universalPlan("nativescript", {
102
+ "kind": "slot",
103
+ "slot": 0
104
+ });
105
+ var __octaneUniversalPlan16 = universalPlan("nativescript", {
106
+ "kind": "slot",
107
+ "slot": 0
108
+ });
109
+ var __octaneUniversalPlan17 = universalPlan("nativescript", {
110
+ "kind": "slot",
111
+ "slot": 0
112
+ });
113
+ var __octaneUniversalPlan18 = universalPlan("nativescript", {
114
+ "kind": "range",
115
+ "children": [{
116
+ "kind": "slot",
117
+ "slot": 0
118
+ }, {
119
+ "kind": "slot",
120
+ "slot": 1
121
+ }]
122
+ });
123
+ var __octaneUniversalPlan19 = universalPlan("nativescript", {
124
+ "kind": "slot",
125
+ "slot": 0
126
+ });
127
+ var __octaneUniversalPlan20 = universalPlan("nativescript", {
128
+ "kind": "slot",
129
+ "slot": 0
130
+ });
131
+ var __octaneUniversalPlan21 = universalPlan("nativescript", {
132
+ "kind": "range",
133
+ "children": [{
134
+ "kind": "slot",
135
+ "slot": 0
136
+ }, {
137
+ "kind": "text",
138
+ "value": " selected"
139
+ }]
140
+ });
141
+ var __octaneUniversalPlan22 = universalPlan("nativescript", {
142
+ "kind": "text",
143
+ "value": "Clear selection"
144
+ });
145
+ var __octaneUniversalPlan23 = universalPlan("nativescript", {
146
+ "kind": "slot",
147
+ "slot": 0
148
+ });
149
+ var __octaneUniversalPlan24 = universalPlan("nativescript", {
150
+ "kind": "range",
151
+ "children": [
152
+ {
153
+ "kind": "slot",
154
+ "slot": 0
155
+ },
156
+ {
157
+ "kind": "slot",
158
+ "slot": 1
159
+ },
160
+ {
161
+ "kind": "slot",
162
+ "slot": 2
163
+ }
164
+ ]
165
+ });
166
+ var __octaneUniversalPlan25 = universalPlan("nativescript", {
167
+ "kind": "slot",
168
+ "slot": 0
169
+ });
170
+ var __octaneUniversalPlan26 = universalPlan("nativescript", {
171
+ "kind": "slot",
172
+ "slot": 0
173
+ });
174
+ var __octaneUniversalPlan27 = universalPlan("nativescript", {
175
+ "kind": "slot",
176
+ "slot": 0
177
+ });
178
+ var __octaneUniversalPlan28 = universalPlan("nativescript", {
179
+ "kind": "slot",
180
+ "slot": 0
181
+ });
182
+ var __octaneUniversalPlan29 = universalPlan("nativescript", {
183
+ "kind": "range",
184
+ "children": [{
185
+ "kind": "slot",
186
+ "slot": 0
187
+ }, {
188
+ "kind": "slot",
189
+ "slot": 1
190
+ }]
191
+ });
192
+ var __octaneUniversalPlan30 = universalPlan("nativescript", {
193
+ "kind": "slot",
194
+ "slot": 0
195
+ });
196
+ var __octaneUniversalPlan31 = universalPlan("nativescript", {
197
+ "kind": "slot",
198
+ "slot": 0
199
+ });
200
+ var __octaneUniversalPlan32 = universalPlan("nativescript", {
201
+ "kind": "range",
202
+ "children": [{
203
+ "kind": "slot",
204
+ "slot": 0
205
+ }, {
206
+ "kind": "slot",
207
+ "slot": 1
208
+ }]
209
+ });
210
+ var __octaneUniversalPlan33 = universalPlan("nativescript", {
211
+ "kind": "slot",
212
+ "slot": 0
213
+ });
214
+ var __octaneUniversalPlan34 = universalPlan("nativescript", {
215
+ "kind": "range",
216
+ "children": [
217
+ {
218
+ "kind": "slot",
219
+ "slot": 0
220
+ },
221
+ {
222
+ "kind": "slot",
223
+ "slot": 1
224
+ },
225
+ {
226
+ "kind": "slot",
227
+ "slot": 2
228
+ },
229
+ {
230
+ "kind": "slot",
231
+ "slot": 3
232
+ }
233
+ ]
234
+ });
235
+ var __octaneUniversalPlan35 = universalPlan("nativescript", {
236
+ "kind": "slot",
237
+ "slot": 0
238
+ });
239
+ function renderTemplate(template, ctx) {
240
+ if (template == null) return null;
241
+ return typeof template === "function" ? template(ctx) : template;
242
+ }
243
+ var TemplateContent = defineUniversalComponent("nativescript", function TemplateContent(props) {
244
+ const content = props.content;
245
+ if (content == null || content === false) return null;
246
+ if (typeof content === "string" || typeof content === "number" || typeof content === "bigint") return universalValue(__octaneUniversalPlan0, [universalComponent("nativescript", Text, universalProps([], String(content)))]);
247
+ return content;
248
+ }, { "module": "@nativescript-community/octane" });
249
+ function sortIndicator(column) {
250
+ const dir = column.getIsSorted?.();
251
+ return dir === "asc" ? " ↑" : dir === "desc" ? " ↓" : "";
252
+ }
253
+ var DataGridHeaderCell = defineUniversalComponent("nativescript", function DataGridHeaderCell(props) {
254
+ const { header } = props;
255
+ props.state;
256
+ const column = header.column;
257
+ const canSort = !header.isPlaceholder && column.getCanSort?.() === true;
258
+ const content = props.render ? props.render(header) : renderTemplate(column.columnDef.header, header.getContext()) ?? column.id;
259
+ const inner = typeof content === "string" || typeof content === "number" || typeof content === "bigint" ? universalValue(__octaneUniversalPlan2, [universalComponent("nativescript", Text, universalProps([], universalChildren("nativescript", () => {
260
+ return universalValue(__octaneUniversalPlan1, [String(content), canSort ? sortIndicator(column) : ""]);
261
+ })))]) : universalValue(__octaneUniversalPlan4, [universalComponent("nativescript", TemplateContent, universalProps([[
262
+ "set",
263
+ "content",
264
+ content
265
+ ]])), canSort ? universalValue(__octaneUniversalPlan3, [universalComponent("nativescript", Text, universalProps([], sortIndicator(column)))]) : null]);
266
+ return universalValue(__octaneUniversalPlan11, [universalComponent("nativescript", View, universalProps([
267
+ [
268
+ "set",
269
+ "className",
270
+ "vx-table-cell vx-table-th"
271
+ ],
272
+ [
273
+ "set",
274
+ "web",
275
+ { role: "columnheader" }
276
+ ],
277
+ [
278
+ "set",
279
+ "style",
280
+ columnStyle(column, Boolean(props.resize || props.reorder), props.state.columnSizing)
281
+ ]
282
+ ], universalChildren("nativescript", () => {
283
+ return universalValue(__octaneUniversalPlan10, [
284
+ canSort ? universalValue(__octaneUniversalPlan6, [universalComponent("nativescript", Pressable, universalProps([
285
+ [
286
+ "set",
287
+ "id",
288
+ props.id
289
+ ],
290
+ [
291
+ "set",
292
+ "className",
293
+ "vx-table-th--sortable"
294
+ ],
295
+ [
296
+ "set",
297
+ "onPress",
298
+ () => column.toggleSorting()
299
+ ],
300
+ [
301
+ "set",
302
+ "accessibilityLabel",
303
+ `Sort ${column.id}, ${column.getIsSorted() || "unsorted"}`
304
+ ]
305
+ ], universalChildren("nativescript", () => {
306
+ return universalValue(__octaneUniversalPlan5, [inner]);
307
+ })))]) : universalValue(__octaneUniversalPlan7, [universalComponent("nativescript", View, universalProps([[
308
+ "set",
309
+ "id",
310
+ props.id
311
+ ]], inner))]),
312
+ !header.isPlaceholder && props.filters && column.getCanFilter() ? universalValue(__octaneUniversalPlan8, [universalComponent("nativescript", TextInput, universalProps([
313
+ [
314
+ "set",
315
+ "id",
316
+ props.id ? `${props.id}-filter` : void 0
317
+ ],
318
+ [
319
+ "set",
320
+ "value",
321
+ String(column.getFilterValue() ?? "")
322
+ ],
323
+ [
324
+ "set",
325
+ "placeholder",
326
+ `Filter ${column.id}`
327
+ ],
328
+ [
329
+ "set",
330
+ "accessibilityLabel",
331
+ `Filter ${column.id}`
332
+ ],
333
+ [
334
+ "set",
335
+ "onChange",
336
+ (value) => {
337
+ column.setFilterValue(value);
338
+ props.table.setPageIndex(0);
339
+ }
340
+ ]
341
+ ]))]) : null,
342
+ !header.isPlaceholder && column.columns.length === 0 && (props.resize || props.reorder) ? universalValue(__octaneUniversalPlan9, [universalComponent("nativescript", ColumnDrag, universalProps([
343
+ [
344
+ "set",
345
+ "id",
346
+ props.id
347
+ ],
348
+ [
349
+ "set",
350
+ "table",
351
+ props.table
352
+ ],
353
+ [
354
+ "set",
355
+ "column",
356
+ column
357
+ ],
358
+ [
359
+ "set",
360
+ "resize",
361
+ props.resize
362
+ ],
363
+ [
364
+ "set",
365
+ "reorder",
366
+ props.reorder
367
+ ],
368
+ [
369
+ "set",
370
+ "direction",
371
+ props.direction
372
+ ],
373
+ [
374
+ "set",
375
+ "state",
376
+ props.state
377
+ ]
378
+ ]))]) : null
379
+ ]);
380
+ })))]);
381
+ }, { "module": "@nativescript-community/octane" });
382
+ var DataGridBodyRow = defineUniversalComponent("nativescript", function DataGridBodyRow(props) {
383
+ const { row } = props;
384
+ props.state;
385
+ const cells = row.getVisibleCells();
386
+ const inner = universalValue(__octaneUniversalPlan14, [cells.map((cell) => universalValue(__octaneUniversalPlan13, [universalComponent("nativescript", View, universalProps([
387
+ [
388
+ "set",
389
+ "key",
390
+ cell.id
391
+ ],
392
+ [
393
+ "set",
394
+ "className",
395
+ "vx-table-cell"
396
+ ],
397
+ [
398
+ "set",
399
+ "web",
400
+ { role: "cell" }
401
+ ],
402
+ [
403
+ "set",
404
+ "style",
405
+ columnStyle(cell.column, Boolean(props.fixed), props.state.columnSizing)
406
+ ]
407
+ ], universalChildren("nativescript", () => {
408
+ return universalValue(__octaneUniversalPlan12, [universalComponent("nativescript", TemplateContent, universalProps([[
409
+ "set",
410
+ "content",
411
+ props.renderCell ? props.renderCell(cell) : renderTemplate(cell.column.columnDef.cell, cell.getContext()) ?? cell.renderValue?.()
412
+ ]]))]);
413
+ })))]))]);
414
+ const cls = "vx-table-row" + (props.onRowPress ? " vx-table-row--pressable" : "") + (row.getIsSelected?.() ? " vx-table-row--selected" : "");
415
+ const id = props.idPrefix ? `${props.idPrefix}-row-${row.id}` : void 0;
416
+ const content = props.onRowPress ? universalValue(__octaneUniversalPlan15, [universalComponent("nativescript", Pressable, universalProps([
417
+ [
418
+ "set",
419
+ "id",
420
+ props.selection ? void 0 : id
421
+ ],
422
+ [
423
+ "set",
424
+ "className",
425
+ "vx-datagrid-row-action"
426
+ ],
427
+ [
428
+ "set",
429
+ "onPress",
430
+ () => props.onRowPress(row)
431
+ ],
432
+ [
433
+ "set",
434
+ "accessibilityLabel",
435
+ props.getRowLabel?.(row) ?? row.id
436
+ ],
437
+ [
438
+ "set",
439
+ "accessibilityHint",
440
+ props.position.label
441
+ ],
442
+ [
443
+ "set",
444
+ "accessibilityState",
445
+ { selected: row.getIsSelected?.() || void 0 }
446
+ ]
447
+ ], inner))]) : inner;
448
+ return universalValue(__octaneUniversalPlan19, [universalComponent("nativescript", HStack, universalProps([
449
+ [
450
+ "set",
451
+ "id",
452
+ props.selection || !props.onRowPress ? id : void 0
453
+ ],
454
+ [
455
+ "set",
456
+ "className",
457
+ cls
458
+ ],
459
+ [
460
+ "set",
461
+ "web",
462
+ {
463
+ role: "row",
464
+ "aria-rowindex": props.position.ariaIndex
465
+ }
466
+ ],
467
+ [
468
+ "set",
469
+ "accessibilityHint",
470
+ props.position.label
471
+ ],
472
+ [
473
+ "set",
474
+ "accessibilityState",
475
+ { selected: row.getIsSelected?.() || void 0 }
476
+ ]
477
+ ], universalChildren("nativescript", () => {
478
+ return universalValue(__octaneUniversalPlan18, [props.selection ? universalValue(__octaneUniversalPlan17, [universalComponent("nativescript", View, universalProps([[
479
+ "set",
480
+ "className",
481
+ "vx-datagrid-selection"
482
+ ], [
483
+ "set",
484
+ "web",
485
+ { role: "cell" }
486
+ ]], universalChildren("nativescript", () => {
487
+ return universalValue(__octaneUniversalPlan16, [universalComponent("nativescript", CheckboxInput, universalProps([
488
+ [
489
+ "set",
490
+ "id",
491
+ props.idPrefix ? `${props.idPrefix}-select-${row.id}` : void 0
492
+ ],
493
+ [
494
+ "set",
495
+ "checked",
496
+ row.getIsSelected()
497
+ ],
498
+ [
499
+ "set",
500
+ "isDisabled",
501
+ !row.getCanSelect()
502
+ ],
503
+ [
504
+ "set",
505
+ "accessibilityLabel",
506
+ `Select ${props.getRowLabel?.(row) ?? row.id}`
507
+ ],
508
+ [
509
+ "set",
510
+ "accessibilityHint",
511
+ props.position.label
512
+ ],
513
+ [
514
+ "set",
515
+ "onCheckedChange",
516
+ (checked) => row.toggleSelected(checked)
517
+ ]
518
+ ]))]);
519
+ })))]) : null, content]);
520
+ })))]);
521
+ }, { "module": "@nativescript-community/octane" });
522
+ var DataGrid = defineUniversalComponent("nativescript", function DataGrid(props) {
523
+ const { table, state } = withSlot(_h$0, useTable, {
524
+ ...props.options,
525
+ defaultColumn: props.showColumnFilters ? {
526
+ filterFn: "includesString",
527
+ ...props.options?.defaultColumn
528
+ } : props.options?.defaultColumn,
529
+ data: props.data,
530
+ columns: props.columns,
531
+ features: props.features,
532
+ initialState: props.initialState,
533
+ state: props.state,
534
+ getRowId: props.getRowId
535
+ });
536
+ const headerGroups = table.getHeaderGroups();
537
+ const rows = table.getRowModel().rows;
538
+ const rowCount = props.options?.manualPagination && props.options.rowCount == null ? -1 : table.getRowCount();
539
+ const ariaRowCount = rowCount < 0 ? -1 : headerGroups.length + rowCount;
540
+ return universalValue(__octaneUniversalPlan35, [universalComponent("nativescript", View, universalProps([
541
+ [
542
+ "set",
543
+ "id",
544
+ props.id
545
+ ],
546
+ [
547
+ "set",
548
+ "className",
549
+ [
550
+ "vx-table",
551
+ "vx-datagrid",
552
+ props.className
553
+ ]
554
+ ],
555
+ [
556
+ "set",
557
+ "style",
558
+ props.style
559
+ ],
560
+ [
561
+ "set",
562
+ "flexGrow",
563
+ props.flexGrow ?? 1
564
+ ],
565
+ [
566
+ "set",
567
+ "flexShrink",
568
+ props.flexShrink
569
+ ],
570
+ [
571
+ "set",
572
+ "alignSelf",
573
+ props.alignSelf
574
+ ],
575
+ [
576
+ "set",
577
+ "row",
578
+ props.row
579
+ ],
580
+ [
581
+ "set",
582
+ "col",
583
+ props.col
584
+ ],
585
+ [
586
+ "set",
587
+ "rowSpan",
588
+ props.rowSpan
589
+ ],
590
+ [
591
+ "set",
592
+ "colSpan",
593
+ props.colSpan
594
+ ],
595
+ [
596
+ "set",
597
+ "ios",
598
+ props.ios
599
+ ],
600
+ [
601
+ "set",
602
+ "android",
603
+ props.android
604
+ ],
605
+ [
606
+ "set",
607
+ "web",
608
+ props.web
609
+ ],
610
+ [
611
+ "set",
612
+ "accessible",
613
+ props.accessible
614
+ ],
615
+ [
616
+ "set",
617
+ "accessibilityHint",
618
+ props.accessibilityHint
619
+ ],
620
+ [
621
+ "set",
622
+ "accessibilityState",
623
+ props.accessibilityState
624
+ ],
625
+ [
626
+ "set",
627
+ "accessibilityRole",
628
+ props.accessibilityRole
629
+ ],
630
+ [
631
+ "set",
632
+ "accessibilityLabel",
633
+ props.accessibilityLabel
634
+ ]
635
+ ], universalChildren("nativescript", () => {
636
+ return universalValue(__octaneUniversalPlan34, [
637
+ props.showGlobalFilter || props.showColumnSettings ? universalValue(__octaneUniversalPlan20, [universalComponent("nativescript", GridControls, universalProps([
638
+ [
639
+ "set",
640
+ "id",
641
+ props.id
642
+ ],
643
+ [
644
+ "set",
645
+ "table",
646
+ table
647
+ ],
648
+ [
649
+ "set",
650
+ "state",
651
+ state
652
+ ],
653
+ [
654
+ "set",
655
+ "search",
656
+ props.showGlobalFilter
657
+ ],
658
+ [
659
+ "set",
660
+ "settings",
661
+ props.showColumnSettings
662
+ ]
663
+ ]))]) : null,
664
+ props.showRowSelection ? universalValue(__octaneUniversalPlan25, [universalComponent("nativescript", HStack, universalProps([[
665
+ "set",
666
+ "className",
667
+ "vx-datagrid-controls"
668
+ ]], universalChildren("nativescript", () => {
669
+ return universalValue(__octaneUniversalPlan24, [
670
+ universalComponent("nativescript", Text, universalProps([[
671
+ "set",
672
+ "id",
673
+ props.id ? `${props.id}-selected-count` : void 0
674
+ ]], universalChildren("nativescript", () => {
675
+ return universalValue(__octaneUniversalPlan21, [Object.values(state.rowSelection).filter(Boolean).length]);
676
+ }))),
677
+ universalComponent("nativescript", Pressable, universalProps([
678
+ [
679
+ "set",
680
+ "id",
681
+ props.id ? `${props.id}-clear-selection` : void 0
682
+ ],
683
+ [
684
+ "set",
685
+ "className",
686
+ "vx-datagrid-action"
687
+ ],
688
+ [
689
+ "set",
690
+ "onPress",
691
+ () => table.resetRowSelection(true)
692
+ ],
693
+ [
694
+ "set",
695
+ "accessibilityLabel",
696
+ "Clear selection"
697
+ ]
698
+ ], universalChildren("nativescript", () => {
699
+ return universalValue(__octaneUniversalPlan23, [universalComponent("nativescript", Text, universalProps([], universalChildren("nativescript", () => {
700
+ return universalValue(__octaneUniversalPlan22, []);
701
+ })))]);
702
+ }))),
703
+ props.renderSelectionActions?.(table)
704
+ ]);
705
+ })))]) : null,
706
+ universalComponent("nativescript", View, universalProps([
707
+ [
708
+ "set",
709
+ "id",
710
+ props.id ? `${props.id}-table` : void 0
711
+ ],
712
+ [
713
+ "set",
714
+ "flexGrow",
715
+ 1
716
+ ],
717
+ [
718
+ "set",
719
+ "web",
720
+ {
721
+ role: "table",
722
+ "aria-label": props.accessibilityLabel,
723
+ "aria-rowcount": ariaRowCount,
724
+ "aria-colcount": table.getVisibleLeafColumns().length + (props.showRowSelection ? 1 : 0)
725
+ }
726
+ ]
727
+ ], universalChildren("nativescript", () => {
728
+ return universalValue(__octaneUniversalPlan32, [universalComponent("nativescript", View, universalProps([[
729
+ "set",
730
+ "id",
731
+ props.id ? `${props.id}-header` : void 0
732
+ ], [
733
+ "set",
734
+ "flexShrink",
735
+ 0
736
+ ]], headerGroups.map((group) => universalValue(__octaneUniversalPlan30, [universalComponent("nativescript", HStack, universalProps([
737
+ [
738
+ "set",
739
+ "key",
740
+ group.id
741
+ ],
742
+ [
743
+ "set",
744
+ "className",
745
+ "vx-table-head"
746
+ ],
747
+ [
748
+ "set",
749
+ "web",
750
+ {
751
+ role: "row",
752
+ "aria-rowindex": group.depth + 1
753
+ }
754
+ ]
755
+ ], universalChildren("nativescript", () => {
756
+ return universalValue(__octaneUniversalPlan29, [props.showRowSelection ? universalValue(__octaneUniversalPlan27, [universalComponent("nativescript", View, universalProps([[
757
+ "set",
758
+ "className",
759
+ "vx-datagrid-selection"
760
+ ], [
761
+ "set",
762
+ "web",
763
+ { role: "columnheader" }
764
+ ]], group.depth === 0 ? universalValue(__octaneUniversalPlan26, [universalComponent("nativescript", CheckboxInput, universalProps([
765
+ [
766
+ "set",
767
+ "id",
768
+ props.id ? `${props.id}-select-page` : void 0
769
+ ],
770
+ [
771
+ "set",
772
+ "checked",
773
+ table.getIsAllPageRowsSelected()
774
+ ],
775
+ [
776
+ "set",
777
+ "indeterminate",
778
+ !table.getIsAllPageRowsSelected() && table.getIsSomePageRowsSelected()
779
+ ],
780
+ [
781
+ "set",
782
+ "isDisabled",
783
+ !rows.some((row) => row.getCanSelect())
784
+ ],
785
+ [
786
+ "set",
787
+ "accessibilityLabel",
788
+ "Select current page"
789
+ ],
790
+ [
791
+ "set",
792
+ "onCheckedChange",
793
+ (checked) => table.toggleAllPageRowsSelected(checked)
794
+ ]
795
+ ]))]) : null))]) : null, group.headers.map((header) => universalValue(__octaneUniversalPlan28, [universalComponent("nativescript", DataGridHeaderCell, universalProps([
796
+ [
797
+ "set",
798
+ "key",
799
+ header.id
800
+ ],
801
+ [
802
+ "set",
803
+ "header",
804
+ header
805
+ ],
806
+ [
807
+ "set",
808
+ "render",
809
+ props.renderHeader
810
+ ],
811
+ [
812
+ "set",
813
+ "id",
814
+ props.id ? `${props.id}-th-${header.column.id}` : void 0
815
+ ],
816
+ [
817
+ "set",
818
+ "state",
819
+ state
820
+ ],
821
+ [
822
+ "set",
823
+ "table",
824
+ table
825
+ ],
826
+ [
827
+ "set",
828
+ "filters",
829
+ props.showColumnFilters
830
+ ],
831
+ [
832
+ "set",
833
+ "resize",
834
+ props.resizableColumns
835
+ ],
836
+ [
837
+ "set",
838
+ "reorder",
839
+ props.reorderableColumns
840
+ ],
841
+ [
842
+ "set",
843
+ "direction",
844
+ props.direction
845
+ ]
846
+ ]))]))]);
847
+ })))])))), universalComponent("nativescript", VirtualList, universalProps([
848
+ [
849
+ "set",
850
+ "flexGrow",
851
+ 1
852
+ ],
853
+ [
854
+ "set",
855
+ "className",
856
+ "vx-datagrid-body"
857
+ ],
858
+ [
859
+ "set",
860
+ "id",
861
+ props.id ? `${props.id}-body` : void 0
862
+ ],
863
+ [
864
+ "set",
865
+ "items",
866
+ rows
867
+ ],
868
+ [
869
+ "set",
870
+ "keyExtractor",
871
+ (row) => row.id
872
+ ],
873
+ [
874
+ "set",
875
+ "renderItem",
876
+ (row, index) => universalValue(__octaneUniversalPlan31, [universalComponent("nativescript", DataGridBodyRow, universalProps([
877
+ [
878
+ "set",
879
+ "row",
880
+ row
881
+ ],
882
+ [
883
+ "set",
884
+ "position",
885
+ gridRowPosition(index, state.pagination, headerGroups.length, rowCount)
886
+ ],
887
+ [
888
+ "set",
889
+ "renderCell",
890
+ props.renderCell
891
+ ],
892
+ [
893
+ "set",
894
+ "onRowPress",
895
+ props.onRowPress
896
+ ],
897
+ [
898
+ "set",
899
+ "idPrefix",
900
+ props.id
901
+ ],
902
+ [
903
+ "set",
904
+ "state",
905
+ state
906
+ ],
907
+ [
908
+ "set",
909
+ "selection",
910
+ props.showRowSelection
911
+ ],
912
+ [
913
+ "set",
914
+ "getRowLabel",
915
+ props.getRowLabel
916
+ ],
917
+ [
918
+ "set",
919
+ "fixed",
920
+ Boolean(props.resizableColumns || props.reorderableColumns)
921
+ ]
922
+ ]))])
923
+ ],
924
+ [
925
+ "set",
926
+ "renderEmpty",
927
+ props.renderEmpty
928
+ ]
929
+ ]))]);
930
+ }))),
931
+ props.showPagination ? universalValue(__octaneUniversalPlan33, [universalComponent("nativescript", GridPagination, universalProps([
932
+ [
933
+ "set",
934
+ "id",
935
+ props.id
936
+ ],
937
+ [
938
+ "set",
939
+ "table",
940
+ table
941
+ ],
942
+ [
943
+ "set",
944
+ "state",
945
+ state
946
+ ],
947
+ [
948
+ "set",
949
+ "sizes",
950
+ props.pageSizeOptions
951
+ ]
952
+ ]))]) : null
953
+ ]);
954
+ })))]);
955
+ }, { "module": "@nativescript-community/octane" });
956
+ //#endregion
957
+ export { DataGrid };