@lostgradient/cinder 0.16.0 → 0.16.1
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/CHANGELOG.md +6 -0
- package/components.json +1 -1
- package/dist/components/data-table/index.js +88 -31
- package/dist/components/table/index.js +85 -28
- package/dist/components/table/table.css +11 -0
- package/dist/components/table/table.schema.js +10 -1
- package/dist/components/table/table.types.d.ts +24 -1
- package/dist/index.js +272 -215
- package/dist/server/components/data-table/index.js +2 -2
- package/dist/server/components/table/index.js +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/{index.server-mehav5vs.js → index.server-gwgm8gqg.js} +1 -1
- package/dist/server/{index.server-ne4gzxvz.js → index.server-wasj5rbh.js} +1 -1
- package/dist/server/index.server-xanq9ppe.js +119 -0
- package/package.json +1 -1
- package/src/components/table/table.css +11 -0
- package/src/components/table/table.examples.json +3 -3
- package/src/components/table/table.schema.json +9 -0
- package/src/components/table/table.schema.ts +11 -0
- package/src/components/table/table.svelte +58 -14
- package/src/components/table/table.types.ts +27 -1
- package/dist/server/index.server-mzj20rfz.js +0 -77
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @lostgradient/cinder
|
|
2
2
|
|
|
3
|
+
## 0.16.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#766](https://github.com/stevekinney/cinder/pull/766) [`01cfe20`](https://github.com/stevekinney/cinder/commit/01cfe20711569effdd5643c3b985603a1536f7df) Thanks [@stevekinney](https://github.com/stevekinney)! - Add a first-class scrollable wrapper option to the compositional Table API.
|
|
8
|
+
|
|
3
9
|
## 0.16.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/components.json
CHANGED
|
@@ -684,14 +684,70 @@ var rest_excludes5 = new Set([
|
|
|
684
684
|
"stickyHeader",
|
|
685
685
|
"density",
|
|
686
686
|
"selectable",
|
|
687
|
+
"scrollable",
|
|
688
|
+
"scrollContainerProps",
|
|
687
689
|
"class",
|
|
688
690
|
"children"
|
|
689
691
|
]);
|
|
690
692
|
var root6 = $8.from_html(`<caption class="cinder-table__caption"> </caption>`);
|
|
691
693
|
var root_14 = $8.from_html(`<table><!><!></table>`);
|
|
694
|
+
var root_23 = $8.from_html(`<div><!></div>`);
|
|
692
695
|
function Table($$anchor, $$props) {
|
|
693
696
|
$8.push($$props, true);
|
|
694
|
-
|
|
697
|
+
const table = ($$anchor2) => {
|
|
698
|
+
var table_1 = root_14();
|
|
699
|
+
$8.attribute_effect(table_1, ($0) => ({
|
|
700
|
+
...rest,
|
|
701
|
+
class: $0,
|
|
702
|
+
"data-cinder-sticky-header": stickyHeader() || undefined,
|
|
703
|
+
"data-cinder-density": density(),
|
|
704
|
+
"data-cinder-selectable": selectable() || undefined,
|
|
705
|
+
[$8.STYLE]: {
|
|
706
|
+
"--cinder-table-caption-height": $8.get(normalizedCaption) ? `${$8.get(captionHeight)}px` : undefined
|
|
707
|
+
}
|
|
708
|
+
}), [() => classNames("cinder-table", $$props.class)]);
|
|
709
|
+
var node = $8.child(table_1);
|
|
710
|
+
{
|
|
711
|
+
var consequent = ($$anchor3) => {
|
|
712
|
+
var caption_1 = root6();
|
|
713
|
+
var text = $8.child(caption_1, true);
|
|
714
|
+
$8.reset(caption_1);
|
|
715
|
+
$8.attach(caption_1, () => measureCaption);
|
|
716
|
+
$8.template_effect(() => $8.set_text(text, $8.get(normalizedCaption)));
|
|
717
|
+
$8.append($$anchor3, caption_1);
|
|
718
|
+
};
|
|
719
|
+
$8.if(node, ($$render) => {
|
|
720
|
+
if ($8.get(normalizedCaption))
|
|
721
|
+
$$render(consequent);
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
var node_1 = $8.sibling(node);
|
|
725
|
+
$8.snippet(node_1, () => $$props.children);
|
|
726
|
+
$8.reset(table_1);
|
|
727
|
+
$8.append($$anchor2, table_1);
|
|
728
|
+
};
|
|
729
|
+
let sort = $8.prop($$props, "sort", 15), stickyHeader = $8.prop($$props, "stickyHeader", 3, false), density = $8.prop($$props, "density", 3, "comfortable"), selectable = $8.prop($$props, "selectable", 3, false), scrollable = $8.prop($$props, "scrollable", 3, false), rest = $8.rest_props($$props, rest_excludes5);
|
|
730
|
+
const wrapperClassName = $8.derived(() => $$props.scrollContainerProps?.class);
|
|
731
|
+
const wrapperAriaLabelledBy = $8.derived(() => normalizeOptionalAttribute($$props.scrollContainerProps?.["aria-labelledby"]));
|
|
732
|
+
const explicitWrapperAriaLabel = $8.derived(() => normalizeOptionalAttribute($$props.scrollContainerProps?.["aria-label"]));
|
|
733
|
+
const explicitWrapperRole = $8.derived(() => normalizeOptionalAttribute($$props.scrollContainerProps?.role));
|
|
734
|
+
const normalizedCaption = $8.derived(() => normalizeOptionalAttribute($$props.caption));
|
|
735
|
+
const wrapperAriaLabel = $8.derived(() => $8.get(explicitWrapperAriaLabel) ?? ($8.get(wrapperAriaLabelledBy) ? undefined : $8.get(normalizedCaption) ? `${$8.get(normalizedCaption)} table scroll area` : undefined));
|
|
736
|
+
const wrapperRole = $8.derived(() => $8.get(explicitWrapperRole) ?? ($8.get(wrapperAriaLabel) || $8.get(wrapperAriaLabelledBy) ? "region" : undefined));
|
|
737
|
+
const wrapperTabindex = $8.derived(() => normalizeOptionalTabindex($$props.scrollContainerProps?.tabindex) ?? 0);
|
|
738
|
+
function normalizeOptionalAttribute(value) {
|
|
739
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
|
|
740
|
+
}
|
|
741
|
+
function normalizeOptionalTabindex(value) {
|
|
742
|
+
if (typeof value === "number" && Number.isInteger(value))
|
|
743
|
+
return value;
|
|
744
|
+
if (typeof value !== "string")
|
|
745
|
+
return;
|
|
746
|
+
const normalizedValue = value.trim();
|
|
747
|
+
if (!/^-?\d+$/.test(normalizedValue))
|
|
748
|
+
return;
|
|
749
|
+
return Number(normalizedValue);
|
|
750
|
+
}
|
|
695
751
|
let captionHeight = $8.state(0);
|
|
696
752
|
const measureCaption = useResizeObserver((entries) => {
|
|
697
753
|
const entry = entries[0];
|
|
@@ -718,36 +774,37 @@ function Table($$anchor, $$props) {
|
|
|
718
774
|
},
|
|
719
775
|
onsortchange
|
|
720
776
|
});
|
|
721
|
-
var
|
|
722
|
-
$8.
|
|
723
|
-
...rest,
|
|
724
|
-
class: $0,
|
|
725
|
-
"data-cinder-sticky-header": stickyHeader() || undefined,
|
|
726
|
-
"data-cinder-density": density(),
|
|
727
|
-
"data-cinder-selectable": selectable() || undefined,
|
|
728
|
-
[$8.STYLE]: {
|
|
729
|
-
"--cinder-table-caption-height": $$props.caption ? `${$8.get(captionHeight)}px` : undefined
|
|
730
|
-
}
|
|
731
|
-
}), [() => classNames("cinder-table", $$props.class)]);
|
|
732
|
-
var node = $8.child(table);
|
|
777
|
+
var fragment = $8.comment();
|
|
778
|
+
var node_2 = $8.first_child(fragment);
|
|
733
779
|
{
|
|
734
|
-
var
|
|
735
|
-
var
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
780
|
+
var consequent_1 = ($$anchor2) => {
|
|
781
|
+
var div = root_23();
|
|
782
|
+
$8.attribute_effect(div, ($0) => ({
|
|
783
|
+
...$$props.scrollContainerProps,
|
|
784
|
+
class: $0,
|
|
785
|
+
role: $8.get(wrapperRole),
|
|
786
|
+
"aria-label": $8.get(wrapperAriaLabel),
|
|
787
|
+
"aria-labelledby": $8.get(wrapperAriaLabelledBy),
|
|
788
|
+
tabindex: $8.get(wrapperTabindex)
|
|
789
|
+
}), [
|
|
790
|
+
() => classNames("cinder-table-scroll", $8.get(wrapperClassName))
|
|
791
|
+
]);
|
|
792
|
+
var node_3 = $8.child(div);
|
|
793
|
+
table(node_3);
|
|
794
|
+
$8.reset(div);
|
|
795
|
+
$8.append($$anchor2, div);
|
|
741
796
|
};
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
797
|
+
var alternate = ($$anchor2) => {
|
|
798
|
+
table($$anchor2);
|
|
799
|
+
};
|
|
800
|
+
$8.if(node_2, ($$render) => {
|
|
801
|
+
if (scrollable())
|
|
802
|
+
$$render(consequent_1);
|
|
803
|
+
else
|
|
804
|
+
$$render(alternate, -1);
|
|
745
805
|
});
|
|
746
806
|
}
|
|
747
|
-
|
|
748
|
-
$8.snippet(node_1, () => $$props.children);
|
|
749
|
-
$8.reset(table);
|
|
750
|
-
$8.append($$anchor, table);
|
|
807
|
+
$8.append($$anchor, fragment);
|
|
751
808
|
$8.pop();
|
|
752
809
|
}
|
|
753
810
|
|
|
@@ -850,7 +907,7 @@ var rest_excludes6 = new Set([
|
|
|
850
907
|
]);
|
|
851
908
|
var root7 = $9.from_html(`<th scope="col" class="cinder-table__header-cell cinder-table__header-cell--selection"><!></th>`);
|
|
852
909
|
var root_15 = $9.from_html(`<!> <!>`, 1);
|
|
853
|
-
var
|
|
910
|
+
var root_24 = $9.from_html(`<tr class="cinder-data-table__virtual-spacer" aria-hidden="true"><td class="cinder-data-table__virtual-spacer-cell"></td></tr>`);
|
|
854
911
|
var root_33 = $9.from_html(`<td class="cinder-table__cell cinder-table__cell--selection"><!></td>`);
|
|
855
912
|
var root_42 = $9.from_html(`<!> <!> <!>`, 1);
|
|
856
913
|
var root_5 = $9.from_html(`<div><!></div>`);
|
|
@@ -955,7 +1012,7 @@ function Data_table($$anchor, $$props) {
|
|
|
955
1012
|
var node_5 = $9.first_child(fragment_7);
|
|
956
1013
|
{
|
|
957
1014
|
var consequent_2 = ($$anchor5) => {
|
|
958
|
-
var tr =
|
|
1015
|
+
var tr = root_24();
|
|
959
1016
|
var td = $9.child(tr);
|
|
960
1017
|
let styles;
|
|
961
1018
|
$9.reset(tr);
|
|
@@ -1048,7 +1105,7 @@ function Data_table($$anchor, $$props) {
|
|
|
1048
1105
|
var node_10 = $9.sibling(node_6, 2);
|
|
1049
1106
|
{
|
|
1050
1107
|
var consequent_4 = ($$anchor5) => {
|
|
1051
|
-
var tr_1 =
|
|
1108
|
+
var tr_1 = root_24();
|
|
1052
1109
|
var td_2 = $9.child(tr_1);
|
|
1053
1110
|
let styles_1;
|
|
1054
1111
|
$9.reset(tr_1);
|
|
@@ -1378,4 +1435,4 @@ export {
|
|
|
1378
1435
|
Data_table as DataTable
|
|
1379
1436
|
};
|
|
1380
1437
|
|
|
1381
|
-
//# debugId=
|
|
1438
|
+
//# debugId=BCCAA92C441D11D164756E2164756E21
|
|
@@ -446,14 +446,70 @@ var rest_excludes4 = new Set([
|
|
|
446
446
|
"stickyHeader",
|
|
447
447
|
"density",
|
|
448
448
|
"selectable",
|
|
449
|
+
"scrollable",
|
|
450
|
+
"scrollContainerProps",
|
|
449
451
|
"class",
|
|
450
452
|
"children"
|
|
451
453
|
]);
|
|
452
454
|
var root5 = $7.from_html(`<caption class="cinder-table__caption"> </caption>`);
|
|
453
455
|
var root_13 = $7.from_html(`<table><!><!></table>`);
|
|
456
|
+
var root_22 = $7.from_html(`<div><!></div>`);
|
|
454
457
|
function Table($$anchor, $$props) {
|
|
455
458
|
$7.push($$props, true);
|
|
456
|
-
|
|
459
|
+
const table = ($$anchor2) => {
|
|
460
|
+
var table_1 = root_13();
|
|
461
|
+
$7.attribute_effect(table_1, ($0) => ({
|
|
462
|
+
...rest,
|
|
463
|
+
class: $0,
|
|
464
|
+
"data-cinder-sticky-header": stickyHeader() || undefined,
|
|
465
|
+
"data-cinder-density": density(),
|
|
466
|
+
"data-cinder-selectable": selectable() || undefined,
|
|
467
|
+
[$7.STYLE]: {
|
|
468
|
+
"--cinder-table-caption-height": $7.get(normalizedCaption) ? `${$7.get(captionHeight)}px` : undefined
|
|
469
|
+
}
|
|
470
|
+
}), [() => classNames("cinder-table", $$props.class)]);
|
|
471
|
+
var node = $7.child(table_1);
|
|
472
|
+
{
|
|
473
|
+
var consequent = ($$anchor3) => {
|
|
474
|
+
var caption_1 = root5();
|
|
475
|
+
var text = $7.child(caption_1, true);
|
|
476
|
+
$7.reset(caption_1);
|
|
477
|
+
$7.attach(caption_1, () => measureCaption);
|
|
478
|
+
$7.template_effect(() => $7.set_text(text, $7.get(normalizedCaption)));
|
|
479
|
+
$7.append($$anchor3, caption_1);
|
|
480
|
+
};
|
|
481
|
+
$7.if(node, ($$render) => {
|
|
482
|
+
if ($7.get(normalizedCaption))
|
|
483
|
+
$$render(consequent);
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
var node_1 = $7.sibling(node);
|
|
487
|
+
$7.snippet(node_1, () => $$props.children);
|
|
488
|
+
$7.reset(table_1);
|
|
489
|
+
$7.append($$anchor2, table_1);
|
|
490
|
+
};
|
|
491
|
+
let sort = $7.prop($$props, "sort", 15), stickyHeader = $7.prop($$props, "stickyHeader", 3, false), density = $7.prop($$props, "density", 3, "comfortable"), selectable = $7.prop($$props, "selectable", 3, false), scrollable = $7.prop($$props, "scrollable", 3, false), rest = $7.rest_props($$props, rest_excludes4);
|
|
492
|
+
const wrapperClassName = $7.derived(() => $$props.scrollContainerProps?.class);
|
|
493
|
+
const wrapperAriaLabelledBy = $7.derived(() => normalizeOptionalAttribute($$props.scrollContainerProps?.["aria-labelledby"]));
|
|
494
|
+
const explicitWrapperAriaLabel = $7.derived(() => normalizeOptionalAttribute($$props.scrollContainerProps?.["aria-label"]));
|
|
495
|
+
const explicitWrapperRole = $7.derived(() => normalizeOptionalAttribute($$props.scrollContainerProps?.role));
|
|
496
|
+
const normalizedCaption = $7.derived(() => normalizeOptionalAttribute($$props.caption));
|
|
497
|
+
const wrapperAriaLabel = $7.derived(() => $7.get(explicitWrapperAriaLabel) ?? ($7.get(wrapperAriaLabelledBy) ? undefined : $7.get(normalizedCaption) ? `${$7.get(normalizedCaption)} table scroll area` : undefined));
|
|
498
|
+
const wrapperRole = $7.derived(() => $7.get(explicitWrapperRole) ?? ($7.get(wrapperAriaLabel) || $7.get(wrapperAriaLabelledBy) ? "region" : undefined));
|
|
499
|
+
const wrapperTabindex = $7.derived(() => normalizeOptionalTabindex($$props.scrollContainerProps?.tabindex) ?? 0);
|
|
500
|
+
function normalizeOptionalAttribute(value) {
|
|
501
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
|
|
502
|
+
}
|
|
503
|
+
function normalizeOptionalTabindex(value) {
|
|
504
|
+
if (typeof value === "number" && Number.isInteger(value))
|
|
505
|
+
return value;
|
|
506
|
+
if (typeof value !== "string")
|
|
507
|
+
return;
|
|
508
|
+
const normalizedValue = value.trim();
|
|
509
|
+
if (!/^-?\d+$/.test(normalizedValue))
|
|
510
|
+
return;
|
|
511
|
+
return Number(normalizedValue);
|
|
512
|
+
}
|
|
457
513
|
let captionHeight = $7.state(0);
|
|
458
514
|
const measureCaption = useResizeObserver((entries) => {
|
|
459
515
|
const entry = entries[0];
|
|
@@ -480,36 +536,37 @@ function Table($$anchor, $$props) {
|
|
|
480
536
|
},
|
|
481
537
|
onsortchange
|
|
482
538
|
});
|
|
483
|
-
var
|
|
484
|
-
$7.
|
|
485
|
-
...rest,
|
|
486
|
-
class: $0,
|
|
487
|
-
"data-cinder-sticky-header": stickyHeader() || undefined,
|
|
488
|
-
"data-cinder-density": density(),
|
|
489
|
-
"data-cinder-selectable": selectable() || undefined,
|
|
490
|
-
[$7.STYLE]: {
|
|
491
|
-
"--cinder-table-caption-height": $$props.caption ? `${$7.get(captionHeight)}px` : undefined
|
|
492
|
-
}
|
|
493
|
-
}), [() => classNames("cinder-table", $$props.class)]);
|
|
494
|
-
var node = $7.child(table);
|
|
539
|
+
var fragment = $7.comment();
|
|
540
|
+
var node_2 = $7.first_child(fragment);
|
|
495
541
|
{
|
|
496
|
-
var
|
|
497
|
-
var
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
542
|
+
var consequent_1 = ($$anchor2) => {
|
|
543
|
+
var div = root_22();
|
|
544
|
+
$7.attribute_effect(div, ($0) => ({
|
|
545
|
+
...$$props.scrollContainerProps,
|
|
546
|
+
class: $0,
|
|
547
|
+
role: $7.get(wrapperRole),
|
|
548
|
+
"aria-label": $7.get(wrapperAriaLabel),
|
|
549
|
+
"aria-labelledby": $7.get(wrapperAriaLabelledBy),
|
|
550
|
+
tabindex: $7.get(wrapperTabindex)
|
|
551
|
+
}), [
|
|
552
|
+
() => classNames("cinder-table-scroll", $7.get(wrapperClassName))
|
|
553
|
+
]);
|
|
554
|
+
var node_3 = $7.child(div);
|
|
555
|
+
table(node_3);
|
|
556
|
+
$7.reset(div);
|
|
557
|
+
$7.append($$anchor2, div);
|
|
503
558
|
};
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
559
|
+
var alternate = ($$anchor2) => {
|
|
560
|
+
table($$anchor2);
|
|
561
|
+
};
|
|
562
|
+
$7.if(node_2, ($$render) => {
|
|
563
|
+
if (scrollable())
|
|
564
|
+
$$render(consequent_1);
|
|
565
|
+
else
|
|
566
|
+
$$render(alternate, -1);
|
|
507
567
|
});
|
|
508
568
|
}
|
|
509
|
-
|
|
510
|
-
$7.snippet(node_1, () => $$props.children);
|
|
511
|
-
$7.reset(table);
|
|
512
|
-
$7.append($$anchor, table);
|
|
569
|
+
$7.append($$anchor, fragment);
|
|
513
570
|
$7.pop();
|
|
514
571
|
}
|
|
515
572
|
|
|
@@ -527,4 +584,4 @@ export {
|
|
|
527
584
|
Table2 as Table
|
|
528
585
|
};
|
|
529
586
|
|
|
530
|
-
//# debugId=
|
|
587
|
+
//# debugId=5ED75768E933CF7864756E2164756E21
|
|
@@ -36,6 +36,11 @@
|
|
|
36
36
|
min-inline-size: max-content;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
.cinder-table-scroll:focus-visible {
|
|
40
|
+
outline: var(--cinder-ring-width) solid transparent;
|
|
41
|
+
box-shadow: var(--_cinder-focus-ring-shadow);
|
|
42
|
+
}
|
|
43
|
+
|
|
39
44
|
.cinder-table__caption {
|
|
40
45
|
caption-side: top;
|
|
41
46
|
text-align: left;
|
|
@@ -163,6 +168,12 @@
|
|
|
163
168
|
}
|
|
164
169
|
|
|
165
170
|
@media (forced-colors: active) {
|
|
171
|
+
.cinder-table-scroll:focus-visible {
|
|
172
|
+
outline: var(--cinder-ring-width) solid ButtonText;
|
|
173
|
+
outline-offset: 3px;
|
|
174
|
+
box-shadow: none;
|
|
175
|
+
}
|
|
176
|
+
|
|
166
177
|
.cinder-table__sort-button:focus-visible {
|
|
167
178
|
outline: var(--cinder-ring-width) solid ButtonText;
|
|
168
179
|
/* 2px is correct here: sort-button has border:none so there is no
|
|
@@ -72,6 +72,10 @@ var schema = {
|
|
|
72
72
|
type: "boolean",
|
|
73
73
|
description: "Enables the leading selection column on the entire table. When true:\n- The single `TableRow` inside `TableHeader` renders a leading `<th>`\n with a select-all checkbox sourced from the header's props.\n- Every `TableRow` inside `TableBody` renders a leading selection cell.\nSelection is strictly controlled — the consumer owns all selection state."
|
|
74
74
|
},
|
|
75
|
+
scrollable: {
|
|
76
|
+
type: "boolean",
|
|
77
|
+
description: "When true, wraps the table in a `.cinder-table-scroll` container that\nenables horizontal overflow scrolling for dense or unknown-width tables.\nUse this instead of manually wrapping Table in `.cinder-table-scroll`.\n\nWhen combined with `stickyHeader`, the generated wrapper is the sticky\nheader's scroll container. Set a bounded block size on `scrollContainerProps`\nwhen the table should scroll vertically inside that wrapper."
|
|
78
|
+
},
|
|
75
79
|
class: {
|
|
76
80
|
type: "string",
|
|
77
81
|
description: "Additional class names merged with `.cinder-table`."
|
|
@@ -86,6 +90,11 @@ var schema = {
|
|
|
86
90
|
required: true,
|
|
87
91
|
description: "TableHeader, TableBody, etc."
|
|
88
92
|
},
|
|
93
|
+
{
|
|
94
|
+
name: "scrollContainerProps",
|
|
95
|
+
reason: "unknown-shape",
|
|
96
|
+
description: "Attributes forwarded to the generated `.cinder-table-scroll` wrapper when\n`scrollable` is true. The wrapper is focusable by default so keyboard users\ncan scroll read-only wide tables. When the table has a caption, or when\n`aria-label` or `aria-labelledby` is provided here, the wrapper becomes a\nnamed `region`; pass `role` or `tabindex` here to override those defaults."
|
|
97
|
+
},
|
|
89
98
|
{
|
|
90
99
|
name: "sort",
|
|
91
100
|
reason: "unknown-shape",
|
|
@@ -99,4 +108,4 @@ export {
|
|
|
99
108
|
table_schema_default as default
|
|
100
109
|
};
|
|
101
110
|
|
|
102
|
-
//# debugId=
|
|
111
|
+
//# debugId=F081B153ACEAE13964756E2164756E21
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { HTMLTableAttributes } from 'svelte/elements';
|
|
2
|
+
import type { HTMLAttributes, HTMLTableAttributes } from 'svelte/elements';
|
|
3
3
|
/** Sort direction. */
|
|
4
4
|
export type SortDirection = 'ascending' | 'descending';
|
|
5
5
|
/** Bound sort state shape. */
|
|
@@ -40,6 +40,11 @@ export type TableContext = {
|
|
|
40
40
|
/** Mirror of Table.selectable. Set synchronously at construction time. */
|
|
41
41
|
readonly selectionEnabled?: boolean;
|
|
42
42
|
};
|
|
43
|
+
/** Attributes forwarded to Table's generated scroll wrapper. */
|
|
44
|
+
export type TableScrollContainerProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class'> & {
|
|
45
|
+
/** Additional class names merged with `.cinder-table-scroll`. */
|
|
46
|
+
class?: string;
|
|
47
|
+
};
|
|
43
48
|
/**
|
|
44
49
|
* Props for the Table component.
|
|
45
50
|
*
|
|
@@ -75,6 +80,24 @@ export type TableProps = Omit<HTMLTableAttributes, 'class'> & {
|
|
|
75
80
|
* Selection is strictly controlled — the consumer owns all selection state.
|
|
76
81
|
*/
|
|
77
82
|
selectable?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* When true, wraps the table in a `.cinder-table-scroll` container that
|
|
85
|
+
* enables horizontal overflow scrolling for dense or unknown-width tables.
|
|
86
|
+
* Use this instead of manually wrapping Table in `.cinder-table-scroll`.
|
|
87
|
+
*
|
|
88
|
+
* When combined with `stickyHeader`, the generated wrapper is the sticky
|
|
89
|
+
* header's scroll container. Set a bounded block size on `scrollContainerProps`
|
|
90
|
+
* when the table should scroll vertically inside that wrapper.
|
|
91
|
+
*/
|
|
92
|
+
scrollable?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Attributes forwarded to the generated `.cinder-table-scroll` wrapper when
|
|
95
|
+
* `scrollable` is true. The wrapper is focusable by default so keyboard users
|
|
96
|
+
* can scroll read-only wide tables. When the table has a caption, or when
|
|
97
|
+
* `aria-label` or `aria-labelledby` is provided here, the wrapper becomes a
|
|
98
|
+
* named `region`; pass `role` or `tabindex` here to override those defaults.
|
|
99
|
+
*/
|
|
100
|
+
scrollContainerProps?: TableScrollContainerProps;
|
|
78
101
|
/** Additional class names merged with `.cinder-table`. */
|
|
79
102
|
class?: string;
|
|
80
103
|
/** TableHeader, TableBody, etc. */
|