@king-design/intact 3.3.2 → 3.3.3

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.
Files changed (67) hide show
  1. package/components/button/demos/basic.md +5 -2
  2. package/components/button/demos/ghost.md +1 -0
  3. package/components/button/demos/group.md +7 -0
  4. package/components/button/group.ts +2 -0
  5. package/components/button/index.md +1 -0
  6. package/components/button/index.ts +2 -0
  7. package/components/button/index.vdt +12 -7
  8. package/components/button/styles.ts +31 -1
  9. package/components/dialog/alert.vdt +2 -3
  10. package/components/dialog/demos/static.md +18 -0
  11. package/components/switch/demos/beforeChange.md +52 -0
  12. package/components/switch/index.md +2 -0
  13. package/components/switch/index.spec.ts +11 -0
  14. package/components/switch/index.ts +28 -6
  15. package/components/switch/index.vdt +8 -2
  16. package/components/switch/styles.ts +15 -1
  17. package/components/table/cell.vdt +6 -1
  18. package/components/table/column.ts +2 -0
  19. package/components/table/column.vdt +2 -1
  20. package/components/table/demos/hidden.md +44 -0
  21. package/components/table/index.md +1 -0
  22. package/components/table/styles.ts +6 -3
  23. package/components/table/table.vdt +4 -2
  24. package/components/table/useColumns.ts +1 -1
  25. package/components/utils.ts +19 -0
  26. package/es/components/button/group.d.ts +1 -0
  27. package/es/components/button/group.js +2 -1
  28. package/es/components/button/index.d.ts +1 -0
  29. package/es/components/button/index.js +1 -0
  30. package/es/components/button/index.vdt.js +13 -6
  31. package/es/components/button/styles.d.ts +1 -1
  32. package/es/components/button/styles.js +3 -3
  33. package/es/components/dialog/alert.vdt.js +2 -2
  34. package/es/components/switch/index.d.ts +3 -1
  35. package/es/components/switch/index.js +65 -13
  36. package/es/components/switch/index.spec.js +21 -0
  37. package/es/components/switch/index.vdt.js +14 -4
  38. package/es/components/switch/styles.js +12 -7
  39. package/es/components/table/cell.vdt.js +3 -1
  40. package/es/components/table/column.d.ts +1 -0
  41. package/es/components/table/column.js +1 -0
  42. package/es/components/table/column.vdt.js +3 -2
  43. package/es/components/table/styles.js +1 -1
  44. package/es/components/table/table.vdt.js +1 -1
  45. package/es/components/table/useColumns.js +1 -1
  46. package/es/components/utils.js +17 -0
  47. package/es/i18n/en-US.js +6 -2
  48. package/es/index.d.ts +2 -2
  49. package/es/index.js +2 -2
  50. package/es/site/data/components/button/demos/basic/react.js +7 -1
  51. package/es/site/data/components/button/demos/ghost/react.js +3 -0
  52. package/es/site/data/components/button/demos/group/react.js +17 -0
  53. package/es/site/data/components/dialog/demos/static/index.d.ts +1 -0
  54. package/es/site/data/components/dialog/demos/static/index.js +15 -0
  55. package/es/site/data/components/dialog/demos/static/react.d.ts +1 -0
  56. package/es/site/data/components/dialog/demos/static/react.js +18 -1
  57. package/es/site/data/components/switch/demos/beforeChange/index.d.ts +12 -0
  58. package/es/site/data/components/switch/demos/beforeChange/index.js +39 -0
  59. package/es/site/data/components/switch/demos/beforeChange/react.d.ts +11 -0
  60. package/es/site/data/components/switch/demos/beforeChange/react.js +62 -0
  61. package/es/site/data/components/table/demos/hidden/index.d.ts +14 -0
  62. package/es/site/data/components/table/demos/hidden/index.js +28 -0
  63. package/es/site/data/components/table/demos/hidden/react.d.ts +13 -0
  64. package/es/site/data/components/table/demos/hidden/react.js +63 -0
  65. package/i18n/en-US.ts +5 -2
  66. package/index.ts +2 -2
  67. package/package.json +2 -2
package/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v3.3.2
2
+ * @king-design v3.3.3
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -64,5 +64,5 @@ export * from './components/treeSelect';
64
64
  export * from './components/upload';
65
65
  export * from './components/view';
66
66
  export * from './components/wave';
67
- export var version = '3.3.2';
67
+ export var version = '3.3.3';
68
68
  /* generate end */
@@ -25,7 +25,13 @@ var Demo = /*#__PURE__*/function (_React$Component) {
25
25
  type: "link"
26
26
  }, "link"), /*#__PURE__*/React.createElement(Button, {
27
27
  type: "flat"
28
- }, "flat"));
28
+ }, "flat"), /*#__PURE__*/React.createElement(Button, {
29
+ color: "red"
30
+ }, "custom"), /*#__PURE__*/React.createElement(Button, {
31
+ color: "#0000ea"
32
+ }, "custom"), /*#__PURE__*/React.createElement(Button, {
33
+ color: "rgb(183, 18, 193)"
34
+ }, "custom"));
29
35
  };
30
36
  return Demo;
31
37
  }(React.Component);
@@ -30,6 +30,9 @@ var Demo = /*#__PURE__*/function (_React$Component) {
30
30
  type: "success",
31
31
  ghost: true
32
32
  }, "success"), /*#__PURE__*/React.createElement(Button, {
33
+ color: "rgb(183, 18, 193)",
34
+ ghost: true
35
+ }, "custom"), /*#__PURE__*/React.createElement(Button, {
33
36
  type: "none",
34
37
  ghost: true
35
38
  }, "none"), /*#__PURE__*/React.createElement(Button, {
@@ -142,6 +142,23 @@ var Demo = /*#__PURE__*/function (_React$Component) {
142
142
  value: "guangzhou"
143
143
  }, "\u5E7F\u5DDE"), /*#__PURE__*/React.createElement(Button, {
144
144
  value: "shenzhen"
145
+ }, "\u6DF1\u5733")), /*#__PURE__*/React.createElement("p", null, "\u652F\u6301\u81EA\u5B9A\u4E49ButtonGroup\u4E0B\u7684Button\u5BBD\u5EA6"), /*#__PURE__*/React.createElement(ButtonGroup, {
146
+ checkType: "radio",
147
+ value: this.state.city,
148
+ onChangeValue: function onChangeValue(city) {
149
+ return _this2.setState({
150
+ city: city
151
+ });
152
+ },
153
+ btnWidth: "100px"
154
+ }, /*#__PURE__*/React.createElement(Button, {
155
+ value: "beijing"
156
+ }, "\u5317\u4EAC"), /*#__PURE__*/React.createElement(Button, {
157
+ value: "shanghai"
158
+ }, "\u4E0A\u6D77"), /*#__PURE__*/React.createElement(Button, {
159
+ value: "guangzhou"
160
+ }, "\u5E7F\u5DDE"), /*#__PURE__*/React.createElement(Button, {
161
+ value: "shenzhen"
145
162
  }, "\u6DF1\u5733")));
146
163
  };
147
164
  return Demo;
@@ -9,4 +9,5 @@ export default class extends Component<Props> {
9
9
  static defaults(): Props;
10
10
  showDialog(type: Type): void;
11
11
  showDialogWithTitle(type: Type): void;
12
+ showAsyncCloseConfirm(): void;
12
13
  }
@@ -33,6 +33,21 @@ var default_1 = /*#__PURE__*/function (_Component) {
33
33
  Message.info('clicked cancel button');
34
34
  });
35
35
  };
36
+ _proto.showAsyncCloseConfirm = function showAsyncCloseConfirm() {
37
+ var dialog;
38
+ Dialog.confirm({
39
+ content: '点击确认,异步关闭',
40
+ ref: function ref(_dialog) {
41
+ return dialog = _dialog;
42
+ },
43
+ ok: function ok() {
44
+ dialog.showLoading();
45
+ setTimeout(function () {
46
+ dialog.close();
47
+ }, 3000);
48
+ }
49
+ });
50
+ };
36
51
  return default_1;
37
52
  }(Component);
38
53
  default_1.template = template;
@@ -7,6 +7,7 @@ export default class Demo extends React.Component<{}, Props> {
7
7
  state: Props;
8
8
  showDialog(type: Type): void;
9
9
  showDialogWithTitle(type: Type): void;
10
+ showAsyncCloseConfirm(): void;
10
11
  render(): React.JSX.Element;
11
12
  }
12
13
  export {};
@@ -38,6 +38,21 @@ var Demo = /*#__PURE__*/function (_React$Component) {
38
38
  Message.info('clicked cancel button');
39
39
  });
40
40
  };
41
+ _proto.showAsyncCloseConfirm = function showAsyncCloseConfirm() {
42
+ var dialog;
43
+ Dialog.confirm({
44
+ content: '点击确认,异步关闭',
45
+ ref: function ref(_dialog) {
46
+ return dialog = _dialog;
47
+ },
48
+ ok: function ok() {
49
+ dialog.showLoading();
50
+ setTimeout(function () {
51
+ dialog.close();
52
+ }, 3000);
53
+ }
54
+ });
55
+ };
41
56
  _proto.render = function render() {
42
57
  var _context2,
43
58
  _this2 = this,
@@ -50,7 +65,9 @@ var Demo = /*#__PURE__*/function (_React$Component) {
50
65
  return /*#__PURE__*/React.createElement(Button, {
51
66
  onClick: _this2.showDialogWithTitle.bind(_this2, $value)
52
67
  }, "Show ", $value[0].toUpperCase() + $value.substring(1), " Dialog with Title");
53
- })));
68
+ })), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Button, {
69
+ onClick: this.showAsyncCloseConfirm
70
+ }, "\u5F02\u6B65\u5173\u95EDconfirm\u5F39\u5C42"));
54
71
  };
55
72
  return Demo;
56
73
  }(React.Component);
@@ -0,0 +1,12 @@
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
+ value1: boolean;
8
+ value2: boolean;
9
+ };
10
+ beforeChange(value: any): Promise<boolean>;
11
+ beforeChangeFalse(value: any): Promise<boolean>;
12
+ }
@@ -0,0 +1,39 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import _Promise from "@babel/runtime-corejs3/core-js/promise";
3
+ export { default as data } from './index.json';
4
+ import { Component } from 'intact';
5
+ import template from './index.vdt';
6
+ import './index.styl';
7
+ import { Message } from 'kpc';
8
+ var default_1 = /*#__PURE__*/function (_Component) {
9
+ _inheritsLoose(default_1, _Component);
10
+ function default_1() {
11
+ return _Component.apply(this, arguments) || this;
12
+ }
13
+ default_1.defaults = function defaults() {
14
+ return {
15
+ value1: false,
16
+ value2: false
17
+ };
18
+ };
19
+ var _proto = default_1.prototype;
20
+ _proto.beforeChange = function beforeChange(value) {
21
+ return new _Promise(function (resolve) {
22
+ Message.warning("current value is " + value);
23
+ setTimeout(function () {
24
+ resolve(true);
25
+ }, 1000);
26
+ });
27
+ };
28
+ _proto.beforeChangeFalse = function beforeChangeFalse(value) {
29
+ Message.warning("current value is " + value);
30
+ return new _Promise(function (resolve) {
31
+ setTimeout(function () {
32
+ resolve(false);
33
+ }, 1000);
34
+ });
35
+ };
36
+ return default_1;
37
+ }(Component);
38
+ default_1.template = template;
39
+ export { default_1 as default };
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import './index.styl';
3
+ export default class Demo extends React.Component {
4
+ state: {
5
+ value1: boolean;
6
+ value2: boolean;
7
+ };
8
+ beforeChange(value: any): Promise<boolean>;
9
+ beforeChangeFalse(value: any): Promise<boolean>;
10
+ render(): React.JSX.Element;
11
+ }
@@ -0,0 +1,62 @@
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 React from 'react';
5
+ import { Switch } from '@king-design/react';
6
+ import './index.styl';
7
+ import { Message } 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
+ value1: false,
19
+ value2: false
20
+ };
21
+ return _this;
22
+ }
23
+ var _proto = Demo.prototype;
24
+ _proto.beforeChange = function beforeChange(value) {
25
+ return new _Promise(function (resolve) {
26
+ Message.warning("current value is " + value);
27
+ setTimeout(function () {
28
+ resolve(true);
29
+ }, 1000);
30
+ });
31
+ };
32
+ _proto.beforeChangeFalse = function beforeChangeFalse(value) {
33
+ Message.warning("current value is " + value);
34
+ return new _Promise(function (resolve) {
35
+ setTimeout(function () {
36
+ resolve(false);
37
+ }, 1000);
38
+ });
39
+ };
40
+ _proto.render = function render() {
41
+ var _this2 = this;
42
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Switch, {
43
+ value: this.state.value1,
44
+ onChangeValue: function onChangeValue(value1) {
45
+ return _this2.setState({
46
+ value1: value1
47
+ });
48
+ },
49
+ beforeChange: this.beforeChange
50
+ }), /*#__PURE__*/React.createElement(Switch, {
51
+ value: this.state.value2,
52
+ onChangeValue: function onChangeValue(value2) {
53
+ return _this2.setState({
54
+ value2: value2
55
+ });
56
+ },
57
+ beforeChange: this.beforeChangeFalse
58
+ }));
59
+ };
60
+ return Demo;
61
+ }(React.Component);
62
+ export { Demo as default };
@@ -0,0 +1,14 @@
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
+ c: string;
11
+ }[];
12
+ data2: never[];
13
+ };
14
+ }
@@ -0,0 +1,28 @@
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
+ c: 'cell 1-3'
17
+ }, {
18
+ a: 'Cell 2-1',
19
+ b: 'Cell 2-2',
20
+ c: 'cell 2-3'
21
+ }],
22
+ data2: []
23
+ };
24
+ };
25
+ return default_1;
26
+ }(Component);
27
+ default_1.template = template;
28
+ export { default_1 as default };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import './index.styl';
3
+ export default class Demo extends React.Component {
4
+ state: {
5
+ data: {
6
+ a: string;
7
+ b: string;
8
+ c: string;
9
+ }[];
10
+ data2: never[];
11
+ };
12
+ render(): React.JSX.Element;
13
+ }
@@ -0,0 +1,63 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
3
+ import React from 'react';
4
+ import { Table, TableColumn } from '@king-design/react';
5
+ import './index.styl';
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
+ data: [{
17
+ a: 'Cell 1-1',
18
+ b: 'Cell 1-2',
19
+ c: 'cell 1-3'
20
+ }, {
21
+ a: 'Cell 2-1',
22
+ b: 'Cell 2-2',
23
+ c: 'cell 2-3'
24
+ }],
25
+ data2: []
26
+ };
27
+ return _this;
28
+ }
29
+ var _proto = Demo.prototype;
30
+ _proto.render = function render() {
31
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Table, {
32
+ data: this.state.data,
33
+ resizable: true
34
+ }, /*#__PURE__*/React.createElement(TableColumn, {
35
+ key: "a",
36
+ title: "Title 1",
37
+ minWidth: 200
38
+ }), /*#__PURE__*/React.createElement(TableColumn, {
39
+ key: "b",
40
+ title: "Title 2",
41
+ minWidth: 300,
42
+ hidden: true
43
+ }), /*#__PURE__*/React.createElement(TableColumn, {
44
+ key: "c",
45
+ title: "Title 3"
46
+ })), /*#__PURE__*/React.createElement("p", null, "\u65E0\u6570\u636E\u5C55\u793A"), /*#__PURE__*/React.createElement(Table, {
47
+ data: this.state.data2,
48
+ resizable: true
49
+ }, /*#__PURE__*/React.createElement(TableColumn, {
50
+ key: "a",
51
+ title: "Title 1"
52
+ }), /*#__PURE__*/React.createElement(TableColumn, {
53
+ key: "b",
54
+ title: "Title 2",
55
+ hidden: true
56
+ }), /*#__PURE__*/React.createElement(TableColumn, {
57
+ key: "c",
58
+ title: "Title 3"
59
+ })));
60
+ };
61
+ return Demo;
62
+ }(React.Component);
63
+ export { Demo as default };
package/i18n/en-US.ts CHANGED
@@ -120,6 +120,9 @@ const i18n = {
120
120
 
121
121
  export default i18n;
122
122
 
123
- if (typeof (global as any).Kpc !== 'undefined') {
124
- (global as any).Kpc.localize(i18n);
123
+ /**
124
+ * global does not exist in Vite, use standard object globalThis
125
+ */
126
+ if (typeof (globalThis as any).Kpc !== 'undefined') {
127
+ (globalThis as any).Kpc.localize(i18n);
125
128
  }
package/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v3.3.2
2
+ * @king-design v3.3.3
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -68,6 +68,6 @@ export * from './components/upload';
68
68
  export * from './components/view';
69
69
  export * from './components/wave';
70
70
 
71
- export const version = '3.3.2';
71
+ export const version = '3.3.3';
72
72
 
73
73
  /* generate end */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@king-design/intact",
3
- "version": "3.3.2",
3
+ "version": "3.3.3",
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.34",
183
+ "intact": "^3.0.35",
184
184
  "monaco-editor": "^0.26.1",
185
185
  "mxgraphx": "^4.0.7",
186
186
  "resize-observer-polyfill": "^1.5.1",