@lm_fe/components 0.1.201

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 (127) hide show
  1. package/README.md +47 -0
  2. package/dist/ContainerDimensions/index.d.ts +10 -0
  3. package/dist/ContainerDimensions2/index.d.ts +10 -0
  4. package/dist/GlobalModal/index.d.ts +7 -0
  5. package/dist/GlobalModal/utils.d.ts +65 -0
  6. package/dist/LazyAntd/AutoComplete/Inner.d.ts +4 -0
  7. package/dist/LazyAntd/AutoComplete/index.d.ts +4 -0
  8. package/dist/LazyAntd/DatePicker/Base/Calendar.d.ts +3 -0
  9. package/dist/LazyAntd/DatePicker/Base/DatePicker.d.ts +11 -0
  10. package/dist/LazyAntd/DatePicker/Base/index.d.ts +12 -0
  11. package/dist/LazyAntd/DatePicker/Base/props.d.ts +14 -0
  12. package/dist/LazyAntd/DatePicker/Calendar.d.ts +4 -0
  13. package/dist/LazyAntd/DatePicker/DatePicker.d.ts +4 -0
  14. package/dist/LazyAntd/DatePicker/MonthPicker.d.ts +4 -0
  15. package/dist/LazyAntd/DatePicker/RangePicker.d.ts +4 -0
  16. package/dist/LazyAntd/DatePicker/TimePicker.d.ts +4 -0
  17. package/dist/LazyAntd/DatePicker/index.d.ts +5 -0
  18. package/dist/LazyAntd/Dropdown/Button.d.ts +2 -0
  19. package/dist/LazyAntd/Dropdown/Inner.d.ts +3 -0
  20. package/dist/LazyAntd/Dropdown/index.d.ts +10 -0
  21. package/dist/LazyAntd/Form/FormItemInner.d.ts +2 -0
  22. package/dist/LazyAntd/Form/Inner.d.ts +3 -0
  23. package/dist/LazyAntd/Form/index.d.ts +9 -0
  24. package/dist/LazyAntd/Modal/Inner.d.ts +4 -0
  25. package/dist/LazyAntd/Modal/index.d.ts +3 -0
  26. package/dist/LazyAntd/Pagination/Inner.d.ts +3 -0
  27. package/dist/LazyAntd/Pagination/index.d.ts +3 -0
  28. package/dist/LazyAntd/Select/Inner.d.ts +3 -0
  29. package/dist/LazyAntd/Select/OptionInner.d.ts +2 -0
  30. package/dist/LazyAntd/Select/index.d.ts +10 -0
  31. package/dist/LazyAntd/Table/Inner.d.ts +3 -0
  32. package/dist/LazyAntd/Table/index.d.ts +3 -0
  33. package/dist/LazyAntd/Tree/DirectoryTreeInner.d.ts +3 -0
  34. package/dist/LazyAntd/Tree/Inner.d.ts +3 -0
  35. package/dist/LazyAntd/Tree/TreeNodeInner.d.ts +4 -0
  36. package/dist/LazyAntd/Tree/index.d.ts +12 -0
  37. package/dist/LazyAntd/TreeSelect/Inner.d.ts +3 -0
  38. package/dist/LazyAntd/TreeSelect/index.d.ts +3 -0
  39. package/dist/LazyAntd/index.d.ts +25 -0
  40. package/dist/Monaco/Inner.d.ts +12 -0
  41. package/dist/Monaco/index.d.ts +1 -0
  42. package/dist/MyAddress/Inner.d.ts +3 -0
  43. package/dist/MyAddress/Old/InnerOld.d.ts +3 -0
  44. package/dist/MyAddress/Old/index.d.ts +3 -0
  45. package/dist/MyAddress/Old/options.d.ts +25 -0
  46. package/dist/MyAddress/index.d.ts +6 -0
  47. package/dist/MyAddress/type.d.ts +16 -0
  48. package/dist/MyAddress/utils.d.ts +6 -0
  49. package/dist/MyImageEditor/Inner.d.ts +4 -0
  50. package/dist/MyImageEditor/index.d.ts +16 -0
  51. package/dist/MyImageEditor/init_delete_control.d.ts +1 -0
  52. package/dist/MyImageEditor/utils.d.ts +36 -0
  53. package/dist/MyInput/index.d.ts +5 -0
  54. package/dist/MyInput/types.d.ts +9 -0
  55. package/dist/MyLazyComponent/index.d.ts +6 -0
  56. package/dist/PDF_Frame_View/Inner.d.ts +3 -0
  57. package/dist/PDF_Frame_View/index.d.ts +5 -0
  58. package/dist/PDF_Frame_View/types.d.ts +32 -0
  59. package/dist/PDF_Frame_View/utils.d.ts +9 -0
  60. package/dist/QRCode/Inner.d.ts +3 -0
  61. package/dist/QRCode/index.d.ts +2 -0
  62. package/dist/QRCode/types.d.ts +68 -0
  63. package/dist/SimpleForm/components/TabForm/index.d.ts +14 -0
  64. package/dist/SimpleForm/components/extra/Custom.d.ts +7 -0
  65. package/dist/SimpleForm/components/extra/MultiInput.d.ts +6 -0
  66. package/dist/SimpleForm/components/extra/SimpleSelect.d.ts +6 -0
  67. package/dist/SimpleForm/components/extra/SwitchSelect.d.ts +4 -0
  68. package/dist/SimpleForm/components/index.d.ts +37 -0
  69. package/dist/SimpleForm/index.d.ts +38 -0
  70. package/dist/SimpleForm/types/help.d.ts +3 -0
  71. package/dist/SimpleForm/types/metaTypes.d.ts +29 -0
  72. package/dist/a_chunks/.root.js +805 -0
  73. package/dist/a_chunks/.root.js.map +1 -0
  74. package/dist/a_chunks/.root10.js +8 -0
  75. package/dist/a_chunks/.root10.js.map +1 -0
  76. package/dist/a_chunks/.root11.js +7 -0
  77. package/dist/a_chunks/.root11.js.map +1 -0
  78. package/dist/a_chunks/.root12.js +8 -0
  79. package/dist/a_chunks/.root12.js.map +1 -0
  80. package/dist/a_chunks/.root13.js +4 -0
  81. package/dist/a_chunks/.root13.js.map +1 -0
  82. package/dist/a_chunks/.root14.js +8 -0
  83. package/dist/a_chunks/.root14.js.map +1 -0
  84. package/dist/a_chunks/.root15.js +7 -0
  85. package/dist/a_chunks/.root15.js.map +1 -0
  86. package/dist/a_chunks/.root16.js +8 -0
  87. package/dist/a_chunks/.root16.js.map +1 -0
  88. package/dist/a_chunks/.root17.js +8 -0
  89. package/dist/a_chunks/.root17.js.map +1 -0
  90. package/dist/a_chunks/.root18.js +8 -0
  91. package/dist/a_chunks/.root18.js.map +1 -0
  92. package/dist/a_chunks/.root19.js +8 -0
  93. package/dist/a_chunks/.root19.js.map +1 -0
  94. package/dist/a_chunks/.root2.js +227 -0
  95. package/dist/a_chunks/.root2.js.map +1 -0
  96. package/dist/a_chunks/.root20.js +6 -0
  97. package/dist/a_chunks/.root20.js.map +1 -0
  98. package/dist/a_chunks/.root21.js +5 -0
  99. package/dist/a_chunks/.root21.js.map +1 -0
  100. package/dist/a_chunks/.root3.js +7 -0
  101. package/dist/a_chunks/.root3.js.map +1 -0
  102. package/dist/a_chunks/.root4.js +918 -0
  103. package/dist/a_chunks/.root4.js.map +1 -0
  104. package/dist/a_chunks/.root5.js +195 -0
  105. package/dist/a_chunks/.root5.js.map +1 -0
  106. package/dist/a_chunks/.root6.js +361 -0
  107. package/dist/a_chunks/.root6.js.map +1 -0
  108. package/dist/a_chunks/.root7.js +8 -0
  109. package/dist/a_chunks/.root7.js.map +1 -0
  110. package/dist/a_chunks/.root8.js +8 -0
  111. package/dist/a_chunks/.root8.js.map +1 -0
  112. package/dist/a_chunks/.root9.js +7 -0
  113. package/dist/a_chunks/.root9.js.map +1 -0
  114. package/dist/a_chunks/index.js +1238 -0
  115. package/dist/a_chunks/index.js.map +1 -0
  116. package/dist/hooks/index.d.ts +2 -0
  117. package/dist/hooks/useMchcDriverStatus.d.ts +3 -0
  118. package/dist/hooks/useMyEffect.d.ts +4 -0
  119. package/dist/index.d.ts +11 -0
  120. package/dist/index.js +45 -0
  121. package/dist/index.js.map +1 -0
  122. package/dist/pack_components.d.ts +17 -0
  123. package/dist/style/index.d.ts +1 -0
  124. package/dist/utils/getInputStyle.d.ts +11 -0
  125. package/dist/utils/index.d.ts +2 -0
  126. package/dist/utils/other.d.ts +4 -0
  127. package/package.json +63 -0
@@ -0,0 +1,918 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
+ import 'antd/es/popover/style';
8
+ import _Popover from 'antd/es/popover';
9
+ import 'antd/es/button/style';
10
+ import _Button from 'antd/es/button';
11
+ import 'antd/es/switch/style';
12
+ import _Switch from 'antd/es/switch';
13
+ import 'antd/es/slider/style';
14
+ import _Slider from 'antd/es/slider';
15
+ import 'antd/es/layout/style';
16
+ import _Layout from 'antd/es/layout';
17
+ import _isString from 'lodash/isString';
18
+ import _get from 'lodash/get';
19
+ import { ClearOutlined } from '@ant-design/icons';
20
+ import { mchcLogger, mchcEvent } from '@lm_fe/env';
21
+ import { safe_json_parse, base64_to_image } from '@lm_fe/utils';
22
+ import classnames from 'classnames';
23
+ import React__default, { useRef, useState, useEffect } from 'react';
24
+ import { HuePicker } from 'react-color';
25
+ import { r as real_fabric, M as MyImageEditorEvents, e as event_process, d as default_legends } from './index.js';
26
+ import 'antd/es/input/style';
27
+ import 'antd/es/input';
28
+ import 'antd/es/skeleton/style';
29
+ import 'antd/es/skeleton';
30
+ import 'fabric';
31
+ import 'lodash/map';
32
+ import 'antd/es/modal/style';
33
+ import 'antd/es/modal';
34
+ import 'lodash/isNil';
35
+ import 'antd/es/row/style';
36
+ import 'antd/es/row';
37
+ import 'antd/es/col/style';
38
+ import 'antd/es/col';
39
+ import 'antd/es/form/style';
40
+ import 'antd/es/form';
41
+ import 'antd/es/divider/style';
42
+ import 'antd/es/divider';
43
+ import 'antd/es/rate/style';
44
+ import 'antd/es/rate';
45
+ import 'antd/es/time-picker/style';
46
+ import 'antd/es/time-picker';
47
+ import 'antd/es/checkbox/style';
48
+ import 'antd/es/checkbox';
49
+ import 'antd/es/input-number/style';
50
+ import 'antd/es/input-number';
51
+ import 'antd/es/radio/style';
52
+ import 'antd/es/radio';
53
+ import 'antd/es/date-picker/style';
54
+ import 'antd/es/date-picker';
55
+ import 'rc-tree/es/TreeNode';
56
+ import 'antd/es/tabs/style';
57
+ import 'antd/es/tabs';
58
+ import '@lm_fe/static';
59
+ import '@lm_fe/service';
60
+ import 'react-keep-alive-pro';
61
+ function styleInject(css, ref) {
62
+ if (ref === void 0) ref = {};
63
+ var insertAt = ref.insertAt;
64
+ if (!css || typeof document === 'undefined') {
65
+ return;
66
+ }
67
+ var head = document.head || document.getElementsByTagName('head')[0];
68
+ var style = document.createElement('style');
69
+ style.type = 'text/css';
70
+ if (insertAt === 'top') {
71
+ if (head.firstChild) {
72
+ head.insertBefore(style, head.firstChild);
73
+ } else {
74
+ head.appendChild(style);
75
+ }
76
+ } else {
77
+ head.appendChild(style);
78
+ }
79
+ if (style.styleSheet) {
80
+ style.styleSheet.cssText = css;
81
+ } else {
82
+ style.appendChild(document.createTextNode(css));
83
+ }
84
+ }
85
+ var css_248z = ".index-module_custom-image-editor__RK-wE {\n width: 100%;\n overflow: hidden;\n margin-top: -460px;\n position: relative;\n border: 1px solid #eee;\n}\n.index-module_custom-image-editor__RK-wE .index-module_react-img-editor-container__RYAxl,\n.index-module_custom-image-editor__RK-wE .index-module_konvajs-content__6WYGJ,\n.index-module_custom-image-editor__RK-wE .index-module_react-img-editor__8luIM {\n width: 100% !important;\n}\n.index-module_custom-image-editor__RK-wE .index-module_react-img-editor-palette__Xvk4K {\n background: #fff;\n}\n.index-module_custom-image-editor-save__eA0OC {\n position: absolute;\n right: 20px;\n bottom: 30px;\n}\n.index-module_custom-image-editor__RK-wE .index-module_custom-image-editor-null__52KxO {\n width: 100%;\n height: 460px;\n}\n.index-module_custom-image-editor__RK-wE .index-module_react-img-editor-toolbar__ps2nI {\n margin-left: -200px;\n position: absolute;\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n height: auto;\n width: 36px !important;\n display: block;\n}\n.index-module_custom-image-editor__RK-wE .index-module_react-img-editor-toolbar-separator__GTqg8 {\n display: none;\n}\n.index-module_gy-image-editor__2PgAg {\n margin: 4px;\n background-color: #fff;\n}\n.index-module_gy-image-editor__2PgAg .index-module_box-img__f2Nx9 {\n width: 90px;\n height: 90px;\n border: 1px solid #d7dce7;\n position: relative;\n margin-top: 8px;\n margin-left: 7px;\n cursor: move;\n}\n.index-module_gy-image-editor__2PgAg .index-module_box-img__f2Nx9 img {\n width: auto;\n max-width: 100%;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.index-module_gy-image-editor__2PgAg .index-module_box-text__valN7 {\n font-size: 12px;\n font-weight: 400;\n color: #828c99;\n line-height: 17px;\n text-align: center;\n}\n.index-module_gy-image-editor__2PgAg .ant-layout-sider {\n background: #fff;\n}\n.index-module_gy-image-editor__2PgAg .ant-layout {\n background: #fff;\n}\n.index-module_gy-image-editor__2PgAg #index-module_images__pRZ9O {\n overflow: hidden;\n clear: both;\n display: flex;\n flex-wrap: wrap;\n}\n.index-module_gy-image-editor__2PgAg #index-module_canvas-container__PuYZw {\n position: relative;\n}\n.index-module_gy-image-editor__2PgAg #index-module_canvas-container__PuYZw .index-module_tool-bar__kAiyj {\n position: absolute;\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n width: 32px;\n height: auto;\n}\n.index-module_gy-image-editor__2PgAg #index-module_canvas-container__PuYZw .index-module_tool-bar__kAiyj .ant-btn {\n width: 20px;\n height: 20px;\n padding: 6px 0;\n border: none;\n}\n.index-module_gy-image-editor__2PgAg .index-module_button-icon__463Ga {\n width: 16px;\n height: 16px;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n.index-module_gy-image-editor__2PgAg .index-module_back__MY6Kt {\n background-image: url(/lm_imgs/mie/back.svg);\n}\n.index-module_gy-image-editor__2PgAg .index-module_forward__IDKoN {\n background-image: url(/lm_imgs/mie/forward.svg);\n}\n.index-module_gy-image-editor__2PgAg .index-module_pen__GyJzG {\n background-image: url(/lm_imgs/mie/pen.svg);\n}\n.index-module_gy-image-editor__2PgAg .index-module_text__LVtw7 {\n background-image: url(/lm_imgs/mie/text.svg);\n}\n.index-module_gy-image-editor__2PgAg .index-module_rect__K6T6d {\n background-image: url(/lm_imgs/mie/rect.svg);\n}\n.index-module_gy-image-editor__2PgAg .index-module_circle-icon2__XjPuI {\n background-image: url(/lm_imgs/mie/circle.svg);\n background-color: none;\n}\n.index-module_gy-image-editor__2PgAg .index-module_triangle__-PP0Y {\n background-image: url(/lm_imgs/mie/triangle.svg);\n}\n.index-module_gy-image-editor__2PgAg .index-module_line__9-WZE {\n background-image: url(/lm_imgs/mie/line.svg);\n}\n.index-module_gy-image-editor__2PgAg .index-module_clear__mXP-m {\n background-image: url(/lm_imgs/mie/clear.svg);\n}\n.index-module_gy-image-editor__2PgAg .index-module_export__h9hhf {\n background-image: url(/lm_imgs/mie/export.svg);\n}\n.index-module_gy-image-editor__2PgAg .index-module_selected__eAmsn {\n background-image: url(/lm_imgs/mie/selected.svg);\n}\n.index-module_gy-image-editor__2PgAg .index-module_noselected__xuC3A {\n background-image: url(/lm_imgs/mie/no.svg);\n}\n.index-module_gy-image-editor__2PgAg .index-module_save__rtkNk {\n background-image: url(/lm_imgs/mie/save.svg);\n}\n.ant-btn:hover\n .ant-btn:focus .index-module_back__MY6Kt {\n background-image: url(/lm_imgs/mie/back-hover.svg);\n}\n.ant-btn:hover\n .ant-btn:focus .index-module_forward__IDKoN {\n background-image: url(/lm_imgs/mie/forward-hover.svg);\n}\n.ant-btn:hover\n .ant-btn:focus .index-module_pen__GyJzG {\n background-image: url(/lm_imgs/mie/pen-hover.svg);\n}\n.ant-btn:hover\n .ant-btn:focus .index-module_text__LVtw7 {\n background-image: url(/lm_imgs/mie/text-hover.svg);\n}\n.ant-btn:hover\n .ant-btn:focus .index-module_rect__K6T6d {\n background-image: url(/lm_imgs/mie/rect-hover.svg);\n}\n.ant-btn:hover\n .ant-btn:focus .index-module_circle-icon2__XjPuI {\n background-image: url(/lm_imgs/mie/circle-hover.svg);\n}\n.ant-btn:hover\n .ant-btn:focus .index-module_triangle__-PP0Y {\n background-image: url(/lm_imgs/mie/triangle-hover.svg);\n}\n.ant-btn:hover\n .ant-btn:focus .index-module_line__9-WZE {\n background-image: url(/lm_imgs/mie/line-hover.svg);\n}\n.ant-btn:hover\n .ant-btn:focus .index-module_clear__mXP-m {\n background-image: url(/lm_imgs/mie/clear-hover.svg);\n}\n.ant-btn:hover\n .ant-btn:focus .index-module_export__h9hhf {\n background-image: url(/lm_imgs/mie/export-hover.svg);\n}\n.ant-btn:hover\n .ant-btn:focus .index-module_selected__eAmsn {\n background-image: url(/lm_imgs/mie/selected-hover.svg);\n}\n.ant-btn:hover\n .ant-btn:focus .index-module_noselected__xuC3A {\n background-image: url(/lm_imgs/mie/no-hover.svg);\n}\n.ant-btn:hover\n .ant-btn:focus .index-module_save__rtkNk {\n background-image: url(/lm_imgs/mie/save-hover.svg);\n}\n";
86
+ var styles = {
87
+ "custom-image-editor": "index-module_custom-image-editor__RK-wE",
88
+ "react-img-editor-container": "index-module_react-img-editor-container__RYAxl",
89
+ "konvajs-content": "index-module_konvajs-content__6WYGJ",
90
+ "react-img-editor": "index-module_react-img-editor__8luIM",
91
+ "react-img-editor-palette": "index-module_react-img-editor-palette__Xvk4K",
92
+ "custom-image-editor-save": "index-module_custom-image-editor-save__eA0OC",
93
+ "custom-image-editor-null": "index-module_custom-image-editor-null__52KxO",
94
+ "react-img-editor-toolbar": "index-module_react-img-editor-toolbar__ps2nI",
95
+ "react-img-editor-toolbar-separator": "index-module_react-img-editor-toolbar-separator__GTqg8",
96
+ "gy-image-editor": "index-module_gy-image-editor__2PgAg",
97
+ "box-img": "index-module_box-img__f2Nx9",
98
+ "box-text": "index-module_box-text__valN7",
99
+ "images": "index-module_images__pRZ9O",
100
+ "canvas-container": "index-module_canvas-container__PuYZw",
101
+ "tool-bar": "index-module_tool-bar__kAiyj",
102
+ "button-icon": "index-module_button-icon__463Ga",
103
+ "back": "index-module_back__MY6Kt",
104
+ "forward": "index-module_forward__IDKoN",
105
+ "pen": "index-module_pen__GyJzG",
106
+ "text": "index-module_text__LVtw7",
107
+ "rect": "index-module_rect__K6T6d",
108
+ "circle-icon2": "index-module_circle-icon2__XjPuI",
109
+ "triangle": "index-module_triangle__-PP0Y",
110
+ "line": "index-module_line__9-WZE",
111
+ "clear": "index-module_clear__mXP-m",
112
+ "export": "index-module_export__h9hhf",
113
+ "selected": "index-module_selected__eAmsn",
114
+ "noselected": "index-module_noselected__xuC3A",
115
+ "save": "index-module_save__rtkNk"
116
+ };
117
+ styleInject(css_248z);
118
+ function init_delete_control() {
119
+ // create a rect object
120
+ var deleteIcon = "data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Ebene_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='595.275px' height='595.275px' viewBox='200 215 230 470' xml:space='preserve'%3E%3Ccircle style='fill:%23F44336;' cx='299.76' cy='439.067' r='218.516'/%3E%3Cg%3E%3Crect x='267.162' y='307.978' transform='matrix(0.7071 -0.7071 0.7071 0.7071 -222.6202 340.6915)' style='fill:white;' width='65.545' height='262.18'/%3E%3Crect x='266.988' y='308.153' transform='matrix(0.7071 0.7071 -0.7071 0.7071 398.3889 -83.3116)' style='fill:white;' width='65.544' height='262.179'/%3E%3C/g%3E%3C/svg%3E";
121
+ var img = document.createElement('img');
122
+ img.src = deleteIcon;
123
+ // real_fabric.Object.prototype.transparentCorners = false;
124
+ // real_fabric.Object.prototype.cornerColor = 'blue';
125
+ // real_fabric.Object.prototype.cornerStyle = 'circle';
126
+ real_fabric.Object.prototype.controls.deleteControl = new real_fabric.Control({
127
+ x: 0.5,
128
+ y: -0.5,
129
+ offsetY: 16,
130
+ offsetX: -16,
131
+ cursorStyle: 'pointer',
132
+ mouseUpHandler: function deleteObject(eventData, transform) {
133
+ var target = transform.target;
134
+ var canvas = target.canvas;
135
+ canvas === null || canvas === void 0 || canvas.remove(target);
136
+ canvas === null || canvas === void 0 || canvas.requestRenderAll();
137
+ return true;
138
+ },
139
+ render: function renderIcon(ctx, left, top, styleOverride, fabricObject) {
140
+ var size = 16;
141
+ ctx.save();
142
+ ctx.translate(left, top);
143
+ ctx.rotate(real_fabric.util.degreesToRadians(fabricObject.angle));
144
+ ctx.drawImage(img, -size / 2, -size / 2, size, size);
145
+ ctx.restore();
146
+ }
147
+ // cornerSize: 24
148
+ });
149
+ }
150
+ init_delete_control();
151
+ var Sider = _Layout.Sider,
152
+ Content = _Layout.Content;
153
+ function MyImageEditor_Inner(props) {
154
+ var value = props.value,
155
+ onChange = props.onChange,
156
+ canvasOptions = props.canvasOptions,
157
+ _props$legends = props.legends,
158
+ legends = _props$legends === void 0 ? default_legends : _props$legends;
159
+ var gyImageEditorRef = useRef(null);
160
+ //strokeWidth: number = 1;
161
+ //fontSize: number = 18;
162
+ //colors: any = "#fe547b";
163
+ var containner = useRef();
164
+ var currentType = useRef('free');
165
+ var textObject = useRef(null);
166
+ var drawingObject = useRef(null);
167
+ var mouseFrom = useRef({});
168
+ var idDrawing = useRef(false);
169
+ var isRedoing = useRef(false);
170
+ var mouseTo = useRef({});
171
+ var stateArr = useRef([]);
172
+ useRef(null);
173
+ var isTagging = useRef(true);
174
+ var freeDrawFlag = useRef(false);
175
+ var freeErase = useRef(false);
176
+ var textFlag = useRef(false);
177
+ var rectFlag = useRef(false);
178
+ var circleFlag = useRef(false);
179
+ var triangleFlag = useRef(false);
180
+ var lineFlag = useRef(false);
181
+ var legend_item = useRef({});
182
+ // const [legend_item, set_legend_item] = useState<Partial<(typeof default_legends)[number]>>({})
183
+ var _useState = useState('#fe547b'),
184
+ _useState2 = _slicedToArray(_useState, 2),
185
+ colors = _useState2[0],
186
+ set_colors = _useState2[1];
187
+ var _useState3 = useState(1),
188
+ _useState4 = _slicedToArray(_useState3, 2),
189
+ strokeWidth = _useState4[0],
190
+ set_strokeWidth = _useState4[1];
191
+ var _useState5 = useState(18),
192
+ _useState6 = _slicedToArray(_useState5, 2),
193
+ fontSize = _useState6[0],
194
+ set_fontSize = _useState6[1];
195
+ var _useState7 = useState(!!value),
196
+ _useState8 = _slicedToArray(_useState7, 2),
197
+ __checked = _useState8[0],
198
+ set_checked = _useState8[1];
199
+ useEffect(function () {
200
+ createContainner();
201
+ }, []);
202
+ useEffect(function () {
203
+ initCanvas();
204
+ }, [value]);
205
+ useEffect(function () {
206
+ return initEvent();
207
+ }, [colors, strokeWidth, fontSize, value]);
208
+ function broadcast_event(type) {
209
+ mchcEvent.emit('custom_msg', {
210
+ type: type,
211
+ data: {
212
+ ins: containner.current
213
+ }
214
+ });
215
+ }
216
+ function createContainner() {
217
+ var _gyImageEditorRef$cur;
218
+ gyImageEditorRef === null || gyImageEditorRef === void 0 || (_gyImageEditorRef$cur = gyImageEditorRef.current) === null || _gyImageEditorRef$cur === void 0 || _gyImageEditorRef$cur.clientWidth;
219
+ if (!containner.current) {
220
+ var _legends$length, _gyImageEditorRef$cur2;
221
+ var count = (_legends$length = legends.length) !== null && _legends$length !== void 0 ? _legends$length : 0;
222
+ var len = count ? 200 : 0;
223
+ containner.current = new real_fabric.Canvas('c', _objectSpread({
224
+ backgroundColor: '#fff',
225
+ width: (gyImageEditorRef === null || gyImageEditorRef === void 0 || (_gyImageEditorRef$cur2 = gyImageEditorRef.current) === null || _gyImageEditorRef$cur2 === void 0 ? void 0 : _gyImageEditorRef$cur2.clientWidth) - len,
226
+ height: 460
227
+ }, canvasOptions));
228
+ broadcast_event(MyImageEditorEvents.create);
229
+ }
230
+ }
231
+ function initCanvas() {
232
+ return _initCanvas.apply(this, arguments);
233
+ }
234
+ function _initCanvas() {
235
+ _initCanvas = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
236
+ var _containner$current19, img_el, _containner$current20, img;
237
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
238
+ while (1) switch (_context.prev = _context.next) {
239
+ case 0:
240
+ mchcLogger.log('initCanvas', {
241
+ value: value
242
+ });
243
+ if (!(value && _isString(value))) {
244
+ _context.next = 12;
245
+ break;
246
+ }
247
+ if (!safe_json_parse(value)) {
248
+ _context.next = 7;
249
+ break;
250
+ }
251
+ mchcLogger.log('initCanvas safe_json_parse', {
252
+ value: value
253
+ });
254
+ (_containner$current19 = containner.current) === null || _containner$current19 === void 0 || _containner$current19.loadFromJSON(value, function () {});
255
+ _context.next = 12;
256
+ break;
257
+ case 7:
258
+ mchcLogger.log('initCanvas base64_to_image', {
259
+ value: value
260
+ });
261
+ // 兼容base64 图片
262
+ _context.next = 10;
263
+ return base64_to_image(value);
264
+ case 10:
265
+ img_el = _context.sent;
266
+ if (img_el) {
267
+ img = new real_fabric.Image(img_el);
268
+ (_containner$current20 = containner.current) === null || _containner$current20 === void 0 || _containner$current20.add(img);
269
+ }
270
+ case 12:
271
+ if (!legends.length) {
272
+ initfreeDraw();
273
+ }
274
+ case 13:
275
+ case "end":
276
+ return _context.stop();
277
+ }
278
+ }, _callee);
279
+ }));
280
+ return _initCanvas.apply(this, arguments);
281
+ }
282
+ function initEvent() {
283
+ var eventType = ['line', 'circle', 'rect', 'triangle', 'text'];
284
+ var con = containner.current;
285
+ if (!con) return function () {};
286
+ var __events = {
287
+ drop: function drop(options) {
288
+ var item = legend_item.current;
289
+ real_fabric.util.loadImage(_get(item, 'img'), function (img) {
290
+ var legimg = new real_fabric.Image(img, {
291
+ left: options.e.offsetX,
292
+ top: options.e.offsetY,
293
+ width: _get(item, 'width'),
294
+ height: _get(item, 'height'),
295
+ // @ts-ignore
296
+ id: _get(item, 'id')
297
+ });
298
+ con.add(legimg);
299
+ handleSelectDraw();
300
+ }, {
301
+ crossOrigin: 'anonymous'
302
+ });
303
+ },
304
+ 'mouse:down': function mouseDown(options) {
305
+ if (eventType.indexOf(currentType.current) != -1) {
306
+ mouseFrom.current.x = options.e.offsetX;
307
+ mouseFrom.current.y = options.e.offsetY;
308
+ idDrawing.current = true;
309
+ switch (currentType.current) {
310
+ case 'text':
311
+ initText();
312
+ break;
313
+ }
314
+ }
315
+ },
316
+ "mouse:move": function mouseMove(options) {
317
+ if (idDrawing.current && eventType.indexOf(currentType.current) != -1) {
318
+ mouseTo.current.x = options.e.offsetX;
319
+ mouseTo.current.y = options.e.offsetY;
320
+ switch (currentType.current) {
321
+ case 'line':
322
+ ininLine();
323
+ break;
324
+ case 'circle':
325
+ initCircle();
326
+ break;
327
+ case 'rect':
328
+ initRect();
329
+ break;
330
+ case 'triangle':
331
+ initTriangle();
332
+ break;
333
+ case 'free':
334
+ initfreeDraw();
335
+ break;
336
+ }
337
+ }
338
+ },
339
+ 'mouse:up': function mouseUp(options) {
340
+ if (eventType.indexOf(currentType.current) != -1) {
341
+ mouseTo.current.x = options.e.offsetX;
342
+ mouseTo.current.y = options.e.offsetY;
343
+ drawingObject.current = null;
344
+ idDrawing.current = false;
345
+ resetMove();
346
+ }
347
+ },
348
+ 'mouse:over': function mouseOver(options) {},
349
+ 'mouse:out': function mouseOut(options) {},
350
+ 'object:added': function objectAdded() {
351
+ if (isRedoing.current == false) {
352
+ stateArr.current = [];
353
+ }
354
+ }
355
+ };
356
+ return event_process(con, __events);
357
+ }
358
+ function initText() {
359
+ var _containner$current;
360
+ createContainner();
361
+ containner.current.isDrawingMode = false;
362
+ containner.current.selection = false;
363
+ textObject.current = new real_fabric.Textbox('', {
364
+ left: mouseFrom.current.x,
365
+ top: mouseFrom.current.y,
366
+ fontSize: fontSize,
367
+ fill: colors,
368
+ hasControls: false
369
+ });
370
+ (_containner$current = containner.current) === null || _containner$current === void 0 || _containner$current.add(textObject.current);
371
+ textObject.current.enterEditing();
372
+ textObject.current.hiddenTextarea.focus();
373
+ }
374
+ function initRect() {
375
+ createContainner();
376
+ var left = mouseFrom.current.x;
377
+ var top = mouseFrom.current.y;
378
+ var width = mouseTo.current.x - mouseFrom.current.x;
379
+ var height = mouseTo.current.y - mouseFrom.current.y;
380
+ var canvasObject = new real_fabric.Rect({
381
+ left: left,
382
+ top: top,
383
+ width: width,
384
+ height: height,
385
+ stroke: colors,
386
+ fill: 'rgba(255, 255, 255, 0)',
387
+ strokeWidth: strokeWidth
388
+ });
389
+ toggleDrawingObject(canvasObject);
390
+ }
391
+ function initCircle() {
392
+ createContainner();
393
+ var left = mouseFrom.current.x;
394
+ var top = mouseFrom.current.y;
395
+ var radius = Math.sqrt((mouseTo.current.x - left) * (mouseTo.current.x - left) + (mouseTo.current.y - top) * (mouseTo.current.y - top)) / 2;
396
+ var canvasObject = new real_fabric.Circle({
397
+ left: left,
398
+ top: top,
399
+ stroke: colors,
400
+ fill: 'rgba(255, 255, 255, 0)',
401
+ radius: radius,
402
+ strokeWidth: strokeWidth
403
+ });
404
+ toggleDrawingObject(canvasObject);
405
+ }
406
+ function initTriangle() {
407
+ createContainner();
408
+ var left = mouseFrom.current.x;
409
+ var top = mouseFrom.current.y;
410
+ var height = mouseTo.current.y - mouseFrom.current.y;
411
+ var width = Math.sqrt(Math.pow(height, 2) + Math.pow(height / 2.0, 2));
412
+ var canvasObject = new real_fabric.Triangle({
413
+ left: left,
414
+ top: top,
415
+ width: width,
416
+ height: height,
417
+ stroke: colors,
418
+ fill: 'rgba(255, 255, 255, 0)',
419
+ strokeWidth: strokeWidth
420
+ });
421
+ toggleDrawingObject(canvasObject);
422
+ }
423
+ function ininLine() {
424
+ createContainner();
425
+ var canvasObject = new real_fabric.Line([mouseFrom.current.x, mouseFrom.current.y, mouseTo.current.x, mouseTo.current.y], {
426
+ fill: colors,
427
+ stroke: colors,
428
+ strokeWidth: strokeWidth
429
+ });
430
+ toggleDrawingObject(canvasObject);
431
+ }
432
+ function initfreeDraw() {
433
+ createContainner();
434
+ containner.current.isDrawingMode = true;
435
+ containner.current.freeDrawingBrush.color = colors;
436
+ containner.current.freeDrawingBrush.width = strokeWidth;
437
+ containner.current.renderAll();
438
+ }
439
+ function toggleDrawingObject(canvasObject) {
440
+ var _containner$current3;
441
+ containner.current.isDrawingMode = false;
442
+ containner.current.selection = false;
443
+ canvasObject.selectable = false;
444
+ if (drawingObject.current) {
445
+ var _containner$current2;
446
+ (_containner$current2 = containner.current) === null || _containner$current2 === void 0 || _containner$current2.remove(drawingObject.current);
447
+ }
448
+ (_containner$current3 = containner.current) === null || _containner$current3 === void 0 || _containner$current3.add(canvasObject);
449
+ drawingObject.current = canvasObject;
450
+ if (textObject.current) {
451
+ textObject.current.exitEditing();
452
+ textObject.current = null;
453
+ }
454
+ }
455
+ function resetMove() {
456
+ mouseFrom.current = {};
457
+ mouseTo.current = {};
458
+ }
459
+ //开始拖拽图片
460
+ function handleDragStart(e, item) {
461
+ legend_item.current = item;
462
+ }
463
+ //后退
464
+ function handleRevoke() {
465
+ var _containner$current4;
466
+ if (((_containner$current4 = containner.current) === null || _containner$current4 === void 0 ? void 0 : _containner$current4._objects.length) > 0) {
467
+ var _containner$current5, _containner$current6;
468
+ stateArr.current.push((_containner$current5 = containner.current) === null || _containner$current5 === void 0 ? void 0 : _containner$current5._objects.pop());
469
+ (_containner$current6 = containner.current) === null || _containner$current6 === void 0 || _containner$current6.renderAll();
470
+ }
471
+ }
472
+ //前进
473
+ function handleRedo() {
474
+ if (stateArr.current.length > 0) {
475
+ var _containner$current7, _containner$current8;
476
+ isRedoing.current = true;
477
+ (_containner$current7 = containner.current) === null || _containner$current7 === void 0 || _containner$current7.add(stateArr.current.pop());
478
+ (_containner$current8 = containner.current) === null || _containner$current8 === void 0 || _containner$current8.renderAll();
479
+ }
480
+ }
481
+ //清除
482
+ function handleClear() {
483
+ var _containner$current9;
484
+ (_containner$current9 = containner.current) === null || _containner$current9 === void 0 || _containner$current9.clear();
485
+ containner.current.backgroundColor = '#fff';
486
+ resetMove();
487
+ isRedoing.current = false;
488
+ stateArr.current = [];
489
+ }
490
+ //擦除
491
+ function handleFreeErase() {
492
+ if (!real_fabric.EraserBrush) return;
493
+ if (freeErase.current) {
494
+ freeErase.current = false;
495
+ containner.current.isDrawingMode = false;
496
+ } else {
497
+ freeErase.current = true;
498
+ freeDrawFlag.current = false;
499
+ textFlag.current = false;
500
+ rectFlag.current = false;
501
+ circleFlag.current = false;
502
+ triangleFlag.current = false;
503
+ lineFlag.current = false;
504
+ removeTextObject();
505
+ // 开启画布自由绘画模式
506
+ containner.current.isDrawingMode = true;
507
+ // 设置自由绘画模式 画笔颜色与画笔线条大小
508
+ containner.current.freeDrawingBrush = new real_fabric.EraserBrush(containner.current);
509
+ containner.current.freeDrawingBrush.width = 20;
510
+ currentType.current = 'free';
511
+ }
512
+ }
513
+ //自由绘画
514
+ function handleFreeDraw() {
515
+ if (freeDrawFlag.current) {
516
+ freeDrawFlag.current = false;
517
+ containner.current.isDrawingMode = false;
518
+ } else {
519
+ freeDrawFlag.current = true;
520
+ freeErase.current = false;
521
+ textFlag.current = false;
522
+ rectFlag.current = false;
523
+ circleFlag.current = false;
524
+ triangleFlag.current = false;
525
+ lineFlag.current = false;
526
+ if (real_fabric.PencilBrush) {
527
+ containner.current.freeDrawingBrush = new real_fabric.PencilBrush(containner.current);
528
+ }
529
+ removeTextObject();
530
+ // 开启画布自由绘画模式
531
+ containner.current.isDrawingMode = true;
532
+ // 设置自由绘画模式 画笔颜色与画笔线条大小
533
+ containner.current.freeDrawingBrush.color = colors;
534
+ containner.current.freeDrawingBrush.width = strokeWidth;
535
+ currentType.current = 'free';
536
+ }
537
+ }
538
+ //文本
539
+ function handleTextDraw() {
540
+ if (textFlag.current) {
541
+ textFlag.current = false;
542
+ removeTextObject();
543
+ } else {
544
+ textFlag.current = true;
545
+ freeDrawFlag.current = false;
546
+ freeErase.current = false;
547
+ rectFlag.current = false;
548
+ circleFlag.current = false;
549
+ triangleFlag.current = false;
550
+ lineFlag.current = false;
551
+ currentType.current = 'text';
552
+ containner.current.isDrawingMode = false;
553
+ containner.current.selection = false;
554
+ clearSelectable();
555
+ if (drawingObject.current) {
556
+ var _containner$current10;
557
+ (_containner$current10 = containner.current) === null || _containner$current10 === void 0 || _containner$current10.remove(drawingObject.current);
558
+ }
559
+ }
560
+ }
561
+ //矩形
562
+ function handleRectDraw() {
563
+ if (rectFlag.current) {
564
+ rectFlag.current = false;
565
+ currentType.current = '';
566
+ } else {
567
+ rectFlag.current = true;
568
+ textFlag.current = false;
569
+ freeDrawFlag.current = false;
570
+ freeErase.current = false;
571
+ circleFlag.current = false;
572
+ triangleFlag.current = false;
573
+ lineFlag.current = false;
574
+ isTagging.current = false;
575
+ currentType.current = 'rect';
576
+ clearSelectable();
577
+ initRect();
578
+ }
579
+ }
580
+ //圆形
581
+ function handleCircleDraw() {
582
+ if (circleFlag.current) {
583
+ circleFlag.current = false;
584
+ currentType.current = '';
585
+ } else {
586
+ rectFlag.current = false;
587
+ textFlag.current = false;
588
+ freeDrawFlag.current = false;
589
+ freeErase.current = false;
590
+ circleFlag.current = true;
591
+ triangleFlag.current = false;
592
+ lineFlag.current = false;
593
+ currentType.current = 'circle';
594
+ clearSelectable();
595
+ initCircle();
596
+ }
597
+ }
598
+ //三角形
599
+ function handleTriangleDraw() {
600
+ if (triangleFlag.current) {
601
+ triangleFlag.current = false;
602
+ currentType.current = '';
603
+ } else {
604
+ rectFlag.current = false;
605
+ textFlag.current = false;
606
+ freeDrawFlag.current = false;
607
+ freeErase.current = false;
608
+ circleFlag.current = false;
609
+ triangleFlag.current = true;
610
+ lineFlag.current = false;
611
+ currentType.current = 'triangle';
612
+ clearSelectable();
613
+ initTriangle();
614
+ }
615
+ }
616
+ //直线
617
+ function handleLineDraw() {
618
+ if (lineFlag.current) {
619
+ lineFlag.current = false;
620
+ currentType.current = '';
621
+ } else {
622
+ rectFlag.current = false;
623
+ textFlag.current = false;
624
+ freeDrawFlag.current = false;
625
+ freeErase.current = false;
626
+ circleFlag.current = false;
627
+ triangleFlag.current = false;
628
+ lineFlag.current = true;
629
+ currentType.current = 'line';
630
+ clearSelectable();
631
+ ininLine();
632
+ }
633
+ }
634
+ //下载图片
635
+ function handleExport() {
636
+ var _containner$current11, _containner$current12, _containner$current13;
637
+ var dataURL = (_containner$current11 = containner.current) === null || _containner$current11 === void 0 ? void 0 : _containner$current11.toDataURL({
638
+ width: (_containner$current12 = containner.current) === null || _containner$current12 === void 0 ? void 0 : _containner$current12.width,
639
+ height: (_containner$current13 = containner.current) === null || _containner$current13 === void 0 ? void 0 : _containner$current13.height,
640
+ left: 0,
641
+ top: 0,
642
+ format: 'png'
643
+ });
644
+ var link = document.createElement('a');
645
+ link.download = 'canvas.current?.png';
646
+ link.href = dataURL;
647
+ document.body.appendChild(link);
648
+ link.click();
649
+ document.body.removeChild(link);
650
+ }
651
+ function removeTextObject() {
652
+ currentType.current = '';
653
+ if (textObject.current) {
654
+ textObject.current.exitEditing();
655
+ textObject.current = null;
656
+ }
657
+ }
658
+ //颜色设置
659
+ function handleGradePicker(e) {
660
+ var colors = e.hex;
661
+ containner.current.freeDrawingBrush.color = colors;
662
+ set_colors(colors);
663
+ }
664
+ //粗细设置
665
+ function handleSlider(value) {
666
+ console.log('value', value);
667
+ set_strokeWidth(value);
668
+ }
669
+ //字体设置
670
+ function handleTextSlider(value) {
671
+ set_fontSize(value);
672
+ }
673
+ //清除选中
674
+ function clearSelectable() {
675
+ var _containner$current14;
676
+ (_containner$current14 = containner.current) === null || _containner$current14 === void 0 || _containner$current14.getObjects().map(function (item) {
677
+ item.set('selectable', false);
678
+ });
679
+ }
680
+ //不可选中
681
+ function handleUnselectDraw() {
682
+ var _containner$current15;
683
+ containner.current.isDrawingMode = false;
684
+ removeTextObject();
685
+ clearSelectable();
686
+ (_containner$current15 = containner.current) === null || _containner$current15 === void 0 || _containner$current15.renderAll();
687
+ }
688
+ //可选中
689
+ function handleSelectDraw() {
690
+ var _containner$current16, _containner$current17;
691
+ containner.current.isDrawingMode = false;
692
+ removeTextObject();
693
+ (_containner$current16 = containner.current) === null || _containner$current16 === void 0 || _containner$current16.getObjects().map(function (item) {
694
+ item.set('selectable', true);
695
+ });
696
+ (_containner$current17 = containner.current) === null || _containner$current17 === void 0 || _containner$current17.renderAll();
697
+ }
698
+ //保存图片到后台
699
+ function handleImgSave() {
700
+ var _containner$current18;
701
+ var value = JSON.stringify(containner.current);
702
+ (_containner$current18 = containner.current) === null || _containner$current18 === void 0 || _containner$current18.requestRenderAll();
703
+ onChange === null || onChange === void 0 || onChange(value);
704
+ broadcast_event(MyImageEditorEvents.save);
705
+ // 反序列化
706
+ // canvas.current?.loadFromJSON(value)
707
+ }
708
+ function handleSwitch(checked) {
709
+ set_checked(checked);
710
+ }
711
+ function renderSetUp() {
712
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
713
+ className: styles["slider"],
714
+ style: {
715
+ width: 300
716
+ }
717
+ }, /*#__PURE__*/React__default.createElement("span", null, "\u7C97\u7EC6"), /*#__PURE__*/React__default.createElement(_Slider, {
718
+ onChange: handleSlider,
719
+ value: strokeWidth
720
+ })), /*#__PURE__*/React__default.createElement("div", {
721
+ className: styles["picker"],
722
+ style: {
723
+ width: 300
724
+ }
725
+ }, /*#__PURE__*/React__default.createElement("span", null, "\u989C\u8272"), /*#__PURE__*/React__default.createElement(HuePicker, {
726
+ width: '300',
727
+ color: colors,
728
+ onChange: handleGradePicker
729
+ })));
730
+ }
731
+ function renderTextSetUp() {
732
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
733
+ className: styles["slider"],
734
+ style: {
735
+ width: 300
736
+ }
737
+ }, /*#__PURE__*/React__default.createElement("span", null, "\u5927\u5C0F"), /*#__PURE__*/React__default.createElement(_Slider, {
738
+ onChange: handleTextSlider,
739
+ value: fontSize
740
+ })), /*#__PURE__*/React__default.createElement("div", {
741
+ className: styles["picker"],
742
+ style: {
743
+ width: 300
744
+ }
745
+ }, /*#__PURE__*/React__default.createElement("span", null, "\u989C\u8272"), /*#__PURE__*/React__default.createElement(HuePicker, {
746
+ width: '300',
747
+ color: colors,
748
+ onChange: handleGradePicker
749
+ })));
750
+ }
751
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
752
+ className: styles["switch"],
753
+ style: {
754
+ margin: '13px 0 16px 58px'
755
+ }
756
+ }, /*#__PURE__*/React__default.createElement("span", null, "\u7535\u5B50\u753B\u677F\uFF1A"), /*#__PURE__*/React__default.createElement(_Switch, {
757
+ checkedChildren: "\u5F00\u542F",
758
+ unCheckedChildren: "\u5173\u95ED",
759
+ checked: __checked,
760
+ onChange: handleSwitch
761
+ })), /*#__PURE__*/React__default.createElement("div", {
762
+ className: styles["gy-image-editor"],
763
+ ref: gyImageEditorRef
764
+ }, /*#__PURE__*/React__default.createElement(_Layout, {
765
+ hidden: !__checked
766
+ }, legends.length ? /*#__PURE__*/React__default.createElement(Sider, {
767
+ style: {
768
+ borderTop: '1px solid #d7dce7'
769
+ }
770
+ }, /*#__PURE__*/React__default.createElement("div", {
771
+ id: styles["images"]
772
+ }, legends.map(function (l, idx) {
773
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
774
+ className: styles["box-img"]
775
+ }, /*#__PURE__*/React__default.createElement("img", {
776
+ draggable: "true",
777
+ onDragStart: function onDragStart(e) {
778
+ return handleDragStart(e, _objectSpread(_objectSpread({}, l), {}, {
779
+ id: idx
780
+ }));
781
+ },
782
+ src: l.img
783
+ })), /*#__PURE__*/React__default.createElement("div", {
784
+ className: styles["box-text"]
785
+ }, l.label));
786
+ }))) : null, /*#__PURE__*/React__default.createElement(Content, null, /*#__PURE__*/React__default.createElement("div", {
787
+ id: styles['canvas-container']
788
+ }, /*#__PURE__*/React__default.createElement("canvas", {
789
+ // width={canvasWidth}
790
+ // height="460"
791
+ id: "c",
792
+ style: {
793
+ border: '1px solid #d7dce7'
794
+ }
795
+ }), /*#__PURE__*/React__default.createElement("div", {
796
+ className: styles["tool-bar"]
797
+ }, /*#__PURE__*/React__default.createElement("div", {
798
+ className: styles["tool-bar-container"]
799
+ }, /*#__PURE__*/React__default.createElement(_Popover, {
800
+ placement: "left",
801
+ content: /*#__PURE__*/React__default.createElement("span", null, "\u540E\u9000")
802
+ }, /*#__PURE__*/React__default.createElement(_Button, {
803
+ onClick: handleRevoke,
804
+ icon: /*#__PURE__*/React__default.createElement("span", {
805
+ className: classnames(styles["button-icon"], styles["back"])
806
+ })
807
+ })), /*#__PURE__*/React__default.createElement(_Popover, {
808
+ placement: "left",
809
+ content: /*#__PURE__*/React__default.createElement("span", null, "\u524D\u8FDB")
810
+ }, /*#__PURE__*/React__default.createElement(_Button, {
811
+ onClick: handleRedo,
812
+ icon: /*#__PURE__*/React__default.createElement("span", {
813
+ className: classnames(styles["button-icon"], styles["forward"])
814
+ })
815
+ })), real_fabric.EraserBrush ? /*#__PURE__*/React__default.createElement(_Popover, {
816
+ placement: "left",
817
+ content: /*#__PURE__*/React__default.createElement("span", null, "\u64E6\u9664")
818
+ }, /*#__PURE__*/React__default.createElement(_Button, {
819
+ onClick: handleFreeErase,
820
+ icon: /*#__PURE__*/React__default.createElement(ClearOutlined, null)
821
+ })) : null, /*#__PURE__*/React__default.createElement(_Popover, {
822
+ placement: "left",
823
+ content: renderSetUp(),
824
+ title: "\u8BBE\u7F6E"
825
+ }, /*#__PURE__*/React__default.createElement(_Button, {
826
+ onClick: handleFreeDraw,
827
+ icon: /*#__PURE__*/React__default.createElement("span", {
828
+ className: classnames(styles["button-icon"], styles["pen"])
829
+ })
830
+ })), /*#__PURE__*/React__default.createElement(_Popover, {
831
+ placement: "left",
832
+ content: renderTextSetUp(),
833
+ title: "\u8BBE\u7F6E"
834
+ }, /*#__PURE__*/React__default.createElement(_Button, {
835
+ onClick: handleTextDraw,
836
+ icon: /*#__PURE__*/React__default.createElement("span", {
837
+ className: classnames(styles["button-icon"], styles["text"])
838
+ })
839
+ })), /*#__PURE__*/React__default.createElement(_Popover, {
840
+ placement: "left",
841
+ content: renderSetUp(),
842
+ title: "\u8BBE\u7F6E"
843
+ }, /*#__PURE__*/React__default.createElement(_Button, {
844
+ onClick: handleRectDraw,
845
+ icon: /*#__PURE__*/React__default.createElement("span", {
846
+ className: classnames(styles["button-icon"], styles["rect"])
847
+ })
848
+ })), /*#__PURE__*/React__default.createElement(_Popover, {
849
+ placement: "left",
850
+ content: renderSetUp(),
851
+ title: "\u8BBE\u7F6E"
852
+ }, /*#__PURE__*/React__default.createElement(_Button, {
853
+ onClick: handleCircleDraw,
854
+ icon: /*#__PURE__*/React__default.createElement("span", {
855
+ className: classnames(styles["button-icon"], styles["circle-icon2"])
856
+ })
857
+ })), /*#__PURE__*/React__default.createElement(_Popover, {
858
+ placement: "left",
859
+ content: renderSetUp(),
860
+ title: "\u8BBE\u7F6E"
861
+ }, /*#__PURE__*/React__default.createElement(_Button, {
862
+ onClick: handleTriangleDraw,
863
+ icon: /*#__PURE__*/React__default.createElement("span", {
864
+ className: classnames(styles["button-icon"], styles["triangle"])
865
+ })
866
+ })), /*#__PURE__*/React__default.createElement(_Popover, {
867
+ placement: "left",
868
+ content: renderSetUp(),
869
+ title: "\u8BBE\u7F6E"
870
+ }, /*#__PURE__*/React__default.createElement(_Button, {
871
+ onClick: handleLineDraw,
872
+ icon: /*#__PURE__*/React__default.createElement("span", {
873
+ className: classnames(styles["button-icon"], styles["line"])
874
+ })
875
+ })), /*#__PURE__*/React__default.createElement(_Popover, {
876
+ placement: "left",
877
+ content: /*#__PURE__*/React__default.createElement("span", null, "\u6E05\u9664")
878
+ }, /*#__PURE__*/React__default.createElement(_Button, {
879
+ onClick: handleClear,
880
+ icon: /*#__PURE__*/React__default.createElement("span", {
881
+ className: classnames(styles["button-icon"], styles["clear"])
882
+ })
883
+ })), /*#__PURE__*/React__default.createElement(_Popover, {
884
+ placement: "left",
885
+ content: /*#__PURE__*/React__default.createElement("span", null, "\u5BFC\u51FA")
886
+ }, /*#__PURE__*/React__default.createElement(_Button, {
887
+ onClick: handleExport,
888
+ icon: /*#__PURE__*/React__default.createElement("span", {
889
+ className: classnames(styles["button-icon"], styles["export"])
890
+ })
891
+ })), /*#__PURE__*/React__default.createElement(_Popover, {
892
+ placement: "left",
893
+ content: /*#__PURE__*/React__default.createElement("span", null, "\u53EF\u9009\u4E2D")
894
+ }, /*#__PURE__*/React__default.createElement(_Button, {
895
+ onClick: handleSelectDraw,
896
+ icon: /*#__PURE__*/React__default.createElement("span", {
897
+ className: classnames(styles["button-icon"], styles["selected"])
898
+ })
899
+ })), /*#__PURE__*/React__default.createElement(_Popover, {
900
+ placement: "left",
901
+ content: /*#__PURE__*/React__default.createElement("span", null, "\u4E0D\u53EF\u9009\u4E2D")
902
+ }, /*#__PURE__*/React__default.createElement(_Button, {
903
+ onClick: handleUnselectDraw,
904
+ icon: /*#__PURE__*/React__default.createElement("span", {
905
+ className: classnames(styles["button-icon"], styles["noselected"])
906
+ })
907
+ })), /*#__PURE__*/React__default.createElement(_Popover, {
908
+ placement: "left",
909
+ content: /*#__PURE__*/React__default.createElement("span", null, "\u4FDD\u5B58")
910
+ }, /*#__PURE__*/React__default.createElement(_Button, {
911
+ onClick: handleImgSave,
912
+ icon: /*#__PURE__*/React__default.createElement("span", {
913
+ className: classnames(styles["button-icon"], styles["save"])
914
+ })
915
+ })))))))));
916
+ }
917
+ export { MyImageEditor_Inner as default };
918
+ //# sourceMappingURL=.root4.js.map