mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
feat(truncate): integrate Truncate
with v11 (#1958)
This commit is contained in:
parent
b4930910bc
commit
97e6301758
8 changed files with 57 additions and 41 deletions
9
types/Truncate/Truncate.svelte.d.ts
vendored
9
types/Truncate/Truncate.svelte.d.ts
vendored
|
@ -1,14 +1,21 @@
|
|||
import type { SvelteComponentTyped } from "svelte";
|
||||
import type { SvelteHTMLElements } from "svelte/elements";
|
||||
|
||||
type RestProps = SvelteHTMLElements["p"];
|
||||
type RestProps = SvelteHTMLElements["svelte:element"];
|
||||
|
||||
export interface TruncateProps extends RestProps {
|
||||
/**
|
||||
* Specify the truncation direction
|
||||
* @default "end"
|
||||
*/
|
||||
clamp?: "end" | "front";
|
||||
|
||||
/**
|
||||
* Specify the tag name
|
||||
* @default "p"
|
||||
*/
|
||||
tag?: keyof HTMLElementTagNameMap;
|
||||
|
||||
[key: `data-${string}`]: any;
|
||||
}
|
||||
|
||||
|
|
11
types/Truncate/truncate.d.ts
vendored
11
types/Truncate/truncate.d.ts
vendored
|
@ -1,12 +1,9 @@
|
|||
import type { Action } from "svelte/action";
|
||||
|
||||
interface TruncateOptions {
|
||||
clamp?: "end" | "front";
|
||||
}
|
||||
|
||||
export function TruncateAction(
|
||||
node: HTMLElement,
|
||||
options?: TruncateOptions
|
||||
): {
|
||||
update: (options?: TruncateOptions) => void;
|
||||
};
|
||||
export declare const truncate: Action<HTMLElement, TruncateOptions>;
|
||||
|
||||
export default TruncateAction;
|
||||
export default truncate;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue