@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
@@ -0,0 +1,129 @@
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, Input } from '@king-design/react';
6
+ import { bind, Message } 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
+ inputValue: '',
20
+ errorMsg: '',
21
+ tourData: [{
22
+ target: '#step1',
23
+ title: '第一步',
24
+ content: '这是第一步的引导说明',
25
+ position: 'bottom'
26
+ }, {
27
+ target: '#step2',
28
+ title: '第二步',
29
+ content: '这是第二步的引导说明',
30
+ position: 'right'
31
+ }, {
32
+ target: '.step3-input',
33
+ title: '第三步',
34
+ content: '请在输入框中输入"next"以继续',
35
+ position: 'bottom'
36
+ }, {
37
+ target: '#step4',
38
+ title: '最后一步',
39
+ content: '恭喜您完成了所有步骤',
40
+ position: 'top'
41
+ }]
42
+ };
43
+ return _this;
44
+ }
45
+ var _proto = Demo.prototype;
46
+ _proto.startTour = function startTour() {
47
+ this.setState({
48
+ showTour: true,
49
+ currentStep: 0
50
+ });
51
+ };
52
+ _proto.finishTour = function finishTour() {
53
+ this.setState({
54
+ showTour: false
55
+ });
56
+ };
57
+ _proto.handleBeforeChange = function handleBeforeChange(current) {
58
+ var inputValue = this.state.inputValue;
59
+ if (current === 3) {
60
+ if (inputValue !== 'next') {
61
+ Message.error('请在输入框中输入"next"才能进入下一步');
62
+ return false;
63
+ }
64
+ }
65
+ return true;
66
+ };
67
+ _proto.render = function render() {
68
+ var _this2 = this;
69
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
70
+ className: "example-container"
71
+ }, /*#__PURE__*/React.createElement(Button, {
72
+ id: "step1"
73
+ }, "\u6B65\u9AA41"), /*#__PURE__*/React.createElement(Button, {
74
+ id: "step2",
75
+ style: {
76
+ "marginLeft": "20px"
77
+ }
78
+ }, "\u6B65\u9AA42"), /*#__PURE__*/React.createElement("div", {
79
+ style: {
80
+ "marginTop": "20px"
81
+ }
82
+ }, /*#__PURE__*/React.createElement(Input, {
83
+ className: "step3-input",
84
+ placeholder: "\u901A\u8FC7\u9A8C\u8BC1\u624D\u80FD\u8FDB\u5165\u4E0B\u4E00\u6B65",
85
+ value: this.state.inputValue,
86
+ onChangeValue: function onChangeValue(inputValue) {
87
+ return _this2.setState({
88
+ inputValue: inputValue
89
+ });
90
+ }
91
+ })), /*#__PURE__*/React.createElement(Button, {
92
+ id: "step4",
93
+ style: {
94
+ "marginTop": "20px"
95
+ }
96
+ }, "\u6B65\u9AA44")), /*#__PURE__*/React.createElement(Tour, {
97
+ value: this.state.currentStep,
98
+ onChangeValue: function onChangeValue(currentStep) {
99
+ return _this2.setState({
100
+ currentStep: currentStep
101
+ });
102
+ },
103
+ visible: this.state.showTour,
104
+ data: this.state.tourData,
105
+ beforeChange: this.handleBeforeChange,
106
+ onFinish: this.finishTour
107
+ }), /*#__PURE__*/React.createElement("div", {
108
+ style: {
109
+ "marginTop": "20px"
110
+ }
111
+ }, /*#__PURE__*/React.createElement(Button, {
112
+ onClick: this.startTour
113
+ }, "\u542F\u52A8\u5F15\u5BFC"), /*#__PURE__*/React.createElement("span", {
114
+ style: {
115
+ "marginLeft": "10px"
116
+ }
117
+ }, "\u5F53\u524D\u6B65\u9AA4: ", this.state.currentStep >= 0 ? this.state.currentStep + 1 : '未启动'), this.state.errorMsg ? /*#__PURE__*/React.createElement("div", {
118
+ style: {
119
+ "marginTop": "10px",
120
+ "color": "#f56c6c"
121
+ }
122
+ }, this.state.errorMsg) : undefined));
123
+ };
124
+ return Demo;
125
+ }(React.Component);
126
+ export { Demo as default };
127
+ __decorate([bind], Demo.prototype, "startTour", null);
128
+ __decorate([bind], Demo.prototype, "finishTour", null);
129
+ __decorate([bind], Demo.prototype, "handleBeforeChange", null);
@@ -0,0 +1,18 @@
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
+ closable: boolean;
9
+ tourData: {
10
+ target: string;
11
+ title: string;
12
+ content: string;
13
+ position: string;
14
+ }[];
15
+ };
16
+ startTour(): void;
17
+ finishTour(): void;
18
+ }
@@ -0,0 +1,42 @@
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
+ closable: false,
17
+ tourData: [{
18
+ target: '#closabelDemo',
19
+ title: '禁用关闭图标',
20
+ content: '当closable为true时,header区域关闭图标隐藏',
21
+ position: 'right'
22
+ }]
23
+ };
24
+ };
25
+ var _proto = default_1.prototype;
26
+ _proto.startTour = function startTour() {
27
+ this.set({
28
+ showTour: true,
29
+ currentStep: 0
30
+ });
31
+ };
32
+ _proto.finishTour = function finishTour() {
33
+ this.set({
34
+ showTour: false
35
+ });
36
+ };
37
+ return default_1;
38
+ }(Component);
39
+ default_1.template = template;
40
+ export { default_1 as default };
41
+ __decorate([bind], default_1.prototype, "startTour", null);
42
+ __decorate([bind], default_1.prototype, "finishTour", null);
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ export default class Demo extends React.Component {
3
+ state: {
4
+ currentStep: number;
5
+ showTour: boolean;
6
+ closable: boolean;
7
+ tourData: {
8
+ target: string;
9
+ title: string;
10
+ content: string;
11
+ position: string;
12
+ }[];
13
+ };
14
+ startTour(): void;
15
+ finishTour(): void;
16
+ render(): React.JSX.Element;
17
+ }
@@ -0,0 +1,85 @@
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, Switch } 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
+ closable: false,
20
+ tourData: [{
21
+ target: '#closabelDemo',
22
+ title: '禁用关闭图标',
23
+ content: '当closable为true时,header区域关闭图标隐藏',
24
+ position: 'right'
25
+ }]
26
+ };
27
+ return _this;
28
+ }
29
+ var _proto = Demo.prototype;
30
+ _proto.startTour = function startTour() {
31
+ this.setState({
32
+ showTour: true,
33
+ currentStep: 0
34
+ });
35
+ };
36
+ _proto.finishTour = function finishTour() {
37
+ this.setState({
38
+ showTour: false
39
+ });
40
+ };
41
+ _proto.render = function render() {
42
+ var _this2 = this;
43
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
44
+ className: "example-container"
45
+ }, /*#__PURE__*/React.createElement(Button, {
46
+ id: "closabelDemo"
47
+ }, "\u76EE\u6807\u5143\u7D201")), /*#__PURE__*/React.createElement(Tour, {
48
+ value: this.state.currentStep,
49
+ onChangeValue: function onChangeValue(currentStep) {
50
+ return _this2.setState({
51
+ currentStep: currentStep
52
+ });
53
+ },
54
+ visible: this.state.showTour,
55
+ data: this.state.tourData,
56
+ closable: this.state.closable,
57
+ onFinish: this.finishTour
58
+ }), /*#__PURE__*/React.createElement("div", {
59
+ style: {
60
+ "marginTop": "20px"
61
+ }
62
+ }, /*#__PURE__*/React.createElement("div", {
63
+ style: {
64
+ "marginBottom": "10px"
65
+ }
66
+ }, /*#__PURE__*/React.createElement(Switch, {
67
+ value: this.state.closable,
68
+ onChangeValue: function onChangeValue(closable) {
69
+ return _this2.setState({
70
+ closable: closable
71
+ });
72
+ }
73
+ }), /*#__PURE__*/React.createElement("span", {
74
+ style: {
75
+ "marginLeft": "10px"
76
+ }
77
+ }, "\u5173\u95ED\u56FE\u6807: ", this.state.closable ? '启用' : '禁用')), /*#__PURE__*/React.createElement(Button, {
78
+ onClick: this.startTour
79
+ }, "\u542F\u52A8\u5F15\u5BFC")));
80
+ };
81
+ return Demo;
82
+ }(React.Component);
83
+ export { Demo as default };
84
+ __decorate([bind], Demo.prototype, "startTour", null);
85
+ __decorate([bind], Demo.prototype, "finishTour", null);
@@ -0,0 +1,11 @@
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
+ };
9
+ settour(): void;
10
+ close(): void;
11
+ }
@@ -0,0 +1,35 @@
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
+ };
17
+ };
18
+ var _proto = default_1.prototype;
19
+ _proto.settour = function settour() {
20
+ this.set({
21
+ showTour: true,
22
+ currentStep: 0
23
+ });
24
+ };
25
+ _proto.close = function close() {
26
+ this.set({
27
+ showTour: false
28
+ });
29
+ };
30
+ return default_1;
31
+ }(Component);
32
+ default_1.template = template;
33
+ export { default_1 as default };
34
+ __decorate([bind], default_1.prototype, "settour", null);
35
+ __decorate([bind], default_1.prototype, "close", null);
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import './index.styl';
3
+ export default class Demo extends React.Component {
4
+ state: {
5
+ currentStep: number;
6
+ showTour: boolean;
7
+ };
8
+ settour(): void;
9
+ close(): void;
10
+ render(): React.JSX.Element;
11
+ }
@@ -0,0 +1,108 @@
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, TourStep, Button, Icon } from '@king-design/react';
6
+ import './index.styl';
7
+ import { bind } from '@king-design/react';
8
+ var Demo = /*#__PURE__*/function (_React$Component) {
9
+ _inheritsLoose(Demo, _React$Component);
10
+ function Demo() {
11
+ var _context;
12
+ var _this;
13
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
14
+ args[_key] = arguments[_key];
15
+ }
16
+ _this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
17
+ _this.state = {
18
+ currentStep: 0,
19
+ showTour: false
20
+ };
21
+ return _this;
22
+ }
23
+ var _proto = Demo.prototype;
24
+ _proto.settour = function settour() {
25
+ this.setState({
26
+ showTour: true,
27
+ currentStep: 0
28
+ });
29
+ };
30
+ _proto.close = function close() {
31
+ this.setState({
32
+ showTour: false
33
+ });
34
+ };
35
+ _proto.render = function render() {
36
+ var _this2 = this;
37
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
38
+ className: "example-container"
39
+ }, /*#__PURE__*/React.createElement(Button, {
40
+ id: "btn5"
41
+ }, "\u793A\u4F8B\u5143\u7D20")), /*#__PURE__*/React.createElement(Tour, {
42
+ value: this.state.currentStep,
43
+ onChangeValue: function onChangeValue(currentStep) {
44
+ return _this2.setState({
45
+ currentStep: currentStep
46
+ });
47
+ },
48
+ visible: this.state.showTour,
49
+ onFinish: this.close
50
+ }, /*#__PURE__*/React.createElement(TourStep, {
51
+ slotHeader: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
52
+ style: {
53
+ "display": "flex",
54
+ "alignItems": "center"
55
+ }
56
+ }, /*#__PURE__*/React.createElement(Icon, {
57
+ className: "ion-android-star",
58
+ style: {
59
+ "marginRight": "5px",
60
+ "color": "#f0ad4e"
61
+ }
62
+ }), /*#__PURE__*/React.createElement("span", {
63
+ className: "custom-title"
64
+ }, "\u81EA\u5B9A\u4E49\u6807\u9898"), /*#__PURE__*/React.createElement("span", {
65
+ style: {
66
+ "marginLeft": "8px",
67
+ "color": "#999",
68
+ "fontSize": "12px"
69
+ }
70
+ }, "\u5E26\u56FE\u6807\u548C\u6837\u5F0F"))),
71
+ slotFooter: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
72
+ className: "step-indicator"
73
+ }, this.state.currentStep + 1, " / 1"), /*#__PURE__*/React.createElement("div", {
74
+ className: "custom-footer"
75
+ }, /*#__PURE__*/React.createElement(Button, {
76
+ size: "small",
77
+ type: "danger",
78
+ style: {
79
+ "marginRight": "8px"
80
+ },
81
+ onClick: this.close
82
+ }, "\u8DF3\u8FC7"), /*#__PURE__*/React.createElement(Button, {
83
+ size: "small",
84
+ type: "primary",
85
+ onClick: this.close
86
+ }, "\u6211\u77E5\u9053\u4E86"))),
87
+ target: "#btn5",
88
+ position: "bottom"
89
+ }, /*#__PURE__*/React.createElement("div", {
90
+ className: "custom-content"
91
+ }, /*#__PURE__*/React.createElement("p", null, "\u8FD9\u662F\u4E00\u4E2A\u81EA\u5B9A\u4E49\u7684\u590D\u6742\u5185\u5BB9\uFF0C\u53EF\u4EE5\u5305\u542B\u56FE\u7247\u3001\u94FE\u63A5\u7B49\u4EFB\u4F55\u5143\u7D20\u3002"), /*#__PURE__*/React.createElement("a", {
92
+ href: "javascript:;",
93
+ style: {
94
+ "color": "#2d8cf0"
95
+ }
96
+ }, "\u4E86\u89E3\u66F4\u591A")))), /*#__PURE__*/React.createElement("div", {
97
+ style: {
98
+ "marginTop": "20px"
99
+ }
100
+ }, /*#__PURE__*/React.createElement(Button, {
101
+ onClick: this.settour
102
+ }, "\u542F\u52A8\u81EA\u5B9A\u4E49\u5F15\u5BFC")));
103
+ };
104
+ return Demo;
105
+ }(React.Component);
106
+ export { Demo as default };
107
+ __decorate([bind], Demo.prototype, "settour", null);
108
+ __decorate([bind], Demo.prototype, "close", null);
@@ -0,0 +1,33 @@
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
+ nextText: string;
14
+ prevText?: undefined;
15
+ } | {
16
+ target: string;
17
+ title: string;
18
+ content: string;
19
+ position: string;
20
+ nextText: string;
21
+ prevText: string;
22
+ } | {
23
+ target: string;
24
+ title: string;
25
+ content: string;
26
+ position: string;
27
+ prevText: string;
28
+ nextText?: undefined;
29
+ })[];
30
+ };
31
+ startTour(): void;
32
+ close(): void;
33
+ }
@@ -0,0 +1,55 @@
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: '#welcome-btn',
18
+ title: '欢迎使用!',
19
+ content: '欢迎来到我们的应用,让我们开始引导之旅吧!',
20
+ position: 'bottom',
21
+ nextText: '开始探索'
22
+ }, {
23
+ target: '#feature-btn',
24
+ title: '功能介绍',
25
+ content: '这里是主要功能区域,您可以在这里进行各种操作。',
26
+ position: 'bottom',
27
+ nextText: '前进',
28
+ prevText: '回到开始'
29
+ }, {
30
+ target: '#finish-btn',
31
+ title: '设置完成',
32
+ content: '恭喜!您已经完成了所有设置,现在可以开始使用了。',
33
+ position: 'top',
34
+ prevText: '返回上一步'
35
+ }]
36
+ };
37
+ };
38
+ var _proto = default_1.prototype;
39
+ _proto.startTour = function startTour() {
40
+ this.set({
41
+ showTour: true,
42
+ currentStep: 0
43
+ });
44
+ };
45
+ _proto.close = function close() {
46
+ this.set({
47
+ showTour: false
48
+ });
49
+ };
50
+ return default_1;
51
+ }(Component);
52
+ default_1.template = template;
53
+ export { default_1 as default };
54
+ __decorate([bind], default_1.prototype, "startTour", null);
55
+ __decorate([bind], default_1.prototype, "close", null);
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import './index.styl';
3
+ export default class Demo extends React.Component {
4
+ state: {
5
+ currentStep: number;
6
+ showTour: boolean;
7
+ tourData: ({
8
+ target: string;
9
+ title: string;
10
+ content: string;
11
+ position: string;
12
+ nextText: string;
13
+ prevText?: undefined;
14
+ } | {
15
+ target: string;
16
+ title: string;
17
+ content: string;
18
+ position: string;
19
+ nextText: string;
20
+ prevText: string;
21
+ } | {
22
+ target: string;
23
+ title: string;
24
+ content: string;
25
+ position: string;
26
+ prevText: string;
27
+ nextText?: undefined;
28
+ })[];
29
+ };
30
+ startTour(): void;
31
+ close(): void;
32
+ render(): React.JSX.Element;
33
+ }
@@ -0,0 +1,99 @@
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 './index.styl';
7
+ import { bind } from '@king-design/react';
8
+ var Demo = /*#__PURE__*/function (_React$Component) {
9
+ _inheritsLoose(Demo, _React$Component);
10
+ function Demo() {
11
+ var _context;
12
+ var _this;
13
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
14
+ args[_key] = arguments[_key];
15
+ }
16
+ _this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
17
+ _this.state = {
18
+ currentStep: 0,
19
+ showTour: false,
20
+ tourData: [{
21
+ target: '#welcome-btn',
22
+ title: '欢迎使用!',
23
+ content: '欢迎来到我们的应用,让我们开始引导之旅吧!',
24
+ position: 'bottom',
25
+ nextText: '开始探索'
26
+ }, {
27
+ target: '#feature-btn',
28
+ title: '功能介绍',
29
+ content: '这里是主要功能区域,您可以在这里进行各种操作。',
30
+ position: 'bottom',
31
+ nextText: '前进',
32
+ prevText: '回到开始'
33
+ }, {
34
+ target: '#finish-btn',
35
+ title: '设置完成',
36
+ content: '恭喜!您已经完成了所有设置,现在可以开始使用了。',
37
+ position: 'top',
38
+ prevText: '返回上一步'
39
+ }]
40
+ };
41
+ return _this;
42
+ }
43
+ var _proto = Demo.prototype;
44
+ _proto.startTour = function startTour() {
45
+ this.setState({
46
+ showTour: true,
47
+ currentStep: 0
48
+ });
49
+ };
50
+ _proto.close = function close() {
51
+ this.setState({
52
+ showTour: false
53
+ });
54
+ };
55
+ _proto.render = function render() {
56
+ var _this2 = this;
57
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
58
+ className: "example-container"
59
+ }, /*#__PURE__*/React.createElement(Button, {
60
+ id: "welcome-btn"
61
+ }, "\u6B22\u8FCE\u9875\u9762"), /*#__PURE__*/React.createElement(Button, {
62
+ id: "feature-btn",
63
+ style: {
64
+ "marginLeft": "20px"
65
+ }
66
+ }, "\u529F\u80FD\u4ECB\u7ECD"), /*#__PURE__*/React.createElement(Button, {
67
+ id: "finish-btn",
68
+ style: {
69
+ "marginLeft": "20px"
70
+ }
71
+ }, "\u5B8C\u6210\u8BBE\u7F6E")), /*#__PURE__*/React.createElement(Tour, {
72
+ value: this.state.currentStep,
73
+ onChangeValue: function onChangeValue(currentStep) {
74
+ return _this2.setState({
75
+ currentStep: currentStep
76
+ });
77
+ },
78
+ visible: this.state.showTour,
79
+ data: this.state.tourData,
80
+ doneText: "\u5B8C\u6210",
81
+ onFinish: this.close
82
+ }), /*#__PURE__*/React.createElement("div", {
83
+ style: {
84
+ "marginTop": "20px"
85
+ }
86
+ }, /*#__PURE__*/React.createElement(Button, {
87
+ type: "primary",
88
+ onClick: this.startTour
89
+ }, "\u5F00\u59CB\u81EA\u5B9A\u4E49\u6309\u94AE\u5F15\u5BFC"), /*#__PURE__*/React.createElement("span", {
90
+ style: {
91
+ "marginLeft": "10px"
92
+ }
93
+ }, "\u5F53\u524D\u6B65\u9AA4: ", this.state.currentStep >= 0 ? this.state.currentStep + 1 : '未启动')));
94
+ };
95
+ return Demo;
96
+ }(React.Component);
97
+ export { Demo as default };
98
+ __decorate([bind], Demo.prototype, "startTour", null);
99
+ __decorate([bind], Demo.prototype, "close", null);