@king-design/intact 3.5.2 → 3.6.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/button/index.md +1 -0
- package/components/cascader/index.spec.ts +7 -6
- package/components/datepicker/basepicker.ts +26 -267
- package/components/datepicker/calendar.ts +8 -2
- package/components/datepicker/calendar.vdt +23 -6
- package/components/datepicker/dayjs.ts +8 -2
- package/components/datepicker/demos/multiple.md +1 -1
- package/components/datepicker/demos/yearMonth.md +1 -1
- package/components/datepicker/helpers.ts +10 -12
- package/components/datepicker/index.md +2 -2
- package/components/datepicker/index.spec.ts +619 -190
- package/components/datepicker/index.ts +22 -21
- package/components/datepicker/index.vdt +47 -42
- package/components/datepicker/shortcuts.ts +1 -1
- package/components/datepicker/styles.ts +112 -4
- package/components/datepicker/useConfirm.ts +82 -0
- package/components/datepicker/useDisabled.ts +31 -33
- package/components/datepicker/useFormats.ts +10 -4
- package/components/datepicker/useHighlight.ts +81 -0
- package/components/datepicker/useKeyboards.ts +2 -1
- package/components/datepicker/useMergeRange.ts +54 -0
- package/components/datepicker/useMonths.ts +6 -3
- package/components/datepicker/usePanel.ts +19 -19
- package/components/datepicker/useQuarters.ts +47 -0
- package/components/datepicker/useShowDate.ts +14 -3
- package/components/datepicker/useStatus.ts +34 -15
- package/components/datepicker/useValue.ts +41 -39
- package/components/datepicker/useValueBase.ts +309 -0
- package/components/datepicker/useWeeks.ts +58 -0
- package/components/datepicker/useYears.ts +7 -3
- package/components/descriptions/.DS_Store +0 -0
- package/components/dialog/useFixBody.ts +7 -64
- package/components/dropdown/dropdown.ts +5 -4
- package/components/dropdown/index.md +1 -0
- package/components/dropdown/item.ts +1 -1
- package/components/dropdown/useKeyboard.ts +0 -1
- package/components/ellipsis/styles.ts +4 -0
- package/components/form/styles.ts +1 -0
- package/components/input/index.spec.ts +42 -0
- package/components/input/index.ts +8 -0
- package/components/input/index.vdt +3 -4
- package/components/input/useAutoWidth.ts +19 -1
- package/components/menu/.DS_Store +0 -0
- package/components/menu/demos/.DS_Store +0 -0
- package/components/scrollSelect/index.spec.ts +3 -3
- package/components/scrollSelect/useMouseEvents.ts +24 -10
- package/components/select/base.ts +3 -2
- package/components/select/base.vdt +3 -1
- package/components/select/demos/creatable.md +13 -0
- package/components/select/index.md +1 -0
- package/components/select/index.spec.ts +225 -6
- package/components/select/option.ts +10 -1
- package/components/select/select.ts +3 -0
- package/components/select/styles.ts +3 -1
- package/components/select/useFilterable.ts +1 -1
- package/components/select/useInput.ts +7 -9
- package/components/select/useSearchable.ts +2 -2
- package/components/table/.DS_Store +0 -0
- package/components/table/index.spec.ts +69 -1
- package/components/table/useStickyHeader.ts +1 -1
- package/components/timepicker/demos/step.md +1 -1
- package/components/timepicker/index.spec.ts +145 -27
- package/components/timepicker/panelPicker.ts +10 -4
- package/components/timepicker/panelPicker.vdt +5 -3
- package/components/timepicker/useConfirm.ts +33 -0
- package/components/timepicker/useDefaultValue.ts +30 -0
- package/components/timepicker/useDisabled.ts +17 -4
- package/components/timepicker/useFormats.ts +1 -1
- package/components/timepicker/useValue.ts +22 -19
- package/components/tour/.DS_Store +0 -0
- package/components/tour/demos/basic.md +73 -0
- package/components/tour/demos/beforeChange.md +109 -0
- package/components/tour/demos/closable.md +70 -0
- package/components/tour/demos/custom.md +98 -0
- package/components/tour/demos/customText.md +94 -0
- package/components/tour/demos/declarative.md +72 -0
- package/components/tour/demos/events.md +101 -0
- package/components/tour/demos/maskClosable.md +76 -0
- package/components/tour/demos/notarget.md +59 -0
- package/components/tour/index.md +48 -0
- package/components/tour/index.spec.ts +259 -0
- package/components/tour/index.ts +2 -0
- package/components/tour/step.ts +55 -0
- package/components/tour/step.vdt +75 -0
- package/components/tour/styles.ts +283 -0
- package/components/tour/tour.ts +107 -0
- package/components/tour/tour.vdt +83 -0
- package/components/tour/useArrow.ts +46 -0
- package/components/tour/useFixBody.ts +22 -0
- package/components/tour/useHighlight.ts +36 -0
- package/components/tour/useMaskClosable.ts +26 -0
- package/components/tour/useNavigation.ts +46 -0
- package/components/tour/usePosition.ts +91 -0
- package/components/tour/useSteps.ts +80 -0
- package/components/virtualList/.DS_Store +0 -0
- package/components/virtualList/demos/.DS_Store +0 -0
- package/es/components/cascader/index.spec.js +18 -19
- package/es/components/datepicker/basepicker.d.ts +6 -25
- package/es/components/datepicker/basepicker.js +22 -234
- package/es/components/datepicker/calendar.d.ts +36 -6
- package/es/components/datepicker/calendar.js +4 -0
- package/es/components/datepicker/calendar.vdt.js +21 -5
- package/es/components/datepicker/dayjs.d.ts +2 -2
- package/es/components/datepicker/dayjs.js +6 -0
- package/es/components/datepicker/helpers.d.ts +8 -7
- package/es/components/datepicker/helpers.js +2 -3
- package/es/components/datepicker/index.d.ts +26 -19
- package/es/components/datepicker/index.js +21 -13
- package/es/components/datepicker/index.spec.js +1389 -633
- package/es/components/datepicker/index.vdt.js +43 -46
- package/es/components/datepicker/shortcuts.d.ts +1 -1
- package/es/components/datepicker/styles.d.ts +22 -0
- package/es/components/datepicker/styles.js +26 -4
- package/es/components/datepicker/useConfirm.d.ts +6 -0
- package/es/components/datepicker/useConfirm.js +65 -0
- package/es/components/datepicker/useDisabled.d.ts +7 -5
- package/es/components/datepicker/useDisabled.js +22 -27
- package/es/components/datepicker/useFormats.d.ts +2 -2
- package/es/components/datepicker/useFormats.js +9 -3
- package/es/components/datepicker/useHighlight.d.ts +14 -0
- package/es/components/datepicker/useHighlight.js +60 -0
- package/es/components/datepicker/useKeyboards.js +2 -1
- package/es/components/datepicker/useMergeRange.d.ts +5 -0
- package/es/components/datepicker/useMergeRange.js +45 -0
- package/es/components/datepicker/useMonths.js +5 -3
- package/es/components/datepicker/usePanel.d.ts +1 -10
- package/es/components/datepicker/usePanel.js +19 -32
- package/es/components/datepicker/useQuarters.d.ts +15 -0
- package/es/components/datepicker/useQuarters.js +36 -0
- package/es/components/datepicker/useShowDate.js +10 -2
- package/es/components/datepicker/useStatus.d.ts +1 -1
- package/es/components/datepicker/useStatus.js +33 -16
- package/es/components/datepicker/useValue.d.ts +12 -6
- package/es/components/datepicker/useValue.js +49 -45
- package/es/components/datepicker/useValueBase.d.ts +28 -0
- package/es/components/datepicker/useValueBase.js +277 -0
- package/es/components/datepicker/useWeeks.d.ts +19 -0
- package/es/components/datepicker/useWeeks.js +48 -0
- package/es/components/datepicker/useYears.js +6 -3
- package/es/components/dialog/useFixBody.js +6 -58
- package/es/components/dropdown/dropdown.d.ts +1 -0
- package/es/components/dropdown/dropdown.js +7 -4
- package/es/components/ellipsis/styles.js +1 -1
- package/es/components/form/styles.js +1 -1
- package/es/components/input/index.d.ts +2 -0
- package/es/components/input/index.js +6 -0
- package/es/components/input/index.spec.js +45 -0
- package/es/components/input/index.vdt.js +4 -3
- package/es/components/input/useAutoWidth.d.ts +2 -0
- package/es/components/input/useAutoWidth.js +19 -1
- package/es/components/scrollSelect/index.spec.js +4 -6
- package/es/components/scrollSelect/useMouseEvents.js +22 -9
- package/es/components/select/base.d.ts +1 -1
- package/es/components/select/base.js +3 -2
- package/es/components/select/base.vdt.js +5 -2
- package/es/components/select/index.spec.js +329 -82
- package/es/components/select/option.d.ts +1 -0
- package/es/components/select/option.js +10 -2
- package/es/components/select/select.d.ts +1 -0
- package/es/components/select/select.js +4 -2
- package/es/components/select/styles.d.ts +79 -0
- package/es/components/select/styles.js +1 -0
- package/es/components/select/useFilterable.js +2 -1
- package/es/components/select/useInput.d.ts +1 -1
- package/es/components/select/useInput.js +7 -4
- package/es/components/select/useSearchable.js +1 -0
- package/es/components/table/index.spec.js +84 -6
- package/es/components/table/useStickyHeader.js +1 -1
- package/es/components/timepicker/index.spec.js +298 -128
- package/es/components/timepicker/panelPicker.d.ts +23 -17
- package/es/components/timepicker/panelPicker.js +7 -4
- package/es/components/timepicker/panelPicker.vdt.js +8 -4
- package/es/components/timepicker/selectPicker.d.ts +5 -4
- package/es/components/timepicker/useConfirm.d.ts +6 -0
- package/es/components/timepicker/useConfirm.js +19 -0
- package/es/components/timepicker/useDefaultValue.d.ts +4 -0
- package/es/components/timepicker/useDefaultValue.js +27 -0
- package/es/components/timepicker/useDisabled.d.ts +7 -4
- package/es/components/timepicker/useDisabled.js +13 -4
- package/es/components/timepicker/useFormats.d.ts +1 -1
- package/es/components/timepicker/useValue.d.ts +14 -8
- package/es/components/timepicker/useValue.js +14 -15
- package/es/components/tour/index.d.ts +2 -0
- package/es/components/tour/index.js +2 -0
- package/es/components/tour/index.spec.d.ts +1 -0
- package/es/components/tour/index.spec.js +356 -0
- package/es/components/tour/step.d.ts +23 -0
- package/es/components/tour/step.js +46 -0
- package/es/components/tour/step.vdt.js +74 -0
- package/es/components/tour/styles.d.ts +7 -0
- package/es/components/tour/styles.js +84 -0
- package/es/components/tour/tour.d.ts +73 -0
- package/es/components/tour/tour.js +70 -0
- package/es/components/tour/tour.vdt.js +66 -0
- package/es/components/tour/useArrow.d.ts +4 -0
- package/es/components/tour/useArrow.js +40 -0
- package/es/components/tour/useFixBody.d.ts +4 -0
- package/es/components/tour/useFixBody.js +17 -0
- package/es/components/tour/useHighlight.d.ts +4 -0
- package/es/components/tour/useHighlight.js +31 -0
- package/es/components/tour/useMaskClosable.d.ts +1 -0
- package/es/components/tour/useMaskClosable.js +25 -0
- package/es/components/tour/useNavigation.d.ts +5 -0
- package/es/components/tour/useNavigation.js +103 -0
- package/es/components/tour/usePosition.d.ts +6 -0
- package/es/components/tour/usePosition.js +93 -0
- package/es/components/tour/useSteps.d.ts +6 -0
- package/es/components/tour/useSteps.js +68 -0
- package/es/hooks/useFixBody.d.ts +11 -0
- package/es/hooks/useFixBody.js +72 -0
- package/es/index.d.ts +3 -2
- package/es/index.js +3 -2
- package/es/site/data/components/datepicker/demos/multiple/react.js +2 -2
- package/es/site/data/components/select/demos/creatable/index.d.ts +1 -0
- package/es/site/data/components/select/demos/creatable/index.js +2 -1
- package/es/site/data/components/select/demos/creatable/react.d.ts +1 -0
- package/es/site/data/components/select/demos/creatable/react.js +31 -2
- package/es/site/data/components/tour/demos/basic/index.d.ts +17 -0
- package/es/site/data/components/tour/demos/basic/index.js +46 -0
- package/es/site/data/components/tour/demos/basic/react.d.ts +16 -0
- package/es/site/data/components/tour/demos/basic/react.js +82 -0
- package/es/site/data/components/tour/demos/beforeChange/index.d.ts +20 -0
- package/es/site/data/components/tour/demos/beforeChange/index.js +69 -0
- package/es/site/data/components/tour/demos/beforeChange/react.d.ts +19 -0
- package/es/site/data/components/tour/demos/beforeChange/react.js +129 -0
- package/es/site/data/components/tour/demos/closable/index.d.ts +18 -0
- package/es/site/data/components/tour/demos/closable/index.js +42 -0
- package/es/site/data/components/tour/demos/closable/react.d.ts +17 -0
- package/es/site/data/components/tour/demos/closable/react.js +85 -0
- package/es/site/data/components/tour/demos/custom/index.d.ts +11 -0
- package/es/site/data/components/tour/demos/custom/index.js +35 -0
- package/es/site/data/components/tour/demos/custom/react.d.ts +11 -0
- package/es/site/data/components/tour/demos/custom/react.js +108 -0
- package/es/site/data/components/tour/demos/customText/index.d.ts +33 -0
- package/es/site/data/components/tour/demos/customText/index.js +55 -0
- package/es/site/data/components/tour/demos/customText/react.d.ts +33 -0
- package/es/site/data/components/tour/demos/customText/react.js +99 -0
- package/es/site/data/components/tour/demos/declarative/index.d.ts +11 -0
- package/es/site/data/components/tour/demos/declarative/index.js +36 -0
- package/es/site/data/components/tour/demos/declarative/react.d.ts +10 -0
- package/es/site/data/components/tour/demos/declarative/react.js +80 -0
- package/es/site/data/components/tour/demos/events/index.d.ts +18 -0
- package/es/site/data/components/tour/demos/events/index.js +58 -0
- package/es/site/data/components/tour/demos/events/react.d.ts +18 -0
- package/es/site/data/components/tour/demos/events/react.js +101 -0
- package/es/site/data/components/tour/demos/maskClosable/index.d.ts +18 -0
- package/es/site/data/components/tour/demos/maskClosable/index.js +47 -0
- package/es/site/data/components/tour/demos/maskClosable/react.d.ts +17 -0
- package/es/site/data/components/tour/demos/maskClosable/react.js +95 -0
- package/es/site/data/components/tour/demos/notarget/index.d.ts +11 -0
- package/es/site/data/components/tour/demos/notarget/index.js +35 -0
- package/es/site/data/components/tour/demos/notarget/react.d.ts +10 -0
- package/es/site/data/components/tour/demos/notarget/react.js +61 -0
- package/es/site/data/components/tour/index.d.ts +57 -0
- package/es/site/data/components/tour/index.js +32 -0
- package/hooks/useFixBody.ts +87 -0
- package/index.ts +3 -2
- package/package.json +2 -2
- package/styles/.DS_Store +0 -0
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.
|
|
2
|
+
* @king-design v3.6.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.
|
|
70
|
+
export var version = '3.6.0';
|
|
70
71
|
/* generate end */
|
|
@@ -73,13 +73,13 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
73
73
|
}), "You selected: ", _JSON$stringify(this.state.dateRange), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Datepicker, {
|
|
74
74
|
multiple: true,
|
|
75
75
|
range: true,
|
|
76
|
+
type: "datetime",
|
|
76
77
|
value: this.state.datetimeRange,
|
|
77
78
|
onChangeValue: function onChangeValue(datetimeRange) {
|
|
78
79
|
return _this2.setState({
|
|
79
80
|
datetimeRange: datetimeRange
|
|
80
81
|
});
|
|
81
|
-
}
|
|
82
|
-
type: "datetime"
|
|
82
|
+
}
|
|
83
83
|
}), "You selected: ", _JSON$stringify(this.state.datetimeRange), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null));
|
|
84
84
|
};
|
|
85
85
|
return Demo;
|
|
@@ -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: false,
|
|
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=false: ", _JSON$stringify(this.state.dayWithKeywords));
|
|
79
108
|
};
|
|
80
109
|
return Demo;
|
|
81
110
|
}(React.Component);
|
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|