taro-ui 3.3.3 → 3.4.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 +1 -1
- package/README.md +85 -0
- package/dist/common/utils.d.ts +2 -1
- package/dist/common/utils.js +3 -0
- package/dist/common/utils.js.map +1 -1
- package/dist/components/accordion/index.d.ts +16 -13
- package/dist/components/accordion/index.js +77 -97
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/action-sheet/body/index.d.ts +2 -4
- package/dist/components/action-sheet/body/index.js +8 -6
- package/dist/components/action-sheet/body/index.js.map +1 -1
- package/dist/components/action-sheet/body/item/index.d.ts +7 -7
- package/dist/components/action-sheet/body/item/index.js +14 -14
- package/dist/components/action-sheet/body/item/index.js.map +1 -1
- package/dist/components/action-sheet/footer/index.d.ts +7 -7
- package/dist/components/action-sheet/footer/index.js +14 -17
- package/dist/components/action-sheet/footer/index.js.map +1 -1
- package/dist/components/action-sheet/header/index.d.ts +2 -4
- package/dist/components/action-sheet/header/index.js +8 -9
- package/dist/components/action-sheet/header/index.js.map +1 -1
- package/dist/components/action-sheet/index.d.ts +12 -13
- package/dist/components/action-sheet/index.js +53 -57
- package/dist/components/action-sheet/index.js.map +1 -1
- package/dist/components/activity-indicator/index.d.ts +12 -6
- package/dist/components/activity-indicator/index.js +19 -22
- package/dist/components/activity-indicator/index.js.map +1 -1
- package/dist/components/avatar/index.d.ts +14 -8
- package/dist/components/avatar/index.js +36 -43
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/badge/index.d.ts +11 -8
- package/dist/components/badge/index.js +18 -34
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/button/index.d.ts +29 -14
- package/dist/components/button/index.js +97 -112
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/calendar/body/index.d.ts +3 -26
- package/dist/components/calendar/body/index.js +215 -235
- package/dist/components/calendar/body/index.js.map +1 -1
- package/dist/components/calendar/controller/index.d.ts +3 -5
- package/dist/components/calendar/controller/index.js +47 -43
- package/dist/components/calendar/controller/index.js.map +1 -1
- package/dist/components/calendar/index.d.ts +3 -20
- package/dist/components/calendar/index.js +219 -201
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/calendar/ui/date-list/index.d.ts +2 -6
- package/dist/components/calendar/ui/date-list/index.js +36 -41
- package/dist/components/calendar/ui/date-list/index.js.map +1 -1
- package/dist/components/calendar/ui/day-list/index.d.ts +2 -4
- package/dist/components/calendar/ui/day-list/index.js +6 -5
- package/dist/components/calendar/ui/day-list/index.js.map +1 -1
- package/dist/components/card/index.d.ts +15 -7
- package/dist/components/card/index.js +42 -43
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/checkbox/index.d.ts +11 -7
- package/dist/components/checkbox/index.js +30 -35
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/config-provider/context.d.ts +6 -0
- package/dist/components/config-provider/context.js +13 -0
- package/dist/components/config-provider/context.js.map +1 -0
- package/dist/components/config-provider/index.d.ts +7 -0
- package/dist/components/config-provider/index.js +15 -0
- package/dist/components/config-provider/index.js.map +1 -0
- package/dist/components/countdown/index.d.ts +19 -19
- package/dist/components/countdown/index.js +183 -118
- package/dist/components/countdown/index.js.map +1 -1
- package/dist/components/countdown/item/index.d.ts +8 -7
- package/dist/components/countdown/item/index.js +10 -13
- package/dist/components/countdown/item/index.js.map +1 -1
- package/dist/components/curtain/index.d.ts +11 -8
- package/dist/components/curtain/index.js +36 -45
- package/dist/components/curtain/index.js.map +1 -1
- package/dist/components/divider/index.d.ts +13 -6
- package/dist/components/divider/index.js +29 -38
- package/dist/components/divider/index.js.map +1 -1
- package/dist/components/drawer/index.d.ts +13 -15
- package/dist/components/drawer/index.js +100 -93
- package/dist/components/drawer/index.js.map +1 -1
- package/dist/components/fab/index.d.ts +8 -7
- package/dist/components/fab/index.js +16 -16
- package/dist/components/fab/index.js.map +1 -1
- package/dist/components/flex/index.d.ts +11 -5
- package/dist/components/flex/index.js +17 -18
- package/dist/components/flex/index.js.map +1 -1
- package/dist/components/flex/item/index.d.ts +11 -5
- package/dist/components/flex/item/index.js +17 -18
- package/dist/components/flex/item/index.js.map +1 -1
- package/dist/components/float-layout/index.d.ts +20 -12
- package/dist/components/float-layout/index.js +56 -72
- package/dist/components/float-layout/index.js.map +1 -1
- package/dist/components/form/index.d.ts +11 -8
- package/dist/components/form/index.js +28 -28
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/grid/index.d.ts +22 -7
- package/dist/components/grid/index.js +61 -66
- package/dist/components/grid/index.js.map +1 -1
- package/dist/components/icon/index.d.ts +13 -7
- package/dist/components/icon/index.js +24 -34
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/image-picker/index.d.ts +19 -9
- package/dist/components/image-picker/index.js +83 -102
- package/dist/components/image-picker/index.js.map +1 -1
- package/dist/components/indexes/index.d.ts +16 -28
- package/dist/components/indexes/index.js +198 -209
- package/dist/components/indexes/index.js.map +1 -1
- package/dist/components/input/index.d.ts +37 -15
- package/dist/components/input/index.js +152 -161
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input-number/index.d.ts +20 -11
- package/dist/components/input-number/index.js +107 -126
- package/dist/components/input-number/index.js.map +1 -1
- package/dist/components/list/index.d.ts +7 -6
- package/dist/components/list/index.js +15 -15
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list/item/index.d.ts +27 -9
- package/dist/components/list/item/index.js +89 -117
- package/dist/components/list/item/index.js.map +1 -1
- package/dist/components/load-more/index.d.ts +15 -7
- package/dist/components/load-more/index.js +29 -50
- package/dist/components/load-more/index.js.map +1 -1
- package/dist/components/loading/index.d.ts +8 -7
- package/dist/components/loading/index.js +14 -20
- package/dist/components/loading/index.js.map +1 -1
- package/dist/components/message/index.d.ts +9 -14
- package/dist/components/message/index.js +45 -59
- package/dist/components/message/index.js.map +1 -1
- package/dist/components/modal/action/index.d.ts +7 -6
- package/dist/components/modal/action/index.js +15 -15
- package/dist/components/modal/action/index.js.map +1 -1
- package/dist/components/modal/content/index.d.ts +2 -4
- package/dist/components/modal/content/index.js +8 -6
- package/dist/components/modal/content/index.js.map +1 -1
- package/dist/components/modal/header/index.d.ts +2 -4
- package/dist/components/modal/header/index.js +8 -6
- package/dist/components/modal/header/index.js.map +1 -1
- package/dist/components/modal/index.d.ts +16 -14
- package/dist/components/modal/index.js +63 -77
- package/dist/components/modal/index.js.map +1 -1
- package/dist/components/nav-bar/index.d.ts +20 -10
- package/dist/components/nav-bar/index.js +146 -162
- package/dist/components/nav-bar/index.js.map +1 -1
- package/dist/components/noticebar/index.d.ts +17 -15
- package/dist/components/noticebar/index.js +115 -128
- package/dist/components/noticebar/index.js.map +1 -1
- package/dist/components/pagination/index.d.ts +13 -11
- package/dist/components/pagination/index.js +64 -120
- package/dist/components/pagination/index.js.map +1 -1
- package/dist/components/progress/index.d.ts +11 -5
- package/dist/components/progress/index.js +39 -36
- package/dist/components/progress/index.js.map +1 -1
- package/dist/components/radio/index.d.ts +11 -7
- package/dist/components/radio/index.js +29 -33
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/range/index.d.ts +19 -21
- package/dist/components/range/index.js +146 -153
- package/dist/components/range/index.js.map +1 -1
- package/dist/components/rate/index.d.ts +13 -7
- package/dist/components/rate/index.js +47 -62
- package/dist/components/rate/index.js.map +1 -1
- package/dist/components/search-bar/index.d.ts +23 -15
- package/dist/components/search-bar/index.js +120 -146
- package/dist/components/search-bar/index.js.map +1 -1
- package/dist/components/segmented-control/index.d.ts +14 -7
- package/dist/components/segmented-control/index.js +52 -66
- package/dist/components/segmented-control/index.js.map +1 -1
- package/dist/components/slider/index.d.ts +21 -12
- package/dist/components/slider/index.js +66 -90
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/steps/index.d.ts +11 -7
- package/dist/components/steps/index.js +43 -48
- package/dist/components/steps/index.js.map +1 -1
- package/dist/components/swipe-action/index.d.ts +12 -25
- package/dist/components/swipe-action/index.js +118 -115
- package/dist/components/swipe-action/index.js.map +1 -1
- package/dist/components/swipe-action/options/index.d.ts +2 -4
- package/dist/components/swipe-action/options/index.js +18 -17
- package/dist/components/swipe-action/options/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +14 -7
- package/dist/components/switch/index.js +36 -41
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/tab-bar/index.d.ts +17 -7
- package/dist/components/tab-bar/index.js +108 -135
- package/dist/components/tab-bar/index.js.map +1 -1
- package/dist/components/tabs/index.d.ts +17 -23
- package/dist/components/tabs/index.js +185 -174
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/tabs-pane/index.d.ts +11 -6
- package/dist/components/tabs-pane/index.js +26 -28
- package/dist/components/tabs-pane/index.js.map +1 -1
- package/dist/components/tag/index.d.ts +14 -7
- package/dist/components/tag/index.js +31 -40
- package/dist/components/tag/index.js.map +1 -1
- package/dist/components/textarea/index.d.ts +29 -11
- package/dist/components/textarea/index.js +72 -92
- package/dist/components/textarea/index.js.map +1 -1
- package/dist/components/timeline/index.d.ts +9 -6
- package/dist/components/timeline/index.js +50 -56
- package/dist/components/timeline/index.js.map +1 -1
- package/dist/components/toast/img.json +3 -6
- package/dist/components/toast/index.d.ts +16 -15
- package/dist/components/toast/index.js +85 -94
- package/dist/components/toast/index.js.map +1 -1
- package/dist/hooks/useComponentLocale.d.ts +2 -0
- package/dist/hooks/useComponentLocale.js +12 -0
- package/dist/hooks/useComponentLocale.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +4006 -4404
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4032 -4434
- package/dist/index.js.map +1 -1
- package/dist/locale/en_US.d.ts +3 -0
- package/dist/locale/en_US.js +34 -0
- package/dist/locale/en_US.js.map +1 -0
- package/dist/locale/index.d.ts +4 -0
- package/dist/locale/index.js +10 -0
- package/dist/locale/index.js.map +1 -0
- package/dist/locale/types.d.ts +34 -0
- package/dist/locale/types.js +1 -0
- package/dist/locale/types.js.map +1 -0
- package/dist/locale/zh_CN.d.ts +3 -0
- package/dist/locale/zh_CN.js +34 -0
- package/dist/locale/zh_CN.js.map +1 -0
- package/dist/style/components/avatar.scss +1 -1
- package/dist/style/components/badge.scss +7 -2
- package/dist/style/components/calendar.scss +1 -1
- package/dist/style/components/countdown.scss +2 -1
- package/dist/style/components/flex.scss +1 -1
- package/dist/style/components/grid.scss +2 -2
- package/dist/style/components/icon.scss +302 -101
- package/dist/style/components/input.scss +2 -2
- package/dist/style/components/progress.scss +1 -1
- package/dist/style/components/search-bar.scss +1 -1
- package/dist/style/components/steps.scss +2 -2
- package/dist/style/components/tabs.scss +1 -1
- package/dist/style/components/tag.scss +1 -1
- package/dist/style/components/timeline.scss +1 -1
- package/dist/style/components/toast.scss +7 -3
- package/dist/style/index.css +176 -176
- package/dist/style/index.css.map +1 -1
- package/dist/style/mixins/libs/hairline.scss +4 -19
- package/dist/style/mixins/libs/shade.scss +3 -6
- package/dist/style/mixins/libs/tint.scss +4 -7
- package/dist/style/themes/purple.scss +15 -15
- package/dist/style/themes/red.scss +16 -13
- package/dist/style/variables/default.scss +69 -73
- package/package.json +5 -3
- package/rn/components/accordion/index.tsx +2 -9
- package/rn/components/action-sheet/body/index.tsx +1 -3
- package/rn/components/action-sheet/body/item/index.tsx +1 -3
- package/rn/components/action-sheet/footer/index.tsx +1 -3
- package/rn/components/action-sheet/header/index.tsx +1 -3
- package/rn/components/activity-indicator/index.tsx +1 -3
- package/rn/components/avatar/index.tsx +5 -5
- package/rn/components/calendar/controller/index.tsx +2 -7
- package/rn/components/card/index.tsx +4 -4
- package/rn/components/countdown/index.scss +5 -4
- package/rn/components/countdown/item/index.tsx +1 -3
- package/rn/components/curtain/index.tsx +5 -5
- package/rn/components/flex/index.scss +2 -2
- package/rn/components/flex/item/index.scss +2 -2
- package/rn/components/grid/index.tsx +15 -15
- package/rn/components/icon/index.tsx +4 -4
- package/rn/components/image-picker/index.tsx +7 -7
- package/rn/components/pagination/index.tsx +7 -7
- package/rn/components/progress/index.tsx +5 -5
- package/rn/components/radio/index.tsx +7 -7
- package/rn/components/rate/index.tsx +4 -4
- package/rn/components/segmented-control/index.tsx +8 -8
- package/rn/components/slider/index.tsx +9 -9
- package/rn/components/steps/index.tsx +8 -8
- package/rn/components/swipe-action/options/index.tsx +1 -3
- package/rn/components/switch/index.tsx +2 -9
- package/rn/components/toast/img.json +3 -6
- package/rn/components/toast/index.tsx +8 -8
- package/rn/style/components/accordion.scss +1 -1
- package/rn/style/components/action-sheet.scss +1 -1
- package/rn/style/components/avatar.scss +1 -1
- package/rn/style/components/badge.scss +8 -3
- package/rn/style/components/button.scss +1 -1
- package/rn/style/components/calendar.scss +1 -1
- package/rn/style/components/checkbox.scss +1 -1
- package/rn/style/components/curtain.scss +1 -1
- package/rn/style/components/fab.scss +1 -4
- package/rn/style/components/flex.scss +1 -1
- package/rn/style/components/grid.scss +2 -6
- package/rn/style/components/icon.scss +302 -101
- package/rn/style/components/index.scss +41 -41
- package/rn/style/components/input.scss +1 -1
- package/rn/style/components/list.scss +2 -4
- package/rn/style/components/loading.scss +4 -4
- package/rn/style/components/message.scss +1 -1
- package/rn/style/components/modal.scss +0 -2
- package/rn/style/components/nav-bar.scss +3 -3
- package/rn/style/components/noticebar.scss +0 -4
- package/rn/style/components/progress.scss +1 -1
- package/rn/style/components/radio.scss +2 -2
- package/rn/style/components/range.scss +1 -1
- package/rn/style/components/search-bar.scss +1 -1
- package/rn/style/components/segmented-control.scss +4 -1
- package/rn/style/components/slider.scss +0 -1
- package/rn/style/components/steps.scss +3 -3
- package/rn/style/components/switch.scss +0 -1
- package/rn/style/components/tabs.scss +2 -2
- package/rn/style/components/tag.scss +1 -1
- package/rn/style/components/timeline.scss +0 -2
- package/rn/style/components/toast.scss +5 -2
- package/rn/style/index.scss +1 -1
- package/rn/style/mixins/libs/hairline.scss +4 -22
- package/rn/style/mixins/libs/shade.scss +1 -4
- package/rn/style/mixins/libs/tint.scss +2 -5
- package/rn/style/themes/purple.scss +15 -15
- package/rn/style/themes/red.scss +16 -13
- package/rn/style/variables/default.scss +69 -73
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
3
2
|
import { AtDividerProps } from '../../../types/divider';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
declare function AtDivider({ className, customStyle, content, height, fontColor, fontSize, lineColor, children }: AtDividerProps): JSX.Element;
|
|
4
|
+
declare namespace AtDivider {
|
|
5
|
+
var propTypes: {
|
|
6
|
+
customStyle: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
7
|
+
className: PropTypes.Requireable<NonNullable<string | any[] | null | undefined>>;
|
|
8
|
+
content: PropTypes.Requireable<string>;
|
|
9
|
+
height: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
10
|
+
fontColor: PropTypes.Requireable<string>;
|
|
11
|
+
fontSize: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
12
|
+
lineColor: PropTypes.Requireable<string>;
|
|
13
|
+
};
|
|
8
14
|
}
|
|
15
|
+
export default AtDivider;
|
|
@@ -3,45 +3,36 @@ import PropTypes from "prop-types";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { View } from "@tarojs/components";
|
|
5
5
|
import { mergeStyle, pxTransform } from "../../common/utils";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
);
|
|
36
|
-
}
|
|
6
|
+
function AtDivider({
|
|
7
|
+
className,
|
|
8
|
+
customStyle,
|
|
9
|
+
content = "",
|
|
10
|
+
height = 0,
|
|
11
|
+
fontColor = "",
|
|
12
|
+
fontSize = 0,
|
|
13
|
+
lineColor = "",
|
|
14
|
+
children
|
|
15
|
+
}) {
|
|
16
|
+
const rootStyle = {
|
|
17
|
+
height: height ? `${pxTransform(Number(height))}` : ""
|
|
18
|
+
};
|
|
19
|
+
const fontStyle = {
|
|
20
|
+
color: fontColor,
|
|
21
|
+
fontSize: fontSize ? `${pxTransform(Number(fontSize))}` : ""
|
|
22
|
+
};
|
|
23
|
+
const lineStyle = {
|
|
24
|
+
backgroundColor: lineColor
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ React.createElement(
|
|
27
|
+
View,
|
|
28
|
+
{
|
|
29
|
+
className: classNames("at-divider", className),
|
|
30
|
+
style: mergeStyle(rootStyle, customStyle)
|
|
31
|
+
},
|
|
32
|
+
/* @__PURE__ */ React.createElement(View, { className: "at-divider__content", style: fontStyle }, content === "" ? children : content),
|
|
33
|
+
/* @__PURE__ */ React.createElement(View, { className: "at-divider__line", style: lineStyle })
|
|
34
|
+
);
|
|
37
35
|
}
|
|
38
|
-
AtDivider.defaultProps = {
|
|
39
|
-
content: "",
|
|
40
|
-
height: 0,
|
|
41
|
-
fontColor: "",
|
|
42
|
-
fontSize: 0,
|
|
43
|
-
lineColor: ""
|
|
44
|
-
};
|
|
45
36
|
AtDivider.propTypes = {
|
|
46
37
|
customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
47
38
|
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/divider/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes
|
|
1
|
+
{"version":3,"sources":["../../../src/components/divider/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { AtDividerProps } from '../../../types/divider'\nimport { mergeStyle, pxTransform } from '../../common/utils'\n\nexport default function AtDivider({\n className,\n customStyle,\n content = '',\n height = 0,\n fontColor = '',\n fontSize = 0,\n lineColor = '',\n children\n}: AtDividerProps): JSX.Element {\n const rootStyle = {\n height: height ? `${pxTransform(Number(height))}` : ''\n }\n\n const fontStyle = {\n color: fontColor,\n fontSize: fontSize ? `${pxTransform(Number(fontSize))}` : ''\n }\n\n const lineStyle: React.CSSProperties = {\n backgroundColor: lineColor\n }\n\n return (\n <View\n className={classNames('at-divider', className)}\n style={mergeStyle(rootStyle, customStyle as object)}\n >\n <View className='at-divider__content' style={fontStyle}>\n {content === '' ? children : content}\n </View>\n <View className='at-divider__line' style={lineStyle}></View>\n </View>\n )\n}\n\nAtDivider.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n content: PropTypes.string,\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n fontColor: PropTypes.string,\n fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n lineColor: PropTypes.string\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAAe;AACtB,OAAO,WAAW;AAClB,SAAS,YAAY;AAErB,SAAS,YAAY,mBAAmB;AAEzB,SAAR,UAA2B;AAAA,EAChC;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AAAA,EACZ;AACF,GAAgC;AAC9B,QAAM,YAAY;AAAA,IAChB,QAAQ,SAAS,GAAG,YAAY,OAAO,MAAM,CAAC,CAAC,KAAK;AAAA,EACtD;AAEA,QAAM,YAAY;AAAA,IAChB,OAAO;AAAA,IACP,UAAU,WAAW,GAAG,YAAY,OAAO,QAAQ,CAAC,CAAC,KAAK;AAAA,EAC5D;AAEA,QAAM,YAAiC;AAAA,IACrC,iBAAiB;AAAA,EACnB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,WAAW,cAAc,SAAS;AAAA,MAC7C,OAAO,WAAW,WAAW,WAAqB;AAAA;AAAA,IAElD,oCAAC,QAAK,WAAU,uBAAsB,OAAO,aAC1C,YAAY,KAAK,WAAW,OAC/B;AAAA,IACA,oCAAC,QAAK,WAAU,oBAAmB,OAAO,WAAW;AAAA,EACvD;AAEJ;AAEA,UAAU,YAAY;AAAA,EACpB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EAClE,SAAS,UAAU;AAAA,EACnB,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAChE,WAAW,UAAU;AAAA,EACrB,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAClE,WAAW,UAAU;AACvB;","names":[]}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
private onMaskClick;
|
|
14
|
-
UNSAFE_componentWillReceiveProps(nextProps: AtDrawerProps): void;
|
|
15
|
-
render(): JSX.Element;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { AtDrawerProps } from '../../../types/drawer';
|
|
3
|
+
declare function AtDrawer({ show, mask, width, right, items, className, children, onItemClick, onClose }: AtDrawerProps): JSX.Element;
|
|
4
|
+
declare namespace AtDrawer {
|
|
5
|
+
var propTypes: {
|
|
6
|
+
show: PropTypes.Requireable<boolean>;
|
|
7
|
+
mask: PropTypes.Requireable<boolean>;
|
|
8
|
+
width: PropTypes.Requireable<string>;
|
|
9
|
+
items: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
10
|
+
onItemClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
12
|
+
};
|
|
16
13
|
}
|
|
14
|
+
export default AtDrawer;
|
|
@@ -1,105 +1,111 @@
|
|
|
1
1
|
import classNames from "classnames";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
|
-
import React from "react";
|
|
3
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { View } from "@tarojs/components";
|
|
5
5
|
import AtList from "../list/index";
|
|
6
6
|
import AtListItem from "../list/item/index";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
animHide() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
7
|
+
function AtDrawer({
|
|
8
|
+
show = false,
|
|
9
|
+
mask = true,
|
|
10
|
+
width = "",
|
|
11
|
+
right = false,
|
|
12
|
+
items = [],
|
|
13
|
+
className,
|
|
14
|
+
children,
|
|
15
|
+
onItemClick,
|
|
16
|
+
onClose
|
|
17
|
+
}) {
|
|
18
|
+
const [animShow, setAnimShow] = useState(false);
|
|
19
|
+
const [_show, setShow] = useState(show);
|
|
20
|
+
const showStateRef = useRef(show);
|
|
21
|
+
const isMountRef = useRef(true);
|
|
22
|
+
const hideTimerRef = useRef();
|
|
23
|
+
const showTimerRef = useRef();
|
|
24
|
+
const onHide = () => {
|
|
25
|
+
setShow(false);
|
|
26
|
+
onClose && onClose();
|
|
27
|
+
};
|
|
28
|
+
const animHide = () => {
|
|
29
|
+
setAnimShow(false);
|
|
30
|
+
if (hideTimerRef.current) {
|
|
31
|
+
clearTimeout(hideTimerRef.current);
|
|
32
|
+
}
|
|
33
|
+
hideTimerRef.current = setTimeout(() => {
|
|
34
|
+
onHide();
|
|
34
35
|
}, 300);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
};
|
|
37
|
+
const runAnimShow = () => {
|
|
38
|
+
setShow(true);
|
|
39
|
+
if (showTimerRef.current) {
|
|
40
|
+
clearTimeout(showTimerRef.current);
|
|
41
|
+
}
|
|
42
|
+
showTimerRef.current = setTimeout(() => {
|
|
43
|
+
setAnimShow(true);
|
|
42
44
|
}, 200);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
};
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
showStateRef.current = _show;
|
|
48
|
+
}, [_show]);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (isMountRef.current) {
|
|
51
|
+
isMountRef.current = false;
|
|
52
|
+
if (show) {
|
|
53
|
+
runAnimShow();
|
|
54
|
+
}
|
|
55
|
+
return;
|
|
51
56
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
};
|
|
65
|
-
const classObject = {
|
|
66
|
-
"at-drawer--show": animShow,
|
|
67
|
-
"at-drawer--right": right,
|
|
68
|
-
"at-drawer--left": !right
|
|
57
|
+
if (show !== showStateRef.current) {
|
|
58
|
+
show ? runAnimShow() : animHide();
|
|
59
|
+
}
|
|
60
|
+
}, [show]);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
return () => {
|
|
63
|
+
if (hideTimerRef.current) {
|
|
64
|
+
clearTimeout(hideTimerRef.current);
|
|
65
|
+
}
|
|
66
|
+
if (showTimerRef.current) {
|
|
67
|
+
clearTimeout(showTimerRef.current);
|
|
68
|
+
}
|
|
69
69
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
70
|
+
}, []);
|
|
71
|
+
const onItemClickHandler = (index) => {
|
|
72
|
+
onItemClick && onItemClick(index);
|
|
73
|
+
animHide();
|
|
74
|
+
};
|
|
75
|
+
const onMaskClick = () => {
|
|
76
|
+
animHide();
|
|
77
|
+
};
|
|
78
|
+
const maskStyle = {
|
|
79
|
+
display: mask ? "block" : "none",
|
|
80
|
+
opacity: animShow ? 1 : 0
|
|
81
|
+
};
|
|
82
|
+
const listStyle = {
|
|
83
|
+
width,
|
|
84
|
+
transition: animShow ? "all 225ms cubic-bezier(0, 0, 0.2, 1)" : "all 195ms cubic-bezier(0.4, 0, 0.6, 1)"
|
|
85
|
+
};
|
|
86
|
+
const classObject = {
|
|
87
|
+
"at-drawer--show": animShow,
|
|
88
|
+
"at-drawer--right": right,
|
|
89
|
+
"at-drawer--left": !right
|
|
90
|
+
};
|
|
91
|
+
return _show ? /* @__PURE__ */ React.createElement(View, { className: classNames(["at-drawer"], classObject, className) }, /* @__PURE__ */ React.createElement(
|
|
92
|
+
View,
|
|
93
|
+
{
|
|
94
|
+
className: "at-drawer__mask",
|
|
95
|
+
style: maskStyle,
|
|
96
|
+
onClick: onMaskClick
|
|
97
|
+
}
|
|
98
|
+
), /* @__PURE__ */ React.createElement(View, { className: "at-drawer__content", style: listStyle }, !!items && items.length ? /* @__PURE__ */ React.createElement(AtList, null, items.map((name, index) => /* @__PURE__ */ React.createElement(
|
|
99
|
+
AtListItem,
|
|
100
|
+
{
|
|
101
|
+
key: `${name}-${index}`,
|
|
102
|
+
"data-index": index,
|
|
103
|
+
onClick: () => onItemClickHandler(index),
|
|
104
|
+
title: name,
|
|
105
|
+
arrow: "right"
|
|
106
|
+
}
|
|
107
|
+
))) : children)) : /* @__PURE__ */ React.createElement(View, null);
|
|
95
108
|
}
|
|
96
|
-
AtDrawer.defaultProps = {
|
|
97
|
-
show: false,
|
|
98
|
-
mask: true,
|
|
99
|
-
width: "",
|
|
100
|
-
right: false,
|
|
101
|
-
items: []
|
|
102
|
-
};
|
|
103
109
|
AtDrawer.propTypes = {
|
|
104
110
|
show: PropTypes.bool,
|
|
105
111
|
mask: PropTypes.bool,
|
|
@@ -108,7 +114,8 @@ AtDrawer.propTypes = {
|
|
|
108
114
|
onItemClick: PropTypes.func,
|
|
109
115
|
onClose: PropTypes.func
|
|
110
116
|
};
|
|
117
|
+
var drawer_default = AtDrawer;
|
|
111
118
|
export {
|
|
112
|
-
|
|
119
|
+
drawer_default as default
|
|
113
120
|
};
|
|
114
121
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/drawer/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes
|
|
1
|
+
{"version":3,"sources":["../../../src/components/drawer/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes from 'prop-types'\nimport React, { useEffect, useRef, useState } from 'react'\nimport { View } from '@tarojs/components'\nimport { AtDrawerProps } from '../../../types/drawer'\nimport AtList from '../list/index'\nimport AtListItem from '../list/item/index'\n\nfunction AtDrawer({\n show = false,\n mask = true,\n width = '',\n right = false,\n items = [],\n className,\n children,\n onItemClick,\n onClose\n}: AtDrawerProps): JSX.Element {\n const [animShow, setAnimShow] = useState(false)\n const [_show, setShow] = useState(show)\n const showStateRef = useRef(show)\n const isMountRef = useRef(true)\n const hideTimerRef = useRef<ReturnType<typeof setTimeout>>()\n const showTimerRef = useRef<ReturnType<typeof setTimeout>>()\n\n const onHide = (): void => {\n setShow(false)\n onClose && onClose()\n }\n\n const animHide = (): void => {\n setAnimShow(false)\n if (hideTimerRef.current) {\n clearTimeout(hideTimerRef.current)\n }\n hideTimerRef.current = setTimeout(() => {\n onHide()\n }, 300)\n }\n\n const runAnimShow = (): void => {\n setShow(true)\n if (showTimerRef.current) {\n clearTimeout(showTimerRef.current)\n }\n showTimerRef.current = setTimeout(() => {\n setAnimShow(true)\n }, 200)\n }\n\n useEffect(() => {\n showStateRef.current = _show\n }, [_show])\n\n useEffect(() => {\n if (isMountRef.current) {\n isMountRef.current = false\n if (show) {\n runAnimShow()\n }\n return\n }\n if (show !== showStateRef.current) {\n show ? runAnimShow() : animHide()\n }\n }, [show])\n\n useEffect(() => {\n return () => {\n if (hideTimerRef.current) {\n clearTimeout(hideTimerRef.current)\n }\n if (showTimerRef.current) {\n clearTimeout(showTimerRef.current)\n }\n }\n }, [])\n\n const onItemClickHandler = (index: number): void => {\n onItemClick && onItemClick(index)\n animHide()\n }\n\n const onMaskClick = (): void => {\n animHide()\n }\n\n const maskStyle = {\n display: mask ? 'block' : 'none',\n opacity: animShow ? 1 : 0\n }\n const listStyle = {\n width,\n transition: animShow\n ? 'all 225ms cubic-bezier(0, 0, 0.2, 1)'\n : 'all 195ms cubic-bezier(0.4, 0, 0.6, 1)'\n }\n\n const classObject = {\n 'at-drawer--show': animShow,\n 'at-drawer--right': right,\n 'at-drawer--left': !right\n }\n\n return _show ? (\n <View className={classNames(['at-drawer'], classObject, className)}>\n <View\n className='at-drawer__mask'\n style={maskStyle}\n onClick={onMaskClick}\n ></View>\n\n <View className='at-drawer__content' style={listStyle}>\n {!!items && items.length ? (\n <AtList>\n {items.map((name, index) => (\n <AtListItem\n key={`${name}-${index}`}\n data-index={index}\n onClick={() => onItemClickHandler(index)}\n title={name}\n arrow='right'\n ></AtListItem>\n ))}\n </AtList>\n ) : (\n children\n )}\n </View>\n </View>\n ) : (\n <View></View>\n )\n}\n\nAtDrawer.propTypes = {\n show: PropTypes.bool,\n mask: PropTypes.bool,\n width: PropTypes.string,\n items: PropTypes.arrayOf(PropTypes.string),\n onItemClick: PropTypes.func,\n onClose: PropTypes.func\n}\n\nexport default AtDrawer\n"],"mappings":"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","names":[]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
3
2
|
import { AtFabProps } from '../../../types/fab';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
declare function AtFab({ size, className, children, onClick }: AtFabProps): JSX.Element;
|
|
4
|
+
declare namespace AtFab {
|
|
5
|
+
var propTypes: {
|
|
6
|
+
size: PropTypes.Requireable<string>;
|
|
7
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
8
|
+
};
|
|
9
9
|
}
|
|
10
|
+
export default AtFab;
|
|
@@ -2,28 +2,28 @@ import classNames from "classnames";
|
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { View } from "@tarojs/components";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
function AtFab({
|
|
6
|
+
size = "normal",
|
|
7
|
+
className,
|
|
8
|
+
children,
|
|
9
|
+
onClick
|
|
10
|
+
}) {
|
|
11
|
+
const handleClick = (e) => {
|
|
12
|
+
if (typeof onClick === "function") {
|
|
13
|
+
onClick(e);
|
|
9
14
|
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
});
|
|
16
|
-
return /* @__PURE__ */ React.createElement(View, { className: rootClass, onClick: this.onClick.bind(this) }, children);
|
|
17
|
-
}
|
|
15
|
+
};
|
|
16
|
+
const rootClass = classNames("at-fab", className, {
|
|
17
|
+
[`at-fab--${size}`]: size
|
|
18
|
+
});
|
|
19
|
+
return /* @__PURE__ */ React.createElement(View, { className: rootClass, onClick: handleClick }, children);
|
|
18
20
|
}
|
|
19
21
|
AtFab.propTypes = {
|
|
20
22
|
size: PropTypes.oneOf(["normal", "small"]),
|
|
21
23
|
onClick: PropTypes.func
|
|
22
24
|
};
|
|
23
|
-
|
|
24
|
-
size: "normal"
|
|
25
|
-
};
|
|
25
|
+
var fab_default = AtFab;
|
|
26
26
|
export {
|
|
27
|
-
|
|
27
|
+
fab_default as default
|
|
28
28
|
};
|
|
29
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/fab/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fab/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { CommonEvent } from '@tarojs/components/types/common'\nimport { AtFabProps } from '../../../types/fab'\n\nfunction AtFab({\n size = 'normal',\n className,\n children,\n onClick\n}: AtFabProps): JSX.Element {\n const handleClick = (e: CommonEvent): void => {\n if (typeof onClick === 'function') {\n onClick(e)\n }\n }\n\n const rootClass = classNames('at-fab', className, {\n [`at-fab--${size}`]: size\n })\n\n return (\n <View className={rootClass} onClick={handleClick}>\n {children}\n </View>\n )\n}\n\nAtFab.propTypes = {\n size: PropTypes.oneOf(['normal', 'small']),\n onClick: PropTypes.func\n}\n\nexport default AtFab\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAAe;AACtB,OAAO,WAAW;AAClB,SAAS,YAAY;AAIrB,SAAS,MAAM;AAAA,EACb,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AACF,GAA4B;AAC1B,QAAM,cAAc,CAAC,MAAyB;AAC5C,QAAI,OAAO,YAAY,YAAY;AACjC,cAAQ,CAAC;AAAA,IACX;AAAA,EACF;AAEA,QAAM,YAAY,WAAW,UAAU,WAAW;AAAA,IAChD,CAAC,WAAW,IAAI,EAAE,GAAG;AAAA,EACvB,CAAC;AAED,SACE,oCAAC,QAAK,WAAW,WAAW,SAAS,eAClC,QACH;AAEJ;AAEA,MAAM,YAAY;AAAA,EAChB,MAAM,UAAU,MAAM,CAAC,UAAU,OAAO,CAAC;AAAA,EACzC,SAAS,UAAU;AACrB;AAEA,IAAO,cAAQ;","names":[]}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
3
2
|
import { AtFlexProps } from '../../../types/flex';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
declare function AtFlex(props: AtFlexProps): JSX.Element;
|
|
4
|
+
declare namespace AtFlex {
|
|
5
|
+
var propTypes: {
|
|
6
|
+
wrap: PropTypes.Requireable<string>;
|
|
7
|
+
align: PropTypes.Requireable<string>;
|
|
8
|
+
justify: PropTypes.Requireable<string>;
|
|
9
|
+
dirction: PropTypes.Requireable<string>;
|
|
10
|
+
alignContent: PropTypes.Requireable<string>;
|
|
11
|
+
};
|
|
7
12
|
}
|
|
13
|
+
export default AtFlex;
|
|
@@ -3,23 +3,21 @@ import _forEach from "lodash/forEach";
|
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { View } from "@tarojs/components";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return /* @__PURE__ */ React.createElement(View, { className: classNames(rootClass) }, this.props.children);
|
|
22
|
-
}
|
|
6
|
+
function AtFlex(props) {
|
|
7
|
+
const rootClass = ["at-row"];
|
|
8
|
+
_forEach(props, (value, key) => {
|
|
9
|
+
if (key === "children") {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (key === "alignContent") {
|
|
13
|
+
return rootClass.push(`at-row--${value}`);
|
|
14
|
+
}
|
|
15
|
+
if (key === "alignContent") {
|
|
16
|
+
return rootClass.push(`at-row__align-content--${value}`);
|
|
17
|
+
}
|
|
18
|
+
rootClass.push(`at-row__${key}--${value}`);
|
|
19
|
+
});
|
|
20
|
+
return /* @__PURE__ */ React.createElement(View, { className: classNames(rootClass) }, props.children);
|
|
23
21
|
}
|
|
24
22
|
AtFlex.propTypes = {
|
|
25
23
|
wrap: PropTypes.oneOf(["no-wrap", "wrap", "wrap-reverse"]),
|
|
@@ -35,7 +33,8 @@ AtFlex.propTypes = {
|
|
|
35
33
|
"around"
|
|
36
34
|
])
|
|
37
35
|
};
|
|
36
|
+
var flex_default = AtFlex;
|
|
38
37
|
export {
|
|
39
|
-
|
|
38
|
+
flex_default as default
|
|
40
39
|
};
|
|
41
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/flex/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport _forEach from 'lodash/forEach'\nimport PropTypes
|
|
1
|
+
{"version":3,"sources":["../../../src/components/flex/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport _forEach from 'lodash/forEach'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { AtFlexProps } from '../../../types/flex'\n\nfunction AtFlex(props: AtFlexProps): JSX.Element {\n const rootClass = ['at-row']\n\n _forEach(props, (value, key) => {\n if (key === 'children') {\n return\n }\n if (key === 'alignContent') {\n return rootClass.push(`at-row--${value}`)\n }\n if (key === 'alignContent') {\n return rootClass.push(`at-row__align-content--${value}`)\n }\n rootClass.push(`at-row__${key}--${value}`)\n })\n\n return <View className={classNames(rootClass)}>{props.children}</View>\n}\n\nAtFlex.propTypes = {\n wrap: PropTypes.oneOf(['no-wrap', 'wrap', 'wrap-reverse']),\n align: PropTypes.oneOf(['start', 'end', 'center', 'stretch', 'baseline']),\n justify: PropTypes.oneOf(['start', 'end', 'center', 'between', 'around']),\n dirction: PropTypes.oneOf(['row', 'column', 'row-reverse', 'column-reverse']),\n alignContent: PropTypes.oneOf([\n 'start',\n 'end',\n 'center',\n 'stretch',\n 'between',\n 'around'\n ])\n}\n\nexport default AtFlex\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,cAAc;AACrB,OAAO,eAAe;AACtB,OAAO,WAAW;AAClB,SAAS,YAAY;AAGrB,SAAS,OAAO,OAAiC;AAC/C,QAAM,YAAY,CAAC,QAAQ;AAE3B,WAAS,OAAO,CAAC,OAAO,QAAQ;AAC9B,QAAI,QAAQ,YAAY;AACtB;AAAA,IACF;AACA,QAAI,QAAQ,gBAAgB;AAC1B,aAAO,UAAU,KAAK,WAAW,KAAK,EAAE;AAAA,IAC1C;AACA,QAAI,QAAQ,gBAAgB;AAC1B,aAAO,UAAU,KAAK,0BAA0B,KAAK,EAAE;AAAA,IACzD;AACA,cAAU,KAAK,WAAW,GAAG,KAAK,KAAK,EAAE;AAAA,EAC3C,CAAC;AAED,SAAO,oCAAC,QAAK,WAAW,WAAW,SAAS,KAAI,MAAM,QAAS;AACjE;AAEA,OAAO,YAAY;AAAA,EACjB,MAAM,UAAU,MAAM,CAAC,WAAW,QAAQ,cAAc,CAAC;AAAA,EACzD,OAAO,UAAU,MAAM,CAAC,SAAS,OAAO,UAAU,WAAW,UAAU,CAAC;AAAA,EACxE,SAAS,UAAU,MAAM,CAAC,SAAS,OAAO,UAAU,WAAW,QAAQ,CAAC;AAAA,EACxE,UAAU,UAAU,MAAM,CAAC,OAAO,UAAU,eAAe,gBAAgB,CAAC;AAAA,EAC5E,cAAc,UAAU,MAAM;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAEA,IAAO,eAAQ;","names":[]}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
3
2
|
import { AtFlexItemProps } from '../../../../types/flex';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
declare function AtFlexItem(props: AtFlexItemProps): JSX.Element;
|
|
4
|
+
declare namespace AtFlexItem {
|
|
5
|
+
var propTypes: {
|
|
6
|
+
isAuto: PropTypes.Requireable<boolean>;
|
|
7
|
+
isWrap: PropTypes.Requireable<boolean>;
|
|
8
|
+
align: PropTypes.Requireable<string>;
|
|
9
|
+
size: PropTypes.Requireable<number>;
|
|
10
|
+
offset: PropTypes.Requireable<number>;
|
|
11
|
+
};
|
|
7
12
|
}
|
|
13
|
+
export default AtFlexItem;
|