orion-design 0.1.30 → 0.1.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. package/README.md +5 -5
  2. package/dist/Throne/index.js +30 -14
  3. package/dist/Throne/index.js.map +1 -1
  4. package/dist/_commonjsHelpers-DWwsNxpa.js +9 -0
  5. package/dist/_commonjsHelpers-DWwsNxpa.js.map +1 -0
  6. package/dist/components/Button/index.js +40 -33
  7. package/dist/components/Button/index.js.map +1 -1
  8. package/dist/components/Flex/index.js +122 -89
  9. package/dist/components/Flex/index.js.map +1 -1
  10. package/dist/components/Form/Form.js +2 -2
  11. package/dist/components/Form/Form.js.map +1 -1
  12. package/dist/components/Form/LovInput/LovInput.js +2 -2
  13. package/dist/components/Form/LovInput/LovInput.js.map +1 -1
  14. package/dist/components/Form/LovInput/hooks/useLov.js +5 -5
  15. package/dist/components/Form/LovInput/hooks/useLov.js.map +1 -1
  16. package/dist/components/Form/LovInput/index.js +4 -4
  17. package/dist/components/Form/hooks/FormItemValidateTrigger.js +2 -2
  18. package/dist/components/Form/hooks/FormItemValidateTrigger.js.map +1 -1
  19. package/dist/components/Form/hooks/index.js +128 -66
  20. package/dist/components/Form/hooks/index.js.map +1 -1
  21. package/dist/components/Form/index.js +836 -656
  22. package/dist/components/Form/index.js.map +1 -1
  23. package/dist/components/Form/utils/index.js +30 -18
  24. package/dist/components/Form/utils/index.js.map +1 -1
  25. package/dist/components/LovTable/index.js +179 -105
  26. package/dist/components/LovTable/index.js.map +1 -1
  27. package/dist/components/Modal/index.js +111 -56
  28. package/dist/components/Modal/index.js.map +1 -1
  29. package/dist/components/Modal/types.js +4 -3
  30. package/dist/components/Modal/types.js.map +1 -1
  31. package/dist/components/Modal/useModal.js +5 -5
  32. package/dist/components/Modal/useModal.js.map +1 -1
  33. package/dist/components/Pagetable/hooks/useColumns.js +88 -80
  34. package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
  35. package/dist/components/Pagetable/index.js +687 -542
  36. package/dist/components/Pagetable/index.js.map +1 -1
  37. package/dist/components/Pagetable/utils/index.js +92 -54
  38. package/dist/components/Pagetable/utils/index.js.map +1 -1
  39. package/dist/components/Querytable/hooks/useColumns.js +82 -74
  40. package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
  41. package/dist/components/Querytable/index.js +579 -469
  42. package/dist/components/Querytable/index.js.map +1 -1
  43. package/dist/components/Querytable/utils/index.js +92 -54
  44. package/dist/components/Querytable/utils/index.js.map +1 -1
  45. package/dist/components/RichTextEditor/index.js +100 -74
  46. package/dist/components/RichTextEditor/index.js.map +1 -1
  47. package/dist/components/Tabs/constants.js +2 -2
  48. package/dist/components/Tabs/constants.js.map +1 -1
  49. package/dist/components/Tabs/index.js +603 -358
  50. package/dist/components/Tabs/index.js.map +1 -1
  51. package/dist/components/Tabs/tab-bar.js +6 -6
  52. package/dist/components/Tabs/tab-bar.js.map +1 -1
  53. package/dist/components/Tabs/tab-pane.js +3 -3
  54. package/dist/components/Tabs/tab-pane.js.map +1 -1
  55. package/dist/components/_constants/aria.js +2 -2
  56. package/dist/components/_constants/aria.js.map +1 -1
  57. package/dist/components/_constants/event.js +6 -4
  58. package/dist/components/_constants/event.js.map +1 -1
  59. package/dist/components/_constants/index.js +6 -6
  60. package/dist/components/_hooks/index.js +7 -7
  61. package/dist/components/_hooks/use-namespace/index.js +74 -39
  62. package/dist/components/_hooks/use-namespace/index.js.map +1 -1
  63. package/dist/components/_hooks/use-ordered-children/index.js +29 -19
  64. package/dist/components/_hooks/use-ordered-children/index.js.map +1 -1
  65. package/dist/components/_util/arrays.js +9 -5
  66. package/dist/components/_util/arrays.js.map +1 -1
  67. package/dist/components/_util/browser.js +6 -6
  68. package/dist/components/_util/browser.js.map +1 -1
  69. package/dist/components/_util/classNames.js +22 -17
  70. package/dist/components/_util/classNames.js.map +1 -1
  71. package/dist/components/_util/dom/aria.js +74 -39
  72. package/dist/components/_util/dom/aria.js.map +1 -1
  73. package/dist/components/_util/dom/element.js +9 -8
  74. package/dist/components/_util/dom/element.js.map +1 -1
  75. package/dist/components/_util/dom/event.js +14 -7
  76. package/dist/components/_util/dom/event.js.map +1 -1
  77. package/dist/components/_util/dom/index.js +36 -36
  78. package/dist/components/_util/dom/position.js +49 -25
  79. package/dist/components/_util/dom/position.js.map +1 -1
  80. package/dist/components/_util/dom/scroll.js +103 -61
  81. package/dist/components/_util/dom/scroll.js.map +1 -1
  82. package/dist/components/_util/dom/style.js +65 -50
  83. package/dist/components/_util/dom/style.js.map +1 -1
  84. package/dist/components/_util/easings.js +8 -4
  85. package/dist/components/_util/easings.js.map +1 -1
  86. package/dist/components/_util/error.js +12 -11
  87. package/dist/components/_util/error.js.map +1 -1
  88. package/dist/components/_util/functions.js +3 -3
  89. package/dist/components/_util/i18n.js +2 -2
  90. package/dist/components/_util/i18n.js.map +1 -1
  91. package/dist/components/_util/index.js +137 -137
  92. package/dist/components/_util/isValid.js +4 -2
  93. package/dist/components/_util/isValid.js.map +1 -1
  94. package/dist/components/_util/objects.js +18 -14
  95. package/dist/components/_util/objects.js.map +1 -1
  96. package/dist/components/_util/props-util/index.js +46 -20
  97. package/dist/components/_util/props-util/index.js.map +1 -1
  98. package/dist/components/_util/props-util/initDefaultProps.js +18 -10
  99. package/dist/components/_util/props-util/initDefaultProps.js.map +1 -1
  100. package/dist/components/_util/raf.js +5 -4
  101. package/dist/components/_util/raf.js.map +1 -1
  102. package/dist/components/_util/rand.js +4 -3
  103. package/dist/components/_util/rand.js.map +1 -1
  104. package/dist/components/_util/strings.js +9 -8
  105. package/dist/components/_util/strings.js.map +1 -1
  106. package/dist/components/_util/throttleByRaf.js +16 -10
  107. package/dist/components/_util/throttleByRaf.js.map +1 -1
  108. package/dist/components/_util/type.js +41 -38
  109. package/dist/components/_util/type.js.map +1 -1
  110. package/dist/components/_util/types.js +41 -22
  111. package/dist/components/_util/types.js.map +1 -1
  112. package/dist/components/_util/typescript.js +2 -2
  113. package/dist/components/_util/typescript.js.map +1 -1
  114. package/dist/components/_util/util.js +85 -43
  115. package/dist/components/_util/util.js.map +1 -1
  116. package/dist/components/_util/vue/global-node.js +27 -15
  117. package/dist/components/_util/vue/global-node.js.map +1 -1
  118. package/dist/components/_util/vue/icon.js +29 -25
  119. package/dist/components/_util/vue/icon.js.map +1 -1
  120. package/dist/components/_util/vue/index.js +41 -41
  121. package/dist/components/_util/vue/install.js +35 -18
  122. package/dist/components/_util/vue/install.js.map +1 -1
  123. package/dist/components/_util/vue/props/index.js +6 -6
  124. package/dist/components/_util/vue/props/runtime.js +46 -30
  125. package/dist/components/_util/vue/props/runtime.js.map +1 -1
  126. package/dist/components/_util/vue/refs.js +12 -6
  127. package/dist/components/_util/vue/refs.js.map +1 -1
  128. package/dist/components/_util/vue/size.js +5 -3
  129. package/dist/components/_util/vue/size.js.map +1 -1
  130. package/dist/components/_util/vue/validator.js +5 -4
  131. package/dist/components/_util/vue/validator.js.map +1 -1
  132. package/dist/components/_util/vue/vnode.js +100 -54
  133. package/dist/components/_util/vue/vnode.js.map +1 -1
  134. package/dist/components/_util/vue-types/index.js +231 -220
  135. package/dist/components/_util/vue-types/index.js.map +1 -1
  136. package/dist/components/components.js +20 -20
  137. package/dist/components/index.js +38 -35
  138. package/dist/components/index.js.map +1 -1
  139. package/dist/components-B3d9m_tn.js +27 -0
  140. package/dist/components-B3d9m_tn.js.map +1 -0
  141. package/dist/error/OrionError.js +8 -4
  142. package/dist/error/OrionError.js.map +1 -1
  143. package/dist/functions-BeMkokbY.js +63 -0
  144. package/dist/functions-BeMkokbY.js.map +1 -0
  145. package/dist/index-BOKLZnqH.js +54 -0
  146. package/dist/index-BOKLZnqH.js.map +1 -0
  147. package/dist/index-D1m0KTpK.js +69 -0
  148. package/dist/index-D1m0KTpK.js.map +1 -0
  149. package/dist/index-DR5ZP7mD.js +160 -0
  150. package/dist/index-DR5ZP7mD.js.map +1 -0
  151. package/dist/index-DkwIULcN.js +200 -0
  152. package/dist/index-DkwIULcN.js.map +1 -0
  153. package/dist/index.css +797 -1
  154. package/dist/index.js +36 -36
  155. package/dist/print/LodopFuncs.js +101 -43
  156. package/dist/print/LodopFuncs.js.map +1 -1
  157. package/dist/print/index.js +200 -108
  158. package/dist/print/index.js.map +1 -1
  159. package/dist/request/ErrorHandlerChain.js +17 -14
  160. package/dist/request/ErrorHandlerChain.js.map +1 -1
  161. package/dist/request/RequestFilterChain.js +16 -13
  162. package/dist/request/RequestFilterChain.js.map +1 -1
  163. package/dist/request/ResponseParserChain.js +17 -14
  164. package/dist/request/ResponseParserChain.js.map +1 -1
  165. package/dist/request/disivion/DateSerializer.js +47 -22
  166. package/dist/request/disivion/DateSerializer.js.map +1 -1
  167. package/dist/request/disivion/DivisionErrorHandler.js +40 -25
  168. package/dist/request/disivion/DivisionErrorHandler.js.map +1 -1
  169. package/dist/request/disivion/DivisionResponseParser.js +16 -10
  170. package/dist/request/disivion/DivisionResponseParser.js.map +1 -1
  171. package/dist/request/disivion/index.js +305 -201
  172. package/dist/request/disivion/index.js.map +1 -1
  173. package/dist/request/error/BizExceptionResponseError.js +11 -5
  174. package/dist/request/error/BizExceptionResponseError.js.map +1 -1
  175. package/dist/request/error/ExceptionResponseError.js +11 -5
  176. package/dist/request/error/ExceptionResponseError.js.map +1 -1
  177. package/dist/request/error/ResponseError.js +9 -4
  178. package/dist/request/error/ResponseError.js.map +1 -1
  179. package/dist/request/error/SessionExceptionResponseError.js +11 -5
  180. package/dist/request/error/SessionExceptionResponseError.js.map +1 -1
  181. package/dist/request/index.js +11 -11
  182. package/dist/utils/DateUtil.js +48 -33
  183. package/dist/utils/DateUtil.js.map +1 -1
  184. package/dist/utils/NumberUtil.js +6 -6
  185. package/dist/utils/NumberUtil.js.map +1 -1
  186. package/dist/utils/cloneDeep.js +2 -2
  187. package/dist/utils/delay.js +3 -3
  188. package/dist/utils/delay.js.map +1 -1
  189. package/dist/utils/functions.js +3 -3
  190. package/dist/utils/index.js +12 -12
  191. package/dist/utils/md5.js +191 -93
  192. package/dist/utils/md5.js.map +1 -1
  193. package/dist/utils/uuid.js +35 -25
  194. package/dist/utils/uuid.js.map +1 -1
  195. package/dist/version/index.js +2 -2
  196. package/dist/version/version.d.ts +1 -1
  197. package/dist/version/version.js +2 -2
  198. package/dist/version/version.js.map +1 -1
  199. package/package.json +1 -1
@@ -1,106 +1,132 @@
1
1
  import "lodash-es";
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";
2
+ import { defineComponent, ref, onMounted, watch, onBeforeUnmount, createVNode } from "vue";
3
+ import { withInstall } from "../_util/vue/install.js";
4
4
  import "element-plus";
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 = () => ({
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 = () => ({
9
9
  modelValue: String,
10
- readonly: w(!1),
11
- uploadImage: T()
12
- }), C = /* @__PURE__ */ g({
10
+ readonly: booleanType(false),
11
+ uploadImage: functionType()
12
+ });
13
+ const RichTextEditor = /* @__PURE__ */ defineComponent({
13
14
  name: "ORichTextEditor",
14
- inheritAttrs: !1,
15
- props: R(),
15
+ inheritAttrs: false,
16
+ props: richTextEditorProps(),
16
17
  emits: ["update:modelValue"],
17
- setup(t, {
18
- slots: O,
19
- attrs: V,
20
- emit: m,
21
- expose: p
18
+ setup(props, {
19
+ slots,
20
+ attrs,
21
+ emit,
22
+ expose
22
23
  }) {
23
- const e = l(null), h = l(), d = l(), u = l();
24
- return p({
24
+ const editorRef = ref(null);
25
+ const editorWrapperDOMRef = ref();
26
+ const editorContainerDOMRef = ref();
27
+ const toolbarContainerDOMRef = ref();
28
+ expose({
25
29
  focus: () => {
26
- var o;
27
- (o = e.value) == null || o.focus();
30
+ var _a;
31
+ (_a = editorRef.value) == null ? void 0 : _a.focus();
28
32
  }
29
- }), x(() => {
30
- const o = {
33
+ });
34
+ onMounted(() => {
35
+ const editorConfig = {
31
36
  placeholder: "请输入内容...",
32
- onChange(a) {
33
- const n = a.getHtml();
34
- m("update:modelValue", n);
37
+ onChange(editor2) {
38
+ const html = editor2.getHtml();
39
+ emit("update:modelValue", html);
35
40
  },
36
- readOnly: t.readonly,
37
- autoFocus: !0,
38
- scroll: !0,
41
+ readOnly: props.readonly,
42
+ autoFocus: true,
43
+ scroll: true,
39
44
  MENU_CONF: {
40
45
  uploadImage: {
41
46
  // 自定义上传
42
- async customUpload(a, n) {
43
- if (t.uploadImage) {
44
- const r = await t.uploadImage(a);
45
- if (r == null || r === !1)
47
+ async customUpload(file, insertFn) {
48
+ if (props.uploadImage) {
49
+ const ret = await props.uploadImage(file);
50
+ if (ret == null || ret === false) {
46
51
  return;
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。");
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
+ }
52
60
  }
53
61
  }
54
62
  }
55
- }, c = E({
56
- selector: d.value,
57
- html: t.modelValue,
63
+ };
64
+ const editor = createEditor({
65
+ selector: editorContainerDOMRef.value,
66
+ html: props.modelValue,
58
67
  // 初始值
59
- config: o,
68
+ config: editorConfig,
60
69
  mode: "default"
61
70
  });
62
- e.value = c;
63
- const v = {
71
+ editorRef.value = editor;
72
+ const toolbarConfig = {
64
73
  excludeKeys: ["blockquote", "bulletedList", "numberedList", "todo", "emotion", "insertLink", "insertImage", "group-video", "insertTable", "codeBlock"]
65
74
  };
66
- I({
67
- editor: c,
68
- selector: u.value,
69
- config: v,
75
+ createToolbar({
76
+ editor,
77
+ selector: toolbarContainerDOMRef.value,
78
+ config: toolbarConfig,
70
79
  mode: "default"
71
80
  // or 'simple'
72
81
  });
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
85
- }
86
- }, [i("div", {
87
- class: "orion-rich-text-toolbar-container",
88
- ref: u,
89
- style: {
90
- borderBottom: "1px solid #ccc"
82
+ });
83
+ watch(() => props.modelValue, (modelValue) => {
84
+ if (editorRef.value) {
85
+ editorRef.value.setHtml(modelValue || "");
91
86
  }
92
- }, null), i("div", {
93
- class: "orion-rich-text-editor-container",
94
- ref: d,
95
- style: {
96
- overflowY: "hidden"
87
+ });
88
+ watch(() => props.readonly, (readonly) => {
89
+ if (editorRef.value) {
90
+ if (readonly) {
91
+ editorRef.value.disable();
92
+ } else {
93
+ editorRef.value.enable();
94
+ }
97
95
  }
98
- }, null)]);
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
+ };
99
124
  }
100
- }), F = y(
101
- C
125
+ });
126
+ const index = withInstall(
127
+ RichTextEditor
102
128
  );
103
129
  export {
104
- F as default
130
+ index as default
105
131
  };
106
132
  //# 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","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,QAAAA;AAAAA,EAAO,GAAG;AAC3C,UAAMC,IAAYC,EAAuB,IAAI,GACvCC,IAAsBD,KACtB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ACR,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
+ {"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"],"mappings":";;;;;;;AASO,MAAMA,sBAAsBA,OAAO;AAAA,EACxCC,YAAYC;AAAAA,EACZC,UAAUC,YAAY,KAAK;AAAA,EAC3BC,aAAaC,aAA0F;AACzG;AAMA,MAAeC,iDAAgB;AAAA,EAC7BC,MAAM;AAAA,EACNC,cAAc;AAAA,EACdC,OAAOV,oBAAqB;AAAA,EAC5BW,OAAO,CAAC,mBAAmB;AAAA,EAC3BC,MAAMF,OAAO;AAAA,IAAEG;AAAAA,IAAOC;AAAAA,IAAOC;AAAAA,IAAMC;AAAAA,EAAO,GAAG;AAC3C,UAAMC,YAAYC,IAAuB,IAAI;AAC7C,UAAMC,sBAAsBD;AAC5B,UAAME,wBAAwBF;AAC9B,UAAMG,yBAAyBH;AAE/BF,WAAO;AAAA,MACLM,OAAOA,MAAM;;AACXL,wBAAUM,UAAVN,mBAAiBK;AAAAA,MACnB;AAAA,IACF,CAAC;AAEDE,cAAU,MAAM;AAEd,YAAMC,eAA8B;AAAA,QAClCC,aAAa;AAAA,QACbC,SAASC,SAAQ;AACf,gBAAMC,OAAOD,QAAOE;AACpBf,eAAK,qBAAqBc,IAAI;AAAA,QAC/B;AAAA,QACDE,UAAUrB,MAAMP;AAAAA,QAChB6B,WAAW;AAAA,QACXC,QAAQ;AAAA,QACRC,WAAW;AAAA,UACT7B,aAAa;AAAA;AAAA,YAEX,MAAM8B,aAAaC,MAAYC,UAAwB;AACrD,kBAAI3B,MAAML,aAAa;AACrB,sBAAMiC,MAAM,MAAM5B,MA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aAAAiC,YAAA,OAAA;AAAA,QAAA,SAAA;AAAA,QAAA,OACmDrC;AAAAA,QAAmB,SAAS;AAAA,UAAEsC,QAAQ;AAAA,UAAkBC,QAAQ;AAAA,QAAI;AAAA,MAAC,GAAA,CAAAF,YAAA,OAAA;AAAA,QAAA,SAAA;AAAA,QAAA,OAChEnC;AAAAA,QAAsB,SAAS;AAAA,UAAEsC,cAAc;AAAA,QAAiB;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,5 +1,5 @@
1
- const t = Symbol("tabsRootContextKey");
1
+ const tabsRootContextKey = Symbol("tabsRootContextKey");
2
2
  export {
3
- t as tabsRootContextKey
3
+ 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":["tabsRootContextKey"],"mappings":"AAqBa,MAAAA,IACX,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":[],"mappings":"AAqBa,MAAA,qBACX,OAAO,oBAAoB;"}