@trionesdev/antd-mobile-react 0.0.2-beta.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/LICENSE +21 -0
- package/dist/ActionSheet/demo/base.d.ts +3 -0
- package/dist/ActionSheet/demo/base.js +39 -0
- package/dist/ActionSheet/index.d.ts +3 -0
- package/dist/ActionSheet/index.js +2 -0
- package/dist/Alert/demo/base.d.ts +3 -0
- package/dist/Alert/demo/base.js +56 -0
- package/dist/Alert/index.d.ts +3 -0
- package/dist/Alert/index.js +2 -0
- package/dist/Avatar/demo/base.d.ts +7 -0
- package/dist/Avatar/demo/base.js +109 -0
- package/dist/Avatar/demo/style.scss +6 -0
- package/dist/Avatar/index.d.ts +3 -0
- package/dist/Avatar/index.js +2 -0
- package/dist/Badge/demo/base.d.ts +7 -0
- package/dist/Badge/demo/base.js +167 -0
- package/dist/Badge/demo/base.scss +6 -0
- package/dist/Badge/index.d.ts +3 -0
- package/dist/Badge/index.js +2 -0
- package/dist/Button/button.d.ts +53 -0
- package/dist/Button/button.js +66 -0
- package/dist/Button/demo/base.d.ts +3 -0
- package/dist/Button/demo/base.js +163 -0
- package/dist/Button/index.d.ts +3 -0
- package/dist/Button/index.js +2 -0
- package/dist/Button/style.scss +231 -0
- package/dist/Calendar/calendar-grid.d.ts +27 -0
- package/dist/Calendar/calendar-grid.js +164 -0
- package/dist/Calendar/calendar-header.d.ts +7 -0
- package/dist/Calendar/calendar-header.js +42 -0
- package/dist/Calendar/calendar-range.d.ts +10 -0
- package/dist/Calendar/calendar-range.js +57 -0
- package/dist/Calendar/calendar.d.ts +10 -0
- package/dist/Calendar/calendar.js +49 -0
- package/dist/Calendar/demo/calendar.d.ts +3 -0
- package/dist/Calendar/demo/calendar.js +10 -0
- package/dist/Calendar/demo/grid.d.ts +3 -0
- package/dist/Calendar/demo/grid.js +12 -0
- package/dist/Calendar/demo/touch-grid.d.ts +3 -0
- package/dist/Calendar/demo/touch-grid.js +8 -0
- package/dist/Calendar/index.d.ts +11 -0
- package/dist/Calendar/index.js +8 -0
- package/dist/Calendar/style.scss +85 -0
- package/dist/Calendar/touchable-calendar-grid.d.ts +14 -0
- package/dist/Calendar/touchable-calendar-grid.js +395 -0
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.d.ts +10 -0
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.js +156 -0
- package/dist/CalendarDatetimePicker/DateTimeSwitch.d.ts +14 -0
- package/dist/CalendarDatetimePicker/DateTimeSwitch.js +39 -0
- package/dist/CalendarDatetimePicker/demo/base.d.ts +3 -0
- package/dist/CalendarDatetimePicker/demo/base.js +41 -0
- package/dist/CalendarDatetimePicker/index.d.ts +3 -0
- package/dist/CalendarDatetimePicker/index.js +2 -0
- package/dist/CalendarDatetimePicker/style.scss +54 -0
- package/dist/CalendarDatetimePicker/types.d.ts +5 -0
- package/dist/CalendarDatetimePicker/types.js +6 -0
- package/dist/CalendarPicker/calendar-picker.d.ts +4 -0
- package/dist/CalendarPicker/calendar-picker.js +87 -0
- package/dist/CalendarPicker/calendar-range-picker.d.ts +4 -0
- package/dist/CalendarPicker/calendar-range-picker.js +87 -0
- package/dist/CalendarPicker/demo/base.d.ts +3 -0
- package/dist/CalendarPicker/demo/base.js +66 -0
- package/dist/CalendarPicker/index.d.ts +9 -0
- package/dist/CalendarPicker/index.js +5 -0
- package/dist/CalendarPicker/style.scss +31 -0
- package/dist/CalendarPicker/types.d.ts +21 -0
- package/dist/CalendarPicker/types.js +1 -0
- package/dist/Card/demo/base.d.ts +4 -0
- package/dist/Card/demo/base.js +65 -0
- package/dist/Card/demo/base.scss +18 -0
- package/dist/Card/index.d.ts +3 -0
- package/dist/Card/index.js +2 -0
- package/dist/CascaderPicker/demo/base.d.ts +3 -0
- package/dist/CascaderPicker/demo/base.js +85 -0
- package/dist/CascaderPicker/index.d.ts +3 -0
- package/dist/CascaderPicker/index.js +2 -0
- package/dist/CascaderView/demo/async.d.ts +3 -0
- package/dist/CascaderView/demo/async.js +41 -0
- package/dist/CascaderView/demo/base.d.ts +3 -0
- package/dist/CascaderView/demo/base.js +62 -0
- package/dist/CascaderView/demo/value.d.ts +3 -0
- package/dist/CascaderView/demo/value.js +63 -0
- package/dist/CascaderView/index.d.ts +3 -0
- package/dist/CascaderView/index.js +2 -0
- package/dist/Cell/demo/base.d.ts +3 -0
- package/dist/Cell/demo/base.js +13 -0
- package/dist/Cell/index.d.ts +3 -0
- package/dist/Cell/index.js +2 -0
- package/dist/Checkbox/demo/base.d.ts +6 -0
- package/dist/Checkbox/demo/base.js +43 -0
- package/dist/Checkbox/demo/disabled.d.ts +3 -0
- package/dist/Checkbox/demo/disabled.js +19 -0
- package/dist/Checkbox/index.d.ts +3 -0
- package/dist/Checkbox/index.js +2 -0
- package/dist/ConfigProvider/demo/base.d.ts +6 -0
- package/dist/ConfigProvider/demo/base.js +24 -0
- package/dist/ConfigProvider/index.d.ts +3 -0
- package/dist/ConfigProvider/index.js +2 -0
- package/dist/DemoBlock/index.d.ts +10 -0
- package/dist/DemoBlock/index.js +15 -0
- package/dist/DemoBlock/index.scss +20 -0
- package/dist/DemoDescription/index.d.ts +6 -0
- package/dist/DemoDescription/index.js +7 -0
- package/dist/DemoDescription/index.scss +3 -0
- package/dist/Descriptions/demo/base.d.ts +3 -0
- package/dist/Descriptions/demo/base.js +102 -0
- package/dist/Descriptions/demo/vertical.d.ts +3 -0
- package/dist/Descriptions/demo/vertical.js +70 -0
- package/dist/Descriptions/index.d.ts +3 -0
- package/dist/Descriptions/index.js +2 -0
- package/dist/Divider/demo/base.d.ts +3 -0
- package/dist/Divider/demo/base.js +35 -0
- package/dist/Divider/index.d.ts +3 -0
- package/dist/Divider/index.js +2 -0
- package/dist/Ellipsis/demo/base.d.ts +3 -0
- package/dist/Ellipsis/demo/base.js +81 -0
- package/dist/Ellipsis/index.d.ts +3 -0
- package/dist/Ellipsis/index.js +2 -0
- package/dist/Empty/demo/base.d.ts +3 -0
- package/dist/Empty/demo/base.js +38 -0
- package/dist/Empty/index.d.ts +3 -0
- package/dist/Empty/index.js +2 -0
- package/dist/ErrorBlock/demo/base.d.ts +3 -0
- package/dist/ErrorBlock/demo/base.js +23 -0
- package/dist/ErrorBlock/index.d.ts +4 -0
- package/dist/ErrorBlock/index.js +3 -0
- package/dist/Footer/demo/base.d.ts +6 -0
- package/dist/Footer/demo/base.js +81 -0
- package/dist/Footer/index.d.ts +3 -0
- package/dist/Footer/index.js +2 -0
- package/dist/Form/demo/base.d.ts +3 -0
- package/dist/Form/demo/base.js +99 -0
- package/dist/Form/demo/input.d.ts +3 -0
- package/dist/Form/demo/input.js +39 -0
- package/dist/Form/index.d.ts +3 -0
- package/dist/Form/index.js +2 -0
- package/dist/Grid/demo/base.d.ts +7 -0
- package/dist/Grid/demo/base.js +46 -0
- package/dist/Grid/demo/base.scss +7 -0
- package/dist/Grid/index.d.ts +3 -0
- package/dist/Grid/index.js +2 -0
- package/dist/Icon/check-icon.d.ts +3 -0
- package/dist/Icon/check-icon.js +10 -0
- package/dist/Icon/demo/base.d.ts +6 -0
- package/dist/Icon/demo/base.js +41 -0
- package/dist/Image/broken-image-icon.d.ts +2 -0
- package/dist/Image/broken-image-icon.js +11 -0
- package/dist/Image/demo/base.d.ts +4 -0
- package/dist/Image/demo/base.js +101 -0
- package/dist/Image/demo/base.scss +4 -0
- package/dist/Image/image-icon.d.ts +2 -0
- package/dist/Image/image-icon.js +11 -0
- package/dist/Image/image.d.ts +19 -0
- package/dist/Image/image.js +113 -0
- package/dist/Image/index.d.ts +4 -0
- package/dist/Image/index.js +3 -0
- package/dist/Image/lazy-detector.d.ts +6 -0
- package/dist/Image/lazy-detector.js +22 -0
- package/dist/Image/style.scss +30 -0
- package/dist/ImagesPreview/ImagesPreview.d.ts +12 -0
- package/dist/ImagesPreview/ImagesPreview.js +83 -0
- package/dist/ImagesPreview/demo/base.d.ts +3 -0
- package/dist/ImagesPreview/demo/base.js +30 -0
- package/dist/ImagesPreview/index.d.ts +3 -0
- package/dist/ImagesPreview/index.js +2 -0
- package/dist/ImagesPreview/style.scss +34 -0
- package/dist/ImagesWall/CameraModal.d.ts +6 -0
- package/dist/ImagesWall/CameraModal.js +23 -0
- package/dist/ImagesWall/ImagesWall.d.ts +29 -0
- package/dist/ImagesWall/ImagesWall.js +225 -0
- package/dist/ImagesWall/demo/base.d.ts +3 -0
- package/dist/ImagesWall/demo/base.js +29 -0
- package/dist/ImagesWall/index.d.ts +3 -0
- package/dist/ImagesWall/index.js +2 -0
- package/dist/ImagesWall/style.scss +70 -0
- package/dist/Input/demo/base.d.ts +3 -0
- package/dist/Input/demo/base.js +29 -0
- package/dist/Input/index.d.ts +3 -0
- package/dist/Input/index.js +2 -0
- package/dist/InputNumber/demo/base.d.ts +3 -0
- package/dist/InputNumber/demo/base.js +13 -0
- package/dist/InputNumber/index.d.ts +3 -0
- package/dist/InputNumber/index.js +2 -0
- package/dist/Mask/demo/base.d.ts +3 -0
- package/dist/Mask/demo/base.js +29 -0
- package/dist/Mask/index.d.ts +3 -0
- package/dist/Mask/index.js +2 -0
- package/dist/NavBar/demo/base.d.ts +4 -0
- package/dist/NavBar/demo/base.js +70 -0
- package/dist/NavBar/demo/base.scss +5 -0
- package/dist/NavBar/index.d.ts +3 -0
- package/dist/NavBar/index.js +2 -0
- package/dist/NoticeBar/demo/base.d.ts +3 -0
- package/dist/NoticeBar/demo/base.js +90 -0
- package/dist/NoticeBar/index.d.ts +3 -0
- package/dist/NoticeBar/index.js +2 -0
- package/dist/PageIndicator/demo/base.d.ts +3 -0
- package/dist/PageIndicator/demo/base.js +41 -0
- package/dist/PageIndicator/index.d.ts +3 -0
- package/dist/PageIndicator/index.js +2 -0
- package/dist/Picker/demo/base.d.ts +3 -0
- package/dist/Picker/demo/base.js +56 -0
- package/dist/Picker/index.d.ts +3 -0
- package/dist/Picker/index.js +2 -0
- package/dist/PickerView/demo/base.d.ts +3 -0
- package/dist/PickerView/demo/base.js +36 -0
- package/dist/PickerView/index.d.ts +3 -0
- package/dist/PickerView/index.js +2 -0
- package/dist/Popup/demo/base.d.ts +3 -0
- package/dist/Popup/demo/base.js +99 -0
- package/dist/Popup/index.d.ts +3 -0
- package/dist/Popup/index.js +2 -0
- package/dist/Progress/Progress.d.ts +37 -0
- package/dist/Progress/Progress.js +52 -0
- package/dist/Progress/ProgressCircle.d.ts +17 -0
- package/dist/Progress/ProgressCircle.js +148 -0
- package/dist/Progress/ProgressLine.d.ts +15 -0
- package/dist/Progress/ProgressLine.js +87 -0
- package/dist/Progress/demo/base.d.ts +3 -0
- package/dist/Progress/demo/base.js +73 -0
- package/dist/Progress/index.d.ts +3 -0
- package/dist/Progress/index.js +2 -0
- package/dist/Progress/style.scss +33 -0
- package/dist/Progress/types.d.ts +4 -0
- package/dist/Progress/types.js +2 -0
- package/dist/Radio/demo/base.d.ts +4 -0
- package/dist/Radio/demo/base.js +85 -0
- package/dist/Radio/demo/base.scss +4 -0
- package/dist/Radio/index.d.ts +3 -0
- package/dist/Radio/index.js +2 -0
- package/dist/Rate/demo/base.d.ts +3 -0
- package/dist/Rate/demo/base.js +59 -0
- package/dist/Rate/index.d.ts +3 -0
- package/dist/Rate/index.js +2 -0
- package/dist/Result/demo/base.d.ts +3 -0
- package/dist/Result/demo/base.js +57 -0
- package/dist/Result/index.d.ts +3 -0
- package/dist/Result/index.js +2 -0
- package/dist/SafeArea/demo/base.d.ts +3 -0
- package/dist/SafeArea/demo/base.js +17 -0
- package/dist/SafeArea/demo/base.scss +18 -0
- package/dist/SafeArea/index.d.ts +3 -0
- package/dist/SafeArea/index.js +2 -0
- package/dist/Scaffold/demo/base.d.ts +3 -0
- package/dist/Scaffold/demo/base.js +30 -0
- package/dist/Scaffold/index.d.ts +3 -0
- package/dist/Scaffold/index.js +2 -0
- package/dist/ScrollView/demo/base.d.ts +3 -0
- package/dist/ScrollView/demo/base.js +43 -0
- package/dist/ScrollView/index.d.ts +3 -0
- package/dist/ScrollView/index.js +2 -0
- package/dist/SideBar/SideBarContext.d.ts +18 -0
- package/dist/SideBar/SideBarContext.js +2 -0
- package/dist/SideBar/demo/base.d.ts +3 -0
- package/dist/SideBar/demo/base.js +54 -0
- package/dist/SideBar/demo/default-active.d.ts +3 -0
- package/dist/SideBar/demo/default-active.js +34 -0
- package/dist/SideBar/demo/scroll-mode.d.ts +3 -0
- package/dist/SideBar/demo/scroll-mode.js +55 -0
- package/dist/SideBar/index.d.ts +3 -0
- package/dist/SideBar/index.js +2 -0
- package/dist/SideBar/side-bar.d.ts +25 -0
- package/dist/SideBar/side-bar.js +351 -0
- package/dist/SideBar/style.scss +85 -0
- package/dist/SideBar/types.d.ts +7 -0
- package/dist/SideBar/types.js +1 -0
- package/dist/Space/demo/base.d.ts +3 -0
- package/dist/Space/demo/base.js +120 -0
- package/dist/Space/index.d.ts +3 -0
- package/dist/Space/index.js +2 -0
- package/dist/SpinLoading/demo/base.d.ts +3 -0
- package/dist/SpinLoading/demo/base.js +21 -0
- package/dist/SpinLoading/index.d.ts +3 -0
- package/dist/SpinLoading/index.js +2 -0
- package/dist/Steps/demo/base.d.ts +3 -0
- package/dist/Steps/demo/base.js +71 -0
- package/dist/Steps/index.d.ts +3 -0
- package/dist/Steps/index.js +2 -0
- package/dist/Swiper/Swiper.d.ts +10 -0
- package/dist/Swiper/Swiper.js +22 -0
- package/dist/Swiper/SwiperCore.d.ts +23 -0
- package/dist/Swiper/SwiperCore.js +272 -0
- package/dist/Swiper/demo/base.d.ts +3 -0
- package/dist/Swiper/demo/base.js +122 -0
- package/dist/Swiper/index.d.ts +8 -0
- package/dist/Swiper/index.js +5 -0
- package/dist/Swiper/style.scss +54 -0
- package/dist/Switch/demo/base.d.ts +3 -0
- package/dist/Switch/demo/base.js +108 -0
- package/dist/Switch/index.d.ts +3 -0
- package/dist/Switch/index.js +2 -0
- package/dist/TabBar/demo/base.d.ts +6 -0
- package/dist/TabBar/demo/base.js +26 -0
- package/dist/TabBar/index.d.ts +3 -0
- package/dist/TabBar/index.js +2 -0
- package/dist/Tabs/demo/base.d.ts +3 -0
- package/dist/Tabs/demo/base.js +59 -0
- package/dist/Tabs/index.d.ts +3 -0
- package/dist/Tabs/index.js +2 -0
- package/dist/Tag/demo/base.d.ts +7 -0
- package/dist/Tag/demo/base.js +67 -0
- package/dist/Tag/demo/style.scss +8 -0
- package/dist/Tag/index.d.ts +3 -0
- package/dist/Tag/index.js +2 -0
- package/dist/Toast/demo/base.d.ts +3 -0
- package/dist/Toast/demo/base.js +121 -0
- package/dist/Toast/demo/component-mode.d.ts +3 -0
- package/dist/Toast/demo/component-mode.js +32 -0
- package/dist/Toast/index.d.ts +8 -0
- package/dist/Toast/index.js +4 -0
- package/dist/Toast/style.scss +63 -0
- package/dist/Toast/toast-modal.d.ts +18 -0
- package/dist/Toast/toast-modal.js +112 -0
- package/dist/Toast/toast.d.ts +20 -0
- package/dist/Toast/toast.js +112 -0
- package/dist/VerificationCodeInput/demo/base.d.ts +3 -0
- package/dist/VerificationCodeInput/demo/base.js +11 -0
- package/dist/VerificationCodeInput/index.d.ts +3 -0
- package/dist/VerificationCodeInput/index.js +2 -0
- package/dist/WaterMark/demo/demo1.d.ts +7 -0
- package/dist/WaterMark/demo/demo1.js +47 -0
- package/dist/WaterMark/demo/demo1.scss +6 -0
- package/dist/WaterMark/demo/demo2.d.ts +3 -0
- package/dist/WaterMark/demo/demo2.js +31 -0
- package/dist/WaterMark/index.d.ts +3 -0
- package/dist/WaterMark/index.js +2 -0
- package/dist/index.d.ts +106 -0
- package/dist/index.js +53 -0
- package/dist/locales/base.d.ts +139 -0
- package/dist/locales/base.js +139 -0
- package/dist/locales/en-US.d.ts +139 -0
- package/dist/locales/en-US.js +4 -0
- package/dist/locales/zh-CN.d.ts +3 -0
- package/dist/locales/zh-CN.js +140 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.js +1 -0
- package/dist/utils/attach-properties-to-component.d.ts +1 -0
- package/dist/utils/attach-properties-to-component.js +9 -0
- package/dist/utils/bound.d.ts +1 -0
- package/dist/utils/bound.js +10 -0
- package/dist/utils/can-use-dom.d.ts +1 -0
- package/dist/utils/can-use-dom.js +1 -0
- package/dist/utils/convert-px.d.ts +1 -0
- package/dist/utils/convert-px.js +27 -0
- package/dist/utils/datetime-utils.d.ts +3 -0
- package/dist/utils/datetime-utils.js +18 -0
- package/dist/utils/dev-log.d.ts +3 -0
- package/dist/utils/dev-log.js +36 -0
- package/dist/utils/get-container.d.ts +2 -0
- package/dist/utils/get-container.js +4 -0
- package/dist/utils/get-scroll-parent.d.ts +3 -0
- package/dist/utils/get-scroll-parent.js +23 -0
- package/dist/utils/is-dev.d.ts +1 -0
- package/dist/utils/is-dev.js +1 -0
- package/dist/utils/lang.d.ts +1 -0
- package/dist/utils/lang.js +1 -0
- package/dist/utils/matrix.d.ts +10 -0
- package/dist/utils/matrix.js +37 -0
- package/dist/utils/merge-locale.d.ts +1 -0
- package/dist/utils/merge-locale.js +16 -0
- package/dist/utils/native-props.d.ts +10 -0
- package/dist/utils/native-props.js +39 -0
- package/dist/utils/random-utils.d.ts +3 -0
- package/dist/utils/random-utils.js +13 -0
- package/dist/utils/reactNode.d.ts +7 -0
- package/dist/utils/reactNode.js +13 -0
- package/dist/utils/render-imperatively.d.ts +14 -0
- package/dist/utils/render-imperatively.js +105 -0
- package/dist/utils/render-to-body.d.ts +2 -0
- package/dist/utils/render-to-body.js +13 -0
- package/dist/utils/render-to-container.d.ts +3 -0
- package/dist/utils/render-to-container.js +10 -0
- package/dist/utils/render.d.ts +9 -0
- package/dist/utils/render.js +87 -0
- package/dist/utils/rubberband.d.ts +2 -0
- package/dist/utils/rubberband.js +11 -0
- package/dist/utils/should-render.d.ts +10 -0
- package/dist/utils/should-render.js +12 -0
- package/dist/utils/supports-passive.d.ts +1 -0
- package/dist/utils/supports-passive.js +13 -0
- package/dist/utils/to-css-length.d.ts +1 -0
- package/dist/utils/to-css-length.js +3 -0
- package/dist/utils/type.d.ts +65 -0
- package/dist/utils/type.js +48 -0
- package/dist/utils/use-initialized.d.ts +1 -0
- package/dist/utils/use-initialized.js +8 -0
- package/dist/utils/use-isomorphic-update-layout-effect.d.ts +2 -0
- package/dist/utils/use-isomorphic-update-layout-effect.js +2 -0
- package/dist/utils/use-lock-scroll.d.ts +2 -0
- package/dist/utils/use-lock-scroll.js +81 -0
- package/dist/utils/use-mutation-effect.d.ts +3 -0
- package/dist/utils/use-mutation-effect.js +26 -0
- package/dist/utils/use-props-value.d.ts +8 -0
- package/dist/utils/use-props-value.js +22 -0
- package/dist/utils/use-resize-effect.d.ts +2 -0
- package/dist/utils/use-resize-effect.js +23 -0
- package/dist/utils/use-touch.d.ts +17 -0
- package/dist/utils/use-touch.js +63 -0
- package/dist/utils/validate.d.ts +1 -0
- package/dist/utils/validate.js +4 -0
- package/dist/utils/with-default-props.d.ts +9 -0
- package/dist/utils/with-default-props.js +33 -0
- package/dist/utils/with-stop-propagation.d.ts +4 -0
- package/dist/utils/with-stop-propagation.js +38 -0
- package/dist/utils/zIndex.d.ts +1 -0
- package/dist/utils/zIndex.js +4 -0
- package/dist/utils/zindexContext.d.ts +3 -0
- package/dist/utils/zindexContext.js +6 -0
- package/package.json +104 -0
- package/readme.md +43 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { DemoBlock } from "../../DemoBlock";
|
|
9
|
+
import { CalendarDatetimePicker } from "../CalendarDatetimePicker";
|
|
10
|
+
import Button from "../../Button";
|
|
11
|
+
import Toast from "../../Toast";
|
|
12
|
+
export default (function () {
|
|
13
|
+
var toastContainer = React.useRef();
|
|
14
|
+
var _React$useState = React.useState(false),
|
|
15
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
16
|
+
open = _React$useState2[0],
|
|
17
|
+
setOpen = _React$useState2[1];
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
ref: toastContainer
|
|
20
|
+
}), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
21
|
+
title: "\u65E5\u671F\u65F6\u95F4\u9009\u62E9\u5668"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(CalendarDatetimePicker, {
|
|
23
|
+
open: open,
|
|
24
|
+
afterOpenChange: function afterOpenChange(o) {
|
|
25
|
+
setOpen(o);
|
|
26
|
+
},
|
|
27
|
+
onOk: function onOk(date) {
|
|
28
|
+
Toast.show({
|
|
29
|
+
getContainer: function getContainer() {
|
|
30
|
+
return toastContainer.current;
|
|
31
|
+
},
|
|
32
|
+
content: "".concat(date.getFullYear(), "-").concat(date.getMonth() + 1, "-").concat(date.getDate(), " ").concat(date.getHours(), ":").concat(date.getMinutes())
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
36
|
+
block: true,
|
|
37
|
+
onClick: function onClick() {
|
|
38
|
+
setOpen(true);
|
|
39
|
+
}
|
|
40
|
+
}, "\u65E5\u671F\u65F6\u95F4\u9009\u62E9\u5668")));
|
|
41
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
@import "@trionesdev/antd-mobile-base-react/dist/style/variable";
|
|
2
|
+
|
|
3
|
+
$calendarDatetimePickerCls: 'triones-antm-calendar-datetime-picker';
|
|
4
|
+
|
|
5
|
+
.#{$calendarDatetimePickerCls} {
|
|
6
|
+
border-top-left-radius: $trionesBorderRadius;
|
|
7
|
+
border-top-right-radius: $trionesBorderRadius;
|
|
8
|
+
|
|
9
|
+
&-header {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
border-bottom: 1Px solid $trionesBorderColor;
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
&-display {
|
|
16
|
+
display: flex;
|
|
17
|
+
padding-left: 8Px;
|
|
18
|
+
|
|
19
|
+
&-date {
|
|
20
|
+
padding-inline: 8Px;
|
|
21
|
+
cursor: default;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-time {
|
|
27
|
+
padding-inline: 12Px;
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
cursor: default;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&-active {
|
|
34
|
+
color: $trionesColorText;
|
|
35
|
+
font-weight: bold;
|
|
36
|
+
background-color: $trionesColorBgTextActive;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&-button {
|
|
41
|
+
padding: 12Px 16Px;
|
|
42
|
+
|
|
43
|
+
&-cancel {
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&-ok {
|
|
47
|
+
color: $trionesColorPrimary;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
&-body {
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import React, { memo, useEffect, useRef } from 'react';
|
|
9
|
+
import Calendar from "../Calendar";
|
|
10
|
+
import "./style.scss";
|
|
11
|
+
import ConfigProvider from "../ConfigProvider";
|
|
12
|
+
import Popup from "../Popup";
|
|
13
|
+
var cls = 'triones-antm-calendar-picker';
|
|
14
|
+
export var CalendarPicker = /*#__PURE__*/memo(function (_ref) {
|
|
15
|
+
var mouth = _ref.mouth,
|
|
16
|
+
open = _ref.open,
|
|
17
|
+
title = _ref.title,
|
|
18
|
+
afterOpenChange = _ref.afterOpenChange,
|
|
19
|
+
value = _ref.value,
|
|
20
|
+
onOk = _ref.onOk,
|
|
21
|
+
onCancel = _ref.onCancel,
|
|
22
|
+
onClose = _ref.onClose;
|
|
23
|
+
var _ConfigProvider$useCo = ConfigProvider.useConfig(),
|
|
24
|
+
locale = _ConfigProvider$useCo.locale;
|
|
25
|
+
var _React$useState = React.useState(open || false),
|
|
26
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
27
|
+
innerOpen = _React$useState2[0],
|
|
28
|
+
setInnerOpen = _React$useState2[1];
|
|
29
|
+
var valueRef = useRef();
|
|
30
|
+
var handleClose = function handleClose() {
|
|
31
|
+
setInnerOpen(false);
|
|
32
|
+
onClose === null || onClose === void 0 || onClose();
|
|
33
|
+
};
|
|
34
|
+
var handleOk = function handleOk() {
|
|
35
|
+
onOk === null || onOk === void 0 || onOk(valueRef.current);
|
|
36
|
+
handleClose();
|
|
37
|
+
};
|
|
38
|
+
var handelCancel = function handelCancel() {
|
|
39
|
+
onCancel === null || onCancel === void 0 || onCancel();
|
|
40
|
+
handleClose();
|
|
41
|
+
};
|
|
42
|
+
useEffect(function () {
|
|
43
|
+
afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(innerOpen);
|
|
44
|
+
}, [innerOpen]);
|
|
45
|
+
useEffect(function () {
|
|
46
|
+
if (value !== undefined) {
|
|
47
|
+
if (value !== valueRef.current) {
|
|
48
|
+
valueRef.current = value;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}, [value]);
|
|
52
|
+
useEffect(function () {
|
|
53
|
+
if (open === undefined) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (open === innerOpen) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
setInnerOpen(open);
|
|
60
|
+
}, [open]);
|
|
61
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
62
|
+
open: innerOpen,
|
|
63
|
+
onClose: function onClose() {
|
|
64
|
+
setInnerOpen(false);
|
|
65
|
+
}
|
|
66
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: classNames("".concat(cls))
|
|
68
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: classNames("".concat(cls, "-header"))
|
|
70
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
71
|
+
className: classNames("".concat(cls, "-header-button"), "".concat(cls, "-header-cancel")),
|
|
72
|
+
onClick: handelCancel
|
|
73
|
+
}, locale.common.cancel), title && /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: classNames("".concat(cls, "-header-title"))
|
|
75
|
+
}, title), /*#__PURE__*/React.createElement("a", {
|
|
76
|
+
className: classNames("".concat(cls, "-header-button"), "".concat(cls, "-header-button-ok")),
|
|
77
|
+
onClick: handleOk
|
|
78
|
+
}, locale.common.confirm)), /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: classNames("".concat(cls, "-body"))
|
|
80
|
+
}, /*#__PURE__*/React.createElement(Calendar, {
|
|
81
|
+
mouth: mouth,
|
|
82
|
+
value: value,
|
|
83
|
+
onChange: function onChange(date) {
|
|
84
|
+
valueRef.current = date;
|
|
85
|
+
}
|
|
86
|
+
}))));
|
|
87
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { memo, useEffect, useRef } from "react";
|
|
8
|
+
import Popup from "../Popup";
|
|
9
|
+
import classNames from "classnames";
|
|
10
|
+
import Calendar from "../Calendar";
|
|
11
|
+
import "./style.scss";
|
|
12
|
+
import ConfigProvider from "../ConfigProvider";
|
|
13
|
+
var cls = 'triones-antm-calendar-picker';
|
|
14
|
+
export var CalendarRangePicker = /*#__PURE__*/memo(function (_ref) {
|
|
15
|
+
var mouth = _ref.mouth,
|
|
16
|
+
open = _ref.open,
|
|
17
|
+
title = _ref.title,
|
|
18
|
+
afterOpenChange = _ref.afterOpenChange,
|
|
19
|
+
value = _ref.value,
|
|
20
|
+
onOk = _ref.onOk,
|
|
21
|
+
onCancel = _ref.onCancel,
|
|
22
|
+
onClose = _ref.onClose;
|
|
23
|
+
var _ConfigProvider$useCo = ConfigProvider.useConfig(),
|
|
24
|
+
locale = _ConfigProvider$useCo.locale;
|
|
25
|
+
var _React$useState = React.useState(open || false),
|
|
26
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
27
|
+
innerOpen = _React$useState2[0],
|
|
28
|
+
setInnerOpen = _React$useState2[1];
|
|
29
|
+
var valueRef = useRef();
|
|
30
|
+
var handleClose = function handleClose() {
|
|
31
|
+
setInnerOpen(false);
|
|
32
|
+
onClose === null || onClose === void 0 || onClose();
|
|
33
|
+
};
|
|
34
|
+
var handleOk = function handleOk() {
|
|
35
|
+
onOk === null || onOk === void 0 || onOk(valueRef.current);
|
|
36
|
+
handleClose();
|
|
37
|
+
};
|
|
38
|
+
var handelCancel = function handelCancel() {
|
|
39
|
+
onCancel === null || onCancel === void 0 || onCancel();
|
|
40
|
+
handleClose();
|
|
41
|
+
};
|
|
42
|
+
useEffect(function () {
|
|
43
|
+
afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(innerOpen);
|
|
44
|
+
}, [innerOpen]);
|
|
45
|
+
useEffect(function () {
|
|
46
|
+
if (value !== undefined) {
|
|
47
|
+
if (value !== valueRef.current) {
|
|
48
|
+
valueRef.current = value;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}, [value]);
|
|
52
|
+
useEffect(function () {
|
|
53
|
+
if (open === undefined) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (open === innerOpen) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
setInnerOpen(open);
|
|
60
|
+
}, [open]);
|
|
61
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
62
|
+
open: innerOpen,
|
|
63
|
+
onClose: function onClose() {
|
|
64
|
+
setInnerOpen(false);
|
|
65
|
+
}
|
|
66
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: classNames("".concat(cls))
|
|
68
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: classNames("".concat(cls, "-header"))
|
|
70
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
71
|
+
className: classNames("".concat(cls, "-header-button")),
|
|
72
|
+
onClick: handelCancel
|
|
73
|
+
}, locale.common.cancel), title && /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: classNames("".concat(cls, "-header-title"))
|
|
75
|
+
}, title), /*#__PURE__*/React.createElement("a", {
|
|
76
|
+
className: classNames("".concat(cls, "-header-button")),
|
|
77
|
+
onClick: handleOk
|
|
78
|
+
}, locale.common.confirm)), /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: classNames("".concat(cls, "-body"))
|
|
80
|
+
}, /*#__PURE__*/React.createElement(Calendar.Range, {
|
|
81
|
+
mouth: mouth,
|
|
82
|
+
value: value,
|
|
83
|
+
onChange: function onChange(date) {
|
|
84
|
+
valueRef.current = date;
|
|
85
|
+
}
|
|
86
|
+
}))));
|
|
87
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { DemoBlock } from "../../DemoBlock";
|
|
9
|
+
import Button from "../../Button";
|
|
10
|
+
import CalendarPicker from "../index";
|
|
11
|
+
import Toast from "../../Toast";
|
|
12
|
+
export default (function () {
|
|
13
|
+
var toastContainer = React.useRef();
|
|
14
|
+
var _React$useState = React.useState(false),
|
|
15
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
16
|
+
open = _React$useState2[0],
|
|
17
|
+
setOpen = _React$useState2[1];
|
|
18
|
+
var _React$useState3 = React.useState(false),
|
|
19
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
20
|
+
open2 = _React$useState4[0],
|
|
21
|
+
setOpen2 = _React$useState4[1];
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
ref: toastContainer
|
|
24
|
+
}), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
25
|
+
title: "\u65E5\u671F\u9009\u62E9\u5668"
|
|
26
|
+
}, /*#__PURE__*/React.createElement(CalendarPicker, {
|
|
27
|
+
open: open,
|
|
28
|
+
afterOpenChange: function afterOpenChange(o) {
|
|
29
|
+
setOpen(o);
|
|
30
|
+
},
|
|
31
|
+
onOk: function onOk(date) {
|
|
32
|
+
Toast.show({
|
|
33
|
+
getContainer: function getContainer() {
|
|
34
|
+
return toastContainer.current;
|
|
35
|
+
},
|
|
36
|
+
content: "".concat(date.getFullYear(), "-").concat(date.getMonth() + 1, "-").concat(date.getDate())
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
40
|
+
block: true,
|
|
41
|
+
onClick: function onClick() {
|
|
42
|
+
setOpen(true);
|
|
43
|
+
}
|
|
44
|
+
}, "\u65E5\u5386\u9009\u62E9\u5668")), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
45
|
+
title: "\u65E5\u5386\u9009\u62E9\u5668(\u533A\u95F4)"
|
|
46
|
+
}, /*#__PURE__*/React.createElement(CalendarPicker.Range, {
|
|
47
|
+
open: open2,
|
|
48
|
+
afterOpenChange: function afterOpenChange(o) {
|
|
49
|
+
setOpen2(o);
|
|
50
|
+
},
|
|
51
|
+
onOk: function onOk(date) {
|
|
52
|
+
var _$getMonth, _$getMonth2;
|
|
53
|
+
Toast.show({
|
|
54
|
+
getContainer: function getContainer() {
|
|
55
|
+
return toastContainer.current;
|
|
56
|
+
},
|
|
57
|
+
content: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "".concat(date[0].getFullYear(), "-").concat((_$getMonth = date[0].getMonth()) !== null && _$getMonth !== void 0 ? _$getMonth : +1, "-").concat(date[0].getDate())), /*#__PURE__*/React.createElement("div", null, "".concat(date[1].getFullYear(), "-").concat((_$getMonth2 = date[1].getMonth()) !== null && _$getMonth2 !== void 0 ? _$getMonth2 : +1, "-").concat(date[1].getDate())))
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
61
|
+
block: true,
|
|
62
|
+
onClick: function onClick() {
|
|
63
|
+
setOpen2(true);
|
|
64
|
+
}
|
|
65
|
+
}, "\u65E5\u5386\u9009\u62E9\u5668(\u533A\u95F4)")));
|
|
66
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CalendarPicker as InternalCalendarPicker } from "./calendar-picker";
|
|
2
|
+
import { CalendarRangePicker } from "./calendar-range-picker";
|
|
3
|
+
import { CalendarPickerProps } from "./types";
|
|
4
|
+
type CompoundedComponent = typeof InternalCalendarPicker & {
|
|
5
|
+
Range: typeof CalendarRangePicker;
|
|
6
|
+
};
|
|
7
|
+
declare const CalendarPicker: CompoundedComponent;
|
|
8
|
+
export type { CalendarPickerProps };
|
|
9
|
+
export default CalendarPicker;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@import "@trionesdev/antd-mobile-base-react/dist/style/variable";
|
|
2
|
+
|
|
3
|
+
$calendarPickerCls: 'triones-antm-calendar-picker';
|
|
4
|
+
|
|
5
|
+
.#{$calendarPickerCls} {
|
|
6
|
+
border-top-left-radius: $trionesBorderRadius;
|
|
7
|
+
border-top-right-radius: $trionesBorderRadius;
|
|
8
|
+
|
|
9
|
+
&-header {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
border-bottom: 1Px solid $trionesBorderColor;
|
|
13
|
+
padding: 4Px;
|
|
14
|
+
&-button {
|
|
15
|
+
padding: 8Px 12Px;
|
|
16
|
+
|
|
17
|
+
&-cancel {
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&-ok {
|
|
21
|
+
color: $trionesColorPrimary;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-body {
|
|
29
|
+
pointer-events: unset;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type CalendarPickerProps = {
|
|
3
|
+
mouth?: Date;
|
|
4
|
+
open?: boolean;
|
|
5
|
+
title?: React.ReactNode;
|
|
6
|
+
afterOpenChange?: (open: boolean) => void;
|
|
7
|
+
value?: Date;
|
|
8
|
+
onOk?: (value?: Date) => void;
|
|
9
|
+
onCancel?: () => void;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
};
|
|
12
|
+
export type CalendarPickerRangeProps = {
|
|
13
|
+
mouth?: Date;
|
|
14
|
+
open?: boolean;
|
|
15
|
+
title?: React.ReactNode;
|
|
16
|
+
afterOpenChange?: (open: boolean) => void;
|
|
17
|
+
value?: Date[];
|
|
18
|
+
onOk?: (value?: Date[]) => void;
|
|
19
|
+
onCancel?: () => void;
|
|
20
|
+
onClose?: () => void;
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* compact: true
|
|
3
|
+
*/
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { DemoBlock } from "../../DemoBlock";
|
|
7
|
+
import { Card } from "../..";
|
|
8
|
+
import "./base.scss";
|
|
9
|
+
var classPrefix = "card-demo";
|
|
10
|
+
export default (function () {
|
|
11
|
+
var onClick = function onClick() {
|
|
12
|
+
console.log('点击了卡片');
|
|
13
|
+
};
|
|
14
|
+
var onHeaderClick = function onHeaderClick() {
|
|
15
|
+
console.log('点击了卡片Header区域');
|
|
16
|
+
};
|
|
17
|
+
var onBodyClick = function onBodyClick() {
|
|
18
|
+
console.log('点击了卡片Body区域');
|
|
19
|
+
};
|
|
20
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DemoBlock, {
|
|
21
|
+
title: "\u57FA\u7840\u7528\u6CD5"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
23
|
+
title: "\u5361\u7247\u6807\u9898",
|
|
24
|
+
onClick: onClick
|
|
25
|
+
}, "\u5361\u7247\u5185\u5BB9")), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
26
|
+
title: "\u6CA1\u6709\u5361\u7247\u5185\u5BB9"
|
|
27
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
28
|
+
title: "\u5361\u7247\u6807\u9898",
|
|
29
|
+
onClick: onClick
|
|
30
|
+
})), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
31
|
+
title: "\u6CA1\u6709\u5361\u7247\u6807\u9898"
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
33
|
+
onClick: onClick
|
|
34
|
+
}, "\u5361\u7247\u5185\u5BB9")), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
35
|
+
title: "\u81EA\u5B9A\u4E49\u5361\u7247\u5185\u5BB9"
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
37
|
+
title: /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
style: {
|
|
39
|
+
fontWeight: 'normal'
|
|
40
|
+
}
|
|
41
|
+
}, "\u5361\u7247\u6807\u9898"),
|
|
42
|
+
onBodyClick: onBodyClick,
|
|
43
|
+
onHeaderClick: onHeaderClick,
|
|
44
|
+
style: {
|
|
45
|
+
borderRadius: '16px'
|
|
46
|
+
}
|
|
47
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: classNames("".concat(classPrefix, "-content"))
|
|
49
|
+
}, "\u5361\u7247\u5185\u5BB9"), /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: classNames("".concat(classPrefix, "-footer")),
|
|
51
|
+
onClick: function onClick(e) {
|
|
52
|
+
return e.stopPropagation();
|
|
53
|
+
}
|
|
54
|
+
}))), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
55
|
+
title: "\u81EA\u5B9A\u4E49\u5361\u7247\u6837\u5F0F"
|
|
56
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
57
|
+
styles: {
|
|
58
|
+
header: {
|
|
59
|
+
color: '#1677ff'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
bodyClassName: classNames("".concat(classPrefix, "-customBody")),
|
|
63
|
+
title: "\u5361\u7247\u6807\u9898"
|
|
64
|
+
}, "\u5361\u7247\u5185\u5BB9")));
|
|
65
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
$class-prefix-card: 'card-demo';
|
|
2
|
+
|
|
3
|
+
.#{$class-prefix-card} {
|
|
4
|
+
&-content {
|
|
5
|
+
height: 50px;
|
|
6
|
+
}
|
|
7
|
+
&-footer {
|
|
8
|
+
padding-top: 11px;
|
|
9
|
+
border-top: 1px solid #e5e5e5;
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: flex-end;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&-customBody {
|
|
15
|
+
color: green;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { DemoBlock } from "../../DemoBlock";
|
|
9
|
+
import Button from "../../Button";
|
|
10
|
+
import CascaderPicker from "../index";
|
|
11
|
+
export default (function () {
|
|
12
|
+
var _React$useState = React.useState(false),
|
|
13
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
14
|
+
open = _React$useState2[0],
|
|
15
|
+
setOpen = _React$useState2[1];
|
|
16
|
+
var options = [{
|
|
17
|
+
value: "jiangsu",
|
|
18
|
+
label: "江苏",
|
|
19
|
+
children: [{
|
|
20
|
+
value: "nanjing",
|
|
21
|
+
label: '南京'
|
|
22
|
+
}, {
|
|
23
|
+
value: "wuxi",
|
|
24
|
+
label: '无锡'
|
|
25
|
+
}, {
|
|
26
|
+
value: "changzhou",
|
|
27
|
+
label: '常州'
|
|
28
|
+
}, {
|
|
29
|
+
value: "suzhou",
|
|
30
|
+
label: '苏州',
|
|
31
|
+
children: [{
|
|
32
|
+
value: "gushu",
|
|
33
|
+
label: '姑苏区'
|
|
34
|
+
}]
|
|
35
|
+
}]
|
|
36
|
+
}, {
|
|
37
|
+
value: "zhejiang",
|
|
38
|
+
label: "浙江",
|
|
39
|
+
children: [{
|
|
40
|
+
value: "hangzhou",
|
|
41
|
+
label: '杭州'
|
|
42
|
+
}, {
|
|
43
|
+
value: "wenzhou",
|
|
44
|
+
label: '温州'
|
|
45
|
+
}]
|
|
46
|
+
}, {
|
|
47
|
+
value: "shanghai",
|
|
48
|
+
label: "上海"
|
|
49
|
+
}, {
|
|
50
|
+
value: "shandong",
|
|
51
|
+
label: '山东'
|
|
52
|
+
}, {
|
|
53
|
+
value: "henan",
|
|
54
|
+
label: '河南'
|
|
55
|
+
}, {
|
|
56
|
+
value: "hebei",
|
|
57
|
+
label: '河北'
|
|
58
|
+
}, {
|
|
59
|
+
value: "hunan",
|
|
60
|
+
label: '湖南'
|
|
61
|
+
}, {
|
|
62
|
+
value: "hubei",
|
|
63
|
+
label: '湖北'
|
|
64
|
+
}];
|
|
65
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DemoBlock, {
|
|
66
|
+
title: "\u57FA\u672C\u4F7F\u7528"
|
|
67
|
+
}, /*#__PURE__*/React.createElement(CascaderPicker, {
|
|
68
|
+
open: open,
|
|
69
|
+
options: options,
|
|
70
|
+
onOk: function onOk(value) {
|
|
71
|
+
console.log(value);
|
|
72
|
+
},
|
|
73
|
+
style: {
|
|
74
|
+
height: 300
|
|
75
|
+
},
|
|
76
|
+
onClose: function onClose() {
|
|
77
|
+
setOpen(false);
|
|
78
|
+
}
|
|
79
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
80
|
+
block: true,
|
|
81
|
+
onClick: function onClick() {
|
|
82
|
+
setOpen(true);
|
|
83
|
+
}
|
|
84
|
+
}, "\u7EA7\u8054\u9009\u62E9")));
|
|
85
|
+
});
|