Compare commits

..

1870 Commits

Author SHA1 Message Date
roymondchen
084ff6ff68 feat(cli): packages配置不做去重处理,因为组件type与数据源type可能相同 2026-03-02 17:19:32 +08:00
roymondchen
ecaa0f5f28 fix(vue-runtime-help): useApp获取不到页面片中的node 2026-02-02 19:07:44 +08:00
roymondchen
eee87c6d01 docs: 创建组件的默认路径配置修改 2026-01-27 14:05:17 +08:00
roymondchen
0b7b6884ae docs: 修改文档中的错别字 2026-01-27 12:11:30 +08:00
roymondchen
575993fe34 docs: 添加runtime api 2026-01-26 19:33:55 +08:00
roymondchen
c23d02558e docs: 完善组件开发/runtime/表单配置文档 2026-01-26 19:06:39 +08:00
roymondchen
450af8021d style(playground): eslint 2026-01-26 14:37:18 +08:00
roymondchen
0ec8af20e0 refactor(playground): form提交的结果使用代码编辑器显示 2026-01-23 17:03:37 +08:00
roymondchen
b4c2c65ccb fix(form): timerange新增value format配置,默认为HH:mm:ss 2026-01-23 16:51:31 +08:00
roymondchen
06fd5392a9 chore: update lockfile v1.7.6 2026-01-19 20:00:34 +08:00
roymondchen
89ac777a7f chore: release v1.7.6 2026-01-19 19:59:14 +08:00
roymondchen
6cf2f38194 fix(form): onChange中修改model的key中有重复的key会出错 2026-01-19 19:40:58 +08:00
roymondchen
e6e68ae69a refactor(core): 调整eventHelper代码 2026-01-12 20:17:47 +08:00
roymondchen
5110f0cbca chore: update lockfile v1.7.5 2026-01-08 17:17:39 +08:00
roymondchen
da2e2c393b chore: release v1.7.5 2026-01-08 17:16:08 +08:00
roymondchen
e6d1624a6c refactor(form): 优化创建初始值等一些工具函数 2026-01-08 17:11:05 +08:00
roymondchen
8956035e41 fix(form): 初始值为0时会丢失 2026-01-08 17:03:16 +08:00
roymondchen
10c36c1980 chore(editor): 画布拖动组件位置更新dsl添加changeRecordes 2026-01-08 16:44:44 +08:00
roymondchen
5f57d620da fix(form): daterange默认值 2026-01-07 18:33:13 +08:00
roymondchen
cfaaaad66e feat(editor): customCreateMonacoEditor options中新增editorCustomType,可以用于创建不同的editor 2026-01-07 17:38:37 +08:00
roymondchen
df611571c7 feat(form): type配置为函数时,参数中的model等对象设置层readonly 2026-01-07 14:43:14 +08:00
roymondchen
5267381ebf fix(editor): 显示条件中选中的字段类型发生时,值对应做类型转换 2026-01-07 14:41:25 +08:00
roymondchen
3cfec95612 fix(editor): 切换固定定位后坐标转换仅支持left,top为数字的情况 2025-12-31 16:33:06 +08:00
roymondchen
c1b12e6f40 chore: update lockfile v1.7.4 2025-12-29 20:42:34 +08:00
roymondchen
c2d2eee749 chore: release v1.7.4 2025-12-29 20:16:45 +08:00
roymondchen
03b6180a02 fix(editor): 数据源方法编辑后content变成字符串 2025-12-29 19:22:28 +08:00
roymondchen
8150f042ff chore: update lockfile v1.7.3 2025-12-25 20:22:52 +08:00
roymondchen
b71a5ef891 chore: release v1.7.3 2025-12-25 20:02:51 +08:00
roymondchen
01158e01fc chore(table): 添加依赖 2025-12-25 19:23:27 +08:00
roymondchen
98c2e2ff1f fix(table): 行内编辑无法修改表单 2025-12-25 19:16:17 +08:00
roymondchen
9d4324dd6b fix(form): 动态tab自定义onTabAdd后出错 2025-12-25 16:03:52 +08:00
roymondchen
2630f00f13 feat(form): groud-list title支持html 2025-12-24 15:40:17 +08:00
roymondchen
b0d8c5383b fix(editor): cose-select无法删除 2025-12-24 15:38:02 +08:00
roymondchen
f0a39667e1 feat(form): text组件支持配置cleareable 2025-12-23 16:47:12 +08:00
roymondchen
5fe91e89b7 feat(form,tdesign-vue-next-adapter): table 多选框放到默认的操作前面,支持配置copy的干预函数 2025-12-19 20:19:55 +08:00
roymondchen
f7811fdb24 docs: 完善文档 2025-12-11 14:20:39 +08:00
roymondchen
7a0dae9f5a build(tmagic-form): package.json中文件入口配置错误 2025-12-09 20:49:23 +08:00
roymondchen
304aaac8dc chore: update lockfile v1.7.2 2025-12-09 19:15:19 +08:00
roymondchen
0f596b5c42 chore: release v1.7.2 2025-12-09 19:13:51 +08:00
roymondchen
e3db0c93e5 chore: update lockfile v1.7.1 2025-12-09 17:41:35 +08:00
roymondchen
3250c53097 chore: release v1.7.1 2025-12-09 17:23:21 +08:00
roymondchen
756612eda5 feat(vue-components): 不再兼容vue2 2025-12-09 17:20:07 +08:00
roymondchen
2a7ab4e916 feat(vue-runtime-help): 去掉vue2的兼容 2025-12-09 16:20:56 +08:00
roymondchen
d039cee913 fix(tmagic-form): runtime刷新导致root丢失 2025-12-09 16:18:35 +08:00
roymondchen
83664cd440 fix(core): getNode 添加stict参数来表示必须知道页面片容器id才会返回页面内的节点 2025-12-09 15:51:15 +08:00
roymondchen
b3ce1a3b93 fix(form): tabs组件子项配置了name后,配置生成的数据出错 2025-12-09 14:22:57 +08:00
roymondchen
738e8611a4 style(editor): 组件属性配置中表格操作栏会覆盖tab头
fix #664
2025-12-05 19:45:08 +08:00
roymondchen
9815fb7c51 chore: update lockfile v1.7.0 2025-12-04 17:37:17 +08:00
roymondchen
411a28946e chore: release v1.7.0 2025-12-04 17:35:47 +08:00
roymondchen
70d730ca82 refactor(editor): 新增数据源按钮封装成组件 2025-12-04 17:31:38 +08:00
roymondchen
a2a9556ab8 style(editor): 调整已选组件节点右侧按钮样式 2025-12-04 16:36:34 +08:00
roymondchen
7e71c070f1 fix(form): datetime如果设置为时间戳,然后初始值是一个字符串的数字显示不正确 2025-12-04 15:20:30 +08:00
roymondchen
8d55d0cd8d feat(editor): 代码编辑器支持配置自动高度 2025-12-03 17:50:48 +08:00
roymondchen
8d7c8fa725 fix(design): dialog 默认参数 2025-12-03 17:15:26 +08:00
roymondchen
ad746319e9 style(tdesign-vue-next-adapter): 去掉无用prop 2025-12-03 17:09:47 +08:00
roymondchen
0dd7f54ebc feat(form): table支持配置操作按钮的icon 2025-12-02 15:25:34 +08:00
roymondchen
69ac90fe22 feat(form): table支持配置拖动操作中的按钮排序而不是拖动整行 2025-12-01 21:09:11 +08:00
roymondchen
2667981e4c fix(form): table拖拽排序后重新渲染组件 2025-11-26 16:40:26 +08:00
roymondchen
b536eba81c fix(form): 生成表单values时将initValus深拷贝,避免修改到传入的对象 2025-11-26 16:38:37 +08:00
roymondchen
054ed561b6 chore: update lockfile v1.7.0-beta.5 2025-11-24 20:31:39 +08:00
roymondchen
c1dc58c97c chore: release v1.7.0-beta.5 2025-11-24 20:30:11 +08:00
roymondchen
bb7ec0aa1b fix(element-plus-adapter): 构建时将vue源码构建入目标代码中,导致页面存在多个版本vue 2025-11-24 20:27:53 +08:00
roymondchen
849b4dc319 fix(tdesign-vue-next-adapter): 没有extra时form item不渲染help节点 2025-11-24 19:15:50 +08:00
roymondchen
8aef360ed7 chore: update lockfile v1.7.0-beta.4 2025-11-24 16:21:50 +08:00
roymondchen
8d65127cdd chore: release v1.7.0-beta.4 2025-11-24 16:20:19 +08:00
roymondchen
93640257e9 fix(design,editro,element-plus-adapter,tdesign-vue-next-adapter): elememt-plus表单渲染失败 2025-11-24 16:14:21 +08:00
roymondchen
09dfaad2cc feat(design): 在html中添加adapter类型class 2025-11-24 13:56:11 +08:00
roymondchen
5dbe1fb655 feat(core): getNode未指定页面片容器id时取获得到的第一个 2025-11-24 13:54:09 +08:00
roymondchen
82df2a8f5c chore: update deps 2025-11-21 16:50:46 +08:00
roymondchen
4dc5f0a298 style: 优化部分结构 2025-11-21 15:41:41 +08:00
roymondchen
3b913c1af4 feat(form): group list新增添加按钮配置 2025-11-20 18:05:53 +08:00
roymondchen
310054b7d6 feat(form): form dialog新增show close/show cancel 配置 2025-11-20 17:57:44 +08:00
roymondchen
fa0e10f687 feat(form): table操作列支持配置固定在左边还是右边 2025-11-20 15:44:14 +08:00
roymondchen
bf6598c871 feat(form): form dialog新增props 2025-11-20 15:03:17 +08:00
roymondchen
6a7f80c48d feat(form): table新增新增按钮配置 2025-11-20 11:27:12 +08:00
roymondchen
e2708b868b feat(form): 表格拖动支持tdesign 2025-11-19 14:39:49 +08:00
roymondchen
97affb2bff feat(form): tip图标放到label中去 2025-11-19 14:37:24 +08:00
roymondchen
e418130a66 feat(form, design, form-schema): table支持自定义title,table 表单组件支持配置title tip 2025-11-19 13:23:03 +08:00
roymondchen
55a2869818 fix(form): 文本输入change出发太频繁 2025-11-18 19:13:56 +08:00
roymondchen
0ecc116652 feat(design, tdesign-vue-next-adapter): formItem新增labelAlign prop 2025-11-18 19:09:14 +08:00
roymondchen
310aa47c1d feat(form): panel点击标题可以展开或者收缩内容 2025-11-18 19:03:29 +08:00
roymondchen
27555d6b2f fix(design): select visible-change事件名写错 2025-11-13 20:27:49 +08:00
roymondchen
da9884645f fix(playgournd): 存在多个vue版本问题 2025-11-12 19:52:32 +08:00
roymondchen
1a08b16a39 fix(tdesign-vue-next-adapter): select支持allowCreate 2025-11-12 19:52:32 +08:00
roymondchen
a96ca8092c feat(design,tdesign-vue-next-adapter): input添加click事件 2025-11-12 19:52:32 +08:00
roymondchen
489d321677 chore: update lockfile v1.7.0-beta.3 2025-11-12 19:52:32 +08:00
roymondchen
3d0081e48e chore: release v1.7.0-beta.3 2025-11-12 19:52:32 +08:00
roymondchen
acda22d5cb feat(design,tdesign-vue,next-adapter): textarea支持autosize 2025-11-12 19:52:32 +08:00
roymondchen
7b19a01849 chore(playground): adapter改成异步加载 2025-11-12 19:52:32 +08:00
roymondchen
d0179028fb feat(element-plus-adapter, from, tdesign-vue-adapter): button兼容type=default和type为空的情况 2025-11-12 19:52:32 +08:00
roymondchen
564a7f4271 fix(editor): 表单组件保持单向数据流 2025-11-12 19:52:32 +08:00
roymondchen
6f0498a9e7 feat(form): text组件配置的append.hander函数添加setModel/setFormValue方法 2025-11-12 19:52:32 +08:00
roymondchen
4f52fcb122 style(form): group-list样式改成card的样式 2025-11-12 19:52:31 +08:00
roymondchen
1297939db2 style(table): table全屏后居中显示 2025-11-12 19:52:31 +08:00
roymondchen
b3cfc0b5d3 chore: update lockfile v1.7.0-beta.2 2025-11-12 19:52:31 +08:00
roymondchen
b96036b23c chore: release v1.7.0-beta.2 2025-11-12 19:52:31 +08:00
roymondchen
3c3ba6525b style(form): table新增按钮放到右边 2025-11-12 19:52:31 +08:00
roymondchen
0f3dfcf511 fix(form): daterange 配置names后配置失效 2025-11-12 19:52:31 +08:00
roymondchen
12e6dd18b4 feat(design, element-plus-adapter, tdesign-vue-next-adapter): 添加adapterType, 完善tdesign useZIndex 2025-11-12 19:52:31 +08:00
roymondchen
cbec52936d fix(form): dialog submit event获取到的changeRecords为空 2025-11-12 19:52:31 +08:00
roymondchen
979b834fac feat(design, tdesign-vue-next-adapter, table, element-plus-adapter): 完善tdesign适配 2025-11-12 19:52:31 +08:00
roymondchen
dabeba85a0 build(playground): 去掉auto-import 2025-11-12 19:52:31 +08:00
roymondchen
954bd37d52 chore: update lockfile v1.7.0-beta.1 2025-11-12 19:52:31 +08:00
roymondchen
59aa9f14b3 chore: release v1.7.0-beta.1 2025-11-12 19:52:31 +08:00
roymondchen
38192a6d48 feat(design, form, form-schema, tdesign-vue-next-adapter): textarea支持rows配置 2025-11-12 19:52:31 +08:00
roymondchen
ec479b9296 feat(form): 表单校验后的错误信息将name转换成text 2025-11-12 19:52:31 +08:00
roymondchen
7f0aef7bee build(editor): css变量使用错误导致lightingcss构建失败 2025-11-12 19:52:31 +08:00
roymondchen
36508aba88 chore(playgournd): 添加@tmagic/design依赖 2025-11-12 19:52:31 +08:00
roymondchen
f30a8ddc41 chore: update lockfile v1.7.0-beta.0 2025-11-12 19:52:31 +08:00
roymondchen
a28705e3df chore: release v1.7.0-beta.0 2025-11-12 19:52:31 +08:00
roymondchen
ca0f8fc988 feat(design, form, tdesign-vue-next-adapter): 完善tdesign适配 2025-11-12 19:52:31 +08:00
roymondchen
68c69ac405 fix(form): tabel复制行不生效 2025-11-12 19:52:30 +08:00
roymondchen
3a9c94a6a6 feat(form): 新增style,fieldStyle配置;tooltip支持配置placement;配置中的函数新增getFormValue方法 2025-11-12 19:52:30 +08:00
roymondchen
5fe57cd389 feat(form): text新增prepend, append不默认使用button 2025-11-12 19:52:30 +08:00
roymondchen
51e9732894 feat(form): fieldset中checkbox新增name,trueValue,falseValue配置 2025-11-12 19:52:30 +08:00
roymondchen
630301bce2 feat(form): 新增flex-layout组件 2025-11-12 19:52:30 +08:00
roymondchen
507e51a2dc feat(design, element-plus-adapter, tdesign-vue-next-adapter): 新增popconfirm组件 2025-11-12 19:52:30 +08:00
roymondchen
11d25603a8 feat(playground): 支持UI组件库切换 2025-11-12 19:52:30 +08:00
roymondchen
8f0d99a4a6 style(design, editor, tdesign-vue-next-adapter): 编辑器顶部导航按钮tdesign下样式优化 2025-11-12 19:52:30 +08:00
roymondchen
08b476e04f feat(design,editor,element-plus-adapter,form,table,tdesign-vue-next-adapter): 重构table组件,适配tdesign 2025-11-12 19:52:30 +08:00
roymondchen
1cb2d57ade refactor(editor): 调整表单配置 2025-11-12 19:52:30 +08:00
roymondchen
d59428d2d6 refactor(form): 保持单向数据流,表单内部的组件不去修改表单的值,统一通过chang事件通知表单修改 2025-11-12 19:52:30 +08:00
roymondchen
e36da82d29 fix(vue-runtime-hlep): 页面片销毁后需要取消app的事件监听 2025-11-12 19:49:55 +08:00
roymondchen
8809351537 feat(table): action支持配置disabled 2025-10-15 14:32:45 +08:00
roymondchen
5387a18024 chore: release vue-container/react-runtime-help/reate-iterator-conatiner 2025-10-14 15:49:20 +08:00
roymondchen
2b80ba3efd chore: update lockfile v1.6.1 2025-10-14 15:37:33 +08:00
roymondchen
6c3916c580 chore: release v1.6.1 2025-10-14 15:36:00 +08:00
roymondchen
4dfdc836f6 chore: update deps 2025-10-14 14:18:50 +08:00
roymondchen
fef1e2c2b4 style(editor): 组件列表标题样式调整 2025-10-14 14:14:48 +08:00
roymondchen
51f95aef6f feat(data-source, editor, schema, react-runtime-help, vue-components): 新增条件成立时隐藏的配置功能 2025-10-13 20:31:54 +08:00
roymondchen
81aa8f151d feat(editor): 属性配置中的样式面板样式优化 2025-10-13 19:32:29 +08:00
roymondchen
cae11dce12 fix(form): text与同行元素不对齐问题 2025-10-13 19:28:18 +08:00
roymondchen
83bf36d980 style(form): radio-group选项中icon大小根据size变化 2025-10-13 19:25:30 +08:00
roymondchen
2888004c17 chore: update deps 2025-10-13 15:57:48 +08:00
roymondchen
abab44ad24 chore: update deps 2025-09-16 19:49:48 +08:00
roymondchen
849b561933 feat(data-source): 数据源数据变化事件监听响应支持立即执行 2025-09-16 19:44:16 +08:00
roymondchen
1031595a97 fix(core): 异步加载数据源时,数据源事件配置失效 2025-09-16 19:34:15 +08:00
roymondchen
f5cb19dfa4 style(editor): 页面列表长度超过可视窗口时出现滚动条 2025-09-12 15:32:03 +08:00
roymondchen
e400175ffe fix: 组件声明周期函数配置中配置数据源自有方法生效 2025-09-10 16:24:44 +08:00
roymondchen
958c78d968 chore: update lockfile v1.6.0 2025-08-27 19:27:29 +08:00
roymondchen
9f81597596 chore: release v1.6.0 2025-08-27 19:26:01 +08:00
roymondchen
001f2b6c9e build(runtime): escape % if URI malformed 2025-08-27 19:18:17 +08:00
roymondchen
a56bb562d8 build: 构建playground失败 2025-08-27 19:08:57 +08:00
roymondchen
7695f005f6 style(runtime): 配置格式化 2025-08-27 17:01:08 +08:00
roymondchen
a10f9d230d fix(cli): 在pnpm工作空间中的项目,保持package.json不受配置中的packages影响 2025-08-27 16:48:51 +08:00
roymondchen
9f350541bf feat(cli): 支持tmagic.config.local配置文件,会与tmagic.config配置合并,可用于本地开发时的临时配置 2025-08-27 16:19:43 +08:00
roymondchen
0643699fac chore: 删除ui/ui-react 2025-08-27 15:43:28 +08:00
roymondchen
9f63dff49b build(runtime): 构建playground示例失败 2025-08-27 14:31:24 +08:00
roymondchen
7d3a2df793 chore: 删除vue2 runtime,后续vue-components里的组件不再考虑vue2的支持 2025-08-27 14:24:15 +08:00
roymondchen
0967c3449e build(runtime): 重构vue3 runtime的构建配置 2025-08-26 20:40:24 +08:00
roymondchen
f267643c42 chore: update deps 2025-08-26 17:27:37 +08:00
roymondchen
f3387ed5e9 chore: update lockfile v1.6.0-beta.6 2025-08-15 12:30:41 +08:00
roymondchen
71d1aab69e chore: release v1.6.0-beta.6 2025-08-15 12:29:06 +08:00
roymondchen
4c6118f50f feat(core): 事件支持关联数据源自身方法 2025-08-15 12:25:00 +08:00
roymondchen
77da3f9762 chore: update lockfile v1.6.0-beta.5 2025-08-08 16:00:48 +08:00
roymondchen
8b3cb63f77 chore: release v1.6.0-beta.5 2025-08-08 15:59:17 +08:00
roymondchen
fc1c9feafd fix(core): 事件行为应该为串行执行 2025-08-08 15:51:54 +08:00
roymondchen
371be8aa27 chore: update lockfile v1.6.0-beta.4 2025-07-24 16:49:05 +08:00
roymondchen
7bb14e6c25 chore: release v1.6.0-beta.4 2025-07-24 16:47:31 +08:00
roymondchen
cdb07dfaea fix(editor): 避免services plugin重复添加 2025-07-24 16:43:40 +08:00
roymondchen
c2830fca6b fix(editor): runtime url更新后恢复当前选中状态 2025-07-24 15:55:59 +08:00
roymondchen
bba67b5533 chore: update lockfile v1.6.0-beta.3 2025-07-24 14:14:37 +08:00
roymondchen
eda9924327 chore: release v1.6.0-beta.3 2025-07-24 14:12:58 +08:00
qyaniwu
07b8f5fe83 fix(editor): 修复代码块编辑器的更新内容后按下ctrl+s光标会偏移的问题 2025-07-24 04:13:02 +00:00
roymondchen
d31a544a23 fix(editor): runtimeUrl更新后需要重新设置runtime的dsl 2025-07-24 11:24:36 +08:00
roymondchen
01b7b58065 chore: update lockfile v1.6.0-beta.2 2025-07-22 20:31:48 +08:00
roymondchen
870dd99e2c chore: release v1.6.0-beta.2 2025-07-22 20:30:18 +08:00
roymondchen
01b88dba25 feat(core): 异步加载dsl片段下,事件触发时node可能不存在 2025-07-22 20:23:14 +08:00
roymondchen
2605011df4 feat(utile): replaceChildNode找不多目标不报错 2025-07-22 20:16:37 +08:00
roymondchen
00cf312a91 chore(vue-runtime-help): release 2025-07-17 19:08:50 +08:00
roymondchen
e3ed80b121 chore: update lockfile v1.6.0-beta.1 2025-07-17 18:51:31 +08:00
roymondchen
0752abc312 chore: release v1.6.0-beta.1 2025-07-17 18:50:02 +08:00
roymondchen
ded24c8b4f feat(editor): 页面片容器内的组件不允许选中 2025-07-17 18:26:29 +08:00
roymondchen
7799a5da61 fix(vue-components): iterator-container 传递 page-fragment-contianer-id 参数 2025-07-17 17:24:41 +08:00
roymondchen
6cb08cf458 style(vue-runtime-help): 完善类型 2025-07-17 17:22:11 +08:00
roymondchen
305ea4619f fix(data-source): 页面未初始化好之前,数据源数据变化后需要修改page.data 2025-07-17 17:20:58 +08:00
roymondchen
291de2005d feat(core): Node中的instance初始为null,用于判断是否与组件产生关联 2025-07-17 17:19:03 +08:00
roymondchen
34bc223f02 feat(vue-components): page-fragment-container编辑器中不去除内部组件id,不然会导致无法从app中获取dsl 2025-07-17 14:09:11 +08:00
roymondchen
bf9fad18b6 fix(vue-components): page-fragment-container不标记为不是node节点 2025-07-15 16:40:53 +08:00
roymondchen
cebf3506d4 build: 升级rollup 4.45.0后playground构建失败,回滚回4.44.1 2025-07-15 16:31:12 +08:00
roymondchen
a43825caa2 feat(vue-components): 添加页面片容器id prop 2025-07-15 15:31:51 +08:00
roymondchen
1736d495fd chore: update lockfile v1.6.0-beta.0 2025-07-15 15:14:30 +08:00
roymondchen
44b592f36a chore: release v1.6.0-beta.0 2025-07-15 15:13:01 +08:00
roymondchen
6a54720068 feat(core,data-source,utils,react-runtime-help,vue-runtime-help): 新增对页面片节点的管理 2025-07-15 15:08:53 +08:00
roymondchen
aaf8046c63 fix(editor): 依赖收集后没有同步到dsl中 2025-07-11 19:02:56 +08:00
roymondchen
5242585500 chore: update copyright 2025-07-11 15:04:22 +08:00
roymondchen
4637c80125 style(editor,stage): 完善moveableOptions prop类型定义 2025-07-04 14:25:05 +08:00
roymondchen
5b7d2dd248 chore: update lockfile v1.5.24 2025-07-03 20:55:54 +08:00
roymondchen
5ab7030c3a chore: release v1.5.24 2025-07-03 20:54:08 +08:00
roymondchen
84bf9ba2f9 fix(editor): 初始化收集依赖后编译数据源不能使用源数据 2025-07-03 20:50:46 +08:00
roymondchen
c87e539dd3 chore: update lockfile v1.5.23 2025-07-03 14:22:13 +08:00
roymondchen
49f3f6853e chore: release v1.5.23 2025-07-03 14:20:41 +08:00
roymondchen
222a96e465 feat(editor): 数据源属性/方法表格可以拖动列宽 2025-07-03 14:11:44 +08:00
roymondchen
2f4a7a33b8 feat(core,data-source,dep,editor,schema): 新增组件禁用代码块/数据源的配置开关 2025-07-03 14:10:20 +08:00
roymondchen
c984c1a0cf fix(editor): 树组件搜索后不展开所有节点 2025-07-02 19:47:52 +08:00
roymondchen
727af1058d fix(editor): 页面列表滚动条 2025-07-02 18:00:21 +08:00
roymondchen
68abaae750 chore: update deps 2025-07-02 17:55:12 +08:00
roymondchen
0e8043664e chore: update deps 2025-07-02 17:06:37 +08:00
roymondchen
3f7d03959c feat(dep,schema): 添加组件没用数据源或者代码块的配置key 2025-07-02 16:42:55 +08:00
roymondchen
ee06c26ca5 refactor(editor): dsl更新后通知runtime更新代码优化 2025-07-02 16:21:03 +08:00
roymondchen
9e590c5cf7 feat(editor): 新增props-panel-unmounted事件 2025-06-26 21:06:21 +08:00
roymondchen
8d6da3712e feat(editor): service新增removePlugin方法 2025-06-26 16:49:32 +08:00
roymondchen
b78ef20602 feat(playground): 新增按比例拖动组件大小快捷键 2025-06-25 14:19:18 +08:00
roymondchen
18e8df4a55 fix(editor): 防止快捷键重复注册 2025-06-25 14:17:43 +08:00
roymondchen
b6a260471d fix(editor,react-runtime-help,vue-runtime-help): 修复拖动页面顺序失效问题 2025-06-20 20:10:24 +08:00
roymondchen
32681964b3 feat(editor): stage overlay 支持放大缩小 2025-06-20 19:47:51 +08:00
roymondchen
95d6263f42 feat(stage): 新增禁用标尺配置 2025-06-20 19:08:10 +08:00
roymondchen
bbf93cb2b5 style(vue-runtime-help): 新增组件props的统一类型定义 2025-06-20 15:22:44 +08:00
roymondchen
3b1e41b217 refactor(playground): 整理代码 2025-06-20 15:05:47 +08:00
roymondchen
bdd59cff9b feat(stage): 添加updateMoveableOptions api,用于更新选中框状态 2025-06-20 14:38:36 +08:00
roymondchen
c3633b0481 chore: update lockfile v1.5.22 2025-06-09 19:44:08 +08:00
roymondchen
652670fa4c chore: release v1.5.22 2025-06-09 19:42:22 +08:00
roymondchen
1614b62d2a feat(editor): 样式中的position选项加上中文 2025-06-09 19:36:54 +08:00
roymondchen
6152a78467 feat(editor): 支持禁用数据源与代码块 2025-06-09 16:35:08 +08:00
roymondchen
b1f020d532 fix(data-source,utils): 不使用replaceAll,安卓10不支持 2025-06-09 14:18:36 +08:00
roymondchen
6b4ca4b83a feat(form,form-schema): group list支持配置默认展开数量 2025-06-06 20:13:34 +08:00
roymondchen
b72f4dae28 fix(vue-runtime-help): 修复页面片中组件拖动位置异常问题 2025-06-06 19:33:15 +08:00
roymondchen
0bd8496fac refactor(editor,stage): 完善页面变化后画布大小更新 2025-06-06 19:29:20 +08:00
roymondchen
b78b2011e5 chore: 更新commit-msg 2025-06-06 16:05:26 +08:00
roymondchen
3097e8eddb feat(editor): 支持配置自定义创建Monaco editor函数 2025-06-06 16:03:56 +08:00
roymondchen
cd4656e54f feat(design): dialog支持配置destroyOnClose 2025-06-06 14:55:06 +08:00
roymondchen
5f246bbc98 chore: update deps 2025-06-05 20:14:23 +08:00
roymondchen
e01ce2128e feat(eslint-conft): 添加import-sort的本地目录 2025-06-04 19:34:17 +08:00
roymondchen
9ee748710b chore: update lockfile v1.5.21 2025-06-04 17:07:40 +08:00
roymondchen
2565d67add chore: release v1.5.21 2025-06-04 17:05:53 +08:00
roymondchen
92534fc915 feat(editor,stage): 支持切换runtimeUrl 2025-05-29 20:17:15 +08:00
roymondchen
0196eb343a feat(editor): 获取联动组件的方法函数中添加组件id参数 2025-05-28 17:47:12 +08:00
roymondchen
8142a7ab6d feat(form): select before/after request配置函数支持异步 2025-05-27 14:58:29 +08:00
roymondchen
c7b2734090 fix(data-source): 没有异步加载数据源的情况下,数据源init方法没有执行 2025-05-26 20:04:40 +08:00
roymondchen
1cee0bf4aa chore: update lockfile v1.5.20 2025-05-21 17:02:30 +08:00
roymondchen
4288ab9873 chore: release v1.5.20 2025-05-21 17:00:45 +08:00
roymondchen
b78d2fda1f feat(core): 新增事件处理前后的钩子函数配置 2025-05-21 16:58:06 +08:00
roymondchen
dc37d4e8bd feat(data-source): 新增判断所有数据源加载完成的方法 2025-05-21 16:27:49 +08:00
roymondchen
a35789c0cf feat(data-source): 由于存在异步加载数据源,新增所有数据源加载完毕事件 2025-05-21 16:24:35 +08:00
roymondchen
1e396d4a8d fix(editor): 新增数据源时,由于方法列表为空出现的报错 2025-05-21 16:20:23 +08:00
roymondchen
444858491d fix(editor): getTMagicApp中对runtime-ready可能存在多次事件监听 2025-05-21 16:18:12 +08:00
roymondchen
1f7ad2fbb8 chore: update lockfile v1.5.19 2025-05-20 13:59:03 +08:00
roymondchen
d66ee4db48 chore: release v1.5.19 2025-05-20 13:57:18 +08:00
roymondchen
abe27db47a feat(core): 支持统一设置node.store的初始值 2025-05-20 11:46:25 +08:00
roymondchen
d628ffad26 fix(data-source): 异步加载数据源时,初始化第一次编译时数据源可能未加载,需要优先设置数据源默认值 2025-05-19 20:14:29 +08:00
roymondchen
79f65fb516 chore(ui): 将ui/ui-react从packages移入runtime中,不再跟随packags发布 2025-05-19 16:16:03 +08:00
roymondchen
fc886715c7 fix(data-source): 异步加载数据源时,初始化第一次编译时数据源可能未加载,需要优先设置数据源默认值 2025-05-19 14:13:52 +08:00
roymondchen
1444eb6ae7 fix(editor): 由于数据源可能有内部方法,所以去掉事件联动中数据源选项置灰的逻辑 2025-05-16 17:14:50 +08:00
roymondchen
5b8c2c2111 chore: update lockfile v1.5.18 2025-05-14 15:49:28 +08:00
roymondchen
7dbf464e38 chore: release v1.5.18 2025-05-14 15:47:34 +08:00
roymondchen
936eb08a94 fix(editor): 选中组件时,如果组件处于所在容器可视范围外,不要将组件滚动至可视范围,而是滚动组件容器至可视范围 2025-05-14 14:17:57 +08:00
roymondchen
d1e99a46a7 feat(core): 新增数据源初始数据配置字段 2025-05-14 11:07:55 +08:00
roymondchen
e0d5efb022 feat(editor): 组件高级配置中添加display 2025-05-13 16:31:14 +08:00
roymondchen
054d12601b feat(editor): eventsServic支持插件扩展 2025-05-13 16:29:34 +08:00
roymondchen
6b481c4473 fix(editor): 根节点修改在update事件中不要触发依赖收集 2025-05-12 17:48:03 +08:00
roymondchen
8195c105c0 style(form-schema): EventSelectConfig添加公共配置 2025-05-07 14:06:56 +08:00
roymondchen
06a3dc8436 chore: update lockfile v1.5.17 2025-05-06 20:14:13 +08:00
roymondchen
b88ca14fde chore: release v1.5.17 2025-05-06 20:12:11 +08:00
roymondchen
9289ffd187 build(docs): 文档构建失败 2025-05-06 20:00:25 +08:00
roymondchen
179b797c5c feat(editor): dsl初始化时收集依赖使用worker 2025-05-06 19:59:27 +08:00
roymondchen
9252822c58 refactor(data-source): 注册base/http数据源的代码有副作用 2025-04-30 17:03:36 +08:00
roymondchen
50b74d10e6 feat(editor,form,form-schema): 新增form-schema,将表单schema放入其中 2025-04-30 16:05:31 +08:00
roymondchen
85284e54f5 feat(cli): 指定组件不使用动态加载,dynamicImport为true时有效 2025-04-30 11:40:56 +08:00
roymondchen
ed01cfca87 feat(form): select before/after request函数配置中增加prop字段 2025-04-29 19:27:01 +08:00
roymondchen
687bf33eb2 chore: update lockfile v1.5.16 2025-04-28 20:26:30 +08:00
roymondchen
1852560b55 chore: release v1.5.16 2025-04-28 20:24:40 +08:00
roymondchen
2dc0bbc679 feat(editor): 组件默认的名称,id配置只要在业务不提供时才加入 2025-04-28 20:14:01 +08:00
roymondchen
e5bcd762b2 feat(core): instance设定不再限制只有方法 2025-04-28 20:11:28 +08:00
roymondchen
6dc007388b feat(core): 添加error hander配置 2025-04-28 17:25:00 +08:00
roymondchen
378c75658d fix(data-source): 异步加载数据源后,数据源未初始化 2025-04-27 17:07:08 +08:00
roymondchen
7eded0e44a chore: update lockfile v1.5.15 2025-04-25 16:23:29 +08:00
roymondchen
cdfb3adfa9 chore: release v1.5.15 2025-04-25 16:21:44 +08:00
roymondchen
ba05ecbf60 fix(editor): getTMagicApp返回类型错误 2025-04-25 15:00:37 +08:00
roymondchen
9d8ee4b2d3 chore: update lockfile v1.5.14 2025-04-24 15:02:24 +08:00
roymondchen
e774c9ff5f chore: release v1.5.14 2025-04-24 15:00:40 +08:00
roymondchen
604ae1eb52 chore: release脚本__dirname变量 2025-04-24 14:50:53 +08:00
roymondchen
105de9d2c6 feat(utils): 添加设置删除获取url参数的方法 2025-04-24 14:38:57 +08:00
roymondchen
0987901a46 build: github workflows 安装node失败 2025-04-24 14:07:30 +08:00
roymondchen
de52ff4fe1 fix(editor): 编辑数据源/代码块时,列表高亮 2025-04-24 14:02:34 +08:00
roymondchen
0e911337b8 fix(dep): 配置了数据源内部方法无法收集到依赖 2025-04-24 11:34:22 +08:00
roymondchen
fd7e737e8c feat(vue-runtime-help): app不存在时抛异常,保证app一定存在,避免多余的可选链 2025-04-23 15:05:14 +08:00
roymondchen
e7e9197ae3 style: 更新eslint版本,更新eslint配置 2025-04-21 20:35:54 +08:00
roymondchen
5e0e776d40 feat(form): onChange添加setModel参数,用于修改model并添加至修改记录中 2025-04-21 19:42:22 +08:00
roymondchen
31515c4046 chore: update lockfile v1.5.13 2025-04-10 20:56:00 +08:00
roymondchen
42adb962fd chore: release v1.5.13 2025-04-10 20:54:13 +08:00
roymondchen
0bcd7d0755 feat(core): 支持传入env 2025-04-10 20:36:38 +08:00
roymondchen
54e00f2852 feat(editor): 编辑代码块/数据源时高亮列表中对应的项 2025-04-10 20:36:38 +08:00
marchyang
f91eb415db fix: 修复表格拖拽排序与表单选字操作冲突的问题 2025-04-04 10:56:52 +08:00
roymondchen
18524d89fb feat(core): 支持自定义Node类 2025-04-02 17:24:02 +08:00
roymondchen
840c2c3c7d fix(data-source): 数据源初始化时机比注册早回出现死循环 2025-04-02 17:17:30 +08:00
roymondchen
9b546645f3 chore: update deps 2025-03-31 20:31:29 +08:00
roymondchen
38ea57c6cb chore: update lockfile v1.5.12 2025-03-27 16:32:44 +08:00
roymondchen
c8fc2f7bfb chore: release v1.5.12 2025-03-27 16:30:51 +08:00
roymondchen
b715a87f40 feat(cli): 如果识别不要组件文件,则默认从npm包的default导入 2025-03-27 16:25:58 +08:00
roymondchen
f17ef325b1 chore: update vite 2025-03-27 11:29:18 +08:00
roymondchen
4ddc55aa6d fix(design): card没有slots时隐藏对应slot 2025-03-27 11:12:27 +08:00
roymondchen
2a714ae9cc fix(vue-components): button删除调试代码,text支持富文本 2025-03-18 16:54:55 +08:00
roymondchen
d53a479b21 style(vue-runtime-help): 更新ts定义 2025-03-18 16:52:21 +08:00
roymondchen
f5742c107a fix(editor): 获取关联组件的方法默认值 2025-03-13 14:30:28 +08:00
roymondchen
9c7d711c16 fix(editor): 数据源修改后,依赖重新收集不准确 2025-03-12 14:22:33 +08:00
roymondchen
11c027c71b chore: update lockfile v1.5.11 2025-03-11 17:14:17 +08:00
roymondchen
16f1c47db6 chore: release v1.5.11 2025-03-11 17:12:29 +08:00
roymondchen
72108e0019 fix(dep): 数据源方法收集判断 2025-03-11 17:01:32 +08:00
roymondchen
0c207c7b83 fix(dep): 依赖收集不能过滤id/name 2025-03-10 11:32:27 +08:00
roymondchen
f671c670db feat(vue-runtime-help): useDsl/useEditorDsl添加app默认参数 2025-03-07 14:33:13 +08:00
roymondchen
a293bd8d3f chore: update lockfile v1.5.10 2025-03-07 11:33:33 +08:00
roymondchen
7dad6720e4 chore: release v1.5.10 2025-03-07 11:31:46 +08:00
roymondchen
402f05f3d6 test(editor): 删除eventsService.init用例 2025-03-06 20:36:10 +08:00
roymondchen
0736646c63 feat(vue-components,react-components): 增加点击事件,使用组件状态hook 2025-03-06 20:29:38 +08:00
roymondchen
8d0040da53 chore(runtime): 更新runtime-help 2025-03-06 20:22:52 +08:00
roymondchen
6f5bb84c04 feat(reate-runtime-help,vue-runtime-help): 新增组件状态hook 2025-03-06 20:20:01 +08:00
roymondchen
63fe6ec68b fix(stage): 防止runtime重复注册 2025-03-06 20:10:52 +08:00
roymondchen
ff07147270 feat(core): node新增registerMethod方法,用于组件注册供其他组件通过事件配置调用 2025-03-06 20:08:47 +08:00
roymondchen
c8e1cffca9 feat(core, editor): 删除公共的点击事件实现,由组件自行添加 2025-03-06 20:05:49 +08:00
roymondchen
5ba2a73c70 feat(core): hook函数调用添加node参数 2025-03-04 19:11:36 +08:00
roymondchen
a4d021d2fb feat(core): app添加dsl-change事件 2025-03-04 17:07:45 +08:00
roymondchen
3c66319b03 fix(data-source): 处理异步动态加载数据源时,初始化数据源还未加载完毕的情况 2025-03-04 17:05:05 +08:00
roymondchen
775fcf5693 fix(editor): 样式配置宽度不能为负 2025-03-04 14:09:28 +08:00
roymondchen
f5315122e4 chore(vue-components): 添加name option 2025-02-27 19:33:57 +08:00
roymondchen
90abde57cc feat(runtime): vue2 h传参与vue3不一样,需要自定义render 2025-02-27 19:32:48 +08:00
roymondchen
91cde30d75 feat(vue-container): 支持自定义render 2025-02-27 19:31:07 +08:00
roymondchen
2114b71d47 style(vue-runtime-help): 添加UserRenderFunction定义 2025-02-27 19:28:08 +08:00
roymondchen
94d0ed1fd0 chore(playground): 恢复dsl本地存储的key 2025-02-27 11:31:20 +08:00
roymondchen
4026c0c305 feat(runtime): 支持页面切换 2025-02-26 15:20:32 +08:00
roymondchen
6d2b9d5f21 chore: update lockfile v1.5.9 2025-02-20 17:34:45 +08:00
roymondchen
f2f9044be0 chore: release v1.5.9 2025-02-20 17:32:53 +08:00
roymondchen
ebc873d6f3 style(stage): 完善Runtime定义 2025-02-20 15:16:20 +08:00
roymondchen
4d77b669ba feat(table): formatter添加index信息 2025-02-18 19:46:00 +08:00
roymondchen
6f2c6b151d feat(table): 支持type: index的序号列 2025-02-18 19:40:28 +08:00
roymondchen
6e2b5aea47 fix(editor): 编辑器销毁不应该移除依赖收集任务的事件监听 2025-02-12 14:08:27 +08:00
roymondchen
098351bb21 chore: update lockfile v1.5.8 2025-02-11 19:39:18 +08:00
roymondchen
a0e7ee7292 chore: release v1.5.8 2025-02-11 19:37:31 +08:00
roymondchen
3fbcbf25ca test(editor): 完善测试用例 2025-02-11 19:34:42 +08:00
roymondchen
413134b21d feat(editor): 优化依赖收集状态显示,新增剩余任务数量显示 2025-02-11 19:25:28 +08:00
roymondchen
6d82c0f730 fix(editor): 组件配置列大小缓存不生效 2025-02-11 17:25:58 +08:00
roymondchen
900b701c80 refactor(editor): 新增useServices hook,减少使用可选链 2025-02-11 16:24:24 +08:00
roymondchen
9cabbe8c7c chore: update lockfile v1.5.7 2025-02-11 10:56:29 +08:00
roymondchen
155c4a75b3 chore: release v1.5.7 2025-02-11 10:54:45 +08:00
roymondchen
aec80388f0 build: vite6.0后构建的css文件名需配置回style 2025-02-11 10:47:43 +08:00
roymondchen
51b62cfe92 chore: update lockfile v1.5.6 2025-02-10 20:14:25 +08:00
roymondchen
8136477dd9 chore: release v1.5.6 2025-02-10 20:12:39 +08:00
roymondchen
877a4eaa49 feat(editor): 优化浏览器变小时各列大小变化 2025-02-10 19:59:11 +08:00
roymondchen
7fa3181376 chore(vue3-runtime): 更新vue cdn 2025-02-10 14:20:52 +08:00
roymondchen
c524cd4086 build: 统一构建加入runtime 2025-01-21 19:56:04 +08:00
roymondchen
5c0cfe44dd build: 统一构建 2025-01-21 19:13:01 +08:00
roymondchen
51ca1e60af fix(editor): 编辑器组件销毁后重置依赖收集 2025-01-20 19:55:14 +08:00
roymondchen
e234428965 chore: update deps 2025-01-20 19:34:12 +08:00
roymondchen
701a9d6f30 fix(core): deep-state-observer update 的data与初始化时相同,导致get data为空 2025-01-20 14:58:20 +08:00
roymondchen
e8461f91e6 fix(editor): 已经配置了的样式无法删除 2025-01-17 19:49:56 +08:00
roymondchen
e9c6a3bb2f fix(editor): 修改数据源可能造成页面卡死 2025-01-17 19:48:02 +08:00
roymondchen
215ef93173 chore: update lockfile v1.5.5 2025-01-14 16:37:34 +08:00
roymondchen
34878d26f8 chore: release v1.5.5 2025-01-14 16:33:37 +08:00
roymondchen
040b787e8f feat(editor): 优化依赖收集,数据源代码块分开收集 2025-01-14 16:27:04 +08:00
roymondchen
b215062177 feat(dep): 性能优化,收集时节点配置中id与name不需要做判断 2025-01-14 16:22:04 +08:00
roymondchen
ad2545c2e2 chore: update lockfile v1.5.4 2025-01-10 19:58:51 +08:00
roymondchen
df1cb5f3e7 chore: release v1.5.4 2025-01-10 19:55:39 +08:00
roymondchen
8b1201626d fix(element-plus-adapter): 只有当前没注册loading指令时才注册 2025-01-10 19:52:32 +08:00
roymondchen
ab7df6c21e refactor(editor): 优化dsl更新后画布更新逻辑 2025-01-10 19:44:40 +08:00
roymondchen
895c461e2b refactor(editor): 优化依赖收集,优先收集数据源依赖 2025-01-10 19:31:41 +08:00
roymondchen
1baec3f1d4 refactor(editor): useTemplateRef参数不能与变量名一样,不然会有一个warn 2025-01-09 20:48:35 +08:00
roymondchen
552df3a614 refactor(editor): service中state改完使用shallowReactive 2025-01-09 20:43:54 +08:00
roymondchen
1bcefdb1e8 fix(element-plus-adapter): 增加loading指令 2025-01-09 20:41:30 +08:00
roymondchen
e57fc7b718 refactor(editor): form-panel mounted事件参数 2025-01-06 19:32:40 +08:00
roymondchen
8feac3861e chore: update lockfile v1.5.3 2025-01-06 18:28:23 +08:00
roymondchen
ee0b10746c chore: release v1.5.3 2025-01-06 18:26:39 +08:00
roymondchen
ac2b8dbfcf refactor(editor): form-panel mounted参数改成proxy 2025-01-06 17:47:06 +08:00
roymondchen
8aaf941d24 refactor(form): type component需要配置component 2025-01-06 17:41:28 +08:00
roymondchen
4313ddca54 style(editor): 显示条件表格配置 2025-01-06 16:23:43 +08:00
roymondchen
a831413151 feat(form): groupList支持复制单条记录,支持移动单条记得到指定位置,table支持复制单条记录 2025-01-03 19:47:25 +08:00
roymondchen
833dbcd8b4 fix(editor): select配置项无法清空 2025-01-03 17:28:57 +08:00
roymondchen
7b0a476677 feat(editor): 配置组件时将样式中的空配置移除 2025-01-03 17:27:29 +08:00
roymondchen
9e35642879 style(editor): 优化样式配置面板 2025-01-03 17:25:25 +08:00
roymondchen
e8bbdf613b feat(editor): 样式配置面板支持拖动大小 2024-12-30 20:44:27 +08:00
moonszhang
246e6941d5 feat(editor,form,schema): 组件样式配置可视化 2024-12-30 12:17:43 +00:00
roymondchen
ec94eed787 fix(core): 公共点击事件在非浏览器环境不执行 2024-12-27 14:52:04 +08:00
roymondchen
46a26af5d6 chore(vue-components): update version 2024-12-26 14:33:19 +08:00
roymondchen
616a4a506d build(runtime): _plugin-vue_export-helper js file cant not be access with Github Pages 2024-12-25 14:52:39 +08:00
roymondchen
a9b4ac0879 chore: update lockfile v1.5.2 2024-12-18 20:40:47 +08:00
roymondchen
5939f1d487 chore: release v1.5.2 2024-12-18 20:36:46 +08:00
roymondchen
af46d775f0 build: vite6.0后构建的css文件名需配置回style 2024-12-18 20:29:54 +08:00
roymondchen
d48d40a2b7 fix(editor): data-source-field-select透传eventData 2024-12-18 20:27:46 +08:00
roymondchen
c29afba89e chore: update lockfile v1.5.1 2024-12-18 16:22:30 +08:00
roymondchen
18f92823c2 chore: release v1.5.1 2024-12-18 16:20:38 +08:00
roymondchen
7887a14f6b style(editor): 完善emit定义 2024-12-18 16:10:07 +08:00
roymondchen
712e317e40 feat(editor): 样式添加display配置,右侧边栏最小值设置成420 2024-12-18 16:01:45 +08:00
roymondchen
957b0d9b40 fix(form): table 开启dropSort后,多次拖动row后会报错 2024-12-18 15:34:04 +08:00
roymondchen
432f1f5a55 feat(design): table添加row/cell class name 2024-12-18 15:31:22 +08:00
roymondchen
039ab9d192 test(editor): 修复测试用例 2024-12-17 20:52:01 +08:00
roymondchen
5cd6d21b2e feat(editor): 组件配置中的样式支持单独一列显示 2024-12-17 20:47:33 +08:00
roymondchen
7a8da68edb feat(form): 新增labelPosition配置 2024-12-17 20:36:29 +08:00
roymondchen
e421a58f4e feat(vue-components,react-components): 组件表单配置修改 2024-12-17 20:33:57 +08:00
roymondchen
74f76d0ba3 feat(editor): 数据源/代码编辑列表新增右键菜单 2024-12-16 20:20:02 +08:00
roymondchen
4f23aebd7f docs: 更新教程中使用的tmagic版本 2024-12-13 17:30:48 +08:00
roymondchen
98f45d2334 chore: update deps 2024-12-13 16:54:56 +08:00
roymondchen
6cf20cee34 refactor(editor): scss中使用use替换import 2024-12-13 16:39:55 +08:00
roymondchen
cf104e64aa style(editor): 修改拼写错误 2024-12-13 16:38:20 +08:00
roymondchen
7109df9deb refactor(editor): 模板改成使用useTemplateRef 2024-12-13 16:19:44 +08:00
roymondchen
23eafb135d chore: update lockfile v1.5.0 2024-12-10 16:36:11 +08:00
roymondchen
4c54355a42 chore: release v1.5.0 2024-12-10 16:34:23 +08:00
roymondchen
d8815237f5 fix(core): devtools更新代码块函数可能没有name,导致失败 2024-12-10 16:05:25 +08:00
roymondchen
3cae4fbc1c feat(cli): 新增npm install 参数配置 2024-12-09 20:21:34 +08:00
roymondchen
e6909dc052 fix(cli): 组件库未npm包时其中的组件无法识别 2024-12-09 20:21:34 +08:00
roymondchen
a569d51f6b fix(cli): keepPackageJsonClean开启后lock不要修改 2024-12-09 20:21:34 +08:00
roymondchen
35ad61034d docs: 1.5.0升级指南 2024-12-09 20:21:34 +08:00
roymondchen
d56b5873ff chore(design): scss兼容性修改 2024-12-09 20:21:34 +08:00
roymondchen
d58cac7909 fix(editor): 事件中选择联动组件无法再组件树中选择 2024-12-09 20:21:34 +08:00
roymondchen
2fd646fdea chore: update lockfile v1.5.0-beta.16 2024-12-09 20:21:34 +08:00
roymondchen
cf2382ac55 chore: release v1.5.0-beta.16 2024-12-09 20:21:34 +08:00
roymondchen
a0f39d90d6 feat(core): 新增调试api 2024-12-09 20:21:34 +08:00
roymondchen
0d6420215c fix(editor): 修改未包含数据源的配置,画布中没有实时更新 2024-12-09 20:21:34 +08:00
roymondchen
945aaaddcb chore(core): setTimeout后清除timeid 2024-12-09 20:21:34 +08:00
roymondchen
5caae4e953 fix(data-source): 执行时机函数需要await 2024-12-09 20:21:34 +08:00
roymondchen
12230c2f4e feat(utils): 新增getGlobalThis方法 2024-12-09 20:21:34 +08:00
roymondchen
e3f6ef48e6 feat(form): formState现在, 2024-12-09 20:21:34 +08:00
roymondchen
9948360435 feat(vue-components): 添加className配置,page新增css、cssFile、jsFile配置 2024-12-09 20:21:34 +08:00
roymondchen
d1197279fd fix(vue-runtime-help): 更新dsl时,设置默认选中项与默认页面 2024-12-09 20:21:34 +08:00
roymondchen
2186fc4e87 fix(core): 没有数据源配置时,不初始化数据源事件 2024-12-09 20:21:34 +08:00
roymondchen
f79e89e0ec docs: 新增快速创建命令 2024-12-09 20:21:34 +08:00
roymondchen
6e2c12f5ff chore: update lockfile v1.5.0-beta.15 2024-12-09 20:21:34 +08:00
roymondchen
ade98ff924 chore: release v1.5.0-beta.15 2024-12-09 20:21:34 +08:00
roymondchen
e3f28abe1a feat(editor): 代码块与数据源列表节点中新增依赖收集中tag 2024-12-09 20:21:34 +08:00
roymondchen
6030ed1684 feat(edtior,stage): 重新渲染改成重新收集依赖后渲染 2024-12-09 20:21:34 +08:00
roymondchen
b51bafe509 style(stage): 选中框上方按钮改成可点击样式 2024-12-09 20:21:34 +08:00
roymondchen
03942dc49e feat(data-source,editor): http数据源params,data,headers支持函数配置 2024-12-09 20:21:34 +08:00
roymondchen
7a47315bc1 feat(editor): 选中页面后页面列表自动滚动到选中项 2024-12-09 20:21:34 +08:00
roymondchen
0727fe4fea feat(stage,editor): 在选中框新增支持触发画布中组件重新渲染 2024-12-09 20:21:34 +08:00
roymondchen
cdf2dc2b36 chore(editor): 优化页面tab体验 2024-12-09 20:21:34 +08:00
roymondchen
b4136c91c2 feat(editor): 优化依赖收集体验,减小收集任务粒度,修改配置时识别是否需要触发重新收集 2024-12-09 20:21:34 +08:00
roymondchen
9f7d67b17b feat(form,editor): 表单新增修改数据记录 2024-12-09 20:21:34 +08:00
roymondchen
0a1f03b5c7 chore(app): 删除无用log,export FlowState 2024-12-09 20:21:34 +08:00
parisma
52c1124e97 feat(editor): 事件流支持上下文对象传递和abort方法中断 2024-12-09 20:21:34 +08:00
roymondchen
f33f965354 chore(ui): 去掉package.json中export字段 2024-12-09 20:21:34 +08:00
roymondchen
eb614c47b0 chore: 更新依赖 2024-12-09 20:21:34 +08:00
roymondchen
7cd1bc7aec chore: 更新依赖 2024-12-09 20:21:34 +08:00
roymondchen
aaba8bff03 chore: update lockfile v1.5.0-beta.14 2024-12-09 20:21:34 +08:00
roymondchen
a6e9ecbe50 chore: release v1.5.0-beta.14 2024-12-09 20:21:34 +08:00
roymondchen
9741c4f3df style(form): 优化feildset,grouplist样式 2024-12-09 20:21:34 +08:00
roymondchen
b24b3749c4 fix(form): datatime没有初始值时异常 2024-12-09 20:21:34 +08:00
roymondchen
7964921389 chore: update lockfile v1.5.0-beta.13 2024-12-09 20:21:34 +08:00
roymondchen
88b243a8f4 chore: release v1.5.0-beta.13 2024-12-09 20:21:34 +08:00
roymondchen
13abe898a9 feat(editor): 支持配置页面过滤函数 2024-12-09 20:21:34 +08:00
roymondchen
12ce5c568e feat(form): 支持配置阻止默认的submit行为 2024-12-09 20:21:34 +08:00
roymondchen
d33ddcfa65 fix(editor): 更新组件配置后,如果当前没有任何依赖,不会触发收集,导致画布不更新 2024-12-09 20:21:34 +08:00
roymondchen
6521fdc988 chore: update lockfile v1.5.0-beta.12 2024-12-09 20:21:34 +08:00
roymondchen
8d231e14cc chore: release v1.5.0-beta.12 2024-12-09 20:21:34 +08:00
roymondchen
6e2a41afbc style(editor): import 错误 2024-12-09 20:21:34 +08:00
roymondchen
ed6d9b2b67 feat(editor): 页面/页面片不再使用tab分开显示,新增搜索页面 2024-12-09 20:21:34 +08:00
roymondchen
fc38fc3957 fix(editor): 修复修改页面配置后可能改造页面卡死问题 2024-12-09 20:21:34 +08:00
roymondchen
5dad9f0ec9 chore: update lockfile v1.5.0-beta.11 2024-12-09 20:21:34 +08:00
roymondchen
b1b1229a0b chore: release v1.5.0-beta.11 2024-12-09 20:21:34 +08:00
roymondchen
25646317ae fix(data-source): http数据源中mock数据应该是数据源定义好的数据,不再是请求的数据源 2024-12-09 20:21:34 +08:00
roymondchen
8b7dca8e23 chore: update lockfile v1.5.0-beta.10 2024-12-09 20:21:34 +08:00
roymondchen
f587a99385 chore: release v1.5.0-beta.10 2024-12-09 20:21:34 +08:00
roymondchen
5267b4bb93 feat(data-source): http数据源参数裁剪与响应裁剪支持异步函数配置 2024-12-09 20:21:34 +08:00
roymondchen
f6885a06b6 fix(data-source): 避免http数据源在编辑器中的响应裁剪中修改到mock配置的数据 2024-12-09 20:21:34 +08:00
roymondchen
eb8126c32f refactor(editor,utils): 将traverseNode方法挪到utils中 2024-12-09 20:21:34 +08:00
roymondchen
8aba06ac38 fix(data-source): 编辑器中迭代器容器中的容器添加组件并关联数据源后没有编译 2024-12-09 20:21:34 +08:00
roymondchen
2885e81c8b chore: update lockfile v1.5.0-beta.9 2024-12-09 20:21:34 +08:00
roymondchen
815a83f9ad chore: release v1.5.0-beta.9 2024-12-09 20:21:34 +08:00
roymondchen
995a9c9b57 chore: 将dist/style.css加入到sideEffects中 2024-12-09 20:21:34 +08:00
roymondchen
fd80bada97 fix(data-source): manager初始化数据源时,如果失败了要把data中对应的数据删掉,不然在ssr中会导致客户端不会重新尝试请求 2024-12-09 20:21:34 +08:00
roymondchen
054474634e fix(stage): 流水布局拖动无效 2024-12-09 20:21:34 +08:00
aldlss
dbb58e507d refactor(types): core 导出 AppOptionsConfig 2024-12-09 20:21:34 +08:00
roymondchen
c343fe4775 chore: update lockfile v1.5.0-beta.8 2024-12-09 20:21:34 +08:00
roymondchen
34bd98a815 chore: release v1.5.0-beta.8 2024-12-09 20:21:34 +08:00
roymondchen
e6239af7d8 fix(form): datarange组件如果传入utc时间,显示会出错 2024-12-09 20:21:34 +08:00
roymondchen
d3f5b2ec91 chore: update lockfile v1.5.0-beta.7 2024-12-09 20:21:34 +08:00
roymondchen
a99da7aa00 chore: release v1.5.0-beta.7 2024-12-09 20:21:34 +08:00
roymondchen
1de4d95bd4 chore: 更新依赖,vue@3.5.1 2024-12-09 20:21:34 +08:00
roymondchen
0c665c6b3c fix(form): date组件初始化时不显示值 2024-12-09 20:21:34 +08:00
roymondchen
7a19b7204c chore(runtime): 更新依赖 2024-12-09 20:21:34 +08:00
roymondchen
d9ef4b91fa fix(vue-component): 从core中获取utils的方法 2024-12-09 20:21:34 +08:00
roymondchen
368c9afc7f chore: update lockfile v1.5.0-beta.6 2024-12-09 20:21:34 +08:00
roymondchen
9da15002ff chore: release v1.5.0-beta.6 2024-12-09 20:21:34 +08:00
roymondchen
595d3cc7ca style(table): 完善ts定义 2024-12-09 20:21:34 +08:00
roymondchen
54c8169c34 chore: pnpm@9.9.0 2024-12-09 20:21:34 +08:00
roymondchen
7b9ceb9cfb style(editor): 修改indent prop 名称 2024-12-09 20:21:34 +08:00
roymondchen
6fd30242c0 feat(table): 新增createColumns函数 2024-12-09 20:21:34 +08:00
roymondchen
8cd2962b4b chore(core): npm包中增加resetcss.css 2024-12-09 20:21:34 +08:00
roymondchen
f17ff8e58b style: 完善ts 2024-12-09 20:21:34 +08:00
roymondchen
45d676f38f chore: update lockfile v1.5.0-beta.5 2024-12-09 20:21:34 +08:00
roymondchen
59417e8248 chore(vue-runtime-help): release 0.1.4 2024-12-09 20:21:34 +08:00
roymondchen
65c7ac919b chore: release v1.5.0-beta.5 2024-12-09 20:21:34 +08:00
roymondchen
f30f8ab13b feat(table): expand支持width fixed配置 2024-12-09 20:21:34 +08:00
roymondchen
815854bad8 chore(vue-components): release 2024-12-09 20:21:34 +08:00
roymondchen
0d901c018f fix(editor): stage销毁问题 2024-12-09 20:21:34 +08:00
roymondchen
a2c79c79cd fix(tmagic-form-runtime): 画布无法点击选中组件 2024-12-09 20:21:34 +08:00
roymondchen
47a21d6544 feat(editor): 新增已选组件、代码编辑、数据源及其子节点增量缩进配置 2024-12-09 20:21:34 +08:00
roymondchen
34fc0a15b9 refactor: 将data-source,dep,schema,utils收敛到core,将form,table,stage,design,util收敛到editor 2024-12-09 20:21:34 +08:00
洩氏诹诹子
c3bc1035ad feat(vue-component, runtime): 使用 app.resolveComponent 获取组件 (#631) 2024-12-09 20:21:34 +08:00
roymondchen
6e71448158 feat(stage): export MoveableActionsAble; 在选中框上面自定义按钮 2024-12-09 20:21:34 +08:00
roymondchen
2bb2a35fcc chore(react-component,vue-component): 更新依赖 2024-12-09 20:21:34 +08:00
roymondchen
ee469dfd65 refactor: 及时释放没用变量 2024-12-09 20:21:34 +08:00
roymondchen
0be82bedee chore: update lockfile v1.5.0-beta.4 2024-12-09 20:21:34 +08:00
roymondchen
735af70af6 chore: release v1.5.0-beta.4 2024-12-09 20:21:34 +08:00
roymondchen
e057ddc187 fix(data-source): 迭代内容多层嵌套下子组件条件配置不生效 2024-12-09 20:21:34 +08:00
roymondchen
b2410a8739 chore: release v1.5.0-beta.3 2024-12-09 20:21:34 +08:00
roymondchen
c82e3257c1 refactor(stage,editor): stage销毁后释放内部变量 2024-12-09 20:21:34 +08:00
roymondchen
6754c3a8a5 fix(dep): 数据源条件依赖收集默认不收集迭代器内部组件的依赖 2024-12-09 20:21:34 +08:00
roymondchen
79767c8ec1 chore: update lockfile v1.5.0-beta.2 2024-12-09 20:21:34 +08:00
roymondchen
f589df7303 chore: release v1.5.0-beta.2 2024-12-09 20:21:34 +08:00
roymondchen
ea79a0d601 fix(data-source): http数据源中mock配置中关闭启用后,不会执行request 2024-12-09 20:21:34 +08:00
roymondchen
798ace76f3 chore: 更新pnpm版本,修复ts错误 2024-12-09 20:21:34 +08:00
roymondchen
0979282504 feat(form): 添加tmagicFormItemProp 2024-12-09 20:21:34 +08:00
roymondchen
feaa295606 chore(playground): playground添加design style 2024-12-09 20:21:34 +08:00
roymondchen
c73a27eb1a feat(design): popover 添加destroyOnClose props 2024-12-09 20:21:34 +08:00
roymondchen
0e44372a7e chore: 更新版本号 2024-12-09 20:21:34 +08:00
roymondchen
7384e8babe chore: update lockfile v1.5.0-beta.1 2024-12-09 20:21:34 +08:00
roymondchen
ee1a019727 chore: release v1.5.0-beta.1 2024-12-09 20:21:34 +08:00
roymondchen
b0d42d79aa style(stage): 完善render配置的定义 2024-12-09 20:21:34 +08:00
roymondchen
c5ce6d3c10 style(editor): 优化数据源新增列表样式 2024-12-09 20:21:34 +08:00
roymondchen
4f7b6cede4 feat(editor): export tree组件 2024-12-09 20:21:34 +08:00
roymondchen
e53c0e1ce5 fix(design): popover zindex不生效 2024-12-09 20:21:34 +08:00
roymondchen
d4408aaa32 chore(runtime): 更新版本号 2024-12-09 20:21:34 +08:00
roymondchen
9dd10d7ea1 chore: release v1.5.0-beta.0 2024-12-09 20:21:34 +08:00
roymondchen
9494ed79a3 feat(uitls): 只是自定义dsl与dom el的关联关系函数 2024-12-09 20:21:34 +08:00
roymondchen
39e68bd33a chore: 升级elememt-plus版本 2024-12-09 20:21:34 +08:00
roymondchen
80040a69ef style(data-source): 删除无用注释 2024-12-09 20:21:34 +08:00
roymondchen
5e61f23106 feat(design,element-plus-adapter,tdesign-vue-next-adapter): 重新实现Popover组件,不再使用element-plus或tdesign组件 2024-12-09 20:21:34 +08:00
roymondchen
cab36b49a3 feat: 将ui-react中的组件独立成包 2024-12-09 20:21:34 +08:00
roymondchen
60d2b64aa5 fix: 迭代器内的组件配置了声明周期代码块无效 2024-12-09 20:21:34 +08:00
roymondchen
9e4da0a5c2 feat: dsl id渲染到dom上的data-tamgic-id,不再是id属性 2024-12-09 20:21:34 +08:00
roymondchen
b00e7aec13 build: 删除多余构建配置,构建ui 2024-12-09 20:21:34 +08:00
roymondchen
3758cf8e0a feat: 统一vue ui组件,将ui中的组件独立成包 2024-12-09 20:21:34 +08:00
roymondchen
5ed534e364 feat(cli): 组件库支持import npm包组件 2024-12-09 20:21:34 +08:00
roymondchen
7aeca39521 build: 不在每个package中构建dts,解决package间相互依赖问题 2024-12-09 20:21:34 +08:00
roymondchen
de47514f69 feat: 完善迭代器嵌套使用问题,重构事件配置处理代码
* feat(editor,core,data-source,dep,schema,ui,utils,vue-runtime-help): 完善迭代器

* test: 完善测试用例

* chore: 构建

* feat: 迭代器嵌套事件传递数据

---------

Co-authored-by: roymondchen <roymondchen@tencent.com>
2024-12-09 20:21:34 +08:00
roymondchen
5e7ac69929 chore: update lockfile v1.4.19 2024-12-09 20:21:34 +08:00
roymondchen
fc2fd851c3 chore: release v1.4.19 2024-12-09 20:21:34 +08:00
roymondchen
3a7bfef5cf fix(form): text组件配置了tooltip无效 2024-10-31 15:52:18 +08:00
roymondchen
1fa27e1239 chore: update lockfile v1.4.18 2024-09-14 10:35:53 +08:00
roymondchen
7173d28e5b chore: release v1.4.18 2024-09-14 10:33:40 +08:00
roymondchen
a750fcd108 chore: 将dist/style.css加入到sideEffects中 2024-09-13 20:27:00 +08:00
roymondchen
4ce3f3e34e style(form): form-item上的hidden class容易冲突,改成tmagic-form-hidden 2024-09-13 20:25:02 +08:00
roymondchen
e5a0fb7eca chore: update lockfile v1.4.17 2024-08-30 17:42:18 +08:00
roymondchen
65f7816c59 chore: release v1.4.17 2024-08-30 17:40:02 +08:00
roymondchen
883e227d54 fix(form): date相关的field,在没有配置valueFormat的情况下与默认的valueFormat不符 2024-08-30 17:35:04 +08:00
roymondchen
45d246abce chore: github action 使用dev分支作为构建分支 2024-08-06 14:42:06 +08:00
roymondchen
8d54bcafc1 style(editor): 代码参数配置label width设置长些 2024-08-06 14:35:19 +08:00
roymondchen
fa2d00ba36 fix(data-source): 编辑器的runtime不能对数据源的mock配置有影响 2024-08-06 14:33:21 +08:00
roymondchen
69f3cb2f12 feat(vue-runtime-help): 只有dsl中的组件才触发生命周期hook 2024-08-02 14:07:27 +08:00
roymondchen
831cdfb2d6 chore: update lockfile v1.4.16 2024-08-02 13:58:24 +08:00
roymondchen
5e95f56c34 chore: release v1.4.16 2024-08-02 13:56:15 +08:00
roymondchen
92e6d40e75 chore: 更新依赖 2024-08-01 20:44:36 +08:00
roymondchen
81a221e561 fix(ui): 页面style没有响应式了 2024-08-01 20:26:46 +08:00
roymondchen
c8d6a4f4d1 refactor(ui): 通过解析dsl渲染的组件,渲染时往config中加入IS_DSL_NODE_KEY,用于识别是系统渲染的 2024-08-01 20:25:02 +08:00
roymondchen
59f05270ae feat(core): 完善屏幕大小自动适配 2024-08-01 17:01:15 +08:00
roymondchen
9f8088164e chore: update lockfile v1.4.15 2024-07-26 13:08:09 +08:00
roymondchen
211673c6a5 chore: release v1.4.15 2024-07-26 13:05:51 +08:00
roymondchen
96224b4d92 fix(stage): 页面失焦时将alt键按下状态重置 2024-07-25 21:04:51 +08:00
roymondchen
b249563f94 feat(editor): 优化编辑器左边栏拖出体验,需要拖出一定距离才行 2024-07-25 20:58:07 +08:00
roymondchen
837daf6cab feat(editor): 编辑器左边栏支持配置不可拖出,支持before-click函数配置 2024-07-25 20:53:03 +08:00
roymondchen
72a7c151e9 fix(editor): 组件树右键菜单在组件树面板拖出时被面板遮挡
fix #624
2024-07-25 19:30:50 +08:00
roymondchen
3fa21fd3eb feat(editor): 数据源选择器编辑按钮添加tooltip 2024-07-25 19:23:34 +08:00
roymondchen
ea556d69f6 style(playground): 完善ts定义 2024-07-25 17:51:49 +08:00
roymondchen
0bbf7c5643 feat(editor): 添加component-list slot,用于自定义组件列表
re #621
2024-07-25 17:49:40 +08:00
roymondchen
16d4eff385 fix(editor): 组件树中将容器拖入自身中会导致容器丢失
fix #622
2024-07-25 17:20:36 +08:00
roymondchen
c456798751 fix(editor): 在组件树中多选时不能选中页面 2024-07-25 16:23:36 +08:00
linzisong
57be30cf6b docs: select选择器远程选项文档补充 2024-07-25 11:25:46 +08:00
roymondchen
8d111ea976 feat(data-source): 数据源新增setValue方法 2024-07-16 16:24:32 +08:00
roymondchen
059c0056c4 fix(editor): 数据源方法配置,设置后再次修改参数配置不显示 2024-07-16 16:16:05 +08:00
roymondchen
e209aa36e8 fix(data-source): 迭代器数据编译支持容器嵌套 2024-07-15 21:32:13 +08:00
roymondchen
a67058e1e5 chore: update lockfile v1.4.14 2024-07-12 16:08:13 +08:00
roymondchen
d85c6c1b2c chore: release v1.4.14 2024-07-12 16:05:59 +08:00
roymondchen
1fc04b4464 fix(data-source): 迭代条件条件组编译逻辑不对 2024-07-12 14:14:04 +08:00
roymondchen
2b8648ed35 chore: update lockfile v1.4.13 2024-07-04 15:34:09 +08:00
roymondchen
602da25b6d chore: release v1.4.13 2024-07-04 15:32:33 +08:00
roymondchen
eb376b261b fix(editor): 修复新增第一个显示条件时会重置表单状态 2024-07-04 15:27:27 +08:00
roymondchen
1e93e9bacc fix(data-source): 按需加载数据源时需要分享数据源方法依赖 2024-07-04 14:41:34 +08:00
roymondchen
5d6de7c405 chore: update lockfile v1.4.12 2024-07-02 21:13:56 +08:00
roymondchen
033ef19d6b chore: release v1.4.12 2024-07-02 21:12:16 +08:00
roymondchen
aabca93c27 fix(editor): 更新容器后,需要将容器内的依赖重新收集 2024-07-02 21:09:18 +08:00
roymondchen
c8870c5c12 fix(dep): 数据源源方法依赖收集,数据源类内定义的方法需要被收集 2024-07-02 21:02:26 +08:00
roymondchen
58a34b0ad6 chore: update lockfile v1.4.11 2024-07-02 16:24:07 +08:00
roymondchen
9989b97fe9 chore: release v1.4.11 2024-07-02 16:22:30 +08:00
roymondchen
6cdeaa0c1b feat(editor): 方法参数支持选择数据源字段 2024-07-02 16:16:15 +08:00
roymondchen
ecfaff2e0d feat(data-source): 迭代器容器内容支持显示条件配置 2024-07-02 16:14:33 +08:00
roymondchen
ef04fd31f0 feat(editor): 优化数据源字段选择器交互 2024-07-02 13:02:21 +08:00
roymondchen
882d222800 feat(data-source): 迭代器容器内容支持显示条件配置 2024-07-01 21:31:55 +08:00
roymondchen
022c10f2df fix(editor): 迭代器容器子项条件配置中值输入类型 2024-07-01 19:33:22 +08:00
洩氏诹诹子
c089adae9e fix(form): 修复 grouplist 添加项时没有调用 changeHandler 的问题 2024-07-01 16:55:25 +08:00
roymondchen
dd243c6c5e chore: update lockfile v1.4.10 2024-06-28 19:27:12 +08:00
roymondchen
f112abf246 chore: release v1.4.10 2024-06-28 19:25:36 +08:00
roymondchen
079679997a fix(stage): 标尺销毁后没有移除对应的dom
fix #617
2024-06-28 19:12:36 +08:00
roymondchen
a164e2be62 feat(dats-source,editor,form,schema,ui): 迭代器容器支持配置子项显示条件 2024-06-28 17:44:04 +08:00
parisma
0c5485b1d0 feat(editor): 支持拖拽调整页面顺序 2024-06-28 08:54:00 +00:00
roymondchen
0ffc223459 feat(editor): 优化数据源字段选择器交互 2024-06-27 19:55:06 +08:00
roymondchen
77f13fa898 fix(form,design): 支持行内表单 2024-06-24 14:20:47 +08:00
roymondchen
654961b349 refactor(util): 完善datetimeFormatter方法ts定义 2024-06-21 16:26:23 +08:00
roymondchen
c63c807232 chore: update lockfile v1.4.9 2024-06-17 16:43:47 +08:00
roymondchen
c2f25c8c7f chore: release v1.4.9 2024-06-17 16:42:05 +08:00
roymondchen
3f974a27b2 chore(ui,playgournd,runtime): 更新版本 2024-06-17 16:38:52 +08:00
roymondchen
e4a06bd12d build: package.json 中files增加src,移除sideEffects 2024-06-17 16:24:06 +08:00
roymondchen
80e42cc997 chore: release v1.4.8 2024-06-17 15:27:15 +08:00
roymondchen
f4c2cdce2b chore: 更新依赖 2024-06-17 15:06:16 +08:00
roymondchen
a66ef3273a build: 发布后更新pnpm lockfile 2024-06-17 14:35:49 +08:00
roymondchen
5c43fbfd96 fix(data-source): 多页面时数据源依赖中可能包含其他页面的,导致更新时失败 2024-06-13 20:53:45 +08:00
roymondchen
948c194a60 feat(ui,runtime): vue-runtime-help中添加use-app方法 2024-06-13 20:44:58 +08:00
roymondchen
7ee7f53938 fix(data-source): 兼容Promise.allSettled 2024-06-13 17:03:48 +08:00
roymondchen
5873842260 style(runtime): 完善ts定义 2024-06-12 15:00:52 +08:00
roymondchen
9eb99ed176 feat(editor): 组件表单配置支持函数 2024-06-12 14:54:15 +08:00
roymondchen
a30e8a3eea feat(editor): 支持数据源模板输入宽选中文本后编辑(在有数据源变量时还有问题) 2024-06-11 20:28:12 +08:00
roymondchen
094635cc0e fix(ui): overlay销毁需要异常page上的事件 2024-06-11 19:31:34 +08:00
roymondchen
5ac768f15b feat(editor): 组件树中支持多选拖动 2024-06-11 19:28:40 +08:00
roymondchen
83b14767b3 style(editor): 属性配置中的源码编辑器添加class,防止样式污染 2024-06-11 13:57:08 +08:00
roymondchen
653cafbe81 chore(runtime): 使用DeepObservedData做完数据源事件模型 2024-06-06 17:42:27 +08:00
roymondchen
ac7bb93a37 fix(data-source): 默认事件处理支持path为空字符串 2024-06-06 17:40:13 +08:00
roymondchen
e1f8392261 chore: 更新依赖 2024-06-05 19:44:39 +08:00
roymondchen
0cd83825b7 fix(runtime): 使用vue-demi cdn 2024-05-31 20:02:53 +08:00
roymondchen
b198417ad1 chore: 补充package.json files字段 2024-05-31 17:45:09 +08:00
roymondchen
78e9a0ab15 fix(editor,runtime): 编辑器中,依赖收集改成异步以后,可能出现配置更新了,但是依赖信息还未更新,导致渲染出来的组件不对 2024-05-31 17:26:37 +08:00
roymondchen
aa25aa6d85 fix(vue-runtime-help): inject app 无效 2024-05-31 17:02:19 +08:00
roymondchen
3b87589d01 chore: update lock v1.4.7 2024-05-31 15:17:36 +08:00
roymondchen
697442ba63 chore: release v1.4.7 2024-05-31 15:14:06 +08:00
roymondchen
4670adadc0 Revert "build: 发布时在更版本号后执行reinstall来生成新lock"
This reverts commit 7dad24737454c99c6f164a6e7699f1e560d7155b.
2024-05-31 15:11:26 +08:00
roymondchen
9448d94e99 docs: editor props sidebar 例子中少了] 2024-05-31 14:49:29 +08:00
roymondchen
94db430b85 fix(ui,runtime): 迭代器容器迭代数据兼容
re #613
2024-05-31 14:45:21 +08:00
roymondchen
7fb4d96cb0 fix(editor): 已选组件树中如果出现items不是数组会导致节点渲染失败 2024-05-30 17:23:41 +08:00
roymondchen
7dad247374 build: 发布时在更版本号后执行reinstall来生成新lock 2024-05-30 17:22:05 +08:00
roymondchen
2d133f47f1 feat(core,editor,form): 页面片容器支持配置容器内组件的事件 2024-05-30 17:14:50 +08:00
parisma
cd191f6815 feat(editor): 复制组件时收集依赖性能优化改造 2024-05-30 07:44:27 +00:00
roymondchen
50d238a48c feat(playground): 设置配置表单的label-width 2024-05-30 11:29:02 +08:00
roymondchen
49e9d5b985 fix(playground): tmagic-form样式丢失
fix #610
2024-05-29 20:10:32 +08:00
Evan Wu
d98029d5e7
fix(editor): 修复pad大屏模式下粘贴位置计算错误偏移问题 (#612)
* fix: 修复moveable中custom able旋转中心错误问题

* fix: 修复修复pad大屏模式下粘贴位置偏差问题
2024-05-29 20:01:51 +08:00
roymondchen
a66da8de9e fix(editor): 数据源模板输入框输入数字索引后浏览器卡死
fix #611
2024-05-29 19:57:14 +08:00
roymondchen
ee269917f8 feat(dep,editor,data-source,schema): 优化编辑器中依赖收集性能 2024-05-29 19:32:16 +08:00
roymondchen
cc8ec39dad chore: release v1.4.6 2024-05-27 19:18:48 +08:00
roymondchen
92e9d888e9 chore: 更新typescript依赖 2024-05-27 19:14:09 +08:00
parisma
faabf1bb3a feat(editor,dep): 支持复制组件时将组件绑定的数据源一并复制 2024-05-27 10:52:07 +00:00
roymondchen
2ea876a2a0 style(utils): 完善ts定义 2024-05-27 17:22:04 +08:00
roymondchen
15e9cdc2d6 fix(runtime): vue runtime App组件中缺失inject 2024-05-24 19:57:22 +08:00
roymondchen
d5ce54f35e docs: 更新vitepress 2024-05-24 17:58:24 +08:00
roymondchen
f8dd062a50 feat(runtime): vue2/vue3公共部分提出到vue-runtime-help中 2024-05-24 17:44:01 +08:00
roymondchen
66001dae04 docs: 数据源文档
re #603
2024-05-24 15:16:30 +08:00
roymondchen
47c42222b3 fix(editor): stageOverlay不应受编辑器zoom影响 2024-05-23 19:32:00 +08:00
roymondchen
5ce099c11d feat(editor): export FloatingBox 2024-05-23 11:03:44 +08:00
roymondchen
c6ac0a0a2b chore(runtime:tmagic-form): 更新版本 2024-05-23 11:02:58 +08:00
roymondchen
20a540f0fc chore(runtime:tmagic-form): 更新版本 2024-05-22 19:20:56 +08:00
Li Ming
af3f621424
fix(runtime:react): update page时出错 2024-05-22 19:17:29 +08:00
roymondchen
58466dbb0a chore: 更新package 2024-05-22 17:34:15 +08:00
roymondchen
fbac2f820e chore: release v1.4.5 2024-05-20 14:24:27 +08:00
roymondchen
22eb7453be build: release git commit 2024-05-20 14:19:13 +08:00
roymondchen
238762dd0f style(core,schema): 完善dsl定义 2024-05-15 20:25:35 +08:00
roymondchen
7a13cd851b refactor(ui): 完善props定义,优化冗余代码 2024-05-15 20:23:51 +08:00
roymondchen
901fe4dd94 chore: 完善依赖 2024-05-14 14:25:47 +08:00
roymondchen
5074c9e68b refactor(core): 完善事件逻辑 2024-05-14 14:05:01 +08:00
qwertyyb
88c04c6dac
feat: 支持数据源事件 (#605)
* feat: 添加observedData

* feat: 修改错误

* fix: 修复单测报错问题

* feat: 完善数据源事件

* fix: 修复数据源事件调用组件方法时报错的异常

* fix: 修复多个相同类型的数据源数据变化的事件混淆的问题

* chore: 删除无用代码

* feat: 默认使用SimpleObservedData

* feat: 删除无用代码

---------

Co-authored-by: marchyang <marchyang@tencent.com>
2024-05-13 17:23:23 +08:00
roymondchen
831204663a test: 完善测试用例 2024-05-09 20:49:54 +08:00
roymondchen
ff60d0238b chore: 更新依赖 2024-05-09 19:58:48 +08:00
roymondchen
c665bf3ccc fix(core,data-source): 事件参数中关联数据源字段无法自动更新 2024-05-09 17:01:34 +08:00
roymondchen
708d3db4bb feat(data-source): manager init 事件增加error数据 2024-05-08 19:26:53 +08:00
roymondchen
9034cef0d2 fix(form): select option label不生效 2024-05-08 14:44:04 +08:00
roymondchen
0f2bd3f01d build: editor version写错
fix #601
2024-05-08 11:46:31 +08:00
roymondchen
6b081fdc53 chore: 包内依赖改成workspace:*,更新release脚本 2024-04-26 17:15:28 +08:00
Evan Wu
e39a7d140f
fix(editor,stage,utils): 修复在ipad等大屏场景下编辑画布中元素位置计算偏差问题 (#598) 2024-04-25 20:13:21 +08:00
roymondchen
71c90d1d4d chore(element-plus-adapter): 移除vue依赖 2024-04-25 19:42:39 +08:00
roymondchen
ad2146f3bd fix(form): select option 在没有adapter的时候默认使用el-option 2024-04-25 19:38:43 +08:00
roymondchen
9174e775ae chore: 更新github action node 版本 2024-04-23 15:50:28 +08:00
roymondchen
7a9e5ca6f6 build: pre-commit检查改成检查ts类型 2024-04-23 15:24:25 +08:00
roymondchen
883e5d60fa build: 按依赖顺序构建 2024-04-23 15:09:29 +08:00
roymondchen
f467c88b10 chore: 更新packageManager 2024-04-22 20:01:56 +08:00
roymondchen
013365388d style(editor): 调整数据源字段选择器样式 2024-04-16 20:38:34 +08:00
roymondchen
03be7bcbd3 chore: release v1.4.4 2024-04-16 17:05:21 +08:00
roymondchen
69c555f567 fix(runtime): 更新page后,在编辑器中无法打开蒙层
由于更新page后,会去判断app.page.data对象是否为dsl中page的配置,如果不是会销毁page,重新new,就导致overlay中page的监听失效

fix #587
2024-04-16 16:28:22 +08:00
roymondchen
fc1a7a09ff feat(editor): 优化数据源选择器与代码选择的编辑按钮 2024-04-16 11:52:11 +08:00
roymondchen
4054c6ed57 feat(editor): 支持配置左侧边栏tab style 2024-04-12 20:20:40 +08:00
roymondchen
b1e79c1e05 fix(editor): 在组件属性配置表单中编辑数据源方法无法保存问题 2024-04-12 20:11:34 +08:00
roymondchen
92049cf251 feat(editor): 新增配置控制属性配置面板右下角的源码按钮是否显示 2024-04-12 19:31:09 +08:00
roymondchen
006133102f feat(cli,data-source,runtime): 数据源支持动态按需加载 2024-04-12 16:52:58 +08:00
roymondchen
872c978b9b fix(editor): floating-box高度无法改变 2024-04-11 17:23:31 +08:00
roymondchen
3af247febb fix(playground): 画布尺寸切换无效
由于element-plus2.6后radio-button label属性改成value

fix #586
2024-04-08 14:25:33 +08:00
roymondchen
f35fca0eeb chore: release v1.4.3 2024-03-29 14:20:35 +08:00
roymondchen
05527a41a1 fix(editor): 数据源字段选择器初始化状态 2024-03-29 14:17:58 +08:00
roymondchen
0e0f50187e fix(data-source,dep,utils): 迭代器数据源配置编译 2024-03-29 12:20:30 +08:00
roymondchen
47b19ae7fa feat(playground): 缓存上次保存dsl 2024-03-28 21:02:15 +08:00
roymondchen
edfe5c6973 chore: release v1.4.2 2024-03-26 17:21:59 +08:00
roymondchen
ceff0d4147 fix(editor): element-plus更新到2.6后表单项清除后是undefined,改回是空字符串 2024-03-26 17:15:42 +08:00
roymondchen
934398911d feat(data-srouce): manager新增init事件 2024-03-26 17:02:14 +08:00
roymondchen
66e16452a8 feat(editor): 数据源字段选择器增加编辑按钮 2024-03-26 16:12:01 +08:00
roymondchen
f92127e3d6 fix(editor): 代码块配置表单项大小不受配置控制 2024-03-26 15:28:06 +08:00
roymondchen
7049b1ff45 fix(editor): 初始化时如果浏览器切到后台编辑器列宽度计算出问题 2024-03-26 15:20:41 +08:00
roymondchen
15b88c97fc fix(form): select 支持tdesign-vue-next
fix #584
2024-03-25 20:17:00 +08:00
roymondchen
3f06ca3623 build(data-source): umd构建版本将lodash打包进去 2024-03-25 19:14:41 +08:00
roymondchen
a4fc95775e fix(editor): element-plus更新到2.6后表单项清除后是undefined,除了string外其他统一改成null 2024-03-25 14:52:11 +08:00
roymondchen
03fe553344 chore: release v1.4.1 2024-03-22 13:31:58 +08:00
roymondchen
6ccd8bb06b fix(design): element-plus select中scrollbar变量名改变 2024-03-22 13:27:09 +08:00
Yang Gao
b564907b12
fix(editor): 数据源列表搜索过滤无响应问题 (#582) 2024-03-21 19:30:29 +08:00
roymondchen
f999b60a79 chore: 完善代码 2024-03-20 14:26:05 +08:00
roymondchen
1dcdab8f92 chore(tmagic-form-runtime): 更新版本 2024-03-19 19:27:29 +08:00
roymondchen
da2da0827d chore: release v1.4.0 2024-03-19 19:22:40 +08:00
roymondchen
b3cf919273 chore(editor): 解决warning 2024-03-19 19:18:03 +08:00
moonszhang
96149bd2ae feat(editor): 数据源抽屉切floatbox 2024-03-19 11:07:43 +00:00
roymondchen
e2326ff4f6 chore: README新增贡献者 2024-03-19 17:29:12 +08:00
roymondchen
92b7a2aecf feat: 完善tdesign-vue-next适配 2024-03-19 17:26:08 +08:00
Evan Wu
0c746aa3d9
feat(runtime, utils): Fix issue #503, setPage实现跳转页面 (#581)
* fix: 修复moveable中custom able旋转中心错误问题

* feat(runtime): fix issue #503, 增加page-change回调

* feat(core, runtime): 增加页面不存在时调用报错

* fix(runtime, core, utils): 提取addParamsToUrl公共方法且更改'page-change'逻辑

* fix(utils): 优化addParamToUrl方法
2024-03-19 16:18:14 +08:00
roymondchen
9d405428be chore(tmagic-form-runtime): 更新版本 2024-03-18 19:47:03 +08:00
roymondchen
24d029574f style(table): 完善ts定义 2024-03-18 19:15:24 +08:00
roymondchen
d5354c11d6 chore(tmagic-form-runtime): 更新依赖 2024-03-18 17:41:06 +08:00
roymondchen
2e11d7cf42 chore: release v1.4.0-beta.2 2024-03-18 17:32:30 +08:00
roymondchen
fff56a97f7 feat(stage,editor): 选中的元素不存在时不报错,并完善事件ts定义
fix #579
2024-03-18 17:25:40 +08:00
roymondchen
42f1f28b02 fix(editor): 拖动浮动窗口会导致窗口变大 2024-03-15 17:14:56 +08:00
roymondchen
de1711d713 feat(editor): 属性面板支持切换源码 2024-03-15 16:44:58 +08:00
roymondchen
c83e76e641 feat(editor): 优化代码块编辑弹窗 2024-03-15 15:24:16 +08:00
roymondchen
36a1a18615 fix(editor): 修复第一次打开编辑器左右边栏宽度可能为0问题 2024-03-15 15:22:30 +08:00
roymondchen
62e7888fcf fix(editor): 修复直接关闭代码块编辑窗口告警 2024-03-13 19:59:45 +08:00
roymondchen
f881b9ea3b chore: 修复报错 2024-03-13 19:57:35 +08:00
roymondchen
38145ff461 style(table): 完善ts定义 2024-03-13 19:55:45 +08:00
roymondchen
523545ec7e chore: release v1.4.0-beta.1 2024-03-13 16:45:20 +08:00
roymondchen
d9b95563b5 chore: 发布时条件git加上no-verify 2024-03-13 16:40:52 +08:00
roymondchen
8c9018407a chore(tmagic-form-runtime): 销毁app 2024-03-13 16:34:40 +08:00
roymondchen
52f09f9f22 style(tmagic-form-runtime): 完善ts定义 2024-03-13 16:25:11 +08:00
roymondchen
ca2c6af060 chore: 更新依赖 2024-03-13 16:17:00 +08:00
moonszhang
7ce60b223e feat(editor): 增加FloatBox的beforeClose函数 2024-03-13 06:00:22 +00:00
moonszhang
cae928f7f9 fix(editor): 修复点击floatbox时更新zindex导致宽高被重置的问题 2024-03-13 06:00:22 +00:00
moonszhang
5fc649607a fix(editor): 修复高级中打开代码块没有floatbox嵌套的问题,floatbox支持beforeClose事件 2024-03-13 06:00:22 +00:00
roymondchen
4f31eed71a style(editor): use-plugin ts定义完善 2024-03-12 14:08:37 +08:00
roymondchen
d71e6b1933 style(editor): float-box限制最大宽高 2024-03-11 20:36:21 +08:00
moonszhang
a035f02f83 feat(editor): 使用 floatbox 替换原抽屉栏 2024-03-11 12:25:19 +00:00
roymondchen
260286f9cf refactor(ui,playground): 优化编码 2024-03-11 20:22:53 +08:00
roymondchen
c68d4e05de feat(data-source,runtime): 数据源编译组件时新增一个参数控制是否要编辑子元素
编译时只需要关注组件本身的配置,子组件有自己的依赖,不需要由父组件来控制,但是在编辑器中就需要,因为为了不改动到编辑器中的dsl,编译后的配置是不会保存起来的,所以容器编译时需要把子组件也一同编译
2024-03-11 20:21:10 +08:00
roymondchen
a3b41caf06 chore: 删除babel配置 2024-03-11 16:29:25 +08:00
roymondchen
cda6c0f791 feat(editor): 样式配置支持配置数据源字段 2024-03-08 20:04:48 +08:00
roymondchen
900acb6eb0 chore(tmagic-form-runtime): 更新依赖 2024-03-08 11:24:06 +08:00
Evan Wu
842fa221aa
fix(stage): 修复moveable中custom able旋转中心错误问题 (#575) 2024-03-08 11:23:40 +08:00
roymondchen
e692e01c4f feat: 支持迭代器容器 2024-03-07 16:56:05 +08:00
roymondchen
6dbac52c50 feat(design,form): cascader新增popper-class prop 2024-03-07 15:18:04 +08:00
Steven Qiang
94a6004608
fix(design): Autocomplete default slot 名称拼写错误
Co-authored-by: Steven <admin@qiangmou.ren>
2024-03-07 15:17:36 +08:00
roymondchen
032f7c03e0 style(dep,editor,schema,stage): 完善注释与ts定义 2024-03-05 19:04:36 +08:00
roymondchen
e272370fea feat(form): label 标签的title属性配置 2024-03-05 15:30:29 +08:00
roymondchen
8e18336fa3 fix(editor): 设置配置时使用的key统一转换成kebab-cased形式
fix #576
2024-03-05 15:07:27 +08:00
roymondchen
16e45cb45d style(editor): 完善service use-plugin的ts类型定义 2024-03-05 14:55:41 +08:00
roymondchen
5cf137e5e8 fix(stage): 多选后拖动没有响应 2024-03-05 14:51:01 +08:00
roymondchen
0315389ce9 feat(editor): props-service支持通过fill-config设置label-width 2024-03-04 14:18:21 +08:00
roymondchen
0e314ef5ad chore: release v1.3.16 2024-03-01 16:36:32 +08:00
roymondchen
ffc3e57aa1 fix(design,editor,tdesign-vue-next-adapter): tMagicPopover在TDesign下异常
fix #574
2024-03-01 16:30:40 +08:00
roymondchen
1b3c598a66 fix(tmagic-form-runtime): useRuntime添加默认参数 2024-03-01 15:19:28 +08:00
roymondchen
6821ce5fbf feat(editor): 新增data-source-panel-search slot 2024-03-01 15:13:33 +08:00
roymondchen
a073b8c50d feat(editor): 新增code-block-panel-search slot 2024-03-01 13:56:53 +08:00
roymondchen
c65470186c chore: release v1.3.15 2024-02-29 17:21:45 +08:00
roymondchen
0df98bc226 fix(runtime): 数据源变化更新页面出错 2024-02-29 16:54:49 +08:00
roymondchen
58b62d18e4 feat(editor): 代码选择器,数据源方法选择新增不可编辑配置,与disabled区分开 2024-02-29 16:47:18 +08:00
roymondchen
d59f5abdf5 chore: release v1.3.14 2024-02-29 14:52:26 +08:00
roymondchen
aec37c35cc build: 发布时不更新tmagic-form runtime的版本号 2024-02-29 14:50:30 +08:00
roymondchen
a1e09c3b54 chore(playground): 更新tmagic-from-runtime版本 2024-02-29 14:09:14 +08:00
roymondchen
3fe83f9fa4 fix(editor): 从页面切换成页面片时不会默认选中第一个页面片 2024-02-28 16:38:32 +08:00
roymondchen
b4df7f5eea fix(editor): 复制页面后,组件树选中状态不对 2024-02-28 16:08:32 +08:00
roymondchen
fcede5c0ac feat(editor): menu配置支持事件 2024-02-28 15:18:36 +08:00
roymondchen
33fcee66df fix(utils): 数据源条件解析空字符出错 2024-02-28 15:09:14 +08:00
roymondchen
455c696ff0 fix(data-source, ui): 页面配置配置数据源字段模块出错 2024-02-28 14:56:45 +08:00
roymondchen
06ff39b800 build: npm发布时更新tmagic-form runtime依赖 2024-02-28 14:38:22 +08:00
roymondchen
074d76456b feat(editor,core,schema): 组件高级配置支持配置数据源方法 2024-02-28 14:33:57 +08:00
moonszhang
0d471a96ed style(editor): 修改floatbox 样式问题 2024-02-27 07:35:40 +00:00
moonszhang
cda5413fd1 refactor(editor): floatbox 使用公共组件 2024-02-27 03:01:38 +00:00
roymondchen
8d1ba220c1 fix(tmagic-form-runtime): 完善form-runtime 2024-01-31 17:09:04 +08:00
roymondchen
7db8d8f45f docs: 启动runtime命令出错 2024-01-23 15:29:32 +08:00
roymondchen
fbb5b3c947 chore: release v1.3.13 2024-01-19 16:31:46 +08:00
roymondchen
2432bc5a69 fix(editor): stage-overlay状态更新 2024-01-19 11:29:11 +08:00
roymondchen
01f8040a1a fix(stage): scrollIntoView不能有横向滚动 2024-01-18 19:47:50 +08:00
roymondchen
9e263f9e23 chore(cli): 修改注释 2024-01-18 19:27:07 +08:00
roymondchen
2114b89365 fix(editor): 弹层画布响应组件树点击 2024-01-18 14:22:31 +08:00
roymondchen
2d5bd2ddb4 chore: release v1.3.12 2024-01-18 11:47:54 +08:00
roymondchen
c30e7d340b feat(editor,stage): 完善双击画布可以已弹层方向显示并显示完整的组件 2024-01-18 11:40:00 +08:00
roymondchen
3613237350 docs(editor): 完善editor props的注释 2024-01-18 11:40:00 +08:00
leon Li
edc7c11929
fix(editor): 移动元素到容器中的时候root没有更新问题 (#569)
* fix(editor/stage): 拖动组件进画布后,父容器位置计算有误

* fix(editorService): 移动元素时候root没有更新问题

---------

Co-authored-by: fanliming <fanlm@novastar.tech>
2024-01-18 11:39:37 +08:00
roymondchen
30929e8bd3 chore: release v1.3.11 2024-01-12 16:43:16 +08:00
roymondchen
2679969cb6 build: 不生成sourcemap 2024-01-12 16:40:24 +08:00
roymondchen
e4af8cadb0 feat(editor,stage): 双击画布可以已弹层方向显示并显示完整的组件 2024-01-12 16:36:59 +08:00
roymondchen
22e8ae47f1 Merge branch 'master' of https://github.com/Tencent/tmagic-editor 2024-01-10 16:41:54 +08:00
leon Li
115123a0bc
fix(editor): 拖动组件进画布后,父容器位置计算有误 (#565)
Co-authored-by: fanliming <fanlm@novastar.tech>
2024-01-10 16:39:15 +08:00
roymondchen
6f7415e116 refactor(form): button text prop 改成 link element-plus将废弃text 2024-01-10 16:34:46 +08:00
roymondchen
b4bf5ddc0a chore: release v1.3.10 2024-01-10 16:07:19 +08:00
roymondchen
84cbc745c7 fix(runtime): 更新Vue3 cdn链接 2024-01-09 15:18:31 +08:00
roymondchen
f8443ed316 feat: 新增tmagic-form-runtime 2024-01-09 14:58:13 +08:00
roymondchen
a10ae0ddd1 refactor(form): 优化代码 2024-01-09 14:50:25 +08:00
roymondchen
5c54f50365 refactor: button text prop 改成 link element-plus将废弃text 2024-01-08 17:49:41 +08:00
roymondchen
aa601f8703 fix(form): table全屏后zindex问题 2024-01-08 16:47:21 +08:00
roymondchen
81e3d0a18e feat(design,element-plus-adapter): 新增获取浮层zIndex的方法 2024-01-08 16:42:45 +08:00
roymondchen
eeb4566a69 style(form): table设置width 100% 2024-01-05 17:07:59 +08:00
marchyang
511acfdb5b Merge branch 'master' of git.woa.com:vft-magic/tmagic-editor 2024-01-05 14:39:11 +08:00
marchyang
ab5e31dfea feat: 输入文本含有空格时,弹窗提示 2024-01-05 14:35:42 +08:00
roymondchen
acab44aaa4 fix(utils): <=条件编译出错 2024-01-04 17:00:58 +08:00
roymondchen
5a5288c9da build(util): umd版本将lodash-es打进去 2024-01-03 16:32:44 +08:00
roymondchen
3c167f3b54 chore: release v1.3.9 2024-01-03 14:49:19 +08:00
roymondchen
783f7c3fc1 fix(stage): 组件添加粗一点的边框后resize操作 选中样式没有和组件本身对齐
fix #562
2024-01-03 14:45:25 +08:00
roymondchen
310c1c21ce chore(form): table新增一个根节点 2024-01-02 20:59:09 +08:00
roymondchen
d3777b236d feat(data-source,utils,runtime): 数据源setData支持指定路径 2024-01-02 20:57:37 +08:00
marchyang
6b4bfae30b feat: 代码编辑器支持emmet插件 --story=115432867 2023-12-28 07:23:03 +00:00
roymondchen
23269625e1 fix(editor): 上下移一层溢出
fix #563
2023-12-27 19:57:33 +08:00
roymondchen
320420478c fix(stage): 有margin的组件拖动大小时top偏移
re #559
2023-12-22 14:31:53 +08:00
roymondchen
1073204858 chore: release v1.3.8 2023-12-21 19:49:08 +08:00
roymondchen
fbe1d88d27 feat(editor,form): 新增属性配置表单error事件
re #557
2023-12-21 16:30:31 +08:00
parisma
d981014160 feat(editor,dep): watcher新增方法:清除指定类型的依赖 2023-12-21 07:38:58 +00:00
parisma
2dc810a9fd feat(editor,ui): 页面片下拉选择框支持点击跳转编辑,修改页面片组件initvalue 2023-12-21 07:38:58 +00:00
moonszhang
2dcef449bf feat(form): table 增加 beforeAddRow 钩子函数校验是否可增加行 2023-12-20 07:44:16 +00:00
roymondchen
7c90b9339d feat(editor): 新增page-bar slot 2023-12-20 15:08:24 +08:00
roymondchen
f9cf6fa500 style(editor): tree empty 样式调整 2023-12-20 15:05:20 +08:00
roymondchen
bd8bbc6154 feat(editor): data-source-service支持扩展 2023-12-20 14:59:58 +08:00
roymondchen
e385ed5d34 chore: release v1.3.7 2023-12-19 14:55:18 +08:00
roymondchen
41a3b8c7c7 feat(editor): 右键菜单兼容页面片 2023-12-19 14:50:54 +08:00
roymondchen
7b6dcedfad feat(core,editor,ui): 新增页面片 2023-12-19 06:39:03 +00:00
roymondchen
698c3451ff feat(editor): 新增自定义右键菜单函数配置 2023-12-18 20:37:10 +08:00
roymondchen
4ec0b69a8d fix(form): table全屏后蒙层在最上一层 2023-12-18 20:18:46 +08:00
roymondchen
86bdb9f099 feat(data-source): 支持在指定js环境下不执行init的配置 2023-12-18 17:27:37 +08:00
roymondchen
2a5b9ec6bd feat(editor, stage): 新增禁用多选的props 2023-12-18 15:00:26 +08:00
roymondchen
09fe6d29e2 chore(editor): 修改拼写错误 2023-12-18 14:17:04 +08:00
roymondchen
538f96c082 feat(playground): 完善form editor 2023-12-15 20:05:29 +08:00
roymondchen
b72e487b58 chore: 使用on-before-unmount替换on-unmouted 2023-12-15 16:20:50 +08:00
roymondchen
f212be136e feat(editor,stage): 新增标尺配置props
re #558
2023-12-15 14:32:32 +08:00
roymondchen
7305f878f3 feat(editor, stage): 初始化加载runtime loading 2023-12-15 14:09:44 +08:00
roymondchen
978391fe90 chore: 修改发布脚本,使用pnpm发布 2023-12-12 19:54:49 +08:00
roymondchen
04a72da06c Revert "chore: 去掉pnpm的限制"
This reverts commit 25a0604073b55bbf72dee32d739d70e307c614f0.
2023-12-12 19:31:19 +08:00
roymondchen
a2ee21faba chore: release v1.3.6 2023-12-12 16:10:17 +08:00
roymondchen
25a0604073 chore: 去掉pnpm的限制 2023-12-12 16:08:10 +08:00
roymondchen
268ec4c27a feat(editor): 修改code-block-list code-block-panel-tool slot data 2023-12-12 15:46:08 +08:00
roymondchen
cf72039ff1 feat(playground): 新增表单编辑器 2023-12-12 15:17:28 +08:00
roymondchen
ba2f1e5ac5 feat(stage, editor): runtime支持直接渲染模式不用iframe 2023-12-12 15:09:33 +08:00
moonszhang
0c994f1e23 fix(table): 修复element table tooltip position 默认使用 fixed 定位导致气泡偏移的问题 2023-12-12 11:02:38 +08:00
roymondchen
a9d794dc19 feat(editor): propsService.setNewItemId新增force参数 2023-12-11 20:19:17 +08:00
parisma
456692ff8a fix(editor): 有复制的内容时展示粘贴菜单 2023-12-11 11:57:46 +00:00
roymondchen
fc89d4cbe8 chore: 更新vite@5.0.7 2023-12-11 11:29:06 +08:00
roymondchen
25a8456312 chore: 更新element-plus版本 2023-12-08 19:54:29 +08:00
roymondchen
fe26ac5ffc fix(editor): 新增数据源方法不会收集依赖 2023-12-08 19:49:09 +08:00
roymondchen
cc202d79f9 fix(form): cascader options不会自动更新 2023-12-08 19:48:10 +08:00
roymondchen
70f2b11df5 fix(dep): get-tagert需要指定type 2023-12-08 19:47:12 +08:00
roymondchen
e50e332818 feat(editor): 可选组件按钮只有在可选组件长度大于3时才显示 2023-12-08 17:27:19 +08:00
roymondchen
741140fa71 refactor(editor): 代码编辑、数据源重构 2023-12-08 17:20:43 +08:00
roymondchen
258d2bc2ea feat(editor,stage): 优化可选组件交互 2023-12-07 19:40:40 +08:00
roymondchen
5c6a3455b0 feat(editor): service扩展支持设置成同步的 2023-12-06 15:28:18 +08:00
roymondchen
75dd89f2fe fix(data-source,utils): 显示条件编译对于undefined理解不正确 2023-12-04 20:35:03 +08:00
roymondchen
4870babc43 chore: release v1.3.5 2023-12-01 15:30:58 +08:00
roymondchen
78762b920e fix(data-source): 数据源初始化 2023-12-01 15:26:36 +08:00
roymondchen
7f9c4f3855 chore: release v1.3.4 2023-11-28 19:47:15 +08:00
roymondchen
6299d286ba feat(editor): 数据源数据定义快速添加支持与已有数据合并 2023-11-28 19:32:12 +08:00
roymondchen
141e1c7130 feat(editor): http数据源请求体配置支持写json 2023-11-28 17:12:12 +08:00
roymondchen
f8125aa149 feat(stage): 支持配置对齐元素 2023-11-28 16:19:00 +08:00
roymondchen
eb43deb9f5 feat(editor): 画布大小支持配置百分比 2023-11-27 16:55:23 +08:00
roymondchen
b0fcafd089 fix(editor): 从组件树中拖入画布新增的情况如果初始position为fixed不改变布局 2023-11-23 15:47:09 +08:00
roymondchen
33c8f8bf5a fix(util): 条件编译对应is与not实现对应value为false的情况出错 2023-11-23 14:51:52 +08:00
roymondchen
4bbde1a5f6 chore: 去掉调试log 2023-11-23 14:49:52 +08:00
roymondchen
c9aab11e03 fix(editor): 修改根节点不添加历史记录 2023-11-22 15:46:00 +08:00
roymondchen
19d24f4089 chore: release v1.3.3 2023-11-21 20:40:30 +08:00
roymondchen
8765cf10f6 style(schema): 完善request-function定义 2023-11-21 19:30:45 +08:00
roymondchen
f305f0a93e style(editor): DepTargetType是枚举类型,不能用type修饰 2023-11-21 19:29:45 +08:00
roymondchen
5547eb4ee8 fix(dep): 数据源依赖收集 2023-11-21 19:17:53 +08:00
roymondchen
5549e8cff9 feat(data-sources): http数据裁剪函数content参数添加options 2023-11-21 19:14:45 +08:00
roymondchen
979d6e2e31 chore: release v1.3.2 2023-11-21 14:13:26 +08:00
roymondchen
e35a963b67 fix(editor): 更新dsl,组件树列表不更新
fix #554
2023-11-21 14:05:43 +08:00
roymondchen
ad008b66b4 style(form): 完善filterFunction类型定义 2023-11-21 11:37:38 +08:00
roymondchen
ab02c2f3ee feat(editor): dataSourceService.add返回添加的数据源 2023-11-21 11:35:53 +08:00
roymondchen
eea8032f0d fix(dep): 数据源依赖收集不收集单独的id,因为id不需要编译 2023-11-21 11:34:33 +08:00
roymondchen
cdba8aeaf2 feat(editor): 数据源选择器支持选择数据源id 2023-11-21 11:32:59 +08:00
moonszhang
c80ea829ac fix(editor): 修复slide 全部拖出来再关闭回去时不展示slide操作栏的问题 2023-11-17 03:05:35 +00:00
roymondchen
fded26251f fix(editor): 不允许容器节点拖动到自己里面
fix #553
2023-11-16 20:01:23 +08:00
roymondchen
2e6d8afb93 feat(data-source): 新增指定数据源的字符串模板编译 2023-11-16 19:54:21 +08:00
roymondchen
94641bad76 refactor: 依赖收集相关代码抽出独立成库 2023-11-16 19:34:50 +08:00
moonszhang
2b10e7eda9 feat(editor): 支持 slide 侧边栏可拖拽悬浮 2023-11-16 11:00:05 +00:00
roymondchen
9098504e5f chore: release v1.3.1 2023-11-15 15:34:37 +08:00
roymondchen
ffd8130269 feat(data-source): 数据源支持ssr 2023-11-15 15:27:23 +08:00
roymondchen
ce0c941bf1 fix(editor): 在组件树将组件拖入不同布局的容器内,需要改变其布局
fix #552
2023-11-13 20:01:32 +08:00
roymondchen
7f6ba9de99 fix(stage): 设置margin后拖动位置出现漂移
fix #549
2023-11-13 19:43:17 +08:00
roymondchen
3b789f4d13 fix(stage): 当页面大小小于画布时,组件又处于画布边缘,moveable边框会超出画布,导致获取到画布外的元素
fix #546
2023-11-13 16:22:13 +08:00
roymondchen
436fb3f5aa feat(core): 将事件响应中的剩余事件参数传入到配置的代码块与数据源方法中
re #551
2023-11-13 14:34:10 +08:00
roymondchen
8dcff6b731 chore(editor): 删除调试信息 2023-11-08 17:35:24 +08:00
roymondchen
fb7bac8bfd chore: release v1.3.0 2023-11-06 16:36:38 +08:00
roymondchen
f0f94d4fcc fix(editor): model-value变化后需要重新生成依赖后再通知runtime更新 2023-11-06 16:33:30 +08:00
roymondchen
7a228b13e6 fix(stage): 隐藏标尺后再显示标尺,拖出来的线没有吸附作用
fix #548
2023-11-06 14:16:16 +08:00
roymondchen
168ec281aa fix(core): 设置page时查找原page兼容数字id情况
fix #547
2023-11-06 11:35:44 +08:00
roymondchen
6fda0e6e44 chore: release v1.3.0-beta.8 2023-11-03 19:34:23 +08:00
roymondchen
4e6b1fe6aa chore: release改成cjs后缀 2023-11-03 19:32:41 +08:00
roymondchen
263533f09a feat(editor): 缓存可选组件菜单置于顶层状态 2023-11-03 19:27:39 +08:00
roymondchen
1c3f8abaf4 fix(editor): 画布区域不允许宽度为0 2023-11-03 16:40:46 +08:00
roymondchen
2d5b7726ef fix(editor): 数据源列表中依赖的key会重复出现 2023-11-03 14:58:19 +08:00
roymondchen
801399777b chore: eslintrc改成cjs后缀 2023-11-03 14:52:02 +08:00
roymondchen
ae0b206c4c docs: 补充数据源相关props 2023-11-02 17:07:06 +08:00
roymondchen
5880dfbe15 chore: release v1.3.0-beta.7 2023-11-01 15:22:12 +08:00
roymondchen
480d013994 feat(editor): 新增组件树、数据源slots 2023-11-01 15:17:52 +08:00
roymondchen
5021c746fc fix(editor): 不允许拖动的节点不允许被拖入
fix #544
2023-11-01 14:13:15 +08:00
roymondchen
905f34ae24 refactor(form): lodash-es import问题 2023-11-01 14:07:37 +08:00
roymondchen
7d251f04e8 refactor(editor): 新增tree组件 2023-11-01 14:06:04 +08:00
roymondchen
8d8c8df82f chore: release v1.3.0-beta.6 2023-10-31 15:34:51 +08:00
roymondchen
f48afa98f2 feat(editor, data-source): 支持http数据源请求、响应裁剪配置 2023-10-31 15:29:04 +08:00
roymondchen
cb2ff28129 fix(editor): 数据源参数、请求头、请求体无法删除
fix #543
2023-10-31 14:28:10 +08:00
roymondchen
1876ccb377 build(playground): dev playgournd时项目启动时runtime加载失败
re #539
2023-10-31 14:14:46 +08:00
roymondchen
7d1bd60ea8 build: package.json中添加exports.types
re #541
2023-10-30 20:00:27 +08:00
roymondchen
58951caa2f docs: 联动原理文档中错别字
fix #540
2023-10-30 19:51:47 +08:00
roymondchen
8d8b30441b build(playground): dev playgournd时项目启动时runtime加载失败
plaground项目启动完后runtime项目还未启动完成,导致自动打开时runtime加载失败

fix #539
2023-10-30 19:48:45 +08:00
roymondchen
b9a7d002f1 chore: release v1.3.0-beta.5 2023-10-24 16:08:54 +08:00
roymondchen
808c82f193 fix(utils): 完善生成数据源默认值 2023-10-24 16:06:07 +08:00
roymondchen
257c8c9fa1 fix(editor): 组件树注册快捷方式 2023-10-24 15:52:01 +08:00
roymondchen
af72d819fe fix(editor): 组件树多选后右键点击不会变回单选 2023-10-24 15:41:54 +08:00
roymondchen
5e7a0a0c53 fix(editor): 粘贴容器,组件树中子组件没有显示 2023-10-24 15:35:27 +08:00
roymondchen
6a5374726e feat(editor): 组件列表支持设置tooltip显示详情 2023-10-24 14:58:37 +08:00
roymondchen
2e5b5665ce style(editor): 组件树节点名称不换行 2023-10-24 14:08:21 +08:00
roymondchen
2d5afb1646 style(editor): 事件配置样式调整 2023-10-23 20:49:04 +08:00
roymondchen
5a345575c4 refactor(editor): ui-slect事件名使用常量 2023-10-23 19:54:26 +08:00
roymondchen
6cfcbdb76e chore: release v1.3.0-beta.4 2023-10-23 16:12:22 +08:00
roymondchen
359806da96 fix(data-source): http数据源参数透传入base 2023-10-23 16:10:18 +08:00
roymondchen
bfb30923e1 chore: release v1.3.0-beta.3 2023-10-23 11:20:38 +08:00
roymondchen
bd9686dbd8 fix(form): table分页lastData初始化异常 2023-10-23 11:14:36 +08:00
roymondchen
1c516bb24b refactor(editor): 优化性能,组件树重写,不再使用el-tree 2023-10-20 19:32:11 +08:00
roymondchen
d3171f4c69 feat(editor): 搜索防抖 2023-10-20 16:56:06 +08:00
roymondchen
04025682d5 refactor(stage): node-list转成数组使用array.from 2023-10-20 16:52:42 +08:00
roymondchen
921867f650 style(form): 优化表格功能按钮显示 2023-10-18 11:20:02 +08:00
roymondchen
70b6bcd66b style(editor): 优化显示条件展示 2023-10-18 11:18:44 +08:00
roymondchen
c25be06441 fix(editor): data-source-field-select出现两个label 2023-10-18 10:59:13 +08:00
roymondchen
ed3c3d60ce feat(form): cascader支持check-strictly/emit-path配置 2023-10-17 20:22:52 +08:00
roymondchen
e4613ba053 feat(editor,data-source): 组件配置支持关联数据源字段 2023-10-17 20:21:18 +08:00
roymondchen
83ab94fcad feat(data-source,editor,schema): 数据源mock新增在编辑器中使用的配置 2023-10-17 17:05:36 +08:00
roymondchen
588ec68b21 feat(editor): 事件关联数据源方法支持预置 2023-10-07 20:10:50 +08:00
roymondchen
803bf323ce refactor(editor): editor组件改成setup 2023-10-07 17:01:33 +08:00
roymondchen
65854d9c0a test(data-source,utils): 生成默认值函数放到utils库中 2023-10-02 17:14:14 +08:00
roymondchen
9072642f22 feat(runtime): 支持数据源mock 2023-10-02 17:11:32 +08:00
roymondchen
4c46a4e575 feat(core,data-source): 数据源支持mock 2023-10-02 17:10:15 +08:00
roymondchen
56dfacbaaa feat(editor): 支持通过json快速配置数据源字段 2023-10-02 16:30:34 +08:00
roymondchen
163f630959 refactor(data-source,utils): 生成默认值函数放到utils库中 2023-10-02 16:28:53 +08:00
roymondchen
d4a8b89e6f feat(editor,schema): 支持配置数据源mock 2023-10-01 17:44:27 +08:00
roymondchen
2b2a9c6706 feat(cli): 新增datasoucreSuperClass配置 2023-10-01 12:18:15 +08:00
roymondchen
1ce6411e05 fix(editor): 右键菜单消失子菜单可能不会跟着消失 2023-09-26 15:57:00 +08:00
roymondchen
a22e59e2bd chore: playground调试启用严格访问模式 2023-09-21 14:10:29 +08:00
roymondchen
355c2f983f chore: release v1.3.0-beta.2 2023-09-21 11:06:44 +08:00
roymondchen
8b7a1e4e3c feat(editor): 数据源事件配置 2023-09-21 10:58:39 +08:00
roymondchen
36988cd3e0 fix(data-source): 组件配置与条件关联了不同数据源时,编译问题 2023-09-20 19:11:03 +08:00
roymondchen
740c2a73fa style(editor): 悬停组件菜单样式优化 2023-09-20 15:36:48 +08:00
roymondchen
5a25899b57 fix(editor,stage): 优化悬停出现组件列表的交互体验 2023-09-20 14:46:57 +08:00
roymondchen
578af946b3 chore: release v1.3.0-beta.1 2023-09-19 19:46:21 +08:00
roymondchen
5840ee537f feat(editor,util): 完善数据源配置 2023-09-19 19:43:05 +08:00
roymondchen
28b3d2e4b3 feat(data-source): timing改成串行 2023-09-19 19:41:53 +08:00
roymondchen
1c6c9ab3e8 feat(editor,stage): 新增鼠标悬停在组件上显示当前位置下所有组件菜单 2023-09-19 17:39:36 +08:00
roymondchen
e9eb47308a chore: release v1.3.0-beta.0 2023-09-15 16:21:47 +08:00
roymondchen
436914e7ee feat(editor): 新增代码块编辑时查看修改 2023-09-15 16:18:13 +08:00
roymondchen
ac303405ef feat(form,editor): 代码块编辑后关闭新增确认弹窗 2023-09-15 15:08:09 +08:00
roymondchen
a9c5004f4d feat(design): drawer增加handleClose方法 2023-09-15 15:06:55 +08:00
roymondchen
75b0d9cdf3 fix(editor): 新增数据源时,设置初始值 2023-09-14 20:33:11 +08:00
roymondchen
7a617d4a17 fix(utils): 编译条件函数异常兼容 2023-09-14 20:28:05 +08:00
roymondchen
502e59cfd7 refactor(core,data-source,schema): 将AppCore定义移到schema中 2023-09-13 16:47:34 +08:00
roymondchen
ea1cae7968 feat(editor): 已选组件新增根节点右键菜单项:全部折叠 2023-09-11 15:57:21 +08:00
roymondchen
13ff7f8d8a chore: release v1.3.0-alpha.24 2023-09-07 19:04:30 +08:00
roymondchen
3cd1ac1cc4 fix(editor): 代码变化时,参数表单需要重新渲染 2023-09-07 19:01:01 +08:00
roymondchen
7bf59929b0 feat(form): form-dialog,form-drawer新增inline,label-position配置 2023-09-06 16:59:22 +08:00
roymondchen
2bd1033665 docs: 删除失效描述 2023-09-06 16:30:04 +08:00
teeniechen
a0a2242341 feat(form): 时间容器增加每日周期显示 2023-09-06 06:45:57 +00:00
teeniechen
17ff5c38f3 Revert "feat(form): 时间容器支持设置多个时间段以及设置每日周期"
This reverts commit c94cde293181712e602f24903c755afa3dca41a2.
2023-09-05 05:05:30 +00:00
teeniechen
c94cde2931 feat(form): 时间容器支持设置多个时间段以及设置每日周期 2023-09-04 06:07:15 +00:00
roymondchen
e3bffde883 chore: release v1.3.0-alpha.23 2023-08-31 16:40:52 +08:00
roymondchen
eacb1e6475 refactor(editor): sidebar不使用tmagic-design tabs 2023-08-31 16:36:17 +08:00
roymondchen
a8eea1a73b fix(core): node销毁后重新渲染再销毁不会触发destroy事件 2023-08-31 15:47:04 +08:00
roymondchen
cda3b04b85 fix(editor): 当组件设置的bottom/right是,上下左右快捷键失效 2023-08-31 15:29:27 +08:00
teeniechen
2ccf47f7dd feat(editor): fixed布局水平居中处理 2023-08-31 06:54:21 +00:00
roymondchen
372c36893d chore: release v1.3.0-alpha.22 2023-08-29 19:02:06 +08:00
roymondchen
7b2fd6ebd4 fix(editor): datasource自动补全用鼠标操作出错 2023-08-29 18:56:02 +08:00
roymondchen
f9ba8b8df5 fix(editor): 新增数据源字段受上一次新增数据影响 2023-08-29 18:47:11 +08:00
roymondchen
cd50d36394 chore(data-source): 单独定义Core,避免循环引用 2023-08-29 18:37:15 +08:00
roymondchen
2bd86d2101 feat(editor): 新增数据源时先选类型 2023-08-29 18:24:15 +08:00
roymondchen
c5a1c2db76 feat(data-source): 数据源中新增app属性,http数据源新增钩子 2023-08-29 17:12:34 +08:00
roymondchen
0865cf4952 fix(cli): packages设置npm包初始化报错 2023-08-29 16:53:29 +08:00
roymondchen
131ec6fff3 style(data-source): 去掉any 2023-08-25 17:44:57 +08:00
roymondchen
7f48b4d9f5 chore(core,data-source): 将app传入datasourceManager 2023-08-25 17:39:37 +08:00
roymondchen
8c93d9a5be chore: release v1.3.0-alpha.21 2023-08-25 11:53:01 +08:00
roymondchen
5c9fd9a0f4 feat(table): action新增tooltip配置 2023-08-25 11:45:57 +08:00
roymondchen
54ec6de4f2 feat(editor): 组件列表中的tooltip改成title 2023-08-25 11:40:01 +08:00
roymondchen
bd6fae9aed feat(table): 新增支持配置组件 2023-08-25 11:37:34 +08:00
roymondchen
644fa4f7c0 chore: release v1.3.0-alpha.20 2023-08-24 15:24:02 +08:00
roymondchen
5319afa563 chore(editor): export getDisplayField 方法 2023-08-24 15:18:32 +08:00
roymondchen
5de5fc933a chore(stage): 优化高亮性能 2023-08-21 19:39:14 +08:00
roymondchen
0274c36afd Revert "chore(stage): 优化高亮与单选性能"
This reverts commit babaadb0cf87829197dbfa820f0141aefea48076.
2023-08-21 19:38:19 +08:00
roymondchen
573f1a2c17 feat(cli,data-source,editor,playground,runtime): 支持自定义数据源 2023-08-21 16:57:18 +08:00
roymondchen
60e14fe53e chore(data-source): 将manager中dataSourceClassMap设置为私有 2023-08-18 15:59:54 +08:00
roymondchen
3f833d41f3 fix(editor): 置顶计算错误 2023-08-15 16:21:46 +08:00
roymondchen
ec8e8a17d2 feat(editor): 历史记录最多存储20条 2023-08-15 16:15:10 +08:00
roymondchen
ccd6fd2be3 chore: 删除无用log 2023-08-15 16:13:53 +08:00
roymondchen
2b07a6de2d feat(form): date,date-time值默认的日期格式改成/,以兼容ios 2023-08-14 14:43:03 +08:00
roymondchen
07a02714df fix(editor): 数据源字符串模板提示出错
fix #530
2023-08-14 14:34:15 +08:00
roymondchen
babaadb0cf chore(stage): 优化高亮与单选性能 2023-08-11 20:23:23 +08:00
roymondchen
df236d172d chore: release v1.3.0-alpha.19 2023-08-10 17:20:17 +08:00
roymondchen
07c49bee4e feat(editor,data-source): 支持数据源方法配置执行时机 2023-08-10 16:04:12 +08:00
roymondchen
e3b2594c57 fix(stage): 拖动出现left -1 2023-08-10 15:02:17 +08:00
roymondchen
d8a2a1f805 chore(editor): 将hooks放到同一个文件夹中 2023-08-09 19:22:42 +08:00
roymondchen
a8f8f488ad fix(cli): 组件配置json key支持使用字符串常量 2023-08-09 16:09:26 +08:00
roymondchen
5927b394a7 chore: release v1.3.0-alpha.18 2023-08-09 15:37:33 +08:00
roymondchen
b1ea4cebad fix(cli): npm包会被转成相对路径 2023-08-09 15:29:58 +08:00
roymondchen
4c9ef87975 fix(stage,playground): moveableOptions对多选无效
fix #529
2023-08-08 20:58:22 +08:00
roymondchen
dacec716bc chore: release v1.3.0-alpha.17 2023-08-08 17:22:50 +08:00
roymondchen
aabc77d903 fix(form): group-list上移下移行为不对 2023-08-08 16:34:23 +08:00
roymondchen
26cd37be23 feat(form): text配置支持函数 2023-08-08 16:20:56 +08:00
roymondchen
63d8c98822 feat(design): input支持textarea rows 2023-08-08 16:14:36 +08:00
roymondchen
44efb3a967 chore(form,editor): 代码块编辑中按esc不会退出 2023-08-04 20:02:51 +08:00
roymondchen
f9dc628ef4 fix(editor): diff code editor中全屏按钮点击无效 2023-08-04 20:00:14 +08:00
roymondchen
cc195d2f5f chore: 更新依赖 2023-08-04 19:58:54 +08:00
roymondchen
92df80e711 feat(core,data-source,ui,ui-react,ui-vue2,utils,runtime): 解析显示条件配置 2023-08-04 19:50:44 +08:00
roymondchen
c389c614d7 style(editor,form): 统一表单组件props定义 2023-08-04 16:39:46 +08:00
roymondchen
46f6aeaaf7 feat(utils): 新增isObject 2023-08-04 15:59:18 +08:00
roymondchen
5887977e45 feat(form): 新增数字范围控件 2023-08-04 15:54:55 +08:00
roymondchen
35862078b3 feat(editor,schema): 支持组件显示条件配置 2023-08-04 15:52:55 +08:00
roymondchen
0d3cd11ade fix(editor): 使用画布上的删除按钮删除组件时依赖没有清空 2023-08-02 20:13:05 +08:00
roymondchen
2f28252c64 chore: release v1.3.0-alpha.16 2023-08-02 17:37:21 +08:00
roymondchen
b424abd17a fix(editor): 删除组件后,依赖清除出现可能出现大量重复循环 2023-08-02 17:23:29 +08:00
roymondchen
d79c9686e5 style(stage): 调整拖动图标 2023-07-27 14:42:33 +08:00
roymondchen
ded82aae41 fix(form): dialog,drawer disable时确认按钮置灰 2023-07-27 14:22:24 +08:00
roymondchen
90205f5395 feat(editor): 新增拖动按钮 2023-07-26 17:29:47 +08:00
roymondchen
1f6ae515f3 chore: release v1.3.0-alpha.15 2023-07-24 20:10:24 +08:00
roymondchen
23bee0b3ae fix(editor): 代码块节点slot参数丢失 2023-07-24 20:07:24 +08:00
roymondchen
ce6d2684b7 fix(editor): 流式布局下通过组件树拖动layout判断不正确 2023-07-21 19:36:51 +08:00
roymondchen
5e316e4d54 docs: 完善编辑器扩展文档 2023-07-21 17:06:46 +08:00
roymondchen
434e163626 chore: release v1.3.0-alpha.14 2023-07-19 19:18:51 +08:00
roymondchen
eccc27e91a chore: 更新vite 2023-07-19 19:16:30 +08:00
roymondchen
e577628852 style(editor): 代码块编辑中代码编辑器高度自动设置保持表单不出现滚动条 2023-07-19 14:57:26 +08:00
roymondchen
2a0680c707 feat(core,editor,data-source,form,schema): 新增数据源方法配置,支持事件联动数据源方法 2023-07-18 19:35:54 +08:00
roymondchen
1a546c326c fix(editor): 修复CodeSelectColConfig interface找不到问题
fix #525
2023-07-18 15:58:01 +08:00
roymondchen
fa2862090f chore(editor): 重构代码块编辑表单 2023-07-14 20:01:15 +08:00
roymondchen
0a9c7c9dda feat(editor): 代码块参数注释改用extra来显示 2023-07-14 16:38:22 +08:00
roymondchen
21f445dc13 chore: release v1.3.0-alpha.13 2023-07-10 17:10:54 +08:00
roymondchen
8e82d38bbb feat(editor): 代码块删除新增确认 2023-07-10 17:08:29 +08:00
roymondchen
6ddac803a2 style(editor): 完善codeBlock.setCodeDslById ts定义 2023-07-07 17:12:56 +08:00
roymondchen
07cd3065b2 feat(editor): 组件选择器点击已选择组件由重新选择改成选择组件 2023-07-07 17:10:51 +08:00
roymondchen
ee3ad63aa3 feat(stage): 新增清除高亮方法 2023-07-07 16:40:34 +08:00
roymondchen
476b1d4ecb chore: release v1.3.0-alpha.12 2023-07-07 15:04:51 +08:00
roymondchen
565881c8c9 fix(editor): 组件拖入画布出错
fix #524
2023-07-07 14:33:31 +08:00
roymondchen
a19fd5450a chore: release v1.3.0-alpha.11 2023-07-06 19:41:08 +08:00
roymondchen
0d7893c4a4 chore: release v1.3.0-alpha.10 2023-07-06 16:42:24 +08:00
roymondchen
c9b9e76514 fix(design): tDesign form 使用reset
fix #522
2023-07-06 16:31:36 +08:00
roymondchen
17101687bf feat(stage): feat(stage): 新增获取moveable配置的方法
re #521
2023-07-06 16:29:42 +08:00
roymondchen
9d24069dcd feat(editor): 点击画布区域聚焦,使得能使用画布的快捷键 2023-07-06 15:37:43 +08:00
roymondchen
fd53170e59 feat(editor,form): 添加属性配置表单formState扩展函数prop 2023-07-06 14:25:59 +08:00
roymondchen
24bb45e2b9 feat(cli): 生成的entry文件里面的import使用相对路径 2023-07-05 15:24:06 +08:00
roymondchen
bb682cb2d7 build(runtime): vue2、react runtime build:libs失败 2023-07-05 15:01:02 +08:00
roymondchen
bbbc982be1 style(editor): 拖动改变工作区左右边栏大小时不要出现滚动条 2023-07-05 14:23:25 +08:00
roymondchen
434bf2ed70 feat(editor): 新增右键菜单移动至其他页面功能 2023-07-05 14:14:53 +08:00
roymondchen
b0f2ed55f6 chore: release v1.3.0-alpha.9 2023-07-03 15:01:25 +08:00
roymondchen
2d4a6aa22a fix(editor): code-editor组件json类型序列化出错 2023-07-03 14:57:31 +08:00
roymondchen
5b3c700f00 fix(editor): 代码编辑器只有在内容发生变化时才触发保存 2023-06-30 19:56:46 +08:00
roymondchen
42b043670e feat(editor,ui): 新增显示隐藏组件功能
re #516
2023-06-30 19:43:46 +08:00
roymondchen
47c26ed189 fix(core): 一个组件配置多个相同的事件销毁后没有能成功移除事件绑定 2023-06-30 19:40:47 +08:00
roymondchen
d8d9184f3f fix(editor): 组件树上的节点拖动画布中出错,应该不响应
fix #519
2023-06-30 17:21:20 +08:00
roymondchen
d480a03369 fix(editor): 添加代码块参数时出错 2023-06-28 16:42:08 +08:00
roymondchen
74c9deaa29 feat(editor, core): 支持直接绑定整个数据源对象 2023-06-28 16:39:47 +08:00
roymondchen
649720079a chore: release v1.3.0-alpha.8 2023-06-27 15:28:52 +08:00
roymondchen
fbf3896878 feat(editor): 导出Resizer组件 2023-06-27 15:25:24 +08:00
roymondchen
b952e6efd1 feat(editor,core): 数据源模板改成使用 ES 分隔符 2023-06-26 20:30:38 +08:00
roymondchen
c886a4bc40 chore(editor): 更新monaco-editor版本 2023-06-26 19:45:26 +08:00
roymondchen
4daf6b4410 feat(editor): 属性样式添加边框 2023-06-26 17:04:25 +08:00
roymondchen
1660e941d7 fix(editor): 组件树右键菜单支持多选 2023-06-26 16:57:11 +08:00
roymondchen
91e4680024 fix(editor): 没有页面时隐藏属性面板 2023-06-26 16:55:51 +08:00
roymondchen
9de04ddaa4 docs: 完善快速开始实例代码 2023-06-25 14:40:15 +08:00
roymondchen
591c4d05b2 chore: release v1.3.0-alpha.7 2023-06-19 14:55:29 +08:00
roymondchen
2b881c3863 feat(editor): 新增parseDSL配置,用于解析DSL,默认使用eval 2023-06-19 11:27:47 +08:00
roymondchen
1f5527270c fix(editor): 支持多层右键菜单 2023-06-16 20:24:51 +08:00
roymondchen
8ca6b3fbe4 fix(form): group-list默认展开 2023-06-16 17:51:59 +08:00
roymondchen
9716aceabf feat(editor): 完善快捷键注册机制 2023-06-16 17:39:50 +08:00
roymondchen
b37568b440 fix(editor): 异常处理 2023-06-13 17:39:31 +08:00
roymondchen
50b058c3c5 chore: release v1.3.0-alpha.6 2023-06-12 19:49:00 +08:00
roymondchen
da18842e42 feat(editor): 优化工作区间大小拖动体验 2023-06-12 19:34:34 +08:00
roymondchen
06d289aff3 feat(editor): 优化快捷键操作 2023-06-12 17:28:56 +08:00
roymondchen
567b054b32 fix(runtime): resetcss不生效 2023-06-08 19:20:34 +08:00
roymondchen
01d1dccbb6 feat(app,utils,runtime): 将resetcss.css移到utils,在runtime中引入 2023-06-08 17:44:06 +08:00
roymondchen
ed4b3c77ef fix(utils): 容器发生更新,需要编译子组建配置
fix #512
2023-06-08 15:36:55 +08:00
roymondchen
391fceef30 feat(ui): text使用p渲染 2023-06-08 14:30:43 +08:00
roymondchen
bdad1a41f9 chore: release v1.3.0-alpha.5 2023-06-06 19:15:57 +08:00
roymondchen
97101f18a6 feat(editor): 添加几个slot 2023-06-06 14:20:12 +08:00
roymondchen
39033ca6fb chore: release v1.3.0-alpha.4 2023-05-30 17:57:35 +08:00
roymondchen
256a9586d7 feat(editor): 事件配置默认展开全部 2023-05-30 17:54:47 +08:00
roymondchen
e83cf322b5 feat(editor): 代码块配置默认全部展开 2023-05-30 17:46:31 +08:00
roymondchen
9281d06723 feat(form): groupList新增默认展开所有的配置 2023-05-30 17:41:30 +08:00
roymondchen
05dfd9d936 fix(design): 默认props 2023-05-30 11:49:32 +08:00
roymondchen
4314e4adab chore: release v1.3.0-alpha.3 2023-05-30 11:44:24 +08:00
roymondchen
dad90a1cec style: 完善@tmagic/design ts 类型 2023-05-29 21:09:26 +08:00
roymondchen
011496fcd8 chore: 更新至vue3.3.4 2023-05-29 17:37:34 +08:00
roymondchen
668991de26 fix(editor): 数据源模板输入框初始化显示问题 2023-05-29 14:27:05 +08:00
roymondchen
aac478eebc feat: 新增数据源 2023-05-29 11:33:44 +08:00
roymondchen
d0ec2fd588 chore(form): fields组件计算lastValues props 2023-05-16 16:44:26 +08:00
roymondchen
a97523e800 fix(design): button 判断默认slot 2023-05-16 16:36:17 +08:00
roymondchen
24604c9d36 feat: 完善tdesign-vue-next适配 2023-05-04 15:42:27 +08:00
roymondchen
e4079d1e60 chore: release v1.2.15 2023-04-26 11:23:28 +08:00
roymondchen
982cc4685e fix(form): fieldset初始化时就触发了change事件 2023-04-26 11:17:48 +08:00
roymondchen
ea4af425f3 feat: 完善tdesign-vue-next适配 2023-04-25 21:03:52 +08:00
roymondchen
26835f6a29 feat(table): action hook配置加入index参数 2023-04-25 11:38:36 +08:00
roymondchen
af393e34fb feat(form): select支持clearable,filterable配置 2023-04-25 11:37:01 +08:00
roymondchen
315e83da19 fix(ui): model prop设置成可选 2023-04-25 11:33:52 +08:00
roymondchen
0295d6f4b5 feat(util): guid方法 2023-04-25 11:32:33 +08:00
roymondchen
e5c13e9e76 style(editor): 将code-block样式抽离成dep-list统一样式 2023-04-25 11:31:09 +08:00
roymondchen
fded83ee0d fix(design): drawer v-model失效 2023-04-25 11:25:25 +08:00
roymondchen
bd0321fe2d chore: release v1.2.14 2023-04-20 16:32:50 +08:00
parisma
51dadabc2c feat(editor): 代码编辑交互优化
1、代码列表中代码块和组件区分不够清晰,查看按钮太靠边,开发模式下未对齐
2、代码编辑/查看弹窗希望可以点击蒙层或者esc键退出
3、代码块绑定到组件的地方和事件绑定UI统一
4、在代码绑定的地方需要支持查看或者编辑
Bug:
1、旧格式的事件联动删除到只剩最后一个时无法成功删除
2023-04-18 07:57:50 +00:00
olivedeng
abc6835786 style(editor): 编辑器左右边栏增加最小宽度 2023-04-18 07:53:44 +00:00
roymondchen
41cd22b17f feat(editor): 代码列表默认只展开第一层 2023-04-10 20:31:01 +08:00
roymondchen
befaf67ba7 feat(ui): 修改useApp实现,与ui-react中保持一致 2023-04-10 19:59:53 +08:00
roymondchen
abcac71826 fix(core): node events 为空时,应为空数组
fix #500
2023-04-10 16:50:13 +08:00
roymondchen
84e2cdf22d fix(playground,runtime): 设备切换时,重新设置root font size与ua
fix #501
2023-04-10 16:42:22 +08:00
roymondchen
3d9f38781a feat(core): 重新设置designWidth时,应该重新计算root font size 2023-04-10 16:40:20 +08:00
roymondchen
40adc77978 style(editor): 相对路径改成alias 2023-04-10 15:16:32 +08:00
roymondchen
a60e067d4e chore: 更新依赖版本
re #498
2023-04-10 14:49:18 +08:00
roymondchen
1b7d840e4d chore: release v1.2.13 2023-03-30 17:11:50 +08:00
roymondchen
8aa2ecd9c8 style(editor): 统一代码列表与其他列表的搜索框 2023-03-30 17:04:46 +08:00
roymondchen
1b5d3e564d feat(design,element-plus-adapter,tdesign-vue-next-adapter): 新增drawer 2023-03-30 17:03:16 +08:00
roymondchen
ffb99645d6 style(editor): 统一左边栏搜索样式 2023-03-30 16:30:04 +08:00
roymondchen
aa12779598 fix(editor): 代码块code-block-panel-tool slot data丢失 2023-03-30 16:13:23 +08:00
roymondchen
6340bcc04b chore: release v1.2.12 2023-03-30 14:25:41 +08:00
roymondchen
fb026a134f fix(core): style兼容hippy 2023-03-30 14:19:04 +08:00
roymondchen
44290b65ba fix(core): 没有设置curPage,默认取第一个page 2023-03-30 12:14:52 +08:00
roymondchen
74ce204489 chore: release v1.2.11 2023-03-30 11:21:22 +08:00
roymondchen
5eb3b0dcae chore(core): 页面变化时仅移除配置的事件 2023-03-29 16:34:20 +08:00
roymondchen
37045f7201 fix(form): table 移动列变成了交换 2023-03-29 15:44:08 +08:00
parisma
39468f3b95 feat(editor,form,core,schema): 事件支持触发代码块 2023-03-29 07:13:57 +00:00
roymondchen
cfd2a6eee3 feat(core,runtime): 删除App中pages,只留下当前page 2023-03-28 21:06:38 +08:00
roymondchen
0cac40eb31 fix(form): table可能出现两个extra 2023-03-28 17:29:42 +08:00
roymondchen
899991794b chore(editor): 拆分Editor.vue 2023-03-28 17:26:34 +08:00
roymondchen
3b6ca97f4c feat(edtior): 代码块使用依赖收集器改造 2023-03-27 19:09:47 +08:00
roymondchen
35f9a59f44 feat(editor): 新增依赖收集器 2023-03-27 19:07:56 +08:00
roymondchen
3b3fbb288d chore: release v1.2.10 2023-03-27 14:20:03 +08:00
parisma
54e2ce2c7e fix(form): 修复lastvalues漏传的问题 2023-03-27 13:01:07 +08:00
roymondchen
fa89af920c chore(editor): codeDsl由codeBlockService维护,不再从editorService中获取,删除editorService中相关api 2023-03-23 16:42:36 +08:00
roymondchen
36c4ffa02e fix(core): 非浏览器环境屏蔽相关代码 2023-03-22 19:28:53 +08:00
roymondchen
a4f32ef8dc docs: tmagic-tutorial仓库地址修改 2023-03-22 15:59:07 +08:00
roymondchen
cb99304993 chore: 将magic-admin迁移出
https://github.com/vft-magic/tmagic-admin
2023-03-22 15:47:46 +08:00
roymondchen
b9248498eb docs: 更新教程 2023-03-22 15:29:53 +08:00
roymondchen
b6652624e3 fix(runtime): vue playgound 中dsl更新没有同步到Core中 2023-03-15 15:32:56 +08:00
roymondchen
f1f100f952 feat(core): 新增节点操作方法 2023-03-15 15:06:58 +08:00
roymondchen
763038cc11 chore(cli): 导入工具函数 2023-03-14 21:28:35 +08:00
roymondchen
b16c1fa5fc chore: release v1.2.9 2023-03-13 15:18:01 +08:00
parisma
5d446f0ccf style: 修复动态tab样式问题 2023-03-10 13:31:47 +08:00
parisma
67428f606a fix: 修复动态tab渲染问题 2023-03-10 12:59:18 +08:00
Cap
ad293fcd31 docs: 组件联动部分vue示例代码修改 2023-03-09 15:58:58 +08:00
parisma
a8407503b9 fix: 解决codecc安全工单,更新了admin中对编辑器的一些用法 2023-03-06 11:09:17 +00:00
roymondchen
2a457c9553 chore: release v1.2.8 2023-03-06 16:41:58 +08:00
roymondchen
c025508cd7 fix(editor,ui,ui-vue2,ui-react): 页面配置更新后,蒙层无法显示
fix #472
2023-03-06 16:29:46 +08:00
roymondchen
449efcc56b feat(stage): 支持多选组件并将多个组件拖入指定容器中
fix #405
2023-03-06 15:19:43 +08:00
Capchen
e3af0b2914
docs: 组件开发和页面发布模块的文档修改 (#488)
* docs(docs): 组件开发和页面发布模块的文档修改

* docs(): 根据review建议,撤回有误解的修改[/]

* docs(): 回撤publish.md文件中的描述
2023-03-06 10:38:45 +08:00
roymondchen
219aa2b550 chore: 更新moveable版本 2023-03-02 20:53:45 +08:00
roymondchen
ece65e7460 chore: 更新element-plus版本 2023-03-02 20:46:35 +08:00
roymondchen
e0c0143970 fix(editor): 更新组件后,组件树选中状态被重置 2023-03-02 20:44:45 +08:00
roymondchen
b8cda53d6a fix(editor): 组件树切换选择组件可能触发多选 2023-03-02 20:14:39 +08:00
roymondchen
dc96720641 chore: release v1.2.7 2023-03-02 17:05:08 +08:00
roymondchen
c9bacb96cd feat(stage,editor): 增肌删除快捷按钮 2023-03-02 16:47:20 +08:00
roymondchen
b4bee9eb82 fix(stage): 选择父组件的able功能丢失 2023-03-02 15:45:21 +08:00
parisma
bf5844c72a docs: 增加表单对比文档说明 2023-03-01 09:25:05 +00:00
parisma
dd884b96ba docs: 添加关于代码块内容的文档 2023-03-01 09:25:05 +00:00
parisma
6610f30afd feat(form): 支持表单差异对比
1、支持表单差异对比
2、支持在tab统计差异数量
2023-03-01 09:22:32 +00:00
roymondchen
c41af9d01d feat(cli): cli返回app 2023-02-22 15:38:13 +08:00
roymondchen
62038c8c60 fix(design): element-plus@2.2.22开始scrollbar.wrap$改成wrapRef 2023-02-21 17:18:09 +08:00
roymondchen
174695b94c chore: release v1.2.6 2023-02-21 15:43:39 +08:00
roymondchen
8edf023a00 fix(form): select下拉列表分页不生效问题 2023-02-21 15:40:29 +08:00
roymondchen
fcb69b7743 chore: release v1.2.5 2023-02-17 15:58:59 +08:00
parisma
010918198a fix(editor): 修复优化性能引起的问题,支持回退撤销对代码关系的更新 2023-02-17 07:31:26 +00:00
roymondchen
8102aaeb12 chore: release v1.2.4 2023-02-17 14:24:14 +08:00
parisma
a013f35cd9 fix: 调整绑定关系结构,优化性能 2023-02-17 14:14:26 +08:00
roymondchen
6637fdc92b chore: release v1.2.3 2023-02-15 19:46:59 +08:00
roymondchen
4d0b4c3178 feat(form): select config.option.afterRequest添加postOptions 2023-02-15 19:35:47 +08:00
roymondchen
3501a69b2f docs: cascader链接不对 2023-02-15 14:27:29 +08:00
roymondchen
d06a874c3b feat(cli): 支持配置是否自动安装组件npm包,支持配置安装组件npm包后是否保持package.json不变 2023-02-14 17:16:15 +08:00
roymondchen
8369b2c22c docs(admin): rEADME中runtime构建描述错误
fix #479
2023-02-14 15:02:04 +08:00
roymondchen
8e870c835e chore(admin): 更新server package依赖版本 2023-02-10 15:09:27 +08:00
roymondchen
de4d77c1ec chore: 完善peerDependencies 2023-02-10 14:56:33 +08:00
roymondchen
ae5c627902 chore: release v1.2.2 2023-02-09 17:00:12 +08:00
roymondchen
aa566e9535 fix(editor): set root 可能没有items 2023-02-09 16:57:22 +08:00
roymondchen
89fa321088 chore: release v1.2.1 2023-02-09 16:32:02 +08:00
roymondchen
bf547fe1a0 feat(cli): export allowTs函数 2023-02-09 16:30:02 +08:00
parisma
0b537f5bff feat(editor,form,schema): 优化代码
Squash merge branch 'feature/parisma_881986193' into 'master'
1、扩展参数配置能力,支持参数类型定义,支持参数注释
2、修复代码块嵌套多层时绑定关系展示不正确的问题
3、支持在组件绑定位置编辑查看代码块
2023-02-09 08:15:37 +00:00
parisma
e42aee84bc chore(admin): 升级第三方依赖的间接依赖 2023-02-08 05:48:18 +00:00
parisma
a94f5d72e8 refactor: 更新管理端runtime 2023-02-07 10:54:56 +08:00
roymondchen
a6226cba18 fix(editor): 编辑器中间列宽度出现负值 2023-02-06 19:50:41 +08:00
roymondchen
b9d4e8c66c feat(util): 修改isPage函数定义 2023-02-06 19:27:57 +08:00
roymondchen
0491487385 feat(editor): 修改service get set 方法的ts定义,不再需要传入泛型参数 2023-02-06 19:25:37 +08:00
oceanzhu
23708e4644 chore: 更新版权年份 2023-01-04 16:11:51 +08:00
roymondchen
3b30d89956 fix(editor): 新增的组件如果没有初始化left值,会导致无法通过键盘方向键左右移动
fix #468
2022-12-30 16:33:38 +08:00
roymondchen
a41a5b3ad4 chore(admin): 使用dayjs替换moment 2022-12-30 15:46:52 +08:00
roymondchen
8fa1d4a5c3 feat(admin): 使用@tmagic/table重构活动列表 2022-12-30 15:37:12 +08:00
guankaishe
032ec81b86 chore: update readme
移除页尾多余的空行
2022-12-29 17:10:52 +08:00
guankaishe
f8be386c02 chore: 更新README
更新Readme,添加For PC Web的无极低代码链接
2022-12-29 17:10:52 +08:00
roymondchen
0f073e9441 chore(magic-admin): 更新tmagic 2022-12-22 11:27:49 +08:00
roymondchen
4ad66b27e8 docs: 去掉beta 2022-12-22 11:21:12 +08:00
roymondchen
b13aaeb0e9 chore: release v1.2.0 2022-12-22 11:14:59 +08:00
roymondchen
3934ebd030 refactor(editor): 优化组件树逻辑 2022-12-22 10:56:05 +08:00
kevinyzheng
87a19c9bae fix(editor): 代码块列表无法滚动 2022-12-21 18:19:52 +08:00
roymondchen
9b324d17cc chore: release v1.2.0-beta.27 2022-12-13 19:02:00 +08:00
roymondchen
cfc57f17af fix(editor): 组件销毁时移除service的时间监听 2022-12-13 15:32:13 +08:00
roymondchen
841b75eef1 docs: 添加editor disabledDragStart props 2022-12-12 17:07:45 +08:00
roymondchen
ac11fc5926 chore: release v1.2.0-beta.26 2022-12-12 16:59:39 +08:00
roymondchen
dd8ac99d5d feat(stage,editor): 添加disabledDragStart配置,用于关闭按下鼠标并拖动功能 2022-12-12 16:56:08 +08:00
roymondchen
c3888bedf2 feat(tdesign-vue-next-adapter): 新增tdesign设配器 2022-12-09 20:16:59 +08:00
roymondchen
c3a57a2bea chore(form): 调整size声明 2022-12-09 20:01:05 +08:00
roymondchen
649c80b0ff style(editor): 适配tdesign 2022-12-09 19:59:54 +08:00
roymondchen
ffb84cffca feat(design): 添加class 2022-12-09 19:58:10 +08:00
roymondchen
7c823022ae build(playground): playground 增加element-plus 按需加载
fix #438
2022-12-08 19:43:38 +08:00
roymondchen
d051aeb155 chore: 去掉eslint prettier warning 2022-12-08 17:17:13 +08:00
roymondchen
a40db172bb docs: 完善service api 2022-12-08 16:13:33 +08:00
roymondchen
3dcdc04127 fix(editor): 粘贴的组件为当前选中组件的副本时,则添加到当前选中组件的父组件中
re #448
2022-12-08 12:50:09 +08:00
roymondchen
9dec40805c chore: release v1.2.0-beta.25 2022-12-07 20:08:02 +08:00
roymondchen
138614a57a fix(cli): 异步组件返回应该是个函数 2022-12-07 19:59:00 +08:00
roymondchen
ba20eb8cf1 fix(playground): 加载组件表单配置资源失败 2022-12-07 18:57:30 +08:00
roymondchen
ccb4e675ab fix(cli): 插件不支持ts的问题 2022-12-07 18:52:12 +08:00
roymondchen
328b3135e5 chore: release v1.2.0-beta.24 2022-12-07 17:04:41 +08:00
roymondchen
12d56aeda9 fix(form): disable配置失效 2022-12-07 17:02:31 +08:00
roymondchen
14550ddc0f chore: release v1.2.0-beta.23 2022-12-07 16:32:00 +08:00
roymondchen
7445d24531 feat(form): 完善select remote功能 2022-12-07 16:28:21 +08:00
roymondchen
e813129eb8 fix(editor): modelValue自动更新不成功 2022-12-07 16:26:26 +08:00
roymondchen
8ab6cdb03c chore: release v1.2.0-beta.22 2022-12-06 21:02:59 +08:00
roymondchen
bd5aa8e0b9 build(element-plus-adapter): 使用vite打包 2022-12-06 20:58:56 +08:00
roymondchen
f3574a5029 chore: release v1.2.0-beta.21 2022-12-06 20:35:10 +08:00
roymondchen
e703c17a47 chore(cli): 去掉type=moudule 2022-12-06 20:33:19 +08:00
roymondchen
45a20d9405 fix(editor): services在组件unmounted时只重置状态不移除事件 2022-12-06 20:32:06 +08:00
roymondchen
67c7faf832 feat(editor): 新增可以移除所有service插件的方法 2022-12-06 19:14:34 +08:00
roymondchen
180252f3f5 chore: 添加type=module 2022-12-06 19:12:32 +08:00
roymondchen
f6dca97442 fix(editor): layout 组件中hasRight判断出错 2022-12-06 16:54:39 +08:00
roymondchen
51f7963197 chore: release v1.2.0-beta.20 2022-12-05 20:41:50 +08:00
roymondchen
828681e960 fix(editor): 复制粘贴时添加的到的父组件应当是当前父组件
fix #448
2022-12-05 20:35:17 +08:00
roymondchen
45eaea6f68 fix(editor): 编辑器初始化默认选择节点 2022-12-05 20:05:23 +08:00
roymondchen
f050ec1273 chore: release v1.2.0-beta.19 2022-12-01 20:38:37 +08:00
roymondchen
102aed78e5 chore: docs移除工作空间 2022-12-01 20:21:07 +08:00
roymondchen
f235e4665b chore: 更新vue-tsc 2022-12-01 19:29:00 +08:00
roymondchen
75eddb913b chore: 更新文档base 2022-12-01 17:51:21 +08:00
roymondchen
f360db1859 chore: 新建github action 自动部署脚本 2022-12-01 17:42:21 +08:00
roymondchen
f6262be397 docs: 1.2.0文档 2022-12-01 17:38:05 +08:00
roymondchen
c143a5f767 Revert "chore: github文档构建锁定在v1.1.6版本"
This reverts commit 3291530b326289653a25a21894dcea3ede9ff520.
2022-11-29 18:06:40 +08:00
oceanzhu
164d777ebf refactor(stage): 将被操作元素和拖拽框抽取出来放到DragResizeHelper中
Squash merge branch 'feature/ocean_stagerefactor_880128993' into 'master'
refactor(stage): 在拖拽过程中,moveable会产生一些状态事件,DragResizeHelper对这些状态事件中对将被操作元素和拖拽框的状态和dom进行处理。
2022-11-29 09:51:41 +00:00
roymondchen
3291530b32 chore: github文档构建锁定在v1.1.6版本 2022-11-29 17:25:53 +08:00
roymondchen
b7934f9f51 fix(editor): 页面切换不在重新渲染画布 2022-11-29 16:58:00 +08:00
roymondchen
239b5d3efe feat(form): dialog支持disabled配置 2022-11-25 20:58:34 +08:00
roymondchen
ea8b863694 feat(form): table支持rowkey配置 2022-11-25 17:31:49 +08:00
roymondchen
830c8d8747 feat(editor): history增加page-change事件 2022-11-25 16:34:42 +08:00
parisma
64d71bef42 docs(admin): 管理端文档更新 2022-11-25 15:19:09 +08:00
oceanzhu
3fb880d09b refactor(stage):重构魔方编辑器stage代码
Squash merge branch 'feature/oc_actionbox_879360293' into 'master'
    对魔方编辑器核心代码stage进行重构,这部分代码主要是负责编辑器中间画布区域的处理,包括渲染一个所见即所得的画布,支持组件的增删改查和拖拽、高亮操作。
    旧代码存在的问题以及解决方案:
    1、过多暴露属性和循环引用,导致stageCore、stageDragResize、StageMultiDragResize、StageRender、StageMask、StageHighlight之间形成复杂的网状依赖,非常不可控。StageCore负责创建后面5个类的实例,并把这些实例作为自己的公共属性,同时core把自己的this传给这些实例,这些实例就会通过core传进来的this,通过core间接的访问其它实例的方法和属性,比如在stageDragResize中可能存在这样的一个访问:this.core.stageRender.contentWindow.document
    解决方案:
    1)、属性尽量设置为私有,对外暴露方法,不暴露属性;
    2)、core避免向其它类传递this,改为传递接口,需要什么就传什么

    2、事件传递较多,跳来跳去,定位问题较为困难
    解决方案:
    重新梳理各个类的职责,尽量在类中闭环,减少事件传递。
    新增了actionManager类,core负责管理render、mask、actionManager三个类;
    actionManager负责管理单选、多选、高亮三个类,同时将mask中的事件监听,转移到actionManager监听,actionManager形成单选、多选、高亮行为后,直接调动单选、多选、高亮完成功能。

    3、存在一些重复代码
    主要是拖拽框的代码在单选、多选、高亮中各自维护,改为统一维护

    4、多选不支持辅助线对齐
    将单选中的moveableOption管理逻辑抽取出来成为单选和多选的父类,使多选支持辅助线对齐

    本次改动取消了一些对外暴露的属性,moveableOption回调函数签名也有变化,详细情况如下:
    删除stageCore公共属性:
    public selectedDom: HTMLElement | undefined;
    public selectedDomList: HTMLElement[] = [];
    public highlightedDom: Element | undefined;
    public dr: StageDragResize;
    public multiDr: StageMultiDragResize;
    public highlightLayer: StageHighlight;
    public config: StageCoreConfig;
    public zoom = DEFAULT_ZOOM;
    public containerHighlightClassName: string;
    public containerHighlightDuration: number;
    public containerHighlightType?: ContainerHighlightType;
    public isContainer: IsContainer;

    stageCore入参改动:
    这两个参数原本定义:
    moveableOptions?: ((core?: StageCore) => MoveableOptions) | MoveableOptions;
    multiMoveableOptions?: ((core?: StageCore) => MoveableOptions) | MoveableOptions;
    修改后定义:
    moveableOptions?: CustomizeMoveableOptions;
    multiMoveableOptions?: CustomizeMoveableOptions;
    CustomizeMoveableOptions =
      | ((config?: CustomizeMoveableOptionsCallbackConfig) => MoveableOptions)
      | MoveableOptions
      | undefined;
    export interface CustomizeMoveableOptionsCallbackConfig {
      targetElId?: string;
    }
2022-11-24 21:19:56 +08:00
roymondchen
deeb55cd0b chore: release v1.2.0-beta.18 2022-11-24 21:04:33 +08:00
parisma
e497ab0008 fix(editor): itemsFunction中补全value
feat(form): export createValues方法
2022-11-24 12:25:26 +00:00
kevinyzheng
d46d61184b feat(cli): export loadUserConfig 2022-11-24 20:16:10 +08:00
roymondchen
76a8eee6c5 chore: release v1.2.0-beta.17 2022-11-24 15:27:37 +08:00
roymondchen
fc50c87ad5 fix(editor): m-form不能加key,会导致vue示例销毁重建 2022-11-24 15:23:50 +08:00
roymondchen
f44500d21b chore: release v1.2.0-beta.16 2022-11-23 18:52:24 +08:00
roymondchen
eacc4dc794 fix(editor): 切换选中组件后组件属性表单内存未释放
fix #123
2022-11-23 17:54:01 +08:00
parisma
5ae32f0792 fix: 在tree上增加tabindex来监听focus事件,完善组件树多选体验 2022-11-23 09:49:58 +00:00
parisma
db91b3e6c6 style(editor): 修复组件树无法滑动的问题 2022-11-23 09:49:58 +00:00
roymondchen
47e851ce5e fix(design): tabs支持modelValue 2022-11-23 15:40:02 +08:00
roymondchen
a4f9467d53 chore: release v1.2.0-beta.15 2022-11-22 16:41:50 +08:00
parisma
dc730cddc3 style(editor): 默认展开组件树节点 2022-11-22 04:28:54 +00:00
parisma
994cd4133a style(editor): 修复代码块列表右侧工具栏遮挡代码块名称的样式问题 2022-11-22 04:28:54 +00:00
parisma
13dc3ca259 fix(editor): 修复setCodeDslById不传content引起的问题 2022-11-22 04:28:54 +00:00
parisma
8195a600f5 feat(editor): 修改代码块参数结构,以对象形式暴露app,params 2022-11-22 04:28:54 +00:00
parisma
a55c6eb8b0 style(form): 修复.el-form-item.hidden跨级选中影响子元素样式的问题 2022-11-22 04:28:54 +00:00
roymondchen
0680bca2b4 docs: 安装cli的命令示例出错 2022-11-21 19:11:51 +08:00
roymondchen
f0d6624fc4 chore: release v1.2.0-beta.14 2022-11-18 18:12:58 +08:00
roymondchen
aa9293af55 feat(table): expand内容支持vue组件 2022-11-18 18:10:17 +08:00
roymondchen
813ca55ef6 feat(editor): 添加右键菜单粘贴icon 2022-11-18 16:22:42 +08:00
roymondchen
54bc196685 chore(playground): 加上vite-plugin-vue-setup-extend后再DevTools上看不到vue的源文件了,固去掉该插件 2022-11-17 20:11:34 +08:00
roymondchen
bddfcee92b fix(editor): 编辑器左中右列宽支持配置最小宽度 2022-11-17 20:03:00 +08:00
roymondchen
0fa44da0d4 chore(editor): 更新service plugin 使用方法注释 2022-11-17 17:19:24 +08:00
kevinyzheng
bb5aa6722f feat(cli): useTs 为必填参数 2022-11-17 04:33:39 +00:00
kevinyzheng
b512e14129 feat(cli): 增加 useTs 配置 2022-11-17 04:33:39 +00:00
parisma
bc4b62a4c1 refactor(editor): 补全ts类型 2022-11-17 11:48:19 +08:00
parisma
8271a3b497 feat(editor): 代码编辑支持全屏 2022-11-16 12:38:01 +08:00
parisma
4e182e5f6e refactor(admin): 修复安全工单 2022-11-16 12:38:01 +08:00
roymondchen
a575073387 chore: release v1.2.0-beta.13 2022-11-15 18:19:57 +08:00
roymondchen
4fe45eb36d fix(form): time value改成HH:mm:ss字符串,支持配置 2022-11-15 18:16:14 +08:00
roymondchen
52fc452823 chore: release v1.2.0-beta.12 2022-11-15 16:58:27 +08:00
parisma
16f671cd8f feat(editor): 代码块支持传递参数 (merge request !9)
Squash merge branch 'feature/parisma_codeDraft' into 'master'
1、 table支持items为函数
2、代码块支持传递参数
2022-11-15 08:48:19 +00:00
kevinyzheng
cc21c47829 feat(cli): hooks.beforeWriteEntry 改为 async 2022-11-15 08:15:43 +00:00
roymondchen
f824b661bd feat(table): 支持expand内容可以为html 2022-11-15 16:03:25 +08:00
roymondchen
8de58a2101 refactor(editor): 明确CodeEditor type的定义 2022-11-15 16:01:52 +08:00
kevinyzheng
4c94fa0a8f feat(cli): 增加 hook.beforeWriteEntry 2022-11-14 06:22:20 +00:00
kevinyzheng
258ac4d56b feat(cli): 设置 dynamicImport 时生成 async-plugin-entry 2022-11-14 06:22:20 +00:00
kevinyzheng
f5a8d6bdc6 fix(cli): entry生成路径错误问题 2022-11-14 06:22:20 +00:00
kevinyzheng
04e18572fd feat(cli): ast 解析入口文件优化 2022-11-14 06:22:20 +00:00
kevinyzheng
6c5cc55f31 feat(cli): 文件声明“不合法”修改为“缺失” 2022-11-14 06:22:20 +00:00
kevinyzheng
958bcd3ec5 feat(cli): 优化 logger,优化 ast 解析 2022-11-14 06:22:20 +00:00
parisma
a03ac7c78b feat: core代码执行兼容老的数据格式 2022-11-10 20:10:21 +08:00
parisma
c2b000ac5f refactor: 安全工单处理 2022-11-10 19:53:35 +08:00
parisma
b2702aaa9e fix: 优化组件列表多选键盘快捷键监听体验 2022-11-10 19:53:35 +08:00
parisma
c7a8552d9b fix: 代码块结构改造完成 2022-11-10 19:53:35 +08:00
parisma
c4293f17a6 feat: 修改code_block结构,组件代码关系绑定改为table,绑定关系更新未完成 2022-11-10 19:53:35 +08:00
parisma
60c572ec30 refactor(editor): 修改变量的类型声明 2022-11-10 19:53:35 +08:00
parisma
0eab817a11 fix(editor): 区分直接关闭和保存后关闭
#440
2022-11-10 19:53:35 +08:00
parisma
0f0ec183a8 fix(editor): 修复自动保存提示不展示的问
#440
2022-11-10 19:53:35 +08:00
parisma
d98d3748d3 feat(editor): 拆分代码块编辑器便于以后扩展,支持草稿自动保存,修复代码块列表的样式问题
#440
2022-11-10 19:53:35 +08:00
parisma
3673d6016d feat(editor): 代码编辑新增草稿功能
#440
2022-11-10 19:53:35 +08:00
roymondchen
3e78a0809b fix(editor): 新增删除页面不应该添加历史 2022-11-10 16:19:17 +08:00
roymondchen
2bbca87e51 chore: release v1.2.0-beta.11 2022-11-08 16:23:29 +08:00
roymondchen
eae776990c fix(editor): Layout 组件与Layout ts type 重名,将组件改为LayoutContainer 2022-11-08 16:21:47 +08:00
roymondchen
d8d6342505 chore: release v1.2.0-beta.10 2022-11-07 16:31:40 +08:00
roymondchen
929d7c463f fix(form): table 分页 2022-11-07 16:23:57 +08:00
roymondchen
617b025ce1 fix(form): table 拖动排序 2022-11-07 15:49:51 +08:00
roymondchen
6fdc28e121 chore(editor): export Layout 2022-11-07 14:32:16 +08:00
roymondchen
66e727838b fix(editor): 多选后,再单选多选中的第一个元素,多选状态没有清除 2022-11-04 19:46:54 +08:00
roymondchen
8d8ef55b81 fix(editor): 画布滚动条出现的不准确 2022-11-04 19:39:47 +08:00
roymondchen
e8c53c2bd1 fix(editor): 单选水平居中 2022-11-04 19:20:30 +08:00
roymondchen
c2e8a1caae fix(editor): content-menu没有响应式 2022-11-04 19:19:44 +08:00
roymondchen
131ae30bae chore: 添加组件name 2022-11-03 14:14:54 +08:00
roymondchen
95be9e9390 chore: 更新element-plus, tabpane只能是tabs的子元素,不能对tabpane进行二次封装 2022-11-02 15:24:58 +08:00
roymondchen
bb01427a42 chore: release v1.2.0-beta.9 2022-10-28 19:20:04 +08:00
roymondchen
723da40bc7 fix(editor): content-menu隐藏时不销毁 2022-10-28 17:43:40 +08:00
roymondchen
9fd8385651 feat(form): 展开更多支持配置函数 2022-10-28 15:08:58 +08:00
parisma
0ca0abf2da fix: 使用form.initValues解决代码块绑定关系更新不及时的问题 2022-10-28 14:58:30 +08:00
parisma
f8d7eaea5e fix(editor): 优化代码逻辑 2022-10-28 14:21:57 +08:00
roymondchen
49c0ec9dd9 fix(form): formState需要同步props更新 2022-10-28 11:38:15 +08:00
roymondchen
5ab38a9077 docs: 修改共享文档 2022-10-26 10:59:16 +08:00
roymondchen
73ecdfff70 chore: release v1.2.0-beta.8 2022-10-25 17:41:35 +08:00
oceanzhu
2dda4f3488 refactor(stage): 删除stageCore构造函数的参数,修改了getScrollParent的实现,无需依赖外部传参数 2022-10-25 09:19:13 +00:00
oceanzhu
554e695ef5 refactor(stage): 根据cr意见优化stageRender构造函数传参 2022-10-25 09:19:13 +00:00
oceanzhu
9787a9e379 refactor(stage): 重构mask,解除对stageCore对象的依赖,同时减少暴露的对象,并重构部分大函数为小函数 2022-10-25 09:19:13 +00:00
oceanzhu
638e996516 refactor(stage): stageRender去除对stageCore对象的依赖,简化对象依赖关系 2022-10-25 09:19:13 +00:00
parisma
baedcaba05 Merge branch 'bugfix/parisma_codeBlock' into 'master' (merge request !4)
fix(editor): 修复管理端和pg表现不一致的问题,删除冗余逻辑
2022-10-25 07:25:12 +00:00
parisma
bc0f17c18f fix(editor): 修复管理端和pg表现不一致的问题,删除冗余逻辑 2022-10-25 11:21:28 +08:00
oceanzhu
f416530d38 fix(stage): 修复辅助线显隐的bug
fix #444
2022-10-20 20:40:13 +08:00
roymondchen
11e0e04cbd feat(editor,stage): 在画布中支持选择父组件
close #403
2022-10-20 19:52:53 +08:00
roymondchen
f6b7e8dad8 feat(form): formDialog支持zIndex props 2022-10-20 16:55:32 +08:00
roymondchen
bab4bf86cb chore: 更新vue-tsc 2022-10-18 16:12:11 +08:00
roymondchen
a06555268f feat(table): action 支持icon,text支持函数 2022-10-18 15:12:16 +08:00
jia000
a44bf0928f
Merge pull request #432 from jia000/master
chore: release v1.2.0-beta.7
2022-10-17 16:04:45 +08:00
roymondchen
f9682a7b70 chore: release v1.2.0-beta.7 2022-10-17 16:03:29 +08:00
roymondchen
d2eaecfaab fix(design): input slot 出错 2022-10-17 12:05:16 +08:00
roymondchen
b965e66440 fix(element-plus-adapter): tag组件写成了tabs 2022-10-14 20:07:55 +08:00
jia000
0437171b7a
Merge pull request #429 from jia000/master
chore: release v1.2.0-beta.6
2022-10-14 18:53:59 +08:00
roymondchen
f6af025355 chore: release v1.2.0-beta.6 2022-10-14 18:52:37 +08:00
parisma
2c31caf34f fix(editor): 设置高亮节点操作一定要在刷新展开状态之后,否则可能导致设置的高亮无效
#404
2022-10-14 18:50:15 +08:00
roymondchen
40410292d7 fix(editor): 多选后拖动,组件树会收缩 2022-10-14 15:56:33 +08:00
roymondchen
a6ecbb66d1 fix(table): type 为selection只能是table下的children,不能是children的children 2022-10-14 15:54:46 +08:00
roymondchen
6caa8cdb79 style(editor): 组件列表与组件树搜索框样式调整 2022-10-14 15:54:46 +08:00
roymondchen
8c5518170d chore: release v1.2.0-beta.5 2022-10-12 19:21:24 +08:00
roymondchen
43691911b7 fix(design): tag组件获取适配组件出错 2022-10-12 19:18:16 +08:00
roymondchen
0444f68f3a fix(editor): 拖动改变左右列宽,不能让中间区域宽度小于0 2022-10-12 17:57:34 +08:00
roymondchen
e01d5d913f fix(editor): 列框缓存失效 2022-10-12 17:57:34 +08:00
jia000
f9e2d80973
Merge pull request #418 from jia000/master
chore: release v1.2.0-beta.4
2022-10-12 16:32:41 +08:00
roymondchen
d5e8a77821 chore: release v1.2.0-beta.4 2022-10-12 16:31:14 +08:00
roymondchen
237cc15387 chore(element-plus-adapter): package.json main 错误 2022-10-12 16:29:08 +08:00
jia000
3539daceaa
Merge pull request #416 from jia000/master
chore: release v1.2.0-beta.3
2022-10-12 15:52:42 +08:00
roymondchen
3baf6ffffc chore: release v1.2.0-beta.3 2022-10-12 15:42:02 +08:00
roymondchen
b77cf108cd fix(stage): 页面布局修改为流式布局后,组件宽可以设置到边框之外
fix #395
2022-10-12 15:39:27 +08:00
roymondchen
476e715982 feat(design): 默认使用element-plus 2022-10-12 14:59:47 +08:00
roymondchen
91bfa5698e test(editor): 测试用例里依赖了element-plus,暂时删掉 2022-10-11 20:29:08 +08:00
roymondchen
63c61caccc feat(editor): editor使用tmagic-design
#401
2022-10-11 20:29:08 +08:00
roymondchen
6d432ba1da feat(form): checkboxGroup options支持函数配置 2022-10-11 18:50:44 +08:00
roymondchen
32a24ad578 feat: table切换成TMagicDesign 2022-10-11 18:11:32 +08:00
roymondchen
4090536c97 docs: 使用element-plus-adapter 2022-10-11 16:08:20 +08:00
roymondchen
1ca339f2ea test: 暂时屏蔽form的测试用例 2022-10-11 15:50:42 +08:00
roymondchen
36f396ac24 feat(playground): 使用@tamgic/design
#401
2022-10-11 15:50:42 +08:00
roymondchen
3a1a9795f6 feat(form): 剥离element-plus依赖,使用tamgic-design
#401
2022-10-11 15:50:42 +08:00
roymondchen
c613b12f11 feat(element-plus-adapter): 新增element-plus ui适配器
#401
2022-10-11 15:50:42 +08:00
roymondchen
e2d784176b feat(design): 新增TMagicDesign,用于适配不同的ui框架
#401
2022-10-11 15:50:42 +08:00
khuntoriia
e3b7f587ee
feat(editor): 支持通过左侧组件树进行组件多选
* feat(layerpanel): 支持通过组件树对组件进行多选

* feat(editor): 重构LayerPanel为ts setup语法形式

* feat(editor): 组件列表选中节点与高亮节点时的逻辑优化,两种形态互斥处理

* fix(editor): 修复按住ctrl不放但鼠标移出的layerpanel时选择模式无法复原的问题,修复点击组件树index多选框可进行选择的问题

* fix(editor): 修复多选场景点击组件树节点取消多选时,节点高亮样式冲突的问题

close #404 

Co-authored-by: parisma <parisma@tencent.com>
2022-10-10 13:57:24 +08:00
jia000
6ec67438d2
Merge pull request #400 from jia000/master
chore: release v1.2.0-beta.2
2022-09-28 16:48:53 +08:00
roymondchen
7da3509bd0 chore: release v1.2.0-beta.2 2022-09-28 16:45:58 +08:00
parisma
52722ec5d4 chore(editor): ts报错修改 2022-09-28 16:42:32 +08:00
roymondchen
d8488782df chore: commit 加上ts type校验 2022-09-28 16:27:31 +08:00
roymondchen
6a65ab812b fix(table): action display 2022-09-28 16:18:10 +08:00
parisma
040d679b7f chore(core): ts报错修改 2022-09-28 16:17:25 +08:00
parisma
551da1a64b fix(eidtor): cr问题修改 2022-09-28 15:52:41 +08:00
parisma
0baec3e532 fix(editor): slot修改,schema声明修改 2022-09-28 15:52:41 +08:00
parisma
85951de24d fix(editor): 修复warning,修改playground dsl codeBlocks字段 2022-09-28 15:52:41 +08:00
parisma
84b24f11b8 Revert "fix(editor): codeblock slot参数修改"
This reverts commit b0a571b2bcb8b4c6f0098dd79fae4b9068996ae5.
2022-09-28 15:52:41 +08:00
parisma
2ac3645bb0 fix(editor): codeblock slot参数修改 2022-09-28 15:52:41 +08:00
parisma
3bb8ecc975 fix(editor): 修复初始dsl无codeBlocks字段时无法新增的问题 2022-09-28 15:52:41 +08:00
parisma
caa47823be feat(editor): 导出CodeBlockList组件 2022-09-28 15:52:41 +08:00
roymondchen
bbb5927e0c fix(stage): 旋转、缩放组件后没有更新dsl 2022-09-27 18:23:19 +08:00
i33
b3bae36d94 fix(runtime): 切换设计窗体大小时,同时修改app 2022-09-27 14:38:30 +08:00
jia000
024e908947
chore: Update issue templates 2022-09-27 14:30:21 +08:00
roymondchen
ac065504f6 test: vue组件测试用例 2022-09-26 21:29:54 +08:00
roymondchen
3570a67f30 chore: 升级vitest版本 2022-09-26 19:21:46 +08:00
roymondchen
96648767e4 chore(editor): 将组件都改成setup模式 2022-09-26 19:15:59 +08:00
roymondchen
c87e3b2164 feat(editor): code组件新增height配置 2022-09-26 18:57:28 +08:00
roymondchen
6cf1f8636c feat(form): form-dialog重新打开是form重新渲染 2022-09-23 19:56:59 +08:00
roymondchen
1c3565035c feat(editor): code组件新增options props 2022-09-23 19:55:28 +08:00
roymondchen
dafcf33255 chore(editor): el-dialog class字段修改 2022-09-23 15:02:38 +08:00
parisma
869b9f23cb feat(editor): 导出CodeSelect组件 2022-09-22 20:07:08 +08:00
jia000
d830b16aa4
Merge pull request #380 from jia000/master
chore: release v1.2.0-beta.1
2022-09-22 18:45:22 +08:00
roymondchen
b50f6a9fbf chore: release v1.2.0-beta.1 2022-09-22 17:13:21 +08:00
roymondchen
23bc21f064 docs: 更新docs 2022-09-22 17:11:44 +08:00
roymondchen
00cd237f61 chore(editor): ts type error 2022-09-22 16:59:18 +08:00
parisma
765c0a227d refactor(core): 升级schema版本 2022-09-22 16:46:11 +08:00
parisma
37181d3084 fix(editor): 默认展开组件列表 2022-09-22 16:46:11 +08:00
parisma
415ecad24c refactor(editor): 修改代码块描述内容在dsl中的键名为codeBlock字段 2022-09-22 16:46:11 +08:00
parisma
92f3696e44 feat(editor): 组件代码块的绑定关系记录到dsl中,修复删除组件解除关系的问题,代码块dsl支持扩展字段 2022-09-22 16:46:11 +08:00
parisma
0b3585c150 feat(editor): 暂时隐藏代码块列表删除组件功能,支持点击组件tag定位到组件 2022-09-22 16:46:11 +08:00
parisma
bfaa8317e3 feat(editor): 支持代码块维度查看与组件的绑定关系,并支持从代码块列表解除绑定 2022-09-22 16:46:11 +08:00
parisma
5de3eeda71 refactor(editor): cr修改 2022-09-22 16:46:11 +08:00
parisma
ff3adbb1d0 refactor(editor): 导出ErrorType类型以便业务方使用 2022-09-22 16:46:11 +08:00
parisma
c3b502254b fix(core): 修复执行代码块的顺序问题 2022-09-22 16:46:11 +08:00
parisma
09c9af8454 fix(stage): 修复ctrl+tab切到其他窗口引起多选状态混乱的问题 2022-09-22 16:46:11 +08:00
parisma
b3ae294a6a style(editor): 样式修改 2022-09-22 16:46:11 +08:00
parisma
c2637b1b0c fix(editor): 样式修改,editor pannel使用resize组件 2022-09-22 16:46:11 +08:00
parisma
27d8640fbc fix(editor): 样式优化 2022-09-22 16:46:11 +08:00
parisma
a452cecc44 fix(editor): 修改样式,修改代码块ID生成逻辑 2022-09-22 16:46:11 +08:00
parisma
9e1fb42783 feat(editor): 增加代码块搜索,代码编辑器同步设置是否可编辑属性,修复不可编辑状态下弹窗无法关闭的问题 2022-09-22 16:46:11 +08:00
parisma
071619b9bd style(editor): 代码块样式修改 2022-09-22 16:46:11 +08:00
parisma
4e6fbab26d fix(editor): 修复通过dsl初始化代码块时,点击查看获取不到绑定的代码块的问题 2022-09-22 16:46:11 +08:00
parisma
134efbfb0f fix(editor): 修复从dsl初始化时代码块绑定关系未同步的问题,修复一些warning,优化语法报错时保存并关闭的交互逻辑 2022-09-22 16:46:11 +08:00
parisma
2356ff514d fix(editor): 修复从dsl初始化时代码块绑定关系未同步的问题 2022-09-22 16:46:11 +08:00
parisma
896f92b5a8 fix(editor): 代码块删除支持传参处理失败逻辑,ts类型修复 2022-09-22 16:46:11 +08:00
parisma
310ee32d75 feat(core): 修改core生命周期钩子处理逻辑,执行对应的代码块 2022-09-22 16:46:11 +08:00
parisma
bc000e9ca6 fix(editor): 解决修改代码名称后已选择的select tag不更新的问题,优化一些样式 2022-09-22 16:46:11 +08:00
parisma
7b961f1284 fix(editor): 绑定关系组件支持单选配置 2022-09-22 16:46:11 +08:00
parisma
ddd22ff486 fix(editor): 绑定关系组件增加option来源的默认逻辑 2022-09-22 16:46:11 +08:00
parisma
8b9ac826fc fix(editor): 修复语法报错 2022-09-22 16:46:11 +08:00
parisma
441a412817 fix(editor): icon使用editor封装的icon组件 2022-09-22 16:46:11 +08:00
parisma
fc749b7375 feat(editor): codeBlockService.getCodeDsl支持增加是否强制刷新参数 2022-09-22 16:46:11 +08:00
parisma
8a9971ab7b fix(editor): 导出CodeBlockList组件 2022-09-22 16:46:11 +08:00
parisma
fa0149773f fix(editor): dsl存储代码块的字段改为methods 2022-09-22 16:46:11 +08:00
parisma
5b220a0e06 feat(editor): codeBlockService暴露一些方法支持hook,默认设置代码块到dsl的method字段 2022-09-22 16:46:11 +08:00
parisma
25d9de10e2 feat(editor): 导出codeBlockService 2022-09-22 16:46:11 +08:00
parisma
2f803c963a feat(editor): 代码块功能增加删除,完善一些边界情况的交互 2022-09-22 16:46:11 +08:00
parisma
0c25cf795f feat(editor): 代码块绑定功能完成 2022-09-22 16:46:11 +08:00
parisma
040d5d0d2c feat(form): select动态监听事件优化 2022-09-22 16:46:11 +08:00
parisma
7020ab4a1f feat(editor)): 组件绑定代码块form表单配置 2022-09-22 16:46:11 +08:00
parisma
7640c06ccb feat(editor): 代码块service封装完成 2022-09-22 16:46:11 +08:00
parisma
452c80d829 feat(editor): 代码块功能新增slot 2022-09-22 16:46:11 +08:00
parisma
2a8cfe58c4 feat(editor): 新增,编辑代码块完成 2022-09-22 16:46:11 +08:00
parisma
f1242ee3f4 feat(editor): 代码块编辑区改为使用弹窗,代码块slot完善 2022-09-22 16:46:11 +08:00
parisma
0c2c33f854 feat(editor): 代码块新增,编辑器保存至dsl 2022-09-22 16:46:11 +08:00
jia000
e69e193874
Merge pull request #377 from jia000/master
chore: release v1.1.6
2022-09-22 16:03:43 +08:00
roymondchen
66c5daca49 chore: release v1.1.6 2022-09-22 16:00:43 +08:00
roymondchen
4643acb0f8 fix(editor): layer-node-content slot参数出错 2022-09-22 15:47:12 +08:00
roymondchen
a16a7e6a4d feat(runtime): vue3使用dynamicImport 2022-09-22 15:23:29 +08:00
roymondchen
c817ad6bb6 feat(cli): 添加dynamicImport配置参数,用于设置是否使用import()来加载组件
re #366
2022-09-22 15:23:29 +08:00
roymondchen
cda0c41ad4 feat(editor): 新增layer-node-content slot,用于定制组件树节点
re #368
2022-09-22 14:43:46 +08:00
roymondchen
0a412ace9f style(form): table 删除样式调整 2022-09-22 12:52:47 +08:00
roymondchen
f853299226 chore: 更新element-plus 2022-09-22 12:52:47 +08:00
roymondchen
eb03ce358f feat(form): table配置支持showIndex用于控制行号 2022-09-22 12:37:51 +08:00
i33
34b628cc07 fix(core): 修复emit 无node时的情况 2022-09-22 12:19:22 +08:00
i33
b0419cdbaf fix(core): 保证传参行为一致 2022-09-22 12:19:22 +08:00
i33
a96d547c20 fix(core): 修复多组件同一事件监听问题修改后导致的共通点击失效问题
统一自定义事件和共通事件行为。
2022-09-22 12:19:22 +08:00
roymondchen
fa4a6d71f6 chore(form): timer type error 2022-09-20 20:28:00 +08:00
roymondchen
560a3acfae feat(form): table新增showIndex配置,用于控制是否显示行索引 2022-09-20 20:23:56 +08:00
jia000
afe1e0f20e
Merge pull request #363 from jia000/master
chore: release v1.1.5
2022-09-20 15:55:12 +08:00
roymondchen
cebb152416 chore: release v1.1.5 2022-09-20 15:31:04 +08:00
roymondchen
b835bb2488 fix(core): 多个组件配置同一事件会导致此事件多次监听
fix #356
2022-09-20 15:21:38 +08:00
roymondchen
6d91cacc84 build: vite依赖升级 2022-09-20 13:18:32 +08:00
roymondchen
6d6490ab31 fix(playground): npm run dev后proxy失效 2022-09-20 13:00:31 +08:00
roymondchen
8c8b180371 chore(editor): 去掉无用console log 2022-09-19 19:00:17 +08:00
roymondchen
e0697833da fix(editor): code-link组件内容不更新 2022-09-19 18:46:17 +08:00
roymondchen
ddf0fcdecc fix(playgound): npm run serve后runtime无法打开
由于vite.config.ts中配置了proxy,run serve的时候是不需要proxy的

fix #352
2022-09-19 15:02:46 +08:00
roymondchen
f10ab21ce8 docs: form select 远程选项 2022-09-19 13:06:18 +08:00
roymondchen
30bb39d71a fix(editor): layout 2022-09-16 17:59:11 +08:00
roymondchen
d76c753483 fix(form): link组件parentValues没有传递下去 2022-09-16 17:46:09 +08:00
roymondchen
835189adc9 feat(editor): 新增Layout 2022-09-16 17:45:16 +08:00
roymondchen
22c57f444f fix(editor): 添加组件后,只有在位置有调整的情况才再次更新组件 2022-09-16 14:21:46 +08:00
roymondchen
39cd7d8ab7 chore(form): form-dialog放到body下 2022-09-15 19:12:46 +08:00
jia000
3b4a57fa94
Merge pull request #346 from jia000/release
chore: release v1.1.4
2022-09-15 15:19:23 +08:00
roymondchen
d748090b5c chore: release v1.1.4 2022-09-15 14:47:56 +08:00
roymondchen
ee361271e7 feat(table): 添加loading参数 2022-09-15 14:41:48 +08:00
roymondchen
5bb42e6107 chore(form): el-dialog 2.3.0后custom-class需改成class 2022-09-15 14:41:03 +08:00
roymondchen
bee9f92abb fix(editor): 画布大小变化,滚动条重置 2022-09-15 14:18:27 +08:00
roymondchen
10d2b3cc9b fix(editor): 添加页面,应该添加到最后 2022-09-14 20:09:00 +08:00
roymondchen
3ff823a59f fix(editor): 页面列表是否可以滚动判断不准确 2022-09-14 20:09:00 +08:00
roymondchen
33a09cccc7 fix(stage): 当选中的组件与上一次选中的组件有重叠时,选中后的下一个click事件丢失 2022-09-14 18:33:19 +08:00
i33
45be838f20 fix(ui): 追加 vue2 和 react 的修改 2022-09-14 14:59:43 +08:00
i33
695efc00a8 fix(ui): 修复text组件在流式容器内无宽高问题 2022-09-14 14:59:43 +08:00
roymondchen
b915accb71 feat(editor): uiService支持插件扩展 2022-09-13 20:30:52 +08:00
jia000
3a5bd4e216
Merge pull request #336 from jia000/master
chore: release v1.1.3
2022-09-13 14:34:13 +08:00
roymondchen
66579793c2 chore: release v1.1.3 2022-09-13 14:32:48 +08:00
roymondchen
e0a16bcf0a fix(editor): 修复流式布局下移动图层操作相反问题 2022-09-13 14:07:08 +08:00
roymondchen
e8550728d1 fix(form): 当默认值为0时,select 远程选项初始化不正确 2022-09-13 13:50:46 +08:00
jia000
3b23e7be6f
Merge pull request #333 from jia000/master
chore: release v1.1.2
2022-09-08 12:49:44 +08:00
roymondchen
601528d752 chore: release v1.1.2 2022-09-08 12:48:44 +08:00
roymondchen
c2cd1c40cf style(editor): icon组件图标样式调整 2022-09-08 12:44:44 +08:00
roymondchen
3e024d21ed feat(editor): 支持控制pagebar中新增按钮显隐 2022-09-06 16:27:30 +08:00
roymondchen
bdd544e87e fix(editor): 画布缩放后,拖入组件位置错位 2022-09-06 16:06:18 +08:00
roymondchen
c307386190 feat(editor): 添加compoent-list-item slot 2022-09-06 16:04:20 +08:00
roymondchen
458f493150 build: 使用esbuildOptions定义global 2022-09-06 15:38:16 +08:00
jia000
08faee9cab
Merge pull request #327 from jia000/release
chore: release v1.1.1
2022-08-31 15:15:19 +08:00
roymondchen
d84c6d08c3 chore: release v1.1.1 2022-08-31 15:14:05 +08:00
roymondchen
2468082be9 docs: 去掉打包脚本,改为使用cli 2022-08-31 15:12:08 +08:00
roymondchen
e67cbceb7d fix(editor): 没有页面时,添加页面出错 2022-08-31 15:11:01 +08:00
roymondchen
13ef262bc2 chore(admin): 升级tmagic版本 2022-08-30 20:29:31 +08:00
jia000
166424a878
Merge pull request #323 from jia000/release
chore: release v1.1.0
2022-08-30 20:19:40 +08:00
roymondchen
53f36bcebb chore: release v1.1.0 2022-08-30 20:18:50 +08:00
i33
8db7821032 fix(core): 解决固定元素失效问题
固定元素在父链存在非none的transform时无效,去除空值的transform样式。
2022-08-30 19:38:33 +08:00
roymondchen
793d02a706 feat(stage): 多选支持resize
close #302
2022-08-30 17:56:53 +08:00
i33
3af6f11f9f fix(editor): 添加remove事件时的参数
之前是有参数的。
2022-08-30 17:39:14 +08:00
roymondchen
2201fbe80c fix(editor,stage,ui,runtime): 流式布局下,height自动设置成auto
fix #298
2022-08-30 17:38:42 +08:00
roymondchen
9e167474a2 fix(stage): 流式布局resize从上或者左边调整,选中框出现错位
fix #297
2022-08-30 14:32:06 +08:00
roymondchen
4a59b4b0f4 feat(editor): 编辑器销毁后销毁services 2022-08-30 12:50:53 +08:00
i33
6c0b92e808
feat(editor): 创建新组件时的顺序 (#316)
* feat(editor): 创建新组件时的顺序

点击面板组件创建新组件时,默认按照当所选组件(非容器)后面的顺序

* feat(editor): 追加vue2 runtime的修改
2022-08-30 12:45:51 +08:00
jia000
d3342a04c9
Merge pull request #315 from jia000/release
chore: release v1.1.0-beta.13
2022-08-29 12:19:33 +08:00
roymondchen
7dfb0ea7b6 chore: release v1.1.0-beta.13 2022-08-29 12:18:18 +08:00
roymondchen
f3c376a31f chore(cli): 去除@vuepress/cli依赖 2022-08-29 12:14:40 +08:00
roymondchen
de8ef8dc58 feat(editor): 画布添加滚动条
fix #262
2022-08-26 22:00:16 +08:00
roymondchen
dd3075be56 feat(editor): 去掉画布根据视窗大小自动调整缩放比例,加上缩放到实际大小/缩放以适应菜单按钮 2022-08-25 16:24:48 +08:00
roymondchen
4872e5352b chore(editor): 重构tool-button,将功能逻辑移到nav-menu中 2022-08-25 15:30:41 +08:00
roymondchen
ca5e4d2702 chore(editor): 导出ContentMenu 2022-08-25 11:08:17 +08:00
jia000
814984d5bf
Merge pull request #309 from jia000/release
chore: release v1.1.0-beta.12
2022-08-24 11:09:03 +08:00
roymondchen
091bf37b6d chore: release v1.1.0-beta.12 2022-08-24 11:04:08 +08:00
roymondchen
9b9c9db683 fix(editor): 上移一层通知runtime更新参数出错
fix #282
2022-08-24 10:36:42 +08:00
roymondchen
5529bbc6e1 fix(editor): 组件属性表单配置默认值 2022-08-24 10:04:28 +08:00
roymondchen
98bc4e2dbb feat(editor): 添加stage slot 2022-08-24 09:37:41 +08:00
roymondchen
31029bc8f1 feat(editor): propsService添加fillConfig方法,支持扩展 2022-08-23 20:35:34 +08:00
roymondchen
3cdcca3b0b chore(editor): 删除无用代码 2022-08-23 20:35:34 +08:00
wangminghua
9b0db4a807 fix(editor): 修复 update 返回值三目运算符判断错误的问题,同时优化输入与输入类型一致。 2022-08-23 14:39:21 +08:00
wangminghua
547e733c65 fix(editor): 修复Add返回数组还是对象的逻辑 2022-08-23 12:59:13 +08:00
roymondchen
cfda89a2f6 chore: 更新monaco-editor版本 2022-08-22 17:42:17 +08:00
王明华
56b8ed1d73
refactor(editor): 支持doPaste插件 (#299)
* refactor(editor): 粘贴时添加粘贴选项,用于格式化粘贴对象数据。

* refactor(editor): 支持doPaste插件
2022-08-22 17:36:02 +08:00
roymondchen
a7fa9f3a29 docs(docs): 组件联动原理描述
close #257
2022-08-22 15:11:55 +08:00
roymondchen
221336f634 docs: tmagic/cli 2022-08-22 15:11:55 +08:00
i33
f3c9ba475f
fix(editor): 拖拽改变父容器时错乱现象 (#296)
* fix(editor): 拖拽改变父容器时错乱现象

直接拖拽元素改变其父容器时, 会产生错乱的现象。

* Update packages/stage/src/types.ts

Co-authored-by: jia000 <398009049@qq.com>

Co-authored-by: jia000 <398009049@qq.com>
2022-08-22 13:18:23 +08:00
jia000
edcfe685d8
Merge pull request #295 from jia000/release
chore: release v1.1.0-beta.11
2022-08-19 11:26:22 +08:00
roymondchen
6cc1d8e3c0 chore: release v1.1.0-beta.11 2022-08-19 11:25:10 +08:00
roymondchen
de380357ee fix(ui,runtime): 组件注册默认以magic-ui-xx的形式,不再需要在组件中设置name
fix #291
2022-08-19 11:09:26 +08:00
roymondchen
143bded648 feat(editor): 记住组件树节点展开的状态
close #283
2022-08-19 10:57:19 +08:00
i33
0536ac29ae
fix(editor): 解决UISelect控制台警告 (#289)
* fix(editor): 解决UISelect控制台警告

tooltip使用时,如果直接子元素有v-if, 会造成控制台警告`[ElOnlyChild] no valid child node found`,添加一个固定元素,避免警告。

* Update UISelect.vue

修改v-if到tooltip
2022-08-19 10:52:01 +08:00
roymondchen
aed4b42191 feat(admin): 更新runtime 2022-08-18 19:47:49 +08:00
roymondchen
87f1bfbdd6 feat(cli): 添加onInit/onPrepare配置 2022-08-18 19:47:49 +08:00
roymondchen
4e4cae4a77 fix(cli): window下路径分隔符\转换为/
fix #286
2022-08-18 17:17:15 +08:00
jia000
8f8d6ba420
Merge pull request #285 from jia000/release
chore: release v1.1.0-beta.10
2022-08-17 15:31:26 +08:00
roymondchen
6573e8606f chore: release v1.1.0-beta.10 2022-08-17 15:29:57 +08:00
roymondchen
e1c0614265 fix(form): text按方向键减到负数后,继续按方向键无效
fix #261
2022-08-17 15:27:10 +08:00
roymondchen
5f0e421550 fix(editor): 复制页面错误 2022-08-17 15:27:10 +08:00
roymondchen
c19afda58c feat(cli): 自动install组件包,支持pnpm,npm,yarn 2022-08-17 15:27:10 +08:00
roymondchen
2cde4bb5a0 feat(editor): runtime add api中parent参数加回去 2022-08-16 16:29:32 +08:00
roymondchen
b1bd7a870e feat(core): 旋转角度支持配置不带单位的数值
fix #260
2022-08-16 15:45:48 +08:00
roymondchen
41a8400095 fix(playground,runtime): 拖动添加弹窗时初始位置不对 2022-08-16 15:20:39 +08:00
roymondchen
59e6aff70a feat(editor,stage): runtime-api中的add/update/remove中的参数加上parentId 2022-08-16 15:20:39 +08:00
roymondchen
9d2e2210d1 fix(editor): react runtime中添加没有即使渲染 2022-08-16 14:39:42 +08:00
jia000
79cee1cbdc
Merge pull request #273 from jia000/release
chore: release v1.1.0-beta.9
2022-08-12 16:12:20 +08:00
roymondchen
cacf228511 chore: release v1.1.0-beta.9 2022-08-12 15:47:14 +08:00
roymondchen
52973d2a34 feat(cli): 支持temp下的config.ts配置文件,该模式下的配置文件会默认被删掉 2022-08-12 15:38:45 +08:00
roymondchen
4f8ea94ee8 feat(stage,editor): 拖入指定容器支持配置成按住alt才开启 2022-08-12 15:36:05 +08:00
roymondchen
b1ce0be682 feat(stage): 暂时禁用多选resizable 2022-08-12 14:28:10 +08:00
roymondchen
edf66cc076 fix(stage): 多选时禁止拖出边界 2022-08-12 14:19:25 +08:00
roymondchen
c949590f80 feat(editor,stage): 多选支持居中操作 2022-08-12 13:39:25 +08:00
王明华
8f5acff0a6
fix(stage): 修复多选组件处于拖拽状态时画布组件命中高亮的问题,优化多选拖拽体验 (#265)
* fix(stage): 修复多选组件处于拖拽状态时画布组件命中高亮的问题,优化多选拖拽体验

* fix(stage): 修复多选组件处于拖拽状态时画布组件命中高亮的问题,优化多选拖拽体验

* fix(stage): type.ts 中定义全局拖拽状态枚举 StageDragStatus,并修改相关的枚举使用项

Co-authored-by: jia000 <398009049@qq.com>
2022-08-12 13:15:26 +08:00
王明华
cf9768ba96
fix(stage): 修复非多选状态下,点击选中组件切换为普通选中状态 (#254)
* fix(stage): 修复非多选状态下,点击选中组件切换为普通选中状态

* fix(stage): 修复非多选状态下,点击选中组件切换为普通选中状态

* fix(stage): 修复非多选状态下,点击选中组件切换为普通选中状态
2022-08-12 12:55:34 +08:00
roymondchen
78fe83bddc docs: 修改教程1中的错误描述 2022-08-12 12:48:02 +08:00
roymondchen
31d60eb1ba fix(playground): pc预览适配 2022-08-11 17:53:03 +08:00
roymondchen
0e82f652a9 fix(editor): 删除节点后,标记父节点为修改状态 2022-08-11 17:25:54 +08:00
roymondchen
882774311a fix(editor): 水平居中添加了两个历史堆栈 2022-08-11 17:25:54 +08:00
jia000
554e7cfd52
Merge pull request #256 from jia000/release
chore: release v1.1.0-beta.8
2022-08-11 14:47:52 +08:00
roymondchen
ea83830f17 chore: release v1.1.0-beta.8 2022-08-11 14:44:46 +08:00
roymondchen
41cdc6e650 test(editor): 更新propsService引用路径 2022-08-11 14:39:59 +08:00
roymondchen
fb93527b44 chore: 更新vitest版本 2022-08-11 14:39:59 +08:00
roymondchen
b6fa064b0b feat(editor): editorService.add支持添加多个组件 2022-08-11 14:26:03 +08:00
roymondchen
5ccb5f1ec9 fix(ui-vue2): button,container,text formconfig补充完整 2022-08-09 20:05:21 +08:00
roymondchen
beee67b3eb fix(editor): 画布右键菜单中粘贴按钮显示条件修改 2022-08-09 20:05:21 +08:00
roymondchen
23617a63e9 fix(editor): icon 图片模式样式修改 2022-08-09 20:05:21 +08:00
roymondchen
66d013f510 build(cli): 增加声明文件生成 2022-08-09 20:05:21 +08:00
jia000
538ec01507
Merge pull request #247 from jia000/release
chore: release v1.1.0-beta.7
2022-08-08 21:15:54 +08:00
roymondchen
100cb940cb chore: release v1.1.0-beta.7 2022-08-08 21:14:11 +08:00
roymondchen
a7057d2568 fix(form): daterange不会自动更新 2022-08-08 21:09:58 +08:00
roymondchen
0a126c1f71 chore: 添加magic-admin/server/static到eslintingnore 2022-08-08 21:09:58 +08:00
parisma
46e0e23785 fix(editor): 修复先单击选中页面,再进行多选无法选中的问题 2022-08-08 19:37:20 +08:00
roymondchen
a4dd4eac02 fix(editor): 页面列表显示问题 2022-08-08 19:21:40 +08:00
roymondchen
9ac3e12487 feat(utils): moment换成dayjs 2022-08-08 18:57:38 +08:00
roymondchen
5f78bbd7b7 feat(core): 新增store 2022-08-08 17:20:21 +08:00
roymondchen
eba6cbccde feat(admin): 更新runtime 2022-08-08 17:12:34 +08:00
roymondchen
1d8149b5eb build: 修改runtime publicDir 2022-08-08 16:13:58 +08:00
roymondchen
7de649d8c4 fix(editor): uiselect没有注册 2022-08-08 13:30:37 +08:00
roymondchen
3d1a803ec9 feat(stage): 多选快捷键改成ctrl/cmd 2022-08-08 13:28:09 +08:00
jia000
8c5250403b
Merge pull request #236 from jia000/release
chore: release v1.1.0-beta.6
2022-08-05 20:22:26 +08:00
roymondchen
3bcc0c408a chore: release v1.1.0-beta.6 2022-08-05 20:21:45 +08:00
roymondchen
08dae20aa0 build(editor): 由于生成.d文件无法将别名转化成真实路径,暂时将@editor改回相对路径 2022-08-05 20:12:35 +08:00
roymondchen
5e36ca8e47 build: 构建时某些文件的.d文件丢失 2022-08-05 20:12:35 +08:00
wangminghua
9ffecf62f7 fix(editor): 添加组件粘贴操作支持偏移量 2022-08-05 20:10:32 +08:00
roymondchen
a4e91fa66d fix(stage): 单选后,粘贴多个组件,原来的单选状态没有取消 2022-08-04 18:49:15 +08:00
roymondchen
574e03f685 feat(editor): 完善storageService功能
新增namespace,setItem/getItem时自动key自动加上namespace;setItem可以指定协议;getItem时根据协议自动解析

fix #224
2022-08-04 18:46:26 +08:00
roymondchen
6e199897ac fix(docs): vuepress暂不支持vite3.0 2022-08-04 16:05:14 +08:00
roymondchen
e8b8d35cbd feat(runtime): vue2/react使用tamgic-cli生成组件依赖入口 2022-08-04 15:39:19 +08:00
roymondchen
a57fef4947 feat(runtime,playground): vue3使用tmagic-cli生成组件依赖入口 2022-08-04 15:39:19 +08:00
roymondchen
abde532654 chore(ui): 补充完整dependencies 2022-08-04 15:39:19 +08:00
roymondchen
14e9b6ec59 chore: 将vite/client配置到tsconfig中 2022-08-04 15:39:19 +08:00
roymondchen
32fdf05eb1 feat(cli): 生成的entry文件不再在window挂对象,通过构建自动挂载 2022-08-04 15:39:19 +08:00
roymondchen
624da4c29a feat(cli): 支持配置temp文件夹,默认.tmagic 2022-08-04 15:39:19 +08:00
roymondchen
55661ee2e7 chore: 更新vite到3.0 2022-08-04 15:39:19 +08:00
roymondchen
e5f0506a00 feat(stage,runtime): 去掉runtime getSnapElements 定义 2022-08-04 15:39:19 +08:00
roymondchen
f18e7b275d feat(cli): 新增tamgic-cli,用于runtime 依赖生成 2022-08-04 15:39:19 +08:00
roymondchen
f1a8097e06 chore: 更新vuepress版本 2022-08-04 15:39:19 +08:00
roymondchen
3c0f19347d chore: 更新ts版本 2022-08-04 15:39:19 +08:00
wangminghua
2008bc7da1 fix(editor): 修复添加StorageService定义导出带来的构建错误 2022-08-04 13:40:46 +08:00
王明华
da0cb7d614
feat(editor): 添加storageService服务 (#225)
* feat(editor): 添加storageService服务

* fix(editor): 添加type.ts 导出StorageService的定义
2022-08-04 12:45:55 +08:00
parisma
8c64ea798a feat(editor): 多选粘贴后同步选中粘贴的多个元素,并支持拖拽,粘贴删除支持多个元素同时撤销到上一步 2022-08-04 12:38:36 +08:00
parisma
af2fa3eee4 test(editor): 修改测试用例,修复流水线打包问题 2022-08-03 14:46:48 +08:00
khuntoriia
b702857aad
feat(editor): 多选菜单支持复制粘贴删除 (#217)
* feat(editor): 多选菜单支持复制粘贴删除

* fix(editor): 编辑器选中节点统一为nodes数组,保留原node对象为nodes数组的第一个元素,将复制粘贴删除行为封装到editorservice中,支持键盘快捷键

* test(editor): 修改editor相关测试用例

* fix(editor): cr问题修改

* feat(editor): 将复制粘贴操作进行拆分封装

* fix(editor): cr修改

Co-authored-by: parisma <parisma@tencent.com>
2022-08-03 14:03:36 +08:00
王明华
a02fd2c695
fix(editor): id可能重复 (#221)
提升id位数,降低id重复几率
2022-08-03 14:01:12 +08:00
roymondchen
259a5aa530 fix(admin): npm install 出错
fix #207
2022-08-01 16:52:24 +08:00
roymondchen
8e1e7ef0de docs: 修改onRuntimeReady描述 2022-07-29 16:57:39 +08:00
jia000
05f9bb8141
Merge pull request #215 from jia000/release
chore: release v1.1.0-beta.5
2022-07-29 14:51:58 +08:00
roymondchen
ccca4eb653 chore: 重新生成changlog 2022-07-29 14:51:13 +08:00
roymondchen
699e6fe953 chore: release v1.1.0-beta.5 2022-07-29 14:46:16 +08:00
roymondchen
aa20c74131 fix(editor): 新增页面时会有一个error 2022-07-29 14:32:53 +08:00
roymondchen
9858327eb8 fix(stage,runtime,ui-react): tmagicRuntimeReady时机修改
fix #198
2022-07-29 12:50:07 +08:00
i33
0a1cf060a5 fix(stage): 在 stage 拖拽改变父容器的BUG
从大容器 到内部小容器 拖拽, 不会改变父容器的问题, 例如:
场景组件 :  
 1. page: Page
 2. page 的子组件:  按钮Button 
 3. page 的子组件:  组Group

操作:
1. 拖住Button 不动, 激活当前父容器Page, 这时Page变暗, 被选择为目标父容器。
2. 继续不松手,再拖至P的子组件Group上方去选择Group,Page还是拥有被选择的样式,Group并未被选为目标父容器。
3. 松开鼠标按键完成拖放, Button 还是在Page内。
2022-07-29 12:46:10 +08:00
roymondchen
4ff07ea5a9 fix(editor): 重复import 2022-07-28 15:31:08 +08:00
i33
340eeb32d7
fix(editor): 已选组件树形拖放时, layout 根据父窗口动态变化 (#210)
* fix(editor): 已选组件树形拖放时, layout 根据父窗口动态变化

当拖拽到不同的父节点时, 自身节点的position不会根据父容器变化

* 修改代码格式

Co-authored-by: jia000 <398009049@qq.com>

Co-authored-by: jia000 <398009049@qq.com>
2022-07-28 13:47:54 +08:00
roymondchen
fff587d9eb fix(editor): 新增组件id不对 2022-07-27 16:47:12 +08:00
parisma
ec1bf1dcb7 fix(admin): 升级tmagic版本,修复第一个活动第一个页面uiconfig中id和page id重复的问题 2022-07-27 16:43:03 +08:00
parisma
a2fb92d988 feat(stage): 1) 高亮边框样式加粗
2) 统一组件是否可选中逻辑,固定定位和绝对定位不可混合多选
3) 多选moveable options接受业务传入的moveableOptions
2022-07-27 13:13:44 +08:00
parisma
a4884c504f fix: 修复多选组件时新增组件的体验问题 2022-07-27 13:13:44 +08:00
jia000
fff974bbdb
Merge pull request #206 from jia000/release
chore: release v1.1.0-beta.4
2022-07-26 16:36:14 +08:00
roymondchen
11d790d245 chore: release v1.1.0-beta.4 2022-07-26 16:34:42 +08:00
roymondchen
c1fc6b8f94 feat(editor): editorService.add 的addNode参数对象中加上inputEvent 2022-07-26 16:28:37 +08:00
roymondchen
0450de481f refactor(stage): 将dragresize中的up down函数移到util中 2022-07-26 16:28:37 +08:00
roymondchen
bf95925878 fix(editor): 拖动组件到最右边会多出1px 2022-07-26 16:28:37 +08:00
roymondchen
9747e0f516 fix(editor): 画布大小与stageRect配置不相符 2022-07-26 16:28:37 +08:00
roymondchen
dd1ec53064 fix(editor): 水平居中 2022-07-26 13:25:56 +08:00
i33
940b08b2c5 fix(editor): 修正css sass变量
遇到浏览器报错
2022-07-26 13:17:11 +08:00
jia000
1f6c59ee41
Merge pull request #203 from jia000/release
chore: release v1.1.0-beta.3
2022-07-25 22:07:49 +08:00
roymondchen
818b5ea02a chore: release v1.1.0-beta.3 2022-07-25 22:06:01 +08:00
roymondchen
89f863d873 fix: 当前选中组件处于流式布局模式下时,直接拖动其他组件会错误判断成是流式组件 2022-07-25 22:02:17 +08:00
roymondchen
d334b697ae fix(editor): 指定父节点添加组件 2022-07-25 22:02:17 +08:00
Iain
923e8ea5ab feat(core): 添加设计稿宽度设置(px转rem相关),默认375,可设置为750 2022-07-22 16:10:50 +08:00
khuntoriia
3ccabfbe44
多选优化及问题修复 (#196)
* feat(stage): 支持绝对定位,固定定位,组内元素按住shift键进行多选拖拽能力

* feat(stage): 使用moveable.helper接管moveable target的更新,针对弹窗场景引入业务方方法进行校准

* feat(stage): 将多选逻辑封装到StageMultiDragResize

* fix(stage): 修复多选target元素无法映射到drag虚拟元素的问题

* feat(stage): 多选拖拽完成后将更新的位置信息暴露给上层业务方

* fix(stage): 删除多余的成员变量

Co-authored-by: parisma <parisma@tencent.com>
2022-07-22 11:31:11 +08:00
khuntoriia
fe520bf600
支持通过按住shift键进行组件多选的能力 (#193)
* feat(stage): 支持绝对定位,固定定位,组内元素按住shift键进行多选拖拽能力

* refactor: 更新pnpm-lock.yaml

* feat(stage): 使用moveable.helper接管moveable target的更新,针对弹窗场景引入业务方方法进行校准

* feat(stage): 将多选逻辑封装到StageMultiDragResize

* fix(stage): cr意见修改

Co-authored-by: parisma <parisma@tencent.com>
2022-07-21 15:15:41 +08:00
roymondchen
1750467d5b fix(core): 事件触发时组件未初始化,等组件初始化后再调用事件处理 2022-07-19 15:39:45 +08:00
roymondchen
a4abf5feea fix(playground): 小屏幕下设备切换按钮样式问题 2022-07-18 14:11:41 +08:00
roymondchen
d8d0096350 chore: release v1.1.0-beta.2 2022-07-15 18:53:56 +08:00
jia000
30b209b628
chore: release v1.0.6 (#183)
* fix(form): el-table类型引用有问题,改为any

* chore: release v1.0.6

Co-authored-by: roymondchen <roymondchen@tencent.com>
2022-07-15 18:19:50 +08:00
roymondchen
7c42f751a4 fix(magic-admin): 画布显示出错 2022-07-14 21:31:51 +08:00
roymondchen
48294ea21b chore: release v1.1.0-beta.1 2022-07-14 21:31:51 +08:00
roymondchen
fe281cfade build: 发布后更新docs依赖 2022-07-14 21:31:51 +08:00
roymondchen
4c5817a922 docs: 尖括号没有转义 2022-07-14 20:39:11 +08:00
roymondchen
0e0e3ee310 refactor: 使用@element-plus/icons-vue替换@element-plus/icons 2022-07-14 20:39:11 +08:00
roymondchen
cec111beed chore: release v1.1.0-beta.0 2022-07-14 20:39:11 +08:00
roymondchen
260b6435cf docs: 添加editor新props 2022-07-14 19:30:42 +08:00
roymondchen
de0c6952c7 feat: 支持将组件拖动到指定容器 2022-07-14 19:02:29 +08:00
roymondchen
f3e2d9ca39 feat(ui): page 添加magic-ui-container class 2022-07-14 19:02:29 +08:00
roymondchen
803f93caab build(playground): run playground 后自动在浏览器中打开页面 2022-07-12 14:23:25 +08:00
roymondchen
014859fd2f feat(runtime): 支持构建magic-admin的runtime产物 2022-07-11 20:18:55 +08:00
roymondchen
7dc0b4e261 fix(magic-admin): 修复发布页面资源路径错误,导致页面无法打开问题 2022-07-11 19:52:52 +08:00
roymondchen
f2893880b1 feat(ui-vue2): 升级至vue2.7.4 2022-07-11 15:23:58 +08:00
roymondchen
d5f6f69994 chore: release v1.0.5 2022-07-08 17:49:38 +08:00
roymondchen
e901ad4dd0 feat(editor): 添加props-panel-header slot;修改layer-panel,component-list-panel slot名称,加上-header 2022-07-08 17:37:04 +08:00
roymondchen
5c74e0f296 chore: release v1.0.4 2022-07-07 20:01:27 +08:00
roymondchen
49c9e87d6e feat(editor): 添加layer-panel/component-list-panel slot 2022-07-07 19:46:11 +08:00
roymondchen
8d5eab0ef8 fix(form): date组件初始值 不显示 2022-07-07 19:46:11 +08:00
roymondchen
dd1a8e22c5 docs: 添加render教程 2022-07-07 19:16:39 +08:00
kevinyzheng
8b70edeaf2 fix(runtime): 解决启动脚本不识别组件包内的插件 2022-07-07 11:54:34 +08:00
roymondchen
db96610c91 chore(form): 去掉无用log 2022-07-05 20:25:12 +08:00
roymondchen
56a7707721 chore: release v1.0.3 2022-07-05 15:04:35 +08:00
roymondchen
3090bc7763 fix(form): 配置了names,validator中的value应为model 2022-07-05 14:49:23 +08:00
roymondchen
9454bb3679 fix(form): tabs配置name后出错 2022-07-05 14:49:23 +08:00
roymondchen
26c60c316a fix(form): fieldset checkbox chang事件不会触发 2022-07-05 14:49:23 +08:00
roymondchen
68302c01f1 chore: install 后需要build,不然run playground会报错 2022-07-01 20:07:28 +08:00
roymondchen
a7afe057fb chore: import type 2022-07-01 20:07:28 +08:00
roymondchen
de81218dc0 chore: 修改actions构建失败问题 2022-07-01 20:07:28 +08:00
roymondchen
4e4d380afd docs: 修改文档表述不恰当问题 2022-07-01 17:42:59 +08:00
roymondchen
4216880d11 build: runtime支持热更新 2022-07-01 17:42:59 +08:00
roymondchen
6d4323123f build: build之前做type check 2022-06-30 20:23:50 +08:00
roymondchen
e1705c350e feat(form): datetime移出默认defaultTime,支持defaultTime配置 2022-06-30 20:23:50 +08:00
roymondchen
1950c11629 chore: release v1.0.2 2022-06-29 15:35:29 +08:00
roymondchen
fab8717fcf fix(form): el-upload类型读取失败导致Table.vue.d.ts丢失 2022-06-29 15:35:29 +08:00
roymondchen
32e86d8167 fix(form): 初始化values时,数组中的对象出现key丢失 2022-06-29 15:35:29 +08:00
roymondchen
fd1fea2519 chore: release v1.0.1 2022-06-27 15:00:07 +08:00
roymondchen
3de29e0316 feat(form): groundlist 函数配置增加prop/config两个变量 2022-06-27 12:06:00 +08:00
i33
ecd80cb4a4 fix(editor): 修正Editor slot 变量位置 2022-06-27 12:04:18 +08:00
roymondchen
618f853d63 chore: release v1.0.0 2022-06-24 20:54:30 +08:00
roymondchen
c83d83b1a1 fix(core): 拼写错误 2022-06-24 20:36:52 +08:00
roymondchen
83cd10159d feat(form): datetime默认的具体时刻设置为23:59:59 2022-06-24 20:36:52 +08:00
Pauli
33990b819f crypto 长度错误 2022-06-23 14:41:46 +08:00
liupo.wu
ac2aef980c fix: 创建活动时 2022-06-23 14:41:46 +08:00
roymondchen
906002f809 chore: release v1.0.0-rc.13 2022-06-22 17:49:31 +08:00
roymondchen
069aec64c1 fix(stage): 无法拖到left为0 2022-06-22 16:51:28 +08:00
roymondchen
fb612eaddc feat(editor): 参考线缓存与页面绑定 2022-06-22 16:51:28 +08:00
roymondchen
363330e07a fix(editor): 编辑器分栏左右各设置最小宽度 fix #145 2022-06-22 16:51:28 +08:00
roymondchen
f9fd249fc4 chore(runtime): 更新vue2的依赖 2022-06-22 16:51:28 +08:00
roymondchen
7467aba75e chore(stage): 修改判断position的方法 2022-06-22 16:51:28 +08:00
roymondchen
c2de910f3c docs: 更新文档 2022-06-21 20:54:12 +08:00
roymondchen
6e7837dc39 chore: release v1.0.0-rc.12 2022-06-21 20:42:36 +08:00
roymondchen
def0e3ef8d feat(stage): 提供tmagicRuntimeReady message事件通知 2022-06-21 20:19:25 +08:00
roymondchen
23776299a7 fix(editor): moveableOptions默认值中的container有误 2022-06-21 20:19:25 +08:00
roymondchen
a49bf42407 docs: runtime教程 2022-06-21 20:19:25 +08:00
i33
f72b8c7614
fix: 修正getScrollParent逻辑 (#141)
* Create const.ts

错别字

* docs:修改注释中错别字

* fix: 修正getScrollParent逻辑
2022-06-21 12:51:35 +08:00
i33
b751621488
docs:修改注释中错别字 (#140)
* Create const.ts

错别字

* docs:修改注释中错别字
2022-06-20 13:10:07 +08:00
roymondchen
0521328465 docs: 修改文档错别字 2022-06-17 18:34:19 +08:00
jia000
0fe6e0ed75
release v1.0.0-rc.11 (#138)
* fix(editor): 页面标题不要换行

* docs: 教程与stageCore

* fix(editor): runtime.updateRootConfig可以为空

* fix(editor): 编辑组件是获取parent需要获取到Proxy

* fix(editor): 默认page属性值加上layout

* fix(stage): magic注入时机应当在iframe onload之后

* chore: release v1.0.0-rc.11

* chore: 更新changlog

Co-authored-by: roymondchen <roymondchen@tencent.com>
2022-06-17 17:13:22 +08:00
i33
e5f269cd88
Update const.ts (#137)
chore(stage): 修改注释中的错别字
2022-06-16 14:35:54 +08:00
roymondchen
3ab29d7022 chore: release v1.0.0-rc.10 2022-06-15 19:43:25 +08:00
roymondchen
7ad80e848f fix(form): 函数配置中添加config参数 2022-06-15 19:38:55 +08:00
roymondchen
eae9725ccb fix(form): 函数配置中添加config参数 2022-06-15 19:35:54 +08:00
roymondchen
7c5c4cb4ae chore: release v1.0.0-rc.9 2022-06-15 15:29:30 +08:00
roymondchen
feff6177c9 fix(stage): 所有父节点中如果有translate,导致选中框定位出错 2022-06-15 15:23:46 +08:00
roymondchen
48c4f784c4 chore: release v1.0.0-rc.8 2022-06-15 14:43:36 +08:00
roymondchen
154860c66c feat: 支持配置updateDragEl方法来调制选中框 2022-06-15 14:22:14 +08:00
roymondchen
10577aea68 fix(editor): page和container默认value加上items 2022-06-15 12:49:43 +08:00
roymondchen
2856ee3b6c style(editor): 重置workspace区域focus样式 2022-06-15 12:49:43 +08:00
roymondchen
b8dbb37b9b build: pages deploy 2022-06-14 15:50:09 +08:00
roymondchen
4e812c396d feat(docs): 添加搜索 2022-06-14 14:52:20 +08:00
roymondchen
470033487c chore(docs): 升级vuepress 2022-06-14 14:52:20 +08:00
roymondchen
a72658d697 chore(admin): 升级tmagic 2022-06-13 21:16:02 +08:00
roymondchen
c57037030d feat(playground): 优化form/table playground 2022-06-13 21:03:34 +08:00
roymondchen
9f23cd6361 feat(playground): 添加不同设备切换 2022-06-13 21:03:34 +08:00
roymondchen
f80825331e feat(playground): 添加form、table playground入口 2022-06-13 21:03:34 +08:00
roymondchen
2ed4557536 chore: release 1.0.0-rc.7 2022-06-13 19:10:40 +08:00
roymondchen
2319df727a feat(playground): 添加弹窗组合 2022-06-13 16:52:14 +08:00
roymondchen
5e3125706c feat: 添加组件支持添加组合 2022-06-13 16:52:14 +08:00
roymondchen
c8c692b69c chore: 添加build:playgroun script 2022-06-13 16:52:14 +08:00
roymondchen
423059deac feat(playground): playground支持旋转操作 2022-06-09 21:03:32 +08:00
roymondchen
5271b08b3a chore: add release script 2022-06-09 20:55:04 +08:00
roymondchen
a90777f11a fix(form): daterange 错误信息不会消除 2022-06-09 20:16:26 +08:00
roymondchen
d97e265444 chore: vitest 配置添加alias 2022-06-09 19:22:05 +08:00
roymondchen
a9936b5276 feat(stage): 支持rotate scale fix #92 2022-06-09 19:22:05 +08:00
roymondchen
46b26328ef fix(runtime): 编辑器中组件的样式不生效 fix #109 2022-06-08 17:27:51 +08:00
roymondchen
ca4a6b596d test: jest 改成 vitest 2022-06-07 20:10:41 +08:00
roymondchen
a418bf14de style(ui): eslint fix 2022-06-07 16:25:41 +08:00
roymondchen
4944b27464 build: 移出lerna,改用pnpm 2022-06-07 16:25:41 +08:00
roymondchen
9af637408c 1.0.0-rc.6 2022-06-06 15:41:00 +08:00
roymondchen
cdabe36b93 fix(ui): 页面组件无法支持event配置 2022-06-06 15:28:47 +08:00
roymondchen
5d159ad9d8 fix(ui): img组件没有配置url是点击页面刷新 2022-06-06 15:28:47 +08:00
roymondchen
70292b92c8 feat(editor): contentmenu支持扩展 2022-06-06 15:28:47 +08:00
roymondchen
586711b9bd fix(editor): 置顶,置低逻辑弄反了 2022-06-06 15:28:47 +08:00
roymondchen
c99663a3e8 fix(editor): 右键菜单隐藏逻辑有问题 2022-06-06 15:28:47 +08:00
roymondchen
6eb1f2418a fix(editor): 复制组件后添加组件id一直是之前复制的组件的id 2022-06-06 15:28:47 +08:00
roymondchen
ce5ac67b2d fix(ui): default拼写错误 2022-06-06 15:28:47 +08:00
roymondchen
efef69e8ff build: 支持node 16 2022-06-01 18:15:55 +08:00
roymondchen
e0f8752773 v1.0.0-rc.5 2022-05-31 21:47:54 +08:00
roymondchen
0824602ad2 fix(stage): 流式布局下,镜像节点zindex应该比选中节点高 2022-05-31 21:47:54 +08:00
roymondchen
85164ec432 feat(stage): elementGuidelines可以配置 2022-05-31 21:47:54 +08:00
roymondchen
a320823992 fix(editor): 组件树右键菜单添加组件无效 2022-05-31 21:47:54 +08:00
roymondchen
663d7cee9f fix(editor): 添加组件默认添加到视窗中间,如果组件初始化height不是数值,则当0处理 2022-05-31 21:47:54 +08:00
roymondchen
805339422a fix(editor): 组件树右键菜单 2022-05-31 20:06:32 +08:00
roymondchen
1db52c36b4 docs: 文档描述修改 2022-05-31 16:03:00 +08:00
roymondchen
d2c936c5f0 v1.0.0-rc.4 2022-05-31 12:09:59 +08:00
roymondchen
31cbe7818f fix(editor): 右键菜单,mac触摸板上容易在菜单出现的时候触发当前鼠标位置的按钮 2022-05-31 12:09:59 +08:00
roymondchen
67e2ba3825 feat(stage): 增加对齐线 2022-05-31 12:09:59 +08:00
roymondchen
26081ea5cc fix(editor): 右键菜单粘贴的组件位置不对 2022-05-31 12:09:59 +08:00
roymondchen
c80dab835d fix(editor): 复制页面,页面名称重新生成 2022-05-31 12:09:59 +08:00
roymondchen
5bfb69b36d feat(playground): 更新默认页面配置 2022-05-27 19:11:33 +08:00
roymondchen
44aa56bd52 feat: 新增蒙层组件 2022-05-27 18:48:55 +08:00
roymondchen
0397c6887a feat(stage): runtime添加getApp方法 2022-05-27 18:48:55 +08:00
roymondchen
4a19017662 fix(editor): 组件配置width为100%时,水平居中失效 2022-05-27 18:48:55 +08:00
roymondchen
9addbddd63 fix(editor): 修复浏览器快捷键 2022-05-27 18:48:55 +08:00
roymondchen
b79963edf3 refactor(core): 去掉公共方法配置选项 2022-05-27 18:48:55 +08:00
roymondchen
d02e044293 refactor(editor): tabpane prop type 2022-05-27 18:48:55 +08:00
roymondchen
8452daf0e0 fix(stage): 页面小于画布时,滚动位置修复 2022-05-27 18:48:55 +08:00
roymondchen
019cfc7e93 feat(stage): 本地缓存参考线,刷新页面不会清空 2022-05-27 18:48:55 +08:00
roymondchen
ab4eaad0b7 refactor(stage): 添加注释 2022-05-27 18:48:55 +08:00
roymondchen
d84037e421 feat: 支持playground:vue2/playground:react命令
vue2 react runtime path 出错导致vue2 react playground运行出错;vue2中存在多个composition-api导致出错

fix #82 fix #68
2022-05-25 17:04:11 +08:00
roymondchen
1601cefb7f v1.0.0-rc.3 2022-05-25 14:27:43 +08:00
roymondchen
8c287ecace feat(ui): 添加二维码,图片组件 2022-05-25 14:22:28 +08:00
roymondchen
dbcd4201ea fix(stage): 只有当组件不在视窗内才自动滚动,新增scrollIntoView配置 2022-05-25 14:22:28 +08:00
roymondchen
e7b9123fd5 v1.0.0-rc.2 2022-05-24 21:24:54 +08:00
roymondchen
50937c2867 feat(editor): 选中组件,组件自动滚动到视窗内 2022-05-24 21:19:20 +08:00
parisma
91e2591495 refactor(admin): 管理端readme更新 2022-05-24 20:50:41 +08:00
parisma
fe821f7d84 fix(admin): 管理端更新编辑器的使用方式 2022-05-24 20:50:41 +08:00
roymondchen
216953611e build: 支持pnpm安装依赖,并支持pnpm playgournd
补充完整devDependencies

fix #83
2022-05-24 20:49:58 +08:00
roymondchen
2134d92d54 fix(editor): 源代码编辑器保存快捷键阻止冒泡 2022-05-24 20:49:58 +08:00
roymondchen
359fc5fdc6 feat(editor): 源代码编辑器支持扩展配置 2022-05-24 20:49:58 +08:00
roymondchen
64e751bdd8 refactor(editor): 拖动添加组件,避免覆盖默认样式 2022-05-24 20:49:58 +08:00
roymondchen
fbd7f80c4f feat(editor): feat(editor): 鼠标移出workpace,禁用快捷键 2022-05-24 20:49:58 +08:00
roymondchen
cf5e775b84 feat(editor): 添加globalThis兼容 2022-05-24 20:49:58 +08:00
roymondchen
d47828976a feat(stage): 选中节点时,给所有父节点添加一个className 2022-05-24 20:49:58 +08:00
roymondchen
bb97c4c6d0 fix(runtime): 获取dsl字段出错 2022-05-20 14:36:03 +08:00
roymondchen
662a3d61ea fix(form): popper弹层字体大小仅在form size为small的时候设置为12px 2022-05-19 14:54:24 +08:00
roymondchen
41dbb0ec80 v1.0.0-rc.1 2022-05-18 17:56:28 +08:00
roymondchen
2173691d7a build(utils): 构建产物不将依赖打入 2022-05-18 17:45:36 +08:00
roymondchen
04d7725db9 feat(editor): 属性表单大小配置;记住编辑器分栏宽度 2022-05-18 17:45:36 +08:00
roymondchen
1f93b4e93c refactor(form): select 暴露getOptions方法 2022-05-18 17:45:36 +08:00
roymondchen
155c22311d refactor(magic-admin): 升级vue-cli5 2022-05-18 15:43:31 +08:00
roymondchen
054e836859 fix(form): select group option key 出错导致页面卡死 #67 2022-05-17 16:21:40 +08:00
roymondchen
cf3dfde648 docs: 表单配置文档整理 2022-05-17 16:21:40 +08:00
roymondchen
6462dcebdf v1.0.0-beta.16 2022-05-17 16:21:40 +08:00
parisma
e6a511e4fe refactor(admin): 管理端启动所需runtime上传至git,省略开发者自行打包的步骤 2022-05-16 20:18:43 +08:00
roymondchen
17e8bbb7b4 refactor(editor): 调整zoomIn zommOut顺序 2022-05-13 20:45:31 +08:00
roymondchen
28d3ea0959 fix(form): label width为0时隐藏label 2022-05-13 20:45:31 +08:00
roymondchen
27a1ff8527 fix(editor): ui-select样式优化 2022-05-13 20:45:31 +08:00
roymondchen
2731609526 fix: 升级element-plus2.2.0后,sidebar动态变化后,顺序不对 2022-05-13 20:45:31 +08:00
roymondchen
1486beb52c fix: 升级element-plus2.2.0后,button默认样式变化 2022-05-13 20:45:31 +08:00
roymondchen
7dc54797d2 fix(editor): 代码编辑器大小变化没有自适应大小 2022-05-13 20:45:31 +08:00
roymondchen
f9d23a4423 build(playground): 增加@vitejs/plugin-legacy插件 2022-05-12 16:21:08 +08:00
parisma
e9e3691c79 refactor: 修复安全工单问题 2022-05-12 16:06:06 +08:00
roymondchen
00bc52c639 v1.0.0-beta.15 2022-05-11 18:40:00 +08:00
roymondchen
8eda764f1e chore: 修改sideEffects 2022-05-11 18:38:17 +08:00
roymondchen
75133ab6da refactor: update element-plus 2022-05-11 18:38:17 +08:00
parisma
86447ec4a1 fix: 管理端启动文档更新 2022-05-10 19:43:56 +08:00
roymondchen
946016686e build(runtime): schema构建后需要配置alias 2022-05-07 20:23:13 +08:00
jia000
6b5ad8c5ae Revert "feat(editor): 选中组件后自动滚动到组件位置"
This reverts commit d23a318003e9d6dad1480df560fb36ac3005554f.
2022-05-07 20:17:00 +08:00
roymondchen
d23a318003 feat(editor): 选中组件后自动滚动到组件位置 2022-05-07 19:58:37 +08:00
roymondchen
ca97e2410b v1.0.0-beta.14 2022-05-07 17:10:14 +08:00
roymondchen
3fcaeb9936 refactor(editor): 导出ToolButton组件 2022-05-07 17:05:54 +08:00
roymondchen
10349fb453 docs: 完善文档 2022-05-07 17:05:54 +08:00
roymondchen
88cc033e0d fix(form): row显隐不会触发 2022-05-07 17:05:54 +08:00
roymondchen
7d62c09c6b fix(editor): root为空时异常处理 2022-05-07 17:05:54 +08:00
roymondchen
327fc47aa1 test(editor): 右键菜单重构后,删除无效测试用例 2022-05-07 15:18:29 +08:00
roymondchen
73f433f6d0 build(schema): build schema 2022-05-07 15:18:29 +08:00
roymondchen
a0c3e25edb fix(editor): 删除全部页面后显示异常 2022-05-07 15:18:29 +08:00
roymondchen
d1610e5ff2 style(editor): 菜单样式优化 2022-05-07 15:18:29 +08:00
roymondchen
bcbd1f5d37 fix(editor): 删除组件后,组件树不更新 2022-05-07 15:18:29 +08:00
roymondchen
29e31e9cad chore: 组件默认值不需要带位置信息 2022-05-07 15:18:29 +08:00
roymondchen
5da8601f36 feat(editor): 支持拖拽添加组件 2022-05-07 15:18:29 +08:00
roymondchen
76b8d2314a fix(editor): mac下meta + v,meta + x快捷键无效 2022-05-07 15:18:29 +08:00
parisma
4f4ed9c61b fix: 删除无用的方法 2022-05-07 14:51:51 +08:00
roymondchen
b1aae65182 feat(editor): 增加editorService.move的扩展 2022-05-05 20:33:10 +08:00
roymondchen
f7bca02844 feat(playground): 增加字体样式配置 2022-05-05 20:33:10 +08:00
roymondchen
56375b0fb0 refactor(editor): 重构右键菜单 2022-05-05 20:33:10 +08:00
roymondchen
34eb57b37a docs(docs): 文档一些名词更新,失效链接修复 2022-04-29 17:49:17 +08:00
roymondchen
da89d5786a refactor(form): textarea去掉外层div 2022-04-29 17:49:17 +08:00
roymondchen
5e4b709d61 fix(editor): 组件列表中搜索栏层级问题 2022-04-29 17:49:17 +08:00
roymondchen
4ac1214e6a refactor(form): submitForm返回toRaw后的值 2022-04-29 17:49:17 +08:00
roymondchen
912639999d feat(table): action增加before配置 2022-04-29 17:49:17 +08:00
parisma
15b202a9be fix(highlight): 修复固定定位和弹窗场景下鼠标高亮偏移的问题 2022-04-28 20:50:08 +08:00
marchyang
a1ae3dd88d fix: 修复lock文件问题 2022-04-28 16:55:10 +08:00
marchyang
582962f6df fix: 修复单独使用@tmagic/editor,报错无法运行的问题 2022-04-28 16:55:10 +08:00
marchyang
cb99a6fff5 fix: 修复缺少buffer依赖,导致单独使用@tmagic/editor出现报错,无法运行的问题
safe-buffer是一个server端的库,使用了nodejs自带的buffer包,不支持浏览器环境,因此导致在运行时报错. 为解决此问题需要引入npm第三方包buffer来兼容浏览器环境.
2022-04-28 16:55:10 +08:00
marchyang
ec8867cbfd fix: 修复node版本16安装依赖失败的问题 2022-04-27 12:39:52 +08:00
roymondchen
b866b0fcea docs: 错别字修改 2022-04-26 21:04:48 +08:00
roymondchen
658337b4b2 build: npm script 兼容windows 2022-04-26 21:04:48 +08:00
parisma
d2220e7d0a docs(git-cz): 添加git-cz 2022-04-26 19:06:33 +08:00
parisma
c0803242c7 refactor: 文档更新 2022-04-26 19:06:33 +08:00
roymondchen
6df8ce82a5 fix(runtime): 修复window系统下npm run playground 出错问题 #29 2022-04-26 17:54:57 +08:00
roymondchen
c8542367db chore(stage): 升级moveable 2022-04-26 17:54:57 +08:00
roymondchen
f9ae10bc9d fix(playground): 预览检查是否保存 2022-04-22 13:24:31 +08:00
roymondchen
2f8f81afb3 v1.0.0-beta.13 2022-04-22 13:24:31 +08:00
roymondchen
51031fe8ab feat(editor): 添加常用快捷键 2022-04-22 12:16:39 +08:00
roymondchen
94debf51c0 fix(stage): 页面高度比画布小时,滚动画布出现异常 2022-04-22 12:16:39 +08:00
roymondchen
74b865f0f9 style(stage): 组件列表节点文案过长时会与右侧图标重叠 2022-04-22 12:16:39 +08:00
roymondchen
9efe4f04fc fix(editor): 删除的快捷键操作,不要对页面生效 2022-04-22 12:16:39 +08:00
roymondchen
9526c44d16 fix(editor): 由于有可选参数,所以将after hook的返回值放到第一个参数 2022-04-22 12:16:39 +08:00
roymondchen
8e004f9766 fix(editor): getLayout增加判断fixed 2022-04-22 12:16:39 +08:00
roymondchen
2647ace396 fix(utils): 判断是否为number不够严谨 2022-04-20 16:38:35 +08:00
roymondchen
1c8829fac9 fix(editor): 在小屏幕下画布的标尺显示不全 2022-04-20 16:38:35 +08:00
roymondchen
9d46305d2a chore: 更新npm依赖 2022-04-14 15:48:53 +08:00
roymondchen
9c540f569c v1.0.0-beta.12 2022-04-13 17:17:14 +08:00
roymondchen
0faabcb3ca fix(stage): 修复添加组件后没有自动选中问题 2022-04-13 17:17:14 +08:00
roymondchen
9cb821c491 fix(stage): 修复鼠标移出画布后,highlight没有清除 2022-04-13 17:17:14 +08:00
roymondchen
f7ba716fe9 fix(stage): 修复滚动容器大小发生变化时,导致滚动距离可能超出最大滚动值 2022-04-13 17:17:14 +08:00
roymondchen
a7351c9a02 fix(uitls): 添加package.json dependencies 2022-04-13 17:17:14 +08:00
roymondchen
90dd8381b1 refactor(form): 修改size类型定义 2022-04-13 17:17:14 +08:00
roymondchen
ed0a833d9f refactor(stage): hightlight throttleTime调整 2022-04-13 17:17:14 +08:00
roymondchen
db62427ee9 feat(editor): 新增删除、复制、粘贴、剪切快捷键操作 2022-04-13 17:17:14 +08:00
roymondchen
067164aadc docs: 添加packages readme 2022-04-13 17:17:14 +08:00
roymondchen
59c0a090b8 fix(form): 修复text append按钮大小 2022-04-13 17:17:14 +08:00
roymondchen
9ae93fc9f2 test: 修改测试用例 2022-04-13 17:17:14 +08:00
roymondchen
992ebbe3ce fix(editor): 修复新增组件时,组件列表配置的数据丢失问题 2022-04-13 17:17:14 +08:00
roymondchen
31373500c2 fix(editor): 切换组件时会连续触发两次表单初始化 2022-04-13 17:17:14 +08:00
roymondchen
554bc4b5c1 feat(form): number组件初始值尝试统一转换成number 2022-04-13 17:17:14 +08:00
roymondchen
959638c2c5 fix(editor): 修复fix布局的组件没有吸附效果问题 2022-04-13 17:17:14 +08:00
roymondchen
4d7b135e50 fix(form): 修复select过滤本地数据出错 2022-04-13 17:17:14 +08:00
roymondchen
0e74970bfe feat(editor): 新增组件自动设置到视窗中间 2022-04-13 17:17:14 +08:00
roymondchen
9c83a540da feat: 新增isPage,isNumber方法 2022-04-13 17:17:14 +08:00
roymondchen
575adb9a5e v1.0.0-beta.11 2022-04-07 19:59:19 +08:00
roymondchen
bb5e192dcd fix(editor): 修复历史状态变化后,画布没有更新 2022-04-07 19:59:19 +08:00
roymondchen
ece1bab5c0 v1.0.0-beta.10 2022-04-07 19:14:14 +08:00
roymondchen
038ef7cde4 fix(stage): import 了错误的log函数 2022-04-07 19:14:14 +08:00
parisma
121498e81b fix: 修复组件树中hover不存在的id导致高亮边框不消失的问题 2022-04-07 19:01:01 +08:00
parisma
a52d25fb70 fix: 修复快速点选拖动时有残影的问题 2022-04-07 19:01:01 +08:00
roymondchen
2e12812aac fix(form): tooltip丢失 2022-04-07 18:31:37 +08:00
roymondchen
57e815940b fix(table): 修复table设置expand后多一列object的问题 2022-04-07 18:31:37 +08:00
roymondchen
06b40c9c15 fix(editor): 修复code 代码编辑器光标错乱问题 2022-04-07 18:31:37 +08:00
roymondchen
71cfab8d4d feat(util): asyncLoadCss支持指定document 2022-04-07 18:31:37 +08:00
roymondchen
f896115881 feat(editor): 组件树保持展开当前选中节点的父节点 2022-04-07 18:31:37 +08:00
roymondchen
8676e02f2f test(editor): 修改测试用例 2022-04-07 18:31:37 +08:00
roymondchen
8390ba75be fix(editor): 从组件树选中没有渲染的组件时,需要等待组件渲染完成再初始化选中框 2022-04-07 18:31:37 +08:00
roymondchen
39dcd89acf fix(stage): 优化拖拽体验,当选中的节点变化时,重新创建moveable,如果没有变化则update状态 2022-04-07 18:31:37 +08:00
roymondchen
fe4c0fa2dc feat(schema): type可以为undefined,默认表现由使用方自行控制 2022-04-07 18:31:37 +08:00
roymondchen
b8d352a885 fix(editor): 新增service方法串行调用问题,解决连续快速拖动导致更新节点错乱问题 2022-04-07 18:31:37 +08:00
roymondchen
9746bab435 refactor(editor): stage组件直接响应stageCore的事件 2022-04-07 18:31:37 +08:00
roymondchen
97fa34bbc6 fix(editor): 添加或者删除节点后,选中状态没有刷新 2022-04-02 20:14:45 +08:00
roymondchen
ed9805f2b4 feat(editor): 修改默人属性面板宽度 2022-04-02 20:14:45 +08:00
roymondchen
97a722579d feat(editor): 组件树增加id和type过滤 2022-04-02 20:14:45 +08:00
roymondchen
29a9912820 fix(stage): canSelect增加event参数 2022-04-02 20:14:45 +08:00
roymondchen
9b849cc906 fix(editor): 修改pagebar过长无法滚动问题 2022-04-02 20:14:45 +08:00
roymondchen
a842c5b0ce feat: 优化拖拽体验 2022-04-02 12:56:54 +08:00
roymondchen
be4df0fc9b fix(editor): 组件树右键菜单子菜单出不来 2022-04-01 16:56:59 +08:00
roymondchen
faa6c6d9fe feat(editor): zoom 设置为button 2022-04-01 16:56:59 +08:00
roymondchen
fb64e078b9 feat(stage): moveable origin改为false 2022-04-01 16:56:59 +08:00
roymondchen
7e216e72f2 feat(form): select options函数配置添加prop参数 2022-04-01 16:56:59 +08:00
parisma
6a46f98766 fix: 修复页面滚动高亮偏移的问题 2022-04-01 15:35:02 +08:00
roymondchen
f500e51933 v1.0.0-beta.9 2022-03-31 19:46:12 +08:00
roymondchen
5350c9050c fix(editor): 修复pagebar文字超长换行问题 2022-03-31 19:46:12 +08:00
roymondchen
759b26481d fix(stage): 修复画布缩放后拖动鼠标漂移 2022-03-31 19:46:12 +08:00
roymondchen
cb4304b6eb feat(stage): 组件对齐不准确,暂时去掉 2022-03-31 19:46:12 +08:00
roymondchen
7f3d6c5438 feat(stage): 增加当前拖动的节点的z-index 2022-03-31 19:46:12 +08:00
roymondchen
bfdd813531 refactor(stage): 优化拖动体验 2022-03-31 19:46:12 +08:00
roymondchen
3dab16b2f6 fix(editor): 新增页面不用添加历史记录 2022-03-31 19:46:12 +08:00
roymondchen
6dbda7b565 style(editor): 将节点类型改成枚举 2022-03-31 19:46:12 +08:00
parisma
148d4547b0 fix: 修复throttle引起的问题 2022-03-31 15:16:32 +08:00
parisma
feb9ac9a81 feat: 编辑器支持鼠标悬停高亮组件 2022-03-31 15:16:32 +08:00
roymondchen
5a85e26443 v1.0.0-beta.8 2022-03-29 13:02:40 +08:00
roymondchen
8619af91db fix(stage): 这有overflow为auto或scroll才在选中的时候设置为hidden 2022-03-29 13:02:40 +08:00
roymondchen
c60e226f35 chore: 更新element-plus 2022-03-29 13:02:40 +08:00
roymondchen
f03281ac6c fix(stage): render destroy后移除load事件 2022-03-29 13:02:40 +08:00
roymondchen
504adcb017 fix(form): onChange、filter、trim函数调用异常处理 2022-03-29 13:02:40 +08:00
roymondchen
8e192e7cd4 feat: 新增select下的popper class 2022-03-29 13:02:40 +08:00
roymondchen
c3f4e41cc8 fix(playground): 新增页面默认width height 100% 2022-03-29 13:02:40 +08:00
roymondchen
30ad8502c4 fix(stage): drag的时候不update width height 2022-03-29 13:02:40 +08:00
roymondchen
8e2d83fec9 fix(stage): 混合布局下拖动错乱 2022-03-29 13:02:40 +08:00
roymondchen
4560562553 fix(stage): 页面默认滚动容器设置为documentElement 2022-03-29 13:02:40 +08:00
roymondchen
6becbdaa6b Revert "Revert "refactor(stage): 升级moveable""
This reverts commit 10ed55deea0c3dc7a97ac136a4065c447aaaf52a.
2022-03-29 13:02:40 +08:00
roymondchen
393889b27a fix(editor): 流式布局下,拖动后选中错误 2022-03-29 13:02:40 +08:00
roymondchen
2ade3d03f7 refactor: 重新设计stage不同布局下的实现 2022-03-28 15:47:49 +08:00
roymondchen
9252eb2ae0 v1.0.0-beta.7 2022-03-18 22:37:00 +08:00
roymondchen
10ed55deea Revert "refactor(stage): 升级moveable"
This reverts commit 9b8adf874c61d737c226f628fc06a42c4aa9f426.
2022-03-18 22:37:00 +08:00
roymondchen
42f1789c10 fix(editor): 切换布局失效 2022-03-18 22:37:00 +08:00
roymondchen
276b95a03c v1.0.0-beta.6 2022-03-17 23:44:12 +08:00
1093 changed files with 84089 additions and 80473 deletions

View File

@ -1,3 +0,0 @@
> 1%
last 2 versions
not dead

View File

@ -1,8 +0,0 @@
dist
coverage
node_modules
dest
comp-entry.ts
config-entry.ts
value-entry.ts

View File

@ -1,63 +0,0 @@
module.exports = {
env: {
node: true,
browser: true,
es2021: true,
},
globals: {
describe: true,
it: true,
expect: true,
jest: true,
beforeEach: true,
},
extends: [
'eslint-config-tencent',
'eslint-config-tencent/ts',
'plugin:vue/vue3-essential',
'eslint-config-tencent/prettier',
],
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 12,
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.vue'],
sourceType: 'module',
},
plugins: [
'vue',
'@typescript-eslint',
'simple-import-sort'
],
ignorePatterns: ['.eslintrc.js'],
rules: {
'vue/no-mutating-props': 'off',
'no-param-reassign': 'off',
'@typescript-eslint/no-require-imports': 'off',
'simple-import-sort/imports': [
"error", {
groups: [
['./polyfills'],
// Node.js builtins. You could also generate this regex if you use a `.js` config.
// For example: `^(${require("module").builtinModules.join("|")})(/|$)`
[
"^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)",
],
// Packages. `react|vue` related packages come first.
["^(react|vue|vite)", "^@?\\w"],
["^(@tmagic)(/.*|$)"],
// Internal packages.
["^(@|@editor)(/.*|$)"],
// Side effect imports.
["^\\u0000"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
// Style imports.
["^.+\\.s?css$"],
],
}
]
},
};

38
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

50
.github/workflows/pages.yml vendored Normal file
View File

@ -0,0 +1,50 @@
name: pages
on:
push:
branches: [dev]
workflow_dispatch:
jobs:
pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: dev
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Set node version to 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- run: pnpm bootstrap
- name: Build VuePress site
run: npm run docs:build
- name: Build Playground site
run: npm run build:playground
- name: clean dist
run: rm -rf dist
- name: mkdir dist
run: mkdir dist && mkdir dist/docs && mkdir dist/playground
- name: move to dist
run: mv docs/.vitepress/dist/* dist/docs && mv playground/dist/* dist/playground
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

12
.gitignore vendored
View File

@ -1,6 +1,11 @@
.DS_Store
node_modules
dist
types
.temp
.cache
temp
# local env files
.env.local
@ -22,3 +27,10 @@ pnpm-debug.log*
*.sw?
coverage
auto-imports.d.ts
components.d.ts
docs/.vitepress/cache
.eslintcache
.npmrc

View File

@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint --edit $1
npx --no-install commitlint --edit $1

View File

@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged
npx lint-staged && npm run check:type

View File

@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npm test

3315
CHANGELOG.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,7 @@ $ git clone git@github.com:<yourname>/tmagic-editor.git
```bash
$ git remote add <name> <url>
# 例如:
$ git remote add wepy git@github.com:Tencent/tmagic-editor.git
$ git remote add tmagic git@github.com:Tencent/tmagic-editor.git
```
#### 保持与 tmagic-editor 仓库的同步

View File

@ -1,6 +1,6 @@
Tencent is pleased to support the open source community by making TMagicEditor available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
Copyright (C) 2025 Tencent. All rights reserved.
TMagicEditor is licensed under the Apache License Version 2.0 except for the third-party components listed below.

View File

@ -16,18 +16,20 @@ https://tencent.github.io/tmagic-editor/playground/index.html
## 环境准备
node.js > 14
node.js >= 18
先安装lerna
pnpm >= 9
先安装 pnpm
```bash
$ npm install -g lerna
$ npm install -g pnpm
```
然后安装依赖
```bash
$ npm run bootstrap
$ pnpm bootstrap
```
## 运行项目
@ -35,15 +37,19 @@ $ npm run bootstrap
执行命令
```bash
$ npm run playground
$ pnpm playground
```
最后浏览器中打开
最后浏览器中打开
http://localhost:8098/
http://localhost:8098/tmagic-editor/playground/
即可得到一个魔方编辑器示例项目
## magic-admin
已迁移至 https://github.com/vft-magic/tmagic-admin
## 项目介绍
在本项目中,我们核心内容,是包含在 `packages/editor` 中的编辑器,以及 `runtime``packages/ui` 提供的各个前端框架相关的 runtime 和 ui。
@ -57,22 +63,33 @@ http://localhost:8098/
<img src="https://image.video.qpic.cn/oa_88b7d-32_509802977_1635842258505918" alt="魔方demo图">
### 页面渲染
runtime 是魔方提供的页面渲染环境。通过加载在编辑器中产出的 uiconfig,即可得到魔方编辑器希望拥有的最终产物,一个活动页面。我们提供了 vue2/vue3/react 几个版本的 runtime。
runtime 是魔方提供的页面渲染环境。通过加载在编辑器中产出的 DSL,即可得到魔方编辑器希望拥有的最终产物,一个活动页面。我们提供了 vue2/vue3/react 几个版本的 runtime。
通过魔方编辑器和 runtime 渲染,以及通过自定义的复杂组件开发,可以在魔方项目上,搭建出复杂而精美的页面。
<img src="https://image.video.qpic.cn/oa_7cf5e6-5_466783002_1637935497991411" width="375">
### 表单渲染
魔方的表单配置项,使用了我们开发的基于 element-ui 的 @tmagic/formmagic-form 也可以在其他地方单独使用。支持渲染 JS Schema 提供的表单描述。
魔方的表单配置项,使用了我们开发的基于 element-ui 的 @tmagic/form@tmagic/form 也可以在其他地方单独使用。支持渲染 JS Schema 提供的表单描述。
<img src="https://image.video.qpic.cn/oa_28dbde-2_1333081854_1637935825410557" >
### 使用
playground 的示例项目,就是为开发者提供的基础应用示例。开发者可以基于此或者参考自行实现,搭建一个基于魔方的可视化搭建平台。
tmagic-editor主要定位是搭建生成移动端H5页面如果有搭建PC端低代码平台的需求可以了解一下腾讯出品的另外一个低代码平台[无极低代码平台](https://wujicode.cn?from=tmagic)。
### 参与贡献
如果你有好的意见或建议,欢迎给我们提 Issues 或 Pull Requests为提升魔方可视化编辑器开发体验贡献力量。<br>详见:[CONTRIBUTING.md](./CONTRIBUTING.md)
[腾讯开源激励计划](https://opensource.tencent.com/contribution) 鼓励开发者的参与和贡献,期待你的加入。
## 贡献者
<a href="https://github.com/Tencent/tmagic-editor/graphs/contributors">
<img src="https://contrib.rocks/image?repo=Tencent/tmagic-editor" />
</a>
### 欢迎入群交流
<img src="https://vfiles.gtimg.cn/vupload/20220412/b85d331649748582992.jpg" width=375>

View File

@ -1,3 +0,0 @@
module.exports = {
presets: ['@vue/cli-plugin-babel/preset'],
};

View File

@ -1 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
export default { extends: ['@commitlint/config-conventional'] };

3
docs/.gitignore vendored
View File

@ -1,3 +0,0 @@
node_modules
.temp
.cache

575
docs/.vitepress/config.ts Normal file
View File

@ -0,0 +1,575 @@
import path from 'path';
import { defineConfig } from 'vitepress'
export default defineConfig({
title: 'tmagic-editor',
description: '页面可视化平台',
base: '/tmagic-editor/docs/',
head: [
['meta', { name: 'theme-color', content: '#646cff' }],
],
themeConfig: {
logo: './favicon.png',
search: {
provider: 'local'
},
socialLinks: [
{ icon: 'github', link: 'https://github.com/Tencent/tmagic-editor' }
],
footer: {
message: 'Powered by 腾讯视频会员平台技术中心',
copyright: 'Copyright (C) 2025 Tencent.'
},
nav: [
{ text: '文档', link: '/guide/', activeMatch: '/guide/' },
{ text: 'Editor API', link: '/api/editor/props', activeMatch: '/api/' },
{ text: 'Runtime API', link: '/runtime-api/core/app', activeMatch: '/runtime-api/' },
{ text: '表单配置', link: '/form-config/fields/text', activeMatch: '/form-config/' },
{ text: '更新日志', link: 'https://github.com/Tencent/tmagic-editor/releases' },
{ text: 'Playground', link: 'https://tencent.github.io/tmagic-editor/playground/index.html' },
],
sidebar: {
'/guide/': [
{
text: '文档',
items: [
{
text: '介绍',
link: '/guide/introduction.md'
},
{
text: '快速开始',
link: '/guide/'
},
{
text: 'RUNTIME',
link: '/guide/runtime.md'
},
{
text: '组件开发',
link: '/guide/component.md'
},
{
text: '基础概念',
link: '/guide/conception.md',
},
{
text: '页面发布',
link: '/guide/publish.md'
},
{
text: '编辑器扩展',
link: '/guide/editor-expand.md'
},
{
text: '升级到1.5.x',
link: '/guide/migration.md'
},
]
},
{
text: '进阶指南',
items: [
{
text: 'JS Schema',
link: '/guide/advanced/js-schema.md',
},
{
text: '布局原理',
link: '/guide/advanced/layout.md',
},
{
text: '页面渲染',
link: '/guide/advanced/page.md',
},
{
text: '联动原理',
link: '/guide/advanced/coupling.md',
},
{
text: '代码块',
link: '/guide/advanced/code-block.md',
},
{
text: '数据源',
link: '/guide/advanced/data-source.md'
},
{
text: '@tmagic/ui',
link: '/guide/advanced/tmagic-ui.md',
},
{
text: '@tmagic/form',
link: '/guide/advanced/tmagic-form.md',
},
],
},
{
text: '教程',
items: [
{
text: '写在前面',
link: '/guide/tutorial/'
},
{
text: '1.Hello World',
link: '/guide/tutorial/hello-world.md'
},
{
text: '2.Runtime',
link: '/guide/tutorial/runtime.md'
},
{
text: '3.DSL解析渲染',
link: '/guide/tutorial/render.md'
}
]
}
],
'/api/': [
{
text: '编辑器',
items: [
{
text: 'Editor组件',
items: [
{
text: 'props',
link: '/api/editor/props.md'
},
{
text: 'slots',
link: '/api/editor/slots.md'
},
{
text: 'events',
link: '/api/editor/events.md'
},
]
},
{
text: 'editorService',
items: [
{
text: '方法',
link: '/api/editor/editorServiceMethods.md',
},
{
text: '事件',
link: '/api/editor/editorServiceEvents.md',
},
],
},
{
text: 'propsService',
items: [
{
text: '方法',
link: '/api/editor/propsServiceMethods.md',
},
{
text: '事件',
link: '/api/editor/propsServiceEvents.md',
}
],
},
{
text: 'historyService',
items: [
{
text: '方法',
link: '/api/editor/historyServiceMethods.md',
},
{
text: '事件',
link: '/api/editor/historyServiceEvents.md',
}
],
},
{
text: 'eventsService',
link: '/api/editor/eventsServiceMethods.md',
},
{
text: 'uiService',
link: '/api/editor/uiServiceMethods.md',
},
{
text: 'codeBlockService',
link: '/api/editor/codeBlockServiceMethods.md',
},
{
text: 'componentListService',
link: '/api/editor/componentListServiceMethods.md',
},
{
text: 'storageService',
link: '/api/editor/storageServiceMethods.md',
},
]
},
{
text: '表单',
items: [
{
text: 'Form组件',
items: [
{
text: 'props',
link: '/api/form/form-props'
},
{
text: 'methods',
link: '/api/form/form-methods'
},
{
text: 'events',
link: '/api/form/form-events'
},
]
},
{
text: 'FormDialog组件',
items: [
{
text: 'props',
link: '/api/form/form-dialog-props'
},
{
text: 'methods',
link: '/api/form/form-dialog-methods'
},
{
text: 'events',
link: '/api/form/form-dialog-events'
},
]
},
],
},
{
text: '表格',
items: [
{
text: 'Table组件',
items: [
{
text: 'props',
link: '/api/table/props'
},
{
text: 'methods',
link: '/api/table/methods'
},
{
text: 'events',
link: '/api/table/events'
},
]
}
]
},
{
text: 'stage',
items: [
{
text: 'StageCore',
items: [
{
text: '方法',
link: '/api/stage/coreMethods',
},
{
text: '事件',
link: '/api/stage/coreEvents',
}
]
},
],
},
],
'/form-config/': [
{
text: '基础配置',
items: [
{
text: 'Input输入框',
link: '/form-config/fields/text.md'
},
{
text: 'Textarea文本域',
link: '/form-config/fields/textarea.md'
},
{
text: 'InputNumber计数器',
link: '/form-config/fields/number.md'
},
{
text: 'NumberRange数字范围',
link: '/form-config/fields/number-range.md'
},
{
text: 'Display只读文本',
link: '/form-config/fields/display.md'
},
{
text: 'Hidden隐藏域',
link: '/form-config/fields/hidden.md'
},
{
text: 'Link链接',
link: '/form-config/fields/link.md'
},
{
text: 'Checkbox多选框',
link: '/form-config/fields/checkbox.md'
},
{
text: 'Radio单选框',
link: '/form-config/fields/radio.md'
},
{
text: 'Switch开关',
link: '/form-config/fields/switch.md'
},
{
text: 'Select选择器',
link: '/form-config/fields/select.md'
},
{
text: 'Cascader级联选择器',
link: '/form-config/fields/cascader.md'
},
{
text: 'ColorPicker颜色选择器',
link: '/form-config/fields/color-picker.md'
},
{
text: 'DatePick日期选择器',
link: '/form-config/fields/date-picker.md'
},
{
text: 'DateRangePick日期范围选择器',
link: '/form-config/fields/daterange-picker.md'
},
{
text: 'DatetimePick日期时间选择器',
link: '/form-config/fields/datetime-picker.md'
},
{
text: 'TimePick时间选择器',
link: '/form-config/fields/time-picker.md'
},
{
text: 'TimeRangePick时间范围选择器',
link: '/form-config/fields/timerange-picker.md'
},
{
text: 'DynamicField动态表单',
link: '/form-config/fields/dynamic-field.md'
}
]
},
{
text: '编辑器中可用配置',
items: [
{
text: 'Code代码编辑器',
link: '/form-config/editor-fields/code.md'
},
{
text: 'CodeLink代码链接',
link: '/form-config/editor-fields/code-link.md'
},
{
text: 'CodeSelect代码块选择器',
link: '/form-config/editor-fields/code-select.md'
},
{
text: 'CodeSelectCol代码块选择列',
link: '/form-config/editor-fields/code-select-col.md'
},
{
text: 'DataSourceSelect数据源选择器',
link: '/form-config/editor-fields/data-source-select.md'
},
{
text: 'DataSourceFieldSelect数据源字段选择器',
link: '/form-config/editor-fields/data-source-field-select.md'
},
{
text: 'DataSourceMethodSelect数据源方法选择器',
link: '/form-config/editor-fields/data-source-method-select.md'
},
{
text: 'DataSourceFields数据源字段配置',
link: '/form-config/editor-fields/data-source-fields.md'
},
{
text: 'DataSourceInput数据源输入框',
link: '/form-config/editor-fields/data-source-input.md'
},
{
text: 'DataSourceMethods数据源方法配置',
link: '/form-config/editor-fields/data-source-methods.md'
},
{
text: 'DataSourceMocks数据源Mock配置',
link: '/form-config/editor-fields/data-source-mocks.md'
},
{
text: 'UISelect组件选择器',
link: '/form-config/editor-fields/ui-select.md'
},
{
text: 'KeyValue键值对',
link: '/form-config/editor-fields/key-value.md'
},
{
text: 'PageFragmentSelect页面片选择器',
link: '/form-config/editor-fields/page-fragment-select.md'
},
{
text: 'EventSelect事件选择器',
link: '/form-config/editor-fields/event-select.md'
},
{
text: 'DisplayConds显示条件配置',
link: '/form-config/editor-fields/display-conds.md'
},
{
text: 'CondOpSelect条件操作选择器',
link: '/form-config/editor-fields/cond-op-select.md'
}
],
},
{
text: '布局配置',
items: [
{
text: '布局',
link: '/form-config/layout.md',
}
]
},
{
text: '联动配置',
items: [
{
text: '联动',
link: '/form-config/relate.md',
}
]
},
{
text: '表单对比',
items: [
{
text: '表单对比',
link: '/form-config/compare.md',
}
]
}
],
'/runtime-api/': [
{
text: '@tmagic/core',
items: [
{
text: 'App',
link: '/runtime-api/core/app',
},
{
text: 'Node',
link: '/runtime-api/core/node',
},
{
text: 'Page',
link: '/runtime-api/core/page',
},
{
text: 'EventHelper',
link: '/runtime-api/core/eventHelper',
},
{
text: 'Env',
link: '/runtime-api/core/env',
},
{
text: 'IteratorContainer',
link: '/runtime-api/core/iteratorContainer',
},
{
text: 'FlowState',
link: '/runtime-api/core/flowState',
},
{
text: 'DevtoolApi',
link: '/runtime-api/core/devtoolApi',
},
{
text: '工具函数',
link: '/runtime-api/core/utils',
},
],
},
{
text: '@tmagic/data-source',
items: [
{
text: 'DataSourceManager',
link: '/runtime-api/data-source/dataSourceManager',
},
{
text: 'DataSource',
link: '/runtime-api/data-source/dataSource',
},
{
text: 'HttpDataSource',
link: '/runtime-api/data-source/httpDataSource',
},
{
text: '观察者数据类',
link: '/runtime-api/data-source/observedData',
},
{
text: '工具函数',
link: '/runtime-api/data-source/utils',
},
],
},
]
},
},
vite: {
optimizeDeps: {
esbuildOptions: {
define: {
global: 'globalThis',
},
},
},
resolve: {
alias:[
{ find: /^@tmagic\/form-schema/, replacement: path.join(__dirname, '../../packages/form-schema/src/index.ts') },
{ find: /^@tmagic\/form/, replacement: path.join(__dirname, '../../packages/form/src/index.ts') },
{ find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../../packages/utils/src/index.ts') },
{ find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../../packages/schema/src/index.ts') },
{ find: /^@tmagic\/design/, replacement: path.join(__dirname, '../../packages/design/src/index.ts') },
{ find: /^@tmagic\/element-plus-adapter/, replacement: path.join(__dirname, '../../packages/element-plus-adapter/src/index.ts') },
]
},
ssr: {
noExternal: ['lodash-es'],
}
}
});

View File

@ -17,37 +17,23 @@
<slot name="highlight"></slot>
</div>
</div>
<div
class="demo-block-control"
ref="control"
:class="{ 'is-fixed': fixedControl }"
@click="isExpanded = !isExpanded"
>
<div class="demo-block-control" ref="control" @click="isExpanded = !isExpanded">
<transition name="arrow-slide">
<i :class="[iconClass, { hovering: hovering }]"></i>
<i :class="[iconClass, hovering]"></i>
</transition>
<transition name="text-slide">
<span v-show="hovering">{{ controlText }}</span>
<span>{{ controlText }}</span>
</transition>
<el-tooltip effect="dark" :content="'前往 codepen.io 运行此示例'" placement="right">
<transition name="text-slide">
<el-button
v-show="hovering || isExpanded"
size="small"
type="text"
class="control-button"
@click.stop="goCodepen"
>
{{type === 'form' ? '查看结果' : '在线运行'}}
<el-button size="small" type="primary" text class="control-button" @click.stop="goCodepen">
{{ type === 'form' ? '查看结果' : '在线运行' }}
</el-button>
</transition>
</el-tooltip>
</div>
<el-dialog
v-model="resultVisible"
title="result"
>
<el-dialog v-model="resultVisible" title="result">
<pre><code class="language-javascript hljs" v-html="result"></code></pre>
</el-dialog>
</div>
@ -61,7 +47,9 @@
transition: 0.2s;
&.hover {
box-shadow: 0 0 8px 0 rgba(232, 237, 250, 0.6), 0 2px 4px 0 rgba(232, 237, 250, 0.5);
box-shadow:
0 0 8px 0 rgba(232, 237, 250, 0.6),
0 2px 4px 0 rgba(232, 237, 250, 0.5);
}
code {
@ -187,7 +175,7 @@
.control-button {
line-height: 26px;
position: absolute;
top: 0;
top: 10px;
right: 0;
font-size: 14px;
padding-left: 5px;
@ -197,8 +185,9 @@
}
</style>
<script type="text/babel" lang="ts">
<script lang="ts">
import hljs from 'highlight.js';
import serialize from 'serialize-javascript';
export function stripScript(content) {
const result = content.match(/<(script)>([\s\S]+)<\/\1>/);
@ -219,9 +208,7 @@ export function stripTemplate(content) {
}
export default {
props: [
'type', 'config'
],
props: ['type', 'config'],
data() {
return {
@ -293,9 +280,15 @@ export default {
},
text() {
return this.isStringConfig ?
hljs.highlight('js', this.config).value :
hljs.highlight('json', JSON.stringify(this.config, null, 2)).value;
return this.isStringConfig
? hljs.highlight('js', this.config).value
: hljs.highlight(
'js',
serialize(this.config, {
space: 2,
unsafe: true,
}).replace(/"(\w+)":\s/g, '$1: '),
).value;
},
formConfig() {
@ -304,7 +297,7 @@ export default {
isStringConfig() {
return typeof this.config === 'string';
}
},
},
watch: {
@ -353,7 +346,7 @@ export default {
});
},
beforeDestroy() {
beforeUnmount() {
this.removeScrollHandler();
},
};

View File

@ -0,0 +1,46 @@
import 'element-plus/dist/index.css';
import 'highlight.js/styles/github.css';
import ElementPlus from 'element-plus';
import Theme from 'vitepress/theme';
import TMagicDesign from '@tmagic/design';
import MagicElementPlusAdapter from '@tmagic/element-plus-adapter';
import MagicForm from '@tmagic/form';
import DemoBlock from './components/demo-block.vue';
import './styles/vars.css';
export default {
...Theme,
enhanceApp({ app }) {
app.use(ElementPlus);
app.use(TMagicDesign, MagicElementPlusAdapter)
app.use(MagicForm, {
request: (options: any) => new Promise((resolve) => {
if (options.url === 'select/remote') {
setTimeout(() => {
resolve({
data: [
{
name: 'select-1',
id: 1
},
{
name: 'select-2',
id: 2
},
],
});
}, 1000);
} else {
resolve({});
}
}),
});
app.component('demo-block', DemoBlock);
},
};

View File

@ -0,0 +1,10 @@
:root {
--vp-c-brand: #2882e0;
--vp-button-brand-border: #2882e0;
--vp-button-brand-hover-border: #2882e0;
--vp-c-brand-light: #559ce7;
--vp-c-brand-lighter: #2882e0;
--vp-c-brand-lightest: #2882e0;
--vp-c-brand-dark: #2882e0;
--vp-c-brand-darker: #2882e0;
}

View File

@ -0,0 +1,370 @@
# codeBlockService方法
## setCodeDsl
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## getCodeDsl
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## getCodeContentById
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## setCodeDslById
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## getCodeDslByIds
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## setCodeEditorShowStatus
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## getCodeEditorShowStatus
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## setCodeEditorContent
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## getCurrentDsl
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## getEditStatus
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
## setEditStatus
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## setId
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## getId
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## getMode
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## setMode
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## setCombineIds
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## getCombineIds
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## refreshAllRelations
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## getCombineInfo
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## getUndeletableList
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## setUndeleteableList
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## setCodeDraft
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## getCodeDraft
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## removeCodeDraft
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## deleteCodeDslByIds
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## getUniqueId
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## deleteCompsInRelation
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## destroy
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
## use
使用中间件的方式扩展方法,上述方法中标记有`扩展支持: 是`的方法都支持使用use扩展
## usePlugin
- **详情:**
相对于[use](#use), usePlugin支持更加灵活更加细致的扩展 上述方法中标记有`扩展支持: 是`的方法都支持使用usePlugin扩展
每个支持扩展的方法都支持定制before、after两个hook来干预原有方法的行为before可以用于修改传入参数after可以用于修改返回的值
## removeAllPlugins
- **详情:**
删掉当前设置的所有扩展

View File

@ -0,0 +1,104 @@
# componentListService方法
## setList
- **参数:**
- {[ComponentGroup](https://github.com/Tencent/tmagic-editor/blob/5880dfbe15fcead63e9dc7c91900f8c4e7a574d8/packages/editor/src/type.ts#L355)[]} componentGroupList 组件列表配置
- **返回:**
- `{void}`
- **详情:**
设置左侧面板的组件列表配置
:::tip
该方法通常由编辑器内部调用,开发者可以通过 [m-editor 的 componentGroupList prop](./props.md#componentgrouplist) 来配置组件列表
:::
- **示例:**
```js
import { componentListService } from '@tmagic/editor';
componentListService.setList([
{
title: '基础组件',
items: [
{
icon: 'text-icon',
text: '文本',
type: 'text',
},
{
icon: 'button-icon',
text: '按钮',
type: 'button',
},
],
},
]);
```
## getList
- **参数:**
- **返回:**
- {[ComponentGroup](https://github.com/Tencent/tmagic-editor/blob/5880dfbe15fcead63e9dc7c91900f8c4e7a574d8/packages/editor/src/type.ts#L355)[]} 组件列表配置
- **详情:**
获取当前的组件列表配置
- **示例:**
```js
import { componentListService } from '@tmagic/editor';
const list = componentListService.getList();
console.log(list);
```
## resetState
- **参数:**
- **返回:**
- `{void}`
- **详情:**
重置组件列表状态,清空所有配置
- **示例:**
```js
import { componentListService } from '@tmagic/editor';
componentListService.resetState();
```
## destroy
- **参数:**
- **返回:**
- `{void}`
- **详情:**
销毁 componentListService清空状态并移除所有事件监听和插件
- **示例:**
```js
import { componentListService } from '@tmagic/editor';
componentListService.destroy();
```

View File

@ -0,0 +1,541 @@
# dataSourceService方法
## get
- **参数:**
- `{StateKey}` name 状态键名
- **返回:**
- `{any}` 对应的状态值
- **详情:**
获取数据源服务的内部状态
可用的状态键:
- `datasourceTypeList`: 数据源类型列表
- `dataSources`: 当前数据源列表
- `editable`: 是否可编辑
- `configs`: 数据源表单配置
- `values`: 数据源默认值
- `events`: 数据源事件列表
- `methods`: 数据源方法列表
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
const dataSources = dataSourceService.get('dataSources');
console.log(dataSources);
```
## set
- **参数:**
- `{StateKey}` name 状态键名
- `{any}` value 状态值
- **返回:**
- `{void}`
- **详情:**
设置数据源服务的内部状态
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
dataSourceService.set('editable', false);
```
## getFormConfig
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` type 数据源类型,默认为 'base'
- **返回:**
- {[FormConfig](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/form/src/schema.ts#L706)} 表单配置
- **详情:**
获取指定类型数据源的表单配置
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
const config = dataSourceService.getFormConfig('http');
console.log(config);
```
## setFormConfig
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` type 数据源类型
- {[FormConfig](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/form/src/schema.ts#L706)} config 表单配置
- **返回:**
- `{void}`
- **详情:**
设置指定类型数据源的表单配置
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
dataSourceService.setFormConfig('http', [
{
name: 'url',
text: '请求地址',
type: 'text',
},
{
name: 'method',
text: '请求方法',
type: 'select',
options: [
{ text: 'GET', value: 'GET' },
{ text: 'POST', value: 'POST' },
],
},
]);
```
## getFormValue
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` type 数据源类型,默认为 'base'
- **返回:**
- {Partial<[DataSourceSchema](https://github.com/Tencent/tmagic-editor/blob/5880dfbe15fcead63e9dc7c91900f8c4e7a574d8/packages/schema/src/index.ts#L221)>} 数据源默认值
- **详情:**
获取指定类型数据源的默认值
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
const defaultValue = dataSourceService.getFormValue('http');
console.log(defaultValue);
```
## setFormValue
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` type 数据源类型
- {Partial<[DataSourceSchema](https://github.com/Tencent/tmagic-editor/blob/5880dfbe15fcead63e9dc7c91900f8c4e7a574d8/packages/schema/src/index.ts#L221)>} value 数据源默认值
- **返回:**
- `{void}`
- **详情:**
设置指定类型数据源的默认值
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
dataSourceService.setFormValue('http', {
type: 'http',
method: 'GET',
url: '',
});
```
## getFormEvent
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` type 数据源类型,默认为 'base'
- **返回:**
- {[EventOption](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/core/src/events.ts#L26-L29)[]} 事件列表
- **详情:**
获取指定类型数据源的事件列表
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
const events = dataSourceService.getFormEvent('http');
console.log(events);
```
## setFormEvent
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` type 数据源类型
- {[EventOption](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/core/src/events.ts#L26-L29)[]} value 事件列表
- **返回:**
- `{void}`
- **详情:**
设置指定类型数据源的事件列表
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
dataSourceService.setFormEvent('http', [
{ label: '请求成功', value: 'success' },
{ label: '请求失败', value: 'error' },
]);
```
## getFormMethod
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` type 数据源类型,默认为 'base'
- **返回:**
- {[EventOption](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/core/src/events.ts#L26-L29)[]} 方法列表
- **详情:**
获取指定类型数据源的方法列表
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
const methods = dataSourceService.getFormMethod('http');
console.log(methods);
```
## setFormMethod
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` type 数据源类型
- {[EventOption](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/core/src/events.ts#L26-L29)[]} value 方法列表
- **返回:**
- `{void}`
- **详情:**
设置指定类型数据源的方法列表
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
dataSourceService.setFormMethod('http', [
{ label: '发起请求', value: 'request' },
{ label: '重试', value: 'retry' },
]);
```
## add
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {[DataSourceSchema](https://github.com/Tencent/tmagic-editor/blob/5880dfbe15fcead63e9dc7c91900f8c4e7a574d8/packages/schema/src/index.ts#L221)} config 数据源配置
- **返回:**
- {[DataSourceSchema](https://github.com/Tencent/tmagic-editor/blob/5880dfbe15fcead63e9dc7c91900f8c4e7a574d8/packages/schema/src/index.ts#L221)} 添加后的数据源配置
- **详情:**
添加一个数据源如果配置中没有id或id已存在会自动生成新的id
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
const newDs = dataSourceService.add({
type: 'http',
title: '用户信息',
url: '/api/user',
method: 'GET',
});
console.log(newDs.id); // 自动生成的id
```
## update
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {[DataSourceSchema](https://github.com/Tencent/tmagic-editor/blob/5880dfbe15fcead63e9dc7c91900f8c4e7a574d8/packages/schema/src/index.ts#L221)} config 数据源配置
- `{Object}` options 可选配置
- {[ChangeRecord](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/form/src/schema.ts#L27-L39)[]} changeRecords 变更记录
- **返回:**
- {[DataSourceSchema](https://github.com/Tencent/tmagic-editor/blob/5880dfbe15fcead63e9dc7c91900f8c4e7a574d8/packages/schema/src/index.ts#L221)} 更新后的数据源配置
- **详情:**
更新数据源
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
const updatedDs = dataSourceService.update({
id: 'ds_123',
type: 'http',
title: '用户详情',
url: '/api/user/detail',
});
console.log(updatedDs);
```
## remove
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` id 数据源id
- **返回:**
- `{void}`
- **详情:**
删除指定id的数据源
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
dataSourceService.remove('ds_123');
```
## createId
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- **返回:**
- `{string}` 生成的唯一id
- **详情:**
生成一个唯一的数据源id格式为 `ds_` + guid
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
const id = dataSourceService.createId();
console.log(id); // 'ds_xxx-xxx-xxx'
```
## getDataSourceById
- **参数:**
- `{string}` id 数据源id
- **返回:**
- {[DataSourceSchema](https://github.com/Tencent/tmagic-editor/blob/5880dfbe15fcead63e9dc7c91900f8c4e7a574d8/packages/schema/src/index.ts#L221) | undefined} 数据源配置
- **详情:**
根据id获取数据源配置
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
const ds = dataSourceService.getDataSourceById('ds_123');
console.log(ds);
```
## copyWithRelated
- **参数:**
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99) | [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)[]} config 组件节点配置
- `{TargetOptions}` collectorOptions 可选的收集器配置
- **返回:**
- `{void}`
- **详情:**
复制组件时会带上组件关联的数据源,将关联的数据源存储到 localStorage
- **示例:**
```js
import { dataSourceService, editorService } from '@tmagic/editor';
const node = editorService.get('node');
dataSourceService.copyWithRelated(node);
```
## paste
- **参数:**
- **返回:**
- `{void}`
- **详情:**
粘贴数据源,从 localStorage 中读取复制的数据源并添加到当前页面
如果数据源id已存在则不会覆盖
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
dataSourceService.paste();
```
## resetState
- **参数:**
- **返回:**
- `{void}`
- **详情:**
重置数据源服务状态,清空所有数据源
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
dataSourceService.resetState();
```
## destroy
- **参数:**
- **返回:**
- `{void}`
- **详情:**
销毁 dataSourceService移除所有事件监听并重置状态
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
dataSourceService.destroy();
```
## usePlugin
- **详情:**
相对于[use](#use), usePlugin支持更加灵活更加细致的扩展 上述方法中标记有`扩展支持: 是`的方法都支持使用usePlugin扩展
每个支持扩展的方法都支持定制before、after两个hook来干预原有方法的行为before可以用于修改传入参数after可以用于修改返回的值
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
dataSourceService.usePlugin({
beforeAdd(config) {
console.log('添加前:', config);
return [config];
},
afterAdd(result, config) {
console.log('添加后:', result);
return result;
},
});
```
## removeAllPlugins
- **详情:**
删掉当前设置的所有扩展
- **示例:**
```js
import { dataSourceService } from '@tmagic/editor';
dataSourceService.removeAllPlugins();
```

View File

@ -0,0 +1,40 @@
# editorService事件
## root-change
- **详情:** dsl跟节点发生变化[editorService.set('root', {})](./editorServiceMethods.md#set)后触发
- **回调函数:** (value: [MApp](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/schema/src/index.ts?plain=1#L66-L73), preValue: [MApp](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/schema/src/index.ts?plain=1#L66-L73)) => void
## select
- **详情:** 选中组件,[editorService.select()](./editorServiceMethods.md#select)后触发
- **回调函数:** (node: [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)) => void
## add
- **详情:** 选中组件,[editorService.add()](./editorServiceMethods.md#add)后触发
- **回调函数:** (node: [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)[]) => void
## remove
- **详情:** 选中组件,[editorService.remove()](./editorServiceMethods.md#remove)后触发
- **回调函数:** (node: [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)[]) => void
## update
- **详情:** 选中组件,[editorService.update()](./editorServiceMethods.md#update)后触发
- **回调函数:** (node: [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)[]) => void
## history-change
- **详情:** 历史记录改变,[editorService.redo()editorService.undo()](./editorServiceMethods.html#undo)后触发
- **回调函数:** (node: [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)) => void

View File

@ -0,0 +1,665 @@
# editorService方法
## get
- **参数:**
- `{'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes' | 'modifiedNodeIds' | 'pageLength' | 'stage'} name`
- **返回:**
- `{any} value`
- **详情:**
获取当前指指定name的值
'root': 当前整个配置,也就是当前编辑器的值
'page': 当前正在编辑的页面配置
'parent': 当前选中的节点的父节点
'node': 当前选中的第一个节点
'highlightNode': 当前高亮的节点
'nodes': 当前选中的所有节点
'modifiedNodeIds': 当前页面所有改动过的节点id
'pageLength': 所以页面个数
'stage': [StageCore](../stage/coreMethods.md)实例
- **示例:**
```js
import { editorService } from '@tmagic/editor';
const node = editorService.get('node');
```
## set
- `{'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes' | 'modifiedNodeIds' | 'pageLength' | 'stage'} name`
- `{any} value`
- **详情:**
参考[get](#get)方法
- **示例:**
```js
import { editorService } from '@tmagic/editor';
const node = editorService.get('node');
editorService.set('node', {
...node,
name: 'new name'
});
```
## getNodeInfo
- **参数:**
- `{number | string}` id 组件id
- `{boolean}` raw 是否使用toRaw默认为true
:::tip
如果raw为false对获取到的对象进行操作会触发vue响应式处理
:::
- **返回:**
- {[EditorNodeInfo](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/editor/src/type.ts#L139-L143)}
- **详情:**
根据id获取组件、组件的父组件以及组件所属的页面节点
- **示例:**
```js
import { editorService } from '@tmagic/editor';
const info = editorService.getNodeInfo('text_123');
console.log(info.node);
console.log(info.parent);
console.log(info.page);
```
## getNodeById
- **参数:**
- `{number | string}` id
- `{boolean}` raw 是否使用toRaw默认为true
- **返回:**
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)} 组件节点配置
- **详情:**
根据id获取组件的信息
- **示例:**
```js
import { editorService } from '@tmagic/editor';
const node = editorService.getNodeById('text_123');
console.log(node);
```
## getParentById
- **参数:**
- `{number | string}` id
- `{boolean}` raw 是否使用toRaw默认为true
- **返回:**
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)} 指点组件的父节点配置
- **详情:**
根据ID获取指点节点的父节点配置
- **示例:**
```js
import { editorService } from '@tmagic/editor';
const parent = editorService.getParentById('text_123');
console.log(parent);
```
## getLayout
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)} parent
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)} node 可选
- **返回:**
- {Promise<[Layout](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/editor/src/type.ts#L297-L302)>} 当前布局模式
- **详情:**
只有容器拥有布局目前支持的布局有流式布局relative绝对定位布局absolute固定定位布局fixed
:::tip
固定定位布局需要从当前选中节点判断,固需要传递可选参数 node
其他布局则是从父组件(容器)来判断
:::
- **示例:**
```js
import { editorService } from '@tmagic/editor';
const parent = editorService.getParentById('text_123');
editorService.getLayout(parent).then((layout) => {
console.log(parent);
});
```
## select
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {number | string | [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)} config 需要选中的节点或节点ID
- **返回:**
- {Promise<[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)>} 当前选中的节点配置
- **详情:**
选中指点节点(将指点节点设置成当前选中状态)
:::tip
editorService.select只是设置了编辑器的选中状态并没有设置画布的选中状态所以根据实际情况可以调用[stage.select](../stage/coreMethods.md#select)来设置画布的选中态
:::
- **示例:**
```js
import { editorService } from '@tmagic/editor';
editorService.select('text_123');
editorService.get('stage')?.select('text_123');
```
## multiSelect
- **参数:**
- {(number | string)[]} ids 需要选中的节点ID集合
- **返回:**
- `{Promise<void>}`
- **详情:**
选中多个节点
:::tip
editorService.multiSelect只是设置了编辑器的选中状态并没有设置画布的选中状态所以根据实际情况可以调用[stage.multiSelect](../stage/coreMethods.md#multiSelect)来设置画布的选中态
:::
- **示例:**
```js
import { editorService } from '@tmagic/editor';
editorService.multiSelect(['text_123', 'button_123']);
editorService.get('stage')?.multiSelect(['text_123', 'button_123']);
```
## highlight
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {number | string | [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)} config 需要高亮的节点或节点ID
- **返回:**
- `{Promise<void>}`
- **详情:**
高亮指定节点
- **示例:**
```js
import { editorService } from '@tmagic/editor';
editorService.highlight('text_123');
```
## doAdd
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)} node 新组件节点
- {[MContainer](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L54-L59)} parent 指定的容器节点
- **返回:**
- {Promise<[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)>} 新增的组件
- **详情:**
往指定的容器中添加组件
## add
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99) | [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)[]} node 新组件节点配置或多个节点集合
- {[MContainer](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L54-L59)} parent 指定的容器组件节点配置,如果不设置,默认为当前选中的组件的父节点
- **返回:**
- {Promise<[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99) | [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)[]>} 新增的组件或组件集合
- **详情:**
往指定的容器或当前容器中添加组件
:::tip
**与[doAdd](#doadd)的区别:**
add可以支持一次添加多个组件add是通过调用[doAdd](#doadd)来最终实现添加的。
编辑器内部添加组件都是调用add来实现的add除了添加操作外还会记录历史堆栈还会更新编辑中相关的状态而[doAdd](#doadd)就仅仅是完成添加的行为
:::
## doRemove
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)} node 要删除的节点
- **返回:**
- `{Promise<void>}`
- **详情:**
删除指定的组件或者页面
## remove
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99) | [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)[])} node 要删除的节点或节点集合
- **返回:**
- `{Promise<void>}`
- **详情:**
删除指定的组件或者页面或组件集合
:::tip
**与[doRemove](#doRemove)的区别:**
remove可以支持一次删除多个组件remove是通过调用[doRemove](#doRemove)来最终实现删除的。
编辑器内部删除组件都是调用remove来实现的remove除了删除操作外还会记录历史堆。
:::
## doUpdate
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99) | [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99))} node 新的节点
- **返回:**
- {Promise<[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99) | [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)>} 新的节点
- **详情:**
更新节点
:::tip
节点中应该要有id不然不知道要更新哪个节点
:::
## update
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {Promise<[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99) | [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)[]>} node 新的节点或节点集合
- **返回:**
- {Promise<[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99) | [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)[]>} 新的节点或节点集合
- **详情:**
更新单个或多个节点
:::tip
**与[doUpdate](#doupdate)的区别:**
update可以支持一次更新多个组件update是通过调用[doUpdate](#doupdate)来最终实现更新的。
编辑器内部更新组件都是调用update来实现的update除了更新操作外还会记录历史堆还会更新[代码块](../../guide/advanced/code-block.md)关系链。
:::
## sort
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{ string | number }` id1
- `{ string | number }` id2
- **返回:**
- `{Promise<void>}`
- **详情:**
将id为id1的组件移动到id为id2的组件位置上例如[1,2,3,4] -> sort(1,3) -> [2,1,3,4]
用于流式布局下的组件拖动更新
## copy
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {Promise<[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99) | [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)[]>} node 需要复制的节点或节点集合
- **返回:**
- `{Promise<void>}`
- **详情:**
复制组件节点或节点集合
通过[storageService.setItem](./storageServiceMethods.md#setitem),将组将节点配置转化成string然后存储到localStorage中
## doPaste
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
-
- **返回:**
- `{Promise<void>}`
- **详情:**
粘贴前置操作返回分配了新id以及校准了坐标的配置
## paste
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {[PastePosition](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/type.ts#L152-L163)} position 粘贴的坐标
- **返回:**
- {Promise<[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99) | [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)[]>} 添加后的组件节点配置
- **详情:**
粘贴组件节点或节点集合
通过[storageService.getItem](./storageServiceMethods.md#setitem),从localStorage中获取节点然后添加到当前容器中
## doAlignCenter
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)} config 需要居中的组件
- **返回:**
- {Promise<[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)>}
- **详情:**
水平居中组件节点,仅在[流式布局](../../guide/advanced/layout.md)下有效
:::warning
仅是计算出left并未更新到编辑器中
:::
## alignCenter
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {Promise<[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99) | [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)[]>} config 需要居中的组件或者组件集合
- **返回:**
- {Promise<[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99) | [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)[]>}
- **详情:**
水平居中组件或者组件集合,仅在[流式布局](../../guide/advanced/layout.md)下有效
:::tip
**与[doAlignCenter](#doaligncentere)的区别:**
alignCenter可以支持一次水平居中多个组件alignCenter是通过调用[doAlignCenter](#doaligncentere)来获取到已设置好水平居中的位置信息的节点然后调用update更新。
:::
## moveLayer
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{number | 'top' | 'bottom'}` offset
- **返回:**
- `{Promise<void>}`
- **详情:**
移动当前选中节点位置
用于实现上移一层、下移一层、置顶、置底
## moveToContainer
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)} config 需要移动的节点
- `{string | number}` targetId 容器ID
- **返回:**
- Promise<[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99) | undefined>
- **详情:**
移动到指定容器中
## undo
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **返回:**
- {Promise<[StepValue](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/type.ts#L400-L404) | null>}
- **详情:**
撤销当前操作
## redo
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **返回:**
- {Promise<[StepValue](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/type.ts#L400-L404) | null>}
- **详情:**
恢复到下一步
## move
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{number}` left
- `{number}` top
- **返回:**
- `{Promise<void>}`
- **详情:**
更新当前选中组件位置,通常用于键盘上下左右快捷键操作
## resetModifiedNodeId
- **详情:**
重置当前记录的修改过的节点id记录通常用于保存之后
## resetState
- **详情:**
清空state
## destroy
- **详情:**
销毁editorService
移除所有事件监听清空state移除所有插件
## use
使用中间件的方式扩展方法,上述方法中标记有`扩展支持: 是`的方法都支持使用use扩展
- **示例:**
```js
import { editorService, getAddParent } from '@tmagic/editor';
import { ElMessageBox } from 'element-plus';
editorService.use({
// 添加是否删除节点确认提示
async remove(node, next) {
await ElMessageBox.confirm('是否删除', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
next();
},
add(node, next) {
// text组件只能添加到container中
const parentNode = getAddParent(node);
if (node.type === 'text' && parentNode?.type !== 'container') {
return;
}
next();
},
});
```
## usePlugin
- **详情:**
相对于[use](#use), usePlugin支持更加灵活更加细致的扩展 上述方法中标记有`扩展支持: 是`的方法都支持使用usePlugin扩展
每个支持扩展的方法都支持定制before、after两个hook来干预原有方法的行为before可以用于修改传入参数after可以用于修改返回的值
- **示例:**
```js
import { editorService } from '@tmagic/editor';
editorService.usePlugin({
// 添加组件的时候设置一个添加时间
beforeDoAdd: (config, parent) => {
config.addTime = new Date().getTime();
return [config, parent];
},
});
```
## removeAllPlugins
- **详情:**
删掉当前设置的所有扩展

View File

@ -0,0 +1,7 @@
# Editor组件 events
## props-panel-mounted
- **详情:** 编辑器右侧组件属性配置加载完毕后触发
- **回调函数:** (formState: [FomState](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/form/src/schema.ts#L27-L39)) => void

View File

@ -0,0 +1,244 @@
# eventsService方法
## init
- **参数:**
- {Record<string, { events: [EventOption](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/core/src/events.ts#L26-L29)[]; methods: [EventOption](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/core/src/events.ts#L26-L29)[] }>} eventMethodList 事件方法列表配置
- **返回:**
- `{void}`
- **详情:**
初始化事件服务,设置所有组件的事件和方法列表
:::tip
该方法通常由编辑器内部调用,开发者可以通过 [m-editor 的 eventMethodList prop](./props.md#eventmethodlist) 来配置
:::
- **示例:**
```js
import { eventsService } from '@tmagic/editor';
eventsService.init({
page: {
events: [
{ label: '页面加载', value: 'load' },
{ label: '页面卸载', value: 'unload' },
],
methods: [
{ label: '刷新', value: 'refresh' },
{ label: '返回', value: 'back' },
],
},
button: {
events: [
{ label: '点击', value: 'click' },
],
methods: [],
},
});
```
## setEvents
- **参数:**
- {Record<string, [EventOption](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/core/src/events.ts#L26-L29)[]>} events 事件配置对象
- **返回:**
- `{void}`
- **详情:**
批量设置多个组件类型的事件列表
- **示例:**
```js
import { eventsService } from '@tmagic/editor';
eventsService.setEvents({
page: [
{ label: '页面加载', value: 'load' },
{ label: '页面显示', value: 'show' },
],
text: [
{ label: '点击', value: 'click' },
],
});
```
## setEvent
- **参数:**
- `{string}` type 组件类型
- {[EventOption](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/core/src/events.ts#L26-L29)[]} events 事件列表
- **返回:**
- `{void}`
- **详情:**
设置指定组件类型的事件列表
- **示例:**
```js
import { eventsService } from '@tmagic/editor';
eventsService.setEvent('button', [
{ label: '点击', value: 'click' },
{ label: '长按', value: 'longpress' },
]);
```
## getEvent
- **参数:**
- `{string}` type 组件类型
- **返回:**
- {[EventOption](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/core/src/events.ts#L26-L29)[]} 事件列表
- **详情:**
获取指定组件类型的事件列表
- **示例:**
```js
import { eventsService } from '@tmagic/editor';
const events = eventsService.getEvent('button');
console.log(events); // [{ label: '点击', value: 'click' }, ...]
```
## setMethods
- **参数:**
- {Record<string, [EventOption](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/core/src/events.ts#L26-L29)[]>} methods 方法配置对象
- **返回:**
- `{void}`
- **详情:**
批量设置多个组件类型的方法列表
- **示例:**
```js
import { eventsService } from '@tmagic/editor';
eventsService.setMethods({
page: [
{ label: '刷新', value: 'refresh' },
{ label: '滚动到顶部', value: 'scrollToTop' },
],
video: [
{ label: '播放', value: 'play' },
{ label: '暂停', value: 'pause' },
],
});
```
## setMethod
- **参数:**
- `{string}` type 组件类型
- {[EventOption](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/core/src/events.ts#L26-L29)[]} methods 方法列表
- **返回:**
- `{void}`
- **详情:**
设置指定组件类型的方法列表
- **示例:**
```js
import { eventsService } from '@tmagic/editor';
eventsService.setMethod('video', [
{ label: '播放', value: 'play' },
{ label: '暂停', value: 'pause' },
{ label: '停止', value: 'stop' },
]);
```
## getMethod
- **参数:**
- `{string}` type 组件类型
- **返回:**
- {[EventOption](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/core/src/events.ts#L26-L29)[]} 方法列表
- **详情:**
获取指定组件类型的方法列表
- **示例:**
```js
import { eventsService } from '@tmagic/editor';
const methods = eventsService.getMethod('video');
console.log(methods); // [{ label: '播放', value: 'play' }, ...]
```
## resetState
- **参数:**
- **返回:**
- `{void}`
- **详情:**
重置事件服务状态,清空所有事件和方法配置
- **示例:**
```js
import { eventsService } from '@tmagic/editor';
eventsService.resetState();
```
## destroy
- **参数:**
- **返回:**
- `{void}`
- **详情:**
销毁 eventsService重置状态并移除所有事件监听和插件
- **示例:**
```js
import { eventsService } from '@tmagic/editor';
eventsService.destroy();
```

View File

@ -0,0 +1,14 @@
# historyService事件
## page-change
- **详情:** 页面切换
- **回调函数:** (undoRedo: [undoRedo](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/utils/undo-redo.ts)) => void
## change
- **详情:** 历史记录发生变化
- **回调函数:** (state: [StepValue](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/type.ts#L400-L404)) => void

View File

@ -0,0 +1,62 @@
# historyService方法
## reset
- **详情:**
重置记录
## changePage
- **参数:**
- {[MPage](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L61)} page
- **详情:**
按页面切换历史堆栈
## empty
- **详情:**
重置记录,同[reset](#reset)
## push
- **参数:**
- {[StepValue](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/type.ts#L400-L404)} state
- **返回:**
- {[StepValue](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/type.ts#L400-L404) | null}
- **详情:**
添加一条历史记录
## undo
- **返回:**
- {Promise<[StepValue](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/type.ts#L400-L404) | null>}
- **详情:**
撤销当前操作
## redo
- **返回:**
- {Promise<[StepValue](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/type.ts#L400-L404) | null>}
- **详情:**
恢复到下一步
## destroy
- **详情:**
销毁

1282
docs/api/editor/props.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
# propsService事件
## props-configs-change
- **详情:** [propsService.setPropsConfigs()](./propsServiceMethods.md#setPropsConfigs)后触发
- **回调函数:** () => void

View File

@ -0,0 +1,190 @@
# propsService方法
## fillConfig
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {[FormConfig](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/form/src/schema.ts#L706)} config
- **返回:**
- {Promise<[FormConfig](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/form/src/schema.ts#L706)>}
- **详情:**
扩展属性表单配置DSL用于为所有表单配置添加公共配置
## setPropsConfigs
- **参数:**
- {Record<string, [FormConfig](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/form/src/schema.ts#L706)>} configs
- **返回:**
- `{void}`
- **详情:**
设置组件与属性表单配置DSL的对应关系
## setPropsConfig
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` type 组件类型
- {[FormConfig](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/form/src/schema.ts#L706)} config 属性表单配置DSL
- **返回:**
- `{Promise<void>}`
- **详情:**
为指定类型组件设置组件属性表单配置
## getPropsConfig
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` type 组件类型
- **返回:**
- {Promise<[FormConfig](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/form/src/schema.ts#L706)>}
- **详情:**
获取指点类型的组件属性表单配置
## setPropsValues
- **参数:**
- {Record<string, [MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)>} values
- **返回:**
- `{void}`
- **详情:**
设置组件与属性表单默认值的对应关系
## setPropsValue
- **参数:**
- `{string}` type 组件类型
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)} value 组件初始值
- **返回:**
- `{Promise<void>}`
- **详情:**
设置组件与属性表单默认值的对应关系
## getPropsValue
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` type 组件类型
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)} value 组件默认值,可选
- **返回:**
- `{Promise<void>}`
- **详情:**
获取指定类型的组件初始值
## createId
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {string} type 组件列席
- **返回:**
- `{Promise<string>}`
- **详情:**
生成组件id
## setNewItemId
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- {[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)} config
- **返回:**
- {Promise<[MNode](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L99)>}
- **详情:**
将组件与组件的子元素配置中的id都设置成一个新的ID
## getDefaultPropsValue
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` type 组件类型
- **返回:**
- `{Promise<void>}`
- **详情:**
获取默认属性配置
## resetState
- **详情:**
情况所有组件的属性配置与初始值
## destroy
- **详情:**
销毁propsService
## use
使用中间件的方式扩展方法,上述方法中标记有`扩展支持: 是`的方法都支持使用use扩展
## usePlugin
- **详情:**
相对于[use](#use), usePlugin支持更加灵活更加细致的扩展 上述方法中标记有`扩展支持: 是`的方法都支持使用usePlugin扩展
每个支持扩展的方法都支持定制before、after两个hook来干预原有方法的行为before可以用于修改传入参数after可以用于修改返回的值
## removeAllPlugins
- **详情:**
删掉当前设置的所有扩展

379
docs/api/editor/slots.md Normal file
View File

@ -0,0 +1,379 @@
# Editor组件 slots
## header
- **详情:** 编辑器最顶部区域
- **默认:**
- **示例:**
```html
<template>
<m-editor>
<template #header>
<div class="custom-header">自定义头部内容</div>
</template>
</m-editor>
</template>
```
## nav
- **详情:** 编辑器顶部菜单栏
- **默认:** [NavMenu.vue](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/layouts/NavMenu.vue)
- **插槽 Props**
- `editorService`: editorService 实例
:::warning
属性配置[menu](./props.md#menu)由默认组件接收如设置该slot[menu](./props.md#menu)配置将失效
:::
- **示例:**
```html
<template>
<m-editor>
<template #nav="{ editorService }">
<div class="custom-nav">
<button @click="save">保存</button>
</div>
</template>
</m-editor>
</template>
```
## content-before
- **详情:** 编辑器主要内容区域之前
- **默认:**
## src-code
- **详情:** 源码查看区域
- **默认:** 默认的代码编辑器
- **插槽 Props**
- `editorService`: editorService 实例
## sidebar
- **详情:** 左边栏
- **默认:** [Sidebar.vue](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/layouts/sidebar/Sidebar.vue)
- **插槽 Props**
- `editorService`: editorService 实例
:::warning
属性配置[sidebar](./props.md#sidebar)由默认组件接收如设置该slot[sidebar](./props.md#sidebar)配置将失效
:::
- **示例:**
```html
<template>
<m-editor>
<template #sidebar="{ editorService }">
<div class="custom-sidebar">
<!-- 自定义侧边栏内容 -->
</div>
</template>
</m-editor>
</template>
```
## component-list
- **详情:** 左边栏中的组件列表
- **默认:** 默认的组件列表
- **插槽 Props**
- `componentGroupList`: 组件分组列表
:::warning
如设置了[sidebar](#sidebar)插槽,此插槽将失效
:::
## component-list-panel-header
- **详情:** 左边栏中的组件列表内上方位置
- **默认:**
:::warning
如设置了[sidebar](#sidebar)插槽,此插槽将失效
:::
## component-list-item
- **详情:** 左边栏中的组件列表中组件item
- **默认:** 图片加文案
- **插槽 Props**
- `component`: 组件配置对象
:::warning
如设置了[sidebar](#sidebar)插槽,此插槽将失效
:::
- **示例:**
```html
<template>
<m-editor>
<template #component-list-item="{ component }">
<div class="custom-item">
<span>{{ component.text }}</span>
</div>
</template>
</m-editor>
</template>
```
## layer-panel-header
- **详情:** 左边栏中的已选组件(组件树)内顶部位置
- **默认:**
:::warning
如设置了[sidebar](#sidebar)插槽,此插槽将失效
:::
## layer-node-content
- **详情:** 左边栏中的已选组件(组件树)节点完整内容
- **默认:** 组件名称加id和工具按钮
- **插槽 Props**
- `data`: 节点数据
:::warning
如设置了[sidebar](#sidebar)插槽,此插槽将失效
:::
## layer-node-label
- **详情:** 左边栏中的已选组件(组件树)节点标签部分
- **默认:** 组件名称加id
- **插槽 Props**
- `data`: 节点数据
:::warning
如设置了[sidebar](#sidebar)插槽,此插槽将失效
:::
- **示例:**
```html
<template>
<m-editor>
<template #layer-node-label="{ data }">
<span>{{ data.type }} - {{ data.name }}</span>
</template>
</m-editor>
</template>
```
## layer-node-tool
- **详情:** 左边栏中的已选组件(组件树)节点右侧工具区域
- **默认:**
- **插槽 Props**
- `data`: 节点数据
:::warning
如设置了[sidebar](#sidebar)插槽,此插槽将失效
:::
## code-block-panel-header
- **详情:** 左边栏中的代码块列表内顶部位置
- **默认:**
:::warning
如设置了[sidebar](#sidebar)插槽,此插槽将失效
:::
## code-block-panel-tool
- **详情:** 左边栏中的代码块列表中代码块右侧位置
- **默认:**
- **插槽 Props**
- `id`: 代码块id
- `data`: 代码块数据
:::warning
如设置了[sidebar](#sidebar)插槽,此插槽将失效
:::
## code-block-panel-search
- **详情:** 左边栏中的代码块列表搜索框位置
- **默认:**
:::warning
如设置了[sidebar](#sidebar)插槽,此插槽将失效
:::
## data-source-panel-tool
- **详情:** 左边栏中的数据源列表中数据源右侧位置
- **默认:**
- **插槽 Props**
- `data`: 数据源数据
:::warning
如设置了[sidebar](#sidebar)插槽,此插槽将失效
:::
## data-source-panel-search
- **详情:** 左边栏中的数据源列表搜索框位置
- **默认:**
:::warning
如设置了[sidebar](#sidebar)插槽,此插槽将失效
:::
## workspace
- **详情:** 编辑器中间区域
- **默认:** [Workspace.vue](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/layouts/workspace/Workspace.vue)
- **插槽 Props**
- `editorService`: editorService 实例
## stage
- **详情:** 画布
- **默认:** [Stage.vue](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/layouts/workspace/Stage.vue)
## workspace-content
- **详情:** 编辑器中间区域内,画布上方位置
- **默认:**
- **插槽 Props**
- `editorService`: editorService 实例
## page-bar
- **详情:** 编辑器中间区域底部页面标签栏
- **默认:** 默认的页面标签栏
## page-bar-add-button
- **详情:** 页面标签栏中的"添加页面"按钮
- **默认:** 默认的添加按钮
## page-bar-title
- **详情:** 编辑器中间区域底部页面标题
- **默认:** 页面名称
- **插槽 Props**
- `page`: 页面配置对象
- **示例:**
```html
<template>
<m-editor>
<template #page-bar-title="{ page }">
<span>{{ page.name }} - {{ page.id }}</span>
</template>
</m-editor>
</template>
```
## page-bar-popover
- **详情:** 编辑器中间区域底部页面标题悬浮框内容
- **默认:** 页面详细信息
- **插槽 Props**
- `page`: 页面配置对象
## page-list-popover
- **详情:** 页面列表弹出框内容
- **默认:** 页面列表
- **插槽 Props**
- `list`: 页面列表
## props-panel
- **详情:** 编辑器右侧属性配置
- **默认:** [PropsPanel.vue](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/layouts/PropsPanel.vue)
## props-panel-header
- **详情:** 编辑器右侧属性配置内顶部区域
- **默认:**
## content-after
- **详情:** 编辑器主要内容区域之后
- **默认:**
## footer
- **详情:** 编辑器底部区域
- **默认:**
## empty
- **详情:** 当前没有页面时,编辑器中间区域
- **默认:** [AddPageBox.vue](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/layouts/AddPageBox.vue)
- **插槽 Props**
- `editorService`: editorService 实例
- **示例:**
```html
<template>
<m-editor>
<template #empty="{ editorService }">
<div class="custom-empty">
<p>暂无页面</p>
<button @click="createFirstPage">创建第一个页面</button>
</div>
</template>
</m-editor>
</template>
```

View File

@ -0,0 +1,290 @@
# storageService方法
## getStorage
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- **返回:**
- `{Storage}` Storage 对象
- **详情:**
获取数据存储对象,默认返回 localStorage
可以通过插件机制替换为其他存储对象(如 sessionStorage
- **示例:**
```js
import { storageService } from '@tmagic/editor';
const storage = storageService.getStorage();
console.log(storage); // localStorage
// 通过插件替换为 sessionStorage
storageService.usePlugin({
afterGetStorage() {
return window.sessionStorage;
},
});
```
## getNamespace
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- **返回:**
- `{string}` 命名空间字符串
- **详情:**
获取存储项的命名空间,默认为 'tmagic'
命名空间用于区分不同应用的存储数据
- **示例:**
```js
import { storageService } from '@tmagic/editor';
const namespace = storageService.getNamespace();
console.log(namespace); // 'tmagic'
```
## clear
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- **返回:**
- `{void}`
- **详情:**
清空当前存储对象中的所有数据
- **示例:**
```js
import { storageService } from '@tmagic/editor';
storageService.clear();
```
## getItem
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` key 存储项的键名
- `{Options}` options 可选配置
- `namespace?: string` 自定义命名空间
- `protocol?: Protocol` 数据协议类型
- **返回:**
- `{any}` 存储的值,如果不存在返回 null
- **详情:**
获取存储项,支持多种数据类型的自动解析
支持的协议类型:
- `Protocol.OBJECT`: JavaScript 对象
- `Protocol.JSON`: JSON 格式
- `Protocol.NUMBER`: 数字类型
- `Protocol.BOOLEAN`: 布尔类型
- `Protocol.STRING`: 字符串类型
- **示例:**
```js
import { storageService } from '@tmagic/editor';
// 获取字符串
const str = storageService.getItem('myKey');
// 使用自定义命名空间
const value = storageService.getItem('key', { namespace: 'custom' });
// 指定协议类型
const num = storageService.getItem('count', { protocol: Protocol.NUMBER });
```
## key
- **参数:**
- `{number}` index 索引位置
- **返回:**
- `{string | null}` 指定位置的键名,不存在返回 null
- **详情:**
获取存储对象中指定索引位置的键名
- **示例:**
```js
import { storageService } from '@tmagic/editor';
const firstKey = storageService.key(0);
console.log(firstKey);
```
## removeItem
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` key 存储项的键名
- `{Options}` options 可选配置
- `namespace?: string` 自定义命名空间
- **返回:**
- `{void}`
- **详情:**
移除指定的存储项
- **示例:**
```js
import { storageService } from '@tmagic/editor';
// 移除默认命名空间下的存储项
storageService.removeItem('myKey');
// 移除自定义命名空间下的存储项
storageService.removeItem('key', { namespace: 'custom' });
```
## setItem
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{string}` key 存储项的键名
- `{any}` value 要存储的值
- `{Options}` options 可选配置
- `namespace?: string` 自定义命名空间
- `protocol?: Protocol` 数据协议类型
- **返回:**
- `{void}`
- **详情:**
设置存储项,自动序列化复杂数据类型
- **示例:**
```js
import { storageService, Protocol } from '@tmagic/editor';
// 存储字符串
storageService.setItem('name', 'tmagic');
// 存储对象
storageService.setItem('config', { a: 1, b: 2 }, { protocol: Protocol.OBJECT });
// 存储数字
storageService.setItem('count', 100, { protocol: Protocol.NUMBER });
// 使用自定义命名空间
storageService.setItem('key', 'value', { namespace: 'custom' });
```
## destroy
- **参数:**
- **返回:**
- `{void}`
- **详情:**
销毁 storageService移除所有事件监听和插件
- **示例:**
```js
import { storageService } from '@tmagic/editor';
storageService.destroy();
```
## use
使用中间件的方式扩展方法,上述方法中标记有`扩展支持: 是`的方法都支持使用use扩展
- **示例:**
```js
import { storageService } from '@tmagic/editor';
storageService.use({
getItem(key, options, next) {
console.log('获取存储项:', key);
return next();
},
});
```
## usePlugin
- **详情:**
相对于[use](#use), usePlugin支持更加灵活更加细致的扩展 上述方法中标记有`扩展支持: 是`的方法都支持使用usePlugin扩展
每个支持扩展的方法都支持定制before、after两个hook来干预原有方法的行为before可以用于修改传入参数after可以用于修改返回的值
- **示例:**
```js
import { storageService } from '@tmagic/editor';
storageService.usePlugin({
beforeSetItem(key, value, options) {
console.log('设置前:', key, value);
return [key, value, options];
},
afterGetItem(result, key, options) {
console.log('获取后:', result);
return result;
},
});
```
## removeAllPlugins
- **详情:**
删掉当前设置的所有扩展
- **示例:**
```js
import { storageService } from '@tmagic/editor';
storageService.removeAllPlugins();
```

View File

@ -0,0 +1,239 @@
# uiService方法
## set
- **参数:**
- `{keyof UiState}` name 状态键名
- `{any}` value 状态值
- **返回:**
- `{void}`
- **详情:**
设置UI服务的状态
可用的状态键:
- `uiSelectMode`: UI选择模式
- `showSrc`: 是否显示源码
- `showStylePanel`: 是否显示样式面板
- `zoom`: 缩放比例
- `stageContainerRect`: 画布容器尺寸
- `stageRect`: 画布尺寸
- `columnWidth`: 列宽度配置
- `showGuides`: 是否显示参考线
- `showRule`: 是否显示标尺
- `propsPanelSize`: 属性面板尺寸
- `showAddPageButton`: 是否显示添加页面按钮
- `showPageListButton`: 是否显示页面列表按钮
- `hideSlideBar`: 是否隐藏侧边栏
- `sideBarItems`: 侧边栏项目
- `navMenuRect`: 导航菜单尺寸
- `frameworkRect`: 框架尺寸
- **示例:**
```js
import { uiService } from '@tmagic/editor';
// 设置缩放比例
uiService.set('zoom', 1.5);
// 设置画布尺寸
uiService.set('stageRect', { width: 375, height: 667 });
// 显示/隐藏参考线
uiService.set('showGuides', true);
// 显示/隐藏标尺
uiService.set('showRule', true);
```
## get
- **参数:**
- `{keyof UiState}` name 状态键名
- **返回:**
- `{any}` 对应的状态值
- **详情:**
获取UI服务的状态值
- **示例:**
```js
import { uiService } from '@tmagic/editor';
const zoom = uiService.get('zoom');
console.log('当前缩放:', zoom);
const stageRect = uiService.get('stageRect');
console.log('画布尺寸:', stageRect);
```
## zoom
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- `{number}` zoom 缩放增量(可以为负数)
- **返回:**
- `{Promise<void>}`
- **详情:**
调整缩放倍数最小为0.1
传入的值会被累加到当前缩放倍数上
- **示例:**
```js
import { uiService } from '@tmagic/editor';
// 放大0.1倍
await uiService.zoom(0.1);
// 缩小0.1倍
await uiService.zoom(-0.1);
// 当前缩放如果是1.0执行zoom(0.5)后变为1.5
await uiService.zoom(0.5);
```
## calcZoom
- **[扩展支持](../../guide/editor-expand#行为扩展)** 是
- **参数:**
- **返回:**
- `{Promise<number>}` 计算出的缩放倍数
- **详情:**
计算"缩放以适应"的倍数
根据画布容器的尺寸和画布尺寸自动计算出合适的缩放比例,使画布完全显示在容器内
- **示例:**
```js
import { uiService } from '@tmagic/editor';
const fitZoom = await uiService.calcZoom();
console.log('适应缩放:', fitZoom);
// 应用缩放以适应
uiService.set('zoom', fitZoom);
```
## resetState
- **参数:**
- **返回:**
- `{void}`
- **详情:**
重置UI服务状态到初始值
- **示例:**
```js
import { uiService } from '@tmagic/editor';
uiService.resetState();
```
## destroy
- **参数:**
- **返回:**
- `{void}`
- **详情:**
销毁 uiService重置状态并移除所有事件监听和插件
- **示例:**
```js
import { uiService } from '@tmagic/editor';
uiService.destroy();
```
## use
使用中间件的方式扩展方法,上述方法中标记有`扩展支持: 是`的方法都支持使用use扩展
- **示例:**
```js
import { uiService } from '@tmagic/editor';
uiService.use({
async zoom(value, next) {
console.log('缩放前:', uiService.get('zoom'));
await next();
console.log('缩放后:', uiService.get('zoom'));
},
});
```
## usePlugin
- **详情:**
相对于[use](#use), usePlugin支持更加灵活更加细致的扩展 上述方法中标记有`扩展支持: 是`的方法都支持使用usePlugin扩展
每个支持扩展的方法都支持定制before、after两个hook来干预原有方法的行为before可以用于修改传入参数after可以用于修改返回的值
- **示例:**
```js
import { uiService } from '@tmagic/editor';
uiService.usePlugin({
beforeZoom(value) {
console.log('缩放增量:', value);
return [value];
},
afterCalcZoom(result) {
console.log('计算的缩放:', result);
// 可以修改返回值
return result;
},
});
```
## removeAllPlugins
- **详情:**
删掉当前设置的所有扩展
- **示例:**
```js
import { uiService } from '@tmagic/editor';
uiService.removeAllPlugins();
```

View File

@ -0,0 +1,27 @@
# FormDialog组件 events
## close
- **详情:** 弹出关闭
- **回调函数:** () => void
## submit
- **详情:** 调用[save()](./form-dialog-methods.md#save)
- **回调函数:** (values: any) => void
## error
- **详情:** 表单校验不同
- **回调函数:** (error: any) => void
## change
- **详情:** 表单中任何值发生变化
- **回调函数:** (values: any) => void

View File

@ -0,0 +1,13 @@
# FormDialog组件 methods
## cancel
- **详情:** 关闭弹窗
## save
- **返回:**
- `{Promise<any>}`
- **详情:** 获取表单的值

View File

@ -0,0 +1,110 @@
# FormDialog组件 props
## config
- **详情:** 表单配置
- **默认值:** `[]`
- **类型:** [FormConfig](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/form/src/schema.ts#L706)
- **示例:**
```html
<template>
<m-form-dialog :config="config"></m-form-dialog>
</template>
<script setup>
import { ref } from 'Vue';
const config = ref([
{
name: 'text',
text: '文本',
},
{
name: 'multiple',
text: '多行文本',
type: 'switch',
},
]);
</script>
```
## values
- **详情:** 表单初始化值
- **默认值:** `{}`
- **类型:** `Object`
- **示例:**
```html
<template>
<m-form-dialog :values="values"></m-form-dialog>
</template>
<script setup>
import { ref } from 'Vue';
const values = ref([
text: 'text',
multiply: true,
]);
</script>
```
## width
- **详情:** 弹窗宽度
- **类型:** `string | number`
## labelWidth
- **详情:**
表单域标签的宽度,例如 '50px'。 作为 Form 直接子元素的 form-item 会继承该值。 支持 auto
- **默认值:** `'200px'`
- **类型:** `string | number`
## fullscreen
- **详情:** 弹出是否全屏
- **默认值:** false
- **类型:** boolean
## disabled
- **详情:** 是否禁用该表单内的所有组件。 若设置为 true则表单内组件上的 disabled 属性不再生效
- **默认值:** false
- **类型:** `boolean`
## title
- **详情:** 弹出标题
- **类型:** `string`
## size
- **详情:** 用于控制该表单内组件的尺寸
- **类型:** `'small' | 'default' | 'large'`
## confirmText
- **详情:** 提交按钮文案
- **默认值:** `'确定'`
- **类型:** `string`

View File

@ -0,0 +1,7 @@
# Form组件 events
## change
- **详情:** 表单中任何值发生变化
- **回调函数:** (values: any) => void

View File

@ -0,0 +1,13 @@
# Form组件 methods
## resetForm
- **详情:** 重置该表单项,将其值重置为初始值,并移除校验结果
## submitForm
- **返回:**
- `{Promise<any>}`
- **详情:** 提交表单,获取表单的值

137
docs/api/form/form-props.md Normal file
View File

@ -0,0 +1,137 @@
# Form组件属性 props
## config
- **详情:** 表单配置
- **默认值:** `[]`
- **类型:** [FormConfig](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/form/src/schema.ts#L706)
- **示例:**
```html
<template>
<m-form-dialog :config="config"></m-form-dialog>
</template>
<script setup>
import { ref } from 'Vue';
const config = ref([
{
name: 'text',
text: '文本',
},
{
name: 'multiple',
text: '多行文本',
type: 'switch',
},
]);
</script>
```
## initValues
- **详情:** 表单初始化值
- **默认值:** `{}`
- **类型:** `Object`
- **示例:**
```html
<template>
<m-form-dialog :init-values="initValues"></m-form-dialog>
</template>
<script setup>
import { ref } from 'Vue';
const initValues = ref([
text: 'text',
multiply: true,
]);
</script>
```
## labelWidth
- **详情:**
表单域标签的宽度,例如 '50px'。 作为 Form 直接子元素的 form-item 会继承该值。 支持 auto
- **默认值:** `'200px'`
- **类型:** `string | number`
## disabled
- **详情:** 是否禁用该表单内的所有组件。 若设置为 true则表单内组件上的 disabled 属性不再生效
- **默认值:** false
- **类型:** `boolean`
## height
- **详情:**
- **默认值:**
- **类型:**
## stepActive
- **详情:**
- **默认值:**
- **类型:**
## size
- **详情:** 用于控制该表单内组件的尺寸
- **类型:** `'small' | 'default' | 'large'`
## inline
- **详情:** 行内表单模式
- **默认值:** false
- **类型:** `boolean`
## labelPosition
- **详情:** 表单域标签的位置, 当设置为 left 或 right 时,则也需要设置 label-width 属性
- **默认值:** right'
- **类型:** `'left' | 'right' | 'top`
## keyProp
- **详情:** 作为表单项的组件实例的key
- **默认值:** `'__key'`
- **类型:** `string`
## popperClass
- **详情:** tooltip弹出层的class
- **类型:** `string`

View File

@ -0,0 +1,21 @@
# stage事件
## runtime-ready
## mounted
## highlight
## update
## select
## multi-select
## select-parent
## sort
## update
## change-guides

View File

@ -0,0 +1,58 @@
# stage方法
## select
- **详情:** 单选选中元素
## multiSelect
- **详情:** 多选选中多个元素
## highlight
- **详情:** 高亮选中元素
## update
- **详情:** 更新组件
## add
- **详情:** 往画布增加一个组件
## remove
- **详情:** 从画布删除一个组件
## setZoom
- **详情:**
## mount
- **详情:** 挂载Dom节点
## clearGuides
- **详情:** 清空所有参考线
## clearGuides
- **详情:** 清空所有参考线
## delayedMarkContainer
- **详情:**
鼠标拖拽着元素在容器上方悬停延迟一段时间后对容器进行标记如果悬停时间够长将标记成功悬停时间短调用方通过返回的timeoutId取消标记
标记的作用:
1、高亮容器给用户一个加入容器的交互感知
2、释放鼠标后通过标记的标志找到要加入的容器
## destroy
- **详情:** 销毁实例

110
docs/api/table/events.md Normal file
View File

@ -0,0 +1,110 @@
# Table组件 events
## sort-change
- **参数:**
- `{ column, prop, order }` - 排序信息对象
- `column: Object` - 排序的列配置
- `prop: string` - 排序的列属性名
- `order: 'ascending' | 'descending' | null` - 排序方式
- **说明:** 当表格的排序条件发生变化时触发
- **示例:**
```js
const handleSortChange = ({ column, prop, order }) => {
console.log('排序变化:', prop, order);
};
```
## after-action
- **参数:**
- `action: string` - 操作类型
- `data: any` - 操作相关数据
- **说明:** 表格操作完成后触发
- **示例:**
```js
const handleAfterAction = (action, data) => {
console.log('操作完成:', action, data);
};
```
## select
- **参数:**
- `selection: Array<any>` - 当前选中的行数据数组
- `row: any` - 刚刚被选中的行数据
- **说明:** 当用户手动勾选某一行时触发
- **示例:**
```js
const handleSelect = (selection, row) => {
console.log('选中行:', row);
console.log('当前选中:', selection);
};
```
## select-all
- **参数:**
- `selection: Array<any>` - 当前选中的行数据数组
- **说明:** 当用户手动勾选全选 Checkbox 时触发
- **示例:**
```js
const handleSelectAll = (selection) => {
console.log('全选/取消全选:', selection.length);
};
```
## selection-change
- **参数:**
- `selection: Array<any>` - 当前选中的行数据数组
- **说明:** 当选择项发生变化时触发
- **示例:**
```js
const handleSelectionChange = (selection) => {
console.log('选中项变化:', selection);
};
```
## expand-change
- **参数:**
- `row: any` - 被展开/收起的行数据
- `expandedRows: Array<any>` - 当前所有展开的行数据数组
- **说明:** 当用户展开或收起某一行时触发(用于可展开表格)
- **示例:**
```js
const handleExpandChange = (row, expandedRows) => {
console.log('展开状态变化:', row);
console.log('当前展开行:', expandedRows);
};
```
## cell-click
- **参数:**
- `row: any` - 行数据
- `column: Object` - 列配置
- `cell: HTMLElement` - 单元格 DOM 元素
- `event: Event` - 原生事件对象
- **说明:** 当某个单元格被点击时触发
- **示例:**
```js
const handleCellClick = (row, column, cell, event) => {
console.log('单元格点击:', row, column.property);
};
```

41
docs/api/table/methods.md Normal file
View File

@ -0,0 +1,41 @@
# Table组件 methods
## toggleRowSelection
- **参数:**
- `row: any` - 要切换选中状态的行数据
- `selected?: boolean` - 是否选中,不传则切换当前状态
- **说明:** 切换某一行的选中状态
- **示例:**
```js
tableRef.value.toggleRowSelection(row, true); // 选中
tableRef.value.toggleRowSelection(row, false); // 取消选中
tableRef.value.toggleRowSelection(row); // 切换状态
```
## toggleRowExpansion
- **参数:**
- `row: any` - 要展开/收起的行数据
- `expanded?: boolean` - 是否展开,不传则切换当前状态
- **说明:** 切换某一行的展开状态(用于可展开表格)
- **示例:**
```js
tableRef.value.toggleRowExpansion(row, true); // 展开
tableRef.value.toggleRowExpansion(row, false); // 收起
```
## clearSelection
- **参数:**
- **说明:** 清空所有选中的行
- **示例:**
```js
tableRef.value.clearSelection();
```

123
docs/api/table/props.md Normal file
View File

@ -0,0 +1,123 @@
# Table组件 props
## data
- **详情:** 表格数据,数组格式
- **默认值:** `[]`
- **类型:** `Array<any>`
- **示例:**
```js
[
{ id: 1, name: '张三', age: 20 },
{ id: 2, name: '李四', age: 25 }
]
```
## columns
- **详情:** 表格列配置
- **默认值:** `[]`
- **类型:** `Array<ColumnConfig>`
- **示例:**
```js
[
{ prop: 'name', label: '姓名', width: 120 },
{ prop: 'age', label: '年龄', width: 80 }
]
```
## spanMethod
- **详情:** 合并行或列的计算方法
- **默认值:** `undefined`
- **类型:** `Function`
- **参数:**
- `{ row, column, rowIndex, columnIndex }`
- **返回值:** `[rowspan, colspan]``{ rowspan, colspan }`
- **示例:**
```js
({ rowIndex, columnIndex }) => {
if (rowIndex % 2 === 0) {
if (columnIndex === 0) {
return [1, 2];
} else if (columnIndex === 1) {
return [0, 0];
}
}
}
```
## loading
- **详情:** 是否显示加载状态
- **默认值:** `false`
- **类型:** `boolean`
## showHeader
- **详情:** 是否显示表头
- **默认值:** `true`
- **类型:** `boolean`
## bodyHeight
- **详情:** Table 的最大高度。合法的值为数字或者单位为 px 的高度
- **默认值:** `undefined`
- **类型:** `string | number`
- **示例:**
```js
bodyHeight: 400
bodyHeight: '400px'
```
## emptyText
- **详情:** 空数据时显示的文本内容
- **默认值:** `'暂无数据'`
- **类型:** `string`
## defaultExpandAll
- **详情:** 是否默认展开所有行,当 Table 包含展开行存在或者为树形表格时有效
- **默认值:** `false`
- **类型:** `boolean`
## rowkeyName
- **详情:** 行数据的 Key用来优化 Table 的渲染
- **默认值:** `'id'`
- **类型:** `string`
- **说明:** 在使用 reserve-selection 功能与显示树形数据时,该属性是必填的
## border
- **详情:** 是否显示边框
- **默认值:** `false`
- **类型:** `boolean`

View File

@ -0,0 +1,7 @@
# 表单对比
tmagic-form可以支持两个版本的表单值对比如果有容器嵌套将在tab标签页展示对应tab下存在的差异数便于在复杂嵌套表单场景下直观的看到差异情况
## 使用方法
在初始化表单时,需要传入当前版本的表单值,上一版本的表单值,以及表单配置,具体可参见[Form Playground](https://tencent.github.io/tmagic-editor/playground/index.html#/form)的demo演示
## 效果展示
<img src="https://vip.image.video.qpic.cn/vupload/20230301/c626071677661813135.png" alt="表单对比"/>

View File

@ -0,0 +1,38 @@
# CodeLink 代码链接
通过弹窗链接的方式编辑代码内容。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'code-link',
name: 'codeLink',
text: '代码配置'
}
```
## 自定义弹窗标题
```js
{
type: 'code-link',
name: 'codeLink',
text: '代码配置',
formTitle: '编辑代码'
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| formTitle | 弹窗标题 | string | — | — |
| codeOptions | 代码编辑器配置项 | object | — | — |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,37 @@
# CodeSelectCol 代码块选择列
代码块选择器的列组件,支持选择代码块并配置参数。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'code-select-col',
name: 'codeId',
text: '代码块'
}
```
## 禁止编辑
```js
{
type: 'code-select-col',
name: 'codeId',
text: '代码块',
notEditable: true
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| notEditable | 是否不可编辑代码块disable控制是否可选择 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,33 @@
# CodeSelect 代码块选择器
用于选择代码块并配置参数的组件。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'code-select',
name: 'codeSelect',
text: '代码块'
}
```
## 功能说明
CodeSelect 组件支持:
- 选择代码块
- 选择数据源方法
- 配置代码块参数
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| className | 自定义类名 | string | — | — |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,61 @@
# Code 代码编辑器
代码编辑器字段,用于编辑代码内容。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'code',
name: 'code',
text: '代码'
}
```
## 指定语言
```js
{
type: 'code',
name: 'code',
text: '代码',
language: 'javascript'
}
```
## 自动调整大小
```js
{
type: 'code',
name: 'code',
text: '代码',
autosize: {
minRows: 3,
maxRows: 10
}
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| language | 代码语言 | string | javascript/typescript/json等 | — |
| height | 编辑器高度 | string | — | — |
| parse | 是否解析代码 | boolean | — | false |
| options | 编辑器配置项 | object | — | — |
| autosize | 自动调整大小配置 | object | — | — |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |
## autosize Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| minRows | 最小行数 | number | — | — |
| maxRows | 最大行数 | number | — | — |

View File

@ -0,0 +1,37 @@
# CondOpSelect 条件操作选择器
用于选择条件操作符的选择器。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'cond-op',
name: 'op',
text: '操作符'
}
```
## 指定父级字段
```js
{
type: 'cond-op',
name: 'op',
text: '操作符',
parentFields: ['field1', 'field2']
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| parentFields | 父级字段 | string[] | — | — |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,67 @@
# DataSourceFieldSelect 数据源字段选择器
用于选择数据源字段的级联选择器。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'data-source-field-select',
name: 'field',
text: '数据源字段'
}
```
## 返回字段key
```js
{
type: 'data-source-field-select',
name: 'field',
text: '数据源字段',
value: 'key'
}
```
## 限制字段类型
```js
{
type: 'data-source-field-select',
name: 'field',
text: '数据源字段',
dataSourceFieldType: ['string', 'number']
}
```
## 父子节点不关联
```js
{
type: 'data-source-field-select',
name: 'field',
text: '数据源字段',
checkStrictly: true
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| value | 返回值类型 | string | key/value | — |
| checkStrictly | 是否严格遵守父子节点不互相关联 | boolean / Function | — | — |
| dataSourceFieldType | 允许选择的字段类型 | DataSourceFieldType[] | — | — |
| fieldConfig | 自定义字段配置 | ChildConfig | — | — |
| notEditable | 是否不可编辑数据源disable控制是否可选择 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |
## value说明
- `key`: 不编译返回数据源id和字段name
- `value`: 编译后返回数据源data[field]

View File

@ -0,0 +1,25 @@
# DataSourceFields 数据源字段配置
用于配置数据源字段的表单组件。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'data-source-fields',
name: 'fields',
text: '字段配置'
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,25 @@
# DataSourceInput 数据源输入框
支持绑定数据源的输入框组件。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'data-source-input',
name: 'input',
text: '输入框'
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,37 @@
# DataSourceMethodSelect 数据源方法选择器
用于选择数据源方法的选择器。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'data-source-method-select',
name: 'method',
text: '数据源方法'
}
```
## 禁止编辑
```js
{
type: 'data-source-method-select',
name: 'method',
text: '数据源方法',
notEditable: true
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| notEditable | 是否不可编辑数据源disable控制是否可选择 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,25 @@
# DataSourceMethods 数据源方法配置
用于配置数据源方法的表单组件。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'data-source-methods',
name: 'methods',
text: '方法配置'
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,25 @@
# DataSourceMocks 数据源Mock配置
用于配置数据源Mock数据的表单组件。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'data-source-mocks',
name: 'mocks',
text: 'Mock配置'
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,55 @@
# DataSourceSelect 数据源选择器
用于选择数据源的下拉选择器。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'data-source-select',
name: 'dataSource',
text: '数据源'
}
```
## 过滤数据源类型
```js
{
type: 'data-source-select',
name: 'dataSource',
text: '数据源',
dataSourceType: 'http'
}
```
## 返回数据源ID
```js
{
type: 'data-source-select',
name: 'dataSource',
text: '数据源',
value: 'id'
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| placeholder | 输入框占位文本 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| dataSourceType | 数据源类型过滤 | string | base/http等 | — |
| value | 返回值类型 | string | id/value | — |
| notEditable | 是否不可编辑数据源disable控制是否可选择 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |
## value说明
- `id`: 不编译返回数据源id
- `value`: 编译后返回数据源data

View File

@ -0,0 +1,38 @@
# DisplayConds 显示条件配置
用于配置组件显示条件的表单组件。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'display-conds',
name: 'displayConds',
text: '显示条件'
}
```
## 带标题前缀
```js
{
type: 'display-conds',
name: 'displayConds',
text: '显示条件',
titlePrefix: '条件'
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| titlePrefix | 标题前缀 | string | — | — |
| parentFields | 父级字段 | string[] / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | — |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,49 @@
# EventSelect 事件选择器
用于配置组件或数据源事件的选择器。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'event-select',
name: 'events',
text: '事件配置',
src: 'component'
}
```
## 数据源事件
```js
{
type: 'event-select',
name: 'events',
text: '事件配置',
src: 'datasource'
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| src | 事件来源 | string | datasource/component | — |
| labelWidth | 标签宽度 | string | — | — |
| eventNameConfig | 事件名称表单配置 | FormItem | — | — |
| actionTypeConfig | 动作类型配置 | FormItem | — | — |
| targetCompConfig | 联动组件配置 | FormItem | — | — |
| compActionConfig | 联动组件动作配置 | FormItem | — | — |
| codeActionConfig | 联动代码配置 | FormItem | — | — |
| dataSourceActionConfig | 联动数据源配置 | FormItem | — | — |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |
## src说明
- `component`: 组件事件
- `datasource`: 数据源事件

View File

@ -0,0 +1,39 @@
# KeyValue 键值对
用于配置键值对数据的表单组件。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'key-value',
name: 'params',
text: '参数'
}
```
## 高级模式
设置 `advanced``true`,可切换到代码编辑模式。
```js
{
type: 'key-value',
name: 'params',
text: '参数',
advanced: true
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| advanced | 是否支持高级模式(代码编辑) | boolean | — | false |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,30 @@
# PageFragmentSelect 页面片选择器
用于选择页面片的下拉选择器。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'page-fragment-select',
name: 'pageFragment',
text: '页面片'
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |
## 使用说明
1. 下拉框会自动列出当前项目中所有的页面片
2. 选中页面片后,点击编辑图标可跳转到对应页面片进行编辑

View File

@ -0,0 +1,33 @@
# UISelect 组件选择器
用于在画布中选择组件的选择器。
::: warning 注意
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
:::
## 基础用法
```js
{
type: 'ui-select',
name: 'targetId',
text: '目标组件'
}
```
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |
## 使用说明
1. 点击"点击此处选择"按钮进入选择模式
2. 在画布中点击目标组件完成选择
3. 选择后会显示组件名称和ID
4. 可通过清除按钮清空选择
5. 点击组件名称可跳转到对应组件

View File

@ -0,0 +1,454 @@
# Cascader 级联选择器
当一个数据集合有清晰的层级结构时,可通过级联选择器逐级查看并选择。
## 基础用法
有两种触发子菜单的方式
<demo-block type="form" :config="[{
type: 'cascader',
name: 'cascader',
text: '选项',
placeholder: '请选择',
options: [
{
value: 'zhinan',
label: '指南',
children: [{
value: 'shejiyuanze',
label: '设计原则',
children: [{
value: 'yizhi',
label: '一致'
}, {
value: 'fankui',
label: '反馈'
}]
}, {
value: 'daohang',
label: '导航',
children: [{
value: 'cexiangdaohang',
label: '侧向导航'
}, {
value: 'dingbudaohang',
label: '顶部导航'
}]
}]
},
{
value: 'zujian',
label: '组件',
children: [{
value: 'basic',
label: 'Basic',
children: [{
value: 'layout',
label: 'Layout 布局'
}, {
value: 'color',
label: 'Color 色彩'
}]
}, {
value: 'form',
label: 'Form',
children: [{
value: 'checkbox',
label: 'Checkbox 多选框'
}, {
value: 'input',
label: 'Input 输入框'
}]
}]
}
]
}]"><template #source><p>type为'cascader'</p></template></demo-block>
## 禁用选项
通过在数据源中设置 disabled 字段来声明该选项是禁用的
<demo-block type="form" :config="[{
type: 'cascader',
name: 'cascader',
text: '选项',
placeholder: '请选择',
disabled: true,
options: [
]
}, {
type: 'cascader',
name: 'cascader1',
text: '选项2',
placeholder: '请选择',
options: [
{
value: 'zhinan',
label: '指南',
disabled: true,
children: [{
value: 'shejiyuanze',
label: '设计原则',
children: [{
value: 'yizhi',
label: '一致'
}, {
value: 'fankui',
label: '反馈'
}]
}, {
value: 'daohang',
label: '导航',
children: [{
value: 'cexiangdaohang',
label: '侧向导航'
}, {
value: 'dingbudaohang',
label: '顶部导航'
}]
}]
},
{
value: 'zujian',
label: '组件',
children: [{
value: 'basic',
label: 'Basic',
disabled: true,
children: [{
value: 'layout',
label: 'Layout 布局'
}, {
value: 'color',
label: 'Color 色彩'
}]
}, {
value: 'form',
label: 'Form',
children: [{
value: 'checkbox',
label: 'Checkbox 多选框'
}, {
value: 'input',
disabled: true,
label: 'Input 输入框'
}]
}]
}
]
}]">
<template #source>
<p>
本例中options 指定的数组中的第一个元素含有 disabled: true 键值对因此是禁用的。在默认情况下Cascader 会检查数据中每一项的 disabled 字段是否为 true ,如果你的数据中表示禁用含义的字段名不为 disabled ,可以通过 disabled 属性来指定(详见下方 API 表格)。当然, value 、 label 和 children 这三个字段名也可以通过同样的方式指定。
</p>
</template>
</demo-block>
## 多选
可通过 `multiple = true` 来开启多选模式
<demo-block type="form" :config="[{
type: 'cascader',
name: 'cascader',
text: '选项',
multiple: true,
placeholder: '请选择',
options: [
{
value: 'zhinan',
label: '指南',
children: [{
value: 'shejiyuanze',
label: '设计原则',
children: [{
value: 'yizhi',
label: '一致'
}, {
value: 'fankui',
label: '反馈'
}]
}, {
value: 'daohang',
label: '导航',
children: [{
value: 'cexiangdaohang',
label: '侧向导航'
}, {
value: 'dingbudaohang',
label: '顶部导航'
}]
}]
},
{
value: 'zujian',
label: '组件',
children: [{
value: 'basic',
label: 'Basic',
children: [{
value: 'layout',
label: 'Layout 布局'
}, {
value: 'color',
label: 'Color 色彩'
}]
}, {
value: 'form',
label: 'Form',
children: [{
value: 'checkbox',
label: 'Checkbox 多选框'
}, {
value: 'input',
label: 'Input 输入框'
}]
}]
}
]
}]">
<template #source>
<p>
在开启多选模式后默认情况下会展示所有已选中的选项的Tag
</p>
</template>
</demo-block>
## 任意一级可选
在单选模式下,你只能选择叶子节点;而在多选模式下,勾选父节点真正选中的都是叶子节点。启用该功能后,可让父子节点取消关联,选择任意一级选项。
可通过 `checkStrictly = true` 来设置父子节点取消选中关联,从而达到选择任意一级选项的目的。
<demo-block type="form" :config="[{
type: 'cascader',
name: 'cascader',
text: '选项',
placeholder: '请选择',
checkStrictly: true,
options: [
{
value: 'zhinan',
label: '指南',
children: [{
value: 'shejiyuanze',
label: '设计原则',
children: [{
value: 'yizhi',
label: '一致'
}, {
value: 'fankui',
label: '反馈'
}]
}]
},
{
value: 'zujian',
label: '组件',
children: [{
value: 'basic',
label: 'Basic',
children: [{
value: 'layout',
label: 'Layout 布局'
}, {
value: 'color',
label: 'Color 色彩'
}]
}]
}
]
}]">
<template #source>
<p>
配置 checkStrictly 为 true可选择任意一级选项
</p>
</template>
</demo-block>
## 仅返回选中节点的值
在选中节点改变时,默认返回由该节点所在的各级菜单的值所组成的数组。可通过 `emitPath = false` 设置仅返回该节点的值。
<demo-block type="form" :config="[{
type: 'cascader',
name: 'cascader',
text: '选项',
placeholder: '请选择',
emitPath: false,
checkStrictly: true,
options: [
{
value: 'zhinan',
label: '指南',
children: [{
value: 'shejiyuanze',
label: '设计原则',
children: [{
value: 'yizhi',
label: '一致'
}, {
value: 'fankui',
label: '反馈'
}]
}]
},
{
value: 'zujian',
label: '组件',
children: [{
value: 'basic',
label: 'Basic',
children: [{
value: 'layout',
label: 'Layout 布局'
}, {
value: 'color',
label: 'Color 色彩'
}]
}]
}
]
}]">
<template #source>
<p>
配置 emitPath 为 false仅返回选中节点的值而非完整路径数组
</p>
</template>
</demo-block>
## 值分隔符
当需要将选中值以字符串形式存储时,可通过 `valueSeparator` 指定分隔符,组件会自动将数组转换为字符串存储,读取时也会自动还原。
<demo-block type="form" :config="[{
type: 'cascader',
name: 'cascader',
text: '选项',
placeholder: '请选择',
valueSeparator: '/',
options: [
{
value: 'zhinan',
label: '指南',
children: [{
value: 'shejiyuanze',
label: '设计原则',
children: [{
value: 'yizhi',
label: '一致'
}]
}]
},
{
value: 'zujian',
label: '组件',
children: [{
value: 'basic',
label: 'Basic',
children: [{
value: 'layout',
label: 'Layout 布局'
}]
}]
}
]
}]">
<template #source>
<p>
配置 valueSeparator 为 '/',选中值将以 'zhinan/shejiyuanze/yizhi' 的字符串形式存储
</p>
</template>
</demo-block>
## 远程选项
通过接口请求获取选项列表
<demo-block type="form" :config="[{
type: 'cascader',
name: 'cascader',
text: '选项',
placeholder: '请选择',
remote: true,
option: {
url: 'cascader/remote',
root: 'data',
cache: true,
timeout: 5000,
body: { query: '' },
item: (data) => data
}
}]">
<template #source>
<p>
配置 remote 为 true然后配置 option 对象,而不是 options 数组
</p>
</template>
</demo-block>
同时在 `src/main.ts` 中需要自定义实现请求:
```typescript
app.use(MagicForm, {
request: async (options: any) => {
// 自定义请求实现
},
});
```
## 动态选项
options 支持传入函数,可根据表单其他字段动态生成选项列表
```typescript
{
type: 'cascader',
name: 'cascader',
text: '选项',
options: (mForm, { model, formValue }) => {
// 根据表单值动态返回选项
return [
{ value: 'a', label: '选项A', children: [] }
];
}
}
```
## Cascader Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|------|------|------|--------|--------|
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| placeholder | 输入框占位文本 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form-schema/src/base.ts) | — | false |
| multiple | 是否多选 | boolean | — | false |
| emitPath | 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false则只返回该节点的值 | boolean | — | true |
| checkStrictly | 是否严格的遵守父子节点不互相关联 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form-schema/src/base.ts) | — | false |
| valueSeparator | 合并成字符串时的分隔符 | string / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form-schema/src/base.ts) | — | — |
| popperClass | 弹出内容的自定义类名 | string | — | — |
| remote | 是否为远程搜索 | boolean | — | false |
| options | 选项数据源 | Array / Function | — | — |
| option | 远程选项配置 | Object | — | — |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form-schema/src/base.ts) | — | — |
## options item
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|------|------|------|--------|--------|
| value | 选项的值 | any | — | — |
| label | 选项的标签 | string | — | — |
| children | 子选项 | Array | — | — |
## option远程配置
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|------|------|------|--------|--------|
| url | 请求地址 | string | — | — |
| root | 响应数据的根路径 | string | — | — |
| cache | 是否缓存请求结果 | boolean | — | false |
| timeout | 请求超时时间(毫秒) | number | — | — |
| body | 请求体 | Object / Function | — | — |
| item | 数据转换函数,将响应数据转换为选项格式 | Function | — | — |

View File

@ -0,0 +1,180 @@
# Checkbox 多选框
一组备选项中进行多选
## 基础用法
单独使用可以表示两种状态之间的切换。
<demo-block type="form" :config="[{
type: 'checkbox',
name: 'checkbox',
text: '选项'
}]">
<template #source>
<p>
要使用 Checkbox 组件,只需要配置 type: 'checkbox',选中意味着变量的值为 true。默认绑定变量的值会是 Boolean选中为 true。
</p>
</template>
</demo-block>
## 禁用状态
多选框不可用状态。
<demo-block type="form" :config="[{
type: 'checkbox',
name: 'checkbox',
text: '选项',
disabled: () => true
}]">
<template #source>
<p>
设置 disabled 属性即可,它接受一个 Booleantrue 为禁用,也可以接受一个返回 Boolean 的函数。
</p>
</template>
</demo-block>
## 自定义选中值
通过 `activeValue``inactiveValue` 自定义选中和未选中时的值。
<demo-block type="form" :config="[{
type: 'checkbox',
name: 'checkbox',
text: '选项',
activeValue: 'yes',
inactiveValue: 'no'
}]">
<template #source>
<p>
设置 activeValue 为选中时的值inactiveValue 为未选中时的值。
</p>
</template>
</demo-block>
## 数值类型
当需要绑定数值类型时,可以使用 `filter: 'number'` 配合默认的 activeValue/inactiveValue。
<demo-block type="form" :config="[{
type: 'checkbox',
name: 'checkbox',
text: '选项',
filter: 'number'
}]">
<template #source>
<p>
配置 filter 为 'number' 时,默认 activeValue 为 1inactiveValue 为 0。
</p>
</template>
</demo-block>
## 使用 Label 显示
通过 `useLabel` 属性控制是否使用 label 作为显示内容。
<demo-block type="form" :config="[{
type: 'checkbox',
name: 'checkbox',
text: '选项',
useLabel: true
}]">
<template #source>
<p>
设置 useLabel 为 true 时,不显示 text 内容,由外部 label 控制显示。
</p>
</template>
</demo-block>
## 多选框组
适用于多个勾选框绑定到同一个数组的情景,通过是否勾选来表示这一组选项中选中的项。
<demo-block type="form" :config="[{
type: 'checkbox-group',
name: 'checkbox',
text: '选项',
options: [
{ text: '选项1', value: 1 },
{ text: '选项2', value: 2 },
{ text: '选项3', value: 3 }
]
}]">
<template #source>
<p>
checkbox-group 元素能把多个 checkbox 管理为一组,绑定值为数组类型。
</p>
</template>
</demo-block>
## 多选框组禁用选项
在选项中设置 `disabled` 可禁用单个选项。
<demo-block type="form" :config="[{
type: 'checkbox-group',
name: 'checkbox',
text: '选项',
options: [
{ text: '选项1', value: 1 },
{ text: '选项2', value: 2, disabled: true },
{ text: '选项3', value: 3 }
]
}]">
<template #source>
<p>
在 options 中设置 disabled: true 可禁用该选项。
</p>
</template>
</demo-block>
## 动态选项
options 支持函数形式,可根据表单状态动态生成选项。
```typescript
{
type: 'checkbox-group',
name: 'checkbox',
text: '选项',
options: (mForm, { model, formValue }) => {
// 根据表单值动态返回选项
return [
{ text: '选项A', value: 'a' },
{ text: '选项B', value: 'b' }
];
}
}
```
## Checkbox Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|------|------|------|--------|--------|
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form-schema/src/base.ts) | — | false |
| activeValue | 选中时的值 | string / number | — | truefilter 为 'number' 时默认 1 |
| inactiveValue | 未选中时的值 | string / number | — | falsefilter 为 'number' 时默认 0 |
| useLabel | 是否使用外部 label 显示 | boolean | — | false |
| filter | 值过滤器 | 'number' / Function | — | — |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form-schema/src/base.ts) | — | — |
## CheckboxGroup Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|------|------|------|--------|--------|
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form-schema/src/base.ts) | — | false |
| options | 选项列表 | Array / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form-schema/src/base.ts) | — | — |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form-schema/src/base.ts) | — | — |
## options item
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|------|------|------|--------|--------|
| value | 选项的值 | any | — | — |
| text | 选项的标签 | string | — | — |
| disabled | 是否禁用该选项 | boolean | — | false |

View File

@ -0,0 +1,86 @@
# ColorPicker 颜色选择器
用于颜色选择,支持多种颜色格式,包括透明度设置。
## 基础用法
<demo-block type="form" :config="[{
text: '颜色选择器',
type: 'colorPicker',
name: 'color'
}]">
<template #source>
<p>
type 为 'colorPicker'默认支持透明度选择showAlpha: true
</p>
</template>
</demo-block>
## 禁用状态
<demo-block type="form" :config="[{
text: '颜色选择器',
type: 'colorPicker',
name: 'color',
disabled: true
}]">
<template #source>
<p>
设置 disabled 属性可禁用颜色选择器。
</p>
</template>
</demo-block>
## 设置默认值
<demo-block type="form" :config="[{
text: '颜色选择器',
type: 'colorPicker',
name: 'color',
defaultValue: '#409EFF'
}]">
<template #source>
<p>
通过 defaultValue 设置默认颜色值。
</p>
</template>
</demo-block>
## 带透明度的颜色
颜色选择器默认开启透明度选择,返回值为 rgba 格式。
<demo-block type="form" :config="[{
text: '颜色选择器',
type: 'colorPicker',
name: 'color',
defaultValue: 'rgba(64, 158, 255, 0.5)'
}]">
<template #source>
<p>
支持 rgba 格式的颜色值,可以设置透明度。
</p>
</template>
</demo-block>
## ColorPicker Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|------|------|------|--------|--------|
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form-schema/src/base.ts) | — | false |
| defaultValue | 默认颜色值 | string | — | — |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form-schema/src/base.ts) | — | — |
## 颜色格式说明
支持以下颜色格式:
| 格式 | 示例 | 说明 |
|------|------|------|
| HEX | #409EFF | 十六进制颜色值 |
| RGB | rgb(64, 158, 255) | RGB 颜色值 |
| RGBA | rgba(64, 158, 255, 0.5) | 带透明度的 RGBA 颜色值 |
| HSL | hsl(210, 100%, 63%) | HSL 颜色值 |
| HSLA | hsla(210, 100%, 63%, 0.5) | 带透明度的 HSLA 颜色值 |

View File

@ -0,0 +1,112 @@
# DatePicker 日期选择器
用于选择或输入日期
## 基础用法
<demo-block type="form" :config="[{
type: 'date',
name: 'date',
text: '日期选择器'
}]">
<template #source>
<p>
以日期为基本单位,基础的日期选择控件
</p>
</template>
</demo-block>
## 禁用状态
<demo-block type="form" :config="[{
type: 'date',
name: 'date',
text: '日期选择器',
disabled: () => true
}]">
<template #source>
<p>
通过 <code>disabled</code> 属性禁用日期选择器
</p>
</template>
</demo-block>
## 占位符
<demo-block type="form" :config="[{
type: 'date',
name: 'date',
text: '日期选择器',
placeholder: '请选择日期'
}]">
<template #source>
<p>
通过 <code>placeholder</code> 属性设置输入框占位文本
</p>
</template>
</demo-block>
## 日期格式
使用`format`指定输入框的格式;使用`valueFormat`指定绑定值的格式。
默认情况下,组件的 `format` 默认值为 `YYYY/MM/DD``valueFormat` 默认值为 `YYYY/MM/DD`。以下为可用的格式化字串,以 UTC 2017年1月2日 03:04:05 为例:
:::warning
请注意大小写
:::
| 格式 | 含义 | 备注 | 举例 |
|------|------|------|------|
| `YYYY` | 年 | | 2017 |
| `M` | 月 | 不补0 | 1 |
| `MM` | 月 | | 01 |
| `D` | 日 | 不补0 | 2 |
| `DD` | 日 | | 02 |
| `H` | 小时 | 24小时制不补0 | 3 |
| `HH` | 小时 | 24小时制 | 03 |
| `h` | 小时 | 12小时制须和 `A``a` 使用不补0 | 3 |
| `hh` | 小时 | 12小时制须和 `A``a` 使用 | 03 |
| `m` | 分钟 | 不补0 | 4 |
| `mm` | 分钟 | | 04 |
| `s` | 秒 | 不补0 | 5 |
| `ss` | 秒 | | 05 |
| `x` | JS时间戳 | 组件绑定值为`number`类型 | 1483326245000 |
| `[MM]` | 不需要格式化字符 | 使用方括号标识不需要格式化的字符 (如 [A] [MM]) | MM |
<demo-block type="form" :config="[{
type: 'date',
name: 'date',
text: '日期选择器',
format: 'YYYY-MM-DD',
valueFormat: 'x'
}]">
<template #source>
<p>
设置 <code>valueFormat</code><code>timestamp</code>,绑定值将返回时间戳格式
</p>
</template>
</demo-block>
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------------- |---------- |-------------------------------- |-------- |
| name | 绑定值的字段名 | string | — | — |
| text | 表单标签 | string | — | — |
| placeholder | 输入框占位文本 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| format | 显示在输入框中的格式 | string | 见[日期格式](#日期格式) | YYYY/MM/DD |
| valueFormat | 绑定值的格式。不指定则绑定值为 Date 对象 | string | 见[日期格式](#日期格式) | YYYY/MM/DD |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | — |
## TypeScript 定义
```typescript
interface DateConfig extends FormItem, Input {
type: 'date';
format?: 'YYYY-MM-dd HH:mm:ss' | string;
valueFormat?: 'YYYY-MM-dd HH:mm:ss' | string;
}
```

View File

@ -0,0 +1,46 @@
# DateRangePicker 日期范围选择器
用于选择或输入日期范围
## 基础用法
<demo-block type="form" :config="[{
type: 'daterange',
name: 'daterange',
text: '日期范围'
}]">
<template #source>
<p>
type为'daterange'
</p>
</template>
</demo-block>
## 绑定多个字段
可以通过配置 `names` 来将日期范围绑定到两个不同的字段上。
<demo-block type="form" :config="[{
type: 'daterange',
names: ['startTime', 'endTime'],
text: '日期范围'
}]">
<template #source>
<p>
配置 names 属性,将开始时间和结束时间分别绑定到 startTime 和 endTime 字段。
</p>
</template>
</demo-block>
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------------- |---------- |-------------------------------- |-------- |
| name | 绑定值(数组形式) | string | — | — |
| names | 绑定值(拆分为两个字段) | string[] | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| dateFormat | 日期格式 | string | — | YYYY/MM/DD |
| timeFormat | 时间格式 | string | — | HH:mm:ss |
| valueFormat | 绑定值的格式 | string | — | YYYY/MM/DD HH:mm:ss |
| defaultTime | 默认时间 | Date[] | — | — |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,104 @@
# DateTimePicker 日期时间选择器
在同一个选择器里选择日期和时间
## 基础用法
<demo-block type="form" :config="[{
type: 'datetime',
name: 'dateTime',
text: '日期时间选择器'
}]">
<template #source>
<p>
通过设置 <code>type: 'datetime'</code> 使用日期时间选择器,可以同时选择日期和时间。
</p>
</template>
</demo-block>
## 带占位符
<demo-block type="form" :config="[{
type: 'datetime',
name: 'dateTime',
text: '日期时间选择器',
placeholder: '请选择日期时间'
}]">
<template #source>
<p>
通过 <code>placeholder</code> 属性设置输入框的占位文本。
</p>
</template>
</demo-block>
## 禁用状态
<demo-block type="form" :config="[{
type: 'datetime',
name: 'dateTime',
text: '日期时间选择器',
disabled: () => true
}]">
<template #source>
<p>
通过 <code>disabled</code> 属性禁用日期时间选择器,支持布尔值或函数。
</p>
</template>
</demo-block>
## 日期格式
使用 `format` 指定输入框的格式;使用 `valueFormat` 指定绑定值的格式。
默认情况下,组件接受并返回格式化后的字符串。以下为可用的格式化字串,以 UTC 2017年1月2日 03:04:05 为例:
:::warning
请注意大小写
:::
| 格式 | 含义 | 备注 | 举例 |
|------|------|------|------|
| `YYYY` | 年 | | 2017 |
| `M` | 月 | 不补0 | 1 |
| `MM` | 月 | | 01 |
| `D` | 日 | 不补0 | 2 |
| `DD` | 日 | | 02 |
| `H` | 小时 | 24小时制不补0 | 3 |
| `HH` | 小时 | 24小时制 | 03 |
| `h` | 小时 | 12小时制须和 `A``a` 使用不补0 | 3 |
| `hh` | 小时 | 12小时制须和 `A``a` 使用 | 03 |
| `m` | 分钟 | 不补0 | 4 |
| `mm` | 分钟 | | 04 |
| `s` | 秒 | 不补0 | 5 |
| `ss` | 秒 | | 05 |
| `A` | AM/PM | 仅 `format` 可用,大写 | AM |
| `a` | am/pm | 仅 `format` 可用,小写 | am |
| `x` | JS时间戳毫秒 | 仅 `valueFormat` 可用 | 1483326245000 |
| `X` | Unix时间戳 | 仅 `valueFormat` 可用 | 1483326245 |
<demo-block type="form" :config="[{
type: 'datetime',
name: 'dateTime',
text: '日期时间选择器',
format: 'YYYY-MM-DD HH:mm',
valueFormat: 'x'
}]">
<template #source>
<p>
自定义格式化:显示格式为 <code>YYYY-MM-DD HH:mm</code>,绑定值格式为时间戳。
</p>
</template>
</demo-block>
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------------- |---------- |-------------------------------- |-------- |
| name | 绑定值的字段名 | string | — | — |
| text | 表单标签 | string | — | — |
| placeholder | 输入框占位文本 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| format | 显示在输入框中的格式 | string | 见[日期格式](#日期格式) | YYYY/MM/DD HH:mm:ss |
| valueFormat | 绑定值的格式 | string | 见[日期格式](#日期格式) | YYYY/MM/DD HH:mm:ss |
| defaultTime | 选择日期后的默认时间值 | Date | — | — |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | — |

View File

@ -0,0 +1,36 @@
# Display 只读文本
用于显示,不可编辑
## TS 定义
```typescript
interface Display extends FormItem {
type: 'display';
}
```
点击查看[FormItem](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts)的定义
## 基础用法
<demo-block type="form" :config="[{
type: 'display',
name: 'display',
text: '只读文本',
defaultValue: 'display'
}]">
<template #source>
<p>
在开启多选模式后默认情况下会展示所有已选中的选项的Tag
</p>
</template>
</demo-block>
## Input Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |

View File

@ -0,0 +1,52 @@
# DynamicField 动态表单
根据模型中某个字段的值,动态生成一组表单字段。
## 基础用法
<demo-block type="form" :config="[{
type: 'select',
name: 'type',
text: '类型',
options: [
{ label: '类型A', value: 'a' },
{ label: '类型B', value: 'b' }
]
}, {
type: 'dynamic-field',
text: '动态字段',
dynamicKey: 'type',
returnFields: async (config, model, request) => {
if (model.type === 'a') {
return [{ name: 'fieldA', label: '字段A', defaultValue: 'valueA' }];
} else if (model.type === 'b') {
return [{ name: 'fieldB', label: '字段B', defaultValue: 'valueB' }];
}
return [];
}
}]">
<template #source>
<p>
当“类型”发生变化时,“动态字段”会根据 `returnFields` 返回的配置生成不同的输入框。
</p>
</template>
</demo-block>
:::warning
特别注意:`dynamic-field` 的上一级配置必须设置 `extensible: true`,才能保存未在 schema 中声明的动态字段。
:::
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------------- |---------- |-------------------------------- |-------- |
| type | 组件类型 | string | dynamic-field | — |
| text | 表单标签 | string | — | — |
| dynamicKey | 监听的字段名。当该字段值变化时,触发 `returnFields` 重新计算 | string | — | — |
| returnFields | 返回字段列表的函数 | (config, model, request) => Promise<Field[]> | — | — |
### Field 对象结构
| 参数 | 说明 | 类型 | 默认值 |
|---------- |-------------- |---------- |-------- |
| name | 字段名 | string | — |
| label | 标签名 | string | — |
| defaultValue | 默认值 | any | — |

View File

@ -0,0 +1,32 @@
# Hidden 隐藏域
改值体现于最终提交的表单中用于例如编辑记录的id这种场景中
## TS 定义
```typescript
interface Hidden extends FormItem {
type: 'hidden';
}
```
点击查看[FormItem](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts)的定义
## 基础用法
<demo-block type="form" :config="[{
type: 'hidden',
name: 'hidden'
}]">
<template #source>
<p>
在开启多选模式后默认情况下会展示所有已选中的选项的Tag
</p>
</template>
</demo-block>
## Input Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |

View File

@ -0,0 +1,64 @@
# Link 链接
用于显示,不可编辑
## TS 定义
```typescript
interface Link extends FormItem {
type: 'link';
href?: string | typeof LinkHrefFunction;
css?: {
[key: string]: string | number;
};
disabledCss?: {
[key: string]: string | number;
};
formTitle?: string;
formWidth?: number | string;
displayText?: string | typeof LinkDisplayTextFunction;
form: FormConfig | typeof LinkFormFunction;
}
```
点击查看[FormItem](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts)的定义
## 基础用法
<demo-block type="form" :config="[{
type: 'link',
name: 'link',
text: '链接',
href: 'https://tencent.github.io/tmagic-editor/playground/index.html#/'
}]">
<template #source>
<p>
在开启多选模式后默认情况下会展示所有已选中的选项的Tag
</p>
</template>
</demo-block>
## 打开表单
<demo-block type="form" :config="[{
type: 'link',
name: 'link',
text: '链接',
form: [{
name: 'text',
text: 'input'
}]
}]">
<template #source>
<p>
在开启多选模式后默认情况下会展示所有已选中的选项的Tag
</p>
</template>
</demo-block>
## Input Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |

View File

@ -0,0 +1,26 @@
# NumberRange 数字范围输入框
用于输入数字范围
## 基础用法
<demo-block type="form" :config="[{
type: 'number-range',
name: 'numberRange',
text: '数字范围'
}]">
<template #source>
<p>
type为'number-range'
</p>
</template>
</demo-block>
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------------- |---------- |-------------------------------- |-------- |
| name | 绑定值(数组形式 [min, max] | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| clearable | 是否可清空 | boolean | — | true |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,63 @@
# InputNumber 计数器
仅允许输入标准的数字值,可定义范围
## 基础用法
<demo-block type="form" :config="[{
type: 'number',
name: 'number',
text: '计数器'
}]">
<template #source>
<p>
type为'number'
</p>
</template>
</demo-block>
## 禁用状态
<demo-block type="form" :config="[{
type: 'number',
name: 'number',
text: '计数器',
disabled: () => true
}]">
<template #source>
<p>
disabled 属性接受一个 Boolean设置为 true 即可禁用整个组件,也可以接受一个返回 Boolean 的函数,如果你只需要控制数值在某一范围内,可以设置 min 属性和 max 属性,不设置 min 和 max 时,最小值为 0。
</p>
</template>
</demo-block>
## 步数
允许定义递增递减的步数控制
<demo-block type="form" :config="[{
type: 'number',
name: 'number',
text: '计数器',
step: 10
}]">
<template #source>
<p>
设置 step 属性可以控制步长,接受一个 Number 。
</p>
</template>
</demo-block>
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|----------|-------------- |----------|-------------------------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| placeholder | 输入框占位文本 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| min | 设置计数器允许的最小值 | number | — | -Infinity |
| max | 设置计数器允许的最大值 | number | — | Infinity |
| step | 计数器步长 | number | — | 1 |
| tooltip | 输入框提示信息 | string | — | — |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,67 @@
# Radio 单选框
在一组备选项中进行单选
## TS 定义
```typescript
interface RadioGroup extends FormItem {
type: 'radio-group';
options: {
value: any;
text: string;
}[];
}
```
点击查看[FormItem](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts)的定义
## 基础用法
由于选项默认可见,不宜过多,若选项过多,建议使用 Select 选择器。
<demo-block type="form" :config="[{
type: 'radio-group',
name: 'radio',
text: '选项',
options: [
{ text: '选项1', value: 1 },
{ text: '选项2', value: 2 }
]
}]">
<template #source>
<p>
要使用 Radio 组件只需要配置type: 'radio-group'。
</p>
</template>
</demo-block>
## 禁用状态
单选框不可用的状态。
<demo-block type="form" :config="[{
type: 'radio-group',
name: 'radio',
text: '选项',
options: [
{ text: '选项1', value: 1 },
{ text: '选项2', value: 2 }
],
disabled: () => true
}]">
<template #source>
<p>
只要在配置中设置 disabled 属性即可,它接受一个 Boolean true 为禁用,也可以接受一个返回 Boolean 的函数。
</p>
</template>
</demo-block>
## RadioGroup Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| options | 选项 | Array | — | - |
| onChange | 值变化时触发的函数 | [OnChangeHandler ](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,209 @@
# Select 选择器
当选项过多时,使用下拉菜单展示并选择内容。
## 基础用法
适用广泛的基础单选
<demo-block type="form" :config="[{
type: 'select',
name: 'select',
text: '选项',
placeholder: '请选择',
options: [
{ text: '选项1', value: 1 },
{ text: '选项2', value: 2 }
]
}]">
<template #source>
<p>
type为'select'
</p>
</template>
</demo-block>
## 有禁用选项
<demo-block type="form" :config="[{
type: 'select',
name: 'select',
text: '选项',
placeholder: '请选择',
options: [
{ text: '选项1', value: 1 },
{ text: '选项2', value: 2, disabled: true }
]
}]">
<template #source>
<p>
在 opitons 选项配置中,设定 disabled 值为 true即可禁用该选项
</p>
</template>
</demo-block>
## 禁用状态
选择器不可用状态
<demo-block type="form" :config="[{
type: 'select',
name: 'select',
text: '选项',
placeholder: '请选择',
disabled: true,
options: [
{ text: '选项1', value: 1 },
{ text: '选项2', value: 2 }
]
}]">
<template #source>
<p>
为 el-select 设置 disabled 属性,则整个选择器不可用
</p>
</template>
</demo-block>
## 基础多选
适用性较广的基础多选,用 Tag 展示已选项
<demo-block type="form" :config="[{
type: 'select',
name: 'select',
text: '选项',
placeholder: '请选择',
multiple: true,
options: [
{ text: '选项1', value: 1 },
{ text: '选项2', value: 2 },
{ text: '选项3', value: 3 }
]
}]"></demo-block>
## 分组
备选项进行分组展示
<demo-block type="form" :config="[{
type: 'select',
name: 'select',
text: '选项',
placeholder: '请选择',
group: true,
options: [
{
label: 'group1',
options: [
{ text: '选项1', value: 1 },
{ text: '选项2', value: 2 },
{ text: '选项3', value: 3 }
],
disabled: true
}, {
label: 'group2',
options: [
{ text: '选项4', value: 4 },
{ text: '选项5', value: 5 },
{ text: '选项6', value: 6 }
]
}
]
}]">
<template #source>
<p>
配置group为true
</p>
</template>
</demo-block>
## 创建条目
可以创建并选中选项中不存在的条目
<demo-block type="form" :config="[{
type: 'select',
name: 'select',
text: '选项',
placeholder: '请选择',
allowCreate: true,
options: [
{ text: '选项1', value: 1 },
{ text: '选项2', value: 2 }
]
}]"></demo-block>
## 远程选项
通过接口请求获取选项列表
<demo-block type="form" :config="[{
type: 'select',
name: 'select',
text: '选项',
placeholder: '请选择',
remote: true,
option: {
url: 'select/remote',
root: 'data',
method: 'post',
mode: 'cors',
headers: { 'Content-Type': 'application/json' },
body: { query: '' },
json: true,
text: option => `${option.name}`,
value: option => `${option.id}`,
}
}]">
<template #source>
<p>
配置remote为true然后配置option而不是options
</p>
</template>
</demo-block>
同时在 `src/main.ts` 中需要自定义实现请求
```typescript
app.use(MagicForm, {
request: async (options: any) => {
// 自定义请求实现
},
});
```
:::tip
如果 Select 的绑定值为对象类型,请务必指定 valueKey 作为它的唯一性标识。
:::
## Select Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------------- |---------- |-------------------------------- |-------- |
| name | 绑定值 | string | — | — |
| placeholder | 输入框占位文本 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| multiple | 是否多选 | boolean | — | false |
| valueKey | 作为 value 唯一标识的键名,绑定值为对象类型时必填 | string | — | value |
| allowCreate | 是否允许用户创建新条目 | boolean | — | false |
| remote | 是否为远程搜索 | boolean | — | false |
| group | 是否选择分组 | boolean | — | false |
| onChange | 值变化时触发的函数 | [OnChangeHandler ](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |
| options | 选项 | Array | — | - |
| option | 选项 | Object | — | - |
## options item
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------------- |---------- |-------------------------------- |-------- |
| text | | 选项的标签 | string/number/object | — | — |
| value | 选项的值 | string | — | — |
| disabled | 是否禁用 | boolean | — | false |
| label | string | — | — | — |
| options | Array | — | — | — |
## option
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------------- |---------- |-------------------------------- |-------- |
| url | string | — | — | — |
| root | string | — | — | — |
| text | string / Function | — | — | — |
| value | string / Function | — | — | — |

View File

@ -0,0 +1,52 @@
# Switch 开关
表示两种相互对立的状态间的切换,多用于触发「开/关」。
## 基本用法
<demo-block type="form" :config="[{
type: 'switch',
name: 'switch',
text: '开关'
}]"></demo-block>
## 扩展的 value 类型
<demo-block type="form" :config="[{
type: 'switch',
name: 'switch',
text: '开关',
activeValue: 'on',
inactiveValue: 'off'
}]">
<template #source>
<p>
设置 activeValue 和 inactiveValue 属性,接受 Boolean , String 或 Number 类型的值。
</p>
</template>
</demo-block>
## 禁用状态
<demo-block type="form" :config="[{
type: 'switch',
name: 'switch',
text: '开关',
disabled: true
}]">
<template #source>
<p>
设置 disabled 属性,接受一个 Boolean设置 true 即可禁用。
</p>
</template>
</demo-block>
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| disabled | 是否禁用 | boolean / [Function](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| active-value | switch 打开时的值 | boolean / string / number | — | true |
| inactive-value | switch 关闭时的值 | boolean / string / number | — | false |

View File

@ -0,0 +1,129 @@
# Input 输入框
通过鼠标或键盘输入字符
## 基础用法
<demo-block type="form" :config="[{
name: 'text',
text: '输入框'
}]">
<template #source>
<p>
Input输入框的type为'text', 是type的默认值所以可以不配置
</p>
</template>
</demo-block>
## 禁用状态
<demo-block type="form" :config="[{
name: 'text',
text: '输入框',
disabled: () => true
}]">
<template #source>
<p>
通过 disabled 属性指定是否禁用 input 组件
</p>
</template>
</demo-block>
## 复合型输入框
后置内容
<demo-block type="form" :config="[{
name: 'text',
text: '重量',
append: '公斤'
}]">
<template #source>
<p>
可以通过配置append来增加一个后置内容。
</p>
</template>
</demo-block>
<demo-block type="form" :config="[{
name: 'text',
text: '输入框',
append: {
type: 'button',
text: '操作',
handler: (vm) => {
vm.$message(vm.mForm.values.text);
}
}
}]">
<template #source>
<p>
可以通过配置append来增加一个后置按钮。
</p>
</template>
</demo-block>
## 过滤内容
<demo-block type="form" :config="[{
name: 'text',
text: '输入框',
filter: 'number'
}]">
<template #source>
<p>
设置filter为'number',可以将值转换成数值,也可以配置一个函数来自由转换。
</p>
</template>
</demo-block>
## 去掉首尾空格
<demo-block type="form" :config="[{
name: 'text',
text: '输入框',
trim: true
}]">
<template #source>
<p>
设置trim为true',可以去掉首尾空格。
</p>
</template>
</demo-block>
## 显示详情
<demo-block type="form" :config="[{
name: 'text',
text: '输入框',
tooltip: true
}]">
<template #source>
<p>
在开启多选模式后默认情况下会展示所有已选中的选项的Tag
</p>
</template>
</demo-block>
## Input Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| text | 表单标签 | string | — | — |
| placeholder | 输入框占位文本 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| clearable | 是否可清空 | boolean | — | true |
| tooltip | 输入时显示内容 | string | — | — |
| trim | 是否去掉首尾空格 | boolean | — | false |
| filter | 过滤值 | string / Function | number | - |
| prepend | 前置内容 | string | — | - |
| append | 后置内容 | string / Object | — | - |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |
## append Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| type | 内容类型 | string | button | — |
| text | 文本内容 | string | — | — |
| handler | 点击操作 | Function | — | - |

View File

@ -0,0 +1,42 @@
# Textarea 文本域
## 基础用法
<demo-block type="form" :config="[{
type: 'textarea',
name: 'textarea',
text: '文本域'
}]">
<template #source>
<p>
在开启多选模式后默认情况下会展示所有已选中的选项的Tag
</p>
</template>
</demo-block>
## 禁用状态
<demo-block type="form" :config="[{
type: 'textarea',
name: 'textarea',
text: '文本域',
disabled: () => true
}]">
<template #source>
<p>
通过 disabled 属性指定是否禁用 input 组件
</p>
</template>
</demo-block>
## Input Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| name | 绑定值 | string | — | — |
| placeholder | 输入框占位文本 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| placeholder | 输入框占位文本 | string | — | — |
| trim | 是否去掉首尾空格 | boolean | — | false |
| filter | 过滤值 | string / Function | number | - |
| onChange | 值变化时触发的函数 | [OnChangeHandler ](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -0,0 +1,41 @@
# TimePicker 时间选择器
用于选择或输入日期
## 基础用法
<demo-block type="form" :config="[{
type: 'time',
name: 'time',
text: '时间选择器'
}]">
<template #source>
<p>
在开启多选模式后默认情况下会展示所有已选中的选项的Tag
</p>
</template>
</demo-block>
## 禁用状态
<demo-block type="form" :config="[{
type: 'time',
name: 'time',
text: '时间选择器',
disabled: () => true
}]">
<template #source>
<p>
在开启多选模式后默认情况下会展示所有已选中的选项的Tag
</p>
</template>
</demo-block>
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------------- |---------- |-------------------------------- |-------- |
| name | 绑定值 | string | — | — |
| placeholder | 输入框占位文本 | string | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [Function](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |

View File

@ -0,0 +1,45 @@
# TimeRangePicker 时间范围选择器
用于选择或输入时间范围
## 基础用法
<demo-block type="form" :config="[{
type: 'timerange',
name: 'timerange',
text: '时间范围'
}]">
<template #source>
<p>
type为'timerange'
</p>
</template>
</demo-block>
## 绑定多个字段
可以通过配置 `names` 来将时间范围绑定到两个不同的字段上。
<demo-block type="form" :config="[{
type: 'timerange',
names: ['startTime', 'endTime'],
text: '时间范围'
}]">
<template #source>
<p>
配置 names 属性,将开始时间和结束时间分别绑定到 startTime 和 endTime 字段。
</p>
</template>
</demo-block>
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------------- |---------- |-------------------------------- |-------- |
| name | 绑定值(数组形式) | string | — | — |
| names | 绑定值(拆分为两个字段) | string[] | — | — |
| text | 表单标签 | string | — | — |
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | false |
| format | 显示格式 | string | — | HH:mm:ss |
| valueFormat | 绑定值的格式 | string | — | HH:mm:ss |
| defaultTime | 默认时间 | Date[] | — | — |
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts) | — | - |

View File

@ -19,7 +19,8 @@
<demo-block type="form" :config="[{
type: 'row',
labelWidth: 100,
labelWidth: '100px',
span: 8,
items: [{
name: 'text',
text: '配置1',
@ -33,7 +34,7 @@
}, {
type: 'row',
span: 12,
labelWidth: 100,
labelWidth: '100px',
items: [{
name: 'text4',
text: '配置1',
@ -50,11 +51,11 @@
<demo-block type="form" :config="[{
name: 'text0',
labelWidth: 100,
labelWidth: '100px',
text: '配置0',
}, {
type: 'row',
labelWidth: 100,
labelWidth: '100px',
items: [{
name: 'text',
text: '配置1',
@ -86,7 +87,7 @@
<demo-block type="form" :config="[{
type: 'fieldset',
labelWidth: 100,
labelWidth: '100px',
legend: 'fieldset',
items: [{
name: 'text',
@ -177,3 +178,38 @@
label: '配置1',
}]
}]"></demo-block>
### step
<demo-block type="form" :config="[{
type: 'step',
items: [{
title: '步骤1',
items: [{
name: 'text',
text: '配置1',
}]
}, {
title: '步骤2',
items: [{
name: 'text2',
text: '配置2',
}]
}]
}]"></demo-block>
### flex-layout
<demo-block type="form" :config="[{
type: 'flex-layout',
gap: '20px',
items: [{
name: 'text',
text: '配置1',
span: 12
}, {
name: 'text2',
text: '配置2',
span: 12
}]
}]"></demo-block>

View File

@ -0,0 +1,37 @@
# 联动
## 显隐
<demo-block type="form" :config="[{
name: 'switch',
text: '显示text',
type: 'switch'
}, {
name: 'text2',
text: '配置2',
display: (state, { model }) => model.switch
}]"></demo-block>
## 输入关联
<demo-block type="form" :config="[{
name: 'firstName',
text: '名',
onChange: (state, v, { model }) => {
model.fullName = `${model.lastName}${model.firstName}`
},
defaultValue: '三'
}, {
name: 'lastName',
text: '姓',
onChange: (state, v, { model }) => {
model.fullName = `${model.lastName}${model.firstName}`
},
defaultValue: '张'
}, {
name: 'fullName',
text: '姓名',
type: 'display',
defaultValue: '张三'
}]"></demo-block>

View File

@ -0,0 +1,92 @@
# 代码块
代码块是一种低代码能力tmagic-editor中对组件的逻辑干预主要通过代码块来进行支持
## 能力展示
代码块支持的能力有
- 1、在线编辑
- 2、参数定义包括参数类型定义
- 3、自动保存草稿
- 4、参数注释
下面将主要介绍代码块的实现原理包含dsl结构定义以及代码块挂载执行时机等
## 协议描述
我们将在线编写的代码内容保存在[DSL](../advanced/js-schema.md)中与app同一层级这样的好处是代码块可以在同一活动不同页面中实现灵活编排。
类型定义参见[CodeBlockDsl](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/schema/src/index.ts#L75)。
```javascript
[{
id: 123456,
type: 'app',
items: [{
id: 222222,
type: 'page',
items: [{
id: 333,
type: 'comp-A'
}]
}],
codeBlocks: {
code_123: {
name: '代码块名称',
content: ()=>{},
params: [{
name: '参数1'
}]
}
}
}]
```
在页面中创建代码块也就是会将新的代码内容添加到DSL中的codeBlocks数组并保存下来这里涉及的逻辑可以参见CodeBlock类中的[setCodeDslById](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/editor/src/services/codeBlock.ts#L107)方法。
并且可以在编辑器左侧的“代码块”tab下看到当前活动的代码块列表
<img src="/code-block.png" alt="代码块列表">
## 组件绑定
代码块的初衷是为了实现对组件逻辑的在线干预代码执行的时机平台提供了组件created, mounted两个钩子因此我们需要将创建的代码与组件进行关联。
<img src="https://vip.image.video.qpic.cn/vupload/20230228/4a34a11677585505930.png" alt="组件绑定代码块">
选中组件之后,在组件配置-高级tab下需要支持下拉选择代码块以及代码参数的输入。由于每一个组件绑定代码块的需求都是相同的因此这一部分我们可以抽出为公共的表单配置相关的逻辑处理在[prop文件](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/editor/src/utils/props.ts#L223)中我们在高级tab下统一添加了名为created和mounted两个配置项表单组件使用了自定义的'code-select'。前面已经提过表单组件会按照type字段来进行渲染即 :is="${type}"[CodeSelect](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/editor/src/fields/CodeSelect.vue)组件是在editor中自定义的
完成绑定的动作实质就是在组件配置中增加与代码块的映射关系
```javascript
[
{
id: '111',
type: 'comp_A',
created: {
hookType: 'code',
hookData: [
{
codeId: 'code_123',
params: {
age: 12,
studentName: 'lisa'
}
}
]
}
}
]
```
## 代码内容注入与执行
在实现代码块创建和绑定操作之后DSL已经包含了代码块执行所需的所有信息接下来我们在页面加载时对代码块进行解析并在适当的时机运行。
由于代码块的执行时机为组件createdmounted因此触发执行的动作需要在runtime中完成对于VUE3来说我们在组件对应的生命周期去触发就可以了react则需要在类似的时间点去触发详细请参见[ui](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui/src/useApp.ts#L29)
接收事件的动作是在[Core](https://github.com/Tencent/tmagic-editor/blob/c143a5f7670ae61d80c1a2cfcc780cfb5259849d/packages/core/src/Node.ts)中完成的请记得前面提到过Core主要负责对组件进行跨框架管理与一些通用复杂逻辑的实现触发时机各个框架不同但接收事件并执行代码块的逻辑与框架无关。[Core/Node](https://github.com/Tencent/tmagic-editor/blob/master/packages/core/src/Node.ts#L56)会对生命周期事件进行监听并根据组件绑定的代码块ID拿到具体的代码内容然后执行。在执行调用时我们以{ app, params }的形式传入了两个参数其中app包含了全局的变量params为组件绑定时针对代码块传入的参数。
至此,我们就完成了代码块创建-绑定-注入-运行。与代码块功能相关的UI界面中我们也提供了丰富的插槽供开发者扩展相关源码请见[sidebar/codeBlock](https://github.com/Tencent/tmagic-editor/tree/master/packages/editor/src/layouts/sidebar/code-block)。
## 代码块界面展示
侧边栏的代码块列表可以查看当前创建的代码块以及每个代码块绑定的组件点击代码块下方展示的组件icon可以在画布中选中该组件
<img src="/code-block-list.png" alt="代码块列表">
代码块编辑面板,可以在这里编写代码内容,申明参数
<img src="https://vip.image.video.qpic.cn/vupload/20230228/1fd2e11677637006239.png" alt="代码块编辑面板">
组件高级tab下绑定代码块可以输入参数值查看注释打开代码编辑面板
<img src="https://vip.image.video.qpic.cn/vupload/20230301/b2c8431677637119126.png" alt="绑定代码块">
保存后点击预览,可以看到在控制台打出了我们打印的日志内容
<img src="https://vip.image.video.qpic.cn/vupload/20230301/672f8a1677637682103.png" alt="预览">

View File

@ -0,0 +1,152 @@
# 联动原理
tmagic-editor的联动指这两种情况
- 在编辑器中,组件的表单配置项之间需要联动。
- 页面中的组件之间,需要联动触发行为。
## 表单联动
表单的详细内容,可以参考[@tmagic/form](./tmagic-form)。我们通过 [JS Schema](./js-schema) 描述的表单配置,实现联动的方式,就是写一个简单 js 函数。
比如下面的例子,我们希望改变选项时,同时改变文本框的内容。
<demo-block type="form" :config="`[{
text: '文本',
name: 'text'
}, {
type: 'select',
text: '下拉选项',
name: 'select',
options: [
{ text: '选项1', value: 1 },
{ text: '选项2', value: 2 }
],
onChange: (vm, value, { model }) => {
model.text = value;
}
}]`">
</demo-block>
在经过表单渲染器时,所有指出函数 API 都会传入当前渲染的**表单组件实例(vm)****当前项目(value)****当前表单model****表单值formValue**model 即 vue 的[表单输入绑定](https://v3.cn.vuejs.org/guide/forms.html#%E5%9F%BA%E7%A1%80%E7%94%A8%E6%B3%95),可以通过修改他来实现值联动。
当然我们也可以通过上述的参数传入,以及其他函数 API 实现更多灵活的表单联动,具体参考[表单 API](../../form-config/relate)。
## 组件联动
tmagic-editor在 @tmagic/core 中,实现了组件的事件绑定/分发机制。在组件渲染时,每个组件在 @tmagic/ui 中经过基础组件渲染时,会被基础组件注入公共方法的实现。如下对按钮配置了**点击使文本隐藏**的联动事件,那么在对应按钮被点击时,将会触发对应绑定文本的隐藏。
<img src="https://image.video.qpic.cn/oa_88b7d-10_2117738923_1637238863127559">
### 添加组件自定义事件
如何开发一个完整组件可以参考[组件开发](../component),这一节我们主要讲述如何配置定义事件。
在组件开发过程中,我们可以通过声明组件中的 event 文件,在文件中描述当前组件可以配置的事件名,和可以被触发的动作。
```javascript
// event.js
export default {
events: [
{
label: '完成某事件',
value: 'yourComponent:finishSomething',
},
],
methods: [
{
label: '弹出 Toast',
value: 'toast',
},
],
};
```
其中events 的 value 是个事件名,是 `string` 类型,为了避免和其他组件事件名重复,应该添加上一些前缀。
而 methods 中的 value 则是一个挂载在组件上的可执行函数。我们会在事件触发时,分发到对应组件上,并执行对应组件实例上的方法。
配置了上述内容的组件,在编辑器中选中当前组件,要触发其他组件的联动事件时,会有如下选项
<img src="https://image.video.qpic.cn/oa_88b7d-32_1191352525_1637240258489761">
在被其他组件选中为联动组件,要触发联动事件,会有如下选项
<img src="https://image.video.qpic.cn/oa_fd3c9c-3_214972289_1637240375129207">
### 组件中的代码实现
如上面提到的,我们定制了**完成某件事**这个事件,以及要提供一个**弹出 Toast**的方法。在组件中必要的实现内容如下。
#### vue 版本实现
我们主要讲解 vue3 的 setup 实现。vue2 可以根据 vue3 同理转换成 options api 实现即可。
```vue
<!-- Test.vue -->
<template>
<div @click="onClick">
<!-- your component code -->
</div>
</template>
<script lang="ts" setup>
import { type ComponentProps, registerNodeHooks, useApp } from '@tmagic/vue-runtime-help';
const props = defineProps<ComponentProps>()
const { app, node } = useApp(props);
const onClick = () => {
// app.emit 第一个参数为事件名,其余参数为你要传给接受事件组件的参数
app.emit("yourComponent:finishSomething", node, /*可以传参给接收方*/);
};
// 此处实现事件动作
const toast = () => {
toast('测试 vue3')
};
// 实际触发时是调用node上的方法所以需要将改方法暴露到node上
registerNodeHooks(node, {
toast,
});
defineExpose({
toast,
});
</script>
```
#### react 版本实现
在 react 的实现中由于tmagic-editor提供的 @tmagic/ui-react 版本是用 hook 实现的。所以组件开发我们也相应的需要使用 hook 方式。
```jsx
import React from 'react';
import { useApp } from '@tmagic/ui-react';
function Test({ config }) {
// react 和 vue 实现不同,我们通过 useApp 这个 hook 来提供 app 等核心内容
const { app } = useApp({
config,
// 此处实现事件动作
// 通过向 useApp 这个 hook 提供 methods 方法
// tmagic-editor会将该事件注册到事件机制中在对应事件响应被触发时调用对应方法
methods: {
toast: (/*接收触发事件组件传进来的参数*/) => {
toast('测试 react');
},
},
});
const onClickFunc = () => {
// app.emit 第一个参数为事件名,其余参数为你要传给接受事件组件的参数
app?.emit("yourComponent:finishSomething", /*可以传参给接收方*/);
}
return (
<div
id={config.id}
style={app.transformStyle(config.style || {})}
onClick={onClick}
>
// your component code
</div>
);
}
export default Test;
```

View File

@ -0,0 +1,105 @@
# 数据源
## 使用数据源
### 添加数据源
在编辑器左侧边栏中选中数据源,在数据源面板右上角添加中选择对应的数据源类型(默认提供了两种基础的数据源)
[![alt 数据源列表](/data-source.png "数据源列表")](/data-source.png){target="_blank"}
### 配置属性字段
[![alt 新增数据源](/create-data-source.png "新增数据源")](/create-data-source.png){target="_blank"}
#### 基础数据源
静态数据,不会自动更新,可以通过配置方法,在方法中更新数据源
```js
({ dataSource, app }) => {
dataSource.setData({
// 数据
});
}
```
然后再组件的事件联动中关联此方法,来触发数据源更新
#### HTTP数据源
通过配置HTTP相关参数(url, query, body, header等)通过网络api获取数据该数据源拥有request方法可通过此方法来刷新数据源
```js
({ dataSource, app }) => {
dataSource.request();
}
```
### 在组件中使用
#### 数据源模板输入框data-source-input
formConfig.js
```js
[
{
type: 'data-source-input'
}
]
```
[![alt 数据源模版](/data-source-input.png "数据源模版")](/data-source-input.png){target="_blank"}
#### 数据源字段选择器输入框data-source-field-select)
formConfig.js
```js
[
{
type: 'data-source-filed-select'
}
]
```
#### 数据源选择器data-source-select)
formConfig.js
```js
[
{
type: 'data-source-select'
}
]
```
#### 数据源方法选择器data-source-method-select)
formConfig.js
```js
[
{
type: 'data-source-method-select'
}
]
```
#### 显示条件
当配置的条件成立时显示,反之隐藏
[![alt 显示条件](/display-cond.png "显示条件")](/display-cond.png){target="_blank"}
## 数据源开发
### 数据源规范
数据源的基础形式,需要有四个文件
- index 入口文件,引入下面几个文件
- formConfig 表单配置描述
- initValue 表单初始值
- event 定义联动事件,具体可以参考[组件联动](./coupling.html#组件联动)
- dataSource 数据源逻辑代码

View File

@ -1,19 +1,19 @@
# JS Schema
魔方的业务组件需要有表单配置能力,我们通过一份配置来描述表单,我们采用的描述方案是 JS schema。当我们在编辑器中配置一个页面时页面的基本信息和页面包含的组件信息也是采用 JS schema 描述的。JS schema 描述方案,,也是我们提供[高级函数](/docs/guide/advanced/high-level-function)功能的基础。
tmagic-editor的业务组件需要有表单配置能力,我们通过一份配置来描述表单,我们采用的描述方案是 JS schema。当我们在编辑器中配置一个页面时页面的基本信息和页面包含的组件信息也是采用 JS schema 描述的。JS schema 描述方案,也是我们提供[代码块](../advanced/code-block)功能的基础。
组件的**配置描述**,参考[示例](/docs/guide/advanced/magic-form.html#示例),是由开发者在开发组件时,通过 [Magic-Form](/docs/guide/advanced/magic-form) 支持的表单项来提供的。
组件的**配置描述**,参考[示例](./tmagic-form.html#示例),是由开发者在开发组件时,通过 [@tmagic/form](./tmagic-form) 支持的表单项来提供的。
在编辑器中对页面进行编辑,保存得到的是一份关于页面基本信息、页面所包含组件以及组件配置信息的配置,我们称为 **uiconfig**,这份配置是最终页面渲染需要的描述信息。
在编辑器中对页面进行编辑,保存得到的是一份关于页面基本信息、页面所包含组件以及组件配置信息的配置,我们称为 **DSL**,这份配置是最终页面渲染需要的描述信息。
JS schema 本质即是一个 js 对象,这个形式可以支持我们在组件的表单配置描述中,直接进行函数编写,功能灵活,对于前端开发来说更符合直觉,几乎没有理解成本。
## 表单配置
组件中的表单配置描述,在经过 Magic-Form 表单渲染器后,可以生成表单栏的配置项。在表单栏中对表单进行配置,配置数据将动态写入 uiconfig 中。
组件中的表单配置描述,在经过 @tmagic/form 表单渲染器后,可以生成表单栏的配置项。在表单栏中对表单进行配置,配置数据将动态写入 DSL 中。
<img src="https://image.video.qpic.cn/oa_88b7d-36_673631168_1636343947880034?imageView2/q/70">
## uiconfig
编辑器中生成的 uiconfig 序列化存储后,在发布时,将其作为 js 文件发布出去,供生成页使用。一个生成页最终保存的 uiconfig 配置示例如下:
## DSL
编辑器中生成的 DSL 序列化存储后,在发布时,将其作为 js 文件发布出去,供生成页使用。一个生成页最终保存的 DSL 配置示例如下:
```javascript
{
@ -27,7 +27,7 @@ JS schema 本质即是一个 js 对象,这个形式可以支持我们在组件
type: "page",
name: "index",
title: "1",
isAbsoluteLayout: true,
layout: "absolute",
style: {
width: "375",
height: "1728",
@ -36,27 +36,9 @@ JS schema 本质即是一个 js 对象,这个形式可以支持我们在组件
id: "39381280",
items: [
{
dtEid: "container",
type: "container",
name: "组",
id: "98549062",
renderType: 0,
reportType: "module",
time: 1623850856402,
report: {
module: {
_module: "组_98549062",
eid: "container"
}
},
devconfig: {
lock: false,
pack: false,
resizable: true,
aspectRatio: false,
ratio: 1,
modify: false
},
items: [
{
type: "button",
@ -86,7 +68,6 @@ JS schema 本质即是一个 js 对象,这个形式可以支持我们在组件
}
],
created: ()=>{},
renderType: 1,
text: "请输入文本内容",
},
{
@ -103,7 +84,6 @@ JS schema 本质即是一个 js 对象,这个形式可以支持我们在组件
name: "文本",
text: "请输入文本内容",
multiple: true,
renderType: 1
},
{
type: "button",
@ -119,7 +99,6 @@ JS schema 本质即是一个 js 对象,这个形式可以支持我们在组件
name: "按钮",
text: "请输入文本内容",
multiple: true,
renderType: 1
}
],
style: {

View File

@ -0,0 +1,49 @@
# 布局原理
tmagic-editor的布局实现方式**关键在于将布局配置指定在容器上,对容器内的所有子组件生效**这是tmagic-editor页面可以支持各种布局方式混合使用的核心方法。
## 容器
前面概念介绍中有提到tmagic-editor的容器是组件的基础。组件必属于某个容器容器下可以放组件也可以放容器。页面本身就是一个容器是所有容器和组件的根整个页面的容器和组件组成一个树状结构。在 DSL 配置中,表现为:
```javascript
[{
id: 123456,
type: 'page',
items: [{
id: 222222,
type: 'comp-A',
}, {
id: 333333,
type: 'comp-B',
}]
}]
```
## 顺序/绝对定位
组件是绝对或者顺序定位,体现在组件的**直属父级容器**上,比如我们将 page 设置为绝对定位,则它的子组件,全都为绝对定位。在 DSL 配置中,表现为:
```javascript
[{
id: 123456,
type: 'page',
layout: "absolute",
items: [{
id: 222222,
type: 'comp-A',
style: {
position: 'absolute',
},
}, {
id: 333333,
type: 'comp-B',
style: {
position: 'absolute',
},
}]
}]
```
所以,我们对绝对/顺序排布的配置描述 layout是存在于容器上的。
## 混合布局
因为tmagic-editor的布局配置是指定在容器上的所以tmagic-editor的设计方式就可以支持在页面中实现各种混合布局的嵌套。
<img src="https://image.video.qpic.cn/oa_88b7d-37_1417201939_1636341538475155?imageView2/q/70">

View File

@ -0,0 +1,64 @@
# 页面渲染
tmagic-editor的页面渲染是通过在载入编辑器中保存的 DSL 配置,通过 ui 渲染器渲染页面。在容器布局原理里我们提到过,容器和组件在配置中呈树状结构,所以渲染页面的时候,渲染器会递归配置内容,从而渲染出页面所有组件。
<img src="https://vfiles.gtimg.cn/vupload/20211009/f4d3031633778551251.png">
## 容器渲染
页面的渲染器,其实就是两个基础组件,基础容器组件和基础组件。页面在读到 DSL 配置之后,根组件必定是一个容器,此时渲染基础容器组件,而容器组件的职责很简单,就是将其子组件渲染出来。具体形式为:
```vue
<template>
<div>
<magic-ui-component
v-for="item in config.items"
:key="item.id"
:config="item"
></magic-ui-component>
</div>
</template>
<script>
export default {
name: 'magic-ui-container',
};
</script>
```
## 组件渲染
所有tmagic-editor组件都通过一个tmagic-editor基础组件来渲染。这个基础组件会识别当前渲染组件的类型。如果当前渲染组件是普通组件包括ui中提供的基础组件和业务开发的业务组件则直接渲染如果当前渲染组件是容器则回到[容器渲染](#容器渲染)逻辑中。
基础组件的具体形式为:
```vue
<template>
<component
:is="tagName"
:config="config"
></component>
</template>
<script lang="ts">
import { computed, defineComponent } from 'vue';
export default defineComponent({
name: 'magic-ui-component',
props: {
config: {
type: Object,
default: () => ({}),
},
},
setup(props) {
return {
tagName: computed(() => `magic-ui-${props.config.type}`),
};
},
});
</script>
```
## 渲染器示例
在tmagic-editor的示例项目中我们提供了三个版本的 @tmagic/ui。可以参考对应前端框架的渲染器实现。
- [vue 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/vue-components/container/src/Container.vue)
- [react 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/react-components/container/src/Container.tsx)

View File

@ -0,0 +1,153 @@
# @tmagic/form
tmagic-editor的表单配置核心就是使用了 @tmagic/form 来作为渲染器。@tmagic/form 是一个 npm 包,可以安装它,在你想使用的地方单独使用。
@tmagic/form 接受一个表单配置,详细配置可参考[表单 api](../../api/form/form-props.md)。
## 安装
```bash
# 最新稳定版
$ npm install @tmagic/form
```
```bash
$ npm install @tmagic/element-plus-adapter @tmagic/design element-plus -S
```
## 快速上手
本节将介绍如何在项目中使用 @tmagic/form
### 引入 @tmagic/form
MagicForm 使用了 element-ui 库
在 main.js 中写入以下内容:
```javascript
import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import TMagicDesign from '@tmagic/design';
import MagicElementPlusAdapter from '@tmagic/element-plus-adapter';
import MagicForm from '@tmagic/form';
import App from './App.vue';
const app = createApp(App);
app.use(ElementPlus, {
locale: zhCn,
});
app.use(TMagicDesign, MagicElementPlusAdapter);
app.use(MagicForm);
app.mount("#app");
```
以上代码便完成了 @tmagic/form 的引入。需要注意的是ElementUI 的样式文件需要单独引入。
在 App.Vue 中写入以下内容:
```html
<m-form :config="config" :init-values="initValue"></m-form>
<script>
export default {
data() {
return {
config: [
{
text: "文本",
name: "text",
},
{
type: "number",
text: "计数器",
name: "number",
},
{
type: "row",
items: [
{
type: "date",
text: "日期",
name: "date",
},
{
type: "checkbox",
text: "多选框",
name: "checkbox",
},
],
},
{
type: "fieldset",
name: "fieldset",
legend: "分组",
items: [
{
type: "select",
text: "下拉选项",
name: "select",
options: [
{ text: "选项1", value: 1 },
{ text: "选项2", value: 2 },
],
},
],
},
],
initValue: {
text: "文本",
number: 10,
fieldset: {
select: 1,
},
},
};
},
};
</script>
```
### 开始使用
至此,一个基于 Vue 和 @tmagic/form 的开发环境已经搭建完毕,现在就可以编写代码了。
### 示例
<demo-block type="form" :config="[{
text: '文本',
name: 'text'
}, {
type: 'number',
text: '计数器',
name: 'number'
}, {
type: 'row',
items: [{
type: 'date',
text: '日期',
name: 'date'
}, {
type: 'checkbox',
text: '多选框',
name: 'checkbox'
}]
}, {
type: 'fieldset',
name: 'fieldset',
legend: '分组',
items: [{
type: 'select',
text: '下拉选项',
name: 'select',
options: [
{ text: '选项1', value: 1 },
{ text: '选项2', value: 2 }
]
}]
}]">
</demo-block>

View File

@ -0,0 +1,23 @@
# @tmagic/ui
在前面[页面渲染](../advanced/page)中提到的 UI 渲染器,就是包含在 @tmagic/ui 中的渲染器组件。
tmagic-editor的设计是希望发布的页面支持多个前端框架即各个业务方可以根据自己熟悉的语言来开发组件、发布页面。也可以通过 [实现一个 runtime](../runtime.html) 的方式,来实现一个自己的 @tmagic/ui
所以tmagic-editor的设计中针对每个前端框架都需要有一个对应的 @tmagic/ui 来承担渲染器职责。同时,也需要一个使用和 @tmagic/ui 相同前端框架的 runtime 来 @tmagic/ui 和业务组件的,具体 runtime 概念,可以参考[页面发布](../publish)。
我们以项目代码中提供的 vue 版本的 [vue-components](https://tencent.github.io/tmagic-editor/vue-components) 作为示例介绍其中包含的内容。
## 渲染器
在 vue 中,实现渲染器的具体形式参考[页面渲染](../advanced/page)中描述的[容器渲染](../advanced/page.html#容器渲染)和[组件渲染](../advanced/page.html#容器渲染)。
## 基础组件
在 [vue-components](https://tencent.github.io/tmagic-editor/vue-components) 中,我们提供了几个基础组件,可以在项目源码中找到对应内容。
- page tmagic-editor的页面基础
- container tmagic-editor的容器渲染器
- Component.vue tmagic-editor的组件渲染器
- button/text 基础组件示例
其中 page/container/Component 是 UI 的基础,是每个框架的 UI 都应该实现的。
button/text 其实就是一个组件开发的示例,具体组件开发相关规范可以参考[组件开发](../component)。

220
docs/guide/component.md Normal file
View File

@ -0,0 +1,220 @@
# 如何开发一个组件
tmagic-editor支持业务方进行自定义组件开发。在tmagic-editor中组件是以 npm 包形式存在的组件和插件只要按照规范开发就可以在tmagic-editor的 runtime 中被加入并正确渲染组件。
### 组件规范
组件的基础形式,需要有四个文件
- index 入口文件,引入下面几个文件
- form-config 表单配置描述
- init-value 表单初始值
- event 定义联动事件,具体可以参考[组件联动](../guide/advanced/coupling.html#组件联动)
- component.{vue,jsx} 组件样式、逻辑代码
### 1. 创建组件
可以使用`npm create tmagic` 选择 `components:组件库(组件/插件/数据源)` 来快速创建一个组件库。
然后继续使用`npm create tmagic` 选择 `component:组件` 来快速创建一个组件。
:::tip
组件库并不是必须,组件如何管理可以根据具体情况来选择。直接放到 runtime 目录中也是一个不错的选择如果选择放到runtime中可以在runtime中的package.json添加
```json
{
"createTmagic": {
"componentsPath": "./components",
"pluginsPath": "./plugins",
"dataSourcesPath": "./dataSources"
}
}
```
来指定组件库的路径。这样在使用`npm create tmagic` 来创建组件时,会自动将组件添加到组件库中。
:::
:::tip
如需为组件添加npm scope name可以在runtime中的package.json中添加
```json
{
"createTmagic": {
"npmScopeName": "@tmagic"
}
}
```
:::
手动创建组件,可以在项目中,如 runtime 目录中,创建一个名为 test-component 的组件目录,其中包含上面四个规范文件。
```javascript
// index.js
// vue
import Test from './Test.vue';
// react
import Test from './Test.tsx';
export { default as config } from './form-config';
export { default as value } from './init-value';
export default Test;
```
:::tip
如果在runtime中使用了@tmagic/cli,则必须保持此规范;不使用则可以自由书写。
:::
```javascript
// form-config.js
export default [
{
type: 'select',
text: '字体颜色',
name: 'color',
options: [
{
text: '红色字体',
value: 'red',
},
{
text: '蓝色字体',
value: 'blue',
},
],
},
{
name: 'text',
text: '配置文案',
},
];
```
:::tip
配置内容必须是一个数组,每个元素是一个对象,包含 type、text、name 等属性,每个对象代表一个表单项。
type 是表单项的类型
text 是表单项的文本
name 是表单项值的key。
上述实例对应生成的值为
```json
{
"color": "red",
"text": "一段文字",
}
```
type 在@tmagic/form@tmagic/editor 中默认提供了一些,@tmagic/form提供的可以前往[表单配置](/form-config/fields/text.html)查看。
:::
```javascript
// init-value.js
export default {
color: 'red',
text: '一段文字',
};
```
:::tip
在编辑器中添加组件时使用,作为初始值。
:::
Vue版本的组件代码示例
```vue
<!-- Test.vue -->
<template>
<div>
<span>this is a Test component:</span>
<span :style="{ color: config.color }">{{ config.text }}</span>
</div>
</template>
<script setup>
defineOptions({
name: 'magic-ui-test',
});
defineProps({
config: {
type: Object,
default: () => ({}),
},
}):
</script>
```
:::tip
编辑器中配置的 config 对象,会作为 props 传入组件中。
:::
react 版本组件代码示例
```javascript
// Test.tsx
import React, { useContext } from 'react';
import Core from '@tmagic/core';
import { AppContent } from '@tmagic/ui-react';
function Test({ config }: { config: any }) {
const app = useContext<Core | undefined>(AppContent);
console.log(app)
return (<div id={config.id}
style={app.transformStyle(config.style || {})}>
<span>this is a Test component:</span>
<span style={ { color: config.color }}>{ config.text }</span>
</div>);
}
export default Test;
```
## 插件开发
插件开发和组件开发形式类似,但是插件开发不需要有组件的规范。
我们只需要在插件中提供一个入口文件。插件需要提供一个 install 方法。
```javascript
// 在Vue的runtime中
export default {
install(vueApp, { app: tmagicApp }) {}
}
```
```javascript
// 在React的runtime中
export default {
install({ app: tmagicApp }) {}
}
```
在插件中开发者可以自由实现需要的业务逻辑。
## 集成到runtime中
### 使用@tmagic/cli
在使用`npm create tmagic` 创建的runtime中自动集成了@tmagic/cli将组件集成到此runtime中只需要在`tmagic.config.ts`中的packages字段中添加
```javascript
import { defineConfig } from '@tmagic/cli';
export default defineConfig({
// other config
packages: [
{
'组件type': '组件目录或者npm包名',
},
],
});
```
:::tip
组件type需要与[componentGroupList](../api/editor/props.html#componentgrouplist)中的type对应。
:::
配置到packages字段中后执行`npm run tmagic`来创建组件库的入口文件。
然后使用`npm run build:libs`命令来构建用于编辑器中的组件配置、组件初始值、组件事件联动的资源文件。

73
docs/guide/conception.md Normal file
View File

@ -0,0 +1,73 @@
# 基础概念
我们通过讲述tmagic-editor的一些基础概念。帮助开发者可以了解tmagic-editor是如何运行以及如何在基础项目之上开发、使用它。
[![alt 原理](/flow.png "原理")](/flow.png){target="_blank"}
## 编辑器
编辑器基础布局上分为:左面板、工作区、右面板、工具栏,如下图。
- **左面板**,包含了组件库的展示,以及工作区中已添加组件的组件树展示。
- **工作区**,一个页面模拟器,用于实时展示用户添加到当前页面中的组件在真实页面中的展示情况。
- **右面板**,展示组件提供出来的表单选项,让用户可以通过配置项来改变组件的行为和样式。
- **工具栏**,放置一些如缩放、撤销等工具按键。
<img src="https://vfiles.gtimg.cn/vupload/20211009/083dfa1633771059332.png">
### 组件
组件是tmagic-editor可配置页面元素的最小单位。我们都会从左面板的组件区中选中组件加入到工作区的模拟器中然后在右面板中对组件进行配置。一个组件的基本内容会包含如下
- 组件样式、逻辑代码(即开发者写的 vue, react 等代码)。
- 表单配置描述tmagic-editor的定义是导出一个表单对象这份配置仅在编辑器中使用。
- 拓展描述,这部分内容目前还未有严格定义,但是我们保留这个扩展能力。
- 组件 `type`, 是组件的类型,这是用来告诉编辑器,我们要渲染的是什么组件。每个组件在开发时就应该确定这样一个唯一、不和其他组件冲突的组件 `type`
```js
[
{
text: '文本',
type: 'text', ⬅️
},
{
text: '按钮',
type: 'button', ⬅️
},
{
text: '测试',
type: 'test', ⬅️
},
]
```
### 插件
插件和组件类似,但是插件的功能是作为页面逻辑行为的一种补充方式。一般不显式的在模拟器中被渲染出具体内容(除非插件中会生成组件并插入页面),通常我们会用插件实现类似登录,页面环境判断,请求拦截器等等功能。
插件一般包含如下内容:
- 插件逻辑代码。
- 插件 `type`,是插件的类型,和组件 `type` 作用相同。在开发时就应该确定这样一个唯一、不和其他组件冲突的组件 `type`
### 容器
容器是tmagic-editor编辑器中的一个基础单位页面本身就是一个容器在基础组件中称为**组**tmagic-editor通过容器概念实现了丰富的布局方式因为我们的布局行为是设置在容器上的容器内的组件是绝对定位、或是顺序排布是根据容器的配置行为改变的。tmagic-editor的容器理论上可以无限嵌套。
### 表单配置
表单配置是编辑器右面板展示的内容,配置项目都是由组件里的表单描述来决定的,用户可以在表单配置区域里通过配置项来改变组件的行为和样式。
注意由于每个组件都需要有一些共同的表单配置项目所以tmagic-editor通过在表单渲染器统一为所有组件加上了通用的表单配置项目。包括基础组件样式配置、钩子事件配置等。
### DSL
DSL 是编辑器搭建页面的最终产物(描述文件),其中包含了所有组件信息(组件布局,组件配置等)和插件内容,以及其他可拓展的信息都存放在 DSL 中。tmagic-editor项目页的展示即是tmagic-editor页面在加载 DSL 之后,根据 DSL 的描述进行渲染的。在tmagic-editor中我们使用 [JS schema](advanced/js-schema.html) 来保存这份配置文件。
## 页面
页面是tmagic-editor作为一个可视化编辑器经过配置后最终得到的呈现结果。搭建后的页面会被发布上线供用户访问。
### runtime
我们把页面统一称为 runtime更具体的 runtime 概念可以查看[页面发布](./publish.html#runtime)。**runtime 是承载tmagic-editor项目页面的运行环境**。编辑器的工作区是 runtime 的一个具体实例,另一个就是我们发布上线后,用户访问的真实项目页面。
## 联动
页面搭建过程中,会涉及到两种联动形式
- 在编辑器中,组件的表单配置项之间需要联动。
- 页面中的组件之间,需要联动触发行为。
### 表单联动
配置项 A 改变值,希望能触发配置项 B 相应的变成另外一个值就是表单联动的一个示例。tmagic-editor实现表单联动的方式就是通过渲染的时候将表单对象注入在组件的表单配置描述中可以通过函数声明来获取并且进行逻辑编写实现表单联动。
### 组件联动
组件 A 在完成点击事件后,希望组件 B 可以展示一个弹窗就是组件联动的一个示例。tmagic-editor通过事件绑定方式可以为组件 A 和 B 配置事件关联,实现上述的组件联动。
<img src="https://vip.image.video.qpic.cn/vupload/20231027/3e02d31698914788006.png" alt="组件联动">

220
docs/guide/editor-expand.md Normal file
View File

@ -0,0 +1,220 @@
# 编辑器扩展
编辑器布局组成部分名称如下图,后续将直接使用图中名称指代其部分
<img src="/layout.png" width="100%">
## UI扩展
### 一、顶部菜单栏定制
通常使用 `m-editor` 组件的 [menu](/api/editor/props.html#menu) `prop` 来对齐进行设置;
顶部菜单栏分为`左` `中` `右`三个部分组成,所以 [menu](/api/editor/props.html#menu) `prop`的数据格式如下:
```js
{ left: [], center: [], right: [] }
```
数组的内容可以有三种种形式:`内部定义好的字符串``其他字符串``MenuButton 或者 MenuComponent 对象`
#### 1. 内部定义好的字符串:
```ts
'/' | 'delete' | 'undo' | 'redo' | 'zoom' | 'zoom-in' | 'zoom-out' | 'guides' | 'rule' | 'scale-to-original' | 'scale-to-fit'
```
是组件内部定义的可直接使用的内置功能,具体含义可以查看 [menu](/api/editor/props.html#menu)
#### 2. 其他字符串
除去[内部定好的字符串](#内部定义好的字符串)的其他字符串,则会被当成普通文本直接显示
#### 3. `MenuButton` 或者 `MenuComponent` 对象
MenuButton 的[定义](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/type.ts#L168)
用于自定义一个按钮,例如定义一个返回按钮可以由如下配置实现
```js
{
type: 'buuton',
text: '返回',
handler: () => window.history.back(),
}
```
如果需要更复杂的功能则可以使用 `MenuComponent`, 可以用于实现渲染任意一个Vue组件
`MenuComponent` 的[定义](https://github.com/Tencent/tmagic-editor/blob/239b5d3efeae916a8cf3e3566d88063ecccc0553/packages/editor/src/type.ts#L197C18-L197C32)
:::tip
如果对内置的顶部菜单栏实现不满意还可以使用自定义的实现完全替换掉
```html
<m-editor>
<template #nav>
<your-nav></your-nav>
</template>
</m-editor>
```
:::
### 二、左侧菜单栏
左侧菜单栏主要展示组件列表、组件树、代码块、数据源等内容。可以通过 `m-editor` 组件的 [sidebar](/api/editor/props.html#sidebar) `prop` 来进行配置。
#### 1. 自定义左侧面板
可以使用 `sidebar` slot 来完全自定义左侧面板:
```html
<m-editor>
<template #sidebar>
<your-sidebar></your-sidebar>
</template>
</m-editor>
```
#### 2. 扩展组件列表
通过 [componentGroupList](/api/editor/props.html#componentgrouplist) prop 配置组件分组和列表:
```js
const componentGroupList = [
{
title: '基础组件',
items: [
{
text: '文本',
type: 'text',
icon: 'text-icon'
},
{
text: '按钮',
type: 'button',
icon: 'button-icon'
}
]
},
{
title: '业务组件',
items: [
// 自定义业务组件
]
}
]
```
#### 3. 组件树扩展
组件树会自动根据页面配置生成,可以通过 `editorService` 监听组件树相关事件:
```js
editorService.on('select', (node) => {
console.log('选中组件:', node);
});
```
### 三、右侧属性配置栏
默认的属性配置栏会分为属性、样式、事件、高级4个tab分页其中只有属性是在组件中的`formConfig`文件中定义,其他三个分页都是自动生成的,所有组件都是一样的。
默认的属性读取流程如下:
组件中定义`formConfig` -> 通过`tamgic-cli`构建成 `runtime``/config/index.umd.cjs` -> `m-editor`中加载然后配置到[propsConfig](/api/editor/props.html#propsconfigs) prop中 -> `m-editor`保存到`propsService`中 -> 选中组件时`editorService`会去`propsService`调用`getPropsConfig`中读取
`propsService.getPropsConfig`会调取`propsService.fillConfig`添加样式、事件、高级3个tab分页
#### 1. 定制属性配置栏中顶部的属性、样式、事件、高级 tab分页
可以通过干预`propsService.fillConfig`来实现自定义。例如:
实现去掉样式、事件、高级3个tab分页直接显示组件内定义好的配置
```js
propsService.usePlugin({
/**
* result为生成好的默认配置
* config为组件中定义好的配置
*/
afterFillConfig(result, config) {
return config
}
});
```
#### 2. 定制属性配置栏中配置的来源
如果觉得上述属性读取流程不满足需要,可以通过干预`propsService.getPropsConfig`来实现自定义的流程
```js
propsService.usePlugin({
/**
* result为生成好的默认配置
* config为组件中定义好的配置
*/
afterGetPropsConfig(result, type) {
// 返回配置DSL即可
return []
}
});
```
#### 3. 自定义属性配置栏
默认属性配置栏是是使用`@tmagic/form`来实现的,如果需要使用其他组件来实现可以使用`props-panel`slot来将其替换掉
```html
<m-editor>
<template #props-panel>
<your-props-panel></your-props-panel>
</template>
</m-editor>
```
## 行为扩展
### 二、服务扩展
可以通过监听事件和使用插件来扩展 EditorService
```js
// 监听编辑器事件
editorService.on('add', (node) => {
console.log('添加组件:', node);
});
// 使用插件扩展
editorService.usePlugin({
beforeAdd(node) {
// 在添加组件前执行
return node;
},
afterAdd(node) {
// 在添加组件后执行
return node;
}
});
```
#### 2. PropsService 扩展
自定义属性配置的处理逻辑:
```js
propsService.usePlugin({
// 修改属性配置
beforeGetPropsConfig(type) {
console.log('获取配置前:', type);
},
afterGetPropsConfig(config, type) {
// 添加自定义配置
return config;
},
// 自定义配置填充逻辑
afterFillConfig(config, type) {
return config;
}
});
```

231
docs/guide/index.md Normal file
View File

@ -0,0 +1,231 @@
# 快速开始
tmagic-editor的编辑器我们已经封装成一个 npm 包,可以直接安装使用。编辑器是使用 vue3 开发的(仅支持vue3),但使用编辑器的业务(runtime)可以不限框架,可以用 vue2、react 等开发业务组件。
::: code-group
```bash [npm]
$ npm create tmagic@latest
```
```bash [pnpm]
$ pnpm create tmagic
```
:::
按照提示操作可以创建`6`中项目:
* runtime:运行时DSL渲染
* admin-client:管理端(编辑器)
* components:组件库(组件/插件/数据源)
* component:组件
* data-source:数据源
* plugin:插件
至少需要一个runtime与admin-client后就可以运行起一个最简单的项目了。
后续还需要新增组件、插件、数据源等,可以继续添加后面几种类型的项目。
新增好一个组件/插件/数据源后可以到runtime/tmagic.config.ts中配置到packages中
## 手动安装
node.js >= 18
可以通过[Vite](https://cn.vitejs.dev/) 或 [Vue CLI](https://cli.vuejs.org/zh/)快速创建项目。
> 使用Vue CLI生成的项目需要在vue.config.js中加上配置transpileDependencies: [/@tmagic/]
```bash
$ npm install @tmagic/editor -S
```
由于在实际应用中项目常常会用到例如[element-plus](https://element-plus.org/)、[tdesign-vue-next](https://tdesign.tencent.com/vue-next/overview)等UI组件库。为了能让使用者能够选择不同UI库[@tmagic/editor](https://github.com/Tencent/tmagic-editor/tree/master/packages/editor)将其中使用到的UI组件封装到[@tmagic/design](https://github.com/Tencent/tmagic-editor/tree/master/packages/design)中然后通过不同的adapter来指定使用具体的对应的UI库我们提供了[@tmagic/element-plus-adapter](https://github.com/Tencent/tmagic-editor/tree/master/packages/element-plus-adapter)来支持[element-plus](https://element-plus.org/),所以还需要安装相关的依赖。
```bash
$ npm install @tmagic/element-plus-adapter element-plus -S
```
editor 中还包含了[monaco-editor](https://microsoft.github.io/monaco-editor/)所以还需安装monaco-editor可以参考 monaco-editor 的[配置指引](https://github.com/microsoft/monaco-editor/blob/main/docs/integrate-esm.md)。
```bash
$ npm install monaco-editor -S
```
## 快速上手
## 引入 @tmagic/editor
在 main.js 中写入以下内容:
```js
import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import editorPlugin from '@tmagic/editor';
import MagicElementPlusAdapter from '@tmagic/element-plus-adapter';
import App from './App.vue';
import 'element-plus/dist/index.css';
import '@tmagic/editor/dist/style.css';
const app = createApp(App);
app.use(ElementPlus, {
locale: zhCn,
});
app.use(router);
app.use(editorPlugin, MagicElementPlusAdapter);
app.mount('#app');
```
以上代码便完成了 @tmagic/editor 的引入。需要注意的是,样式文件需要单独引入。
可以参考我们提供的[Playground](https://github.com/Tencent/tmagic-editor/blob/master/playground/src/main.ts)示例实现代码
## 使用 m-editor 组件
在 App.vue 中写入以下内容:
```html
<template>
<m-editor
v-model="dsl"
:menu="menu"
:runtime-url="runtimeUrl"
:props-configs="propsConfigs"
:props-values="propsValues"
:component-group-list="componentGroupList"
>
</m-editor>
</template>
<script>
import { defineComponent, ref } from "vue";
export default defineComponent({
name: "App",
setup() {
return {
menu: ref({
left: [
// 顶部左侧菜单按钮
],
center: [
// 顶部中间菜单按钮
],
right: [
// 顶部右侧菜单按钮
],
}),
dsl: ref({
// 初始化页面数据
}),
runtimeUrl: "/runtime/vue/playground/index.html",
propsConfigs: [
// 组件属性列表
],
propsValues: [
// 组件默认值
],
componentGroupList: ref([
// 组件列表
]),
};
},
});
</script>
<style lang="scss">
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
#app {
width: 100%;
height: 100%;
display: flex;
}
.m-editor {
flex: 1;
height: 100%;
}
</style>
```
关于 [@tmagic/editor](https://github.com/Tencent/tmagic-editor/tree/master/packages/editor) 组件,更多的属性配置详情请参考[编辑器 API](../api/editor/props.md)。
其中,**有四个需要注意的属性配置项**`runtimeUrl` `values` `configs` `componentGroupList`。这是能让我们的编辑器正常运行的关键。
:::tip
如果出现```Preprocessor dependency "sass" not found. Did you install it?```那么需要install sass
```bash
npm install sass -D
```
:::
:::tip
如果是使用vite构建工具如果出现 ```Uncaught ReferenceError: global is not defined```那么需要再vite.config.js中添加如下配置
```js
{
optimizeDeps: {
esbuildOptions: {
define: {
global: 'globalThis',
},
},
},
}
```
:::
## runtimeUrl
该配置涉及到 [runtime 概念](runtime.md)tmagic-editor编辑器中心的模拟器画布是一个 iframe这里的 `runtimeUrl` 配置的,就是你提供的 iframe 的 url其中渲染了一个 runtime用来响应编辑器中的组件增删改等操作。
:::tip
可以使用`npm create tmagic` 来快速创建一个runtime项目。
:::
## componentGroupList
`componentGroupList` 是指定左侧组件库内容的配置。此处定义了在编辑器组件库中有什么组件。在添加的时候通过组件 `type` 来确定 runtime 中要渲染什么组件。可以参考 [componentGroupList 配置](../api/editor/props.html#componentgrouplist)。
## propsConfigs/propsValues
`propsConfigs` `propsValues``componentGroupList` 中声明的组件是一一对应的,通过 `type` 来识别属于哪个组件,该配置涉及的内容,就是组件的表单配置描述,在[组件开发中](./component.md)会通过 formConfig 配置来声明这份内容。
`configs` 既可以通过 hardcode 方式写上每个组件的表单配置,也可以通过组件打包方式得到对应内容,然后通过异步加载来载入。比如:
```javascript
setup() {
asyncLoadJs(`/runtime/vue/assets/config.js`).then(() => {
propsConfigs.value = window.magicPresetConfigs;
});
asyncLoadJs(`/runtime/vue/assets/value.js`).then(() => {
propsValues.value = window.magicPresetValues;
});
}
```
::: tip 如何快速得到一个 configs/values
上述的 runtime 产物中dist 目录中即包含一个 entry 文件夹在你的项目组件初始化之后分别异步加载里面的config/index.umd.js、value/index.umd.js。并如上面代码中赋值给 configs/values 即可。
:::
## 更多
通过上述步骤,可以快速得到一个初始化的简单编辑器。
除了上述内容外文档的其他章节中也会更深入的描述整个tmagic-editor的设计理念和实现细节。同时你也可以查看我们的[项目源码](https://github.com/Tencent/tmagic-editor),从源码提供的 playground 和 runtime 示例来开发和理解tmagic-editor。

View File

@ -1,14 +1,14 @@
# 介绍
魔方可视化开源项目Magic是从魔方平台演化而来的开源项目,意在提供一个供开发者快速搭建可视化搭建平台的解决方案。
tmagic-editor可视化开源项目是从魔方平台演化而来的开源项目,意在提供一个供开发者快速搭建可视化搭建平台的解决方案。
<img src="https://image.video.qpic.cn/oa_88b7d-32_509802977_1635842258505918" alt="魔方demo图">
<img src="/tmagic.png" alt="魔方demo图">
## 特性
- **所见即所得**,体验友好的拖拽编辑方式。
- **丰富的拓展能力**,支持业务方自定义组件、插件、扩展编辑器能力。
- **支持多种布局方式**魔方的容器概念,支持配置活动时,自由组合嵌套业务组件,提供超强的组件布局方式。
- **支持多种布局方式**tmagic-editor的容器概念支持配置项目时,自由组合嵌套业务组件,提供超强的组件布局方式。
- **支持不同前端框架**使用编辑器的业务方可以采用自己熟悉的前端框架来开发自己的业务组件比如vue2、vue3、react。
- **强大的配置**,支持表单联动的配置能力。
- **组件联动**,支持组件通信、组件联动,允许页面内各组件提供丰富配置能力。
@ -20,26 +20,29 @@
- **编辑器**,承载整个拖拽布局的页面,包含了下述的其他页面可见元素。
- **模拟器**,居中位置渲染了当前页面配置的组件内容,模拟真实页面的展示内容。
- **组件库**,左侧展示当前业务下的相关组件内容,包含魔方提供的基础组件和业务自定义组件。
- **组件库**,左侧展示当前业务下的相关组件内容,包含tmagic-editor提供的基础组件和业务自定义组件。
- **组件树**,左侧展示当前页面添加的组件内容,以树状结构展示。
- **[代码块](./advanced/code-block.md)**,左侧展示添加的函数,可供组件事件中联动所用,或者组件声明周期中调用。
- **[数据源](./advanced/data-source.md)**,左侧展示添加的数据源,用于组件中的各项配置。
- **表单配置**,右侧表单项目,展示由组件内提供的配置描述,提供修改组件行为的配置项。
- **uiconfig 源码**,右上角的 📄 图标可以展示当前页面,各个组件配置,页面基础配置组合而成的配置源码。
- **DSL 源码**,右上角的 📄 图标可以展示当前页面,各个组件配置,页面基础配置组合而成的配置源码。
通过编辑器,可以创建、编辑、保存一个活动页面。同时,魔方开源项目提供了一个页面搭建管理平台的示例magic-admin可以用于快速构建一个完整的页面可视化搭建系统
通过编辑器,可以创建、编辑、保存一个项目页面。
## 核心库
- **@tmagic/editor** 实现一个可视化编辑器。
- **@tmagic/form** 实现组件在编辑器中自定义表单配置。
- **@tencent/magic-core** 实现对组件进行跨框架管理与一些通用复杂逻辑的实现。
- **@tencent/magic-stage** 实现在编辑器中对组件的位置拖动与大小拖拉
- **@tencent/magic-ui** 提供一些基础组件
- **@tmagic/core** 实现对组件进行跨框架管理与一些通用复杂逻辑的实现。
- **@tmagic/data-source** 实现数据源的管理与编译
- **@tmagic/stage** 实现在编辑器中对组件的位置拖动与大小拖拉
- **runtime** 实现在编辑器中对使用不同框架的组件的渲染。
- **page** 项目提供最终页面发布的执行环境与组件构建。
可以查阅 Magic 的[源代码](https://github.com/Tencent/tmagic-editor),与文档描述内容可以逐一对应上,希望文档内容可以为开发者带来比较好的开发体验。
可以查阅 tmagic 的[源代码](https://github.com/Tencent/tmagic-editor),与文档描述内容可以逐一对应上,希望文档内容可以为开发者带来比较好的开发体验。
## 谁在使用
- 腾讯视频视频会员体育会员WETV 国际版TVdoki 商城,小企鹅,小说,漫画
- 腾讯会议
- 腾讯新闻
- 58同城本地生活服务

89
docs/guide/migration.md Normal file
View File

@ -0,0 +1,89 @@
# 升级到1.5.x
## ui npm包的变化
ui中包含的组件被移除这些组件由单独的npm包提供。1.5.0以后ui包将变得不重要只是为了兼容而保留后续将变废弃。
建议将runtime中的tmagic.config中的packages配置的ui包改成
```js
{
packages: [
{ button: '@tmagic/vue-button',
{ container: '@tmagic/vue-container' },
{ img: '@tmagic/vue-img' },
{ 'iterator-container': '@tmagic/vue-iterator-container' },
{ page: '@tmagic/vue-page' },
{ 'page-fragment': '@tmagic/vue-page-fragment' },
{ 'page-fragment-container': '@tmagic/vue-page-fragment-container' },
{ text: '@tmagic/vue-text' },
{ overlay: '@tmagic/vue-overlay' },
{ qrcode: '@tmagic/vue-qrcode' },
],
}
```
:::tip
react的也是类似上面的修改
:::
:::tip
上述这些组件中只有container是最重要的不可缺少的其他都可以换成自己实现的版本。
iterator-container/page/page-fragment/page-fragment-container这几个组件编辑中是有做特殊识别的所以如果希望有完整的功能也尽量保留
:::
## 对编辑画布中组件的识别
1.5.0之前是通过识别dom中是否拥有id属性是判断该dom是不是组件的根节点之后默认会变成识别是否拥有data-tmagic-id
:::tip
此变化是通过container组件来实现的之前vue是`@tmagic/ui`或者`tmagic/ui-vue2`中的Component组件来实现`tmagic/ui-react`则是各个组件自己实现之后vue是由`@tmagic/vue-container`实现react依然由各个组件自己实现。
:::
如果希望依然保留对id属性的识别我们也提供方法
```ts
import { setDslDomRelateConfig } from '@tmagic/editor';
setDslDomRelateConfig('getIdFromEl', (el?: HTMLElement | SVGElement | null) => el?.id);
setDslDomRelateConfig(
'getElById',
(doc?: Document, id?: string | number) => doc?.querySelector(`[id="${id}"]`) as HTMLElement,
);
setDslDomRelateConfig('setIdToEl', (el: HTMLElement | SVGElement, id: string | number) => {
el.id = `${id}`;
});
```
:::tip
与此相关的`m-editor`组件的[canSelect](/api/editor/props.html#canselect)/[isContainer](/api/editor/props.html#iscontainer)这里配置
:::
## 组件对迭代器容器的支持
迭代器容器是通过绑定一个数据源的数组字段,然后会去迭代这个数组来渲染容器中的内容,这个是同一个配置的组件将会被渲染多次,这个时候组件配置的事件或者代码块中将无法准确获取中组件,所以需要将迭代的信息提供出来。
已vue组件为例需要添加iteratorIndex和iteratorContainerId两个prop
```ts
{
props: {
// other props
iteratorIndex: Array as PropType<number[]>,
iteratorContainerId: Array as PropType<Id[]>,
}
}
```
然后传个useApp
```ts
useApp({
// other args
iteratorContainerId: props.iteratorContainerId,
iteratorIndex: props.iteratorIndex,
})
```
:::tip
如果对迭代器容器没有需求的,可以不用
:::

Some files were not shown because too many files have changed in this diff Show More