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.
Files changed (114) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +487 -0
  3. package/dist/index.cjs +1 -0
  4. package/dist/index.mjs +1 -0
  5. package/dist/index.umd.js +1 -0
  6. package/dist/types/components/ICEAlert.d.ts +28 -0
  7. package/dist/types/components/ICEAnchor.d.ts +69 -0
  8. package/dist/types/components/ICEAutoComplete.d.ts +71 -0
  9. package/dist/types/components/ICEAvatar.d.ts +11 -0
  10. package/dist/types/components/ICEAvatarGroup.d.ts +40 -0
  11. package/dist/types/components/ICEBackTop.d.ts +39 -0
  12. package/dist/types/components/ICEBadge.d.ts +17 -0
  13. package/dist/types/components/ICEBreadcrumb.d.ts +82 -0
  14. package/dist/types/components/ICEButton.d.ts +25 -0
  15. package/dist/types/components/ICECalendar.d.ts +84 -0
  16. package/dist/types/components/ICECard.d.ts +22 -0
  17. package/dist/types/components/ICECarousel.d.ts +86 -0
  18. package/dist/types/components/ICECascader.d.ts +84 -0
  19. package/dist/types/components/ICECheckBox.d.ts +21 -0
  20. package/dist/types/components/ICECheckboxGroup.d.ts +75 -0
  21. package/dist/types/components/ICECollapse.d.ts +49 -0
  22. package/dist/types/components/ICEColorPicker.d.ts +52 -0
  23. package/dist/types/components/ICEComment.d.ts +36 -0
  24. package/dist/types/components/ICEDatePicker.d.ts +90 -0
  25. package/dist/types/components/ICEDescriptions.d.ts +40 -0
  26. package/dist/types/components/ICEDrawer.d.ts +59 -0
  27. package/dist/types/components/ICEDropdown.d.ts +63 -0
  28. package/dist/types/components/ICEEmpty.d.ts +28 -0
  29. package/dist/types/components/ICEFloatButton.d.ts +63 -0
  30. package/dist/types/components/ICEForm.d.ts +48 -0
  31. package/dist/types/components/ICEFormItem.d.ts +65 -0
  32. package/dist/types/components/ICEGrid.d.ts +59 -0
  33. package/dist/types/components/ICEIcon.d.ts +9 -0
  34. package/dist/types/components/ICEIconTile.d.ts +53 -0
  35. package/dist/types/components/ICEImagePreview.d.ts +91 -0
  36. package/dist/types/components/ICEImageView.d.ts +62 -0
  37. package/dist/types/components/ICEInputNumber.d.ts +54 -0
  38. package/dist/types/components/ICEKanban.d.ts +85 -0
  39. package/dist/types/components/ICELabel.d.ts +28 -0
  40. package/dist/types/components/ICEList.d.ts +59 -0
  41. package/dist/types/components/ICEMenu.d.ts +48 -0
  42. package/dist/types/components/ICEModal.d.ts +73 -0
  43. package/dist/types/components/ICEPagination.d.ts +62 -0
  44. package/dist/types/components/ICEPanel.d.ts +7 -0
  45. package/dist/types/components/ICEPasswordField.d.ts +18 -0
  46. package/dist/types/components/ICEPopconfirm.d.ts +21 -0
  47. package/dist/types/components/ICEPopover.d.ts +48 -0
  48. package/dist/types/components/ICEProgressBar.d.ts +37 -0
  49. package/dist/types/components/ICERadioButton.d.ts +21 -0
  50. package/dist/types/components/ICERadioGroup.d.ts +71 -0
  51. package/dist/types/components/ICERate.d.ts +43 -0
  52. package/dist/types/components/ICEResult.d.ts +30 -0
  53. package/dist/types/components/ICEScrollPane.d.ts +72 -0
  54. package/dist/types/components/ICESegmented.d.ts +34 -0
  55. package/dist/types/components/ICESelect.d.ts +85 -0
  56. package/dist/types/components/ICESeparator.d.ts +7 -0
  57. package/dist/types/components/ICESkeleton.d.ts +29 -0
  58. package/dist/types/components/ICESlider.d.ts +63 -0
  59. package/dist/types/components/ICESpace.d.ts +51 -0
  60. package/dist/types/components/ICESpin.d.ts +33 -0
  61. package/dist/types/components/ICESplitter.d.ts +85 -0
  62. package/dist/types/components/ICEStatCard.d.ts +14 -0
  63. package/dist/types/components/ICEStatistic.d.ts +78 -0
  64. package/dist/types/components/ICESteps.d.ts +31 -0
  65. package/dist/types/components/ICESvgIcon.d.ts +9 -0
  66. package/dist/types/components/ICESwitch.d.ts +23 -0
  67. package/dist/types/components/ICETable.d.ts +250 -0
  68. package/dist/types/components/ICETabs.d.ts +17 -0
  69. package/dist/types/components/ICETag.d.ts +15 -0
  70. package/dist/types/components/ICETextArea.d.ts +8 -0
  71. package/dist/types/components/ICETextField.d.ts +80 -0
  72. package/dist/types/components/ICETileMap.d.ts +152 -0
  73. package/dist/types/components/ICETimePicker.d.ts +81 -0
  74. package/dist/types/components/ICETimeline.d.ts +33 -0
  75. package/dist/types/components/ICETooltip.d.ts +55 -0
  76. package/dist/types/components/ICETour.d.ts +97 -0
  77. package/dist/types/components/ICETransfer.d.ts +68 -0
  78. package/dist/types/components/ICETree.d.ts +107 -0
  79. package/dist/types/components/ICETreeSelect.d.ts +64 -0
  80. package/dist/types/components/ICETypography.d.ts +67 -0
  81. package/dist/types/components/ICEUpload.d.ts +75 -0
  82. package/dist/types/components/ICEVirtualList.d.ts +100 -0
  83. package/dist/types/components/ICEWatermark.d.ts +49 -0
  84. package/dist/types/components/ICEWindow.d.ts +159 -0
  85. package/dist/types/core/ICEContainer.d.ts +10 -0
  86. package/dist/types/core/ICEFocusManager.d.ts +70 -0
  87. package/dist/types/core/ICEHoverManager.d.ts +26 -0
  88. package/dist/types/core/ICEManager.d.ts +24 -0
  89. package/dist/types/core/ICEMessageManager.d.ts +80 -0
  90. package/dist/types/core/ICEOverlayManager.d.ts +92 -0
  91. package/dist/types/core/ICEPainter.d.ts +12 -0
  92. package/dist/types/core/ICEWidget.d.ts +86 -0
  93. package/dist/types/i18n/ICEI18n.d.ts +35 -0
  94. package/dist/types/index.d.ts +111 -0
  95. package/dist/types/model/ICE2048Model.d.ts +90 -0
  96. package/dist/types/model/ICEBoundedRangeModel.d.ts +20 -0
  97. package/dist/types/model/ICEButtonModel.d.ts +16 -0
  98. package/dist/types/model/ICEFormModel.d.ts +105 -0
  99. package/dist/types/model/ICEHighScoreModel.d.ts +60 -0
  100. package/dist/types/model/ICEMinesweeperModel.d.ts +102 -0
  101. package/dist/types/model/ICESelectionModel.d.ts +31 -0
  102. package/dist/types/model/ICESnakeModel.d.ts +90 -0
  103. package/dist/types/model/ICETetrisModel.d.ts +118 -0
  104. package/dist/types/model/ICEToggleModel.d.ts +14 -0
  105. package/dist/types/theme/ICEArcadeTheme.d.ts +22 -0
  106. package/dist/types/theme/ICETheme.d.ts +120 -0
  107. package/dist/types/util/ICEAccessibilityMirror.d.ts +55 -0
  108. package/dist/types/util/ICEAnimation.d.ts +71 -0
  109. package/dist/types/util/ICEDragReorder.d.ts +102 -0
  110. package/dist/types/util/ICENativeInput.d.ts +65 -0
  111. package/dist/types/util/ICEOverlayPosition.d.ts +52 -0
  112. package/dist/types/util/ICEStyle.d.ts +60 -0
  113. package/dist/types/util/ICEWorldBox.d.ts +14 -0
  114. package/package.json +56 -0
@@ -0,0 +1,21 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ /**
3
+ * 复选框:点击或 Enter/Space 切换勾选,触发 `change`,可直接进表单。
4
+ */
5
+ export declare class ICECheckBox extends ICEWidget {
6
+ private model;
7
+ private box;
8
+ private mark;
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 __toggle;
19
+ protected __applyHoverState(): void;
20
+ private __sync;
21
+ }
@@ -0,0 +1,75 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ import { ICECheckBox } from './ICECheckBox';
3
+ /**
4
+ * 多选组(Ant Checkbox.Group):一组可多选的选项,值是 `string[]`(按选项顺序)。
5
+ *
6
+ * - 整行可点(点文字也能勾选);
7
+ * - `max` 限制最多勾选几项,超出时忽略并触发 `exceed`(载荷 `{ value, max }`);
8
+ * - 键盘:方向键移动活动项、Space 切换;
9
+ * - 表单:值为数组,`setFormValue` 兼容单值 / 空值;
10
+ * - 事件:值变化触发 `change`(载荷 `{ value }`)并调用 `onChange`。
11
+ */
12
+ export interface ICECheckboxGroupOption {
13
+ value: string;
14
+ label?: string;
15
+ disabled?: boolean;
16
+ }
17
+ export interface ICECheckboxGroupOptions {
18
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
19
+ id?: string;
20
+ options: ICECheckboxGroupOption[];
21
+ /** 已选值(按选项顺序归一化) */
22
+ value?: string[];
23
+ direction?: 'horizontal' | 'vertical';
24
+ itemGap?: number;
25
+ /** 最多可勾选数量,不传表示不限 */
26
+ max?: number;
27
+ left?: number;
28
+ top?: number;
29
+ width?: number;
30
+ height?: number;
31
+ fontSize?: number;
32
+ onChange?: (value: string[]) => void;
33
+ }
34
+ export declare class ICECheckboxGroup extends ICEWidget {
35
+ private options;
36
+ private selected;
37
+ private direction;
38
+ private itemGap;
39
+ private fontSize;
40
+ private itemHeight;
41
+ private max;
42
+ private onChange;
43
+ private itemNodes;
44
+ private checkboxNodes;
45
+ private labelNodes;
46
+ private activeIndex;
47
+ private bound;
48
+ constructor(props: ICECheckboxGroupOptions);
49
+ /** 已选值(按选项顺序)。 */
50
+ getValue(): string[];
51
+ getCheckedCount(): number;
52
+ isChecked(value: string): boolean;
53
+ /** 程序式设值:只发 `change` 事件,不回调 `onChange`。 */
54
+ setValue(value: string[]): this;
55
+ /** 全选(受 `max` 限制)。 */
56
+ checkAll(): this;
57
+ clear(): this;
58
+ getFormValue(): any;
59
+ setFormValue(value: any): void;
60
+ getOptionNodes(): ICEWidget[];
61
+ getItemNode(value: string): ICEWidget | null;
62
+ getCheckboxNode(value: string): ICECheckBox | null;
63
+ getLabelTexts(): string[];
64
+ getActiveIndex(): number;
65
+ setOptions(options: ICECheckboxGroupOption[]): this;
66
+ protected afterAddHandler(): void;
67
+ /** 去掉未知值 / 重复值 / 禁用值,并按选项顺序排列。 */
68
+ private __normalize;
69
+ private __onKeyDown;
70
+ private __moveActive;
71
+ /** 切换一个选项;`user` 为 true 时回调 onChange。 */
72
+ private __toggle;
73
+ private __syncSelection;
74
+ private __render;
75
+ }
@@ -0,0 +1,49 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ /**
3
+ * 折叠面板(Ant Collapse / Swing 无直接对应物)。
4
+ *
5
+ * - 每项 = 标题行(▸/▾ + 标题)+ 展开时的内容区;内容支持纯文本或组件工厂;
6
+ * - `accordion: true` 时同时只展开一个;展开/收起会重排并回调 onExpand(keys);
7
+ * - 标题行是独立命中区(点标题只切换展开,不触发内容交互)。
8
+ */
9
+ export interface ICECollapseItem {
10
+ key: string;
11
+ title: string;
12
+ content?: string | (() => any);
13
+ disabled?: boolean;
14
+ }
15
+ export interface ICECollapseOptions {
16
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
17
+ id?: string;
18
+ items: ICECollapseItem[];
19
+ activeKeys?: string[];
20
+ accordion?: boolean;
21
+ left?: number;
22
+ top?: number;
23
+ width?: number;
24
+ headerHeight?: number;
25
+ contentHeight?: number;
26
+ onChange?: (keys: string[]) => void;
27
+ onExpand?: (keys: string[]) => void;
28
+ }
29
+ export declare class ICECollapse extends ICEWidget {
30
+ private items;
31
+ private active;
32
+ private accordion;
33
+ private headerHeight;
34
+ private contentHeight;
35
+ private expandCallback;
36
+ private headerNodes;
37
+ private contentNodes;
38
+ private offsetMap;
39
+ constructor(props: ICECollapseOptions);
40
+ getActiveKeys(): string[];
41
+ setActiveKeys(keys: string[]): this;
42
+ getHeaderNode(key: string): ICEWidget | null;
43
+ getContentNode(key: string): ICEWidget | null;
44
+ getItemTop(key: string): number;
45
+ private __toggle;
46
+ private __render;
47
+ /** 宽度变化时重排标题/内容宽度(引擎只回调 __afterStateMerge)。 */
48
+ protected __afterStateMerge(sizeChanged: boolean): void;
49
+ }
@@ -0,0 +1,52 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ /**
3
+ * 颜色选择器(Ant ColorPicker 的色板网格最小版)。
4
+ *
5
+ * - 按 `colors` 渲染色块网格(`columns` 控制列数),选中色块带描边环;
6
+ * - 点击色块回写 value 并回调 `onChange`;`disabled` 时忽略交互且不可聚焦;
7
+ * - 键盘 ↑/↓/←/→ 在网格里移动选择;
8
+ * - 表单集成:`getFormValue` / `setFormValue`,错误态边框标红。
9
+ */
10
+ export interface ICEColorPickerOptions {
11
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
12
+ id?: string;
13
+ colors?: string[];
14
+ columns?: number;
15
+ value?: string;
16
+ swatchSize?: number;
17
+ gap?: number;
18
+ disabled?: boolean;
19
+ left?: number;
20
+ top?: number;
21
+ width?: number;
22
+ height?: number;
23
+ onChange?: (color: string) => void;
24
+ }
25
+ export declare class ICEColorPicker extends ICEWidget {
26
+ private colors;
27
+ private columns;
28
+ private value?;
29
+ private swatchSize;
30
+ private gap;
31
+ private padding;
32
+ private disabled;
33
+ private onChange;
34
+ private cells;
35
+ private running;
36
+ constructor(props?: ICEColorPickerOptions);
37
+ protected afterAddHandler(): void;
38
+ getValue(): string | undefined;
39
+ setValue(hex: string): this;
40
+ isSelected(hex: string): boolean;
41
+ getSwatchNodes(): ICEWidget[];
42
+ getSwatchNode(color: string): ICEWidget | null;
43
+ getRowCount(): number;
44
+ getFormValue(): any;
45
+ setFormValue(value: any): void;
46
+ protected __applyValidateState(): void;
47
+ private __pick;
48
+ private __onKeyDown;
49
+ private __render;
50
+ private static __resolveSwatchSize;
51
+ private static __defaultPalette;
52
+ }
@@ -0,0 +1,36 @@
1
+ import { ICEButton } from './ICEButton';
2
+ import { ICEWidget } from '../core/ICEWidget';
3
+ /**
4
+ * 评论(Ant Comment 的最小版):文字头像 + 作者 + 时间 + 正文 + 操作按钮 + 嵌套回复。
5
+ *
6
+ * 布局自上而下:头像在左,右侧依次是「作者 · 时间」「正文」「操作」「回复(缩进)」。
7
+ * 高度按内容自动累加(正文单行 20px,多行请自行用 content 组件工厂)。
8
+ */
9
+ export interface ICECommentAction {
10
+ key: string;
11
+ text: string;
12
+ }
13
+ export interface ICECommentOptions {
14
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
15
+ id?: string;
16
+ author: string;
17
+ content: string;
18
+ time?: string;
19
+ /** 文字头像(默认取 author 首字) */
20
+ avatarText?: string;
21
+ avatarColor?: string;
22
+ actions?: ICECommentAction[];
23
+ onAction?: (key: string) => void;
24
+ replies?: ICECommentOptions[];
25
+ left?: number;
26
+ top?: number;
27
+ width?: number;
28
+ indent?: number;
29
+ }
30
+ export declare class ICEComment extends ICEWidget {
31
+ private actionButtons;
32
+ private replyNodes;
33
+ constructor(props: ICECommentOptions);
34
+ getActionButton(key: string): ICEButton | null;
35
+ getReplyNodes(): ICEComment[];
36
+ }
@@ -0,0 +1,90 @@
1
+ import { ICEPanel } from './ICEPanel';
2
+ import { ICEWidget } from '../core/ICEWidget';
3
+ import { ICEOverlayManager } from '../core/ICEOverlayManager';
4
+ /**
5
+ * 日期选择器(Ant DatePicker 的最小版)。
6
+ *
7
+ * - 字段区显示所选日期(可自定义 `format`),未选显示 placeholder,错误态边框标红;
8
+ * - 日历浮层:月份标题 + ‹/› 切月 + 周标题(周一开头)+ 6×7 网格(含上下月补位);
9
+ * 今天、选中日分别高亮;
10
+ * - 值统一是 `YYYY-MM-DD` 字符串(可序列化、可直接进表单);
11
+ * - 关闭策略与 Select 系列一致:浮层 closeOnOutsideClick:false,由组件自己判断点外 + Esc。
12
+ */
13
+ export declare type ICEDatePickerPlacement = 'bottomLeft' | 'bottomRight';
14
+ export interface ICEDatePickerOptions {
15
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
16
+ id?: string;
17
+ value?: string;
18
+ placeholder?: string;
19
+ disabled?: boolean;
20
+ /** 显示格式(默认原样显示 YYYY-MM-DD) */
21
+ format?: (value: string) => string;
22
+ /** 注入「今天」,便于测试与演示 */
23
+ today?: string;
24
+ left?: number;
25
+ top?: number;
26
+ width?: number;
27
+ height?: number;
28
+ cellSize?: number;
29
+ placement?: ICEDatePickerPlacement;
30
+ onChange?: (value: string) => void;
31
+ manager?: ICEOverlayManager;
32
+ }
33
+ export interface ICEDateCell {
34
+ date: string;
35
+ day: number;
36
+ inMonth: boolean;
37
+ isToday: boolean;
38
+ isSelected: boolean;
39
+ }
40
+ export declare class ICEDatePicker extends ICEWidget {
41
+ private value;
42
+ private placeholder;
43
+ private disabled;
44
+ private formatFn;
45
+ private today;
46
+ private cellSize;
47
+ private placement;
48
+ private manager;
49
+ private onChangeCallback;
50
+ private handle;
51
+ private panel;
52
+ private fieldLabel;
53
+ private monthLabel;
54
+ private grid;
55
+ private dayNodes;
56
+ private viewYear;
57
+ private viewMonth;
58
+ private running;
59
+ constructor(props?: ICEDatePickerOptions);
60
+ protected afterAddHandler(): void;
61
+ getValue(): string | null;
62
+ setValue(value: string | null): this;
63
+ getFormValue(): any;
64
+ setFormValue(value: any): void;
65
+ getFieldLabel(): string;
66
+ isOpen(): boolean;
67
+ getPanel(): ICEPanel | null;
68
+ getViewMonth(): {
69
+ year: number;
70
+ month: number;
71
+ };
72
+ setViewMonth(year: number, month: number): this;
73
+ prevMonth(): this;
74
+ nextMonth(): this;
75
+ getDayNode(date: string): ICEWidget | null;
76
+ /** 当前视图月的 6×7 网格(周一开头,含上下月补位)。 */
77
+ getDayCells(): ICEDateCell[];
78
+ activate(): void;
79
+ toggle(): this;
80
+ open(): this;
81
+ close(): this;
82
+ private __setViewFromValue;
83
+ private __pick;
84
+ private __onClick;
85
+ private __onKeyDown;
86
+ private __onGlobalMouseDown;
87
+ private __worldBox;
88
+ private __syncField;
89
+ private __renderPanel;
90
+ }
@@ -0,0 +1,40 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ /**
3
+ * 描述列表(Ant Descriptions):成对的「标签 / 值」,支持单列与多列。
4
+ * 常用于详情页(订单信息、用户资料)。
5
+ */
6
+ export interface ICEDescriptionsItem {
7
+ label: string;
8
+ value: string;
9
+ }
10
+ export interface ICEDescriptionsOptions {
11
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
12
+ id?: string;
13
+ items: ICEDescriptionsItem[];
14
+ column?: number;
15
+ left?: number;
16
+ top?: number;
17
+ width?: number;
18
+ itemHeight?: number;
19
+ labelWidth?: number;
20
+ }
21
+ export declare class ICEDescriptions extends ICEWidget {
22
+ private items;
23
+ private column;
24
+ private itemHeight;
25
+ private labelWidth;
26
+ private rowNodes;
27
+ constructor(props: ICEDescriptionsOptions);
28
+ getRowNodes(): ICEWidget[];
29
+ /** 替换数据并重排(列表内容随选中项变化时用)。 */
30
+ setItems(items: ICEDescriptionsItem[]): this;
31
+ /**
32
+ * 宽度变化时重排内部布局。
33
+ *
34
+ * `__render()` 只在构造与 setItems 时跑,而「窗口缩放 / 分栏拖动」只改 `state.width` ——
35
+ * 引擎在 setState 后只回调 `__afterStateMerge`,不补这次重排的话列宽会停留在旧值
36
+ * (值列宽度算成 0,文字直接消失)。
37
+ */
38
+ protected __afterStateMerge(sizeChanged: boolean): void;
39
+ private __render;
40
+ }
@@ -0,0 +1,59 @@
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
+ * 与 ICEModal 同源(遮罩 + 焦点范围 + 关闭途径),差别只在:
10
+ * - 面板贴边(right / left / top / bottom)并沿该方向占满整条边;
11
+ * - 入场动效是与方向一致的滑入(A5 的 `slideIn`)。
12
+ */
13
+ export declare type ICEDrawerPlacement = 'right' | 'left' | 'top' | 'bottom';
14
+ export declare type ICEDrawerCloseReason = 'mask' | 'esc' | 'close' | 'api';
15
+ export interface ICEDrawerOptions {
16
+ title?: string;
17
+ content?: string | (() => any);
18
+ placement?: ICEDrawerPlacement;
19
+ /** left/right 方向的宽度(默认 360) */
20
+ width?: number;
21
+ /** top/bottom 方向的高度(默认 240) */
22
+ height?: number;
23
+ closable?: boolean;
24
+ maskClosable?: boolean;
25
+ closeOnEsc?: boolean;
26
+ onClose?: (reason: ICEDrawerCloseReason) => void;
27
+ manager?: ICEOverlayManager;
28
+ focusManager?: ICEFocusManager;
29
+ animation?: {
30
+ duration?: number;
31
+ delay?: number;
32
+ easing?: ICEEasing;
33
+ driver?: ICEFrameDriver;
34
+ };
35
+ }
36
+ export declare class ICEDrawer {
37
+ private ice;
38
+ private options;
39
+ private manager;
40
+ private focus;
41
+ private handle;
42
+ private mask;
43
+ private panel;
44
+ private closeButton;
45
+ private previousFocus;
46
+ private pendingReason;
47
+ constructor(ice: any, options?: ICEDrawerOptions);
48
+ isOpen(): boolean;
49
+ getMask(): ICEPanel | null;
50
+ getPanel(): ICEPanel | null;
51
+ getCloseButton(): ICEButton | null;
52
+ open(): this;
53
+ close(reason?: ICEDrawerCloseReason): this;
54
+ private __handleClosed;
55
+ private __createPanel;
56
+ private __visibleWorldRect;
57
+ }
58
+ /** 便捷入口:`openDrawer(ice, options)`。 */
59
+ export declare function openDrawer(ice: any, options?: ICEDrawerOptions): ICEDrawer;
@@ -0,0 +1,63 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ import { ICEOverlayManager } from '../core/ICEOverlayManager';
3
+ import type { ICEOverlayPlacement } from '../util/ICEOverlayPosition';
4
+ /**
5
+ * 下拉菜单:点击触发组件弹出选项列表。
6
+ *
7
+ * - 弹出/定位/点外关闭/Esc 全部复用 `ICEOverlayManager`;
8
+ * - 菜单项支持 disabled 与选中态(primary + ✓);点选回调 `onSelect(item, index)`;
9
+ * - 键盘:↑/↓ 在可选项间移动(跳过 disabled、首尾回绕),Enter 选中并关闭。
10
+ * 关闭状态下不响应方向键(避免抢走页面的按键)。
11
+ */
12
+ export interface ICEDropdownItem {
13
+ key: string;
14
+ label: string;
15
+ disabled?: boolean;
16
+ danger?: boolean;
17
+ }
18
+ export interface ICEDropdownOptions {
19
+ items: ICEDropdownItem[];
20
+ selectedKey?: string;
21
+ placement?: ICEOverlayPlacement;
22
+ width?: number;
23
+ itemHeight?: number;
24
+ offset?: number;
25
+ onSelect?: (item: ICEDropdownItem, index: number) => void;
26
+ manager?: ICEOverlayManager;
27
+ }
28
+ export declare class ICEDropdown {
29
+ private ice;
30
+ private target;
31
+ private options;
32
+ private manager;
33
+ private handle;
34
+ private panel;
35
+ private itemNodes;
36
+ private items;
37
+ private selectedKey;
38
+ private activeIndex;
39
+ private running;
40
+ constructor(ice: any, target: any, options: ICEDropdownOptions);
41
+ start(): this;
42
+ destroy(): this;
43
+ isOpen(): boolean;
44
+ getSelectedKey(): string | null;
45
+ setSelectedKey(key: string | null): this;
46
+ getActiveIndex(): number;
47
+ getItemNode(index: number): ICEWidget | null;
48
+ setItems(items: ICEDropdownItem[]): this;
49
+ open(): this;
50
+ close(): this;
51
+ toggle(): this;
52
+ /** 键盘:↑/↓ 移动激活项(跳过 disabled),Enter 选中。 */
53
+ private __onKeyDown;
54
+ private __moveActive;
55
+ private __initialActiveIndex;
56
+ private __onTargetClick;
57
+ private __createPanel;
58
+ /** 重建菜单项(选中态 / 激活态 / 禁用态都在这里落地)。 */
59
+ private __buildMenu;
60
+ private __select;
61
+ }
62
+ /** 便捷绑定:`attachDropdown(ice, target, options)`。 */
63
+ export declare function attachDropdown(ice: any, target: any, options: ICEDropdownOptions): ICEDropdown;
@@ -0,0 +1,28 @@
1
+ import { ICEButton } from './ICEButton';
2
+ import { ICEWidget } from '../core/ICEWidget';
3
+ /**
4
+ * 空状态:居中的图标 + 描述 + 可选操作按钮。
5
+ * 常用于列表/表格无数据、搜索无结果。
6
+ */
7
+ export interface ICEEmptyOptions {
8
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
9
+ id?: string;
10
+ description?: string;
11
+ /** 图标字形(默认 ◌) */
12
+ icon?: string;
13
+ actionText?: string;
14
+ onAction?: () => void;
15
+ left?: number;
16
+ top?: number;
17
+ width?: number;
18
+ height?: number;
19
+ }
20
+ export declare class ICEEmpty extends ICEWidget {
21
+ private actionButton;
22
+ /** 描述文案(构造时确定;语言包切换后重建组件即变) */
23
+ private descriptionText;
24
+ constructor(props: ICEEmptyOptions);
25
+ getActionButton(): ICEButton | null;
26
+ /** 空态描述文案(测试 / QA 用;语言包切换后重建组件即变)。 */
27
+ getDescription(): string;
28
+ }
@@ -0,0 +1,63 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ /**
3
+ * 悬浮操作按钮(Ant FloatButton):一个圆形主按钮,点击展开一组子按钮。
4
+ *
5
+ * - 默认收起,子按钮 `display:false`(既不显示也不参与命中);
6
+ * - 展开后子按钮沿 `direction`(默认向上)依次排开;
7
+ * - 点子按钮回调 `onItemClick(key)` 与子项自己的 `onClick`,并自动收起;
8
+ * - `type: 'primary' | 'default'` 决定主按钮底色。
9
+ */
10
+ export interface ICEFloatButtonItem {
11
+ key: string;
12
+ /** 图标字形(★ ✓ ⚙ …) */
13
+ icon: string;
14
+ label?: string;
15
+ onClick?: () => void;
16
+ }
17
+ export interface ICEFloatButtonOptions {
18
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
19
+ id?: string;
20
+ /** 主按钮图标,默认 +(展开时变 ×) */
21
+ icon?: string;
22
+ /** 展开后的图标,默认 × */
23
+ expandedIcon?: string;
24
+ size?: number;
25
+ /** 与子按钮的间距,默认 8 */
26
+ gap?: number;
27
+ direction?: 'up' | 'down';
28
+ type?: 'primary' | 'default';
29
+ items?: ICEFloatButtonItem[];
30
+ left?: number;
31
+ top?: number;
32
+ onClick?: () => void;
33
+ onItemClick?: (key: string) => void;
34
+ }
35
+ export declare class ICEFloatButton extends ICEWidget {
36
+ private items;
37
+ private itemNodes;
38
+ private size;
39
+ private gap;
40
+ private direction;
41
+ private type;
42
+ private expanded;
43
+ private iconClosed;
44
+ private iconExpanded;
45
+ private iconNode;
46
+ private onClick;
47
+ private onItemClick;
48
+ constructor(props?: ICEFloatButtonOptions);
49
+ isExpanded(): boolean;
50
+ getItemNode(key: string): ICEWidget | null;
51
+ getItems(): ICEFloatButtonItem[];
52
+ getButtonColor(): string;
53
+ expand(): this;
54
+ collapse(): this;
55
+ toggle(): this;
56
+ /** @overwrite 键盘激活等价一次点击(展开 / 收起)。 */
57
+ activate(): void;
58
+ protected __applyHoverState(): void;
59
+ private __iconColor;
60
+ /** 子按钮只建一次,显隐靠 display(引擎的不可见组件不参与命中)。 */
61
+ private __renderItems;
62
+ private __sync;
63
+ }
@@ -0,0 +1,48 @@
1
+ import { ICEContainer } from '../core/ICEContainer';
2
+ import { ICEFormItem } from './ICEFormItem';
3
+ import { ICEFormModel } from '../model/ICEFormModel';
4
+ /**
5
+ * 表单容器:把若干 ICEFormItem 纵向堆叠,绑上校验模型。
6
+ *
7
+ * - 值与校验都在 `ICEFormModel` 里(纯逻辑),ICEForm 负责「控件 ⇄ 模型」同步与错误渲染;
8
+ * - 控件触发 `change` → 写回模型并按 validateTrigger 校验 → 模型通知 → 表单项更新错误显示;
9
+ * - `submit()` 校验通过才回调 `onSubmit`(回调拿到当前值快照)。
10
+ */
11
+ export interface ICEFormOptions {
12
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
13
+ id?: string;
14
+ width?: number;
15
+ gap?: number;
16
+ /** 复用外部模型(表单与业务共享状态) */
17
+ model?: ICEFormModel;
18
+ items?: ICEFormItem[];
19
+ left?: number;
20
+ top?: number;
21
+ }
22
+ export declare type ICEFormSubmitHandler = (values: Record<string, any>) => void;
23
+ export declare class ICEForm extends ICEContainer {
24
+ private model;
25
+ private items;
26
+ private submitHandlers;
27
+ private itemGap;
28
+ /** reset 期间抑制「控件 change → 写回模型」,避免把初始值当成用户输入再校验一次 */
29
+ private muted;
30
+ constructor(props?: ICEFormOptions);
31
+ getModel(): ICEFormModel;
32
+ getItems(): ICEFormItem[];
33
+ addItems(items: ICEFormItem[]): this;
34
+ addItem(item: ICEFormItem): this;
35
+ getValues(): Record<string, any>;
36
+ setValues(values: Record<string, any>): this;
37
+ reset(): this;
38
+ validate(): boolean;
39
+ /** 同步 + 异步校验全部字段(返回是否通过)。 */
40
+ validateAsync(): Promise<boolean>;
41
+ onSubmit(handler: ICEFormSubmitHandler): this;
42
+ /** 校验通过才回调 onSubmit。 */
43
+ submit(): boolean;
44
+ /** 异步版提交:等异步校验通过才回调 onSubmit。 */
45
+ submitAsync(): Promise<boolean>;
46
+ private __syncErrors;
47
+ private __layout;
48
+ }