@fibrae/semi-foundation 0.3.1 → 0.5.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.
- package/README.md +10 -10
- package/README.zh-CN.md +10 -10
- package/dist/base/auto-close-foundation.d.ts +21 -6
- package/dist/base/auto-close-foundation.js +28 -9
- package/dist/base/focus-handle.d.ts +42 -0
- package/dist/base/focus-handle.js +89 -0
- package/dist/base/focus-scope.js +75 -0
- package/dist/base/foundation.d.ts +57 -26
- package/dist/base/foundation.js +59 -26
- package/dist/base/list-store.js +15 -2
- package/dist/base/modal-resources.d.ts +35 -0
- package/dist/base/modal-resources.js +57 -0
- package/dist/base/popup-lifecycle.d.ts +13 -0
- package/dist/base/popup-lifecycle.js +30 -0
- package/dist/base/release-holder.js +18 -0
- package/dist/base/reset-timer.d.ts +9 -0
- package/dist/base/reset-timer.js +29 -0
- package/dist/base/static-list-wrapper.d.ts +15 -0
- package/dist/base/static-list-wrapper.js +47 -0
- package/dist/base/tokens.css +36 -36
- package/dist/components/anchor/constants.d.ts +11 -0
- package/dist/components/anchor/constants.js +18 -0
- package/dist/components/anchor/foundation.d.ts +49 -0
- package/dist/components/anchor/foundation.js +162 -0
- package/dist/components/anchor/utils.js +16 -0
- package/dist/components/anchor/variables.scss +34 -0
- package/dist/components/audio-player/audio-player.css +226 -0
- package/dist/components/audio-player/audio-player.scss +278 -0
- package/dist/components/audio-player/constants.js +27 -0
- package/dist/components/audio-player/foundation.d.ts +44 -0
- package/dist/components/audio-player/foundation.js +126 -0
- package/dist/components/audio-player/utils.js +6 -0
- package/dist/components/audio-player/variables.scss +53 -0
- package/dist/components/auto-complete/constants.js +7 -0
- package/dist/components/auto-complete/foundation.d.ts +67 -0
- package/dist/components/auto-complete/foundation.js +217 -0
- package/dist/components/auto-complete/option.css +62 -0
- package/dist/components/avatar/constants.js +13 -0
- package/dist/components/avatar/foundation.d.ts +31 -0
- package/dist/components/avatar/foundation.js +43 -0
- package/dist/components/avatar/variables.scss +112 -0
- package/dist/components/backtop/constants.js +35 -0
- package/dist/components/backtop/foundation.d.ts +26 -0
- package/dist/components/backtop/foundation.js +94 -0
- package/dist/components/badge/constants.js +4 -0
- package/dist/components/banner/constants.js +4 -0
- package/dist/components/banner/foundation.d.ts +12 -0
- package/dist/components/banner/foundation.js +12 -0
- package/dist/components/breadcrumb/breadcrumb.scss +116 -0
- package/dist/components/breadcrumb/constants.js +8 -0
- package/dist/components/breadcrumb/foundation.d.ts +47 -0
- package/dist/components/breadcrumb/foundation.js +64 -0
- package/dist/components/breadcrumb/item-foundation.d.ts +45 -0
- package/dist/components/breadcrumb/item-foundation.js +36 -0
- package/dist/components/button/constants.js +5 -0
- package/dist/components/button/split-button-group.css +19 -0
- package/dist/components/button/utils.d.ts +27 -0
- package/dist/components/button/utils.js +89 -0
- package/dist/components/button/variables.scss +169 -0
- package/dist/components/calendar/calendar.css +485 -0
- package/dist/components/calendar/calendar.scss +515 -0
- package/dist/components/calendar/constants.js +14 -0
- package/dist/components/calendar/event-util.js +193 -0
- package/dist/components/calendar/foundation.d.ts +75 -0
- package/dist/components/calendar/foundation.js +196 -0
- package/dist/components/calendar/month-foundation.d.ts +22 -0
- package/dist/components/calendar/month-foundation.js +32 -0
- package/dist/components/card/constants.js +4 -0
- package/dist/components/carousel/carousel.css +345 -0
- package/dist/components/carousel/carousel.scss +451 -0
- package/dist/components/carousel/constants.js +42 -0
- package/dist/components/carousel/foundation.d.ts +64 -0
- package/dist/components/carousel/foundation.js +217 -0
- package/dist/components/carousel/variables.scss +49 -0
- package/dist/components/cascader/cascader.scss +586 -0
- package/dist/components/cascader/constants.js +20 -0
- package/dist/components/cascader/foundation.d.ts +295 -0
- package/dist/components/cascader/foundation.js +884 -0
- package/dist/components/cascader/util.js +148 -0
- package/dist/components/checkbox/checkbox-foundation.d.ts +100 -0
- package/dist/components/checkbox/checkbox-foundation.js +74 -0
- package/dist/components/checkbox/checkbox-group-foundation.d.ts +25 -0
- package/dist/components/checkbox/checkbox-group-foundation.js +34 -0
- package/dist/components/checkbox/constants.js +15 -0
- package/dist/components/checkbox/variables.scss +72 -0
- package/dist/components/code-highlight/constants.js +4 -0
- package/dist/components/code-highlight/highlighter.js +56 -0
- package/dist/components/code-highlight/index.d.ts +26 -0
- package/dist/components/code-highlight/index.js +43 -0
- package/dist/components/code-highlight/registry.js +33 -0
- package/dist/components/collapse/collapse.scss +112 -0
- package/dist/components/collapse/constants.js +4 -0
- package/dist/components/collapse/foundation.d.ts +51 -0
- package/dist/components/collapse/foundation.js +56 -0
- package/dist/components/collapsible/constants.js +4 -0
- package/dist/components/collapsible/foundation.d.ts +69 -0
- package/dist/components/collapsible/foundation.js +132 -0
- package/dist/components/color-picker/color-choose-area-foundation.d.ts +33 -0
- package/dist/components/color-picker/color-choose-area-foundation.js +57 -0
- package/dist/components/color-picker/color-picker.scss +129 -0
- package/dist/components/color-picker/color-slider-foundation.d.ts +28 -0
- package/dist/components/color-picker/color-slider-foundation.js +45 -0
- package/dist/components/color-picker/constants.js +4 -0
- package/dist/components/color-picker/data-part-foundation.d.ts +35 -0
- package/dist/components/color-picker/data-part-foundation.js +86 -0
- package/dist/components/color-picker/foundation.d.ts +53 -0
- package/dist/components/color-picker/foundation.js +150 -0
- package/dist/components/color-picker/utils/convert.d.ts +14 -0
- package/dist/components/color-picker/utils/convert.js +148 -0
- package/dist/components/color-picker/utils/round.js +5 -0
- package/dist/components/color-picker/utils/split.js +26 -0
- package/dist/components/config-provider/breakpoint-observer.js +139 -0
- package/dist/components/config-provider/inherit-config.d.ts +24 -0
- package/dist/components/config-provider/inherit-config.js +24 -0
- package/dist/components/cropper/constants.js +37 -0
- package/dist/components/cropper/cropper.scss +129 -0
- package/dist/components/cropper/foundation.d.ts +94 -0
- package/dist/components/cropper/foundation.js +851 -0
- package/dist/components/cropper/utils.js +23 -0
- package/dist/components/date-picker/_utils/formatter.js +21 -0
- package/dist/components/date-picker/_utils/get-day-of-week.js +14 -0
- package/dist/components/date-picker/_utils/get-default-format-token.js +18 -0
- package/dist/components/date-picker/_utils/get-default-picker-date.js +35 -0
- package/dist/components/date-picker/_utils/get-full-date-offset.js +11 -0
- package/dist/components/date-picker/_utils/get-inset-input-format-token.js +33 -0
- package/dist/components/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +57 -0
- package/dist/components/date-picker/_utils/get-month-table.js +33 -0
- package/dist/components/date-picker/_utils/get-year-and-month.js +18 -0
- package/dist/components/date-picker/_utils/get-year-month-from-value.js +18 -0
- package/dist/components/date-picker/_utils/get-years.js +9 -0
- package/dist/components/date-picker/_utils/index.d.ts +9 -0
- package/dist/components/date-picker/_utils/index.js +9 -0
- package/dist/components/date-picker/_utils/is-after.js +7 -0
- package/dist/components/date-picker/_utils/is-before.js +7 -0
- package/dist/components/date-picker/_utils/is-between.js +11 -0
- package/dist/components/date-picker/_utils/is-same-day.js +7 -0
- package/dist/components/date-picker/_utils/is-timestamp.js +6 -0
- package/dist/components/date-picker/_utils/is-valid-date.js +5 -0
- package/dist/components/date-picker/_utils/parser.js +17 -0
- package/dist/components/date-picker/_utils/picker-type.d.ts +18 -0
- package/dist/components/date-picker/_utils/picker-type.js +28 -0
- package/dist/components/date-picker/_utils/to-callback-args.js +46 -0
- package/dist/components/date-picker/_utils/to-date-arg.js +13 -0
- package/dist/components/date-picker/constants.js +78 -0
- package/dist/components/date-picker/date-picker.scss +1762 -0
- package/dist/components/date-picker/foundation.d.ts +299 -0
- package/dist/components/date-picker/foundation.js +707 -0
- package/dist/components/date-picker/input-foundation.d.ts +134 -0
- package/dist/components/date-picker/input-foundation.js +212 -0
- package/dist/components/date-picker/month-foundation.d.ts +163 -0
- package/dist/components/date-picker/month-foundation.js +196 -0
- package/dist/components/date-picker/months-grid-foundation.d.ts +163 -0
- package/dist/components/date-picker/months-grid-foundation.js +614 -0
- package/dist/components/date-picker/year-and-month-foundation.d.ts +75 -0
- package/dist/components/date-picker/year-and-month-foundation.js +115 -0
- package/dist/components/descriptions/constants.js +4 -0
- package/dist/components/descriptions/foundation.d.ts +9 -0
- package/dist/components/descriptions/foundation.js +33 -0
- package/dist/components/divider/constants.js +4 -0
- package/dist/components/drag-move/foundation.d.ts +31 -0
- package/dist/components/drag-move/foundation.js +203 -0
- package/dist/components/dropdown/constants.js +12 -0
- package/dist/components/dropdown/foundation.d.ts +37 -0
- package/dist/components/dropdown/foundation.js +124 -0
- package/dist/components/dropdown/menu-foundation.d.ts +35 -0
- package/dist/components/dropdown/menu-foundation.js +83 -0
- package/dist/components/empty/constants.js +5 -0
- package/dist/components/feedback/constants.js +19 -0
- package/dist/components/feedback/feedback.scss +153 -0
- package/dist/components/feedback/foundation.d.ts +42 -0
- package/dist/components/feedback/foundation.js +70 -0
- package/dist/components/float-button/constants.js +13 -0
- package/dist/components/float-button/float-button.scss +201 -0
- package/dist/components/form/array-field-rows.d.ts +23 -0
- package/dist/components/form/array-field-rows.js +60 -0
- package/dist/components/form/constants.d.ts +15 -0
- package/dist/components/form/constants.js +47 -0
- package/dist/components/form/errors.d.ts +15 -0
- package/dist/components/form/errors.js +50 -0
- package/dist/components/form/field-store.js +28 -0
- package/dist/components/form/form-api-proxy.d.ts +14 -0
- package/dist/components/form/form-api-proxy.js +48 -0
- package/dist/components/form/form.css +250 -0
- package/dist/components/form/form.scss +319 -0
- package/dist/components/form/foundation.d.ts +71 -0
- package/dist/components/form/foundation.js +1100 -0
- package/dist/components/form/interface.d.ts +247 -0
- package/dist/components/form/json-schema.d.ts +42 -0
- package/dist/components/form/json-schema.js +208 -0
- package/dist/components/form/rtl.scss +13 -0
- package/dist/components/form/rules.d.ts +37 -0
- package/dist/components/form/rules.js +97 -0
- package/dist/components/form/utils.d.ts +119 -0
- package/dist/components/form/utils.js +154 -0
- package/dist/components/form/variables.scss +52 -0
- package/dist/components/grid/constants.js +12 -0
- package/dist/components/grid/gutter.js +39 -0
- package/dist/components/grid/utils.js +39 -0
- package/dist/components/highlight/constants.js +4 -0
- package/dist/components/highlight/foundation.js +108 -0
- package/dist/components/hot-keys/constants.js +207 -0
- package/dist/components/hot-keys/foundation.d.ts +22 -0
- package/dist/components/hot-keys/foundation.js +96 -0
- package/dist/components/image/constants.js +5 -0
- package/dist/components/image/image-foundation.d.ts +39 -0
- package/dist/components/image/image-foundation.js +60 -0
- package/dist/components/image/image.scss +272 -0
- package/dist/components/image/preview-footer-foundation.d.ts +25 -0
- package/dist/components/image/preview-footer-foundation.js +30 -0
- package/dist/components/image/preview-foundation.d.ts +54 -0
- package/dist/components/image/preview-foundation.js +79 -0
- package/dist/components/image/preview-image-foundation.d.ts +63 -0
- package/dist/components/image/preview-image-foundation.js +238 -0
- package/dist/components/image/preview-inner-foundation.d.ts +92 -0
- package/dist/components/image/preview-inner-foundation.js +290 -0
- package/dist/components/image/utils.js +66 -0
- package/dist/components/input/constants.d.ts +8 -0
- package/dist/components/input/constants.js +13 -0
- package/dist/components/input/foundation.d.ts +51 -0
- package/dist/components/input/foundation.js +81 -0
- package/dist/components/input/input.css +619 -0
- package/dist/components/input/input.scss +746 -0
- package/dist/components/input/text-entry-foundation.d.ts +60 -0
- package/dist/components/input/text-entry-foundation.js +105 -0
- package/dist/components/input/textarea-foundation.d.ts +63 -0
- package/dist/components/input/textarea-foundation.js +138 -0
- package/dist/components/input/textarea.css +260 -0
- package/dist/components/input/textarea.scss +320 -0
- package/dist/components/input/util/line-number.js +42 -0
- package/dist/components/input/util/truncate-value.js +14 -0
- package/dist/components/input/variables.scss +107 -0
- package/dist/components/input-number/caret.js +20 -0
- package/dist/components/input-number/constants.d.ts +14 -0
- package/dist/components/input-number/constants.js +13 -0
- package/dist/components/input-number/foundation.d.ts +104 -0
- package/dist/components/input-number/foundation.js +555 -0
- package/dist/components/json-viewer/constants.js +4 -0
- package/dist/components/json-viewer/foundation.d.ts +53 -0
- package/dist/components/json-viewer/foundation.js +161 -0
- package/dist/components/json-viewer/json-viewer.scss +224 -0
- package/dist/components/layout/constants.js +4 -0
- package/dist/components/list/constants.js +4 -0
- package/dist/components/list/list.scss +162 -0
- package/dist/components/lottie/constants.js +4 -0
- package/dist/components/lottie/foundation.d.ts +31 -0
- package/dist/components/lottie/foundation.js +65 -0
- package/dist/components/markdown-render/constants.js +4 -0
- package/dist/components/markdown-render/foundation.d.ts +54 -0
- package/dist/components/markdown-render/foundation.js +118 -0
- package/dist/components/modal/confirm-registry.d.ts +10 -0
- package/dist/components/modal/confirm-registry.js +21 -0
- package/dist/components/modal/confirm.js +34 -0
- package/dist/components/modal/constants.js +4 -0
- package/dist/components/modal/modal-content-foundation.d.ts +38 -0
- package/dist/components/modal/modal-content-foundation.js +73 -0
- package/dist/components/modal/modal-foundation.d.ts +92 -0
- package/dist/components/modal/modal-foundation.js +115 -0
- package/dist/components/navigation/constants.js +20 -0
- package/dist/components/navigation/foundation.d.ts +81 -0
- package/dist/components/navigation/foundation.js +180 -0
- package/dist/components/navigation/item-foundation.d.ts +44 -0
- package/dist/components/navigation/item-foundation.js +42 -0
- package/dist/components/navigation/navigation.scss +764 -0
- package/dist/components/navigation/sub-nav-foundation.d.ts +30 -0
- package/dist/components/navigation/sub-nav-foundation.js +54 -0
- package/dist/components/navigation/variables.scss +120 -0
- package/dist/components/notification/constants.js +32 -0
- package/dist/components/notification/notification-api-foundation.d.ts +29 -0
- package/dist/components/notification/notification-api-foundation.js +58 -0
- package/dist/components/notification/notification-foundation.d.ts +40 -0
- package/dist/components/notification/notification-foundation.js +12 -0
- package/dist/components/notification/notification-list-foundation.d.ts +73 -0
- package/dist/components/notification/notification-list-foundation.js +94 -0
- package/dist/components/overflow-list/constants.d.ts +21 -0
- package/dist/components/overflow-list/constants.js +22 -0
- package/dist/components/overflow-list/foundation.d.ts +78 -0
- package/dist/components/overflow-list/foundation.js +195 -0
- package/dist/components/pagination/constants.js +14 -0
- package/dist/components/pagination/foundation.d.ts +54 -0
- package/dist/components/pagination/foundation.js +185 -0
- package/dist/components/pagination/pagination.scss +189 -0
- package/dist/components/pincode/constants.js +4 -0
- package/dist/components/pincode/foundation.d.ts +38 -0
- package/dist/components/pincode/foundation.js +92 -0
- package/dist/components/popconfirm/constants.d.ts +4 -0
- package/dist/components/popconfirm/constants.js +7 -0
- package/dist/components/popconfirm/popconfirm-foundation.d.ts +47 -0
- package/dist/components/popconfirm/popconfirm-foundation.js +85 -0
- package/dist/components/popover/constants.js +47 -0
- package/dist/components/progress/constants.js +8 -0
- package/dist/components/progress/generates.js +24 -0
- package/dist/components/progress/utils.js +45 -0
- package/dist/components/radio/constants.js +19 -0
- package/dist/components/radio/radio-foundation.d.ts +76 -0
- package/dist/components/radio/radio-foundation.js +92 -0
- package/dist/components/radio/radio-group-foundation.d.ts +19 -0
- package/dist/components/radio/radio-group-foundation.js +31 -0
- package/dist/components/radio/variables.scss +107 -0
- package/dist/components/rating/constants.js +5 -0
- package/dist/components/rating/foundation.d.ts +101 -0
- package/dist/components/rating/foundation.js +166 -0
- package/dist/components/rating/variables.scss +19 -0
- package/dist/components/resizable/constants.js +4 -0
- package/dist/components/resizable/foundation.d.ts +3 -0
- package/dist/components/resizable/group/index.d.ts +60 -0
- package/dist/components/resizable/group/index.js +351 -0
- package/dist/components/resizable/resizable.scss +146 -0
- package/dist/components/resizable/single/index.d.ts +86 -0
- package/dist/components/resizable/single/index.js +444 -0
- package/dist/components/resizable/types.js +18 -0
- package/dist/components/resizable/utils.js +53 -0
- package/dist/components/scroll-list/constants.js +11 -0
- package/dist/components/scroll-list/item-foundation.d.ts +57 -0
- package/dist/components/scroll-list/item-foundation.js +331 -0
- package/dist/components/scroll-list/scroll-list.scss +198 -0
- package/dist/components/scroll-list/scroll-to.js +15 -0
- package/dist/components/select/combobox-name.js +21 -0
- package/dist/components/select/constants.js +22 -0
- package/dist/components/select/foundation.d.ts +135 -0
- package/dist/components/select/foundation.js +752 -0
- package/dist/components/select/option-foundation.js +35 -0
- package/dist/components/select/option.css +67 -0
- package/dist/components/select/select.scss +554 -0
- package/dist/components/side-sheet/constants.js +5 -0
- package/dist/components/side-sheet/side-sheet-foundation.d.ts +80 -0
- package/dist/components/side-sheet/side-sheet-foundation.js +109 -0
- package/dist/components/skeleton/constants.js +4 -0
- package/dist/components/slider/constants.js +12 -0
- package/dist/components/slider/foundation.d.ts +163 -0
- package/dist/components/slider/foundation.js +444 -0
- package/dist/components/slider/variables.scss +63 -0
- package/dist/components/sortable/accessibility.d.ts +14 -0
- package/dist/components/sortable/accessibility.js +49 -0
- package/dist/components/space/constants.js +9 -0
- package/dist/components/spin/constants.js +3 -0
- package/dist/components/spin/foundation.d.ts +22 -0
- package/dist/components/spin/foundation.js +46 -0
- package/dist/components/spin/spin.scss +111 -0
- package/dist/components/steps/bacis-steps.css +234 -0
- package/dist/components/steps/constants.js +8 -0
- package/dist/components/steps/fill-steps.css +141 -0
- package/dist/components/steps/nav-steps.css +48 -0
- package/dist/components/steps/steps.scss +17 -0
- package/dist/components/steps/utils.js +15 -0
- package/dist/components/switch/constants.js +16 -0
- package/dist/components/switch/foundation.d.ts +23 -0
- package/dist/components/switch/foundation.js +20 -0
- package/dist/components/switch/variables.scss +71 -0
- package/dist/components/table/constants.d.ts +76 -0
- package/dist/components/table/constants.js +111 -0
- package/dist/components/table/foundation.d.ts +356 -0
- package/dist/components/table/foundation.js +1001 -0
- package/dist/components/table/operation-panel.css +29 -0
- package/dist/components/table/table.css +636 -0
- package/dist/components/table/table.scss +788 -0
- package/dist/components/table/utils.d.ts +216 -0
- package/dist/components/table/utils.js +516 -0
- package/dist/components/table/variables.scss +81 -0
- package/dist/components/tabs/constants.d.ts +32 -0
- package/dist/components/tabs/constants.js +39 -0
- package/dist/components/tabs/foundation.d.ts +87 -0
- package/dist/components/tabs/foundation.js +190 -0
- package/dist/components/tabs/tabs.scss +933 -0
- package/dist/components/tabs/variables.scss +155 -0
- package/dist/components/tag/constants.js +35 -0
- package/dist/components/tag/focus.js +22 -0
- package/dist/components/tag/mixin.scss +19 -0
- package/dist/components/tag/tag-key.js +18 -0
- package/dist/components/tag/tag.css +537 -0
- package/dist/components/tag/variables.scss +85 -0
- package/dist/components/tag-input/constants.js +9 -0
- package/dist/components/tag-input/foundation.d.ts +94 -0
- package/dist/components/tag-input/foundation.js +247 -0
- package/dist/components/tag-input/tag-input.scss +357 -0
- package/dist/components/tag-input/utils/get-splited-array.js +16 -0
- package/dist/components/tag-input/utils/tag-focus.js +14 -0
- package/dist/components/time-picker/combox-foundation.d.ts +64 -0
- package/dist/components/time-picker/combox-foundation.js +96 -0
- package/dist/components/time-picker/constants.js +23 -0
- package/dist/components/time-picker/foundation.d.ts +91 -0
- package/dist/components/time-picker/foundation.js +272 -0
- package/dist/components/time-picker/input-foundation.d.ts +18 -0
- package/dist/components/time-picker/input-foundation.js +35 -0
- package/dist/components/time-picker/utils/index.js +57 -0
- package/dist/components/timeline/constants.js +7 -0
- package/dist/components/timeline/timeline.scss +190 -0
- package/dist/components/timeline/utils.js +10 -0
- package/dist/components/toast/constants.js +34 -0
- package/dist/components/toast/toast-api-foundation.d.ts +26 -0
- package/dist/components/toast/toast-api-foundation.js +49 -0
- package/dist/components/toast/toast-foundation.d.ts +37 -0
- package/dist/components/toast/toast-foundation.js +5 -0
- package/dist/components/toast/toast-list-foundation.d.ts +31 -0
- package/dist/components/toast/toast-list-foundation.js +76 -0
- package/dist/components/tooltip/adjust-position.js +202 -0
- package/dist/components/tooltip/arrow.css +1 -0
- package/dist/components/tooltip/constants.d.ts +53 -0
- package/dist/components/tooltip/constants.js +99 -0
- package/dist/components/tooltip/foundation.d.ts +116 -0
- package/dist/components/tooltip/foundation.js +750 -0
- package/dist/components/tooltip/position.css +10 -0
- package/dist/components/tooltip/tooltip.scss +72 -0
- package/dist/components/transfer/constants.js +10 -0
- package/dist/components/transfer/foundation.d.ts +130 -0
- package/dist/components/transfer/foundation.js +241 -0
- package/dist/components/transfer/transfer-utils.js +45 -0
- package/dist/components/transfer/transfer.scss +260 -0
- package/dist/components/tree/constants.js +8 -0
- package/dist/components/tree/foundation.d.ts +283 -0
- package/dist/components/tree/foundation.js +341 -0
- package/dist/components/tree/shared.d.ts +208 -0
- package/dist/components/tree/shared.js +564 -0
- package/dist/components/tree/tree-util.d.ts +100 -0
- package/dist/components/tree/tree-util.js +447 -0
- package/dist/components/tree/tree.scss +439 -0
- package/dist/components/tree-select/constants.js +19 -0
- package/dist/components/tree-select/foundation.d.ts +161 -0
- package/dist/components/tree-select/foundation.js +427 -0
- package/dist/components/tree-select/tree-select.scss +467 -0
- package/dist/components/typography/constants.js +50 -0
- package/dist/components/typography/ellipsis.js +154 -0
- package/dist/components/typography/format-numeral.js +99 -0
- package/dist/components/typography/typography.scss +383 -0
- package/dist/components/upload/constants.d.ts +24 -0
- package/dist/components/upload/constants.js +39 -0
- package/dist/components/upload/foundation.d.ts +180 -0
- package/dist/components/upload/foundation.js +763 -0
- package/dist/components/upload/upload.scss +640 -0
- package/dist/components/upload/utils.d.ts +25 -0
- package/dist/components/upload/utils.js +102 -0
- package/dist/components/user-guide/constants.js +12 -0
- package/dist/components/user-guide/foundation.d.ts +72 -0
- package/dist/components/user-guide/foundation.js +121 -0
- package/dist/components/video-player/constants.js +48 -0
- package/dist/components/video-player/foundation.d.ts +89 -0
- package/dist/components/video-player/foundation.js +316 -0
- package/dist/components/video-player/progress-foundation.d.ts +48 -0
- package/dist/components/video-player/progress-foundation.js +91 -0
- package/dist/components/video-player/seek-foundation.d.ts +49 -0
- package/dist/components/video-player/seek-foundation.js +52 -0
- package/dist/components/video-player/utils.js +58 -0
- package/dist/components/video-player/video-player.scss +344 -0
- package/dist/locale/format.d.ts +5 -0
- package/dist/locale/format.js +9 -0
- package/dist/locale/interface.d.ts +18 -0
- package/dist/locale/source/ar.js +19 -1
- package/dist/locale/source/az.js +19 -1
- package/dist/locale/source/bg.js +19 -1
- package/dist/locale/source/bn_IN.js +19 -1
- package/dist/locale/source/ca.js +19 -1
- package/dist/locale/source/ceb_PH.js +19 -1
- package/dist/locale/source/cs_CZ.js +19 -1
- package/dist/locale/source/da.js +19 -1
- package/dist/locale/source/de.js +19 -1
- package/dist/locale/source/el_GR.js +19 -1
- package/dist/locale/source/en_GB.js +19 -1
- package/dist/locale/source/en_US.js +19 -1
- package/dist/locale/source/es.js +19 -1
- package/dist/locale/source/es_419.js +19 -1
- package/dist/locale/source/et.js +19 -1
- package/dist/locale/source/fa_IR.js +19 -1
- package/dist/locale/source/fi_FI.js +19 -1
- package/dist/locale/source/fil_PH.js +19 -1
- package/dist/locale/source/fr.js +19 -1
- package/dist/locale/source/fr_CA.js +19 -1
- package/dist/locale/source/ga.js +19 -1
- package/dist/locale/source/he_IL.js +19 -1
- package/dist/locale/source/hi_IN.js +19 -1
- package/dist/locale/source/hr.js +19 -1
- package/dist/locale/source/hu_HU.js +19 -1
- package/dist/locale/source/id_ID.js +19 -1
- package/dist/locale/source/is.js +19 -1
- package/dist/locale/source/it.js +19 -1
- package/dist/locale/source/ja_JP.js +19 -1
- package/dist/locale/source/jv_ID.js +19 -1
- package/dist/locale/source/kk.js +19 -1
- package/dist/locale/source/km_KH.js +19 -1
- package/dist/locale/source/ko_KR.js +19 -1
- package/dist/locale/source/lt.js +19 -1
- package/dist/locale/source/lv.js +19 -1
- package/dist/locale/source/ms_MY.js +19 -1
- package/dist/locale/source/my_MM.js +19 -1
- package/dist/locale/source/nb.js +19 -1
- package/dist/locale/source/nl_NL.js +19 -1
- package/dist/locale/source/pl_PL.js +19 -1
- package/dist/locale/source/pt.js +19 -1
- package/dist/locale/source/pt_BR.js +19 -1
- package/dist/locale/source/ro.js +19 -1
- package/dist/locale/source/ru_RU.js +19 -1
- package/dist/locale/source/sk.js +19 -1
- package/dist/locale/source/sl.js +19 -1
- package/dist/locale/source/sq.js +19 -1
- package/dist/locale/source/sv_SE.js +19 -1
- package/dist/locale/source/sw.js +19 -1
- package/dist/locale/source/th_TH.js +19 -1
- package/dist/locale/source/tr_TR.js +19 -1
- package/dist/locale/source/uk_UA.js +19 -1
- package/dist/locale/source/ur.js +19 -1
- package/dist/locale/source/uz.js +19 -1
- package/dist/locale/source/vi_VN.js +19 -1
- package/dist/locale/source/zh_CN.js +19 -1
- package/dist/locale/source/zh_TW.js +19 -1
- package/dist/theme/global.scss +36 -36
- package/dist/utils/a11y.d.ts +11 -3
- package/dist/utils/a11y.js +25 -5
- package/dist/utils/announcer.d.ts +1 -1
- package/dist/utils/date-fns-extra.d.ts +3 -1
- package/dist/utils/date-fns-extra.js +8 -3
- package/dist/utils/dom.d.ts +0 -2
- package/dist/utils/dom.js +1 -4
- package/dist/utils/focus-handover.js +1 -1
- package/package.json +3 -4
- package/dist/anchor/constants.d.ts +0 -9
- package/dist/anchor/constants.js +0 -14
- package/dist/anchor/foundation.d.ts +0 -46
- package/dist/anchor/foundation.js +0 -142
- package/dist/anchor/utils.js +0 -16
- package/dist/anchor/variables.scss +0 -34
- package/dist/audio-player/audio-player.css +0 -226
- package/dist/audio-player/audio-player.scss +0 -278
- package/dist/audio-player/constants.js +0 -27
- package/dist/audio-player/foundation.d.ts +0 -43
- package/dist/audio-player/foundation.js +0 -115
- package/dist/audio-player/utils.js +0 -6
- package/dist/audio-player/variables.scss +0 -53
- package/dist/auto-complete/constants.js +0 -7
- package/dist/auto-complete/foundation.d.ts +0 -75
- package/dist/auto-complete/foundation.js +0 -218
- package/dist/avatar/constants.js +0 -13
- package/dist/avatar/foundation.d.ts +0 -28
- package/dist/avatar/foundation.js +0 -31
- package/dist/avatar/variables.scss +0 -112
- package/dist/backtop/constants.js +0 -35
- package/dist/backtop/foundation.d.ts +0 -23
- package/dist/backtop/foundation.js +0 -68
- package/dist/badge/constants.js +0 -4
- package/dist/banner/constants.js +0 -4
- package/dist/banner/foundation.d.ts +0 -9
- package/dist/banner/foundation.js +0 -9
- package/dist/breadcrumb/breadcrumb.scss +0 -116
- package/dist/breadcrumb/constants.js +0 -8
- package/dist/breadcrumb/foundation.d.ts +0 -37
- package/dist/breadcrumb/foundation.js +0 -60
- package/dist/breadcrumb/item-foundation.d.ts +0 -45
- package/dist/breadcrumb/item-foundation.js +0 -36
- package/dist/button/constants.js +0 -5
- package/dist/button/utils.d.ts +0 -27
- package/dist/button/utils.js +0 -89
- package/dist/button/variables.scss +0 -169
- package/dist/calendar/calendar.css +0 -486
- package/dist/calendar/calendar.scss +0 -518
- package/dist/calendar/constants.js +0 -14
- package/dist/calendar/event-util.js +0 -193
- package/dist/calendar/foundation.d.ts +0 -75
- package/dist/calendar/foundation.js +0 -194
- package/dist/calendar/month-foundation.d.ts +0 -10
- package/dist/calendar/month-foundation.js +0 -12
- package/dist/card/constants.js +0 -4
- package/dist/carousel/carousel.css +0 -345
- package/dist/carousel/carousel.scss +0 -451
- package/dist/carousel/constants.js +0 -42
- package/dist/carousel/foundation.d.ts +0 -59
- package/dist/carousel/foundation.js +0 -204
- package/dist/carousel/variables.scss +0 -49
- package/dist/cascader/cascader.scss +0 -586
- package/dist/cascader/constants.js +0 -20
- package/dist/cascader/foundation.d.ts +0 -304
- package/dist/cascader/foundation.js +0 -906
- package/dist/cascader/util.js +0 -148
- package/dist/checkbox/checkbox-foundation.d.ts +0 -93
- package/dist/checkbox/checkbox-foundation.js +0 -63
- package/dist/checkbox/checkbox-group-foundation.d.ts +0 -20
- package/dist/checkbox/checkbox-group-foundation.js +0 -28
- package/dist/checkbox/constants.js +0 -15
- package/dist/checkbox/variables.scss +0 -72
- package/dist/code-highlight/constants.js +0 -4
- package/dist/code-highlight/highlighter.js +0 -56
- package/dist/code-highlight/index.d.ts +0 -24
- package/dist/code-highlight/index.js +0 -19
- package/dist/code-highlight/registry.js +0 -33
- package/dist/collapse/collapse.scss +0 -112
- package/dist/collapse/constants.js +0 -4
- package/dist/collapse/foundation.d.ts +0 -47
- package/dist/collapse/foundation.js +0 -44
- package/dist/collapsible/constants.js +0 -4
- package/dist/collapsible/foundation.d.ts +0 -68
- package/dist/collapsible/foundation.js +0 -123
- package/dist/color-picker/alpha-slider-foundation.d.ts +0 -27
- package/dist/color-picker/alpha-slider-foundation.js +0 -41
- package/dist/color-picker/color-choose-area-foundation.d.ts +0 -33
- package/dist/color-picker/color-choose-area-foundation.js +0 -57
- package/dist/color-picker/color-picker.scss +0 -129
- package/dist/color-picker/color-slider-foundation.d.ts +0 -27
- package/dist/color-picker/color-slider-foundation.js +0 -41
- package/dist/color-picker/constants.js +0 -4
- package/dist/color-picker/data-part-foundation.d.ts +0 -28
- package/dist/color-picker/data-part-foundation.js +0 -76
- package/dist/color-picker/foundation.d.ts +0 -56
- package/dist/color-picker/foundation.js +0 -149
- package/dist/color-picker/utils/convert.d.ts +0 -16
- package/dist/color-picker/utils/convert.js +0 -150
- package/dist/color-picker/utils/round.js +0 -5
- package/dist/color-picker/utils/split.js +0 -26
- package/dist/config-provider/breakpoint-observer.js +0 -139
- package/dist/config-provider/inherit-config.d.ts +0 -24
- package/dist/config-provider/inherit-config.js +0 -24
- package/dist/cropper/constants.js +0 -37
- package/dist/cropper/cropper.scss +0 -129
- package/dist/cropper/foundation.d.ts +0 -90
- package/dist/cropper/foundation.js +0 -806
- package/dist/cropper/utils.js +0 -23
- package/dist/date-picker/_utils/formatter.js +0 -21
- package/dist/date-picker/_utils/get-day-of-week.js +0 -14
- package/dist/date-picker/_utils/get-default-format-token.js +0 -18
- package/dist/date-picker/_utils/get-default-picker-date.js +0 -35
- package/dist/date-picker/_utils/get-full-date-offset.js +0 -11
- package/dist/date-picker/_utils/get-inset-input-format-token.js +0 -33
- package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +0 -57
- package/dist/date-picker/_utils/get-month-table.js +0 -33
- package/dist/date-picker/_utils/get-year-and-month.js +0 -18
- package/dist/date-picker/_utils/get-year-month-from-value.js +0 -18
- package/dist/date-picker/_utils/get-years.js +0 -9
- package/dist/date-picker/_utils/index.d.ts +0 -11
- package/dist/date-picker/_utils/index.js +0 -11
- package/dist/date-picker/_utils/is-after.js +0 -7
- package/dist/date-picker/_utils/is-before.js +0 -7
- package/dist/date-picker/_utils/is-between.js +0 -11
- package/dist/date-picker/_utils/is-same-day.js +0 -7
- package/dist/date-picker/_utils/is-timestamp.js +0 -6
- package/dist/date-picker/_utils/is-valid-date.js +0 -5
- package/dist/date-picker/_utils/parser.js +0 -17
- package/dist/date-picker/_utils/picker-type.d.ts +0 -18
- package/dist/date-picker/_utils/picker-type.js +0 -28
- package/dist/date-picker/_utils/to-callback-args.js +0 -46
- package/dist/date-picker/_utils/to-date-arg.js +0 -13
- package/dist/date-picker/constants.js +0 -78
- package/dist/date-picker/date-picker.scss +0 -1762
- package/dist/date-picker/foundation.d.ts +0 -317
- package/dist/date-picker/foundation.js +0 -709
- package/dist/date-picker/input-foundation.d.ts +0 -138
- package/dist/date-picker/input-foundation.js +0 -212
- package/dist/date-picker/month-foundation.d.ts +0 -154
- package/dist/date-picker/month-foundation.js +0 -186
- package/dist/date-picker/months-grid-foundation.d.ts +0 -171
- package/dist/date-picker/months-grid-foundation.js +0 -547
- package/dist/date-picker/year-and-month-foundation.d.ts +0 -75
- package/dist/date-picker/year-and-month-foundation.js +0 -115
- package/dist/descriptions/constants.js +0 -4
- package/dist/descriptions/foundation.d.ts +0 -12
- package/dist/descriptions/foundation.js +0 -36
- package/dist/divider/constants.js +0 -4
- package/dist/drag-move/foundation.d.ts +0 -30
- package/dist/drag-move/foundation.js +0 -180
- package/dist/dropdown/constants.js +0 -12
- package/dist/dropdown/foundation.d.ts +0 -38
- package/dist/dropdown/foundation.js +0 -124
- package/dist/dropdown/menu-foundation.d.ts +0 -35
- package/dist/dropdown/menu-foundation.js +0 -82
- package/dist/empty/constants.js +0 -5
- package/dist/feedback/constants.js +0 -19
- package/dist/feedback/feedback.scss +0 -153
- package/dist/feedback/foundation.d.ts +0 -42
- package/dist/feedback/foundation.js +0 -72
- package/dist/float-button/constants.js +0 -13
- package/dist/float-button/float-button.scss +0 -201
- package/dist/form/constants.d.ts +0 -7
- package/dist/form/constants.js +0 -8
- package/dist/form/field-store.js +0 -28
- package/dist/form/form-api-proxy.d.ts +0 -14
- package/dist/form/form-api-proxy.js +0 -48
- package/dist/form/form.css +0 -229
- package/dist/form/form.scss +0 -295
- package/dist/form/foundation.d.ts +0 -65
- package/dist/form/foundation.js +0 -820
- package/dist/form/interface.d.ts +0 -158
- package/dist/form/rtl.scss +0 -13
- package/dist/form/utils.d.ts +0 -81
- package/dist/form/utils.js +0 -108
- package/dist/form/variables.scss +0 -50
- package/dist/grid/constants.js +0 -12
- package/dist/grid/gutter.js +0 -39
- package/dist/grid/utils.js +0 -39
- package/dist/highlight/constants.js +0 -4
- package/dist/highlight/foundation.js +0 -108
- package/dist/hot-keys/constants.js +0 -207
- package/dist/hot-keys/foundation.d.ts +0 -18
- package/dist/hot-keys/foundation.js +0 -92
- package/dist/image/constants.js +0 -5
- package/dist/image/image-foundation.d.ts +0 -28
- package/dist/image/image-foundation.js +0 -40
- package/dist/image/image.scss +0 -272
- package/dist/image/preview-footer-foundation.d.ts +0 -25
- package/dist/image/preview-footer-foundation.js +0 -30
- package/dist/image/preview-foundation.d.ts +0 -48
- package/dist/image/preview-foundation.js +0 -71
- package/dist/image/preview-image-foundation.d.ts +0 -67
- package/dist/image/preview-image-foundation.js +0 -226
- package/dist/image/preview-inner-foundation.d.ts +0 -86
- package/dist/image/preview-inner-foundation.js +0 -238
- package/dist/image/utils.js +0 -66
- package/dist/input/constants.d.ts +0 -9
- package/dist/input/constants.js +0 -14
- package/dist/input/foundation.d.ts +0 -50
- package/dist/input/foundation.js +0 -77
- package/dist/input/input.css +0 -616
- package/dist/input/input.scss +0 -738
- package/dist/input/text-entry-foundation.d.ts +0 -53
- package/dist/input/text-entry-foundation.js +0 -92
- package/dist/input/textarea-foundation.d.ts +0 -60
- package/dist/input/textarea-foundation.js +0 -130
- package/dist/input/textarea.css +0 -257
- package/dist/input/textarea.scss +0 -313
- package/dist/input/util/line-number.js +0 -42
- package/dist/input/util/truncate-value.js +0 -14
- package/dist/input/variables.scss +0 -107
- package/dist/input-number/caret.js +0 -20
- package/dist/input-number/constants.d.ts +0 -15
- package/dist/input-number/constants.js +0 -13
- package/dist/input-number/foundation.d.ts +0 -107
- package/dist/input-number/foundation.js +0 -553
- package/dist/json-viewer/constants.js +0 -4
- package/dist/json-viewer/foundation.d.ts +0 -40
- package/dist/json-viewer/foundation.js +0 -123
- package/dist/json-viewer/json-viewer.scss +0 -224
- package/dist/layout/constants.js +0 -4
- package/dist/list/constants.js +0 -4
- package/dist/list/list.scss +0 -162
- package/dist/lottie/constants.js +0 -4
- package/dist/lottie/foundation.d.ts +0 -24
- package/dist/lottie/foundation.js +0 -62
- package/dist/markdown-render/constants.js +0 -4
- package/dist/markdown-render/foundation.d.ts +0 -45
- package/dist/markdown-render/foundation.js +0 -97
- package/dist/modal/confirm.js +0 -34
- package/dist/modal/constants.js +0 -4
- package/dist/modal/modal-content-foundation.d.ts +0 -40
- package/dist/modal/modal-content-foundation.js +0 -48
- package/dist/modal/modal-foundation.d.ts +0 -85
- package/dist/modal/modal-foundation.js +0 -74
- package/dist/navigation/constants.js +0 -20
- package/dist/navigation/foundation.d.ts +0 -68
- package/dist/navigation/foundation.js +0 -152
- package/dist/navigation/item-foundation.d.ts +0 -44
- package/dist/navigation/item-foundation.js +0 -42
- package/dist/navigation/navigation.scss +0 -764
- package/dist/navigation/sub-nav-foundation.d.ts +0 -30
- package/dist/navigation/sub-nav-foundation.js +0 -54
- package/dist/navigation/variables.scss +0 -120
- package/dist/notification/constants.js +0 -32
- package/dist/notification/notification-foundation.d.ts +0 -33
- package/dist/notification/notification-foundation.js +0 -5
- package/dist/notification/notification-list-foundation.d.ts +0 -55
- package/dist/notification/notification-list-foundation.js +0 -48
- package/dist/overflow-list/constants.d.ts +0 -17
- package/dist/overflow-list/constants.js +0 -16
- package/dist/overflow-list/foundation.d.ts +0 -76
- package/dist/overflow-list/foundation.js +0 -188
- package/dist/pagination/constants.js +0 -14
- package/dist/pagination/foundation.d.ts +0 -59
- package/dist/pagination/foundation.js +0 -175
- package/dist/pagination/pagination.scss +0 -189
- package/dist/pincode/constants.js +0 -4
- package/dist/pincode/foundation.d.ts +0 -36
- package/dist/pincode/foundation.js +0 -83
- package/dist/popconfirm/constants.d.ts +0 -7
- package/dist/popconfirm/constants.js +0 -8
- package/dist/popconfirm/popconfirm-foundation.d.ts +0 -36
- package/dist/popconfirm/popconfirm-foundation.js +0 -57
- package/dist/popover/constants.js +0 -47
- package/dist/progress/constants.js +0 -8
- package/dist/progress/generates.js +0 -24
- package/dist/progress/utils.js +0 -45
- package/dist/radio/constants.js +0 -19
- package/dist/radio/radio-foundation.d.ts +0 -74
- package/dist/radio/radio-foundation.js +0 -93
- package/dist/radio/radio-group-foundation.d.ts +0 -17
- package/dist/radio/radio-group-foundation.js +0 -27
- package/dist/radio/variables.scss +0 -107
- package/dist/rating/constants.js +0 -5
- package/dist/rating/foundation.d.ts +0 -104
- package/dist/rating/foundation.js +0 -164
- package/dist/rating/variables.scss +0 -19
- package/dist/resizable/constants.js +0 -4
- package/dist/resizable/foundation.d.ts +0 -3
- package/dist/resizable/group/index.d.ts +0 -51
- package/dist/resizable/group/index.js +0 -309
- package/dist/resizable/resizable.scss +0 -146
- package/dist/resizable/single/index.d.ts +0 -86
- package/dist/resizable/single/index.js +0 -426
- package/dist/resizable/types.js +0 -18
- package/dist/resizable/utils.js +0 -53
- package/dist/scroll-list/constants.js +0 -11
- package/dist/scroll-list/item-foundation.d.ts +0 -54
- package/dist/scroll-list/item-foundation.js +0 -335
- package/dist/scroll-list/scroll-list.scss +0 -198
- package/dist/scroll-list/scroll-to.js +0 -15
- package/dist/select/combobox-name.js +0 -21
- package/dist/select/constants.js +0 -22
- package/dist/select/foundation.d.ts +0 -125
- package/dist/select/foundation.js +0 -710
- package/dist/select/option-foundation.js +0 -35
- package/dist/select/select.scss +0 -554
- package/dist/side-sheet/constants.js +0 -5
- package/dist/side-sheet/side-sheet-foundation.d.ts +0 -64
- package/dist/side-sheet/side-sheet-foundation.js +0 -50
- package/dist/skeleton/constants.js +0 -4
- package/dist/slider/constants.js +0 -12
- package/dist/slider/foundation.d.ts +0 -156
- package/dist/slider/foundation.js +0 -429
- package/dist/slider/variables.scss +0 -63
- package/dist/sortable/accessibility.d.ts +0 -14
- package/dist/sortable/accessibility.js +0 -45
- package/dist/space/constants.js +0 -9
- package/dist/spin/constants.js +0 -3
- package/dist/spin/foundation.d.ts +0 -18
- package/dist/spin/foundation.js +0 -42
- package/dist/spin/spin.scss +0 -111
- package/dist/steps/constants.js +0 -8
- package/dist/steps/steps.scss +0 -17
- package/dist/steps/utils.js +0 -15
- package/dist/switch/constants.js +0 -16
- package/dist/switch/foundation.d.ts +0 -23
- package/dist/switch/foundation.js +0 -19
- package/dist/switch/variables.scss +0 -71
- package/dist/table/constants.d.ts +0 -62
- package/dist/table/constants.js +0 -97
- package/dist/table/foundation.d.ts +0 -345
- package/dist/table/foundation.js +0 -906
- package/dist/table/table.css +0 -636
- package/dist/table/table.scss +0 -788
- package/dist/table/utils.d.ts +0 -179
- package/dist/table/utils.js +0 -469
- package/dist/table/variables.scss +0 -81
- package/dist/tabs/constants.d.ts +0 -28
- package/dist/tabs/constants.js +0 -37
- package/dist/tabs/foundation.d.ts +0 -82
- package/dist/tabs/foundation.js +0 -185
- package/dist/tabs/tabs.scss +0 -933
- package/dist/tabs/variables.scss +0 -155
- package/dist/tag/constants.js +0 -35
- package/dist/tag/focus.js +0 -22
- package/dist/tag/mixin.scss +0 -18
- package/dist/tag/tag-key.js +0 -18
- package/dist/tag/tag.css +0 -537
- package/dist/tag/variables.scss +0 -85
- package/dist/tag-input/constants.js +0 -9
- package/dist/tag-input/foundation.d.ts +0 -89
- package/dist/tag-input/foundation.js +0 -221
- package/dist/tag-input/tag-input.scss +0 -357
- package/dist/tag-input/utils/get-splited-array.js +0 -16
- package/dist/tag-input/utils/tag-focus.js +0 -14
- package/dist/time-picker/combox-foundation.d.ts +0 -71
- package/dist/time-picker/combox-foundation.js +0 -96
- package/dist/time-picker/constants.js +0 -23
- package/dist/time-picker/foundation.d.ts +0 -98
- package/dist/time-picker/foundation.js +0 -245
- package/dist/time-picker/input-foundation.d.ts +0 -15
- package/dist/time-picker/input-foundation.js +0 -33
- package/dist/time-picker/utils/index.js +0 -57
- package/dist/timeline/constants.js +0 -7
- package/dist/timeline/timeline.scss +0 -190
- package/dist/timeline/utils.js +0 -10
- package/dist/toast/constants.js +0 -34
- package/dist/toast/toast-foundation.d.ts +0 -37
- package/dist/toast/toast-foundation.js +0 -5
- package/dist/toast/toast-list-foundation.d.ts +0 -25
- package/dist/toast/toast-list-foundation.js +0 -54
- package/dist/tooltip/adjust-position.js +0 -202
- package/dist/tooltip/constants.d.ts +0 -47
- package/dist/tooltip/constants.js +0 -93
- package/dist/tooltip/foundation.d.ts +0 -102
- package/dist/tooltip/foundation.js +0 -654
- package/dist/tooltip/tooltip.scss +0 -72
- package/dist/transfer/constants.js +0 -10
- package/dist/transfer/foundation.d.ts +0 -121
- package/dist/transfer/foundation.js +0 -193
- package/dist/transfer/transfer-utils.js +0 -45
- package/dist/transfer/transfer.scss +0 -260
- package/dist/tree/constants.js +0 -8
- package/dist/tree/foundation.d.ts +0 -294
- package/dist/tree/foundation.js +0 -538
- package/dist/tree/shared.d.ts +0 -126
- package/dist/tree/shared.js +0 -306
- package/dist/tree/tree-util.d.ts +0 -100
- package/dist/tree/tree-util.js +0 -450
- package/dist/tree/tree.scss +0 -439
- package/dist/tree-select/constants.js +0 -19
- package/dist/tree-select/foundation.d.ts +0 -180
- package/dist/tree-select/foundation.js +0 -615
- package/dist/tree-select/tree-select.scss +0 -467
- package/dist/typography/constants.js +0 -50
- package/dist/typography/ellipsis.js +0 -154
- package/dist/typography/format-numeral.js +0 -99
- package/dist/typography/typography.scss +0 -383
- package/dist/upload/constants.d.ts +0 -24
- package/dist/upload/constants.js +0 -39
- package/dist/upload/foundation.d.ts +0 -181
- package/dist/upload/foundation.js +0 -752
- package/dist/upload/upload.scss +0 -640
- package/dist/upload/utils.d.ts +0 -20
- package/dist/upload/utils.js +0 -93
- package/dist/user-guide/constants.js +0 -12
- package/dist/user-guide/foundation.d.ts +0 -45
- package/dist/user-guide/foundation.js +0 -73
- package/dist/utils/focus-handle.d.ts +0 -43
- package/dist/utils/focus-handle.js +0 -91
- package/dist/utils/focus-scope.js +0 -77
- package/dist/utils/release-holder.js +0 -18
- package/dist/video-player/constants.js +0 -48
- package/dist/video-player/foundation.d.ts +0 -94
- package/dist/video-player/foundation.js +0 -287
- package/dist/video-player/progress-foundation.d.ts +0 -79
- package/dist/video-player/progress-foundation.js +0 -116
- package/dist/video-player/utils.js +0 -50
- package/dist/video-player/video-player.scss +0 -344
- /package/dist/{utils → base}/focus-scope.d.ts +0 -0
- /package/dist/{utils → base}/release-holder.d.ts +0 -0
- /package/dist/{anchor → components/anchor}/anchor.css +0 -0
- /package/dist/{anchor → components/anchor}/anchor.scss +0 -0
- /package/dist/{anchor → components/anchor}/animation.scss +0 -0
- /package/dist/{anchor → components/anchor}/rtl.scss +0 -0
- /package/dist/{anchor → components/anchor}/utils.d.ts +0 -0
- /package/dist/{audio-player → components/audio-player}/constants.d.ts +0 -0
- /package/dist/{audio-player → components/audio-player}/utils.d.ts +0 -0
- /package/dist/{auto-complete → components/auto-complete}/animation.scss +0 -0
- /package/dist/{auto-complete → components/auto-complete}/auto-complete.css +0 -0
- /package/dist/{auto-complete → components/auto-complete}/auto-complete.scss +0 -0
- /package/dist/{auto-complete → components/auto-complete}/constants.d.ts +0 -0
- /package/dist/{auto-complete → components/auto-complete}/option.scss +0 -0
- /package/dist/{auto-complete → components/auto-complete}/rtl.scss +0 -0
- /package/dist/{auto-complete → components/auto-complete}/variables.scss +0 -0
- /package/dist/{avatar → components/avatar}/animation.scss +0 -0
- /package/dist/{avatar → components/avatar}/avatar.css +0 -0
- /package/dist/{avatar → components/avatar}/avatar.scss +0 -0
- /package/dist/{avatar → components/avatar}/constants.d.ts +0 -0
- /package/dist/{avatar → components/avatar}/mixin.scss +0 -0
- /package/dist/{avatar → components/avatar}/rtl.scss +0 -0
- /package/dist/{backtop → components/backtop}/backtop.css +0 -0
- /package/dist/{backtop → components/backtop}/backtop.scss +0 -0
- /package/dist/{backtop → components/backtop}/constants.d.ts +0 -0
- /package/dist/{backtop → components/backtop}/rtl.scss +0 -0
- /package/dist/{backtop → components/backtop}/variables.scss +0 -0
- /package/dist/{badge → components/badge}/badge.css +0 -0
- /package/dist/{badge → components/badge}/badge.scss +0 -0
- /package/dist/{badge → components/badge}/constants.d.ts +0 -0
- /package/dist/{badge → components/badge}/rtl.scss +0 -0
- /package/dist/{badge → components/badge}/variables.scss +0 -0
- /package/dist/{banner → components/banner}/banner.css +0 -0
- /package/dist/{banner → components/banner}/banner.scss +0 -0
- /package/dist/{banner → components/banner}/constants.d.ts +0 -0
- /package/dist/{banner → components/banner}/rtl.scss +0 -0
- /package/dist/{banner → components/banner}/variables.scss +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/animation.scss +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/breadcrumb.css +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/constants.d.ts +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/rtl.scss +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/variables.scss +0 -0
- /package/dist/{button → components/button}/animation.scss +0 -0
- /package/dist/{button → components/button}/button.css +0 -0
- /package/dist/{button → components/button}/button.scss +0 -0
- /package/dist/{button → components/button}/constants.d.ts +0 -0
- /package/dist/{button → components/button}/icon-button.css +0 -0
- /package/dist/{button → components/button}/icon-button.scss +0 -0
- /package/dist/{button → components/button}/rtl.scss +0 -0
- /package/dist/{button → components/button}/split-button-group.scss +0 -0
- /package/dist/{calendar → components/calendar}/constants.d.ts +0 -0
- /package/dist/{calendar → components/calendar}/event-util.d.ts +0 -0
- /package/dist/{calendar → components/calendar}/rtl.scss +0 -0
- /package/dist/{calendar → components/calendar}/variables.scss +0 -0
- /package/dist/{card → components/card}/card.css +0 -0
- /package/dist/{card → components/card}/card.scss +0 -0
- /package/dist/{card → components/card}/constants.d.ts +0 -0
- /package/dist/{card → components/card}/rtl.scss +0 -0
- /package/dist/{card → components/card}/variables.scss +0 -0
- /package/dist/{carousel → components/carousel}/animation.scss +0 -0
- /package/dist/{carousel → components/carousel}/constants.d.ts +0 -0
- /package/dist/{carousel → components/carousel}/rtl.scss +0 -0
- /package/dist/{cascader → components/cascader}/animation.scss +0 -0
- /package/dist/{cascader → components/cascader}/cascader.css +0 -0
- /package/dist/{cascader → components/cascader}/constants.d.ts +0 -0
- /package/dist/{cascader → components/cascader}/rtl.scss +0 -0
- /package/dist/{cascader → components/cascader}/util.d.ts +0 -0
- /package/dist/{cascader → components/cascader}/variables.scss +0 -0
- /package/dist/{checkbox → components/checkbox}/animation.scss +0 -0
- /package/dist/{checkbox → components/checkbox}/checkbox.css +0 -0
- /package/dist/{checkbox → components/checkbox}/checkbox.scss +0 -0
- /package/dist/{checkbox → components/checkbox}/constants.d.ts +0 -0
- /package/dist/{checkbox → components/checkbox}/mixin.scss +0 -0
- /package/dist/{checkbox → components/checkbox}/rtl.scss +0 -0
- /package/dist/{code-highlight → components/code-highlight}/code-highlight.css +0 -0
- /package/dist/{code-highlight → components/code-highlight}/code-highlight.scss +0 -0
- /package/dist/{code-highlight → components/code-highlight}/constants.d.ts +0 -0
- /package/dist/{code-highlight → components/code-highlight}/highlighter.d.ts +0 -0
- /package/dist/{code-highlight → components/code-highlight}/registry.d.ts +0 -0
- /package/dist/{code-highlight → components/code-highlight}/variables.scss +0 -0
- /package/dist/{collapse → components/collapse}/collapse.css +0 -0
- /package/dist/{collapse → components/collapse}/constants.d.ts +0 -0
- /package/dist/{collapse → components/collapse}/rtl.scss +0 -0
- /package/dist/{collapse → components/collapse}/variables.scss +0 -0
- /package/dist/{collapsible → components/collapsible}/animation.scss +0 -0
- /package/dist/{collapsible → components/collapsible}/collapsible.css +0 -0
- /package/dist/{collapsible → components/collapsible}/collapsible.scss +0 -0
- /package/dist/{collapsible → components/collapsible}/constants.d.ts +0 -0
- /package/dist/{collapsible → components/collapsible}/variables.scss +0 -0
- /package/dist/{color-picker → components/color-picker}/color-picker.css +0 -0
- /package/dist/{color-picker → components/color-picker}/constants.d.ts +0 -0
- /package/dist/{color-picker → components/color-picker}/interface.d.ts +0 -0
- /package/dist/{color-picker → components/color-picker}/interface.js +0 -0
- /package/dist/{color-picker → components/color-picker}/utils/round.d.ts +0 -0
- /package/dist/{color-picker → components/color-picker}/utils/split.d.ts +0 -0
- /package/dist/{color-picker → components/color-picker}/variables.scss +0 -0
- /package/dist/{config-provider → components/config-provider}/breakpoint-observer.d.ts +0 -0
- /package/dist/{config-provider → components/config-provider}/responsive-types.d.ts +0 -0
- /package/dist/{config-provider → components/config-provider}/responsive-types.js +0 -0
- /package/dist/{cropper → components/cropper}/constants.d.ts +0 -0
- /package/dist/{cropper → components/cropper}/cropper.css +0 -0
- /package/dist/{cropper → components/cropper}/utils.d.ts +0 -0
- /package/dist/{cropper → components/cropper}/variables.scss +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/formatter.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-day-of-week.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-default-format-token.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-default-picker-date.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-full-date-offset.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-inset-input-format-token.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-inset-input-value-from-inset-input-str.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-month-table.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-year-and-month.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-year-month-from-value.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-years.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-after.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-before.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-between.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-same-day.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-timestamp.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-valid-date.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/parser.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/to-callback-args.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/to-date-arg.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/animation.scss +0 -0
- /package/dist/{date-picker → components/date-picker}/constants.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/date-picker.css +0 -0
- /package/dist/{date-picker → components/date-picker}/rtl.scss +0 -0
- /package/dist/{date-picker → components/date-picker}/variables.scss +0 -0
- /package/dist/{descriptions → components/descriptions}/constants.d.ts +0 -0
- /package/dist/{descriptions → components/descriptions}/descriptions.css +0 -0
- /package/dist/{descriptions → components/descriptions}/descriptions.scss +0 -0
- /package/dist/{descriptions → components/descriptions}/rtl.scss +0 -0
- /package/dist/{descriptions → components/descriptions}/variables.scss +0 -0
- /package/dist/{divider → components/divider}/constants.d.ts +0 -0
- /package/dist/{divider → components/divider}/divider.css +0 -0
- /package/dist/{divider → components/divider}/divider.scss +0 -0
- /package/dist/{divider → components/divider}/variables.scss +0 -0
- /package/dist/{dropdown → components/dropdown}/animation.scss +0 -0
- /package/dist/{dropdown → components/dropdown}/constants.d.ts +0 -0
- /package/dist/{dropdown → components/dropdown}/dropdown.css +0 -0
- /package/dist/{dropdown → components/dropdown}/dropdown.scss +0 -0
- /package/dist/{dropdown → components/dropdown}/rtl.scss +0 -0
- /package/dist/{dropdown → components/dropdown}/variables.scss +0 -0
- /package/dist/{empty → components/empty}/constants.d.ts +0 -0
- /package/dist/{empty → components/empty}/empty.css +0 -0
- /package/dist/{empty → components/empty}/empty.scss +0 -0
- /package/dist/{empty → components/empty}/rtl.scss +0 -0
- /package/dist/{empty → components/empty}/variables.scss +0 -0
- /package/dist/{feedback → components/feedback}/constants.d.ts +0 -0
- /package/dist/{feedback → components/feedback}/feedback.css +0 -0
- /package/dist/{feedback → components/feedback}/variables.scss +0 -0
- /package/dist/{float-button → components/float-button}/constants.d.ts +0 -0
- /package/dist/{float-button → components/float-button}/float-button.css +0 -0
- /package/dist/{float-button → components/float-button}/rtl.scss +0 -0
- /package/dist/{float-button → components/float-button}/variables.scss +0 -0
- /package/dist/{form → components/form}/field-store.d.ts +0 -0
- /package/dist/{form → components/form}/interface.js +0 -0
- /package/dist/{grid → components/grid}/constants.d.ts +0 -0
- /package/dist/{grid → components/grid}/grid.css +0 -0
- /package/dist/{grid → components/grid}/grid.scss +0 -0
- /package/dist/{grid → components/grid}/gutter.d.ts +0 -0
- /package/dist/{grid → components/grid}/mixin.scss +0 -0
- /package/dist/{grid → components/grid}/rtl.scss +0 -0
- /package/dist/{grid → components/grid}/utils.d.ts +0 -0
- /package/dist/{grid → components/grid}/variables.scss +0 -0
- /package/dist/{highlight → components/highlight}/constants.d.ts +0 -0
- /package/dist/{highlight → components/highlight}/foundation.d.ts +0 -0
- /package/dist/{highlight → components/highlight}/highlight.css +0 -0
- /package/dist/{highlight → components/highlight}/highlight.scss +0 -0
- /package/dist/{highlight → components/highlight}/variables.scss +0 -0
- /package/dist/{hot-keys → components/hot-keys}/constants.d.ts +0 -0
- /package/dist/{hot-keys → components/hot-keys}/hot-keys.css +0 -0
- /package/dist/{hot-keys → components/hot-keys}/hot-keys.scss +0 -0
- /package/dist/{hot-keys → components/hot-keys}/variables.scss +0 -0
- /package/dist/{image → components/image}/animation.scss +0 -0
- /package/dist/{image → components/image}/constants.d.ts +0 -0
- /package/dist/{image → components/image}/image.css +0 -0
- /package/dist/{image → components/image}/rtl.scss +0 -0
- /package/dist/{image → components/image}/utils.d.ts +0 -0
- /package/dist/{image → components/image}/variables.scss +0 -0
- /package/dist/{input → components/input}/animation.scss +0 -0
- /package/dist/{input → components/input}/rtl.scss +0 -0
- /package/dist/{input → components/input}/util/line-number.d.ts +0 -0
- /package/dist/{input → components/input}/util/truncate-value.d.ts +0 -0
- /package/dist/{input-number → components/input-number}/animation.scss +0 -0
- /package/dist/{input-number → components/input-number}/caret.d.ts +0 -0
- /package/dist/{input-number → components/input-number}/input-number.css +0 -0
- /package/dist/{input-number → components/input-number}/input-number.scss +0 -0
- /package/dist/{input-number → components/input-number}/rtl.scss +0 -0
- /package/dist/{input-number → components/input-number}/variables.scss +0 -0
- /package/dist/{json-viewer → components/json-viewer}/constants.d.ts +0 -0
- /package/dist/{json-viewer → components/json-viewer}/json-viewer.css +0 -0
- /package/dist/{json-viewer → components/json-viewer}/variables.scss +0 -0
- /package/dist/{layout → components/layout}/constants.d.ts +0 -0
- /package/dist/{layout → components/layout}/layout.css +0 -0
- /package/dist/{layout → components/layout}/layout.scss +0 -0
- /package/dist/{layout → components/layout}/rtl.scss +0 -0
- /package/dist/{list → components/list}/constants.d.ts +0 -0
- /package/dist/{list → components/list}/list.css +0 -0
- /package/dist/{list → components/list}/rtl.scss +0 -0
- /package/dist/{list → components/list}/variables.scss +0 -0
- /package/dist/{lottie → components/lottie}/constants.d.ts +0 -0
- /package/dist/{markdown-render → components/markdown-render}/constants.d.ts +0 -0
- /package/dist/{markdown-render → components/markdown-render}/markdown-render.css +0 -0
- /package/dist/{markdown-render → components/markdown-render}/markdown-render.scss +0 -0
- /package/dist/{markdown-render → components/markdown-render}/variables.scss +0 -0
- /package/dist/{modal → components/modal}/animation.scss +0 -0
- /package/dist/{modal → components/modal}/confirm.d.ts +0 -0
- /package/dist/{modal → components/modal}/constants.d.ts +0 -0
- /package/dist/{modal → components/modal}/modal.css +0 -0
- /package/dist/{modal → components/modal}/modal.scss +0 -0
- /package/dist/{modal → components/modal}/rtl.scss +0 -0
- /package/dist/{modal → components/modal}/variables.scss +0 -0
- /package/dist/{navigation → components/navigation}/animation.scss +0 -0
- /package/dist/{navigation → components/navigation}/constants.d.ts +0 -0
- /package/dist/{navigation → components/navigation}/mixin.scss +0 -0
- /package/dist/{navigation → components/navigation}/navigation.css +0 -0
- /package/dist/{navigation → components/navigation}/rtl.scss +0 -0
- /package/dist/{notification → components/notification}/animation.scss +0 -0
- /package/dist/{notification → components/notification}/constants.d.ts +0 -0
- /package/dist/{notification → components/notification}/notification.css +0 -0
- /package/dist/{notification → components/notification}/notification.scss +0 -0
- /package/dist/{notification → components/notification}/rtl.scss +0 -0
- /package/dist/{notification → components/notification}/variables.scss +0 -0
- /package/dist/{overflow-list → components/overflow-list}/overflow-list.css +0 -0
- /package/dist/{overflow-list → components/overflow-list}/overflow-list.scss +0 -0
- /package/dist/{overflow-list → components/overflow-list}/rtl.scss +0 -0
- /package/dist/{pagination → components/pagination}/animation.scss +0 -0
- /package/dist/{pagination → components/pagination}/constants.d.ts +0 -0
- /package/dist/{pagination → components/pagination}/pagination.css +0 -0
- /package/dist/{pagination → components/pagination}/rtl.scss +0 -0
- /package/dist/{pagination → components/pagination}/variables.scss +0 -0
- /package/dist/{pincode → components/pincode}/constants.d.ts +0 -0
- /package/dist/{pincode → components/pincode}/pincode.css +0 -0
- /package/dist/{pincode → components/pincode}/pincode.scss +0 -0
- /package/dist/{pincode → components/pincode}/variables.scss +0 -0
- /package/dist/{popconfirm → components/popconfirm}/popconfirm.css +0 -0
- /package/dist/{popconfirm → components/popconfirm}/popconfirm.scss +0 -0
- /package/dist/{popconfirm → components/popconfirm}/rtl.scss +0 -0
- /package/dist/{popconfirm → components/popconfirm}/variables.scss +0 -0
- /package/dist/{popover → components/popover}/animation.scss +0 -0
- /package/dist/{popover → components/popover}/constants.d.ts +0 -0
- /package/dist/{popover → components/popover}/popover.css +0 -0
- /package/dist/{popover → components/popover}/popover.scss +0 -0
- /package/dist/{popover → components/popover}/rtl.scss +0 -0
- /package/dist/{popover → components/popover}/variables.scss +0 -0
- /package/dist/{_portal → components/portal}/portal.css +0 -0
- /package/dist/{_portal → components/portal}/portal.scss +0 -0
- /package/dist/{progress → components/progress}/constants.d.ts +0 -0
- /package/dist/{progress → components/progress}/generates.d.ts +0 -0
- /package/dist/{progress → components/progress}/progress.css +0 -0
- /package/dist/{progress → components/progress}/progress.scss +0 -0
- /package/dist/{progress → components/progress}/rtl.scss +0 -0
- /package/dist/{progress → components/progress}/utils.d.ts +0 -0
- /package/dist/{progress → components/progress}/variables.scss +0 -0
- /package/dist/{radio → components/radio}/animation.scss +0 -0
- /package/dist/{radio → components/radio}/constants.d.ts +0 -0
- /package/dist/{radio → components/radio}/mixin.scss +0 -0
- /package/dist/{radio → components/radio}/radio.css +0 -0
- /package/dist/{radio → components/radio}/radio.scss +0 -0
- /package/dist/{radio → components/radio}/rtl.scss +0 -0
- /package/dist/{rating → components/rating}/animation.scss +0 -0
- /package/dist/{rating → components/rating}/constants.d.ts +0 -0
- /package/dist/{rating → components/rating}/rating.css +0 -0
- /package/dist/{rating → components/rating}/rating.scss +0 -0
- /package/dist/{rating → components/rating}/rtl.scss +0 -0
- /package/dist/{resizable → components/resizable}/constants.d.ts +0 -0
- /package/dist/{resizable → components/resizable}/foundation.js +0 -0
- /package/dist/{resizable → components/resizable}/resizable.css +0 -0
- /package/dist/{resizable → components/resizable}/types.d.ts +0 -0
- /package/dist/{resizable → components/resizable}/utils.d.ts +0 -0
- /package/dist/{resizable → components/resizable}/variables.scss +0 -0
- /package/dist/{scroll-list → components/scroll-list}/animation.scss +0 -0
- /package/dist/{scroll-list → components/scroll-list}/constants.d.ts +0 -0
- /package/dist/{scroll-list → components/scroll-list}/rtl.scss +0 -0
- /package/dist/{scroll-list → components/scroll-list}/scroll-list.css +0 -0
- /package/dist/{scroll-list → components/scroll-list}/scroll-to.d.ts +0 -0
- /package/dist/{scroll-list → components/scroll-list}/variables.scss +0 -0
- /package/dist/{select → components/select}/animation.scss +0 -0
- /package/dist/{select → components/select}/combobox-name.d.ts +0 -0
- /package/dist/{select → components/select}/constants.d.ts +0 -0
- /package/dist/{select → components/select}/mixin.scss +0 -0
- /package/dist/{select → components/select}/option-foundation.d.ts +0 -0
- /package/dist/{select → components/select}/option.scss +0 -0
- /package/dist/{select → components/select}/rtl.scss +0 -0
- /package/dist/{select → components/select}/select.css +0 -0
- /package/dist/{select → components/select}/variables.scss +0 -0
- /package/dist/{side-sheet → components/side-sheet}/animation.scss +0 -0
- /package/dist/{side-sheet → components/side-sheet}/constants.d.ts +0 -0
- /package/dist/{side-sheet → components/side-sheet}/rtl.scss +0 -0
- /package/dist/{side-sheet → components/side-sheet}/side-sheet.css +0 -0
- /package/dist/{side-sheet → components/side-sheet}/side-sheet.scss +0 -0
- /package/dist/{side-sheet → components/side-sheet}/variables.scss +0 -0
- /package/dist/{skeleton → components/skeleton}/animation.scss +0 -0
- /package/dist/{skeleton → components/skeleton}/constants.d.ts +0 -0
- /package/dist/{skeleton → components/skeleton}/rtl.scss +0 -0
- /package/dist/{skeleton → components/skeleton}/skeleton.css +0 -0
- /package/dist/{skeleton → components/skeleton}/skeleton.scss +0 -0
- /package/dist/{skeleton → components/skeleton}/variables.scss +0 -0
- /package/dist/{slider → components/slider}/animation.scss +0 -0
- /package/dist/{slider → components/slider}/constants.d.ts +0 -0
- /package/dist/{slider → components/slider}/rtl.scss +0 -0
- /package/dist/{slider → components/slider}/slider.css +0 -0
- /package/dist/{slider → components/slider}/slider.scss +0 -0
- /package/dist/{space → components/space}/constants.d.ts +0 -0
- /package/dist/{space → components/space}/rtl.scss +0 -0
- /package/dist/{space → components/space}/space.css +0 -0
- /package/dist/{space → components/space}/space.scss +0 -0
- /package/dist/{space → components/space}/variables.scss +0 -0
- /package/dist/{spin → components/spin}/animation.scss +0 -0
- /package/dist/{spin → components/spin}/constants.d.ts +0 -0
- /package/dist/{spin → components/spin}/mixin.scss +0 -0
- /package/dist/{spin → components/spin}/rtl.scss +0 -0
- /package/dist/{spin → components/spin}/spin.css +0 -0
- /package/dist/{spin → components/spin}/variables.scss +0 -0
- /package/dist/{steps → components/steps}/animation.scss +0 -0
- /package/dist/{steps → components/steps}/bacis-steps.scss +0 -0
- /package/dist/{steps → components/steps}/constants.d.ts +0 -0
- /package/dist/{steps → components/steps}/fill-steps.scss +0 -0
- /package/dist/{steps → components/steps}/mixin.scss +0 -0
- /package/dist/{steps → components/steps}/nav-steps.scss +0 -0
- /package/dist/{steps → components/steps}/rtl.scss +0 -0
- /package/dist/{steps → components/steps}/steps.css +0 -0
- /package/dist/{steps → components/steps}/utils.d.ts +0 -0
- /package/dist/{steps → components/steps}/variables.scss +0 -0
- /package/dist/{switch → components/switch}/animation.scss +0 -0
- /package/dist/{switch → components/switch}/constants.d.ts +0 -0
- /package/dist/{switch → components/switch}/rtl.scss +0 -0
- /package/dist/{switch → components/switch}/switch.css +0 -0
- /package/dist/{switch → components/switch}/switch.scss +0 -0
- /package/dist/{table → components/table}/animation.scss +0 -0
- /package/dist/{table → components/table}/mixin.scss +0 -0
- /package/dist/{table → components/table}/operation-panel.scss +0 -0
- /package/dist/{table → components/table}/rtl.scss +0 -0
- /package/dist/{tabs → components/tabs}/animation.scss +0 -0
- /package/dist/{tabs → components/tabs}/rtl.scss +0 -0
- /package/dist/{tabs → components/tabs}/tabs.css +0 -0
- /package/dist/{tag → components/tag}/constants.d.ts +0 -0
- /package/dist/{tag → components/tag}/focus.d.ts +0 -0
- /package/dist/{tag → components/tag}/rtl.scss +0 -0
- /package/dist/{tag → components/tag}/tag-key.d.ts +0 -0
- /package/dist/{tag → components/tag}/tag.scss +0 -0
- /package/dist/{tag-input → components/tag-input}/animation.scss +0 -0
- /package/dist/{tag-input → components/tag-input}/constants.d.ts +0 -0
- /package/dist/{tag-input → components/tag-input}/rtl.scss +0 -0
- /package/dist/{tag-input → components/tag-input}/tag-input.css +0 -0
- /package/dist/{tag-input → components/tag-input}/utils/get-splited-array.d.ts +0 -0
- /package/dist/{tag-input → components/tag-input}/utils/tag-focus.d.ts +0 -0
- /package/dist/{tag-input → components/tag-input}/variables.scss +0 -0
- /package/dist/{time-picker → components/time-picker}/constants.d.ts +0 -0
- /package/dist/{time-picker → components/time-picker}/rtl.scss +0 -0
- /package/dist/{time-picker → components/time-picker}/time-picker.css +0 -0
- /package/dist/{time-picker → components/time-picker}/time-picker.scss +0 -0
- /package/dist/{time-picker → components/time-picker}/utils/index.d.ts +0 -0
- /package/dist/{time-picker → components/time-picker}/variables.scss +0 -0
- /package/dist/{timeline → components/timeline}/constants.d.ts +0 -0
- /package/dist/{timeline → components/timeline}/rtl.scss +0 -0
- /package/dist/{timeline → components/timeline}/timeline.css +0 -0
- /package/dist/{timeline → components/timeline}/utils.d.ts +0 -0
- /package/dist/{timeline → components/timeline}/variables.scss +0 -0
- /package/dist/{toast → components/toast}/animation.scss +0 -0
- /package/dist/{toast → components/toast}/constants.d.ts +0 -0
- /package/dist/{toast → components/toast}/rtl.scss +0 -0
- /package/dist/{toast → components/toast}/toast.css +0 -0
- /package/dist/{toast → components/toast}/toast.scss +0 -0
- /package/dist/{toast → components/toast}/variables.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/adjust-position.d.ts +0 -0
- /package/dist/{tooltip → components/tooltip}/animation.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/arrow.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/position.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/rtl.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/tooltip.css +0 -0
- /package/dist/{tooltip → components/tooltip}/variables.scss +0 -0
- /package/dist/{transfer → components/transfer}/animation.scss +0 -0
- /package/dist/{transfer → components/transfer}/constants.d.ts +0 -0
- /package/dist/{transfer → components/transfer}/rtl.scss +0 -0
- /package/dist/{transfer → components/transfer}/transfer-utils.d.ts +0 -0
- /package/dist/{transfer → components/transfer}/transfer.css +0 -0
- /package/dist/{transfer → components/transfer}/variables.scss +0 -0
- /package/dist/{tree → components/tree}/animation.scss +0 -0
- /package/dist/{tree → components/tree}/constants.d.ts +0 -0
- /package/dist/{tree → components/tree}/rtl.scss +0 -0
- /package/dist/{tree → components/tree}/tree.css +0 -0
- /package/dist/{tree → components/tree}/variables.scss +0 -0
- /package/dist/{tree-select → components/tree-select}/constants.d.ts +0 -0
- /package/dist/{tree-select → components/tree-select}/rtl.scss +0 -0
- /package/dist/{tree-select → components/tree-select}/tree-select.css +0 -0
- /package/dist/{tree-select → components/tree-select}/variables.scss +0 -0
- /package/dist/{typography → components/typography}/constants.d.ts +0 -0
- /package/dist/{typography → components/typography}/ellipsis.d.ts +0 -0
- /package/dist/{typography → components/typography}/format-numeral.d.ts +0 -0
- /package/dist/{typography → components/typography}/rtl.scss +0 -0
- /package/dist/{typography → components/typography}/typography.css +0 -0
- /package/dist/{typography → components/typography}/variables.scss +0 -0
- /package/dist/{upload → components/upload}/rtl.scss +0 -0
- /package/dist/{upload → components/upload}/upload.css +0 -0
- /package/dist/{upload → components/upload}/variables.scss +0 -0
- /package/dist/{user-guide → components/user-guide}/animation.scss +0 -0
- /package/dist/{user-guide → components/user-guide}/constants.d.ts +0 -0
- /package/dist/{user-guide → components/user-guide}/user-guide.css +0 -0
- /package/dist/{user-guide → components/user-guide}/user-guide.scss +0 -0
- /package/dist/{user-guide → components/user-guide}/variables.scss +0 -0
- /package/dist/{video-player → components/video-player}/animation.scss +0 -0
- /package/dist/{video-player → components/video-player}/constants.d.ts +0 -0
- /package/dist/{video-player → components/video-player}/utils.d.ts +0 -0
- /package/dist/{video-player → components/video-player}/variables.scss +0 -0
- /package/dist/{video-player → components/video-player}/video-player.css +0 -0
|
@@ -0,0 +1,851 @@
|
|
|
1
|
+
import BaseFoundation from "../../base/foundation.js";
|
|
2
|
+
import { isSecondaryPress } from "../../utils/pointer.js";
|
|
3
|
+
import "./constants.js";
|
|
4
|
+
import { fitAspect, getCropperGeometry } from "./utils.js";
|
|
5
|
+
import { clamp } from "es-toolkit";
|
|
6
|
+
// src/components/cropper/foundation.ts
|
|
7
|
+
var CropperFoundation = class extends BaseFoundation {
|
|
8
|
+
#imgData = {};
|
|
9
|
+
#containerData = {};
|
|
10
|
+
#resizeDir = "";
|
|
11
|
+
#cropperBoxMoveStart = null;
|
|
12
|
+
#imgMoveStart = null;
|
|
13
|
+
#moveRange;
|
|
14
|
+
#resizeVector = {
|
|
15
|
+
paramX: 0,
|
|
16
|
+
paramY: 0
|
|
17
|
+
};
|
|
18
|
+
#rangeX = null;
|
|
19
|
+
#rangeY = null;
|
|
20
|
+
#previewImg = null;
|
|
21
|
+
#previewContainer = null;
|
|
22
|
+
#previewContainerInitSize;
|
|
23
|
+
#previewOriginalStyle;
|
|
24
|
+
static propKeys = [
|
|
25
|
+
"aspectRatio",
|
|
26
|
+
"zoom",
|
|
27
|
+
"rotate"
|
|
28
|
+
];
|
|
29
|
+
#getImgDataWhenResize(ratio) {
|
|
30
|
+
const { imgData } = this.getStates();
|
|
31
|
+
const newImgData = {
|
|
32
|
+
width: imgData.width * ratio,
|
|
33
|
+
height: imgData.height * ratio,
|
|
34
|
+
centerPoint: {
|
|
35
|
+
x: imgData.centerPoint.x * ratio,
|
|
36
|
+
y: imgData.centerPoint.y * ratio
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
this.#imgData.scale *= ratio;
|
|
40
|
+
return newImgData;
|
|
41
|
+
}
|
|
42
|
+
#getCropperBoxWhenResize(ratio, newContainerData) {
|
|
43
|
+
const { cropperBox } = this.getStates();
|
|
44
|
+
const { aspectRatio } = this.getProps();
|
|
45
|
+
const tempCropperBox = {
|
|
46
|
+
width: cropperBox.width * ratio,
|
|
47
|
+
height: cropperBox.height * ratio,
|
|
48
|
+
centerPoint: {
|
|
49
|
+
x: cropperBox.centerPoint.x * ratio,
|
|
50
|
+
y: cropperBox.centerPoint.y * ratio
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
let xMin = tempCropperBox.centerPoint.x - tempCropperBox.width / 2;
|
|
54
|
+
let xMax = tempCropperBox.centerPoint.x + tempCropperBox.width / 2;
|
|
55
|
+
let yMin = tempCropperBox.centerPoint.y - tempCropperBox.height / 2;
|
|
56
|
+
let yMax = tempCropperBox.centerPoint.y + tempCropperBox.height / 2;
|
|
57
|
+
if (aspectRatio) {
|
|
58
|
+
if (xMax > newContainerData.width) {
|
|
59
|
+
xMax = newContainerData.width;
|
|
60
|
+
xMin = tempCropperBox.width > newContainerData.width ? 0 : newContainerData.width - tempCropperBox.width;
|
|
61
|
+
tempCropperBox.width = xMax - xMin;
|
|
62
|
+
tempCropperBox.height = tempCropperBox.width / aspectRatio;
|
|
63
|
+
yMax = yMin + tempCropperBox.height;
|
|
64
|
+
}
|
|
65
|
+
if (yMax > newContainerData.height) {
|
|
66
|
+
yMax = newContainerData.height;
|
|
67
|
+
yMin = tempCropperBox.height > newContainerData.height ? 0 : newContainerData.height - tempCropperBox.height;
|
|
68
|
+
tempCropperBox.height = yMax - yMin;
|
|
69
|
+
tempCropperBox.width = tempCropperBox.height * aspectRatio;
|
|
70
|
+
xMax = xMin + tempCropperBox.width;
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
if (xMax > newContainerData.width) {
|
|
74
|
+
xMax = newContainerData.width;
|
|
75
|
+
xMin = tempCropperBox.width > newContainerData.width ? 0 : newContainerData.width - tempCropperBox.width;
|
|
76
|
+
}
|
|
77
|
+
if (yMax > newContainerData.height) {
|
|
78
|
+
yMax = newContainerData.height;
|
|
79
|
+
yMin = tempCropperBox.height > newContainerData.height ? 0 : newContainerData.height - tempCropperBox.height;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
width: xMax - xMin,
|
|
84
|
+
height: yMax - yMin,
|
|
85
|
+
centerPoint: {
|
|
86
|
+
x: (xMax + xMin) / 2,
|
|
87
|
+
y: (yMax + yMin) / 2
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
#layoutImage() {
|
|
92
|
+
const { originalWidth: naturalWidth, originalHeight: naturalHeight } = this.#imgData;
|
|
93
|
+
const { width: containerWidth, height: containerHeight } = this.#containerData;
|
|
94
|
+
let scale = 1;
|
|
95
|
+
let imgWidth;
|
|
96
|
+
let imgHeight;
|
|
97
|
+
if (naturalWidth / containerWidth > naturalHeight / containerHeight) {
|
|
98
|
+
scale = containerWidth / naturalWidth;
|
|
99
|
+
imgWidth = containerWidth;
|
|
100
|
+
imgHeight = naturalHeight * scale;
|
|
101
|
+
} else {
|
|
102
|
+
scale = containerHeight / naturalHeight;
|
|
103
|
+
imgWidth = naturalWidth * scale;
|
|
104
|
+
imgHeight = containerHeight;
|
|
105
|
+
}
|
|
106
|
+
this.#imgData.scale = scale;
|
|
107
|
+
const { zoom } = this.getStates();
|
|
108
|
+
const newImgDataState = {
|
|
109
|
+
width: imgWidth * zoom,
|
|
110
|
+
height: imgHeight * zoom,
|
|
111
|
+
centerPoint: {
|
|
112
|
+
x: containerWidth / 2,
|
|
113
|
+
y: containerHeight / 2
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const { defaultAspectRatio, aspectRatio } = this.getProps();
|
|
117
|
+
const calcAspect = aspectRatio || defaultAspectRatio;
|
|
118
|
+
const newCropperBoxState = containerWidth / containerHeight > calcAspect ? {
|
|
119
|
+
width: containerHeight * calcAspect,
|
|
120
|
+
height: containerHeight,
|
|
121
|
+
centerPoint: {
|
|
122
|
+
x: containerWidth / 2,
|
|
123
|
+
y: containerHeight / 2
|
|
124
|
+
}
|
|
125
|
+
} : {
|
|
126
|
+
width: containerWidth,
|
|
127
|
+
height: containerWidth / calcAspect,
|
|
128
|
+
centerPoint: {
|
|
129
|
+
x: containerWidth / 2,
|
|
130
|
+
y: containerHeight / 2
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
this.setState({
|
|
134
|
+
imgData: newImgDataState,
|
|
135
|
+
cropperBox: newCropperBoxState,
|
|
136
|
+
loaded: true
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
#renderPreview() {
|
|
140
|
+
this.#removePreview();
|
|
141
|
+
const { preview, src } = this.getProps();
|
|
142
|
+
const previewNode = preview?.();
|
|
143
|
+
if (!previewNode) return;
|
|
144
|
+
const img = document.createElement("img");
|
|
145
|
+
this.#previewImg = img;
|
|
146
|
+
this.#previewContainer = previewNode;
|
|
147
|
+
const { overflow, width, height } = previewNode.style;
|
|
148
|
+
this.#previewOriginalStyle = {
|
|
149
|
+
overflow,
|
|
150
|
+
width,
|
|
151
|
+
height
|
|
152
|
+
};
|
|
153
|
+
img.src = src;
|
|
154
|
+
img.alt = "";
|
|
155
|
+
previewNode.appendChild(img);
|
|
156
|
+
previewNode.style.overflow = "hidden";
|
|
157
|
+
const { width: previewWidth, height: previewHeight } = previewNode.getBoundingClientRect();
|
|
158
|
+
this.#previewContainerInitSize = {
|
|
159
|
+
width: previewWidth,
|
|
160
|
+
height: previewHeight
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
#removePreview() {
|
|
164
|
+
if (this.#previewImg && this.#previewContainer) {
|
|
165
|
+
this.#previewImg.remove();
|
|
166
|
+
Object.assign(this.#previewContainer.style, this.#previewOriginalStyle);
|
|
167
|
+
}
|
|
168
|
+
this.#previewImg = null;
|
|
169
|
+
this.#previewContainer = null;
|
|
170
|
+
}
|
|
171
|
+
#getResizeVector(dir) {
|
|
172
|
+
let paramX = 0, paramY = 0;
|
|
173
|
+
switch (dir) {
|
|
174
|
+
case "tl":
|
|
175
|
+
paramX = -1;
|
|
176
|
+
paramY = -1;
|
|
177
|
+
break;
|
|
178
|
+
case "tm":
|
|
179
|
+
paramY = -1;
|
|
180
|
+
break;
|
|
181
|
+
case "tr":
|
|
182
|
+
paramX = 1;
|
|
183
|
+
paramY = -1;
|
|
184
|
+
break;
|
|
185
|
+
case "ml":
|
|
186
|
+
paramX = -1;
|
|
187
|
+
break;
|
|
188
|
+
case "mr":
|
|
189
|
+
paramX = 1;
|
|
190
|
+
break;
|
|
191
|
+
case "bl":
|
|
192
|
+
paramX = -1;
|
|
193
|
+
paramY = 1;
|
|
194
|
+
break;
|
|
195
|
+
case "bm":
|
|
196
|
+
paramY = 1;
|
|
197
|
+
break;
|
|
198
|
+
case "br":
|
|
199
|
+
paramX = 1;
|
|
200
|
+
paramY = 1;
|
|
201
|
+
}
|
|
202
|
+
return {
|
|
203
|
+
paramX,
|
|
204
|
+
paramY
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
#computeAspectResizeRange() {
|
|
208
|
+
const { cropperBox } = this.getStates();
|
|
209
|
+
const { aspectRatio } = this.getProps();
|
|
210
|
+
const { width: containerWidth, height: containerHeight } = this.#containerData;
|
|
211
|
+
let height, width;
|
|
212
|
+
const xMin = cropperBox.centerPoint.x - cropperBox.width / 2;
|
|
213
|
+
const xMax = cropperBox.centerPoint.x + cropperBox.width / 2;
|
|
214
|
+
const yMin = cropperBox.centerPoint.y - cropperBox.height / 2;
|
|
215
|
+
const yMax = cropperBox.centerPoint.y + cropperBox.height / 2;
|
|
216
|
+
switch (this.#resizeDir) {
|
|
217
|
+
case "tl":
|
|
218
|
+
height = yMax;
|
|
219
|
+
width = xMax;
|
|
220
|
+
[width, height] = fitAspect(width, height, aspectRatio);
|
|
221
|
+
this.#rangeX = [xMax - width, xMax];
|
|
222
|
+
this.#rangeY = [yMax - height, yMax];
|
|
223
|
+
break;
|
|
224
|
+
case "tm":
|
|
225
|
+
height = yMax;
|
|
226
|
+
const leftHalfWidth = cropperBox.centerPoint.x;
|
|
227
|
+
const rightHalfWidth = containerWidth - cropperBox.centerPoint.x;
|
|
228
|
+
width = 2 * (leftHalfWidth < rightHalfWidth ? leftHalfWidth : rightHalfWidth);
|
|
229
|
+
[width, height] = fitAspect(width, height, aspectRatio);
|
|
230
|
+
this.#rangeX = [cropperBox.centerPoint.x - width / 2, cropperBox.centerPoint.x + width / 2];
|
|
231
|
+
this.#rangeY = [yMax - height, yMax];
|
|
232
|
+
break;
|
|
233
|
+
case "tr":
|
|
234
|
+
height = yMax;
|
|
235
|
+
width = containerWidth - xMin;
|
|
236
|
+
[width, height] = fitAspect(width, height, aspectRatio);
|
|
237
|
+
this.#rangeX = [xMin, xMin + width];
|
|
238
|
+
this.#rangeY = [yMax - height, yMax];
|
|
239
|
+
break;
|
|
240
|
+
case "ml":
|
|
241
|
+
width = xMax;
|
|
242
|
+
const topHalfHeight = cropperBox.centerPoint.y;
|
|
243
|
+
const bottomHalfHeight = containerHeight - cropperBox.centerPoint.y;
|
|
244
|
+
height = 2 * (topHalfHeight < bottomHalfHeight ? topHalfHeight : bottomHalfHeight);
|
|
245
|
+
[width, height] = fitAspect(width, height, aspectRatio);
|
|
246
|
+
this.#rangeX = [xMax - width, xMax];
|
|
247
|
+
this.#rangeY = [cropperBox.centerPoint.y - height / 2, cropperBox.centerPoint.y + height / 2];
|
|
248
|
+
break;
|
|
249
|
+
case "mr":
|
|
250
|
+
width = containerWidth - xMin;
|
|
251
|
+
const topHalfHeight2 = cropperBox.centerPoint.y;
|
|
252
|
+
const bottomHalfHeight2 = containerHeight - cropperBox.centerPoint.y;
|
|
253
|
+
height = 2 * (topHalfHeight2 < bottomHalfHeight2 ? topHalfHeight2 : bottomHalfHeight2);
|
|
254
|
+
[width, height] = fitAspect(width, height, aspectRatio);
|
|
255
|
+
this.#rangeX = [xMin, xMin + width];
|
|
256
|
+
this.#rangeY = [cropperBox.centerPoint.y - height / 2, cropperBox.centerPoint.y + height / 2];
|
|
257
|
+
break;
|
|
258
|
+
case "bl":
|
|
259
|
+
height = containerHeight - yMin;
|
|
260
|
+
width = xMax;
|
|
261
|
+
[width, height] = fitAspect(width, height, aspectRatio);
|
|
262
|
+
this.#rangeX = [xMax - width, xMax];
|
|
263
|
+
this.#rangeY = [yMin, yMin + height];
|
|
264
|
+
break;
|
|
265
|
+
case "bm":
|
|
266
|
+
height = containerHeight - yMin;
|
|
267
|
+
const leftHalfWidth2 = cropperBox.centerPoint.x;
|
|
268
|
+
const rightHalfWidth2 = containerWidth - cropperBox.centerPoint.x;
|
|
269
|
+
width = 2 * (leftHalfWidth2 < rightHalfWidth2 ? leftHalfWidth2 : rightHalfWidth2);
|
|
270
|
+
[width, height] = fitAspect(width, height, aspectRatio);
|
|
271
|
+
this.#rangeX = [cropperBox.centerPoint.x - width / 2, cropperBox.centerPoint.x + width / 2];
|
|
272
|
+
this.#rangeY = [yMin, yMin + height];
|
|
273
|
+
break;
|
|
274
|
+
case "br":
|
|
275
|
+
height = containerHeight - yMin;
|
|
276
|
+
width = containerWidth - xMin;
|
|
277
|
+
[width, height] = fitAspect(width, height, aspectRatio);
|
|
278
|
+
this.#rangeX = [xMin, xMin + width];
|
|
279
|
+
this.#rangeY = [yMin, yMin + height];
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
#readContainerSize() {
|
|
283
|
+
const container = this.adapter.getContainer();
|
|
284
|
+
return {
|
|
285
|
+
width: container.clientWidth,
|
|
286
|
+
height: container.clientHeight
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
#toContainerPoint(clientX, clientY) {
|
|
290
|
+
const container = this.adapter.getContainer();
|
|
291
|
+
const rect = container.getBoundingClientRect();
|
|
292
|
+
return {
|
|
293
|
+
x: clientX - rect.left - container.clientLeft,
|
|
294
|
+
y: clientY - rect.top - container.clientTop
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
/** `point` is in container coordinates */
|
|
298
|
+
#resizeCornerWithAspect = (point) => {
|
|
299
|
+
const { cropperBox } = this.getStates();
|
|
300
|
+
const { aspectRatio } = this.getProps();
|
|
301
|
+
const newCropperBoxPos = {
|
|
302
|
+
width: cropperBox.width,
|
|
303
|
+
height: cropperBox.height,
|
|
304
|
+
centerPoint: { ...cropperBox.centerPoint }
|
|
305
|
+
};
|
|
306
|
+
let offsetX, offsetY;
|
|
307
|
+
if (["ml", "mr"].includes(this.#resizeDir)) offsetX = clamp(point.x, ...this.#rangeX);
|
|
308
|
+
else offsetY = clamp(point.y, ...this.#rangeY);
|
|
309
|
+
const minHeight = Math.max(10, 10 / aspectRatio);
|
|
310
|
+
let collapsed = false;
|
|
311
|
+
const driveHeight = (height) => {
|
|
312
|
+
collapsed = height === 0;
|
|
313
|
+
newCropperBoxPos.height = Math.max(height, minHeight);
|
|
314
|
+
newCropperBoxPos.width = newCropperBoxPos.height * aspectRatio;
|
|
315
|
+
};
|
|
316
|
+
const driveWidth = (width) => {
|
|
317
|
+
collapsed = width === 0;
|
|
318
|
+
newCropperBoxPos.height = Math.max(width / aspectRatio, minHeight);
|
|
319
|
+
newCropperBoxPos.width = newCropperBoxPos.height * aspectRatio;
|
|
320
|
+
};
|
|
321
|
+
switch (this.#resizeDir) {
|
|
322
|
+
case "tl":
|
|
323
|
+
driveHeight(this.#rangeY[1] - offsetY);
|
|
324
|
+
newCropperBoxPos.centerPoint = {
|
|
325
|
+
x: this.#rangeX[1] - newCropperBoxPos.width / 2,
|
|
326
|
+
y: this.#rangeY[1] - newCropperBoxPos.height / 2
|
|
327
|
+
};
|
|
328
|
+
break;
|
|
329
|
+
case "tm":
|
|
330
|
+
driveHeight(this.#rangeY[1] - offsetY);
|
|
331
|
+
newCropperBoxPos.centerPoint = {
|
|
332
|
+
x: cropperBox.centerPoint.x,
|
|
333
|
+
y: this.#rangeY[1] - newCropperBoxPos.height / 2
|
|
334
|
+
};
|
|
335
|
+
break;
|
|
336
|
+
case "tr":
|
|
337
|
+
driveHeight(this.#rangeY[1] - offsetY);
|
|
338
|
+
newCropperBoxPos.centerPoint = {
|
|
339
|
+
x: this.#rangeX[0] + newCropperBoxPos.width / 2,
|
|
340
|
+
y: this.#rangeY[1] - newCropperBoxPos.height / 2
|
|
341
|
+
};
|
|
342
|
+
break;
|
|
343
|
+
case "ml":
|
|
344
|
+
driveWidth(this.#rangeX[1] - offsetX);
|
|
345
|
+
newCropperBoxPos.centerPoint = {
|
|
346
|
+
x: this.#rangeX[1] - newCropperBoxPos.width / 2,
|
|
347
|
+
y: cropperBox.centerPoint.y
|
|
348
|
+
};
|
|
349
|
+
break;
|
|
350
|
+
case "mr":
|
|
351
|
+
driveWidth(offsetX - this.#rangeX[0]);
|
|
352
|
+
newCropperBoxPos.centerPoint = {
|
|
353
|
+
x: this.#rangeX[0] + newCropperBoxPos.width / 2,
|
|
354
|
+
y: cropperBox.centerPoint.y
|
|
355
|
+
};
|
|
356
|
+
break;
|
|
357
|
+
case "bl":
|
|
358
|
+
driveHeight(offsetY - this.#rangeY[0]);
|
|
359
|
+
newCropperBoxPos.centerPoint = {
|
|
360
|
+
x: this.#rangeX[1] - newCropperBoxPos.width / 2,
|
|
361
|
+
y: this.#rangeY[0] + newCropperBoxPos.height / 2
|
|
362
|
+
};
|
|
363
|
+
break;
|
|
364
|
+
case "bm":
|
|
365
|
+
driveHeight(offsetY - this.#rangeY[0]);
|
|
366
|
+
newCropperBoxPos.centerPoint = {
|
|
367
|
+
x: cropperBox.centerPoint.x,
|
|
368
|
+
y: this.#rangeY[0] + newCropperBoxPos.height / 2
|
|
369
|
+
};
|
|
370
|
+
break;
|
|
371
|
+
case "br":
|
|
372
|
+
driveHeight(offsetY - this.#rangeY[0]);
|
|
373
|
+
newCropperBoxPos.centerPoint = {
|
|
374
|
+
x: this.#rangeX[0] + newCropperBoxPos.width / 2,
|
|
375
|
+
y: this.#rangeY[0] + newCropperBoxPos.height / 2
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
this.setState({ cropperBox: newCropperBoxPos });
|
|
379
|
+
if (collapsed) {
|
|
380
|
+
this.#changeDir();
|
|
381
|
+
this.#computeAspectResizeRange();
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
#changeDir() {
|
|
385
|
+
let dir = this.#resizeDir;
|
|
386
|
+
if (dir.includes("t")) dir = dir.replace("t", "b");
|
|
387
|
+
else if (dir.includes("b")) dir = dir.replace("b", "t");
|
|
388
|
+
if (dir.includes("l")) dir = dir.replace("l", "r");
|
|
389
|
+
else if (dir.includes("r")) dir = dir.replace("r", "l");
|
|
390
|
+
this.#resizeDir = dir;
|
|
391
|
+
}
|
|
392
|
+
#resizeCornerFree = (point) => {
|
|
393
|
+
const { cropperBox } = this.getStates();
|
|
394
|
+
const offsetX = clamp(point.x, ...this.#rangeX);
|
|
395
|
+
const offsetY = clamp(point.y, ...this.#rangeY);
|
|
396
|
+
const newCropperBoxPos = {
|
|
397
|
+
width: cropperBox.width,
|
|
398
|
+
height: cropperBox.height,
|
|
399
|
+
centerPoint: {
|
|
400
|
+
x: cropperBox.centerPoint.x,
|
|
401
|
+
y: cropperBox.centerPoint.y
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
const { paramX, paramY } = this.#resizeVector;
|
|
405
|
+
if (paramX) {
|
|
406
|
+
const fixed = cropperBox.centerPoint.x - paramX * cropperBox.width / 2;
|
|
407
|
+
const raw = cropperBox.width + paramX * (offsetX - (fixed + paramX * cropperBox.width));
|
|
408
|
+
if (raw < 0) this.#resizeVector.paramX = -paramX;
|
|
409
|
+
newCropperBoxPos.width = Math.max(Math.abs(raw), 10);
|
|
410
|
+
newCropperBoxPos.centerPoint.x = fixed + this.#resizeVector.paramX * newCropperBoxPos.width / 2;
|
|
411
|
+
}
|
|
412
|
+
if (paramY) {
|
|
413
|
+
const fixed = cropperBox.centerPoint.y - paramY * cropperBox.height / 2;
|
|
414
|
+
const raw = cropperBox.height + paramY * (offsetY - (fixed + paramY * cropperBox.height));
|
|
415
|
+
if (raw < 0) this.#resizeVector.paramY = -paramY;
|
|
416
|
+
newCropperBoxPos.height = Math.max(Math.abs(raw), 10);
|
|
417
|
+
newCropperBoxPos.centerPoint.y = fixed + this.#resizeVector.paramY * newCropperBoxPos.height / 2;
|
|
418
|
+
}
|
|
419
|
+
this.setState({ cropperBox: newCropperBoxPos });
|
|
420
|
+
};
|
|
421
|
+
#moveBoxBy(offsetX, offsetY, range) {
|
|
422
|
+
const { cropperBox } = this.getStates();
|
|
423
|
+
this.setState({ cropperBox: {
|
|
424
|
+
width: cropperBox.width,
|
|
425
|
+
height: cropperBox.height,
|
|
426
|
+
centerPoint: {
|
|
427
|
+
x: clamp(cropperBox.centerPoint.x + offsetX, range.xMin, range.xMax),
|
|
428
|
+
y: clamp(cropperBox.centerPoint.y + offsetY, range.yMin, range.yMax)
|
|
429
|
+
}
|
|
430
|
+
} });
|
|
431
|
+
}
|
|
432
|
+
#startCornerResize(dir) {
|
|
433
|
+
this.#resizeDir = dir;
|
|
434
|
+
this.#resizeVector = this.#getResizeVector(dir);
|
|
435
|
+
const { aspectRatio } = this.getProps();
|
|
436
|
+
if (aspectRatio) this.#computeAspectResizeRange();
|
|
437
|
+
else {
|
|
438
|
+
this.#rangeX = [0, this.#containerData.width];
|
|
439
|
+
this.#rangeY = [0, this.#containerData.height];
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
#getMoveRange() {
|
|
443
|
+
const { cropperBox } = this.getStates();
|
|
444
|
+
const { width, height } = this.#readContainerSize();
|
|
445
|
+
return {
|
|
446
|
+
xMin: cropperBox.width / 2,
|
|
447
|
+
xMax: width - cropperBox.width / 2,
|
|
448
|
+
yMin: cropperBox.height / 2,
|
|
449
|
+
yMax: height - cropperBox.height / 2
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
#resizeCornerBy(dx, dy) {
|
|
453
|
+
const { cropperBox } = this.getStates();
|
|
454
|
+
const { aspectRatio } = this.getProps();
|
|
455
|
+
const left = cropperBox.centerPoint.x - cropperBox.width / 2;
|
|
456
|
+
const top = cropperBox.centerPoint.y - cropperBox.height / 2;
|
|
457
|
+
const heightDelta = aspectRatio && dx ? dx / aspectRatio : dy;
|
|
458
|
+
const minHeight = aspectRatio ? Math.max(10, 10 / aspectRatio) : 10;
|
|
459
|
+
const x = Math.max(left + cropperBox.width + dx, left + 10);
|
|
460
|
+
const y = Math.max(top + cropperBox.height + heightDelta, top + minHeight);
|
|
461
|
+
this.#startCornerResize("br");
|
|
462
|
+
(aspectRatio ? this.#resizeCornerWithAspect : this.#resizeCornerFree)({
|
|
463
|
+
x,
|
|
464
|
+
y
|
|
465
|
+
});
|
|
466
|
+
this.handleCornerLostPointerCapture();
|
|
467
|
+
}
|
|
468
|
+
static getInitialState() {
|
|
469
|
+
return {
|
|
470
|
+
imgData: {
|
|
471
|
+
width: 0,
|
|
472
|
+
height: 0,
|
|
473
|
+
centerPoint: {
|
|
474
|
+
x: 0,
|
|
475
|
+
y: 0
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
cropperBox: {
|
|
479
|
+
width: 0,
|
|
480
|
+
height: 0,
|
|
481
|
+
centerPoint: {
|
|
482
|
+
x: 0,
|
|
483
|
+
y: 0
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
zoom: 1,
|
|
487
|
+
rotate: 0,
|
|
488
|
+
loaded: false
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
handleCornerPointerMove = (e) => {
|
|
492
|
+
if (!this.#resizeDir) return;
|
|
493
|
+
e.preventDefault();
|
|
494
|
+
const point = this.#toContainerPoint(e.clientX, e.clientY);
|
|
495
|
+
if (this.getProps().aspectRatio) this.#resizeCornerWithAspect(point);
|
|
496
|
+
else this.#resizeCornerFree(point);
|
|
497
|
+
};
|
|
498
|
+
/** Follows pointerup and pointercancel; also fires when the corner leaves the page mid-drag */
|
|
499
|
+
handleCornerLostPointerCapture = () => {
|
|
500
|
+
this.#resizeDir = "";
|
|
501
|
+
this.#resizeVector = {
|
|
502
|
+
paramX: 0,
|
|
503
|
+
paramY: 0
|
|
504
|
+
};
|
|
505
|
+
};
|
|
506
|
+
handleCropperBoxPointerMove = ({ clientX, clientY }) => {
|
|
507
|
+
if (!this.#cropperBoxMoveStart) return;
|
|
508
|
+
this.#moveBoxBy(clientX - this.#cropperBoxMoveStart.x, clientY - this.#cropperBoxMoveStart.y, this.#moveRange);
|
|
509
|
+
this.#cropperBoxMoveStart = {
|
|
510
|
+
x: clientX,
|
|
511
|
+
y: clientY
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
handleCropperBoxLostPointerCapture = () => {
|
|
515
|
+
this.#cropperBoxMoveStart = null;
|
|
516
|
+
};
|
|
517
|
+
handleMaskPointerMove = ({ clientX, clientY }) => {
|
|
518
|
+
if (!this.#imgMoveStart) return;
|
|
519
|
+
const { imgData } = this.getStates();
|
|
520
|
+
const offsetX = clientX - this.#imgMoveStart.x;
|
|
521
|
+
const offsetY = clientY - this.#imgMoveStart.y;
|
|
522
|
+
const newCenterPointX = imgData.centerPoint.x + offsetX;
|
|
523
|
+
const newCenterPointY = imgData.centerPoint.y + offsetY;
|
|
524
|
+
const newImgData = {
|
|
525
|
+
width: imgData.width,
|
|
526
|
+
height: imgData.height,
|
|
527
|
+
centerPoint: {
|
|
528
|
+
x: newCenterPointX,
|
|
529
|
+
y: newCenterPointY
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
this.#imgMoveStart = {
|
|
533
|
+
x: clientX,
|
|
534
|
+
y: clientY
|
|
535
|
+
};
|
|
536
|
+
this.setState({ imgData: newImgData });
|
|
537
|
+
};
|
|
538
|
+
handleMaskLostPointerCapture = () => {
|
|
539
|
+
this.#imgMoveStart = null;
|
|
540
|
+
};
|
|
541
|
+
init() {
|
|
542
|
+
this.#containerData = this.#readContainerSize();
|
|
543
|
+
this.#cropperBoxMoveStart = null;
|
|
544
|
+
if (this.getStates().loaded) {
|
|
545
|
+
this.#renderPreview();
|
|
546
|
+
this.updatePreview();
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
/** A zoom or rotate prop that goes back to undefined (a form reset) returns to 1 or 0 */
|
|
550
|
+
handlePropsChange(prev) {
|
|
551
|
+
const { aspectRatio, zoom, rotate } = this.getProps();
|
|
552
|
+
if (prev.aspectRatio !== aspectRatio) this.applyAspectRatio();
|
|
553
|
+
const resetZoom = zoom === void 0 && prev.zoom !== void 0;
|
|
554
|
+
const resetRotate = rotate === void 0 && prev.rotate !== void 0;
|
|
555
|
+
if (resetZoom || resetRotate) this.syncRotateAndZoom({
|
|
556
|
+
zoom: resetZoom ? 1 : void 0,
|
|
557
|
+
rotate: resetRotate ? 0 : void 0
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
destroy() {
|
|
561
|
+
this.#removePreview();
|
|
562
|
+
}
|
|
563
|
+
handleResize = () => {
|
|
564
|
+
const { loaded } = this.getStates();
|
|
565
|
+
if (!loaded) return;
|
|
566
|
+
const newContainerData = this.#readContainerSize();
|
|
567
|
+
const { width: oldWidth, height: oldHeight } = this.#containerData;
|
|
568
|
+
if (newContainerData.width === oldWidth && newContainerData.height === oldHeight) return;
|
|
569
|
+
if (newContainerData.width === 0 || newContainerData.height === 0) return;
|
|
570
|
+
if (oldWidth === 0 || oldHeight === 0) {
|
|
571
|
+
this.#containerData = newContainerData;
|
|
572
|
+
this.#layoutImage();
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
const ratio = Math.min(newContainerData.width / oldWidth, newContainerData.height / oldHeight);
|
|
576
|
+
const newImgData = this.#getImgDataWhenResize(ratio);
|
|
577
|
+
const newCropperBox = this.#getCropperBoxWhenResize(ratio, newContainerData);
|
|
578
|
+
this.#containerData = newContainerData;
|
|
579
|
+
this.setState({
|
|
580
|
+
imgData: newImgData,
|
|
581
|
+
cropperBox: newCropperBox
|
|
582
|
+
});
|
|
583
|
+
};
|
|
584
|
+
/**
|
|
585
|
+
* Refits the crop box to a changed `aspectRatio`: height stays, width follows, and a box too big for the
|
|
586
|
+
* container shrinks. It stays centered, moved only as far as the container edges require.
|
|
587
|
+
*/
|
|
588
|
+
applyAspectRatio = () => {
|
|
589
|
+
this.handleCornerLostPointerCapture();
|
|
590
|
+
this.handleCropperBoxLostPointerCapture();
|
|
591
|
+
const { aspectRatio } = this.getProps();
|
|
592
|
+
const { cropperBox, loaded } = this.getStates();
|
|
593
|
+
const { width: containerWidth, height: containerHeight } = this.#containerData;
|
|
594
|
+
if (!loaded || !aspectRatio || !containerWidth || !containerHeight) return;
|
|
595
|
+
let height = Math.max(cropperBox.height, 10, 10 / aspectRatio);
|
|
596
|
+
let width = height * aspectRatio;
|
|
597
|
+
if (width > containerWidth) {
|
|
598
|
+
width = containerWidth;
|
|
599
|
+
height = width / aspectRatio;
|
|
600
|
+
}
|
|
601
|
+
if (height > containerHeight) {
|
|
602
|
+
height = containerHeight;
|
|
603
|
+
width = height * aspectRatio;
|
|
604
|
+
}
|
|
605
|
+
this.setState({ cropperBox: {
|
|
606
|
+
width,
|
|
607
|
+
height,
|
|
608
|
+
centerPoint: {
|
|
609
|
+
x: clamp(cropperBox.centerPoint.x, width / 2, containerWidth - width / 2),
|
|
610
|
+
y: clamp(cropperBox.centerPoint.y, height / 2, containerHeight - height / 2)
|
|
611
|
+
}
|
|
612
|
+
} });
|
|
613
|
+
};
|
|
614
|
+
handleImageLoad = ({ target }) => {
|
|
615
|
+
if (!(target instanceof HTMLImageElement)) return;
|
|
616
|
+
const { naturalWidth, naturalHeight } = target;
|
|
617
|
+
this.#containerData = this.#readContainerSize();
|
|
618
|
+
this.#imgData.originalWidth = naturalWidth;
|
|
619
|
+
this.#imgData.originalHeight = naturalHeight;
|
|
620
|
+
this.#layoutImage();
|
|
621
|
+
this.#renderPreview();
|
|
622
|
+
};
|
|
623
|
+
/**
|
|
624
|
+
* Brings the state to the `rotate` and `zoom` props once the image has loaded; a controlled zoom also undoes
|
|
625
|
+
* wheel zooming the parent does not accept. Turns and scales around the cropper box center.
|
|
626
|
+
*/
|
|
627
|
+
syncRotateAndZoom = ({ rotate: newRotate, zoom: newZoom } = this.getProps()) => {
|
|
628
|
+
const { rotate, zoom, imgData, cropperBox, loaded } = this.getStates();
|
|
629
|
+
const rotateChanged = newRotate !== void 0 && !Object.is(newRotate, rotate);
|
|
630
|
+
const zoomChanged = newZoom !== void 0 && !Object.is(newZoom, zoom);
|
|
631
|
+
if (!loaded || !rotateChanged && !zoomChanged) return;
|
|
632
|
+
const center = {
|
|
633
|
+
x: cropperBox.centerPoint.x,
|
|
634
|
+
y: -cropperBox.centerPoint.y
|
|
635
|
+
};
|
|
636
|
+
let imgCenter = {
|
|
637
|
+
x: imgData.centerPoint.x,
|
|
638
|
+
y: -imgData.centerPoint.y
|
|
639
|
+
};
|
|
640
|
+
let { width, height } = imgData;
|
|
641
|
+
if (rotateChanged) {
|
|
642
|
+
const angle = (newRotate - rotate) * Math.PI / 180;
|
|
643
|
+
imgCenter = {
|
|
644
|
+
x: (imgCenter.x - center.x) * Math.cos(angle) + (imgCenter.y - center.y) * Math.sin(angle) + center.x,
|
|
645
|
+
y: -(imgCenter.x - center.x) * Math.sin(angle) + (imgCenter.y - center.y) * Math.cos(angle) + center.y
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
if (zoomChanged) {
|
|
649
|
+
width = width / zoom * newZoom;
|
|
650
|
+
height = height / zoom * newZoom;
|
|
651
|
+
imgCenter = {
|
|
652
|
+
x: (imgCenter.x - center.x) / zoom * newZoom + center.x,
|
|
653
|
+
y: (imgCenter.y - center.y) / zoom * newZoom + center.y
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
this.setState({
|
|
657
|
+
rotate: rotateChanged ? newRotate : rotate,
|
|
658
|
+
zoom: zoomChanged ? newZoom : zoom,
|
|
659
|
+
imgData: {
|
|
660
|
+
width,
|
|
661
|
+
height,
|
|
662
|
+
centerPoint: {
|
|
663
|
+
x: imgCenter.x,
|
|
664
|
+
y: -imgCenter.y
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
};
|
|
669
|
+
handleWheel = (e) => {
|
|
670
|
+
e.preventDefault();
|
|
671
|
+
if (!this.getStates().loaded) return;
|
|
672
|
+
const { imgData, zoom: currZoom } = this.getStates();
|
|
673
|
+
const { maxZoom, minZoom, zoomStep } = this.getProps();
|
|
674
|
+
if (e.deltaY === 0) return;
|
|
675
|
+
const stepped = currZoom + (e.deltaY < 0 ? zoomStep : -zoomStep);
|
|
676
|
+
const _zoom = Number(Math.min(maxZoom, Math.max(minZoom, stepped)).toFixed(2));
|
|
677
|
+
if (_zoom === currZoom) return;
|
|
678
|
+
const point = this.#toContainerPoint(e.clientX, e.clientY);
|
|
679
|
+
const scaleCenter = {
|
|
680
|
+
x: point.x,
|
|
681
|
+
y: -point.y
|
|
682
|
+
};
|
|
683
|
+
const currentPoint = { ...imgData.centerPoint };
|
|
684
|
+
currentPoint.y = -currentPoint.y;
|
|
685
|
+
const newCenterPoint = {
|
|
686
|
+
x: (currentPoint.x - scaleCenter.x) / currZoom * _zoom + scaleCenter.x,
|
|
687
|
+
y: -((currentPoint.y - scaleCenter.y) / currZoom * _zoom + scaleCenter.y)
|
|
688
|
+
};
|
|
689
|
+
const newImgDataState = {
|
|
690
|
+
width: imgData.width / currZoom * _zoom,
|
|
691
|
+
height: imgData.height / currZoom * _zoom,
|
|
692
|
+
centerPoint: newCenterPoint
|
|
693
|
+
};
|
|
694
|
+
this.setState({
|
|
695
|
+
imgData: newImgDataState,
|
|
696
|
+
zoom: _zoom
|
|
697
|
+
});
|
|
698
|
+
this.adapter.notifyZoomChange(_zoom);
|
|
699
|
+
};
|
|
700
|
+
updatePreview = () => {
|
|
701
|
+
if (!this.#previewImg) return;
|
|
702
|
+
const { cropperBox, imgData, rotate } = this.getStates();
|
|
703
|
+
const { width, height } = imgData;
|
|
704
|
+
const { viewX: translateX, viewY: translateY } = getCropperGeometry(imgData, cropperBox);
|
|
705
|
+
let zoom = 1;
|
|
706
|
+
const { width: containerWidth, height: containerHeight } = this.#previewContainerInitSize;
|
|
707
|
+
let previewWidth = containerWidth;
|
|
708
|
+
let previewHeight = containerHeight;
|
|
709
|
+
if (previewWidth < previewHeight) {
|
|
710
|
+
zoom = containerWidth / cropperBox.width;
|
|
711
|
+
let tempHeight = zoom * cropperBox.height;
|
|
712
|
+
if (tempHeight > containerHeight) {
|
|
713
|
+
zoom = containerHeight / cropperBox.height;
|
|
714
|
+
previewWidth = zoom * cropperBox.width;
|
|
715
|
+
} else previewHeight = tempHeight;
|
|
716
|
+
} else {
|
|
717
|
+
zoom = containerHeight / cropperBox.height;
|
|
718
|
+
let tempWidth = zoom * cropperBox.width;
|
|
719
|
+
if (tempWidth > containerWidth) {
|
|
720
|
+
zoom = containerWidth / cropperBox.width;
|
|
721
|
+
previewHeight = zoom * cropperBox.height;
|
|
722
|
+
} else previewWidth = tempWidth;
|
|
723
|
+
}
|
|
724
|
+
this.#previewImg.style.width = `${width * zoom}px`;
|
|
725
|
+
this.#previewImg.style.height = `${height * zoom}px`;
|
|
726
|
+
this.#previewImg.style.transform = `translate(${translateX * zoom}px, ${translateY * zoom}px) rotate(${rotate}deg)`;
|
|
727
|
+
this.#previewImg.style.transformOrigin = "center";
|
|
728
|
+
this.#previewContainer.style.width = `${previewWidth}px`;
|
|
729
|
+
this.#previewContainer.style.height = `${previewHeight}px`;
|
|
730
|
+
};
|
|
731
|
+
handleCornerPointerDown = (e) => {
|
|
732
|
+
const currentTarget = e.currentTarget;
|
|
733
|
+
if (!(currentTarget instanceof HTMLElement) || isSecondaryPress(e)) return;
|
|
734
|
+
e.preventDefault();
|
|
735
|
+
currentTarget.setPointerCapture(e.pointerId);
|
|
736
|
+
this.#startCornerResize(currentTarget.dataset.dir);
|
|
737
|
+
};
|
|
738
|
+
handleCropperBoxPointerDown = (e) => {
|
|
739
|
+
if (e.target instanceof HTMLElement && e.target.dataset.dir) return;
|
|
740
|
+
const { currentTarget } = e;
|
|
741
|
+
if (!(currentTarget instanceof Element) || isSecondaryPress(e)) return;
|
|
742
|
+
currentTarget.setPointerCapture(e.pointerId);
|
|
743
|
+
this.#cropperBoxMoveStart = {
|
|
744
|
+
x: e.clientX,
|
|
745
|
+
y: e.clientY
|
|
746
|
+
};
|
|
747
|
+
this.#moveRange = this.#getMoveRange();
|
|
748
|
+
};
|
|
749
|
+
/**
|
|
750
|
+
* Moves the box with the arrow keys by KEYBOARD_STEP px; Shift moves the bottom right corner instead, through
|
|
751
|
+
* the drag path, so the box keeps to the container and the aspect ratio. Only with resize handles shown, as
|
|
752
|
+
* with a pointer.
|
|
753
|
+
*/
|
|
754
|
+
handleCropperBoxKeyDown = (e) => {
|
|
755
|
+
if (e.altKey || e.ctrlKey || e.metaKey) return;
|
|
756
|
+
const direction = (/* @__PURE__ */ new Map([
|
|
757
|
+
["ArrowLeft", [-1, 0]],
|
|
758
|
+
["ArrowRight", [1, 0]],
|
|
759
|
+
["ArrowUp", [0, -1]],
|
|
760
|
+
["ArrowDown", [0, 1]]
|
|
761
|
+
])).get(e.key);
|
|
762
|
+
if (!direction || !this.getStates().loaded) return;
|
|
763
|
+
const dx = direction[0] * 10;
|
|
764
|
+
const dy = direction[1] * 10;
|
|
765
|
+
if (!e.shiftKey) {
|
|
766
|
+
e.preventDefault();
|
|
767
|
+
this.#moveBoxBy(dx, dy, this.#getMoveRange());
|
|
768
|
+
} else if (this.getProps().showResizeBox) {
|
|
769
|
+
e.preventDefault();
|
|
770
|
+
this.#resizeCornerBy(dx, dy);
|
|
771
|
+
}
|
|
772
|
+
};
|
|
773
|
+
handleMaskPointerDown = (e) => {
|
|
774
|
+
const { currentTarget } = e;
|
|
775
|
+
if (!(currentTarget instanceof Element) || currentTarget !== e.target || isSecondaryPress(e)) return;
|
|
776
|
+
currentTarget.setPointerCapture(e.pointerId);
|
|
777
|
+
this.#imgMoveStart = {
|
|
778
|
+
x: e.clientX,
|
|
779
|
+
y: e.clientY
|
|
780
|
+
};
|
|
781
|
+
};
|
|
782
|
+
getCropperCanvas = () => {
|
|
783
|
+
if (!this.getStates().loaded) throw new Error("[Semi] Cropper: getCropperCanvas called before the image loaded");
|
|
784
|
+
const { cropperBox, imgData, rotate, zoom } = this.getStates();
|
|
785
|
+
const { fill } = this.getProps();
|
|
786
|
+
const canvas = document.createElement("canvas");
|
|
787
|
+
const ctx = canvas.getContext("2d");
|
|
788
|
+
const img = this.adapter.getImg();
|
|
789
|
+
const angle = rotate * Math.PI / 180;
|
|
790
|
+
const sine = Math.abs(Math.sin(angle));
|
|
791
|
+
const cosine = Math.abs(Math.cos(angle));
|
|
792
|
+
const imgWidth = this.#imgData.originalWidth;
|
|
793
|
+
const imgHeight = this.#imgData.originalHeight;
|
|
794
|
+
const containerWidth = imgWidth * cosine + imgHeight * sine;
|
|
795
|
+
const containerHeight = imgHeight * cosine + imgWidth * sine;
|
|
796
|
+
const cropperContainerWidth = containerWidth * zoom * this.#imgData.scale;
|
|
797
|
+
const cropperContainerHeight = containerHeight * zoom * this.#imgData.scale;
|
|
798
|
+
const cropperContainerTop = imgData.centerPoint.y - cropperContainerHeight / 2;
|
|
799
|
+
const cropperContainerLeft = imgData.centerPoint.x - cropperContainerWidth / 2;
|
|
800
|
+
const cropperBoxLeft = cropperBox.centerPoint.x - cropperBox.width / 2;
|
|
801
|
+
const cropperBoxTop = cropperBox.centerPoint.y - cropperBox.height / 2;
|
|
802
|
+
const realZoom = zoom * this.#imgData.scale;
|
|
803
|
+
const relativeCropLeft = (cropperBoxLeft - cropperContainerLeft) / realZoom;
|
|
804
|
+
const relativeCropTop = (cropperBoxTop - cropperContainerTop) / realZoom;
|
|
805
|
+
const relativeWidth = cropperBox.width / realZoom;
|
|
806
|
+
const relativeHeight = cropperBox.height / realZoom;
|
|
807
|
+
const relativeCropRight = relativeCropLeft + relativeWidth;
|
|
808
|
+
const relativeCropBottom = relativeCropTop + relativeHeight;
|
|
809
|
+
if (relativeCropRight < 0 || relativeCropBottom < 0 || relativeCropLeft > containerWidth || relativeCropTop > containerHeight) {
|
|
810
|
+
const emptyCanvas = document.createElement("canvas");
|
|
811
|
+
const ctx = emptyCanvas.getContext("2d");
|
|
812
|
+
emptyCanvas.width = relativeWidth;
|
|
813
|
+
emptyCanvas.height = relativeHeight;
|
|
814
|
+
ctx.fillStyle = fill;
|
|
815
|
+
ctx.fillRect(0, 0, relativeWidth, relativeHeight);
|
|
816
|
+
return emptyCanvas;
|
|
817
|
+
}
|
|
818
|
+
canvas.width = containerWidth;
|
|
819
|
+
canvas.height = containerHeight;
|
|
820
|
+
ctx.fillStyle = fill;
|
|
821
|
+
ctx.fillRect(0, 0, containerWidth, containerHeight);
|
|
822
|
+
const halfWidth = containerWidth / 2;
|
|
823
|
+
const halfHeight = containerHeight / 2;
|
|
824
|
+
ctx.translate(halfWidth, halfHeight);
|
|
825
|
+
ctx.rotate(rotate * Math.PI / 180);
|
|
826
|
+
ctx.translate(-halfWidth, -halfHeight);
|
|
827
|
+
const imgX = (containerWidth - imgWidth) / 2;
|
|
828
|
+
const imgY = (containerHeight - imgHeight) / 2;
|
|
829
|
+
ctx.drawImage(img, 0, 0, imgWidth, imgHeight, imgX, imgY, imgWidth, imgHeight);
|
|
830
|
+
const canvas2 = document.createElement("canvas");
|
|
831
|
+
const ctx2 = canvas2.getContext("2d");
|
|
832
|
+
let realLeft = relativeCropLeft;
|
|
833
|
+
let realTop = relativeCropTop;
|
|
834
|
+
let realWidth = relativeWidth;
|
|
835
|
+
let realHeight = relativeHeight;
|
|
836
|
+
if (relativeCropLeft < 0) realLeft = 0;
|
|
837
|
+
if (relativeCropTop < 0) realTop = 0;
|
|
838
|
+
if (relativeCropRight > containerWidth) realWidth = containerWidth - realLeft;
|
|
839
|
+
else if (relativeCropLeft < 0) realWidth = relativeCropRight;
|
|
840
|
+
if (relativeCropBottom > containerHeight) realHeight = containerHeight - realTop;
|
|
841
|
+
else if (relativeCropTop < 0) realHeight = relativeCropBottom;
|
|
842
|
+
canvas2.width = relativeWidth;
|
|
843
|
+
canvas2.height = relativeHeight;
|
|
844
|
+
ctx2.fillStyle = fill;
|
|
845
|
+
ctx2.fillRect(0, 0, relativeWidth, relativeHeight);
|
|
846
|
+
const imgDataResult = ctx.getImageData(realLeft, realTop, realWidth, realHeight);
|
|
847
|
+
ctx2.putImageData(imgDataResult, relativeCropLeft < 0 ? -relativeCropLeft : 0, relativeCropTop < 0 ? -relativeCropTop : 0);
|
|
848
|
+
return canvas2;
|
|
849
|
+
};
|
|
850
|
+
};
|
|
851
|
+
export { CropperFoundation as default };
|