china-mobile-international-custom-components 0.0.41 → 0.0.43

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 (75) hide show
  1. package/es/ApplicationTypeTag.mjs +1 -1
  2. package/es/AutoShowTooltip.mjs +90 -0
  3. package/es/AvailableRangePreview.mjs +1 -1
  4. package/es/AvailableRangeSetting.mjs +266 -11
  5. package/es/CommonTagsList.mjs +200 -0
  6. package/es/DialogContainer.mjs +128 -0
  7. package/es/FileUploader.mjs +255 -0
  8. package/es/ParameterTable.mjs +2288 -0
  9. package/es/SourcePublish.mjs +475 -833
  10. package/es/Table.mjs +2 -2
  11. package/es/assets/AutoShowTooltip.css +1 -0
  12. package/es/assets/AvailableRangeSetting.css +1 -0
  13. package/es/assets/CommonTagsList.css +1 -0
  14. package/es/assets/DialogContainer.css +1 -0
  15. package/es/assets/FileUploader.css +1 -0
  16. package/es/assets/ParameterTable.css +1 -0
  17. package/es/assets/SourcePublish.css +1 -1
  18. package/es/assets/index2.css +1 -1
  19. package/es/chunks/{BackBar.zjPh_z_w.js → BackBar.DY42HcZy.js} +33 -33
  20. package/es/chunks/{BackBar.C3Tp-e_K.js → BackBar.eaUb1JvV.js} +98 -98
  21. package/es/chunks/config.CyAT4SUn.js +435 -0
  22. package/es/chunks/config.JrGX09T5.js +435 -0
  23. package/es/chunks/i18n.Bd7hh14j.js +4026 -0
  24. package/es/chunks/{i18n.BNeBD4gR.js → i18n.CfMhDOdX.js} +6 -6
  25. package/es/chunks/{index.DENagLDS.js → index.CHlFhI6c.js} +2 -2
  26. package/es/chunks/index.DjDvyGXt.js +313 -0
  27. package/es/chunks/layout.B1qqvrXz.js +639 -0
  28. package/es/chunks/request.24c3shPx.js +5 -0
  29. package/es/index.mjs +184 -130
  30. package/lib/ApplicationTypeTag.js +1 -1
  31. package/lib/AutoShowTooltip.js +1 -0
  32. package/lib/AvailableRangePreview.js +1 -1
  33. package/lib/AvailableRangeSetting.js +1 -1
  34. package/lib/CommonTagsList.js +1 -0
  35. package/lib/DialogContainer.js +1 -0
  36. package/lib/FileUploader.js +1 -0
  37. package/lib/ParameterTable.js +1 -0
  38. package/lib/SourcePublish.js +1 -1
  39. package/lib/Table.js +1 -1
  40. package/lib/assets/AutoShowTooltip.css +1 -0
  41. package/lib/assets/AvailableRangeSetting.css +1 -0
  42. package/lib/assets/CommonTagsList.css +1 -0
  43. package/lib/assets/DialogContainer.css +1 -0
  44. package/lib/assets/FileUploader.css +1 -0
  45. package/lib/assets/ParameterTable.css +1 -0
  46. package/lib/assets/SourcePublish.css +1 -1
  47. package/lib/assets/index2.css +1 -1
  48. package/lib/chunks/{BackBar.BL8repFN.js → BackBar.By7ouDgL.js} +1 -1
  49. package/lib/chunks/BackBar.CaaASGvb.js +1 -0
  50. package/lib/chunks/config.BInpXFGZ.js +1 -0
  51. package/lib/chunks/config.CL0cmPQ6.js +1 -0
  52. package/lib/chunks/i18n.D3L1FBDI.js +6 -0
  53. package/lib/chunks/index.D-pFPuUr.js +1 -0
  54. package/lib/chunks/{index.5Su4CrC-.js → index.zQ1SfvBa.js} +1 -1
  55. package/lib/chunks/layout.Cen7E9tF.js +1 -0
  56. package/lib/chunks/request.D8T4MgGX.js +1 -0
  57. package/lib/index.js +1 -1
  58. package/package.json +3 -3
  59. package/es/BackBar.mjs +0 -49
  60. package/es/assets/AiboxTable.css +0 -1
  61. package/es/assets/index3.css +0 -1
  62. package/es/chunks/AiboxTable.feSxtxGI.js +0 -563
  63. package/es/chunks/BackBar.DE2EjQfI.js +0 -606
  64. package/es/chunks/index.CSPp4g5C.js +0 -303
  65. package/es/chunks/index.D1cu8OUn.js +0 -260
  66. package/es/chunks/index.Doax01RQ.js +0 -254
  67. package/lib/BackBar.js +0 -1
  68. package/lib/assets/AiboxTable.css +0 -1
  69. package/lib/assets/index3.css +0 -1
  70. package/lib/chunks/AiboxTable.DdCYg_mt.js +0 -1
  71. package/lib/chunks/BackBar.CpYFuBeN.js +0 -1
  72. package/lib/chunks/BackBar.DcGRWfNN.js +0 -1
  73. package/lib/chunks/index.6X8xsqRJ.js +0 -1
  74. package/lib/chunks/index.B_esKpWv.js +0 -1
  75. package/lib/chunks/index.CP9rhXZ5.js +0 -1
@@ -0,0 +1,128 @@
1
+ import { w as C } from "./chunks/index.bCzIhWFw.js";
2
+ import { ref as s, computed as b, onBeforeUnmount as B, createBlock as k, createCommentVNode as V, openBlock as O, unref as S, normalizeClass as x, withCtx as i, createElementVNode as T, renderSlot as c, nextTick as r } from "vue";
3
+ import { ElDialog as $ } from "element-plus";
4
+ import './assets/DialogContainer.css';const E = { class: "dialog-body" }, N = {
5
+ __name: "DialogContainer",
6
+ props: {
7
+ // 弹框宽度
8
+ width: {
9
+ type: String,
10
+ default: "720px"
11
+ },
12
+ // 弹框标题
13
+ title: {
14
+ type: String,
15
+ default: ""
16
+ },
17
+ // 是否显示关闭按钮|是否esc和点击遮罩关闭
18
+ closable: {
19
+ type: Boolean,
20
+ default: !0
21
+ },
22
+ // 是否显示关闭销毁
23
+ destroyOnclose: {
24
+ type: Boolean,
25
+ default: !1
26
+ },
27
+ // 自定义类名
28
+ customClass: {
29
+ type: String,
30
+ default: ""
31
+ },
32
+ // 拖动
33
+ draggable: {
34
+ type: Boolean,
35
+ default: !0
36
+ },
37
+ // appendTo: {
38
+ // type: String,
39
+ // default: '#layout-wrap__left'
40
+ // },
41
+ modal: {
42
+ type: Boolean,
43
+ default: !0
44
+ }
45
+ },
46
+ emits: ["open", "opened", "close", "closed"],
47
+ setup(e, { expose: o, emit: l }) {
48
+ const t = l, u = e, a = s(!1), n = s(!1), m = () => {
49
+ a.value = !0, r(() => {
50
+ n.value = !0;
51
+ });
52
+ }, g = () => {
53
+ n.value = !1;
54
+ }, p = b(() => "dialog-container " + u.customClass), h = () => {
55
+ t("open");
56
+ }, v = () => {
57
+ t("opened");
58
+ }, D = () => {
59
+ t("close");
60
+ }, y = () => {
61
+ t("closed"), r(() => {
62
+ a.value = !1;
63
+ });
64
+ };
65
+ return B(() => {
66
+ a.value = !1;
67
+ }), o({
68
+ showDialog: m,
69
+ hideDialog: g
70
+ }), (d, f) => a.value ? (O(), k(S($), {
71
+ key: 0,
72
+ ref: "Dialog",
73
+ modelValue: n.value,
74
+ "onUpdate:modelValue": f[0] || (f[0] = (w) => n.value = w),
75
+ width: e.width,
76
+ title: e.title,
77
+ "append-to-body": "",
78
+ modal: e.modal,
79
+ "close-on-click-modal": !1,
80
+ "close-on-press-escape": !1,
81
+ "show-close": e.closable,
82
+ "destroy-on-close": e.destroyOnclose,
83
+ class: x(p.value),
84
+ draggable: e.draggable,
85
+ onOpen: h,
86
+ onOpened: v,
87
+ onClose: D,
88
+ onClosed: y
89
+ }, {
90
+ header: i(() => [
91
+ c(d.$slots, "title")
92
+ ]),
93
+ footer: i(() => [
94
+ c(d.$slots, "footer")
95
+ ]),
96
+ default: i(() => [
97
+ T("div", E, [
98
+ c(d.$slots, "default")
99
+ ])
100
+ ]),
101
+ _: 3
102
+ }, 8, ["modelValue", "width", "title", "modal", "show-close", "destroy-on-close", "class", "draggable"])) : V("", !0);
103
+ }
104
+ }, F = (e = s(!1)) => {
105
+ const o = s(null), l = s(null);
106
+ return {
107
+ dialogRef: o,
108
+ //弹窗的ref必须为dialogRef
109
+ formRef: l,
110
+ //弹窗里面含有form表单的话,ref必须为formRef
111
+ showDialog: () => {
112
+ o.value.showDialog();
113
+ },
114
+ hideDialog: () => {
115
+ e.value = !1, o.value.hideDialog();
116
+ },
117
+ resetDialog: () => {
118
+ e.value = !1, l.value && r(() => {
119
+ l.value.resetFields();
120
+ });
121
+ }
122
+ };
123
+ }, I = C(N);
124
+ export {
125
+ I as DialogContainer,
126
+ I as default,
127
+ F as useDialog
128
+ };
@@ -0,0 +1,255 @@
1
+ import { w as N } from "./chunks/index.bCzIhWFw.js";
2
+ import { ref as U, computed as P, resolveComponent as _, resolveDirective as B, createElementBlock as x, openBlock as c, normalizeStyle as K, normalizeClass as S, withDirectives as D, createBlock as m, unref as n, withCtx as d, createCommentVNode as p, createElementVNode as f, renderSlot as R, resolveDynamicComponent as j, createVNode as T, createTextVNode as C, toDisplayString as u } from "vue";
3
+ import { ElMessage as I, ElUpload as z, ElIcon as O, ElButton as $ } from "element-plus";
4
+ import { u as w } from "./chunks/i18n.Bd7hh14j.js";
5
+ import { g as X } from "./chunks/request.24c3shPx.js";
6
+ import './assets/FileUploader.css';const V = (t) => {
7
+ const e = /\.([^.]+)$/, o = t.match(e);
8
+ return o ? o[1] : null;
9
+ }, G = (t, e, o) => {
10
+ const { t: a } = w();
11
+ let l = !0;
12
+ const r = t.name && t.name.toLowerCase();
13
+ if (console.log(t.name, r, "fileName"), e && e.indexOf(V(r)) === -1) {
14
+ const s = a("COMPONENTS.UPLOAD_TYPE_TIP", { type: e });
15
+ I({
16
+ type: "warning",
17
+ message: s
18
+ }), l = !1;
19
+ }
20
+ if (t.size > 1024 * 1024 * o) {
21
+ const s = a("COMPONENTS.UPLOAD_SIZE_TIP", { size: o });
22
+ I.warning(s), l = !1;
23
+ }
24
+ return l;
25
+ }, ce = (t) => {
26
+ const { t: e } = w();
27
+ let o = t.toLowerCase(), a = "", l = "";
28
+ const r = e("WORKFLOW_COM.TIP_TEXT_3");
29
+ return o.includes("file") ? (l = "jpg、jpeg、png、webp、doc、docx、ppt、pptx、pdf、txt、xls、xlsx、csv、mp4、mkv、webm、ts、avi、mov、flv、3gp、ogv、mp3、wav、aac、flac、ogg", a = e("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("image") ? (l = "jpg、jpeg、png、webp", a = e("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("doc") ? (l = "doc、docx", a = e("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("ppt") ? (l = "ppt、pptx", a = e("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("pdf") ? (l = "pdf", a = e("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("txt") ? (l = "txt", a = e("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("excel") ? (l = "xls、xlsx、csv", a = e("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("audio") ? (l = "mp3、wav、aac、flac、ogg", a = e("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("video") && (l = "mp4、mkv、webm、ts、avi、mov、flv、3gp、ogv", a = e("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })), a + r;
30
+ }, ie = (t) => {
31
+ let e = t.toLowerCase();
32
+ if (e.includes("file"))
33
+ return ".jpg,.jpeg,.png,.webp,.doc,.docx,.ppt,.pptx,.pdf,.txt,.xls,.xlsx,.csv,.mp4,.mkv,.webm,.ts,.avi,.mov,.flv,.3gp,.ogv,.mp3,.wav,.aac,.flac,.ogg";
34
+ if (e.includes("image"))
35
+ return ".jpg,.jpeg,.png,.webp";
36
+ if (e.includes("doc"))
37
+ return ".doc,.docx";
38
+ if (e.includes("ppt"))
39
+ return ".ppt,.pptx";
40
+ if (e.includes("pdf"))
41
+ return ".pdf";
42
+ if (e.includes("txt"))
43
+ return ".txt";
44
+ if (e.includes("excel"))
45
+ return ".xls,.xlsx,.csv";
46
+ if (e.includes("audio"))
47
+ return ".mp3,.wav,.aac,.flac,.ogg";
48
+ if (e.includes("video"))
49
+ return ".mp4,.mkv,.webm,.ts,.avi,.mov,.flv,.3gp,.ogv";
50
+ }, de = (t) => {
51
+ const e = t.match(/array(\w+)/);
52
+ return e && e[1] ? e[1].toLowerCase() : null;
53
+ }, q = () => {
54
+ const { $request: t, $env: e } = X();
55
+ return {
56
+ commonUpload: (o, a = "common") => t({
57
+ method: "post",
58
+ url: `${e.VITE_APP_AIBOX_BASE_URL}/api/v1/common/file/upload?type=${a}`,
59
+ data: o,
60
+ dataType: "formData",
61
+ skipCamelToKebab: !0
62
+ })
63
+ };
64
+ }, g = {
65
+ 卡片: "Card",
66
+ 按钮: "Button",
67
+ 面板: "Panel",
68
+ 自定义: "Custom"
69
+ }, Y = { class: "card-uploader__mask" }, Z = { key: 3 }, H = { class: "panel-uploader__text" }, J = { class: "panel-uploader__text--tip" }, Q = {
70
+ key: 0,
71
+ class: "panel-uploader__text--tip font-style"
72
+ }, ee = { class: "panel-uploader__text--tip font-style" }, te = {
73
+ __name: "index",
74
+ props: {
75
+ uploadType: {
76
+ type: String,
77
+ default: "Card"
78
+ },
79
+ acceptType: {
80
+ type: String,
81
+ default: ""
82
+ },
83
+ multiple: {
84
+ type: Boolean,
85
+ default: !1
86
+ },
87
+ limitCount: {
88
+ type: Number,
89
+ default: 1e3
90
+ },
91
+ limitSize: {
92
+ type: Number,
93
+ default: 8
94
+ },
95
+ warnTips: {
96
+ type: String,
97
+ default: ""
98
+ },
99
+ warnTips2: {
100
+ type: String,
101
+ default: ""
102
+ },
103
+ isMiio: {
104
+ type: Boolean,
105
+ default: !0
106
+ },
107
+ businessType: {
108
+ type: String,
109
+ default: "common"
110
+ },
111
+ defaultUploadIcon: {
112
+ type: String,
113
+ default: ""
114
+ }
115
+ },
116
+ emits: ["on-success"],
117
+ setup(t, { emit: e }) {
118
+ const { t: o } = w(), a = U(!1), l = U(null), { commonUpload: r } = q(), s = t, M = e, E = {
119
+ plugin: "Plugin",
120
+ agent: "WorkflowIcon1",
121
+ dialogue: "WorkflowIcon3",
122
+ model: "Model",
123
+ workflow: "Workflow",
124
+ space: "Space",
125
+ "my-space": "MySpace",
126
+ mcp: "McpIcon"
127
+ }, F = P(() => ({
128
+ Card: "card-uploader",
129
+ Button: "button-uploader",
130
+ Panel: "panel-uploader"
131
+ })[s.uploadType]), v = P(() => s.defaultUploadIcon ? E[s.defaultUploadIcon] : ""), W = async (i) => {
132
+ if (G(i, s.acceptType, s.limitSize))
133
+ if (s.isMiio) {
134
+ a.value = !0;
135
+ const { data: y } = await r(
136
+ {
137
+ file: i.raw
138
+ },
139
+ s.businessType
140
+ ).finally(() => {
141
+ a.value = !1;
142
+ });
143
+ console.log(y, "data"), M("on-success", y);
144
+ } else
145
+ M("on-success", i);
146
+ else
147
+ l.value.handleRemove(i);
148
+ };
149
+ return (i, A) => {
150
+ const y = _("IconEdit2"), b = _("IconAdd"), h = _("IconUpload2"), k = _("File"), L = B("loading");
151
+ return c(), x("div", {
152
+ class: S(["file-uploader", t.defaultUploadIcon]),
153
+ style: K({
154
+ border: !t.defaultUploadIcon && t.uploadType === "Card" ? "1px dashed var(--el-border-color)" : "none",
155
+ "border-radius": !t.defaultUploadIcon && t.uploadType === "Card" ? "8px" : "0",
156
+ "background-image": v.value ? `url('${v.value}')` : "none"
157
+ })
158
+ }, [
159
+ D((c(), m(n(z), {
160
+ ref_key: "uploader",
161
+ ref: l,
162
+ class: S(F.value),
163
+ action: "",
164
+ "auto-upload": !1,
165
+ limit: t.limitCount,
166
+ "show-file-list": !1,
167
+ accept: t.acceptType,
168
+ multiple: t.multiple,
169
+ drag: t.uploadType === n(g).面板,
170
+ "on-change": W
171
+ }, {
172
+ default: d(() => [
173
+ v.value ? (c(), m(n(O), {
174
+ key: 0,
175
+ size: "64",
176
+ class: "absolute"
177
+ }, {
178
+ default: d(() => [
179
+ (c(), m(j(v.value)))
180
+ ]),
181
+ _: 1
182
+ })) : p("", !0),
183
+ f("div", Y, [
184
+ T(n(O), {
185
+ color: "#fff",
186
+ size: "16px"
187
+ }, {
188
+ default: d(() => [
189
+ T(y)
190
+ ]),
191
+ _: 1
192
+ })
193
+ ]),
194
+ t.uploadType === n(g).卡片 ? (c(), m(n(O), {
195
+ key: 1,
196
+ class: "card-uploader__icon"
197
+ }, {
198
+ default: d(() => [
199
+ t.defaultUploadIcon ? p("", !0) : (c(), m(b, { key: 0 })),
200
+ R(i.$slots, "text-slot")
201
+ ]),
202
+ _: 3
203
+ })) : p("", !0),
204
+ t.uploadType === n(g).按钮 ? (c(), m(n($), {
205
+ key: 2,
206
+ type: "primary"
207
+ }, {
208
+ default: d(() => [
209
+ T(n(O), { style: { "margin-right": "5px" } }, {
210
+ default: d(() => [
211
+ T(h)
212
+ ]),
213
+ _: 1
214
+ }),
215
+ C(" " + u(n(o)("COMMON_BUTTON.UPLOAD_TEXT")), 1)
216
+ ]),
217
+ _: 1
218
+ })) : p("", !0),
219
+ t.uploadType === n(g).面板 ? (c(), x("div", Z, [
220
+ T(n(O), { size: "48px" }, {
221
+ default: d(() => [
222
+ T(k)
223
+ ]),
224
+ _: 1
225
+ }),
226
+ f("div", H, [
227
+ f("div", J, [
228
+ f("span", null, u(n(o)("COMMON_BUTTON.CLICK_TEXT")), 1),
229
+ C(" " + u(n(o)("COMMON_BUTTON.OR_TEXT")) + " ", 1),
230
+ f("span", null, u(n(o)("COMMON_BUTTON.DRAG_TEXT")), 1),
231
+ C(" " + u(n(o)("COMMON_BUTTON.FILE_UPLOAD_TEXT")), 1)
232
+ ]),
233
+ t.warnTips2 ? (c(), x("div", Q, u(t.warnTips2), 1)) : p("", !0),
234
+ f("div", ee, u(t.warnTips), 1)
235
+ ])
236
+ ])) : p("", !0),
237
+ t.uploadType === n(g).自定义 ? R(i.$slots, "upload-box", { key: 4 }) : p("", !0)
238
+ ]),
239
+ _: 3
240
+ }, 8, ["class", "limit", "accept", "multiple", "drag"])), [
241
+ [L, a.value]
242
+ ])
243
+ ], 6);
244
+ };
245
+ }
246
+ }, pe = N(te);
247
+ export {
248
+ pe as FileUploader,
249
+ g as UploadTypesEnum,
250
+ pe as default,
251
+ de as extractAndLowerCaseArrayType,
252
+ ie as getAcceptType,
253
+ ce as getWarnTips,
254
+ G as validateUpload
255
+ };