@pisell/materials 3.3.68 → 3.3.69
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 +5 -5
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.js +16 -16
- package/build/lowcode/view.js +16 -16
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.js +68 -10
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +5 -3
- package/es/components/dataSourceComponents/dataSourceForm/serve.d.ts +30 -0
- package/es/components/dataSourceComponents/dataSourceForm/serve.js +93 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +66 -28
- package/es/components/dataSourceComponents/dataSourceForm/type.d.ts +1 -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.js +3 -4
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/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/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +11 -11
- package/es/components/dataSourceComponents/hooks/useActions.js +20 -14
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
- package/es/components/table/Table/fields/index.d.ts +2 -2
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/utils/platform.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.js +37 -3
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +5 -3
- package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +30 -0
- package/lib/components/dataSourceComponents/dataSourceForm/serve.js +45 -2
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +23 -2
- package/lib/components/dataSourceComponents/dataSourceForm/type.d.ts +1 -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.js +3 -3
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/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/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +11 -11
- package/lib/components/dataSourceComponents/hooks/useActions.js +3 -0
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
- package/lib/components/table/Table/fields/index.d.ts +2 -2
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/utils/platform.d.ts +1 -1
- 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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL参数处理工具方法
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* 从浏览器URL获取查询参数
|
|
6
|
+
* @returns Record<string, string> URL查询参数对象
|
|
7
|
+
*/
|
|
8
|
+
export declare const getUrlParams: () => Record<string, string>;
|
|
9
|
+
/**
|
|
10
|
+
* 从URL参数中提取formSettingMeta相关的参数
|
|
11
|
+
* @param urlParams URL查询参数对象,如果不传则自动从浏览器获取
|
|
12
|
+
* @returns 包含business_code、channel_code和isBoard参数的对象
|
|
13
|
+
*/
|
|
14
|
+
export declare const getFormSettingParams: (urlParams?: Record<string, string>) => {
|
|
15
|
+
businessCode: string;
|
|
16
|
+
channelCode: string;
|
|
17
|
+
isBoard: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* 根据URL参数更新租户设置数据
|
|
21
|
+
* @param data 要更新的数据对象,如 {"order.prefix":"","order.suffix":"","payment.number":""}
|
|
22
|
+
* @returns Promise<any> 返回更新结果
|
|
23
|
+
*/
|
|
24
|
+
export declare const updateTenantSettingFromUrl: (data: Record<string, any>) => Promise<any>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/dataSourceComponents/dataSourceForm/urlUtils.ts
|
|
20
|
+
var urlUtils_exports = {};
|
|
21
|
+
__export(urlUtils_exports, {
|
|
22
|
+
getFormSettingParams: () => getFormSettingParams,
|
|
23
|
+
getUrlParams: () => getUrlParams,
|
|
24
|
+
updateTenantSettingFromUrl: () => updateTenantSettingFromUrl
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(urlUtils_exports);
|
|
27
|
+
var import_utils = require("../../table/utils");
|
|
28
|
+
var getUrlParams = () => {
|
|
29
|
+
const urlSearchParams = new URLSearchParams(window.location.search);
|
|
30
|
+
const urlParams = {};
|
|
31
|
+
urlSearchParams.forEach((value, key) => {
|
|
32
|
+
urlParams[key] = value;
|
|
33
|
+
});
|
|
34
|
+
return urlParams;
|
|
35
|
+
};
|
|
36
|
+
var getFormSettingParams = (urlParams) => {
|
|
37
|
+
const params = urlParams || getUrlParams();
|
|
38
|
+
return {
|
|
39
|
+
businessCode: params.businessCode || params.business_code,
|
|
40
|
+
channelCode: params.channelCode || params.channel_code,
|
|
41
|
+
isBoard: params.is_board === "1"
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
var updateTenantSettingFromUrl = async (data) => {
|
|
45
|
+
debugger;
|
|
46
|
+
const urlParams = getFormSettingParams();
|
|
47
|
+
const businessCode = urlParams.businessCode;
|
|
48
|
+
const channelCode = urlParams.channelCode;
|
|
49
|
+
const boardCode = urlParams.isBoard && businessCode && channelCode ? `${businessCode}+${channelCode}` : void 0;
|
|
50
|
+
const requestBody = {
|
|
51
|
+
business_code: businessCode || "",
|
|
52
|
+
channel_code: channelCode || "",
|
|
53
|
+
board_code: boardCode || "",
|
|
54
|
+
data
|
|
55
|
+
};
|
|
56
|
+
const url = "/tenant/setting";
|
|
57
|
+
return import_utils.request.getRequest().post(url, requestBody, {
|
|
58
|
+
headers: {
|
|
59
|
+
"Content-Type": "application/json"
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
+
0 && (module.exports = {
|
|
65
|
+
getFormSettingParams,
|
|
66
|
+
getUrlParams,
|
|
67
|
+
updateTenantSettingFromUrl
|
|
68
|
+
});
|
|
@@ -136,13 +136,13 @@ var withFormItem = (WrappedComponent, overlayProps) => {
|
|
|
136
136
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
137
137
|
WrappedComponent,
|
|
138
138
|
{
|
|
139
|
+
...overlayProps == null ? void 0 : overlayProps.innerProps,
|
|
139
140
|
...otherProps,
|
|
140
141
|
mode: propsMode,
|
|
141
142
|
renderMode: effectiveMode,
|
|
142
|
-
...overlayProps == null ? void 0 : overlayProps.innerProps,
|
|
143
143
|
style: {
|
|
144
|
-
...
|
|
145
|
-
...
|
|
144
|
+
...((_a2 = overlayProps == null ? void 0 : overlayProps.innerProps) == null ? void 0 : _a2.style) || {},
|
|
145
|
+
...innerStyle || {}
|
|
146
146
|
},
|
|
147
147
|
fieldKey: name,
|
|
148
148
|
isVerification: typeobj == null ? void 0 : typeobj.enabled,
|
|
@@ -105,6 +105,7 @@ var BaseTable = (props, ref) => {
|
|
|
105
105
|
}, [dataSourceKey]);
|
|
106
106
|
(0, import_react.useEffect)(() => {
|
|
107
107
|
if (dataSourceKeyRef.current) {
|
|
108
|
+
if (dataSource == null ? void 0 : dataSource.fromSettingMeta) return;
|
|
108
109
|
list == null ? void 0 : list.run(queryPageConfig);
|
|
109
110
|
} else {
|
|
110
111
|
list == null ? void 0 : list.mutate([]);
|
|
@@ -19,7 +19,7 @@ interface UseTablePropsProps {
|
|
|
19
19
|
*/
|
|
20
20
|
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
21
21
|
currentComponentId: any;
|
|
22
|
-
title: number | boolean |
|
|
22
|
+
title: number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
23
23
|
pagination: {
|
|
24
24
|
total: number;
|
|
25
25
|
current: number;
|
|
@@ -28,7 +28,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
28
28
|
showSizeChanger: boolean;
|
|
29
29
|
};
|
|
30
30
|
columns: import("./useColumns").Column[];
|
|
31
|
-
subTitle: number | boolean |
|
|
31
|
+
subTitle: number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
32
32
|
buttons: any[] | null;
|
|
33
33
|
filter: {
|
|
34
34
|
dom: any;
|
|
@@ -54,7 +54,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
54
54
|
width: number;
|
|
55
55
|
align: "center" | "left" | "right";
|
|
56
56
|
fixed: false | "left" | "right";
|
|
57
|
-
type: "
|
|
57
|
+
type: "button" | "link";
|
|
58
58
|
items: OperationItem[];
|
|
59
59
|
} | undefined;
|
|
60
60
|
operationContent?: {
|
|
@@ -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;
|
|
@@ -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);
|
|
@@ -15,4 +15,4 @@ export declare const getFileMetadataParams: (file: RcFile & {
|
|
|
15
15
|
metadata?: MediaMetadata;
|
|
16
16
|
}) => Record<string, any>;
|
|
17
17
|
export declare const isValueEqual: (value: any, fileListValue: any) => boolean;
|
|
18
|
-
export declare const getBaseTime: (size: number) =>
|
|
18
|
+
export declare const getBaseTime: (size: number) => 2000 | 1000 | 4000 | 8000;
|
|
@@ -19,7 +19,7 @@ declare const formFieldMap: {
|
|
|
19
19
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
20
20
|
onChange: (value: string) => void;
|
|
21
21
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
22
|
-
rootDomain: "custom" | "
|
|
22
|
+
rootDomain: "custom" | "saas" | "xzero";
|
|
23
23
|
customDomain?: string | undefined;
|
|
24
24
|
value?: string | undefined;
|
|
25
25
|
tenantId: string;
|
|
@@ -59,7 +59,13 @@ declare const formFieldMap: {
|
|
|
59
59
|
FormItemTranslation: import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
60
60
|
FormItemIconSelect: import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
61
61
|
};
|
|
62
|
-
declare const getFieldComponent: (fieldComponent: string) => (import("react").FC<import("./
|
|
62
|
+
declare const getFieldComponent: (fieldComponent: string) => import("react").FC<any> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | (import("react").FC<{}> & {
|
|
63
|
+
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
64
|
+
} & {
|
|
65
|
+
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
66
|
+
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
|
|
67
|
+
onChange: (value: string) => void;
|
|
68
|
+
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
|
|
63
69
|
JSON: import("react").FC<any>;
|
|
64
70
|
Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
65
71
|
TextArea: import("react").FC<import("antd/es/input").TextAreaProps & import("react").RefAttributes<import("antd/es/input/TextArea").TextAreaRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
@@ -72,18 +78,14 @@ declare const getFieldComponent: (fieldComponent: string) => (import("react").FC
|
|
|
72
78
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
73
79
|
onChange: (value: string) => void;
|
|
74
80
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
75
|
-
rootDomain: "custom" | "
|
|
81
|
+
rootDomain: "custom" | "saas" | "xzero";
|
|
76
82
|
customDomain?: string | undefined;
|
|
77
83
|
value?: string | undefined;
|
|
78
84
|
tenantId: string;
|
|
79
85
|
name?: string | undefined;
|
|
80
86
|
fieldKey?: string | undefined;
|
|
81
87
|
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
82
|
-
}) | import("react").FC<import("./
|
|
83
|
-
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
84
|
-
} & {
|
|
85
|
-
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
86
|
-
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<{}> & {
|
|
88
|
+
}) | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | (import("react").FC<{}> & {
|
|
87
89
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
88
90
|
} & {
|
|
89
91
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
@@ -95,7 +97,5 @@ declare const getFieldComponent: (fieldComponent: string) => (import("react").FC
|
|
|
95
97
|
extraParams?: Record<string, any> | undefined;
|
|
96
98
|
} & {
|
|
97
99
|
dataSource?: any;
|
|
98
|
-
}) => JSX.Element) | import("react").FC<
|
|
99
|
-
onChange: (value: string) => void;
|
|
100
|
-
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./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>;
|
|
100
|
+
}) => JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
101
101
|
export { getFieldComponent, formFieldMap };
|
|
@@ -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) {
|
|
@@ -197,12 +197,12 @@ export declare const fieldList: ({
|
|
|
197
197
|
field_icon: string;
|
|
198
198
|
field_name: string;
|
|
199
199
|
field_type: string;
|
|
200
|
-
default_value:
|
|
200
|
+
default_value: string;
|
|
201
201
|
} | {
|
|
202
202
|
field_icon: string;
|
|
203
203
|
field_name: string;
|
|
204
204
|
field_type: string;
|
|
205
|
-
default_value:
|
|
205
|
+
default_value: boolean;
|
|
206
206
|
} | {
|
|
207
207
|
field_icon: string;
|
|
208
208
|
field_name: string;
|
|
@@ -155,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
155
155
|
sort?: SortType | undefined;
|
|
156
156
|
mode: "" | "localStorage" | "remote";
|
|
157
157
|
currentViewMode: ModeType;
|
|
158
|
-
}) => ("filters" | "
|
|
158
|
+
}) => ("filters" | "filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
|
|
159
159
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
160
160
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
161
161
|
export {};
|
package/lib/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export { default as DataSourceTypography } from './components/dataSourceComponen
|
|
|
26
26
|
export { default as DataSourceTable } from './components/dataSourceComponents/dataSourceTable';
|
|
27
27
|
export { default as DataSourceWrapper } from './components/dataSourceComponents/dataSourceWrapper';
|
|
28
28
|
export { default as FormItemCheckbox } from './components/dataSourceComponents/fields/Checkbox';
|
|
29
|
+
export { default as FormItemSwitch } from './components/dataSourceComponents/fields/Switch';
|
|
29
30
|
export { default as FormItemColorPicker } from './components/dataSourceComponents/fields/ColorPicker';
|
|
30
31
|
export { default as FormItemDatePicker } from './components/dataSourceComponents/fields/DatePicker';
|
|
31
32
|
export { default as FormItemInput } from './components/dataSourceComponents/fields/Input';
|
package/lib/index.js
CHANGED
|
@@ -84,6 +84,7 @@ __export(src_exports, {
|
|
|
84
84
|
FormItemInputNumber: () => import_InputNumber.default,
|
|
85
85
|
FormItemRadio: () => import_Radio.default,
|
|
86
86
|
FormItemSelect: () => import_Select.default,
|
|
87
|
+
FormItemSwitch: () => import_Switch.default,
|
|
87
88
|
FormItemTimePicker: () => import_TimePicker.default,
|
|
88
89
|
FormItemTranslation: () => import_Translation.default,
|
|
89
90
|
FormItemUpload: () => import_Upload.default,
|
|
@@ -233,6 +234,7 @@ var import_dataSourceTypography = __toESM(require("./components/dataSourceCompon
|
|
|
233
234
|
var import_dataSourceTable = __toESM(require("./components/dataSourceComponents/dataSourceTable"));
|
|
234
235
|
var import_dataSourceWrapper = __toESM(require("./components/dataSourceComponents/dataSourceWrapper"));
|
|
235
236
|
var import_Checkbox = __toESM(require("./components/dataSourceComponents/fields/Checkbox"));
|
|
237
|
+
var import_Switch = __toESM(require("./components/dataSourceComponents/fields/Switch"));
|
|
236
238
|
var import_ColorPicker = __toESM(require("./components/dataSourceComponents/fields/ColorPicker"));
|
|
237
239
|
var import_DatePicker = __toESM(require("./components/dataSourceComponents/fields/DatePicker"));
|
|
238
240
|
var import_Input = __toESM(require("./components/dataSourceComponents/fields/Input"));
|
|
@@ -400,6 +402,7 @@ var import_pisellGoodPassCard = __toESM(require("./components/pisellGoodPassCard
|
|
|
400
402
|
FormItemInputNumber,
|
|
401
403
|
FormItemRadio,
|
|
402
404
|
FormItemSelect,
|
|
405
|
+
FormItemSwitch,
|
|
403
406
|
FormItemTimePicker,
|
|
404
407
|
FormItemTranslation,
|
|
405
408
|
FormItemUpload,
|
package/lib/utils/platform.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const isMobile: () =>
|
|
1
|
+
export declare const isMobile: () => boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import formItemCheckboxMeta from '../form-item-checkbox/meta';
|
|
2
|
+
import formItemSwitchMeta from '../form-item-switch/meta';
|
|
2
3
|
import formItemCheckboxGroupMeta from '../form-item-checkbox.group/meta';
|
|
3
4
|
import formItemColorPickerMeta from '../form-item-color-picker/meta';
|
|
4
5
|
import formItemDatePickerMeta from '../form-item-date-picker/meta';
|
|
@@ -19,6 +20,7 @@ import formItemUploadMeta from '../form-item-upload/meta';
|
|
|
19
20
|
|
|
20
21
|
export const metaAll = [
|
|
21
22
|
formItemCheckboxMeta,
|
|
23
|
+
formItemSwitchMeta,
|
|
22
24
|
formItemCheckboxGroupMeta,
|
|
23
25
|
formItemColorPickerMeta,
|
|
24
26
|
formItemDatePickerMeta,
|
|
@@ -67,6 +69,7 @@ export const nocobaseCpt2PisellCptMap: Record<string, any> = {
|
|
|
67
69
|
TimePicker: 'FormItemTimePicker',
|
|
68
70
|
ColorPicker: 'FormItemColorPicker',
|
|
69
71
|
Checkbox: 'FormItemCheckbox',
|
|
72
|
+
Switch: 'FormItemSwitch',
|
|
70
73
|
'Radio.Group': 'FormItemRadio.Group',
|
|
71
74
|
'Checkbox.Group': 'FormItemCheckbox.Group',
|
|
72
75
|
Upload: 'FormItemUpload',
|