@king-design/intact 3.1.0-beta.3 → 3.1.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/components/cascader/index.vdt +1 -0
- package/components/config/demos/basic.md +19 -0
- package/components/config/index.md +20 -0
- package/components/config/index.ts +8 -4
- package/components/dialog/index.spec.ts +41 -2
- package/components/drawer/index.spec.ts +4 -2
- package/components/icon/demos/icons.md +20 -9
- package/components/input/demos/blocks.md +16 -1
- package/components/input/styles.ts +2 -1
- package/components/portal.ts +6 -1
- package/components/table/styles.ts +2 -0
- package/components/tree/demos/expandAll.md +36 -8
- package/components/tree/index.md +1 -1
- package/components/tree/useExpanded.ts +14 -2
- package/components/treeSelect/index.md +1 -1
- package/components/upload/demos/files.md +14 -12
- package/components/upload/index.md +5 -5
- package/components/upload/index.ts +6 -5
- package/components/upload/useFiles.ts +19 -8
- package/es/components/cascader/index.vdt.js +1 -0
- package/es/components/config/index.d.ts +9 -2
- package/es/components/config/index.js +4 -3
- package/es/components/dialog/index.spec.js +87 -5
- package/es/components/drawer/index.spec.js +6 -4
- package/es/components/input/styles.js +1 -1
- package/es/components/portal.js +7 -1
- package/es/components/table/styles.js +3 -2
- package/es/components/tree/useExpanded.js +21 -6
- package/es/components/upload/index.d.ts +6 -5
- package/es/components/upload/index.js +1 -0
- package/es/components/upload/useFiles.js +21 -8
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/config/demos/basic/index.d.ts +5 -0
- package/es/site/data/components/config/demos/basic/index.js +17 -0
- package/es/site/data/components/config/demos/basic/react.d.ts +4 -0
- package/es/site/data/components/config/demos/basic/react.js +29 -0
- package/es/site/data/components/config/index.d.ts +57 -0
- package/es/site/data/components/config/index.js +42 -0
- package/es/site/data/components/icon/demos/icons/index.js +3 -2
- package/es/site/data/components/input/demos/blocks/react.js +11 -1
- package/es/site/data/components/tree/demos/draggable/react.js +1 -1
- package/es/site/data/components/tree/demos/expandAll/index.d.ts +9 -1
- package/es/site/data/components/tree/demos/expandAll/index.js +14 -2
- package/es/site/data/components/tree/demos/expandAll/react.d.ts +10 -1
- package/es/site/data/components/tree/demos/expandAll/react.js +24 -5
- package/es/site/data/components/upload/demos/files/index.d.ts +2 -5
- package/es/site/data/components/upload/demos/files/index.js +5 -1
- package/es/site/data/components/upload/demos/files/react.d.ts +2 -5
- package/es/site/data/components/upload/demos/files/react.js +13 -2
- package/es/site/src/pages/document/styles.js +1 -1
- package/index.ts +2 -2
- package/package.json +2 -2
- package/es/site/data/components/icon/demos/icons/react.d.ts +0 -15
- package/es/site/data/components/icon/demos/icons/react.js +0 -107
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import { __decorate } from "tslib";
|
|
2
3
|
export { default as data } from './index.json';
|
|
3
4
|
import { Component } from 'intact';
|
|
4
5
|
import template from './index.vdt';
|
|
6
|
+
import './index.styl';
|
|
7
|
+
import { bind } from 'kpc';
|
|
5
8
|
|
|
6
9
|
var default_1 = /*#__PURE__*/function (_Component) {
|
|
7
10
|
_inheritsLoose(default_1, _Component);
|
|
@@ -38,12 +41,21 @@ var default_1 = /*#__PURE__*/function (_Component) {
|
|
|
38
41
|
label: 'Third floor-2.2.1'
|
|
39
42
|
}]
|
|
40
43
|
}]
|
|
41
|
-
}]
|
|
44
|
+
}],
|
|
45
|
+
delayData: undefined
|
|
42
46
|
};
|
|
43
47
|
};
|
|
44
48
|
|
|
49
|
+
var _proto = default_1.prototype;
|
|
50
|
+
|
|
51
|
+
_proto.load = function load() {
|
|
52
|
+
this.set('delayData', this.get('data'));
|
|
53
|
+
};
|
|
54
|
+
|
|
45
55
|
return default_1;
|
|
46
56
|
}(Component);
|
|
47
57
|
|
|
48
58
|
default_1.template = template;
|
|
49
|
-
export { default_1 as default };
|
|
59
|
+
export { default_1 as default };
|
|
60
|
+
|
|
61
|
+
__decorate([bind], default_1.prototype, "load", null);
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import './index.styl';
|
|
3
|
+
import { TreeDataItem } from '@king-design/react';
|
|
4
|
+
interface Props {
|
|
5
|
+
data: TreeDataItem<string>[];
|
|
6
|
+
delayData?: TreeDataItem<string>[];
|
|
7
|
+
}
|
|
8
|
+
export default class Demo extends React.Component<{}, Props> {
|
|
3
9
|
state: {
|
|
4
10
|
data: ({
|
|
5
11
|
label: string;
|
|
@@ -31,6 +37,9 @@ export default class Demo extends React.Component {
|
|
|
31
37
|
}[];
|
|
32
38
|
})[];
|
|
33
39
|
})[];
|
|
40
|
+
delayData: undefined;
|
|
34
41
|
};
|
|
42
|
+
load(): void;
|
|
35
43
|
render(): JSX.Element;
|
|
36
44
|
}
|
|
45
|
+
export {};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
2
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
+
import { __decorate } from "tslib";
|
|
3
4
|
import React from 'react';
|
|
4
|
-
import { Tree } from '@king-design/react';
|
|
5
|
+
import { Tree, Button } from '@king-design/react';
|
|
6
|
+
import './index.styl';
|
|
7
|
+
import { bind } from '@king-design/react';
|
|
5
8
|
|
|
6
9
|
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
7
10
|
_inheritsLoose(Demo, _React$Component);
|
|
@@ -43,21 +46,37 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
43
46
|
label: 'Third floor-2.2.1'
|
|
44
47
|
}]
|
|
45
48
|
}]
|
|
46
|
-
}]
|
|
49
|
+
}],
|
|
50
|
+
delayData: undefined
|
|
47
51
|
};
|
|
48
52
|
return _this;
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
var _proto = Demo.prototype;
|
|
52
56
|
|
|
57
|
+
_proto.load = function load() {
|
|
58
|
+
this.setState({
|
|
59
|
+
delayData: this.state.data
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
53
63
|
_proto.render = function render() {
|
|
54
|
-
return /*#__PURE__*/React.createElement(
|
|
64
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: "wrapper"
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Tree, {
|
|
55
67
|
defaultExpandAll: true,
|
|
56
68
|
data: this.state.data
|
|
57
|
-
})
|
|
69
|
+
}), /*#__PURE__*/React.createElement(Tree, {
|
|
70
|
+
defaultExpandAll: true,
|
|
71
|
+
data: this.state.delayData
|
|
72
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
73
|
+
onClick: this.load
|
|
74
|
+
}, "\u52A0\u8F7D\u6570\u636E"));
|
|
58
75
|
};
|
|
59
76
|
|
|
60
77
|
return Demo;
|
|
61
78
|
}(React.Component);
|
|
62
79
|
|
|
63
|
-
export { Demo as default };
|
|
80
|
+
export { Demo as default };
|
|
81
|
+
|
|
82
|
+
__decorate([bind], Demo.prototype, "load", null);
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
export { default as data } from './index.json';
|
|
2
2
|
import { Component } from 'intact';
|
|
3
3
|
import './index.styl';
|
|
4
|
+
import { UploadFile } from 'kpc';
|
|
4
5
|
interface Props {
|
|
5
|
-
|
|
6
|
+
files?: UploadFile[];
|
|
6
7
|
}
|
|
7
|
-
declare type DefaultFile = {
|
|
8
|
-
name: string;
|
|
9
|
-
url: string;
|
|
10
|
-
};
|
|
11
8
|
export default class extends Component<Props> {
|
|
12
9
|
static template: string | import("intact").Template<any>;
|
|
13
10
|
static defaults(): Props;
|
|
@@ -3,6 +3,7 @@ export { default as data } from './index.json';
|
|
|
3
3
|
import { Component } from 'intact';
|
|
4
4
|
import template from './index.vdt';
|
|
5
5
|
import './index.styl';
|
|
6
|
+
import { UploadFileStatus } from 'kpc';
|
|
6
7
|
|
|
7
8
|
var default_1 = /*#__PURE__*/function (_Component) {
|
|
8
9
|
_inheritsLoose(default_1, _Component);
|
|
@@ -13,12 +14,15 @@ var default_1 = /*#__PURE__*/function (_Component) {
|
|
|
13
14
|
|
|
14
15
|
default_1.defaults = function defaults() {
|
|
15
16
|
return {
|
|
16
|
-
|
|
17
|
+
files: [{
|
|
17
18
|
name: 'test1.jpg',
|
|
18
19
|
url: 'http://www.example.com/test1.jpg'
|
|
19
20
|
}, {
|
|
20
21
|
name: 'test2.png',
|
|
21
22
|
url: 'http://www.example.com/test2.png'
|
|
23
|
+
}, {
|
|
24
|
+
name: 'test3.png',
|
|
25
|
+
status: UploadFileStatus.Error
|
|
22
26
|
}]
|
|
23
27
|
};
|
|
24
28
|
};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './index.styl';
|
|
3
|
+
import { UploadFile } from '@king-design/react';
|
|
3
4
|
interface Props {
|
|
4
|
-
|
|
5
|
+
files?: UploadFile[];
|
|
5
6
|
}
|
|
6
|
-
declare type DefaultFile = {
|
|
7
|
-
name: string;
|
|
8
|
-
url: string;
|
|
9
|
-
};
|
|
10
7
|
export default class Demo extends React.Component<{}, Props> {
|
|
11
8
|
state: Props;
|
|
12
9
|
render(): JSX.Element;
|
|
@@ -3,6 +3,7 @@ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/con
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Upload } from '@king-design/react';
|
|
5
5
|
import './index.styl';
|
|
6
|
+
import { UploadFileStatus } from '@king-design/react';
|
|
6
7
|
|
|
7
8
|
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
8
9
|
_inheritsLoose(Demo, _React$Component);
|
|
@@ -18,12 +19,15 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
18
19
|
|
|
19
20
|
_this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
20
21
|
_this.state = {
|
|
21
|
-
|
|
22
|
+
files: [{
|
|
22
23
|
name: 'test1.jpg',
|
|
23
24
|
url: 'http://www.example.com/test1.jpg'
|
|
24
25
|
}, {
|
|
25
26
|
name: 'test2.png',
|
|
26
27
|
url: 'http://www.example.com/test2.png'
|
|
28
|
+
}, {
|
|
29
|
+
name: 'test3.png',
|
|
30
|
+
status: UploadFileStatus.Error
|
|
27
31
|
}]
|
|
28
32
|
};
|
|
29
33
|
return _this;
|
|
@@ -32,10 +36,17 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
32
36
|
var _proto = Demo.prototype;
|
|
33
37
|
|
|
34
38
|
_proto.render = function render() {
|
|
39
|
+
var _this2 = this;
|
|
40
|
+
|
|
35
41
|
return /*#__PURE__*/React.createElement(Upload, {
|
|
36
42
|
multiple: true,
|
|
37
43
|
action: "//fakestoreapi.com/products",
|
|
38
|
-
|
|
44
|
+
files: this.state.files,
|
|
45
|
+
onChangeFiles: function onChangeFiles(files) {
|
|
46
|
+
return _this2.setState({
|
|
47
|
+
files: files
|
|
48
|
+
});
|
|
49
|
+
}
|
|
39
50
|
});
|
|
40
51
|
};
|
|
41
52
|
|
|
@@ -2,5 +2,5 @@ import { css } from '@emotion/css';
|
|
|
2
2
|
import { theme } from 'kpc/styles/theme';
|
|
3
3
|
import { makeStyles as makeTableStyles } from 'kpc/components/table/styles';
|
|
4
4
|
export function makeStyles(k) {
|
|
5
|
-
return /*#__PURE__*/css("h1,h2,h3,h4,h5{font-weight:400;color:#000;}h1{font-size:2em;}blockquote{margin:1em 0;padding:1px 2em;background:#f8f8f8;border-left:2px solid #ff4133;position:relative;line-height:2em;&:before{content:\"!\";display:block;position:absolute;top:50%;margin-top:-10px;width:20px;height:20px;border-radius:100
|
|
5
|
+
return /*#__PURE__*/css("h1,h2,h3,h4,h5{font-weight:400;color:#000;}h1{font-size:2em;}blockquote{margin:1em 0;padding:1px 2em;background:#f8f8f8;border-left:2px solid #ff4133;position:relative;line-height:2em;&:before{content:\"!\";display:block;position:absolute;top:50%;margin-top:-10px;width:20px;height:20px;border-radius:100%;text-align:center;background:#ff4133;color:#fff;line-height:20px;left:-11px;}}.", k, "-layout-aside{font-size:14px;overflow:visible!important;.aside-wrapper{overflow:auto;padding-bottom:10px;}.catalog-section{margin-top:10px;}h5{font-size:16px;margin:15px 0 15px 20px;color:#999;}ul{list-style:none;margin:0;padding:0;}a{display:flex;align-items:center;height:40px;padding-left:25px;color:#333;&:hover{background:#f3f3f3;color:#333;}span{margin-left:5px;color:#666;font-size:12px;}}.active{&>a,& span{color:#ffffff!important;background-color:", theme.color.primary, ";}}.", k, "-btn{display:none;}}.", k, "-layout-body{font-size:14px;max-width:100%;article{position:relative;padding:15px 40px;margin-right:200px;border-rardius:50%;}.article-head{display:flex;border-bottom:1px solid #e4e4e4;align-items:center;margin-bottom:27px;.title{font-size:30px;line-height:28px;font-weight:400;color:", theme.color.title, ";margin:19px 0;flex:1;white-space:nowrap;margin-right:16px;}.edit-link{color:#999;font-style:italic;font-size:12px;}}.browser-mockup{border-top:30px solid #eee;position:relative;border-radius:", theme.largeBorderRadius, ";box-shadow:", theme.boxShadow, ";&:before{display:block;content:'';box-shadow:0 0 0 2px ", theme.color.danger, ",21px 0 0 2px ", theme.color.success, ",42px 0 0 2px ", theme.color.warning, ";background:", theme.color.danger, ";position:absolute;width:7px;height:7px;border-radius:50%;top:-19px;left:19px;}&:after{content:'';display:block;height:20px;background:#fff;position:absolute;top:-26px;left:85px;width:calc(100% - 90px);border-radius:", theme.borderRadius, ";}}iframe{width:100%;border:none;display:block;}}.example{padding:0 20px 20px 20px;margin-bottom:20px;border:1px solid #eee;font-size:12px;position:relative;.example-title{position:absolute;top:-13px;left:15px;background:#fff;padding:0 10px;font-size:16px;color:#000;}}.example-opera{padding:40px 0 20px;}.example-desc{padding:5px;border-bottom:1px dashed #eee;border-top:1px dashed #eee;position:relative;}.example-code{position:relative;code{border:none;border-radius:0;}.open{position:absolute;padding:3px 10px;right:0;top:33px;cursor:pointer;&:hover{color:", theme.color.primary, ";}}}.api{font-size:12px;.", k, "-table{", makeTableStyles('k'), ";}table{table-layout:auto!important;}}@media (max-width: 768px){.table-of-contents{display:none;}.", k, "-layout-aside{transform:translateX(-260px);transition:transform ", theme.transition.middle, ";&.expanded{transform:translateX(0);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.3);}.", k, "-btn{display:block;position:absolute;top:66px;right:0;transform:translateX(100%);border:none;box-shadow:3px 0 4px 0 rgba(0, 0, 0, 0.3);}}.", k, "-layout-body{padding:0!important;article{margin-right:0;}.catalogue{display:none;}}}");
|
|
6
6
|
}
|
package/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.1.0
|
|
2
|
+
* @king-design v3.1.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -65,6 +65,6 @@ export * from './components/treeSelect';
|
|
|
65
65
|
export * from './components/upload';
|
|
66
66
|
export * from './components/wave';
|
|
67
67
|
|
|
68
|
-
export const version = '3.1.0
|
|
68
|
+
export const version = '3.1.0';
|
|
69
69
|
|
|
70
70
|
/* generate end */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@king-design/intact",
|
|
3
|
-
"version": "3.1.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "A component library written in Intact for Intact, Vue, React and Angular",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
"dependencies": {
|
|
180
180
|
"@babel/runtime-corejs3": "^7.16.0",
|
|
181
181
|
"@emotion/css": "^11.5.0",
|
|
182
|
-
"@king-design/react": "^3.1.0
|
|
182
|
+
"@king-design/react": "^3.1.0",
|
|
183
183
|
"dayjs": "^1.10.7",
|
|
184
184
|
"downloadjs": "^1.4.7",
|
|
185
185
|
"enquire.js": "^2.1.6",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.styl';
|
|
3
|
-
interface Props {
|
|
4
|
-
keywords?: string;
|
|
5
|
-
fonts: string[][];
|
|
6
|
-
}
|
|
7
|
-
export default class Demo extends React.Component<{}, Props> {
|
|
8
|
-
state: Props;
|
|
9
|
-
private classNames;
|
|
10
|
-
private config;
|
|
11
|
-
componentDidMount(): void;
|
|
12
|
-
filter(): string[][];
|
|
13
|
-
render(): JSX.Element;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
-
import _trimInstanceProperty from "@babel/runtime-corejs3/core-js/instance/trim";
|
|
4
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
|
|
5
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
|
|
6
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { Icon, Input } from '@king-design/react';
|
|
9
|
-
import './index.styl';
|
|
10
|
-
import { useConfigContext } from '@king-design/react';
|
|
11
|
-
|
|
12
|
-
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
13
|
-
_inheritsLoose(Demo, _React$Component);
|
|
14
|
-
|
|
15
|
-
function Demo() {
|
|
16
|
-
var _context;
|
|
17
|
-
|
|
18
|
-
var _this;
|
|
19
|
-
|
|
20
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21
|
-
args[_key] = arguments[_key];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
_this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
25
|
-
_this.state = {
|
|
26
|
-
keywords: '',
|
|
27
|
-
fonts: [["information-fill"], ["warning-fill"], ["success-fill"], ["error-fill"], ["question-fill"], ["heart-fill"], ['heart'], ['notification-fill'], ['notification'], ["information"], ["alert"], ["question"], ["zoom-in"], ["zoom-out"], ["close-outline"], ["check-outline"], ["time"], ['right-circled', 'arrow'], ['down-circled', 'arrow'], ['right-circled', 'arrow'], ['up-circled', 'arrow'], ['right-squared', 'arrow'], ['down-squared', 'arrow'], ['left-squared', 'arrow'], ['up-squared', 'arrow'], ['right', 'arrow'], ['down', 'arrow'], ['left', 'arrow'], ['up', 'arrow'], ['right-bold', 'arrow'], ['down-bold', 'arrow'], ['left-bold', 'arrow'], ['up-bold', 'arrow'], ['sort'], ['sort-bold'], ['close'], ['close-bold'], ['check'], ['check-bold'], ['add'], ['add-bold'], ['minus'], ['minus-bold'], ['share'], ['tag'], ['clone'], ['cloud'], ['pin'], ['home'], ['cut'], ['server'], ['internet'], ['mail'], ['paper'], ['phone'], ['panel'], ['alarm'], ['earphone'], ['settings-horizontal'], ['settings-vertical'], ['settings'], ['message'], ['return-right'], ['picture'], ['logout'], ['all'], ['drag'], ['more'], ['more-circled'], ['folder'], ['folder-open'], ['lock'], ['unlock'], ['user'], ['users'], ['edit'], ['location'], ['delete'], ['calendar'], ['search'], ['batchsearch'], ['hidden'], ['visible'], ['refresh'], ['upload'], ['download']]
|
|
28
|
-
};
|
|
29
|
-
_this.config = useConfigContext();
|
|
30
|
-
return _this;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
var _proto = Demo.prototype;
|
|
34
|
-
|
|
35
|
-
_proto.classNames = function classNames(_classNames) {
|
|
36
|
-
if (typeof _classNames === 'string') return _classNames;
|
|
37
|
-
var ret = [];
|
|
38
|
-
|
|
39
|
-
for (var key in _classNames) {
|
|
40
|
-
var value = _classNames[key];
|
|
41
|
-
|
|
42
|
-
if (value) {
|
|
43
|
-
ret.push(key);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return ret.join(' ');
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
51
|
-
var fonts = this.state.fonts;
|
|
52
|
-
var map = {};
|
|
53
|
-
fonts.forEach(function (_ref) {
|
|
54
|
-
var font = _ref[0];
|
|
55
|
-
|
|
56
|
-
if (map[font]) {
|
|
57
|
-
console.log('duplicated', font);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
map[font] = true;
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
_proto.filter = function filter() {
|
|
65
|
-
var _context2;
|
|
66
|
-
|
|
67
|
-
var keywords = _trimInstanceProperty(_context2 = this.state.keywords).call(_context2).toLowerCase();
|
|
68
|
-
|
|
69
|
-
var fonts = this.state.fonts;
|
|
70
|
-
if (!keywords) return fonts;
|
|
71
|
-
return _filterInstanceProperty(fonts).call(fonts, function (font) {
|
|
72
|
-
var _context3, _context4;
|
|
73
|
-
|
|
74
|
-
return _includesInstanceProperty(_context3 = font[0]).call(_context3, keywords) || font[1] && _includesInstanceProperty(_context4 = font[1]).call(_context4, keywords);
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
_proto.render = function render() {
|
|
79
|
-
var _this2 = this,
|
|
80
|
-
_context5,
|
|
81
|
-
_context6;
|
|
82
|
-
|
|
83
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
|
|
84
|
-
value: this.state.keywords,
|
|
85
|
-
onChangeValue: function onChangeValue(keywords) {
|
|
86
|
-
return _this2.setState({
|
|
87
|
-
keywords: keywords
|
|
88
|
-
});
|
|
89
|
-
},
|
|
90
|
-
placeholder: "Search icon",
|
|
91
|
-
clearable: true
|
|
92
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
93
|
-
className: "icons"
|
|
94
|
-
}, _mapInstanceProperty(_context5 = _filterInstanceProperty(_context6 = this).call(_context6)).call(_context5, function ($value, $key) {
|
|
95
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
96
|
-
className: "icon"
|
|
97
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
98
|
-
className: _this2.classNames(_this2.config.k + '-icon-' + $value[0]),
|
|
99
|
-
size: "large"
|
|
100
|
-
}), /*#__PURE__*/React.createElement("div", null, _this2.config.k + '-icon-' + $value[0]));
|
|
101
|
-
})));
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
return Demo;
|
|
105
|
-
}(React.Component);
|
|
106
|
-
|
|
107
|
-
export { Demo as default };
|