@king-design/intact 3.1.0-beta.2 → 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/copy/index.spec.ts +28 -0
- package/components/copy/index.ts +2 -0
- package/components/copy/useCopy.ts +3 -1
- package/components/dialog/base.ts +1 -1
- package/components/dialog/base.vdt +2 -2
- package/components/dialog/index.spec.ts +41 -2
- package/components/dialog/styles.ts +1 -0
- 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/menu/demos/basic.md +1 -1
- package/components/menu/item.vdt +17 -2
- package/components/menu/menu.ts +4 -0
- package/components/menu/menu.vdt +1 -1
- package/components/menu/styles.ts +19 -15
- package/components/menu/useDropdown.ts +3 -6
- package/components/portal.ts +6 -1
- package/components/table/row.vdt +2 -2
- package/components/table/styles.ts +2 -0
- package/components/table/table.vdt +1 -1
- package/components/tree/demos/draggable.md +63 -48
- package/components/tree/demos/expandAll.md +36 -8
- package/components/tree/index.md +3 -2
- package/components/tree/index.spec.ts +39 -40
- package/components/tree/index.ts +8 -3
- package/components/tree/styles.ts +2 -0
- package/components/tree/useDraggable.ts +5 -5
- package/components/tree/useExpanded.ts +15 -3
- package/components/tree/useNodes.ts +1 -0
- package/components/treeSelect/index.md +7 -1
- package/components/treeSelect/index.ts +4 -0
- 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/copy/index.d.ts +1 -0
- package/es/components/copy/index.js +2 -1
- package/es/components/copy/index.spec.js +64 -1
- package/es/components/copy/useCopy.d.ts +1 -1
- package/es/components/copy/useCopy.js +3 -1
- package/es/components/dialog/base.js +1 -1
- package/es/components/dialog/base.vdt.js +3 -3
- package/es/components/dialog/index.spec.js +87 -5
- package/es/components/dialog/styles.js +1 -1
- package/es/components/drawer/index.spec.js +6 -4
- package/es/components/input/styles.js +1 -1
- package/es/components/menu/item.vdt.js +22 -2
- package/es/components/menu/menu.d.ts +1 -0
- package/es/components/menu/menu.js +2 -1
- package/es/components/menu/menu.vdt.js +1 -1
- package/es/components/menu/styles.d.ts +1 -0
- package/es/components/menu/styles.js +10 -2
- package/es/components/menu/useDropdown.js +3 -6
- package/es/components/portal.js +7 -1
- package/es/components/table/row.vdt.js +1 -1
- package/es/components/table/styles.js +3 -2
- package/es/components/table/table.vdt.js +1 -1
- package/es/components/tree/index.d.ts +5 -3
- package/es/components/tree/index.js +5 -0
- package/es/components/tree/index.spec.js +60 -39
- package/es/components/tree/styles.js +1 -1
- package/es/components/tree/useDraggable.js +12 -12
- package/es/components/tree/useExpanded.d.ts +1 -0
- package/es/components/tree/useExpanded.js +23 -7
- package/es/components/tree/useNodes.d.ts +1 -0
- package/es/components/treeSelect/index.d.ts +1 -0
- package/es/components/treeSelect/index.js +4 -0
- 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/menu/demos/basic/react.js +2 -2
- package/es/site/data/components/tree/demos/draggable/index.d.ts +23 -17
- package/es/site/data/components/tree/demos/draggable/index.js +45 -35
- package/es/site/data/components/tree/demos/draggable/react.d.ts +23 -17
- package/es/site/data/components/tree/demos/draggable/react.js +55 -36
- 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,6 +1,7 @@
|
|
|
1
1
|
export { default as data } from './index.json';
|
|
2
2
|
import { Component } from 'intact';
|
|
3
|
-
import
|
|
3
|
+
import './index.styl';
|
|
4
|
+
import { TreeDataItem, TreeNode, TreeDragEndData, TreeMode } from 'kpc';
|
|
4
5
|
interface Props {
|
|
5
6
|
data?: TreeDataItem<string>[];
|
|
6
7
|
expandedKeys?: string[];
|
|
@@ -8,29 +9,34 @@ interface Props {
|
|
|
8
9
|
export default class extends Component<Props> {
|
|
9
10
|
static template: string | import("intact").Template<any>;
|
|
10
11
|
static defaults(): {
|
|
11
|
-
data: {
|
|
12
|
+
data: ({
|
|
12
13
|
label: string;
|
|
13
14
|
key: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} | {
|
|
15
|
+
type: string;
|
|
16
|
+
children?: undefined;
|
|
17
|
+
disabled?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
label: string;
|
|
20
|
+
key: string;
|
|
21
|
+
type: string;
|
|
22
|
+
children: {
|
|
23
23
|
label: string;
|
|
24
24
|
key: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
25
|
+
type: string;
|
|
26
|
+
}[];
|
|
27
|
+
disabled?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
label: string;
|
|
30
|
+
key: string;
|
|
31
|
+
type: string;
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
children?: undefined;
|
|
34
|
+
})[];
|
|
35
|
+
expandedKeys: never[];
|
|
30
36
|
};
|
|
31
37
|
onDragEnd(data: TreeDragEndData<string>): void;
|
|
32
38
|
allowDrag(node: TreeNode<string>): boolean;
|
|
33
|
-
allowDrop(node: TreeNode<string
|
|
39
|
+
allowDrop(node: TreeNode<string>, srcNode: TreeNode<string>, mode: TreeMode): boolean;
|
|
34
40
|
onDenyDrag(node: TreeNode<string>): void;
|
|
35
41
|
onDenyDrop(node: TreeNode<string>): void;
|
|
36
42
|
}
|
|
@@ -2,7 +2,8 @@ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
|
2
2
|
export { default as data } from './index.json';
|
|
3
3
|
import { Component } from 'intact';
|
|
4
4
|
import template from './index.vdt';
|
|
5
|
-
import
|
|
5
|
+
import './index.styl';
|
|
6
|
+
import { Message, TreeMode } from 'kpc';
|
|
6
7
|
|
|
7
8
|
var default_1 = /*#__PURE__*/function (_Component) {
|
|
8
9
|
_inheritsLoose(default_1, _Component);
|
|
@@ -14,43 +15,42 @@ var default_1 = /*#__PURE__*/function (_Component) {
|
|
|
14
15
|
default_1.defaults = function defaults() {
|
|
15
16
|
return {
|
|
16
17
|
data: [{
|
|
17
|
-
label: '
|
|
18
|
-
key: '
|
|
18
|
+
label: '总览',
|
|
19
|
+
key: 'summarization',
|
|
20
|
+
type: 'file'
|
|
21
|
+
}, {
|
|
22
|
+
label: '产品简介',
|
|
23
|
+
key: 'introduction',
|
|
24
|
+
type: 'file'
|
|
25
|
+
}, {
|
|
26
|
+
label: '技术实现',
|
|
27
|
+
key: 'implemention',
|
|
28
|
+
type: 'file'
|
|
29
|
+
}, {
|
|
30
|
+
label: '操作指南',
|
|
31
|
+
key: 'guide',
|
|
32
|
+
type: 'dir',
|
|
19
33
|
children: [{
|
|
20
|
-
label: '
|
|
21
|
-
key: '
|
|
22
|
-
|
|
23
|
-
label: 'This node can not be dragged and dropped.',
|
|
24
|
-
key: '1-1-1'
|
|
25
|
-
}]
|
|
34
|
+
label: '产品安装',
|
|
35
|
+
key: 'installation',
|
|
36
|
+
type: 'file'
|
|
26
37
|
}]
|
|
27
38
|
}, {
|
|
28
|
-
label: '
|
|
29
|
-
key: '
|
|
39
|
+
label: '接入说明',
|
|
40
|
+
key: 'interaction',
|
|
41
|
+
type: 'dir',
|
|
30
42
|
children: [{
|
|
31
|
-
label: '
|
|
32
|
-
key: '
|
|
33
|
-
|
|
34
|
-
label: 'Third floor-2.1.1',
|
|
35
|
-
key: '2-1-1'
|
|
36
|
-
}, {
|
|
37
|
-
label: 'Third floor-2.1.2',
|
|
38
|
-
key: '2-1-2'
|
|
39
|
-
}]
|
|
40
|
-
}, {
|
|
41
|
-
label: 'Second floor-2.2',
|
|
42
|
-
key: '2-2',
|
|
43
|
-
children: [{
|
|
44
|
-
label: 'Third floor-2.2.1',
|
|
45
|
-
key: '2-2-1'
|
|
46
|
-
}]
|
|
47
|
-
}, {
|
|
48
|
-
label: 'Second floor-2.3',
|
|
49
|
-
key: '2-3',
|
|
50
|
-
disabled: true
|
|
43
|
+
label: '使用',
|
|
44
|
+
key: 'usage',
|
|
45
|
+
type: 'file'
|
|
51
46
|
}]
|
|
47
|
+
}, {
|
|
48
|
+
label: '禁用文件',
|
|
49
|
+
key: 'disabled',
|
|
50
|
+
type: 'file',
|
|
51
|
+
disabled: true
|
|
52
52
|
}],
|
|
53
|
-
expandedKeys: [
|
|
53
|
+
expandedKeys: []
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
|
|
@@ -61,11 +61,21 @@ var default_1 = /*#__PURE__*/function (_Component) {
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
_proto.allowDrag = function allowDrag(node) {
|
|
64
|
-
return node.key !== '
|
|
64
|
+
return node.key !== 'summarization';
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
_proto.allowDrop = function allowDrop(node) {
|
|
68
|
-
|
|
67
|
+
_proto.allowDrop = function allowDrop(node, srcNode, mode) {
|
|
68
|
+
// 能够将文件拖入文件夹,但是不能讲文件夹拖入文件夹
|
|
69
|
+
if (mode === TreeMode.Inner) {
|
|
70
|
+
// 文件拖入文件夹
|
|
71
|
+
return srcNode.data.type === 'file' && node.data.type === 'dir';
|
|
72
|
+
} else if (srcNode.data.type === 'dir' && node.parent) {
|
|
73
|
+
// 此时插入模式是,前面或者后面插入
|
|
74
|
+
// 如果拖动的是文件夹,但是目标节点存在父元素,代表目标节点也是文件夹,不能插入
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return true;
|
|
69
79
|
};
|
|
70
80
|
|
|
71
81
|
_proto.onDenyDrag = function onDenyDrag(node) {
|
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import './index.styl';
|
|
3
|
+
import { TreeDataItem, TreeNode, TreeDragEndData, TreeMode } from '@king-design/react';
|
|
3
4
|
interface Props {
|
|
4
5
|
data?: TreeDataItem<string>[];
|
|
5
6
|
expandedKeys?: string[];
|
|
6
7
|
}
|
|
7
8
|
export default class Demo extends React.Component<{}, Props> {
|
|
8
9
|
state: {
|
|
9
|
-
data: {
|
|
10
|
+
data: ({
|
|
10
11
|
label: string;
|
|
11
12
|
key: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} | {
|
|
13
|
+
type: string;
|
|
14
|
+
children?: undefined;
|
|
15
|
+
disabled?: undefined;
|
|
16
|
+
} | {
|
|
17
|
+
label: string;
|
|
18
|
+
key: string;
|
|
19
|
+
type: string;
|
|
20
|
+
children: {
|
|
21
21
|
label: string;
|
|
22
22
|
key: string;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
23
|
+
type: string;
|
|
24
|
+
}[];
|
|
25
|
+
disabled?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
label: string;
|
|
28
|
+
key: string;
|
|
29
|
+
type: string;
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
children?: undefined;
|
|
32
|
+
})[];
|
|
33
|
+
expandedKeys: never[];
|
|
28
34
|
};
|
|
29
35
|
onDragEnd(data: TreeDragEndData<string>): void;
|
|
30
36
|
allowDrag(node: TreeNode<string>): boolean;
|
|
31
|
-
allowDrop(node: TreeNode<string
|
|
37
|
+
allowDrop(node: TreeNode<string>, srcNode: TreeNode<string>, mode: TreeMode): boolean;
|
|
32
38
|
onDenyDrag(node: TreeNode<string>): void;
|
|
33
39
|
onDenyDrop(node: TreeNode<string>): void;
|
|
34
40
|
render(): JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
2
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { Tree } from '@king-design/react';
|
|
5
|
-
import
|
|
4
|
+
import { Tree, Icon } from '@king-design/react';
|
|
5
|
+
import './index.styl';
|
|
6
|
+
import { Message, TreeMode } from '@king-design/react';
|
|
6
7
|
|
|
7
8
|
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
8
9
|
_inheritsLoose(Demo, _React$Component);
|
|
@@ -19,43 +20,42 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
19
20
|
_this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
20
21
|
_this.state = {
|
|
21
22
|
data: [{
|
|
22
|
-
label: '
|
|
23
|
-
key: '
|
|
23
|
+
label: '总览',
|
|
24
|
+
key: 'summarization',
|
|
25
|
+
type: 'file'
|
|
26
|
+
}, {
|
|
27
|
+
label: '产品简介',
|
|
28
|
+
key: 'introduction',
|
|
29
|
+
type: 'file'
|
|
30
|
+
}, {
|
|
31
|
+
label: '技术实现',
|
|
32
|
+
key: 'implemention',
|
|
33
|
+
type: 'file'
|
|
34
|
+
}, {
|
|
35
|
+
label: '操作指南',
|
|
36
|
+
key: 'guide',
|
|
37
|
+
type: 'dir',
|
|
24
38
|
children: [{
|
|
25
|
-
label: '
|
|
26
|
-
key: '
|
|
27
|
-
|
|
28
|
-
label: 'This node can not be dragged and dropped.',
|
|
29
|
-
key: '1-1-1'
|
|
30
|
-
}]
|
|
39
|
+
label: '产品安装',
|
|
40
|
+
key: 'installation',
|
|
41
|
+
type: 'file'
|
|
31
42
|
}]
|
|
32
43
|
}, {
|
|
33
|
-
label: '
|
|
34
|
-
key: '
|
|
44
|
+
label: '接入说明',
|
|
45
|
+
key: 'interaction',
|
|
46
|
+
type: 'dir',
|
|
35
47
|
children: [{
|
|
36
|
-
label: '
|
|
37
|
-
key: '
|
|
38
|
-
|
|
39
|
-
label: 'Third floor-2.1.1',
|
|
40
|
-
key: '2-1-1'
|
|
41
|
-
}, {
|
|
42
|
-
label: 'Third floor-2.1.2',
|
|
43
|
-
key: '2-1-2'
|
|
44
|
-
}]
|
|
45
|
-
}, {
|
|
46
|
-
label: 'Second floor-2.2',
|
|
47
|
-
key: '2-2',
|
|
48
|
-
children: [{
|
|
49
|
-
label: 'Third floor-2.2.1',
|
|
50
|
-
key: '2-2-1'
|
|
51
|
-
}]
|
|
52
|
-
}, {
|
|
53
|
-
label: 'Second floor-2.3',
|
|
54
|
-
key: '2-3',
|
|
55
|
-
disabled: true
|
|
48
|
+
label: '使用',
|
|
49
|
+
key: 'usage',
|
|
50
|
+
type: 'file'
|
|
56
51
|
}]
|
|
52
|
+
}, {
|
|
53
|
+
label: '禁用文件',
|
|
54
|
+
key: 'disabled',
|
|
55
|
+
type: 'file',
|
|
56
|
+
disabled: true
|
|
57
57
|
}],
|
|
58
|
-
expandedKeys: [
|
|
58
|
+
expandedKeys: []
|
|
59
59
|
};
|
|
60
60
|
return _this;
|
|
61
61
|
}
|
|
@@ -67,11 +67,21 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
_proto.allowDrag = function allowDrag(node) {
|
|
70
|
-
return node.key !== '
|
|
70
|
+
return node.key !== 'summarization';
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
_proto.allowDrop = function allowDrop(node) {
|
|
74
|
-
|
|
73
|
+
_proto.allowDrop = function allowDrop(node, srcNode, mode) {
|
|
74
|
+
// 能够将文件拖入文件夹,但是不能讲文件夹拖入文件夹
|
|
75
|
+
if (mode === TreeMode.Inner) {
|
|
76
|
+
// 文件拖入文件夹
|
|
77
|
+
return srcNode.data.type === 'file' && node.data.type === 'dir';
|
|
78
|
+
} else if (srcNode.data.type === 'dir' && node.parent) {
|
|
79
|
+
// 此时插入模式是,前面或者后面插入
|
|
80
|
+
// 如果拖动的是文件夹,但是目标节点存在父元素,代表目标节点也是文件夹,不能插入
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return true;
|
|
75
85
|
};
|
|
76
86
|
|
|
77
87
|
_proto.onDenyDrag = function onDenyDrag(node) {
|
|
@@ -86,6 +96,15 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
86
96
|
var _this2 = this;
|
|
87
97
|
|
|
88
98
|
return /*#__PURE__*/React.createElement(Tree, {
|
|
99
|
+
slotLabel: function slotLabel(_ref) {
|
|
100
|
+
var data = _ref[0],
|
|
101
|
+
node = _ref[1];
|
|
102
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, data.type === 'file' ? /*#__PURE__*/React.createElement(Icon, {
|
|
103
|
+
className: "k-icon-paper"
|
|
104
|
+
}) : /*#__PURE__*/React.createElement(Icon, {
|
|
105
|
+
className: "k-icon-folder"
|
|
106
|
+
}), data.label);
|
|
107
|
+
},
|
|
89
108
|
draggable: true,
|
|
90
109
|
onDragend: this.onDragEnd,
|
|
91
110
|
allowDrag: this.allowDrag,
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export { default as data } from './index.json';
|
|
2
2
|
import { Component } from 'intact';
|
|
3
|
-
|
|
3
|
+
import './index.styl';
|
|
4
|
+
import { TreeDataItem } from 'kpc';
|
|
5
|
+
interface Props {
|
|
6
|
+
data: TreeDataItem<string>[];
|
|
7
|
+
delayData?: TreeDataItem<string>[];
|
|
8
|
+
}
|
|
9
|
+
export default class extends Component<Props> {
|
|
4
10
|
static template: string | import("intact").Template<any>;
|
|
5
11
|
static defaults(): {
|
|
6
12
|
data: ({
|
|
@@ -33,5 +39,7 @@ export default class extends Component {
|
|
|
33
39
|
}[];
|
|
34
40
|
})[];
|
|
35
41
|
})[];
|
|
42
|
+
delayData: undefined;
|
|
36
43
|
};
|
|
44
|
+
load(): void;
|
|
37
45
|
}
|
|
@@ -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 {};
|