@k2b/ui 0.22.0 → 0.23.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/dist/browser/content/Calendar.js +1086 -1049
- package/dist/browser/content/Calendar.js.map +1 -1
- package/dist/browser/content/CalendarDayView.js +1187 -0
- package/dist/browser/content/CalendarDayView.js.map +1 -0
- package/dist/browser/content/CalendarWeekView.js +1571 -0
- package/dist/browser/content/CalendarWeekView.js.map +1 -0
- package/dist/browser/content/ChartExplorer.js +174 -82
- package/dist/browser/content/ChartExplorer.js.map +1 -1
- package/dist/browser/content/ChartFilterControls.js +90 -33
- package/dist/browser/content/ChartFilterControls.js.map +1 -1
- package/dist/browser/content/DataTable.js +199 -171
- package/dist/browser/content/DataTable.js.map +1 -1
- package/dist/browser/content/calendar-day-scroll.js +98 -0
- package/dist/browser/content/calendar-day-scroll.js.map +1 -0
- package/dist/browser/content/calendar-days.js +408 -0
- package/dist/browser/content/calendar-days.js.map +1 -0
- package/dist/browser/content/calendar-dialogs.js +236 -0
- package/dist/browser/content/calendar-dialogs.js.map +1 -0
- package/dist/browser/content/calendar-messages.js +210 -2
- package/dist/browser/content/calendar-messages.js.map +1 -1
- package/dist/browser/content/calendar-pointer.js +15 -3
- package/dist/browser/content/calendar-pointer.js.map +1 -1
- package/dist/browser/content/calendar-shared.js +328 -0
- package/dist/browser/content/calendar-shared.js.map +1 -0
- package/dist/browser/content/calendar-time-view.js +1649 -0
- package/dist/browser/content/calendar-time-view.js.map +1 -0
- package/dist/browser/content/chart-messages.js +10 -0
- package/dist/browser/content/chart-messages.js.map +1 -1
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/inputs/Combobox.js +0 -1
- package/dist/browser/inputs/Combobox.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +123 -97
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/PageTitle.js +4 -1
- package/dist/browser/layout/PageTitle.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +164 -86
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/surfaces/StatCell.js +18 -6
- package/dist/browser/surfaces/StatCell.js.map +1 -1
- package/dist/ssr/content/Calendar.js +524 -335
- package/dist/ssr/content/Calendar.js.map +1 -1
- package/dist/ssr/content/CalendarDayView.js +800 -0
- package/dist/ssr/content/CalendarDayView.js.map +1 -0
- package/dist/ssr/content/CalendarWeekView.js +1069 -0
- package/dist/ssr/content/CalendarWeekView.js.map +1 -0
- package/dist/ssr/content/ChartExplorer.js +93 -34
- package/dist/ssr/content/ChartExplorer.js.map +1 -1
- package/dist/ssr/content/ChartFilterControls.js +49 -7
- package/dist/ssr/content/ChartFilterControls.js.map +1 -1
- package/dist/ssr/content/DataTable.js +69 -51
- package/dist/ssr/content/DataTable.js.map +1 -1
- package/dist/ssr/content/calendar-day-scroll.js +98 -0
- package/dist/ssr/content/calendar-day-scroll.js.map +1 -0
- package/dist/ssr/content/calendar-days.js +408 -0
- package/dist/ssr/content/calendar-days.js.map +1 -0
- package/dist/ssr/content/calendar-dialogs.js +159 -0
- package/dist/ssr/content/calendar-dialogs.js.map +1 -0
- package/dist/ssr/content/calendar-messages.js +210 -2
- package/dist/ssr/content/calendar-messages.js.map +1 -1
- package/dist/ssr/content/calendar-pointer.js +15 -3
- package/dist/ssr/content/calendar-pointer.js.map +1 -1
- package/dist/ssr/content/calendar-shared.js +261 -0
- package/dist/ssr/content/calendar-shared.js.map +1 -0
- package/dist/ssr/content/calendar-time-view.js +1306 -0
- package/dist/ssr/content/calendar-time-view.js.map +1 -0
- package/dist/ssr/content/chart-messages.js +10 -0
- package/dist/ssr/content/chart-messages.js.map +1 -1
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/inputs/Combobox.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +38 -29
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/PageTitle.js +4 -1
- package/dist/ssr/layout/PageTitle.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +164 -86
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/surfaces/StatCell.js +2 -2
- package/dist/ssr/surfaces/StatCell.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/content/Calendar.d.ts +91 -0
- package/dist/types/content/CalendarDayView.d.ts +7 -0
- package/dist/types/content/CalendarWeekView.d.ts +7 -0
- package/dist/types/content/ChartExplorer.d.ts +36 -1
- package/dist/types/content/ChartFilterControls.d.ts +6 -1
- package/dist/types/content/DataTable.d.ts +5 -0
- package/dist/types/content/calendar-day-scroll.d.ts +42 -0
- package/dist/types/content/calendar-days.d.ts +192 -0
- package/dist/types/content/calendar-dialogs.d.ts +22 -0
- package/dist/types/content/calendar-messages.d.ts +99 -0
- package/dist/types/content/calendar-pointer.d.ts +9 -0
- package/dist/types/content/calendar-shared.d.ts +69 -0
- package/dist/types/content/calendar-time-view.d.ts +252 -0
- package/dist/types/content/chart-messages.d.ts +5 -0
- package/dist/types/content/index.d.ts +2 -2
- package/dist/types/layout/AppWorkspace.d.ts +25 -3
- package/dist/types/layout/PageTitle.d.ts +2 -1
- package/dist/types/layout/app-workspace-controller.d.ts +9 -1
- package/dist/types/surfaces/StatCell.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
import { template as _$template } from "solid-js/web";
|
|
2
2
|
import { delegateEvents as _$delegateEvents } from "solid-js/web";
|
|
3
3
|
import { setStyleProperty as _$setStyleProperty } from "solid-js/web";
|
|
4
|
-
import { runHydrationEvents as _$runHydrationEvents } from "solid-js/web";
|
|
5
4
|
import { use as _$use } from "solid-js/web";
|
|
6
5
|
import { memo as _$memo } from "solid-js/web";
|
|
7
|
-
import {
|
|
8
|
-
import { getNextMarker as _$getNextMarker } from "solid-js/web";
|
|
6
|
+
import { runHydrationEvents as _$runHydrationEvents } from "solid-js/web";
|
|
9
7
|
import { setAttribute as _$setAttribute } from "solid-js/web";
|
|
8
|
+
import { className as _$className } from "solid-js/web";
|
|
10
9
|
import { effect as _$effect } from "solid-js/web";
|
|
10
|
+
import { getNextMarker as _$getNextMarker } from "solid-js/web";
|
|
11
11
|
import { createComponent as _$createComponent } from "solid-js/web";
|
|
12
12
|
import { getNextElement as _$getNextElement } from "solid-js/web";
|
|
13
13
|
import { insert as _$insert } from "solid-js/web";
|
|
14
14
|
var _tmpl$ = /*#__PURE__*/_$template(`<span class=k2b-data-table__header-title>`),
|
|
15
15
|
_tmpl$2 = /*#__PURE__*/_$template(`<span class=k2b-data-table__header-subtitle>`),
|
|
16
|
-
_tmpl$3 = /*#__PURE__*/_$template(`<
|
|
17
|
-
_tmpl$4 = /*#__PURE__*/_$template(`<a class="k2b-data-table__header-content k2b-data-table__sort"
|
|
18
|
-
_tmpl$5 = /*#__PURE__*/_$template(`<
|
|
19
|
-
_tmpl$6 = /*#__PURE__*/_$template(`<div class=k2b-data-
|
|
20
|
-
_tmpl$7 = /*#__PURE__*/_$template(`<
|
|
21
|
-
_tmpl$8 = /*#__PURE__*/_$template(`<
|
|
22
|
-
_tmpl$9 = /*#__PURE__*/_$template(`<
|
|
23
|
-
_tmpl$0 = /*#__PURE__*/_$template(`<
|
|
24
|
-
_tmpl$1 = /*#__PURE__*/_$template(`<td
|
|
25
|
-
_tmpl$10 = /*#__PURE__*/_$template(`<
|
|
26
|
-
_tmpl$11 = /*#__PURE__*/_$template(`<td
|
|
27
|
-
_tmpl$12 = /*#__PURE__*/_$template(`<
|
|
28
|
-
_tmpl$13 = /*#__PURE__*/_$template(`<
|
|
29
|
-
_tmpl$14 = /*#__PURE__*/_$template(`<span>`),
|
|
30
|
-
_tmpl$15 = /*#__PURE__*/_$template(`<
|
|
31
|
-
|
|
16
|
+
_tmpl$3 = /*#__PURE__*/_$template(`<span class=k2b-data-table__header-line><!$><!/><i aria-hidden=true>`),
|
|
17
|
+
_tmpl$4 = /*#__PURE__*/_$template(`<a class="k2b-data-table__header-content k2b-data-table__sort">`),
|
|
18
|
+
_tmpl$5 = /*#__PURE__*/_$template(`<button type=button class="k2b-data-table__header-content k2b-data-table__sort">`),
|
|
19
|
+
_tmpl$6 = /*#__PURE__*/_$template(`<div class=k2b-data-table__header-content>`),
|
|
20
|
+
_tmpl$7 = /*#__PURE__*/_$template(`<tr aria-hidden=true><td class=k2b-data-table__fill>`),
|
|
21
|
+
_tmpl$8 = /*#__PURE__*/_$template(`<div class=k2b-data-table__sentinel aria-hidden=true>`),
|
|
22
|
+
_tmpl$9 = /*#__PURE__*/_$template(`<div role=region tabindex=0><table><thead class=k2b-data-table__head><tr class=k2b-data-table__head-row></tr></thead><tbody></tbody><!$><!/></table><!$><!/>`),
|
|
23
|
+
_tmpl$0 = /*#__PURE__*/_$template(`<th scope=col>`),
|
|
24
|
+
_tmpl$1 = /*#__PURE__*/_$template(`<tr><td class=k2b-data-table__empty>`),
|
|
25
|
+
_tmpl$10 = /*#__PURE__*/_$template(`<tr>`),
|
|
26
|
+
_tmpl$11 = /*#__PURE__*/_$template(`<td><div>`),
|
|
27
|
+
_tmpl$12 = /*#__PURE__*/_$template(`<tfoot class=k2b-data-table__foot data-sticky=true><tr class=k2b-data-table__foot-row>`),
|
|
28
|
+
_tmpl$13 = /*#__PURE__*/_$template(`<td class=k2b-data-table__footer-cell>`),
|
|
29
|
+
_tmpl$14 = /*#__PURE__*/_$template(`<div class=k2b-data-table__scrollbar aria-hidden=true><span>`),
|
|
30
|
+
_tmpl$15 = /*#__PURE__*/_$template(`<div>`),
|
|
31
|
+
_tmpl$16 = /*#__PURE__*/_$template(`<span>`),
|
|
32
|
+
_tmpl$17 = /*#__PURE__*/_$template(`<footer>`);
|
|
33
|
+
import { createContext, createEffect, createMemo, createSignal, createUniqueId, For, Match, onCleanup, onMount, Show, Switch, useContext } from "solid-js";
|
|
32
34
|
import { Dynamic } from "solid-js/web";
|
|
33
35
|
import { suppressTextSelection } from "../internal/text-selection";
|
|
34
36
|
import { useLocale } from "../intl/locale";
|
|
@@ -222,34 +224,29 @@ function DataTableRoot(props) {
|
|
|
222
224
|
const sortKeyOf = col => col.sortable === true ? col.id : typeof col.sortable === "string" ? col.sortable : null;
|
|
223
225
|
|
|
224
226
|
/**
|
|
225
|
-
* Sorting is a link
|
|
226
|
-
*
|
|
227
|
+
* Sorting is a link by default: server-rendered tables keep the order in the
|
|
228
|
+
* URL. Client tables pass onSortChange instead. Clicking the active column
|
|
229
|
+
* flips its direction.
|
|
227
230
|
*/
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
const direction = active && props.sort?.direction === "desc" ? "asc" : "desc";
|
|
233
|
-
return {
|
|
234
|
-
href: props.sortHref({
|
|
235
|
-
key,
|
|
236
|
-
direction
|
|
237
|
-
}),
|
|
238
|
-
active,
|
|
239
|
-
direction
|
|
240
|
-
};
|
|
241
|
-
};
|
|
231
|
+
const nextSortFor = key => ({
|
|
232
|
+
key,
|
|
233
|
+
direction: props.sort?.key === key && props.sort?.direction === "desc" ? "asc" : "desc"
|
|
234
|
+
});
|
|
242
235
|
|
|
243
236
|
/** Only a sortable column carries a sort state; the rest carry none at all. */
|
|
244
237
|
const ariaSortFor = col => {
|
|
245
238
|
const key = sortKeyOf(col);
|
|
246
|
-
if (!key || !props.sortHref && !props.renderHeader) return undefined;
|
|
239
|
+
if (!key || !props.sortHref && !props.onSortChange && !props.renderHeader) return undefined;
|
|
247
240
|
if (props.sort?.key !== key) return "none";
|
|
248
241
|
return props.sort?.direction === "asc" ? "ascending" : "descending";
|
|
249
242
|
};
|
|
250
243
|
const renderHeaderDefault = col => {
|
|
251
|
-
const
|
|
252
|
-
|
|
244
|
+
const key = sortKeyOf(col);
|
|
245
|
+
// Only how a column sorts decides the element. The order lives in its attributes, so a header button keeps
|
|
246
|
+
// keyboard focus when a click sorts the table and the reader can press it again to reverse the order.
|
|
247
|
+
const mode = createMemo(() => !key ? null : props.sortHref ? "link" : props.onSortChange ? "button" : null);
|
|
248
|
+
const active = () => key !== null && props.sort?.key === key;
|
|
249
|
+
const title = () => [(() => {
|
|
253
250
|
var _el$ = _$getNextElement(_tmpl$);
|
|
254
251
|
_$insert(_el$, () => renderColumnPart(col.header, col));
|
|
255
252
|
return _el$;
|
|
@@ -263,37 +260,68 @@ function DataTableRoot(props) {
|
|
|
263
260
|
return _el$2;
|
|
264
261
|
}
|
|
265
262
|
})];
|
|
266
|
-
|
|
267
|
-
var _el$3 = _$getNextElement(_tmpl$3)
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
return (() => {
|
|
273
|
-
var _el$4 = _$getNextElement(_tmpl$4),
|
|
274
|
-
_el$5 = _el$4.firstChild,
|
|
275
|
-
_el$7 = _el$5.firstChild,
|
|
276
|
-
[_el$8, _co$] = _$getNextMarker(_el$7.nextSibling),
|
|
277
|
-
_el$6 = _el$8.nextSibling;
|
|
278
|
-
_$insert(_el$5, title, _el$8, _co$);
|
|
263
|
+
const line = () => (() => {
|
|
264
|
+
var _el$3 = _$getNextElement(_tmpl$3),
|
|
265
|
+
_el$5 = _el$3.firstChild,
|
|
266
|
+
[_el$6, _co$] = _$getNextMarker(_el$5.nextSibling),
|
|
267
|
+
_el$4 = _el$6.nextSibling;
|
|
268
|
+
_$insert(_el$3, title, _el$6, _co$);
|
|
279
269
|
_$effect(_p$ => {
|
|
280
|
-
var _v$ = sort
|
|
281
|
-
_v$2 =
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
_v$ !== _p$.e && _$setAttribute(_el$4, "href", _p$.e = _v$);
|
|
285
|
-
_v$2 !== _p$.t && _$setAttribute(_el$4, "data-align", _p$.t = _v$2);
|
|
286
|
-
_v$3 !== _p$.a && _$className(_el$6, _p$.a = _v$3);
|
|
287
|
-
_v$4 !== _p$.o && _$setAttribute(_el$6, "data-active", _p$.o = _v$4);
|
|
270
|
+
var _v$ = `k2b-data-table__sort-icon ti ${active() && props.sort?.direction === "asc" ? "ti-arrow-up" : "ti-arrow-down"}`,
|
|
271
|
+
_v$2 = active() ? "true" : undefined;
|
|
272
|
+
_v$ !== _p$.e && _$className(_el$4, _p$.e = _v$);
|
|
273
|
+
_v$2 !== _p$.t && _$setAttribute(_el$4, "data-active", _p$.t = _v$2);
|
|
288
274
|
return _p$;
|
|
289
275
|
}, {
|
|
290
276
|
e: undefined,
|
|
291
|
-
t: undefined
|
|
292
|
-
a: undefined,
|
|
293
|
-
o: undefined
|
|
277
|
+
t: undefined
|
|
294
278
|
});
|
|
295
|
-
return _el$
|
|
279
|
+
return _el$3;
|
|
296
280
|
})();
|
|
281
|
+
return _$createComponent(Switch, {
|
|
282
|
+
get fallback() {
|
|
283
|
+
return (() => {
|
|
284
|
+
var _el$9 = _$getNextElement(_tmpl$6);
|
|
285
|
+
_$insert(_el$9, title);
|
|
286
|
+
_$effect(() => _$setAttribute(_el$9, "data-align", alignAttr(col)));
|
|
287
|
+
return _el$9;
|
|
288
|
+
})();
|
|
289
|
+
},
|
|
290
|
+
get children() {
|
|
291
|
+
return [_$createComponent(Match, {
|
|
292
|
+
get when() {
|
|
293
|
+
return mode() === "link";
|
|
294
|
+
},
|
|
295
|
+
get children() {
|
|
296
|
+
var _el$7 = _$getNextElement(_tmpl$4);
|
|
297
|
+
_$insert(_el$7, line);
|
|
298
|
+
_$effect(_p$ => {
|
|
299
|
+
var _v$3 = key ? props.sortHref?.(nextSortFor(key)) : undefined,
|
|
300
|
+
_v$4 = alignAttr(col);
|
|
301
|
+
_v$3 !== _p$.e && _$setAttribute(_el$7, "href", _p$.e = _v$3);
|
|
302
|
+
_v$4 !== _p$.t && _$setAttribute(_el$7, "data-align", _p$.t = _v$4);
|
|
303
|
+
return _p$;
|
|
304
|
+
}, {
|
|
305
|
+
e: undefined,
|
|
306
|
+
t: undefined
|
|
307
|
+
});
|
|
308
|
+
return _el$7;
|
|
309
|
+
}
|
|
310
|
+
}), _$createComponent(Match, {
|
|
311
|
+
get when() {
|
|
312
|
+
return mode() === "button";
|
|
313
|
+
},
|
|
314
|
+
get children() {
|
|
315
|
+
var _el$8 = _$getNextElement(_tmpl$5);
|
|
316
|
+
_el$8.$$click = () => key && props.onSortChange?.(nextSortFor(key));
|
|
317
|
+
_$insert(_el$8, line);
|
|
318
|
+
_$effect(() => _$setAttribute(_el$8, "data-align", alignAttr(col)));
|
|
319
|
+
_$runHydrationEvents();
|
|
320
|
+
return _el$8;
|
|
321
|
+
}
|
|
322
|
+
})];
|
|
323
|
+
}
|
|
324
|
+
});
|
|
297
325
|
};
|
|
298
326
|
const renderValueDefault = value => defaultRender(value, locale(), messages());
|
|
299
327
|
const renderCellDefault = (row, col) => renderValueDefault(valueOf(row, col));
|
|
@@ -397,28 +425,28 @@ function DataTableRoot(props) {
|
|
|
397
425
|
onMouseLeave: () => setHoveredColumn(null),
|
|
398
426
|
get children() {
|
|
399
427
|
return [(() => {
|
|
400
|
-
var _el$
|
|
401
|
-
_el$0 = _el$9.firstChild,
|
|
428
|
+
var _el$0 = _$getNextElement(_tmpl$9),
|
|
402
429
|
_el$1 = _el$0.firstChild,
|
|
403
430
|
_el$10 = _el$1.firstChild,
|
|
404
|
-
_el$11 = _el$
|
|
405
|
-
_el$
|
|
406
|
-
|
|
407
|
-
_el$
|
|
408
|
-
|
|
409
|
-
|
|
431
|
+
_el$11 = _el$10.firstChild,
|
|
432
|
+
_el$12 = _el$10.nextSibling,
|
|
433
|
+
_el$15 = _el$12.nextSibling,
|
|
434
|
+
[_el$16, _co$2] = _$getNextMarker(_el$15.nextSibling),
|
|
435
|
+
_el$18 = _el$1.nextSibling,
|
|
436
|
+
[_el$19, _co$3] = _$getNextMarker(_el$18.nextSibling);
|
|
437
|
+
_el$0.addEventListener("scroll", onScroll);
|
|
410
438
|
var _ref$ = scrollRef;
|
|
411
|
-
typeof _ref$ === "function" ? _$use(_ref$, _el$
|
|
439
|
+
typeof _ref$ === "function" ? _$use(_ref$, _el$0) : scrollRef = _el$0;
|
|
412
440
|
var _ref$2 = tableRef;
|
|
413
|
-
typeof _ref$2 === "function" ? _$use(_ref$2, _el$
|
|
414
|
-
_$insert(_el$
|
|
441
|
+
typeof _ref$2 === "function" ? _$use(_ref$2, _el$1) : tableRef = _el$1;
|
|
442
|
+
_$insert(_el$11, _$createComponent(For, {
|
|
415
443
|
get each() {
|
|
416
444
|
return props.columns;
|
|
417
445
|
},
|
|
418
446
|
children: (col, index) => (() => {
|
|
419
|
-
var _el$
|
|
420
|
-
_el$
|
|
421
|
-
_$insert(_el$
|
|
447
|
+
var _el$20 = _$getNextElement(_tmpl$0);
|
|
448
|
+
_el$20.addEventListener("mouseenter", () => setHoveredColumnIfEnabled(index()));
|
|
449
|
+
_$insert(_el$20, (() => {
|
|
422
450
|
var _c$ = _$memo(() => !!props.renderHeader);
|
|
423
451
|
return () => _c$() ? props.renderHeader({
|
|
424
452
|
col,
|
|
@@ -430,10 +458,10 @@ function DataTableRoot(props) {
|
|
|
430
458
|
_v$14 = alignAttr(col),
|
|
431
459
|
_v$15 = columnHighlighted(index()),
|
|
432
460
|
_v$16 = ariaSortFor(col);
|
|
433
|
-
_v$13 !== _p$.e && _$className(_el$
|
|
434
|
-
_v$14 !== _p$.t && _$setAttribute(_el$
|
|
435
|
-
_v$15 !== _p$.a && _$setAttribute(_el$
|
|
436
|
-
_v$16 !== _p$.o && _$setAttribute(_el$
|
|
461
|
+
_v$13 !== _p$.e && _$className(_el$20, _p$.e = _v$13);
|
|
462
|
+
_v$14 !== _p$.t && _$setAttribute(_el$20, "data-align", _p$.t = _v$14);
|
|
463
|
+
_v$15 !== _p$.a && _$setAttribute(_el$20, "data-highlighted", _p$.a = _v$15);
|
|
464
|
+
_v$16 !== _p$.o && _$setAttribute(_el$20, "aria-sort", _p$.o = _v$16);
|
|
437
465
|
return _p$;
|
|
438
466
|
}, {
|
|
439
467
|
e: undefined,
|
|
@@ -441,24 +469,24 @@ function DataTableRoot(props) {
|
|
|
441
469
|
a: undefined,
|
|
442
470
|
o: undefined
|
|
443
471
|
});
|
|
444
|
-
return _el$
|
|
472
|
+
return _el$20;
|
|
445
473
|
})()
|
|
446
474
|
}));
|
|
447
|
-
_$insert(_el$
|
|
475
|
+
_$insert(_el$12, _$createComponent(Show, {
|
|
448
476
|
get when() {
|
|
449
477
|
return props.rows.length > 0;
|
|
450
478
|
},
|
|
451
479
|
get fallback() {
|
|
452
480
|
return (() => {
|
|
453
|
-
var _el$
|
|
454
|
-
_el$
|
|
455
|
-
_$insert(_el$
|
|
481
|
+
var _el$21 = _$getNextElement(_tmpl$1),
|
|
482
|
+
_el$22 = _el$21.firstChild;
|
|
483
|
+
_$insert(_el$22, _$createComponent(Placeholder, {
|
|
456
484
|
get description() {
|
|
457
485
|
return _$memo(() => props.empty ?? dataTableMessages().noRecords);
|
|
458
486
|
}
|
|
459
487
|
}));
|
|
460
|
-
_$effect(() => _$setAttribute(_el$
|
|
461
|
-
return _el$
|
|
488
|
+
_$effect(() => _$setAttribute(_el$22, "colspan", props.columns.length));
|
|
489
|
+
return _el$21;
|
|
462
490
|
})();
|
|
463
491
|
},
|
|
464
492
|
get children() {
|
|
@@ -470,30 +498,30 @@ function DataTableRoot(props) {
|
|
|
470
498
|
const id = () => rowId(row);
|
|
471
499
|
const isSelected = () => props.selection ? props.selection.selected().has(id() ?? "") : props.selectedRowId && id() === props.selectedRowId;
|
|
472
500
|
return (() => {
|
|
473
|
-
var _el$
|
|
474
|
-
_el$
|
|
475
|
-
_el$
|
|
476
|
-
_el$
|
|
477
|
-
_el$
|
|
478
|
-
_el$
|
|
501
|
+
var _el$23 = _$getNextElement(_tmpl$10);
|
|
502
|
+
_el$23.$$keydown = e => onRowKeyDown(e, row);
|
|
503
|
+
_el$23.$$contextmenu = () => props.onRowContextMenu?.(row);
|
|
504
|
+
_el$23.$$dblclick = event => onRowDoubleClick(event, row);
|
|
505
|
+
_el$23.$$click = event => onRowClick(event, row);
|
|
506
|
+
_el$23.addEventListener("focus", () => {
|
|
479
507
|
const key = id();
|
|
480
508
|
if (key !== undefined) props.selection?.markFocused(key);
|
|
481
509
|
});
|
|
482
510
|
_$use(element => {
|
|
483
511
|
const key = id();
|
|
484
512
|
if (key !== undefined) props.selection?.register(key, element);
|
|
485
|
-
}, _el$
|
|
486
|
-
_$insert(_el$
|
|
513
|
+
}, _el$23);
|
|
514
|
+
_$insert(_el$23, _$createComponent(For, {
|
|
487
515
|
get each() {
|
|
488
516
|
return props.columns;
|
|
489
517
|
},
|
|
490
518
|
children: (col, index) => {
|
|
491
519
|
const value = () => valueOf(row, col);
|
|
492
520
|
return (() => {
|
|
493
|
-
var _el$
|
|
494
|
-
_el$
|
|
495
|
-
_el$
|
|
496
|
-
_$insert(_el$
|
|
521
|
+
var _el$24 = _$getNextElement(_tmpl$11),
|
|
522
|
+
_el$25 = _el$24.firstChild;
|
|
523
|
+
_el$24.addEventListener("mouseenter", () => setHoveredColumnIfEnabled(index()));
|
|
524
|
+
_$insert(_el$25, (() => {
|
|
497
525
|
var _c$2 = _$memo(() => !!props.renderCell);
|
|
498
526
|
return () => _c$2() ? props.renderCell({
|
|
499
527
|
row,
|
|
@@ -511,11 +539,11 @@ function DataTableRoot(props) {
|
|
|
511
539
|
_v$25 = props.verticalAlign && props.verticalAlign !== "middle" ? props.verticalAlign : undefined,
|
|
512
540
|
_v$26 = columnHighlighted(index()),
|
|
513
541
|
_v$27 = cellContentClass();
|
|
514
|
-
_v$23 !== _p$.e && _$className(_el$
|
|
515
|
-
_v$24 !== _p$.t && _$setAttribute(_el$
|
|
516
|
-
_v$25 !== _p$.a && _$setAttribute(_el$
|
|
517
|
-
_v$26 !== _p$.o && _$setAttribute(_el$
|
|
518
|
-
_v$27 !== _p$.i && _$className(_el$
|
|
542
|
+
_v$23 !== _p$.e && _$className(_el$24, _p$.e = _v$23);
|
|
543
|
+
_v$24 !== _p$.t && _$setAttribute(_el$24, "data-align", _p$.t = _v$24);
|
|
544
|
+
_v$25 !== _p$.a && _$setAttribute(_el$24, "data-valign", _p$.a = _v$25);
|
|
545
|
+
_v$26 !== _p$.o && _$setAttribute(_el$24, "data-highlighted", _p$.o = _v$26);
|
|
546
|
+
_v$27 !== _p$.i && _$className(_el$25, _p$.i = _v$27);
|
|
519
547
|
return _p$;
|
|
520
548
|
}, {
|
|
521
549
|
e: undefined,
|
|
@@ -524,7 +552,7 @@ function DataTableRoot(props) {
|
|
|
524
552
|
o: undefined,
|
|
525
553
|
i: undefined
|
|
526
554
|
});
|
|
527
|
-
return _el$
|
|
555
|
+
return _el$24;
|
|
528
556
|
})();
|
|
529
557
|
}
|
|
530
558
|
}));
|
|
@@ -535,12 +563,12 @@ function DataTableRoot(props) {
|
|
|
535
563
|
_v$20 = isSelected() ? "true" : undefined,
|
|
536
564
|
_v$21 = props.selection ? !!isSelected() : undefined,
|
|
537
565
|
_v$22 = props.selection ? props.selection.focused() === id() ? 0 : -1 : isInteractive() ? 0 : undefined;
|
|
538
|
-
_v$17 !== _p$.e && _$className(_el$
|
|
539
|
-
_v$18 !== _p$.t && _$setAttribute(_el$
|
|
540
|
-
_v$19 !== _p$.a && _$setAttribute(_el$
|
|
541
|
-
_v$20 !== _p$.o && _$setAttribute(_el$
|
|
542
|
-
_v$21 !== _p$.i && _$setAttribute(_el$
|
|
543
|
-
_v$22 !== _p$.n && _$setAttribute(_el$
|
|
566
|
+
_v$17 !== _p$.e && _$className(_el$23, _p$.e = _v$17);
|
|
567
|
+
_v$18 !== _p$.t && _$setAttribute(_el$23, "data-hover", _p$.t = _v$18);
|
|
568
|
+
_v$19 !== _p$.a && _$setAttribute(_el$23, "data-clickable", _p$.a = _v$19);
|
|
569
|
+
_v$20 !== _p$.o && _$setAttribute(_el$23, "data-selected", _p$.o = _v$20);
|
|
570
|
+
_v$21 !== _p$.i && _$setAttribute(_el$23, "aria-selected", _p$.i = _v$21);
|
|
571
|
+
_v$22 !== _p$.n && _$setAttribute(_el$23, "tabindex", _p$.n = _v$22);
|
|
544
572
|
return _p$;
|
|
545
573
|
}, {
|
|
546
574
|
e: undefined,
|
|
@@ -551,7 +579,7 @@ function DataTableRoot(props) {
|
|
|
551
579
|
n: undefined
|
|
552
580
|
});
|
|
553
581
|
_$runHydrationEvents();
|
|
554
|
-
return _el$
|
|
582
|
+
return _el$23;
|
|
555
583
|
})();
|
|
556
584
|
}
|
|
557
585
|
}), _$createComponent(Show, {
|
|
@@ -559,31 +587,31 @@ function DataTableRoot(props) {
|
|
|
559
587
|
return props.fillHeight;
|
|
560
588
|
},
|
|
561
589
|
get children() {
|
|
562
|
-
var _el$
|
|
563
|
-
_el$
|
|
564
|
-
_$effect(() => _$setAttribute(_el$
|
|
565
|
-
return _el$
|
|
590
|
+
var _el$13 = _$getNextElement(_tmpl$7),
|
|
591
|
+
_el$14 = _el$13.firstChild;
|
|
592
|
+
_$effect(() => _$setAttribute(_el$14, "colspan", props.columns.length));
|
|
593
|
+
return _el$13;
|
|
566
594
|
}
|
|
567
595
|
})];
|
|
568
596
|
}
|
|
569
597
|
}));
|
|
570
|
-
_$insert(_el$
|
|
598
|
+
_$insert(_el$1, _$createComponent(Show, {
|
|
571
599
|
get when() {
|
|
572
600
|
return props.footer;
|
|
573
601
|
},
|
|
574
602
|
children: footer => (() => {
|
|
575
|
-
var _el$
|
|
576
|
-
_el$
|
|
577
|
-
_$insert(_el$
|
|
603
|
+
var _el$26 = _$getNextElement(_tmpl$12),
|
|
604
|
+
_el$27 = _el$26.firstChild;
|
|
605
|
+
_$insert(_el$27, _$createComponent(For, {
|
|
578
606
|
get each() {
|
|
579
607
|
return props.columns;
|
|
580
608
|
},
|
|
581
609
|
children: (col, index) => {
|
|
582
610
|
const value = () => footer().values?.[col.id];
|
|
583
611
|
return (() => {
|
|
584
|
-
var _el$
|
|
585
|
-
_el$
|
|
586
|
-
_$insert(_el$
|
|
612
|
+
var _el$28 = _$getNextElement(_tmpl$13);
|
|
613
|
+
_el$28.addEventListener("mouseenter", () => setHoveredColumnIfEnabled(index()));
|
|
614
|
+
_$insert(_el$28, (() => {
|
|
587
615
|
var _c$3 = _$memo(() => !!footer().renderCell);
|
|
588
616
|
return () => _c$3() ? footer().renderCell({
|
|
589
617
|
col,
|
|
@@ -594,31 +622,31 @@ function DataTableRoot(props) {
|
|
|
594
622
|
_$effect(_p$ => {
|
|
595
623
|
var _v$28 = alignAttr(col),
|
|
596
624
|
_v$29 = columnHighlighted(index());
|
|
597
|
-
_v$28 !== _p$.e && _$setAttribute(_el$
|
|
598
|
-
_v$29 !== _p$.t && _$setAttribute(_el$
|
|
625
|
+
_v$28 !== _p$.e && _$setAttribute(_el$28, "data-align", _p$.e = _v$28);
|
|
626
|
+
_v$29 !== _p$.t && _$setAttribute(_el$28, "data-highlighted", _p$.t = _v$29);
|
|
599
627
|
return _p$;
|
|
600
628
|
}, {
|
|
601
629
|
e: undefined,
|
|
602
630
|
t: undefined
|
|
603
631
|
});
|
|
604
|
-
return _el$
|
|
632
|
+
return _el$28;
|
|
605
633
|
})();
|
|
606
634
|
}
|
|
607
635
|
}));
|
|
608
|
-
return _el$
|
|
636
|
+
return _el$26;
|
|
609
637
|
})()
|
|
610
|
-
}), _el$
|
|
611
|
-
_$insert(_el$
|
|
638
|
+
}), _el$16, _co$2);
|
|
639
|
+
_$insert(_el$0, _$createComponent(Show, {
|
|
612
640
|
get when() {
|
|
613
641
|
return shouldRenderLoadMoreSentinel();
|
|
614
642
|
},
|
|
615
643
|
get children() {
|
|
616
|
-
var _el$
|
|
644
|
+
var _el$17 = _$getNextElement(_tmpl$8);
|
|
617
645
|
var _ref$3 = loadMoreRef;
|
|
618
|
-
typeof _ref$3 === "function" ? _$use(_ref$3, _el$
|
|
619
|
-
return _el$
|
|
646
|
+
typeof _ref$3 === "function" ? _$use(_ref$3, _el$17) : loadMoreRef = _el$17;
|
|
647
|
+
return _el$17;
|
|
620
648
|
}
|
|
621
|
-
}), _el$
|
|
649
|
+
}), _el$19, _co$3);
|
|
622
650
|
_$effect(_p$ => {
|
|
623
651
|
var _v$5 = labelledBy() ? undefined : props.ariaLabel ?? dataTableMessages().dataTable,
|
|
624
652
|
_v$6 = labelledBy(),
|
|
@@ -630,16 +658,16 @@ function DataTableRoot(props) {
|
|
|
630
658
|
_v$10 = tableClass(),
|
|
631
659
|
_v$11 = props.fillHeight ? "true" : undefined,
|
|
632
660
|
_v$12 = props.stickyHeader === false ? undefined : "true";
|
|
633
|
-
_v$5 !== _p$.e && _$setAttribute(_el$
|
|
634
|
-
_v$6 !== _p$.t && _$setAttribute(_el$
|
|
635
|
-
_v$7 !== _p$.a && _$className(_el$
|
|
636
|
-
_v$8 !== _p$.o && _$setAttribute(_el$
|
|
637
|
-
_v$9 !== _p$.i && _$setAttribute(_el$
|
|
638
|
-
_v$0 !== _p$.n && _$setAttribute(_el$
|
|
639
|
-
_v$1 !== _p$.s && _$setAttribute(_el$
|
|
640
|
-
_v$10 !== _p$.h && _$className(_el$
|
|
641
|
-
_v$11 !== _p$.r && _$setAttribute(_el$
|
|
642
|
-
_v$12 !== _p$.d && _$setAttribute(_el$
|
|
661
|
+
_v$5 !== _p$.e && _$setAttribute(_el$0, "aria-label", _p$.e = _v$5);
|
|
662
|
+
_v$6 !== _p$.t && _$setAttribute(_el$0, "aria-labelledby", _p$.t = _v$6);
|
|
663
|
+
_v$7 !== _p$.a && _$className(_el$0, _p$.a = _v$7);
|
|
664
|
+
_v$8 !== _p$.o && _$setAttribute(_el$0, "data-density", _p$.o = _v$8);
|
|
665
|
+
_v$9 !== _p$.i && _$setAttribute(_el$0, "data-has-footer", _p$.i = _v$9);
|
|
666
|
+
_v$0 !== _p$.n && _$setAttribute(_el$0, "data-surface", _p$.n = _v$0);
|
|
667
|
+
_v$1 !== _p$.s && _$setAttribute(_el$0, "data-scroll-preserve", _p$.s = _v$1);
|
|
668
|
+
_v$10 !== _p$.h && _$className(_el$1, _p$.h = _v$10);
|
|
669
|
+
_v$11 !== _p$.r && _$setAttribute(_el$1, "data-fill", _p$.r = _v$11);
|
|
670
|
+
_v$12 !== _p$.d && _$setAttribute(_el$10, "data-sticky", _p$.d = _v$12);
|
|
643
671
|
return _p$;
|
|
644
672
|
}, {
|
|
645
673
|
e: undefined,
|
|
@@ -653,26 +681,26 @@ function DataTableRoot(props) {
|
|
|
653
681
|
r: undefined,
|
|
654
682
|
d: undefined
|
|
655
683
|
});
|
|
656
|
-
return _el$
|
|
684
|
+
return _el$0;
|
|
657
685
|
})(), _$createComponent(For, {
|
|
658
686
|
each: ["y", "x"],
|
|
659
687
|
children: axis => (() => {
|
|
660
|
-
var _el$
|
|
661
|
-
_el$
|
|
662
|
-
_el$
|
|
663
|
-
_el$
|
|
664
|
-
_el$
|
|
688
|
+
var _el$29 = _$getNextElement(_tmpl$14),
|
|
689
|
+
_el$30 = _el$29.firstChild;
|
|
690
|
+
_el$29.addEventListener("pointercancel", event => event.currentTarget.releasePointerCapture(event.pointerId));
|
|
691
|
+
_el$29.$$pointerup = event => event.currentTarget.releasePointerCapture(event.pointerId);
|
|
692
|
+
_el$29.$$pointermove = event => {
|
|
665
693
|
if (event.currentTarget.hasPointerCapture(event.pointerId)) scrollFromPointer(event, axis);
|
|
666
694
|
};
|
|
667
|
-
_el$
|
|
668
|
-
_$setAttribute(_el$
|
|
695
|
+
_el$29.$$pointerdown = event => startScrollbarDrag(event, axis);
|
|
696
|
+
_$setAttribute(_el$29, "data-axis", axis);
|
|
669
697
|
_$effect(_p$ => {
|
|
670
698
|
var _v$30 = scrollbars()[axis].overflow ? "true" : undefined,
|
|
671
699
|
_v$31 = `${scrollbars()[axis].offset}px`,
|
|
672
700
|
_v$32 = `${scrollbars()[axis].size}px`;
|
|
673
|
-
_v$30 !== _p$.e && _$setAttribute(_el$
|
|
674
|
-
_v$31 !== _p$.t && _$setStyleProperty(_el$
|
|
675
|
-
_v$32 !== _p$.a && _$setStyleProperty(_el$
|
|
701
|
+
_v$30 !== _p$.e && _$setAttribute(_el$29, "data-overflow", _p$.e = _v$30);
|
|
702
|
+
_v$31 !== _p$.t && _$setStyleProperty(_el$30, "--k2b-data-table-scroll-offset", _p$.t = _v$31);
|
|
703
|
+
_v$32 !== _p$.a && _$setStyleProperty(_el$30, "--k2b-data-table-scroll-size", _p$.a = _v$32);
|
|
676
704
|
return _p$;
|
|
677
705
|
}, {
|
|
678
706
|
e: undefined,
|
|
@@ -680,7 +708,7 @@ function DataTableRoot(props) {
|
|
|
680
708
|
a: undefined
|
|
681
709
|
});
|
|
682
710
|
_$runHydrationEvents();
|
|
683
|
-
return _el$
|
|
711
|
+
return _el$29;
|
|
684
712
|
})()
|
|
685
713
|
})];
|
|
686
714
|
}
|
|
@@ -715,14 +743,14 @@ const DataTableHeader = props => {
|
|
|
715
743
|
const panel = useContext(DataTablePanelContext);
|
|
716
744
|
panel?.registerHeading();
|
|
717
745
|
return (() => {
|
|
718
|
-
var _el$
|
|
719
|
-
_$insert(_el$
|
|
746
|
+
var _el$31 = _$getNextElement(_tmpl$15);
|
|
747
|
+
_$insert(_el$31, _$createComponent(PanelHeader, {
|
|
720
748
|
get title() {
|
|
721
749
|
return (() => {
|
|
722
|
-
var _el$
|
|
723
|
-
_$insert(_el$
|
|
724
|
-
_$effect(() => _$setAttribute(_el$
|
|
725
|
-
return _el$
|
|
750
|
+
var _el$32 = _$getNextElement(_tmpl$16);
|
|
751
|
+
_$insert(_el$32, () => props.title);
|
|
752
|
+
_$effect(() => _$setAttribute(_el$32, "id", panel?.headingId));
|
|
753
|
+
return _el$32;
|
|
726
754
|
})();
|
|
727
755
|
},
|
|
728
756
|
get subtitle() {
|
|
@@ -738,22 +766,22 @@ const DataTableHeader = props => {
|
|
|
738
766
|
return props.size;
|
|
739
767
|
}
|
|
740
768
|
}));
|
|
741
|
-
_$effect(() => _$className(_el$
|
|
742
|
-
return _el$
|
|
769
|
+
_$effect(() => _$className(_el$31, `k2b-data-panel__header ${props.class ?? ""}`));
|
|
770
|
+
return _el$31;
|
|
743
771
|
})();
|
|
744
772
|
};
|
|
745
773
|
const DataTableControls = props => (() => {
|
|
746
|
-
var _el$32 = _$getNextElement(_tmpl$13);
|
|
747
|
-
_$insert(_el$32, () => props.children);
|
|
748
|
-
_$effect(() => _$className(_el$32, `k2b-data-panel__controls ${props.class ?? ""}`));
|
|
749
|
-
return _el$32;
|
|
750
|
-
})();
|
|
751
|
-
const DataTablePanelFooter = props => (() => {
|
|
752
774
|
var _el$33 = _$getNextElement(_tmpl$15);
|
|
753
775
|
_$insert(_el$33, () => props.children);
|
|
754
|
-
_$effect(() => _$className(_el$33, `k2b-data-
|
|
776
|
+
_$effect(() => _$className(_el$33, `k2b-data-panel__controls ${props.class ?? ""}`));
|
|
755
777
|
return _el$33;
|
|
756
778
|
})();
|
|
779
|
+
const DataTablePanelFooter = props => (() => {
|
|
780
|
+
var _el$34 = _$getNextElement(_tmpl$17);
|
|
781
|
+
_$insert(_el$34, () => props.children);
|
|
782
|
+
_$effect(() => _$className(_el$34, `k2b-data-panel__footer ${props.class ?? ""}`));
|
|
783
|
+
return _el$34;
|
|
784
|
+
})();
|
|
757
785
|
const DataTable = DataTableRoot;
|
|
758
786
|
DataTable.Panel = DataTablePanel;
|
|
759
787
|
DataTable.Header = DataTableHeader;
|