mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
fix(types): upgrade sveld and type constant props as accessors (#742)
This commit is contained in:
parent
fac78ee4aa
commit
54e1e07872
10 changed files with 63 additions and 61 deletions
16
types/Breakpoint/Breakpoint.d.ts
vendored
16
types/Breakpoint/Breakpoint.d.ts
vendored
|
@ -16,13 +16,6 @@ export interface BreakpointProps {
|
|||
* @default { sm: false, md: false, lg: false, xlg: false, max: false, }
|
||||
*/
|
||||
sizes?: Record<BreakpointSize, boolean>;
|
||||
|
||||
/**
|
||||
* Reference the Carbon grid breakpoints
|
||||
* @constant
|
||||
* @default { sm: 320, md: 672, lg: 1056, xlg: 1312, max: 1584, }
|
||||
*/
|
||||
breakpoints?: { sm: 320; md: 672; lg: 1056; xlg: 1312; max: 1584 };
|
||||
}
|
||||
|
||||
export default class Breakpoint extends SvelteComponentTyped<
|
||||
|
@ -34,4 +27,11 @@ export default class Breakpoint extends SvelteComponentTyped<
|
|||
}>;
|
||||
},
|
||||
{ default: { size: BreakpointSize; sizes: Record<BreakpointSize, boolean> } }
|
||||
> {}
|
||||
> {
|
||||
/**
|
||||
* Reference the Carbon grid breakpoints
|
||||
* @constant
|
||||
* @default { sm: 320, md: 672, lg: 1056, xlg: 1312, max: 1584, }
|
||||
*/
|
||||
breakpoints: Record<BreakpointSize, BreakpointValue>;
|
||||
}
|
||||
|
|
16
types/FileUploader/FileUploader.d.ts
vendored
16
types/FileUploader/FileUploader.d.ts
vendored
|
@ -27,13 +27,6 @@ export interface FileUploaderProps
|
|||
*/
|
||||
multiple?: boolean;
|
||||
|
||||
/**
|
||||
* Override the default behavior of clearing the array of uploaded files
|
||||
* @constant
|
||||
* @default () => { files = []; }
|
||||
*/
|
||||
clearFiles?: () => void;
|
||||
|
||||
/**
|
||||
* Specify the label description
|
||||
* @default ""
|
||||
|
@ -84,4 +77,11 @@ export default class FileUploader extends SvelteComponentTyped<
|
|||
keydown: WindowEventMap["keydown"];
|
||||
},
|
||||
{}
|
||||
> {}
|
||||
> {
|
||||
/**
|
||||
* Override the default behavior of clearing the array of uploaded files
|
||||
* @constant
|
||||
* @default () => { files = []; }
|
||||
*/
|
||||
clearFiles: () => void;
|
||||
}
|
||||
|
|
16
types/ImageLoader/ImageLoader.d.ts
vendored
16
types/ImageLoader/ImageLoader.d.ts
vendored
|
@ -44,17 +44,17 @@ export interface ImageLoaderProps
|
|||
* @default false
|
||||
*/
|
||||
fadeIn?: boolean;
|
||||
|
||||
/**
|
||||
* Method invoked to load the image provided a `src` value
|
||||
* @constant
|
||||
* @default (url) => { if (image != null) image = null; loaded = false; error = false; image = new Image(); image.src = url || src; image.onload = () => (loaded = true); image.onerror = () => (error = true); }
|
||||
*/
|
||||
loadImage?: (url?: string) => void;
|
||||
}
|
||||
|
||||
export default class ImageLoader extends SvelteComponentTyped<
|
||||
ImageLoaderProps,
|
||||
{ load: CustomEvent<any>; error: CustomEvent<any> },
|
||||
{ error: {}; loading: {} }
|
||||
> {}
|
||||
> {
|
||||
/**
|
||||
* Method invoked to load the image provided a `src` value
|
||||
* @constant
|
||||
* @default (url) => { if (image != null) image = null; loaded = false; error = false; image = new Image(); image.src = url || src; image.onload = () => (loaded = true); image.onerror = () => (error = true); }
|
||||
*/
|
||||
loadImage: (url?: string) => void;
|
||||
}
|
||||
|
|
16
types/ListBox/ListBoxField.d.ts
vendored
16
types/ListBox/ListBoxField.d.ts
vendored
|
@ -23,13 +23,6 @@ export interface ListBoxFieldProps
|
|||
*/
|
||||
tabindex?: string;
|
||||
|
||||
/**
|
||||
* Default translation ids
|
||||
* @constant
|
||||
* @default { close: "close", open: "open" }
|
||||
*/
|
||||
translationIds?: { close: "close"; open: "open" };
|
||||
|
||||
/**
|
||||
* Override the default translation ids
|
||||
* @default (id) => defaultTranslations[id]
|
||||
|
@ -61,4 +54,11 @@ export default class ListBoxField extends SvelteComponentTyped<
|
|||
blur: WindowEventMap["blur"];
|
||||
},
|
||||
{ default: {} }
|
||||
> {}
|
||||
> {
|
||||
/**
|
||||
* Default translation ids
|
||||
* @constant
|
||||
* @default { close: "close", open: "open" }
|
||||
*/
|
||||
translationIds: { close: "close"; open: "open" };
|
||||
}
|
||||
|
|
16
types/ListBox/ListBoxMenuIcon.d.ts
vendored
16
types/ListBox/ListBoxMenuIcon.d.ts
vendored
|
@ -11,13 +11,6 @@ export interface ListBoxMenuIconProps
|
|||
*/
|
||||
open?: boolean;
|
||||
|
||||
/**
|
||||
* Default translation ids
|
||||
* @constant
|
||||
* @default { close: "close", open: "open" }
|
||||
*/
|
||||
translationIds?: { close: "close"; open: "open" };
|
||||
|
||||
/**
|
||||
* Override the default translation ids
|
||||
* @default (id) => defaultTranslations[id]
|
||||
|
@ -29,4 +22,11 @@ export default class ListBoxMenuIcon extends SvelteComponentTyped<
|
|||
ListBoxMenuIconProps,
|
||||
{ click: WindowEventMap["click"] },
|
||||
{}
|
||||
> {}
|
||||
> {
|
||||
/**
|
||||
* Default translation ids
|
||||
* @constant
|
||||
* @default { close: "close", open: "open" }
|
||||
*/
|
||||
translationIds: { close: "close"; open: "open" };
|
||||
}
|
||||
|
|
16
types/ListBox/ListBoxSelection.d.ts
vendored
16
types/ListBox/ListBoxSelection.d.ts
vendored
|
@ -16,13 +16,6 @@ export interface ListBoxSelectionProps
|
|||
*/
|
||||
disabled?: boolean;
|
||||
|
||||
/**
|
||||
* Default translation ids
|
||||
* @constant
|
||||
* @default { clearAll: "clearAll", clearSelection: "clearSelection", }
|
||||
*/
|
||||
translationIds?: { clearAll: "clearAll"; clearSelection: "clearSelection" };
|
||||
|
||||
/**
|
||||
* Override the default translation ids
|
||||
* @default (id) => defaultTranslations[id]
|
||||
|
@ -40,4 +33,11 @@ export default class ListBoxSelection extends SvelteComponentTyped<
|
|||
ListBoxSelectionProps,
|
||||
{ clear: CustomEvent<any> },
|
||||
{}
|
||||
> {}
|
||||
> {
|
||||
/**
|
||||
* Default translation ids
|
||||
* @constant
|
||||
* @default { clearAll: "clearAll", clearSelection: "clearSelection", }
|
||||
*/
|
||||
translationIds: { clearAll: "clearAll"; clearSelection: "clearSelection" };
|
||||
}
|
||||
|
|
2
types/LocalStorage/LocalStorage.d.ts
vendored
2
types/LocalStorage/LocalStorage.d.ts
vendored
|
@ -25,11 +25,13 @@ export default class LocalStorage extends SvelteComponentTyped<
|
|||
> {
|
||||
/**
|
||||
* Remove the persisted key value from the browser's local storage
|
||||
* @default () => { localStorage.removeItem(key); }
|
||||
*/
|
||||
clearItem: () => void;
|
||||
|
||||
/**
|
||||
* Clear all key values from the browser's local storage
|
||||
* @default () => { localStorage.clear(); }
|
||||
*/
|
||||
clearAll: () => void;
|
||||
}
|
||||
|
|
16
types/NumberInput/NumberInput.d.ts
vendored
16
types/NumberInput/NumberInput.d.ts
vendored
|
@ -122,13 +122,6 @@ export interface NumberInputProps
|
|||
*/
|
||||
translateWithId?: (id: NumberInputTranslationId) => string;
|
||||
|
||||
/**
|
||||
* Default translation ids
|
||||
* @constant
|
||||
* @default { increment: "increment", decrement: "decrement", }
|
||||
*/
|
||||
translationIds?: { increment: "increment"; decrement: "decrement" };
|
||||
|
||||
/**
|
||||
* Set an id for the input element
|
||||
* @default "ccs-" + Math.random().toString(36)
|
||||
|
@ -158,4 +151,11 @@ export default class NumberInput extends SvelteComponentTyped<
|
|||
input: WindowEventMap["input"];
|
||||
},
|
||||
{ label: {} }
|
||||
> {}
|
||||
> {
|
||||
/**
|
||||
* Default translation ids
|
||||
* @constant
|
||||
* @default { increment: "increment", decrement: "decrement", }
|
||||
*/
|
||||
translationIds: { increment: "increment"; decrement: "decrement" };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue