@pisell/materials 6.4.19 → 6.4.21
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 +145 -145
- package/build/lowcode/render/default/view.js +21 -21
- package/build/lowcode/view.js +21 -21
- package/es/components/colorPicker/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.js +72 -10
- package/es/components/dataSourceComponents/dataSourceForm/formItem.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +16 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.d.ts +8 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +5 -3
- package/es/components/dataSourceComponents/dataSourceForm/serve.d.ts +179 -0
- package/es/components/dataSourceComponents/dataSourceForm/serve.js +93 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +39 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +66 -28
- package/es/components/dataSourceComponents/dataSourceForm/type.d.ts +32 -0
- package/es/components/dataSourceComponents/dataSourceForm/urlUtils.d.ts +24 -0
- package/es/components/dataSourceComponents/dataSourceForm/urlUtils.js +76 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +3 -4
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.d.ts +8 -0
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +39 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +100 -0
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +84 -0
- package/es/components/dataSourceComponents/dataSourceWrapper/index.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -2
- package/es/components/dataSourceComponents/fields/Switch/ReadPretty.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Switch/ReadPretty.js +16 -0
- package/es/components/dataSourceComponents/fields/Switch/ReadPretty.less +2 -0
- package/es/components/dataSourceComponents/fields/Switch/WithMode.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Switch/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/Switch/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Switch/index.js +8 -0
- package/es/components/dataSourceComponents/fields/Switch/type.d.ts +16 -0
- package/es/components/dataSourceComponents/fields/Switch/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +10 -11
- package/es/components/dataSourceComponents/hooks/useActions.d.ts +18 -0
- package/es/components/dataSourceComponents/hooks/useActions.js +20 -14
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +120 -0
- package/es/components/dataSourceComponents/provider/variables/VariablesProvider.d.ts +4 -0
- package/es/components/date-picker/datePickerCpt.d.ts +0 -1
- package/es/components/filter/components/items/index.d.ts +0 -1
- package/es/components/filter/components/items/text/Editor/index.d.ts +0 -1
- package/es/components/filter/components/items/text/Preview/index.d.ts +0 -1
- package/es/components/filter/components/items/text/index.d.ts +0 -1
- package/es/components/filter/index.d.ts +0 -1
- package/es/components/iconfont/index.js +1 -1
- package/es/components/list/index.d.ts +0 -1
- package/es/components/lowCodePage/index.d.ts +0 -1
- package/es/components/page/index.d.ts +6 -0
- package/es/components/pisell-config-provider/index.js +0 -1
- package/es/components/pisellCardList/index.d.ts +4 -0
- package/es/components/pisellCardList/index.js +5 -1
- package/es/components/pisellDatePicker/datePickerCpt.d.ts +0 -1
- package/es/components/pisellInput/components/BankCard/index.d.ts +0 -1
- package/es/components/pisellInput/components/Copy/index.d.ts +0 -1
- package/es/components/pisellInput/components/SecurityCode/index.d.ts +0 -1
- package/es/components/pisellLoading/index.d.ts +0 -1
- package/es/components/pisellTooltip/index.d.ts +0 -1
- package/es/components/pisellWalletPassCard/index.d.ts +4 -0
- package/es/components/pisellWalletPassCard/index.js +17 -4
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/Note/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +27 -0
- package/es/components/productCard/cartSkuCard/components/discountReason/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/packages/index.d.ts +11 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/sales/index.d.ts +13 -0
- package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +7 -0
- package/es/components/productCard/cartSkuCard/index.d.ts +10 -0
- package/es/components/productCard/cartSkuCard/locales.d.ts +96 -0
- package/es/components/productCard/components/AmountFooter/index.d.ts +0 -1
- package/es/components/productCard/components/Header/EditButton/index.d.ts +0 -1
- package/es/components/productCard/components/MultiDay/index.d.ts +0 -1
- package/es/components/productCard/components/Note/index.d.ts +0 -1
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +0 -1
- package/es/components/productCard/components/Packages/components/options/index.d.ts +0 -1
- package/es/components/productCard/components/Packages/index.d.ts +0 -1
- package/es/components/productCard/components/Time/components/SelectHolderMultiple/index.d.ts +0 -1
- package/es/components/productCard/status.d.ts +32 -0
- package/es/components/productCard/types.d.ts +84 -0
- package/es/components/qrcode/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +0 -1
- package/es/components/table/Actions/component/GallerySetting/index.d.ts +0 -1
- package/es/components/table/Actions/component/Group/PopoverContent.d.ts +1 -0
- package/es/components/table/Actions/component/ViewMode/index.d.ts +0 -1
- package/es/components/table/BasicTable/index.d.ts +0 -1
- package/es/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +0 -1
- package/es/components/table/Gallery/components/GalleryItem/components/RenderFields/index.d.ts +0 -1
- package/es/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +0 -1
- package/es/components/table/Table/SelectField/index.d.ts +0 -1
- package/es/components/table/Table/fields/date/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/index.d.ts +2 -3
- package/es/components/table/Table/fields/link/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/select/index.d.ts +0 -1
- 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/fields/treeSelect/index.d.ts +0 -1
- package/es/components/table/Table/tableConfig/SortRow/index.d.ts +0 -1
- package/es/components/table/Table/tableConfig/summary/index.d.ts +0 -1
- package/es/components/table/TableFilter/SortIcon.d.ts +1 -0
- package/es/components/table/View/index.d.ts +0 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locales/en-US.js +1 -0
- package/es/locales/zh-CN.js +1 -0
- package/es/locales/zh-TW.js +1 -0
- package/lib/components/colorPicker/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.js +41 -3
- package/lib/components/dataSourceComponents/dataSourceForm/formItem.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +16 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.d.ts +8 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +5 -3
- package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +179 -0
- package/lib/components/dataSourceComponents/dataSourceForm/serve.js +45 -2
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +39 -0
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +23 -2
- package/lib/components/dataSourceComponents/dataSourceForm/type.d.ts +32 -0
- package/lib/components/dataSourceComponents/dataSourceForm/urlUtils.d.ts +24 -0
- package/lib/components/dataSourceComponents/dataSourceForm/urlUtils.js +68 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +3 -3
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.d.ts +8 -0
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +39 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +100 -0
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +84 -0
- package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -2
- package/lib/components/dataSourceComponents/fields/Switch/ReadPretty.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Switch/ReadPretty.js +52 -0
- package/lib/components/dataSourceComponents/fields/Switch/ReadPretty.less +2 -0
- package/lib/components/dataSourceComponents/fields/Switch/WithMode.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Switch/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/Switch/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Switch/index.js +42 -0
- package/lib/components/dataSourceComponents/fields/Switch/type.d.ts +16 -0
- package/lib/components/dataSourceComponents/fields/Switch/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +10 -11
- package/lib/components/dataSourceComponents/hooks/useActions.d.ts +18 -0
- package/lib/components/dataSourceComponents/hooks/useActions.js +3 -0
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +120 -0
- package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.d.ts +4 -0
- package/lib/components/date-picker/datePickerCpt.d.ts +0 -1
- package/lib/components/filter/components/items/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/Editor/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/Preview/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/index.d.ts +0 -1
- package/lib/components/filter/index.d.ts +0 -1
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/list/index.d.ts +0 -1
- package/lib/components/lowCodePage/index.d.ts +0 -1
- package/lib/components/page/index.d.ts +6 -0
- package/lib/components/pisell-config-provider/index.js +0 -1
- package/lib/components/pisellCardList/index.d.ts +4 -0
- package/lib/components/pisellCardList/index.js +5 -1
- package/lib/components/pisellDatePicker/datePickerCpt.d.ts +0 -1
- package/lib/components/pisellInput/components/BankCard/index.d.ts +0 -1
- package/lib/components/pisellInput/components/Copy/index.d.ts +0 -1
- package/lib/components/pisellInput/components/SecurityCode/index.d.ts +0 -1
- package/lib/components/pisellLoading/index.d.ts +0 -1
- package/lib/components/pisellTooltip/index.d.ts +0 -1
- package/lib/components/pisellWalletPassCard/index.d.ts +4 -0
- package/lib/components/pisellWalletPassCard/index.js +12 -2
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/Note/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +27 -0
- package/lib/components/productCard/cartSkuCard/components/discountReason/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/packages/index.d.ts +11 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/sales/index.d.ts +13 -0
- package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +7 -0
- package/lib/components/productCard/cartSkuCard/index.d.ts +10 -0
- package/lib/components/productCard/cartSkuCard/locales.d.ts +96 -0
- package/lib/components/productCard/components/AmountFooter/index.d.ts +0 -1
- package/lib/components/productCard/components/Header/EditButton/index.d.ts +0 -1
- package/lib/components/productCard/components/MultiDay/index.d.ts +0 -1
- package/lib/components/productCard/components/Note/index.d.ts +0 -1
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +0 -1
- package/lib/components/productCard/components/Packages/components/options/index.d.ts +0 -1
- package/lib/components/productCard/components/Packages/index.d.ts +0 -1
- package/lib/components/productCard/components/Time/components/SelectHolderMultiple/index.d.ts +0 -1
- package/lib/components/productCard/status.d.ts +32 -0
- package/lib/components/productCard/types.d.ts +84 -0
- package/lib/components/qrcode/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +0 -1
- package/lib/components/table/Actions/component/GallerySetting/index.d.ts +0 -1
- package/lib/components/table/Actions/component/Group/PopoverContent.d.ts +1 -0
- package/lib/components/table/Actions/component/ViewMode/index.d.ts +0 -1
- package/lib/components/table/BasicTable/index.d.ts +0 -1
- package/lib/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +0 -1
- package/lib/components/table/Gallery/components/GalleryItem/components/RenderFields/index.d.ts +0 -1
- package/lib/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +0 -1
- package/lib/components/table/Table/SelectField/index.d.ts +0 -1
- package/lib/components/table/Table/fields/date/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/index.d.ts +2 -3
- package/lib/components/table/Table/fields/link/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/select/index.d.ts +0 -1
- 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/fields/treeSelect/index.d.ts +0 -1
- package/lib/components/table/Table/tableConfig/SortRow/index.d.ts +0 -1
- package/lib/components/table/Table/tableConfig/summary/index.d.ts +0 -1
- package/lib/components/table/TableFilter/SortIcon.d.ts +1 -0
- package/lib/components/table/View/index.d.ts +0 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/locales/en-US.js +1 -0
- package/lib/locales/zh-CN.js +1 -0
- package/lib/locales/zh-TW.js +1 -0
- package/lowcode/data-source-form/constants.ts +3 -0
- package/lowcode/data-source-form/meta.ts +90 -31
- package/lowcode/data-source-form/utils.ts +132 -19
- package/lowcode/form-item-switch/meta.ts +145 -0
- package/lowcode/form-item-switch/snippets.ts +15 -0
- package/package.json +3 -3
- package/es/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +0 -24
- package/es/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +0 -25
- package/es/components/dataSourceComponents/hooks/usePlatform.d.ts +0 -5
- package/es/components/filter/types.d.ts +0 -46
- package/es/components/iconfont/index.d.ts +0 -8
- package/es/components/pisellAdjustPrice/index.d.ts +0 -4
- package/es/components/pisellEmpty/index.d.ts +0 -19
- package/es/components/pisellQRScanner/index.d.ts +0 -24
- package/es/components/pisellText/components/Editable/index.d.ts +0 -29
- package/es/components/pisellText/index.d.ts +0 -9
- package/es/components/productCard/components/Time/components/SelectResource/index.d.ts +0 -18
- package/es/components/select/index.d.ts +0 -9
- package/es/components/sortableList/index.d.ts +0 -11
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +0 -7
- package/es/components/table/Actions/index.d.ts +0 -18
- package/es/components/table/Table/index.d.ts +0 -4
- package/es/components/table/hooks/useTransColumns.d.ts +0 -14
- package/es/components/table/index.d.ts +0 -4
- package/es/components/table/serve.d.ts +0 -13
- package/es/components/tabs/index.d.ts +0 -17
- package/es/components/virtual-keyboard/Amount/index.d.ts +0 -5
- package/es/components/virtual-keyboard/Amount/types.d.ts +0 -44
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -25
- package/es/components/virtual-keyboard/Number/index.d.ts +0 -6
- package/es/components/walletCard/index.d.ts +0 -71
- package/es/locales/en-US.d.ts +0 -307
- package/es/locales/zh-CN.d.ts +0 -302
- package/es/locales/zh-TW.d.ts +0 -302
- package/lib/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +0 -24
- package/lib/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +0 -25
- package/lib/components/dataSourceComponents/hooks/usePlatform.d.ts +0 -5
- package/lib/components/filter/types.d.ts +0 -46
- package/lib/components/iconfont/index.d.ts +0 -8
- package/lib/components/pisellAdjustPrice/index.d.ts +0 -4
- package/lib/components/pisellEmpty/index.d.ts +0 -19
- package/lib/components/pisellQRScanner/index.d.ts +0 -24
- package/lib/components/pisellText/components/Editable/index.d.ts +0 -29
- package/lib/components/pisellText/index.d.ts +0 -9
- package/lib/components/productCard/components/Time/components/SelectResource/index.d.ts +0 -18
- package/lib/components/select/index.d.ts +0 -9
- package/lib/components/sortableList/index.d.ts +0 -11
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +0 -7
- package/lib/components/table/Actions/index.d.ts +0 -18
- package/lib/components/table/Table/index.d.ts +0 -4
- package/lib/components/table/hooks/useTransColumns.d.ts +0 -14
- package/lib/components/table/index.d.ts +0 -4
- package/lib/components/table/serve.d.ts +0 -13
- package/lib/components/tabs/index.d.ts +0 -17
- package/lib/components/virtual-keyboard/Amount/index.d.ts +0 -5
- package/lib/components/virtual-keyboard/Amount/types.d.ts +0 -44
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -25
- package/lib/components/virtual-keyboard/Number/index.d.ts +0 -6
- package/lib/components/walletCard/index.d.ts +0 -71
- package/lib/locales/en-US.d.ts +0 -307
- package/lib/locales/zh-CN.d.ts +0 -302
- package/lib/locales/zh-TW.d.ts +0 -302
|
@@ -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: string | number | boolean | React.ReactFragment | JSX.Element | (() => 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: string | number | boolean | React.ReactFragment | JSX.Element | (() => 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: "button" | "link";
|
|
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" | "middle" | "large";
|
|
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;
|
|
@@ -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
|
+
}
|
|
@@ -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;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
declare const SelectWithDataSource: (props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../../dataSourceForm/utils").WithModeProps & import("../../dataSourceForm/utils").WithFormItemProps & {
|
|
3
2
|
options?: any;
|
|
4
|
-
optionSourceType?: "default" | "
|
|
3
|
+
optionSourceType?: "default" | "api" | "custom" | undefined;
|
|
5
4
|
labelField: string;
|
|
6
5
|
valueField: string;
|
|
7
6
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/fields/Switch/ReadPretty.tsx
|
|
30
|
+
var ReadPretty_exports = {};
|
|
31
|
+
__export(ReadPretty_exports, {
|
|
32
|
+
default: () => ReadPretty_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ReadPretty_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_iconfont = __toESM(require("../../../iconfont"));
|
|
37
|
+
var import_ReadPretty = require("./ReadPretty.less");
|
|
38
|
+
var SwitchReadPretty = (props) => {
|
|
39
|
+
const { value, checked } = props;
|
|
40
|
+
const isChecked = value !== void 0 ? value : checked;
|
|
41
|
+
return isChecked ? /* @__PURE__ */ import_react.default.createElement(
|
|
42
|
+
import_iconfont.default,
|
|
43
|
+
{
|
|
44
|
+
type: "pisell2-check",
|
|
45
|
+
style: {
|
|
46
|
+
color: "var(--theme-color)",
|
|
47
|
+
fontSize: 20
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
) : null;
|
|
51
|
+
};
|
|
52
|
+
var ReadPretty_default = SwitchReadPretty;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/fields/Switch/WithMode.ts
|
|
30
|
+
var WithMode_exports = {};
|
|
31
|
+
__export(WithMode_exports, {
|
|
32
|
+
default: () => WithMode_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(WithMode_exports);
|
|
35
|
+
var import_utils = require("../../dataSourceForm/utils");
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_ReadPretty = __toESM(require("./ReadPretty"));
|
|
38
|
+
var SwitchWithMode = (0, import_utils.withMode)(import_antd.Switch, import_ReadPretty.default);
|
|
39
|
+
var WithMode_default = SwitchWithMode;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/fields/Switch/index.tsx
|
|
30
|
+
var Switch_exports = {};
|
|
31
|
+
__export(Switch_exports, {
|
|
32
|
+
default: () => Switch_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Switch_exports);
|
|
35
|
+
var import_WithMode = __toESM(require("./WithMode"));
|
|
36
|
+
var import_utils = require("../../dataSourceForm/utils");
|
|
37
|
+
var Switch = (0, import_utils.withFormItem)(import_WithMode.default, {
|
|
38
|
+
otherFormItemProps: {
|
|
39
|
+
valuePropName: "checked"
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
var Switch_default = Switch;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface SwitchProps {
|
|
3
|
+
value?: boolean;
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
defaultChecked?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
size?: 'default' | 'small';
|
|
9
|
+
checkedChildren?: React.ReactNode;
|
|
10
|
+
unCheckedChildren?: React.ReactNode;
|
|
11
|
+
autoFocus?: boolean;
|
|
12
|
+
onChange?: (checked: boolean, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
+
onClick?: (checked: boolean, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
14
|
+
renderMode?: 'view' | 'edit' | 'disabled' | 'hidden';
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/components/dataSourceComponents/fields/Switch/type.ts
|
|
16
|
+
var type_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(type_exports);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
declare const formFieldMap: {
|
|
3
2
|
FormItemCheckbox: import("react").FC<{}> & {
|
|
4
3
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
@@ -20,7 +19,7 @@ declare const formFieldMap: {
|
|
|
20
19
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
21
20
|
onChange: (value: string) => void;
|
|
22
21
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
23
|
-
rootDomain: "custom" | "
|
|
22
|
+
rootDomain: "custom" | "xzero" | "saas";
|
|
24
23
|
customDomain?: string | undefined;
|
|
25
24
|
value?: string | undefined;
|
|
26
25
|
tenantId: string;
|
|
@@ -35,7 +34,7 @@ declare const formFieldMap: {
|
|
|
35
34
|
};
|
|
36
35
|
FormItemSelect: (props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
37
36
|
options?: any;
|
|
38
|
-
optionSourceType?: "default" | "
|
|
37
|
+
optionSourceType?: "default" | "api" | "custom" | undefined;
|
|
39
38
|
labelField: string;
|
|
40
39
|
valueField: string;
|
|
41
40
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -60,13 +59,11 @@ declare const formFieldMap: {
|
|
|
60
59
|
FormItemTranslation: import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
61
60
|
FormItemIconSelect: import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
62
61
|
};
|
|
63
|
-
declare const getFieldComponent: (fieldComponent: string) =>
|
|
62
|
+
declare const getFieldComponent: (fieldComponent: string) => (import("react").FC<{}> & {
|
|
64
63
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
65
64
|
} & {
|
|
66
65
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
67
|
-
}) | 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("
|
|
68
|
-
onChange: (value: string) => void;
|
|
69
|
-
} & 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> & {
|
|
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("./Input/type").InputProps> & {
|
|
70
67
|
JSON: import("react").FC<any>;
|
|
71
68
|
Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
72
69
|
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>;
|
|
@@ -79,24 +76,26 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
79
76
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
80
77
|
onChange: (value: string) => void;
|
|
81
78
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
82
|
-
rootDomain: "custom" | "
|
|
79
|
+
rootDomain: "custom" | "xzero" | "saas";
|
|
83
80
|
customDomain?: string | undefined;
|
|
84
81
|
value?: string | undefined;
|
|
85
82
|
tenantId: string;
|
|
86
83
|
name?: string | undefined;
|
|
87
84
|
fieldKey?: string | undefined;
|
|
88
85
|
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
89
|
-
}) |
|
|
86
|
+
}) | (import("react").FC<{}> & {
|
|
90
87
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
91
88
|
} & {
|
|
92
89
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
93
90
|
}) | ((props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
94
91
|
options?: any;
|
|
95
|
-
optionSourceType?: "default" | "
|
|
92
|
+
optionSourceType?: "default" | "api" | "custom" | undefined;
|
|
96
93
|
labelField: string;
|
|
97
94
|
valueField: string;
|
|
98
95
|
extraParams?: Record<string, any> | undefined;
|
|
99
96
|
} & {
|
|
100
97
|
dataSource?: any;
|
|
101
|
-
}) => JSX.Element) | import("react").FC<
|
|
98
|
+
}) => JSX.Element) | import("react").FC<any> | 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>;
|
|
102
101
|
export { getFieldComponent, formFieldMap };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DataSourceType } from '../provider/dataSource/DataSourceContext';
|
|
2
|
+
export interface UseActionsParams {
|
|
3
|
+
dataSource?: DataSourceType;
|
|
4
|
+
currentValue?: 'server' | 'local';
|
|
5
|
+
__designMode?: string;
|
|
6
|
+
extraParams?: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
declare const useActions: ({ dataSource: propsDataSource, currentValue: propsCurrentValue, __designMode, extraParams: propsExtraParams, }?: UseActionsParams) => {
|
|
9
|
+
create: (values: Record<string, any>) => Promise<any>;
|
|
10
|
+
get: () => Promise<any>;
|
|
11
|
+
update: (values: Record<string, any>) => Promise<any>;
|
|
12
|
+
list: (params: {
|
|
13
|
+
page: number;
|
|
14
|
+
pageSize: number;
|
|
15
|
+
}) => Promise<any>;
|
|
16
|
+
destroy: (id: string) => Promise<any>;
|
|
17
|
+
};
|
|
18
|
+
export default useActions;
|
|
@@ -168,6 +168,9 @@ var useActions = ({
|
|
|
168
168
|
designModeToast();
|
|
169
169
|
return Promise.reject();
|
|
170
170
|
}
|
|
171
|
+
if (currentDataSource == null ? void 0 : currentDataSource.fromSettingMeta) {
|
|
172
|
+
return Promise.reject();
|
|
173
|
+
}
|
|
171
174
|
if (isCustomApi) {
|
|
172
175
|
const actions = getParsedActions();
|
|
173
176
|
if (!actions.update) {
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Result } from 'ahooks/es/useRequest/src/types';
|
|
3
|
+
import { ActionsItem } from '../../dataSourceForm/serve';
|
|
4
|
+
export interface Field {
|
|
5
|
+
name: string;
|
|
6
|
+
type: string;
|
|
7
|
+
allowNull: boolean;
|
|
8
|
+
primaryKey: boolean;
|
|
9
|
+
unique: boolean;
|
|
10
|
+
autoIncrement: boolean;
|
|
11
|
+
description?: (null | string)[];
|
|
12
|
+
possibleTypes?: string[];
|
|
13
|
+
rawType: string;
|
|
14
|
+
interface: string;
|
|
15
|
+
uiSchema: UiSchema;
|
|
16
|
+
key?: string;
|
|
17
|
+
collectionName?: string;
|
|
18
|
+
collectionKey?: any;
|
|
19
|
+
dataSourceKey?: string;
|
|
20
|
+
defaultValue?: any;
|
|
21
|
+
}
|
|
22
|
+
interface UiSchema {
|
|
23
|
+
type?: string;
|
|
24
|
+
'x-component': string;
|
|
25
|
+
'x-component-props'?: Xcomponentprops;
|
|
26
|
+
'x-validator'?: string;
|
|
27
|
+
title: string;
|
|
28
|
+
default?: any;
|
|
29
|
+
enum?: any[];
|
|
30
|
+
}
|
|
31
|
+
interface Xcomponentprops {
|
|
32
|
+
style?: Style;
|
|
33
|
+
autoSize?: AutoSize;
|
|
34
|
+
stringMode?: boolean;
|
|
35
|
+
step?: string;
|
|
36
|
+
dateFormat?: string;
|
|
37
|
+
showTime?: boolean;
|
|
38
|
+
}
|
|
39
|
+
interface AutoSize {
|
|
40
|
+
minRows: number;
|
|
41
|
+
}
|
|
42
|
+
interface Style {
|
|
43
|
+
width: string;
|
|
44
|
+
}
|
|
45
|
+
export declare type ActionTypes = 'list' | 'get' | 'update' | 'create' | 'destroy';
|
|
46
|
+
export declare type DataSourceType = {
|
|
47
|
+
fromSettingMeta: boolean;
|
|
48
|
+
actions: {
|
|
49
|
+
get: ActionsItem;
|
|
50
|
+
update: ActionsItem;
|
|
51
|
+
create: ActionsItem;
|
|
52
|
+
delete: ActionsItem;
|
|
53
|
+
list: ActionsItem;
|
|
54
|
+
};
|
|
55
|
+
headerDataSource: string;
|
|
56
|
+
dataSourceKey: string;
|
|
57
|
+
filterTargetKey: string;
|
|
58
|
+
introspected: boolean;
|
|
59
|
+
isCustomApi: boolean;
|
|
60
|
+
key: string;
|
|
61
|
+
tableName: string;
|
|
62
|
+
logging: boolean;
|
|
63
|
+
name: string;
|
|
64
|
+
title: string;
|
|
65
|
+
titleField: string;
|
|
66
|
+
types: ActionTypes[];
|
|
67
|
+
fields: Field[];
|
|
68
|
+
options: {
|
|
69
|
+
apiType: string;
|
|
70
|
+
baseUrl: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export declare type DataSourceContextProps = {
|
|
74
|
+
dataSource: DataSourceType;
|
|
75
|
+
children?: React.ReactNode;
|
|
76
|
+
currentValue?: string;
|
|
77
|
+
actions?: {
|
|
78
|
+
list?: () => Promise<any>;
|
|
79
|
+
get?: () => Promise<any>;
|
|
80
|
+
update?: () => Promise<any>;
|
|
81
|
+
create?: () => Promise<any>;
|
|
82
|
+
destroy?: () => Promise<any>;
|
|
83
|
+
};
|
|
84
|
+
requestOptions?: {
|
|
85
|
+
list?: any;
|
|
86
|
+
get?: any;
|
|
87
|
+
update?: any;
|
|
88
|
+
create?: any;
|
|
89
|
+
destroy?: any;
|
|
90
|
+
};
|
|
91
|
+
overrideData?: {
|
|
92
|
+
list?: any;
|
|
93
|
+
get?: any;
|
|
94
|
+
};
|
|
95
|
+
autoRun?: {
|
|
96
|
+
list?: boolean;
|
|
97
|
+
get?: boolean;
|
|
98
|
+
};
|
|
99
|
+
extraParams?: {
|
|
100
|
+
list?: Record<string, any>;
|
|
101
|
+
get?: Record<string, any>;
|
|
102
|
+
update?: Record<string, any>;
|
|
103
|
+
create?: Record<string, any>;
|
|
104
|
+
destroy?: Record<string, any>;
|
|
105
|
+
};
|
|
106
|
+
__id?: string;
|
|
107
|
+
__designMode?: string;
|
|
108
|
+
};
|
|
109
|
+
export interface DataSourceContextType {
|
|
110
|
+
dataSource?: DataSourceType;
|
|
111
|
+
list: Result<any, any>;
|
|
112
|
+
destroy: Result<any, any>;
|
|
113
|
+
get: Result<any, any>;
|
|
114
|
+
update: Result<any, any>;
|
|
115
|
+
create: Result<any, any>;
|
|
116
|
+
__designMode?: string;
|
|
117
|
+
getCurrentRecord: () => any;
|
|
118
|
+
}
|
|
119
|
+
export declare const DataSourceContext: import("react").Context<DataSourceContextType>;
|
|
120
|
+
export default DataSourceContext;
|