@pisell/materials 1.0.499 → 1.0.501
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 +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +14 -14
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +14 -14
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +2 -6
- package/es/components/dataSourceComponents/dataSourceTable/filter/utils.js +2 -1
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +2 -6
- package/es/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Translation/BaseTranslation.js +108 -0
- package/es/components/dataSourceComponents/fields/Translation/ReadPretty.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Translation/ReadPretty.js +13 -0
- package/es/components/dataSourceComponents/fields/Translation/ReadPretty.less +11 -0
- package/es/components/dataSourceComponents/fields/Translation/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Translation/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/Translation/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Translation/index.js +4 -0
- package/es/components/dataSourceComponents/fields/Translation/index.less +58 -0
- package/es/components/dataSourceComponents/fields/Translation/type.d.ts +15 -0
- package/es/components/dataSourceComponents/fields/Translation/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +142 -39
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.js +35 -11
- package/es/components/dataSourceComponents/fields/Upload/index.less +7 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.js +3 -0
- package/es/components/dataSourceComponents/fields/index.d.ts +2 -1
- package/es/components/dataSourceComponents/fields/index.js +3 -1
- package/es/hooks/useTranslationOriginal.d.ts +2 -0
- package/es/hooks/useTranslationOriginal.js +9 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locales/en-US.d.ts +1 -0
- package/es/locales/en-US.js +7 -2
- package/es/locales/zh-CN.d.ts +1 -0
- package/es/locales/zh-CN.js +2 -1
- package/es/locales/zh-TW.d.ts +1 -0
- package/es/locales/zh-TW.js +2 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +2 -4
- package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.js +2 -1
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +2 -4
- package/lib/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Translation/BaseTranslation.js +112 -0
- package/lib/components/dataSourceComponents/fields/Translation/ReadPretty.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Translation/ReadPretty.js +50 -0
- package/lib/components/dataSourceComponents/fields/Translation/ReadPretty.less +11 -0
- package/lib/components/dataSourceComponents/fields/Translation/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Translation/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/Translation/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Translation/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/Translation/index.less +58 -0
- package/lib/components/dataSourceComponents/fields/Translation/type.d.ts +15 -0
- package/lib/components/dataSourceComponents/fields/Translation/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +67 -2
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.js +24 -4
- package/lib/components/dataSourceComponents/fields/Upload/index.less +7 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.js +2 -0
- package/lib/components/dataSourceComponents/fields/index.d.ts +2 -1
- package/lib/components/dataSourceComponents/fields/index.js +3 -1
- package/lib/hooks/useTranslationOriginal.d.ts +2 -0
- package/lib/hooks/useTranslationOriginal.js +41 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/locales/en-US.d.ts +1 -0
- package/lib/locales/en-US.js +3 -1
- package/lib/locales/zh-CN.d.ts +1 -0
- package/lib/locales/zh-CN.js +2 -1
- package/lib/locales/zh-TW.d.ts +1 -0
- package/lib/locales/zh-TW.js +2 -1
- package/lowcode/data-source-form/constants.ts +1 -0
- package/lowcode/data-source-form/utils.ts +12 -1
- package/lowcode/form-item-translation/meta.ts +249 -0
- package/lowcode/form-item-translation/snippets.ts +13 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -80,6 +80,7 @@ __export(src_exports, {
|
|
|
80
80
|
FormItemRadio: () => import_Radio.default,
|
|
81
81
|
FormItemSelect: () => import_Select.default,
|
|
82
82
|
FormItemTimePicker: () => import_TimePicker.default,
|
|
83
|
+
FormItemTranslation: () => import_Translation.default,
|
|
83
84
|
FormItemUpload: () => import_Upload.default,
|
|
84
85
|
Grid: () => import_antd12.Grid,
|
|
85
86
|
Icon: () => import_icon.default,
|
|
@@ -313,6 +314,7 @@ var import_Radio = __toESM(require("./components/dataSourceComponents/fields/Rad
|
|
|
313
314
|
var import_Select = __toESM(require("./components/dataSourceComponents/fields/Select"));
|
|
314
315
|
var import_TimePicker = __toESM(require("./components/dataSourceComponents/fields/TimePicker"));
|
|
315
316
|
var import_Upload = __toESM(require("./components/dataSourceComponents/fields/Upload"));
|
|
317
|
+
var import_Translation = __toESM(require("./components/dataSourceComponents/fields/Translation"));
|
|
316
318
|
var import_dataSourceTable = __toESM(require("./components/dataSourceComponents/dataSourceTable"));
|
|
317
319
|
var import_dataSourceWrapper = __toESM(require("./components/dataSourceComponents/dataSourceWrapper"));
|
|
318
320
|
var import_dataSourceTypography = __toESM(require("./components/dataSourceComponents/dataSourceShow/dataSourceTypography"));
|
|
@@ -371,6 +373,7 @@ var import_dataSourceQRCode = __toESM(require("./components/dataSourceComponents
|
|
|
371
373
|
FormItemRadio,
|
|
372
374
|
FormItemSelect,
|
|
373
375
|
FormItemTimePicker,
|
|
376
|
+
FormItemTranslation,
|
|
374
377
|
FormItemUpload,
|
|
375
378
|
Grid,
|
|
376
379
|
Icon,
|
package/lib/locales/en-US.d.ts
CHANGED
package/lib/locales/en-US.js
CHANGED
|
@@ -211,5 +211,7 @@ var en_US_default = {
|
|
|
211
211
|
"pisell-delete-confirm-title": "Confirm Delete",
|
|
212
212
|
"pisell-delete-confirm-content": "Are you sure you want to delete this record?",
|
|
213
213
|
"pisell-delete-confirm-ok": "OK",
|
|
214
|
-
"pisell-delete-confirm-cancel": "Cancel"
|
|
214
|
+
"pisell-delete-confirm-cancel": "Cancel",
|
|
215
|
+
"pisell-design-mode-action-disabled": "This operation is not allowed in edit mode",
|
|
216
|
+
"pisell-translation-original": "Original"
|
|
215
217
|
};
|
package/lib/locales/zh-CN.d.ts
CHANGED
package/lib/locales/zh-CN.js
CHANGED
|
@@ -210,5 +210,6 @@ var zh_CN_default = {
|
|
|
210
210
|
"pisell-delete-confirm-content": "确定要删除该条记录吗?",
|
|
211
211
|
"pisell-delete-confirm-ok": "确定",
|
|
212
212
|
"pisell-delete-confirm-cancel": "取消",
|
|
213
|
-
"pisell-design-mode-action-disabled": "编辑模式下不可执行此操作"
|
|
213
|
+
"pisell-design-mode-action-disabled": "编辑模式下不可执行此操作",
|
|
214
|
+
"pisell-translation-original": "原始语言"
|
|
214
215
|
};
|
package/lib/locales/zh-TW.d.ts
CHANGED
package/lib/locales/zh-TW.js
CHANGED
|
@@ -211,5 +211,6 @@ var zh_TW_default = {
|
|
|
211
211
|
"pisell-delete-confirm-content": "確定要刪除該條記錄嗎?",
|
|
212
212
|
"pisell-delete-confirm-ok": "確定",
|
|
213
213
|
"pisell-delete-confirm-cancel": "取消",
|
|
214
|
-
"pisell-design-mode-action-disabled": "編輯模式下不可執行此操作"
|
|
214
|
+
"pisell-design-mode-action-disabled": "編輯模式下不可執行此操作",
|
|
215
|
+
"pisell-translation-original": "原始語言"
|
|
215
216
|
};
|
|
@@ -163,6 +163,12 @@ export const createFormItemSchema = (
|
|
|
163
163
|
componentName = 'Upload';
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
if (item?.interface === 'i18nAttachment') {
|
|
167
|
+
cptTitle = '多媒体文件上传';
|
|
168
|
+
componentName = 'Upload';
|
|
169
|
+
props.enableMultilingual = true;
|
|
170
|
+
}
|
|
171
|
+
|
|
166
172
|
if (validator && validator !== 'integer') {
|
|
167
173
|
if (validator === 'email') {
|
|
168
174
|
cptTitle = '电子邮箱输入';
|
|
@@ -174,7 +180,7 @@ export const createFormItemSchema = (
|
|
|
174
180
|
};
|
|
175
181
|
}
|
|
176
182
|
|
|
177
|
-
if (xComponent === 'Input.JSON') {
|
|
183
|
+
if (xComponent === 'Input.JSON' && item?.interface !== 'i18nInput') {
|
|
178
184
|
const jsonChildren = item._children || item.children || [];
|
|
179
185
|
|
|
180
186
|
// 如果有children属性,递归创建子表单项
|
|
@@ -207,6 +213,11 @@ export const createFormItemSchema = (
|
|
|
207
213
|
}
|
|
208
214
|
}
|
|
209
215
|
|
|
216
|
+
if (item?.interface === 'i18nInput') {
|
|
217
|
+
cptTitle = '多语言输入';
|
|
218
|
+
componentName = 'Translation';
|
|
219
|
+
}
|
|
220
|
+
|
|
210
221
|
if (
|
|
211
222
|
['Select', 'Radio.Group', 'Checkbox.Group'].includes(xComponent) &&
|
|
212
223
|
uiSchema?.enum?.length > 0
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import snippets from './snippets';
|
|
2
|
+
import {
|
|
3
|
+
formItemGeneralDataGroup,
|
|
4
|
+
getFormItemGeneralInfoGroup,
|
|
5
|
+
generalItemMap,
|
|
6
|
+
getFormItemValidateGroup,
|
|
7
|
+
} from '../_utils/defaultSchema';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
snippets,
|
|
11
|
+
componentName: 'FormItemTranslation',
|
|
12
|
+
title: '多语言文本',
|
|
13
|
+
category: '表单',
|
|
14
|
+
group: '无代码组件',
|
|
15
|
+
docUrl: '',
|
|
16
|
+
screenshot: '',
|
|
17
|
+
devMode: 'proCode',
|
|
18
|
+
npm: {
|
|
19
|
+
package: '@pisell/materials',
|
|
20
|
+
version: '1.0.1',
|
|
21
|
+
exportName: 'FormItemTranslation',
|
|
22
|
+
main: 'src/index.tsx',
|
|
23
|
+
destructuring: true,
|
|
24
|
+
subName: '',
|
|
25
|
+
},
|
|
26
|
+
generalProps: [
|
|
27
|
+
formItemGeneralDataGroup,
|
|
28
|
+
getFormItemGeneralInfoGroup([
|
|
29
|
+
generalItemMap['label'],
|
|
30
|
+
generalItemMap['placeholder'],
|
|
31
|
+
generalItemMap['tooltip'],
|
|
32
|
+
generalItemMap['extra'],
|
|
33
|
+
generalItemMap['hideLabel'],
|
|
34
|
+
generalItemMap['renderMode'],
|
|
35
|
+
// generalItemMap['defaultValue'],
|
|
36
|
+
]),
|
|
37
|
+
getFormItemValidateGroup([
|
|
38
|
+
generalItemMap['requiredobj'],
|
|
39
|
+
generalItemMap['minLengthobj'],
|
|
40
|
+
generalItemMap['maxLengthobj'],
|
|
41
|
+
generalItemMap['typeobj'],
|
|
42
|
+
]),
|
|
43
|
+
],
|
|
44
|
+
props: [
|
|
45
|
+
{
|
|
46
|
+
name: 'defaultValue',
|
|
47
|
+
title: { label: '默认值', tip: '默认内容' },
|
|
48
|
+
propType: 'string',
|
|
49
|
+
setter: 'StringSetter',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'value',
|
|
53
|
+
title: { label: '当前值', tip: '当前值' },
|
|
54
|
+
propType: 'string',
|
|
55
|
+
setter: 'StringSetter',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'allowClear',
|
|
59
|
+
title: { label: '支持清除', tip: '是否允许清除' },
|
|
60
|
+
propType: 'bool',
|
|
61
|
+
setter: 'BoolSetter',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'bordered',
|
|
65
|
+
title: { label: '显示边框', tip: '是否有边框' },
|
|
66
|
+
propType: 'bool',
|
|
67
|
+
defaultValue: true,
|
|
68
|
+
setter: 'BoolSetter',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'disabled',
|
|
72
|
+
title: { label: '是否禁用', tip: '是否为禁用状态' },
|
|
73
|
+
propType: 'bool',
|
|
74
|
+
defaultValue: false,
|
|
75
|
+
setter: 'BoolSetter',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'readOnly',
|
|
79
|
+
title: { label: '是否只读', tip: '是否为只读状态' },
|
|
80
|
+
propType: 'bool',
|
|
81
|
+
defaultValue: false,
|
|
82
|
+
setter: 'BoolSetter',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'placeholder',
|
|
86
|
+
title: { label: '占位提示', tip: '占位提示' },
|
|
87
|
+
propType: 'string',
|
|
88
|
+
defaultValue: '请输入',
|
|
89
|
+
setter: 'PisellI18nSetter',
|
|
90
|
+
},
|
|
91
|
+
// {
|
|
92
|
+
// name: 'id',
|
|
93
|
+
// title: { label: '输入框ID', tip: '输入框的ID' },
|
|
94
|
+
// propType: 'string',
|
|
95
|
+
// },
|
|
96
|
+
{
|
|
97
|
+
name: 'maxLength',
|
|
98
|
+
title: { label: '最大长度', tip: '最大长度' },
|
|
99
|
+
propType: 'number',
|
|
100
|
+
setter: 'NumberSetter',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'size',
|
|
104
|
+
title: { label: '控件大小', tip: '控件大小' },
|
|
105
|
+
setter: {
|
|
106
|
+
componentName: 'RadioGroupSetter',
|
|
107
|
+
props: {
|
|
108
|
+
options: [
|
|
109
|
+
{
|
|
110
|
+
title: '大',
|
|
111
|
+
value: 'large',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
title: '中',
|
|
115
|
+
value: 'middle',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
title: '小',
|
|
119
|
+
value: 'small',
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
propType: { type: 'oneOf', value: ['large', 'middle', 'small'] },
|
|
125
|
+
defaultValue: 'middle',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'addonAfter',
|
|
129
|
+
title: { label: '后置标签', tip: '后置标签' },
|
|
130
|
+
propType: { type: 'oneOfType', value: ['string', 'node'] },
|
|
131
|
+
setter: ['PisellI18nSetter', 'SlotSetter'],
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'addonBefore',
|
|
135
|
+
title: { label: '前置标签', tip: '前置标签' },
|
|
136
|
+
propType: { type: 'oneOfType', value: ['string', 'node'] },
|
|
137
|
+
setter: ['PisellI18nSetter', 'SlotSetter'],
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'prefix',
|
|
141
|
+
title: { label: '前缀', tip: '前缀' },
|
|
142
|
+
propType: { type: 'oneOfType', value: ['string', 'node'] },
|
|
143
|
+
setter: ['PisellI18nSetter', 'SlotSetter'],
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: 'suffix',
|
|
147
|
+
title: { label: '后缀', tip: '后缀' },
|
|
148
|
+
propType: { type: 'oneOfType', value: ['string', 'node'] },
|
|
149
|
+
setter: ['PisellI18nSetter', 'SlotSetter'],
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'onChange',
|
|
153
|
+
title: { label: '输入框内容变化时的回调', tip: '输入框内容变化时的回调' },
|
|
154
|
+
propType: 'func',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'onPressEnter',
|
|
158
|
+
title: { label: '按下回车的回调', tip: '按下回车的回调' },
|
|
159
|
+
propType: 'func',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'onFocus',
|
|
163
|
+
title: { label: '获取焦点回调', tip: '获取焦点回调' },
|
|
164
|
+
propType: 'func',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: 'onKeyDown',
|
|
168
|
+
title: { label: '按键按下时的回调', tip: '按键按下时的回调' },
|
|
169
|
+
propType: 'func',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: 'onKeyPress',
|
|
173
|
+
title: { label: '按键按下后的回调', tip: '按键按下之后释放之前的回调' },
|
|
174
|
+
propType: 'func',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: 'onKeyUp',
|
|
178
|
+
title: { label: '按键释放回调', tip: '按键释放之后的回调' },
|
|
179
|
+
propType: 'func',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: 'onBlur',
|
|
183
|
+
title: { label: '失去焦点回调', tip: '失去焦点回调' },
|
|
184
|
+
propType: 'func',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: 'onClick',
|
|
188
|
+
title: { label: '点击回调', tip: '点击回调' },
|
|
189
|
+
propType: 'func',
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: 'onClear',
|
|
193
|
+
title: { label: '按下清除按钮的回调', tip: '按下清除按钮的回调' },
|
|
194
|
+
propType: 'func',
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
configure: {
|
|
198
|
+
supports: {
|
|
199
|
+
style: true,
|
|
200
|
+
events: [
|
|
201
|
+
{
|
|
202
|
+
name: 'onChange',
|
|
203
|
+
template:
|
|
204
|
+
"onChange(event,${extParams}){\n// 输入框内容变化时的回调\nconsole.log('onChange',event);}",
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: 'onPressEnter',
|
|
208
|
+
template:
|
|
209
|
+
"onPressEnter(event,${extParams}){\n// 按下回车的回调\nconsole.log('onPressEnter',event);}",
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: 'onFocus',
|
|
213
|
+
template:
|
|
214
|
+
"onFocus(event,${extParams}){\n// 获取焦点回调\nconsole.log('onFocus',event);}",
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: 'onKeyDown',
|
|
218
|
+
template:
|
|
219
|
+
"onKeyDown(event,${extParams}){\n// 按键按下时的回调\nconsole.log('onKeyDown',event);}",
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: 'onKeyPress',
|
|
223
|
+
template:
|
|
224
|
+
"onKeyPress(event,${extParams}){\n// 按键按下后的回调\nconsole.log('onKeyPress',event);}",
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
name: 'onKeyUp',
|
|
228
|
+
template:
|
|
229
|
+
"onKeyUp(event,${extParams}){\n// 按键释放回调\nconsole.log('onKeyUp',event);}",
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: 'onBlur',
|
|
233
|
+
template:
|
|
234
|
+
"onBlur(event,${extParams}){\n// 按键释放回调\nconsole.log('onBlur',event);}",
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: 'onClick',
|
|
238
|
+
template:
|
|
239
|
+
"onClick(event,${extParams}){\n// 点击回调\nconsole.log('onClick',event);}",
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: 'onClear',
|
|
243
|
+
template:
|
|
244
|
+
"onClear(event,${extParams}){\n// 按下清除按钮的回调\nconsole.log('onClear',event);}",
|
|
245
|
+
},
|
|
246
|
+
],
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
};
|