hys-ui 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +3 -3
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +440 -119
- package/dist/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas.vue.js +7 -0
- package/dist/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas2.vue.js +166 -0
- package/dist/components/HysAnimatedNumber/NumberDigits/NumberDigits.vue.js +7 -0
- package/dist/components/HysAnimatedNumber/NumberDigits/NumberDigits2.vue.js +105 -0
- package/dist/components/HysAnimatedNumber/animation/digital.js +186 -0
- package/dist/components/HysAnimatedNumber/animation/morph.js +110 -0
- package/dist/components/HysAnimatedNumber/animation/paint.js +34 -0
- package/dist/components/HysAnimatedNumber/animation/particles.js +51 -0
- package/dist/components/HysAnimatedNumber/animation/paths.js +165 -0
- package/dist/components/HysAnimatedNumber/animation/physics.js +66 -0
- package/dist/components/HysAnimatedNumber/animation/render.js +89 -0
- package/dist/components/HysAnimatedNumber/animation/reveal.js +125 -0
- package/dist/components/HysAnimatedNumber/animation/rolling.js +66 -0
- package/dist/components/HysAnimatedNumber/animation/scenarios.js +217 -0
- package/dist/components/HysAnimatedNumber/animation/spatial.js +112 -0
- package/dist/components/HysAnimatedNumber/useNumberCountdown.js +58 -0
- package/dist/components/HysAnimatedNumber/useNumberVisuals.js +60 -0
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +2 -2
- package/dist/components/HysFormItem/HysFormItem.vue.js +1 -1
- package/dist/components/HysFormItem/HysFormItem2.vue.js +231 -229
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +327 -274
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +38 -38
- package/dist/components/HysSearch/HysSearch.vue.js +2 -2
- package/dist/components/HysSortableList/HysSortableList.vue.js +2 -2
- package/dist/components/HysSortableList/HysSortableList2.vue.js +498 -129
- package/dist/components/HysSortableList/SortableGhost/SortableGhost.vue.js +7 -0
- package/dist/components/HysSortableList/SortableGhost/SortableGhost2.vue.js +43 -0
- package/dist/components/HysSortableList/SortableGhost/useSortGhost.js +54 -0
- package/dist/components/HysSortableList/geometry.js +230 -0
- package/dist/components/HysSortableList/model.js +254 -0
- package/dist/components/HysSortableList/transactions.js +281 -0
- package/dist/components/HysSortableList/useSortDrag.js +270 -0
- package/dist/components/HysSortableList/useSortKeyboard.js +72 -0
- package/dist/components/HysSortableList/useSortWindow.js +144 -0
- package/dist/components/HysTextarea/HysTextarea.vue.js +56 -32
- package/dist/components/HysToast/HysToast.vue.js +3 -3
- package/dist/components/HysToast/HysToast2.vue.js +379 -107
- package/dist/components/HysToast/ToastViewport/ToastViewport.vue.js +7 -0
- package/dist/components/HysToast/ToastViewport/ToastViewport2.vue.js +211 -0
- package/dist/components/HysToast/ToastViewport/useToastStackDisclosure.js +71 -0
- package/dist/components/HysToast/toastPresentation.js +98 -0
- package/dist/components/HysToast/useToastActions.js +62 -0
- package/dist/components/HysToast/useToastSwipe.js +48 -0
- package/dist/components/HysToast/useToastTimer.js +90 -0
- package/dist/composables/animatedNumberDigits.js +106 -0
- package/dist/composables/animatedNumberFormat.js +222 -0
- package/dist/composables/animatedNumberTiming.js +66 -0
- package/dist/composables/numberAnimation.js +72 -0
- package/dist/composables/numberAnimationCatalog.js +301 -0
- package/dist/composables/numberAnimationSequence.js +45 -0
- package/dist/composables/popupReferenceBinding.js +41 -0
- package/dist/composables/textInput.js +23 -14
- package/dist/composables/toastEscape.js +18 -10
- package/dist/composables/toastQueue.js +276 -0
- package/dist/composables/toastQueueModel.js +86 -0
- package/dist/composables/toastTasks.js +58 -0
- package/dist/composables/useHysAnimatedNumber.js +264 -0
- package/dist/composables/useHysNumberAnimationGroup.js +23 -0
- package/dist/composables/useHysToast.js +117 -135
- package/dist/composables/usePopupSurface.js +190 -356
- package/dist/composables/usePopupSurfaceInteractions.js +172 -0
- package/dist/composables/useTextareaSize.js +62 -46
- package/dist/index.js +125 -111
- package/dist/style.css +1 -1
- package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +88 -49
- package/dist/types/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas.vue.d.ts +19 -0
- package/dist/types/components/HysAnimatedNumber/NumberDigits/NumberDigits.vue.d.ts +31 -0
- package/dist/types/components/HysAnimatedNumber/animation/digital.d.ts +3 -0
- package/dist/types/components/HysAnimatedNumber/animation/morph.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/paint.d.ts +44 -0
- package/dist/types/components/HysAnimatedNumber/animation/particles.d.ts +5 -0
- package/dist/types/components/HysAnimatedNumber/animation/paths.d.ts +12 -0
- package/dist/types/components/HysAnimatedNumber/animation/physics.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/render.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/reveal.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/rolling.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/scenarios.d.ts +4 -0
- package/dist/types/components/HysAnimatedNumber/animation/spatial.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/useNumberCountdown.d.ts +8 -0
- package/dist/types/components/HysAnimatedNumber/useNumberVisuals.d.ts +12 -0
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +11 -2
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +2 -2
- package/dist/types/components/HysCard/HysCard.vue.d.ts +1 -1
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +3 -3
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +2 -2
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +2 -2
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +3 -3
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +5 -5
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +3 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +1 -1
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +1 -1
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +1 -1
- package/dist/types/components/HysInput/HysInput.vue.d.ts +13 -1
- package/dist/types/components/HysModal/HysModal.vue.d.ts +1 -1
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +1 -1
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +1 -1
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +2 -2
- package/dist/types/components/HysSortableList/HysSortableList.vue.d.ts +48 -25
- package/dist/types/components/HysSortableList/SortableGhost/SortableGhost.vue.d.ts +31 -0
- package/dist/types/components/HysSortableList/SortableGhost/useSortGhost.d.ts +23 -0
- package/dist/types/components/HysSortableList/geometry.d.ts +35 -0
- package/dist/types/components/HysSortableList/model.d.ts +61 -0
- package/dist/types/components/HysSortableList/sortableList.d.ts +151 -0
- package/dist/types/components/HysSortableList/transactions.d.ts +10 -0
- package/dist/types/components/HysSortableList/useSortDrag.d.ts +25 -0
- package/dist/types/components/HysSortableList/useSortKeyboard.d.ts +17 -0
- package/dist/types/components/HysSortableList/useSortWindow.d.ts +16 -0
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +1 -1
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +1 -1
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +13 -2
- package/dist/types/components/HysToast/HysToast.vue.d.ts +44 -46
- package/dist/types/components/HysToast/ToastViewport/ToastViewport.vue.d.ts +25 -0
- package/dist/types/components/HysToast/ToastViewport/useToastStackDisclosure.d.ts +16 -0
- package/dist/types/components/HysToast/toastPresentation.d.ts +8 -0
- package/dist/types/components/HysToast/toastTypes.d.ts +212 -0
- package/dist/types/components/HysToast/useToastActions.d.ts +18 -0
- package/dist/types/components/HysToast/useToastSwipe.d.ts +11 -0
- package/dist/types/components/HysToast/useToastTimer.d.ts +22 -0
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +1 -1
- package/dist/types/components/HysTour/HysTour.vue.d.ts +1 -1
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +3 -3
- package/dist/types/components/HysUpload/HysUpload.vue.d.ts +2 -2
- package/dist/types/composables/animatedNumber.d.ts +220 -0
- package/dist/types/composables/animatedNumberDigits.d.ts +32 -0
- package/dist/types/composables/animatedNumberFormat.d.ts +16 -0
- package/dist/types/composables/animatedNumberTiming.d.ts +21 -0
- package/dist/types/composables/drawer.d.ts +1 -1
- package/dist/types/composables/numberAnimation.d.ts +29 -0
- package/dist/types/composables/numberAnimationCatalog.d.ts +58 -0
- package/dist/types/composables/numberAnimationSequence.d.ts +13 -0
- package/dist/types/composables/popupReferenceBinding.d.ts +9 -0
- package/dist/types/composables/textInput.d.ts +39 -4
- package/dist/types/composables/toastEscape.d.ts +1 -1
- package/dist/types/composables/toastQueue.d.ts +121 -0
- package/dist/types/composables/toastQueueModel.d.ts +116 -0
- package/dist/types/composables/toastTasks.d.ts +2 -0
- package/dist/types/composables/useHysAnimatedNumber.d.ts +37 -0
- package/dist/types/composables/useHysNumberAnimationGroup.d.ts +4 -0
- package/dist/types/composables/useHysToast.d.ts +4 -48
- package/dist/types/composables/usePopupSurface.d.ts +20 -20
- package/dist/types/composables/usePopupSurfaceInteractions.d.ts +33 -0
- package/dist/types/composables/useTextareaSize.d.ts +5 -2
- package/dist/types/index.d.ts +15 -6
- package/package.json +1 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import type { StyleValue, VNodeChild } from "vue";
|
|
2
|
+
import type { HysNumberAnimation, HysNumberAnimationPresets, HysNumberDigitAnimations } from "./numberAnimation";
|
|
3
|
+
export type HysNumberValue = number | string;
|
|
4
|
+
export type HysNumberDirection = "up" | "down" | "none";
|
|
5
|
+
export type HysNumberStatus = "idle" | "delayed" | "playing" | "paused" | "stopped" | "finished";
|
|
6
|
+
export type HysNumberEasing = "linear" | "ease-in" | "ease-out" | "ease-in-out" | "spring" | "bounce" | readonly [number, number, number, number] | ((progress: number) => number);
|
|
7
|
+
export type HysNumberInterrupt = "retarget" | "restart" | "queue" | "snap";
|
|
8
|
+
export type HysNumberTrigger = "mount" | "activate" | "update" | "manual" | "click" | "hover" | "visible";
|
|
9
|
+
export type HysNumberEffect = "count" | "odometer" | "wheel" | "flip" | "slot" | "random" | "scramble" | "fade" | "scale" | "bounce" | "spring" | "slide" | "blur" | "appear" | "disappear" | "flash" | "highlight" | "gradient";
|
|
10
|
+
export type HysNumberRounding = "half-up" | "half-even" | "floor" | "ceil" | "trunc";
|
|
11
|
+
export type HysNumberFormat = "decimal" | "percent" | "currency" | "scientific";
|
|
12
|
+
export interface HysNumberInterpolationContext {
|
|
13
|
+
from: HysNumberValue;
|
|
14
|
+
to: HysNumberValue;
|
|
15
|
+
progress: number;
|
|
16
|
+
easedProgress: number;
|
|
17
|
+
/** 内置插值计算的当前值,字符串模式保留十进制精度。 */
|
|
18
|
+
defaultValue: HysNumberValue;
|
|
19
|
+
}
|
|
20
|
+
export interface HysNumberAnimationOptions {
|
|
21
|
+
/** 目标值。十进制字符串可保留超出 Number 安全范围的精度。 */
|
|
22
|
+
value?: HysNumberValue;
|
|
23
|
+
/** 起始值。省略时首次直接显示目标值,后续从当前显示值过渡。 */
|
|
24
|
+
from?: HysNumberValue;
|
|
25
|
+
/** 单轮时长,单位毫秒。默认 650,非正数直接到达终点。 */
|
|
26
|
+
duration?: number;
|
|
27
|
+
/** 每次新播放的等待毫秒数,循环的后续轮次立即开始。 */
|
|
28
|
+
delay?: number;
|
|
29
|
+
/** 播放速度倍率,影响延迟与时长,默认 1。 */
|
|
30
|
+
speed?: number;
|
|
31
|
+
/** 缓动名称、四元组 [x1, y1, x2, y2] 或返回进度的函数。默认 ease-out。 */
|
|
32
|
+
easing?: HysNumberEasing;
|
|
33
|
+
/** 替换中间帧数值。接收起止值、原始进度、缓动进度和内置插值,首尾始终精确。 */
|
|
34
|
+
interpolate?: (context: HysNumberInterpolationContext) => HysNumberValue;
|
|
35
|
+
/** true 无限循环,正整数表示总轮数,默认 1。 */
|
|
36
|
+
loop?: boolean | number;
|
|
37
|
+
/** 循环轮次交替方向。 */
|
|
38
|
+
alternate?: boolean;
|
|
39
|
+
/** 更新策略。retarget 从当前帧衔接,restart 回到起点,queue 逐个播放,snap 立即显示。 */
|
|
40
|
+
interrupt?: HysNumberInterrupt;
|
|
41
|
+
/** queue 等待项上限,默认 32,范围 1–256。满时丢弃最旧的等待项。 */
|
|
42
|
+
queueLimit?: number;
|
|
43
|
+
/** retarget / restart 的最短更新时间间隔,单位毫秒。间隔内保留最新目标。 */
|
|
44
|
+
updateInterval?: number;
|
|
45
|
+
/** 最大采样帧率,范围 1–120,默认随浏览器刷新率采样。 */
|
|
46
|
+
fps?: number;
|
|
47
|
+
/** 直接显示目标值。全局动效关闭与系统减少动态效果也会立即完成。 */
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
/** 页面隐藏时冻结计时,可见时继续,默认 true。 */
|
|
50
|
+
pauseWhenHidden?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface HysNumberFrame {
|
|
53
|
+
value: HysNumberValue;
|
|
54
|
+
from: HysNumberValue;
|
|
55
|
+
to: HysNumberValue;
|
|
56
|
+
progress: number;
|
|
57
|
+
easedProgress: number;
|
|
58
|
+
direction: HysNumberDirection;
|
|
59
|
+
status: HysNumberStatus;
|
|
60
|
+
iteration: number;
|
|
61
|
+
}
|
|
62
|
+
export interface HysNumberComposableOptions extends HysNumberAnimationOptions {
|
|
63
|
+
/** 指定是否在挂载时播放,省略时提供 from 即播放。 */
|
|
64
|
+
autoPlay?: boolean;
|
|
65
|
+
/** 监听 value 并应用更新策略,默认 true。 */
|
|
66
|
+
autoUpdate?: boolean;
|
|
67
|
+
}
|
|
68
|
+
export interface HysNumberTrend {
|
|
69
|
+
previous: HysNumberValue;
|
|
70
|
+
target: HysNumberValue;
|
|
71
|
+
direction: HysNumberDirection;
|
|
72
|
+
delta: string | null;
|
|
73
|
+
percent: string | null;
|
|
74
|
+
significant: boolean;
|
|
75
|
+
}
|
|
76
|
+
export type HysNumberEvent = "start" | "update" | "progress" | "pause" | "resume" | "end" | "cancel" | "loop";
|
|
77
|
+
export interface HysNumberControls {
|
|
78
|
+
play: () => void;
|
|
79
|
+
pause: () => void;
|
|
80
|
+
resume: () => void;
|
|
81
|
+
stop: () => void;
|
|
82
|
+
restart: () => void;
|
|
83
|
+
reset: () => void;
|
|
84
|
+
reverse: () => void;
|
|
85
|
+
seek: (progress: number) => void;
|
|
86
|
+
finishAnimation: () => void;
|
|
87
|
+
}
|
|
88
|
+
export interface HysNumberUnitRule {
|
|
89
|
+
/** 按绝对值匹配的最小值,优先使用匹配规则中阈值最大的一项。 */
|
|
90
|
+
threshold: HysNumberValue;
|
|
91
|
+
/** 缩放除数,省略时使用 threshold。 */
|
|
92
|
+
divisor?: HysNumberValue;
|
|
93
|
+
label: string;
|
|
94
|
+
}
|
|
95
|
+
export interface HysNumberFormatOptions {
|
|
96
|
+
/** 小数位数的兼容属性,precision 优先。 */
|
|
97
|
+
decimals?: number;
|
|
98
|
+
/** 固定小数位数,范围 0–100。省略时普通字符串保留有效精度。 */
|
|
99
|
+
precision?: number;
|
|
100
|
+
/** 去掉末尾小数零及多余的小数点。 */
|
|
101
|
+
trimZeros?: boolean;
|
|
102
|
+
/** 整数最小位数,范围 1–21,不足时补零。 */
|
|
103
|
+
minimumIntegerDigits?: number;
|
|
104
|
+
/** 舍入规则,默认 half-up,恰好一半时远离零。 */
|
|
105
|
+
rounding?: HysNumberRounding;
|
|
106
|
+
/** 千分位符号。空字符串关闭分组,省略时由 grouping 和 locale 决定。 */
|
|
107
|
+
groupSeparator?: string;
|
|
108
|
+
/** 小数点符号。省略时使用地区格式或句点。 */
|
|
109
|
+
decimalSeparator?: string;
|
|
110
|
+
/** 是否按地区习惯分组。省略时指定 locale 才默认开启。 */
|
|
111
|
+
grouping?: boolean;
|
|
112
|
+
/** BCP 47 地区或语言标签,例如 zh-CN、de-DE、hi-IN、ar-EG。 */
|
|
113
|
+
locale?: string | string[];
|
|
114
|
+
/** decimal、percent、currency 或 scientific。默认 decimal。 */
|
|
115
|
+
numberFormat?: HysNumberFormat;
|
|
116
|
+
/** percent 的数据约定,ratio(默认)下 0.42 显示为 42%,points 下 42 显示为 42%。 */
|
|
117
|
+
percentInput?: "ratio" | "points";
|
|
118
|
+
/** ISO 4217 货币代码,例如 CNY、USD 或 EUR。默认 CNY。 */
|
|
119
|
+
currency?: string;
|
|
120
|
+
/** 替换地区格式生成的货币符号,保留符号位置。 */
|
|
121
|
+
currencySymbol?: string;
|
|
122
|
+
/** 使用 symbol、narrowSymbol 或 code 显示币种。默认 symbol。 */
|
|
123
|
+
currencyDisplay?: "symbol" | "narrowSymbol" | "code";
|
|
124
|
+
/** 自动单位。short 使用 K/M/B/T,zh 使用万/亿/万亿,也可传自定义规则数组。 */
|
|
125
|
+
compact?: "short" | "zh" | readonly HysNumberUnitRule[];
|
|
126
|
+
/** 在自动缩写单位之后附加文字。 */
|
|
127
|
+
unit?: string;
|
|
128
|
+
/** 正负号显示策略。默认 auto,仅显示负号。 */
|
|
129
|
+
signDisplay?: "auto" | "always" | "exceptZero" | "never";
|
|
130
|
+
/** 自定义正号。需设置 signDisplay="always" 或 "exceptZero"。 */
|
|
131
|
+
positiveSign?: string;
|
|
132
|
+
/** 自定义负号。 */
|
|
133
|
+
negativeSign?: string;
|
|
134
|
+
}
|
|
135
|
+
export interface HysAnimatedNumberContext extends HysNumberFrame {
|
|
136
|
+
displayValue: string;
|
|
137
|
+
unit: string;
|
|
138
|
+
remaining?: number;
|
|
139
|
+
trend: HysNumberTrend;
|
|
140
|
+
}
|
|
141
|
+
export interface HysNumberDigitContext extends HysAnimatedNumberContext {
|
|
142
|
+
digit: string;
|
|
143
|
+
index: number;
|
|
144
|
+
position: number;
|
|
145
|
+
section: "integer" | "fraction";
|
|
146
|
+
digitProgress: number;
|
|
147
|
+
}
|
|
148
|
+
export interface HysAnimatedNumberProps extends HysNumberAnimationOptions, HysNumberFormatOptions {
|
|
149
|
+
/** v-model 的目标值。与 value 同时传入时优先。 */
|
|
150
|
+
modelValue?: HysNumberValue;
|
|
151
|
+
/** 可组合的播放触发条件。默认 mount 和 update,manual 仅响应实例方法。 */
|
|
152
|
+
trigger?: HysNumberTrigger | readonly HysNumberTrigger[];
|
|
153
|
+
/** 自动和用户交互触发时的条件,可接收触发原因与最新目标值。 */
|
|
154
|
+
canPlay?: boolean | ((trigger: HysNumberTrigger, target: HysNumberValue) => boolean);
|
|
155
|
+
/** 进入视口触发时只播放一次,默认 true。 */
|
|
156
|
+
visibleOnce?: boolean;
|
|
157
|
+
/** 离开视口暂停并在重新进入时继续。 */
|
|
158
|
+
pauseOutside?: boolean;
|
|
159
|
+
/** 可视比例 0–1,默认 0.2。 */
|
|
160
|
+
visibilityThreshold?: number;
|
|
161
|
+
/** 数字动画效果,可传数组组合。默认 count。 */
|
|
162
|
+
effect?: HysNumberEffect | readonly HysNumberEffect[];
|
|
163
|
+
/** 统一效果入口。接受效果名、带参数的配置,或最多 8 层的配置数组,支持运行时切换。 */
|
|
164
|
+
animation?: HysNumberAnimation;
|
|
165
|
+
/** 用户预设表。预设可引用其他预设,循环引用自动跳过。 */
|
|
166
|
+
animationPresets?: HysNumberAnimationPresets;
|
|
167
|
+
/** animation 无法解析时使用的备用配置。 */
|
|
168
|
+
fallbackAnimation?: HysNumberAnimation;
|
|
169
|
+
/** 按位权覆盖效果。键为 integer:0(个位)、fraction:1(第一位小数)或 *(所有未指定数位)。 */
|
|
170
|
+
digitAnimations?: HysNumberDigitAnimations;
|
|
171
|
+
/** 全局效果强度 0–2,默认 1;0 仅保留数值变化。 */
|
|
172
|
+
motionIntensity?: number;
|
|
173
|
+
/** full 完整效果,simplified 仅计数,off 立即到达目标。遵循系统减少动效设置。 */
|
|
174
|
+
animationMotion?: "full" | "simplified" | "off";
|
|
175
|
+
/** 播放区间的差值达到 changeThreshold 时追加的效果,默认 highlight。 */
|
|
176
|
+
thresholdEffect?: HysNumberEffect | readonly HysNumberEffect[];
|
|
177
|
+
/** 滚轮与滑动方向,默认 vertical。 */
|
|
178
|
+
axis?: "vertical" | "horizontal";
|
|
179
|
+
/** 逐位启动间隔,单位毫秒。 */
|
|
180
|
+
stagger?: number;
|
|
181
|
+
/** 单位数字动效时长,单位毫秒。省略时使用剩余的播放时间。 */
|
|
182
|
+
digitDuration?: number;
|
|
183
|
+
/** high-to-low 从高位开始,low-to-high 从低位开始。 */
|
|
184
|
+
digitOrder?: "high-to-low" | "low-to-high";
|
|
185
|
+
/** 数值区域的自定义逐帧样式,可与内置效果组合。 */
|
|
186
|
+
animationStyle?: (context: HysAnimatedNumberContext) => StyleValue;
|
|
187
|
+
/** 为起点和终点文本预留宽度,并保留当前内容的自然宽度。 */
|
|
188
|
+
stableWidth?: boolean;
|
|
189
|
+
/** plain 常规数字、panel 逐位面板、display 大屏数字。默认 plain。 */
|
|
190
|
+
appearance?: "plain" | "panel" | "display";
|
|
191
|
+
/** 启用正负值的语义配色。 */
|
|
192
|
+
colorBySign?: boolean;
|
|
193
|
+
/** 按最近一次目标值增减配色,优先于 colorBySign。 */
|
|
194
|
+
colorByDirection?: boolean;
|
|
195
|
+
/** 差值绝对值达到此阈值时标记 significant 并触发 threshold 事件。 */
|
|
196
|
+
changeThreshold?: HysNumberValue;
|
|
197
|
+
/** 展示统计标题,title 插槽优先。 */
|
|
198
|
+
title?: string;
|
|
199
|
+
/** 数值前的文本,prefix 插槽优先。 */
|
|
200
|
+
prefix?: string;
|
|
201
|
+
/** 数值后的文本,suffix 插槽优先。 */
|
|
202
|
+
suffix?: string;
|
|
203
|
+
/** 应用到数值区域的 Vue 样式。 */
|
|
204
|
+
valueStyle?: StyleValue;
|
|
205
|
+
/** 接收当前值、格式文本、播放状态与趋势,可返回文字或 VNode。 */
|
|
206
|
+
formatter?: (context: HysAnimatedNumberContext) => VNodeChild;
|
|
207
|
+
/** 朗读结束值和倒计时结束值。默认静默更新。 */
|
|
208
|
+
announce?: boolean;
|
|
209
|
+
/** 启用截止时间倒计时,传 Unix 毫秒时间戳或 Date。 */
|
|
210
|
+
deadline?: number | Date;
|
|
211
|
+
/** 倒计时模板支持 D、DD、H、HH、m、mm、s、ss、SSS,字面文本使用方括号。 */
|
|
212
|
+
format?: string;
|
|
213
|
+
}
|
|
214
|
+
export interface HysAnimatedNumberInstance extends HysNumberControls {
|
|
215
|
+
displayValue: string;
|
|
216
|
+
remaining: number;
|
|
217
|
+
frame: HysNumberFrame;
|
|
218
|
+
trend: HysNumberTrend;
|
|
219
|
+
setValue: (target: HysNumberValue) => void;
|
|
220
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { HysNumberEffect } from "./animatedNumber";
|
|
2
|
+
import type { NumberPresentation } from "./animatedNumberFormat";
|
|
3
|
+
export declare const digitEffects: readonly HysNumberEffect[];
|
|
4
|
+
type DigitSection = "integer" | "fraction";
|
|
5
|
+
export declare function digitCount(parts: Intl.NumberFormatPart[]): number;
|
|
6
|
+
export interface DigitToken {
|
|
7
|
+
key: string;
|
|
8
|
+
text: string;
|
|
9
|
+
type: Intl.NumberFormatPartTypes;
|
|
10
|
+
position: number;
|
|
11
|
+
section?: DigitSection;
|
|
12
|
+
}
|
|
13
|
+
export declare function numberTokens(parts: Intl.NumberFormatPart[], split: boolean): DigitToken[];
|
|
14
|
+
export declare function createDigitTracks(start: NumberPresentation, end: NumberPresentation, glyphs: string[]): (token: DigitToken) => {
|
|
15
|
+
offset: number;
|
|
16
|
+
destination: number;
|
|
17
|
+
steps: number;
|
|
18
|
+
carry: {
|
|
19
|
+
start: number;
|
|
20
|
+
end: number;
|
|
21
|
+
} | undefined;
|
|
22
|
+
fromPresent: boolean;
|
|
23
|
+
toPresent: boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare function digitMotion(effect: HysNumberEffect, track: ReturnType<ReturnType<typeof createDigitTracks>>, progress: number, index: number, glyphs: string[]): {
|
|
26
|
+
first: string;
|
|
27
|
+
second: string;
|
|
28
|
+
phase: number;
|
|
29
|
+
direction: number;
|
|
30
|
+
changed: boolean;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HysNumberAnimationOptions, HysNumberDirection, HysNumberFormatOptions, HysNumberTrend, HysNumberValue } from "./animatedNumber";
|
|
2
|
+
export declare function numberValue(value: HysNumberValue | undefined): HysNumberValue;
|
|
3
|
+
export declare function bounded(value: number | undefined, fallback: number, min: number, max: number): number;
|
|
4
|
+
export declare function numberDirection(from: HysNumberValue, to: HysNumberValue): HysNumberDirection;
|
|
5
|
+
export declare function numberInterpolation(from: HysNumberValue, to: HysNumberValue): (progress: number) => HysNumberValue;
|
|
6
|
+
export declare function createNumberInterpolator(from: HysNumberValue, to: HysNumberValue, custom: HysNumberAnimationOptions["interpolate"]): (_progress: number, easedProgress: number) => HysNumberValue;
|
|
7
|
+
export declare function numberTrend(previous: HysNumberValue, target: HysNumberValue, threshold?: HysNumberValue): HysNumberTrend;
|
|
8
|
+
export interface NumberPresentation {
|
|
9
|
+
text: string;
|
|
10
|
+
parts: Intl.NumberFormatPart[];
|
|
11
|
+
unit: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function createNumberPresentation(options: HysNumberFormatOptions): {
|
|
14
|
+
format: (raw: HysNumberValue) => NumberPresentation;
|
|
15
|
+
localized: string[];
|
|
16
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { HysNumberEasing, HysNumberValue } from "./animatedNumber";
|
|
2
|
+
import type { createNumberInterpolator } from "./animatedNumberFormat";
|
|
3
|
+
type Tick = (now: number) => void;
|
|
4
|
+
export declare function unsubscribe(tick: Tick): void;
|
|
5
|
+
export declare function subscribe(tick: Tick): void;
|
|
6
|
+
export declare function listenVisibility(update: () => void): void;
|
|
7
|
+
export declare function unlistenVisibility(update: () => void): void;
|
|
8
|
+
export declare function makeEasing(easing?: HysNumberEasing): (progress: number) => number;
|
|
9
|
+
export interface Run {
|
|
10
|
+
from: HysNumberValue;
|
|
11
|
+
to: HysNumberValue;
|
|
12
|
+
interpolate: ReturnType<typeof createNumberInterpolator>;
|
|
13
|
+
easing: ReturnType<typeof makeEasing>;
|
|
14
|
+
duration: number;
|
|
15
|
+
elapsed: number;
|
|
16
|
+
iteration: number;
|
|
17
|
+
loops: number;
|
|
18
|
+
alternate: boolean;
|
|
19
|
+
started: boolean;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -98,5 +98,5 @@ export declare const drawerSizes: {
|
|
|
98
98
|
readonly xl: 960;
|
|
99
99
|
readonly full: "100%";
|
|
100
100
|
};
|
|
101
|
-
export declare const drawerVertical: (placement?: HysDrawerPlacement) => placement is "
|
|
101
|
+
export declare const drawerVertical: (placement?: HysDrawerPlacement) => placement is "bottom" | "top";
|
|
102
102
|
export declare function drawerSize(props: HysDrawerProps): string | number;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { HysNumberEffect } from "./animatedNumber";
|
|
2
|
+
import { type HysNumberAnimationEntry, type HysNumberAnimationName } from "./numberAnimationCatalog";
|
|
3
|
+
export interface HysNumberAnimationConfig {
|
|
4
|
+
/** 内置名称、原有效果名称或 animationPresets 中的预设名。 */
|
|
5
|
+
name: HysNumberAnimationName | HysNumberEffect | (string & {});
|
|
6
|
+
/** 效果强度 0–2。 */
|
|
7
|
+
strength?: number;
|
|
8
|
+
/** 滚动圈数或重复次数 1–12。 */
|
|
9
|
+
cycles?: number;
|
|
10
|
+
/** 数位交错量,按总时长比例指定,范围 0–0.9。 */
|
|
11
|
+
stagger?: number;
|
|
12
|
+
/** 可复现的随机种子。 */
|
|
13
|
+
seed?: number;
|
|
14
|
+
/** 为有方向的效果选择滚动轴。 */
|
|
15
|
+
axis?: "horizontal" | "vertical";
|
|
16
|
+
}
|
|
17
|
+
export type HysNumberAnimationItem = HysNumberAnimationConfig["name"] | HysNumberAnimationConfig;
|
|
18
|
+
export type HysNumberAnimation = HysNumberAnimationItem | readonly HysNumberAnimationItem[];
|
|
19
|
+
export type HysNumberAnimationPresets = Readonly<Record<string, HysNumberAnimation>>;
|
|
20
|
+
export type HysNumberDigitAnimations = Readonly<Record<string, HysNumberAnimation>>;
|
|
21
|
+
export interface ResolvedNumberAnimation extends Omit<HysNumberAnimationConfig, "name"> {
|
|
22
|
+
entry?: HysNumberAnimationEntry;
|
|
23
|
+
effect?: HysNumberEffect;
|
|
24
|
+
}
|
|
25
|
+
export declare function resolveNumberAnimation(animation: unknown, presets?: HysNumberAnimationPresets): ResolvedNumberAnimation[];
|
|
26
|
+
/** 导入可复用的动画配置,名称在实际使用时按预设表解析。 */
|
|
27
|
+
export declare function parseHysNumberAnimation(json: string): readonly HysNumberAnimationConfig[];
|
|
28
|
+
/** 导出动画配置。仅保存名称与可序列化参数。 */
|
|
29
|
+
export declare function stringifyHysNumberAnimation(animation: HysNumberAnimation): string;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Built-in effects, grouped as presented in the documentation. */
|
|
2
|
+
declare const categories: readonly [{
|
|
3
|
+
readonly id: "rolling";
|
|
4
|
+
readonly label: "机械滚动与计数动画";
|
|
5
|
+
readonly entries: readonly [readonly ["drum-roll", "数字滚筒动画", "Drum Roll"], readonly ["gear-counter", "数字齿轮滚动", "Gear Counter"], readonly ["conveyor-counter", "数字传送带动画", "Conveyor Counter"], readonly ["waterfall-counter", "数字瀑布滚动", "Waterfall Counter"], readonly ["spiral-roll", "数字螺旋滚动", "Spiral Roll"], readonly ["inertia-roll", "数字惯性滚动", "Inertia Roll"], readonly ["accelerating-roll", "数字加速滚动", "Accelerating Roll"], readonly ["decelerating-roll", "数字减速滚动", "Decelerating Roll"], readonly ["overshoot-roll", "数字回弹滚动", "Overshoot Roll"], readonly ["damped-roll", "数字阻尼滚动", "Damped Roll"], readonly ["multi-cycle-roll", "数字多圈滚动", "Multi-Cycle Roll"], readonly ["segmented-roll", "数字分段滚动", "Segmented Roll"], readonly ["step-counter", "数字阶梯计数", "Step Counter"], readonly ["jump-counter", "数字跳跃计数", "Jump Counter"], readonly ["differential-roll", "数字差速滚动", "Differential Roll"], readonly ["synchronized-roll", "数字同步滚轮", "Synchronized Roll"], readonly ["asynchronous-roll", "数字异步滚轮", "Asynchronous Roll"], readonly ["sequential-stop", "数字逐位停靠", "Sequential Stop"], readonly ["mechanical-snap", "数字机械卡位", "Mechanical Snap"], readonly ["mileage-tick", "数字里程跳表", "Mileage Tick"]];
|
|
6
|
+
}, {
|
|
7
|
+
readonly id: "spatial";
|
|
8
|
+
readonly label: "3D 立体与翻转动画";
|
|
9
|
+
readonly entries: readonly [readonly ["cube-rotate", "3D 数字立方体旋转", "Cube Rotate"], readonly ["cylinder-rotate", "3D 数字圆柱旋转", "Cylinder Rotate"], readonly ["sphere-rotate", "3D 数字球面旋转", "Sphere Rotate"], readonly ["3d-wheel", "3D 数字轮盘", "3D Wheel"], readonly ["vertical-fold", "数字上下折叠", "Vertical Fold"], readonly ["horizontal-fold", "数字左右折叠", "Horizontal Fold"], readonly ["card-flip", "数字卡片翻页", "Card Flip"], readonly ["calendar-flip", "数字日历翻页", "Calendar Flip"], readonly ["split-flap-clock", "复古翻页时钟", "Split-Flap Clock"], readonly ["blinds-flip", "数字百叶窗翻转", "Blinds Flip"], readonly ["3d-pop-out", "数字立体弹出", "3D Pop Out"], readonly ["3d-retract", "数字立体缩回", "3D Retract"], readonly ["perspective-rotate", "数字透视旋转", "Perspective Rotate"], readonly ["depth-transition", "数字空间穿梭", "Depth Transition"], readonly ["axis-flip", "数字轴向翻转", "Axis Flip"], readonly ["polyhedron-transition", "数字多面体切换", "Polyhedron Transition"], readonly ["3d-floating", "数字立体悬浮", "3D Floating"], readonly ["3d-tilt", "数字立体倾斜", "3D Tilt"], readonly ["3d-compression", "数字立体挤压", "3D Compression"], readonly ["3d-unfold", "数字立体展开", "3D Unfold"]];
|
|
10
|
+
}, {
|
|
11
|
+
readonly id: "morph";
|
|
12
|
+
readonly label: "数字形态变换动画";
|
|
13
|
+
readonly entries: readonly [readonly ["number-morph", "数字形状渐变", "Number Morph"], readonly ["path-morphing", "数字路径变形", "Path Morphing"], readonly ["outline-morph", "数字轮廓变形", "Outline Morph"], readonly ["stroke-rebuild", "数字笔画重组", "Stroke Rebuild"], readonly ["skeleton-morph", "数字骨架变换", "Skeleton Morph"], readonly ["liquid-morph", "数字液态变形", "Liquid Morph"], readonly ["clay-morph", "数字橡皮泥变形", "Clay Morph"], readonly ["melting-number", "数字融化变形", "Melting Number"], readonly ["stretch-morph", "数字拉伸变形", "Stretch Morph"], readonly ["squash-morph", "数字压缩变形", "Squash Morph"], readonly ["twist-morph", "数字扭曲变形", "Twist Morph"], readonly ["rotate-morph", "数字旋转变形", "Rotate Morph"], readonly ["fragment-morph", "数字碎片重组", "Fragment Morph"], readonly ["geometric-morph", "数字几何重构", "Geometric Morph"], readonly ["polyline-morph", "数字折线变形", "Polyline Morph"], readonly ["curve-morph", "数字曲线变形", "Curve Morph"], readonly ["smooth-morph", "数字平滑形变", "Smooth Morph"], readonly ["split-and-merge", "数字分裂与合并", "Split & Merge"], readonly ["character-blend", "数字字符融合", "Character Blend"], readonly ["contour-flow", "数字轮廓流动", "Contour Flow"]];
|
|
14
|
+
}, {
|
|
15
|
+
readonly id: "reveal";
|
|
16
|
+
readonly label: "数字揭示与排版动画";
|
|
17
|
+
readonly entries: readonly [readonly ["digit-reveal", "数字逐字揭示", "Digit Reveal"], readonly ["mask-reveal", "数字遮罩揭示", "Mask Reveal"], readonly ["wipe-reveal", "数字擦除揭示", "Wipe Reveal"], readonly ["scan-reveal", "数字扫描揭示", "Scan Reveal"], readonly ["clip-reveal", "数字裁剪揭示", "Clip Reveal"], readonly ["center-reveal", "数字中心向外展开", "Center Reveal"], readonly ["edge-converge", "数字两侧向中心收拢", "Edge Converge"], readonly ["rise-reveal", "数字从底部升起", "Rise Reveal"], readonly ["drop-reveal", "数字从顶部降落", "Drop Reveal"], readonly ["shutter-reveal", "数字百叶窗揭示", "Shutter Reveal"], readonly ["number-typewriter", "数字打字机效果", "Number Typewriter"], readonly ["handwriting-number", "数字手写绘制", "Handwriting Number"], readonly ["stroke-draw", "数字路径描绘", "Stroke Draw"], readonly ["outline-fill", "数字轮廓填充", "Outline Fill"], readonly ["progressive-fill", "数字渐进填充", "Progressive Fill"], readonly ["wave-fill", "数字波浪填充", "Wave Fill"], readonly ["shine-sweep", "数字遮罩扫光", "Shine Sweep"], readonly ["light-reveal", "数字光束揭示", "Light Reveal"], readonly ["slice-assemble", "数字切片拼接", "Slice Assemble"], readonly ["staggered-reveal", "数字交错揭示", "Staggered Reveal"]];
|
|
18
|
+
}, {
|
|
19
|
+
readonly id: "physics";
|
|
20
|
+
readonly label: "弹性与物理运动动画";
|
|
21
|
+
readonly entries: readonly [readonly ["gravity-drop", "数字重力下落", "Gravity Drop"], readonly ["free-fall", "数字自由落体", "Free Fall"], readonly ["ground-bounce", "数字落地反弹", "Ground Bounce"], readonly ["spring-stretch", "数字弹簧伸缩", "Spring Stretch"], readonly ["rubber-band", "数字橡胶回弹", "Rubber Band"], readonly ["jelly", "数字果冻抖动", "Jelly"], readonly ["squash-and-stretch", "数字弹性挤压", "Squash & Stretch"], readonly ["pendulum", "数字钟摆摆动", "Pendulum"], readonly ["swing", "数字左右摇摆", "Swing"], readonly ["inertia-slide", "数字惯性滑动", "Inertia Slide"], readonly ["magnetic-snap", "数字磁吸定位", "Magnetic Snap"], readonly ["wave-motion", "数字波浪起伏", "Wave Motion"], readonly ["pulse", "数字连续脉冲", "Pulse"], readonly ["breathing", "数字呼吸动画", "Breathing"], readonly ["heartbeat", "数字心跳动画", "Heartbeat"], readonly ["rhythmic-vibration", "数字节奏振动", "Rhythmic Vibration"], readonly ["impact", "数字冲击反馈", "Impact"], readonly ["catapult", "数字弹射入场", "Catapult"], readonly ["spin-pop", "数字旋转弹入", "Spin Pop"], readonly ["elastic-return", "数字弹性归位", "Elastic Return"]];
|
|
22
|
+
}, {
|
|
23
|
+
readonly id: "particles";
|
|
24
|
+
readonly label: "粒子、碎片与流体动画";
|
|
25
|
+
readonly entries: readonly [readonly ["particle-assemble", "数字粒子聚合", "Particle Assemble"], readonly ["particle-dissolve", "数字粒子消散", "Particle Dissolve"], readonly ["particle-rebuild", "数字粒子重组", "Particle Rebuild"], readonly ["pixel-assemble", "数字像素聚合", "Pixel Assemble"], readonly ["pixel-dissolve", "数字像素溶解", "Pixel Dissolve"], readonly ["mosaic-transition", "数字马赛克切换", "Mosaic Transition"], readonly ["fragment-scatter", "数字碎片飞散", "Fragment Scatter"], readonly ["fragment-assemble", "数字碎片拼接", "Fragment Assemble"], readonly ["sand-assemble", "数字沙粒聚合", "Sand Assemble"], readonly ["sand-fall", "数字沙粒坠落", "Sand Fall"], readonly ["smoke-reveal", "数字烟雾显现", "Smoke Reveal"], readonly ["water-ripple", "数字水波扩散", "Water Ripple"], readonly ["liquid-gather", "数字液滴汇聚", "Liquid Gather"], readonly ["liquid-flow", "数字液体流动", "Liquid Flow"], readonly ["ink-spread", "数字墨水扩散", "Ink Spread"], readonly ["ink-rebuild", "数字墨水重组", "Ink Rebuild"], readonly ["light-particle-gather", "数字光点汇聚", "Light Particle Gather"], readonly ["firefly-gather", "数字萤火虫聚合", "Firefly Gather"], readonly ["star-scatter", "数字星光散射", "Star Scatter"], readonly ["particle-burst", "数字粒子爆发", "Particle Burst"]];
|
|
26
|
+
}, {
|
|
27
|
+
readonly id: "digital";
|
|
28
|
+
readonly label: "科技感与赛博数字动画";
|
|
29
|
+
readonly entries: readonly [readonly ["seven-segment-display", "LED 七段数码管", "Seven-Segment Display"], readonly ["sixteen-segment-display", "LED 十六段数码管", "Sixteen-Segment Display"], readonly ["dot-matrix-number", "LED 点阵数字", "Dot Matrix Number"], readonly ["lcd-number", "LCD 液晶数字", "LCD Number"], readonly ["neon-number", "霓虹灯数字", "Neon Number"], readonly ["holographic-number", "全息投影数字", "Holographic Number"], readonly ["matrix-decode", "数字矩阵解码", "Matrix Decode"], readonly ["binary-decode", "数字二进制解码", "Binary Decode"], readonly ["hex-decode", "数字十六进制解码", "Hex Decode"], readonly ["character-scramble", "数字字符扰动", "Character Scramble"], readonly ["glitch", "数字故障闪烁", "Glitch"], readonly ["signal-interference", "数字信号干扰", "Signal Interference"], readonly ["rgb-split", "数字 RGB 色差", "RGB Split"], readonly ["scanline", "数字扫描线", "Scanline"], readonly ["crt-effect", "数字 CRT 复古显示", "CRT Effect"], readonly ["electronic-pulse", "数字电子脉冲", "Electronic Pulse"], readonly ["electric-flow", "数字电流流动", "Electric Flow"], readonly ["energy-charging", "数字能量充能", "Energy Charging"], readonly ["energy-discharge", "数字能量释放", "Energy Discharge"], readonly ["radar-scan", "数字雷达扫描", "Radar Scan"], readonly ["raster-transition", "数字光栅切换", "Raster Transition"], readonly ["pixel-scan", "数字像素扫描", "Pixel Scan"], readonly ["data-stream", "数字数据流切换", "Data Stream"], readonly ["code-rain", "数字代码雨", "Code Rain"], readonly ["terminal-print", "数字终端打印", "Terminal Print"], readonly ["terminal-cursor", "数字终端光标闪烁", "Terminal Cursor"], readonly ["hud-counter", "数字 HUD 仪表显示", "HUD Counter"], readonly ["halo-pulse", "数字光环脉冲", "Halo Pulse"], readonly ["laser-outline", "数字激光描边", "Laser Outline"], readonly ["grid-rebuild", "数字科技网格重组", "Grid Rebuild"]];
|
|
30
|
+
}, {
|
|
31
|
+
readonly id: "data";
|
|
32
|
+
readonly label: "金融、统计与数据可视化动画";
|
|
33
|
+
readonly entries: readonly [readonly ["amount-rise", "金额逐位增长动画"], readonly ["amount-fall", "金额逐位下降动画"], readonly ["fractional-roll", "金额小数位独立滚动"], readonly ["currency-switch", "货币符号切换动画"], readonly ["sign-flip", "正负号翻转动画"], readonly ["grouping-reflow", "数字千分位动态重排"], readonly ["carry-highlight", "数值进位强调动画"], readonly ["borrow-highlight", "数值退位强调动画"], readonly ["trend-up", "数值增长箭头联动"], readonly ["trend-down", "数值下降箭头联动"], readonly ["delta-expand", "数字差值展开动画"], readonly ["percent-change", "数字百分比变化动画"], readonly ["gain-highlight", "数字增幅强调动画"], readonly ["threshold-cross", "数字阈值突破动画"], readonly ["goal-reached", "数字目标达成动画"], readonly ["goal-exceeded", "数字目标超额动画"], readonly ["progress-fill", "数字进度填充动画"], readonly ["ring-progress", "数字环形进度联动"], readonly ["gauge-needle", "数字仪表盘指针联动"], readonly ["trend-line", "数字趋势曲线联动"], readonly ["chart-growth", "数字图表同步增长"], readonly ["ranking-swap", "数字排行榜名次切换"], readonly ["rank-rise", "数字名次跃升动画"], readonly ["rank-fall", "数字名次下降动画"], readonly ["kpi-refresh", "KPI 数值刷新动画"], readonly ["kpi-alert", "KPI 数值异常警示动画"], readonly ["kpi-peak", "KPI 数值峰值强调动画"], readonly ["kpi-trough", "KPI 数值低谷强调动画"], readonly ["live-trade", "实时交易金额跳动动画"], readonly ["live-orders", "实时订单数量增长动画"]];
|
|
34
|
+
}, {
|
|
35
|
+
readonly id: "sequence";
|
|
36
|
+
readonly label: "数字组合与编排动画";
|
|
37
|
+
readonly entries: readonly [readonly ["sequential-start", "多数字依次启动", "Sequential Start"], readonly ["wave-start", "多数字波浪启动", "Wave Start"], readonly ["staircase-start", "多数字阶梯启动", "Staircase Start"], readonly ["center-out", "多数字中心扩散", "Center Out"], readonly ["outside-in", "多数字两侧汇聚", "Outside In"], readonly ["random-start", "多数字随机启动", "Random Start"], readonly ["synchronized-stop", "多数字同步定格", "Synchronized Stop"], readonly ["staggered-stop", "多数字错峰定格", "Staggered Stop"], readonly ["alternating-roll", "多数字交替滚动", "Alternating Roll"], readonly ["relay-roll", "多数字接力滚动", "Relay Roll"], readonly ["chain-transition", "多数字链式变化", "Chain Transition"], readonly ["rhythm-sync", "多数字节奏同步", "Rhythm Sync"], readonly ["cascade", "多数字级联变化", "Cascade"], readonly ["mirror-transition", "多数字镜像变化", "Mirror Transition"], readonly ["grouped-transition", "多数字分组变化", "Grouped Transition"], readonly ["matrix-sequence", "多数字矩阵编排", "Matrix Sequence"], readonly ["path-sequence", "多数字路径编排", "Path Sequence"], readonly ["random-rearrange", "多数字随机重排", "Random Rearrange"], readonly ["row-reveal", "多数字逐行揭示", "Row Reveal"], readonly ["column-reveal", "多数字逐列揭示", "Column Reveal"]];
|
|
38
|
+
}, {
|
|
39
|
+
readonly id: "special";
|
|
40
|
+
readonly label: "特殊展示与创意动画";
|
|
41
|
+
readonly entries: readonly [readonly ["flip-clock", "数字时钟翻页动画"], readonly ["rolling-stopwatch", "数字秒表滚动动画"], readonly ["lottery-draw", "数字彩票摇号动画"], readonly ["raffle-roll", "数字抽奖滚动动画"], readonly ["countdown-sprint", "数字倒计时冲刺动画"], readonly ["milestone", "数字里程碑达成动画"], readonly ["achievement", "数字成就解锁动画"], readonly ["coin-drop", "数字金币掉落动画"], readonly ["coin-stack", "数字金币堆叠动画"], readonly ["reward-burst", "数字奖励爆发动画"], readonly ["fireworks", "数字烟花庆祝动画"], readonly ["confetti", "数字彩带庆祝动画"], readonly ["medal-pop", "数字奖牌弹出动画"], readonly ["badge-light", "数字徽章点亮动画"], readonly ["energy-meter", "数字能量槽充满动画"], readonly ["thermometer", "数字温度计升降动画"], readonly ["battery", "数字电量充放动画"], readonly ["speedometer", "数字速度表加减速动画"], readonly ["water-level", "数字水位上涨下降动画"], readonly ["scale-ticks", "数字刻度尺动态变化动画"]];
|
|
42
|
+
}];
|
|
43
|
+
type Category = (typeof categories)[number];
|
|
44
|
+
export type HysNumberAnimationCategory = Category["id"];
|
|
45
|
+
export type HysNumberAnimationName = Category["entries"][number][0];
|
|
46
|
+
export interface HysNumberAnimationEntry {
|
|
47
|
+
name: HysNumberAnimationName;
|
|
48
|
+
label: string;
|
|
49
|
+
english?: string;
|
|
50
|
+
category: HysNumberAnimationCategory;
|
|
51
|
+
variant: number;
|
|
52
|
+
}
|
|
53
|
+
export declare const hysNumberAnimationCategories: {
|
|
54
|
+
id: "data" | "rolling" | "spatial" | "morph" | "reveal" | "physics" | "particles" | "digital" | "sequence" | "special";
|
|
55
|
+
label: "机械滚动与计数动画" | "3D 立体与翻转动画" | "数字形态变换动画" | "数字揭示与排版动画" | "弹性与物理运动动画" | "粒子、碎片与流体动画" | "科技感与赛博数字动画" | "金融、统计与数据可视化动画" | "数字组合与编排动画" | "特殊展示与创意动画";
|
|
56
|
+
}[];
|
|
57
|
+
export declare const hysNumberAnimationCatalog: readonly HysNumberAnimationEntry[];
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface HysNumberSequenceStep {
|
|
2
|
+
index: number;
|
|
3
|
+
delay: number;
|
|
4
|
+
duration: number;
|
|
5
|
+
reverse: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** 将多实例编排转换为每个实例的顺序、延迟、时长和播放方向。 */
|
|
8
|
+
export declare function createHysNumberSequence(name: string, count: number, options?: {
|
|
9
|
+
duration?: number;
|
|
10
|
+
interval?: number;
|
|
11
|
+
columns?: number;
|
|
12
|
+
seed?: number;
|
|
13
|
+
}): HysNumberSequenceStep[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type ReferenceListeners = {
|
|
2
|
+
[Name in keyof HTMLElementEventMap]?: (event: HTMLElementEventMap[Name]) => void;
|
|
3
|
+
};
|
|
4
|
+
export declare function createPopupReferenceBinding(kind: "tooltip" | "popover", id: string, events: ReferenceListeners): {
|
|
5
|
+
attach: (node: HTMLElement | undefined, open: boolean) => void;
|
|
6
|
+
detach: () => void;
|
|
7
|
+
syncAria: (open: boolean) => void;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component, InputHTMLAttributes, TextareaHTMLAttributes } from "vue";
|
|
1
|
+
import type { Component, InputHTMLAttributes, StyleValue, TextareaHTMLAttributes } from "vue";
|
|
2
2
|
export interface HysInputFormatInfo {
|
|
3
3
|
userTyping: boolean;
|
|
4
4
|
input: string;
|
|
@@ -9,8 +9,20 @@ export interface HysInputCountInfo {
|
|
|
9
9
|
maxLength?: number;
|
|
10
10
|
}
|
|
11
11
|
export type HysInputCountStrategy = boolean | ((value: string) => number);
|
|
12
|
+
export type HysInputSize = "sm" | "md" | "lg" | "small" | "middle" | "default" | "large";
|
|
13
|
+
export interface HysInputModelModifiers {
|
|
14
|
+
lazy?: boolean;
|
|
15
|
+
trim?: boolean;
|
|
16
|
+
number?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface HysTextareaStyle {
|
|
19
|
+
height?: string;
|
|
20
|
+
overflowY?: "auto" | "hidden";
|
|
21
|
+
}
|
|
12
22
|
export interface HysInputProps {
|
|
13
23
|
modelValue?: string | number | null;
|
|
24
|
+
/** Vue v-model 修饰符。lazy 延后写入模型,trim 去首尾空白,number 由 Vue 转换数值。 */
|
|
25
|
+
modelModifiers?: HysInputModelModifiers;
|
|
14
26
|
defaultValue?: string | number | null;
|
|
15
27
|
placeholder?: string;
|
|
16
28
|
type?: string;
|
|
@@ -21,6 +33,12 @@ export interface HysInputProps {
|
|
|
21
33
|
error?: string;
|
|
22
34
|
status?: "error" | "warning" | "success";
|
|
23
35
|
clearable?: boolean;
|
|
36
|
+
/** 清空开关别名,clearable 显式设置时优先。 */
|
|
37
|
+
allowClear?: boolean;
|
|
38
|
+
/** 输入框外侧的附加文字,prepend 插槽优先。 */
|
|
39
|
+
addonBefore?: string;
|
|
40
|
+
/** 输入框外侧的附加文字,append 插槽优先。 */
|
|
41
|
+
addonAfter?: string;
|
|
24
42
|
clearIcon?: Component;
|
|
25
43
|
prefixIcon?: Component;
|
|
26
44
|
suffixIcon?: Component;
|
|
@@ -42,7 +60,7 @@ export interface HysInputProps {
|
|
|
42
60
|
allowInput?: (value: string) => boolean;
|
|
43
61
|
autocomplete?: string;
|
|
44
62
|
name?: string;
|
|
45
|
-
size?:
|
|
63
|
+
size?: HysInputSize;
|
|
46
64
|
rows?: number;
|
|
47
65
|
autosize?: boolean | {
|
|
48
66
|
minRows?: number;
|
|
@@ -50,27 +68,44 @@ export interface HysInputProps {
|
|
|
50
68
|
};
|
|
51
69
|
resize?: "none" | "both" | "horizontal" | "vertical";
|
|
52
70
|
inputProps?: InputHTMLAttributes | TextareaHTMLAttributes;
|
|
71
|
+
/** 应用到原生输入元素的样式。自动高度启用时由组件管理 height 和 overflowY。 */
|
|
72
|
+
inputStyle?: StyleValue;
|
|
73
|
+
/** 原生 inputmode,用于提示移动端键盘布局。 */
|
|
74
|
+
inputmode?: InputHTMLAttributes["inputmode"];
|
|
75
|
+
/** 原生控件的 Tab 顺序。 */
|
|
76
|
+
tabindex?: string | number;
|
|
77
|
+
/** 关联的原生 form 元素 ID,可提交在表单外的输入。 */
|
|
78
|
+
form?: string;
|
|
79
|
+
/** 是否由组件交互触发表单的 change、blur 校验,默认 true。 */
|
|
80
|
+
validateEvent?: boolean;
|
|
53
81
|
autofocus?: boolean;
|
|
54
82
|
selectOnFocus?: boolean;
|
|
55
83
|
bordered?: boolean;
|
|
56
84
|
round?: boolean;
|
|
57
85
|
}
|
|
58
86
|
export interface HysInputInstance {
|
|
87
|
+
element: HTMLInputElement | HTMLTextAreaElement | undefined;
|
|
59
88
|
input: HTMLInputElement | HTMLTextAreaElement | undefined;
|
|
60
89
|
textarea: HTMLTextAreaElement | undefined;
|
|
61
90
|
isComposing: boolean;
|
|
91
|
+
passwordVisible: boolean;
|
|
92
|
+
textareaStyle: HysTextareaStyle;
|
|
62
93
|
focus: (options?: FocusOptions) => void;
|
|
63
94
|
blur: () => void;
|
|
64
95
|
select: () => void;
|
|
65
96
|
clear: () => void;
|
|
66
97
|
resize: () => Promise<void>;
|
|
98
|
+
resizeTextarea: () => Promise<void>;
|
|
67
99
|
setSelectionRange: (start: number, end: number, direction?: "forward" | "backward" | "none") => void;
|
|
68
100
|
scrollTo: (options: ScrollToOptions) => void;
|
|
69
101
|
}
|
|
70
|
-
export type HysTextareaProps = Omit<HysInputProps,
|
|
71
|
-
export interface HysTextareaInstance extends Omit<HysInputInstance,
|
|
102
|
+
export type HysTextareaProps = Omit<HysInputProps, "type" | "showPassword" | "showPasswordOn" | "passwordVisible" | "defaultPasswordVisible">;
|
|
103
|
+
export interface HysTextareaInstance extends Omit<HysInputInstance, "input" | "element" | "passwordVisible"> {
|
|
72
104
|
input: HTMLTextAreaElement | undefined;
|
|
105
|
+
element: HTMLTextAreaElement | undefined;
|
|
73
106
|
}
|
|
107
|
+
export declare function textInputSize(size?: HysInputSize): "sm" | "md" | "lg" | undefined;
|
|
108
|
+
export declare function modelText(value: string, modifiers?: HysInputModelModifiers): string;
|
|
74
109
|
export declare function textCount(value: string, strategy?: HysInputCountStrategy): number;
|
|
75
110
|
export declare function textLimit(value: string, max: number | undefined, strategy?: HysInputCountStrategy): string;
|
|
76
111
|
export declare function textLengthLimit(value?: string | number): number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function registerToastEscape(close: () => void): () => void;
|
|
1
|
+
export declare function registerToastEscape(close: (event: KeyboardEvent) => void, element: () => HTMLElement | undefined): (() => void) | undefined;
|