@laser-ui/components 2.3.4 → 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 (215) hide show
  1. package/CHANGELOG.md +12 -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 +5 -9
  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/Checkbox.js +4 -1
  33. package/checkbox/CheckboxGroup.d.ts +0 -1
  34. package/checkbox/types.d.ts +0 -1
  35. package/circular-progress/CircularProgress.d.ts +0 -1
  36. package/compose/Compose.d.ts +0 -1
  37. package/compose/ComposeItem.d.ts +0 -1
  38. package/compose/types.d.ts +0 -1
  39. package/config-provider/ConfigProvider.d.ts +0 -1
  40. package/config-provider/types.d.ts +0 -1
  41. package/context/index.d.ts +0 -1
  42. package/date-picker/DatePicker.d.ts +0 -1
  43. package/date-picker/DatePicker.js +13 -5
  44. package/date-picker/internal/DatePickerPanel.d.ts +0 -1
  45. package/date-picker/types.d.ts +0 -1
  46. package/dialog-service.d.ts +0 -1
  47. package/drawer/Drawer.d.ts +0 -1
  48. package/drawer/DrawerFooter.d.ts +0 -1
  49. package/drawer/DrawerHeader.d.ts +0 -1
  50. package/drawer/types.d.ts +0 -1
  51. package/drawer/vars.d.ts +0 -1
  52. package/dropdown/Dropdown.d.ts +0 -1
  53. package/dropdown/internal/DropdownList.d.ts +0 -1
  54. package/dropdown/internal/DropdownList.js +6 -6
  55. package/dropdown/internal/DropdownSub.d.ts +0 -1
  56. package/dropdown/types.d.ts +0 -1
  57. package/dropdown/utils.d.ts +0 -1
  58. package/empty/Empty.d.ts +0 -1
  59. package/empty/types.d.ts +0 -1
  60. package/fab/Fab.d.ts +0 -1
  61. package/fab/FabBacktop.d.ts +0 -1
  62. package/fab/FabButton.d.ts +0 -1
  63. package/fab/types.d.ts +0 -1
  64. package/fab/vars.d.ts +0 -1
  65. package/form/Form.d.ts +0 -1
  66. package/form/FormItem.d.ts +0 -1
  67. package/form/internal/FormError.d.ts +0 -1
  68. package/form/types.d.ts +0 -1
  69. package/form/vars.d.ts +0 -1
  70. package/hooks/useContainerScrolling.d.ts +0 -1
  71. package/hooks/useFocusVisible.d.ts +0 -1
  72. package/hooks/useLayout.d.ts +0 -1
  73. package/hooks/useNestedPopup.d.ts +0 -1
  74. package/hooks/useStyled.d.ts +0 -1
  75. package/hooks/useStyled.js +0 -2
  76. package/hooks/useZIndex.js +5 -2
  77. package/icon/Icon.d.ts +0 -1
  78. package/icon/types.d.ts +0 -1
  79. package/image/Image.d.ts +0 -1
  80. package/image/ImageAction.d.ts +0 -1
  81. package/image/ImageLoader.d.ts +0 -1
  82. package/image/ImagePreview.d.ts +0 -1
  83. package/image/types.d.ts +0 -1
  84. package/input/Input.d.ts +0 -1
  85. package/input/Input.js +4 -1
  86. package/input/InputNumber.js +4 -1
  87. package/input/types.d.ts +0 -1
  88. package/internal/lazy-loading/LazyLoading.d.ts +0 -1
  89. package/internal/lazy-loading/types.d.ts +0 -1
  90. package/internal/popup/Popup.d.ts +0 -1
  91. package/internal/popup/types.d.ts +0 -1
  92. package/internal/portal/Portal.d.ts +0 -1
  93. package/internal/portal/types.d.ts +0 -1
  94. package/mask/Mask.d.ts +0 -1
  95. package/mask/types.d.ts +0 -1
  96. package/menu/Menu.d.ts +0 -1
  97. package/menu/Menu.js +6 -6
  98. package/menu/internal/MenuGroup.d.ts +0 -1
  99. package/menu/internal/MenuItem.d.ts +0 -1
  100. package/menu/internal/MenuSub.d.ts +0 -1
  101. package/menu/types.d.ts +0 -1
  102. package/menu/utils.d.ts +0 -1
  103. package/modal/Modal.d.ts +0 -1
  104. package/modal/ModalAlert.d.ts +0 -1
  105. package/modal/ModalFooter.d.ts +0 -1
  106. package/modal/ModalHeader.d.ts +0 -1
  107. package/modal/types.d.ts +0 -1
  108. package/modal/vars.d.ts +0 -1
  109. package/notification/Notification.d.ts +0 -1
  110. package/notification/types.d.ts +0 -1
  111. package/package.json +2 -2
  112. package/pagination/Pagination.d.ts +0 -1
  113. package/pagination/types.d.ts +0 -1
  114. package/pagination/utils.d.ts +1 -2
  115. package/popover/Popover.d.ts +0 -1
  116. package/popover/PopoverFooter.d.ts +0 -1
  117. package/popover/PopoverHeader.d.ts +0 -1
  118. package/popover/types.d.ts +0 -1
  119. package/popover/vars.d.ts +0 -1
  120. package/progress/Progress.d.ts +0 -1
  121. package/progress/types.d.ts +0 -1
  122. package/radio/Radio.d.ts +0 -1
  123. package/radio/Radio.js +4 -1
  124. package/radio/RadioGroup.d.ts +0 -1
  125. package/radio/types.d.ts +0 -1
  126. package/radio/vars.d.ts +1 -2
  127. package/rating/Rating.d.ts +0 -1
  128. package/rating/internal/RatingStar.d.ts +0 -1
  129. package/rating/types.d.ts +0 -1
  130. package/root/Dialogs.d.ts +0 -1
  131. package/root/Root.d.ts +0 -1
  132. package/root/types.d.ts +0 -1
  133. package/root/vars.d.ts +0 -1
  134. package/select/Select.d.ts +0 -1
  135. package/select/Select.js +4 -8
  136. package/select/types.d.ts +0 -1
  137. package/separator/Separator.d.ts +0 -1
  138. package/separator/types.d.ts +0 -1
  139. package/skeleton/Skeleton.d.ts +0 -1
  140. package/skeleton/types.d.ts +0 -1
  141. package/slider/Slider.d.ts +0 -1
  142. package/slider/Slider.js +45 -39
  143. package/slider/types.d.ts +0 -1
  144. package/slides/Slides.d.ts +0 -1
  145. package/slides/Slides.js +5 -5
  146. package/slides/types.d.ts +0 -1
  147. package/spinner/Spinner.d.ts +0 -1
  148. package/spinner/types.d.ts +0 -1
  149. package/stepper/Stepper.d.ts +0 -1
  150. package/stepper/types.d.ts +0 -1
  151. package/switch/Switch.js +4 -1
  152. package/switch/types.d.ts +0 -1
  153. package/table/Table.d.ts +0 -1
  154. package/table/TableEmpty.d.ts +0 -1
  155. package/table/TableExpand.d.ts +0 -1
  156. package/table/TableFilter.d.ts +0 -1
  157. package/table/TableTd.d.ts +0 -1
  158. package/table/TableTh.d.ts +0 -1
  159. package/table/TableThAction.d.ts +0 -1
  160. package/table/internal/TableCell.d.ts +0 -1
  161. package/table/types.d.ts +0 -1
  162. package/table/vars.d.ts +0 -1
  163. package/tabs/Tabs.d.ts +0 -1
  164. package/tabs/types.d.ts +0 -1
  165. package/tag/Tag.d.ts +0 -1
  166. package/tag/types.d.ts +0 -1
  167. package/textarea/Textarea.d.ts +0 -1
  168. package/textarea/types.d.ts +0 -1
  169. package/time-picker/TimePicker.d.ts +0 -1
  170. package/time-picker/TimePicker.js +5 -1
  171. package/time-picker/internal/TimePickerPanel.d.ts +0 -1
  172. package/time-picker/types.d.ts +0 -1
  173. package/timeline/Timeline.d.ts +0 -1
  174. package/timeline/types.d.ts +0 -1
  175. package/toast/Toast.d.ts +0 -1
  176. package/toast/types.d.ts +0 -1
  177. package/tooltip/Tooltip.d.ts +0 -1
  178. package/tooltip/types.d.ts +0 -1
  179. package/transfer/Transfer.d.ts +0 -1
  180. package/transfer/Transfer.js +4 -5
  181. package/transfer/internal/TransferPanel.d.ts +0 -1
  182. package/transfer/types.d.ts +0 -1
  183. package/transition/CollapseTransition.d.ts +0 -1
  184. package/transition/Transition.d.ts +0 -1
  185. package/transition/types.d.ts +0 -1
  186. package/tree/Tree.d.ts +0 -1
  187. package/tree/internal/TreePanel.d.ts +0 -1
  188. package/tree/node/abstract-node.d.ts +0 -1
  189. package/tree/node/multiple-node.d.ts +0 -1
  190. package/tree/node/single-node.d.ts +0 -1
  191. package/tree/types.d.ts +0 -1
  192. package/tree/utils.d.ts +0 -1
  193. package/tree-select/TreeSelect.d.ts +0 -1
  194. package/tree-select/TreeSelect.js +4 -8
  195. package/tree-select/internal/TreeSelectSearchPanel.d.ts +0 -1
  196. package/tree-select/internal/types.d.ts +0 -1
  197. package/tree-select/types.d.ts +0 -1
  198. package/types.d.ts +0 -1
  199. package/upload/Upload.d.ts +0 -1
  200. package/upload/Upload.js +4 -3
  201. package/upload/UploadAction.d.ts +0 -1
  202. package/upload/UploadButton.d.ts +0 -1
  203. package/upload/UploadList.d.ts +0 -1
  204. package/upload/UploadPicture.d.ts +0 -1
  205. package/upload/UploadPictureList.d.ts +0 -1
  206. package/upload/UploadPreviewAction.d.ts +0 -1
  207. package/upload/hooks.d.ts +0 -1
  208. package/upload/types.d.ts +0 -1
  209. package/upload/vars.d.ts +5 -6
  210. package/utils/handleModalKeyDown.d.ts +0 -1
  211. package/utils/mergeCS.d.ts +0 -1
  212. package/virtual-scroll/VirtualScroll.d.ts +0 -1
  213. package/virtual-scroll/types.d.ts +0 -1
  214. package/wave/Wave.d.ts +0 -1
  215. package/wave/types.d.ts +0 -1
package/switch/Switch.js CHANGED
@@ -26,7 +26,10 @@ export function Switch(props) {
26
26
  style: { opacity: checked ? 1 : 0 },
27
27
  }), { children: stateContent[0] }))), checkNodeExist(stateContent[1]) && (_jsx("div", Object.assign({}, mergeCS(styled('switch__state-content'), {
28
28
  style: { opacity: checked ? 0 : 1 },
29
- }), { children: stateContent[1] })))] })), _jsx("input", Object.assign({}, inputProps, styled('switch__input'), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { type: "checkbox", disabled: disabled, role: "switch", "aria-checked": checked, onChange: () => {
29
+ }), { children: stateContent[1] })))] })), _jsx("input", Object.assign({}, inputProps, mergeCS(styled('switch__input'), {
30
+ className: inputProps === null || inputProps === void 0 ? void 0 : inputProps.className,
31
+ style: inputProps === null || inputProps === void 0 ? void 0 : inputProps.style,
32
+ }), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { type: "checkbox", disabled: disabled, role: "switch", "aria-checked": checked, onChange: () => {
30
33
  changeChecked((draft) => !draft);
31
34
  } })), _jsx(Transition, { enter: checked, name: `${namespace}-switch`, duration: TTANSITION_DURING, onSkipEnter: (el) => {
32
35
  if (el) {
package/switch/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';
package/table/Table.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { TableProps } from './types';
3
2
  import { TableEmpty } from './TableEmpty';
4
3
  import { TableExpand } from './TableExpand';
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { TableEmptyProps } from './types';
3
2
  export declare function TableEmpty(props: TableEmptyProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { TableExpandProps } from './types';
3
2
  export declare function TableExpand(props: TableExpandProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { TableFilterProps } from './types';
3
2
  export declare function TableFilter(props: TableFilterProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { TableTdProps } from './types';
3
2
  export declare function TableTd(props: TableTdProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { TableThProps } from './types';
3
2
  export declare function TableTh(props: TableThProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { TableThActionProps } from './types';
3
2
  export declare function TableThAction(props: TableThActionProps): React.ReactElement | null;
@@ -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 TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
package/table/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { BaseProps, PopupPlacement } from '../types';
4
3
  export {};
package/table/vars.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { TableContextData } from './types';
3
2
  export declare const CLASSES: {
4
3
  table: string;
package/tabs/Tabs.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { TabsItem, TabsProps } from './types';
3
2
  export declare function Tabs<ID extends React.Key, T extends TabsItem<ID>>(props: TabsProps<ID, T>): React.ReactElement | null;
package/tabs/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/tag/Tag.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { TagProps } from './types';
3
2
  export declare function Tag(props: TagProps): React.ReactElement | null;
package/tag/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 {};
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { TextareaProps } from './types';
3
2
  export declare function Textarea(props: TextareaProps): 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, Size } from '../types';
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { TimePickerProps } from './types';
3
2
  export declare function TimePicker(props: TimePickerProps): React.ReactElement | null;
@@ -179,10 +179,14 @@ export function TimePicker(props) {
179
179
  };
180
180
  const clearable = clearableProp && !isNull(_value) && !visible && !disabled;
181
181
  const inputNode = (isLeft) => {
182
+ var _a, _b;
182
183
  const index = isLeft ? 0 : 1;
183
184
  const value = isLeft ? valueLeft : valueRight;
184
185
  const inputRef = isLeft ? inputLeftRef : inputRightRef;
185
- return (_jsx(BaseInput, Object.assign({}, inputProps === null || inputProps === void 0 ? void 0 : inputProps[index], styled('time-picker__input'), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: (instance) => {
186
+ return (_jsx(BaseInput, Object.assign({}, inputProps === null || inputProps === void 0 ? void 0 : inputProps[index], mergeCS(styled('time-picker__input'), {
187
+ className: (_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps[index]) === null || _a === void 0 ? void 0 : _a.className,
188
+ style: (_b = inputProps === null || inputProps === void 0 ? void 0 : inputProps[index]) === null || _b === void 0 ? void 0 : _b.style,
189
+ }), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: (instance) => {
186
190
  var _a;
187
191
  inputRef.current = instance;
188
192
  const ret = setRef((_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps[index]) === null || _a === void 0 ? void 0 : _a.ref, instance);
@@ -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 TimePickerPanelProps {
@@ -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 { TimelineItem, TimelineProps } from './types';
3
2
  export declare function Timeline<T extends TimelineItem>(props: TimelineProps<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/toast/Toast.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { ToastProps } from './types';
3
2
  export declare function Toast(props: ToastProps): React.ReactElement | null;
package/toast/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 { TooltipProps } from './types';
3
2
  export declare function Tooltip(props: TooltipProps): React.ReactElement | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CLASSES } from './vars';
3
2
  import type { BaseProps, PopupPlacement } from '../types';
4
3
  export {};
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { TransferItem, TransferProps } from './types';
3
2
  export declare function Transfer<V extends React.Key, T extends TransferItem<V>>(props: TransferProps<V, T>): React.ReactElement | null;
@@ -2,7 +2,6 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import KeyboardArrowLeftOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_left.svg?react';
4
4
  import KeyboardArrowRightOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg?react';
5
- import { isUndefined } from 'lodash';
6
5
  import { useMemo } from 'react';
7
6
  import { TransferPanel } from './internal/TransferPanel';
8
7
  import { CLASSES, IS_SELECTED, NO_MATCH } from './vars';
@@ -36,10 +35,10 @@ export function Transfer(props) {
36
35
  const empty = [true, true];
37
36
  const allSelected = [true, true];
38
37
  const hasSelected = [false, false];
39
- const filterFn = isUndefined(customSearch === null || customSearch === void 0 ? void 0 : customSearch.filter)
40
- ? (item, searchValue) => item.label.includes(searchValue)
41
- : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
42
- (item, searchValue) => customSearch.filter(searchValue, item);
38
+ const customFilterFn = customSearch && customSearch.filter ? customSearch.filter : undefined;
39
+ const filterFn = customFilterFn
40
+ ? (item, searchValue) => customFilterFn(searchValue, item)
41
+ : (item, searchValue) => item.label.includes(searchValue);
43
42
  const sortFn = customSearch === null || customSearch === void 0 ? void 0 : customSearch.sort;
44
43
  const handleItem = (item, index, noMatch) => {
45
44
  const newItem = Object.assign({ [IS_SELECTED]: false, [NO_MATCH]: noMatch }, item);
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Styled } from '../../hooks/useStyled';
3
2
  import type { TransferItem } from '../types';
4
3
  import { type CLASSES } from '../vars';
@@ -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,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { CollapseTransitionProps } from './types';
3
2
  export declare function CollapseTransition(props: CollapseTransitionProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { TransitionProps } from './types';
3
2
  export declare function Transition(props: TransitionProps): React.ReactElement | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export {};
3
2
  export interface TransitionProps {
4
3
  children: (ref: React.RefCallback<HTMLElement | null>, leaved: boolean) => React.ReactElement | null;
package/tree/Tree.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { TreeItem, TreeProps } from './types';
3
2
  export declare function Tree<V extends React.Key, T extends TreeItem<V>>(props: TreeProps<V, T>): React.ReactElement | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Styled } from '../../hooks/useStyled';
3
2
  import type { AbstractTreeNode } from '../node/abstract-node';
4
3
  import type { TreeItem } from '../types';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { TreeNode, TreeNodeStatus } from './types';
3
2
  export declare abstract class AbstractTreeNode<ID extends React.Key, T extends TreeNode> {
4
3
  origin: T;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { TreeNode, TreeNodeStatus } from './types';
3
2
  import { AbstractTreeNode } from './abstract-node';
4
3
  export declare class MultipleTreeNode<ID extends React.Key, T extends TreeNode> extends AbstractTreeNode<ID, T> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { TreeNode, TreeNodeStatus } from './types';
3
2
  import { AbstractTreeNode } from './abstract-node';
4
3
  export declare class SingleTreeNode<ID extends React.Key, T extends TreeNode> extends AbstractTreeNode<ID, T> {
package/tree/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 } from '../types';
package/tree/utils.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { AbstractTreeNode } from './node/abstract-node';
3
2
  import type { TreeNode } from './node/types';
4
3
  export declare function getTreeNodeLabel<V extends React.Key, T extends TreeNode & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { TreeSelectProps } from './types';
3
2
  import type { TreeItem } from '../tree/types';
4
3
  export declare function TreeSelect<V extends React.Key, T extends TreeItem<V>>(props: TreeSelectProps<V, T>): React.ReactElement | null;
@@ -121,10 +121,8 @@ export function TreeSelect(props) {
121
121
  if (!hasSearch) {
122
122
  return [];
123
123
  }
124
- const filterFn = isUndefined(customSearch === null || customSearch === void 0 ? void 0 : customSearch.filter)
125
- ? (item) => item.label.includes(searchValue)
126
- : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
127
- (item) => customSearch.filter(searchValue, item);
124
+ const customFilterFn = customSearch && customSearch.filter ? customSearch.filter : undefined;
125
+ const filterFn = customFilterFn ? (item) => customFilterFn(searchValue, item) : (item) => item.label.includes(searchValue);
128
126
  const sortFn = customSearch === null || customSearch === void 0 ? void 0 : customSearch.sort;
129
127
  const searchList = [];
130
128
  const reduceNodes = (nodes) => {
@@ -301,10 +299,8 @@ export function TreeSelect(props) {
301
299
  changeVisible((draft) => (searchable ? true : !draft));
302
300
  }, children: [_jsxs("div", Object.assign({}, styled('tree-select__container'), { title: selectedLabel, children: [(() => {
303
301
  const nodeProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, inputProps), mergeCS(styled('tree-select__search'), {
304
- style: {
305
- opacity: inputable ? undefined : 0,
306
- zIndex: inputable ? undefined : -1,
307
- },
302
+ className: inputProps === null || inputProps === void 0 ? void 0 : inputProps.className,
303
+ style: Object.assign(Object.assign({}, inputProps === null || inputProps === void 0 ? void 0 : inputProps.style), { opacity: inputable ? undefined : 0, zIndex: inputable ? undefined : -1 }),
308
304
  })), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria), { ref: (instance) => {
309
305
  inputRef.current = instance;
310
306
  const ret = setRef(inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref, instance);
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { TreeSelectSearchPanelItem } from './types';
3
2
  import type { Styled } from '../../hooks/useStyled';
4
3
  import type { TreeItem } from '../../tree/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 { TreeItem } from '../tree/types';
package/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export {};
3
2
  export type Lang = 'en-US' | 'zh-CN';
4
3
  export type Size = 'small' | 'medium' | 'large';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { UploadProps } from './types';
3
2
  import { UploadAction } from './UploadAction';
4
3
  import { UploadButton } from './UploadButton';
package/upload/Upload.js CHANGED
@@ -94,13 +94,14 @@ export const Upload = (props) => {
94
94
  xhr.addEventListener('load', () => {
95
95
  update({ state: xhr.status >= 200 && xhr.status < 300 ? 'load' : 'error', percent: undefined });
96
96
  });
97
+ if (!request) {
98
+ throw new Error('`request` prop is required when upload file!');
99
+ }
97
100
  const { url, method = 'POST', responseType = 'json', header = {}, body = (file) => {
98
101
  const formData = new FormData();
99
102
  formData.append('file', file);
100
103
  return formData;
101
- }, custom,
102
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
103
- } = request;
104
+ }, custom, } = request;
104
105
  xhr.open(method, url);
105
106
  xhr.responseType = responseType;
106
107
  Object.entries(header).forEach((h) => {
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { UploadActionProps } from './types';
3
2
  export declare function UploadAction(props: UploadActionProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { UploadButtonProps } from './types';
3
2
  export declare function UploadButton(props: UploadButtonProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { UploadListProps } from './types';
3
2
  export declare function UploadList(props: UploadListProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { UploadPictureProps } from './types';
3
2
  export declare function UploadPicture(props: UploadPictureProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { UploadPictureListProps } from './types';
3
2
  export declare function UploadPictureList(props: UploadPictureListProps): React.ReactElement | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { UploadPreviewActionProps } from './types';
3
2
  export declare function UploadPreviewAction(props: UploadPreviewActionProps): React.ReactElement | null;
package/upload/hooks.d.ts CHANGED
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare function useNextTick(): import("react").RefObject<boolean>;
package/upload/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ACTION_CLASSES, BUTTON_CLASSES, CLASSES, LIST_CLASSES, PICTURE_CLASSES, PICTURE_LIST_CLASSES } from './vars';
3
2
  import type { FormControlProvider } from '../form/types';
4
3
  import type { BaseProps } from '../types';
package/upload/vars.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { UploadFile } from './types';
3
2
  export declare const CLASSES: {
4
3
  upload: string;
@@ -68,9 +67,9 @@ export declare const UploadContext: import("react").Context<{
68
67
  export declare const UploadActionContext: import("react").Context<{
69
68
  file: UploadFile;
70
69
  defaultActions?: {
71
- preview?: ((file: UploadFile) => void) | undefined;
72
- download?: ((file: UploadFile) => void) | undefined;
73
- } | undefined;
74
- light?: boolean | undefined;
75
- onRemove?: (() => void) | undefined;
70
+ preview?: (file: UploadFile) => void;
71
+ download?: (file: UploadFile) => void;
72
+ };
73
+ light?: boolean;
74
+ onRemove?: () => void;
76
75
  } | undefined>;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare function handleModalKeyDown(e: React.KeyboardEvent<HTMLDivElement>): void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare function mergeCS(target: {
3
2
  className: string;
4
3
  style: React.CSSProperties;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { VirtualScrollProps } from './types';
3
2
  export declare function VirtualScroll<T>(props: VirtualScrollProps<T>): React.ReactElement | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export {};
3
2
  export type VirtualScrollOptimization<T = any> = Pick<VirtualScrollProps<T>, 'list' | 'itemKey' | 'itemSize' | 'itemEmptySize' | 'itemNested' | 'itemFocusable' | 'itemExpand'>;
4
3
  export interface VirtualScrollRef<T> {
package/wave/Wave.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { WaveProps } from './types';
3
2
  export declare function Wave(props: WaveProps): React.ReactElement | null;
package/wave/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export {};
3
2
  export type WaveRef = () => void;
4
3
  export interface WaveProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {