@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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CSSProperties, FC, ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { NativeProps } from './native-props';
|
|
4
|
+
export type CardProps = {
|
|
5
|
+
styles?: {
|
|
6
|
+
header?: CSSProperties;
|
|
7
|
+
body?: CSSProperties;
|
|
8
|
+
footer?: CSSProperties;
|
|
9
|
+
};
|
|
10
|
+
title?: ReactNode;
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
extra?: ReactNode;
|
|
13
|
+
footer?: ReactNode;
|
|
14
|
+
headerClassName?: string;
|
|
15
|
+
bodyClassName?: string;
|
|
16
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
17
|
+
onBodyClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
18
|
+
onHeaderClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
} & NativeProps;
|
|
21
|
+
export declare const Card: FC<CardProps>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { withNativeProps } from "./native-props";
|
|
4
|
+
var classPrefix = "triones-antm-card";
|
|
5
|
+
export var Card = function Card(props) {
|
|
6
|
+
var renderHeader = function renderHeader() {
|
|
7
|
+
var _props$styles;
|
|
8
|
+
if (!(props.title || props.extra)) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
className: classNames("".concat(classPrefix, "-header"), props.headerClassName),
|
|
13
|
+
style: props === null || props === void 0 || (_props$styles = props.styles) === null || _props$styles === void 0 ? void 0 : _props$styles.header,
|
|
14
|
+
onClick: props.onHeaderClick
|
|
15
|
+
}, props.icon && /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: "".concat(classPrefix, "-header-icon")
|
|
17
|
+
}, props.icon), /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
className: "".concat(classPrefix, "-header-title")
|
|
19
|
+
}, props.title), props.extra && /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: "".concat(classPrefix, "-header-extra")
|
|
21
|
+
}, props.extra));
|
|
22
|
+
};
|
|
23
|
+
var renderBody = function renderBody() {
|
|
24
|
+
var _props$styles2;
|
|
25
|
+
if (!props.children) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: classNames("".concat(classPrefix, "-body"), props.bodyClassName),
|
|
30
|
+
style: props === null || props === void 0 || (_props$styles2 = props.styles) === null || _props$styles2 === void 0 ? void 0 : _props$styles2.body,
|
|
31
|
+
onClick: props.onBodyClick
|
|
32
|
+
}, props.children);
|
|
33
|
+
};
|
|
34
|
+
var renderFooter = function renderFooter() {
|
|
35
|
+
var _props$styles3;
|
|
36
|
+
if (!props.footer) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: classNames("".concat(classPrefix, "-footer")),
|
|
41
|
+
style: props === null || props === void 0 || (_props$styles3 = props.styles) === null || _props$styles3 === void 0 ? void 0 : _props$styles3.footer
|
|
42
|
+
}, props.footer);
|
|
43
|
+
};
|
|
44
|
+
return withNativeProps(props, /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: classPrefix,
|
|
46
|
+
onClick: props.onClick
|
|
47
|
+
}, renderHeader(), renderBody(), renderFooter()));
|
|
48
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CSSProperties, ReactElement } from 'react';
|
|
2
|
+
import React, { AriaAttributes } from 'react';
|
|
3
|
+
export type NativeProps<S extends string = never> = {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: CSSProperties & Partial<Record<S, string>>;
|
|
6
|
+
tabIndex?: number;
|
|
7
|
+
} & AriaAttributes;
|
|
8
|
+
export declare function withNativeProps<P extends NativeProps>(props: P, element: ReactElement): ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
export function withNativeProps(props, element) {
|
|
10
|
+
var p = _objectSpread({}, element.props);
|
|
11
|
+
if (props.className) {
|
|
12
|
+
p.className = classNames(element.props.className, props.className);
|
|
13
|
+
}
|
|
14
|
+
if (props.style) {
|
|
15
|
+
p.style = _objectSpread(_objectSpread({}, p.style), props.style);
|
|
16
|
+
}
|
|
17
|
+
if (props.tabIndex !== undefined) {
|
|
18
|
+
p.tabIndex = props.tabIndex;
|
|
19
|
+
}
|
|
20
|
+
for (var key in props) {
|
|
21
|
+
if (!props.hasOwnProperty(key)) continue;
|
|
22
|
+
if (key.startsWith('data-') || key.startsWith('aria-')) {
|
|
23
|
+
p[key] = props[key];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return /*#__PURE__*/React.cloneElement(element, p);
|
|
27
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@import "../style/variable";
|
|
2
|
+
$class-prefix-card: 'triones-antm-card';
|
|
3
|
+
|
|
4
|
+
.#{$class-prefix-card} {
|
|
5
|
+
background: $trionesColorBgBase;
|
|
6
|
+
border-radius: $trionesBorderRadius;
|
|
7
|
+
//padding: $trionesPadding $trionesPadding;
|
|
8
|
+
&-header {
|
|
9
|
+
position: relative;
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: 8Px;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
padding: $trionesPaddingXs $trionesPaddingXs;
|
|
16
|
+
&:not(:last-child) {
|
|
17
|
+
border-bottom: solid 0.5Px $trionesBorderColor;
|
|
18
|
+
}
|
|
19
|
+
&-title {
|
|
20
|
+
font-size: $trionesFontSize;
|
|
21
|
+
line-height: 1.4;
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
&-body {
|
|
26
|
+
padding: $trionesPaddingXs $trionesPaddingXs;
|
|
27
|
+
}
|
|
28
|
+
&-footer {
|
|
29
|
+
padding: $trionesPaddingXs $trionesPaddingXs;
|
|
30
|
+
}
|
|
31
|
+
&-footer {
|
|
32
|
+
border-top: solid 0.5Px $trionesBorderColor;
|
|
33
|
+
padding: $trionesPaddingXs $trionesPaddingXs;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import './style.scss';
|
|
3
|
+
export type CascaderPickerProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
afterOpenChange?: (open: boolean) => void;
|
|
8
|
+
title?: React.ReactNode;
|
|
9
|
+
options?: any[];
|
|
10
|
+
/**
|
|
11
|
+
* @description 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 string 变为 { value: string, label: ReactNode } 的格式
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
labelInValue?: boolean;
|
|
15
|
+
fieldNames?: {
|
|
16
|
+
value?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
children?: string;
|
|
19
|
+
};
|
|
20
|
+
columnsCount?: number;
|
|
21
|
+
value?: any[];
|
|
22
|
+
onOk?: (value?: any[]) => void;
|
|
23
|
+
onCancel?: () => void;
|
|
24
|
+
onClose?: () => void;
|
|
25
|
+
asyncRequest?: (parentValue?: any) => Promise<any>;
|
|
26
|
+
};
|
|
27
|
+
export declare const CascaderPicker: FC<CascaderPickerProps>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { isEqual } from 'lodash';
|
|
3
|
+
import React, { useEffect, useRef } from 'react';
|
|
4
|
+
import CascaderView from "../CascaderView";
|
|
5
|
+
import ConfigProvider from "../ConfigProvider";
|
|
6
|
+
import Popup from "../Popup";
|
|
7
|
+
import "./style.scss";
|
|
8
|
+
var cascaderPickerCls = 'triones-antm-cascader-picker';
|
|
9
|
+
export var CascaderPicker = /*#__PURE__*/React.memo(function (_ref) {
|
|
10
|
+
var className = _ref.className,
|
|
11
|
+
style = _ref.style,
|
|
12
|
+
_ref$open = _ref.open,
|
|
13
|
+
open = _ref$open === void 0 ? false : _ref$open,
|
|
14
|
+
afterOpenChange = _ref.afterOpenChange,
|
|
15
|
+
title = _ref.title,
|
|
16
|
+
options = _ref.options,
|
|
17
|
+
_ref$labelInValue = _ref.labelInValue,
|
|
18
|
+
labelInValue = _ref$labelInValue === void 0 ? false : _ref$labelInValue,
|
|
19
|
+
fieldNames = _ref.fieldNames,
|
|
20
|
+
columnsCount = _ref.columnsCount,
|
|
21
|
+
value = _ref.value,
|
|
22
|
+
onOk = _ref.onOk,
|
|
23
|
+
onCancel = _ref.onCancel,
|
|
24
|
+
onClose = _ref.onClose,
|
|
25
|
+
asyncRequest = _ref.asyncRequest;
|
|
26
|
+
var _ConfigProvider$useCo = ConfigProvider.useConfig(),
|
|
27
|
+
locale = _ConfigProvider$useCo.locale;
|
|
28
|
+
var internalValueRf = useRef(value);
|
|
29
|
+
var handleClose = function handleClose() {
|
|
30
|
+
onClose === null || onClose === void 0 || onClose();
|
|
31
|
+
};
|
|
32
|
+
var handleOk = function handleOk() {
|
|
33
|
+
onOk === null || onOk === void 0 || onOk(internalValueRf.current);
|
|
34
|
+
};
|
|
35
|
+
var handelCancel = function handelCancel() {
|
|
36
|
+
onCancel === null || onCancel === void 0 || onCancel();
|
|
37
|
+
handleClose();
|
|
38
|
+
};
|
|
39
|
+
useEffect(function () {
|
|
40
|
+
if (value === undefined) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (isEqual(value, internalValueRf.current)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
internalValueRf.current = value;
|
|
47
|
+
}, [value]);
|
|
48
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
49
|
+
open: open,
|
|
50
|
+
onClose: handleClose,
|
|
51
|
+
styles: {
|
|
52
|
+
body: {
|
|
53
|
+
borderTopLeftRadius: 6,
|
|
54
|
+
borderTopRightRadius: 6
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
className: classNames(cascaderPickerCls, className),
|
|
59
|
+
style: style
|
|
60
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: classNames("".concat(cascaderPickerCls, "-header"))
|
|
62
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
63
|
+
className: classNames("".concat(cascaderPickerCls, "-header-button")),
|
|
64
|
+
onClick: handelCancel
|
|
65
|
+
}, locale.common.cancel), title && /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
className: classNames("".concat(cascaderPickerCls, "-header-title"))
|
|
67
|
+
}, title), /*#__PURE__*/React.createElement("a", {
|
|
68
|
+
className: classNames("".concat(cascaderPickerCls, "-header-button"), "".concat(cascaderPickerCls, "-header-button-ok")),
|
|
69
|
+
onClick: handleOk
|
|
70
|
+
}, locale.common.confirm)), /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: classNames("".concat(cascaderPickerCls, "-body"))
|
|
72
|
+
}, /*#__PURE__*/React.createElement(CascaderView
|
|
73
|
+
// open={ open}
|
|
74
|
+
, {
|
|
75
|
+
fieldNames: fieldNames,
|
|
76
|
+
options: options,
|
|
77
|
+
labelInValue: labelInValue,
|
|
78
|
+
columnsCount: columnsCount,
|
|
79
|
+
value: value,
|
|
80
|
+
onChange: function onChange(newVal) {
|
|
81
|
+
internalValueRf.current = newVal;
|
|
82
|
+
},
|
|
83
|
+
asyncRequest: asyncRequest,
|
|
84
|
+
style: {
|
|
85
|
+
height: '100%'
|
|
86
|
+
}
|
|
87
|
+
}))));
|
|
88
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
@import "../style/variable";
|
|
2
|
+
$cascaderPickerCls: 'triones-antm-cascader-picker';
|
|
3
|
+
|
|
4
|
+
.#{$cascaderPickerCls} {
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 300Px;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
position: relative;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
|
|
12
|
+
&-header {
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
align-items: center;
|
|
16
|
+
border-bottom: 1Px solid $trionesBorderColor;
|
|
17
|
+
padding: 4Px;
|
|
18
|
+
|
|
19
|
+
&-button {
|
|
20
|
+
|
|
21
|
+
padding: 8Px;
|
|
22
|
+
font-size: 12Px;
|
|
23
|
+
&-ok{
|
|
24
|
+
color: $trionesColorPrimary;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-title {
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&-body {
|
|
33
|
+
flex: 1 1;
|
|
34
|
+
width: 100%;
|
|
35
|
+
pointer-events: unset;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
}
|
|
38
|
+
&-view{
|
|
39
|
+
--height: 100%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 _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; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
+
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); }
|
|
5
|
+
import React from "react";
|
|
6
|
+
import classNames from "classnames";
|
|
7
|
+
import { CheckOutline } from "../../../antd-mobile-icons-react";
|
|
8
|
+
var cascaderViewCls = 'triones-antm-cascader-view';
|
|
9
|
+
export var CascaderColumnItem = function CascaderColumnItem(_ref) {
|
|
10
|
+
var option = _ref.option,
|
|
11
|
+
_onClick = _ref.onClick,
|
|
12
|
+
selected = _ref.selected;
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: classNames("".concat(cascaderViewCls, "-column-item"), _defineProperty({}, "".concat(cascaderViewCls, "-column-item-selected"), selected)),
|
|
15
|
+
onClick: function onClick() {
|
|
16
|
+
_onClick === null || _onClick === void 0 || _onClick(option);
|
|
17
|
+
}
|
|
18
|
+
}, /*#__PURE__*/React.createElement("div", null, option.label), selected && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CheckOutline, null)));
|
|
19
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CascaderColumnItem } from "./cascader-column-item";
|
|
4
|
+
var cascaderViewCls = 'triones-antm-cascader-view';
|
|
5
|
+
export var CascaderColumn = function CascaderColumn(_ref) {
|
|
6
|
+
var _ref$index = _ref.index,
|
|
7
|
+
index = _ref$index === void 0 ? 0 : _ref$index,
|
|
8
|
+
options = _ref.options,
|
|
9
|
+
value = _ref.value,
|
|
10
|
+
onSelect = _ref.onSelect;
|
|
11
|
+
var handleOnSelect = function handleOnSelect(option) {
|
|
12
|
+
onSelect === null || onSelect === void 0 || onSelect(option, index);
|
|
13
|
+
};
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: classNames("".concat(cascaderViewCls, "-column"))
|
|
16
|
+
}, options === null || options === void 0 ? void 0 : options.map(function (option, index) {
|
|
17
|
+
return /*#__PURE__*/React.createElement(CascaderColumnItem, {
|
|
18
|
+
key: index,
|
|
19
|
+
option: option,
|
|
20
|
+
selected: (value === null || value === void 0 ? void 0 : value.value) === option.value,
|
|
21
|
+
onClick: function onClick() {
|
|
22
|
+
handleOnSelect(option);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CSSProperties, FC } from 'react';
|
|
2
|
+
import './style.scss';
|
|
3
|
+
export type CascaderViewProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
options?: any[];
|
|
7
|
+
labelInValue?: boolean;
|
|
8
|
+
fieldNames?: {
|
|
9
|
+
value?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
children?: string;
|
|
12
|
+
};
|
|
13
|
+
columnsCount?: number;
|
|
14
|
+
value?: any;
|
|
15
|
+
onChange?: (value: any) => void;
|
|
16
|
+
asyncRequest?: (parentValue?: any) => Promise<any>;
|
|
17
|
+
};
|
|
18
|
+
export declare const CascaderView: FC<CascaderViewProps>;
|