@titaui/pc 1.11.4-0 → 1.11.4-0.beta-2
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/lib/components/avatar/text-avatar/index.css +9 -2
- package/lib/components/avatar/text-avatar/index.js +34 -9
- package/lib/components/button/rect-btn/index.js +7 -7
- package/lib/components/change-okr-modal/Item.js +15 -15
- package/lib/components/communication/index.js +30 -29
- package/lib/components/drawer/index.js +7 -6
- package/lib/components/dynamic/constant.js +43 -36
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/dynamic-footer.js +243 -0
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +6 -2
- package/lib/components/dynamic/dynamic-item/dynamic-interview/img/wifi.svg +24 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +51 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.js +50 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/interview-content.js +65 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/img/wifi.svg +24 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.css +61 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.js +61 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/interview-content.js +69 -0
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +6 -6
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +11 -11
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +14 -14
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +10 -10
- package/lib/components/dynamic/dynamic-item/index.js +70 -41
- package/lib/components/dynamic/dynamic-list/index.js +5 -13
- package/lib/components/e-priority/index.js +18 -12
- package/lib/components/eReport/eReportShare/index.js +12 -12
- package/lib/components/file-list/components/single-file/index.js +11 -11
- package/lib/components/form/form-fields/date/index.css +24 -0
- package/lib/components/form/form-fields/date/index.js +102 -0
- package/lib/components/form/form-fields/input/index.js +10 -10
- package/lib/components/form/form-fields/user/index.css +23 -3
- package/lib/components/form/form-fields/user/index.js +18 -8
- package/lib/components/form/form-fields/user/user-input.js +15 -6
- package/lib/components/form/index.js +10 -3
- package/lib/components/grid-layout/sub-employee-okr/person-okr.js +11 -5
- package/lib/components/icon-button-list/index.css +2 -57
- package/lib/components/icon-button-list/index.js +10 -7
- package/lib/components/img-viewer/index.css +10 -3
- package/lib/components/img-viewer/index.js +57 -18
- package/lib/components/mblog/components/MblogContent.js +5 -2
- package/lib/components/mblog/index.js +31 -30
- package/lib/components/menus/components/menu-tree/images/interview-menu/my-interview.svg +16 -0
- package/lib/components/menus/components/menu-tree/images/interview-menu/template.svg +16 -0
- package/lib/components/menus/components/menu-tree/images/interview-menu/todo.svg +16 -0
- package/lib/components/menus/components/menu-tree/index.css +4 -2
- package/lib/components/menus/components/menu-tree/tree-node/index.css +85 -1
- package/lib/components/menus/export-modules/interview-menus/constant.js +23 -17
- package/lib/components/menus/export-modules/interview-menus/handle-highlight.js +5 -5
- package/lib/components/menus/export-modules/interview-menus/index.css +7 -0
- package/lib/components/menus/export-modules/interview-menus/index.js +5 -4
- package/lib/components/nav-top/components/menu/img/new.svg +30 -0
- package/lib/components/nav-top/components/menu/img/wecome-temp.png +0 -0
- package/lib/components/nav-top/components/menu/index.css +91 -0
- package/lib/components/nav-top/components/menu/index.js +80 -32
- package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +25 -19
- package/lib/components/nav-top/components/user-message/components/remind/remind-item.js +48 -10
- package/lib/components/nav-top/components/user-message/constant.js +1 -0
- package/lib/components/nav-top/components/user-message/hrMessage.js +22 -19
- package/lib/components/nav-top/components/user-message/index.js +23 -20
- package/lib/components/nav-top/request.apis.js +3 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +7 -7
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +3 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/range-picker-pop.js +10 -0
- package/lib/components/okr-detail/detail-header/actions.js +62 -66
- package/lib/components/okr-detail/detail-header/index.css +2 -2
- package/lib/components/okr-detail/detail-header/index.js +205 -194
- package/lib/components/okr-detail/index.js +21 -19
- package/lib/components/okr-detail/okr-list/index.js +5 -3
- package/lib/components/okr-flow/child-node/index.css +68 -22
- package/lib/components/okr-flow/child-node/work-node.js +61 -24
- package/lib/components/okr-flow/empty/index.css +8 -1
- package/lib/components/okr-flow/export-modal/index.js +108 -21
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.css +3 -1
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +30 -24
- package/lib/components/okr-flow/images/loading-light.gif +0 -0
- package/lib/components/okr-flow/okr-map/index.js +43 -22
- package/lib/components/okr-flow/request-apis.js +15 -8
- package/lib/components/okr-flow/root-node/index.css +2 -2
- package/lib/components/okr-flow/root-node/index.js +26 -25
- package/lib/components/okr-flow/utils/index.js +45 -29
- package/lib/components/okr-flow/utils/tree-handler.js +29 -18
- package/lib/components/okrcase-library/index.css +6 -4
- package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +36 -30
- package/lib/components/pagination/index.css +3 -3
- package/lib/components/pagination/select.css +58 -23
- package/lib/components/period-selector/index.css +9 -3
- package/lib/components/period-selector/index.js +14 -11
- package/lib/components/picker/components/panels/date-panel/date-body.js +21 -19
- package/lib/components/picker/components/panels/date-panel/date-head.js +29 -8
- package/lib/components/picker/components/panels/month-panel/month-body.js +6 -4
- package/lib/components/picker/components/picker-trigger/index.css +31 -0
- package/lib/components/picker/components/picker-trigger/index.js +24 -15
- package/lib/components/picker/picker-panels.js +1 -1
- package/lib/components/picker/picker.js +12 -13
- package/lib/components/popup/index.js +4 -4
- package/lib/components/radio/index.css +9 -9
- package/lib/components/scroll-container/index.js +423 -0
- package/lib/components/scroll-container/style.css +35 -0
- package/lib/components/scrollbar/scroll-mask/index.js +1 -1
- package/lib/components/superset-charts/components/chart/index.js +1 -1
- package/lib/components/superset-charts/utils/axios.js +5 -13
- package/lib/components/survey-model/contact.js +93 -0
- package/lib/components/survey-model/index.css +141 -0
- package/lib/components/survey-model/index.js +268 -0
- package/lib/components/survey-model/instance.js +86 -0
- package/lib/components/survey-model/request-api.js +80 -0
- package/lib/components/task-relation-modal/index.js +0 -1
- package/lib/components/task-tree/helper.js +61 -0
- package/lib/components/task-tree/images/P1.svg +15 -0
- package/lib/components/task-tree/images/P2.svg +15 -0
- package/lib/components/task-tree/images/P3.svg +15 -0
- package/lib/components/task-tree/images/P4.svg +15 -0
- package/lib/components/task-tree/images/P5.svg +15 -0
- package/lib/components/task-tree/images/arrow.svg +9 -0
- package/lib/components/task-tree/images/empty-131.png +0 -0
- package/lib/components/task-tree/images/followed.svg +33 -0
- package/lib/components/task-tree/images/nice.svg +108 -0
- package/lib/components/task-tree/images/struc12.png +0 -0
- package/lib/components/task-tree/images/struc2.png +0 -0
- package/lib/components/task-tree/images/xialat-s.svg +13 -0
- package/lib/components/task-tree/index.js +16 -0
- package/lib/components/task-tree/precls.js +8 -0
- package/lib/components/task-tree/request-apis.js +88 -0
- package/lib/components/task-tree/task-item-node/constant.js +45 -0
- package/lib/components/task-tree/task-item-node/e-empty.js +29 -0
- package/lib/components/task-tree/task-item-node/e-project.js +212 -0
- package/lib/components/task-tree/task-item-node/e-status-dropdown.js +114 -0
- package/lib/components/task-tree/task-item-node/e-task.js +426 -0
- package/lib/components/task-tree/task-item-node/get-process-color.js +62 -0
- package/lib/components/task-tree/task-item-node/index.css +299 -0
- package/lib/components/task-tree/task-item-node/task-node-render.js +43 -0
- package/lib/components/task-tree/task-tree.css +16 -0
- package/lib/components/task-tree/task-tree.js +49 -0
- package/lib/components/time-picker/index.css +24 -0
- package/lib/components/time-picker/time-picker-selector.js +8 -12
- package/lib/components/time-picker/time-picker.js +94 -133
- package/lib/components/time-picker/timer-picker-input.js +3 -7
- package/lib/components/time-picker/utils.js +13 -2
- package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.css +1 -0
- package/lib/components/wechat-btn/index.css +14 -0
- package/lib/components/wechat-btn/index.js +338 -0
- package/lib/components-v1/radio/radio.js +3 -3
- package/lib/components-v1/radio/style/index.css +8 -8
- package/lib/index.js +99 -91
- package/lib/pages/okr-map/export-modules/okr-map/header/index.css +7 -2
- package/lib/pages/okr-map/export-modules/okr-map/header/index.js +73 -34
- package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +65 -42
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.css +26 -14
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +58 -13
- package/lib/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +28 -20
- package/lib/pages/okr-map/number-select/index.css +12 -9
- package/lib/pages/okr-map/number-select/index.js +3 -3
- package/lib/utils/auth.js +65 -8
- package/lib/utils/bs-global.js +18 -6
- package/lib/utils/open-data.js +63 -43
- package/package.json +6 -2
- package/.eslintignore +0 -3
- package/.eslintrc.js +0 -223
- package/.husky/pre-commit +0 -4
- package/.prettierignore +0 -31
- package/.prettierrc.js +0 -90
- package/.vscode/settings.json +0 -5
- package/yarn-error.log +0 -22184
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _lodash = _interopRequireDefault(require("lodash.debounce"));
|
|
15
|
+
|
|
16
|
+
var _easyBem = _interopRequireDefault(require("easy-bem"));
|
|
17
|
+
|
|
18
|
+
require("./style.css");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
|
+
|
|
28
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
29
|
+
|
|
30
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
31
|
+
|
|
32
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
+
|
|
34
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
+
|
|
36
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
37
|
+
|
|
38
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
39
|
+
|
|
40
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
+
|
|
42
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
43
|
+
|
|
44
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
+
|
|
46
|
+
var cn = (0, _easyBem["default"])('indiana-scroll-container');
|
|
47
|
+
var SCROLL_END_DEBOUNCE = 300;
|
|
48
|
+
var LEFT_BUTTON = 0;
|
|
49
|
+
|
|
50
|
+
var ScrollContainer = /*#__PURE__*/function (_PureComponent) {
|
|
51
|
+
_inherits(ScrollContainer, _PureComponent);
|
|
52
|
+
|
|
53
|
+
var _super = _createSuper(ScrollContainer);
|
|
54
|
+
|
|
55
|
+
function ScrollContainer(props) {
|
|
56
|
+
var _this;
|
|
57
|
+
|
|
58
|
+
_classCallCheck(this, ScrollContainer);
|
|
59
|
+
|
|
60
|
+
_this = _super.call(this, props);
|
|
61
|
+
|
|
62
|
+
_this.onEndScroll = function () {
|
|
63
|
+
_this.scrolling = false;
|
|
64
|
+
|
|
65
|
+
if (!_this.pressed && _this.started) {
|
|
66
|
+
_this.processEnd();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
_this.onScroll = function (e) {
|
|
71
|
+
var container = _this.container.current; // Ignore the internal scrolls
|
|
72
|
+
|
|
73
|
+
if (container.scrollLeft !== _this.scrollLeft || container.scrollTop !== _this.scrollTop) {
|
|
74
|
+
_this.scrolling = true;
|
|
75
|
+
|
|
76
|
+
_this.processScroll(e);
|
|
77
|
+
|
|
78
|
+
_this.onEndScroll();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
_this.onTouchStart = function (e) {
|
|
83
|
+
var nativeMobileScroll = _this.props.nativeMobileScroll;
|
|
84
|
+
|
|
85
|
+
if (_this.isDraggable(e.target)) {
|
|
86
|
+
_this.internal = true;
|
|
87
|
+
|
|
88
|
+
if (nativeMobileScroll && _this.scrolling) {
|
|
89
|
+
_this.pressed = true;
|
|
90
|
+
} else {
|
|
91
|
+
var touch = e.touches[0];
|
|
92
|
+
|
|
93
|
+
_this.processClick(e, touch.clientX, touch.clientY);
|
|
94
|
+
|
|
95
|
+
if (!nativeMobileScroll && _this.props.stopPropagation) {
|
|
96
|
+
e.stopPropagation();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
_this.onTouchEnd = function (e) {
|
|
103
|
+
var nativeMobileScroll = _this.props.nativeMobileScroll;
|
|
104
|
+
|
|
105
|
+
if (_this.pressed) {
|
|
106
|
+
if (_this.started && (!_this.scrolling || !nativeMobileScroll)) {
|
|
107
|
+
_this.processEnd();
|
|
108
|
+
} else {
|
|
109
|
+
_this.pressed = false;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
_this.forceUpdate();
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
_this.onTouchMove = function (e) {
|
|
117
|
+
var nativeMobileScroll = _this.props.nativeMobileScroll;
|
|
118
|
+
|
|
119
|
+
if (_this.pressed && (!nativeMobileScroll || !_this.isMobile)) {
|
|
120
|
+
var touch = e.touches[0];
|
|
121
|
+
|
|
122
|
+
if (touch) {
|
|
123
|
+
_this.processMove(e, touch.clientX, touch.clientY);
|
|
124
|
+
} // e.preventDefault(); // 处理无法拖动选中文字的问题,先屏蔽禁止默认事件
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
if (_this.props.stopPropagation) {
|
|
128
|
+
e.stopPropagation();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
_this.onMouseDown = function (e) {
|
|
134
|
+
if (_this.isDraggable(e.target) && _this.isScrollable()) {
|
|
135
|
+
_this.internal = true;
|
|
136
|
+
|
|
137
|
+
if (_this.props.buttons.indexOf(e.button) !== -1) {
|
|
138
|
+
_this.processClick(e, e.clientX, e.clientY); // e.preventDefault();
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
if (_this.props.stopPropagation) {
|
|
142
|
+
e.stopPropagation();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
_this.onMouseMove = function (e) {
|
|
149
|
+
if (_this.pressed) {
|
|
150
|
+
_this.processMove(e, e.clientX, e.clientY); // e.preventDefault();
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
if (_this.props.stopPropagation) {
|
|
154
|
+
e.stopPropagation();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
_this.onMouseUp = function (e) {
|
|
160
|
+
if (_this.pressed) {
|
|
161
|
+
if (_this.started) {
|
|
162
|
+
_this.processEnd();
|
|
163
|
+
} else {
|
|
164
|
+
_this.internal = false;
|
|
165
|
+
_this.pressed = false;
|
|
166
|
+
|
|
167
|
+
_this.forceUpdate();
|
|
168
|
+
|
|
169
|
+
if (_this.props.onClick) {
|
|
170
|
+
_this.props.onClick(e);
|
|
171
|
+
}
|
|
172
|
+
} // e.preventDefault();
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
if (_this.props.stopPropagation) {
|
|
176
|
+
e.stopPropagation();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
_this.container = /*#__PURE__*/_react["default"].createRef();
|
|
182
|
+
_this.onEndScroll = (0, _lodash["default"])(_this.onEndScroll, SCROLL_END_DEBOUNCE); // Is container scrolling now (for example by inertia)
|
|
183
|
+
|
|
184
|
+
_this.scrolling = false; // Is scrolling started
|
|
185
|
+
|
|
186
|
+
_this.started = false; // Is touch active or mouse pressed down
|
|
187
|
+
|
|
188
|
+
_this.pressed = false; // Is event internal
|
|
189
|
+
|
|
190
|
+
_this.internal = false; // Bind callbacks
|
|
191
|
+
|
|
192
|
+
_this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
|
|
193
|
+
return _this;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
_createClass(ScrollContainer, [{
|
|
197
|
+
key: "componentDidMount",
|
|
198
|
+
value: function componentDidMount() {
|
|
199
|
+
var nativeMobileScroll = this.props.nativeMobileScroll;
|
|
200
|
+
var container = this.container.current;
|
|
201
|
+
window.addEventListener('mouseup', this.onMouseUp, {
|
|
202
|
+
capture: true
|
|
203
|
+
});
|
|
204
|
+
window.addEventListener('mousemove', this.onMouseMove, {
|
|
205
|
+
capture: true
|
|
206
|
+
});
|
|
207
|
+
window.addEventListener('touchmove', this.onTouchMove, {
|
|
208
|
+
passive: false,
|
|
209
|
+
capture: true
|
|
210
|
+
});
|
|
211
|
+
window.addEventListener('touchend', this.onTouchEnd, {
|
|
212
|
+
capture: true
|
|
213
|
+
}); // due to https://github.com/facebook/react/issues/9809#issuecomment-414072263
|
|
214
|
+
|
|
215
|
+
container.addEventListener('touchstart', this.onTouchStart, {
|
|
216
|
+
passive: false
|
|
217
|
+
});
|
|
218
|
+
container.addEventListener('mousedown', this.onMouseDown, {
|
|
219
|
+
passive: false
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
if (nativeMobileScroll) {
|
|
223
|
+
// We should check if it's the mobile device after page was loaded
|
|
224
|
+
// to prevent breaking SSR
|
|
225
|
+
this.isMobile = this.isMobileDevice(); // If it's the mobile device, we should rerender to change styles
|
|
226
|
+
|
|
227
|
+
if (this.isMobile) {
|
|
228
|
+
this.forceUpdate();
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}, {
|
|
233
|
+
key: "componentWillUnmount",
|
|
234
|
+
value: function componentWillUnmount() {
|
|
235
|
+
window.removeEventListener('mouseup', this.onMouseUp);
|
|
236
|
+
window.removeEventListener('mousemove', this.onMouseMove);
|
|
237
|
+
window.removeEventListener('touchmove', this.onTouchMove);
|
|
238
|
+
window.removeEventListener('touchend', this.onTouchEnd);
|
|
239
|
+
}
|
|
240
|
+
}, {
|
|
241
|
+
key: "getElement",
|
|
242
|
+
value: function getElement() {
|
|
243
|
+
return this.container.current;
|
|
244
|
+
}
|
|
245
|
+
}, {
|
|
246
|
+
key: "isMobileDevice",
|
|
247
|
+
value: function isMobileDevice() {
|
|
248
|
+
return typeof window.orientation !== 'undefined' || navigator.userAgent.indexOf('IEMobile') !== -1;
|
|
249
|
+
}
|
|
250
|
+
}, {
|
|
251
|
+
key: "isDraggable",
|
|
252
|
+
value: function isDraggable(target) {
|
|
253
|
+
var ignoreElements = this.props.ignoreElements;
|
|
254
|
+
|
|
255
|
+
if (ignoreElements) {
|
|
256
|
+
var closest = target.closest(ignoreElements);
|
|
257
|
+
return closest === null || closest.contains(this.getElement());
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
}, {
|
|
263
|
+
key: "isScrollable",
|
|
264
|
+
value: function isScrollable() {
|
|
265
|
+
var container = this.container.current;
|
|
266
|
+
return container && (container.scrollWidth > container.clientWidth || container.scrollHeight > container.clientHeight);
|
|
267
|
+
} // Simulate 'onEndScroll' event that fires when scrolling is stopped
|
|
268
|
+
|
|
269
|
+
}, {
|
|
270
|
+
key: "processClick",
|
|
271
|
+
value: function processClick(e, clientX, clientY) {
|
|
272
|
+
var container = this.container.current;
|
|
273
|
+
this.scrollLeft = container.scrollLeft;
|
|
274
|
+
this.scrollTop = container.scrollTop;
|
|
275
|
+
this.clientX = clientX;
|
|
276
|
+
this.clientY = clientY;
|
|
277
|
+
this.pressed = true;
|
|
278
|
+
}
|
|
279
|
+
}, {
|
|
280
|
+
key: "processStart",
|
|
281
|
+
value: function processStart() {
|
|
282
|
+
var changeCursor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
283
|
+
var onStartScroll = this.props.onStartScroll;
|
|
284
|
+
this.started = true; // Add the class to change displayed cursor
|
|
285
|
+
|
|
286
|
+
if (changeCursor) {
|
|
287
|
+
document.body.classList.add('indiana-dragging');
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if (onStartScroll) {
|
|
291
|
+
onStartScroll({
|
|
292
|
+
external: !this.internal
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
this.forceUpdate();
|
|
297
|
+
} // Process native scroll (scrollbar, mobile scroll)
|
|
298
|
+
|
|
299
|
+
}, {
|
|
300
|
+
key: "processScroll",
|
|
301
|
+
value: function processScroll(e) {
|
|
302
|
+
if (this.started) {
|
|
303
|
+
var onScroll = this.props.onScroll;
|
|
304
|
+
|
|
305
|
+
if (onScroll) {
|
|
306
|
+
onScroll({
|
|
307
|
+
external: !this.internal
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
} else {
|
|
311
|
+
this.processStart(false);
|
|
312
|
+
}
|
|
313
|
+
} // Process non-native scroll
|
|
314
|
+
|
|
315
|
+
}, {
|
|
316
|
+
key: "processMove",
|
|
317
|
+
value: function processMove(e, newClientX, newClientY) {
|
|
318
|
+
var _this$props = this.props,
|
|
319
|
+
horizontal = _this$props.horizontal,
|
|
320
|
+
vertical = _this$props.vertical,
|
|
321
|
+
activationDistance = _this$props.activationDistance,
|
|
322
|
+
onScroll = _this$props.onScroll;
|
|
323
|
+
var container = this.container.current;
|
|
324
|
+
|
|
325
|
+
if (!this.started) {
|
|
326
|
+
if (horizontal && Math.abs(newClientX - this.clientX) > activationDistance || vertical && Math.abs(newClientY - this.clientY) > activationDistance) {
|
|
327
|
+
this.clientX = newClientX;
|
|
328
|
+
this.clientY = newClientY;
|
|
329
|
+
this.processStart();
|
|
330
|
+
}
|
|
331
|
+
} else {
|
|
332
|
+
if (horizontal) {
|
|
333
|
+
container.scrollLeft -= newClientX - this.clientX;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
if (vertical) {
|
|
337
|
+
container.scrollTop -= newClientY - this.clientY;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if (onScroll) {
|
|
341
|
+
onScroll({
|
|
342
|
+
external: !this.internal
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
this.clientX = newClientX;
|
|
347
|
+
this.clientY = newClientY;
|
|
348
|
+
this.scrollLeft = container.scrollLeft;
|
|
349
|
+
this.scrollTop = container.scrollTop;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}, {
|
|
353
|
+
key: "processEnd",
|
|
354
|
+
value: function processEnd() {
|
|
355
|
+
var onEndScroll = this.props.onEndScroll;
|
|
356
|
+
var container = this.container.current;
|
|
357
|
+
|
|
358
|
+
if (container && onEndScroll) {
|
|
359
|
+
onEndScroll({
|
|
360
|
+
external: !this.internal
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
this.pressed = false;
|
|
365
|
+
this.started = false;
|
|
366
|
+
this.scrolling = false;
|
|
367
|
+
this.internal = false;
|
|
368
|
+
document.body.classList.remove('indiana-dragging');
|
|
369
|
+
this.forceUpdate();
|
|
370
|
+
}
|
|
371
|
+
}, {
|
|
372
|
+
key: "getRef",
|
|
373
|
+
value: function getRef(el) {
|
|
374
|
+
;
|
|
375
|
+
[this.container, this.props.innerRef].forEach(function (ref) {
|
|
376
|
+
if (ref) {
|
|
377
|
+
if (typeof ref === 'function') {
|
|
378
|
+
ref(el);
|
|
379
|
+
} else {
|
|
380
|
+
;
|
|
381
|
+
ref.current = el;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
}, {
|
|
387
|
+
key: "render",
|
|
388
|
+
value: function render() {
|
|
389
|
+
var _this$props2 = this.props,
|
|
390
|
+
children = _this$props2.children,
|
|
391
|
+
draggingClassName = _this$props2.draggingClassName,
|
|
392
|
+
className = _this$props2.className,
|
|
393
|
+
style = _this$props2.style,
|
|
394
|
+
hideScrollbars = _this$props2.hideScrollbars,
|
|
395
|
+
Component = _this$props2.component;
|
|
396
|
+
return /*#__PURE__*/_react["default"].createElement(Component, {
|
|
397
|
+
className: (0, _classnames["default"])(className, this.pressed && draggingClassName, cn({
|
|
398
|
+
dragging: this.pressed,
|
|
399
|
+
'hide-scrollbars': hideScrollbars,
|
|
400
|
+
'native-scroll': this.isMobile
|
|
401
|
+
})),
|
|
402
|
+
style: style,
|
|
403
|
+
ref: this.getRef,
|
|
404
|
+
onScroll: this.onScroll
|
|
405
|
+
}, children);
|
|
406
|
+
}
|
|
407
|
+
}]);
|
|
408
|
+
|
|
409
|
+
return ScrollContainer;
|
|
410
|
+
}(_react.PureComponent);
|
|
411
|
+
|
|
412
|
+
exports["default"] = ScrollContainer;
|
|
413
|
+
ScrollContainer.defaultProps = {
|
|
414
|
+
nativeMobileScroll: true,
|
|
415
|
+
hideScrollbars: true,
|
|
416
|
+
activationDistance: 10,
|
|
417
|
+
vertical: true,
|
|
418
|
+
horizontal: true,
|
|
419
|
+
stopPropagation: false,
|
|
420
|
+
style: {},
|
|
421
|
+
component: 'div',
|
|
422
|
+
buttons: [LEFT_BUTTON]
|
|
423
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.indiana-scroll-container {
|
|
2
|
+
overflow: auto;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.indiana-scroll-container--dragging {
|
|
6
|
+
scroll-behavior: auto !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.indiana-scroll-container--dragging > * {
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
cursor: grab;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.indiana-scroll-container--hide-scrollbars {
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
overflow: -moz-scrollbars-none;
|
|
17
|
+
-ms-overflow-style: none;
|
|
18
|
+
scrollbar-width: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.indiana-scroll-container--hide-scrollbars::-webkit-scrollbar {
|
|
22
|
+
display: none !important;
|
|
23
|
+
height: 0 !important;
|
|
24
|
+
width: 0 !important;
|
|
25
|
+
background: transparent !important;
|
|
26
|
+
-webkit-appearance: none !important;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.indiana-scroll-container--native-scroll {
|
|
30
|
+
overflow: auto;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.indiana-dragging {
|
|
34
|
+
cursor: grab;
|
|
35
|
+
}
|
|
@@ -86,7 +86,7 @@ var ScrollBarMask = function ScrollBarMask(_ref) {
|
|
|
86
86
|
} // 判断是否滚动到底部
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
if (scrollElement.scrollTop + scrollElement.offsetHeight === scrollElement.scrollHeight) {
|
|
89
|
+
if (scrollElement && scrollElement.scrollTop + scrollElement.offsetHeight === scrollElement.scrollHeight) {
|
|
90
90
|
setIsScrollToBottom(true);
|
|
91
91
|
} else {
|
|
92
92
|
setIsScrollToBottom(false);
|
|
@@ -19,7 +19,7 @@ var Chart = function Chart(props) {
|
|
|
19
19
|
// });
|
|
20
20
|
// }, []);
|
|
21
21
|
var Chart = (_window = window) === null || _window === void 0 ? void 0 : (_window$SupersetChart = _window.SupersetChart) === null || _window$SupersetChart === void 0 ? void 0 : _window$SupersetChart.SupersetChart;
|
|
22
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
22
|
+
return Chart ? /*#__PURE__*/_react["default"].createElement(Chart, props) : /*#__PURE__*/_react["default"].createElement("div", null);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
var _default = Chart;
|
|
@@ -17,7 +17,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
17
17
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
18
|
|
|
19
19
|
var requestDomain = function requestDomain() {
|
|
20
|
-
if (!window.location.hostname.match(/dev/)) return
|
|
20
|
+
if (!window.location.hostname.match(/dev/)) return '';
|
|
21
21
|
return "".concat(window.location.protocol, "//www.tita.gift");
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -25,15 +25,15 @@ var tenantId = window.BSGlobal && window.BSGlobal.tenantInfo.Id || 0;
|
|
|
25
25
|
var userId = window.BSGlobal && window.BSGlobal.loginUserInfo.Id || 0;
|
|
26
26
|
|
|
27
27
|
function getToken() {
|
|
28
|
-
return sessionStorage.getItem(
|
|
28
|
+
return sessionStorage.getItem('DEMOFREE_TOKEN') || '';
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function clearToken() {
|
|
32
|
-
sessionStorage.removeItem(
|
|
32
|
+
sessionStorage.removeItem('DEMOFREE_TOKEN');
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
function setToken(token) {
|
|
36
|
-
sessionStorage.setItem(
|
|
36
|
+
sessionStorage.setItem('DEMOFREE_TOKEN', token);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
var getJwtToken = function getJwtToken() {
|
|
@@ -43,7 +43,7 @@ var getJwtToken = function getJwtToken() {
|
|
|
43
43
|
return JSON.parse(res.data.Data.obj).token;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
return
|
|
46
|
+
return '';
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
49
|
|
|
@@ -65,14 +65,6 @@ var beforeResponse = function beforeResponse(res) {
|
|
|
65
65
|
config.retry = 3;
|
|
66
66
|
config.retryCount = config.retryCount || 0;
|
|
67
67
|
|
|
68
|
-
if (window.titaTracker) {
|
|
69
|
-
window.titaTracker("action").record({
|
|
70
|
-
actionName: JSON.stringify(config),
|
|
71
|
-
actionGroup: "调用接口",
|
|
72
|
-
productName: "接口"
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
68
|
if (res.data.code === 401) {
|
|
77
69
|
// 401错误表示未登录授权或者token失效
|
|
78
70
|
clearToken();
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _button = _interopRequireDefault(require("../button"));
|
|
15
|
+
|
|
16
|
+
var _form = _interopRequireDefault(require("../form"));
|
|
17
|
+
|
|
18
|
+
require("./index.css");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
+
|
|
28
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
|
|
30
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31
|
+
|
|
32
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
33
|
+
|
|
34
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
+
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
|
|
38
|
+
var preCls = 'tita-survey-model';
|
|
39
|
+
var Rect = _button["default"].Rect;
|
|
40
|
+
var Input = _form["default"].Fields.Input;
|
|
41
|
+
|
|
42
|
+
var ContactModel = function ContactModel(_ref) {
|
|
43
|
+
var visilble = _ref.visilble,
|
|
44
|
+
setVisible = _ref.setVisible,
|
|
45
|
+
sendData = _ref.sendData;
|
|
46
|
+
|
|
47
|
+
var _useState = (0, _react.useState)(''),
|
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
+
contact = _useState2[0],
|
|
50
|
+
setContact = _useState2[1];
|
|
51
|
+
|
|
52
|
+
var onContactChange = function onContactChange(value) {
|
|
53
|
+
setContact(value);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
var handleClose = function handleClose() {
|
|
57
|
+
sendData(contact);
|
|
58
|
+
|
|
59
|
+
if (setVisible) {
|
|
60
|
+
setVisible(false);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var handleSubmit = function handleSubmit() {
|
|
65
|
+
sendData(contact);
|
|
66
|
+
setVisible(false);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
if (!visilble) return /*#__PURE__*/_react["default"].createElement("div", null);
|
|
70
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
71
|
+
className: (0, _classnames["default"])('tita-survey-model')
|
|
72
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
73
|
+
className: "".concat(preCls, "__head")
|
|
74
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
75
|
+
className: "".concat(preCls, "__head-title")
|
|
76
|
+
}, "\u5982\u613F\u610F\u63A5\u53D7\u56DE\u8BBF\uFF0C\u8BF7\u7559\u4E0B\u59D3\u540D\u4E0E\u7535\u8BDD"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
77
|
+
className: "tu-icon-canceled ".concat(preCls, "__head-close "),
|
|
78
|
+
onClick: handleClose
|
|
79
|
+
})), /*#__PURE__*/_react["default"].createElement(Input, {
|
|
80
|
+
placeholder: '参与调研有礼相送哦~',
|
|
81
|
+
value: contact,
|
|
82
|
+
onChange: onContactChange,
|
|
83
|
+
className: "".concat(preCls, "__input")
|
|
84
|
+
}), /*#__PURE__*/_react["default"].createElement(Rect, {
|
|
85
|
+
type: "primary",
|
|
86
|
+
className: "".concat(preCls, "__btn"),
|
|
87
|
+
onClick: handleSubmit
|
|
88
|
+
}, "\u63D0\u4EA4"));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
ContactModel.defaultProps = {};
|
|
92
|
+
var _default = ContactModel;
|
|
93
|
+
exports["default"] = _default;
|