plain-design 1.0.0-beta.143 → 1.0.0-beta.145
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/dist/plain-design.commonjs.min.js +1 -1
- package/dist/plain-design.min.js +1 -1
- package/dist/report.html +2 -2
- package/package.json +2 -2
- package/src/packages/components/AutoTable/use/useTableOption.ai.tsx +2 -2
- package/src/packages/components/Icon/icon.external.tsx +101 -0
- package/src/packages/components/Icon/index.tsx +10 -4
- package/src/packages/i18n/lang/en-us.ts +7 -0
- package/src/packages/i18n/lang/zh-cn.ts +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plain-design",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.145",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/plain-design.min.js",
|
|
6
6
|
"module": "dist/plain-design.commonjs.min.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dev": "cross-env APP_ENV=prod vue-cli-service serve",
|
|
16
16
|
"build": "cross-env APP_ENV=prod vue-cli-service build",
|
|
17
17
|
"release": "cross-env NODE_ENV=production webpack --config ./build/webpack.release.js --progress",
|
|
18
|
-
"ferv": "ferv ./
|
|
18
|
+
"ferv": "ferv ./plain-design -b plain-design/ -c -s -p 3379"
|
|
19
19
|
},
|
|
20
20
|
"author": "",
|
|
21
21
|
"license": "ISC",
|
|
@@ -462,7 +462,7 @@ export const useTableOptionAi = AutoModule.createRegistration((option) => {
|
|
|
462
462
|
processor: ({ list, render }) => {list.push({ key: 'ai-chat-button', seq: 2, render });},
|
|
463
463
|
render: () => (
|
|
464
464
|
<>
|
|
465
|
-
<Tooltip message={i18n.$it('table.aiButton').d('AI对话')}><Button icon="
|
|
465
|
+
<Tooltip message={i18n.$it('table.aiButton').d('AI对话')}><Button icon="ie-chat-ai-fill" onClick={methods.openChat}/></Tooltip>
|
|
466
466
|
{/*<Tooltip message="测试搜索"><Button icon="pi-bug" onClick={methods.testSearch}/></Tooltip>*/}
|
|
467
467
|
{/*<Tooltip message="测试搜索2"><Button icon="pi-bug" onClick={methods.testSearch2}/></Tooltip>*/}
|
|
468
468
|
{/*<Tooltip message="测试配置"><Button icon="pi-bug" onClick={methods.testSearch}/></Tooltip>*/}
|
|
@@ -476,7 +476,7 @@ export const useTableOptionAi = AutoModule.createRegistration((option) => {
|
|
|
476
476
|
option.hooks.onBaseTableAttrs.use((attrs) => {
|
|
477
477
|
if (!!aiConfig) {
|
|
478
478
|
attrs.formEditorFootRender = (formData) => (
|
|
479
|
-
<Tooltip message={i18n.$it('ai.smartFilling').d('智能填写')}><Button style={{ order: 20 }} icon="
|
|
479
|
+
<Tooltip message={i18n.$it('ai.smartFilling').d('智能填写')}><Button style={{ order: 20 }} icon="ie-chat-ai-fill" onClick={() => methods.smartFilling(formData)}/></Tooltip>
|
|
480
480
|
);
|
|
481
481
|
}
|
|
482
482
|
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import {RenderNode} from "@peryl/react-compose";
|
|
2
|
+
|
|
3
|
+
export const IconExternal: Record<string, () => RenderNode> = {
|
|
4
|
+
'ie-stick': () => (
|
|
5
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
6
|
+
<defs>
|
|
7
|
+
<linearGradient id="colorGradient" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
8
|
+
<stop offset="0%" stopColor="#f18ffa"/>
|
|
9
|
+
<stop offset="50%" stopColor="#8dbcff"/>
|
|
10
|
+
<stop offset="100%" stopColor="#337cef"/>
|
|
11
|
+
</linearGradient>
|
|
12
|
+
</defs>
|
|
13
|
+
<path fill="url(#colorGradient)"
|
|
14
|
+
d="M15.2238 15.5079L13.0111 20.1581C12.8687 20.4573 12.5107 20.5844 12.2115 20.442C12.1448 20.4103 12.0845 20.3665 12.0337 20.3129L8.49229 16.5741C8.39749 16.474 8.27113 16.4096 8.13445 16.3918L3.02816 15.7243C2.69958 15.6814 2.46804 15.3802 2.51099 15.0516C2.52056 14.9784 2.54359 14.9075 2.5789 14.8426L5.04031 10.3192C5.1062 10.1981 5.12839 10.058 5.10314 9.92253L4.16 4.85991C4.09931 4.53414 4.3142 4.22086 4.63997 4.16017C4.7126 4.14664 4.78711 4.14664 4.85974 4.16017L9.92237 5.10331C10.0579 5.12855 10.198 5.10637 10.319 5.04048L14.8424 2.57907C15.1335 2.42068 15.4979 2.52825 15.6562 2.81931C15.6916 2.88421 15.7146 2.95507 15.7241 3.02833L16.3916 8.13462C16.4095 8.2713 16.4739 8.39766 16.5739 8.49245L20.3127 12.0338C20.5533 12.2617 20.5636 12.6415 20.3357 12.8821C20.2849 12.9357 20.2246 12.9795 20.1579 13.0112L15.5078 15.224C15.3833 15.2832 15.283 15.3835 15.2238 15.5079ZM16.0206 17.435L17.4348 16.0208L21.6775 20.2634L20.2633 21.6776L16.0206 17.435Z"></path>
|
|
15
|
+
</svg>
|
|
16
|
+
),
|
|
17
|
+
'ie-chat-ai-fill': () => (
|
|
18
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
19
|
+
<defs>
|
|
20
|
+
<linearGradient id="colorGradient" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
21
|
+
<stop offset="0%" stopColor="#f18ffa"/>
|
|
22
|
+
<stop offset="50%" stopColor="#8dbcff"/>
|
|
23
|
+
<stop offset="100%" stopColor="#337cef"/>
|
|
24
|
+
</linearGradient>
|
|
25
|
+
</defs>
|
|
26
|
+
<path fill="url(#colorGradient)" d="M20.7134 8.12811L20.4668 8.69379C20.2864 9.10792 19.7136 9.10792 19.5331 8.69379L19.2866 8.12811C18.8471 7.11947 18.0555 6.31641 17.0677 5.87708L16.308 5.53922C15.8973 5.35653 15.8973 4.75881 16.308 4.57612L17.0252 4.25714C18.0384 3.80651 18.8442 2.97373 19.2761 1.93083L19.5293 1.31953C19.7058 0.893489 20.2942 0.893489 20.4706 1.31953L20.7238 1.93083C21.1558 2.97373 21.9616 3.80651 22.9748 4.25714L23.6919 4.57612C24.1027 4.75881 24.1027 5.35653 23.6919 5.53922L22.9323 5.87708C21.9445 6.31641 21.1529 7.11947 20.7134 8.12811ZM20 11C20.6986 11 21.3694 10.8806 21.9929 10.6611C21.9976 10.7735 22 10.8865 22 11C22 15.4183 18.4183 19 14 19V22.5C9 20.5 2 17.5 2 11C2 6.58172 5.58172 3 10 3H14C14.1135 3 14.2265 3.00237 14.3389 3.00705C14.1194 3.63061 14 4.30136 14 5C14 8.31371 16.6863 11 20 11Z"></path>
|
|
27
|
+
</svg>
|
|
28
|
+
),
|
|
29
|
+
'ie-chat-ai': () => (
|
|
30
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
31
|
+
<defs>
|
|
32
|
+
<linearGradient id="colorGradient" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
33
|
+
<stop offset="0%" stopColor="#f18ffa"/>
|
|
34
|
+
<stop offset="50%" stopColor="#8dbcff"/>
|
|
35
|
+
<stop offset="100%" stopColor="#337cef"/>
|
|
36
|
+
</linearGradient>
|
|
37
|
+
</defs>
|
|
38
|
+
<path fill="url(#colorGradient)" d="M20.7134 8.12811L20.4668 8.69379C20.2864 9.10792 19.7136 9.10792 19.5331 8.69379L19.2866 8.12811C18.8471 7.11947 18.0555 6.31641 17.0677 5.87708L16.308 5.53922C15.8973 5.35653 15.8973 4.75881 16.308 4.57612L17.0252 4.25714C18.0384 3.80651 18.8442 2.97373 19.2761 1.93083L19.5293 1.31953C19.7058 0.893489 20.2942 0.893489 20.4706 1.31953L20.7238 1.93083C21.1558 2.97373 21.9616 3.80651 22.9748 4.25714L23.6919 4.57612C24.1027 4.75881 24.1027 5.35653 23.6919 5.53922L22.9323 5.87708C21.9445 6.31641 21.1529 7.11947 20.7134 8.12811ZM10 3H14V5H10C6.68629 5 4 7.68629 4 11C4 14.61 6.46208 16.9656 12 19.4798V17H14C17.3137 17 20 14.3137 20 11H22C22 15.4183 18.4183 19 14 19V22.5C9 20.5 2 17.5 2 11C2 6.58172 5.58172 3 10 3Z"></path>
|
|
39
|
+
</svg>
|
|
40
|
+
),
|
|
41
|
+
'ie-undo': () => (
|
|
42
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
43
|
+
<path d="M11 20L1 12L11 4V9C16.5228 9 21 13.4772 21 19C21 19.2727 20.9891 19.5428 20.9677 19.81C19.5055 17.0364 16.6381 15.119 13.313 15.0053L13 15H10.9999L11 20ZM8.99986 13H10.9999L13.0341 13.0003L13.3814 13.0065C14.6657 13.0504 15.9053 13.3165 17.0568 13.7734C15.5898 12.0749 13.4204 11 11 11H9V8.16125L4.20156 12L8.99992 15.8387L8.99986 13Z"></path>
|
|
44
|
+
</svg>
|
|
45
|
+
),
|
|
46
|
+
'ie-redo': () => (
|
|
47
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
48
|
+
<path d="M13 14H11C7.54202 14 4.53953 15.9502 3.03239 18.8107C3.01093 18.5433 3 18.2729 3 18C3 12.4772 7.47715 8 13 8V2.5L23.5 11L13 19.5V14ZM11 12H15V15.3078L20.3214 11L15 6.69224V10H13C10.5795 10 8.41011 11.0749 6.94312 12.7735C8.20873 12.2714 9.58041 12 11 12Z"></path>
|
|
49
|
+
</svg>
|
|
50
|
+
),
|
|
51
|
+
'ie-import': () => (
|
|
52
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
53
|
+
<path d="M3 19H21V21H3V19ZM13 5.82843V17H11V5.82843L4.92893 11.8995L3.51472 10.4853L12 2L20.4853 10.4853L19.0711 11.8995L13 5.82843Z"></path>
|
|
54
|
+
</svg>
|
|
55
|
+
),
|
|
56
|
+
'ie-export': () => (
|
|
57
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
58
|
+
<path d="M3 19H21V21H3V19ZM13 13.1716L19.0711 7.1005L20.4853 8.51472L12 17L3.51472 8.51472L4.92893 7.1005L11 13.1716V2H13V13.1716Z"></path>
|
|
59
|
+
</svg>
|
|
60
|
+
),
|
|
61
|
+
'ie-clear': () => (
|
|
62
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
63
|
+
<path d="M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z"></path>
|
|
64
|
+
</svg>
|
|
65
|
+
),
|
|
66
|
+
'ie-external-link': () => (
|
|
67
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
68
|
+
<path d="M10 6V8H5V19H16V14H18V20C18 20.5523 17.5523 21 17 21H4C3.44772 21 3 20.5523 3 20V7C3 6.44772 3.44772 6 4 6H10ZM21 3V11H19L18.9999 6.413L11.2071 14.2071L9.79289 12.7929L17.5849 5H13V3H21Z"></path>
|
|
69
|
+
</svg>
|
|
70
|
+
),
|
|
71
|
+
'ie-thumbs-up': () => (
|
|
72
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
73
|
+
<path d="M2 8.99997H5V21H2C1.44772 21 1 20.5523 1 20V9.99997C1 9.44769 1.44772 8.99997 2 8.99997ZM7.29289 7.70708L13.6934 1.30661C13.8693 1.13066 14.1479 1.11087 14.3469 1.26016L15.1995 1.8996C15.6842 2.26312 15.9026 2.88253 15.7531 3.46966L14.5998 7.99997H21C22.1046 7.99997 23 8.8954 23 9.99997V12.1043C23 12.3656 22.9488 12.6243 22.8494 12.8658L19.755 20.3807C19.6007 20.7554 19.2355 21 18.8303 21H8C7.44772 21 7 20.5523 7 20V8.41419C7 8.14897 7.10536 7.89462 7.29289 7.70708Z"></path>
|
|
74
|
+
</svg>
|
|
75
|
+
),
|
|
76
|
+
'ie-thumbs-down': () => (
|
|
77
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
78
|
+
<path d="M22 15H19V3H22C22.5523 3 23 3.44772 23 4V14C23 14.5523 22.5523 15 22 15ZM16.7071 16.2929L10.3066 22.6934C10.1307 22.8693 9.85214 22.8891 9.65308 22.7398L8.8005 22.1004C8.3158 21.7369 8.09739 21.1174 8.24686 20.5303L9.40017 16H3C1.89543 16 1 15.1046 1 14V11.8957C1 11.6344 1.05118 11.3757 1.15064 11.1342L4.24501 3.61925C4.3993 3.24455 4.76447 3 5.16969 3H16C16.5523 3 17 3.44772 17 4V15.5858C17 15.851 16.8946 16.1054 16.7071 16.2929Z"></path>
|
|
79
|
+
</svg>
|
|
80
|
+
),
|
|
81
|
+
'ie-full-screen': () => (
|
|
82
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
83
|
+
<path d="M8 3V5H4V9H2V3H8ZM2 21V15H4V19H8V21H2ZM22 21H16V19H20V15H22V21ZM22 9H20V5H16V3H22V9Z"></path>
|
|
84
|
+
</svg>
|
|
85
|
+
),
|
|
86
|
+
'ie-full-screen-exit': () => (
|
|
87
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
88
|
+
<path d="M18 7H22V9H16V3H18V7ZM8 9H2V7H6V3H8V9ZM18 17V21H16V15H22V17H18ZM8 15V21H6V17H2V15H8Z"></path>
|
|
89
|
+
</svg>
|
|
90
|
+
),
|
|
91
|
+
'ie-backward': () => (
|
|
92
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
93
|
+
<path d="M15.0001 4.99976V10.9998L21.0001 11.0001L21.0001 13.0001L15.0001 12.9998V18.9998L7.99985 12L15.0001 4.99976ZM4.00006 18.9999L4.00006 4.99993H6.00006L6.00006 18.9999H4.00006Z"></path>
|
|
94
|
+
</svg>
|
|
95
|
+
),
|
|
96
|
+
'ie-forward': () => (
|
|
97
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
98
|
+
<path d="M8.99988 4.99976L16.0002 12L8.99988 18.9998V12.9998L2.9999 13.0001L2.99988 11.0001L8.99988 10.9998V4.99976ZM17.9999 18.9999L18 4.99993H20L19.9999 18.9999H17.9999Z"></path>
|
|
99
|
+
</svg>
|
|
100
|
+
)
|
|
101
|
+
};
|
|
@@ -5,6 +5,7 @@ import './icon.scss';
|
|
|
5
5
|
import {IconRegistration} from "./icon.registry";
|
|
6
6
|
import {renderNothing} from "../../utils/renderNothing";
|
|
7
7
|
import {ThemeStatus} from "../../uses/useStyle";
|
|
8
|
+
import {IconExternal} from "./icon.external";
|
|
8
9
|
|
|
9
10
|
IconRegistration.registry('pi-', ({ props }) => (<PlainIcon {...mergeAttrs({ style: { verticalAlign: 'baseline' } }, props)}/>));
|
|
10
11
|
|
|
@@ -28,11 +29,16 @@ export const Icon = designComponent({
|
|
|
28
29
|
|
|
29
30
|
watch(() => props.icon, async icon => {
|
|
30
31
|
if (!icon) {state.renderer = renderNothing;}
|
|
31
|
-
|
|
32
|
-
if (!
|
|
33
|
-
state.renderer =
|
|
32
|
+
|
|
33
|
+
if (!!IconExternal[icon!]) {
|
|
34
|
+
state.renderer = IconExternal[icon!];
|
|
34
35
|
} else {
|
|
35
|
-
|
|
36
|
+
const content = await IconRegistration.getIconRenderer({ props, attrs });
|
|
37
|
+
if (!content) {
|
|
38
|
+
state.renderer = renderNothing;
|
|
39
|
+
} else {
|
|
40
|
+
state.renderer = () => content;
|
|
41
|
+
}
|
|
36
42
|
}
|
|
37
43
|
}, { immediate: true });
|
|
38
44
|
|
|
@@ -116,6 +116,13 @@ export const EnUsLocale: tZhCnLocale = {
|
|
|
116
116
|
summary: 'Sum',
|
|
117
117
|
save: 'Save',
|
|
118
118
|
done: 'Done',
|
|
119
|
+
undo: 'Undo',
|
|
120
|
+
redo: 'Redo',
|
|
121
|
+
import: 'Import',
|
|
122
|
+
export: 'Export',
|
|
123
|
+
clear: 'Clear',
|
|
124
|
+
forward: 'Forward',
|
|
125
|
+
backward: 'Backward',
|
|
119
126
|
},
|
|
120
127
|
yes: 'YES',
|
|
121
128
|
no: 'NO',
|
|
@@ -114,6 +114,13 @@ export const ZhCnLocale = {
|
|
|
114
114
|
summary: '合计',
|
|
115
115
|
save: '保存',
|
|
116
116
|
done: '完成',
|
|
117
|
+
undo: '撤销',
|
|
118
|
+
redo: '重做',
|
|
119
|
+
import: '导入',
|
|
120
|
+
export: '导出',
|
|
121
|
+
clear: '清空',
|
|
122
|
+
forward: '前移',
|
|
123
|
+
backward: '后移',
|
|
117
124
|
},
|
|
118
125
|
yes: '是',
|
|
119
126
|
no: '否',
|
|
@@ -321,7 +328,7 @@ export const ZhCnLocale = {
|
|
|
321
328
|
require: '提问的内容不能为空',
|
|
322
329
|
tableAiPlaceholder: '你可以与ai对话实现对列表的查询、排序以及配置功能;比如:查询编号约等于129,创建时间大于前天的数据,先按照创建时间降序,再按照更新时间升序排序;最后是调宽编号字段的宽度',
|
|
323
330
|
formAiPlaceholder: '一句话描述你要编辑的数据内容',
|
|
324
|
-
smartFilling:'智能填写',
|
|
331
|
+
smartFilling: '智能填写',
|
|
325
332
|
}
|
|
326
333
|
} as const;
|
|
327
334
|
|