@skeletonlabs/skeleton 1.9.0-dev.1226d909 → 1.9.0-dev.4e13b4f1
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/components/AppRail/AppRail.svelte +14 -3
- package/dist/components/AppRail/AppRail.svelte.d.ts +5 -3
- package/dist/components/AppRail/AppRailAnchor.svelte +4 -3
- package/dist/components/AppRail/AppRailAnchor.svelte.d.ts +1 -0
- package/dist/components/AppRail/AppRailTile.svelte +5 -3
- package/dist/components/AppRail/AppRailTile.svelte.d.ts +2 -0
- package/dist/components/Autocomplete/Autocomplete.svelte +10 -15
- package/dist/components/Ratings/Ratings.svelte +25 -15
- package/package.json +1 -1
|
@@ -10,21 +10,32 @@ export let regionTrail = "";
|
|
|
10
10
|
export let hover = "bg-primary-hover-token";
|
|
11
11
|
export let active = "bg-primary-active-token";
|
|
12
12
|
export let spacing = "space-y-1";
|
|
13
|
+
export let aspectRatio = "aspect-square";
|
|
13
14
|
setContext("active", active);
|
|
14
15
|
setContext("hover", hover);
|
|
15
16
|
setContext("spacing", spacing);
|
|
17
|
+
setContext("aspectRatio", aspectRatio);
|
|
16
18
|
const cBase = "grid grid-rows-[auto_1fr_auto] overflow-y-auto";
|
|
19
|
+
const cRegionLead = "box-border";
|
|
20
|
+
const cRegionDefault = "box-border";
|
|
21
|
+
const cRegionTrail = "box-border";
|
|
17
22
|
$:
|
|
18
23
|
classesBase = `${cBase} ${background} ${border} ${width} ${height} ${gap} ${$$props.class || ""}`;
|
|
24
|
+
$:
|
|
25
|
+
classesRegionLead = `${cRegionLead} ${regionLead}`;
|
|
26
|
+
$:
|
|
27
|
+
classesRegionDefault = `${cRegionDefault} ${regionDefault}`;
|
|
28
|
+
$:
|
|
29
|
+
classesRegionTrail = `${cRegionTrail} ${regionTrail}`;
|
|
19
30
|
</script>
|
|
20
31
|
|
|
21
32
|
<!-- @component A vertical navigation rail component. -->
|
|
22
33
|
|
|
23
34
|
<div class="app-rail {classesBase}" data-testid="app-rail">
|
|
24
35
|
<!-- Slot: lead -->
|
|
25
|
-
<div class="app-bar-lead {
|
|
36
|
+
<div class="app-bar-lead {classesRegionLead}"><slot name="lead" /></div>
|
|
26
37
|
<!-- Slot: Default -->
|
|
27
|
-
<div class="app-bar-default {
|
|
38
|
+
<div class="app-bar-default {classesRegionDefault}"><slot /></div>
|
|
28
39
|
<!-- Slot: lead -->
|
|
29
|
-
<div class="app-bar-trail {
|
|
40
|
+
<div class="app-bar-trail {classesRegionTrail}"><slot name="trail" /></div>
|
|
30
41
|
</div>
|
|
@@ -18,12 +18,14 @@ declare const __propDef: {
|
|
|
18
18
|
regionDefault?: string | undefined;
|
|
19
19
|
/** Rail: Provide arbitrary classes to the trail region.*/
|
|
20
20
|
regionTrail?: string | undefined;
|
|
21
|
-
/**
|
|
21
|
+
/** Provide classes to set the tile/anchor hover background color.*/
|
|
22
22
|
hover?: string | undefined;
|
|
23
|
-
/**
|
|
23
|
+
/** Provide classes to set the tile/anchor active tile background.*/
|
|
24
24
|
active?: string | undefined;
|
|
25
|
-
/**
|
|
25
|
+
/** Provide classes to set the tile/anchor vertical spacing.*/
|
|
26
26
|
spacing?: string | undefined;
|
|
27
|
+
/** Provide classes to set the tile/anchor aspect ratio.*/
|
|
28
|
+
aspectRatio?: string | undefined;
|
|
27
29
|
};
|
|
28
30
|
events: {
|
|
29
31
|
[evt: string]: CustomEvent<any>;
|
|
@@ -5,15 +5,16 @@ export let regionLabel = "";
|
|
|
5
5
|
export let hover = getContext("hover");
|
|
6
6
|
export let active = getContext("active");
|
|
7
7
|
export let spacing = getContext("spacing");
|
|
8
|
+
export let aspectRatio = getContext("aspectRatio");
|
|
8
9
|
const cBase = "unstyled";
|
|
9
|
-
const cWrapper = "w-full
|
|
10
|
+
const cWrapper = "w-full flex flex-col justify-center items-stretch text-center space-y-1";
|
|
10
11
|
const cLabel = "font-bold text-xs";
|
|
11
12
|
$:
|
|
12
13
|
classActive = selected ? active : "";
|
|
13
14
|
$:
|
|
14
|
-
classesBase = `${cBase}
|
|
15
|
+
classesBase = `${cBase} ${$$props.class || ""}`;
|
|
15
16
|
$:
|
|
16
|
-
classesWrapper = `${cWrapper} ${hover} ${spacing} ${classActive}`;
|
|
17
|
+
classesWrapper = `${cWrapper} ${aspectRatio} ${hover} ${spacing} ${classActive}`;
|
|
17
18
|
$:
|
|
18
19
|
classesLead = `${regionLead}`;
|
|
19
20
|
$:
|
|
@@ -8,17 +8,19 @@ export let regionLabel = "";
|
|
|
8
8
|
export let hover = getContext("hover");
|
|
9
9
|
export let active = getContext("active");
|
|
10
10
|
export let spacing = getContext("spacing");
|
|
11
|
+
export let width = getContext("width");
|
|
12
|
+
export let aspectRatio = getContext("aspectRatio");
|
|
11
13
|
const cBase = "cursor-pointer";
|
|
12
|
-
const cWrapper = "
|
|
14
|
+
const cWrapper = "flex flex-col justify-center items-stretch";
|
|
13
15
|
const cInterface = "text-center";
|
|
14
16
|
const cLabel = "font-bold text-xs";
|
|
15
17
|
let elemInput;
|
|
16
18
|
$:
|
|
17
19
|
classActive = group === value ? active : "";
|
|
18
20
|
$:
|
|
19
|
-
classesBase = `${cBase}
|
|
21
|
+
classesBase = `${cBase} ${$$props.class || ""}`;
|
|
20
22
|
$:
|
|
21
|
-
classesWrapper = `${cWrapper} ${hover} ${classActive}`;
|
|
23
|
+
classesWrapper = `${cWrapper} ${aspectRatio} ${width} ${hover} ${classActive}`;
|
|
22
24
|
$:
|
|
23
25
|
classesInterface = `${cInterface} ${spacing}`;
|
|
24
26
|
$:
|
|
@@ -17,20 +17,18 @@ export let duration = 200;
|
|
|
17
17
|
const deprecated = [whitelist, blacklist, duration];
|
|
18
18
|
$:
|
|
19
19
|
listedOptions = options;
|
|
20
|
-
function
|
|
20
|
+
function filterByAllowDeny() {
|
|
21
|
+
let _options = [...options];
|
|
21
22
|
if (allowlist.length) {
|
|
22
|
-
|
|
23
|
-
} else {
|
|
24
|
-
listedOptions = [...options];
|
|
23
|
+
_options = _options.filter((option) => allowlist.includes(option.value));
|
|
25
24
|
}
|
|
26
|
-
}
|
|
27
|
-
function filterByDenied() {
|
|
28
25
|
if (denylist.length) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
_options = _options.filter((option) => !denylist.includes(option.value));
|
|
27
|
+
}
|
|
28
|
+
if (!allowlist.length && !denylist.length) {
|
|
29
|
+
_options = options;
|
|
33
30
|
}
|
|
31
|
+
listedOptions = _options;
|
|
34
32
|
}
|
|
35
33
|
function filterOptions() {
|
|
36
34
|
let _options = [...listedOptions];
|
|
@@ -46,11 +44,8 @@ function onSelection(option) {
|
|
|
46
44
|
dispatch("selection", option);
|
|
47
45
|
}
|
|
48
46
|
$:
|
|
49
|
-
if (allowlist)
|
|
50
|
-
|
|
51
|
-
$:
|
|
52
|
-
if (denylist)
|
|
53
|
-
filterByDenied();
|
|
47
|
+
if (allowlist.length || denylist.length)
|
|
48
|
+
filterByAllowDeny();
|
|
54
49
|
$:
|
|
55
50
|
optionsFiltered = input ? filterOptions() : listedOptions;
|
|
56
51
|
$:
|
|
@@ -13,11 +13,13 @@ function iconClick(index) {
|
|
|
13
13
|
index: index + 1
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
+
function isFull(value2, index) {
|
|
17
|
+
return Math.floor(value2) >= index + 1;
|
|
18
|
+
}
|
|
19
|
+
function isHalf(value2, index) {
|
|
20
|
+
return value2 === index + 0.5;
|
|
21
|
+
}
|
|
16
22
|
const cBase = "w-full flex";
|
|
17
|
-
$:
|
|
18
|
-
elemInteractive = interactive ? "button" : "span";
|
|
19
|
-
$:
|
|
20
|
-
attrInteractive = interactive ? { type: "button" } : {};
|
|
21
23
|
$:
|
|
22
24
|
classesBase = `${cBase} ${text} ${fill} ${justify} ${spacing} ${$$props.class ?? ""}`;
|
|
23
25
|
</script>
|
|
@@ -25,18 +27,26 @@ $:
|
|
|
25
27
|
<div class="ratings {classesBase}" data-testid="rating-bar">
|
|
26
28
|
<!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
|
|
27
29
|
{#each Array(max) as _, i}
|
|
28
|
-
{#if
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
{#if interactive}
|
|
31
|
+
<button class="rating-icon {regionIcon}" type="button" on:click={() => iconClick(i)}>
|
|
32
|
+
{#if isFull(value, i)}
|
|
33
|
+
<slot name="full" />
|
|
34
|
+
{:else if isHalf(value, i)}
|
|
35
|
+
<slot name="half" />
|
|
36
|
+
{:else}
|
|
37
|
+
<slot name="empty" />
|
|
38
|
+
{/if}
|
|
39
|
+
</button>
|
|
36
40
|
{:else}
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
<span class="rating-icon {regionIcon}">
|
|
42
|
+
{#if isFull(value, i)}
|
|
43
|
+
<slot name="full" />
|
|
44
|
+
{:else if isHalf(value, i)}
|
|
45
|
+
<slot name="half" />
|
|
46
|
+
{:else}
|
|
47
|
+
<slot name="empty" />
|
|
48
|
+
{/if}
|
|
49
|
+
</span>
|
|
40
50
|
{/if}
|
|
41
51
|
{/each}
|
|
42
52
|
</div>
|