@ebscn/ui 0.0.11 → 1.0.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 +44 -0
- package/cjs/components/alphabet-keyboard/alphabet-keyboard.css +143 -0
- package/cjs/components/alphabet-keyboard/alphabet-keyboard.d.ts +11 -0
- package/cjs/components/alphabet-keyboard/alphabet-keyboard.js +139 -0
- package/cjs/components/alphabet-keyboard/index.d.ts +4 -0
- package/cjs/components/alphabet-keyboard/index.js +9 -0
- package/cjs/components/button/button.css +152 -0
- package/cjs/components/button/button.d.ts +40 -0
- package/cjs/components/button/button.js +215 -0
- package/cjs/components/button/index.d.ts +4 -0
- package/cjs/components/button/index.js +9 -0
- package/cjs/components/card/card.css +37 -0
- package/cjs/components/card/card.d.ts +17 -0
- package/cjs/components/card/card.js +40 -0
- package/cjs/components/card/index.d.ts +4 -0
- package/cjs/components/card/index.js +10 -0
- package/cjs/components/checkbox/checkbox.css +92 -0
- package/cjs/components/checkbox/checkbox.d.ts +44 -0
- package/cjs/components/checkbox/checkbox.js +106 -0
- package/cjs/components/checkbox/group-context.d.ts +8 -0
- package/cjs/components/checkbox/group-context.js +8 -0
- package/cjs/components/checkbox/group.d.ts +10 -0
- package/cjs/components/checkbox/group.js +48 -0
- package/cjs/components/checkbox/index.d.ts +26 -0
- package/cjs/components/checkbox/index.js +14 -0
- package/cjs/components/checkbox/native-input.d.ts +10 -0
- package/cjs/components/checkbox/native-input.js +38 -0
- package/cjs/components/grid/grid.css +15 -0
- package/cjs/components/grid/grid.d.ts +15 -0
- package/cjs/components/grid/grid.js +45 -0
- package/cjs/components/grid/index.d.ts +7 -0
- package/cjs/components/grid/index.js +12 -0
- package/cjs/components/icons/check-icon.d.ts +4 -0
- package/cjs/components/icons/check-icon.js +30 -0
- package/cjs/components/icons/check-only-icon.d.ts +4 -0
- package/cjs/components/icons/check-only-icon.js +21 -0
- package/cjs/components/icons/clear-icon.d.ts +4 -0
- package/cjs/components/icons/clear-icon.js +41 -0
- package/cjs/components/icons/indeterminate-icon.d.ts +4 -0
- package/cjs/components/icons/indeterminate-icon.js +29 -0
- package/cjs/components/icons/index.d.ts +8 -0
- package/cjs/components/icons/index.js +62 -0
- package/cjs/components/icons/loading-icon.d.ts +4 -0
- package/cjs/components/icons/loading-icon.js +89 -0
- package/cjs/components/icons/search-icon.d.ts +4 -0
- package/cjs/components/icons/search-icon.js +43 -0
- package/cjs/components/icons/spin-icon.d.ts +4 -0
- package/cjs/components/icons/spin-icon.js +32 -0
- package/cjs/components/icons/uncheck-icon.d.ts +4 -0
- package/cjs/components/icons/uncheck-icon.js +26 -0
- package/cjs/components/imageViewer/imageViewer.d.ts +4 -0
- package/cjs/components/imageViewer/imageViewer.js +35 -0
- package/cjs/components/imageViewer/index.js +9 -0
- package/cjs/components/marketTag/index.d.ts +4 -0
- package/cjs/components/marketTag/index.js +9 -0
- package/cjs/components/marketTag/marketTag.css +14 -0
- package/cjs/components/marketTag/marketTag.d.ts +11 -0
- package/cjs/components/marketTag/marketTag.js +27 -0
- package/cjs/components/number-keyboard/index.d.ts +4 -0
- package/cjs/components/number-keyboard/index.js +9 -0
- package/cjs/components/number-keyboard/number-keyboard.css +77 -0
- package/cjs/components/number-keyboard/number-keyboard.d.ts +13 -0
- package/cjs/components/number-keyboard/number-keyboard.js +93 -0
- package/cjs/components/pdfLink/index.d.ts +3 -0
- package/cjs/components/pdfLink/index.js +10 -0
- package/cjs/components/pdfLink/pdfLink.css +11 -0
- package/cjs/components/pdfLink/pdfLink.d.ts +8 -0
- package/cjs/components/pdfLink/pdfLink.js +102 -0
- package/cjs/components/protocol/index.d.ts +3 -0
- package/cjs/components/protocol/index.js +10 -0
- package/cjs/components/protocol/protocol.css +46 -0
- package/cjs/components/protocol/protocol.d.ts +15 -0
- package/cjs/components/protocol/protocol.js +120 -0
- package/cjs/components/radio/group-context.d.ts +8 -0
- package/cjs/components/radio/group-context.js +8 -0
- package/cjs/components/radio/group.d.ts +10 -0
- package/cjs/components/radio/group.js +43 -0
- package/cjs/components/radio/index.d.ts +8 -0
- package/cjs/components/radio/index.js +13 -0
- package/cjs/components/radio/radio.css +92 -0
- package/cjs/components/radio/radio.d.ts +19 -0
- package/cjs/components/radio/radio.js +92 -0
- package/cjs/components/search/index.d.ts +3 -0
- package/cjs/components/search/index.js +10 -0
- package/cjs/components/search/search.css +53 -0
- package/cjs/components/search/search.d.ts +15 -0
- package/cjs/components/search/search.js +110 -0
- package/cjs/components/stock-count-keyboard/index.d.ts +4 -0
- package/cjs/components/stock-count-keyboard/index.js +9 -0
- package/cjs/components/stock-count-keyboard/stock-count-keyboard.css +74 -0
- package/cjs/components/stock-count-keyboard/stock-count-keyboard.d.ts +9 -0
- package/cjs/components/stock-count-keyboard/stock-count-keyboard.js +82 -0
- package/cjs/components/stock-keyboard/index.d.ts +4 -0
- package/cjs/components/stock-keyboard/index.js +9 -0
- package/cjs/components/stock-keyboard/stock-keyboard.css +111 -0
- package/cjs/components/stock-keyboard/stock-keyboard.d.ts +12 -0
- package/cjs/components/stock-keyboard/stock-keyboard.js +107 -0
- package/cjs/components/switch/index.d.ts +4 -0
- package/cjs/components/switch/index.js +10 -0
- package/cjs/components/switch/switch.css +104 -0
- package/cjs/components/switch/switch.d.ts +16 -0
- package/cjs/components/switch/switch.js +213 -0
- package/cjs/components/toastLoading/index.d.ts +4 -0
- package/cjs/components/toastLoading/index.js +9 -0
- package/cjs/components/toastLoading/toastLoading.css +27 -0
- package/cjs/components/toastLoading/toastLoading.d.ts +7 -0
- package/cjs/components/toastLoading/toastLoading.js +35 -0
- package/cjs/global/global.css +289 -0
- package/cjs/global/index.d.ts +1 -0
- package/cjs/global/index.js +11 -0
- package/cjs/global/theme-dark.css +18 -0
- package/cjs/global/theme-default.css +48 -0
- package/cjs/index.d.ts +18 -0
- package/cjs/index.js +149 -0
- package/cjs/utils/attach-properties-to-component.d.ts +1 -0
- package/cjs/utils/attach-properties-to-component.js +15 -0
- package/cjs/utils/bound.d.ts +1 -0
- package/cjs/utils/bound.js +16 -0
- package/cjs/utils/can-use-dom.d.ts +1 -0
- package/cjs/utils/can-use-dom.js +7 -0
- package/cjs/utils/convert-px.d.ts +1 -0
- package/cjs/utils/convert-px.js +33 -0
- package/cjs/utils/create-icon-component.d.ts +2 -0
- package/cjs/utils/create-icon-component.js +12 -0
- package/cjs/utils/dev-log.d.ts +3 -0
- package/cjs/utils/dev-log.js +45 -0
- package/cjs/utils/generate-int-array.d.ts +1 -0
- package/cjs/utils/generate-int-array.js +13 -0
- package/cjs/utils/get-container.d.ts +2 -0
- package/cjs/utils/get-container.js +10 -0
- package/cjs/utils/get-scroll-parent.d.ts +3 -0
- package/cjs/utils/get-scroll-parent.js +30 -0
- package/cjs/utils/is-dev.d.ts +1 -0
- package/cjs/utils/is-dev.js +7 -0
- package/cjs/utils/is-node-with-content.d.ts +4 -0
- package/cjs/utils/is-node-with-content.js +9 -0
- package/cjs/utils/matrix.d.ts +10 -0
- package/cjs/utils/matrix.js +47 -0
- package/cjs/utils/measure-css-length.d.ts +1 -0
- package/cjs/utils/measure-css-length.js +29 -0
- package/cjs/utils/merge-locale.d.ts +1 -0
- package/cjs/utils/merge-locale.js +21 -0
- package/cjs/utils/native-props.d.ts +8 -0
- package/cjs/utils/native-props.js +38 -0
- package/cjs/utils/nearest.d.ts +1 -0
- package/cjs/utils/nearest.js +11 -0
- package/cjs/utils/noop.d.ts +1 -0
- package/cjs/utils/noop.js +8 -0
- package/cjs/utils/reduce-and-restore-motion.d.ts +4 -0
- package/cjs/utils/reduce-and-restore-motion.js +44 -0
- package/cjs/utils/render-imperatively.d.ts +13 -0
- package/cjs/utils/render-imperatively.js +207 -0
- package/cjs/utils/render-to-body.d.ts +2 -0
- package/cjs/utils/render-to-body.js +19 -0
- package/cjs/utils/render-to-container.d.ts +3 -0
- package/cjs/utils/render-to-container.js +16 -0
- package/cjs/utils/render.d.ts +9 -0
- package/cjs/utils/render.js +196 -0
- package/cjs/utils/replace-message.d.ts +1 -0
- package/cjs/utils/replace-message.js +13 -0
- package/cjs/utils/rubberband.d.ts +2 -0
- package/cjs/utils/rubberband.js +20 -0
- package/cjs/utils/should-render.d.ts +10 -0
- package/cjs/utils/should-render.js +20 -0
- package/cjs/utils/shuffle.d.ts +6 -0
- package/cjs/utils/shuffle.js +29 -0
- package/cjs/utils/sleep.d.ts +1 -0
- package/cjs/utils/sleep.js +12 -0
- package/cjs/utils/supports-passive.d.ts +1 -0
- package/cjs/utils/supports-passive.js +19 -0
- package/cjs/utils/to-css-length.d.ts +1 -0
- package/cjs/utils/to-css-length.js +9 -0
- package/cjs/utils/traverse-react-node.d.ts +2 -0
- package/cjs/utils/traverse-react-node.js +23 -0
- package/cjs/utils/tree.d.ts +1 -0
- package/cjs/utils/tree.js +24 -0
- package/cjs/utils/undefined-fallback.d.ts +3 -0
- package/cjs/utils/undefined-fallback.js +17 -0
- package/cjs/utils/use-drag-and-pinch.d.ts +1 -0
- package/cjs/utils/use-drag-and-pinch.js +8 -0
- package/cjs/utils/use-initialized.d.ts +1 -0
- package/cjs/utils/use-initialized.js +14 -0
- package/cjs/utils/use-inner-visible.d.ts +1 -0
- package/cjs/utils/use-inner-visible.js +17 -0
- package/cjs/utils/use-isomorphic-update-layout-effect.d.ts +2 -0
- package/cjs/utils/use-isomorphic-update-layout-effect.js +8 -0
- package/cjs/utils/use-lock-scroll.d.ts +2 -0
- package/cjs/utils/use-lock-scroll.js +84 -0
- package/cjs/utils/use-mutation-effect.d.ts +2 -0
- package/cjs/utils/use-mutation-effect.js +21 -0
- package/cjs/utils/use-props-value.d.ts +8 -0
- package/cjs/utils/use-props-value.js +30 -0
- package/cjs/utils/use-ref-state.d.ts +2 -0
- package/cjs/utils/use-ref-state.js +17 -0
- package/cjs/utils/use-resize-effect.d.ts +2 -0
- package/cjs/utils/use-resize-effect.js +29 -0
- package/cjs/utils/use-tab-list-scroll.d.ts +5 -0
- package/cjs/utils/use-tab-list-scroll.js +67 -0
- package/cjs/utils/use-touch.d.ts +17 -0
- package/cjs/utils/use-touch.js +69 -0
- package/cjs/utils/validate.d.ts +8 -0
- package/cjs/utils/validate.js +39 -0
- package/cjs/utils/with-cache.d.ts +1 -0
- package/cjs/utils/with-cache.js +15 -0
- package/cjs/utils/with-default-props.d.ts +2 -0
- package/cjs/utils/with-default-props.js +32 -0
- package/cjs/utils/with-func-props.d.ts +5 -0
- package/cjs/utils/with-func-props.js +38 -0
- package/cjs/utils/with-stop-propagation.d.ts +4 -0
- package/cjs/utils/with-stop-propagation.js +37 -0
- package/es/components/alphabet-keyboard/alphabet-keyboard.css +143 -0
- package/es/components/alphabet-keyboard/alphabet-keyboard.d.ts +11 -0
- package/es/components/alphabet-keyboard/alphabet-keyboard.js +132 -0
- package/es/components/alphabet-keyboard/index.d.ts +4 -0
- package/es/components/alphabet-keyboard/index.js +3 -0
- package/es/components/button/button.css +152 -0
- package/es/components/button/button.d.ts +40 -0
- package/es/components/button/button.js +206 -0
- package/es/components/button/index.d.ts +4 -0
- package/es/components/button/index.js +3 -0
- package/es/components/card/card.css +37 -0
- package/es/components/card/card.d.ts +17 -0
- package/es/components/card/card.js +33 -0
- package/es/components/card/index.d.ts +4 -0
- package/es/components/card/index.js +3 -0
- package/es/components/checkbox/checkbox.css +92 -0
- package/es/components/checkbox/checkbox.d.ts +44 -0
- package/es/components/checkbox/checkbox.js +97 -0
- package/es/components/checkbox/group-context.d.ts +8 -0
- package/es/components/checkbox/group-context.js +2 -0
- package/es/components/checkbox/group.d.ts +10 -0
- package/es/components/checkbox/group.js +40 -0
- package/es/components/checkbox/index.d.ts +26 -0
- package/es/components/checkbox/index.js +7 -0
- package/es/components/checkbox/native-input.d.ts +10 -0
- package/es/components/checkbox/native-input.js +29 -0
- package/es/components/grid/grid.css +15 -0
- package/es/components/grid/grid.d.ts +15 -0
- package/es/components/grid/grid.js +36 -0
- package/es/components/grid/index.d.ts +7 -0
- package/es/components/grid/index.js +6 -0
- package/es/components/icons/check-icon.d.ts +4 -0
- package/es/components/icons/check-icon.js +22 -0
- package/es/components/icons/check-only-icon.d.ts +4 -0
- package/es/components/icons/check-only-icon.js +13 -0
- package/es/components/icons/clear-icon.d.ts +4 -0
- package/es/components/icons/clear-icon.js +33 -0
- package/es/components/icons/indeterminate-icon.d.ts +4 -0
- package/es/components/icons/indeterminate-icon.js +21 -0
- package/es/components/icons/index.d.ts +8 -0
- package/es/components/icons/index.js +8 -0
- package/es/components/icons/loading-icon.d.ts +4 -0
- package/es/components/icons/loading-icon.js +81 -0
- package/es/components/icons/search-icon.d.ts +4 -0
- package/es/components/icons/search-icon.js +35 -0
- package/es/components/icons/spin-icon.d.ts +4 -0
- package/es/components/icons/spin-icon.js +24 -0
- package/es/components/icons/uncheck-icon.d.ts +4 -0
- package/es/components/icons/uncheck-icon.js +18 -0
- package/es/components/imageViewer/imageViewer.d.ts +4 -0
- package/es/components/imageViewer/imageViewer.js +28 -0
- package/es/components/imageViewer/index.d.ts +7 -0
- package/es/components/imageViewer/index.js +2 -0
- package/es/components/marketTag/index.d.ts +4 -0
- package/es/components/marketTag/index.js +3 -0
- package/es/components/marketTag/marketTag.css +14 -0
- package/es/components/marketTag/marketTag.d.ts +11 -0
- package/es/components/marketTag/marketTag.js +19 -0
- package/es/components/number-keyboard/index.d.ts +4 -0
- package/es/components/number-keyboard/index.js +3 -0
- package/es/components/number-keyboard/number-keyboard.css +77 -0
- package/es/components/number-keyboard/number-keyboard.d.ts +13 -0
- package/es/components/number-keyboard/number-keyboard.js +85 -0
- package/es/components/pdfLink/index.d.ts +3 -0
- package/es/components/pdfLink/index.js +3 -0
- package/es/components/pdfLink/pdfLink.css +11 -0
- package/es/components/pdfLink/pdfLink.d.ts +8 -0
- package/es/components/pdfLink/pdfLink.js +94 -0
- package/es/components/protocol/index.d.ts +3 -0
- package/es/components/protocol/index.js +3 -0
- package/es/components/protocol/protocol.css +46 -0
- package/es/components/protocol/protocol.d.ts +15 -0
- package/es/components/protocol/protocol.js +112 -0
- package/es/components/radio/group-context.d.ts +8 -0
- package/es/components/radio/group-context.js +2 -0
- package/es/components/radio/group.d.ts +10 -0
- package/es/components/radio/group.js +35 -0
- package/es/components/radio/index.d.ts +8 -0
- package/es/components/radio/index.js +7 -0
- package/es/components/radio/radio.css +92 -0
- package/es/components/radio/radio.d.ts +19 -0
- package/es/components/radio/radio.js +82 -0
- package/es/components/search/index.d.ts +3 -0
- package/es/components/search/index.js +3 -0
- package/es/components/search/search.css +53 -0
- package/es/components/search/search.d.ts +15 -0
- package/es/components/search/search.js +102 -0
- package/es/components/stock-count-keyboard/index.d.ts +4 -0
- package/es/components/stock-count-keyboard/index.js +3 -0
- package/es/components/stock-count-keyboard/stock-count-keyboard.css +74 -0
- package/es/components/stock-count-keyboard/stock-count-keyboard.d.ts +9 -0
- package/es/components/stock-count-keyboard/stock-count-keyboard.js +74 -0
- package/es/components/stock-keyboard/index.d.ts +4 -0
- package/es/components/stock-keyboard/index.js +3 -0
- package/es/components/stock-keyboard/stock-keyboard.css +111 -0
- package/es/components/stock-keyboard/stock-keyboard.d.ts +12 -0
- package/es/components/stock-keyboard/stock-keyboard.js +99 -0
- package/es/components/switch/index.d.ts +4 -0
- package/es/components/switch/index.js +3 -0
- package/es/components/switch/switch.css +104 -0
- package/es/components/switch/switch.d.ts +16 -0
- package/es/components/switch/switch.js +204 -0
- package/es/components/toastLoading/index.d.ts +4 -0
- package/es/components/toastLoading/index.js +3 -0
- package/es/components/toastLoading/toastLoading.css +27 -0
- package/es/components/toastLoading/toastLoading.d.ts +7 -0
- package/es/components/toastLoading/toastLoading.js +27 -0
- package/es/global/global.css +289 -0
- package/es/global/index.d.ts +1 -0
- package/es/global/index.js +9 -0
- package/es/global/theme-dark.css +18 -0
- package/es/global/theme-default.css +48 -0
- package/es/index.d.ts +18 -0
- package/es/index.js +18 -0
- package/es/utils/attach-properties-to-component.d.ts +1 -0
- package/es/utils/attach-properties-to-component.js +9 -0
- package/es/utils/bound.d.ts +1 -0
- package/es/utils/bound.js +10 -0
- package/es/utils/can-use-dom.d.ts +1 -0
- package/es/utils/can-use-dom.js +1 -0
- package/es/utils/convert-px.d.ts +1 -0
- package/es/utils/convert-px.js +27 -0
- package/es/utils/create-icon-component.d.ts +2 -0
- package/es/utils/create-icon-component.js +6 -0
- package/es/utils/dev-log.d.ts +3 -0
- package/es/utils/dev-log.js +37 -0
- package/es/utils/generate-int-array.d.ts +1 -0
- package/es/utils/generate-int-array.js +7 -0
- package/es/utils/get-container.d.ts +2 -0
- package/es/utils/get-container.js +4 -0
- package/es/utils/get-scroll-parent.d.ts +3 -0
- package/es/utils/get-scroll-parent.js +24 -0
- package/es/utils/is-dev.d.ts +1 -0
- package/es/utils/is-dev.js +1 -0
- package/es/utils/is-node-with-content.d.ts +4 -0
- package/es/utils/is-node-with-content.js +3 -0
- package/es/utils/matrix.d.ts +10 -0
- package/es/utils/matrix.js +32 -0
- package/es/utils/measure-css-length.d.ts +1 -0
- package/es/utils/measure-css-length.js +23 -0
- package/es/utils/merge-locale.d.ts +1 -0
- package/es/utils/merge-locale.js +15 -0
- package/es/utils/native-props.d.ts +8 -0
- package/es/utils/native-props.js +31 -0
- package/es/utils/nearest.d.ts +1 -0
- package/es/utils/nearest.js +5 -0
- package/es/utils/noop.d.ts +1 -0
- package/es/utils/noop.js +1 -0
- package/es/utils/reduce-and-restore-motion.d.ts +4 -0
- package/es/utils/reduce-and-restore-motion.js +35 -0
- package/es/utils/render-imperatively.d.ts +13 -0
- package/es/utils/render-imperatively.js +199 -0
- package/es/utils/render-to-body.d.ts +2 -0
- package/es/utils/render-to-body.js +13 -0
- package/es/utils/render-to-container.d.ts +3 -0
- package/es/utils/render-to-container.js +10 -0
- package/es/utils/render.d.ts +9 -0
- package/es/utils/render.js +187 -0
- package/es/utils/replace-message.d.ts +1 -0
- package/es/utils/replace-message.js +7 -0
- package/es/utils/rubberband.d.ts +2 -0
- package/es/utils/rubberband.js +13 -0
- package/es/utils/should-render.d.ts +10 -0
- package/es/utils/should-render.js +12 -0
- package/es/utils/shuffle.d.ts +6 -0
- package/es/utils/shuffle.js +23 -0
- package/es/utils/sleep.d.ts +1 -0
- package/es/utils/sleep.js +5 -0
- package/es/utils/supports-passive.d.ts +1 -0
- package/es/utils/supports-passive.js +13 -0
- package/es/utils/to-css-length.d.ts +1 -0
- package/es/utils/to-css-length.js +3 -0
- package/es/utils/traverse-react-node.d.ts +2 -0
- package/es/utils/traverse-react-node.js +16 -0
- package/es/utils/tree.d.ts +1 -0
- package/es/utils/tree.js +18 -0
- package/es/utils/undefined-fallback.d.ts +3 -0
- package/es/utils/undefined-fallback.js +11 -0
- package/es/utils/use-drag-and-pinch.d.ts +1 -0
- package/es/utils/use-drag-and-pinch.js +2 -0
- package/es/utils/use-initialized.d.ts +1 -0
- package/es/utils/use-initialized.js +8 -0
- package/es/utils/use-inner-visible.d.ts +1 -0
- package/es/utils/use-inner-visible.js +11 -0
- package/es/utils/use-isomorphic-update-layout-effect.d.ts +2 -0
- package/es/utils/use-isomorphic-update-layout-effect.js +2 -0
- package/es/utils/use-lock-scroll.d.ts +2 -0
- package/es/utils/use-lock-scroll.js +78 -0
- package/es/utils/use-mutation-effect.d.ts +2 -0
- package/es/utils/use-mutation-effect.js +15 -0
- package/es/utils/use-props-value.d.ts +8 -0
- package/es/utils/use-props-value.js +24 -0
- package/es/utils/use-ref-state.d.ts +2 -0
- package/es/utils/use-ref-state.js +11 -0
- package/es/utils/use-resize-effect.d.ts +2 -0
- package/es/utils/use-resize-effect.js +23 -0
- package/es/utils/use-tab-list-scroll.d.ts +5 -0
- package/es/utils/use-tab-list-scroll.js +60 -0
- package/es/utils/use-touch.d.ts +17 -0
- package/es/utils/use-touch.js +63 -0
- package/es/utils/validate.d.ts +8 -0
- package/es/utils/validate.js +26 -0
- package/es/utils/with-cache.d.ts +1 -0
- package/es/utils/with-cache.js +9 -0
- package/es/utils/with-default-props.d.ts +2 -0
- package/es/utils/with-default-props.js +25 -0
- package/es/utils/with-func-props.d.ts +5 -0
- package/es/utils/with-func-props.js +32 -0
- package/es/utils/with-stop-propagation.d.ts +4 -0
- package/es/utils/with-stop-propagation.js +30 -0
- package/package.json +48 -20
- package/__vendor/__vendor.js +0 -1
- package/handRead/handRead.d.ts +0 -6
- package/handRead/handRead.js +0 -302
- package/handRead/index.d.ts +0 -25
- package/handRead/index.js +0 -11
- package/imageViewer/imageViewer.d.ts +0 -3
- package/imageViewer/imageViewer.js +0 -28
- package/imageViewer/index.js +0 -8
- package/index.d.ts +0 -6
- package/index.js +0 -14
- package/keyboard/index.d.ts +0 -13
- package/keyboard/index.js +0 -7
- package/keyboard/keyboard.d.ts +0 -2
- package/keyboard/keyboard.js +0 -87
- package/style.css +0 -1
- package/utils/isEqual.d.ts +0 -5
- /package/{imageViewer → cjs/components/imageViewer}/index.d.ts +0 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.renderImperatively = renderImperatively;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _renderToBody = require("./render-to-body");
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
12
|
+
__assign = Object.assign || function (t) {
|
|
13
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14
|
+
s = arguments[i];
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
return __assign.apply(this, arguments);
|
|
20
|
+
};
|
|
21
|
+
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) {
|
|
23
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
24
|
+
resolve(value);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) {
|
|
29
|
+
try {
|
|
30
|
+
step(generator.next(value));
|
|
31
|
+
} catch (e) {
|
|
32
|
+
reject(e);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function rejected(value) {
|
|
36
|
+
try {
|
|
37
|
+
step(generator["throw"](value));
|
|
38
|
+
} catch (e) {
|
|
39
|
+
reject(e);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function step(result) {
|
|
43
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
44
|
+
}
|
|
45
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
49
|
+
var _ = {
|
|
50
|
+
label: 0,
|
|
51
|
+
sent: function () {
|
|
52
|
+
if (t[0] & 1) throw t[1];
|
|
53
|
+
return t[1];
|
|
54
|
+
},
|
|
55
|
+
trys: [],
|
|
56
|
+
ops: []
|
|
57
|
+
},
|
|
58
|
+
f,
|
|
59
|
+
y,
|
|
60
|
+
t,
|
|
61
|
+
g;
|
|
62
|
+
return g = {
|
|
63
|
+
next: verb(0),
|
|
64
|
+
"throw": verb(1),
|
|
65
|
+
"return": verb(2)
|
|
66
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
67
|
+
return this;
|
|
68
|
+
}), g;
|
|
69
|
+
function verb(n) {
|
|
70
|
+
return function (v) {
|
|
71
|
+
return step([n, v]);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function step(op) {
|
|
75
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
76
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
77
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
78
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
79
|
+
switch (op[0]) {
|
|
80
|
+
case 0:
|
|
81
|
+
case 1:
|
|
82
|
+
t = op;
|
|
83
|
+
break;
|
|
84
|
+
case 4:
|
|
85
|
+
_.label++;
|
|
86
|
+
return {
|
|
87
|
+
value: op[1],
|
|
88
|
+
done: false
|
|
89
|
+
};
|
|
90
|
+
case 5:
|
|
91
|
+
_.label++;
|
|
92
|
+
y = op[1];
|
|
93
|
+
op = [0];
|
|
94
|
+
continue;
|
|
95
|
+
case 7:
|
|
96
|
+
op = _.ops.pop();
|
|
97
|
+
_.trys.pop();
|
|
98
|
+
continue;
|
|
99
|
+
default:
|
|
100
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
101
|
+
_ = 0;
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
105
|
+
_.label = op[1];
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
109
|
+
_.label = t[1];
|
|
110
|
+
t = op;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
if (t && _.label < t[2]) {
|
|
114
|
+
_.label = t[2];
|
|
115
|
+
_.ops.push(op);
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
if (t[2]) _.ops.pop();
|
|
119
|
+
_.trys.pop();
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
op = body.call(thisArg, _);
|
|
123
|
+
} catch (e) {
|
|
124
|
+
op = [6, e];
|
|
125
|
+
y = 0;
|
|
126
|
+
} finally {
|
|
127
|
+
f = t = 0;
|
|
128
|
+
}
|
|
129
|
+
if (op[0] & 5) throw op[1];
|
|
130
|
+
return {
|
|
131
|
+
value: op[0] ? op[1] : void 0,
|
|
132
|
+
done: true
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
function renderImperatively(element) {
|
|
137
|
+
var _this = this;
|
|
138
|
+
var Wrapper = _react.default.forwardRef(function (_, ref) {
|
|
139
|
+
var _a = (0, _react.useState)(false),
|
|
140
|
+
visible = _a[0],
|
|
141
|
+
setVisible = _a[1];
|
|
142
|
+
var closedRef = (0, _react.useRef)(false);
|
|
143
|
+
var _b = (0, _react.useState)(element),
|
|
144
|
+
elementToRender = _b[0],
|
|
145
|
+
setElementToRender = _b[1];
|
|
146
|
+
var keyRef = (0, _react.useRef)(0);
|
|
147
|
+
(0, _react.useEffect)(function () {
|
|
148
|
+
if (!closedRef.current) {
|
|
149
|
+
setVisible(true);
|
|
150
|
+
} else {
|
|
151
|
+
afterClose();
|
|
152
|
+
}
|
|
153
|
+
}, []);
|
|
154
|
+
function onClose() {
|
|
155
|
+
var _a, _b;
|
|
156
|
+
closedRef.current = true;
|
|
157
|
+
setVisible(false);
|
|
158
|
+
(_b = (_a = elementToRender.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
159
|
+
}
|
|
160
|
+
function afterClose() {
|
|
161
|
+
var _a, _b;
|
|
162
|
+
unmount();
|
|
163
|
+
(_b = (_a = elementToRender.props).afterClose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
164
|
+
}
|
|
165
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
166
|
+
return {
|
|
167
|
+
close: onClose,
|
|
168
|
+
replace: function (element) {
|
|
169
|
+
var _a, _b;
|
|
170
|
+
keyRef.current++;
|
|
171
|
+
(_b = (_a = elementToRender.props).afterClose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
172
|
+
setElementToRender(element);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
});
|
|
176
|
+
return _react.default.cloneElement(elementToRender, __assign(__assign({}, elementToRender.props), {
|
|
177
|
+
key: keyRef.current,
|
|
178
|
+
visible: visible,
|
|
179
|
+
onClose: onClose,
|
|
180
|
+
afterClose: afterClose
|
|
181
|
+
}));
|
|
182
|
+
});
|
|
183
|
+
var wrapperRef = _react.default.createRef();
|
|
184
|
+
var unmount = (0, _renderToBody.renderToBody)(_react.default.createElement(Wrapper, {
|
|
185
|
+
ref: wrapperRef
|
|
186
|
+
}));
|
|
187
|
+
return {
|
|
188
|
+
close: function () {
|
|
189
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
190
|
+
var _a;
|
|
191
|
+
return __generator(this, function (_b) {
|
|
192
|
+
if (!wrapperRef.current) {
|
|
193
|
+
// it means the wrapper is not mounted yet, call `unmount` directly
|
|
194
|
+
unmount();
|
|
195
|
+
} else {
|
|
196
|
+
(_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
197
|
+
}
|
|
198
|
+
return [2 /*return*/];
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
},
|
|
202
|
+
replace: function (element) {
|
|
203
|
+
var _a;
|
|
204
|
+
(_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.replace(element);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.renderToBody = renderToBody;
|
|
7
|
+
var _render = require("./render");
|
|
8
|
+
function renderToBody(element) {
|
|
9
|
+
var container = document.createElement('div');
|
|
10
|
+
document.body.appendChild(container);
|
|
11
|
+
function unmount() {
|
|
12
|
+
var unmountResult = (0, _render.unmount)(container);
|
|
13
|
+
if (unmountResult && container.parentNode) {
|
|
14
|
+
container.parentNode.removeChild(container);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
(0, _render.render)(element, container);
|
|
18
|
+
return unmount;
|
|
19
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
export type GetContainer = HTMLElement | (() => HTMLElement) | null;
|
|
3
|
+
export declare function renderToContainer(getContainer: GetContainer, node: ReactElement): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.renderToContainer = renderToContainer;
|
|
7
|
+
var _reactDom = require("react-dom");
|
|
8
|
+
var _getContainer = require("./get-container");
|
|
9
|
+
var _canUseDom = require("./can-use-dom");
|
|
10
|
+
function renderToContainer(getContainer, node) {
|
|
11
|
+
if (_canUseDom.canUseDom && getContainer) {
|
|
12
|
+
var container = (0, _getContainer.resolveContainer)(getContainer);
|
|
13
|
+
return (0, _reactDom.createPortal)(node, container);
|
|
14
|
+
}
|
|
15
|
+
return node;
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { Root } from 'react-dom/client';
|
|
3
|
+
declare const MARK = "__antd_mobile_root__";
|
|
4
|
+
type ContainerType = (Element | DocumentFragment) & {
|
|
5
|
+
[MARK]?: Root;
|
|
6
|
+
};
|
|
7
|
+
export declare function render(node: ReactElement, container: ContainerType): void;
|
|
8
|
+
export declare function unmount(container: ContainerType): boolean | Promise<void>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.render = render;
|
|
7
|
+
exports.unmount = unmount;
|
|
8
|
+
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
12
|
+
__assign = Object.assign || function (t) {
|
|
13
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14
|
+
s = arguments[i];
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
return __assign.apply(this, arguments);
|
|
20
|
+
};
|
|
21
|
+
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) {
|
|
23
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
24
|
+
resolve(value);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) {
|
|
29
|
+
try {
|
|
30
|
+
step(generator.next(value));
|
|
31
|
+
} catch (e) {
|
|
32
|
+
reject(e);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function rejected(value) {
|
|
36
|
+
try {
|
|
37
|
+
step(generator["throw"](value));
|
|
38
|
+
} catch (e) {
|
|
39
|
+
reject(e);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function step(result) {
|
|
43
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
44
|
+
}
|
|
45
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
49
|
+
var _ = {
|
|
50
|
+
label: 0,
|
|
51
|
+
sent: function () {
|
|
52
|
+
if (t[0] & 1) throw t[1];
|
|
53
|
+
return t[1];
|
|
54
|
+
},
|
|
55
|
+
trys: [],
|
|
56
|
+
ops: []
|
|
57
|
+
},
|
|
58
|
+
f,
|
|
59
|
+
y,
|
|
60
|
+
t,
|
|
61
|
+
g;
|
|
62
|
+
return g = {
|
|
63
|
+
next: verb(0),
|
|
64
|
+
"throw": verb(1),
|
|
65
|
+
"return": verb(2)
|
|
66
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
67
|
+
return this;
|
|
68
|
+
}), g;
|
|
69
|
+
function verb(n) {
|
|
70
|
+
return function (v) {
|
|
71
|
+
return step([n, v]);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function step(op) {
|
|
75
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
76
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
77
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
78
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
79
|
+
switch (op[0]) {
|
|
80
|
+
case 0:
|
|
81
|
+
case 1:
|
|
82
|
+
t = op;
|
|
83
|
+
break;
|
|
84
|
+
case 4:
|
|
85
|
+
_.label++;
|
|
86
|
+
return {
|
|
87
|
+
value: op[1],
|
|
88
|
+
done: false
|
|
89
|
+
};
|
|
90
|
+
case 5:
|
|
91
|
+
_.label++;
|
|
92
|
+
y = op[1];
|
|
93
|
+
op = [0];
|
|
94
|
+
continue;
|
|
95
|
+
case 7:
|
|
96
|
+
op = _.ops.pop();
|
|
97
|
+
_.trys.pop();
|
|
98
|
+
continue;
|
|
99
|
+
default:
|
|
100
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
101
|
+
_ = 0;
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
105
|
+
_.label = op[1];
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
109
|
+
_.label = t[1];
|
|
110
|
+
t = op;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
if (t && _.label < t[2]) {
|
|
114
|
+
_.label = t[2];
|
|
115
|
+
_.ops.push(op);
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
if (t[2]) _.ops.pop();
|
|
119
|
+
_.trys.pop();
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
op = body.call(thisArg, _);
|
|
123
|
+
} catch (e) {
|
|
124
|
+
op = [6, e];
|
|
125
|
+
y = 0;
|
|
126
|
+
} finally {
|
|
127
|
+
f = t = 0;
|
|
128
|
+
}
|
|
129
|
+
if (op[0] & 5) throw op[1];
|
|
130
|
+
return {
|
|
131
|
+
value: op[0] ? op[1] : void 0,
|
|
132
|
+
done: true
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
// Let compiler not to search module usage
|
|
137
|
+
var fullClone = __assign({}, ReactDOM);
|
|
138
|
+
var version = fullClone.version,
|
|
139
|
+
reactRender = fullClone.render,
|
|
140
|
+
unmountComponentAtNode = fullClone.unmountComponentAtNode;
|
|
141
|
+
var createRoot;
|
|
142
|
+
try {
|
|
143
|
+
var mainVersion = Number((version || '').split('.')[0]);
|
|
144
|
+
if (mainVersion >= 18 && fullClone.createRoot) {
|
|
145
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
146
|
+
createRoot = fullClone.createRoot;
|
|
147
|
+
}
|
|
148
|
+
} catch (e) {
|
|
149
|
+
// Do nothing;
|
|
150
|
+
}
|
|
151
|
+
function toggleWarning(skip) {
|
|
152
|
+
var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = fullClone.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
153
|
+
if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === 'object') {
|
|
154
|
+
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
var MARK = '__antd_mobile_root__';
|
|
158
|
+
function legacyRender(node, container) {
|
|
159
|
+
reactRender(node, container);
|
|
160
|
+
}
|
|
161
|
+
function concurrentRender(node, container) {
|
|
162
|
+
toggleWarning(true);
|
|
163
|
+
var root = container[MARK] || createRoot(container);
|
|
164
|
+
toggleWarning(false);
|
|
165
|
+
root.render(node);
|
|
166
|
+
container[MARK] = root;
|
|
167
|
+
}
|
|
168
|
+
function render(node, container) {
|
|
169
|
+
if (createRoot) {
|
|
170
|
+
concurrentRender(node, container);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
legacyRender(node, container);
|
|
174
|
+
}
|
|
175
|
+
// ========================== Unmount =========================
|
|
176
|
+
function legacyUnmount(container) {
|
|
177
|
+
return unmountComponentAtNode(container);
|
|
178
|
+
}
|
|
179
|
+
function concurrentUnmount(container) {
|
|
180
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
181
|
+
return __generator(this, function (_a) {
|
|
182
|
+
// Delay to unmount to avoid React 18 sync warning
|
|
183
|
+
return [2 /*return*/, Promise.resolve().then(function () {
|
|
184
|
+
var _a;
|
|
185
|
+
(_a = container[MARK]) === null || _a === void 0 ? void 0 : _a.unmount();
|
|
186
|
+
delete container[MARK];
|
|
187
|
+
})];
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
function unmount(container) {
|
|
192
|
+
if (createRoot) {
|
|
193
|
+
return concurrentUnmount(container);
|
|
194
|
+
}
|
|
195
|
+
return legacyUnmount(container);
|
|
196
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function replaceMessage(template: string, kv: Record<string, string>): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.replaceMessage = replaceMessage;
|
|
7
|
+
// 移植自 field-form https://github.com/react-component/field-form/blob/master/src/utils/validateUtil.ts#L21
|
|
8
|
+
function replaceMessage(template, kv) {
|
|
9
|
+
return template.replace(/\$\{\w+\}/g, function (str) {
|
|
10
|
+
var key = str.slice(2, -1);
|
|
11
|
+
return kv[key];
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.rubberband = rubberband;
|
|
7
|
+
exports.rubberbandIfOutOfBounds = rubberbandIfOutOfBounds;
|
|
8
|
+
var _bound = require("./bound");
|
|
9
|
+
function rubberband(distance, dimension, constant) {
|
|
10
|
+
return distance * dimension * constant / (dimension + constant * distance);
|
|
11
|
+
}
|
|
12
|
+
function rubberbandIfOutOfBounds(position, min, max, dimension, constant) {
|
|
13
|
+
if (constant === void 0) {
|
|
14
|
+
constant = 0.15;
|
|
15
|
+
}
|
|
16
|
+
if (constant === 0) return (0, _bound.bound)(position, min, max);
|
|
17
|
+
if (position < min) return -rubberband(min - position, dimension, constant) + min;
|
|
18
|
+
if (position > max) return +rubberband(position - max, dimension, constant) + max;
|
|
19
|
+
return position;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FC, ReactElement } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
active: boolean;
|
|
4
|
+
forceRender?: boolean;
|
|
5
|
+
destroyOnClose?: boolean;
|
|
6
|
+
children: ReactElement;
|
|
7
|
+
}
|
|
8
|
+
export declare const ShouldRender: FC<Props>;
|
|
9
|
+
export declare function useShouldRender(active: boolean, forceRender?: boolean, destroyOnClose?: boolean): boolean;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ShouldRender = void 0;
|
|
7
|
+
exports.useShouldRender = useShouldRender;
|
|
8
|
+
var _useInitialized = require("./use-initialized");
|
|
9
|
+
var ShouldRender = function (props) {
|
|
10
|
+
var shouldRender = useShouldRender(props.active, props.forceRender, props.destroyOnClose);
|
|
11
|
+
return shouldRender ? props.children : null;
|
|
12
|
+
};
|
|
13
|
+
exports.ShouldRender = ShouldRender;
|
|
14
|
+
function useShouldRender(active, forceRender, destroyOnClose) {
|
|
15
|
+
var initialized = (0, _useInitialized.useInitialized)(active);
|
|
16
|
+
if (forceRender) return true;
|
|
17
|
+
if (active) return true;
|
|
18
|
+
if (!initialized) return false;
|
|
19
|
+
return !destroyOnClose;
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.shuffle = shuffle;
|
|
7
|
+
/**
|
|
8
|
+
* 数组打乱
|
|
9
|
+
* @param array 任意数组
|
|
10
|
+
* @returns any[] 打乱后的数组
|
|
11
|
+
*/
|
|
12
|
+
var __spreadArray = void 0 && (void 0).__spreadArray || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
21
|
+
function shuffle(array) {
|
|
22
|
+
var _a;
|
|
23
|
+
var result = __spreadArray([], array, true);
|
|
24
|
+
for (var i = result.length; i > 0; i--) {
|
|
25
|
+
var j = Math.floor(Math.random() * i);
|
|
26
|
+
_a = [result[j], result[i - 1]], result[i - 1] = _a[0], result[j] = _a[1];
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sleep: (time: number) => Promise<unknown>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sleep = void 0;
|
|
7
|
+
var sleep = function (time) {
|
|
8
|
+
return new Promise(function (resolve) {
|
|
9
|
+
return setTimeout(resolve, time);
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
exports.sleep = sleep;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare let supportsPassive: boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.supportsPassive = void 0;
|
|
7
|
+
var _canUseDom = require("./can-use-dom");
|
|
8
|
+
var supportsPassive = exports.supportsPassive = false;
|
|
9
|
+
if (_canUseDom.canUseDom) {
|
|
10
|
+
try {
|
|
11
|
+
var opts = {};
|
|
12
|
+
Object.defineProperty(opts, 'passive', {
|
|
13
|
+
get: function () {
|
|
14
|
+
exports.supportsPassive = supportsPassive = true;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
window.addEventListener('test-passive', null, opts);
|
|
18
|
+
} catch (e) {}
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toCSSLength(val: string | number): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.traverseReactNode = traverseReactNode;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactIs = require("react-is");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function traverseReactNode(children, fn) {
|
|
11
|
+
var i = 0;
|
|
12
|
+
function handle(target) {
|
|
13
|
+
_react.default.Children.forEach(target, function (child) {
|
|
14
|
+
if (!(0, _reactIs.isFragment)(child)) {
|
|
15
|
+
fn(child, i);
|
|
16
|
+
i += 1;
|
|
17
|
+
} else {
|
|
18
|
+
handle(child.props.children);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
handle(children);
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getTreeDeep(treeData: any[], childrenName?: string): number;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getTreeDeep = getTreeDeep;
|
|
7
|
+
// 找到树的深度
|
|
8
|
+
function getTreeDeep(treeData, childrenName) {
|
|
9
|
+
if (childrenName === void 0) {
|
|
10
|
+
childrenName = 'children';
|
|
11
|
+
}
|
|
12
|
+
var walker = function (tree) {
|
|
13
|
+
var deep = 0;
|
|
14
|
+
tree.forEach(function (item) {
|
|
15
|
+
if (item[childrenName]) {
|
|
16
|
+
deep = Math.max(deep, walker(item[childrenName]) + 1);
|
|
17
|
+
} else {
|
|
18
|
+
deep = Math.max(deep, 1);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return deep;
|
|
22
|
+
};
|
|
23
|
+
return walker(treeData);
|
|
24
|
+
}
|