fan-standard-comp 3.2.1 → 3.2.3

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 (293) hide show
  1. package/Readme.md +2 -32
  2. package/dist/09cd8e9be7081f2166444cce393fe968.svg +54 -0
  3. package/dist/e3378c145b7db195ad068735e15fb28a.svg +165 -0
  4. package/dist/fan-standard-comp.umd.js +183 -439
  5. package/dist/fonts/iconfont.ttf +0 -0
  6. package/dist/fonts/iconfont.woff +0 -0
  7. package/dist/fonts/lg.ttf +0 -0
  8. package/dist/fonts/lg.woff +0 -0
  9. package/dist/fonts/lg.woff2 +0 -0
  10. package/es/ButtonGroup/ButtonList.d.ts +2 -1
  11. package/es/ButtonGroup/ButtonMenu.d.ts +2 -1
  12. package/es/ButtonGroup/PopConfirmTitle.js +5 -5
  13. package/es/ButtonGroup/index.d.ts +3 -1
  14. package/es/ButtonGroup/index.js +146 -180
  15. package/es/ButtonGroup/style/index.less +4 -1
  16. package/es/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
  17. package/es/CalendarCoordPicker/CalendarMonthPicker.js +26 -0
  18. package/es/CalendarCoordPicker/index.d.ts +8 -0
  19. package/es/CalendarCoordPicker/index.js +296 -0
  20. package/es/CalendarCoordPicker/index.less +31 -0
  21. package/es/ConfigContext/index.d.ts +7 -0
  22. package/es/ConfigContext/index.js +12 -0
  23. package/es/DragContent/index.d.ts +1 -1
  24. package/es/DragContent/index.js +5 -5
  25. package/es/FormComp/ChunkUploader/api.js +14 -14
  26. package/es/FormComp/ChunkUploader/index.js +132 -139
  27. package/es/FormComp/ChunkUploader/lib.js +21 -21
  28. package/es/FormComp/ChunkUploader/upload-queue.class.js +64 -66
  29. package/es/FormComp/EditButton/index.d.ts +1 -1
  30. package/es/FormComp/EditButton/index.js +15 -17
  31. package/es/FormComp/FieldComponent/ReUpload.d.ts +1 -1
  32. package/es/FormComp/FieldComponent/ReUpload.js +37 -23
  33. package/es/FormComp/FieldComponent/RefactorTextarea.js +32 -0
  34. package/es/FormComp/FieldComponent/RefactorTreeSelect.js +72 -19
  35. package/es/FormComp/FieldComponent/TitleNode.d.ts +2 -1
  36. package/es/FormComp/FieldComponent/index.d.ts +1 -1
  37. package/es/FormComp/FieldComponent/index.js +37 -26
  38. package/es/FormComp/FieldComponent/setReadonlyValues.js +6 -6
  39. package/es/FormComp/RenderItemGroup/index.js +24 -8
  40. package/es/FormComp/Uploader/index.d.ts +9 -2
  41. package/es/FormComp/Uploader/index.js +325 -156
  42. package/es/FormComp/VarTemplate/index.js +57 -64
  43. package/es/ImageGallery/ImagePreview.d.ts +13 -0
  44. package/es/ImageGallery/ImagePreview.js +168 -0
  45. package/es/ImageGallery/PreviewStyles/ImagePreview.less +730 -0
  46. package/es/ImageGallery/PreviewStyles/fonts/lg.svg +54 -0
  47. package/es/ImageGallery/PreviewStyles/fonts/lg.ttf +0 -0
  48. package/es/ImageGallery/PreviewStyles/fonts/lg.woff +0 -0
  49. package/es/ImageGallery/PreviewStyles/fonts/lg.woff2 +0 -0
  50. package/es/ImageGallery/PreviewStyles/lg-thumbnail.css +108 -0
  51. package/es/ImageGallery/PreviewStyles/lg-video.css +144 -0
  52. package/es/ImageGallery/PreviewStyles/lg-zoom.css +116 -0
  53. package/es/ImageGallery/PreviewStyles/lightgallery.css +728 -0
  54. package/es/ImageGallery/SliderContent.d.ts +7 -0
  55. package/es/ImageGallery/SliderContent.js +699 -0
  56. package/es/ImageGallery/Thumbnail.d.ts +3 -0
  57. package/es/ImageGallery/Thumbnail.js +296 -0
  58. package/es/ImageGallery/hook/uniqueId.d.ts +1 -0
  59. package/es/ImageGallery/hook/uniqueId.js +10 -0
  60. package/es/ImageGallery/index.d.ts +4 -0
  61. package/es/ImageGallery/index.js +29 -0
  62. package/es/ImageGallery/style/index.less +5 -0
  63. package/es/ImageGallery/types.d.ts +5 -0
  64. package/es/ImageGallery/types.js +1 -0
  65. package/es/NavLeafScroll/index.js +94 -50
  66. package/es/RefactorTree/index.d.ts +1 -1
  67. package/es/RefactorTree/index.js +6 -6
  68. package/es/RefactorTree/indexTreeNode.d.ts +1 -1
  69. package/es/RefactorTree/indexTreeNode.js +19 -17
  70. package/es/RefactorTree/util.js +18 -18
  71. package/es/SpecIcon/fonts/demo_index.html +559 -5
  72. package/es/SpecIcon/fonts/iconfont.css +101 -3
  73. package/es/SpecIcon/fonts/iconfont.js +34 -27
  74. package/es/SpecIcon/fonts/iconfont.json +168 -0
  75. package/es/SpecIcon/fonts/iconfont.svg +163 -171
  76. package/es/SpecIcon/fonts/iconfont.ttf +0 -0
  77. package/es/SpecIcon/fonts/iconfont.woff +0 -0
  78. package/es/SpecIcon/fonts/iconfont.woff2 +0 -0
  79. package/es/SpecIcon/style/iconfont.less +106 -11
  80. package/es/SplitterLayout/Pane.d.ts +1 -1
  81. package/es/SplitterLayout/index.js +25 -26
  82. package/es/StandardContent/SplitterLayout/Pane.js +3 -3
  83. package/es/StandardContent/SplitterLayout/index.js +25 -26
  84. package/es/StandardContent/SubfieldContent.d.ts +1 -1
  85. package/es/StandardContent/WrapperContent.d.ts +1 -1
  86. package/es/StandardDragModal/index.d.ts +11 -3
  87. package/es/StandardDragModal/index.js +25 -3
  88. package/es/StandardFilter/index.d.ts +5 -16
  89. package/es/StandardFilter/index.js +212 -200
  90. package/es/StandardFilter/indexClass.d.ts +37 -0
  91. package/es/StandardFilter/indexClass.js +217 -0
  92. package/es/StandardFilter/style/index.less +82 -9
  93. package/es/StandardForm/StepForm.d.ts +1 -1
  94. package/es/StandardForm/StepForm.js +28 -22
  95. package/es/StandardForm/TabForm.d.ts +1 -1
  96. package/es/StandardForm/TabForm.js +41 -43
  97. package/es/StandardForm/index.d.ts +1 -1
  98. package/es/StandardForm/index.js +5 -5
  99. package/es/StandardModal/UpdateFormRef.js +0 -1
  100. package/es/StandardModal/index.d.ts +2 -1
  101. package/es/StandardModal/index.js +25 -39
  102. package/es/StandardPanel/index.d.ts +1 -1
  103. package/es/StandardPanel/index.js +7 -7
  104. package/es/StandardTable/index.d.ts +1 -0
  105. package/es/StandardTable/index.js +44 -26
  106. package/es/components/IconNode/index.d.ts +1 -1
  107. package/es/components/IconNode/index.js +0 -1
  108. package/es/data/general.config.js +31 -0
  109. package/es/index.d.ts +3 -1
  110. package/es/index.js +6 -2
  111. package/es/utils/filterPermission.js +7 -10
  112. package/es/utils/getParentNodes.js +101 -26
  113. package/es/utils/index.js +2 -3
  114. package/es/utils/urlUtils.js +76 -0
  115. package/lib/ButtonGroup/ButtonList.d.ts +2 -1
  116. package/lib/ButtonGroup/ButtonList.js +2 -3
  117. package/lib/ButtonGroup/ButtonMenu.d.ts +2 -1
  118. package/lib/ButtonGroup/ButtonMenu.js +2 -3
  119. package/lib/ButtonGroup/PopConfirmTitle.js +7 -8
  120. package/lib/ButtonGroup/index.d.ts +3 -1
  121. package/lib/ButtonGroup/index.js +150 -185
  122. package/lib/ButtonGroup/style/index.less +4 -1
  123. package/lib/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
  124. package/lib/CalendarCoordPicker/CalendarMonthPicker.js +36 -0
  125. package/lib/CalendarCoordPicker/index.d.ts +8 -0
  126. package/lib/CalendarCoordPicker/index.js +305 -0
  127. package/lib/CalendarCoordPicker/index.less +31 -0
  128. package/lib/ConfigContext/index.d.ts +7 -0
  129. package/lib/ConfigContext/index.js +17 -0
  130. package/lib/DragContent/DragBar.js +2 -3
  131. package/lib/DragContent/index.d.ts +1 -1
  132. package/lib/DragContent/index.js +9 -10
  133. package/lib/FormComp/ChunkUploader/api.js +15 -15
  134. package/lib/FormComp/ChunkUploader/index.js +135 -142
  135. package/lib/FormComp/ChunkUploader/lib.js +22 -22
  136. package/lib/FormComp/ChunkUploader/upload-queue.class.js +66 -69
  137. package/lib/FormComp/ChunkUploader/worker.js +1 -1
  138. package/lib/FormComp/EditButton/index.d.ts +1 -1
  139. package/lib/FormComp/EditButton/index.js +19 -22
  140. package/lib/FormComp/FieldComponent/ReUpload.d.ts +1 -1
  141. package/lib/FormComp/FieldComponent/ReUpload.js +40 -28
  142. package/lib/FormComp/FieldComponent/RefactorTextarea.js +42 -0
  143. package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +75 -23
  144. package/lib/FormComp/FieldComponent/TitleNode.d.ts +2 -1
  145. package/lib/FormComp/FieldComponent/TitleNode.js +2 -3
  146. package/lib/FormComp/FieldComponent/index.d.ts +1 -1
  147. package/lib/FormComp/FieldComponent/index.js +41 -28
  148. package/lib/FormComp/FieldComponent/setReadonlyValues.js +15 -20
  149. package/lib/FormComp/RenderItemGroup/index.js +26 -11
  150. package/lib/FormComp/Uploader/index.d.ts +9 -2
  151. package/lib/FormComp/Uploader/index.js +325 -159
  152. package/lib/FormComp/VarTemplate/index.js +63 -71
  153. package/lib/FormComp/index.js +1 -1
  154. package/lib/ImageGallery/ImagePreview.d.ts +13 -0
  155. package/lib/ImageGallery/ImagePreview.js +178 -0
  156. package/lib/ImageGallery/PreviewStyles/ImagePreview.less +730 -0
  157. package/lib/ImageGallery/PreviewStyles/fonts/lg.svg +54 -0
  158. package/lib/ImageGallery/PreviewStyles/fonts/lg.ttf +0 -0
  159. package/lib/ImageGallery/PreviewStyles/fonts/lg.woff +0 -0
  160. package/lib/ImageGallery/PreviewStyles/fonts/lg.woff2 +0 -0
  161. package/lib/ImageGallery/PreviewStyles/lg-thumbnail.css +108 -0
  162. package/lib/ImageGallery/PreviewStyles/lg-video.css +144 -0
  163. package/lib/ImageGallery/PreviewStyles/lg-zoom.css +116 -0
  164. package/lib/ImageGallery/PreviewStyles/lightgallery.css +728 -0
  165. package/lib/ImageGallery/SliderContent.d.ts +7 -0
  166. package/lib/ImageGallery/SliderContent.js +708 -0
  167. package/lib/ImageGallery/Thumbnail.d.ts +3 -0
  168. package/lib/ImageGallery/Thumbnail.js +306 -0
  169. package/lib/ImageGallery/hook/uniqueId.d.ts +1 -0
  170. package/lib/ImageGallery/hook/uniqueId.js +17 -0
  171. package/lib/ImageGallery/index.d.ts +4 -0
  172. package/lib/ImageGallery/index.js +36 -0
  173. package/lib/ImageGallery/style/index.less +5 -0
  174. package/lib/ImageGallery/types.d.ts +5 -0
  175. package/lib/ImageGallery/types.js +5 -0
  176. package/lib/NavLeafScroll/index.js +98 -55
  177. package/lib/RefactorTree/index.d.ts +1 -1
  178. package/lib/RefactorTree/index.js +10 -11
  179. package/lib/RefactorTree/indexTreeNode.d.ts +1 -1
  180. package/lib/RefactorTree/indexTreeNode.js +23 -22
  181. package/lib/RefactorTree/util.js +18 -18
  182. package/lib/SpecIcon/fonts/demo_index.html +559 -5
  183. package/lib/SpecIcon/fonts/iconfont.css +101 -3
  184. package/lib/SpecIcon/fonts/iconfont.js +34 -27
  185. package/lib/SpecIcon/fonts/iconfont.json +168 -0
  186. package/lib/SpecIcon/fonts/iconfont.svg +163 -171
  187. package/lib/SpecIcon/fonts/iconfont.ttf +0 -0
  188. package/lib/SpecIcon/fonts/iconfont.woff +0 -0
  189. package/lib/SpecIcon/fonts/iconfont.woff2 +0 -0
  190. package/lib/SpecIcon/index.js +2 -3
  191. package/lib/SpecIcon/style/iconfont.less +106 -11
  192. package/lib/SplitterLayout/Pane.d.ts +1 -1
  193. package/lib/SplitterLayout/Pane.js +2 -3
  194. package/lib/SplitterLayout/index.js +27 -29
  195. package/lib/StandardContent/SplitterLayout/Pane.js +5 -6
  196. package/lib/StandardContent/SplitterLayout/index.js +27 -29
  197. package/lib/StandardContent/SubfieldContent.d.ts +1 -1
  198. package/lib/StandardContent/SubfieldContent.js +2 -3
  199. package/lib/StandardContent/WrapperContent.d.ts +1 -1
  200. package/lib/StandardContent/WrapperContent.js +2 -3
  201. package/lib/StandardDragModal/index.d.ts +11 -3
  202. package/lib/StandardDragModal/index.js +27 -33
  203. package/lib/StandardFilter/index.d.ts +5 -16
  204. package/lib/StandardFilter/index.js +215 -201
  205. package/lib/StandardFilter/indexClass.d.ts +37 -0
  206. package/lib/StandardFilter/indexClass.js +223 -0
  207. package/lib/StandardFilter/style/index.less +82 -9
  208. package/lib/StandardForm/ActionList.js +2 -3
  209. package/lib/StandardForm/StepForm.d.ts +1 -1
  210. package/lib/StandardForm/StepForm.js +32 -27
  211. package/lib/StandardForm/TabForm.d.ts +1 -1
  212. package/lib/StandardForm/TabForm.js +45 -48
  213. package/lib/StandardForm/index.d.ts +1 -1
  214. package/lib/StandardForm/index.js +9 -10
  215. package/lib/StandardModal/UpdateFormRef.js +3 -4
  216. package/lib/StandardModal/index.d.ts +2 -1
  217. package/lib/StandardModal/index.js +29 -43
  218. package/lib/StandardPanel/index.d.ts +1 -1
  219. package/lib/StandardPanel/index.js +11 -12
  220. package/lib/StandardTable/index.d.ts +1 -0
  221. package/lib/StandardTable/index.js +49 -29
  222. package/lib/components/IconNode/index.d.ts +1 -1
  223. package/lib/components/IconNode/index.js +2 -4
  224. package/lib/components/index.js +1 -1
  225. package/lib/data/func.code.js +2 -3
  226. package/lib/data/general.config.js +33 -3
  227. package/lib/data/index.js +1 -1
  228. package/lib/index.d.ts +3 -1
  229. package/lib/index.js +30 -10
  230. package/lib/utils/ValueFormat.js +1 -2
  231. package/lib/utils/filterPermission.js +11 -18
  232. package/lib/utils/getParentNodes.js +103 -29
  233. package/lib/utils/index.js +5 -27
  234. package/lib/utils/urlUtils.js +82 -0
  235. package/package.json +15 -9
  236. package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
  237. package/dist/fonts/iconfont.eot +0 -0
  238. package/es/StandardDragModal/ChangeStandardModal.d.ts +0 -44
  239. package/es/StandardDragModal/ChangeStandardModal.js +0 -493
  240. package/es/StandardDragModal/DraggableModal.d.ts +0 -7
  241. package/es/StandardDragModal/DraggableModal.js +0 -31
  242. package/es/StandardDragModal/DraggableModalContext.d.ts +0 -9
  243. package/es/StandardDragModal/DraggableModalContext.js +0 -5
  244. package/es/StandardDragModal/DraggableModalInner.d.ts +0 -16
  245. package/es/StandardDragModal/DraggableModalInner.js +0 -114
  246. package/es/StandardDragModal/DraggableModalProvider.d.ts +0 -4
  247. package/es/StandardDragModal/DraggableModalProvider.js +0 -40
  248. package/es/StandardDragModal/Modal.d.ts +0 -11
  249. package/es/StandardDragModal/Modal.js +0 -24
  250. package/es/StandardDragModal/ResizeHandle.d.ts +0 -2
  251. package/es/StandardDragModal/ResizeHandle.js +0 -8
  252. package/es/StandardDragModal/clamp.d.ts +0 -1
  253. package/es/StandardDragModal/clamp.js +0 -3
  254. package/es/StandardDragModal/draggableModalReducer.d.ts +0 -66
  255. package/es/StandardDragModal/draggableModalReducer.js +0 -157
  256. package/es/StandardDragModal/getWindowSize.d.ts +0 -4
  257. package/es/StandardDragModal/getWindowSize.js +0 -6
  258. package/es/StandardDragModal/index.less +0 -65
  259. package/es/StandardDragModal/useDrag.d.ts +0 -5
  260. package/es/StandardDragModal/useDrag.js +0 -66
  261. package/es/StandardDragModal/usePrevious.d.ts +0 -1
  262. package/es/StandardDragModal/usePrevious.js +0 -8
  263. package/es/StandardDragModal/useResize.d.ts +0 -7
  264. package/es/StandardDragModal/useResize.js +0 -74
  265. package/es/utils/dictSelectUtil.js +0 -153
  266. package/lib/StandardDragModal/ChangeStandardModal.d.ts +0 -44
  267. package/lib/StandardDragModal/ChangeStandardModal.js +0 -502
  268. package/lib/StandardDragModal/DraggableModal.d.ts +0 -7
  269. package/lib/StandardDragModal/DraggableModal.js +0 -40
  270. package/lib/StandardDragModal/DraggableModalContext.d.ts +0 -9
  271. package/lib/StandardDragModal/DraggableModalContext.js +0 -15
  272. package/lib/StandardDragModal/DraggableModalInner.d.ts +0 -16
  273. package/lib/StandardDragModal/DraggableModalInner.js +0 -124
  274. package/lib/StandardDragModal/DraggableModalProvider.d.ts +0 -4
  275. package/lib/StandardDragModal/DraggableModalProvider.js +0 -48
  276. package/lib/StandardDragModal/Modal.d.ts +0 -11
  277. package/lib/StandardDragModal/Modal.js +0 -32
  278. package/lib/StandardDragModal/ResizeHandle.d.ts +0 -2
  279. package/lib/StandardDragModal/ResizeHandle.js +0 -18
  280. package/lib/StandardDragModal/clamp.d.ts +0 -1
  281. package/lib/StandardDragModal/clamp.js +0 -10
  282. package/lib/StandardDragModal/draggableModalReducer.d.ts +0 -66
  283. package/lib/StandardDragModal/draggableModalReducer.js +0 -167
  284. package/lib/StandardDragModal/getWindowSize.d.ts +0 -4
  285. package/lib/StandardDragModal/getWindowSize.js +0 -13
  286. package/lib/StandardDragModal/index.less +0 -65
  287. package/lib/StandardDragModal/useDrag.d.ts +0 -5
  288. package/lib/StandardDragModal/useDrag.js +0 -73
  289. package/lib/StandardDragModal/usePrevious.d.ts +0 -1
  290. package/lib/StandardDragModal/usePrevious.js +0 -15
  291. package/lib/StandardDragModal/useResize.d.ts +0 -7
  292. package/lib/StandardDragModal/useResize.js +0 -81
  293. package/lib/utils/dictSelectUtil.js +0 -161
@@ -1,4 +0,0 @@
1
- import * as React from 'react';
2
- export declare const DraggableModalProvider: ({ children, }: {
3
- children: React.ReactNode;
4
- }) => React.ReactElement;
@@ -1,40 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
- 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."); }
4
- 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); }
5
- 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; }
6
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
7
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
- import * as React from 'react';
9
- import { useEffect, useReducer } from 'react';
10
- import { DraggableModalContext } from './DraggableModalContext';
11
- import { getWindowSize } from './getWindowSize';
12
- import { draggableModalReducer, initialModalsState } from './draggableModalReducer';
13
- export var DraggableModalProvider = function DraggableModalProvider(_ref) {
14
- var children = _ref.children;
15
- var _useReducer = useReducer(draggableModalReducer, initialModalsState),
16
- _useReducer2 = _slicedToArray(_useReducer, 2),
17
- state = _useReducer2[0],
18
- dispatch = _useReducer2[1];
19
- useEffect(function () {
20
- var onResize = function onResize() {
21
- return dispatch({
22
- type: 'windowResize',
23
- size: getWindowSize()
24
- });
25
- };
26
- if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object') {
27
- window.addEventListener('resize', onResize);
28
- onResize();
29
- }
30
- return function () {
31
- (typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object' && window.removeEventListener('resize', onResize);
32
- };
33
- }, [dispatch]);
34
- return /*#__PURE__*/React.createElement(DraggableModalContext.Provider, {
35
- value: {
36
- state: state,
37
- dispatch: dispatch
38
- }
39
- }, children);
40
- };
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- interface StandardDragModalProps {
4
- visible: boolean;
5
- title?: string | React.ReactNode;
6
- initialWidth?: number;
7
- initialHeight?: number;
8
- [k: string]: any;
9
- }
10
- declare const StandardDragModal: (props: StandardDragModalProps) => JSX.Element;
11
- export default StandardDragModal;
@@ -1,24 +0,0 @@
1
- import { __rest } from "tslib";
2
- import React from 'react';
3
- import { DraggableModal, DraggableModalProvider } from './index';
4
- import './index.less';
5
- var StandardDragModal = function StandardDragModal(props) {
6
- var visible = props.visible,
7
- onCancel = props.onCancel,
8
- onSubmit = props.onSubmit,
9
- children = props.children,
10
- others = __rest(props, ["visible", "onCancel", "onSubmit", "children"]);
11
- var handleOk = function handleOk() {
12
- onSubmit && onSubmit();
13
- };
14
- var handleCancel = function handleCancel() {
15
- onCancel && onCancel();
16
- };
17
- return /*#__PURE__*/React.createElement(DraggableModalProvider, null, /*#__PURE__*/React.createElement(DraggableModal, Object.assign({
18
- visible: visible,
19
- onOk: handleOk,
20
- onCancel: handleCancel,
21
- zIndex: 1001
22
- }, others), children));
23
- };
24
- export default StandardDragModal;
@@ -1,2 +0,0 @@
1
- import * as React from 'react';
2
- export declare const ResizeHandle: (props: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => React.ReactElement;
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- export var ResizeHandle = function ResizeHandle(props) {
3
- return /*#__PURE__*/React.createElement("div", Object.assign({
4
- className: "ant-design-draggable-modal-resize-handle"
5
- }, props), /*#__PURE__*/React.createElement("div", {
6
- className: "ant-design-draggable-modal-resize-handle-inner"
7
- }));
8
- };
@@ -1 +0,0 @@
1
- export declare const clamp: (min: number, max: number, value: number) => number;
@@ -1,3 +0,0 @@
1
- export var clamp = function clamp(min, max, value) {
2
- return Math.max(min, Math.min(max, value));
3
- };
@@ -1,66 +0,0 @@
1
- export declare type ModalID = string;
2
- export interface ModalState {
3
- x: number;
4
- y: number;
5
- width: number;
6
- height: number;
7
- zIndex: number;
8
- visible: boolean;
9
- }
10
- export interface ModalsState {
11
- maxZIndex: number;
12
- windowSize: {
13
- width: number;
14
- height: number;
15
- };
16
- modals: {
17
- [key: string]: ModalState;
18
- };
19
- }
20
- export declare const initialModalsState: ModalsState;
21
- export declare const initialModalState: ModalState;
22
- export declare type Action = {
23
- type: 'show';
24
- id: ModalID;
25
- } | {
26
- type: 'hide';
27
- id: ModalID;
28
- } | {
29
- type: 'focus';
30
- id: ModalID;
31
- } | {
32
- type: 'unmount';
33
- id: ModalID;
34
- } | {
35
- type: 'mount';
36
- id: ModalID;
37
- intialState: {
38
- initialWidth?: number;
39
- initialHeight?: number;
40
- };
41
- } | {
42
- type: 'windowResize';
43
- size: {
44
- width: number;
45
- height: number;
46
- };
47
- } | {
48
- type: 'drag';
49
- id: ModalID;
50
- x: number;
51
- y: number;
52
- } | {
53
- type: 'resize';
54
- id: ModalID;
55
- x: number;
56
- y: number;
57
- width: number;
58
- height: number;
59
- };
60
- export declare const getModalState: ({ state, id, initialWidth, initialHeight, }: {
61
- state: ModalsState;
62
- id: ModalID;
63
- initialWidth?: number;
64
- initialHeight?: number;
65
- }) => ModalState;
66
- export declare const draggableModalReducer: (state: ModalsState, action: Action) => ModalsState;
@@ -1,157 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
- 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); }
8
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
9
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
- 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; }
11
- import { getWindowSize } from './getWindowSize';
12
- import { clamp } from './clamp';
13
- var mapObject = function mapObject(o, f) {
14
- return Object.assign.apply(Object, [{}].concat(_toConsumableArray(Object.keys(o).map(function (k) {
15
- return _defineProperty({}, k, f(o[k]));
16
- }))));
17
- };
18
- export var initialModalsState = {
19
- maxZIndex: 0,
20
- windowSize: getWindowSize(),
21
- modals: {}
22
- };
23
- export var initialModalState = {
24
- x: 0,
25
- y: 0,
26
- width: 800,
27
- height: 800,
28
- zIndex: 0,
29
- visible: false
30
- };
31
- var getInitialModalState = function getInitialModalState(_ref2) {
32
- var _ref2$initialWidth = _ref2.initialWidth,
33
- initialWidth = _ref2$initialWidth === void 0 ? initialModalState.width : _ref2$initialWidth,
34
- _ref2$initialHeight = _ref2.initialHeight,
35
- initialHeight = _ref2$initialHeight === void 0 ? initialModalState.height : _ref2$initialHeight;
36
- return Object.assign(Object.assign({}, initialModalState), {
37
- width: initialWidth,
38
- height: initialHeight
39
- });
40
- };
41
- export var getModalState = function getModalState(_ref3) {
42
- var state = _ref3.state,
43
- id = _ref3.id,
44
- initialWidth = _ref3.initialWidth,
45
- initialHeight = _ref3.initialHeight;
46
- return state.modals[id] || getInitialModalState({
47
- initialWidth: initialWidth,
48
- initialHeight: initialHeight
49
- });
50
- };
51
- var getNextZIndex = function getNextZIndex(state, id) {
52
- return getModalState({
53
- state: state,
54
- id: id
55
- }).zIndex === state.maxZIndex ? state.maxZIndex : state.maxZIndex + 1;
56
- };
57
- var clampDrag = function clampDrag(windowWidth, windowHeight, x, y, width, height) {
58
- var maxX = windowWidth - width;
59
- var maxY = windowHeight - height;
60
- var clampedX = clamp(0, maxX, x);
61
- var clampedY = clamp(0, maxY, y);
62
- return {
63
- x: clampedX,
64
- y: clampedY
65
- };
66
- };
67
- var clampResize = function clampResize(windowWidth, windowHeight, x, y, width, height) {
68
- var maxWidth = windowWidth - x;
69
- var maxHeight = windowHeight - y;
70
- var clampedWidth = clamp(200, maxWidth, width);
71
- var clampedHeight = clamp(200, maxHeight, height);
72
- return {
73
- width: clampedWidth,
74
- height: clampedHeight
75
- };
76
- };
77
- export var draggableModalReducer = function draggableModalReducer(state, action) {
78
- switch (action.type) {
79
- case 'resize':
80
- var size = clampResize(state.windowSize.width, state.windowSize.height, action.x, action.y, action.width, action.height);
81
- return Object.assign(Object.assign({}, state), {
82
- maxZIndex: getNextZIndex(state, action.id),
83
- modals: Object.assign(Object.assign({}, state.modals), _defineProperty({}, action.id, Object.assign(Object.assign(Object.assign({}, state.modals[action.id]), size), {
84
- zIndex: getNextZIndex(state, action.id)
85
- })))
86
- });
87
- case 'drag':
88
- return Object.assign(Object.assign({}, state), {
89
- maxZIndex: getNextZIndex(state, action.id),
90
- modals: Object.assign(Object.assign({}, state.modals), _defineProperty({}, action.id, Object.assign(Object.assign(Object.assign({}, state.modals[action.id]), clampDrag(state.windowSize.width, state.windowSize.height, action.x, action.y, state.modals[action.id].width, state.modals[action.id].height)), {
91
- zIndex: getNextZIndex(state, action.id)
92
- })))
93
- });
94
- case 'show':
95
- {
96
- var _modalState = state.modals[action.id];
97
- var centerX = state.windowSize.width / 2 - _modalState.width / 2;
98
- var centerY = state.windowSize.height / 2 - _modalState.height / 2;
99
- var position = clampDrag(state.windowSize.width, state.windowSize.height, centerX, centerY, _modalState.width, _modalState.height);
100
- var _size = clampResize(state.windowSize.width, state.windowSize.height, position.x, position.y, _modalState.width, _modalState.height);
101
- return Object.assign(Object.assign({}, state), {
102
- maxZIndex: state.maxZIndex + 1,
103
- modals: Object.assign(Object.assign({}, state.modals), _defineProperty({}, action.id, Object.assign(Object.assign(Object.assign(Object.assign({}, _modalState), position), _size), {
104
- zIndex: state.maxZIndex + 1,
105
- visible: true
106
- })))
107
- });
108
- }
109
- case 'focus':
110
- var modalState = state.modals[action.id];
111
- return Object.assign(Object.assign({}, state), {
112
- maxZIndex: state.maxZIndex + 1,
113
- modals: Object.assign(Object.assign({}, state.modals), _defineProperty({}, action.id, Object.assign(Object.assign({}, modalState), {
114
- zIndex: state.maxZIndex + 1
115
- })))
116
- });
117
- case 'hide':
118
- {
119
- var _modalState2 = state.modals[action.id];
120
- return Object.assign(Object.assign({}, state), {
121
- modals: Object.assign(Object.assign({}, state.modals), _defineProperty({}, action.id, Object.assign(Object.assign({}, _modalState2), {
122
- visible: false
123
- })))
124
- });
125
- }
126
- case 'mount':
127
- var initialState = getInitialModalState(action.intialState);
128
- return Object.assign(Object.assign({}, state), {
129
- maxZIndex: state.maxZIndex + 1,
130
- modals: Object.assign(Object.assign({}, state.modals), _defineProperty({}, action.id, Object.assign(Object.assign({}, initialState), {
131
- x: state.windowSize.width / 2 - initialState.width / 2,
132
- y: state.windowSize.height / 2 - initialState.height / 2,
133
- zIndex: state.maxZIndex + 1
134
- })))
135
- });
136
- case 'unmount':
137
- var modalsClone = Object.assign({}, state.modals);
138
- delete modalsClone[action.id];
139
- return Object.assign(Object.assign({}, state), {
140
- modals: modalsClone
141
- });
142
- case 'windowResize':
143
- return Object.assign(Object.assign({}, state), {
144
- windowSize: action.size,
145
- modals: mapObject(state.modals, function (modalState) {
146
- if (!modalState.visible) {
147
- return modalState;
148
- }
149
- var position = clampDrag(state.windowSize.width, state.windowSize.height, modalState.x, modalState.y, modalState.width, modalState.height);
150
- var size = clampResize(state.windowSize.width, state.windowSize.height, position.x, position.y, modalState.width, modalState.height);
151
- return Object.assign(Object.assign(Object.assign({}, modalState), position), size);
152
- })
153
- });
154
- default:
155
- throw new Error();
156
- }
157
- };
@@ -1,4 +0,0 @@
1
- export declare const getWindowSize: () => {
2
- width: number;
3
- height: number;
4
- };
@@ -1,6 +0,0 @@
1
- export var getWindowSize = function getWindowSize() {
2
- return {
3
- width: window.innerWidth || 0,
4
- height: window.innerHeight || 0
5
- };
6
- };
@@ -1,65 +0,0 @@
1
- /**
2
- * NOTE: This is not compiled.
3
- */
4
-
5
- .ant-design-draggable-modal {
6
- pointer-events: none;
7
- overflow: hidden !important;
8
- }
9
-
10
- .ant-design-draggable-modal .ant-modal {
11
- display: flex;
12
- max-width: none;
13
- transform-origin: 50% 50% !important;
14
- }
15
-
16
- .ant-design-draggable-modal .ant-modal-content {
17
- flex: 1;
18
- display: flex;
19
- flex-direction: column;
20
- }
21
-
22
- .ant-design-draggable-modal .ant-modal-header {
23
- flex: 0;
24
- padding: 0;
25
- }
26
-
27
- .ant-design-draggable-modal .ant-modal-footer {
28
- flex: 0;
29
- padding: 16px;
30
- }
31
-
32
- .ant-design-draggable-modal .ant-design-draggable-modal-title {
33
- cursor: move;
34
- padding: 16px;
35
- }
36
-
37
- .ant-design-draggable-modal .ant-design-draggable-modal-title::before {
38
- content: '\00a0';
39
- }
40
-
41
- .ant-design-draggable-modal .ant-modal-body {
42
- flex: 1;
43
- overflow-y: auto;
44
- padding: 16px;
45
- }
46
-
47
- .ant-design-draggable-modal-resize-handle-inner {
48
- width: 12px;
49
- right: 14px;
50
- border: 2px solid grey;
51
- height: 12px;
52
- bottom: 14px;
53
- position: absolute;
54
- border-top: 0;
55
- border-left: 0;
56
- }
57
-
58
- .ant-design-draggable-modal-resize-handle {
59
- right: -10px;
60
- width: 44px;
61
- bottom: -10px;
62
- cursor: se-resize;
63
- height: 44px;
64
- position: absolute;
65
- }
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- export declare const useDrag: (x: number, y: number, onDrag: (args: {
3
- x: number;
4
- y: number;
5
- }) => void) => (e: React.MouseEvent) => void;
@@ -1,66 +0,0 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- 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."); }
3
- 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); }
4
- 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; }
5
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import { useState, useEffect, useCallback } from 'react';
8
- export var useDrag = function useDrag(x, y, onDrag) {
9
- var _useState = useState(false),
10
- _useState2 = _slicedToArray(_useState, 2),
11
- dragging = _useState2[0],
12
- setDragging = _useState2[1];
13
- var _useState3 = useState({
14
- initX: 0,
15
- initY: 0,
16
- mouseDownX: 0,
17
- mouseDownY: 0
18
- }),
19
- _useState4 = _slicedToArray(_useState3, 2),
20
- initialDragState = _useState4[0],
21
- setInitialDragState = _useState4[1];
22
- var onMouseDown = useCallback(function (e) {
23
- e.preventDefault();
24
- setInitialDragState({
25
- initX: x,
26
- initY: y,
27
- mouseDownX: e.clientX,
28
- mouseDownY: e.clientY
29
- });
30
- setDragging(true);
31
- }, [x, y, setDragging, setInitialDragState]);
32
- useEffect(function () {
33
- var onMouseMove = function onMouseMove(e) {
34
- if (dragging) {
35
- var initX = initialDragState.initX,
36
- mouseDownX = initialDragState.mouseDownX,
37
- initY = initialDragState.initY,
38
- mouseDownY = initialDragState.mouseDownY;
39
- var dx = e.clientX - mouseDownX;
40
- var dy = e.clientY - mouseDownY;
41
- var _x = initX + dx;
42
- var _y = initY + dy;
43
- onDrag({
44
- x: _x,
45
- y: _y
46
- });
47
- }
48
- };
49
- window.addEventListener('mousemove', onMouseMove, {
50
- passive: true
51
- });
52
- return function () {
53
- return window.removeEventListener('mousemove', onMouseMove);
54
- };
55
- }, [initialDragState, dragging, onDrag]);
56
- useEffect(function () {
57
- var onMouseUp = function onMouseUp() {
58
- setDragging(false);
59
- };
60
- window.addEventListener('mouseup', onMouseUp);
61
- return function () {
62
- return window.removeEventListener('mouseup', onMouseUp);
63
- };
64
- }, [setDragging]);
65
- return onMouseDown;
66
- };
@@ -1 +0,0 @@
1
- export declare const usePrevious: <T>(value: T) => T;
@@ -1,8 +0,0 @@
1
- import { useRef, useEffect } from 'react';
2
- export var usePrevious = function usePrevious(value) {
3
- var ref = useRef(value);
4
- useEffect(function () {
5
- ref.current = value;
6
- }, [value]);
7
- return ref.current;
8
- };
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- export declare const useResize: (x: number, y: number, width: number, height: number, onResize: (args: {
3
- x: number;
4
- y: number;
5
- width: number;
6
- height: number;
7
- }) => void) => (e: React.MouseEvent) => void;
@@ -1,74 +0,0 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- 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."); }
3
- 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); }
4
- 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; }
5
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import { useState, useEffect, useCallback } from 'react';
8
- export var useResize = function useResize(x, y, width, height, onResize) {
9
- var _useState = useState(false),
10
- _useState2 = _slicedToArray(_useState, 2),
11
- dragging = _useState2[0],
12
- setDragging = _useState2[1];
13
- var _useState3 = useState({
14
- initX: 0,
15
- initY: 0,
16
- initWidth: 0,
17
- initHeight: 0,
18
- mouseDownX: 0,
19
- mouseDownY: 0
20
- }),
21
- _useState4 = _slicedToArray(_useState3, 2),
22
- initialDragState = _useState4[0],
23
- setInitialDragState = _useState4[1];
24
- var onMouseDown = useCallback(function (e) {
25
- e.preventDefault();
26
- setInitialDragState({
27
- initX: x,
28
- initY: y,
29
- initWidth: width,
30
- initHeight: height,
31
- mouseDownX: e.clientX,
32
- mouseDownY: e.clientY
33
- });
34
- setDragging(true);
35
- }, [width, height, setDragging, setInitialDragState, x, y]);
36
- useEffect(function () {
37
- var onMouseMove = function onMouseMove(e) {
38
- if (dragging) {
39
- var initX = initialDragState.initX,
40
- initY = initialDragState.initY,
41
- initWidth = initialDragState.initWidth,
42
- mouseDownX = initialDragState.mouseDownX,
43
- initHeight = initialDragState.initHeight,
44
- mouseDownY = initialDragState.mouseDownY;
45
- var dx = e.clientX - mouseDownX;
46
- var dy = e.clientY - mouseDownY;
47
- var _width = initWidth + dx;
48
- var _height = initHeight + dy;
49
- return onResize({
50
- x: initX,
51
- y: initY,
52
- width: _width,
53
- height: _height
54
- });
55
- }
56
- };
57
- window.addEventListener('mousemove', onMouseMove, {
58
- passive: true
59
- });
60
- return function () {
61
- return window.removeEventListener('mousemove', onMouseMove);
62
- };
63
- }, [initialDragState, dragging, onResize]);
64
- useEffect(function () {
65
- var onMouseUp = function onMouseUp() {
66
- setDragging(false);
67
- };
68
- window.addEventListener('mouseup', onMouseUp);
69
- return function () {
70
- return window.removeEventListener('mouseup', onMouseUp);
71
- };
72
- }, [setDragging]);
73
- return onMouseDown;
74
- };