mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
feat(truncate): integrate Truncate
with v11
This commit is contained in:
parent
b4930910bc
commit
6c2d416721
8 changed files with 57 additions and 41 deletions
|
@ -1,7 +1,9 @@
|
|||
// @ts-check
|
||||
|
||||
/**
|
||||
* Svelte action that applies single-line text truncation to an element
|
||||
* @typedef {{ clamp?: "end" | "front" }} TruncateOptions
|
||||
* @type {(node: HTMLElement, options?: TruncateOptions) => { update: (options?: TruncateOptions) => void; }}
|
||||
* @type {import ("svelte/action").Action<HTMLElement, TruncateOptions>}
|
||||
* @example
|
||||
* <h1 use:truncate>...</h1>
|
||||
* <h1 use:truncate={{ clamp: "front" }}>...</h1>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue