ice-web-components 1.0.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/LICENSE +21 -0
- package/README.md +487 -0
- package/dist/index.cjs +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.umd.js +1 -0
- package/dist/types/components/ICEAlert.d.ts +28 -0
- package/dist/types/components/ICEAnchor.d.ts +69 -0
- package/dist/types/components/ICEAutoComplete.d.ts +71 -0
- package/dist/types/components/ICEAvatar.d.ts +11 -0
- package/dist/types/components/ICEAvatarGroup.d.ts +40 -0
- package/dist/types/components/ICEBackTop.d.ts +39 -0
- package/dist/types/components/ICEBadge.d.ts +17 -0
- package/dist/types/components/ICEBreadcrumb.d.ts +82 -0
- package/dist/types/components/ICEButton.d.ts +25 -0
- package/dist/types/components/ICECalendar.d.ts +84 -0
- package/dist/types/components/ICECard.d.ts +22 -0
- package/dist/types/components/ICECarousel.d.ts +86 -0
- package/dist/types/components/ICECascader.d.ts +84 -0
- package/dist/types/components/ICECheckBox.d.ts +21 -0
- package/dist/types/components/ICECheckboxGroup.d.ts +75 -0
- package/dist/types/components/ICECollapse.d.ts +49 -0
- package/dist/types/components/ICEColorPicker.d.ts +52 -0
- package/dist/types/components/ICEComment.d.ts +36 -0
- package/dist/types/components/ICEDatePicker.d.ts +90 -0
- package/dist/types/components/ICEDescriptions.d.ts +40 -0
- package/dist/types/components/ICEDrawer.d.ts +59 -0
- package/dist/types/components/ICEDropdown.d.ts +63 -0
- package/dist/types/components/ICEEmpty.d.ts +28 -0
- package/dist/types/components/ICEFloatButton.d.ts +63 -0
- package/dist/types/components/ICEForm.d.ts +48 -0
- package/dist/types/components/ICEFormItem.d.ts +65 -0
- package/dist/types/components/ICEGrid.d.ts +59 -0
- package/dist/types/components/ICEIcon.d.ts +9 -0
- package/dist/types/components/ICEIconTile.d.ts +53 -0
- package/dist/types/components/ICEImagePreview.d.ts +91 -0
- package/dist/types/components/ICEImageView.d.ts +62 -0
- package/dist/types/components/ICEInputNumber.d.ts +54 -0
- package/dist/types/components/ICEKanban.d.ts +85 -0
- package/dist/types/components/ICELabel.d.ts +28 -0
- package/dist/types/components/ICEList.d.ts +59 -0
- package/dist/types/components/ICEMenu.d.ts +48 -0
- package/dist/types/components/ICEModal.d.ts +73 -0
- package/dist/types/components/ICEPagination.d.ts +62 -0
- package/dist/types/components/ICEPanel.d.ts +7 -0
- package/dist/types/components/ICEPasswordField.d.ts +18 -0
- package/dist/types/components/ICEPopconfirm.d.ts +21 -0
- package/dist/types/components/ICEPopover.d.ts +48 -0
- package/dist/types/components/ICEProgressBar.d.ts +37 -0
- package/dist/types/components/ICERadioButton.d.ts +21 -0
- package/dist/types/components/ICERadioGroup.d.ts +71 -0
- package/dist/types/components/ICERate.d.ts +43 -0
- package/dist/types/components/ICEResult.d.ts +30 -0
- package/dist/types/components/ICEScrollPane.d.ts +72 -0
- package/dist/types/components/ICESegmented.d.ts +34 -0
- package/dist/types/components/ICESelect.d.ts +85 -0
- package/dist/types/components/ICESeparator.d.ts +7 -0
- package/dist/types/components/ICESkeleton.d.ts +29 -0
- package/dist/types/components/ICESlider.d.ts +63 -0
- package/dist/types/components/ICESpace.d.ts +51 -0
- package/dist/types/components/ICESpin.d.ts +33 -0
- package/dist/types/components/ICESplitter.d.ts +85 -0
- package/dist/types/components/ICEStatCard.d.ts +14 -0
- package/dist/types/components/ICEStatistic.d.ts +78 -0
- package/dist/types/components/ICESteps.d.ts +31 -0
- package/dist/types/components/ICESvgIcon.d.ts +9 -0
- package/dist/types/components/ICESwitch.d.ts +23 -0
- package/dist/types/components/ICETable.d.ts +250 -0
- package/dist/types/components/ICETabs.d.ts +17 -0
- package/dist/types/components/ICETag.d.ts +15 -0
- package/dist/types/components/ICETextArea.d.ts +8 -0
- package/dist/types/components/ICETextField.d.ts +80 -0
- package/dist/types/components/ICETileMap.d.ts +152 -0
- package/dist/types/components/ICETimePicker.d.ts +81 -0
- package/dist/types/components/ICETimeline.d.ts +33 -0
- package/dist/types/components/ICETooltip.d.ts +55 -0
- package/dist/types/components/ICETour.d.ts +97 -0
- package/dist/types/components/ICETransfer.d.ts +68 -0
- package/dist/types/components/ICETree.d.ts +107 -0
- package/dist/types/components/ICETreeSelect.d.ts +64 -0
- package/dist/types/components/ICETypography.d.ts +67 -0
- package/dist/types/components/ICEUpload.d.ts +75 -0
- package/dist/types/components/ICEVirtualList.d.ts +100 -0
- package/dist/types/components/ICEWatermark.d.ts +49 -0
- package/dist/types/components/ICEWindow.d.ts +159 -0
- package/dist/types/core/ICEContainer.d.ts +10 -0
- package/dist/types/core/ICEFocusManager.d.ts +70 -0
- package/dist/types/core/ICEHoverManager.d.ts +26 -0
- package/dist/types/core/ICEManager.d.ts +24 -0
- package/dist/types/core/ICEMessageManager.d.ts +80 -0
- package/dist/types/core/ICEOverlayManager.d.ts +92 -0
- package/dist/types/core/ICEPainter.d.ts +12 -0
- package/dist/types/core/ICEWidget.d.ts +86 -0
- package/dist/types/i18n/ICEI18n.d.ts +35 -0
- package/dist/types/index.d.ts +111 -0
- package/dist/types/model/ICE2048Model.d.ts +90 -0
- package/dist/types/model/ICEBoundedRangeModel.d.ts +20 -0
- package/dist/types/model/ICEButtonModel.d.ts +16 -0
- package/dist/types/model/ICEFormModel.d.ts +105 -0
- package/dist/types/model/ICEHighScoreModel.d.ts +60 -0
- package/dist/types/model/ICEMinesweeperModel.d.ts +102 -0
- package/dist/types/model/ICESelectionModel.d.ts +31 -0
- package/dist/types/model/ICESnakeModel.d.ts +90 -0
- package/dist/types/model/ICETetrisModel.d.ts +118 -0
- package/dist/types/model/ICEToggleModel.d.ts +14 -0
- package/dist/types/theme/ICEArcadeTheme.d.ts +22 -0
- package/dist/types/theme/ICETheme.d.ts +120 -0
- package/dist/types/util/ICEAccessibilityMirror.d.ts +55 -0
- package/dist/types/util/ICEAnimation.d.ts +71 -0
- package/dist/types/util/ICEDragReorder.d.ts +102 -0
- package/dist/types/util/ICENativeInput.d.ts +65 -0
- package/dist/types/util/ICEOverlayPosition.d.ts +52 -0
- package/dist/types/util/ICEStyle.d.ts +60 -0
- package/dist/types/util/ICEWorldBox.d.ts +14 -0
- package/package.json +56 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
2
|
+
/**
|
|
3
|
+
* 滑块:单值 / 区间双滑块,支持 `step` 量化与方向键微调。
|
|
4
|
+
*/
|
|
5
|
+
export declare class ICESlider extends ICEWidget {
|
|
6
|
+
private model;
|
|
7
|
+
private track;
|
|
8
|
+
private fill;
|
|
9
|
+
private thumb;
|
|
10
|
+
private upperThumb;
|
|
11
|
+
private range;
|
|
12
|
+
private rangeValue;
|
|
13
|
+
private step;
|
|
14
|
+
private activeThumb;
|
|
15
|
+
private dragThumb;
|
|
16
|
+
private minValue;
|
|
17
|
+
private maxValue;
|
|
18
|
+
private dragging;
|
|
19
|
+
private __bound;
|
|
20
|
+
constructor(props?: any);
|
|
21
|
+
/** 是否区间模式(双滑块)。 */
|
|
22
|
+
isRange(): boolean;
|
|
23
|
+
setValue(value: number): this;
|
|
24
|
+
getValue(): number;
|
|
25
|
+
/** 区间取值 [下界, 上界];单值模式返回 null。 */
|
|
26
|
+
getRangeValue(): [number, number] | null;
|
|
27
|
+
/** 设置区间:各自夹取到 [min,max],反序时自动交换。 */
|
|
28
|
+
setRangeValue(value: [number, number] | number[]): this;
|
|
29
|
+
getThumbs(): any[];
|
|
30
|
+
/** 当前操作中的滑块(键盘调整 / 拖动高亮用)。 */
|
|
31
|
+
getActiveThumb(): 'lower' | 'upper';
|
|
32
|
+
setActiveThumb(thumb: 'lower' | 'upper'): this;
|
|
33
|
+
/**
|
|
34
|
+
* 按比例(0..1)落值。
|
|
35
|
+
*
|
|
36
|
+
* - 单值模式:直接设置;
|
|
37
|
+
* - 区间模式:`thumb` 省略时取「离哪个滑块近」,拖动过程中由调用方传入锁定的滑块,
|
|
38
|
+
* 两个滑块互相夹取、不会穿过(与 Ant Range 一致)。
|
|
39
|
+
*/
|
|
40
|
+
setValueFromRatio(ratio: number, thumb?: 'lower' | 'upper'): this;
|
|
41
|
+
getFormValue(): any;
|
|
42
|
+
setFormValue(value: any): void;
|
|
43
|
+
protected afterAddHandler(): void;
|
|
44
|
+
private __bindGlobalEvents;
|
|
45
|
+
private __onGlobalMouseDown;
|
|
46
|
+
private __onGlobalMouseMove;
|
|
47
|
+
private __onGlobalMouseUp;
|
|
48
|
+
/** 方向键按 step 调值(区间模式调当前滑块,默认下界)。 */
|
|
49
|
+
private __onKeyDown;
|
|
50
|
+
private __isPointInside;
|
|
51
|
+
private __updateFromEvent;
|
|
52
|
+
protected __applyHoverState(): void;
|
|
53
|
+
/** 按 step 相对 min 量化;step ≤ 0 时保持连续取值。 */
|
|
54
|
+
private __quantize;
|
|
55
|
+
/** 把任意入参整理成 [下界, 上界](量化 + 夹取 + 反序交换)。 */
|
|
56
|
+
private __normalizeRange;
|
|
57
|
+
private __ratio;
|
|
58
|
+
private __thumbStyle;
|
|
59
|
+
private __thumbLeft;
|
|
60
|
+
private __upperThumbLeft;
|
|
61
|
+
private __fillWidth;
|
|
62
|
+
private __sync;
|
|
63
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ICEContainer } from '../core/ICEContainer';
|
|
2
|
+
/**
|
|
3
|
+
* 间距容器(Ant Space / Flex 的最小版):按固定间距排列一组子组件。
|
|
4
|
+
*
|
|
5
|
+
* - `direction: 'horizontal'`(默认)横向排列,`'vertical'` 纵向排列;
|
|
6
|
+
* - `size` 是子项间距(默认 8);
|
|
7
|
+
* - 交叉轴对齐 `align: 'start' | 'center' | 'end'`;
|
|
8
|
+
* - `wrap: true` 时横向超出容器宽度换行;
|
|
9
|
+
* - 不传 width / height 时按内容自适应,加了子项就自动重排。
|
|
10
|
+
*
|
|
11
|
+
* 注:布局本身由本组件完成(不是引擎的 `ICEFlowLayout`)——因为 Space 需要同时处理
|
|
12
|
+
* 交叉轴对齐与「按内容回写自身尺寸」,这两件事引擎布局器不管。
|
|
13
|
+
*/
|
|
14
|
+
export interface ICESpaceOptions {
|
|
15
|
+
/** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
|
|
16
|
+
id?: string;
|
|
17
|
+
direction?: 'horizontal' | 'vertical';
|
|
18
|
+
/** 子项间距,默认 8 */
|
|
19
|
+
size?: number;
|
|
20
|
+
align?: 'start' | 'center' | 'end';
|
|
21
|
+
wrap?: boolean;
|
|
22
|
+
left?: number;
|
|
23
|
+
top?: number;
|
|
24
|
+
width?: number;
|
|
25
|
+
height?: number;
|
|
26
|
+
}
|
|
27
|
+
export declare class ICESpace extends ICEContainer {
|
|
28
|
+
private items;
|
|
29
|
+
private direction;
|
|
30
|
+
private gap;
|
|
31
|
+
private align;
|
|
32
|
+
private wrap;
|
|
33
|
+
private autoWidth;
|
|
34
|
+
private autoHeight;
|
|
35
|
+
constructor(props?: ICESpaceOptions);
|
|
36
|
+
/** 子项列表(按加入顺序)。 */
|
|
37
|
+
getItems(): any[];
|
|
38
|
+
setSize(size: number): this;
|
|
39
|
+
getSize(): number;
|
|
40
|
+
setAlign(align: 'start' | 'center' | 'end'): this;
|
|
41
|
+
/** 加入一个子项并立即重排。 */
|
|
42
|
+
addItem(child: any): this;
|
|
43
|
+
/** 直接 `addChild` 也当作子项处理(保持容器语义)。 */
|
|
44
|
+
addChild(child: any, markDirty?: boolean): void;
|
|
45
|
+
removeItem(child: any): this;
|
|
46
|
+
revalidate(): this;
|
|
47
|
+
/** 交叉轴偏移。 */
|
|
48
|
+
private __crossOffset;
|
|
49
|
+
private __layout;
|
|
50
|
+
private __markDirty;
|
|
51
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ICEPath } from 'ice-render';
|
|
2
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
3
|
+
/** 旋转弧线:用 Path2D 画一段 270° 圆弧,颜色走主色。 */
|
|
4
|
+
declare class ICESpinArc extends ICEPath {
|
|
5
|
+
constructor(props?: any);
|
|
6
|
+
protected createPathObject(): any;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 加载指示器(Ant Spin 的最小版):一段圆弧绕中心旋转。
|
|
10
|
+
*
|
|
11
|
+
* - 旋转复用引擎的动画系统(`transform.rotate` 0→360 循环),与蚂蚁线同一套路;
|
|
12
|
+
* - `spinning: false` 停止旋转(弧线保持显示);`tip` 可在右侧显示提示文字。
|
|
13
|
+
*/
|
|
14
|
+
export interface ICESpinOptions {
|
|
15
|
+
size?: number;
|
|
16
|
+
spinning?: boolean;
|
|
17
|
+
tip?: string;
|
|
18
|
+
color?: string;
|
|
19
|
+
left?: number;
|
|
20
|
+
top?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare class ICESpin extends ICEWidget {
|
|
23
|
+
private arc;
|
|
24
|
+
private spinning;
|
|
25
|
+
constructor(props?: ICESpinOptions);
|
|
26
|
+
protected afterAddHandler(): void;
|
|
27
|
+
isSpinning(): boolean;
|
|
28
|
+
getArcNode(): ICESpinArc;
|
|
29
|
+
setSpinning(spinning: boolean): this;
|
|
30
|
+
private __startSpin;
|
|
31
|
+
private __stopSpin;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
2
|
+
/** 分隔条:悬停 / 拖动时高亮(视觉状态自己维护,父组件只管拖动逻辑)。 */
|
|
3
|
+
declare class ICESplitterDivider extends ICEWidget {
|
|
4
|
+
private active;
|
|
5
|
+
constructor(props?: any);
|
|
6
|
+
setActive(active: boolean): this;
|
|
7
|
+
protected __applyHoverState(): void;
|
|
8
|
+
private __sync;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 分隔面板(Ant Splitter):两栏 + 可拖动的分隔条。
|
|
12
|
+
*
|
|
13
|
+
* - `direction: 'horizontal'`(默认)左右分栏,`'vertical'` 上下分栏;
|
|
14
|
+
* - `size` 是第一栏的像素尺寸,夹取范围 `[min, 容器尺寸 - dividerSize - min]`;
|
|
15
|
+
* - 拖动分隔条改变尺寸(mousedown 必须落在分隔条上),拖动中触发 `resize`
|
|
16
|
+
* (载荷 `{ size }`)与 `onResize`;
|
|
17
|
+
* - 两栏是调用方传进来的组件,本组件只负责摆位置与改尺寸。
|
|
18
|
+
*/
|
|
19
|
+
export interface ICESplitterOptions {
|
|
20
|
+
/** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
|
|
21
|
+
id?: string;
|
|
22
|
+
/** horizontal = 左右分栏(默认),vertical = 上下分栏 */
|
|
23
|
+
direction?: 'horizontal' | 'vertical';
|
|
24
|
+
/** 第一栏尺寸(像素) */
|
|
25
|
+
size?: number;
|
|
26
|
+
/** 两栏最小尺寸,默认 40 */
|
|
27
|
+
min?: number;
|
|
28
|
+
/** 分隔条粗细,默认 6 */
|
|
29
|
+
dividerSize?: number;
|
|
30
|
+
/** 第一栏组件 */
|
|
31
|
+
first?: any;
|
|
32
|
+
/** 第二栏组件 */
|
|
33
|
+
second?: any;
|
|
34
|
+
left?: number;
|
|
35
|
+
top?: number;
|
|
36
|
+
width?: number;
|
|
37
|
+
height?: number;
|
|
38
|
+
onResize?: (size: number) => void;
|
|
39
|
+
}
|
|
40
|
+
export declare class ICESplitter extends ICEWidget {
|
|
41
|
+
private direction;
|
|
42
|
+
/** 调用方要的尺寸(不被「当下容器的夹取」覆盖,容器变大后能恢复) */
|
|
43
|
+
private requestedSize;
|
|
44
|
+
private size;
|
|
45
|
+
private min;
|
|
46
|
+
private dividerSize;
|
|
47
|
+
private first;
|
|
48
|
+
private second;
|
|
49
|
+
private divider;
|
|
50
|
+
private onResize;
|
|
51
|
+
private dragging;
|
|
52
|
+
private bound;
|
|
53
|
+
private laying;
|
|
54
|
+
constructor(props: ICESplitterOptions);
|
|
55
|
+
/** 当前第一栏尺寸。 */
|
|
56
|
+
getSize(): number;
|
|
57
|
+
/** 第一栏占比(0..1)。 */
|
|
58
|
+
getRatio(): number;
|
|
59
|
+
setRatio(ratio: number): this;
|
|
60
|
+
setSize(size: number): this;
|
|
61
|
+
getDividerNode(): ICESplitterDivider;
|
|
62
|
+
getFirstNode(): any;
|
|
63
|
+
getSecondNode(): any;
|
|
64
|
+
protected afterAddHandler(): void;
|
|
65
|
+
/** 自身尺寸变化后重排两栏(引擎在 setState 尺寸变化时会调这个钩子)。 */
|
|
66
|
+
revalidate(): this;
|
|
67
|
+
/** 自身尺寸被程序式改动(setState)时也要重排两栏(引擎只回调这个钩子)。 */
|
|
68
|
+
protected __afterStateMerge(sizeChanged: boolean): void;
|
|
69
|
+
protected __applyHoverState(): void;
|
|
70
|
+
/** 拖动手柄的可视反馈。 */
|
|
71
|
+
private __syncDivider;
|
|
72
|
+
/** 第一栏可用的最大尺寸:容器减去分隔条与第二栏最小尺寸。 */
|
|
73
|
+
private __max;
|
|
74
|
+
private __total;
|
|
75
|
+
private __clamp;
|
|
76
|
+
private __layout;
|
|
77
|
+
private __onGlobalMouseDown;
|
|
78
|
+
private __onGlobalMouseMove;
|
|
79
|
+
private __onGlobalMouseUp;
|
|
80
|
+
/** 是否可拖动:分隔条自身 + 2px 容错(细条不好瞄)。 */
|
|
81
|
+
isDragging(): boolean;
|
|
82
|
+
private __isOnDivider;
|
|
83
|
+
private __updateFromEvent;
|
|
84
|
+
}
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ICEPanel } from './ICEPanel';
|
|
2
|
+
/**
|
|
3
|
+
* 统计卡:图标 + 标题 + 数值 + 涨跌趋势,用于仪表盘顶部指标。
|
|
4
|
+
*/
|
|
5
|
+
export declare class ICEStatCard extends ICEPanel {
|
|
6
|
+
private valueNode;
|
|
7
|
+
private titleNode;
|
|
8
|
+
private trendNode;
|
|
9
|
+
private iconNode;
|
|
10
|
+
constructor(props?: any);
|
|
11
|
+
setValue(value: string | number): this;
|
|
12
|
+
setTitle(title: string): this;
|
|
13
|
+
setTrend(trend: string): this;
|
|
14
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
2
|
+
/**
|
|
3
|
+
* 数值格式化:精度 + 可选千分位;非数字(如「暂缺」)原样返回。
|
|
4
|
+
* 负数先取绝对值分组,再把符号补回去(`-1234567.5` → `-1,234,567.5`)。
|
|
5
|
+
*/
|
|
6
|
+
export declare function formatStatisticValue(value: number | string, precision?: number, group?: boolean): string;
|
|
7
|
+
/**
|
|
8
|
+
* 倒计时格式:`N 天 HH:mm:ss`;不足一天时省略「N 天」。
|
|
9
|
+
* 负数按 0 处理(归零后不再显示 -00:00:01 这种反人类文案)。
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatCountdown(ms: number): string;
|
|
12
|
+
/**
|
|
13
|
+
* 统计数值(Ant Statistic):标题 + 大号数字 + 前缀/后缀,支持千分位与精度。
|
|
14
|
+
*
|
|
15
|
+
* 传 `countdown`(剩余毫秒)时进入倒计时模式:按「N 天 HH:mm:ss」显示剩余时间,
|
|
16
|
+
* 归零触发 `finish` 事件与 `onFinish` 回调(Ant 的 `Statistic.Countdown`)。
|
|
17
|
+
*/
|
|
18
|
+
export interface ICEStatisticOptions {
|
|
19
|
+
/** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
|
|
20
|
+
id?: string;
|
|
21
|
+
title?: string;
|
|
22
|
+
value?: number | string;
|
|
23
|
+
/** 小数位数,默认 0 */
|
|
24
|
+
precision?: number;
|
|
25
|
+
/** 千分位分隔,默认 false */
|
|
26
|
+
groupSeparator?: boolean;
|
|
27
|
+
prefix?: string;
|
|
28
|
+
suffix?: string;
|
|
29
|
+
/** 数值颜色状态(默认正文色) */
|
|
30
|
+
status?: 'default' | 'primary' | 'success' | 'warning' | 'error' | 'info';
|
|
31
|
+
/** 倒计时剩余毫秒;给了就进入倒计时模式 */
|
|
32
|
+
countdown?: number;
|
|
33
|
+
/** 倒计时是否自动开始(默认 true;测试里可关掉,避免挂定时器) */
|
|
34
|
+
autoStart?: boolean;
|
|
35
|
+
/** 倒计时归零回调(与 `finish` 事件同义) */
|
|
36
|
+
onFinish?: () => void;
|
|
37
|
+
left?: number;
|
|
38
|
+
top?: number;
|
|
39
|
+
width?: number;
|
|
40
|
+
height?: number;
|
|
41
|
+
fontSize?: number;
|
|
42
|
+
}
|
|
43
|
+
export declare class ICEStatistic extends ICEWidget {
|
|
44
|
+
private titleNode;
|
|
45
|
+
private valueNode;
|
|
46
|
+
private precision;
|
|
47
|
+
private group;
|
|
48
|
+
private prefix;
|
|
49
|
+
private suffix;
|
|
50
|
+
private countdownMode;
|
|
51
|
+
private remaining;
|
|
52
|
+
private running;
|
|
53
|
+
private handle;
|
|
54
|
+
private onFinish;
|
|
55
|
+
private rawValue;
|
|
56
|
+
constructor(props: ICEStatisticOptions);
|
|
57
|
+
getTitleText(): string;
|
|
58
|
+
getValueText(): string;
|
|
59
|
+
setTitle(title: string): this;
|
|
60
|
+
/** 普通模式:改数值(字符串原样显示)。 */
|
|
61
|
+
setValue(value: number | string): this;
|
|
62
|
+
getValue(): number | string;
|
|
63
|
+
isCountdown(): boolean;
|
|
64
|
+
getRemaining(): number;
|
|
65
|
+
isRunning(): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* 设置剩余毫秒。≤ 0 视为归零:文案变 `00:00:00`,停止计时并触发完成回调。
|
|
68
|
+
*/
|
|
69
|
+
setCountdown(ms: number): this;
|
|
70
|
+
/** 开始(或继续)倒计时。 */
|
|
71
|
+
start(): this;
|
|
72
|
+
/** 暂停倒计时(保留剩余时间)。 */
|
|
73
|
+
stop(): this;
|
|
74
|
+
private __stopTween;
|
|
75
|
+
private __syncCountdownText;
|
|
76
|
+
private __syncValueText;
|
|
77
|
+
private __finish;
|
|
78
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
2
|
+
/**
|
|
3
|
+
* 步骤条(Ant Steps):横向序号 + 标题/描述 + 连接线,当前步骤高亮、已完成打勾。
|
|
4
|
+
*/
|
|
5
|
+
export interface ICEStepsItem {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ICEStepsOptions {
|
|
10
|
+
/** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
|
|
11
|
+
id?: string;
|
|
12
|
+
items: ICEStepsItem[];
|
|
13
|
+
current?: number;
|
|
14
|
+
left?: number;
|
|
15
|
+
top?: number;
|
|
16
|
+
width?: number;
|
|
17
|
+
circleSize?: number;
|
|
18
|
+
onChange?: (current: number) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare class ICESteps extends ICEWidget {
|
|
21
|
+
private items;
|
|
22
|
+
private current;
|
|
23
|
+
private circleSize;
|
|
24
|
+
private stepNodes;
|
|
25
|
+
private onChange;
|
|
26
|
+
constructor(props: ICEStepsOptions);
|
|
27
|
+
getCurrent(): number;
|
|
28
|
+
setCurrent(current: number): this;
|
|
29
|
+
getStepNode(index: number): ICEWidget | null;
|
|
30
|
+
private __render;
|
|
31
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
2
|
+
/**
|
|
3
|
+
* 开关:点击或 Enter/Space 切换,滑块带过渡动画,触发 `change`。
|
|
4
|
+
*/
|
|
5
|
+
export declare class ICESwitch extends ICEWidget {
|
|
6
|
+
private model;
|
|
7
|
+
private track;
|
|
8
|
+
private knob;
|
|
9
|
+
private knobTravel;
|
|
10
|
+
constructor(props?: any);
|
|
11
|
+
isSelected(): boolean;
|
|
12
|
+
setSelected(selected: boolean): this;
|
|
13
|
+
getFormValue(): any;
|
|
14
|
+
setFormValue(value: any): void;
|
|
15
|
+
/** 键盘激活(Enter / Space)与鼠标点击同义:切换开关。 */
|
|
16
|
+
activate(): void;
|
|
17
|
+
protected initEvents(): void;
|
|
18
|
+
/** 禁用的控件不响应鼠标(与 `activate()` 的键盘路径保持一致)。 */
|
|
19
|
+
private __toggle;
|
|
20
|
+
protected __applyHoverState(): void;
|
|
21
|
+
private __sync;
|
|
22
|
+
private __knobGap;
|
|
23
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
2
|
+
import { ICECheckBox } from './ICECheckBox';
|
|
3
|
+
import { ICEPagination } from './ICEPagination';
|
|
4
|
+
import { ICEDropTarget } from '../util/ICEDragReorder';
|
|
5
|
+
export declare type ICETableColumn = {
|
|
6
|
+
key: string;
|
|
7
|
+
title: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
/** 固定列:横向滚动时钉在左边不跟着滚(宽表的常用约定) */
|
|
10
|
+
fixed?: boolean;
|
|
11
|
+
/** 拖拽缩列时的最小宽度(不传用表格的 `minColumnWidth`,默认 60) */
|
|
12
|
+
minWidth?: number;
|
|
13
|
+
align?: 'left' | 'center' | 'right';
|
|
14
|
+
/** 表头可排序:`true` 用默认比较(数值按数值、其余按字典序),或传自定义比较函数 */
|
|
15
|
+
sorter?: boolean | ((a: ICETableRow, b: ICETableRow) => number);
|
|
16
|
+
renderCell?: (value: string, row: ICETableRow, column: ICETableColumn, meta: {
|
|
17
|
+
cellWidth: number;
|
|
18
|
+
cellHeight: number;
|
|
19
|
+
align: 'left' | 'center' | 'right';
|
|
20
|
+
}) => any | null;
|
|
21
|
+
};
|
|
22
|
+
export declare type ICETableRow = Record<string, any>;
|
|
23
|
+
/**
|
|
24
|
+
* 列宽求解(纯函数,方便单测)。
|
|
25
|
+
*
|
|
26
|
+
* 规则:
|
|
27
|
+
* - 显式 `width` 优先,且不低于 `minWidth`;
|
|
28
|
+
* - 剩下的宽度在所有「自动列」(没给 width 的)之间均分;
|
|
29
|
+
* - 均分后仍小于最小宽度的,抬到最小宽度 —— 此时**总和可能超过 totalWidth**,
|
|
30
|
+
* 这是有意的(宽表就该横向溢出,由调用方决定要不要横向滚动),不在函数里悄悄压扁。
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveColumnWidths(columns: Array<{
|
|
33
|
+
width?: number;
|
|
34
|
+
minWidth?: number;
|
|
35
|
+
}>, totalWidth: number, defaultMinWidth?: number): number[];
|
|
36
|
+
export interface ICETableSortState {
|
|
37
|
+
key: string;
|
|
38
|
+
order: 'asc' | 'desc';
|
|
39
|
+
}
|
|
40
|
+
export interface ICETablePaginationOptions {
|
|
41
|
+
pageSize?: number;
|
|
42
|
+
/** 初始页码(从 1 开始) */
|
|
43
|
+
page?: number;
|
|
44
|
+
showTotal?: boolean;
|
|
45
|
+
/** 换页回调(与 `pagechange` 事件同义) */
|
|
46
|
+
onChange?: (page: number, pageSize: number) => void;
|
|
47
|
+
}
|
|
48
|
+
export declare type ICETableSelectionMode = 'none' | 'single' | 'multiple';
|
|
49
|
+
/**
|
|
50
|
+
* 表格:列定义(宽度 / 对齐 / 排序 / 自定义单元格)+ 行选择 + 分页 + 空态 + 悬停/斑马纹。
|
|
51
|
+
*
|
|
52
|
+
* - 点表头排序:升 → 降 → 恢复,`sorter` 可为布尔或自定义比较函数;
|
|
53
|
+
* - 行选择 `rowSelection: 'none' | 'single'(默认)| 'multiple'`:多选时最左侧多出
|
|
54
|
+
* 40px 选择列(表头全选 + 每行复选框),`getSelectedRows()` / `selectAll()` /
|
|
55
|
+
* `clearSelection()` 配合批量操作;选择变化触发 `selectionchange` 与 `onSelectionChange`;
|
|
56
|
+
* - `pagination: { pageSize, page, showTotal, onChange }`:只渲染当前页并挂出 `ICEPagination`;
|
|
57
|
+
* - 没有数据时渲染 `ICEEmpty` 空态(不会留一片空白)。
|
|
58
|
+
*/
|
|
59
|
+
export declare class ICETable extends ICEWidget {
|
|
60
|
+
private columns;
|
|
61
|
+
/** 原始数据(排序前的顺序,用于第三次点击恢复) */
|
|
62
|
+
private sourceData;
|
|
63
|
+
/** 排序后的全量数据(分页从这里切片) */
|
|
64
|
+
private sortedData;
|
|
65
|
+
/** 当前页要渲染的行(不分页时等于 sortedData) */
|
|
66
|
+
private data;
|
|
67
|
+
private pageSize;
|
|
68
|
+
private page;
|
|
69
|
+
private paginationOptions;
|
|
70
|
+
private paginationNode;
|
|
71
|
+
private sortKey;
|
|
72
|
+
private sortOrder;
|
|
73
|
+
private rowPanels;
|
|
74
|
+
private cellNodes;
|
|
75
|
+
private selectedIndex;
|
|
76
|
+
/** 多选模式下的选中行(当前页内的下标,按行序) */
|
|
77
|
+
private selectedIndexes;
|
|
78
|
+
private selectionMode;
|
|
79
|
+
private selectionNodes;
|
|
80
|
+
private headerCheckbox;
|
|
81
|
+
private onSelectionChange;
|
|
82
|
+
/** 选择列宽度(多选时内容列整体右移这么多) */
|
|
83
|
+
private static readonly SELECTION_WIDTH;
|
|
84
|
+
/** 上一次渲染用的宽度:宽度变了要多渲染一次(否则列宽不更新) */
|
|
85
|
+
private renderedWidth;
|
|
86
|
+
/** 鼠标悬停行(-1 = 无);只影响底色,不影响选中 */
|
|
87
|
+
private hoveredIndex;
|
|
88
|
+
private rowHeight;
|
|
89
|
+
private headerHeight;
|
|
90
|
+
private onSelect;
|
|
91
|
+
/** 拖拽缩列后的宽度覆盖(列 key → 宽度);不动原始 columns 定义 */
|
|
92
|
+
private columnWidthOverrides;
|
|
93
|
+
/** 是否允许拖表头边界缩列 */
|
|
94
|
+
private resizable;
|
|
95
|
+
private minColumnWidth;
|
|
96
|
+
private onColumnResize;
|
|
97
|
+
/** 拖拽状态:{ key, index, startX, startWidth } */
|
|
98
|
+
private resizeState;
|
|
99
|
+
/** 可滚动模式:虚拟行(`virtual`)或存在固定列时启用;旧路径保持原样 */
|
|
100
|
+
private scrollable;
|
|
101
|
+
private virtual;
|
|
102
|
+
private bodyPane;
|
|
103
|
+
private headerPane;
|
|
104
|
+
private bodyContent;
|
|
105
|
+
private frozenLayer;
|
|
106
|
+
private frozenContent;
|
|
107
|
+
private rowWindow;
|
|
108
|
+
private virtualScrollTop;
|
|
109
|
+
private virtualScrollLeft;
|
|
110
|
+
private rowNodes;
|
|
111
|
+
private frozenRowNodes;
|
|
112
|
+
private virtualBuffer;
|
|
113
|
+
/** 可滚动模式下的内容宽度(列多到装不下时 > 视口宽度) */
|
|
114
|
+
private renderedContentWidth;
|
|
115
|
+
/** 行拖拽排序:开启后按住行上下拖就能改顺序 */
|
|
116
|
+
private rowDraggable;
|
|
117
|
+
private onRowReorder;
|
|
118
|
+
/** 拖拽状态:源行下标 + 当前落点 + 指示线节点 */
|
|
119
|
+
private dragRow;
|
|
120
|
+
private __bound;
|
|
121
|
+
constructor(props?: any);
|
|
122
|
+
setData(data: ICETableRow[]): this;
|
|
123
|
+
/** 全量行数(排序后、分页前的总数)。 */
|
|
124
|
+
getTotalRows(): number;
|
|
125
|
+
/** 总页数;不分页时为 1。 */
|
|
126
|
+
getPageCount(): number;
|
|
127
|
+
getPage(): number;
|
|
128
|
+
getPageSize(): number;
|
|
129
|
+
/** 换页:夹取到 [1, pageCount],重新渲染并回调。 */
|
|
130
|
+
setPage(page: number): this;
|
|
131
|
+
setPageSize(pageSize: number): this;
|
|
132
|
+
/** 分页器节点(不分页 / 空数据时为 null)。 */
|
|
133
|
+
getPaginationNode(): ICEPagination | null;
|
|
134
|
+
/** 当前渲染顺序的数据(排序后)。 */
|
|
135
|
+
getRows(): ICETableRow[];
|
|
136
|
+
getSortState(): ICETableSortState | null;
|
|
137
|
+
/** 表头文案(排序中的列带 ▲/▼ 指示)。 */
|
|
138
|
+
getHeaderLabel(key: string): string;
|
|
139
|
+
/** 点表头:升序 → 降序 → 恢复原始顺序。 */
|
|
140
|
+
toggleSort(key: string): this;
|
|
141
|
+
/** 显式设置排序(`order: null` 恢复原始顺序)。 */
|
|
142
|
+
sortBy(key: string, order: 'asc' | 'desc' | null): this;
|
|
143
|
+
/** 按当前页/每页条数切出要渲染的行,并把高度(含分页器 / 空态)算好。 */
|
|
144
|
+
private __applyPage;
|
|
145
|
+
/** 分页器区域高度(分页器本体 32 + 上下留白)。 */
|
|
146
|
+
private __footerHeight;
|
|
147
|
+
setSelectedRow(index: number): this;
|
|
148
|
+
getSelectedIndex(): number;
|
|
149
|
+
getSelectionMode(): ICETableSelectionMode;
|
|
150
|
+
getSelectedIndexes(): number[];
|
|
151
|
+
/** 选中的行(多选按行序返回)。 */
|
|
152
|
+
getSelectedRows(): ICETableRow[];
|
|
153
|
+
/** 批量设置选中行(多选模式用;单选模式只认第一个)。 */
|
|
154
|
+
setSelectedIndexes(indexes: number[]): this;
|
|
155
|
+
selectAll(): this;
|
|
156
|
+
clearSelection(): this;
|
|
157
|
+
getSelectionNode(index: number): ICECheckBox | null;
|
|
158
|
+
getHeaderCheckbox(): ICECheckBox | null;
|
|
159
|
+
protected afterAddHandler(): void;
|
|
160
|
+
private __bindGlobalEvents;
|
|
161
|
+
private __onGlobalMouseDown;
|
|
162
|
+
/**
|
|
163
|
+
* 宽松数值解析:容忍千分位与常见货币/百分号(`$1,240.00`、`12%`、`-3.5`)。
|
|
164
|
+
* 解析不出来返回 null,交给字符串比较。
|
|
165
|
+
*/
|
|
166
|
+
private __toNumber;
|
|
167
|
+
/** 默认比较:两侧都能解析成数字(含货币/千分位/百分号)时按数值,否则按字符串。 */
|
|
168
|
+
private __compareRows;
|
|
169
|
+
private __render;
|
|
170
|
+
/**
|
|
171
|
+
* @overwrite 宽度变化时重算列宽。
|
|
172
|
+
*
|
|
173
|
+
* `__render()` 只在 setData / 排序 / 分页时跑,而窗口缩放、分栏拖动只会改 `state.width`;
|
|
174
|
+
* 引擎在 setState 后只回调 `__afterStateMerge`(不会调 `revalidate`),所以钩子挂在这里。
|
|
175
|
+
* 不补这次渲染,列宽会停留在旧值 —— 表现为单元格文字互相重叠。
|
|
176
|
+
*/
|
|
177
|
+
protected __afterStateMerge(sizeChanged: boolean): void;
|
|
178
|
+
/** 建一行(普通模式与虚拟模式共用;top 由调用方给,虚拟模式里相对滚动内容)。 */
|
|
179
|
+
/**
|
|
180
|
+
* 可滚动模式的渲染:表头与表体各自一个 `ICEScrollPane`(横向同步),
|
|
181
|
+
* 表体只渲染可视行窗口(虚拟行),有固定列时再叠一层不横向滚动的冻结层。
|
|
182
|
+
*/
|
|
183
|
+
private __renderScrollable;
|
|
184
|
+
/** 按当前滚动位置重算可视行窗口:窗口外的行面板拆掉,窗口内的补上。 */
|
|
185
|
+
private __syncRowWindow;
|
|
186
|
+
/** 行被拆掉时,把它名下的单元格记录也清掉(否则 `cellNodes` 会随滚动无限增长)。 */
|
|
187
|
+
private __forgetRowCells;
|
|
188
|
+
private __createRowPanel;
|
|
189
|
+
private __placeCells;
|
|
190
|
+
private __layoutCells;
|
|
191
|
+
private __columnWidths;
|
|
192
|
+
/** 当前各列实际宽度(按列 key 给,方便断言与持久化)。 */
|
|
193
|
+
getColumnWidths(): Record<string, number>;
|
|
194
|
+
/**
|
|
195
|
+
* 手动设置某列宽度(拖拽缩列走的就是它):宽度按 `minWidth` 夹取,改完重排整张表。
|
|
196
|
+
* 返回是否真的变了(相同宽度不会白重排)。
|
|
197
|
+
*/
|
|
198
|
+
setColumnWidth(key: string, width: number): boolean;
|
|
199
|
+
isResizable(): boolean;
|
|
200
|
+
isResizing(): boolean;
|
|
201
|
+
isVirtual(): boolean;
|
|
202
|
+
isScrollable(): boolean;
|
|
203
|
+
/** 当前可视行窗口(`[start, end)`,虚拟模式专用;普通模式返回整段)。 */
|
|
204
|
+
getRowRange(): {
|
|
205
|
+
start: number;
|
|
206
|
+
end: number;
|
|
207
|
+
count: number;
|
|
208
|
+
};
|
|
209
|
+
/** 真正建出来的行数(虚拟模式下的节点数上界,QA 拿它守「不会全量渲染」)。 */
|
|
210
|
+
getRenderedRowCount(): number;
|
|
211
|
+
getScroll(): {
|
|
212
|
+
x: number;
|
|
213
|
+
y: number;
|
|
214
|
+
};
|
|
215
|
+
/** 内容总高度(虚拟模式下 = 行数 × 行高)。 */
|
|
216
|
+
getContentHeight(): number;
|
|
217
|
+
/** 固定列的总宽度(没有固定列就是 0)。 */
|
|
218
|
+
getFrozenWidth(): number;
|
|
219
|
+
setScrollTop(y: number): this;
|
|
220
|
+
setScrollLeft(x: number): this;
|
|
221
|
+
/** 把某一行滚进视口(贴顶)。 */
|
|
222
|
+
scrollToRow(index: number): this;
|
|
223
|
+
isRowDraggable(): boolean;
|
|
224
|
+
isRowDragging(): boolean;
|
|
225
|
+
/** 当前落点(拖拽中才有值;QA 用它断言指示线跟手)。 */
|
|
226
|
+
getDropTarget(): ICEDropTarget | null;
|
|
227
|
+
/**
|
|
228
|
+
* 把第 `from` 行移到落点处(拖拽松手时调用;也可以直接调它做「上移/下移」按钮)。
|
|
229
|
+
*
|
|
230
|
+
* 移动的是**当前渲染顺序**(`sortedData`);没有激活排序时同步 `sourceData`,
|
|
231
|
+
* 这样第 n 次点表头恢复原序时拿到的是新顺序。返回是否真的动了。
|
|
232
|
+
*/
|
|
233
|
+
moveRow(from: number, target: ICEDropTarget): boolean;
|
|
234
|
+
/** 指针在行区域里的纵向坐标 → 行下标(可滚动模式要把滚动偏移加回来)。 */
|
|
235
|
+
private __rowIndexAt;
|
|
236
|
+
private __startRowDrag;
|
|
237
|
+
/** 指示线挂在哪:可滚动模式挂内容盒(跟着滚动走),否则挂表格自己。 */
|
|
238
|
+
private __dropHost;
|
|
239
|
+
private __updateRowDrag;
|
|
240
|
+
private __endRowDrag;
|
|
241
|
+
/** 表头边界拖拽句柄:透明条,命中区 ±4px。 */
|
|
242
|
+
private __createResizeHandles;
|
|
243
|
+
private __startResize;
|
|
244
|
+
private __onGlobalMouseMove;
|
|
245
|
+
private __onGlobalMouseUp;
|
|
246
|
+
private __format;
|
|
247
|
+
private __syncSelection;
|
|
248
|
+
/** 广播选择变化(多选批量操作用)。 */
|
|
249
|
+
private __emitSelection;
|
|
250
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ICEContainer } from '../core/ICEContainer';
|
|
2
|
+
/**
|
|
3
|
+
* 标签页:一组互斥按钮,`onChange` 通知切换(程序式 `setActiveIndex` 不触发回调)。
|
|
4
|
+
*/
|
|
5
|
+
export declare class ICETabs extends ICEContainer {
|
|
6
|
+
private buttons;
|
|
7
|
+
private activeIndex;
|
|
8
|
+
private tabs;
|
|
9
|
+
private onChangeCallback;
|
|
10
|
+
constructor(props?: any);
|
|
11
|
+
getActiveIndex(): number;
|
|
12
|
+
setActiveIndex(index: number): this;
|
|
13
|
+
getTabs(): string[];
|
|
14
|
+
/** 用户点击切页(`setActiveIndex` 是程序式设置,不触发 onChange)。 */
|
|
15
|
+
private __activate;
|
|
16
|
+
private __applyActive;
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
2
|
+
/**
|
|
3
|
+
* 标签:默认 Bootstrap 实底(`.text-bg-*`),`variant: 'soft'` 切浅底 + 强调文字。
|
|
4
|
+
*/
|
|
5
|
+
export declare class ICETag extends ICEWidget {
|
|
6
|
+
private textNode;
|
|
7
|
+
private statusColors;
|
|
8
|
+
/** `solid` = Bootstrap `.text-bg-*` 实底(默认);`soft` = subtle 浅底 + 强调文字 */
|
|
9
|
+
private variant;
|
|
10
|
+
constructor(props?: any);
|
|
11
|
+
setText(text: string): this;
|
|
12
|
+
protected __applyHoverState(): void;
|
|
13
|
+
private __mix;
|
|
14
|
+
private __hex;
|
|
15
|
+
}
|