@genexus/genexus-ide-ui 1.1.13 → 1.1.15

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 (142) hide show
  1. package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
  2. package/dist/cjs/gx-ide-about.cjs.entry.js +29 -15
  3. package/dist/cjs/gx-ide-about.cjs.entry.js.map +1 -1
  4. package/dist/cjs/gx-ide-bpm-export-xpdl.cjs.entry.js +2 -2
  5. package/dist/cjs/gx-ide-bpm-export-xpdl.cjs.entry.js.map +1 -1
  6. package/dist/cjs/gx-ide-data-type-selector.cjs.entry.js +121 -40
  7. package/dist/cjs/gx-ide-data-type-selector.cjs.entry.js.map +1 -1
  8. package/dist/cjs/gx-ide-empty-state.cjs.entry.js +2 -2
  9. package/dist/cjs/gx-ide-empty-state.cjs.entry.js.map +1 -1
  10. package/dist/cjs/gx-ide-file-uploader.cjs.entry.js +0 -13
  11. package/dist/cjs/gx-ide-file-uploader.cjs.entry.js.map +1 -1
  12. package/dist/cjs/gx-ide-plugin-details.cjs.entry.js +201 -0
  13. package/dist/cjs/gx-ide-plugin-details.cjs.entry.js.map +1 -0
  14. package/dist/cjs/gx-ide-plugin-explorer.cjs.entry.js +159 -0
  15. package/dist/cjs/gx-ide-plugin-explorer.cjs.entry.js.map +1 -0
  16. package/dist/cjs/gx-ide-sc-chat-container.cjs.entry.js +0 -1
  17. package/dist/cjs/gx-ide-sc-chat-container.cjs.entry.js.map +1 -1
  18. package/dist/cjs/loader.cjs.js +1 -1
  19. package/dist/collection/collection-manifest.json +3 -1
  20. package/dist/collection/components/_helpers/empty-state/gx-ide-empty-state.css +4 -0
  21. package/dist/collection/components/_helpers/empty-state/gx-ide-empty-state.js +1 -1
  22. package/dist/collection/components/_helpers/empty-state/gx-ide-empty-state.js.map +1 -1
  23. package/dist/collection/components/{_branding/about → about}/about.css +44 -15
  24. package/dist/collection/components/{_branding/about → about}/about.js +46 -62
  25. package/dist/collection/components/about/about.js.map +1 -0
  26. package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/langs/about.lang.en.json +3 -3
  27. package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/langs/about.lang.ja.json +3 -3
  28. package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/langs/about.lang.zh.json +3 -3
  29. package/dist/collection/components/bpm/export-xpdl/bpm-export-xpdl.js +2 -2
  30. package/dist/collection/components/bpm/export-xpdl/bpm-export-xpdl.js.map +1 -1
  31. package/dist/collection/components/data-type-selector/data-type-selector.css +1 -0
  32. package/dist/collection/components/data-type-selector/data-type-selector.js +165 -43
  33. package/dist/collection/components/data-type-selector/data-type-selector.js.map +1 -1
  34. package/dist/collection/components/data-type-selector/gx-ide-assets/data-type-selector/langs/data-type-selector.lang.en.json +1 -1
  35. package/dist/collection/components/data-type-selector/helpers.js +2 -0
  36. package/dist/collection/components/data-type-selector/helpers.js.map +1 -1
  37. package/dist/collection/components/file-uploader/file-uploader.js +0 -13
  38. package/dist/collection/components/file-uploader/file-uploader.js.map +1 -1
  39. package/dist/collection/components/plugin-details/gx-ide-assets/plugin-details/langs/plugin-details.lang.en.json +9 -0
  40. package/dist/collection/components/plugin-details/gx-ide-assets/plugin-details/langs/plugin-details.lang.ja.json +9 -0
  41. package/dist/collection/components/plugin-details/gx-ide-assets/plugin-details/langs/plugin-details.lang.zh.json +9 -0
  42. package/dist/collection/components/plugin-details/plugin-details.css +168 -0
  43. package/dist/collection/components/plugin-details/plugin-details.js +292 -0
  44. package/dist/collection/components/plugin-details/plugin-details.js.map +1 -0
  45. package/dist/collection/components/plugin-explorer/gx-ide-assets/plugin-explorer/images/plugin-icon.svg +10 -0
  46. package/dist/collection/components/plugin-explorer/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.en.json +10 -0
  47. package/dist/collection/components/plugin-explorer/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.ja.json +10 -0
  48. package/dist/collection/components/plugin-explorer/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.zh.json +10 -0
  49. package/dist/collection/components/plugin-explorer/plugin-explorer.css +106 -0
  50. package/dist/collection/components/plugin-explorer/plugin-explorer.js +263 -0
  51. package/dist/collection/components/plugin-explorer/plugin-explorer.js.map +1 -0
  52. package/dist/collection/components/team-dev/bring-changes/gx-ide-assets/team-dev-bring-changes/langs/team-dev-bring-changes.lang.ja.json +45 -45
  53. package/dist/collection/pages/assets/images/plugin/docker-iso.svg +12 -0
  54. package/dist/collection/showcase/chat-container/callbacks.js +0 -1
  55. package/dist/collection/showcase/chat-container/callbacks.js.map +1 -1
  56. package/dist/collection/testing/locale.e2e.js +2 -0
  57. package/dist/collection/testing/locale.e2e.js.map +1 -1
  58. package/dist/components/gx-ide-about.js +32 -19
  59. package/dist/components/gx-ide-about.js.map +1 -1
  60. package/dist/components/gx-ide-bpm-export-xpdl.js +2 -2
  61. package/dist/components/gx-ide-bpm-export-xpdl.js.map +1 -1
  62. package/dist/components/gx-ide-data-type-selector.js +126 -42
  63. package/dist/components/gx-ide-data-type-selector.js.map +1 -1
  64. package/dist/components/gx-ide-empty-state2.js +2 -2
  65. package/dist/components/gx-ide-empty-state2.js.map +1 -1
  66. package/dist/components/gx-ide-file-uploader.js +0 -13
  67. package/dist/components/gx-ide-file-uploader.js.map +1 -1
  68. package/dist/components/gx-ide-plugin-details.d.ts +11 -0
  69. package/dist/components/gx-ide-plugin-details.js +222 -0
  70. package/dist/components/gx-ide-plugin-details.js.map +1 -0
  71. package/dist/components/gx-ide-plugin-explorer.d.ts +11 -0
  72. package/dist/components/gx-ide-plugin-explorer.js +194 -0
  73. package/dist/components/gx-ide-plugin-explorer.js.map +1 -0
  74. package/dist/components/gx-ide-sc-chat-container.js +0 -1
  75. package/dist/components/gx-ide-sc-chat-container.js.map +1 -1
  76. package/dist/esm/genexus-ide-ui.js +1 -1
  77. package/dist/esm/gx-ide-about.entry.js +29 -15
  78. package/dist/esm/gx-ide-about.entry.js.map +1 -1
  79. package/dist/esm/gx-ide-bpm-export-xpdl.entry.js +2 -2
  80. package/dist/esm/gx-ide-bpm-export-xpdl.entry.js.map +1 -1
  81. package/dist/esm/gx-ide-data-type-selector.entry.js +121 -40
  82. package/dist/esm/gx-ide-data-type-selector.entry.js.map +1 -1
  83. package/dist/esm/gx-ide-empty-state.entry.js +2 -2
  84. package/dist/esm/gx-ide-empty-state.entry.js.map +1 -1
  85. package/dist/esm/gx-ide-file-uploader.entry.js +0 -13
  86. package/dist/esm/gx-ide-file-uploader.entry.js.map +1 -1
  87. package/dist/esm/gx-ide-plugin-details.entry.js +197 -0
  88. package/dist/esm/gx-ide-plugin-details.entry.js.map +1 -0
  89. package/dist/esm/gx-ide-plugin-explorer.entry.js +155 -0
  90. package/dist/esm/gx-ide-plugin-explorer.entry.js.map +1 -0
  91. package/dist/esm/gx-ide-sc-chat-container.entry.js +0 -1
  92. package/dist/esm/gx-ide-sc-chat-container.entry.js.map +1 -1
  93. package/dist/esm/loader.js +1 -1
  94. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  95. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
  96. package/dist/genexus-ide-ui/gx-ide-assets/about/langs/about.lang.en.json +3 -3
  97. package/dist/genexus-ide-ui/gx-ide-assets/about/langs/about.lang.ja.json +3 -3
  98. package/dist/genexus-ide-ui/gx-ide-assets/about/langs/about.lang.zh.json +3 -3
  99. package/dist/genexus-ide-ui/gx-ide-assets/data-type-selector/langs/data-type-selector.lang.en.json +1 -1
  100. package/dist/genexus-ide-ui/gx-ide-assets/plugin-details/langs/plugin-details.lang.en.json +9 -0
  101. package/dist/genexus-ide-ui/gx-ide-assets/plugin-details/langs/plugin-details.lang.ja.json +9 -0
  102. package/dist/genexus-ide-ui/gx-ide-assets/plugin-details/langs/plugin-details.lang.zh.json +9 -0
  103. package/dist/genexus-ide-ui/gx-ide-assets/plugin-explorer/images/plugin-icon.svg +10 -0
  104. package/dist/genexus-ide-ui/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.en.json +10 -0
  105. package/dist/genexus-ide-ui/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.ja.json +10 -0
  106. package/dist/genexus-ide-ui/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.zh.json +10 -0
  107. package/dist/genexus-ide-ui/gx-ide-assets/team-dev-bring-changes/langs/team-dev-bring-changes.lang.ja.json +45 -45
  108. package/dist/genexus-ide-ui/{p-a47d71eb.entry.js → p-4328be14.entry.js} +7 -7
  109. package/dist/genexus-ide-ui/p-4328be14.entry.js.map +1 -0
  110. package/dist/genexus-ide-ui/p-476b74a1.entry.js +109 -0
  111. package/dist/genexus-ide-ui/p-476b74a1.entry.js.map +1 -0
  112. package/dist/genexus-ide-ui/{p-6d996621.entry.js → p-4e6425f3.entry.js} +1 -2
  113. package/dist/genexus-ide-ui/p-4e6425f3.entry.js.map +1 -0
  114. package/dist/genexus-ide-ui/p-641c79a9.entry.js +198 -0
  115. package/dist/genexus-ide-ui/p-641c79a9.entry.js.map +1 -0
  116. package/dist/genexus-ide-ui/p-6b4fdf55.entry.js +344 -0
  117. package/dist/genexus-ide-ui/p-6b4fdf55.entry.js.map +1 -0
  118. package/dist/genexus-ide-ui/{p-17dc4c9c.entry.js → p-7d7cf30d.entry.js} +35 -51
  119. package/dist/genexus-ide-ui/p-7d7cf30d.entry.js.map +1 -0
  120. package/dist/genexus-ide-ui/p-84c1c1bb.entry.js +270 -0
  121. package/dist/genexus-ide-ui/p-84c1c1bb.entry.js.map +1 -0
  122. package/dist/genexus-ide-ui/{p-844b7117.entry.js → p-86365635.entry.js} +3 -3
  123. package/dist/genexus-ide-ui/p-86365635.entry.js.map +1 -0
  124. package/dist/types/components/{_branding/about → about}/about.d.ts +6 -10
  125. package/dist/types/components/data-type-selector/data-type-selector.d.ts +16 -12
  126. package/dist/types/components/plugin-details/plugin-details.d.ts +55 -0
  127. package/dist/types/components/plugin-explorer/plugin-explorer.d.ts +43 -0
  128. package/dist/types/components.d.ts +126 -26
  129. package/package.json +1 -1
  130. package/dist/collection/components/_branding/about/about.js.map +0 -1
  131. package/dist/genexus-ide-ui/p-0550fd5f.entry.js +0 -96
  132. package/dist/genexus-ide-ui/p-0550fd5f.entry.js.map +0 -1
  133. package/dist/genexus-ide-ui/p-17dc4c9c.entry.js.map +0 -1
  134. package/dist/genexus-ide-ui/p-6d996621.entry.js.map +0 -1
  135. package/dist/genexus-ide-ui/p-844b7117.entry.js.map +0 -1
  136. package/dist/genexus-ide-ui/p-a47d71eb.entry.js.map +0 -1
  137. package/dist/genexus-ide-ui/p-ca6eb9fd.entry.js +0 -255
  138. package/dist/genexus-ide-ui/p-ca6eb9fd.entry.js.map +0 -1
  139. /package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/images/copyrights-illustration.png +0 -0
  140. /package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/images/next-arrow.svg +0 -0
  141. /package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/images/next-logo.svg +0 -0
  142. /package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/images/next-square.svg +0 -0
@@ -14,7 +14,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
14
14
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
15
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
16
16
  };
17
- var _GxIdeKbManagerImport__componentLocale, _GxIdeKbManagerImport_showAll, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, _GxIdeKbManagerImport_handleSelectionChange, _GxIdeKbManagerImport_updateListBoxModelState, _GxIdeKbManagerImport_showAllObjects, _GxIdeKbManagerImport_showRecentlyObjects, _GxIdeKbManagerImport_renderFooter;
17
+ var _GxIdeKbManagerImport__componentLocale, _GxIdeKbManagerImport_showAll, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, _GxIdeKbManagerImport_dataTypeCategoryMap, _GxIdeKbManagerImport_dataTypeDataIdMap, _GxIdeKbManagerImport_lastArrowKey, _GxIdeKbManagerImport_selectedDataTypeIds, _GxIdeKbManagerImport_focusAlreadySet, _GxIdeKbManagerImport_actionListEl, _GxIdeKbManagerImport_evaluateSelectionChanged, _GxIdeKbManagerImport_listKeyDownHandler, _GxIdeKbManagerImport_listClickHandler, _GxIdeKbManagerImport_showAllObjects, _GxIdeKbManagerImport_showRecentlyObjects, _GxIdeKbManagerImport_handleButtonTab, _GxIdeKbManagerImport_renderFooter, _GxIdeKbManagerImport_setFocus;
18
18
  // Stencil
19
19
  import { Host, h } from "@stencil/core";
20
20
  // Other Libraries
@@ -24,16 +24,17 @@ import { Locale } from "../../common/locale";
24
24
  import { mapCategoryToListItemGroup, mapDataTypesToList } from "./helpers";
25
25
  const CSS_BUNDLES = [
26
26
  "resets/box-sizing",
27
- "components/tab",
28
- "components/tooltip",
29
27
  "components/list-box",
30
- "components/tree-view",
31
28
  "utils/form--full",
32
- "utils/layout",
33
29
  "utils/typography",
30
+ "utils/layout",
34
31
  "utils/spacing",
35
32
  "chameleon/scrollbar"
36
33
  ];
34
+ const ARROW_UP_KEY = "ArrowUp";
35
+ const ARROW_DOWN_KEY = "ArrowDown";
36
+ const ENTER_KEY = "Enter";
37
+ const TAB_KEY = "Tab";
37
38
  const ALL_CATEGORY_ID = "all";
38
39
  const RECENTLY_USED_CATEGORY_ID = "recenttly-used";
39
40
  const CLOCK_ICON = getIconPath({
@@ -46,40 +47,66 @@ export class GxIdeKbManagerImport {
46
47
  _GxIdeKbManagerImport__componentLocale.set(this, void 0);
47
48
  _GxIdeKbManagerImport_showAll.set(this, false);
48
49
  _GxIdeKbManagerImport_categoriesActionListItemGroupMap.set(this, new Map());
49
- _GxIdeKbManagerImport_handleSelectionChange.set(this, (event) => {
50
- var _a;
51
- const eventType = (_a = event.detail[0]) === null || _a === void 0 ? void 0 : _a.item.type;
52
- if (eventType === "actionable") {
53
- const name = event.detail[0].item.caption;
54
- const itemAdditionalBase = event.detail[0].item.additionalInformation["stretch-start"].center[0];
55
- const icon = itemAdditionalBase.imgSrc;
56
- this.dataTypeSelectedCallback({
57
- name: name,
58
- icon: icon
59
- });
60
- __classPrivateFieldGet(this, _GxIdeKbManagerImport_updateListBoxModelState, "f").call(this, event.detail[0].item.caption, "actionable");
61
- }
62
- else if (eventType === "group") {
63
- __classPrivateFieldGet(this, _GxIdeKbManagerImport_updateListBoxModelState, "f").call(this, event.detail[0].item.caption, "group");
50
+ _GxIdeKbManagerImport_dataTypeCategoryMap.set(this, new Map());
51
+ _GxIdeKbManagerImport_dataTypeDataIdMap.set(this, new Map());
52
+ _GxIdeKbManagerImport_lastArrowKey.set(this, null);
53
+ _GxIdeKbManagerImport_selectedDataTypeIds.set(this, {
54
+ // For setting focus
55
+ categoryId: undefined,
56
+ dataTypeId: undefined
57
+ });
58
+ _GxIdeKbManagerImport_focusAlreadySet.set(this, false);
59
+ _GxIdeKbManagerImport_actionListEl.set(this, void 0);
60
+ _GxIdeKbManagerImport_evaluateSelectionChanged.set(this, (path) => {
61
+ const chActionListItem = path.find(el => el.tagName === "CH-ACTION-LIST-ITEM");
62
+ if (chActionListItem) {
63
+ const id = chActionListItem.id;
64
+ const dataTypeData = __classPrivateFieldGet(this, _GxIdeKbManagerImport_dataTypeDataIdMap, "f").get(id);
65
+ this.dataTypeSelectedCallback(dataTypeData);
64
66
  }
65
67
  });
66
- _GxIdeKbManagerImport_updateListBoxModelState.set(this, (name, type) => {
67
- if (this.selectedCategory === RECENTLY_USED_CATEGORY_ID) {
68
- this.recentlyUsedActionListModel.forEach(item => {
69
- // clear selected
70
- item.selected = false;
71
- });
72
- const selectedItemIndex = this.recentlyUsed.findIndex(item => item.name === name);
73
- if (selectedItemIndex !== -1) {
74
- this.recentlyUsedActionListModel[selectedItemIndex].selected = true;
68
+ _GxIdeKbManagerImport_listKeyDownHandler.set(this, (event) => {
69
+ const pressedKey = event.key;
70
+ const path = event.composedPath();
71
+ if (pressedKey === ARROW_UP_KEY || pressedKey === ARROW_DOWN_KEY) {
72
+ __classPrivateFieldSet(this, _GxIdeKbManagerImport_lastArrowKey, pressedKey, "f");
73
+ if (pressedKey === ARROW_UP_KEY) {
74
+ // Check if this is the first group. IF it is, let the host know,
75
+ // so it can close the dialog.
76
+ const chActionListItem = path.find(el => el.tagName === "CH-ACTION-LIST-ITEM");
77
+ if (chActionListItem !== undefined) {
78
+ return;
79
+ }
80
+ // This is a ch-action-list-group
81
+ const actionGroup = path.find(el => el.tagName === "CH-ACTION-LIST-GROUP");
82
+ const currentFocusedActionGroupId = actionGroup.id;
83
+ const firstActionListGroupId = __classPrivateFieldGet(this, _GxIdeKbManagerImport_actionListEl, "f").shadowRoot.firstElementChild.id;
84
+ if (currentFocusedActionGroupId === firstActionListGroupId) {
85
+ this.arrowUpOnFirstElement();
86
+ }
75
87
  }
76
88
  }
77
- else if (type === "group" &&
78
- __classPrivateFieldGet(this, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, "f").has(name)) {
79
- const group = __classPrivateFieldGet(this, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, "f").get(name);
80
- const groupUpdated = Object.assign(Object.assign({}, group), { expanded: group.expanded });
81
- __classPrivateFieldGet(this, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, "f").set(name, groupUpdated);
89
+ else if (pressedKey === ENTER_KEY) {
90
+ __classPrivateFieldGet(this, _GxIdeKbManagerImport_evaluateSelectionChanged, "f").call(this, path);
91
+ }
92
+ else if (pressedKey === TAB_KEY) {
93
+ event.stopPropagation();
94
+ }
95
+ });
96
+ _GxIdeKbManagerImport_listClickHandler.set(this, (event) => {
97
+ if (__classPrivateFieldGet(this, _GxIdeKbManagerImport_lastArrowKey, "f")) {
98
+ // User navigated with ArrowUp or ArrowDown
99
+ // Ignore, since this was not a click event.
100
+ }
101
+ else if (event.detail === 0) {
102
+ // ignore keyboard Enter (Enter happens by default on buttons on onClick)
103
+ return;
104
+ }
105
+ else {
106
+ const path = event.composedPath();
107
+ __classPrivateFieldGet(this, _GxIdeKbManagerImport_evaluateSelectionChanged, "f").call(this, path);
82
108
  }
109
+ __classPrivateFieldSet(this, _GxIdeKbManagerImport_lastArrowKey, null, "f");
83
110
  });
84
111
  _GxIdeKbManagerImport_showAllObjects.set(this, () => {
85
112
  if (!__classPrivateFieldGet(this, _GxIdeKbManagerImport_showAll, "f")) {
@@ -111,6 +138,13 @@ export class GxIdeKbManagerImport {
111
138
  this.categoriesListBoxModel = newSelectedCategory;
112
139
  __classPrivateFieldSet(this, _GxIdeKbManagerImport_showAll, false, "f");
113
140
  };
141
+ _GxIdeKbManagerImport_handleButtonTab.set(this, (event) => {
142
+ // Prevents bubbling, which causes this component to close, due to how the IDE handles Tab event
143
+ // in a parent element.
144
+ if (event.key === TAB_KEY || event.key === ENTER_KEY) {
145
+ event.stopPropagation();
146
+ }
147
+ });
114
148
  _GxIdeKbManagerImport_renderFooter.set(this, () => {
115
149
  const recentlyUsedBtnClass = this.selectedCategory === RECENTLY_USED_CATEGORY_ID
116
150
  ? "button-secondary"
@@ -129,20 +163,49 @@ export class GxIdeKbManagerImport {
129
163
  else {
130
164
  selectedCategoryDescription = this.selectedCategory;
131
165
  }
132
- return (h("footer", { class: "footer control-footer control-footer-start spacing-body-inline spacing-body-block scrollable\n " }, h("div", { class: "buttons-spacer" }, this.recentlyUsed && this.recentlyUsed.length > 0 && (h("button", { class: `button-icon-only ${recentlyUsedBtnClass}`, "aria-label": `${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").select} ${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").fixedTypes.recentlyUsed}`, title: `${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").select} ${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").fixedTypes.recentlyUsed}`, onClick: __classPrivateFieldGet(this, _GxIdeKbManagerImport_showRecentlyObjects, "f") }, h("ch-image", { class: "icon-md", src: CLOCK_ICON }))), h("button", { class: `button-icon-only ${allBtnClass}`, onClick: __classPrivateFieldGet(this, _GxIdeKbManagerImport_showAllObjects, "f"), "aria-label": `${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").select} ${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").fixedTypes.all}`, title: `${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").select} ${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").fixedTypes.all}` }, "[*]"), this.categories.map(category => {
166
+ return (h("footer", { class: "footer control-footer control-footer-start scrollable\n " }, h("div", { class: "buttons-spacer" }, this.recentlyUsed && this.recentlyUsed.length > 0 && (h("button", { class: `button-icon-only ${recentlyUsedBtnClass}`, "aria-label": `${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").select} ${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").fixedTypes.recentlyUsed}`, title: `${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").select} ${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").fixedTypes.recentlyUsed}`, onClick: __classPrivateFieldGet(this, _GxIdeKbManagerImport_showRecentlyObjects, "f"), onKeyDown: __classPrivateFieldGet(this, _GxIdeKbManagerImport_handleButtonTab, "f") }, h("ch-image", { class: "icon-md", src: CLOCK_ICON }))), h("button", { class: `button-icon-only ${allBtnClass}`, onClick: __classPrivateFieldGet(this, _GxIdeKbManagerImport_showAllObjects, "f"), onKeyDown: __classPrivateFieldGet(this, _GxIdeKbManagerImport_handleButtonTab, "f"), "aria-label": `${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").select} ${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").fixedTypes.all}`, title: `${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").select} ${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").fixedTypes.all}` }, "[*]"), this.categories.map(category => {
133
167
  const buttonClass = category.name === this.selectedCategory
134
168
  ? "button-secondary"
135
169
  : "button-tertiary";
136
- return (h("button", { class: `button-icon-only ${buttonClass}`, "aria-label": category.name, title: category.name, onClick: this.selectedCategoryHandler, "data-name": category.name }, h("ch-image", { class: "icon-md", src: category.icon })));
170
+ return (h("button", { class: `button-icon-only ${buttonClass}`, "aria-label": category.name, title: category.name, onClick: this.selectedCategoryHandler, onKeyDown: __classPrivateFieldGet(this, _GxIdeKbManagerImport_handleButtonTab, "f"), "data-name": category.name }, h("ch-image", { class: "icon-md", src: category.icon })));
137
171
  })), h("p", { class: "body-regular-s selected-category" }, selectedCategoryDescription)));
138
172
  });
173
+ _GxIdeKbManagerImport_setFocus.set(this, async () => {
174
+ if (__classPrivateFieldGet(this, _GxIdeKbManagerImport_focusAlreadySet, "f")) {
175
+ return;
176
+ }
177
+ let focusableElement;
178
+ setTimeout(() => {
179
+ // setTimeout as a WA, since the list-box elements are not rendered/read immediatelly
180
+ if (this.focusType === "selected" &&
181
+ __classPrivateFieldGet(this, _GxIdeKbManagerImport_selectedDataTypeIds, "f").categoryId &&
182
+ __classPrivateFieldGet(this, _GxIdeKbManagerImport_selectedDataTypeIds, "f").dataTypeId) {
183
+ // set focus on the selected element
184
+ const selectedDataTypeEl = __classPrivateFieldGet(this, _GxIdeKbManagerImport_actionListEl, "f").shadowRoot.getElementById(__classPrivateFieldGet(this, _GxIdeKbManagerImport_selectedDataTypeIds, "f").dataTypeId);
185
+ if (selectedDataTypeEl) {
186
+ focusableElement = selectedDataTypeEl;
187
+ }
188
+ }
189
+ else {
190
+ // set focus of the first element
191
+ const firstActionListGroup = __classPrivateFieldGet(this, _GxIdeKbManagerImport_actionListEl, "f").shadowRoot.firstElementChild;
192
+ const firstButton = firstActionListGroup.shadowRoot.firstElementChild;
193
+ focusableElement = firstButton;
194
+ }
195
+ focusableElement && focusableElement.focus();
196
+ __classPrivateFieldSet(this, _GxIdeKbManagerImport_focusAlreadySet, true, "f");
197
+ }, 150);
198
+ });
139
199
  this.categoriesListBoxModel = [];
140
200
  this.selectedCategory = undefined;
141
- this.statusInfo = [];
142
201
  this.recentlyUsedActionListModel = [];
143
202
  this.loading = true;
203
+ this.categoriesJustChanged = false;
204
+ this.actionListDidRender = false;
144
205
  this.categories = undefined;
145
206
  this.dataTypeSelectedCallback = undefined;
207
+ this.arrowUpOnFirstElement = undefined;
208
+ this.focusType = "first-element";
146
209
  this.recentlyUsed = [];
147
210
  }
148
211
  categoriesChanged(newCategories) {
@@ -153,9 +216,25 @@ export class GxIdeKbManagerImport {
153
216
  newCategories.forEach(category => {
154
217
  const categoryListBoxModel = mapCategoryToListItemGroup(category);
155
218
  __classPrivateFieldGet(this, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, "f").set(category.name, categoryListBoxModel);
219
+ category.types.forEach(type => {
220
+ const isSelected = type.selected;
221
+ if (isSelected) {
222
+ // For setting focus
223
+ __classPrivateFieldGet(this, _GxIdeKbManagerImport_selectedDataTypeIds, "f").categoryId = category.name;
224
+ __classPrivateFieldGet(this, _GxIdeKbManagerImport_selectedDataTypeIds, "f").dataTypeId = type.name;
225
+ }
226
+ __classPrivateFieldGet(this, _GxIdeKbManagerImport_dataTypeCategoryMap, "f").set(type.name, category.id);
227
+ __classPrivateFieldGet(this, _GxIdeKbManagerImport_dataTypeDataIdMap, "f").set(type.name, {
228
+ id: category.id,
229
+ name: type.name,
230
+ icon: type.icon,
231
+ selected: type.selected
232
+ });
233
+ });
156
234
  });
157
235
  this.loading = false;
158
236
  __classPrivateFieldGet(this, _GxIdeKbManagerImport_showAllObjects, "f").call(this);
237
+ this.categoriesJustChanged = true;
159
238
  }
160
239
  recentlyUsedChanged(newRecentlyUsed) {
161
240
  this.recentlyUsedActionListModel = null;
@@ -167,7 +246,10 @@ export class GxIdeKbManagerImport {
167
246
  this.recentlyUsed.length && this.recentlyUsedChanged(this.recentlyUsed);
168
247
  }
169
248
  render() {
170
- return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), this.loading ? (h("gx-ide-loader", { loaderTitle: __classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").loader.title, description: __classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").loader.description, show: true })) : (h("section", { class: "main" }, h("ch-action-list-render", { class: "list-box", model: this.categoriesListBoxModel, selection: "single", onSelectedItemsChange: __classPrivateFieldGet(this, _GxIdeKbManagerImport_handleSelectionChange, "f") }), __classPrivateFieldGet(this, _GxIdeKbManagerImport_renderFooter, "f").call(this)))));
249
+ return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), this.loading ? (h("gx-ide-loader", { loaderTitle: __classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").loader.title, description: __classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").loader.description, show: true })) : (h("section", { class: "main" }, h("ch-action-list-render", { ref: async (el) => {
250
+ __classPrivateFieldSet(this, _GxIdeKbManagerImport_actionListEl, el, "f");
251
+ __classPrivateFieldGet(this, _GxIdeKbManagerImport_setFocus, "f").call(this);
252
+ }, class: "list-box", model: this.categoriesListBoxModel, selection: "single", onKeyDown: __classPrivateFieldGet(this, _GxIdeKbManagerImport_listKeyDownHandler, "f"), onClick: __classPrivateFieldGet(this, _GxIdeKbManagerImport_listClickHandler, "f") }), __classPrivateFieldGet(this, _GxIdeKbManagerImport_renderFooter, "f").call(this)))));
171
253
  }
172
254
  static get is() { return "gx-ide-data-type-selector"; }
173
255
  static get encapsulation() { return "shadow"; }
@@ -211,7 +293,7 @@ export class GxIdeKbManagerImport {
211
293
  "mutable": false,
212
294
  "complexType": {
213
295
  "original": "DataTypeSelectedCallback",
214
- "resolved": "(data: { name: string; icon: string; }) => Promise<void>",
296
+ "resolved": "(data: DataTypeData) => Promise<void>",
215
297
  "references": {
216
298
  "DataTypeSelectedCallback": {
217
299
  "location": "local",
@@ -224,9 +306,48 @@ export class GxIdeKbManagerImport {
224
306
  "optional": false,
225
307
  "docs": {
226
308
  "tags": [],
227
- "text": "Callback invoked when user select an item type"
309
+ "text": "Callback invoked when the user has selected an item type"
228
310
  }
229
311
  },
312
+ "arrowUpOnFirstElement": {
313
+ "type": "unknown",
314
+ "mutable": false,
315
+ "complexType": {
316
+ "original": "ArrowFirstOnFirstElement",
317
+ "resolved": "() => Promise<void>",
318
+ "references": {
319
+ "ArrowFirstOnFirstElement": {
320
+ "location": "local",
321
+ "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/data-type-selector/data-type-selector.tsx",
322
+ "id": "src/components/data-type-selector/data-type-selector.tsx::ArrowFirstOnFirstElement"
323
+ }
324
+ }
325
+ },
326
+ "required": false,
327
+ "optional": false,
328
+ "docs": {
329
+ "tags": [],
330
+ "text": "Defines the type of focus applied when the component renders for the first time."
331
+ }
332
+ },
333
+ "focusType": {
334
+ "type": "string",
335
+ "mutable": false,
336
+ "complexType": {
337
+ "original": "\"first-element\" | \"selected\"",
338
+ "resolved": "\"first-element\" | \"selected\"",
339
+ "references": {}
340
+ },
341
+ "required": false,
342
+ "optional": false,
343
+ "docs": {
344
+ "tags": [],
345
+ "text": "Defines the type of focus applied when the component renders for the first time."
346
+ },
347
+ "attribute": "focus-type",
348
+ "reflect": false,
349
+ "defaultValue": "\"first-element\""
350
+ },
230
351
  "recentlyUsed": {
231
352
  "type": "unknown",
232
353
  "mutable": false,
@@ -255,9 +376,10 @@ export class GxIdeKbManagerImport {
255
376
  return {
256
377
  "categoriesListBoxModel": {},
257
378
  "selectedCategory": {},
258
- "statusInfo": {},
259
379
  "recentlyUsedActionListModel": {},
260
- "loading": {}
380
+ "loading": {},
381
+ "categoriesJustChanged": {},
382
+ "actionListDidRender": {}
261
383
  };
262
384
  }
263
385
  static get elementRef() { return "el"; }
@@ -271,5 +393,5 @@ export class GxIdeKbManagerImport {
271
393
  }];
272
394
  }
273
395
  }
274
- _GxIdeKbManagerImport__componentLocale = new WeakMap(), _GxIdeKbManagerImport_showAll = new WeakMap(), _GxIdeKbManagerImport_categoriesActionListItemGroupMap = new WeakMap(), _GxIdeKbManagerImport_handleSelectionChange = new WeakMap(), _GxIdeKbManagerImport_updateListBoxModelState = new WeakMap(), _GxIdeKbManagerImport_showAllObjects = new WeakMap(), _GxIdeKbManagerImport_showRecentlyObjects = new WeakMap(), _GxIdeKbManagerImport_renderFooter = new WeakMap();
396
+ _GxIdeKbManagerImport__componentLocale = new WeakMap(), _GxIdeKbManagerImport_showAll = new WeakMap(), _GxIdeKbManagerImport_categoriesActionListItemGroupMap = new WeakMap(), _GxIdeKbManagerImport_dataTypeCategoryMap = new WeakMap(), _GxIdeKbManagerImport_dataTypeDataIdMap = new WeakMap(), _GxIdeKbManagerImport_lastArrowKey = new WeakMap(), _GxIdeKbManagerImport_selectedDataTypeIds = new WeakMap(), _GxIdeKbManagerImport_focusAlreadySet = new WeakMap(), _GxIdeKbManagerImport_actionListEl = new WeakMap(), _GxIdeKbManagerImport_evaluateSelectionChanged = new WeakMap(), _GxIdeKbManagerImport_listKeyDownHandler = new WeakMap(), _GxIdeKbManagerImport_listClickHandler = new WeakMap(), _GxIdeKbManagerImport_showAllObjects = new WeakMap(), _GxIdeKbManagerImport_showRecentlyObjects = new WeakMap(), _GxIdeKbManagerImport_handleButtonTab = new WeakMap(), _GxIdeKbManagerImport_renderFooter = new WeakMap(), _GxIdeKbManagerImport_setFocus = new WeakMap();
275
397
  //# sourceMappingURL=data-type-selector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-type-selector.js","sourceRoot":"","sources":["../../../src/components/data-type-selector/data-type-selector.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,UAAU;AACV,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,kBAAkB;AAClB,OAAO,EAAkB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAY/D,YAAY;AACZ,OAAO,EAAE,MAAM,E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","sourcesContent":["// Stencil\nimport { Component, Host, h, Prop, Element, State, Watch } from \"@stencil/core\";\n// Other Libraries\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\nimport {\n ActionListItemActionable,\n ActionListItemModel,\n ActionListItemModelExtended,\n ActionListItemType,\n ActionListModel\n} from \"@genexus/chameleon-controls-library\";\nimport {\n ActionListItemAdditionalBase,\n ActionListItemGroup\n} from \"@genexus/chameleon-controls-library/dist/types/components/action-list/types\";\n// Gx Ide Ui\nimport { Locale } from \"../../common/locale\";\nimport { mapCategoryToListItemGroup, mapDataTypesToList } from \"./helpers\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/tab\",\n \"components/tooltip\",\n \"components/list-box\",\n \"components/tree-view\",\n \"utils/form--full\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\n\nconst ALL_CATEGORY_ID = \"all\";\nconst RECENTLY_USED_CATEGORY_ID = \"recenttly-used\";\n\nconst CLOCK_ICON = getIconPath({\n category: \"system\",\n name: \"time\",\n colorType: \"primary\"\n});\n\n@Component({\n tag: \"gx-ide-data-type-selector\",\n styleUrl: \"data-type-selector.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/data-type-selector\"]\n})\nexport class GxIdeKbManagerImport {\n #_componentLocale: any;\n #showAll: boolean = false;\n #categoriesActionListItemGroupMap: Map<string, ActionListItemGroup> = new Map<\n string,\n ActionListItemGroup\n >();\n\n @Element() el: HTMLGxIdeDataTypeSelectorElement;\n\n @State() categoriesListBoxModel: ActionListItemModel[] = [];\n @State() selectedCategory: string;\n @State() statusInfo: StatusInfo[] = [];\n @State() recentlyUsedActionListModel: ActionListModel = [];\n @State() loading: boolean = true;\n\n /**\n * All possible types and its category\n */\n @Prop() readonly categories: DataTypeCategoryData[] = undefined;\n @Watch(\"categories\")\n categoriesChanged(newCategories: DataTypeCategoryData[]) {\n if (!newCategories?.length) {\n return;\n }\n this.#categoriesActionListItemGroupMap.clear();\n newCategories.forEach(category => {\n const categoryListBoxModel = mapCategoryToListItemGroup(category);\n this.#categoriesActionListItemGroupMap.set(\n category.name,\n categoryListBoxModel\n );\n });\n this.loading = false;\n this.#showAllObjects();\n }\n\n /**\n * Callback invoked when user select an item type\n */\n @Prop() readonly dataTypeSelectedCallback: DataTypeSelectedCallback;\n\n /**\n * All recently used types list\n */\n @Prop() readonly recentlyUsed: DataTypeData[] = [];\n @Watch(\"recentlyUsed\")\n recentlyUsedChanged(newRecentlyUsed: DataTypeData[]) {\n this.recentlyUsedActionListModel = null;\n this.recentlyUsedActionListModel = mapDataTypesToList(newRecentlyUsed);\n }\n\n async componentWillLoad() {\n this.#_componentLocale = await Locale.getComponentStrings(this.el);\n // initialize models\n this.recentlyUsed.length && this.recentlyUsedChanged(this.recentlyUsed);\n }\n\n #handleSelectionChange = (\n event: CustomEvent<ActionListItemModelExtended[]>\n ) => {\n const eventType = event.detail[0]?.item.type;\n if (eventType === \"actionable\") {\n const name = event.detail[0].item.caption;\n\n const itemAdditionalBase = event.detail[0].item.additionalInformation[\n \"stretch-start\"\n ].center[0] as ActionListItemAdditionalBase;\n const icon = itemAdditionalBase.imgSrc;\n\n this.dataTypeSelectedCallback({\n name: name,\n icon: icon\n });\n\n this.#updateListBoxModelState(event.detail[0].item.caption, \"actionable\");\n } else if (eventType === \"group\") {\n this.#updateListBoxModelState(event.detail[0].item.caption, \"group\");\n }\n };\n\n #updateListBoxModelState = (name: string, type: ActionListItemType) => {\n if (this.selectedCategory === RECENTLY_USED_CATEGORY_ID) {\n this.recentlyUsedActionListModel.forEach(item => {\n // clear selected\n (item as ActionListItemActionable).selected = false;\n });\n const selectedItemIndex = this.recentlyUsed.findIndex(\n item => item.name === name\n );\n if (selectedItemIndex !== -1) {\n (\n this.recentlyUsedActionListModel[\n selectedItemIndex\n ] as ActionListItemActionable\n ).selected = true;\n }\n } else if (\n type === \"group\" &&\n this.#categoriesActionListItemGroupMap.has(name)\n ) {\n const group = this.#categoriesActionListItemGroupMap.get(\n name\n ) as ActionListItemGroup;\n const groupUpdated = { ...group, expanded: group.expanded };\n this.#categoriesActionListItemGroupMap.set(name, groupUpdated);\n }\n };\n\n #showAllObjects = () => {\n if (!this.#showAll) {\n const allCategoriesActionListModel: ActionListItemModel[] = [];\n let counter = 1;\n const mapLength = this.#categoriesActionListItemGroupMap.size;\n for (const key of this.#categoriesActionListItemGroupMap.keys()) {\n allCategoriesActionListModel.push(\n this.#categoriesActionListItemGroupMap.get(key)\n );\n if (counter !== mapLength) {\n allCategoriesActionListModel.push({ type: \"separator\" });\n }\n counter++;\n }\n this.categoriesListBoxModel = allCategoriesActionListModel;\n this.#showAll = true;\n this.selectedCategory = ALL_CATEGORY_ID;\n }\n };\n\n #showRecentlyObjects = () => {\n this.#showAll = false;\n this.categoriesListBoxModel = this.recentlyUsedActionListModel;\n this.selectedCategory = RECENTLY_USED_CATEGORY_ID;\n };\n\n private selectedCategoryHandler = (e: MouseEvent) => {\n this.selectedCategory = (e.currentTarget as HTMLButtonElement).dataset.name;\n const newSelectedCategory = [\n this.#categoriesActionListItemGroupMap.get(this.selectedCategory)\n ];\n this.categoriesListBoxModel = newSelectedCategory;\n this.#showAll = false;\n };\n\n #renderFooter = () => {\n const recentlyUsedBtnClass =\n this.selectedCategory === RECENTLY_USED_CATEGORY_ID\n ? \"button-secondary\"\n : \"button-tertiary\";\n const allBtnClass =\n this.selectedCategory === ALL_CATEGORY_ID\n ? \"button-secondary\"\n : \"button-tertiary\";\n let selectedCategoryDescription = this.selectedCategory;\n if (this.selectedCategory === RECENTLY_USED_CATEGORY_ID) {\n selectedCategoryDescription =\n this.#_componentLocale.fixedTypes.recentlyUsed;\n } else if (this.selectedCategory === ALL_CATEGORY_ID) {\n selectedCategoryDescription = this.#_componentLocale.fixedTypes.all;\n } else {\n selectedCategoryDescription = this.selectedCategory;\n }\n\n return (\n <footer\n class=\"footer control-footer control-footer-start spacing-body-inline spacing-body-block scrollable\n \"\n >\n <div class=\"buttons-spacer\">\n {this.recentlyUsed && this.recentlyUsed.length > 0 && (\n <button\n class={`button-icon-only ${recentlyUsedBtnClass}`}\n aria-label={`${this.#_componentLocale.select} ${\n this.#_componentLocale.fixedTypes.recentlyUsed\n }`}\n title={`${this.#_componentLocale.select} ${\n this.#_componentLocale.fixedTypes.recentlyUsed\n }`}\n onClick={this.#showRecentlyObjects}\n >\n <ch-image class=\"icon-md\" src={CLOCK_ICON}></ch-image>\n </button>\n )}\n <button\n class={`button-icon-only ${allBtnClass}`}\n onClick={this.#showAllObjects}\n aria-label={`${this.#_componentLocale.select} ${\n this.#_componentLocale.fixedTypes.all\n }`}\n title={`${this.#_componentLocale.select} ${\n this.#_componentLocale.fixedTypes.all\n }`}\n >\n [*]\n </button>\n {this.categories.map(category => {\n const buttonClass =\n category.name === this.selectedCategory\n ? \"button-secondary\"\n : \"button-tertiary\";\n\n return (\n <button\n class={`button-icon-only ${buttonClass}`}\n aria-label={category.name}\n title={category.name}\n onClick={this.selectedCategoryHandler}\n data-name={category.name}\n >\n <ch-image class=\"icon-md\" src={category.icon}></ch-image>\n </button>\n );\n })}\n </div>\n <p class=\"body-regular-s selected-category\">\n {selectedCategoryDescription}\n </p>\n </footer>\n );\n };\n\n render(): void {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n {this.loading ? (\n <gx-ide-loader\n loaderTitle={this.#_componentLocale.loader.title}\n description={this.#_componentLocale.loader.description}\n show\n ></gx-ide-loader>\n ) : (\n <section class=\"main\">\n <ch-action-list-render\n class=\"list-box\"\n model={this.categoriesListBoxModel}\n selection=\"single\"\n onSelectedItemsChange={this.#handleSelectionChange}\n ></ch-action-list-render>\n {this.#renderFooter()}\n </section>\n )}\n </Host>\n );\n }\n}\n\ntype StatusInfo = {\n [key: string]: {\n display: boolean;\n };\n};\n\nexport type DataTypeCategoryData = {\n name: string;\n icon: string;\n types: DataTypeData[];\n};\nexport type DataTypeData = {\n name: string;\n icon: string;\n};\n\nexport type DataTypeSelectedCallback = (data: {\n name: string;\n icon: string;\n}) => Promise<void>;\n"]}
1
+ {"version":3,"file":"data-type-selector.js","sourceRoot":"","sources":["../../../src/components/data-type-selector/data-type-selector.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,UAAU;AACV,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,kBAAkB;AAClB,OAAO,EAAkB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAM/D,YAAY;AACZ,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE3E,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,qBAAqB;IACrB,kBAAkB;IAClB,kBAAkB;IAClB,cAAc;IACd,eAAe;IACf,qBAAqB;CACtB,CAAC;AAEF,MAAM,YAAY,GAAG,SAAS,CAAC;AAC/B,MAAM,cAAc,GAAG,WAAW,CAAC;AACnC,MAAM,SAAS,GAAG,OAAO,CAAC;AAC1B,MAAM,OAAO,GAAG,KAAK,CAAC;AAEtB,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,yBAAyB,GAAG,gBAAgB,CAAC;AAEnD,MAAM,UAAU,GAAG,WAAW,CAAC;IAC7B,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAQH,MAAM,OAAO,oBAAoB;;QAC/B,yDAAuB;QACvB,wCAAoB,KAAK,EAAC;QAC1B,iEAAsE,IAAI,GAAG,EAG1E,EAAC;QAEJ,oDAA4C,IAAI,GAAG,EAAkB,EAAC;QACtE,kDAAgD,IAAI,GAAG,EAGpD,EAAC;QACJ,6CAAoE,IAAI,EAAC;QACzE,oDAA4C;YAC1C,o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AAG,EAAE,KAAK,EAAC,EAAE,EAAC,EAAE;wBACd,uBAAA,IAAI,sCAAiB,EAAmC,MAAA,CAAC;wBACzD,uBAAA,IAAI,sCAAU,MAAd,IAAI,CAAY,CAAC;oBACnB,CAAC,EACD,KAAK,EAAC,UAAU,EAChB,KAAK,EAAE,IAAI,CAAC,sBAAsB,EAClC,SAAS,EAAC,QAAQ,EAClB,SAAS,EAAE,uBAAA,IAAI,gDAAoB,EACnC,OAAO,EAAE,uBAAA,IAAI,8CAAkB,GACR;gBACxB,uBAAA,IAAI,0CAAc,MAAlB,IAAI,CAAgB,CACb,CACX,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["// Stencil\nimport { Component, Host, h, Prop, Element, State, Watch } from \"@stencil/core\";\n// Other Libraries\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\nimport {\n ActionListItemModel,\n ActionListModel\n} from \"@genexus/chameleon-controls-library\";\nimport { ActionListItemGroup } from \"@genexus/chameleon-controls-library/dist/types/components/action-list/types\";\n// Gx Ide Ui\nimport { Locale } from \"../../common/locale\";\nimport { mapCategoryToListItemGroup, mapDataTypesToList } from \"./helpers\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/list-box\",\n \"utils/form--full\",\n \"utils/typography\",\n \"utils/layout\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\n\nconst ARROW_UP_KEY = \"ArrowUp\";\nconst ARROW_DOWN_KEY = \"ArrowDown\";\nconst ENTER_KEY = \"Enter\";\nconst TAB_KEY = \"Tab\";\n\nconst ALL_CATEGORY_ID = \"all\";\nconst RECENTLY_USED_CATEGORY_ID = \"recenttly-used\";\n\nconst CLOCK_ICON = getIconPath({\n category: \"system\",\n name: \"time\",\n colorType: \"primary\"\n});\n\n@Component({\n tag: \"gx-ide-data-type-selector\",\n styleUrl: \"data-type-selector.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/data-type-selector\"]\n})\nexport class GxIdeKbManagerImport {\n #_componentLocale: any;\n #showAll: boolean = false;\n #categoriesActionListItemGroupMap: Map<string, ActionListItemGroup> = new Map<\n string,\n ActionListItemGroup\n >();\n\n #dataTypeCategoryMap: Map<string, string> = new Map<string, string>();\n #dataTypeDataIdMap: Map<string, DataTypeData> = new Map<\n string,\n DataTypeData\n >();\n #lastArrowKey: typeof ARROW_UP_KEY | typeof ARROW_DOWN_KEY | null = null;\n #selectedDataTypeIds: SelectedDataTypeIds = {\n // For setting focus\n categoryId: undefined,\n dataTypeId: undefined\n };\n #focusAlreadySet: boolean = false;\n\n #actionListEl!: HTMLChActionListRenderElement;\n @Element() el: HTMLGxIdeDataTypeSelectorElement;\n\n @State() categoriesListBoxModel: ActionListItemModel[] = [];\n @State() selectedCategory: string;\n @State() recentlyUsedActionListModel: ActionListModel = [];\n @State() loading: boolean = true;\n @State() categoriesJustChanged: boolean = false;\n @State() actionListDidRender: boolean = false;\n\n /**\n * All possible types and its category\n */\n @Prop() readonly categories: DataTypeCategoryData[] = undefined;\n @Watch(\"categories\")\n categoriesChanged(newCategories: DataTypeCategoryData[]) {\n if (!newCategories?.length) {\n return;\n }\n\n this.#categoriesActionListItemGroupMap.clear();\n newCategories.forEach(category => {\n const categoryListBoxModel = mapCategoryToListItemGroup(category);\n this.#categoriesActionListItemGroupMap.set(\n category.name,\n categoryListBoxModel\n );\n category.types.forEach(type => {\n const isSelected = type.selected;\n if (isSelected) {\n // For setting focus\n this.#selectedDataTypeIds.categoryId = category.name;\n this.#selectedDataTypeIds.dataTypeId = type.name;\n }\n\n this.#dataTypeCategoryMap.set(type.name, category.id);\n this.#dataTypeDataIdMap.set(type.name, {\n id: category.id,\n name: type.name,\n icon: type.icon,\n selected: type.selected\n });\n });\n });\n this.loading = false;\n this.#showAllObjects();\n this.categoriesJustChanged = true;\n }\n\n /**\n * Callback invoked when the user has selected an item type\n */\n @Prop() readonly dataTypeSelectedCallback: DataTypeSelectedCallback;\n\n /**\n * Defines the type of focus applied when the component renders for the first time.\n */\n @Prop() readonly arrowUpOnFirstElement: ArrowFirstOnFirstElement;\n\n /**\n * Defines the type of focus applied when the component renders for the first time.\n */\n @Prop() readonly focusType: \"first-element\" | \"selected\" = \"first-element\";\n\n /**\n * All recently used types list\n */\n @Prop() readonly recentlyUsed: DataTypeData[] = [];\n @Watch(\"recentlyUsed\")\n recentlyUsedChanged(newRecentlyUsed: DataTypeData[]) {\n this.recentlyUsedActionListModel = null;\n this.recentlyUsedActionListModel = mapDataTypesToList(newRecentlyUsed);\n }\n\n async componentWillLoad() {\n this.#_componentLocale = await Locale.getComponentStrings(this.el);\n // initialize models\n this.recentlyUsed.length && this.recentlyUsedChanged(this.recentlyUsed);\n }\n\n #evaluateSelectionChanged = (path: EventTarget[]) => {\n const chActionListItem = path.find(\n el => (el as HTMLElement).tagName === \"CH-ACTION-LIST-ITEM\"\n );\n if (chActionListItem) {\n const id = (chActionListItem as HTMLElement).id;\n const dataTypeData = this.#dataTypeDataIdMap.get(id);\n this.dataTypeSelectedCallback(dataTypeData);\n }\n };\n\n #listKeyDownHandler = (event: KeyboardEvent) => {\n const pressedKey = event.key;\n const path = event.composedPath();\n\n if (pressedKey === ARROW_UP_KEY || pressedKey === ARROW_DOWN_KEY) {\n this.#lastArrowKey = pressedKey;\n\n if (pressedKey === ARROW_UP_KEY) {\n // Check if this is the first group. IF it is, let the host know,\n // so it can close the dialog.\n\n const chActionListItem = path.find(\n el => (el as HTMLElement).tagName === \"CH-ACTION-LIST-ITEM\"\n );\n\n if (chActionListItem !== undefined) {\n return;\n }\n\n // This is a ch-action-list-group\n const actionGroup = path.find(\n el => (el as HTMLElement).tagName === \"CH-ACTION-LIST-GROUP\"\n );\n const currentFocusedActionGroupId = (actionGroup as HTMLElement).id;\n\n const firstActionListGroupId =\n this.#actionListEl.shadowRoot.firstElementChild.id;\n\n if (currentFocusedActionGroupId === firstActionListGroupId) {\n this.arrowUpOnFirstElement();\n }\n }\n } else if (pressedKey === ENTER_KEY) {\n this.#evaluateSelectionChanged(path);\n } else if (pressedKey === TAB_KEY) {\n event.stopPropagation();\n }\n };\n\n #listClickHandler = (event: MouseEvent) => {\n if (this.#lastArrowKey) {\n // User navigated with ArrowUp or ArrowDown\n // Ignore, since this was not a click event.\n } else if (event.detail === 0) {\n // ignore keyboard Enter (Enter happens by default on buttons on onClick)\n return;\n } else {\n const path = event.composedPath();\n this.#evaluateSelectionChanged(path);\n }\n this.#lastArrowKey = null;\n };\n\n #showAllObjects = () => {\n if (!this.#showAll) {\n const allCategoriesActionListModel: ActionListItemModel[] = [];\n let counter = 1;\n const mapLength = this.#categoriesActionListItemGroupMap.size;\n for (const key of this.#categoriesActionListItemGroupMap.keys()) {\n allCategoriesActionListModel.push(\n this.#categoriesActionListItemGroupMap.get(key)\n );\n if (counter !== mapLength) {\n allCategoriesActionListModel.push({ type: \"separator\" });\n }\n counter++;\n }\n this.categoriesListBoxModel = allCategoriesActionListModel;\n this.#showAll = true;\n this.selectedCategory = ALL_CATEGORY_ID;\n }\n };\n\n #showRecentlyObjects = () => {\n this.#showAll = false;\n this.categoriesListBoxModel = this.recentlyUsedActionListModel;\n this.selectedCategory = RECENTLY_USED_CATEGORY_ID;\n };\n\n private selectedCategoryHandler = (e: MouseEvent) => {\n this.selectedCategory = (e.currentTarget as HTMLButtonElement).dataset.name;\n const newSelectedCategory = [\n this.#categoriesActionListItemGroupMap.get(this.selectedCategory)\n ];\n this.categoriesListBoxModel = newSelectedCategory;\n this.#showAll = false;\n };\n\n #handleButtonTab = (event: KeyboardEvent) => {\n // Prevents bubbling, which causes this component to close, due to how the IDE handles Tab event\n // in a parent element.\n if (event.key === TAB_KEY || event.key === ENTER_KEY) {\n event.stopPropagation();\n }\n };\n\n #renderFooter = () => {\n const recentlyUsedBtnClass =\n this.selectedCategory === RECENTLY_USED_CATEGORY_ID\n ? \"button-secondary\"\n : \"button-tertiary\";\n const allBtnClass =\n this.selectedCategory === ALL_CATEGORY_ID\n ? \"button-secondary\"\n : \"button-tertiary\";\n let selectedCategoryDescription = this.selectedCategory;\n if (this.selectedCategory === RECENTLY_USED_CATEGORY_ID) {\n selectedCategoryDescription =\n this.#_componentLocale.fixedTypes.recentlyUsed;\n } else if (this.selectedCategory === ALL_CATEGORY_ID) {\n selectedCategoryDescription = this.#_componentLocale.fixedTypes.all;\n } else {\n selectedCategoryDescription = this.selectedCategory;\n }\n\n return (\n <footer\n class=\"footer control-footer control-footer-start scrollable\n \"\n >\n <div class=\"buttons-spacer\">\n {this.recentlyUsed && this.recentlyUsed.length > 0 && (\n <button\n class={`button-icon-only ${recentlyUsedBtnClass}`}\n aria-label={`${this.#_componentLocale.select} ${\n this.#_componentLocale.fixedTypes.recentlyUsed\n }`}\n title={`${this.#_componentLocale.select} ${\n this.#_componentLocale.fixedTypes.recentlyUsed\n }`}\n onClick={this.#showRecentlyObjects}\n onKeyDown={this.#handleButtonTab}\n >\n <ch-image class=\"icon-md\" src={CLOCK_ICON}></ch-image>\n </button>\n )}\n <button\n class={`button-icon-only ${allBtnClass}`}\n onClick={this.#showAllObjects}\n onKeyDown={this.#handleButtonTab}\n aria-label={`${this.#_componentLocale.select} ${\n this.#_componentLocale.fixedTypes.all\n }`}\n title={`${this.#_componentLocale.select} ${\n this.#_componentLocale.fixedTypes.all\n }`}\n >\n [*]\n </button>\n {this.categories.map(category => {\n const buttonClass =\n category.name === this.selectedCategory\n ? \"button-secondary\"\n : \"button-tertiary\";\n\n return (\n <button\n class={`button-icon-only ${buttonClass}`}\n aria-label={category.name}\n title={category.name}\n onClick={this.selectedCategoryHandler}\n onKeyDown={this.#handleButtonTab}\n data-name={category.name}\n >\n <ch-image class=\"icon-md\" src={category.icon}></ch-image>\n </button>\n );\n })}\n </div>\n <p class=\"body-regular-s selected-category\">\n {selectedCategoryDescription}\n </p>\n </footer>\n );\n };\n\n #setFocus = async () => {\n if (this.#focusAlreadySet) {\n return;\n }\n let focusableElement: HTMLElement;\n\n setTimeout(() => {\n // setTimeout as a WA, since the list-box elements are not rendered/read immediatelly\n if (\n this.focusType === \"selected\" &&\n this.#selectedDataTypeIds.categoryId &&\n this.#selectedDataTypeIds.dataTypeId\n ) {\n // set focus on the selected element\n const selectedDataTypeEl = this.#actionListEl.shadowRoot.getElementById(\n this.#selectedDataTypeIds.dataTypeId\n );\n if (selectedDataTypeEl) {\n focusableElement = selectedDataTypeEl;\n }\n } else {\n // set focus of the first element\n const firstActionListGroup =\n this.#actionListEl.shadowRoot.firstElementChild;\n\n const firstButton = firstActionListGroup.shadowRoot.firstElementChild;\n focusableElement = firstButton as HTMLButtonElement;\n }\n\n focusableElement && (focusableElement as HTMLElement).focus();\n this.#focusAlreadySet = true;\n }, 150);\n };\n\n render(): void {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n {this.loading ? (\n <gx-ide-loader\n loaderTitle={this.#_componentLocale.loader.title}\n description={this.#_componentLocale.loader.description}\n show\n ></gx-ide-loader>\n ) : (\n <section class=\"main\">\n <ch-action-list-render\n ref={async el => {\n this.#actionListEl = el as HTMLChActionListRenderElement;\n this.#setFocus();\n }}\n class=\"list-box\"\n model={this.categoriesListBoxModel}\n selection=\"single\"\n onKeyDown={this.#listKeyDownHandler}\n onClick={this.#listClickHandler}\n ></ch-action-list-render>\n {this.#renderFooter()}\n </section>\n )}\n </Host>\n );\n }\n}\n\nexport type DataTypeCategoryData = {\n id: string;\n name: string;\n icon: string;\n types: DataTypeData[];\n};\nexport type DataTypeData = {\n id: string;\n name: string;\n icon: string;\n selected: boolean;\n};\n\nexport type DataTypeSelectedCallback = (data: DataTypeData) => Promise<void>;\n\ntype SelectedDataTypeIds = {\n categoryId: string;\n dataTypeId: string;\n};\n\nexport type ArrowFirstOnFirstElement = () => Promise<void>;\n"]}
@@ -2,7 +2,7 @@
2
2
  "componentName": "Data Type Selector",
3
3
  "loader": {
4
4
  "title": "Loading Data Types",
5
- "description": "Hango on please..."
5
+ "description": "Hang on please..."
6
6
  },
7
7
  "fixedTypes": {
8
8
  "all": "All",
@@ -9,6 +9,7 @@ export const mapCategoryToListItemGroup = (category) => {
9
9
  return {
10
10
  caption: type.name,
11
11
  id: type.name,
12
+ selected: type.selected,
12
13
  additionalInformation: {
13
14
  "stretch-start": {
14
15
  center: [{ imgSrc: type.icon }]
@@ -25,6 +26,7 @@ export const mapDataTypesToList = (dataTypes) => {
25
26
  return {
26
27
  caption: dataType.name,
27
28
  id: dataType.name,
29
+ selected: dataType.selected,
28
30
  additionalInformation: {
29
31
  "stretch-start": {
30
32
  center: [{ imgSrc: dataType.icon || undefined }]
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/components/data-type-selector/helpers.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,QAA8B,EACT,EAAE;IACvB,MAAM,aAAa,GAAwB;QACzC,OAAO,EAAE,QAAQ,CAAC,IAAI;QACtB,EAAE,EAAE,QAAQ,CAAC,IAAI;QACjB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC/B,OAAO;gBACL,OAAO,EAAE,IAAI,CAAC,IAAI;gBAClB,EAAE,EAAE,IAAI,CAAC,IAAI;gBACb,qBAAqB,EAAE;oBACrB,eAAe,EAAE;wBACf,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;qBAChC;iBACF;gBACD,IAAI,EAAE,YAAY;aACnB,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;IACF,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,SAAyB,EACR,EAAE;IACnB,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;QACvC,OAAO;YACL,OAAO,EAAE,QAAQ,CAAC,IAAI;YACtB,EAAE,EAAE,QAAQ,CAAC,IAAI;YACjB,qBAAqB,EAAE;gBACrB,eAAe,EAAE;oBACf,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,IAAI,SAAS,EAAE,CAAC;iBACjD;aACF;YACD,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,KAAK;SACb,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { DataTypeCategoryData, DataTypeData } from \"./data-type-selector\";\nimport {\n ActionListItemGroup,\n ActionListModel\n} from \"@genexus/chameleon-controls-library/dist/types/components/action-list/types\";\n\nexport const mapCategoryToListItemGroup = (\n category: DataTypeCategoryData\n): ActionListItemGroup => {\n const categoryGroup: ActionListItemGroup = {\n caption: category.name,\n id: category.name,\n type: \"group\",\n expanded: true,\n expandable: true,\n items: category.types.map(type => {\n return {\n caption: type.name,\n id: type.name,\n additionalInformation: {\n \"stretch-start\": {\n center: [{ imgSrc: type.icon }]\n }\n },\n type: \"actionable\"\n };\n })\n };\n return categoryGroup;\n};\n\nexport const mapDataTypesToList = (\n dataTypes: DataTypeData[]\n): ActionListModel => {\n return dataTypes.map((dataType, index) => {\n return {\n caption: dataType.name,\n id: dataType.name,\n additionalInformation: {\n \"stretch-start\": {\n center: [{ imgSrc: dataType.icon || undefined }]\n }\n },\n type: \"actionable\",\n order: index\n };\n });\n};\n"]}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/components/data-type-selector/helpers.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,QAA8B,EACT,EAAE;IACvB,MAAM,aAAa,GAAwB;QACzC,OAAO,EAAE,QAAQ,CAAC,IAAI;QACtB,EAAE,EAAE,QAAQ,CAAC,IAAI;QACjB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC/B,OAAO;gBACL,OAAO,EAAE,IAAI,CAAC,IAAI;gBAClB,EAAE,EAAE,IAAI,CAAC,IAAI;gBACb,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,qBAAqB,EAAE;oBACrB,eAAe,EAAE;wBACf,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;qBAChC;iBACF;gBACD,IAAI,EAAE,YAAY;aACnB,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;IACF,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,SAAyB,EACR,EAAE;IACnB,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;QACvC,OAAO;YACL,OAAO,EAAE,QAAQ,CAAC,IAAI;YACtB,EAAE,EAAE,QAAQ,CAAC,IAAI;YACjB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,qBAAqB,EAAE;gBACrB,eAAe,EAAE;oBACf,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,IAAI,SAAS,EAAE,CAAC;iBACjD;aACF;YACD,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,KAAK;SACb,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { DataTypeCategoryData, DataTypeData } from \"./data-type-selector\";\nimport {\n ActionListItemGroup,\n ActionListModel\n} from \"@genexus/chameleon-controls-library/dist/types/components/action-list/types\";\n\nexport const mapCategoryToListItemGroup = (\n category: DataTypeCategoryData\n): ActionListItemGroup => {\n const categoryGroup: ActionListItemGroup = {\n caption: category.name,\n id: category.name,\n type: \"group\",\n expanded: true,\n expandable: true,\n items: category.types.map(type => {\n return {\n caption: type.name,\n id: type.name,\n selected: type.selected,\n additionalInformation: {\n \"stretch-start\": {\n center: [{ imgSrc: type.icon }]\n }\n },\n type: \"actionable\"\n };\n })\n };\n return categoryGroup;\n};\n\nexport const mapDataTypesToList = (\n dataTypes: DataTypeData[]\n): ActionListModel => {\n return dataTypes.map((dataType, index) => {\n return {\n caption: dataType.name,\n id: dataType.name,\n selected: dataType.selected,\n additionalInformation: {\n \"stretch-start\": {\n center: [{ imgSrc: dataType.icon || undefined }]\n }\n },\n type: \"actionable\",\n order: index\n };\n });\n};\n"]}
@@ -126,13 +126,11 @@ export class FileUploader {
126
126
  const stateWithPromise = Object.assign(Object.assign({}, this.fileStates.get(id)), { uploadPromise });
127
127
  this.fileStates = new Map(this.fileStates.set(id, stateWithPromise));
128
128
  const result = await uploadPromise;
129
- console.log("Upload result:", { id, result });
130
129
  const state = this.fileStates.get(id);
131
130
  if (state) {
132
131
  if (result.success && result.remoteId) {
133
132
  const updatedState = Object.assign(Object.assign({}, state), { remoteId: result.remoteId, pending: false, progress: 100 });
134
133
  this.fileStates = new Map(this.fileStates.set(id, updatedState));
135
- console.log("File uploaded successfully:", updatedState);
136
134
  await ((_a = this.fileUploadedCallback) === null || _a === void 0 ? void 0 : _a.call(this, {
137
135
  name: state.name,
138
136
  originalName: state.file.name,
@@ -142,7 +140,6 @@ export class FileUploader {
142
140
  else {
143
141
  const updatedState = Object.assign(Object.assign({}, state), { error: ((_b = result.errors) === null || _b === void 0 ? void 0 : _b.upload) || "Upload failed", pending: false });
144
142
  this.fileStates = new Map(this.fileStates.set(id, updatedState));
145
- console.log("File upload failed:", updatedState);
146
143
  }
147
144
  }
148
145
  }
@@ -153,7 +150,6 @@ export class FileUploader {
153
150
  ? error.message
154
151
  : "Unknown error occurred", pending: false });
155
152
  this.fileStates = new Map(this.fileStates.set(id, updatedState));
156
- console.log("File upload error:", updatedState);
157
153
  }
158
154
  }
159
155
  }
@@ -227,14 +223,6 @@ export class FileUploader {
227
223
  const uploadedFiles = Array.from(this.fileStates.values())
228
224
  .filter(file => {
229
225
  const isValid = !file.pending && file.remoteId && !file.error;
230
- console.log("File validation:", {
231
- id: file.id,
232
- name: file.name,
233
- pending: file.pending,
234
- remoteId: file.remoteId,
235
- error: file.error,
236
- isValid
237
- });
238
226
  return isValid;
239
227
  })
240
228
  .map(file => ({
@@ -242,7 +230,6 @@ export class FileUploader {
242
230
  originalName: file.file.name,
243
231
  remoteId: file.remoteId
244
232
  }));
245
- console.log("Files to be confirmed:", uploadedFiles);
246
233
  if (uploadedFiles.length > 0) {
247
234
  await ((_a = this.dialogConfirmedCallback) === null || _a === void 0 ? void 0 : _a.call(this, uploadedFiles));
248
235
  }