@alicloud/console-components-search 0.2.6 → 0.2.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.
@@ -131,7 +131,7 @@ let options2 = [
131
131
  <SearchFilter
132
132
  dataSource={[
133
133
  {label: '实例名称', value: 'xxxxxx', dataIndex: 'name'},
134
- {value: [{tagKey: 'xxxx', tagValue: 'xxxxxx'}, {tagKey: 'xx2xx', tagValue: 'xxxxxx'}], dataIndex: 'tag'}
134
+ {value: [], dataIndex: 'tag'}
135
135
  ]}
136
136
  onChange={(deletedFilter, remainFilters)=> {
137
137
  console.log(deletedFilter, remainFilters);
package/doc-dist/10.js CHANGED
@@ -2,5 +2,5 @@
2
2
  if (!window.__CONSOLE_OS_GLOBAL_HOOK__){window.__CONSOLE_OS_GLOBAL_VARS_={};window.__CONSOLE_OS_GLOBAL_HOOK__ = function(id, resolver) {resolver(undefined, undefined, undefined, {window: window,location: location,history: history,document: document})};window.__CONSOLE_OS_GLOBAL_HOOK__.standalone = true}
3
3
  window.__CONSOLE_OS_GLOBAL_HOOK__("console-fe-test-rc-search-doc", function(require, module, exports, context){ var window = context.window;var location = context.location;var history = context.history;var document = context.document;with(window.__CONSOLE_OS_GLOBAL_VARS_) {
4
4
 
5
- (window["webpackJsonpconsole-fe-test-rc-search-doc"]=window["webpackJsonpconsole-fe-test-rc-search-doc"]||[]).push([[10],{681:function(e,a,n){"use strict";n.r(a),n.d(a,"demo",(function(){return v})),n.d(a,"meta",(function(){return g})),n.d(a,"code",(function(){return x})),n.d(a,"imports",(function(){return m})),n.d(a,"deps",(function(){return b}));var l={};n.r(l),n.d(l,"default",(function(){return i}));var t=n(5),o=n(1),r=n(0),c=n.n(r),d=n(63),u=n(64),p=[{label:"实例名称",dataIndex:"name",template:"input",templateProps:{placeholder:"按实例名称搜索",dataSource:[]},groupName:"test"},{label:"网络类型",dataIndex:"type",template:"select",templateProps:{placeholder:"请选择网络类型",dataSource:[{label:"A",value:"a"},{label:"B",value:"b"},{label:"C",value:"c"},{label:"D",value:"d"}]},groupName:"test"},{label:"付费类型",dataIndex:"pay",template:"multiple",templateProps:{placeholder:"请选择付费类型",dataSource:[{label:"A",value:"a"},{label:"B",value:"b"},{label:"C",value:"c"},{label:"D",value:"d"}]},groupName:"test2"}],s=[{label:"实例名称",dataIndex:"name",template:"input",templateProps:{placeholder:"按实例名称搜索",dataSource:[]}},{label:"网络类型",dataIndex:"type",template:"select",templateProps:{placeholder:"请选择网络类型",dataSource:[{label:"A",value:"a"},{label:"B",value:"b"},{label:"C",value:"c"},{label:"D",value:"d"}]}},{label:"付费类型",dataIndex:"pay",template:"multiple",templateProps:{placeholder:"请选择付费类型",dataSource:[{label:"A",value:"a"},{label:"B",value:"b"},{label:"C",value:"c"},{label:"D",value:"d"}]}}],i=function(e){var a=Object(r.useState)([]),n=Object(o.a)(a,2),l=n[0],i=n[1];return console.log(l),c.a.createElement(u.ConfigProvider,null,c.a.createElement("div",null,c.a.createElement(d.Search,{defaultDataIndex:"name",options:s,onSearch:function(e,a){console.log(e,a)},suggestions:[{label:"实例名称",children:["222222"]},"33333333"]}),c.a.createElement("br",null),c.a.createElement("br",null),c.a.createElement("div",null,"搜索条件成组"),c.a.createElement(d.Search,{defaultDataIndex:"name",options:p,onSearch:function(e,a,n){i([].concat(Object(t.a)(l),[n]))},suggestions:[{label:"实例名称",children:["222222"]},"33333333"]}),c.a.createElement("div",{style:{marginTop:8}},c.a.createElement(d.SearchFilter,{dataSource:l,onChange:function(e,a){i(a)}})),c.a.createElement("div",{style:{marginTop:8}},c.a.createElement(d.SearchFilter,{dataSource:[{label:"实例名称",value:"xxxxxx",dataIndex:"name"},{value:[{tagKey:"xxxx",tagValue:"xxxxxx"},{tagKey:"xx2xx",tagValue:"xxxxxx"}],dataIndex:"tag"}],onChange:function(e,a){console.log(e,a)}}))))};const m=["react","@alicloud/console-components-search","@alicloud/console-components","react"],x="/**\n * @title 场景1\n */\n\nimport React from \"react\";\nimport { Search, SearchFilter } from \"@alicloud/console-components-search\";\nimport { ConfigProvider } from \"@alicloud/console-components\";\nimport { useState } from \"react\";\n \n let options = [\n {\n label: '实例名称',\n dataIndex: 'name',\n template: 'input',\n templateProps: {\n placeholder: '按实例名称搜索',\n dataSource: []\n },\n groupName:\"test\"\n },\n {\n label: '网络类型',\n dataIndex: 'type',\n template: 'select',\n templateProps: {\n placeholder: '请选择网络类型',\n dataSource: [\n {label: 'A', value: 'a'},\n {label: 'B', value: 'b'},\n {label: 'C', value: 'c'},\n {label: 'D', value: 'd'},\n ]\n },\n groupName:\"test\"\n },\n {\n label: '付费类型',\n dataIndex: 'pay',\n template: 'multiple',\n templateProps: {\n placeholder: '请选择付费类型',\n dataSource: [\n {label: 'A', value: 'a'},\n {label: 'B', value: 'b'},\n {label: 'C', value: 'c'},\n {label: 'D', value: 'd'},\n ]\n },\n groupName:\"test2\"\n }\n]\n\nlet options2 = [\n {\n label: '实例名称',\n dataIndex: 'name',\n template: 'input',\n templateProps: {\n placeholder: '按实例名称搜索',\n dataSource: []\n },\n },\n {\n label: '网络类型',\n dataIndex: 'type',\n template: 'select',\n templateProps: {\n placeholder: '请选择网络类型',\n dataSource: [\n {label: 'A', value: 'a'},\n {label: 'B', value: 'b'},\n {label: 'C', value: 'c'},\n {label: 'D', value: 'd'},\n ]\n },\n },\n {\n label: '付费类型',\n dataIndex: 'pay',\n template: 'multiple',\n templateProps: {\n placeholder: '请选择付费类型',\n dataSource: [\n {label: 'A', value: 'a'},\n {label: 'B', value: 'b'},\n {label: 'C', value: 'c'},\n {label: 'D', value: 'd'},\n ]\n },\n }\n]\n\n\n const Demo1: React.FC<{}> = (props) => {\n const [filters, setFilters] = useState<any>([]);\n console.log(filters)\n return (\n <ConfigProvider>\n <div>\n <Search\n defaultDataIndex=\"name\"\n options={options2}\n onSearch={(value, dataIndex) => {\n console.log(value, dataIndex)\n }}\n suggestions={[{label: '实例名称', children: ['222222']}, '33333333']}\n />\n <br/><br/>\n\n <div>搜索条件成组</div>\n <Search\n defaultDataIndex=\"name\"\n options={options}\n onSearch={(value, dataIndex, extra) => {\n //@ts-ignore\n setFilters([...filters, extra])\n }}\n suggestions={[{label: '实例名称', children: ['222222']}, '33333333']}\n />\n\n <div style={{marginTop: 8}}>\n <SearchFilter\n dataSource={filters}\n onChange={(deletedFilter, remainFilters)=> {\n setFilters(remainFilters)\n }}\n />\n </div>\n\n <div style={{marginTop: 8}}>\n <SearchFilter\n dataSource={[\n {label: '实例名称', value: 'xxxxxx', dataIndex: 'name'},\n {value: [{tagKey: 'xxxx', tagValue: 'xxxxxx'}, {tagKey: 'xx2xx', tagValue: 'xxxxxx'}], dataIndex: 'tag'}\n ]}\n onChange={(deletedFilter, remainFilters)=> {\n console.log(deletedFilter, remainFilters);\n }}\n />\n </div>\n </div>\n </ConfigProvider>\n );\n };\n \n export default Demo1;\n ",b={react:r,"@alicloud/console-components-search":d,"@alicloud/console-components":u,react:r},{default:v,meta:g={}}=l}}]);
5
+ (window["webpackJsonpconsole-fe-test-rc-search-doc"]=window["webpackJsonpconsole-fe-test-rc-search-doc"]||[]).push([[10],{681:function(e,a,n){"use strict";n.r(a),n.d(a,"demo",(function(){return h})),n.d(a,"meta",(function(){return x})),n.d(a,"code",(function(){return b})),n.d(a,"imports",(function(){return m})),n.d(a,"deps",(function(){return v}));var l={};n.r(l),n.d(l,"default",(function(){return i}));var t=n(5),o=n(1),r=n(0),c=n.n(r),d=n(63),u=n(64),p=[{label:"实例名称",dataIndex:"name",template:"input",templateProps:{placeholder:"按实例名称搜索",dataSource:[]},groupName:"test"},{label:"网络类型",dataIndex:"type",template:"select",templateProps:{placeholder:"请选择网络类型",dataSource:[{label:"A",value:"a"},{label:"B",value:"b"},{label:"C",value:"c"},{label:"D",value:"d"}]},groupName:"test"},{label:"付费类型",dataIndex:"pay",template:"multiple",templateProps:{placeholder:"请选择付费类型",dataSource:[{label:"A",value:"a"},{label:"B",value:"b"},{label:"C",value:"c"},{label:"D",value:"d"}]},groupName:"test2"}],s=[{label:"实例名称",dataIndex:"name",template:"input",templateProps:{placeholder:"按实例名称搜索",dataSource:[]}},{label:"网络类型",dataIndex:"type",template:"select",templateProps:{placeholder:"请选择网络类型",dataSource:[{label:"A",value:"a"},{label:"B",value:"b"},{label:"C",value:"c"},{label:"D",value:"d"}]}},{label:"付费类型",dataIndex:"pay",template:"multiple",templateProps:{placeholder:"请选择付费类型",dataSource:[{label:"A",value:"a"},{label:"B",value:"b"},{label:"C",value:"c"},{label:"D",value:"d"}]}}],i=function(e){var a=Object(r.useState)([]),n=Object(o.a)(a,2),l=n[0],i=n[1];return console.log(l),c.a.createElement(u.ConfigProvider,null,c.a.createElement("div",null,c.a.createElement(d.Search,{defaultDataIndex:"name",options:s,onSearch:function(e,a){console.log(e,a)},suggestions:[{label:"实例名称",children:["222222"]},"33333333"]}),c.a.createElement("br",null),c.a.createElement("br",null),c.a.createElement("div",null,"搜索条件成组"),c.a.createElement(d.Search,{defaultDataIndex:"name",options:p,onSearch:function(e,a,n){i([].concat(Object(t.a)(l),[n]))},suggestions:[{label:"实例名称",children:["222222"]},"33333333"]}),c.a.createElement("div",{style:{marginTop:8}},c.a.createElement(d.SearchFilter,{dataSource:l,onChange:function(e,a){i(a)}})),c.a.createElement("div",{style:{marginTop:8}},c.a.createElement(d.SearchFilter,{dataSource:[{label:"实例名称",value:"xxxxxx",dataIndex:"name"},{value:[],dataIndex:"tag"}],onChange:function(e,a){console.log(e,a)}}))))};const m=["react","@alicloud/console-components-search","@alicloud/console-components","react"],b="/**\n * @title 场景1\n */\n\nimport React from \"react\";\nimport { Search, SearchFilter } from \"@alicloud/console-components-search\";\nimport { ConfigProvider } from \"@alicloud/console-components\";\nimport { useState } from \"react\";\n \n let options = [\n {\n label: '实例名称',\n dataIndex: 'name',\n template: 'input',\n templateProps: {\n placeholder: '按实例名称搜索',\n dataSource: []\n },\n groupName:\"test\"\n },\n {\n label: '网络类型',\n dataIndex: 'type',\n template: 'select',\n templateProps: {\n placeholder: '请选择网络类型',\n dataSource: [\n {label: 'A', value: 'a'},\n {label: 'B', value: 'b'},\n {label: 'C', value: 'c'},\n {label: 'D', value: 'd'},\n ]\n },\n groupName:\"test\"\n },\n {\n label: '付费类型',\n dataIndex: 'pay',\n template: 'multiple',\n templateProps: {\n placeholder: '请选择付费类型',\n dataSource: [\n {label: 'A', value: 'a'},\n {label: 'B', value: 'b'},\n {label: 'C', value: 'c'},\n {label: 'D', value: 'd'},\n ]\n },\n groupName:\"test2\"\n }\n]\n\nlet options2 = [\n {\n label: '实例名称',\n dataIndex: 'name',\n template: 'input',\n templateProps: {\n placeholder: '按实例名称搜索',\n dataSource: []\n },\n },\n {\n label: '网络类型',\n dataIndex: 'type',\n template: 'select',\n templateProps: {\n placeholder: '请选择网络类型',\n dataSource: [\n {label: 'A', value: 'a'},\n {label: 'B', value: 'b'},\n {label: 'C', value: 'c'},\n {label: 'D', value: 'd'},\n ]\n },\n },\n {\n label: '付费类型',\n dataIndex: 'pay',\n template: 'multiple',\n templateProps: {\n placeholder: '请选择付费类型',\n dataSource: [\n {label: 'A', value: 'a'},\n {label: 'B', value: 'b'},\n {label: 'C', value: 'c'},\n {label: 'D', value: 'd'},\n ]\n },\n }\n]\n\n\n const Demo1: React.FC<{}> = (props) => {\n const [filters, setFilters] = useState<any>([]);\n console.log(filters)\n return (\n <ConfigProvider>\n <div>\n <Search\n defaultDataIndex=\"name\"\n options={options2}\n onSearch={(value, dataIndex) => {\n console.log(value, dataIndex)\n }}\n suggestions={[{label: '实例名称', children: ['222222']}, '33333333']}\n />\n <br/><br/>\n\n <div>搜索条件成组</div>\n <Search\n defaultDataIndex=\"name\"\n options={options}\n onSearch={(value, dataIndex, extra) => {\n //@ts-ignore\n setFilters([...filters, extra])\n }}\n suggestions={[{label: '实例名称', children: ['222222']}, '33333333']}\n />\n\n <div style={{marginTop: 8}}>\n <SearchFilter\n dataSource={filters}\n onChange={(deletedFilter, remainFilters)=> {\n setFilters(remainFilters)\n }}\n />\n </div>\n\n <div style={{marginTop: 8}}>\n <SearchFilter\n dataSource={[\n {label: '实例名称', value: 'xxxxxx', dataIndex: 'name'},\n {value: [], dataIndex: 'tag'}\n ]}\n onChange={(deletedFilter, remainFilters)=> {\n console.log(deletedFilter, remainFilters);\n }}\n />\n </div>\n </div>\n </ConfigProvider>\n );\n };\n \n export default Demo1;\n ",v={react:r,"@alicloud/console-components-search":d,"@alicloud/console-components":u,react:r},{default:h,meta:x={}}=l}}]);
6
6
  }})