@pisell/materials 2.2.108 → 2.2.110
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 +7 -7
- package/build/lowcode/preview.js +164 -148
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +53 -23
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +58 -28
- package/es/components/appVersionControl/index.d.ts +4 -0
- package/es/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
- package/es/components/auto-resize-text/auto-text-size-standalone.js +258 -0
- package/es/components/auto-resize-text/index.d.ts +6 -0
- package/es/components/auto-resize-text/index.js +40 -0
- package/es/components/cardPro/index.d.ts +3 -0
- package/es/components/cardPro/index.js +10 -3
- 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/BaseTable.js +11 -4
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
- package/es/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +38 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +100 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +35 -15
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +92 -6
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +84 -0
- package/es/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +10 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +10 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +24 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +2 -1
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +199 -19
- package/es/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +6 -0
- package/es/components/dataSourceComponents/fields/Upload/CameraPopover.js +66 -0
- package/es/components/dataSourceComponents/fields/Upload/index.js +4 -3
- package/es/components/dataSourceComponents/fields/Upload/index.less +35 -3
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +38 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.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/drag-sort-tree/index.d.ts +4 -0
- package/es/components/filter/index.d.ts +0 -1
- package/es/components/filter/types.d.ts +3 -0
- package/es/components/iconfont/index.d.ts +8 -0
- package/es/components/iconfont/index.js +1 -1
- package/es/components/keyboard/index.d.ts +22 -0
- package/es/components/keyboard/index.js +159 -0
- package/es/components/keyboard/index.less +44 -0
- package/es/components/list/index.d.ts +0 -1
- package/es/components/login-and-register/index.d.ts +82 -0
- package/es/components/page/index.d.ts +1 -0
- package/es/components/pisell-config-provider/index.d.ts +13 -0
- package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +1 -0
- package/es/components/pisellCamera/index.d.ts +4 -0
- package/es/components/pisellCamera/index.js +228 -0
- package/es/components/pisellCamera/index.less +131 -0
- package/es/components/pisellEmpty/index.d.ts +19 -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/pisellQRScanner/index.d.ts +0 -13
- package/es/components/pisellQRScanner/index.js +0 -8
- package/es/components/pisellToast/squareToast/renderImperatively.d.ts +29 -0
- package/es/components/pisellWalletPassCard/index.d.ts +136 -0
- package/es/components/pisellWalletPassCard/index.js +6 -3
- package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +73 -5
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/index.js +2 -11
- 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-time/index.d.ts +1 -0
- package/es/components/table/Actions/component/ColumnsSetting/index.d.ts +1 -0
- package/es/components/table/Actions/component/ExportImport/index.d.ts +7 -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/Actions/index.d.ts +1 -0
- package/es/components/table/Actions/index.js +4 -1
- 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/index.d.ts +4 -0
- package/es/components/table/Table/utils.d.ts +161 -0
- package/es/components/table/Table/utils.js +22 -1
- package/es/components/table/hooks/useTableSetting.d.ts +21 -0
- package/es/components/table/hooks/useTableSetting.js +113 -5
- package/es/components/table/hooks/useTransDataSource.d.ts +11 -0
- package/es/components/table/index.js +14 -3
- package/es/components/table/types.d.ts +268 -0
- package/es/components/translation/index.d.ts +14 -0
- package/es/components/versionModal/index.d.ts +23 -0
- package/es/components/versionSelect/index.d.ts +1 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +21 -7
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +44 -25
- package/es/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
- package/es/components/virtualInput/BaseVirtualInput/index.js +163 -0
- package/es/components/virtualInput/BaseVirtualInput/index.less +77 -0
- package/es/components/virtualInput/index.d.ts +24 -0
- package/es/components/virtualInput/index.js +60 -0
- package/es/components/virtualInput/index.less +42 -0
- package/es/components/walletCard/index.d.ts +71 -0
- package/es/index.d.ts +144 -0
- package/es/index.js +4 -1
- package/es/locales/en-US.d.ts +307 -0
- package/es/locales/en-US.js +29 -1
- package/es/locales/zh-CN.d.ts +302 -0
- package/es/locales/zh-CN.js +29 -1
- package/es/locales/zh-TW.d.ts +302 -0
- package/es/locales/zh-TW.js +29 -1
- package/es/utils/platform.d.ts +1 -1
- package/lib/components/appVersionControl/index.d.ts +4 -0
- package/lib/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
- package/lib/components/auto-resize-text/auto-text-size-standalone.js +273 -0
- package/lib/components/auto-resize-text/index.d.ts +6 -0
- package/lib/components/auto-resize-text/index.js +71 -0
- package/lib/components/cardPro/index.d.ts +3 -0
- package/lib/components/cardPro/index.js +3 -2
- 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/BaseTable.js +8 -2
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
- package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +38 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +100 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +22 -7
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +78 -7
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +84 -0
- package/lib/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +10 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +10 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +24 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +2 -1
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +168 -5
- package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +6 -0
- package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.js +95 -0
- package/lib/components/dataSourceComponents/fields/Upload/index.js +2 -1
- package/lib/components/dataSourceComponents/fields/Upload/index.less +35 -3
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +38 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.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/drag-sort-tree/index.d.ts +4 -0
- package/lib/components/filter/index.d.ts +0 -1
- package/lib/components/filter/types.d.ts +3 -0
- package/lib/components/iconfont/index.d.ts +8 -0
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/keyboard/index.d.ts +22 -0
- package/lib/components/keyboard/index.js +223 -0
- package/lib/components/keyboard/index.less +44 -0
- package/lib/components/list/index.d.ts +0 -1
- package/lib/components/login-and-register/index.d.ts +82 -0
- package/lib/components/page/index.d.ts +1 -0
- package/lib/components/pisell-config-provider/index.d.ts +13 -0
- package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +1 -0
- package/lib/components/pisellCamera/index.d.ts +4 -0
- package/lib/components/pisellCamera/index.js +222 -0
- package/lib/components/pisellCamera/index.less +131 -0
- package/lib/components/pisellEmpty/index.d.ts +19 -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/pisellQRScanner/index.d.ts +0 -13
- package/lib/components/pisellToast/squareToast/renderImperatively.d.ts +29 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +136 -0
- package/lib/components/pisellWalletPassCard/index.js +7 -2
- package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +45 -11
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/index.js +2 -13
- 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-time/index.d.ts +1 -0
- package/lib/components/table/Actions/component/ColumnsSetting/index.d.ts +1 -0
- package/lib/components/table/Actions/component/ExportImport/index.d.ts +7 -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/Actions/index.d.ts +1 -0
- package/lib/components/table/Actions/index.js +4 -1
- 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/index.d.ts +4 -0
- package/lib/components/table/Table/utils.d.ts +161 -0
- package/lib/components/table/Table/utils.js +18 -1
- package/lib/components/table/hooks/useTableSetting.d.ts +21 -0
- package/lib/components/table/hooks/useTableSetting.js +114 -4
- package/lib/components/table/hooks/useTransDataSource.d.ts +11 -0
- package/lib/components/table/index.js +12 -1
- package/lib/components/table/types.d.ts +268 -0
- package/lib/components/translation/index.d.ts +14 -0
- package/lib/components/versionModal/index.d.ts +23 -0
- package/lib/components/versionSelect/index.d.ts +1 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +19 -2
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +45 -27
- package/lib/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.js +179 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.less +77 -0
- package/lib/components/virtualInput/index.d.ts +24 -0
- package/lib/components/virtualInput/index.js +102 -0
- package/lib/components/virtualInput/index.less +42 -0
- package/lib/components/walletCard/index.d.ts +71 -0
- package/lib/index.d.ts +144 -0
- package/lib/index.js +9 -0
- package/lib/locales/en-US.d.ts +307 -0
- package/lib/locales/en-US.js +25 -1
- package/lib/locales/zh-CN.d.ts +302 -0
- package/lib/locales/zh-CN.js +25 -1
- package/lib/locales/zh-TW.d.ts +302 -0
- package/lib/locales/zh-TW.js +25 -1
- package/lib/utils/platform.d.ts +1 -1
- package/lowcode/auto-resize-text/meta.ts +47 -0
- package/lowcode/data-source-table/meta.ts +358 -66
- package/lowcode/form-item-upload/meta.ts +20 -5
- package/lowcode/table/meta.ts +104 -0
- package/package.json +3 -2
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
getInitialValues: () => Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 处理table的props
|
|
16
|
+
* 转换title
|
|
17
|
+
* @param props
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
21
|
+
currentComponentId: any;
|
|
22
|
+
title: number | boolean | JSX.Element | React.ReactFragment | (() => React.ReactNode) | null | undefined;
|
|
23
|
+
pagination: {
|
|
24
|
+
total: number;
|
|
25
|
+
current: number;
|
|
26
|
+
pageSize: number;
|
|
27
|
+
size: string;
|
|
28
|
+
showSizeChanger: boolean;
|
|
29
|
+
};
|
|
30
|
+
columns: import("./useColumns").Column[];
|
|
31
|
+
subTitle: number | boolean | JSX.Element | React.ReactFragment | (() => React.ReactNode) | null | undefined;
|
|
32
|
+
buttons: any[] | null;
|
|
33
|
+
filter: {
|
|
34
|
+
dom: any;
|
|
35
|
+
items: any;
|
|
36
|
+
} | null;
|
|
37
|
+
onRow: (record: any) => any;
|
|
38
|
+
actionButtons: any[] | null;
|
|
39
|
+
__id?: string | undefined;
|
|
40
|
+
currentSettingKey?: string | undefined;
|
|
41
|
+
titleButtons?: {
|
|
42
|
+
show: boolean;
|
|
43
|
+
maxCount: number;
|
|
44
|
+
items: OperationItem[];
|
|
45
|
+
} | undefined;
|
|
46
|
+
tableButtons?: {
|
|
47
|
+
show: boolean;
|
|
48
|
+
maxCount: number;
|
|
49
|
+
items: OperationItem[];
|
|
50
|
+
} | undefined;
|
|
51
|
+
operation?: {
|
|
52
|
+
show: boolean;
|
|
53
|
+
title: string;
|
|
54
|
+
width: number;
|
|
55
|
+
align: "center" | "left" | "right";
|
|
56
|
+
fixed: false | "left" | "right";
|
|
57
|
+
type: "link" | "button";
|
|
58
|
+
items: OperationItem[];
|
|
59
|
+
} | undefined;
|
|
60
|
+
operationContent?: {
|
|
61
|
+
[key: string]: React.ReactNode;
|
|
62
|
+
} | undefined;
|
|
63
|
+
dataSource: import("../../provider/dataSource/DataSourceContext").DataSourceType;
|
|
64
|
+
search?: {
|
|
65
|
+
show: boolean;
|
|
66
|
+
placeholder: string;
|
|
67
|
+
} | undefined;
|
|
68
|
+
__designMode: string;
|
|
69
|
+
componentId: string;
|
|
70
|
+
clickToDetail?: {
|
|
71
|
+
show: boolean;
|
|
72
|
+
useCustomAction: boolean;
|
|
73
|
+
actionType: string;
|
|
74
|
+
openMode: "modal" | "drawer";
|
|
75
|
+
openContentSize: "small" | "large" | "middle";
|
|
76
|
+
openTitle: string;
|
|
77
|
+
key: string;
|
|
78
|
+
} | undefined;
|
|
79
|
+
filterBy?: Record<string, any> | undefined;
|
|
80
|
+
sortBy: string;
|
|
81
|
+
tabs?: {
|
|
82
|
+
show: boolean;
|
|
83
|
+
type: string;
|
|
84
|
+
items: {
|
|
85
|
+
name: string;
|
|
86
|
+
filterBy: Record<string, any>;
|
|
87
|
+
sortBy: string;
|
|
88
|
+
}[];
|
|
89
|
+
} | undefined;
|
|
90
|
+
onValuesChange?: ((changedValues: any, values: any) => void) | undefined;
|
|
91
|
+
extraParams?: {
|
|
92
|
+
list?: Record<string, any> | undefined;
|
|
93
|
+
get?: Record<string, any> | undefined;
|
|
94
|
+
update?: Record<string, any> | undefined;
|
|
95
|
+
create?: Record<string, any> | undefined;
|
|
96
|
+
destroy?: Record<string, any> | undefined;
|
|
97
|
+
} | undefined;
|
|
98
|
+
localSettings?: import("../../../table/types").LocalSettingsType | undefined;
|
|
99
|
+
};
|
|
100
|
+
export default useTableProps;
|
|
@@ -35,7 +35,8 @@ var useTableProps = function useTableProps(props) {
|
|
|
35
35
|
closeDrawer = props.closeDrawer,
|
|
36
36
|
refreshData = props.refreshData,
|
|
37
37
|
handleFilterChange = props.handleFilterChange,
|
|
38
|
-
tableRef = props.tableRef
|
|
38
|
+
tableRef = props.tableRef,
|
|
39
|
+
getInitialValues = props.getInitialValues;
|
|
39
40
|
var propsTitle = originProps.title,
|
|
40
41
|
propsSubTitle = originProps.subTitle,
|
|
41
42
|
titleButtons = originProps.titleButtons,
|
|
@@ -45,7 +46,9 @@ var useTableProps = function useTableProps(props) {
|
|
|
45
46
|
search = originProps.search,
|
|
46
47
|
clickToDetail = originProps.clickToDetail,
|
|
47
48
|
propsOnRow = originProps.onRow,
|
|
48
|
-
filterBy = originProps.filterBy
|
|
49
|
+
filterBy = originProps.filterBy,
|
|
50
|
+
currentSettingKey = originProps.currentSettingKey,
|
|
51
|
+
__id = originProps.__id;
|
|
49
52
|
var _ref = operation || {},
|
|
50
53
|
items = _ref.items,
|
|
51
54
|
show = _ref.show,
|
|
@@ -109,7 +112,7 @@ var useTableProps = function useTableProps(props) {
|
|
|
109
112
|
|
|
110
113
|
// 删除记录
|
|
111
114
|
var handleDelete = useMemoizedFn( /*#__PURE__*/function () {
|
|
112
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(record, softDelete) {
|
|
115
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(record, softDelete, customDeleteAction) {
|
|
113
116
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
114
117
|
while (1) switch (_context2.prev = _context2.next) {
|
|
115
118
|
case 0:
|
|
@@ -122,27 +125,38 @@ var useTableProps = function useTableProps(props) {
|
|
|
122
125
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
123
126
|
while (1) switch (_context.prev = _context.next) {
|
|
124
127
|
case 0:
|
|
128
|
+
if (!customDeleteAction) {
|
|
129
|
+
_context.next = 5;
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
_context.next = 3;
|
|
133
|
+
return customDeleteAction(record);
|
|
134
|
+
case 3:
|
|
135
|
+
_context.next = 13;
|
|
136
|
+
break;
|
|
137
|
+
case 5:
|
|
125
138
|
if (!softDelete) {
|
|
126
|
-
_context.next =
|
|
139
|
+
_context.next = 11;
|
|
127
140
|
break;
|
|
128
141
|
}
|
|
142
|
+
// 软删除
|
|
129
143
|
deleteTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
130
|
-
_context.next =
|
|
144
|
+
_context.next = 9;
|
|
131
145
|
return update === null || update === void 0 ? void 0 : update.runAsync(_objectSpread(_objectSpread({}, record), {}, {
|
|
132
146
|
deleted_at: deleteTime
|
|
133
147
|
}));
|
|
134
|
-
case
|
|
135
|
-
_context.next =
|
|
148
|
+
case 9:
|
|
149
|
+
_context.next = 13;
|
|
136
150
|
break;
|
|
137
|
-
case
|
|
138
|
-
_context.next =
|
|
151
|
+
case 11:
|
|
152
|
+
_context.next = 13;
|
|
139
153
|
return destroy === null || destroy === void 0 ? void 0 : destroy.runAsync(record.id);
|
|
140
|
-
case
|
|
154
|
+
case 13:
|
|
141
155
|
refreshData();
|
|
142
156
|
PisellToast({
|
|
143
157
|
content: getText('pisell-action-delete-success')
|
|
144
158
|
});
|
|
145
|
-
case
|
|
159
|
+
case 15:
|
|
146
160
|
case "end":
|
|
147
161
|
return _context.stop();
|
|
148
162
|
}
|
|
@@ -160,7 +174,7 @@ var useTableProps = function useTableProps(props) {
|
|
|
160
174
|
}
|
|
161
175
|
}, _callee2);
|
|
162
176
|
}));
|
|
163
|
-
return function (_x, _x2) {
|
|
177
|
+
return function (_x, _x2, _x3) {
|
|
164
178
|
return _ref2.apply(this, arguments);
|
|
165
179
|
};
|
|
166
180
|
}());
|
|
@@ -192,7 +206,7 @@ var useTableProps = function useTableProps(props) {
|
|
|
192
206
|
okText: getText('pisell-delete-confirm-ok'),
|
|
193
207
|
cancelText: getText('pisell-delete-confirm-cancel'),
|
|
194
208
|
onOk: function onOk() {
|
|
195
|
-
handleDelete(record, item === null || item === void 0 ? void 0 : item.softDelete);
|
|
209
|
+
handleDelete(record, item === null || item === void 0 ? void 0 : item.softDelete, item === null || item === void 0 ? void 0 : item.customDeleteAction);
|
|
196
210
|
}
|
|
197
211
|
});
|
|
198
212
|
return;
|
|
@@ -279,12 +293,17 @@ var useTableProps = function useTableProps(props) {
|
|
|
279
293
|
if (!(propsFilter !== null && propsFilter !== void 0 && propsFilter.show) && !(search !== null && search !== void 0 && search.show)) {
|
|
280
294
|
return null;
|
|
281
295
|
}
|
|
282
|
-
|
|
296
|
+
var dom = /*#__PURE__*/React.createElement(Filter, _extends({}, propsFilter, {
|
|
283
297
|
componentId: componentId,
|
|
284
298
|
search: search,
|
|
285
299
|
handleValuesChange: handleFilterChange,
|
|
286
|
-
filterBy: filterBy
|
|
300
|
+
filterBy: filterBy,
|
|
301
|
+
getInitialValues: getInitialValues
|
|
287
302
|
}));
|
|
303
|
+
return {
|
|
304
|
+
dom: dom,
|
|
305
|
+
items: propsFilter === null || propsFilter === void 0 ? void 0 : propsFilter.items
|
|
306
|
+
};
|
|
288
307
|
}, [propsFilter, search]);
|
|
289
308
|
var onRow = useMemoizedFn(function (record) {
|
|
290
309
|
if (!(clickToDetail !== null && clickToDetail !== void 0 && clickToDetail.show)) {
|
|
@@ -315,6 +334,7 @@ var useTableProps = function useTableProps(props) {
|
|
|
315
334
|
});
|
|
316
335
|
});
|
|
317
336
|
return _objectSpread(_objectSpread({}, originProps), {}, {
|
|
337
|
+
currentComponentId: componentId,
|
|
318
338
|
title: title,
|
|
319
339
|
pagination: pagination,
|
|
320
340
|
columns: columns,
|
|
@@ -11,7 +11,7 @@ declare type Params = {
|
|
|
11
11
|
sortBy: string;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
declare const useTableQuery: (props: DataSourceTableProps) => {
|
|
14
|
+
declare const useTableQuery: (props: DataSourceTableProps, currentSettingHash: string) => {
|
|
15
15
|
queryPageConfig: {
|
|
16
16
|
page: number;
|
|
17
17
|
pageSize: number;
|
|
@@ -28,5 +28,6 @@ declare const useTableQuery: (props: DataSourceTableProps) => {
|
|
|
28
28
|
refreshData: () => void;
|
|
29
29
|
handleFilterChange: (changedFields: any, allFields: any) => void;
|
|
30
30
|
refreshCurrentPage: () => void;
|
|
31
|
+
getInitialValues: () => Record<string, any>;
|
|
31
32
|
};
|
|
32
33
|
export default useTableQuery;
|
|
@@ -10,13 +10,24 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
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; }
|
|
11
11
|
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; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import { useState } from 'react';
|
|
13
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
14
14
|
import { useMemoizedFn } from 'ahooks';
|
|
15
|
-
|
|
15
|
+
import { getCurrentViewModeFromLocalStorage, getTableSettingByCurrentViewMode, setTableSettingToLocalStorage } from "../../../table/Table/utils";
|
|
16
|
+
var useTableQuery = function useTableQuery(props, currentSettingHash) {
|
|
16
17
|
var _tabs$items, _tabs$items2;
|
|
17
18
|
var filterBy = props.filterBy,
|
|
18
19
|
sortBy = props.sortBy,
|
|
19
|
-
tabs = props.tabs
|
|
20
|
+
tabs = props.tabs,
|
|
21
|
+
localSettings = props.localSettings;
|
|
22
|
+
var tableId = useMemo(function () {
|
|
23
|
+
if (props.__designMode === 'design') {
|
|
24
|
+
return 'designMode-mock-table-id';
|
|
25
|
+
}
|
|
26
|
+
return (props === null || props === void 0 ? void 0 : props.currentComponentId) || props.__id;
|
|
27
|
+
}, [props.__id, props.__designMode, props === null || props === void 0 ? void 0 : props.currentComponentId]);
|
|
28
|
+
var currentViewMode = useMemo(function () {
|
|
29
|
+
return getCurrentViewModeFromLocalStorage(tableId) || 'grid';
|
|
30
|
+
}, [tableId]);
|
|
20
31
|
|
|
21
32
|
// 分页配置
|
|
22
33
|
var _useState = useState({
|
|
@@ -28,19 +39,50 @@ var useTableQuery = function useTableQuery(props) {
|
|
|
28
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
40
|
queryPageConfig = _useState2[0],
|
|
30
41
|
setQueryPageConfig = _useState2[1];
|
|
42
|
+
var getInitialValues = useMemoizedFn(function () {
|
|
43
|
+
try {
|
|
44
|
+
if (!tableId) return {};
|
|
45
|
+
var setting = getTableSettingByCurrentViewMode(tableId, currentViewMode);
|
|
46
|
+
console.log('setting22', setting);
|
|
47
|
+
return (setting === null || setting === void 0 ? void 0 : setting.filters) || {};
|
|
48
|
+
} catch (e) {
|
|
49
|
+
return {};
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// 初始读取本地 filters(若开启本地记忆且 scope 包含 filters)
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
var _localSettings$scope;
|
|
56
|
+
if (!tableId) return;
|
|
57
|
+
var enable = !!(localSettings !== null && localSettings !== void 0 && localSettings.enable && (_localSettings$scope = localSettings.scope) !== null && _localSettings$scope !== void 0 && _localSettings$scope.includes('filters'));
|
|
58
|
+
if (!enable) return;
|
|
59
|
+
var setting = getTableSettingByCurrentViewMode(tableId, currentViewMode);
|
|
60
|
+
var persisted = (setting === null || setting === void 0 ? void 0 : setting.filters) || {};
|
|
61
|
+
if (persisted && Object.keys(persisted).length > 0) {
|
|
62
|
+
setQueryPageConfig(function (prev) {
|
|
63
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
64
|
+
filter: _objectSpread(_objectSpread({}, prev.filter), persisted)
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, [tableId, currentViewMode, JSON.stringify(localSettings)]);
|
|
31
69
|
|
|
32
70
|
// 分页变化
|
|
33
71
|
var handleValuesChange = useMemoizedFn(function (params, allParams) {
|
|
72
|
+
var _localSettings$scope2;
|
|
34
73
|
var _ref = params.pagination || {},
|
|
35
74
|
page = _ref.page,
|
|
36
75
|
size = _ref.size;
|
|
76
|
+
var nextFilterForSave = null;
|
|
37
77
|
setQueryPageConfig(function (prev) {
|
|
38
78
|
var sort = prev.sort || sortBy;
|
|
39
79
|
var filter = prev.filter;
|
|
40
80
|
if ("tabs" in params) {
|
|
41
81
|
var _params$tabs, _params$tabs2;
|
|
42
82
|
sort = ((_params$tabs = params.tabs) === null || _params$tabs === void 0 ? void 0 : _params$tabs.sortBy) || sortBy || "";
|
|
43
|
-
|
|
83
|
+
var tabsFilter = ((_params$tabs2 = params.tabs) === null || _params$tabs2 === void 0 ? void 0 : _params$tabs2.filterBy) || {};
|
|
84
|
+
filter = _objectSpread(_objectSpread({}, prev.filter), tabsFilter);
|
|
85
|
+
nextFilterForSave = filter;
|
|
44
86
|
}
|
|
45
87
|
if ("order_by" in params) {
|
|
46
88
|
var _allParams$tabs;
|
|
@@ -53,14 +95,57 @@ var useTableQuery = function useTableQuery(props) {
|
|
|
53
95
|
filter: filter
|
|
54
96
|
});
|
|
55
97
|
});
|
|
98
|
+
|
|
99
|
+
// 当 tabs 变化导致 filter 变更时,同步写入本地(遵循 localSettings)
|
|
100
|
+
var enable = !!(localSettings !== null && localSettings !== void 0 && localSettings.enable && (_localSettings$scope2 = localSettings.scope) !== null && _localSettings$scope2 !== void 0 && _localSettings$scope2.includes('filters'));
|
|
101
|
+
if (enable && tableId && nextFilterForSave) {
|
|
102
|
+
var excluded = new Set((localSettings === null || localSettings === void 0 ? void 0 : localSettings.excludedFilterFields) || []);
|
|
103
|
+
var filtered = {};
|
|
104
|
+
Object.keys(nextFilterForSave).forEach(function (k) {
|
|
105
|
+
if (!excluded.has(k)) {
|
|
106
|
+
filtered[k] = nextFilterForSave[k];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
setTableSettingToLocalStorage({
|
|
110
|
+
tableId: tableId,
|
|
111
|
+
tableSettingObj: {
|
|
112
|
+
filters: filtered
|
|
113
|
+
},
|
|
114
|
+
currentViewMode: currentViewMode,
|
|
115
|
+
currentSettingHash: currentSettingHash
|
|
116
|
+
});
|
|
117
|
+
}
|
|
56
118
|
});
|
|
57
119
|
var handleFilterChange = useMemoizedFn(function (changedFields, allFields) {
|
|
120
|
+
var _localSettings$scope3;
|
|
121
|
+
var nextFilter = _objectSpread({}, allFields);
|
|
58
122
|
setQueryPageConfig(function (prev) {
|
|
59
123
|
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
60
124
|
page: 1,
|
|
61
|
-
filter: _objectSpread(_objectSpread(_objectSpread({}, prev.filter),
|
|
125
|
+
filter: _objectSpread(_objectSpread(_objectSpread({}, prev.filter), nextFilter), filterBy || {})
|
|
62
126
|
});
|
|
63
127
|
});
|
|
128
|
+
|
|
129
|
+
// 写入本地(仅当开启本地记忆且 scope 包含 filters)
|
|
130
|
+
var enable = !!(localSettings !== null && localSettings !== void 0 && localSettings.enable && (_localSettings$scope3 = localSettings.scope) !== null && _localSettings$scope3 !== void 0 && _localSettings$scope3.includes('filters'));
|
|
131
|
+
if (enable && tableId) {
|
|
132
|
+
// 按 excludedFilterFields 过滤写入
|
|
133
|
+
var excluded = new Set((localSettings === null || localSettings === void 0 ? void 0 : localSettings.excludedFilterFields) || []);
|
|
134
|
+
var filtered = {};
|
|
135
|
+
Object.keys(nextFilter || {}).forEach(function (k) {
|
|
136
|
+
if (!excluded.has(k)) {
|
|
137
|
+
filtered[k] = nextFilter[k];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
setTableSettingToLocalStorage({
|
|
141
|
+
tableId: tableId,
|
|
142
|
+
tableSettingObj: {
|
|
143
|
+
filters: filtered
|
|
144
|
+
},
|
|
145
|
+
currentViewMode: currentViewMode,
|
|
146
|
+
currentSettingHash: currentSettingHash
|
|
147
|
+
});
|
|
148
|
+
}
|
|
64
149
|
});
|
|
65
150
|
var refreshData = useMemoizedFn(function () {
|
|
66
151
|
setQueryPageConfig(function (prev) {
|
|
@@ -80,7 +165,8 @@ var useTableQuery = function useTableQuery(props) {
|
|
|
80
165
|
handleValuesChange: handleValuesChange,
|
|
81
166
|
refreshData: refreshData,
|
|
82
167
|
handleFilterChange: handleFilterChange,
|
|
83
|
-
refreshCurrentPage: refreshCurrentPage
|
|
168
|
+
refreshCurrentPage: refreshCurrentPage,
|
|
169
|
+
getInitialValues: getInitialValues
|
|
84
170
|
};
|
|
85
171
|
};
|
|
86
172
|
export default useTableQuery;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ColumnType } from 'antd/es/table';
|
|
3
|
+
import { LocalSettingsType } from '../../table/types';
|
|
4
|
+
import { DataSourceType } from '../provider/dataSource/DataSourceContext';
|
|
5
|
+
export declare type OperationItem = {
|
|
6
|
+
label?: string;
|
|
7
|
+
openMode: 'modal' | 'drawer' | 'custom';
|
|
8
|
+
openContentSize: 'small' | 'middle' | 'large';
|
|
9
|
+
openTitle: string;
|
|
10
|
+
actionType: 'detail' | 'edit' | 'delete' | 'custom';
|
|
11
|
+
key: string;
|
|
12
|
+
buttonProps?: any;
|
|
13
|
+
onClick?: (record: any) => void;
|
|
14
|
+
afterClose?: () => void;
|
|
15
|
+
};
|
|
16
|
+
export interface DataSourceTableProps {
|
|
17
|
+
__id?: string;
|
|
18
|
+
currentComponentId?: string;
|
|
19
|
+
currentSettingKey?: string;
|
|
20
|
+
title?: string | React.ReactNode | (() => React.ReactNode);
|
|
21
|
+
subTitle?: string | React.ReactNode | (() => React.ReactNode);
|
|
22
|
+
titleButtons?: {
|
|
23
|
+
show: boolean;
|
|
24
|
+
maxCount: number;
|
|
25
|
+
items: OperationItem[];
|
|
26
|
+
};
|
|
27
|
+
tableButtons?: {
|
|
28
|
+
show: boolean;
|
|
29
|
+
maxCount: number;
|
|
30
|
+
items: OperationItem[];
|
|
31
|
+
};
|
|
32
|
+
buttons?: any[];
|
|
33
|
+
operation?: {
|
|
34
|
+
show: boolean;
|
|
35
|
+
title: string;
|
|
36
|
+
width: number;
|
|
37
|
+
align: 'left' | 'center' | 'right';
|
|
38
|
+
fixed: 'left' | 'right' | false;
|
|
39
|
+
type: 'link' | 'button';
|
|
40
|
+
items: OperationItem[];
|
|
41
|
+
};
|
|
42
|
+
operationContent?: {
|
|
43
|
+
[key: string]: React.ReactNode;
|
|
44
|
+
};
|
|
45
|
+
dataSource: DataSourceType;
|
|
46
|
+
columns: ColumnType<any>[];
|
|
47
|
+
filter: any;
|
|
48
|
+
search?: {
|
|
49
|
+
show: boolean;
|
|
50
|
+
placeholder: string;
|
|
51
|
+
};
|
|
52
|
+
__designMode: string;
|
|
53
|
+
componentId: string;
|
|
54
|
+
clickToDetail?: {
|
|
55
|
+
show: boolean;
|
|
56
|
+
useCustomAction: boolean;
|
|
57
|
+
actionType: string;
|
|
58
|
+
openMode: 'modal' | 'drawer';
|
|
59
|
+
openContentSize: 'small' | 'middle' | 'large';
|
|
60
|
+
openTitle: string;
|
|
61
|
+
key: string;
|
|
62
|
+
};
|
|
63
|
+
onRow?: any;
|
|
64
|
+
filterBy?: Record<string, any>;
|
|
65
|
+
sortBy: string;
|
|
66
|
+
tabs?: {
|
|
67
|
+
show: boolean;
|
|
68
|
+
type: string;
|
|
69
|
+
items: {
|
|
70
|
+
name: string;
|
|
71
|
+
filterBy: Record<string, any>;
|
|
72
|
+
sortBy: string;
|
|
73
|
+
}[];
|
|
74
|
+
};
|
|
75
|
+
onValuesChange?: (changedValues: any, values: any) => void;
|
|
76
|
+
extraParams?: {
|
|
77
|
+
list?: Record<string, any>;
|
|
78
|
+
get?: Record<string, any>;
|
|
79
|
+
update?: Record<string, any>;
|
|
80
|
+
create?: Record<string, any>;
|
|
81
|
+
destroy?: Record<string, any>;
|
|
82
|
+
};
|
|
83
|
+
localSettings?: LocalSettingsType;
|
|
84
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputProps } from 'antd';
|
|
3
|
+
import { ModeType } from "../../dataSourceForm/type";
|
|
4
|
+
export interface PhoneInputProps extends Omit<InputProps, 'value' | 'onChange'> {
|
|
5
|
+
renderMode: ModeType;
|
|
6
|
+
value?: string;
|
|
7
|
+
onChange?: (value: string) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const MobileNumberInputWithMode: React.FC<PhoneInputProps & import("../../dataSourceForm/utils").WithModeProps>;
|
|
10
|
+
export default MobileNumberInputWithMode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputProps } from 'antd';
|
|
3
|
+
import { ModeType } from "../../dataSourceForm/type";
|
|
4
|
+
export interface PhoneInputProps extends Omit<InputProps, 'value' | 'onChange'> {
|
|
5
|
+
renderMode: ModeType;
|
|
6
|
+
value?: string;
|
|
7
|
+
onChange?: (value: string) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const PhoneNumberInputWithMode: React.FC<PhoneInputProps & import("../../dataSourceForm/utils").WithModeProps>;
|
|
10
|
+
export default PhoneNumberInputWithMode;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取nocobase数据列表
|
|
3
|
+
*/
|
|
4
|
+
export declare const getCountryDataList: () => Promise<any>;
|
|
5
|
+
export interface Country {
|
|
6
|
+
id: number;
|
|
7
|
+
name: {
|
|
8
|
+
en: string;
|
|
9
|
+
"zh-CN": string;
|
|
10
|
+
"zh-HK": string;
|
|
11
|
+
original: string;
|
|
12
|
+
};
|
|
13
|
+
code: string;
|
|
14
|
+
calling_code: string;
|
|
15
|
+
currency_code: string;
|
|
16
|
+
sort: number;
|
|
17
|
+
status: string;
|
|
18
|
+
created_at: string;
|
|
19
|
+
updated_at: string;
|
|
20
|
+
prefix: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const useCountries: () => {
|
|
23
|
+
data: Country[];
|
|
24
|
+
};
|
|
@@ -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;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
declare const SelectWithDataSource: (props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../../dataSourceForm/utils").WithModeProps & import("../../dataSourceForm/utils").WithFormItemProps & {
|
|
2
3
|
options?: any;
|
|
3
|
-
optionSourceType?: "
|
|
4
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
4
5
|
labelField: string;
|
|
5
6
|
valueField: string;
|
|
6
7
|
extraParams?: Record<string, any> | undefined;
|