@fibrae/semi-foundation 0.1.1 → 0.3.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 (282) hide show
  1. package/dist/anchor/foundation.d.ts +1 -4
  2. package/dist/anchor/foundation.js +21 -22
  3. package/dist/audio-player/foundation.d.ts +10 -13
  4. package/dist/audio-player/foundation.js +19 -20
  5. package/dist/auto-complete/foundation.d.ts +12 -14
  6. package/dist/auto-complete/foundation.js +51 -52
  7. package/dist/avatar/foundation.d.ts +5 -6
  8. package/dist/avatar/foundation.js +16 -16
  9. package/dist/avatar/variables.scss +0 -1
  10. package/dist/backtop/foundation.d.ts +2 -5
  11. package/dist/backtop/foundation.js +7 -8
  12. package/dist/banner/foundation.d.ts +1 -1
  13. package/dist/banner/foundation.js +4 -4
  14. package/dist/base/auto-close-foundation.d.ts +8 -9
  15. package/dist/base/auto-close-foundation.js +15 -15
  16. package/dist/base/foundation.d.ts +4 -4
  17. package/dist/base/foundation.js +12 -11
  18. package/dist/base/list-store.d.ts +0 -1
  19. package/dist/breadcrumb/foundation.d.ts +5 -5
  20. package/dist/breadcrumb/foundation.js +9 -10
  21. package/dist/breadcrumb/item-foundation.d.ts +3 -3
  22. package/dist/breadcrumb/item-foundation.js +6 -6
  23. package/dist/calendar/event-util.d.ts +0 -10
  24. package/dist/calendar/event-util.js +1 -11
  25. package/dist/calendar/foundation.d.ts +1 -6
  26. package/dist/calendar/foundation.js +5 -9
  27. package/dist/calendar/month-foundation.d.ts +2 -3
  28. package/dist/calendar/month-foundation.js +6 -7
  29. package/dist/carousel/foundation.d.ts +17 -19
  30. package/dist/carousel/foundation.js +51 -51
  31. package/dist/cascader/foundation.d.ts +36 -32
  32. package/dist/cascader/foundation.js +145 -132
  33. package/dist/cascader/util.d.ts +1 -8
  34. package/dist/cascader/util.js +1 -8
  35. package/dist/checkbox/checkbox-foundation.d.ts +3 -7
  36. package/dist/checkbox/checkbox-foundation.js +15 -17
  37. package/dist/checkbox/checkbox-group-foundation.d.ts +2 -3
  38. package/dist/checkbox/checkbox-group-foundation.js +8 -8
  39. package/dist/code-highlight/index.d.ts +1 -2
  40. package/dist/code-highlight/index.js +3 -3
  41. package/dist/collapse/foundation.d.ts +2 -2
  42. package/dist/collapse/foundation.js +7 -7
  43. package/dist/collapsible/foundation.d.ts +3 -3
  44. package/dist/collapsible/foundation.js +8 -8
  45. package/dist/color-picker/alpha-slider-foundation.d.ts +2 -4
  46. package/dist/color-picker/alpha-slider-foundation.js +10 -10
  47. package/dist/color-picker/color-choose-area-foundation.d.ts +2 -5
  48. package/dist/color-picker/color-choose-area-foundation.js +14 -14
  49. package/dist/color-picker/color-picker.scss +0 -2
  50. package/dist/color-picker/color-slider-foundation.d.ts +2 -4
  51. package/dist/color-picker/color-slider-foundation.js +10 -10
  52. package/dist/color-picker/data-part-foundation.d.ts +5 -5
  53. package/dist/color-picker/data-part-foundation.js +11 -11
  54. package/dist/color-picker/foundation.d.ts +4 -4
  55. package/dist/color-picker/foundation.js +10 -10
  56. package/dist/color-picker/interface.d.ts +0 -1
  57. package/dist/config-provider/breakpoint-observer.d.ts +3 -3
  58. package/dist/config-provider/breakpoint-observer.js +6 -6
  59. package/dist/config-provider/responsive-types.d.ts +0 -16
  60. package/dist/cropper/foundation.d.ts +15 -16
  61. package/dist/cropper/foundation.js +26 -24
  62. package/dist/date-picker/_utils/get-default-picker-date.d.ts +0 -3
  63. package/dist/date-picker/_utils/get-default-picker-date.js +0 -3
  64. package/dist/date-picker/_utils/get-inset-input-format-token.d.ts +0 -2
  65. package/dist/date-picker/_utils/get-inset-input-format-token.js +0 -2
  66. package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.d.ts +0 -2
  67. package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +0 -2
  68. package/dist/date-picker/_utils/parser.d.ts +0 -3
  69. package/dist/date-picker/_utils/parser.js +0 -7
  70. package/dist/date-picker/_utils/picker-type.d.ts +1 -3
  71. package/dist/date-picker/_utils/picker-type.js +0 -2
  72. package/dist/date-picker/_utils/to-callback-args.d.ts +0 -1
  73. package/dist/date-picker/_utils/to-callback-args.js +0 -1
  74. package/dist/date-picker/date-picker.scss +0 -3
  75. package/dist/date-picker/foundation.d.ts +39 -58
  76. package/dist/date-picker/foundation.js +126 -153
  77. package/dist/date-picker/input-foundation.d.ts +10 -16
  78. package/dist/date-picker/input-foundation.js +28 -30
  79. package/dist/date-picker/month-foundation.d.ts +0 -3
  80. package/dist/date-picker/month-foundation.js +0 -2
  81. package/dist/date-picker/months-grid-foundation.d.ts +17 -26
  82. package/dist/date-picker/months-grid-foundation.js +65 -75
  83. package/dist/date-picker/year-and-month-foundation.d.ts +3 -3
  84. package/dist/date-picker/year-and-month-foundation.js +11 -11
  85. package/dist/drag-move/foundation.d.ts +2 -3
  86. package/dist/drag-move/foundation.js +15 -13
  87. package/dist/dropdown/foundation.d.ts +8 -7
  88. package/dist/dropdown/foundation.js +32 -28
  89. package/dist/dropdown/menu-foundation.d.ts +1 -2
  90. package/dist/dropdown/menu-foundation.js +11 -11
  91. package/dist/feedback/foundation.d.ts +9 -10
  92. package/dist/feedback/foundation.js +33 -33
  93. package/dist/feedback/variables.scss +1 -5
  94. package/dist/float-button/float-button.css +0 -1
  95. package/dist/float-button/float-button.scss +0 -2
  96. package/dist/form/form-api-proxy.d.ts +8 -7
  97. package/dist/form/form-api-proxy.js +25 -25
  98. package/dist/form/form.scss +0 -12
  99. package/dist/form/foundation.d.ts +5 -5
  100. package/dist/form/foundation.js +60 -76
  101. package/dist/form/interface.d.ts +2 -15
  102. package/dist/form/utils.d.ts +0 -8
  103. package/dist/form/utils.js +0 -7
  104. package/dist/form/variables.scss +1 -4
  105. package/dist/grid/variables.scss +0 -10
  106. package/dist/highlight/foundation.d.ts +0 -2
  107. package/dist/highlight/foundation.js +1 -3
  108. package/dist/hot-keys/foundation.d.ts +2 -3
  109. package/dist/hot-keys/foundation.js +5 -5
  110. package/dist/image/image-foundation.d.ts +4 -6
  111. package/dist/image/image-foundation.js +10 -10
  112. package/dist/image/preview-footer-foundation.d.ts +3 -4
  113. package/dist/image/preview-footer-foundation.js +10 -10
  114. package/dist/image/preview-foundation.d.ts +0 -3
  115. package/dist/image/preview-foundation.js +7 -6
  116. package/dist/image/preview-image-foundation.d.ts +6 -9
  117. package/dist/image/preview-image-foundation.js +14 -14
  118. package/dist/image/preview-inner-foundation.d.ts +9 -10
  119. package/dist/image/preview-inner-foundation.js +38 -38
  120. package/dist/input/foundation.d.ts +10 -11
  121. package/dist/input/foundation.js +47 -49
  122. package/dist/input/text-entry-foundation.d.ts +3 -5
  123. package/dist/input/text-entry-foundation.js +14 -15
  124. package/dist/input/textarea-foundation.d.ts +7 -8
  125. package/dist/input/textarea-foundation.js +36 -36
  126. package/dist/input-number/caret.d.ts +0 -1
  127. package/dist/input-number/caret.js +0 -1
  128. package/dist/input-number/foundation.d.ts +16 -19
  129. package/dist/input-number/foundation.js +54 -58
  130. package/dist/json-viewer/foundation.d.ts +8 -10
  131. package/dist/json-viewer/foundation.js +23 -24
  132. package/dist/locale/interface.d.ts +0 -3
  133. package/dist/lottie/foundation.d.ts +1 -1
  134. package/dist/lottie/foundation.js +4 -4
  135. package/dist/markdown-render/foundation.d.ts +2 -7
  136. package/dist/markdown-render/foundation.js +5 -9
  137. package/dist/modal/modal-content-foundation.d.ts +7 -7
  138. package/dist/modal/modal-content-foundation.js +20 -20
  139. package/dist/modal/modal-foundation.d.ts +6 -6
  140. package/dist/modal/modal-foundation.js +24 -24
  141. package/dist/navigation/foundation.d.ts +1 -8
  142. package/dist/navigation/foundation.js +14 -20
  143. package/dist/navigation/item-foundation.d.ts +1 -1
  144. package/dist/navigation/item-foundation.js +8 -8
  145. package/dist/navigation/sub-nav-foundation.d.ts +3 -4
  146. package/dist/navigation/sub-nav-foundation.js +17 -17
  147. package/dist/notification/notification-list-foundation.d.ts +7 -8
  148. package/dist/notification/notification-list-foundation.js +12 -13
  149. package/dist/notification/variables.scss +0 -1
  150. package/dist/overflow-list/foundation.d.ts +4 -6
  151. package/dist/overflow-list/foundation.js +18 -19
  152. package/dist/pagination/foundation.d.ts +8 -10
  153. package/dist/pagination/foundation.js +28 -28
  154. package/dist/pincode/foundation.d.ts +6 -9
  155. package/dist/pincode/foundation.js +23 -26
  156. package/dist/popconfirm/popconfirm-foundation.d.ts +7 -9
  157. package/dist/popconfirm/popconfirm-foundation.js +26 -26
  158. package/dist/progress/generates.d.ts +1 -4
  159. package/dist/progress/generates.js +1 -4
  160. package/dist/progress/utils.d.ts +1 -1
  161. package/dist/progress/utils.js +1 -1
  162. package/dist/radio/radio-foundation.d.ts +5 -9
  163. package/dist/radio/radio-foundation.js +15 -16
  164. package/dist/radio/radio-group-foundation.d.ts +2 -3
  165. package/dist/radio/radio-group-foundation.js +9 -9
  166. package/dist/rating/foundation.d.ts +10 -15
  167. package/dist/rating/foundation.js +35 -38
  168. package/dist/resizable/group/index.d.ts +6 -10
  169. package/dist/resizable/group/index.js +40 -44
  170. package/dist/resizable/resizable.scss +0 -1
  171. package/dist/resizable/single/index.d.ts +3 -7
  172. package/dist/resizable/single/index.js +10 -13
  173. package/dist/scroll-list/item-foundation.d.ts +7 -9
  174. package/dist/scroll-list/item-foundation.js +35 -36
  175. package/dist/scroll-list/variables.scss +1 -6
  176. package/dist/select/foundation.d.ts +42 -57
  177. package/dist/select/foundation.js +214 -279
  178. package/dist/select/option-foundation.d.ts +23 -28
  179. package/dist/select/option-foundation.js +10 -19
  180. package/dist/select/variables.scss +1 -8
  181. package/dist/side-sheet/side-sheet-foundation.d.ts +7 -12
  182. package/dist/side-sheet/side-sheet-foundation.js +23 -27
  183. package/dist/side-sheet/variables.scss +1 -3
  184. package/dist/slider/foundation.d.ts +17 -28
  185. package/dist/slider/foundation.js +47 -59
  186. package/dist/slider/variables.scss +1 -5
  187. package/dist/sortable/accessibility.d.ts +1 -1
  188. package/dist/sortable/accessibility.js +2 -2
  189. package/dist/spin/foundation.d.ts +2 -4
  190. package/dist/spin/foundation.js +6 -7
  191. package/dist/spin/variables.scss +1 -3
  192. package/dist/steps/utils.d.ts +1 -1
  193. package/dist/switch/foundation.d.ts +2 -3
  194. package/dist/switch/foundation.js +7 -7
  195. package/dist/switch/switch.scss +1 -1
  196. package/dist/switch/variables.scss +1 -5
  197. package/dist/table/foundation.d.ts +24 -33
  198. package/dist/table/foundation.js +144 -108
  199. package/dist/table/table.scss +0 -1
  200. package/dist/table/utils.d.ts +2 -10
  201. package/dist/table/utils.js +0 -13
  202. package/dist/table/variables.scss +1 -5
  203. package/dist/tabs/foundation.d.ts +5 -14
  204. package/dist/tabs/foundation.js +17 -21
  205. package/dist/tabs/tabs.scss +1 -1
  206. package/dist/tag/focus.js +0 -1
  207. package/dist/tag-input/foundation.d.ts +11 -13
  208. package/dist/tag-input/foundation.js +52 -53
  209. package/dist/tag-input/tag-input.scss +0 -1
  210. package/dist/tag-input/utils/tag-focus.d.ts +0 -1
  211. package/dist/tag-input/utils/tag-focus.js +0 -1
  212. package/dist/time-picker/combox-foundation.d.ts +3 -11
  213. package/dist/time-picker/combox-foundation.js +3 -10
  214. package/dist/time-picker/foundation.d.ts +13 -23
  215. package/dist/time-picker/foundation.js +39 -48
  216. package/dist/time-picker/input-foundation.d.ts +4 -4
  217. package/dist/time-picker/input-foundation.js +13 -13
  218. package/dist/time-picker/utils/index.d.ts +0 -11
  219. package/dist/time-picker/utils/index.js +0 -11
  220. package/dist/toast/toast-list-foundation.d.ts +7 -7
  221. package/dist/toast/toast-list-foundation.js +14 -14
  222. package/dist/tooltip/adjust-position.d.ts +1 -2
  223. package/dist/tooltip/constants.d.ts +0 -3
  224. package/dist/tooltip/constants.js +0 -3
  225. package/dist/tooltip/foundation.d.ts +9 -12
  226. package/dist/tooltip/foundation.js +67 -63
  227. package/dist/tooltip/position.scss +0 -1
  228. package/dist/transfer/foundation.d.ts +22 -13
  229. package/dist/transfer/foundation.js +38 -24
  230. package/dist/tree/foundation.d.ts +14 -16
  231. package/dist/tree/foundation.js +61 -62
  232. package/dist/tree/shared.d.ts +2 -4
  233. package/dist/tree/shared.js +0 -2
  234. package/dist/tree/tree-util.d.ts +0 -5
  235. package/dist/tree/tree-util.js +0 -5
  236. package/dist/tree-select/foundation.d.ts +26 -22
  237. package/dist/tree-select/foundation.js +91 -86
  238. package/dist/typography/ellipsis.d.ts +5 -7
  239. package/dist/typography/ellipsis.js +8 -10
  240. package/dist/typography/format-numeral.d.ts +1 -1
  241. package/dist/typography/format-numeral.js +2 -2
  242. package/dist/typography/typography.scss +0 -1
  243. package/dist/upload/constants.d.ts +1 -1
  244. package/dist/upload/foundation.d.ts +17 -23
  245. package/dist/upload/foundation.js +93 -103
  246. package/dist/upload/utils.d.ts +3 -8
  247. package/dist/upload/utils.js +6 -11
  248. package/dist/user-guide/foundation.d.ts +3 -5
  249. package/dist/user-guide/foundation.js +19 -19
  250. package/dist/utils/a11y.d.ts +2 -6
  251. package/dist/utils/a11y.js +1 -4
  252. package/dist/utils/announcer.d.ts +2 -2
  253. package/dist/utils/announcer.js +4 -4
  254. package/dist/utils/array.d.ts +0 -6
  255. package/dist/utils/array.js +0 -6
  256. package/dist/utils/date-fns-extra.js +1 -5
  257. package/dist/utils/dom.d.ts +0 -1
  258. package/dist/utils/dom.js +0 -1
  259. package/dist/utils/escape-html.js +0 -3
  260. package/dist/utils/field-sizing.d.ts +0 -2
  261. package/dist/utils/field-sizing.js +0 -2
  262. package/dist/utils/focus-handle.d.ts +1 -2
  263. package/dist/utils/focus-handle.js +1 -3
  264. package/dist/utils/focus-scope.d.ts +5 -6
  265. package/dist/utils/focus-scope.js +10 -11
  266. package/dist/utils/is-promise.d.ts +1 -1
  267. package/dist/utils/release-holder.d.ts +2 -2
  268. package/dist/utils/release-holder.js +4 -4
  269. package/dist/utils/scroll-lock.d.ts +3 -4
  270. package/dist/utils/scroll-lock.js +3 -4
  271. package/dist/utils/tween.d.ts +0 -1
  272. package/dist/utils/tween.js +0 -1
  273. package/dist/utils/uuid.d.ts +0 -1
  274. package/dist/utils/uuid.js +0 -1
  275. package/dist/utils/warning.d.ts +0 -1
  276. package/dist/utils/warning.js +0 -1
  277. package/dist/video-player/foundation.d.ts +15 -15
  278. package/dist/video-player/foundation.js +89 -89
  279. package/dist/video-player/progress-foundation.d.ts +2 -3
  280. package/dist/video-player/progress-foundation.js +12 -13
  281. package/dist/video-player/variables.scss +1 -1
  282. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  @use 'semi:theme' as *;
2
- // Spacing
2
+
3
3
  $spacing-table-paddingY: $spacing-base; // 表格空数据占位及虚拟列表分组垂直内边距
4
4
  $spacing-table-paddingX: $spacing-base-tight; // 表格空数据占位及虚拟列表分组水平内边距
5
5
  $spacing-table_middle-paddingY: $spacing-base-tight; // 中尺寸表格单元格垂直内边距
@@ -26,11 +26,9 @@ $spacing-table_expand_icon-marginRight: 8px; // 行展开按钮右侧外边距
26
26
  $spacing-table_panel_operation-paddingX: $spacing-base; // 表格操作栏水平内边距
27
27
  $spacing-table_panel_operation-paddingY: $spacing-tight; // 表格操作栏垂直内边距
28
28
 
29
- // Size
30
29
  $width-table_base_border: 1px; // 表格单元格分割线宽度
31
30
  $width-table_header_border: 1px; // 表格表头分割线宽度
32
31
  $width-table_resizer_border: 2px; // 表格拉伸列标示线宽度
33
- // $radius-table_base: 4px;
34
32
  $width-table_column_selection: 48px; // 表格选择列及展开列宽度
35
33
  $width-table_column_sorter-icon: 16px; // 表格排序按钮宽度
36
34
  $height-table_column_sorter-icon: 16px; // 表格排序按钮高度
@@ -42,7 +40,6 @@ $width-table_react_resizable_handle: 9px; // 表格伸缩列调节热区宽度
42
40
  $height-table_pagination_outer_min: 60px; // 表格分页器高度
43
41
  $height-table_column_filter_dropdown: 290px; // 表格过滤筛选列表最大高度
44
42
 
45
- // Color no need to change
46
43
  $color-table_panel-bg-default: var(--semi-color-primary); // 操作区域样式默认背景颜色
47
44
  $color-table_panel-text-default: var(--semi-color-primary-light-active); // 表格操作栏选中项文本颜色
48
45
  $color-table-bg-default: var(--semi-color-bg-1); // 表格固定列及吸顶表头背景颜色
@@ -77,7 +74,6 @@ $color-table_placeholder-text-default: var(--semi-color-text-2); // 表格空数
77
74
 
78
75
  $color-table_cell-bg-hover: var(--semi-color-bg-0); // 让表格在 hover 时正确显示 $color-table_body-bg-hover 颜色,如无必要不要修改
79
76
 
80
- // Other
81
77
  $font-table_base-fontSize: 14px; // 表格默认文本字号
82
78
  $border-table_base-borderStyle: solid; // 表格描边样式
83
79
  $width-table_fixed_shadow: 6px; // 表格固定列滚动阴影宽度
@@ -11,13 +11,10 @@ export interface MotionView {
11
11
  export type MotionViewInput = Pick<MotionView, 'activeKey' | 'propsActiveKey' | 'paneKeys'>;
12
12
  /** The members of a keyboard event the foundation reads; DOM and synthetic events both satisfy it */
13
13
  export type TabKeyEvent = Pick<KeyboardEvent, 'key' | 'altKey' | 'ctrlKey' | 'metaKey' | 'target' | 'currentTarget' | 'preventDefault' | 'stopPropagation'>;
14
- /** What a pane's slide-in depends on */
15
14
  export interface PaneMotionInput {
16
- itemKey: string | undefined;
15
+ itemKey?: string;
17
16
  activeKey: string | null;
18
- /** The key selected before activeKey, null on mount */
19
17
  prevActiveKey: string | null;
20
- /** The itemKeys of the panes in order */
21
18
  paneKeys: ReadonlyArray<string | undefined>;
22
19
  tabPosition: 'top' | 'left';
23
20
  tabPaneMotion: boolean;
@@ -35,20 +32,17 @@ interface TabEntry {
35
32
  itemKey?: string;
36
33
  disabled?: boolean;
37
34
  }
38
- /** The props the foundation reads */
39
35
  export interface TabsBaseProps {
40
36
  activeKey?: string | null;
41
37
  tabPosition?: 'top' | 'left';
42
38
  preventScroll?: boolean;
43
39
  }
44
- /** The state the foundation reads */
45
40
  export interface TabsBaseState {
46
41
  activeKey: string | null;
47
42
  }
48
43
  export default class TabsFoundation<P extends TabsBaseProps = TabsBaseProps, S extends TabsBaseState = TabsBaseState, E = unknown> extends BaseFoundation<TabsAdapter<P, S, E>, P, S> {
49
44
  #private;
50
45
  protected handleNewActiveKey(activeKey: string | null): void;
51
- /** activeKey, else defaultActiveKey, else the first enabled entry of `list` that has a key */
52
46
  static getDefaultActiveKey(props: {
53
47
  activeKey?: string | null;
54
48
  defaultActiveKey?: string;
@@ -58,14 +52,12 @@ export default class TabsFoundation<P extends TabsBaseProps = TabsBaseProps, S e
58
52
  * null, matches no tab, or the tab sits in the more menu), the first enabled one takes it.
59
53
  */
60
54
  static getTabbableKey(tabs: ReadonlyArray<TabEntry>, activeKey: string | null): string | undefined;
61
- /** The slide-in class of a pane and whether it plays: only the selected pane slides, from the side of the previous one */
62
55
  static getPaneMotion({ itemKey, activeKey, prevActiveKey, paneKeys, tabPosition, tabPaneMotion, forceDisableMotion }: PaneMotionInput): {
63
56
  startClassName: string;
64
57
  hasMotion: boolean;
65
58
  };
66
59
  /** The next MotionView; `prev` itself when nothing it records changed, so hosts can compare by reference */
67
60
  static getMotionView(prev: MotionView | undefined, { activeKey, propsActiveKey, paneKeys }: MotionViewInput): MotionView;
68
- /** Splits `list` into the tabs that stay in the bar and the last `more` ones (or `more.count`) that move into the menu */
69
61
  static splitMore<T>(list: readonly T[], more: number | {
70
62
  count: number;
71
63
  }): {
@@ -76,16 +68,15 @@ export default class TabsFoundation<P extends TabsBaseProps = TabsBaseProps, S e
76
68
  static isTabsOverflowing(barEl: HTMLElement, tabPosition?: 'top' | 'left'): boolean;
77
69
  /** `barItemKey` is the data-scrollkey of the tab, see getBarItemKey */
78
70
  static scrollTabIntoView(barEl: HTMLElement | null | undefined, barItemKey: string, position?: ScrollLogicalPosition, behavior?: ScrollBehavior): void;
79
- /** Re-keys the OverflowList visibility map by itemKey; `hasHidden` and `isShowInViewport` summarize it */
80
71
  static readVisibleState(visibleMap: ReadonlyMap<string, boolean>): {
81
72
  visibleState: Map<string, boolean>;
82
73
  isShowInViewport: boolean;
83
74
  hasHidden: boolean;
84
75
  };
85
- handleTabClick(activeKey: string, event: E): void;
86
- syncActiveKey(activeKey?: string | null): void;
87
- handleTabPanesChange(panes: ReadonlyArray<TabEntry>): void;
88
- handleTabDelete(tabKey: string): void;
76
+ handleTabClick: (activeKey: string, event: E) => void;
77
+ syncActiveKey: (activeKey?: string | null) => void;
78
+ handleTabPanesChange: (panes: ReadonlyArray<TabEntry>) => void;
79
+ handleTabDelete: (tabKey: string) => void;
89
80
  handleKeyDown: (event: E & TabKeyEvent, itemKey: string, closable: boolean) => void;
90
81
  }
91
82
  export {};
@@ -8,7 +8,7 @@ const OVERFLOW_LIST_SCROLL_WRAPPER = `${BASE_CLASS_PREFIX}-overflow-list-scroll-
8
8
  var TabsFoundation = class TabsFoundation extends BaseFoundation {
9
9
  #notifyChange(activeKey) {
10
10
  const { activeKey: stateActiveKey } = this.getStates();
11
- if (stateActiveKey !== activeKey) this._adapter.notifyChange(activeKey);
11
+ if (stateActiveKey !== activeKey) this.adapter.notifyChange(activeKey);
12
12
  }
13
13
  #handlePrevent(event) {
14
14
  event.stopPropagation();
@@ -37,7 +37,7 @@ var TabsFoundation = class TabsFoundation extends BaseFoundation {
37
37
  }
38
38
  #switchTabOnArrowPress(key, tab, allTabs) {
39
39
  const { preventScroll } = this.getProps();
40
- const rtl = this._adapter.getContext("direction") === "rtl";
40
+ const rtl = this.adapter.getContext("direction") === "rtl";
41
41
  const step = {
42
42
  ArrowLeft: rtl ? 1 : -1,
43
43
  ArrowUp: -1,
@@ -55,9 +55,8 @@ var TabsFoundation = class TabsFoundation extends BaseFoundation {
55
55
  }
56
56
  handleNewActiveKey(activeKey) {
57
57
  const { activeKey: stateActiveKey } = this.getStates();
58
- if (stateActiveKey !== activeKey) this._adapter.setNewActiveKey(activeKey);
58
+ if (stateActiveKey !== activeKey) this.adapter.setNewActiveKey(activeKey);
59
59
  }
60
- /** activeKey, else defaultActiveKey, else the first enabled entry of `list` that has a key */
61
60
  static getDefaultActiveKey(props, list) {
62
61
  if (props.activeKey !== void 0) return props.activeKey;
63
62
  if (props.defaultActiveKey !== void 0) return props.defaultActiveKey;
@@ -71,7 +70,6 @@ var TabsFoundation = class TabsFoundation extends BaseFoundation {
71
70
  if (tabs.some((tab) => tab.itemKey === activeKey)) return;
72
71
  return tabs.find((tab) => !tab.disabled)?.itemKey;
73
72
  }
74
- /** The slide-in class of a pane and whether it plays: only the selected pane slides, from the side of the previous one */
75
73
  static getPaneMotion({ itemKey, activeKey, prevActiveKey, paneKeys, tabPosition, tabPaneMotion, forceDisableMotion }) {
76
74
  const activeIndex = activeKey === null ? -1 : paneKeys.indexOf(activeKey);
77
75
  const itemIndex = itemKey === void 0 ? -1 : paneKeys.indexOf(itemKey);
@@ -100,7 +98,6 @@ var TabsFoundation = class TabsFoundation extends BaseFoundation {
100
98
  forceDisableMotion: propsActiveKey === prev.propsActiveKey ? prev.forceDisableMotion : paneKeys.includes(propsActiveKey) && !prev.paneKeys.includes(propsActiveKey)
101
99
  };
102
100
  }
103
- /** Splits `list` into the tabs that stay in the bar and the last `more` ones (or `more.count`) that move into the menu */
104
101
  static splitMore(list, more) {
105
102
  if (typeof more !== "number" && typeof more !== "object") throw new Error("[Semi Tabs]: invalid tab props format: more");
106
103
  const keep = list.length - Math.min(typeof more === "number" ? more : more.count, list.length);
@@ -126,7 +123,6 @@ var TabsFoundation = class TabsFoundation extends BaseFoundation {
126
123
  inline: position
127
124
  });
128
125
  }
129
- /** Re-keys the OverflowList visibility map by itemKey; `hasHidden` and `isShowInViewport` summarize it */
130
126
  static readVisibleState(visibleMap) {
131
127
  const visibleState = new Map([...visibleMap].map(([barItemKey, visible]) => [getItemKeyByBarItemKey(barItemKey), visible]));
132
128
  const visibles = [...visibleState.values()];
@@ -136,28 +132,28 @@ var TabsFoundation = class TabsFoundation extends BaseFoundation {
136
132
  hasHidden: visibles.some((visible) => !visible)
137
133
  };
138
134
  }
139
- handleTabClick(activeKey, event) {
135
+ handleTabClick = (activeKey, event) => {
140
136
  this.#notifyChange(activeKey);
141
- if (!this._isControlledComponent("activeKey")) this.handleNewActiveKey(activeKey);
142
- this._adapter.notifyTabClick(activeKey, event);
143
- }
144
- syncActiveKey(activeKey) {
137
+ if (!this.isControlledComponent("activeKey")) this.handleNewActiveKey(activeKey);
138
+ this.adapter.notifyTabClick(activeKey, event);
139
+ };
140
+ syncActiveKey = (activeKey) => {
145
141
  if (activeKey !== void 0) this.handleNewActiveKey(activeKey);
146
- }
147
- handleTabPanesChange(panes) {
148
- if (this._isControlledComponent("activeKey")) return;
142
+ };
143
+ handleTabPanesChange = (panes) => {
144
+ if (this.isControlledComponent("activeKey")) return;
149
145
  const { activeKey } = this.getStates();
150
146
  if (!panes.some((pane) => pane.itemKey === activeKey)) this.handleNewActiveKey(TabsFoundation.getDefaultActiveKey({}, panes));
151
- }
152
- handleTabDelete(tabKey) {
153
- this._adapter.notifyTabDelete(tabKey);
154
- }
147
+ };
148
+ handleTabDelete = (tabKey) => {
149
+ this.adapter.notifyTabDelete(tabKey);
150
+ };
155
151
  handleKeyDown = (event, itemKey, closable) => {
156
152
  if (event.altKey || event.ctrlKey || event.metaKey) return;
157
153
  const tab = event.currentTarget;
158
- if (event.target !== tab) return;
154
+ if (!(tab instanceof HTMLElement) || event.target !== tab) return;
159
155
  const { preventScroll } = this.getProps();
160
- const allTabs = [...tab.parentElement.children].filter((item) => (item.getAttribute("data-tabkey") ?? "").startsWith(TAB_DATA_KEY_PREFIX));
156
+ const allTabs = [...tab.closest("[role=\"tablist\"]").querySelectorAll(`[data-tabkey^="${TAB_DATA_KEY_PREFIX}"]`)];
161
157
  const tabs = allTabs.filter((item) => item.getAttribute("aria-disabled") !== "true");
162
158
  switch (event.key) {
163
159
  case "ArrowLeft":
@@ -56,12 +56,12 @@ $ignoreIcon: '.#{$prefix}-icon-checkbox_tick, .#{$prefix}-icon-radio, .#{$prefix
56
56
  display: flex;
57
57
  align-content: center;
58
58
 
59
+ // :not(:not(&-icon)) outranks the generic icon rules
59
60
  &-icon:not(:not(&-icon)) {
60
61
  display: flex;
61
62
  flex-shrink: 0;
62
63
  align-items: center;
63
64
  margin-inline: $spacing-tabs_tab-more_trigger_icon-marginLeft $spacing-tabs_tab-more_trigger_icon-marginRight;
64
- // :not(:not(&-icon)) outranks the generic icon rules
65
65
  margin-top: $spacing-tabs_tab-more_trigger_icon-marginTop;
66
66
  margin-bottom: $spacing-tabs_tab-more_trigger_icon-marginBottom;
67
67
  }
package/dist/tag/focus.js CHANGED
@@ -5,7 +5,6 @@ const tagCls = cssClasses.PREFIX;
5
5
  function isReachableTag(node) {
6
6
  return node instanceof HTMLElement && node.matches(`.${tagCls}:not(.${tagCls}-invisible)`) && node.tabIndex >= 0;
7
7
  }
8
- /** Prefers the following tag, falling back to the preceding one. */
9
8
  function findAdjacentTag(tag) {
10
9
  for (let node = tag.nextElementSibling; node; node = node.nextElementSibling) if (isReachableTag(node)) return node;
11
10
  for (let node = tag.previousElementSibling; node; node = node.previousElementSibling) if (isReachableTag(node)) return node;
@@ -13,7 +13,6 @@ export interface TagSortIds {
13
13
  ids: string[];
14
14
  move?: OnSortEndProps;
15
15
  }
16
- /** The props the foundation reads with getProps */
17
16
  export interface TagInputBaseProps {
18
17
  value?: string[] | null;
19
18
  inputValue?: string;
@@ -65,7 +64,6 @@ export default class TagInputFoundation<P extends TagInputBaseProps = TagInputBa
65
64
  * values return `prev` itself, so a caller can skip the update and an untaken sort stays pending.
66
65
  */
67
66
  static getSortIds(values: string[], prev?: TagSortIds): TagSortIds;
68
- /** The input text on screen: a string `inputValue` prop wins over state */
69
67
  static getInputValue(props: {
70
68
  inputValue?: string;
71
69
  }, state: {
@@ -74,18 +72,18 @@ export default class TagInputFoundation<P extends TagInputBaseProps = TagInputBa
74
72
  init(): void;
75
73
  destroy(): void;
76
74
  /** Re-fits the inline input width without field-sizing; hosts call it when the typed text changes */
77
- fitInputWidth(): void;
78
- handleInputChange(value: string, e: E): void;
79
- handleInputCompositionStart: (_e: any) => void;
75
+ fitInputWidth: () => void;
76
+ handleInputChange: (value: string, e: E) => void;
77
+ handleInputCompositionStart: (_e: unknown) => void;
80
78
  handleInputCompositionEnd: (e: any) => void;
81
79
  handleKeyDown: (e: TagInputKeyboardEvent) => void;
82
- handleInputBlur(e: TagInputCursorEvent): void;
83
- handleInputFocus(e: TagInputCursorEvent): void;
84
- handleClearBtn(e: TagInputMouseEvent): void;
85
- handleTagClose(index: number): void;
86
- handleClick(): void;
80
+ handleInputBlur: (e: TagInputCursorEvent) => void;
81
+ handleInputFocus: (e: TagInputCursorEvent) => void;
82
+ handleClearBtn: (e: TagInputMouseEvent) => void;
83
+ handleTagClose: (index: number) => void;
84
+ handleClick: () => void;
87
85
  /** Ends the active session started by a click: on a mousedown outside the TagInput, or on blur() */
88
- deactivate(): void;
89
- handleClickPrefixOrSuffix(): void;
90
- handleSortEnd({ oldIndex, newIndex }: OnSortEndProps): void;
86
+ deactivate: () => void;
87
+ handleClickPrefixOrSuffix: () => void;
88
+ handleSortEnd: ({ oldIndex, newIndex }: OnSortEndProps) => void;
91
89
  }
@@ -23,7 +23,7 @@ var TagInputFoundation = class TagInputFoundation extends BaseFoundation {
23
23
  return getSplitedArray(originString, separators);
24
24
  }
25
25
  #checkInputChangeValid(value) {
26
- const { maxLength, separator } = this._adapter.getProps();
26
+ const { maxLength, separator } = this.adapter.getProps();
27
27
  const { inputValue } = this.#current();
28
28
  let allowChange = true;
29
29
  if (typeof maxLength === "number") {
@@ -33,7 +33,7 @@ var TagInputFoundation = class TagInputFoundation extends BaseFoundation {
33
33
  for (let i = 0; i < maxLen; i++) if (valueArr[i] !== void 0 && (inputArr[i] === void 0 || valueArr[i].length > inputArr[i].length)) {
34
34
  if (valueArr[i].length > maxLength) {
35
35
  allowChange = false;
36
- this._adapter.notifyInputExceed(value);
36
+ this.adapter.notifyInputExceed(value);
37
37
  break;
38
38
  }
39
39
  }
@@ -41,7 +41,7 @@ var TagInputFoundation = class TagInputFoundation extends BaseFoundation {
41
41
  return allowChange;
42
42
  }
43
43
  #handleAddTags(e) {
44
- const { separator, max, allowDuplicates } = this._adapter.getProps();
44
+ const { separator, max, allowDuplicates } = this.adapter.getProps();
45
45
  const { inputValue, tagsArray } = this.#current();
46
46
  let addTags = this.#splitArray(inputValue, separator);
47
47
  addTags = addTags.filter((item, idx) => {
@@ -52,7 +52,7 @@ var TagInputFoundation = class TagInputFoundation extends BaseFoundation {
52
52
  });
53
53
  let newTagList = tagsArray.concat(addTags);
54
54
  if (typeof max === "number" && newTagList.length > max) {
55
- this._adapter.notifyExceed(newTagList);
55
+ this.adapter.notifyExceed(newTagList);
56
56
  addTags = addTags.slice(0, Math.max(0, max - tagsArray.length));
57
57
  newTagList = tagsArray.concat(addTags);
58
58
  }
@@ -60,18 +60,18 @@ var TagInputFoundation = class TagInputFoundation extends BaseFoundation {
60
60
  this.#onInputChange("", e);
61
61
  }
62
62
  #onRemove(newTagList, removedTags, index) {
63
- if (!this._isControlledComponent()) this._adapter.setTagsArray(newTagList);
64
- this._adapter.notifyTagChange(newTagList);
65
- this._adapter.notifyTagRemove(removedTags, index);
63
+ if (!this.isControlledComponent()) this.adapter.setTagsArray(newTagList);
64
+ this.adapter.notifyTagChange(newTagList);
65
+ this.adapter.notifyTagRemove(removedTags, index);
66
66
  }
67
67
  #onAdd(newTagList, addTags) {
68
- if (!this._isControlledComponent()) this._adapter.setTagsArray(newTagList);
69
- this._adapter.notifyTagChange(newTagList);
70
- this._adapter.notifyTagAdd(addTags);
68
+ if (!this.isControlledComponent()) this.adapter.setTagsArray(newTagList);
69
+ this.adapter.notifyTagChange(newTagList);
70
+ this.adapter.notifyTagAdd(addTags);
71
71
  }
72
72
  #onInputChange(value, e) {
73
- this._adapter.setInputValue(value);
74
- this._adapter.notifyInputChange(value, e);
73
+ this.adapter.setInputValue(value);
74
+ this.adapter.notifyInputChange(value, e);
75
75
  }
76
76
  /** A controlled `value` wins over state, and a controlled `null` means no tags */
77
77
  static getTagsArray(props, state) {
@@ -107,7 +107,6 @@ var TagInputFoundation = class TagInputFoundation extends BaseFoundation {
107
107
  ids: values.map((value) => unused.get(value)?.shift() ?? newId(value))
108
108
  };
109
109
  }
110
- /** The input text on screen: a string `inputValue` prop wins over state */
111
110
  static getInputValue(props, state) {
112
111
  return typeof props.inputValue === "string" ? props.inputValue : state.inputValue;
113
112
  }
@@ -122,38 +121,38 @@ var TagInputFoundation = class TagInputFoundation extends BaseFoundation {
122
121
  this.#fitInline = false;
123
122
  }
124
123
  /** Re-fits the inline input width without field-sizing; hosts call it when the typed text changes */
125
- fitInputWidth() {
126
- const input = this.#fitInline ? this._adapter.getInput() : null;
124
+ fitInputWidth = () => {
125
+ const input = this.#fitInline ? this.adapter.getInput() : null;
127
126
  if (input) fitInputWidth(input);
128
- }
129
- handleInputChange(value, e) {
127
+ };
128
+ handleInputChange = (value, e) => {
130
129
  const { entering } = this.getStates();
131
130
  if (entering) this.#onInputChange(value, e);
132
131
  else if (this.#checkInputChangeValid(value)) this.#onInputChange(value, e);
133
- }
132
+ };
134
133
  handleInputCompositionStart = (_e) => {
135
134
  const { maxLength } = this.getProps();
136
135
  if (typeof maxLength !== "number") return;
137
- this._adapter.setEntering(true);
136
+ this.adapter.setEntering(true);
138
137
  };
139
138
  handleInputCompositionEnd = (e) => {
140
139
  const { value } = e.target;
141
140
  const { maxLength, separator } = this.getProps();
142
141
  if (typeof maxLength !== "number") return;
143
- this._adapter.setEntering(false);
142
+ this.adapter.setEntering(false);
144
143
  let allowChange = true;
145
144
  const inputArr = this.#splitArray(value, separator);
146
145
  let index = 0;
147
146
  for (; index < inputArr.length; index++) if (inputArr[index].length > maxLength) {
148
147
  allowChange = false;
149
- this._adapter.notifyInputExceed(value);
148
+ this.adapter.notifyInputExceed(value);
150
149
  break;
151
150
  }
152
151
  if (!allowChange) {
153
152
  const newInputArr = inputArr.slice(0, index);
154
153
  if (index < inputArr.length) newInputArr.push(inputArr[index].slice(0, maxLength));
155
154
  this.#onInputChange(newInputArr.join(Array.isArray(separator) ? separator[0] : separator), e);
156
- } else this._adapter.setInputValue(value);
155
+ } else this.adapter.setInputValue(value);
157
156
  };
158
157
  handleKeyDown = (e) => {
159
158
  const { inputValue, tagsArray } = this.#current();
@@ -168,55 +167,55 @@ var TagInputFoundation = class TagInputFoundation extends BaseFoundation {
168
167
  const removedTag = tagsArray[length - 1];
169
168
  this.#onRemove(newTagList, removedTag, length - 1);
170
169
  }
171
- this._adapter.notifyKeyDown(e);
170
+ this.adapter.notifyKeyDown(e);
172
171
  };
173
- handleInputBlur(e) {
174
- const { addOnBlur } = this._adapter.getProps();
172
+ handleInputBlur = (e) => {
173
+ const { addOnBlur } = this.adapter.getProps();
175
174
  if (addOnBlur === true && this.#current().inputValue !== "") this.#handleAddTags(e);
176
175
  this.deactivate();
177
- this._adapter.setFocusing(false);
178
- this._adapter.notifyBlur(e);
179
- }
180
- handleInputFocus(e) {
176
+ this.adapter.setFocusing(false);
177
+ this.adapter.notifyBlur(e);
178
+ };
179
+ handleInputFocus = (e) => {
181
180
  this.handleClick();
182
- this._adapter.setFocusing(true);
183
- this._adapter.notifyFocus(e);
184
- }
185
- handleClearBtn(e) {
181
+ this.adapter.setFocusing(true);
182
+ this.adapter.notifyFocus(e);
183
+ };
184
+ handleClearBtn = (e) => {
186
185
  const { inputValue, tagsArray } = this.#current();
187
186
  if (tagsArray.length > 0) {
188
- if (!this._isControlledComponent()) this._adapter.setTagsArray([]);
189
- this._adapter.notifyTagChange([]);
187
+ if (!this.isControlledComponent()) this.adapter.setTagsArray([]);
188
+ this.adapter.notifyTagChange([]);
190
189
  }
191
190
  if (inputValue.length > 0) this.#onInputChange("", e);
192
191
  e.stopPropagation();
193
- }
194
- handleTagClose(index) {
192
+ };
193
+ handleTagClose = (index) => {
195
194
  const { tagsArray } = this.#current();
196
195
  const newTagList = [...tagsArray];
197
196
  newTagList.splice(index, 1);
198
197
  const removedTag = tagsArray[index];
199
198
  this.#onRemove(newTagList, removedTag, index);
200
- }
201
- handleClick() {
199
+ };
200
+ handleClick = () => {
202
201
  const { disabled } = this.getProps();
203
202
  if (disabled) return;
204
- if (!this.getState("active")) this._adapter.setActive(true);
205
- }
203
+ if (!this.getState("active")) this.adapter.setActive(true);
204
+ };
206
205
  /** Ends the active session started by a click: on a mousedown outside the TagInput, or on blur() */
207
- deactivate() {
208
- this._adapter.setActive(false);
209
- }
210
- handleClickPrefixOrSuffix() {
211
- const { disabled } = this._adapter.getProps();
212
- const { focusing } = this._adapter.getStates();
213
- if (!disabled && !focusing) this._adapter.toggleFocusing(true);
214
- }
215
- handleSortEnd({ oldIndex, newIndex }) {
206
+ deactivate = () => {
207
+ this.adapter.setActive(false);
208
+ };
209
+ handleClickPrefixOrSuffix = () => {
210
+ const { disabled } = this.adapter.getProps();
211
+ const { focusing } = this.adapter.getStates();
212
+ if (!disabled && !focusing) this.adapter.toggleFocusing(true);
213
+ };
214
+ handleSortEnd = ({ oldIndex, newIndex }) => {
216
215
  const { tagsArray } = this.#current();
217
216
  const newTagsArray = arrayMove(tagsArray, oldIndex, newIndex);
218
- if (!this._isControlledComponent()) this._adapter.setTagsArray(newTagsArray);
219
- this._adapter.notifyTagChange(newTagsArray);
220
- }
217
+ if (!this.isControlledComponent()) this.adapter.setTagsArray(newTagsArray);
218
+ this.adapter.notifyTagChange(newTagsArray);
219
+ };
221
220
  };
222
221
  export { TagInputFoundation as default };
@@ -40,7 +40,6 @@ $module: #{$prefix}-tagInput;
40
40
  }
41
41
  }
42
42
 
43
- // renders like the bare icon it wraps
44
43
  &-sortable-handle {
45
44
  @include bare-button;
46
45
 
@@ -1,3 +1,2 @@
1
- /** The place of the focused element among the tags' tab stops in the TagInput's wrapper, or -1 */
2
1
  export declare function getFocusedTagStop(wrapper: HTMLElement | null): number;
3
2
  export declare function focusTagStop(wrapper: HTMLElement | null, index: number): void;
@@ -5,7 +5,6 @@ import { tabbable } from "tabbable";
5
5
  function tagStops(wrapper) {
6
6
  return tabbable(wrapper, { displayCheck: "none" }).filter((node) => !node.closest(`.${cssClasses.PREFIX}-wrapper-input, .${cssClasses.PREFIX}-sortable-handle`));
7
7
  }
8
- /** The place of the focused element among the tags' tab stops in the TagInput's wrapper, or -1 */
9
8
  function getFocusedTagStop(wrapper) {
10
9
  return wrapper ? tagStops(wrapper).indexOf(FocusTrapHandle.getActiveElement(wrapper)) : -1;
11
10
  }
@@ -1,6 +1,5 @@
1
1
  export type TimeStamp = Date | string | number;
2
2
  export type ColumnType = 'ampm' | 'hour' | 'minute' | 'second';
3
- /** The props one time panel is computed from */
4
3
  export interface ComboboxBaseProps {
5
4
  timeStampValue?: TimeStamp;
6
5
  format?: string;
@@ -19,17 +18,15 @@ export declare function formatOption(option: number, disabledOptions: number[]):
19
18
  value: string;
20
19
  disabled: boolean;
21
20
  };
22
- /** Pure calculations for one time panel: which columns show, what each lists, and the time a picked item makes */
23
21
  export default class ComboboxFoundation {
24
- /** The columns `format` asks for */
25
22
  static getColumns(format: string): {
26
23
  showHour: boolean;
27
24
  showMinute: boolean;
28
25
  showSecond: boolean;
29
26
  };
30
27
  /**
31
- * The items and the selected index of each column. Every column reads the shown time (midnight, or noon in a PM
32
- * panel, while there is no value), the time a picked item is applied to.
28
+ * Every column reads the shown time (midnight, or noon in a PM panel, while there is no value), the time a picked
29
+ * item is applied to.
33
30
  */
34
31
  static getOptions(props: ComboboxBaseProps): {
35
32
  isAM: boolean;
@@ -58,10 +55,7 @@ export default class ComboboxFoundation {
58
55
  showMinute: boolean;
59
56
  showSecond: boolean;
60
57
  };
61
- /**
62
- * The time after picking `itemValue` in column `type`. A 12-hour hour keeps the half day `isAM` names; AM/PM moves
63
- * the time by 12 hours only when it is in the other half day.
64
- */
58
+ /** A 12-hour hour keeps the half day `isAM` names; AM/PM moves the time by 12 hours only when it is in the other half day */
65
59
  static applyItem(timeStampValue: TimeStamp, type: ColumnType, itemValue: string, use12Hours: boolean, isAM: boolean): Date;
66
60
  /**
67
61
  * `disabledHours()`, mapped onto the 12-hour column of the half day `isAM` names when `use12Hours`; the hours of
@@ -70,10 +64,8 @@ export default class ComboboxFoundation {
70
64
  static getDisabledHours({ use12Hours, disabledHours, isAM }: Pick<ComboboxBaseProps, 'use12Hours' | 'disabledHours'> & {
71
65
  isAM?: boolean;
72
66
  }): number[];
73
- /** The half day of the value; `defaultIsAM` applies while there is no value */
74
67
  static isAM(timeStamp: TimeStamp, defaultIsAM?: boolean): boolean;
75
68
  /** A timestamp of 0 is a value; only nothing and '' are not */
76
69
  static hasValue(timeStamp: unknown): boolean;
77
- /** The time a panel shows; without a value, today's midnight, or noon when the panel shows PM */
78
70
  static getDisplayDateFromTimeStamp(timeStamp: TimeStamp, defaultIsPM?: boolean): Date;
79
71
  }
@@ -19,9 +19,7 @@ function toColumn(options, disabledOptions, selected) {
19
19
  selectedIndex: options.indexOf(selected)
20
20
  };
21
21
  }
22
- /** Pure calculations for one time panel: which columns show, what each lists, and the time a picked item makes */
23
22
  var ComboboxFoundation = class ComboboxFoundation {
24
- /** The columns `format` asks for */
25
23
  static getColumns(format) {
26
24
  return {
27
25
  showHour: /HH|hh|H|h/.test(format),
@@ -30,8 +28,8 @@ var ComboboxFoundation = class ComboboxFoundation {
30
28
  };
31
29
  }
32
30
  /**
33
- * The items and the selected index of each column. Every column reads the shown time (midnight, or noon in a PM
34
- * panel, while there is no value), the time a picked item is applied to.
31
+ * Every column reads the shown time (midnight, or noon in a PM panel, while there is no value), the time a picked
32
+ * item is applied to.
35
33
  */
36
34
  static getOptions(props) {
37
35
  const { timeStampValue, use12Hours, hourStep, disabledMinutes, disabledSeconds, hideDisabledOptions, minuteStep, secondStep } = props;
@@ -57,10 +55,7 @@ var ComboboxFoundation = class ComboboxFoundation {
57
55
  second: toColumn(secondOptions, disabledSecondOptions, dateTime.getSeconds())
58
56
  };
59
57
  }
60
- /**
61
- * The time after picking `itemValue` in column `type`. A 12-hour hour keeps the half day `isAM` names; AM/PM moves
62
- * the time by 12 hours only when it is in the other half day.
63
- */
58
+ /** A 12-hour hour keeps the half day `isAM` names; AM/PM moves the time by 12 hours only when it is in the other half day */
64
59
  static applyItem(timeStampValue, type, itemValue, use12Hours, isAM) {
65
60
  const date = ComboboxFoundation.getDisplayDateFromTimeStamp(timeStampValue, use12Hours && !isAM);
66
61
  const hours = date.getHours();
@@ -83,7 +78,6 @@ var ComboboxFoundation = class ComboboxFoundation {
83
78
  if (use12Hours && Array.isArray(disabledOptions)) return disabledOptions.filter((h) => h < 12 === Boolean(isAM)).map((h) => h % 12 || 12);
84
79
  return disabledOptions;
85
80
  }
86
- /** The half day of the value; `defaultIsAM` applies while there is no value */
87
81
  static isAM(timeStamp, defaultIsAM = true) {
88
82
  return ComboboxFoundation.hasValue(timeStamp) ? ComboboxFoundation.getDisplayDateFromTimeStamp(timeStamp).getHours() < 12 : defaultIsAM;
89
83
  }
@@ -91,7 +85,6 @@ var ComboboxFoundation = class ComboboxFoundation {
91
85
  static hasValue(timeStamp) {
92
86
  return timeStamp != null && timeStamp !== "" && isValidDate(new Date(timeStamp));
93
87
  }
94
- /** The time a panel shows; without a value, today's midnight, or noon when the panel shows PM */
95
88
  static getDisplayDateFromTimeStamp(timeStamp, defaultIsPM = false) {
96
89
  if (!ComboboxFoundation.hasValue(timeStamp)) {
97
90
  const now = /* @__PURE__ */ new Date();