@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,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _ui = require("@ebscn/ui");
|
|
8
|
+
var _antdMobile = require("antd-mobile");
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
var defaultProps = {
|
|
14
|
+
children: [],
|
|
15
|
+
buttonTop: false,
|
|
16
|
+
// 确认按钮默认在协议区下面,为true时按钮放到协议上面
|
|
17
|
+
scrollHeight: '',
|
|
18
|
+
// 协议区最大高度
|
|
19
|
+
hideButton: false,
|
|
20
|
+
// 是否隐藏确认按钮
|
|
21
|
+
popoverContent: '请勾选同意',
|
|
22
|
+
popoverPlacement: 'top-start',
|
|
23
|
+
popoverTimeout: 3000
|
|
24
|
+
};
|
|
25
|
+
var Protocol = function (p) {
|
|
26
|
+
var _a = (0, _react.useState)([]),
|
|
27
|
+
checked = _a[0],
|
|
28
|
+
setChecked = _a[1];
|
|
29
|
+
var _b = (0, _react.useState)(true),
|
|
30
|
+
popoverVisible = _b[0],
|
|
31
|
+
setPopoverVisible = _b[1];
|
|
32
|
+
var timer = (0, _react.useRef)(null);
|
|
33
|
+
var props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
34
|
+
var containerClass = props.scrollHeight ? 'ebscn-protocol ebscn-protocol-scroll' : 'ebscn-protocol';
|
|
35
|
+
// 支持字符串,reactNode和ReactNode[], 统一处理为ReactNode[]
|
|
36
|
+
var children = typeof props.children === 'string' || !Array.isArray(props.children) ? [_react.default.createElement(_react.default.Fragment, null, props.children)] : props.children;
|
|
37
|
+
function showPop() {
|
|
38
|
+
if (timer.current) {
|
|
39
|
+
clearTimeout(timer.current);
|
|
40
|
+
}
|
|
41
|
+
setPopoverVisible(true);
|
|
42
|
+
timer.current = setTimeout(function () {
|
|
43
|
+
// 3秒后隐藏popover
|
|
44
|
+
setPopoverVisible(false);
|
|
45
|
+
}, props.popoverTimeout);
|
|
46
|
+
}
|
|
47
|
+
function renderButton() {
|
|
48
|
+
if (props.hideButton) return;
|
|
49
|
+
var btnCls = props.buttonTop ? 'ebscn-protocol-top-button' : props.scrollHeight ? 'ebscn-protocol-fixed-button' : '';
|
|
50
|
+
var fullChecked = checked.length === children.length;
|
|
51
|
+
if (fullChecked && props.onAllCheck) {
|
|
52
|
+
// 全选后执行 onAllCheck
|
|
53
|
+
props.onAllCheck();
|
|
54
|
+
}
|
|
55
|
+
var btnClick = function () {
|
|
56
|
+
if (fullChecked) {
|
|
57
|
+
if (props.onConfirm) {
|
|
58
|
+
props.onConfirm();
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
showPop();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return _react.default.createElement("div", {
|
|
65
|
+
onClick: btnClick,
|
|
66
|
+
style: {
|
|
67
|
+
height: '50px'
|
|
68
|
+
}
|
|
69
|
+
}, _react.default.createElement(_ui.Button, {
|
|
70
|
+
block: true,
|
|
71
|
+
color: "primary",
|
|
72
|
+
size: "large",
|
|
73
|
+
className: btnCls,
|
|
74
|
+
disabled: !fullChecked,
|
|
75
|
+
style: {
|
|
76
|
+
pointerEvents: fullChecked ? 'auto' : 'none'
|
|
77
|
+
}
|
|
78
|
+
}, "\u786E\u8BA4"));
|
|
79
|
+
}
|
|
80
|
+
(0, _react.useEffect)(function () {
|
|
81
|
+
showPop();
|
|
82
|
+
return function () {
|
|
83
|
+
if (timer.current) {
|
|
84
|
+
clearTimeout(timer.current);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}, []);
|
|
88
|
+
return _react.default.createElement(_react.default.Fragment, null, props.buttonTop && renderButton(), _react.default.createElement("div", {
|
|
89
|
+
className: containerClass,
|
|
90
|
+
style: {
|
|
91
|
+
maxHeight: props.scrollHeight
|
|
92
|
+
}
|
|
93
|
+
}, _react.default.createElement(_antdMobile.Popover, {
|
|
94
|
+
content: props.popoverContent,
|
|
95
|
+
placement: props.popoverPlacement,
|
|
96
|
+
mode: "dark",
|
|
97
|
+
visible: popoverVisible
|
|
98
|
+
}, _react.default.createElement("span", null)), _react.default.createElement(_ui.Checkbox.Group, {
|
|
99
|
+
value: checked,
|
|
100
|
+
onChange: function (v) {
|
|
101
|
+
setChecked(v);
|
|
102
|
+
}
|
|
103
|
+
}, children.map(function (child, index) {
|
|
104
|
+
return _react.default.createElement("div", {
|
|
105
|
+
key: index,
|
|
106
|
+
className: "ebscn-protocol-item",
|
|
107
|
+
onClick: function () {
|
|
108
|
+
return setPopoverVisible(false);
|
|
109
|
+
}
|
|
110
|
+
}, _react.default.createElement("div", {
|
|
111
|
+
className: "ebscn-protocol-item-checkbox"
|
|
112
|
+
}, _react.default.createElement(_ui.Checkbox, {
|
|
113
|
+
size: "small",
|
|
114
|
+
value: index
|
|
115
|
+
})), _react.default.createElement("div", {
|
|
116
|
+
className: "ebscn-protocol-item-text"
|
|
117
|
+
}, child));
|
|
118
|
+
}))), !props.buttonTop && renderButton());
|
|
119
|
+
};
|
|
120
|
+
var _default = exports.default = Protocol;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
|
+
import { RadioValue } from '.';
|
|
3
|
+
export interface RadioGroupProps {
|
|
4
|
+
value?: RadioValue | null;
|
|
5
|
+
onChange?: (val: RadioValue) => void;
|
|
6
|
+
defaultValue?: RadioValue | null;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const Group: FC<RadioGroupProps>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Group = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
9
|
+
var _groupContext = require("./group-context");
|
|
10
|
+
var _usePropsValue = require("../../utils/use-props-value");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
var defaultProps = {
|
|
13
|
+
disabled: false,
|
|
14
|
+
defaultValue: null
|
|
15
|
+
};
|
|
16
|
+
var Group = function (p) {
|
|
17
|
+
var props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
18
|
+
var _a = (0, _usePropsValue.usePropsValue)({
|
|
19
|
+
value: props.value,
|
|
20
|
+
defaultValue: props.defaultValue,
|
|
21
|
+
onChange: function (v) {
|
|
22
|
+
var _a;
|
|
23
|
+
if (v === null) return;
|
|
24
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, v);
|
|
25
|
+
}
|
|
26
|
+
}),
|
|
27
|
+
value = _a[0],
|
|
28
|
+
setValue = _a[1];
|
|
29
|
+
return _react.default.createElement(_groupContext.RadioGroupContext.Provider
|
|
30
|
+
// TODO: 性能优化
|
|
31
|
+
, {
|
|
32
|
+
// TODO: 性能优化
|
|
33
|
+
value: {
|
|
34
|
+
value: value === null ? [] : [value],
|
|
35
|
+
check: function (v) {
|
|
36
|
+
setValue(v);
|
|
37
|
+
},
|
|
38
|
+
uncheck: function () {},
|
|
39
|
+
disabled: props.disabled
|
|
40
|
+
}
|
|
41
|
+
}, props.children);
|
|
42
|
+
};
|
|
43
|
+
exports.Group = Group;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './radio.less';
|
|
3
|
+
export type { RadioProps, RadioValue } from './radio';
|
|
4
|
+
export type { RadioGroupProps } from './group';
|
|
5
|
+
declare const _default: import("react").FC<import("./radio").RadioProps> & {
|
|
6
|
+
Group: import("react").FC<import("./group").RadioGroupProps>;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
require("./radio.css");
|
|
8
|
+
var _attachPropertiesToComponent = require("../../utils/attach-properties-to-component");
|
|
9
|
+
var _group = require("./group");
|
|
10
|
+
var _radio2 = require("./radio");
|
|
11
|
+
var _default = exports.default = (0, _attachPropertiesToComponent.attachPropertiesToComponent)(_radio2.Radio, {
|
|
12
|
+
Group: _group.Group
|
|
13
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
.ebscn-radio {
|
|
2
|
+
--icon-size: 24px;
|
|
3
|
+
--font-size: var(--ebscn-font-size-8);
|
|
4
|
+
--gap: 12px;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
vertical-align: text-bottom;
|
|
7
|
+
justify-content: flex-start;
|
|
8
|
+
align-items: center;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
}
|
|
11
|
+
.ebscn-radio input[type='radio'] {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
.ebscn-radio.ebscn-radio-small {
|
|
15
|
+
--icon-size: 16px;
|
|
16
|
+
--font-size: var(--ebscn-font-size-4);
|
|
17
|
+
--gap: 9px;
|
|
18
|
+
}
|
|
19
|
+
.ebscn-radio .ebscn-radio-icon {
|
|
20
|
+
flex: none;
|
|
21
|
+
border-radius: var(--icon-size);
|
|
22
|
+
border: 1px solid var(--ebscn-color-light);
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
width: var(--icon-size);
|
|
25
|
+
height: var(--icon-size);
|
|
26
|
+
color: var(--ebscn-color-text-light-solid);
|
|
27
|
+
}
|
|
28
|
+
.ebscn-radio .ebscn-radio-icon > svg {
|
|
29
|
+
display: block;
|
|
30
|
+
width: 100%;
|
|
31
|
+
height: 100%;
|
|
32
|
+
}
|
|
33
|
+
.ebscn-radio div.ebscn-radio-icon.ebscn-radio-only-icon {
|
|
34
|
+
color: var(--ebscn-color-primary);
|
|
35
|
+
background-color: var(--ebscn-color-background);
|
|
36
|
+
}
|
|
37
|
+
.ebscn-radio.ebscn-radio-block {
|
|
38
|
+
display: flex;
|
|
39
|
+
}
|
|
40
|
+
.ebscn-radio.ebscn-radio-checked .ebscn-radio-icon {
|
|
41
|
+
border-color: var(--ebscn-color-primary);
|
|
42
|
+
background-color: var(--ebscn-color-primary);
|
|
43
|
+
}
|
|
44
|
+
.ebscn-radio.ebscn-radio-disabled {
|
|
45
|
+
cursor: not-allowed;
|
|
46
|
+
}
|
|
47
|
+
.ebscn-radio.ebscn-radio-disabled .ebscn-radio-content {
|
|
48
|
+
opacity: 0.4;
|
|
49
|
+
}
|
|
50
|
+
.ebscn-radio.ebscn-radio-disabled .ebscn-radio-icon {
|
|
51
|
+
background-color: #e4e4e4;
|
|
52
|
+
border-color: #d9d9d9;
|
|
53
|
+
opacity: 0.4;
|
|
54
|
+
}
|
|
55
|
+
.ebscn-radio.ebscn-radio-disabled.ebscn-radio-checked .ebscn-radio-icon {
|
|
56
|
+
background-color: var(--ebscn-color-primary);
|
|
57
|
+
}
|
|
58
|
+
.ebscn-radio .ebscn-radio-custom-icon {
|
|
59
|
+
font-size: var(--icon-size);
|
|
60
|
+
}
|
|
61
|
+
.ebscn-radio.ebscn-radio-indeterminate .ebscn-radio-icon {
|
|
62
|
+
background-color: var(--ebscn-color-background);
|
|
63
|
+
color: var(--ebscn-color-primary);
|
|
64
|
+
}
|
|
65
|
+
.ebscn-radio-content {
|
|
66
|
+
flex: 0 1 auto;
|
|
67
|
+
font-size: var(--font-size);
|
|
68
|
+
padding-left: var(--gap);
|
|
69
|
+
}
|
|
70
|
+
.ebscn-radio .ebscn-radio-icon-right-input {
|
|
71
|
+
display: flex;
|
|
72
|
+
justify-content: space-between;
|
|
73
|
+
flex-direction: row;
|
|
74
|
+
width: 100%;
|
|
75
|
+
height: 100%;
|
|
76
|
+
}
|
|
77
|
+
.ebscn-radio .ebscn-radio-icon-right-input .ebscn-radio-content {
|
|
78
|
+
padding-left: 0;
|
|
79
|
+
height: 100%;
|
|
80
|
+
}
|
|
81
|
+
.ebscn-radio .ebscn-radio-icon-right-input .ebscn-radio-icon.ebscn-radio-only-icon {
|
|
82
|
+
margin-right: 16px;
|
|
83
|
+
height: 100%;
|
|
84
|
+
border-color: transparent;
|
|
85
|
+
}
|
|
86
|
+
.ebscn-radio .ebscn-radio-icon-right-input .ebscn-radio-icon.ebscn-radio-only-icon svg {
|
|
87
|
+
vertical-align: middle;
|
|
88
|
+
}
|
|
89
|
+
.ebscn-radio-icon-right {
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { NativeProps } from '../../utils/native-props';
|
|
4
|
+
export type RadioValue = string | number;
|
|
5
|
+
export type RadioProps = {
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
defaultChecked?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
onChange?: (checked: boolean) => void;
|
|
10
|
+
value?: RadioValue;
|
|
11
|
+
block?: boolean;
|
|
12
|
+
id?: string;
|
|
13
|
+
icon?: (checked: boolean) => ReactNode;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
onClick?: (event: React.MouseEvent<HTMLLabelElement, MouseEvent>) => void;
|
|
16
|
+
size?: 'normal' | 'small';
|
|
17
|
+
iconRight?: boolean;
|
|
18
|
+
} & NativeProps<'--icon-size' | '--font-size' | '--gap'>;
|
|
19
|
+
export declare const Radio: FC<RadioProps>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Radio = void 0;
|
|
7
|
+
var _ui = require("@ebscn/ui");
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _devLog = require("../../utils/dev-log");
|
|
11
|
+
var _isDev = require("../../utils/is-dev");
|
|
12
|
+
var _nativeProps = require("../../utils/native-props");
|
|
13
|
+
var _usePropsValue = require("../../utils/use-props-value");
|
|
14
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
15
|
+
var _nativeInput = require("../checkbox/native-input");
|
|
16
|
+
var _groupContext = require("./group-context");
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
var classPrefix = "ebscn-radio";
|
|
21
|
+
var defaultProps = {
|
|
22
|
+
defaultChecked: false,
|
|
23
|
+
size: 'normal',
|
|
24
|
+
iconRight: false
|
|
25
|
+
};
|
|
26
|
+
var Radio = function (p) {
|
|
27
|
+
var _a;
|
|
28
|
+
var props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
29
|
+
var groupContext = (0, _react.useContext)(_groupContext.RadioGroupContext);
|
|
30
|
+
var _b = (0, _usePropsValue.usePropsValue)({
|
|
31
|
+
value: props.checked,
|
|
32
|
+
defaultValue: props.defaultChecked,
|
|
33
|
+
onChange: props.onChange
|
|
34
|
+
}),
|
|
35
|
+
checked = _b[0],
|
|
36
|
+
setChecked = _b[1];
|
|
37
|
+
var disabled = props.disabled;
|
|
38
|
+
var value = props.value;
|
|
39
|
+
if (groupContext && value !== undefined) {
|
|
40
|
+
if (_isDev.isDev) {
|
|
41
|
+
if (p.checked !== undefined) {
|
|
42
|
+
(0, _devLog.devWarning)('Radio', 'When used within `Radio.Group`, the `checked` prop of `Radio` will not work.');
|
|
43
|
+
}
|
|
44
|
+
if (p.defaultChecked !== undefined) {
|
|
45
|
+
(0, _devLog.devWarning)('Radio', 'When used within `Radio.Group`, the `defaultChecked` prop of `Radio` will not work.');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
checked = groupContext.value.includes(value);
|
|
49
|
+
setChecked = function (innerChecked) {
|
|
50
|
+
var _a;
|
|
51
|
+
if (innerChecked) {
|
|
52
|
+
groupContext.check(value);
|
|
53
|
+
} else {
|
|
54
|
+
groupContext.uncheck(value);
|
|
55
|
+
}
|
|
56
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, innerChecked);
|
|
57
|
+
};
|
|
58
|
+
disabled = disabled || groupContext.disabled;
|
|
59
|
+
}
|
|
60
|
+
var renderIcon = function () {
|
|
61
|
+
if (props.icon) {
|
|
62
|
+
return _react.default.createElement("div", {
|
|
63
|
+
className: "".concat(classPrefix, "-custom-icon")
|
|
64
|
+
}, props.icon(checked));
|
|
65
|
+
}
|
|
66
|
+
if (props.iconRight) {
|
|
67
|
+
return checked && _react.default.createElement("div", {
|
|
68
|
+
className: "".concat(classPrefix, "-icon ").concat(classPrefix, "-only-icon")
|
|
69
|
+
}, _react.default.createElement(_ui.CheckOnlyIcon, null));
|
|
70
|
+
}
|
|
71
|
+
return _react.default.createElement("div", {
|
|
72
|
+
className: "".concat(classPrefix, "-icon")
|
|
73
|
+
}, checked ? _react.default.createElement(_ui.CheckIcon, null) : _react.default.createElement(_ui.UncheckIcon, null));
|
|
74
|
+
};
|
|
75
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("label", {
|
|
76
|
+
onClick: props.onClick,
|
|
77
|
+
className: (0, _classnames.default)(classPrefix, (_a = {}, _a["".concat(classPrefix, "-checked")] = checked, _a["".concat(classPrefix, "-disabled")] = disabled, _a["".concat(classPrefix, "-block")] = props.block, _a["".concat(classPrefix, "-small")] = props.size === 'small', _a["".concat(classPrefix, "-icon-right")] = props.iconRight, _a))
|
|
78
|
+
}, _react.default.createElement(_nativeInput.NativeInput, {
|
|
79
|
+
type: "radio",
|
|
80
|
+
checked: checked,
|
|
81
|
+
onChange: setChecked,
|
|
82
|
+
disabled: disabled,
|
|
83
|
+
id: props.id
|
|
84
|
+
}), props.iconRight ? _react.default.createElement("div", {
|
|
85
|
+
className: "".concat(classPrefix, "-icon-right-input")
|
|
86
|
+
}, props.children && _react.default.createElement("div", {
|
|
87
|
+
className: "".concat(classPrefix, "-content")
|
|
88
|
+
}, props.children), renderIcon()) : _react.default.createElement(_react.default.Fragment, null, renderIcon(), props.children && _react.default.createElement("div", {
|
|
89
|
+
className: "".concat(classPrefix, "-content")
|
|
90
|
+
}, props.children))));
|
|
91
|
+
};
|
|
92
|
+
exports.Radio = Radio;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
require("./search.css");
|
|
8
|
+
var _search2 = _interopRequireDefault(require("./search"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
var _default = exports.default = _search2.default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
.ebscn-search {
|
|
2
|
+
display: flex;
|
|
3
|
+
}
|
|
4
|
+
.ebscn-search .ebscn-search-box {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
height: 32px;
|
|
7
|
+
line-height: 20px;
|
|
8
|
+
padding: 6px 8px;
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
background-color: #F8F9FC;
|
|
11
|
+
flex: 1;
|
|
12
|
+
border-radius: 16px;
|
|
13
|
+
}
|
|
14
|
+
.ebscn-search .ebscn-search-box .ebscn-search-search-icon {
|
|
15
|
+
vertical-align: middle;
|
|
16
|
+
margin-right: 6px;
|
|
17
|
+
color: var(--ebscn-color-weak);
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
}
|
|
20
|
+
.ebscn-search .ebscn-search-box .ebscn-search-clear-icon {
|
|
21
|
+
vertical-align: middle;
|
|
22
|
+
color: var(--ebscn-color-light);
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
.ebscn-search .ebscn-search-box .ebscn-search-input {
|
|
26
|
+
border: none;
|
|
27
|
+
background: transparent;
|
|
28
|
+
outline: none;
|
|
29
|
+
color: var(--ebscn-color-text);
|
|
30
|
+
width: calc(100% - 40px);
|
|
31
|
+
}
|
|
32
|
+
.ebscn-search .ebscn-search-box .ebscn-search-input::-webkit-input-placeholder {
|
|
33
|
+
color: var(--ebscn-color-weak);
|
|
34
|
+
}
|
|
35
|
+
.ebscn-search .ebscn-search-box .ebscn-search-input::placeholder {
|
|
36
|
+
color: var(--ebscn-color-weak);
|
|
37
|
+
}
|
|
38
|
+
.ebscn-search .ebscn-search-text {
|
|
39
|
+
width: 54px;
|
|
40
|
+
text-align: center;
|
|
41
|
+
line-height: 32px;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
}
|
|
44
|
+
.ebscn-search .ebscn-search-two-icon {
|
|
45
|
+
width: 100px;
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: space-around;
|
|
48
|
+
}
|
|
49
|
+
.ebscn-search .ebscn-search-two-icon .ebscn-search-two-icon-item svg {
|
|
50
|
+
width: 32px;
|
|
51
|
+
height: 32px;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { NativeProps } from '../../utils/native-props';
|
|
4
|
+
type NativeInputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
5
|
+
export type Props = Pick<NativeInputProps, 'autoFocus' | 'onKeyDown' | 'id' | 'placeholder' | 'disabled'> & {
|
|
6
|
+
value?: string;
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
onSearch: (val: string) => void;
|
|
9
|
+
onClear?: () => void;
|
|
10
|
+
searchLayout?: 'normal' | 'text' | 'twoIcon';
|
|
11
|
+
children?: string | ReactNode[] | ReactNode;
|
|
12
|
+
debounce?: number;
|
|
13
|
+
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--text-align'>;
|
|
14
|
+
declare const Search: FC<Props>;
|
|
15
|
+
export default Search;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _ui = require("@ebscn/ui");
|
|
8
|
+
var _ahooks = require("ahooks");
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _nativeProps = require("../../utils/native-props");
|
|
11
|
+
var _usePropsValue = require("../../utils/use-props-value");
|
|
12
|
+
var _validate = require("../../utils/validate");
|
|
13
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
var classPrefix = "ebscn-search";
|
|
17
|
+
var defaultProps = {
|
|
18
|
+
searchLayout: 'normal',
|
|
19
|
+
placeholder: '请输入业务关键字',
|
|
20
|
+
defaultValue: '',
|
|
21
|
+
debounce: 0
|
|
22
|
+
};
|
|
23
|
+
var Search = function (p) {
|
|
24
|
+
var props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
25
|
+
var searchLayout = props.searchLayout;
|
|
26
|
+
var _a = (0, _usePropsValue.usePropsValue)(props),
|
|
27
|
+
value = _a[0],
|
|
28
|
+
setValue = _a[1];
|
|
29
|
+
var compositionStartRef = (0, _react.useRef)(false);
|
|
30
|
+
var nativeInputRef = (0, _react.useRef)(null);
|
|
31
|
+
var debouncedSearch = (0, _ahooks.useDebounceFn)(props.onSearch, {
|
|
32
|
+
wait: props.debounce
|
|
33
|
+
}).run;
|
|
34
|
+
// 防抖大于0时使用新函数执行回调
|
|
35
|
+
var _search = props.debounce > 0 ? debouncedSearch : props.onSearch;
|
|
36
|
+
var onKeydown = function (e) {
|
|
37
|
+
if (e.code === 'Enter' || e.keyCode === 13) {
|
|
38
|
+
_search(value);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var onChange = function (e) {
|
|
42
|
+
setValue(e.target.value);
|
|
43
|
+
_search(e.target.value);
|
|
44
|
+
};
|
|
45
|
+
var onClear = function () {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
setValue('');
|
|
48
|
+
(_a = props.onClear) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
49
|
+
// https://github.com/ant-design/ant-design-mobile/issues/5212
|
|
50
|
+
if ((0, _validate.isIOS)() && compositionStartRef.current) {
|
|
51
|
+
compositionStartRef.current = false;
|
|
52
|
+
(_b = nativeInputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var SearchInput = _react.default.createElement("div", {
|
|
56
|
+
className: "".concat(classPrefix, "-box")
|
|
57
|
+
}, _react.default.createElement(_ui.SearchIcon, {
|
|
58
|
+
className: "".concat(classPrefix, "-search-icon")
|
|
59
|
+
}), _react.default.createElement("input", {
|
|
60
|
+
ref: nativeInputRef,
|
|
61
|
+
type: "text",
|
|
62
|
+
className: "".concat(classPrefix, "-input"),
|
|
63
|
+
id: props.id,
|
|
64
|
+
value: value,
|
|
65
|
+
placeholder: props.placeholder,
|
|
66
|
+
autoFocus: props.autoFocus,
|
|
67
|
+
disabled: props.disabled,
|
|
68
|
+
role: "search",
|
|
69
|
+
onCompositionStart: function () {
|
|
70
|
+
compositionStartRef.current = true;
|
|
71
|
+
},
|
|
72
|
+
onCompositionEnd: function () {
|
|
73
|
+
compositionStartRef.current = false;
|
|
74
|
+
},
|
|
75
|
+
onChange: onChange,
|
|
76
|
+
onKeyDown: onKeydown
|
|
77
|
+
}), _react.default.createElement("span", {
|
|
78
|
+
className: "".concat(classPrefix, "-clear-icon-container"),
|
|
79
|
+
onClick: onClear
|
|
80
|
+
}, _react.default.createElement(_ui.ClearIcon, {
|
|
81
|
+
className: "".concat(classPrefix, "-clear-icon")
|
|
82
|
+
})));
|
|
83
|
+
// 支持字符串,reactNode和ReactNode[], 统一处理为ReactNode[]
|
|
84
|
+
var children = typeof props.children === 'string' || !Array.isArray(props.children) ? [_react.default.createElement(_react.default.Fragment, null, props.children)] : props.children;
|
|
85
|
+
var ret = _react.default.createElement(_react.default.Fragment, null);
|
|
86
|
+
if (searchLayout === 'text' && children.length > 0) {
|
|
87
|
+
ret = _react.default.createElement("div", {
|
|
88
|
+
className: "".concat(classPrefix)
|
|
89
|
+
}, SearchInput, _react.default.createElement("span", {
|
|
90
|
+
className: "".concat(classPrefix, "-text")
|
|
91
|
+
}, children[0]));
|
|
92
|
+
} else if (searchLayout === 'twoIcon' && children.length > 1) {
|
|
93
|
+
ret = _react.default.createElement("div", {
|
|
94
|
+
className: "".concat(classPrefix)
|
|
95
|
+
}, SearchInput, _react.default.createElement("span", {
|
|
96
|
+
className: "".concat(classPrefix, "-two-icon")
|
|
97
|
+
}, children.map(function (item, index) {
|
|
98
|
+
return _react.default.createElement("div", {
|
|
99
|
+
className: "".concat(classPrefix, "-two-icon-item"),
|
|
100
|
+
key: index
|
|
101
|
+
}, item);
|
|
102
|
+
})));
|
|
103
|
+
} else {
|
|
104
|
+
ret = _react.default.createElement("div", {
|
|
105
|
+
className: "".concat(classPrefix)
|
|
106
|
+
}, SearchInput);
|
|
107
|
+
}
|
|
108
|
+
return (0, _nativeProps.withNativeProps)(props, ret);
|
|
109
|
+
};
|
|
110
|
+
var _default = exports.default = Search;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
require("./stock-count-keyboard.css");
|
|
8
|
+
var _stockCountKeyboard2 = require("./stock-count-keyboard");
|
|
9
|
+
var _default = exports.default = _stockCountKeyboard2.StockCountKeyboard;
|