mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 11:59:34 +00:00
feat: add LocalStorage component
This commit is contained in:
parent
b5161b6b9e
commit
1f7fe60695
11 changed files with 199 additions and 3 deletions
25
types/LocalStorage/LocalStorage.d.ts
vendored
Normal file
25
types/LocalStorage/LocalStorage.d.ts
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface LocalStorageProps {
|
||||
/**
|
||||
* Specify the local storage key
|
||||
* @default "local-storage-key"
|
||||
*/
|
||||
key?: string;
|
||||
|
||||
/**
|
||||
* Provide a value to persist
|
||||
* @default ""
|
||||
*/
|
||||
value?: any;
|
||||
}
|
||||
|
||||
export default class LocalStorage extends SvelteComponentTyped<
|
||||
LocalStorageProps,
|
||||
{
|
||||
save: CustomEvent<any>;
|
||||
update: CustomEvent<{ prevValue: any; value: any }>;
|
||||
},
|
||||
{}
|
||||
> {}
|
||||
1
types/index.d.ts
vendored
1
types/index.d.ts
vendored
|
|
@ -69,6 +69,7 @@ export { default as ListBoxMenuItem } from "./ListBox/ListBoxMenuItem";
|
|||
export { default as ListBoxSelection } from "./ListBox/ListBoxSelection";
|
||||
export { default as ListItem } from "./ListItem/ListItem";
|
||||
export { default as Loading } from "./Loading/Loading";
|
||||
export { default as LocalStorage } from "./LocalStorage/LocalStorage";
|
||||
export { default as MultiSelect } from "./MultiSelect/MultiSelect";
|
||||
export { default as Modal } from "./Modal/Modal";
|
||||
export { default as ToastNotification } from "./Notification/ToastNotification";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue