@progress/kendo-vue-data-tools 8.3.0-develop.1 → 8.3.0-develop.3

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.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { ClipboardActionType } from './common';
9
+ /**
10
+ * @hidden
11
+ */
12
+ export declare class ClipboardService {
13
+ private clipboardEvent;
14
+ constructor(clipboardEventHandler: (clipboardType: ClipboardActionType, event: ClipboardEvent) => void);
15
+ private copyHandler;
16
+ private cutHandler;
17
+ private pasteHandler;
18
+ addEventListeners: (document: Document | undefined) => void;
19
+ removeEventListeners: (document: Document | undefined) => void;
20
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./common.js");class r{constructor(i){this.copyHandler=e=>{this.clipboardEvent(t.ClipboardActionType.copy,e)},this.cutHandler=e=>{this.clipboardEvent(t.ClipboardActionType.cut,e)},this.pasteHandler=e=>{this.clipboardEvent(t.ClipboardActionType.paste,e)},this.addEventListeners=e=>{e&&(e.addEventListener(t.ClipboardActionType.copy,this.copyHandler),e.addEventListener(t.ClipboardActionType.cut,this.cutHandler),e.addEventListener(t.ClipboardActionType.paste,this.pasteHandler))},this.removeEventListeners=e=>{e&&(e.removeEventListener(t.ClipboardActionType.copy,this.copyHandler),e.removeEventListener(t.ClipboardActionType.cut,this.cutHandler),e.removeEventListener(t.ClipboardActionType.paste,this.pasteHandler))},this.clipboardEvent=i}}exports.ClipboardService=r;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { ClipboardActionType as t } from "./common.mjs";
9
+ class n {
10
+ constructor(r) {
11
+ this.copyHandler = (e) => {
12
+ this.clipboardEvent(t.copy, e);
13
+ }, this.cutHandler = (e) => {
14
+ this.clipboardEvent(t.cut, e);
15
+ }, this.pasteHandler = (e) => {
16
+ this.clipboardEvent(t.paste, e);
17
+ }, this.addEventListeners = (e) => {
18
+ e && (e.addEventListener(t.copy, this.copyHandler), e.addEventListener(t.cut, this.cutHandler), e.addEventListener(t.paste, this.pasteHandler));
19
+ }, this.removeEventListeners = (e) => {
20
+ e && (e.removeEventListener(t.copy, this.copyHandler), e.removeEventListener(t.cut, this.cutHandler), e.removeEventListener(t.paste, this.pasteHandler));
21
+ }, this.clipboardEvent = r;
22
+ }
23
+ }
24
+ export {
25
+ n as ClipboardService
26
+ };
@@ -0,0 +1,188 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { ColumnBaseProps } from '../interfaces/ColumnProps';
9
+ import { SelectDescriptor } from '../selection/TableSelection';
10
+ /**
11
+ * The possible values of the `type` property.
12
+ */
13
+ export declare enum ClipboardActionType {
14
+ copy = "copy",
15
+ cut = "cut",
16
+ paste = "paste"
17
+ }
18
+ /**
19
+ * Represents the object of the `ClipboardDataEvent` event.
20
+ */
21
+ export interface ClipboardDataEvent {
22
+ /**
23
+ * Represents the type of the clipboard action.
24
+ */
25
+ type: ClipboardActionType;
26
+ /**
27
+ * Represents the native [ClipboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent)
28
+ */
29
+ nativeEvent?: ClipboardEvent;
30
+ /**
31
+ * All the Grid columns.
32
+ */
33
+ columns: ColumnBaseProps[];
34
+ /**
35
+ * Passes the dataItemKey prop in the clipboard action.
36
+ */
37
+ dataItemKey: string;
38
+ /**
39
+ * Passes the clipboard prop copyHeaders value in the clipboard action.
40
+ */
41
+ copyHeaders?: boolean;
42
+ /**
43
+ * Sets the cell delimiter used when manipulating the clipboard data Defaults to `\t`.
44
+ */
45
+ cellDelimiter?: string;
46
+ /**
47
+ * Sets the row delimiter used when manipulating the clipboard data Defaults to `\r\n`.
48
+ */
49
+ newLineDelimiter?: string;
50
+ /**
51
+ * This is the item that is clicked if the action is raised from the contextMenu.
52
+ */
53
+ dataItem?: any;
54
+ /**
55
+ * This is the column field that is clicked if the action is raised from the contextMenu.
56
+ */
57
+ field?: string;
58
+ }
59
+ /**
60
+ * Represents the object of the `GridClipboardEvent` event.
61
+ */
62
+ export interface GridClipboardEvent extends ClipboardDataEvent, ClipboardData {
63
+ }
64
+ /**
65
+ * Represents the `PopulateClipboardArgs` event argument.
66
+ */
67
+ export interface PopulateClipboardArgs {
68
+ /**
69
+ * Represents the base object of the `ClipboardDataEvent` event.
70
+ */
71
+ event: ClipboardDataEvent;
72
+ /**
73
+ * Represents the current selected state of the data.
74
+ */
75
+ selectedState: SelectDescriptor;
76
+ /**
77
+ * Passes the data currently displayed.
78
+ */
79
+ data: any[];
80
+ /**
81
+ * Passes dataItemKey name of the field that could be used to make difference between dataItems.
82
+ */
83
+ dataItemKey?: string;
84
+ /**
85
+ * Passes subItemsField that will be used in grouping cases.
86
+ */
87
+ subItemsField?: string;
88
+ /**
89
+ * Previous copied items.
90
+ */
91
+ previousCopiedItems?: ClipboardItem[];
92
+ }
93
+ /**
94
+ * Represents the object that is returned form the `populateClipboardData` function.
95
+ */
96
+ export interface ClipboardData {
97
+ /**
98
+ * A collection of the ClipboardItem that are selected.
99
+ */
100
+ copiedItems: ClipboardItem[];
101
+ /**
102
+ * A collection of the ClipboardItem that are pasted.
103
+ */
104
+ pastedItems: ClipboardItem[];
105
+ /**
106
+ * When the action is `copy` or `cut` - the Grid data, copied to the clipboard, in Excel-compatible format.
107
+ * When the action is `paste` - the current clipboard data, available in the original DOM event.
108
+ */
109
+ clipboardData: string;
110
+ }
111
+ /**
112
+ * Represents the aria that is copied - the dataItem and the fields.
113
+ */
114
+ export interface ClipboardItem {
115
+ /**
116
+ * Represents the dataItem used in the clipboard action.
117
+ */
118
+ dataItem: any;
119
+ /**
120
+ * Represents the fields used in the clipboard action.
121
+ */
122
+ fields: string[];
123
+ }
124
+ /**
125
+ * Represents settings that can be added to the clipboard behavior.
126
+ */
127
+ export interface ClipboardSettings {
128
+ /**
129
+ * Determines whether column titles or field names will be included in the generated data
130
+ * during the `copy` and `cut` actions.
131
+ * Defaults to `false`.
132
+ */
133
+ copyHeaders?: boolean;
134
+ /**
135
+ * Determines what is the delimiter used to separate the cells.
136
+ * Defaults to `\t`.
137
+ */
138
+ cellDelimiter?: string;
139
+ /**
140
+ * Determines what is the delimiter used to separate the rows.
141
+ * Defaults to `'\r\n'`.
142
+ */
143
+ newLineDelimiter?: string;
144
+ }
145
+ /**
146
+ * @hidden
147
+ */
148
+ export declare const getItemsToUpdateOnPaste: (args: PopulateClipboardArgs, selectedItems: ClipboardItem[], dataLength: number, dataItemKey: string) => any[];
149
+ /**
150
+ * @hidden
151
+ */
152
+ export declare const getPreviouslyCopiedItemsData: (previousCopiedItems?: ClipboardItem[]) => any[][];
153
+ /**
154
+ * @hidden
155
+ */
156
+ export declare const getClipboardItemsToPaste: (args: PopulateClipboardArgs, clipboardText: string) => string[][];
157
+ /**
158
+ * @hidden
159
+ */
160
+ export declare const getItemsToPaste: (args: PopulateClipboardArgs, clipboardText: string) => any[][];
161
+ /**
162
+ * @hidden
163
+ */
164
+ export declare const getPastedItems: (args: PopulateClipboardArgs, clipboardText: string) => ClipboardItem[];
165
+ /**
166
+ * @hidden
167
+ */
168
+ export declare const itemToString: (item: any, cols: string[], cellDelimiter?: string) => string | null;
169
+ /**
170
+ * @hidden
171
+ */
172
+ export declare const addHeaders: (initialData: string, cols: string[], event: ClipboardDataEvent) => string;
173
+ /**
174
+ * @hidden
175
+ */
176
+ export declare const getSelectedItems: (args: PopulateClipboardArgs) => ClipboardItem[];
177
+ /**
178
+ * @hidden
179
+ */
180
+ export declare const getClipboardText: (copiedItems: ClipboardItem[], event: ClipboardDataEvent) => string;
181
+ /**
182
+ * @hidden
183
+ */
184
+ export declare const getClipboardData: (event: ClipboardDataEvent, copiedItems: ClipboardItem[]) => string;
185
+ /**
186
+ * A function used to populate the Clipboard data.
187
+ */
188
+ export declare const populateClipboardData: (args: PopulateClipboardArgs) => ClipboardData;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("@progress/kendo-vue-common");var b=(t=>(t.copy="copy",t.cut="cut",t.paste="paste",t))(b||{});const x=(t,n,e,a)=>{const s=D.getter(a);if(!n.length)return[];const l=t.data.findIndex(d=>s(d)===s(n[0].dataItem))||0,o=n.length<2?e:n.length;return t.data.filter((d,i)=>i>=l&&i<l+o)||[]},C=t=>(t==null?void 0:t.map(e=>e.fields.map(a=>e.dataItem[a].toString())))||[],w=(t,n)=>{var d,i;const{event:e}=t,a=n.includes(`
9
+ `)?`
10
+ `:null,s=(d=e.cellDelimiter)!=null?d:" ",l=(i=e.newLineDelimiter)!=null?i:`\r
11
+ `,o=n.includes(l)?l:a;return(o?n.split(o):[n]).map(r=>r.includes(s)?r.split(s):[r])},S=(t,n)=>{var e;return((e=t.event.nativeEvent)==null?void 0:e.type)==="paste"?w(t,n):C(t.previousCopiedItems)},E=(t,n)=>{var I,u,y;const{event:e}=t,a=e.dataItem,s=(u=(I=t.dataItemKey)!=null?I:e.dataItemKey)!=null?u:"",l=D.getter(s),o=a&&!a.selected&&e.field?[{dataItem:e.dataItem,fields:[e.field]}]:h(t),c=o.length?o[0].fields[0]:(y=e.columns[0].field)!=null?y:"",d=e.columns.map(f=>{var g;return(g=f.field)!=null?g:""}),i=d.indexOf(c),r=S(t,n),p=x(t,o,r.length,s);return r.slice(0,p.length).map((f,g)=>{const F=i+f.length,P=d.slice(i,F),T={[s]:l(p[g])};return P.forEach(($,j)=>T[$]=f[j]),{dataItem:T,fields:P}})},L=(t,n,e=" ")=>{if(!n.length)return null;let a="";return n.forEach((s,l,o)=>a+=`${t[s]}${l<o.length-1?e:""}`),a},v=(t,n,e)=>{var o,c;const a=(o=e.cellDelimiter)!=null?o:" ",s=(c=e.newLineDelimiter)!=null?c:`\r
12
+ `;return`${n.join(a)}${s}${t}`},h=t=>{var d,i;const{event:n,selectedState:e,data:a}=t,s=(i=(d=t.dataItemKey)!=null?d:n.dataItemKey)!=null?i:"",l=D.getter(s),o={},c=[];return Object.entries(e).forEach(([r,p])=>{o[r]=Array.isArray(p)?p.map(m=>n.columns[m]).filter(m=>!m.declarationIndex||m.declarationIndex>=0):n.columns.filter(m=>!m.declarationIndex||m.declarationIndex>=0)}),a==null||a.forEach(r=>{var m;const p=(m=l(r))!=null?m:"";o[p]&&c.push({dataItem:r,fields:o[p].map(I=>{var u;return(u=I.field)!=null?u:""})})}),c},K=(t,n)=>{var l,o;const e=(l=n.newLineDelimiter)!=null?l:`\r
13
+ `,a=(o=n.cellDelimiter)!=null?o:" ";return t.map((c,d)=>{var r;let i=(r=L(c.dataItem,c.fields,a))!=null?r:"";return n.copyHeaders&&d===0&&(i=v(i,c.fields,n)),i?[i]:[]}).join(e)},O=(t,n)=>{var a;let e="";if(t.type==="paste"){const s=t.nativeEvent?t.nativeEvent.clipboardData:"";e=s?s.getData("text").trim():""}else e=K(n,t),(a=navigator.clipboard)==null||a.writeText(e);return e},R=t=>{const{event:n}=t,e=h(t)||[],a=O(n,e)||"",s=n.type==="paste"?E(t,a)||[]:[];return{copiedItems:e,pastedItems:s,clipboardData:a}};exports.ClipboardActionType=b;exports.addHeaders=v;exports.getClipboardData=O;exports.getClipboardItemsToPaste=w;exports.getClipboardText=K;exports.getItemsToPaste=S;exports.getItemsToUpdateOnPaste=x;exports.getPastedItems=E;exports.getPreviouslyCopiedItemsData=C;exports.getSelectedItems=h;exports.itemToString=L;exports.populateClipboardData=R;
@@ -0,0 +1,104 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { getter as h } from "@progress/kendo-vue-common";
9
+ var E = /* @__PURE__ */ ((t) => (t.copy = "copy", t.cut = "cut", t.paste = "paste", t))(E || {});
10
+ const L = (t, n, e, a) => {
11
+ const s = h(a);
12
+ if (!n.length)
13
+ return [];
14
+ const l = t.data.findIndex((d) => s(d) === s(n[0].dataItem)) || 0, i = n.length < 2 ? e : n.length;
15
+ return t.data.filter((d, o) => o >= l && o < l + i) || [];
16
+ }, C = (t) => (t == null ? void 0 : t.map((e) => e.fields.map((a) => e.dataItem[a].toString()))) || [], K = (t, n) => {
17
+ var d, o;
18
+ const { event: e } = t, a = n.includes(`
19
+ `) ? `
20
+ ` : null, s = (d = e.cellDelimiter) != null ? d : " ", l = (o = e.newLineDelimiter) != null ? o : `\r
21
+ `, i = n.includes(l) ? l : a;
22
+ return (i ? n.split(i) : [n]).map((c) => c.includes(s) ? c.split(s) : [c]);
23
+ }, F = (t, n) => {
24
+ var e;
25
+ return ((e = t.event.nativeEvent) == null ? void 0 : e.type) === "paste" ? K(t, n) : C(t.previousCopiedItems);
26
+ }, S = (t, n) => {
27
+ var f, u, g;
28
+ const { event: e } = t, a = e.dataItem, s = (u = (f = t.dataItemKey) != null ? f : e.dataItemKey) != null ? u : "", l = h(s), i = a && !a.selected && e.field ? [{ dataItem: e.dataItem, fields: [e.field] }] : w(t), r = i.length ? i[0].fields[0] : (g = e.columns[0].field) != null ? g : "", d = e.columns.map((I) => {
29
+ var D;
30
+ return (D = I.field) != null ? D : "";
31
+ }), o = d.indexOf(r), c = F(t, n), p = L(t, i, c.length, s);
32
+ return c.slice(0, p.length).map((I, D) => {
33
+ const P = o + I.length, x = d.slice(o, P), y = { [s]: l(p[D]) };
34
+ return x.forEach((T, b) => y[T] = I[b]), {
35
+ dataItem: y,
36
+ fields: x
37
+ };
38
+ });
39
+ }, $ = (t, n, e = " ") => {
40
+ if (!n.length)
41
+ return null;
42
+ let a = "";
43
+ return n.forEach((s, l, i) => a += `${t[s]}${l < i.length - 1 ? e : ""}`), a;
44
+ }, v = (t, n, e) => {
45
+ var i, r;
46
+ const a = (i = e.cellDelimiter) != null ? i : " ", s = (r = e.newLineDelimiter) != null ? r : `\r
47
+ `;
48
+ return `${n.join(a)}${s}${t}`;
49
+ }, w = (t) => {
50
+ var d, o;
51
+ const { event: n, selectedState: e, data: a } = t, s = (o = (d = t.dataItemKey) != null ? d : n.dataItemKey) != null ? o : "", l = h(s), i = {}, r = [];
52
+ return Object.entries(e).forEach(([c, p]) => {
53
+ i[c] = Array.isArray(p) ? p.map((m) => n.columns[m]).filter((m) => !m.declarationIndex || m.declarationIndex >= 0) : n.columns.filter((m) => !m.declarationIndex || m.declarationIndex >= 0);
54
+ }), a == null || a.forEach((c) => {
55
+ var m;
56
+ const p = (m = l(c)) != null ? m : "";
57
+ i[p] && r.push({
58
+ dataItem: c,
59
+ fields: i[p].map((f) => {
60
+ var u;
61
+ return (u = f.field) != null ? u : "";
62
+ })
63
+ });
64
+ }), r;
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);
74
+ }, R = (t, n) => {
75
+ var a;
76
+ let e = "";
77
+ if (t.type === "paste") {
78
+ const s = t.nativeEvent ? t.nativeEvent.clipboardData : "";
79
+ e = s ? s.getData("text").trim() : "";
80
+ } else
81
+ e = O(n, t), (a = navigator.clipboard) == null || a.writeText(e);
82
+ return e;
83
+ }, G = (t) => {
84
+ const { event: n } = t, e = w(t) || [], a = R(n, e) || "", s = n.type === "paste" ? S(t, a) || [] : [];
85
+ return {
86
+ copiedItems: e,
87
+ pastedItems: s,
88
+ clipboardData: a
89
+ };
90
+ };
91
+ export {
92
+ E as ClipboardActionType,
93
+ v as addHeaders,
94
+ R as getClipboardData,
95
+ K as getClipboardItemsToPaste,
96
+ O as getClipboardText,
97
+ F as getItemsToPaste,
98
+ L as getItemsToUpdateOnPaste,
99
+ S as getPastedItems,
100
+ C as getPreviouslyCopiedItemsData,
101
+ w as getSelectedItems,
102
+ $ as itemToString,
103
+ G as populateClipboardData
104
+ };