@genexus/genexus-ide-ui 3.0.1 → 3.1.0

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 (100) hide show
  1. package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
  2. package/dist/cjs/gx-ide-file-item.cjs.entry.js +21 -2
  3. package/dist/cjs/gx-ide-file-item.cjs.entry.js.map +1 -1
  4. package/dist/cjs/gx-ide-file-uploader.cjs.entry.js +11 -8
  5. package/dist/cjs/gx-ide-file-uploader.cjs.entry.js.map +1 -1
  6. package/dist/cjs/gx-ide-launchpad.cjs.entry.js +4 -16
  7. package/dist/cjs/gx-ide-launchpad.cjs.entry.js.map +1 -1
  8. package/dist/cjs/gx-ide-multi-select.cjs.entry.js +113 -0
  9. package/dist/cjs/gx-ide-multi-select.cjs.entry.js.map +1 -0
  10. package/dist/cjs/gx-ide-search.cjs.entry.js +171 -0
  11. package/dist/cjs/gx-ide-search.cjs.entry.js.map +1 -0
  12. package/dist/cjs/gx-ide-ww-files.cjs.entry.js +4 -9
  13. package/dist/cjs/gx-ide-ww-files.cjs.entry.js.map +1 -1
  14. package/dist/cjs/loader.cjs.js +1 -1
  15. package/dist/collection/collection-manifest.json +2 -0
  16. package/dist/collection/components/_helpers/multi-select/gx-ide-multi-select.css +193 -0
  17. package/dist/collection/components/_helpers/multi-select/gx-ide-multi-select.js +209 -0
  18. package/dist/collection/components/_helpers/multi-select/gx-ide-multi-select.js.map +1 -0
  19. package/dist/collection/components/file-uploader/file-item/file-item.css +23 -28
  20. package/dist/collection/components/file-uploader/file-item/file-item.js +37 -1
  21. package/dist/collection/components/file-uploader/file-item/file-item.js.map +1 -1
  22. package/dist/collection/components/file-uploader/file-uploader.css +11 -22
  23. package/dist/collection/components/file-uploader/file-uploader.js +10 -7
  24. package/dist/collection/components/file-uploader/file-uploader.js.map +1 -1
  25. package/dist/collection/components/file-uploader/gx-ide-assets/file-uploader/langs/file-uploader.lang.en.json +7 -3
  26. package/dist/collection/components/file-uploader/gx-ide-assets/file-uploader/langs/file-uploader.lang.ja.json +7 -3
  27. package/dist/collection/components/file-uploader/gx-ide-assets/file-uploader/langs/file-uploader.lang.zh.json +8 -3
  28. package/dist/collection/components/launchpad/root/gx-ide-assets/launchpad/shortcuts.json +1 -26
  29. package/dist/collection/components/launchpad/root/launchpad.js +5 -42
  30. package/dist/collection/components/launchpad/root/launchpad.js.map +1 -1
  31. package/dist/collection/components/search/gx-ide-assets/search/langs/search.lang.en.json +37 -0
  32. package/dist/collection/components/search/gx-ide-assets/search/langs/search.lang.ja.json +37 -0
  33. package/dist/collection/components/search/gx-ide-assets/search/langs/search.lang.zh.json +37 -0
  34. package/dist/collection/components/search/search.css +44 -0
  35. package/dist/collection/components/search/search.js +275 -0
  36. package/dist/collection/components/search/search.js.map +1 -0
  37. package/dist/collection/components/ww-files/ww-files.js +4 -9
  38. package/dist/collection/components/ww-files/ww-files.js.map +1 -1
  39. package/dist/collection/testing/locale.e2e.js +4 -1
  40. package/dist/collection/testing/locale.e2e.js.map +1 -1
  41. package/dist/components/file-item.js +22 -2
  42. package/dist/components/file-item.js.map +1 -1
  43. package/dist/components/gx-ide-file-uploader.js +11 -8
  44. package/dist/components/gx-ide-file-uploader.js.map +1 -1
  45. package/dist/components/gx-ide-launchpad.js +6 -19
  46. package/dist/components/gx-ide-launchpad.js.map +1 -1
  47. package/dist/components/gx-ide-multi-select.d.ts +11 -0
  48. package/dist/components/gx-ide-multi-select.js +132 -0
  49. package/dist/components/gx-ide-multi-select.js.map +1 -0
  50. package/dist/components/gx-ide-search.d.ts +11 -0
  51. package/dist/components/gx-ide-search.js +206 -0
  52. package/dist/components/gx-ide-search.js.map +1 -0
  53. package/dist/components/gx-ide-ww-files.js +4 -9
  54. package/dist/components/gx-ide-ww-files.js.map +1 -1
  55. package/dist/esm/genexus-ide-ui.js +1 -1
  56. package/dist/esm/gx-ide-file-item.entry.js +21 -2
  57. package/dist/esm/gx-ide-file-item.entry.js.map +1 -1
  58. package/dist/esm/gx-ide-file-uploader.entry.js +11 -8
  59. package/dist/esm/gx-ide-file-uploader.entry.js.map +1 -1
  60. package/dist/esm/gx-ide-launchpad.entry.js +5 -17
  61. package/dist/esm/gx-ide-launchpad.entry.js.map +1 -1
  62. package/dist/esm/gx-ide-multi-select.entry.js +109 -0
  63. package/dist/esm/gx-ide-multi-select.entry.js.map +1 -0
  64. package/dist/esm/gx-ide-search.entry.js +167 -0
  65. package/dist/esm/gx-ide-search.entry.js.map +1 -0
  66. package/dist/esm/gx-ide-ww-files.entry.js +4 -9
  67. package/dist/esm/gx-ide-ww-files.entry.js.map +1 -1
  68. package/dist/esm/loader.js +1 -1
  69. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  70. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
  71. package/dist/genexus-ide-ui/gx-ide-assets/file-uploader/langs/file-uploader.lang.en.json +7 -3
  72. package/dist/genexus-ide-ui/gx-ide-assets/file-uploader/langs/file-uploader.lang.ja.json +7 -3
  73. package/dist/genexus-ide-ui/gx-ide-assets/file-uploader/langs/file-uploader.lang.zh.json +8 -3
  74. package/dist/genexus-ide-ui/gx-ide-assets/launchpad/shortcuts.json +1 -26
  75. package/dist/genexus-ide-ui/gx-ide-assets/search/langs/search.lang.en.json +37 -0
  76. package/dist/genexus-ide-ui/gx-ide-assets/search/langs/search.lang.ja.json +37 -0
  77. package/dist/genexus-ide-ui/gx-ide-assets/search/langs/search.lang.zh.json +37 -0
  78. package/dist/genexus-ide-ui/p-0745a565.entry.js +152 -0
  79. package/dist/genexus-ide-ui/p-0745a565.entry.js.map +1 -0
  80. package/dist/genexus-ide-ui/{p-6246204f.entry.js → p-25e749c7.entry.js} +44 -57
  81. package/dist/genexus-ide-ui/p-25e749c7.entry.js.map +1 -0
  82. package/dist/genexus-ide-ui/{p-60db2f02.entry.js → p-7bdeae77.entry.js} +106 -108
  83. package/dist/genexus-ide-ui/p-7bdeae77.entry.js.map +1 -0
  84. package/dist/genexus-ide-ui/p-8b5c826b.entry.js +212 -0
  85. package/dist/genexus-ide-ui/p-8b5c826b.entry.js.map +1 -0
  86. package/dist/genexus-ide-ui/p-c460c9e7.entry.js +187 -0
  87. package/dist/genexus-ide-ui/p-c460c9e7.entry.js.map +1 -0
  88. package/dist/genexus-ide-ui/{p-aad714a5.entry.js → p-e2b88bea.entry.js} +70 -67
  89. package/dist/genexus-ide-ui/p-e2b88bea.entry.js.map +1 -0
  90. package/dist/types/components/_helpers/multi-select/gx-ide-multi-select.d.ts +29 -0
  91. package/dist/types/components/file-uploader/file-item/file-item.d.ts +2 -0
  92. package/dist/types/components/launchpad/root/launchpad.d.ts +0 -4
  93. package/dist/types/components/search/search.d.ts +59 -0
  94. package/dist/types/components.d.ts +121 -4
  95. package/package.json +1 -1
  96. package/dist/genexus-ide-ui/p-60db2f02.entry.js.map +0 -1
  97. package/dist/genexus-ide-ui/p-6246204f.entry.js.map +0 -1
  98. package/dist/genexus-ide-ui/p-aad714a5.entry.js.map +0 -1
  99. package/dist/genexus-ide-ui/p-f3c3e830.entry.js +0 -163
  100. package/dist/genexus-ide-ui/p-f3c3e830.entry.js.map +0 -1
@@ -0,0 +1,209 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f)
3
+ throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
5
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
6
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
7
+ };
8
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9
+ if (kind === "m")
10
+ throw new TypeError("Private method is not writable");
11
+ if (kind === "a" && !f)
12
+ throw new TypeError("Private accessor was defined without a setter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
14
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
16
+ };
17
+ var _GxIdeMultiSelect_multiButtonEl, _GxIdeMultiSelect_popoverEl, _GxIdeMultiSelect_togglePopover, _GxIdeMultiSelect_checkboxChangeHandler, _GxIdeMultiSelect_removeSelectedItemHandler, _GxIdeMultiSelect_isItemSelected, _GxIdeMultiSelect_renderSelectedItems;
18
+ import { Host, h } from "@stencil/core";
19
+ import { getIconPath } from "@genexus/mercury";
20
+ const CSS_BUNDLES = [
21
+ "resets/box-sizing",
22
+ "components/button",
23
+ "components/icon",
24
+ "components/checkbox",
25
+ "utils/typography",
26
+ "utils/spacing",
27
+ "chameleon/scrollbar",
28
+ "components/combo-box"
29
+ ];
30
+ const CHEVRON_DOWN_ICON = getIconPath({
31
+ category: "navigation",
32
+ name: "chevron-down",
33
+ colorType: "on-interactive"
34
+ });
35
+ const CLOSE_ICON = getIconPath({
36
+ category: "system",
37
+ name: "close",
38
+ colorType: "on-interactive"
39
+ });
40
+ export class GxIdeMultiSelect {
41
+ constructor() {
42
+ _GxIdeMultiSelect_multiButtonEl.set(this, void 0);
43
+ _GxIdeMultiSelect_popoverEl.set(this, void 0);
44
+ _GxIdeMultiSelect_togglePopover.set(this, () => {
45
+ if (!this.disabled) {
46
+ this.showPopover = !this.showPopover;
47
+ }
48
+ });
49
+ _GxIdeMultiSelect_checkboxChangeHandler.set(this, (optionValue, event) => {
50
+ const target = event.target;
51
+ const isChecked = target.value === target.checkedValue;
52
+ let newValue;
53
+ if (isChecked) {
54
+ newValue = [...this.value, optionValue];
55
+ }
56
+ else {
57
+ newValue = this.value.filter(val => val !== optionValue);
58
+ }
59
+ this.gxSelectionChange.emit(newValue);
60
+ });
61
+ _GxIdeMultiSelect_removeSelectedItemHandler.set(this, (itemValue) => {
62
+ const newValue = this.value.filter(val => val !== itemValue);
63
+ this.gxSelectionChange.emit(newValue);
64
+ });
65
+ _GxIdeMultiSelect_isItemSelected.set(this, (itemValue) => {
66
+ return this.value.includes(itemValue);
67
+ });
68
+ _GxIdeMultiSelect_renderSelectedItems.set(this, () => {
69
+ if (this.value.length === 0) {
70
+ return (h("span", { class: "multi-select__placeholder body-italic-m" }, this.placeholder));
71
+ }
72
+ const selectedOptions = this.model.filter(opt => this.value.includes(opt.value));
73
+ return (h("div", { class: "multi-select__items" }, selectedOptions.map(item => (h("div", { class: "multi-select__item", key: item.value }, h("span", { class: "multi-select__caption body-regular-s" }, item.caption), h("button", { type: "button", class: "button-tertiary button-icon-only multi-select__close", onClick: e => {
74
+ e.stopPropagation();
75
+ e.preventDefault();
76
+ __classPrivateFieldGet(this, _GxIdeMultiSelect_removeSelectedItemHandler, "f").call(this, item.value);
77
+ }, "aria-label": `Remove ${item.caption}` }, h("ch-image", { class: "icon-xs", src: CLOSE_ICON, type: "mask" })))))));
78
+ });
79
+ this.showPopover = false;
80
+ this.model = [];
81
+ this.value = [];
82
+ this.placeholder = "Select options";
83
+ this.disabled = false;
84
+ }
85
+ componentDidLoad() {
86
+ if (__classPrivateFieldGet(this, _GxIdeMultiSelect_popoverEl, "f") && __classPrivateFieldGet(this, _GxIdeMultiSelect_multiButtonEl, "f")) {
87
+ __classPrivateFieldGet(this, _GxIdeMultiSelect_popoverEl, "f").actionElement = __classPrivateFieldGet(this, _GxIdeMultiSelect_multiButtonEl, "f");
88
+ }
89
+ }
90
+ render() {
91
+ return (h(Host, null, h("ch-theme", { model: CSS_BUNDLES }), h("button", { class: "combo-box multi-select__button", type: "button", ref: (el) => (__classPrivateFieldSet(this, _GxIdeMultiSelect_multiButtonEl, el, "f")), onClick: __classPrivateFieldGet(this, _GxIdeMultiSelect_togglePopover, "f"), disabled: this.disabled }, __classPrivateFieldGet(this, _GxIdeMultiSelect_renderSelectedItems, "f").call(this), h("ch-image", { class: "icon-m multi-select__chevron", src: CHEVRON_DOWN_ICON, type: "mask" })), h("ch-popover", { ref: (el) => (__classPrivateFieldSet(this, _GxIdeMultiSelect_popoverEl, el, "f")), closeOnClickOutside: true, show: this.showPopover, blockAlign: "outside-end", inlineAlign: "inside-end", inlineSizeMatch: "action-element", class: "scrollable" }, h("div", null, this.model.map(option => (h("ch-checkbox", { class: "checkbox checkbox-item", caption: option.caption, checkedValue: "true", value: __classPrivateFieldGet(this, _GxIdeMultiSelect_isItemSelected, "f").call(this, option.value) ? "true" : "false", startImgSrc: option.startImgSrc, onInput: e => __classPrivateFieldGet(this, _GxIdeMultiSelect_checkboxChangeHandler, "f").call(this, option.value, e) })))))));
92
+ }
93
+ static get is() { return "gx-ide-multi-select"; }
94
+ static get encapsulation() { return "shadow"; }
95
+ static get originalStyleUrls() {
96
+ return {
97
+ "$": ["gx-ide-multi-select.scss"]
98
+ };
99
+ }
100
+ static get styleUrls() {
101
+ return {
102
+ "$": ["gx-ide-multi-select.css"]
103
+ };
104
+ }
105
+ static get properties() {
106
+ return {
107
+ "model": {
108
+ "type": "unknown",
109
+ "mutable": false,
110
+ "complexType": {
111
+ "original": "ComboBoxModel",
112
+ "resolved": "ComboBoxItemModel[]",
113
+ "references": {
114
+ "ComboBoxModel": {
115
+ "location": "import",
116
+ "path": "@genexus/chameleon-controls-library",
117
+ "id": ""
118
+ }
119
+ }
120
+ },
121
+ "required": false,
122
+ "optional": false,
123
+ "docs": {
124
+ "tags": [],
125
+ "text": "Model with available options to select from"
126
+ },
127
+ "defaultValue": "[]"
128
+ },
129
+ "value": {
130
+ "type": "unknown",
131
+ "mutable": false,
132
+ "complexType": {
133
+ "original": "string[]",
134
+ "resolved": "string[]",
135
+ "references": {}
136
+ },
137
+ "required": false,
138
+ "optional": false,
139
+ "docs": {
140
+ "tags": [],
141
+ "text": "Currently selected item values"
142
+ },
143
+ "defaultValue": "[]"
144
+ },
145
+ "placeholder": {
146
+ "type": "string",
147
+ "mutable": false,
148
+ "complexType": {
149
+ "original": "string",
150
+ "resolved": "string",
151
+ "references": {}
152
+ },
153
+ "required": false,
154
+ "optional": false,
155
+ "docs": {
156
+ "tags": [],
157
+ "text": "Placeholder text when no items are selected"
158
+ },
159
+ "attribute": "placeholder",
160
+ "reflect": false,
161
+ "defaultValue": "\"Select options\""
162
+ },
163
+ "disabled": {
164
+ "type": "boolean",
165
+ "mutable": false,
166
+ "complexType": {
167
+ "original": "boolean",
168
+ "resolved": "boolean",
169
+ "references": {}
170
+ },
171
+ "required": false,
172
+ "optional": false,
173
+ "docs": {
174
+ "tags": [],
175
+ "text": "Disabled state"
176
+ },
177
+ "attribute": "disabled",
178
+ "reflect": false,
179
+ "defaultValue": "false"
180
+ }
181
+ };
182
+ }
183
+ static get states() {
184
+ return {
185
+ "showPopover": {}
186
+ };
187
+ }
188
+ static get events() {
189
+ return [{
190
+ "method": "gxSelectionChange",
191
+ "name": "gxSelectionChange",
192
+ "bubbles": true,
193
+ "cancelable": true,
194
+ "composed": true,
195
+ "docs": {
196
+ "tags": [],
197
+ "text": "Emitted when the selection changes"
198
+ },
199
+ "complexType": {
200
+ "original": "string[]",
201
+ "resolved": "string[]",
202
+ "references": {}
203
+ }
204
+ }];
205
+ }
206
+ static get elementRef() { return "el"; }
207
+ }
208
+ _GxIdeMultiSelect_multiButtonEl = new WeakMap(), _GxIdeMultiSelect_popoverEl = new WeakMap(), _GxIdeMultiSelect_togglePopover = new WeakMap(), _GxIdeMultiSelect_checkboxChangeHandler = new WeakMap(), _GxIdeMultiSelect_removeSelectedItemHandler = new WeakMap(), _GxIdeMultiSelect_isItemSelected = new WeakMap(), _GxIdeMultiSelect_renderSelectedItems = new WeakMap();
209
+ //# sourceMappingURL=gx-ide-multi-select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gx-ide-multi-select.js","sourceRoot":"","sources":["../../../../src/components/_helpers/multi-select/gx-ide-multi-select.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,KAAK,EACL,OAAO,EACP,KAAK,EAEN,MAAM,eAAe,CA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E,uBAAA,IAAI,wCAAgB,MAApB,IAAI,EAAiB,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAC5D,WAAW,EAAE,MAAM,CAAC,WAAW,EAC/B,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,uBAAA,IAAI,+CAAuB,MAA3B,IAAI,EAAwB,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,GAC1D,CACH,CAAC,CACE,CACK,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Prop,\n State,\n Element,\n Event,\n EventEmitter\n} from \"@stencil/core\";\nimport { getIconPath, MercuryBundles } from \"@genexus/mercury\";\nimport { ComboBoxModel } from \"@genexus/chameleon-controls-library\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/button\",\n \"components/icon\",\n \"components/checkbox\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\",\n \"components/combo-box\"\n];\n\nconst CHEVRON_DOWN_ICON = getIconPath({\n category: \"navigation\",\n name: \"chevron-down\",\n colorType: \"on-interactive\"\n});\n\nconst CLOSE_ICON = getIconPath({\n category: \"system\",\n name: \"close\",\n colorType: \"on-interactive\"\n});\n\n@Component({\n tag: \"gx-ide-multi-select\",\n styleUrl: \"gx-ide-multi-select.scss\",\n shadow: true\n})\nexport class GxIdeMultiSelect {\n #multiButtonEl: HTMLButtonElement;\n #popoverEl: HTMLChPopoverElement;\n\n @Element() el: HTMLGxIdeMultiSelectElement;\n\n @State() showPopover = false;\n\n /**\n * Model with available options to select from\n */\n @Prop() readonly model: ComboBoxModel = [];\n\n /**\n * Currently selected item values\n */\n @Prop() readonly value: string[] = [];\n\n /**\n * Placeholder text when no items are selected\n */\n @Prop() readonly placeholder: string = \"Select options\";\n\n /**\n * Disabled state\n */\n @Prop() readonly disabled: boolean = false;\n\n /**\n * Emitted when the selection changes\n */\n @Event() gxSelectionChange: EventEmitter<string[]>;\n\n componentDidLoad() {\n if (this.#popoverEl && this.#multiButtonEl) {\n this.#popoverEl.actionElement = this.#multiButtonEl;\n }\n }\n\n #togglePopover = () => {\n if (!this.disabled) {\n this.showPopover = !this.showPopover;\n }\n };\n\n #checkboxChangeHandler = (\n optionValue: string,\n event: CustomEvent | InputEvent\n ) => {\n const target = event.target as HTMLChCheckboxElement;\n const isChecked = target.value === target.checkedValue;\n\n let newValue: string[];\n if (isChecked) {\n newValue = [...this.value, optionValue];\n } else {\n newValue = this.value.filter(val => val !== optionValue);\n }\n\n this.gxSelectionChange.emit(newValue);\n };\n\n #removeSelectedItemHandler = (itemValue: string) => {\n const newValue = this.value.filter(val => val !== itemValue);\n this.gxSelectionChange.emit(newValue);\n };\n\n #isItemSelected = (itemValue: string): boolean => {\n return this.value.includes(itemValue);\n };\n\n #renderSelectedItems = () => {\n if (this.value.length === 0) {\n return (\n <span class=\"multi-select__placeholder body-italic-m\">\n {this.placeholder}\n </span>\n );\n }\n\n const selectedOptions = this.model.filter(opt =>\n this.value.includes(opt.value)\n );\n\n return (\n <div class=\"multi-select__items\">\n {selectedOptions.map(item => (\n <div class=\"multi-select__item\" key={item.value}>\n <span class=\"multi-select__caption body-regular-s\">\n {item.caption}\n </span>\n <button\n type=\"button\"\n class=\"button-tertiary button-icon-only multi-select__close\"\n onClick={e => {\n e.stopPropagation();\n e.preventDefault();\n this.#removeSelectedItemHandler(item.value);\n }}\n aria-label={`Remove ${item.caption}`}\n >\n <ch-image class=\"icon-xs\" src={CLOSE_ICON} type=\"mask\"></ch-image>\n </button>\n </div>\n ))}\n </div>\n );\n };\n\n render() {\n return (\n <Host>\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n\n <button\n class=\"combo-box multi-select__button\"\n type=\"button\"\n ref={(el: HTMLButtonElement) => (this.#multiButtonEl = el)}\n onClick={this.#togglePopover}\n disabled={this.disabled}\n >\n {this.#renderSelectedItems()}\n <ch-image\n class=\"icon-m multi-select__chevron\"\n src={CHEVRON_DOWN_ICON}\n type=\"mask\"\n />\n </button>\n\n <ch-popover\n ref={(el: HTMLChPopoverElement) => (this.#popoverEl = el)}\n closeOnClickOutside\n show={this.showPopover}\n blockAlign=\"outside-end\"\n inlineAlign=\"inside-end\"\n inlineSizeMatch=\"action-element\"\n class={\"scrollable\"}\n >\n <div>\n {this.model.map(option => (\n <ch-checkbox\n class=\"checkbox checkbox-item\"\n caption={option.caption}\n checkedValue=\"true\"\n value={this.#isItemSelected(option.value) ? \"true\" : \"false\"}\n startImgSrc={option.startImgSrc}\n onInput={e => this.#checkboxChangeHandler(option.value, e)}\n />\n ))}\n </div>\n </ch-popover>\n </Host>\n );\n }\n}\n"]}
@@ -4,62 +4,61 @@ Found on /common/helpers.tsx hiChar function is used to add a span/class to ever
4
4
  */
5
5
  :host {
6
6
  display: block;
7
- inline-size: 100%;
8
7
  }
9
8
 
10
9
  .file-item {
11
10
  display: grid;
12
- grid-template-columns: auto 1fr auto;
13
- grid-template-rows: auto;
14
- gap: var(--spacing-gap-l);
11
+ column-gap: var(--spacing-gap-l);
12
+ row-gap: var(--spacing-gap-s);
15
13
  align-items: center;
16
- border: 1px solid var(--mer-border__default);
17
- border-radius: 4px;
14
+ border-radius: var(--border-radius-s);
15
+ }
16
+ .file-item--without-actions {
17
+ grid-template-columns: max-content 1fr;
18
+ grid-template-areas: "icon name";
19
+ }
20
+ .file-item--with-actions {
21
+ grid-template-columns: max-content 1fr max-content;
22
+ grid-template-areas: "icon name actions";
18
23
  }
19
24
  .file-item__icon {
20
25
  display: flex;
21
26
  align-items: center;
27
+ grid-area: icon;
28
+ padding-block: calc(32px - var(--ch-image-size));
22
29
  }
23
30
  .file-item__name {
31
+ grid-area: name;
24
32
  overflow: hidden;
25
33
  white-space: nowrap;
26
34
  text-overflow: ellipsis;
27
- inline-size: 100%;
28
- font-weight: var(--font-style-regular);
35
+ min-inline-size: 0;
29
36
  }
30
37
  .file-item__name ch-edit {
31
38
  overflow: hidden;
32
39
  white-space: nowrap;
33
40
  text-overflow: ellipsis;
34
- inline-size: 100%;
35
- font-weight: var(--font-style-regular);
36
41
  }
37
42
  .file-item__name .label {
38
43
  overflow: hidden;
39
44
  white-space: nowrap;
40
45
  text-overflow: ellipsis;
41
- inline-size: 100%;
42
- font-weight: var(--font-style-regular);
43
46
  }
44
47
  .file-item__actions {
48
+ grid-area: actions;
45
49
  display: flex;
46
- gap: var(--spacing-gap-m);
47
50
  }
48
- .file-item__actions button:active, .file-item__actions button:focus, .file-item__actions button:hover {
49
- background-color: var(--mer-surface__hover);
50
- }
51
- .file-item__actions button:active {
52
- background-color: var(--mer-surface__pressed);
51
+ .file-item__cancel-upload {
52
+ transform: translateX(7px);
53
53
  }
54
54
  .file-item__progress-container {
55
55
  grid-column: 1/-1;
56
56
  display: flex;
57
57
  flex-direction: column;
58
58
  gap: var(--spacing-gap-xs);
59
- inline-size: 100%;
60
59
  border: 2px dashed var(--color-border-neutral-default);
61
- border-radius: 8px;
62
- padding: var(--spacing-padding-l);
60
+ border-radius: var(--border-radius-m);
61
+ padding: var(--spacing-padding-xxs) var(--spacing-padding-l) var(--spacing-padding-m) var(--spacing-padding-l);
63
62
  }
64
63
  .file-item__progress-header {
65
64
  display: flex;
@@ -68,21 +67,17 @@ Found on /common/helpers.tsx hiChar function is used to add a span/class to ever
68
67
  gap: var(--spacing-gap-l);
69
68
  }
70
69
  .file-item__uploading-text {
71
- font-style: italic;
72
70
  color: var(--color-text-neutral-disabled);
73
71
  overflow: hidden;
74
72
  white-space: nowrap;
75
73
  text-overflow: ellipsis;
76
74
  max-inline-size: calc(100% - 40px);
77
75
  }
78
- .file-item__progress-bar {
79
- inline-size: 100%;
80
- }
81
76
  .file-item__progress-bar progress {
82
- inline-size: 100%;
83
- height: 8px;
77
+ block-size: 8px;
78
+ line-height: 0;
84
79
  border: none;
85
- border-radius: 4px;
80
+ border-radius: var(--border-radius-s);
86
81
  overflow: hidden;
87
82
  }
88
83
  .file-item__progress-bar progress::-webkit-progress-bar {
@@ -71,6 +71,7 @@ export class FileItem {
71
71
  });
72
72
  this.file = undefined;
73
73
  this.editable = false;
74
+ this.componentLocale = undefined;
74
75
  this.fileDeletedCallback = undefined;
75
76
  this.fileDeletionErrorCallback = undefined;
76
77
  this.isEditing = false;
@@ -84,7 +85,25 @@ export class FileItem {
84
85
  this.currentName = this.file.name;
85
86
  }
86
87
  render() {
87
- return (h("div", { class: "file-item" }, h("ch-theme", { model: CSS_BUNDLES }), h("div", { class: "file-item__icon" }, h("ch-image", { src: FILE_ICON, class: "icon-m" })), h("div", { class: "file-item__name" }, this.isEditing ? (h("ch-edit", { value: this.currentName, autoFocus: true, onInput: __classPrivateFieldGet(this, _FileItem_handleNameChange, "f"), onBlur: __classPrivateFieldGet(this, _FileItem_handleBlur, "f"), class: "input" })) : (h("label", { class: "label" }, this.currentName))), h("div", { class: "file-item__actions" }, !this.file.pending && this.editable && (h("button", { class: "button-tertiary button-icon-only", type: "button", onClick: __classPrivateFieldGet(this, _FileItem_startEditing, "f") }, h("ch-image", { src: EDIT_ICON, class: "icon-m" }))), !this.file.pending && (h("button", { class: "button-tertiary button-icon-only", type: "button", onClick: __classPrivateFieldGet(this, _FileItem_handleDelete, "f"), "aria-label": "Delete file" }, h("ch-image", { src: DELETE_ICON, class: "icon-m" })))), this.file.pending && (h("div", { class: "file-item__progress-container" }, h("div", { class: "file-item__progress-header" }, h("span", { class: "file-item__uploading-text" }, "Uploading ", this.currentName, "..."), h("button", { class: "button-tertiary button-icon-only", type: "button", onClick: __classPrivateFieldGet(this, _FileItem_handleCancelClick, "f") }, h("ch-image", { src: CANCEL_ICON, class: "icon-m" }))), h("div", { class: "file-item__progress-bar" }, h("progress", { class: "elevation-1", value: this.file.progress, max: "100" }))))));
88
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
89
+ const displayItemActions = !this.file.pending;
90
+ const displayProgressContainer = this.file.pending;
91
+ const labelId = "progress-label-" + this.file.id;
92
+ let liAriaLabel;
93
+ if (this.file.pending) {
94
+ liAriaLabel = ((_d = (_c = (_b = (_a = this.componentLocale) === null || _a === void 0 ? void 0 : _a.fileItem) === null || _b === void 0 ? void 0 : _b.uploadingAriaLabel) === null || _c === void 0 ? void 0 : _c.replace("{fileName}", this.currentName)) === null || _d === void 0 ? void 0 : _d.replace("{fileProgress}", this.file.progress.toString())) || this.currentName;
95
+ }
96
+ else if (this.file.remoteId) {
97
+ liAriaLabel = ((_g = (_f = (_e = this.componentLocale) === null || _e === void 0 ? void 0 : _e.fileItem) === null || _f === void 0 ? void 0 : _f.uploadedSuccessfullyAriaLabel) === null || _g === void 0 ? void 0 : _g.replace("{fileName}", this.currentName)) || this.currentName;
98
+ }
99
+ else {
100
+ liAriaLabel = this.currentName;
101
+ }
102
+ return (h("li", { class: {
103
+ "file-item": true,
104
+ "file-item--without-actions": !displayItemActions,
105
+ "file-item--with-actions": displayItemActions
106
+ }, "aria-label": liAriaLabel }, h("ch-theme", { model: CSS_BUNDLES }), h("div", { class: "file-item__icon" }, h("ch-image", { disabled: !this.file.pending, src: FILE_ICON, class: "icon-m" })), h("div", { class: "file-item__name" }, this.isEditing ? (h("ch-edit", { accessibleName: (_k = (_j = (_h = this.componentLocale) === null || _h === void 0 ? void 0 : _h.fileItem) === null || _j === void 0 ? void 0 : _j.editNamePlaceholderAriaLabel) === null || _k === void 0 ? void 0 : _k.replace("{fileName}", this.currentName), value: this.currentName, autoFocus: true, onInput: __classPrivateFieldGet(this, _FileItem_handleNameChange, "f"), onBlur: __classPrivateFieldGet(this, _FileItem_handleBlur, "f"), class: "input", id: labelId })) : (h("span", { class: "label", id: labelId }, this.currentName))), displayItemActions ? (h("div", { class: "file-item__actions" }, !this.file.pending && this.editable && (h("button", { class: "button-tertiary button-icon-only", type: "button", onClick: __classPrivateFieldGet(this, _FileItem_startEditing, "f") }, h("ch-image", { src: EDIT_ICON, class: "icon-m" }))), !this.file.pending && (h("button", { class: "button-tertiary button-icon-only", type: "button", onClick: __classPrivateFieldGet(this, _FileItem_handleDelete, "f"), "aria-label": "Delete file" }, h("ch-image", { src: DELETE_ICON, class: "icon-m" }))))) : (null), displayProgressContainer && (h("div", { class: "file-item__progress-container" }, h("div", { class: "file-item__progress-header" }, h("span", { class: "file-item__uploading-text typography-body-italic-s" }, "Uploading ", this.currentName, "..."), h("button", { "aria-label": ((_o = (_m = (_l = this.componentLocale) === null || _l === void 0 ? void 0 : _l.fileItem) === null || _m === void 0 ? void 0 : _m.cancelUploadButtonAriaLabel) === null || _o === void 0 ? void 0 : _o.replace("{fileName}", this.currentName)) || "Cancel upload", class: "button-tertiary button-icon-only file-item__cancel-upload", type: "button", onClick: __classPrivateFieldGet(this, _FileItem_handleCancelClick, "f") }, h("ch-image", { src: CANCEL_ICON, class: "icon-m" }))), h("div", { class: "file-item__progress-bar" }, h("progress", { class: "elevation-1", value: this.file.progress, max: "100", "aria-labelledby": labelId }))))));
88
107
  }
89
108
  static get is() { return "gx-ide-file-item"; }
90
109
  static get encapsulation() { return "shadow"; }
@@ -139,6 +158,23 @@ export class FileItem {
139
158
  "reflect": false,
140
159
  "defaultValue": "false"
141
160
  },
161
+ "componentLocale": {
162
+ "type": "any",
163
+ "mutable": false,
164
+ "complexType": {
165
+ "original": "any",
166
+ "resolved": "any",
167
+ "references": {}
168
+ },
169
+ "required": false,
170
+ "optional": true,
171
+ "docs": {
172
+ "tags": [],
173
+ "text": "Component locale strings"
174
+ },
175
+ "attribute": "component-locale",
176
+ "reflect": false
177
+ },
142
178
  "fileDeletedCallback": {
143
179
  "type": "unknown",
144
180
  "mutable": false,
@@ -1 +1 @@
1
- {"version":3,"file":"file-item.js","sourceRoot":"","sources":["../../../../src/components/file-uploader/file-item/file-item.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n h,\n Prop,\n State,\n Event,\n EventEmitter,\n Watch\n} from \"@stencil/core\";\nimport { getIconPath, MercuryBundles } from \"@genexus/mercury\";\nimport { ChEditCustomEvent } from \"@genexus/chameleon-controls-library\";\nimport { FileUploadState } from \"../types\";\n\nconst FILE_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"file\",\n colorType: \"primary\"\n});\n\nconst EDIT_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"edit\",\n colorType: \"primary\"\n});\n\nconst DELETE_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"delete\",\n colorType: \"primary\"\n});\n\nconst CANCEL_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"close\",\n colorType: \"primary\"\n});\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/button\",\n \"components/icon\",\n \"components/edit\",\n \"utils/typography\",\n \"utils/spacing\",\n \"utils/form\",\n \"utils/layout\",\n \"utils/elevation\"\n];\n\n@Component({\n tag: \"gx-ide-file-item\",\n styleUrl: \"file-item.scss\",\n shadow: true\n})\nexport class FileItem {\n /** File state containing upload information */\n @Prop() readonly file!: FileUploadState;\n\n /** Whether the file name can be edited */\n @Prop() readonly editable: boolean = false;\n\n /** Callback when a file is deleted */\n @Prop() readonly fileDeletedCallback?: (fileId: string) => 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 /** Updates current name when file prop changes */\n @Watch(\"file\")\n handleFileChange(newFile: FileUploadState) {\n this.currentName = newFile.name;\n }\n\n @State() isEditing: boolean = false;\n @State() currentName: string;\n\n /** Emitted when the file name is changed */\n @Event() fileNameChange: EventEmitter<{ id: string; name: string }>;\n\n /** Emitted when the file is deleted */\n @Event() fileDelete: EventEmitter<string>;\n\n /** Emitted when the file upload is cancelled */\n @Event() fileCancel: EventEmitter<string>;\n\n componentWillLoad() {\n this.currentName = this.file.name;\n }\n\n #handleNameChange = (event: ChEditCustomEvent<string> | InputEvent) => {\n const newName = (event as CustomEvent<string>).detail;\n\n if (newName && newName !== this.currentName) {\n this.currentName = newName;\n this.fileNameChange.emit({\n id: this.file.id,\n name: newName\n });\n }\n };\n\n #handleBlur = () => {\n this.isEditing = false;\n };\n\n /** Handles file deletion */\n #handleDelete = () => {\n this.fileDelete.emit(this.file.id);\n };\n\n /** Handles upload cancellation */\n #handleCancelClick = (e: MouseEvent) => {\n e.preventDefault();\n this.fileCancel.emit(this.file.id);\n };\n\n /** Starts file name editing */\n #startEditing = () => {\n if (this.editable) {\n this.isEditing = true;\n }\n };\n\n render() {\n return (\n <div class=\"file-item\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <div class=\"file-item__icon\">\n <ch-image src={FILE_ICON} class=\"icon-m\" />\n </div>\n\n <div class=\"file-item__name\">\n {this.isEditing ? (\n <ch-edit\n value={this.currentName}\n autoFocus={true}\n onInput={this.#handleNameChange}\n onBlur={this.#handleBlur}\n class=\"input\"\n />\n ) : (\n <label class=\"label\">{this.currentName}</label>\n )}\n </div>\n\n <div class=\"file-item__actions\">\n {!this.file.pending && this.editable && (\n <button\n class=\"button-tertiary button-icon-only\"\n type=\"button\"\n onClick={this.#startEditing}\n >\n <ch-image src={EDIT_ICON} class=\"icon-m\" />\n </button>\n )}\n {!this.file.pending && (\n <button\n class=\"button-tertiary button-icon-only\"\n type=\"button\"\n onClick={this.#handleDelete}\n aria-label=\"Delete file\"\n >\n <ch-image src={DELETE_ICON} class=\"icon-m\" />\n </button>\n )}\n </div>\n\n {this.file.pending && (\n <div class=\"file-item__progress-container\">\n <div class=\"file-item__progress-header\">\n <span class=\"file-item__uploading-text\">\n Uploading {this.currentName}...\n </span>\n <button\n class=\"button-tertiary button-icon-only\"\n type=\"button\"\n onClick={this.#handleCancelClick}\n >\n <ch-image src={CANCEL_ICON} class=\"icon-m\" />\n </button>\n </div>\n <div class=\"file-item__progress-bar\">\n <progress\n class=\"elevation-1\"\n value={this.file.progress}\n max=\"100\"\n />\n </div>\n </div>\n )}\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"file-item.js","sourceRoot":"","sources":["../../../../src/components/file-uploader/file-item/file-item.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,SAAS,EACT,CAAC,EACD,IAAI,EACJ,KAAK,EACL,KAAK,EAEL,KAAK,EACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAI/D,MAAM,SAAS,GAAG,WAAW,CAAC;IAC5B,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,WAAW,CAAC;IAC5B,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,WAAW,CAAC;IAC9B,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,WAAW,CAAC;IAC9B,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,OAAO;IACb,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,YAAY;IACZ,cAAc;IACd,iBAAiB;CAClB,CAAC;AAOF,MAAM,OAAO,QAAQ;;QAyCnB,qCAAoB,CAAC,KAA6C,EAAE,EAAE;YACpE,MAAM,OAAO,GAAI,KAA6B,CAAC,MAAM,CAAC;YAEtD,IAAI,OAAO,IAAI,OAAO,KAAK,IAAI,CAAC,WAAW,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AAO,EAAE,uBAAA,IAAI,mCAAmB;wBAEhC,gBAAU,GAAG,EAAE,WAAW,EAAE,KAAK,EAAC,QAAQ,GAAG,CACtC,CACL;gBACN,WAAK,KAAK,EAAC,yBAAyB;oBAClC,gBACE,KAAK,EAAC,aAAa,EACnB,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EACzB,GAAG,EAAC,KAAK,qBACQ,OAAO,GACxB,CACE,CACF,CACP,CACE,CACN,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n h,\n Prop,\n State,\n Event,\n EventEmitter,\n Watch\n} from \"@stencil/core\";\nimport { getIconPath, MercuryBundles } from \"@genexus/mercury\";\nimport { ChEditCustomEvent } from \"@genexus/chameleon-controls-library\";\nimport { FileUploadState } from \"../types\";\n\nconst FILE_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"file\",\n colorType: \"primary\"\n});\n\nconst EDIT_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"edit\",\n colorType: \"primary\"\n});\n\nconst DELETE_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"delete\",\n colorType: \"primary\"\n});\n\nconst CANCEL_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"close\",\n colorType: \"primary\"\n});\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/button\",\n \"components/icon\",\n \"components/edit\",\n \"utils/typography\",\n \"utils/spacing\",\n \"utils/form\",\n \"utils/layout\",\n \"utils/elevation\"\n];\n\n@Component({\n tag: \"gx-ide-file-item\",\n styleUrl: \"file-item.scss\",\n shadow: true\n})\nexport class FileItem {\n /** File state containing upload information */\n @Prop() readonly file!: FileUploadState;\n\n /** Whether the file name can be edited */\n @Prop() readonly editable: boolean = false;\n\n /** Component locale strings */\n @Prop() readonly componentLocale?: any;\n\n /** Callback when a file is deleted */\n @Prop() readonly fileDeletedCallback?: (fileId: string) => 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 /** Updates current name when file prop changes */\n @Watch(\"file\")\n handleFileChange(newFile: FileUploadState) {\n this.currentName = newFile.name;\n }\n\n @State() isEditing: boolean = false;\n @State() currentName: string;\n\n /** Emitted when the file name is changed */\n @Event() fileNameChange: EventEmitter<{ id: string; name: string }>;\n\n /** Emitted when the file is deleted */\n @Event() fileDelete: EventEmitter<string>;\n\n /** Emitted when the file upload is cancelled */\n @Event() fileCancel: EventEmitter<string>;\n\n componentWillLoad() {\n this.currentName = this.file.name;\n }\n\n #handleNameChange = (event: ChEditCustomEvent<string> | InputEvent) => {\n const newName = (event as CustomEvent<string>).detail;\n\n if (newName && newName !== this.currentName) {\n this.currentName = newName;\n this.fileNameChange.emit({\n id: this.file.id,\n name: newName\n });\n }\n };\n\n #handleBlur = () => {\n this.isEditing = false;\n };\n\n /** Handles file deletion */\n #handleDelete = () => {\n this.fileDelete.emit(this.file.id);\n };\n\n /** Handles upload cancellation */\n #handleCancelClick = (e: MouseEvent) => {\n e.preventDefault();\n this.fileCancel.emit(this.file.id);\n };\n\n /** Starts file name editing */\n #startEditing = () => {\n if (this.editable) {\n this.isEditing = true;\n }\n };\n\n render() {\n\n const displayItemActions = !this.file.pending;\n const displayProgressContainer = this.file.pending;\n const labelId = \"progress-label-\" + this.file.id;\n\n let liAriaLabel: string;\n if (this.file.pending) {\n liAriaLabel = this.componentLocale?.fileItem?.uploadingAriaLabel\n ?.replace(\"{fileName}\", this.currentName)\n ?.replace(\"{fileProgress}\", this.file.progress.toString()) || this.currentName;\n } else if (this.file.remoteId) {\n liAriaLabel = this.componentLocale?.fileItem?.uploadedSuccessfullyAriaLabel\n ?.replace(\"{fileName}\", this.currentName) || this.currentName;\n } else {\n liAriaLabel = this.currentName;\n }\n\n return (\n <li class={{\n \"file-item\": true,\n \"file-item--without-actions\": !displayItemActions,\n \"file-item--with-actions\": displayItemActions\n }}\n aria-label={liAriaLabel}\n >\n\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n\n <div class=\"file-item__icon\">\n <ch-image disabled={!this.file.pending} src={FILE_ICON} class=\"icon-m\" />\n </div>\n\n <div class=\"file-item__name\">\n {this.isEditing ? (\n <ch-edit\n accessibleName={this.componentLocale?.fileItem?.editNamePlaceholderAriaLabel\n ?.replace(\"{fileName}\", this.currentName)}\n value={this.currentName}\n autoFocus={true}\n onInput={this.#handleNameChange}\n onBlur={this.#handleBlur}\n class=\"input\"\n id={labelId}\n />\n ) : (\n <span class=\"label\" id={labelId}>{this.currentName}</span>\n )}\n </div>\n\n {displayItemActions ? (\n <div class=\"file-item__actions\">\n {!this.file.pending && this.editable && (\n <button\n class=\"button-tertiary button-icon-only\"\n type=\"button\"\n onClick={this.#startEditing}\n >\n <ch-image src={EDIT_ICON} class=\"icon-m\" />\n </button>\n )}\n {!this.file.pending && (\n <button\n class=\"button-tertiary button-icon-only\"\n type=\"button\"\n onClick={this.#handleDelete}\n aria-label=\"Delete file\"\n >\n <ch-image src={DELETE_ICON} class=\"icon-m\" />\n </button>\n )}\n </div>\n ) : (\n null\n )}\n\n {displayProgressContainer && (\n <div class=\"file-item__progress-container\">\n <div class=\"file-item__progress-header\">\n <span class=\"file-item__uploading-text typography-body-italic-s\">\n Uploading {this.currentName}...\n </span>\n <button\n aria-label={this.componentLocale?.fileItem?.cancelUploadButtonAriaLabel\n ?.replace(\"{fileName}\", this.currentName) || \"Cancel upload\"}\n class=\"button-tertiary button-icon-only file-item__cancel-upload\"\n type=\"button\"\n onClick={this.#handleCancelClick}\n >\n <ch-image src={CANCEL_ICON} class=\"icon-m\" />\n </button>\n </div>\n <div class=\"file-item__progress-bar\">\n <progress\n class=\"elevation-1\"\n value={this.file.progress}\n max=\"100\"\n aria-labelledby={labelId}\n />\n </div>\n </div>\n )}\n </li>\n );\n }\n}\n"]}
@@ -119,26 +119,22 @@ button.button-secondary {
119
119
  }
120
120
 
121
121
  :host {
122
- display: block;
122
+ display: grid;
123
123
  inline-size: 100%;
124
124
  block-size: 100%;
125
- padding-inline-end: 0 !important;
126
125
  }
127
126
 
128
127
  .file-uploader-dialog {
129
- display: flex;
130
- flex-direction: column;
128
+ display: grid;
129
+ grid-template-rows: 1fr max-content;
131
130
  block-size: 100%;
131
+ min-block-size: 0;
132
132
  position: relative;
133
133
  }
134
134
  .file-uploader-dialog .dialog-content {
135
- flex: 1;
136
135
  min-block-size: 0;
137
136
  overflow: auto;
138
137
  }
139
- .file-uploader-dialog .dialog-footer {
140
- padding-inline-end: var(--spacing-body-inline-end);
141
- }
142
138
 
143
139
  .file-uploader {
144
140
  display: flex;
@@ -156,20 +152,20 @@ button.button-secondary {
156
152
  position: sticky;
157
153
  top: 0;
158
154
  z-index: 1;
159
- background-color: var(--color-accent-surface-elevation-1);
160
155
  display: flex;
161
156
  justify-content: space-between;
162
157
  align-items: center;
163
- padding-inline-end: var(--spacing-body-inline-end);
164
158
  }
165
159
  .file-uploader__list-content {
166
160
  flex: 1;
167
161
  overflow-y: auto;
168
162
  display: flex;
169
163
  flex-direction: column;
170
- gap: var(--spacing-gap-m);
171
- padding-inline-end: var(--spacing-body-inline-end);
172
- padding-block-end: 16px;
164
+ gap: var(--spacing-gap-l);
165
+ list-style: none;
166
+ margin: 0;
167
+ padding: 0;
168
+ padding-block-end: var(--spacing-padding-l);
173
169
  }
174
170
  .file-uploader__list-title-container {
175
171
  display: flex;
@@ -182,11 +178,8 @@ button.button-secondary {
182
178
  flex-direction: column;
183
179
  align-items: center;
184
180
  justify-content: center;
185
- inline-size: calc(100% - var(--spacing-body-inline-end));
186
- block-size: calc(100% - 12px);
187
- min-block-size: 200px;
188
- margin-block-end: 12px;
189
- background: var(--color-accent-surface-elevation-1);
181
+ inline-size: 100%;
182
+ block-size: 100%;
190
183
  border: 2px dashed var(--color-border-neutral-default);
191
184
  border-radius: 8px;
192
185
  transition: border-color 0.3s ease, background-color 0.3s ease, opacity 0.3s ease;
@@ -204,10 +197,6 @@ button.button-secondary {
204
197
  margin-block-start: 8px;
205
198
  }
206
199
 
207
- .hidden-input {
208
- display: none;
209
- }
210
-
211
200
  .label-primary-row {
212
201
  display: flex;
213
202
  align-items: center;
@@ -22,7 +22,7 @@ import { Host, h } from "@stencil/core";
22
22
  import { getIconPath } from "@genexus/mercury";
23
23
  import { Locale } from "../../common/locale";
24
24
  const PLUS_ICON = getIconPath({
25
- category: "gemini-tools",
25
+ category: "system",
26
26
  name: "add",
27
27
  colorType: "primary"
28
28
  });
@@ -310,19 +310,22 @@ export class FileUploader {
310
310
  this.fileStates.clear();
311
311
  }
312
312
  render() {
313
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
314
- return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("input", { type: "file", class: "hidden-input", multiple: this.multiple, accept: (_a = this.types) === null || _a === void 0 ? void 0 : _a.map(type => (type.startsWith(".") ? type : `.${type}`)).join(","), onChange: __classPrivateFieldGet(this, _FileUploader_handleFileInput, "f"), ref: el => (__classPrivateFieldSet(this, _FileUploader_fileInputEl, el, "f")), "aria-hidden": "true", tabIndex: -1, style: { display: "none" } }), h("div", { class: "file-uploader-dialog" }, h("div", { class: "dialog-content" }, this.isDragging || this.fileStates.size === 0 ? (h("div", { class: {
315
- "file-uploader__drop-zone": true,
313
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
314
+ return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("input", { type: "file", hidden: true, multiple: this.multiple, accept: (_a = this.types) === null || _a === void 0 ? void 0 : _a.map(type => (type.startsWith(".") ? type : `.${type}`)).join(","), onChange: __classPrivateFieldGet(this, _FileUploader_handleFileInput, "f"), ref: el => (__classPrivateFieldSet(this, _FileUploader_fileInputEl, el, "f")), "aria-hidden": "true", tabIndex: -1 }), h("div", { class: "file-uploader-dialog" }, h("div", { class: "dialog-content" }, this.isDragging || this.fileStates.size === 0 ? (h("div", { class: {
315
+ "file-uploader__drop-zone elevation-1": true,
316
316
  "file-uploader__drop-zone--dragging": this.isDragging
317
317
  }, onDragEnter: __classPrivateFieldGet(this, _FileUploader_handleDragEnter, "f"), onDragLeave: __classPrivateFieldGet(this, _FileUploader_handleDragLeave, "f"), onDragOver: __classPrivateFieldGet(this, _FileUploader_handleDragOver, "f"), onDrop: __classPrivateFieldGet(this, _FileUploader_handleDrop, "f") }, h("button", { class: "button-tertiary button-icon-and-text", type: "button", onClick: __classPrivateFieldGet(this, _FileUploader_handleFileSelect, "f") }, h("ch-image", { class: "icon-m", src: PLUS_ICON }), h("label", { class: "label" }, this.multiple
318
318
  ? (_b = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _b === void 0 ? void 0 : _b.header.uploadButtonMultiple
319
319
  : (_c = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _c === void 0 ? void 0 : _c.header.uploadButtonSingle)), h("div", { class: "text-container" }, h("div", { class: "label-primary-row" }, h("label", { class: "label" }, this.label || ((_d = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _d === void 0 ? void 0 : _d.header.orText)), h("label", { class: "label" }, (_e = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _e === void 0 ? void 0 : _e.header.dragAndDrop)), h("span", { class: "caption" }, this.types && this.types.length > 0
320
320
  ? (_f = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _f === void 0 ? void 0 : _f.header.acceptedFiles.replace("{0}", this.types.join(", "))
321
- : (_g = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _g === void 0 ? void 0 : _g.header.allFilesAccepted)))) : (h("div", { class: "file-uploader__list" }, h("div", { class: "file-uploader__list-header spacing-body-block-end" }, h("div", { class: "file-uploader__list-title-container" }, h("label", { class: "label" }, this.label ||
321
+ : (_g = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _g === void 0 ? void 0 : _g.header.allFilesAccepted)))) : (h("div", { class: "file-uploader__list" }, h("div", { class: "file-uploader__list-header elevation-1 spacing-body-block-end spacing-inline-end" }, h("div", { class: "file-uploader__list-title-container" }, h("label", { class: "label" }, this.label ||
322
322
  ((_h = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _h === void 0 ? void 0 : _h.fileList.attachedFiles)), h("span", { class: "caption" }, (_j = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _j === void 0 ? void 0 : _j.fileList.filesCount.replace("{0}", this.fileStates.size.toString()))), this.multiple && (h("button", { class: "button-tertiary button-icon-and-text", type: "button", onClick: __classPrivateFieldGet(this, _FileUploader_handleFileSelect, "f") }, h("ch-image", { class: "icon-m", src: PLUS_ICON }), h("label", { class: "label" }, this.multiple
323
323
  ? (_k = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _k === void 0 ? void 0 : _k.header.uploadButtonMultiple
324
- : (_l = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _l === void 0 ? void 0 : _l.header.uploadButtonSingle)))), h("div", { class: "file-uploader__list-content scrollable" }, Array.from(this.fileStates.values()).map(file => (h("gx-ide-file-item", { key: file.id, file: file, editable: this.canEditName, onFileNameChange: __classPrivateFieldGet(this, _FileUploader_handleNameChange, "f"), onFileDelete: __classPrivateFieldGet(this, _FileUploader_handleFileCancel, "f"), onFileCancel: __classPrivateFieldGet(this, _FileUploader_handleFileCancel, "f") }))))))), h("div", { class: "dialog-footer dialog-footer dialog-footer-with-border" }, h("div", { class: "buttons-spacer" }, h("button", { class: "button-secondary", type: "button", onClick: __classPrivateFieldGet(this, _FileUploader_handleCancel, "f") }, (_m = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _m === void 0 ? void 0 : _m.buttons.cancel), h("button", { class: "button-primary", type: "button", onClick: __classPrivateFieldGet(this, _FileUploader_handleConfirm, "f"), disabled: this.fileStates.size === 0 ||
325
- Array.from(this.fileStates.values()).some(file => file.pending) }, (_o = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _o === void 0 ? void 0 : _o.buttons.confirm))))));
324
+ : (_l = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _l === void 0 ? void 0 : _l.header.uploadButtonSingle)))), h("ul", { class: "file-uploader__list-content scrollable spacing-inline-end spacing-block-end", "aria-live": "polite", "aria-label": (_m = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _m === void 0 ? void 0 : _m.fileList.selectedFilesAriaLabel }, Array.from(this.fileStates.values()).map(file => (h("gx-ide-file-item", { key: file.id, file: file, editable: this.canEditName, componentLocale: __classPrivateFieldGet(this, _FileUploader__componentLocale, "f"), onFileNameChange: __classPrivateFieldGet(this, _FileUploader_handleNameChange, "f"), onFileDelete: __classPrivateFieldGet(this, _FileUploader_handleFileCancel, "f"), onFileCancel: __classPrivateFieldGet(this, _FileUploader_handleFileCancel, "f") }))))))), h("div", { class: {
325
+ "dialog-footer": true,
326
+ "dialog-footer-with-border": this.fileStates.size > 0
327
+ } }, h("div", { class: "buttons-spacer" }, h("button", { class: "button-secondary", type: "button", onClick: __classPrivateFieldGet(this, _FileUploader_handleCancel, "f") }, (_o = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _o === void 0 ? void 0 : _o.buttons.cancel), h("button", { class: "button-primary", type: "button", onClick: __classPrivateFieldGet(this, _FileUploader_handleConfirm, "f"), disabled: this.fileStates.size === 0 ||
328
+ Array.from(this.fileStates.values()).some(file => file.pending) }, (_p = __classPrivateFieldGet(this, _FileUploader__componentLocale, "f")) === null || _p === void 0 ? void 0 : _p.buttons.confirm))))));
326
329
  }
327
330
  static get is() { return "gx-ide-file-uploader"; }
328
331
  static get encapsulation() { return "shadow"; }