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,73 @@
|
|
|
1
|
+
import { ICEButton } from './ICEButton';
|
|
2
|
+
import { ICEPanel } from './ICEPanel';
|
|
3
|
+
import { ICEOverlayManager } from '../core/ICEOverlayManager';
|
|
4
|
+
import { ICEFocusManager } from '../core/ICEFocusManager';
|
|
5
|
+
import type { ICEEasing, ICEFrameDriver } from '../util/ICEAnimation';
|
|
6
|
+
/**
|
|
7
|
+
* 模态对话框:全屏遮罩 + 居中面板 + 焦点陷阱。
|
|
8
|
+
*
|
|
9
|
+
* - 遮罩铺满可见区域且可交互 —— 引擎按 zIndex 命中,模态打开时点击不会穿透到下面的组件;
|
|
10
|
+
* - 焦点被限制在对话框内(`ICEFocusManager.setFocusScope`),打开时聚焦第一个可聚焦控件,
|
|
11
|
+
* 关闭后恢复打开前的焦点;
|
|
12
|
+
* - 关闭途径:遮罩点击(`maskClosable`)、Esc(`closeOnEsc`)、确定/取消按钮、显式 `close()`。
|
|
13
|
+
*/
|
|
14
|
+
export declare type ICEModalCloseReason = 'mask' | 'esc' | 'confirm' | 'cancel' | 'api';
|
|
15
|
+
export interface ICEModalOptions {
|
|
16
|
+
title?: string;
|
|
17
|
+
/** 正文文本或内容工厂 */
|
|
18
|
+
content?: string | (() => any);
|
|
19
|
+
width?: number;
|
|
20
|
+
/** 面板高度(不传按内容估算) */
|
|
21
|
+
height?: number;
|
|
22
|
+
confirmText?: string;
|
|
23
|
+
cancelText?: string;
|
|
24
|
+
showFooter?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* `onConfirm` 之后是否自动关闭(默认 true)。
|
|
27
|
+
*
|
|
28
|
+
* 异步场景(提交前要跑异步校验 / 等接口)传 `false`:回调里自己做异步操作,
|
|
29
|
+
* 成功后再调 `modal.close()`,失败时弹窗留在原地展示错误。
|
|
30
|
+
*/
|
|
31
|
+
closeOnConfirm?: boolean;
|
|
32
|
+
maskClosable?: boolean;
|
|
33
|
+
closeOnEsc?: boolean;
|
|
34
|
+
confirmLoading?: boolean;
|
|
35
|
+
onConfirm?: () => void;
|
|
36
|
+
onCancel?: () => void;
|
|
37
|
+
onClose?: (reason: ICEModalCloseReason) => void;
|
|
38
|
+
manager?: ICEOverlayManager;
|
|
39
|
+
focusManager?: ICEFocusManager;
|
|
40
|
+
animation?: {
|
|
41
|
+
duration?: number;
|
|
42
|
+
delay?: number;
|
|
43
|
+
easing?: ICEEasing;
|
|
44
|
+
driver?: ICEFrameDriver;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export declare class ICEModal {
|
|
48
|
+
private ice;
|
|
49
|
+
private options;
|
|
50
|
+
private manager;
|
|
51
|
+
private focus;
|
|
52
|
+
private handle;
|
|
53
|
+
private mask;
|
|
54
|
+
private dialog;
|
|
55
|
+
private confirmButton;
|
|
56
|
+
private cancelButton;
|
|
57
|
+
private previousFocus;
|
|
58
|
+
/** 显式关闭时暂存的关闭原因(浮层回调只有 api/esc/outside/exclusive,认不出 confirm/cancel) */
|
|
59
|
+
private pendingReason;
|
|
60
|
+
constructor(ice: any, options?: ICEModalOptions);
|
|
61
|
+
isOpen(): boolean;
|
|
62
|
+
getMask(): ICEPanel | null;
|
|
63
|
+
getDialog(): ICEPanel | null;
|
|
64
|
+
getConfirmButton(): ICEButton | null;
|
|
65
|
+
getCancelButton(): ICEButton | null;
|
|
66
|
+
open(): this;
|
|
67
|
+
close(reason?: ICEModalCloseReason): this;
|
|
68
|
+
private __handleClosed;
|
|
69
|
+
private __createDialog;
|
|
70
|
+
private __visibleWorldRect;
|
|
71
|
+
}
|
|
72
|
+
/** 便捷入口:`ICEModal.open(ice, options)` 等价于 new ICEModal(ice, options).open()。 */
|
|
73
|
+
export declare function openModal(ice: any, options?: ICEModalOptions): ICEModal;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ICEButton } from './ICEButton';
|
|
2
|
+
import { ICEContainer } from '../core/ICEContainer';
|
|
3
|
+
/**
|
|
4
|
+
* 分页器:页码 + 上一页/下一页 + 可选「共 N 条」与每页条数切换。
|
|
5
|
+
*
|
|
6
|
+
* - 页码按钮就是 `ICEButton`,所以天然可聚焦(Tab / Enter 可操作,见 ICEFocusManager);
|
|
7
|
+
* - 页数多时用省略号收口:始终显示首页、末页与当前页附近的窗口(最多 `maxPageButtons` 个页码位);
|
|
8
|
+
* - `setCurrent` / `setPageSize` 会夹取并重排,变更后回调 `onChange(page, pageSize)`。
|
|
9
|
+
*/
|
|
10
|
+
export interface ICEPaginationOptions {
|
|
11
|
+
/** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
|
|
12
|
+
id?: string;
|
|
13
|
+
total?: number;
|
|
14
|
+
pageSize?: number;
|
|
15
|
+
current?: number;
|
|
16
|
+
width?: number;
|
|
17
|
+
left?: number;
|
|
18
|
+
top?: number;
|
|
19
|
+
/** 页码位上限(含省略号,默认 7) */
|
|
20
|
+
maxPageButtons?: number;
|
|
21
|
+
showTotal?: boolean;
|
|
22
|
+
showSizeChanger?: boolean;
|
|
23
|
+
pageSizeOptions?: number[];
|
|
24
|
+
size?: 'default' | 'small';
|
|
25
|
+
onChange?: (page: number, pageSize: number) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare class ICEPagination extends ICEContainer {
|
|
28
|
+
private total;
|
|
29
|
+
private pageSize;
|
|
30
|
+
private current;
|
|
31
|
+
private maxPageButtons;
|
|
32
|
+
private showTotal;
|
|
33
|
+
private showSizeChanger;
|
|
34
|
+
private pageSizeOptions;
|
|
35
|
+
private size;
|
|
36
|
+
private onChange;
|
|
37
|
+
private prevButton;
|
|
38
|
+
private nextButton;
|
|
39
|
+
private pageButtons;
|
|
40
|
+
private sizeChanger;
|
|
41
|
+
constructor(props?: ICEPaginationOptions);
|
|
42
|
+
getTotal(): number;
|
|
43
|
+
getPageCount(): number;
|
|
44
|
+
getCurrent(): number;
|
|
45
|
+
getPageSize(): number;
|
|
46
|
+
getPrevButton(): ICEButton | null;
|
|
47
|
+
getNextButton(): ICEButton | null;
|
|
48
|
+
getPageButton(page: number): ICEButton | null;
|
|
49
|
+
getSizeChanger(): ICEButton | null;
|
|
50
|
+
setTotal(total: number): this;
|
|
51
|
+
/** 设置当前页(自动夹取到 [1, pageCount]),变化时回调 onChange。 */
|
|
52
|
+
setCurrent(page: number, options?: {
|
|
53
|
+
silent?: boolean;
|
|
54
|
+
}): this;
|
|
55
|
+
/** 设置每页条数(重算页数并把 current 夹取到合法范围),变化时回调 onChange。 */
|
|
56
|
+
setPageSize(pageSize: number, options?: {
|
|
57
|
+
silent?: boolean;
|
|
58
|
+
}): this;
|
|
59
|
+
private __render;
|
|
60
|
+
/** 页码窗口:1 … n-1 [n n+1 n+2] … last(-1 表示省略号) */
|
|
61
|
+
private __pageWindow;
|
|
62
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ICEButton } from './ICEButton';
|
|
2
|
+
import { ICETextField } from './ICETextField';
|
|
3
|
+
/**
|
|
4
|
+
* 密码框:显示掩码(• 数量 = 真实长度),`getValue()` / 表单取值仍是明文。
|
|
5
|
+
*
|
|
6
|
+
* `showToggle: true` 时右侧出现眼睛按钮,可在明文/掩码之间切换(便于用户核对输入)。
|
|
7
|
+
*/
|
|
8
|
+
export declare class ICEPasswordField extends ICETextField {
|
|
9
|
+
private visible;
|
|
10
|
+
private toggleButton;
|
|
11
|
+
private showToggle;
|
|
12
|
+
constructor(props?: any);
|
|
13
|
+
/** 明文 / 掩码。 */
|
|
14
|
+
isVisible(): boolean;
|
|
15
|
+
setVisible(visible: boolean): this;
|
|
16
|
+
getToggleButton(): ICEButton | null;
|
|
17
|
+
protected formatDisplayValue(value: string): string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ICEPopover, ICEPopoverOptions } from './ICEPopover';
|
|
2
|
+
/**
|
|
3
|
+
* 气泡确认框:点击目标弹出「标题 + 说明 + 取消/确定」的小卡片。
|
|
4
|
+
*
|
|
5
|
+
* 复用 ICEPopover 的触发与定位;确认/取消后自动关闭并回调。
|
|
6
|
+
*/
|
|
7
|
+
export interface ICEPopconfirmOptions extends ICEPopoverOptions {
|
|
8
|
+
description?: string;
|
|
9
|
+
confirmText?: string;
|
|
10
|
+
cancelText?: string;
|
|
11
|
+
/** 危险操作:确认按钮用 error 色 */
|
|
12
|
+
danger?: boolean;
|
|
13
|
+
onConfirm?: () => void;
|
|
14
|
+
onCancel?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare class ICEPopconfirm extends ICEPopover {
|
|
17
|
+
private confirmOptions;
|
|
18
|
+
constructor(ice: any, target: any, options?: ICEPopconfirmOptions);
|
|
19
|
+
protected __createContent(): any;
|
|
20
|
+
}
|
|
21
|
+
export declare function attachPopconfirm(ice: any, target: any, options?: ICEPopconfirmOptions): ICEPopconfirm;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ICEOverlayManager, ICEOverlayHandle } from '../core/ICEOverlayManager';
|
|
2
|
+
import type { ICEOverlayPlacement } from '../util/ICEOverlayPosition';
|
|
3
|
+
/**
|
|
4
|
+
* 卡片式浮层:点击(默认)或悬停触发,内容可以是文本或自定义组件工厂。
|
|
5
|
+
*
|
|
6
|
+
* 与 ICETooltip 的区别:
|
|
7
|
+
* - 触发方式默认是 click(可切 hover);
|
|
8
|
+
* - 内容通常是「标题 + 正文」的卡片,也支持自定义组件;
|
|
9
|
+
* - 点击目标会 toggle;点浮层外、按 Esc 关闭(由 ICEOverlayManager 负责)。
|
|
10
|
+
*/
|
|
11
|
+
export interface ICEPopoverOptions {
|
|
12
|
+
title?: string;
|
|
13
|
+
/** 正文文本,或内容工厂(每次弹出新建) */
|
|
14
|
+
content?: string | (() => any);
|
|
15
|
+
trigger?: 'click' | 'hover';
|
|
16
|
+
placement?: ICEOverlayPlacement;
|
|
17
|
+
offset?: number;
|
|
18
|
+
mouseEnterDelay?: number;
|
|
19
|
+
mouseLeaveDelay?: number;
|
|
20
|
+
enterAnimation?: 'none' | 'fade' | 'scale';
|
|
21
|
+
exitAnimation?: 'none' | 'fade';
|
|
22
|
+
/** 复用外部浮层管理器(测试注入) */
|
|
23
|
+
manager?: ICEOverlayManager;
|
|
24
|
+
onOpenChange?: (open: boolean) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare class ICEPopover {
|
|
27
|
+
protected ice: any;
|
|
28
|
+
protected target: any;
|
|
29
|
+
protected options: ICEPopoverOptions;
|
|
30
|
+
protected manager: ICEOverlayManager;
|
|
31
|
+
protected handle: ICEOverlayHandle | null;
|
|
32
|
+
private enterTimer;
|
|
33
|
+
private leaveTimer;
|
|
34
|
+
private running;
|
|
35
|
+
constructor(ice: any, target: any, options?: ICEPopoverOptions);
|
|
36
|
+
start(): this;
|
|
37
|
+
destroy(): this;
|
|
38
|
+
isOpen(): boolean;
|
|
39
|
+
show(): this;
|
|
40
|
+
hide(): this;
|
|
41
|
+
toggle(): this;
|
|
42
|
+
/** 内容面板:标题(可选)+ 正文/自定义内容。子类可覆盖做更复杂的卡片。 */
|
|
43
|
+
protected __createContent(): any;
|
|
44
|
+
private __onClick;
|
|
45
|
+
private __onHoverChange;
|
|
46
|
+
private __clearTimers;
|
|
47
|
+
}
|
|
48
|
+
export declare function attachPopover(ice: any, target: any, options?: ICEPopoverOptions): ICEPopover;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ICELabel } from './ICELabel';
|
|
2
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
3
|
+
/**
|
|
4
|
+
* 进度环/进度条。
|
|
5
|
+
*
|
|
6
|
+
* - 线形(默认):`ICEBoundedRangeModel` 驱动填充条宽度;
|
|
7
|
+
* - 环形(`type: 'circle'`):底环 + 进度弧(Path2D 弧线,12 点方向顺时针)+ 居中百分比;
|
|
8
|
+
* `size` / `strokeWidth` / `showText` / `format` 可配,`status: 'success'` 走成功色。
|
|
9
|
+
*/
|
|
10
|
+
export declare type ICEProgressType = 'line' | 'circle';
|
|
11
|
+
export declare class ICEProgressBar extends ICEWidget {
|
|
12
|
+
private model;
|
|
13
|
+
private type;
|
|
14
|
+
private track;
|
|
15
|
+
private fill;
|
|
16
|
+
private trackRing;
|
|
17
|
+
private ring;
|
|
18
|
+
private textNode;
|
|
19
|
+
private strokeWidth;
|
|
20
|
+
private showText;
|
|
21
|
+
private formatFn;
|
|
22
|
+
constructor(props?: any);
|
|
23
|
+
setValue(value: number): this;
|
|
24
|
+
getValue(): number;
|
|
25
|
+
isCircle(): boolean;
|
|
26
|
+
/** 归一化进度(0..1)。 */
|
|
27
|
+
getPercent(): number;
|
|
28
|
+
/** 进度弧扫过的比例(0..1);线形模式同样返回归一化进度。 */
|
|
29
|
+
getSweepRatio(): number;
|
|
30
|
+
getRingNode(): any;
|
|
31
|
+
getTrackRingNode(): any;
|
|
32
|
+
getTextNode(): ICELabel | null;
|
|
33
|
+
private __ratio;
|
|
34
|
+
private __format;
|
|
35
|
+
private __fillWidth;
|
|
36
|
+
private __sync;
|
|
37
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
2
|
+
/**
|
|
3
|
+
* 单选框:点击或 Enter/Space 选中;同组互斥由调用方(表单/业务)维护。
|
|
4
|
+
*/
|
|
5
|
+
export declare class ICERadioButton extends ICEWidget {
|
|
6
|
+
private model;
|
|
7
|
+
private outer;
|
|
8
|
+
private inner;
|
|
9
|
+
constructor(props?: any);
|
|
10
|
+
isSelected(): boolean;
|
|
11
|
+
setSelected(selected: boolean): this;
|
|
12
|
+
getFormValue(): any;
|
|
13
|
+
setFormValue(value: any): void;
|
|
14
|
+
/** 键盘激活(Enter / Space)与鼠标点击同义:选中本项。 */
|
|
15
|
+
activate(): void;
|
|
16
|
+
protected initEvents(): void;
|
|
17
|
+
/** 禁用的控件不响应鼠标(与 `activate()` 的键盘路径保持一致)。 */
|
|
18
|
+
private __select;
|
|
19
|
+
protected __applyHoverState(): void;
|
|
20
|
+
private __sync;
|
|
21
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
2
|
+
import { ICERadioButton } from './ICERadioButton';
|
|
3
|
+
/**
|
|
4
|
+
* 单选组(Ant Radio.Group):一组互斥选项,整行可点,值是选项的 `value`。
|
|
5
|
+
*
|
|
6
|
+
* 与 `ICERadioButton` 的分工:单个按钮只管「选中/未选中」,**互斥与取值由本组件维护**,
|
|
7
|
+
* 因此业务代码不用再自己写「点了 A 要把 B 取消」这类同步逻辑。
|
|
8
|
+
*
|
|
9
|
+
* - 键盘:聚焦后 ←/↑ 上一项、→/↓ 下一项(自动跳过禁用项),Enter/Space 选中当前项;
|
|
10
|
+
* - 表单:实现取值约定,可直接放进 `ICEForm`;
|
|
11
|
+
* - 事件:值变化触发 `change`(载荷 `{ value }`)并调用 `onChange`。
|
|
12
|
+
*/
|
|
13
|
+
export interface ICERadioGroupOption {
|
|
14
|
+
value: string;
|
|
15
|
+
label?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ICERadioGroupOptions {
|
|
19
|
+
/** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
|
|
20
|
+
id?: string;
|
|
21
|
+
options: ICERadioGroupOption[];
|
|
22
|
+
/** 当前选中值(不在选项里的值会被忽略) */
|
|
23
|
+
value?: string;
|
|
24
|
+
/** 排布方向,默认 horizontal */
|
|
25
|
+
direction?: 'horizontal' | 'vertical';
|
|
26
|
+
/** 选项之间的间距,默认 16 */
|
|
27
|
+
itemGap?: number;
|
|
28
|
+
left?: number;
|
|
29
|
+
top?: number;
|
|
30
|
+
width?: number;
|
|
31
|
+
height?: number;
|
|
32
|
+
fontSize?: number;
|
|
33
|
+
onChange?: (value: string) => void;
|
|
34
|
+
}
|
|
35
|
+
export declare class ICERadioGroup extends ICEWidget {
|
|
36
|
+
private options;
|
|
37
|
+
private value;
|
|
38
|
+
private direction;
|
|
39
|
+
private itemGap;
|
|
40
|
+
private fontSize;
|
|
41
|
+
private itemHeight;
|
|
42
|
+
private onChange;
|
|
43
|
+
private itemNodes;
|
|
44
|
+
private radioNodes;
|
|
45
|
+
private labelNodes;
|
|
46
|
+
private activeIndex;
|
|
47
|
+
private bound;
|
|
48
|
+
constructor(props: ICERadioGroupOptions);
|
|
49
|
+
getValue(): string | null;
|
|
50
|
+
/** 程序式改值:只发 `change` 事件,不回调 `onChange`(与库内其它控件一致)。 */
|
|
51
|
+
setValue(value: string): this;
|
|
52
|
+
getFormValue(): any;
|
|
53
|
+
setFormValue(value: any): void;
|
|
54
|
+
getOptionNodes(): ICEWidget[];
|
|
55
|
+
getItemNode(value: string): ICEWidget | null;
|
|
56
|
+
getRadioNode(value: string): ICERadioButton | null;
|
|
57
|
+
getLabelTexts(): string[];
|
|
58
|
+
/** 当前键盘活动项(不一定是选中项)。 */
|
|
59
|
+
getActiveIndex(): number;
|
|
60
|
+
setOptions(options: ICERadioGroupOption[]): this;
|
|
61
|
+
protected afterAddHandler(): void;
|
|
62
|
+
private __isKnown;
|
|
63
|
+
/** 选项 → 组内索引(跳过禁用项的下一项)。 */
|
|
64
|
+
private __nextEnabled;
|
|
65
|
+
private __onKeyDown;
|
|
66
|
+
private __moveActive;
|
|
67
|
+
/** 选中一个选项;`user` 为 true 时回调 onChange。 */
|
|
68
|
+
private __select;
|
|
69
|
+
private __syncSelection;
|
|
70
|
+
private __render;
|
|
71
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
2
|
+
/**
|
|
3
|
+
* 评分(Ant Rate):N 颗星,点击设置分值、悬停预览、键盘 ←/→ 调整。
|
|
4
|
+
*/
|
|
5
|
+
export interface ICERateOptions {
|
|
6
|
+
/** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
|
|
7
|
+
id?: string;
|
|
8
|
+
count?: number;
|
|
9
|
+
value?: number;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
size?: number;
|
|
12
|
+
color?: string;
|
|
13
|
+
left?: number;
|
|
14
|
+
top?: number;
|
|
15
|
+
onChange?: (value: number) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare class ICERate extends ICEWidget {
|
|
18
|
+
private count;
|
|
19
|
+
private value;
|
|
20
|
+
private preview;
|
|
21
|
+
private disabled;
|
|
22
|
+
private size;
|
|
23
|
+
private color;
|
|
24
|
+
private starNodes;
|
|
25
|
+
private onChange;
|
|
26
|
+
private running;
|
|
27
|
+
constructor(props?: ICERateOptions);
|
|
28
|
+
protected afterAddHandler(): void;
|
|
29
|
+
getValue(): number;
|
|
30
|
+
setValue(value: number): this;
|
|
31
|
+
getPreviewValue(): number;
|
|
32
|
+
getStarNodes(): ICEWidget[];
|
|
33
|
+
setDisabled(disabled: boolean): this;
|
|
34
|
+
/** 把指针 x 换算成星序号(1..count)。 */
|
|
35
|
+
private __starIndexAt;
|
|
36
|
+
private __onClick;
|
|
37
|
+
private __onMouseMove;
|
|
38
|
+
private __onMouseLeave;
|
|
39
|
+
private __onKeyDown;
|
|
40
|
+
private __applyValue;
|
|
41
|
+
private __worldBox;
|
|
42
|
+
private __render;
|
|
43
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ICEButton } from './ICEButton';
|
|
2
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
3
|
+
/**
|
|
4
|
+
* 结果页(Ant Result):状态图标 + 标题 + 副标题 + 操作按钮组。
|
|
5
|
+
* 用于提交成功/失败、404、无权限等场景。
|
|
6
|
+
*/
|
|
7
|
+
export declare type ICEResultStatus = 'success' | 'error' | 'info' | 'warning';
|
|
8
|
+
export interface ICEResultAction {
|
|
9
|
+
key: string;
|
|
10
|
+
text: string;
|
|
11
|
+
primary?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ICEResultOptions {
|
|
14
|
+
/** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
|
|
15
|
+
id?: string;
|
|
16
|
+
status?: ICEResultStatus;
|
|
17
|
+
title?: string;
|
|
18
|
+
subtitle?: string;
|
|
19
|
+
actions?: ICEResultAction[];
|
|
20
|
+
onAction?: (key: string) => void;
|
|
21
|
+
left?: number;
|
|
22
|
+
top?: number;
|
|
23
|
+
width?: number;
|
|
24
|
+
height?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare class ICEResult extends ICEWidget {
|
|
27
|
+
private buttons;
|
|
28
|
+
constructor(props: ICEResultOptions);
|
|
29
|
+
getActionButton(key: string): ICEButton | null;
|
|
30
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ICEContainer } from '../core/ICEContainer';
|
|
2
|
+
/**
|
|
3
|
+
* 滚动视口(Swing 的 JScrollPane / Ant 的 overflow:auto 容器)。
|
|
4
|
+
*
|
|
5
|
+
* 依赖引擎的**子树裁剪**(`clipChildren`):内容超出视口的部分被裁掉,滚出去的子组件
|
|
6
|
+
* 也命不中(命中检测同样尊重裁剪区)。
|
|
7
|
+
*
|
|
8
|
+
* 结构:
|
|
9
|
+
* ```
|
|
10
|
+
* ICEScrollPane (clipChildren: true)
|
|
11
|
+
* ├── contentBox 位置 = (-scrollX, -scrollY),尺寸 = 内容尺寸
|
|
12
|
+
* │ └── 调用方的内容组件
|
|
13
|
+
* └── scrollbarTrack + scrollbarThumb 滚动条(内容超出时才显示)
|
|
14
|
+
* ```
|
|
15
|
+
* 内容盒与滚动条都在构造期创建,保证滚动条的 zIndex 恒高于内容(引擎按 zIndex 排序渲染)。
|
|
16
|
+
*/
|
|
17
|
+
export interface ICEScrollPaneOptions {
|
|
18
|
+
width?: number;
|
|
19
|
+
height?: number;
|
|
20
|
+
/** 初始滚动位置 */
|
|
21
|
+
scrollX?: number;
|
|
22
|
+
scrollY?: number;
|
|
23
|
+
/** 是否显示滚动条(默认 auto:内容超出时显示) */
|
|
24
|
+
scrollbar?: boolean;
|
|
25
|
+
/** 滚轮灵敏度(每个 deltaY 像素对应的滚动量,默认 1) */
|
|
26
|
+
wheelStep?: number;
|
|
27
|
+
}
|
|
28
|
+
export declare class ICEScrollPane extends ICEContainer {
|
|
29
|
+
private contentBox;
|
|
30
|
+
private contentNode;
|
|
31
|
+
private scrollbarTrack;
|
|
32
|
+
private scrollbarThumb;
|
|
33
|
+
private scrollX;
|
|
34
|
+
private scrollY;
|
|
35
|
+
private contentWidth;
|
|
36
|
+
private contentHeight;
|
|
37
|
+
private explicitContentSize;
|
|
38
|
+
private scrollbarMode;
|
|
39
|
+
private wheelStep;
|
|
40
|
+
private __bound;
|
|
41
|
+
constructor(props?: ICEScrollPaneOptions & Record<string, any>);
|
|
42
|
+
/** 设置滚动内容(会替换上一个内容组件)。 */
|
|
43
|
+
setContent(node: any): this;
|
|
44
|
+
getContent(): any;
|
|
45
|
+
/** 显式设置内容尺寸(内容自己不做布局时用;设置后不再跟随内容组件尺寸)。 */
|
|
46
|
+
setContentSize(width: number, height: number): this;
|
|
47
|
+
getContentSize(): [number, number];
|
|
48
|
+
getViewportSize(): [number, number];
|
|
49
|
+
/** 可滚动范围(上界);内容不超出时为 0。 */
|
|
50
|
+
getScrollRange(): [number, number];
|
|
51
|
+
getScroll(): [number, number];
|
|
52
|
+
/** 设置滚动位置(按可滚动范围夹取)。 */
|
|
53
|
+
setScroll(x: number, y: number): this;
|
|
54
|
+
scrollBy(dx: number, dy: number): this;
|
|
55
|
+
isScrollbarVisible(): boolean;
|
|
56
|
+
/** 滚动条滑块(测试与自定义样式用)。 */
|
|
57
|
+
getScrollbarThumb(): any;
|
|
58
|
+
protected afterAddHandler(): void;
|
|
59
|
+
private __bindGlobalEvents;
|
|
60
|
+
private __onWheel;
|
|
61
|
+
private __paneWorldBox;
|
|
62
|
+
private __syncContentSizeFromNode;
|
|
63
|
+
/**
|
|
64
|
+
* 把「内容子树」整体抬到本视口之上。
|
|
65
|
+
*
|
|
66
|
+
* 引擎按**全局 zIndex** 排序渲染(zIndex 在构造时自增),因此「先创建内容、后创建视口」
|
|
67
|
+
* 这种常见的组装顺序会让视口自己的背景盖住内容。这里给整个子树统一赋一个高于视口的
|
|
68
|
+
* zIndex:同值时引擎的稳定排序保持树的原顺序(父在前、子在后),层级不会乱。
|
|
69
|
+
*/
|
|
70
|
+
private __raiseAboveSelf;
|
|
71
|
+
private __syncScrollbar;
|
|
72
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ICEButton } from './ICEButton';
|
|
2
|
+
import { ICEContainer } from '../core/ICEContainer';
|
|
3
|
+
/**
|
|
4
|
+
* 分段控制器(Ant Segmented / iOS ICESegmentedControl 的最小版):
|
|
5
|
+
* 一组互斥选项,选中项实心高亮。每个分段是 ICEButton,因此天然可聚焦(Tab/Enter 可操作)。
|
|
6
|
+
*/
|
|
7
|
+
export interface ICESegmentedOption {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface ICESegmentedOptions {
|
|
13
|
+
/** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
|
|
14
|
+
id?: string;
|
|
15
|
+
options: ICESegmentedOption[];
|
|
16
|
+
value?: string;
|
|
17
|
+
left?: number;
|
|
18
|
+
top?: number;
|
|
19
|
+
width?: number;
|
|
20
|
+
height?: number;
|
|
21
|
+
onChange?: (value: string) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare class ICESegmented extends ICEContainer {
|
|
24
|
+
private options;
|
|
25
|
+
private value;
|
|
26
|
+
private heightValue;
|
|
27
|
+
private onChange;
|
|
28
|
+
private nodes;
|
|
29
|
+
constructor(props: ICESegmentedOptions);
|
|
30
|
+
getValue(): string | null;
|
|
31
|
+
setValue(value: string): this;
|
|
32
|
+
getSegmentNode(value: string): ICEButton | null;
|
|
33
|
+
private __render;
|
|
34
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
2
|
+
import { ICEOverlayManager } from '../core/ICEOverlayManager';
|
|
3
|
+
/**
|
|
4
|
+
* 选择器:输入框外观 + 下拉选项(单选 / 多选 / 搜索过滤)。
|
|
5
|
+
*
|
|
6
|
+
* - 字段区自绘(选中标签或 placeholder + 下拉箭头),错误态边框标红;
|
|
7
|
+
* - 下拉走 `ICEOverlayManager`(工具层、点外关闭、Esc、入场动画),并声明 `keyboardCaptured`,
|
|
8
|
+
* 打开期间方向键/Enter/字符输入由本组件处理(搜索过滤);
|
|
9
|
+
* - 可聚焦(Tab 可达),`activate()`(Enter/Space)打开下拉开;
|
|
10
|
+
* - 表单集成:`getFormValue` / `setFormValue` 与 ICETextField 同语义。
|
|
11
|
+
*/
|
|
12
|
+
export interface ICESelectOption {
|
|
13
|
+
value: string;
|
|
14
|
+
label: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface ICESelectOptions {
|
|
18
|
+
/** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
|
|
19
|
+
id?: string;
|
|
20
|
+
options: ICESelectOption[];
|
|
21
|
+
value?: string | string[];
|
|
22
|
+
mode?: 'single' | 'multiple';
|
|
23
|
+
showSearch?: boolean;
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
left?: number;
|
|
27
|
+
top?: number;
|
|
28
|
+
width?: number;
|
|
29
|
+
height?: number;
|
|
30
|
+
optionHeight?: number;
|
|
31
|
+
onChange?: (value: any, option: any) => void;
|
|
32
|
+
/** 是否参与键盘焦点轮转(默认 true,禁用时自动不可聚焦) */
|
|
33
|
+
focusable?: boolean;
|
|
34
|
+
manager?: ICEOverlayManager;
|
|
35
|
+
}
|
|
36
|
+
export declare class ICESelect extends ICEWidget {
|
|
37
|
+
private options;
|
|
38
|
+
private mode;
|
|
39
|
+
private showSearch;
|
|
40
|
+
private placeholder;
|
|
41
|
+
private disabled;
|
|
42
|
+
private selected;
|
|
43
|
+
private optionHeight;
|
|
44
|
+
private onChange;
|
|
45
|
+
private manager;
|
|
46
|
+
private handle;
|
|
47
|
+
private fieldLabel;
|
|
48
|
+
private panel;
|
|
49
|
+
private optionNodes;
|
|
50
|
+
private visible;
|
|
51
|
+
private query;
|
|
52
|
+
private activeIndex;
|
|
53
|
+
private running;
|
|
54
|
+
constructor(props: ICESelectOptions);
|
|
55
|
+
protected afterAddHandler(): void;
|
|
56
|
+
/** 供测试/外部注入浮层管理器 */
|
|
57
|
+
setOverlayManager(manager: ICEOverlayManager): this;
|
|
58
|
+
private __overlayManager;
|
|
59
|
+
getValue(): any;
|
|
60
|
+
setValue(value: any): this;
|
|
61
|
+
getFormValue(): any;
|
|
62
|
+
setFormValue(value: any): void;
|
|
63
|
+
isOpen(): boolean;
|
|
64
|
+
getFieldLabel(): string;
|
|
65
|
+
getQuery(): string;
|
|
66
|
+
getVisibleOptions(): ICESelectOption[];
|
|
67
|
+
getOptionNode(value: string): ICEWidget | null;
|
|
68
|
+
setOptions(options: ICESelectOption[]): this;
|
|
69
|
+
activate(): void;
|
|
70
|
+
toggle(): this;
|
|
71
|
+
private __onClick;
|
|
72
|
+
open(): this;
|
|
73
|
+
close(): this;
|
|
74
|
+
/** 键盘(打开期间):搜索字符 / Backspace / ↑↓ / Enter / Esc。 */
|
|
75
|
+
private __onKeyDown;
|
|
76
|
+
private __moveActive;
|
|
77
|
+
private __setQuery;
|
|
78
|
+
private __pick;
|
|
79
|
+
private __normalizeValue;
|
|
80
|
+
/** 字段区:标签文本 / placeholder + 下拉箭头;同时处理错误态边框。 */
|
|
81
|
+
private __syncField;
|
|
82
|
+
private __createPanel;
|
|
83
|
+
/** 重建下拉内容(搜索行 + 过滤后的选项)。 */
|
|
84
|
+
private __buildPanel;
|
|
85
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ICEWidget } from '../core/ICEWidget';
|
|
2
|
+
/**
|
|
3
|
+
* 骨架屏:内容加载前的灰色占位。
|
|
4
|
+
*
|
|
5
|
+
* `active` 打开时整体做呼吸(opacity 0.55 ⇄ 1 循环),加载完成后 setActive(false) 并移除。
|
|
6
|
+
*/
|
|
7
|
+
export interface ICESkeletonOptions {
|
|
8
|
+
/** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
|
|
9
|
+
id?: string;
|
|
10
|
+
rows?: number;
|
|
11
|
+
avatar?: boolean;
|
|
12
|
+
title?: boolean;
|
|
13
|
+
active?: boolean;
|
|
14
|
+
left?: number;
|
|
15
|
+
top?: number;
|
|
16
|
+
width?: number;
|
|
17
|
+
height?: number;
|
|
18
|
+
}
|
|
19
|
+
export declare class ICESkeleton extends ICEWidget {
|
|
20
|
+
private placeholders;
|
|
21
|
+
private active;
|
|
22
|
+
private pulse;
|
|
23
|
+
constructor(props: ICESkeletonOptions);
|
|
24
|
+
isActive(): boolean;
|
|
25
|
+
getPlaceholderCount(): number;
|
|
26
|
+
setActive(active: boolean): this;
|
|
27
|
+
private __startPulse;
|
|
28
|
+
private __stopPulse;
|
|
29
|
+
}
|