@king-design/intact 3.5.2 → 3.6.0-beta.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.
Files changed (206) hide show
  1. package/components/button/index.md +1 -0
  2. package/components/datepicker/basepicker.ts +60 -13
  3. package/components/datepicker/calendar.ts +5 -1
  4. package/components/datepicker/calendar.vdt +20 -6
  5. package/components/datepicker/dayjs.ts +22 -2
  6. package/components/datepicker/demos/multiple.md +0 -5
  7. package/components/datepicker/demos/nowrap.md +35 -0
  8. package/components/datepicker/demos/yearMonth.md +8 -2
  9. package/components/datepicker/helpers.ts +5 -5
  10. package/components/datepicker/index.md +3 -2
  11. package/components/datepicker/index.spec.ts +107 -90
  12. package/components/datepicker/index.ts +23 -5
  13. package/components/datepicker/index.vdt +34 -35
  14. package/components/datepicker/styles.ts +102 -3
  15. package/components/datepicker/useDisabled.ts +3 -3
  16. package/components/datepicker/useFormats.ts +2 -0
  17. package/components/datepicker/useMergeRange.ts +54 -0
  18. package/components/datepicker/usePosition.ts +169 -0
  19. package/components/datepicker/useQuarters.ts +47 -0
  20. package/components/datepicker/useShowDate.ts +42 -11
  21. package/components/datepicker/useValue.ts +35 -4
  22. package/components/datepicker/useWeeks.ts +58 -0
  23. package/components/dialog/useFixBody.ts +7 -64
  24. package/components/ellipsis/styles.ts +4 -0
  25. package/components/form/styles.ts +1 -0
  26. package/components/scrollSelect/index.spec.ts +3 -3
  27. package/components/scrollSelect/useMouseEvents.ts +23 -10
  28. package/components/select/base.vdt +2 -1
  29. package/components/select/demos/creatable.md +13 -0
  30. package/components/select/index.md +1 -0
  31. package/components/select/index.spec.ts +146 -0
  32. package/components/select/option.ts +9 -1
  33. package/components/select/select.ts +2 -0
  34. package/components/select/useFilterable.ts +1 -1
  35. package/components/select/useInput.ts +4 -2
  36. package/components/select/useSearchable.ts +2 -2
  37. package/components/timepicker/demos/step.md +1 -1
  38. package/components/timepicker/panelPicker.vdt +5 -1
  39. package/components/timepicker/styles.ts +0 -1
  40. package/components/tour/demos/basic.md +73 -0
  41. package/components/tour/demos/beforeChange.md +109 -0
  42. package/components/tour/demos/closable.md +70 -0
  43. package/components/tour/demos/custom.md +98 -0
  44. package/components/tour/demos/customText.md +94 -0
  45. package/components/tour/demos/declarative.md +72 -0
  46. package/components/tour/demos/events.md +101 -0
  47. package/components/tour/demos/maskClosable.md +76 -0
  48. package/components/tour/demos/notarget.md +59 -0
  49. package/components/tour/index.md +48 -0
  50. package/components/tour/index.spec.ts +259 -0
  51. package/components/tour/index.ts +2 -0
  52. package/components/tour/step.ts +55 -0
  53. package/components/tour/step.vdt +75 -0
  54. package/components/tour/styles.ts +283 -0
  55. package/components/tour/tour.ts +107 -0
  56. package/components/tour/tour.vdt +83 -0
  57. package/components/tour/useArrow.ts +46 -0
  58. package/components/tour/useFixBody.ts +22 -0
  59. package/components/tour/useHighlight.ts +36 -0
  60. package/components/tour/useMaskClosable.ts +26 -0
  61. package/components/tour/useNavigation.ts +46 -0
  62. package/components/tour/usePosition.ts +91 -0
  63. package/components/tour/useSteps.ts +80 -0
  64. package/es/components/datepicker/basepicker.d.ts +4 -2
  65. package/es/components/datepicker/basepicker.js +46 -13
  66. package/es/components/datepicker/calendar.d.ts +34 -6
  67. package/es/components/datepicker/calendar.js +4 -0
  68. package/es/components/datepicker/calendar.vdt.js +21 -5
  69. package/es/components/datepicker/dayjs.d.ts +13 -2
  70. package/es/components/datepicker/dayjs.js +6 -0
  71. package/es/components/datepicker/helpers.d.ts +5 -5
  72. package/es/components/datepicker/index.d.ts +17 -2
  73. package/es/components/datepicker/index.js +23 -5
  74. package/es/components/datepicker/index.spec.js +356 -355
  75. package/es/components/datepicker/index.vdt.js +25 -29
  76. package/es/components/datepicker/styles.d.ts +17 -0
  77. package/es/components/datepicker/styles.js +29 -2
  78. package/es/components/datepicker/useDisabled.d.ts +2 -2
  79. package/es/components/datepicker/useDisabled.js +1 -1
  80. package/es/components/datepicker/useFormats.js +3 -1
  81. package/es/components/datepicker/useMergeRange.d.ts +5 -0
  82. package/es/components/datepicker/useMergeRange.js +50 -0
  83. package/es/components/datepicker/usePosition.d.ts +10 -0
  84. package/es/components/datepicker/usePosition.js +166 -0
  85. package/es/components/datepicker/useQuarters.d.ts +15 -0
  86. package/es/components/datepicker/useQuarters.js +36 -0
  87. package/es/components/datepicker/useShowDate.d.ts +1 -1
  88. package/es/components/datepicker/useShowDate.js +42 -9
  89. package/es/components/datepicker/useStatus.d.ts +1 -1
  90. package/es/components/datepicker/useValue.d.ts +1 -0
  91. package/es/components/datepicker/useValue.js +26 -2
  92. package/es/components/datepicker/useWeeks.d.ts +19 -0
  93. package/es/components/datepicker/useWeeks.js +48 -0
  94. package/es/components/dialog/useFixBody.js +6 -58
  95. package/es/components/ellipsis/styles.js +1 -1
  96. package/es/components/form/styles.js +1 -1
  97. package/es/components/scrollSelect/index.spec.js +4 -6
  98. package/es/components/scrollSelect/useMouseEvents.js +21 -9
  99. package/es/components/select/base.vdt.js +4 -2
  100. package/es/components/select/index.spec.js +235 -62
  101. package/es/components/select/option.d.ts +1 -0
  102. package/es/components/select/option.js +9 -2
  103. package/es/components/select/select.d.ts +1 -0
  104. package/es/components/select/select.js +2 -1
  105. package/es/components/select/useFilterable.js +2 -1
  106. package/es/components/select/useInput.js +5 -2
  107. package/es/components/select/useSearchable.js +1 -0
  108. package/es/components/timepicker/panelPicker.d.ts +2 -1
  109. package/es/components/timepicker/panelPicker.vdt.js +12 -4
  110. package/es/components/timepicker/selectPicker.d.ts +1 -1
  111. package/es/components/timepicker/styles.js +1 -1
  112. package/es/components/timepicker/useDisabled.d.ts +1 -1
  113. package/es/components/timepicker/useValue.d.ts +1 -0
  114. package/es/components/tour/index.d.ts +2 -0
  115. package/es/components/tour/index.js +2 -0
  116. package/es/components/tour/index.spec.d.ts +1 -0
  117. package/es/components/tour/index.spec.js +356 -0
  118. package/es/components/tour/step.d.ts +23 -0
  119. package/es/components/tour/step.js +46 -0
  120. package/es/components/tour/step.vdt.js +74 -0
  121. package/es/components/tour/styles.d.ts +7 -0
  122. package/es/components/tour/styles.js +84 -0
  123. package/es/components/tour/tour.d.ts +73 -0
  124. package/es/components/tour/tour.js +70 -0
  125. package/es/components/tour/tour.vdt.js +66 -0
  126. package/es/components/tour/useArrow.d.ts +4 -0
  127. package/es/components/tour/useArrow.js +40 -0
  128. package/es/components/tour/useFixBody.d.ts +4 -0
  129. package/es/components/tour/useFixBody.js +17 -0
  130. package/es/components/tour/useHighlight.d.ts +4 -0
  131. package/es/components/tour/useHighlight.js +31 -0
  132. package/es/components/tour/useMaskClosable.d.ts +1 -0
  133. package/es/components/tour/useMaskClosable.js +25 -0
  134. package/es/components/tour/useNavigation.d.ts +5 -0
  135. package/es/components/tour/useNavigation.js +103 -0
  136. package/es/components/tour/usePosition.d.ts +6 -0
  137. package/es/components/tour/usePosition.js +93 -0
  138. package/es/components/tour/useSteps.d.ts +6 -0
  139. package/es/components/tour/useSteps.js +68 -0
  140. package/es/hooks/useFixBody.d.ts +11 -0
  141. package/es/hooks/useFixBody.js +72 -0
  142. package/es/index.d.ts +3 -2
  143. package/es/index.js +3 -2
  144. package/es/site/data/components/datepicker/demos/multiple/index.d.ts +0 -1
  145. package/es/site/data/components/datepicker/demos/multiple/index.js +1 -2
  146. package/es/site/data/components/datepicker/demos/multiple/react.d.ts +0 -1
  147. package/es/site/data/components/datepicker/demos/multiple/react.js +2 -13
  148. package/es/site/data/components/datepicker/demos/nowrap/index.d.ts +10 -0
  149. package/es/site/data/components/datepicker/demos/nowrap/index.js +19 -0
  150. package/es/site/data/components/datepicker/demos/nowrap/react.d.ts +10 -0
  151. package/es/site/data/components/datepicker/demos/nowrap/react.js +49 -0
  152. package/es/site/data/components/datepicker/demos/yearMonth/index.d.ts +2 -0
  153. package/es/site/data/components/datepicker/demos/yearMonth/index.js +3 -1
  154. package/es/site/data/components/datepicker/demos/yearMonth/react.d.ts +2 -0
  155. package/es/site/data/components/datepicker/demos/yearMonth/react.js +21 -1
  156. package/es/site/data/components/select/demos/creatable/index.d.ts +1 -0
  157. package/es/site/data/components/select/demos/creatable/index.js +2 -1
  158. package/es/site/data/components/select/demos/creatable/react.d.ts +1 -0
  159. package/es/site/data/components/select/demos/creatable/react.js +31 -2
  160. package/es/site/data/components/select/demos/searchable/index.js +1 -1
  161. package/es/site/data/components/select/demos/searchable/react.js +1 -1
  162. package/es/site/data/components/tour/demos/basic/index.d.ts +17 -0
  163. package/es/site/data/components/tour/demos/basic/index.js +46 -0
  164. package/es/site/data/components/tour/demos/basic/react.d.ts +16 -0
  165. package/es/site/data/components/tour/demos/basic/react.js +82 -0
  166. package/es/site/data/components/tour/demos/beforeChange/index.d.ts +20 -0
  167. package/es/site/data/components/tour/demos/beforeChange/index.js +69 -0
  168. package/es/site/data/components/tour/demos/beforeChange/react.d.ts +19 -0
  169. package/es/site/data/components/tour/demos/beforeChange/react.js +129 -0
  170. package/es/site/data/components/tour/demos/closable/index.d.ts +18 -0
  171. package/es/site/data/components/tour/demos/closable/index.js +42 -0
  172. package/es/site/data/components/tour/demos/closable/react.d.ts +17 -0
  173. package/es/site/data/components/tour/demos/closable/react.js +85 -0
  174. package/es/site/data/components/tour/demos/custom/index.d.ts +11 -0
  175. package/es/site/data/components/tour/demos/custom/index.js +35 -0
  176. package/es/site/data/components/tour/demos/custom/react.d.ts +11 -0
  177. package/es/site/data/components/tour/demos/custom/react.js +108 -0
  178. package/es/site/data/components/tour/demos/customButtons/index.d.ts +33 -0
  179. package/es/site/data/components/tour/demos/customButtons/index.js +55 -0
  180. package/es/site/data/components/tour/demos/customButtons/react.d.ts +33 -0
  181. package/es/site/data/components/tour/demos/customButtons/react.js +99 -0
  182. package/es/site/data/components/tour/demos/customText/index.d.ts +20 -0
  183. package/es/site/data/components/tour/demos/customText/index.js +54 -0
  184. package/es/site/data/components/tour/demos/customText/react.d.ts +19 -0
  185. package/es/site/data/components/tour/demos/customText/react.js +95 -0
  186. package/es/site/data/components/tour/demos/declarative/index.d.ts +11 -0
  187. package/es/site/data/components/tour/demos/declarative/index.js +36 -0
  188. package/es/site/data/components/tour/demos/declarative/react.d.ts +10 -0
  189. package/es/site/data/components/tour/demos/declarative/react.js +80 -0
  190. package/es/site/data/components/tour/demos/events/index.d.ts +18 -0
  191. package/es/site/data/components/tour/demos/events/index.js +58 -0
  192. package/es/site/data/components/tour/demos/events/react.d.ts +18 -0
  193. package/es/site/data/components/tour/demos/events/react.js +101 -0
  194. package/es/site/data/components/tour/demos/maskClosable/index.d.ts +18 -0
  195. package/es/site/data/components/tour/demos/maskClosable/index.js +47 -0
  196. package/es/site/data/components/tour/demos/maskClosable/react.d.ts +17 -0
  197. package/es/site/data/components/tour/demos/maskClosable/react.js +95 -0
  198. package/es/site/data/components/tour/demos/notarget/index.d.ts +11 -0
  199. package/es/site/data/components/tour/demos/notarget/index.js +35 -0
  200. package/es/site/data/components/tour/demos/notarget/react.d.ts +10 -0
  201. package/es/site/data/components/tour/demos/notarget/react.js +61 -0
  202. package/es/site/data/components/tour/index.d.ts +57 -0
  203. package/es/site/data/components/tour/index.js +32 -0
  204. package/hooks/useFixBody.ts +87 -0
  205. package/index.ts +3 -2
  206. package/package.json +1 -1
package/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v3.5.2
2
+ * @king-design v3.6.0-beta.0
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -59,6 +59,7 @@ export * from './components/timeline';
59
59
  export * from './components/timepicker';
60
60
  export * from './components/tip';
61
61
  export * from './components/tooltip';
62
+ export * from './components/tour';
62
63
  export * from './components/transfer';
63
64
  export * from './components/tree';
64
65
  export * from './components/treeSelect';
@@ -66,5 +67,5 @@ export * from './components/upload';
66
67
  export * from './components/view';
67
68
  export * from './components/virtualList';
68
69
  export * from './components/wave';
69
- export var version = '3.5.2';
70
+ export var version = '3.6.0-beta.0';
70
71
  /* generate end */
@@ -6,7 +6,6 @@ interface Props {
6
6
  year?: string[];
7
7
  month?: string[];
8
8
  dateRange?: [string, string][];
9
- datetimeRange?: [string, string][];
10
9
  }
11
10
  export default class extends Component<Props> {
12
11
  static template: string | import("intact").Template<any>;
@@ -13,8 +13,7 @@ var default_1 = /*#__PURE__*/function (_Component) {
13
13
  datetime: [],
14
14
  year: [],
15
15
  month: [],
16
- dateRange: [],
17
- datetimeRange: []
16
+ dateRange: []
18
17
  };
19
18
  };
20
19
  return default_1;
@@ -5,7 +5,6 @@ interface Props {
5
5
  year?: string[];
6
6
  month?: string[];
7
7
  dateRange?: [string, string][];
8
- datetimeRange?: [string, string][];
9
8
  }
10
9
  export default class Demo extends React.Component<{}, Props> {
11
10
  state: Props;
@@ -17,8 +17,7 @@ var Demo = /*#__PURE__*/function (_React$Component) {
17
17
  datetime: [],
18
18
  year: [],
19
19
  month: [],
20
- dateRange: [],
21
- datetimeRange: []
20
+ dateRange: []
22
21
  };
23
22
  return _this;
24
23
  }
@@ -70,17 +69,7 @@ var Demo = /*#__PURE__*/function (_React$Component) {
70
69
  dateRange: dateRange
71
70
  });
72
71
  }
73
- }), "You selected: ", _JSON$stringify(this.state.dateRange), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Datepicker, {
74
- multiple: true,
75
- range: true,
76
- value: this.state.datetimeRange,
77
- onChangeValue: function onChangeValue(datetimeRange) {
78
- return _this2.setState({
79
- datetimeRange: datetimeRange
80
- });
81
- },
82
- type: "datetime"
83
- }), "You selected: ", _JSON$stringify(this.state.datetimeRange), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null));
72
+ }), "You selected: ", _JSON$stringify(this.state.dateRange), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null));
84
73
  };
85
74
  return Demo;
86
75
  }(React.Component);
@@ -0,0 +1,10 @@
1
+ export { default as data } from './index.json';
2
+ import { Component } from 'intact';
3
+ interface Props {
4
+ dateRange?: [string, string][];
5
+ mergeDateRange?: [string, string][];
6
+ }
7
+ export default class extends Component<Props> {
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
+ 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
+ dateRange: [],
13
+ mergeDateRange: []
14
+ };
15
+ };
16
+ return default_1;
17
+ }(Component);
18
+ default_1.template = template;
19
+ export { default_1 as default };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ dateRange?: [string, string][];
4
+ mergeDateRange?: [string, string][];
5
+ }
6
+ export default class Demo extends React.Component<{}, Props> {
7
+ state: Props;
8
+ render(): React.JSX.Element;
9
+ }
10
+ export {};
@@ -0,0 +1,49 @@
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 { Datepicker } 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
+ dateRange: [],
17
+ mergeDateRange: []
18
+ };
19
+ return _this;
20
+ }
21
+ var _proto = Demo.prototype;
22
+ _proto.render = function render() {
23
+ var _this2 = this;
24
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Datepicker, {
25
+ multiple: true,
26
+ nowrap: true,
27
+ range: true,
28
+ value: this.state.dateRange,
29
+ onChangeValue: function onChangeValue(dateRange) {
30
+ return _this2.setState({
31
+ dateRange: dateRange
32
+ });
33
+ }
34
+ }), "You selected: ", _JSON$stringify(this.state.dateRange), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Datepicker, {
35
+ multiple: true,
36
+ nowrap: true,
37
+ isMerge: true,
38
+ range: true,
39
+ value: this.state.mergeDateRange,
40
+ onChangeValue: function onChangeValue(mergeDateRange) {
41
+ return _this2.setState({
42
+ mergeDateRange: mergeDateRange
43
+ });
44
+ }
45
+ }), "You selected: ", _JSON$stringify(this.state.mergeDateRange), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null));
46
+ };
47
+ return Demo;
48
+ }(React.Component);
49
+ export { Demo as default };
@@ -4,6 +4,8 @@ import './index.styl';
4
4
  interface Props {
5
5
  year?: string | null;
6
6
  month?: string | null;
7
+ week?: string | null;
8
+ quarter?: string | null;
7
9
  }
8
10
  export default class extends Component<Props> {
9
11
  static template: string | import("intact").Template<any>;
@@ -11,7 +11,9 @@ var default_1 = /*#__PURE__*/function (_Component) {
11
11
  default_1.defaults = function defaults() {
12
12
  return {
13
13
  year: null,
14
- month: null
14
+ month: null,
15
+ week: null,
16
+ quarter: null
15
17
  };
16
18
  };
17
19
  return default_1;
@@ -3,6 +3,8 @@ import './index.styl';
3
3
  interface Props {
4
4
  year?: string | null;
5
5
  month?: string | null;
6
+ week?: string | null;
7
+ quarter?: string | null;
6
8
  }
7
9
  export default class Demo extends React.Component<{}, Props> {
8
10
  state: Props;
@@ -14,7 +14,9 @@ var Demo = /*#__PURE__*/function (_React$Component) {
14
14
  _this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
15
15
  _this.state = {
16
16
  year: null,
17
- month: null
17
+ month: null,
18
+ week: null,
19
+ quarter: null
18
20
  };
19
21
  return _this;
20
22
  }
@@ -38,6 +40,24 @@ var Demo = /*#__PURE__*/function (_React$Component) {
38
40
  });
39
41
  },
40
42
  clearable: true
43
+ }), /*#__PURE__*/React.createElement(Datepicker, {
44
+ type: "week",
45
+ value: this.state.week,
46
+ onChangeValue: function onChangeValue(week) {
47
+ return _this2.setState({
48
+ week: week
49
+ });
50
+ },
51
+ clearable: true
52
+ }), /*#__PURE__*/React.createElement(Datepicker, {
53
+ type: "quarter",
54
+ value: this.state.quarter,
55
+ onChangeValue: function onChangeValue(quarter) {
56
+ return _this2.setState({
57
+ quarter: quarter
58
+ });
59
+ },
60
+ clearable: true
41
61
  }));
42
62
  };
43
63
  return Demo;
@@ -3,6 +3,7 @@ import { Component } from 'intact';
3
3
  interface Props {
4
4
  day?: string | null;
5
5
  days?: string[];
6
+ dayWithKeywords?: string[];
6
7
  }
7
8
  export default class extends Component<Props> {
8
9
  static template: string | import("intact").Template<any>;
@@ -10,7 +10,8 @@ var default_1 = /*#__PURE__*/function (_Component) {
10
10
  default_1.defaults = function defaults() {
11
11
  return {
12
12
  day: null,
13
- days: []
13
+ days: [],
14
+ dayWithKeywords: []
14
15
  };
15
16
  };
16
17
  return default_1;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  interface Props {
3
3
  day?: string | null;
4
4
  days?: string[];
5
+ dayWithKeywords?: string[];
5
6
  }
6
7
  export default class Demo extends React.Component<{}, Props> {
7
8
  state: Props;
@@ -14,7 +14,8 @@ var Demo = /*#__PURE__*/function (_React$Component) {
14
14
  _this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
15
15
  _this.state = {
16
16
  day: null,
17
- days: []
17
+ days: [],
18
+ dayWithKeywords: []
18
19
  };
19
20
  return _this;
20
21
  }
@@ -75,7 +76,35 @@ var Demo = /*#__PURE__*/function (_React$Component) {
75
76
  value: "Saturday"
76
77
  }, "\u661F\u671F\u516D"), /*#__PURE__*/React.createElement(Option, {
77
78
  value: "Sunday"
78
- }, "\u661F\u671F\u5929")), "Days: ", _JSON$stringify(this.state.days));
79
+ }, "\u661F\u671F\u5929")), "Days: ", _JSON$stringify(this.state.days), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Select, {
80
+ value: this.state.dayWithKeywords,
81
+ onChangeValue: function onChangeValue(dayWithKeywords) {
82
+ return _this2.setState({
83
+ dayWithKeywords: dayWithKeywords
84
+ });
85
+ },
86
+ filterable: true,
87
+ multiple: true,
88
+ creatable: true,
89
+ keepKeywords: true,
90
+ style: {
91
+ "marginRight": "10px"
92
+ }
93
+ }, /*#__PURE__*/React.createElement(Option, {
94
+ value: "Monday"
95
+ }, "\u661F\u671F\u4E00"), /*#__PURE__*/React.createElement(Option, {
96
+ value: "Tuesday"
97
+ }, "\u661F\u671F\u4E8C"), /*#__PURE__*/React.createElement(Option, {
98
+ value: "Wednesday"
99
+ }, "\u661F\u671F\u4E09"), /*#__PURE__*/React.createElement(Option, {
100
+ value: "Thursday"
101
+ }, "\u661F\u671F\u56DB"), /*#__PURE__*/React.createElement(Option, {
102
+ value: "Friday"
103
+ }, "\u661F\u671F\u4E94"), /*#__PURE__*/React.createElement(Option, {
104
+ value: "Saturday"
105
+ }, "\u661F\u671F\u516D"), /*#__PURE__*/React.createElement(Option, {
106
+ value: "Sunday"
107
+ }, "\u661F\u671F\u5929")), "Day with keepKeywords: ", _JSON$stringify(this.state.dayWithKeywords));
79
108
  };
80
109
  return Demo;
81
110
  }(React.Component);
@@ -11,7 +11,7 @@ var default_1 = /*#__PURE__*/function (_Component) {
11
11
  default_1.defaults = function defaults() {
12
12
  return {
13
13
  day: null,
14
- days: []
14
+ days: ['Tuesday']
15
15
  };
16
16
  };
17
17
  return default_1;
@@ -14,7 +14,7 @@ var Demo = /*#__PURE__*/function (_React$Component) {
14
14
  _this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
15
15
  _this.state = {
16
16
  day: null,
17
- days: []
17
+ days: ['Tuesday']
18
18
  };
19
19
  return _this;
20
20
  }
@@ -0,0 +1,17 @@
1
+ export { default as data } from './index.json';
2
+ import { Component } from 'intact';
3
+ export default class extends Component {
4
+ static template: string | import("intact").Template<any>;
5
+ static defaults(): {
6
+ currentStep: number;
7
+ showTour: boolean;
8
+ tourData: {
9
+ target: string;
10
+ title: string;
11
+ content: string;
12
+ position: string;
13
+ }[];
14
+ };
15
+ settour(): void;
16
+ close(): void;
17
+ }
@@ -0,0 +1,46 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import { __decorate } from "tslib";
3
+ export { default as data } from './index.json';
4
+ import { Component } from 'intact';
5
+ import template from './index.vdt';
6
+ import { bind } from 'kpc';
7
+ var default_1 = /*#__PURE__*/function (_Component) {
8
+ _inheritsLoose(default_1, _Component);
9
+ function default_1() {
10
+ return _Component.apply(this, arguments) || this;
11
+ }
12
+ default_1.defaults = function defaults() {
13
+ return {
14
+ currentStep: 0,
15
+ showTour: false,
16
+ tourData: [{
17
+ target: '#btn1',
18
+ title: '第一步',
19
+ content: '这是第一步的引导说明',
20
+ position: 'bottom'
21
+ }, {
22
+ target: '#btn2',
23
+ title: '第二步',
24
+ content: '这是第二步的引导说明',
25
+ position: 'right'
26
+ }]
27
+ };
28
+ };
29
+ var _proto = default_1.prototype;
30
+ _proto.settour = function settour() {
31
+ this.set({
32
+ showTour: true,
33
+ currentStep: 0
34
+ });
35
+ };
36
+ _proto.close = function close() {
37
+ this.set({
38
+ showTour: false
39
+ });
40
+ };
41
+ return default_1;
42
+ }(Component);
43
+ default_1.template = template;
44
+ export { default_1 as default };
45
+ __decorate([bind], default_1.prototype, "settour", null);
46
+ __decorate([bind], default_1.prototype, "close", null);
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ export default class Demo extends React.Component {
3
+ state: {
4
+ currentStep: number;
5
+ showTour: boolean;
6
+ tourData: {
7
+ target: string;
8
+ title: string;
9
+ content: string;
10
+ position: string;
11
+ }[];
12
+ };
13
+ settour(): void;
14
+ close(): void;
15
+ render(): React.JSX.Element;
16
+ }
@@ -0,0 +1,82 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
3
+ import { __decorate } from "tslib";
4
+ import React from 'react';
5
+ import { Tour, Button } from '@king-design/react';
6
+ import { bind } from '@king-design/react';
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
+ currentStep: 0,
18
+ showTour: false,
19
+ tourData: [{
20
+ target: '#btn1',
21
+ title: '第一步',
22
+ content: '这是第一步的引导说明',
23
+ position: 'bottom'
24
+ }, {
25
+ target: '#btn2',
26
+ title: '第二步',
27
+ content: '这是第二步的引导说明',
28
+ position: 'right'
29
+ }]
30
+ };
31
+ return _this;
32
+ }
33
+ var _proto = Demo.prototype;
34
+ _proto.settour = function settour() {
35
+ this.setState({
36
+ showTour: true,
37
+ currentStep: 0
38
+ });
39
+ };
40
+ _proto.close = function close() {
41
+ this.setState({
42
+ showTour: false
43
+ });
44
+ };
45
+ _proto.render = function render() {
46
+ var _this2 = this;
47
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
48
+ className: "example-container"
49
+ }, /*#__PURE__*/React.createElement(Button, {
50
+ id: "btn1"
51
+ }, "\u793A\u4F8B\u5143\u7D201"), /*#__PURE__*/React.createElement(Button, {
52
+ id: "btn2",
53
+ style: {
54
+ "marginLeft": "20px"
55
+ }
56
+ }, "\u793A\u4F8B\u5143\u7D202")), /*#__PURE__*/React.createElement(Tour, {
57
+ value: this.state.currentStep,
58
+ onChangeValue: function onChangeValue(currentStep) {
59
+ return _this2.setState({
60
+ currentStep: currentStep
61
+ });
62
+ },
63
+ visible: this.state.showTour,
64
+ data: this.state.tourData,
65
+ onFinish: this.close
66
+ }), /*#__PURE__*/React.createElement("div", {
67
+ style: {
68
+ "marginTop": "20px"
69
+ }
70
+ }, /*#__PURE__*/React.createElement(Button, {
71
+ onClick: this.settour
72
+ }, "\u542F\u52A8\u5F15\u5BFC"), /*#__PURE__*/React.createElement("span", {
73
+ style: {
74
+ "marginLeft": "10px"
75
+ }
76
+ }, "\u5F53\u524D\u6B65\u9AA4: ", this.state.currentStep >= 0 ? this.state.currentStep + 1 : '未启动')));
77
+ };
78
+ return Demo;
79
+ }(React.Component);
80
+ export { Demo as default };
81
+ __decorate([bind], Demo.prototype, "settour", null);
82
+ __decorate([bind], Demo.prototype, "close", null);
@@ -0,0 +1,20 @@
1
+ export { default as data } from './index.json';
2
+ import { Component } from 'intact';
3
+ export default class extends Component {
4
+ static template: string | import("intact").Template<any>;
5
+ static defaults(): {
6
+ currentStep: number;
7
+ showTour: boolean;
8
+ inputValue: string;
9
+ errorMsg: string;
10
+ tourData: {
11
+ target: string;
12
+ title: string;
13
+ content: string;
14
+ position: string;
15
+ }[];
16
+ };
17
+ startTour(): void;
18
+ finishTour(): void;
19
+ handleBeforeChange(current: number): boolean;
20
+ }
@@ -0,0 +1,69 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import { __decorate } from "tslib";
3
+ export { default as data } from './index.json';
4
+ import { Component } from 'intact';
5
+ import template from './index.vdt';
6
+ import { bind, Message } from 'kpc';
7
+ var default_1 = /*#__PURE__*/function (_Component) {
8
+ _inheritsLoose(default_1, _Component);
9
+ function default_1() {
10
+ return _Component.apply(this, arguments) || this;
11
+ }
12
+ default_1.defaults = function defaults() {
13
+ return {
14
+ currentStep: 0,
15
+ showTour: false,
16
+ inputValue: '',
17
+ errorMsg: '',
18
+ tourData: [{
19
+ target: '#step1',
20
+ title: '第一步',
21
+ content: '这是第一步的引导说明',
22
+ position: 'bottom'
23
+ }, {
24
+ target: '#step2',
25
+ title: '第二步',
26
+ content: '这是第二步的引导说明',
27
+ position: 'right'
28
+ }, {
29
+ target: '.step3-input',
30
+ title: '第三步',
31
+ content: '请在输入框中输入"next"以继续',
32
+ position: 'bottom'
33
+ }, {
34
+ target: '#step4',
35
+ title: '最后一步',
36
+ content: '恭喜您完成了所有步骤',
37
+ position: 'top'
38
+ }]
39
+ };
40
+ };
41
+ var _proto = default_1.prototype;
42
+ _proto.startTour = function startTour() {
43
+ this.set({
44
+ showTour: true,
45
+ currentStep: 0
46
+ });
47
+ };
48
+ _proto.finishTour = function finishTour() {
49
+ this.set({
50
+ showTour: false
51
+ });
52
+ };
53
+ _proto.handleBeforeChange = function handleBeforeChange(current) {
54
+ var inputValue = this.get('inputValue');
55
+ if (current === 3) {
56
+ if (inputValue !== 'next') {
57
+ Message.error('请在输入框中输入"next"才能进入下一步');
58
+ return false;
59
+ }
60
+ }
61
+ return true;
62
+ };
63
+ return default_1;
64
+ }(Component);
65
+ default_1.template = template;
66
+ export { default_1 as default };
67
+ __decorate([bind], default_1.prototype, "startTour", null);
68
+ __decorate([bind], default_1.prototype, "finishTour", null);
69
+ __decorate([bind], default_1.prototype, "handleBeforeChange", null);
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ export default class Demo extends React.Component {
3
+ state: {
4
+ currentStep: number;
5
+ showTour: boolean;
6
+ inputValue: string;
7
+ errorMsg: string;
8
+ tourData: {
9
+ target: string;
10
+ title: string;
11
+ content: string;
12
+ position: string;
13
+ }[];
14
+ };
15
+ startTour(): void;
16
+ finishTour(): void;
17
+ handleBeforeChange(current: number): boolean;
18
+ render(): React.JSX.Element;
19
+ }