@fibrae/semi-foundation 0.2.0 → 0.3.1

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 (209) hide show
  1. package/LICENSE +0 -62
  2. package/README.md +36 -34
  3. package/README.zh-CN.md +79 -0
  4. package/dist/anchor/foundation.d.ts +0 -3
  5. package/dist/anchor/foundation.js +0 -1
  6. package/dist/audio-player/foundation.d.ts +0 -3
  7. package/dist/audio-player/foundation.js +0 -1
  8. package/dist/auto-complete/foundation.d.ts +0 -2
  9. package/dist/auto-complete/foundation.js +0 -1
  10. package/dist/avatar/foundation.d.ts +0 -1
  11. package/dist/avatar/variables.scss +0 -1
  12. package/dist/backtop/foundation.d.ts +0 -3
  13. package/dist/backtop/foundation.js +0 -1
  14. package/dist/base/auto-close-foundation.d.ts +0 -1
  15. package/dist/base/foundation.d.ts +0 -1
  16. package/dist/base/list-store.d.ts +0 -1
  17. package/dist/calendar/event-util.d.ts +0 -10
  18. package/dist/calendar/event-util.js +0 -10
  19. package/dist/calendar/foundation.d.ts +1 -6
  20. package/dist/calendar/foundation.js +1 -5
  21. package/dist/calendar/month-foundation.d.ts +0 -1
  22. package/dist/calendar/month-foundation.js +0 -1
  23. package/dist/carousel/foundation.d.ts +0 -2
  24. package/dist/cascader/foundation.d.ts +2 -6
  25. package/dist/cascader/foundation.js +2 -11
  26. package/dist/cascader/util.d.ts +1 -8
  27. package/dist/cascader/util.js +1 -8
  28. package/dist/checkbox/checkbox-foundation.d.ts +1 -5
  29. package/dist/checkbox/checkbox-foundation.js +0 -2
  30. package/dist/checkbox/checkbox-group-foundation.d.ts +0 -1
  31. package/dist/code-highlight/index.d.ts +0 -1
  32. package/dist/color-picker/color-picker.scss +0 -2
  33. package/dist/color-picker/interface.d.ts +0 -1
  34. package/dist/config-provider/responsive-types.d.ts +0 -16
  35. package/dist/cropper/foundation.d.ts +0 -1
  36. package/dist/cropper/foundation.js +0 -1
  37. package/dist/date-picker/_utils/get-default-picker-date.d.ts +0 -3
  38. package/dist/date-picker/_utils/get-default-picker-date.js +0 -3
  39. package/dist/date-picker/_utils/get-inset-input-format-token.d.ts +0 -2
  40. package/dist/date-picker/_utils/get-inset-input-format-token.js +0 -2
  41. package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.d.ts +0 -2
  42. package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +0 -2
  43. package/dist/date-picker/_utils/parser.d.ts +0 -3
  44. package/dist/date-picker/_utils/parser.js +0 -7
  45. package/dist/date-picker/_utils/picker-type.d.ts +1 -3
  46. package/dist/date-picker/_utils/picker-type.js +0 -2
  47. package/dist/date-picker/_utils/to-callback-args.d.ts +0 -1
  48. package/dist/date-picker/_utils/to-callback-args.js +0 -1
  49. package/dist/date-picker/date-picker.scss +0 -3
  50. package/dist/date-picker/foundation.d.ts +3 -22
  51. package/dist/date-picker/foundation.js +1 -24
  52. package/dist/date-picker/input-foundation.d.ts +1 -7
  53. package/dist/date-picker/input-foundation.js +0 -2
  54. package/dist/date-picker/month-foundation.d.ts +0 -3
  55. package/dist/date-picker/month-foundation.js +0 -2
  56. package/dist/date-picker/months-grid-foundation.d.ts +1 -10
  57. package/dist/date-picker/months-grid-foundation.js +1 -10
  58. package/dist/drag-move/foundation.d.ts +0 -1
  59. package/dist/dropdown/foundation.d.ts +0 -2
  60. package/dist/dropdown/menu-foundation.d.ts +1 -2
  61. package/dist/feedback/foundation.d.ts +0 -1
  62. package/dist/feedback/variables.scss +1 -5
  63. package/dist/float-button/float-button.css +0 -1
  64. package/dist/float-button/float-button.scss +0 -2
  65. package/dist/form/form.scss +0 -12
  66. package/dist/form/foundation.js +0 -15
  67. package/dist/form/interface.d.ts +2 -15
  68. package/dist/form/utils.d.ts +0 -8
  69. package/dist/form/utils.js +0 -7
  70. package/dist/form/variables.scss +1 -4
  71. package/dist/grid/variables.scss +0 -10
  72. package/dist/highlight/foundation.d.ts +0 -2
  73. package/dist/highlight/foundation.js +0 -2
  74. package/dist/hot-keys/foundation.d.ts +0 -1
  75. package/dist/image/image-foundation.d.ts +0 -2
  76. package/dist/image/preview-footer-foundation.d.ts +0 -1
  77. package/dist/image/preview-foundation.d.ts +0 -3
  78. package/dist/image/preview-image-foundation.d.ts +0 -1
  79. package/dist/image/preview-inner-foundation.d.ts +0 -1
  80. package/dist/input/foundation.d.ts +0 -1
  81. package/dist/input/text-entry-foundation.d.ts +0 -2
  82. package/dist/input/text-entry-foundation.js +0 -1
  83. package/dist/input/textarea-foundation.d.ts +0 -1
  84. package/dist/input-number/caret.d.ts +0 -1
  85. package/dist/input-number/caret.js +0 -1
  86. package/dist/input-number/foundation.d.ts +0 -5
  87. package/dist/input-number/foundation.js +0 -5
  88. package/dist/json-viewer/foundation.d.ts +0 -2
  89. package/dist/json-viewer/foundation.js +0 -1
  90. package/dist/locale/interface.d.ts +0 -3
  91. package/dist/markdown-render/foundation.d.ts +1 -6
  92. package/dist/markdown-render/foundation.js +1 -5
  93. package/dist/navigation/foundation.d.ts +0 -7
  94. package/dist/navigation/foundation.js +0 -6
  95. package/dist/navigation/sub-nav-foundation.d.ts +0 -1
  96. package/dist/notification/notification-list-foundation.d.ts +2 -3
  97. package/dist/notification/notification-list-foundation.js +0 -1
  98. package/dist/notification/variables.scss +0 -1
  99. package/dist/overflow-list/foundation.d.ts +0 -2
  100. package/dist/overflow-list/foundation.js +0 -1
  101. package/dist/pagination/foundation.d.ts +0 -2
  102. package/dist/pincode/foundation.d.ts +1 -4
  103. package/dist/pincode/foundation.js +1 -4
  104. package/dist/popconfirm/popconfirm-foundation.d.ts +0 -2
  105. package/dist/progress/generates.d.ts +1 -4
  106. package/dist/progress/generates.js +1 -4
  107. package/dist/progress/utils.d.ts +1 -1
  108. package/dist/progress/utils.js +1 -1
  109. package/dist/radio/radio-foundation.d.ts +0 -4
  110. package/dist/radio/radio-foundation.js +0 -1
  111. package/dist/radio/radio-group-foundation.d.ts +0 -1
  112. package/dist/rating/foundation.d.ts +0 -5
  113. package/dist/rating/foundation.js +0 -3
  114. package/dist/resizable/group/index.d.ts +0 -4
  115. package/dist/resizable/group/index.js +0 -4
  116. package/dist/resizable/resizable.scss +0 -1
  117. package/dist/resizable/single/index.d.ts +1 -5
  118. package/dist/resizable/single/index.js +1 -4
  119. package/dist/scroll-list/item-foundation.d.ts +0 -2
  120. package/dist/scroll-list/item-foundation.js +0 -1
  121. package/dist/scroll-list/variables.scss +1 -6
  122. package/dist/select/foundation.d.ts +0 -1
  123. package/dist/select/option-foundation.d.ts +2 -3
  124. package/dist/select/option-foundation.js +0 -1
  125. package/dist/select/variables.scss +1 -8
  126. package/dist/side-sheet/side-sheet-foundation.d.ts +1 -6
  127. package/dist/side-sheet/side-sheet-foundation.js +1 -5
  128. package/dist/side-sheet/variables.scss +1 -3
  129. package/dist/slider/foundation.d.ts +1 -12
  130. package/dist/slider/foundation.js +1 -13
  131. package/dist/slider/variables.scss +1 -5
  132. package/dist/spin/foundation.d.ts +0 -2
  133. package/dist/spin/foundation.js +0 -1
  134. package/dist/spin/variables.scss +1 -3
  135. package/dist/switch/foundation.d.ts +0 -1
  136. package/dist/switch/switch.scss +1 -1
  137. package/dist/switch/variables.scss +1 -5
  138. package/dist/table/foundation.d.ts +12 -21
  139. package/dist/table/foundation.js +51 -15
  140. package/dist/table/table.scss +0 -1
  141. package/dist/table/utils.d.ts +0 -8
  142. package/dist/table/utils.js +0 -13
  143. package/dist/table/variables.scss +1 -5
  144. package/dist/tabs/foundation.d.ts +0 -9
  145. package/dist/tabs/foundation.js +0 -4
  146. package/dist/tabs/tabs.scss +1 -1
  147. package/dist/tag/focus.js +0 -1
  148. package/dist/tag-input/foundation.d.ts +0 -2
  149. package/dist/tag-input/foundation.js +0 -1
  150. package/dist/tag-input/tag-input.scss +0 -1
  151. package/dist/tag-input/utils/tag-focus.d.ts +0 -1
  152. package/dist/tag-input/utils/tag-focus.js +0 -1
  153. package/dist/time-picker/combox-foundation.d.ts +3 -11
  154. package/dist/time-picker/combox-foundation.js +3 -10
  155. package/dist/time-picker/foundation.d.ts +0 -10
  156. package/dist/time-picker/foundation.js +0 -9
  157. package/dist/time-picker/utils/index.d.ts +0 -11
  158. package/dist/time-picker/utils/index.js +0 -11
  159. package/dist/tooltip/adjust-position.d.ts +1 -2
  160. package/dist/tooltip/constants.d.ts +0 -3
  161. package/dist/tooltip/constants.js +0 -3
  162. package/dist/tooltip/foundation.d.ts +0 -3
  163. package/dist/tooltip/foundation.js +0 -2
  164. package/dist/tooltip/position.scss +0 -1
  165. package/dist/transfer/foundation.d.ts +0 -4
  166. package/dist/transfer/foundation.js +0 -1
  167. package/dist/tree/foundation.d.ts +0 -2
  168. package/dist/tree/foundation.js +0 -1
  169. package/dist/tree/shared.d.ts +1 -3
  170. package/dist/tree/shared.js +0 -2
  171. package/dist/tree/tree-util.d.ts +0 -5
  172. package/dist/tree/tree-util.js +0 -5
  173. package/dist/tree-select/foundation.d.ts +0 -2
  174. package/dist/tree-select/foundation.js +0 -3
  175. package/dist/typography/ellipsis.d.ts +1 -3
  176. package/dist/typography/ellipsis.js +0 -2
  177. package/dist/typography/typography.scss +0 -1
  178. package/dist/upload/constants.d.ts +1 -1
  179. package/dist/upload/foundation.d.ts +0 -6
  180. package/dist/upload/foundation.js +1 -11
  181. package/dist/upload/utils.d.ts +0 -5
  182. package/dist/upload/utils.js +0 -5
  183. package/dist/user-guide/foundation.d.ts +0 -2
  184. package/dist/utils/a11y.d.ts +1 -5
  185. package/dist/utils/a11y.js +1 -4
  186. package/dist/utils/array.d.ts +0 -6
  187. package/dist/utils/array.js +0 -6
  188. package/dist/utils/date-fns-extra.js +1 -5
  189. package/dist/utils/dom.d.ts +0 -1
  190. package/dist/utils/dom.js +0 -1
  191. package/dist/utils/escape-html.js +0 -3
  192. package/dist/utils/field-sizing.d.ts +0 -2
  193. package/dist/utils/field-sizing.js +0 -2
  194. package/dist/utils/focus-handle.d.ts +0 -1
  195. package/dist/utils/focus-handle.js +0 -1
  196. package/dist/utils/focus-scope.d.ts +0 -1
  197. package/dist/utils/focus-scope.js +0 -1
  198. package/dist/utils/scroll-lock.d.ts +3 -4
  199. package/dist/utils/scroll-lock.js +3 -4
  200. package/dist/utils/tween.d.ts +0 -1
  201. package/dist/utils/tween.js +0 -1
  202. package/dist/utils/uuid.d.ts +0 -1
  203. package/dist/utils/uuid.js +0 -1
  204. package/dist/utils/warning.d.ts +0 -1
  205. package/dist/utils/warning.js +0 -1
  206. package/dist/video-player/progress-foundation.d.ts +0 -1
  207. package/dist/video-player/progress-foundation.js +0 -1
  208. package/dist/video-player/variables.scss +1 -1
  209. package/package.json +2 -2
package/LICENSE CHANGED
@@ -20,65 +20,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
20
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
21
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  SOFTWARE.
23
-
24
- The code implementation of the external library is referenced by DouyinFe are:
25
-
26
- - animate.css
27
-
28
- The MIT License (MIT)
29
-
30
- Copyright (c) 2020 Daniel Eden
31
-
32
- Permission is hereby granted, free of charge, to any person obtaining a copy
33
- of this software and associated documentation files (the "Software"), to deal
34
- in the Software without restriction, including without limitation the rights
35
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
36
- copies of the Software, and to permit persons to whom the Software is
37
- furnished to do so, subject to the following conditions:
38
-
39
- The above copyright notice and this permission notice shall be included in all
40
- copies or substantial portions of the Software.
41
-
42
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
47
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48
- SOFTWARE.
49
-
50
- - Ant Design
51
- MIT LICENSE
52
-
53
- Copyright (c) 2015-present Ant UED, https://xtech.antfin.com/
54
-
55
- Permission is hereby granted, free of charge, to any person obtaining
56
- a copy of this software and associated documentation files (the
57
- "Software"), to deal in the Software without restriction, including
58
- without limitation the rights to use, copy, modify, merge, publish,
59
- distribute, sublicense, and/or sell copies of the Software, and to
60
- permit persons to whom the Software is furnished to do so, subject to
61
- the following conditions:
62
-
63
- The above copyright notice and this permission notice shall be
64
- included in all copies or substantial portions of the Software.
65
-
66
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
67
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
68
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
69
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
70
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
71
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
72
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
73
-
74
- - rc-tree
75
-
76
- MIT LICENSE
77
-
78
- Copyright (c) 2015-present Alipay.com, https://www.alipay.com/
79
-
80
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
81
-
82
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
83
-
84
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,27 +1,29 @@
1
1
  # @fibrae/semi-foundation
2
2
 
3
- Semi Design Next 中与框架无关的部分:组件逻辑(Foundation)、SCSS 样式、主题 token 和语言包。各框架的组件库共用它,使用方通常不直接依赖,而是经 UI 包间接使用。
3
+ [简体中文](README.zh-CN.md)
4
4
 
5
- ## Foundation 与 Adapter
5
+ The framework-agnostic part of Semi Design Next: component logic (Foundation), SCSS styles, theme tokens and locale packs. The component libraries of every framework share it. Applications usually use it through a UI package rather than depending on it directly.
6
6
 
7
- 每个组件的 JavaScript 分成两部分,以便在不同框架间复用:
7
+ ## Foundation and Adapter
8
8
 
9
- - Foundation:承载组件的业务逻辑,不引用任何 DOM。需要操作 DOM 的逻辑,委托给 Adapter。
10
- - Adapter:Foundation 所需方法的接口,由各框架包用本框架的原生机制实现(如 React 的 hook、Vue 的 composable)。
9
+ The JavaScript of each component has two parts so it can be reused across frameworks:
11
10
 
12
- 因此本包不依赖任何框架和 UI 包。
11
+ - Foundation: holds the component's business logic and references no DOM. Logic that needs the DOM is delegated to the Adapter.
12
+ - Adapter: the interface of the methods a Foundation needs, implemented by each framework package with its native mechanism (such as a React hook or a Vue composable).
13
13
 
14
- ## 安装
14
+ This is why the package depends on no framework or UI package.
15
+
16
+ ## Installation
15
17
 
16
18
  ```sh
17
19
  pnpm add @fibrae/semi-foundation
18
20
  ```
19
21
 
20
- 构建插件解析 `semi:` 地址时需要它,UI 包已把它作为依赖。
22
+ Build plugins need it to resolve `semi:` addresses, and the UI packages already depend on it.
21
23
 
22
- ## 使用
24
+ ## Usage
23
25
 
24
- 本包没有根入口,只提供逐文件的深路径,与 `src/` 下的目录一一对应,同时提供类型声明:
26
+ This package has no root entry. It offers only deep file paths, which map one-to-one to the directories under `src/` and come with type declarations:
25
27
 
26
28
  ```ts
27
29
  import BaseFoundation from '@fibrae/semi-foundation/base/foundation';
@@ -30,48 +32,48 @@ import en_GB from '@fibrae/semi-foundation/locale/source/en_GB';
30
32
  import { utcToZonedTime } from '@fibrae/semi-foundation/utils/date-fns-extra';
31
33
  ```
32
34
 
33
- `exports` 还包含 `./*.css` 与 `./*.scss`:组件 CSS 是 `vp pack` 编译的产物;发布的 `.scss` 含有 `semi:` 地址,不能直接用 Sass 编译,需要经构建插件或 `@fibrae/semi-scss-compile`。
35
+ `exports` also includes `./*.css` and `./*.scss`. The component CSS is compiled by `vp pack`. The published `.scss` contains `semi:` addresses and cannot be compiled by Sass directly; it goes through a build plugin or `@fibrae/semi-scss-compile`.
34
36
 
35
- ## 目录
37
+ ## Directories
36
38
 
37
- `src/` 下每个组件一个目录,按需包含 `foundation.ts`、`constants.ts` 与 `*.scss`(`variables.scss`、`mixin.scss`、`rtl.scss` 等只按源文件发布)。公共目录:
39
+ `src/` has one directory per component, containing `foundation.ts`, `constants.ts` and `*.scss` as needed (`variables.scss`, `mixin.scss`, `rtl.scss` and similar ship only as source). Shared directories:
38
40
 
39
- | 目录 | 内容 |
40
- | --------- | ------------------------------------------------------------------- |
41
- | `base/` | `BaseFoundation` 与通用常量 |
42
- | `theme/` | 唯一的主题:全局 token、色板、mixin,组件 SCSS 经 `semi:theme` 加载 |
43
- | `locale/` | 语言包与 `Locale` 类型 |
44
- | `utils/` | 焦点、层栈、日期、DOM 等工具 |
41
+ | Directory | Contents |
42
+ | --------- | ------------------------------------------------------------------------------------------------ |
43
+ | `base/` | `BaseFoundation` and common constants |
44
+ | `theme/` | The one theme: global tokens, palettes and mixins, loaded by component SCSS through `semi:theme` |
45
+ | `locale/` | Locale packs and the `Locale` type |
46
+ | `utils/` | Focus, layer stack, date, DOM and other utilities |
45
47
 
46
- ## 语言包
48
+ ## Locale packs
47
49
 
48
- `src/locale/source/` 下有 57 个语言包,每个文件默认导出一个 `Locale`,类型在 `src/locale/interface.ts`:
50
+ `src/locale/source/` holds 57 locale packs. Each file default-exports a `Locale`, whose type is in `src/locale/interface.ts`:
49
51
 
50
- - `code`:语言代码。
51
- - `dateFnsLocale`:格式化和解析日期时使用的 date-fns locale 对象。
52
- - `currency`:ISO 4217 货币代码,InputNumber 传给 `Intl.NumberFormat`。
53
- - 其余键按组件分组,是组件的内置文案和可访问名称。含 `${名字}` 的值是占位符,翻译时不要替换占位符本身。
52
+ - `code`: the language code.
53
+ - `dateFnsLocale`: the date-fns locale object used to format and parse dates.
54
+ - `currency`: the ISO 4217 currency code, passed by InputNumber to `Intl.NumberFormat`.
55
+ - The other keys are grouped by component and hold built-in text and accessible names. Values with `${name}` are placeholders; do not translate the placeholder itself.
54
56
 
55
- 使用时把语言包传给 UI 包的 `LocaleProvider`:
57
+ To use a pack, pass it to the UI package's `LocaleProvider`:
56
58
 
57
59
  ```tsx
58
- import en_GB from '@fibrae/semi-foundation/locale/source/en_GB';
59
60
  import { LocaleProvider } from '@fibrae/semi-ui-react';
61
+ import en_GB from '@fibrae/semi-ui-react/locale/source/en_GB';
60
62
 
61
63
  <LocaleProvider locale={en_GB}>
62
64
  <App />
63
65
  </LocaleProvider>;
64
66
  ```
65
67
 
66
- Vue 包的 `LocaleProvider` 同名,通过 `:locale` 传入。新增文案或可访问名称、补齐全部语言包的步骤见 [locale-text](../../.agents/skills/locale-text/SKILL.md)。
68
+ The Vue package's `LocaleProvider` has the same name and takes `:locale`. For adding text or accessible names and filling in every locale pack, see [locale-text](../../.agents/skills/locale-text/SKILL.md).
67
69
 
68
- ## 与其他包的关系
70
+ ## Related packages
69
71
 
70
- - 依赖 `@fibrae/semi-json-viewer-core`;Markdown、MDX、Lottie 与代码高亮等与框架无关的渲染逻辑也在本包。
71
- - 被各框架的 UI 包、`@fibrae/semi-ai-foundation` 及 AI 组件包使用。
72
+ - Depends on `@fibrae/semi-json-viewer-core`. Framework-agnostic rendering logic for Markdown, MDX, Lottie and code highlighting also lives here.
73
+ - Used by the UI package of each framework, `@fibrae/semi-ai-foundation` and the AI component packages.
72
74
 
73
- ## 开发
75
+ ## Development
74
76
 
75
- `pnpm --filter @fibrae/semi-foundation build` 执行 `vp pack`:`src/**/*.ts` 逐文件输出 ESM 与类型声明,组件 SCSS 编译为 CSS,主题 token 编译进 `base/tokens.css`。各框架 UI 包的类型检查读取这里已构建的类型。
77
+ `pnpm --filter @fibrae/semi-foundation build` runs `vp pack`: `src/**/*.ts` emits ESM and type declarations file by file, component SCSS compiles to CSS, and theme tokens compile into `base/tokens.css`. Type checks in the UI packages read the types built here.
76
78
 
77
- 通用命令见根目录 [README.md](../../README.md#常用命令)。样式写法、`semi:` importer 与主题 token 协议见 [styles](../../.agents/references/styles.md) 的「组件 SCSS」「Sass 模块与 semi: importer」「主题 token 协议」等节。
79
+ For general commands, see [CONTRIBUTING.md](../../CONTRIBUTING.md#常用命令) at the repository root. For how to write styles, the `semi:` importer and the theme token protocol, see the 「组件 SCSS」, 「Sass 模块与 semi: importer」 and 「主题 token 协议」 sections of [styles](../../.agents/references/styles.md).
@@ -0,0 +1,79 @@
1
+ # @fibrae/semi-foundation
2
+
3
+ [English](README.md)
4
+
5
+ Semi Design Next 中与框架无关的部分:组件逻辑(Foundation)、SCSS 样式、主题 token 和语言包。各框架的组件库共用它,使用方通常不直接依赖,而是经 UI 包间接使用。
6
+
7
+ ## Foundation 与 Adapter
8
+
9
+ 每个组件的 JavaScript 分成两部分,以便在不同框架间复用:
10
+
11
+ - Foundation:承载组件的业务逻辑,不引用任何 DOM。需要操作 DOM 的逻辑,委托给 Adapter。
12
+ - Adapter:Foundation 所需方法的接口,由各框架包用本框架的原生机制实现(如 React 的 hook、Vue 的 composable)。
13
+
14
+ 因此本包不依赖任何框架和 UI 包。
15
+
16
+ ## 安装
17
+
18
+ ```sh
19
+ pnpm add @fibrae/semi-foundation
20
+ ```
21
+
22
+ 构建插件解析 `semi:` 地址时需要它,UI 包已把它作为依赖。
23
+
24
+ ## 使用
25
+
26
+ 本包没有根入口,只提供逐文件的深路径,与 `src/` 下的目录一一对应,同时提供类型声明:
27
+
28
+ ```ts
29
+ import BaseFoundation from '@fibrae/semi-foundation/base/foundation';
30
+ import type { Locale } from '@fibrae/semi-foundation/locale/interface';
31
+ import en_GB from '@fibrae/semi-foundation/locale/source/en_GB';
32
+ import { utcToZonedTime } from '@fibrae/semi-foundation/utils/date-fns-extra';
33
+ ```
34
+
35
+ `exports` 还包含 `./*.css` 与 `./*.scss`:组件 CSS 是 `vp pack` 编译的产物;发布的 `.scss` 含有 `semi:` 地址,不能直接用 Sass 编译,需要经构建插件或 `@fibrae/semi-scss-compile`。
36
+
37
+ ## 目录
38
+
39
+ `src/` 下每个组件一个目录,按需包含 `foundation.ts`、`constants.ts` 与 `*.scss`(`variables.scss`、`mixin.scss`、`rtl.scss` 等只按源文件发布)。公共目录:
40
+
41
+ | 目录 | 内容 |
42
+ | --------- | ------------------------------------------------------------------- |
43
+ | `base/` | `BaseFoundation` 与通用常量 |
44
+ | `theme/` | 唯一的主题:全局 token、色板、mixin,组件 SCSS 经 `semi:theme` 加载 |
45
+ | `locale/` | 语言包与 `Locale` 类型 |
46
+ | `utils/` | 焦点、层栈、日期、DOM 等工具 |
47
+
48
+ ## 语言包
49
+
50
+ `src/locale/source/` 下有 57 个语言包,每个文件默认导出一个 `Locale`,类型在 `src/locale/interface.ts`:
51
+
52
+ - `code`:语言代码。
53
+ - `dateFnsLocale`:格式化和解析日期时使用的 date-fns locale 对象。
54
+ - `currency`:ISO 4217 货币代码,InputNumber 传给 `Intl.NumberFormat`。
55
+ - 其余键按组件分组,是组件的内置文案和可访问名称。含 `${名字}` 的值是占位符,翻译时不要替换占位符本身。
56
+
57
+ 使用时把语言包传给 UI 包的 `LocaleProvider`:
58
+
59
+ ```tsx
60
+ import { LocaleProvider } from '@fibrae/semi-ui-react';
61
+ import en_GB from '@fibrae/semi-ui-react/locale/source/en_GB';
62
+
63
+ <LocaleProvider locale={en_GB}>
64
+ <App />
65
+ </LocaleProvider>;
66
+ ```
67
+
68
+ Vue 包的 `LocaleProvider` 同名,通过 `:locale` 传入。新增文案或可访问名称、补齐全部语言包的步骤见 [locale-text](../../.agents/skills/locale-text/SKILL.md)。
69
+
70
+ ## 与其他包的关系
71
+
72
+ - 依赖 `@fibrae/semi-json-viewer-core`;Markdown、MDX、Lottie 与代码高亮等与框架无关的渲染逻辑也在本包。
73
+ - 被各框架的 UI 包、`@fibrae/semi-ai-foundation` 及 AI 组件包使用。
74
+
75
+ ## 开发
76
+
77
+ `pnpm --filter @fibrae/semi-foundation build` 执行 `vp pack`:`src/**/*.ts` 逐文件输出 ESM 与类型声明,组件 SCSS 编译为 CSS,主题 token 编译进 `base/tokens.css`。各框架 UI 包的类型检查读取这里已构建的类型。
78
+
79
+ 通用命令见根目录 [CONTRIBUTING.md](../../CONTRIBUTING.md#常用命令)。样式写法、`semi:` importer 与主题 token 协议见 [styles](../../.agents/references/styles.md) 的「组件 SCSS」「Sass 模块与 semi: importer」「主题 token 协议」等节。
@@ -12,7 +12,6 @@ export interface AnchorAdapter<P extends AnchorBaseProps = AnchorBaseProps, S ex
12
12
  notifyChange: (currentLink: string, previousLink: string) => void;
13
13
  notifyClick: (e: E, link: string) => void;
14
14
  }
15
- /** The props the foundation reads */
16
15
  export interface AnchorBaseProps {
17
16
  defaultAnchor?: string;
18
17
  scrollMotion?: boolean;
@@ -20,7 +19,6 @@ export interface AnchorBaseProps {
20
19
  offsetTop?: number;
21
20
  scrollIntoViewOptions?: Options;
22
21
  }
23
- /** The state the foundation reads */
24
22
  export interface AnchorBaseState {
25
23
  activeLink: string;
26
24
  links: string[];
@@ -40,7 +38,6 @@ export default class AnchorFoundation<P extends AnchorBaseProps = AnchorBaseProp
40
38
  /** Runs once the links have registered: listens to the container, applies `defaultAnchor` */
41
39
  init(): void;
42
40
  destroy(): void;
43
- /** Rebinds scroll listeners when `getContainer` returns a different node */
44
41
  handleContainerChange: () => void;
45
42
  syncSlideBar: () => void;
46
43
  addLink: (link: string) => void;
@@ -113,7 +113,6 @@ var AnchorFoundation = class extends BaseFoundation {
113
113
  this.#throttledScroll.cancel();
114
114
  this.#debouncedScrollEnd.cancel();
115
115
  }
116
- /** Rebinds scroll listeners when `getContainer` returns a different node */
117
116
  handleContainerChange = () => {
118
117
  if (this.adapter.getContainer() !== this.#container) {
119
118
  this.#unbind();
@@ -4,12 +4,10 @@ export type AudioInfo = {
4
4
  cover?: string;
5
5
  src: string;
6
6
  };
7
- /** The props the foundation reads with getProp */
8
7
  export interface AudioPlayerBaseProps {
9
8
  audioUrl: string | AudioInfo | (AudioInfo | string)[];
10
9
  skipDuration?: number;
11
10
  }
12
- /** The state the foundation reads and writes */
13
11
  export interface AudioPlayerBaseState {
14
12
  isPlaying: boolean;
15
13
  currentIndex: number;
@@ -41,6 +39,5 @@ export default class AudioPlayerFoundation<P extends AudioPlayerBaseProps = Audi
41
39
  handleSeek: (direction: number) => void;
42
40
  handleRefresh: () => void;
43
41
  handleVolumeChange: (value: number) => void;
44
- /** Mutes, or restores half volume when muted */
45
42
  handleVolumeSilent: () => void;
46
43
  }
@@ -108,7 +108,6 @@ var AudioPlayerFoundation = class extends BaseFoundation {
108
108
  audio.volume = volume / 100;
109
109
  this.setState({ volume });
110
110
  };
111
- /** Mutes, or restores half volume when muted */
112
111
  handleVolumeSilent = () => {
113
112
  this.handleVolumeChange(this.getState("volume") === 0 ? 50 : 0);
114
113
  };
@@ -11,7 +11,6 @@ export interface StateOptionItem extends DataItem {
11
11
  _source?: DataItem | string | number;
12
12
  }
13
13
  export type AutoCompleteData = ReadonlyArray<DataItem | string | number>;
14
- /** The props the foundation reads with getProps */
15
14
  export interface AutoCompleteBaseProps {
16
15
  data?: AutoCompleteData;
17
16
  defaultActiveFirstOption?: boolean;
@@ -23,7 +22,6 @@ export interface AutoCompleteBaseProps {
23
22
  renderSelectedItem?(this: void, option: DataItem): string;
24
23
  value?: string | number;
25
24
  }
26
- /** The state the foundation reads with getStates */
27
25
  export interface AutoCompleteBaseState {
28
26
  focusIndex: number;
29
27
  inputValue?: string | number;
@@ -29,7 +29,6 @@ var AutoCompleteFoundation = class AutoCompleteFoundation extends BaseFoundation
29
29
  static #getRenderSelectedItem({ renderSelectedItem }) {
30
30
  return renderSelectedItem ?? ((option) => option?.value);
31
31
  }
32
- /** The input text, selection and highlight that `selectedValue` shows */
33
32
  static #valueStates(props, selectedValue) {
34
33
  if (selectedValue === void 0) return {
35
34
  inputValue: "",
@@ -1,5 +1,4 @@
1
1
  import BaseFoundation, { DefaultAdapter } from "../base/foundation.js";
2
- /** The props the foundation reads */
3
2
  export interface AvatarBaseProps {
4
3
  gap?: number;
5
4
  }
@@ -91,7 +91,6 @@ $width-avatar-bottom_slot_square_extra_large-border: 2px; // extra large 头像
91
91
 
92
92
  $color-avatar-top_slot_text: var(--semi-color-bg-0); //顶部 Slot 文字颜色
93
93
 
94
- // top slot offset; positions the slot together with the scale below
95
94
  $spacing-avatar-top_slot_small-shift: -28px; // small 顶部 slot 偏移量, 和 scale 一起控制 slot 的位置
96
95
  $spacing-avatar-top_slot_default-shift: -32px; // default 顶部 slot 偏移量, 和 scale 一起控制 slot 的位置
97
96
  $spacing-avatar-top_slot_medium-shift: -30px; // medium 顶部 slot 偏移量, 和 scale 一起控制 slot 的位置
@@ -1,7 +1,5 @@
1
1
  import BaseFoundation, { DefaultAdapter } from "../base/foundation.js";
2
- /** What `target()` returns: the window or a scrollable element */
3
2
  export type Target = Window | HTMLElement;
4
- /** The props the foundation reads */
5
3
  export interface BackTopBaseProps {
6
4
  target?: () => Target | null;
7
5
  visibilityHeight?: number;
@@ -19,7 +17,6 @@ export default class BackTopFoundation<P extends BackTopBaseProps = BackTopBaseP
19
17
  /** Children sit inside a native button, so interactive ones would nest; development only */
20
18
  static warnInteractiveChildren(button?: Element | null): void;
21
19
  init(): void;
22
- /** Rebinds the scroll listener when `target` returns a different element */
23
20
  handleTargetChange: () => void;
24
21
  destroy(): void;
25
22
  onClick: (e: E) => void;
@@ -37,7 +37,6 @@ var BackTopFoundation = class extends BaseFoundation {
37
37
  init() {
38
38
  this.#bind();
39
39
  }
40
- /** Rebinds the scroll listener when `target` returns a different element */
41
40
  handleTargetChange = () => {
42
41
  if (this.getProps().target() !== this.#targetNode) {
43
42
  this.#unbind();
@@ -1,5 +1,4 @@
1
1
  import BaseFoundation, { DefaultAdapter } from "./foundation.js";
2
- /** The props the foundation reads with getProp */
3
2
  export interface AutoCloseBaseProps {
4
3
  id?: string;
5
4
  duration?: number;
@@ -18,7 +18,6 @@ export interface DefaultAdapter<P = Record<string, any>, S = Record<string, any>
18
18
  /** The context type an adapter declares; `unknown` for a foundation that does not read context */
19
19
  export type ContextOf<T> = T extends DefaultAdapter<any, any, infer C> ? C : never;
20
20
  export type HostContext<A> = unknown extends ContextOf<A> ? ([keyof ContextOf<A>] extends [never] ? any : ContextOf<A>) : ContextOf<A>;
21
- /** The context of a foundation that only reads the reading direction from the enclosing ConfigProvider */
22
21
  export interface DirectionContext {
23
22
  direction?: 'ltr' | 'rtl';
24
23
  }
@@ -1,4 +1,3 @@
1
- /** The part of a Toast or Notification list's state the kernel maintains */
2
1
  export interface ListStoreState<T> {
3
2
  removedItems: T[];
4
3
  updatedItems: T[];
@@ -2,14 +2,10 @@ import { EventObject, ParsedRangeEvent } from "./foundation.js";
2
2
  import { Locale } from "date-fns";
3
3
  export declare function checkWeekend(val: Date): boolean;
4
4
  export declare function getCurrDate(): Date;
5
- /** A 0-1 fraction of the day or week row as a CSS percentage, capped at 100% */
6
5
  export declare function toPercent(num: number): string;
7
6
  export declare function round(value: number): number;
8
7
  export declare function getPos(value: Date | number): number;
9
8
  export declare function isAllDayEvent(event: EventObject): boolean;
10
- /**
11
- * Fills a missing start (end - 1h) or end (start + 1h), clamped to the day.
12
- */
13
9
  export declare function amendEvent(event: EventObject): EventObject | undefined;
14
10
  /** An event every view can lay out: it has a start, and when it has an end, the end is not before it */
15
11
  export interface NormalizedEvent extends EventObject {
@@ -21,7 +17,6 @@ export interface NormalizedEvent extends EventObject {
21
17
  * 1ms earlier, so it belongs only to the days before that midnight. Works on a copy.
22
18
  */
23
19
  export declare function normalizeEvent(event: EventObject): NormalizedEvent | undefined;
24
- /** The max topInd is the row height */
25
20
  export declare function calcRowHeight(events: ParsedRangeEvent[]): number;
26
21
  export interface DateObj {
27
22
  ind: number;
@@ -35,11 +30,7 @@ export interface DateObj {
35
30
  }
36
31
  export type weekStartsOnEnum = 0 | 1 | 2 | 3 | 4 | 5 | 6;
37
32
  export declare function calcRangeData(value: Date, start: Date, rangeLen: number, mode: string, locale: Locale, weekStartsOn: weekStartsOnEnum, today?: Date | number | null): DateObj[];
38
- /**
39
- * The days of a week as { date, dayString, ind, isToday, isWeekend, weekday }; `monthStart` is for month mode
40
- */
41
33
  export declare function calcWeekData(value: Date, monthStart: Date | null, mode: string, locale: Locale, weekStartsOn: weekStartsOnEnum, today?: Date | number | null): DateObj[];
42
- /** Splits an all-day event into one event per day it spans */
43
34
  export declare function parseAllDayEvent(event: NormalizedEvent, allDay?: boolean): {
44
35
  [x: string]: any;
45
36
  key: string;
@@ -56,7 +47,6 @@ export declare function parseEvent(rawEvent: EventObject): {
56
47
  end?: Date;
57
48
  children?: any;
58
49
  }[];
59
- /** Groups events into a map keyed by the date string of `key`, normalized by `func` */
60
50
  export declare function convertEventsArrToMap(arr: EventObject[], key: 'start' | 'date', func: (val: Date) => Date): Map<string, EventObject[]>;
61
51
  export declare function filterEvents(events: Map<string, EventObject[]>, start: Date, end: Date): Map<string, EventObject[]>;
62
52
  export declare function parseRangeAllDayEvent(event: EventObject[], startDate: Date, rangeStart: Date, rangeEnd: Date, parsed: Array<Array<ParsedRangeEvent>>): ParsedRangeEvent[][];
@@ -22,7 +22,6 @@ function checkWeekend(val) {
22
22
  function getCurrDate() {
23
23
  return /* @__PURE__ */ new Date();
24
24
  }
25
- /** A 0-1 fraction of the day or week row as a CSS percentage, capped at 100% */
26
25
  function toPercent(num) {
27
26
  return `${num < 1 ? num * 100 : 100}%`;
28
27
  }
@@ -35,9 +34,6 @@ function getPos(value) {
35
34
  function isAllDayEvent(event) {
36
35
  return "allDay" in event && event.allDay;
37
36
  }
38
- /**
39
- * Fills a missing start (end - 1h) or end (start + 1h), clamped to the day.
40
- */
41
37
  function amendEvent(event) {
42
38
  const { start, end } = event;
43
39
  if (!start && !end) {
@@ -78,7 +74,6 @@ function normalizeEvent(event) {
78
74
  };
79
75
  return amendEvent(event);
80
76
  }
81
- /** The max topInd is the row height */
82
77
  function calcRowHeight(events) {
83
78
  const topIndArr = events.map((item) => item.topInd);
84
79
  return topIndArr.length ? Math.max(...topIndArr) + 1 : 1;
@@ -106,14 +101,10 @@ function calcRangeData(value, start, rangeLen, mode, locale, weekStartsOn, today
106
101
  return dateObj;
107
102
  });
108
103
  }
109
- /**
110
- * The days of a week as { date, dayString, ind, isToday, isWeekend, weekday }; `monthStart` is for month mode
111
- */
112
104
  function calcWeekData(value, monthStart, mode = "week", locale, weekStartsOn, today) {
113
105
  const start = startOfWeek(value, { weekStartsOn });
114
106
  return calcRangeData(monthStart || value, start, 7, mode, locale, weekStartsOn, today);
115
107
  }
116
- /** Splits an all-day event into one event per day it spans */
117
108
  function parseAllDayEvent(event, allDay = true) {
118
109
  const { start, end } = event;
119
110
  const diff = end ? differenceInCalendarDays(end, start) : 0;
@@ -128,7 +119,6 @@ function parseEvent(rawEvent) {
128
119
  if (differenceInHours(end, start) < 24) return [copyEvent(event, startOfDay(start), null, endOfDay(start)), copyEvent(event, startOfDay(end), startOfDay(end))];
129
120
  return parseAllDayEvent(event);
130
121
  }
131
- /** Groups events into a map keyed by the date string of `key`, normalized by `func` */
132
122
  function convertEventsArrToMap(arr, key, func) {
133
123
  return new Map(Object.entries(groupBy(arr, (item) => (func ? func(item[key]) : item[key]).toString())));
134
124
  }
@@ -31,7 +31,6 @@ export interface RangeData {
31
31
  week: DateObj[];
32
32
  }
33
33
  export type MonthData = Record<number, DateObj[]>;
34
- /** The props the foundation reads with getProps */
35
34
  export interface CalendarBaseProps {
36
35
  displayValue?: Date;
37
36
  showCurrTime?: boolean;
@@ -40,9 +39,6 @@ export interface CalendarAdapter<P extends CalendarBaseProps = CalendarBaseProps
40
39
  updateCurrPos: (currPos: number) => void;
41
40
  setShowCurrTime: (show: boolean) => void;
42
41
  }
43
- /**
44
- * Static pure layout functions for the views; an instance drives a day column's current time line.
45
- */
46
42
  export default class CalendarFoundation<P extends CalendarBaseProps = CalendarBaseProps, S extends object = object> extends BaseFoundation<CalendarAdapter<P, S>, P, S> {
47
43
  #private;
48
44
  static formatCbValue([date, ...time]: [Date, number, number, number] | [Date]): Date;
@@ -63,9 +59,8 @@ export default class CalendarFoundation<P extends CalendarBaseProps = CalendarBa
63
59
  * Subscribes to the day changing; returns the unsubscribe function. The caller refreshes once itself on mount.
64
60
  */
65
61
  static watchToday(onChange: () => void): () => void;
66
- /** How many event rows fit in a month cell of this height */
67
62
  static getItemLimit(cellHeight: number): number;
68
- /** How many of a day's events overflow the limit; a day's events are a sparse array indexed by row */
63
+ /** A day's events are a sparse array indexed by row */
69
64
  static countHidden(dayEvents: ParsedRangeEvent[] | undefined, itemLimit: number): number;
70
65
  /**
71
66
  * Once the open card's cell no longer collapses (resize, events changed) its "more" button is gone, and the
@@ -4,9 +4,6 @@ import { calcRangeData, calcWeekData, collectDailyEvents, convertEventsArrToMap,
4
4
  import { countBy } from "es-toolkit";
5
5
  import { addDays, compareAsc, differenceInCalendarDays, endOfMonth, endOfWeek, format, getWeekOfMonth, getWeeksInMonth, isAfter, isBefore, isSameDay, isSameMonth, isSameWeek, startOfDay, startOfMonth, startOfWeek } from "date-fns";
6
6
  // src/calendar/foundation.ts
7
- /**
8
- * Static pure layout functions for the views; an instance drives a day column's current time line.
9
- */
10
7
  var CalendarFoundation = class CalendarFoundation extends BaseFoundation {
11
8
  #currTimeTimer;
12
9
  static #parseEvents(events) {
@@ -165,11 +162,10 @@ var CalendarFoundation = class CalendarFoundation extends BaseFoundation {
165
162
  window.removeEventListener("focus", onChange);
166
163
  };
167
164
  }
168
- /** How many event rows fit in a month cell of this height */
169
165
  static getItemLimit(cellHeight) {
170
166
  return Math.max(0, Math.ceil((cellHeight - numbers.MONTH_CELL_PADDING) / numbers.MONTH_EVENT_HEIGHT));
171
167
  }
172
- /** How many of a day's events overflow the limit; a day's events are a sparse array indexed by row */
168
+ /** A day's events are a sparse array indexed by row */
173
169
  static countHidden(dayEvents, itemLimit) {
174
170
  return dayEvents?.slice(itemLimit).filter(Boolean).length ?? 0;
175
171
  }
@@ -3,7 +3,6 @@ export interface CalendarMonthAdapter<P extends object = object, S extends objec
3
3
  notifyClose: (e: any, key: string) => void;
4
4
  openCard: (key: string) => void;
5
5
  }
6
- /** Drives the month view's "more" card */
7
6
  export default class CalendarMonthFoundation<P extends object = object, S extends object = object> extends BaseFoundation<CalendarMonthAdapter<P, S>, P, S> {
8
7
  /** Closes the "more" card from its close button or a mousedown outside */
9
8
  closeCard: (e: unknown, key: string) => void;
@@ -1,6 +1,5 @@
1
1
  import BaseFoundation from "../base/foundation.js";
2
2
  // src/calendar/month-foundation.ts
3
- /** Drives the month view's "more" card */
4
3
  var CalendarMonthFoundation = class extends BaseFoundation {
5
4
  /** Closes the "more" card from its close button or a mousedown outside */
6
5
  closeCard = (e, key) => {
@@ -12,13 +12,11 @@ export type CarouselAutoPlay = boolean | {
12
12
  interval?: number;
13
13
  hoverToPause?: boolean;
14
14
  };
15
- /** The props the foundation reads */
16
15
  export interface CarouselBaseProps {
17
16
  activeIndex?: number;
18
17
  autoPlay?: CarouselAutoPlay;
19
18
  speed?: number;
20
19
  }
21
- /** The state the foundation reads */
22
20
  export interface CarouselBaseState {
23
21
  activeIndex: number;
24
22
  isInit: boolean;
@@ -133,7 +133,6 @@ export interface BasicCascaderProps {
133
133
  onBlur?: (e: any) => void;
134
134
  onFocus?: (e: any) => void;
135
135
  }
136
- /** The multiple-mode checked sets */
137
136
  export interface BasicCheckedState {
138
137
  checkedKeys: Set<string>;
139
138
  halfCheckedKeys: Set<string>;
@@ -221,7 +220,6 @@ export default class CascaderFoundation<E = unknown, LE = unknown> extends BaseF
221
220
  static getRealKeys(value: BasicValue, keyEntities: BasicEntities, props: BasicCascaderProps): string[];
222
221
  /** Whether a multiple value holds anything to clear, counting the controlled paths treeData lacks */
223
222
  static hasMultipleValue(props: BasicCascaderProps, { checkedKeys, keyEntities }: Pick<BasicCascaderInnerData, 'checkedKeys' | 'keyEntities'>): boolean;
224
- /** Checked, half checked and merged keys for a list of checked keys */
225
223
  static calcCheckedState(keys: string[], keyEntities: BasicEntities, { checkRelation, autoMergeValue, leafOnly }: BasicCascaderProps): BasicCheckedState;
226
224
  /**
227
225
  * The multiple-mode values that follow props: keyEntities, disabledKeys under disableStrictly, and the checked
@@ -231,13 +229,11 @@ export default class CascaderFoundation<E = unknown, LE = unknown> extends BaseF
231
229
  */
232
230
  static deriveMultipleState(props: BasicCascaderProps, state: BasicCascaderInnerData): MultipleView;
233
231
  static getInitialState(props: BasicCascaderProps): BasicCascaderInnerData;
234
- /** The flattened search results while searching, otherwise the top level */
235
232
  static getRenderData(props: BasicCascaderProps, state: BasicCascaderInnerData): Array<BasicEntity | BasicData>;
236
- /** Whether an option opens a column: it has children, or loadData may load some */
237
233
  static isBranch(data: BasicCascaderData, loadData: unknown): boolean;
238
234
  /**
239
- * What a treeitem in a column shows and exposes. An option that is both active and selected shows only as selected,
240
- * and in multiple mode selection is the checkbox's, so the row is never marked selected.
235
+ * An option that is both active and selected shows only as selected, and in multiple mode selection is the
236
+ * checkbox's, so the row is never marked selected.
241
237
  */
242
238
  static getTreeItemState(key: string, sets: Record<'activeKeys' | 'selectedKeys' | 'loadedKeys' | 'loadingKeys' | 'checkedKeys' | 'halfCheckedKeys', Set<string>>, multiple: boolean, expandable: boolean): TreeItemState;
243
239
  /** `keyboardKey` while its option is shown; hover or a click elsewhere can close its column */