@webx-ui/module-media 0.2.0 → 0.4.0
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.
- package/dist/MediaField.d.ts +23 -6
- package/dist/MediaToolbar.d.ts +2 -0
- package/dist/api.d.ts +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +579 -463
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +12 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { WxTree as
|
|
3
|
-
import { useTranslate as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as S, useModel as A, ref as M, watch as q, openBlock as b, createBlock as $, unref as e, mergeModels as F, computed as D, resolveDirective as Pe, withCtx as w, createElementBlock as W, Fragment as Q, renderList as Z, withDirectives as Oe, createCommentVNode as U, createVNode as h, createTextVNode as P, toDisplayString as L, isRef as te, useTemplateRef as ee, onMounted as he, nextTick as qe, createElementVNode as _, withKeys as Ne, normalizeClass as Ae, normalizeStyle as me } from "vue";
|
|
2
|
+
import { WxTree as He, WxSelectionArea as Ie, WxFileCard as Xe, WxEmpty as Ke, toast as N, WxAction as T, WxInput as j, WxDropdown as pe, WxDropdownItem as fe, WxActions as G, useModal as ae, WxDialog as le, WxSelect as je, WxSpace as be, WxButton as I, useElementWidth as Ge, createModal as Y, WxPagination as Ye, WxDrawer as Je, confirm as ve, openImageEditor as Qe, WxCard as Ze, WxImage as et, WxPopover as tt, WxPopconfirm as at } from "@webx-ui/core";
|
|
3
|
+
import { useTranslate as B, useAdmin as ie } from "@webx-ui/admin";
|
|
4
|
+
const ge = /* @__PURE__ */ S({
|
|
5
5
|
__name: "DirectoryTree",
|
|
6
|
-
props: /* @__PURE__ */
|
|
6
|
+
props: /* @__PURE__ */ F({
|
|
7
7
|
directories: {}
|
|
8
8
|
}, {
|
|
9
9
|
selected: { default: null },
|
|
10
10
|
selectedModifiers: {}
|
|
11
11
|
}),
|
|
12
|
-
emits: /* @__PURE__ */
|
|
13
|
-
setup(a, { emit:
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
() =>
|
|
17
|
-
(
|
|
18
|
-
t.value =
|
|
12
|
+
emits: /* @__PURE__ */ F(["move"], ["update:selected"]),
|
|
13
|
+
setup(a, { emit: d }) {
|
|
14
|
+
const m = a, l = A(a, "selected"), v = d, i = B("webx-media"), t = M([]), p = M([]);
|
|
15
|
+
q(
|
|
16
|
+
() => m.directories,
|
|
17
|
+
(n) => {
|
|
18
|
+
t.value = n.map(k), p.value = g(n);
|
|
19
19
|
},
|
|
20
20
|
{ immediate: !0, deep: !0 }
|
|
21
21
|
);
|
|
22
|
-
function
|
|
22
|
+
function k(n) {
|
|
23
23
|
return {
|
|
24
|
-
...
|
|
25
|
-
label:
|
|
26
|
-
children: (
|
|
24
|
+
...n,
|
|
25
|
+
label: n.is_root ? i("manager.root") : n.title,
|
|
26
|
+
children: (n.children ?? []).map(k)
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
29
|
+
function g(n) {
|
|
30
|
+
return n.flatMap((f) => [f.id, ...g(f.children ?? [])]);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
const f =
|
|
34
|
-
f &&
|
|
32
|
+
function u(n) {
|
|
33
|
+
const f = n.zone === "inside" ? n.target : n.parent;
|
|
34
|
+
f && v("move", n.node.id, f.id);
|
|
35
35
|
}
|
|
36
|
-
return (
|
|
36
|
+
return (n, f) => (b(), $(e(He), {
|
|
37
37
|
selected: l.value,
|
|
38
38
|
"onUpdate:selected": f[0] || (f[0] = (c) => l.value = c),
|
|
39
|
-
expanded:
|
|
40
|
-
"onUpdate:expanded": f[1] || (f[1] = (c) =>
|
|
39
|
+
expanded: p.value,
|
|
40
|
+
"onUpdate:expanded": f[1] || (f[1] = (c) => p.value = c),
|
|
41
41
|
modelValue: t.value,
|
|
42
42
|
"onUpdate:modelValue": f[2] || (f[2] = (c) => t.value = c),
|
|
43
43
|
class: "wx-media-tree",
|
|
44
44
|
"node-key": "id",
|
|
45
45
|
draggable: "",
|
|
46
46
|
"show-lines": "",
|
|
47
|
-
onDrop:
|
|
47
|
+
onDrop: u
|
|
48
48
|
}, null, 8, ["selected", "expanded", "modelValue"]));
|
|
49
49
|
}
|
|
50
|
-
}),
|
|
50
|
+
}), lt = /* @__PURE__ */ S({
|
|
51
51
|
__name: "FileGrid",
|
|
52
|
-
props: /* @__PURE__ */
|
|
52
|
+
props: /* @__PURE__ */ F({
|
|
53
53
|
files: {},
|
|
54
54
|
api: {},
|
|
55
55
|
query: {},
|
|
@@ -58,40 +58,40 @@ const fe = /* @__PURE__ */ R({
|
|
|
58
58
|
selected: { default: () => [] },
|
|
59
59
|
selectedModifiers: {}
|
|
60
60
|
}),
|
|
61
|
-
emits: /* @__PURE__ */
|
|
62
|
-
setup(a, { emit:
|
|
63
|
-
const
|
|
64
|
-
() =>
|
|
61
|
+
emits: /* @__PURE__ */ F(["open", "rename", "edit", "remove"], ["update:selected"]),
|
|
62
|
+
setup(a, { emit: d }) {
|
|
63
|
+
const m = a, l = A(a, "selected"), v = d, i = B("webx-media"), t = D(
|
|
64
|
+
() => m.query ? i("manager.empty-search", { query: m.query }) : i("manager.empty")
|
|
65
65
|
);
|
|
66
|
-
function
|
|
67
|
-
|
|
66
|
+
function p() {
|
|
67
|
+
N.success(i("manager.link-copied"));
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
let
|
|
69
|
+
function k(g) {
|
|
70
|
+
const u = document.createElement("textarea");
|
|
71
|
+
u.value = g.url, u.setAttribute("readonly", ""), u.style.position = "fixed", u.style.opacity = "0", document.body.appendChild(u), u.select();
|
|
72
|
+
let n = !1;
|
|
73
73
|
try {
|
|
74
|
-
|
|
74
|
+
n = document.execCommand("copy");
|
|
75
75
|
} catch {
|
|
76
|
-
|
|
76
|
+
n = !1;
|
|
77
77
|
}
|
|
78
|
-
if (
|
|
79
|
-
|
|
78
|
+
if (u.remove(), n) {
|
|
79
|
+
p();
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
N.danger(`${i("errors.copy")} ${g.url}`, { duration: 0 });
|
|
83
83
|
}
|
|
84
|
-
return (
|
|
85
|
-
const
|
|
86
|
-
return a.files.length > 0 ? (b(),
|
|
84
|
+
return (g, u) => {
|
|
85
|
+
const n = Pe("wx-select");
|
|
86
|
+
return a.files.length > 0 ? (b(), $(e(Ie), {
|
|
87
87
|
key: 0,
|
|
88
88
|
modelValue: l.value,
|
|
89
|
-
"onUpdate:modelValue":
|
|
89
|
+
"onUpdate:modelValue": u[0] || (u[0] = (f) => l.value = f),
|
|
90
90
|
class: "wx-media-grid",
|
|
91
91
|
multiple: !a.single
|
|
92
92
|
}, {
|
|
93
93
|
default: w(({ isSelected: f }) => [
|
|
94
|
-
(b(!0),
|
|
94
|
+
(b(!0), W(Q, null, Z(a.files, (c) => Oe((b(), $(e(Xe), {
|
|
95
95
|
key: c.id,
|
|
96
96
|
class: "wx-media-grid__card",
|
|
97
97
|
name: c.name,
|
|
@@ -103,37 +103,38 @@ const fe = /* @__PURE__ */ R({
|
|
|
103
103
|
editable: c.editable,
|
|
104
104
|
removable: "",
|
|
105
105
|
copyable: "",
|
|
106
|
-
"rename-label": e(
|
|
107
|
-
"edit-label": e(
|
|
108
|
-
"remove-label": e(
|
|
109
|
-
"remove-confirm-text": e(
|
|
110
|
-
"cancel-label": e(
|
|
111
|
-
"save-label": e(
|
|
112
|
-
"copy-label": e(
|
|
113
|
-
"copied-label": e(
|
|
114
|
-
onRename: (
|
|
115
|
-
onEdit: (
|
|
116
|
-
onRemove: (
|
|
117
|
-
onCopy:
|
|
118
|
-
onCopyError: (
|
|
119
|
-
onDblclick: (
|
|
106
|
+
"rename-label": e(i)("manager.rename"),
|
|
107
|
+
"edit-label": e(i)("manager.edit"),
|
|
108
|
+
"remove-label": e(i)("manager.delete"),
|
|
109
|
+
"remove-confirm-text": e(i)("dialogs.delete-file", { name: c.name }),
|
|
110
|
+
"cancel-label": e(i)("manager.cancel"),
|
|
111
|
+
"save-label": e(i)("manager.save"),
|
|
112
|
+
"copy-label": e(i)("manager.copy-link"),
|
|
113
|
+
"copied-label": e(i)("manager.link-copied"),
|
|
114
|
+
onRename: (s) => v("rename", c, s),
|
|
115
|
+
onEdit: (s) => v("edit", c),
|
|
116
|
+
onRemove: (s) => v("remove", c),
|
|
117
|
+
onCopy: p,
|
|
118
|
+
onCopyError: (s) => k(c),
|
|
119
|
+
onDblclick: (s) => v("open", c)
|
|
120
120
|
}, null, 8, ["name", "url", "thumbnail", "type", "selected", "editable", "rename-label", "edit-label", "remove-label", "remove-confirm-text", "cancel-label", "save-label", "copy-label", "copied-label", "onRename", "onEdit", "onRemove", "onCopyError", "onDblclick"])), [
|
|
121
|
-
[
|
|
121
|
+
[n, c.id]
|
|
122
122
|
])), 128))
|
|
123
123
|
]),
|
|
124
124
|
_: 1
|
|
125
|
-
}, 8, ["modelValue", "multiple"])) : (b(),
|
|
125
|
+
}, 8, ["modelValue", "multiple"])) : (b(), $(e(Ke), {
|
|
126
126
|
key: 1,
|
|
127
127
|
description: t.value
|
|
128
128
|
}, null, 8, ["description"]));
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
}),
|
|
131
|
+
}), it = { class: "wx-media-toolbar" }, ot = /* @__PURE__ */ S({
|
|
132
132
|
__name: "MediaToolbar",
|
|
133
|
-
props: /* @__PURE__ */
|
|
133
|
+
props: /* @__PURE__ */ F({
|
|
134
134
|
canUpload: { type: Boolean },
|
|
135
135
|
canManage: { type: Boolean },
|
|
136
136
|
selected: {},
|
|
137
|
+
fixedType: { type: Boolean },
|
|
137
138
|
compact: { type: Boolean }
|
|
138
139
|
}, {
|
|
139
140
|
search: { default: "" },
|
|
@@ -143,110 +144,110 @@ const fe = /* @__PURE__ */ R({
|
|
|
143
144
|
sort: { default: "-created_at" },
|
|
144
145
|
sortModifiers: {}
|
|
145
146
|
}),
|
|
146
|
-
emits: /* @__PURE__ */
|
|
147
|
-
setup(a, { emit:
|
|
148
|
-
const
|
|
149
|
-
{ value: "all", label:
|
|
147
|
+
emits: /* @__PURE__ */ F(["upload", "move", "remove", "folders"], ["update:search", "update:type", "update:sort"]),
|
|
148
|
+
setup(a, { emit: d }) {
|
|
149
|
+
const m = a, l = A(a, "search"), v = A(a, "type"), i = A(a, "sort"), t = d, p = B("webx-media"), k = D(() => [
|
|
150
|
+
{ value: "all", label: p("manager.all-types") },
|
|
150
151
|
...["image", "video", "audio", "document", "other"].map((f) => ({
|
|
151
152
|
value: f,
|
|
152
|
-
label:
|
|
153
|
+
label: p(`manager.${f}`)
|
|
153
154
|
}))
|
|
154
|
-
]),
|
|
155
|
-
{ value: "-created_at", label:
|
|
156
|
-
{ value: "created_at", label:
|
|
157
|
-
{ value: "name", label:
|
|
158
|
-
{ value: "-size", label:
|
|
159
|
-
]),
|
|
160
|
-
return (f, c) => (b(),
|
|
161
|
-
a.compact ? (b(),
|
|
155
|
+
]), g = D(() => [
|
|
156
|
+
{ value: "-created_at", label: p("manager.sort-newest") },
|
|
157
|
+
{ value: "created_at", label: p("manager.sort-oldest") },
|
|
158
|
+
{ value: "name", label: p("manager.sort-name") },
|
|
159
|
+
{ value: "-size", label: p("manager.sort-size") }
|
|
160
|
+
]), u = D(() => k.value.find((f) => f.value === v.value)?.label ?? ""), n = D(() => g.value.find((f) => f.value === i.value)?.label ?? "");
|
|
161
|
+
return (f, c) => (b(), W("header", it, [
|
|
162
|
+
a.compact ? (b(), $(e(T), {
|
|
162
163
|
key: 0,
|
|
163
164
|
icon: "folder",
|
|
164
|
-
title: e(
|
|
165
|
+
title: e(p)("manager.folders"),
|
|
165
166
|
size: "sm",
|
|
166
|
-
onClick: c[0] || (c[0] = (
|
|
167
|
-
}, null, 8, ["title"])) :
|
|
168
|
-
|
|
167
|
+
onClick: c[0] || (c[0] = (s) => t("folders"))
|
|
168
|
+
}, null, 8, ["title"])) : U("", !0),
|
|
169
|
+
h(e(j), {
|
|
169
170
|
modelValue: l.value,
|
|
170
|
-
"onUpdate:modelValue": c[1] || (c[1] = (
|
|
171
|
+
"onUpdate:modelValue": c[1] || (c[1] = (s) => l.value = s),
|
|
171
172
|
class: "wx-media-toolbar__search",
|
|
172
|
-
placeholder: e(
|
|
173
|
+
placeholder: e(p)("manager.search"),
|
|
173
174
|
clearable: "",
|
|
174
175
|
size: "sm"
|
|
175
176
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
176
|
-
|
|
177
|
+
a.fixedType ? U("", !0) : (b(), $(e(pe), { key: 1 }, {
|
|
177
178
|
trigger: w(() => [
|
|
178
|
-
|
|
179
|
+
h(e(T), {
|
|
179
180
|
icon: "filter",
|
|
180
|
-
title: `${e(
|
|
181
|
+
title: `${e(p)("manager.all-types")}: ${u.value}`,
|
|
181
182
|
size: "sm"
|
|
182
183
|
}, null, 8, ["title"])
|
|
183
184
|
]),
|
|
184
185
|
default: w(() => [
|
|
185
|
-
(b(!0),
|
|
186
|
-
key: String(
|
|
187
|
-
active:
|
|
188
|
-
onClick: (
|
|
186
|
+
(b(!0), W(Q, null, Z(k.value, (s) => (b(), $(e(fe), {
|
|
187
|
+
key: String(s.value),
|
|
188
|
+
active: s.value === v.value,
|
|
189
|
+
onClick: (x) => v.value = s.value
|
|
189
190
|
}, {
|
|
190
191
|
default: w(() => [
|
|
191
|
-
|
|
192
|
+
P(L(s.label), 1)
|
|
192
193
|
]),
|
|
193
194
|
_: 2
|
|
194
195
|
}, 1032, ["active", "onClick"]))), 128))
|
|
195
196
|
]),
|
|
196
197
|
_: 1
|
|
197
|
-
}),
|
|
198
|
-
|
|
198
|
+
})),
|
|
199
|
+
h(e(pe), null, {
|
|
199
200
|
trigger: w(() => [
|
|
200
|
-
|
|
201
|
+
h(e(T), {
|
|
201
202
|
icon: "arrow-down",
|
|
202
|
-
title:
|
|
203
|
+
title: n.value,
|
|
203
204
|
size: "sm"
|
|
204
205
|
}, null, 8, ["title"])
|
|
205
206
|
]),
|
|
206
207
|
default: w(() => [
|
|
207
|
-
(b(!0),
|
|
208
|
-
key:
|
|
209
|
-
active:
|
|
210
|
-
onClick: (
|
|
208
|
+
(b(!0), W(Q, null, Z(g.value, (s) => (b(), $(e(fe), {
|
|
209
|
+
key: s.value,
|
|
210
|
+
active: s.value === i.value,
|
|
211
|
+
onClick: (x) => i.value = s.value
|
|
211
212
|
}, {
|
|
212
213
|
default: w(() => [
|
|
213
|
-
|
|
214
|
+
P(L(s.label), 1)
|
|
214
215
|
]),
|
|
215
216
|
_: 2
|
|
216
217
|
}, 1032, ["active", "onClick"]))), 128))
|
|
217
218
|
]),
|
|
218
219
|
_: 1
|
|
219
220
|
}),
|
|
220
|
-
a.canUpload ? (b(),
|
|
221
|
-
key:
|
|
221
|
+
a.canUpload ? (b(), $(e(T), {
|
|
222
|
+
key: 2,
|
|
222
223
|
type: "upload",
|
|
223
|
-
title: e(
|
|
224
|
+
title: e(p)("manager.upload"),
|
|
224
225
|
size: "sm",
|
|
225
|
-
onClick: c[2] || (c[2] = (
|
|
226
|
-
}, null, 8, ["title"])) :
|
|
227
|
-
a.canManage ? (b(),
|
|
228
|
-
key:
|
|
226
|
+
onClick: c[2] || (c[2] = (s) => t("upload"))
|
|
227
|
+
}, null, 8, ["title"])) : U("", !0),
|
|
228
|
+
a.canManage ? (b(), $(e(G), {
|
|
229
|
+
key: 3,
|
|
229
230
|
size: "sm"
|
|
230
231
|
}, {
|
|
231
232
|
default: w(() => [
|
|
232
|
-
|
|
233
|
+
h(e(T), {
|
|
233
234
|
icon: "folder",
|
|
234
|
-
title: e(
|
|
235
|
-
disabled:
|
|
236
|
-
onClick: c[3] || (c[3] = (
|
|
235
|
+
title: e(p)("manager.move"),
|
|
236
|
+
disabled: m.selected === 0,
|
|
237
|
+
onClick: c[3] || (c[3] = (s) => t("move"))
|
|
237
238
|
}, null, 8, ["title", "disabled"]),
|
|
238
|
-
|
|
239
|
+
h(e(T), {
|
|
239
240
|
type: "remove",
|
|
240
|
-
title: e(
|
|
241
|
-
disabled:
|
|
242
|
-
onClick: c[4] || (c[4] = (
|
|
241
|
+
title: e(p)("manager.delete"),
|
|
242
|
+
disabled: m.selected === 0,
|
|
243
|
+
onClick: c[4] || (c[4] = (s) => t("remove"))
|
|
243
244
|
}, null, 8, ["title", "disabled"])
|
|
244
245
|
]),
|
|
245
246
|
_: 1
|
|
246
|
-
})) :
|
|
247
|
+
})) : U("", !0)
|
|
247
248
|
]));
|
|
248
249
|
}
|
|
249
|
-
}),
|
|
250
|
+
}), nt = /* @__PURE__ */ S({
|
|
250
251
|
__name: "MoveDialog",
|
|
251
252
|
props: {
|
|
252
253
|
directories: {},
|
|
@@ -254,44 +255,44 @@ const fe = /* @__PURE__ */ R({
|
|
|
254
255
|
count: {}
|
|
255
256
|
},
|
|
256
257
|
setup(a) {
|
|
257
|
-
const
|
|
258
|
-
() =>
|
|
259
|
-
),
|
|
260
|
-
function
|
|
261
|
-
return
|
|
258
|
+
const d = a, { open: m, resolve: l, dismiss: v } = ae(), i = B("webx-media"), t = D(
|
|
259
|
+
() => k(d.directories).filter((g) => g.value !== d.from)
|
|
260
|
+
), p = M(t.value[0]?.value ?? null);
|
|
261
|
+
function k(g) {
|
|
262
|
+
return g.flatMap((u) => [
|
|
262
263
|
{
|
|
263
|
-
value:
|
|
264
|
+
value: u.id,
|
|
264
265
|
// Indented, so the tree is still readable once it is a flat list.
|
|
265
|
-
label: " ".repeat(
|
|
266
|
+
label: " ".repeat(u.depth * 3) + (u.is_root ? i("manager.root") : u.title)
|
|
266
267
|
},
|
|
267
|
-
...
|
|
268
|
+
...k(u.children ?? [])
|
|
268
269
|
]);
|
|
269
270
|
}
|
|
270
|
-
return (
|
|
271
|
-
open: e(
|
|
272
|
-
"onUpdate:open":
|
|
273
|
-
title: e(
|
|
271
|
+
return (g, u) => (b(), $(e(le), {
|
|
272
|
+
open: e(m),
|
|
273
|
+
"onUpdate:open": u[3] || (u[3] = (n) => te(m) ? m.value = n : null),
|
|
274
|
+
title: e(i)("manager.move-to"),
|
|
274
275
|
width: 420
|
|
275
276
|
}, {
|
|
276
277
|
footer: w(() => [
|
|
277
|
-
|
|
278
|
+
h(e(be), { size: "sm" }, {
|
|
278
279
|
default: w(() => [
|
|
279
|
-
|
|
280
|
+
h(e(I), {
|
|
280
281
|
variant: "outline",
|
|
281
|
-
onClick:
|
|
282
|
+
onClick: u[1] || (u[1] = (n) => e(v)())
|
|
282
283
|
}, {
|
|
283
284
|
default: w(() => [
|
|
284
|
-
|
|
285
|
+
P(L(e(i)("manager.cancel")), 1)
|
|
285
286
|
]),
|
|
286
287
|
_: 1
|
|
287
288
|
}),
|
|
288
|
-
|
|
289
|
+
h(e(I), {
|
|
289
290
|
type: "primary",
|
|
290
|
-
disabled:
|
|
291
|
-
onClick:
|
|
291
|
+
disabled: p.value === null,
|
|
292
|
+
onClick: u[2] || (u[2] = (n) => e(l)(p.value))
|
|
292
293
|
}, {
|
|
293
294
|
default: w(() => [
|
|
294
|
-
|
|
295
|
+
P(L(e(i)("manager.move")), 1)
|
|
295
296
|
]),
|
|
296
297
|
_: 1
|
|
297
298
|
}, 8, ["disabled"])
|
|
@@ -300,16 +301,16 @@ const fe = /* @__PURE__ */ R({
|
|
|
300
301
|
})
|
|
301
302
|
]),
|
|
302
303
|
default: w(() => [
|
|
303
|
-
|
|
304
|
-
modelValue:
|
|
305
|
-
"onUpdate:modelValue":
|
|
304
|
+
h(e(je), {
|
|
305
|
+
modelValue: p.value,
|
|
306
|
+
"onUpdate:modelValue": u[0] || (u[0] = (n) => p.value = n),
|
|
306
307
|
options: t.value
|
|
307
308
|
}, null, 8, ["modelValue", "options"])
|
|
308
309
|
]),
|
|
309
310
|
_: 1
|
|
310
311
|
}, 8, ["open", "title"]));
|
|
311
312
|
}
|
|
312
|
-
}),
|
|
313
|
+
}), rt = /* @__PURE__ */ S({
|
|
313
314
|
__name: "NameDialog",
|
|
314
315
|
props: {
|
|
315
316
|
title: {},
|
|
@@ -318,39 +319,39 @@ const fe = /* @__PURE__ */ R({
|
|
|
318
319
|
confirmText: { default: void 0 }
|
|
319
320
|
},
|
|
320
321
|
setup(a) {
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
await
|
|
322
|
+
const d = a, { open: m, resolve: l, dismiss: v } = ae(), i = B("webx-media"), t = M(d.value), p = ee("input");
|
|
323
|
+
he(async () => {
|
|
324
|
+
await qe(), p.value?.querySelector("input")?.focus();
|
|
324
325
|
});
|
|
325
|
-
function
|
|
326
|
-
const
|
|
327
|
-
|
|
326
|
+
function k() {
|
|
327
|
+
const g = t.value.trim();
|
|
328
|
+
g !== "" && l(g);
|
|
328
329
|
}
|
|
329
|
-
return (
|
|
330
|
-
open: e(
|
|
331
|
-
"onUpdate:open":
|
|
330
|
+
return (g, u) => (b(), $(e(le), {
|
|
331
|
+
open: e(m),
|
|
332
|
+
"onUpdate:open": u[2] || (u[2] = (n) => te(m) ? m.value = n : null),
|
|
332
333
|
title: a.title,
|
|
333
334
|
width: 420
|
|
334
335
|
}, {
|
|
335
336
|
footer: w(() => [
|
|
336
|
-
|
|
337
|
+
h(e(be), { size: "sm" }, {
|
|
337
338
|
default: w(() => [
|
|
338
|
-
|
|
339
|
+
h(e(I), {
|
|
339
340
|
variant: "outline",
|
|
340
|
-
onClick:
|
|
341
|
+
onClick: u[1] || (u[1] = (n) => e(v)())
|
|
341
342
|
}, {
|
|
342
343
|
default: w(() => [
|
|
343
|
-
|
|
344
|
+
P(L(e(i)("manager.cancel")), 1)
|
|
344
345
|
]),
|
|
345
346
|
_: 1
|
|
346
347
|
}),
|
|
347
|
-
|
|
348
|
+
h(e(I), {
|
|
348
349
|
type: "primary",
|
|
349
350
|
disabled: t.value.trim() === "",
|
|
350
|
-
onClick:
|
|
351
|
+
onClick: k
|
|
351
352
|
}, {
|
|
352
353
|
default: w(() => [
|
|
353
|
-
|
|
354
|
+
P(L(a.confirmText ?? e(i)("manager.save")), 1)
|
|
354
355
|
]),
|
|
355
356
|
_: 1
|
|
356
357
|
}, 8, ["disabled"])
|
|
@@ -359,16 +360,16 @@ const fe = /* @__PURE__ */ R({
|
|
|
359
360
|
})
|
|
360
361
|
]),
|
|
361
362
|
default: w(() => [
|
|
362
|
-
|
|
363
|
+
_("div", {
|
|
363
364
|
ref_key: "input",
|
|
364
|
-
ref:
|
|
365
|
+
ref: p
|
|
365
366
|
}, [
|
|
366
|
-
|
|
367
|
+
h(e(j), {
|
|
367
368
|
modelValue: t.value,
|
|
368
|
-
"onUpdate:modelValue":
|
|
369
|
-
placeholder: a.label ?? e(
|
|
370
|
-
"aria-label": a.label ?? e(
|
|
371
|
-
onKeyup:
|
|
369
|
+
"onUpdate:modelValue": u[0] || (u[0] = (n) => t.value = n),
|
|
370
|
+
placeholder: a.label ?? e(i)("manager.folder-name"),
|
|
371
|
+
"aria-label": a.label ?? e(i)("manager.folder-name"),
|
|
372
|
+
onKeyup: Ne(k, ["enter"])
|
|
372
373
|
}, null, 8, ["modelValue", "placeholder", "aria-label"])
|
|
373
374
|
], 512)
|
|
374
375
|
]),
|
|
@@ -376,17 +377,17 @@ const fe = /* @__PURE__ */ R({
|
|
|
376
377
|
}, 8, ["open", "title"]));
|
|
377
378
|
}
|
|
378
379
|
});
|
|
379
|
-
function
|
|
380
|
-
const
|
|
380
|
+
function we(a) {
|
|
381
|
+
const d = `${a.apiPath}/media`, m = (l) => l.data;
|
|
381
382
|
return {
|
|
382
|
-
directories: () => a.http.get(`${
|
|
383
|
-
createDirectory: (l,
|
|
384
|
-
renameDirectory: (l,
|
|
385
|
-
moveDirectory: (l,
|
|
386
|
-
deleteDirectory: (l,
|
|
387
|
-
query: { force:
|
|
383
|
+
directories: () => a.http.get(`${d}/directories`).then(m),
|
|
384
|
+
createDirectory: (l, v) => a.http.post(`${d}/directories`, { parent_id: l, title: v }).then(m),
|
|
385
|
+
renameDirectory: (l, v) => a.http.patch(`${d}/directories/${l}`, { title: v }).then(m),
|
|
386
|
+
moveDirectory: (l, v) => a.http.patch(`${d}/directories/${l}/move`, { parent_id: v }).then(m),
|
|
387
|
+
deleteDirectory: (l, v = !1) => a.http.delete(`${d}/directories/${l}`, {
|
|
388
|
+
query: { force: v ? 1 : void 0 }
|
|
388
389
|
}),
|
|
389
|
-
files: (l = {}) => a.http.get(`${
|
|
390
|
+
files: (l = {}) => a.http.get(`${d}/files`, {
|
|
390
391
|
query: {
|
|
391
392
|
directory_id: l.directory_id ?? void 0,
|
|
392
393
|
q: l.q || void 0,
|
|
@@ -396,52 +397,53 @@ function ot(a) {
|
|
|
396
397
|
per_page: l.per_page
|
|
397
398
|
}
|
|
398
399
|
}),
|
|
399
|
-
file: (l) => a.http.get(`${
|
|
400
|
-
|
|
400
|
+
file: (l) => a.http.get(`${d}/files/${l}`).then(m),
|
|
401
|
+
fileByPath: (l) => a.http.get(`${d}/files/by-path?path=${encodeURIComponent(l)}`).then(m).catch(() => null),
|
|
402
|
+
async upload(l, v, i) {
|
|
401
403
|
const t = new FormData();
|
|
402
|
-
return t.append("directory_id", String(l)),
|
|
403
|
-
const
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}),
|
|
409
|
-
const
|
|
410
|
-
if (
|
|
411
|
-
|
|
404
|
+
return t.append("directory_id", String(l)), v.forEach((p) => t.append("files[]", p)), new Promise((p, k) => {
|
|
405
|
+
const g = new XMLHttpRequest();
|
|
406
|
+
g.open("POST", `${d}/files`), g.responseType = "json", g.withCredentials = !0, g.setRequestHeader("Accept", "application/json"), g.setRequestHeader("X-Requested-With", "XMLHttpRequest"), g.setRequestHeader("X-Webx-Locale", a.i18n.state.locale);
|
|
407
|
+
const u = st();
|
|
408
|
+
u && g.setRequestHeader("X-XSRF-TOKEN", u), g.upload.addEventListener("progress", (n) => {
|
|
409
|
+
n.lengthComputable && i?.(Math.round(n.loaded / n.total * 100));
|
|
410
|
+
}), g.addEventListener("load", () => {
|
|
411
|
+
const n = g.response;
|
|
412
|
+
if (g.status >= 200 && g.status < 300 && n?.data) {
|
|
413
|
+
p(n.data);
|
|
412
414
|
return;
|
|
413
415
|
}
|
|
414
|
-
|
|
415
|
-
Object.assign(new Error(
|
|
416
|
-
status:
|
|
417
|
-
body:
|
|
416
|
+
k(
|
|
417
|
+
Object.assign(new Error(n?.message ?? "Upload failed"), {
|
|
418
|
+
status: g.status,
|
|
419
|
+
body: n
|
|
418
420
|
})
|
|
419
421
|
);
|
|
420
|
-
}),
|
|
422
|
+
}), g.addEventListener("error", () => k(new Error("Upload failed"))), g.send(t);
|
|
421
423
|
});
|
|
422
424
|
},
|
|
423
|
-
rename: (l,
|
|
424
|
-
move: (l,
|
|
425
|
+
rename: (l, v) => a.http.patch(`${d}/files/${l}`, { name: v }).then(m),
|
|
426
|
+
move: (l, v) => a.http.post(`${d}/files/move`, { ids: l, directory_id: v }).then((i) => i.data.moved),
|
|
425
427
|
// A POST for the batch, not a DELETE: the panel's own client sends no body on DELETE, and
|
|
426
428
|
// a list of ids in a query string is a worse answer than an honest verb.
|
|
427
|
-
remove: (l) => a.http.post(`${
|
|
428
|
-
removeOne: (l) => a.http.delete(`${
|
|
429
|
-
edit: (l,
|
|
430
|
-
copy: (l) => a.http.post(`${
|
|
431
|
-
restoreOriginal: (l) => a.http.post(`${
|
|
432
|
-
thumb(l,
|
|
429
|
+
remove: (l) => a.http.post(`${d}/files/delete`, { ids: l }).then((v) => v.data.deleted),
|
|
430
|
+
removeOne: (l) => a.http.delete(`${d}/files/${l}`),
|
|
431
|
+
edit: (l, v) => a.http.post(`${d}/files/${l}/edit`, v).then(m),
|
|
432
|
+
copy: (l) => a.http.post(`${d}/files/${l}/copy`).then(m),
|
|
433
|
+
restoreOriginal: (l) => a.http.post(`${d}/files/${l}/restore-original`).then(m),
|
|
434
|
+
thumb(l, v, i, t = "cover") {
|
|
433
435
|
if (!l.thumb)
|
|
434
436
|
return null;
|
|
435
|
-
const
|
|
436
|
-
return
|
|
437
|
+
const p = new URL(l.thumb, window.location.origin);
|
|
438
|
+
return p.searchParams.set("w", String(v)), i && p.searchParams.set("h", String(i)), p.searchParams.set("fit", t), p.pathname + p.search;
|
|
437
439
|
}
|
|
438
440
|
};
|
|
439
441
|
}
|
|
440
|
-
function
|
|
441
|
-
const a = document.cookie.split("; ").find((
|
|
442
|
+
function st() {
|
|
443
|
+
const a = document.cookie.split("; ").find((d) => d.startsWith("XSRF-TOKEN="));
|
|
442
444
|
return a ? decodeURIComponent(a.slice(11)) : null;
|
|
443
445
|
}
|
|
444
|
-
const
|
|
446
|
+
const dt = {
|
|
445
447
|
module: {
|
|
446
448
|
title: "Files"
|
|
447
449
|
},
|
|
@@ -482,6 +484,19 @@ const it = {
|
|
|
482
484
|
"status-selected": "selected: :count",
|
|
483
485
|
"status-size": "size: :size"
|
|
484
486
|
},
|
|
487
|
+
// The picture field on a form, which is the module used from outside its own section.
|
|
488
|
+
field: {
|
|
489
|
+
select: "Choose a picture",
|
|
490
|
+
edit: "Captions",
|
|
491
|
+
replace: "Replace",
|
|
492
|
+
captions: "Captions",
|
|
493
|
+
"alt-hint": "What is on the picture, for a reader who cannot see it",
|
|
494
|
+
"title-hint": "A caption shown on hover",
|
|
495
|
+
"no-preview": "No preview",
|
|
496
|
+
"clear-title": "Clear the field?",
|
|
497
|
+
"clear-text": "The file stays in the library — only this record stops using it.",
|
|
498
|
+
"clear-confirm": "Clear"
|
|
499
|
+
},
|
|
485
500
|
// The image editor is a component of the design system, so its words are props rather than
|
|
486
501
|
// lines in the dictionary — the manager hands it these when it opens it.
|
|
487
502
|
editor: {
|
|
@@ -533,29 +548,29 @@ const it = {
|
|
|
533
548
|
directory_id: "folder",
|
|
534
549
|
files: "files"
|
|
535
550
|
}
|
|
536
|
-
},
|
|
537
|
-
function
|
|
551
|
+
}, ye = /* @__PURE__ */ new WeakSet();
|
|
552
|
+
function xe() {
|
|
538
553
|
try {
|
|
539
|
-
const { i18n: a } =
|
|
540
|
-
|
|
554
|
+
const { i18n: a } = ie();
|
|
555
|
+
ye.has(a) || (a.defaults("webx-media", dt), ye.add(a));
|
|
541
556
|
} catch {
|
|
542
557
|
}
|
|
543
558
|
}
|
|
544
|
-
const
|
|
559
|
+
const ut = {
|
|
545
560
|
key: 0,
|
|
546
561
|
class: "wx-media__folders"
|
|
547
|
-
},
|
|
562
|
+
}, ct = { class: "wx-media__files" }, mt = ["accept"], pt = { class: "wx-media__status" }, ft = { key: 0 }, vt = { class: "wx-media__drawer" }, ke = /* @__PURE__ */ S({
|
|
548
563
|
__name: "MediaManager",
|
|
549
564
|
props: {
|
|
550
565
|
picking: { type: Boolean, default: !1 },
|
|
551
566
|
accept: { default: null }
|
|
552
567
|
},
|
|
553
568
|
emits: ["pick"],
|
|
554
|
-
setup(a, { emit:
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
const t =
|
|
558
|
-
function
|
|
569
|
+
setup(a, { emit: d }) {
|
|
570
|
+
const m = a, l = d, v = ie(), i = we(v);
|
|
571
|
+
xe();
|
|
572
|
+
const t = B("webx-media");
|
|
573
|
+
function p() {
|
|
559
574
|
return {
|
|
560
575
|
title: t("editor.title"),
|
|
561
576
|
saveLabel: t("editor.save"),
|
|
@@ -576,325 +591,334 @@ const rt = {
|
|
|
576
591
|
errorText: t("editor.error")
|
|
577
592
|
};
|
|
578
593
|
}
|
|
579
|
-
const
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
594
|
+
const k = ee("root"), g = Ge(k), u = D(() => g.value > 0 && g.value < 640), n = M([]), f = M(null), c = M(null), s = M([]), x = M(""), z = M(m.accept ?? "all");
|
|
595
|
+
q(
|
|
596
|
+
() => m.accept,
|
|
597
|
+
(r) => {
|
|
598
|
+
z.value = r ?? "all";
|
|
599
|
+
}
|
|
600
|
+
);
|
|
601
|
+
const X = M("-created_at"), J = M(!1), H = M(!1), oe = ee("picker"), _e = D(() => c.value?.data ?? []), K = D(() => v.can("media.manage")), Ce = D(() => v.can("media.upload") || K.value), R = D(() => Ve(f.value));
|
|
602
|
+
he(E), q([f, z, X], () => V(1)), q(
|
|
603
|
+
x,
|
|
604
|
+
Be(() => V(1), 300)
|
|
605
|
+
), q(u, (r) => {
|
|
584
606
|
r || (H.value = !1);
|
|
585
607
|
});
|
|
586
|
-
async function
|
|
587
|
-
|
|
608
|
+
async function E() {
|
|
609
|
+
n.value = await i.directories(), f.value ??= n.value[0]?.id ?? null, await V(1);
|
|
588
610
|
}
|
|
589
|
-
async function
|
|
590
|
-
|
|
611
|
+
async function V(r = c.value?.meta.current_page ?? 1) {
|
|
612
|
+
J.value = !0;
|
|
591
613
|
try {
|
|
592
|
-
c.value = await
|
|
593
|
-
directory_id:
|
|
594
|
-
q:
|
|
595
|
-
type:
|
|
614
|
+
c.value = await i.files({
|
|
615
|
+
directory_id: x.value ? null : f.value,
|
|
616
|
+
q: x.value,
|
|
617
|
+
type: z.value === "all" ? null : z.value,
|
|
596
618
|
sort: X.value,
|
|
597
619
|
page: r
|
|
598
|
-
}),
|
|
620
|
+
}), s.value = [];
|
|
599
621
|
} finally {
|
|
600
|
-
|
|
622
|
+
J.value = !1;
|
|
601
623
|
}
|
|
602
624
|
}
|
|
603
625
|
function Me() {
|
|
604
|
-
|
|
626
|
+
oe.value?.click();
|
|
605
627
|
}
|
|
606
|
-
async function
|
|
607
|
-
const
|
|
608
|
-
if (
|
|
628
|
+
async function Te(r) {
|
|
629
|
+
const o = r.target, y = Array.from(o.files ?? []);
|
|
630
|
+
if (o.value = "", !(y.length === 0 || f.value === null))
|
|
609
631
|
try {
|
|
610
|
-
const
|
|
611
|
-
|
|
612
|
-
} catch (
|
|
613
|
-
|
|
632
|
+
const C = await i.upload(f.value, y), O = C.filter((Fe) => Fe.duplicate).length;
|
|
633
|
+
C.length > O && N.success(t("manager.uploaded", { count: C.length - O })), O > 0 && N.info(t("manager.duplicate-added")), await Promise.all([E(), V(1)]);
|
|
634
|
+
} catch (C) {
|
|
635
|
+
N.danger(ce(C) ?? t("errors.upload"));
|
|
614
636
|
}
|
|
615
637
|
}
|
|
616
|
-
const
|
|
638
|
+
const ne = Y(rt);
|
|
617
639
|
async function re() {
|
|
618
|
-
const r = await
|
|
640
|
+
const r = await ne({
|
|
619
641
|
title: t("manager.new-folder"),
|
|
620
642
|
confirmText: t("manager.new-folder")
|
|
621
643
|
});
|
|
622
|
-
r === void 0 || f.value === null || (await
|
|
644
|
+
r === void 0 || f.value === null || (await i.createDirectory(f.value, r), await E());
|
|
623
645
|
}
|
|
624
646
|
async function se() {
|
|
625
|
-
const r =
|
|
647
|
+
const r = R.value;
|
|
626
648
|
if (!r || r.is_root)
|
|
627
649
|
return;
|
|
628
|
-
const
|
|
650
|
+
const o = await ne({
|
|
629
651
|
title: t("manager.rename"),
|
|
630
652
|
value: r.title,
|
|
631
653
|
confirmText: t("manager.save")
|
|
632
654
|
});
|
|
633
|
-
|
|
655
|
+
o !== void 0 && (await i.renameDirectory(r.id, o), await E());
|
|
634
656
|
}
|
|
635
657
|
async function de() {
|
|
636
|
-
const r =
|
|
658
|
+
const r = R.value;
|
|
637
659
|
if (!(!r || r.is_root)) {
|
|
638
660
|
try {
|
|
639
|
-
await
|
|
640
|
-
} catch (
|
|
641
|
-
const
|
|
642
|
-
if (!
|
|
643
|
-
throw
|
|
661
|
+
await i.deleteDirectory(r.id);
|
|
662
|
+
} catch (o) {
|
|
663
|
+
const y = Ee(o);
|
|
664
|
+
if (!y)
|
|
665
|
+
throw o;
|
|
644
666
|
if (!await ve({
|
|
645
667
|
title: t("dialogs.delete-folder-title", { title: r.title }),
|
|
646
|
-
message: `${t("dialogs.delete-folder-contents",
|
|
668
|
+
message: `${t("dialogs.delete-folder-contents", y)} ${t("dialogs.delete-folder-warning")}`,
|
|
647
669
|
confirmText: t("dialogs.confirm"),
|
|
648
670
|
cancelText: t("manager.cancel"),
|
|
649
671
|
tone: "danger"
|
|
650
672
|
}))
|
|
651
673
|
return;
|
|
652
|
-
await
|
|
674
|
+
await i.deleteDirectory(r.id, !0);
|
|
653
675
|
}
|
|
654
|
-
f.value = null, await
|
|
676
|
+
f.value = null, await E();
|
|
655
677
|
}
|
|
656
678
|
}
|
|
657
|
-
async function ue(r,
|
|
679
|
+
async function ue(r, o) {
|
|
658
680
|
try {
|
|
659
|
-
await
|
|
660
|
-
} catch (
|
|
661
|
-
|
|
681
|
+
await i.moveDirectory(r, o);
|
|
682
|
+
} catch (y) {
|
|
683
|
+
N.danger(ce(y) ?? t("errors.directory-into-itself"));
|
|
662
684
|
}
|
|
663
|
-
await
|
|
685
|
+
await E();
|
|
664
686
|
}
|
|
665
|
-
const
|
|
666
|
-
async function
|
|
667
|
-
const r = await
|
|
668
|
-
directories:
|
|
687
|
+
const ze = Y(nt);
|
|
688
|
+
async function We() {
|
|
689
|
+
const r = await ze({
|
|
690
|
+
directories: n.value,
|
|
669
691
|
from: f.value,
|
|
670
|
-
count:
|
|
692
|
+
count: s.value.length
|
|
671
693
|
});
|
|
672
|
-
r !== void 0 && (await
|
|
694
|
+
r !== void 0 && (await i.move([...s.value], r), await Promise.all([E(), V()]));
|
|
673
695
|
}
|
|
674
|
-
async function
|
|
675
|
-
const r = [...
|
|
696
|
+
async function De() {
|
|
697
|
+
const r = [...s.value];
|
|
676
698
|
await ve({
|
|
677
699
|
title: t("dialogs.delete-files-title", { count: r.length }),
|
|
678
700
|
message: t("dialogs.delete-files-text"),
|
|
679
701
|
confirmText: t("dialogs.confirm"),
|
|
680
702
|
cancelText: t("manager.cancel"),
|
|
681
703
|
tone: "danger"
|
|
682
|
-
}) && (await
|
|
704
|
+
}) && (await i.remove(r), await Promise.all([E(), V()]));
|
|
683
705
|
}
|
|
684
|
-
async function
|
|
685
|
-
await
|
|
686
|
-
}
|
|
687
|
-
async function Le(r) {
|
|
688
|
-
await o.removeOne(r.id), await Promise.all([W(), L()]);
|
|
706
|
+
async function Le(r, o) {
|
|
707
|
+
await i.rename(r.id, o), await V();
|
|
689
708
|
}
|
|
690
709
|
async function Ue(r) {
|
|
691
|
-
|
|
710
|
+
await i.removeOne(r.id), await Promise.all([E(), V()]);
|
|
711
|
+
}
|
|
712
|
+
async function Re(r) {
|
|
713
|
+
const o = await Qe({
|
|
692
714
|
src: r.source ?? r.url,
|
|
693
715
|
fileName: r.file_name,
|
|
694
716
|
filters: !1,
|
|
695
717
|
// The editor is a component of the design system: its words are props with English
|
|
696
718
|
// defaults, not lines in the panel's dictionary. Whoever opens it is the one who knows
|
|
697
719
|
// what language the panel is being read in.
|
|
698
|
-
...
|
|
720
|
+
...p()
|
|
699
721
|
});
|
|
700
|
-
|
|
722
|
+
o && (await i.edit(r.id, {
|
|
701
723
|
// The editor's frame is read against the picture as it is on screen — already turned — and
|
|
702
724
|
// the server applies the operations in that order for the same reason.
|
|
703
|
-
crop:
|
|
704
|
-
rotate: (
|
|
705
|
-
flip:
|
|
706
|
-
resize: { width:
|
|
707
|
-
}), await
|
|
725
|
+
crop: o.crop,
|
|
726
|
+
rotate: (o.rotation % 360 + 360) % 360,
|
|
727
|
+
flip: o.flipX ? "horizontal" : o.flipY ? "vertical" : void 0,
|
|
728
|
+
resize: { width: o.width, height: o.height }
|
|
729
|
+
}), await V());
|
|
708
730
|
}
|
|
709
|
-
function
|
|
710
|
-
const
|
|
711
|
-
for (const
|
|
712
|
-
if (
|
|
713
|
-
return
|
|
714
|
-
const O =
|
|
731
|
+
function Ve(r) {
|
|
732
|
+
const o = (y) => {
|
|
733
|
+
for (const C of y) {
|
|
734
|
+
if (C.id === r)
|
|
735
|
+
return C;
|
|
736
|
+
const O = o(C.children ?? []);
|
|
715
737
|
if (O)
|
|
716
738
|
return O;
|
|
717
739
|
}
|
|
718
740
|
return null;
|
|
719
741
|
};
|
|
720
|
-
return r === null ? null : n
|
|
742
|
+
return r === null ? null : o(n.value);
|
|
721
743
|
}
|
|
722
|
-
function
|
|
723
|
-
const
|
|
724
|
-
return
|
|
744
|
+
function Ee(r) {
|
|
745
|
+
const o = r?.body;
|
|
746
|
+
return o?.code === "directory_not_empty" ? o.counts ?? null : null;
|
|
725
747
|
}
|
|
726
748
|
function ce(r) {
|
|
727
749
|
return r?.message ?? null;
|
|
728
750
|
}
|
|
729
|
-
function
|
|
730
|
-
const
|
|
731
|
-
let
|
|
732
|
-
for (;
|
|
733
|
-
|
|
734
|
-
return `${
|
|
751
|
+
function Se(r) {
|
|
752
|
+
const o = ["B", "KB", "MB", "GB", "TB"];
|
|
753
|
+
let y = r, C = 0;
|
|
754
|
+
for (; y >= 1024 && C < o.length - 1; )
|
|
755
|
+
y /= 1024, C++;
|
|
756
|
+
return `${y >= 10 || C === 0 ? Math.round(y) : y.toFixed(1)} ${o[C]}`;
|
|
735
757
|
}
|
|
736
|
-
function
|
|
737
|
-
let
|
|
758
|
+
function Be(r, o) {
|
|
759
|
+
let y;
|
|
738
760
|
return () => {
|
|
739
|
-
clearTimeout(
|
|
761
|
+
clearTimeout(y), y = setTimeout(r, o);
|
|
740
762
|
};
|
|
741
763
|
}
|
|
742
|
-
return (r,
|
|
764
|
+
return (r, o) => (b(), W("div", {
|
|
743
765
|
ref_key: "root",
|
|
744
|
-
ref:
|
|
745
|
-
class:
|
|
766
|
+
ref: k,
|
|
767
|
+
class: Ae(["wx-media", { "wx-media--compact": u.value }])
|
|
746
768
|
}, [
|
|
747
|
-
|
|
748
|
-
|
|
769
|
+
u.value ? U("", !0) : (b(), W("aside", ut, [
|
|
770
|
+
h(ge, {
|
|
749
771
|
selected: f.value,
|
|
750
|
-
"onUpdate:selected":
|
|
751
|
-
directories:
|
|
772
|
+
"onUpdate:selected": o[0] || (o[0] = (y) => f.value = y),
|
|
773
|
+
directories: n.value,
|
|
752
774
|
onMove: ue
|
|
753
775
|
}, null, 8, ["selected", "directories"]),
|
|
754
|
-
|
|
776
|
+
K.value ? (b(), $(e(G), {
|
|
755
777
|
key: 0,
|
|
756
778
|
size: "sm",
|
|
757
779
|
align: "start"
|
|
758
780
|
}, {
|
|
759
781
|
default: w(() => [
|
|
760
|
-
|
|
782
|
+
h(e(T), {
|
|
761
783
|
type: "add",
|
|
762
784
|
title: e(t)("manager.new-folder"),
|
|
763
785
|
onClick: re
|
|
764
786
|
}, null, 8, ["title"]),
|
|
765
|
-
|
|
787
|
+
h(e(T), {
|
|
766
788
|
type: "edit",
|
|
767
789
|
title: e(t)("manager.rename"),
|
|
768
|
-
disabled: !
|
|
790
|
+
disabled: !R.value || R.value.is_root,
|
|
769
791
|
onClick: se
|
|
770
792
|
}, null, 8, ["title", "disabled"]),
|
|
771
|
-
|
|
793
|
+
h(e(T), {
|
|
772
794
|
type: "remove",
|
|
773
795
|
title: e(t)("manager.delete"),
|
|
774
|
-
disabled: !
|
|
796
|
+
disabled: !R.value || R.value.is_root,
|
|
775
797
|
onClick: de
|
|
776
798
|
}, null, 8, ["title", "disabled"])
|
|
777
799
|
]),
|
|
778
800
|
_: 1
|
|
779
|
-
})) :
|
|
801
|
+
})) : U("", !0)
|
|
780
802
|
])),
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
search:
|
|
784
|
-
"onUpdate:search":
|
|
785
|
-
type:
|
|
786
|
-
"onUpdate:type":
|
|
803
|
+
_("section", ct, [
|
|
804
|
+
h(ot, {
|
|
805
|
+
search: x.value,
|
|
806
|
+
"onUpdate:search": o[1] || (o[1] = (y) => x.value = y),
|
|
807
|
+
type: z.value,
|
|
808
|
+
"onUpdate:type": o[2] || (o[2] = (y) => z.value = y),
|
|
787
809
|
sort: X.value,
|
|
788
|
-
"onUpdate:sort":
|
|
789
|
-
"can-upload":
|
|
790
|
-
"
|
|
791
|
-
|
|
792
|
-
|
|
810
|
+
"onUpdate:sort": o[3] || (o[3] = (y) => X.value = y),
|
|
811
|
+
"can-upload": Ce.value,
|
|
812
|
+
"fixed-type": a.accept !== null,
|
|
813
|
+
"can-manage": K.value,
|
|
814
|
+
selected: s.value.length,
|
|
815
|
+
compact: u.value,
|
|
793
816
|
onUpload: Me,
|
|
794
|
-
onMove:
|
|
795
|
-
onRemove:
|
|
796
|
-
onFolders:
|
|
797
|
-
}, null, 8, ["search", "type", "sort", "can-upload", "can-manage", "selected", "compact"]),
|
|
798
|
-
|
|
817
|
+
onMove: We,
|
|
818
|
+
onRemove: De,
|
|
819
|
+
onFolders: o[4] || (o[4] = (y) => H.value = !0)
|
|
820
|
+
}, null, 8, ["search", "type", "sort", "can-upload", "fixed-type", "can-manage", "selected", "compact"]),
|
|
821
|
+
_("input", {
|
|
799
822
|
ref_key: "picker",
|
|
800
|
-
ref:
|
|
823
|
+
ref: oe,
|
|
801
824
|
type: "file",
|
|
802
825
|
multiple: "",
|
|
803
826
|
hidden: "",
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
827
|
+
accept: a.accept === null ? void 0 : `${a.accept}/*`,
|
|
828
|
+
onChange: Te
|
|
829
|
+
}, null, 40, mt),
|
|
830
|
+
h(lt, {
|
|
831
|
+
selected: s.value,
|
|
832
|
+
"onUpdate:selected": o[5] || (o[5] = (y) => s.value = y),
|
|
833
|
+
files: _e.value,
|
|
834
|
+
api: e(i),
|
|
835
|
+
query: x.value,
|
|
812
836
|
single: a.picking,
|
|
813
|
-
onRename:
|
|
814
|
-
onEdit:
|
|
815
|
-
onRemove:
|
|
816
|
-
onOpen:
|
|
837
|
+
onRename: Le,
|
|
838
|
+
onEdit: Re,
|
|
839
|
+
onRemove: Ue,
|
|
840
|
+
onOpen: o[6] || (o[6] = (y) => l("pick", y))
|
|
817
841
|
}, null, 8, ["selected", "files", "api", "query", "single"]),
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
842
|
+
_("footer", pt, [
|
|
843
|
+
_("span", null, L(e(t)("manager.status-files", { count: c.value?.stats.files ?? 0 })), 1),
|
|
844
|
+
s.value.length > 0 ? (b(), W("span", ft, L(e(t)("manager.status-selected", { count: s.value.length })), 1)) : U("", !0),
|
|
845
|
+
_("span", null, L(e(t)("manager.status-size", { size: Se(c.value?.stats.size ?? 0) })), 1)
|
|
822
846
|
]),
|
|
823
|
-
c.value && c.value.meta.last_page > 1 ? (b(),
|
|
847
|
+
c.value && c.value.meta.last_page > 1 ? (b(), $(e(Ye), {
|
|
824
848
|
key: 0,
|
|
825
849
|
page: c.value.meta.current_page,
|
|
826
850
|
"per-page": c.value.meta.per_page,
|
|
827
851
|
total: c.value.meta.total,
|
|
828
852
|
"last-page": c.value.meta.last_page,
|
|
829
|
-
disabled:
|
|
853
|
+
disabled: J.value,
|
|
830
854
|
size: "sm",
|
|
831
|
-
onChange:
|
|
832
|
-
}, null, 8, ["page", "per-page", "total", "last-page", "disabled"])) :
|
|
855
|
+
onChange: o[7] || (o[7] = ({ page: y }) => V(y))
|
|
856
|
+
}, null, 8, ["page", "per-page", "total", "last-page", "disabled"])) : U("", !0)
|
|
833
857
|
]),
|
|
834
|
-
|
|
858
|
+
h(e(Je), {
|
|
835
859
|
open: H.value,
|
|
836
|
-
"onUpdate:open":
|
|
860
|
+
"onUpdate:open": o[10] || (o[10] = (y) => H.value = y),
|
|
837
861
|
side: "left",
|
|
838
862
|
title: e(t)("manager.folders"),
|
|
839
863
|
size: 280
|
|
840
864
|
}, {
|
|
841
865
|
default: w(() => [
|
|
842
|
-
|
|
843
|
-
|
|
866
|
+
_("div", vt, [
|
|
867
|
+
h(ge, {
|
|
844
868
|
selected: f.value,
|
|
845
869
|
"onUpdate:selected": [
|
|
846
|
-
|
|
847
|
-
|
|
870
|
+
o[8] || (o[8] = (y) => f.value = y),
|
|
871
|
+
o[9] || (o[9] = (y) => H.value = !1)
|
|
848
872
|
],
|
|
849
|
-
directories:
|
|
873
|
+
directories: n.value,
|
|
850
874
|
onMove: ue
|
|
851
875
|
}, null, 8, ["selected", "directories"]),
|
|
852
|
-
|
|
876
|
+
K.value ? (b(), $(e(G), {
|
|
853
877
|
key: 0,
|
|
854
878
|
size: "sm",
|
|
855
879
|
align: "start"
|
|
856
880
|
}, {
|
|
857
881
|
default: w(() => [
|
|
858
|
-
|
|
882
|
+
h(e(T), {
|
|
859
883
|
type: "add",
|
|
860
884
|
title: e(t)("manager.new-folder"),
|
|
861
885
|
onClick: re
|
|
862
886
|
}, null, 8, ["title"]),
|
|
863
|
-
|
|
887
|
+
h(e(T), {
|
|
864
888
|
type: "edit",
|
|
865
889
|
title: e(t)("manager.rename"),
|
|
866
|
-
disabled: !
|
|
890
|
+
disabled: !R.value || R.value.is_root,
|
|
867
891
|
onClick: se
|
|
868
892
|
}, null, 8, ["title", "disabled"]),
|
|
869
|
-
|
|
893
|
+
h(e(T), {
|
|
870
894
|
type: "remove",
|
|
871
895
|
title: e(t)("manager.delete"),
|
|
872
|
-
disabled: !
|
|
896
|
+
disabled: !R.value || R.value.is_root,
|
|
873
897
|
onClick: de
|
|
874
898
|
}, null, 8, ["title", "disabled"])
|
|
875
899
|
]),
|
|
876
900
|
_: 1
|
|
877
|
-
})) :
|
|
901
|
+
})) : U("", !0)
|
|
878
902
|
])
|
|
879
903
|
]),
|
|
880
904
|
_: 1
|
|
881
905
|
}, 8, ["open", "title"])
|
|
882
906
|
], 2));
|
|
883
907
|
}
|
|
884
|
-
}),
|
|
908
|
+
}), gt = /* @__PURE__ */ S({
|
|
885
909
|
__name: "MediaPage",
|
|
886
910
|
setup(a) {
|
|
887
|
-
return (
|
|
911
|
+
return (d, m) => (b(), $(e(Ze), {
|
|
888
912
|
class: "wx-media-page",
|
|
889
913
|
padding: "md"
|
|
890
914
|
}, {
|
|
891
915
|
default: w(() => [
|
|
892
|
-
|
|
916
|
+
h(ke)
|
|
893
917
|
]),
|
|
894
918
|
_: 1
|
|
895
919
|
}));
|
|
896
920
|
}
|
|
897
|
-
}),
|
|
921
|
+
}), yt = { class: "wx-media-picker" }, $e = /* @__PURE__ */ S({
|
|
898
922
|
__name: "MediaPicker",
|
|
899
923
|
props: {
|
|
900
924
|
accept: { default: "image" },
|
|
@@ -902,139 +926,231 @@ const rt = {
|
|
|
902
926
|
manage: { type: Boolean, default: !1 }
|
|
903
927
|
},
|
|
904
928
|
setup(a) {
|
|
905
|
-
const { open:
|
|
906
|
-
return (
|
|
907
|
-
open: e(
|
|
908
|
-
"onUpdate:open":
|
|
929
|
+
const { open: d, resolve: m } = ae(), l = B("webx-media");
|
|
930
|
+
return (v, i) => (b(), $(e(le), {
|
|
931
|
+
open: e(d),
|
|
932
|
+
"onUpdate:open": i[1] || (i[1] = (t) => te(d) ? d.value = t : null),
|
|
909
933
|
title: a.title ?? e(l)("module.title"),
|
|
910
934
|
width: 960
|
|
911
935
|
}, {
|
|
912
936
|
default: w(() => [
|
|
913
|
-
|
|
914
|
-
|
|
937
|
+
_("div", yt, [
|
|
938
|
+
h(ke, {
|
|
915
939
|
picking: !a.manage,
|
|
916
940
|
accept: a.manage ? null : a.accept,
|
|
917
|
-
onPick:
|
|
941
|
+
onPick: i[0] || (i[0] = (t) => e(m)(t))
|
|
918
942
|
}, null, 8, ["picking", "accept"])
|
|
919
943
|
])
|
|
920
944
|
]),
|
|
921
945
|
_: 1
|
|
922
946
|
}, 8, ["open", "title"]));
|
|
923
947
|
}
|
|
924
|
-
}),
|
|
925
|
-
|
|
948
|
+
}), ht = Y($e), Ut = Y(
|
|
949
|
+
$e,
|
|
926
950
|
{ props: { manage: !0 } }
|
|
927
|
-
),
|
|
951
|
+
), bt = { class: "wx-media-field" }, wt = {
|
|
928
952
|
key: 0,
|
|
929
953
|
class: "wx-media-field__label"
|
|
930
|
-
},
|
|
954
|
+
}, xt = ["disabled"], kt = ["disabled", "title"], $t = {
|
|
955
|
+
key: 1,
|
|
956
|
+
class: "wx-media-field__missing"
|
|
957
|
+
}, _t = {
|
|
958
|
+
key: 0,
|
|
959
|
+
class: "wx-media-field__bar"
|
|
960
|
+
}, Ct = { class: "wx-media-field__captions" }, Mt = { class: "wx-media-field__caption" }, Tt = { class: "wx-media-field__caption" }, zt = { class: "wx-media-field__captions-footer" }, Rt = /* @__PURE__ */ S({
|
|
931
961
|
__name: "MediaField",
|
|
932
|
-
props: /* @__PURE__ */
|
|
962
|
+
props: /* @__PURE__ */ F({
|
|
933
963
|
label: { default: void 0 },
|
|
934
964
|
accept: { default: "image" },
|
|
935
|
-
captions: { type: Boolean, default: !0 }
|
|
965
|
+
captions: { type: Boolean, default: !0 },
|
|
966
|
+
aspect: { default: "16/9" },
|
|
967
|
+
height: { default: 220 },
|
|
968
|
+
disabled: { type: Boolean, default: !1 }
|
|
936
969
|
}, {
|
|
937
970
|
modelValue: { default: null },
|
|
938
971
|
modelModifiers: {}
|
|
939
972
|
}),
|
|
940
973
|
emits: ["update:modelValue"],
|
|
941
974
|
setup(a) {
|
|
942
|
-
const
|
|
943
|
-
|
|
944
|
-
const l =
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
975
|
+
const d = a, m = A(a, "modelValue");
|
|
976
|
+
xe();
|
|
977
|
+
const l = B("webx-media"), v = we(ie()), i = {
|
|
978
|
+
"16/9": "16 / 9",
|
|
979
|
+
"4/3": "4 / 3",
|
|
980
|
+
"1/1": "1 / 1"
|
|
981
|
+
}, t = M(!1), p = M({});
|
|
982
|
+
q(
|
|
983
|
+
() => m.value?.path,
|
|
984
|
+
async (s) => {
|
|
985
|
+
if (!s || m.value?.url || p.value[s]) return;
|
|
986
|
+
const x = await v.fileByPath(s);
|
|
987
|
+
x && (p.value = { ...p.value, [s]: x.url });
|
|
988
|
+
},
|
|
989
|
+
{ immediate: !0 }
|
|
990
|
+
);
|
|
991
|
+
const k = D(() => {
|
|
992
|
+
const s = m.value;
|
|
993
|
+
return s ? s.url ?? p.value[s.path] ?? null : null;
|
|
994
|
+
}), g = D(
|
|
995
|
+
() => d.aspect ? { aspectRatio: i[d.aspect] ?? d.aspect } : { height: typeof d.height == "number" ? `${d.height}px` : d.height }
|
|
996
|
+
);
|
|
997
|
+
function u(s) {
|
|
998
|
+
return m.value?.[s] ?? {};
|
|
948
999
|
}
|
|
949
|
-
function
|
|
950
|
-
|
|
1000
|
+
function n(s, x) {
|
|
1001
|
+
m.value && (m.value = { ...m.value, [s]: x });
|
|
951
1002
|
}
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1003
|
+
async function f() {
|
|
1004
|
+
if (d.disabled) return;
|
|
1005
|
+
const s = await ht({ accept: d.accept });
|
|
1006
|
+
s && (m.value = { ...m.value, path: s.path, url: s.url });
|
|
1007
|
+
}
|
|
1008
|
+
function c() {
|
|
1009
|
+
m.value = null, t.value = !1;
|
|
1010
|
+
}
|
|
1011
|
+
return (s, x) => (b(), W("div", bt, [
|
|
1012
|
+
a.label ? (b(), W("span", wt, L(a.label), 1)) : U("", !0),
|
|
1013
|
+
m.value ? (b(), W("div", {
|
|
1014
|
+
key: 2,
|
|
1015
|
+
class: "wx-media-field__frame",
|
|
1016
|
+
style: me(g.value)
|
|
1017
|
+
}, [
|
|
1018
|
+
_("button", {
|
|
1019
|
+
type: "button",
|
|
1020
|
+
class: "wx-media-field__picture",
|
|
1021
|
+
disabled: a.disabled,
|
|
1022
|
+
title: e(l)("field.replace"),
|
|
1023
|
+
onClick: f
|
|
1024
|
+
}, [
|
|
1025
|
+
k.value ? (b(), $(e(et), {
|
|
1026
|
+
key: 0,
|
|
1027
|
+
src: k.value,
|
|
1028
|
+
fit: "contain",
|
|
1029
|
+
width: "100%",
|
|
1030
|
+
height: "100%"
|
|
1031
|
+
}, null, 8, ["src"])) : (b(), W("span", $t, L(e(l)("field.no-preview")), 1))
|
|
1032
|
+
], 8, kt),
|
|
1033
|
+
a.disabled ? U("", !0) : (b(), W("div", _t, [
|
|
1034
|
+
h(e(G), { size: "sm" }, {
|
|
1035
|
+
default: w(() => [
|
|
1036
|
+
a.captions ? (b(), $(e(tt), {
|
|
1037
|
+
key: 0,
|
|
1038
|
+
open: t.value,
|
|
1039
|
+
"onUpdate:open": x[3] || (x[3] = (z) => t.value = z),
|
|
1040
|
+
title: e(l)("field.captions"),
|
|
1041
|
+
width: 360,
|
|
1042
|
+
side: "top",
|
|
1043
|
+
teleport: ""
|
|
1044
|
+
}, {
|
|
1045
|
+
trigger: w(() => [
|
|
1046
|
+
h(e(T), {
|
|
1047
|
+
type: "edit",
|
|
1048
|
+
title: e(l)("field.edit")
|
|
1049
|
+
}, null, 8, ["title"])
|
|
1050
|
+
]),
|
|
1051
|
+
default: w(() => [
|
|
1052
|
+
_("div", Ct, [
|
|
1053
|
+
_("div", Mt, [
|
|
1054
|
+
x[4] || (x[4] = _("label", {
|
|
1055
|
+
class: "wx-media-field__caption-label",
|
|
1056
|
+
for: "wx-media-alt"
|
|
1057
|
+
}, "alt", -1)),
|
|
1058
|
+
h(e(j), {
|
|
1059
|
+
id: "wx-media-alt",
|
|
1060
|
+
localized: "",
|
|
1061
|
+
"model-value": u("alt"),
|
|
1062
|
+
placeholder: e(l)("field.alt-hint"),
|
|
1063
|
+
"onUpdate:modelValue": x[0] || (x[0] = (z) => n("alt", z))
|
|
1064
|
+
}, null, 8, ["model-value", "placeholder"])
|
|
1065
|
+
]),
|
|
1066
|
+
_("div", Tt, [
|
|
1067
|
+
x[5] || (x[5] = _("label", {
|
|
1068
|
+
class: "wx-media-field__caption-label",
|
|
1069
|
+
for: "wx-media-title"
|
|
1070
|
+
}, "title", -1)),
|
|
1071
|
+
h(e(j), {
|
|
1072
|
+
id: "wx-media-title",
|
|
1073
|
+
localized: "",
|
|
1074
|
+
"model-value": u("title"),
|
|
1075
|
+
placeholder: e(l)("field.title-hint"),
|
|
1076
|
+
"onUpdate:modelValue": x[1] || (x[1] = (z) => n("title", z))
|
|
1077
|
+
}, null, 8, ["model-value", "placeholder"])
|
|
1078
|
+
]),
|
|
1079
|
+
_("div", zt, [
|
|
1080
|
+
h(e(I), {
|
|
1081
|
+
size: "sm",
|
|
1082
|
+
type: "primary",
|
|
1083
|
+
onClick: x[2] || (x[2] = (z) => t.value = !1)
|
|
1084
|
+
}, {
|
|
1085
|
+
default: w(() => [
|
|
1086
|
+
P(L(e(l)("manager.save")), 1)
|
|
1087
|
+
]),
|
|
1088
|
+
_: 1
|
|
1089
|
+
})
|
|
1090
|
+
])
|
|
1091
|
+
])
|
|
1092
|
+
]),
|
|
1093
|
+
_: 1
|
|
1094
|
+
}, 8, ["open", "title"])) : U("", !0),
|
|
1095
|
+
h(e(at), {
|
|
1096
|
+
title: e(l)("field.clear-title"),
|
|
1097
|
+
description: e(l)("field.clear-text"),
|
|
1098
|
+
"confirm-text": e(l)("field.clear-confirm"),
|
|
1099
|
+
"cancel-text": e(l)("manager.cancel"),
|
|
1100
|
+
"confirm-type": "danger",
|
|
1101
|
+
side: "top",
|
|
1102
|
+
onConfirm: c
|
|
1103
|
+
}, {
|
|
1104
|
+
trigger: w(() => [
|
|
1105
|
+
h(e(T), {
|
|
1106
|
+
type: "remove",
|
|
1107
|
+
title: e(l)("field.clear-confirm")
|
|
1108
|
+
}, null, 8, ["title"])
|
|
1109
|
+
]),
|
|
1110
|
+
_: 1
|
|
1111
|
+
}, 8, ["title", "description", "confirm-text", "cancel-text"])
|
|
1112
|
+
]),
|
|
1113
|
+
_: 1
|
|
1114
|
+
})
|
|
1115
|
+
]))
|
|
1116
|
+
], 4)) : (b(), W("div", {
|
|
1117
|
+
key: 1,
|
|
1118
|
+
class: "wx-media-field__frame is-empty",
|
|
1119
|
+
style: me(g.value)
|
|
1120
|
+
}, [
|
|
1121
|
+
_("button", {
|
|
1122
|
+
type: "button",
|
|
1123
|
+
class: "wx-media-field__pick",
|
|
1124
|
+
disabled: a.disabled,
|
|
1125
|
+
onClick: f
|
|
1126
|
+
}, L(e(l)("field.select")), 9, xt)
|
|
1127
|
+
], 4))
|
|
1012
1128
|
]));
|
|
1013
1129
|
}
|
|
1014
1130
|
});
|
|
1015
|
-
function
|
|
1016
|
-
const
|
|
1131
|
+
function Vt(a = {}) {
|
|
1132
|
+
const d = a.path ?? "/media";
|
|
1017
1133
|
return {
|
|
1018
1134
|
id: "media",
|
|
1019
|
-
path:
|
|
1135
|
+
path: d,
|
|
1020
1136
|
routes: [
|
|
1021
1137
|
{
|
|
1022
|
-
path:
|
|
1138
|
+
path: d,
|
|
1023
1139
|
name: "webx.media",
|
|
1024
|
-
component:
|
|
1140
|
+
component: gt
|
|
1025
1141
|
}
|
|
1026
1142
|
]
|
|
1027
1143
|
};
|
|
1028
1144
|
}
|
|
1029
1145
|
export {
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1146
|
+
Rt as WxMediaField,
|
|
1147
|
+
ke as WxMediaManager,
|
|
1148
|
+
gt as WxMediaPage,
|
|
1149
|
+
$e as WxMediaPicker,
|
|
1150
|
+
we as createMediaApi,
|
|
1151
|
+
Vt as media,
|
|
1152
|
+
dt as mediaMessages,
|
|
1153
|
+
Ut as openMediaLibrary,
|
|
1154
|
+
ht as openMediaPicker
|
|
1039
1155
|
};
|
|
1040
1156
|
//# sourceMappingURL=index.js.map
|