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,263 +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.setUploaderValue = exports.setTimePickerValue = exports.setDatePickerValue = exports.setSelectValue = exports.setCascaderValue = void 0;
9
-
10
- require("antd/es/image/style");
11
-
12
- var _image = _interopRequireDefault(require("antd/es/image"));
13
-
14
- var _react = _interopRequireWildcard(require("react"));
15
-
16
- var _moment = _interopRequireDefault(require("moment"));
17
-
18
- var _util = require("../Uploader/util");
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
27
-
28
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
29
-
30
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
31
-
32
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
33
-
34
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
35
-
36
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
37
-
38
- // 设置纯展示模式下的级联选择显示值
39
- var setCascaderValue = function setCascaderValue(value, props) {
40
- var selectOptions = props.selectOptions,
41
- defaultProps = props.defaultProps;
42
- if (!value || value.length === 0 || !selectOptions) return '-'; // 无值情况 下
43
-
44
- var matchNode = undefined;
45
- var matchValueItems = [];
46
- value.forEach(function (valKey) {
47
- var matchValue; // 第一个值使用 ‘selectOptions’查找,后面使用上一次匹配到的父节点查找 matchNode
48
-
49
- if (matchNode && matchNode.children) {
50
- matchValue = matchNode.children.filter(function (seItem) {
51
- return seItem.value == valKey;
52
- });
53
- } else {
54
- matchValue = selectOptions.filter(function (seItem) {
55
- return seItem.value == valKey;
56
- });
57
- }
58
-
59
- if (matchValue.length > 0) {
60
- matchNode = matchValue[0];
61
- matchValueItems.push(matchValue[0]);
62
- }
63
- }); // 如果自定义"选择后展示的渲染函数"则直接返回此选择方法
64
-
65
- if (defaultProps.displayRender) return defaultProps.displayRender(matchValueItems.map(function (item) {
66
- return item.label;
67
- }), matchValueItems);
68
- return matchValueItems.map(function (item) {
69
- return item.label;
70
- }).join('/');
71
- }; // 设置纯展示模式下的下拉、单选、多选表单值
72
-
73
-
74
- exports.setCascaderValue = setCascaderValue;
75
-
76
- var setSelectValue = function setSelectValue(value, props) {
77
- var selectOptions = props.selectOptions,
78
- selectOptionRender = props.selectOptionRender,
79
- defaultProps = props.defaultProps,
80
- type = props.type,
81
- separator = props.separator;
82
- var labelInValue = defaultProps.labelInValue;
83
- if (!value && value !== 0 || !selectOptions) return '-'; // 无值情况 下
84
- // 数组情况
85
-
86
- if (Array.isArray(value)) {
87
- if (value.length == 0) {
88
- return '-'; // 无值情况 下
89
- } // 返回是数组
90
-
91
-
92
- var matchValues = [];
93
- value.forEach(function (valKey, index) {
94
- var matchValue = selectOptions.filter(function (seItem) {
95
- return seItem.value == (labelInValue ? valKey.value : valKey);
96
- });
97
-
98
- if (matchValue.length > 0) {
99
- // 如果 select 配置选项展示内容,则直接使用其配置值展示当前只读信息
100
- if (selectOptionRender) {
101
- matchValues.push( /*#__PURE__*/_react.default.createElement("div", {
102
- key: index,
103
- className: "checkbox-viewonly-item"
104
- }, selectOptionRender(matchValue[0]), value.length - 1 > index ? separator ? separator : separator == null ? '' : ',' : ''));
105
- } else {
106
- matchValues.push(matchValue[0].label);
107
- }
108
- }
109
- }); // 如果 select 配置选项展示内容,则直接使用其配置值展示当前只读信息
110
-
111
- if (selectOptionRender) {
112
- return /*#__PURE__*/_react.default.createElement("div", {
113
- className: "checkbox-viewonly-list"
114
- }, matchValues);
115
- }
116
-
117
- return matchValues.join(separator ? separator : ',');
118
- } else {
119
- // 如select配置labelInValue则value返回数据是对象{key: 'xxx'}
120
- var matchValue = selectOptions.filter(function (seItem) {
121
- return seItem.value == (labelInValue ? value.value : value);
122
- }); // 如果 select 配置选项展示内容,则直接使用其配置值展示当前只读信息
123
-
124
- if (selectOptionRender) {
125
- return matchValue.length > 0 ? selectOptionRender(matchValue[0]) : '-';
126
- }
127
-
128
- return matchValue.length > 0 ? matchValue[0].label : '-';
129
- }
130
- }; // 设置纯展示模式下的日期控件值
131
-
132
-
133
- exports.setSelectValue = setSelectValue;
134
-
135
- var setDatePickerValue = function setDatePickerValue(value, props) {
136
- var type = props.type,
137
- protoConfig = props.protoConfig;
138
- if (!value && value !== 0) return '-'; // 无值情况 下
139
- // 数组情况 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'
140
-
141
- switch (type) {
142
- case 'datePicker':
143
- return (0, _moment.default)(value).format(protoConfig && protoConfig.format || 'YYYY-MM-DD');
144
- break;
145
-
146
- case 'dateTimePicker':
147
- return (0, _moment.default)(value).format(protoConfig && protoConfig.format || 'YYYY-MM-DD HH:mm:ss');
148
- break;
149
-
150
- case 'rangePicker':
151
- return "".concat((0, _moment.default)(value[0]).format(protoConfig && protoConfig.format || 'YYYY-MM-DD'), " - ").concat((0, _moment.default)(value[1]).format(protoConfig && protoConfig.format || 'YYYY-MM-DD'));
152
- break;
153
-
154
- case 'rangeTimePicker':
155
- return "".concat((0, _moment.default)(value[0]).format(protoConfig && protoConfig.format || 'YYYY-MM-DD HH:mm:ss'), " - ").concat((0, _moment.default)(value[1]).format(protoConfig && protoConfig.format || 'YYYY-MM-DD HH:mm:ss'));
156
- break;
157
-
158
- case 'monthPicker':
159
- return (0, _moment.default)(value).format(protoConfig && protoConfig.format || 'MM月');
160
- break;
161
-
162
- default:
163
- return '-';
164
- break;
165
- }
166
- }; // 设置纯展示模式下的时间控件值
167
-
168
-
169
- exports.setDatePickerValue = setDatePickerValue;
170
-
171
- var setTimePickerValue = function setTimePickerValue(value, props) {
172
- var type = props.type,
173
- protoConfig = props.protoConfig;
174
- if (!value && value !== 0) return '-'; // 无值情况 下
175
-
176
- switch (type) {
177
- case 'timePicker':
178
- return (0, _moment.default)(value).format(protoConfig && protoConfig.format || 'HH:mm:ss');
179
- break;
180
-
181
- case 'timePickerRange':
182
- return "".concat((0, _moment.default)(value[0]).format(protoConfig && protoConfig.format || 'HH:mm:ss'), " - ").concat((0, _moment.default)(value[1]).format(protoConfig && protoConfig.format || 'HH:mm:ss'));
183
- break;
184
-
185
- default:
186
- return '-';
187
- break;
188
- }
189
- }; // 设置纯展示模式下上传控件显示值
190
-
191
-
192
- exports.setTimePickerValue = setTimePickerValue;
193
-
194
- var setUploaderValue = function setUploaderValue(value, props) {
195
- if (!value && value !== 0) return '-'; // 无值情况 下
196
-
197
- if (Array.isArray(value)) {
198
- var _useState = (0, _react.useState)(),
199
- _useState2 = _slicedToArray(_useState, 2),
200
- previews = _useState2[0],
201
- setPreviews = _useState2[1];
202
-
203
- (0, _react.useEffect)(function () {
204
- var previewsUlr = [];
205
- value.forEach(function (vItem) {
206
- if (vItem === null || vItem === void 0 ? void 0 : vItem.downloadUrl) {
207
- previewsUlr.push({
208
- url: vItem.downloadUrl
209
- });
210
- setPreviews(previewsUlr.filter(function (pItem) {
211
- return pItem;
212
- }));
213
- } else {
214
- if (vItem === null || vItem === void 0 ? void 0 : vItem.originFileObj) (0, _util.getBase64)(vItem.originFileObj).then(function (result) {
215
- previewsUlr.push(result);
216
- setPreviews(previewsUlr.filter(function (pItem) {
217
- return pItem;
218
- }));
219
- return result;
220
- });
221
- }
222
- });
223
- }, [value]);
224
- return /*#__PURE__*/_react.default.createElement("div", {
225
- className: 'spec-uploader-viewonly'
226
- }, /*#__PURE__*/_react.default.createElement(_image.default.PreviewGroup, null, previews && (previews === null || previews === void 0 ? void 0 : previews.map(function (item, index) {
227
- return (item === null || item === void 0 ? void 0 : item.url) ? /*#__PURE__*/_react.default.createElement(_image.default, {
228
- key: index,
229
- width: 100,
230
- height: 100,
231
- style: {
232
- objectFit: 'contain'
233
- },
234
- src: item.url
235
- }) : /*#__PURE__*/_react.default.createElement("div", {
236
- key: index,
237
- className: "spec-uploader-viewonly-item"
238
- }, "\u6682\u65E0\u56FE\u7247");
239
- }))));
240
- } else {
241
- var _useState3 = (0, _react.useState)(),
242
- _useState4 = _slicedToArray(_useState3, 2),
243
- preview = _useState4[0],
244
- setPreview = _useState4[1];
245
-
246
- (0, _react.useEffect)(function () {
247
- (0, _util.getBase64)(value).then(function (result) {
248
- setPreview(result);
249
- });
250
- }, [value]);
251
- return /*#__PURE__*/_react.default.createElement("div", {
252
- className: "spec-uploader-viewonly"
253
- }, preview ? /*#__PURE__*/_react.default.createElement(_image.default, {
254
- style: {
255
- objectFit: 'contain'
256
- },
257
- width: 100,
258
- src: preview === null || preview === void 0 ? void 0 : preview.url
259
- }) : '暂无图片');
260
- }
261
- };
262
-
263
- exports.setUploaderValue = setUploaderValue;
@@ -1,116 +0,0 @@
1
- @root-entry-name: default;
2
- @import (reference) '~antd/es/style/themes/index';
3
-
4
- .refactor-tree-select {
5
- position: relative;
6
- .ant-select {
7
- z-index: 2;
8
- .ant-select-selector {
9
- background: transparent;
10
- }
11
- .ant-select-selection-item {
12
- //opacity: 0;
13
- display: none;
14
- }
15
- &.ant-select-disabled.ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
16
- background: transparent;
17
- }
18
-
19
- //.ant-select-disabled.ant-select-single:not(.ant-select-customize-input) ~ .refactor-tree-select-extra{
20
- //}
21
- }
22
- &.refactor-disabled .refactor-tree-select-extra {
23
- background: @disabled-bg;
24
- color: @disabled-color;
25
- }
26
- .refactor-tree-select-extra {
27
- width: 100%;
28
- background: @component-background;
29
- position: absolute;
30
- top: 0;
31
- left: 0;
32
- bottom: 0;
33
- height: @input-height-base;
34
- z-index: 1;
35
- padding: 1px 22px 1px 8px;
36
- line-height: 30px;
37
- overflow: hidden;
38
- text-overflow: ellipsis;
39
- white-space: nowrap;
40
- }
41
- }
42
-
43
- .spec-uploader-viewonly {
44
- display: inline-block;
45
- width: 100%;
46
- &:after {
47
- display: table;
48
- clear: both;
49
- content: '';
50
- }
51
- .spec-uploader-viewonly-item {
52
- float: left;
53
- width: 100px;
54
- height: 100px;
55
- padding: @padding-xs;
56
- margin-right: @padding-xs;
57
- margin-bottom: @padding-xs;
58
- border: 1px solid @border-color-base;
59
- border-radius: @border-radius-sm;
60
- line-height: 88px;
61
- text-align: center;
62
- background: transparent;
63
- img {
64
- width: 100%;
65
- height: 100%;
66
- }
67
- }
68
- .ant-image +.ant-image{
69
- margin-left: 5px;
70
- }
71
- }
72
-
73
- // 下拉树只读列表
74
- .tree-select-viewonly-list {
75
- position: relative;
76
- width: 100%;
77
- border: 1px solid fade(@border-color-split, 60%);
78
- border-radius: @border-radius-sm;
79
- padding: @padding-xs @padding-sm;
80
- &.collapsed {
81
- padding-bottom: 28px;
82
- }
83
- .tree-select-viewonly-item b {
84
- font-size: 18px;
85
- }
86
- .toggle-icon {
87
- position: absolute;
88
- bottom: 0;
89
- left: 0;
90
- width: 100%;
91
- height: 28px;
92
- line-height: 28px;
93
- text-align: center;
94
- font-size: @font-size-sm;
95
- cursor: pointer;
96
- color: @text-color-secondary;
97
- //color: color(~`colorPalette('@{text-color-secondary}', 3) `);
98
- background-image: -webkit-gradient(linear, left top, left bottom, from(fade(@component-background, 0)), to(@component-background));
99
- background-image: -webkit-linear-gradient(top, fade(@component-background, 0), @component-background);
100
- background-image: linear-gradient(-180deg, fade(@component-background, 0), @component-background);
101
- &:hover {
102
- color: @primary-color;
103
- }
104
- }
105
- }
106
-
107
- .checkbox-viewonly-item{
108
- display: inline ;
109
- }
110
-
111
-
112
- .upload-viewonly {
113
- .ant-upload-select.ant-upload-disabled {
114
- display: none;
115
- }
116
- }
@@ -1,37 +0,0 @@
1
- import React from "react";
2
- import { FieldComponentProps } from '../FieldComponent';
3
- export interface FieldsItemProps extends FieldComponentProps {
4
- label?: string | React.ReactNode;
5
- description?: string;
6
- isHide?: (fields?: any, form?: any, fieldStatus?: string) => boolean | boolean;
7
- customRender?: (form?: any, data?: FieldsItemProps, fieldStatus?: string) => React.ReactNode;
8
- colSpan?: number;
9
- display?: string | object;
10
- protoFormItem?: object;
11
- preExtra?: (config?: any, form?: any) => React.ReactNode;
12
- extra?: (config?: any, form?: any) => React.ReactNode;
13
- rules?: any;
14
- fieldOptions?: any;
15
- size?: 'large' | 'middle' | 'small' | string;
16
- componentStyle?: React.CSSProperties;
17
- }
18
- interface layoutProps {
19
- labelCol?: any;
20
- wrapperCol?: any;
21
- }
22
- interface displayLayoutProps extends layoutProps {
23
- side?: layoutProps;
24
- block?: layoutProps;
25
- }
26
- interface ItemGroupProps {
27
- itemGroup: any | FieldsItemProps[];
28
- size?: string;
29
- fieldStatus?: 'default' | 'viewOnly' | 'disabled';
30
- fieldSize?: 'large' | 'middle' | 'small' | any;
31
- displayLayout?: displayLayoutProps;
32
- form?: any;
33
- layout?: string;
34
- doUpdateFormFields?: () => void;
35
- }
36
- declare const RenderItemGroup: (props: ItemGroupProps) => any;
37
- export default RenderItemGroup;
@@ -1,255 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- require("antd/es/row/style");
9
-
10
- var _row = _interopRequireDefault(require("antd/es/row"));
11
-
12
- require("antd/es/tooltip/style");
13
-
14
- var _tooltip = _interopRequireDefault(require("antd/es/tooltip"));
15
-
16
- require("antd/es/col/style");
17
-
18
- var _col = _interopRequireDefault(require("antd/es/col"));
19
-
20
- require("antd/es/form/style");
21
-
22
- var _form = _interopRequireDefault(require("antd/es/form"));
23
-
24
- var _react = _interopRequireDefault(require("react"));
25
-
26
- var _data = require("../../data");
27
-
28
- var _FieldComponent = _interopRequireDefault(require("../FieldComponent"));
29
-
30
- var _SpecIcon = _interopRequireDefault(require("../../SpecIcon"));
31
-
32
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
-
34
- 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); }
35
-
36
- var FormItem = _form.default.Item;
37
-
38
- var RenderItemGroup = function RenderItemGroup(props) {
39
- var itemGroup = props.itemGroup,
40
- _props$size = props.size,
41
- size = _props$size === void 0 ? 'md' : _props$size,
42
- _props$fieldStatus = props.fieldStatus,
43
- fieldStatus = _props$fieldStatus === void 0 ? 'default' : _props$fieldStatus,
44
- _props$fieldSize = props.fieldSize,
45
- fieldSize = _props$fieldSize === void 0 ? 'middle' : _props$fieldSize,
46
- displayLayout = props.displayLayout,
47
- form = props.form,
48
- doUpdateFormFields = props.doUpdateFormFields,
49
- _props$layout = props.layout,
50
- layout = _props$layout === void 0 ? "horizontal" : _props$layout;
51
-
52
- var setColSpan = function setColSpan(display, modalSize) {
53
- if (_typeof(display) === 'object' || display === 'block' || modalSize === 'xs' || modalSize === 'sm') {
54
- return 24;
55
- }
56
-
57
- if (modalSize === 'lg' || modalSize === 'xlg') {
58
- return 8;
59
- }
60
-
61
- return 12;
62
- };
63
-
64
- var updateFormFields = function updateFormFields() {
65
- // if (newVal) form && form.setFieldsValue({ ...newVal })
66
- if (doUpdateFormFields) doUpdateFormFields(); // 用于触发更新表单实例赋值
67
- }; // useEffect(() => {
68
- // // updateFormFields()
69
- // }, [form])
70
- // 渲染隐藏指定控件
71
-
72
-
73
- var itemIsHide = function itemIsHide(isHide, getFieldsValue, FormInstance) {
74
- if (typeof isHide === 'function') {
75
- return isHide(getFieldsValue, FormInstance, fieldStatus);
76
- }
77
-
78
- return isHide || false;
79
- }; // 渲染表单控件
80
-
81
-
82
- var renderFormField = function renderFormField(field) {
83
- var componentStyle = field.componentStyle,
84
- extra = field.extra,
85
- preExtra = field.preExtra; // 当前可传参的配置值
86
- // 带前缀或后缀控件渲染
87
-
88
- if (preExtra || extra) {
89
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, preExtra ? preExtra(field, form) : '', /*#__PURE__*/_react.default.createElement(FormItem, {
90
- noStyle: true,
91
- rules: field.rules || (field.fieldOptions ? field.fieldOptions.rules : []),
92
- name: field.filedName
93
- }, /*#__PURE__*/_react.default.createElement(_FieldComponent.default, Object.assign({}, field, {
94
- onChange: function onChange(eOrValue) {
95
- updateFormFields();
96
-
97
- for (var _len = arguments.length, otherParams = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
98
- otherParams[_key - 1] = arguments[_key];
99
- }
100
-
101
- if (field.onChange) field.onChange.apply(field, [eOrValue].concat(otherParams));
102
- },
103
- fieldStatus: field.fieldStatus || fieldStatus,
104
- size: field.protoConfig && field.protoConfig.size || field.size || fieldSize,
105
- style: componentStyle || Object.assign({}, _data.general.formItemStyle.wide)
106
- }))), extra ? extra(field, form) : '');
107
- } else {
108
- return /*#__PURE__*/_react.default.createElement(_FieldComponent.default, Object.assign({}, field, {
109
- onChange: function onChange(eOrValue) {
110
- // let updateValue = val
111
- // if (field.type === 'input' || field.type === 'textarea' || field.type === 'radio' || field.type === 'password') {
112
- // updateValue = val.target.value
113
- // }
114
- // updateFormFields({ [field.filedName]: updateValue })
115
- updateFormFields(); // if (field.onChange) field.onChange(val, form)
116
-
117
- for (var _len2 = arguments.length, otherParams = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
118
- otherParams[_key2 - 1] = arguments[_key2];
119
- }
120
-
121
- if (field.onChange) field.onChange.apply(field, [eOrValue].concat(otherParams));
122
- },
123
- fieldStatus: field.fieldStatus || fieldStatus,
124
- size: field.protoConfig && field.protoConfig.size || field.size || fieldSize,
125
- style: componentStyle || Object.assign({}, _data.general.formItemStyle.wide)
126
- }));
127
- }
128
- };
129
-
130
- var renderColFormItem = function renderColFormItem(item, index, formLayout) {
131
- var label = item.label,
132
- description = item.description,
133
- type = item.type,
134
- customRender = item.customRender,
135
- filedName = item.filedName; // 当前可传参的配置值
136
-
137
- if (layout === "horizontal") {
138
- return /*#__PURE__*/_react.default.createElement(_col.default, {
139
- key: index,
140
- span: item.colSpan || setColSpan(item.display, size)
141
- }, /*#__PURE__*/_react.default.createElement(FormItem, Object.assign({
142
- name: type !== 'custom' && filedName,
143
- className: fieldStatus === 'viewOnly' ? 'form-item-view-only' : '',
144
- label: description ? /*#__PURE__*/_react.default.createElement("span", null, label, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
145
- title: description
146
- }, /*#__PURE__*/_react.default.createElement(_SpecIcon.default, {
147
- name: "info"
148
- }))) : label,
149
- rules: item.preExtra || item.extra ? [] : item.rules || (item.fieldOptions ? item.fieldOptions.rules : []),
150
- required: item.rules && item.rules.filter(function (rItem) {
151
- return rItem.required;
152
- }).length > 0
153
- }, formLayout, item.protoFormItem), type === 'custom' && customRender ? customRender(form, Object.assign({}, item), fieldStatus) : renderFormField(Object.assign({}, item))));
154
- } else {
155
- return /*#__PURE__*/_react.default.createElement(FormItem, Object.assign({
156
- key: index,
157
- name: type !== 'custom' && filedName,
158
- className: fieldStatus === 'viewOnly' ? 'form-item-view-only' : '',
159
- label: description ? /*#__PURE__*/_react.default.createElement("span", null, label, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
160
- title: description
161
- }, /*#__PURE__*/_react.default.createElement(_SpecIcon.default, {
162
- name: "info"
163
- }))) : label,
164
- rules: item.rules || (item.fieldOptions ? item.fieldOptions.rules : [])
165
- }, formLayout, item.protoFormItem), type === 'custom' && customRender ? customRender(form, Object.assign({}, item), fieldStatus) : renderFormField(Object.assign({}, item)));
166
- }
167
- }; // 渲染表单控件列表
168
-
169
-
170
- var renderItemGroupNode = function renderItemGroupNode() {
171
- return itemGroup.map(function (item, index) {
172
- var label = item.label,
173
- isHide = item.isHide,
174
- type = item.type,
175
- _item$display = item.display,
176
- display = _item$display === void 0 ? 'side' : _item$display; // 当前可传参的配置值
177
-
178
- var formLayout = {}; // if (displayLayout) {
179
- // // 如果未配置,则使用以下配置值
180
- // formLayout = { ...displayLayout }
181
- // }
182
- // 优先级 displayLayout.side > displayLayout > general
183
- // 优先级:若有displayLayout.block 则直接使用 general > displayLayout
184
-
185
- formLayout = (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.side) || ((displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.block) ? _data.general.modalSize[size].formLayout : !displayLayout || JSON.stringify(displayLayout) === '{}' ? _data.general.modalSize[size].formLayout : displayLayout);
186
-
187
- if (item.hasOwnProperty('display')) {
188
- if (typeof display === 'string') {
189
- if (display === 'block') {
190
- formLayout = (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.block) || _data.general.modalSize[size].formBlockLayout;
191
- } else {// 使用默认
192
- // formLayout = displayLayout?.side || (displayLayout?.block ? general.modalSize[size].formLayout : displayLayout) || general.modalSize[size].formLayout
193
- }
194
- } else {
195
- formLayout = item.display; // 对象类型传值如: {labelCol: {span: 3},wrapperCol: {span: 8}} 优先级最高
196
- }
197
- } // 当布局为 'vertical'或'inline'时,不配置栅格结构
198
-
199
-
200
- if (layout !== 'horizontal') {
201
- formLayout = {};
202
- } // title标题或html渲染
203
-
204
-
205
- if (type === 'title' || type === 'html') {
206
- return /*#__PURE__*/_react.default.createElement(FormItem, {
207
- key: index,
208
- noStyle: true,
209
- shouldUpdate: true
210
- }, function (FormInstance) {
211
- var _a; // isHide 返回为true则隐藏当前控件
212
-
213
-
214
- return !itemIsHide(isHide, FormInstance.getFieldValue(), FormInstance) ? /*#__PURE__*/_react.default.createElement(_col.default, {
215
- span: item.colSpan || 24
216
- }, type === 'title' ? /*#__PURE__*/_react.default.createElement("h3", Object.assign({
217
- className: "modalPanelTitle ".concat((_a = item === null || item === void 0 ? void 0 : item.protoConfig) === null || _a === void 0 ? void 0 : _a.className)
218
- }, item.protoConfig), label) : label) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, null);
219
- });
220
- } // 判断是否强制重新渲染表单
221
-
222
-
223
- if (item.protoFormItem && item.protoFormItem.shouldUpdate) {
224
- return /*#__PURE__*/_react.default.createElement(FormItem, {
225
- key: index,
226
- noStyle: true,
227
- shouldUpdate: item.protoFormItem.shouldUpdate
228
- }, function (FormInstance) {
229
- // isHide 返回为true则隐藏当前控件
230
- return !itemIsHide(isHide, FormInstance.getFieldValue(), FormInstance) ? renderColFormItem(item, index, formLayout) : null;
231
- });
232
- }
233
-
234
- return renderColFormItem(item, index, formLayout);
235
- });
236
- }; // itemGroup = Array 则按以下结构渲染
237
-
238
-
239
- if (itemGroup && Array.isArray(itemGroup)) {
240
- // 布局配置为'vertical或inline'
241
- if (layout !== 'horizontal') {
242
- return renderItemGroupNode();
243
- } // 布局配置为horizontal
244
-
245
-
246
- return /*#__PURE__*/_react.default.createElement(_row.default, null, renderItemGroupNode());
247
- }
248
- /* itemGroup = ReactNode则直接返回 */
249
-
250
-
251
- return itemGroup;
252
- };
253
-
254
- var _default = RenderItemGroup;
255
- exports.default = _default;