@digitalc/dxp-ui 0.0.5-alpha.10 → 0.0.5-alpha.11
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/README.md +1 -1
- package/es/assets/token.json +4 -1
- package/es/components/Amount/index.d.ts +1 -0
- package/es/components/Amount/index.js +4 -2
- package/es/components/Button/index.d.ts +14 -18
- package/es/components/Button/index.js +82 -36
- package/es/components/Icon/index.d.ts +1 -1
- package/es/components/Image/index.d.ts +2 -0
- package/es/components/Image/index.js +11 -2
- package/es/components/ListItem/designTokens.d.ts +30 -0
- package/es/components/ListItem/designTokens.js +31 -0
- package/es/components/ListItem/index.d.ts +60 -0
- package/es/components/ListItem/index.js +227 -0
- package/es/components/ListItem/style/index.less +77 -0
- package/es/components/ListItem/style/variables.less +1 -0
- package/es/components/Navigation/index.d.ts +1 -0
- package/es/components/Navigation/index.js +8 -4
- package/es/components/Navigation/style/index.less +7 -0
- package/es/components/StickyFooter/index.d.ts +3 -0
- package/es/components/StickyFooter/index.js +7 -1
- package/es/components/Tabs/index.js +1 -1
- package/es/components/Text/designTokens.d.ts +6 -0
- package/es/components/Text/designTokens.js +7 -1
- package/es/components/Text/index.js +14 -2
- package/es/components/TextLink/index.d.ts +1 -1
- package/es/components/index.d.ts +3 -0
- package/es/components/index.js +4 -1
- package/es/fonts/SF/SF-Pro-Display-BlackItalic.otf +0 -0
- package/es/fonts/SF/SF-Pro-Text-Bold.otf +0 -0
- package/es/fonts/SF/SF-Pro-Text-Medium.eot +0 -0
- package/es/fonts/SF/SF-Pro-Text-Medium.otf +0 -0
- package/es/fonts/SF/SF-Pro-Text-Medium.svg +40549 -0
- package/es/fonts/SF/SF-Pro-Text-Medium.ttf +0 -0
- package/es/fonts/SF/SF-Pro-Text-Medium.woff +0 -0
- package/es/fonts/SF/SF-Pro-Text-Medium.woff2 +0 -0
- package/es/fonts/SF/SF-Pro-Text-Regular.otf +0 -0
- package/es/fonts/SF/SF-Pro-Text-Regular.ttf +0 -0
- package/es/fonts/SF/SF-Pro-Text-Semibold.otf +0 -0
- package/es/fonts/SF/SF-Pro-Text-SemiboldItalic.otf +0 -0
- package/es/style/variables.less +53 -27
- package/es/tokens/DXPGlobal.d.ts +1 -1
- package/es/tokens/DXPGlobal.js +3 -2
- package/es/utils/tokenManager.d.ts +12 -0
- package/es/utils/tokenManager.js +11 -5
- package/lib/assets/token.json +4 -1
- package/lib/components/Amount/index.d.ts +1 -0
- package/lib/components/Amount/index.js +5 -3
- package/lib/components/Button/demo/index.d.ts +3 -0
- package/lib/components/Button/demo/index.js +138 -0
- package/lib/components/Button/index.d.ts +14 -18
- package/lib/components/Button/index.js +46 -15
- package/lib/components/Icon/index.d.ts +1 -1
- package/lib/components/Image/index.d.ts +2 -0
- package/lib/components/Image/index.js +23 -3
- package/lib/components/ListItem/designTokens.d.ts +30 -0
- package/lib/components/ListItem/designTokens.js +65 -0
- package/lib/components/ListItem/index.d.ts +60 -0
- package/lib/components/ListItem/index.js +348 -0
- package/lib/components/ListItem/style/index.less +77 -0
- package/lib/components/ListItem/style/variables.less +1 -0
- package/lib/components/Navigation/index.d.ts +1 -0
- package/lib/components/Navigation/index.js +18 -5
- package/lib/components/Navigation/style/index.less +7 -0
- package/lib/components/StickyFooter/index.d.ts +3 -0
- package/lib/components/StickyFooter/index.js +12 -5
- package/lib/components/Tabs/index.js +1 -1
- package/lib/components/Text/designTokens.d.ts +6 -0
- package/lib/components/Text/designTokens.js +7 -1
- package/lib/components/Text/index.js +52 -37
- package/lib/components/TextLink/index.d.ts +1 -1
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.js +7 -0
- package/lib/fonts/SF/SF-Pro-Display-BlackItalic.otf +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Bold.otf +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Medium.eot +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Medium.otf +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Medium.svg +40549 -0
- package/lib/fonts/SF/SF-Pro-Text-Medium.ttf +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Medium.woff +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Medium.woff2 +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Regular.otf +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Regular.ttf +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Semibold.otf +0 -0
- package/lib/fonts/SF/SF-Pro-Text-SemiboldItalic.otf +0 -0
- package/lib/style/variables.less +53 -27
- package/lib/tokens/DXPGlobal.d.ts +1 -1
- package/lib/tokens/DXPGlobal.js +1 -1
- package/lib/utils/tokenManager.d.ts +12 -0
- package/lib/utils/tokenManager.js +9 -3
- package/package.json +2 -2
- package/umd/dxp-ui.min.css +1 -1
- package/umd/dxp-ui.min.js +1 -1
- package/umd/static/SF-Pro-Text-Bold.89d66db4.otf +0 -0
- package/umd/static/SF-Pro-Text-Regular.e042d171.ttf +0 -0
- package/umd/static/SF-Pro-Text-Regular.f09e811b.otf +0 -0
- package/umd/static/SF-Pro-Text-Semibold.a5a4b4bc.otf +0 -0
- package/umd/static/SF-Pro-Text-SemiboldItalic.ed8f4a28.otf +0 -0
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type backImageRadio = 1 | 2 | 0.68;
|
|
3
|
+
export declare const BackImageEunm: Record<string, backImageRadio>;
|
|
3
4
|
export interface IImageProps {
|
|
4
5
|
src?: string;
|
|
5
6
|
radio?: backImageRadio;
|
|
6
7
|
imageSize?: number | string;
|
|
7
8
|
style?: React.CSSProperties;
|
|
9
|
+
className?: string;
|
|
8
10
|
}
|
|
9
11
|
declare const Image: (props: IImageProps) => React.JSX.Element;
|
|
10
12
|
export default Image;
|
|
@@ -55,21 +55,31 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
55
55
|
// src/components/Image/index.tsx
|
|
56
56
|
var Image_exports = {};
|
|
57
57
|
__export(Image_exports, {
|
|
58
|
+
BackImageEunm: () => BackImageEunm,
|
|
58
59
|
default: () => Image_default
|
|
59
60
|
});
|
|
60
61
|
module.exports = __toCommonJS(Image_exports);
|
|
61
62
|
var import_react = __toESM(require("react"));
|
|
63
|
+
var import_classnames = __toESM(require("classnames"));
|
|
64
|
+
var import_constants = require("../../constants");
|
|
65
|
+
var BackImageEunm = {
|
|
66
|
+
whRadio1: 1,
|
|
67
|
+
whRadio2: 2,
|
|
68
|
+
whRadio3: 0.68
|
|
69
|
+
};
|
|
62
70
|
var Image = (props) => {
|
|
63
71
|
const _a = props, {
|
|
64
72
|
src,
|
|
65
73
|
style,
|
|
66
74
|
imageSize,
|
|
67
|
-
radio =
|
|
75
|
+
radio = BackImageEunm.whRadio2,
|
|
76
|
+
className
|
|
68
77
|
} = _a, otherProps = __objRest(_a, [
|
|
69
78
|
"src",
|
|
70
79
|
"style",
|
|
71
80
|
"imageSize",
|
|
72
|
-
"radio"
|
|
81
|
+
"radio",
|
|
82
|
+
"className"
|
|
73
83
|
]);
|
|
74
84
|
const mergedStyle = imageSize ? __spreadValues({
|
|
75
85
|
width: imageSize,
|
|
@@ -77,6 +87,16 @@ var Image = (props) => {
|
|
|
77
87
|
aspectRatio: `${radio}`,
|
|
78
88
|
objectFit: "cover"
|
|
79
89
|
}, style) : __spreadValues({}, style);
|
|
80
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
90
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
91
|
+
"img",
|
|
92
|
+
__spreadValues({
|
|
93
|
+
className: (0, import_classnames.default)(
|
|
94
|
+
`${import_constants.cssClasses.PREFIX}-image}`,
|
|
95
|
+
className
|
|
96
|
+
),
|
|
97
|
+
src,
|
|
98
|
+
style: mergedStyle
|
|
99
|
+
}, otherProps)
|
|
100
|
+
);
|
|
81
101
|
};
|
|
82
102
|
var Image_default = Image;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare const designTokens: {
|
|
2
|
+
sizingListItemIconImage: any;
|
|
3
|
+
sizingListItemIconIcon: any;
|
|
4
|
+
sizingListItemIconIconStatus: any;
|
|
5
|
+
sizingListItemImageImage: any;
|
|
6
|
+
sizingListItemImageIcon: any;
|
|
7
|
+
sizingListItemImageIconLg: any;
|
|
8
|
+
sizingListItemImageThumbnail: any;
|
|
9
|
+
sizingListItemIcon: any;
|
|
10
|
+
sizingListItemIconLg: any;
|
|
11
|
+
spacingListItemIconStatusPaddingRight: any;
|
|
12
|
+
spacingListItemIconPaddingLeft: any;
|
|
13
|
+
spacingListItemImagePaddingRight: any;
|
|
14
|
+
spacingListItemIconImagePaddingVertical: any;
|
|
15
|
+
spacingListItemIconImagePaddingHorizontal: any;
|
|
16
|
+
spacingListItemIconIconPaddingVertical: any;
|
|
17
|
+
spacingListItemIconIconPaddingHorizontal: any;
|
|
18
|
+
spacingListItemImageIconPaddingRight: any;
|
|
19
|
+
spacingListItemImagePointsPaddingTop: any;
|
|
20
|
+
colorListItemIconBackground: any;
|
|
21
|
+
colorListItemIconSubtle: any;
|
|
22
|
+
colorListItemIcon: any;
|
|
23
|
+
borderRadiusListItem: any;
|
|
24
|
+
colorListItemBackground: any;
|
|
25
|
+
spacingListItemTextPaddingHorizontal: any;
|
|
26
|
+
colorListItemTextTitle: any;
|
|
27
|
+
colorListItemTextSubtitle: any;
|
|
28
|
+
colorListItemTextPoints: any;
|
|
29
|
+
};
|
|
30
|
+
export default designTokens;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/ListItem/designTokens.ts
|
|
30
|
+
var designTokens_exports = {};
|
|
31
|
+
__export(designTokens_exports, {
|
|
32
|
+
default: () => designTokens_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(designTokens_exports);
|
|
35
|
+
var import_tokenManager = __toESM(require("../../utils/tokenManager"));
|
|
36
|
+
var designTokens = {
|
|
37
|
+
sizingListItemIconImage: import_tokenManager.default.tokenKey("sizingListItemIconImage"),
|
|
38
|
+
sizingListItemIconIcon: import_tokenManager.default.tokenKey("sizingListItemIconIcon"),
|
|
39
|
+
sizingListItemIconIconStatus: import_tokenManager.default.tokenKey("sizingListItemIconIconStatus"),
|
|
40
|
+
sizingListItemImageImage: import_tokenManager.default.tokenKey("sizingListItemImageImage"),
|
|
41
|
+
sizingListItemImageIcon: import_tokenManager.default.tokenKey("sizingListItemImageIcon"),
|
|
42
|
+
sizingListItemImageIconLg: import_tokenManager.default.tokenKey("sizingListItemImageIconLg"),
|
|
43
|
+
sizingListItemImageThumbnail: import_tokenManager.default.tokenKey("sizingListItemImageThumbnail"),
|
|
44
|
+
sizingListItemIcon: import_tokenManager.default.tokenKey("sizingListItemIcon"),
|
|
45
|
+
sizingListItemIconLg: import_tokenManager.default.tokenKey("sizingListItemIconLg"),
|
|
46
|
+
spacingListItemIconStatusPaddingRight: import_tokenManager.default.tokenKey("spacingListItemIconStatusPaddingRight"),
|
|
47
|
+
spacingListItemIconPaddingLeft: import_tokenManager.default.tokenKey("spacingListItemIconPaddingLeft"),
|
|
48
|
+
spacingListItemImagePaddingRight: import_tokenManager.default.tokenKey("spacingListItemImagePaddingRight"),
|
|
49
|
+
spacingListItemIconImagePaddingVertical: import_tokenManager.default.tokenKey("spacingListItemIconImagePaddingVertical"),
|
|
50
|
+
spacingListItemIconImagePaddingHorizontal: import_tokenManager.default.tokenKey("spacingListItemIconImagePaddingHorizontal"),
|
|
51
|
+
spacingListItemIconIconPaddingVertical: import_tokenManager.default.tokenKey("spacingListItemIconIconPaddingVertical"),
|
|
52
|
+
spacingListItemIconIconPaddingHorizontal: import_tokenManager.default.tokenKey("spacingListItemIconIconPaddingHorizontal"),
|
|
53
|
+
spacingListItemImageIconPaddingRight: import_tokenManager.default.tokenKey("spacingListItemImageIconPaddingRight"),
|
|
54
|
+
spacingListItemImagePointsPaddingTop: import_tokenManager.default.tokenKey("spacingListItemImagePointsPaddingTop"),
|
|
55
|
+
colorListItemIconBackground: import_tokenManager.default.tokenKey("colorListItemIconBackground"),
|
|
56
|
+
colorListItemIconSubtle: import_tokenManager.default.tokenKey("colorListItemIconSubtle"),
|
|
57
|
+
colorListItemIcon: import_tokenManager.default.tokenKey("colorListItemIcon"),
|
|
58
|
+
borderRadiusListItem: import_tokenManager.default.tokenKey("borderRadiusListItem"),
|
|
59
|
+
colorListItemBackground: import_tokenManager.default.tokenKey("colorListItemBackground"),
|
|
60
|
+
spacingListItemTextPaddingHorizontal: import_tokenManager.default.tokenKey("spacingListItemTextPaddingHorizontal"),
|
|
61
|
+
colorListItemTextTitle: import_tokenManager.default.tokenKey("colorListItemTextTitle"),
|
|
62
|
+
colorListItemTextSubtitle: import_tokenManager.default.tokenKey("colorListItemTextSubtitle"),
|
|
63
|
+
colorListItemTextPoints: import_tokenManager.default.tokenKey("colorListItemTextPoints")
|
|
64
|
+
};
|
|
65
|
+
var designTokens_default = designTokens;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style/index.less';
|
|
3
|
+
export declare const ListItemTypes: {
|
|
4
|
+
readonly ListItemIcon: "ListItemIcon";
|
|
5
|
+
readonly ListItemImage: "ListItemImage";
|
|
6
|
+
readonly ListItemOther: "ListItemOther";
|
|
7
|
+
};
|
|
8
|
+
export declare const TAPPABLE_AREAS: {
|
|
9
|
+
readonly ALL: "ALL";
|
|
10
|
+
readonly EXPECT_IMAGE: "EXPECT_IMAGE";
|
|
11
|
+
};
|
|
12
|
+
export declare const ListItemRightTypes: {
|
|
13
|
+
readonly Toggle: "Toggle";
|
|
14
|
+
readonly Link: "Link";
|
|
15
|
+
readonly Status: "Status";
|
|
16
|
+
readonly Default: "Default";
|
|
17
|
+
};
|
|
18
|
+
export type ListItemType = typeof ListItemTypes[keyof typeof ListItemTypes];
|
|
19
|
+
export type ListItemRightType = typeof ListItemRightTypes[keyof typeof ListItemRightTypes];
|
|
20
|
+
export type TappableAreaType = typeof TAPPABLE_AREAS[keyof typeof TAPPABLE_AREAS];
|
|
21
|
+
export interface IIconConfig {
|
|
22
|
+
iconStyle: React.CSSProperties;
|
|
23
|
+
iconName: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ISubIconValueConfig {
|
|
26
|
+
value: string;
|
|
27
|
+
iconName: string;
|
|
28
|
+
}
|
|
29
|
+
export interface IListItemProps {
|
|
30
|
+
listType: ListItemType;
|
|
31
|
+
leftIcon?: IIconConfig;
|
|
32
|
+
leftImageSrc?: string;
|
|
33
|
+
title: string;
|
|
34
|
+
subTitle?: string;
|
|
35
|
+
listItemRightType?: ListItemRightType;
|
|
36
|
+
showToggle?: boolean;
|
|
37
|
+
toggleChecked?: boolean;
|
|
38
|
+
onToggleChange?: (checked: boolean, event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
39
|
+
showLink?: boolean;
|
|
40
|
+
LinkName?: string;
|
|
41
|
+
onLinkClick?: () => void;
|
|
42
|
+
showStatus?: boolean;
|
|
43
|
+
statusIconName?: string;
|
|
44
|
+
statusIconColor?: string;
|
|
45
|
+
subTitleUp?: boolean;
|
|
46
|
+
tagName?: string;
|
|
47
|
+
showTag?: boolean;
|
|
48
|
+
subIconObj?: ISubIconValueConfig;
|
|
49
|
+
leftThumbnail?: string;
|
|
50
|
+
showRightBtn?: boolean;
|
|
51
|
+
onRightBtnClick?: () => void;
|
|
52
|
+
rightBtnTxt?: string;
|
|
53
|
+
showRightIcon?: boolean;
|
|
54
|
+
rightIconName?: string;
|
|
55
|
+
onRightIconClick?: () => void;
|
|
56
|
+
tappableArea?: TappableAreaType;
|
|
57
|
+
tappableAreaClick?: () => void;
|
|
58
|
+
}
|
|
59
|
+
declare const ListItem: React.FC<IListItemProps>;
|
|
60
|
+
export default ListItem;
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __objRest = (source, exclude) => {
|
|
25
|
+
var target = {};
|
|
26
|
+
for (var prop in source)
|
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
var __export = (target, all) => {
|
|
37
|
+
for (var name in all)
|
|
38
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
39
|
+
};
|
|
40
|
+
var __copyProps = (to, from, except, desc) => {
|
|
41
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
42
|
+
for (let key of __getOwnPropNames(from))
|
|
43
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
44
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
45
|
+
}
|
|
46
|
+
return to;
|
|
47
|
+
};
|
|
48
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
49
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
50
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
51
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
52
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
53
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
54
|
+
mod
|
|
55
|
+
));
|
|
56
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
57
|
+
|
|
58
|
+
// src/components/ListItem/index.tsx
|
|
59
|
+
var ListItem_exports = {};
|
|
60
|
+
__export(ListItem_exports, {
|
|
61
|
+
ListItemRightTypes: () => ListItemRightTypes,
|
|
62
|
+
ListItemTypes: () => ListItemTypes,
|
|
63
|
+
TAPPABLE_AREAS: () => TAPPABLE_AREAS,
|
|
64
|
+
default: () => ListItem_default
|
|
65
|
+
});
|
|
66
|
+
module.exports = __toCommonJS(ListItem_exports);
|
|
67
|
+
var import_react = __toESM(require("react"));
|
|
68
|
+
var import_designTokens = __toESM(require("./designTokens"));
|
|
69
|
+
var import_cssinjs = require("@ant-design/cssinjs");
|
|
70
|
+
var import_lodash = require("lodash");
|
|
71
|
+
var import_theme = require("../../utils/theme");
|
|
72
|
+
var import__ = require("../index");
|
|
73
|
+
var import_constants = require("../../constants");
|
|
74
|
+
var import_style = require("./style/index.less");
|
|
75
|
+
var ListItemTypes = {
|
|
76
|
+
ListItemIcon: "ListItemIcon",
|
|
77
|
+
ListItemImage: "ListItemImage",
|
|
78
|
+
ListItemOther: "ListItemOther"
|
|
79
|
+
};
|
|
80
|
+
var TAPPABLE_AREAS = {
|
|
81
|
+
ALL: "ALL",
|
|
82
|
+
// 点击全部区域
|
|
83
|
+
EXPECT_IMAGE: "EXPECT_IMAGE"
|
|
84
|
+
// 除了坐车的图片区域
|
|
85
|
+
};
|
|
86
|
+
var ListItemRightTypes = {
|
|
87
|
+
Toggle: "Toggle",
|
|
88
|
+
Link: "Link",
|
|
89
|
+
Status: "Status",
|
|
90
|
+
Default: "Default"
|
|
91
|
+
};
|
|
92
|
+
var ListItem = (_a) => {
|
|
93
|
+
var _b = _a, {
|
|
94
|
+
listType,
|
|
95
|
+
leftIcon,
|
|
96
|
+
leftImageSrc,
|
|
97
|
+
title,
|
|
98
|
+
subTitle,
|
|
99
|
+
onToggleChange,
|
|
100
|
+
toggleChecked,
|
|
101
|
+
showToggle,
|
|
102
|
+
showLink,
|
|
103
|
+
LinkName,
|
|
104
|
+
onLinkClick,
|
|
105
|
+
showStatus,
|
|
106
|
+
statusIconName = "icon-Attention",
|
|
107
|
+
statusIconColor = "#BC1430",
|
|
108
|
+
subTitleUp = false,
|
|
109
|
+
tagName,
|
|
110
|
+
showTag = false,
|
|
111
|
+
subIconObj,
|
|
112
|
+
leftThumbnail,
|
|
113
|
+
showRightBtn = false,
|
|
114
|
+
onRightBtnClick,
|
|
115
|
+
rightBtnTxt,
|
|
116
|
+
showRightIcon = false,
|
|
117
|
+
rightIconName,
|
|
118
|
+
onRightIconClick,
|
|
119
|
+
tappableArea,
|
|
120
|
+
tappableAreaClick
|
|
121
|
+
} = _b, restProps = __objRest(_b, [
|
|
122
|
+
"listType",
|
|
123
|
+
"leftIcon",
|
|
124
|
+
"leftImageSrc",
|
|
125
|
+
"title",
|
|
126
|
+
"subTitle",
|
|
127
|
+
"onToggleChange",
|
|
128
|
+
"toggleChecked",
|
|
129
|
+
"showToggle",
|
|
130
|
+
"showLink",
|
|
131
|
+
"LinkName",
|
|
132
|
+
"onLinkClick",
|
|
133
|
+
"showStatus",
|
|
134
|
+
"statusIconName",
|
|
135
|
+
"statusIconColor",
|
|
136
|
+
"subTitleUp",
|
|
137
|
+
"tagName",
|
|
138
|
+
"showTag",
|
|
139
|
+
"subIconObj",
|
|
140
|
+
"leftThumbnail",
|
|
141
|
+
"showRightBtn",
|
|
142
|
+
"onRightBtnClick",
|
|
143
|
+
"rightBtnTxt",
|
|
144
|
+
"showRightIcon",
|
|
145
|
+
"rightIconName",
|
|
146
|
+
"onRightIconClick",
|
|
147
|
+
"tappableArea",
|
|
148
|
+
"tappableAreaClick"
|
|
149
|
+
]);
|
|
150
|
+
const {
|
|
151
|
+
sizingListItemImageImage,
|
|
152
|
+
borderRadiusListItem,
|
|
153
|
+
colorListItemBackground,
|
|
154
|
+
// spacingListItemIconImagePaddingHorizontal,
|
|
155
|
+
// spacingListItemIconImagePaddingVertical,
|
|
156
|
+
colorListItemIconBackground,
|
|
157
|
+
// sizingListItemIconImage,
|
|
158
|
+
spacingListItemTextPaddingHorizontal,
|
|
159
|
+
sizingListItemIconIcon,
|
|
160
|
+
colorListItemTextTitle,
|
|
161
|
+
colorListItemTextSubtitle,
|
|
162
|
+
colorListItemIconSubtle,
|
|
163
|
+
// sizingListItemImageIconLg,
|
|
164
|
+
sizingListItemImageIcon,
|
|
165
|
+
spacingListItemImageIconPaddingRight,
|
|
166
|
+
colorListItemTextPoints,
|
|
167
|
+
sizingListItemImageThumbnail,
|
|
168
|
+
sizingListItemIconLg
|
|
169
|
+
} = import_designTokens.default;
|
|
170
|
+
const useCustomButtonStyle = () => {
|
|
171
|
+
const hashId = (0, import_cssinjs.useStyleRegister)({
|
|
172
|
+
theme: import_theme.theme,
|
|
173
|
+
token: {},
|
|
174
|
+
path: [`${import_constants.cssClasses.PREFIX}-list-item `]
|
|
175
|
+
}, () => `
|
|
176
|
+
.${import_constants.cssClasses.PREFIX}-list-item {
|
|
177
|
+
box-shadow: 0px 3px 8px 0px rgba(0, 0, 0, 0.12);
|
|
178
|
+
border-radius: ${borderRadiusListItem || 8}px;
|
|
179
|
+
background-color:${colorListItemBackground || "#fff"};
|
|
180
|
+
&.noShadow{
|
|
181
|
+
box-shadow:none !important;
|
|
182
|
+
}
|
|
183
|
+
.${import_constants.cssClasses.PREFIX}-icon-container {
|
|
184
|
+
background:${colorListItemIconBackground || "#F5F5F8"};
|
|
185
|
+
margin-right:${spacingListItemTextPaddingHorizontal}px;
|
|
186
|
+
}
|
|
187
|
+
.${import_constants.cssClasses.PREFIX}-image-container {
|
|
188
|
+
margin-right:${spacingListItemTextPaddingHorizontal}px;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
.${import_constants.cssClasses.PREFIX}-item-right {
|
|
192
|
+
padding-right:${spacingListItemTextPaddingHorizontal}px;
|
|
193
|
+
}
|
|
194
|
+
.${import_constants.cssClasses.PREFIX}-status-warp {
|
|
195
|
+
padding-left: ${spacingListItemTextPaddingHorizontal}px;
|
|
196
|
+
}
|
|
197
|
+
.${import_constants.cssClasses.PREFIX}-item-title {
|
|
198
|
+
color:${colorListItemTextTitle};
|
|
199
|
+
}
|
|
200
|
+
.${import_constants.cssClasses.PREFIX}-item-subTitle {
|
|
201
|
+
color:${colorListItemTextSubtitle};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.${import_constants.cssClasses.PREFIX}-sub-icon-title {
|
|
205
|
+
color:${colorListItemTextPoints};
|
|
206
|
+
margin-left:${spacingListItemImageIconPaddingRight}px;
|
|
207
|
+
}
|
|
208
|
+
.${import_constants.cssClasses.PREFIX}-right-btn {
|
|
209
|
+
min-width:60px !important;
|
|
210
|
+
}
|
|
211
|
+
`);
|
|
212
|
+
return hashId;
|
|
213
|
+
};
|
|
214
|
+
useCustomButtonStyle();
|
|
215
|
+
const onAllClick = () => {
|
|
216
|
+
if (tappableArea === TAPPABLE_AREAS.ALL && tappableAreaClick) {
|
|
217
|
+
tappableAreaClick();
|
|
218
|
+
}
|
|
219
|
+
;
|
|
220
|
+
};
|
|
221
|
+
const onExceptImgClick = (e) => {
|
|
222
|
+
if (tappableArea === TAPPABLE_AREAS.EXPECT_IMAGE && tappableAreaClick) {
|
|
223
|
+
e == null ? void 0 : e.stopPropagation();
|
|
224
|
+
tappableAreaClick();
|
|
225
|
+
}
|
|
226
|
+
;
|
|
227
|
+
};
|
|
228
|
+
const onTextLinkClick = (e) => {
|
|
229
|
+
e == null ? void 0 : e.stopPropagation();
|
|
230
|
+
if (onLinkClick) {
|
|
231
|
+
onLinkClick();
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
const onSwicthChange = (checked, event) => {
|
|
235
|
+
event == null ? void 0 : event.stopPropagation();
|
|
236
|
+
if (onToggleChange) {
|
|
237
|
+
onToggleChange(checked, event);
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
241
|
+
"div",
|
|
242
|
+
__spreadProps(__spreadValues({
|
|
243
|
+
className: `
|
|
244
|
+
${import_constants.cssClasses.PREFIX}-list-item
|
|
245
|
+
${listType === ListItemTypes.ListItemOther ? "noShadow" : ""}
|
|
246
|
+
`
|
|
247
|
+
}, restProps), {
|
|
248
|
+
onClick: onAllClick
|
|
249
|
+
}),
|
|
250
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
251
|
+
"div",
|
|
252
|
+
{
|
|
253
|
+
className: `
|
|
254
|
+
${import_constants.cssClasses.PREFIX}-item-left
|
|
255
|
+
`
|
|
256
|
+
},
|
|
257
|
+
listType === ListItemTypes.ListItemIcon && !(0, import_lodash.isEmpty)(leftIcon) && /* @__PURE__ */ import_react.default.createElement(
|
|
258
|
+
"div",
|
|
259
|
+
{
|
|
260
|
+
className: `${import_constants.cssClasses.PREFIX}-icon-container`
|
|
261
|
+
},
|
|
262
|
+
/* @__PURE__ */ import_react.default.createElement(import__.Icon, { name: leftIcon ? leftIcon.iconName : "", size: sizingListItemIconIcon, style: leftIcon ? leftIcon.iconStyle : {} })
|
|
263
|
+
),
|
|
264
|
+
listType === ListItemTypes.ListItemImage && leftImageSrc && /* @__PURE__ */ import_react.default.createElement(
|
|
265
|
+
"div",
|
|
266
|
+
{
|
|
267
|
+
className: `${import_constants.cssClasses.PREFIX}-image-container`
|
|
268
|
+
},
|
|
269
|
+
/* @__PURE__ */ import_react.default.createElement(import__.Image, { radio: 1, src: leftImageSrc, imageSize: sizingListItemImageImage || 104 }),
|
|
270
|
+
showTag && /* @__PURE__ */ import_react.default.createElement(
|
|
271
|
+
import__.Tag,
|
|
272
|
+
{
|
|
273
|
+
types: "red",
|
|
274
|
+
style: {
|
|
275
|
+
position: "absolute",
|
|
276
|
+
bottom: 0,
|
|
277
|
+
left: 0,
|
|
278
|
+
right: 0,
|
|
279
|
+
justifyContent: "center"
|
|
280
|
+
},
|
|
281
|
+
block: true
|
|
282
|
+
},
|
|
283
|
+
tagName
|
|
284
|
+
)
|
|
285
|
+
),
|
|
286
|
+
listType === ListItemTypes.ListItemOther && leftThumbnail && /* @__PURE__ */ import_react.default.createElement(
|
|
287
|
+
"div",
|
|
288
|
+
{
|
|
289
|
+
className: `${import_constants.cssClasses.PREFIX}-image-container`
|
|
290
|
+
},
|
|
291
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
292
|
+
import__.Image,
|
|
293
|
+
{
|
|
294
|
+
radio: import__.BackImageEunm.whRadio1,
|
|
295
|
+
src: leftThumbnail,
|
|
296
|
+
imageSize: sizingListItemImageThumbnail || 56,
|
|
297
|
+
style: { borderRadius: `${borderRadiusListItem}px`, margin: "10px 0" }
|
|
298
|
+
}
|
|
299
|
+
)
|
|
300
|
+
)
|
|
301
|
+
),
|
|
302
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
303
|
+
"div",
|
|
304
|
+
{
|
|
305
|
+
className: `
|
|
306
|
+
${import_constants.cssClasses.PREFIX}-item-right
|
|
307
|
+
`,
|
|
308
|
+
onClick: onExceptImgClick
|
|
309
|
+
},
|
|
310
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: `${import_constants.cssClasses.PREFIX}-title-sub-warp` }, subTitleUp && /* @__PURE__ */ import_react.default.createElement(import__.Text, { size: "ContentC12Regular", className: `${import_constants.cssClasses.PREFIX}-item-subTitle` }, subTitle), /* @__PURE__ */ import_react.default.createElement(
|
|
311
|
+
import__.Text,
|
|
312
|
+
{
|
|
313
|
+
size: "ContentC14Bold",
|
|
314
|
+
className: `${import_constants.cssClasses.PREFIX}-item-title
|
|
315
|
+
${subTitle ? "line1" : "line2"}
|
|
316
|
+
}`
|
|
317
|
+
},
|
|
318
|
+
title
|
|
319
|
+
), !subTitleUp && /* @__PURE__ */ import_react.default.createElement(import__.Text, { size: "ContentC12Regular", className: `${import_constants.cssClasses.PREFIX}-item-subTitle` }, subTitle), !(0, import_lodash.isEmpty)(subIconObj) && /* @__PURE__ */ import_react.default.createElement("div", { className: `${import_constants.cssClasses.PREFIX}-sub-icon` }, /* @__PURE__ */ import_react.default.createElement(import__.Icon, { name: subIconObj.iconName, color: colorListItemIconSubtle, size: sizingListItemImageIcon || 20 }), /* @__PURE__ */ import_react.default.createElement(import__.Text, { size: "ContentC12Regular", className: `${import_constants.cssClasses.PREFIX}-sub-icon-title` }, subIconObj.value))),
|
|
320
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: `${import_constants.cssClasses.PREFIX}-status-warp` }, showToggle && /* @__PURE__ */ import_react.default.createElement(import__.Toggle, { size: "small", checked: toggleChecked, onChange: onSwicthChange }), showLink && /* @__PURE__ */ import_react.default.createElement(import__.TextLink, { className: `${import_constants.cssClasses.PREFIX}-right-link`, type: import__.TextLinkEnum.default, text: LinkName, onClick: onTextLinkClick }), showStatus && /* @__PURE__ */ import_react.default.createElement(import__.Icon, { name: statusIconName || "", size: sizingListItemIconIcon, color: statusIconColor }), showRightBtn && /* @__PURE__ */ import_react.default.createElement(
|
|
321
|
+
import__.Button,
|
|
322
|
+
{
|
|
323
|
+
className: `${import_constants.cssClasses.PREFIX}-right-btn`,
|
|
324
|
+
onClick: (e) => {
|
|
325
|
+
e.stopPropagation();
|
|
326
|
+
if (onRightBtnClick) {
|
|
327
|
+
onRightBtnClick();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
rightBtnTxt
|
|
332
|
+
), showRightIcon && /* @__PURE__ */ import_react.default.createElement(
|
|
333
|
+
import__.Icon,
|
|
334
|
+
{
|
|
335
|
+
name: rightIconName || "",
|
|
336
|
+
size: sizingListItemIconLg,
|
|
337
|
+
onClick: (e) => {
|
|
338
|
+
e.stopPropagation();
|
|
339
|
+
if (onRightIconClick) {
|
|
340
|
+
onRightIconClick();
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
))
|
|
345
|
+
)
|
|
346
|
+
);
|
|
347
|
+
};
|
|
348
|
+
var ListItem_default = ListItem;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
@import './variables.less';
|
|
2
|
+
|
|
3
|
+
.@{prefix}-list-item {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
align-items: center;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
|
|
9
|
+
.@{prefix}-item-left {
|
|
10
|
+
|
|
11
|
+
.@{prefix}-icon-container {
|
|
12
|
+
width: 80px;
|
|
13
|
+
height: 80px;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
flex-shrink: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.@{prefix}-image-container {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
flex-shrink: 0;
|
|
25
|
+
position: relative;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.@{prefix}-item-right {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex: 1;
|
|
33
|
+
min-width: 0;
|
|
34
|
+
flex-direction: row;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
|
|
38
|
+
.@{prefix}-title-sub-warp {
|
|
39
|
+
flex: 1;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
|
|
42
|
+
.@{prefix}-item-title {
|
|
43
|
+
display: block;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
text-overflow: ellipsis;
|
|
46
|
+
-webkit-box-orient: vertical;
|
|
47
|
+
|
|
48
|
+
&.line1 {
|
|
49
|
+
display: -webkit-box;
|
|
50
|
+
-webkit-line-clamp: 1;
|
|
51
|
+
-webkit-box-orient: vertical;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&.line2 {
|
|
56
|
+
display: -webkit-box;
|
|
57
|
+
-webkit-line-clamp: 2;
|
|
58
|
+
-webkit-box-orient: vertical;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.@{prefix}-item-subTitle {
|
|
64
|
+
display: block;
|
|
65
|
+
white-space: nowrap;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
text-overflow: ellipsis;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.@{prefix}-sub-icon {
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../../style/variables.less';
|