pro-comp-x 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/README.md +57 -12
  2. package/compiled/@ant-design/icons/index.js +1 -0
  3. package/compiled/@ant-design/icons/package.json +1 -0
  4. package/compiled/antd/index.d.ts +482 -0
  5. package/compiled/antd/index.js +29 -0
  6. package/compiled/antd/package.json +1 -0
  7. package/compiled/classnames/index.js +7 -0
  8. package/compiled/classnames/package.json +1 -0
  9. package/compiled/dayjs/index.js +1 -0
  10. package/compiled/dayjs/package.json +1 -0
  11. package/dist/404.html +36 -0
  12. package/dist/esm/antd-alias/antd.less +30 -0
  13. package/dist/esm/antd-alias/button.d.ts +2 -0
  14. package/dist/esm/antd-alias/button.js +2 -0
  15. package/dist/esm/antd-alias/cascader.d.ts +2 -0
  16. package/dist/esm/antd-alias/cascader.js +2 -0
  17. package/dist/esm/antd-alias/checkbox.d.ts +2 -0
  18. package/dist/esm/antd-alias/checkbox.js +2 -0
  19. package/dist/esm/antd-alias/col.d.ts +2 -0
  20. package/dist/esm/antd-alias/col.js +2 -0
  21. package/dist/esm/antd-alias/config-provider.d.ts +2 -0
  22. package/dist/esm/antd-alias/config-provider.js +2 -0
  23. package/dist/esm/antd-alias/date-picker.d.ts +2 -0
  24. package/dist/esm/antd-alias/date-picker.js +2 -0
  25. package/dist/esm/antd-alias/form.d.ts +2 -0
  26. package/dist/esm/antd-alias/form.js +2 -0
  27. package/dist/esm/antd-alias/index.d.ts +36 -0
  28. package/dist/esm/antd-alias/index.js +48 -0
  29. package/dist/esm/antd-alias/input-number.d.ts +2 -0
  30. package/dist/esm/antd-alias/input-number.js +2 -0
  31. package/dist/esm/antd-alias/input.d.ts +2 -0
  32. package/dist/esm/antd-alias/input.js +2 -0
  33. package/dist/esm/antd-alias/mentions.d.ts +2 -0
  34. package/dist/esm/antd-alias/mentions.js +2 -0
  35. package/dist/esm/antd-alias/modal.d.ts +2 -0
  36. package/dist/esm/antd-alias/modal.js +2 -0
  37. package/dist/esm/antd-alias/pagination.d.ts +2 -0
  38. package/dist/esm/antd-alias/pagination.js +2 -0
  39. package/dist/esm/antd-alias/popover.d.ts +2 -0
  40. package/dist/esm/antd-alias/popover.js +2 -0
  41. package/dist/esm/antd-alias/radio.d.ts +2 -0
  42. package/dist/esm/antd-alias/radio.js +2 -0
  43. package/dist/esm/antd-alias/row.d.ts +2 -0
  44. package/dist/esm/antd-alias/row.js +2 -0
  45. package/dist/esm/antd-alias/select.d.ts +2 -0
  46. package/dist/esm/antd-alias/select.js +2 -0
  47. package/dist/esm/antd-alias/slider.d.ts +2 -0
  48. package/dist/esm/antd-alias/slider.js +2 -0
  49. package/dist/esm/antd-alias/spin.d.ts +2 -0
  50. package/dist/esm/antd-alias/spin.js +2 -0
  51. package/dist/esm/antd-alias/switch.d.ts +2 -0
  52. package/dist/esm/antd-alias/switch.js +2 -0
  53. package/dist/esm/antd-alias/table.d.ts +2 -0
  54. package/dist/esm/antd-alias/table.js +2 -0
  55. package/dist/esm/antd-alias/tabs.d.ts +2 -0
  56. package/dist/esm/antd-alias/tabs.js +2 -0
  57. package/dist/esm/antd-alias/time-picker.d.ts +2 -0
  58. package/dist/esm/antd-alias/time-picker.js +2 -0
  59. package/dist/esm/antd-alias/tooltip.d.ts +2 -0
  60. package/dist/esm/antd-alias/tooltip.js +2 -0
  61. package/dist/esm/antd-alias/tree-select.d.ts +2 -0
  62. package/dist/esm/antd-alias/tree-select.js +2 -0
  63. package/dist/esm/antd-alias/upload.d.ts +2 -0
  64. package/dist/esm/antd-alias/upload.js +2 -0
  65. package/dist/esm/components/ComponentExtends/DatePicker/index.d.ts +9 -0
  66. package/dist/esm/components/ComponentExtends/DatePicker/index.js +5 -12
  67. package/dist/esm/components/ComponentExtends/InputBox/index.d.ts +31 -0
  68. package/dist/esm/components/ComponentExtends/InputBox/index.js +3 -4
  69. package/dist/esm/components/ComponentExtends/InputSearch/index.d.ts +9 -0
  70. package/dist/esm/components/ComponentExtends/InputSearch/index.js +3 -10
  71. package/dist/esm/components/ComponentExtends/InputTooltip/index.d.ts +11 -0
  72. package/dist/esm/components/ComponentExtends/InputTooltip/index.js +18 -28
  73. package/dist/esm/components/ComponentExtends/Modal/index.d.ts +15 -0
  74. package/dist/esm/components/ComponentExtends/Modal/index.js +4 -13
  75. package/dist/esm/components/ComponentExtends/NumberRange/index.d.ts +13 -0
  76. package/dist/esm/components/ComponentExtends/NumberRange/index.js +21 -30
  77. package/dist/esm/components/ComponentExtends/Raido/index.d.ts +10 -0
  78. package/dist/esm/components/ComponentExtends/Raido/index.js +3 -10
  79. package/dist/esm/components/ComponentExtends/SelectQuery/index.d.ts +32 -0
  80. package/dist/esm/components/ComponentExtends/SelectQuery/index.js +40 -51
  81. package/dist/esm/components/ComponentExtends/TableEditCell/index.d.ts +20 -0
  82. package/dist/esm/components/ComponentExtends/TableEditCell/index.js +5 -19
  83. package/dist/esm/components/ComponentExtends/Tabs/index.d.ts +8 -0
  84. package/dist/esm/components/ComponentExtends/Tabs/index.js +11 -16
  85. package/dist/esm/components/ComponentExtends/Text/index.d.ts +4 -0
  86. package/dist/esm/components/ComponentExtends/Text/index.js +1 -4
  87. package/dist/esm/components/ComponentExtends/TimePicker/index.d.ts +6 -0
  88. package/dist/esm/components/ComponentExtends/TimePicker/index.js +5 -12
  89. package/dist/esm/components/ComponentExtends/UploadImages/index.d.ts +8 -0
  90. package/dist/esm/components/ComponentExtends/UploadImages/index.js +10 -23
  91. package/dist/esm/components/ComponentExtends/index.d.ts +15 -0
  92. package/dist/esm/components/DndProvider/index.d.ts +7 -0
  93. package/dist/esm/components/DndProvider/index.js +15 -0
  94. package/dist/esm/components/DraggableBodyRow/DraggableBodyRow.less +16 -14
  95. package/dist/esm/components/DraggableBodyRow/index.d.ts +18 -0
  96. package/dist/esm/components/DraggableBodyRow/index.js +2 -2
  97. package/dist/esm/components/DraggableCell/index.d.ts +40 -0
  98. package/dist/esm/components/DraggableCell/index.js +23 -10
  99. package/dist/esm/components/DraggableTabNode/index.d.ts +7 -0
  100. package/dist/esm/components/DraggableTabNode/index.js +3 -5
  101. package/dist/esm/components/DraggableTable/DraggableTable.less +31 -0
  102. package/dist/esm/components/DraggableTable/index.d.ts +23 -0
  103. package/dist/esm/components/DraggableTable/index.js +170 -0
  104. package/dist/esm/components/PageList/FilterForm/index.d.ts +53 -0
  105. package/dist/esm/components/PageList/FilterForm/index.js +52 -66
  106. package/dist/esm/components/PageList/index.d.ts +76 -0
  107. package/dist/esm/components/PageList/index.js +148 -138
  108. package/dist/esm/components/PageWraper/index.d.ts +13 -0
  109. package/dist/esm/components/PageWraper/index.js +8 -13
  110. package/dist/esm/components/Panel/Panel.less +2 -0
  111. package/dist/esm/components/Panel/index.d.ts +20 -0
  112. package/dist/esm/components/Panel/index.js +17 -27
  113. package/dist/esm/components/ProConfigProvider/context.d.ts +17 -0
  114. package/dist/esm/components/ProConfigProvider/context.js +6 -1
  115. package/dist/esm/components/ProConfigProvider/index.d.ts +10 -0
  116. package/dist/esm/components/ProConfigProvider/index.js +4 -9
  117. package/dist/esm/components/RenderForm/RenderForm.less +19 -0
  118. package/dist/esm/components/RenderForm/index.d.ts +64 -0
  119. package/dist/esm/components/RenderForm/index.js +106 -103
  120. package/dist/esm/index.d.ts +25 -0
  121. package/dist/esm/index.js +4 -17
  122. package/dist/esm/styles/antd-custom.less +5 -0
  123. package/dist/esm/styles/base.less +3 -6
  124. package/dist/esm/styles/dumi.less +17 -0
  125. package/dist/esm/styles/index.less +1 -0
  126. package/dist/esm/utils/getClassPrefix.d.ts +2 -0
  127. package/dist/index.css +26895 -0
  128. package/dist/index.html +36 -0
  129. package/dist/pro-components-dark.css +1 -0
  130. package/dist/pro-components-default.css +1 -0
  131. package/dist/umi.css +2 -0
  132. package/dist/umi.js +1 -0
  133. package/package.json +29 -30
  134. package/public/pro-components-dark.css +19 -0
  135. package/public/pro-components-default.css +23 -0
  136. package/dist/esm/components/ActionConfigForm/index.js +0 -129
  137. package/dist/esm/components/ColorPalette/ColorPalette.less +0 -9
  138. package/dist/esm/components/ColorPalette/index.js +0 -88
  139. package/dist/esm/components/MarkdownView/MarkdownView.less +0 -93
  140. package/dist/esm/components/MarkdownView/index.js +0 -142
  141. package/dist/esm/components/MdPlainText/MdPlainText.less +0 -118
  142. package/dist/esm/components/MdPlainText/constants.js +0 -2
  143. package/dist/esm/components/MdPlainText/index.js +0 -717
  144. package/dist/esm/components/MdPlainText/planinShortcuts.js +0 -18
  145. package/dist/esm/components/MdPlainText/textContent.js +0 -4
  146. package/dist/esm/components/MdPlainText/utils.js +0 -159
  147. package/dist/esm/components/PlainText/index.js +0 -122
  148. package/dist/esm/components/PlainTextBox/PlainTextBox.less +0 -94
  149. package/dist/esm/components/PlainTextBox/index.js +0 -264
@@ -1,18 +0,0 @@
1
- var withInlines = function withInlines(editor) {
2
- var isInline = editor.isInline,
3
- isSelectable = editor.isSelectable,
4
- isElementReadOnly = editor.isElementReadOnly;
5
-
6
- // 自定义的type需要在这里重写,否则编辑不认
7
- editor.isInline = function (element) {
8
- return ['badge'].includes(element.type) || isInline(element);
9
- };
10
- editor.isElementReadOnly = function (element) {
11
- return element.type === 'badge' || isElementReadOnly(element);
12
- };
13
- editor.isSelectable = function (element) {
14
- return element.type !== 'badge' && isSelectable(element);
15
- };
16
- return editor;
17
- };
18
- export { withInlines };
@@ -1,4 +0,0 @@
1
- /* eslint-disable */
2
- //@ts-ignore
3
- var mdText = "\n## \u89D2\u8272\n\n\u4F60\u7684\u4EFB\u52A1\u662F\u5206\u6790\u7528\u6237\u6D88\u606F\uFF0C\u63D0\u53D6\u51FA\u7528\u6237\u60F3\u8981\u67E5\u8BE2\u7684\u6570\u636E\u7C7B\u578B\u548C\u67E5\u8BE2\u6761\u4EF6\u3002\n\n## \u53C2\u6570\u8BF4\u660E\n\n* searchType: \u641C\u7D22\u7C7B\u578B\uFF0C\u679A\u4E3E\u503C:\n * contract: \u5408\u540C\n * order: \u8BA2\u5355\n * customer: \u5BA2\u6237\n* custName: \u5BA2\u6237\u540D\u79F0(\u4EBA\u540D\u6216\u516C\u53F8\u540D\u79F0)\uFF0C\u672B\u5C3E\u4E0D\u8981\u6709\"\u516C\u53F8\"\uFF0C\u4E0D\u80FD\u662F \"\u6211\u540D\u4E0B\"\n* custCode: \u5BA2\u6237\u7F16\u7801\n* productName: \u4EA7\u54C1\u540D\u79F0/\u4E1A\u52A1\u540D\u79F0\uFF0C\u672B\u5C3E\u4E0D\u8981\u6709\"\u4E1A\u52A1\"\u3002\u793A\u4F8B: \u96C6\u56E2WLAN, \u4E92\u8054\u7F51\u7535\u89C6, \u5546\u52A1\u4E13\u7EBF, \u6570\u636E\u4E13\u7EBFC2C, \u548C\u6559\u80B2\u7EDF\u4ED8, \u4E00\u7F51\u901A\n* contractStage: \u5408\u540C\u73AF\u8282\uFF0C\u679A\u4E3E\u503C\n * \u534F\u8BAE\u8D77\u8349\n * \u534F\u8BAE\u590D\u6838\n * \u534F\u8BAE\u5BA1\u6279: \u4E5F\u79F0\u5BA1\u6838, \u5BA1\u6279\u4E2D\n * \u534F\u8BAE\u4E8C\u6B21\u786E\u8BA4\n * \u52A0\u76D6\u7535\u5B50\u7B7E\u7AE0\n * \u534F\u8BAE\u7B7E\u8BA2\u5F52\u6863: \u4E5F\u79F0\u5F85\u7B7E\u7F72\n * \u534F\u8BAE\u8F6C\u8BA2\u5355\n* contractStatus: \u5408\u540C\u72B6\u6001\uFF0C\u679A\u4E3E\u503C:\n * 1000: \u53D7\u7406\n * 1100: \u751F\u6548\n * 1900: \u5DF2\u8F6C\u8BA2\u5355\n * 1300: \u5F52\u6863\n * 1700: \u5F85\u8F6C\u8BA2\u5355\n * 1800: \u90E8\u5206\u8F6C\u8BA2\u5355\n * 2100: \u6B63\u5F0F\u5408\u540C\n * 3100: \u5E9F\u5F03\n * 3000: \u8349\u7A3F\n * 3500: \u8F6C\u5355\u5931\u8D25\n * 2900: \u8D44\u6E90\u9884\u5224\u5355\u5BA1\u6838\u4E2D\n * 1910: \u5230\u671F\u5173\u95ED\n* minSignDate: \u5408\u540C\u7684\u6700\u5C0F\u8D77\u8349\u65E5\u671F/\u7B7E\u8BA2\u65E5\u671F\uFF08\u542B\uFF09\n* maxSignDate: \u5408\u540C\u7684\u6700\u5927\u8D77\u8349\u65E5\u671F/\u7B7E\u8BA2\u65E5\u671F\uFF08\u542B\uFF09\n* minDueDate: \u5408\u540C\u7684\u6700\u5C0F\u5230\u671F\u65E5\u671F\uFF08\u542B\uFF09\n* maxDueDate: \u5408\u540C\u7684\u6700\u5927\u5230\u671F\u65E5\u671F\uFF08\u542B\uFF09\n* minAmount: \u6700\u5C0F\u5408\u540C\u91D1\u989D\n* maxAmount: \u6700\u5927\u5408\u540C\u91D1\u989D\n* orderAction: \u8BA2\u5355\u64CD\u4F5C\u7C7B\u578B\uFF0C\u679A\u4E3E\u503C:\n * 201: \u65B0\u589E\n * 202: \u53D8\u66F4\n * 203: \u9500\u6237\n * 204: \u63D0\u524D\u7ED3\u675F\n * 205: \u552E\u540E\n * 206: \u8D44\u8D39\u53D8\u66F4\n * 207: \u6210\u5458\u6279\u91CF\u6DFB\u52A0\n * 208: \u6210\u5458\u6279\u91CF\u4FEE\u6539\n * 209: \u6210\u5458\u6279\u91CF\u6CE8\u9500\n * 102: \u5F00\u901A\u65BD\u5DE5\n * 103: \u53D8\u66F4\u65BD\u5DE5\n * 104: \u9000\u8FD8\n * 105: \u6CE8\u9500\n * 106: \u505C\u673A\n * 107: \u590D\u673A\n * 108: \u8FC7\u6237\n * 109: \u9886\u53D6\n * 110: \u52D8\u5BDF\n * 301: \u4EA4\u5E95\u9884\u7EA6\n* orderStatus: \u8BA2\u5355\u72B6\u6001\uFF0C\u679A\u4E3E\u503C:\n * 2000: \u521B\u5EFA\n * 2001: \u5F85\u5BA1\u6279\n * 2002: \u5BA1\u6279\u4E0D\u901A\u8FC7\n * 2005: \u5F85\u786E\u8BA4\n * 2006: \u5F85\u4E1A\u52A1\u529E\u7406\n * 2008: \u5DF2\u64A4\u5355\n * 2009: \u5DF2\u5B8C\u6210\n * 2010: \u4E1A\u52A1\u529E\u7406\u5931\u8D25\n * 2011: \u5F85\u7A3D\u6838\n * 2012: \u5DF2\u7ED3\u5355\n * 2014: \u7A3D\u6838\u5931\u8D25\n * 2015: \u5BA1\u6838\u4E0D\u901A\u8FC7\n * 2017: \u5904\u7406\u4E2D\n * 2018: \u9000\u5355\u4FEE\u6539\n * 2019: \u9884\u5904\u7406\n * 2021: \u7B49\u5F85\u6C47\u805A\n * 2024: \u5F85\u8425\u9500\u6848\u529E\u7406\n * 2025: \u56DE\u6536\u6682\u5B58\n * 2026: \u5F85\u5BA1\u6838\n * 2027: \u5931\u8D25\n * 2030: \u5F85\u652F\u4ED8\n * 2032: \u540C\u6B65CRM\u5931\u8D25\n\n\u8D77\u8349\u65E5\u671F\u3001\u5230\u671F\u65E5\u671F\u5404\u7528\u4E24\u4E2A\u53C2\u6570\u8868\u793A\u8303\u56F4\u3002\u793A\u4F8B\uFF1A\n\n* 2024 \u5E74 5 \u6708 15 \u65E5\u8D77\u8349\uFF0C\u8868\u793A minSignDate=2024-05-15, maxSignDate=2024-05-15\n* 2024 \u5E74 5 \u6708\u4EFD\u8D77\u8349\uFF0C\u8868\u793A minSignDate=2024-05-01, maxSignDate=2024-05-31\n* 2024 \u5E74 5 \u6708\u4EFD\u4E4B\u524D\u8D77\u8349\uFF0C\u8868\u793A maxSignDate=2024-04-31 (\u4E0A\u4E2A\u6708\u7684\u6700\u540E\u4E00\u5929)\n* 2024 \u5E74 5 \u6708\u4EFD\u4E4B\u540E\u8D77\u8349\uFF0C\u8868\u793A minSignDate=2024-06-01 (\u4E0B\u4E2A\u6708\u7684\u7B2C\u4E00\u5929)\n* 2024 \u5E74 5 \u6708 15 \u65E5\u5230\u671F\uFF0C\u8868\u793A minDueDate=2024-05-15, maxDueDate=2024-05-15\n* 2024 \u5E74 5 \u6708\u4EFD\u5230\u671F\uFF0C\u8868\u793A minDueDate=2024-05-01, maxDueDate=2024-05-31\n* 2024 \u5E74 5 \u6708\u4EFD\u4E4B\u524D\u5230\u671F\uFF0C\u8868\u793A maxDueDate=2024-04-31 (\u4E0A\u4E2A\u6708\u7684\u6700\u540E\u4E00\u5929)\n* 2024 \u5E74 5 \u6708\u4EFD\u4E4B\u540E\u5230\u671F\uFF0C\u8868\u793A minDueDate=2024-06-01 (\u4E0B\u4E2A\u6708\u7684\u7B2C\u4E00\u5929)\n\n\u5F53\u524D\u65E5\u671F\u662F , \u7528\u6237\u8BF4\u7684\u65E5\u671F\u4E0D\u5B8C\u6574\u65F6\u6839\u636E\u5F53\u524D\u65E5\u671F\u63A8\u65AD\u3002\n\n\u5408\u540C\u91D1\u989D\u7528 minAmount, maxAmount \u4E24\u4E2A\u53C2\u6570\u8868\u793A\u8303\u56F4:\n\n* \u5927\u4E8E\u7B49\u4E8E 1000 \u8868\u793A minAmount=1000, maxAmount=null\n* \u5927\u4E8E 1000 \u8868\u793A minAmount=1001, maxAmount=null\n* \u5C0F\u4E8E\u7B49\u4E8E 1000 \u8868\u793A minAmount=null, maxAmount=1000\n* \u5C0F\u4E8E 1000 \u8868\u793A minAmount=null, maxAmount=999\n* \u4E0D\u8D85\u8FC7 1000 \u7B49\u540C\u4E8E\u5C0F\u4E8E\u7B49\u4E8E 1000, \u8868\u793A minAmount=null, maxAmount=1000\n* \u4E0D\u5C11\u4E8E 1000 \u7B49\u540C\u4E8E\u5927\u4E8E\u7B49\u4E8E 1000, \u8868\u793A minAmount=1000, maxAmount=null\n\n\u5408\u540C\u72B6\u6001\u3001\u5408\u540C\u73AF\u8282\u9700\u8981\u505A\u4E9B\u7279\u6B8A\u5904\u7406:\n\n* \u5F85\u7B7E\u7F72\u5408\u540C\u8868\u793A contractStage=\u534F\u8BAE\u7B7E\u8BA2\u5F52\u6863, contractStatus=null\n* \u5BA1\u6838\u72B6\u6001\u7684\u5408\u540C\u3001\u5BA1\u6838\u4E2D\u5408\u540C\u3001\u5BA1\u6279\u4E2D\u5408\u540C\u8868\u793A contractStage=\u534F\u8BAE\u5BA1\u6279, contractStatus=null\n\n## \u6B65\u9AA4\n\n1. \u5148\u5224\u65AD\u7528\u6237\u60F3\u8981\u67E5\u8BE2\u7684\u6570\u636E\u7C7B\u578B(searchType)\uFF0C\u5982\u679C\u65E0\u6CD5\u51C6\u786E\u5224\u65AD\uFF0C\u76F4\u63A5\u9000\u51FA\n2. \u5982\u679C searchType=contract, \u63D0\u53D6\u4EE5\u4E0B\u53C2\u6570: custName, productName, contractStage, contractStatus, signDate, dueDate, amount\n3. \u5982\u679C searchType=order, \u63D0\u53D6\u4EE5\u4E0B\u53C2\u6570: productName, orderAction, orderStatus\n4. \u5982\u679C searchType=customer, \u63D0\u53D6\u4EE5\u4E0B\u53C2\u6570: custName, custCode\n\n## \u8F93\u51FA\n\n\u4EE5 JSON \u683C\u5F0F\u8F93\u51FA\u63D0\u53D6\u5230\u7684 searchType \u548C\u5176\u5B83\u53C2\u6570\uFF0C\u6BD4\u5982:\n\n\n\u5982\u679C\u63D0\u53D6\u4E0D\u5230 searchType, \u8F93\u51FA null:\n\n\n## \u793A\u4F8B 1\n\n\u8F93\u5165: \u6211\u60F3\u67E5\u6211\u540D\u4E0B\u516B\u6708\u4EFD\u8D77\u8349\u7684\u5BA1\u6279\u4E2D\u5408\u540C\n\n\u8F93\u51FA:\n\n\n## \u793A\u4F8B 2\n\n\u8F93\u5165: \u6211\u60F3\u67E5\u6D69\u9CB8\u516C\u53F8\u5341\u4E00\u6708\u4EFD\u8D77\u8349\uFF0C\u529E\u7406\u5546\u52A1\u4E13\u7EBF\u4E1A\u52A1\uFF0C\u91D1\u989D\u5927\u4E8E10\u4E07\u7684\u5F85\u8F6C\u8BA2\u5355\u5408\u540C\n\n\u8F93\u51FA:\n\n\n## \u793A\u4F8B 3\n\n\u8F93\u5165: \u8DDF\u6D69\u9CB8\u76F8\u5173\u7684\u8BA2\u5355\n\n\u8F93\u51FA:\n\n## \u793A\u4F8B 4\n\n\u8F93\u5165: \u5BA2\u6237\u540D\u79F0\uFF1A\u91D1\u725B\u5C71\n\n\u8F93\u51FA:\n\n";
4
- export default mdText;
@@ -1,159 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
11
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
16
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
- import { STYLE_ATTR } from "./constants";
18
- import { Node as SlateNode } from 'slate';
19
-
20
- // 获取html标签内容
21
- var parseHTML = function parseHTML(html) {
22
- var parser = new DOMParser();
23
- var doc = parser.parseFromString(html, 'text/html');
24
- function parseNode(htmlNode) {
25
- var elementAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
26
- var result = [];
27
- var nodeObj = {};
28
- // 处理属性
29
- if (htmlNode.nodeType === Node.TEXT_NODE) {
30
- var nodeText = htmlNode.textContent;
31
- nodeObj.text = nodeText;
32
- if (elementAttr) {
33
- nodeObj = _objectSpread(_objectSpread({}, nodeObj), elementAttr);
34
- }
35
- result.push(nodeObj);
36
- }
37
- if (htmlNode.nodeType === Node.ELEMENT_NODE) {
38
- var _htmlNode$tagName;
39
- var tagName = htmlNode === null || htmlNode === void 0 || (_htmlNode$tagName = htmlNode.tagName) === null || _htmlNode$tagName === void 0 ? void 0 : _htmlNode$tagName.toLocaleLowerCase();
40
- var attributes = {};
41
- if (htmlNode.attributes) {
42
- Array.from(htmlNode.attributes).forEach(function (attr) {
43
- var styleObj = {};
44
- if (attr.name === 'style' && attr !== null && attr !== void 0 && attr.value) {
45
- var _attr$value;
46
- var styleArr = attr === null || attr === void 0 || (_attr$value = attr.value) === null || _attr$value === void 0 ? void 0 : _attr$value.split(';');
47
- if (Array.isArray(styleArr) && styleArr.length > 0) {
48
- styleArr.forEach(function (styleItem) {
49
- var _styleItem$split = styleItem === null || styleItem === void 0 ? void 0 : styleItem.split(':'),
50
- _styleItem$split2 = _slicedToArray(_styleItem$split, 2),
51
- styleKey = _styleItem$split2[0],
52
- styleVal = _styleItem$split2[1];
53
- styleObj[styleKey] = styleVal;
54
- });
55
- }
56
- attributes = _objectSpread(_objectSpread({}, attributes), styleObj);
57
- } else if (tagName === 'a') {
58
- if (attr.name.startsWith('data-')) {
59
- var _attributes;
60
- attributes = _objectSpread(_objectSpread(_objectSpread({}, attributes), styleObj), {}, {
61
- action: _objectSpread(_objectSpread({}, ((_attributes = attributes) === null || _attributes === void 0 ? void 0 : _attributes.action) || {}), {}, _defineProperty({}, attr.name.replace('data-', ''), attr.value))
62
- });
63
- }
64
- } else {
65
- attributes[attr.name] = attr.value;
66
- }
67
- });
68
- }
69
- htmlNode.childNodes.forEach(function (child) {
70
- var parsedChild = parseNode(child, attributes);
71
- result.push.apply(result, _toConsumableArray(parsedChild));
72
- });
73
- }
74
- return result;
75
- }
76
- return parseNode(doc.body);
77
- };
78
-
79
- // 把markdown节点转换成字符串
80
- var serialize = function serialize(nodes) {
81
- var loopNodes = function loopNodes(items) {
82
- return items === null || items === void 0 ? void 0 : items.map(function (item) {
83
- var _item$children;
84
- var str = SlateNode.string(item);
85
- if (Array.isArray(item === null || item === void 0 ? void 0 : item.children) && (item === null || item === void 0 || (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.length) > 0) {
86
- str = loopNodes(item === null || item === void 0 ? void 0 : item.children).join('');
87
- }
88
- if (item !== null && item !== void 0 && item.text && Object.keys(item).length > 1) {
89
- var itemStyle = [];
90
- var actionArr = [];
91
- Object.keys(item).forEach(function (attrItem) {
92
- if (STYLE_ATTR.includes(attrItem)) {
93
- itemStyle.push("".concat(attrItem, ":").concat(item === null || item === void 0 ? void 0 : item[attrItem]));
94
- } else if (attrItem === 'action' && Object.keys(item === null || item === void 0 ? void 0 : item[attrItem]).length > 0) {
95
- Object.keys(item === null || item === void 0 ? void 0 : item[attrItem]).forEach(function (actionKey) {
96
- var _item$attrItem;
97
- actionArr.push("data-".concat(actionKey, "=\"").concat(item === null || item === void 0 || (_item$attrItem = item[attrItem]) === null || _item$attrItem === void 0 ? void 0 : _item$attrItem[actionKey], "\""));
98
- });
99
- }
100
- });
101
- if (actionArr.length > 0) {
102
- if (itemStyle.length > 0) {
103
- str = "<a href=\"javascript:void(0);\" style=\"".concat(itemStyle.join(';'), "\" ").concat(actionArr.join(' '), ">").concat(item === null || item === void 0 ? void 0 : item.text, "</a>");
104
- } else {
105
- str = "<a href=\"javascript:void(0);\" ".concat(actionArr.join(' '), ">").concat(item === null || item === void 0 ? void 0 : item.text, "</a>");
106
- }
107
- } else if (itemStyle.length > 0) {
108
- str = "<span style=\"".concat(itemStyle.join(';'), "\">").concat(item === null || item === void 0 ? void 0 : item.text, "</span>");
109
- }
110
- }
111
- return str;
112
- });
113
- };
114
- return loopNodes(nodes).join('\n');
115
- };
116
-
117
- // markdown转成nodes
118
- var deserialize = function deserialize(mdContent) {
119
- var lines = mdContent.split('\n');
120
- var nodes = lines.map(function (item) {
121
- var itemObj = {
122
- type: 'paragraph'
123
- };
124
- if (item.includes('<span') || item !== null && item !== void 0 && item.includes('<a')) {
125
- var nodeGroup = parseHTML(item);
126
- itemObj.children = nodeGroup;
127
- } else {
128
- itemObj.children = [{
129
- text: item
130
- }];
131
- }
132
- return itemObj;
133
- });
134
- return nodes;
135
- };
136
-
137
- // 变量分词
138
- var splitWords = function splitWords(textContent) {
139
- if (typeof textContent === 'string' && textContent.length > 0) {
140
- var regex = /\$\{(.+?)\}/g;
141
- var match = textContent.match(regex);
142
- var parts = textContent.split(regex);
143
- return parts.map(function (part) {
144
- if (match !== null && match !== void 0 && match.includes("${".concat(part, "}"))) {
145
- return {
146
- highlight: true,
147
- text: "${".concat(part, "}")
148
- };
149
- }
150
- return {
151
- text: part
152
- };
153
- });
154
- }
155
- return [{
156
- text: textContent
157
- }];
158
- };
159
- export { parseHTML, serialize, deserialize, splitWords };
@@ -1,122 +0,0 @@
1
- import React, { useMemo, memo } from 'react';
2
- import { Transforms, Range, Node } from 'slate';
3
- import { Slate, Editable, ReactEditor } from 'slate-react';
4
- import { isKeyHotkey } from 'is-hotkey';
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- var PlainText = function PlainText(_ref) {
7
- var editor = _ref.editor,
8
- decorate = _ref.decorate,
9
- value = _ref.value,
10
- _onChange = _ref.onChange,
11
- renderLeaf = _ref.renderLeaf,
12
- renderElement = _ref.renderElement,
13
- className = _ref.className,
14
- onCompositionStart = _ref.onCompositionStart,
15
- onCompositionEnd = _ref.onCompositionEnd,
16
- onKeyDown = _ref.onKeyDown,
17
- onFocus = _ref.onFocus,
18
- onBlur = _ref.onBlur,
19
- _ref$placeholder = _ref.placeholder,
20
- placeholder = _ref$placeholder === void 0 ? '请输入' : _ref$placeholder,
21
- _ref$readOnly = _ref.readOnly,
22
- readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
23
- toggleMouseWheel = _ref.toggleMouseWheel,
24
- onPaste = _ref.onPaste;
25
- // 把富文本节点转换成字符串
26
- var serialize = function serialize(valueNodes) {
27
- return valueNodes.map(function (n) {
28
- if (Array.isArray(n === null || n === void 0 ? void 0 : n.children)) {
29
- return serialize(n === null || n === void 0 ? void 0 : n.children);
30
- }
31
- return Node.string(n);
32
- }).join('\n');
33
- };
34
-
35
- // 把字符串转换成富文本节点
36
- var deserialize = function deserialize(content) {
37
- return content.split('\n').map(function (line) {
38
- return {
39
- children: [{
40
- text: line
41
- }]
42
- };
43
- });
44
- };
45
- var initialValue = useMemo(function () {
46
- return deserialize(value || '');
47
- }, []);
48
- var onHandleKeyDown = function onHandleKeyDown(event) {
49
- var selection = editor.selection;
50
- if (onKeyDown) {
51
- onKeyDown(event);
52
- }
53
-
54
- /**
55
- * 默认左/右行为为 unit:'character'.
56
- * 无法区分两个游标位置, 如:
57
- * <inline>foo<cursor/></inline> vs <inline>foo</inline><cursor/>
58
- * 这里我们将行为修改为 unit:'offset'
59
- */
60
- if (selection && Range.isCollapsed(selection)) {
61
- var nativeEvent = event.nativeEvent;
62
- if (isKeyHotkey('left', nativeEvent)) {
63
- event.preventDefault();
64
- Transforms.move(editor, {
65
- unit: 'offset',
66
- reverse: true
67
- });
68
- return;
69
- }
70
- if (isKeyHotkey('right', nativeEvent)) {
71
- event.preventDefault();
72
- Transforms.move(editor, {
73
- unit: 'offset'
74
- });
75
- }
76
- }
77
- };
78
- var onMouseEnter = function onMouseEnter(e) {
79
- var _e$currentTarget = e.currentTarget,
80
- scrollTop = _e$currentTarget.scrollTop,
81
- scrollHeight = _e$currentTarget.scrollHeight,
82
- clientHeight = _e$currentTarget.clientHeight;
83
- toggleMouseWheel === null || toggleMouseWheel === void 0 || toggleMouseWheel(false, scrollTop + scrollHeight > clientHeight);
84
- };
85
- var onMouseLeave = function onMouseLeave(e) {
86
- var _e$currentTarget2 = e.currentTarget,
87
- scrollTop = _e$currentTarget2.scrollTop,
88
- scrollHeight = _e$currentTarget2.scrollHeight,
89
- clientHeight = _e$currentTarget2.clientHeight;
90
- toggleMouseWheel === null || toggleMouseWheel === void 0 || toggleMouseWheel(true, scrollTop + scrollHeight > clientHeight);
91
- };
92
- return /*#__PURE__*/_jsx(Slate, {
93
- editor: editor,
94
- initialValue: initialValue,
95
- onChange: function onChange(nodes) {
96
- var textContent = serialize(nodes);
97
- if (_onChange) {
98
- _onChange(textContent, nodes);
99
- }
100
- },
101
- children: /*#__PURE__*/_jsx(Editable, {
102
- onClick: function onClick() {
103
- ReactEditor.focus(editor);
104
- },
105
- onMouseEnter: onMouseEnter,
106
- onMouseLeave: onMouseLeave,
107
- onCompositionStart: onCompositionStart,
108
- onCompositionEnd: onCompositionEnd,
109
- className: className,
110
- decorate: decorate,
111
- placeholder: placeholder,
112
- onKeyDown: onHandleKeyDown,
113
- renderLeaf: renderLeaf,
114
- renderElement: renderElement,
115
- onFocus: onFocus,
116
- onBlur: onBlur,
117
- readOnly: readOnly,
118
- onPaste: onPaste
119
- })
120
- });
121
- };
122
- export default /*#__PURE__*/memo(PlainText);
@@ -1,94 +0,0 @@
1
- .@{pro-prefix}-plain-text-box {
2
- &-wrap {
3
- position: relative;
4
- display: inline-flex;
5
- flex-direction: column;
6
- width: 100%;
7
- outline: none;
8
- border: 1px solid @border-color-base;
9
- border-radius: @border-radius-base;
10
- min-height: 32px;
11
- max-height: 320px;
12
- background: @component-background;
13
-
14
- &:hover,
15
- &:focus,
16
- &:active {
17
- border-color: @primary-color;
18
- box-shadow: 0 0 0 2px @primary-2;
19
- }
20
- }
21
-
22
- &-placeholder {
23
- position: absolute;
24
- z-index: 1;
25
- top: @space-xs;
26
- left: @space-sm;
27
- color: @disabled-color;
28
- pointer-events: none;
29
- }
30
-
31
- &-header,
32
- &-text,
33
- &-extra {
34
- padding: @space-xs @space-sm;
35
- }
36
-
37
- &-header {
38
- border-bottom: 1px solid @border-color-split;
39
- }
40
-
41
- &-container {
42
- position: relative;
43
- flex: 1;
44
- display: flex;
45
- overflow: hidden;
46
- }
47
-
48
- &-extra {
49
- display: flex;
50
- cursor: pointer;
51
- color: @gray-6;
52
- font-size: @font-size-sm;
53
-
54
- .anticon {
55
- margin: auto;
56
- }
57
-
58
- &:hover {
59
- color: @gray-7;
60
- }
61
- }
62
-
63
- &-text {
64
- position: relative;
65
- flex: 1;
66
- font-size: @font-size-base;
67
- color: @text-color;
68
- outline: none;
69
- overflow: auto;
70
- }
71
- }
72
-
73
- .@{pro-prefix}-plain-text-box-cursor {
74
- position: fixed;
75
- display: inline-block;
76
- width: 1px;
77
- height: 1px;
78
- }
79
-
80
- .@{pro-prefix}-plain-text-box-inline-chromium-bug-fix {
81
- font-size: 0;
82
- }
83
-
84
- .@{pro-prefix}-plain-text-box-badge {
85
- background: @blue-1;
86
- color: @blue-7;
87
- padding: 0 @space-xxs;
88
- border-radius: @border-radius-sm;
89
- display: inline;
90
- }
91
-
92
- .@{pro-prefix}-plain-text-box-popver {
93
- width: 320px;
94
- }