tplus-components-touch 1.26.1 → 1.27.1
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/README.md +16 -16
- package/locales/zh/tplus-components-touch.json +1 -1
- package/locales/zh-CN/tplus-components-touch.json +1 -1
- package/mocks/memberInfo.json +79 -79
- package/package.json +2 -2
- package/tsconfig.json +26 -26
- package/dist/components/addLog/AddLogProcessor.js +0 -53
- package/dist/components/addLog/AddLogProcessor.js.map +0 -1
- package/dist/components/addLog/OperationLogApi.js +0 -164
- package/dist/components/addLog/OperationLogApi.js.map +0 -1
- package/dist/components/autoComplete/index.js +0 -259
- package/dist/components/autoComplete/index.js.map +0 -1
- package/dist/components/autoComplete/index.less +0 -89
- package/dist/components/autoComplete/option.js +0 -75
- package/dist/components/autoComplete/option.js.map +0 -1
- package/dist/components/autoCompleteWithKeyboard/index.js +0 -206
- package/dist/components/autoCompleteWithKeyboard/index.js.map +0 -1
- package/dist/components/autoCompleteWithKeyboard/index.less +0 -5
- package/dist/components/billSearch/api.js +0 -425
- package/dist/components/billSearch/api.js.map +0 -1
- package/dist/components/billSearch/index.js +0 -2030
- package/dist/components/billSearch/index.js.map +0 -1
- package/dist/components/billSearch/index.less +0 -573
- package/dist/components/cloudPrint/BTPrintFormatUtil.js +0 -568
- package/dist/components/cloudPrint/BTPrintFormatUtil.js.map +0 -1
- package/dist/components/cloudPrint/api.js +0 -454
- package/dist/components/cloudPrint/api.js.map +0 -1
- package/dist/components/cloudPrint/index.js +0 -974
- package/dist/components/cloudPrint/index.js.map +0 -1
- package/dist/components/cloudPrint/printDispatch.js +0 -336
- package/dist/components/cloudPrint/printDispatch.js.map +0 -1
- package/dist/components/commonForm/autoComplete/index.js +0 -272
- package/dist/components/commonForm/autoComplete/index.js.map +0 -1
- package/dist/components/commonForm/autoComplete/style.less +0 -8
- package/dist/components/commonForm/datePicker/index.js +0 -117
- package/dist/components/commonForm/datePicker/index.js.map +0 -1
- package/dist/components/commonForm/datePicker/style.less +0 -11
- package/dist/components/commonForm/formControl/index.js +0 -183
- package/dist/components/commonForm/formControl/index.js.map +0 -1
- package/dist/components/commonForm/formControl/style.less +0 -8
- package/dist/components/commonForm/index.js +0 -208
- package/dist/components/commonForm/index.js.map +0 -1
- package/dist/components/commonForm/inputNumber/index.js +0 -291
- package/dist/components/commonForm/inputNumber/index.js.map +0 -1
- package/dist/components/commonForm/inputNumber/style.less +0 -17
- package/dist/components/commonForm/radio/index.js +0 -157
- package/dist/components/commonForm/radio/index.js.map +0 -1
- package/dist/components/commonForm/radio/style.less +0 -11
- package/dist/components/commonForm/style.less +0 -12
- package/dist/components/deliverySearch/api.js +0 -355
- package/dist/components/deliverySearch/api.js.map +0 -1
- package/dist/components/deliverySearch/index.js +0 -1254
- package/dist/components/deliverySearch/index.js.map +0 -1
- package/dist/components/deliverySearch/index.less +0 -624
- package/dist/components/form/index.js +0 -325
- package/dist/components/form/index.js.map +0 -1
- package/dist/components/hardwareAPI/index.js +0 -181
- package/dist/components/hardwareAPI/index.js.map +0 -1
- package/dist/components/hotKey/config.js +0 -306
- package/dist/components/hotKey/config.js.map +0 -1
- package/dist/components/hotKey/hotKeyModal.js +0 -479
- package/dist/components/hotKey/hotKeyModal.js.map +0 -1
- package/dist/components/hotKey/index.js +0 -782
- package/dist/components/hotKey/index.js.map +0 -1
- package/dist/components/hotKey/localConfig.js +0 -3831
- package/dist/components/hotKey/localConfig.js.map +0 -1
- package/dist/components/hotKey/style.less +0 -99
- package/dist/components/hotKey/utils.js +0 -135
- package/dist/components/hotKey/utils.js.map +0 -1
- package/dist/components/input/index.js +0 -257
- package/dist/components/input/index.js.map +0 -1
- package/dist/components/input/style.less +0 -107
- package/dist/components/input/tplusInput/index.js +0 -89
- package/dist/components/input/tplusInput/index.js.map +0 -1
- package/dist/components/input/tplusInput/inputContent.js +0 -130
- package/dist/components/input/tplusInput/inputContent.js.map +0 -1
- package/dist/components/input/tplusInput/inputs.js +0 -201
- package/dist/components/input/tplusInput/inputs.js.map +0 -1
- package/dist/components/input/tplusInput/style.less +0 -194
- package/dist/components/input/utils/index.js +0 -26
- package/dist/components/input/utils/index.js.map +0 -1
- package/dist/components/inventorySearch/api.js +0 -214
- package/dist/components/inventorySearch/api.js.map +0 -1
- package/dist/components/inventorySearch/index.js +0 -303
- package/dist/components/inventorySearch/index.js.map +0 -1
- package/dist/components/inventorySearch/index.less +0 -244
- package/dist/components/inventorySearch/store.js +0 -344
- package/dist/components/inventorySearch/store.js.map +0 -1
- package/dist/components/inventorySearch/tab.js +0 -255
- package/dist/components/inventorySearch/tab.js.map +0 -1
- package/dist/components/keyboard/index.js +0 -258
- package/dist/components/keyboard/index.js.map +0 -1
- package/dist/components/keyboard/index.less +0 -556
- package/dist/components/keyboard/letterKeyboard.js +0 -222
- package/dist/components/keyboard/letterKeyboard.js.map +0 -1
- package/dist/components/keyboard/numKeyboard.js +0 -458
- package/dist/components/keyboard/numKeyboard.js.map +0 -1
- package/dist/components/keyboard/numKeyboardDigit.js +0 -502
- package/dist/components/keyboard/numKeyboardDigit.js.map +0 -1
- package/dist/components/keyboard/numKeyboardScan.js +0 -215
- package/dist/components/keyboard/numKeyboardScan.js.map +0 -1
- package/dist/components/keyboard/numberButtonInteger.js +0 -296
- package/dist/components/keyboard/numberButtonInteger.js.map +0 -1
- package/dist/components/keyboard/numberButton_input.js +0 -300
- package/dist/components/keyboard/numberButton_input.js.map +0 -1
- package/dist/components/keyboard/onlyKeyboard.js +0 -90
- package/dist/components/keyboard/onlyKeyboard.js.map +0 -1
- package/dist/components/keyboard/onlyLetterButton.js +0 -187
- package/dist/components/keyboard/onlyLetterButton.js.map +0 -1
- package/dist/components/keyboard/onlyLetterButton2.js +0 -235
- package/dist/components/keyboard/onlyLetterButton2.js.map +0 -1
- package/dist/components/keyboard/onlyLetterButton2.less +0 -184
- package/dist/components/keyboard/onlyNumberButton.js +0 -128
- package/dist/components/keyboard/onlyNumberButton.js.map +0 -1
- package/dist/components/keyboard/onlyNumberButton2.js +0 -115
- package/dist/components/keyboard/onlyNumberButton2.js.map +0 -1
- package/dist/components/keyboard/textKeyboard.js +0 -50
- package/dist/components/keyboard/textKeyboard.js.map +0 -1
- package/dist/components/layout/hamburger.js +0 -29
- package/dist/components/layout/hamburger.js.map +0 -1
- package/dist/components/layout/index.js +0 -31
- package/dist/components/layout/index.js.map +0 -1
- package/dist/components/layout/layout.js +0 -182
- package/dist/components/layout/layout.js.map +0 -1
- package/dist/components/layout/sider.js +0 -165
- package/dist/components/layout/sider.js.map +0 -1
- package/dist/components/layout/style.less +0 -83
- package/dist/components/loading/index.js +0 -193
- package/dist/components/loading/index.js.map +0 -1
- package/dist/components/loading/loadingContent.js +0 -159
- package/dist/components/loading/loadingContent.js.map +0 -1
- package/dist/components/loading/style.less +0 -51
- package/dist/components/loading/utils.js +0 -29
- package/dist/components/loading/utils.js.map +0 -1
- package/dist/components/message/index.js +0 -286
- package/dist/components/message/index.js.map +0 -1
- package/dist/components/message/index.less +0 -150
- package/dist/components/modal/index.js +0 -93
- package/dist/components/modal/index.js.map +0 -1
- package/dist/components/modal/index.less +0 -19
- package/dist/components/modalVertical/index.js +0 -338
- package/dist/components/modalVertical/index.js.map +0 -1
- package/dist/components/modalVertical/style.less +0 -114
- package/dist/components/modalWraper/index.js +0 -482
- package/dist/components/modalWraper/index.js.map +0 -1
- package/dist/components/modalWraper/style.less +0 -363
- package/dist/components/modalWraper/utils.js +0 -49
- package/dist/components/modalWraper/utils.js.map +0 -1
- package/dist/components/notification/index.js +0 -124
- package/dist/components/notification/index.js.map +0 -1
- package/dist/components/notification/index.less +0 -58
- package/dist/components/overflowTip/index.js +0 -269
- package/dist/components/overflowTip/index.js.map +0 -1
- package/dist/components/overflowTip/style.less +0 -66
- package/dist/components/page/index.js +0 -49
- package/dist/components/page/index.js.map +0 -1
- package/dist/components/page/index.less +0 -26
- package/dist/components/product/detail.js +0 -97
- package/dist/components/product/detail.js.map +0 -1
- package/dist/components/product/getCard.js +0 -145
- package/dist/components/product/getCard.js.map +0 -1
- package/dist/components/product/index.less +0 -354
- package/dist/components/progressState/EmptyAndErrorView.js +0 -143
- package/dist/components/progressState/EmptyAndErrorView.js.map +0 -1
- package/dist/components/progressState/ProgressState.js +0 -157
- package/dist/components/progressState/ProgressState.js.map +0 -1
- package/dist/components/progressState/index.js +0 -14
- package/dist/components/progressState/index.js.map +0 -1
- package/dist/components/progressState/style.less +0 -65
- package/dist/components/scan/index.js +0 -219
- package/dist/components/scan/index.js.map +0 -1
- package/dist/components/scan/index.less +0 -34
- package/dist/components/select/index.js +0 -28
- package/dist/components/select/index.js.map +0 -1
- package/dist/components/select/index.less +0 -12
- package/dist/components/settlement/asyncModal.js +0 -178
- package/dist/components/settlement/asyncModal.js.map +0 -1
- package/dist/components/settlement/index.js +0 -16
- package/dist/components/settlement/index.js.map +0 -1
- package/dist/components/settlement/settlement.js +0 -5488
- package/dist/components/settlement/settlement.js.map +0 -1
- package/dist/components/settlement/settlement.less +0 -1604
- package/dist/components/settlement/settlementStore.js +0 -1459
- package/dist/components/settlement/settlementStore.js.map +0 -1
- package/dist/components/settlement/utils.js +0 -295
- package/dist/components/settlement/utils.js.map +0 -1
- package/dist/components/socket/index.js +0 -220
- package/dist/components/socket/index.js.map +0 -1
- package/dist/components/spin/index.js +0 -95
- package/dist/components/spin/index.js.map +0 -1
- package/dist/components/spin/spin-style.less +0 -436
- package/dist/components/test/index.js +0 -338
- package/dist/components/test/index.js.map +0 -1
- package/dist/components/ticon/iconfont/demo.css +0 -539
- package/dist/components/ticon/iconfont/demo_index.html +0 -4765
- package/dist/components/ticon/iconfont/iconfont.css +0 -811
- package/dist/components/ticon/iconfont/iconfont.eot +0 -0
- package/dist/components/ticon/iconfont/iconfont.js +0 -33
- package/dist/components/ticon/iconfont/iconfont.js.map +0 -1
- package/dist/components/ticon/iconfont/iconfont.json +0 -1402
- package/dist/components/ticon/iconfont/iconfont.svg +0 -572
- package/dist/components/ticon/iconfont/iconfont.ttf +0 -0
- package/dist/components/ticon/iconfont/iconfont.woff +0 -0
- package/dist/components/ticon/iconfont/iconfont.woff2 +0 -0
- package/dist/components/ticon/index.js +0 -60
- package/dist/components/ticon/index.js.map +0 -1
- package/dist/components/touchScroll/index.js +0 -182
- package/dist/components/touchScroll/index.js.map +0 -1
- package/dist/components/touchTable/AuthProcess.js +0 -42
- package/dist/components/touchTable/AuthProcess.js.map +0 -1
- package/dist/components/touchTable/generateWater.js +0 -59
- package/dist/components/touchTable/generateWater.js.map +0 -1
- package/dist/components/touchTable/index.js +0 -958
- package/dist/components/touchTable/index.js.map +0 -1
- package/dist/components/touchTable/index.less +0 -190
- package/dist/components/touchTable/utils.js +0 -14
- package/dist/components/touchTable/utils.js.map +0 -1
- package/dist/demo/PopOverDemo.js +0 -126
- package/dist/demo/PopOverDemo.js.map +0 -1
- package/dist/index.js +0 -246
- package/dist/index.js.map +0 -1
- package/dist/util/tools.js +0 -210
- package/dist/util/tools.js.map +0 -1
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
.tplus-layout{
|
|
2
|
-
display: flex;
|
|
3
|
-
flex: 1;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
min-height: 0;
|
|
6
|
-
background: #EAEBED;
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
* {
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
}
|
|
11
|
-
&.tplus-layout-has-sider {
|
|
12
|
-
flex-direction: row;
|
|
13
|
-
> .tplus-layout,
|
|
14
|
-
> .tplus-layout-content {
|
|
15
|
-
overflow-x: hidden;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
.tplus-layout-header{
|
|
20
|
-
padding: 0 50px;
|
|
21
|
-
height: 60px;
|
|
22
|
-
line-height: 60px;
|
|
23
|
-
}
|
|
24
|
-
.tplus-layout-footer{
|
|
25
|
-
box-shadow: 0px -3px 4px rgba(0, 0, 0, .03);
|
|
26
|
-
}
|
|
27
|
-
.tplus-layout-header, .tplus-layout-footer {
|
|
28
|
-
flex: 0 0 auto;
|
|
29
|
-
}
|
|
30
|
-
.tplus-layout-content {
|
|
31
|
-
flex: 1;
|
|
32
|
-
min-height: 0;
|
|
33
|
-
}
|
|
34
|
-
//animation
|
|
35
|
-
._tplus-animation-ease_{
|
|
36
|
-
transition: all 0.2s ease-in-out;
|
|
37
|
-
}
|
|
38
|
-
// sider
|
|
39
|
-
.tplus-layout-sider{
|
|
40
|
-
height: 100%;
|
|
41
|
-
position: relative;
|
|
42
|
-
.tplus-layout-sider-children{
|
|
43
|
-
height: 100%;
|
|
44
|
-
}
|
|
45
|
-
.tplus-sider-trigger{
|
|
46
|
-
position: fixed;
|
|
47
|
-
width: 100%;
|
|
48
|
-
bottom: 0px;
|
|
49
|
-
z-index: 9;
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
min-height: 40px;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
//_hamburger_
|
|
55
|
-
._hamburger_{
|
|
56
|
-
transform: scale(0.42, 0.42);
|
|
57
|
-
._hamburger_-line{
|
|
58
|
-
width: 50px;
|
|
59
|
-
height: 5px;
|
|
60
|
-
background-color: #ecf0f1;
|
|
61
|
-
display: block;
|
|
62
|
-
margin: 8px auto;
|
|
63
|
-
._tplus-animation-ease_;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
._hamburger-active ._hamburger_-line{
|
|
67
|
-
border-radius: 100px 0px 0px 100px;
|
|
68
|
-
}
|
|
69
|
-
._hamburger-active ._hamburger_-line:nth-child(1),
|
|
70
|
-
._hamburger-active ._hamburger_-line:nth-child(3){
|
|
71
|
-
width: 20px;
|
|
72
|
-
}
|
|
73
|
-
._hamburger-active ._hamburger_-line:nth-child(2){
|
|
74
|
-
width: 35px;
|
|
75
|
-
transform: translateX(-5px);
|
|
76
|
-
}
|
|
77
|
-
._hamburger-active ._hamburger_-line:nth-child(1){
|
|
78
|
-
transform: translateX(-14px) translateY(6px) rotate(-45deg);
|
|
79
|
-
}
|
|
80
|
-
._hamburger-active ._hamburger_-line:nth-child(3){
|
|
81
|
-
transform: translateX(-13px) translateY(-5px) rotate(45deg)
|
|
82
|
-
}
|
|
83
|
-
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = undefined;
|
|
7
|
-
|
|
8
|
-
var _regenerator = require('babel-runtime/regenerator');
|
|
9
|
-
|
|
10
|
-
var _regenerator2 = _interopRequireDefault(_regenerator);
|
|
11
|
-
|
|
12
|
-
var _extends2 = require('babel-runtime/helpers/extends');
|
|
13
|
-
|
|
14
|
-
var _extends3 = _interopRequireDefault(_extends2);
|
|
15
|
-
|
|
16
|
-
var _assign = require('babel-runtime/core-js/object/assign');
|
|
17
|
-
|
|
18
|
-
var _assign2 = _interopRequireDefault(_assign);
|
|
19
|
-
|
|
20
|
-
var _typeof2 = require('babel-runtime/helpers/typeof');
|
|
21
|
-
|
|
22
|
-
var _typeof3 = _interopRequireDefault(_typeof2);
|
|
23
|
-
|
|
24
|
-
var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');
|
|
25
|
-
|
|
26
|
-
var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
|
|
27
|
-
|
|
28
|
-
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
29
|
-
|
|
30
|
-
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
31
|
-
|
|
32
|
-
var _createClass2 = require('babel-runtime/helpers/createClass');
|
|
33
|
-
|
|
34
|
-
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
35
|
-
|
|
36
|
-
var _react = require('react');
|
|
37
|
-
|
|
38
|
-
var _react2 = _interopRequireDefault(_react);
|
|
39
|
-
|
|
40
|
-
var _propTypes = require('prop-types');
|
|
41
|
-
|
|
42
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
43
|
-
|
|
44
|
-
var _reactDom = require('react-dom');
|
|
45
|
-
|
|
46
|
-
var _reactDom2 = _interopRequireDefault(_reactDom);
|
|
47
|
-
|
|
48
|
-
var _loadingContent = require('./loadingContent');
|
|
49
|
-
|
|
50
|
-
var _loadingContent2 = _interopRequireDefault(_loadingContent);
|
|
51
|
-
|
|
52
|
-
var _utils = require('./utils');
|
|
53
|
-
|
|
54
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
55
|
-
|
|
56
|
-
var Loading = function () {
|
|
57
|
-
function Loading() {
|
|
58
|
-
(0, _classCallCheck3.default)(this, Loading);
|
|
59
|
-
this.loadingEle = null;
|
|
60
|
-
this.ref = null;
|
|
61
|
-
this.startTimeStamp = null;
|
|
62
|
-
this.delayTime = null;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
(0, _createClass3.default)(Loading, null, [{
|
|
66
|
-
key: 'show',
|
|
67
|
-
value: function () {
|
|
68
|
-
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(params, callback) {
|
|
69
|
-
var _this = this;
|
|
70
|
-
|
|
71
|
-
var props, _ref2, target, queryElement, loadingEle, queryClass, positionProper, onClose;
|
|
72
|
-
|
|
73
|
-
return _regenerator2.default.wrap(function _callee$(_context) {
|
|
74
|
-
while (1) {
|
|
75
|
-
switch (_context.prev = _context.next) {
|
|
76
|
-
case 0:
|
|
77
|
-
onClose = function onClose() {
|
|
78
|
-
var argument = typeof props.duration === 'number' ? callback : undefined;
|
|
79
|
-
Loading.destroy(argument);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
if (window._tplus_loading) {
|
|
83
|
-
Loading.destroy(callback);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
this.startTimeStamp = +new Date();
|
|
87
|
-
window._tplus_loading = true;
|
|
88
|
-
props = { delay: 200 }; // 默认200ms防闪烁延迟
|
|
89
|
-
|
|
90
|
-
if ((typeof params === 'undefined' ? 'undefined' : (0, _typeof3.default)(params)) === 'object' && params) {
|
|
91
|
-
props = (0, _assign2.default)(props, params);
|
|
92
|
-
params.delay === false && delete params.delay;
|
|
93
|
-
} else if (typeof params === 'string') {
|
|
94
|
-
props.text = params;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
_ref2 = params || {}, target = _ref2.target;
|
|
98
|
-
queryElement = void 0;
|
|
99
|
-
loadingEle = document.createElement('div');
|
|
100
|
-
|
|
101
|
-
this.loadingEle = loadingEle;
|
|
102
|
-
this.delayTime = props.delay;
|
|
103
|
-
|
|
104
|
-
if (!target) {
|
|
105
|
-
_context.next = 19;
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
queryClass = '.' + target;
|
|
110
|
-
|
|
111
|
-
if (['.', '#'].includes(target.charAt(0))) {
|
|
112
|
-
queryClass = target;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
//如果找不到 取root 存在有dom渲染比查询晚一步的情况 根据事件队列机制再次查询一次
|
|
116
|
-
_context.next = 16;
|
|
117
|
-
return (0, _utils.queryEle)(queryClass);
|
|
118
|
-
|
|
119
|
-
case 16:
|
|
120
|
-
queryElement = _context.sent;
|
|
121
|
-
positionProper = getComputedStyle(queryElement, null).getPropertyValue('position');
|
|
122
|
-
|
|
123
|
-
if (!positionProper || positionProper == 'static') {
|
|
124
|
-
queryElement.style.position = 'relative';
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
case 19:
|
|
128
|
-
|
|
129
|
-
!target && document.body.appendChild(loadingEle);
|
|
130
|
-
|
|
131
|
-
_reactDom2.default.render(_react2.default.createElement(_loadingContent2.default, (0, _extends3.default)({ onClose: onClose }, props, { ref: function ref(_ref3) {
|
|
132
|
-
return _this.ref = _ref3;
|
|
133
|
-
} })), loadingEle);
|
|
134
|
-
target && queryElement.appendChild(loadingEle);
|
|
135
|
-
|
|
136
|
-
case 22:
|
|
137
|
-
case 'end':
|
|
138
|
-
return _context.stop();
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}, _callee, this);
|
|
142
|
-
}));
|
|
143
|
-
|
|
144
|
-
function show(_x, _x2) {
|
|
145
|
-
return _ref.apply(this, arguments);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return show;
|
|
149
|
-
}()
|
|
150
|
-
}, {
|
|
151
|
-
key: 'hide',
|
|
152
|
-
value: function hide() {
|
|
153
|
-
var endTimeStamp = +new Date();
|
|
154
|
-
var delayTime = this.delayTime;
|
|
155
|
-
if (delayTime && endTimeStamp - this.startTimeStamp <= delayTime) {
|
|
156
|
-
return this.destroy();
|
|
157
|
-
}
|
|
158
|
-
this.ref && this.ref.readyClose();
|
|
159
|
-
}
|
|
160
|
-
}, {
|
|
161
|
-
key: 'destroy',
|
|
162
|
-
value: function destroy(callback) {
|
|
163
|
-
var loadingEle = this.loadingEle;
|
|
164
|
-
if (loadingEle) {
|
|
165
|
-
_reactDom2.default.unmountComponentAtNode(loadingEle);
|
|
166
|
-
!!loadingEle.parentNode && loadingEle.parentNode.removeChild(loadingEle);
|
|
167
|
-
delete window._tplus_loading;
|
|
168
|
-
}
|
|
169
|
-
callback && callback();
|
|
170
|
-
}
|
|
171
|
-
}]);
|
|
172
|
-
return Loading;
|
|
173
|
-
}(); /**
|
|
174
|
-
* Created by hzy on 2019/4/19.
|
|
175
|
-
*/
|
|
176
|
-
/**
|
|
177
|
-
* show 方法参数 option 说明 // Loading.show({text: '数据加载中'}, callback)
|
|
178
|
-
* loading调用的简写法 Loading.show('数据加载中')
|
|
179
|
-
* @style Loading wrapper style
|
|
180
|
-
* @className Loading wrapper className
|
|
181
|
-
* @text 提示文字,不传默认为 '加载中,请稍后...',字符串类型
|
|
182
|
-
* @target Loading 需要覆盖的 DOM 节点。传入一个 DOM 节点的class或者id名的字符串,不传默认为全屏效果
|
|
183
|
-
* @node 自定义展示元素,会覆盖默认展示。类型为react element
|
|
184
|
-
* @duration Loading持续时间,单位为毫秒值,数字类型
|
|
185
|
-
* @delay Loading防闪烁延迟显示时间, 单位为毫秒值, 数字类型,默认为200,可设置false禁用延迟
|
|
186
|
-
* @callback 为在传入 duration 参数后,自动隐藏后的回调,不传 duration 参数则该回调不生效
|
|
187
|
-
*
|
|
188
|
-
* hide 方法隐藏并销毁Loading组件 Loading.hide();
|
|
189
|
-
*/
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
exports.default = Loading;
|
|
193
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["tplus-components-touch/components/loading/index.js"],"names":["Loading","loadingEle","ref","startTimeStamp","delayTime","params","callback","onClose","argument","props","duration","undefined","destroy","window","_tplus_loading","Date","delay","text","target","queryElement","document","createElement","queryClass","includes","charAt","positionProper","getComputedStyle","getPropertyValue","style","position","body","appendChild","ReactDOM","render","endTimeStamp","readyClose","unmountComponentAtNode","parentNode","removeChild"],"mappings":"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","file":"index.js","sourcesContent":["/**\r\n * Created by hzy on 2019/4/19.\r\n */\r\n/**\r\n * show 方法参数 option 说明 // Loading.show({text: '数据加载中'}, callback)\r\n * loading调用的简写法 Loading.show('数据加载中')\r\n * @style Loading wrapper style\r\n * @className Loading wrapper className\r\n * @text 提示文字,不传默认为 '加载中,请稍后...',字符串类型\r\n * @target Loading 需要覆盖的 DOM 节点。传入一个 DOM 节点的class或者id名的字符串,不传默认为全屏效果\r\n * @node 自定义展示元素,会覆盖默认展示。类型为react element\r\n * @duration Loading持续时间,单位为毫秒值,数字类型\r\n * @delay Loading防闪烁延迟显示时间, 单位为毫秒值, 数字类型,默认为200,可设置false禁用延迟\r\n * @callback 为在传入 duration 参数后,自动隐藏后的回调,不传 duration 参数则该回调不生效\r\n *\r\n * hide 方法隐藏并销毁Loading组件 Loading.hide();\r\n */\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport ReactDOM from 'react-dom';\r\nimport LoaingContent from './loadingContent';\r\nimport {queryEle} from './utils';\r\n\r\nexport default class Loading {\r\n loadingEle = null;\r\n ref = null;\r\n startTimeStamp = null;\r\n delayTime = null;\r\n\r\n static async show(params, callback) {\r\n if (window._tplus_loading) {\r\n Loading.destroy(callback);\r\n }\r\n\r\n this.startTimeStamp = +new Date();\r\n window._tplus_loading = true;\r\n let props = {delay: 200}; // 默认200ms防闪烁延迟\r\n\r\n if (typeof params === 'object' && params) {\r\n props = Object.assign(props, params);\r\n params.delay === false && (delete params.delay);\r\n } else if (typeof params === 'string') {\r\n props.text = params;\r\n }\r\n\r\n const {target} = params || {};\r\n let queryElement;\r\n const loadingEle = document.createElement('div');\r\n this.loadingEle = loadingEle;\r\n this.delayTime = props.delay;\r\n\r\n if (target) {\r\n let queryClass = `.${target}`;\r\n if (['.', '#'].includes(target.charAt(0))) {\r\n queryClass = target;\r\n }\r\n\r\n //如果找不到 取root 存在有dom渲染比查询晚一步的情况 根据事件队列机制再次查询一次\r\n queryElement = await queryEle(queryClass);\r\n\r\n const positionProper = getComputedStyle(queryElement, null).getPropertyValue('position');\r\n if (!positionProper || positionProper == 'static') {\r\n queryElement.style.position = 'relative';\r\n }\r\n }\r\n\r\n !target && document.body.appendChild(loadingEle);\r\n\r\n function onClose() {\r\n const argument = typeof props.duration === 'number' ? callback : undefined;\r\n Loading.destroy(argument);\r\n }\r\n\r\n ReactDOM.render(<LoaingContent onClose={onClose} {...props} ref={ref => this.ref = ref}/>, loadingEle);\r\n target && queryElement.appendChild(loadingEle);\r\n }\r\n\r\n static hide() {\r\n const endTimeStamp = +new Date();\r\n const delayTime = this.delayTime;\r\n if (delayTime && (endTimeStamp - this.startTimeStamp <= delayTime)) {\r\n return this.destroy();\r\n }\r\n this.ref && this.ref.readyClose();\r\n }\r\n\r\n static destroy(callback) {\r\n const loadingEle = this.loadingEle;\r\n if (loadingEle) {\r\n ReactDOM.unmountComponentAtNode(loadingEle);\r\n !!loadingEle.parentNode && loadingEle.parentNode.removeChild(loadingEle);\r\n delete window._tplus_loading;\r\n }\r\n callback && callback();\r\n }\r\n}\r\n"]}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _assign = require('babel-runtime/core-js/object/assign');
|
|
8
|
-
|
|
9
|
-
var _assign2 = _interopRequireDefault(_assign);
|
|
10
|
-
|
|
11
|
-
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
|
|
12
|
-
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
|
|
14
|
-
|
|
15
|
-
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
16
|
-
|
|
17
|
-
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
18
|
-
|
|
19
|
-
var _createClass2 = require('babel-runtime/helpers/createClass');
|
|
20
|
-
|
|
21
|
-
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
22
|
-
|
|
23
|
-
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
24
|
-
|
|
25
|
-
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
26
|
-
|
|
27
|
-
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
28
|
-
|
|
29
|
-
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
30
|
-
|
|
31
|
-
var _class, _temp2;
|
|
32
|
-
|
|
33
|
-
var _react = require('react');
|
|
34
|
-
|
|
35
|
-
var _react2 = _interopRequireDefault(_react);
|
|
36
|
-
|
|
37
|
-
var _propTypes = require('prop-types');
|
|
38
|
-
|
|
39
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
40
|
-
|
|
41
|
-
require('./style.less');
|
|
42
|
-
|
|
43
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
44
|
-
|
|
45
|
-
var defaultSpinner = 'https://newretail.static.chanjet.com/loading.gif';
|
|
46
|
-
|
|
47
|
-
var LoaingContent = (_temp2 = _class = function (_Component) {
|
|
48
|
-
(0, _inherits3.default)(LoaingContent, _Component);
|
|
49
|
-
|
|
50
|
-
function LoaingContent() {
|
|
51
|
-
var _ref;
|
|
52
|
-
|
|
53
|
-
var _temp, _this, _ret;
|
|
54
|
-
|
|
55
|
-
(0, _classCallCheck3.default)(this, LoaingContent);
|
|
56
|
-
|
|
57
|
-
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
58
|
-
args[_key] = arguments[_key];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = LoaingContent.__proto__ || (0, _getPrototypeOf2.default)(LoaingContent)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
|
62
|
-
closeAnimate: false
|
|
63
|
-
}, _this.readyClose = function (e) {
|
|
64
|
-
_this.setState({ closeAnimate: true }, function () {
|
|
65
|
-
setTimeout(function () {
|
|
66
|
-
_this.close();
|
|
67
|
-
}, 250);
|
|
68
|
-
});
|
|
69
|
-
}, _this.close = function (e) {
|
|
70
|
-
if (e) {
|
|
71
|
-
e.stopPropagation();
|
|
72
|
-
}
|
|
73
|
-
_this.clearCloseTimer();
|
|
74
|
-
_this.props.onClose();
|
|
75
|
-
}, _this.startLoadingTimer = function () {
|
|
76
|
-
_this.closeTimer = setTimeout(function () {
|
|
77
|
-
_this.readyClose();
|
|
78
|
-
}, _this.props.duration);
|
|
79
|
-
}, _this.clearCloseTimer = function () {
|
|
80
|
-
if (_this.closeTimer) {
|
|
81
|
-
clearTimeout(_this.closeTimer);
|
|
82
|
-
_this.closeTimer = null;
|
|
83
|
-
}
|
|
84
|
-
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
(0, _createClass3.default)(LoaingContent, [{
|
|
88
|
-
key: 'componentDidMount',
|
|
89
|
-
value: function componentDidMount() {
|
|
90
|
-
if (typeof this.props.duration === 'number') {
|
|
91
|
-
this.startLoadingTimer();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}, {
|
|
95
|
-
key: 'componentWillUnmount',
|
|
96
|
-
value: function componentWillUnmount() {
|
|
97
|
-
this.clearCloseTimer();
|
|
98
|
-
}
|
|
99
|
-
}, {
|
|
100
|
-
key: 'render',
|
|
101
|
-
value: function render() {
|
|
102
|
-
var _props = this.props,
|
|
103
|
-
style = _props.style,
|
|
104
|
-
text = _props.text,
|
|
105
|
-
node = _props.node,
|
|
106
|
-
className = _props.className,
|
|
107
|
-
target = _props.target,
|
|
108
|
-
delay = _props.delay,
|
|
109
|
-
opacity = _props.opacity;
|
|
110
|
-
var closeAnimate = this.state.closeAnimate;
|
|
111
|
-
|
|
112
|
-
var showTip = text !== false;
|
|
113
|
-
var loadingNode = _react2.default.createElement(
|
|
114
|
-
_react.Fragment,
|
|
115
|
-
null,
|
|
116
|
-
_react2.default.createElement(
|
|
117
|
-
'div',
|
|
118
|
-
{ className: 'tplus-loading-spinner' },
|
|
119
|
-
_react2.default.createElement('img', { src: defaultSpinner, className: 'default-spinner-gif' })
|
|
120
|
-
),
|
|
121
|
-
showTip && _react2.default.createElement(
|
|
122
|
-
'p',
|
|
123
|
-
{ className: 'tplus-loading-tip' },
|
|
124
|
-
text
|
|
125
|
-
)
|
|
126
|
-
);
|
|
127
|
-
var containerClass = ('tplus-loading ' + (closeAnimate ? 'loading-close-animate' : '') + ' ' + className).trim();
|
|
128
|
-
var targetStyle = target ? { position: 'absolute' } : {};
|
|
129
|
-
var delayDuration = delay ? { animation: 'loading-delay-animation ' + delay + 'ms', WebkitAnimation: 'loading-delay-animation ' + delay + 'ms' } : {};
|
|
130
|
-
var style2 = opacity ? { 'background-color': 'rgba(2555, 255, 255, ' + opacity + ')' } : {};
|
|
131
|
-
return _react2.default.createElement(
|
|
132
|
-
'div',
|
|
133
|
-
{ className: containerClass, style: (0, _assign2.default)(targetStyle, delayDuration, style, style2) },
|
|
134
|
-
_react2.default.createElement(
|
|
135
|
-
'div',
|
|
136
|
-
{ className: 'tplus-loading-content' },
|
|
137
|
-
(0, _react.isValidElement)(node) ? node : loadingNode
|
|
138
|
-
)
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
}]);
|
|
142
|
-
return LoaingContent;
|
|
143
|
-
}(_react.Component), _class.propTypes = {
|
|
144
|
-
text: _propTypes2.default.string,
|
|
145
|
-
className: _propTypes2.default.string,
|
|
146
|
-
style: _propTypes2.default.object,
|
|
147
|
-
node: _propTypes2.default.element,
|
|
148
|
-
onClose: _propTypes2.default.func,
|
|
149
|
-
duration: _propTypes2.default.number,
|
|
150
|
-
target: _propTypes2.default.string
|
|
151
|
-
}, _class.defaultProps = {
|
|
152
|
-
onClose: function onClose() {},
|
|
153
|
-
|
|
154
|
-
className: '',
|
|
155
|
-
style: {},
|
|
156
|
-
text: '加载中,请稍后...'
|
|
157
|
-
}, _temp2);
|
|
158
|
-
exports.default = LoaingContent;
|
|
159
|
-
//# sourceMappingURL=loadingContent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["tplus-components-touch/components/loading/loadingContent.js"],"names":["defaultSpinner","LoaingContent","state","closeAnimate","readyClose","e","setState","setTimeout","close","stopPropagation","clearCloseTimer","props","onClose","startLoadingTimer","closeTimer","duration","clearTimeout","style","text","node","className","target","delay","opacity","showTip","loadingNode","containerClass","trim","targetStyle","position","delayDuration","animation","WebkitAnimation","style2","Component","propTypes","PropTypes","string","object","element","func","number","defaultProps"],"mappings":"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","file":"loadingContent.js","sourcesContent":["import React, {Component, Fragment, isValidElement} from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport './style.less';\r\n\r\nconst defaultSpinner = 'https://newretail.static.chanjet.com/loading.gif';\r\n\r\nclass LoaingContent extends Component {\r\n static propTypes = {\r\n text: PropTypes.string,\r\n className: PropTypes.string,\r\n style: PropTypes.object,\r\n node: PropTypes.element,\r\n onClose: PropTypes.func,\r\n duration: PropTypes.number,\r\n target: PropTypes.string,\r\n };\r\n\r\n static defaultProps = {\r\n onClose() {},\r\n className: '',\r\n style: {},\r\n text: '加载中,请稍后...',\r\n };\r\n\r\n state = {\r\n closeAnimate: false,\r\n };\r\n\r\n componentDidMount() {\r\n if (typeof this.props.duration === 'number') {\r\n this.startLoadingTimer();\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.clearCloseTimer();\r\n }\r\n\r\n readyClose = (e) => {\r\n this.setState({closeAnimate: true}, () => {\r\n setTimeout(() => {\r\n this.close();\r\n }, 250)\r\n })\r\n }\r\n\r\n close = (e) => {\r\n if (e) {\r\n e.stopPropagation();\r\n }\r\n this.clearCloseTimer();\r\n this.props.onClose();\r\n }\r\n\r\n startLoadingTimer = () => {\r\n this.closeTimer = setTimeout(() => {\r\n this.readyClose();\r\n }, this.props.duration);\r\n }\r\n\r\n clearCloseTimer = () => {\r\n if (this.closeTimer) {\r\n clearTimeout(this.closeTimer);\r\n this.closeTimer = null;\r\n }\r\n }\r\n\r\n render() {\r\n const { style, text, node, className, target, delay, opacity } = this.props;\r\n const {closeAnimate} = this.state;\r\n const showTip = text !== false;\r\n const loadingNode = (\r\n <Fragment>\r\n <div className='tplus-loading-spinner'>\r\n <img src={defaultSpinner} className='default-spinner-gif' />\r\n </div>\r\n {showTip && <p className='tplus-loading-tip'>{text}</p>}\r\n </Fragment>\r\n );\r\n const containerClass = `tplus-loading ${closeAnimate ? 'loading-close-animate' : ''} ${className}`.trim();\r\n const targetStyle = target ? {position: 'absolute'} : {};\r\n const delayDuration = delay ? {animation: `loading-delay-animation ${delay}ms`, WebkitAnimation: `loading-delay-animation ${delay}ms`} : {};\r\n const style2 = opacity ? { 'background-color': `rgba(2555, 255, 255, ${opacity})` } : {};\r\n return (\r\n <div className={containerClass} style={Object.assign(targetStyle, delayDuration, style,style2)}>\r\n <div className='tplus-loading-content'>\r\n {isValidElement(node) ? node : loadingNode}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default LoaingContent;\r\n"]}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
._tplus-animation-ease_{
|
|
2
|
-
transition: all 0.2s ease-in-out;
|
|
3
|
-
};
|
|
4
|
-
.tplus-loading {
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
z-index: 2019;
|
|
8
|
-
position: fixed;
|
|
9
|
-
left: 0px;
|
|
10
|
-
top: 0px;
|
|
11
|
-
background-color: rgba(2555,255,255,0.5);
|
|
12
|
-
.tplus-loading-content{
|
|
13
|
-
padding: 10px;
|
|
14
|
-
top: 50%;
|
|
15
|
-
left: 50%;
|
|
16
|
-
transform: translate(-50%,-50%);
|
|
17
|
-
transform-origin: 50% 50%;
|
|
18
|
-
position: absolute;
|
|
19
|
-
.tplus-loading-spinner{
|
|
20
|
-
text-align: center;
|
|
21
|
-
margin-bottom: 20px;
|
|
22
|
-
.default-spinner-gif{
|
|
23
|
-
display: block;
|
|
24
|
-
width: 150px;
|
|
25
|
-
margin: 0 auto;
|
|
26
|
-
position: relative;
|
|
27
|
-
left: 6px;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
.tplus-loading-tip{
|
|
31
|
-
color: #777;
|
|
32
|
-
text-align: center;
|
|
33
|
-
}
|
|
34
|
-
.closeAnimate{
|
|
35
|
-
._tplus-animation-ease_;
|
|
36
|
-
background-color: #01AAED !important;
|
|
37
|
-
opacity: 0;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
.loading-close-animate{
|
|
42
|
-
._tplus-animation-ease_;
|
|
43
|
-
opacity: 0;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
@keyframes loading-delay-animation {
|
|
48
|
-
0% { opacity: 0}
|
|
49
|
-
99.99% { opacity: 0 }
|
|
50
|
-
100% { opacity: 1 }
|
|
51
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.queryEle = undefined;
|
|
7
|
-
|
|
8
|
-
var _promise = require('babel-runtime/core-js/promise');
|
|
9
|
-
|
|
10
|
-
var _promise2 = _interopRequireDefault(_promise);
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
function queryEle(queryClass) {
|
|
15
|
-
return new _promise2.default(function (resolve, reject) {
|
|
16
|
-
var element = document.querySelector(queryClass);
|
|
17
|
-
if (!element) {
|
|
18
|
-
setTimeout(function () {
|
|
19
|
-
element = document.querySelector(queryClass) || document.querySelector('#root');
|
|
20
|
-
resolve(element);
|
|
21
|
-
}, 0);
|
|
22
|
-
} else {
|
|
23
|
-
return resolve(element);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
exports.queryEle = queryEle;
|
|
29
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["tplus-components-touch/components/loading/utils.js"],"names":["queryEle","queryClass","resolve","reject","element","document","querySelector","setTimeout"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,QAAT,CAAkBC,UAAlB,EAA8B;AAC5B,SAAO,sBAAY,UAACC,OAAD,EAAUC,MAAV,EAAqB;AACtC,QAAIC,UAAUC,SAASC,aAAT,CAAuBL,UAAvB,CAAd;AACA,QAAI,CAACG,OAAL,EAAc;AACZG,iBAAW,YAAM;AACfH,kBAAUC,SAASC,aAAT,CAAuBL,UAAvB,KAAsCI,SAASC,aAAT,CAAuB,OAAvB,CAAhD;AACAJ,gBAAQE,OAAR;AACD,OAHD,EAGG,CAHH;AAID,KALD,MAKO;AACL,aAAOF,QAAQE,OAAR,CAAP;AACD;AACF,GAVM,CAAP;AAWD;;QAEOJ,Q,GAAAA,Q","file":"utils.js","sourcesContent":["function queryEle(queryClass) {\r\n return new Promise((resolve, reject) => {\r\n let element = document.querySelector(queryClass);\r\n if (!element) {\r\n setTimeout(() => {\r\n element = document.querySelector(queryClass) || document.querySelector('#root');\r\n resolve(element);\r\n }, 0);\r\n } else {\r\n return resolve(element);\r\n }\r\n });\r\n}\r\n\r\nexport {queryEle};\r\n"]}
|