@genexus/genexus-ide-ui 1.0.38 → 1.0.40
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/cjs/genexus-ide-ui.cjs.js +1 -1
- package/dist/cjs/gx-ide-ai-assistant.cjs.entry.js +26 -16
- package/dist/cjs/gx-ide-ai-assistant.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-ai-message.cjs.entry.js +22 -11
- package/dist/cjs/gx-ide-ai-message.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-current-user-info.cjs.entry.js +42 -3
- package/dist/cjs/gx-ide-current-user-info.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-data-type-selector.cjs.entry.js +226 -0
- package/dist/cjs/gx-ide-data-type-selector.cjs.entry.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ai-assistant/ai-assistant.js +26 -35
- package/dist/collection/components/ai-assistant/ai-assistant.js.map +1 -1
- package/dist/collection/components/ai-assistant/ai-message.css +13 -11
- package/dist/collection/components/ai-assistant/ai-message.js +41 -13
- package/dist/collection/components/ai-assistant/ai-message.js.map +1 -1
- package/dist/collection/components/current-user-info/current-user-info.css +7 -0
- package/dist/collection/components/current-user-info/current-user-info.js +4 -2
- package/dist/collection/components/current-user-info/current-user-info.js.map +1 -1
- package/dist/collection/components/current-user-info/helpers.js +38 -1
- package/dist/collection/components/current-user-info/helpers.js.map +1 -1
- package/dist/collection/components/data-type-selector/data-type-selector.css +24 -0
- package/dist/collection/components/data-type-selector/data-type-selector.js +275 -0
- package/dist/collection/components/data-type-selector/data-type-selector.js.map +1 -0
- package/dist/collection/components/data-type-selector/gx-ide-assets/data-type-selector/langs/data-type-selector.lang.en.json +13 -0
- package/dist/collection/components/data-type-selector/gx-ide-assets/data-type-selector/langs/data-type-selector.lang.ja.json +13 -0
- package/dist/collection/components/data-type-selector/gx-ide-assets/data-type-selector/langs/data-type-selector.lang.zh.json +13 -0
- package/dist/collection/components/data-type-selector/helpers.js +38 -0
- package/dist/collection/components/data-type-selector/helpers.js.map +1 -0
- package/dist/collection/components/kb-manager-import/kb-manager-import.js +1 -1
- package/dist/collection/components/team-dev/update/update.js +1 -1
- package/dist/collection/testing/locale.e2e.js +1 -0
- package/dist/collection/testing/locale.e2e.js.map +1 -1
- package/dist/components/ai-message.js +23 -11
- package/dist/components/ai-message.js.map +1 -1
- package/dist/components/gx-ide-ai-assistant.js +28 -18
- package/dist/components/gx-ide-ai-assistant.js.map +1 -1
- package/dist/components/gx-ide-current-user-info.js +42 -3
- package/dist/components/gx-ide-current-user-info.js.map +1 -1
- package/dist/components/gx-ide-data-type-selector.d.ts +11 -0
- package/dist/components/gx-ide-data-type-selector.js +258 -0
- package/dist/components/gx-ide-data-type-selector.js.map +1 -0
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-ai-assistant.entry.js +27 -17
- package/dist/esm/gx-ide-ai-assistant.entry.js.map +1 -1
- package/dist/esm/gx-ide-ai-message.entry.js +22 -11
- package/dist/esm/gx-ide-ai-message.entry.js.map +1 -1
- package/dist/esm/gx-ide-current-user-info.entry.js +42 -3
- package/dist/esm/gx-ide-current-user-info.entry.js.map +1 -1
- package/dist/esm/gx-ide-data-type-selector.entry.js +222 -0
- package/dist/esm/gx-ide-data-type-selector.entry.js.map +1 -0
- 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/gx-ide-assets/data-type-selector/langs/data-type-selector.lang.en.json +13 -0
- package/dist/genexus-ide-ui/gx-ide-assets/data-type-selector/langs/data-type-selector.lang.ja.json +13 -0
- package/dist/genexus-ide-ui/gx-ide-assets/data-type-selector/langs/data-type-selector.lang.zh.json +13 -0
- package/dist/genexus-ide-ui/{p-798eb91a.entry.js → p-6e993843.entry.js} +42 -22
- package/dist/genexus-ide-ui/p-6e993843.entry.js.map +1 -0
- package/dist/genexus-ide-ui/p-a3a43593.entry.js +255 -0
- package/dist/genexus-ide-ui/p-a3a43593.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-dd890eed.entry.js → p-c2ec8185.entry.js} +85 -46
- package/dist/genexus-ide-ui/p-c2ec8185.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-a7dcfedd.entry.js → p-fdd9de33.entry.js} +62 -54
- package/dist/genexus-ide-ui/p-fdd9de33.entry.js.map +1 -0
- package/dist/types/components/ai-assistant/ai-assistant.d.ts +1 -6
- package/dist/types/components/ai-assistant/ai-message.d.ts +5 -0
- package/dist/types/components/current-user-info/helpers.d.ts +24 -1
- package/dist/types/components/data-type-selector/data-type-selector.d.ts +46 -0
- package/dist/types/components/data-type-selector/helpers.d.ts +4 -0
- package/dist/types/components.d.ts +47 -19
- package/package.json +2 -1
- package/dist/genexus-ide-ui/p-798eb91a.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-a7dcfedd.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-dd890eed.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-message.js","sourceRoot":"","sources":["../../../src/components/ai-assistant/ai-message.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"ai-message.js","sourceRoot":"","sources":["../../../src/components/ai-assistant/ai-message.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,SAAS,GAAG,WAAW,CAAC;IAC5B,QAAQ,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K,EAAE;gCACL,eAAe,EACb,IAAI,CAAC,WAAW,KAAK,uBAAuB;gCAC9C,uBAAuB,EACrB,IAAI,CAAC,WAAW,KAAK,uBAAuB;gCAC9C,0BAA0B,EAAE,IAAI;6BACjC;4BAED,YAAM,KAAK,EAAC,2BAA2B,IACpC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAC3B,CACF;wBACN,IAAI,CAAC,gBAAgB,EAAE,CACpB,CACP;oBACD,WACE,KAAK,EAAE;4BACL,kBAAkB,EAAE,IAAI;4BACxB,+BAA+B,EAC7B,IAAI,CAAC,WAAW,KAAK,uBAAuB;yBAC/C;wBAEA,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CACxB,YAAM,KAAK,EAAC,QAAQ;4BAClB,gBAAU,KAAK,EAAC,SAAS,EAAC,GAAG,EAAE,SAAS,GAAa;4BACpD,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CACvB,CACR,CAAC,CAAC,CAAC,IAAI;wBACP,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CACnC;oBACL,IAAI,CAAC,WAAW,KAAK,uBAAuB,CAAC,CAAC,CAAC,CAC9C,WAAK,KAAK,EAAC,mBAAmB;wBAC5B,WAAK,KAAK,EAAC,WAAW,GAAO,CACzB,CACP,CAAC,CAAC,CAAC,IAAI,CACJ,CACF,CACH,CACN,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, Element, State } from \"@stencil/core\";\n\nimport { getIconPath } from \"@genexus/mercury\";\n\nimport { Locale } from \"../../common/locale\";\nimport { MessageType } from \"./ai-assistant\";\nimport { hiChar } from \"../../common/helpers\";\n\nconst COPY_ICON = getIconPath({\n category: \"bpm\",\n name: \"tasks\",\n colorType: \"neutral\"\n});\n\n@Component({\n tag: \"gx-ide-ai-message\",\n styleUrl: \"ai-message.scss\",\n shadow: false,\n assetsDirs: [\"gx-ide-assets/ai-message\"]\n})\nexport class GxIdeAiMessage {\n /* The message allows to be copied*/\n private _componentLocale: any;\n private copyable = false;\n\n @Element() el: HTMLGxIdeAiMessageElement;\n\n /**\n * This wil display the message if true\n */\n @State() visible = false;\n\n /**\n * This wil show the user a text, indicating that the message has been copied\n */\n @State() showCopiedMessage = false;\n\n /**\n * A reference to the gx-ide-ai-assistant host element\n */\n @Prop() readonly aiAssistantHostRef: HTMLGxIdeAiAssistantElement;\n\n /**\n * The actual message\n */\n @Prop() readonly message: string;\n\n /**\n * The message type\n */\n @Prop() readonly messageType: MessageType;\n\n /**\n * The filter value\n */\n @Prop() readonly filterValue: string;\n\n /**\n * It hides the message (used for the filter)\n */\n @Prop() readonly hidden: boolean;\n\n /**\n * An object with the needed string translations.\n */\n @Prop() readonly translations: Translations;\n\n async componentWillLoad() {\n this._componentLocale = await Locale.getComponentStrings(this.el);\n this.evaluateMessageIsCopyable();\n }\n\n componentDidRender() {\n setTimeout(() => {\n /* Without the timeout it appears instantly (no apparent transition)*/\n this.visible = true;\n const messagesList = this.el.parentElement;\n messagesList.scrollTo(0, 0);\n }, 0);\n }\n\n private copyMessage = () => {\n const messageInfo = JSON.stringify(\n {\n messageType: this.messageType,\n message: this.message\n },\n null,\n 2\n );\n\n navigator.clipboard.writeText(messageInfo);\n this.showCopiedMessage = true;\n setTimeout(() => {\n this.showCopiedMessage = false;\n }, 1500);\n };\n\n #buttonMouseDownHandler = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n };\n\n private evaluateMessageIsCopyable = () => {\n this.copyable = this.messageType !== \"assistant-in-progress\";\n };\n\n private evaluateCopyIcon = () => {\n return this.copyable ? (\n <button\n class=\"button-tertiary button-icon-only\"\n aria-label=\"copy\"\n onClick={this.copyMessage}\n onMouseDown={this.#buttonMouseDownHandler}\n >\n <ch-image class=\"icon-md\" src={COPY_ICON}></ch-image>\n </button>\n ) : null;\n };\n\n render() {\n return (\n <li\n class={{\n \"message\": true,\n \"message--visible\": this.visible && !this.hidden,\n [`message--${[this.messageType]}`]: true,\n \"message--assistant\": this.messageType !== \"user\",\n \"message--copyable\": this.copyable,\n \"message--copying\": this.showCopiedMessage\n }}\n >\n <div class=\"message__outer-wrapper\">\n <div\n class={{\n \"message__inner-wrapper\": true\n }}\n >\n {this.messageType === \"user\" ? (\n <div class=\"message__header\">\n <span class=\"message__role message__role--user\">\n <span class=\"message__role-description\">\n {this._componentLocale.you}\n </span>\n </span>\n {this.evaluateCopyIcon()}\n </div>\n ) : (\n <div\n class={{\n \"message__header\": true,\n \"message__header--in-progress\":\n this.messageType === \"assistant-in-progress\"\n }}\n >\n <span\n class={{\n \"message__role\":\n this.messageType !== \"assistant-in-progress\",\n \"message__role--hidden\":\n this.messageType === \"assistant-in-progress\",\n \"message__role--assistant\": true\n }}\n >\n <span class=\"message__role-description\">\n {this._componentLocale.assistant}\n </span>\n </span>\n {this.evaluateCopyIcon()}\n </div>\n )}\n <div\n class={{\n \"message__caption\": true,\n \"message__caption--in-progress\":\n this.messageType === \"assistant-in-progress\"\n }}\n >\n {this.showCopiedMessage ? (\n <span class=\"copied\">\n <ch-image class=\"icon-md\" src={COPY_ICON}></ch-image>\n {this.translations[\"copied\"]}\n </span>\n ) : null}\n {hiChar(this.message, this.filterValue)}\n </div>\n {this.messageType === \"assistant-in-progress\" ? (\n <div class=\"animation-wrapper\">\n <div class=\"dot-pulse\"></div>\n </div>\n ) : null}\n </div>\n </div>\n </li>\n );\n }\n}\n\nexport type Translations = {\n [key: string]: string;\n};\n"]}
|
|
@@ -37,6 +37,13 @@
|
|
|
37
37
|
font-size: var(--mer-font__size--4xs);
|
|
38
38
|
color: var(--mer-text__neutral);
|
|
39
39
|
}
|
|
40
|
+
.user-login__name, .user-login__organization {
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
text-overflow: ellipsis;
|
|
44
|
+
max-inline-size: 120px;
|
|
45
|
+
display: inline-block;
|
|
46
|
+
}
|
|
40
47
|
.user-login__avatar {
|
|
41
48
|
font-size: 9px;
|
|
42
49
|
flex: 0 0 auto;
|
|
@@ -19,7 +19,7 @@ var _GxIdeNewEnvironment_componentLocale, _GxIdeNewEnvironment_initials, _GxIdeN
|
|
|
19
19
|
import { Host, h } from "@stencil/core";
|
|
20
20
|
import { getIconPath } from "@genexus/mercury";
|
|
21
21
|
import { Locale } from "../../common/locale";
|
|
22
|
-
import { getInitialsFromName } from "./helpers";
|
|
22
|
+
import { getInitialsFromName, limitFullName } from "./helpers";
|
|
23
23
|
const CSS_BUNDLES = [
|
|
24
24
|
// TODO: review if "utils/form--full" is required.
|
|
25
25
|
"resets/box-sizing",
|
|
@@ -104,7 +104,9 @@ export class GxIdeNewEnvironment {
|
|
|
104
104
|
], "f");
|
|
105
105
|
}
|
|
106
106
|
render() {
|
|
107
|
-
|
|
107
|
+
var _a, _b;
|
|
108
|
+
const userName = limitFullName((_a = this.userInfo) === null || _a === void 0 ? void 0 : _a.name);
|
|
109
|
+
return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("ch-dropdown-render", { class: "dropdown", model: __classPrivateFieldGet(this, _GxIdeNewEnvironment_menuDropdownModel, "f"), position: "InsideEnd_OutsideEnd", itemClickCallback: __classPrivateFieldGet(this, _GxIdeNewEnvironment_dropDownitemClickHandler, "f") }, h("button", { class: "user-login__button", ref: el => (__classPrivateFieldSet(this, _GxIdeNewEnvironment_userLoginButton, el, "f")), slot: "action" }, h("div", { class: "user-login__details" }, userName ? (h("span", { class: "user-login__name" }, userName)) : null, ((_b = this.userInfo) === null || _b === void 0 ? void 0 : _b.team) ? (h("span", { class: "user-login__organization" }, this.userInfo.team)) : null), h("div", { class: "user-login__avatar" }, __classPrivateFieldGet(this, _GxIdeNewEnvironment_initials, "f")), h("ch-image", { src: CHEVRON_DOWN_ICON, class: "icon-md", containerRef: __classPrivateFieldGet(this, _GxIdeNewEnvironment_userLoginButton, "f") })), h("div", { class: "user-login__footer footer-slot", slot: "footer" }, h("p", { class: "text-body-regular-s privacy-policy", onClick: this.showTermsCallback }, __classPrivateFieldGet(this, _GxIdeNewEnvironment_componentLocale, "f").privacyAndTerms)))));
|
|
108
110
|
}
|
|
109
111
|
static get is() { return "gx-ide-current-user-info"; }
|
|
110
112
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"current-user-info.js","sourceRoot":"","sources":["../../../src/components/current-user-info/current-user-info.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qBAAqB;AACrB,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"current-user-info.js","sourceRoot":"","sources":["../../../src/components/current-user-info/current-user-info.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qBAAqB;AACrB,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/D,MAAM,WAAW,GAAmB;IAClC,kDAAkD;IAClD,mBAAmB;IACnB,oBAAoB;IACpB,mBAAmB;IACnB,iBAAiB;IACjB,qBAAqB;IAC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AEN,WAAK,KAAK,EAAC,oBAAoB,IAAE,uBAAA,IAAI,qCAAU,CAAO;oBACtD,gBACE,GAAG,EAAE,iBAAiB,EACtB,KAAK,EAAC,SAAS,EACf,YAAY,EAAE,uBAAA,IAAI,4CAAiB,GACzB,CACL;gBACT,WAAK,KAAK,EAAC,gCAAgC,EAAC,IAAI,EAAC,QAAQ;oBACvD,SACE,KAAK,EAAC,oCAAoC,EAC1C,OAAO,EAAE,IAAI,CAAC,iBAAiB,IAE9B,uBAAA,IAAI,4CAAiB,CAAC,eAAe,CACpC,CACA,CACa,CAChB,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["/* STENCIL IMPORTS */\nimport { Component, Element, Host, Prop, State, h } from \"@stencil/core\";\n\nimport { getIconPath, MercuryBundles } from \"@genexus/mercury\";\n\nimport { Locale } from \"../../common/locale\";\nimport { getInitialsFromName, limitFullName } from \"./helpers\";\nimport { DropdownModel } from \"@genexus/chameleon-controls-library\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n // TODO: review if \"utils/form--full\" is required.\n \"resets/box-sizing\",\n \"components/tooltip\",\n \"components/toggle\",\n \"components/icon\",\n \"components/dropdown\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\n\nconst CHEVRON_DOWN_ICON = getIconPath({\n category: \"navigation\",\n name: \"chevron-down\",\n colorType: \"neutral\"\n});\n\nconst MY_ACCOUNT_ID = \"my-account\";\nconst CHANGE_TEAM_ID = \"change-team\";\nconst SIGN_OUT_ID = \"sign-out\";\nconst LANGUAGE_ID = \"language\";\n\n@Component({\n tag: \"gx-ide-current-user-info\",\n styleUrl: \"current-user-info.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/current-user-info\"]\n})\nexport class GxIdeNewEnvironment {\n #componentLocale: any;\n #initials: string = \"\";\n // #mode: Mode;\n #menuDropdownModel: DropdownModel;\n\n @Element() el: HTMLGxIdeCurrentUserInfoElement;\n #userLoginButton: HTMLButtonElement;\n\n @State() showMenu: boolean = false;\n\n /**\n * User data\n */\n @Prop() readonly userInfo: UserInfo;\n\n /**\n * Callback executed when the user click \"My Account\" link\n */\n @Prop() readonly myAccountCallback!: () => Promise<void>;\n\n /**\n * Callback executed when the user click \"change team\" link\n */\n @Prop() readonly changeTeamCallback!: () => Promise<void>;\n\n /**\n * Callback executed when the user click \"Language\" link\n */\n @Prop() readonly changeLanguageCallback!: () => Promise<void>;\n\n /**\n * Callback executed when the user switch the \"Mode\" status\n */\n @Prop() readonly changeModeCallback!: (mode: Mode) => Promise<void>;\n\n /**\n * Callback executed when the user click \"Sign Out\" link\n */\n @Prop() readonly signOutCallback!: () => Promise<void>;\n\n /**\n * Callback executed when the user click \"Privacy Policy & Terms of use\" link\n */\n @Prop() readonly showTermsCallback!: () => Promise<void>;\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n this.#initials = getInitialsFromName(this.userInfo.name);\n this.#menuDropdownModel = [\n {\n id: MY_ACCOUNT_ID,\n caption: this.#componentLocale.myAccountLabel,\n showSeparator: false\n },\n {\n id: CHANGE_TEAM_ID,\n caption: this.#componentLocale.changeTeamLabel,\n showSeparator: false\n },\n {\n id: SIGN_OUT_ID,\n caption: this.#componentLocale.signOutLabel,\n showSeparator: true\n }\n // {\n // id: LANGUAGE_ID,\n // caption: this.#componentLocale.languageLabel,\n // showSeparator: true\n // }\n ];\n }\n\n // #handleModeSwitch = () => {\n // this.#mode = this.#mode === \"dark\" ? \"light\" : \"dark\";\n // if (this.changeModeCallback) {\n // this.changeModeCallback(this.#mode);\n // }\n // };\n\n #dropDownitemClickHandler = (\n _event: UIEvent,\n _target: string,\n itemId: string\n ): void => {\n if (itemId === MY_ACCOUNT_ID) {\n this.myAccountCallback();\n } else if (itemId === CHANGE_TEAM_ID) {\n this.changeTeamCallback();\n } else if (itemId === SIGN_OUT_ID) {\n this.signOutCallback();\n } else if (itemId === LANGUAGE_ID) {\n this.changeLanguageCallback();\n }\n };\n\n render() {\n const userName = limitFullName(this.userInfo?.name);\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <ch-dropdown-render\n class=\"dropdown\"\n model={this.#menuDropdownModel}\n position=\"InsideEnd_OutsideEnd\"\n itemClickCallback={this.#dropDownitemClickHandler}\n >\n <button\n class=\"user-login__button\"\n ref={el => (this.#userLoginButton = el as HTMLButtonElement)}\n slot=\"action\"\n >\n <div class=\"user-login__details\">\n {userName ? (\n <span class=\"user-login__name\">{userName}</span>\n ) : null}\n {this.userInfo?.team ? (\n <span class=\"user-login__organization\">\n {this.userInfo.team}\n </span>\n ) : null}\n </div>\n\n <div class=\"user-login__avatar\">{this.#initials}</div>\n <ch-image\n src={CHEVRON_DOWN_ICON}\n class=\"icon-md\"\n containerRef={this.#userLoginButton}\n ></ch-image>\n </button>\n <div class=\"user-login__footer footer-slot\" slot=\"footer\">\n <p\n class=\"text-body-regular-s privacy-policy\"\n onClick={this.showTermsCallback}\n >\n {this.#componentLocale.privacyAndTerms}\n </p>\n </div>\n </ch-dropdown-render>\n </Host>\n );\n }\n}\n\nexport type UserInfo = {\n name: string;\n team: string;\n};\n\nexport type Mode = \"dark\" | \"light\";\n"]}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns initials from the first two words of a name. Returns "X" for invalid input.
|
|
3
|
+
*
|
|
4
|
+
* @param name - The full name string.
|
|
5
|
+
* @returns Initials of the first two words, or "X" if invalid.
|
|
6
|
+
*
|
|
7
|
+
* Example:
|
|
8
|
+
* getInitialsFromName("John Doe") -> "JD"
|
|
9
|
+
* getInitialsFromName("Jane") -> "J"
|
|
10
|
+
* getInitialsFromName("") -> "X"
|
|
11
|
+
*/
|
|
1
12
|
export const getInitialsFromName = (name) => {
|
|
2
|
-
|
|
13
|
+
if (typeof name !== "string" || name.trim() === "") {
|
|
14
|
+
return "X";
|
|
15
|
+
}
|
|
16
|
+
const nameData = name.split(" ").filter(Boolean); // Remove any empty strings from splitting
|
|
3
17
|
if (nameData.length === 1) {
|
|
4
18
|
return nameData[0][0].toUpperCase();
|
|
5
19
|
}
|
|
@@ -7,4 +21,27 @@ export const getInitialsFromName = (name) => {
|
|
|
7
21
|
return `${nameData[0][0].toUpperCase()}${nameData[1][0].toUpperCase()}`;
|
|
8
22
|
}
|
|
9
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Limits the full name to the first two words. Returns null for invalid input.
|
|
26
|
+
*
|
|
27
|
+
* @param fullName - The full name string to be limited.
|
|
28
|
+
* @returns The first two words of the full name, or null if invalid.
|
|
29
|
+
*
|
|
30
|
+
* Example:
|
|
31
|
+
* limitFullName("John Doe Smith") -> "John Doe"
|
|
32
|
+
* limitFullName("Jane") -> "Jane"
|
|
33
|
+
* limitFullName("") -> null
|
|
34
|
+
*/
|
|
35
|
+
export const limitFullName = (fullName) => {
|
|
36
|
+
if (typeof fullName !== "string" || fullName.trim() === "") {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
const fullNameData = fullName.split(" ").filter(Boolean); // Remove any empty strings from splitting
|
|
40
|
+
if (fullNameData.length === 1) {
|
|
41
|
+
return fullNameData[0];
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return `${fullNameData[0]} ${fullNameData[1]}`;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
10
47
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/components/current-user-info/helpers.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAY,
|
|
1
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AAC","sourcesContent":["/**\n * Returns initials from the first two words of a name. Returns \"X\" for invalid input.\n *\n * @param name - The full name string.\n * @returns Initials of the first two words, or \"X\" if invalid.\n *\n * Example:\n * getInitialsFromName(\"John Doe\") -> \"JD\"\n * getInitialsFromName(\"Jane\") -> \"J\"\n * getInitialsFromName(\"\") -> \"X\"\n */\nexport const getInitialsFromName = (name: string): string | null => {\n if (typeof name !== \"string\" || name.trim() === \"\") {\n return \"X\";\n }\n\n const nameData = name.split(\" \").filter(Boolean); // Remove any empty strings from splitting\n if (nameData.length === 1) {\n return nameData[0][0].toUpperCase();\n } else {\n return `${nameData[0][0].toUpperCase()}${nameData[1][0].toUpperCase()}`;\n }\n};\n\n/**\n * Limits the full name to the first two words. Returns null for invalid input.\n *\n * @param fullName - The full name string to be limited.\n * @returns The first two words of the full name, or null if invalid.\n *\n * Example:\n * limitFullName(\"John Doe Smith\") -> \"John Doe\"\n * limitFullName(\"Jane\") -> \"Jane\"\n * limitFullName(\"\") -> null\n */\nexport const limitFullName = (fullName: string): string | null => {\n if (typeof fullName !== \"string\" || fullName.trim() === \"\") {\n return null;\n }\n\n const fullNameData = fullName.split(\" \").filter(Boolean); // Remove any empty strings from splitting\n if (fullNameData.length === 1) {\n return fullNameData[0];\n } else {\n return `${fullNameData[0]} ${fullNameData[1]}`;\n }\n};\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: grid;
|
|
4
|
+
block-size: 100%;
|
|
5
|
+
overflow: auto;
|
|
6
|
+
grid-template-rows: 1fr max-content;
|
|
7
|
+
--control__border-width: var(--mer-border__width--sm);
|
|
8
|
+
--control__border-radius: var(--mer-border__radius--sm);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.main {
|
|
12
|
+
display: contents;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.selected-category {
|
|
16
|
+
margin: 0;
|
|
17
|
+
text-transform: capitalize;
|
|
18
|
+
margin-inline-start: var(--mer-spacing--md);
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.footer {
|
|
23
|
+
overflow: auto;
|
|
24
|
+
}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f)
|
|
3
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
5
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
6
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
9
|
+
if (kind === "m")
|
|
10
|
+
throw new TypeError("Private method is not writable");
|
|
11
|
+
if (kind === "a" && !f)
|
|
12
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
14
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
|
+
};
|
|
17
|
+
var _GxIdeKbManagerImport__componentLocale, _GxIdeKbManagerImport_showAll, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, _GxIdeKbManagerImport_handleSelectionChange, _GxIdeKbManagerImport_updateListBoxModelState, _GxIdeKbManagerImport_showAllObjects, _GxIdeKbManagerImport_showRecentlyObjects, _GxIdeKbManagerImport_renderFooter;
|
|
18
|
+
// Stencil
|
|
19
|
+
import { Host, h } from "@stencil/core";
|
|
20
|
+
// Other Libraries
|
|
21
|
+
import { getIconPath } from "@genexus/mercury";
|
|
22
|
+
// Gx Ide Ui
|
|
23
|
+
import { Locale } from "../../common/locale";
|
|
24
|
+
import { mapCategoryToListItemGroup, mapDataTypesToList } from "./helpers";
|
|
25
|
+
const CSS_BUNDLES = [
|
|
26
|
+
"resets/box-sizing",
|
|
27
|
+
"components/tab",
|
|
28
|
+
"components/tooltip",
|
|
29
|
+
"components/list-box",
|
|
30
|
+
"components/tree-view",
|
|
31
|
+
"utils/form--full",
|
|
32
|
+
"utils/layout",
|
|
33
|
+
"utils/typography",
|
|
34
|
+
"utils/spacing",
|
|
35
|
+
"chameleon/scrollbar"
|
|
36
|
+
];
|
|
37
|
+
const ALL_CATEGORY_ID = "all";
|
|
38
|
+
const RECENTLY_USED_CATEGORY_ID = "recenttly-used";
|
|
39
|
+
const CLOCK_ICON = getIconPath({
|
|
40
|
+
category: "system",
|
|
41
|
+
name: "time",
|
|
42
|
+
colorType: "primary"
|
|
43
|
+
});
|
|
44
|
+
export class GxIdeKbManagerImport {
|
|
45
|
+
constructor() {
|
|
46
|
+
_GxIdeKbManagerImport__componentLocale.set(this, void 0);
|
|
47
|
+
_GxIdeKbManagerImport_showAll.set(this, false);
|
|
48
|
+
_GxIdeKbManagerImport_categoriesActionListItemGroupMap.set(this, new Map());
|
|
49
|
+
_GxIdeKbManagerImport_handleSelectionChange.set(this, (event) => {
|
|
50
|
+
var _a;
|
|
51
|
+
const eventType = (_a = event.detail[0]) === null || _a === void 0 ? void 0 : _a.item.type;
|
|
52
|
+
if (eventType === "actionable") {
|
|
53
|
+
const name = event.detail[0].item.caption;
|
|
54
|
+
const itemAdditionalBase = event.detail[0].item.additionalInformation["stretch-start"].center[0];
|
|
55
|
+
const icon = itemAdditionalBase.imgSrc;
|
|
56
|
+
this.dataTypeSelectedCallback({
|
|
57
|
+
name: name,
|
|
58
|
+
icon: icon
|
|
59
|
+
});
|
|
60
|
+
__classPrivateFieldGet(this, _GxIdeKbManagerImport_updateListBoxModelState, "f").call(this, event.detail[0].item.caption, "actionable");
|
|
61
|
+
}
|
|
62
|
+
else if (eventType === "group") {
|
|
63
|
+
__classPrivateFieldGet(this, _GxIdeKbManagerImport_updateListBoxModelState, "f").call(this, event.detail[0].item.caption, "group");
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
_GxIdeKbManagerImport_updateListBoxModelState.set(this, (name, type) => {
|
|
67
|
+
if (this.selectedCategory === RECENTLY_USED_CATEGORY_ID) {
|
|
68
|
+
this.recentlyUsedActionListModel.forEach(item => {
|
|
69
|
+
// clear selected
|
|
70
|
+
item.selected = false;
|
|
71
|
+
});
|
|
72
|
+
const selectedItemIndex = this.recentlyUsed.findIndex(item => item.name === name);
|
|
73
|
+
if (selectedItemIndex !== -1) {
|
|
74
|
+
this.recentlyUsedActionListModel[selectedItemIndex].selected = true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
else if (type === "group" &&
|
|
78
|
+
__classPrivateFieldGet(this, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, "f").has(name)) {
|
|
79
|
+
const group = __classPrivateFieldGet(this, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, "f").get(name);
|
|
80
|
+
const groupUpdated = Object.assign(Object.assign({}, group), { expanded: group.expanded });
|
|
81
|
+
__classPrivateFieldGet(this, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, "f").set(name, groupUpdated);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
_GxIdeKbManagerImport_showAllObjects.set(this, () => {
|
|
85
|
+
if (!__classPrivateFieldGet(this, _GxIdeKbManagerImport_showAll, "f")) {
|
|
86
|
+
const allCategoriesActionListModel = [];
|
|
87
|
+
let counter = 1;
|
|
88
|
+
const mapLength = __classPrivateFieldGet(this, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, "f").size;
|
|
89
|
+
for (const key of __classPrivateFieldGet(this, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, "f").keys()) {
|
|
90
|
+
allCategoriesActionListModel.push(__classPrivateFieldGet(this, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, "f").get(key));
|
|
91
|
+
if (counter !== mapLength) {
|
|
92
|
+
allCategoriesActionListModel.push({ type: "separator" });
|
|
93
|
+
}
|
|
94
|
+
counter++;
|
|
95
|
+
}
|
|
96
|
+
this.categoriesListBoxModel = allCategoriesActionListModel;
|
|
97
|
+
__classPrivateFieldSet(this, _GxIdeKbManagerImport_showAll, true, "f");
|
|
98
|
+
this.selectedCategory = ALL_CATEGORY_ID;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
_GxIdeKbManagerImport_showRecentlyObjects.set(this, () => {
|
|
102
|
+
__classPrivateFieldSet(this, _GxIdeKbManagerImport_showAll, false, "f");
|
|
103
|
+
this.categoriesListBoxModel = this.recentlyUsedActionListModel;
|
|
104
|
+
this.selectedCategory = RECENTLY_USED_CATEGORY_ID;
|
|
105
|
+
});
|
|
106
|
+
this.selectedCategoryHandler = (e) => {
|
|
107
|
+
this.selectedCategory = e.currentTarget.dataset.name;
|
|
108
|
+
const newSelectedCategory = [
|
|
109
|
+
__classPrivateFieldGet(this, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, "f").get(this.selectedCategory)
|
|
110
|
+
];
|
|
111
|
+
this.categoriesListBoxModel = newSelectedCategory;
|
|
112
|
+
__classPrivateFieldSet(this, _GxIdeKbManagerImport_showAll, false, "f");
|
|
113
|
+
};
|
|
114
|
+
_GxIdeKbManagerImport_renderFooter.set(this, () => {
|
|
115
|
+
const recentlyUsedBtnClass = this.selectedCategory === RECENTLY_USED_CATEGORY_ID
|
|
116
|
+
? "button-secondary"
|
|
117
|
+
: "button-tertiary";
|
|
118
|
+
const allBtnClass = this.selectedCategory === ALL_CATEGORY_ID
|
|
119
|
+
? "button-secondary"
|
|
120
|
+
: "button-tertiary";
|
|
121
|
+
let selectedCategoryDescription = this.selectedCategory;
|
|
122
|
+
if (this.selectedCategory === RECENTLY_USED_CATEGORY_ID) {
|
|
123
|
+
selectedCategoryDescription =
|
|
124
|
+
__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").fixedTypes.recentlyUsed;
|
|
125
|
+
}
|
|
126
|
+
else if (this.selectedCategory === ALL_CATEGORY_ID) {
|
|
127
|
+
selectedCategoryDescription = __classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").fixedTypes.all;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
selectedCategoryDescription = this.selectedCategory;
|
|
131
|
+
}
|
|
132
|
+
return (h("footer", { class: "footer control-footer control-footer-start spacing-body-inline spacing-body-block scrollable\n " }, h("div", { class: "buttons-spacer" }, this.recentlyUsed && this.recentlyUsed.length > 0 && (h("button", { class: `button-icon-only ${recentlyUsedBtnClass}`, "aria-label": `${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").select} ${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").fixedTypes.recentlyUsed}`, title: `${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").select} ${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").fixedTypes.recentlyUsed}`, onClick: __classPrivateFieldGet(this, _GxIdeKbManagerImport_showRecentlyObjects, "f") }, h("ch-image", { class: "icon-md", src: CLOCK_ICON }))), h("button", { class: `button-icon-only ${allBtnClass}`, onClick: __classPrivateFieldGet(this, _GxIdeKbManagerImport_showAllObjects, "f"), "aria-label": `${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").select} ${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").fixedTypes.all}`, title: `${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").select} ${__classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").fixedTypes.all}` }, "[*]"), this.categories.map(category => {
|
|
133
|
+
const buttonClass = category.name === this.selectedCategory
|
|
134
|
+
? "button-secondary"
|
|
135
|
+
: "button-tertiary";
|
|
136
|
+
return (h("button", { class: `button-icon-only ${buttonClass}`, "aria-label": category.name, title: category.name, onClick: this.selectedCategoryHandler, "data-name": category.name }, h("ch-image", { class: "icon-md", src: category.icon })));
|
|
137
|
+
})), h("p", { class: "text-body-regular-s selected-category" }, selectedCategoryDescription)));
|
|
138
|
+
});
|
|
139
|
+
this.categoriesListBoxModel = [];
|
|
140
|
+
this.selectedCategory = undefined;
|
|
141
|
+
this.statusInfo = [];
|
|
142
|
+
this.recentlyUsedActionListModel = [];
|
|
143
|
+
this.loading = true;
|
|
144
|
+
this.categories = undefined;
|
|
145
|
+
this.dataTypeSelectedCallback = undefined;
|
|
146
|
+
this.recentlyUsed = [];
|
|
147
|
+
}
|
|
148
|
+
categoriesChanged(newCategories) {
|
|
149
|
+
if (!(newCategories === null || newCategories === void 0 ? void 0 : newCategories.length)) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
__classPrivateFieldGet(this, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, "f").clear();
|
|
153
|
+
newCategories.forEach(category => {
|
|
154
|
+
const categoryListBoxModel = mapCategoryToListItemGroup(category);
|
|
155
|
+
__classPrivateFieldGet(this, _GxIdeKbManagerImport_categoriesActionListItemGroupMap, "f").set(category.name, categoryListBoxModel);
|
|
156
|
+
});
|
|
157
|
+
this.loading = false;
|
|
158
|
+
__classPrivateFieldGet(this, _GxIdeKbManagerImport_showAllObjects, "f").call(this);
|
|
159
|
+
}
|
|
160
|
+
recentlyUsedChanged(newRecentlyUsed) {
|
|
161
|
+
this.recentlyUsedActionListModel = null;
|
|
162
|
+
this.recentlyUsedActionListModel = mapDataTypesToList(newRecentlyUsed);
|
|
163
|
+
}
|
|
164
|
+
async componentWillLoad() {
|
|
165
|
+
__classPrivateFieldSet(this, _GxIdeKbManagerImport__componentLocale, await Locale.getComponentStrings(this.el), "f");
|
|
166
|
+
// initialize models
|
|
167
|
+
this.recentlyUsed.length && this.recentlyUsedChanged(this.recentlyUsed);
|
|
168
|
+
}
|
|
169
|
+
render() {
|
|
170
|
+
return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), this.loading ? (h("gx-ide-loader", { loaderTitle: __classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").loader.title, description: __classPrivateFieldGet(this, _GxIdeKbManagerImport__componentLocale, "f").loader.description, show: true })) : (h("section", { class: "main" }, h("ch-action-list-render", { class: "list-box", model: this.categoriesListBoxModel, selection: "single", onSelectedItemsChange: __classPrivateFieldGet(this, _GxIdeKbManagerImport_handleSelectionChange, "f") }), __classPrivateFieldGet(this, _GxIdeKbManagerImport_renderFooter, "f").call(this)))));
|
|
171
|
+
}
|
|
172
|
+
static get is() { return "gx-ide-data-type-selector"; }
|
|
173
|
+
static get encapsulation() { return "shadow"; }
|
|
174
|
+
static get originalStyleUrls() {
|
|
175
|
+
return {
|
|
176
|
+
"$": ["data-type-selector.scss"]
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
static get styleUrls() {
|
|
180
|
+
return {
|
|
181
|
+
"$": ["data-type-selector.css"]
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
static get assetsDirs() { return ["gx-ide-assets/data-type-selector"]; }
|
|
185
|
+
static get properties() {
|
|
186
|
+
return {
|
|
187
|
+
"categories": {
|
|
188
|
+
"type": "unknown",
|
|
189
|
+
"mutable": false,
|
|
190
|
+
"complexType": {
|
|
191
|
+
"original": "DataTypeCategoryData[]",
|
|
192
|
+
"resolved": "DataTypeCategoryData[]",
|
|
193
|
+
"references": {
|
|
194
|
+
"DataTypeCategoryData": {
|
|
195
|
+
"location": "local",
|
|
196
|
+
"path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/data-type-selector/data-type-selector.tsx",
|
|
197
|
+
"id": "src/components/data-type-selector/data-type-selector.tsx::DataTypeCategoryData"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"required": false,
|
|
202
|
+
"optional": false,
|
|
203
|
+
"docs": {
|
|
204
|
+
"tags": [],
|
|
205
|
+
"text": "All possible types and its category"
|
|
206
|
+
},
|
|
207
|
+
"defaultValue": "undefined"
|
|
208
|
+
},
|
|
209
|
+
"dataTypeSelectedCallback": {
|
|
210
|
+
"type": "unknown",
|
|
211
|
+
"mutable": false,
|
|
212
|
+
"complexType": {
|
|
213
|
+
"original": "DataTypeSelectedCallback",
|
|
214
|
+
"resolved": "(data: { name: string; icon: string; }) => Promise<void>",
|
|
215
|
+
"references": {
|
|
216
|
+
"DataTypeSelectedCallback": {
|
|
217
|
+
"location": "local",
|
|
218
|
+
"path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/data-type-selector/data-type-selector.tsx",
|
|
219
|
+
"id": "src/components/data-type-selector/data-type-selector.tsx::DataTypeSelectedCallback"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"required": false,
|
|
224
|
+
"optional": false,
|
|
225
|
+
"docs": {
|
|
226
|
+
"tags": [],
|
|
227
|
+
"text": "Callback invoked when user select an item type"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"recentlyUsed": {
|
|
231
|
+
"type": "unknown",
|
|
232
|
+
"mutable": false,
|
|
233
|
+
"complexType": {
|
|
234
|
+
"original": "DataTypeData[]",
|
|
235
|
+
"resolved": "DataTypeData[]",
|
|
236
|
+
"references": {
|
|
237
|
+
"DataTypeData": {
|
|
238
|
+
"location": "local",
|
|
239
|
+
"path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/data-type-selector/data-type-selector.tsx",
|
|
240
|
+
"id": "src/components/data-type-selector/data-type-selector.tsx::DataTypeData"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
"required": false,
|
|
245
|
+
"optional": false,
|
|
246
|
+
"docs": {
|
|
247
|
+
"tags": [],
|
|
248
|
+
"text": "All recently used types list"
|
|
249
|
+
},
|
|
250
|
+
"defaultValue": "[]"
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
static get states() {
|
|
255
|
+
return {
|
|
256
|
+
"categoriesListBoxModel": {},
|
|
257
|
+
"selectedCategory": {},
|
|
258
|
+
"statusInfo": {},
|
|
259
|
+
"recentlyUsedActionListModel": {},
|
|
260
|
+
"loading": {}
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
static get elementRef() { return "el"; }
|
|
264
|
+
static get watchers() {
|
|
265
|
+
return [{
|
|
266
|
+
"propName": "categories",
|
|
267
|
+
"methodName": "categoriesChanged"
|
|
268
|
+
}, {
|
|
269
|
+
"propName": "recentlyUsed",
|
|
270
|
+
"methodName": "recentlyUsedChanged"
|
|
271
|
+
}];
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
_GxIdeKbManagerImport__componentLocale = new WeakMap(), _GxIdeKbManagerImport_showAll = new WeakMap(), _GxIdeKbManagerImport_categoriesActionListItemGroupMap = new WeakMap(), _GxIdeKbManagerImport_handleSelectionChange = new WeakMap(), _GxIdeKbManagerImport_updateListBoxModelState = new WeakMap(), _GxIdeKbManagerImport_showAllObjects = new WeakMap(), _GxIdeKbManagerImport_showRecentlyObjects = new WeakMap(), _GxIdeKbManagerImport_renderFooter = new WeakMap();
|
|
275
|
+
//# sourceMappingURL=data-type-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-type-selector.js","sourceRoot":"","sources":["../../../src/components/data-type-selector/data-type-selector.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,UAAU;AACV,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,kBAAkB;AAClB,OAAO,EAAkB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAY/D,YAAY;AACZ,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE3E,MAAM,WAAW,GAAmB;IAClC,mBAAmB;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IACzB,CAAC;IAYD,mBAAmB,CAAC,eAA+B;QACjD,IAAI,CAAC,2BAA2B,GAAG,IAAI,CAAC;QACxC,IAAI,CAAC,2BAA2B,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,uBAAA,IAAI,0CAAqB,MAAM,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC,MAAA,CAAC;QACnE,oBAAoB;QACpB,IAAI,CAAC,YAAY,CAAC,MAAM,IAAI,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1E,CAAC;IAqKD,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,IAAC,KAAK,EAAC,QAAQ;YAClB,gBAAU,KAAK,EAAE,WAAW,GAAa;YACxC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CACd,qBACE,WAAW,EAAE,uBAAA,IAAI,8CAAkB,CAAC,MAAM,CAAC,KAAK,EAChD,WAAW,EAAE,uBAAA,IAAI,8CAAkB,CAAC,MAAM,CAAC,WAAW,EACtD,IAAI,SACW,CAClB,CAAC,CAAC,CAAC,CACF,eAAS,KAAK,EAAC,MAAM;gBACnB,6BACE,KAAK,EAAC,UAAU,EAChB,KAAK,EAAE,IAAI,CAAC,sBAAsB,EAClC,SAAS,EAAC,QAAQ,EAClB,qBAAqB,EAAE,uBAAA,IAAI,mDAAuB,GAC3B;gBACxB,uBAAA,IAAI,0CAAc,MAAlB,IAAI,CAAgB,CACb,CACX,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["// Stencil\nimport { Component, Host, h, Prop, Element, State, Watch } from \"@stencil/core\";\n// Other Libraries\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\nimport {\n 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=\"text-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"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"componentName": "Data Type Selector",
|
|
3
|
+
"loader": {
|
|
4
|
+
"title": "Loading Data Types",
|
|
5
|
+
"description": "Hango on please..."
|
|
6
|
+
},
|
|
7
|
+
"fixedTypes": {
|
|
8
|
+
"all": "All",
|
|
9
|
+
"recentlyUsed": "Recently Used"
|
|
10
|
+
},
|
|
11
|
+
"select": "Select",
|
|
12
|
+
"selectedCategory": "Selected Cateogry: "
|
|
13
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const mapCategoryToListItemGroup = (category) => {
|
|
2
|
+
const categoryGroup = {
|
|
3
|
+
caption: category.name,
|
|
4
|
+
id: category.name,
|
|
5
|
+
type: "group",
|
|
6
|
+
expanded: true,
|
|
7
|
+
expandable: true,
|
|
8
|
+
items: category.types.map(type => {
|
|
9
|
+
return {
|
|
10
|
+
caption: type.name,
|
|
11
|
+
id: type.name,
|
|
12
|
+
additionalInformation: {
|
|
13
|
+
"stretch-start": {
|
|
14
|
+
center: [{ imgSrc: type.icon }]
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
type: "actionable"
|
|
18
|
+
};
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
return categoryGroup;
|
|
22
|
+
};
|
|
23
|
+
export const mapDataTypesToList = (dataTypes) => {
|
|
24
|
+
return dataTypes.map((dataType, index) => {
|
|
25
|
+
return {
|
|
26
|
+
caption: dataType.name,
|
|
27
|
+
id: dataType.name,
|
|
28
|
+
additionalInformation: {
|
|
29
|
+
"stretch-start": {
|
|
30
|
+
center: [{ imgSrc: dataType.icon || undefined }]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
type: "actionable",
|
|
34
|
+
order: index
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/components/data-type-selector/helpers.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,QAA8B,EACT,EAAE;IACvB,MAAM,aAAa,GAAwB;QACzC,OAAO,EAAE,QAAQ,CAAC,IAAI;QACtB,EAAE,EAAE,QAAQ,CAAC,IAAI;QACjB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC/B,OAAO;gBACL,OAAO,EAAE,IAAI,CAAC,IAAI;gBAClB,EAAE,EAAE,IAAI,CAAC,IAAI;gBACb,qBAAqB,EAAE;oBACrB,eAAe,EAAE;wBACf,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;qBAChC;iBACF;gBACD,IAAI,EAAE,YAAY;aACnB,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;IACF,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,SAAyB,EACR,EAAE;IACnB,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;QACvC,OAAO;YACL,OAAO,EAAE,QAAQ,CAAC,IAAI;YACtB,EAAE,EAAE,QAAQ,CAAC,IAAI;YACjB,qBAAqB,EAAE;gBACrB,eAAe,EAAE;oBACf,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,IAAI,SAAS,EAAE,CAAC;iBACjD;aACF;YACD,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,KAAK;SACb,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { DataTypeCategoryData, DataTypeData } from \"./data-type-selector\";\nimport {\n ActionListItemGroup,\n ActionListModel\n} from \"@genexus/chameleon-controls-library/dist/types/components/action-list/types\";\n\nexport const mapCategoryToListItemGroup = (\n category: DataTypeCategoryData\n): ActionListItemGroup => {\n const categoryGroup: ActionListItemGroup = {\n caption: category.name,\n id: category.name,\n type: \"group\",\n expanded: true,\n expandable: true,\n items: category.types.map(type => {\n return {\n caption: type.name,\n id: type.name,\n additionalInformation: {\n \"stretch-start\": {\n center: [{ imgSrc: type.icon }]\n }\n },\n type: \"actionable\"\n };\n })\n };\n return categoryGroup;\n};\n\nexport const mapDataTypesToList = (\n dataTypes: DataTypeData[]\n): ActionListModel => {\n return dataTypes.map((dataType, index) => {\n return {\n caption: dataType.name,\n id: dataType.name,\n additionalInformation: {\n \"stretch-start\": {\n center: [{ imgSrc: dataType.icon || undefined }]\n }\n },\n type: \"actionable\",\n order: index\n };\n });\n};\n"]}
|