@kayak-sj/design 1.0.0 → 1.0.1

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 (222) hide show
  1. package/dist/assets/components-CgiuwHwW.css +1 -0
  2. package/dist/{components/k-form/formComponent/Editor.vue_vue_type_script_setup_true_lang.js → chunks/Editor-CNxCYFmc.js} +4 -3
  3. package/dist/chunks/ImageCutter-B4uKMA_8.js +41 -0
  4. package/dist/chunks/KEditor-C882CuWG.js +331 -0
  5. package/dist/{_virtual/_plugin-vue_export-helper.js → chunks/_plugin-vue_export-helper-B3ysoDQm.js} +1 -1
  6. package/dist/chunks/components-Cj9QZ2w0.js +4962 -0
  7. package/dist/chunks/editorValue-DSKvW8ty.js +65 -0
  8. package/dist/components/index.js +3 -91
  9. package/dist/components/k-dialog/KDialog.d.ts +6 -6
  10. package/dist/components/k-dialog/KDialog.d.ts.map +1 -1
  11. package/dist/components/k-echarts/KEcharts.d.ts +2 -2
  12. package/dist/components/k-echarts/index.js +479 -2
  13. package/dist/components/k-editor/KEditor.d.ts +4 -4
  14. package/dist/components/k-editor/index.js +3 -3
  15. package/dist/components/k-form/KForm.d.ts +3 -3
  16. package/dist/components/k-form/KForm.d.ts.map +1 -1
  17. package/dist/components/k-form/formComponent/DatePicker.d.ts +1 -1
  18. package/dist/components/k-form/formComponent/DatePicker.d.ts.map +1 -1
  19. package/dist/components/k-form/formComponent/Input.d.ts +2 -2
  20. package/dist/components/k-form/formComponent/Input.d.ts.map +1 -1
  21. package/dist/components/k-form/formComponent/TimePicker.d.ts +1 -1
  22. package/dist/components/k-form/formComponent/TimePicker.d.ts.map +1 -1
  23. package/dist/components/k-form/formComponent/TreeSelect.d.ts +1 -1
  24. package/dist/components/k-form/formComponent/TreeSelect.d.ts.map +1 -1
  25. package/dist/components/k-link-button/KLinkButton.d.ts +1 -1
  26. package/dist/components/k-link-button/KLinkButton.d.ts.map +1 -1
  27. package/dist/components/k-table/KTable.d.ts +1 -1
  28. package/dist/components/k-upload/KUpload.d.ts +5 -5
  29. package/dist/index.js +212 -41
  30. package/package.json +3 -3
  31. package/dist/_virtual/_rolldown/runtime.js +0 -11
  32. package/dist/components/k-button/KButton.js +0 -5
  33. package/dist/components/k-button/KButton.vue_vue_type_script_setup_true_lang.js +0 -15
  34. package/dist/components/k-card/KCard.js +0 -5
  35. package/dist/components/k-card/KCard.vue_vue_type_script_setup_true_lang.js +0 -23
  36. package/dist/components/k-dialog/KDialog.js +0 -5
  37. package/dist/components/k-dialog/KDialog.vue_vue_type_script_setup_true_lang.js +0 -129
  38. package/dist/components/k-dialog/KDialogHeader.js +0 -5
  39. package/dist/components/k-dialog/KDialogHeader.vue_vue_type_script_setup_true_lang.js +0 -42
  40. package/dist/components/k-echarts/KEcharts.js +0 -7
  41. package/dist/components/k-echarts/KEcharts.vue_vue_type_script_setup_true_lang.js +0 -45
  42. package/dist/components/k-echarts/composables/useKEcharts.js +0 -117
  43. package/dist/components/k-echarts/constants/echartEvents.js +0 -4
  44. package/dist/components/k-echarts/themes/customed.js +0 -285
  45. package/dist/components/k-echarts/themes/registerThemes.js +0 -7
  46. package/dist/components/k-echarts/utils/buildChartOptions.js +0 -23
  47. package/dist/components/k-echarts/utils/createToggleFeature.js +0 -12
  48. package/dist/components/k-editor/KEditor.js +0 -7
  49. package/dist/components/k-editor/KEditor.vue_vue_type_script_setup_true_lang.js +0 -96
  50. package/dist/components/k-editor/composables/useEditorImageUpload.js +0 -60
  51. package/dist/components/k-editor/composables/useKEditor.js +0 -98
  52. package/dist/components/k-editor/composables/useKEditorConfig.js +0 -46
  53. package/dist/components/k-editor/utils/editorValue.js +0 -37
  54. package/dist/components/k-editor/utils/registerPreviewMenu.js +0 -38
  55. package/dist/components/k-editor/utils/sanitizePasteHtml.js +0 -8
  56. package/dist/components/k-form/KForm.js +0 -5
  57. package/dist/components/k-form/KForm.vue_vue_type_script_setup_true_lang.js +0 -248
  58. package/dist/components/k-form/KFormField.js +0 -5
  59. package/dist/components/k-form/KFormField.vue_vue_type_script_setup_true_lang.js +0 -50
  60. package/dist/components/k-form/composables/useFormSchema.js +0 -36
  61. package/dist/components/k-form/composables/useKFormFields.js +0 -50
  62. package/dist/components/k-form/composables/useKFormModel.js +0 -194
  63. package/dist/components/k-form/composables/useKFormTemplateRef.js +0 -7
  64. package/dist/components/k-form/constants.js +0 -4
  65. package/dist/components/k-form/formComponent/Cascader.js +0 -7
  66. package/dist/components/k-form/formComponent/Cascader.vue_vue_type_script_setup_true_lang.js +0 -45
  67. package/dist/components/k-form/formComponent/Cascader.vue_vue_type_style_index_0_scoped_ed0da536_lang.css +0 -1
  68. package/dist/components/k-form/formComponent/CheckBox.js +0 -7
  69. package/dist/components/k-form/formComponent/CheckBox.vue_vue_type_script_setup_true_lang.js +0 -86
  70. package/dist/components/k-form/formComponent/CheckBox.vue_vue_type_style_index_0_scoped_fca64c11_lang.css +0 -1
  71. package/dist/components/k-form/formComponent/DatePicker.js +0 -7
  72. package/dist/components/k-form/formComponent/DatePicker.vue_vue_type_script_setup_true_lang.js +0 -144
  73. package/dist/components/k-form/formComponent/DatePicker.vue_vue_type_style_index_0_scoped_578e2613_lang.css +0 -1
  74. package/dist/components/k-form/formComponent/Editor.js +0 -5
  75. package/dist/components/k-form/formComponent/Fallback.js +0 -5
  76. package/dist/components/k-form/formComponent/Fallback.vue_vue_type_script_setup_true_lang.js +0 -22
  77. package/dist/components/k-form/formComponent/Input.js +0 -5
  78. package/dist/components/k-form/formComponent/Input.vue_vue_type_script_setup_true_lang.js +0 -93
  79. package/dist/components/k-form/formComponent/InputMixInput.js +0 -7
  80. package/dist/components/k-form/formComponent/InputMixInput.vue_vue_type_script_setup_true_lang.js +0 -108
  81. package/dist/components/k-form/formComponent/InputMixInput.vue_vue_type_style_index_0_scoped_6fdf6265_lang.css +0 -1
  82. package/dist/components/k-form/formComponent/InputMixSelect.js +0 -7
  83. package/dist/components/k-form/formComponent/InputMixSelect.vue_vue_type_script_setup_true_lang.js +0 -185
  84. package/dist/components/k-form/formComponent/InputMixSelect.vue_vue_type_style_index_0_scoped_1f46ef39_lang.css +0 -1
  85. package/dist/components/k-form/formComponent/InputNumber.js +0 -7
  86. package/dist/components/k-form/formComponent/InputNumber.vue_vue_type_script_setup_true_lang.js +0 -63
  87. package/dist/components/k-form/formComponent/InputNumber.vue_vue_type_style_index_0_scoped_acdc4199_lang.css +0 -1
  88. package/dist/components/k-form/formComponent/Radio.js +0 -7
  89. package/dist/components/k-form/formComponent/Radio.vue_vue_type_script_setup_true_lang.js +0 -50
  90. package/dist/components/k-form/formComponent/Radio.vue_vue_type_style_index_0_scoped_e0ff32b0_lang.css +0 -1
  91. package/dist/components/k-form/formComponent/RadioInput.js +0 -7
  92. package/dist/components/k-form/formComponent/RadioInput.vue_vue_type_script_setup_true_lang.js +0 -130
  93. package/dist/components/k-form/formComponent/RadioInput.vue_vue_type_style_index_0_scoped_1543c319_lang.css +0 -1
  94. package/dist/components/k-form/formComponent/ScrollSelect.js +0 -7
  95. package/dist/components/k-form/formComponent/ScrollSelect.vue_vue_type_script_setup_true_lang.js +0 -132
  96. package/dist/components/k-form/formComponent/ScrollSelect.vue_vue_type_style_index_0_scoped_dc0bba37_lang.css +0 -1
  97. package/dist/components/k-form/formComponent/Select.js +0 -7
  98. package/dist/components/k-form/formComponent/Select.vue_vue_type_script_setup_true_lang.js +0 -81
  99. package/dist/components/k-form/formComponent/Select.vue_vue_type_style_index_0_scoped_20fc23b7_lang.css +0 -1
  100. package/dist/components/k-form/formComponent/SelectMultiple.js +0 -7
  101. package/dist/components/k-form/formComponent/SelectMultiple.vue_vue_type_script_setup_true_lang.js +0 -84
  102. package/dist/components/k-form/formComponent/SelectMultiple.vue_vue_type_style_index_0_scoped_e6ca06e1_lang.css +0 -1
  103. package/dist/components/k-form/formComponent/Tag.js +0 -7
  104. package/dist/components/k-form/formComponent/Tag.vue_vue_type_script_setup_true_lang.js +0 -86
  105. package/dist/components/k-form/formComponent/Tag.vue_vue_type_style_index_0_scoped_9961a98a_lang.css +0 -1
  106. package/dist/components/k-form/formComponent/Text.js +0 -7
  107. package/dist/components/k-form/formComponent/Text.vue_vue_type_script_setup_true_lang.js +0 -19
  108. package/dist/components/k-form/formComponent/Text.vue_vue_type_style_index_0_scoped_9dc35114_lang.css +0 -1
  109. package/dist/components/k-form/formComponent/TimePicker.js +0 -7
  110. package/dist/components/k-form/formComponent/TimePicker.vue_vue_type_script_setup_true_lang.js +0 -116
  111. package/dist/components/k-form/formComponent/TimePicker.vue_vue_type_style_index_0_scoped_8680ec2d_lang.css +0 -1
  112. package/dist/components/k-form/formComponent/TreeSelect.js +0 -5
  113. package/dist/components/k-form/formComponent/TreeSelect.vue_vue_type_script_setup_true_lang.js +0 -57
  114. package/dist/components/k-form/formComponent/Upload.js +0 -5
  115. package/dist/components/k-form/formComponent/Upload.vue_vue_type_script_setup_true_lang.js +0 -64
  116. package/dist/components/k-form/formComponent/componentRegistry.js +0 -49
  117. package/dist/components/k-form/utils/fieldValue.js +0 -83
  118. package/dist/components/k-form/utils/formRules.js +0 -44
  119. package/dist/components/k-form/utils/resolveFormFieldComponent.js +0 -13
  120. package/dist/components/k-handle-page/KHandlePage.js +0 -5
  121. package/dist/components/k-handle-page/KHandlePage.vue_vue_type_script_setup_true_lang.js +0 -105
  122. package/dist/components/k-handle-page/useHandlePageInit.js +0 -21
  123. package/dist/components/k-icon/KIcon.js +0 -7
  124. package/dist/components/k-icon/KIcon.vue_vue_type_script_setup_true_lang.js +0 -23
  125. package/dist/components/k-icon/KIcon.vue_vue_type_style_index_0_scoped_6fd081ab_lang.css +0 -1
  126. package/dist/components/k-icon/resolveLucideIcon.js +0 -26
  127. package/dist/components/k-link-button/KLinkButton.js +0 -5
  128. package/dist/components/k-link-button/KLinkButton.vue_vue_type_script_setup_true_lang.js +0 -58
  129. package/dist/components/k-long-page/KLongPage.js +0 -7
  130. package/dist/components/k-long-page/KLongPage.vue_vue_type_script_setup_true_lang.js +0 -72
  131. package/dist/components/k-long-page/KLongPage.vue_vue_type_style_index_0_scoped_ac934c5d_lang.css +0 -1
  132. package/dist/components/k-long-page/KLongPagePanel.js +0 -7
  133. package/dist/components/k-long-page/KLongPagePanel.vue_vue_type_script_setup_true_lang.js +0 -18
  134. package/dist/components/k-long-page/KLongPagePanel.vue_vue_type_style_index_0_scoped_9d6e7832_lang.css +0 -1
  135. package/dist/components/k-long-page/composables/useLongPageNavDrag.js +0 -32
  136. package/dist/components/k-long-page/icons/icon-base-2.js +0 -4
  137. package/dist/components/k-long-page/icons/icon-base.js +0 -4
  138. package/dist/components/k-long-page/icons/icon-notice-2.js +0 -4
  139. package/dist/components/k-long-page/icons/icon-notice.js +0 -4
  140. package/dist/components/k-long-page/icons/icon-price-2.js +0 -4
  141. package/dist/components/k-long-page/icons/icon-price.js +0 -4
  142. package/dist/components/k-long-page/icons/icon-restrict-2.js +0 -4
  143. package/dist/components/k-long-page/icons/icon-restrict.js +0 -4
  144. package/dist/components/k-long-page/icons/icon-setup-2.js +0 -4
  145. package/dist/components/k-long-page/icons/icon-setup.js +0 -4
  146. package/dist/components/k-long-page/navConfigs.js +0 -23
  147. package/dist/components/k-pagination/KPagination.js +0 -5
  148. package/dist/components/k-pagination/KPagination.vue_vue_type_script_setup_true_lang.js +0 -36
  149. package/dist/components/k-panel/KPanel.js +0 -5
  150. package/dist/components/k-panel/KPanel.vue_vue_type_script_setup_true_lang.js +0 -47
  151. package/dist/components/k-panel-query/KPanelQuery.js +0 -5
  152. package/dist/components/k-panel-query/KPanelQuery.vue_vue_type_script_setup_true_lang.js +0 -151
  153. package/dist/components/k-panel-query/KPanelQueryActions.js +0 -5
  154. package/dist/components/k-panel-query/KPanelQueryActions.vue_vue_type_script_setup_true_lang.js +0 -45
  155. package/dist/components/k-panel-query/KPanelQueryForm.js +0 -5
  156. package/dist/components/k-panel-query/KPanelQueryForm.vue_vue_type_script_setup_true_lang.js +0 -55
  157. package/dist/components/k-panel-query/KPanelQueryItem.js +0 -5
  158. package/dist/components/k-panel-query/KPanelQueryItem.vue_vue_type_script_setup_true_lang.js +0 -63
  159. package/dist/components/k-table/KTable.js +0 -7
  160. package/dist/components/k-table/KTable.vue_vue_type_script_setup_true_lang.js +0 -190
  161. package/dist/components/k-table/KTable.vue_vue_type_style_index_0_scoped_9ecd6487_lang.css +0 -1
  162. package/dist/components/k-table/KTableColumn.js +0 -7
  163. package/dist/components/k-table/KTableColumn.vue_vue_type_script_setup_true_lang.js +0 -154
  164. package/dist/components/k-table/KTableColumn.vue_vue_type_style_index_0_scoped_578909bc_lang.css +0 -1
  165. package/dist/components/k-table/KTableColumnSelector.js +0 -7
  166. package/dist/components/k-table/KTableColumnSelector.vue_vue_type_script_setup_true_lang.js +0 -59
  167. package/dist/components/k-table/KTableColumnSelector.vue_vue_type_style_index_0_scoped_e0b3cf31_lang.css +0 -1
  168. package/dist/components/k-table/KTableToolbar.js +0 -7
  169. package/dist/components/k-table/KTableToolbar.vue_vue_type_script_setup_true_lang.js +0 -60
  170. package/dist/components/k-table/KTableToolbar.vue_vue_type_style_index_0_scoped_bff19ed1_lang.css +0 -1
  171. package/dist/components/k-table/composables/useColumnDisplay.js +0 -103
  172. package/dist/components/k-table/composables/useKTable.js +0 -179
  173. package/dist/components/k-table/composables/useKTableCrossPageSelection.js +0 -58
  174. package/dist/components/k-table/composables/useKTableTemplateRef.js +0 -7
  175. package/dist/components/k-table/composables/useTableColumns.js +0 -61
  176. package/dist/components/k-table/composables/useTableData.js +0 -47
  177. package/dist/components/k-table/composables/useTablePagination.js +0 -52
  178. package/dist/components/k-table/composables/useTableRadio.js +0 -28
  179. package/dist/components/k-table/composables/useTableRowSort.js +0 -35
  180. package/dist/components/k-table/composables/useTableTreeLoad.js +0 -32
  181. package/dist/components/k-table/dictOptions.js +0 -9
  182. package/dist/components/k-table/kTableProps.js +0 -17
  183. package/dist/components/k-table/report/convertDownloadCol.js +0 -11
  184. package/dist/components/k-table/report/exportKTableReport.js +0 -19
  185. package/dist/components/k-table/report/mergeQueryConfig.js +0 -31
  186. package/dist/components/k-table/report/pickExportColumns.js +0 -7
  187. package/dist/components/k-table/report/useExportKTableReport.js +0 -29
  188. package/dist/components/k-table/types.js +0 -20
  189. package/dist/components/k-table/utils/columnIdentity.js +0 -6
  190. package/dist/components/k-table/utils/formatCellValue.js +0 -30
  191. package/dist/components/k-table/utils/rowKey.js +0 -10
  192. package/dist/components/k-upload/KUpload.js +0 -7
  193. package/dist/components/k-upload/KUpload.vue_vue_type_script_setup_true_lang.js +0 -355
  194. package/dist/components/k-upload/KUpload.vue_vue_type_style_index_0_scoped_6050c2c6_lang.css +0 -1
  195. package/dist/components/k-upload/components/ImageCutter.js +0 -7
  196. package/dist/components/k-upload/components/ImageCutter.vue_vue_type_script_setup_true_lang.js +0 -40
  197. package/dist/components/k-upload/components/UploadFileItem.js +0 -7
  198. package/dist/components/k-upload/components/UploadFileItem.vue_vue_type_script_setup_true_lang.js +0 -73
  199. package/dist/components/k-upload/components/UploadFileItem.vue_vue_type_style_index_0_scoped_01959ada_lang.css +0 -1
  200. package/dist/components/k-upload/components/UploadInlineActions.js +0 -7
  201. package/dist/components/k-upload/components/UploadInlineActions.vue_vue_type_script_setup_true_lang.js +0 -39
  202. package/dist/components/k-upload/components/UploadInlineActions.vue_vue_type_style_index_0_scoped_55d9c320_lang.css +0 -1
  203. package/dist/components/k-upload/components/UploadMediaDialog.js +0 -7
  204. package/dist/components/k-upload/components/UploadMediaDialog.vue_vue_type_script_setup_true_lang.js +0 -44
  205. package/dist/components/k-upload/components/UploadMediaDialog.vue_vue_type_style_index_0_scoped_b9720661_lang.css +0 -1
  206. package/dist/components/k-upload/components/UploadTipArea.js +0 -7
  207. package/dist/components/k-upload/components/UploadTipArea.vue_vue_type_script_setup_true_lang.js +0 -26
  208. package/dist/components/k-upload/components/UploadTipArea.vue_vue_type_style_index_0_scoped_f2b7df65_lang.css +0 -1
  209. package/dist/components/k-upload/composables/useImagePreview.js +0 -23
  210. package/dist/components/k-upload/composables/useMediaPreview.js +0 -20
  211. package/dist/components/k-upload/composables/useUploadFileList.js +0 -46
  212. package/dist/components/k-upload/composables/useUploadRequest.js +0 -43
  213. package/dist/components/k-upload/composables/useUploadValidation.js +0 -22
  214. package/dist/components/k-upload/resolveUploadAction.js +0 -13
  215. package/dist/components/k-upload/utils/uploadFileValue.js +0 -44
  216. package/dist/config/uploadConfig.js +0 -29
  217. package/dist/theme/index.js +0 -22
  218. package/dist/utils/createStubComponent.js +0 -43
  219. package/dist/utils/validators.js +0 -152
  220. /package/dist/{components/k-upload/components/ImageCutter.vue_vue_type_style_index_0_scoped_900b5e3b_lang.css → assets/ImageCutter-B771uShK.css} +0 -0
  221. /package/dist/{components/k-editor/KEditor.vue_vue_type_style_index_0_scoped_b9ef08e0_lang.css → assets/KEditor-LzsE5URl.css} +0 -0
  222. /package/dist/{components/k-echarts/KEcharts.vue_vue_type_style_index_0_scoped_d6da558a_lang.css → assets/index-DMxcQQBQ.css} +0 -0
@@ -1,96 +0,0 @@
1
- import { ensurePreviewMenuRegistered as e } from "./utils/registerPreviewMenu.js";
2
- import { useKEditor as t } from "./composables/useKEditor.js";
3
- import { Fragment as n, computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, isRef as u, normalizeStyle as d, openBlock as f, toDisplayString as p, unref as m, withCtx as h } from "vue";
4
- import { ElDialog as g } from "element-plus";
5
- import "@wangeditor/editor/dist/css/style.css";
6
- import { Editor as _, Toolbar as v } from "@wangeditor/editor-for-vue";
7
- //#region src/components/k-editor/KEditor.vue?vue&type=script&setup=true&lang.ts
8
- var y = { class: "k-editor__shell" }, b = { class: "k-editor__tips" }, x = ["innerHTML"], S = ["innerHTML"], C = /*@__PURE__*/ l({
9
- name: "KEditor",
10
- inheritAttrs: !1,
11
- __name: "KEditor",
12
- props: {
13
- modelValue: { default: "" },
14
- items: { default: () => [] },
15
- maxWordCount: { default: 100 },
16
- maxLength: {},
17
- config: { default: () => ({}) },
18
- disabled: {
19
- type: Boolean,
20
- default: !1
21
- },
22
- placeholder: { default: "请输入" }
23
- },
24
- emits: ["update:modelValue", "click"],
25
- setup(l, { emit: C }) {
26
- let w = l, T = C;
27
- e();
28
- let { editorRef: E, toolbarConfig: D, editorConfig: O, mode: k, previewVisible: A, previewHtml: j, wordCount: M, isReadonly: N, displayHtml: P, maxWords: F, handleCreated: I, handleChange: L, handleCustomPaste: R } = t({
29
- props: w,
30
- emit: T
31
- }), z = r(() => {
32
- let e = w.config?.height;
33
- return typeof e == "number" && e > 0 ? e : 160;
34
- }), B = r(() => {
35
- let e = `${z.value}px`;
36
- return {
37
- height: e,
38
- maxHeight: e,
39
- minHeight: e
40
- };
41
- });
42
- function V() {
43
- let e = E.value;
44
- !e || e.isDisabled() || e.isFocused() || e.focus();
45
- }
46
- return (e, t) => (f(), a("div", {
47
- class: "k-editor",
48
- onClick: t[1] ||= (e) => T("click")
49
- }, [m(N) ? (f(), a("div", {
50
- key: 1,
51
- class: "k-editor__readonly",
52
- style: d({ minHeight: `${z.value}px` }),
53
- innerHTML: m(P)
54
- }, null, 12, x)) : (f(), a(n, { key: 0 }, [o("div", y, [c(m(v), {
55
- class: "k-editor__toolbar",
56
- editor: m(E),
57
- "default-config": m(D),
58
- mode: m(k)
59
- }, null, 8, [
60
- "editor",
61
- "default-config",
62
- "mode"
63
- ]), c(m(_), {
64
- class: "k-editor__content",
65
- style: d(B.value),
66
- "default-config": m(O),
67
- mode: m(k),
68
- onClick: V,
69
- onOnCreated: m(I),
70
- onOnChange: m(L),
71
- onCustomPaste: m(R)
72
- }, null, 8, [
73
- "style",
74
- "default-config",
75
- "mode",
76
- "onOnCreated",
77
- "onOnChange",
78
- "onCustomPaste"
79
- ])]), o("p", b, [t[2] ||= s(" 字数统计: ", -1), o("span", null, [s(p(m(M)) + " ", 1), m(F) ? (f(), a(n, { key: 0 }, [s("/" + p(m(F)), 1)], 64)) : i("", !0)])])], 64)), c(m(g), {
80
- modelValue: m(A),
81
- "onUpdate:modelValue": t[0] ||= (e) => u(A) ? A.value = e : null,
82
- title: "内容预览",
83
- width: "720px",
84
- "append-to-body": "",
85
- "destroy-on-close": ""
86
- }, {
87
- default: h(() => [o("div", {
88
- class: "k-editor__preview",
89
- innerHTML: m(j)
90
- }, null, 8, S)]),
91
- _: 1
92
- }, 8, ["modelValue"])]));
93
- }
94
- });
95
- //#endregion
96
- export { C as default };
@@ -1,60 +0,0 @@
1
- import { getUploadConfig as e } from "../../../config/uploadConfig.js";
2
- import { ElMessage as t } from "element-plus";
3
- //#region src/components/k-editor/composables/useEditorImageUpload.ts
4
- function n(t) {
5
- let n = e(), r = t.resource_id ?? t.resourceId;
6
- if (r != null && r !== "") return `${n.urls.SHOW_IMG_URL}${r}`;
7
- let i = t.url;
8
- return typeof i == "string" && i ? i : null;
9
- }
10
- async function r(t) {
11
- let n = e();
12
- if (!n.uploadRequest) throw Error("[KEditor] uploadRequest 未配置");
13
- let r = await n.uploadRequest({
14
- file: t,
15
- action: n.urls.UPLOAD_IMG_URL,
16
- data: {},
17
- onProgress: () => {}
18
- });
19
- if (String(r[n.responseCode] ?? "") !== n.responseSuccessCode) throw Error(String(r[n.responseMsg] ?? "图片上传失败"));
20
- return r;
21
- }
22
- async function i(t) {
23
- let n = e();
24
- return new Promise((e, r) => {
25
- let i = new FormData();
26
- i.append("file", t);
27
- let a = new XMLHttpRequest();
28
- a.open("POST", n.urls.UPLOAD_IMG_URL), a.onreadystatechange = () => {
29
- if (a.readyState === 4) {
30
- if (a.status !== 200) {
31
- r(/* @__PURE__ */ Error("图片上传失败"));
32
- return;
33
- }
34
- try {
35
- let t = JSON.parse(a.responseText);
36
- if (String(t[n.responseCode] ?? "") !== n.responseSuccessCode) {
37
- r(Error(String(t[n.responseMsg] ?? "图片上传失败")));
38
- return;
39
- }
40
- e(t);
41
- } catch {
42
- r(/* @__PURE__ */ Error("图片上传失败"));
43
- }
44
- }
45
- }, a.send(i);
46
- });
47
- }
48
- function a() {
49
- return async (a, o) => {
50
- try {
51
- let t = e().uploadRequest ? await r(a) : await i(a), s = n(t);
52
- if (!s) throw Error("图片上传失败");
53
- o(s, String(t.file_name ?? t.fileName ?? a.name), s);
54
- } catch (e) {
55
- t.error(e instanceof Error ? e.message : "图片上传失败");
56
- }
57
- };
58
- }
59
- //#endregion
60
- export { a as createEditorImageUpload };
@@ -1,98 +0,0 @@
1
- import { buildEditorEmitValue as e, countEditorWords as t, getEditorHtml as n, isSameEditorHtml as r, resolveMaxWordCount as i } from "../utils/editorValue.js";
2
- import { K_EDITOR_PREVIEW_EVENT as a, bindEditorPreviewId as o } from "../utils/registerPreviewMenu.js";
3
- import { sanitizePasteHtml as s } from "../utils/sanitizePasteHtml.js";
4
- import { useKEditorConfig as c } from "./useKEditorConfig.js";
5
- import { computed as l, onBeforeUnmount as u, onMounted as d, shallowRef as f, watch as p } from "vue";
6
- //#region src/components/k-editor/composables/useKEditor.ts
7
- var m = !1;
8
- function h() {
9
- if (m) return;
10
- m = !0;
11
- let e = console.warn.bind(console);
12
- console.warn = (...t) => {
13
- let n = t[0];
14
- typeof n == "string" && (n.includes("编辑区域高度") || n.includes("Textarea height < 300px")) || e(...t);
15
- };
16
- }
17
- function g(m) {
18
- h();
19
- let { props: g, emit: _ } = m, v = f(), y = f(!1), b = f(""), x = f(0), S = f(""), C = f(!1), w = f(""), T = l(() => g.disabled === !0), E = l(() => n(g.modelValue)), D = l(() => i(g.maxWordCount, g.maxLength)), { toolbarConfig: O, editorConfig: k } = c({
20
- config: () => g.config,
21
- items: () => g.items,
22
- placeholder: () => g.placeholder,
23
- disabled: () => g.disabled
24
- });
25
- function A(e) {
26
- let t = e.detail;
27
- !t || t.editorId !== w.value || (b.value = t.html, y.value = !0);
28
- }
29
- d(() => {
30
- window.addEventListener(a, A);
31
- });
32
- function j(e) {
33
- x.value = t(e.getText());
34
- }
35
- function M(n) {
36
- let r = n.getHtml(), i = t(n.getText());
37
- x.value = i, S.value = r, _("update:modelValue", e(r, i));
38
- }
39
- function N(e, t) {
40
- C.value = !0, e.setHtml(t), S.value = t, j(e), queueMicrotask(() => {
41
- C.value = !1;
42
- });
43
- }
44
- function P(e) {
45
- v.value = e, w.value = o(e);
46
- let t = E.value;
47
- t ? N(e, t) : j(e);
48
- }
49
- function F(n) {
50
- if (C.value) return;
51
- let r = t(n.getText());
52
- if (D.value != null && r > D.value) {
53
- N(n, S.value), x.value = t(n.getText()), _("update:modelValue", e(S.value, x.value)), queueMicrotask(() => {
54
- n.isDisabled() || n.focus();
55
- });
56
- return;
57
- }
58
- M(n);
59
- }
60
- function I(e, t, n) {
61
- let r = t.clipboardData?.getData("text/html");
62
- if (!r) {
63
- n(!0);
64
- return;
65
- }
66
- t.preventDefault(), e.dangerouslyInsertHtml(s(r)), n(!1);
67
- }
68
- return p(() => g.modelValue, (e, t) => {
69
- if (r(e, t) || T.value) return;
70
- let i = v.value;
71
- if (!i) return;
72
- let a = n(e);
73
- i.getHtml() !== a && N(i, a);
74
- }), p(T, (e) => {
75
- let t = v.value;
76
- t && (e ? t.disable() : t.enable());
77
- }, { flush: "post" }), u(() => {
78
- window.removeEventListener(a, A);
79
- let e = v.value;
80
- e && e.destroy();
81
- }), {
82
- editorRef: v,
83
- toolbarConfig: O,
84
- editorConfig: k,
85
- mode: "default",
86
- previewVisible: y,
87
- previewHtml: b,
88
- wordCount: x,
89
- isReadonly: T,
90
- displayHtml: E,
91
- maxWords: D,
92
- handleCreated: P,
93
- handleChange: F,
94
- handleCustomPaste: I
95
- };
96
- }
97
- //#endregion
98
- export { g as useKEditor };
@@ -1,46 +0,0 @@
1
- import { K_EDITOR_PREVIEW_MENU_KEY as e } from "../utils/registerPreviewMenu.js";
2
- import { createEditorImageUpload as t } from "./useEditorImageUpload.js";
3
- import { computed as n, toValue as r } from "vue";
4
- //#region src/components/k-editor/composables/useKEditorConfig.ts
5
- function i(i) {
6
- let a = t();
7
- return {
8
- toolbarConfig: n(() => {
9
- let t = r(i.config)?.toolbar, n = r(i.items), a = {
10
- excludeKeys: [
11
- "emotion",
12
- "group-video",
13
- "insertImage"
14
- ],
15
- insertKeys: {
16
- index: 0,
17
- keys: [e]
18
- },
19
- ...t
20
- };
21
- return n?.length ? {
22
- ...a,
23
- toolbarKeys: n
24
- } : a;
25
- }),
26
- editorConfig: n(() => {
27
- let { toolbar: e, MENU_CONF: t, height: n, ...o } = r(i.config) ?? {};
28
- return {
29
- placeholder: r(i.placeholder) ?? "请输入",
30
- autoFocus: !1,
31
- readOnly: r(i.disabled) === !0,
32
- MENU_CONF: {
33
- lineHeight: { lineHeightList: ["1"] },
34
- uploadImage: {
35
- base64LimitSize: 0,
36
- customUpload: a
37
- },
38
- ...t
39
- },
40
- ...o
41
- };
42
- })
43
- };
44
- }
45
- //#endregion
46
- export { i as useKEditorConfig };
@@ -1,37 +0,0 @@
1
- //#region src/components/k-editor/utils/editorValue.ts
2
- function e(e) {
3
- return e == null ? "" : typeof e == "object" ? e.html ?? "" : e;
4
- }
5
- function t(e) {
6
- return e.replace(/<[^>]*>/g, "").replace(/&nbsp;/gi, " ").replace(/&#160;/gi, " ").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&amp;/gi, "&").replace(/&quot;/gi, "\"");
7
- }
8
- function n(e) {
9
- return e.replace(/&nbsp;/g, " ").replace(/\n/g, "").replace(/\s/g, "").length;
10
- }
11
- function r(e) {
12
- return n(t(e));
13
- }
14
- function i(t) {
15
- return t == null ? 0 : r(e(t));
16
- }
17
- function a(e, t) {
18
- return {
19
- html: t === 0 ? "" : e,
20
- length: t
21
- };
22
- }
23
- function o(e) {
24
- let t = e ?? "";
25
- return a(t, r(t));
26
- }
27
- function s(e, t) {
28
- let n = e ?? t;
29
- if (n === "" || n == null) return;
30
- let r = Number(n);
31
- return Number.isFinite(r) && r > 0 ? r : void 0;
32
- }
33
- function c(t, n) {
34
- return e(t) === e(n);
35
- }
36
- //#endregion
37
- export { a as buildEditorEmitValue, r as countEditorHtmlWords, n as countEditorWords, e as getEditorHtml, i as getEditorWordCount, c as isSameEditorHtml, s as resolveMaxWordCount, t as stripEditorHtml, o as toKEditorValue };
@@ -1,38 +0,0 @@
1
- import { Boot as e } from "@wangeditor/editor";
2
- //#region src/components/k-editor/utils/registerPreviewMenu.ts
3
- var t = "kPreview", n = "k-editor-preview", r = /* @__PURE__ */ new WeakMap(), i = !1, a = 0;
4
- function o(e) {
5
- let t = r.get(e);
6
- if (t) return t;
7
- let n = `k-editor-${++a}`;
8
- return r.set(e, n), n;
9
- }
10
- var s = class {
11
- title = "预览";
12
- tag = "button";
13
- getValue(e) {
14
- return "";
15
- }
16
- isActive(e) {
17
- return !1;
18
- }
19
- isDisabled(e) {
20
- return !1;
21
- }
22
- exec(e) {
23
- window.dispatchEvent(new CustomEvent(n, { detail: {
24
- editorId: o(e),
25
- html: e.getHtml()
26
- } }));
27
- }
28
- };
29
- function c() {
30
- i ||= (e.registerMenu({
31
- key: t,
32
- factory() {
33
- return new s();
34
- }
35
- }), !0);
36
- }
37
- //#endregion
38
- export { n as K_EDITOR_PREVIEW_EVENT, t as K_EDITOR_PREVIEW_MENU_KEY, o as bindEditorPreviewId, c as ensurePreviewMenuRegistered };
@@ -1,8 +0,0 @@
1
- //#region src/components/k-editor/utils/sanitizePasteHtml.ts
2
- function e(e) {
3
- if (!e) return "";
4
- let t = e;
5
- return t = t.replace(/<xml>[\s\S]*?<\/xml>/gi, ""), t = t.replace(/(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g, ""), t = t.replace(/<!--(.*?)-->/g, ""), t = t.replace(/<style>[\s\S]*?<\/style>/gi, ""), t;
6
- }
7
- //#endregion
8
- export { e as sanitizePasteHtml };
@@ -1,5 +0,0 @@
1
- import e from "./KForm.vue_vue_type_script_setup_true_lang.js";
2
- //#region src/components/k-form/KForm.vue
3
- var t = e;
4
- //#endregion
5
- export { t as default };
@@ -1,248 +0,0 @@
1
- import { useKFormFields as e } from "./composables/useKFormFields.js";
2
- import { useKFormModel as t } from "./composables/useKFormModel.js";
3
- import { DATE_PICKER_VALUES_KEY as n } from "./constants.js";
4
- import { isBuiltinFormComponentType as r } from "./utils/resolveFormFieldComponent.js";
5
- import i from "./KFormField.js";
6
- import { Fragment as a, computed as o, createBlock as s, createElementBlock as ee, createElementVNode as c, createSlots as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeProps as te, nextTick as p, normalizeClass as m, normalizeStyle as ne, openBlock as h, provide as g, ref as _, renderList as v, renderSlot as y, toDisplayString as b, toRef as x, unref as S, useAttrs as C, useSlots as w, watch as T, withCtx as E, withModifiers as re } from "vue";
7
- import { ElForm as ie, ElFormItem as ae, ElTooltip as D } from "element-plus";
8
- import O from "dayjs";
9
- //#region src/components/k-form/KForm.vue?vue&type=script&setup=true&lang.ts
10
- var k = ["innerHTML"], A = /*@__PURE__*/ f({
11
- name: "KForm",
12
- inheritAttrs: !1,
13
- __name: "KForm",
14
- props: {
15
- formConfigs: {},
16
- colLength: { default: 2 },
17
- inline: {
18
- type: Boolean,
19
- default: !1
20
- },
21
- labelWidth: { default: void 0 },
22
- autoLayout: {
23
- type: Boolean,
24
- default: !1
25
- },
26
- hideLabel: {
27
- type: Boolean,
28
- default: !1
29
- },
30
- labelPosition: { default: "right" },
31
- modelValue: { default: void 0 },
32
- data: { default: () => ({}) },
33
- ignoreValidate: {
34
- type: Boolean,
35
- default: !1
36
- },
37
- readonly: {
38
- type: Boolean,
39
- default: !1
40
- }
41
- },
42
- emits: ["update:modelValue", "change"],
43
- setup(f, { expose: A, emit: j }) {
44
- let M = w(), N = f, P = j, F = C(), I = _(), L = _({});
45
- g(n, L);
46
- function R(e) {
47
- if (e == null || e === "") return;
48
- if (e instanceof Date) return Number.isNaN(e.getTime()) ? void 0 : e;
49
- if (Array.isArray(e)) {
50
- let t = e[0];
51
- return t ? R(t) : void 0;
52
- }
53
- let t = O(e);
54
- return t.isValid() ? t.toDate() : void 0;
55
- }
56
- function z(e, t) {
57
- L.value = {
58
- ...L.value,
59
- [`kitDate-${e}`]: R(t)
60
- };
61
- }
62
- function B(e) {
63
- return r(e.component) && e.component === "DatePicker";
64
- }
65
- let V = o(() => ({
66
- colLength: N.colLength,
67
- inline: N.inline,
68
- labelWidth: H.value,
69
- labelPosition: N.labelPosition,
70
- autoLayout: N.autoLayout,
71
- hideLabel: N.hideLabel
72
- })), H = o(() => N.labelWidth ? N.labelWidth : N.autoLayout ? "120px" : "110px"), U = o(() => ({
73
- "k-form--inline-layout": N.inline,
74
- "k-form--query-layout": N.autoLayout,
75
- "k-form--grid-layout": !N.autoLayout && !N.inline
76
- })), W = o(() => ({ "--k-form-cols": String(N.colLength) })), G = o(() => N.modelValue !== void 0), K = t({
77
- formConfigs: x(N, "formConfigs"),
78
- data: x(N, "data"),
79
- modelValue: x(N, "modelValue"),
80
- controlled: G,
81
- onChange: (e) => {
82
- P("change", e), G.value && P("update:modelValue", e);
83
- }
84
- });
85
- function q() {
86
- let e = {};
87
- N.formConfigs.forEach((t) => {
88
- B(t) && (e[`kitDate-${t.id}`] = R(K.formModel[t.id]));
89
- }), L.value = e;
90
- }
91
- let { normalizedConfigs: J, getFieldOptions: oe, resolveItemRules: Y, itemStyle: se, itemDisplay: ce, isItemReadonly: X, isItemDisabled: Z } = e({
92
- formConfigs: x(N, "formConfigs"),
93
- layout: V,
94
- formReadonly: x(N, "readonly")
95
- });
96
- T(() => N.formConfigs, () => q(), {
97
- immediate: !0,
98
- deep: !0
99
- }), T(() => K.formModel, () => q(), { deep: !0 });
100
- function le(e) {
101
- let t = ce(e);
102
- return {
103
- ...se(e),
104
- ...t ? { display: t } : {}
105
- };
106
- }
107
- let ue = o(() => {
108
- let e = { ...F };
109
- return delete e.readonly, {
110
- inline: N.inline && !N.autoLayout,
111
- labelWidth: H.value,
112
- labelPosition: N.labelPosition ?? "right",
113
- ...e
114
- };
115
- });
116
- function Q(e, t) {
117
- K.updateFieldValue(e, t), B(e) && z(e.id, t), de(e);
118
- }
119
- function de(e) {
120
- if (!I.value) return;
121
- let t = e.validatePeers ?? [], n = Y(e).length > 0;
122
- !n && !t.length || p(() => {
123
- n && I.value?.validateField(e.id).catch(() => {});
124
- for (let e of t) I.value?.validateField(e).catch(() => {});
125
- });
126
- }
127
- async function fe() {
128
- let e = K.getVisibleFieldsValue();
129
- if (!I.value) return e;
130
- try {
131
- return await I.value.validate() === !1 ? N.ignoreValidate ? (I.value.clearValidate(), e) : ($(), null) : e;
132
- } catch {
133
- return N.ignoreValidate ? (I.value.clearValidate(), e) : ($(), null);
134
- }
135
- }
136
- function $() {
137
- ((I.value?.$el)?.querySelector(".el-form-item.is-error") ?? document.querySelector(".k-form .el-form-item.is-error"))?.scrollIntoView({
138
- block: "center",
139
- behavior: "smooth"
140
- });
141
- }
142
- function pe(e) {
143
- return K.getFieldsValue(e);
144
- }
145
- function me() {
146
- return K.getVisibleFieldsValue();
147
- }
148
- function he(e) {
149
- K.setFieldsValue(e);
150
- }
151
- function ge() {
152
- I.value?.resetFields(), K.resetFormModel();
153
- }
154
- function _e(e) {
155
- K.resetFieldsValue(e), e.forEach((e) => I.value?.clearValidate(e));
156
- }
157
- function ve() {
158
- I.value?.clearValidate();
159
- }
160
- function ye() {
161
- return I.value;
162
- }
163
- return A({
164
- validateFields: fe,
165
- getFieldsValue: pe,
166
- getParams: me,
167
- setFieldsValue: he,
168
- resetForm: ge,
169
- resetFieldsValue: _e,
170
- getFormRef: ye,
171
- clearValidate: ve
172
- }), (e, t) => (h(), s(S(ie), te({
173
- ref_key: "formRef",
174
- ref: I,
175
- class: ["k-form", U.value],
176
- style: W.value,
177
- model: S(K).formModel
178
- }, ue.value, { onSubmit: t[0] ||= re(() => {}, ["prevent"]) }), {
179
- default: E(() => [(h(!0), ee(a, null, v(S(J), (n) => (h(), s(S(ae), {
180
- key: n.id,
181
- "data-label": n.label || "",
182
- "data-field-id": n.id,
183
- label: n.label ? `${n.label}:` : void 0,
184
- prop: n.id,
185
- rules: S(Y)(n),
186
- class: m(["k-form__item", [n.class, {
187
- "k-form__item--readonly": S(X)(n),
188
- "k-form__item--disabled": S(Z)(n),
189
- "k-form__item--full-row": n.newLineStart,
190
- "k-form__item--choice": S(r)(n.component) && (n.component === "Radio" || n.component === "Checkbox" || n.component === "Tag")
191
- }]]),
192
- style: ne(le(n))
193
- }, l({
194
- default: E(() => [!n.slot || !S(M)[n.id] ? (h(), s(i, {
195
- key: 0,
196
- item: n,
197
- "model-value": S(K).formModel[n.id],
198
- options: S(oe)(n),
199
- readonly: S(X)(n),
200
- disabled: S(Z)(n),
201
- "onUpdate:modelValue": (e) => Q(n, e)
202
- }, null, 8, [
203
- "item",
204
- "model-value",
205
- "options",
206
- "readonly",
207
- "disabled",
208
- "onUpdate:modelValue"
209
- ])) : y(e.$slots, n.id, {
210
- item: n,
211
- value: S(K).formModel[n.id],
212
- updateValue: (e) => Q(n, e)
213
- }, void 0, void 0, 1)]),
214
- _: 2
215
- }, [n.toolTip ? {
216
- name: "label",
217
- fn: E(() => [d(S(D), {
218
- effect: "dark",
219
- placement: "bottom",
220
- "popper-class": "k-form__tooltip"
221
- }, {
222
- content: E(() => [c("span", { innerHTML: n.toolTip }, null, 8, k)]),
223
- default: E(() => [t[1] ||= c("span", {
224
- class: "k-form__tip-icon",
225
- "aria-hidden": "true"
226
- }, "i", -1)]),
227
- _: 2
228
- }, 1024), u(" " + b(n.label ? `${n.label}:` : ""), 1)]),
229
- key: "0"
230
- } : void 0]), 1032, [
231
- "data-label",
232
- "data-field-id",
233
- "label",
234
- "prop",
235
- "rules",
236
- "class",
237
- "style"
238
- ]))), 128)), y(e.$slots, "default")]),
239
- _: 3
240
- }, 16, [
241
- "class",
242
- "style",
243
- "model"
244
- ]));
245
- }
246
- });
247
- //#endregion
248
- export { A as default };
@@ -1,5 +0,0 @@
1
- import e from "./KFormField.vue_vue_type_script_setup_true_lang.js";
2
- //#region src/components/k-form/KFormField.vue
3
- var t = e;
4
- //#endregion
5
- export { t as default };
@@ -1,50 +0,0 @@
1
- import { isBuiltinFormComponentType as e, resolveFormFieldComponent as t } from "./utils/resolveFormFieldComponent.js";
2
- import { computed as n, createBlock as r, defineComponent as i, mergeProps as a, openBlock as o, resolveDynamicComponent as s } from "vue";
3
- //#region src/components/k-form/KFormField.vue?vue&type=script&setup=true&lang.ts
4
- var c = /*@__PURE__*/ i({
5
- name: "KFormField",
6
- __name: "KFormField",
7
- props: {
8
- item: {},
9
- modelValue: {},
10
- options: {},
11
- readonly: { type: Boolean },
12
- disabled: { type: Boolean }
13
- },
14
- emits: ["update:modelValue"],
15
- setup(i, { emit: c }) {
16
- let l = i, u = c, d = n(() => t(l.item.component)), f = n(() => e(l.item.component) ? l.item.component : ""), p = n(() => {
17
- let e = { ...l.item.componentProps ?? {} };
18
- return delete e.value, delete e.onChange, delete e.style, delete e.readonly, delete e.disabled, [
19
- "Complex",
20
- "ScrollSelect",
21
- "Cascader"
22
- ].includes(f.value) || delete e.options, {
23
- ...e,
24
- componentType: f.value
25
- };
26
- }), m = n(() => {
27
- if (![
28
- "Complex",
29
- "ScrollSelect",
30
- "Cascader"
31
- ].includes(f.value)) return l.options;
32
- });
33
- function h(e) {
34
- u("update:modelValue", e);
35
- }
36
- return (e, t) => (o(), r(s(d.value), a({
37
- "model-value": i.modelValue,
38
- options: m.value,
39
- readonly: i.readonly,
40
- disabled: i.disabled
41
- }, p.value, { "onUpdate:modelValue": h }), null, 16, [
42
- "model-value",
43
- "options",
44
- "readonly",
45
- "disabled"
46
- ]));
47
- }
48
- });
49
- //#endregion
50
- export { c as default };