-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(svelte/demo/bootstrap): svelte 5 migration
- Loading branch information
1 parent
b31cff0
commit 9128d8c
Showing
54 changed files
with
296 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import App from './App.svelte'; | ||
import '@agnos-ui/core-bootstrap/scss/agnosui.scss'; | ||
import {mount} from 'svelte'; | ||
|
||
export const main = new App({ | ||
export const main = mount(App, { | ||
target: document.getElementById('root')!, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
svelte/demo/src/bootstrap/samples/accordion/Default.route.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 8 additions & 4 deletions
12
svelte/demo/src/bootstrap/samples/modal/Component.route.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
<script lang="ts"> | ||
import {openModal} from '@agnos-ui/svelte-bootstrap/components/modal'; | ||
import ComponentModal from './ComponentModal.svelte'; | ||
const launch = () => openModal({title: 'Hi there!', children: ComponentModal, contentData: {name: 'World'}}); | ||
import {type ModalContext, openModal} from '@agnos-ui/svelte-bootstrap/components/modal'; | ||
const onclick = () => openModal({title: 'Hi there!', children, contentData: {name: 'World'}}); | ||
</script> | ||
|
||
<button type="button" class="btn btn-primary" on:click={() => launch()}>Launch demo modal</button> | ||
{#snippet children({state, widget}: ModalContext<{name: string}>)} | ||
<p>Hello, {state.contentData.name}!</p> | ||
<button type="button" class="btn btn-outline-primary" onclick={() => widget.api.close()}>Close</button> | ||
{/snippet} | ||
|
||
<button type="button" class="btn btn-primary" {onclick}>Launch demo modal</button> |
10 changes: 0 additions & 10 deletions
10
svelte/demo/src/bootstrap/samples/modal/ComponentModal.svelte
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
<script lang="ts"> | ||
import {openModal} from '@agnos-ui/svelte-bootstrap/components/modal'; | ||
import {type ModalContext, openModal} from '@agnos-ui/svelte-bootstrap/components/modal'; | ||
import StackModal from './StackModal.svelte'; | ||
</script> | ||
|
||
<button class="btn btn-primary" on:click={() => openModal({title: 'First modal', className: 'modal-sm', children: StackModal})} | ||
>Launch demo modal</button | ||
> | ||
{#snippet children(props: ModalContext<void>)} | ||
<StackModal {...props} /> | ||
{/snippet} | ||
|
||
<button class="btn btn-primary" onclick={() => openModal({title: 'First modal', className: 'modal-sm', children})}>Launch demo modal</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
<script lang="ts"> | ||
import type {ModalSlots} from '@agnos-ui/svelte-bootstrap/components/modal'; | ||
import {openModal} from '@agnos-ui/svelte-bootstrap/components/modal'; | ||
import Self from './StackModal.svelte'; | ||
type $$Props = ModalSlots['default']; | ||
type $$Slots = ModalSlots; | ||
export let widget: $$Props['widget']; | ||
export let state: $$Props['state']; | ||
import {type ModalContext, openModal} from '@agnos-ui/svelte-bootstrap/components/modal'; | ||
let {state, widget}: ModalContext<void> = $props(); | ||
</script> | ||
|
||
This is a modal<br /><br /> | ||
<button class="btn btn-outline-primary m-1" on:click={() => openModal({title: 'Other modal', children: Self, container: state.modalElement})}> | ||
<button | ||
class="btn btn-outline-primary m-1" | ||
onclick={() => openModal({title: 'Other modal', children: state.children, container: state.modalElement})} | ||
> | ||
Launch other modal</button | ||
><br /> | ||
<button class="btn btn-outline-secondary m-1" on:click={() => widget.api.patch({backdrop: true})}>Enable backdrop</button><button | ||
<button class="btn btn-outline-secondary m-1" onclick={() => widget.api.patch({backdrop: true})}>Enable backdrop</button><button | ||
class="btn btn-outline-secondary m-1" | ||
on:click={() => widget.api.patch({backdrop: false})}>Disable backdrop</button | ||
onclick={() => widget.api.patch({backdrop: false})}>Disable backdrop</button | ||
><br /> | ||
<button class="btn btn-outline-secondary m-1" on:click={() => widget.api.close()}>Close</button> | ||
<button class="btn btn-outline-secondary m-1" onclick={() => widget.api.close()}>Close</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.