@king-design/intact 3.6.2-beta.1 → 3.7.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/.DS_Store +0 -0
- package/components/anchor/constants.ts +3 -0
- package/components/anchor/demos/basic.md +34 -0
- package/components/anchor/demos/container.md +76 -0
- package/components/anchor/demos/events.md +100 -0
- package/components/anchor/demos/horizontal.md +33 -0
- package/components/anchor/demos/nested.md +132 -0
- package/components/anchor/index.md +38 -0
- package/components/anchor/index.spec.ts +171 -0
- package/components/anchor/index.ts +159 -0
- package/components/anchor/index.vdt +24 -0
- package/components/anchor/link.ts +44 -0
- package/components/anchor/link.vdt +49 -0
- package/components/anchor/styles.ts +50 -0
- package/components/anchor/useScroll.ts +221 -0
- package/components/config/demos/basic.md +11 -3
- package/components/descriptions/.DS_Store +0 -0
- package/components/dialog/base.vdt +3 -1
- package/components/drawer/demos/resizable.md +67 -0
- package/components/drawer/index.md +1 -0
- package/components/drawer/index.spec.ts +43 -0
- package/components/drawer/index.ts +14 -0
- package/components/drawer/index.vdt +20 -3
- package/components/drawer/styles.ts +44 -0
- package/components/drawer/useDrawerResizable.ts +190 -0
- package/components/icon/demos/color.md +1 -1
- package/components/icon/demos/icons.md +18 -0
- package/components/menu/.DS_Store +0 -0
- package/components/menu/demos/.DS_Store +0 -0
- package/components/menu/demos/collapse.md +2 -2
- package/components/menu/demos/showCollapseArrow.md +3 -3
- package/components/menu/demos/size.md +4 -4
- package/components/menu/styles.ts +7 -3
- package/components/notification/demos/basic.md +27 -0
- package/components/notification/demos/close.md +52 -0
- package/components/notification/demos/duration.md +43 -0
- package/components/notification/demos/events.md +39 -0
- package/components/notification/demos/hideClose.md +30 -0
- package/components/notification/demos/icon.md +47 -0
- package/components/notification/demos/position.md +39 -0
- package/components/notification/demos/types.md +38 -0
- package/components/notification/index.md +62 -0
- package/components/notification/index.spec.ts +211 -0
- package/components/notification/index.ts +2 -0
- package/components/notification/notification.ts +185 -0
- package/components/notification/notification.vdt +62 -0
- package/components/notification/notifications.ts +46 -0
- package/components/notification/notifications.vdt +16 -0
- package/components/notification/styles.ts +179 -0
- package/components/select/styles.ts +2 -0
- package/components/table/.DS_Store +0 -0
- package/components/table/demos/hidden.md +8 -2
- package/components/table/demos/sort.md +4 -4
- package/components/table/styles.ts +6 -2
- package/components/tabs/useActiveBar.ts +3 -3
- package/components/tag/base.ts +4 -0
- package/components/tag/demos/border.md +1 -1
- package/components/tag/demos/color.md +40 -0
- package/components/tag/demos/draggable.md +1 -1
- package/components/tag/demos/tags.md +1 -1
- package/components/tag/index.md +1 -0
- package/components/tag/index.spec.ts +8 -0
- package/components/tag/index.vdt +6 -4
- package/components/tag/styles.ts +23 -0
- package/components/tag/useColor.ts +79 -0
- package/components/timepicker/index.spec.ts +16 -5
- package/components/timepicker/useDefaultValue.ts +16 -7
- package/components/timepicker/useStep.ts +3 -2
- package/components/tour/.DS_Store +0 -0
- package/components/transfer/demos/customFilter.md +1 -1
- package/components/transfer/demos/customList.md +1 -1
- package/components/transfer/demos/getData.md +1 -1
- package/components/transfer/demos/leftChecked.md +1 -1
- package/components/transfer/demos/pagination.md +63 -0
- package/components/transfer/demos/table.md +248 -0
- package/components/transfer/demos/tree.md +1 -1
- package/components/transfer/index.md +2 -0
- package/components/transfer/index.spec.ts +147 -0
- package/components/transfer/index.ts +7 -0
- package/components/transfer/index.vdt +30 -4
- package/components/transfer/styles.ts +11 -1
- package/components/transfer/useCheck.ts +5 -5
- package/components/transfer/usePagination.ts +92 -0
- package/components/virtualList/.DS_Store +0 -0
- package/components/virtualList/demos/.DS_Store +0 -0
- package/dist/fonts/iconfont.eot +0 -0
- package/dist/fonts/iconfont.svg +235 -0
- package/dist/fonts/iconfont.ttf +0 -0
- package/dist/fonts/iconfont.woff +0 -0
- package/dist/fonts/iconfont.woff2 +0 -0
- package/dist/fonts/ionicons.eot +0 -0
- package/dist/fonts/ionicons.svg +2230 -0
- package/dist/fonts/ionicons.ttf +0 -0
- package/dist/fonts/ionicons.woff +0 -0
- package/dist/fonts/ionicons.woff2 +0 -0
- package/dist/i18n/en-US.js +1411 -0
- package/dist/i18n/en-US.js.map +1 -0
- package/dist/i18n/en-US.min.js +1 -0
- package/dist/i18n/index.js +283 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/index.min.js +1 -0
- package/dist/kpc.js +50764 -0
- package/dist/kpc.js.map +1 -0
- package/dist/kpc.min.js +1 -0
- package/dist/kpc.react.js +58380 -0
- package/dist/kpc.react.js.map +1 -0
- package/dist/kpc.react.min.js +1 -0
- package/dist/kpc.tmp.js.map +1 -0
- package/dist/kpc.vue-legacy.js +58272 -0
- package/dist/kpc.vue-legacy.js.map +1 -0
- package/dist/kpc.vue-legacy.min.js +1 -0
- package/dist/kpc.vue.js +58128 -0
- package/dist/kpc.vue.js.map +1 -0
- package/dist/kpc.vue.min.js +1 -0
- package/es/components/anchor/constants.d.ts +2 -0
- package/es/components/anchor/constants.js +2 -0
- package/es/components/anchor/index.d.ts +41 -0
- package/es/components/anchor/index.js +141 -0
- package/es/components/anchor/index.spec.d.ts +1 -0
- package/es/components/anchor/index.spec.js +230 -0
- package/es/components/anchor/index.vdt.js +31 -0
- package/es/components/anchor/link.d.ts +16 -0
- package/es/components/anchor/link.js +52 -0
- package/es/components/anchor/link.vdt.js +49 -0
- package/es/components/anchor/styles.d.ts +5 -0
- package/es/components/anchor/styles.js +30 -0
- package/es/components/anchor/useScroll.d.ts +7 -0
- package/es/components/anchor/useScroll.js +218 -0
- package/es/components/dialog/base.vdt.js +1 -1
- package/es/components/drawer/index.d.ts +3 -0
- package/es/components/drawer/index.js +22 -3
- package/es/components/drawer/index.spec.js +83 -0
- package/es/components/drawer/index.vdt.js +23 -3
- package/es/components/drawer/styles.js +1 -1
- package/es/components/drawer/useDrawerResizable.d.ts +10 -0
- package/es/components/drawer/useDrawerResizable.js +162 -0
- package/es/components/menu/styles.d.ts +1 -0
- package/es/components/menu/styles.js +4 -1
- package/es/components/notification/index.d.ts +1 -0
- package/es/components/notification/index.js +1 -0
- package/es/components/notification/index.spec.d.ts +1 -0
- package/es/components/notification/index.spec.js +317 -0
- package/es/components/notification/notification.d.ts +39 -0
- package/es/components/notification/notification.js +183 -0
- package/es/components/notification/notification.vdt.js +56 -0
- package/es/components/notification/notifications.d.ts +16 -0
- package/es/components/notification/notifications.js +51 -0
- package/es/components/notification/notifications.vdt.js +24 -0
- package/es/components/notification/styles.d.ts +9 -0
- package/es/components/notification/styles.js +110 -0
- package/es/components/select/styles.js +1 -1
- package/es/components/table/styles.js +1 -1
- package/es/components/tabs/useActiveBar.js +7 -3
- package/es/components/tag/base.d.ts +2 -0
- package/es/components/tag/base.js +3 -0
- package/es/components/tag/index.spec.js +17 -0
- package/es/components/tag/index.vdt.js +12 -5
- package/es/components/tag/styles.d.ts +9 -0
- package/es/components/tag/styles.js +14 -1
- package/es/components/tag/useColor.d.ts +7 -0
- package/es/components/tag/useColor.js +71 -0
- package/es/components/timepicker/index.spec.js +70 -42
- package/es/components/timepicker/useDefaultValue.js +12 -7
- package/es/components/timepicker/useStep.js +4 -2
- package/es/components/transfer/index.d.ts +13 -0
- package/es/components/transfer/index.js +6 -2
- package/es/components/transfer/index.spec.js +197 -0
- package/es/components/transfer/index.vdt.js +28 -5
- package/es/components/transfer/styles.js +4 -1
- package/es/components/transfer/useCheck.js +2 -1
- package/es/components/transfer/usePagination.d.ts +12 -0
- package/es/components/transfer/usePagination.js +79 -0
- package/es/index.d.ts +4 -2
- package/es/index.js +4 -2
- package/es/site/data/components/anchor/demos/basic/index.d.ts +11 -0
- package/es/site/data/components/anchor/demos/basic/index.js +18 -0
- package/es/site/data/components/anchor/demos/basic/react.d.ts +11 -0
- package/es/site/data/components/anchor/demos/basic/react.js +46 -0
- package/es/site/data/components/anchor/demos/container/index.d.ts +12 -0
- package/es/site/data/components/anchor/demos/container/index.js +19 -0
- package/es/site/data/components/anchor/demos/container/react.d.ts +12 -0
- package/es/site/data/components/anchor/demos/container/react.js +52 -0
- package/es/site/data/components/anchor/demos/events/index.d.ts +17 -0
- package/es/site/data/components/anchor/demos/events/index.js +36 -0
- package/es/site/data/components/anchor/demos/events/react.d.ts +17 -0
- package/es/site/data/components/anchor/demos/events/react.js +88 -0
- package/es/site/data/components/anchor/demos/horizontal/index.d.ts +11 -0
- package/es/site/data/components/anchor/demos/horizontal/index.js +18 -0
- package/es/site/data/components/anchor/demos/horizontal/react.d.ts +11 -0
- package/es/site/data/components/anchor/demos/horizontal/react.js +46 -0
- package/es/site/data/components/anchor/demos/nested/index.d.ts +12 -0
- package/es/site/data/components/anchor/demos/nested/index.js +19 -0
- package/es/site/data/components/anchor/demos/nested/react.d.ts +12 -0
- package/es/site/data/components/anchor/demos/nested/react.js +100 -0
- package/es/site/data/components/anchor/index.d.ts +57 -0
- package/es/site/data/components/anchor/index.js +32 -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 -1
- package/es/site/data/components/config/demos/basic/react.d.ts +1 -0
- package/es/site/data/components/config/demos/basic/react.js +15 -3
- package/es/site/data/components/drawer/demos/resizable/index.d.ts +15 -0
- package/es/site/data/components/drawer/demos/resizable/index.js +26 -0
- package/es/site/data/components/drawer/demos/resizable/react.d.ts +15 -0
- package/es/site/data/components/drawer/demos/resizable/react.js +63 -0
- package/es/site/data/components/icon/demos/icons/index.js +1 -1
- package/es/site/data/components/menu/demos/collapse/index.d.ts +6 -1
- package/es/site/data/components/menu/demos/collapse/react.d.ts +6 -1
- package/es/site/data/components/menu/demos/showCollapseArrow/index.d.ts +8 -1
- package/es/site/data/components/menu/demos/showCollapseArrow/react.d.ts +8 -1
- package/es/site/data/components/menu/demos/size/index.d.ts +7 -2
- package/es/site/data/components/menu/demos/size/react.d.ts +7 -2
- package/es/site/data/components/notification/demos/basic/index.d.ts +6 -0
- package/es/site/data/components/notification/demos/basic/index.js +21 -0
- package/es/site/data/components/notification/demos/basic/react.d.ts +5 -0
- package/es/site/data/components/notification/demos/basic/react.js +24 -0
- package/es/site/data/components/notification/demos/close/index.d.ts +13 -0
- package/es/site/data/components/notification/demos/close/index.js +38 -0
- package/es/site/data/components/notification/demos/close/react.d.ts +13 -0
- package/es/site/data/components/notification/demos/close/react.js +52 -0
- package/es/site/data/components/notification/demos/duration/index.d.ts +7 -0
- package/es/site/data/components/notification/demos/duration/index.js +33 -0
- package/es/site/data/components/notification/demos/duration/react.d.ts +6 -0
- package/es/site/data/components/notification/demos/duration/react.js +38 -0
- package/es/site/data/components/notification/demos/events/index.d.ts +6 -0
- package/es/site/data/components/notification/demos/events/index.js +31 -0
- package/es/site/data/components/notification/demos/events/react.d.ts +5 -0
- package/es/site/data/components/notification/demos/events/react.js +34 -0
- package/es/site/data/components/notification/demos/hideClose/index.d.ts +6 -0
- package/es/site/data/components/notification/demos/hideClose/index.js +25 -0
- package/es/site/data/components/notification/demos/hideClose/react.d.ts +5 -0
- package/es/site/data/components/notification/demos/hideClose/react.js +28 -0
- package/es/site/data/components/notification/demos/icon/index.d.ts +7 -0
- package/es/site/data/components/notification/demos/icon/index.js +33 -0
- package/es/site/data/components/notification/demos/icon/react.d.ts +6 -0
- package/es/site/data/components/notification/demos/icon/react.js +42 -0
- package/es/site/data/components/notification/demos/position/index.d.ts +9 -0
- package/es/site/data/components/notification/demos/position/index.js +27 -0
- package/es/site/data/components/notification/demos/position/react.d.ts +8 -0
- package/es/site/data/components/notification/demos/position/react.js +40 -0
- package/es/site/data/components/notification/demos/types/index.d.ts +9 -0
- package/es/site/data/components/notification/demos/types/index.js +26 -0
- package/es/site/data/components/notification/demos/types/react.d.ts +8 -0
- package/es/site/data/components/notification/demos/types/react.js +39 -0
- package/es/site/data/components/notification/index.d.ts +57 -0
- package/es/site/data/components/notification/index.js +32 -0
- package/es/site/data/components/table/demos/hidden/react.js +21 -3
- package/es/site/data/components/tag/demos/color/index.d.ts +10 -0
- package/es/site/data/components/tag/demos/color/index.js +19 -0
- package/es/site/data/components/tag/demos/color/react.d.ts +10 -0
- package/es/site/data/components/tag/demos/color/react.js +34 -0
- package/es/site/data/components/transfer/demos/pagination/index.d.ts +19 -0
- package/es/site/data/components/transfer/demos/pagination/index.js +42 -0
- package/es/site/data/components/transfer/demos/pagination/react.d.ts +20 -0
- package/es/site/data/components/transfer/demos/pagination/react.js +65 -0
- package/es/site/data/components/transfer/demos/table/index.d.ts +33 -0
- package/es/site/data/components/transfer/demos/table/index.js +132 -0
- package/es/site/data/components/transfer/demos/table/react.d.ts +35 -0
- package/es/site/data/components/transfer/demos/table/react.js +246 -0
- package/es/site/src/router/index.js +4 -33
- package/es/styles/fonts/iconfont.eot +0 -0
- package/es/styles/fonts/iconfont.js +1 -1
- package/es/styles/fonts/iconfont.svg +38 -0
- package/es/styles/fonts/iconfont.ttf +0 -0
- package/es/styles/fonts/iconfont.woff +0 -0
- package/es/styles/fonts/iconfont.woff2 +0 -0
- package/es/styles/theme.d.ts +8 -0
- package/es/styles/theme.js +5 -1
- package/index.ts +4 -2
- package/package.json +2 -2
- package/styles/.DS_Store +0 -0
- package/styles/fonts/demo_index.html +443 -6
- package/styles/fonts/iconfont.css +82 -6
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.js +1 -1
- package/styles/fonts/iconfont.json +133 -0
- package/styles/fonts/iconfont.svg +38 -0
- package/styles/fonts/iconfont.ts +76 -0
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/fonts/iconfont.woff2 +0 -0
- package/styles/theme.ts +4 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
3
|
+
import _keysInstanceProperty from "@babel/runtime-corejs3/core-js/instance/keys";
|
|
4
|
+
import _startsWithInstanceProperty from "@babel/runtime-corejs3/core-js/instance/starts-with";
|
|
5
|
+
import Article from '~/../src/components/article';
|
|
6
|
+
import data from './index.json';
|
|
7
|
+
import sidebar from '~/doc.json';
|
|
8
|
+
var r = require.context('./', true, /demos.*(index|demo).ts/);
|
|
9
|
+
var keys = _keysInstanceProperty(r).call(r);
|
|
10
|
+
var demos = [];
|
|
11
|
+
for (var i = 0; i < keys.length; i++) {
|
|
12
|
+
var file = keys[i];
|
|
13
|
+
if (!_startsWithInstanceProperty(file).call(file, '.')) continue;
|
|
14
|
+
// if we found demo.js then ignore index.js
|
|
15
|
+
if (/demo.ts$/.test(file)) i++;
|
|
16
|
+
demos.push(r(file));
|
|
17
|
+
}
|
|
18
|
+
var default_1 = /*#__PURE__*/function (_Article) {
|
|
19
|
+
_inheritsLoose(default_1, _Article);
|
|
20
|
+
function default_1() {
|
|
21
|
+
return _Article.apply(this, arguments) || this;
|
|
22
|
+
}
|
|
23
|
+
return default_1;
|
|
24
|
+
}(Article);
|
|
25
|
+
default_1.sidebar = sidebar;
|
|
26
|
+
default_1.data = data;
|
|
27
|
+
default_1.defaults = function () {
|
|
28
|
+
return _extends({}, Article.defaults, data, {
|
|
29
|
+
demos: demos
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export { default_1 as default };
|
|
@@ -48,14 +48,32 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
48
48
|
resizable: true
|
|
49
49
|
}, /*#__PURE__*/React.createElement(TableColumn, {
|
|
50
50
|
key: "a",
|
|
51
|
-
title: "Title 1"
|
|
51
|
+
title: "Title 1",
|
|
52
|
+
hidden: true
|
|
52
53
|
}), /*#__PURE__*/React.createElement(TableColumn, {
|
|
53
54
|
key: "b",
|
|
54
|
-
title: "Title 2"
|
|
55
|
-
hidden: true
|
|
55
|
+
title: "Title 2"
|
|
56
56
|
}), /*#__PURE__*/React.createElement(TableColumn, {
|
|
57
57
|
key: "c",
|
|
58
58
|
title: "Title 3"
|
|
59
|
+
})), /*#__PURE__*/React.createElement(Table, {
|
|
60
|
+
data: this.state.data2,
|
|
61
|
+
resizable: true,
|
|
62
|
+
checkType: "none"
|
|
63
|
+
}, /*#__PURE__*/React.createElement(TableColumn, {
|
|
64
|
+
key: "a",
|
|
65
|
+
title: "Title 1",
|
|
66
|
+
hidden: true
|
|
67
|
+
}), /*#__PURE__*/React.createElement(TableColumn, {
|
|
68
|
+
key: "b",
|
|
69
|
+
title: "Title 2"
|
|
70
|
+
}), /*#__PURE__*/React.createElement(TableColumn, {
|
|
71
|
+
key: "c",
|
|
72
|
+
title: "Title 3",
|
|
73
|
+
hidden: true
|
|
74
|
+
}), /*#__PURE__*/React.createElement(TableColumn, {
|
|
75
|
+
key: "d",
|
|
76
|
+
title: "Title 4"
|
|
59
77
|
})));
|
|
60
78
|
};
|
|
61
79
|
return Demo;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as data } from './index.json';
|
|
2
|
+
import { Component } from 'intact';
|
|
3
|
+
import './index.styl';
|
|
4
|
+
interface Props {
|
|
5
|
+
colors: string[];
|
|
6
|
+
}
|
|
7
|
+
export default class extends Component {
|
|
8
|
+
static template: string | import("intact").Template<any>;
|
|
9
|
+
static defaults(): Props;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
colors: ['default', 'primary', 'danger', 'success', 'warning', 'purple', 'teal', 'blue', 'yellow', '#f50', '#87d068', 'rgb(255, 0, 179)']
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
return default_1;
|
|
17
|
+
}(Component);
|
|
18
|
+
default_1.template = template;
|
|
19
|
+
export { default_1 as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Tag } from '@king-design/react';
|
|
6
|
+
import './index.styl';
|
|
7
|
+
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
8
|
+
_inheritsLoose(Demo, _React$Component);
|
|
9
|
+
function Demo() {
|
|
10
|
+
var _context;
|
|
11
|
+
var _this;
|
|
12
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
|
+
args[_key] = arguments[_key];
|
|
14
|
+
}
|
|
15
|
+
_this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
16
|
+
_this.state = {
|
|
17
|
+
colors: ['default', 'primary', 'danger', 'success', 'warning', 'purple', 'teal', 'blue', 'yellow', '#f50', '#87d068', 'rgb(255, 0, 179)']
|
|
18
|
+
};
|
|
19
|
+
return _this;
|
|
20
|
+
}
|
|
21
|
+
var _proto = Demo.prototype;
|
|
22
|
+
_proto.render = function render() {
|
|
23
|
+
var _context2;
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: "container"
|
|
26
|
+
}, _mapInstanceProperty(_context2 = this.state.colors).call(_context2, function ($value, $key) {
|
|
27
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
28
|
+
color: $value
|
|
29
|
+
}, $value);
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
return Demo;
|
|
33
|
+
}(React.Component);
|
|
34
|
+
export { Demo as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { default as data } from './index.json';
|
|
2
|
+
import { Component } from 'intact';
|
|
3
|
+
import type { TransferDataItem } from 'kpc';
|
|
4
|
+
interface Props {
|
|
5
|
+
data: TransferDataItem[];
|
|
6
|
+
value?: number[];
|
|
7
|
+
}
|
|
8
|
+
export default class extends Component<Props> {
|
|
9
|
+
static template: string | import("intact").Template<any>;
|
|
10
|
+
static defaults(): {
|
|
11
|
+
data: TransferDataItem<"key", "label">[];
|
|
12
|
+
value: never[];
|
|
13
|
+
};
|
|
14
|
+
onChangePage(model: 'left' | 'right', data: {
|
|
15
|
+
value: number;
|
|
16
|
+
limit: number;
|
|
17
|
+
}): void;
|
|
18
|
+
customFilter(item: TransferDataItem, keywords: string): boolean;
|
|
19
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
var _context;
|
|
3
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
4
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
|
|
5
|
+
import { __decorate } from "tslib";
|
|
6
|
+
export { default as data } from './index.json';
|
|
7
|
+
import { Component } from 'intact';
|
|
8
|
+
import template from './index.vdt';
|
|
9
|
+
import { range, bind } from 'kpc/components/utils';
|
|
10
|
+
var data = _mapInstanceProperty(_context = range(1, 100)).call(_context, function (item) {
|
|
11
|
+
return {
|
|
12
|
+
label: "\u4E3B\u673A\u540D" + item,
|
|
13
|
+
key: item
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
var default_1 = /*#__PURE__*/function (_Component) {
|
|
17
|
+
_inheritsLoose(default_1, _Component);
|
|
18
|
+
function default_1() {
|
|
19
|
+
return _Component.apply(this, arguments) || this;
|
|
20
|
+
}
|
|
21
|
+
default_1.defaults = function defaults() {
|
|
22
|
+
return {
|
|
23
|
+
data: data,
|
|
24
|
+
value: []
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
var _proto = default_1.prototype;
|
|
28
|
+
_proto.onChangePage = function onChangePage(model, data) {
|
|
29
|
+
console.log(model + " panel: page " + data.value + ", limit " + data.limit);
|
|
30
|
+
};
|
|
31
|
+
_proto.customFilter = function customFilter(item, keywords) {
|
|
32
|
+
var _context2;
|
|
33
|
+
var label = item.label;
|
|
34
|
+
var matchKeywords = _includesInstanceProperty(_context2 = label.toLowerCase()).call(_context2, keywords.toLowerCase());
|
|
35
|
+
return matchKeywords;
|
|
36
|
+
};
|
|
37
|
+
return default_1;
|
|
38
|
+
}(Component);
|
|
39
|
+
default_1.template = template;
|
|
40
|
+
export { default_1 as default };
|
|
41
|
+
__decorate([bind], default_1.prototype, "onChangePage", null);
|
|
42
|
+
__decorate([bind], default_1.prototype, "customFilter", null);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TransferDataItem } from '@king-design/react';
|
|
3
|
+
interface Props {
|
|
4
|
+
data: TransferDataItem[];
|
|
5
|
+
value?: number[];
|
|
6
|
+
}
|
|
7
|
+
export default class Demo extends React.Component<{}, Props> {
|
|
8
|
+
state: {
|
|
9
|
+
data: TransferDataItem<"key", "label">[];
|
|
10
|
+
value: never[];
|
|
11
|
+
};
|
|
12
|
+
private __test;
|
|
13
|
+
onChangePage(model: 'left' | 'right', data: {
|
|
14
|
+
value: number;
|
|
15
|
+
limit: number;
|
|
16
|
+
}): void;
|
|
17
|
+
customFilter(item: TransferDataItem, keywords: string): boolean;
|
|
18
|
+
render(): React.JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
var _context;
|
|
3
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
4
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
5
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
|
|
6
|
+
import { __decorate } from "tslib";
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { Transfer } from '@king-design/react';
|
|
9
|
+
import { range, bind } from '@king-design/react/components/utils';
|
|
10
|
+
var data = _mapInstanceProperty(_context = range(1, 100)).call(_context, function (item) {
|
|
11
|
+
return {
|
|
12
|
+
label: "\u4E3B\u673A\u540D" + item,
|
|
13
|
+
key: item
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
17
|
+
_inheritsLoose(Demo, _React$Component);
|
|
18
|
+
function Demo() {
|
|
19
|
+
var _context2;
|
|
20
|
+
var _this;
|
|
21
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22
|
+
args[_key] = arguments[_key];
|
|
23
|
+
}
|
|
24
|
+
_this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context2 = [this]).call(_context2, args)) || this;
|
|
25
|
+
_this.state = {
|
|
26
|
+
data: data,
|
|
27
|
+
value: []
|
|
28
|
+
};
|
|
29
|
+
_this.__test = void 0;
|
|
30
|
+
return _this;
|
|
31
|
+
}
|
|
32
|
+
var _proto = Demo.prototype;
|
|
33
|
+
_proto.onChangePage = function onChangePage(model, data) {
|
|
34
|
+
console.log(model + " panel: page " + data.value + ", limit " + data.limit);
|
|
35
|
+
};
|
|
36
|
+
_proto.customFilter = function customFilter(item, keywords) {
|
|
37
|
+
var _context3;
|
|
38
|
+
var label = item.label;
|
|
39
|
+
var matchKeywords = _includesInstanceProperty(_context3 = label.toLowerCase()).call(_context3, keywords.toLowerCase());
|
|
40
|
+
return matchKeywords;
|
|
41
|
+
};
|
|
42
|
+
_proto.render = function render() {
|
|
43
|
+
var _this2 = this;
|
|
44
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Transfer, {
|
|
45
|
+
value: this.state.value,
|
|
46
|
+
onChangeValue: function onChangeValue(value) {
|
|
47
|
+
return _this2.setState({
|
|
48
|
+
value: value
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
data: this.state.data,
|
|
52
|
+
pagination: true,
|
|
53
|
+
filterable: true,
|
|
54
|
+
filter: this.customFilter,
|
|
55
|
+
onPage: this.onChangePage,
|
|
56
|
+
ref: function ref(i) {
|
|
57
|
+
return _this2.__test = i;
|
|
58
|
+
}
|
|
59
|
+
}), /*#__PURE__*/React.createElement("p", null, "You selected: [" + this.state.value.join(', ') + "]"));
|
|
60
|
+
};
|
|
61
|
+
return Demo;
|
|
62
|
+
}(React.Component);
|
|
63
|
+
export { Demo as default };
|
|
64
|
+
__decorate([bind], Demo.prototype, "onChangePage", null);
|
|
65
|
+
__decorate([bind], Demo.prototype, "customFilter", null);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export { default as data } from './index.json';
|
|
2
|
+
import { Component } from 'intact';
|
|
3
|
+
import './index.styl';
|
|
4
|
+
interface Props {
|
|
5
|
+
allData: DataItem[];
|
|
6
|
+
leftData: DataItem[];
|
|
7
|
+
rightData: DataItem[];
|
|
8
|
+
leftCheckedKeys: number[];
|
|
9
|
+
rightCheckedKeys: number[];
|
|
10
|
+
leftKeywords: string;
|
|
11
|
+
rightKeywords: string;
|
|
12
|
+
leftFilteredData: DataItem[];
|
|
13
|
+
rightFilteredData: DataItem[];
|
|
14
|
+
}
|
|
15
|
+
type DataItem = {
|
|
16
|
+
id: number;
|
|
17
|
+
name: string;
|
|
18
|
+
ip: string;
|
|
19
|
+
status: string;
|
|
20
|
+
};
|
|
21
|
+
export default class extends Component<Props> {
|
|
22
|
+
static template: string | import("intact").Template<any>;
|
|
23
|
+
static defaults(): Props;
|
|
24
|
+
filterData(data: DataItem[], keywords: string): DataItem[];
|
|
25
|
+
onLeftKeywordsChange(v: string | undefined): void;
|
|
26
|
+
onRightKeywordsChange(v: string | undefined): void;
|
|
27
|
+
onLeftCheckedKeysChange(keys: number[] | undefined): void;
|
|
28
|
+
onRightCheckedKeysChange(keys: number[] | undefined): void;
|
|
29
|
+
enableAdd(): boolean;
|
|
30
|
+
enableRemove(): boolean;
|
|
31
|
+
onAdd(): void;
|
|
32
|
+
onRemove(): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
var _context;
|
|
3
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
4
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
|
|
5
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
|
|
6
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
7
|
+
import _Set from "@babel/runtime-corejs3/core-js/set";
|
|
8
|
+
import { __decorate } from "tslib";
|
|
9
|
+
export { default as data } from './index.json';
|
|
10
|
+
import { Component } from 'intact';
|
|
11
|
+
import template from './index.vdt';
|
|
12
|
+
import './index.styl';
|
|
13
|
+
import { bind } from 'kpc';
|
|
14
|
+
import { range } from 'kpc/components/utils';
|
|
15
|
+
var rawData = _mapInstanceProperty(_context = range(1, 50)).call(_context, function (item) {
|
|
16
|
+
return {
|
|
17
|
+
id: item,
|
|
18
|
+
name: "\u670D\u52A1\u5668" + item,
|
|
19
|
+
ip: "10.10.1." + item,
|
|
20
|
+
status: item % 3 === 0 ? '运行中' : item % 3 === 1 ? '已停止' : '维护中'
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
var default_1 = /*#__PURE__*/function (_Component) {
|
|
24
|
+
_inheritsLoose(default_1, _Component);
|
|
25
|
+
function default_1() {
|
|
26
|
+
return _Component.apply(this, arguments) || this;
|
|
27
|
+
}
|
|
28
|
+
default_1.defaults = function defaults() {
|
|
29
|
+
return {
|
|
30
|
+
allData: rawData,
|
|
31
|
+
leftData: rawData,
|
|
32
|
+
rightData: [],
|
|
33
|
+
leftCheckedKeys: [],
|
|
34
|
+
rightCheckedKeys: [],
|
|
35
|
+
leftKeywords: '',
|
|
36
|
+
rightKeywords: '',
|
|
37
|
+
leftFilteredData: rawData,
|
|
38
|
+
rightFilteredData: []
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
var _proto = default_1.prototype;
|
|
42
|
+
_proto.filterData = function filterData(data, keywords) {
|
|
43
|
+
if (!keywords) return data;
|
|
44
|
+
var lowerKeywords = keywords.toLowerCase();
|
|
45
|
+
return _filterInstanceProperty(data).call(data, function (item) {
|
|
46
|
+
var _context2, _context3, _context4;
|
|
47
|
+
return _includesInstanceProperty(_context2 = item.name.toLowerCase()).call(_context2, lowerKeywords) || _includesInstanceProperty(_context3 = item.ip).call(_context3, keywords) || _includesInstanceProperty(_context4 = item.status).call(_context4, keywords);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
_proto.onLeftKeywordsChange = function onLeftKeywordsChange(v) {
|
|
51
|
+
var keywords = v || '';
|
|
52
|
+
this.set('leftKeywords', keywords);
|
|
53
|
+
var data = this.filterData(this.get('leftData'), keywords);
|
|
54
|
+
this.set('leftFilteredData', data);
|
|
55
|
+
};
|
|
56
|
+
_proto.onRightKeywordsChange = function onRightKeywordsChange(v) {
|
|
57
|
+
var keywords = v || '';
|
|
58
|
+
this.set('rightKeywords', keywords);
|
|
59
|
+
var data = this.filterData(this.get('rightData'), keywords);
|
|
60
|
+
this.set('rightFilteredData', data);
|
|
61
|
+
};
|
|
62
|
+
_proto.onLeftCheckedKeysChange = function onLeftCheckedKeysChange(keys) {
|
|
63
|
+
this.set('leftCheckedKeys', keys || []);
|
|
64
|
+
};
|
|
65
|
+
_proto.onRightCheckedKeysChange = function onRightCheckedKeysChange(keys) {
|
|
66
|
+
this.set('rightCheckedKeys', keys || []);
|
|
67
|
+
};
|
|
68
|
+
_proto.enableAdd = function enableAdd() {
|
|
69
|
+
var keys = this.get('leftCheckedKeys');
|
|
70
|
+
return keys && keys.length > 0;
|
|
71
|
+
};
|
|
72
|
+
_proto.enableRemove = function enableRemove() {
|
|
73
|
+
var keys = this.get('rightCheckedKeys');
|
|
74
|
+
return keys && keys.length > 0;
|
|
75
|
+
};
|
|
76
|
+
_proto.onAdd = function onAdd() {
|
|
77
|
+
var _context5;
|
|
78
|
+
var leftCheckedKeys = this.get('leftCheckedKeys');
|
|
79
|
+
var leftData = this.get('leftData');
|
|
80
|
+
var rightData = this.get('rightData');
|
|
81
|
+
var selectedItems = _filterInstanceProperty(leftData).call(leftData, function (item) {
|
|
82
|
+
return _includesInstanceProperty(leftCheckedKeys).call(leftCheckedKeys, item.id);
|
|
83
|
+
});
|
|
84
|
+
var newLeftData = _filterInstanceProperty(leftData).call(leftData, function (item) {
|
|
85
|
+
return !_includesInstanceProperty(leftCheckedKeys).call(leftCheckedKeys, item.id);
|
|
86
|
+
});
|
|
87
|
+
var newRightData = _concatInstanceProperty(_context5 = []).call(_context5, rightData, selectedItems);
|
|
88
|
+
this.set({
|
|
89
|
+
leftData: newLeftData,
|
|
90
|
+
rightData: newRightData,
|
|
91
|
+
leftCheckedKeys: []
|
|
92
|
+
});
|
|
93
|
+
var leftFiltered = this.filterData(newLeftData, this.get('leftKeywords'));
|
|
94
|
+
var rightFiltered = this.filterData(newRightData, this.get('rightKeywords'));
|
|
95
|
+
this.set('leftFilteredData', leftFiltered);
|
|
96
|
+
this.set('rightFilteredData', rightFiltered);
|
|
97
|
+
};
|
|
98
|
+
_proto.onRemove = function onRemove() {
|
|
99
|
+
var rightCheckedKeys = this.get('rightCheckedKeys');
|
|
100
|
+
var allData = this.get('allData');
|
|
101
|
+
var rightData = this.get('rightData');
|
|
102
|
+
var newRightData = _filterInstanceProperty(rightData).call(rightData, function (item) {
|
|
103
|
+
return !_includesInstanceProperty(rightCheckedKeys).call(rightCheckedKeys, item.id);
|
|
104
|
+
});
|
|
105
|
+
var rightDataIds = new _Set(_mapInstanceProperty(newRightData).call(newRightData, function (item) {
|
|
106
|
+
return item.id;
|
|
107
|
+
}));
|
|
108
|
+
var newLeftData = _filterInstanceProperty(allData).call(allData, function (item) {
|
|
109
|
+
return !rightDataIds.has(item.id);
|
|
110
|
+
});
|
|
111
|
+
this.set({
|
|
112
|
+
leftData: newLeftData,
|
|
113
|
+
rightData: newRightData,
|
|
114
|
+
rightCheckedKeys: []
|
|
115
|
+
});
|
|
116
|
+
var leftFiltered = this.filterData(newLeftData, this.get('leftKeywords'));
|
|
117
|
+
var rightFiltered = this.filterData(newRightData, this.get('rightKeywords'));
|
|
118
|
+
this.set('leftFilteredData', leftFiltered);
|
|
119
|
+
this.set('rightFilteredData', rightFiltered);
|
|
120
|
+
};
|
|
121
|
+
return default_1;
|
|
122
|
+
}(Component);
|
|
123
|
+
default_1.template = template;
|
|
124
|
+
export { default_1 as default };
|
|
125
|
+
__decorate([bind], default_1.prototype, "onLeftKeywordsChange", null);
|
|
126
|
+
__decorate([bind], default_1.prototype, "onRightKeywordsChange", null);
|
|
127
|
+
__decorate([bind], default_1.prototype, "onLeftCheckedKeysChange", null);
|
|
128
|
+
__decorate([bind], default_1.prototype, "onRightCheckedKeysChange", null);
|
|
129
|
+
__decorate([bind], default_1.prototype, "enableAdd", null);
|
|
130
|
+
__decorate([bind], default_1.prototype, "enableRemove", null);
|
|
131
|
+
__decorate([bind], default_1.prototype, "onAdd", null);
|
|
132
|
+
__decorate([bind], default_1.prototype, "onRemove", null);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.styl';
|
|
3
|
+
interface Props {
|
|
4
|
+
allData: DataItem[];
|
|
5
|
+
leftData: DataItem[];
|
|
6
|
+
rightData: DataItem[];
|
|
7
|
+
leftCheckedKeys: number[];
|
|
8
|
+
rightCheckedKeys: number[];
|
|
9
|
+
leftKeywords: string;
|
|
10
|
+
rightKeywords: string;
|
|
11
|
+
leftFilteredData: DataItem[];
|
|
12
|
+
rightFilteredData: DataItem[];
|
|
13
|
+
}
|
|
14
|
+
type DataItem = {
|
|
15
|
+
id: number;
|
|
16
|
+
name: string;
|
|
17
|
+
ip: string;
|
|
18
|
+
status: string;
|
|
19
|
+
};
|
|
20
|
+
export default class Demo extends React.Component<{}, Props> {
|
|
21
|
+
state: Props;
|
|
22
|
+
private leftTable;
|
|
23
|
+
private rightTable;
|
|
24
|
+
filterData(data: DataItem[], keywords: string): DataItem[];
|
|
25
|
+
onLeftKeywordsChange(v: string | undefined): void;
|
|
26
|
+
onRightKeywordsChange(v: string | undefined): void;
|
|
27
|
+
onLeftCheckedKeysChange(keys: number[] | undefined): void;
|
|
28
|
+
onRightCheckedKeysChange(keys: number[] | undefined): void;
|
|
29
|
+
enableAdd(): boolean;
|
|
30
|
+
enableRemove(): boolean;
|
|
31
|
+
onAdd(): void;
|
|
32
|
+
onRemove(): void;
|
|
33
|
+
render(): React.JSX.Element;
|
|
34
|
+
}
|
|
35
|
+
export {};
|