@cicctencent/low-code-editor 0.0.0-stage → 1.1.9-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +2 -2
  2. package/api-extractor.json +36 -0
  3. package/dist/ActivityBar/index.vue.d.ts +29 -0
  4. package/dist/ComponentTree/components/List.vue.d.ts +29 -0
  5. package/dist/ComponentTree/index.vue.d.ts +32 -0
  6. package/dist/DataSource/index.vue.d.ts +34 -0
  7. package/dist/HeaderBar/components/BarTooltip.vue.d.ts +37 -0
  8. package/dist/HeaderBar/index.vue.d.ts +49 -0
  9. package/dist/NavTree/index.vue.d.ts +48 -0
  10. package/dist/SchemaConfig/index.vue.d.ts +36 -0
  11. package/dist/SidebarPane/index.vue.d.ts +38 -0
  12. package/dist/components/ComponentTreeFavorites/components/List.vue.d.ts +41 -0
  13. package/dist/components/ComponentTreeFavorites/components/Tips.vue.d.ts +16 -0
  14. package/dist/components/ComponentTreeFavorites/index.vue.d.ts +44 -0
  15. package/dist/components/ImageGuide/index.vue.d.ts +45 -0
  16. package/dist/components.d.ts +7 -0
  17. package/dist/composables/useComponentTree.d.ts +13 -0
  18. package/dist/config/ace.config.d.ts +3 -0
  19. package/dist/domain/EditorDomain.d.ts +89 -0
  20. package/dist/editor.d.ts +466 -0
  21. package/dist/editor.vue.d.ts +104 -0
  22. package/dist/formily/ActivityBar/index.d.ts +4 -0
  23. package/dist/formily/ComponentTree/index.d.ts +4 -0
  24. package/dist/formily/DataBinding/index.d.ts +4 -0
  25. package/dist/formily/DataBinding/index.vue.d.ts +26 -0
  26. package/dist/formily/DataSource/index.d.ts +4 -0
  27. package/dist/formily/MenuTable/PageList.vue.d.ts +28 -0
  28. package/dist/formily/MenuTable/index.d.ts +4 -0
  29. package/dist/formily/MenuTable/index.vue.d.ts +30 -0
  30. package/dist/formily/MenuTable/useMenuTable.d.ts +2 -0
  31. package/dist/formily/NavTree/index.d.ts +4 -0
  32. package/dist/formily/SidebarPane/index.d.ts +4 -0
  33. package/dist/formily/index.d.ts +2 -0
  34. package/dist/index.css +1167 -0
  35. package/dist/index.d.ts +250 -0
  36. package/dist/index.js +42688 -0
  37. package/dist/utils/base64.d.ts +4 -0
  38. package/dist/utils/index.d.ts +27 -0
  39. package/package.json +62 -4
  40. package/rollup.config.js +3 -0
  41. package/src/ActivityBar/index.vue +71 -0
  42. package/src/ComponentTree/components/List.vue +310 -0
  43. package/src/ComponentTree/index.vue +77 -0
  44. package/src/DataSource/index.vue +640 -0
  45. package/src/HeaderBar/components/BarDialog.vue +43 -0
  46. package/src/HeaderBar/components/BarTooltip.vue +33 -0
  47. package/src/HeaderBar/index.vue +513 -0
  48. package/src/NavTree/index.vue +345 -0
  49. package/src/SchemaConfig/index.vue +150 -0
  50. package/src/SidebarPane/index.vue +199 -0
  51. package/src/SynBarComponent/index.vue +31 -0
  52. package/src/assets/font/NotoSansSC.ttf +0 -0
  53. package/src/assets/img/header/edit.png +0 -0
  54. package/src/assets/img/header/link.png +0 -0
  55. package/src/assets/img/header/link.svg +9 -0
  56. package/src/assets/img/header/preview.png +0 -0
  57. package/src/assets/img/header/preview.svg +9 -0
  58. package/src/assets/img/header/redo.svg +1 -0
  59. package/src/assets/img/header/undo.svg +1 -0
  60. package/src/assets/img/tool/all-select.svg +9 -0
  61. package/src/assets/img/tool/all.svg +9 -0
  62. package/src/assets/img/tool/collect.svg +6 -0
  63. package/src/assets/img/tool/collection-select.svg +3 -0
  64. package/src/assets/img/tool/collection-tag.svg +5 -0
  65. package/src/assets/img/tool/info.svg +4 -0
  66. package/src/assets/img/tool/union.svg +4 -0
  67. package/src/components/ComponentTreeFavorites/components/List.vue +452 -0
  68. package/src/components/ComponentTreeFavorites/components/Tips.vue +108 -0
  69. package/src/components/ComponentTreeFavorites/index.vue +180 -0
  70. package/src/components/ImageGuide/index.vue +100 -0
  71. package/src/components.ts +23 -0
  72. package/src/composables/useComponentTree.ts +38 -0
  73. package/src/config/ace.config.ts +22 -0
  74. package/src/domain/EditorDomain.ts +265 -0
  75. package/src/editor.ts +645 -0
  76. package/src/editor.vue +380 -0
  77. package/src/formily/ActivityBar/index.ts +23 -0
  78. package/src/formily/ActivityBar/index.vue +121 -0
  79. package/src/formily/ComponentTree/index.ts +22 -0
  80. package/src/formily/DataBinding/index.ts +22 -0
  81. package/src/formily/DataBinding/index.vue +285 -0
  82. package/src/formily/DataSource/index.ts +22 -0
  83. package/src/formily/MenuTable/PageList.vue +132 -0
  84. package/src/formily/MenuTable/index.ts +19 -0
  85. package/src/formily/MenuTable/index.vue +218 -0
  86. package/src/formily/MenuTable/useMenuTable.ts +147 -0
  87. package/src/formily/NavTree/index.ts +20 -0
  88. package/src/formily/SidebarPane/index.ts +23 -0
  89. package/src/formily/SidebarPane/index.vue +174 -0
  90. package/src/formily/index.ts +12 -0
  91. package/src/index.ts +29 -0
  92. package/src/typings/vue-shim.d.ts +13 -0
  93. package/src/utils/base64.ts +5 -0
  94. package/src/utils/index.ts +57 -0
  95. package/test/case.ts +67 -0
  96. package/test/utils/index.test.ts +27 -0
  97. package/tsconfig.json +8 -0
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <div class="component-tree">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <script lang="ts" setup>
8
+ import { Component, onMounted, PropType } from 'vue';
9
+ const props = defineProps({
10
+ componentInstance: {
11
+ },
12
+ });
13
+
14
+ onMounted(()=>{
15
+ console.log(props);
16
+
17
+ });
18
+ </script>
19
+
20
+ <style lang="scss" scoped>
21
+ .component-tree {
22
+ flex-shrink: 1;
23
+ padding: 16px 17px;
24
+ position: relative;
25
+ height: 100%;
26
+
27
+ display: flex;
28
+ flex-direction: column;
29
+ }
30
+ </style>
31
+
Binary file
Binary file
Binary file
@@ -0,0 +1,9 @@
1
+ <svg width="30" height="31" viewBox="0 0 30 31" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
2
+ <rect width="30" height="31" fill="url(#pattern0)"/>
3
+ <defs>
4
+ <pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
5
+ <use xlink:href="#image0_454_8732" transform="translate(0 -0.00403226) scale(0.0104167 0.0100806)"/>
6
+ </pattern>
7
+ <image id="image0_454_8732" width="96" height="100" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABkCAYAAAB5CTUuAAAEKElEQVR4Ae2aS47VMBBFe4FMWABbYMAIBAxh2lLPYI7EiMWAxHYeuqhvqxRV5fNS9nWSshQ5HScu5xyXnaZ5uFWREniQRq/gtxIgngQloASICYjDVwaUADEBcfjKgBIgJiAOXxlQAsQExOErA0qAmIA4fGVACRATEIevDCgBYgLi8JUBJUBMQBy+MqAEiAmIw1cGlAAxAXH4yoASICYgDl8ZcCUBv//8veH48fPX7cPnr7dXr9/8P8fPOK5YumUAgQP63HE1Ec0FYMbPAffaIAvPXaE0FYDZ7AFee+0K2dBMwF74lHR2Cc0EEOC0xvICqFxiuClP77M/n1lCEwHR7F8CGT0HGUvPHnW/SBcQbbprAV5NQroADyCWnS3F64NL0lqRW+Ip7+0i4B5oV5GQLsD7hYsb7taZdgUJ6QK4VNh6K3h7/9klpAvIzACKOLOEdAEerHuXIApA7fXLLEPbUUu6gOgzNAPQnITHp+8ZIbr30U3A1k/RiMSchOiZka+nC8DLRpCyloqo/8enbyOzdsfWRAAieZsx1uwsCe8/fXH/pTWrf5dWg4vNBER7QQ8JDTg167KZAIw4WioyJfBLyNYZX13NiE86biogW4IH1pN8pGWouYAMCRby9GvKtjELSsAkzfZI8PYSC9hrpyS04Rz322ec4ckudckAvh0gcJZO6wiQ9zVFwJFYtq+NwfEp6q4CImAENZUQCbN7gScI7V5mIM40hgK6jdldwBYJFGNrzm70E0GeEzCaBImAJQlzAO3s8WY/ALNEGTSSBJmAOQkQ4MGzy4fX7oGN7vPupbietVRAJAHXvdkNMSxeu12eeB/qkSXIBRAQ4OEgZA8w2/gMZrE9bLsVEN3PZ21mTZ9r/fMQAryX9GbtFJSVNAef/Xt9qiUcWgDArgFPAahHkzCsAIDl7LS1hXnv+UgShhUAuBY8z/F3gIwyJ2FrVu0Zz9ACIkitJWBv6VWGFgAIb999dDMBcjJKJDmr/6UxDi8g2guwJGVBsl9TXOpQ91iKhheAGYT/cmLB2PMsCbZPnpcAk7/RUgFYGRK8TOuxFxwiA+ihpYQSQMoLdUsJXHpsvTCc3c2HygC+bQsJlQGku7LOluD1h2utyyEzgFA8aFw+tsLz+traB8e1pT60ALyoB26rhKiP+gxdOZUigBCxNIujZ3t8guL1Dp8BdBSBtNnAGY0aR/QbMJ7hvey/VX0aAQC0JIEyluqlrMmUcSoBGRJ6wsd4Tydgj4Te8E8rAC+GsnZJwl7Qa81/HtpLdcoMeHm7578ZQwQObrqoCV0FnmM8vQC+6Kh1CRCbKQElQExAHL4yoASICYjDVwaUADEBcfjKgBIgJiAOXxlQAsQExOErA0qAmIA4fGVACRATEIevDCgBYgLi8JUBJUBMQBy+MqAEiAmIw/8DonqrBuQtX8UAAAAASUVORK5CYII="/>
8
+ </defs>
9
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg width="27" height="25" viewBox="0 0 27 25" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
2
+ <rect width="27" height="25" fill="url(#pattern0)"/>
3
+ <defs>
4
+ <pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
5
+ <use xlink:href="#image0_433_6403" transform="translate(-0.00322061) scale(0.0201288 0.0217391)"/>
6
+ </pattern>
7
+ <image id="image0_433_6403" width="50" height="46" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAuCAYAAABqK0pRAAAK3GlDQ1BJQ0MgUHJvZmlsZQAASImVlwdUk1kWx9/3pTdaAAEpoffeAkgJPXTpICohCSSUGBICiqiIDI7gWFARAXVEBwUUHB2KDCpiwTYoNuwDMgioq1iwobJfYAkzs2d3z95z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AY0rOrC+uHSElJEh1/BGPEzNQEbFh2bhHNBx5AFoE8UVFdD7YTNAhBLCBq8ME/OJwB1lMk1mBK1YFSwsa1K4kefCAYI6BuJ8hAZycHBlKimlyPgOwA2UWKJ0B2EYwRch1Eb30EY4TeDiLXvlGPkBtytNJHcRNFXduQIrfdvHqeIv0wzcMmaY2WWrAoHSz0sElaox4ZLEkK5o7RGIGFxGChR2NksMQEzB2jMQILicFCAwC5BPOzg7XvNQAAAABJRU5ErkJggg=="/>
8
+ </defs>
9
+ </svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1677657356301" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2121" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M398.09 256h356.66l-69.41-69.41c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l124.03 124.03c12.5 12.5 12.5 32.75 0 45.25L730.59 434.66c-6.25 6.25-14.44 9.38-22.62 9.38s-16.38-3.12-22.62-9.38c-12.5-12.5-12.5-32.75 0-45.25l69.4-69.41H398.09c-130.66 0-236.97 100.48-236.97 224 0 123.5 106.31 224 236.97 224h327.42c17.67 0 32 14.31 32 32s-14.33 32-32 32H398.09C232.12 832 97.12 702.81 97.12 544c0-158.8 135-288 300.97-288z" fill="#333333" p-id="2122"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1677657350855" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1976" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M625.91 256H269.25l69.41-69.41c12.5-12.5 12.5-32.75 0-45.25s-32.75-12.5-45.25 0L169.38 265.38c-12.5 12.5-12.5 32.75 0 45.25l124.03 124.03c6.25 6.25 14.44 9.38 22.62 9.38s16.38-3.12 22.62-9.38c12.5-12.5 12.5-32.75 0-45.25L269.25 320h356.66c130.66 0 236.97 100.48 236.97 224 0 123.5-106.31 224-236.97 224H298.48c-17.67 0-32 14.31-32 32s14.33 32 32 32H625.9c165.97 0 300.97-129.19 300.97-288 0.01-158.8-134.99-288-300.96-288z" fill="#333333" p-id="1977"></path></svg>
@@ -0,0 +1,9 @@
1
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="Frame 626416">
3
+ <g id="Group 1635092001">
4
+ <path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M4.875 3.375C4.32272 3.375 3.875 3.82272 3.875 4.375V19C3.875 19.5523 4.32272 20 4.875 20H19.5C20.0523 20 20.5 19.5523 20.5 19V14.0625C19.1883 14.0625 18.125 12.9992 18.125 11.6875C18.125 10.3758 19.1883 9.3125 20.5 9.3125V4.375C20.5 3.82272 20.0523 3.375 19.5 3.375H4.875Z" fill="#C79156"/>
5
+ <circle id="Ellipse 45" cx="12.1875" cy="3.375" r="2.375" fill="#C79156"/>
6
+ <circle id="Ellipse 46" cx="3.875" cy="11.6875" r="2.375" fill="#C79156"/>
7
+ </g>
8
+ </g>
9
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="Frame 626416">
3
+ <g id="Group 1635092001">
4
+ <path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M4.875 3.375C4.32272 3.375 3.875 3.82272 3.875 4.375V19C3.875 19.5523 4.32272 20 4.875 20H19.5C20.0523 20 20.5 19.5523 20.5 19V14.0625C19.1883 14.0625 18.125 12.9992 18.125 11.6875C18.125 10.3758 19.1883 9.3125 20.5 9.3125V4.375C20.5 3.82272 20.0523 3.375 19.5 3.375H4.875Z" fill="#828690"/>
5
+ <circle id="Ellipse 45" cx="12.1875" cy="3.375" r="2.375" fill="#828690"/>
6
+ <circle id="Ellipse 46" cx="3.875" cy="11.6875" r="2.375" fill="#828690"/>
7
+ </g>
8
+ </g>
9
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="Frame 626416">
3
+ <rect width="16" height="16" rx="2" fill="#C79156"/>
4
+ <path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M8 13C8 13 4.23831 10.1544 2.83334 8.55556C2.31511 7.96583 2 7.18706 2 6.33333C2 4.49238 3.46525 3 5.27273 3C6.41107 3 7.41368 3.59195 8 4.49011C8.58632 3.59195 9.58893 3 10.7273 3C12.5348 3 14 4.49238 14 6.33333C14 7.18706 13.6849 7.96583 13.1667 8.55556C11.7617 10.1544 8 13 8 13Z" fill="white"/>
5
+ </g>
6
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="16" viewBox="0 0 20 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10 16C10 16 3.98132 11.447 1.73337 8.88889C0.904205 7.94532 0.400024 6.6993 0.400024 5.33333C0.400024 2.38781 2.74442 0 5.63639 0C7.45775 0 9.06191 0.94712 10 2.38418C10.9381 0.94712 12.5423 0 14.3637 0C17.2556 0 19.6 2.38781 19.6 5.33333C19.6 6.6993 19.0958 7.94532 18.2667 8.88889C16.0187 11.447 10 16 10 16Z" fill="#C79156"/>
3
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="collection-tag">
3
+ <path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M10.9999 19C10.9999 19 4.9812 14.447 2.73324 11.8889C1.90408 10.9453 1.3999 9.6993 1.3999 8.33333C1.3999 5.38781 3.7443 3 6.63627 3C8.45762 3 10.0618 3.94712 10.9999 5.38418C11.938 3.94712 13.5422 3 15.3635 3C18.2555 3 20.5999 5.38781 20.5999 8.33333C20.5999 9.6993 20.0957 10.9453 19.2666 11.8889C17.0186 14.447 10.9999 19 10.9999 19Z" fill="#828690"/>
4
+ </g>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="16" height="16" rx="2" fill="#1A1A1A"/>
3
+ <path d="M8 2.75C9.4845 2.789 10.7209 3.30263 11.7091 4.29088C12.6974 5.27912 13.211 6.5155 13.25 8C13.211 9.4845 12.6974 10.7209 11.7091 11.7091C10.7209 12.6974 9.4845 13.211 8 13.25C6.5155 13.211 5.27912 12.6974 4.29088 11.7091C3.30263 10.7209 2.789 9.4845 2.75 8C2.789 6.5155 3.30263 5.27912 4.29088 4.29088C5.27912 3.30263 6.5155 2.789 8 2.75ZM8.78525 5.97275C8.9885 5.97275 9.1565 5.91225 9.28925 5.79125C9.422 5.67025 9.48838 5.50812 9.48837 5.30487C9.48837 5.10162 9.422 4.9395 9.28925 4.8185C9.1565 4.6975 8.9905 4.637 8.79125 4.637C8.592 4.637 8.426 4.6975 8.29325 4.8185C8.1605 4.9395 8.09412 5.10162 8.09412 5.30487C8.09412 5.50812 8.1605 5.67025 8.29325 5.79125C8.426 5.91225 8.59012 5.97275 8.78562 5.97275H8.78525ZM8.92587 10.1915C8.92587 10.1445 8.92975 10.082 8.9375 10.004C8.94525 9.926 8.94525 9.85175 8.9375 9.78125L8.3165 10.496C8.254 10.5662 8.1895 10.621 8.123 10.6602C8.0565 10.6995 7.99988 10.7112 7.95312 10.6955C7.88287 10.6642 7.85162 10.6095 7.85938 10.5312L8.89062 7.28525C8.92963 7.0665 8.8945 6.879 8.78525 6.72275C8.676 6.5665 8.50025 6.47275 8.258 6.4415C7.9845 6.44925 7.68563 6.5645 7.36137 6.78725C7.03713 7.01 6.75388 7.29325 6.51163 7.637V7.81288C6.50388 7.89113 6.50388 7.96537 6.51163 8.03562L7.13263 7.32088C7.19513 7.25063 7.25962 7.19588 7.32613 7.15663C7.39262 7.11738 7.44537 7.10562 7.48438 7.12138C7.56262 7.16037 7.59 7.22287 7.5665 7.30888L6.54688 10.5433C6.49213 10.7385 6.5195 10.9124 6.629 11.0649C6.7385 11.2174 6.92987 11.3209 7.20312 11.3754C7.59387 11.3676 7.922 11.2544 8.1875 11.0356C8.453 10.8169 8.69912 10.5356 8.92587 10.1919V10.1915Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="16" height="16" rx="2" fill="#1A1A1A"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8 13C8 13 4.23831 10.1544 2.83334 8.55556C2.31511 7.96583 2 7.18706 2 6.33333C2 4.49238 3.46525 3 5.27273 3C6.41107 3 7.41368 3.59195 8 4.49011C8.58632 3.59195 9.58893 3 10.7273 3C12.5348 3 14 4.49238 14 6.33333C14 7.18706 13.6849 7.96583 13.1667 8.55556C11.7617 10.1544 8 13 8 13Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,452 @@
1
+ <template>
2
+ <div class="component-list-favorites__tags">
3
+ <div
4
+ v-for="item in tags"
5
+ class="tag-item"
6
+ @click="scrollView(item)"
7
+ :key="item"
8
+ >
9
+ {{ item }}
10
+ </div>
11
+ </div>
12
+ <div class="component-list-favorites" ref="listRef">
13
+ <template v-if="componentTree.length">
14
+ <el-collapse v-model="activeNames">
15
+ <template v-for="item in componentTree" :key="item.title">
16
+ <el-collapse-item
17
+ :name="item.title"
18
+ v-if="calc(item)"
19
+ :data-id="item.title"
20
+ >
21
+ <template #title>
22
+ <el-icon color="#999999" :size="16">
23
+ <CaretBottom v-if="activeNames.includes(item.title)" />
24
+ <CaretRight v-else />
25
+ </el-icon>
26
+ {{ item.title }}
27
+ </template>
28
+ <template
29
+ v-for="subItem in (item.list as ComponentTree[])"
30
+ :key="subItem.title"
31
+ >
32
+ <el-collapse-item
33
+ class="nested-list"
34
+ :name="subItem.title"
35
+ v-if="calc(subItem)"
36
+ >
37
+ <template #title>
38
+ <!-- <el-icon color="#999999" :size="16">
39
+ <CaretBottom v-if="activeNames.includes(subItem.title)" />
40
+ <CaretRight v-else />
41
+ </el-icon> -->
42
+ {{ subItem.title }}
43
+ </template>
44
+ <div v-if="subItem.list" class="component-group">
45
+ <template
46
+ v-for="element in (subItem.list as ComponentTreeItem[])"
47
+ :key="element.name"
48
+ >
49
+ <div
50
+ class="component-item"
51
+ :style="{
52
+ 'pointer-events': readOnly ? 'none' : 'auto',
53
+ }"
54
+ @mousedown="e => onMousedown(e, element)"
55
+ >
56
+ <div
57
+ class="component-img"
58
+ :ref="el => imgRefMap.set(element.name, el)"
59
+ >
60
+ <img :src="element.icon" alt="" />
61
+ </div>
62
+ <!-- 当前正在移动的组件副本 -->
63
+ <div
64
+ v-if="element.name === movingComponent.name"
65
+ class="component-img-copy"
66
+ :style="{
67
+ top: `${movingComponent.top}px`,
68
+ left: `${movingComponent.left}px`,
69
+ cursor: movingComponent.cursor,
70
+ }"
71
+ >
72
+ <img :src="element.icon" alt="" />
73
+ </div>
74
+ <div class="component-name">
75
+ {{ element.title }}
76
+ </div>
77
+ <div class="tip-box">
78
+ <img
79
+ :src="InfoIcon"
80
+ class="icon"
81
+ alt=""
82
+ @mousedown.stop.prevent=""
83
+ @click.stop.prevent="viewTips(element)"
84
+ />
85
+ <img
86
+ :src="
87
+ isFavorite(element?.name)
88
+ ? CollectSelectIcon
89
+ : CollectIcon
90
+ "
91
+ class="icon"
92
+ alt=""
93
+ @mousedown.stop.prevent=""
94
+ @click.stop.prevent="handleCollect(element)"
95
+ />
96
+ </div>
97
+ </div>
98
+ </template>
99
+ </div>
100
+ </el-collapse-item>
101
+ </template>
102
+ </el-collapse-item>
103
+ </template>
104
+ </el-collapse>
105
+ </template>
106
+ <template v-else>
107
+ <div class="notice">组件库为空</div>
108
+ </template>
109
+ <Tips v-model="dialog" :tipsInfo="tipsInfo" :width="776" />
110
+ </div>
111
+ <div :class="['drop-area', coverIframe ? 'cover-iframe' : '']"></div>
112
+ </template>
113
+
114
+ <script lang="ts" setup>
115
+ import { ref, watch, reactive, inject, Ref, computed, onMounted } from 'vue';
116
+ import { ComponentTreeItem, ComponentTree } from '@cicctencent/low-code-core';
117
+ import Tips from './Tips.vue';
118
+ import CollectSelectIcon from '../../../assets/img/tool/collect.svg';
119
+ import CollectIcon from '../../../assets/img/tool/union.svg';
120
+ import InfoIcon from '../../../assets/img/tool/info.svg';
121
+ import { CaretBottom, CaretRight } from '@cicctencent/icons-vue';
122
+ const props = withDefaults(
123
+ defineProps<{
124
+ componentTree?: ComponentTree[];
125
+ readOnly?: boolean;
126
+ favorites: string[];
127
+ }>(),
128
+ {
129
+ readOnly: false,
130
+ favorites: [] as any,
131
+ }
132
+ );
133
+
134
+ const emits = defineEmits(['dragEnd', 'clickItem', 'collect']);
135
+ // 默认全部展开
136
+ const activeNames = ref([]);
137
+ // 是否覆盖iframe 为了解决组件拖拽到iframe出现的位置偏差问题
138
+ const coverIframe = ref(false);
139
+ // 组件图片的ref集合
140
+ const imgRefMap = ref(new Map());
141
+ // 当前正在移动的组件位置
142
+ const movingComponent = reactive({
143
+ name: '',
144
+ top: 0,
145
+ left: 0,
146
+ cursor: 'pointer',
147
+ });
148
+ const iframe = inject<Ref<HTMLIFrameElement>>('iframe');
149
+ watch(
150
+ () => props.componentTree,
151
+ list => {
152
+ const value = [];
153
+ (list || []).forEach(v => {
154
+ value.push(v.title);
155
+ v.list &&
156
+ v.list.forEach(lv => {
157
+ value.push(lv.title);
158
+ });
159
+ });
160
+ activeNames.value = value;
161
+ },
162
+ { deep: true, immediate: true }
163
+ );
164
+ /* 计算该分类下有多少个组件 */
165
+ const calc = (tree: ComponentTree): number => {
166
+ if (tree.list.length) {
167
+ // 不是最后一级分类
168
+ if ((tree.list[0] as ComponentTree)?.list) {
169
+ return (tree.list as ComponentTree[])
170
+ .map(v => calc(v))
171
+ .reduce((p, c) => p + c);
172
+ }
173
+ // 是最后一级分类
174
+ return tree.list.length;
175
+ }
176
+ return 0;
177
+ };
178
+ /**
179
+ * 由于在跨域的iframe上无法触发drag和drop事件 而仅能触发的dragend事件计算的坐标有误差 因此使用mouse事件替代拖拽事件
180
+ */
181
+ const listRef = ref();
182
+ // 记录鼠标是否移动
183
+ let isMoved = false;
184
+ // 记录鼠标长按是否超过0.5s
185
+ let isLongPress = false;
186
+ // 偏移距离
187
+ const offsetLength = 10;
188
+ // 按下鼠标触发的事件
189
+ const onMousedown = (e: MouseEvent, element: ComponentTreeItem) => {
190
+ e.preventDefault();
191
+ const rect = iframe?.value?.getBoundingClientRect?.();
192
+ // 提高蒙层的层级 盖住iframe
193
+ coverIframe.value = true;
194
+ const img = imgRefMap.value.get(element.name);
195
+ // 长按鼠标超过0.5s则副本自动移出当前位置 向上向下各偏移offsetLength 以提示用户可以拖动组件
196
+ const timer = setTimeout(() => {
197
+ isLongPress = true;
198
+ movingComponent.name = element.name;
199
+ movingComponent.left = e.clientX - img.offsetWidth / 2 + offsetLength;
200
+ movingComponent.top = e.clientY - img.offsetHeight / 2 - offsetLength;
201
+ }, 500);
202
+ // 移动鼠标触发的事件
203
+ const move = (ev: MouseEvent) => {
204
+ isMoved = true;
205
+ if (!isLongPress) clearTimeout(timer);
206
+ // 展示组件副本 鼠标移动时让副本组件跟随鼠标
207
+ movingComponent.name = element.name;
208
+ movingComponent.left =
209
+ ev.clientX - img.offsetWidth / 2 + (isLongPress ? offsetLength : 0);
210
+ movingComponent.top =
211
+ ev.clientY - img.offsetHeight / 2 - (isLongPress ? offsetLength : 0);
212
+ // 根据设置鼠标样式
213
+ if (rect) {
214
+ if (
215
+ ev.clientX > rect.left &&
216
+ ev.clientX < rect.left + rect.width &&
217
+ ev.clientY > rect.top &&
218
+ ev.clientY < rect.top + rect.height
219
+ ) {
220
+ movingComponent.cursor = 'copy';
221
+ } else {
222
+ movingComponent.cursor = 'no-drop';
223
+ }
224
+ }
225
+ };
226
+ // 抬起鼠标触发的事件
227
+ const up = (ev: MouseEvent) => {
228
+ if (!isLongPress) clearTimeout(timer);
229
+ // 恢复层级
230
+ coverIframe.value = false;
231
+ // 鼠标未移动且没有长按为点击事件
232
+ if (!isMoved && !isLongPress) {
233
+ emits('clickItem', { key: element.key, value: element });
234
+ } else {
235
+ isMoved = false;
236
+ isLongPress = false;
237
+ // 恢复默认值
238
+ movingComponent.name = '';
239
+ movingComponent.left = 0;
240
+ movingComponent.top = 0;
241
+ movingComponent.cursor = 'pointer';
242
+ const { key, name } = element;
243
+ const { clientX: x, clientY: y } = ev;
244
+ emits('dragEnd', { key, value: { x, y, name } }, ev.view === self);
245
+ }
246
+ document.removeEventListener('mousemove', move);
247
+ document.removeEventListener('mouseup', up);
248
+ };
249
+ document.addEventListener('mousemove', move);
250
+ document.addEventListener('mouseup', up);
251
+ };
252
+ const dialog = ref<boolean>(false);
253
+ const tipsInfo = ref();
254
+ function viewTips(item) {
255
+ tipsInfo.value = item;
256
+ dialog.value = true;
257
+ }
258
+ const tags = computed(() => {
259
+ return props.componentTree.map(it => it.title);
260
+ });
261
+
262
+ const isFavorite = val => {
263
+ if (!props.favorites) {
264
+ return false;
265
+ }
266
+ console.log(typeof props.favorites);
267
+ return props.favorites.includes(val);
268
+ };
269
+
270
+ const scrollView = (item: string) => {
271
+ const el = document.querySelector(`[data-id="${item}"]`);
272
+ if (el) {
273
+ el.scrollIntoView({ behavior: 'smooth' });
274
+ }
275
+ };
276
+ // 收藏/取消收藏
277
+ const handleCollect = item => {
278
+ emits('collect', item);
279
+ };
280
+ </script>
281
+
282
+ <style lang="scss" scoped>
283
+ .component-list-favorites__tags {
284
+ display: flex;
285
+ column-gap: 4px;
286
+ flex-wrap: wrap;
287
+ padding-top: 12px;
288
+ position: sticky;
289
+ top: 0;
290
+ background: #fff;
291
+ z-index: 2;
292
+
293
+ .tag-item {
294
+ padding: 5px 10px;
295
+ border-radius: 4px;
296
+ border: 1px solid #dcdfe6;
297
+ background: #fff;
298
+ color: #4d5260;
299
+ font-size: 14px;
300
+ font-weight: 500;
301
+ line-height: 22px;
302
+ margin-bottom: 6px;
303
+ cursor: pointer;
304
+ &:hover {
305
+ background: #c79156;
306
+ border: 1px solid #c79156;
307
+ color: #fff;
308
+ }
309
+ }
310
+ }
311
+ .component-list-favorites {
312
+ display: flex;
313
+ flex-basis: 100px;
314
+ flex-grow: 1;
315
+ height: 100%;
316
+ overflow-y: auto;
317
+ flex-direction: column;
318
+
319
+ &.is_sticky {
320
+ // padding-top: ;
321
+ }
322
+
323
+ .notice {
324
+ text-align: center;
325
+ font-size: 14px;
326
+ color: rgba(0, 0, 0, 0.6);
327
+ padding: 50px 15px 0;
328
+ }
329
+ .component-group {
330
+ display: flex;
331
+ flex-wrap: wrap;
332
+ column-gap: 10px;
333
+ }
334
+ .component-item {
335
+ display: flex;
336
+ align-items: center;
337
+ flex-direction: column;
338
+ margin-bottom: 10px;
339
+ position: relative;
340
+ cursor: pointer;
341
+ &:hover {
342
+ .tip-box {
343
+ display: block;
344
+ }
345
+ }
346
+ .tip-box {
347
+ position: absolute;
348
+ background: rgba(26, 26, 26, 0.4);
349
+ width: 100px;
350
+ height: 100px;
351
+ left: 0;
352
+ top: 0;
353
+ box-sizing: border-box;
354
+ padding-top: 9px;
355
+ padding-right: 6px;
356
+ display: none;
357
+ border-radius: 4px;
358
+ .icon {
359
+ float: right;
360
+ margin-left: 4px;
361
+ position: relative;
362
+ z-index: 1;
363
+ cursor: pointer;
364
+ }
365
+ }
366
+ .component-img {
367
+ box-sizing: border-box;
368
+ width: 100px;
369
+ min-width: 100px;
370
+ height: 100px;
371
+ background-color: rgba(#212121, 0.1);
372
+ border-radius: 4px;
373
+ // margin-right: 24px;
374
+ padding: 8px 9px;
375
+ img {
376
+ height: 100%;
377
+ width: 100%;
378
+ object-fit: contain;
379
+ }
380
+ }
381
+ .component-img-copy {
382
+ @extend .component-img;
383
+ /* 由于设置为absolute会被该组件外的其他组件遮盖 因此设置为fixed */
384
+ position: fixed;
385
+ z-index: 999;
386
+ transition: all ease;
387
+ }
388
+ .component-name {
389
+ font-size: 12px;
390
+ line-height: 24px;
391
+ color: #828690;
392
+ }
393
+ }
394
+ }
395
+
396
+ .drop-area {
397
+ background: transparent;
398
+ }
399
+ // 显示在最高层
400
+ .cover-iframe {
401
+ position: fixed;
402
+ inset: 0;
403
+ z-index: 99;
404
+ }
405
+ </style>
406
+ <style lang="scss">
407
+ .component-list-favorites {
408
+ .el-collapse {
409
+ margin-top: 20px;
410
+ border: none;
411
+ .el-collapse-item__arrow {
412
+ display: none;
413
+ }
414
+ .el-collapse-item__header {
415
+ color: #282f40;
416
+ font-size: 14px;
417
+ font-weight: 500;
418
+ line-height: 120%;
419
+ height: auto;
420
+ margin-bottom: 20px;
421
+ border: none;
422
+ display: flex;
423
+ align-items: center;
424
+ column-gap: 8px;
425
+ path {
426
+ fill: #999 !important;
427
+ }
428
+ }
429
+ .el-collapse-item__wrap {
430
+ border-bottom: none;
431
+ .el-collapse-item__content {
432
+ padding-bottom: 0px;
433
+ padding-left: 10px;
434
+ }
435
+ }
436
+ }
437
+ .nested-list {
438
+ .el-collapse-item__header {
439
+ font-size: 14px;
440
+ line-height: 24px;
441
+ font-weight: 400;
442
+ height: auto;
443
+ color: #282f40;
444
+ margin-bottom: 4px;
445
+ border: none;
446
+ }
447
+ .el-collapse-item__content {
448
+ padding-left: 0px !important;
449
+ }
450
+ }
451
+ }
452
+ </style>