fan-standard-comp 3.1.2 → 3.1.4
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/package.json +1 -1
- package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
- package/dist/fan-standard-comp.umd.js +0 -597
- package/dist/fonts/iconfont.eot +0 -0
- package/dist/fonts/iconfont.ttf +0 -0
- package/dist/fonts/iconfont.woff +0 -0
- package/es/ButtonGroup/ButtonList.d.ts +0 -2
- package/es/ButtonGroup/ButtonList.js +0 -37
- package/es/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/es/ButtonGroup/ButtonMenu.js +0 -38
- package/es/ButtonGroup/PopConfirmTitle.d.ts +0 -9
- package/es/ButtonGroup/PopConfirmTitle.js +0 -37
- package/es/ButtonGroup/index.d.ts +0 -30
- package/es/ButtonGroup/index.js +0 -374
- package/es/ButtonGroup/style/index.less +0 -36
- package/es/DragContent/DragBar.js +0 -21
- package/es/DragContent/index.d.ts +0 -14
- package/es/DragContent/index.js +0 -173
- package/es/DragContent/index.less +0 -44
- package/es/FormComp/ChunkUploader/api.js +0 -76
- package/es/FormComp/ChunkUploader/index.js +0 -391
- package/es/FormComp/ChunkUploader/lib.js +0 -96
- package/es/FormComp/ChunkUploader/style/style.less +0 -3
- package/es/FormComp/ChunkUploader/upload-queue.class.js +0 -167
- package/es/FormComp/ChunkUploader/worker.js +0 -23
- package/es/FormComp/EditButton/index.d.ts +0 -26
- package/es/FormComp/EditButton/index.js +0 -140
- package/es/FormComp/FieldComponent/ReUpload.d.ts +0 -3
- package/es/FormComp/FieldComponent/ReUpload.js +0 -131
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +0 -245
- package/es/FormComp/FieldComponent/TitleNode.d.ts +0 -6
- package/es/FormComp/FieldComponent/TitleNode.js +0 -9
- package/es/FormComp/FieldComponent/index.d.ts +0 -38
- package/es/FormComp/FieldComponent/index.js +0 -413
- package/es/FormComp/FieldComponent/setReadonlyValues.js +0 -236
- package/es/FormComp/FieldComponent/style/index.less +0 -116
- package/es/FormComp/RenderItemGroup/index.d.ts +0 -37
- package/es/FormComp/RenderItemGroup/index.js +0 -234
- package/es/FormComp/Uploader/index.d.ts +0 -19
- package/es/FormComp/Uploader/index.js +0 -275
- package/es/FormComp/Uploader/style/index.less +0 -14
- package/es/FormComp/Uploader/util.d.ts +0 -8
- package/es/FormComp/Uploader/util.js +0 -38
- package/es/FormComp/VarTemplate/index.js +0 -293
- package/es/FormComp/index.d.ts +0 -1
- package/es/FormComp/index.js +0 -1
- package/es/NavLeafScroll/index.js +0 -379
- package/es/NavLeafScroll/style/index.less +0 -119
- package/es/RefactorTree/data.d.ts +0 -7
- package/es/RefactorTree/index.d.ts +0 -40
- package/es/RefactorTree/index.js +0 -167
- package/es/RefactorTree/indexTreeNode.d.ts +0 -39
- package/es/RefactorTree/indexTreeNode.js +0 -237
- package/es/RefactorTree/style/index.d.ts +0 -1
- package/es/RefactorTree/style/index.js +0 -1
- package/es/RefactorTree/style/index.less +0 -22
- package/es/RefactorTree/util.d.ts +0 -42
- package/es/RefactorTree/util.js +0 -187
- package/es/SpecIcon/fonts/demo.css +0 -539
- package/es/SpecIcon/fonts/demo_index.html +0 -1315
- package/es/SpecIcon/fonts/iconfont.css +0 -211
- package/es/SpecIcon/fonts/iconfont.eot +0 -0
- package/es/SpecIcon/fonts/iconfont.js +0 -41
- package/es/SpecIcon/fonts/iconfont.json +0 -352
- package/es/SpecIcon/fonts/iconfont.svg +0 -173
- package/es/SpecIcon/fonts/iconfont.ttf +0 -0
- package/es/SpecIcon/fonts/iconfont.woff +0 -0
- package/es/SpecIcon/fonts/iconfont.woff2 +0 -0
- package/es/SpecIcon/index.d.ts +0 -17
- package/es/SpecIcon/index.js +0 -77
- package/es/SpecIcon/style/iconfont.less +0 -213
- package/es/SpecIcon/style/index.less +0 -98
- package/es/SplitterLayout/Pane.d.ts +0 -13
- package/es/SplitterLayout/Pane.js +0 -36
- package/es/SplitterLayout/index.js +0 -375
- package/es/SplitterLayout/index.less +0 -58
- package/es/StandardContent/SplitterLayout/Pane.js +0 -50
- package/es/StandardContent/SplitterLayout/index.js +0 -374
- package/es/StandardContent/SplitterLayout/index.less +0 -58
- package/es/StandardContent/SubfieldContent.d.ts +0 -17
- package/es/StandardContent/SubfieldContent.js +0 -41
- package/es/StandardContent/WrapperContent.d.ts +0 -13
- package/es/StandardContent/WrapperContent.js +0 -29
- package/es/StandardContent/data.d.ts +0 -101
- package/es/StandardContent/style/index.less +0 -80
- package/es/StandardDragModal/index.d.ts +0 -11
- package/es/StandardDragModal/index.js +0 -30
- package/es/StandardFilter/index.d.ts +0 -35
- package/es/StandardFilter/index.js +0 -253
- package/es/StandardFilter/style/index.less +0 -62
- package/es/StandardForm/ActionList.js +0 -44
- package/es/StandardForm/StepForm.d.ts +0 -19
- package/es/StandardForm/StepForm.js +0 -267
- package/es/StandardForm/TabForm.d.ts +0 -19
- package/es/StandardForm/TabForm.js +0 -122
- package/es/StandardForm/index.d.ts +0 -32
- package/es/StandardForm/index.js +0 -170
- package/es/StandardForm/style/index.less +0 -58
- package/es/StandardModal/UpdateFormRef.js +0 -18
- package/es/StandardModal/index.d.ts +0 -44
- package/es/StandardModal/index.js +0 -495
- package/es/StandardModal/style/index.less +0 -50
- package/es/StandardPanel/index.d.ts +0 -28
- package/es/StandardPanel/index.js +0 -134
- package/es/StandardPanel/style/index.less +0 -135
- package/es/StandardTable/index.d.ts +0 -22
- package/es/StandardTable/index.js +0 -126
- package/es/StandardTable/style/index.d.ts +0 -1
- package/es/StandardTable/style/index.js +0 -1
- package/es/StandardTable/style/index.less +0 -206
- package/es/components/IconNode/index.d.ts +0 -16
- package/es/components/IconNode/index.js +0 -28
- package/es/components/index.d.ts +0 -2
- package/es/components/index.js +0 -2
- package/es/data/func.code.js +0 -112
- package/es/data/general.config.js +0 -172
- package/es/data/index.js +0 -3
- package/es/index.d.ts +0 -24
- package/es/index.js +0 -31
- package/es/styles/index.less +0 -0
- package/es/theme/spec-variable.less +0 -48
- package/es/utils/ValueFormat.js +0 -50
- package/es/utils/filterPermission.js +0 -111
- package/es/utils/getParentNodes.js +0 -215
- package/es/utils/index.js +0 -3
- package/lib/ButtonGroup/ButtonList.d.ts +0 -2
- package/lib/ButtonGroup/ButtonList.js +0 -55
- package/lib/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/lib/ButtonGroup/ButtonMenu.js +0 -51
- package/lib/ButtonGroup/PopConfirmTitle.d.ts +0 -9
- package/lib/ButtonGroup/PopConfirmTitle.js +0 -48
- package/lib/ButtonGroup/index.d.ts +0 -30
- package/lib/ButtonGroup/index.js +0 -405
- package/lib/ButtonGroup/style/index.less +0 -36
- package/lib/DragContent/DragBar.js +0 -33
- package/lib/DragContent/index.d.ts +0 -14
- package/lib/DragContent/index.js +0 -191
- package/lib/DragContent/index.less +0 -44
- package/lib/FormComp/ChunkUploader/api.js +0 -89
- package/lib/FormComp/ChunkUploader/index.js +0 -410
- package/lib/FormComp/ChunkUploader/lib.js +0 -113
- package/lib/FormComp/ChunkUploader/style/style.less +0 -3
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +0 -174
- package/lib/FormComp/ChunkUploader/worker.js +0 -28
- package/lib/FormComp/EditButton/index.d.ts +0 -26
- package/lib/FormComp/EditButton/index.js +0 -159
- package/lib/FormComp/FieldComponent/ReUpload.d.ts +0 -3
- package/lib/FormComp/FieldComponent/ReUpload.js +0 -151
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +0 -268
- package/lib/FormComp/FieldComponent/TitleNode.d.ts +0 -6
- package/lib/FormComp/FieldComponent/TitleNode.js +0 -19
- package/lib/FormComp/FieldComponent/index.d.ts +0 -38
- package/lib/FormComp/FieldComponent/index.js +0 -457
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +0 -263
- package/lib/FormComp/FieldComponent/style/index.less +0 -116
- package/lib/FormComp/RenderItemGroup/index.d.ts +0 -37
- package/lib/FormComp/RenderItemGroup/index.js +0 -255
- package/lib/FormComp/Uploader/index.d.ts +0 -19
- package/lib/FormComp/Uploader/index.js +0 -301
- package/lib/FormComp/Uploader/style/index.less +0 -14
- package/lib/FormComp/Uploader/util.d.ts +0 -8
- package/lib/FormComp/Uploader/util.js +0 -47
- package/lib/FormComp/VarTemplate/index.js +0 -308
- package/lib/FormComp/index.d.ts +0 -1
- package/lib/FormComp/index.js +0 -15
- package/lib/NavLeafScroll/index.js +0 -397
- package/lib/NavLeafScroll/style/index.less +0 -119
- package/lib/RefactorTree/data.d.ts +0 -7
- package/lib/RefactorTree/index.d.ts +0 -40
- package/lib/RefactorTree/index.js +0 -190
- package/lib/RefactorTree/indexTreeNode.d.ts +0 -39
- package/lib/RefactorTree/indexTreeNode.js +0 -260
- package/lib/RefactorTree/style/index.d.ts +0 -1
- package/lib/RefactorTree/style/index.js +0 -3
- package/lib/RefactorTree/style/index.less +0 -22
- package/lib/RefactorTree/util.d.ts +0 -42
- package/lib/RefactorTree/util.js +0 -195
- package/lib/SpecIcon/fonts/demo.css +0 -539
- package/lib/SpecIcon/fonts/demo_index.html +0 -1315
- package/lib/SpecIcon/fonts/iconfont.css +0 -211
- package/lib/SpecIcon/fonts/iconfont.eot +0 -0
- package/lib/SpecIcon/fonts/iconfont.js +0 -43
- package/lib/SpecIcon/fonts/iconfont.json +0 -352
- package/lib/SpecIcon/fonts/iconfont.svg +0 -173
- package/lib/SpecIcon/fonts/iconfont.ttf +0 -0
- package/lib/SpecIcon/fonts/iconfont.woff +0 -0
- package/lib/SpecIcon/fonts/iconfont.woff2 +0 -0
- package/lib/SpecIcon/index.d.ts +0 -17
- package/lib/SpecIcon/index.js +0 -90
- package/lib/SpecIcon/style/iconfont.less +0 -213
- package/lib/SpecIcon/style/index.less +0 -98
- package/lib/SplitterLayout/Pane.d.ts +0 -13
- package/lib/SplitterLayout/Pane.js +0 -48
- package/lib/SplitterLayout/index.js +0 -386
- package/lib/SplitterLayout/index.less +0 -58
- package/lib/StandardContent/SplitterLayout/Pane.js +0 -62
- package/lib/StandardContent/SplitterLayout/index.js +0 -387
- package/lib/StandardContent/SplitterLayout/index.less +0 -58
- package/lib/StandardContent/SubfieldContent.d.ts +0 -17
- package/lib/StandardContent/SubfieldContent.js +0 -56
- package/lib/StandardContent/WrapperContent.d.ts +0 -13
- package/lib/StandardContent/WrapperContent.js +0 -43
- package/lib/StandardContent/data.d.ts +0 -101
- package/lib/StandardContent/style/index.less +0 -80
- package/lib/StandardDragModal/index.d.ts +0 -11
- package/lib/StandardDragModal/index.js +0 -43
- package/lib/StandardFilter/index.d.ts +0 -35
- package/lib/StandardFilter/index.js +0 -272
- package/lib/StandardFilter/style/index.less +0 -62
- package/lib/StandardForm/ActionList.js +0 -57
- package/lib/StandardForm/StepForm.d.ts +0 -19
- package/lib/StandardForm/StepForm.js +0 -295
- package/lib/StandardForm/TabForm.d.ts +0 -19
- package/lib/StandardForm/TabForm.js +0 -148
- package/lib/StandardForm/index.d.ts +0 -32
- package/lib/StandardForm/index.js +0 -197
- package/lib/StandardForm/style/index.less +0 -58
- package/lib/StandardModal/UpdateFormRef.js +0 -32
- package/lib/StandardModal/index.d.ts +0 -44
- package/lib/StandardModal/index.js +0 -525
- package/lib/StandardModal/style/index.less +0 -50
- package/lib/StandardPanel/index.d.ts +0 -28
- package/lib/StandardPanel/index.js +0 -155
- package/lib/StandardPanel/style/index.less +0 -135
- package/lib/StandardTable/index.d.ts +0 -22
- package/lib/StandardTable/index.js +0 -143
- package/lib/StandardTable/style/index.d.ts +0 -1
- package/lib/StandardTable/style/index.js +0 -3
- package/lib/StandardTable/style/index.less +0 -206
- package/lib/components/IconNode/index.d.ts +0 -16
- package/lib/components/IconNode/index.js +0 -39
- package/lib/components/index.d.ts +0 -2
- package/lib/components/index.js +0 -15
- package/lib/data/func.code.js +0 -119
- package/lib/data/general.config.js +0 -179
- package/lib/data/index.js +0 -23
- package/lib/index.d.ts +0 -24
- package/lib/index.js +0 -236
- package/lib/styles/index.less +0 -0
- package/lib/theme/spec-variable.less +0 -48
- package/lib/utils/ValueFormat.js +0 -58
- package/lib/utils/filterPermission.js +0 -127
- package/lib/utils/getParentNodes.js +0 -226
- package/lib/utils/index.js +0 -35
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
@root-entry-name: default;
|
|
2
|
-
@import (reference) '~antd/es/style/themes/index';
|
|
3
|
-
.spec-uploader {
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.ant-form-item-has-error {
|
|
8
|
-
.spec-uploader {
|
|
9
|
-
.ant-upload-list .ant-upload-list-picture-card,
|
|
10
|
-
.ant-upload-list-picture .ant-upload-list-item, .ant-upload-list-picture-card .ant-upload-list-item {
|
|
11
|
-
border-color: @error-color;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
interface baseResolveProps {
|
|
2
|
-
status?: string;
|
|
3
|
-
url?: any;
|
|
4
|
-
error?: any;
|
|
5
|
-
}
|
|
6
|
-
export declare function getBase64(file: any): Promise<baseResolveProps>;
|
|
7
|
-
export declare function getAccept(fileType: string): ".jpg,.png" | ".svg" | ".doc,.docx,.pdf,.xls,.xlsx" | ".rar,.zip" | ".rar,.zip,.doc,.docx,.pdf,.jpg,.png";
|
|
8
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export function getBase64(file) {
|
|
2
|
-
return new Promise(function (resolve) {
|
|
3
|
-
var reader = new FileReader();
|
|
4
|
-
reader.readAsDataURL(file);
|
|
5
|
-
|
|
6
|
-
reader.onload = function () {
|
|
7
|
-
return resolve({
|
|
8
|
-
status: 'success',
|
|
9
|
-
url: reader.result
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
reader.onerror = function (error) {
|
|
14
|
-
return resolve({
|
|
15
|
-
status: 'error',
|
|
16
|
-
error: error
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
export function getAccept(fileType) {
|
|
22
|
-
switch (fileType) {
|
|
23
|
-
case 'image':
|
|
24
|
-
return '.jpg,.png';
|
|
25
|
-
|
|
26
|
-
case 'svg':
|
|
27
|
-
return '.svg';
|
|
28
|
-
|
|
29
|
-
case 'office':
|
|
30
|
-
return '.doc,.docx,.pdf,.xls,.xlsx';
|
|
31
|
-
|
|
32
|
-
case 'zip':
|
|
33
|
-
return '.rar,.zip';
|
|
34
|
-
|
|
35
|
-
default:
|
|
36
|
-
return '.rar,.zip,.doc,.docx,.pdf,.jpg,.png';
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
|
-
|
|
3
|
-
import "antd/es/tag/style";
|
|
4
|
-
import _Tag from "antd/es/tag";
|
|
5
|
-
import "antd/es/input/style";
|
|
6
|
-
import _Input from "antd/es/input";
|
|
7
|
-
|
|
8
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
-
|
|
10
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
11
|
-
|
|
12
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
13
|
-
|
|
14
|
-
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); } }
|
|
15
|
-
|
|
16
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
17
|
-
|
|
18
|
-
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
19
|
-
|
|
20
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
|
-
|
|
22
|
-
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); }; }
|
|
23
|
-
|
|
24
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
25
|
-
|
|
26
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
27
|
-
|
|
28
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
29
|
-
|
|
30
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
31
|
-
|
|
32
|
-
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; }
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Created by S.C. on 2019/11/16.
|
|
36
|
-
*/
|
|
37
|
-
import React, { Component } from 'react';
|
|
38
|
-
var TextArea = _Input.TextArea;
|
|
39
|
-
var isIE = !!document.all;
|
|
40
|
-
|
|
41
|
-
var VarTemplate = /*#__PURE__*/function (_Component) {
|
|
42
|
-
_inherits(VarTemplate, _Component);
|
|
43
|
-
|
|
44
|
-
var _super = _createSuper(VarTemplate);
|
|
45
|
-
|
|
46
|
-
_createClass(VarTemplate, null, [{
|
|
47
|
-
key: "getDerivedStateFromProps",
|
|
48
|
-
value: function getDerivedStateFromProps(nextProps) {
|
|
49
|
-
// console.log('执行getDerivedStateFromProps', nextProps)
|
|
50
|
-
// Should be a controlled component.
|
|
51
|
-
if ('value' in nextProps) {
|
|
52
|
-
return _objectSpread({}, nextProps.value || {});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
}]);
|
|
58
|
-
|
|
59
|
-
function VarTemplate(props) {
|
|
60
|
-
var _this;
|
|
61
|
-
|
|
62
|
-
_classCallCheck(this, VarTemplate);
|
|
63
|
-
|
|
64
|
-
_this = _super.call(this, props);
|
|
65
|
-
|
|
66
|
-
_defineProperty(_assertThisInitialized(_this), "handleBlur", function (e) {
|
|
67
|
-
_this.getCurrentCursor();
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
_defineProperty(_assertThisInitialized(_this), "handleFocus", function (e) {// console.log('获取焦点')
|
|
71
|
-
// this.$emit('focus', event)
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
_defineProperty(_assertThisInitialized(_this), "handleInputChange", function (e) {
|
|
75
|
-
var onChange = _this.props.onChange;
|
|
76
|
-
|
|
77
|
-
_this.getCurrentCursor();
|
|
78
|
-
|
|
79
|
-
_this.setState({
|
|
80
|
-
currentContent: e.target.value,
|
|
81
|
-
startNum: e.target.value.length,
|
|
82
|
-
endNum: e.target.value.length,
|
|
83
|
-
wordCount: e.target.value.length
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
if (onChange) onChange(e.target.value);
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
_defineProperty(_assertThisInitialized(_this), "setTagWords", function (key) {
|
|
90
|
-
var onChange = _this.props.onChange;
|
|
91
|
-
var _this$state = _this.state,
|
|
92
|
-
currentContent = _this$state.currentContent,
|
|
93
|
-
startNum = _this$state.startNum,
|
|
94
|
-
endNum = _this$state.endNum;
|
|
95
|
-
|
|
96
|
-
_this.setState({
|
|
97
|
-
currentContent: _this.insertContent(currentContent, key, startNum, endNum),
|
|
98
|
-
startNum: startNum + key.length,
|
|
99
|
-
// 光标起始位置累加
|
|
100
|
-
endNum: endNum + key.length,
|
|
101
|
-
// 光标起始位置累加
|
|
102
|
-
wordCount: _this.insertContent(currentContent, key, startNum, endNum).length
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
if (onChange) onChange(_this.insertContent(currentContent, key, startNum, endNum));
|
|
106
|
-
setTimeout(function () {
|
|
107
|
-
_this.moveToCursor(); // 重新定位光标
|
|
108
|
-
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
_defineProperty(_assertThisInitialized(_this), "insertContent", function (str, insertStr, start, end) {
|
|
113
|
-
if (start !== end) {
|
|
114
|
-
var _prevStr = str.substring(0, start);
|
|
115
|
-
|
|
116
|
-
var _nextStr = str.substring(end, str.length);
|
|
117
|
-
|
|
118
|
-
return _prevStr + insertStr + _nextStr;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
var prevStr = str.substring(0, start);
|
|
122
|
-
var nextStr = str.substring(start, str.length);
|
|
123
|
-
return prevStr + insertStr + nextStr;
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
_defineProperty(_assertThisInitialized(_this), "getCurrentCursor", function () {
|
|
127
|
-
var start = 0;
|
|
128
|
-
var end = 0;
|
|
129
|
-
|
|
130
|
-
var oTextarea = _this.content.querySelector('textarea'); // 获取textarea标签
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (isIE) {
|
|
134
|
-
// selection 当前激活选中区,即高亮文本块,和/或文当中用户可执行某些操作的其它元素。
|
|
135
|
-
// createRange 从当前文本选中区中创建 TextRange 对象,
|
|
136
|
-
// 或从控件选中区中创建 controlRange 集合。
|
|
137
|
-
var sTextRange = document.selection.createRange(); // 判断选中的是不是textarea对象
|
|
138
|
-
|
|
139
|
-
if (sTextRange.parentElement() === oTextarea) {
|
|
140
|
-
// 创建一个TextRange对象
|
|
141
|
-
var oTextRange = document.body.createTextRange(); // 移动文本范围以便范围的开始和结束位置能够完全包含给定元素的文本。
|
|
142
|
-
|
|
143
|
-
oTextRange.moveToElementText(oTextarea); // 这里我们比较oTextRange和sTextRange的开头,的到选中区域的开头位置
|
|
144
|
-
|
|
145
|
-
for (start = 0; oTextRange.compareEndPoints('StartToStart', sTextRange) < 0; start++) {
|
|
146
|
-
oTextRange.moveStart('character', 1);
|
|
147
|
-
} // 需要计算一下\n的数目(按字符移动的方式不计\n,所以这里加上)
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
for (var i = 0; i <= start; i++) {
|
|
151
|
-
if (oTextarea.value.charAt(i) === '\n') {
|
|
152
|
-
start++;
|
|
153
|
-
}
|
|
154
|
-
} // 再计算一次结束的位置
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
oTextRange.moveToElementText(oTextarea);
|
|
158
|
-
|
|
159
|
-
for (end = 0; oTextRange.compareEndPoints('StartToEnd', sTextRange) < 0; end++) {
|
|
160
|
-
oTextRange.moveStart('character', 1);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
for (var j = 0; j <= end; j++) {
|
|
164
|
-
if (oTextarea.value.charAt(j) === '\n') {
|
|
165
|
-
end++;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
} else {
|
|
170
|
-
start = oTextarea.selectionStart;
|
|
171
|
-
end = oTextarea.selectionEnd;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
_this.setState({
|
|
175
|
-
startNum: start,
|
|
176
|
-
endNum: end
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
_defineProperty(_assertThisInitialized(_this), "moveToCursor", function () {
|
|
181
|
-
var _this$state2 = _this.state,
|
|
182
|
-
startNum = _this$state2.startNum,
|
|
183
|
-
endNum = _this$state2.endNum;
|
|
184
|
-
|
|
185
|
-
var oTextarea = _this.content.querySelector('textarea');
|
|
186
|
-
|
|
187
|
-
var start = startNum;
|
|
188
|
-
var end = endNum;
|
|
189
|
-
|
|
190
|
-
if (isNaN(start) || isNaN(end)) {
|
|
191
|
-
alert('位置输入错误');
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
if (isIE) {
|
|
195
|
-
var oTextRange = oTextarea.createTextRange();
|
|
196
|
-
var LStart = startNum;
|
|
197
|
-
var LEnd = endNum;
|
|
198
|
-
var _start = 0;
|
|
199
|
-
var _end = 0;
|
|
200
|
-
var value = oTextarea.value;
|
|
201
|
-
|
|
202
|
-
for (var i = 0; i < value.length && i < LStart; i++) {
|
|
203
|
-
var c = value.charAt(i);
|
|
204
|
-
|
|
205
|
-
if (c !== '\n') {
|
|
206
|
-
_start++;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
for (var j = value.length - 1; j >= LEnd && j >= 0; j--) {
|
|
211
|
-
var _c = value.charAt(j);
|
|
212
|
-
|
|
213
|
-
if (_c !== '\n') {
|
|
214
|
-
_end++;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
oTextRange.moveStart('character', _start);
|
|
219
|
-
oTextRange.moveEnd('character', -_end); // oTextRange.collapse(true);
|
|
220
|
-
|
|
221
|
-
oTextRange.select();
|
|
222
|
-
oTextarea.focus();
|
|
223
|
-
} else {
|
|
224
|
-
oTextarea.select();
|
|
225
|
-
oTextarea.selectionStart = startNum;
|
|
226
|
-
oTextarea.selectionEnd = endNum;
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
var _value = props.value || '';
|
|
231
|
-
|
|
232
|
-
_this.state = {
|
|
233
|
-
currentContent: _value,
|
|
234
|
-
startNum: _value.length,
|
|
235
|
-
// 光标开始位置(当选中文本时)
|
|
236
|
-
endNum: _value.length,
|
|
237
|
-
// 光标结束位置(当选中文本时)
|
|
238
|
-
wordCount: _value.length // 输入框内的字符数总和(包含占位符所需要的长度)
|
|
239
|
-
|
|
240
|
-
};
|
|
241
|
-
_this.content = /*#__PURE__*/React.createRef();
|
|
242
|
-
return _this;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
_createClass(VarTemplate, [{
|
|
246
|
-
key: "render",
|
|
247
|
-
value: function render() {
|
|
248
|
-
var _this2 = this;
|
|
249
|
-
|
|
250
|
-
var _this$props = this.props,
|
|
251
|
-
size = _this$props.size,
|
|
252
|
-
style = _this$props.style,
|
|
253
|
-
tags = _this$props.tags,
|
|
254
|
-
disabled = _this$props.disabled;
|
|
255
|
-
var _this$state3 = this.state,
|
|
256
|
-
currentContent = _this$state3.currentContent,
|
|
257
|
-
wordCount = _this$state3.wordCount;
|
|
258
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
259
|
-
className: "vart-wrap",
|
|
260
|
-
style: style,
|
|
261
|
-
ref: function ref(cRef) {
|
|
262
|
-
_this2.content = cRef;
|
|
263
|
-
}
|
|
264
|
-
}, tags && Array.isArray(tags) && /*#__PURE__*/React.createElement("div", {
|
|
265
|
-
className: "vart-header"
|
|
266
|
-
}, tags.map(function (item) {
|
|
267
|
-
return /*#__PURE__*/React.createElement(_Tag, {
|
|
268
|
-
key: item.id,
|
|
269
|
-
onClick: function onClick() {
|
|
270
|
-
return !disabled && _this2.setTagWords(item.variableNameFormatted);
|
|
271
|
-
}
|
|
272
|
-
}, item.variableName);
|
|
273
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
274
|
-
className: "vart-input"
|
|
275
|
-
}, /*#__PURE__*/React.createElement(TextArea, {
|
|
276
|
-
type: "text",
|
|
277
|
-
size: size,
|
|
278
|
-
value: currentContent,
|
|
279
|
-
placeholder: "\u8BF7\u8F93\u5165",
|
|
280
|
-
onFocus: this.handleFocus,
|
|
281
|
-
onBlur: this.handleBlur,
|
|
282
|
-
onChange: function onChange(e) {
|
|
283
|
-
return _this2.handleInputChange(e);
|
|
284
|
-
},
|
|
285
|
-
disabled: disabled
|
|
286
|
-
})));
|
|
287
|
-
}
|
|
288
|
-
}]);
|
|
289
|
-
|
|
290
|
-
return VarTemplate;
|
|
291
|
-
}(Component);
|
|
292
|
-
|
|
293
|
-
export default VarTemplate;
|
package/es/FormComp/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Uploader } from './Uploader';
|
package/es/FormComp/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Uploader } from './Uploader';
|