framework7-svelte 8.3.4 → 9.0.0-beta.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/components/accordion-content.d.ts +11 -5
- package/components/accordion-content.svelte +8 -6
- package/components/accordion-item.d.ts +23 -11
- package/components/accordion-item.svelte +27 -25
- package/components/accordion-toggle.d.ts +11 -5
- package/components/accordion-toggle.svelte +8 -6
- package/components/accordion.d.ts +11 -5
- package/components/accordion.svelte +11 -10
- package/components/actions-button.d.ts +14 -6
- package/components/actions-button.svelte +21 -19
- package/components/actions-group.d.ts +11 -5
- package/components/actions-group.svelte +4 -7
- package/components/actions-label.d.ts +11 -5
- package/components/actions-label.svelte +13 -23
- package/components/actions.d.ts +31 -21
- package/components/actions.svelte +50 -54
- package/components/app.d.ts +11 -5
- package/components/app.svelte +6 -7
- package/components/area-chart.d.ts +13 -6
- package/components/area-chart.svelte +42 -46
- package/components/badge.d.ts +11 -5
- package/components/badge.svelte +10 -9
- package/components/block-footer.d.ts +11 -5
- package/components/block-footer.svelte +8 -6
- package/components/block-header.d.ts +11 -5
- package/components/block-header.svelte +8 -6
- package/components/block-title.d.ts +11 -5
- package/components/block-title.svelte +12 -10
- package/components/block.d.ts +11 -5
- package/components/block.svelte +76 -76
- package/components/breadcrumbs-collapsed.d.ts +12 -6
- package/components/breadcrumbs-collapsed.svelte +10 -15
- package/components/breadcrumbs-item.d.ts +12 -6
- package/components/breadcrumbs-item.svelte +9 -8
- package/components/breadcrumbs-separator.d.ts +10 -5
- package/components/breadcrumbs-separator.svelte +9 -5
- package/components/breadcrumbs.d.ts +11 -6
- package/components/breadcrumbs.svelte +8 -6
- package/components/button.d.ts +44 -37
- package/components/button.svelte +107 -103
- package/components/card-content.d.ts +11 -5
- package/components/card-content.svelte +11 -10
- package/components/card-footer.d.ts +11 -5
- package/components/card-footer.svelte +8 -6
- package/components/card-header.d.ts +11 -5
- package/components/card-header.svelte +8 -6
- package/components/card.d.ts +43 -31
- package/components/card.svelte +78 -67
- package/components/checkbox.d.ts +20 -13
- package/components/checkbox.svelte +32 -30
- package/components/chip.d.ts +22 -15
- package/components/chip.svelte +54 -60
- package/components/fab-backdrop.d.ts +10 -5
- package/components/fab-backdrop.svelte +5 -7
- package/components/fab-button.d.ts +17 -11
- package/components/fab-button.svelte +20 -29
- package/components/fab-buttons.d.ts +11 -5
- package/components/fab-buttons.svelte +5 -12
- package/components/fab.d.ts +22 -13
- package/components/fab.svelte +55 -51
- package/components/gauge.d.ts +24 -19
- package/components/gauge.svelte +25 -25
- package/components/icon.d.ts +19 -13
- package/components/icon.svelte +65 -63
- package/components/input.d.ts +78 -61
- package/components/input.svelte +171 -154
- package/components/link.d.ts +28 -21
- package/components/link.svelte +67 -65
- package/components/list-button.d.ts +22 -15
- package/components/list-button.svelte +56 -44
- package/components/list-group.d.ts +16 -10
- package/components/list-group.svelte +38 -34
- package/components/list-index.d.ts +20 -13
- package/components/list-index.svelte +23 -24
- package/components/list-input.d.ts +91 -64
- package/components/list-input.svelte +254 -205
- package/components/list-item.d.ts +98 -63
- package/components/list-item.svelte +412 -439
- package/components/list.d.ts +72 -54
- package/components/list.svelte +151 -147
- package/components/login-screen-title.d.ts +11 -5
- package/components/login-screen-title.svelte +4 -6
- package/components/login-screen.d.ts +20 -10
- package/components/login-screen.svelte +39 -42
- package/components/message.d.ts +48 -29
- package/components/message.svelte +123 -88
- package/components/messagebar-attachment.d.ts +17 -9
- package/components/messagebar-attachment.svelte +16 -18
- package/components/messagebar-attachments.d.ts +11 -5
- package/components/messagebar-attachments.svelte +6 -6
- package/components/messagebar-sheet-image.d.ts +19 -10
- package/components/messagebar-sheet-image.svelte +30 -22
- package/components/messagebar-sheet-item.d.ts +11 -5
- package/components/messagebar-sheet-item.svelte +4 -6
- package/components/messagebar-sheet.d.ts +11 -5
- package/components/messagebar-sheet.svelte +4 -6
- package/components/messagebar.d.ts +53 -31
- package/components/messagebar.svelte +100 -77
- package/components/messages-title.d.ts +11 -5
- package/components/messages-title.svelte +4 -6
- package/components/messages.d.ts +26 -20
- package/components/messages.svelte +32 -32
- package/components/nav-left.d.ts +19 -12
- package/components/nav-left.svelte +23 -39
- package/components/nav-right.d.ts +11 -6
- package/components/nav-right.svelte +4 -15
- package/components/nav-title-large.d.ts +11 -5
- package/components/nav-title-large.svelte +4 -6
- package/components/nav-title.d.ts +13 -8
- package/components/nav-title.svelte +25 -20
- package/components/navbar.d.ts +47 -28
- package/components/navbar.svelte +100 -111
- package/components/page-content.d.ts +41 -29
- package/components/page-content.svelte +58 -50
- package/components/page.d.ts +71 -46
- package/components/page.svelte +102 -82
- package/components/panel.d.ts +51 -35
- package/components/panel.svelte +94 -99
- package/components/photo-browser.d.ts +50 -41
- package/components/photo-browser.svelte +48 -47
- package/components/pie-chart.d.ts +13 -6
- package/components/pie-chart.svelte +29 -27
- package/components/popover.d.ts +28 -19
- package/components/popover.svelte +45 -48
- package/components/popup.d.ts +37 -23
- package/components/popup.svelte +68 -57
- package/components/preloader.d.ts +10 -5
- package/components/preloader.svelte +30 -31
- package/components/progressbar.d.ts +11 -6
- package/components/progressbar.svelte +13 -17
- package/components/radio.d.ts +19 -12
- package/components/radio.svelte +19 -23
- package/components/range.d.ts +35 -27
- package/components/range.svelte +47 -44
- package/components/routable-modals.d.ts +9 -4
- package/components/routable-modals.svelte +9 -8
- package/components/router-context-provider.d.ts +11 -6
- package/components/router-context-provider.svelte +2 -4
- package/components/searchbar.d.ts +60 -43
- package/components/searchbar.svelte +115 -104
- package/components/segmented.d.ts +21 -15
- package/components/segmented.svelte +38 -35
- package/components/sheet.d.ts +47 -30
- package/components/sheet.svelte +94 -76
- package/components/snippet-render.d.ts +24 -0
- package/components/snippet-render.svelte +9 -0
- package/components/stepper.d.ts +53 -43
- package/components/stepper.svelte +83 -79
- package/components/subnavbar.d.ts +13 -8
- package/components/subnavbar.svelte +12 -20
- package/components/swipeout-actions.d.ts +14 -8
- package/components/swipeout-actions.svelte +14 -13
- package/components/swipeout-button.d.ts +20 -13
- package/components/swipeout-button.svelte +31 -31
- package/components/tab.d.ts +14 -8
- package/components/tab.svelte +20 -28
- package/components/tabs.d.ts +15 -9
- package/components/tabs.svelte +27 -26
- package/components/text-editor.d.ts +44 -24
- package/components/text-editor.svelte +56 -41
- package/components/toggle.d.ts +22 -15
- package/components/toggle.svelte +33 -37
- package/components/toolbar-pane.d.ts +24 -0
- package/components/toolbar-pane.svelte +14 -0
- package/components/toolbar.d.ts +30 -20
- package/components/toolbar.svelte +61 -53
- package/components/treeview-item.d.ts +36 -17
- package/components/treeview-item.svelte +101 -81
- package/components/treeview.d.ts +11 -5
- package/components/treeview.svelte +4 -6
- package/components/use-icon.d.ts +9 -4
- package/components/use-icon.svelte +1 -1
- package/components/view.d.ts +76 -65
- package/components/view.svelte +66 -48
- package/components/views.d.ts +11 -5
- package/components/views.svelte +12 -15
- package/framework7-svelte.d.ts +3 -1
- package/framework7-svelte.js +6 -4
- package/package.json +2 -2
- package/shared/components-router.js +28 -25
- package/shared/f7.js +1 -7
- package/shared/mixins.js +5 -5
- package/shared/modal-state-classes.js +4 -5
- package/shared/plugin.js +1 -4
- package/shared/rest-props.js +1 -4
- package/shared/use-icon.js +2 -5
- package/shared/use-store.js +9 -9
- package/shared/use-tab.js +3 -3
- package/shared/use-tooltip.js +3 -4
- package/shared/utils.js +2 -8
- package/shared/get-reactive-context.js +0 -16
- package/shared/list-context.js +0 -10
- package/shared/router-context.js +0 -8
- package/shared/set-reactive-context.js +0 -26
|
@@ -1,35 +1,27 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { colorClasses } from '../shared/mixins.js';
|
|
3
3
|
import { classNames } from '../shared/utils.js';
|
|
4
|
-
|
|
4
|
+
let {
|
|
5
|
+
class: className,
|
|
6
|
+
title = undefined,
|
|
7
|
+
inner = true,
|
|
8
|
+
f7Slot = 'fixed',
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
} = $props();
|
|
5
12
|
|
|
6
|
-
|
|
7
|
-
export { className as class };
|
|
8
|
-
|
|
9
|
-
export let sliding = undefined;
|
|
10
|
-
export let title = undefined;
|
|
11
|
-
export let inner = true;
|
|
12
|
-
export let f7Slot = 'fixed';
|
|
13
|
-
|
|
14
|
-
$: classes = classNames(
|
|
15
|
-
className,
|
|
16
|
-
'subnavbar',
|
|
17
|
-
{
|
|
18
|
-
sliding,
|
|
19
|
-
},
|
|
20
|
-
colorClasses($$props),
|
|
21
|
-
);
|
|
13
|
+
const classes = $derived(classNames(className, 'subnavbar', {}, colorClasses(restProps)));
|
|
22
14
|
</script>
|
|
23
15
|
|
|
24
|
-
<div class={classes} data-f7-slot={f7Slot} {...restProps
|
|
16
|
+
<div class={classes} data-f7-slot={f7Slot} {...restProps}>
|
|
25
17
|
{#if inner}
|
|
26
18
|
<div class="subnavbar-inner">
|
|
27
19
|
{#if title}
|
|
28
20
|
<div class="subnavbar-title">{title}</div>
|
|
29
21
|
{/if}
|
|
30
|
-
|
|
22
|
+
{@render children?.()}
|
|
31
23
|
</div>
|
|
32
24
|
{:else}
|
|
33
|
-
|
|
25
|
+
{@render children?.()}
|
|
34
26
|
{/if}
|
|
35
27
|
</div>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
import { SvelteComponent } from 'svelte';
|
|
2
|
+
import { SvelteComponent, Snippet } from 'svelte';
|
|
3
3
|
import { HTMLAttributes } from 'svelte/elements';
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
interface
|
|
7
|
-
left
|
|
8
|
-
right
|
|
9
|
-
side
|
|
6
|
+
interface Props {
|
|
7
|
+
left?: boolean;
|
|
8
|
+
right?: boolean;
|
|
9
|
+
side?: string;
|
|
10
10
|
color?: string;
|
|
11
11
|
colorTheme?: string;
|
|
12
12
|
textColor?: string;
|
|
@@ -14,14 +14,20 @@ interface SwipeoutActionsProps {
|
|
|
14
14
|
borderColor?: string;
|
|
15
15
|
rippleColor?: string;
|
|
16
16
|
dark?: boolean;
|
|
17
|
+
children?: Snippet;
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
interface SwipeoutActionsProps {}
|
|
21
|
+
interface SwipeoutActionsProps extends Props {}
|
|
22
|
+
|
|
23
|
+
interface SwipeoutActionsEvents extends Record<'',{}>{}
|
|
24
|
+
|
|
19
25
|
|
|
20
26
|
|
|
21
27
|
declare class SwipeoutActions extends SvelteComponent<
|
|
22
|
-
SwipeoutActionsProps
|
|
23
|
-
|
|
24
|
-
{
|
|
28
|
+
SwipeoutActionsProps,
|
|
29
|
+
SwipeoutActionsEvents,
|
|
30
|
+
{ }
|
|
25
31
|
> {}
|
|
26
32
|
|
|
27
33
|
export { SwipeoutActionsProps };
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { colorClasses } from '../shared/mixins.js';
|
|
3
3
|
import { classNames } from '../shared/utils.js';
|
|
4
|
-
|
|
4
|
+
let {
|
|
5
|
+
class: className,
|
|
6
|
+
left = false,
|
|
7
|
+
right = false,
|
|
8
|
+
side = undefined,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
} = $props();
|
|
5
12
|
|
|
6
|
-
|
|
7
|
-
export { className as class };
|
|
13
|
+
const sideComputed = $derived(side || (left ? 'left' : right ? 'right' : 'left'));
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// eslint-disable-next-line
|
|
14
|
-
$: sideComputed = side || (left ? 'left' : right ? 'right' : 'left');
|
|
15
|
-
|
|
16
|
-
$: classes = classNames(className, `swipeout-actions-${sideComputed}`, colorClasses($$props));
|
|
15
|
+
const classes = $derived(
|
|
16
|
+
classNames(className, `swipeout-actions-${sideComputed}`, colorClasses(restProps)),
|
|
17
|
+
);
|
|
17
18
|
</script>
|
|
18
19
|
|
|
19
|
-
<div class={classes} {...restProps
|
|
20
|
-
|
|
20
|
+
<div class={classes} {...restProps}>
|
|
21
|
+
{@render children?.()}
|
|
21
22
|
</div>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
|
|
2
|
-
import { SvelteComponent } from 'svelte';
|
|
2
|
+
import { SvelteComponent, Snippet } from 'svelte';
|
|
3
3
|
import { HTMLAttributes } from 'svelte/elements';
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
interface
|
|
7
|
-
text
|
|
8
|
-
confirmTitle
|
|
9
|
-
confirmText
|
|
10
|
-
overswipe
|
|
11
|
-
close
|
|
12
|
-
delete
|
|
13
|
-
href
|
|
6
|
+
interface Props {
|
|
7
|
+
text?: string;
|
|
8
|
+
confirmTitle?: string;
|
|
9
|
+
confirmText?: string;
|
|
10
|
+
overswipe?: boolean;
|
|
11
|
+
close?: boolean;
|
|
12
|
+
delete?: boolean;
|
|
13
|
+
href?: string;
|
|
14
14
|
color?: string;
|
|
15
15
|
colorTheme?: string;
|
|
16
16
|
textColor?: string;
|
|
@@ -18,15 +18,22 @@ interface SwipeoutButtonProps {
|
|
|
18
18
|
borderColor?: string;
|
|
19
19
|
rippleColor?: string;
|
|
20
20
|
dark?: boolean;
|
|
21
|
-
onClick
|
|
21
|
+
onClick?: (event?: any) => void;
|
|
22
|
+
children?: Snippet;
|
|
23
|
+
onclick?: () => void;
|
|
22
24
|
}
|
|
23
25
|
|
|
26
|
+
interface SwipeoutButtonProps {}
|
|
27
|
+
interface SwipeoutButtonProps extends Props {}
|
|
28
|
+
|
|
29
|
+
interface SwipeoutButtonEvents extends Record<'',{}>{}
|
|
30
|
+
|
|
24
31
|
|
|
25
32
|
|
|
26
33
|
declare class SwipeoutButton extends SvelteComponent<
|
|
27
|
-
SwipeoutButtonProps
|
|
28
|
-
|
|
29
|
-
{
|
|
34
|
+
SwipeoutButtonProps,
|
|
35
|
+
SwipeoutButtonEvents,
|
|
36
|
+
{ }
|
|
30
37
|
> {}
|
|
31
38
|
|
|
32
39
|
export { SwipeoutButtonProps };
|
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { createEventDispatcher } from 'svelte';
|
|
3
|
-
|
|
4
2
|
import { colorClasses } from '../shared/mixins.js';
|
|
5
|
-
import { classNames
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
let deleteProp = undefined;
|
|
19
|
-
export { deleteProp as delete };
|
|
20
|
-
export let href = undefined;
|
|
3
|
+
import { classNames } from '../shared/utils.js';
|
|
4
|
+
let {
|
|
5
|
+
class: className,
|
|
6
|
+
delete: deleteProp,
|
|
7
|
+
text = undefined,
|
|
8
|
+
confirmTitle = undefined,
|
|
9
|
+
confirmText = undefined,
|
|
10
|
+
overswipe = undefined,
|
|
11
|
+
close = undefined,
|
|
12
|
+
href = undefined,
|
|
13
|
+
children,
|
|
14
|
+
...restProps
|
|
15
|
+
} = $props();
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
const classes = $derived(
|
|
18
|
+
classNames(
|
|
19
|
+
className,
|
|
20
|
+
{
|
|
21
|
+
'swipeout-overswipe': overswipe,
|
|
22
|
+
'swipeout-delete': deleteProp,
|
|
23
|
+
'swipeout-close': close,
|
|
24
|
+
},
|
|
25
|
+
colorClasses(restProps),
|
|
26
|
+
),
|
|
30
27
|
);
|
|
31
28
|
|
|
32
29
|
function onClick() {
|
|
33
|
-
|
|
30
|
+
restProps.onClick?.();
|
|
31
|
+
restProps.onclick?.();
|
|
34
32
|
}
|
|
35
33
|
</script>
|
|
36
34
|
|
|
@@ -39,9 +37,11 @@
|
|
|
39
37
|
data-confirm={confirmText || undefined}
|
|
40
38
|
data-confirm-title={confirmTitle || undefined}
|
|
41
39
|
class={classes}
|
|
42
|
-
|
|
43
|
-
{...restProps
|
|
40
|
+
onclick={onClick}
|
|
41
|
+
{...restProps}
|
|
44
42
|
>
|
|
45
|
-
{
|
|
46
|
-
|
|
43
|
+
{#if text}
|
|
44
|
+
{text}
|
|
45
|
+
{/if}
|
|
46
|
+
{@render children?.()}
|
|
47
47
|
</a>
|
package/components/tab.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
import { SvelteComponent } from 'svelte';
|
|
2
|
+
import { SvelteComponent, Snippet } from 'svelte';
|
|
3
3
|
import { HTMLAttributes } from 'svelte/elements';
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
interface
|
|
6
|
+
interface Props {
|
|
7
7
|
color?: string;
|
|
8
8
|
colorTheme?: string;
|
|
9
9
|
textColor?: string;
|
|
@@ -11,17 +11,23 @@ interface TabProps {
|
|
|
11
11
|
borderColor?: string;
|
|
12
12
|
rippleColor?: string;
|
|
13
13
|
dark?: boolean;
|
|
14
|
-
tabActive
|
|
15
|
-
onTabShow
|
|
16
|
-
onTabHide
|
|
14
|
+
tabActive?: boolean;
|
|
15
|
+
onTabShow?: (el?: HTMLElement) => void;
|
|
16
|
+
onTabHide?: (el?: HTMLElement) => void;
|
|
17
|
+
children?: Snippet;
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
interface TabProps {}
|
|
21
|
+
interface TabProps extends Props {}
|
|
22
|
+
|
|
23
|
+
interface TabEvents extends Record<'',{}>{}
|
|
24
|
+
|
|
19
25
|
|
|
20
26
|
|
|
21
27
|
declare class Tab extends SvelteComponent<
|
|
22
|
-
TabProps
|
|
23
|
-
|
|
24
|
-
{
|
|
28
|
+
TabProps,
|
|
29
|
+
TabEvents,
|
|
30
|
+
{ }
|
|
25
31
|
> {}
|
|
26
32
|
|
|
27
33
|
export { TabProps };
|
package/components/tab.svelte
CHANGED
|
@@ -1,32 +1,22 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { onMount, onDestroy,
|
|
2
|
+
import { onMount, onDestroy, tick, getContext } from 'svelte';
|
|
3
3
|
|
|
4
|
-
import { restProps } from '../shared/rest-props.js';
|
|
5
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
|
-
import { classNames,
|
|
5
|
+
import { classNames, getComponentId } from '../shared/utils.js';
|
|
7
6
|
import { f7ready, app } from '../shared/f7.js';
|
|
8
7
|
import { useTab } from '../shared/use-tab.js';
|
|
9
|
-
import { getReactiveContext } from '../shared/get-reactive-context.js';
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
let className = undefined;
|
|
14
|
-
export { className as class };
|
|
15
|
-
export let tabActive = false;
|
|
16
|
-
export let id = undefined;
|
|
9
|
+
let { class: className, tabActive = false, id = undefined, children, ...restProps } = $props();
|
|
17
10
|
|
|
18
11
|
const RouterContext = getContext('RouterContext') || {};
|
|
19
12
|
|
|
20
|
-
let TabsSwipeableContext =
|
|
21
|
-
getReactiveContext('TabsSwipeableContext', (newValue) => {
|
|
22
|
-
TabsSwipeableContext = newValue || false;
|
|
23
|
-
}) || {};
|
|
13
|
+
let TabsSwipeableContext = getContext('TabsSwipeableContext') || (() => ({ value: false }));
|
|
24
14
|
|
|
25
|
-
let el;
|
|
26
|
-
let routerData = null;
|
|
27
|
-
let initialTabContent = null;
|
|
15
|
+
let el = $state(null);
|
|
16
|
+
let routerData = $state(null);
|
|
17
|
+
let initialTabContent = $state(null);
|
|
28
18
|
|
|
29
|
-
|
|
19
|
+
const isSwiper = $derived(TabsSwipeableContext().value);
|
|
30
20
|
|
|
31
21
|
if (
|
|
32
22
|
!routerData &&
|
|
@@ -54,11 +44,13 @@
|
|
|
54
44
|
};
|
|
55
45
|
}
|
|
56
46
|
}
|
|
57
|
-
let tabContent = initialTabContent || null;
|
|
47
|
+
let tabContent = $state(initialTabContent || null);
|
|
58
48
|
|
|
59
|
-
|
|
49
|
+
const classes = $derived(
|
|
50
|
+
classNames(className, 'tab', tabActive && 'tab-active', colorClasses(restProps)),
|
|
51
|
+
);
|
|
60
52
|
|
|
61
|
-
useTab(() => el,
|
|
53
|
+
useTab(() => el, restProps);
|
|
62
54
|
|
|
63
55
|
onMount(() => {
|
|
64
56
|
if (el && initialTabContent) {
|
|
@@ -80,7 +72,7 @@
|
|
|
80
72
|
}
|
|
81
73
|
});
|
|
82
74
|
});
|
|
83
|
-
|
|
75
|
+
$effect(() => {
|
|
84
76
|
if (!routerData) return;
|
|
85
77
|
app.f7events.emit('tabRouterDidUpdate', routerData);
|
|
86
78
|
});
|
|
@@ -92,17 +84,17 @@
|
|
|
92
84
|
</script>
|
|
93
85
|
|
|
94
86
|
{#if isSwiper || TabsSwipeableContext}
|
|
95
|
-
<swiper-slide {id} class={classes} bind:this={el} {...restProps
|
|
87
|
+
<swiper-slide {id} class={classes} bind:this={el} {...restProps}>
|
|
96
88
|
{#if tabContent}
|
|
97
|
-
<
|
|
89
|
+
<tabContent.component {...tabContent.props} />
|
|
98
90
|
{/if}
|
|
99
|
-
|
|
91
|
+
{@render children?.()}
|
|
100
92
|
</swiper-slide>
|
|
101
93
|
{:else}
|
|
102
|
-
<div {id} class={classes} bind:this={el} {...restProps
|
|
94
|
+
<div {id} class={classes} bind:this={el} {...restProps}>
|
|
103
95
|
{#if tabContent}
|
|
104
|
-
<
|
|
96
|
+
<tabContent.component {...tabContent.props} />
|
|
105
97
|
{/if}
|
|
106
|
-
|
|
98
|
+
{@render children?.()}
|
|
107
99
|
</div>
|
|
108
100
|
{/if}
|
package/components/tabs.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
|
|
2
|
-
import { SvelteComponent } from 'svelte';
|
|
2
|
+
import { SvelteComponent, Snippet } from 'svelte';
|
|
3
3
|
import { HTMLAttributes } from 'svelte/elements';
|
|
4
4
|
|
|
5
5
|
import { SwiperOptions } from 'swiper';
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
interface
|
|
9
|
-
animated
|
|
10
|
-
swipeable
|
|
11
|
-
routable
|
|
12
|
-
swiperParams
|
|
8
|
+
interface Props {
|
|
9
|
+
animated?: boolean;
|
|
10
|
+
swipeable?: boolean;
|
|
11
|
+
routable?: boolean;
|
|
12
|
+
swiperParams?: SwiperOptions;
|
|
13
13
|
color?: string;
|
|
14
14
|
colorTheme?: string;
|
|
15
15
|
textColor?: string;
|
|
@@ -17,14 +17,20 @@ interface TabsProps {
|
|
|
17
17
|
borderColor?: string;
|
|
18
18
|
rippleColor?: string;
|
|
19
19
|
dark?: boolean;
|
|
20
|
+
children?: Snippet;
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
interface TabsProps {}
|
|
24
|
+
interface TabsProps extends Props {}
|
|
25
|
+
|
|
26
|
+
interface TabsEvents extends Record<'',{}>{}
|
|
27
|
+
|
|
22
28
|
|
|
23
29
|
|
|
24
30
|
declare class Tabs extends SvelteComponent<
|
|
25
|
-
TabsProps
|
|
26
|
-
|
|
27
|
-
{
|
|
31
|
+
TabsProps,
|
|
32
|
+
TabsEvents,
|
|
33
|
+
{ }
|
|
28
34
|
> {}
|
|
29
35
|
|
|
30
36
|
export { TabsProps };
|
package/components/tabs.svelte
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { onMount, tick } from 'svelte';
|
|
2
|
+
import { onMount, setContext, tick } from 'svelte';
|
|
3
3
|
|
|
4
|
-
import { restProps } from '../shared/rest-props.js';
|
|
5
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
5
|
import { classNames } from '../shared/utils.js';
|
|
7
|
-
import { setReactiveContext } from '../shared/set-reactive-context.js';
|
|
8
6
|
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
let {
|
|
8
|
+
class: className,
|
|
9
|
+
animated = false,
|
|
10
|
+
swipeable = false,
|
|
11
|
+
routable = false,
|
|
12
|
+
swiperParams = undefined,
|
|
13
|
+
children,
|
|
14
|
+
...restProps
|
|
15
|
+
} = $props();
|
|
15
16
|
|
|
16
|
-
let wrapEl;
|
|
17
|
+
let wrapEl = $state(null);
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
const classes = $derived(classNames(className, colorClasses(restProps)));
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const tabsClasses = $derived(
|
|
22
|
+
classNames({
|
|
23
|
+
tabs: true,
|
|
24
|
+
'tabs-routable': routable,
|
|
25
|
+
}),
|
|
26
|
+
);
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
setContext('TabsSwipeableContext', () => ({
|
|
29
|
+
value: true,
|
|
30
|
+
}));
|
|
26
31
|
|
|
27
32
|
onMount(() => {
|
|
28
33
|
if (swipeable && swiperParams && wrapEl) {
|
|
@@ -38,26 +43,22 @@
|
|
|
38
43
|
</script>
|
|
39
44
|
|
|
40
45
|
{#if animated}
|
|
41
|
-
<div
|
|
42
|
-
class={classNames('tabs-animated-wrap', classes)}
|
|
43
|
-
bind:this={wrapEl}
|
|
44
|
-
{...restProps($$restProps)}
|
|
45
|
-
>
|
|
46
|
+
<div class={classNames('tabs-animated-wrap', classes)} bind:this={wrapEl} {...restProps}>
|
|
46
47
|
<div class={tabsClasses}>
|
|
47
|
-
|
|
48
|
+
{@render children?.()}
|
|
48
49
|
</div>
|
|
49
50
|
</div>
|
|
50
51
|
{:else if swipeable}
|
|
51
52
|
<swiper-container
|
|
52
53
|
bind:this={wrapEl}
|
|
53
54
|
class={classNames(tabsClasses, classes)}
|
|
54
|
-
{...restProps
|
|
55
|
+
{...restProps}
|
|
55
56
|
init={swiperParams ? 'false' : 'true'}
|
|
56
57
|
>
|
|
57
|
-
|
|
58
|
+
{@render children?.()}
|
|
58
59
|
</swiper-container>
|
|
59
60
|
{:else}
|
|
60
|
-
<div class={classNames(tabsClasses, classes)} {...restProps
|
|
61
|
-
|
|
61
|
+
<div class={classNames(tabsClasses, classes)} {...restProps}>
|
|
62
|
+
{@render children?.()}
|
|
62
63
|
</div>
|
|
63
64
|
{/if}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
import { SvelteComponent } from 'svelte';
|
|
2
|
+
import { SvelteComponent, Snippet } from 'svelte';
|
|
3
3
|
import { HTMLAttributes } from 'svelte/elements';
|
|
4
4
|
|
|
5
5
|
import { TextEditor } from 'framework7/types';
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
interface
|
|
8
|
+
interface Props {
|
|
9
9
|
color?: string;
|
|
10
10
|
colorTheme?: string;
|
|
11
11
|
textColor?: string;
|
|
@@ -13,35 +13,55 @@ interface TextEditorProps {
|
|
|
13
13
|
borderColor?: string;
|
|
14
14
|
rippleColor?: string;
|
|
15
15
|
dark?: boolean;
|
|
16
|
-
mode
|
|
17
|
-
value
|
|
18
|
-
buttons
|
|
19
|
-
customButtons
|
|
20
|
-
dividers
|
|
21
|
-
imageUrlText
|
|
22
|
-
linkUrlText
|
|
23
|
-
placeholder
|
|
24
|
-
clearFormattingOnPaste
|
|
25
|
-
resizable
|
|
26
|
-
onTextEditorChange
|
|
27
|
-
onTextEditorInput
|
|
28
|
-
onTextEditorFocus
|
|
29
|
-
onTextEditorBlur
|
|
30
|
-
onTextEditorButtonClick
|
|
31
|
-
onTextEditorKeyboardOpen
|
|
32
|
-
onTextEditorKeyboardClose
|
|
33
|
-
onTextEditorPopoverOpen
|
|
34
|
-
onTextEditorPopoverClose
|
|
16
|
+
mode?: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
buttons?: Array<any>;
|
|
19
|
+
customButtons?: Object;
|
|
20
|
+
dividers?: boolean;
|
|
21
|
+
imageUrlText?: string;
|
|
22
|
+
linkUrlText?: string;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
clearFormattingOnPaste?: boolean;
|
|
25
|
+
resizable?: boolean;
|
|
26
|
+
onTextEditorChange?: (value?: any) => void;
|
|
27
|
+
onTextEditorInput?: (value?: any) => void;
|
|
28
|
+
onTextEditorFocus?: (...args: any[]) => void;
|
|
29
|
+
onTextEditorBlur?: (...args: any[]) => void;
|
|
30
|
+
onTextEditorButtonClick?: (button?: any) => void;
|
|
31
|
+
onTextEditorKeyboardOpen?: (...args: any[]) => void;
|
|
32
|
+
onTextEditorKeyboardClose?: (...args: any[]) => void;
|
|
33
|
+
onTextEditorPopoverOpen?: (...args: any[]) => void;
|
|
34
|
+
onTextEditorPopoverClose?: (...args: any[]) => void;
|
|
35
35
|
onTextEditorInsertLink?: (...args: any[]) => void;
|
|
36
36
|
onTextEditorInsertImage?: (...args: any[]) => void;
|
|
37
|
+
rootStart?: Snippet;
|
|
38
|
+
children?: Snippet;
|
|
39
|
+
rootEnd?: Snippet;
|
|
40
|
+
root?: Snippet;
|
|
41
|
+
ontexteditorchange?: () => void;
|
|
42
|
+
ontexteditorinput?: () => void;
|
|
43
|
+
ontexteditorfocus?: () => void;
|
|
44
|
+
ontexteditorblur?: () => void;
|
|
45
|
+
ontexteditorbuttonclick?: () => void;
|
|
46
|
+
ontexteditorkeyboardopen?: () => void;
|
|
47
|
+
ontexteditorkeyboardclose?: () => void;
|
|
48
|
+
ontexteditorpopoveropen?: () => void;
|
|
49
|
+
ontexteditorpopoverclose?: () => void;
|
|
50
|
+
ontexteditorinsertlink?: () => void;
|
|
51
|
+
ontexteditorinsertimage?: () => void;
|
|
37
52
|
}
|
|
38
53
|
|
|
54
|
+
interface TextEditorProps {}
|
|
55
|
+
interface TextEditorProps extends Props {}
|
|
56
|
+
|
|
57
|
+
interface TextEditorEvents extends Record<'',{}>{}
|
|
58
|
+
|
|
39
59
|
|
|
40
60
|
|
|
41
61
|
declare class TextEditor extends SvelteComponent<
|
|
42
|
-
TextEditorProps
|
|
43
|
-
|
|
44
|
-
{
|
|
62
|
+
TextEditorProps,
|
|
63
|
+
TextEditorEvents,
|
|
64
|
+
{ }
|
|
45
65
|
> {}
|
|
46
66
|
|
|
47
67
|
export { TextEditorProps };
|