@ebscn/ui 0.0.10 → 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,37 @@
|
|
|
1
|
+
.ebscn-card {
|
|
2
|
+
background: var(--ebscn-color-background);
|
|
3
|
+
}
|
|
4
|
+
.ebscn-card-module {
|
|
5
|
+
border-radius: 16px;
|
|
6
|
+
padding: 16px;
|
|
7
|
+
margin: 0 0 12px 0;
|
|
8
|
+
}
|
|
9
|
+
.ebscn-card-line {
|
|
10
|
+
border-radius: 6px;
|
|
11
|
+
padding: 12px;
|
|
12
|
+
background-color: #f5f5f5;
|
|
13
|
+
}
|
|
14
|
+
.ebscn-card-line:not(:last-child) {
|
|
15
|
+
margin-bottom: 10px;
|
|
16
|
+
}
|
|
17
|
+
.ebscn-card-inline {
|
|
18
|
+
border-radius: 4px;
|
|
19
|
+
padding: 12px;
|
|
20
|
+
margin-top: 10px;
|
|
21
|
+
background-color: #f5f5f5;
|
|
22
|
+
}
|
|
23
|
+
.ebscn-card-inline:not(:last-child) {
|
|
24
|
+
margin-right: 10px;
|
|
25
|
+
}
|
|
26
|
+
.ebscn-card-header {
|
|
27
|
+
position: relative;
|
|
28
|
+
display: flex;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
align-items: center;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
}
|
|
33
|
+
.ebscn-card-header-title {
|
|
34
|
+
font-size: var(--ebscn-font-size-7);
|
|
35
|
+
line-height: 1.4;
|
|
36
|
+
font-weight: bold;
|
|
37
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode, CSSProperties } from 'react';
|
|
3
|
+
import { NativeProps } from '../../utils/native-props';
|
|
4
|
+
export type ICardProps = {
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
type?: 'module' | 'line' | 'inline';
|
|
7
|
+
extra?: ReactNode;
|
|
8
|
+
headerStyle?: CSSProperties;
|
|
9
|
+
headerClassName?: string;
|
|
10
|
+
bodyStyle?: CSSProperties;
|
|
11
|
+
bodyClassName?: string;
|
|
12
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
13
|
+
onBodyClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
14
|
+
onHeaderClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
} & NativeProps;
|
|
17
|
+
export default function Card(props: ICardProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cns from 'classnames';
|
|
3
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
4
|
+
var classPrefix = "ebscn-card";
|
|
5
|
+
export default function Card(props) {
|
|
6
|
+
var typeClassName = "".concat(classPrefix, "-").concat(props.type || 'module');
|
|
7
|
+
var renderHeader = function () {
|
|
8
|
+
if (!(props.title || props.extra)) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return React.createElement("div", {
|
|
12
|
+
className: cns("".concat(classPrefix, "-header"), "".concat(classPrefix, "-").concat(props.type, "-header"), props.headerClassName),
|
|
13
|
+
style: props.headerStyle,
|
|
14
|
+
onClick: props.onHeaderClick
|
|
15
|
+
}, React.createElement("div", {
|
|
16
|
+
className: "".concat(classPrefix, "-header-title")
|
|
17
|
+
}, props.title), props.extra);
|
|
18
|
+
};
|
|
19
|
+
var renderBody = function () {
|
|
20
|
+
if (!props.children) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
return React.createElement("div", {
|
|
24
|
+
className: cns("".concat(classPrefix, "-body"), "".concat(classPrefix, "-").concat(props.type, "-body"), props.bodyClassName),
|
|
25
|
+
style: props.bodyStyle,
|
|
26
|
+
onClick: props.onBodyClick
|
|
27
|
+
}, props.children);
|
|
28
|
+
};
|
|
29
|
+
return withNativeProps(props, React.createElement("div", {
|
|
30
|
+
className: cns(classPrefix, typeClassName),
|
|
31
|
+
onClick: props.onClick
|
|
32
|
+
}, renderHeader(), renderBody()));
|
|
33
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
.ebscn-checkbox {
|
|
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-checkbox input {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
.ebscn-checkbox.ebscn-checkbox-small {
|
|
15
|
+
--icon-size: 16px;
|
|
16
|
+
--font-size: var(--ebscn-font-size-4);
|
|
17
|
+
--gap: 9px;
|
|
18
|
+
}
|
|
19
|
+
.ebscn-checkbox .ebscn-checkbox-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-checkbox .ebscn-checkbox-icon > svg {
|
|
29
|
+
display: block;
|
|
30
|
+
width: 100%;
|
|
31
|
+
height: 100%;
|
|
32
|
+
}
|
|
33
|
+
.ebscn-checkbox div.ebscn-checkbox-icon.ebscn-checkbox-only-icon {
|
|
34
|
+
color: var(--ebscn-color-primary);
|
|
35
|
+
background-color: var(--ebscn-color-background);
|
|
36
|
+
}
|
|
37
|
+
.ebscn-checkbox.ebscn-checkbox-block {
|
|
38
|
+
display: flex;
|
|
39
|
+
}
|
|
40
|
+
.ebscn-checkbox.ebscn-checkbox-checked .ebscn-checkbox-icon {
|
|
41
|
+
border-color: var(--ebscn-color-primary);
|
|
42
|
+
background-color: var(--ebscn-color-primary);
|
|
43
|
+
}
|
|
44
|
+
.ebscn-checkbox.ebscn-checkbox-disabled {
|
|
45
|
+
cursor: not-allowed;
|
|
46
|
+
}
|
|
47
|
+
.ebscn-checkbox.ebscn-checkbox-disabled .ebscn-checkbox-content {
|
|
48
|
+
opacity: 0.4;
|
|
49
|
+
}
|
|
50
|
+
.ebscn-checkbox.ebscn-checkbox-disabled .ebscn-checkbox-icon {
|
|
51
|
+
background-color: #e4e4e4;
|
|
52
|
+
border-color: #d9d9d9;
|
|
53
|
+
opacity: 0.4;
|
|
54
|
+
}
|
|
55
|
+
.ebscn-checkbox.ebscn-checkbox-disabled.ebscn-checkbox-checked .ebscn-checkbox-icon {
|
|
56
|
+
background-color: var(--ebscn-color-primary);
|
|
57
|
+
}
|
|
58
|
+
.ebscn-checkbox .ebscn-checkbox-custom-icon {
|
|
59
|
+
font-size: var(--icon-size);
|
|
60
|
+
}
|
|
61
|
+
.ebscn-checkbox.ebscn-checkbox-indeterminate .ebscn-checkbox-icon {
|
|
62
|
+
background-color: var(--ebscn-color-background);
|
|
63
|
+
color: var(--ebscn-color-primary);
|
|
64
|
+
}
|
|
65
|
+
.ebscn-checkbox-content {
|
|
66
|
+
flex: 0 1 auto;
|
|
67
|
+
font-size: var(--font-size);
|
|
68
|
+
padding-left: var(--gap);
|
|
69
|
+
}
|
|
70
|
+
.ebscn-checkbox .ebscn-checkbox-icon-right-input {
|
|
71
|
+
display: flex;
|
|
72
|
+
justify-content: space-between;
|
|
73
|
+
flex-direction: row;
|
|
74
|
+
width: 100%;
|
|
75
|
+
height: 100%;
|
|
76
|
+
}
|
|
77
|
+
.ebscn-checkbox .ebscn-checkbox-icon-right-input .ebscn-checkbox-content {
|
|
78
|
+
padding-left: 0;
|
|
79
|
+
height: 100%;
|
|
80
|
+
}
|
|
81
|
+
.ebscn-checkbox .ebscn-checkbox-icon-right-input .ebscn-checkbox-icon.ebscn-checkbox-only-icon {
|
|
82
|
+
margin-right: 16px;
|
|
83
|
+
height: 100%;
|
|
84
|
+
border-color: transparent;
|
|
85
|
+
}
|
|
86
|
+
.ebscn-checkbox .ebscn-checkbox-icon-right-input .ebscn-checkbox-icon.ebscn-checkbox-only-icon svg {
|
|
87
|
+
vertical-align: middle;
|
|
88
|
+
}
|
|
89
|
+
.ebscn-checkbox-icon-right {
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { NativeProps } from '../../utils/native-props';
|
|
4
|
+
export type CheckboxValue = string | number;
|
|
5
|
+
export type CheckboxProps = {
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
defaultChecked?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
onChange?: (checked: boolean) => void;
|
|
10
|
+
value?: CheckboxValue;
|
|
11
|
+
indeterminate?: boolean;
|
|
12
|
+
block?: boolean;
|
|
13
|
+
id?: string;
|
|
14
|
+
icon?: (checked: boolean, indeterminate: boolean) => ReactNode;
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
onClick?: (event: React.MouseEvent<HTMLLabelElement, MouseEvent>) => void;
|
|
17
|
+
size?: 'normal' | 'small';
|
|
18
|
+
iconRight?: boolean;
|
|
19
|
+
} & NativeProps<'--icon-size' | '--font-size' | '--gap'>;
|
|
20
|
+
export type CheckboxRef = {
|
|
21
|
+
check: () => void;
|
|
22
|
+
uncheck: () => void;
|
|
23
|
+
toggle: () => void;
|
|
24
|
+
};
|
|
25
|
+
declare const Checkbox: React.ForwardRefExoticComponent<{
|
|
26
|
+
checked?: boolean | undefined;
|
|
27
|
+
defaultChecked?: boolean | undefined;
|
|
28
|
+
disabled?: boolean | undefined;
|
|
29
|
+
onChange?: ((checked: boolean) => void) | undefined;
|
|
30
|
+
value?: CheckboxValue | undefined;
|
|
31
|
+
indeterminate?: boolean | undefined;
|
|
32
|
+
block?: boolean | undefined;
|
|
33
|
+
id?: string | undefined;
|
|
34
|
+
icon?: ((checked: boolean, indeterminate: boolean) => ReactNode) | undefined;
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
onClick?: ((event: React.MouseEvent<HTMLLabelElement, MouseEvent>) => void) | undefined;
|
|
37
|
+
size?: "small" | "normal" | undefined;
|
|
38
|
+
iconRight?: boolean | undefined;
|
|
39
|
+
} & {
|
|
40
|
+
className?: string | undefined;
|
|
41
|
+
style?: (React.CSSProperties & Partial<Record<"--icon-size" | "--font-size" | "--gap", string>>) | undefined;
|
|
42
|
+
tabIndex?: number | undefined;
|
|
43
|
+
} & React.AriaAttributes & React.RefAttributes<CheckboxRef>>;
|
|
44
|
+
export default Checkbox;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { CheckIcon, CheckOnlyIcon, IndeterminateIcon, UncheckIcon } from '@ebscn/ui';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import React, { forwardRef, useContext, useImperativeHandle } from 'react';
|
|
4
|
+
import { devWarning } from '../../utils/dev-log';
|
|
5
|
+
import { isDev } from '../../utils/is-dev';
|
|
6
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
7
|
+
import { usePropsValue } from '../../utils/use-props-value';
|
|
8
|
+
import { mergeProps } from '../../utils/with-default-props';
|
|
9
|
+
import { CheckboxGroupContext } from './group-context';
|
|
10
|
+
import { NativeInput } from './native-input';
|
|
11
|
+
var classPrefix = "ebscn-checkbox";
|
|
12
|
+
var defaultProps = {
|
|
13
|
+
defaultChecked: false,
|
|
14
|
+
indeterminate: false,
|
|
15
|
+
size: 'normal',
|
|
16
|
+
iconRight: false
|
|
17
|
+
};
|
|
18
|
+
var Checkbox = forwardRef(function (p, ref) {
|
|
19
|
+
var _a;
|
|
20
|
+
var groupContext = useContext(CheckboxGroupContext);
|
|
21
|
+
var props = mergeProps(defaultProps, p);
|
|
22
|
+
var _b = usePropsValue({
|
|
23
|
+
value: props.checked,
|
|
24
|
+
defaultValue: props.defaultChecked,
|
|
25
|
+
onChange: props.onChange
|
|
26
|
+
}),
|
|
27
|
+
checked = _b[0],
|
|
28
|
+
setChecked = _b[1];
|
|
29
|
+
var disabled = props.disabled;
|
|
30
|
+
var value = props.value;
|
|
31
|
+
if (groupContext && value !== undefined) {
|
|
32
|
+
if (isDev) {
|
|
33
|
+
if (p.checked !== undefined) {
|
|
34
|
+
devWarning('Checkbox', 'When used within `Checkbox.Group`, the `checked` prop of `Checkbox` will not work.');
|
|
35
|
+
}
|
|
36
|
+
if (p.defaultChecked !== undefined) {
|
|
37
|
+
devWarning('Checkbox', 'When used within `Checkbox.Group`, the `defaultChecked` prop of `Checkbox` will not work.');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
checked = groupContext.value.includes(value);
|
|
41
|
+
setChecked = function (checked) {
|
|
42
|
+
var _a;
|
|
43
|
+
if (checked) {
|
|
44
|
+
groupContext.check(value);
|
|
45
|
+
} else {
|
|
46
|
+
groupContext.uncheck(value);
|
|
47
|
+
}
|
|
48
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, checked);
|
|
49
|
+
};
|
|
50
|
+
disabled = disabled || groupContext.disabled;
|
|
51
|
+
}
|
|
52
|
+
useImperativeHandle(ref, function () {
|
|
53
|
+
return {
|
|
54
|
+
check: function () {
|
|
55
|
+
setChecked(true);
|
|
56
|
+
},
|
|
57
|
+
uncheck: function () {
|
|
58
|
+
setChecked(false);
|
|
59
|
+
},
|
|
60
|
+
toggle: function () {
|
|
61
|
+
setChecked(!checked);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
var renderIcon = function () {
|
|
66
|
+
if (props.icon) {
|
|
67
|
+
return React.createElement("div", {
|
|
68
|
+
className: "".concat(classPrefix, "-custom-icon")
|
|
69
|
+
}, props.icon(checked, props.indeterminate));
|
|
70
|
+
}
|
|
71
|
+
if (props.iconRight) {
|
|
72
|
+
return checked && React.createElement("div", {
|
|
73
|
+
className: "".concat(classPrefix, "-icon ").concat(classPrefix, "-only-icon")
|
|
74
|
+
}, React.createElement(CheckOnlyIcon, null));
|
|
75
|
+
}
|
|
76
|
+
return React.createElement("div", {
|
|
77
|
+
className: "".concat(classPrefix, "-icon")
|
|
78
|
+
}, props.indeterminate ? React.createElement(IndeterminateIcon, null) : checked ? React.createElement(CheckIcon, null) : React.createElement(UncheckIcon, null));
|
|
79
|
+
};
|
|
80
|
+
return withNativeProps(props, React.createElement("label", {
|
|
81
|
+
onClick: props.onClick,
|
|
82
|
+
className: classNames(classPrefix, (_a = {}, _a["".concat(classPrefix, "-checked")] = checked && !props.indeterminate, _a["".concat(classPrefix, "-indeterminate")] = props.indeterminate, _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))
|
|
83
|
+
}, React.createElement(NativeInput, {
|
|
84
|
+
type: "checkbox",
|
|
85
|
+
checked: checked,
|
|
86
|
+
onChange: setChecked,
|
|
87
|
+
disabled: disabled,
|
|
88
|
+
id: props.id
|
|
89
|
+
}), props.iconRight ? React.createElement("div", {
|
|
90
|
+
className: "".concat(classPrefix, "-icon-right-input")
|
|
91
|
+
}, props.children && React.createElement("div", {
|
|
92
|
+
className: "".concat(classPrefix, "-content")
|
|
93
|
+
}, props.children), renderIcon()) : React.createElement(React.Fragment, null, renderIcon(), props.children && React.createElement("div", {
|
|
94
|
+
className: "".concat(classPrefix, "-content")
|
|
95
|
+
}, props.children))));
|
|
96
|
+
});
|
|
97
|
+
export default Checkbox;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CheckboxValue } from '.';
|
|
3
|
+
export declare const CheckboxGroupContext: import("react").Context<{
|
|
4
|
+
value: CheckboxValue[];
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
check: (val: CheckboxValue) => void;
|
|
7
|
+
uncheck: (val: CheckboxValue) => void;
|
|
8
|
+
} | null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
|
+
import { CheckboxValue } from '.';
|
|
3
|
+
export interface CheckboxGroupProps {
|
|
4
|
+
value?: CheckboxValue[];
|
|
5
|
+
onChange?: (val: CheckboxValue[]) => void;
|
|
6
|
+
defaultValue?: CheckboxValue[];
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const Group: FC<CheckboxGroupProps>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { mergeProps } from '../../utils/with-default-props';
|
|
12
|
+
import { CheckboxGroupContext } from './group-context';
|
|
13
|
+
import { usePropsValue } from '../../utils/use-props-value';
|
|
14
|
+
var defaultProps = {
|
|
15
|
+
disabled: false,
|
|
16
|
+
defaultValue: []
|
|
17
|
+
};
|
|
18
|
+
export var Group = function (p) {
|
|
19
|
+
var props = mergeProps(defaultProps, p);
|
|
20
|
+
var _a = usePropsValue(props),
|
|
21
|
+
value = _a[0],
|
|
22
|
+
setValue = _a[1];
|
|
23
|
+
return React.createElement(CheckboxGroupContext.Provider
|
|
24
|
+
// TODO: 性能优化
|
|
25
|
+
, {
|
|
26
|
+
// TODO: 性能优化
|
|
27
|
+
value: {
|
|
28
|
+
value: value,
|
|
29
|
+
disabled: props.disabled,
|
|
30
|
+
check: function (v) {
|
|
31
|
+
setValue(__spreadArray(__spreadArray([], value, true), [v], false));
|
|
32
|
+
},
|
|
33
|
+
uncheck: function (v) {
|
|
34
|
+
setValue(value.filter(function (item) {
|
|
35
|
+
return item !== v;
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}, props.children);
|
|
40
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './checkbox.less';
|
|
3
|
+
export type { CheckboxValue, CheckboxProps, CheckboxRef } from './checkbox';
|
|
4
|
+
export type { CheckboxGroupProps } from './group';
|
|
5
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
6
|
+
checked?: boolean | undefined;
|
|
7
|
+
defaultChecked?: boolean | undefined;
|
|
8
|
+
disabled?: boolean | undefined;
|
|
9
|
+
onChange?: ((checked: boolean) => void) | undefined;
|
|
10
|
+
value?: import("./checkbox").CheckboxValue | undefined;
|
|
11
|
+
indeterminate?: boolean | undefined;
|
|
12
|
+
block?: boolean | undefined;
|
|
13
|
+
id?: string | undefined;
|
|
14
|
+
icon?: ((checked: boolean, indeterminate: boolean) => import("react").ReactNode) | undefined;
|
|
15
|
+
children?: import("react").ReactNode;
|
|
16
|
+
onClick?: ((event: import("react").MouseEvent<HTMLLabelElement, MouseEvent>) => void) | undefined;
|
|
17
|
+
size?: "small" | "normal" | undefined;
|
|
18
|
+
iconRight?: boolean | undefined;
|
|
19
|
+
} & {
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
style?: (import("react").CSSProperties & Partial<Record<"--icon-size" | "--font-size" | "--gap", string>>) | undefined;
|
|
22
|
+
tabIndex?: number | undefined;
|
|
23
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./checkbox").CheckboxRef>> & {
|
|
24
|
+
Group: import("react").FC<import("./group").CheckboxGroupProps>;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useMemoizedFn } from 'ahooks';
|
|
2
|
+
import React, { useEffect, useRef } from 'react';
|
|
3
|
+
export var NativeInput = function (props) {
|
|
4
|
+
var inputRef = useRef(null);
|
|
5
|
+
var handleClick = useMemoizedFn(function (e) {
|
|
6
|
+
e.stopPropagation();
|
|
7
|
+
e.stopImmediatePropagation();
|
|
8
|
+
var latestChecked = e.target.checked;
|
|
9
|
+
if (latestChecked === props.checked) return;
|
|
10
|
+
props.onChange(latestChecked);
|
|
11
|
+
});
|
|
12
|
+
useEffect(function () {
|
|
13
|
+
if (props.disabled) return;
|
|
14
|
+
if (!inputRef.current) return;
|
|
15
|
+
var input = inputRef.current;
|
|
16
|
+
input.addEventListener('click', handleClick);
|
|
17
|
+
return function () {
|
|
18
|
+
input.removeEventListener('click', handleClick);
|
|
19
|
+
};
|
|
20
|
+
}, [props.disabled, props.onChange]);
|
|
21
|
+
return React.createElement("input", {
|
|
22
|
+
ref: inputRef,
|
|
23
|
+
type: props.type,
|
|
24
|
+
checked: props.checked,
|
|
25
|
+
onChange: function () {},
|
|
26
|
+
disabled: props.disabled,
|
|
27
|
+
id: props.id
|
|
28
|
+
});
|
|
29
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.adm-grid {
|
|
2
|
+
--gap: 0;
|
|
3
|
+
--gap-horizontal: var(--gap);
|
|
4
|
+
--gap-vertical: var(--gap);
|
|
5
|
+
display: grid;
|
|
6
|
+
grid-gap: 10px;
|
|
7
|
+
-webkit-column-gap: var(--gap-horizontal);
|
|
8
|
+
column-gap: var(--gap-horizontal);
|
|
9
|
+
row-gap: var(--gap-vertical);
|
|
10
|
+
grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
|
|
11
|
+
align-items: stretch;
|
|
12
|
+
}
|
|
13
|
+
.adm-grid-item {
|
|
14
|
+
grid-column-end: span var(--item-span);
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FC, ReactNode } from 'react';
|
|
3
|
+
import { NativeProps } from '../../utils/native-props';
|
|
4
|
+
export type GridProps = {
|
|
5
|
+
columns: number;
|
|
6
|
+
gap?: number | string | [number | string, number | string];
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
} & NativeProps<'--gap' | '--gap-vertical' | '--gap-horizontal'>;
|
|
9
|
+
export declare const Grid: FC<GridProps>;
|
|
10
|
+
export type GridItemProps = {
|
|
11
|
+
span?: number;
|
|
12
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
} & NativeProps;
|
|
15
|
+
export declare const GridItem: FC<GridItemProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { mergeProps } from '../../utils/with-default-props';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
4
|
+
import { toCSSLength } from '../../utils/to-css-length';
|
|
5
|
+
var classPrefix = "adm-grid";
|
|
6
|
+
export var Grid = function (props) {
|
|
7
|
+
var style = {
|
|
8
|
+
'--columns': props.columns.toString()
|
|
9
|
+
};
|
|
10
|
+
var gap = props.gap;
|
|
11
|
+
if (gap !== undefined) {
|
|
12
|
+
if (Array.isArray(gap)) {
|
|
13
|
+
style['--gap-horizontal'] = toCSSLength(gap[0]);
|
|
14
|
+
style['--gap-vertical'] = toCSSLength(gap[1]);
|
|
15
|
+
} else {
|
|
16
|
+
style['--gap'] = toCSSLength(gap);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return withNativeProps(props, React.createElement("div", {
|
|
20
|
+
className: classPrefix,
|
|
21
|
+
style: style
|
|
22
|
+
}, props.children));
|
|
23
|
+
};
|
|
24
|
+
export var GridItem = function (p) {
|
|
25
|
+
var props = mergeProps({
|
|
26
|
+
span: 1
|
|
27
|
+
}, p);
|
|
28
|
+
var itemStyle = {
|
|
29
|
+
'--item-span': props.span
|
|
30
|
+
};
|
|
31
|
+
return withNativeProps(props, React.createElement("div", {
|
|
32
|
+
className: "".concat(classPrefix, "-item"),
|
|
33
|
+
style: itemStyle,
|
|
34
|
+
onClick: props.onClick
|
|
35
|
+
}, props.children));
|
|
36
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './grid.less';
|
|
3
|
+
export type { GridProps, GridItemProps } from './grid';
|
|
4
|
+
declare const _default: import("react").FC<import("./grid").GridProps> & {
|
|
5
|
+
Item: import("react").FC<import("./grid").GridItemProps>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
3
|
+
var CheckIcon = memo(function (props) {
|
|
4
|
+
return withNativeProps(props, React.createElement("svg", {
|
|
5
|
+
width: "1em",
|
|
6
|
+
height: "1em",
|
|
7
|
+
viewBox: "0 0 48 48"
|
|
8
|
+
}, React.createElement("g", {
|
|
9
|
+
stroke: "none",
|
|
10
|
+
strokeWidth: "1",
|
|
11
|
+
fill: "none",
|
|
12
|
+
fillRule: "evenodd"
|
|
13
|
+
}, React.createElement("path", {
|
|
14
|
+
d: "M24,4 C35.0470982,4 44,12.9529018 44,24 C44,35.0470982 35.0426786,44 24,44 C12.9573214,44 4,35.0426786 4,24 C4,12.9573214 12.9529018,4 24,4 Z",
|
|
15
|
+
fill: "none"
|
|
16
|
+
}), React.createElement("path", {
|
|
17
|
+
d: "M26.9781406,13.9393398 C27.5106738,14.471873 27.5590859,15.3052003 27.1233769,15.8924233 L26.9781406,16.0606602 L20.04,23 L31.9781406,34.9393398 C32.5639271,35.5251263 32.5639271,36.4748737 31.9781406,37.0606602 C31.4456075,37.5931933 30.6122802,37.6416054 30.0250572,37.2058965 L29.8568203,37.0606602 L16.8568203,24.0606602 C16.2710339,23.4748737 16.2710339,22.5251263 16.8568203,21.9393398 L24.8568203,13.9393398 C25.4426067,13.3535534 26.3923542,13.3535534 26.9781406,13.9393398 Z",
|
|
18
|
+
fill: "currentColor",
|
|
19
|
+
transform: "translate(24.417480, 25.500000) rotate(-90.000000) translate(-24.417480, -25.500000) "
|
|
20
|
+
}))));
|
|
21
|
+
});
|
|
22
|
+
export default CheckIcon;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
3
|
+
var CheckOnlyIcon = memo(function (props) {
|
|
4
|
+
return withNativeProps(props, React.createElement("svg", {
|
|
5
|
+
width: "1em",
|
|
6
|
+
height: "1em",
|
|
7
|
+
viewBox: "0 0 32 32"
|
|
8
|
+
}, React.createElement("path", {
|
|
9
|
+
d: "M30.5986424,6.1055493 C30.9712631,6.53987855 30.9531134,7.18617346 30.5567048,7.59890623 L12.3166884,26.5900478 C11.9341206,26.9883697 11.3010844,27.001141 10.9027625,26.6185732 C10.8828778,26.5994749 10.8637913,26.5795625 10.8455522,26.5588869 L1.39075001,15.8410716 C1.02539196,15.4269074 1.06495712,14.7949798 1.47912126,14.4296218 C1.8340823,14.1164902 2.35996301,14.0951176 2.73916366,14.3784118 L10.9224935,20.4920347 C11.2975514,20.7722339 11.8168072,20.7547169 12.172129,20.4498784 L29.0316484,5.98571934 C29.497452,5.58609604 30.1990191,5.63974574 30.5986424,6.1055493 Z",
|
|
10
|
+
fill: "currentColor"
|
|
11
|
+
})));
|
|
12
|
+
});
|
|
13
|
+
export default CheckOnlyIcon;
|