orion-design 0.1.31 → 0.1.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. package/README.md +5 -5
  2. package/dist/Throne/index.js +14 -30
  3. package/dist/Throne/index.js.map +1 -1
  4. package/dist/components/Button/index.js +33 -40
  5. package/dist/components/Button/index.js.map +1 -1
  6. package/dist/components/Flex/index.js +89 -122
  7. package/dist/components/Flex/index.js.map +1 -1
  8. package/dist/components/Form/Form.js +2 -2
  9. package/dist/components/Form/Form.js.map +1 -1
  10. package/dist/components/Form/LovInput/LovInput.js +2 -2
  11. package/dist/components/Form/LovInput/LovInput.js.map +1 -1
  12. package/dist/components/Form/LovInput/hooks/useLov.js +5 -5
  13. package/dist/components/Form/LovInput/hooks/useLov.js.map +1 -1
  14. package/dist/components/Form/LovInput/index.js +4 -4
  15. package/dist/components/Form/hooks/FormItemValidateTrigger.js +2 -2
  16. package/dist/components/Form/hooks/FormItemValidateTrigger.js.map +1 -1
  17. package/dist/components/Form/hooks/index.js +68 -127
  18. package/dist/components/Form/hooks/index.js.map +1 -1
  19. package/dist/components/Form/index.js +656 -836
  20. package/dist/components/Form/index.js.map +1 -1
  21. package/dist/components/Form/utils/index.js +18 -30
  22. package/dist/components/Form/utils/index.js.map +1 -1
  23. package/dist/components/LovTable/LovPagetable.vue.d.ts +492 -0
  24. package/dist/components/LovTable/index.d.ts +246 -0
  25. package/dist/components/LovTable/index.js +106 -179
  26. package/dist/components/LovTable/index.js.map +1 -1
  27. package/dist/components/Modal/index.js +56 -111
  28. package/dist/components/Modal/index.js.map +1 -1
  29. package/dist/components/Modal/types.d.ts +1 -1
  30. package/dist/components/Modal/types.js +3 -4
  31. package/dist/components/Modal/types.js.map +1 -1
  32. package/dist/components/Modal/useModal.js +5 -5
  33. package/dist/components/Modal/useModal.js.map +1 -1
  34. package/dist/components/Pagetable/Pagetable.d.ts +92 -1
  35. package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +13 -0
  36. package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +13 -0
  37. package/dist/components/Pagetable/columns/PagetableColumnLink.d.ts +13 -0
  38. package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +13 -0
  39. package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +13 -0
  40. package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +13 -0
  41. package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +13 -0
  42. package/dist/components/Pagetable/hooks/useColumns.js +85 -88
  43. package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
  44. package/dist/components/Pagetable/index.d.ts +155 -0
  45. package/dist/components/Pagetable/index.js +596 -683
  46. package/dist/components/Pagetable/index.js.map +1 -1
  47. package/dist/components/Pagetable/utils/index.js +54 -92
  48. package/dist/components/Pagetable/utils/index.js.map +1 -1
  49. package/dist/components/Querytable/hooks/useColumns.js +74 -82
  50. package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
  51. package/dist/components/Querytable/index.js +469 -579
  52. package/dist/components/Querytable/index.js.map +1 -1
  53. package/dist/components/Querytable/utils/index.js +54 -92
  54. package/dist/components/Querytable/utils/index.js.map +1 -1
  55. package/dist/components/RichTextEditor/index.js +74 -100
  56. package/dist/components/RichTextEditor/index.js.map +1 -1
  57. package/dist/components/Tabs/constants.js +2 -2
  58. package/dist/components/Tabs/constants.js.map +1 -1
  59. package/dist/components/Tabs/index.js +358 -603
  60. package/dist/components/Tabs/index.js.map +1 -1
  61. package/dist/components/Tabs/tab-bar.js +6 -6
  62. package/dist/components/Tabs/tab-bar.js.map +1 -1
  63. package/dist/components/Tabs/tab-pane.js +3 -3
  64. package/dist/components/Tabs/tab-pane.js.map +1 -1
  65. package/dist/components/_constants/aria.js +2 -2
  66. package/dist/components/_constants/aria.js.map +1 -1
  67. package/dist/components/_constants/event.js +4 -6
  68. package/dist/components/_constants/event.js.map +1 -1
  69. package/dist/components/_constants/index.js +6 -6
  70. package/dist/components/_hooks/index.js +7 -7
  71. package/dist/components/_hooks/use-namespace/index.js +39 -74
  72. package/dist/components/_hooks/use-namespace/index.js.map +1 -1
  73. package/dist/components/_hooks/use-ordered-children/index.js +19 -29
  74. package/dist/components/_hooks/use-ordered-children/index.js.map +1 -1
  75. package/dist/components/_util/arrays.js +5 -9
  76. package/dist/components/_util/arrays.js.map +1 -1
  77. package/dist/components/_util/browser.js +6 -6
  78. package/dist/components/_util/browser.js.map +1 -1
  79. package/dist/components/_util/classNames.js +17 -22
  80. package/dist/components/_util/classNames.js.map +1 -1
  81. package/dist/components/_util/dom/aria.js +39 -74
  82. package/dist/components/_util/dom/aria.js.map +1 -1
  83. package/dist/components/_util/dom/element.js +8 -9
  84. package/dist/components/_util/dom/element.js.map +1 -1
  85. package/dist/components/_util/dom/event.js +7 -14
  86. package/dist/components/_util/dom/event.js.map +1 -1
  87. package/dist/components/_util/dom/index.js +36 -36
  88. package/dist/components/_util/dom/position.js +25 -49
  89. package/dist/components/_util/dom/position.js.map +1 -1
  90. package/dist/components/_util/dom/scroll.js +61 -103
  91. package/dist/components/_util/dom/scroll.js.map +1 -1
  92. package/dist/components/_util/dom/style.js +50 -65
  93. package/dist/components/_util/dom/style.js.map +1 -1
  94. package/dist/components/_util/easings.js +4 -8
  95. package/dist/components/_util/easings.js.map +1 -1
  96. package/dist/components/_util/error.js +11 -12
  97. package/dist/components/_util/error.js.map +1 -1
  98. package/dist/components/_util/functions.js +3 -3
  99. package/dist/components/_util/i18n.js +2 -2
  100. package/dist/components/_util/i18n.js.map +1 -1
  101. package/dist/components/_util/index.js +137 -137
  102. package/dist/components/_util/isValid.js +2 -4
  103. package/dist/components/_util/isValid.js.map +1 -1
  104. package/dist/components/_util/objects.js +14 -18
  105. package/dist/components/_util/objects.js.map +1 -1
  106. package/dist/components/_util/props-util/index.js +20 -46
  107. package/dist/components/_util/props-util/index.js.map +1 -1
  108. package/dist/components/_util/props-util/initDefaultProps.js +10 -18
  109. package/dist/components/_util/props-util/initDefaultProps.js.map +1 -1
  110. package/dist/components/_util/raf.js +4 -5
  111. package/dist/components/_util/raf.js.map +1 -1
  112. package/dist/components/_util/rand.js +3 -4
  113. package/dist/components/_util/rand.js.map +1 -1
  114. package/dist/components/_util/strings.js +8 -9
  115. package/dist/components/_util/strings.js.map +1 -1
  116. package/dist/components/_util/throttleByRaf.js +10 -16
  117. package/dist/components/_util/throttleByRaf.js.map +1 -1
  118. package/dist/components/_util/type.js +38 -41
  119. package/dist/components/_util/type.js.map +1 -1
  120. package/dist/components/_util/types.js +22 -41
  121. package/dist/components/_util/types.js.map +1 -1
  122. package/dist/components/_util/typescript.js +2 -2
  123. package/dist/components/_util/typescript.js.map +1 -1
  124. package/dist/components/_util/util.js +43 -85
  125. package/dist/components/_util/util.js.map +1 -1
  126. package/dist/components/_util/vue/global-node.js +15 -27
  127. package/dist/components/_util/vue/global-node.js.map +1 -1
  128. package/dist/components/_util/vue/icon.js +25 -29
  129. package/dist/components/_util/vue/icon.js.map +1 -1
  130. package/dist/components/_util/vue/index.js +41 -41
  131. package/dist/components/_util/vue/install.js +18 -35
  132. package/dist/components/_util/vue/install.js.map +1 -1
  133. package/dist/components/_util/vue/props/index.js +6 -6
  134. package/dist/components/_util/vue/props/runtime.js +30 -46
  135. package/dist/components/_util/vue/props/runtime.js.map +1 -1
  136. package/dist/components/_util/vue/refs.js +6 -12
  137. package/dist/components/_util/vue/refs.js.map +1 -1
  138. package/dist/components/_util/vue/size.js +3 -5
  139. package/dist/components/_util/vue/size.js.map +1 -1
  140. package/dist/components/_util/vue/validator.js +4 -5
  141. package/dist/components/_util/vue/validator.js.map +1 -1
  142. package/dist/components/_util/vue/vnode.js +54 -100
  143. package/dist/components/_util/vue/vnode.js.map +1 -1
  144. package/dist/components/_util/vue-types/index.js +220 -231
  145. package/dist/components/_util/vue-types/index.js.map +1 -1
  146. package/dist/components/components.js +20 -20
  147. package/dist/components/index.js +35 -38
  148. package/dist/components/index.js.map +1 -1
  149. package/dist/error/OrionError.js +4 -8
  150. package/dist/error/OrionError.js.map +1 -1
  151. package/dist/index.css +1 -797
  152. package/dist/index.js +36 -36
  153. package/dist/print/LodopFuncs.js +43 -101
  154. package/dist/print/LodopFuncs.js.map +1 -1
  155. package/dist/print/index.js +108 -200
  156. package/dist/print/index.js.map +1 -1
  157. package/dist/request/ErrorHandlerChain.js +14 -17
  158. package/dist/request/ErrorHandlerChain.js.map +1 -1
  159. package/dist/request/RequestFilterChain.js +13 -16
  160. package/dist/request/RequestFilterChain.js.map +1 -1
  161. package/dist/request/ResponseParserChain.js +14 -17
  162. package/dist/request/ResponseParserChain.js.map +1 -1
  163. package/dist/request/disivion/DateSerializer.js +22 -47
  164. package/dist/request/disivion/DateSerializer.js.map +1 -1
  165. package/dist/request/disivion/DivisionErrorHandler.js +25 -40
  166. package/dist/request/disivion/DivisionErrorHandler.js.map +1 -1
  167. package/dist/request/disivion/DivisionResponseParser.js +10 -16
  168. package/dist/request/disivion/DivisionResponseParser.js.map +1 -1
  169. package/dist/request/disivion/index.js +201 -305
  170. package/dist/request/disivion/index.js.map +1 -1
  171. package/dist/request/error/BizExceptionResponseError.js +5 -11
  172. package/dist/request/error/BizExceptionResponseError.js.map +1 -1
  173. package/dist/request/error/ExceptionResponseError.js +5 -11
  174. package/dist/request/error/ExceptionResponseError.js.map +1 -1
  175. package/dist/request/error/ResponseError.js +4 -9
  176. package/dist/request/error/ResponseError.js.map +1 -1
  177. package/dist/request/error/SessionExceptionResponseError.js +5 -11
  178. package/dist/request/error/SessionExceptionResponseError.js.map +1 -1
  179. package/dist/request/index.js +11 -11
  180. package/dist/utils/DateUtil.js +33 -48
  181. package/dist/utils/DateUtil.js.map +1 -1
  182. package/dist/utils/NumberUtil.js +6 -6
  183. package/dist/utils/NumberUtil.js.map +1 -1
  184. package/dist/utils/cloneDeep.js +2 -2
  185. package/dist/utils/delay.js +3 -3
  186. package/dist/utils/delay.js.map +1 -1
  187. package/dist/utils/functions.js +3 -3
  188. package/dist/utils/index.js +12 -12
  189. package/dist/utils/md5.js +93 -191
  190. package/dist/utils/md5.js.map +1 -1
  191. package/dist/utils/uuid.js +25 -35
  192. package/dist/utils/uuid.js.map +1 -1
  193. package/dist/version/index.js +2 -2
  194. package/dist/version/version.d.ts +1 -1
  195. package/dist/version/version.js +2 -2
  196. package/dist/version/version.js.map +1 -1
  197. package/package.json +1 -1
  198. package/dist/_commonjsHelpers-DWwsNxpa.js +0 -9
  199. package/dist/_commonjsHelpers-DWwsNxpa.js.map +0 -1
  200. package/dist/components-B3d9m_tn.js +0 -27
  201. package/dist/components-B3d9m_tn.js.map +0 -1
  202. package/dist/functions-BeMkokbY.js +0 -63
  203. package/dist/functions-BeMkokbY.js.map +0 -1
  204. package/dist/index-BOKLZnqH.js +0 -54
  205. package/dist/index-BOKLZnqH.js.map +0 -1
  206. package/dist/index-D1m0KTpK.js +0 -69
  207. package/dist/index-D1m0KTpK.js.map +0 -1
  208. package/dist/index-DR5ZP7mD.js +0 -160
  209. package/dist/index-DR5ZP7mD.js.map +0 -1
  210. package/dist/index-DkwIULcN.js +0 -200
  211. package/dist/index-DkwIULcN.js.map +0 -1
@@ -1,132 +1,106 @@
1
1
  import "lodash-es";
2
- import { defineComponent, ref, onMounted, watch, onBeforeUnmount, createVNode } from "vue";
3
- import { withInstall } from "../_util/vue/install.js";
2
+ import { defineComponent as g, ref as l, onMounted as x, watch as s, onBeforeUnmount as b, createVNode as i } from "vue";
3
+ import { withInstall as y } from "../_util/vue/install.js";
4
4
  import "element-plus";
5
- import OrionError from "../../error/OrionError.js";
6
- import { booleanType, functionType } from "../_util/type.js";
7
- import { createEditor, createToolbar } from "@wangeditor/editor";
8
- const richTextEditorProps = () => ({
5
+ import f from "../../error/OrionError.js";
6
+ import { booleanType as w, functionType as T } from "../_util/type.js";
7
+ import { createEditor as E, createToolbar as I } from "@wangeditor/editor";
8
+ const R = () => ({
9
9
  modelValue: String,
10
- readonly: booleanType(false),
11
- uploadImage: functionType()
12
- });
13
- const RichTextEditor = /* @__PURE__ */ defineComponent({
10
+ readonly: w(!1),
11
+ uploadImage: T()
12
+ }), C = /* @__PURE__ */ g({
14
13
  name: "ORichTextEditor",
15
- inheritAttrs: false,
16
- props: richTextEditorProps(),
14
+ inheritAttrs: !1,
15
+ props: R(),
17
16
  emits: ["update:modelValue"],
18
- setup(props, {
19
- slots,
20
- attrs,
21
- emit,
22
- expose
17
+ setup(t, {
18
+ slots: O,
19
+ attrs: V,
20
+ emit: m,
21
+ expose: p
23
22
  }) {
24
- const editorRef = ref(null);
25
- const editorWrapperDOMRef = ref();
26
- const editorContainerDOMRef = ref();
27
- const toolbarContainerDOMRef = ref();
28
- expose({
23
+ const e = l(null), h = l(), d = l(), u = l();
24
+ return p({
29
25
  focus: () => {
30
- var _a;
31
- (_a = editorRef.value) == null ? void 0 : _a.focus();
26
+ var o;
27
+ (o = e.value) == null || o.focus();
32
28
  }
33
- });
34
- onMounted(() => {
35
- const editorConfig = {
29
+ }), x(() => {
30
+ const o = {
36
31
  placeholder: "请输入内容...",
37
- onChange(editor2) {
38
- const html = editor2.getHtml();
39
- emit("update:modelValue", html);
32
+ onChange(a) {
33
+ const n = a.getHtml();
34
+ m("update:modelValue", n);
40
35
  },
41
- readOnly: props.readonly,
42
- autoFocus: true,
43
- scroll: true,
36
+ readOnly: t.readonly,
37
+ autoFocus: !0,
38
+ scroll: !0,
44
39
  MENU_CONF: {
45
40
  uploadImage: {
46
41
  // 自定义上传
47
- async customUpload(file, insertFn) {
48
- if (props.uploadImage) {
49
- const ret = await props.uploadImage(file);
50
- if (ret == null || ret === false) {
42
+ async customUpload(a, n) {
43
+ if (t.uploadImage) {
44
+ const r = await t.uploadImage(a);
45
+ if (r == null || r === !1)
51
46
  return;
52
- }
53
- if (!ret.url) {
54
- throw new OrionError(`RichTextEditor: 图片上传接口 uploadImage 的返回数据中未包含 url 字段。`);
55
- }
56
- insertFn(ret.url, ret.alt, ret.href);
57
- } else {
58
- throw new OrionError(`RichTextEditor: 未实现文件上传接口onUpload。`);
59
- }
47
+ if (!r.url)
48
+ throw new f("RichTextEditor: 图片上传接口 uploadImage 的返回数据中未包含 url 字段。");
49
+ n(r.url, r.alt, r.href);
50
+ } else
51
+ throw new f("RichTextEditor: 未实现文件上传接口onUpload。");
60
52
  }
61
53
  }
62
54
  }
63
- };
64
- const editor = createEditor({
65
- selector: editorContainerDOMRef.value,
66
- html: props.modelValue,
55
+ }, c = E({
56
+ selector: d.value,
57
+ html: t.modelValue,
67
58
  // 初始值
68
- config: editorConfig,
59
+ config: o,
69
60
  mode: "default"
70
61
  });
71
- editorRef.value = editor;
72
- const toolbarConfig = {
62
+ e.value = c;
63
+ const v = {
73
64
  excludeKeys: ["blockquote", "bulletedList", "numberedList", "todo", "emotion", "insertLink", "insertImage", "group-video", "insertTable", "codeBlock"]
74
65
  };
75
- createToolbar({
76
- editor,
77
- selector: toolbarContainerDOMRef.value,
78
- config: toolbarConfig,
66
+ I({
67
+ editor: c,
68
+ selector: u.value,
69
+ config: v,
79
70
  mode: "default"
80
71
  // or 'simple'
81
72
  });
82
- });
83
- watch(() => props.modelValue, (modelValue) => {
84
- if (editorRef.value) {
85
- editorRef.value.setHtml(modelValue || "");
73
+ }), s(() => t.modelValue, (o) => {
74
+ e.value && e.value.setHtml(o || "");
75
+ }), s(() => t.readonly, (o) => {
76
+ e.value && (o ? e.value.disable() : e.value.enable());
77
+ }), b(() => {
78
+ e.value != null && (e.value.destroy(), e.value = null);
79
+ }), () => i("div", {
80
+ class: "orion-rich-text-editor—wrapper",
81
+ ref: h,
82
+ style: {
83
+ border: "1px solid #ccc",
84
+ zIndex: 100
86
85
  }
87
- });
88
- watch(() => props.readonly, (readonly) => {
89
- if (editorRef.value) {
90
- if (readonly) {
91
- editorRef.value.disable();
92
- } else {
93
- editorRef.value.enable();
94
- }
86
+ }, [i("div", {
87
+ class: "orion-rich-text-toolbar-container",
88
+ ref: u,
89
+ style: {
90
+ borderBottom: "1px solid #ccc"
95
91
  }
96
- });
97
- onBeforeUnmount(() => {
98
- if (editorRef.value == null) return;
99
- editorRef.value.destroy();
100
- editorRef.value = null;
101
- });
102
- return () => {
103
- return createVNode("div", {
104
- "class": "orion-rich-text-editor—wrapper",
105
- "ref": editorWrapperDOMRef,
106
- "style": {
107
- border: "1px solid #ccc",
108
- zIndex: 100
109
- }
110
- }, [createVNode("div", {
111
- "class": "orion-rich-text-toolbar-container",
112
- "ref": toolbarContainerDOMRef,
113
- "style": {
114
- borderBottom: "1px solid #ccc"
115
- }
116
- }, null), createVNode("div", {
117
- "class": "orion-rich-text-editor-container",
118
- "ref": editorContainerDOMRef,
119
- "style": {
120
- overflowY: "hidden"
121
- }
122
- }, null)]);
123
- };
92
+ }, null), i("div", {
93
+ class: "orion-rich-text-editor-container",
94
+ ref: d,
95
+ style: {
96
+ overflowY: "hidden"
97
+ }
98
+ }, null)]);
124
99
  }
125
- });
126
- const index = withInstall(
127
- RichTextEditor
100
+ }), F = y(
101
+ C
128
102
  );
129
103
  export {
130
- index as default
104
+ F as default
131
105
  };
132
106
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/RichTextEditor/RichTextEditor.tsx","../../../src/components/RichTextEditor/index.ts"],"sourcesContent":["import { computed, defineComponent, ref, onBeforeUnmount, onMounted, watch } from 'vue'\r\nimport type { PropType, ExtractPropTypes, CSSProperties, Plugin, App } from 'vue'\r\nimport classNames from '../_util/classNames'\r\nimport OrionError from '../../error/OrionError'\r\nimport { anyType, booleanType, functionType, objectType, someType, stringType, tuple } from '../_util/type'\r\n\r\nimport { createEditor, createToolbar, DomEditor } from '@wangeditor/editor'\r\nimport type { IDomEditor, IEditorConfig, IToolbarConfig } from '@wangeditor/editor'\r\n\r\nexport const richTextEditorProps = () => ({\r\n modelValue: String,\r\n readonly: booleanType(false),\r\n uploadImage: functionType<(file: File) => { url: string; alt?: string; href?: string } | null | false>(),\r\n})\r\n\r\nexport type RichTextEditorProps = Partial<ExtractPropTypes<ReturnType<typeof richTextEditorProps>>>\r\n\r\ntype InsertFnType = (url: string, alt: string, href: string) => void\r\n\r\nexport default defineComponent({\r\n name: 'ORichTextEditor',\r\n inheritAttrs: false,\r\n props: richTextEditorProps(),\r\n emits: ['update:modelValue'],\r\n setup(props, { slots, attrs, emit, expose }) {\r\n const editorRef = ref<IDomEditor | null>(null) // TS 语法\r\n const editorWrapperDOMRef = ref<HTMLDivElement>()\r\n const editorContainerDOMRef = ref<HTMLDivElement>()\r\n const toolbarContainerDOMRef = ref<HTMLDivElement>()\r\n\r\n expose({\r\n focus: () => {\r\n editorRef.value?.focus()\r\n },\r\n })\r\n\r\n onMounted(() => {\r\n // 编辑器配置\r\n const editorConfig: IEditorConfig = {\r\n placeholder: '请输入内容...',\r\n onChange(editor) {\r\n const html = editor.getHtml()\r\n emit('update:modelValue', html)\r\n },\r\n readOnly: props.readonly,\r\n autoFocus: true,\r\n scroll: true,\r\n MENU_CONF: {\r\n uploadImage: {\r\n // 自定义上传\r\n async customUpload(file: File, insertFn: InsertFnType) {\r\n if (props.uploadImage) {\r\n const ret = await props.uploadImage(file)\r\n\r\n if (ret == null || ret === false) {\r\n return\r\n }\r\n\r\n if (!ret.url) {\r\n throw new OrionError(`RichTextEditor: 图片上传接口 uploadImage 的返回数据中未包含 url 字段。`)\r\n }\r\n\r\n insertFn(ret.url, ret.alt, ret.href)\r\n } else {\r\n throw new OrionError(`RichTextEditor: 未实现文件上传接口onUpload。`)\r\n }\r\n },\r\n },\r\n },\r\n }\r\n const editor = createEditor({\r\n selector: editorContainerDOMRef.value!,\r\n html: props.modelValue, // 初始值\r\n config: editorConfig,\r\n mode: 'default',\r\n })\r\n editorRef.value = editor\r\n\r\n // 工具栏配置\r\n const toolbarConfig: Partial<IToolbarConfig> = {\r\n excludeKeys: ['blockquote', 'bulletedList', 'numberedList', 'todo', 'emotion', 'insertLink', 'insertImage', 'group-video', 'insertTable', 'codeBlock'],\r\n }\r\n\r\n const toolbar = createToolbar({\r\n editor,\r\n selector: toolbarContainerDOMRef.value!,\r\n config: toolbarConfig,\r\n mode: 'default', // or 'simple'\r\n })\r\n\r\n // const t = DomEditor.getToolbar(editor)\r\n // const curToolbarConfig = t.getConfig()\r\n // console.log(curToolbarConfig.toolbarKeys) // 当前菜单排序和分组\r\n })\r\n\r\n watch(\r\n () => props.modelValue,\r\n (modelValue) => {\r\n if (editorRef.value) {\r\n editorRef.value.setHtml(modelValue || '')\r\n }\r\n }\r\n )\r\n\r\n watch(\r\n () => props.readonly,\r\n (readonly) => {\r\n if (editorRef.value) {\r\n if (readonly) {\r\n editorRef.value.disable()\r\n } else {\r\n editorRef.value.enable()\r\n }\r\n }\r\n }\r\n )\r\n\r\n onBeforeUnmount(() => {\r\n if (editorRef.value == null) return\r\n editorRef.value.destroy()\r\n editorRef.value = null\r\n })\r\n\r\n return () => {\r\n return (\r\n <div class=\"orion-rich-text-editor—wrapper\" ref={editorWrapperDOMRef} style={{ border: '1px solid #ccc', zIndex: 100 }}>\r\n <div class=\"orion-rich-text-toolbar-container\" ref={toolbarContainerDOMRef} style={{ borderBottom: '1px solid #ccc' }}></div>\r\n <div class=\"orion-rich-text-editor-container\" ref={editorContainerDOMRef} style={{ overflowY: 'hidden' }}></div>\r\n </div>\r\n )\r\n }\r\n },\r\n})\r\n","import { withInstall } from '../_util'\r\n\r\nimport RichTextEditor from './RichTextEditor'\r\n\r\nexport type { RichTextEditorProps } from \"./RichTextEditor\"\r\n\r\nexport default withInstall<typeof RichTextEditor, {}>(\r\n RichTextEditor\r\n)\r\n"],"names":["richTextEditorProps","modelValue","String","readonly","booleanType","uploadImage","functionType","defineComponent","name","inheritAttrs","props","emits","setup","slots","attrs","emit","expose","editorRef","ref","editorWrapperDOMRef","editorContainerDOMRef","toolbarContainerDOMRef","focus","value","onMounted","editorConfig","placeholder","onChange","editor","html","getHtml","readOnly","autoFocus","scroll","MENU_CONF","customUpload","file","insertFn","ret","url","OrionError","alt","href","createEditor","selector","config","mode","toolbarConfig","excludeKeys","createToolbar","watch","setHtml","disable","enable","onBeforeUnmount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;AAAA,MAAC,GAAA,IAAA,GAAAH,YAAA,OAAA;AAAA,QAAA,SAAA;AAAA,QAAA,OAClEpC;AAAAA,QAAqB,SAAS;AAAA,UAAEwC,WAAW;AAAA,QAAS;AAAA,MAAC,GAAA,IAAA,CAAA,CAAA;AAAA;EAIhH;AACF,CAAC;AC9HD,MAAA,QAAe;AAAA,EACb;AACF;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/RichTextEditor/RichTextEditor.tsx","../../../src/components/RichTextEditor/index.ts"],"sourcesContent":["import { computed, defineComponent, ref, onBeforeUnmount, onMounted, watch } from 'vue'\r\nimport type { PropType, ExtractPropTypes, CSSProperties, Plugin, App } from 'vue'\r\nimport classNames from '../_util/classNames'\r\nimport OrionError from '../../error/OrionError'\r\nimport { anyType, booleanType, functionType, objectType, someType, stringType, tuple } from '../_util/type'\r\n\r\nimport { createEditor, createToolbar, DomEditor } from '@wangeditor/editor'\r\nimport type { IDomEditor, IEditorConfig, IToolbarConfig } from '@wangeditor/editor'\r\n\r\nexport const richTextEditorProps = () => ({\r\n modelValue: String,\r\n readonly: booleanType(false),\r\n uploadImage: functionType<(file: File) => { url: string; alt?: string; href?: string } | null | false>(),\r\n})\r\n\r\nexport type RichTextEditorProps = Partial<ExtractPropTypes<ReturnType<typeof richTextEditorProps>>>\r\n\r\ntype InsertFnType = (url: string, alt: string, href: string) => void\r\n\r\nexport default defineComponent({\r\n name: 'ORichTextEditor',\r\n inheritAttrs: false,\r\n props: richTextEditorProps(),\r\n emits: ['update:modelValue'],\r\n setup(props, { slots, attrs, emit, expose }) {\r\n const editorRef = ref<IDomEditor | null>(null) // TS 语法\r\n const editorWrapperDOMRef = ref<HTMLDivElement>()\r\n const editorContainerDOMRef = ref<HTMLDivElement>()\r\n const toolbarContainerDOMRef = ref<HTMLDivElement>()\r\n\r\n expose({\r\n focus: () => {\r\n editorRef.value?.focus()\r\n },\r\n })\r\n\r\n onMounted(() => {\r\n // 编辑器配置\r\n const editorConfig: IEditorConfig = {\r\n placeholder: '请输入内容...',\r\n onChange(editor) {\r\n const html = editor.getHtml()\r\n emit('update:modelValue', html)\r\n },\r\n readOnly: props.readonly,\r\n autoFocus: true,\r\n scroll: true,\r\n MENU_CONF: {\r\n uploadImage: {\r\n // 自定义上传\r\n async customUpload(file: File, insertFn: InsertFnType) {\r\n if (props.uploadImage) {\r\n const ret = await props.uploadImage(file)\r\n\r\n if (ret == null || ret === false) {\r\n return\r\n }\r\n\r\n if (!ret.url) {\r\n throw new OrionError(`RichTextEditor: 图片上传接口 uploadImage 的返回数据中未包含 url 字段。`)\r\n }\r\n\r\n insertFn(ret.url, ret.alt, ret.href)\r\n } else {\r\n throw new OrionError(`RichTextEditor: 未实现文件上传接口onUpload。`)\r\n }\r\n },\r\n },\r\n },\r\n }\r\n const editor = createEditor({\r\n selector: editorContainerDOMRef.value!,\r\n html: props.modelValue, // 初始值\r\n config: editorConfig,\r\n mode: 'default',\r\n })\r\n editorRef.value = editor\r\n\r\n // 工具栏配置\r\n const toolbarConfig: Partial<IToolbarConfig> = {\r\n excludeKeys: ['blockquote', 'bulletedList', 'numberedList', 'todo', 'emotion', 'insertLink', 'insertImage', 'group-video', 'insertTable', 'codeBlock'],\r\n }\r\n\r\n const toolbar = createToolbar({\r\n editor,\r\n selector: toolbarContainerDOMRef.value!,\r\n config: toolbarConfig,\r\n mode: 'default', // or 'simple'\r\n })\r\n\r\n // const t = DomEditor.getToolbar(editor)\r\n // const curToolbarConfig = t.getConfig()\r\n // console.log(curToolbarConfig.toolbarKeys) // 当前菜单排序和分组\r\n })\r\n\r\n watch(\r\n () => props.modelValue,\r\n (modelValue) => {\r\n if (editorRef.value) {\r\n editorRef.value.setHtml(modelValue || '')\r\n }\r\n }\r\n )\r\n\r\n watch(\r\n () => props.readonly,\r\n (readonly) => {\r\n if (editorRef.value) {\r\n if (readonly) {\r\n editorRef.value.disable()\r\n } else {\r\n editorRef.value.enable()\r\n }\r\n }\r\n }\r\n )\r\n\r\n onBeforeUnmount(() => {\r\n if (editorRef.value == null) return\r\n editorRef.value.destroy()\r\n editorRef.value = null\r\n })\r\n\r\n return () => {\r\n return (\r\n <div class=\"orion-rich-text-editor—wrapper\" ref={editorWrapperDOMRef} style={{ border: '1px solid #ccc', zIndex: 100 }}>\r\n <div class=\"orion-rich-text-toolbar-container\" ref={toolbarContainerDOMRef} style={{ borderBottom: '1px solid #ccc' }}></div>\r\n <div class=\"orion-rich-text-editor-container\" ref={editorContainerDOMRef} style={{ overflowY: 'hidden' }}></div>\r\n </div>\r\n )\r\n }\r\n },\r\n})\r\n","import { withInstall } from '../_util'\r\n\r\nimport RichTextEditor from './RichTextEditor'\r\n\r\nexport type { RichTextEditorProps } from \"./RichTextEditor\"\r\n\r\nexport default withInstall<typeof RichTextEditor, {}>(\r\n RichTextEditor\r\n)\r\n"],"names":["richTextEditorProps","modelValue","String","readonly","booleanType","uploadImage","functionType","defineComponent","name","inheritAttrs","props","emits","setup","slots","attrs","emit","expose","editorRef","ref","editorWrapperDOMRef","editorContainerDOMRef","toolbarContainerDOMRef","focus","value","onMounted","editorConfig","placeholder","onChange","editor","html","getHtml","readOnly","autoFocus","scroll","MENU_CONF","customUpload","file","insertFn","ret","url","OrionError","alt","href","createEditor","selector","config","mode","toolbarConfig","excludeKeys","createToolbar","watch","setHtml","disable","enable","onBeforeUnmount","destroy","_createVNode","border","zIndex","borderBottom","overflowY","index","withInstall","RichTextEditor"],"mappings":";;;;;;;AASO,MAAMA,IAAsBA,OAAO;AAAA,EACxCC,YAAYC;AAAAA,EACZC,UAAUC,EAAY,EAAK;AAAA,EAC3BC,aAAaC,EAA0F;AACzG,IAMeC,sBAAgB;AAAA,EAC7BC,MAAM;AAAA,EACNC,cAAc;AAAA,EACdC,OAAOV,EAAqB;AAAA,EAC5BW,OAAO,CAAC,mBAAmB;AAAA,EAC3BC,MAAMF,GAAO;AAAA,IAAEG,OAAAA;AAAAA,IAAOC,OAAAA;AAAAA,IAAOC,MAAAA;AAAAA,IAAMC,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A,QACAgB,UAAUvB,EAAuBE;AAAAA,QACjCsB,QAAQE;AAAAA,QACRD,MAAM;AAAA;AAAA,MACR,CAAC;AAAA,IAKH,CAAC,GAEDI,EACE,MAAMxC,EAAMT,YACXA,CAAAA,MAAe;AACd,MAAIgB,EAAUM,SACZN,EAAUM,MAAM4B,QAAQlD,KAAc,EAAE;AAAA,IAE5C,CACF,GAEAiD,EACE,MAAMxC,EAAMP,UACXA,CAAAA,MAAa;AACZ,MAAIc,EAAUM,UACRpB,IACFc,EAAUM,MAAM6B,YAEhBnC,EAAUM,MAAM8B;IAGtB,CACF,GAEAC,EAAgB,MAAM;AACpB,MAAIrC,EAAUM,SAAS,SACvBN,EAAUM,MAAMgC,WAChBtC,EAAUM,QAAQ;AAAA,IACpB,CAAC,GAEM,MACLiC,EAAA,OAAA;AAAA,MAAA,OAAA;AAAA,MAAA,KACmDrC;AAAAA,MAAmB,OAAS;AAAA,QAAEsC,QAAQ;AAAA,QAAkBC,QAAQ;AAAA,MAAI;AAAA,IAAC,GAAA,CAAAF,EAAA,OAAA;AAAA,MAAA,OAAA;AAAA,MAAA,KAChEnC;AAAAA,MAAsB,OAAS;AAAA,QAAEsC,cAAc;AAAA,MAAiB;AAAA,IAAC,GAAA,IAAA,GAAAH,EAAA,OAAA;AAAA,MAAA,OAAA;AAAA,MAAA,KAClEpC;AAAAA,MAAqB,OAAS;AAAA,QAAEwC,WAAW;AAAA,MAAS;AAAA,IAAC,GAAA,IAAA,CAAA,CAAA;AAAA,EAIhH;AACF,CAAC,GC9HDC,IAAeC;AAAA,EACbC;AACF;"}
@@ -1,5 +1,5 @@
1
- const tabsRootContextKey = Symbol("tabsRootContextKey");
1
+ const t = Symbol("tabsRootContextKey");
2
2
  export {
3
- tabsRootContextKey
3
+ t as tabsRootContextKey
4
4
  };
5
5
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../src/components/Tabs/constants.ts"],"sourcesContent":["import type { ComputedRef, InjectionKey, Ref, Slots, UnwrapRef } from 'vue'\r\nimport type { TabsProps } from './tabs'\r\nimport type { TabPaneProps } from './tab-pane'\r\n\r\nexport type TabsPaneContext = UnwrapRef<{\r\n uid: number\r\n slots: Slots\r\n props: TabPaneProps\r\n paneName: ComputedRef<string | number | undefined>\r\n active: ComputedRef<boolean>\r\n index: Ref<string | undefined>\r\n}>\r\n\r\nexport interface TabsRootContext {\r\n props: TabsProps\r\n currentName: Ref<string | number>\r\n registerPane: (pane: TabsPaneContext) => void\r\n sortPane: (pane: TabsPaneContext) => void\r\n unregisterPane: (uid: number) => void\r\n}\r\n\r\nexport const tabsRootContextKey: InjectionKey<TabsRootContext> =\r\n Symbol('tabsRootContextKey')\r\n"],"names":[],"mappings":"AAqBa,MAAA,qBACX,OAAO,oBAAoB;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../src/components/Tabs/constants.ts"],"sourcesContent":["import type { ComputedRef, InjectionKey, Ref, Slots, UnwrapRef } from 'vue'\r\nimport type { TabsProps } from './tabs'\r\nimport type { TabPaneProps } from './tab-pane'\r\n\r\nexport type TabsPaneContext = UnwrapRef<{\r\n uid: number\r\n slots: Slots\r\n props: TabPaneProps\r\n paneName: ComputedRef<string | number | undefined>\r\n active: ComputedRef<boolean>\r\n index: Ref<string | undefined>\r\n}>\r\n\r\nexport interface TabsRootContext {\r\n props: TabsProps\r\n currentName: Ref<string | number>\r\n registerPane: (pane: TabsPaneContext) => void\r\n sortPane: (pane: TabsPaneContext) => void\r\n unregisterPane: (uid: number) => void\r\n}\r\n\r\nexport const tabsRootContextKey: InjectionKey<TabsRootContext> =\r\n Symbol('tabsRootContextKey')\r\n"],"names":["tabsRootContextKey"],"mappings":"AAqBa,MAAAA,IACX,OAAO,oBAAoB;"}