@genexus/genexus-ide-ui 0.0.139 → 0.0.140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
  2. package/dist/cjs/gx-ide-bpm-import-files.cjs.entry.js +103 -0
  3. package/dist/cjs/gx-ide-bpm-import-files.cjs.entry.js.map +1 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/collection/collection-manifest.json +3 -3
  6. package/dist/collection/components/bpm/import-files/gx-ide-assets/bpm-import-files/langs/bpm-import-files.lang.en.json +18 -0
  7. package/dist/collection/components/bpm/import-files/helpers.js.map +1 -0
  8. package/dist/collection/components/bpm/{files-selector/files-selector.css → import-files/import-files.css} +27 -0
  9. package/dist/collection/components/bpm/{files-selector/files-selector.js → import-files/import-files.js} +32 -33
  10. package/dist/collection/components/bpm/import-files/import-files.js.map +1 -0
  11. package/dist/components/gx-ide-bpm-import-files.d.ts +11 -0
  12. package/dist/components/gx-ide-bpm-import-files.js +172 -0
  13. package/dist/components/gx-ide-bpm-import-files.js.map +1 -0
  14. package/dist/esm/genexus-ide-ui.js +1 -1
  15. package/dist/esm/gx-ide-bpm-import-files.entry.js +99 -0
  16. package/dist/esm/gx-ide-bpm-import-files.entry.js.map +1 -0
  17. package/dist/esm/loader.js +1 -1
  18. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  19. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
  20. package/dist/genexus-ide-ui/gx-ide-assets/bpm-import-files/langs/bpm-import-files.lang.en.json +18 -0
  21. package/dist/genexus-ide-ui/{p-82291acd.entry.js → p-03b2a741.entry.js} +43 -19
  22. package/dist/genexus-ide-ui/p-03b2a741.entry.js.map +1 -0
  23. package/dist/types/components/bpm/{files-selector/files-selector.d.ts → import-files/import-files.d.ts} +11 -5
  24. package/dist/types/components.d.ts +34 -32
  25. package/package.json +1 -1
  26. package/dist/cjs/gx-ide-bpm-files-selector.cjs.entry.js +0 -101
  27. package/dist/cjs/gx-ide-bpm-files-selector.cjs.entry.js.map +0 -1
  28. package/dist/collection/components/bpm/files-selector/files-selector.js.map +0 -1
  29. package/dist/collection/components/bpm/files-selector/gx-ide-assets/bpm-files-selector/langs/bpm-files-selector.lang.en.json +0 -14
  30. package/dist/collection/components/bpm/files-selector/helpers.js.map +0 -1
  31. package/dist/components/gx-ide-bpm-files-selector.d.ts +0 -11
  32. package/dist/components/gx-ide-bpm-files-selector.js +0 -164
  33. package/dist/components/gx-ide-bpm-files-selector.js.map +0 -1
  34. package/dist/esm/gx-ide-bpm-files-selector.entry.js +0 -97
  35. package/dist/esm/gx-ide-bpm-files-selector.entry.js.map +0 -1
  36. package/dist/genexus-ide-ui/gx-ide-assets/bpm-files-selector/langs/bpm-files-selector.lang.en.json +0 -14
  37. package/dist/genexus-ide-ui/p-82291acd.entry.js.map +0 -1
  38. package/dist/types/components/bpm/import-gxpm/import-gxpm.d.ts +0 -21
  39. /package/dist/collection/components/bpm/{files-selector/gx-ide-assets/bpm-files-selector/langs/bpm-files-selector.lang.ja.json → import-files/gx-ide-assets/bpm-import-files/langs/bpm-import-files.lang.ja.json} +0 -0
  40. /package/dist/collection/components/bpm/{files-selector/gx-ide-assets/bpm-files-selector/langs/bpm-files-selector.lang.zh.json → import-files/gx-ide-assets/bpm-import-files/langs/bpm-import-files.lang.zh.json} +0 -0
  41. /package/dist/collection/components/bpm/{files-selector → import-files}/helpers.js +0 -0
  42. /package/dist/genexus-ide-ui/gx-ide-assets/{bpm-files-selector/langs/bpm-files-selector.lang.ja.json → bpm-import-files/langs/bpm-import-files.lang.ja.json} +0 -0
  43. /package/dist/genexus-ide-ui/gx-ide-assets/{bpm-files-selector/langs/bpm-files-selector.lang.zh.json → bpm-import-files/langs/bpm-import-files.lang.zh.json} +0 -0
  44. /package/dist/types/components/bpm/{files-selector → import-files}/helpers.d.ts +0 -0
@@ -21,26 +21,28 @@ export class GxIdeTemplate {
21
21
  this.loadFileHandle = async () => {
22
22
  this.fileInput.click();
23
23
  };
24
- this.handleFileInputChange = async (event) => {
24
+ this.handleFileInputChange = (event) => {
25
25
  const fileInput = event.target;
26
26
  if (fileInput.files && fileInput.files.length > 0) {
27
27
  const newFiles = Array.from(fileInput.files);
28
28
  const uniqueFiles = newFiles.filter(newFile => !this.files.some(existingFile => existingFile.name === newFile.name));
29
29
  this.files = [...this.files, ...uniqueFiles];
30
30
  }
31
- if (this.addCallback) {
32
- await this.addCallback(this.files);
33
- }
34
31
  this.fileInput.value = null;
35
32
  };
33
+ this.confirmCallbackHandle = async () => {
34
+ if (this.confirmCallback && this.files.length > 0) {
35
+ const data = {
36
+ automaticBackup: this.automaticBackupEl.checked,
37
+ files: this.files
38
+ };
39
+ await this.confirmCallback(data);
40
+ }
41
+ };
36
42
  this.removeFiles = (filesToRemove) => {
37
- const removedFiles = this.files.filter(file => filesToRemove.includes(file.name));
38
43
  this.files = this.files.filter(file => !filesToRemove.includes(file.name));
39
- if (this.removeCallback) {
40
- this.removeCallback(removedFiles);
41
- this.selectedFiles = [];
42
- this.fileInput.value = null;
43
- }
44
+ this.selectedFiles = [];
45
+ this.fileInput.value = null;
44
46
  };
45
47
  this.handleRemoveButtonClick = () => {
46
48
  this.removeFiles(this.selectedFiles);
@@ -49,8 +51,8 @@ export class GxIdeTemplate {
49
51
  this.selectedFiles = [];
50
52
  this.displayTitle = false;
51
53
  this.allowedExtensions = undefined;
52
- this.addCallback = undefined;
53
- this.removeCallback = undefined;
54
+ this.confirmCallback = undefined;
55
+ this.cancelCallback = undefined;
54
56
  }
55
57
  // 6.COMPONENT LIFECYCLE METHODS //
56
58
  async componentWillLoad() {
@@ -65,21 +67,21 @@ export class GxIdeTemplate {
65
67
  // 10.RENDER() FUNCTION //
66
68
  render() {
67
69
  var _a;
68
- 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("label", { htmlFor: "path-list" }, this._componentLocale.main.listLabel), h("gx-ide-list-selector", { id: "path-list", type: "multi-selection", listName: "path-list", noListBorder: true, ordered: true, onSelectionChanged: this.fileSelectionChangedHandler, class: "path-list" }, renderListItems(filesToListItemsData(this.files))), h("div", { class: "controls-wrapper" }, h("input", { type: "file", id: "input_file", accept: (_a = this.allowedExtensions) === null || _a === void 0 ? void 0 : _a.join(", "), ref: el => (this.fileInput = el), onChange: this.handleFileInputChange, class: "hidden-input", multiple: true }), h("button", { onClick: this.loadFileHandle }, this._componentLocale.main.addFilesButton), h("button", { onClick: this.handleRemoveButtonClick, disabled: this.selectedFiles.length === 0 }, this._componentLocale.main.removeFilesButton, " (", this.selectedFiles.length, ")"))))));
70
+ 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: "main" }, h("div", { class: "controls-wrapper controls-wrapper--vertical" }, h("label", { htmlFor: "path-list" }, this._componentLocale.main.listLabel), h("gx-ide-list-selector", { id: "path-list", type: "multi-selection", listName: "path-list", ordered: true, onSelectionChanged: this.fileSelectionChangedHandler, class: "path-list" }, renderListItems(filesToListItemsData(this.files)))), h("div", { class: "footer" }, h("div", { class: "checkbox-container" }, h("ch-checkbox", { id: "automatic-backup", accessibleName: this._componentLocale.main.automaticBackupLabel, checkedValue: "true", unCheckedValue: "false", value: "checked", ref: el => (this.automaticBackupEl = el) }), h("label", { htmlFor: "automatic-backup" }, this._componentLocale.main.automaticBackupLabel)), h("div", { class: "controls-wrapper" }, h("input", { type: "file", id: "input_file", accept: (_a = this.allowedExtensions) === null || _a === void 0 ? void 0 : _a.join(", "), ref: el => (this.fileInput = el), onChange: this.handleFileInputChange, class: "hidden-input", multiple: true }), h("button", { onClick: this.loadFileHandle }, this._componentLocale.main.addFilesButton), h("button", { onClick: this.handleRemoveButtonClick, disabled: this.selectedFiles.length === 0 }, this._componentLocale.main.removeFilesButton, " (", this.selectedFiles.length, ")")))), h("button", { slot: "footer-end", onClick: this.confirmCallbackHandle }, this._componentLocale.footer.confirmButton), h("button", { slot: "footer-end", onClick: this.cancelCallback }, this._componentLocale.footer.cancelButton)))));
69
71
  }
70
- static get is() { return "gx-ide-bpm-files-selector"; }
72
+ static get is() { return "gx-ide-bpm-import-files"; }
71
73
  static get encapsulation() { return "shadow"; }
72
74
  static get originalStyleUrls() {
73
75
  return {
74
- "$": ["files-selector.scss"]
76
+ "$": ["import-files.scss"]
75
77
  };
76
78
  }
77
79
  static get styleUrls() {
78
80
  return {
79
- "$": ["files-selector.css"]
81
+ "$": ["import-files.css"]
80
82
  };
81
83
  }
82
- static get assetsDirs() { return ["gx-ide-assets/bpm-files-selector"]; }
84
+ static get assetsDirs() { return ["gx-ide-assets/bpm-import-files"]; }
83
85
  static get properties() {
84
86
  return {
85
87
  "displayTitle": {
@@ -115,16 +117,17 @@ export class GxIdeTemplate {
115
117
  "text": "Allowed extensions when 'Add files' button is pressed"
116
118
  }
117
119
  },
118
- "addCallback": {
120
+ "confirmCallback": {
119
121
  "type": "unknown",
120
122
  "mutable": false,
121
123
  "complexType": {
122
- "original": "(files: File[]) => Promise<void>",
123
- "resolved": "(files: File[]) => Promise<void>",
124
+ "original": "(data: ImportData) => Promise<boolean>",
125
+ "resolved": "(data: ImportData) => Promise<boolean>",
124
126
  "references": {
125
- "File": {
126
- "location": "global",
127
- "id": "global::File"
127
+ "ImportData": {
128
+ "location": "local",
129
+ "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/import-files/import-files.tsx",
130
+ "id": "src/components/bpm/import-files/import-files.tsx::ImportData"
128
131
  },
129
132
  "Promise": {
130
133
  "location": "global",
@@ -136,20 +139,16 @@ export class GxIdeTemplate {
136
139
  "optional": false,
137
140
  "docs": {
138
141
  "tags": [],
139
- "text": "Callback invoked when user press 'Add files' button. Returns a list with selected files."
142
+ "text": "Callback invoked when user press 'OK' button"
140
143
  }
141
144
  },
142
- "removeCallback": {
145
+ "cancelCallback": {
143
146
  "type": "unknown",
144
147
  "mutable": false,
145
148
  "complexType": {
146
- "original": "(files: File[] | string[]) => Promise<void>",
147
- "resolved": "(files: string[] | File[]) => Promise<void>",
149
+ "original": "() => Promise<void>",
150
+ "resolved": "() => Promise<void>",
148
151
  "references": {
149
- "File": {
150
- "location": "global",
151
- "id": "global::File"
152
- },
153
152
  "Promise": {
154
153
  "location": "global",
155
154
  "id": "global::Promise"
@@ -160,7 +159,7 @@ export class GxIdeTemplate {
160
159
  "optional": false,
161
160
  "docs": {
162
161
  "tags": [],
163
- "text": "Callback invoked when remove button is pressed."
162
+ "text": "Callback invoked when user press 'Cancel' button."
164
163
  }
165
164
  }
166
165
  };
@@ -212,4 +211,4 @@ export class GxIdeTemplate {
212
211
  }
213
212
  static get elementRef() { return "el"; }
214
213
  }
215
- //# sourceMappingURL=files-selector.js.map
214
+ //# sourceMappingURL=import-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-files.js","sourceRoot":"","sources":["../../../../src/components/bpm/import-files/import-files.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;AAGvB,oBAAoB;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAQjD,MAAM,OAAO,aAAa;;QAQhB,sBAAiB,GAAG,KAAK,CAAC;QAqElC,iBAAiB;QAEjB,0BAA0B;QAE1B,qBAA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KAAK,EAAC,cAAc,EACpB,QAAQ,SACR;gCACF,cAAQ,OAAO,EAAE,IAAI,CAAC,cAAc,IACjC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,CACnC;gCACT,cACE,OAAO,EAAE,IAAI,CAAC,uBAAuB,EACrC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC;oCAExC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,iBAAiB;;oCAC5C,IAAI,CAAC,aAAa,CAAC,MAAM;wCACnB,CACL,CACF,CACF;oBAEN,cAAQ,IAAI,EAAC,YAAY,EAAC,OAAO,EAAE,IAAI,CAAC,qBAAqB,IAC1D,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,aAAa,CACpC;oBACT,cAAQ,IAAI,EAAC,YAAY,EAAC,OAAO,EAAE,IAAI,CAAC,cAAc,IACnD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,YAAY,CACnC,CACQ,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 */\nimport { CheckedItemsInfo } from \"../../_helpers/list-selector/list-selector\";\n/* CUSTOM IMPORTS */\nimport { config } from \"../../../common/config\";\nimport { Locale } from \"../../../common/locale\";\nimport { renderListItems } from \"../../../common/render-list-item\";\nimport { filesToListItemsData } from \"./helpers\";\n\n@Component({\n tag: \"gx-ide-bpm-import-files\",\n styleUrl: \"import-files.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/bpm-import-files\"]\n})\nexport class GxIdeTemplate {\n // 1.OWN PROPERTIES //\n\n /**\n * The component hard-coded strings translations.\n */\n private _componentLocale: any;\n\n private renderedFirstTime = false;\n\n // 2. REFERENCE TO ELEMENTS //\n\n @Element() el: HTMLGxIdeBpmImportFilesElement;\n\n private fileInput: HTMLInputElement;\n private automaticBackupEl: HTMLChCheckboxElement;\n\n // 3.STATE() VARIABLES //\n /**\n * Contains the list of files\n */\n @State() files: File[] = [];\n\n /**\n * Contains the list of selected files\n */\n @State() selectedFiles: 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 /**\n * Allowed extensions when 'Add files' button is pressed\n */\n @Prop() readonly allowedExtensions: string[];\n\n /**\n * Callback invoked when user press 'OK' button\n */\n @Prop() readonly confirmCallback: (data: ImportData) => Promise<boolean>;\n\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 /**\n * @description Gets fired when something changes on items section.\n */\n @Event() selectionChanged: EventEmitter<void>;\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 fileSelectionChangedHandler = (\n selectedItem: CustomEvent<CheckedItemsInfo>\n ) => {\n this.selectionChanged.emit();\n\n const selectedFiles = Array.isArray(selectedItem.detail)\n ? selectedItem.detail\n : [selectedItem.detail];\n\n this.selectedFiles = selectedFiles.map(item => item.itemValue);\n };\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 newFiles: File[] = Array.from(fileInput.files);\n const uniqueFiles = newFiles.filter(\n newFile =>\n !this.files.some(existingFile => existingFile.name === newFile.name)\n );\n this.files = [...this.files, ...uniqueFiles];\n }\n\n this.fileInput.value = null;\n };\n\n private confirmCallbackHandle = async () => {\n if (this.confirmCallback && this.files.length > 0) {\n const data: ImportData = {\n automaticBackup: this.automaticBackupEl.checked,\n files: this.files\n };\n\n await this.confirmCallback(data);\n }\n };\n\n private removeFiles = (filesToRemove: string[]) => {\n this.files = this.files.filter(file => !filesToRemove.includes(file.name));\n\n this.selectedFiles = [];\n this.fileInput.value = null;\n };\n\n private handleRemoveButtonClick = () => {\n this.removeFiles(this.selectedFiles);\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=\"main\">\n {/* path list*/}\n <div class=\"controls-wrapper controls-wrapper--vertical\">\n <label htmlFor=\"path-list\">\n {this._componentLocale.main.listLabel}\n </label>\n <gx-ide-list-selector\n id=\"path-list\"\n type=\"multi-selection\"\n listName=\"path-list\"\n ordered\n onSelectionChanged={this.fileSelectionChangedHandler}\n class=\"path-list\"\n >\n {renderListItems(filesToListItemsData(this.files))}\n </gx-ide-list-selector>\n </div>\n\n <div class=\"footer\">\n <div class=\"checkbox-container\">\n <ch-checkbox\n id=\"automatic-backup\"\n accessibleName={\n this._componentLocale.main.automaticBackupLabel\n }\n checkedValue=\"true\"\n unCheckedValue=\"false\"\n value=\"checked\"\n ref={el =>\n (this.automaticBackupEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n <label htmlFor=\"automatic-backup\">\n {this._componentLocale.main.automaticBackupLabel}\n </label>\n </div>\n <div class=\"controls-wrapper\">\n <input\n type=\"file\"\n id=\"input_file\"\n accept={this.allowedExtensions?.join(\", \")}\n ref={el => (this.fileInput = el as HTMLInputElement)}\n onChange={this.handleFileInputChange}\n class=\"hidden-input\"\n multiple\n />\n <button onClick={this.loadFileHandle}>\n {this._componentLocale.main.addFilesButton}\n </button>\n <button\n onClick={this.handleRemoveButtonClick}\n disabled={this.selectedFiles.length === 0}\n >\n {this._componentLocale.main.removeFilesButton} (\n {this.selectedFiles.length})\n </button>\n </div>\n </div>\n </div>\n\n <button slot=\"footer-end\" onClick={this.confirmCallbackHandle}>\n {this._componentLocale.footer.confirmButton}\n </button>\n <button slot=\"footer-end\" onClick={this.cancelCallback}>\n {this._componentLocale.footer.cancelButton}\n </button>\n </gx-ide-container>\n </div>\n </Host>\n );\n }\n}\n\nexport type ImportData = {\n files: File[];\n automaticBackup: boolean;\n};\n"]}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface GxIdeBpmImportFiles extends Components.GxIdeBpmImportFiles, HTMLElement {}
4
+ export const GxIdeBpmImportFiles: {
5
+ prototype: GxIdeBpmImportFiles;
6
+ new (): GxIdeBpmImportFiles;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,172 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { c as config } from './config.js';
3
+ import { L as Locale } from './locale.js';
4
+ import { r as renderListItems } from './render-list-item.js';
5
+ import { d as defineCustomElement$9 } from './checkbox.js';
6
+ import { d as defineCustomElement$8 } from './icon.js';
7
+ import { d as defineCustomElement$7 } from './container.js';
8
+ import { d as defineCustomElement$6 } from './list-selector.js';
9
+ import { d as defineCustomElement$5 } from './list-selector-item.js';
10
+ import { d as defineCustomElement$4 } from './title2.js';
11
+ import { d as defineCustomElement$3 } from './icon2.js';
12
+ import { d as defineCustomElement$2 } from './title.js';
13
+
14
+ const filesToListItemsData = (files) => {
15
+ const itemsData = [];
16
+ files.forEach(file => {
17
+ const itemId = typeof file === "string" ? file : file.name;
18
+ const itemValue = typeof file === "string" ? file : file.name;
19
+ const itemIcon = undefined;
20
+ const itemChecked = false;
21
+ itemsData.push({
22
+ itemId: itemId,
23
+ itemValue: itemValue,
24
+ itemIcon: itemIcon,
25
+ itemChecked: itemChecked
26
+ });
27
+ });
28
+ return itemsData;
29
+ };
30
+
31
+ const importFilesCss = ":root{--ui-animaton-speed:0.2s}.gxg-title-01{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-01-font-weight);font-size:var(--ds-title-01-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-01--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-01-font-weight);font-size:var(--ds-title-01-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-title-02{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-02-font-weight);font-size:var(--ds-title-02-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-02--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-02-font-weight);font-size:var(--ds-title-02-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable);color:var(--color-on-primary)}.gxg-title-03{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-03-font-weight);font-size:var(--ds-title-03-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-03--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-03-font-weight);font-size:var(--ds-title-03-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-title-04{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-04-font-weight);font-size:var(--ds-title-04-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-04--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-04-font-weight);font-size:var(--ds-title-04-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-title-05{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-05-font-weight);font-size:var(--ds-title-05-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-05--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-05-font-weight);font-size:var(--ds-title-05-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-text{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable)}.gxg-text--negative{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-text--gray{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--dimmed)}.gxg-quote{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);font-style:italic}.gxg-quote--negative{color:var(--ds-base-font-color--negative)}.gxg-link{line-height:unset;font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--link);text-decoration:underline;cursor:pointer;display:inline-block}.gxg-link:hover{color:var(--ds-base-font-color--link-hover)}.gxg-link:active{color:var(--ds-base-font-color--link-active)}.gxg-link-gray{line-height:unset;font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--link);text-decoration:underline;cursor:pointer;display:inline-block;color:var(--ds-base-font-color--dimmed)}.gxg-link-gray:hover{line-height:unset;font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--link);text-decoration:underline;cursor:pointer;display:inline-block;color:var(--ds-base-font-color--dimmed);filter:brightness(1.4)}.gxg-alert-error{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--error);display:inline-block}.gxg-alert-warning{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--warning);display:inline-block}.gxg-alert-success{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--success);display:inline-block}.gxg-tab--disabled{color:var(--color-primary-disabled);pointer-events:none}.gxg-tab--disabled[disabled]{color:var(--color-primary-disabled);pointer-events:none}.gxg-label{font-family:var(--ds-base-font-family-primary);font-weight:var(--gxg-label-font-weight);font-size:var(--gxg-label-font-size);color:var(--gxg-label-color);text-align:center;line-height:1.455em;display:flex;align-items:center}.gxg-label:hover{color:var(--color-primary-hover)}.gxg-label:focus{color:var(--color-primary-active)}.gxg-label:active{color:var(--color-primary-active)}.gxg-label[disabled]{color:var(--color-primary-disabled)}.gxg-label--negative{color:var(--color-on-primary)}.gxg-label--negative[disabled]{color:var(--color-on-disabled)}.gxg-scrollbar{}.gxg-scrollbar::-webkit-scrollbar{width:var(--gxg-scrollbar-width);height:var(--gxg-scrollbar-width)}.gxg-scrollbar::-webkit-scrollbar-track{background-color:var(--gxg-scrollbar-track-background);border-radius:var(--gxg-scrollbar-track-border-radius)}.gxg-scrollbar::-webkit-scrollbar-thumb{background-color:var(--gxg-scrollbar-track-thumb-background);border-radius:var(--gxg-scrollbar-track-thumb-radius)}.gxg-scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--gxg-scrollbar-track-thumb-hover-background)}.gxg-scrollbar::-webkit-scrollbar-corner{background:rgba(0, 0, 0, 0)}.gxi-hidden{display:none !important}.gxi-full-height{height:100%}.gxi-overflow-auto{overflow:auto}.gxi-display-flex{display:flex}.align-start{display:flex;align-items:start}.align-center{display:flex;align-items:center}.align-end{display:flex;align-items:end}.overflow-auto{overflow:auto}.justify-start{display:flex;justify-content:start}.justify-center{display:flex;justify-content:center}.justify-end{display:flex;justify-content:end}.grid{display:grid;grid-row-gap:var(--gx-ide-grid-row-gap);grid-column-gap:var(--gx-ide-grid-column-gap);grid-template-rows:auto}ch-grid-cell{display:flex}ch-grid{overflow:auto;height:100%}ch-grid-column{z-index:99;border-bottom:1px solid var(--mer-color__neutral-gray--800)}ch-grid-column:first-child{padding-inline-start:var(--gx-ide-container__padding) !important}ch-grid-column:last-child{padding-inline-end:var(--gx-ide-container__padding) !important}ch-grid-cell{--mer-spacing--xs:var(--gx-ide-container__padding)}.layout{display:grid;gap:var(--mer-spacing--lg);box-sizing:border-box}.layout--two-cols{grid-template-columns:1fr 1fr}.layout--space-above{padding-block-start:var(--mer-spacing--lg)}gxg-tabs{box-shadow:none}:host(.gx-ide-component){height:100% !important;display:flex !important;flex-direction:column !important}:host(:focus-within) gx-ide-top-bar::part(wrapper){background-color:var(--color-secondary-enabled)}.gx-ide-main-wrapper{color:var(--gx-ide-component-text-color);font-weight:var(--mer-font__weight--regular);font-size:var(--mer-font__size--xs);font-family:var(--mer-font-family--primary);height:100%;background-color:var(--gx-ide-component-background-color);display:flex;flex-direction:column;flex-grow:1;box-sizing:border-box}.gx-ide-main{flex-grow:1;overflow-y:auto;}.gx-ide-main::-webkit-scrollbar{width:var(--gxg-scrollbar-width);height:var(--gxg-scrollbar-width)}.gx-ide-main::-webkit-scrollbar-track{background-color:var(--gxg-scrollbar-track-background);border-radius:var(--gxg-scrollbar-track-border-radius)}.gx-ide-main::-webkit-scrollbar-thumb{background-color:var(--gxg-scrollbar-track-thumb-background);border-radius:var(--gxg-scrollbar-track-thumb-radius)}.gx-ide-main::-webkit-scrollbar-thumb:hover{background-color:var(--gxg-scrollbar-track-thumb-hover-background)}.gx-ide-main::-webkit-scrollbar-corner{background:rgba(0, 0, 0, 0)}.gx-ide-overflow{overflow-y:auto;}.gx-ide-overflow::-webkit-scrollbar{width:var(--gxg-scrollbar-width);height:var(--gxg-scrollbar-width)}.gx-ide-overflow::-webkit-scrollbar-track{background-color:var(--gxg-scrollbar-track-background);border-radius:var(--gxg-scrollbar-track-border-radius)}.gx-ide-overflow::-webkit-scrollbar-thumb{background-color:var(--gxg-scrollbar-track-thumb-background);border-radius:var(--gxg-scrollbar-track-thumb-radius)}.gx-ide-overflow::-webkit-scrollbar-thumb:hover{background-color:var(--gxg-scrollbar-track-thumb-hover-background)}.gx-ide-overflow::-webkit-scrollbar-corner{background:rgba(0, 0, 0, 0)}.tree-container{display:flex;height:100%;width:100%;box-sizing:border-box}p{margin:0;font-size:var(--mer-font__size--xxs)}.control-wrapper{display:flex;gap:var(--mer-spacing--xs);align-items:center}.control-wrapper--vertical{flex-direction:column;align-items:start}.controls-wrapper{display:flex;gap:var(--mer-spacing--xs)}.controls-wrapper--vertical{flex-direction:column;align-items:start}.input-text{box-sizing:border-box;background-color:transparent;border:var(--mer-border__width--sm) solid var(--mer-border-color__dim);border-radius:var(--mer-border__width--lg);height:26px;color:var(--mer-text__bright);font-size:var(--mer-font__size--xxs)}.input-text--full-width{align-self:stretch}:host{display:block}.main{display:grid;grid-template-rows:1fr auto;height:100%;gap:var(--gx-ide-form-items-gap)}.path-list{width:100%;height:100%}gx-ide-list-selector::part(list){height:100%}.hidden-input{display:none}.checkbox-container{display:flex;gap:0.5rem}.footer{display:flex;flex-direction:column;gap:var(--gx-ide-form-items-gap)}";
32
+
33
+ const GxIdeTemplate = /*@__PURE__*/ proxyCustomElement(class GxIdeTemplate extends HTMLElement {
34
+ constructor() {
35
+ super();
36
+ this.__registerHost();
37
+ this.__attachShadow();
38
+ this.componentDidRenderFirstTime = createEvent(this, "componentDidRenderFirstTime", 7);
39
+ this.selectionChanged = createEvent(this, "selectionChanged", 7);
40
+ this.renderedFirstTime = false;
41
+ // 7.LISTENERS //
42
+ // 8.PUBLIC METHODS API //
43
+ // 9.LOCAL METHODS //
44
+ this.fileSelectionChangedHandler = (selectedItem) => {
45
+ this.selectionChanged.emit();
46
+ const selectedFiles = Array.isArray(selectedItem.detail)
47
+ ? selectedItem.detail
48
+ : [selectedItem.detail];
49
+ this.selectedFiles = selectedFiles.map(item => item.itemValue);
50
+ };
51
+ this.loadFileHandle = async () => {
52
+ this.fileInput.click();
53
+ };
54
+ this.handleFileInputChange = (event) => {
55
+ const fileInput = event.target;
56
+ if (fileInput.files && fileInput.files.length > 0) {
57
+ const newFiles = Array.from(fileInput.files);
58
+ const uniqueFiles = newFiles.filter(newFile => !this.files.some(existingFile => existingFile.name === newFile.name));
59
+ this.files = [...this.files, ...uniqueFiles];
60
+ }
61
+ this.fileInput.value = null;
62
+ };
63
+ this.confirmCallbackHandle = async () => {
64
+ if (this.confirmCallback && this.files.length > 0) {
65
+ const data = {
66
+ automaticBackup: this.automaticBackupEl.checked,
67
+ files: this.files
68
+ };
69
+ await this.confirmCallback(data);
70
+ }
71
+ };
72
+ this.removeFiles = (filesToRemove) => {
73
+ this.files = this.files.filter(file => !filesToRemove.includes(file.name));
74
+ this.selectedFiles = [];
75
+ this.fileInput.value = null;
76
+ };
77
+ this.handleRemoveButtonClick = () => {
78
+ this.removeFiles(this.selectedFiles);
79
+ };
80
+ this.files = [];
81
+ this.selectedFiles = [];
82
+ this.displayTitle = false;
83
+ this.allowedExtensions = undefined;
84
+ this.confirmCallback = undefined;
85
+ this.cancelCallback = undefined;
86
+ }
87
+ // 6.COMPONENT LIFECYCLE METHODS //
88
+ async componentWillLoad() {
89
+ this._componentLocale = await Locale.getComponentStrings(this.el);
90
+ }
91
+ componentDidRender() {
92
+ if (!this.renderedFirstTime) {
93
+ this.componentDidRenderFirstTime.emit(this._componentLocale.componentName);
94
+ this.renderedFirstTime = true;
95
+ }
96
+ }
97
+ // 10.RENDER() FUNCTION //
98
+ render() {
99
+ var _a;
100
+ 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: "main" }, h("div", { class: "controls-wrapper controls-wrapper--vertical" }, h("label", { htmlFor: "path-list" }, this._componentLocale.main.listLabel), h("gx-ide-list-selector", { id: "path-list", type: "multi-selection", listName: "path-list", ordered: true, onSelectionChanged: this.fileSelectionChangedHandler, class: "path-list" }, renderListItems(filesToListItemsData(this.files)))), h("div", { class: "footer" }, h("div", { class: "checkbox-container" }, h("ch-checkbox", { id: "automatic-backup", accessibleName: this._componentLocale.main.automaticBackupLabel, checkedValue: "true", unCheckedValue: "false", value: "checked", ref: el => (this.automaticBackupEl = el) }), h("label", { htmlFor: "automatic-backup" }, this._componentLocale.main.automaticBackupLabel)), h("div", { class: "controls-wrapper" }, h("input", { type: "file", id: "input_file", accept: (_a = this.allowedExtensions) === null || _a === void 0 ? void 0 : _a.join(", "), ref: el => (this.fileInput = el), onChange: this.handleFileInputChange, class: "hidden-input", multiple: true }), h("button", { onClick: this.loadFileHandle }, this._componentLocale.main.addFilesButton), h("button", { onClick: this.handleRemoveButtonClick, disabled: this.selectedFiles.length === 0 }, this._componentLocale.main.removeFilesButton, " (", this.selectedFiles.length, ")")))), h("button", { slot: "footer-end", onClick: this.confirmCallbackHandle }, this._componentLocale.footer.confirmButton), h("button", { slot: "footer-end", onClick: this.cancelCallback }, this._componentLocale.footer.cancelButton)))));
101
+ }
102
+ static get assetsDirs() { return ["gx-ide-assets/bpm-import-files"]; }
103
+ get el() { return this; }
104
+ static get style() { return importFilesCss; }
105
+ }, [1, "gx-ide-bpm-import-files", {
106
+ "displayTitle": [4, "display-title"],
107
+ "allowedExtensions": [16],
108
+ "confirmCallback": [16],
109
+ "cancelCallback": [16],
110
+ "files": [32],
111
+ "selectedFiles": [32]
112
+ }]);
113
+ function defineCustomElement$1() {
114
+ if (typeof customElements === "undefined") {
115
+ return;
116
+ }
117
+ const components = ["gx-ide-bpm-import-files", "ch-checkbox", "ch-icon", "gx-ide-container", "gx-ide-list-selector", "gx-ide-list-selector-item", "gx-ide-title", "gxg-icon", "gxg-title"];
118
+ components.forEach(tagName => { switch (tagName) {
119
+ case "gx-ide-bpm-import-files":
120
+ if (!customElements.get(tagName)) {
121
+ customElements.define(tagName, GxIdeTemplate);
122
+ }
123
+ break;
124
+ case "ch-checkbox":
125
+ if (!customElements.get(tagName)) {
126
+ defineCustomElement$9();
127
+ }
128
+ break;
129
+ case "ch-icon":
130
+ if (!customElements.get(tagName)) {
131
+ defineCustomElement$8();
132
+ }
133
+ break;
134
+ case "gx-ide-container":
135
+ if (!customElements.get(tagName)) {
136
+ defineCustomElement$7();
137
+ }
138
+ break;
139
+ case "gx-ide-list-selector":
140
+ if (!customElements.get(tagName)) {
141
+ defineCustomElement$6();
142
+ }
143
+ break;
144
+ case "gx-ide-list-selector-item":
145
+ if (!customElements.get(tagName)) {
146
+ defineCustomElement$5();
147
+ }
148
+ break;
149
+ case "gx-ide-title":
150
+ if (!customElements.get(tagName)) {
151
+ defineCustomElement$4();
152
+ }
153
+ break;
154
+ case "gxg-icon":
155
+ if (!customElements.get(tagName)) {
156
+ defineCustomElement$3();
157
+ }
158
+ break;
159
+ case "gxg-title":
160
+ if (!customElements.get(tagName)) {
161
+ defineCustomElement$2();
162
+ }
163
+ break;
164
+ } });
165
+ }
166
+
167
+ const GxIdeBpmImportFiles = GxIdeTemplate;
168
+ const defineCustomElement = defineCustomElement$1;
169
+
170
+ export { GxIdeBpmImportFiles, defineCustomElement };
171
+
172
+ //# sourceMappingURL=gx-ide-bpm-import-files.js.map
@@ -0,0 +1 @@
1
+ {"file":"gx-ide-bpm-import-files.js","mappings":";;;;;;;;;;;;;AAEO,MAAM,oBAAoB,GAAG,CAAC,KAAwB;IAC3D,MAAM,SAAS,GAAe,EAAE,CAAC;IACjC,KAAK,CAAC,OAAO,CAAC,IAAI;QAChB,MAAM,MAAM,GAAG,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAC3D,MAAM,SAAS,GAAG,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAC9D,MAAM,QAAQ,GAAW,SAAS,CAAC;QACnC,MAAM,WAAW,GAAY,KAAK,CAAC;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ACpB,QAAQ,SACR,EACF,cAAQ,OAAO,EAAE,IAAI,CAAC,cAAc,IACjC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,CACnC,EACT,cACE,OAAO,EAAE,IAAI,CAAC,uBAAuB,EACrC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,IAExC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,QAC5C,IAAI,CAAC,aAAa,CAAC,MAAM,MACnB,CACL,CACF,CACF,EAEN,cAAQ,IAAI,EAAC,YAAY,EAAC,OAAO,EAAE,IAAI,CAAC,qBAAqB,IAC1D,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,aAAa,CACpC,EACT,cAAQ,IAAI,EAAC,YAAY,EAAC,OAAO,EAAE,IAAI,CAAC,cAAc,IACnD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,YAAY,CACnC,CACQ,CACf,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/bpm/import-files/helpers.ts","src/components/bpm/import-files/import-files.scss?tag=gx-ide-bpm-import-files&encapsulation=shadow","src/components/bpm/import-files/import-files.tsx"],"sourcesContent":["import { ItemData } from \"../../_helpers/list-selector/list-selector-item/list-selector-item\";\n\nexport const filesToListItemsData = (files: string[] | File[]): ItemData[] => {\n const itemsData: ItemData[] = [];\n files.forEach(file => {\n const itemId = typeof file === \"string\" ? file : file.name;\n const itemValue = typeof file === \"string\" ? file : file.name;\n const itemIcon: string = undefined;\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","@import \"../../../global/gx-ide-common.scss\";\n@import \"../../../global/gx-ide-mixins.scss\";\n@import \"../../../global/temporary-tokens-chameleon.scss\";\n\n:host {\n display: block;\n}\n\n.main {\n display: grid;\n grid-template-rows: 1fr auto;\n height: 100%;\n gap: var(--gx-ide-form-items-gap);\n}\n.path-list {\n width: 100%;\n height: 100%;\n}\ngx-ide-list-selector::part(list) {\n height: 100%;\n}\n.hidden-input {\n display: none;\n}\n.checkbox-container {\n display: flex;\n gap: 0.5rem;\n}\n.footer {\n display: flex;\n flex-direction: column;\n gap: var(--gx-ide-form-items-gap);\n}\n","/* 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 */\nimport { CheckedItemsInfo } from \"../../_helpers/list-selector/list-selector\";\n/* CUSTOM IMPORTS */\nimport { config } from \"../../../common/config\";\nimport { Locale } from \"../../../common/locale\";\nimport { renderListItems } from \"../../../common/render-list-item\";\nimport { filesToListItemsData } from \"./helpers\";\n\n@Component({\n tag: \"gx-ide-bpm-import-files\",\n styleUrl: \"import-files.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/bpm-import-files\"]\n})\nexport class GxIdeTemplate {\n // 1.OWN PROPERTIES //\n\n /**\n * The component hard-coded strings translations.\n */\n private _componentLocale: any;\n\n private renderedFirstTime = false;\n\n // 2. REFERENCE TO ELEMENTS //\n\n @Element() el: HTMLGxIdeBpmImportFilesElement;\n\n private fileInput: HTMLInputElement;\n private automaticBackupEl: HTMLChCheckboxElement;\n\n // 3.STATE() VARIABLES //\n /**\n * Contains the list of files\n */\n @State() files: File[] = [];\n\n /**\n * Contains the list of selected files\n */\n @State() selectedFiles: 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 /**\n * Allowed extensions when 'Add files' button is pressed\n */\n @Prop() readonly allowedExtensions: string[];\n\n /**\n * Callback invoked when user press 'OK' button\n */\n @Prop() readonly confirmCallback: (data: ImportData) => Promise<boolean>;\n\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 /**\n * @description Gets fired when something changes on items section.\n */\n @Event() selectionChanged: EventEmitter<void>;\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 fileSelectionChangedHandler = (\n selectedItem: CustomEvent<CheckedItemsInfo>\n ) => {\n this.selectionChanged.emit();\n\n const selectedFiles = Array.isArray(selectedItem.detail)\n ? selectedItem.detail\n : [selectedItem.detail];\n\n this.selectedFiles = selectedFiles.map(item => item.itemValue);\n };\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 newFiles: File[] = Array.from(fileInput.files);\n const uniqueFiles = newFiles.filter(\n newFile =>\n !this.files.some(existingFile => existingFile.name === newFile.name)\n );\n this.files = [...this.files, ...uniqueFiles];\n }\n\n this.fileInput.value = null;\n };\n\n private confirmCallbackHandle = async () => {\n if (this.confirmCallback && this.files.length > 0) {\n const data: ImportData = {\n automaticBackup: this.automaticBackupEl.checked,\n files: this.files\n };\n\n await this.confirmCallback(data);\n }\n };\n\n private removeFiles = (filesToRemove: string[]) => {\n this.files = this.files.filter(file => !filesToRemove.includes(file.name));\n\n this.selectedFiles = [];\n this.fileInput.value = null;\n };\n\n private handleRemoveButtonClick = () => {\n this.removeFiles(this.selectedFiles);\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=\"main\">\n {/* path list*/}\n <div class=\"controls-wrapper controls-wrapper--vertical\">\n <label htmlFor=\"path-list\">\n {this._componentLocale.main.listLabel}\n </label>\n <gx-ide-list-selector\n id=\"path-list\"\n type=\"multi-selection\"\n listName=\"path-list\"\n ordered\n onSelectionChanged={this.fileSelectionChangedHandler}\n class=\"path-list\"\n >\n {renderListItems(filesToListItemsData(this.files))}\n </gx-ide-list-selector>\n </div>\n\n <div class=\"footer\">\n <div class=\"checkbox-container\">\n <ch-checkbox\n id=\"automatic-backup\"\n accessibleName={\n this._componentLocale.main.automaticBackupLabel\n }\n checkedValue=\"true\"\n unCheckedValue=\"false\"\n value=\"checked\"\n ref={el =>\n (this.automaticBackupEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n <label htmlFor=\"automatic-backup\">\n {this._componentLocale.main.automaticBackupLabel}\n </label>\n </div>\n <div class=\"controls-wrapper\">\n <input\n type=\"file\"\n id=\"input_file\"\n accept={this.allowedExtensions?.join(\", \")}\n ref={el => (this.fileInput = el as HTMLInputElement)}\n onChange={this.handleFileInputChange}\n class=\"hidden-input\"\n multiple\n />\n <button onClick={this.loadFileHandle}>\n {this._componentLocale.main.addFilesButton}\n </button>\n <button\n onClick={this.handleRemoveButtonClick}\n disabled={this.selectedFiles.length === 0}\n >\n {this._componentLocale.main.removeFilesButton} (\n {this.selectedFiles.length})\n </button>\n </div>\n </div>\n </div>\n\n <button slot=\"footer-end\" onClick={this.confirmCallbackHandle}>\n {this._componentLocale.footer.confirmButton}\n </button>\n <button slot=\"footer-end\" onClick={this.cancelCallback}>\n {this._componentLocale.footer.cancelButton}\n </button>\n </gx-ide-container>\n </div>\n </Host>\n );\n }\n}\n\nexport type ImportData = {\n files: File[];\n automaticBackup: boolean;\n};\n"],"version":3}