@genexus/genexus-ide-ui 0.0.138 → 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 (61) 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/gx-ide-bpm-import-gxpm.cjs.entry.js +43 -0
  5. package/dist/cjs/gx-ide-bpm-import-gxpm.cjs.entry.js.map +1 -0
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/collection-manifest.json +4 -3
  8. package/dist/collection/components/bpm/import-files/gx-ide-assets/bpm-import-files/langs/bpm-import-files.lang.en.json +18 -0
  9. package/dist/collection/components/bpm/import-files/helpers.js.map +1 -0
  10. package/dist/collection/components/bpm/import-files/import-files.css +586 -0
  11. package/dist/collection/components/bpm/{files-selector/files-selector.js → import-files/import-files.js} +32 -33
  12. package/dist/collection/components/bpm/import-files/import-files.js.map +1 -0
  13. package/dist/collection/components/bpm/import-gxpm/gx-ide-assets/bpm-import-gxpm/langs/bpm-import-gxpm.lang.en.json +10 -0
  14. package/dist/collection/components/bpm/{files-selector/files-selector.css → import-gxpm/import-gxpm.css} +5 -2
  15. package/dist/collection/components/bpm/import-gxpm/import-gxpm.js +88 -0
  16. package/dist/collection/components/bpm/import-gxpm/import-gxpm.js.map +1 -0
  17. package/dist/components/gx-ide-bpm-import-files.d.ts +11 -0
  18. package/dist/components/gx-ide-bpm-import-files.js +172 -0
  19. package/dist/components/gx-ide-bpm-import-files.js.map +1 -0
  20. package/dist/components/gx-ide-bpm-import-gxpm.d.ts +11 -0
  21. package/dist/components/gx-ide-bpm-import-gxpm.js +101 -0
  22. package/dist/components/gx-ide-bpm-import-gxpm.js.map +1 -0
  23. package/dist/esm/genexus-ide-ui.js +1 -1
  24. package/dist/esm/gx-ide-bpm-import-files.entry.js +99 -0
  25. package/dist/esm/gx-ide-bpm-import-files.entry.js.map +1 -0
  26. package/dist/esm/gx-ide-bpm-import-gxpm.entry.js +39 -0
  27. package/dist/esm/gx-ide-bpm-import-gxpm.entry.js.map +1 -0
  28. package/dist/esm/loader.js +1 -1
  29. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  30. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
  31. package/dist/genexus-ide-ui/gx-ide-assets/bpm-import-files/langs/bpm-import-files.lang.en.json +18 -0
  32. package/dist/genexus-ide-ui/gx-ide-assets/bpm-import-files/langs/bpm-import-files.lang.ja.json +3 -0
  33. package/dist/genexus-ide-ui/gx-ide-assets/bpm-import-files/langs/bpm-import-files.lang.zh.json +3 -0
  34. package/dist/genexus-ide-ui/gx-ide-assets/bpm-import-gxpm/langs/bpm-import-gxpm.lang.en.json +10 -0
  35. package/dist/genexus-ide-ui/gx-ide-assets/bpm-import-gxpm/langs/bpm-import-gxpm.lang.ja.json +3 -0
  36. package/dist/genexus-ide-ui/gx-ide-assets/bpm-import-gxpm/langs/bpm-import-gxpm.lang.zh.json +3 -0
  37. package/dist/genexus-ide-ui/{p-82291acd.entry.js → p-03b2a741.entry.js} +43 -19
  38. package/dist/genexus-ide-ui/p-03b2a741.entry.js.map +1 -0
  39. package/dist/genexus-ide-ui/p-049a370c.entry.js +78 -0
  40. package/dist/genexus-ide-ui/p-049a370c.entry.js.map +1 -0
  41. package/dist/types/components/bpm/import-files/import-files.d.ts +56 -0
  42. package/dist/types/components.d.ts +70 -28
  43. package/package.json +1 -1
  44. package/dist/cjs/gx-ide-bpm-files-selector.cjs.entry.js +0 -101
  45. package/dist/cjs/gx-ide-bpm-files-selector.cjs.entry.js.map +0 -1
  46. package/dist/collection/components/bpm/files-selector/files-selector.js.map +0 -1
  47. package/dist/collection/components/bpm/files-selector/gx-ide-assets/bpm-files-selector/langs/bpm-files-selector.lang.en.json +0 -14
  48. package/dist/collection/components/bpm/files-selector/helpers.js.map +0 -1
  49. package/dist/components/gx-ide-bpm-files-selector.d.ts +0 -11
  50. package/dist/components/gx-ide-bpm-files-selector.js +0 -164
  51. package/dist/components/gx-ide-bpm-files-selector.js.map +0 -1
  52. package/dist/esm/gx-ide-bpm-files-selector.entry.js +0 -97
  53. package/dist/esm/gx-ide-bpm-files-selector.entry.js.map +0 -1
  54. package/dist/genexus-ide-ui/gx-ide-assets/bpm-files-selector/langs/bpm-files-selector.lang.en.json +0 -14
  55. package/dist/genexus-ide-ui/p-82291acd.entry.js.map +0 -1
  56. /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
  57. /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
  58. /package/dist/collection/components/bpm/{files-selector → import-files}/helpers.js +0 -0
  59. /package/dist/{genexus-ide-ui/gx-ide-assets/bpm-files-selector/langs/bpm-files-selector.lang.ja.json → collection/components/bpm/import-gxpm/gx-ide-assets/bpm-import-gxpm/langs/bpm-import-gxpm.lang.ja.json} +0 -0
  60. /package/dist/{genexus-ide-ui/gx-ide-assets/bpm-files-selector/langs/bpm-files-selector.lang.zh.json → collection/components/bpm/import-gxpm/gx-ide-assets/bpm-import-gxpm/langs/bpm-import-gxpm.lang.zh.json} +0 -0
  61. /package/dist/types/components/bpm/{files-selector → import-files}/helpers.d.ts +0 -0
@@ -1,101 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-5ab4492a.js');
6
- const config = require('./config-8246d533.js');
7
- const locale = require('./locale-bf43b87c.js');
8
- const renderListItem = require('./render-list-item-c7e24eb8.js');
9
-
10
- const filesToListItemsData = (files) => {
11
- const itemsData = [];
12
- files.forEach(file => {
13
- const itemId = typeof file === "string" ? file : file.name;
14
- const itemValue = typeof file === "string" ? file : file.name;
15
- const itemIcon = undefined;
16
- const itemChecked = false;
17
- itemsData.push({
18
- itemId: itemId,
19
- itemValue: itemValue,
20
- itemIcon: itemIcon,
21
- itemChecked: itemChecked
22
- });
23
- });
24
- return itemsData;
25
- };
26
-
27
- const filesSelectorCss = ":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}.hidden-input{display:none}";
28
-
29
- const GxIdeTemplate = class {
30
- constructor(hostRef) {
31
- index.registerInstance(this, hostRef);
32
- this.componentDidRenderFirstTime = index.createEvent(this, "componentDidRenderFirstTime", 7);
33
- this.selectionChanged = index.createEvent(this, "selectionChanged", 7);
34
- this.renderedFirstTime = false;
35
- // 7.LISTENERS //
36
- // 8.PUBLIC METHODS API //
37
- // 9.LOCAL METHODS //
38
- this.fileSelectionChangedHandler = (selectedItem) => {
39
- this.selectionChanged.emit();
40
- const selectedFiles = Array.isArray(selectedItem.detail)
41
- ? selectedItem.detail
42
- : [selectedItem.detail];
43
- this.selectedFiles = selectedFiles.map(item => item.itemValue);
44
- };
45
- this.loadFileHandle = async () => {
46
- this.fileInput.click();
47
- };
48
- this.handleFileInputChange = async (event) => {
49
- const fileInput = event.target;
50
- if (fileInput.files && fileInput.files.length > 0) {
51
- const newFiles = Array.from(fileInput.files);
52
- const uniqueFiles = newFiles.filter(newFile => !this.files.some(existingFile => existingFile.name === newFile.name));
53
- this.files = [...this.files, ...uniqueFiles];
54
- }
55
- if (this.addCallback) {
56
- await this.addCallback(this.files);
57
- }
58
- this.fileInput.value = null;
59
- };
60
- this.removeFiles = (filesToRemove) => {
61
- const removedFiles = this.files.filter(file => filesToRemove.includes(file.name));
62
- this.files = this.files.filter(file => !filesToRemove.includes(file.name));
63
- if (this.removeCallback) {
64
- this.removeCallback(removedFiles);
65
- this.selectedFiles = [];
66
- this.fileInput.value = null;
67
- }
68
- };
69
- this.handleRemoveButtonClick = () => {
70
- this.removeFiles(this.selectedFiles);
71
- };
72
- this.files = [];
73
- this.selectedFiles = [];
74
- this.displayTitle = false;
75
- this.allowedExtensions = undefined;
76
- this.addCallback = undefined;
77
- this.removeCallback = undefined;
78
- }
79
- // 6.COMPONENT LIFECYCLE METHODS //
80
- async componentWillLoad() {
81
- this._componentLocale = await locale.Locale.getComponentStrings(this.el);
82
- }
83
- componentDidRender() {
84
- if (!this.renderedFirstTime) {
85
- this.componentDidRenderFirstTime.emit(this._componentLocale.componentName);
86
- this.renderedFirstTime = true;
87
- }
88
- }
89
- // 10.RENDER() FUNCTION //
90
- render() {
91
- var _a;
92
- return (index.h(index.Host, { class: "gx-ide-component" }, index.h("div", { class: "gx-ide-main-wrapper" }, index.h("gx-ide-container", { containerTitle: this.displayTitle ? this._componentLocale.componentName : null, slimmerFooter: config.config.gxIdeContainer.slimmerFooter }, index.h("label", { htmlFor: "path-list" }, this._componentLocale.main.listLabel), index.h("gx-ide-list-selector", { id: "path-list", type: "multi-selection", listName: "path-list", noListBorder: true, ordered: true, onSelectionChanged: this.fileSelectionChangedHandler, class: "path-list" }, renderListItem.renderListItems(filesToListItemsData(this.files))), index.h("div", { class: "controls-wrapper" }, index.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 }), index.h("button", { onClick: this.loadFileHandle }, this._componentLocale.main.addFilesButton), index.h("button", { onClick: this.handleRemoveButtonClick, disabled: this.selectedFiles.length === 0 }, this._componentLocale.main.removeFilesButton, " (", this.selectedFiles.length, ")"))))));
93
- }
94
- static get assetsDirs() { return ["gx-ide-assets/bpm-files-selector"]; }
95
- get el() { return index.getElement(this); }
96
- };
97
- GxIdeTemplate.style = filesSelectorCss;
98
-
99
- exports.gx_ide_bpm_files_selector = GxIdeTemplate;
100
-
101
- //# sourceMappingURL=gx-ide-bpm-files-selector.cjs.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"gx-ide-bpm-files-selector.entry.cjs.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;QACnC,SAAS,CAAC,IAAI,CAAC;YACb,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,SAAS;YACpB,QAAQ,EAAE,QAAQ;YAClB,WAAW,EAAE,WAAW;SACzB,CAAC,CAAC;KACJ,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC;;ACjBD,MAAM,gBAAgB,GAAG,q/WAAq/W;;MCyBjgX,aAAa;;;;;QAQhB,sBAAiB,GAAG,KAAK,CAAC;;;;QA0E1B,gCAA2B,GAAG,CACpC,YAA2C;YAE3C,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;YAE7B,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC;kBACpD,YAAY,CAAC,MAAM;kBACnB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YAE1B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,I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AAE,EAAC,YAAY,EACf,MAAM,EAAE,MAAA,IAAI,CAAC,iBAAiB,0CAAE,IAAI,CAAC,IAAI,CAAC,EAC1C,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,SAAS,GAAG,EAAsB,CAAC,EACpD,QAAQ,EAAE,IAAI,CAAC,qBAAqB,EACpC,KAAK,EAAC,cAAc,EACpB,QAAQ,SACR,EACFA,oBAAQ,OAAO,EAAE,IAAI,CAAC,cAAc,IACjC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,CACnC,EACTA,oBACE,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,CACW,CACf,CACD,EACP;KACH;;;;;;;;","names":["Locale","h","Host","config","renderListItems"],"sources":["src/components/bpm/files-selector/helpers.ts","src/components/bpm/files-selector/files-selector.scss?tag=gx-ide-bpm-files-selector&encapsulation=shadow","src/components/bpm/files-selector/files-selector.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.hidden-input {\n display: none;\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-files-selector\",\n styleUrl: \"files-selector.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/bpm-files-selector\"]\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: HTMLGxIdeBpmFilesSelectorElement;\n\n private fileInput: HTMLInputElement;\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 'Add files' button. Returns a list with selected files.\n */\n @Prop() readonly addCallback: (files: File[]) => Promise<void>;\n\n /**\n * Callback invoked when remove button is pressed.\n */\n @Prop() readonly removeCallback: (files: File[] | string[]) => 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 = async (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 if (this.addCallback) {\n await this.addCallback(this.files);\n }\n\n this.fileInput.value = null;\n };\n\n private removeFiles = (filesToRemove: string[]) => {\n const removedFiles = this.files.filter(file =>\n filesToRemove.includes(file.name)\n );\n\n this.files = this.files.filter(file => !filesToRemove.includes(file.name));\n\n if (this.removeCallback) {\n this.removeCallback(removedFiles);\n this.selectedFiles = [];\n this.fileInput.value = null;\n }\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 {/* path list*/}\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 noListBorder\n ordered\n onSelectionChanged={this.fileSelectionChangedHandler}\n class=\"path-list\"\n >\n {renderListItems(filesToListItemsData(this.files))}\n </gx-ide-list-selector>\n\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 </gx-ide-container>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"version":3,"file":"files-selector.js","sourceRoot":"","sources":["../../../../src/components/bpm/files-selector/files-selector.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;QAoElC,iBAAiB;QAEjB,0BAA0B;QAE1B,qBAAqB;QAEb,gCAA2B,GAAG,CACpC,YAA2C,EAC3C,EAAE;YACF,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;YAE7B,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC;gBACtD,CAAC,CAAC,YAAY,CAAC,MAAM;gBACrB,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YAE1B,IAAI,C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BAAiB,EACtB,QAAQ,EAAC,WAAW,EACpB,YAAY,QACZ,OAAO,QACP,kBAAkB,EAAE,IAAI,CAAC,2BAA2B,EACpD,KAAK,EAAC,WAAW,IAEhB,eAAe,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAC7B;oBAEvB,WAAK,KAAK,EAAC,kBAAkB;wBAC3B,aACE,IAAI,EAAC,MAAM,EACX,EAAE,EAAC,YAAY,EACf,MAAM,EAAE,MAAA,IAAI,CAAC,iBAAiB,0CAAE,IAAI,CAAC,IAAI,CAAC,EAC1C,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,EAAsB,CAAC,EACpD,QAAQ,EAAE,IAAI,CAAC,qBAAqB,EACpC,KAAK,EAAC,cAAc,EACpB,QAAQ,SACR;wBACF,cAAQ,OAAO,EAAE,IAAI,CAAC,cAAc,IACjC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,CACnC;wBACT,cACE,OAAO,EAAE,IAAI,CAAC,uBAAuB,EACrC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC;4BAExC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,iBAAiB;;4BAC5C,IAAI,CAAC,aAAa,CAAC,MAAM;gCACnB,CACL,CACW,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-files-selector\",\n styleUrl: \"files-selector.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/bpm-files-selector\"]\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: HTMLGxIdeBpmFilesSelectorElement;\n\n private fileInput: HTMLInputElement;\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 'Add files' button. Returns a list with selected files.\n */\n @Prop() readonly addCallback: (files: File[]) => Promise<void>;\n\n /**\n * Callback invoked when remove button is pressed.\n */\n @Prop() readonly removeCallback: (files: File[] | string[]) => 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 = async (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 if (this.addCallback) {\n await this.addCallback(this.files);\n }\n\n this.fileInput.value = null;\n };\n\n private removeFiles = (filesToRemove: string[]) => {\n const removedFiles = this.files.filter(file =>\n filesToRemove.includes(file.name)\n );\n\n this.files = this.files.filter(file => !filesToRemove.includes(file.name));\n\n if (this.removeCallback) {\n this.removeCallback(removedFiles);\n this.selectedFiles = [];\n this.fileInput.value = null;\n }\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 {/* path list*/}\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 noListBorder\n ordered\n onSelectionChanged={this.fileSelectionChangedHandler}\n class=\"path-list\"\n >\n {renderListItems(filesToListItemsData(this.files))}\n </gx-ide-list-selector>\n\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 </gx-ide-container>\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -1,14 +0,0 @@
1
- {
2
- "componentName": "BPM Files Selector",
3
- "header": {},
4
- "main": {
5
- "listLabel": "Path List",
6
- "addFilesButton": "Add Files",
7
- "removeFilesButton": "Remove"
8
- },
9
- "footer": {},
10
- "loader": {
11
- "title": "Loading...",
12
- "cancelLabel": "Cancel"
13
- }
14
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/components/bpm/files-selector/helpers.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAwB,EAAc,EAAE;IAC3E,MAAM,SAAS,GAAe,EAAE,CAAC;IACjC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,MAAM,MAAM,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC3D,MAAM,SAAS,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9D,MAAM,QAAQ,GAAW,SAAS,CAAC;QACnC,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 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"]}
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../types/components";
2
-
3
- interface GxIdeBpmFilesSelector extends Components.GxIdeBpmFilesSelector, HTMLElement {}
4
- export const GxIdeBpmFilesSelector: {
5
- prototype: GxIdeBpmFilesSelector;
6
- new (): GxIdeBpmFilesSelector;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,164 +0,0 @@
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$8 } from './icon.js';
6
- import { d as defineCustomElement$7 } from './container.js';
7
- import { d as defineCustomElement$6 } from './list-selector.js';
8
- import { d as defineCustomElement$5 } from './list-selector-item.js';
9
- import { d as defineCustomElement$4 } from './title2.js';
10
- import { d as defineCustomElement$3 } from './icon2.js';
11
- import { d as defineCustomElement$2 } from './title.js';
12
-
13
- const filesToListItemsData = (files) => {
14
- const itemsData = [];
15
- files.forEach(file => {
16
- const itemId = typeof file === "string" ? file : file.name;
17
- const itemValue = typeof file === "string" ? file : file.name;
18
- const itemIcon = undefined;
19
- const itemChecked = false;
20
- itemsData.push({
21
- itemId: itemId,
22
- itemValue: itemValue,
23
- itemIcon: itemIcon,
24
- itemChecked: itemChecked
25
- });
26
- });
27
- return itemsData;
28
- };
29
-
30
- const filesSelectorCss = ":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}.hidden-input{display:none}";
31
-
32
- const GxIdeTemplate = /*@__PURE__*/ proxyCustomElement(class GxIdeTemplate extends HTMLElement {
33
- constructor() {
34
- super();
35
- this.__registerHost();
36
- this.__attachShadow();
37
- this.componentDidRenderFirstTime = createEvent(this, "componentDidRenderFirstTime", 7);
38
- this.selectionChanged = createEvent(this, "selectionChanged", 7);
39
- this.renderedFirstTime = false;
40
- // 7.LISTENERS //
41
- // 8.PUBLIC METHODS API //
42
- // 9.LOCAL METHODS //
43
- this.fileSelectionChangedHandler = (selectedItem) => {
44
- this.selectionChanged.emit();
45
- const selectedFiles = Array.isArray(selectedItem.detail)
46
- ? selectedItem.detail
47
- : [selectedItem.detail];
48
- this.selectedFiles = selectedFiles.map(item => item.itemValue);
49
- };
50
- this.loadFileHandle = async () => {
51
- this.fileInput.click();
52
- };
53
- this.handleFileInputChange = async (event) => {
54
- const fileInput = event.target;
55
- if (fileInput.files && fileInput.files.length > 0) {
56
- const newFiles = Array.from(fileInput.files);
57
- const uniqueFiles = newFiles.filter(newFile => !this.files.some(existingFile => existingFile.name === newFile.name));
58
- this.files = [...this.files, ...uniqueFiles];
59
- }
60
- if (this.addCallback) {
61
- await this.addCallback(this.files);
62
- }
63
- this.fileInput.value = null;
64
- };
65
- this.removeFiles = (filesToRemove) => {
66
- const removedFiles = this.files.filter(file => filesToRemove.includes(file.name));
67
- this.files = this.files.filter(file => !filesToRemove.includes(file.name));
68
- if (this.removeCallback) {
69
- this.removeCallback(removedFiles);
70
- this.selectedFiles = [];
71
- this.fileInput.value = null;
72
- }
73
- };
74
- this.handleRemoveButtonClick = () => {
75
- this.removeFiles(this.selectedFiles);
76
- };
77
- this.files = [];
78
- this.selectedFiles = [];
79
- this.displayTitle = false;
80
- this.allowedExtensions = undefined;
81
- this.addCallback = undefined;
82
- this.removeCallback = undefined;
83
- }
84
- // 6.COMPONENT LIFECYCLE METHODS //
85
- async componentWillLoad() {
86
- this._componentLocale = await Locale.getComponentStrings(this.el);
87
- }
88
- componentDidRender() {
89
- if (!this.renderedFirstTime) {
90
- this.componentDidRenderFirstTime.emit(this._componentLocale.componentName);
91
- this.renderedFirstTime = true;
92
- }
93
- }
94
- // 10.RENDER() FUNCTION //
95
- render() {
96
- var _a;
97
- 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, ")"))))));
98
- }
99
- static get assetsDirs() { return ["gx-ide-assets/bpm-files-selector"]; }
100
- get el() { return this; }
101
- static get style() { return filesSelectorCss; }
102
- }, [1, "gx-ide-bpm-files-selector", {
103
- "displayTitle": [4, "display-title"],
104
- "allowedExtensions": [16],
105
- "addCallback": [16],
106
- "removeCallback": [16],
107
- "files": [32],
108
- "selectedFiles": [32]
109
- }]);
110
- function defineCustomElement$1() {
111
- if (typeof customElements === "undefined") {
112
- return;
113
- }
114
- const components = ["gx-ide-bpm-files-selector", "ch-icon", "gx-ide-container", "gx-ide-list-selector", "gx-ide-list-selector-item", "gx-ide-title", "gxg-icon", "gxg-title"];
115
- components.forEach(tagName => { switch (tagName) {
116
- case "gx-ide-bpm-files-selector":
117
- if (!customElements.get(tagName)) {
118
- customElements.define(tagName, GxIdeTemplate);
119
- }
120
- break;
121
- case "ch-icon":
122
- if (!customElements.get(tagName)) {
123
- defineCustomElement$8();
124
- }
125
- break;
126
- case "gx-ide-container":
127
- if (!customElements.get(tagName)) {
128
- defineCustomElement$7();
129
- }
130
- break;
131
- case "gx-ide-list-selector":
132
- if (!customElements.get(tagName)) {
133
- defineCustomElement$6();
134
- }
135
- break;
136
- case "gx-ide-list-selector-item":
137
- if (!customElements.get(tagName)) {
138
- defineCustomElement$5();
139
- }
140
- break;
141
- case "gx-ide-title":
142
- if (!customElements.get(tagName)) {
143
- defineCustomElement$4();
144
- }
145
- break;
146
- case "gxg-icon":
147
- if (!customElements.get(tagName)) {
148
- defineCustomElement$3();
149
- }
150
- break;
151
- case "gxg-title":
152
- if (!customElements.get(tagName)) {
153
- defineCustomElement$2();
154
- }
155
- break;
156
- } });
157
- }
158
-
159
- const GxIdeBpmFilesSelector = GxIdeTemplate;
160
- const defineCustomElement = defineCustomElement$1;
161
-
162
- export { GxIdeBpmFilesSelector, defineCustomElement };
163
-
164
- //# sourceMappingURL=gx-ide-bpm-files-selector.js.map
@@ -1 +0,0 @@
1
- {"file":"gx-ide-bpm-files-selector.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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aAAa,CAAC,MAAM,MACnB,CACL,CACW,CACf,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/bpm/files-selector/helpers.ts","src/components/bpm/files-selector/files-selector.scss?tag=gx-ide-bpm-files-selector&encapsulation=shadow","src/components/bpm/files-selector/files-selector.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.hidden-input {\n display: none;\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-files-selector\",\n styleUrl: \"files-selector.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/bpm-files-selector\"]\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: HTMLGxIdeBpmFilesSelectorElement;\n\n private fileInput: HTMLInputElement;\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 'Add files' button. Returns a list with selected files.\n */\n @Prop() readonly addCallback: (files: File[]) => Promise<void>;\n\n /**\n * Callback invoked when remove button is pressed.\n */\n @Prop() readonly removeCallback: (files: File[] | string[]) => 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 = async (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 if (this.addCallback) {\n await this.addCallback(this.files);\n }\n\n this.fileInput.value = null;\n };\n\n private removeFiles = (filesToRemove: string[]) => {\n const removedFiles = this.files.filter(file =>\n filesToRemove.includes(file.name)\n );\n\n this.files = this.files.filter(file => !filesToRemove.includes(file.name));\n\n if (this.removeCallback) {\n this.removeCallback(removedFiles);\n this.selectedFiles = [];\n this.fileInput.value = null;\n }\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 {/* path list*/}\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 noListBorder\n ordered\n onSelectionChanged={this.fileSelectionChangedHandler}\n class=\"path-list\"\n >\n {renderListItems(filesToListItemsData(this.files))}\n </gx-ide-list-selector>\n\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 </gx-ide-container>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,97 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-5bd24426.js';
2
- import { c as config } from './config-a492e15e.js';
3
- import { L as Locale } from './locale-3c32f251.js';
4
- import { r as renderListItems } from './render-list-item-9953ed8a.js';
5
-
6
- const filesToListItemsData = (files) => {
7
- const itemsData = [];
8
- files.forEach(file => {
9
- const itemId = typeof file === "string" ? file : file.name;
10
- const itemValue = typeof file === "string" ? file : file.name;
11
- const itemIcon = undefined;
12
- const itemChecked = false;
13
- itemsData.push({
14
- itemId: itemId,
15
- itemValue: itemValue,
16
- itemIcon: itemIcon,
17
- itemChecked: itemChecked
18
- });
19
- });
20
- return itemsData;
21
- };
22
-
23
- const filesSelectorCss = ":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}.hidden-input{display:none}";
24
-
25
- const GxIdeTemplate = class {
26
- constructor(hostRef) {
27
- registerInstance(this, hostRef);
28
- this.componentDidRenderFirstTime = createEvent(this, "componentDidRenderFirstTime", 7);
29
- this.selectionChanged = createEvent(this, "selectionChanged", 7);
30
- this.renderedFirstTime = false;
31
- // 7.LISTENERS //
32
- // 8.PUBLIC METHODS API //
33
- // 9.LOCAL METHODS //
34
- this.fileSelectionChangedHandler = (selectedItem) => {
35
- this.selectionChanged.emit();
36
- const selectedFiles = Array.isArray(selectedItem.detail)
37
- ? selectedItem.detail
38
- : [selectedItem.detail];
39
- this.selectedFiles = selectedFiles.map(item => item.itemValue);
40
- };
41
- this.loadFileHandle = async () => {
42
- this.fileInput.click();
43
- };
44
- this.handleFileInputChange = async (event) => {
45
- const fileInput = event.target;
46
- if (fileInput.files && fileInput.files.length > 0) {
47
- const newFiles = Array.from(fileInput.files);
48
- const uniqueFiles = newFiles.filter(newFile => !this.files.some(existingFile => existingFile.name === newFile.name));
49
- this.files = [...this.files, ...uniqueFiles];
50
- }
51
- if (this.addCallback) {
52
- await this.addCallback(this.files);
53
- }
54
- this.fileInput.value = null;
55
- };
56
- this.removeFiles = (filesToRemove) => {
57
- const removedFiles = this.files.filter(file => filesToRemove.includes(file.name));
58
- this.files = this.files.filter(file => !filesToRemove.includes(file.name));
59
- if (this.removeCallback) {
60
- this.removeCallback(removedFiles);
61
- this.selectedFiles = [];
62
- this.fileInput.value = null;
63
- }
64
- };
65
- this.handleRemoveButtonClick = () => {
66
- this.removeFiles(this.selectedFiles);
67
- };
68
- this.files = [];
69
- this.selectedFiles = [];
70
- this.displayTitle = false;
71
- this.allowedExtensions = undefined;
72
- this.addCallback = undefined;
73
- this.removeCallback = undefined;
74
- }
75
- // 6.COMPONENT LIFECYCLE METHODS //
76
- async componentWillLoad() {
77
- this._componentLocale = await Locale.getComponentStrings(this.el);
78
- }
79
- componentDidRender() {
80
- if (!this.renderedFirstTime) {
81
- this.componentDidRenderFirstTime.emit(this._componentLocale.componentName);
82
- this.renderedFirstTime = true;
83
- }
84
- }
85
- // 10.RENDER() FUNCTION //
86
- render() {
87
- var _a;
88
- 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, ")"))))));
89
- }
90
- static get assetsDirs() { return ["gx-ide-assets/bpm-files-selector"]; }
91
- get el() { return getElement(this); }
92
- };
93
- GxIdeTemplate.style = filesSelectorCss;
94
-
95
- export { GxIdeTemplate as gx_ide_bpm_files_selector };
96
-
97
- //# sourceMappingURL=gx-ide-bpm-files-selector.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"gx-ide-bpm-files-selector.entry.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;QACnC,SAAS,CAAC,IAAI,CAAC;YACb,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,SAAS;YACpB,QAAQ,EAAE,QAAQ;YAClB,WAAW,EAAE,WAAW;SACzB,CAAC,CAAC;KACJ,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC;;ACjBD,MAAM,gBAAgB,GAAG,q/WAAq/W;;MCyBjgX,aAAa;;;;;QAQhB,sBAAiB,GAAG,KAAK,CAAC;;;;QA0E1B,gCAA2B,GAAG,CACpC,YAA2C;YAE3C,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;YAE7B,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC;kBACpD,YAAY,CAAC,MAAM;kBACnB,CAAC,YAAY,CAAC,MAAM,C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AAK,EAAC,kBAAkB,IAC3B,aACE,IAAI,EAAC,MAAM,EACX,EAAE,EAAC,YAAY,EACf,MAAM,EAAE,MAAA,IAAI,CAAC,iBAAiB,0CAAE,IAAI,CAAC,IAAI,CAAC,EAC1C,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,SAAS,GAAG,EAAsB,CAAC,EACpD,QAAQ,EAAE,IAAI,CAAC,qBAAqB,EACpC,KAAK,EAAC,cAAc,EACpB,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,CACW,CACf,CACD,EACP;KACH;;;;;;;;","names":[],"sources":["src/components/bpm/files-selector/helpers.ts","src/components/bpm/files-selector/files-selector.scss?tag=gx-ide-bpm-files-selector&encapsulation=shadow","src/components/bpm/files-selector/files-selector.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.hidden-input {\n display: none;\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-files-selector\",\n styleUrl: \"files-selector.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/bpm-files-selector\"]\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: HTMLGxIdeBpmFilesSelectorElement;\n\n private fileInput: HTMLInputElement;\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 'Add files' button. Returns a list with selected files.\n */\n @Prop() readonly addCallback: (files: File[]) => Promise<void>;\n\n /**\n * Callback invoked when remove button is pressed.\n */\n @Prop() readonly removeCallback: (files: File[] | string[]) => 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 = async (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 if (this.addCallback) {\n await this.addCallback(this.files);\n }\n\n this.fileInput.value = null;\n };\n\n private removeFiles = (filesToRemove: string[]) => {\n const removedFiles = this.files.filter(file =>\n filesToRemove.includes(file.name)\n );\n\n this.files = this.files.filter(file => !filesToRemove.includes(file.name));\n\n if (this.removeCallback) {\n this.removeCallback(removedFiles);\n this.selectedFiles = [];\n this.fileInput.value = null;\n }\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 {/* path list*/}\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 noListBorder\n ordered\n onSelectionChanged={this.fileSelectionChangedHandler}\n class=\"path-list\"\n >\n {renderListItems(filesToListItemsData(this.files))}\n </gx-ide-list-selector>\n\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 </gx-ide-container>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,14 +0,0 @@
1
- {
2
- "componentName": "BPM Files Selector",
3
- "header": {},
4
- "main": {
5
- "listLabel": "Path List",
6
- "addFilesButton": "Add Files",
7
- "removeFilesButton": "Remove"
8
- },
9
- "footer": {},
10
- "loader": {
11
- "title": "Loading...",
12
- "cancelLabel": "Cancel"
13
- }
14
- }