@laser-ui/components 2.3.5 → 2.4.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 (208) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/accordion/Accordion.d.ts +0 -1
  3. package/accordion/types.d.ts +0 -1
  4. package/affix/Affix.d.ts +0 -1
  5. package/affix/types.d.ts +0 -1
  6. package/alert/Alert.d.ts +0 -1
  7. package/alert/types.d.ts +0 -1
  8. package/anchor/Anchor.d.ts +0 -1
  9. package/anchor/types.d.ts +0 -1
  10. package/avatar/Avatar.d.ts +0 -1
  11. package/avatar/types.d.ts +0 -1
  12. package/badge/Badge.d.ts +0 -1
  13. package/badge/internal/BadgeNumber.d.ts +0 -1
  14. package/badge/types.d.ts +0 -1
  15. package/base-input/types.d.ts +0 -1
  16. package/breadcrumb/Breadcrumb.d.ts +0 -1
  17. package/breadcrumb/types.d.ts +0 -1
  18. package/button/types.d.ts +0 -1
  19. package/card/Card.d.ts +0 -1
  20. package/card/CardAction.d.ts +0 -1
  21. package/card/CardActions.d.ts +0 -1
  22. package/card/CardContent.d.ts +0 -1
  23. package/card/CardHeader.d.ts +0 -1
  24. package/card/types.d.ts +0 -1
  25. package/cascader/Cascader.d.ts +0 -1
  26. package/cascader/Cascader.js +3 -5
  27. package/cascader/internal/CascaderPanel.d.ts +0 -1
  28. package/cascader/internal/CascaderSearchPanel.d.ts +0 -1
  29. package/cascader/internal/types.d.ts +0 -1
  30. package/cascader/types.d.ts +0 -1
  31. package/checkbox/Checkbox.d.ts +0 -1
  32. package/checkbox/CheckboxGroup.d.ts +0 -1
  33. package/checkbox/types.d.ts +0 -1
  34. package/circular-progress/CircularProgress.d.ts +0 -1
  35. package/compose/Compose.d.ts +0 -1
  36. package/compose/ComposeItem.d.ts +0 -1
  37. package/compose/types.d.ts +0 -1
  38. package/config-provider/ConfigProvider.d.ts +0 -1
  39. package/config-provider/types.d.ts +0 -1
  40. package/context/index.d.ts +0 -1
  41. package/date-picker/DatePicker.d.ts +0 -1
  42. package/date-picker/DatePicker.js +8 -4
  43. package/date-picker/internal/DatePickerPanel.d.ts +0 -1
  44. package/date-picker/types.d.ts +0 -1
  45. package/dialog-service.d.ts +0 -1
  46. package/drawer/Drawer.d.ts +0 -1
  47. package/drawer/DrawerFooter.d.ts +0 -1
  48. package/drawer/DrawerHeader.d.ts +0 -1
  49. package/drawer/types.d.ts +0 -1
  50. package/drawer/vars.d.ts +0 -1
  51. package/dropdown/Dropdown.d.ts +0 -1
  52. package/dropdown/internal/DropdownList.d.ts +0 -1
  53. package/dropdown/internal/DropdownList.js +6 -6
  54. package/dropdown/internal/DropdownSub.d.ts +0 -1
  55. package/dropdown/types.d.ts +0 -1
  56. package/dropdown/utils.d.ts +0 -1
  57. package/empty/Empty.d.ts +0 -1
  58. package/empty/types.d.ts +0 -1
  59. package/fab/Fab.d.ts +0 -1
  60. package/fab/FabBacktop.d.ts +0 -1
  61. package/fab/FabButton.d.ts +0 -1
  62. package/fab/types.d.ts +0 -1
  63. package/fab/vars.d.ts +0 -1
  64. package/form/Form.d.ts +0 -1
  65. package/form/FormItem.d.ts +0 -1
  66. package/form/internal/FormError.d.ts +0 -1
  67. package/form/types.d.ts +0 -1
  68. package/form/vars.d.ts +0 -1
  69. package/hooks/useContainerScrolling.d.ts +0 -1
  70. package/hooks/useFocusVisible.d.ts +0 -1
  71. package/hooks/useLayout.d.ts +0 -1
  72. package/hooks/useNestedPopup.d.ts +0 -1
  73. package/hooks/useStyled.d.ts +0 -1
  74. package/hooks/useStyled.js +0 -2
  75. package/hooks/useZIndex.js +5 -2
  76. package/icon/Icon.d.ts +0 -1
  77. package/icon/types.d.ts +0 -1
  78. package/image/Image.d.ts +0 -1
  79. package/image/ImageAction.d.ts +0 -1
  80. package/image/ImageLoader.d.ts +0 -1
  81. package/image/ImagePreview.d.ts +0 -1
  82. package/image/types.d.ts +0 -1
  83. package/input/Input.d.ts +0 -1
  84. package/input/types.d.ts +0 -1
  85. package/internal/lazy-loading/LazyLoading.d.ts +0 -1
  86. package/internal/lazy-loading/types.d.ts +0 -1
  87. package/internal/popup/Popup.d.ts +0 -1
  88. package/internal/popup/types.d.ts +0 -1
  89. package/internal/portal/Portal.d.ts +0 -1
  90. package/internal/portal/types.d.ts +0 -1
  91. package/mask/Mask.d.ts +0 -1
  92. package/mask/types.d.ts +0 -1
  93. package/menu/Menu.d.ts +0 -1
  94. package/menu/Menu.js +6 -6
  95. package/menu/internal/MenuGroup.d.ts +0 -1
  96. package/menu/internal/MenuItem.d.ts +0 -1
  97. package/menu/internal/MenuSub.d.ts +0 -1
  98. package/menu/types.d.ts +0 -1
  99. package/menu/utils.d.ts +0 -1
  100. package/modal/Modal.d.ts +0 -1
  101. package/modal/ModalAlert.d.ts +0 -1
  102. package/modal/ModalFooter.d.ts +0 -1
  103. package/modal/ModalHeader.d.ts +0 -1
  104. package/modal/types.d.ts +0 -1
  105. package/modal/vars.d.ts +0 -1
  106. package/notification/Notification.d.ts +0 -1
  107. package/notification/types.d.ts +0 -1
  108. package/package.json +2 -2
  109. package/pagination/Pagination.d.ts +0 -1
  110. package/pagination/types.d.ts +0 -1
  111. package/pagination/utils.d.ts +1 -2
  112. package/popover/Popover.d.ts +0 -1
  113. package/popover/PopoverFooter.d.ts +0 -1
  114. package/popover/PopoverHeader.d.ts +0 -1
  115. package/popover/types.d.ts +0 -1
  116. package/popover/vars.d.ts +0 -1
  117. package/progress/Progress.d.ts +0 -1
  118. package/progress/types.d.ts +0 -1
  119. package/radio/Radio.d.ts +0 -1
  120. package/radio/RadioGroup.d.ts +0 -1
  121. package/radio/types.d.ts +0 -1
  122. package/radio/vars.d.ts +1 -2
  123. package/rating/Rating.d.ts +0 -1
  124. package/rating/internal/RatingStar.d.ts +0 -1
  125. package/rating/types.d.ts +0 -1
  126. package/root/Dialogs.d.ts +0 -1
  127. package/root/Root.d.ts +0 -1
  128. package/root/types.d.ts +0 -1
  129. package/root/vars.d.ts +0 -1
  130. package/select/Select.d.ts +0 -1
  131. package/select/Select.js +2 -4
  132. package/select/types.d.ts +0 -1
  133. package/separator/Separator.d.ts +0 -1
  134. package/separator/types.d.ts +0 -1
  135. package/skeleton/Skeleton.d.ts +0 -1
  136. package/skeleton/types.d.ts +0 -1
  137. package/slider/Slider.d.ts +0 -1
  138. package/slider/types.d.ts +0 -1
  139. package/slides/Slides.d.ts +0 -1
  140. package/slides/Slides.js +5 -5
  141. package/slides/types.d.ts +0 -1
  142. package/spinner/Spinner.d.ts +0 -1
  143. package/spinner/types.d.ts +0 -1
  144. package/stepper/Stepper.d.ts +0 -1
  145. package/stepper/types.d.ts +0 -1
  146. package/switch/types.d.ts +0 -1
  147. package/table/Table.d.ts +0 -1
  148. package/table/TableEmpty.d.ts +0 -1
  149. package/table/TableExpand.d.ts +0 -1
  150. package/table/TableFilter.d.ts +0 -1
  151. package/table/TableTd.d.ts +0 -1
  152. package/table/TableTh.d.ts +0 -1
  153. package/table/TableThAction.d.ts +0 -1
  154. package/table/internal/TableCell.d.ts +0 -1
  155. package/table/types.d.ts +0 -1
  156. package/table/vars.d.ts +0 -1
  157. package/tabs/Tabs.d.ts +0 -1
  158. package/tabs/types.d.ts +0 -1
  159. package/tag/Tag.d.ts +0 -1
  160. package/tag/types.d.ts +0 -1
  161. package/textarea/Textarea.d.ts +0 -1
  162. package/textarea/types.d.ts +0 -1
  163. package/time-picker/TimePicker.d.ts +0 -1
  164. package/time-picker/internal/TimePickerPanel.d.ts +0 -1
  165. package/time-picker/types.d.ts +0 -1
  166. package/timeline/Timeline.d.ts +0 -1
  167. package/timeline/types.d.ts +0 -1
  168. package/toast/Toast.d.ts +0 -1
  169. package/toast/types.d.ts +0 -1
  170. package/tooltip/Tooltip.d.ts +0 -1
  171. package/tooltip/types.d.ts +0 -1
  172. package/transfer/Transfer.d.ts +0 -1
  173. package/transfer/Transfer.js +4 -5
  174. package/transfer/internal/TransferPanel.d.ts +0 -1
  175. package/transfer/types.d.ts +0 -1
  176. package/transition/CollapseTransition.d.ts +0 -1
  177. package/transition/Transition.d.ts +0 -1
  178. package/transition/types.d.ts +0 -1
  179. package/tree/Tree.d.ts +0 -1
  180. package/tree/internal/TreePanel.d.ts +0 -1
  181. package/tree/node/abstract-node.d.ts +0 -1
  182. package/tree/node/multiple-node.d.ts +0 -1
  183. package/tree/node/single-node.d.ts +0 -1
  184. package/tree/types.d.ts +0 -1
  185. package/tree/utils.d.ts +0 -1
  186. package/tree-select/TreeSelect.d.ts +0 -1
  187. package/tree-select/TreeSelect.js +2 -4
  188. package/tree-select/internal/TreeSelectSearchPanel.d.ts +0 -1
  189. package/tree-select/internal/types.d.ts +0 -1
  190. package/tree-select/types.d.ts +0 -1
  191. package/types.d.ts +0 -1
  192. package/upload/Upload.d.ts +0 -1
  193. package/upload/Upload.js +4 -3
  194. package/upload/UploadAction.d.ts +0 -1
  195. package/upload/UploadButton.d.ts +0 -1
  196. package/upload/UploadList.d.ts +0 -1
  197. package/upload/UploadPicture.d.ts +0 -1
  198. package/upload/UploadPictureList.d.ts +0 -1
  199. package/upload/UploadPreviewAction.d.ts +0 -1
  200. package/upload/hooks.d.ts +0 -1
  201. package/upload/types.d.ts +0 -1
  202. package/upload/vars.d.ts +5 -6
  203. package/utils/handleModalKeyDown.d.ts +0 -1
  204. package/utils/mergeCS.d.ts +0 -1
  205. package/virtual-scroll/VirtualScroll.d.ts +0 -1
  206. package/virtual-scroll/types.d.ts +0 -1
  207. package/wave/Wave.d.ts +0 -1
  208. package/wave/types.d.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
4
4
 
5
+ # [2.4.0](https://github.com/laser-ui/laser-ui/compare/v2.3.5...v2.4.0) (2026-03-27)
6
+
7
+ ### Bug Fixes
8
+
9
+ - fix `no-non-null-assertion` ([0080403](https://github.com/laser-ui/laser-ui/commit/0080403dcf3c8d82f473d5ce62c2222efdfc0e06))
10
+
5
11
  ## [2.3.5](https://github.com/laser-ui/laser-ui/compare/v2.3.4...v2.3.5) (2026-03-16)
6
12
 
7
13
  ### Bug Fixes
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { AccordionItem, AccordionProps } from './types';
3
2
  export declare function Accordion<ID extends React.Key, T extends AccordionItem<ID>>(props: AccordionProps<ID, T>): React.ReactElement | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { BaseProps } from '../types';
4
3
  export {};
package/affix/Affix.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { AffixProps } from './types';
3
2
  export declare function Affix(props: AffixProps): React.ReactElement | null;
package/affix/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { RefExtra } from '@laser-ui/hooks/useRefExtra';
3
2
  export {};
4
3
  export interface AffixRef {
package/alert/Alert.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { AlertProps } from './types';
3
2
  export declare function Alert(props: AlertProps): React.ReactElement | null;
package/alert/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { BaseProps } from '../types';
4
3
  export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { AnchorItem, AnchorProps } from './types';
3
2
  import { DOT_INDICATOR, LINE_INDICATOR } from './vars';
4
3
  export declare const Anchor: {
package/anchor/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES, DOT_INDICATOR, LINE_INDICATOR } from './vars';
3
2
  import type { BaseProps } from '../types';
4
3
  import type { RefExtra } from '@laser-ui/hooks/useRefExtra';
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { AvatarProps } from './types';
3
2
  export declare function Avatar(props: AvatarProps): React.ReactElement | null;
package/avatar/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { BaseProps } from '../types';
4
3
  export {};
package/badge/Badge.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { BadgeProps } from './types';
3
2
  import { BadgeText } from './BadgeText';
4
3
  export declare const Badge: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Styled } from '../../hooks/useStyled';
3
2
  import type { CLASSES } from '../vars';
4
3
  interface BadgeNumberProps {
package/badge/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { BaseProps } from '../types';
4
3
  export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export {};
3
2
  export interface BaseInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
4
3
  ref?: React.Ref<HTMLInputElement>;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { BreadcrumbItem, BreadcrumbProps } from './types';
3
2
  export declare function Breadcrumb<ID extends React.Key, T extends BreadcrumbItem<ID>>(props: BreadcrumbProps<ID, T>): React.ReactElement | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { BaseProps } from '../types';
4
3
  export {};
package/button/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { BaseProps, Size } from '../types';
4
3
  export {};
package/card/Card.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CardProps } from './types';
3
2
  import { CardAction } from './CardAction';
4
3
  import { CardActions } from './CardActions';
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { CardActionProps } from './types';
3
2
  export declare function CardAction(props: CardActionProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { CardActionsProps } from './types';
3
2
  export declare function CardActions(props: CardActionsProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { CardContentProps } from './types';
3
2
  export declare function CardContent(props: CardContentProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { CardHeaderProps } from './types';
3
2
  export declare function CardHeader(props: CardHeaderProps): React.ReactElement | null;
package/card/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { BaseProps } from '../types';
4
3
  export {};
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { CascaderItem, CascaderProps } from './types';
3
2
  export declare function Cascader<V extends React.Key, T extends CascaderItem<V>>(props: CascaderProps<V, T>): React.ReactElement | null;
@@ -6,7 +6,7 @@ import CancelFilled from '@material-design-icons/svg/filled/cancel.svg?react';
6
6
  import CloseOutlined from '@material-design-icons/svg/outlined/close.svg?react';
7
7
  import KeyboardArrowDownOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_down.svg?react';
8
8
  import SearchOutlined from '@material-design-icons/svg/outlined/search.svg?react';
9
- import { isNull, isUndefined } from 'lodash';
9
+ import { isNull } from 'lodash';
10
10
  import { useId, useImperativeHandle, useMemo, useRef, useState } from 'react';
11
11
  import { CascaderPanel } from './internal/CascaderPanel';
12
12
  import { CascaderSearchPanel } from './internal/CascaderSearchPanel';
@@ -113,10 +113,8 @@ export function Cascader(props) {
113
113
  if (!hasSearch) {
114
114
  return [];
115
115
  }
116
- const filterFn = isUndefined(customSearch === null || customSearch === void 0 ? void 0 : customSearch.filter)
117
- ? (item) => item.label.includes(searchValue)
118
- : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
119
- (item) => customSearch.filter(searchValue, item);
116
+ const customFilterFn = customSearch && customSearch.filter ? customSearch.filter : undefined;
117
+ const filterFn = customFilterFn ? (item) => customFilterFn(searchValue, item) : (item) => item.label.includes(searchValue);
120
118
  const sortFn = customSearch === null || customSearch === void 0 ? void 0 : customSearch.sort;
121
119
  const searchList = [];
122
120
  const reduceNodes = (nodes) => {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Styled } from '../../hooks/useStyled';
3
2
  import type { AbstractTreeNode } from '../../tree/node/abstract-node';
4
3
  import type { CascaderItem } from '../types';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CascaderSearchPanelItem } from './types';
3
2
  import type { Styled } from '../../hooks/useStyled';
4
3
  import type { CascaderItem } from '../types';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { SelectItem } from '../../select/types';
3
2
  import type { AbstractTreeNode } from '../../tree/node/abstract-node';
4
3
  import type { TreeNode } from '../../tree/node/types';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { FormControlProvider } from '../form/types';
4
3
  import type { BaseProps, Size } from '../types';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CheckboxProps } from './types';
3
2
  import { CheckboxGroup } from './CheckboxGroup';
4
3
  export declare const Checkbox: {
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { CheckboxGroupItem, CheckboxGroupProps } from './types';
3
2
  export declare function CheckboxGroup<V extends React.Key, T extends CheckboxGroupItem<V>>(props: CheckboxGroupProps<V, T>): React.ReactElement | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { FormControlProvider } from '../form/types';
4
3
  import type { BaseProps } from '../types';
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare function CircularProgress(props: React.SVGProps<SVGSVGElement>): React.ReactElement | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ComposeProps } from './types';
3
2
  import { ComposeItem } from './ComposeItem';
4
3
  export declare const Compose: {
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { ComposeItemProps } from './types';
3
2
  export declare function ComposeItem(props: ComposeItemProps): React.ReactElement | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { BaseProps, Size } from '../types';
4
3
  export {};
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { ConfigProviderProps } from './types';
3
2
  export declare function ConfigProvider(props: ConfigProviderProps): React.ReactElement | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { LContextIn } from '../context';
3
2
  export {};
4
3
  export interface ConfigProviderProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ComponentProps } from './props';
3
2
  import type { Size } from '../types';
4
3
  import type { RefExtra } from '@laser-ui/hooks/useRefExtra';
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { DatePickerProps } from './types';
3
2
  export declare function DatePicker(props: DatePickerProps): React.ReactElement | null;
@@ -386,10 +386,14 @@ export function DatePicker(props) {
386
386
  return () => {
387
387
  timePickerPanelRef.current = null;
388
388
  };
389
- }, styled: styled, time: dataRef.current.latestFocused === 'start' ? valueLeft : valueRight, format: format, config: showTime && !isBoolean(showTime) && showTime.config
390
- ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
391
- (...args) => showTime.config(...args, dataRef.current.latestFocused, [valueLeft, valueRight])
392
- : undefined, inDatePicker: true, onTimeChange: (time) => {
389
+ }, styled: styled, time: dataRef.current.latestFocused === 'start' ? valueLeft : valueRight, format: format, config: (() => {
390
+ if (showTime && !isBoolean(showTime)) {
391
+ const fn = showTime.config;
392
+ if (fn) {
393
+ return (...args) => fn(...args, dataRef.current.latestFocused, [valueLeft, valueRight]);
394
+ }
395
+ }
396
+ })(), inDatePicker: true, onTimeChange: (time) => {
393
397
  changeValue(time);
394
398
  } })), _jsx("div", Object.assign({}, styled('date-picker__footer'), { children: _jsx(Button, { pattern: "link", onClick: () => {
395
399
  const now = new Date();
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Styled } from '../../hooks/useStyled';
3
2
  import type { CLASSES } from '../vars';
4
3
  interface DatePickerPanelProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { FormControlProvider } from '../form/types';
4
3
  import type { TimePickerProps } from '../time-picker';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare class DialogInstance<P extends object> {
3
2
  key: string | number;
4
3
  private type;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { DrawerProps } from './types';
3
2
  import { DrawerFooter } from './DrawerFooter';
4
3
  import { DrawerHeader } from './DrawerHeader';
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { DrawerFooterProps } from './types';
3
2
  export declare function DrawerFooter(props: DrawerFooterProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { DrawerHeaderProps } from './types';
3
2
  export declare function DrawerHeader(props: DrawerHeaderProps): React.ReactElement | null;
package/drawer/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { ButtonProps } from '../button';
4
3
  import type { BaseProps } from '../types';
package/drawer/vars.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Offsets } from './types';
3
2
  export declare const CLASSES: {
4
3
  drawer: string;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { DropdownItem, DropdownProps } from './types';
3
2
  export declare function Dropdown<ID extends React.Key, T extends DropdownItem<ID>>(props: DropdownProps<ID, T>): React.ReactElement | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Styled } from '../../hooks/useStyled';
3
2
  import type { DropdownItem } from '../types';
4
3
  import type { CLASSES } from '../vars';
@@ -147,12 +147,12 @@ export function DropdownList(props) {
147
147
  })(),
148
148
  },
149
149
  }), { role: "group", "aria-labelledby": id, children: childrenNode }))] })) : (_jsx(DropdownSub, { ref: (instance) => {
150
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
151
- const fn = instance;
152
- updateSubPosition.current.set(itemId, fn);
153
- return () => {
154
- updateSubPosition.current.delete(itemId);
155
- };
150
+ if (instance) {
151
+ updateSubPosition.current.set(itemId, instance);
152
+ return () => {
153
+ updateSubPosition.current.delete(itemId);
154
+ };
155
+ }
156
156
  }, namespace: namespace, styled: styled, id: id, icon: itemIcon, theme: itemTheme, list: _jsx(DropdownList, { namespace: namespace, styled: styled, ulProps: { 'aria-labelledby': id }, list: (children !== null && children !== void 0 ? children : []), ancestryOfSub: currentAncestryOfSub, virtual: virtual, focusVisible: focusVisible, focusId: focusId, popupIds: popupIds, updateSubPosition: updateSubPosition, trigger: trigger, zIndex: zIndex, handleKeyDown: handleKeyDown, getItemId: getItemId, onClick: onClick, onFocusIdsChange: onFocusIdsChange, onPopupIdsChange: onPopupIdsChange, addPopupId: addPopupId, removePopupId: removePopupId, onVisibleChange: onVisibleChange }), popupState: popupState === null || popupState === void 0 ? void 0 : popupState.visible, trigger: trigger, focus: focusVisible && isFocus, disabled: itemDisabled, zIndex: isUndefined(zIndex)
157
157
  ? zIndex
158
158
  : isNumber(zIndex)
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Styled } from '../../hooks/useStyled';
3
2
  import type { CLASSES } from '../vars';
4
3
  interface DropdownSubProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { BaseProps, VerticalSidePlacement } from '../types';
4
3
  export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { DropdownItem } from './types';
3
2
  export declare function checkEnableItem<ID extends React.Key, T extends DropdownItem<ID>>(item: T): boolean;
4
3
  export declare function getSameLevelEnableItems<ID extends React.Key, T extends DropdownItem<ID>>(arr: T[]): T[];
package/empty/Empty.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { EmptyProps } from './types';
3
2
  import { SIMPLE_IMG } from './vars';
4
3
  export declare const Empty: {
package/empty/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES, SIMPLE_IMG } from './vars';
3
2
  import type { BaseProps } from '../types';
4
3
  export {};
package/fab/Fab.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { FabProps } from './types';
3
2
  import { FabBacktop } from './FabBacktop';
4
3
  import { FabButton } from './FabButton';
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { FabBacktopProps } from './types';
3
2
  export declare function FabBacktop(props: FabBacktopProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { FabButtonProps } from './types';
3
2
  export declare function FabButton(props: FabButtonProps): React.ReactElement | null;
package/fab/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { BUTTON_CLASSES, CLASSES } from './vars';
3
2
  import type { BaseProps } from '../types';
4
3
  import type { RefExtra } from '@laser-ui/hooks/useRefExtra';
package/fab/vars.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const CLASSES: {
3
2
  fab: string;
4
3
  fab__actions: string;
package/form/Form.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { FormProps } from './types';
3
2
  import { FormItem } from './FormItem';
4
3
  export declare const Form: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { FormErrors, FormItemProps } from './types';
3
2
  export declare function FormItem<T extends {
4
3
  [index: string]: FormErrors;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Styled } from '../../hooks/useStyled';
3
2
  import type { CLASSES } from '../vars';
4
3
  interface FormErrorProps {
package/form/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { AbstractControl } from './model/abstract-control';
3
2
  import type { CLASSES } from './vars';
4
3
  import type { BaseProps, Size } from '../types';
package/form/vars.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { FormGroup } from './model/form-group';
3
2
  import type { FormContextData } from './types';
4
3
  export declare const CLASSES: {
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare function useContainerScrolling(target: React.RefObject<HTMLElement | null>, callback?: () => void, disabled?: boolean): void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare function useFocusVisible(isValidCode: (code: string) => boolean): [
3
2
  boolean,
4
3
  {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare function useLayout(): {
3
2
  pageScrollRef: import("react").RefObject<HTMLElement | null>;
4
3
  contentResizeRef: import("react").RefObject<HTMLElement | null>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { DraftFunction } from '@laser-ui/hooks/useImmer';
3
2
  interface PopupId<ID> {
4
3
  id: ID;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type Styled<C extends {
3
2
  [index: string]: string;
4
3
  }> = (...args: (keyof C | {
@@ -5,7 +5,6 @@ export function useStyled(classes, styleProvider, styleOverrides) {
5
5
  const context = use(LContext);
6
6
  const classRoot = {};
7
7
  Object.keys(styleProvider).forEach((key) => {
8
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9
8
  classRoot[key] = isUndefined(styleProvider[key]) ? `${context.namespace}-${key}` : styleProvider[key];
10
9
  });
11
10
  const prevClassRoot = useRef(classRoot);
@@ -49,7 +48,6 @@ export function useStyled(classes, styleProvider, styleOverrides) {
49
48
  const handleKey = (classKey) => {
50
49
  let remove = false;
51
50
  if (styleOverrides && styleOverrides[classKey]) {
52
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
53
51
  const styleOverride = styleOverrides[classKey];
54
52
  if (styleOverride.remove) {
55
53
  remove = true;
@@ -6,8 +6,11 @@ export function useZIndex(visible) {
6
6
  const [zIndex, setZIndex] = useState(0);
7
7
  useIsomorphicLayoutEffect(() => {
8
8
  if (visible) {
9
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10
- const zIndex = Array.from(ZINDEX).at(-1)[1] + 1;
9
+ let zIndex = 1;
10
+ const end = Array.from(ZINDEX).at(-1);
11
+ if (end) {
12
+ zIndex = end[1] + 1;
13
+ }
11
14
  ZINDEX.set(id, zIndex);
12
15
  setZIndex(zIndex);
13
16
  return () => {
package/icon/Icon.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { IconProps } from './types';
3
2
  export declare function Icon(props: IconProps): React.ReactElement | null;
package/icon/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { BaseProps } from '../types';
4
3
  export {};
package/image/Image.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ImageProps } from './types';
3
2
  import { ImageAction } from './ImageAction';
4
3
  import { ImageLoader } from './ImageLoader';
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { ImageActionProps } from './types';
3
2
  export declare function ImageAction(props: ImageActionProps): React.ReactElement | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ImageLoaderProps } from './types';
3
2
  export declare const ImageLoader: {
4
3
  (props: ImageLoaderProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { ImagePreviewProps } from './types';
3
2
  export declare function ImagePreview(props: ImagePreviewProps): React.ReactElement | null;
package/image/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES, PREVIEW_CLASSES } from './vars';
3
2
  import type { BaseProps } from '../types';
4
3
  export {};
package/input/Input.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { InputProps } from './types';
3
2
  import { InputNumber } from './InputNumber';
4
3
  export declare const Input: {
package/input/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { FormControlProvider } from '../form/types';
4
3
  import type { BaseProps, Size } from '../types';
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { LazyLoadingProps } from './types';
3
2
  export declare function LazyLoading(props: LazyLoadingProps): React.ReactNode;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export {};
3
2
  export interface LazyLoadingProps {
4
3
  children?: React.ReactNode;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { PopupProps } from './types';
3
2
  export declare function Popup(props: PopupProps): React.ReactElement | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export {};
3
2
  export interface PopupProps {
4
3
  children: (props: {