@genexus/genexus-ide-ui 1.0.48 → 1.0.50
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.
- package/dist/{esm/MERCURY_ASSETS-91a1db9c.js → cjs/MERCURY_ASSETS-ac982891.js} +2 -4
- package/dist/cjs/MERCURY_ASSETS-ac982891.js.map +1 -0
- package/dist/cjs/assets-manager-7227a74b.js +7 -0
- package/dist/cjs/assets-manager-7227a74b.js.map +1 -0
- package/dist/cjs/code-render-9b3efb53.js +50 -0
- package/dist/cjs/code-render-9b3efb53.js.map +1 -0
- package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
- package/dist/cjs/gx-ide-ai-message.cjs.entry.js +3 -2
- package/dist/cjs/gx-ide-ai-message.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-chat-container.cjs.entry.js +62 -0
- package/dist/cjs/gx-ide-chat-container.cjs.entry.js.map +1 -0
- package/dist/cjs/gx-ide-create-kb-from-server.cjs.entry.js +4 -3
- package/dist/cjs/gx-ide-create-kb-from-server.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-current-user-info.cjs.entry.js +3 -2
- package/dist/cjs/gx-ide-current-user-info.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-dashboard-home.cjs.entry.js +3 -2
- package/dist/cjs/gx-ide-dashboard-home.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-data-selector.cjs.entry.js +3 -2
- package/dist/cjs/gx-ide-data-selector.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-data-type-selector.cjs.entry.js +3 -2
- package/dist/cjs/gx-ide-data-type-selector.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-design-import.cjs.entry.js +8 -7
- package/dist/cjs/gx-ide-design-import.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-entity-selector.cjs.entry.js +4 -3
- package/dist/cjs/gx-ide-entity-selector.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-kb-manager-export.cjs.entry.js +7 -6
- package/dist/cjs/gx-ide-kb-manager-export.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-kb-manager-import.cjs.entry.js +6 -5
- package/dist/cjs/gx-ide-kb-manager-import.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-manage-module-references-v2.cjs.entry.js +4 -3
- package/dist/cjs/gx-ide-manage-module-references-v2.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-manage-module-references.cjs.entry.js +4 -3
- package/dist/cjs/gx-ide-manage-module-references.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-new-kb.cjs.entry.js +3 -2
- package/dist/cjs/gx-ide-new-kb.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-object-selector.cjs.entry.js +4 -3
- package/dist/cjs/gx-ide-object-selector.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-sc-chat-container.cjs.entry.js +286 -0
- package/dist/cjs/gx-ide-sc-chat-container.cjs.entry.js.map +1 -0
- package/dist/cjs/gx-ide-share-kb.cjs.entry.js +3 -2
- package/dist/cjs/gx-ide-share-kb.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-start-page.cjs.entry.js +6 -5
- package/dist/cjs/gx-ide-start-page.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-welcome-page.cjs.entry.js +3 -2
- package/dist/cjs/gx-ide-welcome-page.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-ww-attributes.cjs.entry.js +3 -2
- package/dist/cjs/gx-ide-ww-attributes.cjs.entry.js.map +1 -1
- package/dist/cjs/index.cjs.js +9 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/_helpers/chat-container/chat-container.css +178 -0
- package/dist/collection/components/_helpers/chat-container/chat-container.js +137 -0
- package/dist/collection/components/_helpers/chat-container/chat-container.js.map +1 -0
- package/dist/collection/components/_helpers/chat-container/code-render.js +42 -0
- package/dist/collection/components/_helpers/chat-container/code-render.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/showcase/chat-container/callbacks.js +247 -0
- package/dist/collection/showcase/chat-container/callbacks.js.map +1 -0
- package/dist/collection/showcase/chat-container/chat-showcase.css +4 -0
- package/dist/collection/showcase/chat-container/chat.showcase.js +57 -0
- package/dist/collection/showcase/chat-container/chat.showcase.js.map +1 -0
- package/dist/collection/testing/locale.e2e.js +4 -0
- package/dist/collection/testing/locale.e2e.js.map +1 -1
- package/dist/components/MERCURY_ASSETS.js +0 -4
- package/dist/components/MERCURY_ASSETS.js.map +1 -1
- package/dist/components/ai-message.js +2 -1
- package/dist/components/ai-message.js.map +1 -1
- package/dist/components/assets-manager.js +5 -0
- package/dist/components/assets-manager.js.map +1 -0
- package/dist/components/chat-container.js +78 -0
- package/dist/components/chat-container.js.map +1 -0
- package/dist/components/code-render.js +47 -0
- package/dist/components/code-render.js.map +1 -0
- package/dist/components/entity-selector.js +2 -1
- package/dist/components/entity-selector.js.map +1 -1
- package/dist/components/gx-ide-chat-container.d.ts +11 -0
- package/dist/components/gx-ide-chat-container.js +8 -0
- package/dist/components/gx-ide-chat-container.js.map +1 -0
- package/dist/components/gx-ide-create-kb-from-server.js +2 -1
- package/dist/components/gx-ide-create-kb-from-server.js.map +1 -1
- package/dist/components/gx-ide-current-user-info.js +2 -1
- package/dist/components/gx-ide-current-user-info.js.map +1 -1
- package/dist/components/gx-ide-dashboard-home.js +2 -1
- package/dist/components/gx-ide-dashboard-home.js.map +1 -1
- package/dist/components/gx-ide-data-selector.js +2 -1
- package/dist/components/gx-ide-data-selector.js.map +1 -1
- package/dist/components/gx-ide-data-type-selector.js +2 -1
- package/dist/components/gx-ide-data-type-selector.js.map +1 -1
- package/dist/components/gx-ide-design-import.js +2 -1
- package/dist/components/gx-ide-design-import.js.map +1 -1
- package/dist/components/gx-ide-kb-manager-export.js +2 -1
- package/dist/components/gx-ide-kb-manager-export.js.map +1 -1
- package/dist/components/gx-ide-kb-manager-import.js +2 -1
- package/dist/components/gx-ide-kb-manager-import.js.map +1 -1
- package/dist/components/gx-ide-manage-module-references-v2.js +2 -1
- package/dist/components/gx-ide-manage-module-references-v2.js.map +1 -1
- package/dist/components/gx-ide-manage-module-references.js +2 -1
- package/dist/components/gx-ide-manage-module-references.js.map +1 -1
- package/dist/components/gx-ide-new-kb.js +2 -1
- package/dist/components/gx-ide-new-kb.js.map +1 -1
- package/dist/components/gx-ide-object-selector.js +2 -1
- package/dist/components/gx-ide-object-selector.js.map +1 -1
- package/dist/components/gx-ide-sc-chat-container.d.ts +11 -0
- package/dist/components/gx-ide-sc-chat-container.js +308 -0
- package/dist/components/gx-ide-sc-chat-container.js.map +1 -0
- package/dist/components/gx-ide-share-kb.js +2 -1
- package/dist/components/gx-ide-share-kb.js.map +1 -1
- package/dist/components/gx-ide-start-page.js +2 -1
- package/dist/components/gx-ide-start-page.js.map +1 -1
- package/dist/components/gx-ide-welcome-page.js +2 -1
- package/dist/components/gx-ide-welcome-page.js.map +1 -1
- package/dist/components/gx-ide-ww-attributes.js +2 -1
- package/dist/components/gx-ide-ww-attributes.js.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/{cjs/MERCURY_ASSETS-fbc83c8c.js → esm/MERCURY_ASSETS-9e4e8ebc.js} +1 -7
- package/dist/esm/MERCURY_ASSETS-9e4e8ebc.js.map +1 -0
- package/dist/esm/assets-manager-0d129105.js +5 -0
- package/dist/esm/assets-manager-0d129105.js.map +1 -0
- package/dist/esm/code-render-79798e42.js +47 -0
- package/dist/esm/code-render-79798e42.js.map +1 -0
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-ai-message.entry.js +2 -1
- package/dist/esm/gx-ide-ai-message.entry.js.map +1 -1
- package/dist/esm/gx-ide-chat-container.entry.js +58 -0
- package/dist/esm/gx-ide-chat-container.entry.js.map +1 -0
- package/dist/esm/gx-ide-create-kb-from-server.entry.js +2 -1
- package/dist/esm/gx-ide-create-kb-from-server.entry.js.map +1 -1
- package/dist/esm/gx-ide-current-user-info.entry.js +2 -1
- package/dist/esm/gx-ide-current-user-info.entry.js.map +1 -1
- package/dist/esm/gx-ide-dashboard-home.entry.js +2 -1
- package/dist/esm/gx-ide-dashboard-home.entry.js.map +1 -1
- package/dist/esm/gx-ide-data-selector.entry.js +2 -1
- package/dist/esm/gx-ide-data-selector.entry.js.map +1 -1
- package/dist/esm/gx-ide-data-type-selector.entry.js +2 -1
- package/dist/esm/gx-ide-data-type-selector.entry.js.map +1 -1
- package/dist/esm/gx-ide-design-import.entry.js +2 -1
- package/dist/esm/gx-ide-design-import.entry.js.map +1 -1
- package/dist/esm/gx-ide-entity-selector.entry.js +2 -1
- package/dist/esm/gx-ide-entity-selector.entry.js.map +1 -1
- package/dist/esm/gx-ide-kb-manager-export.entry.js +2 -1
- package/dist/esm/gx-ide-kb-manager-export.entry.js.map +1 -1
- package/dist/esm/gx-ide-kb-manager-import.entry.js +2 -1
- package/dist/esm/gx-ide-kb-manager-import.entry.js.map +1 -1
- package/dist/esm/gx-ide-manage-module-references-v2.entry.js +2 -1
- package/dist/esm/gx-ide-manage-module-references-v2.entry.js.map +1 -1
- package/dist/esm/gx-ide-manage-module-references.entry.js +2 -1
- package/dist/esm/gx-ide-manage-module-references.entry.js.map +1 -1
- package/dist/esm/gx-ide-new-kb.entry.js +2 -1
- package/dist/esm/gx-ide-new-kb.entry.js.map +1 -1
- package/dist/esm/gx-ide-object-selector.entry.js +2 -1
- package/dist/esm/gx-ide-object-selector.entry.js.map +1 -1
- package/dist/esm/gx-ide-sc-chat-container.entry.js +282 -0
- package/dist/esm/gx-ide-sc-chat-container.entry.js.map +1 -0
- package/dist/esm/gx-ide-share-kb.entry.js +2 -1
- package/dist/esm/gx-ide-share-kb.entry.js.map +1 -1
- package/dist/esm/gx-ide-start-page.entry.js +2 -1
- package/dist/esm/gx-ide-start-page.entry.js.map +1 -1
- package/dist/esm/gx-ide-welcome-page.entry.js +2 -1
- package/dist/esm/gx-ide-welcome-page.entry.js.map +1 -1
- package/dist/esm/gx-ide-ww-attributes.entry.js +2 -1
- package/dist/esm/gx-ide-ww-attributes.entry.js.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
- package/dist/genexus-ide-ui/index.esm.js +6 -0
- package/dist/genexus-ide-ui/index.esm.js.map +1 -1
- package/dist/genexus-ide-ui/{p-aa324232.entry.js → p-1a629aa9.entry.js} +4 -2
- package/dist/genexus-ide-ui/{p-aa324232.entry.js.map → p-1a629aa9.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/{p-18317dd7.entry.js → p-1e29cd30.entry.js} +4 -2
- package/dist/genexus-ide-ui/{p-18317dd7.entry.js.map → p-1e29cd30.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/{p-af05e095.entry.js → p-1ea6c3fe.entry.js} +13 -11
- package/dist/genexus-ide-ui/{p-af05e095.entry.js.map → p-1ea6c3fe.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/{p-a1c5775d.entry.js → p-2145674e.entry.js} +4 -2
- package/dist/genexus-ide-ui/{p-a1c5775d.entry.js.map → p-2145674e.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/{p-ec6129c7.entry.js → p-2cefd33a.entry.js} +4 -2
- package/dist/genexus-ide-ui/{p-ec6129c7.entry.js.map → p-2cefd33a.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/{p-f252dd07.entry.js → p-36fecdcb.entry.js} +10 -8
- package/dist/genexus-ide-ui/{p-f252dd07.entry.js.map → p-36fecdcb.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/{p-f827b9b8.entry.js → p-3ca45936.entry.js} +4 -2
- package/dist/genexus-ide-ui/{p-f827b9b8.entry.js.map → p-3ca45936.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/{p-a8739942.entry.js → p-440742f3.entry.js} +4 -2
- package/dist/genexus-ide-ui/{p-a8739942.entry.js.map → p-440742f3.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/{p-a40648dc.entry.js → p-442e30e3.entry.js} +4 -2
- package/dist/genexus-ide-ui/{p-a40648dc.entry.js.map → p-442e30e3.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/{p-2dcfa6ef.entry.js → p-47d4ec9a.entry.js} +33 -31
- package/dist/genexus-ide-ui/{p-2dcfa6ef.entry.js.map → p-47d4ec9a.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/p-6e4208d8.js +9 -0
- package/dist/genexus-ide-ui/p-6e4208d8.js.map +1 -0
- package/dist/genexus-ide-ui/{p-64f2a9f4.entry.js → p-7be438dc.entry.js} +10 -8
- package/dist/genexus-ide-ui/{p-64f2a9f4.entry.js.map → p-7be438dc.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/p-8558e873.entry.js +224 -0
- package/dist/genexus-ide-ui/p-8558e873.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-8cebb078.entry.js → p-8942f4b6.entry.js} +4 -2
- package/dist/genexus-ide-ui/{p-8cebb078.entry.js.map → p-8942f4b6.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/{p-9e34f166.entry.js → p-9cfd7800.entry.js} +4 -2
- package/dist/genexus-ide-ui/{p-9e34f166.entry.js.map → p-9cfd7800.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/{p-1986d34d.js → p-ad5caf61.js} +1 -10
- package/dist/genexus-ide-ui/p-ad5caf61.js.map +1 -0
- package/dist/genexus-ide-ui/{p-c1162623.entry.js → p-b1eb312d.entry.js} +15 -13
- package/dist/genexus-ide-ui/{p-c1162623.entry.js.map → p-b1eb312d.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/p-c1791757.entry.js +87 -0
- package/dist/genexus-ide-ui/p-c1791757.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-1feae6ef.entry.js → p-c4c48a1e.entry.js} +4 -2
- package/dist/genexus-ide-ui/{p-1feae6ef.entry.js.map → p-c4c48a1e.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/{p-e4bbec21.entry.js → p-cfef5956.entry.js} +4 -2
- package/dist/genexus-ide-ui/{p-e4bbec21.entry.js.map → p-cfef5956.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/{p-92c51f3e.entry.js → p-e14affde.entry.js} +4 -2
- package/dist/genexus-ide-ui/{p-92c51f3e.entry.js.map → p-e14affde.entry.js.map} +1 -1
- package/dist/genexus-ide-ui/p-f3f1e1f6.js +68 -0
- package/dist/genexus-ide-ui/p-f3f1e1f6.js.map +1 -0
- package/dist/genexus-ide-ui/{p-0c60c76f.entry.js → p-f7d2a39a.entry.js} +11 -9
- package/dist/genexus-ide-ui/{p-0c60c76f.entry.js.map → p-f7d2a39a.entry.js.map} +1 -1
- package/dist/types/components/_helpers/chat-container/chat-container.d.ts +23 -0
- package/dist/types/components/_helpers/chat-container/code-render.d.ts +4 -0
- package/dist/types/components.d.ts +54 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/showcase/chat-container/callbacks.d.ts +6 -0
- package/dist/types/showcase/chat-container/chat.showcase.d.ts +6 -0
- package/package.json +1 -1
- package/dist/cjs/MERCURY_ASSETS-fbc83c8c.js.map +0 -1
- package/dist/esm/MERCURY_ASSETS-91a1db9c.js.map +0 -1
- package/dist/genexus-ide-ui/p-1986d34d.js.map +0 -1
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { r as e, h as t, H as n } from "./p-49712340.js";
|
|
2
|
+
|
|
3
|
+
import { m as a } from "./p-f3f1e1f6.js";
|
|
4
|
+
|
|
5
|
+
import "./p-ad5caf61.js";
|
|
6
|
+
|
|
7
|
+
const o = "{{ASSISTANT_NAME}}";
|
|
8
|
+
|
|
9
|
+
let s;
|
|
10
|
+
|
|
11
|
+
const r = `\n ### Code block {#code-block}\n To create code blocks, you’ll use three backticks (\` \`\`\` \`) or three tildes (\`~~~\`) on the lines before and after the code block.\n \n \`\`\`\n {\n "firstName": "John",\n "lastName": "Smith",\n "age": 25\n }\n \`\`\`\n \n Another way to create code blocks is to indent every line of the block by at least four spaces or one tab.\n \n <html>\n <head>\n </head>\n </html>\n \n \n #### Syntax Highlighting {#syntax-highlighting}\n This feature allows you to add color highlighting for whatever language your code was written in.\n To add syntax highlighting, specify a language next to the backticks before the fenced code block.\n \n \`\`\`json\n {\n "firstName": "John",\n "lastName": "Smith",\n "age": 25\n }\n \`\`\`\n \n \`\`\`javascript\n import React from 'react'\n import ReactDOM from 'react-dom'\n import Markdown from 'react-markdown'\n import rehypeHighlight from 'rehype-highlight'\n \n const markdown = \`\n # Your markdown here\n \`\n \n ReactDOM.render(\n <Markdown rehypePlugins={[rehypeHighlight]}>{markdown}</Markdown>,\n document.querySelector('#content')\n )\n \`\`\`\n \n ### Horizontal Rules {#horizontal-rules}\n To create a horizontal rule, use three or more asterisks (\`***\`), dashes (\`---\`), or underscores (\`___\`) on a line by themselves.\n `;
|
|
12
|
+
|
|
13
|
+
const i = `\n ### Code block {#code-block}\n To create code blocks, you’ll use three backticks (\` \`\`\` \`) or three tildes (\`~~~\`) on the lines before and after the code block.\n \n \`\`\`json\n {\n "firstName": "John",\n "lastName": "Smith",\n "age": 25\n }\n \`\`\`\n `;
|
|
14
|
+
|
|
15
|
+
const sendChatToLLM = () => {
|
|
16
|
+
// This is a WA to get the chat reference
|
|
17
|
+
const e = document.querySelector("ch-chat");
|
|
18
|
+
e.addNewMessage({
|
|
19
|
+
id: `${(new Date).getTime()}`,
|
|
20
|
+
role: "assistant",
|
|
21
|
+
content: "Analyzing",
|
|
22
|
+
status: "waiting"
|
|
23
|
+
});
|
|
24
|
+
s = setTimeout((() => {
|
|
25
|
+
e.updateLastMessage({
|
|
26
|
+
role: "assistant",
|
|
27
|
+
content: "Processing with Chat with LLMs",
|
|
28
|
+
status: "waiting"
|
|
29
|
+
}, "replace");
|
|
30
|
+
s = setTimeout((() => {
|
|
31
|
+
dummyStreaming(e, 20, r, "replace");
|
|
32
|
+
}), 200);
|
|
33
|
+
}), 200);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
function dummyStreaming(e, t, n, a) {
|
|
37
|
+
s = setTimeout((() => {
|
|
38
|
+
const o = t >= n.length;
|
|
39
|
+
e.updateLastMessage({
|
|
40
|
+
role: "assistant",
|
|
41
|
+
content: {
|
|
42
|
+
message: n.substring(t - 20, t),
|
|
43
|
+
files: o ? [ {
|
|
44
|
+
url: "https://next.genexus.ai",
|
|
45
|
+
caption: "Mars Exploration Contract"
|
|
46
|
+
}, {
|
|
47
|
+
url: "https://gx-chameleon.netlify.app",
|
|
48
|
+
caption: "Venus Exploration Contract"
|
|
49
|
+
} ] : undefined
|
|
50
|
+
},
|
|
51
|
+
status: o ? "complete" : "streaming"
|
|
52
|
+
}, a);
|
|
53
|
+
if (!o) {
|
|
54
|
+
dummyStreaming(e, t + 20, n, "concat");
|
|
55
|
+
}
|
|
56
|
+
}), t % 200 === 0 ? 50 : 40);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const c = {
|
|
60
|
+
clear: () => new Promise((e => e())),
|
|
61
|
+
sendChatToLLM,
|
|
62
|
+
uploadImage: () => new Promise((e => e(""))),
|
|
63
|
+
stopGeneratingAnswer: () => {
|
|
64
|
+
clearTimeout(s);
|
|
65
|
+
// This is a WA to get the chat reference
|
|
66
|
+
const e = document.querySelector("ch-chat");
|
|
67
|
+
e.updateLastMessage({
|
|
68
|
+
role: "assistant",
|
|
69
|
+
content: "",
|
|
70
|
+
status: "complete"
|
|
71
|
+
}, "concat");
|
|
72
|
+
return new Promise((e => setTimeout((() => e), 10)));
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const d = {
|
|
77
|
+
accessibleName: {
|
|
78
|
+
clearChat: "Clear chat",
|
|
79
|
+
copyResponseButton: "Copy assistant response",
|
|
80
|
+
downloadCodeButton: "Download code",
|
|
81
|
+
imagePicker: "Select images",
|
|
82
|
+
removeUploadedImage: "Remove uploaded image",
|
|
83
|
+
sendButton: "Send",
|
|
84
|
+
sendInput: "Message",
|
|
85
|
+
stopGeneratingAnswerButton: "Stop generating answer"
|
|
86
|
+
},
|
|
87
|
+
placeholder: {
|
|
88
|
+
sendInput: "Ask me a question..."
|
|
89
|
+
},
|
|
90
|
+
text: {
|
|
91
|
+
copyCodeButton: "Copy code",
|
|
92
|
+
processing: `Processing with ${o}`,
|
|
93
|
+
sourceFiles: "Source files:"
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
Array.from({
|
|
98
|
+
length: 40
|
|
99
|
+
}, ((e, t) => t % 2 === 0 ? {
|
|
100
|
+
id: `index: ${t}`,
|
|
101
|
+
role: "user",
|
|
102
|
+
content: `index: ${t}` + `index: ${t}\n` + `index: ${t}\n` + `index: ${t}\n` + `index: ${t}\n` + `index: ${t}\n` + `index: ${t}\n`
|
|
103
|
+
} : {
|
|
104
|
+
id: `index: ${t}`,
|
|
105
|
+
role: "assistant",
|
|
106
|
+
content: i + `\nindex: ${t}\n` + `index: ${t}\n` + `index: ${t}\n` + `index: ${t}\n` + `index: ${t}\n` + `index: ${t}\n` + `index: ${t}\n`
|
|
107
|
+
}));
|
|
108
|
+
|
|
109
|
+
const l = [ {
|
|
110
|
+
id: "1",
|
|
111
|
+
role: "user",
|
|
112
|
+
content: "Please give me an example about...",
|
|
113
|
+
metadata: "14:55"
|
|
114
|
+
}, {
|
|
115
|
+
id: "2",
|
|
116
|
+
role: "assistant",
|
|
117
|
+
status: "complete",
|
|
118
|
+
content: "Action required example. Action required example. Action required example.",
|
|
119
|
+
metadata: "14:56"
|
|
120
|
+
}, {
|
|
121
|
+
id: "3",
|
|
122
|
+
role: "assistant",
|
|
123
|
+
status: "complete",
|
|
124
|
+
content: "Warning in request",
|
|
125
|
+
metadata: "14:57",
|
|
126
|
+
parts: "warning"
|
|
127
|
+
}, {
|
|
128
|
+
id: "4",
|
|
129
|
+
role: "error",
|
|
130
|
+
content: "Error in Request",
|
|
131
|
+
metadata: "14:58"
|
|
132
|
+
}, {
|
|
133
|
+
id: "5",
|
|
134
|
+
role: "assistant",
|
|
135
|
+
status: "complete",
|
|
136
|
+
content: "Warning in request",
|
|
137
|
+
metadata: "14:59",
|
|
138
|
+
parts: "success"
|
|
139
|
+
}, {
|
|
140
|
+
id: "6",
|
|
141
|
+
role: "user",
|
|
142
|
+
content: "Implement the function calculate_average_grade in grades.py that takes a list of grades as input and returns the average grade as a floating-point number",
|
|
143
|
+
metadata: "15:00"
|
|
144
|
+
}, {
|
|
145
|
+
id: "7",
|
|
146
|
+
role: "assistant",
|
|
147
|
+
status: "complete",
|
|
148
|
+
content: "You can provide further details or updates regarding your support ticket and its associated code. Your input here helps us better understand and address your issue effectively.",
|
|
149
|
+
metadata: "15:01"
|
|
150
|
+
}, {
|
|
151
|
+
id: "8",
|
|
152
|
+
role: "assistant",
|
|
153
|
+
status: "waiting",
|
|
154
|
+
content: "Processing Request"
|
|
155
|
+
}, {
|
|
156
|
+
id: "9",
|
|
157
|
+
role: "assistant",
|
|
158
|
+
status: "complete",
|
|
159
|
+
content: i
|
|
160
|
+
} ];
|
|
161
|
+
|
|
162
|
+
const h = ":host{block-size:100%;display:grid}";
|
|
163
|
+
|
|
164
|
+
var m = undefined && undefined.__classPrivateFieldGet || function(e, t, n, a) {
|
|
165
|
+
if (n === "a" && !a) throw new TypeError("Private accessor was defined without a getter");
|
|
166
|
+
if (typeof t === "function" ? e !== t || !a : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
167
|
+
return n === "m" ? a : n === "a" ? a.call(e) : a ? a.value : t.get(e);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
var u = undefined && undefined.__classPrivateFieldSet || function(e, t, n, a, o) {
|
|
171
|
+
if (a === "m") throw new TypeError("Private method is not writable");
|
|
172
|
+
if (a === "a" && !o) throw new TypeError("Private accessor was defined without a setter");
|
|
173
|
+
if (typeof t === "function" ? e !== t || !o : !t.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
174
|
+
return a === "a" ? o.call(e, n) : o ? o.value = n : t.set(e, n), n;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
var p, g, f;
|
|
178
|
+
|
|
179
|
+
const w = [ "resets/box-sizing", "components/chat" ];
|
|
180
|
+
|
|
181
|
+
const y = class {
|
|
182
|
+
constructor(t) {
|
|
183
|
+
e(this, t);
|
|
184
|
+
p.set(this, void 0);
|
|
185
|
+
g.set(this, (() => {
|
|
186
|
+
m(this, p, "f").showCopyConversationMessage();
|
|
187
|
+
}));
|
|
188
|
+
f.set(this, (() => {
|
|
189
|
+
console.log("delete messages");
|
|
190
|
+
}));
|
|
191
|
+
this.showAdditionalContent = false;
|
|
192
|
+
this.conversationCopied = false;
|
|
193
|
+
}
|
|
194
|
+
render() {
|
|
195
|
+
return t(n, null, t("ch-theme", {
|
|
196
|
+
model: w
|
|
197
|
+
}), t("gx-ide-chat-container", {
|
|
198
|
+
chatTitle: "GeneXus Assistant",
|
|
199
|
+
copyConversationCallback: m(this, g, "f"),
|
|
200
|
+
deleteConversationCallback: m(this, f, "f"),
|
|
201
|
+
ref: e => u(this, p, e, "f")
|
|
202
|
+
}, t("ch-chat", {
|
|
203
|
+
callbacks: c,
|
|
204
|
+
class: "chat",
|
|
205
|
+
generatingResponse: false,
|
|
206
|
+
loadingState: "all-records-loaded",
|
|
207
|
+
markdownTheme: "mercury/markdown-viewer",
|
|
208
|
+
renderItem: a("mercury/markdown-viewer"),
|
|
209
|
+
isMobile: false,
|
|
210
|
+
items: l,
|
|
211
|
+
showAdditionalContent: this.showAdditionalContent,
|
|
212
|
+
translations: d
|
|
213
|
+
}, t("div", {
|
|
214
|
+
slot: "additional-content"
|
|
215
|
+
}, "Custom content that is rendered when the chat renders content"))));
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
p = new WeakMap, g = new WeakMap, f = new WeakMap;
|
|
220
|
+
|
|
221
|
+
y.style = h;
|
|
222
|
+
|
|
223
|
+
export { y as gx_ide_sc_chat_container };
|
|
224
|
+
//# sourceMappingURL=p-8558e873.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PROCESSING_PLACEHOLDER","timeOut","ASSISTANT_RESPONSE_MARKDOWN","ASSISTANT_RESPONSE_SHORT_MARKDOWN","sendChatToLLM","chatRef","document","querySelector","addNewMessage","id","Date","getTime","role","content","status","setTimeout","updateLastMessage","dummyStreaming","counter","stringToDisplay","mode","streamingCompleted","length","message","substring","files","url","caption","undefined","chatCallbacks","clear","Promise","resolve","uploadImage","stopGeneratingAnswer","clearTimeout","chatTranslations","accessibleName","clearChat","copyResponseButton","downloadCodeButton","imagePicker","removeUploadedImage","sendButton","sendInput","stopGeneratingAnswerButton","placeholder","text","copyCodeButton","processing","sourceFiles","Array","from","_","index","codeFixerRecord","metadata","parts","chatShowcaseCss","CSS_BUNDLES","GxIdeScChatContainer","_GxIdeScChatContainer_chatContainerRef","set","this","_GxIdeScChatContainer_copyConversationCallbackHandler","__classPrivateFieldGet","showCopyConversationMessage","_GxIdeScChatContainer_deleteConversationCallbackHandler","console","log","render","h","Host","model","chatTitle","copyConversationCallback","deleteConversationCallback","ref","el","__classPrivateFieldSet","callbacks","class","generatingResponse","loadingState","markdownTheme","renderItem","mercuryChatMessageRender","isMobile","items","showAdditionalContent","translations","slot"],"sources":["src/showcase/chat-container/callbacks.ts","src/showcase/chat-container/chat-showcase.scss?tag=gx-ide-sc-chat-container&encapsulation=shadow","src/showcase/chat-container/chat.showcase.tsx"],"sourcesContent":["import {\n ChatInternalCallbacks,\n ChatMessage,\n ChatTranslations\n} from \"@genexus/chameleon-controls-library\";\n\nconst PROCESSING_PLACEHOLDER = \"{{ASSISTANT_NAME}}\";\n\nlet timeOut: NodeJS.Timeout;\n\nconst ASSISTANT_RESPONSE_MARKDOWN = `\n ### Code block {#code-block}\n To create code blocks, you’ll use three backticks (\\` \\`\\`\\` \\`) or three tildes (\\`~~~\\`) on the lines before and after the code block.\n \n \\`\\`\\`\n {\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"age\": 25\n }\n \\`\\`\\`\n \n Another way to create code blocks is to indent every line of the block by at least four spaces or one tab.\n \n <html>\n <head>\n </head>\n </html>\n \n \n #### Syntax Highlighting {#syntax-highlighting}\n This feature allows you to add color highlighting for whatever language your code was written in.\n To add syntax highlighting, specify a language next to the backticks before the fenced code block.\n \n \\`\\`\\`json\n {\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"age\": 25\n }\n \\`\\`\\`\n \n \\`\\`\\`javascript\n import React from 'react'\n import ReactDOM from 'react-dom'\n import Markdown from 'react-markdown'\n import rehypeHighlight from 'rehype-highlight'\n \n const markdown = \\`\n # Your markdown here\n \\`\n \n ReactDOM.render(\n <Markdown rehypePlugins={[rehypeHighlight]}>{markdown}</Markdown>,\n document.querySelector('#content')\n )\n \\`\\`\\`\n \n ### Horizontal Rules {#horizontal-rules}\n To create a horizontal rule, use three or more asterisks (\\`***\\`), dashes (\\`---\\`), or underscores (\\`___\\`) on a line by themselves.\n `;\n\nconst ASSISTANT_RESPONSE_SHORT_MARKDOWN = `\n ### Code block {#code-block}\n To create code blocks, you’ll use three backticks (\\` \\`\\`\\` \\`) or three tildes (\\`~~~\\`) on the lines before and after the code block.\n \n \\`\\`\\`json\n {\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"age\": 25\n }\n \\`\\`\\`\n `;\n\nconst sendChatToLLM = () => {\n // This is a WA to get the chat reference\n const chatRef = document.querySelector(\"ch-chat\") as HTMLChChatElement;\n\n chatRef.addNewMessage({\n id: `${new Date().getTime()}`,\n role: \"assistant\",\n content: \"Analyzing\",\n status: \"waiting\"\n });\n\n timeOut = setTimeout(() => {\n chatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: \"Processing with Chat with LLMs\",\n status: \"waiting\"\n },\n \"replace\"\n );\n\n timeOut = setTimeout(() => {\n dummyStreaming(chatRef, 20, ASSISTANT_RESPONSE_MARKDOWN, \"replace\");\n }, 200);\n }, 200);\n};\n\nfunction dummyStreaming(\n chatRef: HTMLChChatElement,\n counter: number,\n stringToDisplay: string,\n mode: \"concat\" | \"replace\"\n) {\n timeOut = setTimeout(\n () => {\n const streamingCompleted = counter >= stringToDisplay.length;\n\n chatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: {\n message: stringToDisplay.substring(counter - 20, counter),\n files: streamingCompleted\n ? [\n {\n url: \"https://next.genexus.ai\",\n caption: \"Mars Exploration Contract\"\n },\n {\n url: \"https://gx-chameleon.netlify.app\",\n caption: \"Venus Exploration Contract\"\n }\n ]\n : undefined\n },\n status: streamingCompleted ? \"complete\" : \"streaming\"\n },\n mode\n );\n\n if (!streamingCompleted) {\n dummyStreaming(chatRef, counter + 20, stringToDisplay, \"concat\");\n }\n },\n counter % 200 === 0 ? 50 : 40\n );\n}\n\nexport const chatCallbacks: ChatInternalCallbacks = {\n clear: () => new Promise(resolve => resolve()),\n sendChatToLLM: sendChatToLLM,\n uploadImage: () => new Promise(resolve => resolve(\"\")),\n stopGeneratingAnswer: () => {\n clearTimeout(timeOut);\n\n // This is a WA to get the chat reference\n const chatRef = document.querySelector(\"ch-chat\") as HTMLChChatElement;\n\n chatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: \"\",\n status: \"complete\"\n },\n \"concat\"\n );\n\n return new Promise(resolve => setTimeout(() => resolve, 10));\n }\n};\n\nexport const chatTranslations: ChatTranslations = {\n accessibleName: {\n clearChat: \"Clear chat\",\n copyResponseButton: \"Copy assistant response\",\n downloadCodeButton: \"Download code\",\n imagePicker: \"Select images\",\n removeUploadedImage: \"Remove uploaded image\",\n sendButton: \"Send\",\n sendInput: \"Message\",\n stopGeneratingAnswerButton: \"Stop generating answer\"\n },\n placeholder: {\n sendInput: \"Ask me a question...\"\n },\n text: {\n copyCodeButton: \"Copy code\",\n processing: `Processing with ${PROCESSING_PLACEHOLDER}`,\n sourceFiles: \"Source files:\"\n }\n};\n\nexport const chatRecord: ChatMessage[] = [\n { id: \"1\", role: \"user\", content: \"Hello world\" },\n { id: \"2\", role: \"assistant\", content: ASSISTANT_RESPONSE_MARKDOWN },\n { id: \"3\", role: \"user\", content: \"Hello world 1\" },\n { id: \"4\", role: \"assistant\", content: ASSISTANT_RESPONSE_SHORT_MARKDOWN },\n { id: \"5\", role: \"user\", content: \"Hello world 2\" },\n { id: \"6\", role: \"assistant\", content: ASSISTANT_RESPONSE_SHORT_MARKDOWN },\n { id: \"7\", role: \"user\", content: \"Hello world 3\" },\n { id: \"8\", role: \"assistant\", content: ASSISTANT_RESPONSE_SHORT_MARKDOWN },\n { id: \"9\", role: \"user\", content: \"Hello world 4\" },\n { id: \"10\", role: \"assistant\", content: ASSISTANT_RESPONSE_SHORT_MARKDOWN }\n];\n\nexport const longChatRecord: ChatMessage[] = Array.from(\n { length: 40 },\n (_, index) =>\n index % 2 === 0\n ? {\n id: `index: ${index}`,\n role: \"user\",\n content:\n `index: ${index}` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n`\n }\n : {\n id: `index: ${index}`,\n role: \"assistant\",\n content:\n ASSISTANT_RESPONSE_SHORT_MARKDOWN +\n `\\nindex: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n`\n }\n);\n\nexport const codeFixerRecord: ChatMessage[] = [\n {\n id: \"1\",\n role: \"user\",\n content: \"Please give me an example about...\",\n metadata: \"14:55\"\n },\n {\n id: \"2\",\n role: \"assistant\",\n status: \"complete\",\n content:\n \"Action required example. Action required example. Action required example.\",\n metadata: \"14:56\"\n },\n {\n id: \"3\",\n role: \"assistant\",\n status: \"complete\",\n content: \"Warning in request\",\n metadata: \"14:57\",\n parts: \"warning\"\n },\n {\n id: \"4\",\n role: \"error\",\n content: \"Error in Request\",\n metadata: \"14:58\"\n },\n {\n id: \"5\",\n role: \"assistant\",\n status: \"complete\",\n content: \"Warning in request\",\n metadata: \"14:59\",\n parts: \"success\"\n },\n {\n id: \"6\",\n role: \"user\",\n content:\n \"Implement the function calculate_average_grade in grades.py that takes a list of grades as input and returns the average grade as a floating-point number\",\n metadata: \"15:00\"\n },\n {\n id: \"7\",\n role: \"assistant\",\n status: \"complete\",\n content:\n \"You can provide further details or updates regarding your support ticket and its associated code. Your input here helps us better understand and address your issue effectively.\",\n metadata: \"15:01\"\n },\n {\n id: \"8\",\n role: \"assistant\",\n status: \"waiting\",\n content: \"Processing Request\"\n },\n {\n id: \"9\",\n role: \"assistant\",\n status: \"complete\",\n content: ASSISTANT_RESPONSE_SHORT_MARKDOWN\n }\n];\n",":host {\n block-size: 100%;\n display: grid;\n}\n","import { Component, Host, h, State } from \"@stencil/core\";\nimport { mercuryChatMessageRender } from \"../../components/_helpers/chat-container/code-render\";\nimport { MercuryBundles } from \"@genexus/mercury\";\n\nconst CSS_BUNDLES: MercuryBundles = [\"resets/box-sizing\", \"components/chat\"];\n\nimport { chatCallbacks, chatTranslations, codeFixerRecord } from \"./callbacks\";\n\n@Component({\n tag: \"gx-ide-sc-chat-container\",\n styleUrl: \"chat-showcase.scss\",\n shadow: true\n})\nexport class GxIdeScChatContainer {\n #chatContainerRef!: HTMLGxIdeChatContainerElement;\n\n @State() showAdditionalContent: boolean = false;\n @State() conversationCopied: boolean = false;\n\n #copyConversationCallbackHandler = () => {\n this.#chatContainerRef.showCopyConversationMessage();\n };\n\n #deleteConversationCallbackHandler = () => {\n console.log(\"delete messages\");\n };\n\n render() {\n return (\n <Host>\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <gx-ide-chat-container\n chatTitle=\"GeneXus Assistant\"\n copyConversationCallback={this.#copyConversationCallbackHandler}\n deleteConversationCallback={this.#deleteConversationCallbackHandler}\n ref={el =>\n (this.#chatContainerRef = el as HTMLGxIdeChatContainerElement)\n }\n >\n <ch-chat\n callbacks={chatCallbacks}\n class=\"chat\"\n generatingResponse={false}\n loadingState=\"all-records-loaded\"\n markdownTheme=\"mercury/markdown-viewer\"\n renderItem={mercuryChatMessageRender(\"mercury/markdown-viewer\")}\n isMobile={false}\n items={codeFixerRecord}\n showAdditionalContent={this.showAdditionalContent}\n translations={chatTranslations}\n >\n <div slot=\"additional-content\">\n Custom content that is rendered when the chat renders content\n </div>\n </ch-chat>\n </gx-ide-chat-container>\n </Host>\n );\n }\n}\n"],"mappings":";;;;;;AAMA,MAAMA,IAAyB;;AAE/B,IAAIC;;AAEJ,MAAMC,IAA8B;;AAoDpC,MAAMC,IAAoC;;AAa1C,MAAMC,gBAAgB;;EAEpB,MAAMC,IAAUC,SAASC,cAAc;EAEvCF,EAAQG,cAAc;IACpBC,IAAI,IAAG,IAAIC,MAAOC;IAClBC,MAAM;IACNC,SAAS;IACTC,QAAQ;;EAGVb,IAAUc,YAAW;IACnBV,EAAQW,kBACN;MACEJ,MAAM;MACNC,SAAS;MACTC,QAAQ;OAEV;IAGFb,IAAUc,YAAW;MACnBE,eAAeZ,GAAS,IAAIH,GAA6B;AAAU,QAClE;AAAI,MACN;AAAI;;AAGT,SAASe,eACPZ,GACAa,GACAC,GACAC;EAEAnB,IAAUc,YACR;IACE,MAAMM,IAAqBH,KAAWC,EAAgBG;IAEtDjB,EAAQW,kBACN;MACEJ,MAAM;MACNC,SAAS;QACPU,SAASJ,EAAgBK,UAAUN,IAAU,IAAIA;QACjDO,OAAOJ,IACH,EACE;UACEK,KAAK;UACLC,SAAS;WAEX;UACED,KAAK;UACLC,SAAS;cAGbC;;MAENd,QAAQO,IAAqB,aAAa;OAE5CD;IAGF,KAAKC,GAAoB;MACvBJ,eAAeZ,GAASa,IAAU,IAAIC,GAAiB;;MAG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AU;GAEZ;EACE/C,IAAI;EACJG,MAAM;EACNE,QAAQ;EACRD,SAAS;EACT2C,UAAU;EACVC,OAAO;GAET;EACEhD,IAAI;EACJG,MAAM;EACNC,SACE;EACF2C,UAAU;GAEZ;EACE/C,IAAI;EACJG,MAAM;EACNE,QAAQ;EACRD,SACE;EACF2C,UAAU;GAEZ;EACE/C,IAAI;EACJG,MAAM;EACNE,QAAQ;EACRD,SAAS;GAEX;EACEJ,IAAI;EACJG,MAAM;EACNE,QAAQ;EACRD,SAASV;;;ACrSb,MAAMuD,IAAkB;;;;;;;;;;;;;;;;;ACIxB,MAAMC,IAA8B,EAAC,qBAAqB;;MAS7CC,IAAoB;;;IAC/BC,EAAAC,IAAAC,WAAA;IAKAC,EAAAF,IAAAC,OAAmC;MACjCE,EAAAF,MAAIF,GAAA,KAAmBK;AAA6B;IAGtDC,EAAAL,IAAAC,OAAqC;MACnCK,QAAQC,IAAI;AAAkB;iCARU;8BACH;;EAUvC,MAAAC;IACE,OACEC,EAACC,GAAI,MACHD,EAAA;MAAUE,OAAOd;QACjBY,EAAA;MACEG,WAAU;MACVC,0BAA0BV,EAAAF,MAAIC,GAAA;MAC9BY,4BAA4BX,EAAAF,MAAII,GAAA;MAChCU,KAAKC,KACFC,EAAAhB,MAAIF,GAAqBiB,GAAmC;OAG/DP,EAAA;MACES,WAAWnD;MACXoD,OAAM;MACNC,oBAAoB;MACpBC,cAAa;MACbC,eAAc;MACdC,YAAYC,EAAyB;MACrCC,UAAU;MACVC,OAAOjC;MACPkC,uBAAuB1B,KAAK0B;MAC5BC,cAActD;OAEdmC,EAAA;MAAKoB,MAAK;OAAoB"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { r as e, c as t, h as r, H as i, g as a } from "./p-49712340.js";
|
|
2
2
|
|
|
3
|
-
import { g as o } from "./p-
|
|
3
|
+
import { g as o } from "./p-6e4208d8.js";
|
|
4
|
+
|
|
5
|
+
import "./p-ad5caf61.js";
|
|
4
6
|
|
|
5
7
|
import { r as s } from "./p-d1cb5507.js";
|
|
6
8
|
|
|
@@ -470,4 +472,4 @@ c = new WeakMap, g = new WeakMap;
|
|
|
470
472
|
h.style = n;
|
|
471
473
|
|
|
472
474
|
export { h as gx_ide_manage_module_references_v2 };
|
|
473
|
-
//# sourceMappingURL=p-
|
|
475
|
+
//# sourceMappingURL=p-8942f4b6.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["manageModuleReferencesCss","CSS_BUNDLES","GxManageModuleReferencesV2","this","renderedFirstTime","_GxManageModuleReferencesV2_filterIcon","set","getIconPath","category","name","colorType","_GxManageModuleReferencesV2_moduleIcon","onProgress","message","progress","state","data","selectedModuleAction","Object","assign","progressValue","progressState","handleModuleChange","event","selectedModuleId","detail","rowsId","selectedModule","modulesMap","get","moduleActionHandler","module","actionCompleted","closeProgressBar","executeActionCallbackHandler","async","executeActionCallback","moduleSelectedVersionId","id","selectedVersion","moduleSelectedVersionAction","action","selectedServerId","serverSelectedCallbackHandler","showModuleMenu","e","serverContextMenuCallback","buttonBoundingClientRect","target","getBoundingClientRect","selection","clientX","x","clientY","y","searchModulesFilterHandler","searchModulesFilterValue","trim","toLowerCase","getFilteredServerModules","serverModulesExtended","filter","nameMatch","includes","descriptionMatch","description","actionMatch","selectedButtonFilter","filtered","renderGridOrEmptyState","filteredServerModules","length","renderModulesVersionsGrid","renderEmptyStateModules","h","rowSelectionMode","part","class","onSelectionChanged","settingable","size","map","rowid","key","selected","type","color","moduleVersionIconColor","disabled","fit","onClick","stateIconSrc","__classPrivateFieldGet","stateTitle","_componentLocale","modules","noModulesFilter","moduleId","foundModule","find","moduleAction","moduleCurrentVersion","currentVersion","renderVersionIcon","renderVersionName","renderVersionWarningMessage","warningMessage","renderInstalledVersion","caption","cssClass","modulesInformation","moduleProperties","installed","notInstalled","moduleVersionsValueChangedHandler","selectedVersionId","value","updateSelectedModuleVersion","moduleVersionsItemChangedHandler","moduleSelectedVersion","versions","version","updatedSelectedModule","updatedModuleIndex","findIndex","renderModuleVersions","label","availableVersions","labelPosition","centerLabel","onValueChanged","loadingServer","item","onItemSelected","selectedButtonChangedHandler","serverItemSelectedHandler","serverId","serverValueChangedHandler","reloadServer","reload","serverSelectedCallback","serverModules","clear","modulesSelectedVersionMap","forEach","extendedModuleData","push","progressBarCloseHandler","setTimeout","Map","loadingServerHandler","loading","loaderEl","show","componentDidRender","componentDidRenderFirstTime","emit","componentName","componentWillLoad","Locale","getComponentStrings","el","componentDidLoad","servers","render","Host","model","noContentPadding","noAboveFooterPadding","noBorderAboveFooter","containerTitle","displayTitle","selectServer","disableFilter","showServerCommands","icon","searchModules","reduced","fullWidth","onSelectedButtonChanged","buttonsContainer","browse","updates","ref","serversDetail","renderModuleDataProperties","properties","emptyState","title","stateDescription","slot","stateType","noBorder","progressBar","defaultCaption","active","closeType","closedCallback","loaderTitle","container","borderRadius","abortTime"],"sources":["src/components/modules/manage-module-references-v2/manage-module-references.scss?tag=gx-ide-manage-module-references-v2&encapsulation=shadow","src/components/modules/manage-module-references-v2/manage-module-references-v2.tsx"],"sourcesContent":["@import \"../../../global/gx-ide-common.scss\";\n@import \"../../../global/gx-ide-mixins.scss\";\n\n/*--- General ---*/\np,\nul {\n font-size: var(--font-size-lg);\n margin: 0;\n}\np {\n line-height: 1.6em;\n}\n/*--- Header ---*/\n.header {\n align-items: center;\n grid-template-columns: 1fr auto;\n grid-template-rows: 1fr;\n}\n.main {\n display: grid;\n //grid-template-columns: 1fr 2fr 1fr;\n grid-template-columns: 1fr 1fr;\n grid-template-rows: 1fr;\n height: 100%;\n overflow: auto;\n}\nch-grid-columnset {\n display: none;\n}\nch-grid-row[selected] {\n gxg-icon[data-action=\"install\"] {\n //WA to improve visibility\n filter: brightness(2);\n }\n}\n.grid-cell-module {\n &__info {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--mer-spacing--3xs);\n }\n &__name {\n font-weight: var(--mer-font__weight--bold);\n display: flex;\n align-items: center;\n gap: var(--mer-spacing--sm);\n }\n &__name,\n &__description {\n line-height: 1.55em;\n }\n &__description {\n padding-inline-start: 36px;\n }\n}\n\n/*--- Servers Container ---*/\n.grid-container {\n height: 100%;\n overflow: auto;\n gx-ide-empty-state {\n height: 100%;\n }\n}\n.servers-container {\n display: none;\n height: 100%;\n &__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--gxg-list-box-main__padding) var(--gxg-list-box-main__padding)\n 0 var(--gxg-list-box-main__padding);\n\n gxg-button {\n width: 100%;\n }\n }\n}\n\n/*--- Modules (Header) ---*/\n.modules {\n &__header {\n padding: var(--gxg-list-box-main__padding);\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--xs);\n }\n &__combo-container {\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--xs);\n }\n &__server-commands {\n display: flex;\n gap: var(--mer-spacing--xs);\n }\n &__combo {\n gxg-combo-box {\n flex: 1;\n }\n display: flex;\n flex-direction: row;\n gap: var(--mer-spacing--xs);\n }\n &__container {\n border-inline-end: var(--mer-border__width--sm) solid\n var(--gx-ide-container-border-color);\n display: grid;\n grid-template-rows: auto 1fr;\n height: 100%;\n overflow: auto;\n }\n &__main {\n display: grid;\n grid-template-rows: auto 1fr;\n height: 100%;\n overflow: auto;\n\n &-header {\n display: flex;\n padding: var(--mer-spacing--xs);\n flex-direction: column;\n gap: var(--mer-spacing--xs);\n }\n }\n}\n\n/*--- Module Info ---*/\n.module-info {\n display: grid;\n grid-template-rows: auto 1fr;\n height: 100%;\n overflow: auto;\n\n &__title {\n display: flex;\n align-items: center;\n gap: var(--mer-spacing--xs);\n }\n\n &__name {\n display: flex;\n align-items: center;\n gap: var(--mer-spacing--sm);\n --ds-icon-size-box--regular: 24px;\n --ds-icon-size--regular: 24px;\n font-weight: var(--mer-font__weight--bold);\n }\n\n &__header {\n padding: var(--gx-ide-container__padding);\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--xs);\n border-block-end: var(--mer-border__width--sm) solid\n var(--gx-ide-container-border-color);\n }\n\n &__action-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--mer-spacing--xs);\n &:before {\n content: \"\";\n width: var(--mer-spacing--xs);\n height: var(--mer-spacing--xs);\n border-radius: 50%;\n display: block;\n background-color: var(--mer-icon__primary--disabled);\n }\n &--installed:before {\n background-color: var(--mer-icon__primary);\n }\n &--uninstallable:before {\n background-color: var(--mer-icon__warning);\n }\n }\n\n &__warning-message {\n margin-block-start: var(--mer-spacing--2xs);\n background-color: var(--mer-color__tinted-yellow--5);\n color: var(--mer-text__on-elevation);\n border: var(--mer-border__width--sm) solid var(--mer-border-color__warning);\n border-radius: var(--mer-border__radius--sm);\n padding: var(--mer-spacing--xs) var(--mer-spacing--md);\n }\n\n &__divider {\n width: calc(100% - var(--gx-ide-container__padding) * 4);\n padding: 0 var(--gx-ide-container__padding);\n margin: 0 auto;\n border: 0;\n border-block-end: var(--mer-border__width--sm) solid\n var(--gx-ide-container-border-color);\n }\n &__properties {\n display: flex;\n flex-direction: column;\n padding: var(--gx-ide-container__padding);\n gap: var(--mer-spacing--xs);\n overflow: auto;\n }\n}\n\n.md-property {\n display: grid;\n gap: var(--mer-spacing--xs);\n\n &--inline {\n grid-template-columns: auto 1fr;\n }\n &--block {\n }\n &__key {\n font-weight: var(--font-weight-bold);\n max-width: 150px;\n }\n &__value {\n font-size: var(--mer-font__size--2xs);\n }\n &__key,\n &__value {\n > * {\n display: inline-block;\n }\n }\n &__list {\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--xs);\n > ul {\n margin: 0;\n padding: 0;\n list-style-type: none;\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--2xs);\n margin-inline-start: var(--mer-spacing--xs);\n\n li {\n position: relative;\n padding-inline-start: 12px;\n line-height: var(--ds-base-font-line-height--comfortable);\n &::before {\n content: \"\";\n position: absolute;\n left: 0;\n top: 7px;\n display: inline-block;\n width: var(--mer-spacing--2xs);\n height: var(--mer-spacing--2xs);\n background-color: var(--mer-text__on-surface);\n }\n }\n }\n }\n}\n\n.md-property,\n.md-property__list {\n border-block-end: var(--mer-border__width--sm) solid\n var(--gx-ide-container-border-color);\n padding-block-end: var(--mer-spacing--xs);\n\n &:last-child {\n border-block-end: 0;\n padding-block-end: 0;\n }\n}\n\ngxg-ide-loader {\n border-radius: var(--mer-border__radius--md);\n}\n\n.button-wrapper {\n display: grid;\n align-items: center;\n justify-content: center;\n}\n","/* STENCIL IMPORTS */\nimport {\n Component,\n Host,\n h,\n Prop,\n Event,\n Element,\n EventEmitter,\n State,\n Watch\n} from \"@stencil/core\";\n/* OTHER LIBRARIES IMPORTS */\nimport { Color } from \"@genexus/gemini\";\nimport { topStateBarType } from \"@genexus/gemini\";\nimport { TabularGridSelectionChangedEvent } from \"@genexus/chameleon-controls-library\";\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\n/* CUSTOM IMPORTS */\nimport {\n ModuleServerData,\n ModuleData,\n ModuleActionType,\n ModuleFilterType,\n ExtendedModuleData\n} from \"../types\";\nimport { renderModuleDataProperties } from \"../../../common/common\";\nimport { Locale } from \"../../../common/locale\";\nimport { ContextMenuInfo } from \"../../../common/types\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n // \"utils/form\",\n // \"utils/layout\",\n // \"utils/typography\",\n // \"components/button\",\n // \"components/checkbox\",\n // \"components/edit\",\n \"components/tabular-grid\"\n];\n\n@Component({\n tag: \"gx-ide-manage-module-references-v2\",\n styleUrl: \"manage-module-references.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/manage-module-references-v2\"]\n})\nexport class GxManageModuleReferencesV2 {\n // 1.OWN PROPERTIES | WATCH'S //\n\n /**\n * The component hard-coded strings translations.\n */\n private _componentLocale: any;\n private renderedFirstTime = false;\n\n // 2. REFERENCE TO ELEMENTS //\n\n @Element() el: HTMLGxIdeManageModuleReferencesV2Element;\n private loaderEl!: HTMLGxgIdeLoaderElement;\n private serversDetail!: HTMLDivElement;\n\n #filterIcon = getIconPath({\n category: \"system\",\n name: \"filters\",\n colorType: \"on-elevation\"\n });\n #moduleIcon = getIconPath({\n category: \"objects\",\n name: \"module\"\n });\n\n // 3.STATE() VARIABLES //\n\n // Filtering modules\n @State() searchModulesFilterValue: string = \"\";\n @State() selectedButtonFilter: ModuleFilterType = \"browse\";\n @State() serverModules: ModuleData[] = [];\n @State() serverModulesExtended: ExtendedModuleData[] = [];\n @State() filteredServerModules: ExtendedModuleData[] = [];\n @State() modulesMap: Map<string, ExtendedModuleData> = new Map();\n\n @State() selectedModule: ExtendedModuleData;\n @State() selectedServerId: string;\n @State() selectedModuleAction: ActionInfo = {\n message: \"\",\n progress: 0,\n state: \"in-progress\"\n };\n @State() modulesSelectedVersionMap: Map<string, string> = new Map();\n @State() actionCompleted = true;\n @State() closeProgressBar = true;\n @State() progressValue: number = 0;\n @State() progressState: topStateBarType = \"in-progress\";\n @State() loadingServer = false;\n @Watch(\"loadingServer\")\n loadingServerHandler(loading: boolean) {\n if (loading) {\n this.loaderEl.show = true;\n } else {\n this.loaderEl.show = false;\n }\n }\n\n // 4.PUBLIC PROPERTY API //\n\n /**\n * If true it displays the component title on the header\n */\n @Prop() readonly displayTitle = false;\n\n /**\n * List of module servers currently cataloged\n */\n @Prop() readonly servers: ModuleServerData[] = [];\n\n /**\n * Callback invoked when a server is selected. Returns the set of modules available on that server.\n */\n @Prop() readonly serverSelectedCallback: ServerSelectedCallback;\n\n /**\n * Callback invoked when the user wants to execute the action corresponding to a selected module. When the action begins to be executed, the component must be able to show the progress of the action. For this, the onProgress parameter is available, which is in turn a callback used by the host to notify the progress by text message and percentage.\n */\n @Prop() readonly executeActionCallback: ExecuteActionCallback;\n\n /**\n * Callback invoked when an element is right clicked on servers list\n */\n @Prop() readonly serverContextMenuCallback: ServerContextMenuCallback;\n\n /**\n * Allows you to hide the button (...) that executes serverContextMenuCallback, if we do not implement the commands in a first version\n */\n @Prop() readonly showServerCommands: boolean = false;\n\n // 5.EVENTS (EMIT) //\n\n /**\n * This event is emitted once just after the component is fully loaded and the first render() occurs\n */\n @Event() componentDidRenderFirstTime: EventEmitter<boolean>;\n\n // 6.COMPONENT LIFECYCLE EVENTS //\n\n componentDidRender() {\n if (!this.renderedFirstTime) {\n this.componentDidRenderFirstTime.emit(\n this._componentLocale.componentName\n );\n this.renderedFirstTime = true;\n }\n }\n\n async componentWillLoad() {\n this._componentLocale = await Locale.getComponentStrings(this.el);\n }\n\n async componentDidLoad() {\n await this.serverSelectedCallbackHandler(this.servers[0].id, false);\n }\n\n // 7.LISTENERS //\n\n // 8.PUBLIC METHODS API //\n\n // 9.LOCAL METHODS //\n\n /**\n * Callback invoked to get the progress when module is performing an action\n */\n private onProgress = (\n message: string,\n progress: number,\n state: topStateBarType\n ): void => {\n const data = { message, progress, state };\n this.selectedModuleAction = { ...data };\n this.progressValue = this.selectedModuleAction.progress;\n this.progressState = this.selectedModuleAction.state;\n };\n\n /**\n * Used for changing the selected module\n */\n private handleModuleChange = (\n event: CustomEvent<TabularGridSelectionChangedEvent>\n ) => {\n const selectedModuleId = event.detail.rowsId[0];\n this.selectedModule = this.modulesMap.get(selectedModuleId);\n };\n\n private moduleActionHandler = (module: ModuleData) => () => {\n this.actionCompleted = false;\n this.closeProgressBar = false;\n this.executeActionCallbackHandler(module);\n };\n\n /**\n * Perform an action relative to a module using callbackExecuteAction callback and receive the state of that action with onProgress callback\n */\n private executeActionCallbackHandler = async (module: ModuleData) => {\n if (this.executeActionCallback) {\n this.actionCompleted = false;\n const moduleSelectedVersionId = this.modulesMap.get(module.id)\n .selectedVersion.id;\n const moduleSelectedVersionAction = this.modulesMap.get(module.id)\n .selectedVersion.action;\n const actionCompleted = await this.executeActionCallback(\n this.selectedServerId,\n module.id,\n moduleSelectedVersionId,\n moduleSelectedVersionAction,\n this.onProgress\n );\n if (actionCompleted) {\n this.serverSelectedCallbackHandler(this.selectedServerId, false);\n }\n this.actionCompleted = true;\n }\n };\n\n private showModuleMenu = async (e: MouseEvent) => {\n if (this.serverContextMenuCallback) {\n const buttonBoundingClientRect = (\n e.target as HTMLElement\n ).getBoundingClientRect();\n await this.serverContextMenuCallback({\n selection: [this.selectedServerId],\n clientX: buttonBoundingClientRect.x,\n clientY: buttonBoundingClientRect.y\n });\n }\n };\n\n private searchModulesFilterHandler = (e: CustomEvent<string>) => {\n this.searchModulesFilterValue = e.detail.trim().toLowerCase();\n };\n\n private getFilteredServerModules = (): ExtendedModuleData[] => {\n return this.serverModulesExtended.filter(module => {\n // Filter conditions\n const nameMatch = module.selectedVersion.name\n .toLowerCase()\n .includes(this.searchModulesFilterValue);\n const descriptionMatch = module.selectedVersion.description\n .toLowerCase()\n .includes(this.searchModulesFilterValue);\n let actionMatch;\n if (this.selectedButtonFilter === \"browse\") {\n // If browse is selected, display all\n actionMatch = true;\n } else if (this.selectedButtonFilter === \"installed\") {\n actionMatch = !!(\n module.selectedVersion.action === \"update\" ||\n module.selectedVersion.action === \"restore\"\n );\n } else if (this.selectedButtonFilter === \"updates\") {\n actionMatch = !!(module.selectedVersion.action === \"update\");\n }\n\n const filtered = (nameMatch || descriptionMatch) && actionMatch;\n return filtered;\n });\n };\n\n // 9.LOCAL METHODS > RENDERS //\n private renderGridOrEmptyState = () => {\n this.filteredServerModules = this.getFilteredServerModules();\n if (this.filteredServerModules.length > 0) {\n return this.renderModulesVersionsGrid();\n } else {\n return this.renderEmptyStateModules();\n }\n };\n\n private renderModulesVersionsGrid = (): HTMLChTabularGridElement => {\n return (\n <ch-tabular-grid\n rowSelectionMode=\"single\"\n part=\"ch-grid-pending-commits\"\n class=\"tabular-grid servers-detail no-border\"\n onSelectionChanged={this.handleModuleChange}\n >\n <ch-tabular-grid-columnset class=\"tabular-grid-column-set\">\n <ch-tabular-grid-column\n settingable={false}\n class=\"tabular-grid-column\"\n ></ch-tabular-grid-column>\n <ch-tabular-grid-column\n settingable={false}\n size=\"min-content\"\n class=\"tabular-grid-column\"\n ></ch-tabular-grid-column>\n </ch-tabular-grid-columnset>\n\n {this.filteredServerModules.map((module: ExtendedModuleData) => (\n <ch-tabular-grid-row\n rowid={module.id}\n key={module.id}\n selected={\n this.selectedModule && this.selectedModule.id === module.id\n }\n class=\"tabular-grid-row\"\n >\n <ch-tabular-grid-cell class=\"grid-cell-module__info tabular-grid-cell\">\n <span class=\"grid-cell-module__name\">\n <gxg-icon\n type=\"objects/module\"\n data-action={module.selectedVersion.action}\n color={this.moduleVersionIconColor(module.id)}\n size=\"small\"\n ></gxg-icon>\n {module.selectedVersion.name}\n </span>\n <span class=\"grid-cell-module__description\">\n {module.selectedVersion.description}\n </span>\n </ch-tabular-grid-cell>\n\n <ch-tabular-grid-cell class=\"tabular-grid-cell\">\n {this.selectedModule && this.selectedModule.id === module.id ? (\n <div class=\"button-wrapper\">\n <gxg-button\n disabled={\n !this.actionCompleted ||\n module.selectedVersion.action === \"incompatible\" ||\n module.selectedVersion.action === \"not-installable\"\n }\n fit\n part=\"module-action\"\n onClick={this.moduleActionHandler(module)}\n >\n {module.selectedVersion.action}\n </gxg-button>\n </div>\n ) : null}\n </ch-tabular-grid-cell>\n </ch-tabular-grid-row>\n ))}\n </ch-tabular-grid>\n );\n };\n\n private renderEmptyStateModules = () => {\n return (\n <gx-ide-empty-state\n stateIconSrc={this.#filterIcon}\n stateTitle={this._componentLocale.modules.noModulesFilter}\n ></gx-ide-empty-state>\n );\n };\n\n private moduleVersionIconColor = (moduleId: string): Color => {\n const foundModule = this.serverModulesExtended.find(module => {\n return module.id === moduleId;\n });\n if (foundModule) {\n const moduleAction = foundModule.selectedVersion.action;\n const moduleCurrentVersion = foundModule.currentVersion;\n if (\n moduleAction === \"not-installable\" ||\n moduleAction === \"incompatible\"\n ) {\n return \"warning\";\n } else if (!moduleCurrentVersion) {\n return \"mercury-primary-disabled\";\n } else {\n return \"mercury-primary\";\n }\n }\n\n return \"mercury-primary\";\n };\n\n private renderVersionIcon = () => {\n return (\n <gxg-icon\n type=\"objects/module\"\n color={this.moduleVersionIconColor(this.selectedModule.id)}\n ></gxg-icon>\n );\n };\n\n /* module details/information renders*/\n private renderVersionName = () => {\n return (\n <gxg-title part=\"module-info__name\" type=\"title-05\">\n <div class=\"module-info__name\">\n {this.selectedModule.selectedVersion.name}\n </div>\n </gxg-title>\n );\n };\n\n private renderVersionWarningMessage = () => {\n const warningMessage = this.selectedModule.selectedVersion.warningMessage;\n if (warningMessage) {\n return <p class=\"module-info__warning-message\">{warningMessage}</p>;\n }\n };\n\n private renderInstalledVersion = () => {\n const currentVersion = this.selectedModule.currentVersion;\n let caption;\n let cssClass = \"module-info__action-container\";\n if (currentVersion) {\n caption = `${this._componentLocale.modulesInformation.moduleProperties.installed}: ${currentVersion}`;\n cssClass += ` module-info__action-container--installed`;\n } else {\n caption =\n this._componentLocale.modulesInformation.moduleProperties.notInstalled;\n }\n return (\n <div class={cssClass}>\n <gxg-text part=\"module-info__action\">{caption}</gxg-text>\n </div>\n );\n };\n\n // Update selected version\n private moduleVersionsValueChangedHandler = (e: CustomEvent<any>) => {\n const selectedVersionId = e.detail.value;\n this.updateSelectedModuleVersion(selectedVersionId);\n };\n private moduleVersionsItemChangedHandler = (e: CustomEvent<any>) => {\n const selectedVersionId = e.detail.value;\n this.updateSelectedModuleVersion(selectedVersionId);\n };\n private updateSelectedModuleVersion = (selectedVersionId: string) => {\n const moduleSelectedVersion = this.selectedModule.versions.find(version => {\n return version.id === selectedVersionId;\n });\n if (moduleSelectedVersion) {\n const updatedSelectedModule = {\n ...this.selectedModule,\n selectedVersion: moduleSelectedVersion\n };\n this.selectedModule = updatedSelectedModule;\n\n // update module selected in modules array as well\n const updatedModuleIndex = this.serverModulesExtended.findIndex(\n module => module.id === updatedSelectedModule.id\n );\n if (updatedModuleIndex !== -1) {\n // Update the object with new information\n this.serverModulesExtended[updatedModuleIndex] = {\n ...this.serverModulesExtended[updatedModuleIndex],\n ...updatedSelectedModule\n };\n }\n }\n };\n\n private renderModuleVersions = () => {\n return (\n <div part=\"available-versions\">\n <gxg-combo-box\n id=\"versions-combo-box\"\n disable-filter\n value=\"\"\n part=\"module-versions\"\n display-validation-styles\n display-validation-message\n label={\n this._componentLocale.modulesInformation.moduleProperties\n .availableVersions\n }\n labelPosition=\"start\"\n centerLabel\n onValueChanged={this.moduleVersionsValueChangedHandler}\n disabled={this.loadingServer || !this.actionCompleted}\n >\n {this.selectedModule.versions.map(item => (\n <gxg-combo-box-item\n value={item.id}\n onItemSelected={this.moduleVersionsItemChangedHandler}\n >\n {item.id}\n </gxg-combo-box-item>\n ))}\n </gxg-combo-box>\n </div>\n );\n };\n\n private selectedButtonChangedHandler = (e: CustomEvent<string>) => {\n this.selectedButtonFilter = e.detail as ModuleFilterType;\n };\n\n // Update server selected\n private serverItemSelectedHandler = (\n e: CustomEvent<{\n el: HTMLGxgComboBoxItemElement;\n index: number;\n value: any;\n icon?: string;\n }>\n ) => {\n const serverId = e.detail.value;\n this.serverSelectedCallbackHandler(serverId, false);\n };\n private serverValueChangedHandler = (e: CustomEvent<any>) => {\n const serverId = e.detail;\n this.serverSelectedCallbackHandler(serverId, false);\n };\n\n private reloadServer = () => {\n this.serverSelectedCallbackHandler(this.selectedServerId, true);\n };\n /**\n * Change the server selected value in response to callbackServerSelected callback\n */\n private serverSelectedCallbackHandler = async (\n serverId: any,\n reload: boolean\n ) => {\n if (this.serverSelectedCallback) {\n this.loadingServer = true;\n\n // clear\n this.serverModules = [];\n this.serverModulesExtended = [];\n this.filteredServerModules = [];\n this.modulesMap.clear();\n this.modulesSelectedVersionMap.clear();\n\n this.serverModules = await this.serverSelectedCallback(serverId, reload);\n // Save modules on Map as well to get information about modules faster\n this.serverModules.forEach(module => {\n const extendedModuleData = {\n ...module,\n selectedVersion: module.versions[0]\n };\n // When the server retrieves the modules, the selected module is by default the first one.\n this.serverModulesExtended.push(extendedModuleData);\n // Save modules on a map as well, for faster retrieval.\n this.modulesMap.set(module.id, extendedModuleData);\n });\n this.selectedServerId = serverId;\n this.loadingServer = false;\n }\n };\n\n private progressBarCloseHandler = () => {\n setTimeout(() => {\n this.actionCompleted = true;\n this.closeProgressBar = true;\n // reset\n this.progressValue = 0;\n this.progressState = \"in-progress\";\n }, 400);\n // delay to force the footer line disappear after the top-state-bar has been closed.\n };\n\n // 11.RENDER() FUNCTION //\n\n render(): void {\n return (\n <Host\n class={{\n \"gx-ide-component\": true\n }}\n >\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <div class=\"gx-ide-main-wrapper\">\n <gx-ide-container\n noContentPadding\n noAboveFooterPadding\n noBorderAboveFooter={this.closeProgressBar}\n part=\"servers\"\n containerTitle={\n this.displayTitle ? this._componentLocale.componentName : null\n }\n >\n {/* Servers*/}\n <main class=\"main\">\n <div class=\"modules__container\">\n <header class=\"modules__header\">\n <div class=\"modules__combo-container\">\n <gxg-label>\n {this._componentLocale.modules.selectServer}\n </gxg-label>\n <div class=\"modules__combo\">\n <gxg-combo-box\n disabled={this.loadingServer || !this.actionCompleted}\n disableFilter\n onValueChanged={this.serverValueChangedHandler}\n >\n {this.servers.map(item => (\n <gxg-combo-box-item\n value={item.id}\n onItemSelected={this.serverItemSelectedHandler}\n >\n {item.name}\n </gxg-combo-box-item>\n ))}\n </gxg-combo-box>\n {this.showServerCommands ? (\n <span class=\"modules__server-commands\">\n <gxg-button\n type=\"secondary-icon-only\"\n icon=\"gemini-tools/show-more-horizontal\"\n onClick={this.showModuleMenu}\n ></gxg-button>\n </span>\n ) : null}\n <gxg-button\n type=\"secondary-icon-only\"\n icon=\"gemini-tools/reset\"\n onClick={this.reloadServer}\n ></gxg-button>\n </div>\n </div>\n </header>\n\n <div class=\"modules__main\">\n <div class=\"modules__main-header\">\n <gxg-form-text\n label={this._componentLocale.modules.searchModules}\n labelPosition=\"above\"\n centerLabel={false}\n onValueChanged={this.searchModulesFilterHandler}\n disabled={this.loadingServer || !this.actionCompleted}\n ></gxg-form-text>\n <gxg-buttons-container\n reduced\n fullWidth\n class=\"modules__browser\"\n onSelectedButtonChanged={\n this.selectedButtonChangedHandler\n }\n >\n <gxg-button\n id=\"browse\"\n selected\n disabled={this.loadingServer || !this.actionCompleted}\n >\n {this._componentLocale.modules.buttonsContainer.browse}\n </gxg-button>\n <gxg-button\n id=\"installed\"\n disabled={this.loadingServer || !this.actionCompleted}\n >\n {\n this._componentLocale.modules.buttonsContainer\n .installed\n }\n </gxg-button>\n <gxg-button\n id=\"updates\"\n disabled={this.loadingServer || !this.actionCompleted}\n >\n {this._componentLocale.modules.buttonsContainer.updates}\n </gxg-button>\n </gxg-buttons-container>\n </div>\n {/* modules grid*/}\n <div\n class=\"grid-container\"\n ref={el => (this.serversDetail = el as HTMLDivElement)}\n >\n {this.renderGridOrEmptyState()}\n </div>\n </div>\n </div>\n\n {/* Module version information*/}\n {this.selectedModule ? (\n <div class=\"module-info\">\n <header class=\"module-info__header\">\n <div class=\"module-info__title\">\n {this.renderVersionIcon()}\n {this.renderVersionName()}\n </div>\n {this.renderInstalledVersion()}\n {this.renderModuleVersions()}\n {this.renderVersionWarningMessage()}\n </header>\n <div class=\"module-info__properties gxg-scrollbar\">\n {renderModuleDataProperties(\n this.selectedModule.selectedVersion.properties\n )}\n </div>\n </div>\n ) : (\n <gx-ide-empty-state\n class=\"recent-objects__empty-state\"\n stateIconSrc={this.#moduleIcon}\n stateTitle={\n this._componentLocale.modulesInformation.emptyState.title\n }\n stateDescription={\n this._componentLocale.modulesInformation.emptyState\n .description\n }\n ></gx-ide-empty-state>\n )}\n </main>\n {/* Top State Bar*/}\n <gxg-top-state-bar\n slot=\"footer-above\"\n part=\"progress-bar\"\n stateType={this.progressState}\n noBorder\n caption={\n this.selectedModuleAction.message ||\n this._componentLocale.progressBar.defaultCaption\n }\n progress={this.progressValue}\n active={!this.actionCompleted || !this.closeProgressBar}\n closeType=\"not-progress\"\n closedCallback={this.progressBarCloseHandler}\n ></gxg-top-state-bar>\n </gx-ide-container>\n </div>\n <gxg-ide-loader\n loaderTitle={this._componentLocale.servers.loading}\n ref={el => (this.loaderEl = el as HTMLGxgIdeLoaderElement)}\n container={this.serversDetail}\n borderRadius=\"0 0 0 8px\"\n abortTime={60000}\n ></gxg-ide-loader>\n </Host>\n );\n }\n}\n\nexport type ExecuteActionCallback = (\n serverId: string,\n moduleId: string,\n moduleVersionId: string,\n action: ModuleActionType,\n onProgress: (\n message: string,\n progress: number,\n state: topStateBarType\n ) => void\n) => Promise<boolean>;\n\nexport type ServerSelectedCallback = (\n id: string,\n reload: boolean\n) => Promise<ModuleData[]>;\n\nexport type ServerContextMenuCallback = (\n contextMenuInfo: ContextMenuInfo\n) => Promise<void>;\nexport interface ActionInfo {\n message: string;\n progress: number;\n state: topStateBarType;\n}\n"],"mappings":";;;;;;;;AAAA,MAAMA,IAA4B;;;;;;;;;;AC6BlC,MAAMC,IAA8B,EAClC;;;;;;;AAOA;;MASWC,IAA0B;;;;IAO7BC,KAAAC,oBAAoB;IAQ5BC,EAAAC,IAAAH,MAAcI,EAAY;MACxBC,UAAU;MACVC,MAAM;MACNC,WAAW;;IAEbC,EAAAL,IAAAH,MAAcI,EAAY;MACxBC,UAAU;MACVC,MAAM;;;;;;;eAsGAN,KAAAS,aAAa,CACnBC,GACAC,GACAC;MAEA,MAAMC,IAAO;QAAEH;QAASC;QAAUC;;MAClCZ,KAAKc,uBAAoBC,OAAAC,OAAA,IAAQH;MACjCb,KAAKiB,gBAAgBjB,KAAKc,qBAAqBH;MAC/CX,KAAKkB,gBAAgBlB,KAAKc,qBAAqBF;AAAK;;;eAM9CZ,KAAAmB,qBACNC;MAEA,MAAMC,IAAmBD,EAAME,OAAOC,OAAO;MAC7CvB,KAAKwB,iBAAiBxB,KAAKyB,WAAWC,IAAIL;AAAiB;IAGrDrB,KAAA2B,sBAAuBC,KAAuB;MACpD5B,KAAK6B,kBAAkB;MACvB7B,KAAK8B,mBAAmB;MACxB9B,KAAK+B,6BAA6BH;AAAO;;;;IAMnC5B,KAAA+B,+BAA+BC,MAAOJ;MAC5C,IAAI5B,KAAKiC,uBAAuB;QAC9BjC,KA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","renderedFirstTime","_GxManageModuleReferencesV2_filterIcon","set","getIconPath","category","name","colorType","_GxManageModuleReferencesV2_moduleIcon","onProgress","message","progress","state","data","selectedModuleAction","Object","assign","progressValue","progressState","handleModuleChange","event","selectedModuleId","detail","rowsId","selectedModule","modulesMap","get","moduleActionHandler","module","actionCompleted","closeProgressBar","executeActionCallbackHandler","async","executeActionCallback","moduleSelectedVersionId","id","selectedVersion","moduleSelectedVersionAction","action","selectedServerId","serverSelectedCallbackHandler","showModuleMenu","e","serverContextMenuCallback","buttonBoundingClientRect","target","getBoundingClientRect","selection","clientX","x","clientY","y","searchModulesFilterHandler","searchModulesFilterValue","trim","toLowerCase","getFilteredServerModules","serverModulesExtended","filter","nameMatch","includes","descriptionMatch","description","actionMatch","selectedButtonFilter","filtered","renderGridOrEmptyState","filteredServerModules","length","renderModulesVersionsGrid","renderEmptyStateModules","h","rowSelectionMode","part","class","onSelectionChanged","settingable","size","map","rowid","key","selected","type","color","moduleVersionIconColor","disabled","fit","onClick","stateIconSrc","__classPrivateFieldGet","stateTitle","_componentLocale","modules","noModulesFilter","moduleId","foundModule","find","moduleAction","moduleCurrentVersion","currentVersion","renderVersionIcon","renderVersionName","renderVersionWarningMessage","warningMessage","renderInstalledVersion","caption","cssClass","modulesInformation","moduleProperties","installed","notInstalled","moduleVersionsValueChangedHandler","selectedVersionId","value","updateSelectedModuleVersion","moduleVersionsItemChangedHandler","moduleSelectedVersion","versions","version","updatedSelectedModule","updatedModuleIndex","findIndex","renderModuleVersions","label","availableVersions","labelPosition","centerLabel","onValueChanged","loadingServer","item","onItemSelected","selectedButtonChangedHandler","serverItemSelectedHandler","serverId","serverValueChangedHandler","reloadServer","reload","serverSelectedCallback","serverModules","clear","modulesSelectedVersionMap","forEach","extendedModuleData","push","progressBarCloseHandler","setTimeout","Map","loadingServerHandler","loading","loaderEl","show","componentDidRender","componentDidRenderFirstTime","emit","componentName","componentWillLoad","Locale","getComponentStrings","el","componentDidLoad","servers","render","Host","model","noContentPadding","noAboveFooterPadding","noBorderAboveFooter","containerTitle","displayTitle","selectServer","disableFilter","showServerCommands","icon","searchModules","reduced","fullWidth","onSelectedButtonChanged","buttonsContainer","browse","updates","ref","serversDetail","renderModuleDataProperties","properties","emptyState","title","stateDescription","slot","stateType","noBorder","progressBar","defaultCaption","active","closeType","closedCallback","loaderTitle","container","borderRadius","abortTime"],"sources":["src/components/modules/manage-module-references-v2/manage-module-references.scss?tag=gx-ide-manage-module-references-v2&encapsulation=shadow","src/components/modules/manage-module-references-v2/manage-module-references-v2.tsx"],"sourcesContent":["@import \"../../../global/gx-ide-common.scss\";\n@import \"../../../global/gx-ide-mixins.scss\";\n\n/*--- General ---*/\np,\nul {\n font-size: var(--font-size-lg);\n margin: 0;\n}\np {\n line-height: 1.6em;\n}\n/*--- Header ---*/\n.header {\n align-items: center;\n grid-template-columns: 1fr auto;\n grid-template-rows: 1fr;\n}\n.main {\n display: grid;\n //grid-template-columns: 1fr 2fr 1fr;\n grid-template-columns: 1fr 1fr;\n grid-template-rows: 1fr;\n height: 100%;\n overflow: auto;\n}\nch-grid-columnset {\n display: none;\n}\nch-grid-row[selected] {\n gxg-icon[data-action=\"install\"] {\n //WA to improve visibility\n filter: brightness(2);\n }\n}\n.grid-cell-module {\n &__info {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--mer-spacing--3xs);\n }\n &__name {\n font-weight: var(--mer-font__weight--bold);\n display: flex;\n align-items: center;\n gap: var(--mer-spacing--sm);\n }\n &__name,\n &__description {\n line-height: 1.55em;\n }\n &__description {\n padding-inline-start: 36px;\n }\n}\n\n/*--- Servers Container ---*/\n.grid-container {\n height: 100%;\n overflow: auto;\n gx-ide-empty-state {\n height: 100%;\n }\n}\n.servers-container {\n display: none;\n height: 100%;\n &__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--gxg-list-box-main__padding) var(--gxg-list-box-main__padding)\n 0 var(--gxg-list-box-main__padding);\n\n gxg-button {\n width: 100%;\n }\n }\n}\n\n/*--- Modules (Header) ---*/\n.modules {\n &__header {\n padding: var(--gxg-list-box-main__padding);\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--xs);\n }\n &__combo-container {\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--xs);\n }\n &__server-commands {\n display: flex;\n gap: var(--mer-spacing--xs);\n }\n &__combo {\n gxg-combo-box {\n flex: 1;\n }\n display: flex;\n flex-direction: row;\n gap: var(--mer-spacing--xs);\n }\n &__container {\n border-inline-end: var(--mer-border__width--sm) solid\n var(--gx-ide-container-border-color);\n display: grid;\n grid-template-rows: auto 1fr;\n height: 100%;\n overflow: auto;\n }\n &__main {\n display: grid;\n grid-template-rows: auto 1fr;\n height: 100%;\n overflow: auto;\n\n &-header {\n display: flex;\n padding: var(--mer-spacing--xs);\n flex-direction: column;\n gap: var(--mer-spacing--xs);\n }\n }\n}\n\n/*--- Module Info ---*/\n.module-info {\n display: grid;\n grid-template-rows: auto 1fr;\n height: 100%;\n overflow: auto;\n\n &__title {\n display: flex;\n align-items: center;\n gap: var(--mer-spacing--xs);\n }\n\n &__name {\n display: flex;\n align-items: center;\n gap: var(--mer-spacing--sm);\n --ds-icon-size-box--regular: 24px;\n --ds-icon-size--regular: 24px;\n font-weight: var(--mer-font__weight--bold);\n }\n\n &__header {\n padding: var(--gx-ide-container__padding);\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--xs);\n border-block-end: var(--mer-border__width--sm) solid\n var(--gx-ide-container-border-color);\n }\n\n &__action-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--mer-spacing--xs);\n &:before {\n content: \"\";\n width: var(--mer-spacing--xs);\n height: var(--mer-spacing--xs);\n border-radius: 50%;\n display: block;\n background-color: var(--mer-icon__primary--disabled);\n }\n &--installed:before {\n background-color: var(--mer-icon__primary);\n }\n &--uninstallable:before {\n background-color: var(--mer-icon__warning);\n }\n }\n\n &__warning-message {\n margin-block-start: var(--mer-spacing--2xs);\n background-color: var(--mer-color__tinted-yellow--5);\n color: var(--mer-text__on-elevation);\n border: var(--mer-border__width--sm) solid var(--mer-border-color__warning);\n border-radius: var(--mer-border__radius--sm);\n padding: var(--mer-spacing--xs) var(--mer-spacing--md);\n }\n\n &__divider {\n width: calc(100% - var(--gx-ide-container__padding) * 4);\n padding: 0 var(--gx-ide-container__padding);\n margin: 0 auto;\n border: 0;\n border-block-end: var(--mer-border__width--sm) solid\n var(--gx-ide-container-border-color);\n }\n &__properties {\n display: flex;\n flex-direction: column;\n padding: var(--gx-ide-container__padding);\n gap: var(--mer-spacing--xs);\n overflow: auto;\n }\n}\n\n.md-property {\n display: grid;\n gap: var(--mer-spacing--xs);\n\n &--inline {\n grid-template-columns: auto 1fr;\n }\n &--block {\n }\n &__key {\n font-weight: var(--font-weight-bold);\n max-width: 150px;\n }\n &__value {\n font-size: var(--mer-font__size--2xs);\n }\n &__key,\n &__value {\n > * {\n display: inline-block;\n }\n }\n &__list {\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--xs);\n > ul {\n margin: 0;\n padding: 0;\n list-style-type: none;\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--2xs);\n margin-inline-start: var(--mer-spacing--xs);\n\n li {\n position: relative;\n padding-inline-start: 12px;\n line-height: var(--ds-base-font-line-height--comfortable);\n &::before {\n content: \"\";\n position: absolute;\n left: 0;\n top: 7px;\n display: inline-block;\n width: var(--mer-spacing--2xs);\n height: var(--mer-spacing--2xs);\n background-color: var(--mer-text__on-surface);\n }\n }\n }\n }\n}\n\n.md-property,\n.md-property__list {\n border-block-end: var(--mer-border__width--sm) solid\n var(--gx-ide-container-border-color);\n padding-block-end: var(--mer-spacing--xs);\n\n &:last-child {\n border-block-end: 0;\n padding-block-end: 0;\n }\n}\n\ngxg-ide-loader {\n border-radius: var(--mer-border__radius--md);\n}\n\n.button-wrapper {\n display: grid;\n align-items: center;\n justify-content: center;\n}\n","/* STENCIL IMPORTS */\nimport {\n Component,\n Host,\n h,\n Prop,\n Event,\n Element,\n EventEmitter,\n State,\n Watch\n} from \"@stencil/core\";\n/* OTHER LIBRARIES IMPORTS */\nimport { Color } from \"@genexus/gemini\";\nimport { topStateBarType } from \"@genexus/gemini\";\nimport { TabularGridSelectionChangedEvent } from \"@genexus/chameleon-controls-library\";\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\n/* CUSTOM IMPORTS */\nimport {\n ModuleServerData,\n ModuleData,\n ModuleActionType,\n ModuleFilterType,\n ExtendedModuleData\n} from \"../types\";\nimport { renderModuleDataProperties } from \"../../../common/common\";\nimport { Locale } from \"../../../common/locale\";\nimport { ContextMenuInfo } from \"../../../common/types\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n // \"utils/form\",\n // \"utils/layout\",\n // \"utils/typography\",\n // \"components/button\",\n // \"components/checkbox\",\n // \"components/edit\",\n \"components/tabular-grid\"\n];\n\n@Component({\n tag: \"gx-ide-manage-module-references-v2\",\n styleUrl: \"manage-module-references.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/manage-module-references-v2\"]\n})\nexport class GxManageModuleReferencesV2 {\n // 1.OWN PROPERTIES | WATCH'S //\n\n /**\n * The component hard-coded strings translations.\n */\n private _componentLocale: any;\n private renderedFirstTime = false;\n\n // 2. REFERENCE TO ELEMENTS //\n\n @Element() el: HTMLGxIdeManageModuleReferencesV2Element;\n private loaderEl!: HTMLGxgIdeLoaderElement;\n private serversDetail!: HTMLDivElement;\n\n #filterIcon = getIconPath({\n category: \"system\",\n name: \"filters\",\n colorType: \"on-elevation\"\n });\n #moduleIcon = getIconPath({\n category: \"objects\",\n name: \"module\"\n });\n\n // 3.STATE() VARIABLES //\n\n // Filtering modules\n @State() searchModulesFilterValue: string = \"\";\n @State() selectedButtonFilter: ModuleFilterType = \"browse\";\n @State() serverModules: ModuleData[] = [];\n @State() serverModulesExtended: ExtendedModuleData[] = [];\n @State() filteredServerModules: ExtendedModuleData[] = [];\n @State() modulesMap: Map<string, ExtendedModuleData> = new Map();\n\n @State() selectedModule: ExtendedModuleData;\n @State() selectedServerId: string;\n @State() selectedModuleAction: ActionInfo = {\n message: \"\",\n progress: 0,\n state: \"in-progress\"\n };\n @State() modulesSelectedVersionMap: Map<string, string> = new Map();\n @State() actionCompleted = true;\n @State() closeProgressBar = true;\n @State() progressValue: number = 0;\n @State() progressState: topStateBarType = \"in-progress\";\n @State() loadingServer = false;\n @Watch(\"loadingServer\")\n loadingServerHandler(loading: boolean) {\n if (loading) {\n this.loaderEl.show = true;\n } else {\n this.loaderEl.show = false;\n }\n }\n\n // 4.PUBLIC PROPERTY API //\n\n /**\n * If true it displays the component title on the header\n */\n @Prop() readonly displayTitle = false;\n\n /**\n * List of module servers currently cataloged\n */\n @Prop() readonly servers: ModuleServerData[] = [];\n\n /**\n * Callback invoked when a server is selected. Returns the set of modules available on that server.\n */\n @Prop() readonly serverSelectedCallback: ServerSelectedCallback;\n\n /**\n * Callback invoked when the user wants to execute the action corresponding to a selected module. When the action begins to be executed, the component must be able to show the progress of the action. For this, the onProgress parameter is available, which is in turn a callback used by the host to notify the progress by text message and percentage.\n */\n @Prop() readonly executeActionCallback: ExecuteActionCallback;\n\n /**\n * Callback invoked when an element is right clicked on servers list\n */\n @Prop() readonly serverContextMenuCallback: ServerContextMenuCallback;\n\n /**\n * Allows you to hide the button (...) that executes serverContextMenuCallback, if we do not implement the commands in a first version\n */\n @Prop() readonly showServerCommands: boolean = false;\n\n // 5.EVENTS (EMIT) //\n\n /**\n * This event is emitted once just after the component is fully loaded and the first render() occurs\n */\n @Event() componentDidRenderFirstTime: EventEmitter<boolean>;\n\n // 6.COMPONENT LIFECYCLE EVENTS //\n\n componentDidRender() {\n if (!this.renderedFirstTime) {\n this.componentDidRenderFirstTime.emit(\n this._componentLocale.componentName\n );\n this.renderedFirstTime = true;\n }\n }\n\n async componentWillLoad() {\n this._componentLocale = await Locale.getComponentStrings(this.el);\n }\n\n async componentDidLoad() {\n await this.serverSelectedCallbackHandler(this.servers[0].id, false);\n }\n\n // 7.LISTENERS //\n\n // 8.PUBLIC METHODS API //\n\n // 9.LOCAL METHODS //\n\n /**\n * Callback invoked to get the progress when module is performing an action\n */\n private onProgress = (\n message: string,\n progress: number,\n state: topStateBarType\n ): void => {\n const data = { message, progress, state };\n this.selectedModuleAction = { ...data };\n this.progressValue = this.selectedModuleAction.progress;\n this.progressState = this.selectedModuleAction.state;\n };\n\n /**\n * Used for changing the selected module\n */\n private handleModuleChange = (\n event: CustomEvent<TabularGridSelectionChangedEvent>\n ) => {\n const selectedModuleId = event.detail.rowsId[0];\n this.selectedModule = this.modulesMap.get(selectedModuleId);\n };\n\n private moduleActionHandler = (module: ModuleData) => () => {\n this.actionCompleted = false;\n this.closeProgressBar = false;\n this.executeActionCallbackHandler(module);\n };\n\n /**\n * Perform an action relative to a module using callbackExecuteAction callback and receive the state of that action with onProgress callback\n */\n private executeActionCallbackHandler = async (module: ModuleData) => {\n if (this.executeActionCallback) {\n this.actionCompleted = false;\n const moduleSelectedVersionId = this.modulesMap.get(module.id)\n .selectedVersion.id;\n const moduleSelectedVersionAction = this.modulesMap.get(module.id)\n .selectedVersion.action;\n const actionCompleted = await this.executeActionCallback(\n this.selectedServerId,\n module.id,\n moduleSelectedVersionId,\n moduleSelectedVersionAction,\n this.onProgress\n );\n if (actionCompleted) {\n this.serverSelectedCallbackHandler(this.selectedServerId, false);\n }\n this.actionCompleted = true;\n }\n };\n\n private showModuleMenu = async (e: MouseEvent) => {\n if (this.serverContextMenuCallback) {\n const buttonBoundingClientRect = (\n e.target as HTMLElement\n ).getBoundingClientRect();\n await this.serverContextMenuCallback({\n selection: [this.selectedServerId],\n clientX: buttonBoundingClientRect.x,\n clientY: buttonBoundingClientRect.y\n });\n }\n };\n\n private searchModulesFilterHandler = (e: CustomEvent<string>) => {\n this.searchModulesFilterValue = e.detail.trim().toLowerCase();\n };\n\n private getFilteredServerModules = (): ExtendedModuleData[] => {\n return this.serverModulesExtended.filter(module => {\n // Filter conditions\n const nameMatch = module.selectedVersion.name\n .toLowerCase()\n .includes(this.searchModulesFilterValue);\n const descriptionMatch = module.selectedVersion.description\n .toLowerCase()\n .includes(this.searchModulesFilterValue);\n let actionMatch;\n if (this.selectedButtonFilter === \"browse\") {\n // If browse is selected, display all\n actionMatch = true;\n } else if (this.selectedButtonFilter === \"installed\") {\n actionMatch = !!(\n module.selectedVersion.action === \"update\" ||\n module.selectedVersion.action === \"restore\"\n );\n } else if (this.selectedButtonFilter === \"updates\") {\n actionMatch = !!(module.selectedVersion.action === \"update\");\n }\n\n const filtered = (nameMatch || descriptionMatch) && actionMatch;\n return filtered;\n });\n };\n\n // 9.LOCAL METHODS > RENDERS //\n private renderGridOrEmptyState = () => {\n this.filteredServerModules = this.getFilteredServerModules();\n if (this.filteredServerModules.length > 0) {\n return this.renderModulesVersionsGrid();\n } else {\n return this.renderEmptyStateModules();\n }\n };\n\n private renderModulesVersionsGrid = (): HTMLChTabularGridElement => {\n return (\n <ch-tabular-grid\n rowSelectionMode=\"single\"\n part=\"ch-grid-pending-commits\"\n class=\"tabular-grid servers-detail no-border\"\n onSelectionChanged={this.handleModuleChange}\n >\n <ch-tabular-grid-columnset class=\"tabular-grid-column-set\">\n <ch-tabular-grid-column\n settingable={false}\n class=\"tabular-grid-column\"\n ></ch-tabular-grid-column>\n <ch-tabular-grid-column\n settingable={false}\n size=\"min-content\"\n class=\"tabular-grid-column\"\n ></ch-tabular-grid-column>\n </ch-tabular-grid-columnset>\n\n {this.filteredServerModules.map((module: ExtendedModuleData) => (\n <ch-tabular-grid-row\n rowid={module.id}\n key={module.id}\n selected={\n this.selectedModule && this.selectedModule.id === module.id\n }\n class=\"tabular-grid-row\"\n >\n <ch-tabular-grid-cell class=\"grid-cell-module__info tabular-grid-cell\">\n <span class=\"grid-cell-module__name\">\n <gxg-icon\n type=\"objects/module\"\n data-action={module.selectedVersion.action}\n color={this.moduleVersionIconColor(module.id)}\n size=\"small\"\n ></gxg-icon>\n {module.selectedVersion.name}\n </span>\n <span class=\"grid-cell-module__description\">\n {module.selectedVersion.description}\n </span>\n </ch-tabular-grid-cell>\n\n <ch-tabular-grid-cell class=\"tabular-grid-cell\">\n {this.selectedModule && this.selectedModule.id === module.id ? (\n <div class=\"button-wrapper\">\n <gxg-button\n disabled={\n !this.actionCompleted ||\n module.selectedVersion.action === \"incompatible\" ||\n module.selectedVersion.action === \"not-installable\"\n }\n fit\n part=\"module-action\"\n onClick={this.moduleActionHandler(module)}\n >\n {module.selectedVersion.action}\n </gxg-button>\n </div>\n ) : null}\n </ch-tabular-grid-cell>\n </ch-tabular-grid-row>\n ))}\n </ch-tabular-grid>\n );\n };\n\n private renderEmptyStateModules = () => {\n return (\n <gx-ide-empty-state\n stateIconSrc={this.#filterIcon}\n stateTitle={this._componentLocale.modules.noModulesFilter}\n ></gx-ide-empty-state>\n );\n };\n\n private moduleVersionIconColor = (moduleId: string): Color => {\n const foundModule = this.serverModulesExtended.find(module => {\n return module.id === moduleId;\n });\n if (foundModule) {\n const moduleAction = foundModule.selectedVersion.action;\n const moduleCurrentVersion = foundModule.currentVersion;\n if (\n moduleAction === \"not-installable\" ||\n moduleAction === \"incompatible\"\n ) {\n return \"warning\";\n } else if (!moduleCurrentVersion) {\n return \"mercury-primary-disabled\";\n } else {\n return \"mercury-primary\";\n }\n }\n\n return \"mercury-primary\";\n };\n\n private renderVersionIcon = () => {\n return (\n <gxg-icon\n type=\"objects/module\"\n color={this.moduleVersionIconColor(this.selectedModule.id)}\n ></gxg-icon>\n );\n };\n\n /* module details/information renders*/\n private renderVersionName = () => {\n return (\n <gxg-title part=\"module-info__name\" type=\"title-05\">\n <div class=\"module-info__name\">\n {this.selectedModule.selectedVersion.name}\n </div>\n </gxg-title>\n );\n };\n\n private renderVersionWarningMessage = () => {\n const warningMessage = this.selectedModule.selectedVersion.warningMessage;\n if (warningMessage) {\n return <p class=\"module-info__warning-message\">{warningMessage}</p>;\n }\n };\n\n private renderInstalledVersion = () => {\n const currentVersion = this.selectedModule.currentVersion;\n let caption;\n let cssClass = \"module-info__action-container\";\n if (currentVersion) {\n caption = `${this._componentLocale.modulesInformation.moduleProperties.installed}: ${currentVersion}`;\n cssClass += ` module-info__action-container--installed`;\n } else {\n caption =\n this._componentLocale.modulesInformation.moduleProperties.notInstalled;\n }\n return (\n <div class={cssClass}>\n <gxg-text part=\"module-info__action\">{caption}</gxg-text>\n </div>\n );\n };\n\n // Update selected version\n private moduleVersionsValueChangedHandler = (e: CustomEvent<any>) => {\n const selectedVersionId = e.detail.value;\n this.updateSelectedModuleVersion(selectedVersionId);\n };\n private moduleVersionsItemChangedHandler = (e: CustomEvent<any>) => {\n const selectedVersionId = e.detail.value;\n this.updateSelectedModuleVersion(selectedVersionId);\n };\n private updateSelectedModuleVersion = (selectedVersionId: string) => {\n const moduleSelectedVersion = this.selectedModule.versions.find(version => {\n return version.id === selectedVersionId;\n });\n if (moduleSelectedVersion) {\n const updatedSelectedModule = {\n ...this.selectedModule,\n selectedVersion: moduleSelectedVersion\n };\n this.selectedModule = updatedSelectedModule;\n\n // update module selected in modules array as well\n const updatedModuleIndex = this.serverModulesExtended.findIndex(\n module => module.id === updatedSelectedModule.id\n );\n if (updatedModuleIndex !== -1) {\n // Update the object with new information\n this.serverModulesExtended[updatedModuleIndex] = {\n ...this.serverModulesExtended[updatedModuleIndex],\n ...updatedSelectedModule\n };\n }\n }\n };\n\n private renderModuleVersions = () => {\n return (\n <div part=\"available-versions\">\n <gxg-combo-box\n id=\"versions-combo-box\"\n disable-filter\n value=\"\"\n part=\"module-versions\"\n display-validation-styles\n display-validation-message\n label={\n this._componentLocale.modulesInformation.moduleProperties\n .availableVersions\n }\n labelPosition=\"start\"\n centerLabel\n onValueChanged={this.moduleVersionsValueChangedHandler}\n disabled={this.loadingServer || !this.actionCompleted}\n >\n {this.selectedModule.versions.map(item => (\n <gxg-combo-box-item\n value={item.id}\n onItemSelected={this.moduleVersionsItemChangedHandler}\n >\n {item.id}\n </gxg-combo-box-item>\n ))}\n </gxg-combo-box>\n </div>\n );\n };\n\n private selectedButtonChangedHandler = (e: CustomEvent<string>) => {\n this.selectedButtonFilter = e.detail as ModuleFilterType;\n };\n\n // Update server selected\n private serverItemSelectedHandler = (\n e: CustomEvent<{\n el: HTMLGxgComboBoxItemElement;\n index: number;\n value: any;\n icon?: string;\n }>\n ) => {\n const serverId = e.detail.value;\n this.serverSelectedCallbackHandler(serverId, false);\n };\n private serverValueChangedHandler = (e: CustomEvent<any>) => {\n const serverId = e.detail;\n this.serverSelectedCallbackHandler(serverId, false);\n };\n\n private reloadServer = () => {\n this.serverSelectedCallbackHandler(this.selectedServerId, true);\n };\n /**\n * Change the server selected value in response to callbackServerSelected callback\n */\n private serverSelectedCallbackHandler = async (\n serverId: any,\n reload: boolean\n ) => {\n if (this.serverSelectedCallback) {\n this.loadingServer = true;\n\n // clear\n this.serverModules = [];\n this.serverModulesExtended = [];\n this.filteredServerModules = [];\n this.modulesMap.clear();\n this.modulesSelectedVersionMap.clear();\n\n this.serverModules = await this.serverSelectedCallback(serverId, reload);\n // Save modules on Map as well to get information about modules faster\n this.serverModules.forEach(module => {\n const extendedModuleData = {\n ...module,\n selectedVersion: module.versions[0]\n };\n // When the server retrieves the modules, the selected module is by default the first one.\n this.serverModulesExtended.push(extendedModuleData);\n // Save modules on a map as well, for faster retrieval.\n this.modulesMap.set(module.id, extendedModuleData);\n });\n this.selectedServerId = serverId;\n this.loadingServer = false;\n }\n };\n\n private progressBarCloseHandler = () => {\n setTimeout(() => {\n this.actionCompleted = true;\n this.closeProgressBar = true;\n // reset\n this.progressValue = 0;\n this.progressState = \"in-progress\";\n }, 400);\n // delay to force the footer line disappear after the top-state-bar has been closed.\n };\n\n // 11.RENDER() FUNCTION //\n\n render(): void {\n return (\n <Host\n class={{\n \"gx-ide-component\": true\n }}\n >\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <div class=\"gx-ide-main-wrapper\">\n <gx-ide-container\n noContentPadding\n noAboveFooterPadding\n noBorderAboveFooter={this.closeProgressBar}\n part=\"servers\"\n containerTitle={\n this.displayTitle ? this._componentLocale.componentName : null\n }\n >\n {/* Servers*/}\n <main class=\"main\">\n <div class=\"modules__container\">\n <header class=\"modules__header\">\n <div class=\"modules__combo-container\">\n <gxg-label>\n {this._componentLocale.modules.selectServer}\n </gxg-label>\n <div class=\"modules__combo\">\n <gxg-combo-box\n disabled={this.loadingServer || !this.actionCompleted}\n disableFilter\n onValueChanged={this.serverValueChangedHandler}\n >\n {this.servers.map(item => (\n <gxg-combo-box-item\n value={item.id}\n onItemSelected={this.serverItemSelectedHandler}\n >\n {item.name}\n </gxg-combo-box-item>\n ))}\n </gxg-combo-box>\n {this.showServerCommands ? (\n <span class=\"modules__server-commands\">\n <gxg-button\n type=\"secondary-icon-only\"\n icon=\"gemini-tools/show-more-horizontal\"\n onClick={this.showModuleMenu}\n ></gxg-button>\n </span>\n ) : null}\n <gxg-button\n type=\"secondary-icon-only\"\n icon=\"gemini-tools/reset\"\n onClick={this.reloadServer}\n ></gxg-button>\n </div>\n </div>\n </header>\n\n <div class=\"modules__main\">\n <div class=\"modules__main-header\">\n <gxg-form-text\n label={this._componentLocale.modules.searchModules}\n labelPosition=\"above\"\n centerLabel={false}\n onValueChanged={this.searchModulesFilterHandler}\n disabled={this.loadingServer || !this.actionCompleted}\n ></gxg-form-text>\n <gxg-buttons-container\n reduced\n fullWidth\n class=\"modules__browser\"\n onSelectedButtonChanged={\n this.selectedButtonChangedHandler\n }\n >\n <gxg-button\n id=\"browse\"\n selected\n disabled={this.loadingServer || !this.actionCompleted}\n >\n {this._componentLocale.modules.buttonsContainer.browse}\n </gxg-button>\n <gxg-button\n id=\"installed\"\n disabled={this.loadingServer || !this.actionCompleted}\n >\n {\n this._componentLocale.modules.buttonsContainer\n .installed\n }\n </gxg-button>\n <gxg-button\n id=\"updates\"\n disabled={this.loadingServer || !this.actionCompleted}\n >\n {this._componentLocale.modules.buttonsContainer.updates}\n </gxg-button>\n </gxg-buttons-container>\n </div>\n {/* modules grid*/}\n <div\n class=\"grid-container\"\n ref={el => (this.serversDetail = el as HTMLDivElement)}\n >\n {this.renderGridOrEmptyState()}\n </div>\n </div>\n </div>\n\n {/* Module version information*/}\n {this.selectedModule ? (\n <div class=\"module-info\">\n <header class=\"module-info__header\">\n <div class=\"module-info__title\">\n {this.renderVersionIcon()}\n {this.renderVersionName()}\n </div>\n {this.renderInstalledVersion()}\n {this.renderModuleVersions()}\n {this.renderVersionWarningMessage()}\n </header>\n <div class=\"module-info__properties gxg-scrollbar\">\n {renderModuleDataProperties(\n this.selectedModule.selectedVersion.properties\n )}\n </div>\n </div>\n ) : (\n <gx-ide-empty-state\n class=\"recent-objects__empty-state\"\n stateIconSrc={this.#moduleIcon}\n stateTitle={\n this._componentLocale.modulesInformation.emptyState.title\n }\n stateDescription={\n this._componentLocale.modulesInformation.emptyState\n .description\n }\n ></gx-ide-empty-state>\n )}\n </main>\n {/* Top State Bar*/}\n <gxg-top-state-bar\n slot=\"footer-above\"\n part=\"progress-bar\"\n stateType={this.progressState}\n noBorder\n caption={\n this.selectedModuleAction.message ||\n this._componentLocale.progressBar.defaultCaption\n }\n progress={this.progressValue}\n active={!this.actionCompleted || !this.closeProgressBar}\n closeType=\"not-progress\"\n closedCallback={this.progressBarCloseHandler}\n ></gxg-top-state-bar>\n </gx-ide-container>\n </div>\n <gxg-ide-loader\n loaderTitle={this._componentLocale.servers.loading}\n ref={el => (this.loaderEl = el as HTMLGxgIdeLoaderElement)}\n container={this.serversDetail}\n borderRadius=\"0 0 0 8px\"\n abortTime={60000}\n ></gxg-ide-loader>\n </Host>\n );\n }\n}\n\nexport type ExecuteActionCallback = (\n serverId: string,\n moduleId: string,\n moduleVersionId: string,\n action: ModuleActionType,\n onProgress: (\n message: string,\n progress: number,\n state: topStateBarType\n ) => void\n) => Promise<boolean>;\n\nexport type ServerSelectedCallback = (\n id: string,\n reload: boolean\n) => Promise<ModuleData[]>;\n\nexport type ServerContextMenuCallback = (\n contextMenuInfo: ContextMenuInfo\n) => Promise<void>;\nexport interface ActionInfo {\n message: string;\n progress: number;\n state: topStateBarType;\n}\n"],"mappings":";;;;;;;;;;AAAA,MAAMA,IAA4B;;;;;;;;;;AC6BlC,MAAMC,IAA8B,EAClC;;;;;;;AAOA;;MASWC,IAA0B;;;;IAO7BC,KAAAC,oBAAoB;IAQ5BC,EAAAC,IAAAH,MAAcI,EAAY;MACxBC,UAAU;MACVC,MAAM;MACNC,WAAW;;IAEbC,EAAAL,IAAAH,MAAcI,EAAY;MACxBC,UAAU;MACVC,MAAM;;;;;;;eAsGAN,KAAAS,aAAa,CACnBC,GACAC,GACAC;MAEA,MAAMC,IAAO;QAAEH;QAASC;QAAUC;;MAClCZ,KAAKc,uBAAoBC,OAAAC,OAAA,IAAQH;MACjCb,KAAKiB,gBAAgBjB,KAAKc,qBAAqBH;MAC/CX,KAAKkB,gBAAgBlB,KAAKc,qBAAqBF;AAAK;;;eAM9CZ,KAAAmB,qBACNC;MAEA,MAAMC,IAAmBD,EAAME,OAAOC,OAAO;MAC7CvB,KAAKwB,iBAAiBxB,KAAKyB,WAAWC,IAAIL;AAAiB;IAGrDrB,KAAA2B,sBAAuBC,KAAuB;MACpD5B,KAAK6B,kBAAkB;MACvB7B,KAAK8B,mBAAmB;MACxB9B,KAAK+B,6BAA6BH;AAAO;;;;IAMnC5B,KAAA+B,+BAA+BC,MAAOJ;MAC5C,IAAI5B,KAAKiC,uBAAuB;QAC9BjC,KAAK6B,kBAAkB;QACvB,MAAMK,IAA0BlC,KAAKyB,WAAWC,IAAIE,EAAOO,IACxDC,gBAAgBD;QACnB,MAAME,IAA8BrC,KAAKyB,WAAWC,IAAIE,EAAOO,IAC5DC,gBAAgBE;QACnB,MAAMT,UAAwB7B,KAAKiC,sBACjCjC,KAAKuC,kBACLX,EAAOO,IACPD,GACAG,GACArC,KAAKS;QAEP,IAAIoB,GAAiB;UACnB7B,KAAKwC,8BAA8BxC,KAAKuC,kBAAkB;;QAE5DvC,KAAK6B,k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MXlE,KAAKwB,iBACJ+C,EAAA;MAAKG,OAAM;OACTH,EAAA;MAAQG,OAAM;OACZH,EAAA;MAAKG,OAAM;OACR1E,KAAKoG,qBACLpG,KAAKqG,sBAEPrG,KAAKwG,0BACLxG,KAAK0H,wBACL1H,KAAKsG,gCAER/B,EAAA;MAAKG,OAAM;OACR4G,EACCtL,KAAKwB,eAAeY,gBAAgBmJ,gBAK1ChH,EAAA;MACEG,OAAM;MACNc,cAAcC,EAAAzF,MAAIQ,GAAA;MAClBkF,YACE1F,KAAK2F,iBAAiBgB,mBAAmB6E,WAAWC;MAEtDC,kBACE1L,KAAK2F,iBAAiBgB,mBAAmB6E,WACtC1H;SAMXS,EAAA;MACEoH,MAAK;MACLlH,MAAK;MACLmH,WAAW5L,KAAKkB;MAChB2K,UAAQ;MACRpF,SACEzG,KAAKc,qBAAqBJ,WAC1BV,KAAK2F,iBAAiBmG,YAAYC;MAEpCpL,UAAUX,KAAKiB;MACf+K,SAAShM,KAAK6B,oBAAoB7B,KAAK8B;MACvCmK,WAAU;MACVC,gBAAgBlM,KAAKgJ;UAI3BzE,EAAA;MACE4H,aAAanM,KAAK2F,iBAAiBqE,QAAQZ;MAC3CgC,KAAKtB,KAAO9J,KAAKqJ,WAAWS;MAC5BsC,WAAWpM,KAAKqL;MAChBgB,cAAa;MACbC,WAAW"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { r as t, h as e, H as s, g as i } from "./p-49712340.js";
|
|
2
2
|
|
|
3
|
-
import { g as o } from "./p-
|
|
3
|
+
import { g as o } from "./p-6e4208d8.js";
|
|
4
|
+
|
|
5
|
+
import "./p-ad5caf61.js";
|
|
4
6
|
|
|
5
7
|
import { L as n } from "./p-311eedf3.js";
|
|
6
8
|
|
|
@@ -252,4 +254,4 @@ u = new WeakMap, m = new WeakMap, b = new WeakMap;
|
|
|
252
254
|
k.style = r;
|
|
253
255
|
|
|
254
256
|
export { k as gx_ide_data_type_selector };
|
|
255
|
-
//# sourceMappingURL=p-
|
|
257
|
+
//# sourceMappingURL=p-9cfd7800.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["mapCategoryToListItemGroup","category","categoryGroup","caption","name","id","type","expanded","expandable","items","types","map","additionalInformation","center","imgSrc","icon","mapDataTypesToList","dataTypes","dataType","index","undefined","order","dataTypeSelectorCss","CSS_BUNDLES","ALL_CATEGORY_ID","RECENTLY_USED_CATEGORY_ID","CLOCK_ICON","getIconPath","colorType","GxIdeKbManagerImport","_GxIdeKbManagerImport__componentLocale","set","this","_GxIdeKbManagerImport_showAll","_GxIdeKbManagerImport_categoriesActionListItemGroupMap","Map","_GxIdeKbManagerImport_handleSelectionChange","event","eventType","_a","detail","item","itemAdditionalBase","dataTypeSelectedCallback","__classPrivateFieldGet","_GxIdeKbManagerImport_updateListBoxModelState","call","selectedCategory","recentlyUsedActionListModel","forEach","selected","selectedItemIndex","recentlyUsed","findIndex","has","group","get","groupUpdated","Object","assign","_GxIdeKbManagerImport_showAllObjects","allCategoriesActionListModel","counter","mapLength","size","key","keys","push","categoriesListBoxModel","__classPrivateFieldSet","_GxIdeKbManagerImport_showRecentlyObjects","selectedCategoryHandler","e","currentTarget","dataset","newSelectedCategory","_GxIdeKbManagerImport_renderFooter","recentlyUsedBtnClass","allBtnClass","selectedCategoryDescription","fixedTypes","all","h","class","length","select","title","onClick","src","categories","buttonClass","categoriesChanged","newCategories","clear","categoryListBoxModel","loading","recentlyUsedChanged","newRecentlyUsed","componentWillLoad","Locale","getComponentStrings","el","render","Host","model","loaderTitle","loader","description","show","selection","onSelectedItemsChange"],"sources":["src/components/data-type-selector/helpers.ts","src/components/data-type-selector/data-type-selector.scss?tag=gx-ide-data-type-selector&encapsulation=shadow","src/components/data-type-selector/data-type-selector.tsx"],"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",":host {\n position: relative;\n display: grid;\n block-size: 100%;\n overflow: auto;\n grid-template-rows: 1fr max-content;\n\n // WA: Prevent a custom css rule on genexus-web from overriding --control__border-width value.\n // TDOO: remove this when the custom style is removed from genexus-web.\n // custom stlye is: .gx-struct-editor .tabular-grid-cell {\n // --control__border-width: 0;\n // }\n\n --control__border-width: var(--mer-border__width--sm);\n --control__border-radius: var(--mer-border__radius--sm);\n}\n\n.main {\n display: contents;\n}\n\n.selected-category {\n margin: 0;\n text-transform: capitalize;\n margin-inline-start: var(\n --mer-spacing--md\n ); // TODO: Create a semantic class in Mercury for this case.\n white-space: nowrap;\n}\n\n.footer {\n overflow: auto;\n}\n","// 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"],"mappings":";;;;;;AAMO,MAAMA,6BACXC;EAEA,MAAMC,IAAqC;IACzCC,SAASF,EAASG;IAClBC,IAAIJ,EAASG;IACbE,MAAM;IACNC,UAAU;IACVC,YAAY;IACZC,OAAOR,EAASS,MAAMC,KAAIL,MACjB;MACLH,SAASG,EAAKF;MACdC,IAAIC,EAAKF;MACTQ,uBAAuB;QACrB,iBAAiB;UACfC,QAAQ,EAAC;YAAEC,QAAQR,EAAKS;;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Z,MAAII,GAAA;QAE5BQ,EAAAZ,MAAI4C,GAAA,KAAc9B,KAAlBd"}
|
|
1
|
+
{"version":3,"names":["mapCategoryToListItemGroup","category","categoryGroup","caption","name","id","type","expanded","expandable","items","types","map","additionalInformation","center","imgSrc","icon","mapDataTypesToList","dataTypes","dataType","index","undefined","order","dataTypeSelectorCss","CSS_BUNDLES","ALL_CATEGORY_ID","RECENTLY_USED_CATEGORY_ID","CLOCK_ICON","getIconPath","colorType","GxIdeKbManagerImport","_GxIdeKbManagerImport__componentLocale","set","this","_GxIdeKbManagerImport_showAll","_GxIdeKbManagerImport_categoriesActionListItemGroupMap","Map","_GxIdeKbManagerImport_handleSelectionChange","event","eventType","_a","detail","item","itemAdditionalBase","dataTypeSelectedCallback","__classPrivateFieldGet","_GxIdeKbManagerImport_updateListBoxModelState","call","selectedCategory","recentlyUsedActionListModel","forEach","selected","selectedItemIndex","recentlyUsed","findIndex","has","group","get","groupUpdated","Object","assign","_GxIdeKbManagerImport_showAllObjects","allCategoriesActionListModel","counter","mapLength","size","key","keys","push","categoriesListBoxModel","__classPrivateFieldSet","_GxIdeKbManagerImport_showRecentlyObjects","selectedCategoryHandler","e","currentTarget","dataset","newSelectedCategory","_GxIdeKbManagerImport_renderFooter","recentlyUsedBtnClass","allBtnClass","selectedCategoryDescription","fixedTypes","all","h","class","length","select","title","onClick","src","categories","buttonClass","categoriesChanged","newCategories","clear","categoryListBoxModel","loading","recentlyUsedChanged","newRecentlyUsed","componentWillLoad","Locale","getComponentStrings","el","render","Host","model","loaderTitle","loader","description","show","selection","onSelectedItemsChange"],"sources":["src/components/data-type-selector/helpers.ts","src/components/data-type-selector/data-type-selector.scss?tag=gx-ide-data-type-selector&encapsulation=shadow","src/components/data-type-selector/data-type-selector.tsx"],"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",":host {\n position: relative;\n display: grid;\n block-size: 100%;\n overflow: auto;\n grid-template-rows: 1fr max-content;\n\n // WA: Prevent a custom css rule on genexus-web from overriding --control__border-width value.\n // TDOO: remove this when the custom style is removed from genexus-web.\n // custom stlye is: .gx-struct-editor .tabular-grid-cell {\n // --control__border-width: 0;\n // }\n\n --control__border-width: var(--mer-border__width--sm);\n --control__border-radius: var(--mer-border__radius--sm);\n}\n\n.main {\n display: contents;\n}\n\n.selected-category {\n margin: 0;\n text-transform: capitalize;\n margin-inline-start: var(\n --mer-spacing--md\n ); // TODO: Create a semantic class in Mercury for this case.\n white-space: nowrap;\n}\n\n.footer {\n overflow: auto;\n}\n","// 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"],"mappings":";;;;;;;;AAMO,MAAMA,6BACXC;EAEA,MAAMC,IAAqC;IACzCC,SAASF,EAASG;IAClBC,IAAIJ,EAASG;IACbE,MAAM;IACNC,UAAU;IACVC,YAAY;IACZC,OAAOR,EAASS,MAAMC,KAAIL,MACjB;MACLH,SAASG,EAAKF;MACdC,IAAIC,EAAKF;MACTQ,uBAAuB;QACrB,iBAAiB;UACfC,QAAQ,EAAC;YAAEC,QAAQR,EAAKS;;;;MA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