@genexus/genexus-ide-ui 0.0.141 → 0.0.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
- package/dist/cjs/gx-ide-bpm-export-xpdl.cjs.entry.js +78 -0
- package/dist/cjs/gx-ide-bpm-export-xpdl.cjs.entry.js.map +1 -0
- package/dist/cjs/gx-ide-bpm-import-gxpm.cjs.entry.js +47 -3
- package/dist/cjs/gx-ide-bpm-import-gxpm.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-bpm-objects-selector.cjs.entry.js +123 -0
- package/dist/cjs/gx-ide-bpm-objects-selector.cjs.entry.js.map +1 -0
- package/dist/cjs/gx-ide-list-selector_2.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-list-selector_2.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/_helpers/list-selector/list-selector-item/list-selector-item.css +8 -10
- package/dist/collection/components/bpm/export-xpdl/export-xpdl.css +574 -0
- package/dist/collection/components/bpm/export-xpdl/export-xpdl.js +238 -0
- package/dist/collection/components/bpm/export-xpdl/export-xpdl.js.map +1 -0
- package/dist/collection/components/bpm/export-xpdl/gx-ide-assets/bpm-export-xpdl/langs/bpm-export-xpdl.lang.en.json +19 -0
- package/dist/collection/components/bpm/import-gxpm/gx-ide-assets/bpm-import-gxpm/langs/bpm-import-gxpm.lang.en.json +9 -2
- package/dist/collection/components/bpm/import-gxpm/import-gxpm.css +4 -0
- package/dist/collection/components/bpm/import-gxpm/import-gxpm.js +103 -2
- package/dist/collection/components/bpm/import-gxpm/import-gxpm.js.map +1 -1
- package/dist/collection/components/bpm/objects-selector/gx-ide-assets/bpm-objects-selector/langs/bpm-objects-selector.lang.en.json +17 -0
- package/dist/collection/components/bpm/objects-selector/gx-ide-assets/bpm-objects-selector/langs/bpm-objects-selector.lang.ja.json +3 -0
- package/dist/collection/components/bpm/objects-selector/helpers.js +17 -0
- package/dist/collection/components/bpm/objects-selector/helpers.js.map +1 -0
- package/dist/collection/components/bpm/objects-selector/objects-selector.css +574 -0
- package/dist/collection/components/bpm/objects-selector/objects-selector.js +259 -0
- package/dist/collection/components/bpm/objects-selector/objects-selector.js.map +1 -0
- package/dist/collection/components/bpm/timer-duration/gx-ide-assets/bpm-timer-duration/langs/timer-duration.lang.zh.json +3 -0
- package/dist/components/gx-ide-bpm-export-xpdl.d.ts +11 -0
- package/dist/components/gx-ide-bpm-export-xpdl.js +155 -0
- package/dist/components/gx-ide-bpm-export-xpdl.js.map +1 -0
- package/dist/components/gx-ide-bpm-import-gxpm.js +58 -28
- package/dist/components/gx-ide-bpm-import-gxpm.js.map +1 -1
- package/dist/components/gx-ide-bpm-objects-selector.d.ts +11 -0
- package/dist/components/gx-ide-bpm-objects-selector.js +8 -0
- package/dist/components/gx-ide-bpm-objects-selector.js.map +1 -0
- package/dist/components/list-selector-item.js +1 -1
- package/dist/components/list-selector-item.js.map +1 -1
- package/dist/components/objects-selector.js +189 -0
- package/dist/components/objects-selector.js.map +1 -0
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-bpm-export-xpdl.entry.js +74 -0
- package/dist/esm/gx-ide-bpm-export-xpdl.entry.js.map +1 -0
- package/dist/esm/gx-ide-bpm-import-gxpm.entry.js +47 -3
- package/dist/esm/gx-ide-bpm-import-gxpm.entry.js.map +1 -1
- package/dist/esm/gx-ide-bpm-objects-selector.entry.js +119 -0
- package/dist/esm/gx-ide-bpm-objects-selector.entry.js.map +1 -0
- package/dist/esm/gx-ide-list-selector_2.entry.js +1 -1
- package/dist/esm/gx-ide-list-selector_2.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
- package/dist/genexus-ide-ui/gx-ide-assets/bpm-export-xpdl/langs/bpm-export-xpdl.lang.en.json +19 -0
- package/dist/genexus-ide-ui/gx-ide-assets/bpm-export-xpdl/langs/bpm-export-xpdl.lang.ja.json +3 -0
- package/dist/genexus-ide-ui/gx-ide-assets/bpm-export-xpdl/langs/bpm-export-xpdl.lang.zh.json +3 -0
- package/dist/genexus-ide-ui/gx-ide-assets/bpm-import-gxpm/langs/bpm-import-gxpm.lang.en.json +9 -2
- package/dist/genexus-ide-ui/gx-ide-assets/bpm-objects-selector/langs/bpm-objects-selector.lang.en.json +17 -0
- package/dist/genexus-ide-ui/gx-ide-assets/bpm-objects-selector/langs/bpm-objects-selector.lang.ja.json +3 -0
- package/dist/genexus-ide-ui/gx-ide-assets/bpm-objects-selector/langs/bpm-objects-selector.lang.zh.json +3 -0
- package/dist/genexus-ide-ui/gx-ide-assets/bpm-timer-duration/langs/timer-duration.lang.ja.json +3 -0
- package/dist/genexus-ide-ui/gx-ide-assets/bpm-timer-duration/langs/timer-duration.lang.zh.json +3 -0
- package/dist/genexus-ide-ui/{p-972b18a0.entry.js → p-0e47720b.entry.js} +2 -2
- package/dist/genexus-ide-ui/p-0e47720b.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-049a370c.entry.js → p-58cb7bbb.entry.js} +78 -29
- package/dist/genexus-ide-ui/p-58cb7bbb.entry.js.map +1 -0
- package/dist/genexus-ide-ui/p-7364d5d1.entry.js +109 -0
- package/dist/genexus-ide-ui/p-7364d5d1.entry.js.map +1 -0
- package/dist/genexus-ide-ui/p-832a8a94.entry.js +160 -0
- package/dist/genexus-ide-ui/p-832a8a94.entry.js.map +1 -0
- package/dist/types/components/bpm/export-xpdl/export-xpdl.d.ts +66 -0
- package/dist/types/components/bpm/import-gxpm/import-gxpm.d.ts +30 -1
- package/dist/types/components/bpm/objects-selector/helpers.d.ts +7 -0
- package/dist/types/components/bpm/objects-selector/objects-selector.d.ts +61 -0
- package/dist/types/components.d.ts +237 -52
- package/package.json +1 -1
- package/dist/genexus-ide-ui/p-049a370c.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-972b18a0.entry.js.map +0 -1
- /package/dist/collection/components/bpm/{timer-duration/gx-ide-assets/bpm-timer-duration/langs/bpm-timer-duration.lang.ja.json → export-xpdl/gx-ide-assets/bpm-export-xpdl/langs/bpm-export-xpdl.lang.ja.json} +0 -0
- /package/dist/collection/components/bpm/{timer-duration/gx-ide-assets/bpm-timer-duration/langs/bpm-timer-duration.lang.zh.json → export-xpdl/gx-ide-assets/bpm-export-xpdl/langs/bpm-export-xpdl.lang.zh.json} +0 -0
- /package/dist/{genexus-ide-ui/gx-ide-assets/bpm-timer-duration/langs/bpm-timer-duration.lang.zh.json → collection/components/bpm/objects-selector/gx-ide-assets/bpm-objects-selector/langs/bpm-objects-selector.lang.zh.json} +0 -0
- /package/dist/collection/components/bpm/timer-duration/gx-ide-assets/bpm-timer-duration/langs/{bpm-timer-duration.lang.en.json → timer-duration.lang.en.json} +0 -0
- /package/dist/{genexus-ide-ui/gx-ide-assets/bpm-timer-duration/langs/bpm-timer-duration.lang.ja.json → collection/components/bpm/timer-duration/gx-ide-assets/bpm-timer-duration/langs/timer-duration.lang.ja.json} +0 -0
- /package/dist/genexus-ide-ui/gx-ide-assets/bpm-timer-duration/langs/{bpm-timer-duration.lang.en.json → timer-duration.lang.en.json} +0 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/* STENCIL IMPORTS */
|
|
2
|
+
import { Host, h } from "@stencil/core";
|
|
3
|
+
/* OTHER LIBRARIES IMPORTS */
|
|
4
|
+
/* CUSTOM IMPORTS */
|
|
5
|
+
import { config } from "../../../common/config";
|
|
6
|
+
import { Locale } from "../../../common/locale";
|
|
7
|
+
/* import { renderListItems } from "../../../common/render-list-item"; */
|
|
8
|
+
export class GxIdeBpmExportXpdl {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.renderedFirstTime = false;
|
|
11
|
+
// 7.LISTENERS //
|
|
12
|
+
// 8.PUBLIC METHODS API //
|
|
13
|
+
// 9.LOCAL METHODS //
|
|
14
|
+
this.exportHandler = () => {
|
|
15
|
+
var _a;
|
|
16
|
+
if (this.exportCallback) {
|
|
17
|
+
this.notExporting = false;
|
|
18
|
+
const data = {
|
|
19
|
+
directoryName: this.exportInputEl.value,
|
|
20
|
+
Objects: (_a = this.bpmObjectSelectorEl.selection) !== null && _a !== void 0 ? _a : {
|
|
21
|
+
includeAll: false,
|
|
22
|
+
objectIds: []
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
this.exportCallback(data)
|
|
26
|
+
.then(() => {
|
|
27
|
+
this.notExporting = true;
|
|
28
|
+
})
|
|
29
|
+
.catch(error => {
|
|
30
|
+
console.error("Export callback failed:", error);
|
|
31
|
+
this.notExporting = true;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
this.inputHandle = async () => {
|
|
36
|
+
var _a;
|
|
37
|
+
this.emptyInput = !((_a = this.exportInputEl.value) === null || _a === void 0 ? void 0 : _a.length);
|
|
38
|
+
};
|
|
39
|
+
this.handleSelectionChanged = () => {
|
|
40
|
+
this.emptyObjects = !this.bpmObjectSelectorEl.selection.objectIds.length;
|
|
41
|
+
};
|
|
42
|
+
this.emptyInput = true;
|
|
43
|
+
this.emptyObjects = true;
|
|
44
|
+
this.notExporting = true;
|
|
45
|
+
this.displayTitle = false;
|
|
46
|
+
this.exportCallback = undefined;
|
|
47
|
+
this.cancelCallback = undefined;
|
|
48
|
+
this.addCallback = undefined;
|
|
49
|
+
this.referencesCallback = undefined;
|
|
50
|
+
}
|
|
51
|
+
// 6.COMPONENT LIFECYCLE METHODS //
|
|
52
|
+
async componentWillLoad() {
|
|
53
|
+
this._componentLocale = await Locale.getComponentStrings(this.el);
|
|
54
|
+
}
|
|
55
|
+
componentDidRender() {
|
|
56
|
+
if (!this.renderedFirstTime) {
|
|
57
|
+
this.componentDidRenderFirstTime.emit(this._componentLocale.componentName);
|
|
58
|
+
this.renderedFirstTime = true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// 10.RENDER() FUNCTION //
|
|
62
|
+
render() {
|
|
63
|
+
return (h(Host, { class: "gx-ide-component" }, h("div", { class: "gx-ide-main-wrapper" }, h("gx-ide-container", { containerTitle: this.displayTitle ? this._componentLocale.componentName : null, slimmerFooter: config.gxIdeContainer.slimmerFooter }, h("div", { class: "header" }, h("label", { htmlFor: "export-directory", class: "label" }, this._componentLocale.main.exportInputLabel), h("input", { type: "text", id: "export-directory", class: "input-text input", onInput: this.inputHandle, ref: el => (this.exportInputEl = el) }), h("button", { class: "export", disabled: this.emptyInput || this.emptyObjects, onClick: this.exportHandler }, this._componentLocale.main.exportButton), h("button", { class: "cancel", disabled: this.notExporting, onClick: this.cancelCallback }, this._componentLocale.main.cancelButton)), h("gx-ide-bpm-objects-selector", { id: "gx-ide-bpm-objects-selector", addCallback: this.addCallback, referencesCallback: this.referencesCallback, ref: el => (this.bpmObjectSelectorEl =
|
|
64
|
+
el), onSelectionChanged: this.handleSelectionChanged })))));
|
|
65
|
+
}
|
|
66
|
+
static get is() { return "gx-ide-bpm-export-xpdl"; }
|
|
67
|
+
static get encapsulation() { return "shadow"; }
|
|
68
|
+
static get originalStyleUrls() {
|
|
69
|
+
return {
|
|
70
|
+
"$": ["export-xpdl.scss"]
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
static get styleUrls() {
|
|
74
|
+
return {
|
|
75
|
+
"$": ["export-xpdl.css"]
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
static get assetsDirs() { return ["gx-ide-assets/bpm-export-xpdl"]; }
|
|
79
|
+
static get properties() {
|
|
80
|
+
return {
|
|
81
|
+
"displayTitle": {
|
|
82
|
+
"type": "boolean",
|
|
83
|
+
"mutable": false,
|
|
84
|
+
"complexType": {
|
|
85
|
+
"original": "false",
|
|
86
|
+
"resolved": "boolean",
|
|
87
|
+
"references": {}
|
|
88
|
+
},
|
|
89
|
+
"required": false,
|
|
90
|
+
"optional": false,
|
|
91
|
+
"docs": {
|
|
92
|
+
"tags": [],
|
|
93
|
+
"text": "If true it displays the component title on the header"
|
|
94
|
+
},
|
|
95
|
+
"attribute": "display-title",
|
|
96
|
+
"reflect": false,
|
|
97
|
+
"defaultValue": "false"
|
|
98
|
+
},
|
|
99
|
+
"exportCallback": {
|
|
100
|
+
"type": "unknown",
|
|
101
|
+
"mutable": false,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "ExportCallback",
|
|
104
|
+
"resolved": "(exportData: ExportData) => Promise<boolean>",
|
|
105
|
+
"references": {
|
|
106
|
+
"ExportCallback": {
|
|
107
|
+
"location": "local",
|
|
108
|
+
"path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/export-xpdl/export-xpdl.tsx",
|
|
109
|
+
"id": "src/components/bpm/export-xpdl/export-xpdl.tsx::ExportCallback"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"required": false,
|
|
114
|
+
"optional": false,
|
|
115
|
+
"docs": {
|
|
116
|
+
"tags": [{
|
|
117
|
+
"name": "param",
|
|
118
|
+
"text": "exportData - The data required for the export process."
|
|
119
|
+
}, {
|
|
120
|
+
"name": "returns",
|
|
121
|
+
"text": "A promise that resolves to a boolean indicating the success of the export operation.\nReturns `true` if the export was successful, and `false` otherwise."
|
|
122
|
+
}],
|
|
123
|
+
"text": "Callback function invoked when the user presses the 'Create' button.\nThis function is expected to handle the export process based on the provided export data."
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"cancelCallback": {
|
|
127
|
+
"type": "unknown",
|
|
128
|
+
"mutable": false,
|
|
129
|
+
"complexType": {
|
|
130
|
+
"original": "CancelCallback",
|
|
131
|
+
"resolved": "() => Promise<void>",
|
|
132
|
+
"references": {
|
|
133
|
+
"CancelCallback": {
|
|
134
|
+
"location": "local",
|
|
135
|
+
"path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/export-xpdl/export-xpdl.tsx",
|
|
136
|
+
"id": "src/components/bpm/export-xpdl/export-xpdl.tsx::CancelCallback"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"required": false,
|
|
141
|
+
"optional": false,
|
|
142
|
+
"docs": {
|
|
143
|
+
"tags": [],
|
|
144
|
+
"text": "Callback invoked when user press 'Cancel' button"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"addCallback": {
|
|
148
|
+
"type": "unknown",
|
|
149
|
+
"mutable": false,
|
|
150
|
+
"complexType": {
|
|
151
|
+
"original": "() => Promise<ObjectData[]>",
|
|
152
|
+
"resolved": "() => Promise<ObjectData[]>",
|
|
153
|
+
"references": {
|
|
154
|
+
"Promise": {
|
|
155
|
+
"location": "global",
|
|
156
|
+
"id": "global::Promise"
|
|
157
|
+
},
|
|
158
|
+
"ObjectData": {
|
|
159
|
+
"location": "import",
|
|
160
|
+
"path": "../objects-selector/helpers",
|
|
161
|
+
"id": "src/components/bpm/objects-selector/helpers.ts::ObjectData"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"required": false,
|
|
166
|
+
"optional": false,
|
|
167
|
+
"docs": {
|
|
168
|
+
"tags": [{
|
|
169
|
+
"name": "returns",
|
|
170
|
+
"text": "A Promise that resolves to an array of ObjectData. Each ObjectData contains the ID, icon, and name of an object."
|
|
171
|
+
}],
|
|
172
|
+
"text": "Callback invoked when the user presses the 'Add' button. associated with gx-ide-bpm-objects-selector\nThis function is expected to return a list of selected objects' basic information."
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"referencesCallback": {
|
|
176
|
+
"type": "unknown",
|
|
177
|
+
"mutable": false,
|
|
178
|
+
"complexType": {
|
|
179
|
+
"original": "(ids: string[]) => Promise<ObjectData[]>",
|
|
180
|
+
"resolved": "(ids: string[]) => Promise<ObjectData[]>",
|
|
181
|
+
"references": {
|
|
182
|
+
"Promise": {
|
|
183
|
+
"location": "global",
|
|
184
|
+
"id": "global::Promise"
|
|
185
|
+
},
|
|
186
|
+
"ObjectData": {
|
|
187
|
+
"location": "import",
|
|
188
|
+
"path": "../objects-selector/helpers",
|
|
189
|
+
"id": "src/components/bpm/objects-selector/helpers.ts::ObjectData"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"required": false,
|
|
194
|
+
"optional": false,
|
|
195
|
+
"docs": {
|
|
196
|
+
"tags": [{
|
|
197
|
+
"name": "param",
|
|
198
|
+
"text": "ids - An array of IDs of the objects currently added to the list."
|
|
199
|
+
}, {
|
|
200
|
+
"name": "returns",
|
|
201
|
+
"text": "A Promise that resolves to an array of ObjectData. Each ObjectData contains the ID, icon, and name of an object."
|
|
202
|
+
}],
|
|
203
|
+
"text": "Callback invoked when the user presses the 'References' button. associated with gx-ide-bpm-objects-selector\nReceives a parameter which is an array of IDs of the objects currently added to the list.\nReturns a Promise that resolves to an array of ObjectData, where each ObjectData contains the ID, icon, and name of an object."
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
static get states() {
|
|
209
|
+
return {
|
|
210
|
+
"emptyInput": {},
|
|
211
|
+
"emptyObjects": {},
|
|
212
|
+
"notExporting": {}
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
static get events() {
|
|
216
|
+
return [{
|
|
217
|
+
"method": "componentDidRenderFirstTime",
|
|
218
|
+
"name": "componentDidRenderFirstTime",
|
|
219
|
+
"bubbles": true,
|
|
220
|
+
"cancelable": true,
|
|
221
|
+
"composed": true,
|
|
222
|
+
"docs": {
|
|
223
|
+
"tags": [{
|
|
224
|
+
"name": "description",
|
|
225
|
+
"text": "Gets fired when the component has rendered for the first time."
|
|
226
|
+
}],
|
|
227
|
+
"text": ""
|
|
228
|
+
},
|
|
229
|
+
"complexType": {
|
|
230
|
+
"original": "string",
|
|
231
|
+
"resolved": "string",
|
|
232
|
+
"references": {}
|
|
233
|
+
}
|
|
234
|
+
}];
|
|
235
|
+
}
|
|
236
|
+
static get elementRef() { return "el"; }
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=export-xpdl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-xpdl.js","sourceRoot":"","sources":["../../../../src/components/bpm/export-xpdl/export-xpdl.tsx"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,OAAO,EACP,KAAK,EAEL,KAAK,EACN,MAAM,eAAe,CAAC;AACvB,6BAA6B;AAC7B,oBAAoB;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,yEAAyE;AAQzE,MAAM,OAAO,kBAAkB;;QAOrB,sBAAiB,GAAG,KAAK,CAAC;QA0ElC,iBAAiB;QAEjB,0BAA0B;QAE1B,qBAAqB;QAEb,kBAAa,GAAG,GAAG,EAAE;;YAC3B,IAAI,IAAI,CAAC,cAAc,EAAE;gBACvB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;gBAE1B,MAAM,IAAI,GAAe;oBACvB,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK;oBACvC,OAAO,EAAE,MAAA,IAAI,CAAC,mBAAmB,CAAC,SAAS,mCAAI;wBAC7C,UAAU,EAAE,KAAK;wBACjB,SAAS,EAAE,EAAE;qBACd;iBACF,CAAC;gBAEF,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;qBACtB,IAAI,CAAC,GAAG,EAAE;oBACT,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;gBAC3B,CAAC,CAAC;qBACD,KAAK,CAAC,KAAK,CAAC,EAAE;oBACb,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;oBAChD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;gBAC3B,CAAC,CAAC,CA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E,EAAC,kBAAkB,EACrB,KAAK,EAAC,kBAAkB,EACxB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,GAAG,EAAsB,CAAC,GACxD;wBACF,cACE,KAAK,EAAC,QAAQ,EACd,QAAQ,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,YAAY,EAC9C,OAAO,EAAE,IAAI,CAAC,aAAa,IAE1B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CACjC;wBACT,cACE,KAAK,EAAC,QAAQ,EACd,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,OAAO,EAAE,IAAI,CAAC,cAAc,IAE3B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CACjC,CACL;oBAEN,mCACE,EAAE,EAAC,6BAA6B,EAChC,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAC3C,GAAG,EAAE,EAAE,CAAC,EAAE,CACR,CAAC,IAAI,CAAC,mBAAmB;4BACvB,EAAwC,CAAC,EAE7C,kBAAkB,EAAE,IAAI,CAAC,sBAAsB,GAClB,CACd,CACf,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["/* STENCIL IMPORTS */\nimport {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n State\n} from \"@stencil/core\";\n/* OTHER LIBRARIES IMPORTS */\n/* CUSTOM IMPORTS */\nimport { config } from \"../../../common/config\";\nimport { Locale } from \"../../../common/locale\";\nimport { ObjectData } from \"../objects-selector/helpers\";\n\n/* import { renderListItems } from \"../../../common/render-list-item\"; */\n\n@Component({\n tag: \"gx-ide-bpm-export-xpdl\",\n styleUrl: \"export-xpdl.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/bpm-export-xpdl\"]\n})\nexport class GxIdeBpmExportXpdl {\n // 1.OWN PROPERTIES //\n\n /**\n * The component hard-coded strings translations.\n */\n private _componentLocale: any;\n private renderedFirstTime = false;\n\n // 2. REFERENCE TO ELEMENTS //\n\n @Element() el: HTMLGxIdeBpmExportXpdlElement;\n private exportInputEl: HTMLInputElement;\n private bpmObjectSelectorEl: HTMLGxIdeBpmObjectsSelectorElement;\n\n // 3.STATE() VARIABLES //\n\n @State() emptyInput = true;\n @State() emptyObjects = true;\n @State() notExporting = true;\n\n // 4.PUBLIC PROPERTY API | WATCH'S //\n\n /**\n * If true it displays the component title on the header\n */\n @Prop() readonly displayTitle = false;\n\n /**\n * Callback function invoked when the user presses the 'Create' button.\n * This function is expected to handle the export process based on the provided export data.\n *\n * @param {ExportData} exportData - The data required for the export process.\n * @returns {Promise<boolean>} A promise that resolves to a boolean indicating the success of the export operation.\n * Returns `true` if the export was successful, and `false` otherwise.\n */\n @Prop() readonly exportCallback: ExportCallback;\n\n /**\n * Callback invoked when user press 'Cancel' button\n */\n @Prop() readonly cancelCallback: CancelCallback;\n\n /**\n * Callback invoked when the user presses the 'Add' button. associated with gx-ide-bpm-objects-selector\n * This function is expected to return a list of selected objects' basic information.\n * @returns {Promise<ObjectData[]>} A Promise that resolves to an array of ObjectData. Each ObjectData contains the ID, icon, and name of an object.\n */\n @Prop() readonly addCallback: () => Promise<ObjectData[]>;\n\n /**\n * Callback invoked when the user presses the 'References' button. associated with gx-ide-bpm-objects-selector\n * Receives a parameter which is an array of IDs of the objects currently added to the list.\n * Returns a Promise that resolves to an array of ObjectData, where each ObjectData contains the ID, icon, and name of an object.\n * @param {string[]} ids - An array of IDs of the objects currently added to the list.\n * @returns {Promise<ObjectData[]>} A Promise that resolves to an array of ObjectData. Each ObjectData contains the ID, icon, and name of an object.\n */\n @Prop() readonly referencesCallback: (ids: string[]) => Promise<ObjectData[]>;\n\n // 5.EVENTS (EMIT) //\n\n /**\n * @description Gets fired when the component has rendered for the first time.\n */\n @Event() componentDidRenderFirstTime: EventEmitter<string>;\n\n // 6.COMPONENT LIFECYCLE METHODS //\n\n async componentWillLoad() {\n this._componentLocale = await Locale.getComponentStrings(this.el);\n }\n\n componentDidRender() {\n if (!this.renderedFirstTime) {\n this.componentDidRenderFirstTime.emit(\n this._componentLocale.componentName\n );\n this.renderedFirstTime = true;\n }\n }\n\n // 7.LISTENERS //\n\n // 8.PUBLIC METHODS API //\n\n // 9.LOCAL METHODS //\n\n private exportHandler = () => {\n if (this.exportCallback) {\n this.notExporting = false;\n\n const data: ExportData = {\n directoryName: this.exportInputEl.value,\n Objects: this.bpmObjectSelectorEl.selection ?? {\n includeAll: false,\n objectIds: []\n }\n };\n\n this.exportCallback(data)\n .then(() => {\n this.notExporting = true;\n })\n .catch(error => {\n console.error(\"Export callback failed:\", error);\n this.notExporting = true;\n });\n }\n };\n\n private inputHandle = async () => {\n this.emptyInput = !this.exportInputEl.value?.length;\n };\n\n private handleSelectionChanged = () => {\n this.emptyObjects = !this.bpmObjectSelectorEl.selection.objectIds.length;\n };\n\n // 10.RENDER() FUNCTION //\n\n render() {\n return (\n <Host class=\"gx-ide-component\">\n <div class=\"gx-ide-main-wrapper\">\n <gx-ide-container\n containerTitle={\n this.displayTitle ? this._componentLocale.componentName : null\n }\n slimmerFooter={config.gxIdeContainer.slimmerFooter}\n >\n <div class=\"header\">\n <label htmlFor=\"export-directory\" class=\"label\">\n {this._componentLocale.main.exportInputLabel}\n </label>\n <input\n type=\"text\"\n id=\"export-directory\"\n class=\"input-text input\"\n onInput={this.inputHandle}\n ref={el => (this.exportInputEl = el as HTMLInputElement)}\n />\n <button\n class=\"export\"\n disabled={this.emptyInput || this.emptyObjects}\n onClick={this.exportHandler}\n >\n {this._componentLocale.main.exportButton}\n </button>\n <button\n class=\"cancel\"\n disabled={this.notExporting}\n onClick={this.cancelCallback}\n >\n {this._componentLocale.main.cancelButton}\n </button>\n </div>\n\n <gx-ide-bpm-objects-selector\n id=\"gx-ide-bpm-objects-selector\"\n addCallback={this.addCallback}\n referencesCallback={this.referencesCallback}\n ref={el =>\n (this.bpmObjectSelectorEl =\n el as HTMLGxIdeBpmObjectsSelectorElement)\n }\n onSelectionChanged={this.handleSelectionChanged}\n ></gx-ide-bpm-objects-selector>\n </gx-ide-container>\n </div>\n </Host>\n );\n }\n}\n\nexport type ExportCallback = (exportData: ExportData) => Promise<boolean>;\n\nexport type CancelCallback = () => Promise<void>;\n\nexport type ExportData = {\n directoryName: string;\n Objects: SelectionData;\n};\n\nexport type SelectionData = {\n includeAll: boolean;\n objectIds: string[];\n};\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"componentName": "BPM Export XPDL",
|
|
3
|
+
"header": {},
|
|
4
|
+
"main": {
|
|
5
|
+
"exportInputLabel": "Please type the export directory or select it:",
|
|
6
|
+
"exportButton": "Export",
|
|
7
|
+
"cancelButton": "Cancel",
|
|
8
|
+
"addButton": "Add...",
|
|
9
|
+
"selectAllLabel": "Select All",
|
|
10
|
+
"referencesButton": "References",
|
|
11
|
+
"removeButton": "Remove",
|
|
12
|
+
"clearButton": "Clear"
|
|
13
|
+
},
|
|
14
|
+
"footer": {},
|
|
15
|
+
"loader": {
|
|
16
|
+
"title": "Loading...",
|
|
17
|
+
"cancelLabel": "Cancel"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"componentName": "BPM Import GXPM",
|
|
3
3
|
"header": {},
|
|
4
|
-
"main": {
|
|
5
|
-
|
|
4
|
+
"main": {
|
|
5
|
+
"projectPathInputLabel": "Project Path",
|
|
6
|
+
"addFilesButton": "...",
|
|
7
|
+
"automaticBackupCheckboxLabel": "Automatic Backup"
|
|
8
|
+
},
|
|
9
|
+
"footer": {
|
|
10
|
+
"confirmButton": "OK",
|
|
11
|
+
"cancelButton": "Cancel"
|
|
12
|
+
},
|
|
6
13
|
"loader": {
|
|
7
14
|
"title": "Loading...",
|
|
8
15
|
"cancelLabel": "Cancel"
|
|
@@ -10,8 +10,52 @@ export class GxIdeTemplate {
|
|
|
10
10
|
// 7.LISTENERS //
|
|
11
11
|
// 8.PUBLIC METHODS API //
|
|
12
12
|
// 9.LOCAL METHODS //
|
|
13
|
-
this.
|
|
13
|
+
this.loadFileHandle = async () => {
|
|
14
|
+
this.fileInput.click();
|
|
15
|
+
};
|
|
16
|
+
this.handleFileInputChange = (event) => {
|
|
17
|
+
const fileInput = event.target;
|
|
18
|
+
if (fileInput.files && fileInput.files.length > 0) {
|
|
19
|
+
const newFile = fileInput.files[0];
|
|
20
|
+
this.selectedFile = newFile;
|
|
21
|
+
this.pathValue = this.selectedFile.name;
|
|
22
|
+
}
|
|
23
|
+
this.fileInput.value = null;
|
|
24
|
+
};
|
|
25
|
+
this.handlePathInputChange = (event) => {
|
|
26
|
+
this.selectedFile = null;
|
|
27
|
+
const inputElement = event.target;
|
|
28
|
+
const newValue = inputElement.value;
|
|
29
|
+
this.pathValue = newValue;
|
|
30
|
+
};
|
|
31
|
+
this.confirmCallbackHandle = async () => {
|
|
32
|
+
if (this.confirmCallback) {
|
|
33
|
+
const fileName = this.pathValue
|
|
34
|
+
.replace(/^.*?([^\\\/]*)$/, "$1")
|
|
35
|
+
.toLowerCase()
|
|
36
|
+
.trim();
|
|
37
|
+
if (fileName === ".gxpm" || !fileName.endsWith(".gxpm")) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const fileData = this.selectedFile
|
|
41
|
+
? this.selectedFile
|
|
42
|
+
: new File([this.pathValue], fileName);
|
|
43
|
+
const data = {
|
|
44
|
+
automaticBackup: this.automaticBackupEl.value === "true",
|
|
45
|
+
file: fileData
|
|
46
|
+
};
|
|
47
|
+
await this.confirmCallback(data);
|
|
48
|
+
this.fileInput.value = null;
|
|
49
|
+
this.selectedFile = null;
|
|
50
|
+
this.pathValue = "";
|
|
51
|
+
this.automaticBackupEl.value = "false";
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
this.selectedFile = null;
|
|
55
|
+
this.pathValue = "";
|
|
14
56
|
this.displayTitle = false;
|
|
57
|
+
this.confirmCallback = undefined;
|
|
58
|
+
this.cancelCallback = undefined;
|
|
15
59
|
}
|
|
16
60
|
// 6.COMPONENT LIFECYCLE METHODS //
|
|
17
61
|
async componentWillLoad() {
|
|
@@ -25,7 +69,7 @@ export class GxIdeTemplate {
|
|
|
25
69
|
}
|
|
26
70
|
// 10.RENDER() FUNCTION //
|
|
27
71
|
render() {
|
|
28
|
-
return (h(Host, { class: "gx-ide-component" }, h("div", { class: "gx-ide-main-wrapper" }, h("gx-ide-container", { containerTitle: this.displayTitle ? this._componentLocale.componentName : null, slimmerFooter: config.gxIdeContainer.slimmerFooter }, h("div", { class: "header" }, h("label", { htmlFor: "project-path" },
|
|
72
|
+
return (h(Host, { class: "gx-ide-component" }, h("div", { class: "gx-ide-main-wrapper" }, h("gx-ide-container", { containerTitle: this.displayTitle ? this._componentLocale.componentName : null, slimmerFooter: config.gxIdeContainer.slimmerFooter }, h("div", { class: "header" }, h("label", { htmlFor: "project-path" }, this._componentLocale.main.projectPathInputLabel), h("input", { type: "text", class: "input-text", id: "project-path", value: this.pathValue, onChange: this.handlePathInputChange }), h("input", { type: "file", id: "input_file", accept: ".gxpm", ref: el => (this.fileInput = el), onChange: this.handleFileInputChange, class: "hidden-input" }), h("button", { onClick: this.loadFileHandle }, this._componentLocale.main.addFilesButton)), h("div", { class: "control-wrapper" }, h("label", { htmlFor: "automatic-backup" }, this._componentLocale.main.automaticBackupCheckboxLabel), h("ch-checkbox", { id: "automatic-backup", accessibleName: "automatic-backup", checkedValue: "true", unCheckedValue: "false", value: "checked", ref: el => (this.automaticBackupEl = el) })), h("button", { slot: "footer-end", onClick: this.cancelCallback }, this._componentLocale.footer.cancelButton), h("button", { slot: "footer-end", onClick: this.confirmCallbackHandle }, this._componentLocale.footer.confirmButton)))));
|
|
29
73
|
}
|
|
30
74
|
static get is() { return "gx-ide-bpm-import-gxpm"; }
|
|
31
75
|
static get encapsulation() { return "shadow"; }
|
|
@@ -59,9 +103,66 @@ export class GxIdeTemplate {
|
|
|
59
103
|
"attribute": "display-title",
|
|
60
104
|
"reflect": false,
|
|
61
105
|
"defaultValue": "false"
|
|
106
|
+
},
|
|
107
|
+
"confirmCallback": {
|
|
108
|
+
"type": "unknown",
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"complexType": {
|
|
111
|
+
"original": "(data: ImportData) => Promise<void>",
|
|
112
|
+
"resolved": "(data: ImportData) => Promise<void>",
|
|
113
|
+
"references": {
|
|
114
|
+
"ImportData": {
|
|
115
|
+
"location": "local",
|
|
116
|
+
"path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/import-gxpm/import-gxpm.tsx",
|
|
117
|
+
"id": "src/components/bpm/import-gxpm/import-gxpm.tsx::ImportData"
|
|
118
|
+
},
|
|
119
|
+
"Promise": {
|
|
120
|
+
"location": "global",
|
|
121
|
+
"id": "global::Promise"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"required": false,
|
|
126
|
+
"optional": false,
|
|
127
|
+
"docs": {
|
|
128
|
+
"tags": [{
|
|
129
|
+
"name": "param",
|
|
130
|
+
"text": "data - The data to be processed. This can be a string or a File object."
|
|
131
|
+
}, {
|
|
132
|
+
"name": "returns",
|
|
133
|
+
"text": "A Promise that resolves to void, indicating the completion of the operation."
|
|
134
|
+
}],
|
|
135
|
+
"text": "Callback function to be executed when OK button is pressed.\nThis callback is expected to handle the file or string input and return a Promise that resolves when is completed."
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"cancelCallback": {
|
|
139
|
+
"type": "unknown",
|
|
140
|
+
"mutable": false,
|
|
141
|
+
"complexType": {
|
|
142
|
+
"original": "() => Promise<void>",
|
|
143
|
+
"resolved": "() => Promise<void>",
|
|
144
|
+
"references": {
|
|
145
|
+
"Promise": {
|
|
146
|
+
"location": "global",
|
|
147
|
+
"id": "global::Promise"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"required": false,
|
|
152
|
+
"optional": false,
|
|
153
|
+
"docs": {
|
|
154
|
+
"tags": [],
|
|
155
|
+
"text": "Callback invoked when user press 'Cancel' button."
|
|
156
|
+
}
|
|
62
157
|
}
|
|
63
158
|
};
|
|
64
159
|
}
|
|
160
|
+
static get states() {
|
|
161
|
+
return {
|
|
162
|
+
"selectedFile": {},
|
|
163
|
+
"pathValue": {}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
65
166
|
static get events() {
|
|
66
167
|
return [{
|
|
67
168
|
"method": "componentDidRenderFirstTime",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-gxpm.js","sourceRoot":"","sources":["../../../../src/components/bpm/import-gxpm/import-gxpm.tsx"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,OAAO,EACP,KAAK,
|
|
1
|
+
{"version":3,"file":"import-gxpm.js","sourceRoot":"","sources":["../../../../src/components/bpm/import-gxpm/import-gxpm.tsx"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,OAAO,EACP,KAAK,EAEL,KAAK,EACN,MAAM,eAAe,CAAC;AACvB,6BAA6B;AAE7B,oBAAoB;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAQhD,MAAM,OAAO,aAAa;;QAOhB,sBAAiB,GAAG,KAAK,CAAC;QA8DlC,iBAAiB;QAEjB,0BAA0B;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["/* STENCIL IMPORTS */\nimport {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n State\n} from \"@stencil/core\";\n/* OTHER LIBRARIES IMPORTS */\n\n/* CUSTOM IMPORTS */\nimport { config } from \"../../../common/config\";\nimport { Locale } from \"../../../common/locale\";\n\n@Component({\n tag: \"gx-ide-bpm-import-gxpm\",\n styleUrl: \"import-gxpm.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/bpm-import-gxpm\"]\n})\nexport class GxIdeTemplate {\n // 1.OWN PROPERTIES //\n\n /**\n * The component hard-coded strings translations.\n */\n private _componentLocale: any;\n private renderedFirstTime = false;\n\n // 2. REFERENCE TO ELEMENTS //\n\n @Element() el: HTMLGxIdeBpmImportGxpmElement;\n\n private fileInput: HTMLInputElement;\n private automaticBackupEl: HTMLChCheckboxElement;\n\n // 3.STATE() VARIABLES //\n\n /**\n * Contains the list of files\n */\n @State() selectedFile: File = null;\n\n /**\n * Contains the path input value\n */\n @State() pathValue: string = \"\";\n\n // 4.PUBLIC PROPERTY API | WATCH'S //\n\n /**\n * If true it displays the component title on the header\n */\n @Prop() readonly displayTitle = false;\n /**\n * Callback function to be executed when OK button is pressed.\n * This callback is expected to handle the file or string input and return a Promise that resolves when is completed.\n *\n * @param {ImportData} data - The data to be processed. This can be a string or a File object.\n * @returns {Promise<void>} A Promise that resolves to void, indicating the completion of the operation.\n */\n @Prop() readonly confirmCallback: (data: ImportData) => Promise<void>;\n /**\n * Callback invoked when user press 'Cancel' button.\n */\n @Prop() readonly cancelCallback: () => Promise<void>;\n\n // 5.EVENTS (EMIT) //\n\n /**\n * @description Gets fired when the component has rendered for the first time.\n */\n @Event() componentDidRenderFirstTime: EventEmitter<string>;\n\n // 6.COMPONENT LIFECYCLE METHODS //\n\n async componentWillLoad() {\n this._componentLocale = await Locale.getComponentStrings(this.el);\n }\n\n componentDidRender() {\n if (!this.renderedFirstTime) {\n this.componentDidRenderFirstTime.emit(\n this._componentLocale.componentName\n );\n this.renderedFirstTime = true;\n }\n }\n\n // 7.LISTENERS //\n\n // 8.PUBLIC METHODS API //\n\n // 9.LOCAL METHODS //\n\n private loadFileHandle = async () => {\n this.fileInput.click();\n };\n\n private handleFileInputChange = (event: Event) => {\n const fileInput = event.target as HTMLInputElement;\n\n if (fileInput.files && fileInput.files.length > 0) {\n const newFile: File = fileInput.files[0];\n this.selectedFile = newFile;\n this.pathValue = this.selectedFile.name;\n }\n\n this.fileInput.value = null;\n };\n\n private handlePathInputChange = (event: Event) => {\n this.selectedFile = null;\n const inputElement = event.target as HTMLInputElement;\n const newValue = inputElement.value;\n\n this.pathValue = newValue;\n };\n\n private confirmCallbackHandle = async () => {\n if (this.confirmCallback) {\n const fileName = this.pathValue\n .replace(/^.*?([^\\\\\\/]*)$/, \"$1\")\n .toLowerCase()\n .trim();\n if (fileName === \".gxpm\" || !fileName.endsWith(\".gxpm\")) {\n return;\n }\n const fileData = this.selectedFile\n ? this.selectedFile\n : new File([this.pathValue], fileName);\n\n const data: ImportData = {\n automaticBackup: this.automaticBackupEl.value === \"true\",\n file: fileData\n };\n\n await this.confirmCallback(data);\n\n this.fileInput.value = null;\n this.selectedFile = null;\n this.pathValue = \"\";\n this.automaticBackupEl.value = \"false\";\n }\n };\n\n // 10.RENDER() FUNCTION //\n\n render() {\n return (\n <Host class=\"gx-ide-component\">\n <div class=\"gx-ide-main-wrapper\">\n <gx-ide-container\n containerTitle={\n this.displayTitle ? this._componentLocale.componentName : null\n }\n slimmerFooter={config.gxIdeContainer.slimmerFooter}\n >\n <div class=\"header\">\n <label htmlFor=\"project-path\">\n {this._componentLocale.main.projectPathInputLabel}\n </label>\n <input\n type=\"text\"\n class=\"input-text\"\n id=\"project-path\"\n value={this.pathValue}\n onChange={this.handlePathInputChange}\n />\n <input\n type=\"file\"\n id=\"input_file\"\n accept=\".gxpm\"\n ref={el => (this.fileInput = el as HTMLInputElement)}\n onChange={this.handleFileInputChange}\n class=\"hidden-input\"\n />\n <button onClick={this.loadFileHandle}>\n {this._componentLocale.main.addFilesButton}\n </button>\n </div>\n\n <div class=\"control-wrapper\">\n <label htmlFor=\"automatic-backup\">\n {this._componentLocale.main.automaticBackupCheckboxLabel}\n </label>\n\n <ch-checkbox\n id=\"automatic-backup\"\n accessibleName=\"automatic-backup\"\n checkedValue=\"true\"\n unCheckedValue=\"false\"\n value=\"checked\"\n ref={el =>\n (this.automaticBackupEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n </div>\n <button slot=\"footer-end\" onClick={this.cancelCallback}>\n {this._componentLocale.footer.cancelButton}\n </button>\n <button slot=\"footer-end\" onClick={this.confirmCallbackHandle}>\n {this._componentLocale.footer.confirmButton}\n </button>\n </gx-ide-container>\n </div>\n </Host>\n );\n }\n}\n\nexport type ImportData = {\n file: File;\n automaticBackup: boolean;\n};\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"componentName": "BPM Object Selector",
|
|
3
|
+
"header": {},
|
|
4
|
+
"main": {
|
|
5
|
+
"exportDirectoryLabel": "Please type the export directory or select it:",
|
|
6
|
+
"addButton": "Add...",
|
|
7
|
+
"includeAllLabel": "Include All",
|
|
8
|
+
"referencesButton": "References",
|
|
9
|
+
"removeButton": "Remove",
|
|
10
|
+
"clearButton": "Clear"
|
|
11
|
+
},
|
|
12
|
+
"footer": {},
|
|
13
|
+
"loader": {
|
|
14
|
+
"title": "Loading...",
|
|
15
|
+
"cancelLabel": "Cancel"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const objectsToListItemData = (objects) => {
|
|
2
|
+
const itemsData = [];
|
|
3
|
+
objects.forEach(object => {
|
|
4
|
+
const itemId = object.id;
|
|
5
|
+
const itemValue = object.name;
|
|
6
|
+
const itemIcon = object.icon;
|
|
7
|
+
const itemChecked = false;
|
|
8
|
+
itemsData.push({
|
|
9
|
+
itemId: itemId,
|
|
10
|
+
itemValue: itemValue,
|
|
11
|
+
itemIcon: itemIcon,
|
|
12
|
+
itemChecked: itemChecked
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
return itemsData;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/components/bpm/objects-selector/helpers.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,OAAqB,EAAc,EAAE;IACzE,MAAM,SAAS,GAAe,EAAE,CAAC;IACjC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACvB,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;QACzB,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC;QAC9B,MAAM,QAAQ,GAAW,MAAM,CAAC,IAAI,CAAC;QACrC,MAAM,WAAW,GAAY,KAAK,CAAC;QACnC,SAAS,CAAC,IAAI,CAAC;YACb,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,SAAS;YACpB,QAAQ,EAAE,QAAQ;YAClB,WAAW,EAAE,WAAW;SACzB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["import { ItemData } from \"../../_helpers/list-selector/list-selector-item/list-selector-item\";\n\nexport type ObjectData = {\n id: string;\n icon: string;\n name: string;\n};\n\nexport const objectsToListItemData = (objects: ObjectData[]): ItemData[] => {\n const itemsData: ItemData[] = [];\n objects.forEach(object => {\n const itemId = object.id;\n const itemValue = object.name;\n const itemIcon: string = object.icon;\n const itemChecked: boolean = false;\n itemsData.push({\n itemId: itemId,\n itemValue: itemValue,\n itemIcon: itemIcon,\n itemChecked: itemChecked\n });\n });\n return itemsData;\n};\n"]}
|