@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,60 @@
|
|
|
1
|
+
import { useSpring } from '@react-spring/web';
|
|
2
|
+
import { useMutationEffect } from './use-mutation-effect';
|
|
3
|
+
import { bound } from './bound';
|
|
4
|
+
import { useIsomorphicLayoutEffect } from 'ahooks';
|
|
5
|
+
import { useIsomorphicUpdateLayoutEffect } from './use-isomorphic-update-layout-effect';
|
|
6
|
+
export var useTabListScroll = function (targetRef, activeIndex) {
|
|
7
|
+
var _a = useSpring(function () {
|
|
8
|
+
return {
|
|
9
|
+
scrollLeft: 0,
|
|
10
|
+
config: {
|
|
11
|
+
tension: 300,
|
|
12
|
+
clamp: true
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}),
|
|
16
|
+
scrollLeft = _a[0].scrollLeft,
|
|
17
|
+
api = _a[1];
|
|
18
|
+
function animate(immediate) {
|
|
19
|
+
if (immediate === void 0) {
|
|
20
|
+
immediate = false;
|
|
21
|
+
}
|
|
22
|
+
var container = targetRef.current;
|
|
23
|
+
if (!container) return;
|
|
24
|
+
if (activeIndex === undefined) return;
|
|
25
|
+
var activeTabWrapper = container.children.item(activeIndex);
|
|
26
|
+
var activeTab = activeTabWrapper.children.item(0);
|
|
27
|
+
var activeTabLeft = activeTab.offsetLeft;
|
|
28
|
+
var activeTabWidth = activeTab.offsetWidth;
|
|
29
|
+
var containerWidth = container.offsetWidth;
|
|
30
|
+
var containerScrollWidth = container.scrollWidth;
|
|
31
|
+
var containerScrollLeft = container.scrollLeft;
|
|
32
|
+
var maxScrollDistance = containerScrollWidth - containerWidth;
|
|
33
|
+
if (maxScrollDistance <= 0) return;
|
|
34
|
+
var nextScrollLeft = bound(activeTabLeft - (containerWidth - activeTabWidth) / 2, 0, containerScrollWidth - containerWidth);
|
|
35
|
+
api.start({
|
|
36
|
+
scrollLeft: nextScrollLeft,
|
|
37
|
+
from: {
|
|
38
|
+
scrollLeft: containerScrollLeft
|
|
39
|
+
},
|
|
40
|
+
immediate: immediate && !scrollLeft.isAnimating
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
useIsomorphicLayoutEffect(function () {
|
|
44
|
+
animate(true);
|
|
45
|
+
}, []);
|
|
46
|
+
useIsomorphicUpdateLayoutEffect(function () {
|
|
47
|
+
animate();
|
|
48
|
+
}, [activeIndex]);
|
|
49
|
+
useMutationEffect(function () {
|
|
50
|
+
animate(true);
|
|
51
|
+
}, targetRef, {
|
|
52
|
+
subtree: true,
|
|
53
|
+
childList: true,
|
|
54
|
+
characterData: true
|
|
55
|
+
});
|
|
56
|
+
return {
|
|
57
|
+
scrollLeft: scrollLeft,
|
|
58
|
+
animate: animate
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type Direction = '' | 'vertical' | 'horizontal';
|
|
3
|
+
export declare function useTouch(): {
|
|
4
|
+
move: EventListener;
|
|
5
|
+
start: EventListener;
|
|
6
|
+
reset: () => void;
|
|
7
|
+
startX: import("react").MutableRefObject<number>;
|
|
8
|
+
startY: import("react").MutableRefObject<number>;
|
|
9
|
+
deltaX: import("react").MutableRefObject<number>;
|
|
10
|
+
deltaY: import("react").MutableRefObject<number>;
|
|
11
|
+
offsetX: import("react").MutableRefObject<number>;
|
|
12
|
+
offsetY: import("react").MutableRefObject<number>;
|
|
13
|
+
direction: import("react").MutableRefObject<Direction>;
|
|
14
|
+
isVertical: () => boolean;
|
|
15
|
+
isHorizontal: () => boolean;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
var MIN_DISTANCE = 10;
|
|
3
|
+
function getDirection(x, y) {
|
|
4
|
+
if (x > y && x > MIN_DISTANCE) {
|
|
5
|
+
return 'horizontal';
|
|
6
|
+
}
|
|
7
|
+
if (y > x && y > MIN_DISTANCE) {
|
|
8
|
+
return 'vertical';
|
|
9
|
+
}
|
|
10
|
+
return '';
|
|
11
|
+
}
|
|
12
|
+
export function useTouch() {
|
|
13
|
+
var startX = useRef(0);
|
|
14
|
+
var startY = useRef(0);
|
|
15
|
+
var deltaX = useRef(0);
|
|
16
|
+
var deltaY = useRef(0);
|
|
17
|
+
var offsetX = useRef(0);
|
|
18
|
+
var offsetY = useRef(0);
|
|
19
|
+
var direction = useRef('');
|
|
20
|
+
var isVertical = function () {
|
|
21
|
+
return direction.current === 'vertical';
|
|
22
|
+
};
|
|
23
|
+
var isHorizontal = function () {
|
|
24
|
+
return direction.current === 'horizontal';
|
|
25
|
+
};
|
|
26
|
+
var reset = function () {
|
|
27
|
+
deltaX.current = 0;
|
|
28
|
+
deltaY.current = 0;
|
|
29
|
+
offsetX.current = 0;
|
|
30
|
+
offsetY.current = 0;
|
|
31
|
+
direction.current = '';
|
|
32
|
+
};
|
|
33
|
+
var start = function (event) {
|
|
34
|
+
reset();
|
|
35
|
+
startX.current = event.touches[0].clientX;
|
|
36
|
+
startY.current = event.touches[0].clientY;
|
|
37
|
+
};
|
|
38
|
+
var move = function (event) {
|
|
39
|
+
var touch = event.touches[0];
|
|
40
|
+
// Fix: Safari back will set clientX to negative number
|
|
41
|
+
deltaX.current = touch.clientX < 0 ? 0 : touch.clientX - startX.current;
|
|
42
|
+
deltaY.current = touch.clientY - startY.current;
|
|
43
|
+
offsetX.current = Math.abs(deltaX.current);
|
|
44
|
+
offsetY.current = Math.abs(deltaY.current);
|
|
45
|
+
if (!direction.current) {
|
|
46
|
+
direction.current = getDirection(offsetX.current, offsetY.current);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
move: move,
|
|
51
|
+
start: start,
|
|
52
|
+
reset: reset,
|
|
53
|
+
startX: startX,
|
|
54
|
+
startY: startY,
|
|
55
|
+
deltaX: deltaX,
|
|
56
|
+
deltaY: deltaY,
|
|
57
|
+
offsetX: offsetX,
|
|
58
|
+
offsetY: offsetY,
|
|
59
|
+
direction: direction,
|
|
60
|
+
isVertical: isVertical,
|
|
61
|
+
isHorizontal: isHorizontal
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function isDef<T>(val: T): val is NonNullable<T>;
|
|
2
|
+
export declare function isObject(val: unknown): val is Record<any, any>;
|
|
3
|
+
export declare function isPromise(obj: unknown): obj is Promise<unknown>;
|
|
4
|
+
export declare function isDate(val: unknown): val is Date;
|
|
5
|
+
export declare function isMobile(value: string): boolean;
|
|
6
|
+
export declare function isNumeric(val: string | number): val is string;
|
|
7
|
+
export declare function isAndroid(): boolean;
|
|
8
|
+
export declare function isIOS(): boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { canUseDom } from './can-use-dom';
|
|
2
|
+
export function isDef(val) {
|
|
3
|
+
return val !== undefined && val !== null;
|
|
4
|
+
}
|
|
5
|
+
export function isObject(val) {
|
|
6
|
+
return val !== null && typeof val === 'object';
|
|
7
|
+
}
|
|
8
|
+
export function isPromise(obj) {
|
|
9
|
+
return !!obj && typeof obj === 'object' && typeof obj.then === 'function';
|
|
10
|
+
}
|
|
11
|
+
export function isDate(val) {
|
|
12
|
+
return Object.prototype.toString.call(val) === '[object Date]' && !Number.isNaN(val.getTime());
|
|
13
|
+
}
|
|
14
|
+
export function isMobile(value) {
|
|
15
|
+
value = value.replace(/[^-|\d]/g, '');
|
|
16
|
+
return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
|
|
17
|
+
}
|
|
18
|
+
export function isNumeric(val) {
|
|
19
|
+
return typeof val === 'number' || /^\d+(\.\d+)?$/.test(val);
|
|
20
|
+
}
|
|
21
|
+
export function isAndroid() {
|
|
22
|
+
return canUseDom ? /android/.test(navigator.userAgent.toLowerCase()) : false;
|
|
23
|
+
}
|
|
24
|
+
export function isIOS() {
|
|
25
|
+
return canUseDom ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function withCache<T>(generate: () => T): () => T;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
return __assign.apply(this, arguments);
|
|
10
|
+
};
|
|
11
|
+
import assignWith from 'lodash/assignWith';
|
|
12
|
+
export function mergeProps() {
|
|
13
|
+
var items = [];
|
|
14
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
15
|
+
items[_i] = arguments[_i];
|
|
16
|
+
}
|
|
17
|
+
function customizer(objValue, srcValue) {
|
|
18
|
+
return srcValue === undefined ? objValue : srcValue;
|
|
19
|
+
}
|
|
20
|
+
var ret = __assign({}, items[0]);
|
|
21
|
+
for (var i = 1; i < items.length; i++) {
|
|
22
|
+
ret = assignWith(ret, items[i], customizer);
|
|
23
|
+
}
|
|
24
|
+
return ret;
|
|
25
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
export function mergeFuncProps(p1, p2) {
|
|
11
|
+
var p1Keys = Object.keys(p1);
|
|
12
|
+
var p2Keys = Object.keys(p2);
|
|
13
|
+
var keys = new Set(__spreadArray(__spreadArray([], p1Keys, true), p2Keys, true));
|
|
14
|
+
var res = {};
|
|
15
|
+
keys.forEach(function (key) {
|
|
16
|
+
var p1Value = p1[key];
|
|
17
|
+
var p2Value = p2[key];
|
|
18
|
+
if (typeof p1Value === 'function' && typeof p2Value === 'function') {
|
|
19
|
+
res[key] = function () {
|
|
20
|
+
var args = [];
|
|
21
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
22
|
+
args[_i] = arguments[_i];
|
|
23
|
+
}
|
|
24
|
+
p1Value.apply(void 0, args);
|
|
25
|
+
p2Value.apply(void 0, args);
|
|
26
|
+
};
|
|
27
|
+
} else {
|
|
28
|
+
res[key] = p1Value || p2Value;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return res;
|
|
32
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
export type PropagationEvent = 'click';
|
|
4
|
+
export declare function withStopPropagation(events: PropagationEvent[], element: ReactElement): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
return __assign.apply(this, arguments);
|
|
10
|
+
};
|
|
11
|
+
import React from 'react';
|
|
12
|
+
var eventToPropRecord = {
|
|
13
|
+
'click': 'onClick'
|
|
14
|
+
};
|
|
15
|
+
export function withStopPropagation(events, element) {
|
|
16
|
+
var props = __assign({}, element.props);
|
|
17
|
+
var _loop_1 = function (key) {
|
|
18
|
+
var prop = eventToPropRecord[key];
|
|
19
|
+
props[prop] = function (e) {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
e.stopPropagation();
|
|
22
|
+
(_b = (_a = element.props)[prop]) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {
|
|
26
|
+
var key = events_1[_i];
|
|
27
|
+
_loop_1(key);
|
|
28
|
+
}
|
|
29
|
+
return React.cloneElement(element, props);
|
|
30
|
+
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,50 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
"name": "@ebscn/ui",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "ebscn react library",
|
|
5
|
+
"module": "./es/index.js",
|
|
6
|
+
"types": "./es/index.d.ts",
|
|
7
|
+
"typings": "./es/index.d.ts",
|
|
8
|
+
"authors": [
|
|
9
|
+
"ebscn"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"commitlint": {
|
|
13
|
+
"extends": [
|
|
14
|
+
"@commitlint/config-conventional"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"lint-staged": {
|
|
18
|
+
"*.{md,json}": [
|
|
19
|
+
"prettier --write --no-error-on-unmatched-pattern"
|
|
20
|
+
],
|
|
21
|
+
"*.{css,less}": [
|
|
22
|
+
"stylelint --fix",
|
|
23
|
+
"prettier --write"
|
|
24
|
+
],
|
|
25
|
+
"*.{js,jsx}": [
|
|
26
|
+
"eslint --fix",
|
|
27
|
+
"prettier --write"
|
|
28
|
+
],
|
|
29
|
+
"*.{ts,tsx}": [
|
|
30
|
+
"eslint --fix",
|
|
31
|
+
"prettier --parser=typescript --write"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": ">=16.9.0",
|
|
36
|
+
"react-dom": ">=16.9.0"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@react-spring/web": "9.7.3",
|
|
40
|
+
"@use-gesture/react": "10.3.0",
|
|
41
|
+
"ahooks": "3.7.10",
|
|
42
|
+
"antd-mobile": "5.34.0",
|
|
43
|
+
"lodash": "4.17.21",
|
|
44
|
+
"lorem-ipsum": "2.0.8",
|
|
45
|
+
"pdfh5": "1.4.2",
|
|
46
|
+
"react-is": "18.2.0",
|
|
47
|
+
"react-photo-view": "1.2.4",
|
|
48
|
+
"use-sync-external-store": "1.2.0"
|
|
49
|
+
}
|
|
22
50
|
}
|
package/__vendor/__vendor.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/handRead/handRead.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { JSX } from 'react/jsx-runtime';
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { HandReadProps } from ".";
|
|
4
|
-
declare function HandRead(props: HandReadProps): JSX.Element;
|
|
5
|
-
declare const _default: React.MemoExoticComponent<typeof HandRead>;
|
|
6
|
-
export default _default;
|
package/handRead/handRead.js
DELETED
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import { jsx as a, jsxs as P } from "react/jsx-runtime";
|
|
2
|
-
import Y from "react-draggable";
|
|
3
|
-
import Z, { useRef as f, useState as _, useLayoutEffect as H } from "react";
|
|
4
|
-
import { I as ee } from "../imageViewer/imageViewer.js";
|
|
5
|
-
import h from "classnames";
|
|
6
|
-
const te = "_container_1kr1b_9", ne = "_mask_1kr1b_13", re = "_primary_1kr1b_19", ae = "_shadow_1kr1b_22", oe = "_controller_1kr1b_26", se = "_button_1kr1b_34", ce = "_disabled_1kr1b_44", le = "_pdfBox_1kr1b_49", ie = "_pdfWarp_1kr1b_53", de = "_dragContainer_1kr1b_58", ue = "_unLoadImg_1kr1b_65", fe = "_pdfImg_1kr1b_73", ge = "_pdfView_1kr1b_77", _e = "_defaultSeal_1kr1b_84", he = "_animationTip_1kr1b_90", pe = "_actionTip_1kr1b_1", be = "_handle_1kr1b_105", me = "_round-btn_1kr1b_115", ke = "_nextPage_1kr1b_127", Ne = "_lastPage_1kr1b_131", xe = "_nextDisabled_1kr1b_135", Re = "_lastDisabled_1kr1b_138", r = {
|
|
7
|
-
container: te,
|
|
8
|
-
mask: ne,
|
|
9
|
-
primary: re,
|
|
10
|
-
shadow: ae,
|
|
11
|
-
controller: oe,
|
|
12
|
-
button: se,
|
|
13
|
-
disabled: ce,
|
|
14
|
-
pdfBox: le,
|
|
15
|
-
pdfWarp: ie,
|
|
16
|
-
dragContainer: de,
|
|
17
|
-
unLoadImg: ue,
|
|
18
|
-
pdfImg: fe,
|
|
19
|
-
pdfView: ge,
|
|
20
|
-
defaultSeal: _e,
|
|
21
|
-
animationTip: he,
|
|
22
|
-
actionTip: pe,
|
|
23
|
-
handle: be,
|
|
24
|
-
"round-btn": "_round-btn_1kr1b_115",
|
|
25
|
-
roundBtn: me,
|
|
26
|
-
nextPage: ke,
|
|
27
|
-
lastPage: Ne,
|
|
28
|
-
nextDisabled: xe,
|
|
29
|
-
lastDisabled: Re
|
|
30
|
-
}, W = (o) => typeof o == "object" && o !== null, L = (o, i) => {
|
|
31
|
-
if (!W(o) || !W(i))
|
|
32
|
-
return o === i;
|
|
33
|
-
if (o === i)
|
|
34
|
-
return !0;
|
|
35
|
-
const n = Object.keys(o), m = Object.keys(i);
|
|
36
|
-
if (n.length !== m.length)
|
|
37
|
-
return !1;
|
|
38
|
-
for (let b in o)
|
|
39
|
-
if (!L(o[b], i[b]))
|
|
40
|
-
return !1;
|
|
41
|
-
return !0;
|
|
42
|
-
};
|
|
43
|
-
function Ce(o) {
|
|
44
|
-
const { documentJson: i, mandatoryReading: n, done: m, hasRead: b } = o;
|
|
45
|
-
if (!i || !n)
|
|
46
|
-
return /* @__PURE__ */ a("div", { children: "协议内容缺失" });
|
|
47
|
-
const u = f(null), B = o.pdfWidth || 600, v = o.pdfHeight || 840, d = f(0), { documentImgUrl: R, documentPages: k } = i, [M, y] = _(!1), [s, N] = _(
|
|
48
|
-
+n[0].pageNo || 1
|
|
49
|
-
), [l, x] = _(0), [E, Ie] = _(!1), [Pe, O] = _({}), [V, $] = _(!1), C = f(void 0), p = f(void 0), D = f(1.15), [A, X] = _({ x: 0, y: 0 }), I = f(0), T = f(0);
|
|
50
|
-
f({
|
|
51
|
-
type: "",
|
|
52
|
-
touchStartTime: "",
|
|
53
|
-
touchEndTime: ""
|
|
54
|
-
}), H(() => {
|
|
55
|
-
b && n.map(
|
|
56
|
-
(e, t) => n[t].hasRead = !0
|
|
57
|
-
);
|
|
58
|
-
}, [b]), H(() => {
|
|
59
|
-
u.current && !d.current && (d.current = u.current.clientWidth / B, K());
|
|
60
|
-
}, [u.current]);
|
|
61
|
-
function K() {
|
|
62
|
-
O({});
|
|
63
|
-
}
|
|
64
|
-
function U(e) {
|
|
65
|
-
T.current = e.changedTouches[0].clientX;
|
|
66
|
-
}
|
|
67
|
-
function q(e, t) {
|
|
68
|
-
const c = t.changedTouches[0].clientX;
|
|
69
|
-
I.current += c - T.current, I.current >= (+e.right - +e.left) * d.current * 0.2 ? (e.hasRead = !0, I.current = 0, F()) : X({
|
|
70
|
-
x: 0,
|
|
71
|
-
y: 0
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
function G() {
|
|
75
|
-
if (n.filter((t) => !t.hasRead).length === 0)
|
|
76
|
-
return $(!0), !0;
|
|
77
|
-
}
|
|
78
|
-
const J = () => {
|
|
79
|
-
let e = s - 1;
|
|
80
|
-
for (let t = 0; t < l; t++)
|
|
81
|
-
if (e == +n[t].pageNo && !n[t].hasRead) {
|
|
82
|
-
x(t);
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
N(e);
|
|
86
|
-
}, j = () => {
|
|
87
|
-
let e = s + 1;
|
|
88
|
-
for (let t = l; t < n.length; t++)
|
|
89
|
-
if (e == +n[t].pageNo && !n[t].hasRead) {
|
|
90
|
-
x(t);
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
N(e);
|
|
94
|
-
};
|
|
95
|
-
function w() {
|
|
96
|
-
let e = l, t = !0;
|
|
97
|
-
if (s < +n[0].pageNo)
|
|
98
|
-
return !0;
|
|
99
|
-
for (; ; ) {
|
|
100
|
-
if (!n[l].hasRead && +n[l].pageNo < s) {
|
|
101
|
-
C.current = l, t = !1;
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
if (--e < 0)
|
|
105
|
-
break;
|
|
106
|
-
if (!n[e].hasRead) {
|
|
107
|
-
t = !1, C.current = e;
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return V || t;
|
|
112
|
-
}
|
|
113
|
-
function z() {
|
|
114
|
-
let e = C.current;
|
|
115
|
-
x(e), N(+n[e].pageNo);
|
|
116
|
-
}
|
|
117
|
-
function S() {
|
|
118
|
-
let e = l, t = !0;
|
|
119
|
-
if (s >= +n[n.length - 1].pageNo && l === n.length - 1)
|
|
120
|
-
return !0;
|
|
121
|
-
if (!n[l].hasRead && s < +n[l].pageNo)
|
|
122
|
-
p.current = l, t = !1;
|
|
123
|
-
else if (e < n.length - 1) {
|
|
124
|
-
for (let c = e + 1; c < n.length; c++)
|
|
125
|
-
if (!n[c].hasRead) {
|
|
126
|
-
p.current = c, t = !1;
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return t;
|
|
131
|
-
}
|
|
132
|
-
const F = () => {
|
|
133
|
-
if (G())
|
|
134
|
-
return m && m(i.fileId), !0;
|
|
135
|
-
if (n[p.current].hasRead) {
|
|
136
|
-
for (let t = 0; t < n.length; t++)
|
|
137
|
-
if (!n[t].hasRead) {
|
|
138
|
-
p.current = t;
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
const e = +n[p.current].pageNo;
|
|
143
|
-
x(p.current), N(e);
|
|
144
|
-
}, Q = (e, t) => {
|
|
145
|
-
let c = [];
|
|
146
|
-
if (!e || !t)
|
|
147
|
-
return c;
|
|
148
|
-
for (let g = 1; g <= t; g++)
|
|
149
|
-
c.push(`${e}/${g}.jpg`);
|
|
150
|
-
return c;
|
|
151
|
-
};
|
|
152
|
-
return /* @__PURE__ */ P("div", { className: h(r.container), children: [
|
|
153
|
-
/* @__PURE__ */ P("div", { className: r.controller, children: [
|
|
154
|
-
/* @__PURE__ */ a(
|
|
155
|
-
"button",
|
|
156
|
-
{
|
|
157
|
-
className: h(
|
|
158
|
-
r.button,
|
|
159
|
-
w() && r.disabled
|
|
160
|
-
),
|
|
161
|
-
onClick: () => z(),
|
|
162
|
-
disabled: w(),
|
|
163
|
-
children: "上一待确认项"
|
|
164
|
-
}
|
|
165
|
-
),
|
|
166
|
-
/* @__PURE__ */ a(
|
|
167
|
-
"button",
|
|
168
|
-
{
|
|
169
|
-
className: h([
|
|
170
|
-
r.button,
|
|
171
|
-
S() && r.disabled
|
|
172
|
-
]),
|
|
173
|
-
onClick: () => F(),
|
|
174
|
-
disabled: S(),
|
|
175
|
-
children: "下一待确认项"
|
|
176
|
-
}
|
|
177
|
-
),
|
|
178
|
-
/* @__PURE__ */ a(
|
|
179
|
-
"div",
|
|
180
|
-
{
|
|
181
|
-
className: h(r.button),
|
|
182
|
-
onClick: (e) => {
|
|
183
|
-
y(!0), e.preventDefault();
|
|
184
|
-
},
|
|
185
|
-
children: "预览" + s + "/" + k
|
|
186
|
-
}
|
|
187
|
-
)
|
|
188
|
-
] }),
|
|
189
|
-
/* @__PURE__ */ a(
|
|
190
|
-
"div",
|
|
191
|
-
{
|
|
192
|
-
className: r.pdfBox,
|
|
193
|
-
style: { height: v * d.current },
|
|
194
|
-
children: R ? /* @__PURE__ */ P("div", { className: r.pdfWarp, children: [
|
|
195
|
-
/* @__PURE__ */ a(
|
|
196
|
-
"img",
|
|
197
|
-
{
|
|
198
|
-
className: r.pdfImg,
|
|
199
|
-
src: `${R + "/" + s}.jpg`,
|
|
200
|
-
alt: "加载中"
|
|
201
|
-
}
|
|
202
|
-
),
|
|
203
|
-
/* @__PURE__ */ a("div", { className: r.pdfView, ref: u, children: n.map(
|
|
204
|
-
(e, t) => {
|
|
205
|
-
var c;
|
|
206
|
-
return +e.pageNo * 1 === s ? /* @__PURE__ */ a(
|
|
207
|
-
"div",
|
|
208
|
-
{
|
|
209
|
-
className: h(
|
|
210
|
-
r.dragContainer,
|
|
211
|
-
e.hasRead && r.hasRead
|
|
212
|
-
// _styles.shadow
|
|
213
|
-
),
|
|
214
|
-
style: {
|
|
215
|
-
position: "absolute",
|
|
216
|
-
width: Math.min(
|
|
217
|
-
(+e.right - +e.left) * d.current * D.current,
|
|
218
|
-
(((c = u == null ? void 0 : u.current) == null ? void 0 : c.clientWidth) || 375) - 34
|
|
219
|
-
),
|
|
220
|
-
height: (+e.top - +e.bottom) * d.current,
|
|
221
|
-
top: (v - +e.top) * d.current,
|
|
222
|
-
left: Math.max(
|
|
223
|
-
+e.left * d.current - (+e.right - +e.left) * d.current / 2 * (D.current - 1),
|
|
224
|
-
16
|
|
225
|
-
),
|
|
226
|
-
borderColor: e.hasRead ? "#cccccc" : "#e84225"
|
|
227
|
-
},
|
|
228
|
-
children: E && t == 0 ? /* @__PURE__ */ a(
|
|
229
|
-
"div",
|
|
230
|
-
{
|
|
231
|
-
className: r.animationTip
|
|
232
|
-
}
|
|
233
|
-
) : /* @__PURE__ */ a(
|
|
234
|
-
Y,
|
|
235
|
-
{
|
|
236
|
-
handle: `.${r.handle}`,
|
|
237
|
-
axis: "x",
|
|
238
|
-
bounds: "parent",
|
|
239
|
-
onMouseDown: (g) => U(g),
|
|
240
|
-
onStop: (g) => q(e, g),
|
|
241
|
-
position: A,
|
|
242
|
-
children: l === t && !e.hasRead ? /* @__PURE__ */ a(
|
|
243
|
-
"div",
|
|
244
|
-
{
|
|
245
|
-
className: r.handle
|
|
246
|
-
}
|
|
247
|
-
) : /* @__PURE__ */ a("div", {})
|
|
248
|
-
}
|
|
249
|
-
)
|
|
250
|
-
},
|
|
251
|
-
Math.random() + +e.pageNo + +e.bottom
|
|
252
|
-
) : /* @__PURE__ */ a(
|
|
253
|
-
"div",
|
|
254
|
-
{},
|
|
255
|
-
+e.pageNo + +e.bottom + Math.random()
|
|
256
|
-
);
|
|
257
|
-
}
|
|
258
|
-
) }),
|
|
259
|
-
/* @__PURE__ */ a(
|
|
260
|
-
"button",
|
|
261
|
-
{
|
|
262
|
-
className: h(
|
|
263
|
-
r["round-btn"],
|
|
264
|
-
r.lastPage,
|
|
265
|
-
s === 1 && r.lastDisabled
|
|
266
|
-
),
|
|
267
|
-
onClick: J,
|
|
268
|
-
disabled: s === 1
|
|
269
|
-
}
|
|
270
|
-
),
|
|
271
|
-
/* @__PURE__ */ a(
|
|
272
|
-
"button",
|
|
273
|
-
{
|
|
274
|
-
className: h(
|
|
275
|
-
r["round-btn"],
|
|
276
|
-
r.nextPage,
|
|
277
|
-
s == +k && r.nextDisabled
|
|
278
|
-
),
|
|
279
|
-
onClick: j,
|
|
280
|
-
disabled: s == +k
|
|
281
|
-
}
|
|
282
|
-
),
|
|
283
|
-
M && /* @__PURE__ */ a(
|
|
284
|
-
ee,
|
|
285
|
-
{
|
|
286
|
-
currentIndex: s,
|
|
287
|
-
onClose: () => y(!1),
|
|
288
|
-
images: Q(
|
|
289
|
-
R,
|
|
290
|
-
+k
|
|
291
|
-
)
|
|
292
|
-
}
|
|
293
|
-
)
|
|
294
|
-
] }) : /* @__PURE__ */ a("div", { children: "loading" })
|
|
295
|
-
}
|
|
296
|
-
)
|
|
297
|
-
] });
|
|
298
|
-
}
|
|
299
|
-
const Se = Z.memo(Ce, (o, i) => L(o, i));
|
|
300
|
-
export {
|
|
301
|
-
Se as H
|
|
302
|
-
};
|