@king-design/intact 3.1.3 → 3.1.4-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 +2 -2
- package/components/button/demos/ghost.md +3 -3
- package/components/button/demos/group.md +9 -3
- package/components/button/index.vdt +4 -4
- package/components/button/styles.ts +21 -5
- package/components/card/demos/size.md +34 -0
- package/components/card/index.md +1 -0
- package/components/card/index.ts +5 -1
- package/components/card/index.vdt +2 -1
- package/components/card/styles.ts +43 -5
- package/components/carousel/useAutoplay.ts +5 -2
- package/components/config/demos/basic.md +17 -1
- package/components/dropdown/usePosition.ts +11 -12
- package/components/editable/styles.ts +1 -1
- package/components/icon/styles.ts +1 -0
- package/components/input/styles.ts +1 -0
- package/components/message/message.ts +10 -6
- package/components/message/message.vdt +1 -1
- package/components/message/messages.ts +10 -1
- package/components/message/messages.vdt +11 -8
- package/components/table/table.ts +2 -2
- package/components/table/useFixedColumns.ts +1 -1
- package/components/table/{useRestRowStatus.ts → useResetRowStatus.ts} +1 -1
- package/components/tabs/tab.ts +1 -0
- package/components/wave/index.ts +5 -2
- package/es/components/button/index.vdt.js +2 -3
- package/es/components/button/styles.js +6 -6
- package/es/components/card/index.d.ts +2 -0
- package/es/components/card/index.js +4 -2
- package/es/components/card/index.vdt.js +3 -2
- package/es/components/card/styles.js +22 -3
- package/es/components/carousel/useAutoplay.js +5 -2
- package/es/components/dropdown/usePosition.js +0 -1
- package/es/components/editable/styles.js +1 -1
- package/es/components/icon/styles.js +1 -1
- package/es/components/input/styles.js +1 -1
- package/es/components/message/message.d.ts +1 -0
- package/es/components/message/message.js +12 -10
- package/es/components/message/message.vdt.js +2 -1
- package/es/components/message/messages.d.ts +5 -1
- package/es/components/message/messages.js +5 -1
- package/es/components/message/messages.vdt.js +13 -7
- package/es/components/table/table.js +2 -2
- package/es/components/table/useFixedColumns.js +1 -1
- package/es/components/table/{useRestRowStatus.d.ts → useResetRowStatus.d.ts} +1 -1
- package/es/components/table/{useRestRowStatus.js → useResetRowStatus.js} +1 -1
- package/es/components/tabs/tab.d.ts +2 -1
- package/es/components/tabs/tab.js +1 -0
- package/es/components/wave/index.js +6 -2
- package/es/hooks/useDelayClose.js +11 -6
- package/es/hooks/useMouseOutsidable.js +6 -2
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/button/demos/disabled/react.js +3 -3
- package/es/site/data/components/button/demos/ghost/react.js +7 -3
- package/es/site/data/components/button/demos/group/react.js +17 -5
- package/es/site/data/components/card/demos/size/index.d.ts +6 -0
- package/es/site/data/components/card/demos/size/index.js +18 -0
- package/es/site/data/components/card/demos/size/react.d.ts +5 -0
- package/es/site/data/components/card/demos/size/react.js +37 -0
- package/es/site/data/components/config/demos/basic/index.d.ts +1 -0
- package/es/site/data/components/config/demos/basic/index.js +8 -0
- package/es/site/data/components/config/demos/basic/react.d.ts +1 -0
- package/es/site/data/components/config/demos/basic/react.js +9 -1
- package/es/site/data/components/menu/demos/collapse/react.d.ts +11 -0
- package/es/site/data/components/menu/demos/size/react.d.ts +7 -0
- package/hooks/useDelayClose.ts +11 -6
- package/hooks/useMouseOutsidable.ts +6 -2
- package/index.ts +2 -2
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
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 { Button, ButtonGroup } from '@king-design/react';
|
|
4
|
+
import { Button, ButtonGroup, Icon } from '@king-design/react';
|
|
5
5
|
import './index.styl';
|
|
6
6
|
|
|
7
7
|
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
@@ -45,12 +45,12 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
45
45
|
type: "flat"
|
|
46
46
|
}, "\u91CD\u542F")), /*#__PURE__*/React.createElement(ButtonGroup, null, /*#__PURE__*/React.createElement(Button, {
|
|
47
47
|
type: "primary"
|
|
48
|
-
}, /*#__PURE__*/React.createElement(
|
|
49
|
-
className: "k-icon
|
|
48
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
49
|
+
className: "k-icon-left"
|
|
50
50
|
}), "\u4E0A\u4E00\u9875"), /*#__PURE__*/React.createElement(Button, {
|
|
51
51
|
type: "primary"
|
|
52
|
-
}, "\u4E0B\u4E00\u9875", /*#__PURE__*/React.createElement(
|
|
53
|
-
className: "k-icon
|
|
52
|
+
}, "\u4E0B\u4E00\u9875", /*#__PURE__*/React.createElement(Icon, {
|
|
53
|
+
className: "k-icon-right"
|
|
54
54
|
}))), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u7EB5\u5411\u6309\u94AE\u7EC4"), /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
55
55
|
vertical: true
|
|
56
56
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -138,6 +138,18 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
138
138
|
value: "guangzhou"
|
|
139
139
|
}, "\u5E7F\u5DDE"), /*#__PURE__*/React.createElement(Button, {
|
|
140
140
|
value: "shenzhen"
|
|
141
|
+
}, "\u6DF1\u5733")), /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
142
|
+
seperate: true
|
|
143
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
144
|
+
value: "beijing",
|
|
145
|
+
type: "primary",
|
|
146
|
+
disabled: true
|
|
147
|
+
}, "\u5317\u4EAC"), /*#__PURE__*/React.createElement(Button, {
|
|
148
|
+
value: "shanghai"
|
|
149
|
+
}, "\u4E0A\u6D77"), /*#__PURE__*/React.createElement(Button, {
|
|
150
|
+
value: "guangzhou"
|
|
151
|
+
}, "\u5E7F\u5DDE"), /*#__PURE__*/React.createElement(Button, {
|
|
152
|
+
value: "shenzhen"
|
|
141
153
|
}, "\u6DF1\u5733")));
|
|
142
154
|
};
|
|
143
155
|
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
|
|
7
|
+
var default_1 = /*#__PURE__*/function (_Component) {
|
|
8
|
+
_inheritsLoose(default_1, _Component);
|
|
9
|
+
|
|
10
|
+
function default_1() {
|
|
11
|
+
return _Component.apply(this, arguments) || this;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return default_1;
|
|
15
|
+
}(Component);
|
|
16
|
+
|
|
17
|
+
default_1.template = template;
|
|
18
|
+
export { default_1 as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Card } from '@king-design/react';
|
|
4
|
+
import './index.styl';
|
|
5
|
+
|
|
6
|
+
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
7
|
+
_inheritsLoose(Demo, _React$Component);
|
|
8
|
+
|
|
9
|
+
function Demo() {
|
|
10
|
+
return _React$Component.apply(this, arguments) || this;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
var _proto = Demo.prototype;
|
|
14
|
+
|
|
15
|
+
_proto.render = function render() {
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Card, {
|
|
17
|
+
title: "\u7528\u6237\u4FE1\u606F",
|
|
18
|
+
type: "border",
|
|
19
|
+
size: "large"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("div", null, "\u5361\u7247\u5185\u5BB9"), /*#__PURE__*/React.createElement("div", null, "\u5361\u7247\u5185\u5BB9")), /*#__PURE__*/React.createElement(Card, {
|
|
21
|
+
title: "\u7528\u6237\u4FE1\u606F",
|
|
22
|
+
type: "border"
|
|
23
|
+
}, /*#__PURE__*/React.createElement("div", null, "\u5361\u7247\u5185\u5BB9"), /*#__PURE__*/React.createElement("div", null, "\u5361\u7247\u5185\u5BB9")), /*#__PURE__*/React.createElement(Card, {
|
|
24
|
+
title: "\u7528\u6237\u4FE1\u606F",
|
|
25
|
+
type: "border",
|
|
26
|
+
size: "small"
|
|
27
|
+
}, /*#__PURE__*/React.createElement("div", null, "\u5361\u7247\u5185\u5BB9"), /*#__PURE__*/React.createElement("div", null, "\u5361\u7247\u5185\u5BB9")), /*#__PURE__*/React.createElement(Card, {
|
|
28
|
+
title: "\u7528\u6237\u4FE1\u606F",
|
|
29
|
+
type: "border",
|
|
30
|
+
size: "mini"
|
|
31
|
+
}, /*#__PURE__*/React.createElement("div", null, "\u5361\u7247\u5185\u5BB9"), /*#__PURE__*/React.createElement("div", null, "\u5361\u7247\u5185\u5BB9")));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return Demo;
|
|
35
|
+
}(React.Component);
|
|
36
|
+
|
|
37
|
+
export { Demo as default };
|
|
@@ -2,6 +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 { Message } from 'kpc';
|
|
6
|
+
Message.classNamePrefix = 'kd';
|
|
5
7
|
|
|
6
8
|
var default_1 = /*#__PURE__*/function (_Component) {
|
|
7
9
|
_inheritsLoose(default_1, _Component);
|
|
@@ -10,6 +12,12 @@ var default_1 = /*#__PURE__*/function (_Component) {
|
|
|
10
12
|
return _Component.apply(this, arguments) || this;
|
|
11
13
|
}
|
|
12
14
|
|
|
15
|
+
var _proto = default_1.prototype;
|
|
16
|
+
|
|
17
|
+
_proto.showMessage = function showMessage() {
|
|
18
|
+
Message.info('Message with classNamePrefix');
|
|
19
|
+
};
|
|
20
|
+
|
|
13
21
|
return default_1;
|
|
14
22
|
}(Component);
|
|
15
23
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ConfigProvider, Button, Input } from '@king-design/react';
|
|
4
|
+
import { Message } from '@king-design/react';
|
|
5
|
+
Message.classNamePrefix = 'kd';
|
|
4
6
|
|
|
5
7
|
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
6
8
|
_inheritsLoose(Demo, _React$Component);
|
|
@@ -11,12 +13,18 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
11
13
|
|
|
12
14
|
var _proto = Demo.prototype;
|
|
13
15
|
|
|
16
|
+
_proto.showMessage = function showMessage() {
|
|
17
|
+
Message.info('Message with classNamePrefix');
|
|
18
|
+
};
|
|
19
|
+
|
|
14
20
|
_proto.render = function render() {
|
|
15
21
|
return /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
16
22
|
value: {
|
|
17
23
|
classNamePrefix: 'kd'
|
|
18
24
|
}
|
|
19
|
-
}, /*#__PURE__*/React.createElement(Button,
|
|
25
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
26
|
+
onClick: this.showMessage
|
|
27
|
+
}, "Button"), /*#__PURE__*/React.createElement("div", {
|
|
20
28
|
style: {
|
|
21
29
|
"marginTop": "8px"
|
|
22
30
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuProps } from '@king-design/react';
|
|
3
|
+
interface Props extends MenuProps {
|
|
4
|
+
}
|
|
5
|
+
export default class Demo extends React.Component<{}, Props> {
|
|
6
|
+
state: MenuProps<import("misstime").Key>;
|
|
7
|
+
private __test;
|
|
8
|
+
setTheme(theme?: string): void;
|
|
9
|
+
render(): JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
package/hooks/useDelayClose.ts
CHANGED
|
@@ -4,7 +4,7 @@ export function useDelayClose(close: () => void, duration: number) {
|
|
|
4
4
|
const instance = useInstance() as Component<
|
|
5
5
|
{}, {mouseenter: [MouseEvent], mouseleave: [MouseEvent]}
|
|
6
6
|
>;
|
|
7
|
-
let timer: number;
|
|
7
|
+
let timer: number | null = null;
|
|
8
8
|
|
|
9
9
|
function delayClose() {
|
|
10
10
|
if (duration) {
|
|
@@ -14,7 +14,7 @@ export function useDelayClose(close: () => void, duration: number) {
|
|
|
14
14
|
|
|
15
15
|
function onMouseEnter(e: MouseEvent) {
|
|
16
16
|
instance!.trigger('mouseenter', e);
|
|
17
|
-
|
|
17
|
+
clear();
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
function onMouseLeave(e: MouseEvent) {
|
|
@@ -25,14 +25,19 @@ export function useDelayClose(close: () => void, duration: number) {
|
|
|
25
25
|
// so we must detect the $unmounted status here
|
|
26
26
|
if (instance!.$unmounted) return;
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
clear();
|
|
29
29
|
delayClose();
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
function clear() {
|
|
33
|
+
if (timer) {
|
|
34
|
+
clearTimeout(timer);
|
|
35
|
+
timer = null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
32
39
|
onMounted(delayClose);
|
|
33
|
-
onUnmounted(
|
|
34
|
-
clearTimeout(timer);
|
|
35
|
-
});
|
|
40
|
+
onUnmounted(clear);
|
|
36
41
|
|
|
37
42
|
return {onMouseEnter, onMouseLeave};
|
|
38
43
|
}
|
|
@@ -6,7 +6,7 @@ import {onBeforeUnmount, RefObject, onMounted} from 'intact';
|
|
|
6
6
|
import {containsOrEqual} from './useDocumentClick';
|
|
7
7
|
|
|
8
8
|
export function useMouseOutsidable(elementRef: RefObject<HTMLElement>, autoAdd: boolean = true) {
|
|
9
|
-
let timer: number;
|
|
9
|
+
let timer: number | null = null;
|
|
10
10
|
|
|
11
11
|
function onMouseDown() {
|
|
12
12
|
document.addEventListener('click', onDocumentClick, true);
|
|
@@ -16,6 +16,7 @@ export function useMouseOutsidable(elementRef: RefObject<HTMLElement>, autoAdd:
|
|
|
16
16
|
function onMouseUp() {
|
|
17
17
|
timer = window.setTimeout(() => {
|
|
18
18
|
document.removeEventListener('click', onDocumentClick, true);
|
|
19
|
+
timer = null;
|
|
19
20
|
});
|
|
20
21
|
document.removeEventListener('mouseup', onMouseUp);
|
|
21
22
|
}
|
|
@@ -33,7 +34,10 @@ export function useMouseOutsidable(elementRef: RefObject<HTMLElement>, autoAdd:
|
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
onBeforeUnmount(() => {
|
|
36
|
-
|
|
37
|
+
if (timer) {
|
|
38
|
+
clearTimeout(timer);
|
|
39
|
+
timer = null;
|
|
40
|
+
}
|
|
37
41
|
if (autoAdd) {
|
|
38
42
|
elementRef.value!.removeEventListener('mousedown', onMouseDown);
|
|
39
43
|
}
|
package/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.1.
|
|
2
|
+
* @king-design v3.1.4-beta.1
|
|
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.
|
|
68
|
+
export const version = '3.1.4-beta.1';
|
|
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.
|
|
3
|
+
"version": "3.1.4-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": {
|
|
@@ -179,10 +179,10 @@
|
|
|
179
179
|
"dependencies": {
|
|
180
180
|
"@babel/runtime-corejs3": "^7.16.0",
|
|
181
181
|
"@emotion/css": "^11.5.0",
|
|
182
|
-
"@king-design/react": "^3.1.
|
|
182
|
+
"@king-design/react": "^3.1.4-beta.1",
|
|
183
183
|
"dayjs": "^1.10.7",
|
|
184
184
|
"enquire.js": "^2.1.6",
|
|
185
|
-
"intact": "^3.0.
|
|
185
|
+
"intact": "^3.0.25",
|
|
186
186
|
"monaco-editor": "^0.26.1",
|
|
187
187
|
"mxgraphx": "^4.0.7",
|
|
188
188
|
"resize-observer-polyfill": "^1.5.1",
|