zjh-web-ui 1.0.10

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 (175) hide show
  1. package/README.md +1 -0
  2. package/config/resolver.js +21 -0
  3. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  4. package/dist/components/AMapConfig.js +23 -0
  5. package/dist/components/HuiAMapMassMarkers/HuiAMapMassMarkers.vue.js +82 -0
  6. package/dist/components/HuiAMapMassMarkers/HuiAMapMassMarkers.vue2.js +4 -0
  7. package/dist/components/HuiAMapMassMarkers/index.js +7 -0
  8. package/dist/components/HuiAMapSearchAddress/HuiAMapSearchAddress.vue.js +7 -0
  9. package/dist/components/HuiAMapSearchAddress/HuiAMapSearchAddress.vue2.js +190 -0
  10. package/dist/components/HuiAMapSearchAddress/index.js +7 -0
  11. package/dist/components/HuiAMapSearchAddressDialog/HuiAMapSearchAddressDialog.vue.js +83 -0
  12. package/dist/components/HuiAMapSearchAddressDialog/HuiAMapSearchAddressDialog.vue2.js +4 -0
  13. package/dist/components/HuiAMapSearchAddressDialog/index.js +7 -0
  14. package/dist/components/HuiAMapSelectAddress/HuiAMapSelectAddress.vue.js +7 -0
  15. package/dist/components/HuiAMapSelectAddress/HuiAMapSelectAddress.vue2.js +178 -0
  16. package/dist/components/HuiAMapSelectAddress/index.js +7 -0
  17. package/dist/components/HuiAMapSelectAddressDialog/HuiAMapSelectAddressDialog.vue.js +83 -0
  18. package/dist/components/HuiAMapSelectAddressDialog/HuiAMapSelectAddressDialog.vue2.js +4 -0
  19. package/dist/components/HuiAMapSelectAddressDialog/index.js +7 -0
  20. package/dist/components/HuiCountDownButton/HuiCountDownButton.vue.js +63 -0
  21. package/dist/components/HuiCountDownButton/HuiCountDownButton.vue2.js +4 -0
  22. package/dist/components/HuiCountDownButton/index.js +7 -0
  23. package/dist/components/HuiDataView/HuiDataView.vue.js +7 -0
  24. package/dist/components/HuiDataView/HuiDataView.vue2.js +84 -0
  25. package/dist/components/HuiDataView/index.js +7 -0
  26. package/dist/components/HuiGridForm/HuiGridForm.vue.js +7 -0
  27. package/dist/components/HuiGridForm/HuiGridForm.vue2.js +223 -0
  28. package/dist/components/HuiGridForm/HuiGridFormHooks.js +21 -0
  29. package/dist/components/HuiGridForm/index.js +7 -0
  30. package/dist/components/HuiLineEditDialog/HuiLineEditDialog.vue.js +7 -0
  31. package/dist/components/HuiLineEditDialog/HuiLineEditDialog.vue2.js +167 -0
  32. package/dist/components/HuiLineEditDialog/index.js +7 -0
  33. package/dist/components/HuiLineEditPopover/HuiLineEditPopover.vue.js +7 -0
  34. package/dist/components/HuiLineEditPopover/HuiLineEditPopover.vue2.js +128 -0
  35. package/dist/components/HuiLineEditPopover/index.js +7 -0
  36. package/dist/components/HuiPreviewRichTextDialog/HuiPreviewRichTextDialog.vue.js +65 -0
  37. package/dist/components/HuiPreviewRichTextDialog/HuiPreviewRichTextDialog.vue2.js +4 -0
  38. package/dist/components/HuiPreviewRichTextDialog/index.js +7 -0
  39. package/dist/components/HuiRegionTreeDialog/HuiRegionTreeDialog.vue.js +118 -0
  40. package/dist/components/HuiRegionTreeDialog/HuiRegionTreeDialog.vue2.js +4 -0
  41. package/dist/components/HuiRegionTreeDialog/index.js +7 -0
  42. package/dist/components/HuiRegionTreeSelect/HuiRegionTreeSelect.vue.js +7 -0
  43. package/dist/components/HuiRegionTreeSelect/HuiRegionTreeSelect.vue2.js +59 -0
  44. package/dist/components/HuiRegionTreeSelect/index.js +7 -0
  45. package/dist/components/HuiSelectLoadStatus/HuiSelectLoadStatus.vue.js +44 -0
  46. package/dist/components/HuiSelectLoadStatus/HuiSelectLoadStatus.vue2.js +4 -0
  47. package/dist/components/HuiSelectLoadStatus/index.js +7 -0
  48. package/dist/components/HuiShowUrlDialog/HuiShowUrlDialog.vue.js +50 -0
  49. package/dist/components/HuiShowUrlDialog/HuiShowUrlDialog.vue2.js +4 -0
  50. package/dist/components/HuiShowUrlDialog/index.js +7 -0
  51. package/dist/components/HuiStringArrayInputDialog/HuiStringArrayInputDialog.vue.js +118 -0
  52. package/dist/components/HuiStringArrayInputDialog/HuiStringArrayInputDialog.vue2.js +4 -0
  53. package/dist/components/HuiStringArrayInputDialog/index.js +7 -0
  54. package/dist/components/HuiTags/HuiTags.vue.js +7 -0
  55. package/dist/components/HuiTags/HuiTags.vue2.js +28 -0
  56. package/dist/components/HuiTags/index.js +7 -0
  57. package/dist/components/HuiTagsMore/HuiTagsMore.vue.js +188 -0
  58. package/dist/components/HuiTagsMore/HuiTagsMore.vue2.js +4 -0
  59. package/dist/components/HuiTagsMore/index.js +7 -0
  60. package/dist/components/HuiTinymce/HuiTinymce.vue.js +37 -0
  61. package/dist/components/HuiTinymce/HuiTinymce.vue3.js +5 -0
  62. package/dist/components/HuiTinymce/HuiTinymceLinkHooks.js +99 -0
  63. package/dist/components/HuiTinymce/HuiTinymceSettingHooks.js +104 -0
  64. package/dist/components/HuiTinymce/index.js +8 -0
  65. package/dist/components/HuiTinymceDialog/HuiTinymceDialog.vue.js +96 -0
  66. package/dist/components/HuiTinymceDialog/HuiTinymceDialog.vue2.js +4 -0
  67. package/dist/components/HuiTinymceDialog/index.js +7 -0
  68. package/dist/components/HuiTip/HuiTip.vue.js +52 -0
  69. package/dist/components/HuiTip/HuiTip.vue2.js +4 -0
  70. package/dist/components/HuiTip/index.js +7 -0
  71. package/dist/components-install-list.js +47 -0
  72. package/dist/delegate.js +13 -0
  73. package/dist/directives/install-loadmore.js +7 -0
  74. package/dist/directives/select-loadmore.js +25 -0
  75. package/dist/hooks/useHuiDialog/useHuiDialog.js +20 -0
  76. package/dist/hooks/useHuiFormDialog/formDialogPropsDef.js +6 -0
  77. package/dist/hooks/useHuiFormDialog/useHuiFormDialog.js +109 -0
  78. package/dist/index.js +62 -0
  79. package/dist/install-helper/install.js +21 -0
  80. package/dist/style.css +1 -0
  81. package/dist/utils/hui-rules.js +142 -0
  82. package/dist/utils/hui-tool/index.js +7 -0
  83. package/dist/utils/hui-tool/message-box/index.js +33 -0
  84. package/dist/utils/hui-tool/message-box/message-box.vue.js +112 -0
  85. package/dist/utils/hui-tool/message-box/message-box.vue3.js +5 -0
  86. package/dist/utils/hui-tool/msg-tool.js +39 -0
  87. package/global.d.ts +40 -0
  88. package/package.json +44 -0
  89. package/src/css/common-font.scss +104 -0
  90. package/src/css/index.scss +1 -0
  91. package/types/components/AMapConfig.d.ts +2 -0
  92. package/types/components/HuiAMapMassMarkers/HuiAMapMassMarkers.vue.d.ts +105 -0
  93. package/types/components/HuiAMapMassMarkers/index.d.ts +107 -0
  94. package/types/components/HuiAMapMassMarkers/type.d.ts +58 -0
  95. package/types/components/HuiAMapSearchAddress/HuiAMapSearchAddress.vue.d.ts +76 -0
  96. package/types/components/HuiAMapSearchAddress/index.d.ts +77 -0
  97. package/types/components/HuiAMapSearchAddress/type.d.ts +19 -0
  98. package/types/components/HuiAMapSearchAddressDialog/HuiAMapSearchAddressDialog.vue.d.ts +38 -0
  99. package/types/components/HuiAMapSearchAddressDialog/index.d.ts +71 -0
  100. package/types/components/HuiAMapSearchAddressDialog/type.d.ts +17 -0
  101. package/types/components/HuiAMapSelectAddress/HuiAMapSelectAddress.vue.d.ts +76 -0
  102. package/types/components/HuiAMapSelectAddress/index.d.ts +77 -0
  103. package/types/components/HuiAMapSelectAddress/type.d.ts +19 -0
  104. package/types/components/HuiAMapSelectAddressDialog/HuiAMapSelectAddressDialog.vue.d.ts +38 -0
  105. package/types/components/HuiAMapSelectAddressDialog/index.d.ts +71 -0
  106. package/types/components/HuiAMapSelectAddressDialog/type.d.ts +17 -0
  107. package/types/components/HuiCountDownButton/HuiCountDownButton.vue.d.ts +44 -0
  108. package/types/components/HuiCountDownButton/index.d.ts +76 -0
  109. package/types/components/HuiCountDownButton/type.d.ts +20 -0
  110. package/types/components/HuiDataView/HuiDataView.vue.d.ts +60 -0
  111. package/types/components/HuiDataView/index.d.ts +109 -0
  112. package/types/components/HuiDataView/type.d.ts +49 -0
  113. package/types/components/HuiGridForm/HuiGridForm.vue.d.ts +77 -0
  114. package/types/components/HuiGridForm/HuiGridFormHooks.d.ts +4 -0
  115. package/types/components/HuiGridForm/index.d.ts +175 -0
  116. package/types/components/HuiGridForm/type.d.ts +67 -0
  117. package/types/components/HuiLineEditDialog/HuiLineEditDialog.vue.d.ts +75 -0
  118. package/types/components/HuiLineEditDialog/index.d.ts +173 -0
  119. package/types/components/HuiLineEditDialog/type.d.ts +86 -0
  120. package/types/components/HuiLineEditPopover/HuiLineEditPopover.vue.d.ts +74 -0
  121. package/types/components/HuiLineEditPopover/index.d.ts +133 -0
  122. package/types/components/HuiLineEditPopover/type.d.ts +23 -0
  123. package/types/components/HuiPreviewRichTextDialog/HuiPreviewRichTextDialog.vue.d.ts +31 -0
  124. package/types/components/HuiPreviewRichTextDialog/index.d.ts +22 -0
  125. package/types/components/HuiPreviewRichTextDialog/type.d.ts +4 -0
  126. package/types/components/HuiRegionTreeDialog/HuiRegionTreeDialog.vue.d.ts +53 -0
  127. package/types/components/HuiRegionTreeDialog/index.d.ts +68 -0
  128. package/types/components/HuiRegionTreeDialog/type.d.ts +24 -0
  129. package/types/components/HuiRegionTreeSelect/HuiRegionTreeSelect.vue.d.ts +25 -0
  130. package/types/components/HuiRegionTreeSelect/index.d.ts +29 -0
  131. package/types/components/HuiRegionTreeSelect/type.d.ts +6 -0
  132. package/types/components/HuiSelectLoadStatus/HuiSelectLoadStatus.vue.d.ts +14 -0
  133. package/types/components/HuiSelectLoadStatus/index.d.ts +33 -0
  134. package/types/components/HuiSelectLoadStatus/type.d.ts +11 -0
  135. package/types/components/HuiShowUrlDialog/HuiShowUrlDialog.vue.d.ts +37 -0
  136. package/types/components/HuiShowUrlDialog/index.d.ts +40 -0
  137. package/types/components/HuiShowUrlDialog/type.d.ts +11 -0
  138. package/types/components/HuiStringArrayInputDialog/HuiStringArrayInputDialog.vue.d.ts +44 -0
  139. package/types/components/HuiStringArrayInputDialog/index.d.ts +67 -0
  140. package/types/components/HuiStringArrayInputDialog/type.d.ts +33 -0
  141. package/types/components/HuiTags/HuiTags.vue.d.ts +37 -0
  142. package/types/components/HuiTags/index.d.ts +36 -0
  143. package/types/components/HuiTagsMore/HuiTagsMore.vue.d.ts +93 -0
  144. package/types/components/HuiTagsMore/index.d.ts +92 -0
  145. package/types/components/HuiTinymce/HuiTinymce.vue.d.ts +62 -0
  146. package/types/components/HuiTinymce/HuiTinymceLinkHooks.d.ts +3 -0
  147. package/types/components/HuiTinymce/HuiTinymceSettingHooks.d.ts +3 -0
  148. package/types/components/HuiTinymce/index.d.ts +66 -0
  149. package/types/components/HuiTinymce/type.d.ts +51 -0
  150. package/types/components/HuiTinymceDialog/HuiTinymceDialog.vue.d.ts +53 -0
  151. package/types/components/HuiTinymceDialog/index.d.ts +78 -0
  152. package/types/components/HuiTinymceDialog/type.d.ts +12 -0
  153. package/types/components/HuiTip/HuiTip.vue.d.ts +22 -0
  154. package/types/components/HuiTip/index.d.ts +99 -0
  155. package/types/components/HuiTip/type.d.ts +14 -0
  156. package/types/components-install-list.d.ts +3328 -0
  157. package/types/components.d.ts +21 -0
  158. package/types/delegate.d.ts +41 -0
  159. package/types/directives/index.d.ts +4 -0
  160. package/types/directives/install-loadmore.d.ts +7 -0
  161. package/types/directives/select-loadmore.d.ts +7 -0
  162. package/types/hooks/index.d.ts +3 -0
  163. package/types/hooks/useHuiDialog/useHuiDialog.d.ts +18 -0
  164. package/types/hooks/useHuiFormDialog/formDialogPropsDef.d.ts +3 -0
  165. package/types/hooks/useHuiFormDialog/type.d.ts +90 -0
  166. package/types/hooks/useHuiFormDialog/useHuiFormDialog.d.ts +32 -0
  167. package/types/index.d.ts +13 -0
  168. package/types/install-helper/install.d.ts +18 -0
  169. package/types/install-helper/typescript.d.ts +14 -0
  170. package/types/utils/hui-rules.d.ts +80 -0
  171. package/types/utils/hui-tool/index.d.ts +8 -0
  172. package/types/utils/hui-tool/message-box/index.d.ts +18 -0
  173. package/types/utils/hui-tool/message-box/message-box.vue.d.ts +36 -0
  174. package/types/utils/hui-tool/msg-tool.d.ts +26 -0
  175. package/types/utils/index.d.ts +2 -0
@@ -0,0 +1,50 @@
1
+ import { defineComponent as s, ref as m, openBlock as f, createBlock as h, unref as r, isRef as c, withCtx as w, createElementVNode as g, normalizeStyle as y, toValue as _ } from "vue";
2
+ import { useHuiDialog as U } from "../../hooks/useHuiDialog/useHuiDialog.js";
3
+ import { ElDialog as V } from "element-plus";
4
+ import { testUtils as v } from "@hua5/hua5-utils";
5
+ /* empty css */
6
+ const D = ["src"], B = /* @__PURE__ */ s({
7
+ name: "HuiShowUrlDialog",
8
+ __name: "HuiShowUrlDialog",
9
+ props: {
10
+ title: { default: "" },
11
+ width: { default: "920px" },
12
+ height: { default: "600px" }
13
+ },
14
+ setup(b, { expose: n }) {
15
+ const { show: e, payload: t, open: d, close: l } = U(), i = m("");
16
+ function p() {
17
+ if (v.isEmpty(_(t))) {
18
+ l();
19
+ return;
20
+ }
21
+ i.value = t.value.url;
22
+ }
23
+ return n({
24
+ open: d,
25
+ close: l
26
+ }), (o, a) => (f(), h(r(V), {
27
+ modelValue: r(e),
28
+ "onUpdate:modelValue": a[0] || (a[0] = (u) => c(e) ? e.value = u : null),
29
+ title: o.title,
30
+ width: o.width,
31
+ "close-on-click-modal": !1,
32
+ "modal-append-to-body": !1,
33
+ "append-to-body": "",
34
+ onOpen: p
35
+ }, {
36
+ default: w(() => [
37
+ g("iframe", {
38
+ src: i.value,
39
+ frameborder: "0",
40
+ width: "100%",
41
+ style: y({ height: o.height })
42
+ }, null, 12, D)
43
+ ]),
44
+ _: 1
45
+ }, 8, ["modelValue", "title", "width"]));
46
+ }
47
+ });
48
+ export {
49
+ B as default
50
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./HuiShowUrlDialog.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,7 @@
1
+ import { withInstall as o } from "../../install-helper/install.js";
2
+ import t from "./HuiShowUrlDialog.vue.js";
3
+ const a = o(t);
4
+ export {
5
+ a as HuiShowUrlDialog,
6
+ a as default
7
+ };
@@ -0,0 +1,118 @@
1
+ import { defineComponent as B, ref as D, reactive as c, openBlock as y, createBlock as N, unref as l, isRef as R, withCtx as n, createElementVNode as U, createVNode as r, createTextVNode as I, withKeys as x, createElementBlock as F, toDisplayString as H, createCommentVNode as K, toValue as a } from "vue";
2
+ import { ElDialog as M, ElButton as b, ElForm as O, ElFormItem as j, ElInput as z, ElMessage as L } from "element-plus";
3
+ import { useHuiDialog as T } from "../../hooks/useHuiDialog/useHuiDialog.js";
4
+ import { testUtils as _, stringUtils as q } from "@hua5/hua5-utils";
5
+ /* empty css */
6
+ const G = {
7
+ key: 0,
8
+ class: "text-danger ml-50"
9
+ }, Y = /* @__PURE__ */ B({
10
+ name: "HuiStringArrayInputDialog",
11
+ __name: "HuiStringArrayInputDialog",
12
+ props: {
13
+ title: { default: "请输入" },
14
+ label: { default: "内容" },
15
+ placeholder: { default: "请输入" },
16
+ rules: {},
17
+ tips: { type: Boolean, default: !0 }
18
+ },
19
+ emits: ["onSubmit"],
20
+ setup(g, { expose: v, emit: V }) {
21
+ const { id: C, show: p, payload: i, confirmLoading: s, open: E, close: u } = T(), f = D(null), k = V, h = g, t = c({
22
+ inputInfo: ""
23
+ }), w = c({
24
+ inputInfo: h.rules || []
25
+ });
26
+ function S() {
27
+ if (_.isEmpty(a(i))) {
28
+ u();
29
+ return;
30
+ }
31
+ t.inputInfo = Array.isArray(a(i).inputInfo) ? a(i).inputInfo.join(",") : a(i).inputInfo;
32
+ }
33
+ function m() {
34
+ f.value.validate(async (o) => {
35
+ if (o) {
36
+ s.value = !0;
37
+ let e = t.inputInfo;
38
+ e = q.trimChar(e.replaceAll(",", ","), ",", "both"), k("onSubmit", a(C), e), u();
39
+ } else
40
+ L.error("验证未通过");
41
+ });
42
+ }
43
+ function A() {
44
+ t.inputInfo = "", i.value = {}, s.value = !1, f.value.resetFields();
45
+ }
46
+ return v({
47
+ open: E,
48
+ close: u
49
+ }), (o, e) => (y(), N(l(M), {
50
+ modelValue: l(p),
51
+ "onUpdate:modelValue": e[1] || (e[1] = (d) => R(p) ? p.value = d : null),
52
+ title: o.title,
53
+ width: "520px",
54
+ top: "35vh",
55
+ "modal-append-to-body": !1,
56
+ "append-to-body": "",
57
+ onOpen: S,
58
+ onClose: A
59
+ }, {
60
+ footer: n(() => [
61
+ U("div", null, [
62
+ r(l(b), { onClick: l(u) }, {
63
+ default: n(() => e[2] || (e[2] = [
64
+ I("取 消")
65
+ ])),
66
+ _: 1
67
+ }, 8, ["onClick"]),
68
+ r(l(b), {
69
+ type: "primary",
70
+ class: "w-100",
71
+ loading: l(s),
72
+ onClick: m
73
+ }, {
74
+ default: n(() => e[3] || (e[3] = [
75
+ I("确 定")
76
+ ])),
77
+ _: 1
78
+ }, 8, ["loading"])
79
+ ])
80
+ ]),
81
+ default: n(() => [
82
+ r(l(O), {
83
+ ref_key: "formRef",
84
+ ref: f,
85
+ model: t,
86
+ rules: w,
87
+ size: "small",
88
+ class: "mt-30 font-bold w-100%"
89
+ }, {
90
+ default: n(() => [
91
+ r(l(j), {
92
+ label: o.label,
93
+ prop: "inputInfo",
94
+ class: "flex w-100%"
95
+ }, {
96
+ default: n(() => [
97
+ r(l(z), {
98
+ modelValue: t.inputInfo,
99
+ "onUpdate:modelValue": e[0] || (e[0] = (d) => t.inputInfo = d),
100
+ modelModifiers: { trim: !0 },
101
+ placeholder: o.placeholder,
102
+ onKeyup: x(m, ["enter"])
103
+ }, null, 8, ["modelValue", "placeholder"])
104
+ ]),
105
+ _: 1
106
+ }, 8, ["label"]),
107
+ o.tips ? (y(), F("div", G, H(o.placeholder), 1)) : K("", !0)
108
+ ]),
109
+ _: 1
110
+ }, 8, ["model", "rules"])
111
+ ]),
112
+ _: 1
113
+ }, 8, ["modelValue", "title"]));
114
+ }
115
+ });
116
+ export {
117
+ Y as default
118
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./HuiStringArrayInputDialog.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,7 @@
1
+ import { withInstall as t } from "../../install-helper/install.js";
2
+ import r from "./HuiStringArrayInputDialog.vue.js";
3
+ const a = t(r);
4
+ export {
5
+ a as HuiStringArrayInputDialog,
6
+ a as default
7
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./HuiTags.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9feb2e98"]]);
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,28 @@
1
+ import { defineComponent as s, openBlock as n, createBlock as o, unref as p, normalizeClass as i, withCtx as l, createTextVNode as g, toDisplayString as c } from "vue";
2
+ import { ElTag as u } from "element-plus";
3
+ const f = /* @__PURE__ */ s({
4
+ name: "HuiTags",
5
+ __name: "HuiTags",
6
+ props: {
7
+ text: { default: "" },
8
+ tagType: { default: "primary" },
9
+ tagClass: {}
10
+ },
11
+ setup(t) {
12
+ const e = t;
13
+ if (!((a) => ["primary", "success", "warning", "danger", "info"].includes(a))(e.tagType))
14
+ throw new Error(`Invalid tagType: ${e.tagType}`);
15
+ return (a, r) => (n(), o(p(u), {
16
+ type: a.tagType,
17
+ class: i(a.tagClass)
18
+ }, {
19
+ default: l(() => [
20
+ g(c(a.text), 1)
21
+ ]),
22
+ _: 1
23
+ }, 8, ["type", "class"]));
24
+ }
25
+ });
26
+ export {
27
+ f as default
28
+ };
@@ -0,0 +1,7 @@
1
+ import { withInstall as t } from "../../install-helper/install.js";
2
+ import o from "./HuiTags.vue.js";
3
+ const r = t(o);
4
+ export {
5
+ r as HuiTags,
6
+ r as default
7
+ };
@@ -0,0 +1,188 @@
1
+ import { defineComponent as D, ref as h, onMounted as L, openBlock as a, createElementBlock as r, createElementVNode as x, normalizeClass as A, Fragment as y, renderList as o, createBlock as n, unref as c, withCtx as u, mergeProps as f, createTextVNode as d, toDisplayString as g, normalizeStyle as k, createVNode as j, createCommentVNode as B } from "vue";
2
+ import { ElTooltip as w, ElTag as b, ElPopover as M } from "element-plus";
3
+ import T from "../HuiTags/HuiTags.vue.js";
4
+ import { testUtils as N } from "@hua5/hua5-utils";
5
+ const O = {
6
+ key: 0,
7
+ class: "admin-link text-20"
8
+ }, S = { class: "overflow-y-auto max-h-300" }, F = /* @__PURE__ */ D({
9
+ name: "HuiTagsMore",
10
+ __name: "HuiTagsMore",
11
+ props: {
12
+ /* 标签数组传入value组成的数组 arr:[1,2,3]*/
13
+ tagsList: {
14
+ type: Array,
15
+ default: () => []
16
+ },
17
+ /* 字典对象*/
18
+ dictObj: {
19
+ type: Object,
20
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
21
+ default: () => {
22
+ }
23
+ },
24
+ /* 鼠标移入是否显示tip*/
25
+ showTips: {
26
+ type: Boolean,
27
+ default: !1
28
+ },
29
+ /* 容器宽度(超出显示省略号)*/
30
+ width: {
31
+ type: Number,
32
+ default: 100
33
+ },
34
+ valueKey: {
35
+ type: String,
36
+ default: "k"
37
+ },
38
+ labelKey: {
39
+ type: String,
40
+ default: "v"
41
+ },
42
+ isElTag: {
43
+ type: Boolean,
44
+ default: !1
45
+ },
46
+ elTagType: {
47
+ type: String,
48
+ default: "primary"
49
+ },
50
+ elTagAttr: {
51
+ type: Object,
52
+ default: () => ({})
53
+ }
54
+ },
55
+ setup(e) {
56
+ const i = e, E = h(null), K = h(null), m = h(!1), C = () => {
57
+ const s = K.value.clientWidth;
58
+ m.value = s >= i.width;
59
+ };
60
+ L(() => {
61
+ C();
62
+ });
63
+ function l(s) {
64
+ return N.isEmpty(i.dictObj) ? {
65
+ [i.labelKey]: s,
66
+ [i.valueKey]: s
67
+ } : i.dictObj[s] || {};
68
+ }
69
+ return (s, V) => (a(), r("div", {
70
+ ref_key: "parentDiv",
71
+ ref: E,
72
+ class: "flex items-center parentDiv"
73
+ }, [
74
+ x("div", {
75
+ ref_key: "tagsDiv",
76
+ ref: K,
77
+ class: A(["tagsDiv whitespace-nowrap", m.value ? "overflow-hidden" : ""])
78
+ }, [
79
+ e.showTips ? (a(!0), r(y, { key: 0 }, o(e.tagsList, (t, v) => (a(), n(c(w), {
80
+ key: v,
81
+ effect: "dark",
82
+ "show-after": 200,
83
+ content: l(t).tip || l(t)[e.labelKey],
84
+ placement: "top"
85
+ }, {
86
+ default: u(() => [
87
+ e.isElTag ? (a(), n(c(b), f({
88
+ key: 0,
89
+ class: "m-b-5 m-r-5",
90
+ type: e.elTagType,
91
+ ref_for: !0
92
+ }, e.elTagAttr), {
93
+ default: u(() => [
94
+ d(g(l(t)[e.labelKey]), 1)
95
+ ]),
96
+ _: 2
97
+ }, 1040, ["type"])) : (a(), n(T, {
98
+ key: 1,
99
+ class: "m-b-5",
100
+ text: l(t)[e.labelKey],
101
+ style: k({ backgroundColor: l(t).color })
102
+ }, null, 8, ["text", "style"]))
103
+ ]),
104
+ _: 2
105
+ }, 1032, ["content"]))), 128)) : (a(), r(y, { key: 1 }, [
106
+ e.isElTag ? (a(!0), r(y, { key: 0 }, o(e.tagsList, (t) => (a(), n(c(b), f({
107
+ key: l(t)[e.valueKey],
108
+ class: "m-b-5 m-r-5",
109
+ type: e.elTagType,
110
+ ref_for: !0
111
+ }, e.elTagAttr), {
112
+ default: u(() => [
113
+ d(g(l(t)[e.labelKey]), 1)
114
+ ]),
115
+ _: 2
116
+ }, 1040, ["type"]))), 128)) : (a(!0), r(y, { key: 1 }, o(e.tagsList, (t) => (a(), n(T, {
117
+ key: l(t)[e.valueKey],
118
+ class: "m-b-5",
119
+ text: l(t)[e.labelKey],
120
+ style: k({ backgroundColor: l(t).color })
121
+ }, null, 8, ["text", "style"]))), 128))
122
+ ], 64))
123
+ ], 2),
124
+ j(c(M), {
125
+ placement: "right",
126
+ title: "",
127
+ width: 130,
128
+ trigger: "hover"
129
+ }, {
130
+ reference: u(() => [
131
+ m.value ? (a(), r("div", O, "...")) : B("", !0)
132
+ ]),
133
+ default: u(() => [
134
+ x("div", S, [
135
+ e.showTips ? (a(!0), r(y, { key: 0 }, o(e.tagsList, (t, v) => (a(), n(c(w), {
136
+ key: v,
137
+ effect: "dark",
138
+ "show-after": 200,
139
+ content: l(t).tip || l(t)[e.labelKey],
140
+ placement: "top"
141
+ }, {
142
+ default: u(() => [
143
+ e.isElTag ? (a(), n(c(b), f({
144
+ key: 0,
145
+ class: "m-b-5 m-r-5",
146
+ type: e.elTagType,
147
+ ref_for: !0
148
+ }, e.elTagAttr), {
149
+ default: u(() => [
150
+ d(g(l(t)[e.labelKey]), 1)
151
+ ]),
152
+ _: 2
153
+ }, 1040, ["type"])) : (a(), n(T, {
154
+ key: 1,
155
+ class: "m-b-5",
156
+ text: l(t)[e.labelKey],
157
+ style: k({ backgroundColor: l(t).color })
158
+ }, null, 8, ["text", "style"]))
159
+ ]),
160
+ _: 2
161
+ }, 1032, ["content"]))), 128)) : (a(), r(y, { key: 1 }, [
162
+ e.isElTag ? (a(!0), r(y, { key: 0 }, o(e.tagsList, (t) => (a(), n(c(b), f({
163
+ key: l(t)[e.valueKey],
164
+ class: "m-b-5 m-r-5",
165
+ type: e.elTagType,
166
+ ref_for: !0
167
+ }, e.elTagAttr), {
168
+ default: u(() => [
169
+ d(g(l(t)[e.labelKey]), 1)
170
+ ]),
171
+ _: 2
172
+ }, 1040, ["type"]))), 128)) : (a(!0), r(y, { key: 1 }, o(e.tagsList, (t) => (a(), n(T, {
173
+ key: l(t)[e.valueKey],
174
+ class: "m-b-5",
175
+ text: l(t)[e.labelKey],
176
+ style: k({ backgroundColor: l(t).color })
177
+ }, null, 8, ["text", "style"]))), 128))
178
+ ], 64))
179
+ ])
180
+ ]),
181
+ _: 1
182
+ })
183
+ ], 512));
184
+ }
185
+ });
186
+ export {
187
+ F as default
188
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./HuiTagsMore.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,7 @@
1
+ import { withInstall as o } from "../../install-helper/install.js";
2
+ import t from "./HuiTagsMore.vue.js";
3
+ const i = o(t);
4
+ export {
5
+ i as HuiTagsMore,
6
+ i as default
7
+ };
@@ -0,0 +1,37 @@
1
+ import { defineComponent as a, mergeModels as p, useModel as s, openBlock as c, createElementBlock as f, normalizeStyle as k, createVNode as y, unref as n } from "vue";
2
+ import V from "@tinymce/tinymce-vue";
3
+ import { HuiTinymceLinkHooks as v } from "./HuiTinymceLinkHooks.js";
4
+ import { HuiTinymceSettingHooks as H } from "./HuiTinymceSettingHooks.js";
5
+ const T = /* @__PURE__ */ a({
6
+ name: "HuiTinymce",
7
+ __name: "HuiTinymce",
8
+ props: /* @__PURE__ */ p({
9
+ width: { default: "100%" },
10
+ height: { default: "80vh" },
11
+ linkAttribute: { default: () => [
12
+ { title: "小程序AppId", value: "mp_appid" },
13
+ { title: "小程序原始AppId", value: "mp_original_id" }
14
+ ] },
15
+ permission: {}
16
+ }, {
17
+ modelValue: {},
18
+ modelModifiers: {}
19
+ }),
20
+ emits: ["update:modelValue"],
21
+ setup(e) {
22
+ const t = e, { linkExpandAttributeStr: l, linkSetup: m } = v({ props: t }), { setting: u } = H({ props: t, linkSetup: m, linkExpandAttributeStr: l }), i = s(e, "modelValue");
23
+ return (d, o) => (c(), f("div", {
24
+ style: k({ width: d.width })
25
+ }, [
26
+ y(n(V), {
27
+ modelValue: i.value,
28
+ "onUpdate:modelValue": o[0] || (o[0] = (r) => i.value = r),
29
+ init: n(u),
30
+ "api-key": "no-api-key"
31
+ }, null, 8, ["modelValue", "init"])
32
+ ], 4));
33
+ }
34
+ });
35
+ export {
36
+ T as default
37
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./HuiTinymce.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,99 @@
1
+ import { ElMessage as g } from "element-plus";
2
+ import { computed as k } from "vue";
3
+ const x = (p) => {
4
+ const { props: r } = p, h = k(() => {
5
+ let i = "";
6
+ return r.linkAttribute.forEach((l) => {
7
+ i += "|" + l.value;
8
+ }), `a[href${i}]`;
9
+ });
10
+ function A(i) {
11
+ i.ui.registry.addButton("hua5Link", {
12
+ icon: "link",
13
+ tooltip: "添加/修改链接",
14
+ onAction: () => {
15
+ const l = i.selection.getContent();
16
+ let e = i.selection.getNode(), o = null;
17
+ e.nodeName != "A" && (o = e, e = e.parentNode);
18
+ const u = {};
19
+ r.linkAttribute.forEach((t) => {
20
+ u[t.value] = e.getAttribute(t.value) || "";
21
+ });
22
+ const m = e.getAttribute("href") || "";
23
+ u.href = m;
24
+ let s = l;
25
+ e.nodeName == "A" && (s = (o == null ? void 0 : o.outerHTML) || e.innerText), u.title = s;
26
+ const c = [
27
+ {
28
+ type: "input",
29
+ name: "title",
30
+ label: "内容",
31
+ disabled: function() {
32
+ const t = i.selection.getNode();
33
+ if (t != null && t.getAttribute("src"))
34
+ return !0;
35
+ const n = t.firstElementChild;
36
+ if (n != null && n.getAttribute("src"))
37
+ return !0;
38
+ }()
39
+ },
40
+ {
41
+ type: "input",
42
+ name: "href",
43
+ label: "添加连接"
44
+ }
45
+ ];
46
+ r.linkAttribute.forEach((t) => {
47
+ c.push({
48
+ type: "input",
49
+ name: t.value,
50
+ label: t.title
51
+ });
52
+ });
53
+ const d = {
54
+ title: "添加连接",
55
+ // dialog数据回显
56
+ initialData: u,
57
+ body: {
58
+ type: "panel",
59
+ items: c
60
+ },
61
+ buttons: [
62
+ {
63
+ type: "cancel",
64
+ text: "Close"
65
+ },
66
+ {
67
+ type: "submit",
68
+ text: "Save",
69
+ primary: !0
70
+ }
71
+ ],
72
+ // 数据提交
73
+ onSubmit: (t) => {
74
+ const n = t.getData();
75
+ if (e.nodeName == "A")
76
+ i.dom.setAttrib(e, "href", n.href), r.linkAttribute.forEach((a) => {
77
+ e.setAttribute(a.value, n[a.value]);
78
+ }), o || (e.innerText = n.title);
79
+ else {
80
+ let a = `<a href="${n.href}">${n.title}</a>`, f = "";
81
+ r.linkAttribute.forEach((b) => {
82
+ f += `${b.value}="${n[b.value]} "`, a = `<a href="${n.href}" ${f}>${n.title}</a>`;
83
+ }), i.insertContent(a);
84
+ }
85
+ t.close();
86
+ }
87
+ };
88
+ l.includes("href") && l.includes("<a") ? g.error("你选中的内容,其中部分已含有链接,请先删除后再添加") : i.windowManager.open(d);
89
+ }
90
+ });
91
+ }
92
+ return {
93
+ linkSetup: A,
94
+ linkExpandAttributeStr: h
95
+ };
96
+ };
97
+ export {
98
+ x as HuiTinymceLinkHooks
99
+ };