@operato/data-mapper 9.0.1 → 9.0.2
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 +9 -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 +35 -0
- package/dist/src/components/property-editor.js +78 -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 +2 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/ox-data-mapper.d.ts +24 -0
- package/dist/src/ox-data-mapper.js +241 -0
- package/dist/src/ox-data-mapper.js.map +1 -0
- 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/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [9.0.2](https://github.com/hatiolab/operato/compare/v9.0.1...v9.0.2) (2025-07-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* invalid package configuration ([ccde20b](https://github.com/hatiolab/operato/commit/ccde20b75e6cbd1f881e5bac631e361aebfd21c3))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
### [9.0.1](https://github.com/hatiolab/operato/compare/v9.0.0...v9.0.1) (2025-07-01)
|
|
7
16
|
|
|
8
17
|
**Note:** Version bump only for package @operato/data-mapper
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import './property-editor.js';
|
|
5
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
6
|
+
import { PropertySpec } from '@operato/property-editor';
|
|
7
|
+
export declare class FunctionBoxOptionsBuilder extends LitElement {
|
|
8
|
+
value: {
|
|
9
|
+
[name: string]: any;
|
|
10
|
+
};
|
|
11
|
+
props?: PropertySpec[];
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
firstUpdated(): void;
|
|
14
|
+
updated(changes: PropertyValues<this>): void;
|
|
15
|
+
private onPropsChanged;
|
|
16
|
+
private setValues;
|
|
17
|
+
private onValueChanged;
|
|
18
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import './property-editor.js'; /* for registering property editors */
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
7
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
8
|
+
import { OxPropertyEditor } from '@operato/property-editor';
|
|
9
|
+
/**
|
|
10
|
+
모든 에디터들은 change 이벤트를 지원해야 한다. 또한, 모든 에디터들은 value속성에 값을 가져야 한다.
|
|
11
|
+
|
|
12
|
+
Example:
|
|
13
|
+
|
|
14
|
+
<options-builder value="{{value}}">
|
|
15
|
+
<label>Center X</label>
|
|
16
|
+
<input type="number" .value="${value.cx}">
|
|
17
|
+
<label>Width</label>
|
|
18
|
+
<input type="number" .value="${value.width}">
|
|
19
|
+
</options-builder>
|
|
20
|
+
*/
|
|
21
|
+
const DEFAULT_VALUE = {
|
|
22
|
+
legend: '',
|
|
23
|
+
// number: 0, // should be undefined
|
|
24
|
+
angle: 0,
|
|
25
|
+
string: '',
|
|
26
|
+
password: '',
|
|
27
|
+
textarea: '',
|
|
28
|
+
checkbox: false,
|
|
29
|
+
select: '',
|
|
30
|
+
color: '#000000',
|
|
31
|
+
'solidcolor-stops': null,
|
|
32
|
+
'gradientcolor-stops': null,
|
|
33
|
+
'gltf-selector': '',
|
|
34
|
+
'image-selector': '',
|
|
35
|
+
multiplecolor: null,
|
|
36
|
+
editortable: null,
|
|
37
|
+
imageselector: '',
|
|
38
|
+
options: null,
|
|
39
|
+
date: null
|
|
40
|
+
};
|
|
41
|
+
function convertValue(type, value) {
|
|
42
|
+
var converted = String(value).trim() == '' ? undefined : value;
|
|
43
|
+
switch (type) {
|
|
44
|
+
case 'number':
|
|
45
|
+
case 'angle':
|
|
46
|
+
converted = parseFloat(value);
|
|
47
|
+
converted = isNaN(converted) ? undefined : converted;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
return converted;
|
|
51
|
+
}
|
|
52
|
+
let FunctionBoxOptionsBuilder = class FunctionBoxOptionsBuilder extends LitElement {
|
|
53
|
+
constructor() {
|
|
54
|
+
super(...arguments);
|
|
55
|
+
this.value = {};
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
return html `<slot></slot>`;
|
|
59
|
+
}
|
|
60
|
+
firstUpdated() {
|
|
61
|
+
this.addEventListener('change', this.onValueChanged.bind(this));
|
|
62
|
+
}
|
|
63
|
+
updated(changes) {
|
|
64
|
+
changes.has('props') && this.onPropsChanged(this.props || []);
|
|
65
|
+
changes.has('value') && this.setValues();
|
|
66
|
+
}
|
|
67
|
+
onPropsChanged(props) {
|
|
68
|
+
const specs = this.props || [];
|
|
69
|
+
this.textContent = '';
|
|
70
|
+
specs.forEach((spec) => {
|
|
71
|
+
const { label, type, placeholder, name, observe, property, editor, quantifier, defaultValue, disabled, styles } = spec;
|
|
72
|
+
const elementType = OxPropertyEditor.getEditor(type);
|
|
73
|
+
if (!elementType) {
|
|
74
|
+
console.warn('Property Editor not defined', type);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const element = document.createElement(elementType);
|
|
78
|
+
element.label = label;
|
|
79
|
+
element.type = type;
|
|
80
|
+
element.placeholder = placeholder;
|
|
81
|
+
element.name = name;
|
|
82
|
+
element.setAttribute('name', name);
|
|
83
|
+
if (observe) {
|
|
84
|
+
element.observeHandler = observe;
|
|
85
|
+
}
|
|
86
|
+
element.property = property;
|
|
87
|
+
element.editor = editor;
|
|
88
|
+
element.quantifier = quantifier;
|
|
89
|
+
element.defaultValue = defaultValue;
|
|
90
|
+
element.setAttribute('property-editor', 'true');
|
|
91
|
+
element.disabled = disabled;
|
|
92
|
+
if (styles) {
|
|
93
|
+
Object.keys(styles).forEach((key) => {
|
|
94
|
+
element.style[key] = styles[key];
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
this.appendChild(element);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
setValues() {
|
|
101
|
+
this.value &&
|
|
102
|
+
Array.from(this.querySelectorAll('[name]')).forEach((prop) => {
|
|
103
|
+
let name = prop.getAttribute('name');
|
|
104
|
+
if (!name) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
var convertedValue = convertValue(prop.type, this.value[name]);
|
|
108
|
+
if (convertedValue === undefined) {
|
|
109
|
+
convertedValue = DEFAULT_VALUE[prop.type];
|
|
110
|
+
}
|
|
111
|
+
prop.value = convertedValue;
|
|
112
|
+
prop.observe.call(prop, prop.value);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
onValueChanged(e) {
|
|
116
|
+
e.stopPropagation();
|
|
117
|
+
var target = e.target;
|
|
118
|
+
const prop = target.closest('[property-editor]');
|
|
119
|
+
var name = prop.getAttribute('name');
|
|
120
|
+
if (!name) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this.value[name] = prop.value;
|
|
124
|
+
prop.observe(prop.value);
|
|
125
|
+
this.setValues();
|
|
126
|
+
this.dispatchEvent(new CustomEvent('property-change', {
|
|
127
|
+
bubbles: true,
|
|
128
|
+
composed: true,
|
|
129
|
+
detail: {
|
|
130
|
+
[name]: prop.value
|
|
131
|
+
}
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
__decorate([
|
|
136
|
+
property({ type: Object })
|
|
137
|
+
], FunctionBoxOptionsBuilder.prototype, "value", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
property({ type: Array })
|
|
140
|
+
], FunctionBoxOptionsBuilder.prototype, "props", void 0);
|
|
141
|
+
FunctionBoxOptionsBuilder = __decorate([
|
|
142
|
+
customElement('function-box-options-builder')
|
|
143
|
+
], FunctionBoxOptionsBuilder);
|
|
144
|
+
export { FunctionBoxOptionsBuilder };
|
|
145
|
+
//# sourceMappingURL=function-box-options-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function-box-options-builder.js","sourceRoot":"","sources":["../../../src/components/function-box-options-builder.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,sBAAsB,CAAA,CAAC,sCAAsC;AAEpE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAa,gBAAgB,EAAgB,MAAM,0BAA0B,CAAA;AAEpF;;;;;;;;;;;EAWE;AAEF,MAAM,aAAa,GAAG;IACpB,MAAM,EAAE,EAAE;IACV,oCAAoC;IACpC,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,SAAS;IAChB,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,eAAe,EAAE,EAAE;IACnB,gBAAgB,EAAE,EAAE;IACpB,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,EAAE;IACjB,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,IAAI;CACX,CAAA;AAED,SAAS,YAAY,CAAC,IAAY,EAAE,KAAU;IAC5C,IAAI,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAA;IAC9D,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,QAAQ,CA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,IAAI,EAAE,MAAM,EAAE,CAAC;wDAAoC;AACpC;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;wDAAuB;AAFtC,yBAAyB;IADrC,aAAa,CAAC,8BAA8B,CAAC;GACjC,yBAAyB,CAoGrC","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport './property-editor.js' /* for registering property editors */\n\nimport { html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { CSSStyles, OxPropertyEditor, PropertySpec } from '@operato/property-editor'\n\n/**\n모든 에디터들은 change 이벤트를 지원해야 한다. 또한, 모든 에디터들은 value속성에 값을 가져야 한다.\n\nExample:\n\n <options-builder value=\"{{value}}\">\n <label>Center X</label>\n <input type=\"number\" .value=\"${value.cx}\">\n <label>Width</label>\n <input type=\"number\" .value=\"${value.width}\">\n </options-builder>\n*/\n\nconst DEFAULT_VALUE = {\n legend: '',\n // number: 0, // should be undefined\n angle: 0,\n string: '',\n password: '',\n textarea: '',\n checkbox: false,\n select: '',\n color: '#000000',\n 'solidcolor-stops': null,\n 'gradientcolor-stops': null,\n 'gltf-selector': '',\n 'image-selector': '',\n multiplecolor: null,\n editortable: null,\n imageselector: '',\n options: null,\n date: null\n}\n\nfunction convertValue(type: string, value: any) {\n var converted = String(value).trim() == '' ? undefined : value\n switch (type) {\n case 'number':\n case 'angle':\n converted = parseFloat(value)\n converted = isNaN(converted) ? undefined : converted\n break\n }\n\n return converted\n}\n\n@customElement('function-box-options-builder')\nexport class FunctionBoxOptionsBuilder extends LitElement {\n @property({ type: Object }) value: { [name: string]: any } = {}\n @property({ type: Array }) props?: PropertySpec[]\n\n render() {\n return html`<slot></slot>`\n }\n\n firstUpdated() {\n this.addEventListener('change', this.onValueChanged.bind(this))\n }\n\n updated(changes: PropertyValues<this>) {\n changes.has('props') && this.onPropsChanged(this.props || [])\n changes.has('value') && this.setValues()\n }\n\n private onPropsChanged(props: PropertySpec[]) {\n const specs = this.props || []\n\n this.textContent = ''\n specs.forEach((spec: PropertySpec) => {\n const { label, type, placeholder, name, observe, property, editor, quantifier, defaultValue, disabled, styles } =\n spec\n\n const elementType = OxPropertyEditor.getEditor(type)\n if (!elementType) {\n console.warn('Property Editor not defined', type)\n return\n }\n const element = document.createElement(elementType) as OxPropertyEditor\n\n element.label = label\n element.type = type\n element.placeholder = placeholder\n element.name = name\n element.setAttribute('name', name)\n\n if (observe) {\n element.observeHandler = observe\n }\n element.property = property\n element.editor = editor\n element.quantifier = quantifier\n element.defaultValue = defaultValue\n element.setAttribute('property-editor', 'true')\n element.disabled = disabled\n\n if (styles) {\n Object.keys(styles).forEach((key: string) => {\n element.style[key as keyof CSSStyles] = styles[key as keyof CSSStyles]\n })\n }\n\n this.appendChild(element)\n })\n }\n\n private setValues() {\n this.value &&\n Array.from(this.querySelectorAll('[name]')).forEach((prop: { [name: string]: any }) => {\n let name = prop.getAttribute('name')\n if (!name) {\n return\n }\n var convertedValue = convertValue(prop.type, this.value[name])\n if (convertedValue === undefined) {\n convertedValue = (DEFAULT_VALUE as any)[prop.type]\n }\n prop.value = convertedValue\n prop.observe.call(prop, prop.value)\n })\n }\n\n private onValueChanged(e: Event) {\n e.stopPropagation()\n var target = e.target as Element\n\n const prop = target.closest('[property-editor]') as OxPropertyEditor\n\n var name = prop.getAttribute('name')\n if (!name) {\n return\n }\n\n this.value[name] = prop.value\n\n prop.observe(prop.value)\n this.setValues()\n\n this.dispatchEvent(\n new CustomEvent('property-change', {\n bubbles: true,\n composed: true,\n detail: {\n [name]: prop.value\n }\n })\n )\n }\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import '@operato/input/ox-select.js';
|
|
2
|
+
import '@operato/input/ox-input-code.js';
|
|
3
|
+
import '@operato/markdown/ox-markdown.js';
|
|
4
|
+
import './function-box-options-builder.js';
|
|
5
|
+
import { LitElement } from 'lit';
|
|
6
|
+
import { Mapping } from '../types.js';
|
|
7
|
+
export declare class FunctionBoxPopup extends LitElement {
|
|
8
|
+
static styles: import("lit").CSSResult[];
|
|
9
|
+
mapping: Mapping;
|
|
10
|
+
mappingFunction: HTMLSelectElement;
|
|
11
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
12
|
+
private swapVariablePosition;
|
|
13
|
+
private updateOptions;
|
|
14
|
+
private updateMapping;
|
|
15
|
+
}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import '@operato/input/ox-select.js';
|
|
3
|
+
import '@operato/input/ox-input-code.js';
|
|
4
|
+
import '@operato/markdown/ox-markdown.js';
|
|
5
|
+
import './function-box-options-builder.js';
|
|
6
|
+
import { LitElement, html, css } from 'lit';
|
|
7
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
|
8
|
+
import { CommonHeaderStyles } from '@operato/styles';
|
|
9
|
+
import { i18next } from '@operato/i18n';
|
|
10
|
+
import { FunctionList } from '../functions/index.js';
|
|
11
|
+
let FunctionBoxPopup = class FunctionBoxPopup extends LitElement {
|
|
12
|
+
render() {
|
|
13
|
+
var { mappingFunction = 'passthrough', inputs, outputs, parameters = {} } = this.mapping;
|
|
14
|
+
const { help = '', specifications = [] } = FunctionList.find(func => func.name == mappingFunction) || {};
|
|
15
|
+
const helpDataUrl = `data:text/markdown;base64,${window.btoa(unescape(encodeURIComponent(help)))}`;
|
|
16
|
+
return html `
|
|
17
|
+
<div class="header">
|
|
18
|
+
<div class="title">Function Box</div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div id="body">
|
|
22
|
+
<div id="function">
|
|
23
|
+
<label for="select-function">select function</label>
|
|
24
|
+
<ox-select
|
|
25
|
+
id="select-function"
|
|
26
|
+
.value=${mappingFunction || 'passthrough'}
|
|
27
|
+
@change=${(e) => {
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
let val = e.target.value;
|
|
30
|
+
this.mapping = {
|
|
31
|
+
...this.mapping,
|
|
32
|
+
mappingFunction: (val === null || val === void 0 ? void 0 : val.length) > 0 ? val : 'passthrough'
|
|
33
|
+
};
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
<ox-popup-list with-search align-left>
|
|
37
|
+
${FunctionList.map(func => html `
|
|
38
|
+
<div option value=${func.name} ?selected=${func.name == mappingFunction}>${func.label}</div>
|
|
39
|
+
`)}
|
|
40
|
+
</ox-popup-list>
|
|
41
|
+
</ox-select>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div id="detail">
|
|
45
|
+
<div id="variables">
|
|
46
|
+
<div id="inputs">
|
|
47
|
+
<label>inputs</label>
|
|
48
|
+
${inputs.map((input, index) => html `
|
|
49
|
+
<div class="variable-list">
|
|
50
|
+
${input}
|
|
51
|
+
<div class="padding"></div>
|
|
52
|
+
<md-icon @click=${() => this.swapVariablePosition('in', index, 'up')}>arrow_upward</md-icon
|
|
53
|
+
><md-icon @click=${() => this.swapVariablePosition('in', index, 'down')}>arrow_downward</md-icon>
|
|
54
|
+
</div>
|
|
55
|
+
`)}
|
|
56
|
+
</div>
|
|
57
|
+
<div id="returns">
|
|
58
|
+
<label>returns</label>
|
|
59
|
+
${outputs.map((output, index) => html `
|
|
60
|
+
<div class="variable-list">
|
|
61
|
+
${output}
|
|
62
|
+
<div class="padding"></div>
|
|
63
|
+
<md-icon @click=${() => this.swapVariablePosition('out', index, 'up')}>arrow_upward</md-icon
|
|
64
|
+
><md-icon @click=${() => this.swapVariablePosition('out', index, 'down')}>arrow_downward</md-icon>
|
|
65
|
+
</div>
|
|
66
|
+
`)}
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<div id="editor">
|
|
70
|
+
<function-box-options-builder
|
|
71
|
+
.value=${parameters}
|
|
72
|
+
.props=${specifications}
|
|
73
|
+
@property-change=${this.updateOptions}
|
|
74
|
+
></function-box-options-builder>
|
|
75
|
+
<ox-markdown src=${helpDataUrl} .toc=${false}></ox-markdown>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div class="footer">
|
|
81
|
+
<div filler></div>
|
|
82
|
+
<button @click=${this.updateMapping.bind(this)} done><md-icon>save</md-icon>${i18next.t('button.save')}</button>
|
|
83
|
+
</div>
|
|
84
|
+
`;
|
|
85
|
+
}
|
|
86
|
+
swapVariablePosition(inout, index, direction) {
|
|
87
|
+
const list = inout === 'in' ? this.mapping.inputs : this.mapping.outputs;
|
|
88
|
+
if ((direction === 'up' && index === 0) || (direction === 'down' && index === list.length - 1)) {
|
|
89
|
+
return; // 첫 번째 요소를 위로 올리거나, 마지막 요소를 아래로 내릴 수 없음
|
|
90
|
+
}
|
|
91
|
+
const newIndex = direction === 'up' ? index - 1 : index + 1;
|
|
92
|
+
const movingElement = this.shadowRoot.querySelectorAll(`.variable-list`)[index];
|
|
93
|
+
const targetElement = this.shadowRoot.querySelectorAll(`.variable-list`)[newIndex];
|
|
94
|
+
if (!movingElement || !targetElement)
|
|
95
|
+
return;
|
|
96
|
+
// 현재 위치 저장
|
|
97
|
+
const movingRect = movingElement.getBoundingClientRect();
|
|
98
|
+
const targetRect = targetElement.getBoundingClientRect();
|
|
99
|
+
const deltaY = targetRect.top - movingRect.top;
|
|
100
|
+
// 애니메이션을 위해 transform 적용
|
|
101
|
+
movingElement.style.transition = 'transform 0.3s ease-in-out';
|
|
102
|
+
movingElement.style.transform = `translateY(${deltaY}px)`;
|
|
103
|
+
// 애니메이션이 끝나면 실제로 데이터 순서 변경 및 리렌더링
|
|
104
|
+
setTimeout(() => {
|
|
105
|
+
const temp = list[index];
|
|
106
|
+
list[index] = list[newIndex];
|
|
107
|
+
list[newIndex] = temp;
|
|
108
|
+
// 스타일 초기화
|
|
109
|
+
movingElement.style.transition = '';
|
|
110
|
+
movingElement.style.transform = '';
|
|
111
|
+
this.requestUpdate();
|
|
112
|
+
}, 300); // 300ms는 transition 속도와 동일
|
|
113
|
+
}
|
|
114
|
+
updateOptions(e) {
|
|
115
|
+
e.stopPropagation();
|
|
116
|
+
const parameters = this.mapping.parameters || {};
|
|
117
|
+
this.mapping.parameters = {
|
|
118
|
+
...parameters,
|
|
119
|
+
...e.detail
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
updateMapping() {
|
|
123
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
124
|
+
detail: this.mapping
|
|
125
|
+
}));
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
FunctionBoxPopup.styles = [
|
|
129
|
+
CommonHeaderStyles,
|
|
130
|
+
css `
|
|
131
|
+
:host {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
height: 100%;
|
|
135
|
+
border: 1px solid #ccc;
|
|
136
|
+
background: #f9f9f9;
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
div#body {
|
|
141
|
+
display: flex;
|
|
142
|
+
flex-direction: column;
|
|
143
|
+
height: 100%;
|
|
144
|
+
border: 1px solid #ccc;
|
|
145
|
+
background-color: var(--md-sys-color-surface);
|
|
146
|
+
color: var(--md-sys-color-primary);
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
div#function {
|
|
151
|
+
display: flex;
|
|
152
|
+
flex-direction: row;
|
|
153
|
+
gap: var(--spacing-small, 4px);
|
|
154
|
+
padding: 10px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
div#detail {
|
|
158
|
+
flex: 1;
|
|
159
|
+
display: flex;
|
|
160
|
+
flex-direction: row;
|
|
161
|
+
gap: var(--spacing-small, 4px);
|
|
162
|
+
background-color: var(--md-sys-color-surface);
|
|
163
|
+
color: var(--md-sys-color-primary);
|
|
164
|
+
overflow: hidden;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
div#variables {
|
|
168
|
+
flex: 1;
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
gap: var(--spacing-small, 4px);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
div#variables label {
|
|
175
|
+
background-color: var(--md-sys-color-on-primary-container);
|
|
176
|
+
color: var(--md-sys-color-primary-container);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.variable-list {
|
|
180
|
+
display: flex;
|
|
181
|
+
flex-direction: row;
|
|
182
|
+
align-items: center;
|
|
183
|
+
transition: transform 0.3s ease-in-out;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.variable-list .padding {
|
|
187
|
+
flex: 1;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
div#inputs {
|
|
191
|
+
flex: 1;
|
|
192
|
+
display: flex;
|
|
193
|
+
flex-direction: column;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
div#returns {
|
|
197
|
+
flex: 1;
|
|
198
|
+
display: flex;
|
|
199
|
+
flex-direction: column;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
div#editor {
|
|
203
|
+
flex: 4;
|
|
204
|
+
display: flex;
|
|
205
|
+
flex-direction: column;
|
|
206
|
+
gap: var(--spacing-small, 4px);
|
|
207
|
+
overflow: hidden;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function-box-options-builder {
|
|
211
|
+
min-height: 200px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
ox-markdown {
|
|
215
|
+
flex: 1;
|
|
216
|
+
padding: var(--spacing-medium, 8px);
|
|
217
|
+
background-color: var(--md-sys-color-surface-variant);
|
|
218
|
+
overflow: auto;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
ox-select {
|
|
222
|
+
flex: 1;
|
|
223
|
+
}
|
|
224
|
+
`
|
|
225
|
+
];
|
|
226
|
+
__decorate([
|
|
227
|
+
property({ type: Object })
|
|
228
|
+
], FunctionBoxPopup.prototype, "mapping", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
query('#select-function')
|
|
231
|
+
], FunctionBoxPopup.prototype, "mappingFunction", void 0);
|
|
232
|
+
FunctionBoxPopup = __decorate([
|
|
233
|
+
customElement('function-box-popup')
|
|
234
|
+
], FunctionBoxPopup);
|
|
235
|
+
export { FunctionBoxPopup };
|
|
236
|
+
//# sourceMappingURL=function-box-popup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function-box-popup.js","sourceRoot":"","sources":["../../../src/components/function-box-popup.ts"],"names":[],"mappings":";AAAA,OAAO,6BAA6B,CAAA;AACpC,OAAO,iCAAiC,CAAA;AACxC,OAAO,kCAAkC,CAAA;AACzC,OAAO,mCAAmC,CAAA;AAE1C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAG7C,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAwG9C,MAAM;QACJ,IAAI,EAAE,eAAe,GAAG,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QACxF,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,cAAc,GAAG,EAAE,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,eAAe,CAAC,IAAI,EAAE,CAAA;QAExG,MAAM,WAAW,GAAG,6BAA6B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAA;QAElG,OAAO,IAAI,CAAA;;;;;;;;;;qBAUM,eAAe,IAAI,aAAa;sBAC/B,CAA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\nimport '@operato/markdown/ox-markdown.js'\nimport './function-box-options-builder.js'\n\nimport { LitElement, html, css } from 'lit'\nimport { customElement, property, state, query } from 'lit/decorators.js'\nimport { CommonHeaderStyles } from '@operato/styles'\nimport { i18next } from '@operato/i18n'\n\nimport { Mapping } from '../types.js'\nimport { FunctionList } from '../functions/index.js'\n\n@customElement('function-box-popup')\nexport class FunctionBoxPopup extends LitElement {\n static styles = [\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n height: 100%;\n border: 1px solid #ccc;\n background: #f9f9f9;\n overflow: hidden;\n }\n\n div#body {\n display: flex;\n flex-direction: column;\n height: 100%;\n border: 1px solid #ccc;\n background-color: var(--md-sys-color-surface);\n color: var(--md-sys-color-primary);\n overflow: hidden;\n }\n\n div#function {\n display: flex;\n flex-direction: row;\n gap: var(--spacing-small, 4px);\n padding: 10px;\n }\n\n div#detail {\n flex: 1;\n display: flex;\n flex-direction: row;\n gap: var(--spacing-small, 4px);\n background-color: var(--md-sys-color-surface);\n color: var(--md-sys-color-primary);\n overflow: hidden;\n }\n\n div#variables {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: var(--spacing-small, 4px);\n }\n\n div#variables label {\n background-color: var(--md-sys-color-on-primary-container);\n color: var(--md-sys-color-primary-container);\n }\n\n .variable-list {\n display: flex;\n flex-direction: row;\n align-items: center;\n transition: transform 0.3s ease-in-out;\n }\n\n .variable-list .padding {\n flex: 1;\n }\n\n div#inputs {\n flex: 1;\n display: flex;\n flex-direction: column;\n }\n\n div#returns {\n flex: 1;\n display: flex;\n flex-direction: column;\n }\n\n div#editor {\n flex: 4;\n display: flex;\n flex-direction: column;\n gap: var(--spacing-small, 4px);\n overflow: hidden;\n }\n\n function-box-options-builder {\n min-height: 200px;\n }\n\n ox-markdown {\n flex: 1;\n padding: var(--spacing-medium, 8px);\n background-color: var(--md-sys-color-surface-variant);\n overflow: auto;\n }\n\n ox-select {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Object }) mapping!: Mapping\n\n @query('#select-function') mappingFunction!: HTMLSelectElement\n\n render() {\n var { mappingFunction = 'passthrough', inputs, outputs, parameters = {} } = this.mapping\n const { help = '', specifications = [] } = FunctionList.find(func => func.name == mappingFunction) || {}\n\n const helpDataUrl = `data:text/markdown;base64,${window.btoa(unescape(encodeURIComponent(help)))}`\n\n return html`\n <div class=\"header\">\n <div class=\"title\">Function Box</div>\n </div>\n\n <div id=\"body\">\n <div id=\"function\">\n <label for=\"select-function\">select function</label>\n <ox-select\n id=\"select-function\"\n .value=${mappingFunction || 'passthrough'}\n @change=${(e: Event) => {\n e.stopPropagation()\n\n let val = (e.target as HTMLInputElement).value\n\n this.mapping = {\n ...this.mapping,\n mappingFunction: val?.length > 0 ? val : 'passthrough'\n }\n }}\n >\n <ox-popup-list with-search align-left>\n ${FunctionList.map(\n func => html`\n <div option value=${func.name} ?selected=${func.name == mappingFunction}>${func.label}</div>\n `\n )}\n </ox-popup-list>\n </ox-select>\n </div>\n\n <div id=\"detail\">\n <div id=\"variables\">\n <div id=\"inputs\">\n <label>inputs</label>\n ${inputs.map(\n (input, index) => html`\n <div class=\"variable-list\">\n ${input}\n <div class=\"padding\"></div>\n <md-icon @click=${() => this.swapVariablePosition('in', index, 'up')}>arrow_upward</md-icon\n ><md-icon @click=${() => this.swapVariablePosition('in', index, 'down')}>arrow_downward</md-icon>\n </div>\n `\n )}\n </div>\n <div id=\"returns\">\n <label>returns</label>\n ${outputs.map(\n (output, index) => html`\n <div class=\"variable-list\">\n ${output}\n <div class=\"padding\"></div>\n <md-icon @click=${() => this.swapVariablePosition('out', index, 'up')}>arrow_upward</md-icon\n ><md-icon @click=${() => this.swapVariablePosition('out', index, 'down')}>arrow_downward</md-icon>\n </div>\n `\n )}\n </div>\n </div>\n <div id=\"editor\">\n <function-box-options-builder\n .value=${parameters}\n .props=${specifications}\n @property-change=${this.updateOptions}\n ></function-box-options-builder>\n <ox-markdown src=${helpDataUrl} .toc=${false}></ox-markdown>\n </div>\n </div>\n </div>\n\n <div class=\"footer\">\n <div filler></div>\n <button @click=${this.updateMapping.bind(this)} done><md-icon>save</md-icon>${i18next.t('button.save')}</button>\n </div>\n `\n }\n\n private swapVariablePosition(inout: 'in' | 'out', index: number, direction: 'up' | 'down') {\n const list = inout === 'in' ? this.mapping.inputs : this.mapping.outputs\n\n if ((direction === 'up' && index === 0) || (direction === 'down' && index === list.length - 1)) {\n return // 첫 번째 요소를 위로 올리거나, 마지막 요소를 아래로 내릴 수 없음\n }\n\n const newIndex = direction === 'up' ? index - 1 : index + 1\n const movingElement = this.shadowRoot!.querySelectorAll(`.variable-list`)[index] as HTMLElement\n const targetElement = this.shadowRoot!.querySelectorAll(`.variable-list`)[newIndex] as HTMLElement\n\n if (!movingElement || !targetElement) return\n\n // 현재 위치 저장\n const movingRect = movingElement.getBoundingClientRect()\n const targetRect = targetElement.getBoundingClientRect()\n\n const deltaY = targetRect.top - movingRect.top\n\n // 애니메이션을 위해 transform 적용\n movingElement.style.transition = 'transform 0.3s ease-in-out'\n movingElement.style.transform = `translateY(${deltaY}px)`\n\n // 애니메이션이 끝나면 실제로 데이터 순서 변경 및 리렌더링\n setTimeout(() => {\n const temp = list[index]\n list[index] = list[newIndex]\n list[newIndex] = temp\n\n // 스타일 초기화\n movingElement.style.transition = ''\n movingElement.style.transform = ''\n\n this.requestUpdate()\n }, 300) // 300ms는 transition 속도와 동일\n }\n\n private updateOptions(e: Event) {\n e.stopPropagation()\n\n const parameters = this.mapping.parameters || {}\n\n this.mapping.parameters = {\n ...parameters,\n ...(e as CustomEvent).detail\n }\n }\n\n private updateMapping() {\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: this.mapping\n })\n )\n }\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import '@operato/property-editor/ox-property-editor-3axis.js';
|
|
2
|
+
import '@operato/property-editor/ox-property-editor-3dish.js';
|
|
3
|
+
import '@operato/property-editor/ox-property-editor-legend.js';
|
|
4
|
+
import '@operato/property-editor/ox-property-editor-description.js';
|
|
5
|
+
import '@operato/property-editor/ox-property-editor-number.js';
|
|
6
|
+
import '@operato/property-editor/ox-property-editor-unit-number.js';
|
|
7
|
+
import '@operato/property-editor/ox-property-editor-password.js';
|
|
8
|
+
import '@operato/property-editor/ox-property-editor-action.js';
|
|
9
|
+
import '@operato/property-editor/ox-property-editor-angle.js';
|
|
10
|
+
import '@operato/property-editor/ox-property-editor-string.js';
|
|
11
|
+
import '@operato/property-editor/ox-property-editor-data.js';
|
|
12
|
+
import '@operato/property-editor/ox-property-editor-date.js';
|
|
13
|
+
import '@operato/property-editor/ox-property-editor-month.js';
|
|
14
|
+
import '@operato/property-editor/ox-property-editor-time.js';
|
|
15
|
+
import '@operato/property-editor/ox-property-editor-datetime.js';
|
|
16
|
+
import '@operato/property-editor/ox-property-editor-checkbox.js';
|
|
17
|
+
import '@operato/property-editor/ox-property-editor-options.js';
|
|
18
|
+
import '@operato/property-editor/ox-property-editor-select.js';
|
|
19
|
+
import '@operato/property-editor/ox-property-editor-scene-component-id.js';
|
|
20
|
+
import '@operato/property-editor/ox-property-editor-color.js';
|
|
21
|
+
import '@operato/property-editor/ox-property-editor-multiple-colors.js';
|
|
22
|
+
import '@operato/property-editor/ox-property-editor-solid-colorstops.js';
|
|
23
|
+
import '@operato/property-editor/ox-property-editor-gradient-colorstops.js';
|
|
24
|
+
import '@operato/property-editor/ox-property-editor-textarea.js';
|
|
25
|
+
import '@operato/property-editor/ox-property-editor-table.js';
|
|
26
|
+
import '@operato/property-editor/ox-property-editor-key-values.js';
|
|
27
|
+
import '@operato/property-editor/ox-property-editor-partition-keys.js';
|
|
28
|
+
import '@operato/property-editor/ox-property-editor-value-map.js';
|
|
29
|
+
import '@operato/property-editor/ox-property-editor-value-ranges.js';
|
|
30
|
+
import '@operato/property-editor/ox-property-editor-hashtags.js';
|
|
31
|
+
import '@operato/property-editor/ox-property-editor-image.js';
|
|
32
|
+
import '@operato/property-editor/ox-property-editor-file.js';
|
|
33
|
+
import '@operato/attachment/ox-property-editor-attachment-selector.js';
|
|
34
|
+
import '@operato/attachment/ox-property-editor-image-selector.js';
|
|
35
|
+
import '@operato/font/ox-property-editor-font-selector.js';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import '@operato/property-editor/ox-property-editor-3axis.js';
|
|
2
|
+
import '@operato/property-editor/ox-property-editor-3dish.js';
|
|
3
|
+
import '@operato/property-editor/ox-property-editor-legend.js';
|
|
4
|
+
import '@operato/property-editor/ox-property-editor-description.js';
|
|
5
|
+
import '@operato/property-editor/ox-property-editor-number.js';
|
|
6
|
+
import '@operato/property-editor/ox-property-editor-unit-number.js';
|
|
7
|
+
import '@operato/property-editor/ox-property-editor-password.js';
|
|
8
|
+
import '@operato/property-editor/ox-property-editor-action.js';
|
|
9
|
+
import '@operato/property-editor/ox-property-editor-angle.js';
|
|
10
|
+
import '@operato/property-editor/ox-property-editor-string.js';
|
|
11
|
+
import '@operato/property-editor/ox-property-editor-data.js';
|
|
12
|
+
import '@operato/property-editor/ox-property-editor-date.js';
|
|
13
|
+
import '@operato/property-editor/ox-property-editor-month.js';
|
|
14
|
+
import '@operato/property-editor/ox-property-editor-time.js';
|
|
15
|
+
import '@operato/property-editor/ox-property-editor-datetime.js';
|
|
16
|
+
import '@operato/property-editor/ox-property-editor-checkbox.js';
|
|
17
|
+
import '@operato/property-editor/ox-property-editor-options.js';
|
|
18
|
+
import '@operato/property-editor/ox-property-editor-select.js';
|
|
19
|
+
import '@operato/property-editor/ox-property-editor-scene-component-id.js';
|
|
20
|
+
import '@operato/property-editor/ox-property-editor-color.js';
|
|
21
|
+
import '@operato/property-editor/ox-property-editor-multiple-colors.js';
|
|
22
|
+
import '@operato/property-editor/ox-property-editor-solid-colorstops.js';
|
|
23
|
+
import '@operato/property-editor/ox-property-editor-gradient-colorstops.js';
|
|
24
|
+
import '@operato/property-editor/ox-property-editor-textarea.js';
|
|
25
|
+
import '@operato/property-editor/ox-property-editor-table.js';
|
|
26
|
+
import '@operato/property-editor/ox-property-editor-key-values.js';
|
|
27
|
+
import '@operato/property-editor/ox-property-editor-partition-keys.js';
|
|
28
|
+
import '@operato/property-editor/ox-property-editor-value-map.js';
|
|
29
|
+
import '@operato/property-editor/ox-property-editor-value-ranges.js';
|
|
30
|
+
import '@operato/property-editor/ox-property-editor-hashtags.js';
|
|
31
|
+
import '@operato/property-editor/ox-property-editor-image.js';
|
|
32
|
+
import '@operato/property-editor/ox-property-editor-file.js';
|
|
33
|
+
import '@operato/attachment/ox-property-editor-attachment-selector.js';
|
|
34
|
+
import '@operato/attachment/ox-property-editor-image-selector.js';
|
|
35
|
+
import '@operato/font/ox-property-editor-font-selector.js';
|
|
36
|
+
import { OxPropertyEditor } from '@operato/property-editor';
|
|
37
|
+
OxPropertyEditor.register({
|
|
38
|
+
legend: 'ox-property-editor-legend',
|
|
39
|
+
description: 'ox-property-editor-description',
|
|
40
|
+
number: 'ox-property-editor-number',
|
|
41
|
+
'unit-number': 'ox-property-editor-unit-number',
|
|
42
|
+
slider: 'ox-property-editor-range',
|
|
43
|
+
password: 'ox-property-editor-password',
|
|
44
|
+
action: 'ox-property-editor-action',
|
|
45
|
+
angle: 'ox-property-editor-angle',
|
|
46
|
+
string: 'ox-property-editor-string',
|
|
47
|
+
textarea: 'ox-property-editor-textarea',
|
|
48
|
+
javascript: 'ox-property-editor-textarea',
|
|
49
|
+
script: 'ox-property-editor-textarea',
|
|
50
|
+
checkbox: 'ox-property-editor-checkbox',
|
|
51
|
+
boolean: 'ox-property-editor-checkbox',
|
|
52
|
+
select: 'ox-property-editor-select',
|
|
53
|
+
date: 'ox-property-editor-date',
|
|
54
|
+
month: 'ox-property-editor-month',
|
|
55
|
+
datetime: 'ox-property-editor-datetime',
|
|
56
|
+
time: 'ox-property-editor-time',
|
|
57
|
+
options: 'ox-property-editor-options',
|
|
58
|
+
data: 'ox-property-editor-data',
|
|
59
|
+
file: 'ox-property-editor-file',
|
|
60
|
+
image: 'ox-property-editor-image',
|
|
61
|
+
'range-input': 'ox-property-editor-range',
|
|
62
|
+
'attachment-selector': 'ox-property-editor-attachment-selector',
|
|
63
|
+
'gltf-selector': 'ox-property-editor-attachment-selector',
|
|
64
|
+
'image-selector': 'ox-property-editor-image-selector',
|
|
65
|
+
color: 'ox-property-editor-color',
|
|
66
|
+
'solid-color-stops': 'ox-property-editor-solid-colorstops',
|
|
67
|
+
'gradient-color-stops': 'ox-property-editor-gradient-colorstops',
|
|
68
|
+
'multiple-color': 'ox-property-editor-multiple-colors',
|
|
69
|
+
map: 'ox-property-editor-value-map',
|
|
70
|
+
range: 'ox-property-editor-value-ranges',
|
|
71
|
+
'editor-table': 'ox-property-editor-table',
|
|
72
|
+
'id-input': 'ox-property-editor-scene-component-id',
|
|
73
|
+
'font-selector': 'ox-property-editor-font-selector',
|
|
74
|
+
'partition-keys': 'ox-property-editor-partion-keys',
|
|
75
|
+
'key-values': 'ox-property-editor-key-values',
|
|
76
|
+
hashtags: 'ox-property-editor-hashtags'
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=property-editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-editor.js","sourceRoot":"","sources":["../../../src/components/property-editor.ts"],"names":[],"mappings":"AAAA,OAAO,sDAAsD,CAAA;AAC7D,OAAO,sDAAsD,CAAA;AAC7D,OAAO,uDAAuD,CAAA;AAC9D,OAAO,4DAA4D,CAAA;AACnE,OAAO,uDAAuD,CAAA;AAC9D,OAAO,4DAA4D,CAAA;AACnE,OAAO,yDAAyD,CAAA;AAChE,OAAO,uDAAuD,CAAA;AAC9D,OAAO,sDAAsD,CAAA;AAC7D,OAAO,uDAAuD,CAAA;AAC9D,OAAO,qDAAqD,CAAA;AAC5D,OAAO,qDAAqD,CAAA;AAC5D,OAAO,sDAAsD,CAAA;AAC7D,OAAO,qDAAqD,CAAA;AAC5D,OAAO,yDAAyD,CAAA;AAChE,OAAO,yDAAyD,CAAA;AAChE,OAAO,wDAAwD,CAA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BAAqB,EAAE,wCAAwC;IAC/D,eAAe,EAAE,wCAAwC;IACzD,gBAAgB,EAAE,mCAAmC;IACrD,KAAK,EAAE,0BAA0B;IACjC,mBAAmB,EAAE,qCAAqC;IAC1D,sBAAsB,EAAE,wCAAwC;IAChE,gBAAgB,EAAE,oCAAoC;IACtD,GAAG,EAAE,8BAA8B;IACnC,KAAK,EAAE,iCAAiC;IACxC,cAAc,EAAE,0BAA0B;IAC1C,UAAU,EAAE,uCAAuC;IACnD,eAAe,EAAE,kCAAkC;IACnD,gBAAgB,EAAE,iCAAiC;IACnD,YAAY,EAAE,+BAA+B;IAC7C,QAAQ,EAAE,6BAA6B;CACxC,CAAC,CAAA","sourcesContent":["import '@operato/property-editor/ox-property-editor-3axis.js'\nimport '@operato/property-editor/ox-property-editor-3dish.js'\nimport '@operato/property-editor/ox-property-editor-legend.js'\nimport '@operato/property-editor/ox-property-editor-description.js'\nimport '@operato/property-editor/ox-property-editor-number.js'\nimport '@operato/property-editor/ox-property-editor-unit-number.js'\nimport '@operato/property-editor/ox-property-editor-password.js'\nimport '@operato/property-editor/ox-property-editor-action.js'\nimport '@operato/property-editor/ox-property-editor-angle.js'\nimport '@operato/property-editor/ox-property-editor-string.js'\nimport '@operato/property-editor/ox-property-editor-data.js'\nimport '@operato/property-editor/ox-property-editor-date.js'\nimport '@operato/property-editor/ox-property-editor-month.js'\nimport '@operato/property-editor/ox-property-editor-time.js'\nimport '@operato/property-editor/ox-property-editor-datetime.js'\nimport '@operato/property-editor/ox-property-editor-checkbox.js'\nimport '@operato/property-editor/ox-property-editor-options.js'\nimport '@operato/property-editor/ox-property-editor-select.js'\nimport '@operato/property-editor/ox-property-editor-scene-component-id.js'\nimport '@operato/property-editor/ox-property-editor-color.js'\nimport '@operato/property-editor/ox-property-editor-multiple-colors.js'\nimport '@operato/property-editor/ox-property-editor-solid-colorstops.js'\nimport '@operato/property-editor/ox-property-editor-gradient-colorstops.js'\nimport '@operato/property-editor/ox-property-editor-textarea.js'\nimport '@operato/property-editor/ox-property-editor-table.js'\nimport '@operato/property-editor/ox-property-editor-key-values.js'\nimport '@operato/property-editor/ox-property-editor-partition-keys.js'\nimport '@operato/property-editor/ox-property-editor-value-map.js'\nimport '@operato/property-editor/ox-property-editor-value-ranges.js'\nimport '@operato/property-editor/ox-property-editor-hashtags.js'\nimport '@operato/property-editor/ox-property-editor-image.js'\nimport '@operato/property-editor/ox-property-editor-file.js'\nimport '@operato/attachment/ox-property-editor-attachment-selector.js'\nimport '@operato/attachment/ox-property-editor-image-selector.js'\nimport '@operato/font/ox-property-editor-font-selector.js'\n\nimport { OxPropertyEditor } from '@operato/property-editor'\n\nOxPropertyEditor.register({\n legend: 'ox-property-editor-legend',\n description: 'ox-property-editor-description',\n number: 'ox-property-editor-number',\n 'unit-number': 'ox-property-editor-unit-number',\n slider: 'ox-property-editor-range',\n password: 'ox-property-editor-password',\n action: 'ox-property-editor-action',\n angle: 'ox-property-editor-angle',\n string: 'ox-property-editor-string',\n textarea: 'ox-property-editor-textarea',\n javascript: 'ox-property-editor-textarea',\n script: 'ox-property-editor-textarea',\n checkbox: 'ox-property-editor-checkbox',\n boolean: 'ox-property-editor-checkbox',\n select: 'ox-property-editor-select',\n date: 'ox-property-editor-date',\n month: 'ox-property-editor-month',\n datetime: 'ox-property-editor-datetime',\n time: 'ox-property-editor-time',\n options: 'ox-property-editor-options',\n data: 'ox-property-editor-data',\n file: 'ox-property-editor-file',\n image: 'ox-property-editor-image',\n 'range-input': 'ox-property-editor-range',\n 'attachment-selector': 'ox-property-editor-attachment-selector',\n 'gltf-selector': 'ox-property-editor-attachment-selector',\n 'image-selector': 'ox-property-editor-image-selector',\n color: 'ox-property-editor-color',\n 'solid-color-stops': 'ox-property-editor-solid-colorstops',\n 'gradient-color-stops': 'ox-property-editor-gradient-colorstops',\n 'multiple-color': 'ox-property-editor-multiple-colors',\n map: 'ox-property-editor-value-map',\n range: 'ox-property-editor-value-ranges',\n 'editor-table': 'ox-property-editor-table',\n 'id-input': 'ox-property-editor-scene-component-id',\n 'font-selector': 'ox-property-editor-font-selector',\n 'partition-keys': 'ox-property-editor-partion-keys',\n 'key-values': 'ox-property-editor-key-values',\n hashtags: 'ox-property-editor-hashtags'\n})\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Mapping } from '../types.js';
|
|
2
|
+
export interface DataMapperContextType {
|
|
3
|
+
getUniqueId: () => string;
|
|
4
|
+
getNodePosition: (nodeId: string, source: boolean) => {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
} | undefined;
|
|
8
|
+
updateMappings: (mappings: Mapping[]) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const dataMapperContext: {
|
|
11
|
+
__context__: DataMapperContextType;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-mapper-context.js","sourceRoot":"","sources":["../../../src/context/data-mapper-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAW5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAwB,qBAAqB,CAAC,CAAA","sourcesContent":["import { createContext } from '@lit/context'\n\nimport {} from '../types.js'\nimport { Mapping, TreeNode } from '../types.js'\n\nexport interface DataMapperContextType {\n getUniqueId: () => string\n getNodePosition: (nodeId: string, source: boolean) => { x: number; y: number } | undefined\n updateMappings: (mappings: Mapping[]) => void\n}\n\nexport const dataMapperContext = createContext<DataMapperContextType>('data-mapper-context')\n"]}
|