@operato/data-mapper 9.0.0-beta.50 → 9.0.0-beta.52
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/CHANGELOG.md +16 -0
- package/dist/src/components/function-box-options-builder.d.ts +18 -0
- package/dist/src/components/function-box-options-builder.js +145 -0
- package/dist/src/components/function-box-options-builder.js.map +1 -0
- package/dist/src/components/function-box-popup.d.ts +15 -0
- package/dist/src/components/function-box-popup.js +236 -0
- package/dist/src/components/function-box-popup.js.map +1 -0
- package/dist/src/components/property-editor.d.ts +34 -0
- package/dist/src/components/property-editor.js +76 -0
- package/dist/src/components/property-editor.js.map +1 -0
- package/dist/src/context/data-mapper-context.d.ts +12 -0
- package/dist/src/context/data-mapper-context.js +3 -0
- package/dist/src/context/data-mapper-context.js.map +1 -0
- package/dist/src/functions/custom-script.d.ts +10 -0
- package/dist/src/functions/custom-script.js +49 -0
- package/dist/src/functions/custom-script.js.map +1 -0
- package/dist/src/functions/date-formatting.d.ts +10 -0
- package/dist/src/functions/date-formatting.js +59 -0
- package/dist/src/functions/date-formatting.js.map +1 -0
- package/dist/src/functions/index.d.ts +10 -0
- package/dist/src/functions/index.js +19 -0
- package/dist/src/functions/index.js.map +1 -0
- package/dist/src/functions/json-query.d.ts +10 -0
- package/dist/src/functions/json-query.js +116 -0
- package/dist/src/functions/json-query.js.map +1 -0
- package/dist/src/functions/passthrough.d.ts +6 -0
- package/dist/src/functions/passthrough.js +38 -0
- package/dist/src/functions/passthrough.js.map +1 -0
- package/dist/src/functions/range-mapping.d.ts +10 -0
- package/dist/src/functions/range-mapping.js +106 -0
- package/dist/src/functions/range-mapping.js.map +1 -0
- package/dist/src/functions/string-manipulation.d.ts +33 -0
- package/dist/src/functions/string-manipulation.js +215 -0
- package/dist/src/functions/string-manipulation.js.map +1 -0
- package/dist/src/functions/text-transform.d.ts +25 -0
- package/dist/src/functions/text-transform.js +167 -0
- package/dist/src/functions/text-transform.js.map +1 -0
- package/dist/src/functions/value-mapping.d.ts +10 -0
- package/dist/src/functions/value-mapping.js +109 -0
- package/dist/src/functions/value-mapping.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-data-mapper.d.ts +12 -13
- package/dist/src/ox-data-mapper.js +159 -118
- package/dist/src/ox-data-mapper.js.map +1 -1
- package/dist/src/ox-mapping-area.d.ts +36 -0
- package/dist/src/ox-mapping-area.js +382 -0
- package/dist/src/ox-mapping-area.js.map +1 -0
- package/dist/src/types.d.ts +19 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/stories/ox-data-mapper.stories.d.ts +4 -4
- package/dist/stories/ox-data-mapper.stories.js +39 -17
- package/dist/stories/ox-data-mapper.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -3
- package/translations/en.json +3 -0
- package/translations/ja.json +3 -0
- package/translations/ko.json +3 -0
- package/translations/ms.json +3 -0
- package/translations/zh.json +3 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, html, svg, css, nothing } from 'lit';
|
|
3
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
|
+
import { consume } from '@lit/context';
|
|
5
|
+
import { OxPopup } from '@operato/popup';
|
|
6
|
+
import { dataMapperContext } from './context/data-mapper-context.js';
|
|
7
|
+
import './components/function-box-popup.js';
|
|
8
|
+
let OxMappingArea = class OxMappingArea extends LitElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.mappings = [];
|
|
12
|
+
this.popupVisible = false;
|
|
13
|
+
this.popupPosition = { x: 0, y: 0 };
|
|
14
|
+
this.handleKeyDown = (e) => {
|
|
15
|
+
if (e.key === 'Delete' || e.key === 'Backspace') {
|
|
16
|
+
if (this.selectedLine) {
|
|
17
|
+
this.deleteSelectedLine();
|
|
18
|
+
}
|
|
19
|
+
else if (this.selectedMapping) {
|
|
20
|
+
this.deleteSelectedMapping();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
this.handleResize = () => {
|
|
25
|
+
this.requestUpdate();
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
super.connectedCallback();
|
|
30
|
+
window.addEventListener('resize', this.handleResize);
|
|
31
|
+
window.addEventListener('keydown', this.handleKeyDown);
|
|
32
|
+
}
|
|
33
|
+
disconnectedCallback() {
|
|
34
|
+
super.disconnectedCallback();
|
|
35
|
+
window.removeEventListener('resize', this.handleResize);
|
|
36
|
+
window.removeEventListener('keydown', this.handleKeyDown);
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
const mappings = this.mappings || [];
|
|
40
|
+
return html `
|
|
41
|
+
<div class="mapping-area" @dragover=${this.handleDragOver} @drop=${this.handleDrop}>
|
|
42
|
+
<svg>${mappings.map(m => this.renderMapping(m))}</svg>
|
|
43
|
+
</div>
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
renderMapping(mapping) {
|
|
47
|
+
var _a;
|
|
48
|
+
const mappingAreaWidth = this.clientWidth;
|
|
49
|
+
const x = mappingAreaWidth / 2 - 50;
|
|
50
|
+
let y = mapping.position.y;
|
|
51
|
+
if (y === undefined) {
|
|
52
|
+
const positions = [...mapping.inputs, ...mapping.outputs]
|
|
53
|
+
.map(nodeId => this.dataMapperContext.getNodePosition(nodeId, mapping.inputs.includes(nodeId)))
|
|
54
|
+
.filter(Boolean);
|
|
55
|
+
y =
|
|
56
|
+
positions.length > 0
|
|
57
|
+
? positions.reduce((sum, pos) => sum + pos.y, 0) / positions.length - 10
|
|
58
|
+
: this.clientHeight / 2 - 10;
|
|
59
|
+
}
|
|
60
|
+
return svg `
|
|
61
|
+
<defs>
|
|
62
|
+
<!-- 기본 화살표 (검은색) -->
|
|
63
|
+
<marker id="arrowhead" markerWidth="6" markerHeight="4" refX="5.4" refY="2" orient="auto" markerUnits="strokeWidth">
|
|
64
|
+
<polygon points="0 0, 6 2, 0 4" />
|
|
65
|
+
</marker>
|
|
66
|
+
|
|
67
|
+
<!-- 선택된 화살표 (붉은색) -->
|
|
68
|
+
<marker id="arrowhead-selected" markerWidth="6" markerHeight="4" refX="5.4" refY="2" orient="auto" markerUnits="strokeWidth">
|
|
69
|
+
<polygon points="0 0, 6 2, 0 4" />
|
|
70
|
+
</marker>
|
|
71
|
+
</defs>
|
|
72
|
+
|
|
73
|
+
<g>
|
|
74
|
+
${mapping.inputs.map(input => {
|
|
75
|
+
const sourcePos = this.dataMapperContext.getNodePosition(input, true);
|
|
76
|
+
const isSelected = this.isLineSelected(mapping, input, true);
|
|
77
|
+
return sourcePos
|
|
78
|
+
? svg `
|
|
79
|
+
<!-- 베지어 커브 경로 -->
|
|
80
|
+
<path
|
|
81
|
+
d="M ${sourcePos.x},${sourcePos.y}
|
|
82
|
+
C ${sourcePos.x + 100},${sourcePos.y}
|
|
83
|
+
${x - 100},${y + 10}
|
|
84
|
+
${x},${y + 10}"
|
|
85
|
+
class="mapping-line"
|
|
86
|
+
marker-end="url(#${isSelected ? 'arrowhead-selected' : 'arrowhead'})"
|
|
87
|
+
?selected=${isSelected}>
|
|
88
|
+
</path>
|
|
89
|
+
|
|
90
|
+
<!-- 클릭 이벤트를 위한 히트박스 -->
|
|
91
|
+
<path d="M ${sourcePos.x},${sourcePos.y}
|
|
92
|
+
C ${sourcePos.x + 100},${sourcePos.y}
|
|
93
|
+
${x - 100},${y + 10}
|
|
94
|
+
${x},${y + 10}"
|
|
95
|
+
class="mapping-line-for-select"
|
|
96
|
+
@click=${() => this.selectMappingLine(mapping, input, true)}>
|
|
97
|
+
</path>
|
|
98
|
+
`
|
|
99
|
+
: nothing;
|
|
100
|
+
})}
|
|
101
|
+
|
|
102
|
+
<rect class="mapping-box"
|
|
103
|
+
width="100" height="20"
|
|
104
|
+
x=${x} y=${y}
|
|
105
|
+
?selected=${((_a = this.selectedMapping) === null || _a === void 0 ? void 0 : _a.id) === mapping.id}
|
|
106
|
+
@pointerdown=${(e) => this.startDragForMappingBox(e, mapping)}
|
|
107
|
+
@click=${() => this.selectMappingBox(mapping)}
|
|
108
|
+
@dblclick=${(e) => this.openPopup(e, mapping)}>
|
|
109
|
+
</rect>
|
|
110
|
+
|
|
111
|
+
<text x=${x + 50} y=${y + 15} fill="black" font-size="12" text-anchor="middle" pointer-events="none">
|
|
112
|
+
${mapping.mappingFunction || 'passthrough'}
|
|
113
|
+
</text>
|
|
114
|
+
|
|
115
|
+
${mapping.outputs.map(output => {
|
|
116
|
+
const targetPos = this.dataMapperContext.getNodePosition(output, false);
|
|
117
|
+
const isSelected = this.isLineSelected(mapping, output, false);
|
|
118
|
+
return targetPos
|
|
119
|
+
? svg `
|
|
120
|
+
<!-- 베지어 커브 경로 -->
|
|
121
|
+
<path
|
|
122
|
+
d="M ${x + 100},${y + 10}
|
|
123
|
+
C ${x + 200},${y + 10}
|
|
124
|
+
${targetPos.x - 100},${targetPos.y}
|
|
125
|
+
${targetPos.x},${targetPos.y}"
|
|
126
|
+
class="mapping-line"
|
|
127
|
+
marker-end="url(#${isSelected ? 'arrowhead-selected' : 'arrowhead'})"
|
|
128
|
+
?selected=${isSelected}>
|
|
129
|
+
</path>
|
|
130
|
+
|
|
131
|
+
<!-- 클릭 이벤트를 위한 히트박스 -->
|
|
132
|
+
<path d="M ${x + 100},${y + 10}
|
|
133
|
+
C ${x + 200},${y + 10}
|
|
134
|
+
${targetPos.x - 100},${targetPos.y}
|
|
135
|
+
${targetPos.x},${targetPos.y}"
|
|
136
|
+
class="mapping-line-for-select"
|
|
137
|
+
@click=${() => this.selectMappingLine(mapping, output, false)}>
|
|
138
|
+
</path>
|
|
139
|
+
`
|
|
140
|
+
: nothing;
|
|
141
|
+
})}
|
|
142
|
+
</g>
|
|
143
|
+
`;
|
|
144
|
+
}
|
|
145
|
+
startDragForMappingBox(e, mapping) {
|
|
146
|
+
e.stopPropagation();
|
|
147
|
+
let dragStartY = mapping.position.y;
|
|
148
|
+
let dragOffsetY = e.clientY;
|
|
149
|
+
let draggingBox = mapping;
|
|
150
|
+
const onDrag = (e) => {
|
|
151
|
+
e.preventDefault();
|
|
152
|
+
if (!draggingBox)
|
|
153
|
+
return;
|
|
154
|
+
const newY = dragStartY + e.clientY - dragOffsetY;
|
|
155
|
+
const minY = 0;
|
|
156
|
+
const maxY = this.clientHeight - 20;
|
|
157
|
+
draggingBox.position = {
|
|
158
|
+
x: this.clientWidth / 2 - 50,
|
|
159
|
+
y: Math.max(minY, Math.min(maxY, newY))
|
|
160
|
+
};
|
|
161
|
+
this.requestUpdate();
|
|
162
|
+
};
|
|
163
|
+
const stopDrag = (e) => {
|
|
164
|
+
e.stopPropagation();
|
|
165
|
+
window.removeEventListener('pointermove', onDrag);
|
|
166
|
+
window.removeEventListener('pointerup', stopDrag);
|
|
167
|
+
this.dataMapperContext.updateMappings([...this.mappings]);
|
|
168
|
+
};
|
|
169
|
+
window.addEventListener('pointermove', onDrag);
|
|
170
|
+
window.addEventListener('pointerup', stopDrag);
|
|
171
|
+
}
|
|
172
|
+
handleDragOver(e) {
|
|
173
|
+
e.preventDefault();
|
|
174
|
+
}
|
|
175
|
+
handleDrop(e) {
|
|
176
|
+
e.preventDefault();
|
|
177
|
+
const nodeId = e.dataTransfer.getData('application/node-id');
|
|
178
|
+
if (!nodeId) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const from = e.dataTransfer.getData('application/from');
|
|
182
|
+
const { top, left } = this.getBoundingClientRect();
|
|
183
|
+
const dropX = e.clientX - left;
|
|
184
|
+
const dropY = e.clientY - top;
|
|
185
|
+
let droppedOnExistingBox = false;
|
|
186
|
+
let selectedMapping = null;
|
|
187
|
+
const mappings = this.mappings.map(mapping => {
|
|
188
|
+
const boxY = mapping.position.y;
|
|
189
|
+
const boxX = this.clientWidth / 2 - 50;
|
|
190
|
+
if (dropY >= boxY && dropY <= boxY + 20 && dropX >= boxX && dropX < boxX + 100) {
|
|
191
|
+
droppedOnExistingBox = true;
|
|
192
|
+
const updatedMapping = {
|
|
193
|
+
...mapping,
|
|
194
|
+
inputs: from === 'source' ? [...new Set([...mapping.inputs, nodeId])] : mapping.inputs,
|
|
195
|
+
outputs: from === 'source' ? mapping.outputs : [...new Set([...mapping.outputs, nodeId])]
|
|
196
|
+
};
|
|
197
|
+
selectedMapping = updatedMapping;
|
|
198
|
+
return updatedMapping;
|
|
199
|
+
}
|
|
200
|
+
return mapping;
|
|
201
|
+
});
|
|
202
|
+
if (!droppedOnExistingBox) {
|
|
203
|
+
const createdMapping = {
|
|
204
|
+
id: this.dataMapperContext.getUniqueId(),
|
|
205
|
+
function: 'Transform',
|
|
206
|
+
inputs: from == 'source' ? [nodeId] : [],
|
|
207
|
+
outputs: from == 'source' ? [] : [nodeId],
|
|
208
|
+
position: { x: this.clientWidth / 2 - 50, y: dropY - 10 }
|
|
209
|
+
};
|
|
210
|
+
mappings.push(createdMapping);
|
|
211
|
+
selectedMapping = createdMapping;
|
|
212
|
+
}
|
|
213
|
+
this.dataMapperContext.updateMappings(mappings);
|
|
214
|
+
selectedMapping && this.selectMappingBox(selectedMapping);
|
|
215
|
+
}
|
|
216
|
+
selectMappingBox(mapping) {
|
|
217
|
+
this.selectedMapping = mapping;
|
|
218
|
+
this.selectedLine = undefined;
|
|
219
|
+
this.requestUpdate();
|
|
220
|
+
}
|
|
221
|
+
selectMappingLine(mapping, nodeId, isInput) {
|
|
222
|
+
this.selectedMapping = undefined;
|
|
223
|
+
this.selectedLine = { mapping, nodeId, isInput };
|
|
224
|
+
this.requestUpdate();
|
|
225
|
+
}
|
|
226
|
+
isLineSelected(mapping, nodeId, isInput) {
|
|
227
|
+
var _a;
|
|
228
|
+
return (((_a = this.selectedLine) === null || _a === void 0 ? void 0 : _a.mapping) === mapping &&
|
|
229
|
+
this.selectedLine.nodeId === nodeId &&
|
|
230
|
+
this.selectedLine.isInput === isInput);
|
|
231
|
+
}
|
|
232
|
+
openPopup(e, mapping) {
|
|
233
|
+
const popup = OxPopup.open({
|
|
234
|
+
template: html `
|
|
235
|
+
<function-box-popup
|
|
236
|
+
.mapping=${mapping}
|
|
237
|
+
@change=${(e) => {
|
|
238
|
+
const changed = e.detail;
|
|
239
|
+
this.dataMapperContext.updateMappings(this.mappings.map(mapping => {
|
|
240
|
+
if (mapping.id !== changed.id) {
|
|
241
|
+
return mapping;
|
|
242
|
+
}
|
|
243
|
+
return changed;
|
|
244
|
+
}));
|
|
245
|
+
popup.close();
|
|
246
|
+
}}
|
|
247
|
+
></function-box-popup>
|
|
248
|
+
`,
|
|
249
|
+
style: 'width: 80vw; height: 80vh;',
|
|
250
|
+
preventCloseOnBlur: true,
|
|
251
|
+
backdrop: true
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
getSelectedTransformLogic() {
|
|
255
|
+
const mapping = this.mappings.find(m => m === this.selectedMapping);
|
|
256
|
+
return (mapping === null || mapping === void 0 ? void 0 : mapping.mappingFunction) || 'passthrough';
|
|
257
|
+
}
|
|
258
|
+
updateTransformLogic(e) {
|
|
259
|
+
const input = e.target;
|
|
260
|
+
const mappings = this.mappings.map(m => m.mappingFunction === this.selectedMapping ? { ...m, mappingFunction: input.value } : m);
|
|
261
|
+
this.dataMapperContext.updateMappings(mappings);
|
|
262
|
+
}
|
|
263
|
+
deleteSelectedLine() {
|
|
264
|
+
if (!this.selectedLine)
|
|
265
|
+
return;
|
|
266
|
+
const { mapping, nodeId, isInput } = this.selectedLine;
|
|
267
|
+
const updatedMappings = this.mappings
|
|
268
|
+
.map(m => m === mapping
|
|
269
|
+
? {
|
|
270
|
+
...m,
|
|
271
|
+
inputs: isInput ? m.inputs.filter(id => id !== nodeId) : m.inputs,
|
|
272
|
+
outputs: !isInput ? m.outputs.filter(id => id !== nodeId) : m.outputs
|
|
273
|
+
}
|
|
274
|
+
: m)
|
|
275
|
+
.filter(m => m.inputs.length > 0 || m.outputs.length > 0); // 입력/출력이 모두 삭제되면 제거
|
|
276
|
+
this.dataMapperContext.updateMappings(updatedMappings);
|
|
277
|
+
this.selectedLine = undefined;
|
|
278
|
+
this.requestUpdate();
|
|
279
|
+
}
|
|
280
|
+
deleteSelectedMapping() {
|
|
281
|
+
this.dataMapperContext.updateMappings(this.mappings.filter(m => m !== this.selectedMapping));
|
|
282
|
+
this.selectedMapping = undefined;
|
|
283
|
+
this.requestUpdate();
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
OxMappingArea.styles = css `
|
|
287
|
+
:host {
|
|
288
|
+
display: flex;
|
|
289
|
+
|
|
290
|
+
--line-color: #5b5858;
|
|
291
|
+
--selected-line-color: red;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.mapping-area {
|
|
295
|
+
flex: 1;
|
|
296
|
+
padding: 0;
|
|
297
|
+
margin: 0;
|
|
298
|
+
text-align: center;
|
|
299
|
+
position: relative;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
svg {
|
|
303
|
+
position: absolute;
|
|
304
|
+
top: 0;
|
|
305
|
+
left: 0;
|
|
306
|
+
width: 100%;
|
|
307
|
+
height: 100%;
|
|
308
|
+
pointer-events: none;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.mapping-box {
|
|
312
|
+
fill: rgba(0, 255, 0, 0.3);
|
|
313
|
+
stroke: green;
|
|
314
|
+
stroke-width: 1;
|
|
315
|
+
cursor: grab;
|
|
316
|
+
pointer-events: all;
|
|
317
|
+
user-select: none;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.mapping-box:hover {
|
|
321
|
+
fill: rgba(0, 255, 0, 0.5);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.mapping-box[selected] {
|
|
325
|
+
stroke: var(--selected-line-color);
|
|
326
|
+
stroke-width: 2;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.mapping-line {
|
|
330
|
+
stroke: var(--line-color);
|
|
331
|
+
stroke-width: 1;
|
|
332
|
+
fill: none;
|
|
333
|
+
cursor: pointer;
|
|
334
|
+
pointer-events: all;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.mapping-line[selected] {
|
|
338
|
+
stroke: var(--selected-line-color);
|
|
339
|
+
stroke-width: 1.5;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.mapping-line-for-select {
|
|
343
|
+
stroke: transparent;
|
|
344
|
+
stroke-width: 10;
|
|
345
|
+
fill: none;
|
|
346
|
+
cursor: pointer;
|
|
347
|
+
pointer-events: all;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
marker * {
|
|
351
|
+
stroke: var(--line-color);
|
|
352
|
+
fill: var(--line-color);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
marker#arrowhead-selected * {
|
|
356
|
+
stroke: var(--selected-line-color);
|
|
357
|
+
fill: var(--selected-line-color);
|
|
358
|
+
}
|
|
359
|
+
`;
|
|
360
|
+
__decorate([
|
|
361
|
+
property({ type: Array })
|
|
362
|
+
], OxMappingArea.prototype, "mappings", void 0);
|
|
363
|
+
__decorate([
|
|
364
|
+
state()
|
|
365
|
+
], OxMappingArea.prototype, "selectedMapping", void 0);
|
|
366
|
+
__decorate([
|
|
367
|
+
state()
|
|
368
|
+
], OxMappingArea.prototype, "selectedLine", void 0);
|
|
369
|
+
__decorate([
|
|
370
|
+
state()
|
|
371
|
+
], OxMappingArea.prototype, "popupVisible", void 0);
|
|
372
|
+
__decorate([
|
|
373
|
+
state()
|
|
374
|
+
], OxMappingArea.prototype, "popupPosition", void 0);
|
|
375
|
+
__decorate([
|
|
376
|
+
consume({ context: dataMapperContext, subscribe: true })
|
|
377
|
+
], OxMappingArea.prototype, "dataMapperContext", void 0);
|
|
378
|
+
OxMappingArea = __decorate([
|
|
379
|
+
customElement('ox-mapping-area')
|
|
380
|
+
], OxMappingArea);
|
|
381
|
+
export { OxMappingArea };
|
|
382
|
+
//# sourceMappingURL=ox-mapping-area.js.map
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CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA,CAAC,oBAAoB;QAEhF,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,eAAe,CAAC,CAAA;QACtD,IAAI,CAAC,YAAY,GAAG,SAAS,CAAA;QAC7B,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC;IAED,qBAAqB;QACnB,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,eAAe,CAAC,CAAC,CAAA;QAC5F,IAAI,CAAC,eAAe,GAAG,SAAS,CAAA;QAChC,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC;;AAhZM,oBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyElB,AAzEY,CAyEZ;AAE0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAAyB;AAE1C;IAAR,KAAK,EAAE;sDAA0B;AACzB;IAAR,KAAK,EAAE;mDAAsE;AACrE;IAAR,KAAK,EAAE;mDAA8B;AAC7B;IAAR,KAAK,EAAE;oDAA+B;AAG/B;IADP,OAAO,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;wDACR;AApFtC,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CAsZzB","sourcesContent":["import { LitElement, html, svg, css, nothing, PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { consume } from '@lit/context'\nimport { OxPopup } from '@operato/popup'\n\nimport { Mapping } from './types.js'\nimport { dataMapperContext, DataMapperContextType } from './context/data-mapper-context.js'\nimport './components/function-box-popup.js'\n\n@customElement('ox-mapping-area')\nexport class OxMappingArea extends LitElement {\n static styles = css`\n :host {\n display: flex;\n\n --line-color: #5b5858;\n --selected-line-color: red;\n }\n\n .mapping-area {\n flex: 1;\n padding: 0;\n margin: 0;\n text-align: center;\n position: relative;\n }\n\n svg {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n\n .mapping-box {\n fill: rgba(0, 255, 0, 0.3);\n stroke: green;\n stroke-width: 1;\n cursor: grab;\n pointer-events: all;\n user-select: none;\n }\n\n .mapping-box:hover {\n fill: rgba(0, 255, 0, 0.5);\n }\n\n .mapping-box[selected] {\n stroke: var(--selected-line-color);\n stroke-width: 2;\n }\n\n .mapping-line {\n stroke: var(--line-color);\n stroke-width: 1;\n fill: none;\n cursor: pointer;\n pointer-events: all;\n }\n\n .mapping-line[selected] {\n stroke: var(--selected-line-color);\n stroke-width: 1.5;\n }\n\n .mapping-line-for-select {\n stroke: transparent;\n stroke-width: 10;\n fill: none;\n cursor: pointer;\n pointer-events: all;\n }\n\n marker * {\n stroke: var(--line-color);\n fill: var(--line-color);\n }\n\n marker#arrowhead-selected * {\n stroke: var(--selected-line-color);\n fill: var(--selected-line-color);\n }\n `\n\n @property({ type: Array }) mappings: Mapping[] = []\n\n @state() selectedMapping?: Mapping\n @state() selectedLine?: { mapping: Mapping; nodeId: string; isInput: boolean }\n @state() popupVisible: boolean = false\n @state() popupPosition = { x: 0, y: 0 }\n\n @consume({ context: dataMapperContext, subscribe: true })\n private dataMapperContext!: DataMapperContextType\n\n connectedCallback() {\n super.connectedCallback()\n window.addEventListener('resize', this.handleResize)\n window.addEventListener('keydown', this.handleKeyDown)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n window.removeEventListener('resize', this.handleResize)\n window.removeEventListener('keydown', this.handleKeyDown)\n }\n\n render() {\n const mappings = this.mappings || []\n\n return html`\n <div class=\"mapping-area\" @dragover=${this.handleDragOver} @drop=${this.handleDrop}>\n <svg>${mappings.map(m => this.renderMapping(m))}</svg>\n </div>\n `\n }\n\n renderMapping(mapping: Mapping) {\n const mappingAreaWidth = this.clientWidth\n const x = mappingAreaWidth / 2 - 50\n let y = mapping.position.y\n\n if (y === undefined) {\n const positions = [...mapping.inputs, ...mapping.outputs]\n .map(nodeId => this.dataMapperContext.getNodePosition(nodeId, mapping.inputs.includes(nodeId)))\n .filter(Boolean) as { x: number; y: number }[]\n\n y =\n positions.length > 0\n ? positions.reduce((sum, pos) => sum + pos.y, 0) / positions.length - 10\n : this.clientHeight / 2 - 10\n }\n\n return svg`\n <defs>\n <!-- 기본 화살표 (검은색) -->\n <marker id=\"arrowhead\" markerWidth=\"6\" markerHeight=\"4\" refX=\"5.4\" refY=\"2\" orient=\"auto\" markerUnits=\"strokeWidth\">\n <polygon points=\"0 0, 6 2, 0 4\" />\n </marker>\n\n <!-- 선택된 화살표 (붉은색) -->\n <marker id=\"arrowhead-selected\" markerWidth=\"6\" markerHeight=\"4\" refX=\"5.4\" refY=\"2\" orient=\"auto\" markerUnits=\"strokeWidth\">\n <polygon points=\"0 0, 6 2, 0 4\" />\n </marker>\n </defs>\n \n <g>\n ${mapping.inputs.map(input => {\n const sourcePos = this.dataMapperContext.getNodePosition(input, true)\n const isSelected = this.isLineSelected(mapping, input, true)\n return sourcePos\n ? svg`\n <!-- 베지어 커브 경로 -->\n <path \n d=\"M ${sourcePos.x},${sourcePos.y} \n C ${sourcePos.x + 100},${sourcePos.y} \n ${x - 100},${y + 10} \n ${x},${y + 10}\"\n class=\"mapping-line\"\n marker-end=\"url(#${isSelected ? 'arrowhead-selected' : 'arrowhead'})\"\n ?selected=${isSelected}>\n </path>\n \n <!-- 클릭 이벤트를 위한 히트박스 -->\n <path d=\"M ${sourcePos.x},${sourcePos.y} \n C ${sourcePos.x + 100},${sourcePos.y} \n ${x - 100},${y + 10} \n ${x},${y + 10}\"\n class=\"mapping-line-for-select\"\n @click=${() => this.selectMappingLine(mapping, input, true)}>\n </path>\n `\n : nothing\n })}\n \n <rect class=\"mapping-box\"\n width=\"100\" height=\"20\"\n x=${x} y=${y}\n ?selected=${this.selectedMapping?.id === mapping.id}\n @pointerdown=${(e: PointerEvent) => this.startDragForMappingBox(e, mapping)}\n @click=${() => this.selectMappingBox(mapping)}\n @dblclick=${(e: PointerEvent) => this.openPopup(e, mapping)}>\n </rect>\n \n <text x=${x + 50} y=${y + 15} fill=\"black\" font-size=\"12\" text-anchor=\"middle\" pointer-events=\"none\">\n ${mapping.mappingFunction || 'passthrough'}\n </text>\n \n ${mapping.outputs.map(output => {\n const targetPos = this.dataMapperContext.getNodePosition(output, false)\n const isSelected = this.isLineSelected(mapping, output, false)\n return targetPos\n ? svg`\n <!-- 베지어 커브 경로 -->\n <path \n d=\"M ${x + 100},${y + 10} \n C ${x + 200},${y + 10} \n ${targetPos.x - 100},${targetPos.y} \n ${targetPos.x},${targetPos.y}\"\n class=\"mapping-line\"\n marker-end=\"url(#${isSelected ? 'arrowhead-selected' : 'arrowhead'})\"\n ?selected=${isSelected}>\n </path>\n \n <!-- 클릭 이벤트를 위한 히트박스 -->\n <path d=\"M ${x + 100},${y + 10} \n C ${x + 200},${y + 10} \n ${targetPos.x - 100},${targetPos.y} \n ${targetPos.x},${targetPos.y}\"\n class=\"mapping-line-for-select\"\n @click=${() => this.selectMappingLine(mapping, output, false)}>\n </path>\n `\n : nothing\n })}\n </g>\n `\n }\n\n startDragForMappingBox(e: PointerEvent, mapping: Mapping) {\n e.stopPropagation()\n\n let dragStartY = mapping.position.y\n let dragOffsetY = e.clientY\n let draggingBox = mapping\n\n const onDrag = (e: PointerEvent) => {\n e.preventDefault()\n if (!draggingBox) return\n\n const newY = dragStartY + e.clientY - dragOffsetY\n\n const minY = 0\n const maxY = this.clientHeight - 20\n\n draggingBox.position = {\n x: this.clientWidth / 2 - 50,\n y: Math.max(minY, Math.min(maxY, newY))\n }\n\n this.requestUpdate()\n }\n\n const stopDrag = (e: PointerEvent) => {\n e.stopPropagation()\n window.removeEventListener('pointermove', onDrag)\n window.removeEventListener('pointerup', stopDrag)\n\n this.dataMapperContext.updateMappings([...this.mappings])\n }\n\n window.addEventListener('pointermove', onDrag)\n window.addEventListener('pointerup', stopDrag)\n }\n\n handleDragOver(e: DragEvent) {\n e.preventDefault()\n }\n\n handleDrop(e: DragEvent) {\n e.preventDefault()\n const nodeId = e.dataTransfer!.getData('application/node-id')\n if (!nodeId) {\n return\n }\n\n const from = e.dataTransfer!.getData('application/from')\n const { top, left } = this.getBoundingClientRect()\n const dropX = e.clientX - left\n const dropY = e.clientY - top\n\n let droppedOnExistingBox = false\n let selectedMapping = null\n\n const mappings = this.mappings.map(mapping => {\n const boxY = mapping.position.y\n const boxX = this.clientWidth / 2 - 50\n\n if (dropY >= boxY && dropY <= boxY + 20 && dropX >= boxX && dropX < boxX + 100) {\n droppedOnExistingBox = true\n\n const updatedMapping = {\n ...mapping,\n inputs: from === 'source' ? [...new Set([...mapping.inputs, nodeId])] : mapping.inputs,\n outputs: from === 'source' ? mapping.outputs : [...new Set([...mapping.outputs, nodeId])]\n }\n\n selectedMapping = updatedMapping\n\n return updatedMapping\n }\n\n return mapping\n })\n\n if (!droppedOnExistingBox) {\n const createdMapping = {\n id: this.dataMapperContext.getUniqueId(),\n function: 'Transform',\n inputs: from == 'source' ? [nodeId] : [],\n outputs: from == 'source' ? [] : [nodeId],\n position: { x: this.clientWidth / 2 - 50, y: dropY - 10 }\n }\n\n mappings.push(createdMapping)\n\n selectedMapping = createdMapping\n }\n\n this.dataMapperContext.updateMappings(mappings)\n\n selectedMapping && this.selectMappingBox(selectedMapping)\n }\n\n selectMappingBox(mapping: Mapping) {\n this.selectedMapping = mapping\n this.selectedLine = undefined\n this.requestUpdate()\n }\n\n selectMappingLine(mapping: Mapping, nodeId: string, isInput: boolean) {\n this.selectedMapping = undefined\n this.selectedLine = { mapping, nodeId, isInput }\n this.requestUpdate()\n }\n\n isLineSelected(mapping: Mapping, nodeId: string, isInput: boolean) {\n return (\n this.selectedLine?.mapping === mapping &&\n this.selectedLine.nodeId === nodeId &&\n this.selectedLine.isInput === isInput\n )\n }\n\n openPopup(e: PointerEvent, mapping: Mapping) {\n const popup = OxPopup.open({\n template: html`\n <function-box-popup\n .mapping=${mapping}\n @change=${(e: CustomEvent) => {\n const changed = e.detail\n\n this.dataMapperContext.updateMappings(\n this.mappings.map(mapping => {\n if (mapping.id !== changed.id) {\n return mapping\n }\n\n return changed\n })\n )\n popup.close()\n }}\n ></function-box-popup>\n `,\n style: 'width: 80vw; height: 80vh;',\n preventCloseOnBlur: true,\n backdrop: true\n })\n }\n\n getSelectedTransformLogic(): string {\n const mapping = this.mappings.find(m => m === this.selectedMapping)\n return mapping?.mappingFunction || 'passthrough'\n }\n\n updateTransformLogic(e: Event) {\n const input = e.target as HTMLInputElement\n const mappings = this.mappings.map(m =>\n m.mappingFunction === this.selectedMapping ? { ...m, mappingFunction: input.value } : m\n )\n\n this.dataMapperContext.updateMappings(mappings)\n }\n\n handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Delete' || e.key === 'Backspace') {\n if (this.selectedLine) {\n this.deleteSelectedLine()\n } else if (this.selectedMapping) {\n this.deleteSelectedMapping()\n }\n }\n }\n\n deleteSelectedLine() {\n if (!this.selectedLine) return\n\n const { mapping, nodeId, isInput } = this.selectedLine\n const updatedMappings = this.mappings\n .map(m =>\n m === mapping\n ? {\n ...m,\n inputs: isInput ? m.inputs.filter(id => id !== nodeId) : m.inputs,\n outputs: !isInput ? m.outputs.filter(id => id !== nodeId) : m.outputs\n }\n : m\n )\n .filter(m => m.inputs.length > 0 || m.outputs.length > 0) // 입력/출력이 모두 삭제되면 제거\n\n this.dataMapperContext.updateMappings(updatedMappings)\n this.selectedLine = undefined\n this.requestUpdate()\n }\n\n deleteSelectedMapping() {\n this.dataMapperContext.updateMappings(this.mappings.filter(m => m !== this.selectedMapping))\n this.selectedMapping = undefined\n this.requestUpdate()\n }\n\n private handleResize = () => {\n this.requestUpdate()\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface TreeNode {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
children?: TreeNode[];
|
|
5
|
+
multiplicity?: '1' | '*' | '1..*' | '0..1';
|
|
6
|
+
}
|
|
7
|
+
export interface Mapping {
|
|
8
|
+
id: string;
|
|
9
|
+
inputs: string[];
|
|
10
|
+
outputs: string[];
|
|
11
|
+
position: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
mappingFunction?: string;
|
|
16
|
+
parameters?: {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface TreeNode {\n id: string\n label: string\n children?: TreeNode[]\n multiplicity?: '1' | '*' | '1..*' | '0..1'\n}\n\nexport interface Mapping {\n id: string\n inputs: string[]\n outputs: string[]\n position: { x: number; y: number }\n mappingFunction?: string\n parameters?: { [key: string]: any }\n}\n"]}
|
|
@@ -5,10 +5,10 @@ declare const _default: {
|
|
|
5
5
|
title: string;
|
|
6
6
|
component: string;
|
|
7
7
|
argTypes: {
|
|
8
|
-
|
|
8
|
+
sourceSchema: {
|
|
9
9
|
control: string;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
targetSchema: {
|
|
12
12
|
control: string;
|
|
13
13
|
};
|
|
14
14
|
mappings: {
|
|
@@ -23,8 +23,8 @@ interface Story<T> {
|
|
|
23
23
|
argTypes?: Record<string, unknown>;
|
|
24
24
|
}
|
|
25
25
|
interface ArgTypes {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
sourceSchema: object;
|
|
27
|
+
targetSchema: object;
|
|
28
28
|
mappings: Object;
|
|
29
29
|
}
|
|
30
30
|
export declare const Regular: Story<ArgTypes>;
|
|
@@ -2,15 +2,15 @@ import '../src/ox-data-mapper.js';
|
|
|
2
2
|
import '@material/web/icon/icon.js';
|
|
3
3
|
import { html } from 'lit';
|
|
4
4
|
export default {
|
|
5
|
-
title: '
|
|
5
|
+
title: 'ox-data-mapper',
|
|
6
6
|
component: 'ox-data-mapper',
|
|
7
7
|
argTypes: {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
sourceSchema: { control: 'object' },
|
|
9
|
+
targetSchema: { control: 'object' },
|
|
10
10
|
mappings: { control: 'object' }
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
|
-
const Template = ({
|
|
13
|
+
const Template = ({ sourceSchema, targetSchema, mappings }) => html `
|
|
14
14
|
<link
|
|
15
15
|
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
16
16
|
rel="stylesheet"
|
|
@@ -32,21 +32,25 @@ const Template = ({ sourceScheme, targetScheme, mappings }) => html `
|
|
|
32
32
|
<link href="/themes/form-theme.css" rel="stylesheet" />
|
|
33
33
|
|
|
34
34
|
<style>
|
|
35
|
-
#root-inner {
|
|
36
|
-
min-height: 1000px;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
35
|
ox-data-mapper {
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
height: 500px;
|
|
37
|
+
display: block;
|
|
38
|
+
margin: 100px;
|
|
39
|
+
padding: 0 10px;
|
|
40
|
+
background-color: cyan;
|
|
41
|
+
overflow-y: auto;
|
|
42
42
|
}
|
|
43
43
|
</style>
|
|
44
44
|
|
|
45
|
-
<ox-data-mapper
|
|
45
|
+
<ox-data-mapper
|
|
46
|
+
.sourceSchema=${sourceSchema}
|
|
47
|
+
.targetSchema=${targetSchema}
|
|
48
|
+
.mappings=${mappings}
|
|
49
|
+
></ox-data-mapper>
|
|
46
50
|
`;
|
|
47
51
|
export const Regular = Template.bind({});
|
|
48
52
|
Regular.args = {
|
|
49
|
-
|
|
53
|
+
sourceSchema: {
|
|
50
54
|
id: 's1',
|
|
51
55
|
label: 'Order',
|
|
52
56
|
multiplicity: '*',
|
|
@@ -57,12 +61,20 @@ Regular.args = {
|
|
|
57
61
|
multiplicity: '*',
|
|
58
62
|
children: [
|
|
59
63
|
{ id: 's1-1-1', label: 'Name' },
|
|
60
|
-
{ id: 's1-1-2', label: 'Price' }
|
|
64
|
+
{ id: 's1-1-2', label: 'Price' },
|
|
65
|
+
{ id: 's1-1-3', label: 'Name' },
|
|
66
|
+
{ id: 's1-1-4', label: 'Price' },
|
|
67
|
+
{ id: 's1-1-5', label: 'Name' },
|
|
68
|
+
{ id: 's1-1-6', label: 'Price' },
|
|
69
|
+
{ id: 's1-1-7', label: 'Name' },
|
|
70
|
+
{ id: 's1-1-8', label: 'Price' },
|
|
71
|
+
{ id: 's1-1-9', label: 'Name' },
|
|
72
|
+
{ id: 's1-1-10', label: 'Price' }
|
|
61
73
|
]
|
|
62
74
|
}
|
|
63
75
|
]
|
|
64
76
|
},
|
|
65
|
-
|
|
77
|
+
targetSchema: {
|
|
66
78
|
id: 't1',
|
|
67
79
|
label: 'Invoice',
|
|
68
80
|
children: [
|
|
@@ -72,21 +84,31 @@ Regular.args = {
|
|
|
72
84
|
multiplicity: '*',
|
|
73
85
|
children: [
|
|
74
86
|
{ id: 't1-1-1', label: 'Product Name' },
|
|
75
|
-
{ id: 't1-1-2', label: 'Cost' }
|
|
87
|
+
{ id: 't1-1-2', label: 'Cost' },
|
|
88
|
+
{ id: 't1-1-3', label: 'Product Name' },
|
|
89
|
+
{ id: 't1-1-4', label: 'Cost' },
|
|
90
|
+
{ id: 't1-1-5', label: 'Product Name' },
|
|
91
|
+
{ id: 't1-1-6', label: 'Cost' },
|
|
92
|
+
{ id: 't1-1-7', label: 'Product Name' },
|
|
93
|
+
{ id: 't1-1-8', label: 'Cost' }
|
|
76
94
|
]
|
|
77
95
|
}
|
|
78
96
|
]
|
|
79
97
|
},
|
|
80
98
|
mappings: [
|
|
81
99
|
{
|
|
100
|
+
id: '1',
|
|
82
101
|
inputs: ['s1'],
|
|
83
102
|
outputs: ['t1-1-1'],
|
|
84
|
-
|
|
103
|
+
mappingFunction: 'text-transform',
|
|
104
|
+
position: { x: 100, y: 50 }
|
|
85
105
|
},
|
|
86
106
|
{
|
|
107
|
+
id: '2',
|
|
87
108
|
inputs: ['s1-1-1', 's1-1-2'],
|
|
88
109
|
outputs: ['t1-1-2'],
|
|
89
|
-
|
|
110
|
+
mappingFunction: 'value-mapping',
|
|
111
|
+
position: { x: 100, y: 100 }
|
|
90
112
|
}
|
|
91
113
|
]
|
|
92
114
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-data-mapper.stories.js","sourceRoot":"","sources":["../../stories/ox-data-mapper.stories.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAA;AACjC,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"ox-data-mapper.stories.js","sourceRoot":"","sources":["../../stories/ox-data-mapper.stories.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAA;AACjC,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAG1C,eAAe;IACb,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,gBAAgB;IAC3B,QAAQ,EAAE;QACR,YAAY,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QACnC,YAAY,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QACnC,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;KAChC;CACF,CAAA;AAcD,MAAM,QAAQ,GAAoB,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAiC1E,YAAwB;oBACxB,YAAwB;gB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;oBACvC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE;oBAC/B,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE;oBACvC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE;oBAC/B,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE;oBACvC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE;oBAC/B,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE;oBACvC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE;iBAChC;aACF;SACF;KACF;IAED,QAAQ,EAAE;QACR;YACE,EAAE,EAAE,GAAG;YACP,MAAM,EAAE,CAAC,IAAI,CAAC;YACd,OAAO,EAAE,CAAC,QAAQ,CAAC;YACnB,eAAe,EAAE,gBAAgB;YACjC,QAAQ,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE;SAC5B;QACD;YACE,EAAE,EAAE,GAAG;YACP,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;YAC5B,OAAO,EAAE,CAAC,QAAQ,CAAC;YACnB,eAAe,EAAE,eAAe;YAChC,QAAQ,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;SAC7B;KACF;CACF,CAAA","sourcesContent":["import '../src/ox-data-mapper.js'\nimport '@material/web/icon/icon.js'\n\nimport { html, TemplateResult } from 'lit'\nimport { Mapping, TreeNode } from '../src/types.js'\n\nexport default {\n title: 'ox-data-mapper',\n component: 'ox-data-mapper',\n argTypes: {\n sourceSchema: { control: 'object' },\n targetSchema: { control: 'object' },\n mappings: { control: 'object' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n sourceSchema: object\n targetSchema: object\n mappings: Object\n}\n\nconst Template: Story<ArgTypes> = ({ sourceSchema, targetSchema, mappings }: ArgTypes) => html`\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <link href=\"/themes/app-theme.css\" rel=\"stylesheet\" />\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n <link href=\"/themes/grist-theme.css\" rel=\"stylesheet\" />\n <link href=\"/themes/form-theme.css\" rel=\"stylesheet\" />\n\n <style>\n ox-data-mapper {\n height: 500px;\n display: block;\n margin: 100px;\n padding: 0 10px;\n background-color: cyan;\n overflow-y: auto;\n }\n </style>\n\n <ox-data-mapper\n .sourceSchema=${sourceSchema as TreeNode}\n .targetSchema=${targetSchema as TreeNode}\n .mappings=${mappings as Mapping[]}\n ></ox-data-mapper>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n sourceSchema: {\n id: 's1',\n label: 'Order',\n multiplicity: '*',\n children: [\n {\n id: 's1-1',\n label: 'Item',\n multiplicity: '*',\n children: [\n { id: 's1-1-1', label: 'Name' },\n { id: 's1-1-2', label: 'Price' },\n { id: 's1-1-3', label: 'Name' },\n { id: 's1-1-4', label: 'Price' },\n { id: 's1-1-5', label: 'Name' },\n { id: 's1-1-6', label: 'Price' },\n { id: 's1-1-7', label: 'Name' },\n { id: 's1-1-8', label: 'Price' },\n { id: 's1-1-9', label: 'Name' },\n { id: 's1-1-10', label: 'Price' }\n ]\n }\n ]\n },\n\n targetSchema: {\n id: 't1',\n label: 'Invoice',\n children: [\n {\n id: 't1-1',\n label: 'Products',\n multiplicity: '*',\n children: [\n { id: 't1-1-1', label: 'Product Name' },\n { id: 't1-1-2', label: 'Cost' },\n { id: 't1-1-3', label: 'Product Name' },\n { id: 't1-1-4', label: 'Cost' },\n { id: 't1-1-5', label: 'Product Name' },\n { id: 't1-1-6', label: 'Cost' },\n { id: 't1-1-7', label: 'Product Name' },\n { id: 't1-1-8', label: 'Cost' }\n ]\n }\n ]\n },\n\n mappings: [\n {\n id: '1',\n inputs: ['s1'],\n outputs: ['t1-1-1'],\n mappingFunction: 'text-transform',\n position: { x: 100, y: 50 }\n },\n {\n id: '2',\n inputs: ['s1-1-1', 's1-1-2'],\n outputs: ['t1-1-2'],\n mappingFunction: 'value-mapping',\n position: { x: 100, y: 100 }\n }\n ]\n}\n"]}
|