@crmchatreactcomponent/quick-messages 0.0.6 → 0.0.8
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/context/I18nContext.d.ts +2 -0
- package/dist/index.es.js +1027 -437
- package/dist/index.umd.js +12 -10
- package/package.json +2 -1
package/dist/index.es.js
CHANGED
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import { ConfigProvider as
|
|
4
|
-
import
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx as o, jsxs as h, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as me, useMemo as D, useState as $, useEffect as E, createContext as ve, useRef as xe } from "react";
|
|
3
|
+
import { ConfigProvider as St, theme as jt, Popover as Ce, Space as C, message as $t, Modal as Te, Table as _, Button as T, Flex as z, Empty as Se, Input as U, Popconfirm as kt, Menu as At, Alert as wt, ColorPicker as Pt, Tooltip as Dt } from "antd";
|
|
4
|
+
import Ot, { EmojiStyle as Mt, Theme as te } from "emoji-picker-react";
|
|
5
|
+
import { useTranslation as I, I18nextProvider as Et } from "react-i18next";
|
|
6
|
+
import { uniqBy as It } from "lodash-es";
|
|
7
|
+
import k from "styled-components";
|
|
8
|
+
import { DeleteOutlined as Nt, EditOutlined as Lt, PlusOutlined as Gt, SettingOutlined as Ht } from "@ant-design/icons";
|
|
9
|
+
import { useLocalStorage as _t } from "react-use";
|
|
10
|
+
import zt from "color";
|
|
11
|
+
import Ft from "i18next";
|
|
12
|
+
function je() {
|
|
13
|
+
const { theme: e } = me(St.ConfigContext);
|
|
14
|
+
return D(() => (e == null ? void 0 : e.algorithm) === jt.darkAlgorithm, [e]);
|
|
15
|
+
}
|
|
16
|
+
const Rt = Mt.FACEBOOK, Oo = ({
|
|
16
17
|
children: e,
|
|
17
|
-
disabled:
|
|
18
|
-
onSelect:
|
|
18
|
+
disabled: t = !1,
|
|
19
|
+
onSelect: r = () => {
|
|
19
20
|
},
|
|
20
|
-
onOpenChange:
|
|
21
|
+
onOpenChange: n = () => {
|
|
21
22
|
}
|
|
22
23
|
}) => {
|
|
23
|
-
const [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
function c(
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
|
|
24
|
+
const [a, i] = $(!1), u = je();
|
|
25
|
+
E(() => {
|
|
26
|
+
n(a);
|
|
27
|
+
}, [a]);
|
|
28
|
+
function p(s) {
|
|
29
|
+
r(s.emoji), i(!1);
|
|
30
|
+
}
|
|
31
|
+
function c(s) {
|
|
32
|
+
t || i(s);
|
|
33
|
+
}
|
|
34
|
+
return /* @__PURE__ */ o(
|
|
35
|
+
Ce,
|
|
35
36
|
{
|
|
36
37
|
title: "",
|
|
37
|
-
open:
|
|
38
|
+
open: a,
|
|
38
39
|
onOpenChange: c,
|
|
39
40
|
overlayInnerStyle: {
|
|
40
41
|
backgroundColor: "transparent",
|
|
41
42
|
padding: 0
|
|
42
43
|
},
|
|
43
44
|
trigger: ["click"],
|
|
44
|
-
content: /* @__PURE__ */
|
|
45
|
-
|
|
45
|
+
content: /* @__PURE__ */ o(C, { direction: "vertical", size: 12, children: /* @__PURE__ */ o(
|
|
46
|
+
Ot,
|
|
46
47
|
{
|
|
47
48
|
skinTonesDisabled: !0,
|
|
48
|
-
onEmojiClick:
|
|
49
|
-
emojiStyle:
|
|
49
|
+
onEmojiClick: p,
|
|
50
|
+
emojiStyle: Rt,
|
|
50
51
|
lazyLoadEmojis: !1,
|
|
51
|
-
theme: u ?
|
|
52
|
+
theme: u ? te.DARK : te.LIGHT
|
|
52
53
|
}
|
|
53
54
|
) }),
|
|
54
55
|
destroyTooltipOnHide: !0,
|
|
@@ -56,61 +57,635 @@ const Ke = Fe.FACEBOOK, St = ({
|
|
|
56
57
|
}
|
|
57
58
|
);
|
|
58
59
|
};
|
|
59
|
-
function
|
|
60
|
+
function Bt() {
|
|
60
61
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
61
|
-
const
|
|
62
|
-
return (e == "x" ?
|
|
62
|
+
const t = Math.random() * 16 | 0;
|
|
63
|
+
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
-
return e.length >
|
|
66
|
+
function $e(e, t) {
|
|
67
|
+
return e.length > t ? e.substring(0, t) + "…" : e;
|
|
67
68
|
}
|
|
68
|
-
const
|
|
69
|
-
function
|
|
70
|
-
const [
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
|
|
69
|
+
const ke = ve(null);
|
|
70
|
+
function Mo(e) {
|
|
71
|
+
const [t, r] = $t.useMessage(), [n, a] = Te.useModal();
|
|
72
|
+
return /* @__PURE__ */ h(
|
|
73
|
+
ke.Provider,
|
|
73
74
|
{
|
|
74
75
|
value: {
|
|
75
|
-
messageApi:
|
|
76
|
-
modalApi:
|
|
76
|
+
messageApi: t,
|
|
77
|
+
modalApi: n
|
|
77
78
|
},
|
|
78
79
|
children: [
|
|
80
|
+
r,
|
|
79
81
|
a,
|
|
80
|
-
i,
|
|
81
82
|
e.children
|
|
82
83
|
]
|
|
83
84
|
}
|
|
84
85
|
);
|
|
85
86
|
}
|
|
86
|
-
|
|
87
|
+
class Kt {
|
|
88
|
+
constructor() {
|
|
89
|
+
this.type = y.PLAIN;
|
|
90
|
+
}
|
|
91
|
+
toText(t) {
|
|
92
|
+
return t;
|
|
93
|
+
}
|
|
94
|
+
toHtml(t) {
|
|
95
|
+
return t;
|
|
96
|
+
}
|
|
97
|
+
parse(t) {
|
|
98
|
+
return t;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
var Vt = typeof global == "object" && global && global.Object === Object && global, Ae = Vt, qt = typeof self == "object" && self && self.Object === Object && self, Ut = Ae || qt || Function("return this")(), w = Ut, Wt = w.Symbol, F = Wt, we = Object.prototype, Yt = we.hasOwnProperty, Jt = we.toString, N = F ? F.toStringTag : void 0;
|
|
102
|
+
function Xt(e) {
|
|
103
|
+
var t = Yt.call(e, N), r = e[N];
|
|
104
|
+
try {
|
|
105
|
+
e[N] = void 0;
|
|
106
|
+
var n = !0;
|
|
107
|
+
} catch {
|
|
108
|
+
}
|
|
109
|
+
var a = Jt.call(e);
|
|
110
|
+
return n && (t ? e[N] = r : delete e[N]), a;
|
|
111
|
+
}
|
|
112
|
+
var Qt = Object.prototype, Zt = Qt.toString;
|
|
113
|
+
function er(e) {
|
|
114
|
+
return Zt.call(e);
|
|
115
|
+
}
|
|
116
|
+
var tr = "[object Null]", rr = "[object Undefined]", re = F ? F.toStringTag : void 0;
|
|
117
|
+
function O(e) {
|
|
118
|
+
return e == null ? e === void 0 ? rr : tr : re && re in Object(e) ? Xt(e) : er(e);
|
|
119
|
+
}
|
|
120
|
+
function G(e) {
|
|
121
|
+
return e != null && typeof e == "object";
|
|
122
|
+
}
|
|
123
|
+
var nr = Array.isArray, S = nr;
|
|
124
|
+
function Pe(e) {
|
|
125
|
+
var t = typeof e;
|
|
126
|
+
return e != null && (t == "object" || t == "function");
|
|
127
|
+
}
|
|
128
|
+
var or = "[object AsyncFunction]", ar = "[object Function]", ir = "[object GeneratorFunction]", sr = "[object Proxy]";
|
|
129
|
+
function De(e) {
|
|
130
|
+
if (!Pe(e))
|
|
131
|
+
return !1;
|
|
132
|
+
var t = O(e);
|
|
133
|
+
return t == ar || t == ir || t == or || t == sr;
|
|
134
|
+
}
|
|
135
|
+
var lr = w["__core-js_shared__"], B = lr, ne = function() {
|
|
136
|
+
var e = /[^.]+$/.exec(B && B.keys && B.keys.IE_PROTO || "");
|
|
137
|
+
return e ? "Symbol(src)_1." + e : "";
|
|
138
|
+
}();
|
|
139
|
+
function cr(e) {
|
|
140
|
+
return !!ne && ne in e;
|
|
141
|
+
}
|
|
142
|
+
var ur = Function.prototype, dr = ur.toString;
|
|
143
|
+
function M(e) {
|
|
144
|
+
if (e != null) {
|
|
145
|
+
try {
|
|
146
|
+
return dr.call(e);
|
|
147
|
+
} catch {
|
|
148
|
+
}
|
|
149
|
+
try {
|
|
150
|
+
return e + "";
|
|
151
|
+
} catch {
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return "";
|
|
155
|
+
}
|
|
156
|
+
var pr = /[\\^$.*+?()[\]{}|]/g, fr = /^\[object .+?Constructor\]$/, gr = Function.prototype, hr = Object.prototype, br = gr.toString, yr = hr.hasOwnProperty, mr = RegExp(
|
|
157
|
+
"^" + br.call(yr).replace(pr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
158
|
+
);
|
|
159
|
+
function vr(e) {
|
|
160
|
+
if (!Pe(e) || cr(e))
|
|
161
|
+
return !1;
|
|
162
|
+
var t = De(e) ? mr : fr;
|
|
163
|
+
return t.test(M(e));
|
|
164
|
+
}
|
|
165
|
+
function xr(e, t) {
|
|
166
|
+
return e == null ? void 0 : e[t];
|
|
167
|
+
}
|
|
168
|
+
function H(e, t) {
|
|
169
|
+
var r = xr(e, t);
|
|
170
|
+
return vr(r) ? r : void 0;
|
|
171
|
+
}
|
|
172
|
+
var Cr = H(w, "WeakMap"), W = Cr, Tr = 9007199254740991;
|
|
173
|
+
function Oe(e) {
|
|
174
|
+
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Tr;
|
|
175
|
+
}
|
|
176
|
+
function Sr(e) {
|
|
177
|
+
return e != null && Oe(e.length) && !De(e);
|
|
178
|
+
}
|
|
179
|
+
var jr = Object.prototype;
|
|
180
|
+
function Me(e) {
|
|
181
|
+
var t = e && e.constructor, r = typeof t == "function" && t.prototype || jr;
|
|
182
|
+
return e === r;
|
|
183
|
+
}
|
|
184
|
+
var $r = "[object Arguments]";
|
|
185
|
+
function oe(e) {
|
|
186
|
+
return G(e) && O(e) == $r;
|
|
187
|
+
}
|
|
188
|
+
var Ee = Object.prototype, kr = Ee.hasOwnProperty, Ar = Ee.propertyIsEnumerable, wr = oe(/* @__PURE__ */ function() {
|
|
189
|
+
return arguments;
|
|
190
|
+
}()) ? oe : function(e) {
|
|
191
|
+
return G(e) && kr.call(e, "callee") && !Ar.call(e, "callee");
|
|
192
|
+
}, Pr = wr;
|
|
193
|
+
function Dr() {
|
|
194
|
+
return !1;
|
|
195
|
+
}
|
|
196
|
+
var Ie = typeof exports == "object" && exports && !exports.nodeType && exports, ae = Ie && typeof module == "object" && module && !module.nodeType && module, Or = ae && ae.exports === Ie, ie = Or ? w.Buffer : void 0, Mr = ie ? ie.isBuffer : void 0, Er = Mr || Dr, Ir = Er, Nr = "[object Arguments]", Lr = "[object Array]", Gr = "[object Boolean]", Hr = "[object Date]", _r = "[object Error]", zr = "[object Function]", Fr = "[object Map]", Rr = "[object Number]", Br = "[object Object]", Kr = "[object RegExp]", Vr = "[object Set]", qr = "[object String]", Ur = "[object WeakMap]", Wr = "[object ArrayBuffer]", Yr = "[object DataView]", Jr = "[object Float32Array]", Xr = "[object Float64Array]", Qr = "[object Int8Array]", Zr = "[object Int16Array]", en = "[object Int32Array]", tn = "[object Uint8Array]", rn = "[object Uint8ClampedArray]", nn = "[object Uint16Array]", on = "[object Uint32Array]", g = {};
|
|
197
|
+
g[Jr] = g[Xr] = g[Qr] = g[Zr] = g[en] = g[tn] = g[rn] = g[nn] = g[on] = !0;
|
|
198
|
+
g[Nr] = g[Lr] = g[Wr] = g[Gr] = g[Yr] = g[Hr] = g[_r] = g[zr] = g[Fr] = g[Rr] = g[Br] = g[Kr] = g[Vr] = g[qr] = g[Ur] = !1;
|
|
199
|
+
function an(e) {
|
|
200
|
+
return G(e) && Oe(e.length) && !!g[O(e)];
|
|
201
|
+
}
|
|
202
|
+
function sn(e) {
|
|
203
|
+
return function(t) {
|
|
204
|
+
return e(t);
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
var Ne = typeof exports == "object" && exports && !exports.nodeType && exports, L = Ne && typeof module == "object" && module && !module.nodeType && module, ln = L && L.exports === Ne, K = ln && Ae.process, cn = function() {
|
|
208
|
+
try {
|
|
209
|
+
var e = L && L.require && L.require("util").types;
|
|
210
|
+
return e || K && K.binding && K.binding("util");
|
|
211
|
+
} catch {
|
|
212
|
+
}
|
|
213
|
+
}(), se = cn, le = se && se.isTypedArray, un = le ? sn(le) : an, dn = un;
|
|
214
|
+
function Le(e, t) {
|
|
215
|
+
return function(r) {
|
|
216
|
+
return e(t(r));
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
var pn = Le(Object.keys, Object), fn = pn, gn = Object.prototype, hn = gn.hasOwnProperty;
|
|
220
|
+
function bn(e) {
|
|
221
|
+
if (!Me(e))
|
|
222
|
+
return fn(e);
|
|
223
|
+
var t = [];
|
|
224
|
+
for (var r in Object(e))
|
|
225
|
+
hn.call(e, r) && r != "constructor" && t.push(r);
|
|
226
|
+
return t;
|
|
227
|
+
}
|
|
228
|
+
var yn = H(w, "Map"), Y = yn, mn = Le(Object.getPrototypeOf, Object), vn = mn, xn = "[object Object]", Cn = Function.prototype, Tn = Object.prototype, Ge = Cn.toString, Sn = Tn.hasOwnProperty, jn = Ge.call(Object);
|
|
229
|
+
function J(e) {
|
|
230
|
+
if (!G(e) || O(e) != xn)
|
|
231
|
+
return !1;
|
|
232
|
+
var t = vn(e);
|
|
233
|
+
if (t === null)
|
|
234
|
+
return !0;
|
|
235
|
+
var r = Sn.call(t, "constructor") && t.constructor;
|
|
236
|
+
return typeof r == "function" && r instanceof r && Ge.call(r) == jn;
|
|
237
|
+
}
|
|
238
|
+
var $n = H(w, "DataView"), X = $n, kn = H(w, "Promise"), Q = kn, An = H(w, "Set"), Z = An, ce = "[object Map]", wn = "[object Object]", ue = "[object Promise]", de = "[object Set]", pe = "[object WeakMap]", fe = "[object DataView]", Pn = M(X), Dn = M(Y), On = M(Q), Mn = M(Z), En = M(W), P = O;
|
|
239
|
+
(X && P(new X(new ArrayBuffer(1))) != fe || Y && P(new Y()) != ce || Q && P(Q.resolve()) != ue || Z && P(new Z()) != de || W && P(new W()) != pe) && (P = function(e) {
|
|
240
|
+
var t = O(e), r = t == wn ? e.constructor : void 0, n = r ? M(r) : "";
|
|
241
|
+
if (n)
|
|
242
|
+
switch (n) {
|
|
243
|
+
case Pn:
|
|
244
|
+
return fe;
|
|
245
|
+
case Dn:
|
|
246
|
+
return ce;
|
|
247
|
+
case On:
|
|
248
|
+
return ue;
|
|
249
|
+
case Mn:
|
|
250
|
+
return de;
|
|
251
|
+
case En:
|
|
252
|
+
return pe;
|
|
253
|
+
}
|
|
254
|
+
return t;
|
|
255
|
+
});
|
|
256
|
+
var In = P, Nn = "[object String]";
|
|
257
|
+
function V(e) {
|
|
258
|
+
return typeof e == "string" || !S(e) && G(e) && O(e) == Nn;
|
|
259
|
+
}
|
|
260
|
+
var Ln = "[object Map]", Gn = "[object Set]", Hn = Object.prototype, _n = Hn.hasOwnProperty;
|
|
261
|
+
function zn(e) {
|
|
262
|
+
if (e == null)
|
|
263
|
+
return !0;
|
|
264
|
+
if (Sr(e) && (S(e) || typeof e == "string" || typeof e.splice == "function" || Ir(e) || dn(e) || Pr(e)))
|
|
265
|
+
return !e.length;
|
|
266
|
+
var t = In(e);
|
|
267
|
+
if (t == Ln || t == Gn)
|
|
268
|
+
return !e.size;
|
|
269
|
+
if (Me(e))
|
|
270
|
+
return !bn(e).length;
|
|
271
|
+
for (var r in e)
|
|
272
|
+
if (_n.call(e, r))
|
|
273
|
+
return !1;
|
|
274
|
+
return !0;
|
|
275
|
+
}
|
|
276
|
+
function ge(e) {
|
|
277
|
+
return e.every((t) => S(t));
|
|
278
|
+
}
|
|
279
|
+
function R(e) {
|
|
280
|
+
return !!(!S(e) || e.length === 0 || S(e[0]) && e[0].length === 0);
|
|
281
|
+
}
|
|
282
|
+
function He(e) {
|
|
283
|
+
let t = "";
|
|
284
|
+
return Object.keys(e).map((r) => {
|
|
285
|
+
t += ` ${r}="${e[r].replace(/"/g, '\\"')}"`;
|
|
286
|
+
}), t;
|
|
287
|
+
}
|
|
288
|
+
class Fn {
|
|
289
|
+
constructor() {
|
|
290
|
+
this.type = y.IMAGE;
|
|
291
|
+
}
|
|
292
|
+
toText(t) {
|
|
293
|
+
var r;
|
|
294
|
+
return (r = t.title) != null ? r : "";
|
|
295
|
+
}
|
|
296
|
+
toHtml(t) {
|
|
297
|
+
var r;
|
|
298
|
+
return `<img src="${t.src}" alt="${t.title}" ${He(
|
|
299
|
+
(r = t.attrs) != null ? r : {}
|
|
300
|
+
)}>`;
|
|
301
|
+
}
|
|
302
|
+
parse(t) {
|
|
303
|
+
var r, n;
|
|
304
|
+
return t.title = (r = t.title) != null ? r : "", t.attrs = (n = t.attrs) != null ? n : {}, t;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
class Rn {
|
|
308
|
+
constructor() {
|
|
309
|
+
this.type = y.HYPERLINK;
|
|
310
|
+
}
|
|
311
|
+
toText(t) {
|
|
312
|
+
var r;
|
|
313
|
+
return (r = t.title) != null ? r : "";
|
|
314
|
+
}
|
|
315
|
+
toHtml(t) {
|
|
316
|
+
return `<a href="${t.link}" target="_blank" ${He(
|
|
317
|
+
t.attrs
|
|
318
|
+
)}>${t.title}</a>`;
|
|
319
|
+
}
|
|
320
|
+
parse(t) {
|
|
321
|
+
var r, n;
|
|
322
|
+
return t.title = (r = t.title) != null ? r : "", t.attrs = (n = t.attrs) != null ? n : {}, t;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
class Bn {
|
|
326
|
+
constructor() {
|
|
327
|
+
this.type = y.RICH_TEXT;
|
|
328
|
+
}
|
|
329
|
+
toText(t) {
|
|
330
|
+
return t.plain;
|
|
331
|
+
}
|
|
332
|
+
toHtml(t) {
|
|
333
|
+
return t.value;
|
|
334
|
+
}
|
|
335
|
+
parse(t) {
|
|
336
|
+
return t;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
var y = /* @__PURE__ */ ((e) => (e.PLAIN = "gs-plain-text", e.IMAGE = "gs-image", e.HYPERLINK = "gs-hyperlink", e.RICH_TEXT = "gs-rich-text", e))(y || {});
|
|
340
|
+
const Kn = [
|
|
341
|
+
new Kt(),
|
|
342
|
+
new Fn(),
|
|
343
|
+
new Rn(),
|
|
344
|
+
new Bn()
|
|
345
|
+
];
|
|
346
|
+
var j = /* @__PURE__ */ ((e) => (e.PLAIN = "text/plain", e.HTML = "text/html", e))(j || {});
|
|
347
|
+
class Vn {
|
|
348
|
+
detectRule(t) {
|
|
349
|
+
return !!~t.indexOf("google-sheets-html-origin");
|
|
350
|
+
}
|
|
351
|
+
parser(t) {
|
|
352
|
+
const r = document.createElement("div");
|
|
353
|
+
return r.innerHTML = t, [...r.querySelector("table").querySelector("tbody").childNodes].map((a) => [...a.childNodes].map((i) => this.parseTd(i)));
|
|
354
|
+
}
|
|
355
|
+
getSheetsValue(t) {
|
|
356
|
+
try {
|
|
357
|
+
const r = JSON.parse(t);
|
|
358
|
+
return r[r[1]] ? r[r[1]].replaceAll(" ", " ") : "";
|
|
359
|
+
} catch {
|
|
360
|
+
return "";
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
parseTd(t) {
|
|
364
|
+
var r;
|
|
365
|
+
if (t.dataset.sheetsHyperlink)
|
|
366
|
+
return {
|
|
367
|
+
value: {
|
|
368
|
+
title: this.getSheetsValue(t.dataset.sheetsValue),
|
|
369
|
+
link: t.dataset.sheetsHyperlink
|
|
370
|
+
},
|
|
371
|
+
type: y.HYPERLINK
|
|
372
|
+
};
|
|
373
|
+
if (t.dataset.sheetsTextstyleruns)
|
|
374
|
+
return {
|
|
375
|
+
value: {
|
|
376
|
+
plain: this.getSheetsValue(t.dataset.sheetsValue),
|
|
377
|
+
value: t.innerHTML
|
|
378
|
+
},
|
|
379
|
+
type: y.RICH_TEXT
|
|
380
|
+
};
|
|
381
|
+
if (t.dataset.sheetsValue)
|
|
382
|
+
return {
|
|
383
|
+
value: t.innerHTML.replace(/\<br\>/g, `
|
|
384
|
+
`).trim(),
|
|
385
|
+
type: y.PLAIN
|
|
386
|
+
};
|
|
387
|
+
if (t.querySelector("img")) {
|
|
388
|
+
const n = t.querySelector("img");
|
|
389
|
+
return {
|
|
390
|
+
value: {
|
|
391
|
+
src: n.src,
|
|
392
|
+
title: (r = n.title) != null ? r : ""
|
|
393
|
+
},
|
|
394
|
+
type: y.IMAGE
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
return {
|
|
398
|
+
value: t.innerText,
|
|
399
|
+
type: y.PLAIN
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
const q = [new Vn()];
|
|
404
|
+
function qn(e) {
|
|
405
|
+
for (let t = 0; t < q.length; t++)
|
|
406
|
+
if (q[t].detectRule(e)) {
|
|
407
|
+
const r = q[t].parser(e);
|
|
408
|
+
if (!R(r))
|
|
409
|
+
return r;
|
|
410
|
+
}
|
|
411
|
+
return [];
|
|
412
|
+
}
|
|
413
|
+
class Un {
|
|
414
|
+
static parse(t) {
|
|
415
|
+
const r = document.createElement("div");
|
|
416
|
+
r.innerHTML = t;
|
|
417
|
+
const n = r.childNodes[0];
|
|
418
|
+
if (!n)
|
|
419
|
+
return !1;
|
|
420
|
+
if (n.dataset.sheetsHyperlink)
|
|
421
|
+
return {
|
|
422
|
+
value: {
|
|
423
|
+
link: n.dataset.sheetsHyperlink,
|
|
424
|
+
title: n.innerText
|
|
425
|
+
},
|
|
426
|
+
type: y.HYPERLINK
|
|
427
|
+
};
|
|
428
|
+
if (n.tagName === "A")
|
|
429
|
+
return {
|
|
430
|
+
value: {
|
|
431
|
+
link: n.getAttribute("href"),
|
|
432
|
+
title: n.innerText
|
|
433
|
+
},
|
|
434
|
+
type: y.HYPERLINK
|
|
435
|
+
};
|
|
436
|
+
const a = n.childNodes[0];
|
|
437
|
+
return a && n.childNodes.length === 1 && a.tagName === "IMG" ? {
|
|
438
|
+
value: {
|
|
439
|
+
link: a.getAttribute("src"),
|
|
440
|
+
title: a.title
|
|
441
|
+
},
|
|
442
|
+
type: y.IMAGE
|
|
443
|
+
} : n.tagName === "IMG" ? {
|
|
444
|
+
value: {
|
|
445
|
+
link: n.getAttribute("src"),
|
|
446
|
+
title: n.title
|
|
447
|
+
},
|
|
448
|
+
type: y.IMAGE
|
|
449
|
+
} : !1;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
class Wn {
|
|
453
|
+
constructor() {
|
|
454
|
+
this.handles = {}, this.props = {}, this.evenHandles = {};
|
|
455
|
+
}
|
|
456
|
+
destroy() {
|
|
457
|
+
this.handles = {};
|
|
458
|
+
}
|
|
459
|
+
registerHandler(t) {
|
|
460
|
+
[...t, ...Kn].map((r) => {
|
|
461
|
+
this.handles[r.type] = r;
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
formatSetCopyData(t) {
|
|
465
|
+
return V(t) ? [
|
|
466
|
+
[
|
|
467
|
+
{
|
|
468
|
+
value: t,
|
|
469
|
+
payload: void 0,
|
|
470
|
+
type: this.handles[y.PLAIN].type
|
|
471
|
+
}
|
|
472
|
+
]
|
|
473
|
+
] : J(t) ? [[t]] : S(t) ? (ge(t) || (t = [
|
|
474
|
+
t.map((r) => V(r) ? {
|
|
475
|
+
value: r,
|
|
476
|
+
payload: "",
|
|
477
|
+
type: this.handles[y.PLAIN].type
|
|
478
|
+
} : r)
|
|
479
|
+
]), t = t.map(
|
|
480
|
+
(r) => r.map((n) => V(n) ? {
|
|
481
|
+
value: n,
|
|
482
|
+
type: this.handles[y.PLAIN].type,
|
|
483
|
+
payload: ""
|
|
484
|
+
} : n)
|
|
485
|
+
), t) : (console.error("unknown data type", t), []);
|
|
486
|
+
}
|
|
487
|
+
getTextData(t) {
|
|
488
|
+
let r = "";
|
|
489
|
+
return t.map((n, a) => {
|
|
490
|
+
n.map((i, u) => {
|
|
491
|
+
var p;
|
|
492
|
+
const { value: c, type: s, payload: b } = i;
|
|
493
|
+
r += ((p = this.handles[s]) != null ? p : this.handles[y.PLAIN]).toText(c, b), r += u < n.length - 1 ? " " : "";
|
|
494
|
+
}), r += a < t.length - 1 ? `
|
|
495
|
+
` : "";
|
|
496
|
+
}), r;
|
|
497
|
+
}
|
|
498
|
+
getHtmlData(t) {
|
|
499
|
+
var r;
|
|
500
|
+
let n = "";
|
|
501
|
+
if (t.length === 1 && t[0].length === 1) {
|
|
502
|
+
const { type: a, value: i, payload: u } = t[0][0];
|
|
503
|
+
return ((r = this.handles[a]) != null ? r : this.handles[y.PLAIN]).toHtml(i, u);
|
|
504
|
+
}
|
|
505
|
+
return t.map((a, i) => {
|
|
506
|
+
n += "<tr>", a.map((u, p) => {
|
|
507
|
+
var c;
|
|
508
|
+
const { value: s, type: b, payload: x } = u;
|
|
509
|
+
n += `<td>${((c = this.handles[b]) != null ? c : this.handles[y.PLAIN]).toHtml(s, x)}</td>`;
|
|
510
|
+
}), n += "</tr>";
|
|
511
|
+
}), `<table id="gs-clipboard-table"><tbody>${n}</tbody></table>`;
|
|
512
|
+
}
|
|
513
|
+
async formatClipboardData(t) {
|
|
514
|
+
const r = {
|
|
515
|
+
text: "",
|
|
516
|
+
html: "",
|
|
517
|
+
clipboardType: []
|
|
518
|
+
};
|
|
519
|
+
if (!t.types.includes(j.HTML)) {
|
|
520
|
+
const b = await (await t.getType(j.PLAIN)).text();
|
|
521
|
+
return r.text = b, r.html = b, r.clipboardType = [
|
|
522
|
+
[
|
|
523
|
+
{
|
|
524
|
+
value: b,
|
|
525
|
+
type: this.handles[y.PLAIN].type
|
|
526
|
+
}
|
|
527
|
+
]
|
|
528
|
+
], r;
|
|
529
|
+
}
|
|
530
|
+
const n = await t.getType(j.HTML), a = await t.getType(j.PLAIN), i = await n.text(), u = await a.text(), p = document.createElement("div");
|
|
531
|
+
p.innerHTML = i;
|
|
532
|
+
const c = p.querySelector(
|
|
533
|
+
"#original-data"
|
|
534
|
+
);
|
|
535
|
+
if (p.querySelector("#gs-clipboard-table") || c)
|
|
536
|
+
r.text = u, r.html = i, r.clipboardType = JSON.parse(
|
|
537
|
+
decodeURIComponent(c.dataset.data)
|
|
538
|
+
);
|
|
539
|
+
else if (p.querySelector("table")) {
|
|
540
|
+
r.text = u, r.html = i;
|
|
541
|
+
let s = [];
|
|
542
|
+
if (this.props.tableParsers.length > 0) {
|
|
543
|
+
for (let b = 0; b < this.props.tableParsers.length; b++)
|
|
544
|
+
if (this.props.tableParsers[b].detectRule(i)) {
|
|
545
|
+
const x = this.props.tableParsers[b].parser(i);
|
|
546
|
+
if (!R(x)) {
|
|
547
|
+
s = x;
|
|
548
|
+
break;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
(zn(s) || R(s)) && (s = qn(i)), r.clipboardType = s;
|
|
553
|
+
} else {
|
|
554
|
+
let s = null;
|
|
555
|
+
this.props.unknownHtmlParser && (s = this.props.unknownHtmlParser(i)), s = s || Un.parse(i), s || (s = {
|
|
556
|
+
value: u,
|
|
557
|
+
type: this.handles[y.PLAIN].type
|
|
558
|
+
}), r.text = u, r.html = i, J(s) && (r.clipboardType = [[s]]), S(s) && (ge(s) ? r.clipboardType = s : r.clipboardType = [s]);
|
|
559
|
+
}
|
|
560
|
+
return r;
|
|
561
|
+
}
|
|
562
|
+
getClipboardTypeData(t) {
|
|
563
|
+
return t;
|
|
564
|
+
}
|
|
565
|
+
on(t, r) {
|
|
566
|
+
return S(this.evenHandles[t]) || (this.evenHandles[t] = []), this.evenHandles[t].push(r), () => {
|
|
567
|
+
this.evenHandles[t].splice(
|
|
568
|
+
this.evenHandles[t].indexOf(r),
|
|
569
|
+
1
|
|
570
|
+
);
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
trigger(t, ...r) {
|
|
574
|
+
if (S(this.evenHandles[t]))
|
|
575
|
+
for (let n = 0; n < this.evenHandles[t].length; n++) {
|
|
576
|
+
const a = this.evenHandles[t][n];
|
|
577
|
+
a(...r);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
const Yn = {
|
|
582
|
+
handlers: [],
|
|
583
|
+
tableParsers: []
|
|
584
|
+
};
|
|
585
|
+
class Jn extends Wn {
|
|
586
|
+
constructor(t = {}) {
|
|
587
|
+
var r, n;
|
|
588
|
+
if (super(), (n = (r = window.navigator) == null ? void 0 : r.clipboard) != null && n.read)
|
|
589
|
+
this.props = Object.assign(Yn, t), this.registerHandler(this.props.handlers);
|
|
590
|
+
else
|
|
591
|
+
throw new Error("You browser didn't support clipboard api!");
|
|
592
|
+
}
|
|
593
|
+
async getDataFromClipboard() {
|
|
594
|
+
return new Promise((t, r) => {
|
|
595
|
+
window.navigator.clipboard.read().then(
|
|
596
|
+
async (n) => {
|
|
597
|
+
const a = n[0];
|
|
598
|
+
t(
|
|
599
|
+
this.transformClipboardData(await this.formatClipboardData(a))
|
|
600
|
+
);
|
|
601
|
+
},
|
|
602
|
+
(n) => r(n)
|
|
603
|
+
);
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
setCopy(t) {
|
|
607
|
+
return this.setCopyData(this.formatSetCopyData(t), !1);
|
|
608
|
+
}
|
|
609
|
+
formatCopyData(t) {
|
|
610
|
+
return this.setCopyData(this.formatSetCopyData(t), !0);
|
|
611
|
+
}
|
|
612
|
+
transformClipboardData(t) {
|
|
613
|
+
return R(t.clipboardType) || t.clipboardType.map((r) => {
|
|
614
|
+
S(r) ? r.map((n) => {
|
|
615
|
+
n.value = this.handles[n.type] ? this.handles[n.type].parse(n.value) : n.value;
|
|
616
|
+
}) : J(r) && (r.value = this.handles[r.type] ? this.handles[r.type].parse(r.value) : r.value);
|
|
617
|
+
}), t;
|
|
618
|
+
}
|
|
619
|
+
setCopyData(t, r = !1) {
|
|
620
|
+
const n = {
|
|
621
|
+
text: this.getTextData(t),
|
|
622
|
+
html: this.getHtmlData(t),
|
|
623
|
+
clipboardType: this.getClipboardTypeData(t)
|
|
624
|
+
};
|
|
625
|
+
if (r)
|
|
626
|
+
return n;
|
|
627
|
+
this.trigger("beforeCopy", n);
|
|
628
|
+
const a = [
|
|
629
|
+
new ClipboardItem({
|
|
630
|
+
[j.PLAIN]: new Blob([n.text], {
|
|
631
|
+
type: j.PLAIN
|
|
632
|
+
}),
|
|
633
|
+
[j.HTML]: new Blob(
|
|
634
|
+
[
|
|
635
|
+
n.html + `<div id="original-data" data-data="${encodeURIComponent(
|
|
636
|
+
JSON.stringify(n.clipboardType)
|
|
637
|
+
)}"></div>`
|
|
638
|
+
],
|
|
639
|
+
{
|
|
640
|
+
type: j.HTML
|
|
641
|
+
}
|
|
642
|
+
)
|
|
643
|
+
})
|
|
644
|
+
];
|
|
645
|
+
return window.navigator.clipboard.write(a).then(
|
|
646
|
+
() => this.trigger("copySucceeded", a),
|
|
647
|
+
(i) => this.trigger("copyFailed", i)
|
|
648
|
+
), n;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
const Xn = new Jn(), Qn = ({
|
|
87
652
|
data: e = [],
|
|
88
|
-
onChange:
|
|
653
|
+
onChange: t = () => {
|
|
89
654
|
},
|
|
90
|
-
tableHeight:
|
|
91
|
-
limitation:
|
|
655
|
+
tableHeight: r = "460px",
|
|
656
|
+
limitation: n = {}
|
|
92
657
|
}) => {
|
|
93
|
-
const { messageApi:
|
|
94
|
-
function c(
|
|
95
|
-
const
|
|
96
|
-
e[
|
|
658
|
+
const { messageApi: a } = me(ke), { title: i = 15, content: u = 2e3 } = n, { t: p } = I();
|
|
659
|
+
function c(l) {
|
|
660
|
+
const f = e.findIndex((d) => d.label === l.label);
|
|
661
|
+
e[f] = l, t([...e]);
|
|
97
662
|
}
|
|
98
|
-
function
|
|
99
|
-
const
|
|
663
|
+
function s() {
|
|
664
|
+
const l = [
|
|
100
665
|
{
|
|
101
666
|
label: `#${e.length + 1}`,
|
|
102
667
|
content: ""
|
|
103
668
|
},
|
|
104
669
|
...e
|
|
105
670
|
];
|
|
106
|
-
|
|
671
|
+
t(l), a.success(p("createSuccessfully"));
|
|
672
|
+
}
|
|
673
|
+
function b(l) {
|
|
674
|
+
const f = e.filter((d) => d.label !== l);
|
|
675
|
+
t(f);
|
|
107
676
|
}
|
|
108
|
-
function x(
|
|
109
|
-
const
|
|
110
|
-
|
|
677
|
+
async function x() {
|
|
678
|
+
const d = [...(await Xn.getDataFromClipboard()).clipboardType.map((m) => {
|
|
679
|
+
var A, v;
|
|
680
|
+
return {
|
|
681
|
+
label: ((A = m == null ? void 0 : m[0]) == null ? void 0 : A.value) ?? "",
|
|
682
|
+
content: ((v = m == null ? void 0 : m[1]) == null ? void 0 : v.value) ?? ""
|
|
683
|
+
};
|
|
684
|
+
}).filter((m) => m.label && m.content), ...e];
|
|
685
|
+
t(It(d, "label"));
|
|
111
686
|
}
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
-
|
|
687
|
+
return /* @__PURE__ */ h(
|
|
688
|
+
_,
|
|
114
689
|
{
|
|
115
690
|
bordered: !0,
|
|
116
691
|
dataSource: e,
|
|
@@ -118,11 +693,11 @@ const qe = ({
|
|
|
118
693
|
rowKey: "label",
|
|
119
694
|
size: "small",
|
|
120
695
|
scroll: {
|
|
121
|
-
y:
|
|
696
|
+
y: r,
|
|
122
697
|
x: !0
|
|
123
698
|
},
|
|
124
699
|
locale: {
|
|
125
|
-
emptyText: () => /* @__PURE__ */
|
|
700
|
+
emptyText: () => /* @__PURE__ */ h(
|
|
126
701
|
C,
|
|
127
702
|
{
|
|
128
703
|
direction: "vertical",
|
|
@@ -133,40 +708,51 @@ const qe = ({
|
|
|
133
708
|
padding: "62px 0px"
|
|
134
709
|
},
|
|
135
710
|
children: [
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ o(Se, {}),
|
|
712
|
+
/* @__PURE__ */ o(T, { type: "primary", onClick: s, children: p("create") })
|
|
138
713
|
]
|
|
139
714
|
}
|
|
140
715
|
)
|
|
141
716
|
},
|
|
142
|
-
footer: () => /* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
/* @__PURE__ */
|
|
717
|
+
footer: () => /* @__PURE__ */ h(z, { style: { width: "100%" }, justify: "space-between", children: [
|
|
718
|
+
/* @__PURE__ */ o(C, { children: /* @__PURE__ */ o("div", {}) }),
|
|
719
|
+
/* @__PURE__ */ h(C, { size: 12, children: [
|
|
720
|
+
/* @__PURE__ */ o(
|
|
721
|
+
T,
|
|
722
|
+
{
|
|
723
|
+
block: !0,
|
|
724
|
+
type: "text",
|
|
725
|
+
onClick: x,
|
|
726
|
+
children: p("importFromClipboard")
|
|
727
|
+
}
|
|
728
|
+
),
|
|
729
|
+
/* @__PURE__ */ o(T, { type: "primary", onClick: s, children: p("create") })
|
|
730
|
+
] })
|
|
145
731
|
] }),
|
|
146
732
|
children: [
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
|
|
733
|
+
/* @__PURE__ */ o(
|
|
734
|
+
_.Column,
|
|
149
735
|
{
|
|
150
|
-
title:
|
|
736
|
+
title: p("titleFieldName"),
|
|
151
737
|
dataIndex: "label",
|
|
152
738
|
width: 400,
|
|
153
|
-
render: (
|
|
154
|
-
|
|
739
|
+
render: (l, f) => /* @__PURE__ */ o(
|
|
740
|
+
he,
|
|
155
741
|
{
|
|
156
|
-
maxLength:
|
|
742
|
+
maxLength: i,
|
|
157
743
|
type: "input",
|
|
158
|
-
value:
|
|
159
|
-
onChange: (
|
|
160
|
-
if (
|
|
161
|
-
if (e.find((
|
|
162
|
-
|
|
744
|
+
value: l,
|
|
745
|
+
onChange: (d) => {
|
|
746
|
+
if (f.label !== d) {
|
|
747
|
+
if (e.find((m) => m.label === d)) {
|
|
748
|
+
a.error(p("cannotSavedMessageCuzLabelExisted"));
|
|
163
749
|
return;
|
|
164
750
|
}
|
|
165
|
-
if (
|
|
166
|
-
|
|
751
|
+
if (d.trim() === "") {
|
|
752
|
+
a.error(p("cannotSavedMessageCuzLabelEmpty"));
|
|
167
753
|
return;
|
|
168
754
|
}
|
|
169
|
-
|
|
755
|
+
f.label = d, c(f);
|
|
170
756
|
}
|
|
171
757
|
}
|
|
172
758
|
}
|
|
@@ -174,44 +760,44 @@ const qe = ({
|
|
|
174
760
|
},
|
|
175
761
|
"label"
|
|
176
762
|
),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
|
|
763
|
+
/* @__PURE__ */ o(
|
|
764
|
+
_.Column,
|
|
179
765
|
{
|
|
180
|
-
title:
|
|
766
|
+
title: p("content"),
|
|
181
767
|
dataIndex: "content",
|
|
182
768
|
width: 400,
|
|
183
|
-
render: (
|
|
184
|
-
|
|
769
|
+
render: (l, f) => /* @__PURE__ */ o(
|
|
770
|
+
he,
|
|
185
771
|
{
|
|
186
772
|
maxLength: u,
|
|
187
773
|
type: "textarea",
|
|
188
|
-
value:
|
|
189
|
-
onChange: (
|
|
190
|
-
if (
|
|
191
|
-
|
|
774
|
+
value: l,
|
|
775
|
+
onChange: (d) => {
|
|
776
|
+
if (d.trim() === "") {
|
|
777
|
+
a.error(p("cannotSavedMessageCuzContentEmpty"));
|
|
192
778
|
return;
|
|
193
779
|
}
|
|
194
|
-
|
|
780
|
+
f.content = d, c(f);
|
|
195
781
|
}
|
|
196
782
|
}
|
|
197
783
|
)
|
|
198
784
|
},
|
|
199
785
|
"content"
|
|
200
786
|
),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
|
|
787
|
+
/* @__PURE__ */ o(
|
|
788
|
+
_.Column,
|
|
203
789
|
{
|
|
204
790
|
title: "操作",
|
|
205
791
|
dataIndex: "id",
|
|
206
792
|
width: 120,
|
|
207
|
-
render: (
|
|
208
|
-
|
|
793
|
+
render: (l, f) => /* @__PURE__ */ o(C, { size: 4, children: /* @__PURE__ */ o(
|
|
794
|
+
T,
|
|
209
795
|
{
|
|
210
796
|
size: "small",
|
|
211
797
|
type: "text",
|
|
212
798
|
danger: !0,
|
|
213
|
-
onClick: () =>
|
|
214
|
-
children:
|
|
799
|
+
onClick: () => b(f.label),
|
|
800
|
+
children: p("delete")
|
|
215
801
|
}
|
|
216
802
|
) })
|
|
217
803
|
},
|
|
@@ -220,7 +806,7 @@ const qe = ({
|
|
|
220
806
|
]
|
|
221
807
|
}
|
|
222
808
|
);
|
|
223
|
-
},
|
|
809
|
+
}, Zn = k.div`
|
|
224
810
|
border: 1px solid transparent;
|
|
225
811
|
padding: 0 4px;
|
|
226
812
|
margin: 0 -4px;
|
|
@@ -231,29 +817,29 @@ const qe = ({
|
|
|
231
817
|
border-color: ${(e) => e.$isDark ? "#4d4848" : "#c0bbbb"};
|
|
232
818
|
}
|
|
233
819
|
`;
|
|
234
|
-
function
|
|
235
|
-
const [
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}, [
|
|
239
|
-
function
|
|
240
|
-
|
|
820
|
+
function he(e) {
|
|
821
|
+
const [t, r] = $(!1), n = xe(null), a = je();
|
|
822
|
+
E(() => {
|
|
823
|
+
t && n.current && (e.type === "input" ? n.current.select() : n.current.focus());
|
|
824
|
+
}, [t, e.type]);
|
|
825
|
+
function i() {
|
|
826
|
+
r(!0);
|
|
241
827
|
}
|
|
242
828
|
function u(c) {
|
|
243
|
-
|
|
829
|
+
r(!1), e.onChange(c);
|
|
244
830
|
}
|
|
245
|
-
function
|
|
246
|
-
e.onChange(c),
|
|
831
|
+
function p(c) {
|
|
832
|
+
e.onChange(c), n.current.blur();
|
|
247
833
|
}
|
|
248
|
-
if (
|
|
834
|
+
if (t) {
|
|
249
835
|
if (e.type === "textarea")
|
|
250
|
-
return /* @__PURE__ */
|
|
251
|
-
|
|
836
|
+
return /* @__PURE__ */ o("div", { style: { paddingBottom: 18 }, children: /* @__PURE__ */ o(
|
|
837
|
+
U.TextArea,
|
|
252
838
|
{
|
|
253
839
|
showCount: !0,
|
|
254
840
|
maxLength: e.maxLength,
|
|
255
841
|
defaultValue: e.value,
|
|
256
|
-
ref:
|
|
842
|
+
ref: n,
|
|
257
843
|
size: "small",
|
|
258
844
|
style: { width: "100%" },
|
|
259
845
|
autoSize: { minRows: 4, maxRows: 4 },
|
|
@@ -264,32 +850,32 @@ function A(e) {
|
|
|
264
850
|
return;
|
|
265
851
|
{
|
|
266
852
|
c.preventDefault();
|
|
267
|
-
const
|
|
268
|
-
return
|
|
853
|
+
const s = c.target;
|
|
854
|
+
return p(s.value), !1;
|
|
269
855
|
}
|
|
270
856
|
}
|
|
271
857
|
}
|
|
272
858
|
}
|
|
273
859
|
) });
|
|
274
860
|
if (e.type === "input")
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
-
|
|
861
|
+
return /* @__PURE__ */ o(
|
|
862
|
+
U,
|
|
277
863
|
{
|
|
278
864
|
showCount: !0,
|
|
279
865
|
maxLength: e.maxLength,
|
|
280
866
|
defaultValue: e.value,
|
|
281
|
-
ref:
|
|
867
|
+
ref: n,
|
|
282
868
|
size: "small",
|
|
283
869
|
style: { width: "100%" },
|
|
284
870
|
onBlur: (c) => u(c.target.value),
|
|
285
871
|
onPressEnter: (c) => {
|
|
286
|
-
const
|
|
287
|
-
|
|
872
|
+
const s = c.target;
|
|
873
|
+
p(s.value);
|
|
288
874
|
}
|
|
289
875
|
}
|
|
290
876
|
);
|
|
291
877
|
}
|
|
292
|
-
return /* @__PURE__ */
|
|
878
|
+
return /* @__PURE__ */ o(Zn, { onClick: i, $isDark: a, children: /* @__PURE__ */ o(
|
|
293
879
|
"div",
|
|
294
880
|
{
|
|
295
881
|
style: { minHeight: 22 },
|
|
@@ -301,11 +887,11 @@ function A(e) {
|
|
|
301
887
|
}
|
|
302
888
|
) });
|
|
303
889
|
}
|
|
304
|
-
const
|
|
890
|
+
const eo = k.div``, to = k.div`
|
|
305
891
|
min-height: 380px;
|
|
306
|
-
`,
|
|
892
|
+
`, ro = k.span`
|
|
307
893
|
font-size: 12px;
|
|
308
|
-
`,
|
|
894
|
+
`, no = k.div`
|
|
309
895
|
&:hover {
|
|
310
896
|
.ant-btn {
|
|
311
897
|
display: block;
|
|
@@ -314,53 +900,53 @@ const Qe = y.div``, Ve = y.div`
|
|
|
314
900
|
.ant-btn {
|
|
315
901
|
display: none;
|
|
316
902
|
}
|
|
317
|
-
`,
|
|
903
|
+
`, oo = k.div`
|
|
318
904
|
background-color: ${(e) => e.$color};
|
|
319
905
|
width: 12px;
|
|
320
906
|
height: 12px;
|
|
321
907
|
border: 1px solid #fff;
|
|
322
908
|
border-radius: 4px;
|
|
323
|
-
`,
|
|
909
|
+
`, ao = ({
|
|
324
910
|
data: e = [],
|
|
325
|
-
onChange:
|
|
911
|
+
onChange: t = () => {
|
|
326
912
|
},
|
|
327
|
-
...
|
|
913
|
+
...r
|
|
328
914
|
}) => {
|
|
329
|
-
const [
|
|
330
|
-
|
|
331
|
-
e.length > 0 &&
|
|
915
|
+
const [n, a] = $([]), { t: i } = I();
|
|
916
|
+
E(() => {
|
|
917
|
+
e.length > 0 && a([e[0].id]);
|
|
332
918
|
}, []);
|
|
333
|
-
const u =
|
|
334
|
-
key:
|
|
335
|
-
label: /* @__PURE__ */
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
|
|
919
|
+
const u = D(() => e.map((l) => ({
|
|
920
|
+
key: l.id,
|
|
921
|
+
label: /* @__PURE__ */ o(no, { children: /* @__PURE__ */ h(z, { justify: "space-between", align: "center", children: [
|
|
922
|
+
/* @__PURE__ */ h(C, { children: [
|
|
923
|
+
/* @__PURE__ */ o("span", { children: l.title }),
|
|
924
|
+
l.data.length ? /* @__PURE__ */ h(ro, { children: [
|
|
339
925
|
"(",
|
|
340
|
-
|
|
926
|
+
l.data.length,
|
|
341
927
|
")"
|
|
342
928
|
] }) : null
|
|
343
929
|
] }),
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
|
|
930
|
+
/* @__PURE__ */ h(C, { size: 8, children: [
|
|
931
|
+
/* @__PURE__ */ o(oo, { $color: l.color }),
|
|
932
|
+
/* @__PURE__ */ o(
|
|
933
|
+
io,
|
|
348
934
|
{
|
|
349
|
-
data:
|
|
350
|
-
onSaved: (
|
|
935
|
+
data: l,
|
|
936
|
+
onSaved: (f) => c(l.id, f)
|
|
351
937
|
}
|
|
352
938
|
),
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
-
|
|
939
|
+
/* @__PURE__ */ o(
|
|
940
|
+
kt,
|
|
355
941
|
{
|
|
356
|
-
title:
|
|
357
|
-
onConfirm: () =>
|
|
358
|
-
children: /* @__PURE__ */
|
|
359
|
-
|
|
942
|
+
title: i("confirmDelete"),
|
|
943
|
+
onConfirm: () => s(l.id),
|
|
944
|
+
children: /* @__PURE__ */ o(
|
|
945
|
+
T,
|
|
360
946
|
{
|
|
361
947
|
danger: !0,
|
|
362
948
|
size: "small",
|
|
363
|
-
icon: /* @__PURE__ */
|
|
949
|
+
icon: /* @__PURE__ */ o(Nt, {}),
|
|
364
950
|
type: "text"
|
|
365
951
|
}
|
|
366
952
|
)
|
|
@@ -368,216 +954,216 @@ const Qe = y.div``, Ve = y.div`
|
|
|
368
954
|
)
|
|
369
955
|
] })
|
|
370
956
|
] }) })
|
|
371
|
-
})), [e]),
|
|
372
|
-
const
|
|
373
|
-
if (
|
|
374
|
-
const
|
|
375
|
-
if (
|
|
376
|
-
return
|
|
957
|
+
})), [e]), p = D(() => {
|
|
958
|
+
const l = n[0];
|
|
959
|
+
if (l) {
|
|
960
|
+
const f = e.find((d) => d.id === l);
|
|
961
|
+
if (f)
|
|
962
|
+
return f.data;
|
|
377
963
|
}
|
|
378
964
|
return !1;
|
|
379
|
-
}, [
|
|
380
|
-
function c(
|
|
381
|
-
const
|
|
382
|
-
~
|
|
383
|
-
...
|
|
384
|
-
...
|
|
385
|
-
}),
|
|
386
|
-
}
|
|
387
|
-
function
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
}
|
|
391
|
-
function
|
|
392
|
-
const
|
|
393
|
-
if (
|
|
394
|
-
const
|
|
395
|
-
|
|
965
|
+
}, [n, e]);
|
|
966
|
+
function c(l, f) {
|
|
967
|
+
const d = [...e], m = d.findIndex((A) => A.id === l);
|
|
968
|
+
~m && (d[m] = {
|
|
969
|
+
...d[m],
|
|
970
|
+
...f
|
|
971
|
+
}), t(d);
|
|
972
|
+
}
|
|
973
|
+
function s(l) {
|
|
974
|
+
const f = [...e].filter((d) => d.id !== l);
|
|
975
|
+
t(f);
|
|
976
|
+
}
|
|
977
|
+
function b(l) {
|
|
978
|
+
const f = [...e], d = n[0];
|
|
979
|
+
if (d) {
|
|
980
|
+
const m = f.find((A) => A.id === d);
|
|
981
|
+
m && (m.data = l);
|
|
396
982
|
}
|
|
397
|
-
|
|
398
|
-
}
|
|
399
|
-
function
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
id:
|
|
403
|
-
color:
|
|
404
|
-
title:
|
|
983
|
+
t(f);
|
|
984
|
+
}
|
|
985
|
+
function x(l) {
|
|
986
|
+
const f = Bt(), d = [...e];
|
|
987
|
+
d.push({
|
|
988
|
+
id: f,
|
|
989
|
+
color: l.color,
|
|
990
|
+
title: l.title,
|
|
405
991
|
data: []
|
|
406
|
-
}),
|
|
407
|
-
}
|
|
408
|
-
return u.length === 0 ? /* @__PURE__ */
|
|
409
|
-
/* @__PURE__ */
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
] }) : /* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
-
|
|
992
|
+
}), t(d), a([f]);
|
|
993
|
+
}
|
|
994
|
+
return u.length === 0 ? /* @__PURE__ */ h(z, { vertical: !0, align: "center", gap: 8, children: [
|
|
995
|
+
/* @__PURE__ */ o(Se, { description: i("noData") }),
|
|
996
|
+
/* @__PURE__ */ o(be, { onCreate: x })
|
|
997
|
+
] }) : /* @__PURE__ */ o(eo, { children: /* @__PURE__ */ h(z, { gap: 16, children: [
|
|
998
|
+
/* @__PURE__ */ h(C, { direction: "vertical", children: [
|
|
999
|
+
/* @__PURE__ */ o(to, { children: /* @__PURE__ */ o(
|
|
1000
|
+
At,
|
|
415
1001
|
{
|
|
416
1002
|
items: u,
|
|
417
1003
|
style: { width: 300 },
|
|
418
|
-
selectedKeys:
|
|
419
|
-
onSelect: ({ key:
|
|
420
|
-
|
|
1004
|
+
selectedKeys: n,
|
|
1005
|
+
onSelect: ({ key: l }) => {
|
|
1006
|
+
a([l]);
|
|
421
1007
|
}
|
|
422
1008
|
}
|
|
423
1009
|
) }),
|
|
424
|
-
/* @__PURE__ */
|
|
1010
|
+
/* @__PURE__ */ o(be, { onCreate: x, block: !0 })
|
|
425
1011
|
] }),
|
|
426
|
-
|
|
427
|
-
|
|
1012
|
+
p ? /* @__PURE__ */ o(
|
|
1013
|
+
Qn,
|
|
428
1014
|
{
|
|
429
|
-
data:
|
|
430
|
-
onChange:
|
|
431
|
-
...
|
|
1015
|
+
data: p,
|
|
1016
|
+
onChange: b,
|
|
1017
|
+
...r
|
|
432
1018
|
}
|
|
433
|
-
) : /* @__PURE__ */
|
|
434
|
-
|
|
1019
|
+
) : /* @__PURE__ */ o(
|
|
1020
|
+
wt,
|
|
435
1021
|
{
|
|
436
1022
|
type: "info",
|
|
437
|
-
message:
|
|
1023
|
+
message: i("selectAGroupFirst"),
|
|
438
1024
|
style: { height: 60, minWidth: 400 }
|
|
439
1025
|
}
|
|
440
1026
|
)
|
|
441
1027
|
] }) });
|
|
442
1028
|
};
|
|
443
|
-
function
|
|
444
|
-
const [
|
|
445
|
-
return /* @__PURE__ */
|
|
446
|
-
|
|
1029
|
+
function io(e) {
|
|
1030
|
+
const [t, r] = $({ title: "", color: "" });
|
|
1031
|
+
return /* @__PURE__ */ o(
|
|
1032
|
+
_e,
|
|
447
1033
|
{
|
|
448
1034
|
isEdit: !1,
|
|
449
1035
|
onCompleteChange: e.onSaved,
|
|
450
|
-
data:
|
|
451
|
-
onOpenChange: (
|
|
452
|
-
|
|
1036
|
+
data: t,
|
|
1037
|
+
onOpenChange: (n) => {
|
|
1038
|
+
n && r(e.data);
|
|
453
1039
|
},
|
|
454
|
-
onDataChange: (
|
|
455
|
-
children: /* @__PURE__ */
|
|
1040
|
+
onDataChange: (n) => r(n),
|
|
1041
|
+
children: /* @__PURE__ */ o(T, { size: "small", icon: /* @__PURE__ */ o(Lt, {}), type: "text" })
|
|
456
1042
|
}
|
|
457
1043
|
);
|
|
458
1044
|
}
|
|
459
|
-
function
|
|
460
|
-
const { t
|
|
1045
|
+
function be(e) {
|
|
1046
|
+
const { t } = I(), r = {
|
|
461
1047
|
title: "",
|
|
462
1048
|
color: "#1677FF"
|
|
463
|
-
}, [
|
|
464
|
-
...
|
|
1049
|
+
}, [n, a] = $({
|
|
1050
|
+
...r
|
|
465
1051
|
});
|
|
466
|
-
return /* @__PURE__ */
|
|
467
|
-
|
|
1052
|
+
return /* @__PURE__ */ o(
|
|
1053
|
+
_e,
|
|
468
1054
|
{
|
|
469
1055
|
isEdit: !1,
|
|
470
1056
|
onCompleteChange: e.onCreate,
|
|
471
|
-
data:
|
|
472
|
-
onOpenChange: (
|
|
473
|
-
|
|
474
|
-
...
|
|
1057
|
+
data: n,
|
|
1058
|
+
onOpenChange: (i) => {
|
|
1059
|
+
i && a({
|
|
1060
|
+
...r
|
|
475
1061
|
});
|
|
476
1062
|
},
|
|
477
|
-
onDataChange: (
|
|
478
|
-
children: /* @__PURE__ */
|
|
1063
|
+
onDataChange: (i) => a(i),
|
|
1064
|
+
children: /* @__PURE__ */ o(T, { block: !!e.block, icon: /* @__PURE__ */ o(Gt, {}), children: t("addNewGroup") })
|
|
479
1065
|
}
|
|
480
1066
|
);
|
|
481
1067
|
}
|
|
482
|
-
function
|
|
483
|
-
const [
|
|
484
|
-
|
|
485
|
-
e.onOpenChange(
|
|
486
|
-
}, [
|
|
487
|
-
|
|
488
|
-
var
|
|
489
|
-
(
|
|
490
|
-
}, 300)) :
|
|
1068
|
+
function _e(e) {
|
|
1069
|
+
const [t, r] = $(!1), [n, a] = $(""), i = xe(null), { t: u } = I();
|
|
1070
|
+
E(() => {
|
|
1071
|
+
e.onOpenChange(t);
|
|
1072
|
+
}, [t]), E(() => {
|
|
1073
|
+
t ? (a(e.data.color), setTimeout(() => {
|
|
1074
|
+
var s;
|
|
1075
|
+
(s = i.current) == null || s.focus();
|
|
1076
|
+
}, 300)) : a("");
|
|
491
1077
|
}, [e.data]);
|
|
492
|
-
function
|
|
1078
|
+
function p() {
|
|
493
1079
|
e.data.title.trim().length !== 0 && (e.onCompleteChange({
|
|
494
1080
|
title: e.data.title.trim(),
|
|
495
1081
|
color: e.data.color
|
|
496
|
-
}),
|
|
1082
|
+
}), r(!1));
|
|
497
1083
|
}
|
|
498
|
-
function c(
|
|
1084
|
+
function c(s, b) {
|
|
499
1085
|
e.onDataChange({
|
|
500
1086
|
...e.data,
|
|
501
|
-
[
|
|
1087
|
+
[s]: b
|
|
502
1088
|
});
|
|
503
1089
|
}
|
|
504
|
-
return /* @__PURE__ */
|
|
505
|
-
|
|
1090
|
+
return /* @__PURE__ */ o(ee, { children: /* @__PURE__ */ o(
|
|
1091
|
+
Ce,
|
|
506
1092
|
{
|
|
507
1093
|
title: e.isEdit ? u("editGroup") : u("createGroup"),
|
|
508
|
-
open:
|
|
509
|
-
onOpenChange:
|
|
1094
|
+
open: t,
|
|
1095
|
+
onOpenChange: r,
|
|
510
1096
|
trigger: ["click"],
|
|
511
|
-
content: /* @__PURE__ */
|
|
512
|
-
/* @__PURE__ */
|
|
513
|
-
/* @__PURE__ */
|
|
1097
|
+
content: /* @__PURE__ */ h(C, { direction: "vertical", size: 16, children: [
|
|
1098
|
+
/* @__PURE__ */ h(C, { size: 16, children: [
|
|
1099
|
+
/* @__PURE__ */ h("span", { children: [
|
|
514
1100
|
u("titleFieldName"),
|
|
515
1101
|
":"
|
|
516
1102
|
] }),
|
|
517
|
-
/* @__PURE__ */
|
|
518
|
-
|
|
1103
|
+
/* @__PURE__ */ o(
|
|
1104
|
+
U,
|
|
519
1105
|
{
|
|
520
|
-
ref:
|
|
1106
|
+
ref: i,
|
|
521
1107
|
showCount: !0,
|
|
522
1108
|
maxLength: 20,
|
|
523
1109
|
value: e.data.title,
|
|
524
|
-
onChange: (
|
|
1110
|
+
onChange: (s) => c("title", s.target.value)
|
|
525
1111
|
}
|
|
526
1112
|
)
|
|
527
1113
|
] }),
|
|
528
|
-
/* @__PURE__ */
|
|
529
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ h(C, { size: 16, children: [
|
|
1115
|
+
/* @__PURE__ */ h("span", { children: [
|
|
530
1116
|
u("colorFieldName"),
|
|
531
1117
|
":"
|
|
532
1118
|
] }),
|
|
533
|
-
|
|
534
|
-
|
|
1119
|
+
n && /* @__PURE__ */ o(
|
|
1120
|
+
Pt,
|
|
535
1121
|
{
|
|
536
|
-
value:
|
|
537
|
-
onChange: (
|
|
1122
|
+
value: n,
|
|
1123
|
+
onChange: (s) => a(`#${s.toHex()}`),
|
|
538
1124
|
showText: !0,
|
|
539
|
-
onChangeComplete: (
|
|
540
|
-
c("color", `#${
|
|
1125
|
+
onChangeComplete: (s) => {
|
|
1126
|
+
c("color", `#${s.toHex()}`);
|
|
541
1127
|
}
|
|
542
1128
|
}
|
|
543
1129
|
)
|
|
544
1130
|
] }),
|
|
545
|
-
/* @__PURE__ */
|
|
1131
|
+
/* @__PURE__ */ o(T, { block: !0, type: "primary", onClick: p, children: e.isEdit ? u("create") : u("save") })
|
|
546
1132
|
] }),
|
|
547
1133
|
children: e.children
|
|
548
1134
|
}
|
|
549
1135
|
) });
|
|
550
1136
|
}
|
|
551
|
-
const
|
|
552
|
-
}, children:
|
|
553
|
-
const [
|
|
554
|
-
return
|
|
555
|
-
|
|
556
|
-
}, [e]), /* @__PURE__ */
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
|
|
1137
|
+
const so = ({ open: e, onOpenChange: t = () => {
|
|
1138
|
+
}, children: r, ...n }) => {
|
|
1139
|
+
const [a, i] = $(e), { t: u } = I();
|
|
1140
|
+
return E(() => {
|
|
1141
|
+
i(!!e);
|
|
1142
|
+
}, [e]), /* @__PURE__ */ h(ee, { children: [
|
|
1143
|
+
/* @__PURE__ */ o(
|
|
1144
|
+
Te,
|
|
559
1145
|
{
|
|
560
1146
|
title: u("quickMessageConfigs"),
|
|
561
|
-
open:
|
|
1147
|
+
open: a,
|
|
562
1148
|
onCancel: () => {
|
|
563
|
-
|
|
1149
|
+
i(!1), t(!1);
|
|
564
1150
|
},
|
|
565
1151
|
width: 980,
|
|
566
1152
|
footer: null,
|
|
567
|
-
children: /* @__PURE__ */
|
|
1153
|
+
children: /* @__PURE__ */ o(ao, { ...n })
|
|
568
1154
|
}
|
|
569
1155
|
),
|
|
570
|
-
/* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ o(
|
|
571
1157
|
"span",
|
|
572
1158
|
{
|
|
573
1159
|
onClick: () => {
|
|
574
|
-
|
|
1160
|
+
i(!0), t(!0);
|
|
575
1161
|
},
|
|
576
|
-
children:
|
|
1162
|
+
children: r
|
|
577
1163
|
}
|
|
578
1164
|
)
|
|
579
1165
|
] });
|
|
580
|
-
},
|
|
1166
|
+
}, lo = k.div`
|
|
581
1167
|
font-size: 14px;
|
|
582
1168
|
background: #dae5f8;
|
|
583
1169
|
padding: 0 4px;
|
|
@@ -595,60 +1181,60 @@ const tt = ({ open: e, onOpenChange: n = () => {
|
|
|
595
1181
|
&:active {
|
|
596
1182
|
background-color: #9dbcf3;
|
|
597
1183
|
}
|
|
598
|
-
`,
|
|
1184
|
+
`, co = k.div`
|
|
599
1185
|
min-height: 18px;
|
|
600
|
-
`,
|
|
1186
|
+
`, Eo = ({
|
|
601
1187
|
data: e = [],
|
|
602
|
-
onChange:
|
|
603
|
-
tableHeight:
|
|
604
|
-
limitation:
|
|
605
|
-
displayTitleMaxLength:
|
|
606
|
-
displayMaxLength:
|
|
1188
|
+
onChange: t,
|
|
1189
|
+
tableHeight: r,
|
|
1190
|
+
limitation: n,
|
|
1191
|
+
displayTitleMaxLength: a = 10,
|
|
1192
|
+
displayMaxLength: i = 99,
|
|
607
1193
|
SlotContentPrefixSlot: u,
|
|
608
|
-
SlotContentSuffixSlot:
|
|
1194
|
+
SlotContentSuffixSlot: p,
|
|
609
1195
|
onSelect: c = () => {
|
|
610
1196
|
}
|
|
611
1197
|
}) => {
|
|
612
|
-
const [
|
|
1198
|
+
const [s, b] = $(!1), [x, l] = _t(
|
|
613
1199
|
"__activeGroupId",
|
|
614
1200
|
""
|
|
615
|
-
), { t:
|
|
616
|
-
return /* @__PURE__ */
|
|
617
|
-
|
|
618
|
-
|
|
1201
|
+
), { t: f } = I(), d = D(() => e.find((v) => v.id === x), [x, e]), m = D(() => d ? d.data : [], [d, e]), A = D(() => e.length === 0, [e]);
|
|
1202
|
+
return /* @__PURE__ */ h(ee, { children: [
|
|
1203
|
+
A ? /* @__PURE__ */ o(
|
|
1204
|
+
T,
|
|
619
1205
|
{
|
|
620
1206
|
size: "small",
|
|
621
1207
|
type: "primary",
|
|
622
|
-
onClick: () =>
|
|
623
|
-
children:
|
|
1208
|
+
onClick: () => b(!0),
|
|
1209
|
+
children: f("create")
|
|
624
1210
|
}
|
|
625
|
-
) : /* @__PURE__ */
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
|
|
1211
|
+
) : /* @__PURE__ */ h(C, { size: 2, direction: "vertical", children: [
|
|
1212
|
+
/* @__PURE__ */ o(co, { children: /* @__PURE__ */ o(C, { size: 8, children: m.slice(0, i).map((v) => /* @__PURE__ */ o(
|
|
1213
|
+
Dt,
|
|
628
1214
|
{
|
|
629
|
-
title:
|
|
1215
|
+
title: /* @__PURE__ */ o("span", { style: { fontSize: 12 }, children: v.label }),
|
|
630
1216
|
destroyTooltipOnHide: !0,
|
|
631
|
-
children: /* @__PURE__ */
|
|
632
|
-
|
|
1217
|
+
children: /* @__PURE__ */ h(
|
|
1218
|
+
lo,
|
|
633
1219
|
{
|
|
634
|
-
onClick: (
|
|
635
|
-
|
|
1220
|
+
onClick: (Tt) => {
|
|
1221
|
+
Tt.target.closest("bdi") || c(v);
|
|
636
1222
|
},
|
|
637
1223
|
children: [
|
|
638
|
-
u && /* @__PURE__ */
|
|
1224
|
+
u && /* @__PURE__ */ o("bdi", { children: /* @__PURE__ */ o(
|
|
639
1225
|
u,
|
|
640
1226
|
{
|
|
641
|
-
group:
|
|
642
|
-
message:
|
|
1227
|
+
group: d,
|
|
1228
|
+
message: v
|
|
643
1229
|
}
|
|
644
1230
|
) }),
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
/* @__PURE__ */
|
|
648
|
-
|
|
1231
|
+
$e(v.label, a),
|
|
1232
|
+
p && /* @__PURE__ */ h("bdi", { children: [
|
|
1233
|
+
/* @__PURE__ */ o(
|
|
1234
|
+
p,
|
|
649
1235
|
{
|
|
650
|
-
group:
|
|
651
|
-
message:
|
|
1236
|
+
group: d,
|
|
1237
|
+
message: v
|
|
652
1238
|
}
|
|
653
1239
|
),
|
|
654
1240
|
" "
|
|
@@ -657,47 +1243,47 @@ const tt = ({ open: e, onOpenChange: n = () => {
|
|
|
657
1243
|
}
|
|
658
1244
|
)
|
|
659
1245
|
},
|
|
660
|
-
|
|
1246
|
+
v.label
|
|
661
1247
|
)) }) }),
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
e.slice(0,
|
|
664
|
-
|
|
1248
|
+
/* @__PURE__ */ h(C, { size: 8, children: [
|
|
1249
|
+
e.slice(0, i).map((v) => /* @__PURE__ */ o(
|
|
1250
|
+
po,
|
|
665
1251
|
{
|
|
666
|
-
data:
|
|
667
|
-
active:
|
|
668
|
-
displayTitleMaxLength:
|
|
1252
|
+
data: v,
|
|
1253
|
+
active: x === v.id,
|
|
1254
|
+
displayTitleMaxLength: a,
|
|
669
1255
|
onClick: () => {
|
|
670
|
-
|
|
671
|
-
|
|
1256
|
+
l(
|
|
1257
|
+
x === v.id ? "" : v.id
|
|
672
1258
|
);
|
|
673
1259
|
}
|
|
674
1260
|
},
|
|
675
|
-
|
|
1261
|
+
v.id
|
|
676
1262
|
)),
|
|
677
|
-
/* @__PURE__ */
|
|
678
|
-
|
|
1263
|
+
/* @__PURE__ */ o(
|
|
1264
|
+
T,
|
|
679
1265
|
{
|
|
680
1266
|
size: "small",
|
|
681
1267
|
type: "text",
|
|
682
|
-
onClick: () =>
|
|
683
|
-
children: /* @__PURE__ */
|
|
1268
|
+
onClick: () => b(!0),
|
|
1269
|
+
children: /* @__PURE__ */ o(Ht, {})
|
|
684
1270
|
}
|
|
685
1271
|
)
|
|
686
1272
|
] })
|
|
687
1273
|
] }),
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
|
|
1274
|
+
/* @__PURE__ */ o(
|
|
1275
|
+
so,
|
|
690
1276
|
{
|
|
691
|
-
open:
|
|
692
|
-
onOpenChange:
|
|
1277
|
+
open: s,
|
|
1278
|
+
onOpenChange: b,
|
|
693
1279
|
data: e,
|
|
694
|
-
onChange:
|
|
695
|
-
tableHeight:
|
|
696
|
-
limitation:
|
|
1280
|
+
onChange: t,
|
|
1281
|
+
tableHeight: r,
|
|
1282
|
+
limitation: n
|
|
697
1283
|
}
|
|
698
1284
|
)
|
|
699
1285
|
] });
|
|
700
|
-
},
|
|
1286
|
+
}, uo = k.div`
|
|
701
1287
|
background-color: ${(e) => e.$backgroundColor};
|
|
702
1288
|
color: ${(e) => e.$textColor};
|
|
703
1289
|
border: 1px solid transparent;
|
|
@@ -715,132 +1301,136 @@ const tt = ({ open: e, onOpenChange: n = () => {
|
|
|
715
1301
|
opacity: 0.6;
|
|
716
1302
|
}
|
|
717
1303
|
`;
|
|
718
|
-
function
|
|
719
|
-
const
|
|
720
|
-
var
|
|
721
|
-
const
|
|
1304
|
+
function po(e) {
|
|
1305
|
+
const t = D(() => {
|
|
1306
|
+
var i, u;
|
|
1307
|
+
const r = zt(e.data.color), n = r.isDark(), a = n ? (i = r.lighten(0.2)) == null ? void 0 : i.hex() : (u = r.darken(0.15)) == null ? void 0 : u.hex();
|
|
722
1308
|
return {
|
|
723
|
-
$textColor:
|
|
1309
|
+
$textColor: n ? "#fff" : "#333",
|
|
724
1310
|
$backgroundColor: e.data.color,
|
|
725
|
-
$hoverColor:
|
|
1311
|
+
$hoverColor: a
|
|
726
1312
|
};
|
|
727
1313
|
}, [e.data.color]);
|
|
728
|
-
return /* @__PURE__ */
|
|
729
|
-
|
|
1314
|
+
return /* @__PURE__ */ o(
|
|
1315
|
+
uo,
|
|
730
1316
|
{
|
|
731
|
-
...
|
|
1317
|
+
...t,
|
|
732
1318
|
$active: e.active,
|
|
733
1319
|
"data-id": e.data.id,
|
|
734
1320
|
onClick: e.onClick,
|
|
735
1321
|
title: e.data.title,
|
|
736
|
-
children:
|
|
1322
|
+
children: $e(e.data.title, e.displayTitleMaxLength)
|
|
737
1323
|
}
|
|
738
1324
|
);
|
|
739
1325
|
}
|
|
740
1326
|
/*! This file was generated by vite-i18n-gen-resources-type check https://github.com/CRMChatReactComponent/vite-i18n-gen-resources-type. Please do not modify. */
|
|
741
|
-
var
|
|
742
|
-
const
|
|
743
|
-
confirmDelete:
|
|
744
|
-
noData:
|
|
745
|
-
selectAGroupFirst:
|
|
746
|
-
addNewGroup:
|
|
747
|
-
editGroup:
|
|
748
|
-
createGroup:
|
|
749
|
-
titleFieldName:
|
|
750
|
-
colorFieldName:
|
|
751
|
-
save:
|
|
752
|
-
create:
|
|
753
|
-
quickMessageConfigs:
|
|
754
|
-
createSuccessfully:
|
|
755
|
-
cannotSavedMessageCuzLabelExisted:
|
|
756
|
-
cannotSavedMessageCuzLabelEmpty:
|
|
757
|
-
cannotSavedMessageCuzContentEmpty:
|
|
758
|
-
content:
|
|
759
|
-
delete: "Delete"
|
|
760
|
-
|
|
1327
|
+
var ze = /* @__PURE__ */ ((e) => (e.ZH_CN = "zh-CN", e.EN_US = "en-US", e))(ze || {});
|
|
1328
|
+
const Fe = "Are you sure to delete it?", Re = "No data available", Be = "Select a Group first", Ke = "Create a Group", Ve = "Edit Group", qe = "Create Group", Ue = "Title", We = "Color", Ye = "Save", Je = "Create", Xe = "Quick Messages Configs", Qe = "Created Successfully", Ze = "Cannot be saved: title already existing", et = "Cannot be saved: title is empty", tt = "Cannot be saved: content is empty", rt = "Content", nt = "Import from Clipboard", fo = {
|
|
1329
|
+
confirmDelete: Fe,
|
|
1330
|
+
noData: Re,
|
|
1331
|
+
selectAGroupFirst: Be,
|
|
1332
|
+
addNewGroup: Ke,
|
|
1333
|
+
editGroup: Ve,
|
|
1334
|
+
createGroup: qe,
|
|
1335
|
+
titleFieldName: Ue,
|
|
1336
|
+
colorFieldName: We,
|
|
1337
|
+
save: Ye,
|
|
1338
|
+
create: Je,
|
|
1339
|
+
quickMessageConfigs: Xe,
|
|
1340
|
+
createSuccessfully: Qe,
|
|
1341
|
+
cannotSavedMessageCuzLabelExisted: Ze,
|
|
1342
|
+
cannotSavedMessageCuzLabelEmpty: et,
|
|
1343
|
+
cannotSavedMessageCuzContentEmpty: tt,
|
|
1344
|
+
content: rt,
|
|
1345
|
+
delete: "Delete",
|
|
1346
|
+
importFromClipboard: nt
|
|
1347
|
+
}, go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
761
1348
|
__proto__: null,
|
|
762
|
-
addNewGroup:
|
|
763
|
-
cannotSavedMessageCuzContentEmpty:
|
|
764
|
-
cannotSavedMessageCuzLabelEmpty:
|
|
765
|
-
cannotSavedMessageCuzLabelExisted:
|
|
766
|
-
colorFieldName:
|
|
767
|
-
confirmDelete:
|
|
768
|
-
content:
|
|
769
|
-
create:
|
|
770
|
-
createGroup:
|
|
771
|
-
createSuccessfully:
|
|
772
|
-
default:
|
|
773
|
-
editGroup:
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
1349
|
+
addNewGroup: Ke,
|
|
1350
|
+
cannotSavedMessageCuzContentEmpty: tt,
|
|
1351
|
+
cannotSavedMessageCuzLabelEmpty: et,
|
|
1352
|
+
cannotSavedMessageCuzLabelExisted: Ze,
|
|
1353
|
+
colorFieldName: We,
|
|
1354
|
+
confirmDelete: Fe,
|
|
1355
|
+
content: rt,
|
|
1356
|
+
create: Je,
|
|
1357
|
+
createGroup: qe,
|
|
1358
|
+
createSuccessfully: Qe,
|
|
1359
|
+
default: fo,
|
|
1360
|
+
editGroup: Ve,
|
|
1361
|
+
importFromClipboard: nt,
|
|
1362
|
+
noData: Re,
|
|
1363
|
+
quickMessageConfigs: Xe,
|
|
1364
|
+
save: Ye,
|
|
1365
|
+
selectAGroupFirst: Be,
|
|
1366
|
+
titleFieldName: Ue
|
|
1367
|
+
}, Symbol.toStringTag, { value: "Module" })), ot = "确定删除吗?", at = "没有数据", it = "请在左侧选择一个分组", st = "添加一个分组", lt = "编辑分组", ct = "新建分组", ut = "标题", dt = "颜色", pt = "保存", ft = "创建", gt = "快捷消息配置", ht = "创建成功", bt = "无法保存: 标题重复", yt = "无法保存: 标题不能为空", mt = "无法保存: 内容不能为空", vt = "内容", xt = "从剪切板导入", ho = {
|
|
1368
|
+
confirmDelete: ot,
|
|
1369
|
+
noData: at,
|
|
1370
|
+
selectAGroupFirst: it,
|
|
1371
|
+
addNewGroup: st,
|
|
1372
|
+
editGroup: lt,
|
|
1373
|
+
createGroup: ct,
|
|
1374
|
+
titleFieldName: ut,
|
|
1375
|
+
colorFieldName: dt,
|
|
1376
|
+
save: pt,
|
|
1377
|
+
create: ft,
|
|
1378
|
+
quickMessageConfigs: gt,
|
|
1379
|
+
createSuccessfully: ht,
|
|
1380
|
+
cannotSavedMessageCuzLabelExisted: bt,
|
|
1381
|
+
cannotSavedMessageCuzLabelEmpty: yt,
|
|
1382
|
+
cannotSavedMessageCuzContentEmpty: mt,
|
|
1383
|
+
content: vt,
|
|
1384
|
+
delete: "删除",
|
|
1385
|
+
importFromClipboard: xt
|
|
1386
|
+
}, bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
798
1387
|
__proto__: null,
|
|
799
|
-
addNewGroup:
|
|
800
|
-
cannotSavedMessageCuzContentEmpty:
|
|
801
|
-
cannotSavedMessageCuzLabelEmpty:
|
|
802
|
-
cannotSavedMessageCuzLabelExisted:
|
|
803
|
-
colorFieldName:
|
|
804
|
-
confirmDelete:
|
|
805
|
-
content:
|
|
806
|
-
create:
|
|
807
|
-
createGroup:
|
|
808
|
-
createSuccessfully:
|
|
809
|
-
default:
|
|
810
|
-
editGroup:
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
"./locales/
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
1388
|
+
addNewGroup: st,
|
|
1389
|
+
cannotSavedMessageCuzContentEmpty: mt,
|
|
1390
|
+
cannotSavedMessageCuzLabelEmpty: yt,
|
|
1391
|
+
cannotSavedMessageCuzLabelExisted: bt,
|
|
1392
|
+
colorFieldName: dt,
|
|
1393
|
+
confirmDelete: ot,
|
|
1394
|
+
content: vt,
|
|
1395
|
+
create: ft,
|
|
1396
|
+
createGroup: ct,
|
|
1397
|
+
createSuccessfully: ht,
|
|
1398
|
+
default: ho,
|
|
1399
|
+
editGroup: lt,
|
|
1400
|
+
importFromClipboard: xt,
|
|
1401
|
+
noData: at,
|
|
1402
|
+
quickMessageConfigs: gt,
|
|
1403
|
+
save: pt,
|
|
1404
|
+
selectAGroupFirst: it,
|
|
1405
|
+
titleFieldName: ut
|
|
1406
|
+
}, Symbol.toStringTag, { value: "Module" })), yo = /* @__PURE__ */ Object.assign({
|
|
1407
|
+
"./locales/en-US/common.json": go,
|
|
1408
|
+
"./locales/zh-CN/common.json": bo
|
|
1409
|
+
}), ye = Object.entries(yo).reduce(
|
|
1410
|
+
(e, t) => {
|
|
1411
|
+
const [r, n] = t, a = r.match(/\/locales\/([\w-]+)\//), i = r.match(/\/([\w-_]+)\.json$/);
|
|
1412
|
+
return i && a ? (e[a[1]] = e[a[1]] || {}, e[a[1]][i[1]] = n.default) : console.error(`无法解析文件名称 path:${r}`), e;
|
|
823
1413
|
},
|
|
824
1414
|
{}
|
|
825
|
-
),
|
|
826
|
-
|
|
827
|
-
lng:
|
|
1415
|
+
), Ct = Ft.createInstance();
|
|
1416
|
+
Ct.init({
|
|
1417
|
+
lng: ze.ZH_CN,
|
|
828
1418
|
debug: !1,
|
|
829
|
-
ns: Object.keys(
|
|
830
|
-
resources:
|
|
1419
|
+
ns: Object.keys(ye),
|
|
1420
|
+
resources: ye
|
|
831
1421
|
});
|
|
832
|
-
const
|
|
833
|
-
function
|
|
834
|
-
return /* @__PURE__ */
|
|
1422
|
+
const mo = ve(null);
|
|
1423
|
+
function Io(e) {
|
|
1424
|
+
return /* @__PURE__ */ o(Et, { i18n: e.i18n || Ct, defaultNS: "common", children: /* @__PURE__ */ o(mo.Provider, { value: {}, children: e.children }) });
|
|
835
1425
|
}
|
|
836
1426
|
export {
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
1427
|
+
ke as AntdApiContext,
|
|
1428
|
+
Mo as AntdApiContextProviderCmp,
|
|
1429
|
+
Oo as EmojiPickerWrapper,
|
|
1430
|
+
mo as I18nContext,
|
|
1431
|
+
Io as I18nContextCmp,
|
|
1432
|
+
ao as MessageConfigsPanel,
|
|
1433
|
+
so as MessageConfigsPanelModalWrapper,
|
|
1434
|
+
Qn as MessagesEditTable,
|
|
1435
|
+
Eo as QuickMessages
|
|
846
1436
|
};
|