@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,3 @@
|
|
|
1
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T): T;
|
|
2
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T | undefined, c: T): T;
|
|
3
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T | undefined, c: T | undefined, d: T): T;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.undefinedFallback = undefinedFallback;
|
|
7
|
+
function undefinedFallback() {
|
|
8
|
+
var items = [];
|
|
9
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
10
|
+
items[_i] = arguments[_i];
|
|
11
|
+
}
|
|
12
|
+
var i;
|
|
13
|
+
for (i = 0; i < items.length; i++) {
|
|
14
|
+
if (items[i] !== undefined) break;
|
|
15
|
+
}
|
|
16
|
+
return items[i];
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useDragAndPinch: <Config extends import("@use-gesture/react").UserGestureConfig = import("@use-gesture/react").UserGestureConfig>(_handlers: Partial<import("@use-gesture/react").NativeHandlers<import("@use-gesture/react").EventTypes> & import("@use-gesture/react").UserHandlers<import("@use-gesture/react").EventTypes>>, _config?: Config | undefined) => Config["target"] extends object ? void : (...args: any[]) => import("@use-gesture/react/dist/declarations/src/types").ReactDOMAttributes;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDragAndPinch = void 0;
|
|
7
|
+
var _react = require("@use-gesture/react");
|
|
8
|
+
var useDragAndPinch = exports.useDragAndPinch = (0, _react.createUseGesture)([_react.dragAction, _react.pinchAction]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useInitialized(check?: boolean): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useInitialized = useInitialized;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
function useInitialized(check) {
|
|
9
|
+
var initializedRef = (0, _react.useRef)(check);
|
|
10
|
+
if (check) {
|
|
11
|
+
initializedRef.current = true;
|
|
12
|
+
}
|
|
13
|
+
return !!initializedRef.current;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useInnerVisible(outerVisible: boolean): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useInnerVisible = useInnerVisible;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _ahooks = require("ahooks");
|
|
9
|
+
function useInnerVisible(outerVisible) {
|
|
10
|
+
var _a = (0, _react.useState)(outerVisible),
|
|
11
|
+
innerVisible = _a[0],
|
|
12
|
+
setInnerVisible = _a[1];
|
|
13
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(function () {
|
|
14
|
+
setInnerVisible(outerVisible);
|
|
15
|
+
}, [outerVisible]);
|
|
16
|
+
return innerVisible;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useIsomorphicUpdateLayoutEffect = void 0;
|
|
7
|
+
var _ahooks = require("ahooks");
|
|
8
|
+
var useIsomorphicUpdateLayoutEffect = exports.useIsomorphicUpdateLayoutEffect = (0, _ahooks.createUpdateEffect)(_ahooks.useIsomorphicLayoutEffect);
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useLockScroll = useLockScroll;
|
|
7
|
+
var _useTouch = require("./use-touch");
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _getScrollParent = require("./get-scroll-parent");
|
|
10
|
+
var _supportsPassive = require("./supports-passive");
|
|
11
|
+
var totalLockCount = 0;
|
|
12
|
+
var BODY_LOCK_CLASS = 'adm-overflow-hidden';
|
|
13
|
+
function getScrollableElement(el) {
|
|
14
|
+
var current = el === null || el === void 0 ? void 0 : el.parentElement;
|
|
15
|
+
while (current) {
|
|
16
|
+
if (current.clientHeight < current.scrollHeight) {
|
|
17
|
+
return current;
|
|
18
|
+
}
|
|
19
|
+
current = current.parentElement;
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
// 移植自vant:https://github.com/youzan/vant/blob/HEAD/src/composables/use-lock-scroll.ts
|
|
24
|
+
function useLockScroll(rootRef, shouldLock) {
|
|
25
|
+
var touch = (0, _useTouch.useTouch)();
|
|
26
|
+
var onTouchMove = function (event) {
|
|
27
|
+
touch.move(event);
|
|
28
|
+
var direction = touch.deltaY.current > 0 ? '10' : '01';
|
|
29
|
+
var el = (0, _getScrollParent.getScrollParent)(event.target, rootRef.current);
|
|
30
|
+
if (!el) return;
|
|
31
|
+
// This has perf cost but we have to compatible with iOS 12
|
|
32
|
+
if (shouldLock === 'strict') {
|
|
33
|
+
var scrollableParent = getScrollableElement(event.target);
|
|
34
|
+
if (scrollableParent === document.body || scrollableParent === document.documentElement) {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
var scrollHeight = el.scrollHeight,
|
|
40
|
+
offsetHeight = el.offsetHeight,
|
|
41
|
+
scrollTop = el.scrollTop;
|
|
42
|
+
var height = el.getBoundingClientRect().height;
|
|
43
|
+
var status = '11';
|
|
44
|
+
if (scrollTop === 0) {
|
|
45
|
+
status = offsetHeight >= scrollHeight ? '00' : '01';
|
|
46
|
+
} else if (scrollHeight <= Math.round(height + scrollTop)) {
|
|
47
|
+
status = '10';
|
|
48
|
+
}
|
|
49
|
+
if (status !== '11' && touch.isVertical() && !(parseInt(status, 2) & parseInt(direction, 2))) {
|
|
50
|
+
if (event.cancelable && _supportsPassive.supportsPassive) {
|
|
51
|
+
// https://github.com/ant-design/ant-design-mobile/issues/6282
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var lock = function () {
|
|
57
|
+
document.addEventListener('touchstart', touch.start);
|
|
58
|
+
document.addEventListener('touchmove', onTouchMove, _supportsPassive.supportsPassive ? {
|
|
59
|
+
passive: false
|
|
60
|
+
} : false);
|
|
61
|
+
if (!totalLockCount) {
|
|
62
|
+
document.body.classList.add(BODY_LOCK_CLASS);
|
|
63
|
+
}
|
|
64
|
+
totalLockCount++;
|
|
65
|
+
};
|
|
66
|
+
var unlock = function () {
|
|
67
|
+
if (totalLockCount) {
|
|
68
|
+
document.removeEventListener('touchstart', touch.start);
|
|
69
|
+
document.removeEventListener('touchmove', onTouchMove);
|
|
70
|
+
totalLockCount--;
|
|
71
|
+
if (!totalLockCount) {
|
|
72
|
+
document.body.classList.remove(BODY_LOCK_CLASS);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
(0, _react.useEffect)(function () {
|
|
77
|
+
if (shouldLock) {
|
|
78
|
+
lock();
|
|
79
|
+
return function () {
|
|
80
|
+
unlock();
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}, [shouldLock]);
|
|
84
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useMutationEffect = useMutationEffect;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _ahooks = require("ahooks");
|
|
9
|
+
function useMutationEffect(effect, targetRef, options) {
|
|
10
|
+
var fn = (0, _ahooks.useMemoizedFn)(effect);
|
|
11
|
+
(0, _react.useEffect)(function () {
|
|
12
|
+
var observer = new MutationObserver(function () {
|
|
13
|
+
fn();
|
|
14
|
+
});
|
|
15
|
+
if (!targetRef.current) return;
|
|
16
|
+
observer.observe(targetRef.current, options);
|
|
17
|
+
return function () {
|
|
18
|
+
observer.disconnect();
|
|
19
|
+
};
|
|
20
|
+
}, [targetRef]);
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SetStateAction } from 'react';
|
|
2
|
+
type Options<T> = {
|
|
3
|
+
value?: T;
|
|
4
|
+
defaultValue: T;
|
|
5
|
+
onChange?: (v: T) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function usePropsValue<T>(options: Options<T>): readonly [T, (v: SetStateAction<T>, forceTrigger?: boolean) => void];
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePropsValue = usePropsValue;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _ahooks = require("ahooks");
|
|
9
|
+
function usePropsValue(options) {
|
|
10
|
+
var value = options.value,
|
|
11
|
+
defaultValue = options.defaultValue,
|
|
12
|
+
onChange = options.onChange;
|
|
13
|
+
var update = (0, _ahooks.useUpdate)();
|
|
14
|
+
var stateRef = (0, _react.useRef)(value !== undefined ? value : defaultValue);
|
|
15
|
+
if (value !== undefined) {
|
|
16
|
+
stateRef.current = value;
|
|
17
|
+
}
|
|
18
|
+
var setState = (0, _ahooks.useMemoizedFn)(function (v, forceTrigger) {
|
|
19
|
+
if (forceTrigger === void 0) {
|
|
20
|
+
forceTrigger = false;
|
|
21
|
+
}
|
|
22
|
+
// `forceTrigger` means trigger `onChange` even if `v` is the same as `stateRef.current`
|
|
23
|
+
var nextValue = typeof v === 'function' ? v(stateRef.current) : v;
|
|
24
|
+
if (!forceTrigger && nextValue === stateRef.current) return;
|
|
25
|
+
stateRef.current = nextValue;
|
|
26
|
+
update();
|
|
27
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(nextValue);
|
|
28
|
+
});
|
|
29
|
+
return [stateRef.current, setState];
|
|
30
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useRefState = useRefState;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
function useRefState(initialState) {
|
|
9
|
+
var _a = (0, _react.useState)(initialState),
|
|
10
|
+
state = _a[0],
|
|
11
|
+
setState = _a[1];
|
|
12
|
+
var ref = (0, _react.useRef)(state);
|
|
13
|
+
(0, _react.useEffect)(function () {
|
|
14
|
+
ref.current = state;
|
|
15
|
+
}, [state]);
|
|
16
|
+
return [state, setState, ref];
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useResizeEffect = useResizeEffect;
|
|
7
|
+
var _ahooks = require("ahooks");
|
|
8
|
+
function useResizeEffect(effect, targetRef) {
|
|
9
|
+
var fn = (0, _ahooks.useMemoizedFn)(effect);
|
|
10
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(function () {
|
|
11
|
+
var target = targetRef.current;
|
|
12
|
+
if (!target) return;
|
|
13
|
+
if (window.ResizeObserver) {
|
|
14
|
+
var animationFrame_1;
|
|
15
|
+
var observer_1 = new ResizeObserver(function () {
|
|
16
|
+
animationFrame_1 = window.requestAnimationFrame(function () {
|
|
17
|
+
return fn(target);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
observer_1.observe(target);
|
|
21
|
+
return function () {
|
|
22
|
+
window.cancelAnimationFrame(animationFrame_1);
|
|
23
|
+
observer_1.disconnect();
|
|
24
|
+
};
|
|
25
|
+
} else {
|
|
26
|
+
fn(target);
|
|
27
|
+
}
|
|
28
|
+
}, [targetRef]);
|
|
29
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useTabListScroll = void 0;
|
|
7
|
+
var _web = require("@react-spring/web");
|
|
8
|
+
var _useMutationEffect = require("./use-mutation-effect");
|
|
9
|
+
var _bound = require("./bound");
|
|
10
|
+
var _ahooks = require("ahooks");
|
|
11
|
+
var _useIsomorphicUpdateLayoutEffect = require("./use-isomorphic-update-layout-effect");
|
|
12
|
+
var useTabListScroll = function (targetRef, activeIndex) {
|
|
13
|
+
var _a = (0, _web.useSpring)(function () {
|
|
14
|
+
return {
|
|
15
|
+
scrollLeft: 0,
|
|
16
|
+
config: {
|
|
17
|
+
tension: 300,
|
|
18
|
+
clamp: true
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}),
|
|
22
|
+
scrollLeft = _a[0].scrollLeft,
|
|
23
|
+
api = _a[1];
|
|
24
|
+
function animate(immediate) {
|
|
25
|
+
if (immediate === void 0) {
|
|
26
|
+
immediate = false;
|
|
27
|
+
}
|
|
28
|
+
var container = targetRef.current;
|
|
29
|
+
if (!container) return;
|
|
30
|
+
if (activeIndex === undefined) return;
|
|
31
|
+
var activeTabWrapper = container.children.item(activeIndex);
|
|
32
|
+
var activeTab = activeTabWrapper.children.item(0);
|
|
33
|
+
var activeTabLeft = activeTab.offsetLeft;
|
|
34
|
+
var activeTabWidth = activeTab.offsetWidth;
|
|
35
|
+
var containerWidth = container.offsetWidth;
|
|
36
|
+
var containerScrollWidth = container.scrollWidth;
|
|
37
|
+
var containerScrollLeft = container.scrollLeft;
|
|
38
|
+
var maxScrollDistance = containerScrollWidth - containerWidth;
|
|
39
|
+
if (maxScrollDistance <= 0) return;
|
|
40
|
+
var nextScrollLeft = (0, _bound.bound)(activeTabLeft - (containerWidth - activeTabWidth) / 2, 0, containerScrollWidth - containerWidth);
|
|
41
|
+
api.start({
|
|
42
|
+
scrollLeft: nextScrollLeft,
|
|
43
|
+
from: {
|
|
44
|
+
scrollLeft: containerScrollLeft
|
|
45
|
+
},
|
|
46
|
+
immediate: immediate && !scrollLeft.isAnimating
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(function () {
|
|
50
|
+
animate(true);
|
|
51
|
+
}, []);
|
|
52
|
+
(0, _useIsomorphicUpdateLayoutEffect.useIsomorphicUpdateLayoutEffect)(function () {
|
|
53
|
+
animate();
|
|
54
|
+
}, [activeIndex]);
|
|
55
|
+
(0, _useMutationEffect.useMutationEffect)(function () {
|
|
56
|
+
animate(true);
|
|
57
|
+
}, targetRef, {
|
|
58
|
+
subtree: true,
|
|
59
|
+
childList: true,
|
|
60
|
+
characterData: true
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
scrollLeft: scrollLeft,
|
|
64
|
+
animate: animate
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
exports.useTabListScroll = useTabListScroll;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type Direction = '' | 'vertical' | 'horizontal';
|
|
3
|
+
export declare function useTouch(): {
|
|
4
|
+
move: EventListener;
|
|
5
|
+
start: EventListener;
|
|
6
|
+
reset: () => void;
|
|
7
|
+
startX: import("react").MutableRefObject<number>;
|
|
8
|
+
startY: import("react").MutableRefObject<number>;
|
|
9
|
+
deltaX: import("react").MutableRefObject<number>;
|
|
10
|
+
deltaY: import("react").MutableRefObject<number>;
|
|
11
|
+
offsetX: import("react").MutableRefObject<number>;
|
|
12
|
+
offsetY: import("react").MutableRefObject<number>;
|
|
13
|
+
direction: import("react").MutableRefObject<Direction>;
|
|
14
|
+
isVertical: () => boolean;
|
|
15
|
+
isHorizontal: () => boolean;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useTouch = useTouch;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var MIN_DISTANCE = 10;
|
|
9
|
+
function getDirection(x, y) {
|
|
10
|
+
if (x > y && x > MIN_DISTANCE) {
|
|
11
|
+
return 'horizontal';
|
|
12
|
+
}
|
|
13
|
+
if (y > x && y > MIN_DISTANCE) {
|
|
14
|
+
return 'vertical';
|
|
15
|
+
}
|
|
16
|
+
return '';
|
|
17
|
+
}
|
|
18
|
+
function useTouch() {
|
|
19
|
+
var startX = (0, _react.useRef)(0);
|
|
20
|
+
var startY = (0, _react.useRef)(0);
|
|
21
|
+
var deltaX = (0, _react.useRef)(0);
|
|
22
|
+
var deltaY = (0, _react.useRef)(0);
|
|
23
|
+
var offsetX = (0, _react.useRef)(0);
|
|
24
|
+
var offsetY = (0, _react.useRef)(0);
|
|
25
|
+
var direction = (0, _react.useRef)('');
|
|
26
|
+
var isVertical = function () {
|
|
27
|
+
return direction.current === 'vertical';
|
|
28
|
+
};
|
|
29
|
+
var isHorizontal = function () {
|
|
30
|
+
return direction.current === 'horizontal';
|
|
31
|
+
};
|
|
32
|
+
var reset = function () {
|
|
33
|
+
deltaX.current = 0;
|
|
34
|
+
deltaY.current = 0;
|
|
35
|
+
offsetX.current = 0;
|
|
36
|
+
offsetY.current = 0;
|
|
37
|
+
direction.current = '';
|
|
38
|
+
};
|
|
39
|
+
var start = function (event) {
|
|
40
|
+
reset();
|
|
41
|
+
startX.current = event.touches[0].clientX;
|
|
42
|
+
startY.current = event.touches[0].clientY;
|
|
43
|
+
};
|
|
44
|
+
var move = function (event) {
|
|
45
|
+
var touch = event.touches[0];
|
|
46
|
+
// Fix: Safari back will set clientX to negative number
|
|
47
|
+
deltaX.current = touch.clientX < 0 ? 0 : touch.clientX - startX.current;
|
|
48
|
+
deltaY.current = touch.clientY - startY.current;
|
|
49
|
+
offsetX.current = Math.abs(deltaX.current);
|
|
50
|
+
offsetY.current = Math.abs(deltaY.current);
|
|
51
|
+
if (!direction.current) {
|
|
52
|
+
direction.current = getDirection(offsetX.current, offsetY.current);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
move: move,
|
|
57
|
+
start: start,
|
|
58
|
+
reset: reset,
|
|
59
|
+
startX: startX,
|
|
60
|
+
startY: startY,
|
|
61
|
+
deltaX: deltaX,
|
|
62
|
+
deltaY: deltaY,
|
|
63
|
+
offsetX: offsetX,
|
|
64
|
+
offsetY: offsetY,
|
|
65
|
+
direction: direction,
|
|
66
|
+
isVertical: isVertical,
|
|
67
|
+
isHorizontal: isHorizontal
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function isDef<T>(val: T): val is NonNullable<T>;
|
|
2
|
+
export declare function isObject(val: unknown): val is Record<any, any>;
|
|
3
|
+
export declare function isPromise(obj: unknown): obj is Promise<unknown>;
|
|
4
|
+
export declare function isDate(val: unknown): val is Date;
|
|
5
|
+
export declare function isMobile(value: string): boolean;
|
|
6
|
+
export declare function isNumeric(val: string | number): val is string;
|
|
7
|
+
export declare function isAndroid(): boolean;
|
|
8
|
+
export declare function isIOS(): boolean;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isAndroid = isAndroid;
|
|
7
|
+
exports.isDate = isDate;
|
|
8
|
+
exports.isDef = isDef;
|
|
9
|
+
exports.isIOS = isIOS;
|
|
10
|
+
exports.isMobile = isMobile;
|
|
11
|
+
exports.isNumeric = isNumeric;
|
|
12
|
+
exports.isObject = isObject;
|
|
13
|
+
exports.isPromise = isPromise;
|
|
14
|
+
var _canUseDom = require("./can-use-dom");
|
|
15
|
+
function isDef(val) {
|
|
16
|
+
return val !== undefined && val !== null;
|
|
17
|
+
}
|
|
18
|
+
function isObject(val) {
|
|
19
|
+
return val !== null && typeof val === 'object';
|
|
20
|
+
}
|
|
21
|
+
function isPromise(obj) {
|
|
22
|
+
return !!obj && typeof obj === 'object' && typeof obj.then === 'function';
|
|
23
|
+
}
|
|
24
|
+
function isDate(val) {
|
|
25
|
+
return Object.prototype.toString.call(val) === '[object Date]' && !Number.isNaN(val.getTime());
|
|
26
|
+
}
|
|
27
|
+
function isMobile(value) {
|
|
28
|
+
value = value.replace(/[^-|\d]/g, '');
|
|
29
|
+
return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
|
|
30
|
+
}
|
|
31
|
+
function isNumeric(val) {
|
|
32
|
+
return typeof val === 'number' || /^\d+(\.\d+)?$/.test(val);
|
|
33
|
+
}
|
|
34
|
+
function isAndroid() {
|
|
35
|
+
return _canUseDom.canUseDom ? /android/.test(navigator.userAgent.toLowerCase()) : false;
|
|
36
|
+
}
|
|
37
|
+
function isIOS() {
|
|
38
|
+
return _canUseDom.canUseDom ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function withCache<T>(generate: () => T): () => T;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withCache = withCache;
|
|
7
|
+
function withCache(generate) {
|
|
8
|
+
var cache = null;
|
|
9
|
+
return function () {
|
|
10
|
+
if (cache === null) {
|
|
11
|
+
cache = generate();
|
|
12
|
+
}
|
|
13
|
+
return cache;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.mergeProps = mergeProps;
|
|
7
|
+
var _assignWith = _interopRequireDefault(require("lodash/assignWith"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
10
|
+
__assign = Object.assign || function (t) {
|
|
11
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12
|
+
s = arguments[i];
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
14
|
+
}
|
|
15
|
+
return t;
|
|
16
|
+
};
|
|
17
|
+
return __assign.apply(this, arguments);
|
|
18
|
+
};
|
|
19
|
+
function mergeProps() {
|
|
20
|
+
var items = [];
|
|
21
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
22
|
+
items[_i] = arguments[_i];
|
|
23
|
+
}
|
|
24
|
+
function customizer(objValue, srcValue) {
|
|
25
|
+
return srcValue === undefined ? objValue : srcValue;
|
|
26
|
+
}
|
|
27
|
+
var ret = __assign({}, items[0]);
|
|
28
|
+
for (var i = 1; i < items.length; i++) {
|
|
29
|
+
ret = (0, _assignWith.default)(ret, items[i], customizer);
|
|
30
|
+
}
|
|
31
|
+
return ret;
|
|
32
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.mergeFuncProps = mergeFuncProps;
|
|
7
|
+
var __spreadArray = void 0 && (void 0).__spreadArray || function (to, from, pack) {
|
|
8
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
9
|
+
if (ar || !(i in from)) {
|
|
10
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
11
|
+
ar[i] = from[i];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
15
|
+
};
|
|
16
|
+
function mergeFuncProps(p1, p2) {
|
|
17
|
+
var p1Keys = Object.keys(p1);
|
|
18
|
+
var p2Keys = Object.keys(p2);
|
|
19
|
+
var keys = new Set(__spreadArray(__spreadArray([], p1Keys, true), p2Keys, true));
|
|
20
|
+
var res = {};
|
|
21
|
+
keys.forEach(function (key) {
|
|
22
|
+
var p1Value = p1[key];
|
|
23
|
+
var p2Value = p2[key];
|
|
24
|
+
if (typeof p1Value === 'function' && typeof p2Value === 'function') {
|
|
25
|
+
res[key] = function () {
|
|
26
|
+
var args = [];
|
|
27
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
28
|
+
args[_i] = arguments[_i];
|
|
29
|
+
}
|
|
30
|
+
p1Value.apply(void 0, args);
|
|
31
|
+
p2Value.apply(void 0, args);
|
|
32
|
+
};
|
|
33
|
+
} else {
|
|
34
|
+
res[key] = p1Value || p2Value;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
export type PropagationEvent = 'click';
|
|
4
|
+
export declare function withStopPropagation(events: PropagationEvent[], element: ReactElement): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withStopPropagation = withStopPropagation;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
10
|
+
__assign = Object.assign || function (t) {
|
|
11
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12
|
+
s = arguments[i];
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
14
|
+
}
|
|
15
|
+
return t;
|
|
16
|
+
};
|
|
17
|
+
return __assign.apply(this, arguments);
|
|
18
|
+
};
|
|
19
|
+
var eventToPropRecord = {
|
|
20
|
+
'click': 'onClick'
|
|
21
|
+
};
|
|
22
|
+
function withStopPropagation(events, element) {
|
|
23
|
+
var props = __assign({}, element.props);
|
|
24
|
+
var _loop_1 = function (key) {
|
|
25
|
+
var prop = eventToPropRecord[key];
|
|
26
|
+
props[prop] = function (e) {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
(_b = (_a = element.props)[prop]) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {
|
|
33
|
+
var key = events_1[_i];
|
|
34
|
+
_loop_1(key);
|
|
35
|
+
}
|
|
36
|
+
return _react.default.cloneElement(element, props);
|
|
37
|
+
}
|