@laser-ui/components 0.6.5 → 0.6.7

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
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
+ ## [0.6.7](https://github.com/laser-ui/laser-ui/compare/v0.6.6...v0.6.7) (2024-07-10)
6
+
7
+ ### Bug Fixes
8
+
9
+ - **components:** fix get window size ([5f20aa9](https://github.com/laser-ui/laser-ui/commit/5f20aa9b5c8fb4e0dd40c9516847461e18ab5b65))
10
+
11
+ ### Features
12
+
13
+ - **components:** table-filter support custom footer ([31faf0a](https://github.com/laser-ui/laser-ui/commit/31faf0a9488744d83c3e9f9276bfac225ea4514b))
14
+
15
+ ## [0.6.6](https://github.com/laser-ui/laser-ui/compare/v0.6.5...v0.6.6) (2024-06-14)
16
+
17
+ ### Features
18
+
19
+ - **components:** emit change after IME composition ends ([1f80404](https://github.com/laser-ui/laser-ui/commit/1f80404d037c74bd125ca0415c79f0542b6b4ce1))
20
+
5
21
  ## [0.6.5](https://github.com/laser-ui/laser-ui/compare/v0.6.4...v0.6.5) (2024-06-11)
6
22
 
7
23
  ### Bug Fixes
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { BaseInputProps } from './types';
3
+ export declare const BaseInput: import("react").ForwardRefExoticComponent<BaseInputProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,27 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { isString } from 'lodash';
4
+ import { forwardRef, useState } from 'react';
5
+ export const BaseInput = forwardRef((props, ref) => {
6
+ const { value, onValueChange } = props, restProps = __rest(props, ["value", "onValueChange"]);
7
+ const [composing, setComposing] = useState();
8
+ return (_jsx("input", Object.assign({}, restProps, { ref: ref, value: isString(composing) ? composing : value, onCompositionStart: (e) => {
9
+ var _a;
10
+ (_a = restProps.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
11
+ setComposing(e.currentTarget.value);
12
+ }, onCompositionEnd: (e) => {
13
+ var _a;
14
+ (_a = restProps.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
15
+ setComposing(undefined);
16
+ onValueChange(e.currentTarget.value);
17
+ }, onChange: (e) => {
18
+ var _a;
19
+ (_a = restProps.onChange) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
20
+ if (isString(composing)) {
21
+ setComposing(e.currentTarget.value);
22
+ }
23
+ else {
24
+ onValueChange(e.currentTarget.value);
25
+ }
26
+ } })));
27
+ });
@@ -0,0 +1,2 @@
1
+ export type { BaseInputProps } from './types';
2
+ export { BaseInput } from './BaseInput';
@@ -0,0 +1 @@
1
+ export { BaseInput } from './BaseInput';
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export {};
3
+ export interface BaseInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
4
+ onValueChange: (val: string) => void;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -11,6 +11,7 @@ import { createElement, forwardRef, useId, useImperativeHandle, useMemo, useRef,
11
11
  import { CascaderPanel } from './internal/CascaderPanel';
12
12
  import { CascaderSearchPanel } from './internal/CascaderSearchPanel';
13
13
  import { CLASSES } from './vars';
14
+ import { BaseInput } from '../base-input';
14
15
  import { Dropdown } from '../dropdown';
15
16
  import { useComponentProps, useControlled, useDesign, useFocusVisible, useJSS, useLayout, useListenGlobalScrolling, useMaxIndex, useNamespace, useScopedProps, useStyled, useTranslation, } from '../hooks';
16
17
  import { Icon } from '../icon';
@@ -217,7 +218,7 @@ function CascaderFC(props, ref) {
217
218
  const scrollCallback = useRef();
218
219
  const inputable = searchable && visible;
219
220
  const clearable = clearableProp && hasSelected && !visible && !loading && !disabled;
220
- const inputNode = focusVisibleWrapper(createElement(searchable ? 'input' : 'div', Object.assign(Object.assign(Object.assign(Object.assign({}, mergeCS(styled('cascader__search'), {
221
+ const inputNode = focusVisibleWrapper(createElement(searchable ? BaseInput : 'div', Object.assign(Object.assign(Object.assign(Object.assign({}, mergeCS(styled('cascader__search'), {
221
222
  style: {
222
223
  opacity: inputable ? undefined : 0,
223
224
  zIndex: inputable ? undefined : -1,
@@ -338,16 +339,15 @@ function CascaderFC(props, ref) {
338
339
  }
339
340
  }
340
341
  }
341
- }, onChange: (e) => {
342
- if (searchable) {
343
- changeSearchValue(e.currentTarget.value);
344
- }
345
342
  } }), searchable
346
343
  ? {
347
344
  type: 'text',
348
345
  value: searchValue,
349
346
  autoComplete: 'off',
350
347
  disabled,
348
+ onValueChange: (val) => {
349
+ changeSearchValue(val);
350
+ },
351
351
  }
352
352
  : {})));
353
353
  const [selectedNode, suffixNode, selectedLabel] = (() => {
@@ -9,6 +9,7 @@ import { isArray, isBoolean, isNull, isUndefined } from 'lodash';
9
9
  import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
10
10
  import { DatePickerPanel } from './internal/DatePickerPanel';
11
11
  import { CLASSES } from './vars';
12
+ import { BaseInput } from '../base-input';
12
13
  import { Button } from '../button';
13
14
  import dayjs from '../dayjs';
14
15
  import { useComponentProps, useControlled, useDesign, useJSS, useLayout, useListenGlobalScrolling, useMaxIndex, useNamespace, useScopedProps, useStyled, useTranslation, } from '../hooks';
@@ -203,11 +204,11 @@ export const DatePicker = forwardRef((props, ref) => {
203
204
  const index = isLeft ? 0 : 1;
204
205
  const value = isLeft ? valueLeft : valueRight;
205
206
  const render = inputRender === null || inputRender === void 0 ? void 0 : inputRender[index];
206
- const node = (_jsx("input", Object.assign({}, styled('date-picker__input'), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: isLeft ? combineInputLeftRef : combineInputRightRef, type: "text", autoComplete: "off", value: inputValue[index], size: 22, placeholder: isLeft ? placeholderLeft : placeholderRight, disabled: disabled, onChange: (e) => {
207
+ const node = (_jsx(BaseInput, Object.assign({}, styled('date-picker__input'), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: isLeft ? combineInputLeftRef : combineInputRightRef, type: "text", autoComplete: "off", value: inputValue[index], size: 22, placeholder: isLeft ? placeholderLeft : placeholderRight, disabled: disabled, onValueChange: (val) => {
207
208
  forceUpdate();
208
- dataRef.current.inputValue[index] = e.currentTarget.value;
209
- if (dayjs(e.currentTarget.value, format, true).isValid()) {
210
- const date = dayjs(e.currentTarget.value, format).toDate();
209
+ dataRef.current.inputValue[index] = val;
210
+ if (dayjs(val, format, true).isValid()) {
211
+ const date = dayjs(val, format).toDate();
211
212
  changeValue(date);
212
213
  updatePanel(date);
213
214
  }
package/input/Input.js CHANGED
@@ -8,6 +8,7 @@ import VisibilityOffOutlined from '@material-design-icons/svg/outlined/visibilit
8
8
  import { useRef } from 'react';
9
9
  import { InputNumber } from './InputNumber';
10
10
  import { CLASSES } from './vars';
11
+ import { BaseInput } from '../base-input';
11
12
  import { useComponentProps, useControlled, useDesign, useScopedProps, useStyled, useTranslation } from '../hooks';
12
13
  import { Icon } from '../icon';
13
14
  import { mergeCS } from '../utils';
@@ -26,8 +27,8 @@ export const Input = (props) => {
26
27
  }
27
28
  };
28
29
  const designProps = useDesign({ compose: { disabled }, form: formControl });
29
- const inputNode = (_jsx("input", Object.assign({}, styled('input__input'), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: combineInputRef, value: value, type: type === 'password' ? (password ? 'password' : 'text') : type, placeholder: placeholder, disabled: disabled, onChange: (e) => {
30
- changeValue(e.currentTarget.value);
30
+ const inputNode = (_jsx(BaseInput, Object.assign({}, styled('input__input'), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: combineInputRef, value: value, type: type === 'password' ? (password ? 'password' : 'text') : type, placeholder: placeholder, disabled: disabled, onValueChange: (val) => {
31
+ changeValue(val);
31
32
  } })));
32
33
  return (_jsxs("div", Object.assign({}, restProps, mergeCS(styled('input', `input--${size}`, {
33
34
  'input.is-disabled': disabled,
@@ -8,6 +8,7 @@ import KeyboardArrowUpOutlined from '@material-design-icons/svg/outlined/keyboar
8
8
  import { isNull, isUndefined } from 'lodash';
9
9
  import { useRef } from 'react';
10
10
  import { CLASSES } from './vars';
11
+ import { BaseInput } from '../base-input';
11
12
  import { useComponentProps, useControlled, useDesign, useScopedProps, useStyled, useTranslation } from '../hooks';
12
13
  import { Icon } from '../icon';
13
14
  import { mergeCS } from '../utils';
@@ -68,16 +69,16 @@ export function InputNumber(props) {
68
69
  }
69
70
  };
70
71
  const designProps = useDesign({ compose: { disabled }, form: formControl });
71
- const inputNode = (_jsx("input", Object.assign({}, styled('input__input'), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: combineInputRef, value: inputValue, max: max, min: min, step: step, type: "number", placeholder: placeholder, disabled: disabled, onChange: (e) => {
72
+ const inputNode = (_jsx(BaseInput, Object.assign({}, styled('input__input'), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: combineInputRef, value: inputValue, max: max, min: min, step: step, type: "number", placeholder: placeholder, disabled: disabled, onValueChange: (val) => {
72
73
  forceUpdate();
73
- dataRef.current.inputValue = e.currentTarget.value;
74
- if (e.currentTarget.value.length === 0) {
74
+ dataRef.current.inputValue = val;
75
+ if (val.length === 0) {
75
76
  changeValue(null);
76
77
  }
77
78
  else {
78
- const val = Number(e.currentTarget.value);
79
- if ((isUndefined(max) || val <= max) && (isUndefined(min) || val >= min) && (!integer || Number.isInteger(val))) {
80
- changeValue(val);
79
+ const num = Number(val);
80
+ if ((isUndefined(max) || num <= max) && (isUndefined(min) || num >= min) && (!integer || Number.isInteger(num))) {
81
+ changeValue(num);
81
82
  }
82
83
  }
83
84
  }, onFocus: () => {
@@ -89,17 +90,17 @@ export function InputNumber(props) {
89
90
  changeValue(null);
90
91
  }
91
92
  else {
92
- let val = Number(inputValue);
93
- if (!isUndefined(max) && val > max) {
94
- val = max;
93
+ let num = Number(inputValue);
94
+ if (!isUndefined(max) && num > max) {
95
+ num = max;
95
96
  }
96
- if (!isUndefined(min) && val < min) {
97
- val = min;
97
+ if (!isUndefined(min) && num < min) {
98
+ num = min;
98
99
  }
99
- if (integer && !Number.isInteger(val)) {
100
- val = Math.round(val);
100
+ if (integer && !Number.isInteger(num)) {
101
+ num = Math.round(num);
101
102
  }
102
- changeValue(val);
103
+ changeValue(num);
103
104
  }
104
105
  } })));
105
106
  return (_jsxs("div", Object.assign({}, restProps, mergeCS(styled('input', `input--${size}`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laser-ui/components",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "description": "React components.",
5
5
  "keywords": [
6
6
  "ui",
@@ -40,5 +40,5 @@
40
40
  "access": "public",
41
41
  "directory": "../../dist/libs/components"
42
42
  },
43
- "gitHead": "4a94e6ec5bcfa6f04633956dd74c71203bb2e00f"
43
+ "gitHead": "a9765f429b263e6f0183e2b37ba21697846ac014"
44
44
  }
package/root/Root.js CHANGED
@@ -1,39 +1,24 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEvent, useRefExtra } from '@laser-ui/hooks';
3
3
  import { isString, set } from 'lodash';
4
4
  import { useStore } from 'rcl-store';
5
- import { useEffect, useMemo, useRef } from 'react';
5
+ import { useEffect, useMemo } from 'react';
6
6
  import { ROOT_DATA, RootContext, Store } from './vars';
7
7
  import dayjs from '../dayjs';
8
- import { Portal } from '../internal/portal';
9
8
  import resources from '../resources.json';
10
- function WindowSize() {
11
- const windowSizeRef = useRef(null);
12
- useEffect(() => {
13
- if (windowSizeRef.current) {
14
- const observer = new ResizeObserver((entries) => {
15
- const entry = entries[0];
16
- ROOT_DATA.windowSize = { width: entry.contentRect.width, height: entry.contentRect.height };
17
- });
18
- observer.observe(windowSizeRef.current);
19
- return () => {
20
- observer.disconnect();
21
- };
22
- }
23
- });
24
- return (_jsx("div", { ref: windowSizeRef, style: {
25
- position: 'fixed',
26
- top: 0,
27
- right: 0,
28
- bottom: 0,
29
- left: 0,
30
- pointerEvents: 'none',
31
- } }));
32
- }
33
9
  export function Root(props) {
34
10
  const { context: contextProp, children } = props;
35
11
  const windowRef = useRefExtra(() => window);
36
12
  const [{ dialogs }] = useStore(Store, ['dialogs']);
13
+ useEffect(() => {
14
+ const handleResize = () => {
15
+ ROOT_DATA.windowSize = { width: window.innerWidth, height: window.innerHeight };
16
+ };
17
+ window.addEventListener('resize', handleResize);
18
+ return () => {
19
+ window.removeEventListener('resize', handleResize);
20
+ };
21
+ }, []);
37
22
  useEvent(windowRef, 'click', (e) => {
38
23
  // Check if click by keydown
39
24
  if (!(e.clientX === 0 && e.clientY === 0)) {
@@ -84,5 +69,5 @@ export function Root(props) {
84
69
  default:
85
70
  break;
86
71
  }
87
- return (_jsxs(_Fragment, { children: [_jsxs(RootContext.Provider, { value: context, children: [children, dialogs.map(({ node }) => node)] }), _jsx(Portal, { selector: () => document.body, children: _jsx(WindowSize, {}) })] }));
72
+ return (_jsxs(RootContext.Provider, { value: context, children: [children, dialogs.map(({ node }) => node)] }));
88
73
  }
package/select/Select.js CHANGED
@@ -11,6 +11,7 @@ import SearchOutlined from '@material-design-icons/svg/outlined/search.svg?react
11
11
  import { isNull, isNumber, isUndefined } from 'lodash';
12
12
  import { createElement, forwardRef, useCallback, useId, useImperativeHandle, useMemo, useRef, useState } from 'react';
13
13
  import { CLASSES, IS_CREATED } from './vars';
14
+ import { BaseInput } from '../base-input';
14
15
  import { Checkbox } from '../checkbox';
15
16
  import { Dropdown } from '../dropdown';
16
17
  import { Empty } from '../empty';
@@ -232,7 +233,7 @@ function SelectFC(props, ref) {
232
233
  const scrollCallback = useRef();
233
234
  const inputable = searchable && visible;
234
235
  const clearable = clearableProp && hasSelected && !visible && !loading && !disabled;
235
- const inputNode = focusVisibleWrapper(createElement(searchable ? 'input' : 'div', Object.assign(Object.assign(Object.assign(Object.assign({}, mergeCS(styled('select__search'), {
236
+ const inputNode = focusVisibleWrapper(createElement(searchable ? BaseInput : 'div', Object.assign(Object.assign(Object.assign(Object.assign({}, mergeCS(styled('select__search'), {
236
237
  style: {
237
238
  opacity: inputable ? undefined : 0,
238
239
  zIndex: inputable ? undefined : -1,
@@ -352,16 +353,15 @@ function SelectFC(props, ref) {
352
353
  }
353
354
  }
354
355
  }
355
- }, onChange: (e) => {
356
- if (searchable) {
357
- changeSearchValue(e.currentTarget.value);
358
- }
359
356
  } }), searchable
360
357
  ? {
361
358
  type: 'text',
362
359
  value: searchValue,
363
360
  autoComplete: 'off',
364
361
  disabled,
362
+ onValueChange: (val) => {
363
+ changeSearchValue(val);
364
+ },
365
365
  }
366
366
  : {})));
367
367
  const [selectedNode, suffixNode, selectedLabel] = (() => {
@@ -1,6 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import SearchOutlined from '@material-design-icons/svg/outlined/search.svg?react';
4
+ import { isUndefined } from 'lodash';
4
5
  import { CLASSES } from './vars';
5
6
  import { Button } from '../button';
6
7
  import { useComponentProps, useStyled, useTranslation } from '../hooks';
@@ -8,15 +9,15 @@ import { Icon } from '../icon';
8
9
  import { Input } from '../input';
9
10
  import { Popover } from '../popover';
10
11
  export function TableFilter(props) {
11
- const _a = useComponentProps('TableFilter', props), { children, styleOverrides, styleProvider, content, visible, placement = 'bottom-right', placementFixed = false, escClosable = true, gap, inWindow = false, searchable = false, searchValue, modal = false, destroyAfterClose = true, zIndex, scrolling, onVisibleChange, onSearch, onReset, afterVisibleChange } = _a, restProps = __rest(_a, ["children", "styleOverrides", "styleProvider", "content", "visible", "placement", "placementFixed", "escClosable", "gap", "inWindow", "searchable", "searchValue", "modal", "destroyAfterClose", "zIndex", "scrolling", "onVisibleChange", "onSearch", "onReset", "afterVisibleChange"]);
12
+ const _a = useComponentProps('TableFilter', props), { children, styleOverrides, styleProvider, content, footer, visible, placement = 'bottom-right', placementFixed = false, escClosable = true, gap, inWindow = false, searchable = false, searchValue, modal = false, destroyAfterClose = true, zIndex, scrolling, onVisibleChange, onSearch, onReset, afterVisibleChange } = _a, restProps = __rest(_a, ["children", "styleOverrides", "styleProvider", "content", "footer", "visible", "placement", "placementFixed", "escClosable", "gap", "inWindow", "searchable", "searchValue", "modal", "destroyAfterClose", "zIndex", "scrolling", "onVisibleChange", "onSearch", "onReset", "afterVisibleChange"]);
12
13
  const styled = useStyled(CLASSES, { table: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.table }, styleOverrides);
13
14
  const { t } = useTranslation();
14
15
  return (_jsx(Popover, Object.assign({}, restProps, { children: children, content: _jsxs("div", Object.assign({}, styled('table__filter'), { children: [searchable && (_jsx(Input, { style: { display: 'flex' }, model: searchValue, prefix: _jsx(Icon, { children: _jsx(SearchOutlined, {}) }), placeholder: t('Search'), clearable: true, onModelChange: (value) => {
15
16
  onSearch === null || onSearch === void 0 ? void 0 : onSearch(value);
16
- } })), content] })), footer: _jsx(Popover.Footer, { styleOverrides: { popover__footer: { style: { justifyContent: 'space-between' } } }, actions: [
17
+ } })), content] })), footer: isUndefined(footer) ? (_jsx(Popover.Footer, { styleOverrides: { popover__footer: { style: { justifyContent: 'space-between' } } }, actions: [
17
18
  _jsx(Button, { pattern: "link", onClick: () => {
18
19
  onReset === null || onReset === void 0 ? void 0 : onReset();
19
20
  }, children: t('Table', 'Reset') }),
20
21
  'ok',
21
- ] }), visible: visible, trigger: "click", placement: placement, placementFixed: placementFixed, arrow: false, escClosable: escClosable, gap: gap, inWindow: inWindow, modal: modal, destroyAfterClose: destroyAfterClose, zIndex: zIndex, scrolling: scrolling, onVisibleChange: onVisibleChange, afterVisibleChange: afterVisibleChange })));
22
+ ] })) : footer === false ? undefined : (footer), visible: visible, trigger: "click", placement: placement, placementFixed: placementFixed, arrow: false, escClosable: escClosable, gap: gap, inWindow: inWindow, modal: modal, destroyAfterClose: destroyAfterClose, zIndex: zIndex, scrolling: scrolling, onVisibleChange: onVisibleChange, afterVisibleChange: afterVisibleChange })));
22
23
  }
package/table/types.d.ts CHANGED
@@ -43,6 +43,7 @@ export interface TableTdProps extends BaseProps<'table', typeof CLASSES>, React.
43
43
  export interface TableFilterProps extends BaseProps<'table', typeof CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'content'> {
44
44
  children: React.ReactElement | ((render: CloneHTMLElement) => React.ReactNode);
45
45
  content?: React.ReactNode;
46
+ footer?: React.ReactElement | false;
46
47
  visible?: boolean;
47
48
  placement?: PopupPlacement;
48
49
  placementFixed?: boolean;
@@ -9,6 +9,7 @@ import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
9
9
  import { TimePickerPanel } from './internal/TimePickerPanel';
10
10
  import { deepCompareDate, orderTime } from './utils';
11
11
  import { CLASSES } from './vars';
12
+ import { BaseInput } from '../base-input';
12
13
  import { Button } from '../button';
13
14
  import dayjs from '../dayjs';
14
15
  import { useComponentProps, useControlled, useDesign, useJSS, useLayout, useListenGlobalScrolling, useMaxIndex, useNamespace, useScopedProps, useStyled, useTranslation, } from '../hooks';
@@ -191,12 +192,12 @@ export const TimePicker = forwardRef((props, ref) => {
191
192
  const index = isLeft ? 0 : 1;
192
193
  const value = isLeft ? valueLeft : valueRight;
193
194
  const render = inputRender === null || inputRender === void 0 ? void 0 : inputRender[index];
194
- const node = (_jsx("input", Object.assign({}, styled('time-picker__input'), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: isLeft ? combineInputLeftRef : combineInputRightRef, type: "text", autoComplete: "off", value: inputValue[index], size: 10, placeholder: isLeft ? placeholderLeft : placeholderRight, disabled: disabled, onChange: (e) => {
195
+ const node = (_jsx(BaseInput, Object.assign({}, styled('time-picker__input'), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: isLeft ? combineInputLeftRef : combineInputRightRef, type: "text", autoComplete: "off", value: inputValue[index], size: 10, placeholder: isLeft ? placeholderLeft : placeholderRight, disabled: disabled, onValueChange: (val) => {
195
196
  var _a;
196
197
  forceUpdate();
197
- dataRef.current.inputValue[index] = e.currentTarget.value;
198
- if (dayjs(e.currentTarget.value, format, true).isValid()) {
199
- const date = dayjs(e.currentTarget.value, format).toDate();
198
+ dataRef.current.inputValue[index] = val;
199
+ if (dayjs(val, format, true).isValid()) {
200
+ const date = dayjs(val, format).toDate();
200
201
  changeValue(date);
201
202
  (_a = panelRef.current) === null || _a === void 0 ? void 0 : _a.call(panelRef, date);
202
203
  }
@@ -10,6 +10,7 @@ import { isNull, isNumber, isUndefined } from 'lodash';
10
10
  import { createElement, forwardRef, useId, useImperativeHandle, useMemo, useRef, useState } from 'react';
11
11
  import { TreeSelectSearchPanel } from './internal/TreeSelectSearchPanel';
12
12
  import { CLASSES } from './vars';
13
+ import { BaseInput } from '../base-input';
13
14
  import { Dropdown } from '../dropdown';
14
15
  import { useComponentProps, useControlled, useDesign, useFocusVisible, useJSS, useLayout, useListenGlobalScrolling, useMaxIndex, useNamespace, useScopedProps, useStyled, useTranslation, } from '../hooks';
15
16
  import { Icon } from '../icon';
@@ -237,7 +238,7 @@ function TreeSelectFC(props, ref) {
237
238
  const scrollCallback = useRef();
238
239
  const inputable = searchable && visible;
239
240
  const clearable = clearableProp && hasSelected && !visible && !loading && !disabled;
240
- const inputNode = focusVisibleWrapper(createElement(searchable ? 'input' : 'div', Object.assign(Object.assign(Object.assign(Object.assign({}, mergeCS(styled('tree-select__search'), {
241
+ const inputNode = focusVisibleWrapper(createElement(searchable ? BaseInput : 'div', Object.assign(Object.assign(Object.assign(Object.assign({}, mergeCS(styled('tree-select__search'), {
241
242
  style: {
242
243
  opacity: inputable ? undefined : 0,
243
244
  zIndex: inputable ? undefined : -1,
@@ -358,16 +359,15 @@ function TreeSelectFC(props, ref) {
358
359
  }
359
360
  }
360
361
  }
361
- }, onChange: (e) => {
362
- if (searchable) {
363
- changeSearchValue(e.currentTarget.value);
364
- }
365
362
  } }), searchable
366
363
  ? {
367
364
  type: 'text',
368
365
  value: searchValue,
369
366
  autoComplete: 'off',
370
367
  disabled,
368
+ onValueChange: (val) => {
369
+ changeSearchValue(val);
370
+ },
371
371
  }
372
372
  : {})));
373
373
  const [selectedNode, suffixNode, selectedLabel] = (() => {