@progress/kendo-vue-data-tools 10.0.1-develop.7 → 10.1.0-develop.1
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/EULA.pdf +0 -0
- package/EULA.rtf +2730 -0
- package/EULA.txt +292 -0
- package/clipboard/common.d.ts +11 -1
- package/clipboard/common.js +5 -5
- package/clipboard/common.mjs +75 -64
- package/dist/cdn/js/kendo-vue-datatools.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -15
package/clipboard/common.mjs
CHANGED
|
@@ -5,100 +5,111 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { getter as
|
|
8
|
+
import { getter as g } from "@progress/kendo-vue-common";
|
|
9
9
|
var E = /* @__PURE__ */ ((t) => (t.copy = "copy", t.cut = "cut", t.paste = "paste", t))(E || {});
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const F = (t, n, e, s) => {
|
|
11
|
+
const a = g(s);
|
|
12
12
|
if (!n.length)
|
|
13
13
|
return [];
|
|
14
|
-
const
|
|
15
|
-
return t.data.filter((
|
|
16
|
-
},
|
|
17
|
-
var
|
|
18
|
-
const { event: e } = t,
|
|
14
|
+
const r = t.data.findIndex((i) => a(i) === a(n[0].dataItem)) || 0, o = n.length < 2 ? e : n.length;
|
|
15
|
+
return t.data.filter((i, c) => c >= r && c < r + o) || [];
|
|
16
|
+
}, L = (t) => (t == null ? void 0 : t.map((e) => e.fields.map((s) => e.dataItem[s].toString()))) || [], j = (t, n) => {
|
|
17
|
+
var i, c;
|
|
18
|
+
const { event: e } = t, s = n.includes(`
|
|
19
19
|
`) ? `
|
|
20
|
-
` : null,
|
|
21
|
-
`,
|
|
22
|
-
return (
|
|
23
|
-
},
|
|
20
|
+
` : null, a = (i = e.cellDelimiter) != null ? i : " ", r = (c = e.newLineDelimiter) != null ? c : `\r
|
|
21
|
+
`, o = n.includes(r) ? r : s;
|
|
22
|
+
return (o ? n.split(o) : [n]).map((d) => d.includes(a) ? d.split(a) : [d]);
|
|
23
|
+
}, K = (t, n) => {
|
|
24
24
|
var e;
|
|
25
|
-
return ((e = t.event.nativeEvent) == null ? void 0 : e.type) === "paste" ?
|
|
25
|
+
return ((e = t.event.nativeEvent) == null ? void 0 : e.type) === "paste" ? j(t, n) : L(t.previousCopiedItems);
|
|
26
26
|
}, S = (t, n) => {
|
|
27
|
-
var
|
|
28
|
-
const { event: e } = t,
|
|
27
|
+
var u, p, h;
|
|
28
|
+
const { event: e } = t, s = e.dataItem, a = (p = (u = t.dataItemKey) != null ? u : e.dataItemKey) != null ? p : "", r = g(a), o = s && !s.selected && e.field ? [{ dataItem: e.dataItem, fields: [e.field] }] : b(t), l = o.length ? o[0].fields[0] : (h = e.columns[0].field) != null ? h : "", i = e.columns.map((I) => {
|
|
29
29
|
var D;
|
|
30
30
|
return (D = I.field) != null ? D : "";
|
|
31
|
-
}),
|
|
32
|
-
return
|
|
33
|
-
const
|
|
34
|
-
return x.forEach((T,
|
|
31
|
+
}), c = i.indexOf(l), d = K(t, n), f = F(t, o, d.length, a);
|
|
32
|
+
return d.slice(0, f.length).map((I, D) => {
|
|
33
|
+
const w = c + I.length, x = i.slice(c, w), y = { [a]: r(f[D]) };
|
|
34
|
+
return x.forEach((T, C) => y[T] = I[C]), {
|
|
35
35
|
dataItem: y,
|
|
36
36
|
fields: x
|
|
37
37
|
};
|
|
38
38
|
});
|
|
39
|
-
},
|
|
39
|
+
}, P = (t, n) => {
|
|
40
|
+
const e = String(t != null ? t : "").replace(/[\t\r\n]/g, " ").split(n).join(" ");
|
|
41
|
+
return /^\s*[=+@\t\r]/.test(e) || typeof t != "number" && /^\s*-/.test(e) ? `'${e}` : e;
|
|
42
|
+
}, $ = (t, n, e = " ", s = !0) => {
|
|
40
43
|
if (!n.length)
|
|
41
44
|
return null;
|
|
42
45
|
let a = "";
|
|
43
|
-
return n.forEach((
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
return n.forEach((r, o, l) => {
|
|
47
|
+
const i = s ? P(t[r], e) : t[r];
|
|
48
|
+
a += `${i}${o < l.length - 1 ? e : ""}`;
|
|
49
|
+
}), a;
|
|
50
|
+
}, O = (t, n, e) => {
|
|
51
|
+
var o, l;
|
|
52
|
+
const s = (o = e.cellDelimiter) != null ? o : " ", a = (l = e.newLineDelimiter) != null ? l : `\r
|
|
47
53
|
`;
|
|
48
|
-
return `${n.join(
|
|
49
|
-
},
|
|
50
|
-
var
|
|
51
|
-
const { event: n, selectedState: e, data:
|
|
52
|
-
return Object.entries(e).forEach(([
|
|
53
|
-
|
|
54
|
-
}),
|
|
54
|
+
return `${n.map((i) => e.preventFormulaInjection === !1 ? i : P(i, s)).join(s)}${a}${t}`;
|
|
55
|
+
}, b = (t) => {
|
|
56
|
+
var i, c;
|
|
57
|
+
const { event: n, selectedState: e, data: s } = t, a = (c = (i = t.dataItemKey) != null ? i : n.dataItemKey) != null ? c : "", r = g(a), o = {}, l = [];
|
|
58
|
+
return Object.entries(e).forEach(([d, f]) => {
|
|
59
|
+
o[d] = Array.isArray(f) ? f.map((m) => n.columns[m]).filter((m) => !m.declarationIndex || m.declarationIndex >= 0) : n.columns.filter((m) => !m.declarationIndex || m.declarationIndex >= 0);
|
|
60
|
+
}), s == null || s.forEach((d) => {
|
|
55
61
|
var m;
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
dataItem:
|
|
59
|
-
fields:
|
|
60
|
-
var
|
|
61
|
-
return (
|
|
62
|
+
const f = (m = r(d)) != null ? m : "";
|
|
63
|
+
o[f] && l.push({
|
|
64
|
+
dataItem: d,
|
|
65
|
+
fields: o[f].map((u) => {
|
|
66
|
+
var p;
|
|
67
|
+
return (p = u.field) != null ? p : "";
|
|
62
68
|
})
|
|
63
69
|
});
|
|
64
|
-
}),
|
|
65
|
-
}, O = (t, n) => {
|
|
66
|
-
var l, i;
|
|
67
|
-
const e = (l = n.newLineDelimiter) != null ? l : `\r
|
|
68
|
-
`, a = (i = n.cellDelimiter) != null ? i : " ";
|
|
69
|
-
return t.map((r, d) => {
|
|
70
|
-
var c;
|
|
71
|
-
let o = (c = $(r.dataItem, r.fields, a)) != null ? c : "";
|
|
72
|
-
return n.copyHeaders && d === 0 && (o = v(o, r.fields, n)), o ? [o] : [];
|
|
73
|
-
}).join(e);
|
|
70
|
+
}), l;
|
|
74
71
|
}, R = (t, n) => {
|
|
75
|
-
var
|
|
72
|
+
var r, o;
|
|
73
|
+
const e = (r = n.newLineDelimiter) != null ? r : `\r
|
|
74
|
+
`, s = (o = n.cellDelimiter) != null ? o : " ";
|
|
75
|
+
return t.map((l, i) => {
|
|
76
|
+
var d;
|
|
77
|
+
let c = (d = $(
|
|
78
|
+
l.dataItem,
|
|
79
|
+
l.fields,
|
|
80
|
+
s,
|
|
81
|
+
n.preventFormulaInjection !== !1
|
|
82
|
+
)) != null ? d : "";
|
|
83
|
+
return n.copyHeaders && i === 0 && (c = O(c, l.fields, n)), c ? [c] : [];
|
|
84
|
+
}).join(e);
|
|
85
|
+
}, G = (t, n) => {
|
|
86
|
+
var s;
|
|
76
87
|
let e = "";
|
|
77
88
|
if (t.type === "paste") {
|
|
78
|
-
const
|
|
79
|
-
e =
|
|
89
|
+
const a = t.nativeEvent ? t.nativeEvent.clipboardData : "";
|
|
90
|
+
e = a ? a.getData("text").trim() : "";
|
|
80
91
|
} else
|
|
81
|
-
e =
|
|
92
|
+
e = R(n, t), (s = navigator.clipboard) == null || s.writeText(e);
|
|
82
93
|
return e;
|
|
83
|
-
},
|
|
84
|
-
const { event: n } = t, e =
|
|
94
|
+
}, U = (t) => {
|
|
95
|
+
const { event: n } = t, e = b(t) || [], s = G(n, e) || "", a = n.type === "paste" ? S(t, s) || [] : [];
|
|
85
96
|
return {
|
|
86
97
|
copiedItems: e,
|
|
87
|
-
pastedItems:
|
|
88
|
-
clipboardData:
|
|
98
|
+
pastedItems: a,
|
|
99
|
+
clipboardData: s
|
|
89
100
|
};
|
|
90
101
|
};
|
|
91
102
|
export {
|
|
92
103
|
E as ClipboardActionType,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
104
|
+
O as addHeaders,
|
|
105
|
+
G as getClipboardData,
|
|
106
|
+
j as getClipboardItemsToPaste,
|
|
107
|
+
R as getClipboardText,
|
|
108
|
+
K as getItemsToPaste,
|
|
109
|
+
F as getItemsToUpdateOnPaste,
|
|
99
110
|
S as getPastedItems,
|
|
100
|
-
|
|
101
|
-
|
|
111
|
+
L as getPreviouslyCopiedItemsData,
|
|
112
|
+
b as getSelectedItems,
|
|
102
113
|
$ as itemToString,
|
|
103
|
-
|
|
114
|
+
U as populateClipboardData
|
|
104
115
|
};
|