时间戳
@astryxdesign/core v0.7.1 · Timestamp
属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
value | string | number | - | ISO 时刻,或按秒计的 unix 时间。会写到 datetime。 |
format | TimestampFormat | 'auto' | relative、relative_short、auto、date、date_long、date_weekday、date_time、time、system_date、system_date_time、system_time 或 unix_seconds。 |
autoThreshold | number | 604800 | auto 从相对时间换成 date_time 的秒数门槛。 |
hasTooltip | boolean | true | 悬停卡片里是可复制的绝对时间。tooltipEntries 会替换默认行。 |
tooltipEntries | TimestampTooltipEntry[] | - | 每一项选择一种格式、可选的 timezoneID 和可选标签。 |
isTimezoneShown | boolean | false | 在 date_time 和 time 后面加上短时区名。 |
isLive | boolean | false | 刷新相对时间。间隔会随时刻变远而变长。 |
type | TextType | 'supporting' | 传给 Text 的排版角色。 |
size | TextSize | - | 可选的字号覆盖。 |
color | TextColor | 'disabled' | 'secondary' | disabled 由本组件自己上色。其余名称是文字颜色。 |
weight | TextWeight | - | 可选的字重覆盖。 |
不认识的 timezoneID 会在控制台警告,并回退到本地时区。
主题
可见文字使用所选颜色对应的文字 token。disabled 使用 --astryx-color-text-disabled。悬停卡片是共用的 HoverCard。