@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,102 @@
|
|
|
1
|
+
import { ClearIcon, SearchIcon } from '@ebscn/ui';
|
|
2
|
+
import { useDebounceFn } from 'ahooks';
|
|
3
|
+
import React, { useRef } from 'react';
|
|
4
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
5
|
+
import { usePropsValue } from '../../utils/use-props-value';
|
|
6
|
+
import { isIOS } from '../../utils/validate';
|
|
7
|
+
import { mergeProps } from '../../utils/with-default-props';
|
|
8
|
+
var classPrefix = "ebscn-search";
|
|
9
|
+
var defaultProps = {
|
|
10
|
+
searchLayout: 'normal',
|
|
11
|
+
placeholder: '请输入业务关键字',
|
|
12
|
+
defaultValue: '',
|
|
13
|
+
debounce: 0
|
|
14
|
+
};
|
|
15
|
+
var Search = function (p) {
|
|
16
|
+
var props = mergeProps(defaultProps, p);
|
|
17
|
+
var searchLayout = props.searchLayout;
|
|
18
|
+
var _a = usePropsValue(props),
|
|
19
|
+
value = _a[0],
|
|
20
|
+
setValue = _a[1];
|
|
21
|
+
var compositionStartRef = useRef(false);
|
|
22
|
+
var nativeInputRef = useRef(null);
|
|
23
|
+
var debouncedSearch = useDebounceFn(props.onSearch, {
|
|
24
|
+
wait: props.debounce
|
|
25
|
+
}).run;
|
|
26
|
+
// 防抖大于0时使用新函数执行回调
|
|
27
|
+
var _search = props.debounce > 0 ? debouncedSearch : props.onSearch;
|
|
28
|
+
var onKeydown = function (e) {
|
|
29
|
+
if (e.code === 'Enter' || e.keyCode === 13) {
|
|
30
|
+
_search(value);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var onChange = function (e) {
|
|
34
|
+
setValue(e.target.value);
|
|
35
|
+
_search(e.target.value);
|
|
36
|
+
};
|
|
37
|
+
var onClear = function () {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
setValue('');
|
|
40
|
+
(_a = props.onClear) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
41
|
+
// https://github.com/ant-design/ant-design-mobile/issues/5212
|
|
42
|
+
if (isIOS() && compositionStartRef.current) {
|
|
43
|
+
compositionStartRef.current = false;
|
|
44
|
+
(_b = nativeInputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var SearchInput = React.createElement("div", {
|
|
48
|
+
className: "".concat(classPrefix, "-box")
|
|
49
|
+
}, React.createElement(SearchIcon, {
|
|
50
|
+
className: "".concat(classPrefix, "-search-icon")
|
|
51
|
+
}), React.createElement("input", {
|
|
52
|
+
ref: nativeInputRef,
|
|
53
|
+
type: "text",
|
|
54
|
+
className: "".concat(classPrefix, "-input"),
|
|
55
|
+
id: props.id,
|
|
56
|
+
value: value,
|
|
57
|
+
placeholder: props.placeholder,
|
|
58
|
+
autoFocus: props.autoFocus,
|
|
59
|
+
disabled: props.disabled,
|
|
60
|
+
role: "search",
|
|
61
|
+
onCompositionStart: function () {
|
|
62
|
+
compositionStartRef.current = true;
|
|
63
|
+
},
|
|
64
|
+
onCompositionEnd: function () {
|
|
65
|
+
compositionStartRef.current = false;
|
|
66
|
+
},
|
|
67
|
+
onChange: onChange,
|
|
68
|
+
onKeyDown: onKeydown
|
|
69
|
+
}), React.createElement("span", {
|
|
70
|
+
className: "".concat(classPrefix, "-clear-icon-container"),
|
|
71
|
+
onClick: onClear
|
|
72
|
+
}, React.createElement(ClearIcon, {
|
|
73
|
+
className: "".concat(classPrefix, "-clear-icon")
|
|
74
|
+
})));
|
|
75
|
+
// 支持字符串,reactNode和ReactNode[], 统一处理为ReactNode[]
|
|
76
|
+
var children = typeof props.children === 'string' || !Array.isArray(props.children) ? [React.createElement(React.Fragment, null, props.children)] : props.children;
|
|
77
|
+
var ret = React.createElement(React.Fragment, null);
|
|
78
|
+
if (searchLayout === 'text' && children.length > 0) {
|
|
79
|
+
ret = React.createElement("div", {
|
|
80
|
+
className: "".concat(classPrefix)
|
|
81
|
+
}, SearchInput, React.createElement("span", {
|
|
82
|
+
className: "".concat(classPrefix, "-text")
|
|
83
|
+
}, children[0]));
|
|
84
|
+
} else if (searchLayout === 'twoIcon' && children.length > 1) {
|
|
85
|
+
ret = React.createElement("div", {
|
|
86
|
+
className: "".concat(classPrefix)
|
|
87
|
+
}, SearchInput, React.createElement("span", {
|
|
88
|
+
className: "".concat(classPrefix, "-two-icon")
|
|
89
|
+
}, children.map(function (item, index) {
|
|
90
|
+
return React.createElement("div", {
|
|
91
|
+
className: "".concat(classPrefix, "-two-icon-item"),
|
|
92
|
+
key: index
|
|
93
|
+
}, item);
|
|
94
|
+
})));
|
|
95
|
+
} else {
|
|
96
|
+
ret = React.createElement("div", {
|
|
97
|
+
className: "".concat(classPrefix)
|
|
98
|
+
}, SearchInput);
|
|
99
|
+
}
|
|
100
|
+
return withNativeProps(props, ret);
|
|
101
|
+
};
|
|
102
|
+
export default Search;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
.ebscn-stock-count-keyboard {
|
|
2
|
+
display: none;
|
|
3
|
+
position: fixed;
|
|
4
|
+
bottom: 0;
|
|
5
|
+
transform: translateY(101%);
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 216px;
|
|
10
|
+
transition: all 0.5s;
|
|
11
|
+
align-content: flex-start;
|
|
12
|
+
}
|
|
13
|
+
.ebscn-stock-count-keyboard :last-child {
|
|
14
|
+
background: var(--ebscn-color-primary);
|
|
15
|
+
color: var(--ebscn-color-background);
|
|
16
|
+
}
|
|
17
|
+
.ebscn-stock-count-keyboard-key {
|
|
18
|
+
width: 20%;
|
|
19
|
+
height: 54px;
|
|
20
|
+
text-align: center;
|
|
21
|
+
line-height: 54px;
|
|
22
|
+
font-size: 24px;
|
|
23
|
+
color: var(--ebscn-color-text-dark-solid);
|
|
24
|
+
font-weight: 300;
|
|
25
|
+
box-shadow: 0 0 0 1px #cccccc;
|
|
26
|
+
background: var(--ebscn-color-background);
|
|
27
|
+
}
|
|
28
|
+
.ebscn-stock-count-keyboard-key:active {
|
|
29
|
+
width: 20%;
|
|
30
|
+
height: 54px;
|
|
31
|
+
text-align: center;
|
|
32
|
+
font-size: 24px;
|
|
33
|
+
color: var(--ebscn-color-text-dark-solid);
|
|
34
|
+
font-weight: 300;
|
|
35
|
+
box-shadow: 0 0 0 1px #cccccc;
|
|
36
|
+
background: var(--ebscn-color-border);
|
|
37
|
+
}
|
|
38
|
+
.ebscn-stock-count-keyboard-option {
|
|
39
|
+
font-size: var(--ebscn-font-size-11);
|
|
40
|
+
background: #e1e3e8;
|
|
41
|
+
}
|
|
42
|
+
.ebscn-stock-count-keyboard-option:active {
|
|
43
|
+
font-size: var(--ebscn-font-size-11);
|
|
44
|
+
background: #CACBD0;
|
|
45
|
+
}
|
|
46
|
+
.ebscn-stock-count-keyboard-delete {
|
|
47
|
+
background: url(./images/delete.png) #e1e3e8 no-repeat center;
|
|
48
|
+
background-size: 24px 24px;
|
|
49
|
+
}
|
|
50
|
+
.ebscn-stock-count-keyboard-delete:active {
|
|
51
|
+
background: url(./images/delete.png) #CACBD0 no-repeat center;
|
|
52
|
+
background-size: 24px 24px;
|
|
53
|
+
}
|
|
54
|
+
.ebscn-stock-count-keyboard-confirmKey {
|
|
55
|
+
background-color: var(--ebscn-color-primary);
|
|
56
|
+
width: 20%;
|
|
57
|
+
height: 54px;
|
|
58
|
+
line-height: 54px;
|
|
59
|
+
text-align: center;
|
|
60
|
+
font-size: var(--ebscn-font-size-11);
|
|
61
|
+
color: var(--ebscn-color-text-dark-solid);
|
|
62
|
+
font-weight: 300;
|
|
63
|
+
box-shadow: 0 0 0 1px #cccccc;
|
|
64
|
+
}
|
|
65
|
+
.ebscn-stock-count-keyboard-confirmKey:active {
|
|
66
|
+
background-color: #D03B21;
|
|
67
|
+
color: var(--ebscn-color-background);
|
|
68
|
+
}
|
|
69
|
+
@supports (bottom: env(safe-area-inset-bottom)) or (constant(safe-area-inset-bottom)) {
|
|
70
|
+
.keyboard {
|
|
71
|
+
height: calc(216px + env(safe-area-inset-bottom));
|
|
72
|
+
height: calc(216px + constant(safe-area-inset-bottom));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
export type StockCountKeyboardProps = {
|
|
4
|
+
visible?: boolean;
|
|
5
|
+
onInput: Function;
|
|
6
|
+
onDelete: Function;
|
|
7
|
+
onConfirm: Function;
|
|
8
|
+
} & NativeProps;
|
|
9
|
+
export declare function StockCountKeyboard(p: StockCountKeyboardProps): JSX.Element;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import cns from "classnames";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
5
|
+
import { mergeProps } from '../../utils/with-default-props';
|
|
6
|
+
var classPrefix = 'ebscn-stock-count-keyboard';
|
|
7
|
+
var defaultProps = {
|
|
8
|
+
visible: false
|
|
9
|
+
};
|
|
10
|
+
export function StockCountKeyboard(p) {
|
|
11
|
+
var keyboardRef = useRef(null);
|
|
12
|
+
var props = mergeProps(defaultProps, p);
|
|
13
|
+
var visible = props.visible,
|
|
14
|
+
onInput = props.onInput,
|
|
15
|
+
onConfirm = props.onConfirm,
|
|
16
|
+
onDelete = props.onDelete;
|
|
17
|
+
var keys = ['全部', 1, 2, 3, 'X', '1/2', 4, 5, 6, '+100', '1/3', 7, 8, 9, '-100', '1/4', '00', 0, '', '确定'];
|
|
18
|
+
var hideTimer = useRef(null);
|
|
19
|
+
var appearTimer = useRef(null);
|
|
20
|
+
var lastVisible = useRef(null);
|
|
21
|
+
var keyFlag = useRef(0);
|
|
22
|
+
useEffect(function () {
|
|
23
|
+
if (!visible) {
|
|
24
|
+
if (lastVisible.current) {
|
|
25
|
+
// 键盘已实例化,调用隐藏即可
|
|
26
|
+
hideKeyBoard();
|
|
27
|
+
}
|
|
28
|
+
// 未实例化,为初始化,不需处理
|
|
29
|
+
} else {
|
|
30
|
+
showKeyBoard();
|
|
31
|
+
lastVisible.current = visible; // 记录当前键盘状态
|
|
32
|
+
}
|
|
33
|
+
}, [visible]);
|
|
34
|
+
function hideKeyBoard() {
|
|
35
|
+
keyboardRef.current.style.transform = 'translateY(100%)';
|
|
36
|
+
if (appearTimer.current) clearTimeout(appearTimer.current);
|
|
37
|
+
if (!hideTimer.current) {
|
|
38
|
+
hideTimer.current = setTimeout(function () {
|
|
39
|
+
keyboardRef.current.style.display = 'none';
|
|
40
|
+
}, 500);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function showKeyBoard() {
|
|
44
|
+
keyboardRef.current.style.display = '';
|
|
45
|
+
if (hideTimer.current) clearTimeout(hideTimer.current);
|
|
46
|
+
appearTimer.current = setTimeout(function () {
|
|
47
|
+
keyboardRef.current.style.transform = 'translateY(0)';
|
|
48
|
+
}, 20);
|
|
49
|
+
}
|
|
50
|
+
function onKeyPress(key) {
|
|
51
|
+
switch (key) {
|
|
52
|
+
case 'X':
|
|
53
|
+
return onDelete === null || onDelete === void 0 ? void 0 : onDelete();
|
|
54
|
+
case '确定':
|
|
55
|
+
return onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
56
|
+
default:
|
|
57
|
+
return onInput === null || onInput === void 0 ? void 0 : onInput(key);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return withNativeProps(props, React.createElement("div", {
|
|
61
|
+
ref: keyboardRef,
|
|
62
|
+
className: "".concat(classPrefix)
|
|
63
|
+
}, keys.map(function (item, index) {
|
|
64
|
+
return React.createElement("div", {
|
|
65
|
+
key: item || index,
|
|
66
|
+
className: cns(item !== '确定' ? "".concat(classPrefix, "-key") : "".concat(classPrefix, "-confirmKey"), typeof item !== 'number' && item.length && item !== '.' && item !== '确定' ? "".concat(classPrefix, "-option") : item == '确定' ? "".concat(classPrefix, "-confirmKey") : "".concat(classPrefix, "-number-key"), item === 'X' && "".concat(classPrefix, "-delete")),
|
|
67
|
+
onClick: function () {
|
|
68
|
+
if (visible) {
|
|
69
|
+
onKeyPress(item);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, item !== 'X' ? item : '');
|
|
73
|
+
})));
|
|
74
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
.ebscn-stock-keyboard {
|
|
2
|
+
transform: translateY(101%);
|
|
3
|
+
display: flex;
|
|
4
|
+
position: fixed;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 216px;
|
|
9
|
+
transition: all 0.5s;
|
|
10
|
+
align-content: flex-start;
|
|
11
|
+
}
|
|
12
|
+
.ebscn-stock-keyboard .ebscn-stock-keyboard-right {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-wrap: wrap;
|
|
15
|
+
width: 80%;
|
|
16
|
+
height: 216px;
|
|
17
|
+
transition: all 0.5s;
|
|
18
|
+
align-content: flex-start;
|
|
19
|
+
}
|
|
20
|
+
.ebscn-stock-keyboard .ebscn-stock-keyboard-right :last-child {
|
|
21
|
+
background: var(--ebscn-color-primary);
|
|
22
|
+
color: var(--ebscn-color-white);
|
|
23
|
+
}
|
|
24
|
+
.ebscn-stock-keyboard .ebscn-stock-keyboard-right-key {
|
|
25
|
+
width: 25%;
|
|
26
|
+
height: 54px;
|
|
27
|
+
line-height: 54px;
|
|
28
|
+
text-align: center;
|
|
29
|
+
font-size: 24px;
|
|
30
|
+
color: #000000;
|
|
31
|
+
font-weight: 300;
|
|
32
|
+
box-shadow: 0 0 0 1px var(--ebscn-color-light);
|
|
33
|
+
background: var(--ebscn-color-white);
|
|
34
|
+
}
|
|
35
|
+
.ebscn-stock-keyboard .ebscn-stock-keyboard-right-key:active {
|
|
36
|
+
width: 25%;
|
|
37
|
+
height: 54px;
|
|
38
|
+
line-height: 54px;
|
|
39
|
+
text-align: center;
|
|
40
|
+
font-size: 24px;
|
|
41
|
+
color: #000000;
|
|
42
|
+
font-weight: 300;
|
|
43
|
+
box-shadow: 0 0 0 1px var(--ebscn-color-light);
|
|
44
|
+
background: var(--ebscn-color-border);
|
|
45
|
+
}
|
|
46
|
+
.ebscn-stock-keyboard .ebscn-stock-keyboard-right-option {
|
|
47
|
+
font-size: var(--ebscn-font-size-11);
|
|
48
|
+
background: #e1e3e8;
|
|
49
|
+
}
|
|
50
|
+
.ebscn-stock-keyboard .ebscn-stock-keyboard-right-option:active {
|
|
51
|
+
font-size: var(--ebscn-font-size-11);
|
|
52
|
+
background: #CACBD0;
|
|
53
|
+
}
|
|
54
|
+
.ebscn-stock-keyboard .ebscn-stock-keyboard-right-delete {
|
|
55
|
+
background: url(./images/delete.png) #e1e3e8 no-repeat center;
|
|
56
|
+
background-size: 24px 24px;
|
|
57
|
+
}
|
|
58
|
+
.ebscn-stock-keyboard .ebscn-stock-keyboard-right-delete:active {
|
|
59
|
+
background: url(./images/delete.png) #CACBD0 no-repeat center;
|
|
60
|
+
background-size: 24px 24px;
|
|
61
|
+
}
|
|
62
|
+
.ebscn-stock-keyboard .ebscn-stock-keyboard-right-header {
|
|
63
|
+
padding-top: 24px;
|
|
64
|
+
padding-bottom: 16px;
|
|
65
|
+
font-size: var(--ebscn-font-size-10);
|
|
66
|
+
color: #333333;
|
|
67
|
+
text-align: center;
|
|
68
|
+
font-weight: 500;
|
|
69
|
+
}
|
|
70
|
+
.ebscn-stock-keyboard .ebscn-stock-keyboard-right-confirmKey {
|
|
71
|
+
background-color: var(--ebscn-color-primary);
|
|
72
|
+
width: 25%;
|
|
73
|
+
height: 54px;
|
|
74
|
+
line-height: 54px;
|
|
75
|
+
text-align: center;
|
|
76
|
+
font-size: var(--ebscn-font-size-11);
|
|
77
|
+
color: #000000;
|
|
78
|
+
font-weight: 300;
|
|
79
|
+
box-shadow: 0 0 0 1px var(--ebscn-color-light);
|
|
80
|
+
}
|
|
81
|
+
.ebscn-stock-keyboard .ebscn-stock-keyboard-right-confirmKey:active {
|
|
82
|
+
background-color: #D03B21;
|
|
83
|
+
color: var(--ebscn-color-white);
|
|
84
|
+
}
|
|
85
|
+
.ebscn-stock-keyboard .ebscn-stock-keyboard-left {
|
|
86
|
+
width: 20%;
|
|
87
|
+
height: 216px;
|
|
88
|
+
}
|
|
89
|
+
.ebscn-stock-keyboard .ebscn-stock-keyboard-left-key {
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
height: 20%;
|
|
94
|
+
font-size: var(--ebscn-font-size-10);
|
|
95
|
+
font-weight: 400;
|
|
96
|
+
text-align: center;
|
|
97
|
+
color: #333333;
|
|
98
|
+
line-height: 25px;
|
|
99
|
+
box-shadow: 0 0 0 1px var(--ebscn-color-light);
|
|
100
|
+
background: #e1e3e8;
|
|
101
|
+
}
|
|
102
|
+
.ebscn-stock-keyboard .ebscn-stock-keyboard-left-key:active {
|
|
103
|
+
font-size: 18px;
|
|
104
|
+
background: #CACBD0;
|
|
105
|
+
}
|
|
106
|
+
@supports (bottom: env(safe-area-inset-bottom)) or (constant(safe-area-inset-bottom)) {
|
|
107
|
+
.keyboard {
|
|
108
|
+
height: calc(216px + env(safe-area-inset-bottom));
|
|
109
|
+
height: calc(216px + constant(safe-area-inset-bottom));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
export type StockKeyboardProps = {
|
|
4
|
+
visible?: boolean;
|
|
5
|
+
onInput: Function;
|
|
6
|
+
onChangeKeyBoard: Function;
|
|
7
|
+
onDelete: Function;
|
|
8
|
+
onClose: Function;
|
|
9
|
+
onClean: Function;
|
|
10
|
+
onConfirm?: Function;
|
|
11
|
+
} & NativeProps;
|
|
12
|
+
export declare function StockKeyboard(p: StockKeyboardProps): JSX.Element;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import cns from "classnames";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
5
|
+
import { mergeProps } from '../../utils/with-default-props';
|
|
6
|
+
var classPrefix = 'ebscn-stock-keyboard';
|
|
7
|
+
var defaultProps = {
|
|
8
|
+
visible: false
|
|
9
|
+
};
|
|
10
|
+
export function StockKeyboard(p) {
|
|
11
|
+
var keyboardRef = useRef(null);
|
|
12
|
+
var props = mergeProps(defaultProps, p);
|
|
13
|
+
var visible = props.visible,
|
|
14
|
+
onInput = props.onInput,
|
|
15
|
+
onDelete = props.onDelete,
|
|
16
|
+
onClose = props.onClose,
|
|
17
|
+
onClean = props.onClean,
|
|
18
|
+
onConfirm = props.onConfirm,
|
|
19
|
+
onChangeKeyBoard = props.onChangeKeyBoard;
|
|
20
|
+
var keys = [1, 2, 3, 'X', 4, 5, 6, '清除', 7, 8, 9, '隐藏', 'ABC', 0, '', '确定'];
|
|
21
|
+
var leftKeys = ['600', '601', '000', '002', '300'];
|
|
22
|
+
var hideTimer = useRef(null);
|
|
23
|
+
var appearTimer = useRef(null);
|
|
24
|
+
var lastVisible = useRef(null);
|
|
25
|
+
var keyFlag = useRef(0);
|
|
26
|
+
useEffect(function () {
|
|
27
|
+
if (!visible) {
|
|
28
|
+
if (lastVisible.current) {
|
|
29
|
+
// 键盘已实例化,调用隐藏即可
|
|
30
|
+
hideKeyBoard();
|
|
31
|
+
}
|
|
32
|
+
// 未实例化,为初始化,不需处理
|
|
33
|
+
} else {
|
|
34
|
+
showKeyBoard();
|
|
35
|
+
lastVisible.current = visible; // 记录当前键盘状态
|
|
36
|
+
}
|
|
37
|
+
}, [visible]);
|
|
38
|
+
function hideKeyBoard() {
|
|
39
|
+
keyboardRef.current.style.transform = 'translateY(100%)';
|
|
40
|
+
if (appearTimer.current) clearTimeout(appearTimer.current);
|
|
41
|
+
if (!hideTimer.current) {
|
|
42
|
+
hideTimer.current = setTimeout(function () {
|
|
43
|
+
keyboardRef.current.style.display = 'none';
|
|
44
|
+
}, 500);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function showKeyBoard() {
|
|
48
|
+
keyboardRef.current.style.display = '';
|
|
49
|
+
if (hideTimer.current) clearTimeout(hideTimer.current);
|
|
50
|
+
appearTimer.current = setTimeout(function () {
|
|
51
|
+
keyboardRef.current.style.transform = 'translateY(0)';
|
|
52
|
+
}, 20);
|
|
53
|
+
}
|
|
54
|
+
function onKeyPress(key) {
|
|
55
|
+
switch (key) {
|
|
56
|
+
case 'X':
|
|
57
|
+
return onDelete === null || onDelete === void 0 ? void 0 : onDelete();
|
|
58
|
+
case '清除':
|
|
59
|
+
return onClean === null || onClean === void 0 ? void 0 : onClean();
|
|
60
|
+
case '隐藏':
|
|
61
|
+
return onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
62
|
+
case '确定':
|
|
63
|
+
return onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
64
|
+
case 'ABC':
|
|
65
|
+
return onChangeKeyBoard === null || onChangeKeyBoard === void 0 ? void 0 : onChangeKeyBoard();
|
|
66
|
+
default:
|
|
67
|
+
return onInput === null || onInput === void 0 ? void 0 : onInput(key);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return withNativeProps(props, React.createElement("div", {
|
|
71
|
+
ref: keyboardRef,
|
|
72
|
+
className: "".concat(classPrefix)
|
|
73
|
+
}, React.createElement("div", {
|
|
74
|
+
className: "".concat(classPrefix, "-left")
|
|
75
|
+
}, leftKeys.map(function (item, index) {
|
|
76
|
+
return React.createElement("div", {
|
|
77
|
+
key: item || index,
|
|
78
|
+
className: "".concat(classPrefix, "-left-key"),
|
|
79
|
+
onClick: function () {
|
|
80
|
+
if (visible) {
|
|
81
|
+
onKeyPress(item);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}, item !== 'X' ? item : '');
|
|
85
|
+
})), React.createElement("div", {
|
|
86
|
+
ref: keyboardRef,
|
|
87
|
+
className: "".concat(classPrefix, "-right")
|
|
88
|
+
}, keys.map(function (item, index) {
|
|
89
|
+
return React.createElement("div", {
|
|
90
|
+
key: item || index,
|
|
91
|
+
className: cns(item !== '确定' ? "".concat(classPrefix, "-right-key") : "".concat(classPrefix, "-right-confirmKey"), typeof item !== 'number' && item.length && item !== '.' && item !== '确定' ? "".concat(classPrefix, "-right-option") : item == '确定' ? "".concat(classPrefix, "-right-confirmKey") : "".concat(classPrefix, "-right-number-key"), item === 'X' && "".concat(classPrefix, "-right-delete")),
|
|
92
|
+
onClick: function () {
|
|
93
|
+
if (visible) {
|
|
94
|
+
onKeyPress(item);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}, item !== 'X' ? item : '');
|
|
98
|
+
}))));
|
|
99
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
@keyframes loading-rotate {
|
|
2
|
+
100% {
|
|
3
|
+
transform: rotate(1turn);
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
.ebscn-switch {
|
|
7
|
+
--checked-color: var(--ebscn-color-primary);
|
|
8
|
+
--height: 31px;
|
|
9
|
+
--width: 51px;
|
|
10
|
+
--border-width: 2px;
|
|
11
|
+
display: inline-block;
|
|
12
|
+
vertical-align: middle;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
position: relative;
|
|
15
|
+
align-self: center;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
/* 选中状态 */
|
|
18
|
+
/* 禁用状态 */
|
|
19
|
+
/* loading图标 */
|
|
20
|
+
}
|
|
21
|
+
.ebscn-switch.ebscn-switch-small {
|
|
22
|
+
--height: 27px;
|
|
23
|
+
--width: 44px;
|
|
24
|
+
}
|
|
25
|
+
.ebscn-switch input {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
.ebscn-switch-checkbox {
|
|
29
|
+
min-width: var(--width);
|
|
30
|
+
height: var(--height);
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
border-radius: 31px;
|
|
33
|
+
background: var(--ebscn-color-border);
|
|
34
|
+
z-index: 0;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
line-height: var(--height);
|
|
37
|
+
}
|
|
38
|
+
.ebscn-switch-checkbox:before {
|
|
39
|
+
content: ' ';
|
|
40
|
+
position: absolute;
|
|
41
|
+
left: var(--border-width);
|
|
42
|
+
top: var(--border-width);
|
|
43
|
+
width: calc(100% - 2 * var(--border-width));
|
|
44
|
+
height: calc(var(--height) - 2 * var(--border-width));
|
|
45
|
+
border-radius: calc(var(--height) - 2 * var(--border-width));
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
background: #E9E9EA;
|
|
48
|
+
z-index: 1;
|
|
49
|
+
transition: all 200ms;
|
|
50
|
+
transform: scale(1);
|
|
51
|
+
}
|
|
52
|
+
.ebscn-switch-handle {
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
align-items: center;
|
|
56
|
+
width: calc(var(--height) - 2 * var(--border-width));
|
|
57
|
+
height: calc(var(--height) - 2 * var(--border-width));
|
|
58
|
+
border-radius: calc(var(--height) - 2 * var(--border-width));
|
|
59
|
+
background: var(--ebscn-color-text-light-solid);
|
|
60
|
+
position: absolute;
|
|
61
|
+
z-index: 2;
|
|
62
|
+
top: var(--border-width);
|
|
63
|
+
left: var(--border-width);
|
|
64
|
+
transition: all 200ms;
|
|
65
|
+
box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.2), 0 2px 11.5px 0 rgba(0, 0, 0, 0.08), -1px 2px 2px 0 rgba(0, 0, 0, 0.1);
|
|
66
|
+
color: var(--ebscn-color-primary);
|
|
67
|
+
}
|
|
68
|
+
.ebscn-switch-inner {
|
|
69
|
+
position: relative;
|
|
70
|
+
z-index: 1;
|
|
71
|
+
display: flex;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
align-items: center;
|
|
74
|
+
margin: 0 8px 0 calc(var(--height) - var(--border-width) + 5px);
|
|
75
|
+
height: 100%;
|
|
76
|
+
color: var(--ebscn-color-weak);
|
|
77
|
+
transition: margin 200ms;
|
|
78
|
+
font-size: var(--ebscn-font-size-7);
|
|
79
|
+
}
|
|
80
|
+
.ebscn-switch.ebscn-switch-checked .ebscn-switch-checkbox {
|
|
81
|
+
background: var(--checked-color);
|
|
82
|
+
}
|
|
83
|
+
.ebscn-switch.ebscn-switch-checked .ebscn-switch-checkbox:before {
|
|
84
|
+
transform: scale(0);
|
|
85
|
+
}
|
|
86
|
+
.ebscn-switch.ebscn-switch-checked .ebscn-switch-handle {
|
|
87
|
+
left: calc(100% - (var(--height) - var(--border-width)));
|
|
88
|
+
}
|
|
89
|
+
.ebscn-switch.ebscn-switch-checked .ebscn-switch-inner {
|
|
90
|
+
margin: 0 calc(var(--height) - var(--border-width) + 5px) 0 8px;
|
|
91
|
+
color: var(--ebscn-color-text-light-solid);
|
|
92
|
+
}
|
|
93
|
+
.ebscn-switch.ebscn-switch-disabled {
|
|
94
|
+
cursor: not-allowed;
|
|
95
|
+
opacity: 0.4;
|
|
96
|
+
}
|
|
97
|
+
.ebscn-switch.ebscn-switch-disabled:before {
|
|
98
|
+
background-color: #f4f4f4;
|
|
99
|
+
}
|
|
100
|
+
.ebscn-switch-spin-icon {
|
|
101
|
+
width: 14px;
|
|
102
|
+
height: 14px;
|
|
103
|
+
animation: loading-rotate 1s linear infinite;
|
|
104
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
|
+
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
export type SwitchProps = {
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
defaultChecked?: boolean;
|
|
8
|
+
/** @deprecated use `onChange` instead */
|
|
9
|
+
beforeChange?: (val: boolean) => Promise<void>;
|
|
10
|
+
onChange?: (checked: boolean) => void | Promise<void>;
|
|
11
|
+
checkedText?: ReactNode;
|
|
12
|
+
uncheckedText?: ReactNode;
|
|
13
|
+
size?: 'normal' | 'small';
|
|
14
|
+
} & NativeProps<'--checked-color' | '--width' | '--height' | '--border-width'>;
|
|
15
|
+
declare const Switch: FC<SwitchProps>;
|
|
16
|
+
export default Switch;
|