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,80 @@
|
|
|
1
|
+
import { ICEWidget } from './ICEWidget';
|
|
2
|
+
import { ICEEasing, ICEFrameDriver } from '../util/ICEAnimation';
|
|
3
|
+
/**
|
|
4
|
+
* 全局提示(Message / Notification)。
|
|
5
|
+
*
|
|
6
|
+
* - 消息挂在**独立的工具层容器**上,与浮层系统解耦:打开 Modal / Popover 不会清掉消息,
|
|
7
|
+
* 消息也不参与浮层的 exclusive 关闭;
|
|
8
|
+
* - `show()` 顶部居中堆叠(Ant 的 message),`notification()` 右下角倒序堆叠;
|
|
9
|
+
* - duration 到期自动淡出后移除(0 表示常驻);每条消息返回 handle 可单独关闭。
|
|
10
|
+
*/
|
|
11
|
+
export declare type ICEMessageType = 'info' | 'success' | 'warning' | 'error' | 'loading';
|
|
12
|
+
export interface ICEMessageOptions {
|
|
13
|
+
text: string;
|
|
14
|
+
type?: ICEMessageType;
|
|
15
|
+
/** 毫秒;0 表示不自动消失(默认 3000) */
|
|
16
|
+
duration?: number;
|
|
17
|
+
/** 关闭后回调 */
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
animation?: {
|
|
20
|
+
duration?: number;
|
|
21
|
+
delay?: number;
|
|
22
|
+
easing?: ICEEasing;
|
|
23
|
+
driver?: ICEFrameDriver;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface ICENotificationOptions {
|
|
27
|
+
title: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
type?: ICEMessageType;
|
|
30
|
+
duration?: number;
|
|
31
|
+
onClose?: () => void;
|
|
32
|
+
animation?: {
|
|
33
|
+
duration?: number;
|
|
34
|
+
delay?: number;
|
|
35
|
+
easing?: ICEEasing;
|
|
36
|
+
driver?: ICEFrameDriver;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface ICEMessageHandle {
|
|
40
|
+
close(): void;
|
|
41
|
+
isOpen(): boolean;
|
|
42
|
+
getNode(): any;
|
|
43
|
+
}
|
|
44
|
+
export declare class ICEMessageManager {
|
|
45
|
+
private ice;
|
|
46
|
+
private layer;
|
|
47
|
+
private entries;
|
|
48
|
+
private bound;
|
|
49
|
+
constructor(ice: any);
|
|
50
|
+
/** 幂等:创建消息容器(挂 ICE 工具层)。 */
|
|
51
|
+
start(): this;
|
|
52
|
+
stop(): this;
|
|
53
|
+
getLayer(): ICEWidget | null;
|
|
54
|
+
/** 顶部居中消息。 */
|
|
55
|
+
show(options: ICEMessageOptions): ICEMessageHandle;
|
|
56
|
+
/** 右下角通知(带标题、说明与关闭按钮)。 */
|
|
57
|
+
notification(options: ICENotificationOptions): ICEMessageHandle;
|
|
58
|
+
closeAll(): void;
|
|
59
|
+
isOpen(): boolean;
|
|
60
|
+
private __push;
|
|
61
|
+
private __closeEntry;
|
|
62
|
+
/** 顶部居中:自上而下;右下角:自下而上。 */
|
|
63
|
+
private __relayout;
|
|
64
|
+
private __typeColor;
|
|
65
|
+
private __typeIcon;
|
|
66
|
+
}
|
|
67
|
+
export declare function getICEMessageManager(ice: any): ICEMessageManager;
|
|
68
|
+
/** 便捷入口:`ICEMessage.success(ice, '已保存')`。 */
|
|
69
|
+
export declare const ICEMessage: {
|
|
70
|
+
show(ice: any, text: string, options?: Omit<ICEMessageOptions, 'text'>): ICEMessageHandle;
|
|
71
|
+
success(ice: any, text: string, options?: Omit<ICEMessageOptions, 'text' | 'type'>): ICEMessageHandle;
|
|
72
|
+
error(ice: any, text: string, options?: Omit<ICEMessageOptions, 'text' | 'type'>): ICEMessageHandle;
|
|
73
|
+
warning(ice: any, text: string, options?: Omit<ICEMessageOptions, 'text' | 'type'>): ICEMessageHandle;
|
|
74
|
+
info(ice: any, text: string, options?: Omit<ICEMessageOptions, 'text' | 'type'>): ICEMessageHandle;
|
|
75
|
+
loading(ice: any, text: string, options?: Omit<ICEMessageOptions, 'text' | 'type'>): ICEMessageHandle;
|
|
76
|
+
};
|
|
77
|
+
/** 便捷入口:`ICENotification.open(ice, { title, description })`。 */
|
|
78
|
+
export declare const ICENotification: {
|
|
79
|
+
open(ice: any, options: ICENotificationOptions): ICEMessageHandle;
|
|
80
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ICEOverlayPlacement } from '../util/ICEOverlayPosition';
|
|
2
|
+
import { ICEEasing, ICEFrameDriver } from '../util/ICEAnimation';
|
|
3
|
+
/**
|
|
4
|
+
* 弹层/浮层底座。
|
|
5
|
+
*
|
|
6
|
+
* 所有需要「浮在其它组件之上」的组件(Modal、Dropdown、Select、Tooltip、Popover、
|
|
7
|
+
* 右键菜单…)都走这一层,避免每个组件各自实现锚点定位、z 序、点外关闭、Esc 关闭。
|
|
8
|
+
*
|
|
9
|
+
* 实现要点:
|
|
10
|
+
* - 浮层根节点挂在 **ICE 的工具层**(`ice.addTool`):工具层会被递归渲染、绘制在所有
|
|
11
|
+
* 组件之上,且不参与 getComponentById 查找;根节点 `interactive:false`,所以它自身
|
|
12
|
+
* 不会被命中,只有浮层内容可交互。
|
|
13
|
+
* - 浮层内容是根节点的子组件,位置由 `resolveICEOverlayPosition()` 按锚点世界盒算出来
|
|
14
|
+
* (支持 12 种 placement、空间不足自动翻转、夹进可见范围;带视口缩放/平移也正确)。
|
|
15
|
+
* - 关闭:点击浮层与锚点之外、Esc、或调用 handle.close()。
|
|
16
|
+
*/
|
|
17
|
+
export declare type ICEOverlayCloseReason = 'api' | 'outside' | 'esc' | 'exclusive';
|
|
18
|
+
export interface ICEOverlayOptions {
|
|
19
|
+
/** 触发组件(浮层贴着它定位);用 `centered` 时可省略 */
|
|
20
|
+
anchor?: any;
|
|
21
|
+
/** 居中放置(不依赖锚点)—— Modal / Drawer 这类全屏浮层用 */
|
|
22
|
+
centered?: boolean;
|
|
23
|
+
/** 浮层内容组件;所有权交给管理器 —— 关闭时会被移除并销毁 */
|
|
24
|
+
content: any;
|
|
25
|
+
placement?: ICEOverlayPlacement;
|
|
26
|
+
offset?: number;
|
|
27
|
+
padding?: number;
|
|
28
|
+
flip?: boolean;
|
|
29
|
+
/** 点击浮层与锚点之外时关闭(默认 true) */
|
|
30
|
+
closeOnOutsideClick?: boolean;
|
|
31
|
+
/** 按下 Esc 时关闭(默认 true) */
|
|
32
|
+
closeOnEsc?: boolean;
|
|
33
|
+
/** 打开时先关闭其它浮层(默认 true) */
|
|
34
|
+
exclusive?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* 键盘接管:该浮层打开期间,方向键/Enter/Space 归它处理,
|
|
37
|
+
* ICEFocusManager 不再把 Enter/Space 当作「激活当前焦点控件」(否则会先点掉触发按钮)。
|
|
38
|
+
*/
|
|
39
|
+
keyboardCaptured?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 阻断型浮层(Modal 的遮罩):z 序在最上,且**不会被后来打开的非阻断浮层关掉**
|
|
42
|
+
* (否则鼠标扫过页面触发 Tooltip 就会把模态一起关掉)。
|
|
43
|
+
*/
|
|
44
|
+
blocking?: boolean;
|
|
45
|
+
/** 入场动效:none(默认)/ fade / scale(淡入 + 轻微放大) */
|
|
46
|
+
enterAnimation?: 'none' | 'fade' | 'scale';
|
|
47
|
+
/** 出场动效:none(默认,立即移除)/ fade(淡出后再移除) */
|
|
48
|
+
exitAnimation?: 'none' | 'fade';
|
|
49
|
+
/** 动效参数(时长/缓动/帧驱动,测试可注入 driver) */
|
|
50
|
+
animation?: {
|
|
51
|
+
duration?: number;
|
|
52
|
+
delay?: number;
|
|
53
|
+
easing?: ICEEasing;
|
|
54
|
+
driver?: ICEFrameDriver;
|
|
55
|
+
};
|
|
56
|
+
onClose?: (reason: ICEOverlayCloseReason) => void;
|
|
57
|
+
}
|
|
58
|
+
export interface ICEOverlayHandle {
|
|
59
|
+
close(): void;
|
|
60
|
+
isOpen(): boolean;
|
|
61
|
+
/** 锚点移动 / 内容尺寸变化后重算位置 */
|
|
62
|
+
update(): void;
|
|
63
|
+
}
|
|
64
|
+
export declare class ICEOverlayManager {
|
|
65
|
+
private ice;
|
|
66
|
+
private layer;
|
|
67
|
+
private entries;
|
|
68
|
+
private bound;
|
|
69
|
+
constructor(ice: any);
|
|
70
|
+
/**
|
|
71
|
+
* 幂等:创建浮层根节点(挂到 ICE 工具层)并绑定关闭事件。
|
|
72
|
+
* `open()` 会自动调用,通常不需要手动调。
|
|
73
|
+
*/
|
|
74
|
+
start(): this;
|
|
75
|
+
/** 解绑并移除浮层根节点(关闭所有浮层)。 */
|
|
76
|
+
stop(): this;
|
|
77
|
+
open(options: ICEOverlayOptions): ICEOverlayHandle;
|
|
78
|
+
close(handle: ICEOverlayHandle, reason?: ICEOverlayCloseReason): void;
|
|
79
|
+
closeAll(reason?: ICEOverlayCloseReason): void;
|
|
80
|
+
isOpen(): boolean;
|
|
81
|
+
/** 是否有浮层正在接管键盘(见 ICEOverlayOptions.keyboardCaptured)。 */
|
|
82
|
+
isKeyboardCaptured(): boolean;
|
|
83
|
+
getLayer(): any;
|
|
84
|
+
private __destroyEntry;
|
|
85
|
+
private __place;
|
|
86
|
+
/** 可见世界矩形(含视口缩放/平移);拿不到视口信息时退回画布尺寸。 */
|
|
87
|
+
private __visibleWorldRect;
|
|
88
|
+
private __markDirty;
|
|
89
|
+
private __onMouseDown;
|
|
90
|
+
private __onKeyDown;
|
|
91
|
+
}
|
|
92
|
+
export declare function getICEOverlayManager(ice: any): ICEOverlayManager;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ICEThemeTokens } from '../theme/ICETheme';
|
|
2
|
+
export interface ICEPaintContext {
|
|
3
|
+
ctx: any;
|
|
4
|
+
theme: ICEThemeTokens;
|
|
5
|
+
component: any;
|
|
6
|
+
}
|
|
7
|
+
export interface ICEPainter {
|
|
8
|
+
install?(component: any): void;
|
|
9
|
+
uninstall?(component: any): void;
|
|
10
|
+
getPreferredSize?(component: any): [number, number];
|
|
11
|
+
paint(context: ICEPaintContext): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ICEGroup } from 'ice-render';
|
|
2
|
+
import type { ICEPainter } from './ICEPainter';
|
|
3
|
+
/**
|
|
4
|
+
* 所有 UI 组件的基类(继承引擎 ICEGroup)。
|
|
5
|
+
*
|
|
6
|
+
* 在引擎的绘制能力之上只加四件事:交互态(enabled / hovered / focused)、键盘焦点
|
|
7
|
+
* (`focusable` / `activate()`)、表单校验态(`validateStatus`)、表单取值约定
|
|
8
|
+
* (`getFormValue` / `setFormValue`)。
|
|
9
|
+
*/
|
|
10
|
+
export declare class ICEWidget extends ICEGroup {
|
|
11
|
+
protected painter: ICEPainter | null;
|
|
12
|
+
protected preferredWidth: number;
|
|
13
|
+
protected preferredHeight: number;
|
|
14
|
+
protected enabled: boolean;
|
|
15
|
+
protected hovered: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 是否参与键盘焦点轮转(Tab)。默认 false:容器与展示类组件不该拿到焦点,
|
|
18
|
+
* 控件在自己的构造函数里置 true;调用方也可用 `props.focusable` 覆盖。
|
|
19
|
+
*/
|
|
20
|
+
protected focusable: boolean;
|
|
21
|
+
protected focused: boolean;
|
|
22
|
+
/** 表单校验状态(由 ICEFormItem 设置;控件可覆盖 __applyValidateState 做视觉反馈) */
|
|
23
|
+
protected validateStatus: 'default' | 'error' | 'warning' | 'success';
|
|
24
|
+
/**
|
|
25
|
+
* 焦点环策略(`:focus-visible` 的语义):
|
|
26
|
+
* - `keyboard`(默认):只有键盘(Tab / Shift+Tab)聚焦才画环 —— 鼠标点一下按钮、
|
|
27
|
+
* 拖一下滑块都冒蓝框会很怪;
|
|
28
|
+
* - `always`:鼠标聚焦也画环(文本类控件需要「正在输入」的反馈);
|
|
29
|
+
* - `never`:从不画。
|
|
30
|
+
*/
|
|
31
|
+
protected focusRingMode: 'keyboard' | 'always' | 'never';
|
|
32
|
+
constructor(props?: any);
|
|
33
|
+
getFocusRingMode(): 'keyboard' | 'always' | 'never';
|
|
34
|
+
setFocusRingMode(mode: 'keyboard' | 'always' | 'never'): this;
|
|
35
|
+
/** 按聚焦来源判断要不要画焦点环(ICEFocusManager 调用)。 */
|
|
36
|
+
shouldShowFocusRing(origin: 'mouse' | 'keyboard' | 'api'): boolean;
|
|
37
|
+
setEnabled(enabled: boolean): this;
|
|
38
|
+
/**
|
|
39
|
+
* 无障碍:可读名称。
|
|
40
|
+
*
|
|
41
|
+
* 引擎的 a11y 快照优先读 `state.ariaLabel`(见 ice-render 的 `a11y/accessibility.ts`),
|
|
42
|
+
* 拿不到才回退到文本 / id。控件应当给出有意义的名称(按钮用文字、输入框用占位符……),
|
|
43
|
+
* 否则屏幕阅读器会念出一串 id。
|
|
44
|
+
*/
|
|
45
|
+
setAriaLabel(label: string): this;
|
|
46
|
+
getAriaLabel(): string;
|
|
47
|
+
isEnabled(): boolean;
|
|
48
|
+
isHovered(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 是否可聚焦:显式声明 + 启用 + 可交互 + 最终可见(祖先 display:false 时不可聚焦)。
|
|
51
|
+
*/
|
|
52
|
+
isFocusable(): boolean;
|
|
53
|
+
setFocusable(focusable: boolean): this;
|
|
54
|
+
isFocused(): boolean;
|
|
55
|
+
/** 由 ICEFocusManager 调用;默认只记录状态(视觉表现由焦点环负责,子类可覆盖)。 */
|
|
56
|
+
setFocused(focused: boolean): this;
|
|
57
|
+
/**
|
|
58
|
+
* 键盘激活(Enter / Space)。默认等价于一次 click;
|
|
59
|
+
* 有自己语义的控件(勾选、开关、单选)覆盖成对应的切换动作。
|
|
60
|
+
*/
|
|
61
|
+
activate(): void;
|
|
62
|
+
protected __applyFocusState(): void;
|
|
63
|
+
getValidateStatus(): 'default' | 'error' | 'warning' | 'success';
|
|
64
|
+
setValidateStatus(status: 'default' | 'error' | 'warning' | 'success'): this;
|
|
65
|
+
/** 校验状态变化后的视觉反馈钩子(默认不变,控件按需覆盖)。 */
|
|
66
|
+
protected __applyValidateState(): void;
|
|
67
|
+
/**
|
|
68
|
+
* 表单取值约定:控件覆盖这两个方法即可被 ICEForm 直接读写。
|
|
69
|
+
* 默认读写 `state.value`(对没有值语义的组件无害)。
|
|
70
|
+
*/
|
|
71
|
+
getFormValue(): any;
|
|
72
|
+
setFormValue(value: any): void;
|
|
73
|
+
setHovered(hovered: boolean): this;
|
|
74
|
+
setPreferredSize(width: number, height: number): this;
|
|
75
|
+
getPreferredSize(): [number, number];
|
|
76
|
+
setPainter(painter: ICEPainter | null): this;
|
|
77
|
+
getPainter(): ICEPainter | null;
|
|
78
|
+
protected __applyHoverState(): void;
|
|
79
|
+
/**
|
|
80
|
+
* UI 组件内部的图元只负责外观,不参与画布级拖拽、变换、连线。
|
|
81
|
+
* 只有真正的 UI 组件(ICEWidget)保留自己的交互配置。
|
|
82
|
+
*/
|
|
83
|
+
addChild(child: any, markDirty?: boolean): void;
|
|
84
|
+
revalidate(): this;
|
|
85
|
+
protected theme(): import("..").ICEThemeTokens;
|
|
86
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 国际化(i18n):把组件里写死的内置文案收进可切换的语言包。
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { setICELocale, t } from 'ice-web-components';
|
|
6
|
+
* setICELocale('en-US'); // 之后新建/重排的组件用英文文案
|
|
7
|
+
* t('table.empty'); // 'No data'
|
|
8
|
+
* t('pagination.total', { total: 42 }); // '42 in total'
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* 约定:
|
|
12
|
+
* - 默认语言 `zh-CN`;内置 `en-US`;`registerICELocale()` 可以加自己的包;
|
|
13
|
+
* - `t(key, vars)` 的兜底链:**当前语言 → 默认语言 → key 本身**(永远有东西可显示);
|
|
14
|
+
* - 组件在「构造 / 重排」时读文案,所以切语言之后需要重建组件或触发一次重排;
|
|
15
|
+
* - `setICELocale()` 只认注册过的语言,没注册过就忽略(不抛异常、也不切换)。
|
|
16
|
+
*/
|
|
17
|
+
export declare type ICELocaleMessages = Record<string, string>;
|
|
18
|
+
/** 默认语言。 */
|
|
19
|
+
export declare const ICE_DEFAULT_LOCALE = "zh-CN";
|
|
20
|
+
/** 内置中文包(组件的默认文案)。 */
|
|
21
|
+
export declare const ICE_LOCALE_ZH_CN: ICELocaleMessages;
|
|
22
|
+
/** 内置英文包。 */
|
|
23
|
+
export declare const ICE_LOCALE_EN_US: ICELocaleMessages;
|
|
24
|
+
/** 注册(或覆盖)一个语言包。 */
|
|
25
|
+
export declare function registerICELocale(locale: string, messages: ICELocaleMessages): void;
|
|
26
|
+
/** 切换语言;未注册的语言会被忽略。 */
|
|
27
|
+
export declare function setICELocale(locale: string): void;
|
|
28
|
+
export declare function getICELocale(): string;
|
|
29
|
+
export declare function getICELocaleNames(): string[];
|
|
30
|
+
/** 取当前语言的完整包(拷贝,避免外部改坏内置包)。 */
|
|
31
|
+
export declare function getICELocaleMessages(locale?: string): ICELocaleMessages;
|
|
32
|
+
/**
|
|
33
|
+
* 取文案:当前语言 → 默认语言 → key 本身;`{name}` 会被 `vars` 里的值替换。
|
|
34
|
+
*/
|
|
35
|
+
export declare function t(key: string, vars?: Record<string, string | number>): string;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export * from './theme/ICETheme';
|
|
2
|
+
export * from './theme/ICEArcadeTheme';
|
|
3
|
+
export * from './core/ICEManager';
|
|
4
|
+
export * from './core/ICEHoverManager';
|
|
5
|
+
export * from './core/ICEPainter';
|
|
6
|
+
export * from './core/ICEOverlayManager';
|
|
7
|
+
export * from './core/ICEFocusManager';
|
|
8
|
+
export * from './core/ICEMessageManager';
|
|
9
|
+
export * from './core/ICEWidget';
|
|
10
|
+
export * from './core/ICEContainer';
|
|
11
|
+
/**
|
|
12
|
+
* 布局类(`ICEFlowLayout` / `ICEBoxLayout` / `ICELayoutManager`)**不在这里再导出**:
|
|
13
|
+
* 它们本来就是 `ice-render` 的东西,用户直接从 `ice-render` 取。
|
|
14
|
+
* 这样本包的导出集合与引擎完全不重叠,「同时 import 两个包」永远不会撞名。
|
|
15
|
+
*/
|
|
16
|
+
export * from './util/ICEOverlayPosition';
|
|
17
|
+
export * from './util/ICEWorldBox';
|
|
18
|
+
export * from './util/ICEAnimation';
|
|
19
|
+
export * from './util/ICEDragReorder';
|
|
20
|
+
export * from './util/ICEAccessibilityMirror';
|
|
21
|
+
export * from './i18n/ICEI18n';
|
|
22
|
+
export * from './util/ICEStyle';
|
|
23
|
+
export * from './components/ICELabel';
|
|
24
|
+
export * from './components/ICEButton';
|
|
25
|
+
export * from './components/ICEPanel';
|
|
26
|
+
export * from './components/ICEBadge';
|
|
27
|
+
export * from './components/ICETag';
|
|
28
|
+
export * from './components/ICETooltip';
|
|
29
|
+
export * from './components/ICEPopover';
|
|
30
|
+
export * from './components/ICEPopconfirm';
|
|
31
|
+
export * from './components/ICEModal';
|
|
32
|
+
export * from './components/ICEPagination';
|
|
33
|
+
export * from './components/ICEDropdown';
|
|
34
|
+
export * from './components/ICESelect';
|
|
35
|
+
export * from './components/ICEDrawer';
|
|
36
|
+
export * from './components/ICEList';
|
|
37
|
+
export * from './components/ICETree';
|
|
38
|
+
export * from './components/ICESegmented';
|
|
39
|
+
export * from './components/ICEEmpty';
|
|
40
|
+
export * from './components/ICESkeleton';
|
|
41
|
+
export * from './components/ICECollapse';
|
|
42
|
+
export * from './components/ICEDescriptions';
|
|
43
|
+
export * from './components/ICETimeline';
|
|
44
|
+
export * from './components/ICESpin';
|
|
45
|
+
export * from './components/ICERate';
|
|
46
|
+
export * from './components/ICESteps';
|
|
47
|
+
export * from './components/ICEResult';
|
|
48
|
+
export * from './components/ICEInputNumber';
|
|
49
|
+
export * from './components/ICEAutoComplete';
|
|
50
|
+
export * from './components/ICETreeSelect';
|
|
51
|
+
export * from './components/ICECascader';
|
|
52
|
+
export * from './components/ICETransfer';
|
|
53
|
+
export * from './components/ICEUpload';
|
|
54
|
+
export * from './components/ICECarousel';
|
|
55
|
+
export * from './components/ICEDatePicker';
|
|
56
|
+
export * from './components/ICETimePicker';
|
|
57
|
+
export * from './components/ICEComment';
|
|
58
|
+
export * from './components/ICEColorPicker';
|
|
59
|
+
export * from './components/ICEImageView';
|
|
60
|
+
export * from './components/ICEAvatar';
|
|
61
|
+
export * from './components/ICEAvatarGroup';
|
|
62
|
+
export * from './components/ICEIcon';
|
|
63
|
+
export * from './components/ICESvgIcon';
|
|
64
|
+
export * from './components/ICESeparator';
|
|
65
|
+
export * from './components/ICECheckBox';
|
|
66
|
+
export * from './components/ICERadioButton';
|
|
67
|
+
export * from './components/ICESwitch';
|
|
68
|
+
export * from './components/ICEProgressBar';
|
|
69
|
+
export * from './components/ICESlider';
|
|
70
|
+
export * from './components/ICEScrollPane';
|
|
71
|
+
export * from './components/ICEFormItem';
|
|
72
|
+
export * from './components/ICEForm';
|
|
73
|
+
export * from './components/ICECard';
|
|
74
|
+
export * from './components/ICETabs';
|
|
75
|
+
export * from './components/ICETextField';
|
|
76
|
+
export * from './components/ICETextArea';
|
|
77
|
+
export * from './components/ICEPasswordField';
|
|
78
|
+
export * from './components/ICEAlert';
|
|
79
|
+
export * from './components/ICETable';
|
|
80
|
+
export * from './components/ICEMenu';
|
|
81
|
+
export * from './components/ICEStatCard';
|
|
82
|
+
export * from './components/ICEStatistic';
|
|
83
|
+
export * from './components/ICEBreadcrumb';
|
|
84
|
+
export * from './components/ICERadioGroup';
|
|
85
|
+
export * from './components/ICECheckboxGroup';
|
|
86
|
+
export * from './components/ICESplitter';
|
|
87
|
+
export * from './components/ICEWatermark';
|
|
88
|
+
export * from './components/ICETileMap';
|
|
89
|
+
export * from './components/ICEVirtualList';
|
|
90
|
+
export * from './components/ICEKanban';
|
|
91
|
+
export * from './components/ICETypography';
|
|
92
|
+
export * from './components/ICEBackTop';
|
|
93
|
+
export * from './components/ICEAnchor';
|
|
94
|
+
export * from './components/ICEImagePreview';
|
|
95
|
+
export * from './components/ICETour';
|
|
96
|
+
export * from './components/ICECalendar';
|
|
97
|
+
export * from './components/ICEWindow';
|
|
98
|
+
export * from './components/ICEIconTile';
|
|
99
|
+
export * from './components/ICESpace';
|
|
100
|
+
export * from './components/ICEGrid';
|
|
101
|
+
export * from './components/ICEFloatButton';
|
|
102
|
+
export * from './model/ICEButtonModel';
|
|
103
|
+
export * from './model/ICEToggleModel';
|
|
104
|
+
export * from './model/ICEBoundedRangeModel';
|
|
105
|
+
export * from './model/ICEFormModel';
|
|
106
|
+
export * from './model/ICESelectionModel';
|
|
107
|
+
export * from './model/ICEMinesweeperModel';
|
|
108
|
+
export * from './model/ICETetrisModel';
|
|
109
|
+
export * from './model/ICESnakeModel';
|
|
110
|
+
export * from './model/ICEHighScoreModel';
|
|
111
|
+
export * from './model/ICE2048Model';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 2048 的纯逻辑模型(不碰 canvas)。
|
|
3
|
+
*
|
|
4
|
+
* 规则按经典的 Gabriele Cirulli 版 2048:
|
|
5
|
+
* - 开局两个块,值只能是 2 或 4(4 的概率由 `spawnFourChance` 控制,默认 10%);
|
|
6
|
+
* - `move(dir)` 把整盘往一个方向推:**同一次移动里每个块最多合并一次** ——
|
|
7
|
+
* `2,2,2,2` 往左是 `4,4`(不是 `8`),`2,2,4` 往左是 `4,4`(新合出来的 4 不会再吞掉后面的 4);
|
|
8
|
+
* - 合并得分 = 合并出来的值(4+4→8 得 8 分);
|
|
9
|
+
* - **只有真的动了才生成新块、才计一步**:推不动的方向返回 `false`,什么都不变;
|
|
10
|
+
* - 棋盘填满且相邻无可合并 → game over;合并出 `target`(默认 2048)即 `isWon`,
|
|
11
|
+
* 但**不结束**,可以继续冲高分;
|
|
12
|
+
* - 新块位置由注入的 `random` 决定,测试可复现;`spawnAfterMove: false` 是「不刷新」的练习模式。
|
|
13
|
+
*/
|
|
14
|
+
/** 四个方向。 */
|
|
15
|
+
export declare type ICE2048Direction = 'up' | 'right' | 'down' | 'left';
|
|
16
|
+
/** 按上、右、下、左顺序排列(UI 画方向提示可以直接用)。 */
|
|
17
|
+
export declare const ICE_2048_DIRECTIONS: ICE2048Direction[];
|
|
18
|
+
export declare type ICE2048Cell = number | null;
|
|
19
|
+
export interface ICE2048Options {
|
|
20
|
+
rows?: number;
|
|
21
|
+
cols?: number;
|
|
22
|
+
/** 随机源(0..1),默认 `Math.random` */
|
|
23
|
+
random?: () => number;
|
|
24
|
+
/** 合并出这个值算赢,默认 2048 */
|
|
25
|
+
target?: number;
|
|
26
|
+
/** 新块是 4 的概率,默认 0.1(其余是 2) */
|
|
27
|
+
spawnFourChance?: number;
|
|
28
|
+
/** 移动成功后是否生成新块,默认 true(关掉就是练习模式,便于测试断言整盘) */
|
|
29
|
+
spawnAfterMove?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare type ICE2048Listener = (model: ICE2048Model) => void;
|
|
32
|
+
export declare class ICE2048Model {
|
|
33
|
+
private rows;
|
|
34
|
+
private cols;
|
|
35
|
+
private random;
|
|
36
|
+
private target;
|
|
37
|
+
private spawnFourChance;
|
|
38
|
+
private spawnAfterMove;
|
|
39
|
+
private cells;
|
|
40
|
+
private score;
|
|
41
|
+
private moves;
|
|
42
|
+
private won;
|
|
43
|
+
private gameOver;
|
|
44
|
+
private paused;
|
|
45
|
+
/** 上一次移动里「合并落在哪几格」(UI 拿它做高亮 / 特效) */
|
|
46
|
+
private lastMerged;
|
|
47
|
+
private listeners;
|
|
48
|
+
constructor(options?: ICE2048Options);
|
|
49
|
+
getRows(): number;
|
|
50
|
+
getCols(): number;
|
|
51
|
+
/** 一维盘面(行优先),空格是 null。 */
|
|
52
|
+
getCells(): ICE2048Cell[];
|
|
53
|
+
getCell(row: number, col: number): ICE2048Cell;
|
|
54
|
+
getScore(): number;
|
|
55
|
+
getMoves(): number;
|
|
56
|
+
getTarget(): number;
|
|
57
|
+
/** 盘面上最大的块(空盘为 0)。 */
|
|
58
|
+
getBestTile(): number;
|
|
59
|
+
isWon(): boolean;
|
|
60
|
+
isGameOver(): boolean;
|
|
61
|
+
isPaused(): boolean;
|
|
62
|
+
/** 上一次移动发生合并的格子(`[row, col]`);没合并就是空数组。 */
|
|
63
|
+
getLastMerged(): Array<[number, number]>;
|
|
64
|
+
/** 暂停:棋盘类页面(掌机)共用同一套 pause/resume 契约,这里暂停只挡输入。 */
|
|
65
|
+
pause(): void;
|
|
66
|
+
resume(): void;
|
|
67
|
+
/** 还有没有任何一个方向推得动。 */
|
|
68
|
+
canMove(): boolean;
|
|
69
|
+
addChangeListener(listener: ICE2048Listener): () => void;
|
|
70
|
+
/** 往一个方向推;推得动才返回 true(并计一步、生成新块)。 */
|
|
71
|
+
move(direction: ICE2048Direction): boolean;
|
|
72
|
+
/** 重置:可只覆盖部分选项。 */
|
|
73
|
+
reset(options?: ICE2048Options): void;
|
|
74
|
+
/** 直接摆盘(长度必须等于 rows*cols,否则抛)。 */
|
|
75
|
+
setCellsForTest(cells: ICE2048Cell[]): void;
|
|
76
|
+
private __resetBoard;
|
|
77
|
+
/** 在随机空格里放一个块:值 = 4 的概率由 spawnFourChance 控制。 */
|
|
78
|
+
private __spawnTile;
|
|
79
|
+
private __lineCount;
|
|
80
|
+
/**
|
|
81
|
+
* 第 index 条线在给定方向下的**遍历顺序**(始终是「先碰到的在前」):
|
|
82
|
+
* 向左:从左到右;向右:从右到左;向上:从上到下;向下:从下到上。
|
|
83
|
+
*/
|
|
84
|
+
private __lineIndices;
|
|
85
|
+
/** 只算「推得动吗」,不改盘面(复制一份跑一遍)。 */
|
|
86
|
+
private __wouldMove;
|
|
87
|
+
/** 满盘且四邻都没有相同的块 → 结束。 */
|
|
88
|
+
private __refreshGameOver;
|
|
89
|
+
private notify;
|
|
90
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare type ICEBoundedRangeModelListener = (model: ICEBoundedRangeModel) => void;
|
|
2
|
+
export declare class ICEBoundedRangeModel {
|
|
3
|
+
private value;
|
|
4
|
+
private min;
|
|
5
|
+
private max;
|
|
6
|
+
private listeners;
|
|
7
|
+
constructor(options?: {
|
|
8
|
+
value?: number;
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
});
|
|
12
|
+
getValue(): number;
|
|
13
|
+
getMinimum(): number;
|
|
14
|
+
getMaximum(): number;
|
|
15
|
+
setValue(value: number): this;
|
|
16
|
+
addChangeListener(listener: ICEBoundedRangeModelListener): this;
|
|
17
|
+
removeChangeListener(listener: ICEBoundedRangeModelListener): this;
|
|
18
|
+
private __clamp;
|
|
19
|
+
private __notify;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare type ICEButtonModelListener = (model: ICEButtonModel) => void;
|
|
2
|
+
export declare class ICEButtonModel {
|
|
3
|
+
private enabled;
|
|
4
|
+
private pressed;
|
|
5
|
+
private listeners;
|
|
6
|
+
constructor(options?: {
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
});
|
|
9
|
+
isEnabled(): boolean;
|
|
10
|
+
setEnabled(enabled: boolean): this;
|
|
11
|
+
isPressed(): boolean;
|
|
12
|
+
setPressed(pressed: boolean): this;
|
|
13
|
+
addChangeListener(listener: ICEButtonModelListener): this;
|
|
14
|
+
removeChangeListener(listener: ICEButtonModelListener): this;
|
|
15
|
+
private __notify;
|
|
16
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 表单校验模型:字段值 + 规则 + 错误 + 变更通知。
|
|
3
|
+
*
|
|
4
|
+
* 纯逻辑、不碰 canvas —— UI 层(ICEFormItem / ICEForm)只负责把值与错误**画出来**。
|
|
5
|
+
* 规则语义:一条规则失败即停止(取第一条错误信息)。
|
|
6
|
+
*/
|
|
7
|
+
export interface ICEFormRule {
|
|
8
|
+
/** 必填:null/undefined/空串/空数组/false 都算缺失(开关与多选同样适用) */
|
|
9
|
+
required?: boolean;
|
|
10
|
+
/** 自定义错误文案(不填用默认文案) */
|
|
11
|
+
message?: string;
|
|
12
|
+
/** 数值下界 / 上界(值可转成数字时生效) */
|
|
13
|
+
min?: number;
|
|
14
|
+
max?: number;
|
|
15
|
+
minLength?: number;
|
|
16
|
+
maxLength?: number;
|
|
17
|
+
pattern?: RegExp;
|
|
18
|
+
/** 自定义校验:返回错误文案表示失败,返回 null/undefined 表示通过 */
|
|
19
|
+
validator?: (value: any, values: Record<string, any>) => string | null | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* 异步校验(如「用户名是否被占用」)。
|
|
22
|
+
*
|
|
23
|
+
* 只在显式调用 `validateFieldAsync` / `validateAsync` 时执行 —— 值变化触发的自动校验
|
|
24
|
+
* 只跑同步规则,避免每次按键都发请求。
|
|
25
|
+
*/
|
|
26
|
+
asyncValidator?: (value: any, values: Record<string, any>) => Promise<string | null | undefined>;
|
|
27
|
+
}
|
|
28
|
+
export interface ICEFormFieldOptions {
|
|
29
|
+
name: string;
|
|
30
|
+
label?: string;
|
|
31
|
+
rules?: ICEFormRule[];
|
|
32
|
+
/**
|
|
33
|
+
* 依赖的字段名:**这些字段变化时本字段自动重算**。
|
|
34
|
+
* 典型场景「确认密码」「结束日期 ≥ 开始日期」——本字段的合法性取决于别的字段。
|
|
35
|
+
*/
|
|
36
|
+
dependencies?: string[];
|
|
37
|
+
value?: any;
|
|
38
|
+
}
|
|
39
|
+
export interface ICEFormModelOptions {
|
|
40
|
+
/** 改值时是否自动重算该字段(默认 change;'none' 表示只在手动校验时算) */
|
|
41
|
+
validateTrigger?: 'change' | 'none';
|
|
42
|
+
}
|
|
43
|
+
export declare type ICEFormModelListener = (model: ICEFormModel) => void;
|
|
44
|
+
interface ICEFormField {
|
|
45
|
+
name: string;
|
|
46
|
+
label: string;
|
|
47
|
+
rules: ICEFormRule[];
|
|
48
|
+
dependencies: string[];
|
|
49
|
+
value: any;
|
|
50
|
+
initialValue: any;
|
|
51
|
+
error: string | null;
|
|
52
|
+
validating: boolean;
|
|
53
|
+
}
|
|
54
|
+
export declare class ICEFormModel {
|
|
55
|
+
private fields;
|
|
56
|
+
private listeners;
|
|
57
|
+
private validateTrigger;
|
|
58
|
+
constructor(options?: ICEFormModelOptions);
|
|
59
|
+
addField(options: ICEFormFieldOptions): this;
|
|
60
|
+
removeField(name: string): this;
|
|
61
|
+
getField(name: string): ICEFormField | undefined;
|
|
62
|
+
getFieldNames(): string[];
|
|
63
|
+
/** 直接依赖 `name` 的字段(反向查询)。 */
|
|
64
|
+
getDependents(name: string): string[];
|
|
65
|
+
getLabel(name: string): string;
|
|
66
|
+
getValue(name: string): any;
|
|
67
|
+
getValues(): Record<string, any>;
|
|
68
|
+
/**
|
|
69
|
+
* 设置字段值。默认按 `validateTrigger` 决定是否立刻重算该字段(默认重算),
|
|
70
|
+
* `silent: true` 表示只写值、不重算也不通知(批量初始化用)。
|
|
71
|
+
*/
|
|
72
|
+
setValue(name: string, value: any, options?: {
|
|
73
|
+
silent?: boolean;
|
|
74
|
+
}): this;
|
|
75
|
+
setValues(values: Record<string, any>, options?: {
|
|
76
|
+
silent?: boolean;
|
|
77
|
+
}): this;
|
|
78
|
+
/** 依赖 `name` 的字段重算(静默:调用方统一 __notify)。 */
|
|
79
|
+
private __validateDependents;
|
|
80
|
+
getError(name: string): string | null | undefined;
|
|
81
|
+
/** 只返回有错误的字段(无错误时为空对象) */
|
|
82
|
+
getErrors(): Record<string, string>;
|
|
83
|
+
hasErrors(): boolean;
|
|
84
|
+
/** 校验单个字段并写回错误;返回错误文案(null 表示通过)。 */
|
|
85
|
+
validateField(name: string, options?: {
|
|
86
|
+
silent?: boolean;
|
|
87
|
+
}): string | null;
|
|
88
|
+
/** 校验全部字段并返回是否全部通过。 */
|
|
89
|
+
validate(): boolean;
|
|
90
|
+
/** 该字段是否正在异步校验中(UI 可显示「校验中…」)。 */
|
|
91
|
+
isValidating(name: string): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* 单字段异步校验:先跑同步规则(失败即短路、不发请求),再依次跑异步校验器。
|
|
94
|
+
* 返回错误文案(null 表示通过)。
|
|
95
|
+
*/
|
|
96
|
+
validateFieldAsync(name: string): Promise<string | null>;
|
|
97
|
+
/** 校验全部字段(同步 + 异步),返回是否全部通过。 */
|
|
98
|
+
validateAsync(): Promise<boolean>;
|
|
99
|
+
/** 回到初始值并清空错误。 */
|
|
100
|
+
reset(): this;
|
|
101
|
+
addChangeListener(listener: ICEFormModelListener): () => void;
|
|
102
|
+
private __check;
|
|
103
|
+
private __notify;
|
|
104
|
+
}
|
|
105
|
+
export {};
|