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