@endge/ui-vue 0.33.1 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.d.ts +3 -0
- package/dist/test/sfc/SFC_Renderer.manual.vue.d.ts +3 -0
- package/dist/ui/layout/EndgeShell.vue.d.ts +2 -0
- package/dist/ui/render/entities/EndgePage.vue.d.ts +1 -1
- package/dist/ui/render/sfc/SFCRender_Editable.d.ts +2 -0
- package/dist/ui/render/sfc/SFCRender_Table.d.ts +5 -2
- package/dist/ui/render/sfc/SFCRender_TableStyle.d.ts +31 -3
- package/dist/ui/table/TanStackSfcDataTable.vue.d.ts +21 -0
- package/dist/ui/table/TanStackTableColumnManager.vue.d.ts +9 -0
- package/dist/ui/table/TanStackTableRuntimeRenderer.vue.d.ts +17 -0
- package/dist/ui/table/tanstack-table-i18n.d.ts +63 -0
- package/dist/ui/table/tanstack-table-runtime-context.d.ts +10 -0
- package/dist/ui/table/tanstack-table.types.d.ts +57 -0
- package/dist/vue.css +1 -1
- package/dist/vue.js +9343 -82
- package/package.json +6 -18
- package/dist/edit.utils-Dnnbd0xG-D5rAByEo.js +0 -51
- package/dist/events-BvSmBueA-Doh7RyHn.js +0 -23
- package/dist/main-CTvK8fpg.js +0 -11394
- package/dist/revo-grid.entry-BE-lGv7m.js +0 -1615
- package/dist/revogr-attribution_7.entry-C9LXkJOd.js +0 -967
- package/dist/revogr-clipboard_3.entry-JN7kdnTv.js +0 -334
- package/dist/revogr-data_4.entry-CKgkU-3f.js +0 -745
- package/dist/revogr-filter-panel.entry-DtPkSECo.js +0 -329
- package/dist/throttle-Cpk1LoGk-BRnDVCTo.js +0 -183
- package/dist/viewport.helpers-CoCAvmZs-f555rwPU.js +0 -77
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
import { t as f, r as h, c as n, h as v, a4 as g, H as m, f as y, l as w, a5 as b, q as C, a3 as c } from "./main-CTvK8fpg.js";
|
|
2
|
-
import { d as E, c as D, j as S } from "./edit.utils-Dnnbd0xG-D5rAByEo.js";
|
|
3
|
-
/*!
|
|
4
|
-
* Built by Revolist OU ❤️
|
|
5
|
-
*/
|
|
6
|
-
class O {
|
|
7
|
-
constructor(e, i) {
|
|
8
|
-
this.data = e, this.saveCallback = i, this.editInput = null, this.element = null, this.editCell = void 0;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Callback triggered on cell editor render
|
|
12
|
-
*/
|
|
13
|
-
async componentDidRender() {
|
|
14
|
-
var e;
|
|
15
|
-
this.editInput && (await f(), (e = this.editInput) === null || e === void 0 || e.focus());
|
|
16
|
-
}
|
|
17
|
-
onKeyDown(e) {
|
|
18
|
-
const i = E(e.key), r = D(e.key);
|
|
19
|
-
(r || i) && e.target && this.saveCallback && !e.isComposing && (this.beforeDisconnect(), this.saveCallback(this.getValue(), r));
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* IMPORTANT: Prevent scroll glitches when editor is closed and focus is on current input element.
|
|
23
|
-
*/
|
|
24
|
-
beforeDisconnect() {
|
|
25
|
-
var e;
|
|
26
|
-
(e = this.editInput) === null || e === void 0 || e.blur();
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Get value from input
|
|
30
|
-
*/
|
|
31
|
-
getValue() {
|
|
32
|
-
var e;
|
|
33
|
-
return (e = this.editInput) === null || e === void 0 ? void 0 : e.value;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Render method for Editor plugin.
|
|
37
|
-
* Renders input element with passed data from cell.
|
|
38
|
-
* @param {Function} h - h function from stencil render.
|
|
39
|
-
* @param {Object} _additionalData - additional data from plugin.
|
|
40
|
-
* @returns {VNode} - input element.
|
|
41
|
-
*/
|
|
42
|
-
render(e, i) {
|
|
43
|
-
var r, s;
|
|
44
|
-
return e("input", {
|
|
45
|
-
type: "text",
|
|
46
|
-
enterKeyHint: "enter",
|
|
47
|
-
// set input value from cell data
|
|
48
|
-
value: (s = (r = this.editCell) === null || r === void 0 ? void 0 : r.val) !== null && s !== void 0 ? s : "",
|
|
49
|
-
// save input element as ref for further usage
|
|
50
|
-
ref: (o) => {
|
|
51
|
-
this.editInput = o;
|
|
52
|
-
},
|
|
53
|
-
// listen to keydown event on input element
|
|
54
|
-
onKeyDown: (o) => this.onKeyDown(o)
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
/*!
|
|
59
|
-
* Built by Revolist OU ❤️
|
|
60
|
-
*/
|
|
61
|
-
const A = class {
|
|
62
|
-
constructor(t) {
|
|
63
|
-
h(this, t), this.beforePaste = n(this, "beforepaste", 7), this.beforePasteApply = n(this, "beforepasteapply", 7), this.pasteRegion = n(this, "pasteregion", 7), this.afterPasteApply = n(this, "afterpasteapply", 7), this.beforeCut = n(this, "beforecut", 7), this.clearRegion = n(this, "clearregion", 7), this.beforeCopy = n(this, "beforecopy", 7), this.beforeCopyApply = n(this, "beforecopyapply", 7), this.copyRegion = n(this, "copyregion", 7);
|
|
64
|
-
}
|
|
65
|
-
onPaste(t) {
|
|
66
|
-
if (this.readonly)
|
|
67
|
-
return;
|
|
68
|
-
const e = this.getData(t), i = ((e == null ? void 0 : e.types.indexOf("text/html")) || -1) > -1, r = (i ? e == null ? void 0 : e.getData("text/html") : e == null ? void 0 : e.getData("text")) || "", s = (e == null ? void 0 : e.getData("text")) || "", o = this.beforePaste.emit({
|
|
69
|
-
raw: r,
|
|
70
|
-
dataText: s,
|
|
71
|
-
isHTML: i,
|
|
72
|
-
event: t
|
|
73
|
-
});
|
|
74
|
-
if (o.defaultPrevented)
|
|
75
|
-
return;
|
|
76
|
-
let a;
|
|
77
|
-
o.detail.isHTML ? a = this.htmlParse(o.detail.raw) || this.textParse(s || "") : a = this.textParse(o.detail.raw);
|
|
78
|
-
const l = this.beforePasteApply.emit({
|
|
79
|
-
raw: r,
|
|
80
|
-
parsed: a,
|
|
81
|
-
dataText: s,
|
|
82
|
-
event: t
|
|
83
|
-
});
|
|
84
|
-
l.defaultPrevented || (this.pasteRegion.emit(l.detail.parsed), this.afterPasteApply.emit({
|
|
85
|
-
raw: r,
|
|
86
|
-
parsed: a,
|
|
87
|
-
dataText: s,
|
|
88
|
-
event: t
|
|
89
|
-
}).defaultPrevented) || t.preventDefault();
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Listen to copy event and emit copy region event
|
|
93
|
-
*/
|
|
94
|
-
copyStarted(t) {
|
|
95
|
-
const e = this.beforeCopy.emit({
|
|
96
|
-
event: t
|
|
97
|
-
});
|
|
98
|
-
if (e.defaultPrevented)
|
|
99
|
-
return;
|
|
100
|
-
const i = this.getData(e.detail.event);
|
|
101
|
-
t.preventDefault(), this.copyRegion.emit(i || void 0);
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Listen to copy event and emit copy region event
|
|
105
|
-
*/
|
|
106
|
-
cutStarted(t) {
|
|
107
|
-
const e = this.beforeCut.emit({
|
|
108
|
-
event: t
|
|
109
|
-
});
|
|
110
|
-
if (e.defaultPrevented)
|
|
111
|
-
return;
|
|
112
|
-
const i = this.getData(e.detail.event);
|
|
113
|
-
this.copyStarted(t), !this.readonly && (this.clearRegion.emit(i || void 0), t.preventDefault());
|
|
114
|
-
}
|
|
115
|
-
async doCopy(t, e) {
|
|
116
|
-
if (this.beforeCopyApply.emit({
|
|
117
|
-
event: t,
|
|
118
|
-
data: e
|
|
119
|
-
}).defaultPrevented)
|
|
120
|
-
return;
|
|
121
|
-
const r = e ? this.parserCopy(e) : "";
|
|
122
|
-
t.setData("text/plain", r);
|
|
123
|
-
}
|
|
124
|
-
parserCopy(t) {
|
|
125
|
-
return t.map((e) => e.join(" ")).join(`
|
|
126
|
-
`);
|
|
127
|
-
}
|
|
128
|
-
textParse(t) {
|
|
129
|
-
const e = [], i = t.split(/\r\n|\n|\r/);
|
|
130
|
-
for (let r in i)
|
|
131
|
-
e.push(i[r].split(" "));
|
|
132
|
-
return e;
|
|
133
|
-
}
|
|
134
|
-
htmlParse(t) {
|
|
135
|
-
const e = [], r = document.createRange().createContextualFragment(t).querySelector("table");
|
|
136
|
-
if (!r)
|
|
137
|
-
return null;
|
|
138
|
-
for (const s of Array.from(r.rows))
|
|
139
|
-
e.push(Array.from(s.cells).map((o) => o.innerText));
|
|
140
|
-
return e;
|
|
141
|
-
}
|
|
142
|
-
getData(t) {
|
|
143
|
-
return t.clipboardData || (globalThis == null ? void 0 : globalThis.clipboardData);
|
|
144
|
-
}
|
|
145
|
-
}, R = () => "revogr-edit{display:block;position:absolute;background-color:var(--revo-grid-background, #fff)}revogr-edit input{height:100%;width:100%;box-sizing:border-box;background-color:var(--revo-grid-background, transparent)}revogr-edit revo-dropdown{height:100%}revogr-edit revo-dropdown.shrink fieldset legend>span{display:none}", x = class {
|
|
146
|
-
constructor(t) {
|
|
147
|
-
h(this, t), this.cellEdit = n(this, "celleditinit", 7), this.closeEdit = n(this, "closeedit", 7), this.saveOnClose = !1, this.currentEditor = null, this.preventSaveOnClose = !1;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Cancel pending changes flag. Editor will be closed without autosave.
|
|
151
|
-
*/
|
|
152
|
-
async cancelChanges() {
|
|
153
|
-
this.preventSaveOnClose = !0;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Before editor got disconnected.
|
|
157
|
-
* Can be triggered multiple times before actual disconnect.
|
|
158
|
-
*/
|
|
159
|
-
async beforeDisconnect() {
|
|
160
|
-
var t, e;
|
|
161
|
-
(e = (t = this.currentEditor) === null || t === void 0 ? void 0 : t.beforeDisconnect) === null || e === void 0 || e.call(t);
|
|
162
|
-
}
|
|
163
|
-
onAutoSave() {
|
|
164
|
-
var t, e, i;
|
|
165
|
-
this.preventSaveOnClose = !0;
|
|
166
|
-
const r = (e = (t = this.currentEditor) === null || t === void 0 ? void 0 : t.getValue) === null || e === void 0 ? void 0 : e.call(t);
|
|
167
|
-
!((i = this.currentEditor) === null || i === void 0) && i.beforeAutoSave && this.currentEditor.beforeAutoSave(r) === !1 || this.onSave(r, !0);
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Callback triggered when cell editor saved.
|
|
171
|
-
* Closes editor when called.
|
|
172
|
-
* @param preventFocus - if true, editor will not be closed & next cell will not be focused.
|
|
173
|
-
*/
|
|
174
|
-
onSave(t, e) {
|
|
175
|
-
this.preventSaveOnClose = !0, this.editCell && this.cellEdit.emit({
|
|
176
|
-
rgCol: this.editCell.x,
|
|
177
|
-
rgRow: this.editCell.y,
|
|
178
|
-
type: this.editCell.type,
|
|
179
|
-
prop: this.editCell.prop,
|
|
180
|
-
val: t,
|
|
181
|
-
preventFocus: e
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
componentWillRender() {
|
|
185
|
-
if (!(this.currentEditor || !this.column)) {
|
|
186
|
-
if (this.preventSaveOnClose = !1, this.editor) {
|
|
187
|
-
S(this.editor) ? this.currentEditor = new this.editor(
|
|
188
|
-
this.column,
|
|
189
|
-
// save callback
|
|
190
|
-
(t, e) => {
|
|
191
|
-
this.onSave(t, e);
|
|
192
|
-
},
|
|
193
|
-
// cancel callback
|
|
194
|
-
(t) => {
|
|
195
|
-
this.preventSaveOnClose = !0, this.closeEdit.emit(t);
|
|
196
|
-
}
|
|
197
|
-
) : this.currentEditor = this.editor(
|
|
198
|
-
this.column,
|
|
199
|
-
// save callback
|
|
200
|
-
(t, e) => {
|
|
201
|
-
this.onSave(t, e);
|
|
202
|
-
},
|
|
203
|
-
// cancel callback
|
|
204
|
-
(t) => {
|
|
205
|
-
this.preventSaveOnClose = !0, this.closeEdit.emit(t);
|
|
206
|
-
}
|
|
207
|
-
);
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
this.currentEditor = new O(this.column, (t, e) => this.onSave(t, e));
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
componentDidRender() {
|
|
214
|
-
var t, e;
|
|
215
|
-
this.currentEditor && (this.currentEditor.element = this.element.firstElementChild, (e = (t = this.currentEditor).componentDidRender) === null || e === void 0 || e.call(t));
|
|
216
|
-
}
|
|
217
|
-
disconnectedCallback() {
|
|
218
|
-
var t, e;
|
|
219
|
-
this.saveOnClose && (this.preventSaveOnClose || this.onAutoSave()), this.preventSaveOnClose = !1, this.currentEditor && ((e = (t = this.currentEditor).disconnectedCallback) === null || e === void 0 || e.call(t), this.currentEditor.element = null, this.currentEditor = null);
|
|
220
|
-
}
|
|
221
|
-
render() {
|
|
222
|
-
return this.currentEditor ? (this.currentEditor.editCell = this.editCell, v(m, { class: g }, this.currentEditor.render(v, this.additionalData))) : "";
|
|
223
|
-
}
|
|
224
|
-
get element() {
|
|
225
|
-
return y(this);
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
x.style = R();
|
|
229
|
-
class P {
|
|
230
|
-
constructor(e) {
|
|
231
|
-
this.config = e, this.currentCell = null, this.previousRow = null;
|
|
232
|
-
}
|
|
233
|
-
/** Drag finished, calculate and apply changes */
|
|
234
|
-
endOrder(e, i) {
|
|
235
|
-
if (this.currentCell === null)
|
|
236
|
-
return;
|
|
237
|
-
const r = this.getCell(e, i);
|
|
238
|
-
r.y < 0 ? r.y = 0 : r.y < this.currentCell.y && r.y++, r.y !== this.currentCell.y && this.config.positionChanged(this.currentCell.y, r.y), this.clear();
|
|
239
|
-
}
|
|
240
|
-
/** Drag started, reserve initial cell for farther use */
|
|
241
|
-
startOrder(e, i) {
|
|
242
|
-
return this.currentCell = this.getCell(e, i), this.currentCell;
|
|
243
|
-
}
|
|
244
|
-
move(e, i) {
|
|
245
|
-
const r = this.getRow(e, i);
|
|
246
|
-
return this.previousRow === r.itemIndex || r.itemIndex < -1 ? null : (this.previousRow = r.itemIndex, r);
|
|
247
|
-
}
|
|
248
|
-
/** Drag stopped, probably cursor outside of document area */
|
|
249
|
-
clear() {
|
|
250
|
-
this.currentCell = null, this.previousRow = null;
|
|
251
|
-
}
|
|
252
|
-
/** Calculate cell based on x, y position */
|
|
253
|
-
getRow(e, { el: i, rows: r }) {
|
|
254
|
-
const { top: s } = i.getBoundingClientRect(), o = e - s, a = r.renderOffset || 0, l = c(r, o + a);
|
|
255
|
-
return {
|
|
256
|
-
itemIndex: l.itemIndex,
|
|
257
|
-
start: l.start - a + s,
|
|
258
|
-
end: l.end - a + s
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
/** Calculate cell based on x, y position */
|
|
262
|
-
getCell({ x: e, y: i }, { el: r, rows: s, cols: o }) {
|
|
263
|
-
const { top: a, left: l } = r.getBoundingClientRect(), d = i - a, u = e - l, p = c(s, d + (s.renderOffset || 0));
|
|
264
|
-
return { x: c(o, u + (o.renderOffset || 0)).itemIndex, y: p.itemIndex };
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
const k = class {
|
|
268
|
-
constructor(t) {
|
|
269
|
-
h(this, t), this.rowDragStart = n(this, "rowdragstartinit", 7), this.rowDragEnd = n(this, "rowdragendinit", 7), this.rowDrag = n(this, "rowdragmoveinit", 7), this.rowMouseMove = n(this, "rowdragmousemove", 7), this.rowDropped = n(this, "rowdropinit", 7), this.rowOrderChange = n(this, "roworderchange", 7), this.events = [], this.rowMoveFunc = w((e) => {
|
|
270
|
-
const i = this.rowOrderService.move(e, this.getData());
|
|
271
|
-
i !== null && this.rowDrag.emit(Object.assign(Object.assign({}, i), { rowType: this.rowType }));
|
|
272
|
-
}, 5);
|
|
273
|
-
}
|
|
274
|
-
// #endregion
|
|
275
|
-
// #region Methods
|
|
276
|
-
async dragStart(t) {
|
|
277
|
-
t.originalEvent.preventDefault(), this.events.length && this.clearOrder();
|
|
278
|
-
const e = this.getData(), i = this.rowOrderService.startOrder(t.originalEvent, e), r = this.rowOrderService.getRow(t.originalEvent.y, e);
|
|
279
|
-
if (this.rowDragStart.emit({
|
|
280
|
-
cell: i,
|
|
281
|
-
text: b,
|
|
282
|
-
pos: r,
|
|
283
|
-
event: t.originalEvent,
|
|
284
|
-
rowType: this.rowType,
|
|
285
|
-
model: C(this.dataStore, r.itemIndex)
|
|
286
|
-
}).defaultPrevented)
|
|
287
|
-
return;
|
|
288
|
-
const o = (d) => this.move(d), a = (d) => this.endOrder(d), l = () => this.clearOrder();
|
|
289
|
-
this.events.push({
|
|
290
|
-
name: "mousemove",
|
|
291
|
-
listener: o
|
|
292
|
-
}, {
|
|
293
|
-
name: "mouseup",
|
|
294
|
-
listener: a
|
|
295
|
-
}, {
|
|
296
|
-
name: "mouseleave",
|
|
297
|
-
listener: l
|
|
298
|
-
}), document.addEventListener("mousemove", o), document.addEventListener("mouseup", a), document.addEventListener("mouseleave", l);
|
|
299
|
-
}
|
|
300
|
-
async endOrder(t) {
|
|
301
|
-
this.rowOrderService.endOrder(t, this.getData()), this.clearOrder();
|
|
302
|
-
}
|
|
303
|
-
async clearOrder() {
|
|
304
|
-
this.rowOrderService.clear(), this.events.forEach((t) => document.removeEventListener(t.name, t.listener)), this.events.length = 0, this.rowDragEnd.emit({ rowType: this.rowType });
|
|
305
|
-
}
|
|
306
|
-
// #endregion
|
|
307
|
-
move({ x: t, y: e }) {
|
|
308
|
-
this.rowMouseMove.emit({ x: t, y: e, rowType: this.rowType }), this.rowMoveFunc(e);
|
|
309
|
-
}
|
|
310
|
-
connectedCallback() {
|
|
311
|
-
this.rowOrderService = new P({
|
|
312
|
-
positionChanged: (t, e) => {
|
|
313
|
-
const i = this.rowDropped.emit({
|
|
314
|
-
from: t,
|
|
315
|
-
to: e,
|
|
316
|
-
rowType: this.rowType
|
|
317
|
-
});
|
|
318
|
-
i.defaultPrevented || this.rowOrderChange.emit(i.detail);
|
|
319
|
-
}
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
getData() {
|
|
323
|
-
return {
|
|
324
|
-
el: this.parent,
|
|
325
|
-
rows: this.dimensionRow.state,
|
|
326
|
-
cols: this.dimensionCol.state
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
};
|
|
330
|
-
export {
|
|
331
|
-
A as revogr_clipboard,
|
|
332
|
-
x as revogr_edit,
|
|
333
|
-
k as revogr_order_editor
|
|
334
|
-
};
|