@trionesdev/antd-mobile-base-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/README.md +23 -0
- package/dist/ActionSheet/ActionSheet.d.ts +25 -0
- package/dist/ActionSheet/ActionSheet.js +77 -0
- package/dist/ActionSheet/index.d.ts +3 -0
- package/dist/ActionSheet/index.js +2 -0
- package/dist/ActionSheet/style.scss +51 -0
- package/dist/Alert/alert.d.ts +32 -0
- package/dist/Alert/alert.js +49 -0
- package/dist/Alert/index.d.ts +3 -0
- package/dist/Alert/index.js +2 -0
- package/dist/Alert/style.scss +69 -0
- package/dist/Avatar/avatar.d.ts +14 -0
- package/dist/Avatar/avatar.js +40 -0
- package/dist/Avatar/index.d.ts +3 -0
- package/dist/Avatar/index.js +2 -0
- package/dist/Avatar/style.scss +16 -0
- package/dist/Badge/badge.d.ts +14 -0
- package/dist/Badge/badge.js +82 -0
- package/dist/Badge/index.d.ts +3 -0
- package/dist/Badge/index.js +2 -0
- package/dist/Badge/style.scss +100 -0
- package/dist/Card/card.d.ts +21 -0
- package/dist/Card/card.js +48 -0
- package/dist/Card/index.d.ts +4 -0
- package/dist/Card/index.js +3 -0
- package/dist/Card/native-props.d.ts +8 -0
- package/dist/Card/native-props.js +27 -0
- package/dist/Card/style.scss +35 -0
- package/dist/CascaderPicker/cascader-picker.d.ts +27 -0
- package/dist/CascaderPicker/cascader-picker.js +88 -0
- package/dist/CascaderPicker/index.d.ts +3 -0
- package/dist/CascaderPicker/index.js +2 -0
- package/dist/CascaderPicker/style.scss +42 -0
- package/dist/CascaderView/cascader-column-item.d.ts +8 -0
- package/dist/CascaderView/cascader-column-item.js +19 -0
- package/dist/CascaderView/cascader-column.d.ts +9 -0
- package/dist/CascaderView/cascader-column.js +26 -0
- package/dist/CascaderView/cascader-view.d.ts +18 -0
- package/dist/CascaderView/cascader-view.js +243 -0
- package/dist/CascaderView/index.d.ts +3 -0
- package/dist/CascaderView/index.js +2 -0
- package/dist/CascaderView/style.scss +22 -0
- package/dist/CascaderView/types.d.ts +11 -0
- package/dist/CascaderView/types.js +1 -0
- package/dist/Cell/CellGroup.d.ts +3 -0
- package/dist/Cell/CellGroup.js +41 -0
- package/dist/Cell/cell.d.ts +4 -0
- package/dist/Cell/cell.js +31 -0
- package/dist/Cell/index.d.ts +9 -0
- package/dist/Cell/index.js +5 -0
- package/dist/Cell/styles.scss +52 -0
- package/dist/Cell/types.d.ts +41 -0
- package/dist/Cell/types.js +1 -0
- package/dist/Checkbox/checkbox-button.d.ts +3 -0
- package/dist/Checkbox/checkbox-button.js +42 -0
- package/dist/Checkbox/checkbox-group.d.ts +3 -0
- package/dist/Checkbox/checkbox-group.js +32 -0
- package/dist/Checkbox/checkbox.d.ts +4 -0
- package/dist/Checkbox/checkbox.js +47 -0
- package/dist/Checkbox/group-context.d.ts +3 -0
- package/dist/Checkbox/group-context.js +2 -0
- package/dist/Checkbox/index.d.ts +11 -0
- package/dist/Checkbox/index.js +7 -0
- package/dist/Checkbox/index.scss +151 -0
- package/dist/Checkbox/types.d.ts +20 -0
- package/dist/Checkbox/types.js +1 -0
- package/dist/ConfigProvider/config-provider.d.ts +57 -0
- package/dist/ConfigProvider/config-provider.js +41 -0
- package/dist/ConfigProvider/index.d.ts +9 -0
- package/dist/ConfigProvider/index.js +6 -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/DescriptionItem.d.ts +5 -0
- package/dist/Descriptions/DescriptionItem.js +67 -0
- package/dist/Descriptions/Descriptions.d.ts +4 -0
- package/dist/Descriptions/Descriptions.js +229 -0
- package/dist/Descriptions/index.d.ts +9 -0
- package/dist/Descriptions/index.js +5 -0
- package/dist/Descriptions/style.scss +65 -0
- package/dist/Descriptions/types.d.ts +90 -0
- package/dist/Descriptions/types.js +1 -0
- package/dist/Divider/divider.d.ts +17 -0
- package/dist/Divider/divider.js +36 -0
- package/dist/Divider/index.d.ts +3 -0
- package/dist/Divider/index.js +2 -0
- package/dist/Divider/style.scss +62 -0
- package/dist/Ellipsis/ellipsis.d.ts +16 -0
- package/dist/Ellipsis/ellipsis.js +77 -0
- package/dist/Ellipsis/index.d.ts +3 -0
- package/dist/Ellipsis/index.js +2 -0
- package/dist/Ellipsis/style.scss +13 -0
- package/dist/Ellipsis/useMeasure.d.ts +2 -0
- package/dist/Ellipsis/useMeasure.js +123 -0
- package/dist/Empty/empty-icon.d.ts +3 -0
- package/dist/Empty/empty-icon.js +12 -0
- package/dist/Empty/empty.d.ts +12 -0
- package/dist/Empty/empty.js +48 -0
- package/dist/Empty/images/empty.png +0 -0
- package/dist/Empty/index.d.ts +3 -0
- package/dist/Empty/index.js +2 -0
- package/dist/Empty/style.scss +29 -0
- package/dist/ErrorBlock/create-error-block.d.ts +13 -0
- package/dist/ErrorBlock/create-error-block.js +44 -0
- package/dist/ErrorBlock/demo/base.d.ts +3 -0
- package/dist/ErrorBlock/demo/base.js +23 -0
- package/dist/ErrorBlock/error-block.d.ts +2 -0
- package/dist/ErrorBlock/error-block.js +9 -0
- package/dist/ErrorBlock/images/busy.d.ts +2 -0
- package/dist/ErrorBlock/images/busy.js +90 -0
- package/dist/ErrorBlock/images/busy.png +0 -0
- package/dist/ErrorBlock/images/default.d.ts +2 -0
- package/dist/ErrorBlock/images/default.js +166 -0
- package/dist/ErrorBlock/images/default.png +0 -0
- package/dist/ErrorBlock/images/disconnected.d.ts +2 -0
- package/dist/ErrorBlock/images/disconnected.js +123 -0
- package/dist/ErrorBlock/images/disconnected.png +0 -0
- package/dist/ErrorBlock/images/empty.d.ts +2 -0
- package/dist/ErrorBlock/images/empty.js +119 -0
- package/dist/ErrorBlock/images/empty.png +0 -0
- package/dist/ErrorBlock/images/index.d.ts +4 -0
- package/dist/ErrorBlock/images/index.js +4 -0
- package/dist/ErrorBlock/index.d.ts +7 -0
- package/dist/ErrorBlock/index.js +3 -0
- package/dist/ErrorBlock/style.scss +62 -0
- package/dist/Footer/footer.d.ts +20 -0
- package/dist/Footer/footer.js +66 -0
- package/dist/Footer/index.d.ts +3 -0
- package/dist/Footer/index.js +2 -0
- package/dist/Footer/style.scss +55 -0
- package/dist/Form/FormItem/form-item-input.d.ts +15 -0
- package/dist/Form/FormItem/form-item-input.js +39 -0
- package/dist/Form/FormItem/form-item-label.d.ts +13 -0
- package/dist/Form/FormItem/form-item-label.js +25 -0
- package/dist/Form/FormItem/form-item.d.ts +21 -0
- package/dist/Form/FormItem/form-item.js +70 -0
- package/dist/Form/FormItem/index.d.ts +5 -0
- package/dist/Form/FormItem/index.js +3 -0
- package/dist/Form/context.d.ts +12 -0
- package/dist/Form/context.js +6 -0
- package/dist/Form/form.d.ts +44 -0
- package/dist/Form/form.js +31 -0
- package/dist/Form/hooks/useForm.d.ts +2 -0
- package/dist/Form/hooks/useForm.js +24 -0
- package/dist/Form/hooks/useFormContext.d.ts +2 -0
- package/dist/Form/hooks/useFormContext.js +6 -0
- package/dist/Form/index.d.ts +12 -0
- package/dist/Form/index.js +8 -0
- package/dist/Form/interface.d.ts +3 -0
- package/dist/Form/interface.js +1 -0
- package/dist/Form/style.scss +45 -0
- package/dist/Grid/grid.d.ts +16 -0
- package/dist/Grid/grid.js +35 -0
- package/dist/Grid/index.d.ts +7 -0
- package/dist/Grid/index.js +4 -0
- package/dist/Grid/style.scss +17 -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/Input/base-input.d.ts +14 -0
- package/dist/Input/base-input.js +63 -0
- package/dist/Input/index.d.ts +12 -0
- package/dist/Input/index.js +9 -0
- package/dist/Input/index.scss +173 -0
- package/dist/Input/input-affix-wrapper.d.ts +8 -0
- package/dist/Input/input-affix-wrapper.js +50 -0
- package/dist/Input/input-opt.d.ts +16 -0
- package/dist/Input/input-opt.js +93 -0
- package/dist/Input/input-password.d.ts +7 -0
- package/dist/Input/input-password.js +47 -0
- package/dist/Input/input.d.ts +15 -0
- package/dist/Input/input.js +47 -0
- package/dist/Input/textarea.d.ts +13 -0
- package/dist/Input/textarea.js +45 -0
- package/dist/Input/types.d.ts +1 -0
- package/dist/Input/types.js +1 -0
- package/dist/InputNumber/index.d.ts +3 -0
- package/dist/InputNumber/index.js +2 -0
- package/dist/InputNumber/input-number.d.ts +13 -0
- package/dist/InputNumber/input-number.js +69 -0
- package/dist/InputNumber/style.scss +43 -0
- package/dist/Mask/index.d.ts +3 -0
- package/dist/Mask/index.js +2 -0
- package/dist/Mask/mask-modal.d.ts +45 -0
- package/dist/Mask/mask-modal.js +32 -0
- package/dist/Mask/mask.d.ts +5 -0
- package/dist/Mask/mask.js +19 -0
- package/dist/Mask/style.scss +20 -0
- package/dist/NavBar/index.d.ts +3 -0
- package/dist/NavBar/index.js +2 -0
- package/dist/NavBar/nav-bar.d.ts +31 -0
- package/dist/NavBar/nav-bar.js +36 -0
- package/dist/NavBar/style.scss +61 -0
- package/dist/NoticeBar/index.d.ts +3 -0
- package/dist/NoticeBar/index.js +2 -0
- package/dist/NoticeBar/notice-bar.d.ts +64 -0
- package/dist/NoticeBar/notice-bar.js +119 -0
- package/dist/NoticeBar/style.scss +130 -0
- package/dist/PageIndicator/index.d.ts +3 -0
- package/dist/PageIndicator/index.js +2 -0
- package/dist/PageIndicator/page-indicator.d.ts +10 -0
- package/dist/PageIndicator/page-indicator.js +27 -0
- package/dist/PageIndicator/style.scss +59 -0
- package/dist/Picker/index.d.ts +3 -0
- package/dist/Picker/index.js +2 -0
- package/dist/Picker/picker.d.ts +19 -0
- package/dist/Picker/picker.js +97 -0
- package/dist/Picker/style.scss +41 -0
- package/dist/PickerView/index.d.ts +4 -0
- package/dist/PickerView/index.js +2 -0
- package/dist/PickerView/picker-view-column-item.d.ts +7 -0
- package/dist/PickerView/picker-view-column-item.js +11 -0
- package/dist/PickerView/picker-view-column.d.ts +10 -0
- package/dist/PickerView/picker-view-column.js +117 -0
- package/dist/PickerView/picker-view.d.ts +12 -0
- package/dist/PickerView/picker-view.js +60 -0
- package/dist/PickerView/style.scss +72 -0
- package/dist/PickerView/types.d.ts +4 -0
- package/dist/PickerView/types.js +1 -0
- package/dist/Popup/index.d.ts +3 -0
- package/dist/Popup/index.js +2 -0
- package/dist/Popup/popup-modal.d.ts +52 -0
- package/dist/Popup/popup-modal.js +74 -0
- package/dist/Popup/popup.d.ts +4 -0
- package/dist/Popup/popup.js +56 -0
- package/dist/Popup/style.scss +53 -0
- package/dist/Radio/GroupContext.d.ts +10 -0
- package/dist/Radio/GroupContext.js +2 -0
- package/dist/Radio/RadioButton.d.ts +3 -0
- package/dist/Radio/RadioButton.js +60 -0
- package/dist/Radio/RadioGroup.d.ts +3 -0
- package/dist/Radio/RadioGroup.js +60 -0
- package/dist/Radio/index.d.ts +11 -0
- package/dist/Radio/index.js +14 -0
- package/dist/Radio/radio.d.ts +4 -0
- package/dist/Radio/radio.js +78 -0
- package/dist/Radio/style.scss +138 -0
- package/dist/Radio/types.d.ts +58 -0
- package/dist/Radio/types.js +1 -0
- package/dist/Rate/index.d.ts +3 -0
- package/dist/Rate/index.js +2 -0
- package/dist/Rate/rate.d.ts +50 -0
- package/dist/Rate/rate.js +100 -0
- package/dist/Rate/style.scss +37 -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/Result/result.d.ts +10 -0
- package/dist/Result/result.js +28 -0
- package/dist/Result/style.scss +73 -0
- package/dist/Result/use-result-icon.d.ts +2 -0
- package/dist/Result/use-result-icon.js +53 -0
- package/dist/SafeArea/index.d.ts +4 -0
- package/dist/SafeArea/index.js +3 -0
- package/dist/SafeArea/safe-area.d.ts +14 -0
- package/dist/SafeArea/safe-area.js +23 -0
- package/dist/SafeArea/style.scss +18 -0
- package/dist/Scaffold/index.d.ts +3 -0
- package/dist/Scaffold/index.js +2 -0
- package/dist/Scaffold/scaffold.d.ts +11 -0
- package/dist/Scaffold/scaffold.js +19 -0
- package/dist/Scaffold/style.scss +16 -0
- package/dist/ScrollView/index.d.ts +4 -0
- package/dist/ScrollView/index.js +2 -0
- package/dist/ScrollView/scroll-view.d.ts +4 -0
- package/dist/ScrollView/scroll-view.js +55 -0
- package/dist/ScrollView/style.scss +19 -0
- package/dist/ScrollView/types.d.ts +26 -0
- package/dist/ScrollView/types.js +1 -0
- package/dist/SideBar/SideBarContext.d.ts +18 -0
- package/dist/SideBar/SideBarContext.js +2 -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/index.d.ts +3 -0
- package/dist/Space/index.js +2 -0
- package/dist/Space/space.d.ts +38 -0
- package/dist/Space/space.js +61 -0
- package/dist/Space/style.scss +77 -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/SpinLoading/spin-loading.d.ts +10 -0
- package/dist/SpinLoading/spin-loading.js +59 -0
- package/dist/SpinLoading/spin-loading.scss +40 -0
- package/dist/Steps/HorizontalSteps.d.ts +3 -0
- package/dist/Steps/HorizontalSteps.js +85 -0
- package/dist/Steps/Point.d.ts +6 -0
- package/dist/Steps/Point.js +13 -0
- package/dist/Steps/Steps.d.ts +4 -0
- package/dist/Steps/Steps.js +26 -0
- package/dist/Steps/VerticalSteps.d.ts +3 -0
- package/dist/Steps/VerticalSteps.js +92 -0
- package/dist/Steps/context.d.ts +8 -0
- package/dist/Steps/context.js +5 -0
- package/dist/Steps/index.d.ts +4 -0
- package/dist/Steps/index.js +2 -0
- package/dist/Steps/style.scss +146 -0
- package/dist/Steps/types.d.ts +23 -0
- package/dist/Steps/types.js +4 -0
- package/dist/Switch/index.d.ts +3 -0
- package/dist/Switch/index.js +2 -0
- package/dist/Switch/style.scss +128 -0
- package/dist/Switch/switch.d.ts +21 -0
- package/dist/Switch/switch.js +96 -0
- package/dist/TabBar/TabBarContext.d.ts +10 -0
- package/dist/TabBar/TabBarContext.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 +7 -0
- package/dist/TabBar/index.js +3 -0
- package/dist/TabBar/index.scss +36 -0
- package/dist/TabBar/tab-bar.d.ts +61 -0
- package/dist/TabBar/tab-bar.js +86 -0
- package/dist/Tabs/context.d.ts +11 -0
- package/dist/Tabs/context.js +4 -0
- package/dist/Tabs/demo/base.d.ts +3 -0
- package/dist/Tabs/demo/base.js +59 -0
- package/dist/Tabs/index.d.ts +9 -0
- package/dist/Tabs/index.js +5 -0
- package/dist/Tabs/style.scss +108 -0
- package/dist/Tabs/tab-nav.d.ts +9 -0
- package/dist/Tabs/tab-nav.js +25 -0
- package/dist/Tabs/tab-pane.d.ts +7 -0
- package/dist/Tabs/tab-pane.js +17 -0
- package/dist/Tabs/tab.d.ts +7 -0
- package/dist/Tabs/tab.js +6 -0
- package/dist/Tabs/tabs.d.ts +25 -0
- package/dist/Tabs/tabs.js +156 -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/Tag/style.scss +86 -0
- package/dist/Tag/tag.d.ts +30 -0
- package/dist/Tag/tag.js +44 -0
- package/dist/Toast/index.d.ts +5 -0
- package/dist/Toast/index.js +3 -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 +7 -0
- package/dist/Toast/toast.js +78 -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/VerificationCodeInput/style.scss +20 -0
- package/dist/VerificationCodeInput/verification-code-input.d.ts +24 -0
- package/dist/VerificationCodeInput/verification-code-input.js +99 -0
- package/dist/WaterMark/index.d.ts +3 -0
- package/dist/WaterMark/index.js +2 -0
- package/dist/WaterMark/style.scss +17 -0
- package/dist/WaterMark/water-mark.d.ts +22 -0
- package/dist/WaterMark/water-mark.js +108 -0
- package/dist/index.d.ts +90 -0
- package/dist/index.js +46 -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/style/index.d.ts +1 -0
- package/dist/style/index.js +5 -0
- package/dist/style/style.scss +52 -0
- package/dist/style/theme-dark.scss +24 -0
- package/dist/style/theme-default.scss +54 -0
- package/dist/style/variable.scss +168 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.js +1 -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/is-dev.d.ts +1 -0
- package/dist/utils/is-dev.js +1 -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/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/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/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) fengxiaotx@163.com
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @trionesdev/antd-mobile-base-react
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.com/package/@trionesdev/antd-mobile-base-react)
|
|
4
|
+
[](https://npmjs.com/package/@trionesdev/antd-mobile-base-react)
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
$ pnpm install
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
$ npm run dev
|
|
14
|
+
$ npm run build
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
TODO
|
|
20
|
+
|
|
21
|
+
## LICENSE
|
|
22
|
+
|
|
23
|
+
MIT
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
import "./style.scss";
|
|
3
|
+
type ActionSheetActionItemType = {
|
|
4
|
+
key?: any;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
};
|
|
8
|
+
export type ActionSheetProps = {
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
open?: boolean;
|
|
12
|
+
afterOpenChange?: (open: boolean) => void;
|
|
13
|
+
title?: React.ReactNode;
|
|
14
|
+
actions?: ActionSheetActionItemType[];
|
|
15
|
+
cancel?: React.ReactNode | false;
|
|
16
|
+
onCancel?: () => void;
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* @description 点击操作项后是否关闭
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
closeAfterClickAction?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare const ActionSheet: FC<ActionSheetProps>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
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 Popup from "../Popup";
|
|
9
|
+
import classNames from "classnames";
|
|
10
|
+
import "./style.scss";
|
|
11
|
+
var cls = 'triones-antm-action-sheet';
|
|
12
|
+
export var ActionSheet = function ActionSheet(_ref) {
|
|
13
|
+
var className = _ref.className,
|
|
14
|
+
style = _ref.style,
|
|
15
|
+
open = _ref.open,
|
|
16
|
+
afterOpenChange = _ref.afterOpenChange,
|
|
17
|
+
title = _ref.title,
|
|
18
|
+
actions = _ref.actions,
|
|
19
|
+
cancel = _ref.cancel,
|
|
20
|
+
onCancel = _ref.onCancel,
|
|
21
|
+
onClose = _ref.onClose,
|
|
22
|
+
_ref$closeAfterClickA = _ref.closeAfterClickAction,
|
|
23
|
+
closeAfterClickAction = _ref$closeAfterClickA === void 0 ? true : _ref$closeAfterClickA;
|
|
24
|
+
var _React$useState = React.useState(open || false),
|
|
25
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
26
|
+
innerOpen = _React$useState2[0],
|
|
27
|
+
setInnerOpen = _React$useState2[1];
|
|
28
|
+
var handleClose = function handleClose() {
|
|
29
|
+
setInnerOpen(false);
|
|
30
|
+
onClose === null || onClose === void 0 || onClose();
|
|
31
|
+
};
|
|
32
|
+
React.useEffect(function () {
|
|
33
|
+
if (open === undefined) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (open === innerOpen) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
setInnerOpen(open);
|
|
40
|
+
}, [open]);
|
|
41
|
+
React.useEffect(function () {
|
|
42
|
+
afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(innerOpen);
|
|
43
|
+
}, [innerOpen]);
|
|
44
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
45
|
+
open: open,
|
|
46
|
+
afterClose: function afterClose() {
|
|
47
|
+
setInnerOpen(false);
|
|
48
|
+
}
|
|
49
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: classNames(cls, className),
|
|
51
|
+
style: style
|
|
52
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
className: classNames("".concat(cls, "-body"))
|
|
54
|
+
}, title && /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: classNames("".concat(cls, "-title"))
|
|
56
|
+
}, title), actions && /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: classNames("".concat(cls, "-actions"))
|
|
58
|
+
}, actions.map(function (action) {
|
|
59
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
className: "".concat(cls, "-actions-item"),
|
|
61
|
+
key: action.key,
|
|
62
|
+
onClick: function onClick() {
|
|
63
|
+
var _action$onClick;
|
|
64
|
+
(_action$onClick = action.onClick) === null || _action$onClick === void 0 || _action$onClick.call(action);
|
|
65
|
+
if (closeAfterClickAction) {
|
|
66
|
+
handleClose();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}, action.children);
|
|
70
|
+
}))), cancel !== false && /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: classNames("".concat(cls, "-cancel")),
|
|
72
|
+
onClick: function onClick() {
|
|
73
|
+
onCancel === null || onCancel === void 0 || onCancel();
|
|
74
|
+
handleClose();
|
|
75
|
+
}
|
|
76
|
+
}, cancel || /*#__PURE__*/React.createElement("div", null, "\u53D6\u6D88"))));
|
|
77
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@import "../style/variable";
|
|
2
|
+
$actionSheetCls: 'triones-antm-action-sheet';
|
|
3
|
+
|
|
4
|
+
.#{$actionSheetCls} {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
background-color: $trionesColorFill;
|
|
8
|
+
border-top-left-radius: $trionesBorderRadius;
|
|
9
|
+
border-top-right-radius: $trionesBorderRadius;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
gap: 2Px;
|
|
12
|
+
&-body{
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
&-title{
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
align-items: center;
|
|
19
|
+
min-height: 48Px;
|
|
20
|
+
background-color: white;
|
|
21
|
+
font-size: 18Px;
|
|
22
|
+
border-bottom: 1Px solid $trionesBorderColor;
|
|
23
|
+
}
|
|
24
|
+
&-actions{
|
|
25
|
+
&-item{
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
align-items: center;
|
|
29
|
+
min-height: 48Px;
|
|
30
|
+
background-color: white;
|
|
31
|
+
cursor: default;
|
|
32
|
+
position: relative;
|
|
33
|
+
font-size: 18Px;
|
|
34
|
+
&:hover{
|
|
35
|
+
opacity: 0.8;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
&-cancel{
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
align-items: center;
|
|
43
|
+
min-height: 48Px;
|
|
44
|
+
font-size: 18Px;
|
|
45
|
+
background-color: white;
|
|
46
|
+
cursor: default;
|
|
47
|
+
&:hover{
|
|
48
|
+
opacity: 0.8;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import './style.scss';
|
|
3
|
+
export type AlertProps = {
|
|
4
|
+
type?: 'success' | 'info' | 'warning' | 'error';
|
|
5
|
+
/**
|
|
6
|
+
* @description 告警信息
|
|
7
|
+
*/
|
|
8
|
+
message: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* @description 告警信息详情
|
|
11
|
+
*/
|
|
12
|
+
description?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* @description 是否显示图标
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
showIcon?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* @description 是否可以关闭
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
closable?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* @description 关闭回调
|
|
25
|
+
*/
|
|
26
|
+
onClose?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* @description 关闭后回调
|
|
29
|
+
*/
|
|
30
|
+
afterClose?: () => void;
|
|
31
|
+
};
|
|
32
|
+
export declare const Alert: FC<AlertProps>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var _excluded = ["type", "showIcon", "closable"];
|
|
2
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
+
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."); }
|
|
4
|
+
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); }
|
|
5
|
+
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; }
|
|
6
|
+
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; } }
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import { CheckCircleFill, CloseCircleFill, CloseOutline, ExclamationCircleFill, InformationCircleFill } from "../../../antd-mobile-icons-react";
|
|
11
|
+
import classNames from 'classnames';
|
|
12
|
+
import React, { useState } from 'react';
|
|
13
|
+
import "./style.scss";
|
|
14
|
+
export var Alert = function Alert(_ref) {
|
|
15
|
+
var _ref$type = _ref.type,
|
|
16
|
+
type = _ref$type === void 0 ? 'success' : _ref$type,
|
|
17
|
+
_ref$showIcon = _ref.showIcon,
|
|
18
|
+
showIcon = _ref$showIcon === void 0 ? false : _ref$showIcon,
|
|
19
|
+
_ref$closable = _ref.closable,
|
|
20
|
+
closable = _ref$closable === void 0 ? false : _ref$closable,
|
|
21
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
var _useState = useState(true),
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
+
visible = _useState2[0],
|
|
25
|
+
setVisible = _useState2[1];
|
|
26
|
+
var alertCls = 'triones-antm-alert';
|
|
27
|
+
if (!visible) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: classNames("".concat(alertCls), "".concat(alertCls, "-").concat(type), {})
|
|
32
|
+
}, showIcon && /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "".concat(alertCls, "-icon")
|
|
34
|
+
}, type === 'success' && /*#__PURE__*/React.createElement(CheckCircleFill, null), type === 'info' && /*#__PURE__*/React.createElement(InformationCircleFill, null), type === 'warning' && /*#__PURE__*/React.createElement(ExclamationCircleFill, null), type === 'error' && /*#__PURE__*/React.createElement(CloseCircleFill, null)), /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: "".concat(alertCls, "-content")
|
|
36
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: "".concat(alertCls, "-message")
|
|
38
|
+
}, props.message), props.description && /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: "".concat(alertCls, "-description")
|
|
40
|
+
}, props.description)), closable && /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: "".concat(alertCls, "-close-icon"),
|
|
42
|
+
onClick: function onClick() {
|
|
43
|
+
var _props$onClose, _props$afterClose;
|
|
44
|
+
(_props$onClose = props.onClose) === null || _props$onClose === void 0 || _props$onClose.call(props);
|
|
45
|
+
setVisible(false);
|
|
46
|
+
(_props$afterClose = props.afterClose) === null || _props$afterClose === void 0 || _props$afterClose.call(props);
|
|
47
|
+
}
|
|
48
|
+
}, /*#__PURE__*/React.createElement(CloseOutline, null)));
|
|
49
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
@import "../style/variable";
|
|
2
|
+
|
|
3
|
+
$trionesAlertCls: 'triones-antm-alert';
|
|
4
|
+
|
|
5
|
+
$trionesAlertDefaultPadding: 8Px 12Px;
|
|
6
|
+
|
|
7
|
+
.#{$trionesAlertCls} {
|
|
8
|
+
padding: $trionesAlertDefaultPadding;
|
|
9
|
+
border-radius: $trionesBorderRadius;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex: 1 auto;
|
|
12
|
+
border: 1Px solid;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
gap: 4Px;
|
|
16
|
+
|
|
17
|
+
&-success {
|
|
18
|
+
border-color: $trionesColorSuccessBorder;
|
|
19
|
+
background-color: $trionesColorSuccessBg;
|
|
20
|
+
|
|
21
|
+
.#{$trionesAlertCls}-icon {
|
|
22
|
+
color: $trionesColorSuccess;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-info {
|
|
27
|
+
border-color: $trionesColorInfoBorder;
|
|
28
|
+
background-color: $trionesColorInfoBg;
|
|
29
|
+
|
|
30
|
+
.#{$trionesAlertCls}-icon {
|
|
31
|
+
color: $trionesColorInfo;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&-warning {
|
|
36
|
+
border-color: $trionesColorWarningBorder;
|
|
37
|
+
background-color: $trionesColorWarningBg;
|
|
38
|
+
|
|
39
|
+
.#{$trionesAlertCls}-icon {
|
|
40
|
+
color: $trionesColorWarning;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-error {
|
|
45
|
+
border-color: $trionesColorErrorBorder;
|
|
46
|
+
background-color: $trionesColorErrorBg;
|
|
47
|
+
|
|
48
|
+
.#{$trionesAlertCls}-icon {
|
|
49
|
+
color: $trionesColorError;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&-icon {
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&-content {
|
|
57
|
+
flex: 1 auto;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&-close-icon {
|
|
61
|
+
color: $trionesColorIcon;
|
|
62
|
+
font-size: $trionesFontSizeIcon;
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
|
|
65
|
+
.triones-antm-icon {
|
|
66
|
+
font-size: $trionesFontSizeIcon;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style.scss';
|
|
3
|
+
export type AvatarProps = {
|
|
4
|
+
alt?: string;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
shape?: 'circle' | 'square';
|
|
7
|
+
size?: number;
|
|
8
|
+
src?: string | React.ReactNode;
|
|
9
|
+
srcSet?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export declare const Avatar: React.FC<AvatarProps>;
|
|
14
|
+
export default Avatar;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import "./style.scss";
|
|
10
|
+
export var Avatar = function Avatar(_ref) {
|
|
11
|
+
var alt = _ref.alt,
|
|
12
|
+
icon = _ref.icon,
|
|
13
|
+
_ref$shape = _ref.shape,
|
|
14
|
+
shape = _ref$shape === void 0 ? 'circle' : _ref$shape,
|
|
15
|
+
_ref$size = _ref.size,
|
|
16
|
+
size = _ref$size === void 0 ? 40 : _ref$size,
|
|
17
|
+
src = _ref.src,
|
|
18
|
+
srcSet = _ref.srcSet,
|
|
19
|
+
style = _ref.style,
|
|
20
|
+
children = _ref.children;
|
|
21
|
+
var clsPrefix = 'triones-antm-avatar';
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
className: classNames(clsPrefix, _defineProperty({}, "".concat(clsPrefix, "-").concat(shape !== 'square' ? 'circle' : 'square'), true)),
|
|
24
|
+
style: _objectSpread({
|
|
25
|
+
width: size,
|
|
26
|
+
height: size,
|
|
27
|
+
backgroundColor: src ? undefined : '#ccc'
|
|
28
|
+
}, style)
|
|
29
|
+
}, src ? typeof src === 'string' ? /*#__PURE__*/React.createElement("img", {
|
|
30
|
+
src: src,
|
|
31
|
+
srcSet: srcSet,
|
|
32
|
+
alt: alt,
|
|
33
|
+
style: {
|
|
34
|
+
width: '100%',
|
|
35
|
+
height: '100%',
|
|
36
|
+
objectFit: 'cover'
|
|
37
|
+
}
|
|
38
|
+
}) : src : icon ? icon : children);
|
|
39
|
+
};
|
|
40
|
+
export default Avatar;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { BasicComponent } from '../utils/type';
|
|
3
|
+
import './style.scss';
|
|
4
|
+
export type BadgeFill = 'solid' | 'outline';
|
|
5
|
+
export interface BadgeProps extends BasicComponent {
|
|
6
|
+
value: ReactNode;
|
|
7
|
+
dot: boolean;
|
|
8
|
+
max: number;
|
|
9
|
+
top: string | number;
|
|
10
|
+
right: string | number;
|
|
11
|
+
color: string;
|
|
12
|
+
fill: BadgeFill;
|
|
13
|
+
}
|
|
14
|
+
export declare const Badge: FunctionComponent<Partial<BadgeProps>>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import classNames from 'classnames';
|
|
9
|
+
import { ComponentDefaults } from "../utils/type";
|
|
10
|
+
import { useRtl } from "../ConfigProvider/config-provider";
|
|
11
|
+
import "./style.scss";
|
|
12
|
+
var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
13
|
+
value: '',
|
|
14
|
+
dot: false,
|
|
15
|
+
max: 99,
|
|
16
|
+
top: '4',
|
|
17
|
+
right: '8',
|
|
18
|
+
color: '',
|
|
19
|
+
fill: 'solid'
|
|
20
|
+
});
|
|
21
|
+
export var Badge = function Badge(props) {
|
|
22
|
+
var _ref;
|
|
23
|
+
var rtl = useRtl();
|
|
24
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
25
|
+
className = _defaultProps$props.className,
|
|
26
|
+
style = _defaultProps$props.style,
|
|
27
|
+
value = _defaultProps$props.value,
|
|
28
|
+
max = _defaultProps$props.max,
|
|
29
|
+
children = _defaultProps$props.children,
|
|
30
|
+
dot = _defaultProps$props.dot,
|
|
31
|
+
top = _defaultProps$props.top,
|
|
32
|
+
right = _defaultProps$props.right,
|
|
33
|
+
color = _defaultProps$props.color,
|
|
34
|
+
fill = _defaultProps$props.fill;
|
|
35
|
+
var classPrefix = 'triones-antm-badge';
|
|
36
|
+
var classes = classNames(classPrefix, className, _defineProperty({}, "".concat(classPrefix, "-").concat(fill), fill === 'outline'));
|
|
37
|
+
function content() {
|
|
38
|
+
if (dot || _typeof(value) === 'object' || value === 0) return null;
|
|
39
|
+
if (typeof value === 'number' && typeof max === 'number') {
|
|
40
|
+
return max < value ? "".concat(max, "+") : "".concat(value);
|
|
41
|
+
}
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
function isIcon() {
|
|
45
|
+
if (_typeof(value) === 'object' && value) return value;
|
|
46
|
+
}
|
|
47
|
+
function isNumber() {
|
|
48
|
+
if (typeof value === 'number' && value) return value;
|
|
49
|
+
}
|
|
50
|
+
function isString() {
|
|
51
|
+
if (typeof value === 'string' && value) return value;
|
|
52
|
+
}
|
|
53
|
+
var contentClasses = classNames(_defineProperty({}, "".concat(classPrefix, "-dot"), dot), "".concat(classPrefix, "-content"), _defineProperty({}, "".concat(classPrefix, "-sup"), isNumber() || isString() || dot), _defineProperty({}, "".concat(classPrefix, "-one"), typeof content() === 'string' && ((_ref = "".concat(content())) === null || _ref === void 0 ? void 0 : _ref.length) === 1));
|
|
54
|
+
var getStyle = function getStyle() {
|
|
55
|
+
var style = {};
|
|
56
|
+
style.top = "".concat(Number(top) || parseFloat(String(top)) || 0, "px");
|
|
57
|
+
var dir = rtl ? 'left' : 'right';
|
|
58
|
+
style[dir] = "".concat(Number(right) || parseFloat(String(right)) || 0, "px");
|
|
59
|
+
if (color) {
|
|
60
|
+
if (fill === 'outline') {
|
|
61
|
+
style.color = color;
|
|
62
|
+
style.background = '#fff';
|
|
63
|
+
if (!(color !== null && color !== void 0 && color.includes('gradient'))) {
|
|
64
|
+
style.border = "1px solid ".concat(color);
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
style.color = '#fff';
|
|
68
|
+
style.background = color;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return style;
|
|
72
|
+
};
|
|
73
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: classes,
|
|
75
|
+
style: style
|
|
76
|
+
}, isIcon() && /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: "".concat(classPrefix, "-icon")
|
|
78
|
+
}, value), children, !isIcon() && /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: contentClasses,
|
|
80
|
+
style: getStyle()
|
|
81
|
+
}, content()));
|
|
82
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/* prettier-ignore */
|
|
2
|
+
$color-primary: #fa2c19;
|
|
3
|
+
$color-primary-text: #fff;
|
|
4
|
+
$badge-height: 14PX;
|
|
5
|
+
$badge-background-color: linear-gradient(135deg, #f53d4d 0%, #fa2c19 100%);
|
|
6
|
+
$badge-color: #fff;
|
|
7
|
+
$badge-font-size: 10PX;
|
|
8
|
+
$badge-border: 0PX solid #fff;
|
|
9
|
+
$badge-border-radius: $badge-height;
|
|
10
|
+
$badge-min-width: 5PX;
|
|
11
|
+
$badge-padding: 0 4PX;
|
|
12
|
+
$badge-icon-padding: 3PX;
|
|
13
|
+
$badge-icon-size: 12PX;
|
|
14
|
+
$badge-content-transform: translateY(-50%) translateX(100%);
|
|
15
|
+
$badge-z-index: 1;
|
|
16
|
+
$badge-dot-width: 7PX;
|
|
17
|
+
$badge-dot-border: 0PX solid #fff;
|
|
18
|
+
|
|
19
|
+
.triones-antm-badge {
|
|
20
|
+
position: relative;
|
|
21
|
+
display: inline-block;
|
|
22
|
+
|
|
23
|
+
&-icon {
|
|
24
|
+
position: absolute;
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
align-items: center;
|
|
28
|
+
background: $badge-background-color;
|
|
29
|
+
top: -10%;
|
|
30
|
+
right: -15%;
|
|
31
|
+
padding: $badge-icon-padding;
|
|
32
|
+
text-align: center;
|
|
33
|
+
border: $badge-border;
|
|
34
|
+
border-radius: $badge-border-radius;
|
|
35
|
+
z-index: $badge-z-index;
|
|
36
|
+
|
|
37
|
+
.triones-antm-icon {
|
|
38
|
+
width: $badge-icon-size;
|
|
39
|
+
height: $badge-icon-size;
|
|
40
|
+
font-size: $badge-icon-size;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-sup {
|
|
45
|
+
height: $badge-height;
|
|
46
|
+
position: absolute;
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
align-items: center;
|
|
50
|
+
background: $badge-background-color;
|
|
51
|
+
color: $badge-color;
|
|
52
|
+
padding: $badge-padding;
|
|
53
|
+
font-size: $badge-font-size;
|
|
54
|
+
font-weight: normal;
|
|
55
|
+
text-align: center;
|
|
56
|
+
border: $badge-border;
|
|
57
|
+
border-radius: $badge-border-radius;
|
|
58
|
+
min-width: $badge-min-width;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
z-index: 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&-one {
|
|
64
|
+
height: $badge-height;
|
|
65
|
+
width: $badge-height;
|
|
66
|
+
padding: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&-content {
|
|
70
|
+
transform: $badge-content-transform;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-dot {
|
|
74
|
+
width: $badge-dot-width;
|
|
75
|
+
height: $badge-dot-width;
|
|
76
|
+
border: $badge-dot-border;
|
|
77
|
+
border-radius: $badge-dot-width;
|
|
78
|
+
padding: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&-outline {
|
|
82
|
+
.triones-antm-badge-content {
|
|
83
|
+
background: $color-primary-text;
|
|
84
|
+
border: 1PX solid $color-primary;
|
|
85
|
+
color: $color-primary;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
[dir='rtl'] .triones-antm-badge,
|
|
91
|
+
.triones-antm-rtl .triones-antm-badge {
|
|
92
|
+
&-icon {
|
|
93
|
+
right: auto;
|
|
94
|
+
left: -15%;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&-content {
|
|
98
|
+
transform: translateY(-50%) translateX(-100%);
|
|
99
|
+
}
|
|
100
|
+
}
|