@cloudtower/eagle 490.0.5 → 490.0.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.
Files changed (56) hide show
  1. package/README.md +34 -0
  2. package/dist/cjs/core/Cascader/cascader.widget.js +12 -12
  3. package/dist/cjs/core/SearchInput/SearchInput.hook.js +124 -0
  4. package/dist/cjs/core/SearchInput/SearchInput.js +253 -0
  5. package/dist/cjs/core/SearchInput/SearchInput.style.js +13 -0
  6. package/dist/cjs/core/index.js +6 -6
  7. package/dist/cjs/index.js +172 -172
  8. package/dist/cjs/legacy-antd.js +89 -89
  9. package/dist/cjs/stats1.html +1 -1
  10. package/dist/components.css +3836 -3813
  11. package/dist/esm/core/Cascader/cascader.widget.js +1 -1
  12. package/dist/esm/core/SearchInput/SearchInput.hook.js +117 -0
  13. package/dist/esm/core/SearchInput/SearchInput.js +247 -0
  14. package/dist/esm/core/SearchInput/SearchInput.style.js +7 -0
  15. package/dist/esm/index.js +1 -1
  16. package/dist/esm/legacy-antd.js +1 -1
  17. package/dist/esm/stats1.html +1 -1
  18. package/dist/linaria.merged.scss +3611 -3582
  19. package/dist/src/core/Cascader/cascader.type.d.ts +1 -1
  20. package/dist/src/core/ImmersiveDialog/type.d.ts +127 -19
  21. package/dist/src/core/MediumDialog/MediumDialog.type.d.ts +49 -1
  22. package/dist/src/core/SearchInput/SearchInput.d.ts +2 -0
  23. package/dist/src/core/SearchInput/SearchInput.hook.d.ts +9 -0
  24. package/dist/src/core/SearchInput/SearchInput.style.d.ts +5 -0
  25. package/dist/src/core/SearchInput/SearchInput.type.d.ts +150 -0
  26. package/dist/src/core/SearchInput/__test__/SearchInput.hook.test.d.ts +1 -0
  27. package/dist/src/core/SearchInput/index.d.ts +2 -4
  28. package/dist/src/core/SmallDialog/SmallDialog.type.d.ts +150 -21
  29. package/dist/src/core/TableForm/types.d.ts +216 -68
  30. package/dist/src/core/WizardDialog/type.d.ts +147 -13
  31. package/dist/src/core/index.d.ts +0 -1
  32. package/dist/src/coreX/Dialogs/DeleteDialog/DeleteDialog.type.d.ts +100 -9
  33. package/dist/src/coreX/Dialogs/RejectDialog/RejectDialog.type.d.ts +126 -19
  34. package/dist/stories/docs/core/ImmersiveDialog.stories.d.ts +76 -8
  35. package/dist/stories/docs/core/MediumDialog.stories.d.ts +42 -8
  36. package/dist/stories/docs/core/SearchInput.stories.d.ts +6 -1
  37. package/dist/stories/docs/core/SmallDialog.stories.d.ts +86 -7
  38. package/dist/stories/docs/core/TableForm.stories.d.ts +40 -26
  39. package/dist/stories/docs/core/WizardDialog.stories.d.ts +65 -6
  40. package/dist/stories/docs/coreX/Dialogs/DeleteDialog.stories.d.ts +20 -19
  41. package/dist/stories/docs/coreX/Dialogs/RejectDialog.stories.d.ts +24 -23
  42. package/dist/style.css +3836 -3813
  43. package/docs/core/ImmersiveDialog/guide.md +298 -0
  44. package/docs/core/LegacyModal/migrate-guide.md +422 -0
  45. package/docs/core/MediumDialog/guide.md +263 -0
  46. package/docs/core/SearchInput/guide.md +125 -0
  47. package/docs/core/SmallDialog/guide.md +224 -0
  48. package/docs/core/TableForm/guide.md +195 -0
  49. package/docs/core/WizardDialog/guide.md +322 -0
  50. package/docs/coreX/DeleteDialog/guide.md +161 -0
  51. package/docs/coreX/RejectDialog/guide.md +185 -0
  52. package/docs/llms.txt +169 -0
  53. package/package.json +6 -5
  54. package/dist/cjs/core/SearchInput/index.js +0 -164
  55. package/dist/esm/core/SearchInput/index.js +0 -157
  56. package/dist/src/core/SearchInput/searchInput.type.d.ts +0 -63
package/README.md CHANGED
@@ -60,6 +60,40 @@ const App = () => {
60
60
  export default App;
61
61
  ```
62
62
 
63
+ ## AI / Agent 集成
64
+
65
+ 组件库提供了机器可读的文档和 Agent Skill,方便 AI coding agent 理解和使用组件。
66
+
67
+ ### Agent 友好文档
68
+
69
+ 文档随 npm 包发布,安装后位于 `node_modules/@cloudtower/eagle/docs/`:
70
+
71
+ - `docs/llms.txt` -- 组件索引,按分类列出所有组件及一句话描述
72
+ - `docs/<layer>/<组件名>/guide.md` -- 组件详细文档(Props、用法示例、常见模式)
73
+ - `docs/<layer>/<组件名>/migrate-guide.md` -- 废弃组件迁移指南(在各废弃组件目录下)
74
+
75
+ ### Agent Skills
76
+
77
+ Skill 遵循 [Agent Skills 开放标准](https://github.com/vercel-labs/skills),兼容 Claude Code、Cursor、Copilot 等 40+ Agent 工具。
78
+
79
+ | Skill | 说明 |
80
+ |-------|------|
81
+ | `cloudtower-eagle` | 消费侧:帮助 Agent 在业务项目中正确使用组件(组件选型、废弃迁移、使用模式) |
82
+ | `cloudtower-eagle-dev` | 生产侧:帮助 Agent 参与组件库开发(编写文档、Props 变更同步、废弃组件流程) |
83
+
84
+ 安装:
85
+
86
+ ```bash
87
+ # 查看可用 skill
88
+ npx skills add webzard-io/cloudtower-ui-kit --list
89
+
90
+ # 安装消费侧 skill(在业务项目中)
91
+ npx skills add webzard-io/cloudtower-ui-kit --skill cloudtower-eagle
92
+
93
+ # 安装生产侧 skill(组件库开发时)
94
+ npx skills add webzard-io/cloudtower-ui-kit --skill cloudtower-eagle-dev
95
+ ```
96
+
63
97
  ## 如何 [贡献代码]
64
98
 
65
99
  - 快速开始
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
3
  var core = require('@linaria/core');
4
- var index$1 = require('../Link/index.js');
5
- var index$3 = require('../Token/index.js');
6
- var index$4 = require('../../coreX/OverflowTooltip/index.js');
4
+ var index = require('../Link/index.js');
5
+ var index$2 = require('../Token/index.js');
6
+ var index$3 = require('../../coreX/OverflowTooltip/index.js');
7
7
  var useParrotTranslation = require('../../hooks/useParrotTranslation.js');
8
8
  var antd5 = require('antd5');
9
9
  var cs = require('classnames');
10
10
  var React = require('react');
11
- var index = require('../SearchInput/index.js');
12
- var index$2 = require('../Typo/index.js');
11
+ var index$1 = require('../Typo/index.js');
13
12
  var cascader_style = require('./cascader.style.js');
13
+ var SearchInput = require('../SearchInput/SearchInput.js');
14
14
 
15
15
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
16
16
 
@@ -48,14 +48,14 @@ const PresetCascaderHeader = ({ defaultContent, searchProps }) => {
48
48
  (_a = defaultContent == null ? void 0 : defaultContent.onClickAll) == null ? void 0 : _a.call(defaultContent, selectedAll);
49
49
  };
50
50
  return /* @__PURE__ */ React__default.default.createElement(antd5.Flex, { vertical: true, className: cascader_style.CascaderDefaultHeaderContainer }, searchProps ? /* @__PURE__ */ React__default.default.createElement(
51
- index,
51
+ SearchInput.SearchInput,
52
52
  __spreadProps(__spreadValues({}, searchProps), {
53
53
  className: cs__default.default(searchProps.className, cascader_style.CascaderDefaultHeaderSearch),
54
54
  style: {
55
55
  width: "unset"
56
56
  }
57
57
  })
58
- ) : /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null), (defaultContent == null ? void 0 : defaultContent.hide) ? /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null) : /* @__PURE__ */ React__default.default.createElement("div", { className: cs__default.default(cascader_style.CascaderDefaultHeader) }, defaultContent == null ? void 0 : defaultContent.label, /* @__PURE__ */ React__default.default.createElement(index$1, { size: "small", onClick }, selectedAll ? t("components.unselect_all") : t("components.select_all"))));
58
+ ) : /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null), (defaultContent == null ? void 0 : defaultContent.hide) ? /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null) : /* @__PURE__ */ React__default.default.createElement("div", { className: cs__default.default(cascader_style.CascaderDefaultHeader) }, defaultContent == null ? void 0 : defaultContent.label, /* @__PURE__ */ React__default.default.createElement(index, { size: "small", onClick }, selectedAll ? t("components.unselect_all") : t("components.select_all"))));
59
59
  };
60
60
  const PresetCascaderRender = ({
61
61
  menus,
@@ -80,20 +80,20 @@ const CascaderDoubleRowOption = ({ leftTop, leftBottom, rightTop, rightBottom, r
80
80
  className: !leftTop && !rightTop ? cascader_style.Hide : "",
81
81
  gap: 8
82
82
  },
83
- /* @__PURE__ */ React__default.default.createElement("div", { className: cs__default.default(index$2.Typo.Label.l2_medium, "top", "left") }, leftTop),
83
+ /* @__PURE__ */ React__default.default.createElement("div", { className: cs__default.default(index$1.Typo.Label.l2_medium, "top", "left") }, leftTop),
84
84
  /* @__PURE__ */ React__default.default.createElement("div", null, rightTop)
85
85
  ),
86
86
  /* @__PURE__ */ React__default.default.createElement(
87
87
  antd5.Flex,
88
88
  {
89
89
  justify: "space-between",
90
- className: cs__default.default(index$2.Typo.Label.l4_regular, {
90
+ className: cs__default.default(index$1.Typo.Label.l4_regular, {
91
91
  [cascader_style.Hide]: !leftBottom && !rightBottom
92
92
  }),
93
93
  gap: 8
94
94
  },
95
- /* @__PURE__ */ React__default.default.createElement("div", { className: cs__default.default(index$2.Typo.Label.l4_regular, "bottom", "left") }, leftBottom),
96
- /* @__PURE__ */ React__default.default.createElement("div", { className: cs__default.default(index$2.Typo.Label.l4_regular, "bottom") }, rightBottom)
95
+ /* @__PURE__ */ React__default.default.createElement("div", { className: cs__default.default(index$1.Typo.Label.l4_regular, "bottom", "left") }, leftBottom),
96
+ /* @__PURE__ */ React__default.default.createElement("div", { className: cs__default.default(index$1.Typo.Label.l4_regular, "bottom") }, rightBottom)
97
97
  )
98
98
  );
99
99
  };
@@ -101,7 +101,7 @@ const CascaderOptionWithCount = ({ label, count }) => {
101
101
  return /* @__PURE__ */ React__default.default.createElement("div", { className: cascader_style.CascaderDefaultOptionLabel }, label, count ? /* @__PURE__ */ React__default.default.createElement("span", { className: "label" }, count.selected, "/", count.total) : /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null));
102
102
  };
103
103
  const defaultTagRender = (props) => {
104
- return /* @__PURE__ */ React__default.default.createElement(index$3.default, __spreadValues({ size: "medium", color: "blue", key: props.value }, props), /* @__PURE__ */ React__default.default.createElement(index$4, { content: props.label, tooltip: props.label }));
104
+ return /* @__PURE__ */ React__default.default.createElement(index$2.default, __spreadValues({ size: "medium", color: "blue", key: props.value }, props), /* @__PURE__ */ React__default.default.createElement(index$3, { content: props.label, tooltip: props.label }));
105
105
  };
106
106
 
107
107
  exports.CascaderDoubleRowOption = CascaderDoubleRowOption;
@@ -0,0 +1,124 @@
1
+ 'use strict';
2
+
3
+ var iconsReact = require('@cloudtower/icons-react');
4
+ var core = require('@linaria/core');
5
+ var index$1 = require('../Icon/index.js');
6
+ var index = require('../Typo/index.js');
7
+ var useParrotTranslation = require('../../hooks/useParrotTranslation.js');
8
+ var _ = require('lodash');
9
+ var React = require('react');
10
+ var index$2 = require('../../coreX/OverflowTooltip/index.js');
11
+
12
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
+
14
+ var React__default = /*#__PURE__*/_interopDefault(React);
15
+
16
+ var __defProp = Object.defineProperty;
17
+ var __defProps = Object.defineProperties;
18
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
19
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
20
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
21
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
22
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
23
+ var __spreadValues = (a, b) => {
24
+ for (var prop in b || (b = {}))
25
+ if (__hasOwnProp.call(b, prop))
26
+ __defNormalProp(a, prop, b[prop]);
27
+ if (__getOwnPropSymbols)
28
+ for (var prop of __getOwnPropSymbols(b)) {
29
+ if (__propIsEnum.call(b, prop))
30
+ __defNormalProp(a, prop, b[prop]);
31
+ }
32
+ return a;
33
+ };
34
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
35
+ const searchInputRecentSearchLocalStorageKey = "search-input-recent-search";
36
+ const useRecentSearch = (recentSearchLocalStorageKey, maxRecentCount, setValue, onChange) => {
37
+ const { t } = useParrotTranslation();
38
+ const [recentSearchKeys, setRecentSearchKeys] = React.useState([]);
39
+ React.useEffect(() => {
40
+ if (!recentSearchLocalStorageKey)
41
+ return;
42
+ try {
43
+ const currRecentSearchKeys = JSON.parse(
44
+ localStorage.getItem(searchInputRecentSearchLocalStorageKey) || "{}"
45
+ )[recentSearchLocalStorageKey];
46
+ setRecentSearchKeys(currRecentSearchKeys || []);
47
+ } catch (error) {
48
+ setRecentSearchKeys([]);
49
+ }
50
+ }, [recentSearchLocalStorageKey]);
51
+ const setRecentSearchKeysDebounceRef = React.useRef();
52
+ React.useEffect(() => {
53
+ if (!recentSearchLocalStorageKey)
54
+ return;
55
+ const fn = _.debounce((val) => {
56
+ if (!val || !recentSearchLocalStorageKey)
57
+ return;
58
+ setRecentSearchKeys((preState) => {
59
+ const newState = [...preState].filter((item) => item !== val);
60
+ if (newState.length >= maxRecentCount)
61
+ newState.pop();
62
+ newState.unshift(val);
63
+ try {
64
+ const recentSearchMap = JSON.parse(
65
+ localStorage.getItem(searchInputRecentSearchLocalStorageKey) || "{}"
66
+ );
67
+ localStorage.setItem(
68
+ searchInputRecentSearchLocalStorageKey,
69
+ JSON.stringify(__spreadProps(__spreadValues({}, recentSearchMap), {
70
+ [recentSearchLocalStorageKey]: newState
71
+ }))
72
+ );
73
+ } catch (err) {
74
+ console.error(err);
75
+ }
76
+ return newState;
77
+ });
78
+ }, 400);
79
+ setRecentSearchKeysDebounceRef.current = fn;
80
+ return () => fn.cancel();
81
+ }, [maxRecentCount, recentSearchLocalStorageKey]);
82
+ const antd5DropdownMenu = React.useMemo(
83
+ () => ({
84
+ onClick: ({ key: val }) => {
85
+ var _a;
86
+ setValue(val);
87
+ onChange == null ? void 0 : onChange(val);
88
+ (_a = setRecentSearchKeysDebounceRef.current) == null ? void 0 : _a.call(setRecentSearchKeysDebounceRef, val);
89
+ },
90
+ items: [
91
+ {
92
+ key: "recent-search",
93
+ className: core.cx("recent-search-menu-item", index.Typo.Label.l4_regular),
94
+ disabled: true,
95
+ label: /* @__PURE__ */ React__default.default.createElement("span", null, t("components.recent_search"))
96
+ },
97
+ ...recentSearchKeys.map((k) => ({
98
+ key: k,
99
+ label: /* @__PURE__ */ React__default.default.createElement(
100
+ index$1,
101
+ {
102
+ src: iconsReact.Search24Icon,
103
+ hoverSrc: iconsReact.Search24BlueIcon,
104
+ iconHeight: 24,
105
+ iconWidth: 24
106
+ },
107
+ /* @__PURE__ */ React__default.default.createElement(index$2, { content: k })
108
+ )
109
+ }))
110
+ ],
111
+ // 避免 Dropdown 点击时被 Input blur 关闭
112
+ onMouseDown: (e) => e.preventDefault()
113
+ }),
114
+ [onChange, recentSearchKeys, setRecentSearchKeysDebounceRef, setValue, t]
115
+ );
116
+ return {
117
+ recentSearchKeys,
118
+ setRecentSearchKeysDebounceRef,
119
+ antd5DropdownMenu
120
+ };
121
+ };
122
+
123
+ exports.searchInputRecentSearchLocalStorageKey = searchInputRecentSearchLocalStorageKey;
124
+ exports.useRecentSearch = useRecentSearch;
@@ -0,0 +1,253 @@
1
+ 'use strict';
2
+
3
+ var icons = require('@ant-design/icons');
4
+ var iconsReact = require('@cloudtower/icons-react');
5
+ var core = require('@linaria/core');
6
+ var index$1 = require('../Icon/index.js');
7
+ var index$3 = require('../Input/index.js');
8
+ var index$2 = require('../Tooltip/index.js');
9
+ var index = require('../Typo/index.js');
10
+ var useParrotTranslation = require('../../hooks/useParrotTranslation.js');
11
+ var _ = require('lodash');
12
+ var React = require('react');
13
+ var SearchInput_hook = require('./SearchInput.hook.js');
14
+ var SearchInput_style = require('./SearchInput.style.js');
15
+ var Antd5Dropdown = require('../Antd5Dropdown/Antd5Dropdown.js');
16
+
17
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
18
+
19
+ var React__default = /*#__PURE__*/_interopDefault(React);
20
+
21
+ var __defProp = Object.defineProperty;
22
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
23
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
24
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
25
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
26
+ var __spreadValues = (a, b) => {
27
+ for (var prop in b || (b = {}))
28
+ if (__hasOwnProp.call(b, prop))
29
+ __defNormalProp(a, prop, b[prop]);
30
+ if (__getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(b)) {
32
+ if (__propIsEnum.call(b, prop))
33
+ __defNormalProp(a, prop, b[prop]);
34
+ }
35
+ return a;
36
+ };
37
+ var __objRest = (source, exclude) => {
38
+ var target = {};
39
+ for (var prop in source)
40
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
41
+ target[prop] = source[prop];
42
+ if (source != null && __getOwnPropSymbols)
43
+ for (var prop of __getOwnPropSymbols(source)) {
44
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
45
+ target[prop] = source[prop];
46
+ }
47
+ return target;
48
+ };
49
+ const SearchInput = (props) => {
50
+ const _a = props, {
51
+ className,
52
+ debounceWait = 300,
53
+ total = 0,
54
+ onSearchNext,
55
+ onSearchPrev,
56
+ prefixHoverIcon,
57
+ nextHoverIcon,
58
+ clearHoverIcon,
59
+ prefixIcon,
60
+ nextIcon,
61
+ clearIcon,
62
+ width = 276,
63
+ searchIcon,
64
+ enableRecentSearch,
65
+ recentSearchLocalStorageKey,
66
+ maxRecentCount = 5,
67
+ current: externalCurrent,
68
+ onChange,
69
+ onFocus,
70
+ onBlur
71
+ } = _a, restProps = __objRest(_a, [
72
+ "className",
73
+ "debounceWait",
74
+ "total",
75
+ "onSearchNext",
76
+ "onSearchPrev",
77
+ "prefixHoverIcon",
78
+ "nextHoverIcon",
79
+ "clearHoverIcon",
80
+ "prefixIcon",
81
+ "nextIcon",
82
+ "clearIcon",
83
+ "width",
84
+ "searchIcon",
85
+ "enableRecentSearch",
86
+ "recentSearchLocalStorageKey",
87
+ "maxRecentCount",
88
+ "current",
89
+ "onChange",
90
+ "onFocus",
91
+ "onBlur"
92
+ ]);
93
+ const [internalCurrent, setInternalCurrent] = React.useState(0);
94
+ const [value, setValue] = React.useState(props.value || "");
95
+ const { t } = useParrotTranslation();
96
+ const isNoMatch = total === 0;
97
+ const [inputFocused, setInputFocused] = React.useState(false);
98
+ const {
99
+ recentSearchKeys,
100
+ setRecentSearchKeysDebounceRef,
101
+ antd5DropdownMenu
102
+ } = SearchInput_hook.useRecentSearch(
103
+ recentSearchLocalStorageKey,
104
+ maxRecentCount,
105
+ setValue,
106
+ onChange
107
+ );
108
+ const debounceOnChangeRef = React.useRef();
109
+ React.useEffect(() => {
110
+ const fn = _.debounce((val) => {
111
+ var _a2;
112
+ onChange == null ? void 0 : onChange(val);
113
+ if (enableRecentSearch && val) {
114
+ (_a2 = setRecentSearchKeysDebounceRef.current) == null ? void 0 : _a2.call(setRecentSearchKeysDebounceRef, val);
115
+ }
116
+ }, debounceWait);
117
+ debounceOnChangeRef.current = fn;
118
+ return () => fn.cancel();
119
+ }, [
120
+ onChange,
121
+ enableRecentSearch,
122
+ debounceWait,
123
+ setRecentSearchKeysDebounceRef
124
+ ]);
125
+ const current = externalCurrent !== void 0 ? externalCurrent : internalCurrent;
126
+ const setCurrent = React.useCallback(
127
+ (newCurrent) => {
128
+ if (externalCurrent === void 0) {
129
+ setInternalCurrent(newCurrent);
130
+ }
131
+ },
132
+ [externalCurrent]
133
+ );
134
+ const next = React.useCallback(() => {
135
+ if (total) {
136
+ const nextCurrent = current + 1 > total ? 1 : current + 1;
137
+ onSearchNext == null ? void 0 : onSearchNext(value, nextCurrent);
138
+ setCurrent(nextCurrent);
139
+ }
140
+ }, [onSearchNext, current, total, value, setCurrent]);
141
+ const prev = React.useCallback(() => {
142
+ if (total) {
143
+ const prevCurrent = current - 1 < 1 ? total : current - 1;
144
+ onSearchPrev == null ? void 0 : onSearchPrev(value, prevCurrent);
145
+ setCurrent(prevCurrent);
146
+ }
147
+ }, [onSearchPrev, current, total, value, setCurrent]);
148
+ const suffix = onSearchNext && onSearchPrev && value ? /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, typeof total === "number" ? /* @__PURE__ */ React__default.default.createElement(
149
+ "span",
150
+ {
151
+ className: core.cx(
152
+ index.Typo.Label.l4_regular,
153
+ "counter-text",
154
+ SearchInput_style.CountTextStyles
155
+ )
156
+ },
157
+ current,
158
+ "/",
159
+ total
160
+ ) : null, /* @__PURE__ */ React__default.default.createElement("span", { className: SearchInput_style.IconContainerStyles }, isNoMatch ? /* @__PURE__ */ React__default.default.createElement(
161
+ index$1,
162
+ {
163
+ className: SearchInput_style.DisabledIconStyles,
164
+ src: iconsReact.ArrowChevronUp16SecondaryIcon,
165
+ style: { opacity: 0.5 }
166
+ }
167
+ ) : /* @__PURE__ */ React__default.default.createElement(index$2, { title: t("components.prev") }, /* @__PURE__ */ React__default.default.createElement(
168
+ index$1,
169
+ {
170
+ src: prefixIcon != null ? prefixIcon : iconsReact.ArrowChevronUp16SecondaryIcon,
171
+ hoverSrc: prefixHoverIcon != null ? prefixHoverIcon : iconsReact.ArrowChevronUp16BlueIcon,
172
+ onClick: prev
173
+ }
174
+ )), isNoMatch ? /* @__PURE__ */ React__default.default.createElement(
175
+ index$1,
176
+ {
177
+ className: SearchInput_style.DisabledIconStyles,
178
+ src: iconsReact.ArrowChevronDown16SecondaryIcon,
179
+ style: { opacity: 0.5 }
180
+ }
181
+ ) : /* @__PURE__ */ React__default.default.createElement(index$2, { title: t("components.next") }, /* @__PURE__ */ React__default.default.createElement(
182
+ index$1,
183
+ {
184
+ src: nextIcon != null ? nextIcon : iconsReact.ArrowChevronDown16SecondaryIcon,
185
+ hoverSrc: nextHoverIcon != null ? nextHoverIcon : iconsReact.ArrowChevronDown16BlueIcon,
186
+ onClick: next
187
+ }
188
+ )), /* @__PURE__ */ React__default.default.createElement(index$2, { title: t("components.clear") }, /* @__PURE__ */ React__default.default.createElement(
189
+ index$1,
190
+ {
191
+ src: clearIcon != null ? clearIcon : iconsReact.XmarkCloseCircleFill16TertiaryIcon,
192
+ hoverSrc: clearHoverIcon != null ? clearHoverIcon : iconsReact.XmarkCloseCircleFill16SecondaryIcon,
193
+ onClick: () => {
194
+ var _a2;
195
+ setValue("");
196
+ (_a2 = debounceOnChangeRef.current) == null ? void 0 : _a2.call(debounceOnChangeRef, "");
197
+ }
198
+ }
199
+ )))) : null;
200
+ React.useEffect(() => {
201
+ setValue(props.value || "");
202
+ }, [props.value]);
203
+ React.useEffect(() => {
204
+ if (externalCurrent === void 0) {
205
+ setCurrent(total ? 1 : 0);
206
+ }
207
+ }, [value, total, externalCurrent, setCurrent]);
208
+ const InputComponent = /* @__PURE__ */ React__default.default.createElement(
209
+ index$3,
210
+ __spreadValues({
211
+ className: core.cx(SearchInput_style.SearchInputStyles, className),
212
+ style: { width },
213
+ prefix: searchIcon ? /* @__PURE__ */ React__default.default.createElement(index$1, { src: searchIcon }) : /* @__PURE__ */ React__default.default.createElement(icons.SearchOutlined, null),
214
+ suffix,
215
+ onPressEnter: next,
216
+ value,
217
+ onChange: (e) => {
218
+ var _a2;
219
+ const newValue = e.target.value || "";
220
+ setValue(newValue);
221
+ (_a2 = debounceOnChangeRef.current) == null ? void 0 : _a2.call(debounceOnChangeRef, newValue);
222
+ },
223
+ onFocus: (e) => {
224
+ setInputFocused(true);
225
+ onFocus == null ? void 0 : onFocus(e);
226
+ },
227
+ onBlur: (e) => {
228
+ setInputFocused(false);
229
+ onBlur == null ? void 0 : onBlur(e);
230
+ }
231
+ }, restProps)
232
+ );
233
+ if (enableRecentSearch)
234
+ return /* @__PURE__ */ React__default.default.createElement(
235
+ Antd5Dropdown.Antd5Dropdown,
236
+ {
237
+ overlayClassName: core.cx(
238
+ "recent-search-dropdown",
239
+ SearchInput_style.SearchInputDropdownStyles
240
+ ),
241
+ overlayStyle: { width },
242
+ transitionName: "",
243
+ placement: "bottomLeft",
244
+ trigger: ["click"],
245
+ open: inputFocused && !value && !!recentSearchKeys.length,
246
+ menu: antd5DropdownMenu
247
+ },
248
+ InputComponent
249
+ );
250
+ return InputComponent;
251
+ };
252
+
253
+ exports.SearchInput = SearchInput;
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ const SearchInputStyles = "E_s1n7hav7";
4
+ const CountTextStyles = "E_c1tgpyn0";
5
+ const IconContainerStyles = "E_i1cmbu8m";
6
+ const DisabledIconStyles = "E_dxmfsc9";
7
+ const SearchInputDropdownStyles = "E_slbf45q";
8
+
9
+ exports.CountTextStyles = CountTextStyles;
10
+ exports.DisabledIconStyles = DisabledIconStyles;
11
+ exports.IconContainerStyles = IconContainerStyles;
12
+ exports.SearchInputDropdownStyles = SearchInputDropdownStyles;
13
+ exports.SearchInputStyles = SearchInputStyles;
@@ -8,19 +8,19 @@ var index$f = require('./BytePerSecond/index.js');
8
8
  var index$n = require('./Duration/index.js');
9
9
  var index$v = require('./Frequency/index.js');
10
10
  var index$P = require('./Percent/index.js');
11
- var index$S = require('./Second/index.js');
12
- var index$W = require('./Speed/index.js');
11
+ var index$R = require('./Second/index.js');
12
+ var index$V = require('./Speed/index.js');
13
13
 
14
14
  const units = {
15
15
  Percent: index$P,
16
16
  Byte: index$e,
17
17
  BytePerSecond: index$f,
18
18
  Frequency: index$v,
19
- Speed: index$W,
19
+ Speed: index$V,
20
20
  Bps: index$a,
21
21
  BitPerSecond: index$8,
22
22
  Bit: index$7,
23
- Second: index$S,
23
+ Second: index$R,
24
24
  Duration: index$n
25
25
  };
26
26
 
@@ -32,7 +32,7 @@ exports.BytePerSecond = index$f;
32
32
  exports.Duration = index$n;
33
33
  exports.Frequency = index$v;
34
34
  exports.Percent = index$P;
35
- exports.Second = index$S;
36
- exports.Speed = index$W;
35
+ exports.Second = index$R;
36
+ exports.Speed = index$V;
37
37
  exports.Units = units;
38
38
  exports.units = units;