assui 3.2.42 → 3.2.44
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.
- package/es/a-select/index.d.ts +5 -5
- package/es/a-select/index.js +59 -88
- package/es/a-select/style/index.css +47 -52
- package/es/a-select/style/index.js +2 -2
- package/es/a-select/style/index.less +1 -2
- package/es/area-text/index.d.ts +2 -2
- package/es/area-text/index.js +5 -9
- package/es/area-text/style/index.js +1 -1
- package/es/beautiful-dnd/index.js +1 -1
- package/es/button-drawer/index.d.ts +8 -10
- package/es/button-drawer/index.js +61 -94
- package/es/button-drawer/style/index.js +1 -1
- package/es/button-modal/index.d.ts +8 -10
- package/es/button-modal/index.js +60 -93
- package/es/button-modal/style/index.js +1 -1
- package/es/client-only/index.d.ts +2 -2
- package/es/client-only/index.js +1 -1
- package/es/client-only/useClientOnly.js +22 -24
- package/es/color-select/index.d.ts +18 -18
- package/es/color-select/index.js +68 -113
- package/es/color-select/style/index.css +47 -52
- package/es/color-select/style/index.js +1 -1
- package/es/complex-val-select/index.d.ts +13 -25
- package/es/complex-val-select/index.js +54 -71
- package/es/complex-val-select/style/index.js +1 -1
- package/es/condition-input/index.d.ts +13 -21
- package/es/condition-input/index.js +51 -67
- package/es/condition-input/parse2RegexOption.d.ts +7 -10
- package/es/condition-input/parse2RegexOption.js +21 -31
- package/es/condition-input/style/index.js +1 -1
- package/es/condition-select/index.d.ts +1 -7
- package/es/condition-select/index.js +85 -141
- package/es/condition-select/style/index.js +3 -3
- package/es/condition-select/types.d.ts +14 -16
- package/es/condition-select/types.js +1 -1
- package/es/condition-select/utils/index.d.ts +2 -5
- package/es/condition-select/utils/index.js +2 -2
- package/es/condition-select-input/index.d.ts +29 -29
- package/es/condition-select-input/index.js +106 -196
- package/es/condition-select-input/style/index.d.ts +1 -1
- package/es/condition-select-input/style/index.js +3 -3
- package/es/config-provider/context.d.ts +1 -1
- package/es/config-provider/context.js +2 -2
- package/es/config-provider/index.d.ts +3 -27
- package/es/config-provider/index.js +5 -9
- package/es/copy-to-clipboard/index.d.ts +18 -20
- package/es/copy-to-clipboard/index.js +44 -63
- package/es/copy-to-clipboard/style/index.css +14 -23
- package/es/copy-to-clipboard/style/index.js +1 -1
- package/es/count-down/index.d.ts +3 -3
- package/es/count-down/index.js +26 -44
- package/es/count-up/index.d.ts +2 -2
- package/es/count-up/index.js +1 -1
- package/es/flex/index.d.ts +18 -21
- package/es/flex/index.js +32 -64
- package/es/flex/style/index.css +47 -52
- package/es/flex/style/index.js +1 -1
- package/es/flex/utils/gapSize.js +1 -1
- package/es/flex/utils/index.d.ts +3 -27
- package/es/flex/utils/index.js +19 -53
- package/es/highlight-textarea/HighlighedContents.d.ts +3 -6
- package/es/highlight-textarea/HighlighedContents.js +5 -9
- package/es/highlight-textarea/extractSpansOfClasses.d.ts +10 -10
- package/es/highlight-textarea/extractSpansOfClasses.js +45 -62
- package/es/highlight-textarea/getRanges.js +34 -41
- package/es/highlight-textarea/getType.js +2 -6
- package/es/highlight-textarea/index.d.ts +7 -14
- package/es/highlight-textarea/index.js +70 -114
- package/es/highlight-textarea/style/index.css +55 -125
- package/es/highlight-textarea/style/index.js +1 -1
- package/es/highlight-textarea/types.d.ts +7 -26
- package/es/highlight-textarea/types.js +1 -1
- package/es/highlight-words/index.d.ts +2 -6
- package/es/highlight-words/index.js +1 -1
- package/es/img-crop/EasyCrop.d.ts +2 -6
- package/es/img-crop/EasyCrop.js +79 -104
- package/es/img-crop/getCroppedImg.d.ts +3 -8
- package/es/img-crop/getCroppedImg.js +118 -155
- package/es/img-crop/index.d.ts +29 -29
- package/es/img-crop/index.js +340 -490
- package/es/img-crop/style/index.css +47 -52
- package/es/img-crop/style/index.d.ts +1 -1
- package/es/img-crop/style/index.js +3 -3
- package/es/index.d.ts +56 -62
- package/es/index.js +29 -29
- package/es/json-editor/index.d.ts +5 -7
- package/es/json-editor/index.js +62 -91
- package/es/json-editor/style/index.js +1 -1
- package/es/keep-tab/index.d.ts +17 -17
- package/es/keep-tab/index.js +78 -125
- package/es/keep-tab/style/index.css +32 -72
- package/es/keep-tab/style/index.js +1 -1
- package/es/label-auto-complete/index.d.ts +3 -3
- package/es/label-auto-complete/index.js +58 -82
- package/es/label-auto-complete/style/index.css +50 -61
- package/es/label-auto-complete/style/index.js +2 -2
- package/es/label-condition-input/index.d.ts +11 -12
- package/es/label-condition-input/index.js +62 -100
- package/es/label-condition-input/style/index.css +47 -52
- package/es/label-condition-input/style/index.js +1 -1
- package/es/label-condition-select-input/index.d.ts +33 -35
- package/es/label-condition-select-input/index.js +109 -198
- package/es/label-condition-select-input/style/index.css +47 -52
- package/es/label-condition-select-input/style/index.d.ts +1 -1
- package/es/label-condition-select-input/style/index.js +2 -2
- package/es/label-customize-range-picker/defaultRadioList.d.ts +28 -34
- package/es/label-customize-range-picker/defaultRadioList.js +114 -206
- package/es/label-customize-range-picker/index.d.ts +24 -27
- package/es/label-customize-range-picker/index.js +141 -300
- package/es/label-customize-range-picker/style/index.css +47 -52
- package/es/label-customize-range-picker/style/index.d.ts +2 -2
- package/es/label-customize-range-picker/style/index.js +4 -4
- package/es/label-customize-range-picker/utils/index.d.ts +3 -9
- package/es/label-customize-range-picker/utils/index.js +29 -57
- package/es/label-date-picker/index.d.ts +2 -2
- package/es/label-date-picker/index.js +57 -81
- package/es/label-date-picker/style/index.css +47 -52
- package/es/label-date-picker/style/index.js +2 -2
- package/es/label-input/index.d.ts +25 -29
- package/es/label-input/index.js +80 -122
- package/es/label-input/style/index.css +47 -52
- package/es/label-input/style/index.js +1 -1
- package/es/label-number-input/index.d.ts +6 -6
- package/es/label-number-input/index.js +63 -101
- package/es/label-number-input/style/index.css +48 -54
- package/es/label-number-input/style/index.js +1 -1
- package/es/label-range-number/index.d.ts +17 -17
- package/es/label-range-number/index.js +95 -156
- package/es/label-range-number/style/index.css +47 -52
- package/es/label-range-number/style/index.js +1 -1
- package/es/label-range-picker/index.d.ts +3 -3
- package/es/label-range-picker/index.js +71 -103
- package/es/label-range-picker/style/index.css +47 -52
- package/es/label-range-picker/style/index.js +2 -2
- package/es/label-select/index.d.ts +5 -7
- package/es/label-select/index.js +69 -100
- package/es/label-select/style/index.css +51 -65
- package/es/label-select/style/index.js +2 -2
- package/es/label-text-area/index.d.ts +17 -21
- package/es/label-text-area/index.js +64 -97
- package/es/label-text-area/style/index.css +47 -52
- package/es/label-text-area/style/index.js +1 -1
- package/es/label-tree-select/index.d.ts +7 -8
- package/es/label-tree-select/index.js +61 -98
- package/es/label-tree-select/style/index.css +48 -55
- package/es/label-tree-select/style/index.js +2 -2
- package/es/messages/ar_EG.d.ts +24 -24
- package/es/messages/ar_EG.js +5 -5
- package/es/messages/bg_BG.d.ts +24 -24
- package/es/messages/bg_BG.js +5 -5
- package/es/messages/cs_CZ.d.ts +24 -24
- package/es/messages/cs_CZ.js +5 -5
- package/es/messages/de_DE.d.ts +24 -24
- package/es/messages/de_DE.js +5 -5
- package/es/messages/en_US.d.ts +24 -24
- package/es/messages/en_US.js +5 -5
- package/es/messages/es_ES.d.ts +24 -24
- package/es/messages/es_ES.js +5 -5
- package/es/messages/fi_FI.d.ts +24 -24
- package/es/messages/fi_FI.js +5 -5
- package/es/messages/fr_FR.d.ts +24 -24
- package/es/messages/fr_FR.js +5 -5
- package/es/messages/id_ID.d.ts +24 -24
- package/es/messages/id_ID.js +5 -5
- package/es/messages/index.d.ts +23 -27
- package/es/messages/index.js +3 -3
- package/es/messages/it_IT.d.ts +24 -24
- package/es/messages/it_IT.js +5 -5
- package/es/messages/ja_JP.d.ts +24 -24
- package/es/messages/ja_JP.js +5 -5
- package/es/messages/ko_KR.d.ts +24 -24
- package/es/messages/ko_KR.js +5 -5
- package/es/messages/ms_MY.d.ts +24 -24
- package/es/messages/ms_MY.js +5 -5
- package/es/messages/nb_NO.d.ts +24 -24
- package/es/messages/nb_NO.js +5 -5
- package/es/messages/nl_NL.d.ts +24 -24
- package/es/messages/nl_NL.js +5 -5
- package/es/messages/pt_PT.d.ts +24 -24
- package/es/messages/pt_PT.js +5 -5
- package/es/messages/ro_RO.d.ts +24 -24
- package/es/messages/ro_RO.js +5 -5
- package/es/messages/ru_RU.d.ts +24 -24
- package/es/messages/ru_RU.js +5 -5
- package/es/messages/sv_SE.d.ts +24 -24
- package/es/messages/sv_SE.js +5 -5
- package/es/messages/th_TH.d.ts +24 -24
- package/es/messages/th_TH.js +5 -5
- package/es/messages/ug_UG.d.ts +24 -24
- package/es/messages/ug_UG.js +5 -5
- package/es/messages/vi_VN.d.ts +24 -24
- package/es/messages/vi_VN.js +5 -5
- package/es/messages/zh_CN.d.ts +24 -24
- package/es/messages/zh_CN.js +5 -5
- package/es/messages/zh_TW.d.ts +24 -24
- package/es/messages/zh_TW.js +5 -5
- package/es/multipart-upload/getMultipartUploadHandler.d.ts +1 -3
- package/es/multipart-upload/getMultipartUploadHandler.js +6 -8
- package/es/multipart-upload/index.d.ts +33 -39
- package/es/multipart-upload/index.js +121 -217
- package/es/multipart-upload/parse2RegexOption.d.ts +7 -10
- package/es/multipart-upload/parse2RegexOption.js +21 -31
- package/es/multipart-upload/style/index.css +47 -52
- package/es/multipart-upload/style/index.js +2 -2
- package/es/number-format-input/index.js +25 -36
- package/es/number-format-input/style/index.js +1 -1
- package/es/number-input/const/dataTypeEnum.d.ts +2 -2
- package/es/number-input/const/dataTypeEnum.js +1 -1
- package/es/number-input/const/numberType.d.ts +2 -2
- package/es/number-input/const/numberType.js +1 -1
- package/es/number-input/index.d.ts +35 -37
- package/es/number-input/index.js +65 -94
- package/es/number-input/style/index.js +1 -1
- package/es/number-input/utils.d.ts +6 -15
- package/es/number-input/utils.js +2 -2
- package/es/rc-echart/core.d.ts +13 -13
- package/es/rc-echart/core.js +19 -28
- package/es/rc-echart/index.d.ts +12 -12
- package/es/rc-echart/index.js +16 -26
- package/es/rc-motion/index.d.ts +2 -14
- package/es/rc-motion/index.js +1 -1
- package/es/rc-qrcode/index.d.ts +8 -11
- package/es/rc-qrcode/index.js +17 -21
- package/es/rc-qrcode/useQrcode.d.ts +2 -5
- package/es/rc-qrcode/useQrcode.js +33 -38
- package/es/rc-transition-group/index.js +1 -1
- package/es/resizable/index.d.ts +1 -10
- package/es/resizable/index.js +1 -1
- package/es/resizable/style/index.js +1 -1
- package/es/rich-text-editor/index.d.ts +18 -18
- package/es/rich-text-editor/index.js +45 -78
- package/es/rich-text-editor/lang/zh_CN.d.ts +404 -404
- package/es/rich-text-editor/lang/zh_CN.js +393 -416
- package/es/rich-text-editor/plugins/code/index.js +20 -25
- package/es/rich-text-editor/style/index.css +47 -52
- package/es/rich-text-editor/style/index.js +1 -1
- package/es/single-img-upload/index.d.ts +8 -8
- package/es/single-img-upload/index.js +230 -338
- package/es/single-img-upload/style/index.css +47 -52
- package/es/single-img-upload/style/index.js +4 -4
- package/es/sortable-hoc/index.js +1 -1
- package/es/split-pane/index.d.ts +53 -53
- package/es/split-pane/index.js +13 -17
- package/es/split-pane/style/index.js +1 -1
- package/es/step-number-input/const/countType.d.ts +2 -2
- package/es/step-number-input/const/countType.js +1 -1
- package/es/step-number-input/const/numberType.d.ts +2 -2
- package/es/step-number-input/const/numberType.js +1 -1
- package/es/step-number-input/index.d.ts +31 -31
- package/es/step-number-input/index.js +85 -135
- package/es/step-number-input/style/index.css +47 -52
- package/es/step-number-input/style/index.js +2 -2
- package/es/table-col/index.d.ts +3 -3
- package/es/table-col/index.js +7 -11
- package/es/table-col/style/index.js +1 -1
- package/es/text-area/index.d.ts +8 -13
- package/es/text-area/index.js +48 -64
- package/es/text-area/style/index.js +1 -1
- package/es/text-input/index.d.ts +1 -3
- package/es/text-input/index.js +58 -76
- package/es/text-input/style/index.css +53 -123
- package/es/text-input/style/index.js +1 -1
- package/lib/a-select/index.d.ts +5 -5
- package/lib/a-select/index.js +69 -102
- package/lib/a-select/style/index.css +47 -52
- package/lib/a-select/style/index.js +5 -5
- package/lib/a-select/style/index.less +1 -2
- package/lib/area-text/index.d.ts +2 -2
- package/lib/area-text/index.js +13 -21
- package/lib/area-text/style/index.js +4 -4
- package/lib/beautiful-dnd/index.js +37 -52
- package/lib/button-drawer/index.d.ts +8 -10
- package/lib/button-drawer/index.js +101 -153
- package/lib/button-drawer/style/index.js +4 -4
- package/lib/button-modal/index.d.ts +8 -10
- package/lib/button-modal/index.js +99 -151
- package/lib/button-modal/style/index.js +4 -4
- package/lib/client-only/index.d.ts +2 -2
- package/lib/client-only/index.js +5 -5
- package/lib/client-only/useClientOnly.js +26 -28
- package/lib/color-select/index.d.ts +18 -18
- package/lib/color-select/index.js +112 -180
- package/lib/color-select/style/index.css +47 -52
- package/lib/color-select/style/index.js +5 -5
- package/lib/complex-val-select/index.d.ts +13 -25
- package/lib/complex-val-select/index.js +102 -140
- package/lib/complex-val-select/style/index.js +4 -4
- package/lib/condition-input/index.d.ts +13 -21
- package/lib/condition-input/index.js +96 -131
- package/lib/condition-input/parse2RegexOption.d.ts +7 -10
- package/lib/condition-input/parse2RegexOption.js +33 -47
- package/lib/condition-input/style/index.js +4 -4
- package/lib/condition-select/index.d.ts +1 -7
- package/lib/condition-select/index.js +94 -154
- package/lib/condition-select/style/index.js +6 -6
- package/lib/condition-select/types.d.ts +14 -16
- package/lib/condition-select/types.js +4 -4
- package/lib/condition-select/utils/index.d.ts +2 -5
- package/lib/condition-select/utils/index.js +5 -5
- package/lib/condition-select-input/index.d.ts +29 -29
- package/lib/condition-select-input/index.js +150 -259
- package/lib/condition-select-input/style/index.d.ts +1 -1
- package/lib/condition-select-input/style/index.js +6 -6
- package/lib/config-provider/context.d.ts +1 -1
- package/lib/config-provider/context.js +11 -15
- package/lib/config-provider/index.d.ts +3 -27
- package/lib/config-provider/index.js +61 -69
- package/lib/copy-to-clipboard/index.d.ts +18 -20
- package/lib/copy-to-clipboard/index.js +86 -124
- package/lib/copy-to-clipboard/style/index.css +14 -23
- package/lib/copy-to-clipboard/style/index.js +4 -4
- package/lib/count-down/index.d.ts +3 -3
- package/lib/count-down/index.js +36 -58
- package/lib/count-up/index.d.ts +2 -2
- package/lib/count-up/index.js +39 -54
- package/lib/flex/index.d.ts +18 -21
- package/lib/flex/index.js +42 -78
- package/lib/flex/style/index.css +47 -52
- package/lib/flex/style/index.js +4 -4
- package/lib/flex/utils/gapSize.js +4 -4
- package/lib/flex/utils/index.d.ts +3 -27
- package/lib/flex/utils/index.js +27 -65
- package/lib/highlight-textarea/HighlighedContents.d.ts +3 -6
- package/lib/highlight-textarea/HighlighedContents.js +16 -24
- package/lib/highlight-textarea/extractSpansOfClasses.d.ts +10 -10
- package/lib/highlight-textarea/extractSpansOfClasses.js +54 -75
- package/lib/highlight-textarea/getRanges.js +44 -55
- package/lib/highlight-textarea/getType.js +6 -10
- package/lib/highlight-textarea/index.d.ts +7 -14
- package/lib/highlight-textarea/index.js +113 -176
- package/lib/highlight-textarea/style/index.css +55 -125
- package/lib/highlight-textarea/style/index.js +4 -4
- package/lib/highlight-textarea/types.d.ts +7 -26
- package/lib/highlight-textarea/types.js +4 -4
- package/lib/highlight-words/index.d.ts +2 -6
- package/lib/highlight-words/index.js +9 -13
- package/lib/img-crop/EasyCrop.d.ts +2 -6
- package/lib/img-crop/EasyCrop.js +120 -164
- package/lib/img-crop/getCroppedImg.d.ts +3 -8
- package/lib/img-crop/getCroppedImg.js +121 -158
- package/lib/img-crop/index.d.ts +29 -29
- package/lib/img-crop/index.js +383 -555
- package/lib/img-crop/style/index.css +47 -52
- package/lib/img-crop/style/index.d.ts +1 -1
- package/lib/img-crop/style/index.js +6 -6
- package/lib/index.d.ts +56 -62
- package/lib/index.js +202 -254
- package/lib/json-editor/index.d.ts +5 -7
- package/lib/json-editor/index.js +108 -156
- package/lib/json-editor/style/index.js +5 -5
- package/lib/keep-tab/index.d.ts +17 -17
- package/lib/keep-tab/index.js +120 -186
- package/lib/keep-tab/style/index.css +32 -72
- package/lib/keep-tab/style/index.js +4 -4
- package/lib/label-auto-complete/index.d.ts +3 -3
- package/lib/label-auto-complete/index.js +71 -103
- package/lib/label-auto-complete/style/index.css +50 -61
- package/lib/label-auto-complete/style/index.js +5 -5
- package/lib/label-condition-input/index.d.ts +11 -12
- package/lib/label-condition-input/index.js +77 -119
- package/lib/label-condition-input/style/index.css +47 -52
- package/lib/label-condition-input/style/index.js +4 -4
- package/lib/label-condition-select-input/index.d.ts +33 -35
- package/lib/label-condition-select-input/index.js +154 -262
- package/lib/label-condition-select-input/style/index.css +47 -52
- package/lib/label-condition-select-input/style/index.d.ts +1 -1
- package/lib/label-condition-select-input/style/index.js +6 -6
- package/lib/label-customize-range-picker/defaultRadioList.d.ts +28 -34
- package/lib/label-customize-range-picker/defaultRadioList.js +156 -297
- package/lib/label-customize-range-picker/index.d.ts +24 -27
- package/lib/label-customize-range-picker/index.js +186 -363
- package/lib/label-customize-range-picker/style/index.css +47 -52
- package/lib/label-customize-range-picker/style/index.d.ts +2 -2
- package/lib/label-customize-range-picker/style/index.js +8 -8
- package/lib/label-customize-range-picker/utils/index.d.ts +3 -9
- package/lib/label-customize-range-picker/utils/index.js +38 -75
- package/lib/label-date-picker/index.d.ts +2 -2
- package/lib/label-date-picker/index.js +68 -96
- package/lib/label-date-picker/style/index.css +47 -52
- package/lib/label-date-picker/style/index.js +5 -5
- package/lib/label-input/index.d.ts +25 -29
- package/lib/label-input/index.js +96 -142
- package/lib/label-input/style/index.css +47 -52
- package/lib/label-input/style/index.js +4 -4
- package/lib/label-number-input/index.d.ts +6 -6
- package/lib/label-number-input/index.js +78 -122
- package/lib/label-number-input/style/index.css +48 -54
- package/lib/label-number-input/style/index.js +4 -4
- package/lib/label-range-number/index.d.ts +17 -17
- package/lib/label-range-number/index.js +107 -172
- package/lib/label-range-number/style/index.css +47 -52
- package/lib/label-range-number/style/index.js +4 -4
- package/lib/label-range-picker/index.d.ts +3 -3
- package/lib/label-range-picker/index.js +83 -122
- package/lib/label-range-picker/style/index.css +47 -52
- package/lib/label-range-picker/style/index.js +5 -5
- package/lib/label-select/index.d.ts +5 -7
- package/lib/label-select/index.js +83 -130
- package/lib/label-select/style/index.css +51 -65
- package/lib/label-select/style/index.js +5 -5
- package/lib/label-text-area/index.d.ts +17 -21
- package/lib/label-text-area/index.js +77 -114
- package/lib/label-text-area/style/index.css +47 -52
- package/lib/label-text-area/style/index.js +4 -4
- package/lib/label-tree-select/index.d.ts +7 -8
- package/lib/label-tree-select/index.js +72 -113
- package/lib/label-tree-select/style/index.css +48 -55
- package/lib/label-tree-select/style/index.js +5 -5
- package/lib/messages/ar_EG.d.ts +24 -24
- package/lib/messages/ar_EG.js +8 -8
- package/lib/messages/bg_BG.d.ts +24 -24
- package/lib/messages/bg_BG.js +8 -8
- package/lib/messages/cs_CZ.d.ts +24 -24
- package/lib/messages/cs_CZ.js +8 -8
- package/lib/messages/de_DE.d.ts +24 -24
- package/lib/messages/de_DE.js +8 -8
- package/lib/messages/en_US.d.ts +24 -24
- package/lib/messages/en_US.js +8 -8
- package/lib/messages/es_ES.d.ts +24 -24
- package/lib/messages/es_ES.js +8 -8
- package/lib/messages/fi_FI.d.ts +24 -24
- package/lib/messages/fi_FI.js +8 -8
- package/lib/messages/fr_FR.d.ts +24 -24
- package/lib/messages/fr_FR.js +8 -8
- package/lib/messages/id_ID.d.ts +24 -24
- package/lib/messages/id_ID.js +8 -8
- package/lib/messages/index.d.ts +23 -27
- package/lib/messages/index.js +7 -7
- package/lib/messages/it_IT.d.ts +24 -24
- package/lib/messages/it_IT.js +8 -8
- package/lib/messages/ja_JP.d.ts +24 -24
- package/lib/messages/ja_JP.js +8 -8
- package/lib/messages/ko_KR.d.ts +24 -24
- package/lib/messages/ko_KR.js +8 -8
- package/lib/messages/ms_MY.d.ts +24 -24
- package/lib/messages/ms_MY.js +8 -8
- package/lib/messages/nb_NO.d.ts +24 -24
- package/lib/messages/nb_NO.js +8 -8
- package/lib/messages/nl_NL.d.ts +24 -24
- package/lib/messages/nl_NL.js +8 -8
- package/lib/messages/pt_PT.d.ts +24 -24
- package/lib/messages/pt_PT.js +8 -8
- package/lib/messages/ro_RO.d.ts +24 -24
- package/lib/messages/ro_RO.js +8 -8
- package/lib/messages/ru_RU.d.ts +24 -24
- package/lib/messages/ru_RU.js +8 -8
- package/lib/messages/sv_SE.d.ts +24 -24
- package/lib/messages/sv_SE.js +8 -8
- package/lib/messages/th_TH.d.ts +24 -24
- package/lib/messages/th_TH.js +8 -8
- package/lib/messages/ug_UG.d.ts +24 -24
- package/lib/messages/ug_UG.js +8 -8
- package/lib/messages/vi_VN.d.ts +24 -24
- package/lib/messages/vi_VN.js +8 -8
- package/lib/messages/zh_CN.d.ts +24 -24
- package/lib/messages/zh_CN.js +8 -8
- package/lib/messages/zh_TW.d.ts +24 -24
- package/lib/messages/zh_TW.js +8 -8
- package/lib/multipart-upload/getMultipartUploadHandler.d.ts +1 -3
- package/lib/multipart-upload/getMultipartUploadHandler.js +10 -12
- package/lib/multipart-upload/index.d.ts +33 -39
- package/lib/multipart-upload/index.js +165 -286
- package/lib/multipart-upload/parse2RegexOption.d.ts +7 -10
- package/lib/multipart-upload/parse2RegexOption.js +33 -47
- package/lib/multipart-upload/style/index.css +47 -52
- package/lib/multipart-upload/style/index.js +5 -5
- package/lib/number-format-input/index.js +34 -49
- package/lib/number-format-input/style/index.js +4 -4
- package/lib/number-input/const/dataTypeEnum.d.ts +2 -2
- package/lib/number-input/const/dataTypeEnum.js +4 -4
- package/lib/number-input/const/numberType.d.ts +2 -2
- package/lib/number-input/const/numberType.js +4 -4
- package/lib/number-input/index.d.ts +35 -37
- package/lib/number-input/index.js +105 -153
- package/lib/number-input/style/index.js +4 -4
- package/lib/number-input/utils.d.ts +6 -15
- package/lib/number-input/utils.js +5 -5
- package/lib/rc-echart/core.d.ts +13 -13
- package/lib/rc-echart/core.js +60 -88
- package/lib/rc-echart/index.d.ts +12 -12
- package/lib/rc-echart/index.js +57 -86
- package/lib/rc-motion/index.d.ts +2 -14
- package/lib/rc-motion/index.js +9 -13
- package/lib/rc-qrcode/index.d.ts +8 -11
- package/lib/rc-qrcode/index.js +62 -85
- package/lib/rc-qrcode/useQrcode.d.ts +2 -5
- package/lib/rc-qrcode/useQrcode.js +42 -51
- package/lib/rc-transition-group/index.js +37 -52
- package/lib/resizable/index.d.ts +1 -10
- package/lib/resizable/index.js +9 -9
- package/lib/resizable/style/index.js +4 -4
- package/lib/rich-text-editor/index.d.ts +18 -18
- package/lib/rich-text-editor/index.js +70 -107
- package/lib/rich-text-editor/lang/zh_CN.d.ts +404 -404
- package/lib/rich-text-editor/lang/zh_CN.js +397 -420
- package/lib/rich-text-editor/plugins/code/index.js +29 -38
- package/lib/rich-text-editor/style/index.css +47 -52
- package/lib/rich-text-editor/style/index.js +4 -4
- package/lib/single-img-upload/index.d.ts +8 -8
- package/lib/single-img-upload/index.js +273 -400
- package/lib/single-img-upload/style/index.css +47 -52
- package/lib/single-img-upload/style/index.js +7 -7
- package/lib/sortable-hoc/index.js +37 -52
- package/lib/split-pane/index.d.ts +53 -53
- package/lib/split-pane/index.js +22 -33
- package/lib/split-pane/style/index.js +4 -4
- package/lib/step-number-input/const/countType.d.ts +2 -2
- package/lib/step-number-input/const/countType.js +4 -4
- package/lib/step-number-input/const/numberType.d.ts +2 -2
- package/lib/step-number-input/const/numberType.js +4 -4
- package/lib/step-number-input/index.d.ts +31 -31
- package/lib/step-number-input/index.js +133 -204
- package/lib/step-number-input/style/index.css +47 -52
- package/lib/step-number-input/style/index.js +5 -5
- package/lib/table-col/index.d.ts +3 -3
- package/lib/table-col/index.js +15 -23
- package/lib/table-col/style/index.js +4 -4
- package/lib/text-area/index.d.ts +8 -13
- package/lib/text-area/index.js +89 -124
- package/lib/text-area/style/index.js +4 -4
- package/lib/text-input/index.d.ts +1 -3
- package/lib/text-input/index.js +67 -89
- package/lib/text-input/style/index.css +53 -123
- package/lib/text-input/style/index.js +4 -4
- package/package.json +4 -4
package/es/img-crop/index.js
CHANGED
|
@@ -1,203 +1,164 @@
|
|
|
1
|
-
var __assign =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) {
|
|
10
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __awaiter =
|
|
18
|
-
(this && this.__awaiter) ||
|
|
19
|
-
function (thisArg, _arguments, P, generator) {
|
|
20
|
-
function adopt(value) {
|
|
21
|
-
return value instanceof P
|
|
22
|
-
? value
|
|
23
|
-
: new P(function (resolve) {
|
|
24
|
-
resolve(value);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) {
|
|
29
|
-
try {
|
|
30
|
-
step(generator.next(value));
|
|
31
|
-
} catch (e) {
|
|
32
|
-
reject(e);
|
|
33
|
-
}
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) {
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
34
7
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) {
|
|
15
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
16
|
+
resolve(value);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) {
|
|
21
|
+
try {
|
|
22
|
+
step(generator.next(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
41
25
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
26
|
+
}
|
|
27
|
+
function rejected(value) {
|
|
28
|
+
try {
|
|
29
|
+
step(generator["throw"](value));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
reject(e);
|
|
46
32
|
}
|
|
47
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
var __generator =
|
|
51
|
-
(this && this.__generator) ||
|
|
52
|
-
function (thisArg, body) {
|
|
53
|
-
var _ = {
|
|
54
|
-
label: 0,
|
|
55
|
-
sent: function sent() {
|
|
56
|
-
if (t[0] & 1) throw t[1];
|
|
57
|
-
return t[1];
|
|
58
|
-
},
|
|
59
|
-
trys: [],
|
|
60
|
-
ops: [],
|
|
61
|
-
},
|
|
62
|
-
f,
|
|
63
|
-
y,
|
|
64
|
-
t,
|
|
65
|
-
g = Object.create((typeof Iterator === 'function' ? Iterator : Object).prototype);
|
|
66
|
-
return (
|
|
67
|
-
(g.next = verb(0)),
|
|
68
|
-
(g['throw'] = verb(1)),
|
|
69
|
-
(g['return'] = verb(2)),
|
|
70
|
-
typeof Symbol === 'function' &&
|
|
71
|
-
(g[Symbol.iterator] = function () {
|
|
72
|
-
return this;
|
|
73
|
-
}),
|
|
74
|
-
g
|
|
75
|
-
);
|
|
76
|
-
function verb(n) {
|
|
77
|
-
return function (v) {
|
|
78
|
-
return step([n, v]);
|
|
79
|
-
};
|
|
80
33
|
}
|
|
81
|
-
function step(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
34
|
+
function step(result) {
|
|
35
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
36
|
+
}
|
|
37
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
var __generator = this && this.__generator || function (thisArg, body) {
|
|
41
|
+
var _ = {
|
|
42
|
+
label: 0,
|
|
43
|
+
sent: function sent() {
|
|
44
|
+
if (t[0] & 1) throw t[1];
|
|
45
|
+
return t[1];
|
|
46
|
+
},
|
|
47
|
+
trys: [],
|
|
48
|
+
ops: []
|
|
49
|
+
},
|
|
50
|
+
f,
|
|
51
|
+
y,
|
|
52
|
+
t,
|
|
53
|
+
g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
54
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
55
|
+
return this;
|
|
56
|
+
}), g;
|
|
57
|
+
function verb(n) {
|
|
58
|
+
return function (v) {
|
|
59
|
+
return step([n, v]);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function step(op) {
|
|
63
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
64
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) {
|
|
65
|
+
try {
|
|
66
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
67
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
68
|
+
switch (op[0]) {
|
|
69
|
+
case 0:
|
|
70
|
+
case 1:
|
|
71
|
+
t = op;
|
|
72
|
+
break;
|
|
73
|
+
case 4:
|
|
74
|
+
_.label++;
|
|
75
|
+
return {
|
|
76
|
+
value: op[1],
|
|
77
|
+
done: false
|
|
78
|
+
};
|
|
79
|
+
case 5:
|
|
80
|
+
_.label++;
|
|
81
|
+
y = op[1];
|
|
82
|
+
op = [0];
|
|
83
|
+
continue;
|
|
84
|
+
case 7:
|
|
85
|
+
op = _.ops.pop();
|
|
86
|
+
_.trys.pop();
|
|
87
|
+
continue;
|
|
88
|
+
default:
|
|
89
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
90
|
+
_ = 0;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
94
|
+
_.label = op[1];
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
98
|
+
_.label = t[1];
|
|
101
99
|
t = op;
|
|
102
100
|
break;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
op = [0];
|
|
113
|
-
continue;
|
|
114
|
-
case 7:
|
|
115
|
-
op = _.ops.pop();
|
|
116
|
-
_.trys.pop();
|
|
117
|
-
continue;
|
|
118
|
-
default:
|
|
119
|
-
if (
|
|
120
|
-
!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) &&
|
|
121
|
-
(op[0] === 6 || op[0] === 2)
|
|
122
|
-
) {
|
|
123
|
-
_ = 0;
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
127
|
-
_.label = op[1];
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
130
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
131
|
-
_.label = t[1];
|
|
132
|
-
t = op;
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
if (t && _.label < t[2]) {
|
|
136
|
-
_.label = t[2];
|
|
137
|
-
_.ops.push(op);
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
if (t[2]) _.ops.pop();
|
|
141
|
-
_.trys.pop();
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
op = body.call(thisArg, _);
|
|
145
|
-
} catch (e) {
|
|
146
|
-
op = [6, e];
|
|
147
|
-
y = 0;
|
|
148
|
-
} finally {
|
|
149
|
-
f = t = 0;
|
|
101
|
+
}
|
|
102
|
+
if (t && _.label < t[2]) {
|
|
103
|
+
_.label = t[2];
|
|
104
|
+
_.ops.push(op);
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
if (t[2]) _.ops.pop();
|
|
108
|
+
_.trys.pop();
|
|
109
|
+
continue;
|
|
150
110
|
}
|
|
111
|
+
op = body.call(thisArg, _);
|
|
112
|
+
} catch (e) {
|
|
113
|
+
op = [6, e];
|
|
114
|
+
y = 0;
|
|
115
|
+
} finally {
|
|
116
|
+
f = t = 0;
|
|
151
117
|
}
|
|
152
|
-
if (op[0] & 5) throw op[1];
|
|
153
|
-
return {
|
|
154
|
-
value: op[0] ? op[1] : void 0,
|
|
155
|
-
done: true,
|
|
156
|
-
};
|
|
157
118
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
119
|
+
if (op[0] & 5) throw op[1];
|
|
120
|
+
return {
|
|
121
|
+
value: op[0] ? op[1] : void 0,
|
|
122
|
+
done: true
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
127
|
+
var t = {};
|
|
128
|
+
for (var p in s) {
|
|
129
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
130
|
+
}
|
|
131
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
132
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
133
|
+
}
|
|
134
|
+
return t;
|
|
135
|
+
};
|
|
136
|
+
var __read = this && this.__read || function (o, n) {
|
|
137
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
138
|
+
if (!m) return o;
|
|
139
|
+
var i = m.call(o),
|
|
140
|
+
r,
|
|
141
|
+
ar = [],
|
|
142
|
+
e;
|
|
143
|
+
try {
|
|
144
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
145
|
+
ar.push(r.value);
|
|
165
146
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
return t;
|
|
172
|
-
};
|
|
173
|
-
var __read =
|
|
174
|
-
(this && this.__read) ||
|
|
175
|
-
function (o, n) {
|
|
176
|
-
var m = typeof Symbol === 'function' && o[Symbol.iterator];
|
|
177
|
-
if (!m) return o;
|
|
178
|
-
var i = m.call(o),
|
|
179
|
-
r,
|
|
180
|
-
ar = [],
|
|
181
|
-
e;
|
|
147
|
+
} catch (error) {
|
|
148
|
+
e = {
|
|
149
|
+
error: error
|
|
150
|
+
};
|
|
151
|
+
} finally {
|
|
182
152
|
try {
|
|
183
|
-
|
|
184
|
-
ar.push(r.value);
|
|
185
|
-
}
|
|
186
|
-
} catch (error) {
|
|
187
|
-
e = {
|
|
188
|
-
error: error,
|
|
189
|
-
};
|
|
153
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
190
154
|
} finally {
|
|
191
|
-
|
|
192
|
-
if (r && !r.done && (m = i['return'])) m.call(i);
|
|
193
|
-
} finally {
|
|
194
|
-
if (e) throw e.error;
|
|
195
|
-
}
|
|
155
|
+
if (e) throw e.error;
|
|
196
156
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
import
|
|
157
|
+
}
|
|
158
|
+
return ar;
|
|
159
|
+
};
|
|
160
|
+
import Modal from "antd/es/modal";
|
|
161
|
+
import Slider from "antd/es/slider";
|
|
201
162
|
import * as React from 'react';
|
|
202
163
|
import EasyCrop from './EasyCrop';
|
|
203
164
|
import getCroppedImg from './getCroppedImg';
|
|
@@ -238,8 +199,8 @@ var ImgCrop = function ImgCrop(props) {
|
|
|
238
199
|
zipImg = props.zipImg,
|
|
239
200
|
children = props.children,
|
|
240
201
|
cropperProps = props.cropperProps;
|
|
241
|
-
var pkg =
|
|
242
|
-
var MEDIA_CLASS =
|
|
202
|
+
var pkg = "".concat(prefix, "-img-crop");
|
|
203
|
+
var MEDIA_CLASS = "".concat(pkg, "-media");
|
|
243
204
|
var hasZoom = zoom === true;
|
|
244
205
|
var hasRotate = rotate === true;
|
|
245
206
|
var _m = __read(React.useState(''), 2),
|
|
@@ -259,38 +220,35 @@ var ImgCrop = function ImgCrop(props) {
|
|
|
259
220
|
/**
|
|
260
221
|
* Upload
|
|
261
222
|
*/
|
|
262
|
-
var renderUpload = React.useCallback(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
reader.
|
|
284
|
-
setSrc(reader.result);
|
|
285
|
-
});
|
|
286
|
-
reader.readAsDataURL(file);
|
|
223
|
+
var renderUpload = React.useCallback(function () {
|
|
224
|
+
var upload = Array.isArray(children) ? children[0] : children;
|
|
225
|
+
var _a = upload.props,
|
|
226
|
+
beforeUpload = _a.beforeUpload,
|
|
227
|
+
accept = _a.accept,
|
|
228
|
+
restUploadProps = __rest(_a, ["beforeUpload", "accept"]);
|
|
229
|
+
beforeUploadRef.current = beforeUpload;
|
|
230
|
+
return __assign(__assign({}, upload), {
|
|
231
|
+
props: __assign(__assign({}, restUploadProps), {
|
|
232
|
+
accept: accept || 'image/*',
|
|
233
|
+
beforeUpload: function beforeUpload(file, fileList) {
|
|
234
|
+
return new Promise(function (resolve, reject) {
|
|
235
|
+
if (beforeCrop && !beforeCrop(file, fileList)) {
|
|
236
|
+
reject();
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
fileRef.current = file;
|
|
240
|
+
resolveRef.current = resolve;
|
|
241
|
+
rejectRef.current = reject;
|
|
242
|
+
var reader = new FileReader();
|
|
243
|
+
reader.addEventListener('load', function () {
|
|
244
|
+
setSrc(reader.result);
|
|
287
245
|
});
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
);
|
|
246
|
+
reader.readAsDataURL(file);
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
})
|
|
250
|
+
});
|
|
251
|
+
}, [beforeCrop, children]);
|
|
294
252
|
/**
|
|
295
253
|
* EasyCrop
|
|
296
254
|
*/
|
|
@@ -304,287 +262,179 @@ var ImgCrop = function ImgCrop(props) {
|
|
|
304
262
|
var isMaxZoom = zoomVal + ZOOM_STEP > maxZoom;
|
|
305
263
|
var isMinRotate = rotateVal === MIN_ROTATE;
|
|
306
264
|
var isMaxRotate = rotateVal === MAX_ROTATE;
|
|
307
|
-
var subZoomVal = React.useCallback(
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
);
|
|
313
|
-
var
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
);
|
|
319
|
-
var subRotateVal = React.useCallback(
|
|
320
|
-
function () {
|
|
321
|
-
if (!isMinRotate) setRotateVal(rotateVal - ROTATE_STEP);
|
|
322
|
-
},
|
|
323
|
-
[isMinRotate, rotateVal],
|
|
324
|
-
);
|
|
325
|
-
var addRotateVal = React.useCallback(
|
|
326
|
-
function () {
|
|
327
|
-
if (!isMaxRotate) setRotateVal(rotateVal + ROTATE_STEP);
|
|
328
|
-
},
|
|
329
|
-
[isMaxRotate, rotateVal],
|
|
330
|
-
);
|
|
265
|
+
var subZoomVal = React.useCallback(function () {
|
|
266
|
+
if (!isMinZoom) setZoomVal(zoomVal - ZOOM_STEP);
|
|
267
|
+
}, [isMinZoom, zoomVal]);
|
|
268
|
+
var addZoomVal = React.useCallback(function () {
|
|
269
|
+
if (!isMaxZoom) setZoomVal(zoomVal + ZOOM_STEP);
|
|
270
|
+
}, [isMaxZoom, zoomVal]);
|
|
271
|
+
var subRotateVal = React.useCallback(function () {
|
|
272
|
+
if (!isMinRotate) setRotateVal(rotateVal - ROTATE_STEP);
|
|
273
|
+
}, [isMinRotate, rotateVal]);
|
|
274
|
+
var addRotateVal = React.useCallback(function () {
|
|
275
|
+
if (!isMaxRotate) setRotateVal(rotateVal + ROTATE_STEP);
|
|
276
|
+
}, [isMaxRotate, rotateVal]);
|
|
331
277
|
/**
|
|
332
278
|
* Modal
|
|
333
279
|
*/
|
|
334
|
-
var modalProps = React.useMemo(
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
},
|
|
344
|
-
[modalCancel, modalOk, modalWidth],
|
|
345
|
-
);
|
|
280
|
+
var modalProps = React.useMemo(function () {
|
|
281
|
+
var obj = {
|
|
282
|
+
width: modalWidth,
|
|
283
|
+
okText: modalOk,
|
|
284
|
+
cancelText: modalCancel,
|
|
285
|
+
closable: closable
|
|
286
|
+
};
|
|
287
|
+
return obj;
|
|
288
|
+
}, [modalCancel, modalOk, modalWidth]);
|
|
346
289
|
var onClose = React.useCallback(function () {
|
|
347
290
|
setSrc('');
|
|
348
291
|
setZoomVal(1);
|
|
349
292
|
setRotateVal(0);
|
|
350
293
|
}, []);
|
|
351
|
-
var onOk = React.useCallback(
|
|
352
|
-
function () {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
case 2:
|
|
431
|
-
newFile.uid = uid;
|
|
432
|
-
if (typeof beforeUploadRef.current !== 'function')
|
|
433
|
-
return [2 /*return*/, resolveRef.current(newFile)];
|
|
434
|
-
res = beforeUploadRef.current(newFile, [newFile]);
|
|
435
|
-
if (!(typeof res !== 'boolean' && !res)) return [3 /*break*/, 3];
|
|
436
|
-
console.error('beforeUpload must return a boolean or Promise');
|
|
437
|
-
return [3 /*break*/, 7];
|
|
438
|
-
case 3:
|
|
439
|
-
if (res === true)
|
|
440
|
-
return [2 /*return*/, resolveRef.current(newFile)];
|
|
441
|
-
if (res === false)
|
|
442
|
-
return [2 /*return*/, rejectRef.current('not upload')];
|
|
443
|
-
if (!(res && typeof res.then === 'function'))
|
|
444
|
-
return [3 /*break*/, 7];
|
|
445
|
-
_a.label = 4;
|
|
446
|
-
case 4:
|
|
447
|
-
_a.trys.push([4, 6, , 7]);
|
|
448
|
-
return [4 /*yield*/, res];
|
|
449
|
-
case 5:
|
|
450
|
-
passedFile = _a.sent();
|
|
451
|
-
fileType = Object.prototype.toString.call(passedFile);
|
|
452
|
-
if (fileType === '[object File]' || fileType === '[object Blob]')
|
|
453
|
-
newFile = passedFile;
|
|
454
|
-
resolveRef.current(newFile);
|
|
455
|
-
return [3 /*break*/, 7];
|
|
456
|
-
case 6:
|
|
457
|
-
err_1 = _a.sent();
|
|
458
|
-
rejectRef.current(err_1);
|
|
459
|
-
return [3 /*break*/, 7];
|
|
460
|
-
case 7:
|
|
461
|
-
return [2 /*return*/, null];
|
|
462
|
-
}
|
|
463
|
-
});
|
|
464
|
-
});
|
|
465
|
-
},
|
|
466
|
-
type,
|
|
467
|
-
quality,
|
|
468
|
-
);
|
|
469
|
-
return [2 /*return*/];
|
|
470
|
-
});
|
|
294
|
+
var onOk = React.useCallback(function () {
|
|
295
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
296
|
+
var naturalImg, naturalWidth, naturalHeight, canvas, ctx, maxLen, halfMax, left, top, maxImgData, _a, width, height, x, y, _b, type, name, uid;
|
|
297
|
+
return __generator(this, function (_c) {
|
|
298
|
+
onClose();
|
|
299
|
+
naturalImg = document.querySelector(".".concat(MEDIA_CLASS));
|
|
300
|
+
naturalWidth = naturalImg.naturalWidth, naturalHeight = naturalImg.naturalHeight;
|
|
301
|
+
canvas = document.createElement('canvas');
|
|
302
|
+
ctx = canvas.getContext('2d');
|
|
303
|
+
maxLen = Math.sqrt(Math.pow(naturalWidth, 2) + Math.pow(naturalHeight, 2));
|
|
304
|
+
canvas.width = maxLen;
|
|
305
|
+
canvas.height = maxLen;
|
|
306
|
+
// rotate the image
|
|
307
|
+
if (hasRotate && rotateVal > 0 && rotateVal < 360) {
|
|
308
|
+
halfMax = maxLen / 2;
|
|
309
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.translate(halfMax, halfMax);
|
|
310
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.rotate(rotateVal * Math.PI / 180);
|
|
311
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.translate(-halfMax, -halfMax);
|
|
312
|
+
}
|
|
313
|
+
ctx.fillStyle = fillColor;
|
|
314
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
315
|
+
left = (maxLen - naturalWidth) / 2;
|
|
316
|
+
top = (maxLen - naturalHeight) / 2;
|
|
317
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(naturalImg, left, top);
|
|
318
|
+
maxImgData = ctx === null || ctx === void 0 ? void 0 : ctx.getImageData(0, 0, maxLen, maxLen);
|
|
319
|
+
_a = cropPixelsRef.current, width = _a.width, height = _a.height, x = _a.x, y = _a.y;
|
|
320
|
+
canvas.width = width;
|
|
321
|
+
canvas.height = height;
|
|
322
|
+
ctx.putImageData(maxImgData, Math.round(-left - x), Math.round(-top - y));
|
|
323
|
+
_b = fileRef.current, type = _b.type, name = _b.name, uid = _b.uid;
|
|
324
|
+
canvas.toBlob(function (blob) {
|
|
325
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
326
|
+
var newFile, url, imgUrl, fileObj, res, passedFile, fileType, err_1;
|
|
327
|
+
return __generator(this, function (_a) {
|
|
328
|
+
switch (_a.label) {
|
|
329
|
+
case 0:
|
|
330
|
+
newFile = new File([blob], name, {
|
|
331
|
+
type: type
|
|
332
|
+
});
|
|
333
|
+
if (!zipImg) return [3 /*break*/, 2];
|
|
334
|
+
url = window.URL || window.webkitURL;
|
|
335
|
+
imgUrl = url.createObjectURL(newFile);
|
|
336
|
+
return [4 /*yield*/, getCroppedImg(imgUrl, zipImg, name, type)];
|
|
337
|
+
case 1:
|
|
338
|
+
fileObj = _a.sent().fileObj;
|
|
339
|
+
newFile = fileObj;
|
|
340
|
+
_a.label = 2;
|
|
341
|
+
case 2:
|
|
342
|
+
newFile.uid = uid;
|
|
343
|
+
if (typeof beforeUploadRef.current !== 'function') return [2 /*return*/, resolveRef.current(newFile)];
|
|
344
|
+
res = beforeUploadRef.current(newFile, [newFile]);
|
|
345
|
+
if (!(typeof res !== 'boolean' && !res)) return [3 /*break*/, 3];
|
|
346
|
+
console.error('beforeUpload must return a boolean or Promise');
|
|
347
|
+
return [3 /*break*/, 7];
|
|
348
|
+
case 3:
|
|
349
|
+
if (res === true) return [2 /*return*/, resolveRef.current(newFile)];
|
|
350
|
+
if (res === false) return [2 /*return*/, rejectRef.current('not upload')];
|
|
351
|
+
if (!(res && typeof res.then === 'function')) return [3 /*break*/, 7];
|
|
352
|
+
_a.label = 4;
|
|
353
|
+
case 4:
|
|
354
|
+
_a.trys.push([4, 6,, 7]);
|
|
355
|
+
return [4 /*yield*/, res];
|
|
356
|
+
case 5:
|
|
357
|
+
passedFile = _a.sent();
|
|
358
|
+
fileType = Object.prototype.toString.call(passedFile);
|
|
359
|
+
if (fileType === '[object File]' || fileType === '[object Blob]') newFile = passedFile;
|
|
360
|
+
resolveRef.current(newFile);
|
|
361
|
+
return [3 /*break*/, 7];
|
|
362
|
+
case 6:
|
|
363
|
+
err_1 = _a.sent();
|
|
364
|
+
rejectRef.current(err_1);
|
|
365
|
+
return [3 /*break*/, 7];
|
|
366
|
+
case 7:
|
|
367
|
+
return [2 /*return*/, null];
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
}, type, quality);
|
|
372
|
+
return [2 /*return*/];
|
|
471
373
|
});
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
);
|
|
374
|
+
});
|
|
375
|
+
}, [hasRotate, onClose, quality, rotateVal]);
|
|
475
376
|
var renderComponent = function renderComponent(titleOfModal) {
|
|
476
|
-
return /*#__PURE__*/ React.createElement(
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
/*#__PURE__*/ React.createElement(Slider, {
|
|
536
|
-
min: minZoom,
|
|
537
|
-
max: maxZoom,
|
|
538
|
-
step: ZOOM_STEP,
|
|
539
|
-
value: zoomVal,
|
|
540
|
-
onChange: setZoomVal,
|
|
541
|
-
}),
|
|
542
|
-
/*#__PURE__*/ React.createElement(
|
|
543
|
-
'button',
|
|
544
|
-
{
|
|
545
|
-
type: 'button',
|
|
546
|
-
onClick: addZoomVal,
|
|
547
|
-
disabled: isMaxZoom,
|
|
548
|
-
},
|
|
549
|
-
'\uFF0B',
|
|
550
|
-
),
|
|
551
|
-
),
|
|
552
|
-
hasRotate &&
|
|
553
|
-
/*#__PURE__*/ React.createElement(
|
|
554
|
-
'div',
|
|
555
|
-
{
|
|
556
|
-
className: ''.concat(pkg, '-control rotate'),
|
|
557
|
-
},
|
|
558
|
-
/*#__PURE__*/ React.createElement(
|
|
559
|
-
'button',
|
|
560
|
-
{
|
|
561
|
-
type: 'button',
|
|
562
|
-
onClick: subRotateVal,
|
|
563
|
-
disabled: isMinRotate,
|
|
564
|
-
},
|
|
565
|
-
'\u21BA',
|
|
566
|
-
),
|
|
567
|
-
/*#__PURE__*/ React.createElement(Slider, {
|
|
568
|
-
min: MIN_ROTATE,
|
|
569
|
-
max: MAX_ROTATE,
|
|
570
|
-
step: ROTATE_STEP,
|
|
571
|
-
value: rotateVal,
|
|
572
|
-
onChange: setRotateVal,
|
|
573
|
-
}),
|
|
574
|
-
/*#__PURE__*/ React.createElement(
|
|
575
|
-
'button',
|
|
576
|
-
{
|
|
577
|
-
type: 'button',
|
|
578
|
-
onClick: addRotateVal,
|
|
579
|
-
disabled: isMaxRotate,
|
|
580
|
-
},
|
|
581
|
-
'\u21BB',
|
|
582
|
-
),
|
|
583
|
-
),
|
|
584
|
-
),
|
|
585
|
-
);
|
|
377
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, renderUpload(), src && /*#__PURE__*/React.createElement(Modal, __assign({
|
|
378
|
+
open: true,
|
|
379
|
+
wrapClassName: "".concat(pkg, "-modal"),
|
|
380
|
+
title: titleOfModal,
|
|
381
|
+
onOk: onOk,
|
|
382
|
+
onCancel: onClose,
|
|
383
|
+
maskClosable: false,
|
|
384
|
+
destroyOnClose: true,
|
|
385
|
+
centered: true
|
|
386
|
+
}, modalProps), /*#__PURE__*/React.createElement(EasyCrop, __assign({
|
|
387
|
+
image: src,
|
|
388
|
+
aspect: aspect,
|
|
389
|
+
cropShape: shape,
|
|
390
|
+
showGrid: grid,
|
|
391
|
+
zoomWithScroll: hasZoom,
|
|
392
|
+
zoom: zoomVal,
|
|
393
|
+
rotation: rotateVal,
|
|
394
|
+
onZoomChange: setZoomVal,
|
|
395
|
+
onRotationChange: setRotateVal,
|
|
396
|
+
minZoom: minZoom,
|
|
397
|
+
maxZoom: maxZoom,
|
|
398
|
+
onComplete: onComplete,
|
|
399
|
+
classes: {
|
|
400
|
+
containerClassName: "".concat(pkg, "-container"),
|
|
401
|
+
mediaClassName: MEDIA_CLASS
|
|
402
|
+
}
|
|
403
|
+
}, cropperProps)), hasZoom && /*#__PURE__*/React.createElement("div", {
|
|
404
|
+
className: "".concat(pkg, "-control zoom")
|
|
405
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
406
|
+
type: "button",
|
|
407
|
+
onClick: subZoomVal,
|
|
408
|
+
disabled: isMinZoom
|
|
409
|
+
}, "\uFF0D"), /*#__PURE__*/React.createElement(Slider, {
|
|
410
|
+
min: minZoom,
|
|
411
|
+
max: maxZoom,
|
|
412
|
+
step: ZOOM_STEP,
|
|
413
|
+
value: zoomVal,
|
|
414
|
+
onChange: setZoomVal
|
|
415
|
+
}), /*#__PURE__*/React.createElement("button", {
|
|
416
|
+
type: "button",
|
|
417
|
+
onClick: addZoomVal,
|
|
418
|
+
disabled: isMaxZoom
|
|
419
|
+
}, "\uFF0B")), hasRotate && /*#__PURE__*/React.createElement("div", {
|
|
420
|
+
className: "".concat(pkg, "-control rotate")
|
|
421
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
422
|
+
type: "button",
|
|
423
|
+
onClick: subRotateVal,
|
|
424
|
+
disabled: isMinRotate
|
|
425
|
+
}, "\u21BA"), /*#__PURE__*/React.createElement(Slider, {
|
|
426
|
+
min: MIN_ROTATE,
|
|
427
|
+
max: MAX_ROTATE,
|
|
428
|
+
step: ROTATE_STEP,
|
|
429
|
+
value: rotateVal,
|
|
430
|
+
onChange: setRotateVal
|
|
431
|
+
}), /*#__PURE__*/React.createElement("button", {
|
|
432
|
+
type: "button",
|
|
433
|
+
onClick: addRotateVal,
|
|
434
|
+
disabled: isMaxRotate
|
|
435
|
+
}, "\u21BB"))));
|
|
586
436
|
};
|
|
587
437
|
return renderComponent(modalTitle);
|
|
588
438
|
};
|
|
589
439
|
ImgCrop.getCroppedImg = getCroppedImg;
|
|
590
|
-
export default ImgCrop;
|
|
440
|
+
export default ImgCrop;
|