@alicloud/console-components-search 0.1.3 → 0.2.0
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/README.md +104 -131
- package/config/components-with-style.tsx +1 -1
- package/demos/demo1.demo.tsx +91 -90
- package/doc-dist/0.js +1917 -16
- package/doc-dist/1.js +16 -1917
- package/doc-dist/10.js +1 -1
- package/doc-dist/11.js +1 -1
- package/doc-dist/12.js +1 -1
- package/doc-dist/13.js +1 -1
- package/doc-dist/14.js +1 -1
- package/doc-dist/15.js +1 -1
- package/doc-dist/3.js +5 -5
- package/doc-dist/4.js +1 -1
- package/doc-dist/5.js +2 -2
- package/doc-dist/6.js +1 -1
- package/doc-dist/7.js +1 -1
- package/doc-dist/8.js +1 -1
- package/doc-dist/9.js +1 -1
- package/doc-dist/deps/main.js +8 -8
- package/doc-dist/index.js +3 -3
- package/doc-dist/log-deps-build.log +3 -3
- package/es/index.js +1 -1
- package/es/modeSingleSingle/InputPrefix.js +29 -0
- package/es/modeSingleSingle/index2.js +342 -0
- package/es/search.js +2 -3
- package/es/searchTagList/index.js +5 -10
- package/es/style.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/modeSingleSingle/InputPrefix.d.ts +2 -0
- package/lib/modeSingleSingle/InputPrefix.js +43 -0
- package/lib/modeSingleSingle/index2.d.ts +4 -0
- package/lib/modeSingleSingle/index2.js +372 -0
- package/lib/search.js +2 -4
- package/lib/searchTagList/index.d.ts +3 -1
- package/lib/searchTagList/index.js +5 -11
- package/lib/style.js +1 -1
- package/lib/types/IRcSearchProps.type.d.ts +22 -21
- package/lib/types/IRcSearchTagItemProps.type.d.ts +1 -1
- package/lib/types/IRcSearchTagListProps.type.d.ts +3 -3
- package/package.json +1 -1
- package/demos/demo2.demo.tsx +0 -81
- package/demos/demo3.demo.tsx +0 -90
- package/demos/demo4.demo.tsx +0 -137
- package/dist/index.css +0 -1
- package/dist/index.js +0 -60
- package/doc-dist/16.js +0 -6
- package/doc-dist/17.js +0 -6
- package/doc-dist/18.js +0 -6
- package/doc-dist/19.js +0 -6
- package/doc-dist/20.js +0 -6
- package/docs/markdown-render.doc.md +0 -21
- package/docs/test.doc.md +0 -8
- package/es/modeSingleMulti/index.js +0 -868
- package/es/modeSingleSingle/index.js +0 -201
- package/lib/modeSingleMulti/index.d.ts +0 -2
- package/lib/modeSingleMulti/index.js +0 -894
- package/lib/modeSingleSingle/index.d.ts +0 -2
- package/lib/modeSingleSingle/index.js +0 -226
package/demos/demo3.demo.tsx
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @title 场景三 + 结合表格使用
|
|
3
|
-
* @describe 场景三:结合表格使用
|
|
4
|
-
* @canFullScreen
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, {useState} from "react";
|
|
8
|
-
import { Search, IRcSearchProps, SearchTagList } from "@alicloud/console-components-search";
|
|
9
|
-
import { Button, Table } from '@alicloud/console-components'
|
|
10
|
-
// interface IProps {}
|
|
11
|
-
let options = [
|
|
12
|
-
{
|
|
13
|
-
label: '实例名称',
|
|
14
|
-
dataIndex: 'name',
|
|
15
|
-
template: 'input',
|
|
16
|
-
templateProps: {
|
|
17
|
-
placeholder: '按实例名称搜索',
|
|
18
|
-
dataSource: []
|
|
19
|
-
},
|
|
20
|
-
groupName:"test"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
label: '网络类型',
|
|
24
|
-
dataIndex: 'type',
|
|
25
|
-
template: 'select',
|
|
26
|
-
templateProps: {
|
|
27
|
-
placeholder: '请选择网络类型',
|
|
28
|
-
dataSource: [
|
|
29
|
-
{label: 'A', value: 'a'},
|
|
30
|
-
{label: 'B', value: 'b'},
|
|
31
|
-
{label: 'C', value: 'c'},
|
|
32
|
-
{label: 'D', value: 'd'},
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
groupName:"test"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
label: '付费类型',
|
|
39
|
-
dataIndex: 'pay',
|
|
40
|
-
template: 'multiple',
|
|
41
|
-
templateProps: {
|
|
42
|
-
placeholder: '请选择付费类型',
|
|
43
|
-
dataSource: [
|
|
44
|
-
{label: 'A', value: 'a'},
|
|
45
|
-
{label: 'B', value: 'b'},
|
|
46
|
-
{label: 'C', value: 'c'},
|
|
47
|
-
{label: 'D', value: 'd'},
|
|
48
|
-
]
|
|
49
|
-
},
|
|
50
|
-
groupName:"test2"
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
|
|
54
|
-
const Demo3: React.FC<IRcSearchProps> = (props) => {
|
|
55
|
-
const [tagList, setTagList] = useState<any>([]);
|
|
56
|
-
|
|
57
|
-
async function onSearch (field:any) {
|
|
58
|
-
console.log(field)
|
|
59
|
-
setTagList(field);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<div>
|
|
64
|
-
<p>有默认分类: 实例名称</p>
|
|
65
|
-
<div>
|
|
66
|
-
<Button type="primary" style={{marginRight: '10px'}}>主按钮</Button>
|
|
67
|
-
<Search
|
|
68
|
-
defaultDataIndex="name"
|
|
69
|
-
options={options}
|
|
70
|
-
onSearch={onSearch}
|
|
71
|
-
tags={tagList}
|
|
72
|
-
style={{marginRight: '10px', width: '500px'}}
|
|
73
|
-
/>
|
|
74
|
-
<Button type="normal">普通按钮</Button>
|
|
75
|
-
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<SearchTagList regionId="demo" resourceType="demo" style={{marginTop: '8px'}} tagList={tagList}/>
|
|
79
|
-
|
|
80
|
-
<Table>
|
|
81
|
-
<Table.Column title="Key" dataIndex="key" />
|
|
82
|
-
<Table.Column title="实例ID/名称" dataIndex="id" />
|
|
83
|
-
<Table.Column title="状态" dataIndex="status" />
|
|
84
|
-
</Table>
|
|
85
|
-
</div>
|
|
86
|
-
|
|
87
|
-
)
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export default Demo3;
|
package/demos/demo4.demo.tsx
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @title 场景三 + 无默认类别
|
|
3
|
-
* @describe 场景四:无默认类别
|
|
4
|
-
* @canFullScreen
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, {useState} from "react";
|
|
8
|
-
import { Search, IRcSearchProps, SearchTagList } from "@alicloud/console-components-search";
|
|
9
|
-
import { Radio } from '@alicloud/console-components'
|
|
10
|
-
|
|
11
|
-
const RadioGroup = Radio.Group;
|
|
12
|
-
// interface IProps {}
|
|
13
|
-
let options = [
|
|
14
|
-
{
|
|
15
|
-
label: '实例名称',
|
|
16
|
-
dataIndex: 'name',
|
|
17
|
-
template: 'input',
|
|
18
|
-
templateProps: {
|
|
19
|
-
placeholder: '请输入',
|
|
20
|
-
dataSource: []
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
label: '密钥名称',
|
|
25
|
-
dataIndex: 'netkey',
|
|
26
|
-
template: 'input',
|
|
27
|
-
templateProps: {
|
|
28
|
-
placeholder: '请输入',
|
|
29
|
-
dataSource: []
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
label: '网络类型',
|
|
34
|
-
dataIndex: 'type',
|
|
35
|
-
template: 'select',
|
|
36
|
-
templateProps: {
|
|
37
|
-
placeholder: '请选择',
|
|
38
|
-
dataSource: [
|
|
39
|
-
{label: 'A', value: 'a'},
|
|
40
|
-
{label: 'B', value: 'b'},
|
|
41
|
-
{label: 'C', value: 'c'},
|
|
42
|
-
{label: 'D', value: 'd'},
|
|
43
|
-
]
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: '付费类型',
|
|
48
|
-
dataIndex: 'pay',
|
|
49
|
-
template: 'multiple',
|
|
50
|
-
templateProps: {
|
|
51
|
-
placeholder: '请选择',
|
|
52
|
-
dataSource: [
|
|
53
|
-
{label: 'A', value: 'a'},
|
|
54
|
-
{label: 'B', value: 'b'},
|
|
55
|
-
{label: 'C', value: 'c'},
|
|
56
|
-
{label: 'D', value: 'd'},
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
]
|
|
61
|
-
|
|
62
|
-
const Demo3: React.FC<IRcSearchProps> = (props) => {
|
|
63
|
-
const [tagList, setTagList] = useState<any>([]);
|
|
64
|
-
|
|
65
|
-
async function onSuggest (value: string, dataIndex: string) {
|
|
66
|
-
console.log()
|
|
67
|
-
if (!value) {
|
|
68
|
-
return [];
|
|
69
|
-
}
|
|
70
|
-
return [
|
|
71
|
-
// {label: value, value: `${dataIndex}-${value}`}
|
|
72
|
-
`${value}-1`,
|
|
73
|
-
`${value}-2`,
|
|
74
|
-
`${value}-3`,
|
|
75
|
-
`${value}-4`,
|
|
76
|
-
`${value}-5`,
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
async function onSuggestNoIndex (value: string) {
|
|
81
|
-
if (!value) {
|
|
82
|
-
return [];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return [
|
|
86
|
-
{
|
|
87
|
-
label: '实例名称',
|
|
88
|
-
dataIndex: 'name',
|
|
89
|
-
children: [
|
|
90
|
-
{label: `${value}-1`, value: `${value}-1`, dataIndex: 'name'},
|
|
91
|
-
{label: `${value}-2`, value: `${value}-2`, dataIndex: 'name'},
|
|
92
|
-
{label: `${value}-3`, value: `${value}-3`, dataIndex: 'name'},
|
|
93
|
-
]
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
label: '密钥名称',
|
|
97
|
-
dataIndex: 'netkey',
|
|
98
|
-
children: [
|
|
99
|
-
{label: `${value}-1`, value: `${value}-1`, dataIndex: 'name'},
|
|
100
|
-
{label: `${value}-2`, value: `${value}-2`, dataIndex: 'name'},
|
|
101
|
-
{label: `${value}-3`, value: `${value}-3`, dataIndex: 'name'},
|
|
102
|
-
]
|
|
103
|
-
}
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function onTagChange(newTags: any) {
|
|
108
|
-
console.log(`onTagChange:`, newTags);
|
|
109
|
-
setTagList(newTags);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
async function onSearch (allFileds:any) {
|
|
113
|
-
console.log(`onSearch:`, 'allFileds', allFileds)
|
|
114
|
-
console.log(`提交搜索: ${JSON.stringify(allFileds)}`)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return (
|
|
118
|
-
<div>
|
|
119
|
-
<p>无默认分类, 默认多类别搜索</p>
|
|
120
|
-
<Search
|
|
121
|
-
options={options}
|
|
122
|
-
regionId="demo"
|
|
123
|
-
resourceType="demo"
|
|
124
|
-
onSuggest={onSuggest}
|
|
125
|
-
defaultPlaceholder="请搜索"
|
|
126
|
-
onSuggestNoDataIndex={onSuggestNoIndex}
|
|
127
|
-
onSearch={onSearch}
|
|
128
|
-
tags={tagList}
|
|
129
|
-
/>
|
|
130
|
-
<SearchTagList regionId="demo" resourceType="demo" style={{marginTop: '8px'}} tagList={tagList} onChange={onTagChange} />
|
|
131
|
-
<br /><br /><br />
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
)
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
export default Demo3;
|
package/dist/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
body .xconsole-rcsearch-multi-pop .next-select-menu-item{padding-left:0!important}body .xconsole-rcsearch-multi-pop .next-select-menu-item .next-menu-icon-selected{display:none}body .xconsole-rcsearch-multi-pop .next-menu-group-label{padding-left:0}body .xconsole-rc-search-popup{margin-top:4px}
|