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,28 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ import { ICELabel } from './ICELabel';
3
+ export declare type ICEAlertType = 'info' | 'success' | 'warning' | 'error';
4
+ /**
5
+ * 提示条:info / success / warning / error 四种状态 + 类型图标,可关闭。
6
+ */
7
+ export declare class ICEAlert extends ICEWidget {
8
+ private titleNode;
9
+ private messageNode;
10
+ private type;
11
+ private closable;
12
+ private closed;
13
+ private closeButton;
14
+ private iconNode;
15
+ private onCloseCallback;
16
+ constructor(props?: any);
17
+ setTitle(title: string): this;
18
+ setMessage(message: string): this;
19
+ getType(): ICEAlertType;
20
+ getIconNode(): ICELabel | null;
21
+ getTitleNode(): any;
22
+ private static __iconOf;
23
+ /** 关闭(隐藏整棵子树)并回调 onClose;重复调用只生效一次。 */
24
+ close(): this;
25
+ isClosed(): boolean;
26
+ isClosable(): boolean;
27
+ getCloseButton(): ICEWidget | null;
28
+ }
@@ -0,0 +1,69 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ /**
3
+ * 锚点导航(Ant Anchor):一列锚点,点击滚到目标位置,滚动时自动高亮当前项。
4
+ *
5
+ * 与 `ICEScrollPane` 配合使用:`target` 传滚动容器,`items[].top` 是该段落在
6
+ * **内容坐标系**里的纵向位置。滚动事件由 `ICEScrollPane` 的 `scroll` 事件驱动。
7
+ */
8
+ export interface ICEAnchorItem {
9
+ key: string;
10
+ label: string;
11
+ /** 目标位置(内容坐标系里的 y) */
12
+ top: number;
13
+ }
14
+ export interface ICEAnchorOptions {
15
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
16
+ id?: string;
17
+ /** 跟随的滚动容器 */
18
+ target: any;
19
+ items: ICEAnchorItem[];
20
+ /** 初始活动项,默认第一项 */
21
+ activeKey?: string;
22
+ left?: number;
23
+ top?: number;
24
+ width?: number;
25
+ itemHeight?: number;
26
+ fontSize?: number;
27
+ /** 用户点击 / 键盘切换锚点时的回调(滚动带出来的高亮不回调) */
28
+ onChange?: (key: string) => void;
29
+ }
30
+ export declare class ICEAnchor extends ICEWidget {
31
+ private target;
32
+ private items;
33
+ private activeKey;
34
+ private itemHeight;
35
+ private fontSize;
36
+ private onChange;
37
+ private itemNodes;
38
+ private labelNodes;
39
+ private barNodes;
40
+ private bound;
41
+ /**
42
+ * 点击锚点后由我们自己触发的那次滚动位置。
43
+ *
44
+ * 目标滚不到底时(最后一节下面没有内容了)滚动会被夹取,随后的 `scroll` 事件
45
+ * 会把活动项算回「上一个够得着的锚点」—— 表现为「点了最后一个锚点,高亮又跳回去」。
46
+ * 这里把这一次事件认出来并忽略,用户后续真正滚动时(位置不同)再恢复跟随。
47
+ */
48
+ private ignoreNextScroll;
49
+ constructor(props: ICEAnchorOptions);
50
+ getActiveKey(): string | null;
51
+ getLabelTexts(): string[];
52
+ getItemNode(key: string): ICEWidget | null;
53
+ getLabelColor(key: string): string;
54
+ /** 程序式切换活动项(默认不滚动,传 scroll: true 才滚)。 */
55
+ setActiveKey(key: string, options?: {
56
+ scroll?: boolean;
57
+ }): this;
58
+ getItems(): ICEAnchorItem[];
59
+ setItems(items: ICEAnchorItem[]): this;
60
+ protected afterAddHandler(): void;
61
+ /** 键盘 ↑/↓:移动活动项并滚动过去。 */
62
+ private __onKeyDown;
63
+ /** 点击 / 键盘选中:滚动 + 回调。 */
64
+ private __select;
65
+ /** 滚动带出来的高亮:取最后一个「已经越过」的锚点。 */
66
+ private __syncFromScroll;
67
+ private __syncActive;
68
+ private __render;
69
+ }
@@ -0,0 +1,71 @@
1
+ import { ICEPanel } from './ICEPanel';
2
+ import { ICEWidget } from '../core/ICEWidget';
3
+ import { ICEOverlayManager } from '../core/ICEOverlayManager';
4
+ /**
5
+ * 自动完成(Ant AutoComplete):文本输入 + 候选下拉。
6
+ *
7
+ * - 组合 `ICETextField`(输入与取值/表单语义)与浮层里的候选列表;
8
+ * - 输入即过滤(label/value 包含匹配,忽略大小写),无候选时下拉收起;
9
+ * - 点击候选写入输入框并回调 onSelect;键盘 ↑/↓ 移动高亮、Enter 选中、Esc 关闭。
10
+ */
11
+ export interface ICEAutoCompleteOptions {
12
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
13
+ id?: string;
14
+ options: string[];
15
+ value?: string;
16
+ placeholder?: string;
17
+ left?: number;
18
+ top?: number;
19
+ width?: number;
20
+ height?: number;
21
+ optionHeight?: number;
22
+ onSelect?: (value: string) => void;
23
+ onChange?: (text: string) => void;
24
+ /** 复用外部浮层管理器(测试注入) */
25
+ manager?: ICEOverlayManager;
26
+ }
27
+ export declare class ICEAutoComplete extends ICEWidget {
28
+ private allOptions;
29
+ private field;
30
+ private manager;
31
+ private handle;
32
+ private panel;
33
+ private visibleOptions;
34
+ private optionNodes;
35
+ private activeIndex;
36
+ private optionHeight;
37
+ private onSelectCallback;
38
+ private onChangeCallback;
39
+ private running;
40
+ private __panelBound;
41
+ constructor(props: ICEAutoCompleteOptions);
42
+ protected afterAddHandler(): void;
43
+ getValue(): string;
44
+ setValue(value: string): this;
45
+ getFormValue(): any;
46
+ setFormValue(value: any): void;
47
+ getFieldText(): string;
48
+ setValidateStatus(status: any): this;
49
+ getValidateStatus(): any;
50
+ isOpen(): boolean;
51
+ getVisibleOptions(): string[];
52
+ getActiveIndex(): number;
53
+ getOptionNode(value: string): ICEWidget | null;
54
+ /** 当前候选浮层(未打开时为 null)。 */
55
+ getPanel(): ICEPanel | null;
56
+ activate(): void;
57
+ private __overlayManager;
58
+ /** 按当前文本刷新候选与下拉。 */
59
+ private __refresh;
60
+ close(): this;
61
+ /** 点外关闭:点在输入框(本组件)与候选面板之外就收起下拉。 */
62
+ /** 点击落在候选面板上(但事件被派发给了锚点)时,按位置选中。 */
63
+ private __onAnchorClick;
64
+ private __onGlobalMouseDown;
65
+ private __onKeyDown;
66
+ private __onPanelClick;
67
+ private __worldBox;
68
+ private __pick;
69
+ private __createPanel;
70
+ private __buildOptions;
71
+ }
@@ -0,0 +1,11 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ /**
3
+ * 文字头像:取首字母/汉字,背景色可配,自带描边把相邻头像分开。
4
+ */
5
+ export declare class ICEAvatar extends ICEWidget {
6
+ private circle;
7
+ private textNode;
8
+ constructor(props?: any);
9
+ setText(text: string): this;
10
+ getText(): string;
11
+ }
@@ -0,0 +1,40 @@
1
+ import { ICEAvatar } from './ICEAvatar';
2
+ import { ICEWidget } from '../core/ICEWidget';
3
+ /**
4
+ * 头像组(Ant Avatar.Group 的最小版)。
5
+ *
6
+ * - 头像横向**重叠**排布(每个左移 `overlap`),靠 ICEAvatar 自带的描边把相邻头像分开;
7
+ * - 超过 `max` 个时折叠:只显示前 max 个,末尾补一个 `+N` 头像;
8
+ * - 组件宽度按「最后一个头像的右边缘」算,方便直接放进工具栏/表格单元格。
9
+ */
10
+ export interface ICEAvatarGroupItem {
11
+ text: string;
12
+ backgroundColor?: string;
13
+ }
14
+ export interface ICEAvatarGroupOptions {
15
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
16
+ id?: string;
17
+ avatars: ICEAvatarGroupItem[];
18
+ size?: number;
19
+ max?: number;
20
+ /** 相邻头像的重叠像素;默认 size / 4 */
21
+ overlap?: number;
22
+ left?: number;
23
+ top?: number;
24
+ }
25
+ export declare class ICEAvatarGroup extends ICEWidget {
26
+ private avatars;
27
+ private size;
28
+ private max;
29
+ private overlap;
30
+ private avatarNodes;
31
+ private restNode;
32
+ constructor(props: ICEAvatarGroupOptions);
33
+ getCount(): number;
34
+ getVisibleCount(): number;
35
+ getRestCount(): number;
36
+ getAvatarNodes(): ICEAvatar[];
37
+ getRestNode(): ICEAvatar | null;
38
+ setAvatars(avatars: ICEAvatarGroupItem[]): this;
39
+ private __render;
40
+ }
@@ -0,0 +1,39 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ /**
3
+ * 回到顶部(Ant BackTop):一个小圆按钮,滚动超过阈值才出现。
4
+ *
5
+ * 用法是把滚动容器交给它:`new ICEBackTop({ target: scrollPane })`。
6
+ * 依赖 `ICEScrollPane` 的 `scroll` 事件(滚动位置变化时派发),
7
+ * 点击后把目标滚回 `(0, 0)` 并回调 `onClick`。
8
+ */
9
+ export interface ICEBackTopOptions {
10
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
11
+ id?: string;
12
+ /** 跟随的滚动容器(实现 getScroll / setScroll / on('scroll') 即可) */
13
+ target: any;
14
+ /** 超过多少滚动量才出现,默认 200 */
15
+ visibilityHeight?: number;
16
+ /** 圆按钮直径,默认 36 */
17
+ size?: number;
18
+ /** 图标字形,默认 ↑ */
19
+ icon?: string;
20
+ left?: number;
21
+ top?: number;
22
+ onClick?: () => void;
23
+ }
24
+ export declare class ICEBackTop extends ICEWidget {
25
+ private target;
26
+ private visibilityHeight;
27
+ private visible;
28
+ private onClick;
29
+ private iconNode;
30
+ constructor(props: ICEBackTopOptions);
31
+ isVisible(): boolean;
32
+ /** 当前按钮底色(悬停态取主色 hover)。 */
33
+ getButtonColor(): string;
34
+ setTarget(target: any): this;
35
+ protected __applyHoverState(): void;
36
+ /** 可见时才动手:隐藏状态下点击(或键盘激活)应当是空操作。 */
37
+ private __click;
38
+ private __syncVisibility;
39
+ }
@@ -0,0 +1,17 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ /**
3
+ * 徽标:数字/文字胶囊;`dot` 是红点模式,`count` 超过阈值自动显示 `99+`。
4
+ */
5
+ export declare class ICEBadge extends ICEWidget {
6
+ private textNode;
7
+ private dot;
8
+ /** `solid` = Bootstrap `.text-bg-*` 实底(默认);`soft` = subtle 浅底 */
9
+ private variant;
10
+ constructor(props?: any);
11
+ setText(text: string): this;
12
+ /** 是否红点模式(只有圆点、没有文字)。 */
13
+ isDot(): boolean;
14
+ getText(): string;
15
+ /** 计数文案:超过 overflowCount(默认 99)显示 `N+`。 */
16
+ private static __countText;
17
+ }
@@ -0,0 +1,82 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ import { ICELabel } from './ICELabel';
3
+ /**
4
+ * 面包屑(Ant Breadcrumb):一行「路径 + 分隔符」,最后一项是当前页。
5
+ *
6
+ * - 宽度按内容自适应(中文按 1em 估算,不会把文字压出色块外);
7
+ * - 除最后一项外都可点击,点击触发 `navigate` 事件(载荷 `{ item, index }`)与 `onNavigate`;
8
+ * - `maxItems` 超长时把中间项折叠成「…」,点击省略号展开(Ant 的折叠语义:
9
+ * `maxItems` 只数真实项,省略号不占额度)。
10
+ */
11
+ export interface ICEBreadcrumbItem {
12
+ /** 业务键(可选,便于回调里定位) */
13
+ key?: string;
14
+ label: string;
15
+ /** 业务路由(组件不自己跳转,交给 onNavigate 决定) */
16
+ href?: string;
17
+ disabled?: boolean;
18
+ }
19
+ export interface ICEBreadcrumbOptions {
20
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
21
+ id?: string;
22
+ items: ICEBreadcrumbItem[];
23
+ /** 分隔符,默认 `›` */
24
+ separator?: string;
25
+ /** 最多显示多少**真实项**(超过则中间折叠为省略号);不传或 ≤ 0 表示不折叠 */
26
+ maxItems?: number;
27
+ left?: number;
28
+ top?: number;
29
+ width?: number;
30
+ height?: number;
31
+ fontSize?: number;
32
+ /** 点击非当前项的回调(与 `navigate` 事件同义) */
33
+ onNavigate?: (item: ICEBreadcrumbItem, index: number) => void;
34
+ }
35
+ /** 面包屑项:悬停时文字转主色(文字样式落在内层 ICEText 上)。 */
36
+ declare class ICEBreadcrumbItemNode extends ICEWidget {
37
+ private label;
38
+ private textNode;
39
+ private restColor;
40
+ private hoverColor;
41
+ constructor(props: {
42
+ left: number;
43
+ top: number;
44
+ width: number;
45
+ height: number;
46
+ text: string;
47
+ fontSize: number;
48
+ fillStyle: string;
49
+ fontWeight: string;
50
+ clickable: boolean;
51
+ });
52
+ getLabel(): ICELabel;
53
+ getText(): string;
54
+ protected __applyHoverState(): void;
55
+ }
56
+ export declare class ICEBreadcrumb extends ICEWidget {
57
+ private items;
58
+ private separator;
59
+ private maxItems;
60
+ private fontSize;
61
+ private onNavigate;
62
+ /** 用户点过省略号:本次数据下不再自动折叠 */
63
+ private userExpanded;
64
+ private collapsed;
65
+ private itemNodes;
66
+ private separatorNodes;
67
+ constructor(props: ICEBreadcrumbOptions);
68
+ /** 当前显示的标签(折叠时中间会多出一个 `…`)。 */
69
+ getLabelTexts(): string[];
70
+ getItemNodes(): ICEBreadcrumbItemNode[];
71
+ getSeparatorNodes(): ICELabel[];
72
+ getItems(): ICEBreadcrumbItem[];
73
+ isCollapsed(): boolean;
74
+ /** 展开被折叠的中间项。 */
75
+ expand(): this;
76
+ setItems(items: ICEBreadcrumbItem[]): this;
77
+ /** 当前可见序列:真实项,或「首项 + 省略号 + 末尾 maxItems-1 项」。 */
78
+ private __displayed;
79
+ private __render;
80
+ private __navigate;
81
+ }
82
+ export {};
@@ -0,0 +1,25 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ export declare type ICEButtonVariant = 'primary' | 'default' | 'text' | 'link';
3
+ export declare type ICEButtonSize = 'small' | 'middle' | 'large';
4
+ /**
5
+ * 按钮:`primary` / `default` / `text` / `link` 变体,`danger` 与三种尺寸,
6
+ * 自带 hover / 焦点 / 禁用态,点击时触发 `click`。
7
+ */
8
+ export declare class ICEButton extends ICEWidget {
9
+ /** 调用方显式设过 ariaLabel 之后,setText 不再覆盖它 */
10
+ private explicitAriaLabel;
11
+ private label;
12
+ private variant;
13
+ private size;
14
+ private danger;
15
+ private pressed;
16
+ constructor(props?: any);
17
+ /** 覆盖可读名称(之后 setText 不会再把名字改回去)。 */
18
+ setAriaLabel(label: string): this;
19
+ setText(text: string): this;
20
+ getText(): string;
21
+ protected initEvents(): void;
22
+ setEnabled(enabled: boolean): this;
23
+ protected __applyHoverState(): void;
24
+ private __sync;
25
+ }
@@ -0,0 +1,84 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ /** `YYYY-MM-DD`(本地时区,日期选择器统一用这个字符串形态)。 */
3
+ export declare function formatCalendarDate(date: Date): string;
4
+ export interface ICECalendarCell {
5
+ date: string;
6
+ day: number;
7
+ /** 是否属于当前显示的月份 */
8
+ inMonth: boolean;
9
+ }
10
+ /**
11
+ * 生成月视图网格(固定 6 行 × 7 列 = 42 格,前后用相邻月份补齐)。
12
+ * 默认周一开头(与 `ICEDatePicker` 一致)。
13
+ */
14
+ export declare function buildMonthGrid(month: string, options?: {
15
+ weekStart?: number;
16
+ }): ICECalendarCell[];
17
+ /**
18
+ * 日历(Ant Calendar 的最小版):月视图 + 日期选择。
19
+ *
20
+ * - 标题「YYYY 年 M 月」+ 上/下月切换(回调 `onChangeMonth`);
21
+ * - 6×7 网格:相邻月份补齐的格子弱化显示,点击仍然可选;
22
+ * - 选中日期实底高亮,今天带主色描边(`today` 可注入,便于测试与「业务今天」);
23
+ * - 键盘:←/→ 按天、↑/↓ 按周移动选中,PageUp/PageDown 切月。
24
+ */
25
+ export interface ICECalendarOptions {
26
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
27
+ id?: string;
28
+ /** 选中日期 `YYYY-MM-DD` */
29
+ value?: string;
30
+ /** 当前显示的月份 `YYYY-MM`,默认取 value 所在月 / 今天所在月 */
31
+ month?: string;
32
+ /** 「今天」的日期(不传取系统时间;传了便于测试与业务定制) */
33
+ today?: string;
34
+ width?: number;
35
+ height?: number;
36
+ left?: number;
37
+ top?: number;
38
+ onSelect?: (date: string) => void;
39
+ onChangeMonth?: (month: string) => void;
40
+ }
41
+ export declare class ICECalendar extends ICEWidget {
42
+ private value;
43
+ private visibleMonth;
44
+ private today;
45
+ private onSelect;
46
+ private onChangeMonth;
47
+ private cellHeight;
48
+ private headerHeight;
49
+ private weekHeight;
50
+ private titleNode;
51
+ private weekdayNodes;
52
+ private cellNodes;
53
+ private cellLabels;
54
+ private cellNodeMap;
55
+ private bound;
56
+ constructor(props?: ICECalendarOptions);
57
+ getValue(): string | null;
58
+ setValue(value: any, options?: {
59
+ silent?: boolean;
60
+ }): this;
61
+ getFormValue(): any;
62
+ setFormValue(value: any): void;
63
+ getVisibleMonth(): string;
64
+ setVisibleMonth(month: string, options?: {
65
+ silent?: boolean;
66
+ }): this;
67
+ prevMonth(): this;
68
+ nextMonth(): this;
69
+ getTitleText(): string;
70
+ getWeekdayTexts(): string[];
71
+ getCellNodes(): ICEWidget[];
72
+ getCellNode(date: string): ICEWidget | null;
73
+ getCellBackground(date: string): string;
74
+ getCellTextColor(date: string): string;
75
+ isToday(date: string): boolean;
76
+ /** 程序式选中(不发事件)。 */
77
+ selectDate(date: string): this;
78
+ getPrevButton(): ICEWidget | null;
79
+ getNextButton(): ICEWidget | null;
80
+ protected afterAddHandler(): void;
81
+ private __shiftSelected;
82
+ private __onKeyDown;
83
+ private __render;
84
+ }
@@ -0,0 +1,22 @@
1
+ import { ICEPanel } from './ICEPanel';
2
+ /**
3
+ * 卡片:面板 + 标题,并提供右上角 `extra` 插槽(放“更多/操作”)。
4
+ */
5
+ export declare class ICECard extends ICEPanel {
6
+ private titleNode;
7
+ private extraNode;
8
+ constructor(props?: any);
9
+ setTitle(title: string): this;
10
+ /**
11
+ * 右上角插槽(Ant Card 的 `extra`):放操作链接 / 按钮等。
12
+ *
13
+ * 可以传现成节点,也可以传工厂函数 —— **推荐工厂函数**:引擎按创建顺序决定 zIndex,
14
+ * 调用方在卡片之前 new 出来的节点会被卡片底色盖住;传函数则由卡片在构造期创建,
15
+ * 天然在上层。传现成节点时这里也会把整棵子树抬到卡片之上兜底。
16
+ */
17
+ setExtra(extra: any): this;
18
+ getExtraNode(): any;
19
+ getTitleNode(): any;
20
+ /** 整棵子树统一抬到指定 zIndex(同值不破坏子树内「先父后子」的顺序)。 */
21
+ private __raiseSubtree;
22
+ }
@@ -0,0 +1,86 @@
1
+ import { ICEWidget } from '../core/ICEWidget';
2
+ import { ICEFrameDriver } from '../util/ICEAnimation';
3
+ /**
4
+ * 轮播(Ant Carousel 的最小版)。
5
+ *
6
+ * - 结构:裁剪视口(`clipChildren`)里一条横向轨道,幻灯片并排;轨道 left = -index * width;
7
+ * - `goTo` / `next` / `prev` 切换,`loop` 控制是否循环;箭头与圆点可点,方向键 ←/→ 也可切;
8
+ * - 切换用可注入 frame driver 的补间(`duration: 0` 时同步落位,便于测试);
9
+ * - 自动播放走可注入的调度器(`play` / `pause` / `isPlaying`)。
10
+ */
11
+ export declare type ICECarouselFrameDriver = ICEFrameDriver;
12
+ export interface ICECarouselScheduler {
13
+ setInterval(handler: () => void, ms: number): any;
14
+ clearInterval(handle: any): void;
15
+ }
16
+ export interface ICECarouselOptions {
17
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
18
+ id?: string;
19
+ slides?: ICEWidget[];
20
+ left?: number;
21
+ top?: number;
22
+ width?: number;
23
+ height?: number;
24
+ initialIndex?: number;
25
+ loop?: boolean;
26
+ /** 切换过渡时长(毫秒);0 = 立即落位 */
27
+ duration?: number;
28
+ /** 自动播放间隔(毫秒);> 0 时构造后即开始播放 */
29
+ autoplay?: number;
30
+ arrows?: boolean;
31
+ dots?: boolean;
32
+ onChange?: (index: number) => void;
33
+ driver?: ICECarouselFrameDriver;
34
+ scheduler?: ICECarouselScheduler;
35
+ }
36
+ export declare class ICECarousel extends ICEWidget {
37
+ private slides;
38
+ private index;
39
+ private loop;
40
+ private duration;
41
+ private autoplayMs;
42
+ private showArrows;
43
+ private showDots;
44
+ private driver?;
45
+ private scheduler;
46
+ private onChangeCallback;
47
+ private viewport;
48
+ private track;
49
+ private prevButton;
50
+ private nextButton;
51
+ private dots;
52
+ private tweenHandle;
53
+ private timer;
54
+ private running;
55
+ constructor(props?: ICECarouselOptions);
56
+ protected afterAddHandler(): void;
57
+ getCount(): number;
58
+ getIndex(): number;
59
+ setSlides(slides: ICEWidget[]): this;
60
+ getSlideNode(index: number): ICEWidget | null;
61
+ getTrackNode(): ICEWidget | null;
62
+ getPrevButton(): ICEWidget | null;
63
+ getNextButton(): ICEWidget | null;
64
+ getDotNode(index: number): ICEWidget | null;
65
+ isPlaying(): boolean;
66
+ play(): this;
67
+ pause(): this;
68
+ setAutoplay(ms: number): this;
69
+ goTo(index: number, animate?: boolean): this;
70
+ next(): this;
71
+ prev(): this;
72
+ activate(): void;
73
+ private __clampIndex;
74
+ private __onKeyDown;
75
+ private __moveTrack;
76
+ private __updateControls;
77
+ private __render;
78
+ private __makeArrow;
79
+ /**
80
+ * 把一棵子树(含后代)统一抬到指定 zIndex。
81
+ *
82
+ * 整体用同一个值是有意的:同 zIndex 内按树的先父后子顺序绘制,这样既越过了根节点,
83
+ * 又不会打乱子树内部「先底色、后文字」的相对次序(逐个分配不同值反而会把子节点压到父节点下面)。
84
+ */
85
+ private __raiseSubtree;
86
+ }
@@ -0,0 +1,84 @@
1
+ import { ICEPanel } from './ICEPanel';
2
+ import { ICEWidget } from '../core/ICEWidget';
3
+ import { ICEScrollPane } from './ICEScrollPane';
4
+ import { ICEOverlayManager } from '../core/ICEOverlayManager';
5
+ /**
6
+ * 级联选择(Ant Cascader 的最小版)。
7
+ *
8
+ * - 字段显示已选路径(`separator` 可定制),未选显示 placeholder,错误态边框标红;
9
+ * - 浮层按层级横向排列:点父节点展开下一列(不关闭),点叶子定值并关闭;
10
+ * - 值统一是最深一层的 `value`,路径可由 `getPath()` 取回(便于回显上级);
11
+ * - 关闭策略与 Select 系列一致:浮层 closeOnOutsideClick:false,由组件自己判断点外 + Esc。
12
+ */
13
+ export interface ICECascaderOption {
14
+ value: string;
15
+ label: string;
16
+ disabled?: boolean;
17
+ children?: ICECascaderOption[];
18
+ }
19
+ export declare type ICECascaderPlacement = 'bottomLeft' | 'bottomRight';
20
+ export interface ICECascaderOptions {
21
+ /** 组件 id(引擎会用它做唯一标识,e2e/调试时可按 id 定位) */
22
+ id?: string;
23
+ options: ICECascaderOption[];
24
+ value?: string;
25
+ placeholder?: string;
26
+ disabled?: boolean;
27
+ separator?: string;
28
+ left?: number;
29
+ top?: number;
30
+ width?: number;
31
+ height?: number;
32
+ placement?: ICECascaderPlacement;
33
+ onChange?: (value: string, path: ICECascaderOption[]) => void;
34
+ manager?: ICEOverlayManager;
35
+ }
36
+ export declare class ICECascader extends ICEWidget {
37
+ private options;
38
+ private value?;
39
+ private placeholder;
40
+ private disabled;
41
+ private separator;
42
+ private placement;
43
+ private manager;
44
+ private onChangeCallback;
45
+ private handle;
46
+ private panel;
47
+ private fieldLabel;
48
+ private columns;
49
+ private optionNodes;
50
+ private activePath;
51
+ private running;
52
+ constructor(props: ICECascaderOptions);
53
+ protected afterAddHandler(): void;
54
+ getValue(): string | undefined;
55
+ setValue(value: string | null | undefined): this;
56
+ getFormValue(): any;
57
+ setFormValue(value: any): void;
58
+ /** 已选路径(根 → 叶子);未选时为空数组。 */
59
+ getPath(): ICECascaderOption[];
60
+ getFieldLabel(): string;
61
+ isOpen(): boolean;
62
+ getPanel(): ICEPanel | null;
63
+ getColumnNodes(): ICEScrollPane[];
64
+ getColumnNode(level: number): ICEScrollPane | null;
65
+ getOptionNode(level: number, value: string): ICEWidget | null;
66
+ activate(): void;
67
+ toggle(): this;
68
+ open(): this;
69
+ close(): this;
70
+ protected __applyValidateState(): void;
71
+ /** 按 value 在选项树里回溯出「根 → 叶子」路径。 */
72
+ private __findPath;
73
+ /** 选项树的最大层级数(= 最多几列)。 */
74
+ private __maxDepth;
75
+ /** 单列最多几行(封顶 VISIBLE_ROWS,保证浮层高度稳定)。 */
76
+ private __maxRows;
77
+ private __pick;
78
+ private __onClick;
79
+ private __onKeyDown;
80
+ private __onGlobalMouseDown;
81
+ private __worldBox;
82
+ private __syncField;
83
+ private __renderPanel;
84
+ }