@pisell/materials 1.0.497 → 1.0.498
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/meta.js +5 -5
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.js +7 -7
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +15 -2
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -3
- package/es/components/dataSourceComponents/dataSourceTable/filter/utils.js +5 -3
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useColumns.js +4 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +4 -4
- package/es/components/page/index.js +2 -6
- package/es/locales/en-US.d.ts +4 -0
- package/es/locales/en-US.js +5 -1
- package/es/locales/zh-CN.d.ts +4 -0
- package/es/locales/zh-CN.js +4 -0
- package/es/locales/zh-TW.d.ts +4 -0
- package/es/locales/zh-TW.js +4 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +12 -1
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -3
- package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.js +5 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useColumns.js +8 -3
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +4 -4
- package/lib/components/page/index.js +2 -2
- package/lib/locales/en-US.d.ts +4 -0
- package/lib/locales/en-US.js +5 -1
- package/lib/locales/zh-CN.d.ts +4 -0
- package/lib/locales/zh-CN.js +4 -0
- package/lib/locales/zh-TW.d.ts +4 -0
- package/lib/locales/zh-TW.js +4 -0
- package/lowcode/data-source-table/meta.ts +18 -1
- package/lowcode/data-source-table/utils.tsx +12 -11
- package/lowcode/form-item-input.json/snippets.ts +16 -0
- package/package.json +1 -1
|
@@ -25,7 +25,11 @@ import useDataSource from "../hooks/useDataSource";
|
|
|
25
25
|
import useFormSetting from "./provider/hooks/useFormSetting";
|
|
26
26
|
import useJsonPrefixPath from "./provider/hooks/useJsonPrefixPath";
|
|
27
27
|
import DataSourceProvider from "../provider/dataSource/DataSourceProvider";
|
|
28
|
+
import useEngineContext from "../../../hooks/useEngineContext";
|
|
28
29
|
import "./style.less";
|
|
30
|
+
var translationOriginal = function translationOriginal(val) {
|
|
31
|
+
return val.original;
|
|
32
|
+
};
|
|
29
33
|
/**
|
|
30
34
|
* @title: 增加renderMode属性
|
|
31
35
|
* @description: 基于renderMode属性控制渲染模式
|
|
@@ -98,7 +102,7 @@ export var withFormItem = function withFormItem(WrappedComponent, overlayProps)
|
|
|
98
102
|
minobj = _ref2.minobj,
|
|
99
103
|
normalize = _ref2.normalize,
|
|
100
104
|
getValueProps = _ref2.getValueProps,
|
|
101
|
-
|
|
105
|
+
_validator = _ref2.validator,
|
|
102
106
|
style = _ref2.style,
|
|
103
107
|
validateTrigger = _ref2.validateTrigger,
|
|
104
108
|
__designMode = _ref2.__designMode,
|
|
@@ -219,6 +223,13 @@ export var withFormItem = function withFormItem(WrappedComponent, overlayProps)
|
|
|
219
223
|
message: minobj.message || getText('pisell-data-source-form-min-value-message')(minobj === null || minobj === void 0 ? void 0 : minobj.min)
|
|
220
224
|
}));
|
|
221
225
|
}
|
|
226
|
+
if (_validator) {
|
|
227
|
+
rules.push({
|
|
228
|
+
validator: function validator(_, value) {
|
|
229
|
+
return _validator(value);
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
222
233
|
var labelCol = useMemo(function () {
|
|
223
234
|
if (hideLabel) {
|
|
224
235
|
return {
|
|
@@ -263,6 +274,8 @@ export var withDataSource = function withDataSource(WrappedComponent) {
|
|
|
263
274
|
export var withOptions = function withOptions(WrappedComponent) {
|
|
264
275
|
return function (props) {
|
|
265
276
|
var _list$data2;
|
|
277
|
+
var context = useEngineContext();
|
|
278
|
+
translationOriginal = context.appHelper.utils.translationOriginal || translationOriginal;
|
|
266
279
|
var propsOptions = props.options,
|
|
267
280
|
optionSourceType = props.optionSourceType,
|
|
268
281
|
labelField = props.labelField,
|
|
@@ -284,7 +297,7 @@ export var withOptions = function withOptions(WrappedComponent) {
|
|
|
284
297
|
}
|
|
285
298
|
return ((_list$data = list.data) === null || _list$data === void 0 ? void 0 : (_list$data$data = _list$data.data) === null || _list$data$data === void 0 ? void 0 : _list$data$data.map(function (item) {
|
|
286
299
|
return {
|
|
287
|
-
label: item[labelField],
|
|
300
|
+
label: translationOriginal(item[labelField]),
|
|
288
301
|
value: item[valueField]
|
|
289
302
|
};
|
|
290
303
|
})) || [];
|
|
@@ -36,7 +36,8 @@ var Filter = function Filter(props) {
|
|
|
36
36
|
sortButtonShow = _props$sortButtonShow === void 0 ? false : _props$sortButtonShow,
|
|
37
37
|
handleValuesChange = props.handleValuesChange,
|
|
38
38
|
search = props.search,
|
|
39
|
-
filterBy = props.filterBy
|
|
39
|
+
filterBy = props.filterBy,
|
|
40
|
+
show = props.show;
|
|
40
41
|
var _Form$useForm = Form.useForm(),
|
|
41
42
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
42
43
|
form = _Form$useForm2[0];
|
|
@@ -58,8 +59,11 @@ var Filter = function Filter(props) {
|
|
|
58
59
|
});
|
|
59
60
|
}, [items]);
|
|
60
61
|
var filterDom = useMemo(function () {
|
|
62
|
+
if (!show) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
61
65
|
return genFilterItems(list.quickFilter, dataSource);
|
|
62
|
-
}, [list.quickFilter]);
|
|
66
|
+
}, [list.quickFilter, show]);
|
|
63
67
|
useEffect(function () {
|
|
64
68
|
var storedOrder = getStoredFilterOrder(componentId);
|
|
65
69
|
if (!storedOrder) {
|
|
@@ -153,7 +157,7 @@ var Filter = function Filter(props) {
|
|
|
153
157
|
layout: "inline",
|
|
154
158
|
className: "filter-form-wrapper",
|
|
155
159
|
onValuesChange: onValuesChange
|
|
156
|
-
}, searchDom, filterDom, /*#__PURE__*/React.createElement(FilterButton, {
|
|
160
|
+
}, searchDom, filterDom, show && /*#__PURE__*/React.createElement(FilterButton, {
|
|
157
161
|
value: list,
|
|
158
162
|
quickFilterMaxLength: quickFilterMaxLength,
|
|
159
163
|
formFiltersPrefix: '',
|
|
@@ -37,9 +37,9 @@ var fieldType2FilterMap = {
|
|
|
37
37
|
'Checkbox.Group': 'FormItemSelect'
|
|
38
38
|
};
|
|
39
39
|
var getCptProps = function getCptProps(field, cptType, item) {
|
|
40
|
-
var _field$uiSchema, _field$uiSchema2, _field$uiSchema3, _field$uiSchema3$enum, _field$uiSchema6, _field$uiSchema8;
|
|
40
|
+
var _field$uiSchema, _props, _field$uiSchema2, _field$uiSchema3, _field$uiSchema3$enum, _field$uiSchema6, _field$uiSchema8, _item$other;
|
|
41
41
|
var props = (field === null || field === void 0 ? void 0 : (_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema['x-component-props']) || {};
|
|
42
|
-
props.style = _objectSpread(_objectSpread({}, (props === null ||
|
|
42
|
+
props.style = _objectSpread(_objectSpread({}, ((_props = props) === null || _props === void 0 ? void 0 : _props.style) || {}), {}, {
|
|
43
43
|
width: '200px',
|
|
44
44
|
margin: 0
|
|
45
45
|
});
|
|
@@ -60,7 +60,8 @@ var getCptProps = function getCptProps(field, cptType, item) {
|
|
|
60
60
|
props.defaultValue = field === null || field === void 0 ? void 0 : (_field$uiSchema7 = field.uiSchema) === null || _field$uiSchema7 === void 0 ? void 0 : _field$uiSchema7.default;
|
|
61
61
|
}
|
|
62
62
|
if (cptType === 'DateRangePicker') {
|
|
63
|
-
|
|
63
|
+
var _props2;
|
|
64
|
+
props.style = _objectSpread(_objectSpread({}, ((_props2 = props) === null || _props2 === void 0 ? void 0 : _props2.style) || {}), {}, {
|
|
64
65
|
width: '240px'
|
|
65
66
|
});
|
|
66
67
|
}
|
|
@@ -77,6 +78,7 @@ var getCptProps = function getCptProps(field, cptType, item) {
|
|
|
77
78
|
value: false
|
|
78
79
|
}];
|
|
79
80
|
}
|
|
81
|
+
props = _objectSpread(_objectSpread({}, props), (item === null || item === void 0 ? void 0 : (_item$other = item.other) === null || _item$other === void 0 ? void 0 : _item$other.fieldProps) || {});
|
|
80
82
|
return props;
|
|
81
83
|
};
|
|
82
84
|
export var field2Cpt = function field2Cpt(field, item, otherProps) {
|
|
@@ -7,7 +7,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
7
7
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
8
|
import React, { useMemo } from 'react';
|
|
9
9
|
import { getFieldComponent } from "../../fields";
|
|
10
|
-
var genFieldProps = function genFieldProps(field) {
|
|
10
|
+
var genFieldProps = function genFieldProps(field, fieldProps) {
|
|
11
11
|
var props = {
|
|
12
12
|
renderMode: 'view',
|
|
13
13
|
noStyle: true
|
|
@@ -19,6 +19,7 @@ var genFieldProps = function genFieldProps(field) {
|
|
|
19
19
|
}
|
|
20
20
|
props.options = field.uiSchema.enum;
|
|
21
21
|
}
|
|
22
|
+
props = _objectSpread(_objectSpread({}, props), fieldProps || {});
|
|
22
23
|
return props;
|
|
23
24
|
};
|
|
24
25
|
var useColumns = function useColumns(_ref) {
|
|
@@ -36,12 +37,13 @@ var useColumns = function useColumns(_ref) {
|
|
|
36
37
|
return useMemo(function () {
|
|
37
38
|
if (Object.keys(fieldMap).length === 0) return [];
|
|
38
39
|
return columns.map(function (column) {
|
|
40
|
+
var _other;
|
|
39
41
|
var field = fieldMap[column === null || column === void 0 ? void 0 : column.dataIndex];
|
|
40
42
|
|
|
41
43
|
// 优先 column.title -> field.title
|
|
42
44
|
var title = (column === null || column === void 0 ? void 0 : column.title) || (field === null || field === void 0 ? void 0 : field.title);
|
|
43
45
|
var FieldComponent = getFieldComponent(column === null || column === void 0 ? void 0 : column.fieldComponent) || 'div';
|
|
44
|
-
var fieldProps = genFieldProps(field);
|
|
46
|
+
var fieldProps = genFieldProps(field, (_other = column.other) === null || _other === void 0 ? void 0 : _other.fieldProps);
|
|
45
47
|
return _objectSpread(_objectSpread({}, column), {}, {
|
|
46
48
|
title: title,
|
|
47
49
|
render: function render(text) {
|
|
@@ -149,10 +149,10 @@ var useTableProps = function useTableProps(props) {
|
|
|
149
149
|
var handleClick = function handleClick() {
|
|
150
150
|
if (actionType === 'delete') {
|
|
151
151
|
Modal.confirm({
|
|
152
|
-
title: '
|
|
153
|
-
content: '
|
|
154
|
-
okText: '
|
|
155
|
-
cancelText: '
|
|
152
|
+
title: getText('pisell-delete-confirm-title'),
|
|
153
|
+
content: getText('pisell-delete-confirm-content'),
|
|
154
|
+
okText: getText('pisell-delete-confirm-ok'),
|
|
155
|
+
cancelText: getText('pisell-delete-confirm-cancel'),
|
|
156
156
|
onOk: function onOk() {
|
|
157
157
|
handleDelete(record);
|
|
158
158
|
}
|
|
@@ -60,9 +60,7 @@ var Page = function Page(props) {
|
|
|
60
60
|
if (props !== null && props !== void 0 && props.theme) {
|
|
61
61
|
var _props$theme, _props$theme$token;
|
|
62
62
|
return _objectSpread(_objectSpread({}, props.theme), {}, {
|
|
63
|
-
cssVar: {
|
|
64
|
-
key: 'app'
|
|
65
|
-
},
|
|
63
|
+
// cssVar: { key: 'app' },
|
|
66
64
|
token: _objectSpread(_objectSpread({}, props.theme.token), {}, {
|
|
67
65
|
// 外部透传主题时,如果没有传入colorPrimary 默认使用主项目内主题色
|
|
68
66
|
colorPrimary: (props === null || props === void 0 ? void 0 : (_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : (_props$theme$token = _props$theme.token) === null || _props$theme$token === void 0 ? void 0 : _props$theme$token.colorPrimary) || themeColor || '#7F56D9'
|
|
@@ -70,9 +68,7 @@ var Page = function Page(props) {
|
|
|
70
68
|
});
|
|
71
69
|
}
|
|
72
70
|
return {
|
|
73
|
-
cssVar: {
|
|
74
|
-
key: 'app'
|
|
75
|
-
},
|
|
71
|
+
// cssVar: { key: 'app' },
|
|
76
72
|
components: {
|
|
77
73
|
Table: {
|
|
78
74
|
colorFillContent: '#EAECF0',
|
package/es/locales/en-US.d.ts
CHANGED
|
@@ -162,5 +162,9 @@ declare const _default: {
|
|
|
162
162
|
'pisellQrcode-done': string;
|
|
163
163
|
'pisellQrcode-qrcode': string;
|
|
164
164
|
'pisell-design-mode-action-disabled': string;
|
|
165
|
+
'pisell-delete-confirm-title': string;
|
|
166
|
+
'pisell-delete-confirm-content': string;
|
|
167
|
+
'pisell-delete-confirm-ok': string;
|
|
168
|
+
'pisell-delete-confirm-cancel': string;
|
|
165
169
|
};
|
|
166
170
|
export default _default;
|
package/es/locales/en-US.js
CHANGED
|
@@ -212,5 +212,9 @@ export default {
|
|
|
212
212
|
//PisellQrcode组件
|
|
213
213
|
'pisellQrcode-done': 'Done',
|
|
214
214
|
'pisellQrcode-qrcode': 'QR code',
|
|
215
|
-
'pisell-design-mode-action-disabled': 'This action cannot be performed in edit mode'
|
|
215
|
+
'pisell-design-mode-action-disabled': 'This action cannot be performed in edit mode',
|
|
216
|
+
'pisell-delete-confirm-title': 'Confirm Delete',
|
|
217
|
+
'pisell-delete-confirm-content': 'Are you sure you want to delete this record?',
|
|
218
|
+
'pisell-delete-confirm-ok': 'OK',
|
|
219
|
+
'pisell-delete-confirm-cancel': 'Cancel'
|
|
216
220
|
};
|
package/es/locales/zh-CN.d.ts
CHANGED
|
@@ -161,6 +161,10 @@ declare const _default: {
|
|
|
161
161
|
'walletCard-discount': string;
|
|
162
162
|
'pisellQrcode-done': string;
|
|
163
163
|
'pisellQrcode-qrcode': string;
|
|
164
|
+
'pisell-delete-confirm-title': string;
|
|
165
|
+
'pisell-delete-confirm-content': string;
|
|
166
|
+
'pisell-delete-confirm-ok': string;
|
|
167
|
+
'pisell-delete-confirm-cancel': string;
|
|
164
168
|
'pisell-design-mode-action-disabled': string;
|
|
165
169
|
};
|
|
166
170
|
export default _default;
|
package/es/locales/zh-CN.js
CHANGED
|
@@ -211,5 +211,9 @@ export default {
|
|
|
211
211
|
//PisellQrcode组件
|
|
212
212
|
'pisellQrcode-done': '完成',
|
|
213
213
|
'pisellQrcode-qrcode': '二维码',
|
|
214
|
+
'pisell-delete-confirm-title': '确认删除',
|
|
215
|
+
'pisell-delete-confirm-content': '确定要删除该条记录吗?',
|
|
216
|
+
'pisell-delete-confirm-ok': '确定',
|
|
217
|
+
'pisell-delete-confirm-cancel': '取消',
|
|
214
218
|
'pisell-design-mode-action-disabled': '编辑模式下不可执行此操作'
|
|
215
219
|
};
|
package/es/locales/zh-TW.d.ts
CHANGED
|
@@ -161,6 +161,10 @@ declare const _default: {
|
|
|
161
161
|
'walletCard-discount': string;
|
|
162
162
|
'pisellQrcode-done': string;
|
|
163
163
|
'pisellQrcode-qrcode': string;
|
|
164
|
+
'pisell-delete-confirm-title': string;
|
|
165
|
+
'pisell-delete-confirm-content': string;
|
|
166
|
+
'pisell-delete-confirm-ok': string;
|
|
167
|
+
'pisell-delete-confirm-cancel': string;
|
|
164
168
|
'pisell-design-mode-action-disabled': string;
|
|
165
169
|
};
|
|
166
170
|
export default _default;
|
package/es/locales/zh-TW.js
CHANGED
|
@@ -212,5 +212,9 @@ export default {
|
|
|
212
212
|
//PisellQrcode组件
|
|
213
213
|
'pisellQrcode-done': '完成',
|
|
214
214
|
'pisellQrcode-qrcode': '二維碼',
|
|
215
|
+
'pisell-delete-confirm-title': '確認刪除',
|
|
216
|
+
'pisell-delete-confirm-content': '確定要刪除該條記錄嗎?',
|
|
217
|
+
'pisell-delete-confirm-ok': '確定',
|
|
218
|
+
'pisell-delete-confirm-cancel': '取消',
|
|
215
219
|
'pisell-design-mode-action-disabled': '編輯模式下不可執行此操作'
|
|
216
220
|
};
|
|
@@ -49,7 +49,9 @@ var import_useDataSource = __toESM(require("../hooks/useDataSource"));
|
|
|
49
49
|
var import_useFormSetting = __toESM(require("./provider/hooks/useFormSetting"));
|
|
50
50
|
var import_useJsonPrefixPath = __toESM(require("./provider/hooks/useJsonPrefixPath"));
|
|
51
51
|
var import_DataSourceProvider = __toESM(require("../provider/dataSource/DataSourceProvider"));
|
|
52
|
+
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
|
52
53
|
var import_style = require("./style.less");
|
|
54
|
+
var translationOriginal = (val) => val.original;
|
|
53
55
|
var withMode = (FieldComponent, ReadPrettyComponent, transformProps) => {
|
|
54
56
|
return ({ renderMode = "edit", value, onChange, ...props }) => {
|
|
55
57
|
const transformedProps = (transformProps == null ? void 0 : transformProps(
|
|
@@ -245,6 +247,13 @@ var withFormItem = (WrappedComponent, overlayProps) => {
|
|
|
245
247
|
message: minobj.message || (0, import_locales.getText)("pisell-data-source-form-min-value-message")(minobj == null ? void 0 : minobj.min)
|
|
246
248
|
});
|
|
247
249
|
}
|
|
250
|
+
if (validator) {
|
|
251
|
+
rules.push({
|
|
252
|
+
validator: (_, value) => {
|
|
253
|
+
return validator(value);
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
}
|
|
248
257
|
const labelCol = (0, import_react.useMemo)(() => {
|
|
249
258
|
if (hideLabel) {
|
|
250
259
|
return { span: 0 };
|
|
@@ -288,6 +297,8 @@ var withDataSource = (WrappedComponent) => {
|
|
|
288
297
|
var withOptions = (WrappedComponent) => {
|
|
289
298
|
return (props) => {
|
|
290
299
|
var _a;
|
|
300
|
+
const context = (0, import_useEngineContext.default)();
|
|
301
|
+
translationOriginal = context.appHelper.utils.translationOriginal || translationOriginal;
|
|
291
302
|
const {
|
|
292
303
|
options: propsOptions,
|
|
293
304
|
optionSourceType,
|
|
@@ -309,7 +320,7 @@ var withOptions = (WrappedComponent) => {
|
|
|
309
320
|
return propsOptions;
|
|
310
321
|
}
|
|
311
322
|
return ((_b = (_a2 = list.data) == null ? void 0 : _a2.data) == null ? void 0 : _b.map((item) => ({
|
|
312
|
-
label: item[labelField],
|
|
323
|
+
label: translationOriginal(item[labelField]),
|
|
313
324
|
value: item[valueField]
|
|
314
325
|
}))) || [];
|
|
315
326
|
}, [propsOptions, optionSourceType, (_a = list == null ? void 0 : list.data) == null ? void 0 : _a.data]);
|
|
@@ -51,7 +51,8 @@ var Filter = (props) => {
|
|
|
51
51
|
sortButtonShow = false,
|
|
52
52
|
handleValuesChange,
|
|
53
53
|
search,
|
|
54
|
-
filterBy
|
|
54
|
+
filterBy,
|
|
55
|
+
show
|
|
55
56
|
} = props;
|
|
56
57
|
const [form] = import_antd.Form.useForm();
|
|
57
58
|
const { dataSource } = (0, import_useDataSource.default)();
|
|
@@ -66,8 +67,11 @@ var Filter = (props) => {
|
|
|
66
67
|
return items.filter((item) => !(item == null ? void 0 : item.isHidden));
|
|
67
68
|
}, [items]);
|
|
68
69
|
const filterDom = (0, import_react.useMemo)(() => {
|
|
70
|
+
if (!show) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
69
73
|
return (0, import_utils.genFilterItems)(list.quickFilter, dataSource);
|
|
70
|
-
}, [list.quickFilter]);
|
|
74
|
+
}, [list.quickFilter, show]);
|
|
71
75
|
(0, import_react.useEffect)(() => {
|
|
72
76
|
const storedOrder = (0, import_utils.getStoredFilterOrder)(componentId);
|
|
73
77
|
if (!storedOrder) {
|
|
@@ -162,7 +166,7 @@ var Filter = (props) => {
|
|
|
162
166
|
},
|
|
163
167
|
searchDom,
|
|
164
168
|
filterDom,
|
|
165
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
169
|
+
show && /* @__PURE__ */ import_react.default.createElement(
|
|
166
170
|
import_FilterButton.default,
|
|
167
171
|
{
|
|
168
172
|
value: list,
|
|
@@ -66,7 +66,7 @@ var fieldType2FilterMap = {
|
|
|
66
66
|
"Checkbox.Group": "FormItemSelect"
|
|
67
67
|
};
|
|
68
68
|
var getCptProps = (field, cptType, item) => {
|
|
69
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
69
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
70
70
|
let props = ((_a = field == null ? void 0 : field.uiSchema) == null ? void 0 : _a["x-component-props"]) || {};
|
|
71
71
|
props.style = {
|
|
72
72
|
...(props == null ? void 0 : props.style) || {},
|
|
@@ -111,6 +111,10 @@ var getCptProps = (field, cptType, item) => {
|
|
|
111
111
|
}
|
|
112
112
|
];
|
|
113
113
|
}
|
|
114
|
+
props = {
|
|
115
|
+
...props,
|
|
116
|
+
...((_j = item == null ? void 0 : item.other) == null ? void 0 : _j.fieldProps) || {}
|
|
117
|
+
};
|
|
114
118
|
return props;
|
|
115
119
|
};
|
|
116
120
|
var field2Cpt = (field, item, otherProps) => {
|
|
@@ -34,8 +34,8 @@ __export(useColumns_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(useColumns_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_fields = require("../../fields");
|
|
37
|
-
var genFieldProps = (field) => {
|
|
38
|
-
|
|
37
|
+
var genFieldProps = (field, fieldProps) => {
|
|
38
|
+
let props = {
|
|
39
39
|
renderMode: "view",
|
|
40
40
|
noStyle: true
|
|
41
41
|
};
|
|
@@ -49,6 +49,10 @@ var genFieldProps = (field) => {
|
|
|
49
49
|
}
|
|
50
50
|
props.options = field.uiSchema.enum;
|
|
51
51
|
}
|
|
52
|
+
props = {
|
|
53
|
+
...props,
|
|
54
|
+
...fieldProps || {}
|
|
55
|
+
};
|
|
52
56
|
return props;
|
|
53
57
|
};
|
|
54
58
|
var useColumns = ({
|
|
@@ -68,10 +72,11 @@ var useColumns = ({
|
|
|
68
72
|
if (Object.keys(fieldMap).length === 0)
|
|
69
73
|
return [];
|
|
70
74
|
return columns.map((column) => {
|
|
75
|
+
var _a;
|
|
71
76
|
const field = fieldMap[column == null ? void 0 : column.dataIndex];
|
|
72
77
|
const title = (column == null ? void 0 : column.title) || (field == null ? void 0 : field.title);
|
|
73
78
|
const FieldComponent = (0, import_fields.getFieldComponent)(column == null ? void 0 : column.fieldComponent) || "div";
|
|
74
|
-
const fieldProps = genFieldProps(field);
|
|
79
|
+
const fieldProps = genFieldProps(field, (_a = column.other) == null ? void 0 : _a.fieldProps);
|
|
75
80
|
return {
|
|
76
81
|
...column,
|
|
77
82
|
title,
|
|
@@ -132,10 +132,10 @@ var useTableProps = (props) => {
|
|
|
132
132
|
const handleClick = () => {
|
|
133
133
|
if (actionType === "delete") {
|
|
134
134
|
import_antd.Modal.confirm({
|
|
135
|
-
title: "
|
|
136
|
-
content: "
|
|
137
|
-
okText: "
|
|
138
|
-
cancelText: "
|
|
135
|
+
title: (0, import_locales.getText)("pisell-delete-confirm-title"),
|
|
136
|
+
content: (0, import_locales.getText)("pisell-delete-confirm-content"),
|
|
137
|
+
okText: (0, import_locales.getText)("pisell-delete-confirm-ok"),
|
|
138
|
+
cancelText: (0, import_locales.getText)("pisell-delete-confirm-cancel"),
|
|
139
139
|
onOk: () => {
|
|
140
140
|
handleDelete(record);
|
|
141
141
|
}
|
|
@@ -79,7 +79,7 @@ var Page = (props) => {
|
|
|
79
79
|
if (props == null ? void 0 : props.theme) {
|
|
80
80
|
return {
|
|
81
81
|
...props.theme,
|
|
82
|
-
cssVar: { key:
|
|
82
|
+
// cssVar: { key: 'app' },
|
|
83
83
|
token: {
|
|
84
84
|
...props.theme.token,
|
|
85
85
|
// 外部透传主题时,如果没有传入colorPrimary 默认使用主项目内主题色
|
|
@@ -88,7 +88,7 @@ var Page = (props) => {
|
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
return {
|
|
91
|
-
cssVar: { key:
|
|
91
|
+
// cssVar: { key: 'app' },
|
|
92
92
|
components: {
|
|
93
93
|
Table: {
|
|
94
94
|
colorFillContent: "#EAECF0",
|
package/lib/locales/en-US.d.ts
CHANGED
|
@@ -162,5 +162,9 @@ declare const _default: {
|
|
|
162
162
|
'pisellQrcode-done': string;
|
|
163
163
|
'pisellQrcode-qrcode': string;
|
|
164
164
|
'pisell-design-mode-action-disabled': string;
|
|
165
|
+
'pisell-delete-confirm-title': string;
|
|
166
|
+
'pisell-delete-confirm-content': string;
|
|
167
|
+
'pisell-delete-confirm-ok': string;
|
|
168
|
+
'pisell-delete-confirm-cancel': string;
|
|
165
169
|
};
|
|
166
170
|
export default _default;
|
package/lib/locales/en-US.js
CHANGED
|
@@ -202,5 +202,9 @@ var en_US_default = {
|
|
|
202
202
|
//PisellQrcode组件
|
|
203
203
|
"pisellQrcode-done": "Done",
|
|
204
204
|
"pisellQrcode-qrcode": "QR code",
|
|
205
|
-
"pisell-design-mode-action-disabled": "This action cannot be performed in edit mode"
|
|
205
|
+
"pisell-design-mode-action-disabled": "This action cannot be performed in edit mode",
|
|
206
|
+
"pisell-delete-confirm-title": "Confirm Delete",
|
|
207
|
+
"pisell-delete-confirm-content": "Are you sure you want to delete this record?",
|
|
208
|
+
"pisell-delete-confirm-ok": "OK",
|
|
209
|
+
"pisell-delete-confirm-cancel": "Cancel"
|
|
206
210
|
};
|
package/lib/locales/zh-CN.d.ts
CHANGED
|
@@ -161,6 +161,10 @@ declare const _default: {
|
|
|
161
161
|
'walletCard-discount': string;
|
|
162
162
|
'pisellQrcode-done': string;
|
|
163
163
|
'pisellQrcode-qrcode': string;
|
|
164
|
+
'pisell-delete-confirm-title': string;
|
|
165
|
+
'pisell-delete-confirm-content': string;
|
|
166
|
+
'pisell-delete-confirm-ok': string;
|
|
167
|
+
'pisell-delete-confirm-cancel': string;
|
|
164
168
|
'pisell-design-mode-action-disabled': string;
|
|
165
169
|
};
|
|
166
170
|
export default _default;
|
package/lib/locales/zh-CN.js
CHANGED
|
@@ -201,5 +201,9 @@ var zh_CN_default = {
|
|
|
201
201
|
//PisellQrcode组件
|
|
202
202
|
"pisellQrcode-done": "完成",
|
|
203
203
|
"pisellQrcode-qrcode": "二维码",
|
|
204
|
+
"pisell-delete-confirm-title": "确认删除",
|
|
205
|
+
"pisell-delete-confirm-content": "确定要删除该条记录吗?",
|
|
206
|
+
"pisell-delete-confirm-ok": "确定",
|
|
207
|
+
"pisell-delete-confirm-cancel": "取消",
|
|
204
208
|
"pisell-design-mode-action-disabled": "编辑模式下不可执行此操作"
|
|
205
209
|
};
|
package/lib/locales/zh-TW.d.ts
CHANGED
|
@@ -161,6 +161,10 @@ declare const _default: {
|
|
|
161
161
|
'walletCard-discount': string;
|
|
162
162
|
'pisellQrcode-done': string;
|
|
163
163
|
'pisellQrcode-qrcode': string;
|
|
164
|
+
'pisell-delete-confirm-title': string;
|
|
165
|
+
'pisell-delete-confirm-content': string;
|
|
166
|
+
'pisell-delete-confirm-ok': string;
|
|
167
|
+
'pisell-delete-confirm-cancel': string;
|
|
164
168
|
'pisell-design-mode-action-disabled': string;
|
|
165
169
|
};
|
|
166
170
|
export default _default;
|
package/lib/locales/zh-TW.js
CHANGED
|
@@ -202,5 +202,9 @@ var zh_TW_default = {
|
|
|
202
202
|
//PisellQrcode组件
|
|
203
203
|
"pisellQrcode-done": "完成",
|
|
204
204
|
"pisellQrcode-qrcode": "二維碼",
|
|
205
|
+
"pisell-delete-confirm-title": "確認刪除",
|
|
206
|
+
"pisell-delete-confirm-content": "確定要刪除該條記錄嗎?",
|
|
207
|
+
"pisell-delete-confirm-ok": "確定",
|
|
208
|
+
"pisell-delete-confirm-cancel": "取消",
|
|
205
209
|
"pisell-design-mode-action-disabled": "編輯模式下不可執行此操作"
|
|
206
210
|
};
|
|
@@ -1377,6 +1377,23 @@ const dataSourceTable = {
|
|
|
1377
1377
|
defaultValue: false,
|
|
1378
1378
|
isRequired: true,
|
|
1379
1379
|
},
|
|
1380
|
+
{
|
|
1381
|
+
name: 'other',
|
|
1382
|
+
title: {
|
|
1383
|
+
label: {
|
|
1384
|
+
type: 'i18n',
|
|
1385
|
+
'en-US': 'Other Properties',
|
|
1386
|
+
'zh-CN': '其他拓展属性'
|
|
1387
|
+
},
|
|
1388
|
+
tip: {
|
|
1389
|
+
type: 'i18n',
|
|
1390
|
+
'en-US': 'Other extended properties',
|
|
1391
|
+
'zh-CN': '其他拓展属性'
|
|
1392
|
+
}
|
|
1393
|
+
},
|
|
1394
|
+
propType: 'object',
|
|
1395
|
+
setter: 'JsonSetter'
|
|
1396
|
+
}
|
|
1380
1397
|
],
|
|
1381
1398
|
},
|
|
1382
1399
|
},
|
|
@@ -1868,7 +1885,7 @@ const dataSourceTable = {
|
|
|
1868
1885
|
defaultValue: {
|
|
1869
1886
|
'en': 'Operation',
|
|
1870
1887
|
'zh-CN': '操作',
|
|
1871
|
-
'zh-
|
|
1888
|
+
'zh-HK': '操作',
|
|
1872
1889
|
type: 'i18n',
|
|
1873
1890
|
},
|
|
1874
1891
|
condition: {
|
|
@@ -97,6 +97,7 @@ export const fields2Columns = (fields: any[]) => {
|
|
|
97
97
|
// id: 'node_ocm49b0bm71',
|
|
98
98
|
// },
|
|
99
99
|
fieldComponent: createFormItemSchema(field, 'edit').componentName === 'JsonWrapper' ? 'FormItemInput.JSON' : createFormItemSchema(field, 'edit').componentName,
|
|
100
|
+
// fieldProps
|
|
100
101
|
}));
|
|
101
102
|
};
|
|
102
103
|
|
|
@@ -182,7 +183,7 @@ export const resetTableProps = (target: any) => {
|
|
|
182
183
|
type: 'i18n',
|
|
183
184
|
'en': 'Search',
|
|
184
185
|
'zh-CN': '搜索',
|
|
185
|
-
'zh-
|
|
186
|
+
'zh-HK': '搜索',
|
|
186
187
|
},
|
|
187
188
|
});
|
|
188
189
|
target.getProps().setPropValue('titleButtons', {
|
|
@@ -260,7 +261,7 @@ export const setDefaultOperationAndTitleButtons = (target: any) => {
|
|
|
260
261
|
type: 'i18n',
|
|
261
262
|
'en': 'Operation',
|
|
262
263
|
'zh-CN': '操作',
|
|
263
|
-
'zh-
|
|
264
|
+
'zh-HK': '操作',
|
|
264
265
|
},
|
|
265
266
|
align: 'center',
|
|
266
267
|
fixed: false,
|
|
@@ -271,7 +272,7 @@ export const setDefaultOperationAndTitleButtons = (target: any) => {
|
|
|
271
272
|
type: 'i18n',
|
|
272
273
|
'en': 'View',
|
|
273
274
|
'zh-CN': '查看',
|
|
274
|
-
'zh-
|
|
275
|
+
'zh-HK': '查看',
|
|
275
276
|
},
|
|
276
277
|
openMode: 'drawer',
|
|
277
278
|
openContentSize: 'middle',
|
|
@@ -279,7 +280,7 @@ export const setDefaultOperationAndTitleButtons = (target: any) => {
|
|
|
279
280
|
type: 'i18n',
|
|
280
281
|
'en': 'Detail',
|
|
281
282
|
'zh-CN': '详情',
|
|
282
|
-
'zh-
|
|
283
|
+
'zh-HK': '詳情',
|
|
283
284
|
},
|
|
284
285
|
actionType: 'view',
|
|
285
286
|
key: 'view',
|
|
@@ -289,7 +290,7 @@ export const setDefaultOperationAndTitleButtons = (target: any) => {
|
|
|
289
290
|
type: 'i18n',
|
|
290
291
|
'en': 'Edit',
|
|
291
292
|
'zh-CN': '编辑',
|
|
292
|
-
'zh-
|
|
293
|
+
'zh-HK': '編輯',
|
|
293
294
|
},
|
|
294
295
|
openMode: 'drawer',
|
|
295
296
|
openContentSize: 'middle',
|
|
@@ -297,7 +298,7 @@ export const setDefaultOperationAndTitleButtons = (target: any) => {
|
|
|
297
298
|
type: 'i18n',
|
|
298
299
|
'en': 'Edit',
|
|
299
300
|
'zh-CN': '编辑',
|
|
300
|
-
'zh-
|
|
301
|
+
'zh-HK': '編輯',
|
|
301
302
|
},
|
|
302
303
|
actionType: 'edit',
|
|
303
304
|
key: 'edit',
|
|
@@ -307,7 +308,7 @@ export const setDefaultOperationAndTitleButtons = (target: any) => {
|
|
|
307
308
|
type: 'i18n',
|
|
308
309
|
'en': 'Delete',
|
|
309
310
|
'zh-CN': '删除',
|
|
310
|
-
'zh-
|
|
311
|
+
'zh-HK': '刪除',
|
|
311
312
|
},
|
|
312
313
|
actionType: 'delete',
|
|
313
314
|
},
|
|
@@ -322,7 +323,7 @@ export const setDefaultOperationAndTitleButtons = (target: any) => {
|
|
|
322
323
|
type: 'i18n',
|
|
323
324
|
'en': 'Add',
|
|
324
325
|
'zh-CN': '添加',
|
|
325
|
-
'zh-
|
|
326
|
+
'zh-HK': '添加',
|
|
326
327
|
},
|
|
327
328
|
openMode: 'drawer',
|
|
328
329
|
openContentSize: 'middle',
|
|
@@ -330,7 +331,7 @@ export const setDefaultOperationAndTitleButtons = (target: any) => {
|
|
|
330
331
|
type: 'i18n',
|
|
331
332
|
'en': 'Add',
|
|
332
333
|
'zh-CN': '添加',
|
|
333
|
-
'zh-
|
|
334
|
+
'zh-HK': '添加',
|
|
334
335
|
},
|
|
335
336
|
actionType: 'add',
|
|
336
337
|
key: 'add',
|
|
@@ -340,7 +341,7 @@ export const setDefaultOperationAndTitleButtons = (target: any) => {
|
|
|
340
341
|
type: 'i18n',
|
|
341
342
|
'en': 'Add',
|
|
342
343
|
'zh-CN': '添加',
|
|
343
|
-
'zh-
|
|
344
|
+
'zh-HK': '添加',
|
|
344
345
|
},
|
|
345
346
|
},
|
|
346
347
|
},
|
|
@@ -391,7 +392,7 @@ export const setDefaultSearchFilter = (target: any, fields: any[]) => {
|
|
|
391
392
|
type: 'i18n',
|
|
392
393
|
'en': 'Search',
|
|
393
394
|
'zh-CN': '搜索',
|
|
394
|
-
'zh-
|
|
395
|
+
'zh-HK': '搜索',
|
|
395
396
|
},
|
|
396
397
|
});
|
|
397
398
|
|