@cloudtower/eagle 481.0.2 → 481.0.3

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 (30) hide show
  1. package/dist/cjs/core/Cascader/cascader.widget.js +12 -12
  2. package/dist/cjs/core/SearchInput/SearchInput.hook.js +124 -0
  3. package/dist/cjs/core/SearchInput/SearchInput.js +253 -0
  4. package/dist/cjs/core/SearchInput/SearchInput.style.js +13 -0
  5. package/dist/cjs/core/index.js +6 -6
  6. package/dist/cjs/index.js +172 -172
  7. package/dist/cjs/legacy-antd.js +89 -89
  8. package/dist/cjs/stats1.html +1 -1
  9. package/dist/components.css +2240 -2217
  10. package/dist/esm/core/Cascader/cascader.widget.js +1 -1
  11. package/dist/esm/core/SearchInput/SearchInput.hook.js +117 -0
  12. package/dist/esm/core/SearchInput/SearchInput.js +247 -0
  13. package/dist/esm/core/SearchInput/SearchInput.style.js +7 -0
  14. package/dist/esm/index.js +1 -1
  15. package/dist/esm/legacy-antd.js +1 -1
  16. package/dist/esm/stats1.html +1 -1
  17. package/dist/linaria.merged.scss +2372 -2343
  18. package/dist/src/core/Cascader/cascader.type.d.ts +1 -1
  19. package/dist/src/core/SearchInput/SearchInput.d.ts +2 -0
  20. package/dist/src/core/SearchInput/SearchInput.hook.d.ts +9 -0
  21. package/dist/src/core/SearchInput/SearchInput.style.d.ts +5 -0
  22. package/dist/src/core/SearchInput/{searchInput.type.d.ts → SearchInput.type.d.ts} +18 -2
  23. package/dist/src/core/SearchInput/__test__/SearchInput.hook.test.d.ts +1 -0
  24. package/dist/src/core/SearchInput/index.d.ts +2 -4
  25. package/dist/src/core/index.d.ts +0 -1
  26. package/dist/stories/docs/core/SearchInput.stories.d.ts +6 -1
  27. package/dist/style.css +2240 -2217
  28. package/package.json +4 -4
  29. package/dist/cjs/core/SearchInput/index.js +0 -164
  30. package/dist/esm/core/SearchInput/index.js +0 -157
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { CascaderProps as Antd5CascaderProps } from "antd5/lib/cascader";
3
- import { SearchInputProps } from "../SearchInput/searchInput.type";
3
+ import { SearchInputProps } from "../SearchInput";
4
4
  export type { Antd5SizeType } from "../../utils/type";
5
5
  export type PresetCascaderRenderProps = {
6
6
  menus: Parameters<NonNullable<CascaderProps["dropdownRender"]>>[0];
@@ -0,0 +1,2 @@
1
+ import type { SearchInputComponentType } from "./SearchInput.type";
2
+ export declare const SearchInput: SearchInputComponentType;
@@ -0,0 +1,9 @@
1
+ import { type DebouncedFunc } from "lodash";
2
+ import React from "react";
3
+ import type { SearchInputProps } from "./SearchInput.type";
4
+ export declare const searchInputRecentSearchLocalStorageKey = "search-input-recent-search";
5
+ export declare const useRecentSearch: (recentSearchLocalStorageKey: SearchInputProps["recentSearchLocalStorageKey"], maxRecentCount: number, setValue: React.Dispatch<React.SetStateAction<string>>, onChange: SearchInputProps["onChange"]) => {
6
+ recentSearchKeys: string[];
7
+ setRecentSearchKeysDebounceRef: React.MutableRefObject<DebouncedFunc<(val: string) => void> | undefined>;
8
+ antd5DropdownMenu: import("antd5").MenuProps | undefined;
9
+ };
@@ -0,0 +1,5 @@
1
+ export declare const SearchInputStyles: import("@linaria/core").LinariaClassName;
2
+ export declare const CountTextStyles: import("@linaria/core").LinariaClassName;
3
+ export declare const IconContainerStyles: import("@linaria/core").LinariaClassName;
4
+ export declare const DisabledIconStyles: import("@linaria/core").LinariaClassName;
5
+ export declare const SearchInputDropdownStyles: import("@linaria/core").LinariaClassName;
@@ -1,9 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import { InputProps } from "antd/lib/input";
3
3
  import { SrcType } from "../BaseIcon";
4
- export type SearchInputProps = Omit<InputProps, "onChange"> & {
4
+ export type SearchInputProps = Omit<InputProps, "value" | "onChange"> & {
5
5
  /**
6
- * 防抖延迟的时间,单位为毫秒
6
+ * 配置 value 时,需把 debounceWait 设置为 0 ,否则输入时会有卡顿的问题
7
+ */
8
+ value?: InputProps["value"];
9
+ /**
10
+ * 防抖延迟的时间,单位为毫秒,默认为 300ms
7
11
  */
8
12
  debounceWait?: number;
9
13
  /**
@@ -59,5 +63,17 @@ export type SearchInputProps = Omit<InputProps, "onChange"> & {
59
63
  * 搜索框高度,默认为 276
60
64
  */
61
65
  width?: number | string;
66
+ /**
67
+ * 是否开启最近搜索功能
68
+ */
69
+ enableRecentSearch?: boolean;
70
+ /**
71
+ * 最近搜索的本地存储键
72
+ */
73
+ recentSearchLocalStorageKey?: string;
74
+ /**
75
+ * 最多展示多少条最新的搜索记录,默认 5 条
76
+ */
77
+ maxRecentCount?: number;
62
78
  };
63
79
  export type SearchInputComponentType = React.FC<SearchInputProps>;
@@ -1,4 +1,2 @@
1
- import { SearchInputComponentType } from "./searchInput.type";
2
- declare const SearchInput: SearchInputComponentType;
3
- export default SearchInput;
4
- export * from "./searchInput.type";
1
+ export * from "./SearchInput";
2
+ export * from "./SearchInput.type";
@@ -157,7 +157,6 @@ export { default as Overflow } from "./Overflow";
157
157
  export { default as Pagination } from "./Pagination";
158
158
  export { default as Percent } from "./Percent";
159
159
  export { default as Radio } from "./Radio";
160
- export { default as SearchInput } from "./SearchInput";
161
160
  export { default as Second } from "./Second";
162
161
  export { default as SegmentControl } from "./SegmentControl";
163
162
  export { default as Select } from "./Select";
@@ -1,4 +1,4 @@
1
- import SearchInput from "../../../src/core/SearchInput";
1
+ import { SearchInput } from "../../../src/core/SearchInput";
2
2
  import type { StoryObj } from "@storybook/react";
3
3
  /**
4
4
  * * tower legacy 组件, 带 debounce 的搜索框
@@ -45,3 +45,8 @@ export declare const withTotal: Story;
45
45
  * 展示如何使用 current prop 控制搜索项目的当前索引
46
46
  */
47
47
  export declare const ExternallyControlled: Story;
48
+ /**
49
+ * 带最近搜索的示例
50
+ * 展示如何使用 enableRecentSearch prop 启用最近搜索功能
51
+ */
52
+ export declare const withRecentSearch: Story;