@pisell/materials 6.11.4 → 6.11.5
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +13 -13
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +14 -14
- package/es/components/PisellSuperTabs/PisellSuperTabs.d.ts +1 -1
- package/es/components/PisellSuperTabs/PisellSuperTabs.js +7 -4
- package/es/components/PisellSuperTabs/hooks/useTabsState.js +3 -8
- package/es/components/PisellSuperTabs/types.d.ts +2 -0
- package/es/components/PisellTabbar/PisellTabbar.d.ts +1 -1
- package/es/components/PisellTabbar/PisellTabbar.js +405 -59
- package/es/components/PisellTabbar/constants.d.ts +2 -1
- package/es/components/PisellTabbar/constants.js +5 -4
- package/es/components/PisellTabbar/hooks/useActiveKey.d.ts +6 -0
- package/es/components/PisellTabbar/hooks/useActiveKey.js +21 -2
- package/es/components/PisellTabbar/hooks/useExpand.d.ts +1 -0
- package/es/components/PisellTabbar/hooks/useExpand.js +9 -1
- package/es/components/PisellTabbar/types.d.ts +5 -26
- package/es/components/PisellTabbar/utils/index.d.ts +2 -1
- package/es/components/PisellTabbar/utils/index.js +2 -1
- package/es/components/page/index.js +6 -1
- package/es/components/pisellDateTimeDisplay/index.d.ts +1 -0
- package/es/components/pisellDateTimeDisplay/index.js +2 -1
- package/es/components/pisellEmail/PisellEmail.less +2 -2
- package/es/components/pisellFind/PisellFind.stories.d.ts +45 -0
- package/es/components/pisellFind/PisellFind.stories.js +479 -0
- package/es/components/pisellFind/index.d.ts +40 -0
- package/es/components/pisellFind/index.js +72 -0
- package/es/components/pisellLongText/PisellLongText.less +2 -2
- package/es/components/pisellLookup/PisellLookup.d.ts +4 -0
- package/es/components/pisellLookup/PisellLookup.js +636 -0
- package/es/components/pisellLookup/PisellLookup.less +640 -0
- package/es/components/pisellLookup/PisellLookup.stories.d.ts +129 -0
- package/es/components/pisellLookup/PisellLookup.stories.js +1012 -0
- package/es/components/pisellLookup/components/HotWords.d.ts +7 -0
- package/es/components/pisellLookup/components/HotWords.js +49 -0
- package/es/components/pisellLookup/components/LookupAuxiliary.d.ts +7 -0
- package/es/components/pisellLookup/components/LookupAuxiliary.js +59 -0
- package/es/components/pisellLookup/components/LookupResultHost.d.ts +7 -0
- package/es/components/pisellLookup/components/LookupResultHost.js +185 -0
- package/es/components/pisellLookup/components/LookupTrigger.d.ts +3 -0
- package/es/components/pisellLookup/components/LookupTrigger.js +298 -0
- package/es/components/pisellLookup/components/SearchHistory.d.ts +7 -0
- package/es/components/pisellLookup/components/SearchHistory.js +68 -0
- package/es/components/pisellLookup/components/SuggestWords.d.ts +7 -0
- package/es/components/pisellLookup/components/SuggestWords.js +53 -0
- package/es/components/pisellLookup/components/index.d.ts +9 -0
- package/es/components/pisellLookup/components/index.js +10 -0
- package/es/components/pisellLookup/hooks/index.d.ts +6 -0
- package/es/components/pisellLookup/hooks/index.js +7 -0
- package/es/components/pisellLookup/hooks/useDebounceSearch.d.ts +40 -0
- package/es/components/pisellLookup/hooks/useDebounceSearch.js +78 -0
- package/es/components/pisellLookup/hooks/useSearchHistory.d.ts +48 -0
- package/es/components/pisellLookup/hooks/useSearchHistory.js +125 -0
- package/es/components/pisellLookup/hooks/useSearchState.d.ts +80 -0
- package/es/components/pisellLookup/hooks/useSearchState.js +113 -0
- package/es/components/pisellLookup/index.d.ts +6 -0
- package/es/components/pisellLookup/index.js +5 -0
- package/es/components/pisellLookup/types.d.ts +666 -0
- package/es/components/pisellLookup/types.js +1 -0
- package/es/components/pisellLookup/utils/index.d.ts +5 -0
- package/es/components/pisellLookup/utils/index.js +6 -0
- package/es/components/pisellLookup/utils/storage.d.ts +42 -0
- package/es/components/pisellLookup/utils/storage.js +118 -0
- package/es/components/pisellLookup/utils/trigger.d.ts +42 -0
- package/es/components/pisellLookup/utils/trigger.js +76 -0
- package/es/components/pisellMultipleSelect/PisellMultipleSelect.less +7 -7
- package/es/components/pisellSingleLineText/PisellSingleLineText.less +143 -4
- package/es/components/pisellSingleSelect/PisellSingleSelect.less +6 -6
- package/es/components/pisellUrl/PisellUrl.less +1 -1
- package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/es/components/productCard/components/Packages/utils.d.ts +1 -1
- package/es/index.d.ts +4 -0
- package/es/index.js +3 -1
- package/es/locales/en-US.d.ts +14 -0
- package/es/locales/en-US.js +16 -0
- package/es/locales/zh-CN.d.ts +14 -0
- package/es/locales/zh-CN.js +16 -0
- package/es/locales/zh-TW.d.ts +14 -0
- package/es/locales/zh-TW.js +16 -0
- package/es/theme/tokens.js +105 -125
- package/lib/components/PisellSuperTabs/PisellSuperTabs.d.ts +1 -1
- package/lib/components/PisellSuperTabs/PisellSuperTabs.js +6 -4
- package/lib/components/PisellSuperTabs/hooks/useTabsState.js +1 -2
- package/lib/components/PisellSuperTabs/types.d.ts +2 -0
- package/lib/components/PisellTabbar/PisellTabbar.d.ts +1 -1
- package/lib/components/PisellTabbar/PisellTabbar.js +515 -139
- package/lib/components/PisellTabbar/constants.d.ts +2 -1
- package/lib/components/PisellTabbar/constants.js +5 -4
- package/lib/components/PisellTabbar/hooks/useActiveKey.d.ts +6 -0
- package/lib/components/PisellTabbar/hooks/useActiveKey.js +14 -1
- package/lib/components/PisellTabbar/hooks/useExpand.d.ts +1 -0
- package/lib/components/PisellTabbar/hooks/useExpand.js +9 -1
- package/lib/components/PisellTabbar/types.d.ts +5 -26
- package/lib/components/PisellTabbar/utils/index.d.ts +2 -1
- package/lib/components/PisellTabbar/utils/index.js +2 -1
- package/lib/components/page/index.js +3 -0
- package/lib/components/pisellDateTimeDisplay/index.d.ts +1 -0
- package/lib/components/pisellDateTimeDisplay/index.js +3 -1
- package/lib/components/pisellEmail/PisellEmail.less +2 -2
- package/lib/components/pisellFind/PisellFind.stories.d.ts +45 -0
- package/lib/components/pisellFind/PisellFind.stories.js +343 -0
- package/lib/components/pisellFind/index.d.ts +40 -0
- package/lib/components/{PisellTabbar/components → pisellFind}/index.js +36 -7
- package/lib/components/pisellLongText/PisellLongText.less +2 -2
- package/lib/components/pisellLookup/PisellLookup.d.ts +4 -0
- package/lib/components/pisellLookup/PisellLookup.js +434 -0
- package/lib/components/pisellLookup/PisellLookup.less +640 -0
- package/lib/components/pisellLookup/PisellLookup.stories.d.ts +129 -0
- package/lib/components/pisellLookup/PisellLookup.stories.js +631 -0
- package/lib/components/pisellLookup/components/HotWords.d.ts +7 -0
- package/lib/components/pisellLookup/components/HotWords.js +63 -0
- package/lib/components/pisellLookup/components/LookupAuxiliary.d.ts +7 -0
- package/lib/components/pisellLookup/components/LookupAuxiliary.js +93 -0
- package/lib/components/pisellLookup/components/LookupResultHost.d.ts +7 -0
- package/lib/components/pisellLookup/components/LookupResultHost.js +190 -0
- package/lib/components/pisellLookup/components/LookupTrigger.d.ts +3 -0
- package/lib/components/pisellLookup/components/LookupTrigger.js +255 -0
- package/lib/components/pisellLookup/components/SearchHistory.d.ts +7 -0
- package/lib/components/pisellLookup/components/SearchHistory.js +73 -0
- package/lib/components/pisellLookup/components/SuggestWords.d.ts +7 -0
- package/lib/components/pisellLookup/components/SuggestWords.js +71 -0
- package/lib/components/pisellLookup/components/index.d.ts +9 -0
- package/lib/components/pisellLookup/components/index.js +44 -0
- package/lib/components/pisellLookup/hooks/index.d.ts +6 -0
- package/lib/components/pisellLookup/hooks/index.js +27 -0
- package/lib/components/pisellLookup/hooks/useDebounceSearch.d.ts +40 -0
- package/lib/components/pisellLookup/hooks/useDebounceSearch.js +66 -0
- package/lib/components/pisellLookup/hooks/useSearchHistory.d.ts +48 -0
- package/lib/components/pisellLookup/hooks/useSearchHistory.js +107 -0
- package/lib/components/pisellLookup/hooks/useSearchState.d.ts +80 -0
- package/lib/components/pisellLookup/hooks/useSearchState.js +91 -0
- package/lib/components/pisellLookup/index.d.ts +6 -0
- package/lib/components/pisellLookup/index.js +29 -0
- package/lib/components/pisellLookup/types.d.ts +666 -0
- package/lib/components/pisellLookup/types.js +17 -0
- package/lib/components/pisellLookup/utils/index.d.ts +5 -0
- package/lib/components/pisellLookup/utils/index.js +25 -0
- package/lib/components/pisellLookup/utils/storage.d.ts +42 -0
- package/lib/components/pisellLookup/utils/storage.js +96 -0
- package/lib/components/pisellLookup/utils/trigger.d.ts +42 -0
- package/lib/components/pisellLookup/utils/trigger.js +66 -0
- package/lib/components/pisellMultipleSelect/PisellMultipleSelect.less +7 -7
- package/lib/components/pisellSingleLineText/PisellSingleLineText.less +143 -4
- package/lib/components/pisellSingleSelect/PisellSingleSelect.less +6 -6
- package/lib/components/pisellUrl/PisellUrl.less +1 -1
- package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.js +6 -0
- package/lib/locales/en-US.d.ts +14 -0
- package/lib/locales/en-US.js +16 -0
- package/lib/locales/zh-CN.d.ts +14 -0
- package/lib/locales/zh-CN.js +16 -0
- package/lib/locales/zh-TW.d.ts +14 -0
- package/lib/locales/zh-TW.js +16 -0
- package/lib/theme/tokens.js +105 -114
- package/lowcode/pisell-find/meta.ts +365 -0
- package/lowcode/pisell-find/snippets.ts +37 -0
- package/lowcode/pisell-lookup/meta.ts +845 -0
- package/lowcode/pisell-lookup/snippets.ts +93 -0
- package/package.json +1 -1
- package/es/components/PisellTabbar/components/TabbarLevel.d.ts +0 -8
- package/es/components/PisellTabbar/components/TabbarLevel.js +0 -275
- package/es/components/PisellTabbar/components/index.d.ts +0 -1
- package/es/components/PisellTabbar/components/index.js +0 -2
- package/lib/components/PisellTabbar/components/TabbarLevel.d.ts +0 -8
- package/lib/components/PisellTabbar/components/TabbarLevel.js +0 -295
- package/lib/components/PisellTabbar/components/index.d.ts +0 -1
|
@@ -29,7 +29,7 @@ var import_locales = require("../../locales");
|
|
|
29
29
|
var DEFAULT_LEVEL_CONFIG = {
|
|
30
30
|
level1: {
|
|
31
31
|
superTabsBg: "#3b2865",
|
|
32
|
-
cardWidth:
|
|
32
|
+
cardWidth: 106,
|
|
33
33
|
cardHeight: 60,
|
|
34
34
|
paddingLeft: 0
|
|
35
35
|
},
|
|
@@ -69,8 +69,9 @@ var DEFAULT_ITEMS = {
|
|
|
69
69
|
id: "-1",
|
|
70
70
|
shop_id: 9,
|
|
71
71
|
parent_id: 0,
|
|
72
|
-
name: "
|
|
73
|
-
|
|
72
|
+
name: (0, import_locales.getText)("table-filter-search"),
|
|
73
|
+
text: (0, import_locales.getText)("table-filter-search"),
|
|
74
|
+
slug: "search",
|
|
74
75
|
key: "search",
|
|
75
76
|
icon: "",
|
|
76
77
|
customClick: true
|
|
@@ -87,7 +88,7 @@ var DEFAULT_ITEMS = {
|
|
|
87
88
|
}
|
|
88
89
|
};
|
|
89
90
|
var LEVEL_ADD_ITEMS = {
|
|
90
|
-
level1: ["expand"],
|
|
91
|
+
level1: ["search", "expand"],
|
|
91
92
|
level2: ["expand", "all"],
|
|
92
93
|
level3: ["expand", "all"]
|
|
93
94
|
};
|
|
@@ -19,6 +19,12 @@ interface UseActiveKeyReturn {
|
|
|
19
19
|
getActiveKey: (level: number) => string | number;
|
|
20
20
|
/** 内部设置方法(用于同步外部值) */
|
|
21
21
|
_setActiveKey: (value: (string | number)[]) => void;
|
|
22
|
+
/** 设置缓存key */
|
|
23
|
+
setCacheActiveKey: (val: (string | number)[]) => void;
|
|
24
|
+
/** 重置value为缓存key */
|
|
25
|
+
resetActiveKey: () => void;
|
|
26
|
+
/** 获取缓存key */
|
|
27
|
+
getCacheActiveKey: () => (string | number)[];
|
|
22
28
|
}
|
|
23
29
|
/**
|
|
24
30
|
* Tabbar 激活状态管理 Hook
|
|
@@ -26,6 +26,16 @@ var import_react = require("react");
|
|
|
26
26
|
var useActiveKey = (props) => {
|
|
27
27
|
const { initialActiveKey = [], onChange } = props;
|
|
28
28
|
const [activeKey, _setActiveKey] = (0, import_react.useState)(initialActiveKey);
|
|
29
|
+
const cacheActiveKey = (0, import_react.useRef)([]);
|
|
30
|
+
const setCacheActiveKey = (val) => {
|
|
31
|
+
cacheActiveKey.current = [...val];
|
|
32
|
+
};
|
|
33
|
+
const resetActiveKey = () => {
|
|
34
|
+
let val = cacheActiveKey.current;
|
|
35
|
+
_setActiveKey(val);
|
|
36
|
+
onChange == null ? void 0 : onChange(val);
|
|
37
|
+
cacheActiveKey.current = [];
|
|
38
|
+
};
|
|
29
39
|
const setActiveKey = (level, key, cKey) => {
|
|
30
40
|
const newActiveKey = [...activeKey];
|
|
31
41
|
newActiveKey.splice(level + 1);
|
|
@@ -37,12 +47,15 @@ var useActiveKey = (props) => {
|
|
|
37
47
|
onChange == null ? void 0 : onChange(newActiveKey);
|
|
38
48
|
};
|
|
39
49
|
const getActiveKey = (level) => {
|
|
40
|
-
return activeKey[level];
|
|
50
|
+
return activeKey == null ? void 0 : activeKey[level];
|
|
41
51
|
};
|
|
42
52
|
return {
|
|
43
53
|
activeKey,
|
|
44
54
|
setActiveKey,
|
|
45
55
|
getActiveKey,
|
|
56
|
+
resetActiveKey,
|
|
57
|
+
getCacheActiveKey: () => cacheActiveKey.current,
|
|
58
|
+
setCacheActiveKey,
|
|
46
59
|
/**
|
|
47
60
|
* 内部设置方法,用于同步外部传入的 value
|
|
48
61
|
* 会进行深比较,避免不必要的更新
|
|
@@ -37,6 +37,13 @@ var useExpand = (props = {}) => {
|
|
|
37
37
|
[level]: !prev[level]
|
|
38
38
|
}));
|
|
39
39
|
}, []);
|
|
40
|
+
const closeAll = () => {
|
|
41
|
+
setExpand({
|
|
42
|
+
level1: false,
|
|
43
|
+
level2: false,
|
|
44
|
+
level3: false
|
|
45
|
+
});
|
|
46
|
+
};
|
|
40
47
|
const getExpand = (0, import_react.useCallback)(
|
|
41
48
|
(level) => {
|
|
42
49
|
return expand[level];
|
|
@@ -47,7 +54,8 @@ var useExpand = (props = {}) => {
|
|
|
47
54
|
expand,
|
|
48
55
|
setExpand,
|
|
49
56
|
toggleExpand,
|
|
50
|
-
getExpand
|
|
57
|
+
getExpand,
|
|
58
|
+
closeAll
|
|
51
59
|
};
|
|
52
60
|
};
|
|
53
61
|
var useExpand_default = useExpand;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Tabbar 数据源项类型
|
|
4
4
|
*/
|
|
@@ -62,31 +62,6 @@ export interface ExpandState {
|
|
|
62
62
|
* 层级类型
|
|
63
63
|
*/
|
|
64
64
|
export declare type LevelType = 'level1' | 'level2' | 'level3';
|
|
65
|
-
/**
|
|
66
|
-
* TabbarLevel 组件属性
|
|
67
|
-
*/
|
|
68
|
-
export interface TabbarLevelProps {
|
|
69
|
-
/** SKU ID */
|
|
70
|
-
skuId: string;
|
|
71
|
-
/** 数据源 */
|
|
72
|
-
dataSource: TabbarDataSource[];
|
|
73
|
-
/** 当前激活的面板 key */
|
|
74
|
-
activePanelKey: string | number;
|
|
75
|
-
/** 层级 */
|
|
76
|
-
level: LevelType;
|
|
77
|
-
/** 设置激活面板 key */
|
|
78
|
-
setActivePanelKey: (key: string | number, item?: TabbarDataSource) => void;
|
|
79
|
-
/** 是否展开 */
|
|
80
|
-
expand: boolean;
|
|
81
|
-
/** 展开处理函数 */
|
|
82
|
-
handleExpand: () => void;
|
|
83
|
-
/** 渲染子级内容 */
|
|
84
|
-
renderChildren?: (panelProps: any) => ReactNode;
|
|
85
|
-
/** 层级配置 */
|
|
86
|
-
levelConfig?: TabbarLevelConfig;
|
|
87
|
-
/** 展开配置 */
|
|
88
|
-
expandConfig?: ExpandConfig;
|
|
89
|
-
}
|
|
90
65
|
/**
|
|
91
66
|
* PisellTabbar 组件属性
|
|
92
67
|
*/
|
|
@@ -107,5 +82,9 @@ export interface PisellTabbarProps {
|
|
|
107
82
|
expandConfig?: ExpandConfig;
|
|
108
83
|
/** 最大层级数 */
|
|
109
84
|
maxLevel?: 1 | 2 | 3;
|
|
85
|
+
onSearch?: (value: string) => void;
|
|
110
86
|
__designMode?: boolean;
|
|
111
87
|
}
|
|
88
|
+
export interface PisellTabbarRef {
|
|
89
|
+
closeSearchMode: () => void;
|
|
90
|
+
}
|
|
@@ -98,6 +98,9 @@ var Page = (props) => {
|
|
|
98
98
|
});
|
|
99
99
|
}, [platform, themeColor]);
|
|
100
100
|
const PisellConfigProvid = isRenderPisellConfigProvider ? import_pisell_config_provider.default : import_react.default.Fragment;
|
|
101
|
+
(0, import_react.useEffect)(() => {
|
|
102
|
+
document.body.id = "body";
|
|
103
|
+
}, []);
|
|
101
104
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
102
105
|
import_config_provider.default,
|
|
103
106
|
{
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { default as PisellDateTimeDisplay } from './PisellDateTimeDisplay';
|
|
2
2
|
export type { PisellDateTimeDisplayProps, LayoutDirection, DateOrder, TextAlign, FieldType, TimeFormatConfig, DateFormatConfig, WeekdayFormatConfig, FieldConfig, TextStyleConfig, ContainerStyleConfig, } from './types';
|
|
3
|
+
export { default } from './PisellDateTimeDisplay';
|
|
@@ -29,10 +29,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/components/pisellDateTimeDisplay/index.tsx
|
|
30
30
|
var pisellDateTimeDisplay_exports = {};
|
|
31
31
|
__export(pisellDateTimeDisplay_exports, {
|
|
32
|
-
PisellDateTimeDisplay: () => import_PisellDateTimeDisplay.default
|
|
32
|
+
PisellDateTimeDisplay: () => import_PisellDateTimeDisplay.default,
|
|
33
|
+
default: () => import_PisellDateTimeDisplay2.default
|
|
33
34
|
});
|
|
34
35
|
module.exports = __toCommonJS(pisellDateTimeDisplay_exports);
|
|
35
36
|
var import_PisellDateTimeDisplay = __toESM(require("./PisellDateTimeDisplay"));
|
|
37
|
+
var import_PisellDateTimeDisplay2 = __toESM(require("./PisellDateTimeDisplay"));
|
|
36
38
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37
39
|
0 && (module.exports = {
|
|
38
40
|
PisellDateTimeDisplay
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
align-items: center;
|
|
21
21
|
|
|
22
22
|
// 链接样式
|
|
23
|
-
.
|
|
23
|
+
.pisell-lowcode-typography-link {
|
|
24
24
|
cursor: pointer;
|
|
25
25
|
transition: all 0.3s;
|
|
26
26
|
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
// AutoComplete 下拉样式优化
|
|
44
44
|
.pisell-email-autocomplete-dropdown {
|
|
45
|
-
.
|
|
45
|
+
.pisell-lowcode-select-item-option-content {
|
|
46
46
|
display: flex;
|
|
47
47
|
align-items: center;
|
|
48
48
|
gap: 8px;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { PisellFind } from './index';
|
|
3
|
+
/**
|
|
4
|
+
* PisellFind 组件 Storybook
|
|
5
|
+
* 基于 PisellLookup 的组件内查找优化版本
|
|
6
|
+
*/
|
|
7
|
+
declare const meta: Meta<typeof PisellFind>;
|
|
8
|
+
export default meta;
|
|
9
|
+
declare type Story = StoryObj<typeof PisellFind>;
|
|
10
|
+
/**
|
|
11
|
+
* 基础示例 - 列表查找
|
|
12
|
+
*/
|
|
13
|
+
export declare const Basic: Story;
|
|
14
|
+
/**
|
|
15
|
+
* 表格查找
|
|
16
|
+
*/
|
|
17
|
+
export declare const TableFind: Story;
|
|
18
|
+
/**
|
|
19
|
+
* Input 模式查找
|
|
20
|
+
*/
|
|
21
|
+
export declare const InputMode: Story;
|
|
22
|
+
/**
|
|
23
|
+
* 使用 Ref 控制
|
|
24
|
+
*/
|
|
25
|
+
export declare const WithRef: Story;
|
|
26
|
+
/**
|
|
27
|
+
* 显示确认按钮
|
|
28
|
+
*/
|
|
29
|
+
export declare const WithConfirmButton: Story;
|
|
30
|
+
/**
|
|
31
|
+
* 关闭历史记录
|
|
32
|
+
*/
|
|
33
|
+
export declare const NoHistory: Story;
|
|
34
|
+
/**
|
|
35
|
+
* 多字段搜索
|
|
36
|
+
*/
|
|
37
|
+
export declare const MultiFieldSearch: Story;
|
|
38
|
+
/**
|
|
39
|
+
* Drawer 模式
|
|
40
|
+
*/
|
|
41
|
+
export declare const DrawerMode: Story;
|
|
42
|
+
/**
|
|
43
|
+
* Playground - 自由配置
|
|
44
|
+
*/
|
|
45
|
+
export declare const Playground: Story;
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellFind/PisellFind.stories.tsx
|
|
30
|
+
var PisellFind_stories_exports = {};
|
|
31
|
+
__export(PisellFind_stories_exports, {
|
|
32
|
+
Basic: () => Basic,
|
|
33
|
+
DrawerMode: () => DrawerMode,
|
|
34
|
+
InputMode: () => InputMode,
|
|
35
|
+
MultiFieldSearch: () => MultiFieldSearch,
|
|
36
|
+
NoHistory: () => NoHistory,
|
|
37
|
+
Playground: () => Playground,
|
|
38
|
+
TableFind: () => TableFind,
|
|
39
|
+
WithConfirmButton: () => WithConfirmButton,
|
|
40
|
+
WithRef: () => WithRef,
|
|
41
|
+
default: () => PisellFind_stories_default
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(PisellFind_stories_exports);
|
|
44
|
+
var import_react = __toESM(require("react"));
|
|
45
|
+
var import_index = require("./index");
|
|
46
|
+
var import_antd = require("antd");
|
|
47
|
+
var meta = {
|
|
48
|
+
title: "Plus Components/PisellFind",
|
|
49
|
+
component: import_index.PisellFind,
|
|
50
|
+
parameters: {
|
|
51
|
+
layout: "padded",
|
|
52
|
+
docs: {
|
|
53
|
+
description: {
|
|
54
|
+
component: "基于 PisellLookup 的组件内查找组件,专门为已加载数据的查找场景优化。"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
tags: ["autodocs"]
|
|
59
|
+
};
|
|
60
|
+
var PisellFind_stories_default = meta;
|
|
61
|
+
var mockProducts = [
|
|
62
|
+
{ id: 1, name: "iPhone 15 Pro", price: 7999, category: "手机", stock: 100 },
|
|
63
|
+
{ id: 2, name: "iPhone 14", price: 5999, category: "手机", stock: 150 },
|
|
64
|
+
{ id: 3, name: "MacBook Pro", price: 12999, category: "电脑", stock: 50 },
|
|
65
|
+
{ id: 4, name: "MacBook Air", price: 7999, category: "电脑", stock: 80 },
|
|
66
|
+
{ id: 5, name: "iPad Air", price: 4799, category: "平板", stock: 120 },
|
|
67
|
+
{ id: 6, name: "iPad Pro", price: 6799, category: "平板", stock: 60 },
|
|
68
|
+
{ id: 7, name: "AirPods Pro", price: 1899, category: "耳机", stock: 200 },
|
|
69
|
+
{ id: 8, name: "Apple Watch", price: 2999, category: "手表", stock: 90 }
|
|
70
|
+
];
|
|
71
|
+
var Basic = {
|
|
72
|
+
render: () => {
|
|
73
|
+
const [filteredData, setFilteredData] = (0, import_react.useState)(mockProducts);
|
|
74
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 16 } }, /* @__PURE__ */ import_react.default.createElement(
|
|
75
|
+
import_index.PisellFind,
|
|
76
|
+
{
|
|
77
|
+
onSearch: (keyword) => {
|
|
78
|
+
const filtered = mockProducts.filter(
|
|
79
|
+
(item) => item.name.toLowerCase().includes(keyword.toLowerCase())
|
|
80
|
+
);
|
|
81
|
+
setFilteredData(filtered);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
)), /* @__PURE__ */ import_react.default.createElement(
|
|
85
|
+
import_antd.List,
|
|
86
|
+
{
|
|
87
|
+
dataSource: filteredData,
|
|
88
|
+
renderItem: (item) => /* @__PURE__ */ import_react.default.createElement(import_antd.List.Item, null, /* @__PURE__ */ import_react.default.createElement(
|
|
89
|
+
import_antd.List.Item.Meta,
|
|
90
|
+
{
|
|
91
|
+
title: item.name,
|
|
92
|
+
description: /* @__PURE__ */ import_react.default.createElement(import_antd.Space, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, { color: "blue" }, item.category), /* @__PURE__ */ import_react.default.createElement("span", { style: { color: "#ff4d4f", fontWeight: "bold" } }, "¥", item.price), /* @__PURE__ */ import_react.default.createElement("span", null, "库存: ", item.stock))
|
|
93
|
+
}
|
|
94
|
+
))
|
|
95
|
+
}
|
|
96
|
+
));
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
var TableFind = {
|
|
100
|
+
render: () => {
|
|
101
|
+
const [filteredData, setFilteredData] = (0, import_react.useState)(mockProducts);
|
|
102
|
+
const columns = [
|
|
103
|
+
{ title: "商品名称", dataIndex: "name", key: "name" },
|
|
104
|
+
{ title: "价格", dataIndex: "price", key: "price", render: (v) => `¥${v}` },
|
|
105
|
+
{ title: "分类", dataIndex: "category", key: "category", render: (v) => /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, null, v) },
|
|
106
|
+
{ title: "库存", dataIndex: "stock", key: "stock" }
|
|
107
|
+
];
|
|
108
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 16, display: "flex", justifyContent: "space-between", alignItems: "center" } }, /* @__PURE__ */ import_react.default.createElement("h3", null, "商品列表"), /* @__PURE__ */ import_react.default.createElement(
|
|
109
|
+
import_index.PisellFind,
|
|
110
|
+
{
|
|
111
|
+
onSearch: (keyword) => {
|
|
112
|
+
const filtered = mockProducts.filter(
|
|
113
|
+
(item) => item.name.toLowerCase().includes(keyword.toLowerCase())
|
|
114
|
+
);
|
|
115
|
+
setFilteredData(filtered);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
)), /* @__PURE__ */ import_react.default.createElement(
|
|
119
|
+
import_antd.Table,
|
|
120
|
+
{
|
|
121
|
+
dataSource: filteredData,
|
|
122
|
+
columns,
|
|
123
|
+
pagination: { pageSize: 10 }
|
|
124
|
+
}
|
|
125
|
+
));
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
var InputMode = {
|
|
129
|
+
render: () => {
|
|
130
|
+
const [filteredData, setFilteredData] = (0, import_react.useState)(mockProducts);
|
|
131
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 16 } }, /* @__PURE__ */ import_react.default.createElement(
|
|
132
|
+
import_index.PisellFind,
|
|
133
|
+
{
|
|
134
|
+
triggerType: "input",
|
|
135
|
+
placeholder: "搜索商品名称",
|
|
136
|
+
onSearch: (keyword) => {
|
|
137
|
+
const filtered = mockProducts.filter(
|
|
138
|
+
(item) => item.name.toLowerCase().includes(keyword.toLowerCase())
|
|
139
|
+
);
|
|
140
|
+
setFilteredData(filtered);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
)), /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 16 } }, filteredData.map((item) => /* @__PURE__ */ import_react.default.createElement(import_antd.Card, { key: item.id, size: "small" }, /* @__PURE__ */ import_react.default.createElement("h4", null, item.name), /* @__PURE__ */ import_react.default.createElement("p", { style: { color: "#ff4d4f", fontWeight: "bold" } }, "¥", item.price), /* @__PURE__ */ import_react.default.createElement(import_antd.Space, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, null, item.category), /* @__PURE__ */ import_react.default.createElement("span", null, "库存: ", item.stock))))));
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
var WithRef = {
|
|
147
|
+
render: () => {
|
|
148
|
+
const [filteredData, setFilteredData] = (0, import_react.useState)(mockProducts);
|
|
149
|
+
const findRef = (0, import_react.useRef)(null);
|
|
150
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { style: { marginBottom: 16 } }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: () => {
|
|
151
|
+
var _a;
|
|
152
|
+
return (_a = findRef.current) == null ? void 0 : _a.open();
|
|
153
|
+
} }, "打开查找"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: () => {
|
|
154
|
+
var _a;
|
|
155
|
+
return (_a = findRef.current) == null ? void 0 : _a.close();
|
|
156
|
+
} }, "关闭查找"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: () => {
|
|
157
|
+
var _a;
|
|
158
|
+
return (_a = findRef.current) == null ? void 0 : _a.setKeyword("iPhone");
|
|
159
|
+
} }, "搜索 iPhone"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: () => {
|
|
160
|
+
var _a;
|
|
161
|
+
const keyword = (_a = findRef.current) == null ? void 0 : _a.getKeyword();
|
|
162
|
+
alert(`当前关键词: ${keyword}`);
|
|
163
|
+
} }, "获取关键词")), /* @__PURE__ */ import_react.default.createElement(
|
|
164
|
+
import_index.PisellFind,
|
|
165
|
+
{
|
|
166
|
+
ref: findRef,
|
|
167
|
+
onSearch: (keyword) => {
|
|
168
|
+
const filtered = mockProducts.filter(
|
|
169
|
+
(item) => item.name.toLowerCase().includes(keyword.toLowerCase())
|
|
170
|
+
);
|
|
171
|
+
setFilteredData(filtered);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
175
|
+
import_antd.Table,
|
|
176
|
+
{
|
|
177
|
+
dataSource: filteredData,
|
|
178
|
+
columns: [
|
|
179
|
+
{ title: "商品名称", dataIndex: "name" },
|
|
180
|
+
{ title: "价格", dataIndex: "price", render: (v) => `¥${v}` }
|
|
181
|
+
],
|
|
182
|
+
style: { marginTop: 16 }
|
|
183
|
+
}
|
|
184
|
+
));
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
var WithConfirmButton = {
|
|
188
|
+
render: () => {
|
|
189
|
+
const [filteredData, setFilteredData] = (0, import_react.useState)(mockProducts);
|
|
190
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 16 } }, /* @__PURE__ */ import_react.default.createElement(
|
|
191
|
+
import_index.PisellFind,
|
|
192
|
+
{
|
|
193
|
+
showConfirmButton: true,
|
|
194
|
+
confirmButtonText: "Search",
|
|
195
|
+
onSearch: (keyword) => {
|
|
196
|
+
const filtered = mockProducts.filter(
|
|
197
|
+
(item) => item.name.toLowerCase().includes(keyword.toLowerCase())
|
|
198
|
+
);
|
|
199
|
+
setFilteredData(filtered);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
)), /* @__PURE__ */ import_react.default.createElement(
|
|
203
|
+
import_antd.List,
|
|
204
|
+
{
|
|
205
|
+
dataSource: filteredData,
|
|
206
|
+
renderItem: (item) => /* @__PURE__ */ import_react.default.createElement(import_antd.List.Item, null, /* @__PURE__ */ import_react.default.createElement(
|
|
207
|
+
import_antd.List.Item.Meta,
|
|
208
|
+
{
|
|
209
|
+
title: item.name,
|
|
210
|
+
description: `¥${item.price}`
|
|
211
|
+
}
|
|
212
|
+
))
|
|
213
|
+
}
|
|
214
|
+
));
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
var NoHistory = {
|
|
218
|
+
render: () => {
|
|
219
|
+
const [filteredData, setFilteredData] = (0, import_react.useState)(mockProducts);
|
|
220
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 16 } }, /* @__PURE__ */ import_react.default.createElement(
|
|
221
|
+
import_index.PisellFind,
|
|
222
|
+
{
|
|
223
|
+
showHistory: false,
|
|
224
|
+
onSearch: (keyword) => {
|
|
225
|
+
const filtered = mockProducts.filter(
|
|
226
|
+
(item) => item.name.toLowerCase().includes(keyword.toLowerCase())
|
|
227
|
+
);
|
|
228
|
+
setFilteredData(filtered);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
)), /* @__PURE__ */ import_react.default.createElement(
|
|
232
|
+
import_antd.List,
|
|
233
|
+
{
|
|
234
|
+
dataSource: filteredData,
|
|
235
|
+
renderItem: (item) => /* @__PURE__ */ import_react.default.createElement(import_antd.List.Item, null, item.name)
|
|
236
|
+
}
|
|
237
|
+
));
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
var MultiFieldSearch = {
|
|
241
|
+
render: () => {
|
|
242
|
+
const [filteredData, setFilteredData] = (0, import_react.useState)(mockProducts);
|
|
243
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 16 } }, /* @__PURE__ */ import_react.default.createElement(
|
|
244
|
+
import_index.PisellFind,
|
|
245
|
+
{
|
|
246
|
+
buttonText: "搜索商品",
|
|
247
|
+
onSearch: (keyword) => {
|
|
248
|
+
const kw = keyword.toLowerCase();
|
|
249
|
+
const filtered = mockProducts.filter(
|
|
250
|
+
(item) => item.name.toLowerCase().includes(kw) || item.category.toLowerCase().includes(kw)
|
|
251
|
+
);
|
|
252
|
+
setFilteredData(filtered);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
), /* @__PURE__ */ import_react.default.createElement("p", { style: { marginTop: 8, color: "#999", fontSize: 12 } }, "支持搜索商品名称和分类")), /* @__PURE__ */ import_react.default.createElement(
|
|
256
|
+
import_antd.Table,
|
|
257
|
+
{
|
|
258
|
+
dataSource: filteredData,
|
|
259
|
+
columns: [
|
|
260
|
+
{ title: "商品名称", dataIndex: "name" },
|
|
261
|
+
{ title: "价格", dataIndex: "price", render: (v) => `¥${v}` },
|
|
262
|
+
{ title: "分类", dataIndex: "category", render: (v) => /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, null, v) },
|
|
263
|
+
{ title: "库存", dataIndex: "stock" }
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
));
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
var DrawerMode = {
|
|
270
|
+
render: () => {
|
|
271
|
+
const [filteredData, setFilteredData] = (0, import_react.useState)(mockProducts);
|
|
272
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 16 } }, /* @__PURE__ */ import_react.default.createElement(
|
|
273
|
+
import_index.PisellFind,
|
|
274
|
+
{
|
|
275
|
+
displayType: "drawer",
|
|
276
|
+
drawerPlacement: "right",
|
|
277
|
+
onSearch: (keyword) => {
|
|
278
|
+
const filtered = mockProducts.filter(
|
|
279
|
+
(item) => item.name.toLowerCase().includes(keyword.toLowerCase())
|
|
280
|
+
);
|
|
281
|
+
setFilteredData(filtered);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
)), /* @__PURE__ */ import_react.default.createElement(
|
|
285
|
+
import_antd.List,
|
|
286
|
+
{
|
|
287
|
+
dataSource: filteredData,
|
|
288
|
+
renderItem: (item) => /* @__PURE__ */ import_react.default.createElement(import_antd.List.Item, null, /* @__PURE__ */ import_react.default.createElement(
|
|
289
|
+
import_antd.List.Item.Meta,
|
|
290
|
+
{
|
|
291
|
+
title: item.name,
|
|
292
|
+
description: `¥${item.price}`
|
|
293
|
+
}
|
|
294
|
+
))
|
|
295
|
+
}
|
|
296
|
+
));
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
var Playground = {
|
|
300
|
+
render: () => {
|
|
301
|
+
const [filteredData, setFilteredData] = (0, import_react.useState)(mockProducts);
|
|
302
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 16 } }, /* @__PURE__ */ import_react.default.createElement(
|
|
303
|
+
import_index.PisellFind,
|
|
304
|
+
{
|
|
305
|
+
triggerType: "button",
|
|
306
|
+
buttonText: "Find",
|
|
307
|
+
showConfirmButton: false,
|
|
308
|
+
showHistory: true,
|
|
309
|
+
maxHistoryCount: 10,
|
|
310
|
+
size: "middle",
|
|
311
|
+
disabled: false,
|
|
312
|
+
onSearch: (keyword) => {
|
|
313
|
+
const filtered = mockProducts.filter(
|
|
314
|
+
(item) => item.name.toLowerCase().includes(keyword.toLowerCase())
|
|
315
|
+
);
|
|
316
|
+
setFilteredData(filtered);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
)), /* @__PURE__ */ import_react.default.createElement(
|
|
320
|
+
import_antd.Table,
|
|
321
|
+
{
|
|
322
|
+
dataSource: filteredData,
|
|
323
|
+
columns: [
|
|
324
|
+
{ title: "商品名称", dataIndex: "name" },
|
|
325
|
+
{ title: "价格", dataIndex: "price", render: (v) => `¥${v}` },
|
|
326
|
+
{ title: "分类", dataIndex: "category", render: (v) => /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, null, v) }
|
|
327
|
+
]
|
|
328
|
+
}
|
|
329
|
+
));
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
333
|
+
0 && (module.exports = {
|
|
334
|
+
Basic,
|
|
335
|
+
DrawerMode,
|
|
336
|
+
InputMode,
|
|
337
|
+
MultiFieldSearch,
|
|
338
|
+
NoHistory,
|
|
339
|
+
Playground,
|
|
340
|
+
TableFind,
|
|
341
|
+
WithConfirmButton,
|
|
342
|
+
WithRef
|
|
343
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PisellLookupProps, PisellLookupRef } from '../pisellLookup';
|
|
3
|
+
/**
|
|
4
|
+
* PisellFind Props
|
|
5
|
+
* 继承 PisellLookup 的所有 Props
|
|
6
|
+
*/
|
|
7
|
+
export declare type PisellFindProps = PisellLookupProps;
|
|
8
|
+
/**
|
|
9
|
+
* PisellFind Ref
|
|
10
|
+
* 继承 PisellLookup 的所有 Ref 方法
|
|
11
|
+
*/
|
|
12
|
+
export declare type PisellFindRef = PisellLookupRef;
|
|
13
|
+
/**
|
|
14
|
+
* PisellFind 组件
|
|
15
|
+
* 基于 PisellLookup 的组件内查找优化版本
|
|
16
|
+
*
|
|
17
|
+
* 核心特点:
|
|
18
|
+
* - 默认使用 button 触发器
|
|
19
|
+
* - 默认不显示确认按钮(输入即搜索)
|
|
20
|
+
* - 默认开启搜索历史
|
|
21
|
+
* - 默认不展示结果区(结果在页面其他位置展示)
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* // 基础用法
|
|
26
|
+
* <PisellFind
|
|
27
|
+
* onSearch={(keyword) => {
|
|
28
|
+
* const filtered = data.filter(item => item.name.includes(keyword));
|
|
29
|
+
* setFilteredData(filtered);
|
|
30
|
+
* }}
|
|
31
|
+
* />
|
|
32
|
+
*
|
|
33
|
+
* // 切换为 Input 模式
|
|
34
|
+
* <PisellFind
|
|
35
|
+
* triggerType="input"
|
|
36
|
+
* onSearch={(keyword) => filterData(keyword)}
|
|
37
|
+
* />
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare const PisellFind: React.ForwardRefExoticComponent<PisellLookupProps & React.RefAttributes<PisellLookupRef>>;
|