@cloudtower/eagle 0.35.9 → 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 (78) hide show
  1. package/dist/cjs/core/Cascader/cascader.widget.js +12 -12
  2. package/dist/cjs/core/MediumDialog/MediumDialog.js +1 -1
  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 +12 -15
  7. package/dist/cjs/coreX/Dialogs/RejectDialog/RejectDialog.js +4 -16
  8. package/dist/cjs/index.js +245 -253
  9. package/dist/cjs/legacy-antd.js +89 -89
  10. package/dist/cjs/stats1.html +1 -1
  11. package/dist/components.css +2423 -2578
  12. package/dist/esm/core/Cascader/cascader.widget.js +1 -1
  13. package/dist/esm/core/MediumDialog/MediumDialog.js +1 -1
  14. package/dist/esm/core/SearchInput/SearchInput.hook.js +117 -0
  15. package/dist/esm/core/SearchInput/SearchInput.js +247 -0
  16. package/dist/esm/core/SearchInput/SearchInput.style.js +7 -0
  17. package/dist/esm/core/index.js +2 -4
  18. package/dist/esm/coreX/Dialogs/RejectDialog/RejectDialog.js +4 -16
  19. package/dist/esm/index.js +1 -5
  20. package/dist/esm/legacy-antd.js +1 -1
  21. package/dist/esm/stats1.html +1 -1
  22. package/dist/linaria.merged.scss +3680 -3841
  23. package/dist/src/core/Cascader/cascader.type.d.ts +1 -1
  24. package/dist/src/core/SearchInput/SearchInput.d.ts +2 -0
  25. package/dist/src/core/SearchInput/SearchInput.hook.d.ts +9 -0
  26. package/dist/src/core/SearchInput/SearchInput.style.d.ts +5 -0
  27. package/dist/src/core/SearchInput/{searchInput.type.d.ts → SearchInput.type.d.ts} +18 -2
  28. package/dist/src/core/SearchInput/index.d.ts +2 -4
  29. package/dist/src/core/index.d.ts +0 -6
  30. package/dist/src/coreX/Dialogs/RejectDialog/RejectDialog.type.d.ts +1 -5
  31. package/dist/src/coreX/index.d.ts +0 -3
  32. package/dist/src/hooks/index.d.ts +0 -1
  33. package/dist/src/utils/index.d.ts +0 -1
  34. package/dist/stories/docs/core/SearchInput.stories.d.ts +6 -1
  35. package/dist/stories/docs/coreX/Dialogs/RejectDialog.stories.d.ts +1 -3
  36. package/dist/style.css +2423 -2578
  37. package/package.json +4 -6
  38. package/dist/cjs/core/Duration/index.js +0 -78
  39. package/dist/cjs/core/LocalUpload/LocalUpload.hooks.js +0 -66
  40. package/dist/cjs/core/LocalUpload/LocalUpload.js +0 -103
  41. package/dist/cjs/core/LocalUpload/LocalUpload.style.js +0 -13
  42. package/dist/cjs/core/LocalUpload/LocalUpload.widget.js +0 -379
  43. package/dist/cjs/core/SearchInput/index.js +0 -164
  44. package/dist/cjs/coreX/Copy/CopyButton.js +0 -40
  45. package/dist/cjs/coreX/Copy/CopyTooltip.js +0 -66
  46. package/dist/cjs/hooks/useFormatDuration.js +0 -35
  47. package/dist/cjs/utils/formatDuration.js +0 -67
  48. package/dist/esm/core/Duration/index.js +0 -72
  49. package/dist/esm/core/LocalUpload/LocalUpload.hooks.js +0 -63
  50. package/dist/esm/core/LocalUpload/LocalUpload.js +0 -97
  51. package/dist/esm/core/LocalUpload/LocalUpload.style.js +0 -10
  52. package/dist/esm/core/LocalUpload/LocalUpload.widget.js +0 -365
  53. package/dist/esm/core/SearchInput/index.js +0 -157
  54. package/dist/esm/coreX/Copy/CopyButton.js +0 -34
  55. package/dist/esm/coreX/Copy/CopyTooltip.js +0 -59
  56. package/dist/esm/hooks/useFormatDuration.js +0 -33
  57. package/dist/esm/utils/formatDuration.js +0 -65
  58. package/dist/src/core/Duration/duration.type.d.ts +0 -42
  59. package/dist/src/core/Duration/index.d.ts +0 -4
  60. package/dist/src/core/LocalUpload/LocalUpload.d.ts +0 -15
  61. package/dist/src/core/LocalUpload/LocalUpload.hooks.d.ts +0 -32
  62. package/dist/src/core/LocalUpload/LocalUpload.style.d.ts +0 -3
  63. package/dist/src/core/LocalUpload/LocalUpload.type.d.ts +0 -175
  64. package/dist/src/core/LocalUpload/LocalUpload.widget.d.ts +0 -23
  65. package/dist/src/core/LocalUpload/index.d.ts +0 -2
  66. package/dist/src/coreX/Copy/CopyButton.d.ts +0 -5
  67. package/dist/src/coreX/Copy/CopyButton.type.d.ts +0 -8
  68. package/dist/src/coreX/Copy/CopyTooltip.d.ts +0 -5
  69. package/dist/src/coreX/Copy/CopyTooltip.typs.d.ts +0 -16
  70. package/dist/src/coreX/Copy/index.d.ts +0 -2
  71. package/dist/src/hooks/useFormatDuration.d.ts +0 -31
  72. package/dist/src/utils/__test__/formatDuration.spec.d.ts +0 -1
  73. package/dist/src/utils/formatDuration.d.ts +0 -28
  74. package/dist/stories/docs/core/Duration.stories.d.ts +0 -88
  75. package/dist/stories/docs/core/LocalUpload.stories.d.ts +0 -74
  76. package/dist/stories/docs/coreX/Copy/CopyButton.stories.d.ts +0 -66
  77. package/dist/stories/docs/coreX/Copy/CopyTooltip.stories.d.ts +0 -66
  78. /package/dist/src/{hooks/__tests__/useFormatDuration.test.d.ts → core/SearchInput/__test__/SearchInput.hook.test.d.ts} +0 -0
@@ -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;
@@ -48,7 +48,7 @@ const MediumDialog = _a => {
48
48
  }) => /* @__PURE__ */React__default.default.createElement("span", {
49
49
  className: index.Typo.Display.d1s_bold_title
50
50
  }, title),
51
- className: core.cx(MediumDialogStyle, "medium", isContentFull && "content-full", className),
51
+ className: core.cx(MediumDialogStyle, isContentFull && "content-full", className),
52
52
  initializingSkeletonRows: 3,
53
53
  width: isContentFull ? "calc(100vw - 160px)" : 720
54
54
  }, restProps));
@@ -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;
@@ -5,23 +5,21 @@ var index$8 = require('./BitPerSecond/index.js');
5
5
  var index$a = require('./Bps/index.js');
6
6
  var index$e = require('./Byte/index.js');
7
7
  var index$f = require('./BytePerSecond/index.js');
8
- var index$n = require('./Duration/index.js');
9
- var index$v = require('./Frequency/index.js');
10
- var index$P = require('./Percent/index.js');
11
- var index$S = require('./Second/index.js');
12
- var index$W = require('./Speed/index.js');
8
+ var index$u = require('./Frequency/index.js');
9
+ var index$O = require('./Percent/index.js');
10
+ var index$Q = require('./Second/index.js');
11
+ var index$U = require('./Speed/index.js');
13
12
 
14
13
  const units = {
15
- Percent: index$P,
14
+ Percent: index$O,
16
15
  Byte: index$e,
17
16
  BytePerSecond: index$f,
18
- Frequency: index$v,
19
- Speed: index$W,
17
+ Frequency: index$u,
18
+ Speed: index$U,
20
19
  Bps: index$a,
21
20
  BitPerSecond: index$8,
22
21
  Bit: index$7,
23
- Second: index$S,
24
- Duration: index$n
22
+ Second: index$Q
25
23
  };
26
24
 
27
25
  exports.Bit = index$7;
@@ -29,10 +27,9 @@ exports.BitPerSecond = index$8;
29
27
  exports.Bps = index$a;
30
28
  exports.Byte = index$e;
31
29
  exports.BytePerSecond = index$f;
32
- exports.Duration = index$n;
33
- exports.Frequency = index$v;
34
- exports.Percent = index$P;
35
- exports.Second = index$S;
36
- exports.Speed = index$W;
30
+ exports.Frequency = index$u;
31
+ exports.Percent = index$O;
32
+ exports.Second = index$Q;
33
+ exports.Speed = index$U;
37
34
  exports.Units = units;
38
35
  exports.units = units;
@@ -36,17 +36,8 @@ const SecondaryDesc = "E_srje1h0";
36
36
  const Divider = "E_di3zi7v";
37
37
  const SingleRejectContent = ({
38
38
  content,
39
- listType = "ordered",
40
- resourceIcon
39
+ listType = "ordered"
41
40
  }) => {
42
- if (listType === "resource" && Array.isArray(content)) {
43
- return /* @__PURE__ */React__default.default.createElement("div", {
44
- className: core.cx(MultiRejectContentList)
45
- }, content.map((name, index$1) => /* @__PURE__ */React__default.default.createElement("li", {
46
- className: index.Typo.Label.l4_regular,
47
- key: index$1
48
- }, resourceIcon, /* @__PURE__ */React__default.default.createElement("span", null, name))));
49
- }
50
41
  if (Array.isArray(content) && content.length > 1) {
51
42
  if (listType === "ordered") {
52
43
  return /* @__PURE__ */React__default.default.createElement("ol", {
@@ -94,13 +85,10 @@ const RejectDialog = props => {
94
85
  const renderContent = () => {
95
86
  switch (props.type) {
96
87
  case RejectDialog_type.RejectDialogType.Single:
97
- return /* @__PURE__ */React__default.default.createElement(React__default.default.Fragment, null, props.secondaryDesc && /* @__PURE__ */React__default.default.createElement("div", {
98
- className: core.cx(SecondaryDesc, index.Typo.Label.l4_regular)
99
- }, props.secondaryDesc), /* @__PURE__ */React__default.default.createElement(SingleRejectContent, {
88
+ return /* @__PURE__ */React__default.default.createElement(SingleRejectContent, {
100
89
  content: props.content,
101
- listType: props.listType,
102
- resourceIcon: props.resourceIcon
103
- }));
90
+ listType: props.listType
91
+ });
104
92
  case RejectDialog_type.RejectDialogType.All:
105
93
  case RejectDialog_type.RejectDialogType.Part:
106
94
  return /* @__PURE__ */React__default.default.createElement(React__default.default.Fragment, null, props.secondaryDesc && /* @__PURE__ */React__default.default.createElement("div", {