@zentto/report-designer 0.1.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.
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues } from 'lit';
|
|
2
|
+
import type { ReportLayout, DataSourceDef, DataSet } from '@zentto/report-core';
|
|
3
|
+
export declare class ZenttoReportDesigner extends LitElement {
|
|
4
|
+
/** The report layout being designed */
|
|
5
|
+
layout: ReportLayout | null;
|
|
6
|
+
/** Sample data for live preview */
|
|
7
|
+
sampleData: DataSet | null;
|
|
8
|
+
/** Available data sources for the field picker */
|
|
9
|
+
dataSources: DataSourceDef[];
|
|
10
|
+
/** Grid snap size in px */
|
|
11
|
+
gridSnap: number;
|
|
12
|
+
/** Show live preview panel */
|
|
13
|
+
showPreview: boolean;
|
|
14
|
+
/** Auto-save debounce ms (0 = disabled) */
|
|
15
|
+
autoSaveMs: number;
|
|
16
|
+
private _layout;
|
|
17
|
+
private _selectedElementId;
|
|
18
|
+
private _selectedBandId;
|
|
19
|
+
private _drag;
|
|
20
|
+
private _resize;
|
|
21
|
+
private _activePanel;
|
|
22
|
+
private _undoStack;
|
|
23
|
+
private _redoStack;
|
|
24
|
+
private _saveTimer;
|
|
25
|
+
private _idCounter;
|
|
26
|
+
static styles: import("lit").CSSResult;
|
|
27
|
+
connectedCallback(): void;
|
|
28
|
+
disconnectedCallback(): void;
|
|
29
|
+
updated(changed: PropertyValues): void;
|
|
30
|
+
private _newId;
|
|
31
|
+
private _pushUndo;
|
|
32
|
+
private _undo;
|
|
33
|
+
private _redo;
|
|
34
|
+
private _emitChange;
|
|
35
|
+
private _commitChange;
|
|
36
|
+
private _addElementToBand;
|
|
37
|
+
private _deleteSelectedElement;
|
|
38
|
+
private _getSelectedElement;
|
|
39
|
+
private _addBand;
|
|
40
|
+
private _onElementMouseDown;
|
|
41
|
+
private _onResizeMouseDown;
|
|
42
|
+
private _onToolboxDragStart;
|
|
43
|
+
private _onBandDrop;
|
|
44
|
+
private _onBandDragOver;
|
|
45
|
+
private _updateElementProp;
|
|
46
|
+
private _updateElementStyle;
|
|
47
|
+
private _updateBandHeight;
|
|
48
|
+
private _onKeyDown;
|
|
49
|
+
/** Get the current layout */
|
|
50
|
+
getLayout(): ReportLayout;
|
|
51
|
+
/** Set layout programmatically */
|
|
52
|
+
setLayout(layout: ReportLayout): void;
|
|
53
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
54
|
+
private _renderTopToolbar;
|
|
55
|
+
private _renderToolbox;
|
|
56
|
+
private _renderDataPanel;
|
|
57
|
+
private _renderBand;
|
|
58
|
+
private _renderDesignElement;
|
|
59
|
+
private _renderPropertiesPanel;
|
|
60
|
+
}
|
|
61
|
+
declare global {
|
|
62
|
+
interface HTMLElementTagNameMap {
|
|
63
|
+
'zentto-report-designer': ZenttoReportDesigner;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export { ZenttoReportDesigner as default };
|
|
67
|
+
//# sourceMappingURL=zentto-report-designer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zentto-report-designer.d.ts","sourceRoot":"","sources":["../src/zentto-report-designer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAsB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAE1E,OAAO,KAAK,EACV,YAAY,EAKZ,aAAa,EACb,OAAO,EAER,MAAM,qBAAqB,CAAC;AA+C7B,qBACa,oBAAqB,SAAQ,UAAU;IAIlD,uCAAuC;IAEvC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAQ;IAEnC,mCAAmC;IAEnC,UAAU,EAAE,OAAO,GAAG,IAAI,CAAQ;IAElC,kDAAkD;IAElD,WAAW,EAAE,aAAa,EAAE,CAAM;IAElC,2BAA2B;IAE3B,QAAQ,SAAK;IAEb,8BAA8B;IAE9B,WAAW,UAAS;IAEpB,2CAA2C;IAE3C,UAAU,SAAQ;IAIT,OAAO,C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J/B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,wBAAwB,EAAE,oBAAoB,CAAC;KAChD;CACF;AAED,OAAO,EAAE,oBAAoB,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,981 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
// @zentto/report-designer — WYSIWYG report designer web component
|
|
8
|
+
import { LitElement, html, css, nothing } from 'lit';
|
|
9
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
10
|
+
import { createBlankLayout, toPx } from '@zentto/report-core';
|
|
11
|
+
const BAND_LABELS = {
|
|
12
|
+
reportHeader: 'Report Header',
|
|
13
|
+
pageHeader: 'Page Header',
|
|
14
|
+
groupHeader: 'Group Header',
|
|
15
|
+
columnHeader: 'Column Header',
|
|
16
|
+
detail: 'Detail',
|
|
17
|
+
columnFooter: 'Column Footer',
|
|
18
|
+
groupFooter: 'Group Footer',
|
|
19
|
+
pageFooter: 'Page Footer',
|
|
20
|
+
reportFooter: 'Report Footer',
|
|
21
|
+
};
|
|
22
|
+
const TOOLBOX_ITEMS = [
|
|
23
|
+
{ type: 'text', label: 'Text', icon: 'T' },
|
|
24
|
+
{ type: 'field', label: 'Field', icon: 'F' },
|
|
25
|
+
{ type: 'image', label: 'Image', icon: 'IMG' },
|
|
26
|
+
{ type: 'line', label: 'Line', icon: '/' },
|
|
27
|
+
{ type: 'rect', label: 'Rectangle', icon: '[]' },
|
|
28
|
+
{ type: 'barcode', label: 'Barcode', icon: 'BC' },
|
|
29
|
+
{ type: 'pageNumber', label: 'Page #', icon: '#' },
|
|
30
|
+
{ type: 'currentDate', label: 'Date', icon: 'D' },
|
|
31
|
+
];
|
|
32
|
+
let ZenttoReportDesigner = class ZenttoReportDesigner extends LitElement {
|
|
33
|
+
constructor() {
|
|
34
|
+
// ─── Public Properties ──────────────────────────────────────────
|
|
35
|
+
super(...arguments);
|
|
36
|
+
/** The report layout being designed */
|
|
37
|
+
this.layout = null;
|
|
38
|
+
/** Sample data for live preview */
|
|
39
|
+
this.sampleData = null;
|
|
40
|
+
/** Available data sources for the field picker */
|
|
41
|
+
this.dataSources = [];
|
|
42
|
+
/** Grid snap size in px */
|
|
43
|
+
this.gridSnap = 5;
|
|
44
|
+
/** Show live preview panel */
|
|
45
|
+
this.showPreview = false;
|
|
46
|
+
/** Auto-save debounce ms (0 = disabled) */
|
|
47
|
+
this.autoSaveMs = 1000;
|
|
48
|
+
// ─── Internal State ─────────────────────────────────────────────
|
|
49
|
+
this._layout = createBlankLayout();
|
|
50
|
+
this._selectedElementId = null;
|
|
51
|
+
this._selectedBandId = null;
|
|
52
|
+
this._drag = null;
|
|
53
|
+
this._resize = null;
|
|
54
|
+
this._activePanel = 'toolbox';
|
|
55
|
+
this._undoStack = [];
|
|
56
|
+
this._redoStack = [];
|
|
57
|
+
this._saveTimer = null;
|
|
58
|
+
this._idCounter = 0;
|
|
59
|
+
}
|
|
60
|
+
// ─── Styles ─────────────────────────────────────────────────────
|
|
61
|
+
static { this.styles = css `
|
|
62
|
+
:host {
|
|
63
|
+
display: block;
|
|
64
|
+
font-family: 'Segoe UI', Arial, sans-serif;
|
|
65
|
+
font-size: 13px;
|
|
66
|
+
--zrd-bg: #f5f5f5;
|
|
67
|
+
--zrd-panel-bg: #ffffff;
|
|
68
|
+
--zrd-border: #ddd;
|
|
69
|
+
--zrd-accent: #1976d2;
|
|
70
|
+
--zrd-accent-light: #e3f2fd;
|
|
71
|
+
--zrd-text: #333;
|
|
72
|
+
--zrd-text-muted: #888;
|
|
73
|
+
--zrd-band-header: #f0f0f0;
|
|
74
|
+
--zrd-band-border: #ccc;
|
|
75
|
+
--zrd-element-border: #1976d2;
|
|
76
|
+
--zrd-element-selected: #1976d2;
|
|
77
|
+
--zrd-grid-color: rgba(0,0,0,0.05);
|
|
78
|
+
--zrd-danger: #d32f2f;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.designer {
|
|
82
|
+
display: grid;
|
|
83
|
+
grid-template-columns: 220px 1fr 260px;
|
|
84
|
+
grid-template-rows: auto 1fr;
|
|
85
|
+
height: 100%;
|
|
86
|
+
background: var(--zrd-bg);
|
|
87
|
+
color: var(--zrd-text);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* ─── Top Toolbar ─── */
|
|
91
|
+
.top-toolbar {
|
|
92
|
+
grid-column: 1 / -1;
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
gap: 8px;
|
|
96
|
+
padding: 6px 12px;
|
|
97
|
+
background: var(--zrd-panel-bg);
|
|
98
|
+
border-bottom: 1px solid var(--zrd-border);
|
|
99
|
+
}
|
|
100
|
+
.top-toolbar button {
|
|
101
|
+
background: none;
|
|
102
|
+
border: 1px solid var(--zrd-border);
|
|
103
|
+
border-radius: 4px;
|
|
104
|
+
padding: 4px 10px;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
font-size: 12px;
|
|
107
|
+
color: var(--zrd-text);
|
|
108
|
+
}
|
|
109
|
+
.top-toolbar button:hover { background: var(--zrd-accent-light); }
|
|
110
|
+
.top-toolbar button:disabled { opacity: 0.4; cursor: default; }
|
|
111
|
+
.top-toolbar .spacer { flex: 1; }
|
|
112
|
+
.top-toolbar .report-name {
|
|
113
|
+
font-weight: 600;
|
|
114
|
+
font-size: 14px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* ─── Left Panel ─── */
|
|
118
|
+
.left-panel {
|
|
119
|
+
background: var(--zrd-panel-bg);
|
|
120
|
+
border-right: 1px solid var(--zrd-border);
|
|
121
|
+
overflow-y: auto;
|
|
122
|
+
}
|
|
123
|
+
.panel-tabs {
|
|
124
|
+
display: flex;
|
|
125
|
+
border-bottom: 1px solid var(--zrd-border);
|
|
126
|
+
}
|
|
127
|
+
.panel-tab {
|
|
128
|
+
flex: 1;
|
|
129
|
+
padding: 8px 4px;
|
|
130
|
+
text-align: center;
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
font-size: 11px;
|
|
133
|
+
border-bottom: 2px solid transparent;
|
|
134
|
+
}
|
|
135
|
+
.panel-tab.active {
|
|
136
|
+
border-bottom-color: var(--zrd-accent);
|
|
137
|
+
color: var(--zrd-accent);
|
|
138
|
+
font-weight: 600;
|
|
139
|
+
}
|
|
140
|
+
.panel-content { padding: 8px; }
|
|
141
|
+
|
|
142
|
+
/* ─── Toolbox ─── */
|
|
143
|
+
.toolbox-item {
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
gap: 8px;
|
|
147
|
+
padding: 8px;
|
|
148
|
+
border: 1px solid var(--zrd-border);
|
|
149
|
+
border-radius: 4px;
|
|
150
|
+
margin-bottom: 4px;
|
|
151
|
+
cursor: grab;
|
|
152
|
+
user-select: none;
|
|
153
|
+
}
|
|
154
|
+
.toolbox-item:hover { background: var(--zrd-accent-light); }
|
|
155
|
+
.toolbox-icon {
|
|
156
|
+
width: 28px;
|
|
157
|
+
height: 28px;
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
justify-content: center;
|
|
161
|
+
background: var(--zrd-accent-light);
|
|
162
|
+
border-radius: 4px;
|
|
163
|
+
font-weight: bold;
|
|
164
|
+
font-size: 11px;
|
|
165
|
+
color: var(--zrd-accent);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* ─── Canvas ─── */
|
|
169
|
+
.canvas-area {
|
|
170
|
+
overflow: auto;
|
|
171
|
+
padding: 20px;
|
|
172
|
+
}
|
|
173
|
+
.canvas {
|
|
174
|
+
background: white;
|
|
175
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.12);
|
|
176
|
+
position: relative;
|
|
177
|
+
margin: 0 auto;
|
|
178
|
+
}
|
|
179
|
+
.band {
|
|
180
|
+
position: relative;
|
|
181
|
+
border-bottom: 1px dashed var(--zrd-band-border);
|
|
182
|
+
min-height: 20px;
|
|
183
|
+
}
|
|
184
|
+
.band-header {
|
|
185
|
+
display: flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
justify-content: space-between;
|
|
188
|
+
padding: 2px 8px;
|
|
189
|
+
background: var(--zrd-band-header);
|
|
190
|
+
font-size: 11px;
|
|
191
|
+
font-weight: 600;
|
|
192
|
+
color: var(--zrd-text-muted);
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
user-select: none;
|
|
195
|
+
}
|
|
196
|
+
.band-header:hover { background: var(--zrd-accent-light); }
|
|
197
|
+
.band-header.selected { background: var(--zrd-accent-light); color: var(--zrd-accent); }
|
|
198
|
+
.band-body {
|
|
199
|
+
position: relative;
|
|
200
|
+
background-image: linear-gradient(var(--zrd-grid-color) 1px, transparent 1px),
|
|
201
|
+
linear-gradient(90deg, var(--zrd-grid-color) 1px, transparent 1px);
|
|
202
|
+
background-size: 5px 5px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* ─── Elements on Canvas ─── */
|
|
206
|
+
.element {
|
|
207
|
+
position: absolute;
|
|
208
|
+
border: 1px solid transparent;
|
|
209
|
+
cursor: move;
|
|
210
|
+
user-select: none;
|
|
211
|
+
overflow: hidden;
|
|
212
|
+
font-size: 12px;
|
|
213
|
+
}
|
|
214
|
+
.element:hover { border-color: var(--zrd-accent); }
|
|
215
|
+
.element.selected {
|
|
216
|
+
border-color: var(--zrd-element-selected);
|
|
217
|
+
box-shadow: 0 0 0 1px var(--zrd-element-selected);
|
|
218
|
+
}
|
|
219
|
+
.element .resize-handle {
|
|
220
|
+
position: absolute;
|
|
221
|
+
bottom: -3px;
|
|
222
|
+
right: -3px;
|
|
223
|
+
width: 8px;
|
|
224
|
+
height: 8px;
|
|
225
|
+
background: var(--zrd-accent);
|
|
226
|
+
cursor: se-resize;
|
|
227
|
+
display: none;
|
|
228
|
+
}
|
|
229
|
+
.element.selected .resize-handle { display: block; }
|
|
230
|
+
|
|
231
|
+
/* ─── Right Panel (Properties) ─── */
|
|
232
|
+
.right-panel {
|
|
233
|
+
background: var(--zrd-panel-bg);
|
|
234
|
+
border-left: 1px solid var(--zrd-border);
|
|
235
|
+
overflow-y: auto;
|
|
236
|
+
padding: 12px;
|
|
237
|
+
}
|
|
238
|
+
.prop-section {
|
|
239
|
+
margin-bottom: 12px;
|
|
240
|
+
}
|
|
241
|
+
.prop-section h4 {
|
|
242
|
+
font-size: 11px;
|
|
243
|
+
text-transform: uppercase;
|
|
244
|
+
color: var(--zrd-text-muted);
|
|
245
|
+
margin-bottom: 6px;
|
|
246
|
+
}
|
|
247
|
+
.prop-row {
|
|
248
|
+
display: flex;
|
|
249
|
+
align-items: center;
|
|
250
|
+
gap: 4px;
|
|
251
|
+
margin-bottom: 4px;
|
|
252
|
+
}
|
|
253
|
+
.prop-label {
|
|
254
|
+
width: 70px;
|
|
255
|
+
font-size: 11px;
|
|
256
|
+
color: var(--zrd-text-muted);
|
|
257
|
+
flex-shrink: 0;
|
|
258
|
+
}
|
|
259
|
+
.prop-input {
|
|
260
|
+
flex: 1;
|
|
261
|
+
border: 1px solid var(--zrd-border);
|
|
262
|
+
border-radius: 3px;
|
|
263
|
+
padding: 3px 6px;
|
|
264
|
+
font-size: 12px;
|
|
265
|
+
background: white;
|
|
266
|
+
color: var(--zrd-text);
|
|
267
|
+
}
|
|
268
|
+
.prop-input:focus { outline: none; border-color: var(--zrd-accent); }
|
|
269
|
+
select.prop-input { padding: 2px 4px; }
|
|
270
|
+
|
|
271
|
+
.btn-danger {
|
|
272
|
+
background: var(--zrd-danger);
|
|
273
|
+
color: white;
|
|
274
|
+
border: none;
|
|
275
|
+
border-radius: 4px;
|
|
276
|
+
padding: 4px 10px;
|
|
277
|
+
cursor: pointer;
|
|
278
|
+
font-size: 12px;
|
|
279
|
+
width: 100%;
|
|
280
|
+
}
|
|
281
|
+
.btn-danger:hover { opacity: 0.9; }
|
|
282
|
+
|
|
283
|
+
/* ─── Data Source Panel ─── */
|
|
284
|
+
.ds-field {
|
|
285
|
+
padding: 4px 8px;
|
|
286
|
+
cursor: grab;
|
|
287
|
+
border-radius: 3px;
|
|
288
|
+
}
|
|
289
|
+
.ds-field:hover { background: var(--zrd-accent-light); }
|
|
290
|
+
.ds-name { font-weight: 600; margin-bottom: 4px; padding: 6px 8px; background: #f8f8f8; border-radius: 4px; }
|
|
291
|
+
`; }
|
|
292
|
+
// ─── Lifecycle ──────────────────────────────────────────────────
|
|
293
|
+
connectedCallback() {
|
|
294
|
+
super.connectedCallback();
|
|
295
|
+
if (this.layout) {
|
|
296
|
+
this._layout = structuredClone(this.layout);
|
|
297
|
+
}
|
|
298
|
+
this._pushUndo();
|
|
299
|
+
this._onKeyDown = this._onKeyDown.bind(this);
|
|
300
|
+
document.addEventListener('keydown', this._onKeyDown);
|
|
301
|
+
}
|
|
302
|
+
disconnectedCallback() {
|
|
303
|
+
super.disconnectedCallback();
|
|
304
|
+
document.removeEventListener('keydown', this._onKeyDown);
|
|
305
|
+
}
|
|
306
|
+
updated(changed) {
|
|
307
|
+
if (changed.has('layout') && this.layout) {
|
|
308
|
+
this._layout = structuredClone(this.layout);
|
|
309
|
+
}
|
|
310
|
+
if (changed.has('dataSources') && this.dataSources.length > 0) {
|
|
311
|
+
// Sync dataSources into layout
|
|
312
|
+
this._layout = { ...this._layout, dataSources: this.dataSources };
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
// ─── ID Generation ──────────────────────────────────────────────
|
|
316
|
+
_newId(prefix = 'el') {
|
|
317
|
+
return `${prefix}_${Date.now()}_${this._idCounter++}`;
|
|
318
|
+
}
|
|
319
|
+
// ─── Undo / Redo ────────────────────────────────────────────────
|
|
320
|
+
_pushUndo() {
|
|
321
|
+
this._undoStack = [...this._undoStack, JSON.stringify(this._layout)];
|
|
322
|
+
this._redoStack = [];
|
|
323
|
+
if (this._undoStack.length > 50)
|
|
324
|
+
this._undoStack = this._undoStack.slice(-50);
|
|
325
|
+
}
|
|
326
|
+
_undo() {
|
|
327
|
+
if (this._undoStack.length <= 1)
|
|
328
|
+
return;
|
|
329
|
+
const current = this._undoStack.pop();
|
|
330
|
+
this._redoStack = [...this._redoStack, current];
|
|
331
|
+
const prev = this._undoStack[this._undoStack.length - 1];
|
|
332
|
+
this._layout = JSON.parse(prev);
|
|
333
|
+
this._emitChange();
|
|
334
|
+
}
|
|
335
|
+
_redo() {
|
|
336
|
+
if (this._redoStack.length === 0)
|
|
337
|
+
return;
|
|
338
|
+
const next = this._redoStack.pop();
|
|
339
|
+
this._undoStack = [...this._undoStack, next];
|
|
340
|
+
this._layout = JSON.parse(next);
|
|
341
|
+
this._emitChange();
|
|
342
|
+
}
|
|
343
|
+
// ─── Change Emission ────────────────────────────────────────────
|
|
344
|
+
_emitChange() {
|
|
345
|
+
this.dispatchEvent(new CustomEvent('layout-change', {
|
|
346
|
+
detail: { layout: structuredClone(this._layout) },
|
|
347
|
+
bubbles: true,
|
|
348
|
+
composed: true,
|
|
349
|
+
}));
|
|
350
|
+
if (this.autoSaveMs > 0) {
|
|
351
|
+
if (this._saveTimer)
|
|
352
|
+
clearTimeout(this._saveTimer);
|
|
353
|
+
this._saveTimer = setTimeout(() => {
|
|
354
|
+
this.dispatchEvent(new CustomEvent('auto-save', {
|
|
355
|
+
detail: { layout: structuredClone(this._layout) },
|
|
356
|
+
bubbles: true,
|
|
357
|
+
composed: true,
|
|
358
|
+
}));
|
|
359
|
+
}, this.autoSaveMs);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
_commitChange() {
|
|
363
|
+
this._pushUndo();
|
|
364
|
+
this._emitChange();
|
|
365
|
+
this.requestUpdate();
|
|
366
|
+
}
|
|
367
|
+
// ─── Element CRUD ───────────────────────────────────────────────
|
|
368
|
+
_addElementToBand(bandId, type) {
|
|
369
|
+
const band = this._layout.bands.find(b => b.id === bandId);
|
|
370
|
+
if (!band)
|
|
371
|
+
return;
|
|
372
|
+
const baseProps = {
|
|
373
|
+
id: this._newId(type),
|
|
374
|
+
x: 5,
|
|
375
|
+
y: 5,
|
|
376
|
+
width: type === 'line' ? 50 : 80,
|
|
377
|
+
height: type === 'line' ? 0 : 15,
|
|
378
|
+
style: { fontSize: 12 },
|
|
379
|
+
};
|
|
380
|
+
let element;
|
|
381
|
+
switch (type) {
|
|
382
|
+
case 'text':
|
|
383
|
+
element = { ...baseProps, type: 'text', content: 'New Text' };
|
|
384
|
+
break;
|
|
385
|
+
case 'field':
|
|
386
|
+
element = { ...baseProps, type: 'field', dataSource: '', field: '', format: '' };
|
|
387
|
+
break;
|
|
388
|
+
case 'image':
|
|
389
|
+
element = { ...baseProps, type: 'image', src: '', fit: 'contain', width: 40, height: 40 };
|
|
390
|
+
break;
|
|
391
|
+
case 'line':
|
|
392
|
+
element = { ...baseProps, type: 'line', x2: 55, y2: 5, lineStyle: { color: '#000', width: 1, style: 'solid' } };
|
|
393
|
+
break;
|
|
394
|
+
case 'rect':
|
|
395
|
+
element = { ...baseProps, type: 'rect', lineStyle: { color: '#000', width: 1, style: 'solid' }, width: 60, height: 30 };
|
|
396
|
+
break;
|
|
397
|
+
case 'barcode':
|
|
398
|
+
element = { ...baseProps, type: 'barcode', barcodeType: 'qr', value: '12345', width: 30, height: 30 };
|
|
399
|
+
break;
|
|
400
|
+
case 'pageNumber':
|
|
401
|
+
element = { ...baseProps, type: 'pageNumber', format: 'Page {page} of {pages}', width: 60 };
|
|
402
|
+
break;
|
|
403
|
+
case 'currentDate':
|
|
404
|
+
element = { ...baseProps, type: 'currentDate', format: 'dd/MM/yyyy', width: 60 };
|
|
405
|
+
break;
|
|
406
|
+
default:
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
band.elements.push(element);
|
|
410
|
+
this._selectedElementId = element.id;
|
|
411
|
+
this._selectedBandId = bandId;
|
|
412
|
+
this._activePanel = 'properties';
|
|
413
|
+
this._commitChange();
|
|
414
|
+
}
|
|
415
|
+
_deleteSelectedElement() {
|
|
416
|
+
if (!this._selectedElementId || !this._selectedBandId)
|
|
417
|
+
return;
|
|
418
|
+
const band = this._layout.bands.find(b => b.id === this._selectedBandId);
|
|
419
|
+
if (!band)
|
|
420
|
+
return;
|
|
421
|
+
band.elements = band.elements.filter(e => e.id !== this._selectedElementId);
|
|
422
|
+
this._selectedElementId = null;
|
|
423
|
+
this._commitChange();
|
|
424
|
+
}
|
|
425
|
+
_getSelectedElement() {
|
|
426
|
+
if (!this._selectedElementId || !this._selectedBandId)
|
|
427
|
+
return null;
|
|
428
|
+
const band = this._layout.bands.find(b => b.id === this._selectedBandId);
|
|
429
|
+
return band?.elements.find(e => e.id === this._selectedElementId) || null;
|
|
430
|
+
}
|
|
431
|
+
// ─── Band CRUD ──────────────────────────────────────────────────
|
|
432
|
+
_addBand(type) {
|
|
433
|
+
const newBand = {
|
|
434
|
+
id: this._newId('band'),
|
|
435
|
+
type,
|
|
436
|
+
height: 20,
|
|
437
|
+
elements: [],
|
|
438
|
+
};
|
|
439
|
+
// Insert in correct order
|
|
440
|
+
const order = ['reportHeader', 'pageHeader', 'groupHeader', 'columnHeader', 'detail', 'columnFooter', 'groupFooter', 'pageFooter', 'reportFooter'];
|
|
441
|
+
const idx = order.indexOf(type);
|
|
442
|
+
let insertAt = this._layout.bands.length;
|
|
443
|
+
for (let i = 0; i < this._layout.bands.length; i++) {
|
|
444
|
+
if (order.indexOf(this._layout.bands[i].type) > idx) {
|
|
445
|
+
insertAt = i;
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
this._layout.bands.splice(insertAt, 0, newBand);
|
|
450
|
+
this._selectedBandId = newBand.id;
|
|
451
|
+
this._commitChange();
|
|
452
|
+
}
|
|
453
|
+
// ─── Drag & Drop ───────────────────────────────────────────────
|
|
454
|
+
_onElementMouseDown(e, elementId, bandId) {
|
|
455
|
+
e.preventDefault();
|
|
456
|
+
e.stopPropagation();
|
|
457
|
+
this._selectedElementId = elementId;
|
|
458
|
+
this._selectedBandId = bandId;
|
|
459
|
+
this._activePanel = 'properties';
|
|
460
|
+
const el = this._getSelectedElement();
|
|
461
|
+
if (!el)
|
|
462
|
+
return;
|
|
463
|
+
this._drag = {
|
|
464
|
+
elementId,
|
|
465
|
+
bandId,
|
|
466
|
+
offsetX: 0,
|
|
467
|
+
offsetY: 0,
|
|
468
|
+
startX: e.clientX,
|
|
469
|
+
startY: e.clientY,
|
|
470
|
+
};
|
|
471
|
+
const onMove = (me) => {
|
|
472
|
+
if (!this._drag)
|
|
473
|
+
return;
|
|
474
|
+
const dx = me.clientX - this._drag.startX;
|
|
475
|
+
const dy = me.clientY - this._drag.startY;
|
|
476
|
+
const snap = this.gridSnap;
|
|
477
|
+
el.x = Math.max(0, Math.round((el.x + dx) / snap) * snap);
|
|
478
|
+
el.y = Math.max(0, Math.round((el.y + dy) / snap) * snap);
|
|
479
|
+
this._drag.startX = me.clientX;
|
|
480
|
+
this._drag.startY = me.clientY;
|
|
481
|
+
this.requestUpdate();
|
|
482
|
+
};
|
|
483
|
+
const onUp = () => {
|
|
484
|
+
this._drag = null;
|
|
485
|
+
this._commitChange();
|
|
486
|
+
document.removeEventListener('mousemove', onMove);
|
|
487
|
+
document.removeEventListener('mouseup', onUp);
|
|
488
|
+
};
|
|
489
|
+
document.addEventListener('mousemove', onMove);
|
|
490
|
+
document.addEventListener('mouseup', onUp);
|
|
491
|
+
this.requestUpdate();
|
|
492
|
+
}
|
|
493
|
+
_onResizeMouseDown(e, elementId, bandId) {
|
|
494
|
+
e.preventDefault();
|
|
495
|
+
e.stopPropagation();
|
|
496
|
+
const el = this._layout.bands
|
|
497
|
+
.find(b => b.id === bandId)
|
|
498
|
+
?.elements.find(e => e.id === elementId);
|
|
499
|
+
if (!el)
|
|
500
|
+
return;
|
|
501
|
+
this._resize = {
|
|
502
|
+
elementId,
|
|
503
|
+
bandId,
|
|
504
|
+
handle: 'se',
|
|
505
|
+
startWidth: el.width,
|
|
506
|
+
startHeight: el.height,
|
|
507
|
+
startX: e.clientX,
|
|
508
|
+
startY: e.clientY,
|
|
509
|
+
};
|
|
510
|
+
const onMove = (me) => {
|
|
511
|
+
if (!this._resize)
|
|
512
|
+
return;
|
|
513
|
+
const dx = me.clientX - this._resize.startX;
|
|
514
|
+
const dy = me.clientY - this._resize.startY;
|
|
515
|
+
const snap = this.gridSnap;
|
|
516
|
+
el.width = Math.max(5, Math.round((this._resize.startWidth + dx) / snap) * snap);
|
|
517
|
+
el.height = Math.max(5, Math.round((this._resize.startHeight + dy) / snap) * snap);
|
|
518
|
+
this.requestUpdate();
|
|
519
|
+
};
|
|
520
|
+
const onUp = () => {
|
|
521
|
+
this._resize = null;
|
|
522
|
+
this._commitChange();
|
|
523
|
+
document.removeEventListener('mousemove', onMove);
|
|
524
|
+
document.removeEventListener('mouseup', onUp);
|
|
525
|
+
};
|
|
526
|
+
document.addEventListener('mousemove', onMove);
|
|
527
|
+
document.addEventListener('mouseup', onUp);
|
|
528
|
+
}
|
|
529
|
+
// ─── Toolbox Drag into Canvas ───────────────────────────────────
|
|
530
|
+
_onToolboxDragStart(e, type) {
|
|
531
|
+
e.dataTransfer?.setData('element-type', type);
|
|
532
|
+
}
|
|
533
|
+
_onBandDrop(e, bandId) {
|
|
534
|
+
e.preventDefault();
|
|
535
|
+
const type = e.dataTransfer?.getData('element-type');
|
|
536
|
+
if (type) {
|
|
537
|
+
this._addElementToBand(bandId, type);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
_onBandDragOver(e) {
|
|
541
|
+
e.preventDefault();
|
|
542
|
+
}
|
|
543
|
+
// ─── Property Updates ───────────────────────────────────────────
|
|
544
|
+
_updateElementProp(prop, value) {
|
|
545
|
+
const el = this._getSelectedElement();
|
|
546
|
+
if (!el)
|
|
547
|
+
return;
|
|
548
|
+
el[prop] = value;
|
|
549
|
+
this._commitChange();
|
|
550
|
+
}
|
|
551
|
+
_updateElementStyle(prop, value) {
|
|
552
|
+
const el = this._getSelectedElement();
|
|
553
|
+
if (!el)
|
|
554
|
+
return;
|
|
555
|
+
if (!el.style)
|
|
556
|
+
el.style = {};
|
|
557
|
+
el.style[prop] = value;
|
|
558
|
+
this._commitChange();
|
|
559
|
+
}
|
|
560
|
+
_updateBandHeight(bandId, height) {
|
|
561
|
+
const band = this._layout.bands.find(b => b.id === bandId);
|
|
562
|
+
if (!band)
|
|
563
|
+
return;
|
|
564
|
+
band.height = Math.max(5, height);
|
|
565
|
+
this._commitChange();
|
|
566
|
+
}
|
|
567
|
+
// ─── Keyboard ───────────────────────────────────────────────────
|
|
568
|
+
_onKeyDown(e) {
|
|
569
|
+
if (e.key === 'Delete' && this._selectedElementId) {
|
|
570
|
+
this._deleteSelectedElement();
|
|
571
|
+
}
|
|
572
|
+
if (e.ctrlKey && e.key === 'z') {
|
|
573
|
+
e.preventDefault();
|
|
574
|
+
this._undo();
|
|
575
|
+
}
|
|
576
|
+
if (e.ctrlKey && e.key === 'y') {
|
|
577
|
+
e.preventDefault();
|
|
578
|
+
this._redo();
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
// ─── Public API ─────────────────────────────────────────────────
|
|
582
|
+
/** Get the current layout */
|
|
583
|
+
getLayout() {
|
|
584
|
+
return structuredClone(this._layout);
|
|
585
|
+
}
|
|
586
|
+
/** Set layout programmatically */
|
|
587
|
+
setLayout(layout) {
|
|
588
|
+
this._layout = structuredClone(layout);
|
|
589
|
+
this._pushUndo();
|
|
590
|
+
this.requestUpdate();
|
|
591
|
+
}
|
|
592
|
+
// ─── Render ─────────────────────────────────────────────────────
|
|
593
|
+
render() {
|
|
594
|
+
const unit = this._layout.pageSize.unit;
|
|
595
|
+
const pageWidth = toPx(this._layout.pageSize.width, unit);
|
|
596
|
+
return html `
|
|
597
|
+
<div class="designer">
|
|
598
|
+
${this._renderTopToolbar()}
|
|
599
|
+
|
|
600
|
+
<div class="left-panel">
|
|
601
|
+
<div class="panel-tabs">
|
|
602
|
+
<div class="panel-tab ${this._activePanel === 'toolbox' ? 'active' : ''}"
|
|
603
|
+
@click=${() => this._activePanel = 'toolbox'}>Toolbox</div>
|
|
604
|
+
<div class="panel-tab ${this._activePanel === 'data' ? 'active' : ''}"
|
|
605
|
+
@click=${() => this._activePanel = 'data'}>Data</div>
|
|
606
|
+
</div>
|
|
607
|
+
<div class="panel-content">
|
|
608
|
+
${this._activePanel === 'toolbox' ? this._renderToolbox() : null}
|
|
609
|
+
${this._activePanel === 'data' ? this._renderDataPanel() : null}
|
|
610
|
+
</div>
|
|
611
|
+
</div>
|
|
612
|
+
|
|
613
|
+
<div class="canvas-area" @click=${() => { this._selectedElementId = null; this.requestUpdate(); }}>
|
|
614
|
+
<div class="canvas" style="width:${pageWidth}px;">
|
|
615
|
+
${this._layout.bands.map(band => this._renderBand(band))}
|
|
616
|
+
</div>
|
|
617
|
+
</div>
|
|
618
|
+
|
|
619
|
+
<div class="right-panel">
|
|
620
|
+
${this._renderPropertiesPanel()}
|
|
621
|
+
</div>
|
|
622
|
+
</div>
|
|
623
|
+
`;
|
|
624
|
+
}
|
|
625
|
+
_renderTopToolbar() {
|
|
626
|
+
return html `
|
|
627
|
+
<div class="top-toolbar">
|
|
628
|
+
<span class="report-name">${this._layout.name}</span>
|
|
629
|
+
<span class="spacer"></span>
|
|
630
|
+
<button @click=${this._undo} ?disabled=${this._undoStack.length <= 1}>Undo</button>
|
|
631
|
+
<button @click=${this._redo} ?disabled=${this._redoStack.length === 0}>Redo</button>
|
|
632
|
+
<button @click=${() => this._addBand('groupHeader')}>+ Group</button>
|
|
633
|
+
<button @click=${() => this._addBand('detail')}>+ Detail</button>
|
|
634
|
+
<button @click=${() => {
|
|
635
|
+
this.dispatchEvent(new CustomEvent('save', {
|
|
636
|
+
detail: { layout: structuredClone(this._layout) },
|
|
637
|
+
bubbles: true, composed: true,
|
|
638
|
+
}));
|
|
639
|
+
}}>Save</button>
|
|
640
|
+
<button @click=${() => {
|
|
641
|
+
this.showPreview = !this.showPreview;
|
|
642
|
+
this.dispatchEvent(new CustomEvent('toggle-preview', {
|
|
643
|
+
detail: { show: this.showPreview },
|
|
644
|
+
bubbles: true, composed: true,
|
|
645
|
+
}));
|
|
646
|
+
}}>${this.showPreview ? 'Hide Preview' : 'Preview'}</button>
|
|
647
|
+
</div>
|
|
648
|
+
`;
|
|
649
|
+
}
|
|
650
|
+
_renderToolbox() {
|
|
651
|
+
return html `
|
|
652
|
+
${TOOLBOX_ITEMS.map(item => html `
|
|
653
|
+
<div class="toolbox-item"
|
|
654
|
+
draggable="true"
|
|
655
|
+
@dragstart=${(e) => this._onToolboxDragStart(e, item.type)}>
|
|
656
|
+
<div class="toolbox-icon">${item.icon}</div>
|
|
657
|
+
<span>${item.label}</span>
|
|
658
|
+
</div>
|
|
659
|
+
`)}
|
|
660
|
+
`;
|
|
661
|
+
}
|
|
662
|
+
_renderDataPanel() {
|
|
663
|
+
if (this._layout.dataSources.length === 0) {
|
|
664
|
+
return html `<div style="color:var(--zrd-text-muted);padding:12px;">No data sources configured.</div>`;
|
|
665
|
+
}
|
|
666
|
+
return html `
|
|
667
|
+
${this._layout.dataSources.map(ds => html `
|
|
668
|
+
<div class="ds-name">${ds.name} (${ds.type})</div>
|
|
669
|
+
${(ds.fields || []).map(f => html `
|
|
670
|
+
<div class="ds-field" draggable="true"
|
|
671
|
+
@dragstart=${(e) => {
|
|
672
|
+
e.dataTransfer?.setData('element-type', 'field');
|
|
673
|
+
e.dataTransfer?.setData('field-ds', ds.id);
|
|
674
|
+
e.dataTransfer?.setData('field-name', f.name);
|
|
675
|
+
}}>
|
|
676
|
+
${f.label || f.name} <span style="color:var(--zrd-text-muted)">(${f.type})</span>
|
|
677
|
+
</div>
|
|
678
|
+
`)}
|
|
679
|
+
`)}
|
|
680
|
+
`;
|
|
681
|
+
}
|
|
682
|
+
_renderBand(band) {
|
|
683
|
+
const unit = this._layout.pageSize.unit;
|
|
684
|
+
const bandHeight = toPx(band.height, unit);
|
|
685
|
+
const isSelected = this._selectedBandId === band.id && !this._selectedElementId;
|
|
686
|
+
return html `
|
|
687
|
+
<div class="band" data-band-id="${band.id}">
|
|
688
|
+
<div class="band-header ${isSelected ? 'selected' : ''}"
|
|
689
|
+
@click=${(e) => {
|
|
690
|
+
e.stopPropagation();
|
|
691
|
+
this._selectedBandId = band.id;
|
|
692
|
+
this._selectedElementId = null;
|
|
693
|
+
this._activePanel = 'properties';
|
|
694
|
+
this.requestUpdate();
|
|
695
|
+
}}>
|
|
696
|
+
<span>${BAND_LABELS[band.type] || band.type}</span>
|
|
697
|
+
<span style="font-weight:normal">${band.height}${unit}</span>
|
|
698
|
+
</div>
|
|
699
|
+
<div class="band-body" style="height:${bandHeight}px;"
|
|
700
|
+
@drop=${(e) => this._onBandDrop(e, band.id)}
|
|
701
|
+
@dragover=${this._onBandDragOver}>
|
|
702
|
+
${band.elements.map(el => this._renderDesignElement(el, band.id))}
|
|
703
|
+
</div>
|
|
704
|
+
</div>
|
|
705
|
+
`;
|
|
706
|
+
}
|
|
707
|
+
_renderDesignElement(el, bandId) {
|
|
708
|
+
const isSelected = this._selectedElementId === el.id;
|
|
709
|
+
const style = el.style || {};
|
|
710
|
+
let content = '';
|
|
711
|
+
switch (el.type) {
|
|
712
|
+
case 'text':
|
|
713
|
+
content = el.content;
|
|
714
|
+
break;
|
|
715
|
+
case 'field':
|
|
716
|
+
content = el.field ? `[${el.field}]` : '[field]';
|
|
717
|
+
break;
|
|
718
|
+
case 'image':
|
|
719
|
+
content = '[IMG]';
|
|
720
|
+
break;
|
|
721
|
+
case 'barcode':
|
|
722
|
+
content = `[${el.barcodeType}]`;
|
|
723
|
+
break;
|
|
724
|
+
case 'pageNumber':
|
|
725
|
+
content = el.format || 'Page #';
|
|
726
|
+
break;
|
|
727
|
+
case 'currentDate':
|
|
728
|
+
content = el.format || 'Date';
|
|
729
|
+
break;
|
|
730
|
+
case 'rect':
|
|
731
|
+
content = '';
|
|
732
|
+
break;
|
|
733
|
+
case 'line':
|
|
734
|
+
content = '';
|
|
735
|
+
break;
|
|
736
|
+
default: content = `[${el.type}]`;
|
|
737
|
+
}
|
|
738
|
+
const elStyle = `
|
|
739
|
+
left:${el.x}px;top:${el.y}px;width:${el.width}px;height:${el.height}px;
|
|
740
|
+
font-size:${style.fontSize || 12}px;
|
|
741
|
+
font-weight:${style.fontWeight || 'normal'};
|
|
742
|
+
font-family:${style.fontFamily || 'inherit'};
|
|
743
|
+
color:${style.color || 'inherit'};
|
|
744
|
+
background:${style.backgroundColor || 'transparent'};
|
|
745
|
+
text-align:${style.textAlign || 'left'};
|
|
746
|
+
`;
|
|
747
|
+
if (el.type === 'line') {
|
|
748
|
+
return html `
|
|
749
|
+
<div class="element ${isSelected ? 'selected' : ''}"
|
|
750
|
+
style="left:${el.x}px;top:${el.y}px;width:${el.width}px;height:2px;background:#000;"
|
|
751
|
+
@mousedown=${(e) => this._onElementMouseDown(e, el.id, bandId)}>
|
|
752
|
+
<div class="resize-handle"
|
|
753
|
+
@mousedown=${(e) => this._onResizeMouseDown(e, el.id, bandId)}></div>
|
|
754
|
+
</div>
|
|
755
|
+
`;
|
|
756
|
+
}
|
|
757
|
+
if (el.type === 'rect') {
|
|
758
|
+
const ls = el.lineStyle || {};
|
|
759
|
+
return html `
|
|
760
|
+
<div class="element ${isSelected ? 'selected' : ''}"
|
|
761
|
+
style="left:${el.x}px;top:${el.y}px;width:${el.width}px;height:${el.height}px;border:${ls.width || 1}px ${ls.style || 'solid'} ${ls.color || '#000'};background:${el.fill || 'transparent'};"
|
|
762
|
+
@mousedown=${(e) => this._onElementMouseDown(e, el.id, bandId)}>
|
|
763
|
+
<div class="resize-handle"
|
|
764
|
+
@mousedown=${(e) => this._onResizeMouseDown(e, el.id, bandId)}></div>
|
|
765
|
+
</div>
|
|
766
|
+
`;
|
|
767
|
+
}
|
|
768
|
+
return html `
|
|
769
|
+
<div class="element ${isSelected ? 'selected' : ''}"
|
|
770
|
+
style="${elStyle}"
|
|
771
|
+
@mousedown=${(e) => this._onElementMouseDown(e, el.id, bandId)}>
|
|
772
|
+
${content}
|
|
773
|
+
<div class="resize-handle"
|
|
774
|
+
@mousedown=${(e) => this._onResizeMouseDown(e, el.id, bandId)}></div>
|
|
775
|
+
</div>
|
|
776
|
+
`;
|
|
777
|
+
}
|
|
778
|
+
_renderPropertiesPanel() {
|
|
779
|
+
const el = this._getSelectedElement();
|
|
780
|
+
// Band properties
|
|
781
|
+
if (!el && this._selectedBandId) {
|
|
782
|
+
const band = this._layout.bands.find(b => b.id === this._selectedBandId);
|
|
783
|
+
if (!band)
|
|
784
|
+
return html `<div style="padding:12px;color:var(--zrd-text-muted)">Select an element</div>`;
|
|
785
|
+
return html `
|
|
786
|
+
<div class="prop-section">
|
|
787
|
+
<h4>Band: ${BAND_LABELS[band.type]}</h4>
|
|
788
|
+
<div class="prop-row">
|
|
789
|
+
<span class="prop-label">Height</span>
|
|
790
|
+
<input class="prop-input" type="number" .value=${String(band.height)}
|
|
791
|
+
@change=${(e) => this._updateBandHeight(band.id, Number(e.target.value))} />
|
|
792
|
+
</div>
|
|
793
|
+
<div class="prop-row">
|
|
794
|
+
<span class="prop-label">Background</span>
|
|
795
|
+
<input class="prop-input" type="color" .value=${band.backgroundColor || '#ffffff'}
|
|
796
|
+
@change=${(e) => { band.backgroundColor = e.target.value; this._commitChange(); }} />
|
|
797
|
+
</div>
|
|
798
|
+
</div>
|
|
799
|
+
`;
|
|
800
|
+
}
|
|
801
|
+
if (!el)
|
|
802
|
+
return html `<div style="padding:12px;color:var(--zrd-text-muted)">Select an element to edit its properties</div>`;
|
|
803
|
+
return html `
|
|
804
|
+
<div class="prop-section">
|
|
805
|
+
<h4>Position</h4>
|
|
806
|
+
<div class="prop-row">
|
|
807
|
+
<span class="prop-label">X</span>
|
|
808
|
+
<input class="prop-input" type="number" .value=${String(el.x)}
|
|
809
|
+
@change=${(e) => this._updateElementProp('x', Number(e.target.value))} />
|
|
810
|
+
</div>
|
|
811
|
+
<div class="prop-row">
|
|
812
|
+
<span class="prop-label">Y</span>
|
|
813
|
+
<input class="prop-input" type="number" .value=${String(el.y)}
|
|
814
|
+
@change=${(e) => this._updateElementProp('y', Number(e.target.value))} />
|
|
815
|
+
</div>
|
|
816
|
+
<div class="prop-row">
|
|
817
|
+
<span class="prop-label">Width</span>
|
|
818
|
+
<input class="prop-input" type="number" .value=${String(el.width)}
|
|
819
|
+
@change=${(e) => this._updateElementProp('width', Number(e.target.value))} />
|
|
820
|
+
</div>
|
|
821
|
+
<div class="prop-row">
|
|
822
|
+
<span class="prop-label">Height</span>
|
|
823
|
+
<input class="prop-input" type="number" .value=${String(el.height)}
|
|
824
|
+
@change=${(e) => this._updateElementProp('height', Number(e.target.value))} />
|
|
825
|
+
</div>
|
|
826
|
+
</div>
|
|
827
|
+
|
|
828
|
+
<div class="prop-section">
|
|
829
|
+
<h4>Style</h4>
|
|
830
|
+
<div class="prop-row">
|
|
831
|
+
<span class="prop-label">Font Size</span>
|
|
832
|
+
<input class="prop-input" type="number" .value=${String(el.style?.fontSize || 12)}
|
|
833
|
+
@change=${(e) => this._updateElementStyle('fontSize', Number(e.target.value))} />
|
|
834
|
+
</div>
|
|
835
|
+
<div class="prop-row">
|
|
836
|
+
<span class="prop-label">Font</span>
|
|
837
|
+
<select class="prop-input" .value=${el.style?.fontFamily || 'Arial'}
|
|
838
|
+
@change=${(e) => this._updateElementStyle('fontFamily', e.target.value)}>
|
|
839
|
+
<option>Arial</option><option>Times New Roman</option><option>Courier New</option>
|
|
840
|
+
<option>Verdana</option><option>Georgia</option><option>Helvetica</option>
|
|
841
|
+
</select>
|
|
842
|
+
</div>
|
|
843
|
+
<div class="prop-row">
|
|
844
|
+
<span class="prop-label">Bold</span>
|
|
845
|
+
<input type="checkbox" .checked=${el.style?.fontWeight === 'bold'}
|
|
846
|
+
@change=${(e) => this._updateElementStyle('fontWeight', e.target.checked ? 'bold' : 'normal')} />
|
|
847
|
+
</div>
|
|
848
|
+
<div class="prop-row">
|
|
849
|
+
<span class="prop-label">Align</span>
|
|
850
|
+
<select class="prop-input" .value=${el.style?.textAlign || 'left'}
|
|
851
|
+
@change=${(e) => this._updateElementStyle('textAlign', e.target.value)}>
|
|
852
|
+
<option>left</option><option>center</option><option>right</option>
|
|
853
|
+
</select>
|
|
854
|
+
</div>
|
|
855
|
+
<div class="prop-row">
|
|
856
|
+
<span class="prop-label">Color</span>
|
|
857
|
+
<input class="prop-input" type="color" .value=${el.style?.color || '#333333'}
|
|
858
|
+
@change=${(e) => this._updateElementStyle('color', e.target.value)} />
|
|
859
|
+
</div>
|
|
860
|
+
<div class="prop-row">
|
|
861
|
+
<span class="prop-label">Bg Color</span>
|
|
862
|
+
<input class="prop-input" type="color" .value=${el.style?.backgroundColor || '#ffffff'}
|
|
863
|
+
@change=${(e) => this._updateElementStyle('backgroundColor', e.target.value)} />
|
|
864
|
+
</div>
|
|
865
|
+
</div>
|
|
866
|
+
|
|
867
|
+
${el.type === 'text' ? html `
|
|
868
|
+
<div class="prop-section">
|
|
869
|
+
<h4>Content</h4>
|
|
870
|
+
<div class="prop-row">
|
|
871
|
+
<textarea class="prop-input" style="min-height:60px;resize:vertical;" .value=${el.content}
|
|
872
|
+
@change=${(e) => this._updateElementProp('content', e.target.value)}></textarea>
|
|
873
|
+
</div>
|
|
874
|
+
</div>
|
|
875
|
+
` : nothing}
|
|
876
|
+
|
|
877
|
+
${el.type === 'field' ? html `
|
|
878
|
+
<div class="prop-section">
|
|
879
|
+
<h4>Field Binding</h4>
|
|
880
|
+
<div class="prop-row">
|
|
881
|
+
<span class="prop-label">Source</span>
|
|
882
|
+
<select class="prop-input" .value=${el.dataSource || ''}
|
|
883
|
+
@change=${(e) => this._updateElementProp('dataSource', e.target.value)}>
|
|
884
|
+
<option value="">-- select --</option>
|
|
885
|
+
${this._layout.dataSources.map(ds => html `<option value="${ds.id}">${ds.name}</option>`)}
|
|
886
|
+
</select>
|
|
887
|
+
</div>
|
|
888
|
+
<div class="prop-row">
|
|
889
|
+
<span class="prop-label">Field</span>
|
|
890
|
+
<input class="prop-input" .value=${el.field || ''}
|
|
891
|
+
@change=${(e) => this._updateElementProp('field', e.target.value)} />
|
|
892
|
+
</div>
|
|
893
|
+
<div class="prop-row">
|
|
894
|
+
<span class="prop-label">Format</span>
|
|
895
|
+
<input class="prop-input" .value=${el.format || ''}
|
|
896
|
+
placeholder="$#,##0.00"
|
|
897
|
+
@change=${(e) => this._updateElementProp('format', e.target.value)} />
|
|
898
|
+
</div>
|
|
899
|
+
<div class="prop-row">
|
|
900
|
+
<span class="prop-label">Aggregate</span>
|
|
901
|
+
<select class="prop-input" .value=${el.aggregate || ''}
|
|
902
|
+
@change=${(e) => this._updateElementProp('aggregate', e.target.value || undefined)}>
|
|
903
|
+
<option value="">None</option>
|
|
904
|
+
<option>sum</option><option>avg</option><option>count</option><option>min</option><option>max</option>
|
|
905
|
+
</select>
|
|
906
|
+
</div>
|
|
907
|
+
</div>
|
|
908
|
+
` : nothing}
|
|
909
|
+
|
|
910
|
+
${el.type === 'image' ? html `
|
|
911
|
+
<div class="prop-section">
|
|
912
|
+
<h4>Image</h4>
|
|
913
|
+
<div class="prop-row">
|
|
914
|
+
<span class="prop-label">URL/Expr</span>
|
|
915
|
+
<input class="prop-input" .value=${el.src || ''}
|
|
916
|
+
@change=${(e) => this._updateElementProp('src', e.target.value)} />
|
|
917
|
+
</div>
|
|
918
|
+
<div class="prop-row">
|
|
919
|
+
<span class="prop-label">Fit</span>
|
|
920
|
+
<select class="prop-input" .value=${el.fit || 'contain'}
|
|
921
|
+
@change=${(e) => this._updateElementProp('fit', e.target.value)}>
|
|
922
|
+
<option>contain</option><option>cover</option><option>fill</option><option>none</option>
|
|
923
|
+
</select>
|
|
924
|
+
</div>
|
|
925
|
+
</div>
|
|
926
|
+
` : nothing}
|
|
927
|
+
|
|
928
|
+
<div class="prop-section" style="margin-top:20px;">
|
|
929
|
+
<button class="btn-danger" @click=${this._deleteSelectedElement}>Delete Element</button>
|
|
930
|
+
</div>
|
|
931
|
+
`;
|
|
932
|
+
}
|
|
933
|
+
};
|
|
934
|
+
__decorate([
|
|
935
|
+
property({ type: Object })
|
|
936
|
+
], ZenttoReportDesigner.prototype, "layout", void 0);
|
|
937
|
+
__decorate([
|
|
938
|
+
property({ type: Object })
|
|
939
|
+
], ZenttoReportDesigner.prototype, "sampleData", void 0);
|
|
940
|
+
__decorate([
|
|
941
|
+
property({ type: Array })
|
|
942
|
+
], ZenttoReportDesigner.prototype, "dataSources", void 0);
|
|
943
|
+
__decorate([
|
|
944
|
+
property({ type: Number, attribute: 'grid-snap' })
|
|
945
|
+
], ZenttoReportDesigner.prototype, "gridSnap", void 0);
|
|
946
|
+
__decorate([
|
|
947
|
+
property({ type: Boolean, attribute: 'show-preview' })
|
|
948
|
+
], ZenttoReportDesigner.prototype, "showPreview", void 0);
|
|
949
|
+
__decorate([
|
|
950
|
+
property({ type: Number, attribute: 'auto-save-ms' })
|
|
951
|
+
], ZenttoReportDesigner.prototype, "autoSaveMs", void 0);
|
|
952
|
+
__decorate([
|
|
953
|
+
state()
|
|
954
|
+
], ZenttoReportDesigner.prototype, "_layout", void 0);
|
|
955
|
+
__decorate([
|
|
956
|
+
state()
|
|
957
|
+
], ZenttoReportDesigner.prototype, "_selectedElementId", void 0);
|
|
958
|
+
__decorate([
|
|
959
|
+
state()
|
|
960
|
+
], ZenttoReportDesigner.prototype, "_selectedBandId", void 0);
|
|
961
|
+
__decorate([
|
|
962
|
+
state()
|
|
963
|
+
], ZenttoReportDesigner.prototype, "_drag", void 0);
|
|
964
|
+
__decorate([
|
|
965
|
+
state()
|
|
966
|
+
], ZenttoReportDesigner.prototype, "_resize", void 0);
|
|
967
|
+
__decorate([
|
|
968
|
+
state()
|
|
969
|
+
], ZenttoReportDesigner.prototype, "_activePanel", void 0);
|
|
970
|
+
__decorate([
|
|
971
|
+
state()
|
|
972
|
+
], ZenttoReportDesigner.prototype, "_undoStack", void 0);
|
|
973
|
+
__decorate([
|
|
974
|
+
state()
|
|
975
|
+
], ZenttoReportDesigner.prototype, "_redoStack", void 0);
|
|
976
|
+
ZenttoReportDesigner = __decorate([
|
|
977
|
+
customElement('zentto-report-designer')
|
|
978
|
+
], ZenttoReportDesigner);
|
|
979
|
+
export { ZenttoReportDesigner };
|
|
980
|
+
export { ZenttoReportDesigner as default };
|
|
981
|
+
//# sourceMappingURL=zentto-report-designer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zentto-report-designer.js","sourceRoot":"","sources":["../src/zentto-report-designer.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAkE;AAClE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAWnE,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAuB9D,MAAM,WAAW,GAA6B;IAC5C,YAAY,EAAE,eAAe;IAC7B,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,cAAc;IAC3B,YAAY,EAAE,eAAe;IAC7B,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,eAAe;IAC7B,WAAW,EAAE,cAAc;IAC3B,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,eAAe;CAC9B,CAAC;AAEF,MAAM,aAAa,GAAyD;IAC1E,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE;IAC1C,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE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AK,EAAE;0DAAqE;AAC5D;IAAhB,KAAK,EAAE;wDAAmC;AAC1B;IAAhB,KAAK,EAAE;wDAAmC;AArChC,oBAAoB;IADhC,aAAa,CAAC,wBAAwB,CAAC;GAC3B,oBAAoB,CAq7BhC;;AAQD,OAAO,EAAE,oBAAoB,IAAI,OAAO,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zentto/report-designer",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "WYSIWYG report designer web component. Drag-and-drop elements, band management, property editing, live preview.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/zentto-report-designer.js",
|
|
7
|
+
"types": "dist/zentto-report-designer.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/zentto-report-designer.d.ts",
|
|
11
|
+
"import": "./dist/zentto-report-designer.js",
|
|
12
|
+
"default": "./dist/zentto-report-designer.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"dev": "tsc --watch",
|
|
22
|
+
"clean": "rm -rf dist"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@zentto/report-core": "*",
|
|
26
|
+
"@zentto/report-viewer": "*",
|
|
27
|
+
"lit": "^3.2.0",
|
|
28
|
+
"@interactjs/interact": "^1.10.27"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"typescript": "^5.7.0"
|
|
32
|
+
},
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/zentto-erp/zentto-report"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"report",
|
|
40
|
+
"designer",
|
|
41
|
+
"wysiwyg",
|
|
42
|
+
"drag-drop",
|
|
43
|
+
"web-component",
|
|
44
|
+
"zentto"
|
|
45
|
+
]
|
|
46
|
+
}
|