mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
parent
ba2e77eb47
commit
6ca6af94eb
3 changed files with 14 additions and 2 deletions
|
@ -3,12 +3,14 @@
|
||||||
const { modalBody } = $$props;
|
const { modalBody } = $$props;
|
||||||
|
|
||||||
import { Button } from "../Button";
|
import { Button } from "../Button";
|
||||||
|
import { TextInput, PasswordInput } from "../TextInput"
|
||||||
import ComposedModal from "./ComposedModal.svelte";
|
import ComposedModal from "./ComposedModal.svelte";
|
||||||
import ModalHeader from "./ModalHeader.svelte";
|
import ModalHeader from "./ModalHeader.svelte";
|
||||||
import ModalBody from "./ModalBody.svelte";
|
import ModalBody from "./ModalBody.svelte";
|
||||||
import ModalFooter from "./ModalFooter.svelte";
|
import ModalFooter from "./ModalFooter.svelte";
|
||||||
|
|
||||||
$: open = false;
|
let open = false;
|
||||||
|
let type = "password";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if story === undefined}
|
{#if story === undefined}
|
||||||
|
@ -17,6 +19,10 @@
|
||||||
<ModalBody
|
<ModalBody
|
||||||
{...$$props.modalBody}
|
{...$$props.modalBody}
|
||||||
aria-label={modalBody.hasScrollingContent ? 'Modal content' : undefined}>
|
aria-label={modalBody.hasScrollingContent ? 'Modal content' : undefined}>
|
||||||
|
<div>
|
||||||
|
<PasswordInput bind:type placeholder="Password Input" aria-level="" />
|
||||||
|
<Button kind="ghost" size="field" on:click="{() => {type = type === 'password' ? 'text' : 'password'}}">Programmatically toggle password</Button>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Please see ModalWrapper for more examples and demo of the functionality.
|
Please see ModalWrapper for more examples and demo of the functionality.
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
<script>
|
<script>
|
||||||
import { Button } from "../Button";
|
import { Button } from "../Button";
|
||||||
|
import { TextInput, PasswordInput } from "../TextInput"
|
||||||
import Modal from "./Modal.svelte";
|
import Modal from "./Modal.svelte";
|
||||||
|
|
||||||
let open = $$props.open;
|
let open = $$props.open;
|
||||||
|
let type = "password";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
@ -29,6 +31,10 @@
|
||||||
on:submit={() => {
|
on:submit={() => {
|
||||||
console.log('submit');
|
console.log('submit');
|
||||||
}}>
|
}}>
|
||||||
|
<div>
|
||||||
|
<PasswordInput bind:type placeholder="Password Input" aria-level="" />
|
||||||
|
<Button kind="ghost" size="field" on:click="{() => {type = type === 'password' ? 'text' : 'password'}}">Programmatically toggle password</Button>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
This component supports two-way binding by default. Please see ComposedModal
|
This component supports two-way binding by default. Please see ComposedModal
|
||||||
for piecemeal functionality.
|
for piecemeal functionality.
|
||||||
|
|
|
@ -177,7 +177,7 @@
|
||||||
class:bx--tooltip--a11y={true}
|
class:bx--tooltip--a11y={true}
|
||||||
class="{tooltipPosition && `bx--tooltip--${tooltipPosition}`}
|
class="{tooltipPosition && `bx--tooltip--${tooltipPosition}`}
|
||||||
{tooltipAlignment && `bx--tooltip--align-${tooltipAlignment}`}"
|
{tooltipAlignment && `bx--tooltip--align-${tooltipAlignment}`}"
|
||||||
on:click={() => {
|
on:click|stopPropagation={() => {
|
||||||
type = type === 'password' ? 'text' : 'password';
|
type = type === 'password' ? 'text' : 'password';
|
||||||
}}>
|
}}>
|
||||||
<span class:bx--assistive-text={true}>
|
<span class:bx--assistive-text={true}>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue