@alicloud/console-components-search 0.2.37-alpha.6 → 0.2.37-beta.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/CHANGELOG.md +7 -0
- package/demos/demo1.demo.tsx +81 -202
- package/dist/index.js +1641 -1662
- package/es/ComplexSearch/InputPrefix.js +3 -18
- package/es/ComplexSearch/index.js +19 -73
- package/es/message.js +1 -1
- package/es/search.js +2 -0
- package/lib/ComplexSearch/InputPrefix.js +2 -17
- package/lib/ComplexSearch/index.js +20 -73
- package/lib/message.js +1 -1
- package/lib/search.js +2 -0
- package/lib/types/IRcSearchOptions.type.d.ts +0 -2
- package/lib/types/IRcSearchProps.type.d.ts +0 -11
- package/package.json +1 -4
package/CHANGELOG.md
ADDED
package/demos/demo1.demo.tsx
CHANGED
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
* @title 场景1
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import React
|
|
6
|
-
import { Search, SearchFilter } from
|
|
7
|
-
import { ConfigProvider } from
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { Search, SearchFilter } from "@alicloud/console-components-search";
|
|
7
|
+
import { ConfigProvider } from "@alicloud/console-components";
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
|
|
10
|
+
let options = [
|
|
10
11
|
{
|
|
11
12
|
label: '实例名称',
|
|
12
13
|
dataIndex: 'name',
|
|
13
14
|
template: 'input',
|
|
14
15
|
templateProps: {
|
|
15
16
|
// placeholder: '按实例名称搜索',
|
|
16
|
-
dataSource: []
|
|
17
|
+
dataSource: []
|
|
17
18
|
},
|
|
19
|
+
groupName:"test"
|
|
18
20
|
},
|
|
19
21
|
{
|
|
20
22
|
label: '网络类型',
|
|
@@ -23,12 +25,13 @@ const options = [
|
|
|
23
25
|
templateProps: {
|
|
24
26
|
placeholder: '请选择网络类型',
|
|
25
27
|
dataSource: [
|
|
26
|
-
{
|
|
27
|
-
{
|
|
28
|
-
{
|
|
29
|
-
{
|
|
30
|
-
]
|
|
28
|
+
{label: 'A', value: 'a'},
|
|
29
|
+
{label: 'B', value: 'b'},
|
|
30
|
+
{label: 'C', value: 'c'},
|
|
31
|
+
{label: 'D', value: 'd'},
|
|
32
|
+
]
|
|
31
33
|
},
|
|
34
|
+
groupName:"test"
|
|
32
35
|
},
|
|
33
36
|
{
|
|
34
37
|
label: '付费类型',
|
|
@@ -37,212 +40,88 @@ const options = [
|
|
|
37
40
|
templateProps: {
|
|
38
41
|
placeholder: '请选择付费类型',
|
|
39
42
|
dataSource: [
|
|
40
|
-
{
|
|
41
|
-
{
|
|
42
|
-
{
|
|
43
|
-
{
|
|
44
|
-
]
|
|
43
|
+
{label: 'A', value: 'a'},
|
|
44
|
+
{label: 'B', value: 'b'},
|
|
45
|
+
{label: 'C', value: 'c'},
|
|
46
|
+
{label: 'D', value: 'd'},
|
|
47
|
+
]
|
|
45
48
|
},
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
groupName:"test2"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
48
52
|
|
|
49
|
-
|
|
53
|
+
let options2 = [
|
|
50
54
|
{
|
|
51
55
|
label: '实例名称',
|
|
52
56
|
dataIndex: 'name',
|
|
53
57
|
template: 'input',
|
|
54
58
|
templateProps: {
|
|
55
59
|
placeholder: '按实例名称搜索',
|
|
56
|
-
dataSource: []
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
];
|
|
60
|
-
|
|
61
|
-
const intl = (a) => a;
|
|
62
|
-
|
|
63
|
-
const options3 = [
|
|
64
|
-
{
|
|
65
|
-
dataIndex: 'SourceIp',
|
|
66
|
-
label: intl('flow_analysis.prop.enum', { value: 'SourceIp' }),
|
|
67
|
-
template: 'input',
|
|
68
|
-
// groupName: intl('flow_analysis.prop.enum', { value: 'SourceIp' }),
|
|
69
|
-
children: [
|
|
70
|
-
{
|
|
71
|
-
dataIndex: 'SourceIp_equal',
|
|
72
|
-
label: intl('flow_analysis.prop.enum', { value: 'SourceIp_equal' }),
|
|
73
|
-
template: 'input',
|
|
74
|
-
}, {
|
|
75
|
-
dataIndex: 'SourceIp_like',
|
|
76
|
-
label: intl('flow_analysis.prop.enum', { value: 'SourceIp_like' }),
|
|
77
|
-
template: 'input',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
dataIndex: 'SourceIp_notlike',
|
|
81
|
-
label: intl('flow_analysis.prop.enum', { value: 'SourceIp_notlike' }),
|
|
82
|
-
template: 'input',
|
|
83
|
-
// groupName: intl('flow_analysis.prop.enum', { value: 'SourceIp' }),
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
dataIndex: 'DestinationIp_equal',
|
|
89
|
-
label: intl('flow_analysis.prop.enum', { value: 'DestinationIp_equal' }),
|
|
90
|
-
labelEx: (
|
|
91
|
-
<div>
|
|
92
|
-
<span>
|
|
93
|
-
{intl('flow_analysis.prop.enum', { value: 'DestinationIp_equal' })}
|
|
94
|
-
</span>
|
|
95
|
-
<span>
|
|
96
|
-
{intl('tr_flow_log.search.operator.enum', { value: 'equal' })}
|
|
97
|
-
</span>
|
|
98
|
-
</div>
|
|
99
|
-
),
|
|
100
|
-
template: 'input',
|
|
101
|
-
groupName: intl('flow_analysis.prop.enum', { value: 'DestinationIp' }),
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
dataIndex: 'DestinationIp_like',
|
|
105
|
-
label: intl('flow_analysis.prop.enum', { value: 'DestinationIp_like' }),
|
|
106
|
-
labelEx: (
|
|
107
|
-
<div>
|
|
108
|
-
<span>
|
|
109
|
-
{intl('flow_analysis.prop.enum', { value: 'DestinationIp_like' })}
|
|
110
|
-
</span>
|
|
111
|
-
<span>
|
|
112
|
-
{intl('tr_flow_log.search.operator.enum', { value: 'like' })}
|
|
113
|
-
</span>
|
|
114
|
-
</div>
|
|
115
|
-
),
|
|
116
|
-
template: 'input',
|
|
117
|
-
groupName: intl('flow_analysis.prop.enum', { value: 'DestinationIp' }),
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
dataIndex: 'DestinationIp_notlike',
|
|
121
|
-
label: intl('flow_analysis.prop.enum', { value: 'DestinationIp_notlike' }),
|
|
122
|
-
labelEx: (
|
|
123
|
-
<div>
|
|
124
|
-
<span>
|
|
125
|
-
{intl('flow_analysis.prop.enum', { value: 'DestinationIp_notlike' })}
|
|
126
|
-
</span>
|
|
127
|
-
<span>
|
|
128
|
-
{intl('tr_flow_log.search.operator.enum', { value: 'notlike' })}
|
|
129
|
-
</span>
|
|
130
|
-
</div>
|
|
131
|
-
),
|
|
132
|
-
template: 'input',
|
|
133
|
-
groupName: intl('flow_analysis.prop.enum', { value: 'DestinationIp' }),
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
dataIndex: 'Dscp',
|
|
137
|
-
label: intl('flow_analysis.prop.enum', { value: 'Dscp' }),
|
|
138
|
-
template: 'input',
|
|
139
|
-
groupName: intl('flow_analysis.prop.enum', { value: 'Dscp' }),
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
dataIndex: 'Protocol',
|
|
143
|
-
label: intl('flow_analysis.prop.enum', { value: 'Protocol' }),
|
|
144
|
-
template: 'select',
|
|
145
|
-
templateProps: {
|
|
146
|
-
dataSource: [
|
|
147
|
-
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
|
148
|
-
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
|
149
|
-
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 62, 64, 65, 66, 67, 69, 70, 71, 72, 73,
|
|
150
|
-
74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
|
|
151
|
-
97, 98, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 115, 116, 117,
|
|
152
|
-
118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
|
|
153
|
-
136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 255,
|
|
154
|
-
].map((item) => ({
|
|
155
|
-
label: intl('flow_analyzer.detail.protocol.enum', { value: item }),
|
|
156
|
-
value: String(item),
|
|
157
|
-
})),
|
|
60
|
+
dataSource: []
|
|
158
61
|
},
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
{
|
|
162
|
-
dataIndex: 'DestinationPort',
|
|
163
|
-
label: intl('flow_analysis.prop.enum', { value: 'DestinationPort' }),
|
|
164
|
-
template: 'input',
|
|
165
|
-
groupName: intl('flow_analysis.prop.enum', { value: 'DestinationPort' }),
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
dataIndex: 'SourcePort',
|
|
169
|
-
label: intl('flow_analysis.prop.enum', { value: 'SourcePort' }),
|
|
170
|
-
template: 'input',
|
|
171
|
-
groupName: intl('flow_analysis.prop.enum', { value: 'SourcePort' }),
|
|
172
|
-
},
|
|
173
|
-
];
|
|
62
|
+
}
|
|
63
|
+
]
|
|
174
64
|
|
|
175
65
|
|
|
176
|
-
const Demo1: React.FC<{}> = (props) => {
|
|
177
|
-
|
|
178
|
-
{
|
|
179
|
-
{
|
|
180
|
-
{ value: [{ tagKey: 'test', tagValue: '' }], dataIndex: 'tag2' },
|
|
66
|
+
const Demo1: React.FC<{}> = (props) => {
|
|
67
|
+
const [filters, setFilters] = useState<any>([
|
|
68
|
+
{label: '实例名称', value: 'xxxxxx', dataIndex: 'name'},
|
|
69
|
+
{value: [{tagKey: 'test', tagValue: ''}], dataIndex: 'tag'}
|
|
181
70
|
]);
|
|
182
|
-
|
|
71
|
+
return (
|
|
183
72
|
<ConfigProvider>
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
73
|
+
<div>
|
|
74
|
+
<div>默认固定搜索条件</div>
|
|
75
|
+
<Search
|
|
76
|
+
defaultDataIndex="name"
|
|
77
|
+
defaultSelectedDataIndex="name"
|
|
78
|
+
options={[{
|
|
79
|
+
label: '实例名称',
|
|
80
|
+
dataIndex: 'name',
|
|
81
|
+
template: 'input',
|
|
82
|
+
templateProps: {
|
|
83
|
+
placeholder: '按实例名称搜索',
|
|
84
|
+
},
|
|
85
|
+
}]}
|
|
86
|
+
onSearch={(value, dataIndex) => {
|
|
87
|
+
console.log(value, dataIndex)
|
|
88
|
+
}}
|
|
89
|
+
/>
|
|
90
|
+
<br/><br/>
|
|
91
|
+
<Search
|
|
92
|
+
defaultDataIndex="name"
|
|
93
|
+
options={options2}
|
|
94
|
+
onSearch={(value, dataIndex) => {
|
|
95
|
+
console.log(value, dataIndex)
|
|
96
|
+
}}
|
|
97
|
+
suggestions={[{label: '实例名称', children: ['222222']}, '33333333']}
|
|
98
|
+
/>
|
|
99
|
+
<br/><br/>
|
|
211
100
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
// @ts-ignore
|
|
230
|
-
setFilters([...filters, extra]);
|
|
101
|
+
<div>搜索条件成组</div>
|
|
102
|
+
<Search
|
|
103
|
+
defaultDataIndex="name"
|
|
104
|
+
defaultSelectedDataIndex="name"
|
|
105
|
+
options={options}
|
|
106
|
+
onSearch={(value, dataIndex, extra) => {
|
|
107
|
+
//@ts-ignore
|
|
108
|
+
setFilters([...filters, extra])
|
|
109
|
+
}}
|
|
110
|
+
suggestions={[{label: '实例名称', children: ['222222']}, '33333333']}
|
|
111
|
+
/>
|
|
112
|
+
|
|
113
|
+
<div style={{marginTop: 8}}>
|
|
114
|
+
<SearchFilter
|
|
115
|
+
dataSource={filters}
|
|
116
|
+
onChange={(deletedFilter, remainFilters)=> {
|
|
117
|
+
setFilters(remainFilters)
|
|
231
118
|
}}
|
|
232
|
-
suggestions={[{ label: '实例名称', children: ['222222'] }, '33333333']}
|
|
233
119
|
/>
|
|
234
|
-
|
|
235
|
-
<div style={{ marginTop: 8 }}>
|
|
236
|
-
<SearchFilter
|
|
237
|
-
dataSource={filters}
|
|
238
|
-
onChange={(deletedFilter, remainFilters) => {
|
|
239
|
-
setFilters(remainFilters);
|
|
240
|
-
}}
|
|
241
|
-
/>
|
|
242
|
-
</div>
|
|
243
120
|
</div>
|
|
121
|
+
</div>
|
|
244
122
|
</ConfigProvider>
|
|
245
|
-
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
export default Demo1;
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export default Demo1;
|
|
127
|
+
|