@genexus/genexus-ide-ui 1.1.2 → 1.1.3

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 (48) hide show
  1. package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
  2. package/dist/cjs/gx-ide-file-item.cjs.entry.js +110 -0
  3. package/dist/cjs/gx-ide-file-item.cjs.entry.js.map +1 -0
  4. package/dist/cjs/gx-ide-file-uploader.cjs.entry.js +399 -0
  5. package/dist/cjs/gx-ide-file-uploader.cjs.entry.js.map +1 -0
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/collection-manifest.json +2 -0
  8. package/dist/collection/components/file-uploader/file-item/file-item.css +97 -0
  9. package/dist/collection/components/file-uploader/file-item/file-item.js +246 -0
  10. package/dist/collection/components/file-uploader/file-item/file-item.js.map +1 -0
  11. package/dist/collection/components/file-uploader/file-uploader.css +678 -0
  12. package/dist/collection/components/file-uploader/file-uploader.js +750 -0
  13. package/dist/collection/components/file-uploader/file-uploader.js.map +1 -0
  14. package/dist/collection/components/file-uploader/gx-ide-assets/file-uploader/langs/file-uploader.lang.en.json +36 -0
  15. package/dist/collection/components/file-uploader/gx-ide-assets/file-uploader/langs/file-uploader.lang.ja.json +36 -0
  16. package/dist/collection/components/file-uploader/gx-ide-assets/file-uploader/langs/file-uploader.lang.zh.json +36 -0
  17. package/dist/collection/components/file-uploader/types.js +2 -0
  18. package/dist/collection/components/file-uploader/types.js.map +1 -0
  19. package/dist/collection/testing/locale.e2e.js +4 -1
  20. package/dist/collection/testing/locale.e2e.js.map +1 -1
  21. package/dist/components/file-item.js +130 -0
  22. package/dist/components/file-item.js.map +1 -0
  23. package/dist/components/gx-ide-file-item.d.ts +11 -0
  24. package/dist/components/gx-ide-file-item.js +8 -0
  25. package/dist/components/gx-ide-file-item.js.map +1 -0
  26. package/dist/components/gx-ide-file-uploader.d.ts +11 -0
  27. package/dist/components/gx-ide-file-uploader.js +438 -0
  28. package/dist/components/gx-ide-file-uploader.js.map +1 -0
  29. package/dist/esm/genexus-ide-ui.js +1 -1
  30. package/dist/esm/gx-ide-file-item.entry.js +106 -0
  31. package/dist/esm/gx-ide-file-item.entry.js.map +1 -0
  32. package/dist/esm/gx-ide-file-uploader.entry.js +395 -0
  33. package/dist/esm/gx-ide-file-uploader.entry.js.map +1 -0
  34. package/dist/esm/loader.js +1 -1
  35. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  36. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
  37. package/dist/genexus-ide-ui/gx-ide-assets/file-uploader/langs/file-uploader.lang.en.json +36 -0
  38. package/dist/genexus-ide-ui/gx-ide-assets/file-uploader/langs/file-uploader.lang.ja.json +36 -0
  39. package/dist/genexus-ide-ui/gx-ide-assets/file-uploader/langs/file-uploader.lang.zh.json +36 -0
  40. package/dist/genexus-ide-ui/p-961cd6c2.entry.js +475 -0
  41. package/dist/genexus-ide-ui/p-961cd6c2.entry.js.map +1 -0
  42. package/dist/genexus-ide-ui/p-ef5dfd35.entry.js +157 -0
  43. package/dist/genexus-ide-ui/p-ef5dfd35.entry.js.map +1 -0
  44. package/dist/types/components/file-uploader/file-item/file-item.d.ts +31 -0
  45. package/dist/types/components/file-uploader/file-uploader.d.ts +51 -0
  46. package/dist/types/components/file-uploader/types.d.ts +31 -0
  47. package/dist/types/components.d.ts +247 -0
  48. package/package.json +1 -1
@@ -0,0 +1,475 @@
1
+ import { r as e, h as i, H as t, a } from "./p-25a9f1d7.js";
2
+
3
+ import { g as o } from "./p-6e4208d8.js";
4
+
5
+ import "./p-5ac47c69.js";
6
+
7
+ import { L as r } from "./p-311eedf3.js";
8
+
9
+ const s = ":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)}:host{display:grid;block-size:100%}.card-regular{background-color:var(--mer-surface__elevation--01);border:var(--mer-border__width--sm) solid var(--mer-border-color__on-elevation--01);border-radius:var(--mer-border__radius--md);padding:var(--mer-spacing--md) var(--mer-spacing--md);display:grid}.card-small{background-color:var(--mer-surface__elevation--02);border-radius:var(--mer-border__radius--sm);padding:var(--mer-spacing--sm) var(--mer-spacing--sm)}.card-small--actionable:hover{background-color:var(--mer-color__neutral-gray--600)}.card-small--actionable:active{background-color:var(--mer-color__neutral-gray--650)}.card-small:focus-visible{outline:var(--focus__outline-width) var(--focus__outline-style) var(--focus__outline-color);outline-offset:var(--focus__outline-offset)}.empty-state{block-size:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:var(--mer-spacing--sm);text-align:center}.empty-state__title,.empty-state__button,.empty-state__link{max-inline-size:300px}.opacity-0{opacity:0}.opacity-1{opacity:1}.display-contents{display:contents}.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-view-primary{font-size:var(--mer-font__size--2xs)}p{margin:0;font-size:var(--mer-font__size--xxs)}.buttons-container{display:flex;gap:var(--mer-spacing--xs)}:host{display:block;inline-size:100%;block-size:100%;padding-inline-end:0 !important}.file-uploader-dialog{display:flex;flex-direction:column;block-size:100%;background-color:var(--mer-surface__background);position:relative}.file-uploader-dialog .dialog-content{flex:1;min-block-size:0;overflow:auto}.file-uploader-dialog .dialog-footer{padding-inline-end:var(--spacing-body-inline-end)}.file-uploader{display:flex;flex-direction:column;inline-size:100%;block-size:100%}.file-uploader__list{display:flex;flex-direction:column;inline-size:100%;block-size:100%}.file-uploader__list-header{position:sticky;top:0;z-index:1;background-color:var(--mer-surface__elevation--01);display:flex;justify-content:space-between;align-items:center;padding-inline-end:var(--spacing-body-inline-end)}.file-uploader__list-content{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:var(--mer-spacing--xs);padding-inline-end:var(--spacing-body-inline-end);padding-block-end:var(--mer-spacing--md)}.file-uploader__list-title-container{display:flex;align-items:center;gap:var(--mer-spacing--2xs);white-space:nowrap}.file-uploader__drop-zone{display:flex;flex-direction:column;align-items:center;justify-content:center;inline-size:calc(100% - var(--spacing-body-inline-end));block-size:calc(100% - var(--mer-spacing--sm));min-block-size:200px;margin-block-end:var(--mer-spacing--sm);background:var(--mer-surface__elevation--01);border:var(--mer-border__width--md) dashed var(--mer-border-color__dim);border-radius:var(--mer-border__radius--md);transition:border-color 0.3s ease, background-color 0.3s ease, opacity 0.3s ease}.file-uploader__drop-zone--dragging{border-color:var(--mer-accent__primary);background:var(--mer-accent__primary--hover);opacity:0.7}.file-uploader__drop-zone .text-container{display:flex;flex-direction:column;align-items:center;gap:var(--mer-spacing--2xs);margin-block-start:var(--mer-spacing--xs)}.hidden-input{display:none}.label-primary-row{display:flex;align-items:center;gap:var(--mer-spacing--xs)}";
10
+
11
+ var n = undefined && undefined.__classPrivateFieldGet || function(e, i, t, a) {
12
+ if (t === "a" && !a) throw new TypeError("Private accessor was defined without a getter");
13
+ if (typeof i === "function" ? e !== i || !a : !i.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14
+ return t === "m" ? a : t === "a" ? a.call(e) : a ? a.value : i.get(e);
15
+ };
16
+
17
+ var l = undefined && undefined.__classPrivateFieldSet || function(e, i, t, a, o) {
18
+ if (a === "m") throw new TypeError("Private method is not writable");
19
+ if (a === "a" && !o) throw new TypeError("Private accessor was defined without a setter");
20
+ if (typeof i === "function" ? e !== i || !o : !i.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
21
+ return a === "a" ? o.call(e, t) : o ? o.value = t : i.set(e, t), t;
22
+ };
23
+
24
+ var d, c, f, g, h, b, v, p, m, u, y, x, w, k, _, z, M, j;
25
+
26
+ const W = o({
27
+ category: "gemini-tools",
28
+ name: "add",
29
+ colorType: "primary"
30
+ });
31
+
32
+ const O = [ "resets/box-sizing", "components/button", "components/icon", "components/list-box", "components/edit", "utils/typography", "utils/spacing", "utils/form", "utils/layout", "utils/elevation", "chameleon/scrollbar" ];
33
+
34
+ const F = class {
35
+ constructor(i) {
36
+ e(this, i);
37
+ d.add(this);
38
+ c.set(this, void 0);
39
+ f.set(this, void 0);
40
+ g.set(this, 0);
41
+ /** Generates a unique ID for file identification */ h.set(this, (() => Math.random().toString(36).substr(2, 9)));
42
+ /** Handles drag enter event */ p.set(this, (e => {
43
+ var i;
44
+ e.preventDefault();
45
+ e.stopPropagation();
46
+ l(this, g, (i = n(this, g, "f"), i++, i), "f");
47
+ this.isDragging = true;
48
+ }));
49
+ /** Handles drag leave event */ m.set(this, (e => {
50
+ var i;
51
+ e.preventDefault();
52
+ e.stopPropagation();
53
+ l(this, g, (i = n(this, g, "f"), i--, i), "f");
54
+ if (n(this, g, "f") === 0) {
55
+ this.isDragging = false;
56
+ }
57
+ }));
58
+ /** Handles drag over event */ u.set(this, (e => {
59
+ e.preventDefault();
60
+ e.stopPropagation();
61
+ }));
62
+ /** Handles drop event */ y.set(this, (e => {
63
+ var i;
64
+ e.preventDefault();
65
+ e.stopPropagation();
66
+ this.isDragging = false;
67
+ l(this, g, 0, "f");
68
+ const t = (i = e.dataTransfer) === null || i === void 0 ? void 0 : i.files;
69
+ if (t) {
70
+ n(this, k, "f").call(this, t);
71
+ }
72
+ }));
73
+ /** Triggers file input click */ x.set(this, (() => {
74
+ var e;
75
+ (e = n(this, f, "f")) === null || e === void 0 ? void 0 : e.click();
76
+ }));
77
+ /** Handles file input change event */ w.set(this, (e => {
78
+ const i = e.target.files;
79
+ if (i) {
80
+ n(this, k, "f").call(this, i);
81
+ }
82
+ }));
83
+ /** Processes files and starts upload */ k.set(this, (e => {
84
+ const i = n(this, d, "m", v).call(this, e);
85
+ i.forEach((async e => {
86
+ var i, t;
87
+ const a = n(this, h, "f").call(this);
88
+ const o = {
89
+ id: a,
90
+ name: e.name,
91
+ file: e,
92
+ pending: true,
93
+ progress: 0
94
+ };
95
+ if (!this.multiple) {
96
+ this.fileStates.clear();
97
+ }
98
+ this.fileStates = new Map(this.fileStates.set(a, o));
99
+ if (this.uploadFunction) {
100
+ try {
101
+ const o = this.uploadFunction(e, (e => {
102
+ const i = this.fileStates.get(a);
103
+ if (i) {
104
+ const t = Object.assign(Object.assign({}, i), {
105
+ progress: e,
106
+ pending: e < 100
107
+ });
108
+ this.fileStates = new Map(this.fileStates.set(a, t));
109
+ }
110
+ }));
111
+ // Store the upload promise/object for potential cancellation
112
+ const r = Object.assign(Object.assign({}, this.fileStates.get(a)), {
113
+ uploadPromise: o
114
+ });
115
+ this.fileStates = new Map(this.fileStates.set(a, r));
116
+ const s = await o;
117
+ console.log("Upload result:", {
118
+ id: a,
119
+ result: s
120
+ });
121
+ const n = this.fileStates.get(a);
122
+ if (n) {
123
+ if (s.success && s.remoteId) {
124
+ const e = Object.assign(Object.assign({}, n), {
125
+ remoteId: s.remoteId,
126
+ pending: false,
127
+ progress: 100
128
+ });
129
+ this.fileStates = new Map(this.fileStates.set(a, e));
130
+ console.log("File uploaded successfully:", e);
131
+ await ((i = this.fileUploadedCallback) === null || i === void 0 ? void 0 : i.call(this, {
132
+ name: n.name,
133
+ originalName: n.file.name,
134
+ remoteId: s.remoteId
135
+ }));
136
+ } else {
137
+ const e = Object.assign(Object.assign({}, n), {
138
+ error: ((t = s.errors) === null || t === void 0 ? void 0 : t.upload) || "Upload failed",
139
+ pending: false
140
+ });
141
+ this.fileStates = new Map(this.fileStates.set(a, e));
142
+ console.log("File upload failed:", e);
143
+ }
144
+ }
145
+ } catch (e) {
146
+ const i = this.fileStates.get(a);
147
+ if (i) {
148
+ const t = Object.assign(Object.assign({}, i), {
149
+ error: e instanceof Error ? e.message : "Unknown error occurred",
150
+ pending: false
151
+ });
152
+ this.fileStates = new Map(this.fileStates.set(a, t));
153
+ console.log("File upload error:", t);
154
+ }
155
+ }
156
+ }
157
+ }));
158
+ if (n(this, f, "f")) {
159
+ n(this, f, "f").value = "";
160
+ }
161
+ }));
162
+ /** Handles file name change */ _.set(this, (async e => {
163
+ var i;
164
+ const {id: t, name: a} = e.detail;
165
+ const o = this.fileStates.get(t);
166
+ if (o) {
167
+ const e = Object.assign(Object.assign({}, o), {
168
+ name: a.trim(),
169
+ isEditing: false
170
+ });
171
+ this.fileStates = new Map(this.fileStates.set(t, e));
172
+ await ((i = this.fileRenamedCallback) === null || i === void 0 ? void 0 : i.call(this, {
173
+ fileId: t,
174
+ newName: a.trim()
175
+ }));
176
+ }
177
+ }));
178
+ /** Handles individual file cancellation or deletion */ z.set(this, (async e => {
179
+ var i, t, a, o;
180
+ const r = e.detail;
181
+ const s = this.fileStates.get(r);
182
+ if (s) {
183
+ try {
184
+ if (s.pending) {
185
+ // Cancel upload in progress
186
+ if (s.uploadPromise && typeof s.uploadPromise.cancel === "function") {
187
+ s.uploadPromise.cancel();
188
+ } else if (this.cancelUploadFunction) {
189
+ await this.cancelUploadFunction(r);
190
+ }
191
+ await ((i = this.uploadCancelledCallback) === null || i === void 0 ? void 0 : i.call(this, r));
192
+ this.fileStates.delete(r);
193
+ this.fileStates = new Map(this.fileStates);
194
+ } else {
195
+ const e = {
196
+ name: s.name,
197
+ originalName: s.file.name,
198
+ remoteId: s.remoteId
199
+ };
200
+ const i = await ((t = this.onBeforeDelete) === null || t === void 0 ? void 0 : t.call(this, e));
201
+ if (i) {
202
+ await ((a = this.fileDeletedCallback) === null || a === void 0 ? void 0 : a.call(this, e));
203
+ this.fileStates.delete(r);
204
+ this.fileStates = new Map(this.fileStates);
205
+ }
206
+ }
207
+ } catch (e) {
208
+ await ((o = this.fileDeletionErrorCallback) === null || o === void 0 ? void 0 : o.call(this, {
209
+ fileName: s.name,
210
+ error: e instanceof Error ? e.message : "Unknown error occurred"
211
+ }));
212
+ }
213
+ }
214
+ }));
215
+ /** Handles dialog confirmation */ M.set(this, (async () => {
216
+ var e;
217
+ // Verificar si hay subidas en progreso
218
+ const i = Array.from(this.fileStates.values()).some((e => e.pending));
219
+ if (i) {
220
+ return;
221
+ // No permitir confirmar si hay subidas en progreso
222
+ }
223
+ // Obtener todos los archivos que están completamente subidos
224
+ const t = Array.from(this.fileStates.values()).filter((e => {
225
+ const i = !e.pending && e.remoteId && !e.error;
226
+ console.log("File validation:", {
227
+ id: e.id,
228
+ name: e.name,
229
+ pending: e.pending,
230
+ remoteId: e.remoteId,
231
+ error: e.error,
232
+ isValid: i
233
+ });
234
+ return i;
235
+ })).map((e => ({
236
+ name: e.name,
237
+ originalName: e.file.name,
238
+ remoteId: e.remoteId
239
+ })));
240
+ console.log("Files to be confirmed:", t);
241
+ if (t.length > 0) {
242
+ await ((e = this.dialogConfirmedCallback) === null || e === void 0 ? void 0 : e.call(this, t));
243
+ }
244
+ // Clear file states
245
+ this.fileStates.clear();
246
+ this.fileStates = new Map;
247
+ // Reset file input
248
+ if (n(this, f, "f")) {
249
+ n(this, f, "f").value = "";
250
+ }
251
+ }));
252
+ /** Handles dialog cancellation */ j.set(this, (async () => {
253
+ var e, i, t;
254
+ try {
255
+ // Cancelamos todas las subidas en progreso
256
+ for (const [i, t] of this.fileStates.entries()) {
257
+ if (t.pending && this.cancelUploadFunction) {
258
+ try {
259
+ await this.cancelUploadFunction(i);
260
+ await ((e = this.uploadCancelledCallback) === null || e === void 0 ? void 0 : e.call(this, i));
261
+ } catch (e) {
262
+ // Error handling for upload cancellation
263
+ }
264
+ }
265
+ }
266
+ // Limpiamos todos los estados
267
+ this.fileStates.clear();
268
+ this.fileStates = new Map;
269
+ if (n(this, f, "f")) {
270
+ n(this, f, "f").value = "";
271
+ }
272
+ await ((i = this.dialogCanceledCallback) === null || i === void 0 ? void 0 : i.call(this));
273
+ } catch (e) {
274
+ this.fileStates.clear();
275
+ this.fileStates = new Map;
276
+ await ((t = this.dialogCanceledCallback) === null || t === void 0 ? void 0 : t.call(this));
277
+ }
278
+ }));
279
+ this.types = [];
280
+ this.multiple = false;
281
+ this.canEditName = false;
282
+ this.label = undefined;
283
+ this.uploadFunction = undefined;
284
+ this.cancelUploadFunction = undefined;
285
+ this.fileUploadedCallback = undefined;
286
+ this.dialogCanceledCallback = undefined;
287
+ this.dialogConfirmedCallback = undefined;
288
+ this.uploadCancelledCallback = undefined;
289
+ this.fileRenamedCallback = undefined;
290
+ this.fileValidationErrorCallback = undefined;
291
+ this.fileDeletionErrorCallback = undefined;
292
+ this.fileDeletedCallback = undefined;
293
+ this.onBeforeDelete = undefined;
294
+ this.fileStates = new Map;
295
+ this.isDragging = false;
296
+ }
297
+ /** Initializes component with locale strings */ async componentWillLoad() {
298
+ l(this, c, await r.getComponentStrings(this.el), "f");
299
+ }
300
+ /** Clears the current file selection */ async clear() {
301
+ var e;
302
+ for (const [i, t] of this.fileStates.entries()) {
303
+ if (t.pending && this.cancelUploadFunction) {
304
+ try {
305
+ await this.cancelUploadFunction(i);
306
+ await ((e = this.uploadCancelledCallback) === null || e === void 0 ? void 0 : e.call(this, i));
307
+ } catch (e) {
308
+ // Error handling for upload cancellation
309
+ }
310
+ }
311
+ }
312
+ this.fileStates.clear();
313
+ }
314
+ render() {
315
+ var e, a, o, r, s, d, g, h, b, v, k, F, C;
316
+ return i(t, {
317
+ class: "widget"
318
+ }, i("ch-theme", {
319
+ model: O
320
+ }), i("input", {
321
+ type: "file",
322
+ class: "hidden-input",
323
+ multiple: this.multiple,
324
+ accept: (e = this.types) === null || e === void 0 ? void 0 : e.map((e => e.startsWith(".") ? e : `.${e}`)).join(","),
325
+ onChange: n(this, w, "f"),
326
+ ref: e => l(this, f, e, "f"),
327
+ "aria-hidden": "true",
328
+ tabIndex: -1,
329
+ style: {
330
+ display: "none"
331
+ }
332
+ }), i("div", {
333
+ class: "file-uploader-dialog"
334
+ }, i("div", {
335
+ class: "dialog-content"
336
+ }, this.isDragging || this.fileStates.size === 0 ? i("div", {
337
+ class: {
338
+ "file-uploader__drop-zone": true,
339
+ "file-uploader__drop-zone--dragging": this.isDragging
340
+ },
341
+ onDragEnter: n(this, p, "f"),
342
+ onDragLeave: n(this, m, "f"),
343
+ onDragOver: n(this, u, "f"),
344
+ onDrop: n(this, y, "f")
345
+ }, i("button", {
346
+ class: "button-tertiary button-icon-and-text",
347
+ type: "button",
348
+ onClick: n(this, x, "f")
349
+ }, i("ch-image", {
350
+ class: "icon-md",
351
+ src: W
352
+ }), i("label", {
353
+ class: "label"
354
+ }, this.multiple ? (a = n(this, c, "f")) === null || a === void 0 ? void 0 : a.header.uploadButtonMultiple : (o = n(this, c, "f")) === null || o === void 0 ? void 0 : o.header.uploadButtonSingle)), i("div", {
355
+ class: "text-container"
356
+ }, i("div", {
357
+ class: "label-primary-row"
358
+ }, i("label", {
359
+ class: "label"
360
+ }, this.label || ((r = n(this, c, "f")) === null || r === void 0 ? void 0 : r.header.orText)), i("label", {
361
+ class: "label"
362
+ }, (s = n(this, c, "f")) === null || s === void 0 ? void 0 : s.header.dragAndDrop)), i("span", {
363
+ class: "caption"
364
+ }, this.types && this.types.length > 0 ? (d = n(this, c, "f")) === null || d === void 0 ? void 0 : d.header.acceptedFiles.replace("{0}", this.types.join(", ")) : (g = n(this, c, "f")) === null || g === void 0 ? void 0 : g.header.allFilesAccepted))) : i("div", {
365
+ class: "file-uploader__list"
366
+ }, i("div", {
367
+ class: "file-uploader__list-header spacing-body-block-end"
368
+ }, i("div", {
369
+ class: "file-uploader__list-title-container"
370
+ }, i("label", {
371
+ class: "label"
372
+ }, this.label || ((h = n(this, c, "f")) === null || h === void 0 ? void 0 : h.fileList.attachedFiles)), i("span", {
373
+ class: "caption"
374
+ }, (b = n(this, c, "f")) === null || b === void 0 ? void 0 : b.fileList.filesCount.replace("{0}", this.fileStates.size.toString()))), this.multiple && i("button", {
375
+ class: "button-tertiary button-icon-and-text",
376
+ type: "button",
377
+ onClick: n(this, x, "f")
378
+ }, i("ch-image", {
379
+ class: "icon-md",
380
+ src: W
381
+ }), i("label", {
382
+ class: "label"
383
+ }, this.multiple ? (v = n(this, c, "f")) === null || v === void 0 ? void 0 : v.header.uploadButtonMultiple : (k = n(this, c, "f")) === null || k === void 0 ? void 0 : k.header.uploadButtonSingle))), i("div", {
384
+ class: "file-uploader__list-content scrollable"
385
+ }, Array.from(this.fileStates.values()).map((e => i("gx-ide-file-item", {
386
+ key: e.id,
387
+ file: e,
388
+ editable: this.canEditName,
389
+ onFileNameChange: n(this, _, "f"),
390
+ onFileDelete: n(this, z, "f"),
391
+ onFileCancel: n(this, z, "f")
392
+ })))))), i("div", {
393
+ class: "dialog-footer control-footer control-footer-with-border"
394
+ }, i("div", {
395
+ class: "buttons-spacer"
396
+ }, i("button", {
397
+ class: "button-secondary",
398
+ type: "button",
399
+ onClick: n(this, j, "f")
400
+ }, (F = n(this, c, "f")) === null || F === void 0 ? void 0 : F.buttons.cancel), i("button", {
401
+ class: "button-primary",
402
+ type: "button",
403
+ onClick: n(this, M, "f"),
404
+ disabled: this.fileStates.size === 0 || Array.from(this.fileStates.values()).some((e => e.pending))
405
+ }, (C = n(this, c, "f")) === null || C === void 0 ? void 0 : C.buttons.confirm)))));
406
+ }
407
+ static get assetsDirs() {
408
+ return [ "gx-ide-assets/file-uploader" ];
409
+ }
410
+ get el() {
411
+ return a(this);
412
+ }
413
+ };
414
+
415
+ c = new WeakMap, f = new WeakMap, g = new WeakMap, h = new WeakMap, p = new WeakMap,
416
+ m = new WeakMap, u = new WeakMap, y = new WeakMap, x = new WeakMap, w = new WeakMap,
417
+ k = new WeakMap, _ = new WeakMap, z = new WeakMap, M = new WeakMap, j = new WeakMap,
418
+ d = new WeakSet, b = function _FileUploader_isValidFile(e) {
419
+ var i, t;
420
+ // If no types specified, accept any file
421
+ if (!this.types || this.types.length === 0) {
422
+ return {
423
+ isValid: true
424
+ };
425
+ }
426
+ for (const i of this.types) {
427
+ // Handle wildcards like 'image/*'
428
+ if (i.includes("/*")) {
429
+ const t = i.split("/")[0];
430
+ if (e.type.startsWith(t)) {
431
+ return {
432
+ isValid: true
433
+ };
434
+ }
435
+ }
436
+ // Handle extensions like '.jpg'
437
+ else if (i.startsWith(".")) {
438
+ if (e.name.toLowerCase().endsWith(i.toLowerCase())) {
439
+ return {
440
+ isValid: true
441
+ };
442
+ }
443
+ }
444
+ // Handle specific MIME types
445
+ else if (e.type === i || e.type === `application/${i}`) {
446
+ return {
447
+ isValid: true
448
+ };
449
+ }
450
+ }
451
+ return {
452
+ isValid: false,
453
+ error: ((t = (i = n(this, c, "f")) === null || i === void 0 ? void 0 : i.errors) === null || t === void 0 ? void 0 : t.invalidFileType) || "Invalid file type"
454
+ };
455
+ }, v = function _FileUploader_getValidFiles(e) {
456
+ const i = [];
457
+ Array.from(e).forEach((e => {
458
+ var t;
459
+ const a = n(this, d, "m", b).call(this, e);
460
+ if (a.isValid) {
461
+ i.push(e);
462
+ } else {
463
+ (t = this.fileValidationErrorCallback) === null || t === void 0 ? void 0 : t.call(this, {
464
+ fileName: e.name,
465
+ error: a.error
466
+ });
467
+ }
468
+ }));
469
+ return i;
470
+ };
471
+
472
+ F.style = s;
473
+
474
+ export { F as gx_ide_file_uploader };
475
+ //# sourceMappingURL=p-961cd6c2.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["fileUploaderCss","PLUS_ICON","getIconPath","category","name","colorType","CSS_BUNDLES","FileUploader","_FileUploader__componentLocale","set","this","_FileUploader_fileInputEl","_FileUploader_dragCounter","_FileUploader_generateId","Math","random","toString","substr","_FileUploader_handleDragEnter","e","preventDefault","stopPropagation","__classPrivateFieldSet","_a","__classPrivateFieldGet","isDragging","_FileUploader_handleDragLeave","_FileUploader_handleDragOver","_FileUploader_handleDrop","files","dataTransfer","_FileUploader_handleFiles","call","_FileUploader_handleFileSelect","click","_FileUploader_handleFileInput","target","validFiles","_FileUploader_instances","_FileUploader_getValidFiles","forEach","async","file","id","fileState","pending","progress","multiple","fileStates","clear","Map","uploadFunction","uploadPromise","state","get","updatedState","Object","assign","stateWithPromise","result","console","log","success","remoteId","fileUploadedCallback","originalName","error","_b","errors","upload","Error","message","value","_FileUploader_handleNameChange","event","detail","updatedFile","trim","isEditing","fileRenamedCallback","fileId","newName","_FileUploader_handleFileCancel","cancel","cancelUploadFunction","uploadCancelledCallback","delete","fileToDelete","shouldDelete","onBeforeDelete","_c","fileDeletedCallback","_d","fileDeletionErrorCallback","fileName","_FileUploader_handleConfirm","hasPendingUploads","Array","from","values","some","uploadedFiles","filter","isValid","map","length","dialogConfirmedCallback","_FileUploader_handleCancel","entries","dialogCanceledCallback","componentWillLoad","Locale","getComponentStrings","el","render","h","Host","class","model","type","accept","types","startsWith","join","onChange","ref","tabIndex","style","display","size","onDragEnter","onDragLeave","onDragOver","onDrop","onClick","src","header","uploadButtonMultiple","uploadButtonSingle","label","orText","_e","dragAndDrop","_f","acceptedFiles","replace","_g","allFilesAccepted","_h","fileList","attachedFiles","_j","filesCount","_k","_l","key","editable","canEditName","onFileNameChange","onFileDelete","onFileCancel","_m","buttons","disabled","_o","confirm","includes","baseType","split","toLowerCase","endsWith","invalidFileType","validation","_FileUploader_isValidFile","push","fileValidationErrorCallback"],"sources":["src/components/file-uploader/file-uploader.scss?tag=gx-ide-file-uploader&encapsulation=shadow","src/components/file-uploader/file-uploader.tsx"],"sourcesContent":["@import \"../../global/gx-ide-common.scss\";\n@import \"../../global/gx-ide-mixins.scss\";\n@import \"../../../node_modules/@genexus/mercury/dist/assets/scss/helpers.scss\";\n\n:host {\n display: block;\n inline-size: 100%;\n block-size: 100%;\n padding-inline-end: 0 !important;\n}\n\n.file-uploader-dialog {\n display: flex;\n flex-direction: column;\n block-size: 100%;\n background-color: var(--mer-surface__background);\n position: relative;\n\n .dialog-content {\n flex: 1;\n min-block-size: 0;\n overflow: auto;\n }\n\n .dialog-footer {\n padding-inline-end: var(--spacing-body-inline-end);\n }\n}\n\n.file-uploader {\n display: flex;\n flex-direction: column;\n inline-size: 100%;\n block-size: 100%;\n\n &__list {\n display: flex;\n flex-direction: column;\n inline-size: 100%;\n block-size: 100%;\n\n &-header {\n position: sticky;\n top: 0;\n z-index: 1;\n background-color: var(--mer-surface__elevation--01);\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-inline-end: var(--spacing-body-inline-end);\n }\n\n &-content {\n flex: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--xs);\n padding-inline-end: var(--spacing-body-inline-end);\n padding-block-end: var(--mer-spacing--md);\n }\n }\n\n &__list-title-container {\n display: flex;\n align-items: center;\n gap: var(--mer-spacing--2xs);\n white-space: nowrap;\n }\n\n &__drop-zone {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n inline-size: calc(100% - var(--spacing-body-inline-end));\n block-size: calc(100% - var(--mer-spacing--sm));\n min-block-size: 200px;\n margin-block-end: var(--mer-spacing--sm);\n background: var(--mer-surface__elevation--01);\n border: var(--mer-border__width--md) dashed var(--mer-border-color__dim);\n border-radius: var(--mer-border__radius--md);\n transition: border-color 0.3s ease, background-color 0.3s ease,\n opacity 0.3s ease;\n\n &--dragging {\n border-color: var(--mer-accent__primary);\n background: var(--mer-accent__primary--hover);\n opacity: 0.7;\n }\n\n .text-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--mer-spacing--2xs);\n margin-block-start: var(--mer-spacing--xs);\n }\n }\n}\n\n.hidden-input {\n display: none;\n}\n\n.label-primary-row {\n display: flex;\n align-items: center;\n gap: var(--mer-spacing--xs);\n}\n","/* eslint-disable @stencil-community/own-methods-must-be-private */\n/* eslint-disable @stencil-community/own-props-must-be-private */\n/* STENCIL IMPORTS */\nimport {\n Component,\n Host,\n h,\n Prop,\n Element,\n State,\n Method\n} from \"@stencil/core\";\n\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\nimport { Locale } from \"../../common/locale\";\nimport { UploadedFile, FileUploadState, UploadResult } from \"./types\";\n\nconst PLUS_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"add\",\n colorType: \"primary\"\n});\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/button\",\n \"components/icon\",\n \"components/list-box\",\n \"components/edit\",\n \"utils/typography\",\n \"utils/spacing\",\n \"utils/form\",\n \"utils/layout\",\n \"utils/elevation\",\n \"chameleon/scrollbar\"\n];\n\ntype FileValidationResult = {\n isValid: boolean;\n error?: string;\n};\n\n@Component({\n tag: \"gx-ide-file-uploader\",\n styleUrl: \"file-uploader.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/file-uploader\"]\n})\nexport class FileUploader {\n #_componentLocale: any;\n #fileInputEl!: HTMLInputElement;\n\n @Element() el!: HTMLGxIdeFileUploaderElement;\n\n /** Allowed file types/extensions (e.g. ['.jpg', '.png', 'image/*', 'application/pdf']) */\n @Prop() readonly types?: string[] = [];\n\n /** Whether multiple files can be selected */\n @Prop() readonly multiple: boolean = false;\n\n /** Whether file names can be edited */\n @Prop() readonly canEditName: boolean = false;\n\n /** Label to display in the uploader dialog */\n @Prop() readonly label?: string;\n\n /** Function to handle file upload */\n @Prop() readonly uploadFunction!: (\n file: File,\n progressCallback: (progress: number) => void\n ) => Promise<UploadResult>;\n\n /** Function to cancel file upload */\n @Prop() readonly cancelUploadFunction?: (fileId: string) => Promise<void>;\n\n /** Callback when a file is uploaded successfully */\n @Prop() readonly fileUploadedCallback?: (file: UploadedFile) => Promise<void>;\n\n /** Callback when the dialog is canceled */\n @Prop() readonly dialogCanceledCallback?: () => Promise<void>;\n\n /** Callback when the dialog is confirmed with files */\n @Prop() readonly dialogConfirmedCallback?: (\n files: UploadedFile[]\n ) => Promise<void>;\n\n /** Callback when upload is cancelled */\n @Prop() readonly uploadCancelledCallback?: (fileId: string) => Promise<void>;\n\n /** Callback when file is renamed */\n @Prop() readonly fileRenamedCallback?: (data: {\n fileId: string;\n newName: string;\n }) => Promise<void>;\n\n /** Callback when a file validation error occurs */\n @Prop() readonly fileValidationErrorCallback?: (data: {\n fileName: string;\n error: string;\n }) => Promise<void>;\n\n /** Callback when a file deletion error occurs */\n @Prop() readonly fileDeletionErrorCallback?: (data: {\n fileName: string;\n error: string;\n }) => Promise<void>;\n\n /** Callback when a file is deleted */\n @Prop() readonly fileDeletedCallback?: (file: UploadedFile) => Promise<void>;\n\n /** Callback before deleting a file to get confirmation */\n @Prop() readonly onBeforeDelete?: (file: UploadedFile) => Promise<boolean>;\n\n @State() private fileStates: Map<string, FileUploadState> = new Map();\n @State() private isDragging: boolean = false;\n #dragCounter = 0;\n\n /** Initializes component with locale strings */\n async componentWillLoad() {\n this.#_componentLocale = await Locale.getComponentStrings(this.el);\n }\n\n /** Generates a unique ID for file identification */\n #generateId = (): string => {\n return Math.random().toString(36).substr(2, 9);\n };\n\n /** Validates if a file matches the allowed types */\n #isValidFile(file: File): FileValidationResult {\n // If no types specified, accept any file\n if (!this.types || this.types.length === 0) {\n return { isValid: true };\n }\n\n for (const type of this.types) {\n // Handle wildcards like 'image/*'\n if (type.includes(\"/*\")) {\n const baseType = type.split(\"/\")[0];\n if (file.type.startsWith(baseType)) {\n return { isValid: true };\n }\n }\n // Handle extensions like '.jpg'\n else if (type.startsWith(\".\")) {\n if (file.name.toLowerCase().endsWith(type.toLowerCase())) {\n return { isValid: true };\n }\n }\n // Handle specific MIME types\n else if (file.type === type || file.type === `application/${type}`) {\n return { isValid: true };\n }\n }\n\n return {\n isValid: false,\n error:\n this.#_componentLocale?.errors?.invalidFileType || \"Invalid file type\"\n };\n }\n\n /** Filters valid files from a FileList */\n #getValidFiles(files: FileList): File[] {\n const validFiles: File[] = [];\n\n Array.from(files).forEach(file => {\n const validation = this.#isValidFile(file);\n if (validation.isValid) {\n validFiles.push(file);\n } else {\n this.fileValidationErrorCallback?.({\n fileName: file.name,\n error: validation.error\n });\n }\n });\n\n return validFiles;\n }\n\n /** Handles drag enter event */\n #handleDragEnter = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.#dragCounter++;\n this.isDragging = true;\n };\n\n /** Handles drag leave event */\n #handleDragLeave = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.#dragCounter--;\n if (this.#dragCounter === 0) {\n this.isDragging = false;\n }\n };\n\n /** Handles drag over event */\n #handleDragOver = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n };\n\n /** Handles drop event */\n #handleDrop = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.isDragging = false;\n this.#dragCounter = 0;\n\n const files = e.dataTransfer?.files;\n if (files) {\n this.#handleFiles(files);\n }\n };\n\n /** Triggers file input click */\n #handleFileSelect = () => {\n this.#fileInputEl?.click();\n };\n\n /** Handles file input change event */\n #handleFileInput = (e: Event) => {\n const files = (e.target as HTMLInputElement).files;\n if (files) {\n this.#handleFiles(files);\n }\n };\n\n /** Processes files and starts upload */\n #handleFiles = (files: FileList) => {\n const validFiles: File[] = this.#getValidFiles(files);\n\n validFiles.forEach(async file => {\n const id = this.#generateId();\n const fileState: FileUploadState = {\n id,\n name: file.name,\n file,\n pending: true,\n progress: 0\n };\n\n if (!this.multiple) {\n this.fileStates.clear();\n }\n\n this.fileStates = new Map(this.fileStates.set(id, fileState));\n\n if (this.uploadFunction) {\n try {\n const uploadPromise = this.uploadFunction(file, progress => {\n const state = this.fileStates.get(id);\n if (state) {\n const updatedState = {\n ...state,\n progress: progress,\n pending: progress < 100\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n }\n });\n\n // Store the upload promise/object for potential cancellation\n const stateWithPromise = {\n ...this.fileStates.get(id),\n uploadPromise\n };\n this.fileStates = new Map(this.fileStates.set(id, stateWithPromise));\n\n const result = await uploadPromise;\n console.log(\"Upload result:\", { id, result });\n\n const state = this.fileStates.get(id);\n if (state) {\n if (result.success && result.remoteId) {\n const updatedState = {\n ...state,\n remoteId: result.remoteId,\n pending: false,\n progress: 100\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n console.log(\"File uploaded successfully:\", updatedState);\n await this.fileUploadedCallback?.({\n name: state.name,\n originalName: state.file.name,\n remoteId: result.remoteId\n });\n } else {\n const updatedState = {\n ...state,\n error: result.errors?.upload || \"Upload failed\",\n pending: false\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n console.log(\"File upload failed:\", updatedState);\n }\n }\n } catch (error) {\n const state = this.fileStates.get(id);\n if (state) {\n const updatedState = {\n ...state,\n error:\n error instanceof Error\n ? error.message\n : \"Unknown error occurred\",\n pending: false\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n console.log(\"File upload error:\", updatedState);\n }\n }\n }\n });\n\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n };\n\n /** Handles file name change */\n #handleNameChange = async (\n event: CustomEvent<{ id: string; name: string }>\n ) => {\n const { id, name } = event.detail;\n const file = this.fileStates.get(id);\n\n if (file) {\n const updatedFile = {\n ...file,\n name: name.trim(),\n isEditing: false\n };\n\n this.fileStates = new Map(this.fileStates.set(id, updatedFile));\n await this.fileRenamedCallback?.({ fileId: id, newName: name.trim() });\n }\n };\n\n /** Handles individual file cancellation or deletion */\n #handleFileCancel = async (event: CustomEvent<string>) => {\n const id = event.detail;\n const state = this.fileStates.get(id);\n if (state) {\n try {\n if (state.pending) {\n // Cancel upload in progress\n if (\n state.uploadPromise &&\n typeof state.uploadPromise.cancel === \"function\"\n ) {\n state.uploadPromise.cancel();\n } else if (this.cancelUploadFunction) {\n await this.cancelUploadFunction(id);\n }\n\n await this.uploadCancelledCallback?.(id);\n\n this.fileStates.delete(id);\n this.fileStates = new Map(this.fileStates);\n } else {\n const fileToDelete: UploadedFile = {\n name: state.name,\n originalName: state.file.name,\n remoteId: state.remoteId\n };\n\n const shouldDelete = await this.onBeforeDelete?.(fileToDelete);\n\n if (shouldDelete) {\n await this.fileDeletedCallback?.(fileToDelete);\n this.fileStates.delete(id);\n this.fileStates = new Map(this.fileStates);\n }\n }\n } catch (error) {\n await this.fileDeletionErrorCallback?.({\n fileName: state.name,\n error:\n error instanceof Error ? error.message : \"Unknown error occurred\"\n });\n }\n }\n };\n\n /** Handles dialog confirmation */\n #handleConfirm = async () => {\n // Verificar si hay subidas en progreso\n const hasPendingUploads = Array.from(this.fileStates.values()).some(\n file => file.pending\n );\n\n if (hasPendingUploads) {\n return; // No permitir confirmar si hay subidas en progreso\n }\n\n // Obtener todos los archivos que están completamente subidos\n const uploadedFiles: UploadedFile[] = Array.from(this.fileStates.values())\n .filter(file => {\n const isValid = !file.pending && file.remoteId && !file.error;\n console.log(\"File validation:\", {\n id: file.id,\n name: file.name,\n pending: file.pending,\n remoteId: file.remoteId,\n error: file.error,\n isValid\n });\n return isValid;\n })\n .map(file => ({\n name: file.name,\n originalName: file.file.name,\n remoteId: file.remoteId as string\n }));\n\n console.log(\"Files to be confirmed:\", uploadedFiles);\n\n if (uploadedFiles.length > 0) {\n await this.dialogConfirmedCallback?.(uploadedFiles);\n }\n\n // Clear file states\n this.fileStates.clear();\n this.fileStates = new Map();\n\n // Reset file input\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n };\n\n /** Handles dialog cancellation */\n #handleCancel = async () => {\n try {\n // Cancelamos todas las subidas en progreso\n for (const [id, state] of this.fileStates.entries()) {\n if (state.pending && this.cancelUploadFunction) {\n try {\n await this.cancelUploadFunction(id);\n await this.uploadCancelledCallback?.(id);\n } catch (error) {\n // Error handling for upload cancellation\n }\n }\n }\n\n // Limpiamos todos los estados\n this.fileStates.clear();\n this.fileStates = new Map();\n\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n\n await this.dialogCanceledCallback?.();\n } catch (error) {\n this.fileStates.clear();\n this.fileStates = new Map();\n await this.dialogCanceledCallback?.();\n }\n };\n\n /** Clears the current file selection */\n @Method()\n async clear() {\n for (const [id, state] of this.fileStates.entries()) {\n if (state.pending && this.cancelUploadFunction) {\n try {\n await this.cancelUploadFunction(id);\n await this.uploadCancelledCallback?.(id);\n } catch (error) {\n // Error handling for upload cancellation\n }\n }\n }\n this.fileStates.clear();\n }\n\n render() {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <input\n type=\"file\"\n class=\"hidden-input\"\n multiple={this.multiple}\n accept={this.types\n ?.map(type => (type.startsWith(\".\") ? type : `.${type}`))\n .join(\",\")}\n onChange={this.#handleFileInput}\n ref={el => (this.#fileInputEl = el as HTMLInputElement)}\n aria-hidden=\"true\"\n tabIndex={-1}\n style={{ display: \"none\" }}\n />\n <div class=\"file-uploader-dialog\">\n <div class=\"dialog-content\">\n {this.isDragging || this.fileStates.size === 0 ? (\n <div\n class={{\n \"file-uploader__drop-zone\": true,\n \"file-uploader__drop-zone--dragging\": this.isDragging\n }}\n onDragEnter={this.#handleDragEnter}\n onDragLeave={this.#handleDragLeave}\n onDragOver={this.#handleDragOver}\n onDrop={this.#handleDrop}\n >\n <button\n class=\"button-tertiary button-icon-and-text\"\n type=\"button\"\n onClick={this.#handleFileSelect}\n >\n <ch-image class=\"icon-md\" src={PLUS_ICON}></ch-image>\n <label class=\"label\">\n {this.multiple\n ? this.#_componentLocale?.header.uploadButtonMultiple\n : this.#_componentLocale?.header.uploadButtonSingle}\n </label>\n </button>\n <div class=\"text-container\">\n <div class=\"label-primary-row\">\n <label class=\"label\">\n {this.label || this.#_componentLocale?.header.orText}\n </label>\n <label class=\"label\">\n {this.#_componentLocale?.header.dragAndDrop}\n </label>\n </div>\n <span class=\"caption\">\n {this.types && this.types.length > 0\n ? this.#_componentLocale?.header.acceptedFiles.replace(\n \"{0}\",\n this.types.join(\", \")\n )\n : this.#_componentLocale?.header.allFilesAccepted}\n </span>\n </div>\n </div>\n ) : (\n <div class=\"file-uploader__list\">\n <div class=\"file-uploader__list-header spacing-body-block-end\">\n <div class=\"file-uploader__list-title-container\">\n <label class=\"label\">\n {this.label ||\n this.#_componentLocale?.fileList.attachedFiles}\n </label>\n <span class=\"caption\">\n {this.#_componentLocale?.fileList.filesCount.replace(\n \"{0}\",\n this.fileStates.size.toString()\n )}\n </span>\n </div>\n {this.multiple && (\n <button\n class=\"button-tertiary button-icon-and-text\"\n type=\"button\"\n onClick={this.#handleFileSelect}\n >\n <ch-image class=\"icon-md\" src={PLUS_ICON}></ch-image>\n <label class=\"label\">\n {this.multiple\n ? this.#_componentLocale?.header.uploadButtonMultiple\n : this.#_componentLocale?.header.uploadButtonSingle}\n </label>\n </button>\n )}\n </div>\n <div class=\"file-uploader__list-content scrollable\">\n {Array.from(this.fileStates.values()).map(file => (\n <gx-ide-file-item\n key={file.id}\n file={file}\n editable={this.canEditName}\n onFileNameChange={this.#handleNameChange}\n onFileDelete={this.#handleFileCancel}\n onFileCancel={this.#handleFileCancel}\n />\n ))}\n </div>\n </div>\n )}\n </div>\n <div class=\"dialog-footer control-footer control-footer-with-border\">\n <div class=\"buttons-spacer\">\n <button\n class=\"button-secondary\"\n type=\"button\"\n onClick={this.#handleCancel}\n >\n {this.#_componentLocale?.buttons.cancel}\n </button>\n <button\n class=\"button-primary\"\n type=\"button\"\n onClick={this.#handleConfirm}\n disabled={\n this.fileStates.size === 0 ||\n Array.from(this.fileStates.values()).some(\n file => file.pending\n )\n }\n >\n {this.#_componentLocale?.buttons.confirm}\n </button>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":";;;;;;;;AAAA,MAAMA,IAAkB;;;;;;;;;;;;;;;;;ACiBxB,MAAMC,IAAYC,EAAY;EAC5BC,UAAU;EACVC,MAAM;EACNC,WAAW;;;AAGb,MAAMC,IAA8B,EAClC,qBACA,qBACA,mBACA,uBACA,mBACA,oBACA,iBACA,cACA,gBACA,mBACA;;MAcWC,IAAY;;;;IACvBC,EAAAC,IAAAC,WAAA;IACAC,EAAAF,IAAAC,WAAA;IAiEAE,EAAAH,IAAAC,MAAe;4DAQfG,EAAAJ,IAAAC,OAAc,MACLI,KAAKC,SAASC,SAAS,IAAIC,OAAO,GAAG;uCAyD9CC,EAAAT,IAAAC,OAAoBS;;MAClBA,EAAEC;MACFD,EAAEE;MACFC,EAAAZ,MAAAE,IAAAW,IAAAC,EAAAd,MAAAE,GAAA,MAAAW,KAAmBA,IAAA;MACnBb,KAAKe,aAAa;AAAI;uCAIxBC,EAAAjB,IAAAC,OAAoBS;;MAClBA,EAAEC;MACFD,EAAEE;MACFC,EAAAZ,MAAAE,IAAAW,IAAAC,EAAAd,MAAAE,GAAA,MAAAW,KAAmBA,IAAA;MACnB,IAAIC,EAAAd,MAAIE,GAAA,SAAkB,GAAG;QAC3BF,KAAKe,aAAa;;;sCAKtBE,EAAAlB,IAAAC,OAAmBS;MACjBA,EAAEC;MACFD,EAAEE;AAAiB;iCAIrBO,EAAAnB,IAAAC,OAAeS;;MACbA,EAAEC;MACFD,EAAEE;MACFX,KAAKe,aAAa;MAClBH,EAAAZ,MAAIE,GAAgB,GAAC;MAErB,MAAMiB,KAA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