@pisell/materials 6.4.13 → 6.4.14
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +9 -9
- package/build/lowcode/render/default/view.js +23 -23
- package/build/lowcode/view.js +24 -24
- package/es/components/cardPro/index.d.ts +4 -0
- package/es/components/cardPro/index.js +3 -10
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +31 -5
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +4 -2
- package/es/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +10 -3
- package/es/components/dataSourceComponents/fields/Input.Mobile/WithMode.js +70 -28
- package/es/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.Mobile/serve.js +24 -2
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +8 -2
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +45 -13
- package/es/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +3 -2
- package/es/components/dataSourceComponents/fields/Input.Phone/serve.js +76 -8
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +19 -19
- package/es/components/dataSourceComponents/hooks/usePlatform.d.ts +3 -1
- package/es/components/dataSourceComponents/hooks/usePlatform.js +9 -1
- package/es/components/drag-sort-tree/TreeItem/index.d.ts +1 -0
- package/es/components/filter/types.d.ts +2 -1
- package/es/components/iconfont/index.d.ts +8 -0
- package/es/components/iconfont/index.js +1 -1
- package/es/components/table/Actions/index.d.ts +1 -0
- package/es/components/table/Actions/index.js +4 -1
- package/es/components/table/Table/fields/index.d.ts +2 -2
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/hooks/useTableSetting.js +2 -2
- package/es/components/virtual-keyboard/Amount/index.d.ts +1 -0
- package/es/locales/en-US.d.ts +297 -0
- package/es/locales/en-US.js +1 -16
- package/es/locales/zh-CN.d.ts +292 -0
- package/es/locales/zh-CN.js +1 -16
- package/es/locales/zh-TW.d.ts +292 -0
- package/es/locales/zh-TW.js +1 -16
- package/lib/components/cardPro/index.d.ts +4 -0
- package/lib/components/cardPro/index.js +2 -3
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +26 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +4 -2
- package/lib/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +10 -3
- package/lib/components/dataSourceComponents/fields/Input.Mobile/WithMode.js +67 -18
- package/lib/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Mobile/serve.js +29 -7
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +8 -2
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +41 -9
- package/lib/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +3 -2
- package/lib/components/dataSourceComponents/fields/Input.Phone/serve.js +53 -11
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +19 -19
- package/lib/components/dataSourceComponents/hooks/usePlatform.d.ts +3 -1
- package/lib/components/dataSourceComponents/hooks/usePlatform.js +12 -0
- package/lib/components/drag-sort-tree/TreeItem/index.d.ts +1 -0
- package/lib/components/filter/types.d.ts +2 -1
- package/lib/components/iconfont/index.d.ts +8 -0
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/table/Actions/index.d.ts +1 -0
- package/lib/components/table/Actions/index.js +4 -1
- package/lib/components/table/Table/fields/index.d.ts +2 -2
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/hooks/useTableSetting.js +2 -2
- package/lib/components/virtual-keyboard/Amount/index.d.ts +1 -0
- package/lib/locales/en-US.d.ts +297 -0
- package/lib/locales/en-US.js +1 -12
- package/lib/locales/zh-CN.d.ts +292 -0
- package/lib/locales/zh-CN.js +1 -12
- package/lib/locales/zh-TW.d.ts +292 -0
- package/lib/locales/zh-TW.js +1 -12
- package/lowcode/form-item-input.mobile/meta.ts +22 -0
- package/lowcode/form-item-input.phone/meta.ts +22 -0
- package/package.json +1 -1
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { InputProps } from 'antd';
|
|
3
3
|
import { ModeType } from "../../dataSourceForm/type";
|
|
4
|
+
declare type PhoneValue = string | {
|
|
5
|
+
phone: string;
|
|
6
|
+
countryCallingCode: string;
|
|
7
|
+
};
|
|
4
8
|
export interface PhoneInputProps extends Omit<InputProps, 'value' | 'onChange'> {
|
|
5
9
|
renderMode: ModeType;
|
|
6
|
-
value?:
|
|
7
|
-
onChange?: (value:
|
|
10
|
+
value?: PhoneValue;
|
|
11
|
+
onChange?: (value: PhoneValue) => void;
|
|
12
|
+
returnFormat?: 'string' | 'object';
|
|
13
|
+
inputRef?: any;
|
|
8
14
|
}
|
|
9
15
|
declare const PhoneNumberInputWithMode: React.FC<PhoneInputProps & import("../../dataSourceForm/utils").WithModeProps>;
|
|
10
16
|
export default PhoneNumberInputWithMode;
|
|
@@ -40,8 +40,10 @@ var import_serve = require("./serve");
|
|
|
40
40
|
var import_ReadPretty = __toESM(require("./ReadPretty"));
|
|
41
41
|
var import_utils2 = require("../../dataSourceForm/utils");
|
|
42
42
|
var import_useTranslationOriginal = __toESM(require("../../../../hooks/useTranslationOriginal"));
|
|
43
|
+
var import_useSetRequest = __toESM(require("../../../../hooks/useSetRequest"));
|
|
43
44
|
var { Option } = import_select.default;
|
|
44
|
-
var PhoneNumberInput = ({ value: propsValue, onChange, disabled, ...props }) => {
|
|
45
|
+
var PhoneNumberInput = ({ value: propsValue, onChange, disabled, returnFormat = "string", ...props }) => {
|
|
46
|
+
(0, import_useSetRequest.default)();
|
|
45
47
|
const { data: countries = [] } = (0, import_serve.useCountries)();
|
|
46
48
|
const translationOriginal = (0, import_useTranslationOriginal.default)();
|
|
47
49
|
const value = (0, import_react.useMemo)(() => {
|
|
@@ -52,18 +54,24 @@ var PhoneNumberInput = ({ value: propsValue, onChange, disabled, ...props }) =>
|
|
|
52
54
|
}, [propsValue]);
|
|
53
55
|
const parseExternalValue = (val) => {
|
|
54
56
|
if (!val) return { countryCode: "AU", phoneNumber: "" };
|
|
57
|
+
let srtValue = "";
|
|
58
|
+
if ((0, import_utils.isString)(val)) {
|
|
59
|
+
srtValue = val;
|
|
60
|
+
} else if ("phone" in val) {
|
|
61
|
+
srtValue = `${val.countryCallingCode || ""}${val.phone || ""}`;
|
|
62
|
+
}
|
|
55
63
|
const matchedPrefix = countries.find(
|
|
56
|
-
(country) =>
|
|
64
|
+
(country) => srtValue.startsWith(country.prefix)
|
|
57
65
|
);
|
|
58
66
|
if (matchedPrefix) {
|
|
59
67
|
return {
|
|
60
68
|
countryCode: matchedPrefix.code,
|
|
61
|
-
phoneNumber:
|
|
69
|
+
phoneNumber: srtValue.slice(matchedPrefix.prefix.length)
|
|
62
70
|
};
|
|
63
71
|
}
|
|
64
72
|
return {
|
|
65
73
|
countryCode: "AU",
|
|
66
|
-
phoneNumber:
|
|
74
|
+
phoneNumber: srtValue.replace(/\D/g, "")
|
|
67
75
|
};
|
|
68
76
|
};
|
|
69
77
|
const [countryCode, setCountryCode] = (0, import_react.useState)(
|
|
@@ -77,6 +85,17 @@ var PhoneNumberInput = ({ value: propsValue, onChange, disabled, ...props }) =>
|
|
|
77
85
|
setCountryCode(newCountryCode);
|
|
78
86
|
setPhoneNumber(newPhoneNumber);
|
|
79
87
|
}, [value, countries]);
|
|
88
|
+
const handleChange = (prefix, phoneNumber2) => {
|
|
89
|
+
if (returnFormat === "string") {
|
|
90
|
+
const newValue = phoneNumber2 ? `${prefix}${phoneNumber2}` : "";
|
|
91
|
+
onChange == null ? void 0 : onChange(newValue);
|
|
92
|
+
} else {
|
|
93
|
+
onChange == null ? void 0 : onChange({
|
|
94
|
+
phone: phoneNumber2,
|
|
95
|
+
countryCallingCode: prefix
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
};
|
|
80
99
|
const handlePhoneNumberChange = (e) => {
|
|
81
100
|
const cleanNumber = e.target.value.replace(/\D/g, "");
|
|
82
101
|
setPhoneNumber(cleanNumber);
|
|
@@ -84,8 +103,7 @@ var PhoneNumberInput = ({ value: propsValue, onChange, disabled, ...props }) =>
|
|
|
84
103
|
(c) => c.code === countryCode
|
|
85
104
|
);
|
|
86
105
|
const prefix = (selectedCountry == null ? void 0 : selectedCountry.prefix) || "";
|
|
87
|
-
|
|
88
|
-
onChange == null ? void 0 : onChange(newValue);
|
|
106
|
+
handleChange(prefix, cleanNumber);
|
|
89
107
|
if (!cleanNumber) {
|
|
90
108
|
setTimeout(() => {
|
|
91
109
|
const formInstance = props.form;
|
|
@@ -102,8 +120,7 @@ var PhoneNumberInput = ({ value: propsValue, onChange, disabled, ...props }) =>
|
|
|
102
120
|
(c) => c.code === value2
|
|
103
121
|
);
|
|
104
122
|
const prefix = (selectedCountry == null ? void 0 : selectedCountry.prefix) || "";
|
|
105
|
-
|
|
106
|
-
onChange == null ? void 0 : onChange(newValue);
|
|
123
|
+
handleChange(prefix, phoneNumber);
|
|
107
124
|
setTimeout(() => {
|
|
108
125
|
const formInstance = props.form;
|
|
109
126
|
const fieldName = props.fieldKey;
|
|
@@ -122,9 +139,23 @@ var PhoneNumberInput = ({ value: propsValue, onChange, disabled, ...props }) =>
|
|
|
122
139
|
const prefix = (selectedCountry == null ? void 0 : selectedCountry.prefix) || "";
|
|
123
140
|
return `${prefix}${phoneNumber}`;
|
|
124
141
|
}, [countryCode, phoneNumber, countries]);
|
|
142
|
+
const objValue = (0, import_react.useMemo)(() => {
|
|
143
|
+
const selectedCountry = countries.find(
|
|
144
|
+
(c) => c.code === countryCode
|
|
145
|
+
);
|
|
146
|
+
const prefix = (selectedCountry == null ? void 0 : selectedCountry.prefix) || "";
|
|
147
|
+
return {
|
|
148
|
+
phone: phoneNumber || "",
|
|
149
|
+
countryCallingCode: prefix
|
|
150
|
+
};
|
|
151
|
+
}, [countryCode, phoneNumber, countries]);
|
|
125
152
|
const handleBlur = () => {
|
|
126
153
|
const finalValue = concatenatedNumber;
|
|
127
|
-
|
|
154
|
+
if (returnFormat === "string") {
|
|
155
|
+
onChange == null ? void 0 : onChange(finalValue);
|
|
156
|
+
} else {
|
|
157
|
+
onChange == null ? void 0 : onChange(objValue);
|
|
158
|
+
}
|
|
128
159
|
};
|
|
129
160
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Space.Compact, { block: true }, /* @__PURE__ */ import_react.default.createElement(
|
|
130
161
|
import_select.default,
|
|
@@ -147,6 +178,7 @@ var PhoneNumberInput = ({ value: propsValue, onChange, disabled, ...props }) =>
|
|
|
147
178
|
import_antd.Input,
|
|
148
179
|
{
|
|
149
180
|
...props,
|
|
181
|
+
ref: props == null ? void 0 : props.inputRef,
|
|
150
182
|
disabled,
|
|
151
183
|
type: "tel",
|
|
152
184
|
value: phoneNumber,
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
* 获取nocobase数据列表
|
|
3
3
|
*/
|
|
4
4
|
export declare const getCountryDataList: () => Promise<any>;
|
|
5
|
+
export declare const getShopCountryDataList: (locale?: any) => Promise<any>;
|
|
5
6
|
export interface Country {
|
|
6
7
|
id: number;
|
|
7
8
|
name: {
|
|
8
9
|
en: string;
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
'zh-CN': string;
|
|
11
|
+
'zh-HK': string;
|
|
11
12
|
original: string;
|
|
12
13
|
};
|
|
13
14
|
code: string;
|
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
var serve_exports = {};
|
|
31
31
|
__export(serve_exports, {
|
|
32
32
|
getCountryDataList: () => getCountryDataList,
|
|
33
|
+
getShopCountryDataList: () => getShopCountryDataList,
|
|
33
34
|
useCountries: () => useCountries
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(serve_exports);
|
|
@@ -39,13 +40,24 @@ var import_utils = require("../../../table/utils");
|
|
|
39
40
|
var import_usePlatform = require("../../hooks/usePlatform");
|
|
40
41
|
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
41
42
|
var getCountryDataList = async () => {
|
|
42
|
-
const { data } = await import_utils.request.getRequest().get(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
const { data } = await import_utils.request.getRequest().get(
|
|
44
|
+
`/country:list`,
|
|
45
|
+
{},
|
|
46
|
+
{
|
|
47
|
+
isNocobase: true,
|
|
48
|
+
fullResult: true,
|
|
49
|
+
headers: {
|
|
50
|
+
"x-data-source": "pisell2"
|
|
51
|
+
}
|
|
47
52
|
}
|
|
48
|
-
|
|
53
|
+
);
|
|
54
|
+
return data.map((item) => ({
|
|
55
|
+
...item,
|
|
56
|
+
prefix: `+${item.calling_code}`
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
var getShopCountryDataList = async (locale) => {
|
|
60
|
+
const { data } = await import_utils.request.getRequest().get("/shop/area/country", { "translate-locale": locale || "en" });
|
|
49
61
|
return data.map((item) => ({
|
|
50
62
|
...item,
|
|
51
63
|
prefix: `+${item.calling_code}`
|
|
@@ -53,7 +65,9 @@ var getCountryDataList = async () => {
|
|
|
53
65
|
};
|
|
54
66
|
var useCountries = () => {
|
|
55
67
|
const isShop = (0, import_usePlatform.useIsShop)();
|
|
56
|
-
const
|
|
68
|
+
const isH5 = (0, import_usePlatform.useIsH5)();
|
|
69
|
+
const isPc = (0, import_usePlatform.useIsPc)();
|
|
70
|
+
const { appHelper, ...others } = (0, import_useEngineContext.default)();
|
|
57
71
|
const { data, run } = (0, import_ahooks.useRequest)(getCountryDataList, {
|
|
58
72
|
cacheKey: "phone-countries",
|
|
59
73
|
staleTime: 1e3 * 60 * 5,
|
|
@@ -62,15 +76,42 @@ var useCountries = () => {
|
|
|
62
76
|
// 1小时后清除缓存
|
|
63
77
|
manual: true
|
|
64
78
|
});
|
|
79
|
+
const { data: shopData, run: runShop } = (0, import_ahooks.useRequest)(getShopCountryDataList, {
|
|
80
|
+
cacheKey: "phone-shop-countries",
|
|
81
|
+
staleTime: 1e3 * 60 * 5,
|
|
82
|
+
// 5分钟后数据过期
|
|
83
|
+
cacheTime: 1e3 * 60 * 60,
|
|
84
|
+
// 1小时后清除缓存
|
|
85
|
+
manual: true
|
|
86
|
+
});
|
|
65
87
|
(0, import_react.useEffect)(() => {
|
|
66
|
-
if (!isShop) {
|
|
88
|
+
if (!isShop && !isPc && !isH5) {
|
|
67
89
|
run();
|
|
68
90
|
}
|
|
69
91
|
}, [isShop]);
|
|
92
|
+
(0, import_react.useEffect)(() => {
|
|
93
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
94
|
+
if (isShop && !((_e = (_d = (_c = (_b = (_a = appHelper == null ? void 0 : appHelper.utils) == null ? void 0 : _a.store) == null ? void 0 : _b.getState()) == null ? void 0 : _c.global) == null ? void 0 : _d.codeList) == null ? void 0 : _e.length)) {
|
|
95
|
+
runShop((_g = (_f = others == null ? void 0 : others.engine) == null ? void 0 : _f.props) == null ? void 0 : _g.locale);
|
|
96
|
+
}
|
|
97
|
+
}, [isShop]);
|
|
70
98
|
const currentData = (0, import_react.useMemo)(() => {
|
|
71
|
-
var _a, _b, _c, _d;
|
|
99
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
72
100
|
if (isShop) {
|
|
73
|
-
|
|
101
|
+
return (((_d = (_c = (_b = (_a = appHelper == null ? void 0 : appHelper.utils) == null ? void 0 : _a.store) == null ? void 0 : _b.getState()) == null ? void 0 : _c.global) == null ? void 0 : _d.codeList) || shopData).map((item) => ({
|
|
102
|
+
...item,
|
|
103
|
+
prefix: `+${item.calling_code}`
|
|
104
|
+
}));
|
|
105
|
+
} else if (isPc) {
|
|
106
|
+
const codeList = (_h = (_g = (_f = (_e = appHelper == null ? void 0 : appHelper.utils) == null ? void 0 : _e.store) == null ? void 0 : _f.getState()) == null ? void 0 : _g.country) == null ? void 0 : _h.country;
|
|
107
|
+
if (codeList) {
|
|
108
|
+
return codeList.map((item) => ({
|
|
109
|
+
...item,
|
|
110
|
+
prefix: `+${item.calling_code}`
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
} else if (isH5) {
|
|
114
|
+
const codeList = (_l = (_k = (_j = (_i = appHelper == null ? void 0 : appHelper.utils) == null ? void 0 : _i.getStore()) == null ? void 0 : _j.getState()) == null ? void 0 : _k.country) == null ? void 0 : _l.country;
|
|
74
115
|
if (codeList) {
|
|
75
116
|
return codeList.map((item) => ({
|
|
76
117
|
...item,
|
|
@@ -79,11 +120,12 @@ var useCountries = () => {
|
|
|
79
120
|
}
|
|
80
121
|
}
|
|
81
122
|
return data;
|
|
82
|
-
}, [isShop, data]);
|
|
123
|
+
}, [isShop, data, shopData]);
|
|
83
124
|
return { data: currentData };
|
|
84
125
|
};
|
|
85
126
|
// Annotate the CommonJS export names for ESM import in node:
|
|
86
127
|
0 && (module.exports = {
|
|
87
128
|
getCountryDataList,
|
|
129
|
+
getShopCountryDataList,
|
|
88
130
|
useCountries
|
|
89
131
|
});
|
|
@@ -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;
|
|
@@ -20,7 +20,7 @@ declare const formFieldMap: {
|
|
|
20
20
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
21
21
|
onChange: (value: string) => void;
|
|
22
22
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
23
|
-
rootDomain: "custom" | "
|
|
23
|
+
rootDomain: "custom" | "xzero" | "saas";
|
|
24
24
|
customDomain?: string | undefined;
|
|
25
25
|
value?: string | undefined;
|
|
26
26
|
tenantId: string;
|
|
@@ -60,7 +60,21 @@ declare const formFieldMap: {
|
|
|
60
60
|
FormItemTranslation: import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
61
61
|
FormItemIconSelect: import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
62
62
|
};
|
|
63
|
-
declare const getFieldComponent: (fieldComponent: string) => (import("react").FC<import("./
|
|
63
|
+
declare const getFieldComponent: (fieldComponent: string) => import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & 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("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<any> | ((props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
64
|
+
options?: any;
|
|
65
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
66
|
+
labelField: string;
|
|
67
|
+
valueField: string;
|
|
68
|
+
extraParams?: Record<string, any> | undefined;
|
|
69
|
+
} & {
|
|
70
|
+
dataSource?: any;
|
|
71
|
+
}) => JSX.Element) | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | (import("react").FC<{}> & {
|
|
72
|
+
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
73
|
+
} & {
|
|
74
|
+
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
75
|
+
}) | 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 & {
|
|
76
|
+
onChange: (value: string) => void;
|
|
77
|
+
} & 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> & {
|
|
64
78
|
JSON: import("react").FC<any>;
|
|
65
79
|
Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
66
80
|
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>;
|
|
@@ -73,30 +87,16 @@ declare const getFieldComponent: (fieldComponent: string) => (import("react").FC
|
|
|
73
87
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
74
88
|
onChange: (value: string) => void;
|
|
75
89
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
76
|
-
rootDomain: "custom" | "
|
|
90
|
+
rootDomain: "custom" | "xzero" | "saas";
|
|
77
91
|
customDomain?: string | undefined;
|
|
78
92
|
value?: string | undefined;
|
|
79
93
|
tenantId: string;
|
|
80
94
|
name?: string | undefined;
|
|
81
95
|
fieldKey?: string | undefined;
|
|
82
96
|
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
83
|
-
}) | (import("react").FC<{}> & {
|
|
97
|
+
}) | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | (import("react").FC<{}> & {
|
|
84
98
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
85
99
|
} & {
|
|
86
100
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
87
|
-
})
|
|
88
|
-
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
89
|
-
} & {
|
|
90
|
-
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
91
|
-
}) | ((props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
92
|
-
options?: any;
|
|
93
|
-
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
94
|
-
labelField: string;
|
|
95
|
-
valueField: string;
|
|
96
|
-
extraParams?: Record<string, any> | undefined;
|
|
97
|
-
} & {
|
|
98
|
-
dataSource?: any;
|
|
99
|
-
}) => 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 & {
|
|
100
|
-
onChange: (value: string) => void;
|
|
101
|
-
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
101
|
+
});
|
|
102
102
|
export { getFieldComponent, formFieldMap };
|
|
@@ -29,6 +29,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/components/dataSourceComponents/hooks/usePlatform.ts
|
|
30
30
|
var usePlatform_exports = {};
|
|
31
31
|
__export(usePlatform_exports, {
|
|
32
|
+
useIsH5: () => useIsH5,
|
|
33
|
+
useIsPc: () => useIsPc,
|
|
32
34
|
useIsShop: () => useIsShop,
|
|
33
35
|
usePlatform: () => usePlatform
|
|
34
36
|
});
|
|
@@ -44,8 +46,18 @@ var useIsShop = () => {
|
|
|
44
46
|
const platform = usePlatform();
|
|
45
47
|
return platform === "shop";
|
|
46
48
|
};
|
|
49
|
+
var useIsH5 = () => {
|
|
50
|
+
const platform = usePlatform();
|
|
51
|
+
return platform === "h5";
|
|
52
|
+
};
|
|
53
|
+
var useIsPc = () => {
|
|
54
|
+
const platform = usePlatform();
|
|
55
|
+
return platform === "pc";
|
|
56
|
+
};
|
|
47
57
|
// Annotate the CommonJS export names for ESM import in node:
|
|
48
58
|
0 && (module.exports = {
|
|
59
|
+
useIsH5,
|
|
60
|
+
useIsPc,
|
|
49
61
|
useIsShop,
|
|
50
62
|
usePlatform
|
|
51
63
|
});
|
|
@@ -10,11 +10,12 @@ export declare type FilterType = {
|
|
|
10
10
|
/** 筛选列表 */
|
|
11
11
|
list: FilterItemProps[];
|
|
12
12
|
items?: string[];
|
|
13
|
-
__items: string[];
|
|
14
13
|
/** 快速筛选最大长度 */
|
|
15
14
|
quickFilterMaxLength: number;
|
|
16
15
|
/** 配置存储模式 */
|
|
17
16
|
storageMode: "" | "localStorage";
|
|
17
|
+
/** 筛选列表项dom */
|
|
18
|
+
dom?: any;
|
|
18
19
|
};
|
|
19
20
|
/**
|
|
20
21
|
* 筛选列表项配置
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IconComponentProps } from '@ant-design/icons/es/components/Icon';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface IconFontProps extends IconComponentProps {
|
|
4
|
+
type: string;
|
|
5
|
+
onClick?: React.MouseEventHandler<HTMLSpanElement>;
|
|
6
|
+
}
|
|
7
|
+
declare const IconFont: React.FC<IconFontProps>;
|
|
8
|
+
export default IconFont;
|
|
@@ -35,7 +35,7 @@ module.exports = __toCommonJS(iconfont_exports);
|
|
|
35
35
|
var import_icons = require("@ant-design/icons");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var MyIcon = (0, import_icons.createFromIconfontCN)({
|
|
38
|
-
scriptUrl: "https://static.pisellcdn.com/pisell2iconfont1.
|
|
38
|
+
scriptUrl: "https://static.pisellcdn.com/pisell2iconfont1.14.js"
|
|
39
39
|
// 在 iconfont.cn 上生成
|
|
40
40
|
});
|
|
41
41
|
var IconFont = (props) => {
|
|
@@ -63,7 +63,7 @@ var Actions = ({
|
|
|
63
63
|
preserve: true
|
|
64
64
|
});
|
|
65
65
|
const showActions = (0, import_react.useMemo)(() => {
|
|
66
|
-
if (import_react.default.isValidElement(filter)) {
|
|
66
|
+
if (import_react.default.isValidElement(filter) || import_react.default.isValidElement(filter == null ? void 0 : filter.dom)) {
|
|
67
67
|
return true;
|
|
68
68
|
}
|
|
69
69
|
return (filter == null ? void 0 : filter.show) || (sort == null ? void 0 : sort.show) || (columnSetting == null ? void 0 : columnSetting.show) || (dataSourceGroup == null ? void 0 : dataSourceGroup.show) || view.multiple || (exportImport == null ? void 0 : exportImport.show);
|
|
@@ -79,6 +79,9 @@ var Actions = ({
|
|
|
79
79
|
if (import_react.default.isValidElement(filter)) {
|
|
80
80
|
return filter;
|
|
81
81
|
}
|
|
82
|
+
if (import_react.default.isValidElement(filter == null ? void 0 : filter.dom)) {
|
|
83
|
+
return filter.dom;
|
|
84
|
+
}
|
|
82
85
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
83
86
|
import_filter.default,
|
|
84
87
|
{
|
|
@@ -198,12 +198,12 @@ export declare const fieldList: ({
|
|
|
198
198
|
field_icon: string;
|
|
199
199
|
field_name: string;
|
|
200
200
|
field_type: string;
|
|
201
|
-
default_value:
|
|
201
|
+
default_value: string;
|
|
202
202
|
} | {
|
|
203
203
|
field_icon: string;
|
|
204
204
|
field_name: string;
|
|
205
205
|
field_type: string;
|
|
206
|
-
default_value:
|
|
206
|
+
default_value: boolean;
|
|
207
207
|
} | {
|
|
208
208
|
field_icon: string;
|
|
209
209
|
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" | "filter_setting" | "
|
|
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 {};
|
|
@@ -268,9 +268,9 @@ var useTableSetting = (params) => {
|
|
|
268
268
|
}
|
|
269
269
|
} else {
|
|
270
270
|
let names = /* @__PURE__ */ new Set();
|
|
271
|
-
if (import_react2.default.isValidElement(filter)) {
|
|
271
|
+
if (import_react2.default.isValidElement(filter) || import_react2.default.isValidElement(filter == null ? void 0 : filter.dom)) {
|
|
272
272
|
names = new Set(
|
|
273
|
-
((filter == null ? void 0 : filter.
|
|
273
|
+
((filter == null ? void 0 : filter.items) || []).filter((item) => !item.isHidden).map((item) => {
|
|
274
274
|
const rawName = item == null ? void 0 : item.value;
|
|
275
275
|
if (!rawName) return void 0;
|
|
276
276
|
return Array.isArray(rawName) ? rawName.join(",") : String(rawName);
|