@pisell/materials 6.3.8 → 6.3.10
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 +155 -150
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +24 -25
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +34 -35
- package/dist/umd/materials.min.css +1 -0
- package/dist/umd/materials.min.js +1 -0
- package/dist/umd/static/DotsSix.57d66266.svg +1 -0
- package/dist/umd/static/arrow-left.e542294f.svg +1 -0
- package/dist/umd/static/arrow-right.763f03e0.svg +1 -0
- package/dist/umd/static/filter-lines.04a54ae9.svg +1 -0
- package/dist/umd/static/help-circle.31c9be40.svg +1 -0
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- 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/useDataSourceKey.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.Phone/serve.js +158 -22
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +21 -22
- package/es/components/pisellQRScanner/index.d.ts +0 -13
- package/es/components/pisellQRScanner/index.js +0 -8
- package/es/components/pisellText/components/Editable/index.d.ts +29 -0
- package/es/components/pisellText/components/Editable/index.js +130 -0
- package/es/components/pisellText/components/Editable/index.less +40 -0
- package/es/components/pisellText/index.d.ts +1 -0
- package/es/components/pisellText/index.js +2 -0
- package/es/components/pisellWalletPassCard/index.d.ts +0 -1
- package/es/components/productCard/components/Packages/utils.d.ts +1 -1
- package/es/components/select/index.js +4 -2
- package/es/components/select-time/index.d.ts +0 -1
- package/es/components/sortableList/index.d.ts +1 -1
- package/es/components/sortableList/index.js +2 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +9 -1
- package/es/components/table/Actions/component/ExportImport/index.js +55 -27
- package/es/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/es/components/table/Table/fields/index.d.ts +2 -2
- package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/serve.js +8 -0
- package/es/components/tabs/index.d.ts +1 -0
- package/es/components/tabs/index.js +9 -0
- package/es/components/walletCard/index.d.ts +11 -11
- package/es/components/walletCard/index.js +51 -40
- package/es/locales/en-US.d.ts +1 -1
- package/es/locales/en-US.js +2 -2
- package/es/locales/zh-CN.d.ts +1 -1
- package/es/locales/zh-CN.js +1 -1
- package/es/locales/zh-TW.d.ts +1 -1
- package/es/locales/zh-TW.js +1 -1
- package/es/typings.d.ts +7 -1
- package/es/utils/index.d.ts +1 -1
- package/es/utils/platform.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- 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/useDataSourceKey.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Phone/serve.js +182 -18
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +21 -22
- package/lib/components/pisellQRScanner/index.d.ts +0 -13
- package/lib/components/pisellText/components/Editable/index.d.ts +29 -0
- package/lib/components/pisellText/components/Editable/index.js +139 -0
- package/lib/components/pisellText/components/Editable/index.less +40 -0
- package/lib/components/pisellText/index.d.ts +1 -0
- package/lib/components/pisellText/index.js +2 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +0 -1
- package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
- package/lib/components/select/index.js +7 -2
- package/lib/components/select-time/index.d.ts +0 -1
- package/lib/components/sortableList/index.d.ts +1 -1
- package/lib/components/sortableList/index.js +2 -2
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +7 -1
- package/lib/components/table/Actions/component/ExportImport/index.js +37 -25
- package/lib/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/lib/components/table/Table/fields/index.d.ts +2 -2
- package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/serve.js +8 -0
- package/lib/components/tabs/index.d.ts +1 -0
- package/lib/components/tabs/index.js +5 -0
- package/lib/components/walletCard/index.d.ts +11 -11
- package/lib/components/walletCard/index.js +47 -29
- package/lib/locales/en-US.d.ts +1 -1
- package/lib/locales/en-US.js +2 -2
- package/lib/locales/zh-CN.d.ts +1 -1
- package/lib/locales/zh-CN.js +1 -1
- package/lib/locales/zh-TW.d.ts +1 -1
- package/lib/locales/zh-TW.js +1 -1
- package/lib/typings.d.ts +7 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/platform.d.ts +1 -1
- package/lowcode/pisell-text.editable/meta.ts +115 -0
- package/lowcode/pisell-text.editable/snippets.ts +15 -0
- package/lowcode/sortable-list/meta.ts +1 -1
- package/lowcode/wallet-card/meta.ts +20 -0
- package/package.json +2 -2
|
@@ -19,7 +19,7 @@ interface UseTablePropsProps {
|
|
|
19
19
|
*/
|
|
20
20
|
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
21
21
|
currentComponentId: any;
|
|
22
|
-
title: number | boolean | JSX.Element | React.ReactFragment | (() => React.ReactNode) | null | undefined;
|
|
22
|
+
title: string | number | boolean | JSX.Element | React.ReactFragment | (() => 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 | JSX.Element | React.ReactFragment | (() => React.ReactNode) | null | undefined;
|
|
31
|
+
subTitle: string | number | boolean | JSX.Element | React.ReactFragment | (() => React.ReactNode) | null | undefined;
|
|
32
32
|
buttons: any[] | null;
|
|
33
33
|
filter: {
|
|
34
34
|
dom: any;
|
|
@@ -97,32 +97,196 @@ var useCountries = () => {
|
|
|
97
97
|
}, [isShop]);
|
|
98
98
|
const currentData = (0, import_react.useMemo)(() => {
|
|
99
99
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
100
|
+
let codeList = null;
|
|
100
101
|
if (isShop) {
|
|
101
|
-
|
|
102
|
+
codeList = ((_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;
|
|
103
|
+
} else if (isPc) {
|
|
104
|
+
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;
|
|
105
|
+
} else if (isH5) {
|
|
106
|
+
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;
|
|
107
|
+
}
|
|
108
|
+
if (isShop || isPc || isH5) {
|
|
109
|
+
codeList = (codeList == null ? void 0 : codeList.length) > 0 ? codeList : defaultData;
|
|
110
|
+
console.log("codeList", codeList);
|
|
111
|
+
return codeList.map((item) => ({
|
|
102
112
|
...item,
|
|
103
113
|
prefix: `+${item.calling_code}`
|
|
104
114
|
}));
|
|
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;
|
|
115
|
-
if (codeList) {
|
|
116
|
-
return codeList.map((item) => ({
|
|
117
|
-
...item,
|
|
118
|
-
prefix: `+${item.calling_code}`
|
|
119
|
-
}));
|
|
120
|
-
}
|
|
121
115
|
}
|
|
122
116
|
return data;
|
|
123
|
-
}, [isShop, data, shopData]);
|
|
117
|
+
}, [isShop, isPc, isH5, data, shopData]);
|
|
124
118
|
return { data: currentData };
|
|
125
119
|
};
|
|
120
|
+
var defaultData = [
|
|
121
|
+
{
|
|
122
|
+
name: "Mexico",
|
|
123
|
+
code: "MX",
|
|
124
|
+
calling_code: "52",
|
|
125
|
+
currency_code: "MXN"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: "美国",
|
|
129
|
+
code: "US",
|
|
130
|
+
calling_code: "1",
|
|
131
|
+
currency_code: "USD"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: "加拿大",
|
|
135
|
+
code: "CA",
|
|
136
|
+
calling_code: "1",
|
|
137
|
+
currency_code: "CAD"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: "澳大利亚",
|
|
141
|
+
code: "AU",
|
|
142
|
+
calling_code: "61",
|
|
143
|
+
currency_code: "AUD"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "新西兰",
|
|
147
|
+
code: "NZ",
|
|
148
|
+
calling_code: "64",
|
|
149
|
+
currency_code: "NZD"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: "新加坡",
|
|
153
|
+
code: "SG",
|
|
154
|
+
calling_code: "65",
|
|
155
|
+
currency_code: "SGD"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "香港特别行政区",
|
|
159
|
+
code: "HK",
|
|
160
|
+
calling_code: "852",
|
|
161
|
+
currency_code: "HKD"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: "台湾",
|
|
165
|
+
code: "TW",
|
|
166
|
+
calling_code: "886",
|
|
167
|
+
currency_code: "TWD"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: "中国",
|
|
171
|
+
code: "CN",
|
|
172
|
+
calling_code: "86",
|
|
173
|
+
currency_code: "AUD"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "日本",
|
|
177
|
+
code: "JP",
|
|
178
|
+
calling_code: "81",
|
|
179
|
+
currency_code: "JPY"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: "韩国",
|
|
183
|
+
code: "KR",
|
|
184
|
+
calling_code: "82",
|
|
185
|
+
currency_code: "KRW"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: "马来西亚",
|
|
189
|
+
code: "MY",
|
|
190
|
+
calling_code: "60",
|
|
191
|
+
currency_code: "USD"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: "英国",
|
|
195
|
+
code: "GB",
|
|
196
|
+
calling_code: "44",
|
|
197
|
+
currency_code: "GBP"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: "法国",
|
|
201
|
+
code: "FR",
|
|
202
|
+
calling_code: "33",
|
|
203
|
+
currency_code: "EUR"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: "意大利",
|
|
207
|
+
code: "IT",
|
|
208
|
+
calling_code: "39",
|
|
209
|
+
currency_code: "EUR"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "Ireland",
|
|
213
|
+
code: "IE",
|
|
214
|
+
calling_code: "353",
|
|
215
|
+
currency_code: "EUR"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: "Netherlands",
|
|
219
|
+
code: "NL",
|
|
220
|
+
calling_code: "31",
|
|
221
|
+
currency_code: "EUR"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: "Germany",
|
|
225
|
+
code: "DE",
|
|
226
|
+
calling_code: "49",
|
|
227
|
+
currency_code: "EUR"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: "Spain",
|
|
231
|
+
code: "ES",
|
|
232
|
+
calling_code: "34",
|
|
233
|
+
currency_code: "EUR"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: "Finland",
|
|
237
|
+
code: "FI",
|
|
238
|
+
calling_code: "358",
|
|
239
|
+
currency_code: "EUR"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "Hungary",
|
|
243
|
+
code: "HU",
|
|
244
|
+
calling_code: "36",
|
|
245
|
+
currency_code: "HUF"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: "Indonesia",
|
|
249
|
+
code: "ID",
|
|
250
|
+
calling_code: "62",
|
|
251
|
+
currency_code: "IDR"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
name: "India",
|
|
255
|
+
code: "IND",
|
|
256
|
+
calling_code: "91",
|
|
257
|
+
currency_code: "INR"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
name: "Nigeria",
|
|
261
|
+
code: "NG",
|
|
262
|
+
calling_code: "234",
|
|
263
|
+
currency_code: "NGN"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
name: "Islamic Republic of Pakistan",
|
|
267
|
+
code: "PAK",
|
|
268
|
+
calling_code: "92",
|
|
269
|
+
currency_code: "PRK"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: "Philippines",
|
|
273
|
+
code: "PH",
|
|
274
|
+
calling_code: "63",
|
|
275
|
+
currency_code: "PHP"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
name: "Thailand",
|
|
279
|
+
code: "TH",
|
|
280
|
+
calling_code: "66",
|
|
281
|
+
currency_code: "THB"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
name: "South Africa",
|
|
285
|
+
code: "ZA",
|
|
286
|
+
calling_code: "27",
|
|
287
|
+
currency_code: "ZAR"
|
|
288
|
+
}
|
|
289
|
+
];
|
|
126
290
|
// Annotate the CommonJS export names for ESM import in node:
|
|
127
291
|
0 && (module.exports = {
|
|
128
292
|
getCountryDataList,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const SelectWithDataSource: (props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../../dataSourceForm/utils").WithModeProps & import("../../dataSourceForm/utils").WithFormItemProps & {
|
|
2
2
|
options?: any;
|
|
3
|
-
optionSourceType?: "
|
|
3
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
4
4
|
labelField: string;
|
|
5
5
|
valueField: string;
|
|
6
6
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -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) => 1000 | 2000 | 4000 | 8000;
|
|
@@ -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>;
|
|
@@ -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?: "
|
|
37
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
39
38
|
labelField: string;
|
|
40
39
|
valueField: string;
|
|
41
40
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -60,25 +59,7 @@ 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) => import("react").FC<import("./Input
|
|
64
|
-
options?: any;
|
|
65
|
-
optionSourceType?: "custom" | "default" | "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("./Input.Phone/WithMode").PhoneInputProps & 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("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("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<{}> & {
|
|
78
|
-
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
79
|
-
} & {
|
|
80
|
-
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
81
|
-
}) | (import("react").FC<import("./Input/type").InputProps> & {
|
|
62
|
+
declare const getFieldComponent: (fieldComponent: string) => (import("react").FC<import("./Input/type").InputProps> & {
|
|
82
63
|
JSON: import("react").FC<any>;
|
|
83
64
|
Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
84
65
|
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>;
|
|
@@ -98,5 +79,23 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
98
79
|
name?: string | undefined;
|
|
99
80
|
fieldKey?: string | undefined;
|
|
100
81
|
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
101
|
-
})
|
|
82
|
+
}) | import("react").FC<any> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & 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<{}> & {
|
|
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<{}> & {
|
|
87
|
+
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
88
|
+
} & {
|
|
89
|
+
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
90
|
+
}) | ((props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
91
|
+
options?: any;
|
|
92
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
93
|
+
labelField: string;
|
|
94
|
+
valueField: string;
|
|
95
|
+
extraParams?: Record<string, any> | undefined;
|
|
96
|
+
} & {
|
|
97
|
+
dataSource?: any;
|
|
98
|
+
}) => JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & 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 };
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './index.less';
|
|
3
|
-
import type { DetailedHTMLProps, HTMLAttributes, VideoHTMLAttributes, InputHTMLAttributes } from 'react';
|
|
4
|
-
declare type ExtendedDetailedHTMLProps<T extends HTMLAttributes<E>, E extends HTMLElement> = DetailedHTMLProps<T, E> & {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
};
|
|
7
|
-
declare global {
|
|
8
|
-
namespace JSX {
|
|
9
|
-
interface IntrinsicElements {
|
|
10
|
-
div: ExtendedDetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
11
|
-
video: DetailedHTMLProps<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
|
|
12
|
-
input: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
3
|
export interface PisellQRScannerProps {
|
|
17
4
|
/** 是否可见 */
|
|
18
5
|
visible: boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export declare type MultiLanguageValue = {
|
|
4
|
+
en: string;
|
|
5
|
+
'zh-CN': string;
|
|
6
|
+
'zh-HK': string;
|
|
7
|
+
};
|
|
8
|
+
export interface EditableConfig {
|
|
9
|
+
/** 是否禁用编辑 */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** 最大长度 */
|
|
12
|
+
maxLength?: number;
|
|
13
|
+
/** 编辑图标 */
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export interface EditableProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
17
|
+
/** 文本内容,支持字符串或多语言对象 */
|
|
18
|
+
value?: string | MultiLanguageValue;
|
|
19
|
+
/** 子节点内容,优先级高于 value */
|
|
20
|
+
children?: string;
|
|
21
|
+
/** 可编辑配置,boolean 时使用默认配置 */
|
|
22
|
+
editable?: boolean | EditableConfig;
|
|
23
|
+
/** 编辑变更回调 */
|
|
24
|
+
onChange?: (value: string | MultiLanguageValue) => void;
|
|
25
|
+
/** 输入框尺寸 */
|
|
26
|
+
size?: 'large' | 'middle' | 'small';
|
|
27
|
+
}
|
|
28
|
+
declare const Editable: React.FC<EditableProps>;
|
|
29
|
+
export default Editable;
|
|
@@ -0,0 +1,139 @@
|
|
|
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/pisellText/components/Editable/index.tsx
|
|
30
|
+
var Editable_exports = {};
|
|
31
|
+
__export(Editable_exports, {
|
|
32
|
+
default: () => Editable_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Editable_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_icon = __toESM(require("../../../icon"));
|
|
38
|
+
var import_utils = require("@pisell/utils");
|
|
39
|
+
var import_classnames = __toESM(require("classnames"));
|
|
40
|
+
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
41
|
+
var import_translation = __toESM(require("../../../translation"));
|
|
42
|
+
var import_index = require("./index.less");
|
|
43
|
+
var Editable = (props) => {
|
|
44
|
+
const {
|
|
45
|
+
value,
|
|
46
|
+
children,
|
|
47
|
+
editable = false,
|
|
48
|
+
onChange,
|
|
49
|
+
className,
|
|
50
|
+
size = "middle",
|
|
51
|
+
...others
|
|
52
|
+
} = props;
|
|
53
|
+
const context = (0, import_useEngineContext.default)();
|
|
54
|
+
const [isEditing, setIsEditing] = (0, import_react.useState)(false);
|
|
55
|
+
const editableConfig = (0, import_react.useMemo)(() => {
|
|
56
|
+
if (typeof editable === "boolean") {
|
|
57
|
+
return editable ? {} : null;
|
|
58
|
+
}
|
|
59
|
+
return editable || null;
|
|
60
|
+
}, [editable]);
|
|
61
|
+
const currentLocale = (0, import_react.useMemo)(() => {
|
|
62
|
+
var _a, _b;
|
|
63
|
+
const locale = (_b = (_a = context.appHelper.utils) == null ? void 0 : _a.storage) == null ? void 0 : _b.get("umi_locale");
|
|
64
|
+
return import_utils.locales.formatLocale(locale);
|
|
65
|
+
}, []);
|
|
66
|
+
const displayValue = (0, import_react.useMemo)(() => {
|
|
67
|
+
if (typeof children === "string") return children;
|
|
68
|
+
if (typeof value === "string") {
|
|
69
|
+
return value;
|
|
70
|
+
}
|
|
71
|
+
if (value && typeof value === "object") {
|
|
72
|
+
return value[currentLocale] || "";
|
|
73
|
+
}
|
|
74
|
+
return "";
|
|
75
|
+
}, [value, currentLocale, children]);
|
|
76
|
+
const isMultiLanguage = (0, import_react.useMemo)(() => {
|
|
77
|
+
return !!value && typeof value === "object";
|
|
78
|
+
}, [value]);
|
|
79
|
+
const handleEdit = () => {
|
|
80
|
+
if (editableConfig == null ? void 0 : editableConfig.disabled) return;
|
|
81
|
+
setIsEditing(true);
|
|
82
|
+
};
|
|
83
|
+
const handleInputChange = (newValue) => {
|
|
84
|
+
if (!onChange) return;
|
|
85
|
+
onChange(newValue);
|
|
86
|
+
};
|
|
87
|
+
if (isEditing && editableConfig) {
|
|
88
|
+
if (isMultiLanguage) {
|
|
89
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-text-editable-editing", className) }, /* @__PURE__ */ import_react.default.createElement(
|
|
90
|
+
import_translation.default,
|
|
91
|
+
{
|
|
92
|
+
value,
|
|
93
|
+
onChange: handleInputChange,
|
|
94
|
+
onPressEnter: () => setIsEditing(false),
|
|
95
|
+
maxLength: editableConfig.maxLength,
|
|
96
|
+
size,
|
|
97
|
+
autoFocus: true
|
|
98
|
+
}
|
|
99
|
+
));
|
|
100
|
+
}
|
|
101
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
102
|
+
import_antd.Input,
|
|
103
|
+
{
|
|
104
|
+
value: displayValue,
|
|
105
|
+
onChange: (e) => handleInputChange(e.target.value),
|
|
106
|
+
onPressEnter: () => setIsEditing(false),
|
|
107
|
+
maxLength: editableConfig.maxLength,
|
|
108
|
+
size,
|
|
109
|
+
autoFocus: true,
|
|
110
|
+
className: (0, import_classnames.default)("pisell-text-editable-input", className),
|
|
111
|
+
style: others.style
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
116
|
+
"span",
|
|
117
|
+
{
|
|
118
|
+
className: (0, import_classnames.default)("pisell-text-editable", className, {
|
|
119
|
+
"pisell-text-editable-enabled": editableConfig && !editableConfig.disabled
|
|
120
|
+
}),
|
|
121
|
+
...others
|
|
122
|
+
},
|
|
123
|
+
displayValue,
|
|
124
|
+
editableConfig && !editableConfig.disabled && !isEditing && /* @__PURE__ */ import_react.default.createElement(
|
|
125
|
+
"span",
|
|
126
|
+
{
|
|
127
|
+
className: "pisell-text-editable-edit-icon",
|
|
128
|
+
onClick: (e) => {
|
|
129
|
+
e.preventDefault();
|
|
130
|
+
e.stopPropagation();
|
|
131
|
+
handleEdit();
|
|
132
|
+
},
|
|
133
|
+
title: "点击编辑"
|
|
134
|
+
},
|
|
135
|
+
editableConfig.icon || /* @__PURE__ */ import_react.default.createElement(import_icon.default, { type: "pisell2-edit-05", size: 16 })
|
|
136
|
+
)
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
var Editable_default = Editable;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.pisell-text-editable {
|
|
2
|
+
position: relative;
|
|
3
|
+
|
|
4
|
+
&-enabled {
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&-edit-icon {
|
|
9
|
+
margin-left: 4px;
|
|
10
|
+
color: rgba(0, 0, 0, 0.45);
|
|
11
|
+
font-size: 12px;
|
|
12
|
+
opacity: 1;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
pointer-events: auto;
|
|
15
|
+
z-index: 1;
|
|
16
|
+
|
|
17
|
+
&:hover {
|
|
18
|
+
color: #1890ff;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// 确保内部的图标不会阻止点击事件
|
|
22
|
+
* {
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&-input {
|
|
28
|
+
min-width: 100px;
|
|
29
|
+
|
|
30
|
+
&.ant-input {
|
|
31
|
+
border: 1px solid #1890ff;
|
|
32
|
+
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&-editing {
|
|
37
|
+
display: inline-block;
|
|
38
|
+
width: 100%;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -4,5 +4,6 @@ export interface PisellTextProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
4
4
|
declare const PisellText: {
|
|
5
5
|
(props: PisellTextProps): JSX.Element;
|
|
6
6
|
Amount: (props: import("./components/Amount").AmountProps) => JSX.Element;
|
|
7
|
+
Editable: React.FC<import("./components/Editable").EditableProps>;
|
|
7
8
|
};
|
|
8
9
|
export default PisellText;
|
|
@@ -34,8 +34,10 @@ __export(pisellText_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(pisellText_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_Amount = __toESM(require("./components/Amount"));
|
|
37
|
+
var import_Editable = __toESM(require("./components/Editable"));
|
|
37
38
|
var PisellText = (props) => {
|
|
38
39
|
return /* @__PURE__ */ import_react.default.createElement("span", { ...props });
|
|
39
40
|
};
|
|
40
41
|
PisellText.Amount = import_Amount.default;
|
|
42
|
+
PisellText.Editable = import_Editable.default;
|
|
41
43
|
var pisellText_default = PisellText;
|
|
@@ -17,4 +17,4 @@ export declare const minusSign: (item: any, type?: string) => "" | "-";
|
|
|
17
17
|
* @Author: WangHan
|
|
18
18
|
* @Date: 2024-11-22 10:58
|
|
19
19
|
*/
|
|
20
|
-
export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) =>
|
|
20
|
+
export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => any;
|
|
@@ -51,6 +51,7 @@ var SelectBase = (0, import_react.forwardRef)((props, ref) => {
|
|
|
51
51
|
options,
|
|
52
52
|
dropdownRender: propsDropdownRender,
|
|
53
53
|
showSearch,
|
|
54
|
+
onSearch,
|
|
54
55
|
styleType,
|
|
55
56
|
optionFilterProp = "value",
|
|
56
57
|
popupClassName,
|
|
@@ -111,7 +112,10 @@ var SelectBase = (0, import_react.forwardRef)((props, ref) => {
|
|
|
111
112
|
size: "middle",
|
|
112
113
|
placeholder: (0, import_locales.getText)("select-dropdown-render-search"),
|
|
113
114
|
value: searchValue,
|
|
114
|
-
onChange: (e) =>
|
|
115
|
+
onChange: (e) => {
|
|
116
|
+
onSearch == null ? void 0 : onSearch(e.target.value);
|
|
117
|
+
setSearchValue(e.target.value);
|
|
118
|
+
},
|
|
115
119
|
bordered: false,
|
|
116
120
|
allowClear: true,
|
|
117
121
|
prefix: /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { style: { color: "#98A2B3" }, type: "pisell2-search-lg" })
|
|
@@ -142,7 +146,8 @@ var SelectBase = (0, import_react.forwardRef)((props, ref) => {
|
|
|
142
146
|
checkboxChecked,
|
|
143
147
|
propsDropdownRender,
|
|
144
148
|
searchValue,
|
|
145
|
-
showSearch
|
|
149
|
+
showSearch,
|
|
150
|
+
onSearch
|
|
146
151
|
]
|
|
147
152
|
);
|
|
148
153
|
if (styleType === "system") {
|
|
@@ -4,7 +4,7 @@ export interface SortableListProps<T> {
|
|
|
4
4
|
dataSource: Props<T>["list"];
|
|
5
5
|
onChange: Props<T>["onChange"];
|
|
6
6
|
rowKey: Props<T>["rowKey"];
|
|
7
|
-
renderItem?: (item: T) => React.ReactNode;
|
|
7
|
+
renderItem?: (item: T, index: number) => React.ReactNode;
|
|
8
8
|
activationConstraint?: Props<T>["activationConstraint"];
|
|
9
9
|
}
|
|
10
10
|
declare const SortableList: React.FC<SortableListProps<any>>;
|
|
@@ -54,8 +54,8 @@ var SortableList = (props) => {
|
|
|
54
54
|
activationConstraint
|
|
55
55
|
},
|
|
56
56
|
(params) => {
|
|
57
|
-
const { item, props: p, attributes, listeners, style } = params;
|
|
58
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { ...p, ...attributes, ...listeners, style }, renderItem == null ? void 0 : renderItem(item));
|
|
57
|
+
const { item, index, props: p, attributes, listeners, style } = params;
|
|
58
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { ...p, ...attributes, ...listeners, style }, renderItem == null ? void 0 : renderItem(item, index));
|
|
59
59
|
}
|
|
60
60
|
);
|
|
61
61
|
};
|