diff --git a/apps/web-antd/package.json b/apps/web-antd/package.json index 827ff4744166737c349c398700b004902f658a08..feeaa5362532922e5c89e427d22598be677b0adf 100644 --- a/apps/web-antd/package.json +++ b/apps/web-antd/package.json @@ -26,6 +26,10 @@ "#/*": "./src/*" }, "dependencies": { + "@form-create/ant-design-vue": "catalog:", + "@form-create/antd-designer": "catalog:", + "@tinymce/tinymce-vue": "catalog:", + "@types/lodash.clonedeep": "catalog:", "@vben/access": "workspace:*", "@vben/common-ui": "workspace:*", "@vben/constants": "workspace:*", @@ -40,14 +44,16 @@ "@vben/styles": "workspace:*", "@vben/types": "workspace:*", "@vben/utils": "workspace:*", - "@tinymce/tinymce-vue": "catalog:", "@vueuse/core": "catalog:", "ant-design-vue": "catalog:", + "axios": "catalog:", "crypto-js": "catalog:", "dayjs": "catalog:", "highlight.js": "catalog:", + "lodash.clonedeep": "catalog:", "pinia": "catalog:", "vue": "catalog:", + "vue-dompurify-html": "catalog:", "vue-router": "catalog:" } } diff --git a/apps/web-antd/public/tinymce/langs/zh_CN.js b/apps/web-antd/public/tinymce/langs/zh_CN.js index 58ed18871e6679773fd6906e8d5a988d5fd26931..abcf07f7f6f47fcb1f3fad244540c887dc0dadd2 100644 --- a/apps/web-antd/public/tinymce/langs/zh_CN.js +++ b/apps/web-antd/public/tinymce/langs/zh_CN.js @@ -1 +1 @@ -tinymce.addI18n("zh_CN",{"#":"#","Accessibility":"\u8f85\u52a9\u529f\u80fd","Accordion":"\u6298\u53e0\u9762\u677f","Accordion body...":"\u6298\u53e0\u9762\u677f\u6b63\u6587...","Accordion summary...":"\u6298\u53e0\u9762\u677f\u6458\u8981...","Action":"\u52a8\u4f5c","Activity":"\u6d3b\u52a8","Address":"\u5730\u5740","Advanced":"\u9ad8\u7ea7","Align":"\u5bf9\u9f50","Align center":"\u5c45\u4e2d\u5bf9\u9f50","Align left":"\u5de6\u5bf9\u9f50","Align right":"\u53f3\u5bf9\u9f50","Alignment":"\u5bf9\u9f50","Alignment {0}":"\u5bf9\u9f50{0}","All":"\u5168\u90e8","Alternative description":"\u66ff\u4ee3\u63cf\u8ff0","Alternative source":"\u955c\u50cf","Alternative source URL":"\u66ff\u4ee3\u6765\u6e90\u7f51\u5740","Anchor":"\u951a\u70b9","Anchor...":"\u951a\u70b9...","Anchors":"\u951a\u70b9","Animals and Nature":"\u52a8\u7269\u548c\u81ea\u7136","Arrows":"\u7bad\u5934","B":"B","Background color":"\u80cc\u666f\u989c\u8272","Background color {0}":"\u80cc\u666f\u989c\u8272 {0}","Black":"\u9ed1\u8272","Block":"\u5757","Block {0}":"\u6587\u672c\u5757{0}","Blockquote":"Blockquote","Blocks":"\u6837\u5f0f","Blue":"\u84dd\u8272","Blue component":"\u767d\u8272\u90e8\u5206","Body":"\u8868\u4f53","Bold":"\u7c97\u4f53","Border":"\u6846\u7ebf","Border color":"\u6846\u7ebf\u989c\u8272","Border style":"\u8fb9\u6846\u6837\u5f0f","Border width":"\u8fb9\u6846\u5bbd\u5ea6","Bottom":"\u4e0b\u65b9\u5bf9\u9f50","Browse files":"\u6d4f\u89c8\u6587\u4ef6","Browse for an image":"\u6d4f\u89c8\u56fe\u7247","Browse links":"\u6d4f\u89c8\u94fe\u63a5","Bullet list":"\u65e0\u5e8f\u5217\u8868","Cancel":"\u53d6\u6d88","Caption":"\u6807\u9898","Cell":"\u5355\u5143\u683c","Cell padding":"\u5355\u5143\u683c\u5185\u8fb9\u8ddd","Cell properties":"\u5355\u5143\u683c\u5c5e\u6027","Cell spacing":"\u5355\u5143\u683c\u5916\u95f4\u8ddd","Cell styles":"\u5355\u5143\u683c\u6837\u5f0f","Cell type":"\u50a8\u5b58\u683c\u522b","Center":"\u5c45\u4e2d","Characters":"\u5b57\u7b26","Characters (no spaces)":"\u5b57\u7b26(\u65e0\u7a7a\u683c)","Circle":"\u7a7a\u5fc3\u5706","Class":"\u7c7b\u578b","Clear formatting":"\u6e05\u9664\u683c\u5f0f","Close":"\u5173\u95ed","Code":"\u4ee3\u7801","Code sample...":"\u793a\u4f8b\u4ee3\u7801...","Code view":"\u4ee3\u7801\u89c6\u56fe","Color Picker":"\u9009\u8272\u5668","Color swatch":"\u989c\u8272\u6837\u672c","Cols":"\u5217","Column":"\u5217","Column clipboard actions":"\u5217\u526a\u8d34\u677f\u64cd\u4f5c","Column group":"\u5217\u7ec4","Column header":"\u5217\u6807\u9898","Constrain proportions":"\u4fdd\u6301\u6bd4\u4f8b","Copy":"\u590d\u5236","Copy column":"\u590d\u5236\u5217","Copy row":"\u590d\u5236\u884c","Could not find the specified string.":"\u672a\u627e\u5230\u641c\u7d22\u5185\u5bb9\u3002","Could not load emojis":"\u65e0\u6cd5\u52a0\u8f7dEmojis","Count":"\u8ba1\u6570","Currency":"\u8d27\u5e01","Current window":"\u5f53\u524d\u7a97\u53e3","Custom color":"\u81ea\u5b9a\u4e49\u989c\u8272","Custom...":"\u81ea\u5b9a\u4e49......","Cut":"\u526a\u5207","Cut column":"\u526a\u5207\u5217","Cut row":"\u526a\u5207\u884c","Dark Blue":"\u6df1\u84dd\u8272","Dark Gray":"\u6df1\u7070\u8272","Dark Green":"\u6df1\u7eff\u8272","Dark Orange":"\u6df1\u6a59\u8272","Dark Purple":"\u6df1\u7d2b\u8272","Dark Red":"\u6df1\u7ea2\u8272","Dark Turquoise":"\u6df1\u84dd\u7eff\u8272","Dark Yellow":"\u6697\u9ec4\u8272","Dashed":"\u865a\u7ebf","Date/time":"\u65e5\u671f/\u65f6\u95f4","Decrease indent":"\u51cf\u5c11\u7f29\u8fdb","Default":"\u9884\u8bbe","Delete accordion":"\u5220\u9664\u6298\u53e0\u9762\u677f","Delete column":"\u5220\u9664\u5217","Delete row":"\u5220\u9664\u884c","Delete table":"\u5220\u9664\u8868\u683c","Dimensions":"\u5c3a\u5bf8","Disc":"\u5b9e\u5fc3\u5706","Div":"Div","Document":"\u6587\u6863","Dotted":"\u865a\u7ebf","Double":"\u53cc\u7cbe\u5ea6","Drop an image here":"\u62d6\u653e\u4e00\u5f20\u56fe\u50cf\u81f3\u6b64","Dropped file type is not supported":"\u6b64\u6587\u4ef6\u7c7b\u578b\u4e0d\u652f\u6301\u62d6\u653e","Edit":"\u7f16\u8f91","Embed":"\u5185\u5d4c","Emojis":"Emojis","Emojis...":"Emojis...","Error":"\u9519\u8bef","Error: Form submit field collision.":"\u9519\u8bef: \u8868\u5355\u63d0\u4ea4\u5b57\u6bb5\u51b2\u7a81\u3002","Error: No form element found.":"\u9519\u8bef: \u6ca1\u6709\u8868\u5355\u63a7\u4ef6\u3002","Extended Latin":"\u62c9\u4e01\u8bed\u6269\u5145","Failed to initialize plugin: {0}":"\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25: {0}","Failed to load plugin url: {0}":"\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25 \u94fe\u63a5: {0}","Failed to load plugin: {0} from url {1}":"\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25: {0} \u6765\u81ea\u94fe\u63a5 {1}","Failed to upload image: {0}":"\u56fe\u7247\u4e0a\u4f20\u5931\u8d25: {0}","File":"\u6587\u4ef6","Find":"\u5bfb\u627e","Find (if searchreplace plugin activated)":"\u67e5\u627e(\u5982\u679c\u67e5\u627e\u66ff\u6362\u63d2\u4ef6\u5df2\u6fc0\u6d3b)","Find and Replace":"\u67e5\u627e\u548c\u66ff\u6362","Find and replace...":"\u67e5\u627e\u5e76\u66ff\u6362...","Find in selection":"\u5728\u9009\u533a\u4e2d\u67e5\u627e","Find whole words only":"\u5168\u5b57\u5339\u914d","Flags":"\u65d7\u5e1c","Focus to contextual toolbar":"\u79fb\u52a8\u7126\u70b9\u5230\u4e0a\u4e0b\u6587\u83dc\u5355","Focus to element path":"\u79fb\u52a8\u7126\u70b9\u5230\u5143\u7d20\u8def\u5f84","Focus to menubar":"\u79fb\u52a8\u7126\u70b9\u5230\u83dc\u5355\u680f","Focus to toolbar":"\u79fb\u52a8\u7126\u70b9\u5230\u5de5\u5177\u680f","Font":"\u5b57\u4f53","Font size {0}":"\u5b57\u4f53\u5927\u5c0f{0}","Font sizes":"\u5b57\u4f53\u5927\u5c0f","Font {0}":"\u5b57\u4f53{0}","Fonts":"\u5b57\u4f53","Food and Drink":"\u98df\u7269\u548c\u996e\u54c1","Footer":"\u8868\u5c3e","Format":"\u683c\u5f0f","Format {0}":"\u683c\u5f0f{0}","Formats":"\u683c\u5f0f","Fullscreen":"\u5168\u5c4f","G":"G","General":"\u4e00\u822c","Gray":"\u7070\u8272","Green":"\u7eff\u8272","Green component":"\u7eff\u8272\u90e8\u5206","Groove":"\u51f9\u69fd","Handy Shortcuts":"\u5feb\u6377\u952e","Header":"\u8868\u5934","Header cell":"\u8868\u5934\u5355\u5143\u683c","Heading 1":"\u4e00\u7ea7\u6807\u9898","Heading 2":"\u4e8c\u7ea7\u6807\u9898","Heading 3":"\u4e09\u7ea7\u6807\u9898","Heading 4":"\u56db\u7ea7\u6807\u9898","Heading 5":"\u4e94\u7ea7\u6807\u9898","Heading 6":"\u516d\u7ea7\u6807\u9898","Headings":"\u6807\u9898","Height":"\u9ad8\u5ea6","Help":"\u5e2e\u52a9","Hex color code":"\u5341\u516d\u8fdb\u5236\u989c\u8272\u4ee3\u7801","Hidden":"\u9690\u85cf","Horizontal align":"\u6c34\u5e73\u5bf9\u9f50","Horizontal line":"\u6c34\u5e73\u5206\u5272\u7ebf","Horizontal space":"\u6c34\u5e73\u95f4\u8ddd","ID":"ID","ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.":"ID\u5e94\u8be5\u4ee5\u82f1\u6587\u5b57\u6bcd\u5f00\u5934\uff0c\u540e\u9762\u53ea\u80fd\u6709\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u7834\u6298\u53f7\u3001\u70b9\u3001\u5192\u53f7\u6216\u4e0b\u5212\u7ebf\u3002","Image is decorative":"\u56fe\u50cf\u662f\u88c5\u9970\u6027\u7684","Image list":"\u56fe\u7247\u6e05\u5355","Image title":"\u56fe\u7247\u6807\u9898","Image...":"\u56fe\u7247...","ImageProxy HTTP error: Could not find Image Proxy":"\u56fe\u7247\u4ee3\u7406\u8bf7\u6c42\u9519\u8bef\uff1a\u65e0\u6cd5\u627e\u5230\u56fe\u7247\u4ee3\u7406","ImageProxy HTTP error: Incorrect Image Proxy URL":"\u56fe\u7247\u4ee3\u7406\u8bf7\u6c42\u9519\u8bef\uff1a\u56fe\u7247\u4ee3\u7406\u5730\u5740\u9519\u8bef","ImageProxy HTTP error: Rejected request":"\u56fe\u7247\u4ee3\u7406\u8bf7\u6c42\u9519\u8bef\uff1a\u8bf7\u6c42\u88ab\u62d2\u7edd","ImageProxy HTTP error: Unknown ImageProxy error":"\u56fe\u7247\u4ee3\u7406\u8bf7\u6c42\u9519\u8bef\uff1a\u672a\u77e5\u7684\u56fe\u7247\u4ee3\u7406\u9519\u8bef","Increase indent":"\u589e\u52a0\u7f29\u8fdb","Inline":"\u6587\u672c","Insert":"\u63d2\u5165","Insert Template":"\u63d2\u5165\u6a21\u677f","Insert accordion":"\u63d2\u5165\u6298\u53e0\u9762\u677f","Insert column after":"\u5728\u53f3\u4fa7\u63d2\u5165\u5217","Insert column before":"\u5728\u5de6\u4fa7\u63d2\u5165\u5217","Insert date/time":"\u63d2\u5165\u65e5\u671f/\u65f6\u95f4","Insert image":"\u63d2\u5165\u56fe\u7247","Insert link (if link plugin activated)":"\u63d2\u5165\u94fe\u63a5 (\u5982\u679c\u94fe\u63a5\u63d2\u4ef6\u5df2\u6fc0\u6d3b)","Insert row after":"\u5728\u4e0b\u65b9\u63d2\u5165\u884c","Insert row before":"\u5728\u4e0a\u65b9\u63d2\u5165\u884c","Insert table":"\u63d2\u5165\u8868\u683c","Insert template...":"\u63d2\u5165\u6a21\u677f...","Insert video":"\u63d2\u5165\u89c6\u9891","Insert/Edit code sample":"\u63d2\u5165/\u7f16\u8f91\u4ee3\u7801\u793a\u4f8b","Insert/edit image":"\u63d2\u5165/\u7f16\u8f91\u56fe\u7247","Insert/edit link":"\u63d2\u5165/\u7f16\u8f91\u94fe\u63a5","Insert/edit media":"\u63d2\u5165/\u7f16\u8f91\u5a92\u4f53","Insert/edit video":"\u63d2\u5165/\u7f16\u8f91\u89c6\u9891","Inset":"\u5d4c\u5165","Invalid hex color code: {0}":"\u5341\u516d\u8fdb\u5236\u989c\u8272\u4ee3\u7801\u65e0\u6548\uff1a {0}","Invalid input":"\u65e0\u6548\u8f93\u5165","Italic":"\u659c\u4f53","Justify":"\u4e24\u7aef\u5bf9\u9f50","Keyboard Navigation":"\u952e\u76d8\u6307\u5f15","Language":"\u8bed\u8a00","Learn more...":"\u4e86\u89e3\u66f4\u591a...","Left":"\u5de6","Left to right":"\u7531\u5de6\u5230\u53f3","Light Blue":"\u6d45\u84dd\u8272","Light Gray":"\u6d45\u7070\u8272","Light Green":"\u6d45\u7eff\u8272","Light Purple":"\u6d45\u7d2b\u8272","Light Red":"\u6d45\u7ea2\u8272","Light Yellow":"\u6d45\u9ec4\u8272","Line height":"Line height","Link list":"\u94fe\u63a5\u6e05\u5355","Link...":"\u94fe\u63a5...","List Properties":"\u5217\u8868\u5c5e\u6027","List properties...":"\u6807\u9898\u5b57\u4f53\u5c5e\u6027","Loading emojis...":"\u6b63\u5728\u52a0\u8f7dEmojis...","Loading...":"\u52a0\u8f7d\u4e2d...","Lower Alpha":"\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd","Lower Greek":"\u5c0f\u5199\u5e0c\u814a\u5b57\u6bcd","Lower Roman":"\u5c0f\u5199\u7f57\u9a6c\u6570\u5b57","Match case":"\u5927\u5c0f\u5199\u5339\u914d","Mathematical":"\u6570\u5b66","Media poster (Image URL)":"\u5c01\u9762(\u56fe\u7247\u5730\u5740)","Media...":"\u591a\u5a92\u4f53...","Medium Blue":"\u4e2d\u84dd\u8272","Medium Gray":"\u4e2d\u7070\u8272","Medium Purple":"\u4e2d\u7d2b\u8272","Merge cells":"\u5408\u5e76\u5355\u5143\u683c","Middle":"\u5c45\u4e2d\u5bf9\u9f50","Midnight Blue":"\u6df1\u84dd\u8272","More...":"\u66f4\u591a...","Name":"\u540d\u79f0","Navy Blue":"\u6d77\u519b\u84dd","New document":"\u65b0\u5efa\u6587\u6863","New window":"\u65b0\u7a97\u53e3","Next":"\u4e0b\u4e00\u4e2a","No":"\u5426","No alignment":"\u672a\u5bf9\u9f50","No color":"\u65e0","Nonbreaking space":"\u4e0d\u95f4\u65ad\u7a7a\u683c","None":"\u65e0","Numbered list":"\u6709\u5e8f\u5217\u8868","OR":"\u6216","Objects":"\u7269\u4ef6","Ok":"\u786e\u5b9a","Open help dialog":"\u6253\u5f00\u5e2e\u52a9\u5bf9\u8bdd\u6846","Open link":"\u6253\u5f00\u94fe\u63a5","Open link in...":"\u94fe\u63a5\u6253\u5f00\u4f4d\u7f6e...","Open popup menu for split buttons":"\u6253\u5f00\u5f39\u51fa\u5f0f\u83dc\u5355\uff0c\u7528\u4e8e\u62c6\u5206\u6309\u94ae","Orange":"\u6a59\u8272","Outset":"\u5916\u7f6e","Page break":"\u5206\u9875\u7b26","Paragraph":"\u6bb5\u843d","Paste":"\u7c98\u8d34","Paste as text":"\u7c98\u8d34\u4e3a\u6587\u672c","Paste column after":"\u7c98\u8d34\u540e\u9762\u7684\u5217","Paste column before":"\u7c98\u8d34\u6b64\u5217\u524d","Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.":"\u5f53\u524d\u4e3a\u7eaf\u6587\u672c\u7c98\u8d34\u6a21\u5f0f\uff0c\u518d\u6b21\u70b9\u51fb\u53ef\u4ee5\u56de\u5230\u666e\u901a\u7c98\u8d34\u6a21\u5f0f\u3002","Paste or type a link":"\u7c98\u8d34\u6216\u8f93\u5165\u94fe\u63a5","Paste row after":"\u7c98\u8d34\u884c\u5230\u4e0b\u65b9","Paste row before":"\u7c98\u8d34\u884c\u5230\u4e0a\u65b9","Paste your embed code below:":"\u5c06\u5185\u5d4c\u4ee3\u7801\u7c98\u8d34\u5728\u4e0b\u9762:","People":"\u4eba\u7c7b","Plugins":"\u63d2\u4ef6","Plugins installed ({0}):":"\u5df2\u5b89\u88c5\u63d2\u4ef6 ({0}):","Powered by {0}":"\u7531{0}\u9a71\u52a8","Pre":"\u524d\u8a00","Preferences":"\u9996\u9009\u9879","Preformatted":"\u9884\u5148\u683c\u5f0f\u5316\u7684","Premium plugins:":"\u4f18\u79c0\u63d2\u4ef6\uff1a","Press the Up and Down arrow keys to resize the editor.":"\u6309\u4e0a\u4e0b\u7bad\u5934\u952e\u4ee5\u8c03\u6574\u7f16\u8f91\u5668\u5927\u5c0f\u3002","Press the arrow keys to resize the editor.":"\u6309\u7bad\u5934\u952e\u4ee5\u8c03\u6574\u7f16\u8f91\u5668\u5927\u5c0f\u3002","Press {0} for help":"\u6309 {0} \u83b7\u5f97\u5e2e\u52a9","Preview":"\u9884\u89c8","Previous":"\u4e0a\u4e00\u4e2a","Print":"\u6253\u5370","Print...":"\u6253\u5370...","Purple":"\u7d2b\u8272","Quotations":"\u5f15\u7528","R":"R","Range 0 to 255":"\u8303\u56f40\u81f3255","Red":"\u7ea2\u8272","Red component":"\u7ea2\u8272\u90e8\u5206","Redo":"\u91cd\u505a","Remove":"\u79fb\u9664","Remove color":"\u79fb\u9664\u989c\u8272","Remove link":"\u79fb\u9664\u94fe\u63a5","Replace":"\u66ff\u6362","Replace all":"\u66ff\u6362\u5168\u90e8","Replace with":"\u66ff\u6362\u4e3a","Resize":"\u8c03\u6574\u5927\u5c0f","Restore last draft":"\u6062\u590d\u4e0a\u6b21\u7684\u8349\u7a3f","Reveal or hide additional toolbar items":"\u663e\u793a\u6216\u9690\u85cf\u5176\u4ed6\u5de5\u5177\u680f\u9879","Rich Text Area":"\u5bcc\u6587\u672c\u533a\u57df","Rich Text Area. Press ALT-0 for help.":"\u7f16\u8f91\u533a\u3002\u6309Alt+0\u952e\u6253\u5f00\u5e2e\u52a9\u3002","Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help":"\u7f16\u8f91\u533a\u3002\u6309ALT-F9\u6253\u5f00\u83dc\u5355\uff0c\u6309ALT-F10\u6253\u5f00\u5de5\u5177\u680f\uff0c\u6309ALT-0\u67e5\u770b\u5e2e\u52a9","Ridge":"\u6d77\u810a\u5ea7","Right":"\u53f3","Right to left":"\u7531\u53f3\u5230\u5de6","Row":"\u884c","Row clipboard actions":"\u884c\u526a\u8d34\u677f\u64cd\u4f5c","Row group":"\u884c\u7ec4","Row header":"\u884c\u5934","Row properties":"\u884c\u5c5e\u6027","Row type":"\u884c\u7c7b\u578b","Rows":"\u884c\u6570","Save":"\u4fdd\u5b58","Save (if save plugin activated)":"\u4fdd\u5b58(\u5982\u679c\u4fdd\u5b58\u63d2\u4ef6\u5df2\u6fc0\u6d3b)","Scope":"\u8303\u56f4","Search":"\u641c\u7d22","Select all":"\u5168\u9009","Select...":"\u9009\u62e9...","Selection":"\u9009\u62e9","Shortcut":"\u5feb\u6377\u65b9\u5f0f","Show blocks":"\u663e\u793a\u533a\u5757\u8fb9\u6846","Show caption":"\u663e\u793a\u6807\u9898","Show invisible characters":"\u663e\u793a\u4e0d\u53ef\u89c1\u5b57\u7b26","Size":"\u5b57\u53f7","Solid":"\u5b9e\u7ebf","Source":"\u5730\u5740","Source code":"\u6e90\u4ee3\u7801","Special Character":"\u7279\u6b8a\u5b57\u7b26","Special character...":"\u7279\u6b8a\u5b57\u7b26...","Split cell":"\u62c6\u5206\u5355\u5143\u683c","Square":"\u5b9e\u5fc3\u65b9\u5757","Start list at number":"\u4ee5\u6570\u5b57\u5f00\u59cb\u5217\u8868","Strikethrough":"\u5220\u9664\u7ebf","Style":"\u6837\u5f0f","Subscript":"\u4e0b\u6807","Superscript":"\u4e0a\u6807","Switch to or from fullscreen mode":"\u5207\u6362\u5168\u5c4f\u6a21\u5f0f","Symbols":"\u7b26\u53f7","System Font":"\u7cfb\u7edf\u5b57\u4f53","Table":"\u8868\u683c","Table caption":"\u8868\u683c\u6807\u9898","Table properties":"\u8868\u683c\u5c5e\u6027","Table styles":"\u8868\u683c\u6837\u5f0f","Template":"\u6a21\u677f","Templates":"\u6a21\u677f","Text":"\u6587\u5b57","Text color":"\u5b57\u4f53\u989c\u8272","Text color {0}":"\u5b57\u4f53\u989c\u8272 {0}","Text to display":"\u8981\u663e\u793a\u7684\u6587\u672c","The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?":"\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u4e3a\u90ae\u4ef6\u5730\u5740\uff0c\u9700\u8981\u52a0\u4e0amailto: \u524d\u7f00\u5417\uff1f","The URL you entered seems to be an external link. Do you want to add the required http:// prefix?":"\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u5c5e\u4e8e\u5916\u90e8\u94fe\u63a5\uff0c\u9700\u8981\u52a0\u4e0ahttp:// \u524d\u7f00\u5417\uff1f","The URL you entered seems to be an external link. Do you want to add the required https:// prefix?":"\u60a8\u8f93\u5165\u7684 URL \u4f3c\u4e4e\u662f\u4e00\u4e2a\u5916\u90e8\u94fe\u63a5\u3002\u60a8\u60f3\u6dfb\u52a0\u6240\u9700\u7684 https:// \u524d\u7f00\u5417\uff1f","Title":"\u6807\u9898","To open the popup, press Shift+Enter":"\u6309Shitf+Enter\u952e\u6253\u5f00\u5bf9\u8bdd\u6846","Toggle accordion":"\u5207\u6362\u6298\u53e0\u9762\u677f","Tools":"\u5de5\u5177","Top":"\u4e0a\u65b9\u5bf9\u9f50","Travel and Places":"\u65c5\u6e38\u548c\u5730\u70b9","Turquoise":"\u9752\u7eff\u8272","Underline":"\u4e0b\u5212\u7ebf","Undo":"\u64a4\u9500","Upload":"\u4e0a\u4f20","Uploading image":"\u4e0a\u4f20\u56fe\u7247","Upper Alpha":"\u5927\u5199\u82f1\u6587\u5b57\u6bcd","Upper Roman":"\u5927\u5199\u7f57\u9a6c\u6570\u5b57","Url":"\u5730\u5740","User Defined":"\u81ea\u5b9a\u4e49","Valid":"\u6709\u6548","Version":"\u7248\u672c","Vertical align":"\u5782\u76f4\u5bf9\u9f50","Vertical space":"\u5782\u76f4\u95f4\u8ddd","View":"\u67e5\u770b","Visual aids":"\u7f51\u683c\u7ebf","Warn":"\u8b66\u544a","White":"\u767d\u8272","Width":"\u5bbd\u5ea6","Word count":"\u5b57\u6570","Words":"\u5355\u8bcd","Words: {0}":"\u5b57\u6570\uff1a{0}","Yellow":"\u9ec4\u8272","Yes":"\u662f","You are using {0}":"\u4f60\u6b63\u5728\u4f7f\u7528 {0}","You have unsaved changes are you sure you want to navigate away?":"\u4f60\u8fd8\u6709\u6587\u6863\u5c1a\u672a\u4fdd\u5b58\uff0c\u786e\u5b9a\u8981\u79bb\u5f00\uff1f","Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.":"\u4f60\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u6253\u5f00\u526a\u8d34\u677f\uff0c\u8bf7\u4f7f\u7528Ctrl+X/C/V\u7b49\u5feb\u6377\u952e\u3002","alignment":"\u5bf9\u9f50","austral sign":"\u6fb3\u5143\u7b26\u53f7","cedi sign":"\u585e\u5730\u7b26\u53f7","colon sign":"\u5192\u53f7","cruzeiro sign":"\u514b\u9c81\u8d5b\u7f57\u5e01\u7b26\u53f7","currency sign":"\u8d27\u5e01\u7b26\u53f7","dollar sign":"\u7f8e\u5143\u7b26\u53f7","dong sign":"\u8d8a\u5357\u76fe\u7b26\u53f7","drachma sign":"\u5fb7\u62c9\u514b\u9a6c\u7b26\u53f7","euro-currency sign":"\u6b27\u5143\u7b26\u53f7","example":"\u793a\u4f8b","formatting":"\u683c\u5f0f\u5316","french franc sign":"\u6cd5\u90ce\u7b26\u53f7","german penny symbol":"\u5fb7\u56fd\u4fbf\u58eb\u7b26\u53f7","guarani sign":"\u74dc\u62c9\u5c3c\u7b26\u53f7","history":"\u5386\u53f2","hryvnia sign":"\u683c\u91cc\u592b\u5c3c\u4e9a\u7b26\u53f7","indentation":"\u7f29\u8fdb","indian rupee sign":"\u5370\u5ea6\u5362\u6bd4","kip sign":"\u8001\u631d\u57fa\u666e\u7b26\u53f7","lira sign":"\u91cc\u62c9\u7b26\u53f7","livre tournois sign":"\u91cc\u5f17\u5f17\u5c14\u7b26\u53f7","manat sign":"\u9a6c\u7eb3\u7279\u7b26\u53f7","mill sign":"\u5bc6\u5c14\u7b26\u53f7","naira sign":"\u5948\u62c9\u7b26\u53f7","new sheqel sign":"\u65b0\u8c22\u514b\u5c14\u7b26\u53f7","nordic mark sign":"\u5317\u6b27\u9a6c\u514b","peseta sign":"\u6bd4\u585e\u5854\u7b26\u53f7","peso sign":"\u6bd4\u7d22\u7b26\u53f7","ruble sign":"\u5362\u5e03\u7b26\u53f7","rupee sign":"\u5362\u6bd4\u7b26\u53f7","spesmilo sign":"spesmilo\u7b26\u53f7","styles":"\u6837\u5f0f","tenge sign":"\u575a\u6208\u7b26\u53f7","tugrik sign":"\u56fe\u683c\u91cc\u514b\u7b26\u53f7","turkish lira sign":"\u571f\u8033\u5176\u91cc\u62c9","won sign":"\u97e9\u5143\u7b26\u53f7","yen character":"\u65e5\u5143\u5b57\u6837","yen/yuan character variant one":"\u5143\u5b57\u6837\uff08\u5927\u5199\uff09","yuan character":"\u4eba\u6c11\u5e01\u5143\u5b57\u6837","yuan character, in hong kong and taiwan":"\u5143\u5b57\u6837\uff08\u6e2f\u53f0\u5730\u533a\uff09","{0} characters":"{0} \u4e2a\u5b57\u7b26","{0} columns, {1} rows":"{0} \u5217\uff0c{1} \u884c","{0} words":"{0} \u5b57"}); \ No newline at end of file +tinymce.addI18n("zh_CN",{"#":"#","Accessibility":"\u8F85\u52A9\u529F\u80FD","Accordion":"\u6298\u53E0\u9762\u677F","Accordion body...":"\u6298\u53E0\u9762\u677F\u6B63\u6587...","Accordion summary...":"\u6298\u53E0\u9762\u677F\u6458\u8981...","Action":"\u52A8\u4F5C","Activity":"\u6D3B\u52A8","Address":"\u5730\u5740","Advanced":"\u9AD8\u7EA7","Align":"\u5BF9\u9F50","Align center":"\u5C45\u4E2D\u5BF9\u9F50","Align left":"\u5DE6\u5BF9\u9F50","Align right":"\u53F3\u5BF9\u9F50","Alignment":"\u5BF9\u9F50","Alignment {0}":"\u5BF9\u9F50{0}","All":"\u5168\u90E8","Alternative description":"\u66FF\u4EE3\u63CF\u8FF0","Alternative source":"\u955C\u50CF","Alternative source URL":"\u66FF\u4EE3\u6765\u6E90\u7F51\u5740","Anchor":"\u951A\u70B9","Anchor...":"\u951A\u70B9...","Anchors":"\u951A\u70B9","Animals and Nature":"\u52A8\u7269\u548C\u81EA\u7136","Arrows":"\u7BAD\u5934","B":"B","Background color":"\u80CC\u666F\u989C\u8272","Background color {0}":"\u80CC\u666F\u989C\u8272 {0}","Black":"\u9ED1\u8272","Block":"\u5757","Block {0}":"\u6587\u672C\u5757{0}","Blockquote":"Blockquote","Blocks":"\u6837\u5F0F","Blue":"\u84DD\u8272","Blue component":"\u767D\u8272\u90E8\u5206","Body":"\u8868\u4F53","Bold":"\u7C97\u4F53","Border":"\u6846\u7EBF","Border color":"\u6846\u7EBF\u989C\u8272","Border style":"\u8FB9\u6846\u6837\u5F0F","Border width":"\u8FB9\u6846\u5BBD\u5EA6","Bottom":"\u4E0B\u65B9\u5BF9\u9F50","Browse files":"\u6D4F\u89C8\u6587\u4EF6","Browse for an image":"\u6D4F\u89C8\u56FE\u7247","Browse links":"\u6D4F\u89C8\u94FE\u63A5","Bullet list":"\u65E0\u5E8F\u5217\u8868","Cancel":"\u53D6\u6D88","Caption":"\u6807\u9898","Cell":"\u5355\u5143\u683C","Cell padding":"\u5355\u5143\u683C\u5185\u8FB9\u8DDD","Cell properties":"\u5355\u5143\u683C\u5C5E\u6027","Cell spacing":"\u5355\u5143\u683C\u5916\u95F4\u8DDD","Cell styles":"\u5355\u5143\u683C\u6837\u5F0F","Cell type":"\u50A8\u5B58\u683C\u522B","Center":"\u5C45\u4E2D","Characters":"\u5B57\u7B26","Characters (no spaces)":"\u5B57\u7B26(\u65E0\u7A7A\u683C)","Circle":"\u7A7A\u5FC3\u5706","Class":"\u7C7B\u578B","Clear formatting":"\u6E05\u9664\u683C\u5F0F","Close":"\u5173\u95ED","Code":"\u4EE3\u7801","Code sample...":"\u793A\u4F8B\u4EE3\u7801...","Code view":"\u4EE3\u7801\u89C6\u56FE","Color Picker":"\u9009\u8272\u5668","Color swatch":"\u989C\u8272\u6837\u672C","Cols":"\u5217","Column":"\u5217","Column clipboard actions":"\u5217\u526A\u8D34\u677F\u64CD\u4F5C","Column group":"\u5217\u7EC4","Column header":"\u5217\u6807\u9898","Constrain proportions":"\u4FDD\u6301\u6BD4\u4F8B","Copy":"\u590D\u5236","Copy column":"\u590D\u5236\u5217","Copy row":"\u590D\u5236\u884C","Could not find the specified string.":"\u672A\u627E\u5230\u641C\u7D22\u5185\u5BB9\u3002","Could not load emojis":"\u65E0\u6CD5\u52A0\u8F7DEmojis","Count":"\u8BA1\u6570","Currency":"\u8D27\u5E01","Current window":"\u5F53\u524D\u7A97\u53E3","Custom color":"\u81EA\u5B9A\u4E49\u989C\u8272","Custom...":"\u81EA\u5B9A\u4E49......","Cut":"\u526A\u5207","Cut column":"\u526A\u5207\u5217","Cut row":"\u526A\u5207\u884C","Dark Blue":"\u6DF1\u84DD\u8272","Dark Gray":"\u6DF1\u7070\u8272","Dark Green":"\u6DF1\u7EFF\u8272","Dark Orange":"\u6DF1\u6A59\u8272","Dark Purple":"\u6DF1\u7D2B\u8272","Dark Red":"\u6DF1\u7EA2\u8272","Dark Turquoise":"\u6DF1\u84DD\u7EFF\u8272","Dark Yellow":"\u6697\u9EC4\u8272","Dashed":"\u865A\u7EBF","Date/time":"\u65E5\u671F/\u65F6\u95F4","Decrease indent":"\u51CF\u5C11\u7F29\u8FDB","Default":"\u9884\u8BBE","Delete accordion":"\u5220\u9664\u6298\u53E0\u9762\u677F","Delete column":"\u5220\u9664\u5217","Delete row":"\u5220\u9664\u884C","Delete table":"\u5220\u9664\u8868\u683C","Dimensions":"\u5C3A\u5BF8","Disc":"\u5B9E\u5FC3\u5706","Div":"Div","Document":"\u6587\u6863","Dotted":"\u865A\u7EBF","Double":"\u53CC\u7CBE\u5EA6","Drop an image here":"\u62D6\u653E\u4E00\u5F20\u56FE\u50CF\u81F3\u6B64","Dropped file type is not supported":"\u6B64\u6587\u4EF6\u7C7B\u578B\u4E0D\u652F\u6301\u62D6\u653E","Edit":"\u7F16\u8F91","Embed":"\u5185\u5D4C","Emojis":"Emojis","Emojis...":"Emojis...","Error":"\u9519\u8BEF","Error: Form submit field collision.":"\u9519\u8BEF: \u8868\u5355\u63D0\u4EA4\u5B57\u6BB5\u51B2\u7A81\u3002","Error: No form element found.":"\u9519\u8BEF: \u6CA1\u6709\u8868\u5355\u63A7\u4EF6\u3002","Extended Latin":"\u62C9\u4E01\u8BED\u6269\u5145","Failed to initialize plugin: {0}":"\u63D2\u4EF6\u521D\u59CB\u5316\u5931\u8D25: {0}","Failed to load plugin url: {0}":"\u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25 \u94FE\u63A5: {0}","Failed to load plugin: {0} from url {1}":"\u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25: {0} \u6765\u81EA\u94FE\u63A5 {1}","Failed to upload image: {0}":"\u56FE\u7247\u4E0A\u4F20\u5931\u8D25: {0}","File":"\u6587\u4EF6","Find":"\u5BFB\u627E","Find (if searchreplace plugin activated)":"\u67E5\u627E(\u5982\u679C\u67E5\u627E\u66FF\u6362\u63D2\u4EF6\u5DF2\u6FC0\u6D3B)","Find and Replace":"\u67E5\u627E\u548C\u66FF\u6362","Find and replace...":"\u67E5\u627E\u5E76\u66FF\u6362...","Find in selection":"\u5728\u9009\u533A\u4E2D\u67E5\u627E","Find whole words only":"\u5168\u5B57\u5339\u914D","Flags":"\u65D7\u5E1C","Focus to contextual toolbar":"\u79FB\u52A8\u7126\u70B9\u5230\u4E0A\u4E0B\u6587\u83DC\u5355","Focus to element path":"\u79FB\u52A8\u7126\u70B9\u5230\u5143\u7D20\u8DEF\u5F84","Focus to menubar":"\u79FB\u52A8\u7126\u70B9\u5230\u83DC\u5355\u680F","Focus to toolbar":"\u79FB\u52A8\u7126\u70B9\u5230\u5DE5\u5177\u680F","Font":"\u5B57\u4F53","Font size {0}":"\u5B57\u4F53\u5927\u5C0F{0}","Font sizes":"\u5B57\u4F53\u5927\u5C0F","Font {0}":"\u5B57\u4F53{0}","Fonts":"\u5B57\u4F53","Food and Drink":"\u98DF\u7269\u548C\u996E\u54C1","Footer":"\u8868\u5C3E","Format":"\u683C\u5F0F","Format {0}":"\u683C\u5F0F{0}","Formats":"\u683C\u5F0F","Fullscreen":"\u5168\u5C4F","G":"G","General":"\u4E00\u822C","Gray":"\u7070\u8272","Green":"\u7EFF\u8272","Green component":"\u7EFF\u8272\u90E8\u5206","Groove":"\u51F9\u69FD","Handy Shortcuts":"\u5FEB\u6377\u952E","Header":"\u8868\u5934","Header cell":"\u8868\u5934\u5355\u5143\u683C","Heading 1":"\u4E00\u7EA7\u6807\u9898","Heading 2":"\u4E8C\u7EA7\u6807\u9898","Heading 3":"\u4E09\u7EA7\u6807\u9898","Heading 4":"\u56DB\u7EA7\u6807\u9898","Heading 5":"\u4E94\u7EA7\u6807\u9898","Heading 6":"\u516D\u7EA7\u6807\u9898","Headings":"\u6807\u9898","Height":"\u9AD8\u5EA6","Help":"\u5E2E\u52A9","Hex color code":"\u5341\u516D\u8FDB\u5236\u989C\u8272\u4EE3\u7801","Hidden":"\u9690\u85CF","Horizontal align":"\u6C34\u5E73\u5BF9\u9F50","Horizontal line":"\u6C34\u5E73\u5206\u5272\u7EBF","Horizontal space":"\u6C34\u5E73\u95F4\u8DDD","ID":"ID","ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.":"ID\u5E94\u8BE5\u4EE5\u82F1\u6587\u5B57\u6BCD\u5F00\u5934\uFF0C\u540E\u9762\u53EA\u80FD\u6709\u82F1\u6587\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u7834\u6298\u53F7\u3001\u70B9\u3001\u5192\u53F7\u6216\u4E0B\u5212\u7EBF\u3002","Image is decorative":"\u56FE\u50CF\u662F\u88C5\u9970\u6027\u7684","Image list":"\u56FE\u7247\u6E05\u5355","Image title":"\u56FE\u7247\u6807\u9898","Image...":"\u56FE\u7247...","ImageProxy HTTP error: Could not find Image Proxy":"\u56FE\u7247\u4EE3\u7406\u8BF7\u6C42\u9519\u8BEF\uFF1A\u65E0\u6CD5\u627E\u5230\u56FE\u7247\u4EE3\u7406","ImageProxy HTTP error: Incorrect Image Proxy URL":"\u56FE\u7247\u4EE3\u7406\u8BF7\u6C42\u9519\u8BEF\uFF1A\u56FE\u7247\u4EE3\u7406\u5730\u5740\u9519\u8BEF","ImageProxy HTTP error: Rejected request":"\u56FE\u7247\u4EE3\u7406\u8BF7\u6C42\u9519\u8BEF\uFF1A\u8BF7\u6C42\u88AB\u62D2\u7EDD","ImageProxy HTTP error: Unknown ImageProxy error":"\u56FE\u7247\u4EE3\u7406\u8BF7\u6C42\u9519\u8BEF\uFF1A\u672A\u77E5\u7684\u56FE\u7247\u4EE3\u7406\u9519\u8BEF","Increase indent":"\u589E\u52A0\u7F29\u8FDB","Inline":"\u6587\u672C","Insert":"\u63D2\u5165","Insert Template":"\u63D2\u5165\u6A21\u677F","Insert accordion":"\u63D2\u5165\u6298\u53E0\u9762\u677F","Insert column after":"\u5728\u53F3\u4FA7\u63D2\u5165\u5217","Insert column before":"\u5728\u5DE6\u4FA7\u63D2\u5165\u5217","Insert date/time":"\u63D2\u5165\u65E5\u671F/\u65F6\u95F4","Insert image":"\u63D2\u5165\u56FE\u7247","Insert link (if link plugin activated)":"\u63D2\u5165\u94FE\u63A5 (\u5982\u679C\u94FE\u63A5\u63D2\u4EF6\u5DF2\u6FC0\u6D3B)","Insert row after":"\u5728\u4E0B\u65B9\u63D2\u5165\u884C","Insert row before":"\u5728\u4E0A\u65B9\u63D2\u5165\u884C","Insert table":"\u63D2\u5165\u8868\u683C","Insert template...":"\u63D2\u5165\u6A21\u677F...","Insert video":"\u63D2\u5165\u89C6\u9891","Insert/Edit code sample":"\u63D2\u5165/\u7F16\u8F91\u4EE3\u7801\u793A\u4F8B","Insert/edit image":"\u63D2\u5165/\u7F16\u8F91\u56FE\u7247","Insert/edit link":"\u63D2\u5165/\u7F16\u8F91\u94FE\u63A5","Insert/edit media":"\u63D2\u5165/\u7F16\u8F91\u5A92\u4F53","Insert/edit video":"\u63D2\u5165/\u7F16\u8F91\u89C6\u9891","Inset":"\u5D4C\u5165","Invalid hex color code: {0}":"\u5341\u516D\u8FDB\u5236\u989C\u8272\u4EE3\u7801\u65E0\u6548\uFF1A {0}","Invalid input":"\u65E0\u6548\u8F93\u5165","Italic":"\u659C\u4F53","Justify":"\u4E24\u7AEF\u5BF9\u9F50","Keyboard Navigation":"\u952E\u76D8\u6307\u5F15","Language":"\u8BED\u8A00","Learn more...":"\u4E86\u89E3\u66F4\u591A...","Left":"\u5DE6","Left to right":"\u7531\u5DE6\u5230\u53F3","Light Blue":"\u6D45\u84DD\u8272","Light Gray":"\u6D45\u7070\u8272","Light Green":"\u6D45\u7EFF\u8272","Light Purple":"\u6D45\u7D2B\u8272","Light Red":"\u6D45\u7EA2\u8272","Light Yellow":"\u6D45\u9EC4\u8272","Line height":"Line height","Link list":"\u94FE\u63A5\u6E05\u5355","Link...":"\u94FE\u63A5...","List Properties":"\u5217\u8868\u5C5E\u6027","List properties...":"\u6807\u9898\u5B57\u4F53\u5C5E\u6027","Loading emojis...":"\u6B63\u5728\u52A0\u8F7DEmojis...","Loading...":"\u52A0\u8F7D\u4E2D...","Lower Alpha":"\u5C0F\u5199\u82F1\u6587\u5B57\u6BCD","Lower Greek":"\u5C0F\u5199\u5E0C\u814A\u5B57\u6BCD","Lower Roman":"\u5C0F\u5199\u7F57\u9A6C\u6570\u5B57","Match case":"\u5927\u5C0F\u5199\u5339\u914D","Mathematical":"\u6570\u5B66","Media poster (Image URL)":"\u5C01\u9762(\u56FE\u7247\u5730\u5740)","Media...":"\u591A\u5A92\u4F53...","Medium Blue":"\u4E2D\u84DD\u8272","Medium Gray":"\u4E2D\u7070\u8272","Medium Purple":"\u4E2D\u7D2B\u8272","Merge cells":"\u5408\u5E76\u5355\u5143\u683C","Middle":"\u5C45\u4E2D\u5BF9\u9F50","Midnight Blue":"\u6DF1\u84DD\u8272","More...":"\u66F4\u591A...","Name":"\u540D\u79F0","Navy Blue":"\u6D77\u519B\u84DD","New document":"\u65B0\u5EFA\u6587\u6863","New window":"\u65B0\u7A97\u53E3","Next":"\u4E0B\u4E00\u4E2A","No":"\u5426","No alignment":"\u672A\u5BF9\u9F50","No color":"\u65E0","Nonbreaking space":"\u4E0D\u95F4\u65AD\u7A7A\u683C","None":"\u65E0","Numbered list":"\u6709\u5E8F\u5217\u8868","OR":"\u6216","Objects":"\u7269\u4EF6","Ok":"\u786E\u5B9A","Open help dialog":"\u6253\u5F00\u5E2E\u52A9\u5BF9\u8BDD\u6846","Open link":"\u6253\u5F00\u94FE\u63A5","Open link in...":"\u94FE\u63A5\u6253\u5F00\u4F4D\u7F6E...","Open popup menu for split buttons":"\u6253\u5F00\u5F39\u51FA\u5F0F\u83DC\u5355\uFF0C\u7528\u4E8E\u62C6\u5206\u6309\u94AE","Orange":"\u6A59\u8272","Outset":"\u5916\u7F6E","Page break":"\u5206\u9875\u7B26","Paragraph":"\u6BB5\u843D","Paste":"\u7C98\u8D34","Paste as text":"\u7C98\u8D34\u4E3A\u6587\u672C","Paste column after":"\u7C98\u8D34\u540E\u9762\u7684\u5217","Paste column before":"\u7C98\u8D34\u6B64\u5217\u524D","Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.":"\u5F53\u524D\u4E3A\u7EAF\u6587\u672C\u7C98\u8D34\u6A21\u5F0F\uFF0C\u518D\u6B21\u70B9\u51FB\u53EF\u4EE5\u56DE\u5230\u666E\u901A\u7C98\u8D34\u6A21\u5F0F\u3002","Paste or type a link":"\u7C98\u8D34\u6216\u8F93\u5165\u94FE\u63A5","Paste row after":"\u7C98\u8D34\u884C\u5230\u4E0B\u65B9","Paste row before":"\u7C98\u8D34\u884C\u5230\u4E0A\u65B9","Paste your embed code below:":"\u5C06\u5185\u5D4C\u4EE3\u7801\u7C98\u8D34\u5728\u4E0B\u9762:","People":"\u4EBA\u7C7B","Plugins":"\u63D2\u4EF6","Plugins installed ({0}):":"\u5DF2\u5B89\u88C5\u63D2\u4EF6 ({0}):","Powered by {0}":"\u7531{0}\u9A71\u52A8","Pre":"\u524D\u8A00","Preferences":"\u9996\u9009\u9879","Preformatted":"\u9884\u5148\u683C\u5F0F\u5316\u7684","Premium plugins:":"\u4F18\u79C0\u63D2\u4EF6\uFF1A","Press the Up and Down arrow keys to resize the editor.":"\u6309\u4E0A\u4E0B\u7BAD\u5934\u952E\u4EE5\u8C03\u6574\u7F16\u8F91\u5668\u5927\u5C0F\u3002","Press the arrow keys to resize the editor.":"\u6309\u7BAD\u5934\u952E\u4EE5\u8C03\u6574\u7F16\u8F91\u5668\u5927\u5C0F\u3002","Press {0} for help":"\u6309 {0} \u83B7\u5F97\u5E2E\u52A9","Preview":"\u9884\u89C8","Previous":"\u4E0A\u4E00\u4E2A","Print":"\u6253\u5370","Print...":"\u6253\u5370...","Purple":"\u7D2B\u8272","Quotations":"\u5F15\u7528","R":"R","Range 0 to 255":"\u8303\u56F40\u81F3255","Red":"\u7EA2\u8272","Red component":"\u7EA2\u8272\u90E8\u5206","Redo":"\u91CD\u505A","Remove":"\u79FB\u9664","Remove color":"\u79FB\u9664\u989C\u8272","Remove link":"\u79FB\u9664\u94FE\u63A5","Replace":"\u66FF\u6362","Replace all":"\u66FF\u6362\u5168\u90E8","Replace with":"\u66FF\u6362\u4E3A","Resize":"\u8C03\u6574\u5927\u5C0F","Restore last draft":"\u6062\u590D\u4E0A\u6B21\u7684\u8349\u7A3F","Reveal or hide additional toolbar items":"\u663E\u793A\u6216\u9690\u85CF\u5176\u4ED6\u5DE5\u5177\u680F\u9879","Rich Text Area":"\u5BCC\u6587\u672C\u533A\u57DF","Rich Text Area. Press ALT-0 for help.":"\u7F16\u8F91\u533A\u3002\u6309Alt+0\u952E\u6253\u5F00\u5E2E\u52A9\u3002","Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help":"\u7F16\u8F91\u533A\u3002\u6309ALT-F9\u6253\u5F00\u83DC\u5355\uFF0C\u6309ALT-F10\u6253\u5F00\u5DE5\u5177\u680F\uFF0C\u6309ALT-0\u67E5\u770B\u5E2E\u52A9","Ridge":"\u6D77\u810A\u5EA7","Right":"\u53F3","Right to left":"\u7531\u53F3\u5230\u5DE6","Row":"\u884C","Row clipboard actions":"\u884C\u526A\u8D34\u677F\u64CD\u4F5C","Row group":"\u884C\u7EC4","Row header":"\u884C\u5934","Row properties":"\u884C\u5C5E\u6027","Row type":"\u884C\u7C7B\u578B","Rows":"\u884C\u6570","Save":"\u4FDD\u5B58","Save (if save plugin activated)":"\u4FDD\u5B58(\u5982\u679C\u4FDD\u5B58\u63D2\u4EF6\u5DF2\u6FC0\u6D3B)","Scope":"\u8303\u56F4","Search":"\u641C\u7D22","Select all":"\u5168\u9009","Select...":"\u9009\u62E9...","Selection":"\u9009\u62E9","Shortcut":"\u5FEB\u6377\u65B9\u5F0F","Show blocks":"\u663E\u793A\u533A\u5757\u8FB9\u6846","Show caption":"\u663E\u793A\u6807\u9898","Show invisible characters":"\u663E\u793A\u4E0D\u53EF\u89C1\u5B57\u7B26","Size":"\u5B57\u53F7","Solid":"\u5B9E\u7EBF","Source":"\u5730\u5740","Source code":"\u6E90\u4EE3\u7801","Special Character":"\u7279\u6B8A\u5B57\u7B26","Special character...":"\u7279\u6B8A\u5B57\u7B26...","Split cell":"\u62C6\u5206\u5355\u5143\u683C","Square":"\u5B9E\u5FC3\u65B9\u5757","Start list at number":"\u4EE5\u6570\u5B57\u5F00\u59CB\u5217\u8868","Strikethrough":"\u5220\u9664\u7EBF","Style":"\u6837\u5F0F","Subscript":"\u4E0B\u6807","Superscript":"\u4E0A\u6807","Switch to or from fullscreen mode":"\u5207\u6362\u5168\u5C4F\u6A21\u5F0F","Symbols":"\u7B26\u53F7","System Font":"\u7CFB\u7EDF\u5B57\u4F53","Table":"\u8868\u683C","Table caption":"\u8868\u683C\u6807\u9898","Table properties":"\u8868\u683C\u5C5E\u6027","Table styles":"\u8868\u683C\u6837\u5F0F","Template":"\u6A21\u677F","Templates":"\u6A21\u677F","Text":"\u6587\u5B57","Text color":"\u5B57\u4F53\u989C\u8272","Text color {0}":"\u5B57\u4F53\u989C\u8272 {0}","Text to display":"\u8981\u663E\u793A\u7684\u6587\u672C","The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?":"\u4F60\u6240\u586B\u5199\u7684URL\u5730\u5740\u4E3A\u90AE\u4EF6\u5730\u5740\uFF0C\u9700\u8981\u52A0\u4E0Amailto: \u524D\u7F00\u5417\uFF1F","The URL you entered seems to be an external link. Do you want to add the required http:// prefix?":"\u4F60\u6240\u586B\u5199\u7684URL\u5730\u5740\u5C5E\u4E8E\u5916\u90E8\u94FE\u63A5\uFF0C\u9700\u8981\u52A0\u4E0Ahttp:// \u524D\u7F00\u5417\uFF1F","The URL you entered seems to be an external link. Do you want to add the required https:// prefix?":"\u60A8\u8F93\u5165\u7684 URL \u4F3C\u4E4E\u662F\u4E00\u4E2A\u5916\u90E8\u94FE\u63A5\u3002\u60A8\u60F3\u6DFB\u52A0\u6240\u9700\u7684 https:// \u524D\u7F00\u5417\uFF1F","Title":"\u6807\u9898","To open the popup, press Shift+Enter":"\u6309Shitf+Enter\u952E\u6253\u5F00\u5BF9\u8BDD\u6846","Toggle accordion":"\u5207\u6362\u6298\u53E0\u9762\u677F","Tools":"\u5DE5\u5177","Top":"\u4E0A\u65B9\u5BF9\u9F50","Travel and Places":"\u65C5\u6E38\u548C\u5730\u70B9","Turquoise":"\u9752\u7EFF\u8272","Underline":"\u4E0B\u5212\u7EBF","Undo":"\u64A4\u9500","Upload":"\u4E0A\u4F20","Uploading image":"\u4E0A\u4F20\u56FE\u7247","Upper Alpha":"\u5927\u5199\u82F1\u6587\u5B57\u6BCD","Upper Roman":"\u5927\u5199\u7F57\u9A6C\u6570\u5B57","Url":"\u5730\u5740","User Defined":"\u81EA\u5B9A\u4E49","Valid":"\u6709\u6548","Version":"\u7248\u672C","Vertical align":"\u5782\u76F4\u5BF9\u9F50","Vertical space":"\u5782\u76F4\u95F4\u8DDD","View":"\u67E5\u770B","Visual aids":"\u7F51\u683C\u7EBF","Warn":"\u8B66\u544A","White":"\u767D\u8272","Width":"\u5BBD\u5EA6","Word count":"\u5B57\u6570","Words":"\u5355\u8BCD","Words: {0}":"\u5B57\u6570\uFF1A{0}","Yellow":"\u9EC4\u8272","Yes":"\u662F","You are using {0}":"\u4F60\u6B63\u5728\u4F7F\u7528 {0}","You have unsaved changes are you sure you want to navigate away?":"\u4F60\u8FD8\u6709\u6587\u6863\u5C1A\u672A\u4FDD\u5B58\uFF0C\u786E\u5B9A\u8981\u79BB\u5F00\uFF1F","Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.":"\u4F60\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u6253\u5F00\u526A\u8D34\u677F\uFF0C\u8BF7\u4F7F\u7528Ctrl+X/C/V\u7B49\u5FEB\u6377\u952E\u3002","alignment":"\u5BF9\u9F50","austral sign":"\u6FB3\u5143\u7B26\u53F7","cedi sign":"\u585E\u5730\u7B26\u53F7","colon sign":"\u5192\u53F7","cruzeiro sign":"\u514B\u9C81\u8D5B\u7F57\u5E01\u7B26\u53F7","currency sign":"\u8D27\u5E01\u7B26\u53F7","dollar sign":"\u7F8E\u5143\u7B26\u53F7","dong sign":"\u8D8A\u5357\u76FE\u7B26\u53F7","drachma sign":"\u5FB7\u62C9\u514B\u9A6C\u7B26\u53F7","euro-currency sign":"\u6B27\u5143\u7B26\u53F7","example":"\u793A\u4F8B","formatting":"\u683C\u5F0F\u5316","french franc sign":"\u6CD5\u90CE\u7B26\u53F7","german penny symbol":"\u5FB7\u56FD\u4FBF\u58EB\u7B26\u53F7","guarani sign":"\u74DC\u62C9\u5C3C\u7B26\u53F7","history":"\u5386\u53F2","hryvnia sign":"\u683C\u91CC\u592B\u5C3C\u4E9A\u7B26\u53F7","indentation":"\u7F29\u8FDB","indian rupee sign":"\u5370\u5EA6\u5362\u6BD4","kip sign":"\u8001\u631D\u57FA\u666E\u7B26\u53F7","lira sign":"\u91CC\u62C9\u7B26\u53F7","livre tournois sign":"\u91CC\u5F17\u5F17\u5C14\u7B26\u53F7","manat sign":"\u9A6C\u7EB3\u7279\u7B26\u53F7","mill sign":"\u5BC6\u5C14\u7B26\u53F7","naira sign":"\u5948\u62C9\u7B26\u53F7","new sheqel sign":"\u65B0\u8C22\u514B\u5C14\u7B26\u53F7","nordic mark sign":"\u5317\u6B27\u9A6C\u514B","peseta sign":"\u6BD4\u585E\u5854\u7B26\u53F7","peso sign":"\u6BD4\u7D22\u7B26\u53F7","ruble sign":"\u5362\u5E03\u7B26\u53F7","rupee sign":"\u5362\u6BD4\u7B26\u53F7","spesmilo sign":"spesmilo\u7B26\u53F7","styles":"\u6837\u5F0F","tenge sign":"\u575A\u6208\u7B26\u53F7","tugrik sign":"\u56FE\u683C\u91CC\u514B\u7B26\u53F7","turkish lira sign":"\u571F\u8033\u5176\u91CC\u62C9","won sign":"\u97E9\u5143\u7B26\u53F7","yen character":"\u65E5\u5143\u5B57\u6837","yen/yuan character variant one":"\u5143\u5B57\u6837\uFF08\u5927\u5199\uFF09","yuan character":"\u4EBA\u6C11\u5E01\u5143\u5B57\u6837","yuan character, in hong kong and taiwan":"\u5143\u5B57\u6837\uFF08\u6E2F\u53F0\u5730\u533A\uFF09","{0} characters":"{0} \u4E2A\u5B57\u7B26","{0} columns, {1} rows":"{0} \u5217\uFF0C{1} \u884C","{0} words":"{0} \u5B57"}); \ No newline at end of file diff --git a/apps/web-antd/public/tinymce/tinymce.d.ts b/apps/web-antd/public/tinymce/tinymce.d.ts index 20f888b56335204c46f5fba32e4ec79b2c699923..033274a319a981229571b5024d09d183223dcd1a 100644 --- a/apps/web-antd/public/tinymce/tinymce.d.ts +++ b/apps/web-antd/public/tinymce/tinymce.d.ts @@ -1,3 +1,7 @@ +/* eslint-disable @typescript-eslint/no-invalid-void-type */ +/* eslint-disable @typescript-eslint/no-empty-object-type */ +/* eslint-disable @typescript-eslint/no-unsafe-function-type */ +/* eslint-disable no-use-before-define */ interface StringPathBookmark { start: string; end?: string; @@ -22,16 +26,16 @@ interface PathBookmark { isFakeCaret?: boolean; forward?: boolean; } -type Bookmark = StringPathBookmark | RangeBookmark | IdBookmark | IndexBookmark | PathBookmark; +type Bookmark = IdBookmark | IndexBookmark | PathBookmark | RangeBookmark | StringPathBookmark; type NormalizedEvent = E & { - readonly type: string; - readonly target: T; readonly isDefaultPrevented: () => boolean; - readonly preventDefault: () => void; - readonly isPropagationStopped: () => boolean; - readonly stopPropagation: () => void; readonly isImmediatePropagationStopped: () => boolean; + readonly isPropagationStopped: () => boolean; + readonly preventDefault: () => void; readonly stopImmediatePropagation: () => void; + readonly stopPropagation: () => void; + readonly target: T; + readonly type: string; }; type MappedEvent = K extends keyof T ? T[K] : any; interface NativeEventMap { @@ -79,7 +83,7 @@ interface NativeEventMap { type EditorEvent = NormalizedEvent; interface EventDispatcherSettings { scope?: any; - toggleEvent?: (name: string, state: boolean) => void | boolean; + toggleEvent?: (name: string, state: boolean) => boolean | void; beforeFire?: (args: EditorEvent) => void; } interface EventDispatcherConstructor { @@ -88,20 +92,20 @@ interface EventDispatcherConstructor { isNative: (name: string) => boolean; } declare class EventDispatcher { - static isNative(name: string): boolean; - private readonly settings; + private bindings; private readonly scope; + private readonly settings; private readonly toggleEvent; - private bindings; constructor(settings?: EventDispatcherSettings); - fire>(name: K, args?: U): EditorEvent; + static isNative(name: string): boolean; dispatch>(name: K, args?: U): EditorEvent; - on(name: K, callback: false | ((event: EditorEvent>) => void | boolean), prepend?: boolean, extra?: {}): this; + fire>(name: K, args?: U): EditorEvent; + has(name: string): boolean; off(name?: K, callback?: (event: EditorEvent>) => void): this; + on(name: K, callback: ((event: EditorEvent>) => boolean | void) | false, prepend?: boolean, extra?: {}): this; once(name: K, callback: (event: EditorEvent>) => void, prepend?: boolean): this; - has(name: string): boolean; } -type UndoLevelType = 'fragmented' | 'complete'; +type UndoLevelType = 'complete' | 'fragmented'; interface BaseUndoLevel { type: UndoLevelType; bookmark: Bookmark | null; @@ -124,16 +128,16 @@ type UndoLevel = NewUndoLevel & { interface UndoManager { data: UndoLevel[]; typing: boolean; - add: (level?: Partial, event?: EditorEvent) => UndoLevel | null; + add: (level?: Partial, event?: EditorEvent) => null | UndoLevel; dispatchChange: () => void; beforeChange: () => void; - undo: () => UndoLevel | undefined; - redo: () => UndoLevel | undefined; + undo: () => undefined | UndoLevel; + redo: () => undefined | UndoLevel; clear: () => void; reset: () => void; hasUndo: () => boolean; hasRedo: () => boolean; - transact: (callback: () => void) => UndoLevel | null; + transact: (callback: () => void) => null | UndoLevel; ignore: (callback: () => void) => void; extra: (callback1: () => void, callback2: () => void) => void; } @@ -152,15 +156,15 @@ interface ElementSettings { wrap_block_elements?: string; } interface SchemaSettings extends ElementSettings { - custom_elements?: string | Record; + custom_elements?: Record | string; extended_valid_elements?: string; invalid_elements?: string; - invalid_styles?: string | Record; + invalid_styles?: Record | string; schema?: SchemaType; valid_children?: string; - valid_classes?: string | Record; + valid_classes?: Record | string; valid_elements?: string; - valid_styles?: string | Record; + valid_styles?: Record | string; verify_html?: boolean; padd_empty_block_inline_children?: boolean; } @@ -233,7 +237,7 @@ interface Schema { getCustomElements: () => SchemaMap; addValidElements: (validElements: string) => void; setValidElements: (validElements: string) => void; - addCustomElements: (customElements: string | Record) => void; + addCustomElements: (customElements: Record | string) => void; addValidChildren: (validChildren: any) => void; } type Attributes$1 = Array<{ @@ -248,36 +252,36 @@ interface AstNodeConstructor { create(name: string, attrs?: Record): AstNode; } declare class AstNode { - static create(name: string, attrs?: Record): AstNode; - name: string; - type: number; attributes?: Attributes$1; - value?: string; - parent?: AstNode | null; firstChild?: AstNode | null; lastChild?: AstNode | null; + name: string; next?: AstNode | null; + parent?: AstNode | null; prev?: AstNode | null; raw?: boolean; + type: number; + value?: string; constructor(name: string, type: number); - replace(node: AstNode): AstNode; - attr(name: string, value: string | null | undefined): AstNode | undefined; - attr(name: Record | undefined): AstNode | undefined; - attr(name: string): string | undefined; - clone(): AstNode; - wrap(wrapper: AstNode): AstNode; - unwrap(): void; - remove(): AstNode; + static create(name: string, attrs?: Record): AstNode; append(node: AstNode): AstNode; - insert(node: AstNode, refNode: AstNode, before?: boolean): AstNode; - getAll(name: string): AstNode[]; + attr(name: string, value: null | string | undefined): AstNode | undefined; + attr(name: Record | undefined): AstNode | undefined; + attr(name: string): string | undefined; children(): AstNode[]; + clone(): AstNode; empty(): AstNode; + getAll(name: string): AstNode[]; + insert(node: AstNode, refNode: AstNode, before?: boolean): AstNode; isEmpty(elements: SchemaMap, whitespace?: SchemaMap, predicate?: (node: AstNode) => boolean): boolean; + remove(): AstNode; + replace(node: AstNode): AstNode; + unwrap(): void; walk(prev?: boolean): AstNode | null | undefined; + wrap(wrapper: AstNode): AstNode; } -type Content = string | AstNode; -type ContentFormat = 'raw' | 'text' | 'html' | 'tree'; +type Content = AstNode | string; +type ContentFormat = 'html' | 'raw' | 'text' | 'tree'; interface GetContentArgs { format: ContentFormat; get: boolean; @@ -343,13 +347,13 @@ interface BlobInfoImagePair { } declare class NodeChange { private readonly editor; + private isSameElementPath; private lastPath; constructor(editor: Editor); nodeChanged(args?: Record): void; - private isSameElementPath; } interface SelectionOverrides { - showCaret: (direction: number, node: HTMLElement, before: boolean, scrollIntoView?: boolean) => Range | null; + showCaret: (direction: number, node: HTMLElement, before: boolean, scrollIntoView?: boolean) => null | Range; showBlockCaretContainer: (blockCaretContainer: HTMLElement) => void; hideFakeCaret: () => void; destroy: () => void; @@ -364,8 +368,8 @@ type Decorator = (uid: string, data: DecoratorData) => { classes?: string[]; }; type AnnotationListener = (state: boolean, name: string, data?: { - uid: string; nodes: any[]; + uid: string; }) => void; type AnnotationListenerApi = AnnotationListener; interface AnnotatorSettings { @@ -395,7 +399,7 @@ interface GeomRect { interface Rect { inflate: (rect: GeomRect, w: number, h: number) => GeomRect; relativePosition: (rect: GeomRect, targetRect: GeomRect, rel: string) => GeomRect; - findBestRelativePosition: (rect: GeomRect, targetRect: GeomRect, constrainRect: GeomRect, rels: string[]) => string | null; + findBestRelativePosition: (rect: GeomRect, targetRect: GeomRect, constrainRect: GeomRect, rels: string[]) => null | string; intersect: (rect: GeomRect, cropRect: GeomRect) => GeomRect | null; clamp: (rect: GeomRect, clampRect: GeomRect, fixedSize?: boolean) => GeomRect; create: (x: number, y: number, w: number, h: number) => GeomRect; @@ -407,7 +411,7 @@ interface NotificationManagerImpl { getArgs: (notification: T) => NotificationSpec; } interface NotificationSpec { - type?: 'info' | 'warning' | 'error' | 'success'; + type?: 'error' | 'info' | 'success' | 'warning'; text: string; icon?: string; progressBar?: boolean; @@ -463,7 +467,7 @@ interface InlineCmdPattern extends InlineBasePattern { readonly cmd: string; readonly value?: any; } -type InlinePattern = InlineFormatPattern | InlineCmdPattern; +type InlinePattern = InlineCmdPattern | InlineFormatPattern; interface BlockBasePattern { readonly start: string; readonly trigger: BlockPatternTrigger; @@ -477,8 +481,8 @@ interface BlockCmdPattern extends BlockBasePattern { readonly cmd: string; readonly value?: any; } -type BlockPattern = BlockFormatPattern | BlockCmdPattern; -type Pattern = InlinePattern | BlockPattern; +type BlockPattern = BlockCmdPattern | BlockFormatPattern; +type Pattern = BlockPattern | InlinePattern; interface DynamicPatternContext { readonly text: string; readonly block: Element; @@ -487,7 +491,7 @@ type DynamicPatternsLookup = (ctx: DynamicPatternContext) => Pattern[]; type RawDynamicPatternsLookup = (ctx: DynamicPatternContext) => RawPattern[]; interface AlertBannerSpec { type: 'alertbanner'; - level: 'info' | 'warn' | 'error' | 'success'; + level: 'error' | 'info' | 'success' | 'warn'; text: string; icon: string; url?: string; @@ -552,7 +556,7 @@ interface CustomEditorNewSpec extends FormComponentSpec { onFocus?: (e: HTMLElement) => void; settings?: any; } -type CustomEditorSpec = CustomEditorOldSpec | CustomEditorNewSpec; +type CustomEditorSpec = CustomEditorNewSpec | CustomEditorOldSpec; interface DropZoneSpec extends FormComponentWithLabelSpec { type: 'dropzone'; context?: string; @@ -566,7 +570,7 @@ interface HtmlPanelSpec { type: 'htmlpanel'; html: string; onInit?: (el: HTMLElement) => void; - presets?: 'presentation' | 'document'; + presets?: 'document' | 'presentation'; stretched?: boolean; } interface IframeSpec extends FormComponentWithLabelSpec { @@ -588,7 +592,7 @@ interface InputSpec extends FormComponentWithLabelSpec { enabled?: boolean; context?: string; } -type Alignment = 'start' | 'center' | 'end'; +type Alignment = 'center' | 'end' | 'start'; interface LabelSpec { type: 'label'; label: string; @@ -696,9 +700,9 @@ interface CardTextSpec { classes?: string[]; } type CardItemSpec = CardContainerSpec | CardImageSpec | CardTextSpec; -type CardContainerDirection = 'vertical' | 'horizontal'; +type CardContainerDirection = 'horizontal' | 'vertical'; type CardContainerAlign = 'left' | 'right'; -type CardContainerValign = 'top' | 'middle' | 'bottom'; +type CardContainerValign = 'bottom' | 'middle' | 'top'; interface CardContainerSpec { type: 'cardcontainer'; items: CardItemSpec[]; @@ -720,7 +724,7 @@ interface CommonMenuItemInstanceApi { } interface CardMenuItemInstanceApi extends CommonMenuItemInstanceApi { } -interface CardMenuItemSpec extends Omit { +interface CardMenuItemSpec extends Omit { type: 'cardmenuitem'; label?: string; items: CardItemSpec[]; @@ -746,11 +750,11 @@ interface ContextSubMenu extends CommonMenuItemSpec { type: 'submenu'; text: string; icon?: string; - getSubmenuItems: () => string | Array; + getSubmenuItems: () => Array | string; } -type ContextMenuContents = string | ContextMenuItem | SeparatorMenuItemSpec | ContextSubMenu; +type ContextMenuContents = ContextMenuItem | ContextSubMenu | SeparatorMenuItemSpec | string; interface ContextMenuApi { - update: (element: Element) => string | Array; + update: (element: Element) => Array | string; } interface ResetImageItemSpec extends CommonMenuItemSpec { icon: string; @@ -767,8 +771,8 @@ interface ImageMenuItemSpec extends CommonMenuItemSpec { } interface FancyActionArgsMap { inserttable: { - numRows: number; numColumns: number; + numRows: number; }; colorswatch: { value: string; @@ -804,7 +808,7 @@ interface ImageSelectMenuItemSpec extends BaseFancyMenuItemSpec<'imageselect'> { items: (ImageMenuItemSpec | ResetImageItemSpec)[]; }; } -type FancyMenuItemSpec = InsertTableMenuItemSpec | ColorSwatchMenuItemSpec | ImageSelectMenuItemSpec; +type FancyMenuItemSpec = ColorSwatchMenuItemSpec | ImageSelectMenuItemSpec | InsertTableMenuItemSpec; interface MenuItemSpec extends CommonMenuItemSpec { type?: 'menuitem'; icon?: string; @@ -828,11 +832,11 @@ interface ToggleMenuItemInstanceApi extends CommonMenuItemInstanceApi { isActive: () => boolean; setActive: (state: boolean) => void; } -type NestedMenuItemContents = string | MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec | SeparatorMenuItemSpec | FancyMenuItemSpec; +type NestedMenuItemContents = FancyMenuItemSpec | MenuItemSpec | NestedMenuItemSpec | SeparatorMenuItemSpec | string | ToggleMenuItemSpec; interface NestedMenuItemSpec extends CommonMenuItemSpec { type?: 'nestedmenuitem'; icon?: string; - getSubmenuItems: () => string | Array; + getSubmenuItems: () => Array | string; onSetup?: (api: NestedMenuItemInstanceApi) => (api: NestedMenuItemInstanceApi) => void; } interface NestedMenuItemInstanceApi extends CommonMenuItemInstanceApi { @@ -840,12 +844,12 @@ interface NestedMenuItemInstanceApi extends CommonMenuItemInstanceApi { setIconFill: (id: string, value: string) => void; } type MenuButtonItemTypes = NestedMenuItemContents; -type SuccessCallback$1 = (menu: string | MenuButtonItemTypes[]) => void; +type SuccessCallback$1 = (menu: MenuButtonItemTypes[] | string) => void; interface MenuButtonFetchContext { pattern: string; } interface BaseMenuButtonSpec { - buttonType?: 'default' | 'bordered'; + buttonType?: 'bordered' | 'default'; text?: string; tooltip?: string; icon?: string; @@ -871,11 +875,11 @@ interface ToolbarMenuButtonSpec extends BaseMenuButtonSpec { } interface ToolbarMenuButtonInstanceApi extends BaseMenuButtonInstanceApi { } -type ToolbarSplitButtonItemTypes = ChoiceMenuItemSpec | SeparatorMenuItemSpec | ImageMenuItemSpec; +type ToolbarSplitButtonItemTypes = ChoiceMenuItemSpec | ImageMenuItemSpec | SeparatorMenuItemSpec; type SuccessCallback = (menu: ToolbarSplitButtonItemTypes[]) => void; type SelectPredicate = (value: string) => boolean; -type PresetTypes = 'color' | 'normal' | 'listpreview' | 'imageselector'; -type ColumnTypes$1 = number | 'auto'; +type PresetTypes = 'color' | 'imageselector' | 'listpreview' | 'normal'; +type ColumnTypes$1 = 'auto' | number; interface ToolbarSplitButtonSpec { type?: 'splitbutton'; tooltip?: string; @@ -943,7 +947,7 @@ interface LeafSpec extends BaseTreeItemSpec { type TreeItemSpec = DirectorySpec | LeafSpec; interface UrlInputSpec extends FormComponentWithLabelSpec { type: 'urlinput'; - filetype?: 'image' | 'media' | 'file'; + filetype?: 'file' | 'image' | 'media'; enabled?: boolean; picker_text?: string; context?: string; @@ -954,7 +958,7 @@ interface UrlInputData { text?: string; }; } -type BodyComponentSpec = BarSpec | ButtonSpec | CheckboxSpec | TextAreaSpec | InputSpec | ListBoxSpec | SelectBoxSpec | SizeInputSpec | SliderSpec | IframeSpec | HtmlPanelSpec | UrlInputSpec | DropZoneSpec | ColorInputSpec | GridSpec | ColorPickerSpec | ImagePreviewSpec | AlertBannerSpec | CollectionSpec | LabelSpec | TableSpec | TreeSpec | PanelSpec | CustomEditorSpec; +type BodyComponentSpec = AlertBannerSpec | BarSpec | ButtonSpec | CheckboxSpec | CollectionSpec | ColorInputSpec | ColorPickerSpec | CustomEditorSpec | DropZoneSpec | GridSpec | HtmlPanelSpec | IframeSpec | ImagePreviewSpec | InputSpec | LabelSpec | ListBoxSpec | PanelSpec | SelectBoxSpec | SizeInputSpec | SliderSpec | TableSpec | TextAreaSpec | TreeSpec | UrlInputSpec; interface BarSpec { type: 'bar'; items: BodyComponentSpec[]; @@ -966,7 +970,7 @@ interface DialogToggleMenuItemSpec extends CommonMenuItemSpec { type DialogFooterMenuButtonItemSpec = DialogToggleMenuItemSpec; interface BaseDialogFooterButtonSpec { name?: string; - align?: 'start' | 'end'; + align?: 'end' | 'start'; primary?: boolean; enabled?: boolean; icon?: string; @@ -974,7 +978,7 @@ interface BaseDialogFooterButtonSpec { context?: string; } interface DialogFooterNormalButtonSpec extends BaseDialogFooterButtonSpec { - type: 'submit' | 'cancel' | 'custom'; + type: 'cancel' | 'custom' | 'submit'; text: string; } interface DialogFooterMenuButtonSpec extends BaseDialogFooterButtonSpec { @@ -991,7 +995,7 @@ interface DialogFooterToggleButtonSpec extends BaseDialogFooterButtonSpec { text?: string; active?: boolean; } -type DialogFooterButtonSpec = DialogFooterNormalButtonSpec | DialogFooterMenuButtonSpec | DialogFooterToggleButtonSpec; +type DialogFooterButtonSpec = DialogFooterMenuButtonSpec | DialogFooterNormalButtonSpec | DialogFooterToggleButtonSpec; interface TabSpec { name?: string; title: string; @@ -1032,11 +1036,11 @@ type DialogSubmitHandler = (api: DialogInstanceApi) => type DialogCloseHandler = () => void; type DialogCancelHandler = (api: DialogInstanceApi) => void; type DialogTabChangeHandler = (api: DialogInstanceApi, details: DialogTabChangeDetails) => void; -type DialogSize = 'normal' | 'medium' | 'large'; +type DialogSize = 'large' | 'medium' | 'normal'; interface DialogSpec { title: string; size?: DialogSize; - body: TabPanelSpec | PanelSpec; + body: PanelSpec | TabPanelSpec; buttons?: DialogFooterButtonSpec[]; initialData?: Partial; onAction?: DialogActionHandler; @@ -1078,7 +1082,7 @@ interface UrlDialogSpec { onCancel?: UrlDialogCancelHandler; onMessage?: UrlDialogMessageHandler; } -type ColumnTypes = number | 'auto'; +type ColumnTypes = 'auto' | number; type SeparatorItemSpec = SeparatorMenuItemSpec; interface AutocompleterItemSpec { type?: 'autocompleteitem'; @@ -1087,7 +1091,7 @@ interface AutocompleterItemSpec { icon?: string; meta?: Record; } -type AutocompleterContents = SeparatorItemSpec | AutocompleterItemSpec | CardMenuItemSpec; +type AutocompleterContents = AutocompleterItemSpec | CardMenuItemSpec | SeparatorItemSpec; interface AutocompleterSpec { type?: 'autocompleter'; trigger: string; @@ -1103,8 +1107,8 @@ interface AutocompleterInstanceApi { hide: () => void; reload: (fetchOptions: Record) => void; } -type ContextPosition = 'node' | 'selection' | 'line'; -type ContextScope = 'node' | 'editor'; +type ContextPosition = 'line' | 'node' | 'selection'; +type ContextScope = 'editor' | 'node'; interface ContextBarSpec { predicate?: (elem: Element) => boolean; position?: ContextPosition; @@ -1123,13 +1127,13 @@ interface ContextFormToggleButtonInstanceApi extends BaseToolbarToggleButtonInst interface ContextFormButtonSpec extends BaseToolbarButtonSpec { type?: 'contextformbutton'; primary?: boolean; - align?: 'start' | 'end'; + align?: 'end' | 'start'; onAction: (formApi: ContextFormInstanceApi, api: ContextFormButtonInstanceApi) => void; } interface ContextFormToggleButtonSpec extends BaseToolbarToggleButtonSpec { type?: 'contextformtogglebutton'; primary?: boolean; - align?: 'start' | 'end'; + align?: 'end' | 'start'; onAction: (formApi: ContextFormInstanceApi, buttonApi: ContextFormToggleButtonInstanceApi) => void; } interface ContextFormInstanceApi { @@ -1148,7 +1152,7 @@ interface BaseContextFormSpec extends ContextBarSpec { initValue?: () => T; label?: string; launch?: ContextFormLaunchButtonApi | ContextFormLaunchToggleButtonSpec; - commands: Array | ContextFormButtonSpec>; + commands: Array | ContextFormToggleButtonSpec>; onInput?: (api: ContextFormInstanceApi) => void; onSetup?: (api: ContextFormInstanceApi) => (api: ContextFormInstanceApi) => void; } @@ -1164,7 +1168,7 @@ interface ContextSliderFormSpec extends BaseContextFormSpec { interface ContextSizeInputFormSpec extends BaseContextFormSpec { type: 'contextsizeinputform'; } -type ContextFormSpec = ContextInputFormSpec | ContextSliderFormSpec | ContextSizeInputFormSpec; +type ContextFormSpec = ContextInputFormSpec | ContextSizeInputFormSpec | ContextSliderFormSpec; interface ToolbarGroupSpec { name?: string; label?: string; @@ -1228,7 +1232,7 @@ type PublicDialog_d_UrlDialogInstanceApi = UrlDialogInstanceApi; type PublicDialog_d_UrlDialogActionDetails = UrlDialogActionDetails; type PublicDialog_d_UrlDialogMessage = UrlDialogMessage; declare namespace PublicDialog_d { - export { PublicDialog_d_AlertBannerSpec as AlertBannerSpec, PublicDialog_d_BarSpec as BarSpec, PublicDialog_d_BodyComponentSpec as BodyComponentSpec, PublicDialog_d_ButtonSpec as ButtonSpec, PublicDialog_d_CheckboxSpec as CheckboxSpec, PublicDialog_d_CollectionItem as CollectionItem, PublicDialog_d_CollectionSpec as CollectionSpec, PublicDialog_d_ColorInputSpec as ColorInputSpec, PublicDialog_d_ColorPickerSpec as ColorPickerSpec, PublicDialog_d_CustomEditorSpec as CustomEditorSpec, PublicDialog_d_CustomEditorInit as CustomEditorInit, PublicDialog_d_CustomEditorInitFn as CustomEditorInitFn, PublicDialog_d_DialogData as DialogData, PublicDialog_d_DialogSize as DialogSize, PublicDialog_d_DialogSpec as DialogSpec, PublicDialog_d_DialogInstanceApi as DialogInstanceApi, PublicDialog_d_DialogFooterButtonSpec as DialogFooterButtonSpec, PublicDialog_d_DialogActionDetails as DialogActionDetails, PublicDialog_d_DialogChangeDetails as DialogChangeDetails, PublicDialog_d_DialogTabChangeDetails as DialogTabChangeDetails, PublicDialog_d_DropZoneSpec as DropZoneSpec, PublicDialog_d_GridSpec as GridSpec, PublicDialog_d_HtmlPanelSpec as HtmlPanelSpec, PublicDialog_d_IframeSpec as IframeSpec, PublicDialog_d_ImagePreviewSpec as ImagePreviewSpec, PublicDialog_d_InputSpec as InputSpec, PublicDialog_d_LabelSpec as LabelSpec, PublicDialog_d_ListBoxSpec as ListBoxSpec, PublicDialog_d_ListBoxItemSpec as ListBoxItemSpec, PublicDialog_d_ListBoxNestedItemSpec as ListBoxNestedItemSpec, PublicDialog_d_ListBoxSingleItemSpec as ListBoxSingleItemSpec, PublicDialog_d_PanelSpec as PanelSpec, PublicDialog_d_SelectBoxSpec as SelectBoxSpec, PublicDialog_d_SelectBoxItemSpec as SelectBoxItemSpec, PublicDialog_d_SizeInputSpec as SizeInputSpec, PublicDialog_d_SliderSpec as SliderSpec, PublicDialog_d_TableSpec as TableSpec, PublicDialog_d_TabSpec as TabSpec, PublicDialog_d_TabPanelSpec as TabPanelSpec, PublicDialog_d_TextAreaSpec as TextAreaSpec, PublicDialog_d_TreeSpec as TreeSpec, PublicDialog_d_TreeItemSpec as TreeItemSpec, DirectorySpec as TreeDirectorySpec, LeafSpec as TreeLeafSpec, PublicDialog_d_UrlInputData as UrlInputData, PublicDialog_d_UrlInputSpec as UrlInputSpec, PublicDialog_d_UrlDialogSpec as UrlDialogSpec, PublicDialog_d_UrlDialogFooterButtonSpec as UrlDialogFooterButtonSpec, PublicDialog_d_UrlDialogInstanceApi as UrlDialogInstanceApi, PublicDialog_d_UrlDialogActionDetails as UrlDialogActionDetails, PublicDialog_d_UrlDialogMessage as UrlDialogMessage, }; + export { PublicDialog_d_AlertBannerSpec as AlertBannerSpec, PublicDialog_d_BarSpec as BarSpec, PublicDialog_d_BodyComponentSpec as BodyComponentSpec, PublicDialog_d_ButtonSpec as ButtonSpec, PublicDialog_d_CheckboxSpec as CheckboxSpec, PublicDialog_d_CollectionItem as CollectionItem, PublicDialog_d_CollectionSpec as CollectionSpec, PublicDialog_d_ColorInputSpec as ColorInputSpec, PublicDialog_d_ColorPickerSpec as ColorPickerSpec, PublicDialog_d_CustomEditorInit as CustomEditorInit, PublicDialog_d_CustomEditorInitFn as CustomEditorInitFn, PublicDialog_d_CustomEditorSpec as CustomEditorSpec, PublicDialog_d_DialogActionDetails as DialogActionDetails, PublicDialog_d_DialogChangeDetails as DialogChangeDetails, PublicDialog_d_DialogData as DialogData, PublicDialog_d_DialogFooterButtonSpec as DialogFooterButtonSpec, PublicDialog_d_DialogInstanceApi as DialogInstanceApi, PublicDialog_d_DialogSize as DialogSize, PublicDialog_d_DialogSpec as DialogSpec, PublicDialog_d_DialogTabChangeDetails as DialogTabChangeDetails, PublicDialog_d_DropZoneSpec as DropZoneSpec, PublicDialog_d_GridSpec as GridSpec, PublicDialog_d_HtmlPanelSpec as HtmlPanelSpec, PublicDialog_d_IframeSpec as IframeSpec, PublicDialog_d_ImagePreviewSpec as ImagePreviewSpec, PublicDialog_d_InputSpec as InputSpec, PublicDialog_d_LabelSpec as LabelSpec, PublicDialog_d_ListBoxItemSpec as ListBoxItemSpec, PublicDialog_d_ListBoxNestedItemSpec as ListBoxNestedItemSpec, PublicDialog_d_ListBoxSingleItemSpec as ListBoxSingleItemSpec, PublicDialog_d_ListBoxSpec as ListBoxSpec, PublicDialog_d_PanelSpec as PanelSpec, PublicDialog_d_SelectBoxItemSpec as SelectBoxItemSpec, PublicDialog_d_SelectBoxSpec as SelectBoxSpec, PublicDialog_d_SizeInputSpec as SizeInputSpec, PublicDialog_d_SliderSpec as SliderSpec, PublicDialog_d_TableSpec as TableSpec, PublicDialog_d_TabPanelSpec as TabPanelSpec, PublicDialog_d_TabSpec as TabSpec, PublicDialog_d_TextAreaSpec as TextAreaSpec, DirectorySpec as TreeDirectorySpec, PublicDialog_d_TreeItemSpec as TreeItemSpec, LeafSpec as TreeLeafSpec, PublicDialog_d_TreeSpec as TreeSpec, PublicDialog_d_UrlDialogActionDetails as UrlDialogActionDetails, PublicDialog_d_UrlDialogFooterButtonSpec as UrlDialogFooterButtonSpec, PublicDialog_d_UrlDialogInstanceApi as UrlDialogInstanceApi, PublicDialog_d_UrlDialogMessage as UrlDialogMessage, PublicDialog_d_UrlDialogSpec as UrlDialogSpec, PublicDialog_d_UrlInputData as UrlInputData, PublicDialog_d_UrlInputSpec as UrlInputSpec, }; } type PublicInlineContent_d_AutocompleterSpec = AutocompleterSpec; type PublicInlineContent_d_AutocompleterItemSpec = AutocompleterItemSpec; @@ -1245,7 +1249,7 @@ type PublicInlineContent_d_ContextFormToggleButtonInstanceApi = ContextFormToggl type PublicInlineContent_d_ContextToolbarSpec = ContextToolbarSpec; type PublicInlineContent_d_SeparatorItemSpec = SeparatorItemSpec; declare namespace PublicInlineContent_d { - export { PublicInlineContent_d_AutocompleterSpec as AutocompleterSpec, PublicInlineContent_d_AutocompleterItemSpec as AutocompleterItemSpec, PublicInlineContent_d_AutocompleterContents as AutocompleterContents, PublicInlineContent_d_AutocompleterInstanceApi as AutocompleterInstanceApi, PublicInlineContent_d_ContextPosition as ContextPosition, PublicInlineContent_d_ContextScope as ContextScope, PublicInlineContent_d_ContextFormSpec as ContextFormSpec, PublicInlineContent_d_ContextFormInstanceApi as ContextFormInstanceApi, PublicInlineContent_d_ContextFormButtonSpec as ContextFormButtonSpec, PublicInlineContent_d_ContextFormButtonInstanceApi as ContextFormButtonInstanceApi, PublicInlineContent_d_ContextFormToggleButtonSpec as ContextFormToggleButtonSpec, PublicInlineContent_d_ContextFormToggleButtonInstanceApi as ContextFormToggleButtonInstanceApi, PublicInlineContent_d_ContextToolbarSpec as ContextToolbarSpec, PublicInlineContent_d_SeparatorItemSpec as SeparatorItemSpec, }; + export { PublicInlineContent_d_AutocompleterContents as AutocompleterContents, PublicInlineContent_d_AutocompleterInstanceApi as AutocompleterInstanceApi, PublicInlineContent_d_AutocompleterItemSpec as AutocompleterItemSpec, PublicInlineContent_d_AutocompleterSpec as AutocompleterSpec, PublicInlineContent_d_ContextFormButtonInstanceApi as ContextFormButtonInstanceApi, PublicInlineContent_d_ContextFormButtonSpec as ContextFormButtonSpec, PublicInlineContent_d_ContextFormInstanceApi as ContextFormInstanceApi, PublicInlineContent_d_ContextFormSpec as ContextFormSpec, PublicInlineContent_d_ContextFormToggleButtonInstanceApi as ContextFormToggleButtonInstanceApi, PublicInlineContent_d_ContextFormToggleButtonSpec as ContextFormToggleButtonSpec, PublicInlineContent_d_ContextPosition as ContextPosition, PublicInlineContent_d_ContextScope as ContextScope, PublicInlineContent_d_ContextToolbarSpec as ContextToolbarSpec, PublicInlineContent_d_SeparatorItemSpec as SeparatorItemSpec, }; } type PublicMenu_d_MenuItemSpec = MenuItemSpec; type PublicMenu_d_MenuItemInstanceApi = MenuItemInstanceApi; @@ -1271,7 +1275,7 @@ type PublicMenu_d_CardContainerSpec = CardContainerSpec; type PublicMenu_d_CardImageSpec = CardImageSpec; type PublicMenu_d_CardTextSpec = CardTextSpec; declare namespace PublicMenu_d { - export { PublicMenu_d_MenuItemSpec as MenuItemSpec, PublicMenu_d_MenuItemInstanceApi as MenuItemInstanceApi, PublicMenu_d_NestedMenuItemContents as NestedMenuItemContents, PublicMenu_d_NestedMenuItemSpec as NestedMenuItemSpec, PublicMenu_d_NestedMenuItemInstanceApi as NestedMenuItemInstanceApi, PublicMenu_d_FancyMenuItemSpec as FancyMenuItemSpec, PublicMenu_d_ColorSwatchMenuItemSpec as ColorSwatchMenuItemSpec, PublicMenu_d_InsertTableMenuItemSpec as InsertTableMenuItemSpec, PublicMenu_d_ToggleMenuItemSpec as ToggleMenuItemSpec, PublicMenu_d_ToggleMenuItemInstanceApi as ToggleMenuItemInstanceApi, PublicMenu_d_ChoiceMenuItemSpec as ChoiceMenuItemSpec, PublicMenu_d_ChoiceMenuItemInstanceApi as ChoiceMenuItemInstanceApi, PublicMenu_d_SeparatorMenuItemSpec as SeparatorMenuItemSpec, PublicMenu_d_ContextMenuApi as ContextMenuApi, PublicMenu_d_ContextMenuContents as ContextMenuContents, PublicMenu_d_ContextMenuItem as ContextMenuItem, PublicMenu_d_ContextSubMenu as ContextSubMenu, PublicMenu_d_CardMenuItemSpec as CardMenuItemSpec, PublicMenu_d_CardMenuItemInstanceApi as CardMenuItemInstanceApi, PublicMenu_d_CardItemSpec as CardItemSpec, PublicMenu_d_CardContainerSpec as CardContainerSpec, PublicMenu_d_CardImageSpec as CardImageSpec, PublicMenu_d_CardTextSpec as CardTextSpec, }; + export { PublicMenu_d_CardContainerSpec as CardContainerSpec, PublicMenu_d_CardImageSpec as CardImageSpec, PublicMenu_d_CardItemSpec as CardItemSpec, PublicMenu_d_CardMenuItemInstanceApi as CardMenuItemInstanceApi, PublicMenu_d_CardMenuItemSpec as CardMenuItemSpec, PublicMenu_d_CardTextSpec as CardTextSpec, PublicMenu_d_ChoiceMenuItemInstanceApi as ChoiceMenuItemInstanceApi, PublicMenu_d_ChoiceMenuItemSpec as ChoiceMenuItemSpec, PublicMenu_d_ColorSwatchMenuItemSpec as ColorSwatchMenuItemSpec, PublicMenu_d_ContextMenuApi as ContextMenuApi, PublicMenu_d_ContextMenuContents as ContextMenuContents, PublicMenu_d_ContextMenuItem as ContextMenuItem, PublicMenu_d_ContextSubMenu as ContextSubMenu, PublicMenu_d_FancyMenuItemSpec as FancyMenuItemSpec, PublicMenu_d_InsertTableMenuItemSpec as InsertTableMenuItemSpec, PublicMenu_d_MenuItemInstanceApi as MenuItemInstanceApi, PublicMenu_d_MenuItemSpec as MenuItemSpec, PublicMenu_d_NestedMenuItemContents as NestedMenuItemContents, PublicMenu_d_NestedMenuItemInstanceApi as NestedMenuItemInstanceApi, PublicMenu_d_NestedMenuItemSpec as NestedMenuItemSpec, PublicMenu_d_SeparatorMenuItemSpec as SeparatorMenuItemSpec, PublicMenu_d_ToggleMenuItemInstanceApi as ToggleMenuItemInstanceApi, PublicMenu_d_ToggleMenuItemSpec as ToggleMenuItemSpec, }; } interface SidebarInstanceApi { element: () => HTMLElement; @@ -1286,7 +1290,7 @@ interface SidebarSpec { type PublicSidebar_d_SidebarSpec = SidebarSpec; type PublicSidebar_d_SidebarInstanceApi = SidebarInstanceApi; declare namespace PublicSidebar_d { - export { PublicSidebar_d_SidebarSpec as SidebarSpec, PublicSidebar_d_SidebarInstanceApi as SidebarInstanceApi, }; + export { PublicSidebar_d_SidebarInstanceApi as SidebarInstanceApi, PublicSidebar_d_SidebarSpec as SidebarSpec, }; } type PublicToolbar_d_ToolbarButtonSpec = ToolbarButtonSpec; type PublicToolbar_d_ToolbarButtonInstanceApi = ToolbarButtonInstanceApi; @@ -1299,7 +1303,7 @@ type PublicToolbar_d_ToolbarToggleButtonInstanceApi = ToolbarToggleButtonInstanc type PublicToolbar_d_GroupToolbarButtonSpec = GroupToolbarButtonSpec; type PublicToolbar_d_GroupToolbarButtonInstanceApi = GroupToolbarButtonInstanceApi; declare namespace PublicToolbar_d { - export { PublicToolbar_d_ToolbarButtonSpec as ToolbarButtonSpec, PublicToolbar_d_ToolbarButtonInstanceApi as ToolbarButtonInstanceApi, PublicToolbar_d_ToolbarSplitButtonSpec as ToolbarSplitButtonSpec, PublicToolbar_d_ToolbarSplitButtonInstanceApi as ToolbarSplitButtonInstanceApi, PublicToolbar_d_ToolbarMenuButtonSpec as ToolbarMenuButtonSpec, PublicToolbar_d_ToolbarMenuButtonInstanceApi as ToolbarMenuButtonInstanceApi, PublicToolbar_d_ToolbarToggleButtonSpec as ToolbarToggleButtonSpec, PublicToolbar_d_ToolbarToggleButtonInstanceApi as ToolbarToggleButtonInstanceApi, PublicToolbar_d_GroupToolbarButtonSpec as GroupToolbarButtonSpec, PublicToolbar_d_GroupToolbarButtonInstanceApi as GroupToolbarButtonInstanceApi, }; + export { PublicToolbar_d_GroupToolbarButtonInstanceApi as GroupToolbarButtonInstanceApi, PublicToolbar_d_GroupToolbarButtonSpec as GroupToolbarButtonSpec, PublicToolbar_d_ToolbarButtonInstanceApi as ToolbarButtonInstanceApi, PublicToolbar_d_ToolbarButtonSpec as ToolbarButtonSpec, PublicToolbar_d_ToolbarMenuButtonInstanceApi as ToolbarMenuButtonInstanceApi, PublicToolbar_d_ToolbarMenuButtonSpec as ToolbarMenuButtonSpec, PublicToolbar_d_ToolbarSplitButtonInstanceApi as ToolbarSplitButtonInstanceApi, PublicToolbar_d_ToolbarSplitButtonSpec as ToolbarSplitButtonSpec, PublicToolbar_d_ToolbarToggleButtonInstanceApi as ToolbarToggleButtonInstanceApi, PublicToolbar_d_ToolbarToggleButtonSpec as ToolbarToggleButtonSpec, }; } interface ViewButtonApi { setIcon: (newIcon: string) => void; @@ -1331,7 +1335,7 @@ interface ViewButtonsGroupSpec { type: 'group'; buttons: Array; } -type ViewButtonSpec = ViewNormalButtonSpec | ViewToggleButtonSpec | ViewButtonsGroupSpec; +type ViewButtonSpec = ViewButtonsGroupSpec | ViewNormalButtonSpec | ViewToggleButtonSpec; interface ViewInstanceApi { getContainer: () => HTMLElement; } @@ -1343,7 +1347,7 @@ interface ViewSpec { type PublicView_d_ViewSpec = ViewSpec; type PublicView_d_ViewInstanceApi = ViewInstanceApi; declare namespace PublicView_d { - export { PublicView_d_ViewSpec as ViewSpec, PublicView_d_ViewInstanceApi as ViewInstanceApi, }; + export { PublicView_d_ViewInstanceApi as ViewInstanceApi, PublicView_d_ViewSpec as ViewSpec, }; } interface Registry$1 { addButton: (name: string, spec: ToolbarButtonSpec) => void; @@ -1363,15 +1367,15 @@ interface Registry$1 { addView: (name: string, spec: ViewSpec) => void; addContext: (name: string, pred: (args: string) => boolean) => void; getAll: () => { - buttons: Record; - menuItems: Record; - popups: Record; + buttons: Record; contextMenus: Record; - contextToolbars: Record; + contexts: Record boolean>; + contextToolbars: Record; icons: Record; + menuItems: Record; + popups: Record; sidebars: Record; views: Record; - contexts: Record boolean>; }; } interface AutocompleteLookupData { @@ -1394,8 +1398,8 @@ type ApplyFormat = BlockFormat | InlineFormat | SelectorFormat; type RemoveFormat = RemoveBlockFormat | RemoveInlineFormat | RemoveSelectorFormat; type Format = ApplyFormat | RemoveFormat; type Formats = Record; -type FormatAttrOrStyleValue = string | ((vars?: FormatVars) => string | null); -type FormatVars = Record; +type FormatAttrOrStyleValue = ((vars?: FormatVars) => null | string) | string; +type FormatVars = Record; interface BaseFormat { ceFalseOverride?: boolean; classes?: string | string[]; @@ -1406,7 +1410,7 @@ interface BaseFormat { mixed?: boolean; block_expand?: boolean; onmatch?: (node: Element, fmt: T, itemName: string) => boolean; - remove?: 'none' | 'empty' | 'all'; + remove?: 'all' | 'empty' | 'none'; remove_similar?: boolean; split?: boolean; deep?: boolean; @@ -1428,27 +1432,27 @@ interface CommonFormat extends BaseFormat { attributes?: Record; styles?: Record; toggle?: boolean; - preview?: string | false; - onformat?: (elm: Element, fmt: T, vars?: FormatVars, node?: Node | RangeLikeObject | null) => void; + preview?: false | string; + onformat?: (elm: Element, fmt: T, vars?: FormatVars, node?: Node | null | RangeLikeObject) => void; clear_child_styles?: boolean; merge_siblings?: boolean; merge_with_parents?: boolean; } interface BlockFormat extends Block, CommonFormat { } -interface InlineFormat extends Inline, CommonFormat { +interface InlineFormat extends CommonFormat, Inline { } -interface SelectorFormat extends Selector, CommonFormat { +interface SelectorFormat extends CommonFormat, Selector { } interface CommonRemoveFormat extends BaseFormat { - attributes?: string[] | Record; - styles?: string[] | Record; + attributes?: Record | string[]; + styles?: Record | string[]; } interface RemoveBlockFormat extends Block, CommonRemoveFormat { } -interface RemoveInlineFormat extends Inline, CommonRemoveFormat { +interface RemoveInlineFormat extends CommonRemoveFormat, Inline { } -interface RemoveSelectorFormat extends Selector, CommonRemoveFormat { +interface RemoveSelectorFormat extends CommonRemoveFormat, Selector { } interface Filter { name: string; @@ -1534,16 +1538,16 @@ type Ui_d_Registry = Registry; type Ui_d_EditorUiApi = EditorUiApi; type Ui_d_EditorUi = EditorUi; declare namespace Ui_d { - export { Ui_d_Registry as Registry, PublicDialog_d as Dialog, PublicInlineContent_d as InlineContent, PublicMenu_d as Menu, PublicView_d as View, PublicSidebar_d as Sidebar, PublicToolbar_d as Toolbar, Ui_d_EditorUiApi as EditorUiApi, Ui_d_EditorUi as EditorUi, }; + export { PublicDialog_d as Dialog, Ui_d_EditorUi as EditorUi, Ui_d_EditorUiApi as EditorUiApi, PublicInlineContent_d as InlineContent, PublicMenu_d as Menu, Ui_d_Registry as Registry, PublicSidebar_d as Sidebar, PublicToolbar_d as Toolbar, PublicView_d as View, }; } interface WindowParams { - readonly inline?: 'cursor' | 'toolbar' | 'bottom'; + readonly inline?: 'bottom' | 'cursor' | 'toolbar'; readonly ariaAttrs?: boolean; readonly persistent?: boolean; } -type InstanceApi = UrlDialogInstanceApi | DialogInstanceApi; +type InstanceApi = DialogInstanceApi | UrlDialogInstanceApi; interface WindowManagerImpl { - open: (config: DialogSpec, params: WindowParams | undefined, closeWindow: (dialog: DialogInstanceApi) => void) => DialogInstanceApi; + open: (config: DialogSpec, params: undefined | WindowParams, closeWindow: (dialog: DialogInstanceApi) => void) => DialogInstanceApi; openUrl: (config: UrlDialogSpec, closeWindow: (dialog: UrlDialogInstanceApi) => void) => UrlDialogInstanceApi; alert: (message: string, callback: () => void) => void; confirm: (message: string, callback: (state: boolean) => void) => void; @@ -1589,7 +1593,7 @@ interface NodeChangeEvent { interface FormatEvent { format: string; vars?: FormatVars; - node?: Node | RangeLikeObject | null; + node?: Node | null | RangeLikeObject; } interface ObjectResizeEvent { target: HTMLElement; @@ -1619,7 +1623,7 @@ interface SwitchModeEvent { } interface ChangeEvent { level: UndoLevel; - lastLevel: UndoLevel | undefined; + lastLevel: undefined | UndoLevel; } interface AddUndoEvent extends ChangeEvent { originalEvent: Event | undefined; @@ -1740,8 +1744,8 @@ interface EditorEventMap extends Omit { SaveContent: SaveContentEvent; RawSaveContent: SaveContentEvent; LoadContent: { - load: boolean; element: HTMLElement; + load: boolean; }; PreviewFormats: {}; AfterPreviewFormats: {}; @@ -1832,7 +1836,7 @@ type EventTypes_d_DisabledStateChangeEvent = DisabledStateChangeEvent; type EventTypes_d_EditorEventMap = EditorEventMap; type EventTypes_d_EditorManagerEventMap = EditorManagerEventMap; declare namespace EventTypes_d { - export { EventTypes_d_ExecCommandEvent as ExecCommandEvent, EventTypes_d_BeforeGetContentEvent as BeforeGetContentEvent, EventTypes_d_GetContentEvent as GetContentEvent, EventTypes_d_BeforeSetContentEvent as BeforeSetContentEvent, EventTypes_d_SetContentEvent as SetContentEvent, EventTypes_d_SaveContentEvent as SaveContentEvent, EventTypes_d_NewBlockEvent as NewBlockEvent, EventTypes_d_NodeChangeEvent as NodeChangeEvent, EventTypes_d_FormatEvent as FormatEvent, EventTypes_d_ObjectResizeEvent as ObjectResizeEvent, EventTypes_d_ObjectSelectedEvent as ObjectSelectedEvent, EventTypes_d_ScrollIntoViewEvent as ScrollIntoViewEvent, EventTypes_d_SetSelectionRangeEvent as SetSelectionRangeEvent, EventTypes_d_ShowCaretEvent as ShowCaretEvent, EventTypes_d_SwitchModeEvent as SwitchModeEvent, EventTypes_d_ChangeEvent as ChangeEvent, EventTypes_d_AddUndoEvent as AddUndoEvent, EventTypes_d_UndoRedoEvent as UndoRedoEvent, EventTypes_d_WindowEvent as WindowEvent, EventTypes_d_ProgressStateEvent as ProgressStateEvent, EventTypes_d_AfterProgressStateEvent as AfterProgressStateEvent, EventTypes_d_PlaceholderToggleEvent as PlaceholderToggleEvent, EventTypes_d_LoadErrorEvent as LoadErrorEvent, EventTypes_d_PreProcessEvent as PreProcessEvent, EventTypes_d_PostProcessEvent as PostProcessEvent, EventTypes_d_PastePlainTextToggleEvent as PastePlainTextToggleEvent, EventTypes_d_PastePreProcessEvent as PastePreProcessEvent, EventTypes_d_PastePostProcessEvent as PastePostProcessEvent, EventTypes_d_EditableRootStateChangeEvent as EditableRootStateChangeEvent, EventTypes_d_NewTableRowEvent as NewTableRowEvent, EventTypes_d_NewTableCellEvent as NewTableCellEvent, EventTypes_d_TableEventData as TableEventData, EventTypes_d_TableModifiedEvent as TableModifiedEvent, EventTypes_d_BeforeOpenNotificationEvent as BeforeOpenNotificationEvent, EventTypes_d_OpenNotificationEvent as OpenNotificationEvent, EventTypes_d_DisabledStateChangeEvent as DisabledStateChangeEvent, EventTypes_d_EditorEventMap as EditorEventMap, EventTypes_d_EditorManagerEventMap as EditorManagerEventMap, }; + export { EventTypes_d_AddUndoEvent as AddUndoEvent, EventTypes_d_AfterProgressStateEvent as AfterProgressStateEvent, EventTypes_d_BeforeGetContentEvent as BeforeGetContentEvent, EventTypes_d_BeforeOpenNotificationEvent as BeforeOpenNotificationEvent, EventTypes_d_BeforeSetContentEvent as BeforeSetContentEvent, EventTypes_d_ChangeEvent as ChangeEvent, EventTypes_d_DisabledStateChangeEvent as DisabledStateChangeEvent, EventTypes_d_EditableRootStateChangeEvent as EditableRootStateChangeEvent, EventTypes_d_EditorEventMap as EditorEventMap, EventTypes_d_EditorManagerEventMap as EditorManagerEventMap, EventTypes_d_ExecCommandEvent as ExecCommandEvent, EventTypes_d_FormatEvent as FormatEvent, EventTypes_d_GetContentEvent as GetContentEvent, EventTypes_d_LoadErrorEvent as LoadErrorEvent, EventTypes_d_NewBlockEvent as NewBlockEvent, EventTypes_d_NewTableCellEvent as NewTableCellEvent, EventTypes_d_NewTableRowEvent as NewTableRowEvent, EventTypes_d_NodeChangeEvent as NodeChangeEvent, EventTypes_d_ObjectResizeEvent as ObjectResizeEvent, EventTypes_d_ObjectSelectedEvent as ObjectSelectedEvent, EventTypes_d_OpenNotificationEvent as OpenNotificationEvent, EventTypes_d_PastePlainTextToggleEvent as PastePlainTextToggleEvent, EventTypes_d_PastePostProcessEvent as PastePostProcessEvent, EventTypes_d_PastePreProcessEvent as PastePreProcessEvent, EventTypes_d_PlaceholderToggleEvent as PlaceholderToggleEvent, EventTypes_d_PostProcessEvent as PostProcessEvent, EventTypes_d_PreProcessEvent as PreProcessEvent, EventTypes_d_ProgressStateEvent as ProgressStateEvent, EventTypes_d_SaveContentEvent as SaveContentEvent, EventTypes_d_ScrollIntoViewEvent as ScrollIntoViewEvent, EventTypes_d_SetContentEvent as SetContentEvent, EventTypes_d_SetSelectionRangeEvent as SetSelectionRangeEvent, EventTypes_d_ShowCaretEvent as ShowCaretEvent, EventTypes_d_SwitchModeEvent as SwitchModeEvent, EventTypes_d_TableEventData as TableEventData, EventTypes_d_TableModifiedEvent as TableModifiedEvent, EventTypes_d_UndoRedoEvent as UndoRedoEvent, EventTypes_d_WindowEvent as WindowEvent, }; } type Format_d_Formats = Formats; type Format_d_Format = Format; @@ -1845,10 +1849,10 @@ type Format_d_RemoveBlockFormat = RemoveBlockFormat; type Format_d_RemoveInlineFormat = RemoveInlineFormat; type Format_d_RemoveSelectorFormat = RemoveSelectorFormat; declare namespace Format_d { - export { Format_d_Formats as Formats, Format_d_Format as Format, Format_d_ApplyFormat as ApplyFormat, Format_d_BlockFormat as BlockFormat, Format_d_InlineFormat as InlineFormat, Format_d_SelectorFormat as SelectorFormat, Format_d_RemoveFormat as RemoveFormat, Format_d_RemoveBlockFormat as RemoveBlockFormat, Format_d_RemoveInlineFormat as RemoveInlineFormat, Format_d_RemoveSelectorFormat as RemoveSelectorFormat, }; + export { Format_d_ApplyFormat as ApplyFormat, Format_d_BlockFormat as BlockFormat, Format_d_Format as Format, Format_d_Formats as Formats, Format_d_InlineFormat as InlineFormat, Format_d_RemoveBlockFormat as RemoveBlockFormat, Format_d_RemoveFormat as RemoveFormat, Format_d_RemoveInlineFormat as RemoveInlineFormat, Format_d_RemoveSelectorFormat as RemoveSelectorFormat, Format_d_SelectorFormat as SelectorFormat, }; } type StyleFormat = BlockStyleFormat | InlineStyleFormat | SelectorStyleFormat; -type AllowedFormat = Separator | FormatReference | StyleFormat | NestedFormatting; +type AllowedFormat = FormatReference | NestedFormatting | Separator | StyleFormat; interface Separator { title: string; } @@ -1868,44 +1872,44 @@ interface CommonStyleFormat { } interface BlockStyleFormat extends BlockFormat, CommonStyleFormat { } -interface InlineStyleFormat extends InlineFormat, CommonStyleFormat { +interface InlineStyleFormat extends CommonStyleFormat, InlineFormat { } -interface SelectorStyleFormat extends SelectorFormat, CommonStyleFormat { +interface SelectorStyleFormat extends CommonStyleFormat, SelectorFormat { } -type EntityEncoding = 'named' | 'numeric' | 'raw' | 'named,numeric' | 'named+numeric' | 'numeric,named' | 'numeric+named'; +type EntityEncoding = 'named' | 'named+numeric' | 'named,numeric' | 'numeric' | 'numeric+named' | 'numeric,named' | 'raw'; interface ContentLanguage { readonly title: string; readonly code: string; readonly customCode?: string; } type ThemeInitFunc = (editor: Editor, elm: HTMLElement) => { + api?: EditorUiApi; editorContainer: HTMLElement; - iframeContainer: HTMLElement; height?: number; + iframeContainer: HTMLElement; iframeHeight?: number; - api?: EditorUiApi; }; type SetupCallback = (editor: Editor) => void; type FilePickerCallback = (callback: (value: string, meta?: Record) => void, value: string, meta: Record) => void; -type FilePickerValidationStatus = 'valid' | 'unknown' | 'invalid' | 'none'; +type FilePickerValidationStatus = 'invalid' | 'none' | 'unknown' | 'valid'; type FilePickerValidationCallback = (info: { type: string; url: string; }, callback: (validation: { - status: FilePickerValidationStatus; message: string; + status: FilePickerValidationStatus; }) => void) => void; type PastePreProcessFn = (editor: Editor, args: PastePreProcessEvent) => void; type PastePostProcessFn = (editor: Editor, args: PastePostProcessEvent) => void; -type URLConverter = (url: string, name: string, elm?: string | Element) => string; +type URLConverter = (url: string, name: string, elm?: Element | string) => string; type URLConverterCallback = (url: string, node: Node | string | undefined, on_save: boolean, name: string) => string; interface ToolbarGroup { name?: string; label?: string; items: string[]; } -type ToolbarMode = 'floating' | 'sliding' | 'scrolling' | 'wrap'; -type ToolbarLocation = 'top' | 'bottom' | 'auto'; +type ToolbarMode = 'floating' | 'scrolling' | 'sliding' | 'wrap'; +type ToolbarLocation = 'auto' | 'bottom' | 'top'; interface BaseEditorOptions { a11y_advanced_options?: boolean; add_form_submit_trigger?: boolean; @@ -1943,13 +1947,13 @@ interface BaseEditorOptions { content_security_policy?: string; content_style?: string; content_langs?: ContentLanguage[]; - contextmenu?: string | string[] | false; + contextmenu?: false | string | string[]; contextmenu_never_use_native?: boolean; convert_fonts_to_spans?: boolean; convert_unsafe_embeds?: boolean; convert_urls?: boolean; custom_colors?: boolean; - custom_elements?: string | Record; + custom_elements?: Record | string; custom_ui_selector?: string; custom_undo_redo_levels?: number; default_font_stack?: string[]; @@ -1960,7 +1964,7 @@ interface BaseEditorOptions { draggable_modal?: boolean; editable_class?: string; editable_root?: boolean; - element_format?: 'xhtml' | 'html'; + element_format?: 'html' | 'xhtml'; elementpath?: boolean; encoding?: string; end_container_on_empty_block?: boolean | string; @@ -2014,7 +2018,7 @@ interface BaseEditorOptions { inline_boundaries_selector?: string; inline_styles?: boolean; invalid_elements?: string; - invalid_styles?: string | Record; + invalid_styles?: Record | string; keep_styles?: boolean; language?: string; language_load?: boolean; @@ -2023,8 +2027,8 @@ interface BaseEditorOptions { max_height?: number; max_width?: number; menu?: Record; menubar?: boolean | string; min_height?: number; @@ -2032,7 +2036,7 @@ interface BaseEditorOptions { model?: string; model_url?: string; newdocument_content?: string; - newline_behavior?: 'block' | 'linebreak' | 'invert' | 'default'; + newline_behavior?: 'block' | 'default' | 'invert' | 'linebreak'; no_newline_selector?: string; noneditable_class?: string; noneditable_regexp?: RegExp | RegExp[]; @@ -2060,7 +2064,7 @@ interface BaseEditorOptions { remove_script_host?: boolean; remove_trailing_brs?: boolean; removed_menuitems?: string; - resize?: boolean | 'both'; + resize?: 'both' | boolean; resize_img_proportional?: boolean; root_name?: string; sandbox_iframes?: boolean; @@ -2080,11 +2084,11 @@ interface BaseEditorOptions { suffix?: string; table_tab_navigation?: boolean; target?: HTMLElement; - text_patterns?: RawPattern[] | false; + text_patterns?: false | RawPattern[]; text_patterns_lookup?: RawDynamicPatternsLookup; - theme?: string | ThemeInitFunc | false; + theme?: false | string | ThemeInitFunc; theme_url?: string; - toolbar?: boolean | string | string[] | Array; + toolbar?: Array | boolean | string | string[]; toolbar1?: string; toolbar2?: string; toolbar3?: string; @@ -2105,9 +2109,9 @@ interface BaseEditorOptions { url_converter_scope?: any; urlconverter_callback?: URLConverterCallback; valid_children?: string; - valid_classes?: string | Record; + valid_classes?: Record | string; valid_elements?: string; - valid_styles?: string | Record; + valid_styles?: Record | string; verify_html?: boolean; visual?: boolean; visual_anchor_class?: string; @@ -2184,8 +2188,8 @@ interface EditorOptions extends NormalizedEditorOptions { language_url: string; line_height_formats: string; menu: Record; menubar: boolean | string; model: string; @@ -2202,7 +2206,7 @@ interface EditorOptions extends NormalizedEditorOptions { removed_menuitems: string; sandbox_iframes: boolean; sandbox_iframes_exclusions: string[]; - toolbar: boolean | string | string[] | Array; + toolbar: Array | boolean | string | string[]; toolbar_groups: Record; toolbar_location: ToolbarLocation; toolbar_mode: ToolbarMode; @@ -2218,7 +2222,7 @@ interface EditorOptions extends NormalizedEditorOptions { xss_sanitization: boolean; disabled: boolean; } -type StyleMap = Record; +type StyleMap = Record; interface StylesSettings { allow_script_urls?: boolean; allow_svg_data_urls?: boolean; @@ -2229,7 +2233,7 @@ interface Styles { parse: (css: string | undefined) => Record; serialize: (styles: StyleMap, elementName?: string) => string; } -type EventUtilsCallback = (event: EventUtilsEvent) => void | boolean; +type EventUtilsCallback = (event: EventUtilsEvent) => boolean | void; type EventUtilsEvent = NormalizedEvent & { metaKey: boolean; }; @@ -2238,7 +2242,7 @@ interface Callback$1 { scope: any; } interface CallbackList extends Array> { - fakeName: string | false; + fakeName: false | string; capture: boolean; nativeHandler: EventListener; } @@ -2251,26 +2255,26 @@ declare class EventUtils { static Event: EventUtils; domLoaded: boolean; events: Record>>; + private count; + private executeHandlers; private readonly expando; private hasFocusIn; - private count; constructor(); bind(target: any, name: K, callback: EventUtilsCallback, scope?: any): EventUtilsCallback; bind(target: any, names: string, callback: EventUtilsCallback, scope?: any): EventUtilsCallback; + cancel(e: EventUtilsEvent): boolean; + clean(target: any): this; + destroy(): void; + dispatch(target: any, name: string, args?: {}): this; + fire(target: any, name: string, args?: {}): this; unbind(target: any, name: K, callback?: EventUtilsCallback): this; unbind(target: any, names: string, callback?: EventUtilsCallback): this; unbind(target: any): this; - fire(target: any, name: string, args?: {}): this; - dispatch(target: any, name: string, args?: {}): this; - clean(target: any): this; - destroy(): void; - cancel(e: EventUtilsEvent): boolean; - private executeHandlers; } interface SetAttribEvent { attrElm: HTMLElement; attrName: string; - attrValue: string | boolean | number | null; + attrValue: boolean | null | number | string; } interface DOMUtilsSettings { schema: Schema; @@ -2286,7 +2290,7 @@ interface DOMUtilsSettings { referrerPolicy: ReferrerPolicy; } type Target = Node | Window; -type RunArguments = string | T | Array | null; +type RunArguments = Array | null | string | T; type BoundEvent = [ Target, string, @@ -2315,58 +2319,58 @@ interface DOMUtils { clone: (node: Node, deep: boolean) => Node; getRoot: () => HTMLElement; getViewPort: (argWin?: Window) => GeomRect; - getRect: (elm: string | HTMLElement) => GeomRect; - getSize: (elm: string | HTMLElement) => { - w: number; + getRect: (elm: HTMLElement | string) => GeomRect; + getSize: (elm: HTMLElement | string) => { h: number; + w: number; }; getParent: { - (node: string | Node | null, selector: K, root?: Node): HTMLElementTagNameMap[K] | null; - (node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node): T | null; - (node: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node): Node | null; + (node: Node | null | string, selector: K, root?: Node): HTMLElementTagNameMap[K] | null; + (node: Node | null | string, selector: ((node: Node) => node is T) | string, root?: Node): null | T; + (node: Node | null | string, selector?: ((node: Node) => boolean | void) | string, root?: Node): Node | null; }; getParents: { - (elm: string | HTMLElementTagNameMap[K] | null, selector: K, root?: Node, collect?: boolean): Array; - (node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node, collect?: boolean): T[]; - (elm: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node, collect?: boolean): Node[]; + (elm: HTMLElementTagNameMap[K] | null | string, selector: K, root?: Node, collect?: boolean): Array; + (node: Node | null | string, selector: ((node: Node) => node is T) | string, root?: Node, collect?: boolean): T[]; + (elm: Node | null | string, selector?: ((node: Node) => boolean | void) | string, root?: Node, collect?: boolean): Node[]; }; get: { (elm: T): T; (elm: string): HTMLElement | null; }; - getNext: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null; - getPrev: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null; + getNext: (node: Node | null, selector: ((node: Node) => boolean) | string) => Node | null; + getPrev: (node: Node | null, selector: ((node: Node) => boolean) | string) => Node | null; select: { - (selector: K, scope?: string | Node): Array; - (selector: string, scope?: string | Node): T[]; + (selector: K, scope?: Node | string): Array; + (selector: string, scope?: Node | string): T[]; }; is: { (elm: Node | Node[] | null, selector: string): elm is T; (elm: Node | Node[] | null, selector: string): boolean; }; - add: (parentElm: RunArguments, name: string | Element, attrs?: Record, html?: string | Node | null, create?: boolean) => HTMLElement; + add: (parentElm: RunArguments, name: Element | string, attrs?: Record, html?: Node | null | string, create?: boolean) => HTMLElement; create: { - (name: K, attrs?: Record, html?: string | Node | null): HTMLElementTagNameMap[K]; - (name: string, attrs?: Record, html?: string | Node | null): HTMLElement; + (name: K, attrs?: Record, html?: Node | null | string): HTMLElementTagNameMap[K]; + (name: string, attrs?: Record, html?: Node | null | string): HTMLElement; }; - createHTML: (name: string, attrs?: Record, html?: string) => string; + createHTML: (name: string, attrs?: Record, html?: string) => string; createFragment: (html?: string) => DocumentFragment; remove: { (node: T | T[], keepChildren?: boolean): typeof node extends Array ? T[] : T; - (node: string, keepChildren?: boolean): T | false; + (node: string, keepChildren?: boolean): false | T; }; getStyle: { (elm: Element, name: string, computed: true): string; - (elm: string | Element | null, name: string, computed?: boolean): string | undefined; + (elm: Element | null | string, name: string, computed?: boolean): string | undefined; }; - setStyle: (elm: string | Element | Element[], name: string, value: string | number | null) => void; - setStyles: (elm: string | Element | Element[], stylesArg: StyleMap) => void; + setStyle: (elm: Element | Element[] | string, name: string, value: null | number | string) => void; + setStyles: (elm: Element | Element[] | string, stylesArg: StyleMap) => void; removeAllAttribs: (e: RunArguments) => void; - setAttrib: (elm: RunArguments, name: string, value: string | boolean | number | null) => void; - setAttribs: (elm: RunArguments, attrs: Record) => void; - getAttrib: (elm: string | Element | null, name: string, defaultVal?: string) => string; - getAttribs: (elm: string | Element) => NamedNodeMap | Attr[]; - getPos: (elm: string | Element, rootElm?: Node) => { + setAttrib: (elm: RunArguments, name: string, value: boolean | null | number | string) => void; + setAttribs: (elm: RunArguments, attrs: Record) => void; + getAttrib: (elm: Element | null | string, name: string, defaultVal?: string) => string; + getAttribs: (elm: Element | string) => Attr[] | NamedNodeMap; + getPos: (elm: Element | string, rootElm?: Node) => { x: number; y: number; }; @@ -2374,22 +2378,22 @@ interface DOMUtils { serializeStyle: (stylesArg: StyleMap, name?: string) => string; addStyle: (cssText: string) => void; loadCSS: (url: string) => void; - hasClass: (elm: string | Element, cls: string) => boolean; + hasClass: (elm: Element | string, cls: string) => boolean; addClass: (elm: RunArguments, cls: string) => void; removeClass: (elm: RunArguments, cls: string) => void; toggleClass: (elm: RunArguments, cls: string, state?: boolean) => void; - show: (elm: string | Node | Node[]) => void; - hide: (elm: string | Node | Node[]) => void; - isHidden: (elm: string | Node) => boolean; + show: (elm: Node | Node[] | string) => void; + hide: (elm: Node | Node[] | string) => void; + isHidden: (elm: Node | string) => boolean; uniqueId: (prefix?: string) => string; setHTML: (elm: RunArguments, html: string) => void; - getOuterHTML: (elm: string | Node) => string; - setOuterHTML: (elm: string | Node | Node[], html: string) => void; + getOuterHTML: (elm: Node | string) => string; + setOuterHTML: (elm: Node | Node[] | string, html: string) => void; decode: (text: string) => string; encode: (text: string) => string; insertAfter: { - (node: T | T[], reference: string | Node): T; - (node: RunArguments, reference: string | Node): RunResult; + (node: T | T[], reference: Node | string): T; + (node: RunArguments, reference: Node | string): RunResult; }; replace: { (newElm: Node, oldElm: T | T[], keepChildren?: boolean): T; @@ -2419,8 +2423,8 @@ interface DOMUtils { }; fire: (target: Node | Window, name: string, evt?: {}) => EventUtils; dispatch: (target: Node | Window, name: string, evt?: {}) => EventUtils; - getContentEditable: (node: Node) => string | null; - getContentEditableParent: (node: Node) => string | null; + getContentEditable: (node: Node) => null | string; + getContentEditableParent: (node: Node) => null | string; isEditable: (node: Node | null | undefined) => boolean; destroy: () => void; isChildOf: (node: Node, parent: Node) => boolean; @@ -2446,7 +2450,7 @@ interface ControlSelection { destroy: () => void; } interface WriterSettings { - element_format?: 'xhtml' | 'html'; + element_format?: 'html' | 'xhtml'; entities?: string; entity_encoding?: EntityEncoding; indent?: boolean; @@ -2475,7 +2479,7 @@ interface HtmlSerializerSettings extends WriterSettings { interface HtmlSerializer { serialize: (node: AstNode) => string; } -interface DomSerializerSettings extends DomParserSettings, WriterSettings, SchemaSettings, HtmlSerializerSettings { +interface DomSerializerSettings extends DomParserSettings, HtmlSerializerSettings, SchemaSettings, WriterSettings { remove_trailing_brs?: boolean; url_converter?: URLConverter; url_converter_scope?: {}; @@ -2489,9 +2493,9 @@ interface DomSerializerImpl { removeNodeFilter: (name: string, callback?: ParserFilterCallback) => void; removeAttributeFilter: (name: string, callback?: ParserFilterCallback) => void; serialize: { - (node: Element, parserArgs: { + (node: Element, parserArgs: ParserArgs & { format: 'tree'; - } & ParserArgs): AstNode; + }): AstNode; (node: Element, parserArgs?: ParserArgs): string; }; addRules: (rules: string) => void; @@ -2514,9 +2518,9 @@ interface EditorSelection { (): void; }; getContent: { - (args: { + (args: Partial & { format: 'tree'; - } & Partial): AstNode; + }): AstNode; (args?: Partial): string; }; setContent: (content: string, args?: Partial) => void; @@ -2528,7 +2532,7 @@ interface EditorSelection { isForward: () => boolean; setNode: (elm: Element) => Element; getNode: () => HTMLElement; - getSel: () => Selection | null; + getSel: () => null | Selection; setRng: (rng: Range, forward?: boolean) => void; getRng: () => Range; getStart: (real?: boolean) => Element; @@ -2537,13 +2541,13 @@ interface EditorSelection { normalize: () => Range; selectorChanged: (selector: string, callback: (active: boolean, args: { node: Node; - selector: String; parents: Node[]; + selector: string; }) => void) => EditorSelection; selectorChangedWithUnbind: (selector: string, callback: (active: boolean, args: { node: Node; - selector: String; parents: Node[]; + selector: string; }) => void) => { unbind: () => void; }; @@ -2571,31 +2575,31 @@ interface EditorCommandsConstructor { new (editor: Editor): EditorCommands; } declare class EditorCommands { - private readonly editor; private commands; + private readonly editor; constructor(editor: Editor); - execCommand(command: string, ui?: boolean, value?: any, args?: ExecCommandArgs): boolean; - queryCommandState(command: string): boolean; - queryCommandValue(command: string): string; - addCommands(commandList: Commands[K], type: K): void; - addCommands(commandList: Record): void; addCommand(command: string, callback: EditorCommandCallback, scope: S): void; addCommand(command: string, callback: EditorCommandCallback): void; - queryCommandSupported(command: string): boolean; + addCommands(commandList: Commands[K], type: K): void; + addCommands(commandList: Record): void; addQueryStateHandler(command: string, callback: (this: S) => boolean, scope: S): void; addQueryStateHandler(command: string, callback: (this: Editor) => boolean): void; addQueryValueHandler(command: string, callback: (this: S) => string, scope: S): void; addQueryValueHandler(command: string, callback: (this: Editor) => string): void; + execCommand(command: string, ui?: boolean, value?: any, args?: ExecCommandArgs): boolean; + queryCommandState(command: string): boolean; + queryCommandSupported(command: string): boolean; + queryCommandValue(command: string): string; } interface RawString { raw: string; } -type Primitive = string | number | boolean | Record | Function; +type Primitive = boolean | Function | number | Record | string; type TokenisedString = [ string, ...Primitive[] ]; -type Untranslated = Primitive | TokenisedString | RawString | null | undefined; +type Untranslated = null | Primitive | RawString | TokenisedString | undefined; type TranslatedString = string; interface I18n { getData: () => Record>; @@ -2621,14 +2625,14 @@ interface URIConstructor { readonly prototype: URI; new (url: string, settings?: URISettings): URI; getDocumentBaseUrl: (loc: { - protocol: string; host?: string; href?: string; pathname?: string; + protocol: string; }) => string; parseDataUri: (uri: string) => { - type: string; data: string; + type: string; }; } interface SafeUriOptions { @@ -2637,40 +2641,40 @@ interface SafeUriOptions { readonly allow_svg_data_urls?: boolean; } declare class URI { - static parseDataUri(uri: string): { - type: string | undefined; - data: string; - }; - static isDomSafe(uri: string, context?: string, options?: SafeUriOptions): boolean; - static getDocumentBaseUrl(loc: { - protocol: string; - host?: string; - href?: string; - pathname?: string; - }): string; - source: string; - protocol: string | undefined; + anchor: string | undefined; authority: string | undefined; - userInfo: string | undefined; - user: string | undefined; - password: string | undefined; - host: string | undefined; - port: string | undefined; - relative: string | undefined; - path: string; directory: string; file: string | undefined; + host: string | undefined; + password: string | undefined; + path: string; + port: string | undefined; + protocol: string | undefined; query: string | undefined; - anchor: string | undefined; + relative: string | undefined; settings: URISettings; + source: string; + user: string | undefined; + userInfo: string | undefined; constructor(url: string, settings?: URISettings); + static getDocumentBaseUrl(loc: { + host?: string; + href?: string; + pathname?: string; + protocol: string; + }): string; + static isDomSafe(uri: string, context?: string, options?: SafeUriOptions): boolean; + static parseDataUri(uri: string): { + data: string; + type: string | undefined; + }; + getURI(noProtoHost?: boolean): string; + isSameOrigin(uri: URI): boolean; setPath(path: string): void; - toRelative(uri: string): string; toAbsolute(uri: string, noHost?: boolean): string; - isSameOrigin(uri: URI): boolean; - toRelPath(base: string, path: string): string; toAbsPath(base: string, path: string): string; - getURI(noProtoHost?: boolean): string; + toRelative(uri: string): string; + toRelPath(base: string, path: string): string; } interface EditorManager extends Observable { defaultOptions: RawEditorOptions; @@ -2692,8 +2696,7 @@ interface EditorManager extends Observable { get(this: EditorManager, id: number | string): Editor | null; init(this: EditorManager, options: RawEditorOptions): Promise; overrideDefaults(this: EditorManager, defaultOptions: Partial): void; - remove(this: EditorManager): void; - remove(this: EditorManager, selector: string): void; + remove(this: EditorManager, selector: null | string): void; remove(this: EditorManager, editor: Editor): Editor | null; setActive(this: EditorManager, editor: Editor): void; setup(this: EditorManager): void; @@ -2715,7 +2718,7 @@ interface ProcessorError { message: string; } type SimpleProcessor = (value: unknown) => boolean; -type Processor = (value: unknown) => ProcessorSuccess | ProcessorError; +type Processor = (value: unknown) => ProcessorError | ProcessorSuccess; interface BuiltInOptionTypeMap { 'string': string; 'number': number; @@ -2778,8 +2781,8 @@ interface EditorUpload { destroy: () => void; } type FormatChangeCallback = (state: boolean, data: { - node: Node; format: string; + node: Node; parents: Element[]; }) => void; interface FormatRegistry { @@ -2788,22 +2791,22 @@ interface FormatRegistry { (): Record; }; has: (name: string) => boolean; - register: (name: string | Formats, format?: Format[] | Format) => void; + register: (name: Formats | string, format?: Format | Format[]) => void; unregister: (name: string) => Formats; } interface Formatter extends FormatRegistry { - apply: (name: string, vars?: FormatVars, node?: Node | RangeLikeObject | null) => void; + apply: (name: string, vars?: FormatVars, node?: Node | null | RangeLikeObject) => void; remove: (name: string, vars?: FormatVars, node?: Node | Range, similar?: boolean) => void; toggle: (name: string, vars?: FormatVars, node?: Node) => void; match: (name: string, vars?: FormatVars, node?: Node, similar?: boolean) => boolean; - closest: (names: string[]) => string | null; + closest: (names: string[]) => null | string; matchAll: (names: string[], vars?: FormatVars) => string[]; matchNode: (node: Node | null, name: string, vars?: FormatVars, similar?: boolean) => Format | undefined; canApply: (name: string) => boolean; formatChanged: (names: string, callback: FormatChangeCallback, similar?: boolean, vars?: FormatVars) => { unbind: () => void; }; - getCssText: (format: string | ApplyFormat) => string; + getCssText: (format: ApplyFormat | string) => string; } interface EditorMode { isReadOnly: () => boolean; @@ -2818,8 +2821,8 @@ interface EditorModeApi { } interface Model { readonly table: { - readonly getSelectedCells: () => HTMLTableCellElement[]; readonly clearSelectedCells: (container: Node) => void; + readonly getSelectedCells: () => HTMLTableCellElement[]; }; } type ModelManager = AddOnManager; @@ -2831,29 +2834,29 @@ interface Plugin { init?: (editor: Editor, url: string) => void; [key: string]: any; } -type PluginManager = AddOnManager; +type PluginManager = AddOnManager; interface ShortcutsConstructor { readonly prototype: Shortcuts; new (editor: Editor): Shortcuts; } -type CommandFunc = string | [ +type CommandFunc = (() => void) | [ string, boolean, any -] | (() => void); +] | string; declare class Shortcuts { - private readonly editor; - private readonly shortcuts; - private pendingPatterns; - constructor(editor: Editor); - add(pattern: string, desc: string | null, cmdFunc: CommandFunc, scope?: any): boolean; - remove(pattern: string): boolean; - private normalizeCommandFunc; private createShortcut; + private readonly editor; + private executeShortcutAction; private hasModifier; private isFunctionKey; private matchShortcut; - private executeShortcutAction; + private normalizeCommandFunc; + private pendingPatterns; + private readonly shortcuts; + constructor(editor: Editor); + add(pattern: string, desc: null | string, cmdFunc: CommandFunc, scope?: any): boolean; + remove(pattern: string): boolean; } interface RenderResult { iframeContainer?: HTMLElement; @@ -2871,141 +2874,141 @@ interface Theme { getWindowManagerImpl?: () => WindowManagerImpl; getPromotionElement?: () => HTMLElement | null; } -type ThemeManager = AddOnManager; +type ThemeManager = AddOnManager; interface EditorConstructor { readonly prototype: Editor; new (id: string, options: RawEditorOptions, editorManager: EditorManager): Editor; } declare class Editor implements EditorObservable { - documentBaseUrl: string; + _beforeUnload: (() => void) | undefined; + _editableRoot: boolean; + _eventDispatcher: EventDispatcher | undefined; + _nodeChangeDispatcher: NodeChange; + _pendingNativeEvents: string[]; + _selectionOverrides: SelectionOverrides; + _skinLoaded: boolean; + annotator: Annotator; baseUri: URI; - id: string; - plugins: Record; - documentBaseURI: URI; baseURI: URI; - contentCSS: string[]; - contentStyles: string[]; - ui: EditorUi; - mode: EditorMode; - options: Options; - editorUpload: EditorUpload; - shortcuts: Shortcuts; - loadedCSS: Record; - editorCommands: EditorCommands; - suffix: string; - editorManager: EditorManager; - hidden: boolean; - inline: boolean; - hasVisual: boolean; - isNotDirty: boolean; - annotator: Annotator; + bindPendingEventDelegates: EditorObservable['bindPendingEventDelegates']; bodyElement: HTMLElement | undefined; bookmark: any; composing: boolean; container: HTMLElement; contentAreaContainer: HTMLElement; + contentCSS: string[]; contentDocument: Document; + contentStyles: string[]; contentWindow: Window; delegates: Record> | undefined; destroyed: boolean; + dispatch: EditorObservable['dispatch']; + documentBaseURI: URI; + documentBaseUrl: string; dom: DOMUtils; + editorCommands: EditorCommands; editorContainer: HTMLElement; + editorManager: EditorManager; + editorUpload: EditorUpload; eventRoot: Element | undefined; + fire: EditorObservable['fire']; formatter: Formatter; formElement: HTMLElement | undefined; formEventDelegate: ((e: Event) => void) | undefined; + hasEventListeners: EditorObservable['hasEventListeners']; hasHiddenInput: boolean; + hasVisual: boolean; + hidden: boolean; + id: string; iframeElement: HTMLIFrameElement | null; iframeHTML: string | undefined; initialized: boolean; + inline: boolean; + isNotDirty: boolean; + loadedCSS: Record; + mode: EditorMode; + model: Model; notificationManager: NotificationManager; + off: EditorObservable['off']; + on: EditorObservable['on']; + once: EditorObservable['once']; + options: Options; orgDisplay: string; orgVisibility: string | undefined; parser: DomParser; + plugins: Record; quirks: Quirks; readonly: boolean; removed: boolean; schema: Schema; selection: EditorSelection; serializer: DomSerializer; + shortcuts: Shortcuts; startContent: string; + suffix: string; targetElm: HTMLElement; theme: Theme; - model: Model; - undoManager: UndoManager; - windowManager: WindowManager; - _beforeUnload: (() => void) | undefined; - _eventDispatcher: EventDispatcher | undefined; - _nodeChangeDispatcher: NodeChange; - _pendingNativeEvents: string[]; - _selectionOverrides: SelectionOverrides; - _skinLoaded: boolean; - _editableRoot: boolean; - bindPendingEventDelegates: EditorObservable['bindPendingEventDelegates']; toggleNativeEvent: EditorObservable['toggleNativeEvent']; + ui: EditorUi; unbindAllNativeEvents: EditorObservable['unbindAllNativeEvents']; - fire: EditorObservable['fire']; - dispatch: EditorObservable['dispatch']; - on: EditorObservable['on']; - off: EditorObservable['off']; - once: EditorObservable['once']; - hasEventListeners: EditorObservable['hasEventListeners']; + undoManager: UndoManager; + windowManager: WindowManager; constructor(id: string, options: RawEditorOptions, editorManager: EditorManager); - render(): void; - focus(skipFocus?: boolean): void; - hasFocus(): boolean; - translate(text: Untranslated): TranslatedString; - getParam(name: string, defaultVal: BuiltInOptionTypeMap[K], type: K): BuiltInOptionTypeMap[K]; - getParam(name: K, defaultVal?: NormalizedEditorOptions[K], type?: BuiltInOptionType): NormalizedEditorOptions[K]; - getParam(name: string, defaultVal: T, type?: BuiltInOptionType): T; - hasPlugin(name: string, loaded?: boolean): boolean; - nodeChanged(args?: any): void; + _scanForImages(): Promise; addCommand(name: string, callback: EditorCommandCallback, scope: S): void; addCommand(name: string, callback: EditorCommandCallback): void; addQueryStateHandler(name: string, callback: (this: S) => boolean, scope?: S): void; addQueryStateHandler(name: string, callback: (this: Editor) => boolean): void; addQueryValueHandler(name: string, callback: (this: S) => string, scope: S): void; addQueryValueHandler(name: string, callback: (this: Editor) => string): void; - addShortcut(pattern: string, desc: string, cmdFunc: string | [ + addShortcut(pattern: string, desc: string, cmdFunc: (() => void) | [ string, boolean, any - ] | (() => void), scope?: any): void; + ] | string, scope?: any): void; + addVisual(elm?: HTMLElement): void; + convertURL(url: string, name: string, elm?: Element | string): string; + destroy(automatic?: boolean): void; execCommand(cmd: string, ui?: boolean, value?: any, args?: ExecCommandArgs): boolean; - queryCommandState(cmd: string): boolean; - queryCommandValue(cmd: string): string; - queryCommandSupported(cmd: string): boolean; - show(): void; + focus(skipFocus?: boolean): void; + getBody(): HTMLElement; + getContainer(): HTMLElement; + getContent(args: Partial & { + format: 'tree'; + }): AstNode; + getContent(args?: Partial): string; + getContentAreaContainer(): HTMLElement; + getDoc(): Document; + getElement(): HTMLElement; + getParam(name: string, defaultVal: BuiltInOptionTypeMap[K], type: K): BuiltInOptionTypeMap[K]; + getParam(name: K, defaultVal?: NormalizedEditorOptions[K], type?: BuiltInOptionType): NormalizedEditorOptions[K]; + getParam(name: string, defaultVal: T, type?: BuiltInOptionType): T; + getWin(): Window; + hasEditableRoot(): boolean; + hasFocus(): boolean; + hasPlugin(name: string, loaded?: boolean): boolean; hide(): void; + insertContent(content: string, args?: any): void; + isDirty(): boolean; isHidden(): boolean; - setProgressState(state: boolean, time?: number): void; load(args?: Partial): string; + nodeChanged(args?: any): void; + queryCommandState(cmd: string): boolean; + queryCommandSupported(cmd: string): boolean; + queryCommandValue(cmd: string): string; + remove(): void; + render(): void; + resetContent(initialContent?: string): void; save(args?: Partial): string; setContent(content: string, args?: Partial): string; setContent(content: AstNode, args?: Partial): AstNode; setContent(content: Content, args?: Partial): Content; - getContent(args: { - format: 'tree'; - } & Partial): AstNode; - getContent(args?: Partial): string; - insertContent(content: string, args?: any): void; - resetContent(initialContent?: string): void; - isDirty(): boolean; setDirty(state: boolean): void; - getContainer(): HTMLElement; - getContentAreaContainer(): HTMLElement; - getElement(): HTMLElement; - getWin(): Window; - getDoc(): Document; - getBody(): HTMLElement; - convertURL(url: string, name: string, elm?: string | Element): string; - addVisual(elm?: HTMLElement): void; setEditableRoot(state: boolean): void; - hasEditableRoot(): boolean; - remove(): void; - destroy(automatic?: boolean): void; + setProgressState(state: boolean, time?: number): void; + show(): void; + translate(text: Untranslated): TranslatedString; uploadImages(): Promise; - _scanForImages(): Promise; } interface UrlObject { prefix: string; @@ -3046,22 +3049,22 @@ interface ScriptLoaderConstructor { } declare class ScriptLoader { static ScriptLoader: ScriptLoader; - private settings; - private states; + private loading; private queue; - private scriptLoadedCallbacks; private queueLoadedCallbacks; - private loading; + private scriptLoadedCallbacks; + private settings; + private states; constructor(settings?: ScriptLoaderSettings); _setReferrerPolicy(referrerPolicy: ReferrerPolicy): void; - loadScript(url: string): Promise; - isDone(url: string): boolean; - markDone(url: string): void; add(url: string): Promise; + isDone(url: string): boolean; load(url: string): Promise; - remove(url: string): void; loadQueue(): Promise; + loadScript(url: string): Promise; loadScripts(scripts: string[]): Promise; + markDone(url: string): void; + remove(url: string): void; } type TextProcessCallback = (node: Text, offset: number, text: string) => number; interface Spot { @@ -3069,23 +3072,23 @@ interface Spot { offset: number; } interface TextSeeker { - backwards: (node: Node, offset: number, process: TextProcessCallback, root?: Node) => Spot | null; - forwards: (node: Node, offset: number, process: TextProcessCallback, root?: Node) => Spot | null; + backwards: (node: Node, offset: number, process: TextProcessCallback, root?: Node) => null | Spot; + forwards: (node: Node, offset: number, process: TextProcessCallback, root?: Node) => null | Spot; } interface DomTreeWalkerConstructor { readonly prototype: DomTreeWalker; new (startNode: Node, rootNode: Node): DomTreeWalker; } declare class DomTreeWalker { - private readonly rootNode; + private findPreviousNode; + private findSibling; private node; + private readonly rootNode; constructor(startNode: Node, rootNode: Node); current(): Node | null | undefined; next(shallow?: boolean): Node | null | undefined; prev(shallow?: boolean): Node | null | undefined; prev2(shallow?: boolean): Node | null | undefined; - private findSibling; - private findPreviousNode; } interface Version { major: number; @@ -3100,34 +3103,34 @@ interface Env { windowsPhone: boolean; browser: { current: string | undefined; - version: Version; - isEdge: () => boolean; isChromium: () => boolean; + isEdge: () => boolean; + isFirefox: () => boolean; isIE: () => boolean; isOpera: () => boolean; - isFirefox: () => boolean; isSafari: () => boolean; + version: Version; }; os: { current: string | undefined; - version: Version; - isWindows: () => boolean; - isiOS: () => boolean; isAndroid: () => boolean; - isMacOS: () => boolean; + isChromeOS: () => boolean; + isFreeBSD: () => boolean; + isiOS: () => boolean; isLinux: () => boolean; + isMacOS: () => boolean; isSolaris: () => boolean; - isFreeBSD: () => boolean; - isChromeOS: () => boolean; + isWindows: () => boolean; + version: Version; }; deviceType: { + isDesktop: () => boolean; isiPad: () => boolean; isiPhone: () => boolean; - isTablet: () => boolean; isPhone: () => boolean; + isTablet: () => boolean; isTouch: () => boolean; isWebView: () => boolean; - isDesktop: () => boolean; }; } interface FakeClipboardItem { @@ -3182,7 +3185,7 @@ type TextPatterns_d_InlineCmdPattern = InlineCmdPattern; type TextPatterns_d_InlinePattern = InlinePattern; type TextPatterns_d_InlineFormatPattern = InlineFormatPattern; declare namespace TextPatterns_d { - export { TextPatterns_d_Pattern as Pattern, TextPatterns_d_RawPattern as RawPattern, TextPatterns_d_DynamicPatternsLookup as DynamicPatternsLookup, TextPatterns_d_RawDynamicPatternsLookup as RawDynamicPatternsLookup, TextPatterns_d_DynamicPatternContext as DynamicPatternContext, TextPatterns_d_BlockCmdPattern as BlockCmdPattern, TextPatterns_d_BlockPattern as BlockPattern, TextPatterns_d_BlockFormatPattern as BlockFormatPattern, TextPatterns_d_InlineCmdPattern as InlineCmdPattern, TextPatterns_d_InlinePattern as InlinePattern, TextPatterns_d_InlineFormatPattern as InlineFormatPattern, }; + export { TextPatterns_d_BlockCmdPattern as BlockCmdPattern, TextPatterns_d_BlockFormatPattern as BlockFormatPattern, TextPatterns_d_BlockPattern as BlockPattern, TextPatterns_d_DynamicPatternContext as DynamicPatternContext, TextPatterns_d_DynamicPatternsLookup as DynamicPatternsLookup, TextPatterns_d_InlineCmdPattern as InlineCmdPattern, TextPatterns_d_InlineFormatPattern as InlineFormatPattern, TextPatterns_d_InlinePattern as InlinePattern, TextPatterns_d_Pattern as Pattern, TextPatterns_d_RawDynamicPatternsLookup as RawDynamicPatternsLookup, TextPatterns_d_RawPattern as RawPattern, }; } interface Delay { setEditorInterval: (editor: Editor, callback: () => void, time?: number) => number; @@ -3203,24 +3206,24 @@ interface Tools { inArray: (arr: ArrayLike, value: T) => number; grep: { (arr: ArrayLike | null | undefined, pred?: ArrayCallback): T[]; - (arr: Record | null | undefined, pred?: ObjCallback): T[]; + (arr: null | Record | undefined, pred?: ObjCallback): T[]; }; - trim: (str: string | null | undefined) => string; + trim: (str: null | string | undefined) => string; toArray: (obj: ArrayLike) => T[]; hasOwn: (obj: any, name: string) => boolean; - makeMap: (items: ArrayLike | string | undefined, delim?: string | RegExp, map?: Record) => Record; + makeMap: (items: ArrayLike | string | undefined, delim?: RegExp | string, map?: Record) => Record; each: { - (arr: ArrayLike | null | undefined, cb: ArrayCallback, scope?: any): boolean; - (obj: Record | null | undefined, cb: ObjCallback, scope?: any): boolean; + (arr: ArrayLike | null | undefined, cb: ArrayCallback, scope?: any): boolean; + (obj: null | Record | undefined, cb: ObjCallback, scope?: any): boolean; }; map: { (arr: ArrayLike | null | undefined, cb: ArrayCallback): R[]; - (obj: Record | null | undefined, cb: ObjCallback): R[]; + (obj: null | Record | undefined, cb: ObjCallback): R[]; }; - extend: (obj: Object, ext: Object, ...objs: Object[]) => any; + extend: (obj: object, ext: object, ...objs: object[]) => any; walk: >(obj: T, f: WalkCallback, n?: keyof T, scope?: any) => void; - resolve: (path: string, o?: Object) => any; - explode: (s: string | string[], d?: string | RegExp) => string[]; + resolve: (path: string, o?: object) => any; + explode: (s: string | string[], d?: RegExp | string) => string[]; _addCacheSuffix: (url: string) => string; } interface KeyboardLikeEvent { @@ -3278,37 +3281,37 @@ interface TinyMCE extends EditorManager { }; util: { Delay: Delay; - Tools: Tools; - VK: VK; - URI: URIConstructor; EventDispatcher: EventDispatcherConstructor; - Observable: Observable; I18n: I18n; - LocalStorage: Storage; ImageUploader: ImageUploader; + LocalStorage: Storage; + Observable: Observable; + Tools: Tools; + URI: URIConstructor; + VK: VK; }; dom: { - EventUtils: EventUtilsConstructor; - TreeWalker: DomTreeWalkerConstructor; - TextSeeker: (dom: DOMUtils, isBlockBoundary?: (node: Node) => boolean) => TextSeeker; + BookmarkManager: BookmarkManagerNamespace; + ControlSelection: (selection: EditorSelection, editor: Editor) => ControlSelection; DOMUtils: DOMUtilsNamespace; - ScriptLoader: ScriptLoaderConstructor; + Event: EventUtils; + EventUtils: EventUtilsConstructor; RangeUtils: RangeUtilsNamespace; - Serializer: (settings: DomSerializerSettings, editor?: Editor) => DomSerializer; - ControlSelection: (selection: EditorSelection, editor: Editor) => ControlSelection; - BookmarkManager: BookmarkManagerNamespace; + ScriptLoader: ScriptLoaderConstructor; Selection: (dom: DOMUtils, win: Window, serializer: DomSerializer, editor: Editor) => EditorSelection; + Serializer: (settings: DomSerializerSettings, editor?: Editor) => DomSerializer; StyleSheetLoader: (documentOrShadowRoot: Document | ShadowRoot, settings: StyleSheetLoaderSettings) => StyleSheetLoader; - Event: EventUtils; + TextSeeker: (dom: DOMUtils, isBlockBoundary?: (node: Node) => boolean) => TextSeeker; + TreeWalker: DomTreeWalkerConstructor; }; html: { - Styles: (settings?: StylesSettings, schema?: Schema) => Styles; + DomParser: (settings?: DomParserSettings, schema?: Schema) => DomParser; Entities: Entities; Node: AstNodeConstructor; Schema: (settings?: SchemaSettings) => Schema; - DomParser: (settings?: DomParserSettings, schema?: Schema) => DomParser; - Writer: (settings?: WriterSettings) => Writer; Serializer: (settings?: HtmlSerializerSettings, schema?: Schema) => HtmlSerializer; + Styles: (settings?: StylesSettings, schema?: Schema) => Styles; + Writer: (settings?: WriterSettings) => Writer; }; AddOnManager: AddOnManagerNamespace; Annotator: (editor: Editor) => Annotator; @@ -3347,4 +3350,4 @@ interface TinyMCE extends EditorManager { _addCacheSuffix: Tools['_addCacheSuffix']; } declare const tinymce: TinyMCE; -export { AddOnManager, Annotator, AstNode, Bookmark, BookmarkManager, ControlSelection, DOMUtils, Delay, DomParser, DomParserSettings, DomSerializer, DomSerializerSettings, DomTreeWalker, Editor, EditorCommands, EditorEvent, EditorManager, EditorModeApi, EditorObservable, EditorOptions, EditorSelection, Entities, Env, EventDispatcher, EventUtils, EventTypes_d as Events, FakeClipboard, FocusManager, Format_d as Formats, Formatter, GeomRect, HtmlSerializer, HtmlSerializerSettings, I18n, IconManager, Model, ModelManager, NotificationApi, NotificationManager, NotificationSpec, Observable, Plugin, PluginManager, RangeUtils, RawEditorOptions, Rect, Resource, Schema, SchemaSettings, ScriptLoader, Shortcuts, StyleSheetLoader, Styles, TextPatterns_d as TextPatterns, TextSeeker, Theme, ThemeManager, TinyMCE, Tools, URI, Ui_d as Ui, UndoManager, VK, WindowManager, Writer, WriterSettings, tinymce as default }; +export { AddOnManager, Annotator, AstNode, Bookmark, BookmarkManager, ControlSelection, tinymce as default, Delay, DomParser, DomParserSettings, DomSerializer, DomSerializerSettings, DomTreeWalker, DOMUtils, Editor, EditorCommands, EditorEvent, EditorManager, EditorModeApi, EditorObservable, EditorOptions, EditorSelection, Entities, Env, EventDispatcher, EventTypes_d as Events, EventUtils, FakeClipboard, FocusManager, Format_d as Formats, Formatter, GeomRect, HtmlSerializer, HtmlSerializerSettings, I18n, IconManager, Model, ModelManager, NotificationApi, NotificationManager, NotificationSpec, Observable, Plugin, PluginManager, RangeUtils, RawEditorOptions, Rect, Resource, Schema, SchemaSettings, ScriptLoader, Shortcuts, Styles, StyleSheetLoader, TextPatterns_d as TextPatterns, TextSeeker, Theme, ThemeManager, TinyMCE, Tools, Ui_d as Ui, UndoManager, URI, VK, WindowManager, Writer, WriterSettings }; diff --git a/apps/web-antd/src/adapter/component/index.ts b/apps/web-antd/src/adapter/component/index.ts index 698f5c7861807c27ede690bf875b8a6055d0371b..9cc430135ad21d3b2173bf4aee39e34a26d8c9b5 100644 --- a/apps/web-antd/src/adapter/component/index.ts +++ b/apps/web-antd/src/adapter/component/index.ts @@ -115,7 +115,9 @@ export type ComponentType = | 'DatePicker' | 'DefaultButton' | 'Divider' + | 'FileUpload' | 'IconPicker' + | 'ImageUpload' | 'Input' | 'InputNumber' | 'InputPassword' @@ -125,16 +127,14 @@ export type ComponentType = | 'RadioGroup' | 'RangePicker' | 'Rate' + | 'RichTextarea' | 'Select' | 'Space' | 'Switch' | 'Textarea' - | 'RichTextarea' | 'TimePicker' | 'TreeSelect' | 'Upload' - | 'FileUpload' - | 'ImageUpload' | BaseFormComponentType; async function initComponentAdapter() { diff --git a/apps/web-antd/src/adapter/vxe-table.ts b/apps/web-antd/src/adapter/vxe-table.ts index c773cea4a2b70a5defa639dc72670e50a6d0bf90..545245a78621f6f6a22c8cb8c717cba1e7284af2 100644 --- a/apps/web-antd/src/adapter/vxe-table.ts +++ b/apps/web-antd/src/adapter/vxe-table.ts @@ -1,3 +1,5 @@ +import type { Recordable } from '@vben/types'; + import { h } from 'vue'; import { IconifyIcon } from '@vben/icons'; @@ -6,12 +8,11 @@ import { setupVbenVxeTable, useVbenVxeGrid } from '@vben/plugins/vxe-table'; import { isFunction, isString } from '@vben/utils'; import { Button, Image, Popconfirm, Switch } from 'ant-design-vue'; + import { DictTag } from '#/components/dict-tag'; +import { $t } from '#/locales'; import { useVbenForm } from './form'; -import type { Recordable } from '@vben/types'; - -import { $t } from '#/locales'; setupVbenVxeTable({ configVxeTable: (vxeUI) => { @@ -162,10 +163,10 @@ setupVbenVxeTable({ return presets[opt] ? { code: opt, ...presets[opt], ...defaultProps } : { - code: opt, - text: $te(`common.${opt}`) ? $t(`common.${opt}`) : opt, - ...defaultProps, - }; + code: opt, + text: $te(`common.${opt}`) ? $t(`common.${opt}`) : opt, + ...defaultProps, + }; } else { return { ...defaultProps, ...presets[opt.code], ...opt }; } @@ -188,10 +189,10 @@ setupVbenVxeTable({ icon: undefined, onClick: listen ? () => - attrs?.onClick?.({ - code: opt.code, - row, - }) + attrs?.onClick?.({ + code: opt.code, + row, + }) : undefined, }, { diff --git a/apps/web-antd/src/api/bpm/category/index.ts b/apps/web-antd/src/api/bpm/category/index.ts index d9926a3a800a2aac528667a7a9b3612e7236b130..852b2a8686a20eb8e2479995b6ddcde581477fd0 100644 --- a/apps/web-antd/src/api/bpm/category/index.ts +++ b/apps/web-antd/src/api/bpm/category/index.ts @@ -15,12 +15,17 @@ export namespace BpmCategoryApi { /** 查询流程分类分页 */ export async function getCategoryPage(params: PageParam) { - return requestClient.get>('/bpm/category/page', { params }); + return requestClient.get>( + '/bpm/category/page', + { params }, + ); } /** 查询流程分类详情 */ export async function getCategory(id: number) { - return requestClient.get(`/bpm/category/get?id=${id}`); + return requestClient.get( + `/bpm/category/get?id=${id}`, + ); } /** 新增流程分类 */ diff --git a/apps/web-antd/src/api/core/auth.ts b/apps/web-antd/src/api/core/auth.ts index 809f29cdc73a1f624283c78c2722f7b300da742b..c71f5f598892bca445521c588abdb2d7fbe30a3e 100644 --- a/apps/web-antd/src/api/core/auth.ts +++ b/apps/web-antd/src/api/core/auth.ts @@ -1,6 +1,7 @@ -import { baseRequestClient, requestClient } from '#/api/request'; import type { AuthPermissionInfo } from '@vben/types'; +import { baseRequestClient, requestClient } from '#/api/request'; + export namespace AuthApi { /** 登录接口参数 */ export interface LoginParams { @@ -41,9 +42,9 @@ export namespace AuthApi { /** 注册接口参数 */ export interface RegisterParams { - username: string - password: string - captchaVerification: string + username: string; + password: string; + captchaVerification: string; } /** 重置密码接口参数 */ @@ -68,16 +69,22 @@ export async function loginApi(data: AuthApi.LoginParams) { /** 刷新 accessToken */ export async function refreshTokenApi(refreshToken: string) { - return baseRequestClient.post(`/system/auth/refresh-token?refreshToken=${refreshToken}`); + return baseRequestClient.post( + `/system/auth/refresh-token?refreshToken=${refreshToken}`, + ); } /** 退出登录 */ export async function logoutApi(accessToken: string) { - return baseRequestClient.post('/system/auth/logout', {}, { - headers: { - Authorization: `Bearer ${accessToken}`, - } - }); + return baseRequestClient.post( + '/system/auth/logout', + {}, + { + headers: { + Authorization: `Bearer ${accessToken}`, + }, + }, + ); } /** 获取权限信息 */ @@ -96,7 +103,9 @@ export async function getTenantSimpleList() { /** 使用租户域名,获得租户信息 */ export async function getTenantByWebsite(website: string) { - return requestClient.get(`/system/tenant/get-by-website?website=${website}`); + return requestClient.get( + `/system/tenant/get-by-website?website=${website}`, + ); } /** 获取验证码 */ @@ -111,23 +120,23 @@ export async function checkCaptcha(data: any) { /** 获取登录验证码 */ export const sendSmsCode = (data: AuthApi.SmsCodeParams) => { - return requestClient.post('/system/auth/send-sms-code', data ) -} + return requestClient.post('/system/auth/send-sms-code', data); +}; /** 短信验证码登录 */ export const smsLogin = (data: AuthApi.SmsLoginParams) => { - return requestClient.post('/system/auth/sms-login', data) -} + return requestClient.post('/system/auth/sms-login', data); +}; /** 注册 */ export const register = (data: AuthApi.RegisterParams) => { - return requestClient.post('/system/auth/register', data) -} + return requestClient.post('/system/auth/register', data); +}; /** 通过短信重置密码 */ export const smsResetPassword = (data: AuthApi.ResetPasswordParams) => { - return requestClient.post('/system/auth/reset-password', data) -} + return requestClient.post('/system/auth/reset-password', data); +}; /** 社交授权的跳转 */ export const socialAuthRedirect = (type: number, redirectUri: string) => { @@ -137,9 +146,12 @@ export const socialAuthRedirect = (type: number, redirectUri: string) => { redirectUri, }, }); -} +}; /** 社交快捷登录 */ export const socialLogin = (data: AuthApi.SocialLoginParams) => { - return requestClient.post('/system/auth/social-login', data); -} + return requestClient.post( + '/system/auth/social-login', + data, + ); +}; diff --git a/apps/web-antd/src/api/infra/api-access-log/index.ts b/apps/web-antd/src/api/infra/api-access-log/index.ts index 4eb727fb7c18b325bfef86dae657296c05044fcb..8c19debd3e93d728878e18d2985a99d760f00a8e 100644 --- a/apps/web-antd/src/api/infra/api-access-log/index.ts +++ b/apps/web-antd/src/api/infra/api-access-log/index.ts @@ -32,11 +32,13 @@ export namespace InfraApiAccessLogApi { export function getApiAccessLogPage(params: PageParam) { return requestClient.get>( '/infra/api-access-log/page', - { params } + { params }, ); } /** 导出 API 访问日志 */ export function exportApiAccessLog(params: any) { - return requestClient.download('/infra/api-access-log/export-excel', { params }); + return requestClient.download('/infra/api-access-log/export-excel', { + params, + }); } diff --git a/apps/web-antd/src/api/infra/api-error-log/index.ts b/apps/web-antd/src/api/infra/api-error-log/index.ts index dcca22c5ffe6c9bd5ea0f2095e4c237243090802..4408d4cc197adfedcce5f1b255ffae7de5fb1311 100644 --- a/apps/web-antd/src/api/infra/api-error-log/index.ts +++ b/apps/web-antd/src/api/infra/api-error-log/index.ts @@ -36,16 +36,20 @@ export namespace InfraApiErrorLogApi { export function getApiErrorLogPage(params: PageParam) { return requestClient.get>( '/infra/api-error-log/page', - { params } + { params }, ); } /** 更新 API 错误日志的处理状态 */ export function updateApiErrorLogStatus(id: number, processStatus: number) { - return requestClient.put(`/infra/api-error-log/update-status?id=${id}&processStatus=${processStatus}`); + return requestClient.put( + `/infra/api-error-log/update-status?id=${id}&processStatus=${processStatus}`, + ); } /** 导出 API 错误日志 */ export function exportApiErrorLog(params: any) { - return requestClient.download('/infra/api-error-log/export-excel', { params }); + return requestClient.download('/infra/api-error-log/export-excel', { + params, + }); } diff --git a/apps/web-antd/src/api/infra/codegen/index.ts b/apps/web-antd/src/api/infra/codegen/index.ts index 6f3969fb00ef118f20d8e54cc8e5ad2b599d8b95..d8fea0453125d7e1ecbf1acee2afacd22b7621f2 100644 --- a/apps/web-antd/src/api/infra/codegen/index.ts +++ b/apps/web-antd/src/api/infra/codegen/index.ts @@ -79,21 +79,30 @@ export namespace InfraCodegenApi { /** 查询列表代码生成表定义 */ export function getCodegenTableList(dataSourceConfigId: number) { - return requestClient.get('/infra/codegen/table/list?', { - params: { dataSourceConfigId }, - }); + return requestClient.get( + '/infra/codegen/table/list?', + { + params: { dataSourceConfigId }, + }, + ); } /** 查询列表代码生成表定义 */ export function getCodegenTablePage(params: PageParam) { - return requestClient.get>('/infra/codegen/table/page', { params }); + return requestClient.get>( + '/infra/codegen/table/page', + { params }, + ); } /** 查询详情代码生成表定义 */ export function getCodegenTable(tableId: number) { - return requestClient.get('/infra/codegen/detail', { - params: { tableId }, - }); + return requestClient.get( + '/infra/codegen/detail', + { + params: { tableId }, + }, + ); } /** 修改代码生成表定义 */ @@ -110,9 +119,12 @@ export function syncCodegenFromDB(tableId: number) { /** 预览生成代码 */ export function previewCodegen(tableId: number) { - return requestClient.get('/infra/codegen/preview', { - params: { tableId }, - }); + return requestClient.get( + '/infra/codegen/preview', + { + params: { tableId }, + }, + ); } /** 下载生成代码 */ @@ -124,11 +136,16 @@ export function downloadCodegen(tableId: number) { /** 获得表定义 */ export function getSchemaTableList(params: any) { - return requestClient.get('/infra/codegen/db/table/list', { params }); + return requestClient.get( + '/infra/codegen/db/table/list', + { params }, + ); } /** 基于数据库的表结构,创建代码生成器的表定义 */ -export function createCodegenList(data: InfraCodegenApi.CodegenCreateListReqVO) { +export function createCodegenList( + data: InfraCodegenApi.CodegenCreateListReqVO, +) { return requestClient.post('/infra/codegen/create-list', data); } diff --git a/apps/web-antd/src/api/infra/config/index.ts b/apps/web-antd/src/api/infra/config/index.ts index 059579f2355d7c41bb389935fa931d67f5bf1b7c..a482234c1b4d5cace6194efac2397c6c6cd121b8 100644 --- a/apps/web-antd/src/api/infra/config/index.ts +++ b/apps/web-antd/src/api/infra/config/index.ts @@ -1,6 +1,7 @@ -import { requestClient } from '#/api/request'; import type { PageParam, PageResult } from '@vben/request'; +import { requestClient } from '#/api/request'; + export namespace InfraConfigApi { /** 参数配置信息 */ export interface InfraConfig { @@ -18,19 +19,26 @@ export namespace InfraConfigApi { /** 查询参数列表 */ export function getConfigPage(params: PageParam) { - return requestClient.get>('/infra/config/page', { - params - }); + return requestClient.get>( + '/infra/config/page', + { + params, + }, + ); } /** 查询参数详情 */ export function getConfig(id: number) { - return requestClient.get(`/infra/config/get?id=${id}`); + return requestClient.get( + `/infra/config/get?id=${id}`, + ); } /** 根据参数键名查询参数值 */ export function getConfigKey(configKey: string) { - return requestClient.get(`/infra/config/get-value-by-key?key=${configKey}`); + return requestClient.get( + `/infra/config/get-value-by-key?key=${configKey}`, + ); } /** 新增参数 */ @@ -51,6 +59,6 @@ export function deleteConfig(id: number) { /** 导出参数 */ export function exportConfig(params: any) { return requestClient.download('/infra/config/export', { - params + params, }); } diff --git a/apps/web-antd/src/api/infra/data-source-config/index.ts b/apps/web-antd/src/api/infra/data-source-config/index.ts index 2b9b7617b529a9bae64dda5d52ce364d3e0d4922..624e7892da3d24da269cea5d7f54424233ef8672 100644 --- a/apps/web-antd/src/api/infra/data-source-config/index.ts +++ b/apps/web-antd/src/api/infra/data-source-config/index.ts @@ -14,25 +14,33 @@ export namespace InfraDataSourceConfigApi { /** 查询数据源配置列表 */ export function getDataSourceConfigList() { - return requestClient.get('/infra/data-source-config/list'); + return requestClient.get( + '/infra/data-source-config/list', + ); } /** 查询数据源配置详情 */ export function getDataSourceConfig(id: number) { - return requestClient.get(`/infra/data-source-config/get?id=${id}`); + return requestClient.get( + `/infra/data-source-config/get?id=${id}`, + ); } /** 新增数据源配置 */ -export function createDataSourceConfig(data: InfraDataSourceConfigApi.InfraDataSourceConfig) { +export function createDataSourceConfig( + data: InfraDataSourceConfigApi.InfraDataSourceConfig, +) { return requestClient.post('/infra/data-source-config/create', data); } /** 修改数据源配置 */ -export function updateDataSourceConfig(data: InfraDataSourceConfigApi.InfraDataSourceConfig) { +export function updateDataSourceConfig( + data: InfraDataSourceConfigApi.InfraDataSourceConfig, +) { return requestClient.put('/infra/data-source-config/update', data); } /** 删除数据源配置 */ export function deleteDataSourceConfig(id: number) { return requestClient.delete(`/infra/data-source-config/delete?id=${id}`); -} \ No newline at end of file +} diff --git a/apps/web-antd/src/api/infra/demo/demo01/index.ts b/apps/web-antd/src/api/infra/demo/demo01/index.ts index 2871175849e6e45fe2540a642ff693f663c07ac1..b03a2aef041c32823039cd9a71933e3b818ad8a5 100644 --- a/apps/web-antd/src/api/infra/demo/demo01/index.ts +++ b/apps/web-antd/src/api/infra/demo/demo01/index.ts @@ -16,12 +16,17 @@ export namespace Demo01ContactApi { /** 查询示例联系人分页 */ export function getDemo01ContactPage(params: PageParam) { - return requestClient.get>('/infra/demo01-contact/page', { params }); + return requestClient.get>( + '/infra/demo01-contact/page', + { params }, + ); } /** 查询示例联系人详情 */ export function getDemo01Contact(id: number) { - return requestClient.get(`/infra/demo01-contact/get?id=${id}`); + return requestClient.get( + `/infra/demo01-contact/get?id=${id}`, + ); } /** 新增示例联系人 */ diff --git a/apps/web-antd/src/api/infra/demo/demo02/index.ts b/apps/web-antd/src/api/infra/demo/demo02/index.ts index c231f8d949928df96ddc470a971555830f332be8..45fcb148df94eefbcdec64638ef99394a4fa1b98 100644 --- a/apps/web-antd/src/api/infra/demo/demo02/index.ts +++ b/apps/web-antd/src/api/infra/demo/demo02/index.ts @@ -12,12 +12,17 @@ export namespace Demo02CategoryApi { /** 查询示例分类列表 */ export function getDemo02CategoryList(params: any) { - return requestClient.get('/infra/demo02-category/list', { params }); + return requestClient.get( + '/infra/demo02-category/list', + { params }, + ); } /** 查询示例分类详情 */ export function getDemo02Category(id: number) { - return requestClient.get(`/infra/demo02-category/get?id=${id}`); + return requestClient.get( + `/infra/demo02-category/get?id=${id}`, + ); } /** 新增示例分类 */ diff --git a/apps/web-antd/src/api/infra/demo/demo03/inner/index.ts b/apps/web-antd/src/api/infra/demo/demo03/inner/index.ts index bda93c5cbc873fa7f544d0a1a8a5ec4bd10cfe23..d55f8795dbe5118573077d39c6f980185e1218b4 100644 --- a/apps/web-antd/src/api/infra/demo/demo03/inner/index.ts +++ b/apps/web-antd/src/api/infra/demo/demo03/inner/index.ts @@ -32,12 +32,17 @@ export namespace Demo03StudentApi { /** 查询学生分页 */ export function getDemo03StudentPage(params: PageParam) { - return requestClient.get>('/infra/demo03-student/page', { params }); + return requestClient.get>( + '/infra/demo03-student/page', + { params }, + ); } /** 查询学生详情 */ export function getDemo03Student(id: number) { - return requestClient.get(`/infra/demo03-student/get?id=${id}`); + return requestClient.get( + `/infra/demo03-student/get?id=${id}`, + ); } /** 新增学生 */ diff --git a/apps/web-antd/src/api/infra/demo/demo03/normal/index.ts b/apps/web-antd/src/api/infra/demo/demo03/normal/index.ts index 85352c516a5cf5893239395d2508c888cc2337ab..607ba183de8ac4412408288591d19d60ae1e7e21 100644 --- a/apps/web-antd/src/api/infra/demo/demo03/normal/index.ts +++ b/apps/web-antd/src/api/infra/demo/demo03/normal/index.ts @@ -31,12 +31,17 @@ export namespace Demo03StudentApi { /** 查询学生分页 */ export function getDemo03StudentPage(params: PageParam) { - return requestClient.get>('/infra/demo03-student/page', { params }); + return requestClient.get>( + '/infra/demo03-student/page', + { params }, + ); } /** 查询学生详情 */ export function getDemo03Student(id: number) { - return requestClient.get(`/infra/demo03-student/get?id=${id}`); + return requestClient.get( + `/infra/demo03-student/get?id=${id}`, + ); } /** 新增学生 */ diff --git a/apps/web-antd/src/api/infra/file-config/index.ts b/apps/web-antd/src/api/infra/file-config/index.ts index d5992d3f085f71d94d7a6abd0ca46a8687834319..9e7c23b226d6a8b25f33826818d1cdd9e98627f4 100644 --- a/apps/web-antd/src/api/infra/file-config/index.ts +++ b/apps/web-antd/src/api/infra/file-config/index.ts @@ -1,6 +1,7 @@ -import { requestClient } from '#/api/request'; import type { PageParam, PageResult } from '@vben/request'; +import { requestClient } from '#/api/request'; + export namespace InfraFileConfigApi { /** 文件客户端配置 */ export interface FileClientConfig { @@ -32,14 +33,19 @@ export namespace InfraFileConfigApi { /** 查询文件配置列表 */ export function getFileConfigPage(params: PageParam) { - return requestClient.get>('/infra/file-config/page', { - params - }); + return requestClient.get>( + '/infra/file-config/page', + { + params, + }, + ); } /** 查询文件配置详情 */ export function getFileConfig(id: number) { - return requestClient.get(`/infra/file-config/get?id=${id}`); + return requestClient.get( + `/infra/file-config/get?id=${id}`, + ); } /** 更新文件配置为主配置 */ diff --git a/apps/web-antd/src/api/infra/file/index.ts b/apps/web-antd/src/api/infra/file/index.ts index 15ce8fae3c2cd056af92db336a3384ce869b76ed..e4c6975e7c3b4620b5c6ef368c65153f906e511c 100644 --- a/apps/web-antd/src/api/infra/file/index.ts +++ b/apps/web-antd/src/api/infra/file/index.ts @@ -1,6 +1,6 @@ +import type { AxiosRequestConfig, PageParam, PageResult } from '@vben/request'; + import { requestClient } from '#/api/request'; -import type { PageParam, PageResult } from '@vben/request'; -import type { AxiosRequestConfig } from '@vben/request'; /** Axios 上传进度事件 */ export type AxiosProgressEvent = AxiosRequestConfig['onUploadProgress']; @@ -34,9 +34,12 @@ export namespace InfraFileApi { /** 查询文件列表 */ export function getFilePage(params: PageParam) { - return requestClient.get>('/infra/file/page', { - params - }); + return requestClient.get>( + '/infra/file/page', + { + params, + }, + ); } /** 删除文件 */ @@ -46,9 +49,12 @@ export function deleteFile(id: number) { /** 获取文件预签名地址 */ export function getFilePresignedUrl(path: string) { - return requestClient.get('/infra/file/presigned-url', { - params: { path } - }); + return requestClient.get( + '/infra/file/presigned-url', + { + params: { path }, + }, + ); } /** 创建文件 */ @@ -57,6 +63,9 @@ export function createFile(data: InfraFileApi.InfraFile) { } /** 上传文件 */ -export function uploadFile(data: InfraFileApi.FileUploadReqVO, onUploadProgress?: AxiosProgressEvent) { +export function uploadFile( + data: InfraFileApi.FileUploadReqVO, + onUploadProgress?: AxiosProgressEvent, +) { return requestClient.upload('/infra/file/upload', data, { onUploadProgress }); } diff --git a/apps/web-antd/src/api/infra/job-log/index.ts b/apps/web-antd/src/api/infra/job-log/index.ts index f2c756d6109372f562603af1d7b5dcb1ad17fbc4..d94af28cf444cfb7ee8268f674c11df33012a45c 100644 --- a/apps/web-antd/src/api/infra/job-log/index.ts +++ b/apps/web-antd/src/api/infra/job-log/index.ts @@ -22,12 +22,17 @@ export namespace InfraJobLogApi { /** 查询任务日志列表 */ export function getJobLogPage(params: PageParam) { - return requestClient.get>('/infra/job-log/page', { params }); + return requestClient.get>( + '/infra/job-log/page', + { params }, + ); } /** 查询任务日志详情 */ export function getJobLog(id: number) { - return requestClient.get(`/infra/job-log/get?id=${id}`); + return requestClient.get( + `/infra/job-log/get?id=${id}`, + ); } /** 导出定时任务日志 */ diff --git a/apps/web-antd/src/api/infra/job/index.ts b/apps/web-antd/src/api/infra/job/index.ts index 702446921b614d633162cd8393700dc9e9c7f96f..09366d830acefdcd4bd427bf187fdf4d11eb4ccf 100644 --- a/apps/web-antd/src/api/infra/job/index.ts +++ b/apps/web-antd/src/api/infra/job/index.ts @@ -20,7 +20,10 @@ export namespace InfraJobApi { /** 查询任务列表 */ export function getJobPage(params: PageParam) { - return requestClient.get>('/infra/job/page', { params }); + return requestClient.get>( + '/infra/job/page', + { params }, + ); } /** 查询任务详情 */ @@ -52,7 +55,7 @@ export function exportJob(params: any) { export function updateJobStatus(id: number, status: number) { const params = { id, - status + status, }; return requestClient.put('/infra/job/update-status', { params }); } diff --git a/apps/web-antd/src/api/infra/redis/index.ts b/apps/web-antd/src/api/infra/redis/index.ts index 6a22028337d6f9134a219888ce5dc0a8b4e75a8b..7f43e6e2ae983d681d50a198eee5b275d95b9c41 100644 --- a/apps/web-antd/src/api/infra/redis/index.ts +++ b/apps/web-antd/src/api/infra/redis/index.ts @@ -1,13 +1,6 @@ import { requestClient } from '#/api/request'; export namespace InfraRedisApi { - /** Redis 监控信息 */ - export interface InfraRedisMonitorInfo { - info: InfraRedisInfo; - dbSize: number; - commandStats: InfraRedisCommandStats[]; - } - /** Redis 信息 */ export interface InfraRedisInfo { io_threaded_reads_processed: string; @@ -180,9 +173,18 @@ export namespace InfraRedisApi { calls: number; usec: number; } + + /** Redis 监控信息 */ + export interface InfraRedisMonitorInfo { + info: InfraRedisInfo; + dbSize: number; + commandStats: InfraRedisCommandStats[]; + } } /** 获取 Redis 监控信息 */ export function getRedisMonitorInfo() { - return requestClient.get('/infra/redis/get-monitor-info'); + return requestClient.get( + '/infra/redis/get-monitor-info', + ); } diff --git a/apps/web-antd/src/api/request.ts b/apps/web-antd/src/api/request.ts index 8c36097ffd92d9d802b1993558dfe0f65261cb00..c2c7f994416bf7e24351f7d32a1a1f887632723b 100644 --- a/apps/web-antd/src/api/request.ts +++ b/apps/web-antd/src/api/request.ts @@ -19,7 +19,10 @@ import { useAuthStore } from '#/store'; import { refreshTokenApi } from './core'; -const { apiURL, tenantEnable } = useAppConfig(import.meta.env, import.meta.env.PROD); +const { apiURL, tenantEnable } = useAppConfig( + import.meta.env, + import.meta.env.PROD, +); function createRequestClient(baseURL: string, options?: RequestClientOptions) { const client = new RequestClient({ @@ -76,7 +79,9 @@ function createRequestClient(baseURL: string, options?: RequestClientOptions) { config.headers.Authorization = formatToken(accessStore.accessToken); config.headers['Accept-Language'] = preferences.app.locale; // 添加租户编号 - config.headers['tenant-id'] = tenantEnable ? accessStore.tenantId : undefined; + config.headers['tenant-id'] = tenantEnable + ? accessStore.tenantId + : undefined; return config; }, }); @@ -130,7 +135,9 @@ baseRequestClient.addRequestInterceptor({ fulfilled: (config) => { const accessStore = useAccessStore(); // 添加租户编号 - config.headers['tenant-id'] = tenantEnable? accessStore.tenantId : undefined; + config.headers['tenant-id'] = tenantEnable + ? accessStore.tenantId + : undefined; return config; }, }); diff --git a/apps/web-antd/src/api/system/dept/index.ts b/apps/web-antd/src/api/system/dept/index.ts index f79c9c7585119ddc851b8ce9e092a328bea27f52..ff0c4a58290b4e256adb407201e81fd2d7602894 100644 --- a/apps/web-antd/src/api/system/dept/index.ts +++ b/apps/web-antd/src/api/system/dept/index.ts @@ -18,7 +18,9 @@ export namespace SystemDeptApi { /** 查询部门(精简)列表 */ export async function getSimpleDeptList() { - return requestClient.get('/system/dept/simple-list'); + return requestClient.get( + '/system/dept/simple-list', + ); } /** 查询部门列表 */ @@ -28,7 +30,9 @@ export async function getDeptList() { /** 查询部门详情 */ export async function getDept(id: number) { - return requestClient.get(`/system/dept/get?id=${id}`); + return requestClient.get( + `/system/dept/get?id=${id}`, + ); } /** 新增部门 */ diff --git a/apps/web-antd/src/api/system/dict/data/index.ts b/apps/web-antd/src/api/system/dict/data/index.ts index 5cf156172a242121edaf862deb1ebaefd2ca6429..958ad15a9c7a95cf2edbd0bf77f9c4e78ba1cb62 100644 --- a/apps/web-antd/src/api/system/dict/data/index.ts +++ b/apps/web-antd/src/api/system/dict/data/index.ts @@ -3,16 +3,16 @@ import { requestClient } from '#/api/request'; export namespace SystemDictDataApi { /** 字典数据 */ export type SystemDictData = { - id?: number; colorType: string; + createTime: Date; cssClass: string; dictType: string; + id?: number; label: string; remark: string; sort?: number; status: number; value: string; - createTime: Date; }; } diff --git a/apps/web-antd/src/api/system/dict/type/index.ts b/apps/web-antd/src/api/system/dict/type/index.ts index bf4e93586f937288c59f2a67aadddbdae97582a1..8117663dcef396f6e6b64212c3f69e23d6033b7c 100644 --- a/apps/web-antd/src/api/system/dict/type/index.ts +++ b/apps/web-antd/src/api/system/dict/type/index.ts @@ -1,14 +1,23 @@ import { requestClient } from '#/api/request'; +export type DictTypeVO = { + createTime: Date; + id: number | undefined; + name: string; + remark: string; + status: number; + type: string; +}; + export namespace SystemDictTypeApi { /** 字典类型 */ export type SystemDictType = { + createTime: Date; id?: number; name: string; remark: string; status: number; type: string; - createTime: Date; }; } diff --git a/apps/web-antd/src/api/system/login-log/index.ts b/apps/web-antd/src/api/system/login-log/index.ts index 5b1bfdf061e11e9bb72ac66e1243002d2c1c612b..fca8266a8dd74c6053f1019a5c00aede4f618489 100644 --- a/apps/web-antd/src/api/system/login-log/index.ts +++ b/apps/web-antd/src/api/system/login-log/index.ts @@ -21,8 +21,9 @@ export namespace SystemLoginLogApi { /** 查询登录日志列表 */ export function getLoginLogPage(params: PageParam) { - return requestClient.get>('/system/login-log/page', - { params } + return requestClient.get>( + '/system/login-log/page', + { params }, ); } diff --git a/apps/web-antd/src/api/system/mail/account/index.ts b/apps/web-antd/src/api/system/mail/account/index.ts index dc488c35c75f74109bcef126afdfdfcd8e7c85eb..a37146c5838bc951e14f50f0d2c1978946d0391f 100644 --- a/apps/web-antd/src/api/system/mail/account/index.ts +++ b/apps/web-antd/src/api/system/mail/account/index.ts @@ -23,22 +23,28 @@ export namespace SystemMailAccountApi { export function getMailAccountPage(params: PageParam) { return requestClient.get>( '/system/mail-account/page', - { params } + { params }, ); } /** 查询邮箱账号详情 */ export function getMailAccount(id: number) { - return requestClient.get(`/system/mail-account/get?id=${id}`); + return requestClient.get( + `/system/mail-account/get?id=${id}`, + ); } /** 新增邮箱账号 */ -export function createMailAccount(data: SystemMailAccountApi.SystemMailAccount) { +export function createMailAccount( + data: SystemMailAccountApi.SystemMailAccount, +) { return requestClient.post('/system/mail-account/create', data); } /** 修改邮箱账号 */ -export function updateMailAccount(data: SystemMailAccountApi.SystemMailAccount) { +export function updateMailAccount( + data: SystemMailAccountApi.SystemMailAccount, +) { return requestClient.put('/system/mail-account/update', data); } @@ -49,5 +55,7 @@ export function deleteMailAccount(id: number) { /** 获得邮箱账号精简列表 */ export function getSimpleMailAccountList() { - return requestClient.get('/system/mail-account/simple-list'); + return requestClient.get( + '/system/mail-account/simple-list', + ); } diff --git a/apps/web-antd/src/api/system/mail/log/index.ts b/apps/web-antd/src/api/system/mail/log/index.ts index b328d2ce9d2a7d8cb0cc90266248a4d0bd79c5e4..acd4e8e4ed6f09f44e09de168fa3f3b8d489b027 100644 --- a/apps/web-antd/src/api/system/mail/log/index.ts +++ b/apps/web-antd/src/api/system/mail/log/index.ts @@ -29,13 +29,15 @@ export namespace SystemMailLogApi { export function getMailLogPage(params: PageParam) { return requestClient.get>( '/system/mail-log/page', - { params } + { params }, ); } /** 查询邮件日志详情 */ export function getMailLog(id: number) { - return requestClient.get(`/system/mail-log/get?id=${id}`); + return requestClient.get( + `/system/mail-log/get?id=${id}`, + ); } /** 重新发送邮件 */ diff --git a/apps/web-antd/src/api/system/mail/template/index.ts b/apps/web-antd/src/api/system/mail/template/index.ts index 6dc0d2feecf808e6e2610a058c6bfc0ea656b70e..0e6dbf39baa8eae12d330d71b036514c753483ed 100644 --- a/apps/web-antd/src/api/system/mail/template/index.ts +++ b/apps/web-antd/src/api/system/mail/template/index.ts @@ -28,24 +28,29 @@ export namespace SystemMailTemplateApi { /** 查询邮件模版列表 */ export function getMailTemplatePage(params: PageParam) { - return requestClient.get>( - '/system/mail-template/page', - { params } - ); + return requestClient.get< + PageResult + >('/system/mail-template/page', { params }); } /** 查询邮件模版详情 */ export function getMailTemplate(id: number) { - return requestClient.get(`/system/mail-template/get?id=${id}`); + return requestClient.get( + `/system/mail-template/get?id=${id}`, + ); } /** 新增邮件模版 */ -export function createMailTemplate(data: SystemMailTemplateApi.SystemMailTemplate) { +export function createMailTemplate( + data: SystemMailTemplateApi.SystemMailTemplate, +) { return requestClient.post('/system/mail-template/create', data); } /** 修改邮件模版 */ -export function updateMailTemplate(data: SystemMailTemplateApi.SystemMailTemplate) { +export function updateMailTemplate( + data: SystemMailTemplateApi.SystemMailTemplate, +) { return requestClient.put('/system/mail-template/update', data); } diff --git a/apps/web-antd/src/api/system/menu/index.ts b/apps/web-antd/src/api/system/menu/index.ts index 7172b43e4a5cf8facc2ddd821995b4524fcc4666..39c2d861517318e4b5e4bdb59a5c11dd85fa8a7e 100644 --- a/apps/web-antd/src/api/system/menu/index.ts +++ b/apps/web-antd/src/api/system/menu/index.ts @@ -23,17 +23,23 @@ export namespace SystemMenuApi { /** 查询菜单(精简)列表 */ export async function getSimpleMenusList() { - return requestClient.get('/system/menu/simple-list'); + return requestClient.get( + '/system/menu/simple-list', + ); } /** 查询菜单列表 */ export async function getMenuList(params?: Record) { - return requestClient.get('/system/menu/list', { params }); + return requestClient.get('/system/menu/list', { + params, + }); } /** 获取菜单详情 */ export async function getMenu(id: number) { - return requestClient.get(`/system/menu/get?id=${id}`); + return requestClient.get( + `/system/menu/get?id=${id}`, + ); } /** 新增菜单 */ diff --git a/apps/web-antd/src/api/system/notice/index.ts b/apps/web-antd/src/api/system/notice/index.ts index 260bb501f3d3be492ff5997ece36d255c37f75d3..adf1187636319eb58c069dfd454e018885d200e6 100644 --- a/apps/web-antd/src/api/system/notice/index.ts +++ b/apps/web-antd/src/api/system/notice/index.ts @@ -1,6 +1,7 @@ -import { requestClient } from '#/api/request'; import type { PageParam, PageResult } from '@vben/request'; +import { requestClient } from '#/api/request'; + export namespace SystemNoticeApi { /** 公告信息 */ export interface SystemNotice { @@ -17,12 +18,17 @@ export namespace SystemNoticeApi { /** 查询公告列表 */ export function getNoticePage(params: PageParam) { - return requestClient.get>('/system/notice/page', { params }); + return requestClient.get>( + '/system/notice/page', + { params }, + ); } /** 查询公告详情 */ export function getNotice(id: number) { - return requestClient.get(`/system/notice/get?id=${id}`); + return requestClient.get( + `/system/notice/get?id=${id}`, + ); } /** 新增公告 */ diff --git a/apps/web-antd/src/api/system/notify/message/index.ts b/apps/web-antd/src/api/system/notify/message/index.ts index 5a5c2115458ef8251a2050254ba8d2543bcd1fc0..5306d2f0ddb79d501784854c7f99350508c9dcb8 100644 --- a/apps/web-antd/src/api/system/notify/message/index.ts +++ b/apps/web-antd/src/api/system/notify/message/index.ts @@ -22,18 +22,16 @@ export namespace SystemNotifyMessageApi { /** 查询站内信消息列表 */ export function getNotifyMessagePage(params: PageParam) { - return requestClient.get>( - '/system/notify-message/page', - { params }, - ); + return requestClient.get< + PageResult + >('/system/notify-message/page', { params }); } /** 获得我的站内信分页 */ export function getMyNotifyMessagePage(params: PageParam) { - return requestClient.get>( - '/system/notify-message/my-page', - { params }, - ); + return requestClient.get< + PageResult + >('/system/notify-message/my-page', { params }); } /** 批量标记已读 */ @@ -48,7 +46,9 @@ export function updateAllNotifyMessageRead() { /** 获取当前用户的最新站内信列表 */ export function getUnreadNotifyMessageList() { - return requestClient.get('/system/notify-message/get-unread-list'); + return requestClient.get( + '/system/notify-message/get-unread-list', + ); } /** 获得当前用户的未读站内信数量 */ diff --git a/apps/web-antd/src/api/system/notify/template/index.ts b/apps/web-antd/src/api/system/notify/template/index.ts index 7c33f1b8b458d22f07727e7b0d55e3bb83ee5479..1c32986ac575e0a7bf02d13b572ad8d5dafce73e 100644 --- a/apps/web-antd/src/api/system/notify/template/index.ts +++ b/apps/web-antd/src/api/system/notify/template/index.ts @@ -26,24 +26,29 @@ export namespace SystemNotifyTemplateApi { /** 查询站内信模板列表 */ export function getNotifyTemplatePage(params: PageParam) { - return requestClient.get>( - '/system/notify-template/page', - { params }, - ); + return requestClient.get< + PageResult + >('/system/notify-template/page', { params }); } /** 查询站内信模板详情 */ export function getNotifyTemplate(id: number) { - return requestClient.get(`/system/notify-template/get?id=${id}`); + return requestClient.get( + `/system/notify-template/get?id=${id}`, + ); } /** 新增站内信模板 */ -export function createNotifyTemplate(data: SystemNotifyTemplateApi.SystemNotifyTemplate) { +export function createNotifyTemplate( + data: SystemNotifyTemplateApi.SystemNotifyTemplate, +) { return requestClient.post('/system/notify-template/create', data); } /** 修改站内信模板 */ -export function updateNotifyTemplate(data: SystemNotifyTemplateApi.SystemNotifyTemplate) { +export function updateNotifyTemplate( + data: SystemNotifyTemplateApi.SystemNotifyTemplate, +) { return requestClient.put('/system/notify-template/update', data); } @@ -54,10 +59,14 @@ export function deleteNotifyTemplate(id: number) { /** 导出站内信模板 */ export function exportNotifyTemplate(params: any) { - return requestClient.download('/system/notify-template/export-excel', { params }); + return requestClient.download('/system/notify-template/export-excel', { + params, + }); } /** 发送站内信 */ -export function sendNotify(data: SystemNotifyTemplateApi.SystemNotifySendReqVO) { +export function sendNotify( + data: SystemNotifyTemplateApi.SystemNotifySendReqVO, +) { return requestClient.post('/system/notify-template/send-notify', data); } diff --git a/apps/web-antd/src/api/system/oauth2/client/index.ts b/apps/web-antd/src/api/system/oauth2/client/index.ts index 672eace83a4b28018fbfb587c5085cac32453e73..3c057b20bd510a99e904586c72c34ba49e0bd851 100644 --- a/apps/web-antd/src/api/system/oauth2/client/index.ts +++ b/apps/web-antd/src/api/system/oauth2/client/index.ts @@ -1,6 +1,7 @@ -import { requestClient } from '#/api/request'; import type { PageParam, PageResult } from '@vben/request'; +import { requestClient } from '#/api/request'; + export namespace SystemOAuth2ClientApi { /** OAuth2.0 客户端信息 */ export interface SystemOAuth2Client { @@ -27,23 +28,29 @@ export namespace SystemOAuth2ClientApi { /** 查询 OAuth2.0 客户端列表 */ export function getOAuth2ClientPage(params: PageParam) { - return requestClient.get>('/system/oauth2-client/page', - { params } - ); + return requestClient.get< + PageResult + >('/system/oauth2-client/page', { params }); } /** 查询 OAuth2.0 客户端详情 */ export function getOAuth2Client(id: number) { - return requestClient.get(`/system/oauth2-client/get?id=${id}`); + return requestClient.get( + `/system/oauth2-client/get?id=${id}`, + ); } /** 新增 OAuth2.0 客户端 */ -export function createOAuth2Client(data: SystemOAuth2ClientApi.SystemOAuth2Client) { +export function createOAuth2Client( + data: SystemOAuth2ClientApi.SystemOAuth2Client, +) { return requestClient.post('/system/oauth2-client/create', data); } /** 修改 OAuth2.0 客户端 */ -export function updateOAuth2Client(data: SystemOAuth2ClientApi.SystemOAuth2Client) { +export function updateOAuth2Client( + data: SystemOAuth2ClientApi.SystemOAuth2Client, +) { return requestClient.put('/system/oauth2-client/update', data); } diff --git a/apps/web-antd/src/api/system/oauth2/open/index.ts b/apps/web-antd/src/api/system/oauth2/open/index.ts index 7347001d551c21b6c9ae659fd5fd415f6fee3677..60dc88192c91f11a3abfab1b08186c88c617540e 100644 --- a/apps/web-antd/src/api/system/oauth2/open/index.ts +++ b/apps/web-antd/src/api/system/oauth2/open/index.ts @@ -3,8 +3,8 @@ import { requestClient } from '#/api/request'; /** OAuth2.0 授权信息响应 */ export interface OAuth2OpenAuthorizeInfoRespVO { client: { - name: string; logo: string; + name: string; }; scopes: { key: string; @@ -14,7 +14,9 @@ export interface OAuth2OpenAuthorizeInfoRespVO { /** 获得授权信息 */ export function getAuthorize(clientId: string) { - return requestClient.get(`/system/oauth2/authorize?clientId=${clientId}`); + return requestClient.get( + `/system/oauth2/authorize?clientId=${clientId}`, + ); } /** 发起授权 */ @@ -25,7 +27,7 @@ export function authorize( state: string, autoApprove: boolean, checkedScopes: string[], - uncheckedScopes: string[] + uncheckedScopes: string[], ) { // 构建 scopes const scopes: Record = {}; @@ -35,19 +37,19 @@ export function authorize( for (const scope of uncheckedScopes) { scopes[scope] = false; } - + // 发起请求 return requestClient.post('/system/oauth2/authorize', null, { headers: { - 'Content-Type': 'application/x-www-form-urlencoded' + 'Content-Type': 'application/x-www-form-urlencoded', }, params: { response_type: responseType, client_id: clientId, redirect_uri: redirectUri, - state: state, + state, auto_approve: autoApprove, - scope: JSON.stringify(scopes) - } + scope: JSON.stringify(scopes), + }, }); -} +} diff --git a/apps/web-antd/src/api/system/oauth2/token/index.ts b/apps/web-antd/src/api/system/oauth2/token/index.ts index 356537c481203d9bb01e4909bd24977d9733aa41..353cdcacce93f809047e4c019f008ebda22d5b7e 100644 --- a/apps/web-antd/src/api/system/oauth2/token/index.ts +++ b/apps/web-antd/src/api/system/oauth2/token/index.ts @@ -1,6 +1,7 @@ -import { requestClient } from '#/api/request'; import type { PageParam, PageResult } from '@vben/request'; +import { requestClient } from '#/api/request'; + export namespace SystemOAuth2TokenApi { /** OAuth2.0 令牌信息 */ export interface SystemOAuth2Token { @@ -17,12 +18,17 @@ export namespace SystemOAuth2TokenApi { /** 查询 OAuth2.0 令牌列表 */ export function getOAuth2TokenPage(params: PageParam) { - return requestClient.get>('/system/oauth2-token/page', { - params - }); + return requestClient.get>( + '/system/oauth2-token/page', + { + params, + }, + ); } /** 删除 OAuth2.0 令牌 */ export function deleteOAuth2Token(accessToken: string) { - return requestClient.delete(`/system/oauth2-token/delete?accessToken=${accessToken}`); + return requestClient.delete( + `/system/oauth2-token/delete?accessToken=${accessToken}`, + ); } diff --git a/apps/web-antd/src/api/system/operate-log/index.ts b/apps/web-antd/src/api/system/operate-log/index.ts index ab0cf45994ff1e475e834d74343ca37482cb101f..216d9cb90cf593735bc750e2353bab29581ee578 100644 --- a/apps/web-antd/src/api/system/operate-log/index.ts +++ b/apps/web-antd/src/api/system/operate-log/index.ts @@ -27,8 +27,9 @@ export namespace SystemOperateLogApi { /** 查询操作日志列表 */ export function getOperateLogPage(params: PageParam) { - return requestClient.get>('/system/operate-log/page', - { params } + return requestClient.get>( + '/system/operate-log/page', + { params }, ); } diff --git a/apps/web-antd/src/api/system/post/index.ts b/apps/web-antd/src/api/system/post/index.ts index 5caa023ff0f4d535f5cd28bfd56ed9c7c8c7cb6e..63201fd5b14cfc43b79f8e9d39a501b17f60cad2 100644 --- a/apps/web-antd/src/api/system/post/index.ts +++ b/apps/web-antd/src/api/system/post/index.ts @@ -1,5 +1,6 @@ +import type { PageParam, PageResult } from '@vben/request'; + import { requestClient } from '#/api/request'; -import type {PageParam, PageResult} from '@vben/request'; export namespace SystemPostApi { /** 岗位信息 */ @@ -16,19 +17,26 @@ export namespace SystemPostApi { /** 查询岗位列表 */ export function getPostPage(params: PageParam) { - return requestClient.get>('/system/post/page', { - params - }); + return requestClient.get>( + '/system/post/page', + { + params, + }, + ); } /** 获取岗位精简信息列表 */ export function getSimplePostList() { - return requestClient.get('/system/post/simple-list'); + return requestClient.get( + '/system/post/simple-list', + ); } - /** 查询岗位详情 */ +/** 查询岗位详情 */ export function getPost(id: number) { - return requestClient.get(`/system/post/get?id=${id}`); + return requestClient.get( + `/system/post/get?id=${id}`, + ); } /** 新增岗位 */ @@ -49,6 +57,6 @@ export function deletePost(id: number) { /** 导出岗位 */ export function exportPost(params: any) { return requestClient.download('/system/post/export', { - params + params, }); } diff --git a/apps/web-antd/src/api/system/role/index.ts b/apps/web-antd/src/api/system/role/index.ts index 4705d668b33ab7ce1b7d2f3bb4ddba328b9a4944..3a609075f7444ab75e6999ece71932c2b2188101 100644 --- a/apps/web-antd/src/api/system/role/index.ts +++ b/apps/web-antd/src/api/system/role/index.ts @@ -1,6 +1,7 @@ -import { requestClient } from '#/api/request'; import type { PageParam, PageResult } from '@vben/request'; +import { requestClient } from '#/api/request'; + export namespace SystemRoleApi { /** 角色信息 */ export interface SystemRole { @@ -18,17 +19,24 @@ export namespace SystemRoleApi { /** 查询角色列表 */ export function getRolePage(params: PageParam) { - return requestClient.get>('/system/role/page', { params }); + return requestClient.get>( + '/system/role/page', + { params }, + ); } /** 查询角色(精简)列表 */ export function getSimpleRoleList() { - return requestClient.get('/system/role/simple-list'); + return requestClient.get( + '/system/role/simple-list', + ); } /** 查询角色详情 */ export function getRole(id: number) { - return requestClient.get(`/system/role/get?id=${id}`); + return requestClient.get( + `/system/role/get?id=${id}`, + ); } /** 新增角色 */ diff --git a/apps/web-antd/src/api/system/sms/channel/index.ts b/apps/web-antd/src/api/system/sms/channel/index.ts index a6beb4e3db68cf688c6b0415523984843db4b01d..604014e1d3250a4b99ff5ab5d6eae2c4cc42f26e 100644 --- a/apps/web-antd/src/api/system/sms/channel/index.ts +++ b/apps/web-antd/src/api/system/sms/channel/index.ts @@ -27,12 +27,16 @@ export function getSmsChannelPage(params: PageParam) { /** 获得短信渠道精简列表 */ export function getSimpleSmsChannelList() { - return requestClient.get('/system/sms-channel/simple-list'); + return requestClient.get( + '/system/sms-channel/simple-list', + ); } /** 查询短信渠道详情 */ export function getSmsChannel(id: number) { - return requestClient.get(`/system/sms-channel/get?id=${id}`); + return requestClient.get( + `/system/sms-channel/get?id=${id}`, + ); } /** 新增短信渠道 */ diff --git a/apps/web-antd/src/api/system/sms/log/index.ts b/apps/web-antd/src/api/system/sms/log/index.ts index cea6cfbdf5910586dea8b6f127ec9e4cd2994db4..84bb52d6ce7e2dd4eda21be29ef1815b26c46290 100644 --- a/apps/web-antd/src/api/system/sms/log/index.ts +++ b/apps/web-antd/src/api/system/sms/log/index.ts @@ -33,7 +33,10 @@ export namespace SystemSmsLogApi { /** 查询短信日志列表 */ export function getSmsLogPage(params: PageParam) { - return requestClient.get>('/system/sms-log/page', { params }); + return requestClient.get>( + '/system/sms-log/page', + { params }, + ); } /** 导出短信日志 */ diff --git a/apps/web-antd/src/api/system/sms/template/index.ts b/apps/web-antd/src/api/system/sms/template/index.ts index e97bd3a8d394aae087dc19b2b3d3b166e17609bb..53e1ce9f4d323c9deeb5f99073c0dee72520e4eb 100644 --- a/apps/web-antd/src/api/system/sms/template/index.ts +++ b/apps/web-antd/src/api/system/sms/template/index.ts @@ -37,16 +37,22 @@ export function getSmsTemplatePage(params: PageParam) { /** 查询短信模板详情 */ export function getSmsTemplate(id: number) { - return requestClient.get(`/system/sms-template/get?id=${id}`); + return requestClient.get( + `/system/sms-template/get?id=${id}`, + ); } /** 新增短信模板 */ -export function createSmsTemplate(data: SystemSmsTemplateApi.SystemSmsTemplate) { +export function createSmsTemplate( + data: SystemSmsTemplateApi.SystemSmsTemplate, +) { return requestClient.post('/system/sms-template/create', data); } /** 修改短信模板 */ -export function updateSmsTemplate(data: SystemSmsTemplateApi.SystemSmsTemplate) { +export function updateSmsTemplate( + data: SystemSmsTemplateApi.SystemSmsTemplate, +) { return requestClient.put('/system/sms-template/update', data); } @@ -57,7 +63,9 @@ export function deleteSmsTemplate(id: number) { /** 导出短信模板 */ export function exportSmsTemplate(params: any) { - return requestClient.download('/system/sms-template/export-excel', { params }); + return requestClient.download('/system/sms-template/export-excel', { + params, + }); } /** 发送短信 */ diff --git a/apps/web-antd/src/api/system/social/client/index.ts b/apps/web-antd/src/api/system/social/client/index.ts index 59b1da6393b08711290649a34d530b0024fa86ec..a40dd487e53c03bf8bac1d3a9eec1f63722cc33e 100644 --- a/apps/web-antd/src/api/system/social/client/index.ts +++ b/apps/web-antd/src/api/system/social/client/index.ts @@ -1,6 +1,7 @@ -import { requestClient } from '#/api/request'; import type { PageParam, PageResult } from '@vben/request'; +import { requestClient } from '#/api/request'; + export namespace SystemSocialClientApi { /** 社交客户端信息 */ export interface SystemSocialClient { @@ -18,23 +19,29 @@ export namespace SystemSocialClientApi { /** 查询社交客户端列表 */ export function getSocialClientPage(params: PageParam) { - return requestClient.get>('/system/social-client/page', - { params } - ); + return requestClient.get< + PageResult + >('/system/social-client/page', { params }); } /** 查询社交客户端详情 */ export function getSocialClient(id: number) { - return requestClient.get(`/system/social-client/get?id=${id}`); + return requestClient.get( + `/system/social-client/get?id=${id}`, + ); } /** 新增社交客户端 */ -export function createSocialClient(data: SystemSocialClientApi.SystemSocialClient) { +export function createSocialClient( + data: SystemSocialClientApi.SystemSocialClient, +) { return requestClient.post('/system/social-client/create', data); } /** 修改社交客户端 */ -export function updateSocialClient(data: SystemSocialClientApi.SystemSocialClient) { +export function updateSocialClient( + data: SystemSocialClientApi.SystemSocialClient, +) { return requestClient.put('/system/social-client/update', data); } diff --git a/apps/web-antd/src/api/system/social/user/index.ts b/apps/web-antd/src/api/system/social/user/index.ts index f259be46a9ae29b1664786d8a6fd4782603ba6cb..17fb9c526e3ba7aa743c2c4c7492fc0a0976a525 100644 --- a/apps/web-antd/src/api/system/social/user/index.ts +++ b/apps/web-antd/src/api/system/social/user/index.ts @@ -1,6 +1,7 @@ -import { requestClient } from '#/api/request'; import type { PageParam, PageResult } from '@vben/request'; +import { requestClient } from '#/api/request'; + export namespace SystemSocialUserApi { /** 社交用户信息 */ export interface SystemSocialUser { @@ -21,12 +22,15 @@ export namespace SystemSocialUserApi { /** 查询社交用户列表 */ export function getSocialUserPage(params: PageParam) { - return requestClient.get>('/system/social-user/page', - { params } + return requestClient.get>( + '/system/social-user/page', + { params }, ); } /** 查询社交用户详情 */ export function getSocialUser(id: number) { - return requestClient.get(`/system/social-user/get?id=${id}`); + return requestClient.get( + `/system/social-user/get?id=${id}`, + ); } diff --git a/apps/web-antd/src/api/system/tenant-package/index.ts b/apps/web-antd/src/api/system/tenant-package/index.ts index b034a9b5ef2ff9c5b56db34b8b25800dca4c047e..45f56d8200252f028a0e35adeeb4b1fa768a601e 100644 --- a/apps/web-antd/src/api/system/tenant-package/index.ts +++ b/apps/web-antd/src/api/system/tenant-package/index.ts @@ -19,10 +19,9 @@ export namespace SystemTenantPackageApi { /** 租户套餐列表 */ export function getTenantPackagePage(params: PageParam) { - return requestClient.get>( - '/system/tenant-package/page', - { params } - ); + return requestClient.get< + PageResult + >('/system/tenant-package/page', { params }); } /** 查询租户套餐详情 */ @@ -31,12 +30,16 @@ export function getTenantPackage(id: number) { } /** 新增租户套餐 */ -export function createTenantPackage(data: SystemTenantPackageApi.SystemTenantPackage) { +export function createTenantPackage( + data: SystemTenantPackageApi.SystemTenantPackage, +) { return requestClient.post('/system/tenant-package/create', data); } /** 修改租户套餐 */ -export function updateTenantPackage(data: SystemTenantPackageApi.SystemTenantPackage) { +export function updateTenantPackage( + data: SystemTenantPackageApi.SystemTenantPackage, +) { return requestClient.put('/system/tenant-package/update', data); } @@ -47,5 +50,7 @@ export function deleteTenantPackage(id: number) { /** 获取租户套餐精简信息列表 */ export function getTenantPackageList() { - return requestClient.get('/system/tenant-package/get-simple-list'); + return requestClient.get( + '/system/tenant-package/get-simple-list', + ); } diff --git a/apps/web-antd/src/api/system/tenant/index.ts b/apps/web-antd/src/api/system/tenant/index.ts index 92fd905ea569625b47811928ec0413237fbee751..462b16c9f1877c8f0fd5f0afd3835ab6fa59fa58 100644 --- a/apps/web-antd/src/api/system/tenant/index.ts +++ b/apps/web-antd/src/api/system/tenant/index.ts @@ -19,17 +19,24 @@ export namespace SystemTenantApi { /** 租户列表 */ export function getTenantPage(params: PageParam) { - return requestClient.get>('/system/tenant/page', { params }); + return requestClient.get>( + '/system/tenant/page', + { params }, + ); } /** 获取租户精简信息列表 */ export function getSimpleTenantList() { - return requestClient.get('/system/tenant/simple-list'); + return requestClient.get( + '/system/tenant/simple-list', + ); } /** 查询租户详情 */ export function getTenant(id: number) { - return requestClient.get(`/system/tenant/get?id=${id}`,); + return requestClient.get( + `/system/tenant/get?id=${id}`, + ); } /** 新增租户 */ diff --git a/apps/web-antd/src/api/system/user/index.ts b/apps/web-antd/src/api/system/user/index.ts index 7a49ace605fb7168deb903aaf0fd05ed156bfc50..387ac39e6d80cdf166d5a203390d10ecad6ac852 100644 --- a/apps/web-antd/src/api/system/user/index.ts +++ b/apps/web-antd/src/api/system/user/index.ts @@ -1,4 +1,4 @@ -import type {PageParam, PageResult} from '@vben/request'; +import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; @@ -23,12 +23,17 @@ export namespace SystemUserApi { /** 查询用户管理列表 */ export function getUserPage(params: PageParam) { - return requestClient.get>('/system/user/page', { params }); + return requestClient.get>( + '/system/user/page', + { params }, + ); } /** 查询用户详情 */ export function getUser(id: number) { - return requestClient.get(`/system/user/get?id=${id}`); + return requestClient.get( + `/system/user/get?id=${id}`, + ); } /** 新增用户 */ @@ -60,7 +65,7 @@ export function importUserTemplate() { export function importUser(file: File, updateSupport: boolean) { return requestClient.upload('/system/user/import', { file, - updateSupport + updateSupport, }); } @@ -76,5 +81,7 @@ export function updateUserStatus(id: number, status: number) { /** 获取用户精简信息列表 */ export function getSimpleUserList() { - return requestClient.get('/system/user/simple-list'); + return requestClient.get( + '/system/user/simple-list', + ); } diff --git a/apps/web-antd/src/bootstrap.ts b/apps/web-antd/src/bootstrap.ts index e4aaf40571dc27e81b4c8897114798993a3aba56..62779d804b82500281885f35b98381e440388e8c 100644 --- a/apps/web-antd/src/bootstrap.ts +++ b/apps/web-antd/src/bootstrap.ts @@ -1,4 +1,5 @@ import { createApp, watchEffect } from 'vue'; +import VueDOMPurifyHTML from 'vue-dompurify-html'; import { registerAccessDirective } from '@vben/access'; import { registerLoadingDirective } from '@vben/common-ui/es/loading'; @@ -10,6 +11,7 @@ import '@vben/styles/antd'; import { useTitle } from '@vueuse/core'; import { $t, setupI18n } from '#/locales'; +import { setupFormCreate } from '#/plugins/formCreate'; import { initComponentAdapter } from './adapter/component'; import App from './app.vue'; @@ -39,7 +41,7 @@ async function bootstrap(namespace: string) { // 国际化 i18n 配置 await setupI18n(app); - // 配置 pinia-tore + // 配置 pinia-store await initStores(app, { namespace }); // 安装权限指令 @@ -52,6 +54,12 @@ async function bootstrap(namespace: string) { // 配置路由及路由守卫 app.use(router); + // formCreate + setupFormCreate(app); + + // vue-dompurify-html + app.use(VueDOMPurifyHTML); + // 配置Motion插件 const { MotionPlugin } = await import('@vben/plugins/motion'); app.use(MotionPlugin); diff --git a/apps/web-antd/src/components/FormCreate/index.ts b/apps/web-antd/src/components/FormCreate/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..84b612db60d80343c40b55148919f5634fd1cba9 --- /dev/null +++ b/apps/web-antd/src/components/FormCreate/index.ts @@ -0,0 +1,3 @@ +export { useApiSelect } from './src/components/useApiSelect'; + +export { useFormCreateDesigner } from './src/useFormCreateDesigner'; diff --git a/apps/web-antd/src/components/FormCreate/src/components/DictSelect.vue b/apps/web-antd/src/components/FormCreate/src/components/DictSelect.vue new file mode 100644 index 0000000000000000000000000000000000000000..339c4fb4b9def5883f9803d9f4e0c736fd8f4213 --- /dev/null +++ b/apps/web-antd/src/components/FormCreate/src/components/DictSelect.vue @@ -0,0 +1,85 @@ + + + + diff --git a/apps/web-antd/src/components/FormCreate/src/components/useApiSelect.tsx b/apps/web-antd/src/components/FormCreate/src/components/useApiSelect.tsx new file mode 100644 index 0000000000000000000000000000000000000000..ee78263edcb34eed4a1980af297428ceb8a9ff51 --- /dev/null +++ b/apps/web-antd/src/components/FormCreate/src/components/useApiSelect.tsx @@ -0,0 +1,280 @@ +import type { ApiSelectProps } from '#/components/FormCreate/src/type'; + +import { defineComponent, onMounted, ref, useAttrs } from 'vue'; + +import { + Checkbox, + CheckboxGroup, + Radio, + RadioGroup, + Select, + SelectOption, +} from 'ant-design-vue'; + +import { requestClient } from '#/api/request'; +import { isEmpty } from '#/utils/is'; + +export const useApiSelect = (option: ApiSelectProps) => { + return defineComponent({ + name: option.name, + props: { + // 选项标签 + labelField: { + type: String, + default: () => option.labelField ?? 'label', + }, + // 选项的值 + valueField: { + type: String, + default: () => option.valueField ?? 'value', + }, + // api 接口 + url: { + type: String, + default: () => option.url ?? '', + }, + // 请求类型 + method: { + type: String, + default: 'GET', + }, + // 选项解析函数 + parseFunc: { + type: String, + default: '', + }, + // 请求参数 + data: { + type: String, + default: '', + }, + // 选择器类型,下拉框 select、多选框 checkbox、单选框 radio + selectType: { + type: String, + default: 'select', + }, + // 是否多选 + multiple: { + type: Boolean, + default: false, + }, + // 是否远程搜索 + remote: { + type: Boolean, + default: false, + }, + // 远程搜索时携带的参数 + remoteField: { + type: String, + default: 'label', + }, + }, + setup(props) { + const attrs = useAttrs(); + const options = ref([]); // 下拉数据 + const loading = ref(false); // 是否正在从远程获取数据 + const queryParam = ref(); // 当前输入的值 + const getOptions = async () => { + options.value = []; + // 接口选择器 + if (isEmpty(props.url)) { + return; + } + + switch (props.method) { + case 'GET': { + let url: string = props.url; + if (props.remote && queryParam.value !== undefined) { + url = url.includes('?') + ? `${url}&${props.remoteField}=${queryParam.value}` + : `${url}?${props.remoteField}=${queryParam.value}`; + } + parseOptions(await requestClient.get(url)); + break; + } + case 'POST': { + const data: any = JSON.parse(props.data); + if (props.remote) { + data[props.remoteField] = queryParam.value; + } + parseOptions(await requestClient.post(props.url, data)); + break; + } + } + }; + + function parseOptions(data: any) { + // 情况一:如果有自定义解析函数优先使用自定义解析 + if (!isEmpty(props.parseFunc)) { + options.value = parseFunc()?.(data); + return; + } + // 情况二:返回的直接是一个列表 + if (Array.isArray(data)) { + parseOptions0(data); + return; + } + // 情况二:返回的是分页数据,尝试读取 list + data = data.list; + if (!!data && Array.isArray(data)) { + parseOptions0(data); + return; + } + // 情况三:不是 yudao-vue-pro 标准返回 + console.warn( + `接口[${props.url}] 返回结果不是 yudao-vue-pro 标准返回建议采用自定义解析函数处理`, + ); + } + + function parseOptions0(data: any[]) { + if (Array.isArray(data)) { + options.value = data.map((item: any) => ({ + label: parseExpression(item, props.labelField), + value: parseExpression(item, props.valueField), + })); + return; + } + console.warn(`接口[${props.url}] 返回结果不是一个数组`); + } + + function parseFunc() { + let parse: any = null; + if (props.parseFunc) { + // 解析字符串函数 + // eslint-disable-next-line no-new-func + parse = new Function(`return ${props.parseFunc}`)(); + } + return parse; + } + + function parseExpression(data: any, template: string) { + // 检测是否使用了表达式 + if (!template.includes('${')) { + return data[template]; + } + // 正则表达式匹配模板字符串中的 ${...} + const pattern = /\$\{([^}]*)\}/g; + // 使用replace函数配合正则表达式和回调函数来进行替换 + return template.replaceAll(pattern, (_, expr) => { + // expr 是匹配到的 ${} 内的表达式(这里是属性名),从 data 中获取对应的值 + const result = data[expr.trim()]; // 去除前后空白,以防用户输入带空格的属性名 + if (!result) { + console.warn( + `接口选择器选项模版[${template}][${expr.trim()}] 解析值失败结果为[${result}], 请检查属性名称是否存在于接口返回值中,存在则忽略此条!!!`, + ); + } + return result; + }); + } + + const remoteMethod = async (query: any) => { + if (!query) { + return; + } + loading.value = true; + try { + queryParam.value = query; + await getOptions(); + } finally { + loading.value = false; + } + }; + + onMounted(async () => { + await getOptions(); + }); + + const buildSelect = () => { + if (props.multiple) { + // fix:多写此步是为了解决 multiple 属性问题 + return ( + + ); + } + return ( + + ); + }; + const buildCheckbox = () => { + if (isEmpty(options.value)) { + options.value = [ + { label: '选项1', value: '选项1' }, + { label: '选项2', value: '选项2' }, + ]; + } + return ( + + {options.value.map( + (item: { label: any; value: any }, index: any) => ( + + {item.label} + + ), + )} + + ); + }; + const buildRadio = () => { + if (isEmpty(options.value)) { + options.value = [ + { label: '选项1', value: '选项1' }, + { label: '选项2', value: '选项2' }, + ]; + } + return ( + + {options.value.map( + (item: { label: any; value: any }, index: any) => ( + + {item.label} + + ), + )} + + ); + }; + return () => ( + <> + {props.selectType === 'select' + ? buildSelect() + : props.selectType === 'radio' + ? buildRadio() + : // eslint-disable-next-line unicorn/no-nested-ternary + props.selectType === 'checkbox' + ? buildCheckbox() + : buildSelect()} + + ); + }, + }); +}; diff --git a/apps/web-antd/src/components/FormCreate/src/config/index.ts b/apps/web-antd/src/components/FormCreate/src/config/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..49b9d3bda426806b192e3c8ef7c7d4cd2079a4c8 --- /dev/null +++ b/apps/web-antd/src/components/FormCreate/src/config/index.ts @@ -0,0 +1,6 @@ +export { useDictSelectRule } from './useDictSelectRule'; +export { useEditorRule } from './useEditorRule'; +export { useSelectRule } from './useSelectRule'; +export { useUploadFileRule } from './useUploadFileRule'; +export { useUploadImgRule } from './useUploadImgRule'; +export { useUploadImgsRule } from './useUploadImgsRule'; diff --git a/apps/web-antd/src/components/FormCreate/src/config/selectRule.ts b/apps/web-antd/src/components/FormCreate/src/config/selectRule.ts new file mode 100644 index 0000000000000000000000000000000000000000..2c6cee2ce2bbd68e20cf87ef5bc84384a8c9324c --- /dev/null +++ b/apps/web-antd/src/components/FormCreate/src/config/selectRule.ts @@ -0,0 +1,182 @@ +/* eslint-disable no-template-curly-in-string */ +const selectRule = [ + { + type: 'select', + field: 'selectType', + title: '选择器类型', + value: 'select', + options: [ + { label: '下拉框', value: 'select' }, + { label: '单选框', value: 'radio' }, + { label: '多选框', value: 'checkbox' }, + ], + // 参考 https://www.form-create.com/v3/guide/control 组件联动,单选框和多选框不需要多选属性 + control: [ + { + value: 'select', + condition: '==', + method: 'hidden', + rule: [ + 'multiple', + 'clearable', + 'collapseTags', + 'multipleLimit', + 'allowCreate', + 'filterable', + 'noMatchText', + 'remote', + 'remoteMethod', + 'reserveKeyword', + 'defaultFirstOption', + 'automaticDropdown', + ], + }, + ], + }, + { + type: 'switch', + field: 'filterable', + title: '是否可搜索', + }, + { type: 'switch', field: 'multiple', title: '是否多选' }, + { + type: 'switch', + field: 'disabled', + title: '是否禁用', + }, + { type: 'switch', field: 'clearable', title: '是否可以清空选项' }, + { + type: 'switch', + field: 'collapseTags', + title: '多选时是否将选中值按文字的形式展示', + }, + { + type: 'inputNumber', + field: 'multipleLimit', + title: '多选时用户最多可以选择的项目数,为 0 则不限制', + props: { min: 0 }, + }, + { + type: 'input', + field: 'autocomplete', + title: 'autocomplete 属性', + }, + { type: 'input', field: 'placeholder', title: '占位符' }, + { type: 'switch', field: 'allowCreate', title: '是否允许用户创建新条目' }, + { + type: 'input', + field: 'noMatchText', + title: '搜索条件无匹配时显示的文字', + }, + { type: 'input', field: 'noDataText', title: '选项为空时显示的文字' }, + { + type: 'switch', + field: 'reserveKeyword', + title: '多选且可搜索时,是否在选中一个选项后保留当前的搜索关键词', + }, + { + type: 'switch', + field: 'defaultFirstOption', + title: '在输入框按下回车,选择第一个匹配项', + }, + { + type: 'switch', + field: 'popperAppendToBody', + title: '是否将弹出框插入至 body 元素', + value: true, + }, + { + type: 'switch', + field: 'automaticDropdown', + title: '对于不可搜索的 Select,是否在输入框获得焦点后自动弹出选项菜单', + }, +]; + +const apiSelectRule = [ + { + type: 'input', + field: 'url', + title: 'url 地址', + props: { + placeholder: '/system/user/simple-list', + }, + }, + { + type: 'select', + field: 'method', + title: '请求类型', + value: 'GET', + options: [ + { label: 'GET', value: 'GET' }, + { label: 'POST', value: 'POST' }, + ], + control: [ + { + value: 'GET', + condition: '!=', + method: 'hidden', + rule: [ + { + type: 'input', + field: 'data', + title: '请求参数 JSON 格式', + props: { + autosize: true, + type: 'textarea', + placeholder: '{"type": 1}', + }, + }, + ], + }, + ], + }, + { + type: 'input', + field: 'labelField', + title: 'label 属性', + info: '可以使用 el 表达式:${属性},来实现复杂数据组合。如:${nickname}-${id}', + props: { + placeholder: 'nickname', + }, + }, + { + type: 'input', + field: 'valueField', + title: 'value 属性', + info: '可以使用 el 表达式:${属性},来实现复杂数据组合。如:${nickname}-${id}', + props: { + placeholder: 'id', + }, + }, + { + type: 'input', + field: 'parseFunc', + title: '选项解析函数', + info: `data 为接口返回值,需要写一个匿名函数解析返回值为选择器 options 列表 + (data: any)=>{ label: string; value: any }[]`, + props: { + autosize: true, + rows: { minRows: 2, maxRows: 6 }, + type: 'textarea', + placeholder: ` + function (data) { + console.log(data) + return data.list.map(item=> ({label: item.nickname,value: item.id})) + }`, + }, + }, + { + type: 'switch', + field: 'remote', + info: '是否可搜索', + title: '其中的选项是否从服务器远程加载', + }, + { + type: 'input', + field: 'remoteField', + title: '请求参数', + info: '远程请求时请求携带的参数名称,如:name', + }, +]; + +export { apiSelectRule, selectRule }; diff --git a/apps/web-antd/src/components/FormCreate/src/config/useDictSelectRule.ts b/apps/web-antd/src/components/FormCreate/src/config/useDictSelectRule.ts new file mode 100644 index 0000000000000000000000000000000000000000..10d6f1e5311a3094aaf824ed5d987a3736af2032 --- /dev/null +++ b/apps/web-antd/src/components/FormCreate/src/config/useDictSelectRule.ts @@ -0,0 +1,70 @@ +import { onMounted, ref } from 'vue'; + +import cloneDeep from 'lodash.clonedeep'; + +import * as DictDataApi from '#/api/system/dict/type'; +import { selectRule } from '#/components/FormCreate/src/config/selectRule'; +import { + localeProps, + makeRequiredRule, +} from '#/components/FormCreate/src/utils'; +import { generateUUID } from '#/utils'; + +/** + * 字典选择器规则,如果规则使用到动态数据则需要单独配置不能使用 useSelectRule + */ +export const useDictSelectRule = () => { + const label = '字典选择器'; + const name = 'DictSelect'; + const rules = cloneDeep(selectRule); + const dictOptions = ref<{ label: string; value: string }[]>([]); // 字典类型下拉数据 + onMounted(async () => { + const data = await DictDataApi.getSimpleDictTypeList(); + if (!data || data.length === 0) { + return; + } + dictOptions.value = + data?.map((item: DictDataApi.DictTypeVO) => ({ + label: item.name, + value: item.type, + })) ?? []; + }); + return { + icon: 'icon-descriptions', + label, + name, + rule() { + return { + type: name, + field: generateUUID(), + title: label, + info: '', + $required: false, + }; + }, + props(_: any, { t }: any) { + return localeProps(t, `${name}.props`, [ + makeRequiredRule(), + { + type: 'select', + field: 'dictType', + title: '字典类型', + value: '', + options: dictOptions.value, + }, + { + type: 'select', + field: 'valueType', + title: '字典值类型', + value: 'str', + options: [ + { label: '数字', value: 'int' }, + { label: '字符串', value: 'str' }, + { label: '布尔值', value: 'bool' }, + ], + }, + ...rules, + ]); + }, + }; +}; diff --git a/apps/web-antd/src/components/FormCreate/src/config/useEditorRule.ts b/apps/web-antd/src/components/FormCreate/src/config/useEditorRule.ts new file mode 100644 index 0000000000000000000000000000000000000000..1cca13611d9aac196aaf71313e54f261baa8f90a --- /dev/null +++ b/apps/web-antd/src/components/FormCreate/src/config/useEditorRule.ts @@ -0,0 +1,35 @@ +import { + localeProps, + makeRequiredRule, +} from '#/components/FormCreate/src/utils'; +import { generateUUID } from '#/utils'; + +export const useEditorRule = () => { + const label = '富文本'; + const name = 'Editor'; + return { + icon: 'icon-editor', + label, + name, + rule() { + return { + type: name, + field: generateUUID(), + title: label, + info: '', + $required: false, + }; + }, + props(_: any, { t }: any) { + return localeProps(t, `${name}.props`, [ + makeRequiredRule(), + { + type: 'input', + field: 'height', + title: '高度', + }, + { type: 'switch', field: 'readonly', title: '是否只读' }, + ]); + }, + }; +}; diff --git a/apps/web-antd/src/components/FormCreate/src/config/useSelectRule.ts b/apps/web-antd/src/components/FormCreate/src/config/useSelectRule.ts new file mode 100644 index 0000000000000000000000000000000000000000..08284a2df1cbc7fcdfc8ef24050049724785c98a --- /dev/null +++ b/apps/web-antd/src/components/FormCreate/src/config/useSelectRule.ts @@ -0,0 +1,46 @@ +import type { SelectRuleOption } from '#/components/FormCreate/src/type'; + +import cloneDeep from 'lodash.clonedeep'; + +import { selectRule } from '#/components/FormCreate/src/config/selectRule'; +import { + localeProps, + makeRequiredRule, +} from '#/components/FormCreate/src/utils'; +import { generateUUID } from '#/utils'; + +/** + * 通用选择器规则 hook + * + * @param option 规则配置 + */ +export const useSelectRule = (option: SelectRuleOption) => { + const label = option.label; + const name = option.name; + const rules = cloneDeep(selectRule); + return { + icon: option.icon, + label, + name, + event: option.event, + rule() { + return { + type: name, + field: generateUUID(), + title: label, + info: '', + $required: false, + }; + }, + props(_: any, { t }: any) { + if (!option.props) { + option.props = []; + } + return localeProps(t, `${name}.props`, [ + makeRequiredRule(), + ...option.props, + ...rules, + ]); + }, + }; +}; diff --git a/apps/web-antd/src/components/FormCreate/src/config/useUploadFileRule.ts b/apps/web-antd/src/components/FormCreate/src/config/useUploadFileRule.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a006ecaab0b978c896d93e19da9f58074238bf4 --- /dev/null +++ b/apps/web-antd/src/components/FormCreate/src/config/useUploadFileRule.ts @@ -0,0 +1,83 @@ +import { + localeProps, + makeRequiredRule, +} from '#/components/FormCreate/src/utils'; +import { generateUUID } from '#/utils'; + +export const useUploadFileRule = () => { + const label = '文件上传'; + const name = 'UploadFile'; + return { + icon: 'icon-upload', + label, + name, + rule() { + return { + type: name, + field: generateUUID(), + title: label, + info: '', + $required: false, + }; + }, + props(_: any, { t }: any) { + return localeProps(t, `${name}.props`, [ + makeRequiredRule(), + { + type: 'select', + field: 'fileType', + title: '文件类型', + value: ['doc', 'xls', 'ppt', 'txt', 'pdf'], + options: [ + { label: 'doc', value: 'doc' }, + { label: 'xls', value: 'xls' }, + { label: 'ppt', value: 'ppt' }, + { label: 'txt', value: 'txt' }, + { label: 'pdf', value: 'pdf' }, + ], + props: { + multiple: true, + }, + }, + { + type: 'switch', + field: 'autoUpload', + title: '是否在选取文件后立即进行上传', + value: true, + }, + { + type: 'switch', + field: 'drag', + title: '拖拽上传', + value: false, + }, + { + type: 'switch', + field: 'isShowTip', + title: '是否显示提示', + value: true, + }, + { + type: 'inputNumber', + field: 'fileSize', + title: '大小限制(MB)', + value: 5, + props: { min: 0 }, + }, + { + type: 'inputNumber', + field: 'limit', + title: '数量限制', + value: 5, + props: { min: 0 }, + }, + { + type: 'switch', + field: 'disabled', + title: '是否禁用', + value: false, + }, + ]); + }, + }; +}; diff --git a/apps/web-antd/src/components/FormCreate/src/config/useUploadImgRule.ts b/apps/web-antd/src/components/FormCreate/src/config/useUploadImgRule.ts new file mode 100644 index 0000000000000000000000000000000000000000..6bc419473aae70857c961bd3d9cbf739521e3d3c --- /dev/null +++ b/apps/web-antd/src/components/FormCreate/src/config/useUploadImgRule.ts @@ -0,0 +1,92 @@ +import { + localeProps, + makeRequiredRule, +} from '#/components/FormCreate/src/utils'; +import { generateUUID } from '#/utils'; + +export const useUploadImgRule = () => { + const label = '单图上传'; + const name = 'UploadImg'; + return { + icon: 'icon-image', + label, + name, + rule() { + return { + type: name, + field: generateUUID(), + title: label, + info: '', + $required: false, + }; + }, + props(_: any, { t }: any) { + return localeProps(t, `${name}.props`, [ + makeRequiredRule(), + { + type: 'switch', + field: 'drag', + title: '拖拽上传', + value: false, + }, + { + type: 'select', + field: 'fileType', + title: '图片类型限制', + value: ['image/jpeg', 'image/png', 'image/gif'], + options: [ + { label: 'image/apng', value: 'image/apng' }, + { label: 'image/bmp', value: 'image/bmp' }, + { label: 'image/gif', value: 'image/gif' }, + { label: 'image/jpeg', value: 'image/jpeg' }, + { label: 'image/pjpeg', value: 'image/pjpeg' }, + { label: 'image/svg+xml', value: 'image/svg+xml' }, + { label: 'image/tiff', value: 'image/tiff' }, + { label: 'image/webp', value: 'image/webp' }, + { label: 'image/x-icon', value: 'image/x-icon' }, + ], + props: { + multiple: true, + }, + }, + { + type: 'inputNumber', + field: 'fileSize', + title: '大小限制(MB)', + value: 5, + props: { min: 0 }, + }, + { + type: 'input', + field: 'height', + title: '组件高度', + value: '150px', + }, + { + type: 'input', + field: 'width', + title: '组件宽度', + value: '150px', + }, + { + type: 'input', + field: 'borderradius', + title: '组件边框圆角', + value: '8px', + }, + { + type: 'switch', + field: 'disabled', + title: '是否显示删除按钮', + value: true, + }, + { + type: 'switch', + field: 'showBtnText', + title: '是否显示按钮文字', + value: true, + }, + ]); + }, + }; +}; diff --git a/apps/web-antd/src/components/FormCreate/src/config/useUploadImgsRule.ts b/apps/web-antd/src/components/FormCreate/src/config/useUploadImgsRule.ts new file mode 100644 index 0000000000000000000000000000000000000000..c1e1830625a0dc651d7c0278627eb481b8ba8da5 --- /dev/null +++ b/apps/web-antd/src/components/FormCreate/src/config/useUploadImgsRule.ts @@ -0,0 +1,87 @@ +import { + localeProps, + makeRequiredRule, +} from '#/components/FormCreate/src/utils'; +import { generateUUID } from '#/utils'; + +export const useUploadImgsRule = () => { + const label = '多图上传'; + const name = 'UploadImgs'; + return { + icon: 'icon-image', + label, + name, + rule() { + return { + type: name, + field: generateUUID(), + title: label, + info: '', + $required: false, + }; + }, + props(_: any, { t }: any) { + return localeProps(t, `${name}.props`, [ + makeRequiredRule(), + { + type: 'switch', + field: 'drag', + title: '拖拽上传', + value: false, + }, + { + type: 'select', + field: 'fileType', + title: '图片类型限制', + value: ['image/jpeg', 'image/png', 'image/gif'], + options: [ + { label: 'image/apng', value: 'image/apng' }, + { label: 'image/bmp', value: 'image/bmp' }, + { label: 'image/gif', value: 'image/gif' }, + { label: 'image/jpeg', value: 'image/jpeg' }, + { label: 'image/pjpeg', value: 'image/pjpeg' }, + { label: 'image/svg+xml', value: 'image/svg+xml' }, + { label: 'image/tiff', value: 'image/tiff' }, + { label: 'image/webp', value: 'image/webp' }, + { label: 'image/x-icon', value: 'image/x-icon' }, + ], + props: { + multiple: true, + }, + }, + { + type: 'inputNumber', + field: 'fileSize', + title: '大小限制(MB)', + value: 5, + props: { min: 0 }, + }, + { + type: 'inputNumber', + field: 'limit', + title: '数量限制', + value: 5, + props: { min: 0 }, + }, + { + type: 'input', + field: 'height', + title: '组件高度', + value: '150px', + }, + { + type: 'input', + field: 'width', + title: '组件宽度', + value: '150px', + }, + { + type: 'input', + field: 'borderradius', + title: '组件边框圆角', + value: '8px', + }, + ]); + }, + }; +}; diff --git a/apps/web-antd/src/components/FormCreate/src/type/index.ts b/apps/web-antd/src/components/FormCreate/src/type/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..cc5e18aae423bd1577ceca72b53b4d23e837ddee --- /dev/null +++ b/apps/web-antd/src/components/FormCreate/src/type/index.ts @@ -0,0 +1,52 @@ +import type { Rule } from '@form-create/ant-design-vue'; // 左侧拖拽按钮 +// 左侧拖拽按钮 + +// 左侧拖拽按钮 +export interface MenuItem { + label: string; + name: string; + icon: string; +} + +// 左侧拖拽按钮分类 +export interface Menu { + title: string; + name: string; + list: MenuItem[]; +} + +export type MenuList = Array; + +// 拖拽组件的规则 +export interface DragRule { + icon: string; + name: string; + label: string; + children?: string; + inside?: true; + drag?: string | true; + dragBtn?: false; + mask?: false; + + rule(): Rule; + + props(v: any, v1: any): Rule[]; +} + +// 通用下拉组件 Props 类型 +export interface ApiSelectProps { + name: string; // 组件名称 + labelField?: string; // 选项标签 + valueField?: string; // 选项的值 + url?: string; // url 接口 + isDict?: boolean; // 是否字典选择器 +} + +// 选择组件规则配置类型 +export interface SelectRuleOption { + label: string; // label 名称 + name: string; // 组件名称 + icon: string; // 组件图标 + props?: any[]; // 组件规则 + event?: any[]; // 事件配置 +} diff --git a/apps/web-antd/src/components/FormCreate/src/useFormCreateDesigner.ts b/apps/web-antd/src/components/FormCreate/src/useFormCreateDesigner.ts new file mode 100644 index 0000000000000000000000000000000000000000..c522c334ea6b34b78f5707f61eb83eda64b3d03c --- /dev/null +++ b/apps/web-antd/src/components/FormCreate/src/useFormCreateDesigner.ts @@ -0,0 +1,116 @@ +import type { Ref } from 'vue'; + +import type { Menu } from '#/components/FormCreate/src/type'; + +import { nextTick, onMounted } from 'vue'; + +import { apiSelectRule } from '#/components/FormCreate/src/config/selectRule'; + +import { + useDictSelectRule, + useEditorRule, + useSelectRule, + useUploadFileRule, + useUploadImgRule, + useUploadImgsRule, +} from './config'; + +/** + * 表单设计器增强 hook + * 新增 + * - 文件上传 + * - 单图上传 + * - 多图上传 + * - 字典选择器 + * - 用户选择器 + * - 部门选择器 + * - 富文本 + */ +export const useFormCreateDesigner = async (designer: Ref) => { + const editorRule = useEditorRule(); + const uploadFileRule = useUploadFileRule(); + const uploadImgRule = useUploadImgRule(); + const uploadImgsRule = useUploadImgsRule(); + + /** + * 构建表单组件 + */ + const buildFormComponents = () => { + // 移除自带的上传组件规则,使用 uploadFileRule、uploadImgRule、uploadImgsRule 替代 + designer.value?.removeMenuItem('upload'); + // 移除自带的富文本组件规则,使用 editorRule 替代 + designer.value?.removeMenuItem('fc-editor'); + const components = [ + editorRule, + uploadFileRule, + uploadImgRule, + uploadImgsRule, + ]; + components.forEach((component) => { + // 插入组件规则 + designer.value?.addComponent(component); + // 插入拖拽按钮到 `main` 分类下 + designer.value?.appendMenuItem('main', { + icon: component.icon, + name: component.name, + label: component.label, + }); + }); + }; + + const userSelectRule = useSelectRule({ + name: 'UserSelect', + label: '用户选择器', + icon: 'icon-eye', + }); + const deptSelectRule = useSelectRule({ + name: 'DeptSelect', + label: '部门选择器', + icon: 'icon-tree', + }); + const dictSelectRule = useDictSelectRule(); + const apiSelectRule0 = useSelectRule({ + name: 'ApiSelect', + label: '接口选择器', + icon: 'icon-json', + props: [...apiSelectRule], + event: ['click', 'change', 'visibleChange', 'clear', 'blur', 'focus'], + }); + + /** + * 构建系统字段菜单 + */ + const buildSystemMenu = () => { + // 移除自带的下拉选择器组件,使用 currencySelectRule 替代 + // designer.value?.removeMenuItem('select') + // designer.value?.removeMenuItem('radio') + // designer.value?.removeMenuItem('checkbox') + const components = [ + userSelectRule, + deptSelectRule, + dictSelectRule, + apiSelectRule0, + ]; + const menu: Menu = { + name: 'system', + title: '系统字段', + list: components.map((component) => { + // 插入组件规则 + designer.value?.addComponent(component); + // 插入拖拽按钮到 `system` 分类下 + return { + icon: component.icon, + name: component.name, + label: component.label, + }; + }), + }; + designer.value?.addMenu(menu); + }; + + onMounted(async () => { + await nextTick(); + buildFormComponents(); + buildSystemMenu(); + }); +}; diff --git a/apps/web-antd/src/components/FormCreate/src/utils/index.ts b/apps/web-antd/src/components/FormCreate/src/utils/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..816a0f2a366e5f17a3f2521ca1b9f031f835bb80 --- /dev/null +++ b/apps/web-antd/src/components/FormCreate/src/utils/index.ts @@ -0,0 +1,65 @@ +export function makeRequiredRule() { + return { + type: 'Required', + field: 'formCreate$required', + title: '是否必填', + }; +} + +export const localeProps = ( + t: (msg: string) => any, + prefix: string, + rules: any[], +) => { + return rules.map((rule: { field: string; title: any }) => { + if (rule.field === 'formCreate$required') { + rule.title = t('props.required') || rule.title; + } else if (rule.field && rule.field !== '_optionType') { + rule.title = t(`components.${prefix}.${rule.field}`) || rule.title; + } + return rule; + }); +}; + +/** + * 解析表单组件的 field, title 等字段(递归,如果组件包含子组件) + * + * @param rule 组件的生成规则 https://www.form-create.com/v3/guide/rule + * @param fields 解析后表单组件字段 + * @param parentTitle 如果是子表单,子表单的标题,默认为空 + */ +export const parseFormFields = ( + rule: Record, + fields: Array> = [], + parentTitle: string = '', +) => { + const { type, field, $required, title: tempTitle, children } = rule; + if (field && tempTitle) { + let title = tempTitle; + if (parentTitle) { + title = `${parentTitle}.${tempTitle}`; + } + let required = false; + if ($required) { + required = true; + } + fields.push({ + field, + title, + type, + required, + }); + // TODO 子表单 需要处理子表单字段 + // if (type === 'group' && rule.props?.rule && Array.isArray(rule.props.rule)) { + // // 解析子表单的字段 + // rule.props.rule.forEach((item) => { + // parseFields(item, fieldsPermission, title) + // }) + // } + } + if (children && Array.isArray(children)) { + children.forEach((rule) => { + parseFormFields(rule, fields); + }); + } +}; diff --git a/apps/web-antd/src/components/dict-tag/dict-tag.vue b/apps/web-antd/src/components/dict-tag/dict-tag.vue index bc46d285bd0da9f44d1513a81531a4198e156545..d000b6669e0a56d4a77354f018a00406cfd06626 100644 --- a/apps/web-antd/src/components/dict-tag/dict-tag.vue +++ b/apps/web-antd/src/components/dict-tag/dict-tag.vue @@ -1,57 +1,71 @@