@pisell/materials 1.0.870 → 1.0.871
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 -144
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +23 -32
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +23 -32
- package/es/components/batch-editor/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +56 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +98 -0
- package/es/components/dataSourceComponents/dataSourceWrapper/index.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +16 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +16 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +11 -11
- package/es/components/date-picker/index.d.ts +1 -0
- package/es/components/page/index.d.ts +1 -0
- package/es/components/pisellInput/index.d.ts +1 -0
- package/es/components/pisellModal/components/IpadModal/index.d.ts +1 -0
- package/es/components/pisellModal/components/MobileModal/index.d.ts +1 -0
- package/es/components/pisellModal/components/index.d.ts +1 -0
- package/es/components/pisellWalletPassCard/index.d.ts +1 -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 +38 -0
- package/es/components/productCard/cartSkuCard/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/index.js +26 -9
- package/es/components/productCard/components/Time/components/SelectHolder/index.d.ts +3 -0
- package/es/components/productCard/components/Time/components/SelectResource/index.d.ts +18 -0
- package/es/components/productCard/components/Warning/index.d.ts +7 -0
- package/es/components/productCard/index.d.ts +7 -0
- package/es/components/productCard/utils.d.ts +31 -0
- package/es/components/select-time/index.d.ts +1 -0
- package/es/components/table/Actions/component/ColumnsSetting/index.d.ts +1 -0
- package/es/components/table/Actions/component/GallerySetting/index.d.ts +1 -0
- package/es/components/table/Actions/component/Group/index.d.ts +1 -0
- package/es/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +1 -0
- package/es/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +1 -0
- package/es/components/table/Gallery/components/GalleryItem/index.d.ts +14 -0
- package/es/components/table/Gallery/index.d.ts +5 -0
- package/es/components/table/Table/fields/date/index.d.ts +1 -0
- package/es/components/table/Table/fields/image/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/image/index.d.ts +1 -0
- package/es/components/table/Table/fields/link/index.d.ts +1 -0
- package/es/components/table/Table/fields/number/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/number/index.d.ts +1 -0
- package/es/components/table/Table/fields/numberRange/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/numberRange/index.d.ts +1 -0
- package/es/components/table/Table/fields/oldRangePicker/index.d.ts +1 -0
- package/es/components/table/Table/fields/pSwitch/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/pSwitch/index.d.ts +1 -0
- package/es/components/table/Table/fields/rangePicker/index.d.ts +1 -0
- package/es/components/table/Table/fields/search/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/search/index.d.ts +1 -0
- package/es/components/table/Table/fields/text/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/text/index.d.ts +1 -0
- package/es/components/table/Table/utils.d.ts +173 -0
- package/es/components/table/hooks/useTableSetting.d.ts +22 -0
- package/es/components/table/hooks/useTransDataSource.d.ts +12 -0
- package/es/components/versionSelect/index.d.ts +1 -0
- package/es/components/virtual-keyboard/Amount/index.d.ts +5 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +21 -0
- package/es/components/virtual-keyboard/Number/index.d.ts +5 -0
- package/es/index.d.ts +142 -0
- package/lib/components/batch-editor/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +56 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +98 -0
- package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +16 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +16 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +11 -11
- package/lib/components/date-picker/index.d.ts +1 -0
- package/lib/components/page/index.d.ts +1 -0
- package/lib/components/pisellInput/index.d.ts +1 -0
- package/lib/components/pisellModal/components/IpadModal/index.d.ts +1 -0
- package/lib/components/pisellModal/components/MobileModal/index.d.ts +1 -0
- package/lib/components/pisellModal/components/index.d.ts +1 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +43 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +325 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.less +38 -0
- package/lib/components/productCard/cartSkuCard/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/index.js +27 -13
- package/lib/components/productCard/components/Time/components/SelectHolder/index.d.ts +3 -0
- package/lib/components/productCard/components/Time/components/SelectResource/index.d.ts +18 -0
- package/lib/components/productCard/components/Warning/index.d.ts +7 -0
- package/lib/components/productCard/index.d.ts +7 -0
- package/lib/components/productCard/utils.d.ts +31 -0
- package/lib/components/select-time/index.d.ts +1 -0
- package/lib/components/table/Actions/component/ColumnsSetting/index.d.ts +1 -0
- package/lib/components/table/Actions/component/GallerySetting/index.d.ts +1 -0
- package/lib/components/table/Actions/component/Group/index.d.ts +1 -0
- package/lib/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +1 -0
- package/lib/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +1 -0
- package/lib/components/table/Gallery/components/GalleryItem/index.d.ts +14 -0
- package/lib/components/table/Gallery/index.d.ts +5 -0
- package/lib/components/table/Table/fields/date/index.d.ts +1 -0
- package/lib/components/table/Table/fields/image/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/image/index.d.ts +1 -0
- package/lib/components/table/Table/fields/link/index.d.ts +1 -0
- package/lib/components/table/Table/fields/number/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/number/index.d.ts +1 -0
- package/lib/components/table/Table/fields/numberRange/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/numberRange/index.d.ts +1 -0
- package/lib/components/table/Table/fields/oldRangePicker/index.d.ts +1 -0
- package/lib/components/table/Table/fields/pSwitch/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/pSwitch/index.d.ts +1 -0
- package/lib/components/table/Table/fields/rangePicker/index.d.ts +1 -0
- package/lib/components/table/Table/fields/search/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/search/index.d.ts +1 -0
- package/lib/components/table/Table/fields/text/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/text/index.d.ts +1 -0
- package/lib/components/table/Table/utils.d.ts +173 -0
- package/lib/components/table/hooks/useTableSetting.d.ts +22 -0
- package/lib/components/table/hooks/useTransDataSource.d.ts +12 -0
- package/lib/components/versionSelect/index.d.ts +1 -0
- package/lib/components/virtual-keyboard/Amount/index.d.ts +5 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +21 -0
- package/lib/components/virtual-keyboard/Number/index.d.ts +5 -0
- package/lib/index.d.ts +142 -0
- package/package.json +6 -4
- package/es/components/iconfont/index.d.ts +0 -8
- package/es/components/productCard/cartSkuCard/locales.d.ts +0 -96
- package/lib/components/iconfont/index.d.ts +0 -8
- package/lib/components/productCard/cartSkuCard/locales.d.ts +0 -96
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormInstance } from 'antd';
|
|
3
|
+
import { ModeType } from './type';
|
|
4
|
+
import './style.less';
|
|
5
|
+
export interface WithModeProps {
|
|
6
|
+
renderMode?: ModeType;
|
|
7
|
+
value?: any;
|
|
8
|
+
onChange?: (value: any) => void;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @title: 增加renderMode属性
|
|
13
|
+
* @description: 基于renderMode属性控制渲染模式
|
|
14
|
+
* @return: *
|
|
15
|
+
* @Author: shengjie.zuo
|
|
16
|
+
* @Date: 2024-11-23 17:13:18
|
|
17
|
+
*/
|
|
18
|
+
export declare const withMode: <P extends object>(FieldComponent: React.ComponentType<P>, ReadPrettyComponent?: React.ComponentType<P & {
|
|
19
|
+
renderMode: ModeType;
|
|
20
|
+
}> | undefined, transformProps?: ((props: P, renderMode: ModeType) => P) | undefined) => React.FC<P & WithModeProps>;
|
|
21
|
+
export interface WithFormItemProps {
|
|
22
|
+
name: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
mode?: ModeType;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}
|
|
27
|
+
export declare const formItemNameReplace: (name: string) => string;
|
|
28
|
+
export declare const formItemNameReverse: (name: string) => string;
|
|
29
|
+
export declare const isValidDomain: (value: string) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @title: 追加formItem层
|
|
32
|
+
* @description:
|
|
33
|
+
* @return: *
|
|
34
|
+
* @Author: shengjie.zuo
|
|
35
|
+
* @Date: 2024-11-23 17:14:25
|
|
36
|
+
*/
|
|
37
|
+
export declare const withFormItem: <P extends object>(WrappedComponent: React.ComponentType<P>, overlayProps?: {
|
|
38
|
+
otherFormItemProps?: Record<string, any> | ((props: Record<string, any>, others?: Record<string, any>) => Record<string, any>) | undefined;
|
|
39
|
+
innerProps?: Record<string, any> | undefined;
|
|
40
|
+
} | undefined) => React.FC<P & WithFormItemProps>;
|
|
41
|
+
export declare const withDataSource: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
|
|
42
|
+
dataSource?: any;
|
|
43
|
+
}) => JSX.Element;
|
|
44
|
+
export declare const withOptions: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
|
|
45
|
+
options?: any;
|
|
46
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
47
|
+
labelField: string;
|
|
48
|
+
valueField: string;
|
|
49
|
+
extraParams?: Record<string, any> | undefined;
|
|
50
|
+
}) => JSX.Element;
|
|
51
|
+
export declare const getNestedValue: (obj: Record<string, any>, path: string) => Record<string, any>;
|
|
52
|
+
export declare const renderValueWithMap: (value: any, valueMap?: Record<string, string>, renderMode?: ModeType) => JSX.Element | null;
|
|
53
|
+
export declare function toArr(str: string | number | (string | number)[]): (string | number)[];
|
|
54
|
+
export declare const filterSystemFields: (params: Record<string, any>) => Record<string, any>;
|
|
55
|
+
export declare const transformFormObjToArrayWithUntouched: (obj: Record<string, any>) => any[];
|
|
56
|
+
export declare const setFormFieldsUntouched: (form: FormInstance) => void;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DataSourceTableProps } from '../type';
|
|
3
|
+
import { OperationItem } from '../type';
|
|
4
|
+
interface UseTablePropsProps {
|
|
5
|
+
data: any;
|
|
6
|
+
originProps: DataSourceTableProps;
|
|
7
|
+
openDrawer: (type: OperationItem) => void;
|
|
8
|
+
closeDrawer: () => void;
|
|
9
|
+
refreshData: () => void;
|
|
10
|
+
handleFilterChange: (changedFields: any, allFields: any) => void;
|
|
11
|
+
tableRef: any;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 处理table的props
|
|
15
|
+
* 转换title
|
|
16
|
+
* @param props
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
20
|
+
title: string | number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
21
|
+
pagination: {
|
|
22
|
+
total: number;
|
|
23
|
+
current: number;
|
|
24
|
+
pageSize: number;
|
|
25
|
+
size: string;
|
|
26
|
+
showSizeChanger: boolean;
|
|
27
|
+
};
|
|
28
|
+
columns: import("./useColumns").Column[];
|
|
29
|
+
subTitle: string | number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
30
|
+
buttons: any[] | null;
|
|
31
|
+
filter: JSX.Element | null;
|
|
32
|
+
onRow: (record: any) => any;
|
|
33
|
+
actionButtons: any[] | null;
|
|
34
|
+
titleButtons?: {
|
|
35
|
+
show: boolean;
|
|
36
|
+
maxCount: number;
|
|
37
|
+
items: OperationItem[];
|
|
38
|
+
} | undefined;
|
|
39
|
+
tableButtons?: {
|
|
40
|
+
show: boolean;
|
|
41
|
+
maxCount: number;
|
|
42
|
+
items: OperationItem[];
|
|
43
|
+
} | undefined;
|
|
44
|
+
operation?: {
|
|
45
|
+
show: boolean;
|
|
46
|
+
title: string; /**
|
|
47
|
+
* 处理table的props
|
|
48
|
+
* 转换title
|
|
49
|
+
* @param props
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
width: number;
|
|
53
|
+
align: "center" | "left" | "right";
|
|
54
|
+
fixed: false | "left" | "right";
|
|
55
|
+
type: "button" | "link";
|
|
56
|
+
items: OperationItem[];
|
|
57
|
+
} | undefined;
|
|
58
|
+
operationContent?: {
|
|
59
|
+
[key: string]: React.ReactNode;
|
|
60
|
+
} | undefined;
|
|
61
|
+
dataSource: import("../../provider/dataSource/DataSourceContext").DataSourceType;
|
|
62
|
+
search?: {
|
|
63
|
+
show: boolean;
|
|
64
|
+
placeholder: string;
|
|
65
|
+
} | undefined;
|
|
66
|
+
__designMode: string;
|
|
67
|
+
componentId: string;
|
|
68
|
+
clickToDetail?: {
|
|
69
|
+
show: boolean;
|
|
70
|
+
useCustomAction: boolean;
|
|
71
|
+
actionType: string;
|
|
72
|
+
openMode: "modal" | "drawer";
|
|
73
|
+
openContentSize: "large" | "middle" | "small";
|
|
74
|
+
openTitle: string;
|
|
75
|
+
key: string;
|
|
76
|
+
} | undefined;
|
|
77
|
+
filterBy?: Record<string, any> | undefined;
|
|
78
|
+
sortBy: string;
|
|
79
|
+
tabs?: {
|
|
80
|
+
show: boolean;
|
|
81
|
+
type: string;
|
|
82
|
+
items: {
|
|
83
|
+
name: string;
|
|
84
|
+
filterBy: Record<string, any>;
|
|
85
|
+
sortBy: string;
|
|
86
|
+
}[];
|
|
87
|
+
} | undefined;
|
|
88
|
+
onValuesChange?: ((changedValues: any, values: any) => void) | undefined;
|
|
89
|
+
onDeleteFinish?: ((record: Record<string, any>) => void) | undefined;
|
|
90
|
+
extraParams?: {
|
|
91
|
+
list?: Record<string, any> | undefined;
|
|
92
|
+
get?: Record<string, any> | undefined;
|
|
93
|
+
update?: Record<string, any> | undefined;
|
|
94
|
+
create?: Record<string, any> | undefined;
|
|
95
|
+
destroy?: Record<string, any> | undefined;
|
|
96
|
+
} | undefined;
|
|
97
|
+
};
|
|
98
|
+
export default useTableProps;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputProps } from 'antd';
|
|
3
|
+
import { ModeType } from "../../dataSourceForm/type";
|
|
4
|
+
declare type PhoneValue = string | {
|
|
5
|
+
phone: string;
|
|
6
|
+
countryCallingCode: string;
|
|
7
|
+
};
|
|
8
|
+
export interface PhoneInputProps extends Omit<InputProps, 'value' | 'onChange'> {
|
|
9
|
+
renderMode: ModeType;
|
|
10
|
+
value?: PhoneValue;
|
|
11
|
+
onChange?: (value: PhoneValue) => void;
|
|
12
|
+
returnFormat?: 'string' | 'object';
|
|
13
|
+
inputRef?: any;
|
|
14
|
+
}
|
|
15
|
+
declare const MobileNumberInputWithMode: React.FC<PhoneInputProps & import("../../dataSourceForm/utils").WithModeProps>;
|
|
16
|
+
export default MobileNumberInputWithMode;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputProps } from 'antd';
|
|
3
|
+
import { ModeType } from "../../dataSourceForm/type";
|
|
4
|
+
declare type PhoneValue = string | {
|
|
5
|
+
phone: string;
|
|
6
|
+
countryCallingCode: string;
|
|
7
|
+
};
|
|
8
|
+
export interface PhoneInputProps extends Omit<InputProps, 'value' | 'onChange'> {
|
|
9
|
+
renderMode: ModeType;
|
|
10
|
+
value?: PhoneValue;
|
|
11
|
+
onChange?: (value: PhoneValue) => void;
|
|
12
|
+
returnFormat?: 'string' | 'object';
|
|
13
|
+
inputRef?: any;
|
|
14
|
+
}
|
|
15
|
+
declare const PhoneNumberInputWithMode: React.FC<PhoneInputProps & import("../../dataSourceForm/utils").WithModeProps>;
|
|
16
|
+
export default PhoneNumberInputWithMode;
|
|
@@ -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" | "xzero" | "saas";
|
|
6
6
|
customDomain?: string | undefined;
|
|
7
7
|
value?: string | undefined;
|
|
8
8
|
tenantId: string;
|
|
@@ -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" | "xzero" | "saas";
|
|
23
23
|
customDomain?: string | undefined;
|
|
24
24
|
value?: string | undefined;
|
|
25
25
|
tenantId: string;
|
|
@@ -59,13 +59,7 @@ 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) =>
|
|
63
|
-
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
64
|
-
} & {
|
|
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> | 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> & {
|
|
62
|
+
declare const getFieldComponent: (fieldComponent: string) => (import("react").FC<import("./Input/type").InputProps> & {
|
|
69
63
|
JSON: import("react").FC<any>;
|
|
70
64
|
Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
71
65
|
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>;
|
|
@@ -78,14 +72,18 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
78
72
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
79
73
|
onChange: (value: string) => void;
|
|
80
74
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
81
|
-
rootDomain: "custom" | "
|
|
75
|
+
rootDomain: "custom" | "xzero" | "saas";
|
|
82
76
|
customDomain?: string | undefined;
|
|
83
77
|
value?: string | undefined;
|
|
84
78
|
tenantId: string;
|
|
85
79
|
name?: string | undefined;
|
|
86
80
|
fieldKey?: string | undefined;
|
|
87
81
|
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
88
|
-
}) | import("react").FC<
|
|
82
|
+
}) | import("react").FC<any> | (import("react").FC<{}> & {
|
|
83
|
+
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
84
|
+
} & {
|
|
85
|
+
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
86
|
+
}) | 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<{}> & {
|
|
89
87
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
90
88
|
} & {
|
|
91
89
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
@@ -97,5 +95,7 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
97
95
|
extraParams?: Record<string, any> | undefined;
|
|
98
96
|
} & {
|
|
99
97
|
dataSource?: any;
|
|
100
|
-
}) => JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./
|
|
98
|
+
}) => JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & 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("antd").InputProps & {
|
|
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("./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,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-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: 'var(--adm-color-light)',
|
|
277
|
+
weak: 'var(--adm-color-weak)',
|
|
278
|
+
primary: 'var(--adm-color-primary)',
|
|
279
|
+
success: 'var(--adm-color-success)',
|
|
280
|
+
warning: 'var(--adm-color-warning)',
|
|
281
|
+
danger: 'var(--adm-color-danger)'
|
|
282
|
+
};
|