@bysages/solid 0.2.3 → 0.3.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 +16 -2
- package/dist/{ai-response-B_586r27.mjs → ai-response-ClGGptX3.mjs} +15 -15
- package/dist/chevron-D5RzcayK.mjs +9 -0
- package/dist/components/affix/index.mjs +15 -17
- package/dist/components/ai/index.d.mts +1 -1
- package/dist/components/ai/index.mjs +12 -10
- package/dist/components/ai-action/index.mjs +2 -2
- package/dist/components/ai-attachments/index.mjs +50 -38
- package/dist/components/ai-message/index.mjs +11 -13
- package/dist/components/ai-prompt-input/index.mjs +70 -53
- package/dist/components/ai-reasoning/index.mjs +10 -6
- package/dist/components/ai-response/index.mjs +1 -1
- package/dist/components/ai-source/index.mjs +23 -23
- package/dist/components/ai-suggestion/index.mjs +1 -1
- package/dist/components/ai-tool/index.mjs +29 -17
- package/dist/components/alert/index.mjs +37 -42
- package/dist/components/angle-slider/index.mjs +2 -2
- package/dist/components/aspect-ratio/index.mjs +14 -16
- package/dist/components/autocomplete/index.mjs +3 -2
- package/dist/components/avatar/index.d.mts +3 -0
- package/dist/components/avatar/index.mjs +10 -5
- package/dist/components/avatar-group/index.mjs +11 -13
- package/dist/components/back-top/index.mjs +31 -27
- package/dist/components/badge/index.mjs +14 -16
- package/dist/components/banner/index.mjs +24 -28
- package/dist/components/bento/index.d.mts +24 -0
- package/dist/components/bento/index.mjs +51 -0
- package/dist/components/block-ui/index.d.mts +12 -0
- package/dist/components/block-ui/index.mjs +43 -0
- package/dist/components/breadcrumb/index.mjs +7 -5
- package/dist/components/browser/index.d.mts +21 -0
- package/dist/components/browser/index.mjs +87 -0
- package/dist/components/button/index.mjs +27 -29
- package/dist/components/button-group/index.mjs +18 -20
- package/dist/components/calendar/index.mjs +141 -129
- package/dist/components/card/index.mjs +2 -2
- package/dist/components/cascade-select/index.mjs +160 -121
- package/dist/components/checkbox/index.mjs +2 -2
- package/dist/components/checkbox-group/index.mjs +53 -55
- package/dist/components/chip/index.mjs +22 -20
- package/dist/components/clipboard/index.mjs +2 -2
- package/dist/components/color-picker/index.mjs +2 -2
- package/dist/components/combobox/index.mjs +2 -2
- package/dist/components/command/index.mjs +73 -57
- package/dist/components/comment/index.mjs +77 -62
- package/dist/components/config-provider/index.mjs +10 -8
- package/dist/components/container/index.mjs +14 -16
- package/dist/components/data-view/index.d.mts +18 -0
- package/dist/components/data-view/index.mjs +110 -0
- package/dist/components/date-input/index.mjs +2 -2
- package/dist/components/date-picker/index.mjs +2 -2
- package/dist/components/deferred-content/index.d.mts +16 -0
- package/dist/components/deferred-content/index.mjs +52 -0
- package/dist/components/descriptions/index.d.mts +9 -1
- package/dist/components/descriptions/index.mjs +43 -16
- package/dist/components/dock/index.d.mts +22 -0
- package/dist/components/dock/index.mjs +64 -0
- package/dist/components/dynamic-input/index.mjs +71 -68
- package/dist/components/editable/index.mjs +2 -2
- package/dist/components/ellipsis/index.mjs +17 -19
- package/dist/components/empty/index.mjs +2 -2
- package/dist/components/file-upload/index.mjs +2 -2
- package/dist/components/float-button/index.mjs +39 -38
- package/dist/components/form/index.d.mts +1 -1
- package/dist/components/form/index.mjs +52 -37
- package/dist/components/grid/index.mjs +19 -21
- package/dist/components/icon/index.d.mts +9 -4
- package/dist/components/icon/index.mjs +37 -36
- package/dist/components/image/index.mjs +44 -43
- package/dist/components/image-viewer/index.mjs +46 -37
- package/dist/components/input/index.d.mts +3 -0
- package/dist/components/input/index.mjs +1 -41
- package/dist/components/input-group/index.mjs +14 -18
- package/dist/components/kbd/index.mjs +8 -10
- package/dist/components/layout/index.mjs +77 -77
- package/dist/components/link/index.mjs +12 -13
- package/dist/components/list/index.mjs +52 -47
- package/dist/components/listbox/index.mjs +2 -2
- package/dist/components/masonry/index.mjs +15 -17
- package/dist/components/mentions/index.mjs +1 -1
- package/dist/components/menu/index.mjs +2 -2
- package/dist/components/menubar/index.mjs +58 -57
- package/dist/components/meter/index.mjs +41 -41
- package/dist/components/number-input/index.mjs +2 -2
- package/dist/components/order-list/index.d.mts +21 -0
- package/dist/components/order-list/index.mjs +160 -0
- package/dist/components/page-header/index.mjs +2 -2
- package/dist/components/pagination/index.mjs +2 -2
- package/dist/components/password-input/index.mjs +2 -2
- package/dist/components/pin-input/index.mjs +2 -2
- package/dist/components/popconfirm/index.mjs +19 -12
- package/dist/components/progress/index.mjs +2 -2
- package/dist/components/progress-group/index.mjs +65 -58
- package/dist/components/radio-group/index.mjs +2 -2
- package/dist/components/rating-group/index.mjs +2 -2
- package/dist/components/result/index.d.mts +22 -0
- package/dist/components/result/index.mjs +66 -0
- package/dist/components/select/index.d.mts +2 -17
- package/dist/components/select/index.mjs +2 -18
- package/dist/components/separator/index.mjs +17 -19
- package/dist/components/skeleton/index.mjs +8 -10
- package/dist/components/slider/index.mjs +2 -2
- package/dist/components/spinner/index.mjs +15 -17
- package/dist/components/split-button/index.mjs +84 -83
- package/dist/components/spotlight/index.d.mts +11 -0
- package/dist/components/spotlight/index.mjs +38 -0
- package/dist/components/stack/index.mjs +20 -22
- package/dist/components/stat/index.mjs +12 -14
- package/dist/components/steps/index.mjs +2 -2
- package/dist/components/switch/index.mjs +2 -2
- package/dist/components/table/index.mjs +308 -211
- package/dist/components/tabs/index.d.mts +2 -0
- package/dist/components/tabs/index.mjs +10 -5
- package/dist/components/tags-input/index.mjs +2 -2
- package/dist/components/terminal/index.d.mts +17 -0
- package/dist/components/terminal/index.mjs +84 -0
- package/dist/components/textarea/index.mjs +8 -8
- package/dist/components/timeline/index.d.mts +9 -3
- package/dist/components/timeline/index.mjs +18 -3
- package/dist/components/toggle-group/index.mjs +2 -2
- package/dist/components/toolbar/index.d.mts +17 -0
- package/dist/components/toolbar/index.mjs +46 -0
- package/dist/components/transfer/index.mjs +116 -107
- package/dist/components/tree-select/index.mjs +29 -21
- package/dist/components/tree-view/index.mjs +2 -2
- package/dist/components/typography/index.mjs +2 -2
- package/dist/components/user/index.d.mts +19 -0
- package/dist/components/user/index.mjs +68 -0
- package/dist/components/virtual-list/index.d.mts +17 -0
- package/dist/components/virtual-list/index.mjs +71 -0
- package/dist/components/watermark/index.mjs +19 -13
- package/dist/{index-B4XS2n2y.d.mts → index-IfofF-SW.d.mts} +718 -3773
- package/dist/index-YPUiqD3n.d.mts +42 -0
- package/dist/index.d.mts +16 -3
- package/dist/index.mjs +20 -7
- package/dist/input-DoFQ7RXh.mjs +78 -0
- package/dist/{mentions-xbI6vJAP.mjs → mentions-f5Js_2W7.mjs} +76 -70
- package/dist/select-CHaXbzLX.mjs +115 -0
- package/package.json +28 -7
- package/dist/chevron-GWEoEYdO.mjs +0 -9
|
@@ -1,35 +1,33 @@
|
|
|
1
1
|
import { Pagination } from "../pagination/index.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { t as Select$1 } from "../../select-CHaXbzLX.mjs";
|
|
3
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
4
|
-
import {
|
|
4
|
+
import { addEvent, createComponent, delegateEvents, effect, insert, memo, readShallow, ref, setAttribute, setStyleProperty, spread, style, template } from "@solidjs/web";
|
|
5
5
|
import { For, createMemo, createSignal, onCleanup, onMount } from "solid-js";
|
|
6
6
|
import { createListCollection } from "@ark-ui/solid/select";
|
|
7
7
|
import { FlexRender, cellSpanningFeature, columnFilteringFeature, columnOrderingFeature, columnPinningFeature, columnSizingFeature, columnVisibilityFeature, createColumnHelper, createExpandedRowModel, createFilteredRowModel, createPaginatedRowModel, createSortedRowModel, createTable, filterFn_arrIncludes, filterFn_equals, filterFn_inDateRange, filterFn_inNumberRange, filterFn_includesString, filterFn_weakEquals, globalFilteringFeature, rowExpandingFeature, rowPaginationFeature, rowSelectionFeature, rowSortingFeature, sortFn_alphanumeric, sortFn_alphanumericCaseSensitive, sortFn_basic, sortFn_datetime, sortFn_text, sortFn_textCaseSensitive, tableFeatures } from "@tanstack/solid-table";
|
|
8
8
|
import { createVirtualizer } from "@tanstack/solid-virtual";
|
|
9
9
|
//#region src/components/table/index.tsx
|
|
10
|
-
var _tmpl$ =
|
|
11
|
-
var _tmpl$2 =
|
|
12
|
-
var _tmpl$3 =
|
|
13
|
-
var _tmpl$4 =
|
|
14
|
-
var _tmpl$5 =
|
|
15
|
-
var _tmpl$6 =
|
|
16
|
-
var _tmpl$7 =
|
|
17
|
-
var _tmpl$8 =
|
|
18
|
-
var _tmpl$9 =
|
|
19
|
-
var _tmpl$
|
|
20
|
-
var _tmpl$
|
|
21
|
-
var _tmpl$
|
|
22
|
-
var _tmpl$
|
|
23
|
-
var _tmpl$
|
|
24
|
-
var _tmpl$
|
|
25
|
-
var _tmpl$14 = /*#__PURE__*/ template(`<div data-scope=table data-part=pagination><span data-scope=table data-part=page-status></span><div data-scope=table data-part=page-nav>`);
|
|
10
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"width=14 height=14 fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path>`);
|
|
11
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"width=14 height=14 fill=none stroke=currentColor stroke-width=2.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m6 9 6 6 6-6">`);
|
|
12
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m9 6 6 6-6 6">`);
|
|
13
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<input>`);
|
|
14
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<div data-scope=table data-part=cell-main><button type=button data-scope=table data-part=expander>`);
|
|
15
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<div>`);
|
|
16
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div role=row data-scope=table data-part=row>`);
|
|
17
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div><!><!>`);
|
|
18
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<input type=text data-scope=table data-part=header-filter placeholder=Filter>`);
|
|
19
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div data-scope=table data-part=root><div data-scope=table data-part=viewport><div role=table data-scope=table data-part=table><div role=rowgroup data-scope=table data-part=header></div><div role=rowgroup data-scope=table data-part=body><!><!></div></div></div><!>`);
|
|
20
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<div data-scope=table data-part=toolbar><input type=search data-scope=table data-part=global-filter aria-label="Filter all columns">`);
|
|
21
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<div><input>`);
|
|
22
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<div data-scope=table data-part=empty>`);
|
|
23
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<div role=rowgroup data-scope=table data-part=footer>`);
|
|
24
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<div data-scope=table data-part=pagination><span data-scope=table data-part=page-status></span><div data-scope=table data-part=page-nav><!><!>`);
|
|
26
25
|
/** The pagination bar's arrows — thin chevrons for the row of seals. */
|
|
27
26
|
function pageGlyph(direction) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
})();
|
|
27
|
+
var _el$ = _tmpl$();
|
|
28
|
+
var _el$2 = _el$.firstChild;
|
|
29
|
+
setAttribute(_el$2, "d", direction === "start" ? "m15 18-6-6 6-6" : "m9 18 6-6-6-6");
|
|
30
|
+
return _el$;
|
|
33
31
|
}
|
|
34
32
|
/** The page-size select's pointing chevron. */
|
|
35
33
|
function chevronDownGlyph() {
|
|
@@ -401,44 +399,59 @@ function DataTable(props) {
|
|
|
401
399
|
let content;
|
|
402
400
|
if (column.id === SELECT_COL_ID) content = (() => {
|
|
403
401
|
var _el$5 = _tmpl$4();
|
|
404
|
-
spread(_el$5,
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
402
|
+
spread(_el$5, [
|
|
403
|
+
{
|
|
404
|
+
type: "checkbox",
|
|
405
|
+
get checked() {
|
|
406
|
+
return row.getIsSelected();
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
{ indeterminate: false },
|
|
410
|
+
{
|
|
411
|
+
"aria-label": "Select row",
|
|
412
|
+
onchange: () => row.toggleSelected(!row.getIsSelected())
|
|
413
|
+
}
|
|
414
|
+
], false);
|
|
410
415
|
return _el$5;
|
|
411
416
|
})();
|
|
412
417
|
else if (isExpandHost) content = (() => {
|
|
413
|
-
var _el$6 = _tmpl$5()
|
|
414
|
-
_el$7
|
|
418
|
+
var _el$6 = _tmpl$5();
|
|
419
|
+
var _el$7 = _el$6.firstChild;
|
|
420
|
+
_el$7._$$click = () => row.toggleExpanded();
|
|
415
421
|
insert(_el$7, chevronGlyph);
|
|
416
422
|
insert(_el$6, createComponent(FlexRender, { cell }), null);
|
|
417
|
-
effect((
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
}, {
|
|
425
|
-
e
|
|
426
|
-
t
|
|
427
|
-
a
|
|
428
|
-
o
|
|
423
|
+
effect(() => {
|
|
424
|
+
return {
|
|
425
|
+
e: String(row.depth),
|
|
426
|
+
t: row.getIsExpanded() || void 0,
|
|
427
|
+
a: !row.getCanExpand() || void 0,
|
|
428
|
+
o: row.getIsExpanded() ? "Collapse row" : "Expand row"
|
|
429
|
+
};
|
|
430
|
+
}, ({ e, t, a, o }, _p$) => {
|
|
431
|
+
e !== _p$?.e && setStyleProperty(_el$6, "--bs-table-depth", e);
|
|
432
|
+
t !== _p$?.t && setAttribute(_el$7, "data-expanded", t);
|
|
433
|
+
a !== _p$?.a && setAttribute(_el$7, "data-leaf", a);
|
|
434
|
+
o !== _p$?.o && setAttribute(_el$7, "aria-label", o);
|
|
429
435
|
});
|
|
430
436
|
return _el$6;
|
|
431
437
|
})();
|
|
432
438
|
else content = createComponent(FlexRender, { cell });
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
439
|
+
var _el$8 = _tmpl$6();
|
|
440
|
+
spread(_el$8, [
|
|
441
|
+
{
|
|
442
|
+
role: "cell",
|
|
443
|
+
"data-scope": "table",
|
|
444
|
+
"data-part": "cell",
|
|
445
|
+
get "data-numeric"() {
|
|
446
|
+
return column.columnDef.meta?.numeric ? "" : void 0;
|
|
447
|
+
},
|
|
448
|
+
"data-spanned": rowSpan > 1 ? "" : void 0
|
|
449
|
+
},
|
|
450
|
+
pin,
|
|
451
|
+
{ style }
|
|
452
|
+
], true);
|
|
453
|
+
insert(_el$8, content);
|
|
454
|
+
return _el$8;
|
|
442
455
|
}
|
|
443
456
|
function renderRow(row, virtualItem) {
|
|
444
457
|
const style$1 = virtualItem ? {
|
|
@@ -449,31 +462,29 @@ function DataTable(props) {
|
|
|
449
462
|
"block-size": `${virtualItem.size}px`
|
|
450
463
|
} : {};
|
|
451
464
|
const draggable = rowDraggable();
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
return _el$9;
|
|
476
|
-
})();
|
|
465
|
+
var _el$9 = _tmpl$7();
|
|
466
|
+
addEvent(_el$9, "dragend", draggable ? onRowDragEnd : void 0);
|
|
467
|
+
addEvent(_el$9, "drop", draggable ? (e) => onRowDrop(row, e) : void 0);
|
|
468
|
+
addEvent(_el$9, "dragleave", draggable ? onRowDragLeave : void 0);
|
|
469
|
+
addEvent(_el$9, "dragover", draggable ? (e) => onRowDragOver(row, e) : void 0);
|
|
470
|
+
addEvent(_el$9, "dragstart", draggable ? (e) => onRowDragStart(row, e) : void 0);
|
|
471
|
+
setAttribute(_el$9, "draggable", draggable || void 0);
|
|
472
|
+
insert(_el$9, createComponent(For, {
|
|
473
|
+
get each() {
|
|
474
|
+
return row.getVisibleCells();
|
|
475
|
+
},
|
|
476
|
+
children: (cell) => renderCell(cell, row)
|
|
477
|
+
}));
|
|
478
|
+
effect(() => {
|
|
479
|
+
return {
|
|
480
|
+
e: row.getIsSelected() || void 0,
|
|
481
|
+
t: readShallow(style$1)
|
|
482
|
+
};
|
|
483
|
+
}, ({ e, t }, _p$) => {
|
|
484
|
+
e !== _p$?.e && setAttribute(_el$9, "data-selected", e);
|
|
485
|
+
style(_el$9, t, _p$?.t);
|
|
486
|
+
});
|
|
487
|
+
return _el$9;
|
|
477
488
|
}
|
|
478
489
|
function renderHeaderCell(header) {
|
|
479
490
|
const column = header.column;
|
|
@@ -481,90 +492,145 @@ function DataTable(props) {
|
|
|
481
492
|
const canSort = column.getCanSort();
|
|
482
493
|
const canFilter = props.filterable && column.getCanFilter();
|
|
483
494
|
const canDrag = !!props.reorderable && column.id !== SELECT_COL_ID && !column.getIsPinned();
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
495
|
+
var _el$10 = _tmpl$8();
|
|
496
|
+
var _el$11 = _el$10.firstChild;
|
|
497
|
+
var _el$12 = _el$11.nextSibling;
|
|
498
|
+
spread(_el$10, [
|
|
499
|
+
{
|
|
500
|
+
role: "columnheader",
|
|
501
|
+
"data-scope": "table",
|
|
502
|
+
"data-part": "header-cell",
|
|
503
|
+
"data-sortable": canSort || void 0,
|
|
504
|
+
"data-sort": sorted || void 0,
|
|
505
|
+
get "data-numeric"() {
|
|
493
506
|
return column.columnDef.meta?.numeric ? "" : void 0;
|
|
494
507
|
},
|
|
495
|
-
|
|
508
|
+
"data-draggable": canDrag || void 0,
|
|
509
|
+
get "data-id"() {
|
|
496
510
|
return column.id;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
"
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
_el$1.addEventListener("dragstart", (e) => e.stopPropagation());
|
|
514
|
-
_el$1.$$click = (e) => e.stopPropagation();
|
|
515
|
-
setAttribute(_el$1, "draggable", false);
|
|
516
|
-
effect(() => setAttribute(_el$1, "aria-label", `Filter ${column.id}`));
|
|
517
|
-
effect(() => _el$1.value = column.getFilterValue() ?? "");
|
|
518
|
-
return _el$1;
|
|
519
|
-
})() : null, null);
|
|
520
|
-
return _el$0;
|
|
521
|
-
})();
|
|
522
|
-
}
|
|
523
|
-
return (() => {
|
|
524
|
-
var _el$10 = _tmpl$0(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling;
|
|
511
|
+
},
|
|
512
|
+
draggable: canDrag || void 0,
|
|
513
|
+
"aria-sort": sorted === "asc" ? "ascending" : sorted === "desc" ? "descending" : void 0
|
|
514
|
+
},
|
|
515
|
+
() => {
|
|
516
|
+
return pinAttrs(column);
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
onclick: canSort ? () => column.toggleSorting() : void 0,
|
|
520
|
+
ondragstart: canDrag ? onColDragStart : void 0,
|
|
521
|
+
ondragover: canDrag ? (e) => onColDragOver(column, e) : void 0,
|
|
522
|
+
ondragleave: canDrag ? onColDragLeave : void 0,
|
|
523
|
+
ondrop: canDrag ? (e) => onColDrop(column, e) : void 0,
|
|
524
|
+
ondragend: canDrag ? onColDragEnd : void 0
|
|
525
|
+
}
|
|
526
|
+
], true);
|
|
525
527
|
insert(_el$10, (() => {
|
|
526
|
-
var _c$
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
return _el$15;
|
|
533
|
-
})() : null;
|
|
528
|
+
var _c$ = memo(() => {
|
|
529
|
+
return !!(header.isPlaceholder || header.column.columnDef.header === "");
|
|
530
|
+
});
|
|
531
|
+
return () => {
|
|
532
|
+
return _c$() ? null : createComponent(FlexRender, { header });
|
|
533
|
+
};
|
|
534
534
|
})(), _el$11);
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
})
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
535
|
+
insert(_el$10, canFilter ? (() => {
|
|
536
|
+
var _el$13 = _tmpl$9();
|
|
537
|
+
_el$13._$$input = (e) => column.setFilterValue(e.target.value);
|
|
538
|
+
_el$13.addEventListener("dragstart", (e) => e.stopPropagation());
|
|
539
|
+
_el$13._$$click = (e) => e.stopPropagation();
|
|
540
|
+
effect(() => {
|
|
541
|
+
return {
|
|
542
|
+
e: `Filter ${column.id}`,
|
|
543
|
+
t: column.getFilterValue() ?? ""
|
|
544
|
+
};
|
|
545
|
+
}, ({ e, t }, _p$) => {
|
|
546
|
+
e !== _p$?.e && setAttribute(_el$13, "aria-label", e);
|
|
547
|
+
_el$13.value = t ?? "";
|
|
548
|
+
});
|
|
549
|
+
return _el$13;
|
|
550
|
+
})() : null, _el$12);
|
|
551
|
+
return _el$10;
|
|
552
|
+
}
|
|
553
|
+
var _el$14 = _tmpl$10();
|
|
554
|
+
var _el$15 = _el$14.firstChild;
|
|
555
|
+
var _el$16 = _el$15.firstChild;
|
|
556
|
+
var _el$17 = _el$16.firstChild;
|
|
557
|
+
var _el$18 = _el$17.nextSibling;
|
|
558
|
+
var _el$19 = _el$18.firstChild;
|
|
559
|
+
var _el$20 = _el$19.nextSibling;
|
|
560
|
+
var _el$21 = _el$15.nextSibling;
|
|
561
|
+
insert(_el$14, (() => {
|
|
562
|
+
var _c$2 = memo(() => {
|
|
563
|
+
return !!(props.filterable && (props.showToolbar ?? true));
|
|
564
|
+
});
|
|
565
|
+
return () => {
|
|
566
|
+
return _c$2() ? (() => {
|
|
567
|
+
var _el$22 = _tmpl$11();
|
|
568
|
+
var _el$23 = _el$22.firstChild;
|
|
569
|
+
_el$23._$$input = (e) => table.setGlobalFilter(e.target.value);
|
|
570
|
+
effect(() => {
|
|
571
|
+
return {
|
|
572
|
+
e: props.globalFilterPlaceholder,
|
|
573
|
+
t: table.atoms.globalFilter.get() ?? ""
|
|
574
|
+
};
|
|
575
|
+
}, ({ e, t }, _p$) => {
|
|
576
|
+
e !== _p$?.e && setAttribute(_el$23, "placeholder", e);
|
|
577
|
+
_el$23.value = t ?? "";
|
|
578
|
+
});
|
|
579
|
+
return _el$22;
|
|
580
|
+
})() : null;
|
|
581
|
+
};
|
|
582
|
+
})(), _el$15);
|
|
583
|
+
ref(() => {
|
|
584
|
+
return setViewport;
|
|
585
|
+
}, _el$15);
|
|
586
|
+
insert(_el$17, createComponent(For, {
|
|
587
|
+
get each() {
|
|
588
|
+
return table.getHeaderGroups();
|
|
589
|
+
},
|
|
590
|
+
children: (group) => (() => {
|
|
591
|
+
var _el$24 = _tmpl$7();
|
|
592
|
+
insert(_el$24, createComponent(For, {
|
|
593
|
+
get each() {
|
|
594
|
+
return group.headers;
|
|
595
|
+
},
|
|
596
|
+
children: (header) => {
|
|
597
|
+
const column = header.column;
|
|
598
|
+
if (column.id !== SELECT_COL_ID) return renderHeaderCell(header);
|
|
599
|
+
const all = table.getIsAllRowsSelected();
|
|
600
|
+
var _el$25 = _tmpl$12();
|
|
601
|
+
var _el$26 = _el$25.firstChild;
|
|
602
|
+
spread(_el$25, [{
|
|
603
|
+
role: "columnheader",
|
|
604
|
+
"data-scope": "table",
|
|
605
|
+
"data-part": "header-cell"
|
|
606
|
+
}, () => {
|
|
607
|
+
return pinAttrs(column);
|
|
608
|
+
}], true);
|
|
609
|
+
spread(_el$26, [
|
|
610
|
+
{
|
|
611
|
+
type: "checkbox",
|
|
612
|
+
checked: all
|
|
613
|
+
},
|
|
614
|
+
() => {
|
|
615
|
+
return { indeterminate: table.getIsSomeRowsSelected() && !all };
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"aria-label": "Select all rows",
|
|
619
|
+
onchange: () => table.toggleAllRowsSelected(!all)
|
|
620
|
+
}
|
|
621
|
+
], false);
|
|
622
|
+
return _el$25;
|
|
623
|
+
}
|
|
624
|
+
}));
|
|
625
|
+
return _el$24;
|
|
626
|
+
})()
|
|
627
|
+
}));
|
|
628
|
+
insert(_el$18, (() => {
|
|
629
|
+
var _c$3 = memo(() => {
|
|
630
|
+
return !!virtual();
|
|
631
|
+
});
|
|
632
|
+
return () => {
|
|
633
|
+
return _c$3() ? createComponent(For, {
|
|
568
634
|
get each() {
|
|
569
635
|
return virtualizer.getVirtualItems();
|
|
570
636
|
},
|
|
@@ -575,53 +641,84 @@ function DataTable(props) {
|
|
|
575
641
|
},
|
|
576
642
|
children: (row) => renderRow(row)
|
|
577
643
|
});
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
644
|
+
};
|
|
645
|
+
})(), _el$19);
|
|
646
|
+
insert(_el$18, (() => {
|
|
647
|
+
var _c$4 = memo(() => {
|
|
648
|
+
return rows().length === 0;
|
|
649
|
+
});
|
|
650
|
+
return () => {
|
|
651
|
+
return _c$4() ? (() => {
|
|
652
|
+
var _el$27 = _tmpl$13();
|
|
653
|
+
insert(_el$27, () => {
|
|
654
|
+
return props.emptyText;
|
|
655
|
+
});
|
|
656
|
+
return _el$27;
|
|
585
657
|
})() : null;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
658
|
+
};
|
|
659
|
+
})(), _el$20);
|
|
660
|
+
insert(_el$16, (() => {
|
|
661
|
+
var _c$5 = memo(() => {
|
|
662
|
+
return !!(props.stickyFooter && table.getFooterGroups().some((group) => group.headers.some((header) => header.column.columnDef.footer)));
|
|
663
|
+
});
|
|
664
|
+
return () => {
|
|
665
|
+
return _c$5() ? (() => {
|
|
666
|
+
var _el$28 = _tmpl$14();
|
|
667
|
+
insert(_el$28, createComponent(For, {
|
|
592
668
|
get each() {
|
|
593
669
|
return table.getFooterGroups();
|
|
594
670
|
},
|
|
595
671
|
children: (group) => (() => {
|
|
596
|
-
var _el$
|
|
597
|
-
insert(_el$
|
|
672
|
+
var _el$29 = _tmpl$7();
|
|
673
|
+
insert(_el$29, createComponent(For, {
|
|
598
674
|
get each() {
|
|
599
675
|
return group.headers;
|
|
600
676
|
},
|
|
601
677
|
children: (header) => (() => {
|
|
602
|
-
var _el$
|
|
603
|
-
spread(_el$
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
678
|
+
var _el$30 = _tmpl$6();
|
|
679
|
+
spread(_el$30, [{
|
|
680
|
+
role: "columnheader",
|
|
681
|
+
"data-scope": "table",
|
|
682
|
+
"data-part": "footer-cell",
|
|
683
|
+
get "data-numeric"() {
|
|
684
|
+
return header.column.columnDef.meta?.numeric ? "" : void 0;
|
|
685
|
+
}
|
|
686
|
+
}, () => {
|
|
687
|
+
return pinAttrs(header.column);
|
|
688
|
+
}], true);
|
|
689
|
+
insert(_el$30, (() => {
|
|
690
|
+
var _c$7 = memo(() => {
|
|
691
|
+
return !!header.isPlaceholder;
|
|
692
|
+
});
|
|
693
|
+
return () => {
|
|
694
|
+
return _c$7() ? null : createComponent(FlexRender, { footer: header });
|
|
695
|
+
};
|
|
609
696
|
})());
|
|
610
|
-
return _el$
|
|
697
|
+
return _el$30;
|
|
611
698
|
})()
|
|
612
699
|
}));
|
|
613
|
-
return _el$
|
|
700
|
+
return _el$29;
|
|
614
701
|
})()
|
|
615
702
|
}));
|
|
616
|
-
return _el$
|
|
703
|
+
return _el$28;
|
|
617
704
|
})() : null;
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
705
|
+
};
|
|
706
|
+
})(), null);
|
|
707
|
+
insert(_el$14, (() => {
|
|
708
|
+
var _c$6 = memo(() => {
|
|
709
|
+
return !!props.paginated;
|
|
710
|
+
});
|
|
711
|
+
return () => {
|
|
712
|
+
return _c$6() ? (() => {
|
|
713
|
+
var _el$31 = _tmpl$15();
|
|
714
|
+
var _el$32 = _el$31.firstChild;
|
|
715
|
+
var _el$33 = _el$32.nextSibling;
|
|
716
|
+
var _el$34 = _el$33.firstChild;
|
|
717
|
+
var _el$35 = _el$34.nextSibling;
|
|
718
|
+
insert(_el$32, () => {
|
|
719
|
+
return `${table.getRowCount()} rows`;
|
|
720
|
+
});
|
|
721
|
+
insert(_el$33, createComponent(Select$1.Root, {
|
|
625
722
|
get collection() {
|
|
626
723
|
return createListCollection({ items: (props.pageSizeOptions ?? [
|
|
627
724
|
10,
|
|
@@ -672,8 +769,8 @@ function DataTable(props) {
|
|
|
672
769
|
} });
|
|
673
770
|
} })];
|
|
674
771
|
}
|
|
675
|
-
}),
|
|
676
|
-
insert(_el$
|
|
772
|
+
}), _el$34);
|
|
773
|
+
insert(_el$33, createComponent(Pagination.Root, {
|
|
677
774
|
get count() {
|
|
678
775
|
return table.getRowCount();
|
|
679
776
|
},
|
|
@@ -710,30 +807,30 @@ function DataTable(props) {
|
|
|
710
807
|
} })
|
|
711
808
|
];
|
|
712
809
|
}
|
|
713
|
-
}),
|
|
714
|
-
return _el$
|
|
810
|
+
}), _el$35);
|
|
811
|
+
return _el$31;
|
|
715
812
|
})() : null;
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
|
|
813
|
+
};
|
|
814
|
+
})(), _el$21);
|
|
815
|
+
effect(() => {
|
|
816
|
+
return {
|
|
817
|
+
e: props.reorderable || void 0,
|
|
818
|
+
t: `calc(${baseRowHeight()}px * var(--bs-density-scale, 1))`,
|
|
819
|
+
a: colsTemplate(),
|
|
820
|
+
o: mergeMode() || void 0,
|
|
821
|
+
i: readShallow(virtual() ? {
|
|
719
822
|
position: "relative",
|
|
720
823
|
"block-size": `${virtualizer.getTotalSize()}px`
|
|
721
|
-
} : void 0
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
a: void 0,
|
|
732
|
-
o: void 0,
|
|
733
|
-
i: void 0
|
|
734
|
-
});
|
|
735
|
-
return _el$10;
|
|
736
|
-
})();
|
|
824
|
+
} : void 0)
|
|
825
|
+
};
|
|
826
|
+
}, ({ e, t, a, o, i }, _p$) => {
|
|
827
|
+
e !== _p$?.e && setAttribute(_el$14, "data-reorderable", e);
|
|
828
|
+
t !== _p$?.t && setStyleProperty(_el$14, "--bs-table-row-height", t);
|
|
829
|
+
a !== _p$?.a && setStyleProperty(_el$16, "--bs-table-cols", a);
|
|
830
|
+
o !== _p$?.o && setAttribute(_el$18, "data-merge", o);
|
|
831
|
+
style(_el$18, i, _p$?.i);
|
|
832
|
+
});
|
|
833
|
+
return _el$14;
|
|
737
834
|
}
|
|
738
835
|
delegateEvents(["click", "input"]);
|
|
739
836
|
//#endregion
|
|
@@ -9,6 +9,8 @@ import { Tabs as Tabs$1, TabsRootProps } from "@ark-ui/solid/tabs";
|
|
|
9
9
|
type TabsOwnProps = {
|
|
10
10
|
/** One rung of the control-height ladder for the tab rows. */
|
|
11
11
|
size?: "sm" | "md" | "lg";
|
|
12
|
+
/** The register: a ruled line (default), or each tab its own card. */
|
|
13
|
+
variant?: "line" | "card";
|
|
12
14
|
};
|
|
13
15
|
declare function TabsRoot(props: TabsRootProps & TabsOwnProps): import("solid-js").JSX.Element;
|
|
14
16
|
export declare const Tabs: Omit<typeof Tabs$1, "Root"> & {
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { createComponent, mergeProps } from "
|
|
2
|
+
import { createComponent, mergeProps } from "@solidjs/web";
|
|
3
3
|
import { splitProps } from "solid-js";
|
|
4
4
|
import { Tabs as Tabs$1 } from "@ark-ui/solid/tabs";
|
|
5
5
|
//#region src/components/tabs/index.tsx
|
|
6
6
|
function TabsRoot(props) {
|
|
7
|
-
const [own, rest] = splitProps(props, ["size"]);
|
|
8
|
-
return createComponent(Tabs$1.Root, mergeProps(rest, {
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const [own, rest] = splitProps(props, ["size", "variant"]);
|
|
8
|
+
return createComponent(Tabs$1.Root, mergeProps(rest, {
|
|
9
|
+
get "data-size"() {
|
|
10
|
+
return own.size ?? "md";
|
|
11
|
+
},
|
|
12
|
+
get "data-variant"() {
|
|
13
|
+
return own.variant ?? "line";
|
|
14
|
+
}
|
|
15
|
+
}));
|
|
11
16
|
}
|
|
12
17
|
const Tabs = {
|
|
13
18
|
...Tabs$1,
|