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,9 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
3
2
|
import { AtIconProps } from '../../../types/icon';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
declare function AtIcon({ customStyle, className, prefixClass, value, color, size, onClick }: AtIconProps): JSX.Element;
|
|
4
|
+
declare namespace AtIcon {
|
|
5
|
+
var propTypes: {
|
|
6
|
+
customStyle: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
7
|
+
className: PropTypes.Requireable<NonNullable<string | any[] | null | undefined>>;
|
|
8
|
+
prefixClass: PropTypes.Requireable<string>;
|
|
9
|
+
value: PropTypes.Requireable<string>;
|
|
10
|
+
color: PropTypes.Requireable<string>;
|
|
11
|
+
size: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
12
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
13
|
+
};
|
|
9
14
|
}
|
|
15
|
+
export default AtIcon;
|
|
@@ -3,42 +3,32 @@ import PropTypes from "prop-types";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Text } from "@tarojs/components";
|
|
5
5
|
import { mergeStyle, pxTransform } from "../../common/utils";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
color
|
|
18
|
-
} = this.props;
|
|
19
|
-
const rootStyle = {
|
|
20
|
-
fontSize: `${pxTransform(parseInt(String(size)) * 2)}`,
|
|
21
|
-
color
|
|
22
|
-
};
|
|
23
|
-
const iconName = value ? `${prefixClass}-${value}` : "";
|
|
24
|
-
return /* @__PURE__ */ React.createElement(
|
|
25
|
-
Text,
|
|
26
|
-
{
|
|
27
|
-
className: classNames(prefixClass, iconName, className),
|
|
28
|
-
style: mergeStyle(rootStyle, customStyle),
|
|
29
|
-
onClick: this.handleClick.bind(this)
|
|
30
|
-
}
|
|
31
|
-
);
|
|
6
|
+
function AtIcon({
|
|
7
|
+
customStyle = {},
|
|
8
|
+
className = "",
|
|
9
|
+
prefixClass = "at-icon",
|
|
10
|
+
value = "",
|
|
11
|
+
color = "",
|
|
12
|
+
size = 24,
|
|
13
|
+
onClick
|
|
14
|
+
}) {
|
|
15
|
+
function handleClick() {
|
|
16
|
+
onClick && onClick(arguments);
|
|
32
17
|
}
|
|
18
|
+
const rootStyle = {
|
|
19
|
+
fontSize: `${pxTransform(parseInt(String(size)) * 2)}`,
|
|
20
|
+
color
|
|
21
|
+
};
|
|
22
|
+
const iconName = value ? `${prefixClass}-${value}` : "";
|
|
23
|
+
return /* @__PURE__ */ React.createElement(
|
|
24
|
+
Text,
|
|
25
|
+
{
|
|
26
|
+
className: classNames(prefixClass, iconName, className),
|
|
27
|
+
style: mergeStyle(rootStyle, customStyle),
|
|
28
|
+
onClick: handleClick
|
|
29
|
+
}
|
|
30
|
+
);
|
|
33
31
|
}
|
|
34
|
-
AtIcon.defaultProps = {
|
|
35
|
-
customStyle: "",
|
|
36
|
-
className: "",
|
|
37
|
-
prefixClass: "at-icon",
|
|
38
|
-
value: "",
|
|
39
|
-
color: "",
|
|
40
|
-
size: 24
|
|
41
|
-
};
|
|
42
32
|
AtIcon.propTypes = {
|
|
43
33
|
customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
44
34
|
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/icon/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes
|
|
1
|
+
{"version":3,"sources":["../../../src/components/icon/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport { Text } from '@tarojs/components'\nimport { AtIconProps } from '../../../types/icon'\nimport { mergeStyle, pxTransform } from '../../common/utils'\n\nexport default function AtIcon({\n customStyle = {},\n className = '',\n prefixClass = 'at-icon',\n value = '',\n color = '',\n size = 24,\n onClick\n}: AtIconProps): JSX.Element {\n function handleClick(): void {\n onClick && onClick(arguments as any)\n }\n\n const rootStyle = {\n fontSize: `${pxTransform(parseInt(String(size)) * 2)}`,\n color\n }\n\n const iconName = value ? `${prefixClass}-${value}` : ''\n return (\n <Text\n className={classNames(prefixClass, iconName, className)}\n style={mergeStyle(rootStyle, customStyle)}\n onClick={handleClick}\n ></Text>\n )\n}\n\nAtIcon.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n prefixClass: PropTypes.string,\n value: PropTypes.string,\n color: PropTypes.string,\n size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n onClick: PropTypes.func\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAAe;AACtB,OAAO,WAAW;AAClB,SAAS,YAAY;AAErB,SAAS,YAAY,mBAAmB;AAEzB,SAAR,OAAwB;AAAA,EAC7B,cAAc,CAAC;AAAA,EACf,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP;AACF,GAA6B;AAC3B,WAAS,cAAoB;AAC3B,eAAW,QAAQ,SAAgB;AAAA,EACrC;AAEA,QAAM,YAAY;AAAA,IAChB,UAAU,GAAG,YAAY,SAAS,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;AAAA,IACpD;AAAA,EACF;AAEA,QAAM,WAAW,QAAQ,GAAG,WAAW,IAAI,KAAK,KAAK;AACrD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,WAAW,aAAa,UAAU,SAAS;AAAA,MACtD,OAAO,WAAW,WAAW,WAAW;AAAA,MACxC,SAAS;AAAA;AAAA,EACV;AAEL;AAEA,OAAO,YAAY;AAAA,EACjB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EAClE,aAAa,UAAU;AAAA,EACvB,OAAO,UAAU;AAAA,EACjB,OAAO,UAAU;AAAA,EACjB,MAAM,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAC9D,SAAS,UAAU;AACrB;","names":[]}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
3
2
|
import { AtImagePickerProps } from '../../../types/image-picker';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
declare function AtImagePicker({ className, customStyle, files, mode, showAddBtn, multiple, length, count, sizeType, sourceType, onChange, onImageClick, onFail, children }: AtImagePickerProps): JSX.Element;
|
|
4
|
+
declare namespace AtImagePicker {
|
|
5
|
+
var propTypes: {
|
|
6
|
+
className: PropTypes.Requireable<NonNullable<string | any[] | null | undefined>>;
|
|
7
|
+
customStyle: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
8
|
+
files: PropTypes.Requireable<any[]>;
|
|
9
|
+
mode: PropTypes.Requireable<string>;
|
|
10
|
+
showAddBtn: PropTypes.Requireable<boolean>;
|
|
11
|
+
multiple: PropTypes.Requireable<boolean>;
|
|
12
|
+
length: PropTypes.Requireable<number>;
|
|
13
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
+
onImageClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
+
onFail: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
|
+
count: PropTypes.Requireable<number>;
|
|
17
|
+
sizeType: PropTypes.Requireable<any[]>;
|
|
18
|
+
sourceType: PropTypes.Requireable<any[]>;
|
|
19
|
+
};
|
|
11
20
|
}
|
|
21
|
+
export default AtImagePicker;
|
|
@@ -3,7 +3,7 @@ import PropTypes from "prop-types";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Image, View } from "@tarojs/components";
|
|
5
5
|
import Taro from "@tarojs/taro";
|
|
6
|
-
import { uuid } from "../../common/utils";
|
|
6
|
+
import { noop, uuid } from "../../common/utils";
|
|
7
7
|
const generateMatrix = (files, col, showAddBtn) => {
|
|
8
8
|
const matrix = [];
|
|
9
9
|
const length = showAddBtn ? files.length + 1 : files.length;
|
|
@@ -26,109 +26,89 @@ const generateMatrix = (files, col, showAddBtn) => {
|
|
|
26
26
|
}
|
|
27
27
|
return matrix;
|
|
28
28
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
29
|
+
function AtImagePicker({
|
|
30
|
+
className = "",
|
|
31
|
+
customStyle = "",
|
|
32
|
+
files = [],
|
|
33
|
+
mode = "aspectFill",
|
|
34
|
+
showAddBtn = true,
|
|
35
|
+
multiple = false,
|
|
36
|
+
length = 4,
|
|
37
|
+
count,
|
|
38
|
+
sizeType,
|
|
39
|
+
sourceType,
|
|
40
|
+
onChange = noop,
|
|
41
|
+
onImageClick,
|
|
42
|
+
onFail,
|
|
43
|
+
children
|
|
44
|
+
}) {
|
|
45
|
+
const ENV = Taro.getEnv();
|
|
46
|
+
const chooseFile = () => {
|
|
47
|
+
const filePathName = ENV === Taro.ENV_TYPE.ALIPAY ? "apFilePaths" : "tempFiles";
|
|
48
|
+
const params = {};
|
|
49
|
+
if (multiple) {
|
|
50
|
+
params.count = 99;
|
|
51
|
+
}
|
|
52
|
+
if (count) {
|
|
53
|
+
params.count = count;
|
|
54
|
+
}
|
|
55
|
+
if (sizeType) {
|
|
56
|
+
params.sizeType = sizeType;
|
|
57
|
+
}
|
|
58
|
+
if (sourceType) {
|
|
59
|
+
params.sourceType = sourceType;
|
|
60
|
+
}
|
|
61
|
+
Taro.chooseImage(params).then((res) => {
|
|
62
|
+
const targetFiles = res.tempFilePaths.map((path, i) => ({
|
|
63
|
+
url: path,
|
|
64
|
+
file: res[filePathName][i]
|
|
65
|
+
}));
|
|
66
|
+
const newFiles = files.concat(targetFiles);
|
|
67
|
+
onChange(newFiles, "add");
|
|
68
|
+
}).catch((err) => {
|
|
69
|
+
onFail == null ? void 0 : onFail(err);
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
const handleImageClick = (idx) => {
|
|
73
|
+
onImageClick && onImageClick(idx, files[idx]);
|
|
74
|
+
};
|
|
75
|
+
const handleRemoveImg = (idx, event) => {
|
|
76
|
+
event.stopPropagation();
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
if (ENV === Taro.ENV_TYPE.WEB) {
|
|
79
|
+
window.URL.revokeObjectURL(files[idx].url);
|
|
80
|
+
}
|
|
81
|
+
const newFiles = files.filter((_, i) => i !== idx);
|
|
82
|
+
onChange(newFiles, "remove", idx);
|
|
83
|
+
};
|
|
84
|
+
const rowLength = length <= 0 ? 1 : length;
|
|
85
|
+
const matrix = generateMatrix(files, rowLength, showAddBtn);
|
|
86
|
+
const rootCls = classNames("at-image-picker", className);
|
|
87
|
+
return /* @__PURE__ */ React.createElement(View, { className: rootCls, style: customStyle }, matrix.map((row, i) => /* @__PURE__ */ React.createElement(View, { className: "at-image-picker__flex-box", key: i + 1 }, row.map(
|
|
88
|
+
(item, j) => item.url ? /* @__PURE__ */ React.createElement(View, { className: "at-image-picker__flex-item", key: i * length + j }, /* @__PURE__ */ React.createElement(View, { className: "at-image-picker__item" }, /* @__PURE__ */ React.createElement(
|
|
89
|
+
View,
|
|
90
|
+
{
|
|
91
|
+
className: "at-image-picker__remove-btn",
|
|
92
|
+
onClick: (event) => handleRemoveImg(i * length + j, event)
|
|
48
93
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}).catch((err) => {
|
|
57
|
-
var _a, _b;
|
|
58
|
-
(_b = (_a = this.props) == null ? void 0 : _a.onFail) == null ? void 0 : _b.call(_a, err);
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
this.handleImageClick = (idx) => {
|
|
62
|
-
this.props.onImageClick && this.props.onImageClick(idx, this.props.files[idx]);
|
|
63
|
-
};
|
|
64
|
-
this.handleRemoveImg = (idx, event) => {
|
|
65
|
-
event.stopPropagation();
|
|
66
|
-
event.preventDefault();
|
|
67
|
-
const { files = [] } = this.props;
|
|
68
|
-
if (ENV === Taro.ENV_TYPE.WEB) {
|
|
69
|
-
window.URL.revokeObjectURL(files[idx].url);
|
|
94
|
+
), /* @__PURE__ */ React.createElement(
|
|
95
|
+
Image,
|
|
96
|
+
{
|
|
97
|
+
className: "at-image-picker__preview-img",
|
|
98
|
+
mode,
|
|
99
|
+
src: item.url,
|
|
100
|
+
onClick: () => handleImageClick(i * length + j)
|
|
70
101
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
className,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
mode,
|
|
81
|
-
length = 4,
|
|
82
|
-
showAddBtn = true
|
|
83
|
-
} = this.props;
|
|
84
|
-
const rowLength = length <= 0 ? 1 : length;
|
|
85
|
-
const matrix = generateMatrix(files, rowLength, showAddBtn);
|
|
86
|
-
const rootCls = classNames("at-image-picker", className);
|
|
87
|
-
return /* @__PURE__ */ React.createElement(View, { className: rootCls, style: customStyle }, matrix.map((row, i) => /* @__PURE__ */ React.createElement(View, { className: "at-image-picker__flex-box", key: i + 1 }, row.map(
|
|
88
|
-
(item, j) => item.url ? /* @__PURE__ */ React.createElement(
|
|
89
|
-
View,
|
|
90
|
-
{
|
|
91
|
-
className: "at-image-picker__flex-item",
|
|
92
|
-
key: i * length + j
|
|
93
|
-
},
|
|
94
|
-
/* @__PURE__ */ React.createElement(View, { className: "at-image-picker__item" }, /* @__PURE__ */ React.createElement(
|
|
95
|
-
View,
|
|
96
|
-
{
|
|
97
|
-
className: "at-image-picker__remove-btn",
|
|
98
|
-
onClick: this.handleRemoveImg.bind(this, i * length + j)
|
|
99
|
-
}
|
|
100
|
-
), /* @__PURE__ */ React.createElement(
|
|
101
|
-
Image,
|
|
102
|
-
{
|
|
103
|
-
className: "at-image-picker__preview-img",
|
|
104
|
-
mode,
|
|
105
|
-
src: item.url,
|
|
106
|
-
onClick: this.handleImageClick.bind(this, i * length + j)
|
|
107
|
-
}
|
|
108
|
-
))
|
|
109
|
-
) : /* @__PURE__ */ React.createElement(
|
|
110
|
-
View,
|
|
111
|
-
{
|
|
112
|
-
className: "at-image-picker__flex-item",
|
|
113
|
-
key: `empty_${i * length}${j}`
|
|
114
|
-
},
|
|
115
|
-
item.type === "btn" && /* @__PURE__ */ React.createElement(View, { onClick: this.chooseFile }, this.props.children || /* @__PURE__ */ React.createElement(View, { className: "at-image-picker__item at-image-picker__choose-btn" }, /* @__PURE__ */ React.createElement(View, { className: "add-bar" }), /* @__PURE__ */ React.createElement(View, { className: "add-bar" })))
|
|
116
|
-
)
|
|
117
|
-
))));
|
|
118
|
-
}
|
|
102
|
+
))) : /* @__PURE__ */ React.createElement(
|
|
103
|
+
View,
|
|
104
|
+
{
|
|
105
|
+
className: "at-image-picker__flex-item",
|
|
106
|
+
key: `empty_${i * length}${j}`
|
|
107
|
+
},
|
|
108
|
+
item.type === "btn" && /* @__PURE__ */ React.createElement(View, { onClick: chooseFile }, children || /* @__PURE__ */ React.createElement(View, { className: "at-image-picker__item at-image-picker__choose-btn" }, /* @__PURE__ */ React.createElement(View, { className: "add-bar" }), /* @__PURE__ */ React.createElement(View, { className: "add-bar" })))
|
|
109
|
+
)
|
|
110
|
+
))));
|
|
119
111
|
}
|
|
120
|
-
AtImagePicker.defaultProps = {
|
|
121
|
-
className: "",
|
|
122
|
-
customStyle: "",
|
|
123
|
-
files: [],
|
|
124
|
-
mode: "aspectFill",
|
|
125
|
-
showAddBtn: true,
|
|
126
|
-
multiple: false,
|
|
127
|
-
length: 4,
|
|
128
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
129
|
-
onChange: () => {
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
112
|
AtImagePicker.propTypes = {
|
|
133
113
|
className: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
|
|
134
114
|
customStyle: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
@@ -158,7 +138,8 @@ AtImagePicker.propTypes = {
|
|
|
158
138
|
sizeType: PropTypes.array,
|
|
159
139
|
sourceType: PropTypes.array
|
|
160
140
|
};
|
|
141
|
+
var image_picker_default = AtImagePicker;
|
|
161
142
|
export {
|
|
162
|
-
|
|
143
|
+
image_picker_default as default
|
|
163
144
|
};
|
|
164
145
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/image-picker/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes
|
|
1
|
+
{"version":3,"sources":["../../../src/components/image-picker/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport { Image, View } from '@tarojs/components'\nimport { ITouchEvent } from '@tarojs/components/types/common'\nimport Taro from '@tarojs/taro'\nimport { AtImagePickerProps, File } from '../../../types/image-picker'\nimport { noop, uuid } from '../../common/utils'\n\ninterface MatrixFile extends Partial<File> {\n type: 'blank' | 'btn'\n uuid: string\n}\n\n// 生成 jsx 二维矩阵\nconst generateMatrix = (\n files: MatrixFile[],\n col: number,\n showAddBtn: boolean\n): MatrixFile[][] => {\n const matrix: Array<MatrixFile>[] = []\n const length = showAddBtn ? files.length + 1 : files.length\n const row = Math.ceil(length / col)\n for (let i = 0; i < row; i++) {\n if (i === row - 1) {\n // 最后一行数据加上添加按钮\n const lastArr = files.slice(i * col)\n if (lastArr.length < col) {\n if (showAddBtn) {\n lastArr.push({ type: 'btn', uuid: uuid() })\n }\n // 填补剩下的空列\n for (let j = lastArr.length; j < col; j++) {\n lastArr.push({ type: 'blank', uuid: uuid() })\n }\n }\n matrix.push(lastArr)\n } else {\n matrix.push(files.slice(i * col, (i + 1) * col))\n }\n }\n return matrix\n}\n\nfunction AtImagePicker({\n className = '',\n customStyle = '',\n files = [],\n mode = 'aspectFill',\n showAddBtn = true,\n multiple = false,\n length = 4,\n count,\n sizeType,\n sourceType,\n onChange = noop,\n onImageClick,\n onFail,\n children\n}: AtImagePickerProps): JSX.Element {\n const ENV = Taro.getEnv()\n\n const chooseFile = (): void => {\n const filePathName =\n ENV === Taro.ENV_TYPE.ALIPAY ? 'apFilePaths' : 'tempFiles'\n // const count = multiple ? 99 : 1\n const params: any = {}\n if (multiple) {\n params.count = 99\n }\n if (count) {\n params.count = count\n }\n if (sizeType) {\n params.sizeType = sizeType\n }\n if (sourceType) {\n params.sourceType = sourceType\n }\n Taro.chooseImage(params)\n .then(res => {\n const targetFiles = res.tempFilePaths.map((path, i) => ({\n url: path,\n file: res[filePathName][i]\n }))\n const newFiles = files.concat(targetFiles)\n onChange(newFiles, 'add')\n })\n .catch(err => {\n onFail?.(err)\n })\n }\n\n const handleImageClick = (idx: number): void => {\n onImageClick && onImageClick(idx, files[idx])\n }\n\n const handleRemoveImg = (idx: number, event: ITouchEvent): void => {\n event.stopPropagation()\n event.preventDefault()\n if (ENV === Taro.ENV_TYPE.WEB) {\n window.URL.revokeObjectURL(files[idx].url)\n }\n const newFiles = files.filter((_, i) => i !== idx)\n onChange(newFiles, 'remove', idx)\n }\n\n const rowLength = length <= 0 ? 1 : length\n // 行数\n const matrix = generateMatrix(files as MatrixFile[], rowLength, showAddBtn)\n const rootCls = classNames('at-image-picker', className)\n\n return (\n <View className={rootCls} style={customStyle}>\n {matrix.map((row, i) => (\n <View className='at-image-picker__flex-box' key={i + 1}>\n {row.map((item, j) =>\n item.url ? (\n <View className='at-image-picker__flex-item' key={i * length + j}>\n <View className='at-image-picker__item'>\n <View\n className='at-image-picker__remove-btn'\n onClick={(event: ITouchEvent) =>\n handleRemoveImg(i * length + j, event)\n }\n ></View>\n <Image\n className='at-image-picker__preview-img'\n mode={mode}\n src={item.url}\n onClick={() => handleImageClick(i * length + j)}\n />\n </View>\n </View>\n ) : (\n <View\n className='at-image-picker__flex-item'\n key={`empty_${i * length}${j}`}\n >\n {item.type === 'btn' && (\n <View onClick={chooseFile}>\n {children || (\n <View className='at-image-picker__item at-image-picker__choose-btn'>\n <View className='add-bar'></View>\n <View className='add-bar'></View>\n </View>\n )}\n </View>\n )}\n </View>\n )\n )}\n </View>\n ))}\n </View>\n )\n}\n\nAtImagePicker.propTypes = {\n className: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),\n customStyle: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n files: PropTypes.array,\n mode: PropTypes.oneOf([\n 'scaleToFill',\n 'aspectFit',\n 'aspectFill',\n 'widthFix',\n 'top',\n 'bottom',\n 'center',\n 'left',\n 'right',\n 'top left',\n 'top right',\n 'bottom left',\n 'bottom right'\n ]),\n showAddBtn: PropTypes.bool,\n multiple: PropTypes.bool,\n length: PropTypes.number,\n onChange: PropTypes.func,\n onImageClick: PropTypes.func,\n onFail: PropTypes.func,\n count: PropTypes.number,\n sizeType: PropTypes.array,\n sourceType: PropTypes.array\n}\n\nexport default AtImagePicker\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAAe;AACtB,OAAO,WAAW;AAClB,SAAS,OAAO,YAAY;AAE5B,OAAO,UAAU;AAEjB,SAAS,MAAM,YAAY;AAQ3B,MAAM,iBAAiB,CACrB,OACA,KACA,eACmB;AACnB,QAAM,SAA8B,CAAC;AACrC,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private jumpTarget;
|
|
20
|
-
private __jumpTarget;
|
|
21
|
-
private updateState;
|
|
22
|
-
private initData;
|
|
23
|
-
private handleScroll;
|
|
24
|
-
private getAnchorIndex;
|
|
25
|
-
UNSAFE_componentWillReceiveProps(nextProps: AtIndexesProps): void;
|
|
26
|
-
componentDidMount(): void;
|
|
27
|
-
UNSAFE_componentWillMount(): void;
|
|
28
|
-
render(): JSX.Element;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { AtIndexesProps } from '../../../types/indexes';
|
|
3
|
+
declare function AtIndexes({ customStyle, className, animation, topKey, isVibrate, isShowToast, list, onClick, onScrollIntoView, children }: AtIndexesProps): JSX.Element;
|
|
4
|
+
declare namespace AtIndexes {
|
|
5
|
+
var propTypes: {
|
|
6
|
+
customStyle: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
7
|
+
className: PropTypes.Requireable<NonNullable<string | any[] | null | undefined>>;
|
|
8
|
+
animation: PropTypes.Requireable<boolean>;
|
|
9
|
+
isVibrate: PropTypes.Requireable<boolean>;
|
|
10
|
+
isShowToast: PropTypes.Requireable<boolean>;
|
|
11
|
+
topKey: PropTypes.Requireable<string>;
|
|
12
|
+
list: PropTypes.Requireable<any[]>;
|
|
13
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
+
onScrollIntoView: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
+
};
|
|
29
16
|
}
|
|
17
|
+
export default AtIndexes;
|