bhd-components 0.9.1 → 0.9.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 (237) hide show
  1. package/README.md +1 -1
  2. package/dist/index.esm.es5.development.css +833 -363
  3. package/dist/index.esm.es5.development.js +4159 -6606
  4. package/dist/index.esm.es5.production.css +1 -1
  5. package/dist/index.esm.es5.production.js +1 -1
  6. package/dist/vendor.esm.es5.development.css +119 -0
  7. package/dist/{100c4e1e.esm.es5.development.js → vendor.esm.es5.development.js} +16857 -8463
  8. package/dist/vendor.esm.es5.production.css +11 -0
  9. package/dist/vendor.esm.es5.production.js +485 -0
  10. package/es2017/bhdAppLayout/components/BhdTableSimple/index.js +1 -1
  11. package/es2017/bhdAppLayout/components/BhdTableSimple/index/347/232/204/345/211/257/346/234/254.js +2 -2
  12. package/es2017/bhdAppLayout/index.js +16 -16
  13. package/es2017/bhdDatePicker/index.d.ts +1 -2
  14. package/es2017/bhdDatePicker/index.js +253 -256
  15. package/es2017/bhdDatePicker/index.module.less +120 -8
  16. package/es2017/bhdSelect/index.js +4 -4
  17. package/es2017/bhdTipModal/index.js +6 -6
  18. package/es2017/customerService/contactsList.d.ts +2 -2
  19. package/es2017/customerService/contactsList.js +2 -2
  20. package/es2017/customerService/function.js +2 -1
  21. package/es2017/customerService/historyFun.d.ts +2 -2
  22. package/es2017/customerService/historyFun.js +2 -2
  23. package/es2017/customerService/index.d.ts +2 -2
  24. package/es2017/customerService/index.js +6 -6
  25. package/es2017/customerService/js-screen-shot/assets/less/screen-shot.less +478 -0
  26. package/es2017/customerService/js-screen-shot/lib/common-methods/CanvasPatch.d.ts +1 -0
  27. package/es2017/customerService/js-screen-shot/lib/common-methods/CanvasPatch.js +15 -0
  28. package/es2017/customerService/js-screen-shot/lib/common-methods/DeviceTypeVerif.d.ts +2 -0
  29. package/es2017/customerService/js-screen-shot/lib/common-methods/DeviceTypeVerif.js +32 -0
  30. package/es2017/customerService/js-screen-shot/lib/common-methods/FixedData.d.ts +11 -0
  31. package/es2017/customerService/js-screen-shot/lib/common-methods/FixedData.js +17 -0
  32. package/es2017/customerService/js-screen-shot/lib/common-methods/GetBrushSelectedName.d.ts +5 -0
  33. package/es2017/customerService/js-screen-shot/lib/common-methods/GetBrushSelectedName.js +18 -0
  34. package/es2017/customerService/js-screen-shot/lib/common-methods/GetCanvasImgData.d.ts +4 -0
  35. package/es2017/customerService/js-screen-shot/lib/common-methods/GetCanvasImgData.js +25 -0
  36. package/es2017/customerService/js-screen-shot/lib/common-methods/GetColor.d.ts +1 -0
  37. package/es2017/customerService/js-screen-shot/lib/common-methods/GetColor.js +41 -0
  38. package/es2017/customerService/js-screen-shot/lib/common-methods/GetSelectedCalssName.d.ts +1 -0
  39. package/es2017/customerService/js-screen-shot/lib/common-methods/GetSelectedCalssName.js +23 -0
  40. package/es2017/customerService/js-screen-shot/lib/common-methods/GetToolRelativePosition.d.ts +7 -0
  41. package/es2017/customerService/js-screen-shot/lib/common-methods/GetToolRelativePosition.js +9 -0
  42. package/es2017/customerService/js-screen-shot/lib/common-methods/ImgScaling.d.ts +11 -0
  43. package/es2017/customerService/js-screen-shot/lib/common-methods/ImgScaling.js +41 -0
  44. package/es2017/customerService/js-screen-shot/lib/common-methods/SaveBorderArrInfo.d.ts +8 -0
  45. package/es2017/customerService/js-screen-shot/lib/common-methods/SaveBorderArrInfo.js +125 -0
  46. package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.d.ts +1 -0
  47. package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.js +38 -0
  48. package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.d.ts +1 -0
  49. package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.js +27 -0
  50. package/es2017/customerService/js-screen-shot/lib/common-methods/SelectColor.d.ts +1 -0
  51. package/es2017/customerService/js-screen-shot/lib/common-methods/SelectColor.js +6 -0
  52. package/es2017/customerService/js-screen-shot/lib/common-methods/SelectTextSize.d.ts +5 -0
  53. package/es2017/customerService/js-screen-shot/lib/common-methods/SelectTextSize.js +26 -0
  54. package/es2017/customerService/js-screen-shot/lib/common-methods/SetBrushSize.d.ts +14 -0
  55. package/es2017/customerService/js-screen-shot/lib/common-methods/SetBrushSize.js +50 -0
  56. package/es2017/customerService/js-screen-shot/lib/common-methods/SetSelectedClassName.d.ts +7 -0
  57. package/es2017/customerService/js-screen-shot/lib/common-methods/SetSelectedClassName.js +28 -0
  58. package/es2017/customerService/js-screen-shot/lib/common-methods/TakeOutHistory.d.ts +1 -0
  59. package/es2017/customerService/js-screen-shot/lib/common-methods/TakeOutHistory.js +20 -0
  60. package/es2017/customerService/js-screen-shot/lib/common-methods/UpdateContainerMouseStyle.d.ts +1 -0
  61. package/es2017/customerService/js-screen-shot/lib/common-methods/UpdateContainerMouseStyle.js +10 -0
  62. package/es2017/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.d.ts +17 -0
  63. package/es2017/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.js +92 -0
  64. package/es2017/customerService/js-screen-shot/lib/config/Toolbar.d.ts +5 -0
  65. package/es2017/customerService/js-screen-shot/lib/config/Toolbar.js +46 -0
  66. package/es2017/customerService/js-screen-shot/lib/main-entrance/CreateDom.d.ts +24 -0
  67. package/es2017/customerService/js-screen-shot/lib/main-entrance/CreateDom.js +305 -0
  68. package/es2017/customerService/js-screen-shot/lib/main-entrance/InitData.d.ts +78 -0
  69. package/es2017/customerService/js-screen-shot/lib/main-entrance/InitData.js +538 -0
  70. package/es2017/customerService/js-screen-shot/lib/main-entrance/PlugInParameters.d.ts +46 -0
  71. package/es2017/customerService/js-screen-shot/lib/main-entrance/PlugInParameters.js +162 -0
  72. package/es2017/customerService/js-screen-shot/lib/split-methods/AddHistoryData.d.ts +1 -0
  73. package/es2017/customerService/js-screen-shot/lib/split-methods/AddHistoryData.js +23 -0
  74. package/es2017/customerService/js-screen-shot/lib/split-methods/BoundaryJudgment.d.ts +8 -0
  75. package/es2017/customerService/js-screen-shot/lib/split-methods/BoundaryJudgment.js +13 -0
  76. package/es2017/customerService/js-screen-shot/lib/split-methods/CalculateOptionIcoPosition.d.ts +5 -0
  77. package/es2017/customerService/js-screen-shot/lib/split-methods/CalculateOptionIcoPosition.js +21 -0
  78. package/es2017/customerService/js-screen-shot/lib/split-methods/CalculateToolLocation.d.ts +16 -0
  79. package/es2017/customerService/js-screen-shot/lib/split-methods/CalculateToolLocation.js +39 -0
  80. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawArrow.d.ts +31 -0
  81. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawArrow.js +131 -0
  82. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawCircle.d.ts +11 -0
  83. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawCircle.js +37 -0
  84. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.d.ts +19 -0
  85. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.js +119 -0
  86. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawLineArrow.d.ts +13 -0
  87. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawLineArrow.js +51 -0
  88. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawMasking.d.ts +6 -0
  89. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawMasking.js +41 -0
  90. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawMosaic.d.ts +12 -0
  91. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawMosaic.js +67 -0
  92. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawPencil.d.ts +13 -0
  93. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawPencil.js +27 -0
  94. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawRectangle.d.ts +11 -0
  95. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawRectangle.js +22 -0
  96. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawText.d.ts +10 -0
  97. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawText.js +24 -0
  98. package/es2017/customerService/js-screen-shot/lib/split-methods/KeyboardEventHandle.d.ts +10 -0
  99. package/es2017/customerService/js-screen-shot/lib/split-methods/KeyboardEventHandle.js +50 -0
  100. package/es2017/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.d.ts +2 -0
  101. package/es2017/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.js +62 -0
  102. package/es2017/customerService/js-screen-shot/lib/split-methods/ToolClickEvent.d.ts +1 -0
  103. package/es2017/customerService/js-screen-shot/lib/split-methods/ToolClickEvent.js +132 -0
  104. package/es2017/customerService/js-screen-shot/lib/split-methods/drawCrossImg.d.ts +1 -0
  105. package/es2017/customerService/js-screen-shot/lib/split-methods/drawCrossImg.js +33 -0
  106. package/es2017/customerService/js-screen-shot/lib/type/ComponentType.d.ts +133 -0
  107. package/es2017/customerService/js-screen-shot/lib/type/ComponentType.js +2 -0
  108. package/es2017/customerService/js-screen-shot/main.d.ts +110 -0
  109. package/es2017/customerService/js-screen-shot/main.js +1101 -0
  110. package/es2017/customerService/screenshotTool.d.ts +2 -2
  111. package/es2017/customerService/screenshotTool.js +2 -2
  112. package/es2017/customerService/teacherList.d.ts +2 -2
  113. package/es2017/customerService/teacherList.js +2 -2
  114. package/es2017/i18n/en_US.js +4 -1
  115. package/es2017/i18n/zh_CN.js +4 -1
  116. package/es2017/icons/index.js +2 -2
  117. package/es2017/index.js +14 -14
  118. package/es2017/provider/index.js +2 -2
  119. package/es2017/table/index.js +4 -4
  120. package/es2017/tableSelect/index.js +3 -3
  121. package/es2017/textTootip/index.js +1 -1
  122. package/es2017/titleBar/index.js +3 -3
  123. package/es2017/viewImage/index.js +13 -13
  124. package/esm/bhdAppLayout/index.js +15 -15
  125. package/esm/bhdDatePicker/index.d.ts +1 -2
  126. package/esm/bhdDatePicker/index.js +254 -257
  127. package/esm/bhdDatePicker/index.module.less +120 -8
  128. package/esm/bhdSelect/index.js +1 -1
  129. package/esm/bhdTipModal/index.js +1 -1
  130. package/esm/customerService/contactsList.d.ts +2 -2
  131. package/esm/customerService/contactsList.js +1 -1
  132. package/esm/customerService/function.js +2 -1
  133. package/esm/customerService/historyFun.d.ts +2 -2
  134. package/esm/customerService/historyFun.js +1 -1
  135. package/esm/customerService/index.d.ts +2 -2
  136. package/esm/customerService/index.js +2 -2
  137. package/esm/customerService/js-screen-shot/assets/less/screen-shot.less +478 -0
  138. package/esm/customerService/js-screen-shot/lib/common-methods/CanvasPatch.d.ts +1 -0
  139. package/esm/customerService/js-screen-shot/lib/common-methods/CanvasPatch.js +15 -0
  140. package/esm/customerService/js-screen-shot/lib/common-methods/DeviceTypeVerif.d.ts +2 -0
  141. package/esm/customerService/js-screen-shot/lib/common-methods/DeviceTypeVerif.js +32 -0
  142. package/esm/customerService/js-screen-shot/lib/common-methods/FixedData.d.ts +11 -0
  143. package/esm/customerService/js-screen-shot/lib/common-methods/FixedData.js +17 -0
  144. package/esm/customerService/js-screen-shot/lib/common-methods/GetBrushSelectedName.d.ts +5 -0
  145. package/esm/customerService/js-screen-shot/lib/common-methods/GetBrushSelectedName.js +18 -0
  146. package/esm/customerService/js-screen-shot/lib/common-methods/GetCanvasImgData.d.ts +4 -0
  147. package/esm/customerService/js-screen-shot/lib/common-methods/GetCanvasImgData.js +25 -0
  148. package/esm/customerService/js-screen-shot/lib/common-methods/GetColor.d.ts +1 -0
  149. package/esm/customerService/js-screen-shot/lib/common-methods/GetColor.js +41 -0
  150. package/esm/customerService/js-screen-shot/lib/common-methods/GetSelectedCalssName.d.ts +1 -0
  151. package/esm/customerService/js-screen-shot/lib/common-methods/GetSelectedCalssName.js +23 -0
  152. package/esm/customerService/js-screen-shot/lib/common-methods/GetToolRelativePosition.d.ts +7 -0
  153. package/esm/customerService/js-screen-shot/lib/common-methods/GetToolRelativePosition.js +10 -0
  154. package/esm/customerService/js-screen-shot/lib/common-methods/ImgScaling.d.ts +11 -0
  155. package/esm/customerService/js-screen-shot/lib/common-methods/ImgScaling.js +38 -0
  156. package/esm/customerService/js-screen-shot/lib/common-methods/SaveBorderArrInfo.d.ts +8 -0
  157. package/esm/customerService/js-screen-shot/lib/common-methods/SaveBorderArrInfo.js +125 -0
  158. package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.d.ts +1 -0
  159. package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.js +38 -0
  160. package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.d.ts +1 -0
  161. package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.js +27 -0
  162. package/esm/customerService/js-screen-shot/lib/common-methods/SelectColor.d.ts +1 -0
  163. package/esm/customerService/js-screen-shot/lib/common-methods/SelectColor.js +6 -0
  164. package/esm/customerService/js-screen-shot/lib/common-methods/SelectTextSize.d.ts +5 -0
  165. package/esm/customerService/js-screen-shot/lib/common-methods/SelectTextSize.js +26 -0
  166. package/esm/customerService/js-screen-shot/lib/common-methods/SetBrushSize.d.ts +14 -0
  167. package/esm/customerService/js-screen-shot/lib/common-methods/SetBrushSize.js +50 -0
  168. package/esm/customerService/js-screen-shot/lib/common-methods/SetSelectedClassName.d.ts +7 -0
  169. package/esm/customerService/js-screen-shot/lib/common-methods/SetSelectedClassName.js +28 -0
  170. package/esm/customerService/js-screen-shot/lib/common-methods/TakeOutHistory.d.ts +1 -0
  171. package/esm/customerService/js-screen-shot/lib/common-methods/TakeOutHistory.js +20 -0
  172. package/esm/customerService/js-screen-shot/lib/common-methods/UpdateContainerMouseStyle.d.ts +1 -0
  173. package/esm/customerService/js-screen-shot/lib/common-methods/UpdateContainerMouseStyle.js +10 -0
  174. package/esm/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.d.ts +17 -0
  175. package/esm/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.js +92 -0
  176. package/esm/customerService/js-screen-shot/lib/config/Toolbar.d.ts +5 -0
  177. package/esm/customerService/js-screen-shot/lib/config/Toolbar.js +46 -0
  178. package/esm/customerService/js-screen-shot/lib/main-entrance/CreateDom.d.ts +24 -0
  179. package/esm/customerService/js-screen-shot/lib/main-entrance/CreateDom.js +346 -0
  180. package/esm/customerService/js-screen-shot/lib/main-entrance/InitData.d.ts +78 -0
  181. package/esm/customerService/js-screen-shot/lib/main-entrance/InitData.js +758 -0
  182. package/esm/customerService/js-screen-shot/lib/main-entrance/PlugInParameters.d.ts +46 -0
  183. package/esm/customerService/js-screen-shot/lib/main-entrance/PlugInParameters.js +259 -0
  184. package/esm/customerService/js-screen-shot/lib/split-methods/AddHistoryData.d.ts +1 -0
  185. package/esm/customerService/js-screen-shot/lib/split-methods/AddHistoryData.js +23 -0
  186. package/esm/customerService/js-screen-shot/lib/split-methods/BoundaryJudgment.d.ts +8 -0
  187. package/esm/customerService/js-screen-shot/lib/split-methods/BoundaryJudgment.js +13 -0
  188. package/esm/customerService/js-screen-shot/lib/split-methods/CalculateOptionIcoPosition.d.ts +5 -0
  189. package/esm/customerService/js-screen-shot/lib/split-methods/CalculateOptionIcoPosition.js +21 -0
  190. package/esm/customerService/js-screen-shot/lib/split-methods/CalculateToolLocation.d.ts +16 -0
  191. package/esm/customerService/js-screen-shot/lib/split-methods/CalculateToolLocation.js +39 -0
  192. package/esm/customerService/js-screen-shot/lib/split-methods/DrawArrow.d.ts +31 -0
  193. package/esm/customerService/js-screen-shot/lib/split-methods/DrawArrow.js +159 -0
  194. package/esm/customerService/js-screen-shot/lib/split-methods/DrawCircle.d.ts +11 -0
  195. package/esm/customerService/js-screen-shot/lib/split-methods/DrawCircle.js +37 -0
  196. package/esm/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.d.ts +19 -0
  197. package/esm/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.js +120 -0
  198. package/esm/customerService/js-screen-shot/lib/split-methods/DrawLineArrow.d.ts +13 -0
  199. package/esm/customerService/js-screen-shot/lib/split-methods/DrawLineArrow.js +51 -0
  200. package/esm/customerService/js-screen-shot/lib/split-methods/DrawMasking.d.ts +6 -0
  201. package/esm/customerService/js-screen-shot/lib/split-methods/DrawMasking.js +41 -0
  202. package/esm/customerService/js-screen-shot/lib/split-methods/DrawMosaic.d.ts +12 -0
  203. package/esm/customerService/js-screen-shot/lib/split-methods/DrawMosaic.js +67 -0
  204. package/esm/customerService/js-screen-shot/lib/split-methods/DrawPencil.d.ts +13 -0
  205. package/esm/customerService/js-screen-shot/lib/split-methods/DrawPencil.js +27 -0
  206. package/esm/customerService/js-screen-shot/lib/split-methods/DrawRectangle.d.ts +11 -0
  207. package/esm/customerService/js-screen-shot/lib/split-methods/DrawRectangle.js +22 -0
  208. package/esm/customerService/js-screen-shot/lib/split-methods/DrawText.d.ts +10 -0
  209. package/esm/customerService/js-screen-shot/lib/split-methods/DrawText.js +24 -0
  210. package/esm/customerService/js-screen-shot/lib/split-methods/KeyboardEventHandle.d.ts +10 -0
  211. package/esm/customerService/js-screen-shot/lib/split-methods/KeyboardEventHandle.js +61 -0
  212. package/esm/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.d.ts +2 -0
  213. package/esm/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.js +63 -0
  214. package/esm/customerService/js-screen-shot/lib/split-methods/ToolClickEvent.d.ts +1 -0
  215. package/esm/customerService/js-screen-shot/lib/split-methods/ToolClickEvent.js +132 -0
  216. package/esm/customerService/js-screen-shot/lib/split-methods/drawCrossImg.d.ts +1 -0
  217. package/esm/customerService/js-screen-shot/lib/split-methods/drawCrossImg.js +33 -0
  218. package/esm/customerService/js-screen-shot/lib/type/ComponentType.d.ts +133 -0
  219. package/esm/customerService/js-screen-shot/lib/type/ComponentType.js +2 -0
  220. package/esm/customerService/js-screen-shot/main.d.ts +110 -0
  221. package/esm/customerService/js-screen-shot/main.js +1204 -0
  222. package/esm/customerService/screenshotTool.d.ts +2 -2
  223. package/esm/customerService/screenshotTool.js +1 -1
  224. package/esm/customerService/teacherList.d.ts +2 -2
  225. package/esm/customerService/teacherList.js +1 -1
  226. package/esm/i18n/en_US.js +4 -1
  227. package/esm/i18n/zh_CN.js +4 -1
  228. package/esm/icons/index.js +1 -1
  229. package/esm/index.js +14 -14
  230. package/esm/tableSelect/index.js +1 -1
  231. package/esm/viewImage/index.js +3 -3
  232. package/package.json +1 -1
  233. package/dist/a4d5ce04.esm.es5.production.js +0 -468
  234. package/dist/vendor.esm.es5.development.esm.es5.development.css +0 -119
  235. package/dist/vendor.esm.es5.production.esm.es5.production.css +0 -11
  236. package/es2017/customerService/screenShotPlugin.esm.js +0 -6515
  237. package/esm/customerService/screenShotPlugin.esm.js +0 -6516
@@ -0,0 +1,41 @@
1
+ import InitData from "../main-entrance/InitData";
2
+ export function getColor(index) {
3
+ const data = new InitData();
4
+ let currentColor = "#F53440";
5
+ switch(index){
6
+ case 1:
7
+ currentColor = "#F53440";
8
+ break;
9
+ case 2:
10
+ currentColor = "#F65E95";
11
+ break;
12
+ case 3:
13
+ currentColor = "#D254CF";
14
+ break;
15
+ case 4:
16
+ currentColor = "#12A9D7";
17
+ break;
18
+ case 5:
19
+ currentColor = "#30A345";
20
+ break;
21
+ case 6:
22
+ currentColor = "#FACF50";
23
+ break;
24
+ case 7:
25
+ currentColor = "#F66632";
26
+ break;
27
+ case 8:
28
+ currentColor = "#989998";
29
+ break;
30
+ case 9:
31
+ currentColor = "#000000";
32
+ break;
33
+ case 10:
34
+ currentColor = "#FEFFFF";
35
+ break;
36
+ }
37
+ data.setSelectedColor(currentColor);
38
+ // 隐藏颜色选择面板
39
+ data.setColorPanelStatus(false);
40
+ return currentColor;
41
+ }
@@ -0,0 +1 @@
1
+ export declare function getSelectedClassName(index: number): string;
@@ -0,0 +1,23 @@
1
+ export function getSelectedClassName(index) {
2
+ let className = "";
3
+ switch(index){
4
+ case 1:
5
+ className = "square-active";
6
+ break;
7
+ case 2:
8
+ className = "round-active";
9
+ break;
10
+ case 3:
11
+ className = "right-top-active";
12
+ break;
13
+ case 4:
14
+ className = "brush-active";
15
+ break;
16
+ case 5:
17
+ className = "mosaicPen-active";
18
+ break;
19
+ case 6:
20
+ className = "text-active";
21
+ }
22
+ return className;
23
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 获取截图工具栏相对于视口的位置
3
+ */
4
+ export declare function getToolRelativePosition(left?: number, top?: number, dom?: HTMLElement): {
5
+ left: number;
6
+ top: number;
7
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 获取截图工具栏相对于视口的位置
3
+ */ export function getToolRelativePosition(left, top, dom = document.body) {
4
+ const rect = dom.getBoundingClientRect();
5
+ return {
6
+ left: left || Math.abs(rect.left),
7
+ top: top || Math.abs(rect.top)
8
+ };
9
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 等比例缩放图片
3
+ * @param imgWidth
4
+ * @param imgHeight
5
+ * @param containerWidth
6
+ * @param containerHeight
7
+ */
8
+ export declare function imgScaling(imgWidth: number, imgHeight: number, containerWidth: number, containerHeight: number): {
9
+ tempWidth: number;
10
+ tempHeight: number;
11
+ };
@@ -0,0 +1,41 @@
1
+ /**
2
+ * 等比例缩放图片
3
+ * @param imgWidth
4
+ * @param imgHeight
5
+ * @param containerWidth
6
+ * @param containerHeight
7
+ */ export function imgScaling(imgWidth, imgHeight, containerWidth, containerHeight) {
8
+ let [tempWidth, tempHeight] = [
9
+ 0,
10
+ 0
11
+ ];
12
+ if (imgWidth > 0 && imgHeight > 0) {
13
+ // 原图片宽高比例 大于 指定的宽高比例,这就说明了原图片的宽度必然 > 高度
14
+ if (imgWidth / imgHeight >= containerWidth / containerHeight) {
15
+ if (imgWidth > containerWidth) {
16
+ tempWidth = containerWidth;
17
+ // 按原图片的比例进行缩放
18
+ tempHeight = imgHeight * containerWidth / imgWidth;
19
+ } else {
20
+ // 按照图片的大小进行缩放
21
+ tempWidth = imgWidth;
22
+ tempHeight = imgHeight;
23
+ }
24
+ } else {
25
+ // 原图片的高度必然 > 宽度
26
+ if (imgHeight > containerHeight) {
27
+ tempHeight = containerHeight;
28
+ // 按原图片的比例进行缩放
29
+ tempWidth = imgWidth * containerHeight / imgHeight;
30
+ } else {
31
+ // 按原图片的大小进行缩放
32
+ tempWidth = imgWidth;
33
+ tempHeight = imgHeight;
34
+ }
35
+ }
36
+ }
37
+ return {
38
+ tempWidth,
39
+ tempHeight
40
+ };
41
+ }
@@ -0,0 +1,8 @@
1
+ import { cutOutBoxBorder, positionInfoType } from "../type/ComponentType";
2
+ /**
3
+ * 保存边框节点的相关信息
4
+ * @param borderSize 边框节点直径大小
5
+ * @param positionInfo 裁剪框位置信息
6
+ * @private
7
+ */
8
+ export declare function saveBorderArrInfo(borderSize: number, positionInfo: positionInfoType): cutOutBoxBorder[];
@@ -0,0 +1,125 @@
1
+ /**
2
+ * 保存边框节点的相关信息
3
+ * @param borderSize 边框节点直径大小
4
+ * @param positionInfo 裁剪框位置信息
5
+ * @private
6
+ */ export function saveBorderArrInfo(borderSize, positionInfo) {
7
+ // 获取裁剪框位置信息
8
+ const { startX, startY, width, height } = positionInfo;
9
+ const halfBorderSize = borderSize / 2;
10
+ const borderArr = [];
11
+ // 移动, n北s南e东w西
12
+ borderArr[0] = {
13
+ x: startX + halfBorderSize,
14
+ y: startY + halfBorderSize,
15
+ width: width - borderSize,
16
+ height: height - borderSize,
17
+ index: 1,
18
+ option: 1
19
+ };
20
+ // n
21
+ borderArr[1] = {
22
+ x: startX + halfBorderSize,
23
+ y: startY,
24
+ width: width - borderSize,
25
+ height: halfBorderSize,
26
+ index: 2,
27
+ option: 2
28
+ };
29
+ borderArr[2] = {
30
+ x: startX - halfBorderSize + width / 2,
31
+ y: startY - halfBorderSize,
32
+ width: borderSize,
33
+ height: halfBorderSize,
34
+ index: 2,
35
+ option: 2
36
+ };
37
+ // s
38
+ borderArr[3] = {
39
+ x: startX + halfBorderSize,
40
+ y: startY - halfBorderSize + height,
41
+ width: width - borderSize,
42
+ height: halfBorderSize,
43
+ index: 2,
44
+ option: 3
45
+ };
46
+ borderArr[4] = {
47
+ x: startX - halfBorderSize + width / 2,
48
+ y: startY + height,
49
+ width: borderSize,
50
+ height: halfBorderSize,
51
+ index: 2,
52
+ option: 3
53
+ };
54
+ // w
55
+ borderArr[5] = {
56
+ x: startX,
57
+ y: startY + halfBorderSize,
58
+ width: halfBorderSize,
59
+ height: height - borderSize,
60
+ index: 3,
61
+ option: 4
62
+ };
63
+ borderArr[6] = {
64
+ x: startX - halfBorderSize,
65
+ y: startY - halfBorderSize + height / 2,
66
+ width: halfBorderSize,
67
+ height: borderSize,
68
+ index: 3,
69
+ option: 4
70
+ };
71
+ // e
72
+ borderArr[7] = {
73
+ x: startX - halfBorderSize + width,
74
+ y: startY + halfBorderSize,
75
+ width: halfBorderSize,
76
+ height: height - borderSize,
77
+ index: 3,
78
+ option: 5
79
+ };
80
+ borderArr[8] = {
81
+ x: startX + width,
82
+ y: startY - halfBorderSize + height / 2,
83
+ width: halfBorderSize,
84
+ height: borderSize,
85
+ index: 3,
86
+ option: 5
87
+ };
88
+ // nw
89
+ borderArr[9] = {
90
+ x: startX - halfBorderSize,
91
+ y: startY - halfBorderSize,
92
+ width: borderSize,
93
+ height: borderSize,
94
+ index: 4,
95
+ option: 6
96
+ };
97
+ // se
98
+ borderArr[10] = {
99
+ x: startX - halfBorderSize + width,
100
+ y: startY - halfBorderSize + height,
101
+ width: borderSize,
102
+ height: borderSize,
103
+ index: 4,
104
+ option: 7
105
+ };
106
+ // ne
107
+ borderArr[11] = {
108
+ x: startX - halfBorderSize + width,
109
+ y: startY - halfBorderSize,
110
+ width: borderSize,
111
+ height: borderSize,
112
+ index: 5,
113
+ option: 8
114
+ };
115
+ // sw
116
+ borderArr[12] = {
117
+ x: startX - halfBorderSize,
118
+ y: startY - halfBorderSize + height,
119
+ width: borderSize,
120
+ height: borderSize,
121
+ index: 5,
122
+ option: 9
123
+ };
124
+ return borderArr;
125
+ }
@@ -0,0 +1 @@
1
+ export declare function saveCanvasToBase64(context: CanvasRenderingContext2D, startX: number, startY: number, width: number, height: number, quality?: number, writeBase64?: boolean): string;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * 将指定区域的canvas转换为base64格式的图片
3
+ */ import { getCanvas2dCtx } from "./CanvasPatch";
4
+ export function saveCanvasToBase64(context, startX, startY, width, height, quality = 0.75, writeBase64 = true) {
5
+ // 获取设备像素比
6
+ const dpr = window.devicePixelRatio || 1;
7
+ // 获取裁剪框区域图片信息
8
+ const img = context.getImageData(startX * dpr, startY * dpr, width * dpr, height * dpr);
9
+ // 创建canvas标签,用于存放裁剪区域的图片
10
+ const canvas = document.createElement("canvas");
11
+ // 获取裁剪框区域画布
12
+ const imgContext = getCanvas2dCtx(canvas, width, height);
13
+ if (imgContext) {
14
+ // 将图片放进canvas中
15
+ imgContext.putImageData(img, 0, 0);
16
+ if (writeBase64) {
17
+ var // 将图片自动添加至剪贴板中
18
+ _canvas;
19
+ (_canvas = canvas) === null || _canvas === void 0 ? void 0 : _canvas.toBlob((blob)=>{
20
+ var _navigator_clipboard;
21
+ if (blob == null) return;
22
+ const Clipboard = window.ClipboardItem;
23
+ // 浏览器不支持Clipboard
24
+ if (Clipboard == null) return canvas.toDataURL("png");
25
+ const clipboardItem = new Clipboard({
26
+ [blob.type]: blob
27
+ });
28
+ (_navigator_clipboard = navigator.clipboard) === null || _navigator_clipboard === void 0 ? void 0 : _navigator_clipboard.write([
29
+ clipboardItem
30
+ ]).then(()=>{
31
+ return "写入成功";
32
+ });
33
+ }, "image/png", quality);
34
+ }
35
+ return canvas.toDataURL("png");
36
+ }
37
+ return "";
38
+ }
@@ -0,0 +1 @@
1
+ export declare function saveCanvasToImage(context: CanvasRenderingContext2D, startX: number, startY: number, width: number, height: number): void;
@@ -0,0 +1,27 @@
1
+ import { getCanvas2dCtx } from "./CanvasPatch";
2
+ import PlugInParameters from "../main-entrance/PlugInParameters";
3
+ export function saveCanvasToImage(context, startX, startY, width, height) {
4
+ const plugInParameters = new PlugInParameters();
5
+ // 获取设备像素比
6
+ const dpr = window.devicePixelRatio || 1;
7
+ // 获取裁剪框区域图片信息
8
+ // 获取裁剪框区域图片信息
9
+ const img = context.getImageData(startX * dpr, startY * dpr, width * dpr, height * dpr);
10
+ // 创建canvas标签,用于存放裁剪区域的图片
11
+ const canvas = document.createElement("canvas");
12
+ // 获取裁剪框区域画布
13
+ const imgContext = getCanvas2dCtx(canvas, width, height);
14
+ if (imgContext) {
15
+ var _plugInParameters;
16
+ // 将图片放进裁剪框内
17
+ imgContext.putImageData(img, 0, 0);
18
+ const a = document.createElement("a");
19
+ // 获取图片
20
+ a.href = canvas.toDataURL("png");
21
+ // 获取用户传入的文件名
22
+ const imgName = ((_plugInParameters = plugInParameters) === null || _plugInParameters === void 0 ? void 0 : _plugInParameters.getSaveImgTitle()) || new Date().getTime();
23
+ // 下载图片
24
+ a.download = `${imgName}.png`;
25
+ a.click();
26
+ }
27
+ }
@@ -0,0 +1 @@
1
+ export declare function selectColor(): void;
@@ -0,0 +1,6 @@
1
+ import InitData from "../main-entrance/InitData";
2
+ export function selectColor() {
3
+ const data = new InitData();
4
+ // 显示颜色选择面板
5
+ data.setColorPanelStatus(true);
6
+ }
@@ -0,0 +1,5 @@
1
+ export declare function selectTextSize(): void;
2
+ export declare function setTextSize(size: number): void;
3
+ export declare function getTextSize(): number;
4
+ export declare function hiddenTextSizeOptionStatus(): void;
5
+ export declare function hiddenColorPanelStatus(): void;
@@ -0,0 +1,26 @@
1
+ import InitData from "../main-entrance/InitData";
2
+ export function selectTextSize() {
3
+ const data = new InitData();
4
+ // 显示文字大小选择面板
5
+ data.setTextSizeOptionStatus(true);
6
+ }
7
+ export function setTextSize(size) {
8
+ const data = new InitData();
9
+ // 设置字体大小
10
+ data.setFontSize(size);
11
+ }
12
+ export function getTextSize() {
13
+ const data = new InitData();
14
+ // 获取字体大小
15
+ return data.getFontSize();
16
+ }
17
+ export function hiddenTextSizeOptionStatus() {
18
+ const data = new InitData();
19
+ // 隐藏文字大小选择面板
20
+ data.setTextSizeOptionStatus(false);
21
+ }
22
+ export function hiddenColorPanelStatus() {
23
+ const data = new InitData();
24
+ // 隐藏颜色选择面板
25
+ data.setColorPanelStatus(false);
26
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 设置画笔大小
3
+ * @param size
4
+ * @param index
5
+ * @param mouseEvent
6
+ */
7
+ export declare function setBrushSize(size: string, index: number, mouseEvent: MouseEvent): number;
8
+ /**
9
+ * 设置马赛克工具的笔触大小
10
+ * @param size
11
+ * @param index
12
+ * @param mouseEvent
13
+ */
14
+ export declare function setMosaicPenSize(size: string, index: number, mouseEvent: MouseEvent): number;
@@ -0,0 +1,50 @@
1
+ import InitData from "../main-entrance/InitData";
2
+ import { setSelectedClassName } from "./SetSelectedClassName";
3
+ /**
4
+ * 设置画笔大小
5
+ * @param size
6
+ * @param index
7
+ * @param mouseEvent
8
+ */ export function setBrushSize(size, index, mouseEvent) {
9
+ const data = new InitData();
10
+ // 为当前点击项添加选中时的class名
11
+ setSelectedClassName(mouseEvent, index, true);
12
+ let sizeNum = 2;
13
+ switch(size){
14
+ case "small":
15
+ sizeNum = 2;
16
+ break;
17
+ case "medium":
18
+ sizeNum = 5;
19
+ break;
20
+ case "big":
21
+ sizeNum = 10;
22
+ break;
23
+ }
24
+ data.setPenSize(sizeNum);
25
+ return sizeNum;
26
+ }
27
+ /**
28
+ * 设置马赛克工具的笔触大小
29
+ * @param size
30
+ * @param index
31
+ * @param mouseEvent
32
+ */ export function setMosaicPenSize(size, index, mouseEvent) {
33
+ const data = new InitData();
34
+ // 为当前点击项添加选中时的class名
35
+ setSelectedClassName(mouseEvent, index, true);
36
+ let sizeNum = 10;
37
+ switch(size){
38
+ case "small":
39
+ sizeNum = 10;
40
+ break;
41
+ case "medium":
42
+ sizeNum = 20;
43
+ break;
44
+ case "big":
45
+ sizeNum = 40;
46
+ break;
47
+ }
48
+ data.setMosaicPenSize(sizeNum);
49
+ return sizeNum;
50
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 为当前点击项添加选中时的class,移除其兄弟元素选中时的class
3
+ * @param mouseEvent 需要进行操作的元素
4
+ * @param index 当前点击项
5
+ * @param isOption 是否为画笔选项
6
+ */
7
+ export declare function setSelectedClassName(mouseEvent: any, index: number, isOption: boolean): void;
@@ -0,0 +1,28 @@
1
+ import { getSelectedClassName } from "./GetSelectedCalssName";
2
+ import { getBrushSelectedName } from "./GetBrushSelectedName";
3
+ /**
4
+ * 为当前点击项添加选中时的class,移除其兄弟元素选中时的class
5
+ * @param mouseEvent 需要进行操作的元素
6
+ * @param index 当前点击项
7
+ * @param isOption 是否为画笔选项
8
+ */ export function setSelectedClassName(mouseEvent, index, isOption) {
9
+ // 获取当前点击项选中时的class名
10
+ let className = getSelectedClassName(index);
11
+ if (isOption) {
12
+ // 获取画笔选项选中时的对应的class
13
+ className = getBrushSelectedName(index);
14
+ }
15
+ // 解决event 在火狐和Safari浏览上的兼容性问题
16
+ const path = mouseEvent.path || mouseEvent.composedPath && mouseEvent.composedPath();
17
+ // 获取div下的所有子元素
18
+ const nodes = path[1].children;
19
+ for(let i = 0; i < nodes.length; i++){
20
+ const item = nodes[i];
21
+ // 如果工具栏中已经有选中的class则将其移除
22
+ if (item.className.includes("active")) {
23
+ item.classList.remove(item.classList[2]);
24
+ }
25
+ }
26
+ // 给当前点击项添加选中时的class
27
+ mouseEvent.target.className += " " + className;
28
+ }
@@ -0,0 +1 @@
1
+ export declare function takeOutHistory(): void;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * 取出一条历史记录
3
+ */ import InitData from "../main-entrance/InitData";
4
+ export function takeOutHistory() {
5
+ var _data_getScreenShotContainer;
6
+ const data = new InitData();
7
+ data.popHistory();
8
+ const screenShortCanvas = (_data_getScreenShotContainer = data.getScreenShotContainer()) === null || _data_getScreenShotContainer === void 0 ? void 0 : _data_getScreenShotContainer.getContext("2d");
9
+ if (screenShortCanvas != null) {
10
+ if (data.getHistory().length > 0) {
11
+ screenShortCanvas.putImageData(data.getHistory()[data.getHistory().length - 1]["data"], 0, 0);
12
+ }
13
+ }
14
+ data.setUndoClickNum(data.getUndoClickNum() + 1);
15
+ // 历史记录已取完,禁用撤回按钮点击
16
+ if (data.getHistory().length - 1 <= 0) {
17
+ data.setUndoClickNum(0);
18
+ data.setUndoStatus(false);
19
+ }
20
+ }
@@ -0,0 +1 @@
1
+ export declare function updateContainerMouseStyle(container: HTMLCanvasElement, toolName: string): void;
@@ -0,0 +1,10 @@
1
+ export function updateContainerMouseStyle(container, toolName) {
2
+ switch(toolName){
3
+ case "text":
4
+ container.style.cursor = "text";
5
+ break;
6
+ default:
7
+ container.style.cursor = "default";
8
+ break;
9
+ }
10
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * 缩放裁剪框
3
+ * @param currentX 当前鼠标X轴坐标
4
+ * @param currentY 当前鼠标Y轴坐标
5
+ * @param startX 裁剪框当前X轴坐标
6
+ * @param startY 裁剪框当前Y轴坐标
7
+ * @param width 裁剪框宽度
8
+ * @param height 裁剪框高度
9
+ * @param option 当前操作的节点
10
+ * @private
11
+ */
12
+ export declare function zoomCutOutBoxPosition(currentX: number, currentY: number, startX: number, startY: number, width: number, height: number, option: number): {
13
+ tempStartX: number;
14
+ tempStartY: number;
15
+ tempWidth: number;
16
+ tempHeight: number;
17
+ };
@@ -0,0 +1,92 @@
1
+ import { nonNegativeData } from "./FixedData";
2
+ /**
3
+ * 缩放裁剪框
4
+ * @param currentX 当前鼠标X轴坐标
5
+ * @param currentY 当前鼠标Y轴坐标
6
+ * @param startX 裁剪框当前X轴坐标
7
+ * @param startY 裁剪框当前Y轴坐标
8
+ * @param width 裁剪框宽度
9
+ * @param height 裁剪框高度
10
+ * @param option 当前操作的节点
11
+ * @private
12
+ */ export function zoomCutOutBoxPosition(currentX, currentY, startX, startY, width, height, option) {
13
+ // 临时坐标
14
+ let tempStartX, tempStartY, tempWidth, tempHeight = 0;
15
+ // 判断操作方向
16
+ switch(option){
17
+ case 2:
18
+ tempStartY = currentY - (startY + height) > 0 ? startY + height : currentY;
19
+ tempHeight = nonNegativeData(height - (currentY - startY));
20
+ return {
21
+ tempStartX: startX,
22
+ tempStartY,
23
+ tempWidth: width,
24
+ tempHeight
25
+ };
26
+ case 3:
27
+ tempHeight = nonNegativeData(currentY - startY);
28
+ return {
29
+ tempStartX: startX,
30
+ tempStartY: startY,
31
+ tempWidth: width,
32
+ tempHeight
33
+ };
34
+ case 4:
35
+ tempStartX = currentX - (startX + width) > 0 ? startX + width : currentX;
36
+ tempWidth = nonNegativeData(width - (currentX - startX));
37
+ return {
38
+ tempStartX,
39
+ tempStartY: startY,
40
+ tempWidth,
41
+ tempHeight: height
42
+ };
43
+ case 5:
44
+ tempWidth = nonNegativeData(currentX - startX);
45
+ return {
46
+ tempStartX: startX,
47
+ tempStartY: startY,
48
+ tempWidth,
49
+ tempHeight: height
50
+ };
51
+ case 6:
52
+ tempStartX = currentX - (startX + width) > 0 ? startX + width : currentX;
53
+ tempStartY = currentY - (startY + height) > 0 ? startY + height : currentY;
54
+ tempWidth = nonNegativeData(width - (currentX - startX));
55
+ tempHeight = nonNegativeData(height - (currentY - startY));
56
+ return {
57
+ tempStartX,
58
+ tempStartY,
59
+ tempWidth,
60
+ tempHeight
61
+ };
62
+ case 7:
63
+ tempWidth = nonNegativeData(currentX - startX);
64
+ tempHeight = nonNegativeData(currentY - startY);
65
+ return {
66
+ tempStartX: startX,
67
+ tempStartY: startY,
68
+ tempWidth,
69
+ tempHeight
70
+ };
71
+ case 8:
72
+ tempStartY = currentY - (startY + height) > 0 ? startY + height : currentY;
73
+ tempWidth = nonNegativeData(currentX - startX);
74
+ tempHeight = nonNegativeData(height - (currentY - startY));
75
+ return {
76
+ tempStartX: startX,
77
+ tempStartY,
78
+ tempWidth,
79
+ tempHeight
80
+ };
81
+ case 9:
82
+ tempStartX = currentX - (startX + width) > 0 ? startX + width : currentX;
83
+ tempWidth = nonNegativeData(width - (currentX - startX));
84
+ tempHeight = nonNegativeData(currentY - startY);
85
+ return {
86
+ tempStartX,
87
+ tempStartY: startY,
88
+ tempWidth,
89
+ tempHeight
90
+ };
91
+ }
92
+ }
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ id: number;
3
+ title: string;
4
+ }[];
5
+ export default _default;