@skeletonlabs/skeleton 2.4.0-dev.85b69544 → 2.4.0-dev.a85483d9
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.
|
@@ -11,7 +11,7 @@ export let spacing = getContext("spacing");
|
|
|
11
11
|
export let width = getContext("width");
|
|
12
12
|
export let aspectRatio = getContext("aspectRatio");
|
|
13
13
|
const cBase = "cursor-pointer";
|
|
14
|
-
const cWrapper = "flex flex-col justify-center items-stretch";
|
|
14
|
+
const cWrapper = "flex flex-col justify-center items-stretch w-full";
|
|
15
15
|
const cInterface = "text-center";
|
|
16
16
|
const cLabel = "font-bold text-xs";
|
|
17
17
|
let elemInput;
|
|
@@ -27,6 +27,12 @@ $:
|
|
|
27
27
|
classesLead = `${regionLead}`;
|
|
28
28
|
$:
|
|
29
29
|
classesLabel = `${cLabel} ${regionLabel}`;
|
|
30
|
+
function onKeyDown(event) {
|
|
31
|
+
if (["Enter", "Space"].includes(event.code)) {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
elemInput.click();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
30
36
|
function prunedRestProps() {
|
|
31
37
|
delete $$restProps.class;
|
|
32
38
|
return $$restProps;
|
|
@@ -35,9 +41,7 @@ function prunedRestProps() {
|
|
|
35
41
|
|
|
36
42
|
<label class="app-rail-tile {classesBase}" data-testid="app-rail-tile" {title} on:mouseover on:mouseleave on:focus on:blur>
|
|
37
43
|
<!-- A11y attributes are not allowed on <label> -->
|
|
38
|
-
|
|
39
|
-
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
40
|
-
<div class="app-rail-wrapper {classesWrapper}" on:keydown on:keyup on:keypress>
|
|
44
|
+
<button class="app-rail-wrapper {classesWrapper}" tabindex="0" on:keydown={onKeyDown} on:keyup on:keypress>
|
|
41
45
|
<!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
|
|
42
46
|
<div class="h-0 w-0 overflow-hidden">
|
|
43
47
|
<input bind:this={elemInput} type="radio" bind:group {name} {value} {...prunedRestProps()} tabindex="-1" on:click on:change />
|
|
@@ -47,5 +51,5 @@ function prunedRestProps() {
|
|
|
47
51
|
{#if $$slots.lead}<div class="app-rail-lead {classesLead}"><slot name="lead" /></div>{/if}
|
|
48
52
|
<div class="app-rail-label {classesLabel}"><slot /></div>
|
|
49
53
|
</div>
|
|
50
|
-
</
|
|
54
|
+
</button>
|
|
51
55
|
</label>
|
|
@@ -36,7 +36,7 @@ $:
|
|
|
36
36
|
<table
|
|
37
37
|
class="{classesTable}"
|
|
38
38
|
class:table-interactive={interactive}
|
|
39
|
-
role="grid"
|
|
39
|
+
role={interactive ? "grid" : "table"}
|
|
40
40
|
use:tableA11y
|
|
41
41
|
>
|
|
42
42
|
<!-- on:keydown={(e) => onTableKeydown(elemTable, e)} -->
|
|
@@ -44,7 +44,7 @@ $:
|
|
|
44
44
|
<thead class="table-head {regionHead}">
|
|
45
45
|
<tr>
|
|
46
46
|
{#each source.head as heading }
|
|
47
|
-
<th class="{regionHeadCell}">{@html heading}</th>
|
|
47
|
+
<th class="{regionHeadCell}" role="columnheader">{@html heading}</th>
|
|
48
48
|
{/each}
|
|
49
49
|
</tr>
|
|
50
50
|
</thead>
|
|
@@ -63,9 +63,9 @@ $:
|
|
|
63
63
|
<!-- prettier-ignore -->
|
|
64
64
|
<td
|
|
65
65
|
class="{regionCell}"
|
|
66
|
-
role="gridcell"
|
|
66
|
+
role={interactive ? "gridcell" : "cell"}
|
|
67
67
|
aria-colindex={cellIndex + 1}
|
|
68
|
-
tabindex={cellIndex === 0 ? 0 : -1}
|
|
68
|
+
tabindex={cellIndex === 0 && interactive ? 0 : -1}
|
|
69
69
|
>
|
|
70
70
|
{@html Number(cell) === 0 ? cell : (cell ? cell : '-')}
|
|
71
71
|
</td>
|