@rozie-ui/data-table-solid 0.4.0 → 0.6.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.
- package/README.md +66 -52
- package/dist/index.cjs +3198 -837
- package/dist/index.d.cts +71 -8
- package/dist/index.d.mts +71 -8
- package/dist/index.mjs +3122 -761
- package/dist/source/index.jsx +6368 -0
- package/package.json +8 -3
- package/src/Column.tsx +3 -3
- package/src/DataTable.tsx +1401 -133
- package/src/EditorCheckbox.tsx +38 -4
- package/src/EditorDate.tsx +79 -8
- package/src/EditorNumber.tsx +52 -6
- package/src/EditorSelect.tsx +51 -6
- package/src/EditorText.tsx +34 -5
- package/src/FilterNumberRange.tsx +79 -12
- package/src/FilterSelect.tsx +18 -3
- package/src/FilterText.tsx +48 -9
- package/src/GroupBar.tsx +75 -3
- package/src/helpers/columnDefUtils.ts +73 -1
- package/src/helpers/dateValue.ts +55 -0
- package/src/themes/base.css +122 -88
- package/src/themes/bootstrap.css +60 -24
- package/src/themes/material.css +54 -22
- package/src/themes/shadcn.css +59 -23
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { className, createComponent, delegateEvents, effect, insert, memo, setAttribute, style, template, use } from "solid-js/web";
|
|
1
2
|
import { Show, createEffect, createSignal, mergeProps, on, onCleanup, onMount, splitProps, untrack, useContext } from "solid-js";
|
|
2
3
|
import { Key } from "@solid-primitives/keyed";
|
|
3
4
|
import { __rozieInjectStyle, createControllableSignal, parseInlineStyle, rozieAttr, rozieClass, rozieContext, rozieDisplay } from "@rozie/runtime-solid";
|
|
@@ -50,6 +51,48 @@ const collectGroupableLeafDefs = (defs) => {
|
|
|
50
51
|
}
|
|
51
52
|
return out;
|
|
52
53
|
};
|
|
54
|
+
const EDITOR_KINDS = [
|
|
55
|
+
"text",
|
|
56
|
+
"number",
|
|
57
|
+
"select",
|
|
58
|
+
"checkbox",
|
|
59
|
+
"custom"
|
|
60
|
+
];
|
|
61
|
+
const editorKindWarning = (id, editor) => {
|
|
62
|
+
if (editor == null) return null;
|
|
63
|
+
if (typeof editor === "string" && EDITOR_KINDS.indexOf(editor) !== -1) return null;
|
|
64
|
+
return "[rozie-data-table] column \"" + String(id) + "\": editor=\"" + String(editor) + "\" is not a built-in editor. The built-ins are text | number | select | checkbox; anything else needs editor=\"custom\" plus an #editor slot fill (that is how <EditorDate> is used). Falling back to the text input.";
|
|
65
|
+
};
|
|
66
|
+
const columnSpecsEquivalent = (a, b, depth) => {
|
|
67
|
+
const d = typeof depth === "number" ? depth : 0;
|
|
68
|
+
if (a === b) return true;
|
|
69
|
+
if (d > 4) return false;
|
|
70
|
+
const ta = typeof a;
|
|
71
|
+
if (ta !== typeof b) return false;
|
|
72
|
+
if (ta === "function") try {
|
|
73
|
+
return String(a) === String(b);
|
|
74
|
+
} catch (err) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
if (ta === "number") return a !== a && b !== b;
|
|
78
|
+
if (a === null || b === null || ta !== "object") return false;
|
|
79
|
+
const aArr = Array.isArray(a);
|
|
80
|
+
if (aArr !== Array.isArray(b)) return false;
|
|
81
|
+
if (aArr) {
|
|
82
|
+
if (a.length !== b.length) return false;
|
|
83
|
+
for (let i = 0; i < a.length; i++) if (!columnSpecsEquivalent(a[i], b[i], d + 1)) return false;
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
const ka = Object.keys(a);
|
|
87
|
+
const kb = Object.keys(b);
|
|
88
|
+
if (ka.length !== kb.length) return false;
|
|
89
|
+
for (let i = 0; i < ka.length; i++) {
|
|
90
|
+
const k = ka[i];
|
|
91
|
+
if (!Object.prototype.hasOwnProperty.call(b, k)) return false;
|
|
92
|
+
if (!columnSpecsEquivalent(a[k], b[k], d + 1)) return false;
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
};
|
|
53
96
|
//#endregion
|
|
54
97
|
//#region src/helpers/indexMath.ts
|
|
55
98
|
const clamp = (v, lo, hi) => v < lo ? lo : v > hi ? hi : v;
|
|
@@ -195,7 +238,34 @@ const indexOfRowIn = (rows, rowOriginal, rowId) => {
|
|
|
195
238
|
};
|
|
196
239
|
//#endregion
|
|
197
240
|
//#region src/DataTable.tsx
|
|
198
|
-
|
|
241
|
+
var _tmpl$$11 = /* @__PURE__ */ template(`<div class=rozie-data-table-wrap data-rozie-s-d5dcab4c=""><div class=rdt-column-defs aria-hidden=true data-rozie-s-d5dcab4c=""></div><div class=rdt-toolbar data-rozie-s-d5dcab4c=""><input type=text role=searchbox aria-label="Search table"class=rdt-global-filter data-rozie-s-d5dcab4c="">`), _tmpl$2$4 = /* @__PURE__ */ template(`<div class=rdt-sr-live role=status aria-live=polite aria-atomic=true data-rozie-s-d5dcab4c="">`), _tmpl$3$1 = /* @__PURE__ */ template(`<div class="rdt-sr-live rdt-sr-paste"data-testid=paste-announce role=status aria-live=polite aria-atomic=true data-rozie-s-d5dcab4c="">`), _tmpl$4$1 = /* @__PURE__ */ template(`<div class="rdt-sr-live rdt-sr-range"data-testid=range-announce role=status aria-live=polite aria-atomic=true data-rozie-s-d5dcab4c="">`), _tmpl$5$1 = /* @__PURE__ */ template(`<div class="rdt-sr-live rdt-sr-sortfilter"data-testid=sortfilter-announce role=status aria-live=polite aria-atomic=true data-rozie-s-d5dcab4c="">`), _tmpl$6 = /* @__PURE__ */ template(`<details class=rdt-colvis data-rozie-s-d5dcab4c=""><summary class=rdt-colvis-summary data-rozie-s-d5dcab4c="">Columns</summary><div class=rdt-colvis-menu role=group aria-label="Toggle columns"data-rozie-s-d5dcab4c="">`), _tmpl$7 = /* @__PURE__ */ template(`<label class=rdt-colvis-item data-rozie-s-d5dcab4c=""><input type=checkbox class=rdt-colvis-checkbox data-rozie-s-d5dcab4c=""><span class=rdt-colvis-label data-rozie-s-d5dcab4c="">`), _tmpl$8 = /* @__PURE__ */ template(`<div class=rdt-group-bar-host data-rozie-s-d5dcab4c="">`), _tmpl$9 = /* @__PURE__ */ template(`<span class=rdt-group-token data-group-token=""data-rozie-s-d5dcab4c="">`), _tmpl$0 = /* @__PURE__ */ template(`<div class=rdt-scroll data-rozie-s-d5dcab4c=""><table data-rozie-s-d5dcab4c=""><thead class=rdt-thead role=rowgroup data-rozie-s-d5dcab4c=""></thead><tbody class=rdt-tbody role=rowgroup data-rozie-s-d5dcab4c=""><tr class=rdt-spacer aria-hidden=true data-rozie-s-d5dcab4c=""><td data-rozie-s-d5dcab4c=""></td></tr><tr class=rdt-spacer aria-hidden=true data-rozie-s-d5dcab4c=""><td data-rozie-s-d5dcab4c="">`), _tmpl$1 = /* @__PURE__ */ template(`<table data-rozie-s-d5dcab4c=""><thead class=rdt-thead role=rowgroup data-rozie-s-d5dcab4c=""></thead><tbody class=rdt-tbody role=rowgroup data-rozie-s-d5dcab4c="">`), _tmpl$10 = /* @__PURE__ */ template(`<tr class=rdt-tr role=row data-rozie-s-d5dcab4c="">`), _tmpl$11 = /* @__PURE__ */ template(`<th role=columnheader data-grid-cell=""data-row=__header data-rozie-s-d5dcab4c="">`), _tmpl$12 = /* @__PURE__ */ template(`<span data-rozie-s-d5dcab4c="">`), _tmpl$13 = /* @__PURE__ */ template(`<div class=rdt-col-menu role=menu data-rozie-s-d5dcab4c=""><button type=button role=menuitem class=rdt-col-menu-item data-rozie-s-d5dcab4c="">Pin left</button><button type=button role=menuitem class=rdt-col-menu-item data-rozie-s-d5dcab4c="">Pin right</button><button type=button role=menuitem class=rdt-col-menu-item data-rozie-s-d5dcab4c="">Unpin</button><hr class=rdt-col-menu-sep data-rozie-s-d5dcab4c=""><button type=button role=menuitem class=rdt-col-menu-item data-rozie-s-d5dcab4c="">Hide column`), _tmpl$14 = /* @__PURE__ */ template(`<span data-rozie-s-d5dcab4c=""><button type=button class=rdt-resize-handle data-rozie-s-d5dcab4c=""><span class=rdt-resize-grip aria-hidden=true data-rozie-s-d5dcab4c="">`), _tmpl$15 = /* @__PURE__ */ template(`<button type=button class=rdt-sort-btn data-rozie-s-d5dcab4c=""><span class=rdt-header-label data-rozie-s-d5dcab4c=""></span><span class=rdt-sort-ind aria-hidden=true data-rozie-s-d5dcab4c="">`), _tmpl$16 = /* @__PURE__ */ template(`<span data-rozie-s-d5dcab4c=""><span class=rdt-header-label data-rozie-s-d5dcab4c="">`), _tmpl$17 = /* @__PURE__ */ template(`<button type=button class=rdt-col-menu-trigger data-rozie-s-d5dcab4c="">⋯`), _tmpl$18 = /* @__PURE__ */ template(`<input type=checkbox aria-label="Select all rows"class=rdt-select-all data-rozie-s-d5dcab4c="">`), _tmpl$19 = /* @__PURE__ */ template(`<tr class=rdt-filter-row data-rozie-s-d5dcab4c="">`), _tmpl$20 = /* @__PURE__ */ template(`<th role=presentation data-rozie-s-d5dcab4c="">`), _tmpl$21 = /* @__PURE__ */ template(`<input type=text class=rdt-col-filter data-rozie-s-d5dcab4c="">`), _tmpl$22 = /* @__PURE__ */ template(`<tr role=row data-rozie-s-d5dcab4c="">`), _tmpl$23 = /* @__PURE__ */ template(`<td data-grid-cell=""data-rozie-s-d5dcab4c="">`), _tmpl$24 = /* @__PURE__ */ template(`<span data-rozie-s-d5dcab4c=""><button type=button data-expander=""class="rdt-expander rdt-group-toggle"data-rozie-s-d5dcab4c=""></button><span class=rdt-group-value data-rozie-s-d5dcab4c=""></span><span class=rdt-group-count data-rozie-s-d5dcab4c="">`), _tmpl$25 = /* @__PURE__ */ template(`<span class=rdt-cell-value data-rozie-s-d5dcab4c="">`), _tmpl$26 = /* @__PURE__ */ template(`<input type=number data-editing-cell=""data-builtin-editor=""class=rdt-cell-editor data-rozie-s-d5dcab4c="">`), _tmpl$27 = /* @__PURE__ */ template(`<select data-editing-cell=""data-builtin-editor=""class=rdt-cell-editor data-rozie-s-d5dcab4c="">`), _tmpl$28 = /* @__PURE__ */ template(`<input type=checkbox data-editing-cell=""data-builtin-editor=""class=rdt-cell-editor data-rozie-s-d5dcab4c="">`), _tmpl$29 = /* @__PURE__ */ template(`<input type=text data-editing-cell=""data-builtin-editor=""class=rdt-cell-editor data-rozie-s-d5dcab4c="">`), _tmpl$30 = /* @__PURE__ */ template(`<option data-rozie-s-d5dcab4c="">`), _tmpl$31 = /* @__PURE__ */ template(`<input type=checkbox aria-label="Select row"class=rdt-select-row data-rozie-s-d5dcab4c="">`), _tmpl$32 = /* @__PURE__ */ template(`<button type=button data-expander=""class=rdt-expander data-rozie-s-d5dcab4c="">`), _tmpl$33 = /* @__PURE__ */ template(`<span data-fill-handle=""data-testid=fill-handle aria-hidden=true class=rdt-fill-handle data-rozie-s-d5dcab4c="">`), _tmpl$34 = /* @__PURE__ */ template(`<tr class=rdt-detail-row role=row data-rozie-s-d5dcab4c=""><td class=rdt-detail-cell data-rozie-s-d5dcab4c="">`), _tmpl$35 = /* @__PURE__ */ template(`<th class=rdt-col-spacer aria-hidden=true data-rozie-s-d5dcab4c="">`), _tmpl$36 = /* @__PURE__ */ template(`<td class=rdt-col-spacer aria-hidden=true data-rozie-s-d5dcab4c="">`), _tmpl$37 = /* @__PURE__ */ template(`<span data-rozie-s-d5dcab4c=""><input class=rdt-select-placeholder type=checkbox tabindex=-1 aria-hidden=true data-rozie-s-d5dcab4c="">`), _tmpl$38 = /* @__PURE__ */ template(`<span class=rdt-skeleton aria-hidden=true data-rozie-s-d5dcab4c="">​`), _tmpl$39 = /* @__PURE__ */ template(`<div class=rdt-pagination role=group aria-label=Pagination data-rozie-s-d5dcab4c=""><button type=button class="rdt-page-btn rdt-page-prev"data-rozie-s-d5dcab4c="">Prev</button><span class=rdt-page-status aria-live=polite data-rozie-s-d5dcab4c=""></span><button type=button class="rdt-page-btn rdt-page-next"data-rozie-s-d5dcab4c="">Next</button><select aria-label="Rows per page"class=rdt-page-size data-rozie-s-d5dcab4c=""><option value=10 data-rozie-s-d5dcab4c="">10</option><option value=25 data-rozie-s-d5dcab4c="">25</option><option value=50 data-rozie-s-d5dcab4c="">50</option><option value=100 data-rozie-s-d5dcab4c="">100`);
|
|
242
|
+
__rozieInjectStyle("DataTable-d5dcab4c", `[data-rozie-s-d5dcab4c]:host {
|
|
243
|
+
--rdt-color: var(--rozie-data-table-fg, var(--rdt-ds-fg));
|
|
244
|
+
--rdt-select-accent: var(--rozie-data-table-select-accent, var(--rozie-data-table-accent, var(--rdt-ds-select-accent)));
|
|
245
|
+
--rdt-border: 1px solid var(--rozie-data-table-border-color, var(--rdt-ds-border-color));
|
|
246
|
+
--rdt-filter-border: 1px solid var(--rozie-data-table-control-border-color, var(--rdt-ds-control-border-color));
|
|
247
|
+
--rdt-filter-radius: var(--rozie-data-table-radius, var(--rdt-ds-radius));
|
|
248
|
+
--rdt-font: var(--rozie-data-table-font, var(--rdt-ds-font));
|
|
249
|
+
--rdt-cell-padding: var(--rozie-data-table-cell-padding, var(--rdt-ds-cell-padding));
|
|
250
|
+
--rdt-header-bg: var(--rozie-data-table-header-bg, var(--rdt-ds-header-bg));
|
|
251
|
+
--rdt-header-weight: var(--rozie-data-table-header-weight, var(--rdt-ds-header-weight));
|
|
252
|
+
--rdt-sort-ind-opacity: var(--rozie-data-table-sort-indicator-opacity, var(--rdt-ds-sort-indicator-opacity));
|
|
253
|
+
--rdt-resize-grip-color: var(--rozie-data-table-resize-grip-color, var(--rdt-ds-resize-grip-color));
|
|
254
|
+
--rdt-resize-grip-active: var(--rozie-data-table-resize-grip-active, var(--rozie-data-table-accent, var(--rdt-ds-resize-grip-active)));
|
|
255
|
+
--rdt-pin-btn-active-bg: var(--rozie-data-table-pin-active-bg, var(--rdt-ds-pin-active-bg));
|
|
256
|
+
--rdt-colvis-menu-bg: var(--rozie-data-table-menu-bg, var(--rdt-ds-menu-bg));
|
|
257
|
+
--rdt-colvis-menu-shadow: var(--rozie-data-table-menu-shadow, var(--rdt-ds-menu-shadow));
|
|
258
|
+
--rdt-colvis-menu-border: 1px solid var(--rozie-data-table-border-color, var(--rdt-ds-border-color));
|
|
259
|
+
--rdt-colvis-menu-radius: var(--rozie-data-table-radius, var(--rdt-ds-radius));
|
|
260
|
+
--rdt-colvis-summary-border: 1px solid var(--rozie-data-table-control-border-color, var(--rdt-ds-control-border-color));
|
|
261
|
+
--rdt-colvis-summary-radius: var(--rozie-data-table-radius, var(--rdt-ds-radius));
|
|
262
|
+
--rdt-page-btn-disabled-opacity: var(--rozie-data-table-disabled-opacity, var(--rdt-ds-disabled-opacity));
|
|
263
|
+
--rdt-page-btn-border: 1px solid var(--rozie-data-table-control-border-color, var(--rdt-ds-control-border-color));
|
|
264
|
+
--rdt-page-btn-radius: var(--rozie-data-table-radius, var(--rdt-ds-radius));
|
|
265
|
+
--rdt-page-size-border: 1px solid var(--rozie-data-table-control-border-color, var(--rdt-ds-control-border-color));
|
|
266
|
+
--rdt-page-size-radius: var(--rozie-data-table-radius, var(--rdt-ds-radius));
|
|
267
|
+
}
|
|
268
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] {
|
|
199
269
|
border-collapse: collapse;
|
|
200
270
|
width: 100%;
|
|
201
271
|
font: var(--rdt-font, 14px system-ui, sans-serif);
|
|
@@ -321,6 +391,16 @@ __rozieInjectStyle("DataTable-d5dcab4c", `.rozie-data-table[data-rozie-s-d5dcab4
|
|
|
321
391
|
flex-direction: column;
|
|
322
392
|
gap: var(--rdt-chrome-gap, 0.5rem);
|
|
323
393
|
}
|
|
394
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] .rdt-skeleton[data-rozie-s-d5dcab4c] {
|
|
395
|
+
/* inline-block on the cell's own line box, exactly like a text value (a block box was 2px
|
|
396
|
+
short of a text row). */
|
|
397
|
+
display: inline-block;
|
|
398
|
+
width: 100%;
|
|
399
|
+
vertical-align: baseline;
|
|
400
|
+
border-radius: 4px;
|
|
401
|
+
background: color-mix(in srgb, currentColor 12%, transparent);
|
|
402
|
+
color: transparent;
|
|
403
|
+
}
|
|
324
404
|
.rozie-data-table-wrap[data-rozie-s-d5dcab4c] .rdt-toolbar[data-rozie-s-d5dcab4c] {
|
|
325
405
|
display: flex;
|
|
326
406
|
gap: var(--rdt-toolbar-gap, 0.5rem);
|
|
@@ -346,6 +426,9 @@ __rozieInjectStyle("DataTable-d5dcab4c", `.rozie-data-table[data-rozie-s-d5dcab4
|
|
|
346
426
|
.rozie-data-table[data-rozie-s-d5dcab4c] .rdt-filter-row[data-rozie-s-d5dcab4c] {
|
|
347
427
|
background: var(--rdt-filter-row-bg, rgba(0, 0, 0, 0.015));
|
|
348
428
|
}
|
|
429
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] .rdt-pinned[data-rozie-s-d5dcab4c] {
|
|
430
|
+
box-sizing: border-box;
|
|
431
|
+
}
|
|
349
432
|
.rozie-data-table[data-rozie-s-d5dcab4c] .rdt-filter-cell[data-rozie-s-d5dcab4c] {
|
|
350
433
|
padding: var(--rdt-filter-cell-padding, 0.35rem 0.75rem);
|
|
351
434
|
border-bottom: var(--rdt-border, 1px solid rgba(0, 0, 0, 0.08));
|
|
@@ -465,6 +548,9 @@ __rozieInjectStyle("DataTable-d5dcab4c", `.rozie-data-table[data-rozie-s-d5dcab4
|
|
|
465
548
|
.rozie-data-table-wrap[data-rozie-s-d5dcab4c] .rdt-colvis-summary[data-rozie-s-d5dcab4c] {
|
|
466
549
|
cursor: pointer;
|
|
467
550
|
font: inherit;
|
|
551
|
+
/* Own the margin too: content-site typography styles bare \`summary\` (VitePress sets
|
|
552
|
+
\`margin: 16px 0\`), which grew the <details> and stretched the toolbar's search input. */
|
|
553
|
+
margin: 0;
|
|
468
554
|
padding: var(--rdt-colvis-summary-padding, 0.25rem 0.6rem);
|
|
469
555
|
border: var(--rdt-colvis-summary-border, 1px solid rgba(0, 0, 0, 0.2));
|
|
470
556
|
border-radius: var(--rdt-colvis-summary-radius, 4px);
|
|
@@ -503,6 +589,51 @@ __rozieInjectStyle("DataTable-d5dcab4c", `.rozie-data-table[data-rozie-s-d5dcab4
|
|
|
503
589
|
text-align: var(--rdt-expander-col-align, center);
|
|
504
590
|
white-space: nowrap;
|
|
505
591
|
}
|
|
592
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="1"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before,
|
|
593
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="2"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before,
|
|
594
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="3"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before,
|
|
595
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="4"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before,
|
|
596
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="5"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before,
|
|
597
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="6"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before,
|
|
598
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="7"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before,
|
|
599
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="8"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before {
|
|
600
|
+
content: '';
|
|
601
|
+
display: inline-block;
|
|
602
|
+
vertical-align: middle;
|
|
603
|
+
}
|
|
604
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="1"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before {
|
|
605
|
+
width: calc(1 * var(--rdt-tree-indent, 1.25rem));
|
|
606
|
+
}
|
|
607
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="2"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before {
|
|
608
|
+
width: calc(2 * var(--rdt-tree-indent, 1.25rem));
|
|
609
|
+
}
|
|
610
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="3"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before {
|
|
611
|
+
width: calc(3 * var(--rdt-tree-indent, 1.25rem));
|
|
612
|
+
}
|
|
613
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="4"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before {
|
|
614
|
+
width: calc(4 * var(--rdt-tree-indent, 1.25rem));
|
|
615
|
+
}
|
|
616
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="5"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before {
|
|
617
|
+
width: calc(5 * var(--rdt-tree-indent, 1.25rem));
|
|
618
|
+
}
|
|
619
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="6"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before {
|
|
620
|
+
width: calc(6 * var(--rdt-tree-indent, 1.25rem));
|
|
621
|
+
}
|
|
622
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="7"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before {
|
|
623
|
+
width: calc(7 * var(--rdt-tree-indent, 1.25rem));
|
|
624
|
+
}
|
|
625
|
+
.rozie-data-table[data-rozie-s-d5dcab4c] tbody[data-rozie-s-d5dcab4c] tr[data-depth="8"][data-rozie-s-d5dcab4c] > .rdt-expander-td[data-rozie-s-d5dcab4c] + .rdt-td[data-rozie-s-d5dcab4c]::before {
|
|
626
|
+
width: calc(8 * var(--rdt-tree-indent, 1.25rem));
|
|
627
|
+
}
|
|
628
|
+
.rozie-data-table[role="grid"][data-rozie-s-d5dcab4c] {
|
|
629
|
+
user-select: none;
|
|
630
|
+
}
|
|
631
|
+
.rozie-data-table[role="grid"][data-rozie-s-d5dcab4c] input[data-rozie-s-d5dcab4c],
|
|
632
|
+
.rozie-data-table[role="grid"][data-rozie-s-d5dcab4c] textarea[data-rozie-s-d5dcab4c],
|
|
633
|
+
.rozie-data-table[role="grid"][data-rozie-s-d5dcab4c] select[data-rozie-s-d5dcab4c],
|
|
634
|
+
.rozie-data-table[role="grid"][data-rozie-s-d5dcab4c] [contenteditable="true"][data-rozie-s-d5dcab4c] {
|
|
635
|
+
user-select: text;
|
|
636
|
+
}
|
|
506
637
|
.rozie-data-table[data-rozie-s-d5dcab4c] .rdt-select-all[data-rozie-s-d5dcab4c],
|
|
507
638
|
.rozie-data-table[data-rozie-s-d5dcab4c] .rdt-select-row[data-rozie-s-d5dcab4c] {
|
|
508
639
|
cursor: pointer;
|
|
@@ -516,6 +647,7 @@ function DataTable(_props) {
|
|
|
516
647
|
rowCount: null,
|
|
517
648
|
pageCount: null,
|
|
518
649
|
expandable: false,
|
|
650
|
+
getRowId: null,
|
|
519
651
|
getSubRows: null,
|
|
520
652
|
groupable: false,
|
|
521
653
|
stickyHeader: false,
|
|
@@ -540,6 +672,7 @@ function DataTable(_props) {
|
|
|
540
672
|
"pageCount",
|
|
541
673
|
"expandable",
|
|
542
674
|
"expanded",
|
|
675
|
+
"getRowId",
|
|
543
676
|
"getSubRows",
|
|
544
677
|
"groupable",
|
|
545
678
|
"grouping",
|
|
@@ -570,7 +703,9 @@ function DataTable(_props) {
|
|
|
570
703
|
"onReorderChange",
|
|
571
704
|
"onPinChange",
|
|
572
705
|
"onHistoryChange",
|
|
706
|
+
"onVisibleRangeChange",
|
|
573
707
|
"onActivecellChange",
|
|
708
|
+
"onRowActivate",
|
|
574
709
|
"onRangeChange",
|
|
575
710
|
"onCellEditCommit",
|
|
576
711
|
"onRowEditCommit"
|
|
@@ -680,11 +815,13 @@ function DataTable(_props) {
|
|
|
680
815
|
const [rangeAnchor, setRangeAnchor] = createSignal(null);
|
|
681
816
|
const [rangeFocus, setRangeFocus] = createSignal(null);
|
|
682
817
|
const [pasteAnnounce, setPasteAnnounce] = createSignal("");
|
|
818
|
+
const [rangeAnnounce, setRangeAnnounce] = createSignal("");
|
|
683
819
|
const [liveAnnounce, setLiveAnnounce] = createSignal("");
|
|
684
820
|
onMount(() => {
|
|
685
821
|
setDataDefault(data() || []);
|
|
822
|
+
seedColumnPinning();
|
|
686
823
|
table = createTable({
|
|
687
|
-
data:
|
|
824
|
+
data: feedData(),
|
|
688
825
|
columns: tableColumns(),
|
|
689
826
|
state: currentState(),
|
|
690
827
|
getCoreRowModel: getCoreRowModel(),
|
|
@@ -693,7 +830,8 @@ function DataTable(_props) {
|
|
|
693
830
|
getPaginationRowModel: getPaginationRowModel(),
|
|
694
831
|
getExpandedRowModel: getExpandedRowModel(),
|
|
695
832
|
getSubRows: local.getSubRows || void 0,
|
|
696
|
-
|
|
833
|
+
getRowId: rowIdOption(),
|
|
834
|
+
getRowCanExpand: local.expandable === true && local.getSubRows == null ? (row) => !rowIsLazyPlaceholder(row) : void 0,
|
|
697
835
|
onExpandedChange: onExpandedChangeCb,
|
|
698
836
|
autoResetExpanded: false,
|
|
699
837
|
getGroupedRowModel: getGroupedRowModel(),
|
|
@@ -706,7 +844,7 @@ function DataTable(_props) {
|
|
|
706
844
|
manualSorting: local.manual === true,
|
|
707
845
|
rowCount: local.rowCount ?? void 0,
|
|
708
846
|
pageCount: local.pageCount ?? void 0,
|
|
709
|
-
enableRowSelection:
|
|
847
|
+
enableRowSelection: rowSelectionOption(),
|
|
710
848
|
enableMultiRowSelection: local.selectionMode === "multiple",
|
|
711
849
|
onSortingChange: onSortingChangeCb,
|
|
712
850
|
onGlobalFilterChange: onGlobalFilterChangeCb,
|
|
@@ -731,6 +869,7 @@ function DataTable(_props) {
|
|
|
731
869
|
setHeaderGroups(nextGroups);
|
|
732
870
|
setRowModelVer(rowModelVer() + 1);
|
|
733
871
|
if (rowsWindowed() && virtualizer) {
|
|
872
|
+
migratePlaceholderSizeCache();
|
|
734
873
|
virtualizer.setOptions(virtualizerOptions());
|
|
735
874
|
virtualizer._willUpdate();
|
|
736
875
|
}
|
|
@@ -755,6 +894,17 @@ function DataTable(_props) {
|
|
|
755
894
|
};
|
|
756
895
|
refreshRowModel();
|
|
757
896
|
gridRoot = __rozieRootRef ? __rozieRootRef.querySelector(".rozie-data-table") : null;
|
|
897
|
+
if (typeof document !== "undefined") {
|
|
898
|
+
docPointerDown = (ev) => {
|
|
899
|
+
if (!gridRoot) {
|
|
900
|
+
outsidePointerDown = false;
|
|
901
|
+
return;
|
|
902
|
+
}
|
|
903
|
+
const path = ev && typeof ev.composedPath === "function" ? ev.composedPath() : null;
|
|
904
|
+
outsidePointerDown = !(path ? path.indexOf(gridRoot) !== -1 : !!(ev && ev.target && gridRoot.contains && gridRoot.contains(ev.target)));
|
|
905
|
+
};
|
|
906
|
+
document.addEventListener("pointerdown", docPointerDown, true);
|
|
907
|
+
}
|
|
758
908
|
if (isWindowed()) gridScrollEl = __rozieRootRef ? __rozieRootRef.querySelector(".rdt-scroll") : null;
|
|
759
909
|
if (rowsWindowed()) {
|
|
760
910
|
virtualizer = new Virtualizer(virtualizerOptions());
|
|
@@ -776,6 +926,7 @@ function DataTable(_props) {
|
|
|
776
926
|
}
|
|
777
927
|
if (colsWindowed()) {
|
|
778
928
|
if (!(gridScrollEl ? gridScrollEl.clientWidth : 0)) console.warn("[rozie-data-table] virtual is on for columns but the scroll container has no bounded width; set a CSS width on an ancestor so the column window can be measured");
|
|
929
|
+
bumpWindowVer();
|
|
779
930
|
}
|
|
780
931
|
};
|
|
781
932
|
if (typeof requestAnimationFrame === "function") requestAnimationFrame(() => requestAnimationFrame(afterFirstFrame));
|
|
@@ -786,6 +937,10 @@ function DataTable(_props) {
|
|
|
786
937
|
announceState.globalFilter = effectiveGlobalFilter();
|
|
787
938
|
});
|
|
788
939
|
onCleanup(() => {
|
|
940
|
+
if (docPointerDown && typeof document !== "undefined") {
|
|
941
|
+
document.removeEventListener("pointerdown", docPointerDown, true);
|
|
942
|
+
docPointerDown = null;
|
|
943
|
+
}
|
|
789
944
|
if (virtualizerCleanup) virtualizerCleanup();
|
|
790
945
|
if (colVirtualizerCleanup) colVirtualizerCleanup();
|
|
791
946
|
teardownColRtlWatch();
|
|
@@ -795,6 +950,8 @@ function DataTable(_props) {
|
|
|
795
950
|
});
|
|
796
951
|
createEffect(() => {
|
|
797
952
|
maybeClearHistoryOnExternalSwap();
|
|
953
|
+
emitVisibleRangeIfChanged();
|
|
954
|
+
remeasureColumnSizes();
|
|
798
955
|
if (!table) return;
|
|
799
956
|
const d = currentData() || [];
|
|
800
957
|
if (d === lastData && d.length === lastDataLen) return;
|
|
@@ -802,6 +959,7 @@ function DataTable(_props) {
|
|
|
802
959
|
lastDataLen = d.length;
|
|
803
960
|
reFeed();
|
|
804
961
|
});
|
|
962
|
+
createEffect(on(() => windowVer(), (v) => untrack(() => emitVisibleRangeIfChanged()), { defer: true }));
|
|
805
963
|
createEffect(on(() => [
|
|
806
964
|
sorting(),
|
|
807
965
|
globalFilter(),
|
|
@@ -825,6 +983,7 @@ function DataTable(_props) {
|
|
|
825
983
|
local.columns,
|
|
826
984
|
colReg()
|
|
827
985
|
], (v) => untrack(() => (() => {
|
|
986
|
+
seedColumnPinning();
|
|
828
987
|
reFeed();
|
|
829
988
|
maybeClearHistoryOnExternalSwap();
|
|
830
989
|
})()), { defer: true }));
|
|
@@ -849,8 +1008,13 @@ function DataTable(_props) {
|
|
|
849
1008
|
let remeasurePending = false;
|
|
850
1009
|
let remeasureRaf = null;
|
|
851
1010
|
let remeasureDisposed = false;
|
|
1011
|
+
let scrollEndPinned = false;
|
|
1012
|
+
let scrollEndPinnedCount = -1;
|
|
1013
|
+
let scrollEndPinnedTop = -1;
|
|
852
1014
|
const GRID_PAGE_STEP = 10;
|
|
853
1015
|
let gridRoot = null;
|
|
1016
|
+
let outsidePointerDown = false;
|
|
1017
|
+
let docPointerDown = null;
|
|
854
1018
|
let programmatic = 0;
|
|
855
1019
|
let focusIntentEpoch = 0;
|
|
856
1020
|
const DATA_WRITE_TOKEN_KEY = "__rozieDataWriteToken";
|
|
@@ -873,6 +1037,34 @@ function DataTable(_props) {
|
|
|
873
1037
|
left: rail.concat(deduped)
|
|
874
1038
|
};
|
|
875
1039
|
}
|
|
1040
|
+
let pinSeedApplied = false;
|
|
1041
|
+
function seedColumnPinning() {
|
|
1042
|
+
if (pinSeedApplied) return;
|
|
1043
|
+
const live = columnPinning() != null ? columnPinning() : columnPinningDefault();
|
|
1044
|
+
const isRealPin = (id) => id !== SELECT_COL_ID && id !== EXPANDER_COL_ID;
|
|
1045
|
+
if ((live && live.left ? live.left : []).filter(isRealPin).length > 0 || (live && live.right ? live.right : []).filter(isRealPin).length > 0) {
|
|
1046
|
+
pinSeedApplied = true;
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
const defs = columnDefs();
|
|
1050
|
+
if (!defs.length) return;
|
|
1051
|
+
const left = [];
|
|
1052
|
+
const right = [];
|
|
1053
|
+
for (let i = 0; i < defs.length; i++) {
|
|
1054
|
+
const def = defs[i];
|
|
1055
|
+
if (!def) continue;
|
|
1056
|
+
if (def.pinned === "left") left.push(def.id);
|
|
1057
|
+
else if (def.pinned === "right") right.push(def.id);
|
|
1058
|
+
}
|
|
1059
|
+
if (!left.length && !right.length) return;
|
|
1060
|
+
pinSeedApplied = true;
|
|
1061
|
+
const seeded = {
|
|
1062
|
+
left,
|
|
1063
|
+
right
|
|
1064
|
+
};
|
|
1065
|
+
setColumnPinningDefault(seeded);
|
|
1066
|
+
setColumnPinning(seeded);
|
|
1067
|
+
}
|
|
876
1068
|
function currentState() {
|
|
877
1069
|
return {
|
|
878
1070
|
sorting: sorting() != null ? sorting() : sortingDefault(),
|
|
@@ -892,6 +1084,41 @@ function DataTable(_props) {
|
|
|
892
1084
|
function currentData() {
|
|
893
1085
|
return data() != null ? data() : dataDefault();
|
|
894
1086
|
}
|
|
1087
|
+
/**
|
|
1088
|
+
* A-01 — translate the public per-column `width` into table-core's `size`.
|
|
1089
|
+
*
|
|
1090
|
+
* `width` was written onto the ColumnDef in both build branches and read by NOTHING:
|
|
1091
|
+
* table-core resolves column width from `size` (a NUMBER of px), which only the two
|
|
1092
|
+
* chrome columns ever set. So the documented API was completely inert — the exact
|
|
1093
|
+
* sibling of the inert `pinned` that 0.5.0 closed.
|
|
1094
|
+
*
|
|
1095
|
+
* `size` is numeric px by construction, so only a number or a px string can map onto
|
|
1096
|
+
* it; any other CSS length (`12rem`, `20%`, `auto`) has no numeric px value at build
|
|
1097
|
+
* time and is deliberately NOT guessed — it returns null and the column keeps
|
|
1098
|
+
* table-core's default. The `width` prop's docs say exactly this.
|
|
1099
|
+
*
|
|
1100
|
+
* Returns null (not undefined) for "no usable width" so callers can test `!= null`
|
|
1101
|
+
* without tripping over a legitimate 0.
|
|
1102
|
+
*/ function parseWidthToSize(w) {
|
|
1103
|
+
if (typeof w === "number") return Number.isFinite(w) && w > 0 ? w : null;
|
|
1104
|
+
if (typeof w !== "string") return null;
|
|
1105
|
+
const t = w.trim();
|
|
1106
|
+
if (t === "") return null;
|
|
1107
|
+
const m = /^(\d+(?:\.\d+)?)(px)?$/i.exec(t);
|
|
1108
|
+
if (!m) return null;
|
|
1109
|
+
const n = Number.parseFloat(m[1]);
|
|
1110
|
+
return Number.isFinite(n) && n > 0 ? n : null;
|
|
1111
|
+
}
|
|
1112
|
+
const editorWarned = Object.create(null);
|
|
1113
|
+
function checkEditorKind(id, editor) {
|
|
1114
|
+
const msg = editorKindWarning(id, editor);
|
|
1115
|
+
if (!msg) return editor;
|
|
1116
|
+
const key = id + "\0" + String(editor);
|
|
1117
|
+
if (editorWarned[key]) return editor;
|
|
1118
|
+
editorWarned[key] = true;
|
|
1119
|
+
console.warn(msg);
|
|
1120
|
+
return editor;
|
|
1121
|
+
}
|
|
895
1122
|
function buildConfigDef(c) {
|
|
896
1123
|
if (!c) return null;
|
|
897
1124
|
if (Array.isArray(c.columns)) {
|
|
@@ -928,9 +1155,10 @@ function DataTable(_props) {
|
|
|
928
1155
|
aggregationFn: wrapAggregationFn(c.aggregationFn),
|
|
929
1156
|
pinned: c.pinned != null ? c.pinned : "",
|
|
930
1157
|
width: c.width != null ? c.width : "",
|
|
1158
|
+
...parseWidthToSize(c.width) != null ? { size: parseWidthToSize(c.width) } : {},
|
|
931
1159
|
meta: {
|
|
932
1160
|
editable: c.editable === true,
|
|
933
|
-
editor: c.editor != null ? c.editor : "text",
|
|
1161
|
+
editor: c.editor != null ? checkEditorKind(id, c.editor) : "text",
|
|
934
1162
|
editorOptions: c.editorOptions != null ? c.editorOptions : [],
|
|
935
1163
|
validate: typeof c.validate === "function" ? c.validate : null
|
|
936
1164
|
}
|
|
@@ -970,9 +1198,10 @@ function DataTable(_props) {
|
|
|
970
1198
|
aggregationFn: wrapAggregationFn(spec.aggregationFn),
|
|
971
1199
|
pinned: spec.pinned != null ? spec.pinned : "",
|
|
972
1200
|
width: spec.width != null ? spec.width : "",
|
|
1201
|
+
...parseWidthToSize(spec.width) != null ? { size: parseWidthToSize(spec.width) } : {},
|
|
973
1202
|
meta: {
|
|
974
1203
|
editable: spec.editable === true,
|
|
975
|
-
editor: spec.editor != null ? spec.editor : "text",
|
|
1204
|
+
editor: spec.editor != null ? checkEditorKind(id, spec.editor) : "text",
|
|
976
1205
|
editorOptions: spec.editorOptions != null ? spec.editorOptions : [],
|
|
977
1206
|
validate: typeof spec.validate === "function" ? spec.validate : null
|
|
978
1207
|
}
|
|
@@ -1231,9 +1460,12 @@ function DataTable(_props) {
|
|
|
1231
1460
|
function onColumnPinningChangeCb(updater) {
|
|
1232
1461
|
writeColumnPinning(applyUpdater(updater, currentState().columnPinning));
|
|
1233
1462
|
}
|
|
1463
|
+
let columnSizingInfoSync = null;
|
|
1234
1464
|
function onColumnSizingInfoChangeCb(updater) {
|
|
1235
|
-
const next = applyUpdater(updater, columnSizingInfo());
|
|
1236
|
-
|
|
1465
|
+
const next = applyUpdater(updater, columnSizingInfoSync != null ? columnSizingInfoSync : columnSizingInfo());
|
|
1466
|
+
if (next == null) return;
|
|
1467
|
+
columnSizingInfoSync = next;
|
|
1468
|
+
setColumnSizingInfo(next);
|
|
1237
1469
|
}
|
|
1238
1470
|
function resolveVirtual() {
|
|
1239
1471
|
const v = local.virtual;
|
|
@@ -1277,7 +1509,7 @@ function DataTable(_props) {
|
|
|
1277
1509
|
if (c && c.getIsPinned && c.getIsPinned()) out.push(i);
|
|
1278
1510
|
}
|
|
1279
1511
|
}
|
|
1280
|
-
if (
|
|
1512
|
+
if (activeColIndex() >= 0 && out.indexOf(activeColIndex()) === -1) out.push(activeColIndex());
|
|
1281
1513
|
if (editingRow() >= 0 && editingCol() >= 0 && out.indexOf(editingCol()) === -1) out.push(editingCol());
|
|
1282
1514
|
return out;
|
|
1283
1515
|
}
|
|
@@ -1298,18 +1530,37 @@ function DataTable(_props) {
|
|
|
1298
1530
|
if (rowsWindowed()) return table.getPrePaginationRowModel().rows;
|
|
1299
1531
|
return table.getRowModel().rows;
|
|
1300
1532
|
}
|
|
1533
|
+
const REMEASURE_MAX_FRAMES = 10;
|
|
1301
1534
|
function scheduleRemeasure() {
|
|
1302
1535
|
if (remeasureDisposed) return;
|
|
1536
|
+
if (virtualizer && gridScrollEl && !virtualizer.scrollState && gridScrollEl.scrollTop !== scrollEndPinnedTop) {
|
|
1537
|
+
scrollEndPinnedTop = gridScrollEl.scrollTop;
|
|
1538
|
+
scrollEndPinned = virtualizer.getVirtualDistanceFromEnd() <= 1;
|
|
1539
|
+
scrollEndPinnedCount = windowSource().length;
|
|
1540
|
+
}
|
|
1303
1541
|
if (remeasurePending) return;
|
|
1304
1542
|
remeasurePending = true;
|
|
1305
1543
|
let ranMicro = false;
|
|
1306
1544
|
const microPass = () => {
|
|
1307
1545
|
remeasureWindow();
|
|
1308
1546
|
};
|
|
1547
|
+
let rafAttempts = 0;
|
|
1309
1548
|
const rafPass = () => {
|
|
1310
1549
|
remeasureRaf = null;
|
|
1550
|
+
const covered = remeasureWindow();
|
|
1551
|
+
rafAttempts = rafAttempts + 1;
|
|
1552
|
+
if (!covered && rafAttempts < REMEASURE_MAX_FRAMES && !remeasureDisposed && typeof requestAnimationFrame === "function") {
|
|
1553
|
+
remeasureRaf = requestAnimationFrame(rafPass);
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1556
|
+
if (scrollEndPinned && gridScrollEl && !remeasureDisposed && windowSource().length === scrollEndPinnedCount) {
|
|
1557
|
+
const maxTop = gridScrollEl.scrollHeight - gridScrollEl.clientHeight;
|
|
1558
|
+
if (maxTop - gridScrollEl.scrollTop > 1) {
|
|
1559
|
+
gridScrollEl.scrollTop = maxTop;
|
|
1560
|
+
scrollEndPinnedTop = gridScrollEl.scrollTop;
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1311
1563
|
remeasurePending = false;
|
|
1312
|
-
remeasureWindow();
|
|
1313
1564
|
};
|
|
1314
1565
|
if (typeof queueMicrotask !== "undefined") {
|
|
1315
1566
|
ranMicro = true;
|
|
@@ -1331,6 +1582,7 @@ function DataTable(_props) {
|
|
|
1331
1582
|
function pinnedEditIndex() {
|
|
1332
1583
|
if (editingRow() >= 0) return editingRow();
|
|
1333
1584
|
if (editingRowIndex() != null) return editingRowIndex();
|
|
1585
|
+
if (local.interactionMode === "grid" && !activeIsHeader() && activeRow() >= 0) return activeRow();
|
|
1334
1586
|
return -1;
|
|
1335
1587
|
}
|
|
1336
1588
|
function pinnedMeasurement(pin) {
|
|
@@ -1339,12 +1591,86 @@ function DataTable(_props) {
|
|
|
1339
1591
|
return ms && ms[pin] ? ms[pin] : null;
|
|
1340
1592
|
}
|
|
1341
1593
|
function remeasureWindow() {
|
|
1342
|
-
if (remeasureDisposed) return;
|
|
1343
|
-
if (!virtualizer || !gridRoot) return;
|
|
1344
|
-
if (virtualizer.scrollState) return;
|
|
1594
|
+
if (remeasureDisposed) return true;
|
|
1595
|
+
if (!virtualizer || !gridRoot) return true;
|
|
1596
|
+
if (virtualizer.scrollState) return true;
|
|
1345
1597
|
const trs = gridRoot.querySelectorAll("tbody.rdt-tbody > tr[data-index]");
|
|
1346
|
-
|
|
1598
|
+
const rendered = /* @__PURE__ */ new Set();
|
|
1599
|
+
for (const tr of trs) {
|
|
1600
|
+
virtualizer.measureElement(tr);
|
|
1601
|
+
rendered.add(tr.getAttribute("data-index"));
|
|
1602
|
+
}
|
|
1603
|
+
let covered = true;
|
|
1604
|
+
const items = virtualizer.getVirtualItems();
|
|
1605
|
+
for (let i = 0; i < items.length; i++) if (!rendered.has(String(items[i].index))) {
|
|
1606
|
+
covered = false;
|
|
1607
|
+
break;
|
|
1608
|
+
}
|
|
1347
1609
|
if (afterRowRemeasure) afterRowRemeasure();
|
|
1610
|
+
return covered;
|
|
1611
|
+
}
|
|
1612
|
+
const LAZY_PLACEHOLDER_KEY = "__rdtLazyPlaceholder";
|
|
1613
|
+
const LAZY_PLACEHOLDER_ROW_ID_PREFIX = "__rdt_ph_";
|
|
1614
|
+
let lazyPlaceholders = {};
|
|
1615
|
+
function lazyRowsActive() {
|
|
1616
|
+
return rowsWindowed() && !!local.manual && local.rowCount != null && local.rowCount > 0;
|
|
1617
|
+
}
|
|
1618
|
+
function isLazyPlaceholder(orig) {
|
|
1619
|
+
return !!orig && orig[LAZY_PLACEHOLDER_KEY] === true;
|
|
1620
|
+
}
|
|
1621
|
+
function rowIsLazyPlaceholder(row) {
|
|
1622
|
+
return !!row && isLazyPlaceholder(row.original);
|
|
1623
|
+
}
|
|
1624
|
+
function feedData() {
|
|
1625
|
+
const d = currentData() || [];
|
|
1626
|
+
if (!lazyRowsActive()) return d;
|
|
1627
|
+
const n = Math.max(d.length, Number(local.rowCount));
|
|
1628
|
+
const out = new Array(n);
|
|
1629
|
+
for (let i = 0; i < n; i++) {
|
|
1630
|
+
const v = d[i];
|
|
1631
|
+
if (v != null) out[i] = v;
|
|
1632
|
+
else {
|
|
1633
|
+
if (!lazyPlaceholders[i]) lazyPlaceholders[i] = {
|
|
1634
|
+
[LAZY_PLACEHOLDER_KEY]: true,
|
|
1635
|
+
index: i
|
|
1636
|
+
};
|
|
1637
|
+
out[i] = lazyPlaceholders[i];
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
return out;
|
|
1641
|
+
}
|
|
1642
|
+
function migratePlaceholderSizeCache() {
|
|
1643
|
+
if (!virtualizer || !virtualizer.itemSizeCache || !table) return;
|
|
1644
|
+
const cache = virtualizer.itemSizeCache;
|
|
1645
|
+
const coreRows = table.getCoreRowModel().rows;
|
|
1646
|
+
let migrated = false;
|
|
1647
|
+
for (const oldKey of Array.from(cache.keys())) {
|
|
1648
|
+
if (typeof oldKey !== "string" || oldKey.indexOf(LAZY_PLACEHOLDER_ROW_ID_PREFIX) !== 0) continue;
|
|
1649
|
+
const row = coreRows[Number(oldKey.slice(9))];
|
|
1650
|
+
if (!row || rowIsLazyPlaceholder(row) || row.id === oldKey) continue;
|
|
1651
|
+
cache.set(row.id, cache.get(oldKey));
|
|
1652
|
+
cache.delete(oldKey);
|
|
1653
|
+
migrated = true;
|
|
1654
|
+
}
|
|
1655
|
+
if (!migrated) return;
|
|
1656
|
+
virtualizer.itemSizeCache = new Map(cache);
|
|
1657
|
+
if (typeof virtualizer.itemSizeCacheVersion === "number") virtualizer.itemSizeCacheVersion++;
|
|
1658
|
+
}
|
|
1659
|
+
let lastRangeStart = -1;
|
|
1660
|
+
let lastRangeEnd = -1;
|
|
1661
|
+
function emitVisibleRangeIfChanged() {
|
|
1662
|
+
if (!rowsWindowed() || !virtualizer) return;
|
|
1663
|
+
const items = virtualizer.getVirtualItems();
|
|
1664
|
+
if (!items.length) return;
|
|
1665
|
+
const start = items[0].index;
|
|
1666
|
+
const end = items[items.length - 1].index + 1;
|
|
1667
|
+
if (start === lastRangeStart && end === lastRangeEnd) return;
|
|
1668
|
+
lastRangeStart = start;
|
|
1669
|
+
lastRangeEnd = end;
|
|
1670
|
+
_props.onVisibleRangeChange?.({
|
|
1671
|
+
start,
|
|
1672
|
+
end
|
|
1673
|
+
});
|
|
1348
1674
|
}
|
|
1349
1675
|
function virtualItemKey(i) {
|
|
1350
1676
|
const src = windowSource();
|
|
@@ -1451,6 +1777,7 @@ function DataTable(_props) {
|
|
|
1451
1777
|
}
|
|
1452
1778
|
}
|
|
1453
1779
|
bumpWindowVer();
|
|
1780
|
+
scheduleRemeasure();
|
|
1454
1781
|
}
|
|
1455
1782
|
function virtualizerOptions() {
|
|
1456
1783
|
return {
|
|
@@ -1633,20 +1960,29 @@ function DataTable(_props) {
|
|
|
1633
1960
|
if (filterChanged) return totalRowCount() + " results";
|
|
1634
1961
|
return "";
|
|
1635
1962
|
}
|
|
1963
|
+
function rowIdOption() {
|
|
1964
|
+
const f = local.getRowId;
|
|
1965
|
+
return f ? (originalRow, index, parent) => isLazyPlaceholder(originalRow) ? LAZY_PLACEHOLDER_ROW_ID_PREFIX + originalRow.index : String(f(originalRow, index, parent)) : void 0;
|
|
1966
|
+
}
|
|
1967
|
+
function rowSelectionOption() {
|
|
1968
|
+
if (local.selectionMode === "none") return false;
|
|
1969
|
+
return lazyRowsActive() ? (row) => !rowIsLazyPlaceholder(row) : true;
|
|
1970
|
+
}
|
|
1636
1971
|
function reFeed() {
|
|
1637
1972
|
if (!table) return;
|
|
1638
1973
|
table.setOptions((prev) => ({
|
|
1639
1974
|
...prev,
|
|
1640
|
-
data:
|
|
1975
|
+
data: feedData(),
|
|
1641
1976
|
columns: tableColumns(),
|
|
1642
1977
|
state: currentState(),
|
|
1643
|
-
enableRowSelection:
|
|
1978
|
+
enableRowSelection: rowSelectionOption(),
|
|
1644
1979
|
enableMultiRowSelection: local.selectionMode === "multiple",
|
|
1645
1980
|
rowCount: local.rowCount ?? void 0,
|
|
1646
1981
|
pageCount: local.pageCount ?? void 0,
|
|
1647
1982
|
getExpandedRowModel: getExpandedRowModel(),
|
|
1648
1983
|
getSubRows: local.getSubRows || void 0,
|
|
1649
|
-
|
|
1984
|
+
getRowId: rowIdOption(),
|
|
1985
|
+
getRowCanExpand: local.expandable === true && local.getSubRows == null ? (row) => !rowIsLazyPlaceholder(row) : void 0,
|
|
1650
1986
|
onExpandedChange: onExpandedChangeCb,
|
|
1651
1987
|
autoResetExpanded: false,
|
|
1652
1988
|
getGroupedRowModel: getGroupedRowModel(),
|
|
@@ -1804,9 +2140,9 @@ function DataTable(_props) {
|
|
|
1804
2140
|
if (side === "right") return "position:sticky;right:" + (col.getAfter ? col.getAfter("right") : 0) + "px;z-index:" + zIndex + ";";
|
|
1805
2141
|
return "";
|
|
1806
2142
|
}
|
|
1807
|
-
function thStyle(header) {
|
|
2143
|
+
function thStyle(header, widthPx = null) {
|
|
1808
2144
|
let s = "";
|
|
1809
|
-
const w = headerWidth(header);
|
|
2145
|
+
const w = widthPx != null && widthPx > 0 ? widthPx + "px" : headerWidth(header);
|
|
1810
2146
|
if (w) s += "width:" + w + ";";
|
|
1811
2147
|
s += pinStyle(header && header.column ? header.column.id : null, 2);
|
|
1812
2148
|
return s;
|
|
@@ -2069,6 +2405,16 @@ function DataTable(_props) {
|
|
|
2069
2405
|
function headerColIndexOf(hg, header) {
|
|
2070
2406
|
return (hg && hg.headers ? hg.headers : []).indexOf(header);
|
|
2071
2407
|
}
|
|
2408
|
+
function headerLeafStart(hg, header) {
|
|
2409
|
+
const list = hg && hg.headers ? hg.headers : [];
|
|
2410
|
+
let leaf = 0;
|
|
2411
|
+
for (let i = 0; i < list.length; i++) {
|
|
2412
|
+
if (list[i] === header) return leaf;
|
|
2413
|
+
const h = list[i];
|
|
2414
|
+
leaf = leaf + (h && h.colSpan > 1 ? h.colSpan : 1);
|
|
2415
|
+
}
|
|
2416
|
+
return -1;
|
|
2417
|
+
}
|
|
2072
2418
|
function pageRowOffset() {
|
|
2073
2419
|
if (!isGrid() || rowsWindowed()) return 0;
|
|
2074
2420
|
return pageIndex() * pageSize();
|
|
@@ -2114,14 +2460,15 @@ function DataTable(_props) {
|
|
|
2114
2460
|
const header = nextIsHeader == null ? activeIsHeader() : nextIsHeader;
|
|
2115
2461
|
const rowOut = rowsWindowed() && virtualizer && rowIsOutsideWindow(r);
|
|
2116
2462
|
const colOut = colsWindowed() && colVirtualizer && colIsOutsideWindow(c);
|
|
2117
|
-
|
|
2118
|
-
|
|
2463
|
+
const rowScroll = !header && rowOut;
|
|
2464
|
+
if (rowScroll || colOut) {
|
|
2465
|
+
if (rowScroll) virtualizer.scrollToIndex(r, { align: "center" });
|
|
2119
2466
|
if (colOut) colVirtualizer.scrollToIndex(c, { align: "center" });
|
|
2120
2467
|
let focusAttempts = 0;
|
|
2121
2468
|
const myEpoch = focusIntentEpoch;
|
|
2122
2469
|
const focusWhenReady = () => {
|
|
2123
2470
|
if (focusIntentEpoch !== myEpoch) return;
|
|
2124
|
-
const el = resolveCellEl(String(r), c);
|
|
2471
|
+
const el = resolveCellEl(header ? "__header" : String(r), c, header ? lvl : null);
|
|
2125
2472
|
if (el) {
|
|
2126
2473
|
el.focus();
|
|
2127
2474
|
return;
|
|
@@ -2140,6 +2487,10 @@ function DataTable(_props) {
|
|
|
2140
2487
|
}
|
|
2141
2488
|
function totalRowCount() {
|
|
2142
2489
|
if (!table) return (rows() || []).length;
|
|
2490
|
+
if (local.manual === true) {
|
|
2491
|
+
if (local.rowCount != null) return local.rowCount;
|
|
2492
|
+
if (local.pageCount != null) return local.pageCount * pageSize();
|
|
2493
|
+
}
|
|
2143
2494
|
const fm = table.getFilteredRowModel();
|
|
2144
2495
|
return fm && fm.rows ? fm.rows.length : (rows() || []).length;
|
|
2145
2496
|
}
|
|
@@ -2155,6 +2506,9 @@ function DataTable(_props) {
|
|
|
2155
2506
|
function bodyAriaRowIndex(row) {
|
|
2156
2507
|
return headerRowCount() + rowIndexOf(row) + ariaPageOffset() + 1;
|
|
2157
2508
|
}
|
|
2509
|
+
function gridAriaColCount() {
|
|
2510
|
+
return visibleColCount();
|
|
2511
|
+
}
|
|
2158
2512
|
function visibleColCount() {
|
|
2159
2513
|
const rowList = rows() || [];
|
|
2160
2514
|
if (rowList.length) return rowList[0].getVisibleCells().length;
|
|
@@ -2326,6 +2680,9 @@ function DataTable(_props) {
|
|
|
2326
2680
|
function currentCellEl() {
|
|
2327
2681
|
return resolveCellEl(activeIsHeader() ? "__header" : String(activeRow()), activeColIndex(), activeIsHeader() ? activeHeaderLevel() : null);
|
|
2328
2682
|
}
|
|
2683
|
+
function activeCellHasControls() {
|
|
2684
|
+
return focusables(currentCellEl()).length > 0;
|
|
2685
|
+
}
|
|
2329
2686
|
function enterControl() {
|
|
2330
2687
|
const list = focusables(currentCellEl());
|
|
2331
2688
|
if (!list.length) return;
|
|
@@ -2370,10 +2727,10 @@ function DataTable(_props) {
|
|
|
2370
2727
|
let nextLevel = prevLevel;
|
|
2371
2728
|
if ((e.ctrlKey || e.metaKey) && e.shiftKey && !activeIsHeader() && (key === "ArrowUp" || key === "ArrowDown" || key === "ArrowLeft" || key === "ArrowRight")) {
|
|
2372
2729
|
e.preventDefault();
|
|
2373
|
-
if (key === "ArrowUp") extendRange(-
|
|
2374
|
-
else if (key === "ArrowDown") extendRange(bodyRowCount() - 1 -
|
|
2375
|
-
else if (key === "ArrowLeft") extendRange(0, -
|
|
2376
|
-
else extendRange(0, visibleColCount() - 1 -
|
|
2730
|
+
if (key === "ArrowUp") extendRange(-rangeFocusRow(), 0);
|
|
2731
|
+
else if (key === "ArrowDown") extendRange(bodyRowCount() - 1 - rangeFocusRow(), 0);
|
|
2732
|
+
else if (key === "ArrowLeft") extendRange(0, -rangeFocusCol());
|
|
2733
|
+
else extendRange(0, visibleColCount() - 1 - rangeFocusCol());
|
|
2377
2734
|
return;
|
|
2378
2735
|
} else if ((e.ctrlKey || e.metaKey) && !activeIsHeader() && (key === "ArrowUp" || key === "ArrowDown" || key === "ArrowLeft" || key === "ArrowRight")) {
|
|
2379
2736
|
e.preventDefault();
|
|
@@ -2456,15 +2813,15 @@ function DataTable(_props) {
|
|
|
2456
2813
|
nextCol = en.col;
|
|
2457
2814
|
nextIsHeader = false;
|
|
2458
2815
|
} else nextCol = gotoColEdge(true);
|
|
2459
|
-
} else if ((key === "c" || key === "C") && (e.ctrlKey || e.metaKey) && clipboardActiveAllowed()) {
|
|
2816
|
+
} else if ((key === "c" || key === "C") && (e.ctrlKey || e.metaKey) && clipboardActiveAllowed() && clipboardWriteAvailable()) {
|
|
2460
2817
|
e.preventDefault();
|
|
2461
2818
|
copyRange();
|
|
2462
2819
|
return;
|
|
2463
|
-
} else if ((key === "v" || key === "V") && (e.ctrlKey || e.metaKey) && clipboardActiveAllowed()) {
|
|
2820
|
+
} else if ((key === "v" || key === "V") && (e.ctrlKey || e.metaKey) && clipboardActiveAllowed() && clipboardReadAvailable()) {
|
|
2464
2821
|
e.preventDefault();
|
|
2465
2822
|
pasteRange();
|
|
2466
2823
|
return;
|
|
2467
|
-
} else if ((key === "x" || key === "X") && (e.ctrlKey || e.metaKey) && clipboardActiveAllowed()) {
|
|
2824
|
+
} else if ((key === "x" || key === "X") && (e.ctrlKey || e.metaKey) && clipboardActiveAllowed() && clipboardWriteAvailable()) {
|
|
2468
2825
|
e.preventDefault();
|
|
2469
2826
|
cutRange();
|
|
2470
2827
|
return;
|
|
@@ -2494,6 +2851,23 @@ function DataTable(_props) {
|
|
|
2494
2851
|
e.preventDefault();
|
|
2495
2852
|
if (!activeIsHeader()) selectAllBody();
|
|
2496
2853
|
return;
|
|
2854
|
+
} else if (key === " " && e.shiftKey && !e.ctrlKey && !e.metaKey && !activeIsHeader()) {
|
|
2855
|
+
e.preventDefault();
|
|
2856
|
+
if (local.selectionMode !== "none") {
|
|
2857
|
+
const selRow = (rows() || [])[activeRow()];
|
|
2858
|
+
if (selRow && selRow.toggleSelected) selRow.toggleSelected(!rowIsSelected(selRow));
|
|
2859
|
+
}
|
|
2860
|
+
return;
|
|
2861
|
+
} else if (key === " " && (e.ctrlKey || e.metaKey) && !e.shiftKey && !activeIsHeader()) {
|
|
2862
|
+
e.preventDefault();
|
|
2863
|
+
selectActiveColumn();
|
|
2864
|
+
return;
|
|
2865
|
+
} else if (key === "Escape") {
|
|
2866
|
+
if (rangeActive || rangeAnchor() != null) {
|
|
2867
|
+
e.preventDefault();
|
|
2868
|
+
clearRange();
|
|
2869
|
+
}
|
|
2870
|
+
return;
|
|
2497
2871
|
} else if (key === "F2" && e.shiftKey && isActiveCellEditable()) {
|
|
2498
2872
|
e.preventDefault();
|
|
2499
2873
|
beginRowEdit((rows() || [])[activeRow()]);
|
|
@@ -2519,6 +2893,10 @@ function DataTable(_props) {
|
|
|
2519
2893
|
onToggleExpand((rows() || [])[activeRow()], e);
|
|
2520
2894
|
recoverGridFocus(String(grpRow), grpCol, null, true);
|
|
2521
2895
|
return;
|
|
2896
|
+
} else if (key === "Enter" && !activeIsHeader() && !activeCellHasControls()) {
|
|
2897
|
+
e.preventDefault();
|
|
2898
|
+
activateRowAt(activeRow(), "keyboard");
|
|
2899
|
+
return;
|
|
2522
2900
|
} else if (key === "Enter" || key === "F2") {
|
|
2523
2901
|
e.preventDefault();
|
|
2524
2902
|
enterControl();
|
|
@@ -2569,8 +2947,11 @@ function DataTable(_props) {
|
|
|
2569
2947
|
setActiveColIndex(col);
|
|
2570
2948
|
if (isHeader !== prevIsHeader || col !== prevCol || (isHeader ? movedLevel !== prevLevel : movedRow !== prevRow)) focusIntentEpoch = focusIntentEpoch + 1;
|
|
2571
2949
|
if (rangeTransition) rangeTransition = false;
|
|
2572
|
-
else if (rangeClickPending) rangeClickPending =
|
|
2573
|
-
else
|
|
2950
|
+
else if (rangeClickPending && rangeClickPending.isHeader === isHeader && rangeClickPending.r === movedRow && rangeClickPending.c === col) rangeClickPending = null;
|
|
2951
|
+
else {
|
|
2952
|
+
rangeClickPending = null;
|
|
2953
|
+
clearRange();
|
|
2954
|
+
}
|
|
2574
2955
|
if (tgt === cellEl) setActiveInControl(false);
|
|
2575
2956
|
}
|
|
2576
2957
|
function onGridMouseDown(e) {
|
|
@@ -2591,9 +2972,14 @@ function DataTable(_props) {
|
|
|
2591
2972
|
setActiveIsHeader(false);
|
|
2592
2973
|
setActiveRow(row);
|
|
2593
2974
|
setActiveColIndex(col);
|
|
2594
|
-
rangeClickPending =
|
|
2975
|
+
rangeClickPending = {
|
|
2976
|
+
isHeader: false,
|
|
2977
|
+
r: row,
|
|
2978
|
+
c: col
|
|
2979
|
+
};
|
|
2595
2980
|
return;
|
|
2596
2981
|
}
|
|
2982
|
+
if (isEditing(row, col)) return;
|
|
2597
2983
|
beginRangeDrag(row, col);
|
|
2598
2984
|
}
|
|
2599
2985
|
function onGridDblClick(e) {
|
|
@@ -2621,7 +3007,39 @@ function DataTable(_props) {
|
|
|
2621
3007
|
beginEdit(row, col, null);
|
|
2622
3008
|
}
|
|
2623
3009
|
}
|
|
3010
|
+
function activateRowAt(index, trigger) {
|
|
3011
|
+
const row = (rows() || [])[index];
|
|
3012
|
+
if (!row || rowIsGrouped(row) || rowIsLazyPlaceholder(row)) return;
|
|
3013
|
+
_props.onRowActivate?.({
|
|
3014
|
+
row: row.original,
|
|
3015
|
+
index,
|
|
3016
|
+
trigger
|
|
3017
|
+
});
|
|
3018
|
+
}
|
|
3019
|
+
const ROW_ACTIVATE_CONTROLS = "input, button, a[href], select, textarea, label, summary, [contenteditable=\"\"], [contenteditable=\"true\"], [role=\"button\"], [role=\"checkbox\"], [role=\"link\"], [data-editing-cell]";
|
|
3020
|
+
function maybeActivateRowFromClick(e) {
|
|
3021
|
+
if (!e || e.shiftKey || e.ctrlKey || e.metaKey || e.altKey) return;
|
|
3022
|
+
if (rangeDragMoved) return;
|
|
3023
|
+
const tgt = e.target;
|
|
3024
|
+
if (!tgt || !tgt.closest) return;
|
|
3025
|
+
const cellEl = tgt.closest("[data-row]");
|
|
3026
|
+
if (!cellEl) return;
|
|
3027
|
+
const control = tgt.closest(ROW_ACTIVATE_CONTROLS);
|
|
3028
|
+
if (control && cellEl.contains(control)) return;
|
|
3029
|
+
const rowAttr = cellEl.getAttribute("data-row");
|
|
3030
|
+
if (rowAttr == null || rowAttr === "__header") return;
|
|
3031
|
+
const index = parseInt(rowAttr, 10);
|
|
3032
|
+
if (!Number.isFinite(index)) return;
|
|
3033
|
+
if (isGrid() && local.singleClickEdit) {
|
|
3034
|
+
const colAttr = cellEl.getAttribute("data-col-index");
|
|
3035
|
+
const col = colAttr == null ? NaN : parseInt(colAttr, 10);
|
|
3036
|
+
const colId = Number.isFinite(col) ? columnIdAt(index, col) : null;
|
|
3037
|
+
if (colId != null && columnEditable(colId)) return;
|
|
3038
|
+
}
|
|
3039
|
+
activateRowAt(index, "click");
|
|
3040
|
+
}
|
|
2624
3041
|
function onGridClick(e) {
|
|
3042
|
+
maybeActivateRowFromClick(e);
|
|
2625
3043
|
if (!isGrid() || !e) return;
|
|
2626
3044
|
if (!local.singleClickEdit) return;
|
|
2627
3045
|
if (e.shiftKey) return;
|
|
@@ -2732,7 +3150,8 @@ function DataTable(_props) {
|
|
|
2732
3150
|
const headers = hg && hg.headers || [];
|
|
2733
3151
|
if (!colsWindowed()) return headers.map((h) => ({
|
|
2734
3152
|
header: h,
|
|
2735
|
-
span: h && h.colSpan > 1 ? h.colSpan : 1
|
|
3153
|
+
span: h && h.colSpan > 1 ? h.colSpan : 1,
|
|
3154
|
+
width: null
|
|
2736
3155
|
}));
|
|
2737
3156
|
const idx = windowedColIndices();
|
|
2738
3157
|
const idxSet = {};
|
|
@@ -2746,10 +3165,15 @@ function DataTable(_props) {
|
|
|
2746
3165
|
const end = cursor + leafCount;
|
|
2747
3166
|
cursor = end;
|
|
2748
3167
|
let span = 0;
|
|
2749
|
-
|
|
3168
|
+
let width = 0;
|
|
3169
|
+
for (let c = start; c < end; c++) if (idxSet[c]) {
|
|
3170
|
+
span = span + 1;
|
|
3171
|
+
width = width + columnSize(c);
|
|
3172
|
+
}
|
|
2750
3173
|
if (span > 0) out.push({
|
|
2751
3174
|
header: h,
|
|
2752
|
-
span
|
|
3175
|
+
span,
|
|
3176
|
+
width
|
|
2753
3177
|
});
|
|
2754
3178
|
}
|
|
2755
3179
|
return out;
|
|
@@ -2757,14 +3181,25 @@ function DataTable(_props) {
|
|
|
2757
3181
|
function windowedColSpan() {
|
|
2758
3182
|
return colsWindowed() ? windowedColIndices().length + 2 : visibleColCount();
|
|
2759
3183
|
}
|
|
3184
|
+
let lastColSizeSig = 0;
|
|
3185
|
+
function remeasureColumnSizes() {
|
|
3186
|
+
if (!colsWindowed() || !colVirtualizer || !colVirtualizer.measure) return;
|
|
3187
|
+
const n = columnCount();
|
|
3188
|
+
let sig = n;
|
|
3189
|
+
for (let i = 0; i < n; i++) sig = Math.imul(sig, 31) + columnSize(i) | 0;
|
|
3190
|
+
if (sig === lastColSizeSig) return;
|
|
3191
|
+
lastColSizeSig = sig;
|
|
3192
|
+
colVirtualizer.measure();
|
|
3193
|
+
}
|
|
2760
3194
|
function remeasureColumnWindow() {
|
|
2761
3195
|
if (!colsWindowed() || !colVirtualizer) return;
|
|
2762
3196
|
colVirtualizer.setOptions(columnVirtualizerOptions());
|
|
3197
|
+
remeasureColumnSizes();
|
|
2763
3198
|
colVirtualizer._willUpdate();
|
|
2764
3199
|
}
|
|
2765
3200
|
let gridEmptyFallback = false;
|
|
2766
3201
|
let rangeTransition = false;
|
|
2767
|
-
let rangeClickPending =
|
|
3202
|
+
let rangeClickPending = null;
|
|
2768
3203
|
let rangeActive = false;
|
|
2769
3204
|
function inRange(rIdx, cIdx) {
|
|
2770
3205
|
const a = rangeAnchor();
|
|
@@ -2806,7 +3241,17 @@ function DataTable(_props) {
|
|
|
2806
3241
|
const c1 = a.colIndex > f.colIndex ? a.colIndex : f.colIndex;
|
|
2807
3242
|
return rIdx === r1 && cIdx === c1;
|
|
2808
3243
|
}
|
|
3244
|
+
function rangeSummary(anchor, focus) {
|
|
3245
|
+
if (!anchor || !focus) return "";
|
|
3246
|
+
const rows = Math.abs(focus.rowIndex - anchor.rowIndex) + 1;
|
|
3247
|
+
const cols = Math.abs(focus.colIndex - anchor.colIndex) + 1;
|
|
3248
|
+
if (rows === 1 && cols === 1) return "1 cell selected";
|
|
3249
|
+
const rowPart = rows + (rows === 1 ? " row" : " rows");
|
|
3250
|
+
const colPart = cols + (cols === 1 ? " column" : " columns");
|
|
3251
|
+
return rowPart + " by " + colPart + " selected, " + rows * cols + " cells";
|
|
3252
|
+
}
|
|
2809
3253
|
function emitRangeChange(anchor, focus) {
|
|
3254
|
+
setRangeAnnounce(rangeSummary(anchor, focus));
|
|
2810
3255
|
_props.onRangeChange?.({
|
|
2811
3256
|
anchor,
|
|
2812
3257
|
focus
|
|
@@ -2845,11 +3290,15 @@ function DataTable(_props) {
|
|
|
2845
3290
|
focusActiveCell(nextRow, nextCol, false);
|
|
2846
3291
|
if (!hadRange || nextRow !== focus.rowIndex || nextCol !== focus.colIndex) emitRangeChange(anchor, nextFocus);
|
|
2847
3292
|
}
|
|
2848
|
-
function setRangeFocus$local(rIdx, cIdx) {
|
|
3293
|
+
function setRangeFocus$local(rIdx, cIdx, anchorR = null, anchorC = null) {
|
|
2849
3294
|
const maxRow = bodyRowCount() - 1;
|
|
2850
3295
|
const maxCol = visibleColCount() - 1;
|
|
2851
3296
|
if (maxRow < 0 || maxCol < 0) return;
|
|
2852
3297
|
let anchor = rangeAnchor();
|
|
3298
|
+
if (!anchor && anchorR != null && anchorC != null) anchor = {
|
|
3299
|
+
rowIndex: clamp(Math.trunc(Number(anchorR)) || 0, 0, maxRow),
|
|
3300
|
+
colIndex: clamp(Math.trunc(Number(anchorC)) || 0, 0, maxCol)
|
|
3301
|
+
};
|
|
2853
3302
|
if (!anchor) anchor = {
|
|
2854
3303
|
rowIndex: activeRow(),
|
|
2855
3304
|
colIndex: activeColIndex()
|
|
@@ -2880,6 +3329,32 @@ function DataTable(_props) {
|
|
|
2880
3329
|
rangeActive = true;
|
|
2881
3330
|
emitRangeChange(anchor, focus);
|
|
2882
3331
|
}
|
|
3332
|
+
function rangeFocusRow() {
|
|
3333
|
+
const f = rangeFocus();
|
|
3334
|
+
return f && f.rowIndex != null ? f.rowIndex : activeRow();
|
|
3335
|
+
}
|
|
3336
|
+
function rangeFocusCol() {
|
|
3337
|
+
const f = rangeFocus();
|
|
3338
|
+
return f && f.colIndex != null ? f.colIndex : activeColIndex();
|
|
3339
|
+
}
|
|
3340
|
+
function selectActiveColumn() {
|
|
3341
|
+
const maxRow = bodyRowCount() - 1;
|
|
3342
|
+
const maxCol = visibleColCount() - 1;
|
|
3343
|
+
if (maxRow < 0 || maxCol < 0) return;
|
|
3344
|
+
const c = clamp(Math.trunc(Number(activeColIndex())) || 0, 0, maxCol);
|
|
3345
|
+
const anchor = {
|
|
3346
|
+
rowIndex: 0,
|
|
3347
|
+
colIndex: c
|
|
3348
|
+
};
|
|
3349
|
+
const focus = {
|
|
3350
|
+
rowIndex: maxRow,
|
|
3351
|
+
colIndex: c
|
|
3352
|
+
};
|
|
3353
|
+
setRangeAnchor(anchor);
|
|
3354
|
+
setRangeFocus(focus);
|
|
3355
|
+
rangeActive = true;
|
|
3356
|
+
emitRangeChange(anchor, focus);
|
|
3357
|
+
}
|
|
2883
3358
|
function clearRange() {
|
|
2884
3359
|
if (!rangeActive) return;
|
|
2885
3360
|
rangeActive = false;
|
|
@@ -2961,6 +3436,12 @@ function DataTable(_props) {
|
|
|
2961
3436
|
}
|
|
2962
3437
|
return lines.join("\n");
|
|
2963
3438
|
}
|
|
3439
|
+
function clipboardWriteAvailable() {
|
|
3440
|
+
return typeof navigator !== "undefined" && !!navigator.clipboard && typeof navigator.clipboard.writeText === "function";
|
|
3441
|
+
}
|
|
3442
|
+
function clipboardReadAvailable() {
|
|
3443
|
+
return typeof navigator !== "undefined" && !!navigator.clipboard && typeof navigator.clipboard.readText === "function";
|
|
3444
|
+
}
|
|
2964
3445
|
function copyRange() {
|
|
2965
3446
|
if (!clipboardActiveAllowed()) return;
|
|
2966
3447
|
if (typeof navigator === "undefined" || !navigator.clipboard || !navigator.clipboard.writeText) return;
|
|
@@ -2969,27 +3450,30 @@ function DataTable(_props) {
|
|
|
2969
3450
|
if (p && p.catch) p.catch(() => {});
|
|
2970
3451
|
} catch (err) {}
|
|
2971
3452
|
}
|
|
2972
|
-
function applyGridToRange(grid, originRow, originCol) {
|
|
3453
|
+
function applyGridToRange(grid, originRow, originCol, verb) {
|
|
3454
|
+
const opVerb = typeof verb === "string" && verb !== "" ? verb : "pasted";
|
|
2973
3455
|
const maxRow = bodyRowCount() - 1;
|
|
2974
3456
|
const maxCol = visibleColCount() - 1;
|
|
2975
3457
|
if (maxRow < 0 || maxCol < 0) return {
|
|
2976
3458
|
wrote: 0,
|
|
3459
|
+
changed: 0,
|
|
2977
3460
|
total: 0
|
|
2978
3461
|
};
|
|
2979
3462
|
let total = 0;
|
|
2980
|
-
let
|
|
3463
|
+
let applied = 0;
|
|
2981
3464
|
const committed = [];
|
|
2982
3465
|
let next = currentData();
|
|
2983
3466
|
for (let gr = 0; gr < grid.length; gr++) {
|
|
2984
3467
|
const r = originRow + gr;
|
|
2985
3468
|
if (r > maxRow) break;
|
|
2986
3469
|
const rowGrouped = rowIndexIsGrouped(r);
|
|
3470
|
+
const rowPlaceholder = rowIsLazyPlaceholder((rows() || [])[r]);
|
|
2987
3471
|
const cols = grid[gr] || [];
|
|
2988
3472
|
for (let gc = 0; gc < cols.length; gc++) {
|
|
2989
3473
|
const c = originCol + gc;
|
|
2990
3474
|
if (c > maxCol) break;
|
|
2991
3475
|
total = total + 1;
|
|
2992
|
-
if (rowGrouped) continue;
|
|
3476
|
+
if (rowGrouped || rowPlaceholder) continue;
|
|
2993
3477
|
const colId = columnIdAt(r, c);
|
|
2994
3478
|
if (colId == null || !columnEditable(colId)) continue;
|
|
2995
3479
|
const rowObj = rowOriginalAt(r);
|
|
@@ -2998,6 +3482,8 @@ function DataTable(_props) {
|
|
|
2998
3482
|
const field = fieldOfColId(colId);
|
|
2999
3483
|
const srcIndex = sourceIndexOfRow(r);
|
|
3000
3484
|
const oldValue = rowObj ? rowObj[field] : null;
|
|
3485
|
+
applied = applied + 1;
|
|
3486
|
+
if (oldValue === value) continue;
|
|
3001
3487
|
next = replaceRowValue(next, srcIndex, field, value);
|
|
3002
3488
|
committed.push({
|
|
3003
3489
|
rowId: rowIdAt(r),
|
|
@@ -3005,19 +3491,23 @@ function DataTable(_props) {
|
|
|
3005
3491
|
oldValue,
|
|
3006
3492
|
newValue: value
|
|
3007
3493
|
});
|
|
3008
|
-
wrote = wrote + 1;
|
|
3009
3494
|
}
|
|
3010
3495
|
}
|
|
3011
|
-
if (
|
|
3496
|
+
if (committed.length > 0) {
|
|
3012
3497
|
editTransition = true;
|
|
3013
3498
|
writeData(next);
|
|
3014
3499
|
editTransition = false;
|
|
3015
|
-
for (let i = 0; i < committed.length; i++)
|
|
3500
|
+
for (let i = 0; i < committed.length; i++) try {
|
|
3501
|
+
_props.onCellEditCommit?.(committed[i]);
|
|
3502
|
+
} catch (err) {
|
|
3503
|
+
console.error("[rozie-data-table] paste failed partway: a cell-edit-commit listener threw. The model was already written; the remaining cells still notify.", err);
|
|
3504
|
+
}
|
|
3016
3505
|
}
|
|
3017
|
-
if (
|
|
3018
|
-
else if (total > 0) announce("No cells
|
|
3506
|
+
if (applied > 0) announce(applied + " of " + total + " cells " + opVerb);
|
|
3507
|
+
else if (total > 0) announce("No cells " + opVerb + " — " + total + " cells were invalid or read-only");
|
|
3019
3508
|
return {
|
|
3020
|
-
wrote,
|
|
3509
|
+
wrote: applied,
|
|
3510
|
+
changed: committed.length,
|
|
3021
3511
|
total
|
|
3022
3512
|
};
|
|
3023
3513
|
}
|
|
@@ -3049,10 +3539,14 @@ function DataTable(_props) {
|
|
|
3049
3539
|
}
|
|
3050
3540
|
if (!p || !p.then) return;
|
|
3051
3541
|
p.then((text) => {
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3542
|
+
try {
|
|
3543
|
+
const grid = parseTsv(text);
|
|
3544
|
+
if (!grid.length) return;
|
|
3545
|
+
applyGridToRange(tileGridToBox(grid, destBox), anchorRow, anchorCol, "pasted");
|
|
3546
|
+
} catch (err) {
|
|
3547
|
+
console.error("[rozie-data-table] paste failed: a row accessor, the data model setter or other consumer code threw. The paste was abandoned.", err);
|
|
3548
|
+
}
|
|
3549
|
+
}, () => {});
|
|
3056
3550
|
}
|
|
3057
3551
|
function cutRange() {
|
|
3058
3552
|
if (!clipboardActiveAllowed()) return;
|
|
@@ -3071,7 +3565,7 @@ function DataTable(_props) {
|
|
|
3071
3565
|
for (let c = c0; c <= c1; c++) cols.push("");
|
|
3072
3566
|
grid.push(cols);
|
|
3073
3567
|
}
|
|
3074
|
-
applyGridToRange(grid, r0, c0);
|
|
3568
|
+
applyGridToRange(grid, r0, c0, "cut");
|
|
3075
3569
|
}
|
|
3076
3570
|
function clearActiveRange() {
|
|
3077
3571
|
if (!clipboardActiveAllowed()) return;
|
|
@@ -3086,7 +3580,7 @@ function DataTable(_props) {
|
|
|
3086
3580
|
for (let c = c0; c <= c1; c++) cols.push("");
|
|
3087
3581
|
grid.push(cols);
|
|
3088
3582
|
}
|
|
3089
|
-
applyGridToRange(grid, r0, c0);
|
|
3583
|
+
applyGridToRange(grid, r0, c0, "cleared");
|
|
3090
3584
|
}
|
|
3091
3585
|
function fillRange(sourceBox, endCell) {
|
|
3092
3586
|
let box;
|
|
@@ -3122,7 +3616,7 @@ function DataTable(_props) {
|
|
|
3122
3616
|
}
|
|
3123
3617
|
grid.push(cols);
|
|
3124
3618
|
}
|
|
3125
|
-
applyGridToRange(grid, box.r0, box.c0);
|
|
3619
|
+
applyGridToRange(grid, box.r0, box.c0, "filled");
|
|
3126
3620
|
}
|
|
3127
3621
|
let fillDragging = false;
|
|
3128
3622
|
let fillDragMove = null;
|
|
@@ -3284,7 +3778,7 @@ function DataTable(_props) {
|
|
|
3284
3778
|
if (cell && (cell.r !== lastCell.r || cell.c !== lastCell.c)) {
|
|
3285
3779
|
lastCell = cell;
|
|
3286
3780
|
rangeDragMoved = true;
|
|
3287
|
-
setRangeFocus$local(cell.r, cell.c);
|
|
3781
|
+
setRangeFocus$local(cell.r, cell.c, anchorR, anchorC);
|
|
3288
3782
|
}
|
|
3289
3783
|
};
|
|
3290
3784
|
const up = () => {
|
|
@@ -3306,6 +3800,7 @@ function DataTable(_props) {
|
|
|
3306
3800
|
}
|
|
3307
3801
|
function isActiveCellEditable() {
|
|
3308
3802
|
if (rowIndexIsGrouped(activeRow())) return false;
|
|
3803
|
+
if (rowIsLazyPlaceholder((rows() || [])[activeRow()])) return false;
|
|
3309
3804
|
const colId = activeCellColumnId();
|
|
3310
3805
|
return colId != null && columnEditable(colId);
|
|
3311
3806
|
}
|
|
@@ -3419,12 +3914,14 @@ function DataTable(_props) {
|
|
|
3419
3914
|
}
|
|
3420
3915
|
function beginEdit(rowIndex, colIndex, seed) {
|
|
3421
3916
|
if (rowIndexIsGrouped(rowIndex)) return;
|
|
3917
|
+
if (rowIsLazyPlaceholder((rows() || [])[rowIndex])) return;
|
|
3422
3918
|
const colId = columnIdAt(rowIndex, colIndex);
|
|
3423
3919
|
if (colId == null || !columnEditable(colId)) return;
|
|
3424
3920
|
committedThisSession = false;
|
|
3425
3921
|
setInvalid("");
|
|
3426
3922
|
setEditingRowIndex(null);
|
|
3427
3923
|
setRowDraft({});
|
|
3924
|
+
rowDraftSync = {};
|
|
3428
3925
|
setEditingRow(rowIndex);
|
|
3429
3926
|
setEditingCol(colIndex);
|
|
3430
3927
|
setDraftValue(seed != null ? seed : cellValueAt(rowIndex, colIndex));
|
|
@@ -3439,6 +3936,11 @@ function DataTable(_props) {
|
|
|
3439
3936
|
const tryFocus = () => {
|
|
3440
3937
|
const el = resolveCellEl(String(row), col);
|
|
3441
3938
|
if (el) {
|
|
3939
|
+
const ae = gridRoot && gridRoot.getRootNode ? gridRoot.getRootNode().activeElement : null;
|
|
3940
|
+
if (ae && ae !== el && gridRoot.contains && gridRoot.contains(ae) && ae.closest) {
|
|
3941
|
+
const aeCell = ae.closest("[data-grid-cell]");
|
|
3942
|
+
if (aeCell && aeCell !== el) return;
|
|
3943
|
+
}
|
|
3442
3944
|
el.focus();
|
|
3443
3945
|
return;
|
|
3444
3946
|
}
|
|
@@ -3462,6 +3964,7 @@ function DataTable(_props) {
|
|
|
3462
3964
|
function endRowEdit() {
|
|
3463
3965
|
setEditingRowIndex(null);
|
|
3464
3966
|
setRowDraft({});
|
|
3967
|
+
rowDraftSync = {};
|
|
3465
3968
|
setInvalidMsg("");
|
|
3466
3969
|
setActiveInControl(false);
|
|
3467
3970
|
setEditVer(editVer() + 1);
|
|
@@ -3475,7 +3978,14 @@ function DataTable(_props) {
|
|
|
3475
3978
|
return editFocusColId() != null && editFocusColId() === colId;
|
|
3476
3979
|
}
|
|
3477
3980
|
function coerceCellValue(colId, raw) {
|
|
3478
|
-
|
|
3981
|
+
const kind = editorTypeOf(colId);
|
|
3982
|
+
if (kind === "checkbox") {
|
|
3983
|
+
if (typeof raw === "boolean") return raw;
|
|
3984
|
+
if (raw == null) return false;
|
|
3985
|
+
if (typeof raw === "number") return raw !== 0;
|
|
3986
|
+
return /^\s*(true|1|yes|y|on)\s*$/i.test(String(raw));
|
|
3987
|
+
}
|
|
3988
|
+
if (kind !== "number") return raw;
|
|
3479
3989
|
if (raw == null) return null;
|
|
3480
3990
|
if (typeof raw === "number") return Number.isNaN(raw) ? null : raw;
|
|
3481
3991
|
const s = String(raw).trim();
|
|
@@ -3531,10 +4041,11 @@ function DataTable(_props) {
|
|
|
3531
4041
|
}
|
|
3532
4042
|
function toggleActiveBooleanCell() {
|
|
3533
4043
|
if (rowIndexIsGrouped(activeRow())) return;
|
|
3534
|
-
const colId = columnIdAt(activeRow(), activeColIndex());
|
|
3535
|
-
if (colId == null || !columnEditable(colId)) return;
|
|
3536
4044
|
const row = (rows() || [])[activeRow()];
|
|
3537
4045
|
if (!row) return;
|
|
4046
|
+
if (rowIsLazyPlaceholder(row)) return;
|
|
4047
|
+
const colId = columnIdAt(activeRow(), activeColIndex());
|
|
4048
|
+
if (colId == null || !columnEditable(colId)) return;
|
|
3538
4049
|
const rowOriginal = row.original;
|
|
3539
4050
|
const rowId = row.id;
|
|
3540
4051
|
const oldValue = cellValueAt(activeRow(), activeColIndex());
|
|
@@ -3616,6 +4127,7 @@ function DataTable(_props) {
|
|
|
3616
4127
|
const rowIndex = rowIndexOf(row);
|
|
3617
4128
|
if (rowIndex < 0) return;
|
|
3618
4129
|
if (rowIndexIsGrouped(rowIndex)) return;
|
|
4130
|
+
if (rowIsLazyPlaceholder((rows() || [])[rowIndex])) return;
|
|
3619
4131
|
const editable = editableColumnsForRow(rowIndex);
|
|
3620
4132
|
if (editable.length === 0) return;
|
|
3621
4133
|
committedThisSession = false;
|
|
@@ -3631,6 +4143,7 @@ function DataTable(_props) {
|
|
|
3631
4143
|
draft[ec.colId] = orig ? orig[ec.field] : null;
|
|
3632
4144
|
}
|
|
3633
4145
|
setRowDraft(draft);
|
|
4146
|
+
rowDraftSync = draft;
|
|
3634
4147
|
setEditingRowIndex(rowIndex);
|
|
3635
4148
|
setActiveInControl(true);
|
|
3636
4149
|
setEditVer(editVer() + 1);
|
|
@@ -3648,7 +4161,7 @@ function DataTable(_props) {
|
|
|
3648
4161
|
const r = (rows() || [])[rowIndex];
|
|
3649
4162
|
const rowOriginal = r ? r.original : null;
|
|
3650
4163
|
const rowId = r ? r.id : null;
|
|
3651
|
-
const draft =
|
|
4164
|
+
const draft = rowDraftSync || {};
|
|
3652
4165
|
for (let i = 0; i < editable.length; i++) {
|
|
3653
4166
|
const ec = editable[i];
|
|
3654
4167
|
const err = runValidator(ec.colId, coerceCellValue(ec.colId, draft[ec.colId]), rowOriginal);
|
|
@@ -3756,6 +4269,8 @@ function DataTable(_props) {
|
|
|
3756
4269
|
let editTransition = false;
|
|
3757
4270
|
let pendingEditFollow = null;
|
|
3758
4271
|
let committedThisSession = false;
|
|
4272
|
+
let rowDraftSync = {};
|
|
4273
|
+
let dropinTabFlush = null;
|
|
3759
4274
|
function inRowEdit() {
|
|
3760
4275
|
return editingRowIndex() != null;
|
|
3761
4276
|
}
|
|
@@ -3771,6 +4286,11 @@ function DataTable(_props) {
|
|
|
3771
4286
|
setRowDraft$local(colId, value);
|
|
3772
4287
|
return;
|
|
3773
4288
|
}
|
|
4289
|
+
if (dropinTabFlush) {
|
|
4290
|
+
dropinTabFlush.called = true;
|
|
4291
|
+
if (commitEdit(value, true)) dropinTabFlush.committed = true;
|
|
4292
|
+
return;
|
|
4293
|
+
}
|
|
3774
4294
|
commitEdit(value);
|
|
3775
4295
|
};
|
|
3776
4296
|
}
|
|
@@ -3800,10 +4320,11 @@ function DataTable(_props) {
|
|
|
3800
4320
|
setDraftValue(v);
|
|
3801
4321
|
}
|
|
3802
4322
|
function setRowDraft$local(colId, value) {
|
|
3803
|
-
const src =
|
|
4323
|
+
const src = rowDraftSync || {};
|
|
3804
4324
|
const next = {};
|
|
3805
4325
|
for (const k in src) next[k] = src[k];
|
|
3806
4326
|
next[colId] = value;
|
|
4327
|
+
rowDraftSync = next;
|
|
3807
4328
|
setRowDraft(next);
|
|
3808
4329
|
}
|
|
3809
4330
|
function rowEditTab(target, backward) {
|
|
@@ -3858,6 +4379,56 @@ function DataTable(_props) {
|
|
|
3858
4379
|
cancelEdit();
|
|
3859
4380
|
}
|
|
3860
4381
|
}
|
|
4382
|
+
function onEditorDropinKeyDown(e) {
|
|
4383
|
+
if (!e) return;
|
|
4384
|
+
const key = e.key;
|
|
4385
|
+
if (inRowEdit()) {
|
|
4386
|
+
if (key === "Enter") {
|
|
4387
|
+
e.preventDefault();
|
|
4388
|
+
commitRow();
|
|
4389
|
+
return;
|
|
4390
|
+
}
|
|
4391
|
+
if (key === "Escape") {
|
|
4392
|
+
e.preventDefault();
|
|
4393
|
+
cancelRow();
|
|
4394
|
+
return;
|
|
4395
|
+
}
|
|
4396
|
+
if (key === "Tab") {
|
|
4397
|
+
e.preventDefault();
|
|
4398
|
+
rowEditTab(e.target, e.shiftKey);
|
|
4399
|
+
return;
|
|
4400
|
+
}
|
|
4401
|
+
return;
|
|
4402
|
+
}
|
|
4403
|
+
if (key !== "Tab" || e.defaultPrevented) return;
|
|
4404
|
+
e.preventDefault();
|
|
4405
|
+
const fromRow = editingRow();
|
|
4406
|
+
const fromCol = editingCol();
|
|
4407
|
+
const target = e.shiftKey ? prevEditableCell(fromRow, fromCol) : nextEditableCell(fromRow, fromCol);
|
|
4408
|
+
const el = e.target;
|
|
4409
|
+
const ownCell = el && el.closest ? el.closest("[data-grid-cell]") : null;
|
|
4410
|
+
const flush = {
|
|
4411
|
+
called: false,
|
|
4412
|
+
committed: false
|
|
4413
|
+
};
|
|
4414
|
+
dropinTabFlush = flush;
|
|
4415
|
+
if (ownCell && ownCell.focus) ownCell.focus();
|
|
4416
|
+
else if (el && el.blur) el.blur();
|
|
4417
|
+
dropinTabFlush = null;
|
|
4418
|
+
if (!flush.called) {
|
|
4419
|
+
onEditorKeyDown(e);
|
|
4420
|
+
return;
|
|
4421
|
+
}
|
|
4422
|
+
if (!flush.committed) {
|
|
4423
|
+
if (el && el.focus) el.focus();
|
|
4424
|
+
return;
|
|
4425
|
+
}
|
|
4426
|
+
if (target) {
|
|
4427
|
+
setActiveRow(target.row);
|
|
4428
|
+
setActiveColIndex(target.col);
|
|
4429
|
+
beginEdit(target.row, target.col, null);
|
|
4430
|
+
} else focusCellWhenReady(fromRow, fromCol);
|
|
4431
|
+
}
|
|
3861
4432
|
function onEditorBlur(e) {
|
|
3862
4433
|
if (inRowEdit()) {
|
|
3863
4434
|
if (editTransition) return;
|
|
@@ -3870,13 +4441,20 @@ function DataTable(_props) {
|
|
|
3870
4441
|
}
|
|
3871
4442
|
if (editingRow() < 0 || editTransition) return;
|
|
3872
4443
|
const next = e ? e.relatedTarget : null;
|
|
3873
|
-
|
|
4444
|
+
const fromCell = e && e.target && e.target.closest ? e.target.closest("[data-grid-cell]") : null;
|
|
4445
|
+
if (next == null) {
|
|
4446
|
+
if (!outsidePointerDown) return;
|
|
4447
|
+
outsidePointerDown = false;
|
|
4448
|
+
if (!fromCell) return;
|
|
4449
|
+
if (fromCell.getAttribute("data-row") !== String(editingRow()) || fromCell.getAttribute("data-col-index") !== String(editingCol())) return;
|
|
4450
|
+
commitEdit(void 0, true);
|
|
4451
|
+
return;
|
|
4452
|
+
}
|
|
3874
4453
|
if (!(gridRoot && gridRoot.contains && gridRoot.contains(next))) {
|
|
3875
4454
|
commitEdit(void 0);
|
|
3876
4455
|
return;
|
|
3877
4456
|
}
|
|
3878
4457
|
const nextCell = next.closest ? next.closest("[data-grid-cell]") : null;
|
|
3879
|
-
const fromCell = e && e.target && e.target.closest ? e.target.closest("[data-grid-cell]") : null;
|
|
3880
4458
|
if (!nextCell || !fromCell || nextCell === fromCell) return;
|
|
3881
4459
|
const fromRow = fromCell.getAttribute("data-row");
|
|
3882
4460
|
const fromCol = fromCell.getAttribute("data-col-index");
|
|
@@ -4042,545 +4620,1943 @@ function DataTable(_props) {
|
|
|
4042
4620
|
if (!col || !col.getFacetedMinMaxValues) return null;
|
|
4043
4621
|
return col.getFacetedMinMaxValues() || null;
|
|
4044
4622
|
}
|
|
4045
|
-
return
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4623
|
+
return createComponent(__ctx_data_table_columns.Provider, {
|
|
4624
|
+
value: {
|
|
4625
|
+
registerColumn: (id, spec) => {
|
|
4626
|
+
if (id == null) return;
|
|
4627
|
+
const key = String(id);
|
|
4628
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") return;
|
|
4629
|
+
const prev = colReg() ? colReg()[key] : void 0;
|
|
4630
|
+
if (prev !== void 0 && columnSpecsEquivalent(prev, spec)) return;
|
|
4631
|
+
setColReg({
|
|
4632
|
+
...colReg(),
|
|
4633
|
+
[key]: spec
|
|
4634
|
+
});
|
|
4635
|
+
},
|
|
4636
|
+
unregisterColumn: (id) => {
|
|
4637
|
+
if (id == null) return;
|
|
4638
|
+
const r = { ...colReg() };
|
|
4639
|
+
delete r[String(id)];
|
|
4640
|
+
setColReg(r);
|
|
4641
|
+
}
|
|
4054
4642
|
},
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4643
|
+
get children() {
|
|
4644
|
+
var _el$ = _tmpl$$11(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild;
|
|
4645
|
+
use((el) => {
|
|
4646
|
+
__rozieRootRef = el;
|
|
4647
|
+
}, _el$);
|
|
4648
|
+
_el$2.style.setProperty("display", "none");
|
|
4649
|
+
insert(_el$2, resolved);
|
|
4650
|
+
insert(_el$, () => createComponent(Show, {
|
|
4651
|
+
get when() {
|
|
4652
|
+
return !!invalidMsg();
|
|
4653
|
+
},
|
|
4654
|
+
get children() {
|
|
4655
|
+
var _el$5 = _tmpl$2$4();
|
|
4656
|
+
insert(_el$5, invalidMsg);
|
|
4657
|
+
return _el$5;
|
|
4658
|
+
}
|
|
4659
|
+
}), _el$3);
|
|
4660
|
+
insert(_el$, () => createComponent(Show, {
|
|
4661
|
+
get when() {
|
|
4662
|
+
return !!pasteAnnounce();
|
|
4663
|
+
},
|
|
4664
|
+
get children() {
|
|
4665
|
+
var _el$6 = _tmpl$3$1();
|
|
4666
|
+
insert(_el$6, pasteAnnounce);
|
|
4667
|
+
return _el$6;
|
|
4668
|
+
}
|
|
4669
|
+
}), _el$3);
|
|
4670
|
+
insert(_el$, () => createComponent(Show, {
|
|
4671
|
+
get when() {
|
|
4672
|
+
return !!rangeAnnounce();
|
|
4673
|
+
},
|
|
4674
|
+
get children() {
|
|
4675
|
+
var _el$7 = _tmpl$4$1();
|
|
4676
|
+
insert(_el$7, rangeAnnounce);
|
|
4677
|
+
return _el$7;
|
|
4678
|
+
}
|
|
4679
|
+
}), _el$3);
|
|
4680
|
+
insert(_el$, () => createComponent(Show, {
|
|
4681
|
+
get when() {
|
|
4682
|
+
return !!liveAnnounce();
|
|
4683
|
+
},
|
|
4684
|
+
get children() {
|
|
4685
|
+
var _el$8 = _tmpl$5$1();
|
|
4686
|
+
insert(_el$8, liveAnnounce);
|
|
4687
|
+
return _el$8;
|
|
4688
|
+
}
|
|
4689
|
+
}), _el$3);
|
|
4690
|
+
_el$4.$$input = ($event) => {
|
|
4691
|
+
onGlobalFilterInput($event);
|
|
4692
|
+
};
|
|
4693
|
+
insert(_el$3, () => createComponent(Show, {
|
|
4694
|
+
get when() {
|
|
4695
|
+
return allLeafColumns().length;
|
|
4696
|
+
},
|
|
4697
|
+
get children() {
|
|
4698
|
+
var _el$9 = _tmpl$6(), _el$1 = _el$9.firstChild.nextSibling;
|
|
4699
|
+
insert(_el$1, createComponent(Key, {
|
|
4700
|
+
get each() {
|
|
4701
|
+
return allLeafColumns();
|
|
4702
|
+
},
|
|
4703
|
+
by: (lc) => lc.id,
|
|
4704
|
+
children: (lc) => (() => {
|
|
4705
|
+
var _el$10 = _tmpl$7(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling;
|
|
4706
|
+
_el$11.addEventListener("change", ($event) => {
|
|
4707
|
+
onToggleVisibility(lc().id);
|
|
4708
|
+
});
|
|
4709
|
+
insert(_el$12, () => rozieDisplay(lc().label));
|
|
4710
|
+
effect(() => _el$11.checked = lc().visible);
|
|
4711
|
+
return _el$10;
|
|
4712
|
+
})()
|
|
4713
|
+
}));
|
|
4714
|
+
return _el$9;
|
|
4715
|
+
}
|
|
4716
|
+
}), null);
|
|
4717
|
+
insert(_el$, () => createComponent(Show, {
|
|
4718
|
+
get when() {
|
|
4719
|
+
return local.groupable;
|
|
4720
|
+
},
|
|
4721
|
+
get children() {
|
|
4722
|
+
var _el$13 = _tmpl$8();
|
|
4723
|
+
insert(_el$13, () => (_props.groupBarSlot ?? _props.slots?.["groupBar"])?.({
|
|
4724
|
+
get grouping() {
|
|
4725
|
+
return groupingKeys();
|
|
4726
|
+
},
|
|
4727
|
+
get groupableColumns() {
|
|
4728
|
+
return groupableColumns();
|
|
4729
|
+
},
|
|
4730
|
+
applyGrouping,
|
|
4731
|
+
clearGrouping
|
|
4732
|
+
}) ?? createComponent(Key, {
|
|
4733
|
+
get each() {
|
|
4734
|
+
return groupingKeys();
|
|
4735
|
+
},
|
|
4736
|
+
by: (gk) => gk,
|
|
4737
|
+
children: (gk) => (() => {
|
|
4738
|
+
var _el$14 = _tmpl$9();
|
|
4739
|
+
insert(_el$14, () => rozieDisplay(gk()));
|
|
4740
|
+
return _el$14;
|
|
4741
|
+
})()
|
|
4742
|
+
}));
|
|
4743
|
+
return _el$13;
|
|
4744
|
+
}
|
|
4745
|
+
}), null);
|
|
4746
|
+
insert(_el$, () => createComponent(Show, {
|
|
4747
|
+
get when() {
|
|
4748
|
+
return isWindowed();
|
|
4749
|
+
},
|
|
4750
|
+
get fallback() {
|
|
4751
|
+
return (() => {
|
|
4752
|
+
var _el$23 = _tmpl$1(), _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling;
|
|
4753
|
+
_el$23.$$click = ($event) => {
|
|
4754
|
+
onGridClick($event);
|
|
4755
|
+
};
|
|
4756
|
+
_el$23.$$dblclick = ($event) => {
|
|
4757
|
+
onGridDblClick($event);
|
|
4758
|
+
};
|
|
4759
|
+
_el$23.$$mousedown = ($event) => {
|
|
4760
|
+
onGridMouseDown($event);
|
|
4761
|
+
};
|
|
4762
|
+
_el$23.$$focusout = ($event) => {
|
|
4763
|
+
onGridFocusOut($event);
|
|
4764
|
+
};
|
|
4765
|
+
_el$23.$$focusin = ($event) => {
|
|
4766
|
+
syncActiveFromEvent($event);
|
|
4767
|
+
};
|
|
4768
|
+
_el$23.$$keydown = ($event) => {
|
|
4769
|
+
onGridKeyDown($event);
|
|
4770
|
+
};
|
|
4771
|
+
insert(_el$24, createComponent(Key, {
|
|
4772
|
+
get each() {
|
|
4773
|
+
return headerGroups();
|
|
4774
|
+
},
|
|
4775
|
+
by: (hg) => hg.id,
|
|
4776
|
+
children: (hg, hgLevel) => (() => {
|
|
4777
|
+
var _el$26 = _tmpl$10();
|
|
4778
|
+
insert(_el$26, createComponent(Key, {
|
|
4779
|
+
get each() {
|
|
4780
|
+
return hg().headers;
|
|
4781
|
+
},
|
|
4782
|
+
by: (header) => header.id,
|
|
4783
|
+
children: (header) => (() => {
|
|
4784
|
+
var _el$27 = _tmpl$11();
|
|
4785
|
+
insert(_el$27, () => createComponent(Show, {
|
|
4786
|
+
get when() {
|
|
4787
|
+
return isSelectColumn(header().column.id);
|
|
4788
|
+
},
|
|
4789
|
+
get fallback() {
|
|
4790
|
+
return createComponent(Show, {
|
|
4791
|
+
get when() {
|
|
4792
|
+
return isExpanderColumn(header().column.id);
|
|
4793
|
+
},
|
|
4794
|
+
get fallback() {
|
|
4795
|
+
return (() => {
|
|
4796
|
+
var _el$30 = _tmpl$14(), _el$37 = _el$30.firstChild;
|
|
4797
|
+
_el$30.style.setProperty("display", "contents");
|
|
4798
|
+
insert(_el$30, () => createComponent(Show, {
|
|
4799
|
+
get when() {
|
|
4800
|
+
return memo(() => !!header().column.getCanSort)() && header().column.getCanSort();
|
|
4801
|
+
},
|
|
4802
|
+
get fallback() {
|
|
4803
|
+
return (() => {
|
|
4804
|
+
var _el$41 = _tmpl$16(), _el$42 = _el$41.firstChild;
|
|
4805
|
+
_el$41.style.setProperty("display", "contents");
|
|
4806
|
+
insert(_el$42, () => _props.slots?.[`colHeader-${header().column.id}`]?.({
|
|
4807
|
+
get columnId() {
|
|
4808
|
+
return header().column.id;
|
|
4809
|
+
},
|
|
4810
|
+
get column() {
|
|
4811
|
+
return header().column;
|
|
4812
|
+
},
|
|
4813
|
+
get label() {
|
|
4814
|
+
return headerLabel(header().column.id);
|
|
4815
|
+
}
|
|
4816
|
+
}) ?? (_props.colHeaderSlot ?? _props.slots?.["colHeader"])?.({
|
|
4817
|
+
get columnId() {
|
|
4818
|
+
return header().column.id;
|
|
4819
|
+
},
|
|
4820
|
+
get column() {
|
|
4821
|
+
return header().column;
|
|
4822
|
+
},
|
|
4823
|
+
get label() {
|
|
4824
|
+
return headerLabel(header().column.id);
|
|
4825
|
+
}
|
|
4826
|
+
}) ?? rozieDisplay(headerLabel(header().column.id)));
|
|
4827
|
+
return _el$41;
|
|
4828
|
+
})();
|
|
4829
|
+
},
|
|
4830
|
+
get children() {
|
|
4831
|
+
var _el$38 = _tmpl$15(), _el$39 = _el$38.firstChild, _el$40 = _el$39.nextSibling;
|
|
4832
|
+
_el$38.$$click = ($event) => {
|
|
4833
|
+
onHeaderSort(header().column.id, $event);
|
|
4834
|
+
};
|
|
4835
|
+
insert(_el$39, () => _props.slots?.[`colHeader-${header().column.id}`]?.({
|
|
4836
|
+
get columnId() {
|
|
4837
|
+
return header().column.id;
|
|
4838
|
+
},
|
|
4839
|
+
get column() {
|
|
4840
|
+
return header().column;
|
|
4841
|
+
},
|
|
4842
|
+
get label() {
|
|
4843
|
+
return headerLabel(header().column.id);
|
|
4844
|
+
}
|
|
4845
|
+
}) ?? (_props.colHeaderSlot ?? _props.slots?.["colHeader"])?.({
|
|
4846
|
+
get columnId() {
|
|
4847
|
+
return header().column.id;
|
|
4848
|
+
},
|
|
4849
|
+
get column() {
|
|
4850
|
+
return header().column;
|
|
4851
|
+
},
|
|
4852
|
+
get label() {
|
|
4853
|
+
return headerLabel(header().column.id);
|
|
4854
|
+
}
|
|
4855
|
+
}) ?? rozieDisplay(headerLabel(header().column.id)));
|
|
4856
|
+
insert(_el$40, () => rozieDisplay(sortIndicator(header().column.id)));
|
|
4857
|
+
return _el$38;
|
|
4858
|
+
}
|
|
4859
|
+
}), _el$37);
|
|
4860
|
+
insert(_el$30, createComponent(Popover, {
|
|
4861
|
+
trigger: "click",
|
|
4862
|
+
placement: "bottom-end",
|
|
4863
|
+
strategy: "fixed",
|
|
4864
|
+
offset: 4,
|
|
4865
|
+
"data-rozie-s-d5dcab4c": "",
|
|
4866
|
+
anchorSlot: () => (() => {
|
|
4867
|
+
var _el$43 = _tmpl$17();
|
|
4868
|
+
effect(() => setAttribute(_el$43, "aria-label", rozieAttr("Column options for " + headerLabel(header().column.id))));
|
|
4869
|
+
return _el$43;
|
|
4870
|
+
})(),
|
|
4871
|
+
get children() {
|
|
4872
|
+
var _el$31 = _tmpl$13(), _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling, _el$34 = _el$33.nextSibling, _el$36 = _el$34.nextSibling.nextSibling;
|
|
4873
|
+
_el$32.$$click = ($event) => {
|
|
4874
|
+
onPinColumn(header().column.id, "left", $event);
|
|
4875
|
+
};
|
|
4876
|
+
_el$33.$$click = ($event) => {
|
|
4877
|
+
onPinColumn(header().column.id, "right", $event);
|
|
4878
|
+
};
|
|
4879
|
+
_el$34.$$click = ($event) => {
|
|
4880
|
+
onPinColumn(header().column.id, false, $event);
|
|
4881
|
+
};
|
|
4882
|
+
_el$36.$$click = ($event) => {
|
|
4883
|
+
onHideColumn(header().column.id, $event);
|
|
4884
|
+
};
|
|
4885
|
+
effect((_p$) => {
|
|
4886
|
+
var _v$21 = columnPinSide(header().column.id) === "left", _v$22 = columnPinSide(header().column.id) === "right", _v$23 = !columnPinSide(header().column.id);
|
|
4887
|
+
_v$21 !== _p$.e && setAttribute(_el$32, "aria-pressed", _p$.e = _v$21);
|
|
4888
|
+
_v$22 !== _p$.t && setAttribute(_el$33, "aria-pressed", _p$.t = _v$22);
|
|
4889
|
+
_v$23 !== _p$.a && setAttribute(_el$34, "aria-pressed", _p$.a = _v$23);
|
|
4890
|
+
return _p$;
|
|
4891
|
+
}, {
|
|
4892
|
+
e: void 0,
|
|
4893
|
+
t: void 0,
|
|
4894
|
+
a: void 0
|
|
4895
|
+
});
|
|
4896
|
+
return _el$31;
|
|
4897
|
+
}
|
|
4898
|
+
}), _el$37);
|
|
4899
|
+
_el$37.$$touchstart = ($event) => {
|
|
4900
|
+
onResizeStart(header().column.id, $event);
|
|
4901
|
+
};
|
|
4902
|
+
_el$37.$$pointerdown = ($event) => {
|
|
4903
|
+
onResizeStart(header().column.id, $event);
|
|
4904
|
+
};
|
|
4905
|
+
effect(() => setAttribute(_el$37, "aria-label", rozieAttr("Resize " + headerLabel(header().column.id))));
|
|
4906
|
+
return _el$30;
|
|
4907
|
+
})();
|
|
4908
|
+
},
|
|
4909
|
+
get children() {
|
|
4910
|
+
var _el$29 = _tmpl$12();
|
|
4911
|
+
_el$29.style.setProperty("display", "contents");
|
|
4912
|
+
return _el$29;
|
|
4913
|
+
}
|
|
4914
|
+
});
|
|
4915
|
+
},
|
|
4916
|
+
get children() {
|
|
4917
|
+
var _el$28 = _tmpl$12();
|
|
4918
|
+
_el$28.style.setProperty("display", "contents");
|
|
4919
|
+
insert(_el$28, () => (_props.selectAllSlot ?? _props.slots?.["selectAll"])?.({
|
|
4920
|
+
get checked() {
|
|
4921
|
+
return isAllRowsSelected();
|
|
4922
|
+
},
|
|
4923
|
+
get indeterminate() {
|
|
4924
|
+
return isSomeRowsSelected();
|
|
4925
|
+
},
|
|
4926
|
+
get toggle() {
|
|
4927
|
+
return onToggleAllRows;
|
|
4928
|
+
}
|
|
4929
|
+
}) ?? createComponent(Show, {
|
|
4930
|
+
get when() {
|
|
4931
|
+
return local.selectionMode === "multiple";
|
|
4932
|
+
},
|
|
4933
|
+
get children() {
|
|
4934
|
+
var _el$44 = _tmpl$18();
|
|
4935
|
+
_el$44.addEventListener("change", ($event) => {
|
|
4936
|
+
onToggleAllRows($event);
|
|
4937
|
+
});
|
|
4938
|
+
effect(() => _el$44.checked = isAllRowsSelected());
|
|
4939
|
+
return _el$44;
|
|
4940
|
+
}
|
|
4941
|
+
}));
|
|
4942
|
+
return _el$28;
|
|
4943
|
+
}
|
|
4944
|
+
}));
|
|
4945
|
+
effect((_p$) => {
|
|
4946
|
+
var _v$12 = "rdt-th " + rozieClass({
|
|
4947
|
+
"rdt-select-th": isSelectColumn(header().column.id),
|
|
4948
|
+
"rdt-expander-th": isExpanderColumn(header().column.id),
|
|
4949
|
+
"rdt-pinned": columnPinSide(header().column.id) !== "",
|
|
4950
|
+
"rdt-th-resizing": columnIsResizing(header().column.id),
|
|
4951
|
+
"rdt-cell-active": isActiveCell("__header", headerColIndexOf(hg(), header()), hgLevel())
|
|
4952
|
+
}), _v$13 = rozieAttr(header().column.id), _v$14 = rozieAttr(hgLevel()), _v$15 = rozieAttr(header().colSpan > 1 ? header().colSpan : null), _v$16 = rozieAttr(headerColIndexOf(hg(), header())), _v$17 = rozieAttr(headerLeafStart(hg(), header()) + 1), _v$18 = rozieAttr(cellTabindex("__header", headerColIndexOf(hg(), header()), hgLevel())), _v$19 = rozieAttr(ariaSortFor(header().column.id)), _v$20 = parseInlineStyle(thStyle(header()));
|
|
4953
|
+
_v$12 !== _p$.e && className(_el$27, _p$.e = _v$12);
|
|
4954
|
+
_v$13 !== _p$.t && setAttribute(_el$27, "data-col", _p$.t = _v$13);
|
|
4955
|
+
_v$14 !== _p$.a && setAttribute(_el$27, "data-header-level", _p$.a = _v$14);
|
|
4956
|
+
_v$15 !== _p$.o && setAttribute(_el$27, "colspan", _p$.o = _v$15);
|
|
4957
|
+
_v$16 !== _p$.i && setAttribute(_el$27, "data-col-index", _p$.i = _v$16);
|
|
4958
|
+
_v$17 !== _p$.n && setAttribute(_el$27, "aria-colindex", _p$.n = _v$17);
|
|
4959
|
+
_v$18 !== _p$.s && setAttribute(_el$27, "tabindex", _p$.s = _v$18);
|
|
4960
|
+
_v$19 !== _p$.h && setAttribute(_el$27, "aria-sort", _p$.h = _v$19);
|
|
4961
|
+
_p$.r = style(_el$27, _v$20, _p$.r);
|
|
4962
|
+
return _p$;
|
|
4963
|
+
}, {
|
|
4964
|
+
e: void 0,
|
|
4965
|
+
t: void 0,
|
|
4966
|
+
a: void 0,
|
|
4967
|
+
o: void 0,
|
|
4968
|
+
i: void 0,
|
|
4969
|
+
n: void 0,
|
|
4970
|
+
s: void 0,
|
|
4971
|
+
h: void 0,
|
|
4972
|
+
r: void 0
|
|
4973
|
+
});
|
|
4974
|
+
return _el$27;
|
|
4975
|
+
})()
|
|
4976
|
+
}));
|
|
4977
|
+
effect(() => setAttribute(_el$26, "aria-rowindex", rozieAttr(hgLevel() + 1)));
|
|
4978
|
+
return _el$26;
|
|
4979
|
+
})()
|
|
4980
|
+
}), null);
|
|
4981
|
+
insert(_el$24, () => createComponent(Show, {
|
|
4982
|
+
get when() {
|
|
4983
|
+
return hasAnyFilterableColumn();
|
|
4984
|
+
},
|
|
4985
|
+
get children() {
|
|
4986
|
+
var _el$45 = _tmpl$19();
|
|
4987
|
+
insert(_el$45, createComponent(Key, {
|
|
4988
|
+
get each() {
|
|
4989
|
+
return headerGroups()[headerGroups().length - 1].headers;
|
|
4990
|
+
},
|
|
4991
|
+
by: (header) => header.id,
|
|
4992
|
+
children: (header) => (() => {
|
|
4993
|
+
var _el$46 = _tmpl$20();
|
|
4994
|
+
insert(_el$46, () => createComponent(Show, {
|
|
4995
|
+
get when() {
|
|
4996
|
+
return isSelectColumn(header().column.id);
|
|
4997
|
+
},
|
|
4998
|
+
get fallback() {
|
|
4999
|
+
return createComponent(Show, {
|
|
5000
|
+
get when() {
|
|
5001
|
+
return isExpanderColumn(header().column.id);
|
|
5002
|
+
},
|
|
5003
|
+
get fallback() {
|
|
5004
|
+
return (() => {
|
|
5005
|
+
var _el$49 = _tmpl$12();
|
|
5006
|
+
_el$49.style.setProperty("display", "contents");
|
|
5007
|
+
insert(_el$49, () => createComponent(Show, {
|
|
5008
|
+
get when() {
|
|
5009
|
+
return columnIsFilterable(header().column.id);
|
|
5010
|
+
},
|
|
5011
|
+
get children() {
|
|
5012
|
+
var _el$50 = _tmpl$12();
|
|
5013
|
+
_el$50.style.setProperty("display", "contents");
|
|
5014
|
+
insert(_el$50, () => _props.slots?.[`filter-${header().column.id}`]?.({
|
|
5015
|
+
get columnId() {
|
|
5016
|
+
return header().column.id;
|
|
5017
|
+
},
|
|
5018
|
+
get value() {
|
|
5019
|
+
return columnFilterValue(header().column.id);
|
|
5020
|
+
},
|
|
5021
|
+
get uniqueValues() {
|
|
5022
|
+
return getFacetedUniqueValues$1(header().column.id);
|
|
5023
|
+
},
|
|
5024
|
+
get minMax() {
|
|
5025
|
+
return getFacetedMinMaxValues$1(header().column.id);
|
|
5026
|
+
},
|
|
5027
|
+
get columnLabel() {
|
|
5028
|
+
return headerLabel(header().column.id);
|
|
5029
|
+
},
|
|
5030
|
+
get setFilter() {
|
|
5031
|
+
return setColumnFilter;
|
|
5032
|
+
}
|
|
5033
|
+
}) ?? (_props.filterSlot ?? _props.slots?.["filter"])?.({
|
|
5034
|
+
get columnId() {
|
|
5035
|
+
return header().column.id;
|
|
5036
|
+
},
|
|
5037
|
+
get value() {
|
|
5038
|
+
return columnFilterValue(header().column.id);
|
|
5039
|
+
},
|
|
5040
|
+
get uniqueValues() {
|
|
5041
|
+
return getFacetedUniqueValues$1(header().column.id);
|
|
5042
|
+
},
|
|
5043
|
+
get minMax() {
|
|
5044
|
+
return getFacetedMinMaxValues$1(header().column.id);
|
|
5045
|
+
},
|
|
5046
|
+
get columnLabel() {
|
|
5047
|
+
return headerLabel(header().column.id);
|
|
5048
|
+
},
|
|
5049
|
+
get setFilter() {
|
|
5050
|
+
return setColumnFilter;
|
|
5051
|
+
}
|
|
5052
|
+
}) ?? (() => {
|
|
5053
|
+
var _el$51 = _tmpl$21();
|
|
5054
|
+
_el$51.$$click = ($event) => {
|
|
5055
|
+
stopEvent($event);
|
|
5056
|
+
};
|
|
5057
|
+
_el$51.$$input = ($event) => {
|
|
5058
|
+
onColumnFilterInput(header().column.id, $event);
|
|
5059
|
+
};
|
|
5060
|
+
effect(() => setAttribute(_el$51, "aria-label", rozieAttr("Filter " + headerLabel(header().column.id))));
|
|
5061
|
+
effect(() => _el$51.value = columnFilterValue(header().column.id));
|
|
5062
|
+
return _el$51;
|
|
5063
|
+
})());
|
|
5064
|
+
return _el$50;
|
|
5065
|
+
}
|
|
5066
|
+
}));
|
|
5067
|
+
return _el$49;
|
|
5068
|
+
})();
|
|
5069
|
+
},
|
|
5070
|
+
get children() {
|
|
5071
|
+
var _el$48 = _tmpl$12();
|
|
5072
|
+
_el$48.style.setProperty("display", "contents");
|
|
5073
|
+
return _el$48;
|
|
5074
|
+
}
|
|
5075
|
+
});
|
|
5076
|
+
},
|
|
5077
|
+
get children() {
|
|
5078
|
+
var _el$47 = _tmpl$12();
|
|
5079
|
+
_el$47.style.setProperty("display", "contents");
|
|
5080
|
+
return _el$47;
|
|
5081
|
+
}
|
|
5082
|
+
}));
|
|
5083
|
+
effect((_p$) => {
|
|
5084
|
+
var _v$24 = "rdt-filter-cell " + rozieClass({ "rdt-pinned": columnPinSide(header().column.id) !== "" }), _v$25 = parseInlineStyle(pinStyle(header().column.id));
|
|
5085
|
+
_v$24 !== _p$.e && className(_el$46, _p$.e = _v$24);
|
|
5086
|
+
_p$.t = style(_el$46, _v$25, _p$.t);
|
|
5087
|
+
return _p$;
|
|
5088
|
+
}, {
|
|
5089
|
+
e: void 0,
|
|
5090
|
+
t: void 0
|
|
5091
|
+
});
|
|
5092
|
+
return _el$46;
|
|
5093
|
+
})()
|
|
5094
|
+
}));
|
|
5095
|
+
return _el$45;
|
|
5096
|
+
}
|
|
5097
|
+
}), null);
|
|
5098
|
+
insert(_el$25, createComponent(Key, {
|
|
5099
|
+
get each() {
|
|
5100
|
+
return rows();
|
|
5101
|
+
},
|
|
5102
|
+
by: (row) => row.id,
|
|
5103
|
+
children: (row) => [(() => {
|
|
5104
|
+
var _el$52 = _tmpl$22();
|
|
5105
|
+
insert(_el$52, createComponent(Key, {
|
|
5106
|
+
get each() {
|
|
5107
|
+
return visibleCellsFor(row());
|
|
5108
|
+
},
|
|
5109
|
+
by: (cell) => cell.id,
|
|
5110
|
+
children: (cell) => (() => {
|
|
5111
|
+
var _el$53 = _tmpl$23();
|
|
5112
|
+
insert(_el$53, () => createComponent(Show, {
|
|
5113
|
+
get when() {
|
|
5114
|
+
return isExpanderColumn(cell().column.id);
|
|
5115
|
+
},
|
|
5116
|
+
get fallback() {
|
|
5117
|
+
return createComponent(Show, {
|
|
5118
|
+
get when() {
|
|
5119
|
+
return isSelectColumn(cell().column.id);
|
|
5120
|
+
},
|
|
5121
|
+
get fallback() {
|
|
5122
|
+
return createComponent(Show, {
|
|
5123
|
+
get when() {
|
|
5124
|
+
return cellIsGrouped(cell());
|
|
5125
|
+
},
|
|
5126
|
+
get fallback() {
|
|
5127
|
+
return createComponent(Show, {
|
|
5128
|
+
get when() {
|
|
5129
|
+
return isEditing(rowIndexOf(row()), colIndexOf(row(), cell()));
|
|
5130
|
+
},
|
|
5131
|
+
get fallback() {
|
|
5132
|
+
return createComponent(Show, {
|
|
5133
|
+
get when() {
|
|
5134
|
+
return cellIsPlaceholder(cell());
|
|
5135
|
+
},
|
|
5136
|
+
get fallback() {
|
|
5137
|
+
return (() => {
|
|
5138
|
+
var _el$62 = _tmpl$25();
|
|
5139
|
+
insert(_el$62, () => _props.slots?.[`cell-${cell().column.id}`]?.({
|
|
5140
|
+
get columnId() {
|
|
5141
|
+
return cell().column.id;
|
|
5142
|
+
},
|
|
5143
|
+
get column() {
|
|
5144
|
+
return cell().column;
|
|
5145
|
+
},
|
|
5146
|
+
get row() {
|
|
5147
|
+
return cellSlotRow(row());
|
|
5148
|
+
},
|
|
5149
|
+
get value() {
|
|
5150
|
+
return cell().getValue();
|
|
5151
|
+
}
|
|
5152
|
+
}) ?? (_props.cellSlot ?? _props.slots?.["cell"])?.({
|
|
5153
|
+
get columnId() {
|
|
5154
|
+
return cell().column.id;
|
|
5155
|
+
},
|
|
5156
|
+
get column() {
|
|
5157
|
+
return cell().column;
|
|
5158
|
+
},
|
|
5159
|
+
get row() {
|
|
5160
|
+
return cellSlotRow(row());
|
|
5161
|
+
},
|
|
5162
|
+
get value() {
|
|
5163
|
+
return cell().getValue();
|
|
5164
|
+
}
|
|
5165
|
+
}) ?? rozieDisplay(cell().getValue()));
|
|
5166
|
+
return _el$62;
|
|
5167
|
+
})();
|
|
5168
|
+
},
|
|
5169
|
+
get children() {
|
|
5170
|
+
var _el$61 = _tmpl$12();
|
|
5171
|
+
_el$61.style.setProperty("display", "contents");
|
|
5172
|
+
return _el$61;
|
|
5173
|
+
}
|
|
5174
|
+
});
|
|
5175
|
+
},
|
|
5176
|
+
get children() {
|
|
5177
|
+
var _el$60 = _tmpl$12();
|
|
5178
|
+
_el$60.style.setProperty("display", "contents");
|
|
5179
|
+
insert(_el$60, () => createComponent(Show, {
|
|
5180
|
+
get when() {
|
|
5181
|
+
return editorTypeOf(cell().column.id) === "number";
|
|
5182
|
+
},
|
|
5183
|
+
get fallback() {
|
|
5184
|
+
return createComponent(Show, {
|
|
5185
|
+
get when() {
|
|
5186
|
+
return editorTypeOf(cell().column.id) === "select";
|
|
5187
|
+
},
|
|
5188
|
+
get fallback() {
|
|
5189
|
+
return createComponent(Show, {
|
|
5190
|
+
get when() {
|
|
5191
|
+
return editorTypeOf(cell().column.id) === "checkbox";
|
|
5192
|
+
},
|
|
5193
|
+
get fallback() {
|
|
5194
|
+
return createComponent(Show, {
|
|
5195
|
+
get when() {
|
|
5196
|
+
return editorTypeOf(cell().column.id) === "custom";
|
|
5197
|
+
},
|
|
5198
|
+
get fallback() {
|
|
5199
|
+
return (() => {
|
|
5200
|
+
var _el$67 = _tmpl$29();
|
|
5201
|
+
_el$67.addEventListener("blur", ($event) => {
|
|
5202
|
+
onEditorBlur($event);
|
|
5203
|
+
});
|
|
5204
|
+
_el$67.$$keydown = ($event) => {
|
|
5205
|
+
onEditorKeyDown($event);
|
|
5206
|
+
};
|
|
5207
|
+
_el$67.$$input = ($event) => {
|
|
5208
|
+
onCellEditorInput(cell().column.id, $event);
|
|
5209
|
+
};
|
|
5210
|
+
effect(() => setAttribute(_el$67, "aria-invalid", rozieAttr(invalidMsg() ? "true" : null)));
|
|
5211
|
+
effect(() => _el$67.value = editorValueFor(cell().column.id));
|
|
5212
|
+
return _el$67;
|
|
5213
|
+
})();
|
|
5214
|
+
},
|
|
5215
|
+
get children() {
|
|
5216
|
+
var _el$66 = _tmpl$12();
|
|
5217
|
+
_el$66.$$keydown = ($event) => {
|
|
5218
|
+
onEditorDropinKeyDown($event);
|
|
5219
|
+
};
|
|
5220
|
+
_el$66.style.setProperty("display", "contents");
|
|
5221
|
+
insert(_el$66, () => _props.slots?.[`editor-${cell().column.id}`]?.({
|
|
5222
|
+
get columnId() {
|
|
5223
|
+
return cell().column.id;
|
|
5224
|
+
},
|
|
5225
|
+
get column() {
|
|
5226
|
+
return cell().column;
|
|
5227
|
+
},
|
|
5228
|
+
get row() {
|
|
5229
|
+
return cellSlotRow(row());
|
|
5230
|
+
},
|
|
5231
|
+
get value() {
|
|
5232
|
+
return editorValueFor(cell().column.id);
|
|
5233
|
+
},
|
|
5234
|
+
get commit() {
|
|
5235
|
+
return editorCommitFor(cell().column.id);
|
|
5236
|
+
},
|
|
5237
|
+
get cancel() {
|
|
5238
|
+
return editorCancelFor();
|
|
5239
|
+
},
|
|
5240
|
+
get columnLabel() {
|
|
5241
|
+
return headerLabel(cell().column.id);
|
|
5242
|
+
},
|
|
5243
|
+
get autofocus() {
|
|
5244
|
+
return editorAutofocusFor(cell().column.id, rowIndexOf(row()));
|
|
5245
|
+
}
|
|
5246
|
+
}) ?? (_props.editorSlot ?? _props.slots?.["editor"])?.({
|
|
5247
|
+
get columnId() {
|
|
5248
|
+
return cell().column.id;
|
|
5249
|
+
},
|
|
5250
|
+
get column() {
|
|
5251
|
+
return cell().column;
|
|
5252
|
+
},
|
|
5253
|
+
get row() {
|
|
5254
|
+
return cellSlotRow(row());
|
|
5255
|
+
},
|
|
5256
|
+
get value() {
|
|
5257
|
+
return editorValueFor(cell().column.id);
|
|
5258
|
+
},
|
|
5259
|
+
get commit() {
|
|
5260
|
+
return editorCommitFor(cell().column.id);
|
|
5261
|
+
},
|
|
5262
|
+
get cancel() {
|
|
5263
|
+
return editorCancelFor();
|
|
5264
|
+
},
|
|
5265
|
+
get columnLabel() {
|
|
5266
|
+
return headerLabel(cell().column.id);
|
|
5267
|
+
},
|
|
5268
|
+
get autofocus() {
|
|
5269
|
+
return editorAutofocusFor(cell().column.id, rowIndexOf(row()));
|
|
5270
|
+
}
|
|
5271
|
+
}) ?? (() => {
|
|
5272
|
+
var _el$68 = _tmpl$29();
|
|
5273
|
+
_el$68.addEventListener("blur", ($event) => {
|
|
5274
|
+
onEditorBlur($event);
|
|
5275
|
+
});
|
|
5276
|
+
_el$68.$$keydown = ($event) => {
|
|
5277
|
+
onEditorKeyDown($event);
|
|
5278
|
+
};
|
|
5279
|
+
_el$68.$$input = ($event) => {
|
|
5280
|
+
onCellEditorInput(cell().column.id, $event);
|
|
5281
|
+
};
|
|
5282
|
+
effect(() => setAttribute(_el$68, "aria-invalid", rozieAttr(invalidMsg() ? "true" : null)));
|
|
5283
|
+
effect(() => _el$68.value = editorValueFor(cell().column.id));
|
|
5284
|
+
return _el$68;
|
|
5285
|
+
})());
|
|
5286
|
+
return _el$66;
|
|
5287
|
+
}
|
|
5288
|
+
});
|
|
5289
|
+
},
|
|
5290
|
+
get children() {
|
|
5291
|
+
var _el$65 = _tmpl$28();
|
|
5292
|
+
_el$65.addEventListener("blur", ($event) => {
|
|
5293
|
+
onEditorBlur($event);
|
|
5294
|
+
});
|
|
5295
|
+
_el$65.$$keydown = ($event) => {
|
|
5296
|
+
onEditorKeyDown($event);
|
|
5297
|
+
};
|
|
5298
|
+
_el$65.addEventListener("change", ($event) => {
|
|
5299
|
+
onCellEditorCheckbox(cell().column.id, $event);
|
|
5300
|
+
});
|
|
5301
|
+
effect(() => setAttribute(_el$65, "aria-invalid", rozieAttr(invalidMsg() ? "true" : null)));
|
|
5302
|
+
effect(() => _el$65.checked = editorCheckedFor(cell().column.id));
|
|
5303
|
+
return _el$65;
|
|
5304
|
+
}
|
|
5305
|
+
});
|
|
5306
|
+
},
|
|
5307
|
+
get children() {
|
|
5308
|
+
var _el$64 = _tmpl$27();
|
|
5309
|
+
_el$64.addEventListener("blur", ($event) => {
|
|
5310
|
+
onEditorBlur($event);
|
|
5311
|
+
});
|
|
5312
|
+
_el$64.$$keydown = ($event) => {
|
|
5313
|
+
onEditorKeyDown($event);
|
|
5314
|
+
};
|
|
5315
|
+
_el$64.addEventListener("change", ($event) => {
|
|
5316
|
+
onCellEditorInput(cell().column.id, $event);
|
|
5317
|
+
});
|
|
5318
|
+
insert(_el$64, createComponent(Key, {
|
|
5319
|
+
get each() {
|
|
5320
|
+
return editorOptionsOf(cell().column.id);
|
|
5321
|
+
},
|
|
5322
|
+
by: (opt) => opt.value,
|
|
5323
|
+
children: (opt) => (() => {
|
|
5324
|
+
var _el$69 = _tmpl$30();
|
|
5325
|
+
insert(_el$69, () => rozieDisplay(opt().label));
|
|
5326
|
+
effect(() => _el$69.value = rozieAttr(opt().value));
|
|
5327
|
+
return _el$69;
|
|
5328
|
+
})()
|
|
5329
|
+
}));
|
|
5330
|
+
effect(() => setAttribute(_el$64, "aria-invalid", rozieAttr(invalidMsg() ? "true" : null)));
|
|
5331
|
+
effect(() => _el$64.value = editorValueFor(cell().column.id));
|
|
5332
|
+
return _el$64;
|
|
5333
|
+
}
|
|
5334
|
+
});
|
|
5335
|
+
},
|
|
5336
|
+
get children() {
|
|
5337
|
+
var _el$63 = _tmpl$26();
|
|
5338
|
+
_el$63.addEventListener("blur", ($event) => {
|
|
5339
|
+
onEditorBlur($event);
|
|
5340
|
+
});
|
|
5341
|
+
_el$63.$$keydown = ($event) => {
|
|
5342
|
+
onEditorKeyDown($event);
|
|
5343
|
+
};
|
|
5344
|
+
_el$63.$$input = ($event) => {
|
|
5345
|
+
onCellEditorInput(cell().column.id, $event);
|
|
5346
|
+
};
|
|
5347
|
+
effect(() => setAttribute(_el$63, "aria-invalid", rozieAttr(invalidMsg() ? "true" : null)));
|
|
5348
|
+
effect(() => _el$63.value = editorValueFor(cell().column.id));
|
|
5349
|
+
return _el$63;
|
|
5350
|
+
}
|
|
5351
|
+
}));
|
|
5352
|
+
return _el$60;
|
|
5353
|
+
}
|
|
5354
|
+
});
|
|
5355
|
+
},
|
|
5356
|
+
get children() {
|
|
5357
|
+
var _el$56 = _tmpl$24(), _el$57 = _el$56.firstChild, _el$58 = _el$57.nextSibling, _el$59 = _el$58.nextSibling;
|
|
5358
|
+
_el$56.style.setProperty("display", "contents");
|
|
5359
|
+
_el$57.$$click = ($event) => {
|
|
5360
|
+
onToggleExpand(row(), $event);
|
|
5361
|
+
};
|
|
5362
|
+
insert(_el$57, () => rozieDisplay(rowIsExpanded(row()) ? "▾" : "▸"));
|
|
5363
|
+
insert(_el$58, () => _props.slots?.[`cell-${cell().column.id}`]?.({
|
|
5364
|
+
get columnId() {
|
|
5365
|
+
return cell().column.id;
|
|
5366
|
+
},
|
|
5367
|
+
get column() {
|
|
5368
|
+
return cell().column;
|
|
5369
|
+
},
|
|
5370
|
+
get row() {
|
|
5371
|
+
return cellSlotRow(row());
|
|
5372
|
+
},
|
|
5373
|
+
get value() {
|
|
5374
|
+
return cell().getValue();
|
|
5375
|
+
}
|
|
5376
|
+
}) ?? (_props.cellSlot ?? _props.slots?.["cell"])?.({
|
|
5377
|
+
get columnId() {
|
|
5378
|
+
return cell().column.id;
|
|
5379
|
+
},
|
|
5380
|
+
get column() {
|
|
5381
|
+
return cell().column;
|
|
5382
|
+
},
|
|
5383
|
+
get row() {
|
|
5384
|
+
return cellSlotRow(row());
|
|
5385
|
+
},
|
|
5386
|
+
get value() {
|
|
5387
|
+
return cell().getValue();
|
|
5388
|
+
}
|
|
5389
|
+
}) ?? rozieDisplay(cell().getValue()));
|
|
5390
|
+
insert(_el$59, () => rozieDisplay("(" + groupSubRowCount(row()) + ")"));
|
|
5391
|
+
effect((_p$) => {
|
|
5392
|
+
var _v$46 = !!rowIsExpanded(row()), _v$47 = rozieAttr(rowIsExpanded(row()) ? "Collapse group" : "Expand group");
|
|
5393
|
+
_v$46 !== _p$.e && setAttribute(_el$57, "aria-expanded", _p$.e = _v$46);
|
|
5394
|
+
_v$47 !== _p$.t && setAttribute(_el$57, "aria-label", _p$.t = _v$47);
|
|
5395
|
+
return _p$;
|
|
5396
|
+
}, {
|
|
5397
|
+
e: void 0,
|
|
5398
|
+
t: void 0
|
|
5399
|
+
});
|
|
5400
|
+
return _el$56;
|
|
5401
|
+
}
|
|
5402
|
+
});
|
|
5403
|
+
},
|
|
5404
|
+
get children() {
|
|
5405
|
+
var _el$55 = _tmpl$12();
|
|
5406
|
+
_el$55.style.setProperty("display", "contents");
|
|
5407
|
+
insert(_el$55, () => (_props.selectCellSlot ?? _props.slots?.["selectCell"])?.({
|
|
5408
|
+
get row() {
|
|
5409
|
+
return cellSlotRow(row());
|
|
5410
|
+
},
|
|
5411
|
+
get checked() {
|
|
5412
|
+
return rowIsSelected(row());
|
|
5413
|
+
},
|
|
5414
|
+
toggle: (e) => onToggleRow(row(), e)
|
|
5415
|
+
}) ?? (() => {
|
|
5416
|
+
var _el$70 = _tmpl$31();
|
|
5417
|
+
_el$70.addEventListener("change", ($event) => {
|
|
5418
|
+
onToggleRow(row(), $event);
|
|
5419
|
+
});
|
|
5420
|
+
effect(() => _el$70.checked = rowIsSelected(row()));
|
|
5421
|
+
return _el$70;
|
|
5422
|
+
})());
|
|
5423
|
+
return _el$55;
|
|
5424
|
+
}
|
|
5425
|
+
});
|
|
5426
|
+
},
|
|
5427
|
+
get children() {
|
|
5428
|
+
var _el$54 = _tmpl$12();
|
|
5429
|
+
_el$54.style.setProperty("display", "contents");
|
|
5430
|
+
insert(_el$54, () => createComponent(Show, {
|
|
5431
|
+
get when() {
|
|
5432
|
+
return rowCanExpand(row());
|
|
5433
|
+
},
|
|
5434
|
+
get children() {
|
|
5435
|
+
var _el$71 = _tmpl$32();
|
|
5436
|
+
_el$71.$$click = ($event) => {
|
|
5437
|
+
onToggleExpand(row(), $event);
|
|
5438
|
+
};
|
|
5439
|
+
insert(_el$71, () => rozieDisplay(rowIsExpanded(row()) ? "▾" : "▸"));
|
|
5440
|
+
effect((_p$) => {
|
|
5441
|
+
var _v$48 = !!rowIsExpanded(row()), _v$49 = rozieAttr(rowIsExpanded(row()) ? "Collapse row" : "Expand row");
|
|
5442
|
+
_v$48 !== _p$.e && setAttribute(_el$71, "aria-expanded", _p$.e = _v$48);
|
|
5443
|
+
_v$49 !== _p$.t && setAttribute(_el$71, "aria-label", _p$.t = _v$49);
|
|
5444
|
+
return _p$;
|
|
5445
|
+
}, {
|
|
5446
|
+
e: void 0,
|
|
5447
|
+
t: void 0
|
|
5448
|
+
});
|
|
5449
|
+
return _el$71;
|
|
5450
|
+
}
|
|
5451
|
+
}));
|
|
5452
|
+
return _el$54;
|
|
5453
|
+
}
|
|
5454
|
+
}), null);
|
|
5455
|
+
insert(_el$53, () => createComponent(Show, {
|
|
5456
|
+
get when() {
|
|
5457
|
+
return isFillHandleCell(rowIndexOf(row()), colIndexOf(row(), cell()));
|
|
5458
|
+
},
|
|
5459
|
+
get children() {
|
|
5460
|
+
var _el$72 = _tmpl$33();
|
|
5461
|
+
_el$72.$$pointerdown = ($event) => {
|
|
5462
|
+
onFillHandlePointerDown($event);
|
|
5463
|
+
};
|
|
5464
|
+
return _el$72;
|
|
5465
|
+
}
|
|
5466
|
+
}), null);
|
|
5467
|
+
effect((_p$) => {
|
|
5468
|
+
var _v$34 = "rdt-td " + rozieClass({
|
|
5469
|
+
"rdt-select-td": isSelectColumn(cell().column.id),
|
|
5470
|
+
"rdt-expander-td": isExpanderColumn(cell().column.id),
|
|
5471
|
+
"rdt-pinned": columnPinSide(cell().column.id) !== "",
|
|
5472
|
+
"rdt-in-range": inRange(rowIndexOf(row()), colIndexOf(row(), cell())),
|
|
5473
|
+
"rdt-cell-active": isActiveCell(String(rowIndexOf(row())), colIndexOf(row(), cell()))
|
|
5474
|
+
}), _v$35 = rozieAttr(cellRole()), _v$36 = rozieAttr(cell().column.id), _v$37 = rozieAttr(rowIndexOf(row())), _v$38 = rozieAttr(colIndexOf(row(), cell())), _v$39 = rozieAttr(cellTabindex(String(rowIndexOf(row())), colIndexOf(row(), cell()))), _v$40 = parseInlineStyle(bodyCellStyle(row(), cell().column.id)), _v$41 = rozieAttr(cellAriaInvalid(rowIndexOf(row()), colIndexOf(row(), cell()))), _v$42 = rozieAttr(colIndexOf(row(), cell()) + 1), _v$43 = (inRange(rowIndexOf(row()), colIndexOf(row(), cell())) ? "true" : null) ?? void 0, _v$44 = rozieAttr(inRange(rowIndexOf(row()), colIndexOf(row(), cell())) ? "true" : null), _v$45 = rozieAttr(cellIsAggregated(cell()) ? cell().column.id : null);
|
|
5475
|
+
_v$34 !== _p$.e && className(_el$53, _p$.e = _v$34);
|
|
5476
|
+
_v$35 !== _p$.t && setAttribute(_el$53, "role", _p$.t = _v$35);
|
|
5477
|
+
_v$36 !== _p$.a && setAttribute(_el$53, "data-col", _p$.a = _v$36);
|
|
5478
|
+
_v$37 !== _p$.o && setAttribute(_el$53, "data-row", _p$.o = _v$37);
|
|
5479
|
+
_v$38 !== _p$.i && setAttribute(_el$53, "data-col-index", _p$.i = _v$38);
|
|
5480
|
+
_v$39 !== _p$.n && setAttribute(_el$53, "tabindex", _p$.n = _v$39);
|
|
5481
|
+
_p$.s = style(_el$53, _v$40, _p$.s);
|
|
5482
|
+
_v$41 !== _p$.h && setAttribute(_el$53, "aria-invalid", _p$.h = _v$41);
|
|
5483
|
+
_v$42 !== _p$.r && setAttribute(_el$53, "aria-colindex", _p$.r = _v$42);
|
|
5484
|
+
_v$43 !== _p$.d && setAttribute(_el$53, "aria-selected", _p$.d = _v$43);
|
|
5485
|
+
_v$44 !== _p$.l && setAttribute(_el$53, "data-in-range", _p$.l = _v$44);
|
|
5486
|
+
_v$45 !== _p$.u && setAttribute(_el$53, "data-agg-cell", _p$.u = _v$45);
|
|
5487
|
+
return _p$;
|
|
5488
|
+
}, {
|
|
5489
|
+
e: void 0,
|
|
5490
|
+
t: void 0,
|
|
5491
|
+
a: void 0,
|
|
5492
|
+
o: void 0,
|
|
5493
|
+
i: void 0,
|
|
5494
|
+
n: void 0,
|
|
5495
|
+
s: void 0,
|
|
5496
|
+
h: void 0,
|
|
5497
|
+
r: void 0,
|
|
5498
|
+
d: void 0,
|
|
5499
|
+
l: void 0,
|
|
5500
|
+
u: void 0
|
|
5501
|
+
});
|
|
5502
|
+
return _el$53;
|
|
5503
|
+
})()
|
|
5504
|
+
}));
|
|
5505
|
+
effect((_p$) => {
|
|
5506
|
+
var _v$26 = "rdt-tr " + rozieClass({ "rdt-group-header": rowIsGrouped(row()) }), _v$27 = rozieAttr(row().depth), _v$28 = rozieAttr(bodyAriaRowIndex(row())), _v$29 = rozieAttr(rowIsGrouped(row()) ? row().id : null), _v$30 = rozieAttr(groupingActive() && !rowIsGrouped(row()) ? row().id : null), _v$31 = (rowIsGrouped(row()) ? !!rowIsExpanded(row()) : null) ?? void 0, _v$32 = (local.selectionMode !== "none" ? !!rowIsSelected(row()) : null) ?? void 0, _v$33 = rozieAttr(groupingActive() ? row().depth + 1 : null);
|
|
5507
|
+
_v$26 !== _p$.e && className(_el$52, _p$.e = _v$26);
|
|
5508
|
+
_v$27 !== _p$.t && setAttribute(_el$52, "data-depth", _p$.t = _v$27);
|
|
5509
|
+
_v$28 !== _p$.a && setAttribute(_el$52, "aria-rowindex", _p$.a = _v$28);
|
|
5510
|
+
_v$29 !== _p$.o && setAttribute(_el$52, "data-group-header", _p$.o = _v$29);
|
|
5511
|
+
_v$30 !== _p$.i && setAttribute(_el$52, "data-group-leaf", _p$.i = _v$30);
|
|
5512
|
+
_v$31 !== _p$.n && setAttribute(_el$52, "aria-expanded", _p$.n = _v$31);
|
|
5513
|
+
_v$32 !== _p$.s && setAttribute(_el$52, "aria-selected", _p$.s = _v$32);
|
|
5514
|
+
_v$33 !== _p$.h && setAttribute(_el$52, "aria-level", _p$.h = _v$33);
|
|
5515
|
+
return _p$;
|
|
5516
|
+
}, {
|
|
5517
|
+
e: void 0,
|
|
5518
|
+
t: void 0,
|
|
5519
|
+
a: void 0,
|
|
5520
|
+
o: void 0,
|
|
5521
|
+
i: void 0,
|
|
5522
|
+
n: void 0,
|
|
5523
|
+
s: void 0,
|
|
5524
|
+
h: void 0
|
|
5525
|
+
});
|
|
5526
|
+
return _el$52;
|
|
5527
|
+
})(), memo(() => createComponent(Show, {
|
|
5528
|
+
get when() {
|
|
5529
|
+
return rowShowsDetail(row());
|
|
5530
|
+
},
|
|
5531
|
+
get children() {
|
|
5532
|
+
var _el$73 = _tmpl$34(), _el$74 = _el$73.firstChild;
|
|
5533
|
+
insert(_el$74, () => (_props.detailSlot ?? _props.slots?.["detail"])?.({ get row() {
|
|
5534
|
+
return row().original;
|
|
5535
|
+
} }));
|
|
5536
|
+
effect((_p$) => {
|
|
5537
|
+
var _v$50 = rozieAttr(row().id), _v$51 = rozieAttr(visibleColCount());
|
|
5538
|
+
_v$50 !== _p$.e && setAttribute(_el$73, "data-detail-row", _p$.e = _v$50);
|
|
5539
|
+
_v$51 !== _p$.t && setAttribute(_el$74, "colspan", _p$.t = _v$51);
|
|
5540
|
+
return _p$;
|
|
5541
|
+
}, {
|
|
5542
|
+
e: void 0,
|
|
5543
|
+
t: void 0
|
|
5544
|
+
});
|
|
5545
|
+
return _el$73;
|
|
5546
|
+
}
|
|
5547
|
+
}))]
|
|
5548
|
+
}));
|
|
5549
|
+
effect((_p$) => {
|
|
5550
|
+
var _v$0 = rozieAttr(gridAriaRowCount()), _v$1 = rozieAttr(gridAriaColCount()), _v$10 = "rozie-data-table " + rozieClass({ "rdt-sticky": local.stickyHeader }), _v$11 = rozieAttr(tableRole());
|
|
5551
|
+
_v$0 !== _p$.e && setAttribute(_el$23, "aria-rowcount", _p$.e = _v$0);
|
|
5552
|
+
_v$1 !== _p$.t && setAttribute(_el$23, "aria-colcount", _p$.t = _v$1);
|
|
5553
|
+
_v$10 !== _p$.a && className(_el$23, _p$.a = _v$10);
|
|
5554
|
+
_v$11 !== _p$.o && setAttribute(_el$23, "role", _p$.o = _v$11);
|
|
5555
|
+
return _p$;
|
|
5556
|
+
}, {
|
|
5557
|
+
e: void 0,
|
|
5558
|
+
t: void 0,
|
|
5559
|
+
a: void 0,
|
|
5560
|
+
o: void 0
|
|
5561
|
+
});
|
|
5562
|
+
return _el$23;
|
|
5563
|
+
})();
|
|
5564
|
+
},
|
|
5565
|
+
get children() {
|
|
5566
|
+
var _el$15 = _tmpl$0(), _el$16 = _el$15.firstChild, _el$17 = _el$16.firstChild, _el$18 = _el$17.nextSibling, _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$21 = _el$19.nextSibling, _el$22 = _el$21.firstChild;
|
|
5567
|
+
_el$16.$$click = ($event) => {
|
|
5568
|
+
onGridClick($event);
|
|
5569
|
+
};
|
|
5570
|
+
_el$16.$$dblclick = ($event) => {
|
|
5571
|
+
onGridDblClick($event);
|
|
5572
|
+
};
|
|
5573
|
+
_el$16.$$mousedown = ($event) => {
|
|
5574
|
+
onGridMouseDown($event);
|
|
5575
|
+
};
|
|
5576
|
+
_el$16.$$focusout = ($event) => {
|
|
5577
|
+
onGridFocusOut($event);
|
|
5578
|
+
};
|
|
5579
|
+
_el$16.$$focusin = ($event) => {
|
|
5580
|
+
syncActiveFromEvent($event);
|
|
5581
|
+
};
|
|
5582
|
+
_el$16.$$keydown = ($event) => {
|
|
5583
|
+
onGridKeyDown($event);
|
|
5584
|
+
};
|
|
5585
|
+
insert(_el$17, createComponent(Key, {
|
|
5586
|
+
get each() {
|
|
5587
|
+
return headerGroups();
|
|
5588
|
+
},
|
|
5589
|
+
by: (hg) => hg.id,
|
|
5590
|
+
children: (hg, hgLevel) => (() => {
|
|
5591
|
+
var _el$75 = _tmpl$10();
|
|
5592
|
+
insert(_el$75, () => createComponent(Show, {
|
|
5593
|
+
get when() {
|
|
5594
|
+
return colsWindowed();
|
|
5595
|
+
},
|
|
5596
|
+
get children() {
|
|
5597
|
+
var _el$76 = _tmpl$35();
|
|
5598
|
+
effect((_$p) => style(_el$76, parseInlineStyle("width:" + colPadLeft() + "px;padding:0;border:0"), _$p));
|
|
5599
|
+
return _el$76;
|
|
5600
|
+
}
|
|
5601
|
+
}), null);
|
|
5602
|
+
insert(_el$75, createComponent(Key, {
|
|
5603
|
+
get each() {
|
|
5604
|
+
return windowedHeadersFor(hg(), hgLevel());
|
|
5605
|
+
},
|
|
5606
|
+
by: (wh) => wh.header.id,
|
|
5607
|
+
children: (wh) => (() => {
|
|
5608
|
+
var _el$77 = _tmpl$11();
|
|
5609
|
+
insert(_el$77, () => createComponent(Show, {
|
|
5610
|
+
get when() {
|
|
5611
|
+
return isSelectColumn(wh().header.column.id);
|
|
5612
|
+
},
|
|
5613
|
+
get fallback() {
|
|
5614
|
+
return createComponent(Show, {
|
|
5615
|
+
get when() {
|
|
5616
|
+
return isExpanderColumn(wh().header.column.id);
|
|
5617
|
+
},
|
|
5618
|
+
get fallback() {
|
|
5619
|
+
return (() => {
|
|
5620
|
+
var _el$80 = _tmpl$14(), _el$87 = _el$80.firstChild;
|
|
5621
|
+
_el$80.style.setProperty("display", "contents");
|
|
5622
|
+
insert(_el$80, () => createComponent(Show, {
|
|
5623
|
+
get when() {
|
|
5624
|
+
return memo(() => !!wh().header.column.getCanSort)() && wh().header.column.getCanSort();
|
|
5625
|
+
},
|
|
5626
|
+
get fallback() {
|
|
5627
|
+
return (() => {
|
|
5628
|
+
var _el$91 = _tmpl$16(), _el$92 = _el$91.firstChild;
|
|
5629
|
+
_el$91.style.setProperty("display", "contents");
|
|
5630
|
+
insert(_el$92, () => _props.slots?.[`colHeader-${wh().header.column.id}`]?.({
|
|
5631
|
+
get columnId() {
|
|
5632
|
+
return wh().header.column.id;
|
|
5633
|
+
},
|
|
5634
|
+
get column() {
|
|
5635
|
+
return wh().header.column;
|
|
5636
|
+
},
|
|
5637
|
+
get label() {
|
|
5638
|
+
return headerLabel(wh().header.column.id);
|
|
5639
|
+
}
|
|
5640
|
+
}) ?? (_props.colHeaderSlot ?? _props.slots?.["colHeader"])?.({
|
|
5641
|
+
get columnId() {
|
|
5642
|
+
return wh().header.column.id;
|
|
5643
|
+
},
|
|
5644
|
+
get column() {
|
|
5645
|
+
return wh().header.column;
|
|
5646
|
+
},
|
|
5647
|
+
get label() {
|
|
5648
|
+
return headerLabel(wh().header.column.id);
|
|
5649
|
+
}
|
|
5650
|
+
}) ?? rozieDisplay(headerLabel(wh().header.column.id)));
|
|
5651
|
+
return _el$91;
|
|
5652
|
+
})();
|
|
5653
|
+
},
|
|
5654
|
+
get children() {
|
|
5655
|
+
var _el$88 = _tmpl$15(), _el$89 = _el$88.firstChild, _el$90 = _el$89.nextSibling;
|
|
5656
|
+
_el$88.$$click = ($event) => {
|
|
5657
|
+
onHeaderSort(wh().header.column.id, $event);
|
|
5658
|
+
};
|
|
5659
|
+
insert(_el$89, () => _props.slots?.[`colHeader-${wh().header.column.id}`]?.({
|
|
5660
|
+
get columnId() {
|
|
5661
|
+
return wh().header.column.id;
|
|
5662
|
+
},
|
|
5663
|
+
get column() {
|
|
5664
|
+
return wh().header.column;
|
|
5665
|
+
},
|
|
5666
|
+
get label() {
|
|
5667
|
+
return headerLabel(wh().header.column.id);
|
|
5668
|
+
}
|
|
5669
|
+
}) ?? (_props.colHeaderSlot ?? _props.slots?.["colHeader"])?.({
|
|
5670
|
+
get columnId() {
|
|
5671
|
+
return wh().header.column.id;
|
|
5672
|
+
},
|
|
5673
|
+
get column() {
|
|
5674
|
+
return wh().header.column;
|
|
5675
|
+
},
|
|
5676
|
+
get label() {
|
|
5677
|
+
return headerLabel(wh().header.column.id);
|
|
5678
|
+
}
|
|
5679
|
+
}) ?? rozieDisplay(headerLabel(wh().header.column.id)));
|
|
5680
|
+
insert(_el$90, () => rozieDisplay(sortIndicator(wh().header.column.id)));
|
|
5681
|
+
return _el$88;
|
|
5682
|
+
}
|
|
5683
|
+
}), _el$87);
|
|
5684
|
+
insert(_el$80, createComponent(Popover, {
|
|
5685
|
+
trigger: "click",
|
|
5686
|
+
placement: "bottom-end",
|
|
5687
|
+
strategy: "fixed",
|
|
5688
|
+
offset: 4,
|
|
5689
|
+
"data-rozie-s-d5dcab4c": "",
|
|
5690
|
+
anchorSlot: () => (() => {
|
|
5691
|
+
var _el$93 = _tmpl$17();
|
|
5692
|
+
effect(() => setAttribute(_el$93, "aria-label", rozieAttr("Column options for " + headerLabel(wh().header.column.id))));
|
|
5693
|
+
return _el$93;
|
|
5694
|
+
})(),
|
|
5695
|
+
get children() {
|
|
5696
|
+
var _el$81 = _tmpl$13(), _el$82 = _el$81.firstChild, _el$83 = _el$82.nextSibling, _el$84 = _el$83.nextSibling, _el$86 = _el$84.nextSibling.nextSibling;
|
|
5697
|
+
_el$82.$$click = ($event) => {
|
|
5698
|
+
onPinColumn(wh().header.column.id, "left", $event);
|
|
5699
|
+
};
|
|
5700
|
+
_el$83.$$click = ($event) => {
|
|
5701
|
+
onPinColumn(wh().header.column.id, "right", $event);
|
|
5702
|
+
};
|
|
5703
|
+
_el$84.$$click = ($event) => {
|
|
5704
|
+
onPinColumn(wh().header.column.id, false, $event);
|
|
5705
|
+
};
|
|
5706
|
+
_el$86.$$click = ($event) => {
|
|
5707
|
+
onHideColumn(wh().header.column.id, $event);
|
|
5708
|
+
};
|
|
5709
|
+
effect((_p$) => {
|
|
5710
|
+
var _v$61 = columnPinSide(wh().header.column.id) === "left", _v$62 = columnPinSide(wh().header.column.id) === "right", _v$63 = !columnPinSide(wh().header.column.id);
|
|
5711
|
+
_v$61 !== _p$.e && setAttribute(_el$82, "aria-pressed", _p$.e = _v$61);
|
|
5712
|
+
_v$62 !== _p$.t && setAttribute(_el$83, "aria-pressed", _p$.t = _v$62);
|
|
5713
|
+
_v$63 !== _p$.a && setAttribute(_el$84, "aria-pressed", _p$.a = _v$63);
|
|
5714
|
+
return _p$;
|
|
5715
|
+
}, {
|
|
5716
|
+
e: void 0,
|
|
5717
|
+
t: void 0,
|
|
5718
|
+
a: void 0
|
|
5719
|
+
});
|
|
5720
|
+
return _el$81;
|
|
5721
|
+
}
|
|
5722
|
+
}), _el$87);
|
|
5723
|
+
_el$87.$$touchstart = ($event) => {
|
|
5724
|
+
onResizeStart(wh().header.column.id, $event);
|
|
5725
|
+
};
|
|
5726
|
+
_el$87.$$pointerdown = ($event) => {
|
|
5727
|
+
onResizeStart(wh().header.column.id, $event);
|
|
5728
|
+
};
|
|
5729
|
+
effect(() => setAttribute(_el$87, "aria-label", rozieAttr("Resize " + headerLabel(wh().header.column.id))));
|
|
5730
|
+
return _el$80;
|
|
5731
|
+
})();
|
|
5732
|
+
},
|
|
5733
|
+
get children() {
|
|
5734
|
+
var _el$79 = _tmpl$12();
|
|
5735
|
+
_el$79.style.setProperty("display", "contents");
|
|
5736
|
+
return _el$79;
|
|
5737
|
+
}
|
|
5738
|
+
});
|
|
5739
|
+
},
|
|
5740
|
+
get children() {
|
|
5741
|
+
var _el$78 = _tmpl$12();
|
|
5742
|
+
_el$78.style.setProperty("display", "contents");
|
|
5743
|
+
insert(_el$78, () => (_props.selectAllSlot ?? _props.slots?.["selectAll"])?.({
|
|
5744
|
+
get checked() {
|
|
5745
|
+
return isAllRowsSelected();
|
|
5746
|
+
},
|
|
5747
|
+
get indeterminate() {
|
|
5748
|
+
return isSomeRowsSelected();
|
|
5749
|
+
},
|
|
5750
|
+
get toggle() {
|
|
5751
|
+
return onToggleAllRows;
|
|
5752
|
+
}
|
|
5753
|
+
}) ?? createComponent(Show, {
|
|
5754
|
+
get when() {
|
|
5755
|
+
return local.selectionMode === "multiple";
|
|
5756
|
+
},
|
|
5757
|
+
get children() {
|
|
5758
|
+
var _el$94 = _tmpl$18();
|
|
5759
|
+
_el$94.addEventListener("change", ($event) => {
|
|
5760
|
+
onToggleAllRows($event);
|
|
5761
|
+
});
|
|
5762
|
+
effect(() => _el$94.checked = isAllRowsSelected());
|
|
5763
|
+
return _el$94;
|
|
5764
|
+
}
|
|
5765
|
+
}));
|
|
5766
|
+
return _el$78;
|
|
5767
|
+
}
|
|
5768
|
+
}));
|
|
5769
|
+
effect((_p$) => {
|
|
5770
|
+
var _v$52 = "rdt-th " + rozieClass({
|
|
5771
|
+
"rdt-select-th": isSelectColumn(wh().header.column.id),
|
|
5772
|
+
"rdt-expander-th": isExpanderColumn(wh().header.column.id),
|
|
5773
|
+
"rdt-pinned": columnPinSide(wh().header.column.id) !== "",
|
|
5774
|
+
"rdt-th-resizing": columnIsResizing(wh().header.column.id),
|
|
5775
|
+
"rdt-cell-active": isActiveCell("__header", headerColIndexOf(hg(), wh().header), hgLevel())
|
|
5776
|
+
}), _v$53 = rozieAttr(wh().header.column.id), _v$54 = rozieAttr(hgLevel()), _v$55 = rozieAttr(wh().span > 1 ? wh().span : null), _v$56 = rozieAttr(headerColIndexOf(hg(), wh().header)), _v$57 = rozieAttr(headerLeafStart(hg(), wh().header) + 1), _v$58 = rozieAttr(cellTabindex("__header", headerColIndexOf(hg(), wh().header), hgLevel())), _v$59 = rozieAttr(ariaSortFor(wh().header.column.id)), _v$60 = parseInlineStyle(thStyle(wh().header, wh().width));
|
|
5777
|
+
_v$52 !== _p$.e && className(_el$77, _p$.e = _v$52);
|
|
5778
|
+
_v$53 !== _p$.t && setAttribute(_el$77, "data-col", _p$.t = _v$53);
|
|
5779
|
+
_v$54 !== _p$.a && setAttribute(_el$77, "data-header-level", _p$.a = _v$54);
|
|
5780
|
+
_v$55 !== _p$.o && setAttribute(_el$77, "colspan", _p$.o = _v$55);
|
|
5781
|
+
_v$56 !== _p$.i && setAttribute(_el$77, "data-col-index", _p$.i = _v$56);
|
|
5782
|
+
_v$57 !== _p$.n && setAttribute(_el$77, "aria-colindex", _p$.n = _v$57);
|
|
5783
|
+
_v$58 !== _p$.s && setAttribute(_el$77, "tabindex", _p$.s = _v$58);
|
|
5784
|
+
_v$59 !== _p$.h && setAttribute(_el$77, "aria-sort", _p$.h = _v$59);
|
|
5785
|
+
_p$.r = style(_el$77, _v$60, _p$.r);
|
|
5786
|
+
return _p$;
|
|
5787
|
+
}, {
|
|
5788
|
+
e: void 0,
|
|
5789
|
+
t: void 0,
|
|
5790
|
+
a: void 0,
|
|
5791
|
+
o: void 0,
|
|
5792
|
+
i: void 0,
|
|
5793
|
+
n: void 0,
|
|
5794
|
+
s: void 0,
|
|
5795
|
+
h: void 0,
|
|
5796
|
+
r: void 0
|
|
5797
|
+
});
|
|
5798
|
+
return _el$77;
|
|
5799
|
+
})()
|
|
5800
|
+
}), null);
|
|
5801
|
+
insert(_el$75, () => createComponent(Show, {
|
|
5802
|
+
get when() {
|
|
5803
|
+
return colsWindowed();
|
|
5804
|
+
},
|
|
5805
|
+
get children() {
|
|
5806
|
+
var _el$95 = _tmpl$35();
|
|
5807
|
+
effect((_$p) => style(_el$95, parseInlineStyle("width:" + colPadRight() + "px;padding:0;border:0"), _$p));
|
|
5808
|
+
return _el$95;
|
|
5809
|
+
}
|
|
5810
|
+
}), null);
|
|
5811
|
+
effect(() => setAttribute(_el$75, "aria-rowindex", rozieAttr(hgLevel() + 1)));
|
|
5812
|
+
return _el$75;
|
|
5813
|
+
})()
|
|
5814
|
+
}), null);
|
|
5815
|
+
insert(_el$17, () => createComponent(Show, {
|
|
5816
|
+
get when() {
|
|
5817
|
+
return hasAnyFilterableColumn();
|
|
5818
|
+
},
|
|
5819
|
+
get children() {
|
|
5820
|
+
var _el$96 = _tmpl$19();
|
|
5821
|
+
insert(_el$96, () => createComponent(Show, {
|
|
5822
|
+
get when() {
|
|
5823
|
+
return colsWindowed();
|
|
5824
|
+
},
|
|
5825
|
+
get children() {
|
|
5826
|
+
var _el$97 = _tmpl$35();
|
|
5827
|
+
effect((_$p) => style(_el$97, parseInlineStyle("width:" + colPadLeft() + "px;padding:0;border:0"), _$p));
|
|
5828
|
+
return _el$97;
|
|
5829
|
+
}
|
|
5830
|
+
}), null);
|
|
5831
|
+
insert(_el$96, createComponent(Key, {
|
|
5832
|
+
get each() {
|
|
5833
|
+
return windowedHeadersFor(headerGroups()[headerGroups().length - 1], headerGroups().length - 1);
|
|
5834
|
+
},
|
|
5835
|
+
by: (wh) => wh.header.id,
|
|
5836
|
+
children: (wh) => (() => {
|
|
5837
|
+
var _el$98 = _tmpl$20();
|
|
5838
|
+
insert(_el$98, () => createComponent(Show, {
|
|
5839
|
+
get when() {
|
|
5840
|
+
return isSelectColumn(wh().header.column.id);
|
|
5841
|
+
},
|
|
5842
|
+
get fallback() {
|
|
5843
|
+
return createComponent(Show, {
|
|
5844
|
+
get when() {
|
|
5845
|
+
return isExpanderColumn(wh().header.column.id);
|
|
5846
|
+
},
|
|
5847
|
+
get fallback() {
|
|
5848
|
+
return (() => {
|
|
5849
|
+
var _el$101 = _tmpl$12();
|
|
5850
|
+
_el$101.style.setProperty("display", "contents");
|
|
5851
|
+
insert(_el$101, () => createComponent(Show, {
|
|
5852
|
+
get when() {
|
|
5853
|
+
return columnIsFilterable(wh().header.column.id);
|
|
5854
|
+
},
|
|
5855
|
+
get children() {
|
|
5856
|
+
var _el$102 = _tmpl$12();
|
|
5857
|
+
_el$102.style.setProperty("display", "contents");
|
|
5858
|
+
insert(_el$102, () => _props.slots?.[`filter-${wh().header.column.id}`]?.({
|
|
5859
|
+
get columnId() {
|
|
5860
|
+
return wh().header.column.id;
|
|
5861
|
+
},
|
|
5862
|
+
get value() {
|
|
5863
|
+
return columnFilterValue(wh().header.column.id);
|
|
5864
|
+
},
|
|
5865
|
+
get uniqueValues() {
|
|
5866
|
+
return getFacetedUniqueValues$1(wh().header.column.id);
|
|
5867
|
+
},
|
|
5868
|
+
get minMax() {
|
|
5869
|
+
return getFacetedMinMaxValues$1(wh().header.column.id);
|
|
5870
|
+
},
|
|
5871
|
+
get columnLabel() {
|
|
5872
|
+
return headerLabel(wh().header.column.id);
|
|
5873
|
+
},
|
|
5874
|
+
get setFilter() {
|
|
5875
|
+
return setColumnFilter;
|
|
5876
|
+
}
|
|
5877
|
+
}) ?? (_props.filterSlot ?? _props.slots?.["filter"])?.({
|
|
5878
|
+
get columnId() {
|
|
5879
|
+
return wh().header.column.id;
|
|
5880
|
+
},
|
|
5881
|
+
get value() {
|
|
5882
|
+
return columnFilterValue(wh().header.column.id);
|
|
5883
|
+
},
|
|
5884
|
+
get uniqueValues() {
|
|
5885
|
+
return getFacetedUniqueValues$1(wh().header.column.id);
|
|
5886
|
+
},
|
|
5887
|
+
get minMax() {
|
|
5888
|
+
return getFacetedMinMaxValues$1(wh().header.column.id);
|
|
5889
|
+
},
|
|
5890
|
+
get columnLabel() {
|
|
5891
|
+
return headerLabel(wh().header.column.id);
|
|
5892
|
+
},
|
|
5893
|
+
get setFilter() {
|
|
5894
|
+
return setColumnFilter;
|
|
5895
|
+
}
|
|
5896
|
+
}) ?? (() => {
|
|
5897
|
+
var _el$103 = _tmpl$21();
|
|
5898
|
+
_el$103.$$click = ($event) => {
|
|
5899
|
+
stopEvent($event);
|
|
5900
|
+
};
|
|
5901
|
+
_el$103.$$input = ($event) => {
|
|
5902
|
+
onColumnFilterInput(wh().header.column.id, $event);
|
|
5903
|
+
};
|
|
5904
|
+
effect(() => setAttribute(_el$103, "aria-label", rozieAttr("Filter " + headerLabel(wh().header.column.id))));
|
|
5905
|
+
effect(() => _el$103.value = columnFilterValue(wh().header.column.id));
|
|
5906
|
+
return _el$103;
|
|
5907
|
+
})());
|
|
5908
|
+
return _el$102;
|
|
5909
|
+
}
|
|
5910
|
+
}));
|
|
5911
|
+
return _el$101;
|
|
5912
|
+
})();
|
|
5913
|
+
},
|
|
5914
|
+
get children() {
|
|
5915
|
+
var _el$100 = _tmpl$12();
|
|
5916
|
+
_el$100.style.setProperty("display", "contents");
|
|
5917
|
+
return _el$100;
|
|
5918
|
+
}
|
|
5919
|
+
});
|
|
5920
|
+
},
|
|
5921
|
+
get children() {
|
|
5922
|
+
var _el$99 = _tmpl$12();
|
|
5923
|
+
_el$99.style.setProperty("display", "contents");
|
|
5924
|
+
return _el$99;
|
|
5925
|
+
}
|
|
5926
|
+
}));
|
|
5927
|
+
effect((_p$) => {
|
|
5928
|
+
var _v$64 = "rdt-filter-cell " + rozieClass({ "rdt-pinned": columnPinSide(wh().header.column.id) !== "" }), _v$65 = rozieAttr(wh().header.column.id), _v$66 = parseInlineStyle(pinStyle(wh().header.column.id));
|
|
5929
|
+
_v$64 !== _p$.e && className(_el$98, _p$.e = _v$64);
|
|
5930
|
+
_v$65 !== _p$.t && setAttribute(_el$98, "data-col", _p$.t = _v$65);
|
|
5931
|
+
_p$.a = style(_el$98, _v$66, _p$.a);
|
|
5932
|
+
return _p$;
|
|
5933
|
+
}, {
|
|
5934
|
+
e: void 0,
|
|
5935
|
+
t: void 0,
|
|
5936
|
+
a: void 0
|
|
5937
|
+
});
|
|
5938
|
+
return _el$98;
|
|
5939
|
+
})()
|
|
5940
|
+
}), null);
|
|
5941
|
+
insert(_el$96, () => createComponent(Show, {
|
|
5942
|
+
get when() {
|
|
5943
|
+
return colsWindowed();
|
|
5944
|
+
},
|
|
5945
|
+
get children() {
|
|
5946
|
+
var _el$104 = _tmpl$35();
|
|
5947
|
+
effect((_$p) => style(_el$104, parseInlineStyle("width:" + colPadRight() + "px;padding:0;border:0"), _$p));
|
|
5948
|
+
return _el$104;
|
|
5949
|
+
}
|
|
5950
|
+
}), null);
|
|
5951
|
+
return _el$96;
|
|
5952
|
+
}
|
|
5953
|
+
}), null);
|
|
5954
|
+
insert(_el$18, createComponent(Key, {
|
|
5955
|
+
get each() {
|
|
5956
|
+
return windowedRows();
|
|
5957
|
+
},
|
|
5958
|
+
by: (wr) => wr.row.id,
|
|
5959
|
+
children: (wr) => [(() => {
|
|
5960
|
+
var _el$105 = _tmpl$22();
|
|
5961
|
+
insert(_el$105, () => createComponent(Show, {
|
|
5962
|
+
get when() {
|
|
5963
|
+
return colsWindowed();
|
|
5964
|
+
},
|
|
5965
|
+
get children() {
|
|
5966
|
+
var _el$106 = _tmpl$36();
|
|
5967
|
+
effect((_$p) => style(_el$106, parseInlineStyle("width:" + colPadLeft() + "px;padding:0;border:0"), _$p));
|
|
5968
|
+
return _el$106;
|
|
5969
|
+
}
|
|
5970
|
+
}), null);
|
|
5971
|
+
insert(_el$105, createComponent(Key, {
|
|
5972
|
+
get each() {
|
|
5973
|
+
return windowedCells(wr().row);
|
|
5974
|
+
},
|
|
5975
|
+
by: (cell) => cell.id,
|
|
5976
|
+
children: (cell) => (() => {
|
|
5977
|
+
var _el$107 = _tmpl$23();
|
|
5978
|
+
insert(_el$107, () => createComponent(Show, {
|
|
5979
|
+
get when() {
|
|
5980
|
+
return memo(() => !!rowIsLazyPlaceholder(wr().row))() && isSelectColumn(cell().column.id);
|
|
5981
|
+
},
|
|
5982
|
+
get fallback() {
|
|
5983
|
+
return createComponent(Show, {
|
|
5984
|
+
get when() {
|
|
5985
|
+
return memo(() => !!rowIsLazyPlaceholder(wr().row))() && isExpanderColumn(cell().column.id);
|
|
5986
|
+
},
|
|
5987
|
+
get fallback() {
|
|
5988
|
+
return createComponent(Show, {
|
|
5989
|
+
get when() {
|
|
5990
|
+
return rowIsLazyPlaceholder(wr().row);
|
|
5991
|
+
},
|
|
5992
|
+
get fallback() {
|
|
5993
|
+
return createComponent(Show, {
|
|
5994
|
+
get when() {
|
|
5995
|
+
return isExpanderColumn(cell().column.id);
|
|
5996
|
+
},
|
|
5997
|
+
get fallback() {
|
|
5998
|
+
return createComponent(Show, {
|
|
5999
|
+
get when() {
|
|
6000
|
+
return isSelectColumn(cell().column.id);
|
|
6001
|
+
},
|
|
6002
|
+
get fallback() {
|
|
6003
|
+
return createComponent(Show, {
|
|
6004
|
+
get when() {
|
|
6005
|
+
return cellIsGrouped(cell());
|
|
6006
|
+
},
|
|
6007
|
+
get fallback() {
|
|
6008
|
+
return createComponent(Show, {
|
|
6009
|
+
get when() {
|
|
6010
|
+
return isEditing(wr().vi.index, colIndexOf(wr().row, cell()));
|
|
6011
|
+
},
|
|
6012
|
+
get fallback() {
|
|
6013
|
+
return createComponent(Show, {
|
|
6014
|
+
get when() {
|
|
6015
|
+
return cellIsPlaceholder(cell());
|
|
6016
|
+
},
|
|
6017
|
+
get fallback() {
|
|
6018
|
+
return (() => {
|
|
6019
|
+
var _el$120 = _tmpl$25();
|
|
6020
|
+
insert(_el$120, () => _props.slots?.[`cell-${cell().column.id}`]?.({
|
|
6021
|
+
get columnId() {
|
|
6022
|
+
return cell().column.id;
|
|
6023
|
+
},
|
|
6024
|
+
get column() {
|
|
6025
|
+
return cell().column;
|
|
6026
|
+
},
|
|
6027
|
+
get row() {
|
|
6028
|
+
return cellSlotRow(wr().row);
|
|
6029
|
+
},
|
|
6030
|
+
get value() {
|
|
6031
|
+
return cell().getValue();
|
|
6032
|
+
}
|
|
6033
|
+
}) ?? (_props.cellSlot ?? _props.slots?.["cell"])?.({
|
|
6034
|
+
get columnId() {
|
|
6035
|
+
return cell().column.id;
|
|
6036
|
+
},
|
|
6037
|
+
get column() {
|
|
6038
|
+
return cell().column;
|
|
6039
|
+
},
|
|
6040
|
+
get row() {
|
|
6041
|
+
return cellSlotRow(wr().row);
|
|
6042
|
+
},
|
|
6043
|
+
get value() {
|
|
6044
|
+
return cell().getValue();
|
|
6045
|
+
}
|
|
6046
|
+
}) ?? rozieDisplay(cell().getValue()));
|
|
6047
|
+
return _el$120;
|
|
6048
|
+
})();
|
|
6049
|
+
},
|
|
6050
|
+
get children() {
|
|
6051
|
+
var _el$119 = _tmpl$12();
|
|
6052
|
+
_el$119.style.setProperty("display", "contents");
|
|
6053
|
+
return _el$119;
|
|
6054
|
+
}
|
|
6055
|
+
});
|
|
6056
|
+
},
|
|
6057
|
+
get children() {
|
|
6058
|
+
var _el$118 = _tmpl$12();
|
|
6059
|
+
_el$118.style.setProperty("display", "contents");
|
|
6060
|
+
insert(_el$118, () => createComponent(Show, {
|
|
6061
|
+
get when() {
|
|
6062
|
+
return editorTypeOf(cell().column.id) === "number";
|
|
6063
|
+
},
|
|
6064
|
+
get fallback() {
|
|
6065
|
+
return createComponent(Show, {
|
|
6066
|
+
get when() {
|
|
6067
|
+
return editorTypeOf(cell().column.id) === "select";
|
|
6068
|
+
},
|
|
6069
|
+
get fallback() {
|
|
6070
|
+
return createComponent(Show, {
|
|
6071
|
+
get when() {
|
|
6072
|
+
return editorTypeOf(cell().column.id) === "checkbox";
|
|
6073
|
+
},
|
|
6074
|
+
get fallback() {
|
|
6075
|
+
return createComponent(Show, {
|
|
6076
|
+
get when() {
|
|
6077
|
+
return editorTypeOf(cell().column.id) === "custom";
|
|
6078
|
+
},
|
|
6079
|
+
get fallback() {
|
|
6080
|
+
return (() => {
|
|
6081
|
+
var _el$125 = _tmpl$29();
|
|
6082
|
+
_el$125.addEventListener("blur", ($event) => {
|
|
6083
|
+
onEditorBlur($event);
|
|
6084
|
+
});
|
|
6085
|
+
_el$125.$$keydown = ($event) => {
|
|
6086
|
+
onEditorKeyDown($event);
|
|
6087
|
+
};
|
|
6088
|
+
_el$125.$$input = ($event) => {
|
|
6089
|
+
onCellEditorInput(cell().column.id, $event);
|
|
6090
|
+
};
|
|
6091
|
+
effect(() => setAttribute(_el$125, "aria-invalid", rozieAttr(invalidMsg() ? "true" : null)));
|
|
6092
|
+
effect(() => _el$125.value = editorValueFor(cell().column.id));
|
|
6093
|
+
return _el$125;
|
|
6094
|
+
})();
|
|
6095
|
+
},
|
|
6096
|
+
get children() {
|
|
6097
|
+
var _el$124 = _tmpl$12();
|
|
6098
|
+
_el$124.$$keydown = ($event) => {
|
|
6099
|
+
onEditorDropinKeyDown($event);
|
|
6100
|
+
};
|
|
6101
|
+
_el$124.style.setProperty("display", "contents");
|
|
6102
|
+
insert(_el$124, () => _props.slots?.[`editor-${cell().column.id}`]?.({
|
|
6103
|
+
get columnId() {
|
|
6104
|
+
return cell().column.id;
|
|
6105
|
+
},
|
|
6106
|
+
get column() {
|
|
6107
|
+
return cell().column;
|
|
6108
|
+
},
|
|
6109
|
+
get row() {
|
|
6110
|
+
return cellSlotRow(wr().row);
|
|
6111
|
+
},
|
|
6112
|
+
get value() {
|
|
6113
|
+
return editorValueFor(cell().column.id);
|
|
6114
|
+
},
|
|
6115
|
+
get commit() {
|
|
6116
|
+
return editorCommitFor(cell().column.id);
|
|
6117
|
+
},
|
|
6118
|
+
get cancel() {
|
|
6119
|
+
return editorCancelFor();
|
|
6120
|
+
},
|
|
6121
|
+
get columnLabel() {
|
|
6122
|
+
return headerLabel(cell().column.id);
|
|
6123
|
+
},
|
|
6124
|
+
get autofocus() {
|
|
6125
|
+
return editorAutofocusFor(cell().column.id, wr().vi.index);
|
|
6126
|
+
}
|
|
6127
|
+
}) ?? (_props.editorSlot ?? _props.slots?.["editor"])?.({
|
|
6128
|
+
get columnId() {
|
|
6129
|
+
return cell().column.id;
|
|
6130
|
+
},
|
|
6131
|
+
get column() {
|
|
6132
|
+
return cell().column;
|
|
6133
|
+
},
|
|
6134
|
+
get row() {
|
|
6135
|
+
return cellSlotRow(wr().row);
|
|
6136
|
+
},
|
|
6137
|
+
get value() {
|
|
6138
|
+
return editorValueFor(cell().column.id);
|
|
6139
|
+
},
|
|
6140
|
+
get commit() {
|
|
6141
|
+
return editorCommitFor(cell().column.id);
|
|
6142
|
+
},
|
|
6143
|
+
get cancel() {
|
|
6144
|
+
return editorCancelFor();
|
|
6145
|
+
},
|
|
6146
|
+
get columnLabel() {
|
|
6147
|
+
return headerLabel(cell().column.id);
|
|
6148
|
+
},
|
|
6149
|
+
get autofocus() {
|
|
6150
|
+
return editorAutofocusFor(cell().column.id, wr().vi.index);
|
|
6151
|
+
}
|
|
6152
|
+
}) ?? (() => {
|
|
6153
|
+
var _el$126 = _tmpl$29();
|
|
6154
|
+
_el$126.addEventListener("blur", ($event) => {
|
|
6155
|
+
onEditorBlur($event);
|
|
6156
|
+
});
|
|
6157
|
+
_el$126.$$keydown = ($event) => {
|
|
6158
|
+
onEditorKeyDown($event);
|
|
6159
|
+
};
|
|
6160
|
+
_el$126.$$input = ($event) => {
|
|
6161
|
+
onCellEditorInput(cell().column.id, $event);
|
|
6162
|
+
};
|
|
6163
|
+
effect(() => setAttribute(_el$126, "aria-invalid", rozieAttr(invalidMsg() ? "true" : null)));
|
|
6164
|
+
effect(() => _el$126.value = editorValueFor(cell().column.id));
|
|
6165
|
+
return _el$126;
|
|
6166
|
+
})());
|
|
6167
|
+
return _el$124;
|
|
6168
|
+
}
|
|
6169
|
+
});
|
|
6170
|
+
},
|
|
6171
|
+
get children() {
|
|
6172
|
+
var _el$123 = _tmpl$28();
|
|
6173
|
+
_el$123.addEventListener("blur", ($event) => {
|
|
6174
|
+
onEditorBlur($event);
|
|
6175
|
+
});
|
|
6176
|
+
_el$123.$$keydown = ($event) => {
|
|
6177
|
+
onEditorKeyDown($event);
|
|
6178
|
+
};
|
|
6179
|
+
_el$123.addEventListener("change", ($event) => {
|
|
6180
|
+
onCellEditorCheckbox(cell().column.id, $event);
|
|
6181
|
+
});
|
|
6182
|
+
effect(() => setAttribute(_el$123, "aria-invalid", rozieAttr(invalidMsg() ? "true" : null)));
|
|
6183
|
+
effect(() => _el$123.checked = editorCheckedFor(cell().column.id));
|
|
6184
|
+
return _el$123;
|
|
6185
|
+
}
|
|
6186
|
+
});
|
|
6187
|
+
},
|
|
6188
|
+
get children() {
|
|
6189
|
+
var _el$122 = _tmpl$27();
|
|
6190
|
+
_el$122.addEventListener("blur", ($event) => {
|
|
6191
|
+
onEditorBlur($event);
|
|
6192
|
+
});
|
|
6193
|
+
_el$122.$$keydown = ($event) => {
|
|
6194
|
+
onEditorKeyDown($event);
|
|
6195
|
+
};
|
|
6196
|
+
_el$122.addEventListener("change", ($event) => {
|
|
6197
|
+
onCellEditorInput(cell().column.id, $event);
|
|
6198
|
+
});
|
|
6199
|
+
insert(_el$122, createComponent(Key, {
|
|
6200
|
+
get each() {
|
|
6201
|
+
return editorOptionsOf(cell().column.id);
|
|
6202
|
+
},
|
|
6203
|
+
by: (opt) => opt.value,
|
|
6204
|
+
children: (opt) => (() => {
|
|
6205
|
+
var _el$127 = _tmpl$30();
|
|
6206
|
+
insert(_el$127, () => rozieDisplay(opt().label));
|
|
6207
|
+
effect(() => _el$127.value = rozieAttr(opt().value));
|
|
6208
|
+
return _el$127;
|
|
6209
|
+
})()
|
|
6210
|
+
}));
|
|
6211
|
+
effect(() => setAttribute(_el$122, "aria-invalid", rozieAttr(invalidMsg() ? "true" : null)));
|
|
6212
|
+
effect(() => _el$122.value = editorValueFor(cell().column.id));
|
|
6213
|
+
return _el$122;
|
|
6214
|
+
}
|
|
6215
|
+
});
|
|
6216
|
+
},
|
|
6217
|
+
get children() {
|
|
6218
|
+
var _el$121 = _tmpl$26();
|
|
6219
|
+
_el$121.addEventListener("blur", ($event) => {
|
|
6220
|
+
onEditorBlur($event);
|
|
6221
|
+
});
|
|
6222
|
+
_el$121.$$keydown = ($event) => {
|
|
6223
|
+
onEditorKeyDown($event);
|
|
6224
|
+
};
|
|
6225
|
+
_el$121.$$input = ($event) => {
|
|
6226
|
+
onCellEditorInput(cell().column.id, $event);
|
|
6227
|
+
};
|
|
6228
|
+
effect(() => setAttribute(_el$121, "aria-invalid", rozieAttr(invalidMsg() ? "true" : null)));
|
|
6229
|
+
effect(() => _el$121.value = editorValueFor(cell().column.id));
|
|
6230
|
+
return _el$121;
|
|
6231
|
+
}
|
|
6232
|
+
}));
|
|
6233
|
+
return _el$118;
|
|
6234
|
+
}
|
|
6235
|
+
});
|
|
6236
|
+
},
|
|
6237
|
+
get children() {
|
|
6238
|
+
var _el$114 = _tmpl$24(), _el$115 = _el$114.firstChild, _el$116 = _el$115.nextSibling, _el$117 = _el$116.nextSibling;
|
|
6239
|
+
_el$114.style.setProperty("display", "contents");
|
|
6240
|
+
_el$115.$$click = ($event) => {
|
|
6241
|
+
onToggleExpand(wr().row, $event);
|
|
6242
|
+
};
|
|
6243
|
+
insert(_el$115, () => rozieDisplay(rowIsExpanded(wr().row) ? "▾" : "▸"));
|
|
6244
|
+
insert(_el$116, () => _props.slots?.[`cell-${cell().column.id}`]?.({
|
|
6245
|
+
get columnId() {
|
|
6246
|
+
return cell().column.id;
|
|
6247
|
+
},
|
|
6248
|
+
get column() {
|
|
6249
|
+
return cell().column;
|
|
6250
|
+
},
|
|
6251
|
+
get row() {
|
|
6252
|
+
return cellSlotRow(wr().row);
|
|
6253
|
+
},
|
|
6254
|
+
get value() {
|
|
6255
|
+
return cell().getValue();
|
|
6256
|
+
}
|
|
6257
|
+
}) ?? (_props.cellSlot ?? _props.slots?.["cell"])?.({
|
|
6258
|
+
get columnId() {
|
|
6259
|
+
return cell().column.id;
|
|
6260
|
+
},
|
|
6261
|
+
get column() {
|
|
6262
|
+
return cell().column;
|
|
6263
|
+
},
|
|
6264
|
+
get row() {
|
|
6265
|
+
return cellSlotRow(wr().row);
|
|
6266
|
+
},
|
|
6267
|
+
get value() {
|
|
6268
|
+
return cell().getValue();
|
|
6269
|
+
}
|
|
6270
|
+
}) ?? rozieDisplay(cell().getValue()));
|
|
6271
|
+
insert(_el$117, () => rozieDisplay("(" + groupSubRowCount(wr().row) + ")"));
|
|
6272
|
+
effect((_p$) => {
|
|
6273
|
+
var _v$91 = !!rowIsExpanded(wr().row), _v$92 = rozieAttr(rowIsExpanded(wr().row) ? "Collapse group" : "Expand group");
|
|
6274
|
+
_v$91 !== _p$.e && setAttribute(_el$115, "aria-expanded", _p$.e = _v$91);
|
|
6275
|
+
_v$92 !== _p$.t && setAttribute(_el$115, "aria-label", _p$.t = _v$92);
|
|
6276
|
+
return _p$;
|
|
6277
|
+
}, {
|
|
6278
|
+
e: void 0,
|
|
6279
|
+
t: void 0
|
|
6280
|
+
});
|
|
6281
|
+
return _el$114;
|
|
6282
|
+
}
|
|
6283
|
+
});
|
|
6284
|
+
},
|
|
6285
|
+
get children() {
|
|
6286
|
+
var _el$113 = _tmpl$12();
|
|
6287
|
+
_el$113.style.setProperty("display", "contents");
|
|
6288
|
+
insert(_el$113, () => (_props.selectCellSlot ?? _props.slots?.["selectCell"])?.({
|
|
6289
|
+
get row() {
|
|
6290
|
+
return cellSlotRow(wr().row);
|
|
6291
|
+
},
|
|
6292
|
+
get checked() {
|
|
6293
|
+
return rowIsSelected(wr().row);
|
|
6294
|
+
},
|
|
6295
|
+
toggle: (e) => onToggleRow(wr().row, e)
|
|
6296
|
+
}) ?? (() => {
|
|
6297
|
+
var _el$128 = _tmpl$31();
|
|
6298
|
+
_el$128.addEventListener("change", ($event) => {
|
|
6299
|
+
onToggleRow(wr().row, $event);
|
|
6300
|
+
});
|
|
6301
|
+
effect(() => _el$128.checked = rowIsSelected(wr().row));
|
|
6302
|
+
return _el$128;
|
|
6303
|
+
})());
|
|
6304
|
+
return _el$113;
|
|
6305
|
+
}
|
|
6306
|
+
});
|
|
6307
|
+
},
|
|
6308
|
+
get children() {
|
|
6309
|
+
var _el$112 = _tmpl$12();
|
|
6310
|
+
_el$112.style.setProperty("display", "contents");
|
|
6311
|
+
insert(_el$112, () => createComponent(Show, {
|
|
6312
|
+
get when() {
|
|
6313
|
+
return rowCanExpand(wr().row);
|
|
6314
|
+
},
|
|
6315
|
+
get children() {
|
|
6316
|
+
var _el$129 = _tmpl$32();
|
|
6317
|
+
_el$129.$$click = ($event) => {
|
|
6318
|
+
onToggleExpand(wr().row, $event);
|
|
6319
|
+
};
|
|
6320
|
+
insert(_el$129, () => rozieDisplay(rowIsExpanded(wr().row) ? "▾" : "▸"));
|
|
6321
|
+
effect((_p$) => {
|
|
6322
|
+
var _v$93 = !!rowIsExpanded(wr().row), _v$94 = rozieAttr(rowIsExpanded(wr().row) ? "Collapse row" : "Expand row");
|
|
6323
|
+
_v$93 !== _p$.e && setAttribute(_el$129, "aria-expanded", _p$.e = _v$93);
|
|
6324
|
+
_v$94 !== _p$.t && setAttribute(_el$129, "aria-label", _p$.t = _v$94);
|
|
6325
|
+
return _p$;
|
|
6326
|
+
}, {
|
|
6327
|
+
e: void 0,
|
|
6328
|
+
t: void 0
|
|
6329
|
+
});
|
|
6330
|
+
return _el$129;
|
|
6331
|
+
}
|
|
6332
|
+
}));
|
|
6333
|
+
return _el$112;
|
|
6334
|
+
}
|
|
6335
|
+
});
|
|
6336
|
+
},
|
|
6337
|
+
get children() {
|
|
6338
|
+
var _el$111 = _tmpl$12();
|
|
6339
|
+
_el$111.style.setProperty("display", "contents");
|
|
6340
|
+
insert(_el$111, () => (_props.placeholderSlot ?? _props.slots?.["placeholder"])?.({
|
|
6341
|
+
get index() {
|
|
6342
|
+
return wr().vi.index;
|
|
6343
|
+
},
|
|
6344
|
+
get columnId() {
|
|
6345
|
+
return cell().column.id;
|
|
6346
|
+
}
|
|
6347
|
+
}) ?? _tmpl$38());
|
|
6348
|
+
return _el$111;
|
|
6349
|
+
}
|
|
6350
|
+
});
|
|
6351
|
+
},
|
|
6352
|
+
get children() {
|
|
6353
|
+
var _el$110 = _tmpl$12();
|
|
6354
|
+
_el$110.style.setProperty("display", "contents");
|
|
6355
|
+
return _el$110;
|
|
6356
|
+
}
|
|
6357
|
+
});
|
|
6358
|
+
},
|
|
6359
|
+
get children() {
|
|
6360
|
+
var _el$108 = _tmpl$37(), _el$109 = _el$108.firstChild;
|
|
6361
|
+
_el$108.style.setProperty("display", "contents");
|
|
6362
|
+
_el$109.disabled = true;
|
|
6363
|
+
_el$109.style.setProperty("visibility", "hidden");
|
|
6364
|
+
return _el$108;
|
|
6365
|
+
}
|
|
6366
|
+
}), null);
|
|
6367
|
+
insert(_el$107, () => createComponent(Show, {
|
|
6368
|
+
get when() {
|
|
6369
|
+
return isFillHandleCell(wr().vi.index, colIndexOf(wr().row, cell()));
|
|
6370
|
+
},
|
|
6371
|
+
get children() {
|
|
6372
|
+
var _el$131 = _tmpl$33();
|
|
6373
|
+
_el$131.$$pointerdown = ($event) => {
|
|
6374
|
+
onFillHandlePointerDown($event);
|
|
6375
|
+
};
|
|
6376
|
+
return _el$131;
|
|
6377
|
+
}
|
|
6378
|
+
}), null);
|
|
6379
|
+
effect((_p$) => {
|
|
6380
|
+
var _v$79 = "rdt-td " + rozieClass({
|
|
6381
|
+
"rdt-select-td": isSelectColumn(cell().column.id),
|
|
6382
|
+
"rdt-expander-td": isExpanderColumn(cell().column.id),
|
|
6383
|
+
"rdt-pinned": columnPinSide(cell().column.id) !== "",
|
|
6384
|
+
"rdt-in-range": inRange(wr().vi.index, colIndexOf(wr().row, cell())),
|
|
6385
|
+
"rdt-cell-active": isActiveCell(String(wr().vi.index), colIndexOf(wr().row, cell()))
|
|
6386
|
+
}), _v$80 = rozieAttr(cellRole()), _v$81 = rozieAttr(cell().column.id), _v$82 = rozieAttr(wr().vi.index), _v$83 = rozieAttr(colIndexOf(wr().row, cell())), _v$84 = rozieAttr(cellTabindex(String(wr().vi.index), colIndexOf(wr().row, cell()))), _v$85 = parseInlineStyle(bodyCellStyle(wr().row, cell().column.id)), _v$86 = rozieAttr(cellAriaInvalid(wr().vi.index, colIndexOf(wr().row, cell()))), _v$87 = rozieAttr(colIndexOf(wr().row, cell()) + 1), _v$88 = (inRange(wr().vi.index, colIndexOf(wr().row, cell())) ? "true" : null) ?? void 0, _v$89 = rozieAttr(inRange(wr().vi.index, colIndexOf(wr().row, cell())) ? "true" : null), _v$90 = rozieAttr(cellIsAggregated(cell()) ? cell().column.id : null);
|
|
6387
|
+
_v$79 !== _p$.e && className(_el$107, _p$.e = _v$79);
|
|
6388
|
+
_v$80 !== _p$.t && setAttribute(_el$107, "role", _p$.t = _v$80);
|
|
6389
|
+
_v$81 !== _p$.a && setAttribute(_el$107, "data-col", _p$.a = _v$81);
|
|
6390
|
+
_v$82 !== _p$.o && setAttribute(_el$107, "data-row", _p$.o = _v$82);
|
|
6391
|
+
_v$83 !== _p$.i && setAttribute(_el$107, "data-col-index", _p$.i = _v$83);
|
|
6392
|
+
_v$84 !== _p$.n && setAttribute(_el$107, "tabindex", _p$.n = _v$84);
|
|
6393
|
+
_p$.s = style(_el$107, _v$85, _p$.s);
|
|
6394
|
+
_v$86 !== _p$.h && setAttribute(_el$107, "aria-invalid", _p$.h = _v$86);
|
|
6395
|
+
_v$87 !== _p$.r && setAttribute(_el$107, "aria-colindex", _p$.r = _v$87);
|
|
6396
|
+
_v$88 !== _p$.d && setAttribute(_el$107, "aria-selected", _p$.d = _v$88);
|
|
6397
|
+
_v$89 !== _p$.l && setAttribute(_el$107, "data-in-range", _p$.l = _v$89);
|
|
6398
|
+
_v$90 !== _p$.u && setAttribute(_el$107, "data-agg-cell", _p$.u = _v$90);
|
|
6399
|
+
return _p$;
|
|
6400
|
+
}, {
|
|
6401
|
+
e: void 0,
|
|
6402
|
+
t: void 0,
|
|
6403
|
+
a: void 0,
|
|
6404
|
+
o: void 0,
|
|
6405
|
+
i: void 0,
|
|
6406
|
+
n: void 0,
|
|
6407
|
+
s: void 0,
|
|
6408
|
+
h: void 0,
|
|
6409
|
+
r: void 0,
|
|
6410
|
+
d: void 0,
|
|
6411
|
+
l: void 0,
|
|
6412
|
+
u: void 0
|
|
6413
|
+
});
|
|
6414
|
+
return _el$107;
|
|
6415
|
+
})()
|
|
6416
|
+
}), null);
|
|
6417
|
+
insert(_el$105, () => createComponent(Show, {
|
|
6418
|
+
get when() {
|
|
6419
|
+
return colsWindowed();
|
|
6420
|
+
},
|
|
6421
|
+
get children() {
|
|
6422
|
+
var _el$132 = _tmpl$36();
|
|
6423
|
+
effect((_$p) => style(_el$132, parseInlineStyle("width:" + colPadRight() + "px;padding:0;border:0"), _$p));
|
|
6424
|
+
return _el$132;
|
|
6425
|
+
}
|
|
6426
|
+
}), null);
|
|
6427
|
+
effect((_p$) => {
|
|
6428
|
+
var _v$67 = "rdt-tr " + rozieClass({
|
|
6429
|
+
"rdt-group-header": rowIsGrouped(wr().row),
|
|
6430
|
+
"rdt-row-pinned": wr().pinned,
|
|
6431
|
+
"rdt-placeholder-row": rowIsLazyPlaceholder(wr().row)
|
|
6432
|
+
}), _v$68 = rozieAttr(wr().vi.index), _v$69 = rozieAttr(headerRowCount() + wr().vi.index + 1), _v$70 = rozieAttr(wr().vi.index), _v$71 = rozieAttr(wr().pinned ? "true" : null), _v$72 = rozieAttr(wr().row.depth), _v$73 = rozieAttr(rowIsGrouped(wr().row) ? wr().row.id : null), _v$74 = rozieAttr(groupingActive() && !rowIsGrouped(wr().row) ? wr().row.id : null), _v$75 = (rowIsGrouped(wr().row) ? !!rowIsExpanded(wr().row) : null) ?? void 0, _v$76 = (local.selectionMode !== "none" ? !!rowIsSelected(wr().row) : null) ?? void 0, _v$77 = rozieAttr(groupingActive() ? wr().row.depth + 1 : null), _v$78 = (rowIsLazyPlaceholder(wr().row) ? "true" : null) ?? void 0;
|
|
6433
|
+
_v$67 !== _p$.e && className(_el$105, _p$.e = _v$67);
|
|
6434
|
+
_v$68 !== _p$.t && setAttribute(_el$105, "data-row", _p$.t = _v$68);
|
|
6435
|
+
_v$69 !== _p$.a && setAttribute(_el$105, "aria-rowindex", _p$.a = _v$69);
|
|
6436
|
+
_v$70 !== _p$.o && setAttribute(_el$105, "data-index", _p$.o = _v$70);
|
|
6437
|
+
_v$71 !== _p$.i && setAttribute(_el$105, "data-pinned", _p$.i = _v$71);
|
|
6438
|
+
_v$72 !== _p$.n && setAttribute(_el$105, "data-depth", _p$.n = _v$72);
|
|
6439
|
+
_v$73 !== _p$.s && setAttribute(_el$105, "data-group-header", _p$.s = _v$73);
|
|
6440
|
+
_v$74 !== _p$.h && setAttribute(_el$105, "data-group-leaf", _p$.h = _v$74);
|
|
6441
|
+
_v$75 !== _p$.r && setAttribute(_el$105, "aria-expanded", _p$.r = _v$75);
|
|
6442
|
+
_v$76 !== _p$.d && setAttribute(_el$105, "aria-selected", _p$.d = _v$76);
|
|
6443
|
+
_v$77 !== _p$.l && setAttribute(_el$105, "aria-level", _p$.l = _v$77);
|
|
6444
|
+
_v$78 !== _p$.u && setAttribute(_el$105, "aria-busy", _p$.u = _v$78);
|
|
6445
|
+
return _p$;
|
|
6446
|
+
}, {
|
|
6447
|
+
e: void 0,
|
|
6448
|
+
t: void 0,
|
|
6449
|
+
a: void 0,
|
|
6450
|
+
o: void 0,
|
|
6451
|
+
i: void 0,
|
|
6452
|
+
n: void 0,
|
|
6453
|
+
s: void 0,
|
|
6454
|
+
h: void 0,
|
|
6455
|
+
r: void 0,
|
|
6456
|
+
d: void 0,
|
|
6457
|
+
l: void 0,
|
|
6458
|
+
u: void 0
|
|
6459
|
+
});
|
|
6460
|
+
return _el$105;
|
|
6461
|
+
})(), memo(() => createComponent(Show, {
|
|
6462
|
+
get when() {
|
|
6463
|
+
return rowShowsDetail(wr().row);
|
|
6464
|
+
},
|
|
6465
|
+
get children() {
|
|
6466
|
+
var _el$133 = _tmpl$34(), _el$134 = _el$133.firstChild;
|
|
6467
|
+
insert(_el$134, () => (_props.detailSlot ?? _props.slots?.["detail"])?.({ get row() {
|
|
6468
|
+
return wr().row.original;
|
|
6469
|
+
} }));
|
|
6470
|
+
effect((_p$) => {
|
|
6471
|
+
var _v$95 = rozieAttr(wr().row.id), _v$96 = rozieAttr(windowedColSpan());
|
|
6472
|
+
_v$95 !== _p$.e && setAttribute(_el$133, "data-detail-row", _p$.e = _v$95);
|
|
6473
|
+
_v$96 !== _p$.t && setAttribute(_el$134, "colspan", _p$.t = _v$96);
|
|
6474
|
+
return _p$;
|
|
6475
|
+
}, {
|
|
6476
|
+
e: void 0,
|
|
6477
|
+
t: void 0
|
|
6478
|
+
});
|
|
6479
|
+
return _el$133;
|
|
6480
|
+
}
|
|
6481
|
+
}))]
|
|
6482
|
+
}), _el$21);
|
|
6483
|
+
effect((_p$) => {
|
|
6484
|
+
var _v$ = parseInlineStyle(rowsWindowed() && local.maxHeight ? "max-height:" + local.maxHeight + ";overflow:auto;--rozie-data-table-max-height:" + local.maxHeight : "overflow:auto"), _v$2 = rozieAttr(gridAriaRowCount()), _v$3 = rozieAttr(gridAriaColCount()), _v$4 = "rozie-data-table " + rozieClass({
|
|
6485
|
+
"rdt-sticky": local.stickyHeader,
|
|
6486
|
+
"rdt-col-windowed": colsWindowed()
|
|
6487
|
+
}), _v$5 = rozieAttr(tableRole()), _v$6 = rozieAttr(windowedColSpan()), _v$7 = parseInlineStyle("height:" + padTop() + "px;padding:0;border:0"), _v$8 = rozieAttr(windowedColSpan()), _v$9 = parseInlineStyle("height:" + padBottom() + "px;padding:0;border:0");
|
|
6488
|
+
_p$.e = style(_el$15, _v$, _p$.e);
|
|
6489
|
+
_v$2 !== _p$.t && setAttribute(_el$16, "aria-rowcount", _p$.t = _v$2);
|
|
6490
|
+
_v$3 !== _p$.a && setAttribute(_el$16, "aria-colcount", _p$.a = _v$3);
|
|
6491
|
+
_v$4 !== _p$.o && className(_el$16, _p$.o = _v$4);
|
|
6492
|
+
_v$5 !== _p$.i && setAttribute(_el$16, "role", _p$.i = _v$5);
|
|
6493
|
+
_v$6 !== _p$.n && setAttribute(_el$20, "colspan", _p$.n = _v$6);
|
|
6494
|
+
_p$.s = style(_el$20, _v$7, _p$.s);
|
|
6495
|
+
_v$8 !== _p$.h && setAttribute(_el$22, "colspan", _p$.h = _v$8);
|
|
6496
|
+
_p$.r = style(_el$22, _v$9, _p$.r);
|
|
6497
|
+
return _p$;
|
|
6498
|
+
}, {
|
|
6499
|
+
e: void 0,
|
|
6500
|
+
t: void 0,
|
|
6501
|
+
a: void 0,
|
|
6502
|
+
o: void 0,
|
|
6503
|
+
i: void 0,
|
|
6504
|
+
n: void 0,
|
|
6505
|
+
s: void 0,
|
|
6506
|
+
h: void 0,
|
|
6507
|
+
r: void 0
|
|
6508
|
+
});
|
|
6509
|
+
return _el$15;
|
|
6510
|
+
}
|
|
6511
|
+
}), null);
|
|
6512
|
+
insert(_el$, () => createComponent(Show, {
|
|
6513
|
+
get when() {
|
|
6514
|
+
return !rowsWindowed();
|
|
6515
|
+
},
|
|
6516
|
+
get children() {
|
|
6517
|
+
var _el$135 = _tmpl$39(), _el$136 = _el$135.firstChild, _el$137 = _el$136.nextSibling, _el$138 = _el$137.nextSibling, _el$139 = _el$138.nextSibling;
|
|
6518
|
+
_el$136.$$click = ($event) => {
|
|
6519
|
+
onPrevPage();
|
|
6520
|
+
};
|
|
6521
|
+
insert(_el$137, () => rozieDisplay("Page " + (pageIndex() + 1) + " of " + displayPageCount()));
|
|
6522
|
+
_el$138.$$click = ($event) => {
|
|
6523
|
+
onNextPage();
|
|
6524
|
+
};
|
|
6525
|
+
_el$139.addEventListener("change", ($event) => {
|
|
6526
|
+
onPageSizeChange($event);
|
|
6527
|
+
});
|
|
6528
|
+
effect((_p$) => {
|
|
6529
|
+
var _v$97 = !canPrevPage(), _v$98 = !canNextPage();
|
|
6530
|
+
_v$97 !== _p$.e && (_el$136.disabled = _p$.e = _v$97);
|
|
6531
|
+
_v$98 !== _p$.t && (_el$138.disabled = _p$.t = _v$98);
|
|
6532
|
+
return _p$;
|
|
6533
|
+
}, {
|
|
6534
|
+
e: void 0,
|
|
6535
|
+
t: void 0
|
|
6536
|
+
});
|
|
6537
|
+
effect(() => _el$139.value = pageSize());
|
|
6538
|
+
return _el$135;
|
|
6539
|
+
}
|
|
6540
|
+
}), null);
|
|
6541
|
+
effect(() => _el$4.value = globalFilterValue());
|
|
6542
|
+
return _el$;
|
|
6543
|
+
}
|
|
6544
|
+
});
|
|
4581
6545
|
}
|
|
6546
|
+
delegateEvents([
|
|
6547
|
+
"input",
|
|
6548
|
+
"keydown",
|
|
6549
|
+
"focusin",
|
|
6550
|
+
"focusout",
|
|
6551
|
+
"mousedown",
|
|
6552
|
+
"dblclick",
|
|
6553
|
+
"click",
|
|
6554
|
+
"pointerdown",
|
|
6555
|
+
"touchstart"
|
|
6556
|
+
]);
|
|
4582
6557
|
//#endregion
|
|
4583
6558
|
//#region src/Column.tsx
|
|
6559
|
+
var _tmpl$$10 = /* @__PURE__ */ template(`<div class=rozie-data-table-column data-rozie-s-289f2d72="">`);
|
|
4584
6560
|
function Column(_props) {
|
|
4585
6561
|
const [local, attrs] = splitProps(mergeProps({
|
|
4586
6562
|
id: "",
|
|
@@ -4676,13 +6652,15 @@ function Column(_props) {
|
|
|
4676
6652
|
validate: local.validate
|
|
4677
6653
|
};
|
|
4678
6654
|
}
|
|
4679
|
-
return
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
6655
|
+
return (() => {
|
|
6656
|
+
var _el$ = _tmpl$$10();
|
|
6657
|
+
_el$.style.setProperty("display", "none");
|
|
6658
|
+
return _el$;
|
|
6659
|
+
})();
|
|
4683
6660
|
}
|
|
4684
6661
|
//#endregion
|
|
4685
6662
|
//#region src/EditorText.tsx
|
|
6663
|
+
var _tmpl$$9 = /* @__PURE__ */ template(`<input type=text data-editing-cell=""class=rdt-cell-editor data-rozie-s-0d17f43a="">`);
|
|
4686
6664
|
function EditorText(_props) {
|
|
4687
6665
|
const [local, attrs] = splitProps(mergeProps({
|
|
4688
6666
|
columnId: "",
|
|
@@ -4691,7 +6669,8 @@ function EditorText(_props) {
|
|
|
4691
6669
|
value: null,
|
|
4692
6670
|
commit: null,
|
|
4693
6671
|
cancel: null,
|
|
4694
|
-
autofocus: false
|
|
6672
|
+
autofocus: false,
|
|
6673
|
+
columnLabel: ""
|
|
4695
6674
|
}, _props), [
|
|
4696
6675
|
"columnId",
|
|
4697
6676
|
"column",
|
|
@@ -4699,9 +6678,11 @@ function EditorText(_props) {
|
|
|
4699
6678
|
"value",
|
|
4700
6679
|
"commit",
|
|
4701
6680
|
"cancel",
|
|
4702
|
-
"autofocus"
|
|
6681
|
+
"autofocus",
|
|
6682
|
+
"columnLabel"
|
|
4703
6683
|
]);
|
|
4704
6684
|
const [draft, setDraft] = createSignal("");
|
|
6685
|
+
const [touched, setTouched] = createSignal(false);
|
|
4705
6686
|
onMount(() => {
|
|
4706
6687
|
if (local.autofocus) inputElRef?.focus();
|
|
4707
6688
|
});
|
|
@@ -4709,12 +6690,15 @@ function EditorText(_props) {
|
|
|
4709
6690
|
if (v) inputElRef?.focus();
|
|
4710
6691
|
})(v)), { defer: true }));
|
|
4711
6692
|
let inputElRef = null;
|
|
4712
|
-
|
|
6693
|
+
function draftValue() {
|
|
6694
|
+
return touched() ? draft() : local.value != null ? String(local.value) : "";
|
|
6695
|
+
}
|
|
4713
6696
|
function onInput(e) {
|
|
4714
6697
|
setDraft(e && e.target ? e.target.value : "");
|
|
6698
|
+
setTouched(true);
|
|
4715
6699
|
}
|
|
4716
6700
|
function doCommit() {
|
|
4717
|
-
local.commit && local.commit(
|
|
6701
|
+
local.commit && local.commit(draftValue());
|
|
4718
6702
|
}
|
|
4719
6703
|
function doCancel() {
|
|
4720
6704
|
local.cancel && local.cancel();
|
|
@@ -4731,20 +6715,33 @@ function EditorText(_props) {
|
|
|
4731
6715
|
function onBlur() {
|
|
4732
6716
|
doCommit();
|
|
4733
6717
|
}
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
}
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
6718
|
+
function a11yLabel() {
|
|
6719
|
+
if (typeof local.columnLabel === "string" && local.columnLabel !== "") return local.columnLabel;
|
|
6720
|
+
return local.columnId;
|
|
6721
|
+
}
|
|
6722
|
+
return (() => {
|
|
6723
|
+
var _el$ = _tmpl$$9();
|
|
6724
|
+
_el$.addEventListener("blur", ($event) => {
|
|
6725
|
+
onBlur();
|
|
6726
|
+
});
|
|
6727
|
+
_el$.$$keydown = ($event) => {
|
|
6728
|
+
onKeydown($event);
|
|
6729
|
+
};
|
|
6730
|
+
_el$.$$input = ($event) => {
|
|
6731
|
+
onInput($event);
|
|
6732
|
+
};
|
|
6733
|
+
use((el) => {
|
|
6734
|
+
inputElRef = el;
|
|
6735
|
+
}, _el$);
|
|
6736
|
+
effect(() => setAttribute(_el$, "aria-label", rozieAttr(a11yLabel())));
|
|
6737
|
+
effect(() => _el$.value = draftValue());
|
|
6738
|
+
return _el$;
|
|
6739
|
+
})();
|
|
4745
6740
|
}
|
|
6741
|
+
delegateEvents(["input", "keydown"]);
|
|
4746
6742
|
//#endregion
|
|
4747
6743
|
//#region src/EditorNumber.tsx
|
|
6744
|
+
var _tmpl$$8 = /* @__PURE__ */ template(`<input type=number data-editing-cell=""class=rdt-cell-editor data-rozie-s-b2792b32="">`);
|
|
4748
6745
|
function EditorNumber(_props) {
|
|
4749
6746
|
const [local, attrs] = splitProps(mergeProps({
|
|
4750
6747
|
columnId: "",
|
|
@@ -4752,23 +6749,38 @@ function EditorNumber(_props) {
|
|
|
4752
6749
|
row: null,
|
|
4753
6750
|
value: null,
|
|
4754
6751
|
commit: null,
|
|
4755
|
-
cancel: null
|
|
6752
|
+
cancel: null,
|
|
6753
|
+
autofocus: false,
|
|
6754
|
+
columnLabel: ""
|
|
4756
6755
|
}, _props), [
|
|
4757
6756
|
"columnId",
|
|
4758
6757
|
"column",
|
|
4759
6758
|
"row",
|
|
4760
6759
|
"value",
|
|
4761
6760
|
"commit",
|
|
4762
|
-
"cancel"
|
|
6761
|
+
"cancel",
|
|
6762
|
+
"autofocus",
|
|
6763
|
+
"columnLabel"
|
|
4763
6764
|
]);
|
|
4764
6765
|
const [draft, setDraft] = createSignal("");
|
|
4765
|
-
|
|
6766
|
+
const [touched, setTouched] = createSignal(false);
|
|
6767
|
+
onMount(() => {
|
|
6768
|
+
if (local.autofocus) inputElRef?.focus();
|
|
6769
|
+
});
|
|
6770
|
+
createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
|
|
6771
|
+
if (v) inputElRef?.focus();
|
|
6772
|
+
})(v)), { defer: true }));
|
|
6773
|
+
let inputElRef = null;
|
|
6774
|
+
function draftValue() {
|
|
6775
|
+
return touched() ? draft() : local.value != null ? String(local.value) : "";
|
|
6776
|
+
}
|
|
4766
6777
|
function onInput(e) {
|
|
4767
6778
|
setDraft(e && e.target ? e.target.value : "");
|
|
6779
|
+
setTouched(true);
|
|
4768
6780
|
}
|
|
4769
6781
|
function doCommit() {
|
|
4770
6782
|
if (!local.commit) return;
|
|
4771
|
-
const raw =
|
|
6783
|
+
const raw = draftValue();
|
|
4772
6784
|
if (raw == null || String(raw).trim() === "") {
|
|
4773
6785
|
local.commit(null);
|
|
4774
6786
|
return;
|
|
@@ -4791,18 +6803,33 @@ function EditorNumber(_props) {
|
|
|
4791
6803
|
function onBlur() {
|
|
4792
6804
|
doCommit();
|
|
4793
6805
|
}
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
}
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
6806
|
+
function a11yLabel() {
|
|
6807
|
+
if (typeof local.columnLabel === "string" && local.columnLabel !== "") return local.columnLabel;
|
|
6808
|
+
return local.columnId;
|
|
6809
|
+
}
|
|
6810
|
+
return (() => {
|
|
6811
|
+
var _el$ = _tmpl$$8();
|
|
6812
|
+
_el$.addEventListener("blur", ($event) => {
|
|
6813
|
+
onBlur();
|
|
6814
|
+
});
|
|
6815
|
+
_el$.$$keydown = ($event) => {
|
|
6816
|
+
onKeydown($event);
|
|
6817
|
+
};
|
|
6818
|
+
_el$.$$input = ($event) => {
|
|
6819
|
+
onInput($event);
|
|
6820
|
+
};
|
|
6821
|
+
use((el) => {
|
|
6822
|
+
inputElRef = el;
|
|
6823
|
+
}, _el$);
|
|
6824
|
+
effect(() => setAttribute(_el$, "aria-label", rozieAttr(a11yLabel())));
|
|
6825
|
+
effect(() => _el$.value = draftValue());
|
|
6826
|
+
return _el$;
|
|
6827
|
+
})();
|
|
4803
6828
|
}
|
|
6829
|
+
delegateEvents(["input", "keydown"]);
|
|
4804
6830
|
//#endregion
|
|
4805
6831
|
//#region src/EditorSelect.tsx
|
|
6832
|
+
var _tmpl$$7 = /* @__PURE__ */ template(`<select data-editing-cell=""class=rdt-cell-editor data-rozie-s-117f1a16="">`), _tmpl$2$3 = /* @__PURE__ */ template(`<option data-rozie-s-117f1a16="">`);
|
|
4806
6833
|
function EditorSelect(_props) {
|
|
4807
6834
|
const [local, attrs] = splitProps(mergeProps({
|
|
4808
6835
|
columnId: "",
|
|
@@ -4811,7 +6838,9 @@ function EditorSelect(_props) {
|
|
|
4811
6838
|
value: null,
|
|
4812
6839
|
commit: null,
|
|
4813
6840
|
cancel: null,
|
|
4814
|
-
options: []
|
|
6841
|
+
options: [],
|
|
6842
|
+
autofocus: false,
|
|
6843
|
+
columnLabel: ""
|
|
4815
6844
|
}, _props), [
|
|
4816
6845
|
"columnId",
|
|
4817
6846
|
"column",
|
|
@@ -4819,15 +6848,28 @@ function EditorSelect(_props) {
|
|
|
4819
6848
|
"value",
|
|
4820
6849
|
"commit",
|
|
4821
6850
|
"cancel",
|
|
4822
|
-
"options"
|
|
6851
|
+
"options",
|
|
6852
|
+
"autofocus",
|
|
6853
|
+
"columnLabel"
|
|
4823
6854
|
]);
|
|
4824
6855
|
const [draft, setDraft] = createSignal("");
|
|
4825
|
-
|
|
6856
|
+
const [touched, setTouched] = createSignal(false);
|
|
6857
|
+
onMount(() => {
|
|
6858
|
+
if (local.autofocus) selectElRef?.focus();
|
|
6859
|
+
});
|
|
6860
|
+
createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
|
|
6861
|
+
if (v) selectElRef?.focus();
|
|
6862
|
+
})(v)), { defer: true }));
|
|
6863
|
+
let selectElRef = null;
|
|
6864
|
+
function draftValue() {
|
|
6865
|
+
return touched() ? draft() : local.value != null ? String(local.value) : "";
|
|
6866
|
+
}
|
|
4826
6867
|
function onChange(e) {
|
|
4827
6868
|
setDraft(e && e.target ? e.target.value : "");
|
|
6869
|
+
setTouched(true);
|
|
4828
6870
|
}
|
|
4829
6871
|
function doCommit() {
|
|
4830
|
-
local.commit && local.commit(
|
|
6872
|
+
local.commit && local.commit(draftValue());
|
|
4831
6873
|
}
|
|
4832
6874
|
function doCancel() {
|
|
4833
6875
|
local.cancel && local.cancel();
|
|
@@ -4844,20 +6886,45 @@ function EditorSelect(_props) {
|
|
|
4844
6886
|
function onBlur() {
|
|
4845
6887
|
doCommit();
|
|
4846
6888
|
}
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
}
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
6889
|
+
function a11yLabel() {
|
|
6890
|
+
if (typeof local.columnLabel === "string" && local.columnLabel !== "") return local.columnLabel;
|
|
6891
|
+
return local.columnId;
|
|
6892
|
+
}
|
|
6893
|
+
return (() => {
|
|
6894
|
+
var _el$ = _tmpl$$7();
|
|
6895
|
+
_el$.addEventListener("blur", ($event) => {
|
|
6896
|
+
onBlur();
|
|
6897
|
+
});
|
|
6898
|
+
_el$.$$keydown = ($event) => {
|
|
6899
|
+
onKeydown($event);
|
|
6900
|
+
};
|
|
6901
|
+
_el$.addEventListener("change", ($event) => {
|
|
6902
|
+
onChange($event);
|
|
6903
|
+
});
|
|
6904
|
+
use((el) => {
|
|
6905
|
+
selectElRef = el;
|
|
6906
|
+
}, _el$);
|
|
6907
|
+
insert(_el$, createComponent(Key, {
|
|
6908
|
+
get each() {
|
|
6909
|
+
return local.options;
|
|
6910
|
+
},
|
|
6911
|
+
by: (opt) => opt.value,
|
|
6912
|
+
children: (opt) => (() => {
|
|
6913
|
+
var _el$2 = _tmpl$2$3();
|
|
6914
|
+
insert(_el$2, () => rozieDisplay(opt().label));
|
|
6915
|
+
effect(() => _el$2.value = rozieAttr(opt().value));
|
|
6916
|
+
return _el$2;
|
|
6917
|
+
})()
|
|
6918
|
+
}));
|
|
6919
|
+
effect(() => setAttribute(_el$, "aria-label", rozieAttr(a11yLabel())));
|
|
6920
|
+
effect(() => _el$.value = draftValue());
|
|
6921
|
+
return _el$;
|
|
6922
|
+
})();
|
|
4858
6923
|
}
|
|
6924
|
+
delegateEvents(["keydown"]);
|
|
4859
6925
|
//#endregion
|
|
4860
6926
|
//#region src/EditorCheckbox.tsx
|
|
6927
|
+
var _tmpl$$6 = /* @__PURE__ */ template(`<input type=checkbox data-editing-cell=""class=rdt-cell-editor data-rozie-s-3d792482="">`);
|
|
4861
6928
|
function EditorCheckbox(_props) {
|
|
4862
6929
|
const [local, attrs] = splitProps(mergeProps({
|
|
4863
6930
|
columnId: "",
|
|
@@ -4865,15 +6932,26 @@ function EditorCheckbox(_props) {
|
|
|
4865
6932
|
row: null,
|
|
4866
6933
|
value: null,
|
|
4867
6934
|
commit: null,
|
|
4868
|
-
cancel: null
|
|
6935
|
+
cancel: null,
|
|
6936
|
+
autofocus: false,
|
|
6937
|
+
columnLabel: ""
|
|
4869
6938
|
}, _props), [
|
|
4870
6939
|
"columnId",
|
|
4871
6940
|
"column",
|
|
4872
6941
|
"row",
|
|
4873
6942
|
"value",
|
|
4874
6943
|
"commit",
|
|
4875
|
-
"cancel"
|
|
6944
|
+
"cancel",
|
|
6945
|
+
"autofocus",
|
|
6946
|
+
"columnLabel"
|
|
4876
6947
|
]);
|
|
6948
|
+
onMount(() => {
|
|
6949
|
+
if (local.autofocus) inputElRef?.focus();
|
|
6950
|
+
});
|
|
6951
|
+
createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
|
|
6952
|
+
if (v) inputElRef?.focus();
|
|
6953
|
+
})(v)), { defer: true }));
|
|
6954
|
+
let inputElRef = null;
|
|
4877
6955
|
function onChange(e) {
|
|
4878
6956
|
local.commit && local.commit(!!(e && e.target ? e.target.checked : false));
|
|
4879
6957
|
}
|
|
@@ -4883,16 +6961,63 @@ function EditorCheckbox(_props) {
|
|
|
4883
6961
|
local.cancel && local.cancel();
|
|
4884
6962
|
}
|
|
4885
6963
|
}
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
}
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
6964
|
+
function a11yLabel() {
|
|
6965
|
+
if (typeof local.columnLabel === "string" && local.columnLabel !== "") return local.columnLabel;
|
|
6966
|
+
return local.columnId;
|
|
6967
|
+
}
|
|
6968
|
+
return (() => {
|
|
6969
|
+
var _el$ = _tmpl$$6();
|
|
6970
|
+
_el$.$$keydown = ($event) => {
|
|
6971
|
+
onKeydown($event);
|
|
6972
|
+
};
|
|
6973
|
+
_el$.addEventListener("change", ($event) => {
|
|
6974
|
+
onChange($event);
|
|
6975
|
+
});
|
|
6976
|
+
use((el) => {
|
|
6977
|
+
inputElRef = el;
|
|
6978
|
+
}, _el$);
|
|
6979
|
+
effect(() => setAttribute(_el$, "aria-label", rozieAttr(a11yLabel())));
|
|
6980
|
+
effect(() => _el$.checked = !!local.value);
|
|
6981
|
+
return _el$;
|
|
6982
|
+
})();
|
|
4893
6983
|
}
|
|
6984
|
+
delegateEvents(["keydown"]);
|
|
6985
|
+
//#endregion
|
|
6986
|
+
//#region src/helpers/dateValue.ts
|
|
6987
|
+
/**
|
|
6988
|
+
* Coerce an arbitrary cell value to the `YYYY-MM-DD` string a native date input accepts.
|
|
6989
|
+
* Returns `''` for anything that cannot be read as a date — which is what the input shows for
|
|
6990
|
+
* "no date", so an unparseable value degrades to empty rather than to a broken control.
|
|
6991
|
+
*/
|
|
6992
|
+
const toIsoDateString = (v) => {
|
|
6993
|
+
if (v == null || v === "") return "";
|
|
6994
|
+
if (typeof v === "string") {
|
|
6995
|
+
const s = v.trim();
|
|
6996
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(s)) return s;
|
|
6997
|
+
const iso = /^(\d{4}-\d{2}-\d{2})T/.exec(s);
|
|
6998
|
+
if (iso) return iso[1];
|
|
6999
|
+
return fromDate(new Date(s));
|
|
7000
|
+
}
|
|
7001
|
+
if (typeof v === "number") return Number.isFinite(v) ? fromDate(new Date(v)) : "";
|
|
7002
|
+
if (typeof v === "object" && typeof v.getTime === "function") return fromDate(v);
|
|
7003
|
+
return "";
|
|
7004
|
+
};
|
|
7005
|
+
/**
|
|
7006
|
+
* Format a Date as `YYYY-MM-DD` from its LOCAL parts. Local, not UTC: the input renders a
|
|
7007
|
+
* calendar day, and `toISOString()` would show the previous day for anyone west of UTC on a
|
|
7008
|
+
* midnight-local value.
|
|
7009
|
+
*/
|
|
7010
|
+
const fromDate = (d) => {
|
|
7011
|
+
const t = d.getTime();
|
|
7012
|
+
if (!Number.isFinite(t)) return "";
|
|
7013
|
+
const y = d.getFullYear();
|
|
7014
|
+
const m = d.getMonth() + 1;
|
|
7015
|
+
const day = d.getDate();
|
|
7016
|
+
return String(y).padStart(4, "0") + "-" + String(m).padStart(2, "0") + "-" + String(day).padStart(2, "0");
|
|
7017
|
+
};
|
|
4894
7018
|
//#endregion
|
|
4895
7019
|
//#region src/EditorDate.tsx
|
|
7020
|
+
var _tmpl$$5 = /* @__PURE__ */ template(`<input type=date data-editing-cell=""class=rdt-cell-editor data-rozie-s-7abe1a56="">`);
|
|
4896
7021
|
function EditorDate(_props) {
|
|
4897
7022
|
const [local, attrs] = splitProps(mergeProps({
|
|
4898
7023
|
columnId: "",
|
|
@@ -4900,28 +7025,44 @@ function EditorDate(_props) {
|
|
|
4900
7025
|
row: null,
|
|
4901
7026
|
value: null,
|
|
4902
7027
|
commit: null,
|
|
4903
|
-
cancel: null
|
|
7028
|
+
cancel: null,
|
|
7029
|
+
autofocus: false,
|
|
7030
|
+
columnLabel: ""
|
|
4904
7031
|
}, _props), [
|
|
4905
7032
|
"columnId",
|
|
4906
7033
|
"column",
|
|
4907
7034
|
"row",
|
|
4908
7035
|
"value",
|
|
4909
7036
|
"commit",
|
|
4910
|
-
"cancel"
|
|
7037
|
+
"cancel",
|
|
7038
|
+
"autofocus",
|
|
7039
|
+
"columnLabel"
|
|
4911
7040
|
]);
|
|
4912
7041
|
const [draft, setDraft] = createSignal("");
|
|
4913
|
-
|
|
7042
|
+
const [touched, setTouched] = createSignal(false);
|
|
7043
|
+
onMount(() => {
|
|
7044
|
+
if (local.autofocus) inputElRef?.focus();
|
|
7045
|
+
});
|
|
7046
|
+
createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
|
|
7047
|
+
if (v) inputElRef?.focus();
|
|
7048
|
+
})(v)), { defer: true }));
|
|
7049
|
+
let inputElRef = null;
|
|
7050
|
+
function draftValue() {
|
|
7051
|
+
return touched() ? draft() : toIsoDateString(local.value);
|
|
7052
|
+
}
|
|
4914
7053
|
function onInput(e) {
|
|
4915
7054
|
setDraft(e && e.target ? e.target.value : "");
|
|
7055
|
+
setTouched(true);
|
|
4916
7056
|
}
|
|
4917
7057
|
function doCommit() {
|
|
4918
|
-
local.commit && local.commit(
|
|
7058
|
+
local.commit && local.commit(draftValue());
|
|
4919
7059
|
}
|
|
4920
7060
|
function doCancel() {
|
|
4921
7061
|
local.cancel && local.cancel();
|
|
4922
7062
|
}
|
|
4923
7063
|
function onChange(e) {
|
|
4924
7064
|
setDraft(e && e.target ? e.target.value : "");
|
|
7065
|
+
setTouched(true);
|
|
4925
7066
|
}
|
|
4926
7067
|
function onKeydown(e) {
|
|
4927
7068
|
if (e && e.key === "Enter") {
|
|
@@ -4935,42 +7076,66 @@ function EditorDate(_props) {
|
|
|
4935
7076
|
function onBlur() {
|
|
4936
7077
|
doCommit();
|
|
4937
7078
|
}
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
}
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
7079
|
+
function a11yLabel() {
|
|
7080
|
+
if (typeof local.columnLabel === "string" && local.columnLabel !== "") return local.columnLabel;
|
|
7081
|
+
return local.columnId;
|
|
7082
|
+
}
|
|
7083
|
+
return (() => {
|
|
7084
|
+
var _el$ = _tmpl$$5();
|
|
7085
|
+
_el$.addEventListener("blur", ($event) => {
|
|
7086
|
+
onBlur();
|
|
7087
|
+
});
|
|
7088
|
+
_el$.$$keydown = ($event) => {
|
|
7089
|
+
onKeydown($event);
|
|
7090
|
+
};
|
|
7091
|
+
_el$.addEventListener("change", ($event) => {
|
|
7092
|
+
onChange($event);
|
|
7093
|
+
});
|
|
7094
|
+
_el$.$$input = ($event) => {
|
|
7095
|
+
onInput($event);
|
|
7096
|
+
};
|
|
7097
|
+
use((el) => {
|
|
7098
|
+
inputElRef = el;
|
|
7099
|
+
}, _el$);
|
|
7100
|
+
effect(() => setAttribute(_el$, "aria-label", rozieAttr(a11yLabel())));
|
|
7101
|
+
effect(() => _el$.value = draftValue());
|
|
7102
|
+
return _el$;
|
|
7103
|
+
})();
|
|
4949
7104
|
}
|
|
7105
|
+
delegateEvents(["input", "keydown"]);
|
|
4950
7106
|
//#endregion
|
|
4951
7107
|
//#region src/FilterText.tsx
|
|
7108
|
+
var _tmpl$$4 = /* @__PURE__ */ template(`<input part=col-filter type=text class=rdt-col-filter data-rozie-s-18cbb44e="">`);
|
|
4952
7109
|
function FilterText(_props) {
|
|
4953
7110
|
const [local, attrs] = splitProps(mergeProps({
|
|
4954
7111
|
columnId: "",
|
|
4955
7112
|
column: null,
|
|
4956
7113
|
value: null,
|
|
4957
|
-
setFilter: null
|
|
7114
|
+
setFilter: null,
|
|
7115
|
+
columnLabel: ""
|
|
4958
7116
|
}, _props), [
|
|
4959
7117
|
"columnId",
|
|
4960
7118
|
"column",
|
|
4961
7119
|
"value",
|
|
4962
|
-
"setFilter"
|
|
7120
|
+
"setFilter",
|
|
7121
|
+
"columnLabel"
|
|
4963
7122
|
]);
|
|
4964
7123
|
const [draft, setDraft] = createSignal("");
|
|
4965
|
-
|
|
7124
|
+
const [touched, setTouched] = createSignal(false);
|
|
7125
|
+
createEffect(on(() => local.value, (v) => untrack(() => (setTouched(false), void 0)), { defer: true }));
|
|
7126
|
+
function draftValue() {
|
|
7127
|
+
return touched() ? draft() : local.value != null ? String(local.value) : "";
|
|
7128
|
+
}
|
|
4966
7129
|
function onInput(e) {
|
|
4967
7130
|
setDraft(e && e.target ? e.target.value : "");
|
|
7131
|
+
setTouched(true);
|
|
4968
7132
|
}
|
|
4969
7133
|
function applyFilter() {
|
|
4970
|
-
local.setFilter && local.setFilter(local.columnId,
|
|
7134
|
+
local.setFilter && local.setFilter(local.columnId, draftValue());
|
|
4971
7135
|
}
|
|
4972
7136
|
function clearFilter() {
|
|
4973
7137
|
setDraft("");
|
|
7138
|
+
setTouched(false);
|
|
4974
7139
|
local.setFilter && local.setFilter(local.columnId, "");
|
|
4975
7140
|
}
|
|
4976
7141
|
function onKeydown(e) {
|
|
@@ -4985,41 +7150,69 @@ function FilterText(_props) {
|
|
|
4985
7150
|
function onBlur() {
|
|
4986
7151
|
applyFilter();
|
|
4987
7152
|
}
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
}
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
7153
|
+
function a11yLabel() {
|
|
7154
|
+
if (typeof local.columnLabel === "string" && local.columnLabel !== "") return local.columnLabel;
|
|
7155
|
+
return local.columnId;
|
|
7156
|
+
}
|
|
7157
|
+
return (() => {
|
|
7158
|
+
var _el$ = _tmpl$$4();
|
|
7159
|
+
_el$.addEventListener("blur", ($event) => {
|
|
7160
|
+
onBlur();
|
|
7161
|
+
});
|
|
7162
|
+
_el$.$$keydown = ($event) => {
|
|
7163
|
+
onKeydown($event);
|
|
7164
|
+
};
|
|
7165
|
+
_el$.$$input = ($event) => {
|
|
7166
|
+
onInput($event);
|
|
7167
|
+
};
|
|
7168
|
+
effect(() => setAttribute(_el$, "aria-label", rozieAttr(a11yLabel())));
|
|
7169
|
+
effect(() => _el$.value = draftValue());
|
|
7170
|
+
return _el$;
|
|
7171
|
+
})();
|
|
4997
7172
|
}
|
|
7173
|
+
delegateEvents(["input", "keydown"]);
|
|
4998
7174
|
//#endregion
|
|
4999
7175
|
//#region src/FilterNumberRange.tsx
|
|
7176
|
+
var _tmpl$$3 = /* @__PURE__ */ template(`<span data-rozie-s-97b2c090=""><input part=col-filter type=number class=rdt-col-filter data-rozie-s-97b2c090=""><span data-rozie-s-97b2c090=""> - </span><input part=col-filter type=number class=rdt-col-filter data-rozie-s-97b2c090="">`);
|
|
5000
7177
|
function FilterNumberRange(_props) {
|
|
5001
7178
|
const [local, attrs] = splitProps(mergeProps({
|
|
5002
7179
|
columnId: "",
|
|
5003
7180
|
column: null,
|
|
5004
7181
|
value: null,
|
|
5005
7182
|
setFilter: null,
|
|
5006
|
-
minMax: null
|
|
7183
|
+
minMax: null,
|
|
7184
|
+
columnLabel: ""
|
|
5007
7185
|
}, _props), [
|
|
5008
7186
|
"columnId",
|
|
5009
7187
|
"column",
|
|
5010
7188
|
"value",
|
|
5011
7189
|
"setFilter",
|
|
5012
|
-
"minMax"
|
|
7190
|
+
"minMax",
|
|
7191
|
+
"columnLabel"
|
|
5013
7192
|
]);
|
|
5014
7193
|
const [minDraft, setMinDraft] = createSignal("");
|
|
5015
7194
|
const [maxDraft, setMaxDraft] = createSignal("");
|
|
5016
|
-
|
|
5017
|
-
|
|
7195
|
+
const [touched, setTouched] = createSignal(false);
|
|
7196
|
+
createEffect(on(() => Array.isArray(local.value) ? String(local.value[0]) + "\0" + String(local.value[1]) : "", (v) => untrack(() => (setTouched(false), void 0)), { defer: true }));
|
|
7197
|
+
function minDraftValue() {
|
|
7198
|
+
return touched() ? minDraft() : Array.isArray(local.value) && local.value[0] != null ? String(local.value[0]) : "";
|
|
7199
|
+
}
|
|
7200
|
+
function maxDraftValue() {
|
|
7201
|
+
return touched() ? maxDraft() : Array.isArray(local.value) && local.value[1] != null ? String(local.value[1]) : "";
|
|
7202
|
+
}
|
|
5018
7203
|
function onMinInput(e) {
|
|
5019
7204
|
setMinDraft(e && e.target ? e.target.value : "");
|
|
7205
|
+
setTouched(true);
|
|
5020
7206
|
}
|
|
5021
7207
|
function onMaxInput(e) {
|
|
5022
7208
|
setMaxDraft(e && e.target ? e.target.value : "");
|
|
7209
|
+
setTouched(true);
|
|
7210
|
+
}
|
|
7211
|
+
function onKeydown(e) {
|
|
7212
|
+
if (e && e.key === "Enter") applyRange(minDraftValue(), maxDraftValue());
|
|
7213
|
+
}
|
|
7214
|
+
function onBlur() {
|
|
7215
|
+
applyRange(minDraftValue(), maxDraftValue());
|
|
5023
7216
|
}
|
|
5024
7217
|
function minPlaceholder() {
|
|
5025
7218
|
return Array.isArray(local.minMax) && local.minMax[0] != null ? String(local.minMax[0]) : "";
|
|
@@ -5027,46 +7220,75 @@ function FilterNumberRange(_props) {
|
|
|
5027
7220
|
function maxPlaceholder() {
|
|
5028
7221
|
return Array.isArray(local.minMax) && local.minMax[1] != null ? String(local.minMax[1]) : "";
|
|
5029
7222
|
}
|
|
5030
|
-
function applyRange() {
|
|
5031
|
-
const minNum = minDraft
|
|
5032
|
-
const maxNum = maxDraft
|
|
7223
|
+
function applyRange(minDraft, maxDraft) {
|
|
7224
|
+
const minNum = minDraft === "" ? void 0 : Number(minDraft);
|
|
7225
|
+
const maxNum = maxDraft === "" ? void 0 : Number(maxDraft);
|
|
5033
7226
|
if (minNum === void 0 && maxNum === void 0) local.setFilter && local.setFilter(local.columnId, "");
|
|
5034
7227
|
else local.setFilter && local.setFilter(local.columnId, [minNum, maxNum]);
|
|
5035
7228
|
}
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
7229
|
+
function a11yLabel() {
|
|
7230
|
+
if (typeof local.columnLabel === "string" && local.columnLabel !== "") return local.columnLabel;
|
|
7231
|
+
return local.columnId;
|
|
7232
|
+
}
|
|
7233
|
+
return (() => {
|
|
7234
|
+
var _el$ = _tmpl$$3(), _el$2 = _el$.firstChild, _el$4 = _el$2.nextSibling.nextSibling;
|
|
7235
|
+
_el$.style.setProperty("display", "flex");
|
|
7236
|
+
_el$.style.setProperty("align-items", "center");
|
|
7237
|
+
_el$2.addEventListener("blur", ($event) => {
|
|
7238
|
+
onBlur();
|
|
7239
|
+
});
|
|
7240
|
+
_el$2.$$keydown = ($event) => {
|
|
7241
|
+
onKeydown($event);
|
|
7242
|
+
};
|
|
7243
|
+
_el$2.$$input = ($event) => {
|
|
7244
|
+
onMinInput($event);
|
|
7245
|
+
};
|
|
7246
|
+
_el$4.addEventListener("blur", ($event) => {
|
|
7247
|
+
onBlur();
|
|
7248
|
+
});
|
|
7249
|
+
_el$4.$$keydown = ($event) => {
|
|
7250
|
+
onKeydown($event);
|
|
7251
|
+
};
|
|
7252
|
+
_el$4.$$input = ($event) => {
|
|
7253
|
+
onMaxInput($event);
|
|
7254
|
+
};
|
|
7255
|
+
effect((_p$) => {
|
|
7256
|
+
var _v$ = rozieAttr(a11yLabel() + " min"), _v$2 = rozieAttr(minPlaceholder()), _v$3 = rozieAttr(a11yLabel() + " max"), _v$4 = rozieAttr(maxPlaceholder());
|
|
7257
|
+
_v$ !== _p$.e && setAttribute(_el$2, "aria-label", _p$.e = _v$);
|
|
7258
|
+
_v$2 !== _p$.t && setAttribute(_el$2, "placeholder", _p$.t = _v$2);
|
|
7259
|
+
_v$3 !== _p$.a && setAttribute(_el$4, "aria-label", _p$.a = _v$3);
|
|
7260
|
+
_v$4 !== _p$.o && setAttribute(_el$4, "placeholder", _p$.o = _v$4);
|
|
7261
|
+
return _p$;
|
|
7262
|
+
}, {
|
|
7263
|
+
e: void 0,
|
|
7264
|
+
t: void 0,
|
|
7265
|
+
a: void 0,
|
|
7266
|
+
o: void 0
|
|
7267
|
+
});
|
|
7268
|
+
effect(() => _el$2.value = minDraftValue());
|
|
7269
|
+
effect(() => _el$4.value = maxDraftValue());
|
|
7270
|
+
return _el$;
|
|
7271
|
+
})();
|
|
5054
7272
|
}
|
|
7273
|
+
delegateEvents(["input", "keydown"]);
|
|
5055
7274
|
//#endregion
|
|
5056
7275
|
//#region src/FilterSelect.tsx
|
|
7276
|
+
var _tmpl$$2 = /* @__PURE__ */ template(`<select part=col-filter class=rdt-col-filter data-rozie-s-d75b42b2=""><option value=""data-rozie-s-d75b42b2="">All`), _tmpl$2$2 = /* @__PURE__ */ template(`<option data-rozie-s-d75b42b2="">`);
|
|
5057
7277
|
function FilterSelect(_props) {
|
|
5058
7278
|
const [local, attrs] = splitProps(mergeProps({
|
|
5059
7279
|
columnId: "",
|
|
5060
7280
|
column: null,
|
|
5061
7281
|
value: null,
|
|
5062
7282
|
setFilter: null,
|
|
5063
|
-
uniqueValues: []
|
|
7283
|
+
uniqueValues: [],
|
|
7284
|
+
columnLabel: ""
|
|
5064
7285
|
}, _props), [
|
|
5065
7286
|
"columnId",
|
|
5066
7287
|
"column",
|
|
5067
7288
|
"value",
|
|
5068
7289
|
"setFilter",
|
|
5069
|
-
"uniqueValues"
|
|
7290
|
+
"uniqueValues",
|
|
7291
|
+
"columnLabel"
|
|
5070
7292
|
]);
|
|
5071
7293
|
function selectValue() {
|
|
5072
7294
|
return local.value != null ? String(local.value) : "";
|
|
@@ -5076,17 +7298,36 @@ function FilterSelect(_props) {
|
|
|
5076
7298
|
if (v === "") local.setFilter && local.setFilter(local.columnId, "");
|
|
5077
7299
|
else local.setFilter && local.setFilter(local.columnId, v);
|
|
5078
7300
|
}
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
}
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
7301
|
+
function a11yLabel() {
|
|
7302
|
+
if (typeof local.columnLabel === "string" && local.columnLabel !== "") return local.columnLabel;
|
|
7303
|
+
return local.columnId;
|
|
7304
|
+
}
|
|
7305
|
+
return (() => {
|
|
7306
|
+
var _el$ = _tmpl$$2();
|
|
7307
|
+
_el$.firstChild;
|
|
7308
|
+
_el$.addEventListener("change", ($event) => {
|
|
7309
|
+
onChange($event);
|
|
7310
|
+
});
|
|
7311
|
+
insert(_el$, createComponent(Key, {
|
|
7312
|
+
get each() {
|
|
7313
|
+
return local.uniqueValues;
|
|
7314
|
+
},
|
|
7315
|
+
by: (opt) => opt,
|
|
7316
|
+
children: (opt) => (() => {
|
|
7317
|
+
var _el$3 = _tmpl$2$2();
|
|
7318
|
+
insert(_el$3, () => rozieDisplay(opt()));
|
|
7319
|
+
effect(() => _el$3.value = rozieAttr(opt()));
|
|
7320
|
+
return _el$3;
|
|
7321
|
+
})()
|
|
7322
|
+
}), null);
|
|
7323
|
+
effect(() => setAttribute(_el$, "aria-label", rozieAttr(a11yLabel())));
|
|
7324
|
+
effect(() => _el$.value = selectValue());
|
|
7325
|
+
return _el$;
|
|
7326
|
+
})();
|
|
5087
7327
|
}
|
|
5088
7328
|
//#endregion
|
|
5089
7329
|
//#region src/GroupBar.tsx
|
|
7330
|
+
var _tmpl$$1 = /* @__PURE__ */ template(`<div class=rdt-group-bar data-rozie-s-546c469a=""><span data-group-drop-zone=""role=list aria-label="Active grouping"data-rozie-s-546c469a="">`), _tmpl$2$1 = /* @__PURE__ */ template(`<button type=button part=group-token draggable=true class="rdt-group-token rdt-group-token-add"data-rozie-s-546c469a="">`), _tmpl$3 = /* @__PURE__ */ template(`<span class=rdt-group-drop-hint data-rozie-s-546c469a="">Drag columns here to group`), _tmpl$4 = /* @__PURE__ */ template(`<span part=group-token data-group-token=""draggable=true role=listitem tabindex=0 data-rozie-s-546c469a=""><button type=button class=rdt-group-token-remove data-rozie-s-546c469a="">×`), _tmpl$5 = /* @__PURE__ */ template(`<button type=button class=rdt-group-clear data-rozie-s-546c469a="">Clear`);
|
|
5090
7331
|
__rozieInjectStyle("GroupBar-546c469a", `.rdt-group-drop-zone[data-rozie-s-546c469a] {
|
|
5091
7332
|
display: inline-flex;
|
|
5092
7333
|
flex-wrap: wrap;
|
|
@@ -5104,6 +7345,18 @@ __rozieInjectStyle("GroupBar-546c469a", `.rdt-group-drop-zone[data-rozie-s-546c4
|
|
|
5104
7345
|
border-color: var(--rdt-group-drop-zone-border-over, rgba(37, 99, 235, 0.7));
|
|
5105
7346
|
background: var(--rdt-group-drop-zone-bg-over, rgba(37, 99, 235, 0.08));
|
|
5106
7347
|
}
|
|
7348
|
+
.rdt-group-token-add[data-rozie-s-546c469a] {
|
|
7349
|
+
font: inherit;
|
|
7350
|
+
color: inherit;
|
|
7351
|
+
border: none;
|
|
7352
|
+
background: none;
|
|
7353
|
+
cursor: pointer;
|
|
7354
|
+
}
|
|
7355
|
+
.rdt-group-token-add[data-rozie-s-546c469a]:focus-visible,
|
|
7356
|
+
.rdt-group-drop-zone[data-rozie-s-546c469a] [data-group-token][data-rozie-s-546c469a]:focus-visible {
|
|
7357
|
+
outline: var(--rdt-focus-ring, 2px solid #2563eb);
|
|
7358
|
+
outline-offset: 1px;
|
|
7359
|
+
}
|
|
5107
7360
|
.rdt-group-drop-hint[data-rozie-s-546c469a] {
|
|
5108
7361
|
opacity: 0.55;
|
|
5109
7362
|
font-size: 0.8125em;
|
|
@@ -5218,6 +7471,42 @@ function GroupBar(_props) {
|
|
|
5218
7471
|
function removeKey(key) {
|
|
5219
7472
|
local.applyGrouping && local.applyGrouping(local.grouping.filter((k) => k !== key));
|
|
5220
7473
|
}
|
|
7474
|
+
function toggleKey(id) {
|
|
7475
|
+
if (!id) return;
|
|
7476
|
+
if (local.grouping.indexOf(id) !== -1) {
|
|
7477
|
+
removeKey(id);
|
|
7478
|
+
return;
|
|
7479
|
+
}
|
|
7480
|
+
local.applyGrouping && local.applyGrouping(local.grouping.concat([id]));
|
|
7481
|
+
}
|
|
7482
|
+
function moveKey(key, delta) {
|
|
7483
|
+
const cur = local.grouping;
|
|
7484
|
+
const from = cur.indexOf(key);
|
|
7485
|
+
if (from === -1) return;
|
|
7486
|
+
const to = from + delta;
|
|
7487
|
+
if (to < 0 || to >= cur.length) return;
|
|
7488
|
+
const next = cur.slice();
|
|
7489
|
+
next.splice(from, 1);
|
|
7490
|
+
next.splice(to, 0, key);
|
|
7491
|
+
local.applyGrouping && local.applyGrouping(next);
|
|
7492
|
+
}
|
|
7493
|
+
function onTokenKeydown(e, gk) {
|
|
7494
|
+
if (!e) return;
|
|
7495
|
+
const key = e.key;
|
|
7496
|
+
if (key === "Delete" || key === "Backspace") {
|
|
7497
|
+
e.preventDefault();
|
|
7498
|
+
removeKey(gk);
|
|
7499
|
+
return;
|
|
7500
|
+
}
|
|
7501
|
+
if (!e.altKey) return;
|
|
7502
|
+
if (key === "ArrowLeft") {
|
|
7503
|
+
e.preventDefault();
|
|
7504
|
+
moveKey(gk, -1);
|
|
7505
|
+
} else if (key === "ArrowRight") {
|
|
7506
|
+
e.preventDefault();
|
|
7507
|
+
moveKey(gk, 1);
|
|
7508
|
+
}
|
|
7509
|
+
}
|
|
5221
7510
|
function clearAll() {
|
|
5222
7511
|
local.clearGrouping && local.clearGrouping();
|
|
5223
7512
|
}
|
|
@@ -5225,46 +7514,111 @@ function GroupBar(_props) {
|
|
|
5225
7514
|
const col = local.groupableColumns.find((c) => c.id === key);
|
|
5226
7515
|
return col && col.label || key;
|
|
5227
7516
|
}
|
|
5228
|
-
return
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
7517
|
+
return (() => {
|
|
7518
|
+
var _el$ = _tmpl$$1(), _el$2 = _el$.firstChild;
|
|
7519
|
+
insert(_el$, createComponent(Key, {
|
|
7520
|
+
get each() {
|
|
7521
|
+
return local.groupableColumns;
|
|
7522
|
+
},
|
|
7523
|
+
by: (col) => col.id,
|
|
7524
|
+
children: (col) => (() => {
|
|
7525
|
+
var _el$3 = _tmpl$2$1();
|
|
7526
|
+
_el$3.$$click = ($event) => {
|
|
7527
|
+
toggleKey(col().id);
|
|
7528
|
+
};
|
|
7529
|
+
_el$3.addEventListener("dragend", ($event) => {
|
|
7530
|
+
onDragEnd();
|
|
7531
|
+
});
|
|
7532
|
+
_el$3.addEventListener("dragstart", ($event) => {
|
|
7533
|
+
onChipDragStart($event, col().id);
|
|
7534
|
+
});
|
|
7535
|
+
insert(_el$3, () => rozieDisplay(col().label));
|
|
7536
|
+
effect((_p$) => {
|
|
7537
|
+
var _v$ = rozieAttr(local.grouping.indexOf(col().id) !== -1 ? "true" : "false"), _v$2 = rozieAttr("Group by " + col().label);
|
|
7538
|
+
_v$ !== _p$.e && setAttribute(_el$3, "aria-pressed", _p$.e = _v$);
|
|
7539
|
+
_v$2 !== _p$.t && setAttribute(_el$3, "aria-label", _p$.t = _v$2);
|
|
7540
|
+
return _p$;
|
|
7541
|
+
}, {
|
|
7542
|
+
e: void 0,
|
|
7543
|
+
t: void 0
|
|
7544
|
+
});
|
|
7545
|
+
return _el$3;
|
|
7546
|
+
})()
|
|
7547
|
+
}), _el$2);
|
|
7548
|
+
_el$2.addEventListener("drop", ($event) => {
|
|
7549
|
+
onDrop($event);
|
|
7550
|
+
});
|
|
7551
|
+
_el$2.addEventListener("dragleave", ($event) => {
|
|
7552
|
+
onDragLeave($event);
|
|
7553
|
+
});
|
|
7554
|
+
_el$2.addEventListener("dragover", ($event) => {
|
|
7555
|
+
onDragOver($event);
|
|
7556
|
+
});
|
|
7557
|
+
insert(_el$2, () => createComponent(Show, {
|
|
7558
|
+
get when() {
|
|
7559
|
+
return !local.grouping.length;
|
|
7560
|
+
},
|
|
7561
|
+
get children() {
|
|
7562
|
+
return _tmpl$3();
|
|
7563
|
+
}
|
|
7564
|
+
}), null);
|
|
7565
|
+
insert(_el$2, createComponent(Key, {
|
|
7566
|
+
get each() {
|
|
7567
|
+
return local.grouping;
|
|
7568
|
+
},
|
|
7569
|
+
by: (gk) => gk,
|
|
7570
|
+
children: (gk) => (() => {
|
|
7571
|
+
var _el$5 = _tmpl$4(), _el$6 = _el$5.firstChild;
|
|
7572
|
+
_el$5.$$keydown = ($event) => {
|
|
7573
|
+
onTokenKeydown($event, gk());
|
|
7574
|
+
};
|
|
7575
|
+
_el$5.addEventListener("dragend", ($event) => {
|
|
7576
|
+
onDragEnd();
|
|
7577
|
+
});
|
|
7578
|
+
_el$5.addEventListener("dragover", ($event) => {
|
|
7579
|
+
onTokenDragOver($event, gk());
|
|
7580
|
+
});
|
|
7581
|
+
_el$5.addEventListener("dragstart", ($event) => {
|
|
7582
|
+
onTokenDragStart($event, gk());
|
|
7583
|
+
});
|
|
7584
|
+
insert(_el$5, () => rozieDisplay(labelFor(gk())), _el$6);
|
|
7585
|
+
_el$6.$$click = ($event) => {
|
|
7586
|
+
removeKey(gk());
|
|
7587
|
+
};
|
|
7588
|
+
effect((_p$) => {
|
|
7589
|
+
var _v$3 = rozieAttr(labelFor(gk()) + " grouping, position " + (local.grouping.indexOf(gk()) + 1) + " of " + local.grouping.length + ". Alt+Arrow to reorder, Delete to remove."), _v$4 = "rdt-group-token " + rozieClass({ "is-drop-target": dragKind() === "token" && dropKey() === gk() && draggingId() !== gk() }), _v$5 = rozieAttr("Remove " + labelFor(gk()) + " grouping");
|
|
7590
|
+
_v$3 !== _p$.e && setAttribute(_el$5, "aria-label", _p$.e = _v$3);
|
|
7591
|
+
_v$4 !== _p$.t && className(_el$5, _p$.t = _v$4);
|
|
7592
|
+
_v$5 !== _p$.a && setAttribute(_el$6, "aria-label", _p$.a = _v$5);
|
|
7593
|
+
return _p$;
|
|
7594
|
+
}, {
|
|
7595
|
+
e: void 0,
|
|
7596
|
+
t: void 0,
|
|
7597
|
+
a: void 0
|
|
7598
|
+
});
|
|
7599
|
+
return _el$5;
|
|
7600
|
+
})()
|
|
7601
|
+
}), null);
|
|
7602
|
+
insert(_el$, () => createComponent(Show, {
|
|
7603
|
+
get when() {
|
|
7604
|
+
return local.grouping.length;
|
|
7605
|
+
},
|
|
7606
|
+
get children() {
|
|
7607
|
+
var _el$7 = _tmpl$5();
|
|
7608
|
+
_el$7.$$click = ($event) => {
|
|
7609
|
+
clearAll();
|
|
7610
|
+
};
|
|
7611
|
+
return _el$7;
|
|
7612
|
+
}
|
|
7613
|
+
}), null);
|
|
7614
|
+
effect(() => className(_el$2, "rdt-group-drop-zone " + rozieClass({ "is-over": isOver() })));
|
|
7615
|
+
return _el$;
|
|
7616
|
+
})();
|
|
5265
7617
|
}
|
|
7618
|
+
delegateEvents(["click", "keydown"]);
|
|
5266
7619
|
//#endregion
|
|
5267
7620
|
//#region src/DetailPanel.tsx
|
|
7621
|
+
var _tmpl$ = /* @__PURE__ */ template(`<dl class=rdt-detail-panel data-rozie-s-8f65bdaa="">`), _tmpl$2 = /* @__PURE__ */ template(`<div class=rdt-detail-entry data-rozie-s-8f65bdaa=""><dt class=rdt-detail-key data-rozie-s-8f65bdaa=""></dt><dd class=rdt-detail-value data-rozie-s-8f65bdaa="">`);
|
|
5268
7622
|
function DetailPanel(_props) {
|
|
5269
7623
|
const [local, attrs] = splitProps(mergeProps({ row: null }, _props), ["row"]);
|
|
5270
7624
|
function entries() {
|
|
@@ -5275,15 +7629,22 @@ function DetailPanel(_props) {
|
|
|
5275
7629
|
value: r[key] == null ? "" : String(r[key])
|
|
5276
7630
|
}));
|
|
5277
7631
|
}
|
|
5278
|
-
return
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
7632
|
+
return (() => {
|
|
7633
|
+
var _el$ = _tmpl$();
|
|
7634
|
+
insert(_el$, createComponent(Key, {
|
|
7635
|
+
get each() {
|
|
7636
|
+
return entries();
|
|
7637
|
+
},
|
|
7638
|
+
by: (pair) => pair.key,
|
|
7639
|
+
children: (pair) => (() => {
|
|
7640
|
+
var _el$2 = _tmpl$2(), _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
|
|
7641
|
+
insert(_el$3, () => rozieDisplay(pair().key));
|
|
7642
|
+
insert(_el$4, () => rozieDisplay(pair().value));
|
|
7643
|
+
return _el$2;
|
|
7644
|
+
})()
|
|
7645
|
+
}));
|
|
7646
|
+
return _el$;
|
|
7647
|
+
})();
|
|
5287
7648
|
}
|
|
5288
7649
|
//#endregion
|
|
5289
7650
|
export { Column, DataTable, DataTable as default, DetailPanel, EditorCheckbox, EditorDate, EditorNumber, EditorSelect, EditorText, FilterNumberRange, FilterSelect, FilterText, GroupBar };
|