@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.
- package/components/button/index.md +1 -0
- package/components/datepicker/basepicker.ts +60 -13
- package/components/datepicker/calendar.ts +5 -1
- package/components/datepicker/calendar.vdt +20 -6
- package/components/datepicker/dayjs.ts +22 -2
- package/components/datepicker/demos/multiple.md +0 -5
- package/components/datepicker/demos/nowrap.md +35 -0
- package/components/datepicker/demos/yearMonth.md +8 -2
- package/components/datepicker/helpers.ts +5 -5
- package/components/datepicker/index.md +3 -2
- package/components/datepicker/index.spec.ts +107 -90
- package/components/datepicker/index.ts +23 -5
- package/components/datepicker/index.vdt +34 -35
- package/components/datepicker/styles.ts +102 -3
- package/components/datepicker/useDisabled.ts +3 -3
- package/components/datepicker/useFormats.ts +2 -0
- package/components/datepicker/useMergeRange.ts +54 -0
- package/components/datepicker/usePosition.ts +169 -0
- package/components/datepicker/useQuarters.ts +47 -0
- package/components/datepicker/useShowDate.ts +42 -11
- package/components/datepicker/useValue.ts +35 -4
- package/components/datepicker/useWeeks.ts +58 -0
- package/components/dialog/useFixBody.ts +7 -64
- package/components/ellipsis/styles.ts +4 -0
- package/components/form/styles.ts +1 -0
- package/components/scrollSelect/index.spec.ts +3 -3
- package/components/scrollSelect/useMouseEvents.ts +23 -10
- package/components/select/base.vdt +2 -1
- package/components/select/demos/creatable.md +13 -0
- package/components/select/index.md +1 -0
- package/components/select/index.spec.ts +146 -0
- package/components/select/option.ts +9 -1
- package/components/select/select.ts +2 -0
- package/components/select/useFilterable.ts +1 -1
- package/components/select/useInput.ts +4 -2
- package/components/select/useSearchable.ts +2 -2
- package/components/timepicker/demos/step.md +1 -1
- package/components/timepicker/panelPicker.vdt +5 -1
- package/components/timepicker/styles.ts +0 -1
- 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/es/components/datepicker/basepicker.d.ts +4 -2
- package/es/components/datepicker/basepicker.js +46 -13
- package/es/components/datepicker/calendar.d.ts +34 -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 +13 -2
- package/es/components/datepicker/dayjs.js +6 -0
- package/es/components/datepicker/helpers.d.ts +5 -5
- package/es/components/datepicker/index.d.ts +17 -2
- package/es/components/datepicker/index.js +23 -5
- package/es/components/datepicker/index.spec.js +356 -355
- package/es/components/datepicker/index.vdt.js +25 -29
- package/es/components/datepicker/styles.d.ts +17 -0
- package/es/components/datepicker/styles.js +29 -2
- package/es/components/datepicker/useDisabled.d.ts +2 -2
- package/es/components/datepicker/useDisabled.js +1 -1
- package/es/components/datepicker/useFormats.js +3 -1
- package/es/components/datepicker/useMergeRange.d.ts +5 -0
- package/es/components/datepicker/useMergeRange.js +50 -0
- package/es/components/datepicker/usePosition.d.ts +10 -0
- package/es/components/datepicker/usePosition.js +166 -0
- package/es/components/datepicker/useQuarters.d.ts +15 -0
- package/es/components/datepicker/useQuarters.js +36 -0
- package/es/components/datepicker/useShowDate.d.ts +1 -1
- package/es/components/datepicker/useShowDate.js +42 -9
- package/es/components/datepicker/useStatus.d.ts +1 -1
- package/es/components/datepicker/useValue.d.ts +1 -0
- package/es/components/datepicker/useValue.js +26 -2
- package/es/components/datepicker/useWeeks.d.ts +19 -0
- package/es/components/datepicker/useWeeks.js +48 -0
- package/es/components/dialog/useFixBody.js +6 -58
- package/es/components/ellipsis/styles.js +1 -1
- package/es/components/form/styles.js +1 -1
- package/es/components/scrollSelect/index.spec.js +4 -6
- package/es/components/scrollSelect/useMouseEvents.js +21 -9
- package/es/components/select/base.vdt.js +4 -2
- package/es/components/select/index.spec.js +235 -62
- package/es/components/select/option.d.ts +1 -0
- package/es/components/select/option.js +9 -2
- package/es/components/select/select.d.ts +1 -0
- package/es/components/select/select.js +2 -1
- package/es/components/select/useFilterable.js +2 -1
- package/es/components/select/useInput.js +5 -2
- package/es/components/select/useSearchable.js +1 -0
- package/es/components/timepicker/panelPicker.d.ts +2 -1
- package/es/components/timepicker/panelPicker.vdt.js +12 -4
- package/es/components/timepicker/selectPicker.d.ts +1 -1
- package/es/components/timepicker/styles.js +1 -1
- package/es/components/timepicker/useDisabled.d.ts +1 -1
- package/es/components/timepicker/useValue.d.ts +1 -0
- 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/index.d.ts +0 -1
- package/es/site/data/components/datepicker/demos/multiple/index.js +1 -2
- package/es/site/data/components/datepicker/demos/multiple/react.d.ts +0 -1
- package/es/site/data/components/datepicker/demos/multiple/react.js +2 -13
- package/es/site/data/components/datepicker/demos/nowrap/index.d.ts +10 -0
- package/es/site/data/components/datepicker/demos/nowrap/index.js +19 -0
- package/es/site/data/components/datepicker/demos/nowrap/react.d.ts +10 -0
- package/es/site/data/components/datepicker/demos/nowrap/react.js +49 -0
- package/es/site/data/components/datepicker/demos/yearMonth/index.d.ts +2 -0
- package/es/site/data/components/datepicker/demos/yearMonth/index.js +3 -1
- package/es/site/data/components/datepicker/demos/yearMonth/react.d.ts +2 -0
- package/es/site/data/components/datepicker/demos/yearMonth/react.js +21 -1
- 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/select/demos/searchable/index.js +1 -1
- package/es/site/data/components/select/demos/searchable/react.js +1 -1
- 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/customButtons/index.d.ts +33 -0
- package/es/site/data/components/tour/demos/customButtons/index.js +55 -0
- package/es/site/data/components/tour/demos/customButtons/react.d.ts +33 -0
- package/es/site/data/components/tour/demos/customButtons/react.js +99 -0
- package/es/site/data/components/tour/demos/customText/index.d.ts +20 -0
- package/es/site/data/components/tour/demos/customText/index.js +54 -0
- package/es/site/data/components/tour/demos/customText/react.d.ts +19 -0
- package/es/site/data/components/tour/demos/customText/react.js +95 -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 +1 -1
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
maskClosable: true,
|
|
20
|
+
tourData: [{
|
|
21
|
+
target: '#maskDemo1',
|
|
22
|
+
title: '遮罩层交互',
|
|
23
|
+
content: '当maskClosable为true时,点击遮罩层可关闭引导',
|
|
24
|
+
position: 'bottom'
|
|
25
|
+
}, {
|
|
26
|
+
target: '#maskDemo2',
|
|
27
|
+
title: '禁用遮罩层关闭',
|
|
28
|
+
content: '当maskClosable为false时,点击遮罩层无反应,必须使用按钮进行操作',
|
|
29
|
+
position: 'right'
|
|
30
|
+
}]
|
|
31
|
+
};
|
|
32
|
+
return _this;
|
|
33
|
+
}
|
|
34
|
+
var _proto = Demo.prototype;
|
|
35
|
+
_proto.startTour = function startTour() {
|
|
36
|
+
this.setState({
|
|
37
|
+
showTour: true,
|
|
38
|
+
currentStep: 0
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
_proto.finishTour = function finishTour() {
|
|
42
|
+
this.setState({
|
|
43
|
+
showTour: false
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
_proto.render = function render() {
|
|
47
|
+
var _this2 = this;
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
className: "example-container"
|
|
50
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
51
|
+
id: "maskDemo1"
|
|
52
|
+
}, "\u76EE\u6807\u5143\u7D201"), /*#__PURE__*/React.createElement(Button, {
|
|
53
|
+
id: "maskDemo2",
|
|
54
|
+
style: {
|
|
55
|
+
"marginLeft": "20px"
|
|
56
|
+
}
|
|
57
|
+
}, "\u76EE\u6807\u5143\u7D202")), /*#__PURE__*/React.createElement(Tour, {
|
|
58
|
+
value: this.state.currentStep,
|
|
59
|
+
onChangeValue: function onChangeValue(currentStep) {
|
|
60
|
+
return _this2.setState({
|
|
61
|
+
currentStep: currentStep
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
visible: this.state.showTour,
|
|
65
|
+
data: this.state.tourData,
|
|
66
|
+
maskClosable: this.state.maskClosable,
|
|
67
|
+
onFinish: this.finishTour
|
|
68
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
style: {
|
|
70
|
+
"marginTop": "20px"
|
|
71
|
+
}
|
|
72
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
73
|
+
style: {
|
|
74
|
+
"marginBottom": "10px"
|
|
75
|
+
}
|
|
76
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
77
|
+
value: this.state.maskClosable,
|
|
78
|
+
onChangeValue: function onChangeValue(maskClosable) {
|
|
79
|
+
return _this2.setState({
|
|
80
|
+
maskClosable: maskClosable
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
84
|
+
style: {
|
|
85
|
+
"marginLeft": "10px"
|
|
86
|
+
}
|
|
87
|
+
}, "\u70B9\u51FB\u906E\u7F69\u5173\u95ED\u5F15\u5BFC: ", this.state.maskClosable ? '启用' : '禁用')), /*#__PURE__*/React.createElement(Button, {
|
|
88
|
+
onClick: this.startTour
|
|
89
|
+
}, "\u542F\u52A8\u5F15\u5BFC")));
|
|
90
|
+
};
|
|
91
|
+
return Demo;
|
|
92
|
+
}(React.Component);
|
|
93
|
+
export { Demo as default };
|
|
94
|
+
__decorate([bind], Demo.prototype, "startTour", null);
|
|
95
|
+
__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,61 @@
|
|
|
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 } 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
|
+
};
|
|
20
|
+
return _this;
|
|
21
|
+
}
|
|
22
|
+
var _proto = Demo.prototype;
|
|
23
|
+
_proto.settour = function settour() {
|
|
24
|
+
this.setState({
|
|
25
|
+
showTour: true,
|
|
26
|
+
currentStep: 0
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
_proto.close = function close() {
|
|
30
|
+
this.setState({
|
|
31
|
+
showTour: false
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
_proto.render = function render() {
|
|
35
|
+
var _this2 = this;
|
|
36
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tour, {
|
|
37
|
+
value: this.state.currentStep,
|
|
38
|
+
onChangeValue: function onChangeValue(currentStep) {
|
|
39
|
+
return _this2.setState({
|
|
40
|
+
currentStep: currentStep
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
visible: this.state.showTour,
|
|
44
|
+
onFinish: this.close
|
|
45
|
+
}, /*#__PURE__*/React.createElement(TourStep, {
|
|
46
|
+
title: "\u65E0\u76EE\u6807\u5143\u7D20-\u7B2C\u4E00\u6B65"
|
|
47
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u5F53\u6CA1\u6709\u6307\u5B9Atarget\u5C5E\u6027\u6216\u8005\u76EE\u6807\u5143\u7D20\u4E0D\u5B58\u5728\u65F6\uFF0CTour\u4F1A\u5C45\u4E2D\u663E\u793A\u5728\u5C4F\u5E55\u4E2D\u592E\u3002")), /*#__PURE__*/React.createElement(TourStep, {
|
|
48
|
+
title: "\u65E0\u76EE\u6807\u5143\u7D20-\u7B2C\u4E8C\u6B65"
|
|
49
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u5F53\u6CA1\u6709\u6307\u5B9Atarget\u5C5E\u6027\u6216\u8005\u76EE\u6807\u5143\u7D20\u4E0D\u5B58\u5728\u65F6\uFF0C\u6240\u6709\u6B65\u9AA4\u90FD\u4F1A\u5C45\u4E2D\u663E\u793A\u5728\u5C4F\u5E55\u4E2D\u592E\u3002"))), /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
style: {
|
|
51
|
+
"marginTop": "20px"
|
|
52
|
+
}
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
54
|
+
onClick: this.settour
|
|
55
|
+
}, "\u542F\u52A8\u65E0\u76EE\u6807\u5F15\u5BFC")));
|
|
56
|
+
};
|
|
57
|
+
return Demo;
|
|
58
|
+
}(React.Component);
|
|
59
|
+
export { Demo as default };
|
|
60
|
+
__decorate([bind], Demo.prototype, "settour", null);
|
|
61
|
+
__decorate([bind], Demo.prototype, "close", null);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Component } from 'intact';
|
|
2
|
+
import Article from '~/../src/components/article';
|
|
3
|
+
export default class extends Article {
|
|
4
|
+
static sidebar: {
|
|
5
|
+
组件: {
|
|
6
|
+
title: string;
|
|
7
|
+
category: string;
|
|
8
|
+
order: number;
|
|
9
|
+
sidebar: string;
|
|
10
|
+
path: string;
|
|
11
|
+
}[];
|
|
12
|
+
undefined: ({
|
|
13
|
+
title: string;
|
|
14
|
+
order: number;
|
|
15
|
+
sidebar: string;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
path: string;
|
|
18
|
+
} | {
|
|
19
|
+
title: string;
|
|
20
|
+
order: number;
|
|
21
|
+
sidebar: string;
|
|
22
|
+
path: string;
|
|
23
|
+
disabled?: undefined;
|
|
24
|
+
})[];
|
|
25
|
+
};
|
|
26
|
+
static data: {
|
|
27
|
+
setting: {
|
|
28
|
+
title: string;
|
|
29
|
+
category: string;
|
|
30
|
+
order: number;
|
|
31
|
+
sidebar: string;
|
|
32
|
+
};
|
|
33
|
+
contents: string;
|
|
34
|
+
index: string;
|
|
35
|
+
catalogs: {
|
|
36
|
+
text: string;
|
|
37
|
+
level: number;
|
|
38
|
+
id: string;
|
|
39
|
+
}[];
|
|
40
|
+
};
|
|
41
|
+
static defaults: () => {
|
|
42
|
+
demos: Component<any, {}, {}, {}>[];
|
|
43
|
+
setting: {
|
|
44
|
+
title: string;
|
|
45
|
+
category: string;
|
|
46
|
+
order: number;
|
|
47
|
+
sidebar: string;
|
|
48
|
+
};
|
|
49
|
+
contents: string;
|
|
50
|
+
index: string;
|
|
51
|
+
catalogs: {
|
|
52
|
+
text: string;
|
|
53
|
+
level: number;
|
|
54
|
+
id: string;
|
|
55
|
+
}[];
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
3
|
+
import _keysInstanceProperty from "@babel/runtime-corejs3/core-js/instance/keys";
|
|
4
|
+
import _startsWithInstanceProperty from "@babel/runtime-corejs3/core-js/instance/starts-with";
|
|
5
|
+
import Article from '~/../src/components/article';
|
|
6
|
+
import data from './index.json';
|
|
7
|
+
import sidebar from '~/doc.json';
|
|
8
|
+
var r = require.context('./', true, /demos.*(index|demo).ts/);
|
|
9
|
+
var keys = _keysInstanceProperty(r).call(r);
|
|
10
|
+
var demos = [];
|
|
11
|
+
for (var i = 0; i < keys.length; i++) {
|
|
12
|
+
var file = keys[i];
|
|
13
|
+
if (!_startsWithInstanceProperty(file).call(file, '.')) continue;
|
|
14
|
+
// if we found demo.js then ignore index.js
|
|
15
|
+
if (/demo.ts$/.test(file)) i++;
|
|
16
|
+
demos.push(r(file));
|
|
17
|
+
}
|
|
18
|
+
var default_1 = /*#__PURE__*/function (_Article) {
|
|
19
|
+
_inheritsLoose(default_1, _Article);
|
|
20
|
+
function default_1() {
|
|
21
|
+
return _Article.apply(this, arguments) || this;
|
|
22
|
+
}
|
|
23
|
+
return default_1;
|
|
24
|
+
}(Article);
|
|
25
|
+
default_1.sidebar = sidebar;
|
|
26
|
+
default_1.data = data;
|
|
27
|
+
default_1.defaults = function () {
|
|
28
|
+
return _extends({}, Article.defaults, data, {
|
|
29
|
+
demos: demos
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export { default_1 as default };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {useInstance, onBeforeUnmount} from 'intact';
|
|
2
|
+
import {scrollbarWidth} from '../components/position';
|
|
3
|
+
|
|
4
|
+
type Hooks = {
|
|
5
|
+
onStart?: (scrollBarWidth: number | undefined) => void
|
|
6
|
+
onEnd?: () => void
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const instances = new Set<any>();
|
|
10
|
+
let originalStyle: string | null = null;
|
|
11
|
+
let hooks: Hooks | null = null;
|
|
12
|
+
|
|
13
|
+
export function useFixBody() {
|
|
14
|
+
const instance = useInstance()!;
|
|
15
|
+
let fixedBody = false;
|
|
16
|
+
|
|
17
|
+
onBeforeUnmount(() => {
|
|
18
|
+
if (fixedBody) {
|
|
19
|
+
onClosed(instance);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
function onOpen() {
|
|
24
|
+
if (!fixedBody) {
|
|
25
|
+
fixedBody = true;
|
|
26
|
+
onOpened(instance);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function onClose() {
|
|
31
|
+
if (fixedBody) {
|
|
32
|
+
fixedBody = false;
|
|
33
|
+
onClosed(instance);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
onOpen,
|
|
39
|
+
onClose,
|
|
40
|
+
get isFixed() {
|
|
41
|
+
return fixedBody;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function setHooks(h: Hooks | null) {
|
|
47
|
+
hooks = h;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function onOpened(instance: any) {
|
|
51
|
+
const body = document.body;
|
|
52
|
+
if (instances.size === 0) {
|
|
53
|
+
const bodyStyle = body.style;
|
|
54
|
+
originalStyle = body.getAttribute('style');
|
|
55
|
+
bodyStyle.overflow = 'hidden';
|
|
56
|
+
|
|
57
|
+
const scrollBarWidth = shouldFixBody();
|
|
58
|
+
if (scrollBarWidth) {
|
|
59
|
+
bodyStyle.paddingRight = `${scrollBarWidth}px`;
|
|
60
|
+
}
|
|
61
|
+
if (hooks && hooks.onStart) {
|
|
62
|
+
hooks.onStart(scrollBarWidth);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
instances.add(instance);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function onClosed(instance: any) {
|
|
69
|
+
const body = document.body;
|
|
70
|
+
instances.delete(instance);
|
|
71
|
+
if (instances.size === 0) {
|
|
72
|
+
if (originalStyle) {
|
|
73
|
+
body.setAttribute('style', originalStyle);
|
|
74
|
+
} else {
|
|
75
|
+
body.removeAttribute('style');
|
|
76
|
+
}
|
|
77
|
+
if (hooks && hooks.onEnd) {
|
|
78
|
+
hooks.onEnd();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function shouldFixBody() {
|
|
84
|
+
if (document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight)) {
|
|
85
|
+
return scrollbarWidth();
|
|
86
|
+
}
|
|
87
|
+
}
|
package/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.
|
|
2
|
+
* @king-design v3.6.0-beta.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -62,6 +62,7 @@ export * from './components/timeline';
|
|
|
62
62
|
export * from './components/timepicker';
|
|
63
63
|
export * from './components/tip';
|
|
64
64
|
export * from './components/tooltip';
|
|
65
|
+
export * from './components/tour';
|
|
65
66
|
export * from './components/transfer';
|
|
66
67
|
export * from './components/tree';
|
|
67
68
|
export * from './components/treeSelect';
|
|
@@ -70,6 +71,6 @@ export * from './components/view';
|
|
|
70
71
|
export * from './components/virtualList';
|
|
71
72
|
export * from './components/wave';
|
|
72
73
|
|
|
73
|
-
export const version = '3.
|
|
74
|
+
export const version = '3.6.0-beta.0';
|
|
74
75
|
|
|
75
76
|
/* generate end */
|