(value: string | number)
| 65 | |
| 66 | /** Normalizes an animation duration value. */ |
| 67 | export function normalizeDuration(value: string | number): string { |
| 68 | const stringValue = value + ''; |
| 69 | |
| 70 | if (/^[0-9]+(?:\.[0-9]+)?$/.test(stringValue)) { |
| 71 | return `${value}ms`; |
| 72 | } else if (/^[0-9]+(?:\.[0-9]+)?(?:ms|s)$/.test(stringValue)) { |
| 73 | return stringValue; |
| 74 | } else { |
| 75 | return ''; |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Base class for a tab header that supported pagination. |