alus-ui 0.1.2 → 0.1.3
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/display/card/CardDescription.svelte +5 -2
- package/dist/components/display/card/CardTitle.svelte +5 -2
- package/dist/components/display/carousel/CarouselSlide.svelte +5 -2
- package/dist/components/display/timestamp/Timestamp.svelte +9 -5
- package/dist/components/navigation/command-menu/CommandMenuItem.svelte +9 -6
- package/dist/components/overlay/modal/ModalDescription.svelte +5 -2
- package/dist/components/overlay/modal/ModalTitle.svelte +5 -2
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { untrack } from 'svelte';
|
|
2
3
|
import { getCardContext } from './Card.svelte';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
@@ -11,8 +12,10 @@
|
|
|
11
12
|
const ctx = getCardContext();
|
|
12
13
|
|
|
13
14
|
$effect(() => {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
return untrack(() => {
|
|
16
|
+
ctx.setHasDescription(true);
|
|
17
|
+
return () => ctx.setHasDescription(false);
|
|
18
|
+
});
|
|
16
19
|
});
|
|
17
20
|
</script>
|
|
18
21
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { untrack } from 'svelte';
|
|
2
3
|
import { getCardContext } from './Card.svelte';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
@@ -12,8 +13,10 @@
|
|
|
12
13
|
const ctx = getCardContext();
|
|
13
14
|
|
|
14
15
|
$effect(() => {
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
return untrack(() => {
|
|
17
|
+
ctx.setHasTitle(true);
|
|
18
|
+
return () => ctx.setHasTitle(false);
|
|
19
|
+
});
|
|
17
20
|
});
|
|
18
21
|
</script>
|
|
19
22
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { untrack } from 'svelte';
|
|
2
3
|
import { getCarouselContext } from './Carousel.svelte';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
@@ -14,8 +15,10 @@
|
|
|
14
15
|
const active = $derived(ctx.index() === index);
|
|
15
16
|
|
|
16
17
|
$effect(() => {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
return untrack(() => {
|
|
19
|
+
const reg = ctx.registerSlide();
|
|
20
|
+
return reg.unregister;
|
|
21
|
+
});
|
|
19
22
|
});
|
|
20
23
|
</script>
|
|
21
24
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { untrack } from 'svelte';
|
|
3
|
+
|
|
2
4
|
type Mode = 'absolute' | 'relative' | 'both';
|
|
3
5
|
type Style = 'long' | 'short' | 'narrow';
|
|
4
6
|
|
|
@@ -30,11 +32,13 @@
|
|
|
30
32
|
const date = $derived(value instanceof Date ? value : new Date(value));
|
|
31
33
|
|
|
32
34
|
$effect(() => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
return untrack(() => {
|
|
36
|
+
if (mode === 'absolute') return;
|
|
37
|
+
const id = setInterval(() => {
|
|
38
|
+
now = Date.now();
|
|
39
|
+
}, updateInterval);
|
|
40
|
+
return () => clearInterval(id);
|
|
41
|
+
});
|
|
38
42
|
});
|
|
39
43
|
|
|
40
44
|
const absolute = $derived(new Intl.DateTimeFormat(locale, dateOptions).format(date));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { untrack } from 'svelte';
|
|
2
3
|
import { generateCounterId } from '../../../utils/a11y/id.js';
|
|
3
4
|
import { interactiveStateAttrs } from '../../../utils/a11y/index.js';
|
|
4
5
|
import { getCommandMenuContext } from './CommandMenu.svelte';
|
|
@@ -30,12 +31,14 @@
|
|
|
30
31
|
const visible = $derived(ctx.filteredItems().some((i) => i.id === id));
|
|
31
32
|
|
|
32
33
|
$effect(() => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
return untrack(() => {
|
|
35
|
+
const unregister = ctx.registerItem({ id, value, keywords, disabled, onSelect });
|
|
36
|
+
const untrackVis = group?.track(() => visible);
|
|
37
|
+
return () => {
|
|
38
|
+
unregister();
|
|
39
|
+
untrackVis?.();
|
|
40
|
+
};
|
|
41
|
+
});
|
|
39
42
|
});
|
|
40
43
|
|
|
41
44
|
function onClick() {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { untrack } from 'svelte';
|
|
2
3
|
import { getModalContext } from './Modal.svelte';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
@@ -11,8 +12,10 @@
|
|
|
11
12
|
const ctx = getModalContext();
|
|
12
13
|
|
|
13
14
|
$effect(() => {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
return untrack(() => {
|
|
16
|
+
ctx.setHasDescription(true);
|
|
17
|
+
return () => ctx.setHasDescription(false);
|
|
18
|
+
});
|
|
16
19
|
});
|
|
17
20
|
</script>
|
|
18
21
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { untrack } from 'svelte';
|
|
2
3
|
import { getModalContext } from './Modal.svelte';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
@@ -12,8 +13,10 @@
|
|
|
12
13
|
const ctx = getModalContext();
|
|
13
14
|
|
|
14
15
|
$effect(() => {
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
return untrack(() => {
|
|
17
|
+
ctx.setHasTitle(true);
|
|
18
|
+
return () => ctx.setHasTitle(false);
|
|
19
|
+
});
|
|
17
20
|
});
|
|
18
21
|
</script>
|
|
19
22
|
|