@pisell/materials 1.0.934 → 1.0.935
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 +164 -148
- package/build/lowcode/render/default/view.js +30 -15
- package/build/lowcode/view.js +41 -26
- package/es/components/appVersionControl/index.d.ts +4 -0
- package/es/components/batch-editor/index.d.ts +0 -1
- package/es/components/cardPro/index.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +56 -0
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.d.ts +8 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +27 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +39 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +98 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +33 -0
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +85 -0
- package/es/components/dataSourceComponents/dataSourceWrapper/index.d.ts +0 -1
- 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.Phone/serve.d.ts +25 -0
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Upload/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +38 -0
- package/es/components/dataSourceComponents/fields/index.d.ts +11 -12
- package/es/components/drag-sort-tree/index.d.ts +3 -0
- package/es/components/filter/types.d.ts +45 -0
- package/es/components/hardwareErrorTip/demo.d.ts +3 -0
- package/es/components/hardwareErrorTip/errorCard/index.d.ts +28 -0
- package/es/components/hardwareErrorTip/errorTipStatistics/index.d.ts +12 -0
- package/es/components/hardwareErrorTip/index.d.ts +19 -0
- package/es/components/hardwareErrorTip/logCard/index.d.ts +27 -0
- package/es/components/hardwareErrorTip/types.d.ts +28 -0
- package/es/components/iconfont/index.d.ts +8 -0
- package/es/components/keyboard/index.d.ts +22 -0
- package/es/components/list/index.d.ts +0 -1
- package/es/components/login-and-register/index.d.ts +82 -0
- package/es/components/pisell-config-provider/index.d.ts +13 -0
- package/es/components/pisell-config-provider/index.js +0 -1
- package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
- package/es/components/pisellCamera/index.d.ts +4 -0
- package/es/components/pisellCardList/index.d.ts +4 -0
- package/es/components/pisellCardList/index.js +5 -1
- package/es/components/pisellEmpty/index.d.ts +19 -0
- package/es/components/pisellText/components/Editable/index.d.ts +29 -0
- package/es/components/pisellText/index.d.ts +9 -0
- package/es/components/pisellWalletPassCard/index.d.ts +140 -0
- package/es/components/pisellWalletPassCard/index.js +17 -4
- package/es/components/pisellWalletPassCard/utils.d.ts +44 -0
- package/es/components/pisellWalletPassCard/utils.js +499 -0
- package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +46 -0
- package/es/components/productCard/cartSkuCard/index.d.ts +10 -0
- package/es/components/productCard/components/Header/Actions/index.d.ts +3 -0
- package/es/components/productCard/components/Header/DeleteButton/index.d.ts +3 -0
- package/es/components/productCard/components/Packages/utils.d.ts +1 -1
- 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/Time/index.d.ts +3 -0
- package/es/components/select/index.d.ts +9 -0
- package/es/components/sortableList/index.d.ts +11 -0
- package/es/components/table/Actions/component/ExportImport/index.d.ts +7 -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/SelectField/index.d.ts +0 -1
- package/es/components/table/Table/fields/index.d.ts +2 -3
- package/es/components/table/Table/fields/text/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/index.d.ts +0 -1
- package/es/components/table/Table/index.d.ts +4 -0
- package/es/components/table/Table/utils.d.ts +167 -0
- package/es/components/table/hooks/useTableSetting.d.ts +21 -0
- package/es/components/table/hooks/useTableSetting.js +1 -1
- package/es/components/table/hooks/useTransDataSource.d.ts +12 -0
- package/es/components/table/index.d.ts +4 -0
- package/es/components/table/types.d.ts +270 -0
- package/es/components/translation/index.d.ts +15 -0
- package/es/components/versionModal/index.d.ts +24 -0
- package/es/components/virtual-keyboard/Number/index.d.ts +0 -1
- package/es/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
- package/es/components/walletCard/index.d.ts +71 -0
- package/es/index.d.ts +145 -0
- package/es/locales/en-US.d.ts +342 -0
- package/es/locales/en-US.js +1 -0
- package/es/locales/zh-CN.d.ts +337 -0
- package/es/locales/zh-CN.js +1 -0
- package/es/locales/zh-TW.d.ts +337 -0
- package/es/locales/zh-TW.js +16 -8
- package/es/utils/platform.d.ts +1 -1
- package/lib/components/appVersionControl/index.d.ts +4 -0
- package/lib/components/batch-editor/index.d.ts +0 -1
- package/lib/components/cardPro/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +56 -0
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.d.ts +8 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +27 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +39 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +98 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +33 -0
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +85 -0
- package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +0 -1
- 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.Phone/serve.d.ts +25 -0
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Upload/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +38 -0
- package/lib/components/dataSourceComponents/fields/index.d.ts +11 -12
- package/lib/components/drag-sort-tree/index.d.ts +3 -0
- package/lib/components/filter/types.d.ts +45 -0
- package/lib/components/hardwareErrorTip/demo.d.ts +3 -0
- package/lib/components/hardwareErrorTip/errorCard/index.d.ts +28 -0
- package/lib/components/hardwareErrorTip/errorTipStatistics/index.d.ts +12 -0
- package/lib/components/hardwareErrorTip/index.d.ts +19 -0
- package/lib/components/hardwareErrorTip/logCard/index.d.ts +27 -0
- package/lib/components/hardwareErrorTip/types.d.ts +28 -0
- package/lib/components/iconfont/index.d.ts +8 -0
- package/lib/components/keyboard/index.d.ts +22 -0
- package/lib/components/list/index.d.ts +0 -1
- package/lib/components/login-and-register/index.d.ts +82 -0
- package/lib/components/pisell-config-provider/index.d.ts +13 -0
- package/lib/components/pisell-config-provider/index.js +0 -1
- package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
- package/lib/components/pisellCamera/index.d.ts +4 -0
- package/lib/components/pisellCardList/index.d.ts +4 -0
- package/lib/components/pisellCardList/index.js +5 -1
- package/lib/components/pisellEmpty/index.d.ts +19 -0
- package/lib/components/pisellText/components/Editable/index.d.ts +29 -0
- package/lib/components/pisellText/index.d.ts +9 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +140 -0
- package/lib/components/pisellWalletPassCard/index.js +12 -2
- package/lib/components/pisellWalletPassCard/utils.d.ts +44 -0
- package/lib/components/pisellWalletPassCard/utils.js +349 -0
- package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +46 -0
- package/lib/components/productCard/cartSkuCard/index.d.ts +10 -0
- package/lib/components/productCard/components/Header/Actions/index.d.ts +3 -0
- package/lib/components/productCard/components/Header/DeleteButton/index.d.ts +3 -0
- package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
- 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/Time/index.d.ts +3 -0
- package/lib/components/select/index.d.ts +9 -0
- package/lib/components/sortableList/index.d.ts +11 -0
- package/lib/components/table/Actions/component/ExportImport/index.d.ts +7 -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/SelectField/index.d.ts +0 -1
- package/lib/components/table/Table/fields/index.d.ts +2 -3
- package/lib/components/table/Table/fields/text/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/index.d.ts +0 -1
- package/lib/components/table/Table/index.d.ts +4 -0
- package/lib/components/table/Table/utils.d.ts +167 -0
- package/lib/components/table/hooks/useTableSetting.d.ts +21 -0
- package/lib/components/table/hooks/useTableSetting.js +1 -1
- package/lib/components/table/hooks/useTransDataSource.d.ts +12 -0
- package/lib/components/table/index.d.ts +4 -0
- package/lib/components/table/types.d.ts +270 -0
- package/lib/components/translation/index.d.ts +15 -0
- package/lib/components/versionModal/index.d.ts +24 -0
- package/lib/components/virtual-keyboard/Number/index.d.ts +0 -1
- package/lib/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
- package/lib/components/walletCard/index.d.ts +71 -0
- package/lib/index.d.ts +145 -0
- package/lib/locales/en-US.d.ts +342 -0
- package/lib/locales/en-US.js +1 -0
- package/lib/locales/zh-CN.d.ts +337 -0
- package/lib/locales/zh-CN.js +1 -0
- package/lib/locales/zh-TW.d.ts +337 -0
- package/lib/locales/zh-TW.js +1 -4
- package/lib/utils/platform.d.ts +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
declare const DEVICE_TYPE_MAP: {
|
|
3
|
+
readonly printer: any;
|
|
4
|
+
readonly barcode_scanner: any;
|
|
5
|
+
readonly cds: any;
|
|
6
|
+
readonly kds: any;
|
|
7
|
+
readonly display: any;
|
|
8
|
+
readonly card_reader: any;
|
|
9
|
+
readonly till: any;
|
|
10
|
+
readonly scale: any;
|
|
11
|
+
};
|
|
12
|
+
export interface ErrorCardData {
|
|
13
|
+
error_level: 0 | 1 | 2 | 3;
|
|
14
|
+
error_message: string;
|
|
15
|
+
error_code: string;
|
|
16
|
+
time: string;
|
|
17
|
+
device: {
|
|
18
|
+
device_type: keyof typeof DEVICE_TYPE_MAP;
|
|
19
|
+
device_name: string;
|
|
20
|
+
device_idfa: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
interface IErrorCardProps {
|
|
24
|
+
data: ErrorCardData;
|
|
25
|
+
onClose?: () => void;
|
|
26
|
+
}
|
|
27
|
+
declare const ErrorCard: (props: IErrorCardProps) => JSX.Element | null;
|
|
28
|
+
export default ErrorCard;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
export declare type StatisticsData = {
|
|
3
|
+
fatal: number;
|
|
4
|
+
critical: number;
|
|
5
|
+
normal: number;
|
|
6
|
+
info: number;
|
|
7
|
+
};
|
|
8
|
+
interface IStatisticsProps {
|
|
9
|
+
data: StatisticsData;
|
|
10
|
+
}
|
|
11
|
+
declare const Statistics: (props: IStatisticsProps) => JSX.Element;
|
|
12
|
+
export default Statistics;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StatisticsData } from './errorTipStatistics';
|
|
3
|
+
import { type ErrorCardData } from './errorCard';
|
|
4
|
+
import { type LogCardData } from './logCard';
|
|
5
|
+
import './index.less';
|
|
6
|
+
interface HardwareErrorTipProps {
|
|
7
|
+
statistics: StatisticsData;
|
|
8
|
+
errors?: ErrorCardData[];
|
|
9
|
+
logs?: LogCardData[];
|
|
10
|
+
onExportLogs?: (logs: any) => void;
|
|
11
|
+
onCloseError?: (error: ErrorCardData, index?: number) => void;
|
|
12
|
+
onTabChange?: (activeTab: string) => void;
|
|
13
|
+
activeTab?: string;
|
|
14
|
+
isLoadingErrors?: boolean;
|
|
15
|
+
isLoadingLogs?: boolean;
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
}
|
|
18
|
+
declare const HardwareErrorTip: React.FC<HardwareErrorTipProps>;
|
|
19
|
+
export default HardwareErrorTip;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
declare const DEVICE_TYPE_MAP: {
|
|
3
|
+
readonly printer: any;
|
|
4
|
+
readonly barcode_scanner: any;
|
|
5
|
+
readonly cds: any;
|
|
6
|
+
readonly kds: any;
|
|
7
|
+
readonly display: any;
|
|
8
|
+
readonly card_reader: any;
|
|
9
|
+
readonly till: any;
|
|
10
|
+
readonly scale: any;
|
|
11
|
+
};
|
|
12
|
+
export interface LogCardData {
|
|
13
|
+
log_level: 0 | 1 | 2;
|
|
14
|
+
message: string;
|
|
15
|
+
time: string;
|
|
16
|
+
device: {
|
|
17
|
+
device_type: keyof typeof DEVICE_TYPE_MAP;
|
|
18
|
+
device_name: string;
|
|
19
|
+
device_idfa: string;
|
|
20
|
+
};
|
|
21
|
+
data?: string;
|
|
22
|
+
}
|
|
23
|
+
interface ILogCardProps {
|
|
24
|
+
data: LogCardData;
|
|
25
|
+
}
|
|
26
|
+
declare const LogCard: (props: ILogCardProps) => JSX.Element;
|
|
27
|
+
export default LogCard;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const prefix = "pisell-lowcode";
|
|
2
|
+
export declare const ErrorTypeTheme: {
|
|
3
|
+
readonly fatal: {
|
|
4
|
+
readonly iconColor: "#cf1322";
|
|
5
|
+
readonly backgroundColor: "#fff1f0";
|
|
6
|
+
readonly shadowColor: "#ffa39e";
|
|
7
|
+
readonly badgeColor: "#fee2e1";
|
|
8
|
+
};
|
|
9
|
+
readonly critical: {
|
|
10
|
+
readonly iconColor: "#d4380d";
|
|
11
|
+
readonly backgroundColor: "#fff2e8";
|
|
12
|
+
readonly shadowColor: "#ffbb96";
|
|
13
|
+
readonly badgeColor: "#ffedd5";
|
|
14
|
+
};
|
|
15
|
+
readonly normal: {
|
|
16
|
+
readonly iconColor: "#0958d9";
|
|
17
|
+
readonly backgroundColor: "#e6f4ff";
|
|
18
|
+
readonly shadowColor: "#91caff";
|
|
19
|
+
readonly badgeColor: "#d2eafd";
|
|
20
|
+
};
|
|
21
|
+
readonly info: {
|
|
22
|
+
readonly iconColor: "#389e0d";
|
|
23
|
+
readonly backgroundColor: "#f6ffed";
|
|
24
|
+
readonly shadowColor: "#b7eb8f";
|
|
25
|
+
readonly badgeColor: "#dcfce7";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare const errorTypes: any[];
|
|
@@ -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,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export declare type ItemValue = string | number;
|
|
4
|
+
export interface Item {
|
|
5
|
+
value: ItemValue;
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
type: 'text' | 'primary';
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
size?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface KeyboardProps {
|
|
13
|
+
id?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
onChange?: (value?: ItemValue) => void;
|
|
17
|
+
items?: Item[];
|
|
18
|
+
rightItems?: Item[];
|
|
19
|
+
keydown?: boolean;
|
|
20
|
+
}
|
|
21
|
+
declare const _default: React.MemoExoticComponent<(props: KeyboardProps) => JSX.Element>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
/**
|
|
4
|
+
* loginAndRegister组件的属性接口
|
|
5
|
+
*/
|
|
6
|
+
export interface loginAndRegisterProps {
|
|
7
|
+
/** Logo相关配置 */
|
|
8
|
+
showLogo?: boolean;
|
|
9
|
+
logo?: string;
|
|
10
|
+
logoPosition?: 'left' | 'center' | 'right';
|
|
11
|
+
logoSize?: {
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
};
|
|
15
|
+
/** 标题相关配置 */
|
|
16
|
+
title?: string;
|
|
17
|
+
showTitle?: boolean;
|
|
18
|
+
titleAlign?: 'left' | 'center' | 'right';
|
|
19
|
+
/** 副标题相关配置 */
|
|
20
|
+
subtitle?: string;
|
|
21
|
+
showSubtitle?: boolean;
|
|
22
|
+
subtitleAlign?: 'left' | 'center' | 'right';
|
|
23
|
+
/** 登录方式配置 */
|
|
24
|
+
loginMethods?: ('email' | 'google' | 'facebook' | 'apple')[];
|
|
25
|
+
defaultLoginMethod?: 'email' | 'google' | 'facebook' | 'apple';
|
|
26
|
+
/** 表单配置 */
|
|
27
|
+
emailLabel?: string;
|
|
28
|
+
passwordLabel?: string;
|
|
29
|
+
emailPlaceholder?: string;
|
|
30
|
+
passwordPlaceholder?: string;
|
|
31
|
+
emailRules?: any[];
|
|
32
|
+
buttonText?: string;
|
|
33
|
+
rememberMeText?: string;
|
|
34
|
+
forgotPasswordText?: string;
|
|
35
|
+
showRememberMe?: boolean;
|
|
36
|
+
showForgotPassword?: boolean;
|
|
37
|
+
/** 社交登录配置 */
|
|
38
|
+
socialLoginTexts?: {
|
|
39
|
+
google?: string;
|
|
40
|
+
facebook?: string;
|
|
41
|
+
apple?: string;
|
|
42
|
+
};
|
|
43
|
+
/** 底部配置 */
|
|
44
|
+
showFooter?: boolean;
|
|
45
|
+
showSignUp?: boolean;
|
|
46
|
+
signUpText?: string;
|
|
47
|
+
signUpLink?: string;
|
|
48
|
+
signUpPosition?: 'left' | 'center' | 'right';
|
|
49
|
+
otherLinks?: Array<{
|
|
50
|
+
text: string;
|
|
51
|
+
url: string;
|
|
52
|
+
}>;
|
|
53
|
+
otherLinksPosition?: 'left' | 'center' | 'right';
|
|
54
|
+
/** 登录/注册切换配置 */
|
|
55
|
+
showTabs?: boolean;
|
|
56
|
+
loginTabText?: string;
|
|
57
|
+
registerTabText?: string;
|
|
58
|
+
/** 注册表单配置 */
|
|
59
|
+
registerEmailPlaceholder?: string;
|
|
60
|
+
registerPasswordPlaceholder?: string;
|
|
61
|
+
registerButtonText?: string;
|
|
62
|
+
/** 事件回调 */
|
|
63
|
+
onLogin?: (values: {
|
|
64
|
+
email: string;
|
|
65
|
+
loginMethod: string;
|
|
66
|
+
}) => void;
|
|
67
|
+
onSocialLogin?: (type: 'google' | 'facebook' | 'apple') => void;
|
|
68
|
+
onSignUp?: () => void;
|
|
69
|
+
onRegister?: (values: {
|
|
70
|
+
email: string;
|
|
71
|
+
password: string;
|
|
72
|
+
}) => void;
|
|
73
|
+
/** 新增背景图片属性 */
|
|
74
|
+
backgroundImage?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Saas登录组件
|
|
78
|
+
* @param props - 组件属性
|
|
79
|
+
* @returns React组件
|
|
80
|
+
*/
|
|
81
|
+
declare const loginAndRegister: React.FC<loginAndRegisterProps>;
|
|
82
|
+
export default loginAndRegister;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PisellContextType } from './context';
|
|
3
|
+
interface PisellConfigProviderType {
|
|
4
|
+
platform?: PisellContextType['platform'];
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** 货币符号 */
|
|
7
|
+
symbol?: string;
|
|
8
|
+
/** 当前语言环境 */
|
|
9
|
+
locale?: string;
|
|
10
|
+
getSymbolic?: () => string;
|
|
11
|
+
}
|
|
12
|
+
declare const PisellConfigProvider: React.FC<PisellConfigProviderType>;
|
|
13
|
+
export default PisellConfigProvider;
|
|
@@ -28,7 +28,6 @@ var PisellConfigProvider = function PisellConfigProvider(props) {
|
|
|
28
28
|
locale: locale || 'en',
|
|
29
29
|
getSymbolic: getSymbolic
|
|
30
30
|
};
|
|
31
|
-
console.log(config, 'config');
|
|
32
31
|
var staticFunction = App.useApp();
|
|
33
32
|
setMessage(staticFunction.message);
|
|
34
33
|
setModal(staticFunction.modal);
|
|
@@ -31,6 +31,10 @@ export interface PisellCardListProps extends Omit<PisellCheckboxGroupProps, 'opt
|
|
|
31
31
|
showCode?: boolean;
|
|
32
32
|
/** 是否展示到期时间 */
|
|
33
33
|
showValidDate?: boolean;
|
|
34
|
+
/** 使用日程信息计算有效期 */
|
|
35
|
+
validDateBySchedule?: boolean;
|
|
36
|
+
/** 日程列表 */
|
|
37
|
+
scheduleList?: any[];
|
|
34
38
|
/** 是否展示详情按钮 */
|
|
35
39
|
showDetail?: boolean;
|
|
36
40
|
/** 是否展示二维码 */
|
|
@@ -50,7 +50,9 @@ var PisellCardList = function PisellCardList(props) {
|
|
|
50
50
|
formatRedeemTitle = props.formatRedeemTitle,
|
|
51
51
|
onBeforeEditAmount = props.onBeforeEditAmount,
|
|
52
52
|
onItemClick = props.onItemClick,
|
|
53
|
-
showActiveBackground = props.showActiveBackground
|
|
53
|
+
showActiveBackground = props.showActiveBackground,
|
|
54
|
+
validDateBySchedule = props.validDateBySchedule,
|
|
55
|
+
scheduleList = props.scheduleList;
|
|
54
56
|
return data.length ? /*#__PURE__*/React.createElement(PisellCheckboxGroup, {
|
|
55
57
|
options: data,
|
|
56
58
|
value: value,
|
|
@@ -90,6 +92,8 @@ var PisellCardList = function PisellCardList(props) {
|
|
|
90
92
|
var _props$onDetail;
|
|
91
93
|
return props === null || props === void 0 || (_props$onDetail = props.onDetail) === null || _props$onDetail === void 0 ? void 0 : _props$onDetail.call(props, record, index);
|
|
92
94
|
},
|
|
95
|
+
validDateBySchedule: validDateBySchedule || (item === null || item === void 0 ? void 0 : item.validDateBySchedule),
|
|
96
|
+
scheduleList: scheduleList || (item === null || item === void 0 ? void 0 : item.scheduleList),
|
|
93
97
|
beforeEdit: function beforeEdit(record) {
|
|
94
98
|
var _props$beforeEdit;
|
|
95
99
|
return props === null || props === void 0 || (_props$beforeEdit = props.beforeEdit) === null || _props$beforeEdit === void 0 ? void 0 : _props$beforeEdit.call(props, record, index);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EmptyProps } from 'antd';
|
|
3
|
+
import { PisellContextType } from '../pisell-config-provider/context';
|
|
4
|
+
import './index.less';
|
|
5
|
+
export interface PisellEmptyProps extends EmptyProps {
|
|
6
|
+
/** 平台 */
|
|
7
|
+
platform?: PisellContextType['platform'];
|
|
8
|
+
/** 额外内容描述 */
|
|
9
|
+
extraDescription?: React.ReactNode;
|
|
10
|
+
/** 额外内容描述 */
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
/** 自定义底部额外操作区域 */
|
|
13
|
+
footer?: React.ReactNode;
|
|
14
|
+
/** 最大宽度 */
|
|
15
|
+
maxWidth?: number;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
declare const PisellEmpty: (props: PisellEmptyProps) => JSX.Element;
|
|
19
|
+
export default PisellEmpty;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export declare type MultiLanguageValue = {
|
|
4
|
+
en: string;
|
|
5
|
+
'zh-CN': string;
|
|
6
|
+
'zh-HK': string;
|
|
7
|
+
};
|
|
8
|
+
export interface EditableConfig {
|
|
9
|
+
/** 是否禁用编辑 */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** 最大长度 */
|
|
12
|
+
maxLength?: number;
|
|
13
|
+
/** 编辑图标 */
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export interface EditableProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
17
|
+
/** 文本内容,支持字符串或多语言对象 */
|
|
18
|
+
value?: string | MultiLanguageValue;
|
|
19
|
+
/** 子节点内容,优先级高于 value */
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
/** 可编辑配置,boolean 时使用默认配置 */
|
|
22
|
+
editable?: boolean | EditableConfig;
|
|
23
|
+
/** 编辑变更回调 */
|
|
24
|
+
onChange?: (value: string | MultiLanguageValue) => void;
|
|
25
|
+
/** 输入框尺寸 */
|
|
26
|
+
size?: 'large' | 'middle' | 'small';
|
|
27
|
+
}
|
|
28
|
+
declare const Editable: React.FC<EditableProps>;
|
|
29
|
+
export default Editable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PisellTextProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
}
|
|
4
|
+
declare const PisellText: {
|
|
5
|
+
(props: PisellTextProps): JSX.Element;
|
|
6
|
+
Amount: (props: import("./components/Amount").AmountProps) => JSX.Element;
|
|
7
|
+
Editable: React.FC<import("./components/Editable").EditableProps>;
|
|
8
|
+
};
|
|
9
|
+
export default PisellText;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface FormatOption {
|
|
4
|
+
/** 原始 DOM 元素 */
|
|
5
|
+
originDom: React.ReactNode;
|
|
6
|
+
/** 是否选中状态 */
|
|
7
|
+
active: boolean;
|
|
8
|
+
/** 完整的组件数据 */
|
|
9
|
+
data: PisellWalletPassCardProps;
|
|
10
|
+
}
|
|
11
|
+
export interface PisellWalletPassCardProps {
|
|
12
|
+
id: number;
|
|
13
|
+
/** 卡片样式 */
|
|
14
|
+
type: 'default' | 'mini';
|
|
15
|
+
/** 商品名称 */
|
|
16
|
+
name: string;
|
|
17
|
+
/** 二维码 */
|
|
18
|
+
qrCode: string;
|
|
19
|
+
/** 共享店铺名称 */
|
|
20
|
+
storeName: string;
|
|
21
|
+
/** 余额 */
|
|
22
|
+
balance?: number;
|
|
23
|
+
/** 识别码编号 */
|
|
24
|
+
code: string;
|
|
25
|
+
/** 有效期 */
|
|
26
|
+
validDate: string;
|
|
27
|
+
/** 使用金额 */
|
|
28
|
+
redeem?: number;
|
|
29
|
+
/** 是否禁用 */
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** 禁用原因 */
|
|
32
|
+
disabledReason?: string;
|
|
33
|
+
/** 是否展示禁用原因 */
|
|
34
|
+
showDisabledReason?: boolean;
|
|
35
|
+
/** 封面图 */
|
|
36
|
+
cover?: string;
|
|
37
|
+
/** 余额标题文案 */
|
|
38
|
+
balanceTitle?: string;
|
|
39
|
+
/** 使用金额标题文案 */
|
|
40
|
+
redeemTitle?: string;
|
|
41
|
+
/** 是否选中 */
|
|
42
|
+
active?: boolean;
|
|
43
|
+
/** 是否展示商品名称 */
|
|
44
|
+
showName?: boolean;
|
|
45
|
+
/** 是否展示共享店铺名称 */
|
|
46
|
+
showStoreName?: boolean | ((data: any) => boolean);
|
|
47
|
+
/** 是否展示使用金额 */
|
|
48
|
+
showRedeem?: boolean;
|
|
49
|
+
/** 是否展示余额 */
|
|
50
|
+
showBalance?: boolean;
|
|
51
|
+
/** 是否展示识别码编号 */
|
|
52
|
+
showCode?: boolean;
|
|
53
|
+
/** 是否展示有效期 */
|
|
54
|
+
showValidDate?: boolean;
|
|
55
|
+
/** 使用日程信息计算有效期 */
|
|
56
|
+
validDateBySchedule?: boolean;
|
|
57
|
+
/** 日程列表 */
|
|
58
|
+
scheduleList?: any[];
|
|
59
|
+
/** 是否展示右上角详情按钮 */
|
|
60
|
+
showDetail?: boolean;
|
|
61
|
+
/** 是否展示qrCode */
|
|
62
|
+
showQrCode?: boolean;
|
|
63
|
+
/** 是否展示封面 */
|
|
64
|
+
showCover?: boolean;
|
|
65
|
+
/** 是否展示余额货币符号 */
|
|
66
|
+
showBalanceSymbol?: boolean;
|
|
67
|
+
/** 展示操作按钮 */
|
|
68
|
+
showActions?: boolean;
|
|
69
|
+
/** 操作按钮配置 */
|
|
70
|
+
actions?: {
|
|
71
|
+
/** 按钮展示方式 */
|
|
72
|
+
layout: 'expanded' | 'collapsed';
|
|
73
|
+
/** detail 按钮配置 */
|
|
74
|
+
detail?: {
|
|
75
|
+
visible: boolean;
|
|
76
|
+
iconColor: string;
|
|
77
|
+
};
|
|
78
|
+
/** edit按钮配置 */
|
|
79
|
+
edit?: {
|
|
80
|
+
visible: boolean;
|
|
81
|
+
iconColor: string;
|
|
82
|
+
dialogTitle: string;
|
|
83
|
+
enableDialog: boolean;
|
|
84
|
+
fields: {
|
|
85
|
+
name: string;
|
|
86
|
+
label: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
/** 编辑编辑按钮后,弹窗展示之前 */
|
|
91
|
+
beforeEdit?: (value: any) => Promise<any> | boolean | void;
|
|
92
|
+
/** 编辑弹窗点击提交 */
|
|
93
|
+
onConfirmEdit?: (value: any) => void;
|
|
94
|
+
/** 编辑金额事件 */
|
|
95
|
+
onConfirmEditAmount?: (value: number) => void;
|
|
96
|
+
/** 详情按钮点击事件 */
|
|
97
|
+
onDetail?: (data: {
|
|
98
|
+
id: number;
|
|
99
|
+
name: string;
|
|
100
|
+
storeName: string;
|
|
101
|
+
balance?: number;
|
|
102
|
+
redeem?: number;
|
|
103
|
+
code: string;
|
|
104
|
+
validDate: string;
|
|
105
|
+
originData?: any;
|
|
106
|
+
}) => void;
|
|
107
|
+
/** 是否使用外部详情处理(当为 true 且提供了 onDetail 时,不显示内部模态框) */
|
|
108
|
+
useExternalDetail?: boolean;
|
|
109
|
+
/** 单选或者多选 */
|
|
110
|
+
mode?: 'multiple' | 'single';
|
|
111
|
+
/** 是否展示选中图标 */
|
|
112
|
+
showActiveIcon?: boolean;
|
|
113
|
+
/** 开启编辑金额 */
|
|
114
|
+
enableEditAmount?: boolean;
|
|
115
|
+
/** 显示状态标识 */
|
|
116
|
+
showStatus?: boolean;
|
|
117
|
+
/** 名称标题字号字重颜色配置 */
|
|
118
|
+
nameTitleStyle?: {
|
|
119
|
+
fontSize: number;
|
|
120
|
+
fontWeight: number;
|
|
121
|
+
color: string;
|
|
122
|
+
};
|
|
123
|
+
/** 卡片状态 */
|
|
124
|
+
cardStatus?: 'used' | 'expired' | 'disabled' | 'conflict' | 'lastPayment';
|
|
125
|
+
/** 自定义余额格式化函数,如果提供则优先使用 */
|
|
126
|
+
formatBalance?: (balance?: number, option?: FormatOption) => React.ReactNode;
|
|
127
|
+
/** 自定义余额标题格式化函数,如果提供则优先使用 */
|
|
128
|
+
formatBalanceTitle?: (balanceTitle?: string, option?: FormatOption) => React.ReactNode;
|
|
129
|
+
/** 自定义使用金额格式化函数,如果提供则优先使用 */
|
|
130
|
+
formatRedeem?: (redeem?: number, option?: FormatOption) => React.ReactNode;
|
|
131
|
+
/** 自定义使用金额标题格式化函数,如果提供则优先使用 */
|
|
132
|
+
formatRedeemTitle?: (redeemTitle?: string, option?: FormatOption) => React.ReactNode;
|
|
133
|
+
/** 最大使用金额 */
|
|
134
|
+
maxRedeem?: number;
|
|
135
|
+
/** 编辑金额前事件 */
|
|
136
|
+
onBeforeEditAmount?: (value: any) => Promise<any> | boolean | void;
|
|
137
|
+
[key: string]: any;
|
|
138
|
+
}
|
|
139
|
+
declare const PisellWalletPassCard: (props: PisellWalletPassCardProps) => JSX.Element;
|
|
140
|
+
export default PisellWalletPassCard;
|
|
@@ -20,8 +20,9 @@ import { CheckCircleFilled, EditOutlined, ExclamationCircleOutlined, MoreOutline
|
|
|
20
20
|
import { Dropdown, Form, Input, InputNumber, DatePicker, Radio } from 'antd';
|
|
21
21
|
import dayjs from 'dayjs';
|
|
22
22
|
import Iconfont from "../iconfont";
|
|
23
|
-
import { PisellModal } from "../../index";
|
|
23
|
+
import { PisellModal, usePisellConfig } from "../../index";
|
|
24
24
|
import PisellTag from "../pisellTags";
|
|
25
|
+
import { getScheduleSummary } from "./utils";
|
|
25
26
|
import Amount from "../pisellText/components/Amount";
|
|
26
27
|
import AmountCpt from "../virtual-keyboard/Amount";
|
|
27
28
|
|
|
@@ -70,6 +71,7 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
|
|
|
70
71
|
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
71
72
|
pressTimer = _React$useState12[0],
|
|
72
73
|
setPressTimer = _React$useState12[1];
|
|
74
|
+
var config = usePisellConfig();
|
|
73
75
|
|
|
74
76
|
// 添加 useEffect 清理定时器
|
|
75
77
|
useEffect(function () {
|
|
@@ -143,7 +145,9 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
|
|
|
143
145
|
formatBalanceTitle = props.formatBalanceTitle,
|
|
144
146
|
formatRedeem = props.formatRedeem,
|
|
145
147
|
formatRedeemTitle = props.formatRedeemTitle,
|
|
146
|
-
maxRedeem = props.maxRedeem
|
|
148
|
+
maxRedeem = props.maxRedeem,
|
|
149
|
+
validDateBySchedule = props.validDateBySchedule,
|
|
150
|
+
scheduleList = props.scheduleList;
|
|
147
151
|
useEffect(function () {
|
|
148
152
|
document.body.id = 'body';
|
|
149
153
|
}, []);
|
|
@@ -314,6 +318,12 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
|
|
|
314
318
|
}
|
|
315
319
|
setLastTap(now);
|
|
316
320
|
};
|
|
321
|
+
var formatValidDate = useMemo(function () {
|
|
322
|
+
if (validDateBySchedule && scheduleList && (scheduleList === null || scheduleList === void 0 ? void 0 : scheduleList.length) > 0) {
|
|
323
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, getText('pisell-wallet-pass-card-valid'), ' ', getScheduleSummary(scheduleList, config === null || config === void 0 ? void 0 : config.locale) || validDate);
|
|
324
|
+
}
|
|
325
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, getText('pisell-wallet-pass-card-valid-to'), ' ', !!validDate ? validDate : getText('pisell-wallet-pass-card-expireDate'));
|
|
326
|
+
}, [validDateBySchedule, scheduleList, validDate]);
|
|
317
327
|
var _onConfirmEdit = function _onConfirmEdit() {
|
|
318
328
|
form.validateFields().then(function (values) {
|
|
319
329
|
var _values$validDate;
|
|
@@ -545,10 +555,13 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
|
|
|
545
555
|
useThousandsSeparator: true,
|
|
546
556
|
value: discount
|
|
547
557
|
})) : /*#__PURE__*/React.createElement(React.Fragment, null, discount, "% ", getText('pisell-discount-card-unit'))))), /*#__PURE__*/React.createElement("div", {
|
|
548
|
-
className: "pisell-card-code-wrap"
|
|
558
|
+
className: "pisell-card-code-wrap",
|
|
559
|
+
style: {
|
|
560
|
+
marginRight: showValidDate ? 60 : 0
|
|
561
|
+
}
|
|
549
562
|
}, /*#__PURE__*/React.createElement("div", {
|
|
550
563
|
className: "pisell-card-code"
|
|
551
|
-
}, showCode && !isMini && /*#__PURE__*/React.createElement("div", null, code), showValidDate && /*#__PURE__*/React.createElement("div", null,
|
|
564
|
+
}, showCode && !isMini && /*#__PURE__*/React.createElement("div", null, code), showValidDate && /*#__PURE__*/React.createElement("div", null, formatValidDate))));
|
|
552
565
|
};
|
|
553
566
|
var getInputItem = function getInputItem(name) {
|
|
554
567
|
if ('validDate' === name) {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare type Locale = 'en' | 'zh-CN' | 'zh-HK';
|
|
2
|
+
interface ScheduleItem {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string | {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
7
|
+
type: 'standard' | 'time-slots' | 'designation';
|
|
8
|
+
start_time: string | null;
|
|
9
|
+
end_time: string | null;
|
|
10
|
+
repeat_type: 'none' | 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
11
|
+
repeat_rule: {
|
|
12
|
+
end: {
|
|
13
|
+
type: 'never' | 'date' | 'occurrence';
|
|
14
|
+
end_date: string | null;
|
|
15
|
+
occurrence: number | null;
|
|
16
|
+
};
|
|
17
|
+
frequency: number;
|
|
18
|
+
excluded_date: Array<{
|
|
19
|
+
start: string;
|
|
20
|
+
end: string;
|
|
21
|
+
}>;
|
|
22
|
+
included_date: any[];
|
|
23
|
+
frequency_date: number[];
|
|
24
|
+
} | null;
|
|
25
|
+
designation: Array<{
|
|
26
|
+
start_date: string;
|
|
27
|
+
start_time: string;
|
|
28
|
+
end_date: string;
|
|
29
|
+
end_time: string;
|
|
30
|
+
}> | null;
|
|
31
|
+
is_all: number;
|
|
32
|
+
time_slot: Array<{
|
|
33
|
+
start_time: string;
|
|
34
|
+
end_time: string;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 获取schedule摘要信息
|
|
39
|
+
* @param scheduleList 日程列表
|
|
40
|
+
* @param locale 语言设置
|
|
41
|
+
* @returns 摘要文本
|
|
42
|
+
*/
|
|
43
|
+
export declare function getScheduleSummary(scheduleList: ScheduleItem[], locale?: Locale): string;
|
|
44
|
+
export {};
|