@king-design/intact 3.4.3-beta.0 → 3.4.3-beta.1
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/button/demos/disabled.md +4 -14
- package/components/button/index.vdt +1 -1
- package/components/button/styles.ts +1 -14
- package/components/dialog/styles.ts +3 -3
- package/components/dropdown/item.ts +2 -7
- package/components/editable/index.spec.ts +8 -8
- package/components/editable/index.vdt +1 -3
- package/components/editable/styles.ts +1 -8
- package/components/ellipsis/index.vdt +0 -1
- package/components/select/base.ts +1 -7
- package/components/select/base.vdt +1 -2
- package/components/switch/index.ts +1 -1
- package/components/table/cell.ts +0 -1
- package/components/table/cell.vdt +2 -8
- package/components/table/column.ts +0 -2
- package/components/table/index.md +0 -3
- package/components/table/row.ts +3 -4
- package/components/table/row.vdt +2 -2
- package/components/table/styles.ts +1 -1
- package/components/table/table.ts +0 -3
- package/components/table/table.vdt +2 -10
- package/components/table/useGroup.ts +1 -1
- package/components/table/useTree.ts +2 -9
- package/components/tooltip/tooltip.ts +0 -2
- package/components/treeSelect/demos/basic.md +0 -1
- package/components/treeSelect/index.vdt +0 -1
- package/es/components/button/index.vdt.js +1 -1
- package/es/components/button/styles.js +3 -3
- package/es/components/diagram/shapes/callout.d.ts +1 -1
- package/es/components/diagram/shapes/circle.d.ts +1 -1
- package/es/components/diagram/shapes/document.d.ts +1 -1
- package/es/components/diagram/shapes/ellipse.d.ts +1 -1
- package/es/components/diagram/shapes/hexagon.d.ts +1 -1
- package/es/components/diagram/shapes/image.d.ts +1 -1
- package/es/components/diagram/shapes/parallelogram.d.ts +1 -1
- package/es/components/diagram/shapes/rectangle.d.ts +1 -1
- package/es/components/diagram/shapes/square.d.ts +1 -1
- package/es/components/diagram/shapes/text.d.ts +1 -1
- package/es/components/dialog/styles.js +3 -3
- package/es/components/dropdown/item.js +2 -5
- package/es/components/editable/index.spec.js +8 -8
- package/es/components/editable/index.vdt.js +1 -3
- package/es/components/editable/styles.d.ts +0 -1
- package/es/components/editable/styles.js +1 -4
- package/es/components/ellipsis/index.vdt.js +0 -1
- package/es/components/select/base.d.ts +0 -4
- package/es/components/select/base.js +1 -11
- package/es/components/select/base.vdt.js +1 -2
- package/es/components/switch/index.js +1 -1
- package/es/components/table/cell.d.ts +0 -1
- package/es/components/table/cell.vdt.js +3 -13
- package/es/components/table/column.d.ts +0 -1
- package/es/components/table/column.js +0 -1
- package/es/components/table/row.d.ts +1 -2
- package/es/components/table/row.js +2 -3
- package/es/components/table/row.vdt.js +1 -3
- package/es/components/table/styles.js +1 -1
- package/es/components/table/table.d.ts +0 -2
- package/es/components/table/table.js +1 -2
- package/es/components/table/table.vdt.js +0 -14
- package/es/components/table/useGroup.js +1 -1
- package/es/components/table/useTree.d.ts +1 -1
- package/es/components/table/useTree.js +2 -30
- package/es/components/tooltip/tooltip.d.ts +0 -1
- package/es/components/tooltip/tooltip.js +1 -9
- package/es/components/treeSelect/index.vdt.js +0 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/button/demos/disabled/index.d.ts +0 -1
- package/es/site/data/components/button/demos/disabled/index.js +0 -1
- package/es/site/data/components/button/demos/disabled/react.d.ts +0 -1
- package/es/site/data/components/button/demos/disabled/react.js +15 -28
- package/es/site/data/components/treeSelect/demos/basic/react.js +1 -2
- package/index.ts +2 -2
- package/package.json +2 -2
- package/components/select/demos/immutable.md +0 -38
- package/components/select/useImmutable.ts +0 -46
- package/components/table/demos/asyncTree.md +0 -70
- package/components/table/demos/footer.md +0 -38
- package/es/components/select/useImmutable.d.ts +0 -4
- package/es/components/select/useImmutable.js +0 -46
- package/es/site/data/components/select/demos/immutable/index.d.ts +0 -9
- package/es/site/data/components/select/demos/immutable/index.js +0 -18
- package/es/site/data/components/select/demos/immutable/react.d.ts +0 -9
- package/es/site/data/components/select/demos/immutable/react.js +0 -53
- package/es/site/data/components/table/demos/asyncTree/index.d.ts +0 -20
- package/es/site/data/components/table/demos/asyncTree/index.js +0 -53
- package/es/site/data/components/table/demos/asyncTree/react.d.ts +0 -20
- package/es/site/data/components/table/demos/asyncTree/react.js +0 -76
- package/es/site/data/components/table/demos/footer/index.d.ts +0 -12
- package/es/site/data/components/table/demos/footer/index.js +0 -25
- package/es/site/data/components/table/demos/footer/react.d.ts +0 -11
- package/es/site/data/components/table/demos/footer/react.js +0 -46
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Button } from '@king-design/react';
|
|
4
|
-
import './index.styl';
|
|
3
|
+
import { Button, Icon } from '@king-design/react';
|
|
5
4
|
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
6
5
|
_inheritsLoose(Demo, _React$Component);
|
|
7
6
|
function Demo() {
|
|
@@ -12,33 +11,21 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
12
11
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
|
|
13
12
|
disabled: true
|
|
14
13
|
}, "disabled"), /*#__PURE__*/React.createElement(Button, {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}, "
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, "danger"), /*#__PURE__*/React.createElement(Button, {
|
|
27
|
-
type: "success",
|
|
28
|
-
disabled: true
|
|
29
|
-
}, "success"), /*#__PURE__*/React.createElement(Button, {
|
|
30
|
-
type: "none",
|
|
31
|
-
disabled: true
|
|
32
|
-
}, "none"), /*#__PURE__*/React.createElement(Button, {
|
|
33
|
-
type: "link",
|
|
34
|
-
disabled: true
|
|
14
|
+
disabled: true,
|
|
15
|
+
type: "none"
|
|
16
|
+
}, "disabled text"), /*#__PURE__*/React.createElement(Button, {
|
|
17
|
+
disabled: true,
|
|
18
|
+
icon: true,
|
|
19
|
+
circle: true
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
21
|
+
className: "k-icon-search"
|
|
22
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
23
|
+
disabled: true,
|
|
24
|
+
type: "link"
|
|
35
25
|
}, "link"), /*#__PURE__*/React.createElement(Button, {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}, "flat")
|
|
39
|
-
color: "red",
|
|
40
|
-
disabled: true
|
|
41
|
-
}, "custom"));
|
|
26
|
+
disabled: true,
|
|
27
|
+
type: "flat"
|
|
28
|
+
}, "flat"));
|
|
42
29
|
};
|
|
43
30
|
return Demo;
|
|
44
31
|
}(React.Component);
|
package/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.4.3-beta.
|
|
2
|
+
* @king-design v3.4.3-beta.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -69,6 +69,6 @@ export * from './components/upload';
|
|
|
69
69
|
export * from './components/view';
|
|
70
70
|
export * from './components/wave';
|
|
71
71
|
|
|
72
|
-
export const version = '3.4.3-beta.
|
|
72
|
+
export const version = '3.4.3-beta.1';
|
|
73
73
|
|
|
74
74
|
/* generate end */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@king-design/intact",
|
|
3
|
-
"version": "3.4.3-beta.
|
|
3
|
+
"version": "3.4.3-beta.1",
|
|
4
4
|
"description": "A component library written in Intact for Intact, Vue, React and Angular",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
"@emotion/css": "^11.5.0",
|
|
181
181
|
"dayjs": "^1.10.7",
|
|
182
182
|
"enquire.js": "^2.1.6",
|
|
183
|
-
"intact": "^3.0.
|
|
183
|
+
"intact": "^3.0.37",
|
|
184
184
|
"monaco-editor": "^0.26.1",
|
|
185
185
|
"mxgraphx": "^4.0.7",
|
|
186
186
|
"resize-observer-polyfill": "^1.5.1",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 禁用选项不可删除
|
|
3
|
-
order: 14
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
在指定`multiple`多选的情况下,`Select`指定`value`包含`disabled Option`,则禁止删除
|
|
7
|
-
|
|
8
|
-
```vdt
|
|
9
|
-
import {Select, Option, OptionGroup} from 'kpc';
|
|
10
|
-
|
|
11
|
-
<div>
|
|
12
|
-
<Select v-model="day" multiple filterable clearable>
|
|
13
|
-
<Option value="Monday">星期一</Option>
|
|
14
|
-
<Option value="Tuesday" disabled>星期二</Option>
|
|
15
|
-
<Option value="Wednesday">星期三</Option>
|
|
16
|
-
<Option value="Thursday">星期四</Option>
|
|
17
|
-
<Option value="Friday" disabled>星期五</Option>
|
|
18
|
-
<Option value="Saturday">星期六</Option>
|
|
19
|
-
<Option value="Sunday">星期天</Option>
|
|
20
|
-
</Select>
|
|
21
|
-
You selected: {JSON.stringify(this.get('day'))}
|
|
22
|
-
</div>
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
```ts
|
|
26
|
-
interface Props {
|
|
27
|
-
day?: string[]
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default class extends Component {
|
|
31
|
-
static template = template;
|
|
32
|
-
static defaults() {
|
|
33
|
-
return {
|
|
34
|
-
day: ['Tuesday', 'Sunday', 'Wednesday'],
|
|
35
|
-
} as Props;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
```
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { useInstance, Children } from 'intact';
|
|
2
|
-
import type { Select } from './select';
|
|
3
|
-
import { Option, OptionProps } from './option';
|
|
4
|
-
import { OptionGroup } from './group';
|
|
5
|
-
import { eachChildren, isComponentVNode } from '../utils';
|
|
6
|
-
import { useState } from '../../hooks/useState';
|
|
7
|
-
|
|
8
|
-
export function useImmutable() {
|
|
9
|
-
const instance = useInstance() as Select<any, true>;
|
|
10
|
-
const immutableValues = useState<any[]>([]);
|
|
11
|
-
|
|
12
|
-
function setImmutableValues() {
|
|
13
|
-
const { children, multiple } = instance.get();
|
|
14
|
-
if (!multiple) return;
|
|
15
|
-
updateImmutableValues(children);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function updateImmutableValues(children: Children) {
|
|
19
|
-
const _immutableValues: any[] = [];
|
|
20
|
-
const loop = (children: Children) => {
|
|
21
|
-
eachChildren(children, vNode => {
|
|
22
|
-
if (isComponentVNode(vNode, Option)) {
|
|
23
|
-
const { disabled, value } = vNode.props as OptionProps;
|
|
24
|
-
if (disabled) {
|
|
25
|
-
_immutableValues.push(value);
|
|
26
|
-
}
|
|
27
|
-
} else if (isComponentVNode(vNode, OptionGroup)) {
|
|
28
|
-
loop(vNode.props!.children);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
loop(children);
|
|
34
|
-
immutableValues.set(_immutableValues);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function isClosable(key: string) {
|
|
38
|
-
return !immutableValues.value.includes(key);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
setImmutableValues();
|
|
42
|
-
|
|
43
|
-
// instance.on('$receive:children', setImmutableValues);
|
|
44
|
-
|
|
45
|
-
return { immutableValues, isClosable };
|
|
46
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 树形表格异步加载
|
|
3
|
-
order: 33
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
添加`load`数据加载函数即可实现异步加载子节点功能,组件会传入当前节点对象作为参数,函数可以返回
|
|
7
|
-
数组或者异步返回数组作为当前异步加载的子节点。如果子节点还可以进一步展开,可以将`children`属性
|
|
8
|
-
设为空数组`[]`,否则不指定`children`则表示该节点为叶子节点。
|
|
9
|
-
|
|
10
|
-
组件默认遇到`children`为`[]`空数组的情况就会去进行异步加载,你可以通过`loaded`属性设为`true`来
|
|
11
|
-
标识该子节点已经加载完成,无需再次加载
|
|
12
|
-
|
|
13
|
-
```vdt
|
|
14
|
-
import {Table, TableColumn} from 'kpc';
|
|
15
|
-
|
|
16
|
-
<Table data={this.get('data')} rowKey={data => data.name} load={this.loadData}>
|
|
17
|
-
<TableColumn key="name" title="Name" />
|
|
18
|
-
<TableColumn key="size" title="Size">
|
|
19
|
-
<b:template args="[data]">
|
|
20
|
-
{data.size}MB
|
|
21
|
-
</b:template>
|
|
22
|
-
</TableColumn>
|
|
23
|
-
</Table>
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
```ts
|
|
27
|
-
import {bind} from 'kpc';
|
|
28
|
-
interface Props {
|
|
29
|
-
data: NonNullable<any>
|
|
30
|
-
}
|
|
31
|
-
export default class extends Component<Props> {
|
|
32
|
-
static template = template;
|
|
33
|
-
|
|
34
|
-
static defaults() {
|
|
35
|
-
return {
|
|
36
|
-
data: [
|
|
37
|
-
{
|
|
38
|
-
name: 'Audios',
|
|
39
|
-
size: 12,
|
|
40
|
-
children: []
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: 'Images',
|
|
44
|
-
size: 14,
|
|
45
|
-
children: []
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: 'doc.pdf',
|
|
49
|
-
size: 18,
|
|
50
|
-
},
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@bind
|
|
56
|
-
loadData(node: any) {
|
|
57
|
-
return new Promise<void>(resolve => {
|
|
58
|
-
setTimeout(() => {
|
|
59
|
-
node.children = [
|
|
60
|
-
{name: 'child1', size: 17},
|
|
61
|
-
{name: 'child2', size: 15, loaded: true},
|
|
62
|
-
];
|
|
63
|
-
this.set('data', [...this.get('data')]);
|
|
64
|
-
|
|
65
|
-
resolve();
|
|
66
|
-
}, 2000);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
```
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 自定义footer
|
|
3
|
-
order: 32
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
```vdt
|
|
8
|
-
import {Table, TableColumn} from 'kpc';
|
|
9
|
-
|
|
10
|
-
<div>
|
|
11
|
-
<Table data={this.get('data')} resizable>
|
|
12
|
-
<TableColumn key="a" title="Title 1" minWidth={200}/>
|
|
13
|
-
<TableColumn key="b" title="Title 2" minWidth={300}/>
|
|
14
|
-
<b:footer>
|
|
15
|
-
<div class="footer">自定义底部</div>
|
|
16
|
-
</b:footer>
|
|
17
|
-
</Table>
|
|
18
|
-
</div>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
```styl
|
|
22
|
-
.k-table
|
|
23
|
-
margin-bottom 20px
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
```ts
|
|
27
|
-
export default class extends Component {
|
|
28
|
-
static template = template;
|
|
29
|
-
static defaults() {
|
|
30
|
-
return {
|
|
31
|
-
data: [
|
|
32
|
-
{a: 'Cell 1-1', b: 'Cell 1-2'},
|
|
33
|
-
{a: 'Cell 2-1', b: 'Cell 2-2'}
|
|
34
|
-
],
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
```
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
|
|
2
|
-
import { useInstance } from 'intact';
|
|
3
|
-
import { Option } from './option';
|
|
4
|
-
import { OptionGroup } from './group';
|
|
5
|
-
import { eachChildren, isComponentVNode } from '../utils';
|
|
6
|
-
import { useState } from '../../hooks/useState';
|
|
7
|
-
export function useImmutable() {
|
|
8
|
-
var instance = useInstance();
|
|
9
|
-
var immutableValues = useState([]);
|
|
10
|
-
function setImmutableValues() {
|
|
11
|
-
var _instance$get = instance.get(),
|
|
12
|
-
children = _instance$get.children,
|
|
13
|
-
multiple = _instance$get.multiple;
|
|
14
|
-
if (!multiple) return;
|
|
15
|
-
updateImmutableValues(children);
|
|
16
|
-
}
|
|
17
|
-
function updateImmutableValues(children) {
|
|
18
|
-
var _immutableValues = [];
|
|
19
|
-
var loop = function loop(children) {
|
|
20
|
-
eachChildren(children, function (vNode) {
|
|
21
|
-
if (isComponentVNode(vNode, Option)) {
|
|
22
|
-
var _vNode$props = vNode.props,
|
|
23
|
-
disabled = _vNode$props.disabled,
|
|
24
|
-
value = _vNode$props.value;
|
|
25
|
-
if (disabled) {
|
|
26
|
-
_immutableValues.push(value);
|
|
27
|
-
}
|
|
28
|
-
} else if (isComponentVNode(vNode, OptionGroup)) {
|
|
29
|
-
loop(vNode.props.children);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
loop(children);
|
|
34
|
-
immutableValues.set(_immutableValues);
|
|
35
|
-
}
|
|
36
|
-
function isClosable(key) {
|
|
37
|
-
var _context;
|
|
38
|
-
return !_includesInstanceProperty(_context = immutableValues.value).call(_context, key);
|
|
39
|
-
}
|
|
40
|
-
setImmutableValues();
|
|
41
|
-
// instance.on('$receive:children', setImmutableValues);
|
|
42
|
-
return {
|
|
43
|
-
immutableValues: immutableValues,
|
|
44
|
-
isClosable: isClosable
|
|
45
|
-
};
|
|
46
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
-
export { default as data } from './index.json';
|
|
3
|
-
import { Component } from 'intact';
|
|
4
|
-
import template from './index.vdt';
|
|
5
|
-
var default_1 = /*#__PURE__*/function (_Component) {
|
|
6
|
-
_inheritsLoose(default_1, _Component);
|
|
7
|
-
function default_1() {
|
|
8
|
-
return _Component.apply(this, arguments) || this;
|
|
9
|
-
}
|
|
10
|
-
default_1.defaults = function defaults() {
|
|
11
|
-
return {
|
|
12
|
-
day: ['Tuesday', 'Sunday', 'Wednesday']
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
return default_1;
|
|
16
|
-
}(Component);
|
|
17
|
-
default_1.template = template;
|
|
18
|
-
export { default_1 as default };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
-
import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { Select, Option } from '@king-design/react';
|
|
6
|
-
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
7
|
-
_inheritsLoose(Demo, _React$Component);
|
|
8
|
-
function Demo() {
|
|
9
|
-
var _context;
|
|
10
|
-
var _this;
|
|
11
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
12
|
-
args[_key] = arguments[_key];
|
|
13
|
-
}
|
|
14
|
-
_this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
15
|
-
_this.state = {
|
|
16
|
-
day: ['Tuesday', 'Sunday', 'Wednesday']
|
|
17
|
-
};
|
|
18
|
-
return _this;
|
|
19
|
-
}
|
|
20
|
-
var _proto = Demo.prototype;
|
|
21
|
-
_proto.render = function render() {
|
|
22
|
-
var _this2 = this;
|
|
23
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Select, {
|
|
24
|
-
value: this.state.day,
|
|
25
|
-
onChangeValue: function onChangeValue(day) {
|
|
26
|
-
return _this2.setState({
|
|
27
|
-
day: day
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
multiple: true,
|
|
31
|
-
filterable: true,
|
|
32
|
-
clearable: true
|
|
33
|
-
}, /*#__PURE__*/React.createElement(Option, {
|
|
34
|
-
value: "Monday"
|
|
35
|
-
}, "\u661F\u671F\u4E00"), /*#__PURE__*/React.createElement(Option, {
|
|
36
|
-
value: "Tuesday",
|
|
37
|
-
disabled: true
|
|
38
|
-
}, "\u661F\u671F\u4E8C"), /*#__PURE__*/React.createElement(Option, {
|
|
39
|
-
value: "Wednesday"
|
|
40
|
-
}, "\u661F\u671F\u4E09"), /*#__PURE__*/React.createElement(Option, {
|
|
41
|
-
value: "Thursday"
|
|
42
|
-
}, "\u661F\u671F\u56DB"), /*#__PURE__*/React.createElement(Option, {
|
|
43
|
-
value: "Friday",
|
|
44
|
-
disabled: true
|
|
45
|
-
}, "\u661F\u671F\u4E94"), /*#__PURE__*/React.createElement(Option, {
|
|
46
|
-
value: "Saturday"
|
|
47
|
-
}, "\u661F\u671F\u516D"), /*#__PURE__*/React.createElement(Option, {
|
|
48
|
-
value: "Sunday"
|
|
49
|
-
}, "\u661F\u671F\u5929")), "You selected: ", _JSON$stringify(this.state.day));
|
|
50
|
-
};
|
|
51
|
-
return Demo;
|
|
52
|
-
}(React.Component);
|
|
53
|
-
export { Demo as default };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export { default as data } from './index.json';
|
|
2
|
-
import { Component } from 'intact';
|
|
3
|
-
interface Props {
|
|
4
|
-
data: NonNullable<any>;
|
|
5
|
-
}
|
|
6
|
-
export default class extends Component<Props> {
|
|
7
|
-
static template: string | import("intact").Template<any>;
|
|
8
|
-
static defaults(): {
|
|
9
|
-
data: ({
|
|
10
|
-
name: string;
|
|
11
|
-
size: number;
|
|
12
|
-
children: never[];
|
|
13
|
-
} | {
|
|
14
|
-
name: string;
|
|
15
|
-
size: number;
|
|
16
|
-
children?: undefined;
|
|
17
|
-
})[];
|
|
18
|
-
};
|
|
19
|
-
loadData(node: any): Promise<void>;
|
|
20
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
-
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
3
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
4
|
-
import { __decorate } from "tslib";
|
|
5
|
-
export { default as data } from './index.json';
|
|
6
|
-
import { Component } from 'intact';
|
|
7
|
-
import template from './index.vdt';
|
|
8
|
-
import { bind } from 'kpc';
|
|
9
|
-
var default_1 = /*#__PURE__*/function (_Component) {
|
|
10
|
-
_inheritsLoose(default_1, _Component);
|
|
11
|
-
function default_1() {
|
|
12
|
-
return _Component.apply(this, arguments) || this;
|
|
13
|
-
}
|
|
14
|
-
default_1.defaults = function defaults() {
|
|
15
|
-
return {
|
|
16
|
-
data: [{
|
|
17
|
-
name: 'Audios',
|
|
18
|
-
size: 12,
|
|
19
|
-
children: []
|
|
20
|
-
}, {
|
|
21
|
-
name: 'Images',
|
|
22
|
-
size: 14,
|
|
23
|
-
children: []
|
|
24
|
-
}, {
|
|
25
|
-
name: 'doc.pdf',
|
|
26
|
-
size: 18
|
|
27
|
-
}]
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
var _proto = default_1.prototype;
|
|
31
|
-
_proto.loadData = function loadData(node) {
|
|
32
|
-
var _this = this;
|
|
33
|
-
return new _Promise(function (resolve) {
|
|
34
|
-
setTimeout(function () {
|
|
35
|
-
var _context;
|
|
36
|
-
node.children = [{
|
|
37
|
-
name: 'child1',
|
|
38
|
-
size: 17
|
|
39
|
-
}, {
|
|
40
|
-
name: 'child2',
|
|
41
|
-
size: 15,
|
|
42
|
-
loaded: true
|
|
43
|
-
}];
|
|
44
|
-
_this.set('data', _concatInstanceProperty(_context = []).call(_context, _this.get('data')));
|
|
45
|
-
resolve();
|
|
46
|
-
}, 2000);
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
return default_1;
|
|
50
|
-
}(Component);
|
|
51
|
-
default_1.template = template;
|
|
52
|
-
export { default_1 as default };
|
|
53
|
-
__decorate([bind], default_1.prototype, "loadData", null);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface Props {
|
|
3
|
-
data: NonNullable<any>;
|
|
4
|
-
}
|
|
5
|
-
export default class Demo extends React.Component<{}, Props> {
|
|
6
|
-
state: {
|
|
7
|
-
data: ({
|
|
8
|
-
name: string;
|
|
9
|
-
size: number;
|
|
10
|
-
children: never[];
|
|
11
|
-
} | {
|
|
12
|
-
name: string;
|
|
13
|
-
size: number;
|
|
14
|
-
children?: undefined;
|
|
15
|
-
})[];
|
|
16
|
-
};
|
|
17
|
-
loadData(node: any): Promise<void>;
|
|
18
|
-
render(): React.JSX.Element;
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
-
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
4
|
-
import { __decorate } from "tslib";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { Table, TableColumn } from '@king-design/react';
|
|
7
|
-
import { bind } from '@king-design/react';
|
|
8
|
-
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
9
|
-
_inheritsLoose(Demo, _React$Component);
|
|
10
|
-
function Demo() {
|
|
11
|
-
var _context;
|
|
12
|
-
var _this;
|
|
13
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14
|
-
args[_key] = arguments[_key];
|
|
15
|
-
}
|
|
16
|
-
_this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
17
|
-
_this.state = {
|
|
18
|
-
data: [{
|
|
19
|
-
name: 'Audios',
|
|
20
|
-
size: 12,
|
|
21
|
-
children: []
|
|
22
|
-
}, {
|
|
23
|
-
name: 'Images',
|
|
24
|
-
size: 14,
|
|
25
|
-
children: []
|
|
26
|
-
}, {
|
|
27
|
-
name: 'doc.pdf',
|
|
28
|
-
size: 18
|
|
29
|
-
}]
|
|
30
|
-
};
|
|
31
|
-
return _this;
|
|
32
|
-
}
|
|
33
|
-
var _proto = Demo.prototype;
|
|
34
|
-
_proto.loadData = function loadData(node) {
|
|
35
|
-
var _this2 = this;
|
|
36
|
-
return new _Promise(function (resolve) {
|
|
37
|
-
setTimeout(function () {
|
|
38
|
-
var _context2;
|
|
39
|
-
node.children = [{
|
|
40
|
-
name: 'child1',
|
|
41
|
-
size: 17
|
|
42
|
-
}, {
|
|
43
|
-
name: 'child2',
|
|
44
|
-
size: 15,
|
|
45
|
-
loaded: true
|
|
46
|
-
}];
|
|
47
|
-
_this2.setState({
|
|
48
|
-
data: _concatInstanceProperty(_context2 = []).call(_context2, _this2.state.data)
|
|
49
|
-
});
|
|
50
|
-
resolve();
|
|
51
|
-
}, 2000);
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
_proto.render = function render() {
|
|
55
|
-
return /*#__PURE__*/React.createElement(Table, {
|
|
56
|
-
data: this.state.data,
|
|
57
|
-
rowKey: function rowKey(data) {
|
|
58
|
-
return data.name;
|
|
59
|
-
},
|
|
60
|
-
load: this.loadData
|
|
61
|
-
}, /*#__PURE__*/React.createElement(TableColumn, {
|
|
62
|
-
key: "name",
|
|
63
|
-
title: "Name"
|
|
64
|
-
}), /*#__PURE__*/React.createElement(TableColumn, {
|
|
65
|
-
key: "size",
|
|
66
|
-
title: "Size",
|
|
67
|
-
slotTemplate: function slotTemplate(_ref) {
|
|
68
|
-
var data = _ref[0];
|
|
69
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, data.size, "MB");
|
|
70
|
-
}
|
|
71
|
-
}));
|
|
72
|
-
};
|
|
73
|
-
return Demo;
|
|
74
|
-
}(React.Component);
|
|
75
|
-
export { Demo as default };
|
|
76
|
-
__decorate([bind], Demo.prototype, "loadData", null);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { default as data } from './index.json';
|
|
2
|
-
import { Component } from 'intact';
|
|
3
|
-
import './index.styl';
|
|
4
|
-
export default class extends Component {
|
|
5
|
-
static template: string | import("intact").Template<any>;
|
|
6
|
-
static defaults(): {
|
|
7
|
-
data: {
|
|
8
|
-
a: string;
|
|
9
|
-
b: string;
|
|
10
|
-
}[];
|
|
11
|
-
};
|
|
12
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
-
export { default as data } from './index.json';
|
|
3
|
-
import { Component } from 'intact';
|
|
4
|
-
import template from './index.vdt';
|
|
5
|
-
import './index.styl';
|
|
6
|
-
var default_1 = /*#__PURE__*/function (_Component) {
|
|
7
|
-
_inheritsLoose(default_1, _Component);
|
|
8
|
-
function default_1() {
|
|
9
|
-
return _Component.apply(this, arguments) || this;
|
|
10
|
-
}
|
|
11
|
-
default_1.defaults = function defaults() {
|
|
12
|
-
return {
|
|
13
|
-
data: [{
|
|
14
|
-
a: 'Cell 1-1',
|
|
15
|
-
b: 'Cell 1-2'
|
|
16
|
-
}, {
|
|
17
|
-
a: 'Cell 2-1',
|
|
18
|
-
b: 'Cell 2-2'
|
|
19
|
-
}]
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
return default_1;
|
|
23
|
-
}(Component);
|
|
24
|
-
default_1.template = template;
|
|
25
|
-
export { default_1 as default };
|