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