@pisell/materials 6.2.26 → 6.2.28
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +144 -160
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +25 -44
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +30 -49
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/es/components/iconfont/index.d.ts +8 -0
- package/es/components/pisellAdjustPrice/index.d.ts +4 -0
- package/es/components/pisellAdjustPrice/status.d.ts +32 -0
- package/es/components/pisellAdjustPrice/type.d.ts +20 -0
- package/es/components/pisellToast/index.d.ts +16 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +21 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +1 -1
- package/es/components/productCard/cartSkuCard/components/discountReason/index.d.ts +2 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/packages/index.d.ts +10 -0
- package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +20 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/sales/index.d.ts +11 -0
- package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +43 -0
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +282 -0
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.less +35 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
- package/es/components/productCard/cartSkuCard/index.d.ts +9 -0
- package/es/components/productCard/cartSkuCard/index.js +28 -9
- package/es/components/productCard/cartSkuCard/locales.d.ts +96 -0
- package/es/components/productCard/components/Header/index.d.ts +3 -0
- package/es/components/productCard/components/Sales/index.d.ts +3 -0
- package/es/components/productCard/index.d.ts +7 -0
- package/es/components/productCard/locales.d.ts +84 -0
- package/es/components/productCard/status.d.ts +32 -0
- package/es/components/productCard/types.d.ts +84 -0
- package/es/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/virtual-keyboard/Amount/index.d.ts +5 -0
- package/es/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
- package/es/components/virtual-keyboard/Amount/types.d.ts +44 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +21 -0
- package/es/components/virtual-keyboard/Keyboard/index.d.ts +21 -0
- package/es/components/virtual-keyboard/Number/index.d.ts +5 -0
- package/es/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
- package/es/components/virtual-keyboard/Number/types.d.ts +25 -0
- package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +13 -0
- package/es/components/virtual-keyboard/index.d.ts +25 -0
- package/es/utils/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/lib/components/iconfont/index.d.ts +8 -0
- package/lib/components/pisellAdjustPrice/index.d.ts +4 -0
- package/lib/components/pisellAdjustPrice/status.d.ts +32 -0
- package/lib/components/pisellAdjustPrice/type.d.ts +20 -0
- package/lib/components/pisellToast/index.d.ts +16 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +21 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +1 -1
- package/lib/components/productCard/cartSkuCard/components/discountReason/index.d.ts +2 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/packages/index.d.ts +10 -0
- package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +20 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/sales/index.d.ts +11 -0
- package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +43 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +330 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.less +35 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
- package/lib/components/productCard/cartSkuCard/index.d.ts +9 -0
- package/lib/components/productCard/cartSkuCard/index.js +29 -13
- package/lib/components/productCard/cartSkuCard/locales.d.ts +96 -0
- package/lib/components/productCard/components/Header/index.d.ts +3 -0
- package/lib/components/productCard/components/Sales/index.d.ts +3 -0
- package/lib/components/productCard/index.d.ts +7 -0
- package/lib/components/productCard/locales.d.ts +84 -0
- package/lib/components/productCard/status.d.ts +32 -0
- package/lib/components/productCard/types.d.ts +84 -0
- package/lib/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/virtual-keyboard/Amount/index.d.ts +5 -0
- package/lib/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
- package/lib/components/virtual-keyboard/Amount/types.d.ts +44 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +21 -0
- package/lib/components/virtual-keyboard/Keyboard/index.d.ts +21 -0
- package/lib/components/virtual-keyboard/Number/index.d.ts +5 -0
- package/lib/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
- package/lib/components/virtual-keyboard/Number/types.d.ts +25 -0
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +13 -0
- package/lib/components/virtual-keyboard/index.d.ts +25 -0
- package/lib/utils/index.d.ts +1 -1
- package/package.json +4 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const useDataSourceKey: () => {
|
|
2
|
-
dataSourceKey: string |
|
|
3
|
-
dataSourceKeyRef: import("react").MutableRefObject<string |
|
|
2
|
+
dataSourceKey: string | undefined;
|
|
3
|
+
dataSourceKeyRef: import("react").MutableRefObject<string | undefined>;
|
|
4
4
|
};
|
|
5
5
|
export default useDataSourceKey;
|
|
@@ -17,7 +17,7 @@ interface UseTablePropsProps {
|
|
|
17
17
|
* @returns
|
|
18
18
|
*/
|
|
19
19
|
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
20
|
-
title:
|
|
20
|
+
title: number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
21
21
|
pagination: {
|
|
22
22
|
total: number;
|
|
23
23
|
current: number;
|
|
@@ -26,7 +26,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
26
26
|
showSizeChanger: boolean;
|
|
27
27
|
};
|
|
28
28
|
columns: import("./useColumns").Column[];
|
|
29
|
-
subTitle:
|
|
29
|
+
subTitle: number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
30
30
|
buttons: any[] | null;
|
|
31
31
|
filter: JSX.Element | null;
|
|
32
32
|
onRow: (record: any) => any;
|
|
@@ -70,7 +70,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
70
70
|
useCustomAction: boolean;
|
|
71
71
|
actionType: string;
|
|
72
72
|
openMode: "modal" | "drawer";
|
|
73
|
-
openContentSize: "
|
|
73
|
+
openContentSize: "small" | "middle" | "large";
|
|
74
74
|
openTitle: string;
|
|
75
75
|
key: string;
|
|
76
76
|
} | undefined;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
declare const Subdomain: React.FC<import("antd").InputProps & {
|
|
3
3
|
onChange: (value: string) => void;
|
|
4
4
|
onBlur?: ((e: React.FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
5
|
-
rootDomain: "custom" | "
|
|
5
|
+
rootDomain: "custom" | "saas" | "xzero";
|
|
6
6
|
customDomain?: string | undefined;
|
|
7
7
|
value?: string | undefined;
|
|
8
8
|
tenantId: string;
|
|
@@ -15,4 +15,4 @@ export declare const getFileMetadataParams: (file: RcFile & {
|
|
|
15
15
|
metadata?: MediaMetadata;
|
|
16
16
|
}) => Record<string, any>;
|
|
17
17
|
export declare const isValueEqual: (value: any, fileListValue: any) => boolean;
|
|
18
|
-
export declare const getBaseTime: (size: number) =>
|
|
18
|
+
export declare const getBaseTime: (size: number) => 2000 | 1000 | 4000 | 8000;
|
|
@@ -19,7 +19,7 @@ declare const formFieldMap: {
|
|
|
19
19
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
20
20
|
onChange: (value: string) => void;
|
|
21
21
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
22
|
-
rootDomain: "custom" | "
|
|
22
|
+
rootDomain: "custom" | "saas" | "xzero";
|
|
23
23
|
customDomain?: string | undefined;
|
|
24
24
|
value?: string | undefined;
|
|
25
25
|
tenantId: string;
|
|
@@ -59,11 +59,13 @@ declare const formFieldMap: {
|
|
|
59
59
|
FormItemTranslation: import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
60
60
|
FormItemIconSelect: import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
61
61
|
};
|
|
62
|
-
declare const getFieldComponent: (fieldComponent: string) => import("react").FC<import("
|
|
62
|
+
declare const getFieldComponent: (fieldComponent: string) => import("react").FC<any> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | (import("react").FC<{}> & {
|
|
63
63
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
64
64
|
} & {
|
|
65
65
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
66
|
-
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> |
|
|
66
|
+
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
|
|
67
|
+
onChange: (value: string) => void;
|
|
68
|
+
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
|
|
67
69
|
JSON: import("react").FC<any>;
|
|
68
70
|
Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
69
71
|
TextArea: import("react").FC<import("antd/es/input").TextAreaProps & import("react").RefAttributes<import("antd/es/input/TextArea").TextAreaRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
@@ -76,14 +78,14 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
76
78
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
77
79
|
onChange: (value: string) => void;
|
|
78
80
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
79
|
-
rootDomain: "custom" | "
|
|
81
|
+
rootDomain: "custom" | "saas" | "xzero";
|
|
80
82
|
customDomain?: string | undefined;
|
|
81
83
|
value?: string | undefined;
|
|
82
84
|
tenantId: string;
|
|
83
85
|
name?: string | undefined;
|
|
84
86
|
fieldKey?: string | undefined;
|
|
85
87
|
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
86
|
-
}) | (import("react").FC<{}> & {
|
|
88
|
+
}) | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | (import("react").FC<{}> & {
|
|
87
89
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
88
90
|
} & {
|
|
89
91
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
@@ -95,7 +97,5 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
95
97
|
extraParams?: Record<string, any> | undefined;
|
|
96
98
|
} & {
|
|
97
99
|
dataSource?: any;
|
|
98
|
-
}) => JSX.Element) | import("react").FC<
|
|
99
|
-
onChange: (value: string) => void;
|
|
100
|
-
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
100
|
+
}) => JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
101
101
|
export { getFieldComponent, formFieldMap };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IconComponentProps } from '@ant-design/icons/es/components/Icon';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface IconFontProps extends IconComponentProps {
|
|
4
|
+
type: string;
|
|
5
|
+
onClick?: React.MouseEventHandler<HTMLSpanElement>;
|
|
6
|
+
}
|
|
7
|
+
declare const IconFont: React.FC<IconFontProps>;
|
|
8
|
+
export default IconFont;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const defaultConfig: {
|
|
2
|
+
dark: {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
containerBackgroundColor: string;
|
|
5
|
+
buttonBackgroundColor: string;
|
|
6
|
+
textColor: string;
|
|
7
|
+
resetButtonBackgroundColor: string;
|
|
8
|
+
resetButtonTextColor: string;
|
|
9
|
+
isDoneButtonFollowTheme: boolean;
|
|
10
|
+
doneButtonBackgroundColor: string;
|
|
11
|
+
doneButtonTextColor: string;
|
|
12
|
+
isShowMainText: boolean;
|
|
13
|
+
mainTextColor: string;
|
|
14
|
+
isShowSubText: boolean;
|
|
15
|
+
subTextColor: string;
|
|
16
|
+
};
|
|
17
|
+
light: {
|
|
18
|
+
backgroundColor: string;
|
|
19
|
+
containerBackgroundColor: string;
|
|
20
|
+
buttonBackgroundColor: string;
|
|
21
|
+
textColor: string;
|
|
22
|
+
resetButtonBackgroundColor: string;
|
|
23
|
+
resetButtonTextColor: string;
|
|
24
|
+
isDoneButtonFollowTheme: boolean;
|
|
25
|
+
doneButtonBackgroundColor: string;
|
|
26
|
+
doneButtonTextColor: string;
|
|
27
|
+
isShowMainText: boolean;
|
|
28
|
+
mainTextColor: string;
|
|
29
|
+
isShowSubText: boolean;
|
|
30
|
+
subTextColor: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface PisellAdjustPriceProps {
|
|
2
|
+
value?: number;
|
|
3
|
+
originValue: number;
|
|
4
|
+
defaultValue?: number;
|
|
5
|
+
onChange?: (val: number) => void;
|
|
6
|
+
selectType?: 'light' | 'dark';
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
containerBackgroundColor?: string;
|
|
9
|
+
buttonBackgroundColor?: string;
|
|
10
|
+
textColor?: string;
|
|
11
|
+
resetButtonBackgroundColor?: string;
|
|
12
|
+
resetButtonTextColor?: string;
|
|
13
|
+
isDoneButtonFollowTheme?: boolean;
|
|
14
|
+
doneButtonBackgroundColor?: string;
|
|
15
|
+
doneButtonTextColor?: string;
|
|
16
|
+
isShowMainText?: boolean;
|
|
17
|
+
mainTextColor?: string;
|
|
18
|
+
isShowSubText?: boolean;
|
|
19
|
+
subTextColor?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface PisellToastProps {
|
|
4
|
+
/** 提示内容 */
|
|
5
|
+
content: React.ReactNode;
|
|
6
|
+
/** 自动关闭的延时,单位秒。设为 0 时不自动关闭 */
|
|
7
|
+
duration?: number;
|
|
8
|
+
/** 是否展示action */
|
|
9
|
+
showAction?: boolean;
|
|
10
|
+
/** action文案 */
|
|
11
|
+
actionText?: string;
|
|
12
|
+
/** 关闭时触发的回调函数 */
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
}
|
|
15
|
+
declare const PisellToast: (props: PisellToastProps) => void;
|
|
16
|
+
export default PisellToast;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface IProps {
|
|
4
|
+
isShowImage?: boolean;
|
|
5
|
+
dataSource: {
|
|
6
|
+
image?: string;
|
|
7
|
+
bundle?: any[];
|
|
8
|
+
options?: any[];
|
|
9
|
+
product_option_string?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
symbol?: string;
|
|
12
|
+
price?: string | number;
|
|
13
|
+
total?: number;
|
|
14
|
+
origin_total?: number;
|
|
15
|
+
num?: number;
|
|
16
|
+
};
|
|
17
|
+
style?: React.CSSProperties;
|
|
18
|
+
isMainProduct?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const BasicInfo: (props: IProps) => JSX.Element;
|
|
21
|
+
export default BasicInfo;
|
|
@@ -28,7 +28,7 @@ var BasicInfo = function BasicInfo(props) {
|
|
|
28
28
|
className: classNames("num-tag", {
|
|
29
29
|
'is-main': isMainProduct
|
|
30
30
|
})
|
|
31
|
-
}, num <
|
|
31
|
+
}, num < 100 ? num : '99+');
|
|
32
32
|
return null;
|
|
33
33
|
};
|
|
34
34
|
var hasSpecs = (bundle === null || bundle === void 0 ? void 0 : bundle.length) || (options === null || options === void 0 ? void 0 : options.length) || product_option_string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @title: 金额是否是负
|
|
3
|
+
* @description:
|
|
4
|
+
* @param {string} type
|
|
5
|
+
* @return {*}
|
|
6
|
+
* @Author: WangHan
|
|
7
|
+
* @Date: 2024-11-22 10:01
|
|
8
|
+
*/
|
|
9
|
+
export declare const minusSign: (item: any, type?: string) => "" | "-";
|
|
10
|
+
/**
|
|
11
|
+
* @title: 金额格式化
|
|
12
|
+
* @description:
|
|
13
|
+
* @param {number} price
|
|
14
|
+
* @param {string} amountSymbol
|
|
15
|
+
* @param {number} digit
|
|
16
|
+
* @return {*}
|
|
17
|
+
* @Author: WangHan
|
|
18
|
+
* @Date: 2024-11-22 10:58
|
|
19
|
+
*/
|
|
20
|
+
export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
interface IProps {
|
|
3
|
+
hideDivider?: boolean;
|
|
4
|
+
dataSource: {
|
|
5
|
+
symbol?: string;
|
|
6
|
+
relation_products?: any[];
|
|
7
|
+
bundle?: any[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
declare const Sales: ({ hideDivider, dataSource }: IProps) => JSX.Element | null;
|
|
11
|
+
export default Sales;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare type NativeProps<S extends string = never> = {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties & Partial<Record<S, string>>;
|
|
6
|
+
};
|
|
7
|
+
declare type PropagationEvent = 'click';
|
|
8
|
+
import './index.less';
|
|
9
|
+
declare type SideType = 'left' | 'right';
|
|
10
|
+
export declare type SwipeActionRef = {
|
|
11
|
+
close: () => void;
|
|
12
|
+
show: (side?: SideType) => void;
|
|
13
|
+
};
|
|
14
|
+
declare type ActionColor = 'light' | 'weak' | 'primary' | 'success' | 'warning' | 'danger';
|
|
15
|
+
export declare type Action = {
|
|
16
|
+
key: string | number;
|
|
17
|
+
text: ReactNode;
|
|
18
|
+
color?: ActionColor | string;
|
|
19
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare type SwipeActionProps = {
|
|
22
|
+
rightActions?: Action[];
|
|
23
|
+
leftActions?: Action[];
|
|
24
|
+
onAction?: (action: Action, e: React.MouseEvent) => void;
|
|
25
|
+
closeOnTouchOutside?: boolean;
|
|
26
|
+
closeOnAction?: boolean;
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
stopPropagation?: PropagationEvent[];
|
|
29
|
+
onActionsReveal?: (side: SideType) => void;
|
|
30
|
+
onClose?: () => void;
|
|
31
|
+
} & NativeProps<'--background'>;
|
|
32
|
+
export declare const SwipeAction: React.ForwardRefExoticComponent<{
|
|
33
|
+
rightActions?: Action[] | undefined;
|
|
34
|
+
leftActions?: Action[] | undefined;
|
|
35
|
+
onAction?: ((action: Action, e: React.MouseEvent) => void) | undefined;
|
|
36
|
+
closeOnTouchOutside?: boolean | undefined;
|
|
37
|
+
closeOnAction?: boolean | undefined;
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
stopPropagation?: "click"[] | undefined;
|
|
40
|
+
onActionsReveal?: ((side: SideType) => void) | undefined;
|
|
41
|
+
onClose?: (() => void) | undefined;
|
|
42
|
+
} & NativeProps<"--background"> & React.RefAttributes<SwipeActionRef>>;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
|
+
import { animated, useSpring } from '@react-spring/web';
|
|
15
|
+
import { useDrag } from '@use-gesture/react/dist/use-gesture-react.cjs';
|
|
16
|
+
import React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
|
|
17
|
+
// 本地实现的工具函数和类型
|
|
18
|
+
|
|
19
|
+
// withNativeProps 工具函数
|
|
20
|
+
function withNativeProps(props, element) {
|
|
21
|
+
var p = _objectSpread({}, element.props);
|
|
22
|
+
if (props.className) {
|
|
23
|
+
p.className = props.className + (element.props.className ? " ".concat(element.props.className) : '');
|
|
24
|
+
}
|
|
25
|
+
if (props.style) {
|
|
26
|
+
p.style = _objectSpread(_objectSpread({}, props.style), element.props.style);
|
|
27
|
+
}
|
|
28
|
+
return /*#__PURE__*/React.cloneElement(element, p);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// nearest 工具函数
|
|
32
|
+
function nearest(arr, target) {
|
|
33
|
+
return arr.reduce(function (prev, curr) {
|
|
34
|
+
return Math.abs(curr - target) < Math.abs(prev - target) ? curr : prev;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// mergeProps 工具函数
|
|
39
|
+
function mergeProps(a, b) {
|
|
40
|
+
return _objectSpread(_objectSpread({}, a), b);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// withStopPropagation 工具函数
|
|
44
|
+
function withStopPropagation(events, element) {
|
|
45
|
+
if (!events.includes('click')) {
|
|
46
|
+
return element;
|
|
47
|
+
}
|
|
48
|
+
var onClick = function onClick(e) {
|
|
49
|
+
var _element$props$onClic, _element$props;
|
|
50
|
+
e.stopPropagation();
|
|
51
|
+
(_element$props$onClic = (_element$props = element.props).onClick) === null || _element$props$onClic === void 0 || _element$props$onClic.call(_element$props, e);
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/React.cloneElement(element, _objectSpread(_objectSpread({}, element.props), {}, {
|
|
54
|
+
onClick: onClick
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Button 组件实现
|
|
59
|
+
|
|
60
|
+
var Button = function Button(_ref) {
|
|
61
|
+
var children = _ref.children,
|
|
62
|
+
className = _ref.className,
|
|
63
|
+
style = _ref.style,
|
|
64
|
+
onClick = _ref.onClick;
|
|
65
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
66
|
+
className: className,
|
|
67
|
+
style: _objectSpread({
|
|
68
|
+
border: 'none',
|
|
69
|
+
background: (style === null || style === void 0 ? void 0 : style['--background-color']) || 'transparent'
|
|
70
|
+
}, style),
|
|
71
|
+
onClick: onClick
|
|
72
|
+
}, children);
|
|
73
|
+
};
|
|
74
|
+
import "./index.less";
|
|
75
|
+
var classPrefix = "pisell-custom-swipe-action";
|
|
76
|
+
var defaultProps = {
|
|
77
|
+
rightActions: [],
|
|
78
|
+
leftActions: [],
|
|
79
|
+
closeOnTouchOutside: true,
|
|
80
|
+
closeOnAction: true,
|
|
81
|
+
stopPropagation: []
|
|
82
|
+
};
|
|
83
|
+
export var SwipeAction = /*#__PURE__*/forwardRef(function (p, ref) {
|
|
84
|
+
var props = mergeProps(defaultProps, p);
|
|
85
|
+
var rootRef = useRef(null);
|
|
86
|
+
var leftRef = useRef(null);
|
|
87
|
+
var rightRef = useRef(null);
|
|
88
|
+
function getWidth(ref) {
|
|
89
|
+
var element = ref.current;
|
|
90
|
+
if (!element) return 0;
|
|
91
|
+
return element.offsetWidth;
|
|
92
|
+
}
|
|
93
|
+
function getLeftWidth() {
|
|
94
|
+
return getWidth(leftRef);
|
|
95
|
+
}
|
|
96
|
+
function getRightWidth() {
|
|
97
|
+
return getWidth(rightRef);
|
|
98
|
+
}
|
|
99
|
+
var _useSpring = useSpring(function () {
|
|
100
|
+
return {
|
|
101
|
+
x: 0,
|
|
102
|
+
config: {
|
|
103
|
+
tension: 200,
|
|
104
|
+
friction: 30
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}, []),
|
|
108
|
+
_useSpring2 = _slicedToArray(_useSpring, 2),
|
|
109
|
+
x = _useSpring2[0].x,
|
|
110
|
+
api = _useSpring2[1];
|
|
111
|
+
var draggingRef = useRef(false);
|
|
112
|
+
var dragCancelRef = useRef(null);
|
|
113
|
+
function forceCancelDrag() {
|
|
114
|
+
var _dragCancelRef$curren;
|
|
115
|
+
(_dragCancelRef$curren = dragCancelRef.current) === null || _dragCancelRef$curren === void 0 || _dragCancelRef$curren.call(dragCancelRef);
|
|
116
|
+
draggingRef.current = false;
|
|
117
|
+
}
|
|
118
|
+
var bind = useDrag(function (state) {
|
|
119
|
+
dragCancelRef.current = state.cancel;
|
|
120
|
+
if (!state.intentional) return;
|
|
121
|
+
if (state.down) {
|
|
122
|
+
draggingRef.current = true;
|
|
123
|
+
}
|
|
124
|
+
if (!draggingRef.current) return;
|
|
125
|
+
var _state$offset = _slicedToArray(state.offset, 1),
|
|
126
|
+
offsetX = _state$offset[0];
|
|
127
|
+
if (state.last) {
|
|
128
|
+
var leftWidth = getLeftWidth();
|
|
129
|
+
var rightWidth = getRightWidth();
|
|
130
|
+
var position = offsetX + state.velocity[0] * state.direction[0] * 50;
|
|
131
|
+
if (offsetX > 0) {
|
|
132
|
+
position = Math.max(0, position);
|
|
133
|
+
} else if (offsetX < 0) {
|
|
134
|
+
position = Math.min(0, position);
|
|
135
|
+
} else {
|
|
136
|
+
position = 0;
|
|
137
|
+
}
|
|
138
|
+
var targetX = nearest([-rightWidth, 0, leftWidth], position);
|
|
139
|
+
api.start({
|
|
140
|
+
x: targetX
|
|
141
|
+
});
|
|
142
|
+
if (targetX !== 0) {
|
|
143
|
+
var _p$onActionsReveal;
|
|
144
|
+
(_p$onActionsReveal = p.onActionsReveal) === null || _p$onActionsReveal === void 0 || _p$onActionsReveal.call(p, targetX > 0 ? 'left' : 'right');
|
|
145
|
+
}
|
|
146
|
+
window.setTimeout(function () {
|
|
147
|
+
draggingRef.current = false;
|
|
148
|
+
});
|
|
149
|
+
} else {
|
|
150
|
+
api.start({
|
|
151
|
+
x: offsetX,
|
|
152
|
+
immediate: true
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}, {
|
|
156
|
+
from: function from() {
|
|
157
|
+
return [x.get(), 0];
|
|
158
|
+
},
|
|
159
|
+
bounds: function bounds() {
|
|
160
|
+
var leftWidth = getLeftWidth();
|
|
161
|
+
var rightWidth = getRightWidth();
|
|
162
|
+
return {
|
|
163
|
+
left: -rightWidth,
|
|
164
|
+
right: leftWidth
|
|
165
|
+
};
|
|
166
|
+
},
|
|
167
|
+
axis: 'x',
|
|
168
|
+
preventScroll: true,
|
|
169
|
+
pointer: {
|
|
170
|
+
touch: true
|
|
171
|
+
},
|
|
172
|
+
triggerAllEvents: true
|
|
173
|
+
});
|
|
174
|
+
var close = function close() {
|
|
175
|
+
var _props$onClose;
|
|
176
|
+
api.start({
|
|
177
|
+
x: 0
|
|
178
|
+
});
|
|
179
|
+
forceCancelDrag();
|
|
180
|
+
(_props$onClose = props.onClose) === null || _props$onClose === void 0 || _props$onClose.call(props);
|
|
181
|
+
};
|
|
182
|
+
useImperativeHandle(ref, function () {
|
|
183
|
+
return {
|
|
184
|
+
show: function show() {
|
|
185
|
+
var _p$onActionsReveal2;
|
|
186
|
+
var side = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'right';
|
|
187
|
+
if (side === 'right') {
|
|
188
|
+
api.start({
|
|
189
|
+
x: -getRightWidth()
|
|
190
|
+
});
|
|
191
|
+
} else if (side === 'left') {
|
|
192
|
+
api.start({
|
|
193
|
+
x: getLeftWidth()
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
(_p$onActionsReveal2 = p.onActionsReveal) === null || _p$onActionsReveal2 === void 0 || _p$onActionsReveal2.call(p, side);
|
|
197
|
+
},
|
|
198
|
+
close: close
|
|
199
|
+
};
|
|
200
|
+
});
|
|
201
|
+
useEffect(function () {
|
|
202
|
+
if (!props.closeOnTouchOutside) return;
|
|
203
|
+
function handle(e) {
|
|
204
|
+
if (x.get() === 0) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
var root = rootRef.current;
|
|
208
|
+
if (root && !root.contains(e.target)) {
|
|
209
|
+
close();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
document.addEventListener('touchstart', handle);
|
|
213
|
+
return function () {
|
|
214
|
+
document.removeEventListener('touchstart', handle);
|
|
215
|
+
};
|
|
216
|
+
}, [props.closeOnTouchOutside]);
|
|
217
|
+
function renderAction(action) {
|
|
218
|
+
var _action$color, _colorRecord$color;
|
|
219
|
+
var color = (_action$color = action.color) !== null && _action$color !== void 0 ? _action$color : 'light';
|
|
220
|
+
var _style = action.style || {};
|
|
221
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
222
|
+
key: action.key,
|
|
223
|
+
className: "".concat(classPrefix, "-action-button"),
|
|
224
|
+
style: _objectSpread({
|
|
225
|
+
'--background-color': (_colorRecord$color = colorRecord[color]) !== null && _colorRecord$color !== void 0 ? _colorRecord$color : color
|
|
226
|
+
}, _style),
|
|
227
|
+
onClick: function onClick(e) {
|
|
228
|
+
var _action$onClick, _props$onAction;
|
|
229
|
+
if (props.closeOnAction) {
|
|
230
|
+
close();
|
|
231
|
+
}
|
|
232
|
+
(_action$onClick = action.onClick) === null || _action$onClick === void 0 || _action$onClick.call(action, e);
|
|
233
|
+
(_props$onAction = props.onAction) === null || _props$onAction === void 0 || _props$onAction.call(props, action, e);
|
|
234
|
+
}
|
|
235
|
+
}, action.text);
|
|
236
|
+
}
|
|
237
|
+
return withNativeProps(props, /*#__PURE__*/React.createElement("div", _extends({
|
|
238
|
+
className: classPrefix
|
|
239
|
+
}, bind(), {
|
|
240
|
+
ref: rootRef,
|
|
241
|
+
onClickCapture: function onClickCapture(e) {
|
|
242
|
+
if (draggingRef.current) {
|
|
243
|
+
e.stopPropagation();
|
|
244
|
+
e.preventDefault();
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}), /*#__PURE__*/React.createElement(animated.div, {
|
|
248
|
+
className: "".concat(classPrefix, "-track"),
|
|
249
|
+
style: {
|
|
250
|
+
x: x
|
|
251
|
+
}
|
|
252
|
+
}, withStopPropagation(props.stopPropagation, /*#__PURE__*/React.createElement("div", {
|
|
253
|
+
className: "".concat(classPrefix, "-actions ").concat(classPrefix, "-actions-left"),
|
|
254
|
+
ref: leftRef
|
|
255
|
+
}, props.leftActions.map(renderAction))), /*#__PURE__*/React.createElement("div", {
|
|
256
|
+
className: "".concat(classPrefix, "-content"),
|
|
257
|
+
onClickCapture: function onClickCapture(e) {
|
|
258
|
+
if (x.goal !== 0) {
|
|
259
|
+
e.preventDefault();
|
|
260
|
+
e.stopPropagation();
|
|
261
|
+
close();
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}, /*#__PURE__*/React.createElement(animated.div, {
|
|
265
|
+
style: {
|
|
266
|
+
pointerEvents: x.to(function (v) {
|
|
267
|
+
return v !== 0 && x.goal !== 0 ? 'none' : 'auto';
|
|
268
|
+
})
|
|
269
|
+
}
|
|
270
|
+
}, props.children)), withStopPropagation(props.stopPropagation, /*#__PURE__*/React.createElement("div", {
|
|
271
|
+
className: "".concat(classPrefix, "-actions ").concat(classPrefix, "-actions-right"),
|
|
272
|
+
ref: rightRef
|
|
273
|
+
}, props.rightActions.map(renderAction))))));
|
|
274
|
+
});
|
|
275
|
+
var colorRecord = {
|
|
276
|
+
light: '#ccc',
|
|
277
|
+
weak: '#999',
|
|
278
|
+
primary: '#1677ff',
|
|
279
|
+
success: '#00b578',
|
|
280
|
+
warning: '#ff8f1f',
|
|
281
|
+
danger: '#ff3141'
|
|
282
|
+
};
|