mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
Revert "chore: remove Truncate since it does not exist in Carbon v11"
This reverts commit 5833536199
.
This commit is contained in:
parent
b4802196f0
commit
b63a076059
13 changed files with 189 additions and 1 deletions
19
types/Truncate/Truncate.svelte.d.ts
vendored
Normal file
19
types/Truncate/Truncate.svelte.d.ts
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
import type { SvelteComponentTyped } from "svelte";
|
||||
import type { SvelteHTMLElements } from "svelte/elements";
|
||||
|
||||
type RestProps = SvelteHTMLElements["p"];
|
||||
|
||||
export interface TruncateProps extends RestProps {
|
||||
/**
|
||||
* @default "end"
|
||||
*/
|
||||
clamp?: "end" | "front";
|
||||
|
||||
[key: `data-${string}`]: any;
|
||||
}
|
||||
|
||||
export default class Truncate extends SvelteComponentTyped<
|
||||
TruncateProps,
|
||||
Record<string, any>,
|
||||
{ default: {} }
|
||||
> {}
|
12
types/Truncate/truncate.d.ts
vendored
Normal file
12
types/Truncate/truncate.d.ts
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
interface TruncateOptions {
|
||||
clamp?: "end" | "front";
|
||||
}
|
||||
|
||||
export function TruncateAction(
|
||||
node: HTMLElement,
|
||||
options?: TruncateOptions
|
||||
): {
|
||||
update: (options?: TruncateOptions) => void;
|
||||
};
|
||||
|
||||
export default TruncateAction;
|
Loading…
Add table
Add a link
Reference in a new issue