assui 2.3.9 → 3.0.0-alpha.0

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 (168) hide show
  1. package/es/a-select/index.js +7 -22
  2. package/es/a-select/style/index.css +195 -743
  3. package/es/area-text/index.js +1 -3
  4. package/es/button-drawer/index.js +12 -30
  5. package/es/button-modal/index.js +12 -33
  6. package/es/color-select/index.js +10 -23
  7. package/es/color-select/style/index.css +195 -743
  8. package/es/condition-input/index.js +8 -26
  9. package/es/condition-input/parse2RegexOption.js +0 -11
  10. package/es/config-provider/index.js +1 -3
  11. package/es/copy-to-clipboard/index.js +11 -27
  12. package/es/copy-to-clipboard/style/index.css +0 -1
  13. package/es/highlight-textarea/HighlighedContents.js +1 -3
  14. package/es/highlight-textarea/extractSpansOfClasses.d.ts +1 -0
  15. package/es/highlight-textarea/extractSpansOfClasses.js +7 -29
  16. package/es/highlight-textarea/getRanges.js +3 -35
  17. package/es/highlight-textarea/getType.js +0 -6
  18. package/es/highlight-textarea/index.js +11 -30
  19. package/es/highlight-textarea/style/index.css +7 -21
  20. package/es/img-crop/EasyCrop.js +18 -34
  21. package/es/img-crop/getCroppedImg.js +15 -50
  22. package/es/img-crop/index.js +56 -145
  23. package/es/img-crop/style/index.css +195 -743
  24. package/es/json-editor/index.js +6 -20
  25. package/es/keep-tab/index.d.ts +7 -2
  26. package/es/keep-tab/index.js +34 -59
  27. package/es/keep-tab/style/index.css +39 -99
  28. package/es/label-auto-complete/index.js +14 -32
  29. package/es/label-auto-complete/style/index.css +195 -743
  30. package/es/label-condition-input/index.js +13 -29
  31. package/es/label-customize-range-picker/defaultRadioList.js +0 -3
  32. package/es/label-customize-range-picker/index.js +36 -78
  33. package/es/label-customize-range-picker/style/index.css +195 -743
  34. package/es/label-customize-range-picker/utils/index.js +5 -14
  35. package/es/label-date-picker/index.js +11 -28
  36. package/es/label-date-picker/style/index.css +195 -743
  37. package/es/label-input/index.js +23 -37
  38. package/es/label-number-input/index.js +13 -28
  39. package/es/label-range-picker/index.js +11 -28
  40. package/es/label-range-picker/style/index.css +195 -743
  41. package/es/label-select/index.js +11 -27
  42. package/es/label-select/style/index.css +195 -743
  43. package/es/label-text-area/index.js +13 -35
  44. package/es/label-tree-select/index.js +15 -32
  45. package/es/label-tree-select/style/index.css +195 -743
  46. package/es/number-format-input/index.js +1 -11
  47. package/es/number-input/index.js +18 -37
  48. package/es/number-input/utils.js +7 -15
  49. package/es/rc-echart/core.js +15 -27
  50. package/es/rc-echart/index.js +0 -6
  51. package/es/rc-qrcode/index.js +2 -12
  52. package/es/rc-qrcode/useQrcode.js +5 -12
  53. package/es/rich-text-editor/index.js +5 -16
  54. package/es/rich-text-editor/plugins/code/index.js +0 -8
  55. package/es/rich-text-editor/style/index.css +195 -743
  56. package/es/single-img-upload/index.js +36 -110
  57. package/es/single-img-upload/style/index.css +195 -743
  58. package/es/split-pane/index.js +0 -4
  59. package/es/step-number-input/index.js +14 -39
  60. package/es/step-number-input/style/index.css +195 -743
  61. package/es/table-col/index.js +2 -4
  62. package/es/text-area/index.js +8 -27
  63. package/es/text-input/index.js +4 -18
  64. package/es/text-input/style/index.css +7 -21
  65. package/lib/a-select/index.js +7 -27
  66. package/lib/a-select/style/index.css +195 -743
  67. package/lib/a-select/style/index.js +0 -2
  68. package/lib/area-text/index.js +1 -6
  69. package/lib/area-text/style/index.js +0 -1
  70. package/lib/beautiful-dnd/index.js +0 -9
  71. package/lib/button-drawer/index.js +12 -42
  72. package/lib/button-drawer/style/index.js +0 -1
  73. package/lib/button-modal/index.js +12 -44
  74. package/lib/button-modal/style/index.js +0 -1
  75. package/lib/color-select/index.js +10 -39
  76. package/lib/color-select/style/index.css +195 -743
  77. package/lib/color-select/style/index.js +0 -2
  78. package/lib/condition-input/index.js +8 -41
  79. package/lib/condition-input/parse2RegexOption.js +0 -16
  80. package/lib/condition-input/style/index.js +0 -1
  81. package/lib/config-provider/context.js +0 -4
  82. package/lib/config-provider/index.js +1 -28
  83. package/lib/copy-to-clipboard/index.js +11 -38
  84. package/lib/copy-to-clipboard/style/index.css +0 -1
  85. package/lib/copy-to-clipboard/style/index.js +0 -1
  86. package/lib/highlight-textarea/HighlighedContents.js +1 -7
  87. package/lib/highlight-textarea/extractSpansOfClasses.d.ts +1 -0
  88. package/lib/highlight-textarea/extractSpansOfClasses.js +7 -31
  89. package/lib/highlight-textarea/getRanges.js +3 -38
  90. package/lib/highlight-textarea/getType.js +0 -8
  91. package/lib/highlight-textarea/index.js +11 -44
  92. package/lib/highlight-textarea/style/index.css +7 -21
  93. package/lib/highlight-textarea/style/index.js +0 -1
  94. package/lib/highlight-words/index.js +0 -3
  95. package/lib/img-crop/EasyCrop.js +18 -44
  96. package/lib/img-crop/getCroppedImg.js +15 -51
  97. package/lib/img-crop/index.js +56 -159
  98. package/lib/img-crop/style/index.css +195 -743
  99. package/lib/img-crop/style/index.js +0 -3
  100. package/lib/index.js +0 -77
  101. package/lib/json-editor/index.js +6 -35
  102. package/lib/json-editor/style/index.js +0 -2
  103. package/lib/keep-tab/index.d.ts +7 -2
  104. package/lib/keep-tab/index.js +34 -76
  105. package/lib/keep-tab/style/index.css +39 -99
  106. package/lib/keep-tab/style/index.js +0 -2
  107. package/lib/label-auto-complete/index.js +14 -39
  108. package/lib/label-auto-complete/style/index.css +195 -743
  109. package/lib/label-auto-complete/style/index.js +0 -2
  110. package/lib/label-condition-input/index.js +13 -36
  111. package/lib/label-condition-input/style/index.js +0 -1
  112. package/lib/label-customize-range-picker/defaultRadioList.js +0 -7
  113. package/lib/label-customize-range-picker/index.js +36 -99
  114. package/lib/label-customize-range-picker/style/index.css +195 -743
  115. package/lib/label-customize-range-picker/style/index.js +0 -5
  116. package/lib/label-customize-range-picker/utils/index.js +5 -19
  117. package/lib/label-date-picker/index.js +11 -34
  118. package/lib/label-date-picker/style/index.css +195 -743
  119. package/lib/label-date-picker/style/index.js +0 -2
  120. package/lib/label-input/index.js +23 -46
  121. package/lib/label-input/style/index.js +0 -1
  122. package/lib/label-number-input/index.js +13 -36
  123. package/lib/label-number-input/style/index.js +0 -1
  124. package/lib/label-range-picker/index.js +11 -36
  125. package/lib/label-range-picker/style/index.css +195 -743
  126. package/lib/label-range-picker/style/index.js +0 -2
  127. package/lib/label-select/index.js +11 -36
  128. package/lib/label-select/style/index.css +195 -743
  129. package/lib/label-select/style/index.js +0 -2
  130. package/lib/label-text-area/index.js +13 -40
  131. package/lib/label-text-area/style/index.js +0 -1
  132. package/lib/label-tree-select/index.js +15 -38
  133. package/lib/label-tree-select/style/index.css +195 -743
  134. package/lib/label-tree-select/style/index.js +0 -2
  135. package/lib/messages/index.js +0 -2
  136. package/lib/number-format-input/index.js +1 -15
  137. package/lib/number-format-input/style/index.js +0 -1
  138. package/lib/number-input/index.js +18 -55
  139. package/lib/number-input/style/index.js +0 -1
  140. package/lib/number-input/utils.js +8 -20
  141. package/lib/rc-echart/core.js +15 -40
  142. package/lib/rc-echart/index.js +0 -17
  143. package/lib/rc-motion/index.js +0 -3
  144. package/lib/rc-qrcode/index.js +2 -25
  145. package/lib/rc-qrcode/useQrcode.js +5 -17
  146. package/lib/rc-transition-group/index.js +0 -9
  147. package/lib/resizable/index.js +0 -2
  148. package/lib/resizable/style/index.js +0 -1
  149. package/lib/rich-text-editor/index.js +5 -53
  150. package/lib/rich-text-editor/plugins/code/index.js +2 -12
  151. package/lib/rich-text-editor/style/index.css +195 -743
  152. package/lib/rich-text-editor/style/index.js +0 -1
  153. package/lib/single-img-upload/index.js +36 -125
  154. package/lib/single-img-upload/style/index.css +195 -743
  155. package/lib/single-img-upload/style/index.js +0 -3
  156. package/lib/sortable-hoc/index.js +0 -9
  157. package/lib/split-pane/index.js +0 -15
  158. package/lib/split-pane/style/index.js +0 -1
  159. package/lib/step-number-input/index.js +14 -55
  160. package/lib/step-number-input/style/index.css +195 -743
  161. package/lib/step-number-input/style/index.js +0 -2
  162. package/lib/table-col/index.js +2 -6
  163. package/lib/text-area/index.js +8 -38
  164. package/lib/text-area/style/index.js +0 -1
  165. package/lib/text-input/index.js +4 -23
  166. package/lib/text-input/style/index.css +7 -21
  167. package/lib/text-input/style/index.js +0 -1
  168. package/package.json +6 -6
@@ -2,42 +2,32 @@ var __assign = this && this.__assign || function () {
2
2
  __assign = Object.assign || function (t) {
3
3
  for (var s, i = 1, n = arguments.length; i < n; i++) {
4
4
  s = arguments[i];
5
-
6
5
  for (var p in s) {
7
6
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
7
  }
9
8
  }
10
-
11
9
  return t;
12
10
  };
13
-
14
11
  return __assign.apply(this, arguments);
15
12
  };
16
-
17
13
  var __rest = this && this.__rest || function (s, e) {
18
14
  var t = {};
19
-
20
15
  for (var p in s) {
21
16
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
22
17
  }
23
-
24
18
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
25
19
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
26
20
  }
27
21
  return t;
28
22
  };
29
-
30
23
  import React from 'react';
31
24
  import ReactNumberFormat from 'react-number-format';
32
25
  import classNames from 'classnames';
33
-
34
26
  var NumberFormatInput = function NumberFormatInput(_a) {
35
27
  var className = _a.className,
36
- restProps = __rest(_a, ["className"]);
37
-
28
+ restProps = __rest(_a, ["className"]);
38
29
  return /*#__PURE__*/React.createElement(ReactNumberFormat, __assign({}, restProps, {
39
30
  className: classNames('rc-number-format-input', className)
40
31
  }));
41
32
  };
42
-
43
33
  export default NumberFormatInput;
@@ -2,39 +2,31 @@ var __assign = this && this.__assign || function () {
2
2
  __assign = Object.assign || function (t) {
3
3
  for (var s, i = 1, n = arguments.length; i < n; i++) {
4
4
  s = arguments[i];
5
-
6
5
  for (var p in s) {
7
6
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
7
  }
9
8
  }
10
-
11
9
  return t;
12
10
  };
13
-
14
11
  return __assign.apply(this, arguments);
15
12
  };
16
-
17
13
  var __rest = this && this.__rest || function (s, e) {
18
14
  var t = {};
19
-
20
15
  for (var p in s) {
21
16
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
22
17
  }
23
-
24
18
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
25
19
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
26
20
  }
27
21
  return t;
28
22
  };
29
-
30
23
  var __read = this && this.__read || function (o, n) {
31
24
  var m = typeof Symbol === "function" && o[Symbol.iterator];
32
25
  if (!m) return o;
33
26
  var i = m.call(o),
34
- r,
35
- ar = [],
36
- e;
37
-
27
+ r,
28
+ ar = [],
29
+ e;
38
30
  try {
39
31
  while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
40
32
  ar.push(r.value);
@@ -50,10 +42,8 @@ var __read = this && this.__read || function (o, n) {
50
42
  if (e) throw e.error;
51
43
  }
52
44
  }
53
-
54
45
  return ar;
55
46
  };
56
-
57
47
  import * as React from 'react';
58
48
  import Input from "antd/es/input";
59
49
  import useControllableValue from "ahooks/es/useControllableValue";
@@ -63,28 +53,25 @@ import * as numberTypeEnum from './const/numberType';
63
53
  import { filterInt, filterFloat } from './utils';
64
54
  var NumberInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
65
55
  var _a = __read(useControllableValue(props, {
66
- defaultValue: ''
67
- }), 2),
68
- value = _a[0],
69
- setValue = _a[1];
70
-
56
+ defaultValue: ''
57
+ }), 2),
58
+ value = _a[0],
59
+ setValue = _a[1];
71
60
  var onChange = props.onChange,
72
- _b = props.numberType,
73
- numberType = _b === void 0 ? numberTypeEnum.INT : _b,
74
- _c = props.dataType,
75
- dataType = _c === void 0 ? dataTypeEnum.NUMBER : _c,
76
- precision = props.precision,
77
- formatter = props.formatter,
78
- parser = props.parser,
79
- enableMinus = props.enableMinus,
80
- onBlur = props.onBlur,
81
- maxLength = props.maxLength,
82
- restProps = __rest(props, ["onChange", "numberType", "dataType", "precision", "formatter", "parser", "enableMinus", "onBlur", "maxLength"]);
83
-
61
+ _b = props.numberType,
62
+ numberType = _b === void 0 ? numberTypeEnum.INT : _b,
63
+ _c = props.dataType,
64
+ dataType = _c === void 0 ? dataTypeEnum.NUMBER : _c,
65
+ precision = props.precision,
66
+ formatter = props.formatter,
67
+ parser = props.parser,
68
+ enableMinus = props.enableMinus,
69
+ onBlur = props.onBlur,
70
+ maxLength = props.maxLength,
71
+ restProps = __rest(props, ["onChange", "numberType", "dataType", "precision", "formatter", "parser", "enableMinus", "onBlur", "maxLength"]);
84
72
  var onNumberChange = function onNumberChange(e) {
85
73
  var newNumber;
86
74
  var newValue = e.target.value;
87
-
88
75
  if (numberType === numberTypeEnum.INT) {
89
76
  newNumber = filterInt({
90
77
  value: newValue,
@@ -99,19 +86,15 @@ var NumberInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
99
86
  enableMinus: enableMinus
100
87
  });
101
88
  }
102
-
103
89
  if (parser) {
104
90
  newNumber = parser(newNumber);
105
91
  }
106
-
107
92
  if (value !== newNumber) {
108
93
  setValue(newNumber);
109
94
  }
110
95
  };
111
-
112
96
  var onNumberBlur = function onNumberBlur() {
113
97
  var resultValue = value;
114
-
115
98
  if (value === '-' || value === '.') {
116
99
  resultValue = '';
117
100
  } else if (value && dataType === dataTypeEnum.NUMBER) {
@@ -121,11 +104,9 @@ var NumberInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
121
104
  resultValue = parseInt("".concat(value), 10);
122
105
  }
123
106
  }
124
-
125
107
  setValue(resultValue);
126
108
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(resultValue);
127
109
  };
128
-
129
110
  var finallyValue = formatter ? formatter("".concat(value)) : value;
130
111
  return /*#__PURE__*/React.createElement(Input, __assign({
131
112
  type: "text",
@@ -2,44 +2,36 @@
2
2
  var intNumberReg = /^-?\d+$/;
3
3
  export var filterInt = function filterInt(_a) {
4
4
  var value = _a.value,
5
- enableMinus = _a.enableMinus,
6
- preValue = _a.preValue;
5
+ enableMinus = _a.enableMinus,
6
+ preValue = _a.preValue;
7
7
  var nextValue = value.replace(/[^\d\-]/g, '');
8
-
9
8
  if (!enableMinus) {
10
9
  nextValue = value.replace(/\D/g, '');
11
10
  }
12
-
13
11
  if (nextValue && nextValue.length > 1 && !intNumberReg.test(nextValue)) {
14
12
  return preValue !== null && preValue !== void 0 ? preValue : '';
15
13
  }
16
-
17
14
  return nextValue;
18
15
  };
19
16
  export var filterFloat = function filterFloat(_a) {
20
17
  var value = _a.value,
21
- _b = _a.preValue,
22
- preValue = _b === void 0 ? '' : _b,
23
- _c = _a.precision,
24
- precision = _c === void 0 ? 2 : _c,
25
- enableMinus = _a.enableMinus;
18
+ _b = _a.preValue,
19
+ preValue = _b === void 0 ? '' : _b,
20
+ _c = _a.precision,
21
+ precision = _c === void 0 ? 2 : _c,
22
+ enableMinus = _a.enableMinus;
26
23
  var nextValue = value.replace(/[^\d.\-]/g, '');
27
24
  var matchDecimalPoint = nextValue.match(/\./g) || [];
28
-
29
25
  if (matchDecimalPoint.length > 1) {
30
26
  return preValue;
31
27
  }
32
-
33
28
  if (!enableMinus) {
34
29
  nextValue = value.replace(/[^\d.]/g, '');
35
30
  }
36
-
37
31
  var floatNumberReg = /^-?\d+\.?\d*$/;
38
-
39
32
  if (nextValue && nextValue.length > 1 && !floatNumberReg.test(nextValue)) {
40
33
  return preValue;
41
34
  }
42
-
43
35
  var twoDecimalNumReg = new RegExp("^(\\-)*(\\d+)\\.(\\d{".concat(precision, "}).*$"));
44
36
  return nextValue.replace(twoDecimalNumReg, '$1$2.$3');
45
37
  };
@@ -1,24 +1,21 @@
1
1
  /* eslint-disable no-unused-expressions */
2
-
3
2
  /* eslint-disable no-restricted-syntax */
4
3
  import React, { useRef, useLayoutEffect } from 'react';
5
4
  import useMount from "ahooks/es/useMount";
6
5
  import useUpdateEffect from "ahooks/es/useUpdateEffect";
7
6
  import classNames from 'classnames';
8
7
  import ResizeObserver from 'resize-observer-polyfill';
9
-
10
8
  var ReactEchartCore = function ReactEchartCore(props) {
11
9
  var className = props.className,
12
- option = props.option,
13
- echarts = props.echarts,
14
- notMerge = props.notMerge,
15
- lazyUpdate = props.lazyUpdate,
16
- onEvents = props.onEvents,
17
- opts = props.opts,
18
- theme = props.theme;
10
+ option = props.option,
11
+ echarts = props.echarts,
12
+ notMerge = props.notMerge,
13
+ lazyUpdate = props.lazyUpdate,
14
+ onEvents = props.onEvents,
15
+ opts = props.opts,
16
+ theme = props.theme;
19
17
  var chartDomRef = useRef();
20
18
  var chartRef = useRef();
21
-
22
19
  var bindEvents = function bindEvents() {
23
20
  var bindEventFunc = function bindEventFunc(eventName, func) {
24
21
  if (typeof eventName === 'string' && typeof func === 'function') {
@@ -29,62 +26,54 @@ var ReactEchartCore = function ReactEchartCore(props) {
29
26
  }
30
27
  }
31
28
  };
32
-
33
29
  for (var eventName in onEvents) {
34
30
  if (Object.prototype.hasOwnProperty.call(onEvents, eventName)) {
35
31
  bindEventFunc(eventName, onEvents[eventName]);
36
32
  }
37
33
  }
38
34
  };
39
-
40
35
  var initEcharts = function initEcharts() {
41
36
  chartRef.current = echarts.init(chartDomRef.current, theme, opts);
42
37
  };
43
-
44
38
  var renderEchartDom = function renderEchartDom() {
45
39
  if (chartRef.current) {
46
40
  chartRef.current.setOption(option, notMerge, lazyUpdate);
47
41
  }
48
42
  };
49
-
50
43
  var dispose = function dispose() {
51
44
  if (chartRef.current) {
52
45
  chartRef.current.dispose();
53
46
  }
54
- }; // first add
55
-
56
-
47
+ };
48
+ // first add
57
49
  useMount(function () {
58
50
  initEcharts();
59
51
  renderEchartDom();
60
52
  bindEvents();
61
- }); // need reBuild
62
-
53
+ });
54
+ // need reBuild
63
55
  useUpdateEffect(function () {
64
56
  dispose();
65
57
  renderEchartDom();
66
58
  bindEvents();
67
- }, [theme, opts, onEvents]); // need setOption
68
-
59
+ }, [theme, opts, onEvents]);
60
+ // need setOption
69
61
  useUpdateEffect(function () {
70
62
  renderEchartDom();
71
- }, [option, notMerge, lazyUpdate]); // need resize
72
-
63
+ }, [option, notMerge, lazyUpdate]);
64
+ // need resize
73
65
  var resizeChart = function resizeChart() {
74
66
  if (chartRef.current) {
75
67
  chartRef.current.resize();
76
68
  }
77
69
  };
78
-
79
70
  useLayoutEffect(function () {
80
71
  var resizeObserver = new ResizeObserver(function () {
81
72
  resizeChart();
82
73
  });
83
-
84
74
  if (chartDomRef.current) {
85
75
  resizeObserver.observe(chartDomRef.current);
86
76
  }
87
-
88
77
  return function () {
89
78
  resizeObserver.disconnect();
90
79
  };
@@ -104,7 +93,6 @@ var ReactEchartCore = function ReactEchartCore(props) {
104
93
  className: classNames('react-echart', className)
105
94
  });
106
95
  };
107
-
108
96
  ReactEchartCore.defaultProps = {
109
97
  notMerge: false,
110
98
  lazyUpdate: false,
@@ -2,26 +2,20 @@ var __assign = this && this.__assign || function () {
2
2
  __assign = Object.assign || function (t) {
3
3
  for (var s, i = 1, n = arguments.length; i < n; i++) {
4
4
  s = arguments[i];
5
-
6
5
  for (var p in s) {
7
6
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
7
  }
9
8
  }
10
-
11
9
  return t;
12
10
  };
13
-
14
11
  return __assign.apply(this, arguments);
15
12
  };
16
-
17
13
  import React from 'react';
18
14
  import * as echarts from 'echarts';
19
15
  import RcEchartCore from './core';
20
-
21
16
  var RcEcharts = function RcEcharts(props) {
22
17
  return /*#__PURE__*/React.createElement(RcEchartCore, __assign({
23
18
  echarts: echarts
24
19
  }, props));
25
20
  };
26
-
27
21
  export default RcEcharts;
@@ -2,44 +2,35 @@ var __assign = this && this.__assign || function () {
2
2
  __assign = Object.assign || function (t) {
3
3
  for (var s, i = 1, n = arguments.length; i < n; i++) {
4
4
  s = arguments[i];
5
-
6
5
  for (var p in s) {
7
6
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
7
  }
9
8
  }
10
-
11
9
  return t;
12
10
  };
13
-
14
11
  return __assign.apply(this, arguments);
15
12
  };
16
-
17
13
  import * as React from 'react';
18
14
  import QRCode from 'qrcode';
19
15
  import useMount from "ahooks/es/useMount";
20
16
  import useQrcode from './useQrcode';
21
-
22
17
  var RcQrcode = function RcQrcode(props) {
23
18
  var value = props.value,
24
- options = props.options,
25
- getCanvasInstance = props.getCanvasInstance;
19
+ options = props.options,
20
+ getCanvasInstance = props.getCanvasInstance;
26
21
  var domElRef = React.useRef(null);
27
22
  var defaultOptions = {
28
23
  errorCorrectionLevel: 'H',
29
24
  margin: 0,
30
25
  width: 134
31
26
  };
32
-
33
27
  var finallyOptions = __assign(__assign({}, defaultOptions), options);
34
-
35
28
  useMount(function () {
36
29
  QRCode.toCanvas(value, finallyOptions, function (err, result) {
37
30
  var _a;
38
-
39
31
  if (err) {
40
32
  throw err;
41
33
  }
42
-
43
34
  getCanvasInstance && getCanvasInstance(result);
44
35
  (_a = domElRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(result);
45
36
  });
@@ -48,7 +39,6 @@ var RcQrcode = function RcQrcode(props) {
48
39
  ref: domElRef
49
40
  });
50
41
  };
51
-
52
42
  RcQrcode.defaultProps = {
53
43
  value: '',
54
44
  options: {}
@@ -2,10 +2,9 @@ var __read = this && this.__read || function (o, n) {
2
2
  var m = typeof Symbol === "function" && o[Symbol.iterator];
3
3
  if (!m) return o;
4
4
  var i = m.call(o),
5
- r,
6
- ar = [],
7
- e;
8
-
5
+ r,
6
+ ar = [],
7
+ e;
9
8
  try {
10
9
  while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
11
10
  ar.push(r.value);
@@ -21,32 +20,26 @@ var __read = this && this.__read || function (o, n) {
21
20
  if (e) throw e.error;
22
21
  }
23
22
  }
24
-
25
23
  return ar;
26
24
  };
27
-
28
25
  import QRCode from 'qrcode';
29
26
  import { useEffect, useState } from 'react';
30
27
  export var useQRCode = function useQRCode(value, options) {
31
28
  if (options === void 0) {
32
29
  options = {};
33
30
  }
34
-
35
31
  var _a = __read(useState(''), 2),
36
- dataURL = _a[0],
37
- setDataURL = _a[1];
38
-
32
+ dataURL = _a[0],
33
+ setDataURL = _a[1];
39
34
  useEffect(function () {
40
35
  if (!value) {
41
36
  setDataURL('');
42
37
  return;
43
38
  }
44
-
45
39
  QRCode.toDataURL(value, options, function (err, url) {
46
40
  if (err) {
47
41
  throw err;
48
42
  }
49
-
50
43
  setDataURL(url);
51
44
  });
52
45
  }, [value, options]);
@@ -2,39 +2,32 @@ var __assign = this && this.__assign || function () {
2
2
  __assign = Object.assign || function (t) {
3
3
  for (var s, i = 1, n = arguments.length; i < n; i++) {
4
4
  s = arguments[i];
5
-
6
5
  for (var p in s) {
7
6
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
7
  }
9
8
  }
10
-
11
9
  return t;
12
10
  };
13
-
14
11
  return __assign.apply(this, arguments);
15
12
  };
16
-
17
13
  var __rest = this && this.__rest || function (s, e) {
18
14
  var t = {};
19
-
20
15
  for (var p in s) {
21
16
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
22
17
  }
23
-
24
18
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
25
19
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
26
20
  }
27
21
  return t;
28
22
  };
29
-
30
23
  import React from 'react';
31
24
  import { Editor } from '@tinymce/tinymce-react';
32
25
  import tinymce from 'tinymce/tinymce';
33
26
  import 'tinymce/themes/silver';
34
27
  import 'tinymce/models/dom';
35
28
  import 'tinymce/icons/default';
36
- import 'tinymce/skins/ui/oxide/skin.min.css'; // importing the plugin js.
37
-
29
+ import 'tinymce/skins/ui/oxide/skin.min.css';
30
+ // importing the plugin js.
38
31
  import 'tinymce/plugins/advlist';
39
32
  import 'tinymce/plugins/autolink';
40
33
  import 'tinymce/plugins/link';
@@ -43,8 +36,8 @@ import 'tinymce/plugins/lists';
43
36
  import 'tinymce/plugins/charmap';
44
37
  import 'tinymce/plugins/anchor';
45
38
  import 'tinymce/plugins/searchreplace';
46
- import 'tinymce/plugins/wordcount'; // import 'tinymce/plugins/code';
47
-
39
+ import 'tinymce/plugins/wordcount';
40
+ // import 'tinymce/plugins/code';
48
41
  import 'tinymce/plugins/fullscreen';
49
42
  import 'tinymce/plugins/insertdatetime';
50
43
  import 'tinymce/plugins/media';
@@ -77,17 +70,13 @@ var defaultInit = {
77
70
  toolbar: defaultToolbar,
78
71
  content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
79
72
  };
80
-
81
73
  var RichTextEditor = function RichTextEditor(props) {
82
74
  var init = props.init,
83
- restProps = __rest(props, ["init"]);
84
-
75
+ restProps = __rest(props, ["init"]);
85
76
  var resultInit = __assign(__assign({}, defaultInit), init);
86
-
87
77
  return /*#__PURE__*/React.createElement(Editor, __assign({}, restProps, {
88
78
  init: resultInit
89
79
  }));
90
80
  };
91
-
92
81
  export { defaultPlugins, defaultToolbar };
93
82
  export default RichTextEditor;
@@ -1,7 +1,6 @@
1
1
  // @ts-nocheck
2
2
  import tinymce from 'tinymce/tinymce';
3
3
  var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
4
-
5
4
  var setContent = function setContent(editor, html) {
6
5
  editor.focus();
7
6
  editor.undoManager.transact(function () {
@@ -10,13 +9,11 @@ var setContent = function setContent(editor, html) {
10
9
  editor.selection.setCursorLocation();
11
10
  editor.nodeChanged();
12
11
  };
13
-
14
12
  var getContent = function getContent(editor) {
15
13
  return editor.getContent({
16
14
  source_view: true
17
15
  });
18
16
  };
19
-
20
17
  var open = function open(editor) {
21
18
  var editorContent = getContent(editor);
22
19
  editor.windowManager.open({
@@ -48,18 +45,15 @@ var open = function open(editor) {
48
45
  }
49
46
  });
50
47
  };
51
-
52
48
  var register$1 = function register$1(editor) {
53
49
  editor.addCommand('mceCodeEditor', function () {
54
50
  open(editor);
55
51
  });
56
52
  };
57
-
58
53
  var register = function register(editor) {
59
54
  var onAction = function onAction() {
60
55
  return editor.execCommand('mceCodeEditor');
61
56
  };
62
-
63
57
  editor.ui.registry.addButton('code', {
64
58
  text: 'Source code',
65
59
  tooltip: 'Source code',
@@ -71,7 +65,6 @@ var register = function register(editor) {
71
65
  onAction: onAction
72
66
  });
73
67
  };
74
-
75
68
  function initCodePlugin() {
76
69
  global.add('code', function (editor) {
77
70
  register$1(editor);
@@ -79,5 +72,4 @@ function initCodePlugin() {
79
72
  return {};
80
73
  });
81
74
  }
82
-
83
75
  export default initCodePlugin;