@endge/ui-vue 0.23.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.
Files changed (79) hide show
  1. package/LICENSE +201 -0
  2. package/dist/domain/core/endge-vue.d.ts +22 -0
  3. package/dist/domain/types/filter-renderer.type.d.ts +5 -0
  4. package/dist/domain/types/sfc-render.type.d.ts +143 -0
  5. package/dist/edit.utils-Dnnbd0xG-D9ndNtVP.js +51 -0
  6. package/dist/events-BvSmBueA-Doh7RyHn.js +23 -0
  7. package/dist/main-CQv-nkoD.js +19453 -0
  8. package/dist/main.d.ts +42 -0
  9. package/dist/model/render/sfc/SFCVueRenderInspection.d.ts +12 -0
  10. package/dist/model/render/sfc/SFCVueRuntimeBridge.d.ts +43 -0
  11. package/dist/model/render/sfc/native-vue-sfc-adapter.d.ts +4 -0
  12. package/dist/model/style/EndgeDOMStyleRuntime.d.ts +10 -0
  13. package/dist/model/style/endge-dom-style.d.ts +17 -0
  14. package/dist/model/style/index.d.ts +2 -0
  15. package/dist/reactive/use-current-environment.d.ts +8 -0
  16. package/dist/reactive/use-current-locale.d.ts +8 -0
  17. package/dist/reactive/use-current-project-filter.d.ts +8 -0
  18. package/dist/reactive/use-current-theme.d.ts +8 -0
  19. package/dist/reactive/use-ui.d.ts +3 -0
  20. package/dist/revo-grid.entry-BAwst49a.js +1615 -0
  21. package/dist/revogr-attribution_7.entry-BMG7pXkt.js +967 -0
  22. package/dist/revogr-clipboard_3.entry-BRLLR59Q.js +334 -0
  23. package/dist/revogr-data_4.entry-D1ndZEok.js +745 -0
  24. package/dist/revogr-filter-panel.entry-C-xzIppO.js +329 -0
  25. package/dist/store/domain.d.ts +91 -0
  26. package/dist/test/overlay/context-menu-manager.test.d.ts +1 -0
  27. package/dist/test/sfc/EndgeVueAdapter.test.d.ts +1 -0
  28. package/dist/test/sfc/SFCRender_Component.test.d.ts +1 -0
  29. package/dist/test/sfc/SFCRender_Evaluator.test.d.ts +1 -0
  30. package/dist/test/sfc/SFCRender_FormControls.test.d.ts +1 -0
  31. package/dist/test/sfc/SFCRender_Grid.test.d.ts +1 -0
  32. package/dist/test/sfc/SFCRender_IntrinsicEvents.test.d.ts +1 -0
  33. package/dist/test/sfc/SFCRender_TableAlignment.test.d.ts +1 -0
  34. package/dist/test/sfc/SFCRender_TableLayout.test.d.ts +1 -0
  35. package/dist/test/sfc/SFCRender_TableVisibility.test.d.ts +1 -0
  36. package/dist/test/sfc/SFCVueRenderInspection.test.d.ts +1 -0
  37. package/dist/test/style/endge-dom-runtime-placement.test.d.ts +1 -0
  38. package/dist/test/style/endge-dom-style-jsdom.test.d.ts +1 -0
  39. package/dist/test/style/endge-dom-style.test.d.ts +1 -0
  40. package/dist/test/style/sfc-style-markers.test.d.ts +1 -0
  41. package/dist/throttle-Cpk1LoGk-5dM_0aHc.js +183 -0
  42. package/dist/ui/filter/EndgeFilterControlRenderer.d.ts +33 -0
  43. package/dist/ui/filter/EndgeFilterField.vue.d.ts +13 -0
  44. package/dist/ui/filter/EndgeFilterRenderer.vue.d.ts +3 -0
  45. package/dist/ui/filter/index.d.ts +2 -0
  46. package/dist/ui/layout/EndgeShell.vue.d.ts +22 -0
  47. package/dist/ui/overlay/EndgeContextMenuRoot.vue.d.ts +4 -0
  48. package/dist/ui/overlay/context-menu-manager.d.ts +46 -0
  49. package/dist/ui/render/entities/EndgePage.vue.d.ts +1852 -0
  50. package/dist/ui/render/sfc/SFCRender_Badge.d.ts +3 -0
  51. package/dist/ui/render/sfc/SFCRender_Base.d.ts +8 -0
  52. package/dist/ui/render/sfc/SFCRender_BoundaryRegistry.d.ts +15 -0
  53. package/dist/ui/render/sfc/SFCRender_Box.d.ts +3 -0
  54. package/dist/ui/render/sfc/SFCRender_Checkbox.d.ts +3 -0
  55. package/dist/ui/render/sfc/SFCRender_Component.d.ts +3 -0
  56. package/dist/ui/render/sfc/SFCRender_Context.d.ts +8 -0
  57. package/dist/ui/render/sfc/SFCRender_DateTime.d.ts +3 -0
  58. package/dist/ui/render/sfc/SFCRender_Divider.d.ts +3 -0
  59. package/dist/ui/render/sfc/SFCRender_Dot.d.ts +3 -0
  60. package/dist/ui/render/sfc/SFCRender_Evaluator.d.ts +19 -0
  61. package/dist/ui/render/sfc/SFCRender_Flex.d.ts +3 -0
  62. package/dist/ui/render/sfc/SFCRender_Grid.d.ts +3 -0
  63. package/dist/ui/render/sfc/SFCRender_Icon.d.ts +3 -0
  64. package/dist/ui/render/sfc/SFCRender_Input.d.ts +3 -0
  65. package/dist/ui/render/sfc/SFCRender_Node.d.ts +6 -0
  66. package/dist/ui/render/sfc/SFCRender_Number.d.ts +3 -0
  67. package/dist/ui/render/sfc/SFCRender_Select.d.ts +3 -0
  68. package/dist/ui/render/sfc/SFCRender_Table.d.ts +9 -0
  69. package/dist/ui/render/sfc/SFCRender_TableAlignment.d.ts +8 -0
  70. package/dist/ui/render/sfc/SFCRender_TableStyle.d.ts +35 -0
  71. package/dist/ui/render/sfc/SFCRender_Text.d.ts +3 -0
  72. package/dist/ui/render/sfc/SFCRender_Textarea.d.ts +3 -0
  73. package/dist/ui/render/sfc/SFC_Renderer.vue.d.ts +3 -0
  74. package/dist/ui/render/sfc/SFC_RuntimeRenderer.vue.d.ts +3 -0
  75. package/dist/ui/table/NativeTablePagination.vue.d.ts +15 -0
  76. package/dist/viewport.helpers-CoCAvmZs-f555rwPU.js +77 -0
  77. package/dist/vue.css +1 -0
  78. package/dist/vue.js +75 -0
  79. package/package.json +77 -0
@@ -0,0 +1,334 @@
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-CQv-nkoD.js";
2
+ import { d as E, c as D, j as S } from "./edit.utils-Dnnbd0xG-D9ndNtVP.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
+ };