@genexus/genexus-ide-ui 0.0.131 → 0.0.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/cjs/{form-validation-b4788ff9.js → form-validation-40aa8527.js} +2 -1
  2. package/dist/cjs/form-validation-40aa8527.js.map +1 -0
  3. package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
  4. package/dist/cjs/gx-ide-connect-gx-server.cjs.entry.js +88 -0
  5. package/dist/cjs/gx-ide-connect-gx-server.cjs.entry.js.map +1 -0
  6. package/dist/cjs/gx-ide-create-kb-from-server.cjs.entry.js +1 -1
  7. package/dist/cjs/gx-ide-new-environment.cjs.entry.js +1 -1
  8. package/dist/cjs/gx-ide-new-kb.cjs.entry.js +1 -1
  9. package/dist/cjs/gx-ide-share-kb.cjs.entry.js +1 -1
  10. package/dist/cjs/{gxg-button.cjs.entry.js → gx-ide-title_3.cjs.entry.js} +70 -1
  11. package/dist/cjs/gx-ide-title_3.cjs.entry.js.map +1 -0
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/collection/collection-manifest.json +1 -0
  14. package/dist/collection/common/form-validation.js +1 -0
  15. package/dist/collection/common/form-validation.js.map +1 -1
  16. package/dist/collection/common/types.js.map +1 -1
  17. package/dist/collection/components/connect-gx-server/connect-gx-server.css +533 -0
  18. package/dist/collection/components/connect-gx-server/connect-gx-server.js +260 -0
  19. package/dist/collection/components/connect-gx-server/connect-gx-server.js.map +1 -0
  20. package/dist/collection/components/connect-gx-server/gx-ide-assets/connect-gx-server/langs/connect-gx-server.lang.en.json +17 -0
  21. package/dist/collection/components/connect-gx-server/gx-ide-assets/connect-gx-server/langs/connect-gx-server.lang.ja.json +3 -0
  22. package/dist/collection/components/connect-gx-server/gx-ide-assets/connect-gx-server/langs/connect-gx-server.lang.zh.json +3 -0
  23. package/dist/components/form-validation.js +1 -0
  24. package/dist/components/form-validation.js.map +1 -1
  25. package/dist/components/gx-ide-connect-gx-server.d.ts +11 -0
  26. package/dist/components/gx-ide-connect-gx-server.js +183 -0
  27. package/dist/components/gx-ide-connect-gx-server.js.map +1 -0
  28. package/dist/esm/{form-validation-39376dc8.js → form-validation-9367af5a.js} +2 -1
  29. package/dist/esm/form-validation-9367af5a.js.map +1 -0
  30. package/dist/esm/genexus-ide-ui.js +1 -1
  31. package/dist/esm/gx-ide-connect-gx-server.entry.js +84 -0
  32. package/dist/esm/gx-ide-connect-gx-server.entry.js.map +1 -0
  33. package/dist/esm/gx-ide-create-kb-from-server.entry.js +1 -1
  34. package/dist/esm/gx-ide-new-environment.entry.js +1 -1
  35. package/dist/esm/gx-ide-new-kb.entry.js +1 -1
  36. package/dist/esm/gx-ide-share-kb.entry.js +1 -1
  37. package/dist/esm/{gxg-button.entry.js → gx-ide-title_3.entry.js} +70 -3
  38. package/dist/esm/{gxg-button.entry.js.map → gx-ide-title_3.entry.js.map} +1 -1
  39. package/dist/esm/loader.js +1 -1
  40. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  41. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
  42. package/dist/genexus-ide-ui/gx-ide-assets/connect-gx-server/langs/connect-gx-server.lang.en.json +17 -0
  43. package/dist/genexus-ide-ui/gx-ide-assets/connect-gx-server/langs/connect-gx-server.lang.ja.json +3 -0
  44. package/dist/genexus-ide-ui/gx-ide-assets/connect-gx-server/langs/connect-gx-server.lang.zh.json +3 -0
  45. package/dist/genexus-ide-ui/p-00095d68.js +20 -0
  46. package/dist/genexus-ide-ui/p-00095d68.js.map +1 -0
  47. package/dist/genexus-ide-ui/{p-dc1fb08a.entry.js → p-51f2f081.entry.js} +2 -2
  48. package/dist/genexus-ide-ui/p-64de1e77.entry.js +129 -0
  49. package/dist/genexus-ide-ui/p-64de1e77.entry.js.map +1 -0
  50. package/dist/genexus-ide-ui/{p-259c12b9.entry.js → p-6d06451e.entry.js} +2 -2
  51. package/dist/genexus-ide-ui/{p-b37744dc.entry.js → p-9a8f3b43.entry.js} +2 -2
  52. package/dist/genexus-ide-ui/{p-5381e7f3.entry.js → p-c49ce410.entry.js} +117 -16
  53. package/dist/genexus-ide-ui/p-c49ce410.entry.js.map +1 -0
  54. package/dist/genexus-ide-ui/{p-d3610b68.entry.js → p-e7f542e1.entry.js} +2 -2
  55. package/dist/types/common/form-validation.d.ts +2 -2
  56. package/dist/types/common/types.d.ts +4 -0
  57. package/dist/types/components/connect-gx-server/connect-gx-server.d.ts +60 -0
  58. package/dist/types/components.d.ts +102 -8
  59. package/package.json +1 -1
  60. package/dist/cjs/form-validation-b4788ff9.js.map +0 -1
  61. package/dist/cjs/gx-ide-title_2.cjs.entry.js +0 -77
  62. package/dist/cjs/gx-ide-title_2.cjs.entry.js.map +0 -1
  63. package/dist/cjs/gxg-button.cjs.entry.js.map +0 -1
  64. package/dist/esm/form-validation-39376dc8.js.map +0 -1
  65. package/dist/esm/gx-ide-title_2.entry.js +0 -72
  66. package/dist/esm/gx-ide-title_2.entry.js.map +0 -1
  67. package/dist/genexus-ide-ui/p-3ad793aa.entry.js +0 -105
  68. package/dist/genexus-ide-ui/p-3ad793aa.entry.js.map +0 -1
  69. package/dist/genexus-ide-ui/p-5381e7f3.entry.js.map +0 -1
  70. package/dist/genexus-ide-ui/p-e8646b08.js +0 -19
  71. package/dist/genexus-ide-ui/p-e8646b08.js.map +0 -1
  72. /package/dist/genexus-ide-ui/{p-dc1fb08a.entry.js.map → p-51f2f081.entry.js.map} +0 -0
  73. /package/dist/genexus-ide-ui/{p-259c12b9.entry.js.map → p-6d06451e.entry.js.map} +0 -0
  74. /package/dist/genexus-ide-ui/{p-b37744dc.entry.js.map → p-9a8f3b43.entry.js.map} +0 -0
  75. /package/dist/genexus-ide-ui/{p-d3610b68.entry.js.map → p-e7f542e1.entry.js.map} +0 -0
@@ -0,0 +1,260 @@
1
+ /* STENCIL IMPORTS */
2
+ import { Host, h } from "@stencil/core";
3
+ /* OTHER LIBRARIES IMPORTS */
4
+ /* CUSTOM IMPORTS */
5
+ import { config } from "../../common/config";
6
+ import { Locale } from "../../common/locale";
7
+ import { formSubmitValidation } from "../../common/form-validation";
8
+ export class GxIdeConnectGxServer {
9
+ constructor() {
10
+ this.renderedFirstTime = false;
11
+ // 7.LISTENERS //
12
+ // 8.PUBLIC METHODS API //
13
+ // 9.LOCAL METHODS //
14
+ this.renderServerUrls = () => {
15
+ var _a;
16
+ if ((_a = this.serverUrls) === null || _a === void 0 ? void 0 : _a.length) {
17
+ return this.serverUrls.map(serverUrl => {
18
+ return h("gxg-combo-box-item", null, serverUrl);
19
+ });
20
+ }
21
+ return [];
22
+ };
23
+ this.continueWithGxServerHandler = (event) => {
24
+ this.displayLoginControls = !event.detail.value;
25
+ };
26
+ this.evaluateDisplayLoginControls = () => {
27
+ if (this.enableUserLogged) {
28
+ this.displayLoginControls = false;
29
+ }
30
+ else {
31
+ this.displayLoginControls = true;
32
+ }
33
+ };
34
+ this.connectHandler = () => {
35
+ if (this.connectCallback) {
36
+ this.connectCallback({
37
+ serverUrl: this.serverURLEl.value,
38
+ continueWithGeneXusAccount: this.continueWithGeneXusAccountEl.checked,
39
+ user: this.userNameEl.value,
40
+ password: this.passwordEl.value
41
+ }).then((formSubmitResult) => {
42
+ console.log(formSubmitResult);
43
+ formSubmitValidation(formSubmitResult, this);
44
+ });
45
+ }
46
+ };
47
+ this.displayLoginControls = false;
48
+ this.displayTitle = false;
49
+ this.serverUrls = undefined;
50
+ this.enableCustomServer = false;
51
+ this.defaultConnectionData = undefined;
52
+ this.enableUserLogged = false;
53
+ this.connectCallback = undefined;
54
+ this.cancelCallback = undefined;
55
+ }
56
+ // 6.COMPONENT LIFECYCLE METHODS //
57
+ async componentWillLoad() {
58
+ this._componentLocale = await Locale.getComponentStrings(this.el);
59
+ this.evaluateDisplayLoginControls();
60
+ }
61
+ componentDidRender() {
62
+ if (!this.renderedFirstTime) {
63
+ this.componentDidRenderFirstTime.emit(this._componentLocale.componentName);
64
+ this.renderedFirstTime = true;
65
+ }
66
+ }
67
+ // 10.RENDER() FUNCTION //
68
+ render() {
69
+ var _a;
70
+ return (h(Host, { class: "gx-ide-component" }, h("div", { class: "gx-ide-main-wrapper" }, h("gx-ide-container", { containerTitle: this.displayTitle ? this._componentLocale.componentName : null, slimmerFooter: config.gxIdeContainer.slimmerFooter }, h("div", { class: "wrapper" }, h("gxg-combo-box", { label: this._componentLocale.main.serverUrl, disableFilter: !this.enableCustomServer, value: (_a = this.defaultConnectionData) === null || _a === void 0 ? void 0 : _a.serverUrl, ref: el => (this.serverURLEl = el), toolTip: config.tooltip }, this.renderServerUrls()), h("gxg-form-checkbox", { label: this._componentLocale.main.continueWithGxAccount, onChange: this.continueWithGxServerHandler, checked: this.defaultConnectionData
71
+ ? this.defaultConnectionData.continueWithGeneXusAccount
72
+ : this.enableUserLogged, disabled: !this.enableUserLogged, ref: el => (this.continueWithGeneXusAccountEl =
73
+ el) }), this.displayLoginControls ? (h("div", { class: "user-details-container" }, h("gxg-form-text", { label: this._componentLocale.main.userName, labelPosition: "above", disabled: !this.displayLoginControls, value: this.defaultConnectionData.user, ref: el => (this.userNameEl = el), toolTip: config.tooltip }), h("gxg-form-text", { label: this._componentLocale.main.password, labelPosition: "above", disabled: !this.displayLoginControls, value: this.defaultConnectionData.password, ref: el => (this.passwordEl = el), password: true, toolTip: config.tooltip }))) : null), h("gxg-button", { slot: "footer-end", type: "outlined" }, this._componentLocale.main.cancel), h("gxg-button", { slot: "footer-end", onClick: this.connectHandler }, this._componentLocale.main.connect)))));
74
+ }
75
+ static get is() { return "gx-ide-connect-gx-server"; }
76
+ static get encapsulation() { return "shadow"; }
77
+ static get originalStyleUrls() {
78
+ return {
79
+ "$": ["connect-gx-server.scss"]
80
+ };
81
+ }
82
+ static get styleUrls() {
83
+ return {
84
+ "$": ["connect-gx-server.css"]
85
+ };
86
+ }
87
+ static get assetsDirs() { return ["gx-ide-assets/connect-gx-server"]; }
88
+ static get properties() {
89
+ return {
90
+ "displayTitle": {
91
+ "type": "boolean",
92
+ "mutable": false,
93
+ "complexType": {
94
+ "original": "false",
95
+ "resolved": "boolean",
96
+ "references": {}
97
+ },
98
+ "required": false,
99
+ "optional": false,
100
+ "docs": {
101
+ "tags": [],
102
+ "text": "If true it displays the component title on the header"
103
+ },
104
+ "attribute": "display-title",
105
+ "reflect": false,
106
+ "defaultValue": "false"
107
+ },
108
+ "serverUrls": {
109
+ "type": "unknown",
110
+ "mutable": false,
111
+ "complexType": {
112
+ "original": "string[]",
113
+ "resolved": "string[]",
114
+ "references": {}
115
+ },
116
+ "required": false,
117
+ "optional": false,
118
+ "docs": {
119
+ "tags": [],
120
+ "text": "Array of cataloged server URLs"
121
+ }
122
+ },
123
+ "enableCustomServer": {
124
+ "type": "boolean",
125
+ "mutable": false,
126
+ "complexType": {
127
+ "original": "boolean",
128
+ "resolved": "boolean",
129
+ "references": {}
130
+ },
131
+ "required": false,
132
+ "optional": false,
133
+ "docs": {
134
+ "tags": [],
135
+ "text": "'true' if the user should be allowed to manually enter a server URL in serverUrls."
136
+ },
137
+ "attribute": "enable-custom-server",
138
+ "reflect": false,
139
+ "defaultValue": "false"
140
+ },
141
+ "defaultConnectionData": {
142
+ "type": "unknown",
143
+ "mutable": false,
144
+ "complexType": {
145
+ "original": "GXServerConnectionData",
146
+ "resolved": "{ serverUrl: string; continueWithGeneXusAccount: boolean; user: string; password: string; }",
147
+ "references": {
148
+ "GXServerConnectionData": {
149
+ "location": "local",
150
+ "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/connect-gx-server/connect-gx-server.tsx",
151
+ "id": "src/components/connect-gx-server/connect-gx-server.tsx::GXServerConnectionData"
152
+ }
153
+ }
154
+ },
155
+ "required": false,
156
+ "optional": true,
157
+ "docs": {
158
+ "tags": [],
159
+ "text": "Initial user values for the case in which the user returns to the login modal after a successful authentication."
160
+ }
161
+ },
162
+ "enableUserLogged": {
163
+ "type": "boolean",
164
+ "mutable": false,
165
+ "complexType": {
166
+ "original": "boolean",
167
+ "resolved": "boolean",
168
+ "references": {}
169
+ },
170
+ "required": false,
171
+ "optional": false,
172
+ "docs": {
173
+ "tags": [],
174
+ "text": "If 'true', shows the enabled and checked 'Continue with GX Account' checkbox. If 'false', shows the checkbox unchecked and disabled, and displays the options to enter username and password directly. Even if 'true', allow the user to deselect the checkbox and enter username and password."
175
+ },
176
+ "attribute": "enable-user-logged",
177
+ "reflect": false,
178
+ "defaultValue": "false"
179
+ },
180
+ "connectCallback": {
181
+ "type": "unknown",
182
+ "mutable": false,
183
+ "complexType": {
184
+ "original": "(\n data: GXServerConnectionData\n ) => Promise<ConnectionResultData>",
185
+ "resolved": "(data: GXServerConnectionData) => Promise<ConnectionResultData>",
186
+ "references": {
187
+ "GXServerConnectionData": {
188
+ "location": "local",
189
+ "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/connect-gx-server/connect-gx-server.tsx",
190
+ "id": "src/components/connect-gx-server/connect-gx-server.tsx::GXServerConnectionData"
191
+ },
192
+ "Promise": {
193
+ "location": "global",
194
+ "id": "global::Promise"
195
+ },
196
+ "ConnectionResultData": {
197
+ "location": "import",
198
+ "path": "../../common/types",
199
+ "id": "src/common/types.ts::ConnectionResultData"
200
+ }
201
+ }
202
+ },
203
+ "required": false,
204
+ "optional": false,
205
+ "docs": {
206
+ "tags": [],
207
+ "text": "If 'true', shows the enabled and checked 'Continue with GX Account' checkbox. If 'false', shows the checkbox unchecked and disabled, and displays the options to enter username and password directly. Even if 'true', allow the user to deselect the checkbox and enter username and password."
208
+ }
209
+ },
210
+ "cancelCallback": {
211
+ "type": "unknown",
212
+ "mutable": false,
213
+ "complexType": {
214
+ "original": "() => Promise<void>",
215
+ "resolved": "() => Promise<void>",
216
+ "references": {
217
+ "Promise": {
218
+ "location": "global",
219
+ "id": "global::Promise"
220
+ }
221
+ }
222
+ },
223
+ "required": false,
224
+ "optional": false,
225
+ "docs": {
226
+ "tags": [],
227
+ "text": "Callback that allows canceling the server connection process."
228
+ }
229
+ }
230
+ };
231
+ }
232
+ static get states() {
233
+ return {
234
+ "displayLoginControls": {}
235
+ };
236
+ }
237
+ static get events() {
238
+ return [{
239
+ "method": "componentDidRenderFirstTime",
240
+ "name": "componentDidRenderFirstTime",
241
+ "bubbles": true,
242
+ "cancelable": true,
243
+ "composed": true,
244
+ "docs": {
245
+ "tags": [{
246
+ "name": "description",
247
+ "text": "Gets fired when the component has rendered for the first time."
248
+ }],
249
+ "text": ""
250
+ },
251
+ "complexType": {
252
+ "original": "string",
253
+ "resolved": "string",
254
+ "references": {}
255
+ }
256
+ }];
257
+ }
258
+ static get elementRef() { return "el"; }
259
+ }
260
+ //# sourceMappingURL=connect-gx-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect-gx-server.js","sourceRoot":"","sources":["../../../src/components/connect-gx-server/connect-gx-server.tsx"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,OAAO,EACP,KAAK,EAEL,KAAK,EACN,MAAM,eAAe,CAAC;AACvB,6BAA6B;AAC7B,oBAAoB;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AASpE,MAAM,OAAO,oBAAoB;;QAOvB,sBAAiB,GAAG,KAAK,CAAC;QA8ElC,iBAAiB;QAEjB,0BAA0B;QAE1B,qBAAqB;QAEb,qBAAgB,GAAG,GAAiC,EAAE;;YAC5D,IAAI,MAAA,IAAI,CAAC,UAAU,0CAAE,MAAM,EAAE;gBAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;oBACrC,OAAO,8BAAqB,SAAS,CAAsB,CAAC;gBAC9D,CAAC,CAAC,CAAC;aACJ;YACD,OAAO,EAAE,CAAC;QAC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n Element,\n Event,\n EventEmitter,\n State\n} from \"@stencil/core\";\n/* OTHER LIBRARIES IMPORTS */\n/* CUSTOM IMPORTS */\nimport { config } from \"../../common/config\";\nimport { Locale } from \"../../common/locale\";\nimport { formSubmitValidation } from \"../../common/form-validation\";\nimport { ConnectionResultData } from \"../../common/types\";\n\n@Component({\n tag: \"gx-ide-connect-gx-server\",\n styleUrl: \"connect-gx-server.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/connect-gx-server\"]\n})\nexport class GxIdeConnectGxServer {\n // 1.OWN PROPERTIES //\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: HTMLGxIdeConnectGxServerElement;\n\n private serverURLEl!: HTMLGxgComboBoxElement;\n private userNameEl!: HTMLGxgFormTextElement;\n private passwordEl!: HTMLGxgFormTextElement;\n private continueWithGeneXusAccountEl!: HTMLGxgFormCheckboxElement;\n\n // 3.STATE() VARIABLES //\n\n //\n @State() displayLoginControls: boolean = false;\n\n // 4.PUBLIC PROPERTY API | WATCH'S //\n\n /**\n * If true it displays the component title on the header\n */\n @Prop() readonly displayTitle = false;\n\n /**\n * Array of cataloged server URLs\n */\n @Prop() readonly serverUrls: string[];\n\n /**\n * 'true' if the user should be allowed to manually enter a server URL in serverUrls.\n */\n @Prop() readonly enableCustomServer: boolean = false;\n\n /**\n * Initial user values for the case in which the user returns to the login modal after a successful authentication.\n */\n @Prop() readonly defaultConnectionData?: GXServerConnectionData;\n\n /**\n * If 'true', shows the enabled and checked 'Continue with GX Account' checkbox. If 'false', shows the checkbox unchecked and disabled, and displays the options to enter username and password directly. Even if 'true', allow the user to deselect the checkbox and enter username and password.\n */\n @Prop() readonly enableUserLogged: boolean = false;\n\n /**\n * If 'true', shows the enabled and checked 'Continue with GX Account' checkbox. If 'false', shows the checkbox unchecked and disabled, and displays the options to enter username and password directly. Even if 'true', allow the user to deselect the checkbox and enter username and password.\n */\n @Prop() readonly connectCallback: (\n data: GXServerConnectionData\n ) => Promise<ConnectionResultData>;\n\n /**\n * Callback that allows canceling the server connection process.\n */\n @Prop() readonly cancelCallback: () => Promise<void>;\n\n // 5.EVENTS (EMIT) //\n\n /**\n * @description Gets fired when the component has rendered for the first time.\n */\n @Event() componentDidRenderFirstTime: EventEmitter<string>;\n\n // 6.COMPONENT LIFECYCLE METHODS //\n\n async componentWillLoad() {\n this._componentLocale = await Locale.getComponentStrings(this.el);\n this.evaluateDisplayLoginControls();\n }\n\n componentDidRender() {\n if (!this.renderedFirstTime) {\n this.componentDidRenderFirstTime.emit(\n this._componentLocale.componentName\n );\n this.renderedFirstTime = true;\n }\n }\n\n // 7.LISTENERS //\n\n // 8.PUBLIC METHODS API //\n\n // 9.LOCAL METHODS //\n\n private renderServerUrls = (): HTMLGxgComboBoxItemElement[] => {\n if (this.serverUrls?.length) {\n return this.serverUrls.map(serverUrl => {\n return <gxg-combo-box-item>{serverUrl}</gxg-combo-box-item>;\n });\n }\n return [];\n };\n\n private continueWithGxServerHandler = (\n event: CustomEvent<{ id: string; value: boolean; disabled?: boolean }>\n ) => {\n this.displayLoginControls = !event.detail.value;\n };\n\n private evaluateDisplayLoginControls = () => {\n if (this.enableUserLogged) {\n this.displayLoginControls = false;\n } else {\n this.displayLoginControls = true;\n }\n };\n\n private connectHandler = () => {\n if (this.connectCallback) {\n this.connectCallback({\n serverUrl: this.serverURLEl.value,\n continueWithGeneXusAccount: this.continueWithGeneXusAccountEl.checked,\n user: this.userNameEl.value,\n password: this.passwordEl.value\n }).then((formSubmitResult: ConnectionResultData) => {\n console.log(formSubmitResult);\n formSubmitValidation(formSubmitResult, this);\n });\n }\n };\n\n // 10.RENDER() FUNCTION //\n\n render() {\n return (\n <Host class=\"gx-ide-component\">\n <div class=\"gx-ide-main-wrapper\">\n <gx-ide-container\n containerTitle={\n this.displayTitle ? this._componentLocale.componentName : null\n }\n slimmerFooter={config.gxIdeContainer.slimmerFooter}\n >\n <div class=\"wrapper\">\n {/* server url */}\n <gxg-combo-box\n label={this._componentLocale.main.serverUrl}\n disableFilter={!this.enableCustomServer}\n value={this.defaultConnectionData?.serverUrl}\n ref={el => (this.serverURLEl = el as HTMLGxgComboBoxElement)}\n toolTip={config.tooltip}\n >\n {this.renderServerUrls()}\n </gxg-combo-box>\n\n {/* continue with GeneXus account */}\n <gxg-form-checkbox\n label={this._componentLocale.main.continueWithGxAccount}\n onChange={this.continueWithGxServerHandler}\n checked={\n this.defaultConnectionData\n ? this.defaultConnectionData.continueWithGeneXusAccount\n : this.enableUserLogged\n }\n disabled={!this.enableUserLogged}\n ref={el =>\n (this.continueWithGeneXusAccountEl =\n el as HTMLGxgFormCheckboxElement)\n }\n ></gxg-form-checkbox>\n\n {this.displayLoginControls ? (\n <div class=\"user-details-container\">\n {/* username */}\n <gxg-form-text\n label={this._componentLocale.main.userName}\n labelPosition=\"above\"\n disabled={!this.displayLoginControls}\n value={this.defaultConnectionData.user}\n ref={el => (this.userNameEl = el as HTMLGxgFormTextElement)}\n toolTip={config.tooltip}\n ></gxg-form-text>\n {/* password */}\n <gxg-form-text\n label={this._componentLocale.main.password}\n labelPosition=\"above\"\n disabled={!this.displayLoginControls}\n value={this.defaultConnectionData.password}\n ref={el => (this.passwordEl = el as HTMLGxgFormTextElement)}\n password\n toolTip={config.tooltip}\n ></gxg-form-text>\n </div>\n ) : null}\n </div>\n\n {/* cancel and connect buttons */}\n <gxg-button slot=\"footer-end\" type=\"outlined\">\n {this._componentLocale.main.cancel}\n </gxg-button>\n <gxg-button slot=\"footer-end\" onClick={this.connectHandler}>\n {this._componentLocale.main.connect}\n </gxg-button>\n </gx-ide-container>\n </div>\n </Host>\n );\n }\n}\n\nexport type GXServerConnectionData = {\n serverUrl: string;\n continueWithGeneXusAccount: boolean;\n user: string;\n password: string;\n};\n"]}
@@ -0,0 +1,17 @@
1
+ {
2
+ "componentName": "Connect to GeneXus Server",
3
+ "header": {},
4
+ "main": {
5
+ "serverUrl": "Server URL",
6
+ "continueWithGxAccount": "Continue with GeneXus Account",
7
+ "userName": "Username",
8
+ "password": "Password",
9
+ "cancel": "Cancel",
10
+ "connect": "Connect"
11
+ },
12
+ "footer": {},
13
+ "loader": {
14
+ "title": "Loading...",
15
+ "cancelLabel": "Cancel"
16
+ }
17
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "presentation": "「こんにちは、私の名前は {0} です。オレゴンに住んでいます。」"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "presentation": "你好,我的名字是 {0},我住在俄勒冈州。"
3
+ }
@@ -6,6 +6,7 @@ const formSubmitValidation = (result, ref) => {
6
6
  const hasError = element.hasError;
7
7
  const reference = ref[`${key}El`];
8
8
  if (reference && hasError && message.trim()) {
9
+ console.log("hasError");
9
10
  reference.validationStatus = "error";
10
11
  reference.validationMessage = message;
11
12
  }
@@ -1 +1 @@
1
- {"file":"form-validation.js","mappings":"MAGa,oBAAoB,GAAG,CAAC,MAAwB,EAAE,GAAQ;;IACrE,MAAA,MAAM,CAAC,WAAW,0CAAE,OAAO,CAAC,OAAO;QACjC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACxB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAClC,MAAM,SAAS,GAAkB,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;QACjD,IAAI,SAAS,IAAI,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE;YAC3C,SAAS,CAAC,gBAAgB,GAAG,OAAO,CAAC;YACrC,SAAS,CAAC,iBAAiB,GAAG,OAAO,CAAC;SACvC;aAAM,IAAI,SAAS,IAAI,CAAC,QAAQ,EAAE;YACjC,SAAS,CAAC,gBAAgB,GAAG,eAAe,CAAC;YAC7C,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC;SACpC;KACF,CAAC,CAAC;AACL;;;;","names":[],"sources":["src/common/form-validation.ts"],"sourcesContent":["import { FormSubmitResult } from \"../common/types\";\nimport { FormComponent } from \"@genexus/gemini/dist/types/common/interfaces\";\n\nexport const formSubmitValidation = (result: FormSubmitResult, ref: any) => {\n result.fieldErrors?.forEach(element => {\n const key = element.key;\n const message = element.message;\n const hasError = element.hasError;\n const reference: FormComponent = ref[`${key}El`];\n if (reference && hasError && message.trim()) {\n reference.validationStatus = \"error\";\n reference.validationMessage = message;\n } else if (reference && !hasError) {\n reference.validationStatus = \"indeterminate\";\n reference.validationMessage = null;\n }\n });\n};\n"],"version":3}
1
+ {"file":"form-validation.js","mappings":"MAGa,oBAAoB,GAAG,CAClC,MAA+C,EAC/C,GAAQ;;IAER,MAAA,MAAM,CAAC,WAAW,0CAAE,OAAO,CAAC,OAAO;QACjC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACxB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAElC,MAAM,SAAS,GAAkB,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;QACjD,IAAI,SAAS,IAAI,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE;YAC3C,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACxB,SAAS,CAAC,gBAAgB,GAAG,OAAO,CAAC;YACrC,SAAS,CAAC,iBAAiB,GAAG,OAAO,CAAC;SACvC;aAAM,IAAI,SAAS,IAAI,CAAC,QAAQ,EAAE;YACjC,SAAS,CAAC,gBAAgB,GAAG,eAAe,CAAC;YAC7C,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC;SACpC;KACF,CAAC,CAAC;AACL;;;;","names":[],"sources":["src/common/form-validation.ts"],"sourcesContent":["import { FormSubmitResult, ConnectionResultData } from \"../common/types\";\nimport { FormComponent } from \"@genexus/gemini/dist/types/common/interfaces\";\n\nexport const formSubmitValidation = (\n result: FormSubmitResult | ConnectionResultData,\n ref: any\n) => {\n result.fieldErrors?.forEach(element => {\n const key = element.key;\n const message = element.message;\n const hasError = element.hasError;\n\n const reference: FormComponent = ref[`${key}El`];\n if (reference && hasError && message.trim()) {\n console.log(\"hasError\");\n reference.validationStatus = \"error\";\n reference.validationMessage = message;\n } else if (reference && !hasError) {\n reference.validationStatus = \"indeterminate\";\n reference.validationMessage = null;\n }\n });\n};\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface GxIdeConnectGxServer extends Components.GxIdeConnectGxServer, HTMLElement {}
4
+ export const GxIdeConnectGxServer: {
5
+ prototype: GxIdeConnectGxServer;
6
+ new (): GxIdeConnectGxServer;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,183 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { c as config } from './config.js';
3
+ import { L as Locale } from './locale.js';
4
+ import { f as formSubmitValidation } from './form-validation.js';
5
+ import { d as defineCustomElement$d } from './icon.js';
6
+ import { d as defineCustomElement$c } from './container.js';
7
+ import { d as defineCustomElement$b } from './title2.js';
8
+ import { d as defineCustomElement$a } from './button.js';
9
+ import { d as defineCustomElement$9 } from './combo-box.js';
10
+ import { d as defineCustomElement$8 } from './combo-box-item.js';
11
+ import { d as defineCustomElement$7 } from './form-checkbox.js';
12
+ import { d as defineCustomElement$6 } from './form-text.js';
13
+ import { d as defineCustomElement$5 } from './icon2.js';
14
+ import { d as defineCustomElement$4 } from './gxg-label2.js';
15
+ import { d as defineCustomElement$3 } from './title.js';
16
+ import { d as defineCustomElement$2 } from './tooltip.js';
17
+
18
+ const connectGxServerCss = ":root{--ui-animaton-speed:0.2s}.gxg-title-01{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-01-font-weight);font-size:var(--ds-title-01-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-01--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-01-font-weight);font-size:var(--ds-title-01-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-title-02{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-02-font-weight);font-size:var(--ds-title-02-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-02--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-02-font-weight);font-size:var(--ds-title-02-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable);color:var(--color-on-primary)}.gxg-title-03{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-03-font-weight);font-size:var(--ds-title-03-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-03--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-03-font-weight);font-size:var(--ds-title-03-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-title-04{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-04-font-weight);font-size:var(--ds-title-04-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-04--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-04-font-weight);font-size:var(--ds-title-04-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-title-05{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-05-font-weight);font-size:var(--ds-title-05-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-05--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-05-font-weight);font-size:var(--ds-title-05-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-text{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable)}.gxg-text--negative{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-text--gray{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--dimmed)}.gxg-quote{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);font-style:italic}.gxg-quote--negative{color:var(--ds-base-font-color--negative)}.gxg-link{line-height:unset;font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--link);text-decoration:underline;cursor:pointer;display:inline-block}.gxg-link:hover{color:var(--ds-base-font-color--link-hover)}.gxg-link:active{color:var(--ds-base-font-color--link-active)}.gxg-link-gray{line-height:unset;font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--link);text-decoration:underline;cursor:pointer;display:inline-block;color:var(--ds-base-font-color--dimmed)}.gxg-link-gray:hover{line-height:unset;font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--link);text-decoration:underline;cursor:pointer;display:inline-block;color:var(--ds-base-font-color--dimmed);filter:brightness(1.4)}.gxg-alert-error{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--error);display:inline-block}.gxg-alert-warning{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--warning);display:inline-block}.gxg-alert-success{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--success);display:inline-block}.gxg-tab--disabled{color:var(--color-primary-disabled);pointer-events:none}.gxg-tab--disabled[disabled]{color:var(--color-primary-disabled);pointer-events:none}.gxg-label{font-family:var(--ds-base-font-family-primary);font-weight:var(--gxg-label-font-weight);font-size:var(--gxg-label-font-size);color:var(--gxg-label-color);text-align:center;line-height:1.455em;display:flex;align-items:center}.gxg-label:hover{color:var(--color-primary-hover)}.gxg-label:focus{color:var(--color-primary-active)}.gxg-label:active{color:var(--color-primary-active)}.gxg-label[disabled]{color:var(--color-primary-disabled)}.gxg-label--negative{color:var(--color-on-primary)}.gxg-label--negative[disabled]{color:var(--color-on-disabled)}.gxg-scrollbar{}.gxg-scrollbar::-webkit-scrollbar{width:var(--gxg-scrollbar-width);height:var(--gxg-scrollbar-width)}.gxg-scrollbar::-webkit-scrollbar-track{background-color:var(--gxg-scrollbar-track-background);border-radius:var(--gxg-scrollbar-track-border-radius)}.gxg-scrollbar::-webkit-scrollbar-thumb{background-color:var(--gxg-scrollbar-track-thumb-background);border-radius:var(--gxg-scrollbar-track-thumb-radius)}.gxg-scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--gxg-scrollbar-track-thumb-hover-background)}.gxg-scrollbar::-webkit-scrollbar-corner{background:rgba(0, 0, 0, 0)}.gxi-hidden{display:none !important}.gxi-full-height{height:100%}.gxi-overflow-auto{overflow:auto}.gxi-display-flex{display:flex}.align-start{display:flex;align-items:start}.align-center{display:flex;align-items:center}.align-end{display:flex;align-items:end}.overflow-auto{overflow:auto}.justify-start{display:flex;justify-content:start}.justify-center{display:flex;justify-content:center}.justify-end{display:flex;justify-content:end}.grid{display:grid;grid-row-gap:var(--gx-ide-grid-row-gap);grid-column-gap:var(--gx-ide-grid-column-gap);grid-template-rows:auto}ch-grid-cell{display:flex}ch-grid{overflow:auto;height:100%}ch-grid-column{z-index:99;border-bottom:1px solid var(--mer-color__neutral-gray--800)}ch-grid-column:first-child{padding-inline-start:var(--gx-ide-container__padding) !important}ch-grid-column:last-child{padding-inline-end:var(--gx-ide-container__padding) !important}ch-grid-cell{--mer-spacing--xs:var(--gx-ide-container__padding)}.layout{display:grid;gap:var(--mer-spacing--lg);box-sizing:border-box}.layout--two-cols{grid-template-columns:1fr 1fr}.layout--space-above{padding-block-start:var(--mer-spacing--lg)}gxg-tabs{box-shadow:none}:host(.gx-ide-component){height:100% !important;display:flex !important;flex-direction:column !important}:host(:focus-within) gx-ide-top-bar::part(wrapper){background-color:var(--color-secondary-enabled)}.gx-ide-main-wrapper{color:var(--gx-ide-component-text-color);font-weight:var(--mer-font__weight--regular);font-size:var(--mer-font__size--xs);font-family:var(--mer-font-family--primary);height:100%;background-color:var(--gx-ide-component-background-color);display:flex;flex-direction:column;flex-grow:1;box-sizing:border-box}.gx-ide-main{flex-grow:1;overflow-y:auto;}.gx-ide-main::-webkit-scrollbar{width:var(--gxg-scrollbar-width);height:var(--gxg-scrollbar-width)}.gx-ide-main::-webkit-scrollbar-track{background-color:var(--gxg-scrollbar-track-background);border-radius:var(--gxg-scrollbar-track-border-radius)}.gx-ide-main::-webkit-scrollbar-thumb{background-color:var(--gxg-scrollbar-track-thumb-background);border-radius:var(--gxg-scrollbar-track-thumb-radius)}.gx-ide-main::-webkit-scrollbar-thumb:hover{background-color:var(--gxg-scrollbar-track-thumb-hover-background)}.gx-ide-main::-webkit-scrollbar-corner{background:rgba(0, 0, 0, 0)}.gx-ide-overflow{overflow-y:auto;}.gx-ide-overflow::-webkit-scrollbar{width:var(--gxg-scrollbar-width);height:var(--gxg-scrollbar-width)}.gx-ide-overflow::-webkit-scrollbar-track{background-color:var(--gxg-scrollbar-track-background);border-radius:var(--gxg-scrollbar-track-border-radius)}.gx-ide-overflow::-webkit-scrollbar-thumb{background-color:var(--gxg-scrollbar-track-thumb-background);border-radius:var(--gxg-scrollbar-track-thumb-radius)}.gx-ide-overflow::-webkit-scrollbar-thumb:hover{background-color:var(--gxg-scrollbar-track-thumb-hover-background)}.gx-ide-overflow::-webkit-scrollbar-corner{background:rgba(0, 0, 0, 0)}.tree-container{display:flex;height:100%;width:100%;box-sizing:border-box}p{margin:0}:host{display:block}.user-details-container{display:flex;gap:var(--gx-ide-form-items-gap)}.wrapper{display:flex;flex-direction:column;gap:var(--mer-spacing--md)}";
19
+
20
+ const GxIdeConnectGxServer$1 = /*@__PURE__*/ proxyCustomElement(class GxIdeConnectGxServer extends HTMLElement {
21
+ constructor() {
22
+ super();
23
+ this.__registerHost();
24
+ this.__attachShadow();
25
+ this.componentDidRenderFirstTime = createEvent(this, "componentDidRenderFirstTime", 7);
26
+ this.renderedFirstTime = false;
27
+ // 7.LISTENERS //
28
+ // 8.PUBLIC METHODS API //
29
+ // 9.LOCAL METHODS //
30
+ this.renderServerUrls = () => {
31
+ var _a;
32
+ if ((_a = this.serverUrls) === null || _a === void 0 ? void 0 : _a.length) {
33
+ return this.serverUrls.map(serverUrl => {
34
+ return h("gxg-combo-box-item", null, serverUrl);
35
+ });
36
+ }
37
+ return [];
38
+ };
39
+ this.continueWithGxServerHandler = (event) => {
40
+ this.displayLoginControls = !event.detail.value;
41
+ };
42
+ this.evaluateDisplayLoginControls = () => {
43
+ if (this.enableUserLogged) {
44
+ this.displayLoginControls = false;
45
+ }
46
+ else {
47
+ this.displayLoginControls = true;
48
+ }
49
+ };
50
+ this.connectHandler = () => {
51
+ if (this.connectCallback) {
52
+ this.connectCallback({
53
+ serverUrl: this.serverURLEl.value,
54
+ continueWithGeneXusAccount: this.continueWithGeneXusAccountEl.checked,
55
+ user: this.userNameEl.value,
56
+ password: this.passwordEl.value
57
+ }).then((formSubmitResult) => {
58
+ console.log(formSubmitResult);
59
+ formSubmitValidation(formSubmitResult, this);
60
+ });
61
+ }
62
+ };
63
+ this.displayLoginControls = false;
64
+ this.displayTitle = false;
65
+ this.serverUrls = undefined;
66
+ this.enableCustomServer = false;
67
+ this.defaultConnectionData = undefined;
68
+ this.enableUserLogged = false;
69
+ this.connectCallback = undefined;
70
+ this.cancelCallback = undefined;
71
+ }
72
+ // 6.COMPONENT LIFECYCLE METHODS //
73
+ async componentWillLoad() {
74
+ this._componentLocale = await Locale.getComponentStrings(this.el);
75
+ this.evaluateDisplayLoginControls();
76
+ }
77
+ componentDidRender() {
78
+ if (!this.renderedFirstTime) {
79
+ this.componentDidRenderFirstTime.emit(this._componentLocale.componentName);
80
+ this.renderedFirstTime = true;
81
+ }
82
+ }
83
+ // 10.RENDER() FUNCTION //
84
+ render() {
85
+ var _a;
86
+ return (h(Host, { class: "gx-ide-component" }, h("div", { class: "gx-ide-main-wrapper" }, h("gx-ide-container", { containerTitle: this.displayTitle ? this._componentLocale.componentName : null, slimmerFooter: config.gxIdeContainer.slimmerFooter }, h("div", { class: "wrapper" }, h("gxg-combo-box", { label: this._componentLocale.main.serverUrl, disableFilter: !this.enableCustomServer, value: (_a = this.defaultConnectionData) === null || _a === void 0 ? void 0 : _a.serverUrl, ref: el => (this.serverURLEl = el), toolTip: config.tooltip }, this.renderServerUrls()), h("gxg-form-checkbox", { label: this._componentLocale.main.continueWithGxAccount, onChange: this.continueWithGxServerHandler, checked: this.defaultConnectionData
87
+ ? this.defaultConnectionData.continueWithGeneXusAccount
88
+ : this.enableUserLogged, disabled: !this.enableUserLogged, ref: el => (this.continueWithGeneXusAccountEl =
89
+ el) }), this.displayLoginControls ? (h("div", { class: "user-details-container" }, h("gxg-form-text", { label: this._componentLocale.main.userName, labelPosition: "above", disabled: !this.displayLoginControls, value: this.defaultConnectionData.user, ref: el => (this.userNameEl = el), toolTip: config.tooltip }), h("gxg-form-text", { label: this._componentLocale.main.password, labelPosition: "above", disabled: !this.displayLoginControls, value: this.defaultConnectionData.password, ref: el => (this.passwordEl = el), password: true, toolTip: config.tooltip }))) : null), h("gxg-button", { slot: "footer-end", type: "outlined" }, this._componentLocale.main.cancel), h("gxg-button", { slot: "footer-end", onClick: this.connectHandler }, this._componentLocale.main.connect)))));
90
+ }
91
+ static get assetsDirs() { return ["gx-ide-assets/connect-gx-server"]; }
92
+ get el() { return this; }
93
+ static get style() { return connectGxServerCss; }
94
+ }, [1, "gx-ide-connect-gx-server", {
95
+ "displayTitle": [4, "display-title"],
96
+ "serverUrls": [16],
97
+ "enableCustomServer": [4, "enable-custom-server"],
98
+ "defaultConnectionData": [16],
99
+ "enableUserLogged": [4, "enable-user-logged"],
100
+ "connectCallback": [16],
101
+ "cancelCallback": [16],
102
+ "displayLoginControls": [32]
103
+ }]);
104
+ function defineCustomElement$1() {
105
+ if (typeof customElements === "undefined") {
106
+ return;
107
+ }
108
+ const components = ["gx-ide-connect-gx-server", "ch-icon", "gx-ide-container", "gx-ide-title", "gxg-button", "gxg-combo-box", "gxg-combo-box-item", "gxg-form-checkbox", "gxg-form-text", "gxg-icon", "gxg-label", "gxg-title", "gxg-tooltip"];
109
+ components.forEach(tagName => { switch (tagName) {
110
+ case "gx-ide-connect-gx-server":
111
+ if (!customElements.get(tagName)) {
112
+ customElements.define(tagName, GxIdeConnectGxServer$1);
113
+ }
114
+ break;
115
+ case "ch-icon":
116
+ if (!customElements.get(tagName)) {
117
+ defineCustomElement$d();
118
+ }
119
+ break;
120
+ case "gx-ide-container":
121
+ if (!customElements.get(tagName)) {
122
+ defineCustomElement$c();
123
+ }
124
+ break;
125
+ case "gx-ide-title":
126
+ if (!customElements.get(tagName)) {
127
+ defineCustomElement$b();
128
+ }
129
+ break;
130
+ case "gxg-button":
131
+ if (!customElements.get(tagName)) {
132
+ defineCustomElement$a();
133
+ }
134
+ break;
135
+ case "gxg-combo-box":
136
+ if (!customElements.get(tagName)) {
137
+ defineCustomElement$9();
138
+ }
139
+ break;
140
+ case "gxg-combo-box-item":
141
+ if (!customElements.get(tagName)) {
142
+ defineCustomElement$8();
143
+ }
144
+ break;
145
+ case "gxg-form-checkbox":
146
+ if (!customElements.get(tagName)) {
147
+ defineCustomElement$7();
148
+ }
149
+ break;
150
+ case "gxg-form-text":
151
+ if (!customElements.get(tagName)) {
152
+ defineCustomElement$6();
153
+ }
154
+ break;
155
+ case "gxg-icon":
156
+ if (!customElements.get(tagName)) {
157
+ defineCustomElement$5();
158
+ }
159
+ break;
160
+ case "gxg-label":
161
+ if (!customElements.get(tagName)) {
162
+ defineCustomElement$4();
163
+ }
164
+ break;
165
+ case "gxg-title":
166
+ if (!customElements.get(tagName)) {
167
+ defineCustomElement$3();
168
+ }
169
+ break;
170
+ case "gxg-tooltip":
171
+ if (!customElements.get(tagName)) {
172
+ defineCustomElement$2();
173
+ }
174
+ break;
175
+ } });
176
+ }
177
+
178
+ const GxIdeConnectGxServer = GxIdeConnectGxServer$1;
179
+ const defineCustomElement = defineCustomElement$1;
180
+
181
+ export { GxIdeConnectGxServer, defineCustomElement };
182
+
183
+ //# sourceMappingURL=gx-ide-connect-gx-server.js.map
@@ -0,0 +1 @@
1
+ {"file":"gx-ide-connect-gx-server.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,kBAAkB,GAAG,0gWAA0gW;;MCwBxhWA,sBAAoB;;;;;;QAOvB,sBAAiB,GAAG,KAAK,CAAC;;;;QAoF1B,qBAAgB,GAAG;;YACzB,IAAI,MAAA,IAAI,CAAC,UAAU,0CAAE,MAAM,EAAE;gBAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS;oBAClC,OAAO,8BAAqB,SAAS,CAAsB,CAAC;iBAC7D,CAAC,CAAC;aACJ;YACD,OAAO,EAAE,CAAC;SACX,CAAC;QAEM,gCAA2B,GAAG,CACpC,KAAsE;YAEtE,IAAI,CAAC,oBAAoB,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;SACjD,CAAC;QAEM,iCAA4B,GAAG;YACrC,IAAI,IAAI,CAAC,gBAAgB,EAAE;gBACzB,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;aACnC;iBAAM;gBACL,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;aAClC;SACF,CAAC;QAEM,mBAAc,GAAG;YACvB,IAAI,IAAI,CAAC,eAAe,EAAE;gBACxB,IAAI,CAAC,eAAe,CAAC;oBACnB,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK;oBACjC,0BAA0B,EAAE,IAAI,CAAC,4BAA4B,CAAC,OAAO;oBACrE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK;oBAC3B,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK;iBAChC,CAAC,CAAC,IAAI,CAAC,CAAC,gBAAsC;oBAC7C,OA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["GxIdeConnectGxServer"],"sources":["src/components/connect-gx-server/connect-gx-server.scss?tag=gx-ide-connect-gx-server&encapsulation=shadow","src/components/connect-gx-server/connect-gx-server.tsx"],"sourcesContent":["@import \"../../global/gx-ide-common.scss\";\n@import \"../../global/gx-ide-mixins.scss\";\n\n:host {\n display: block;\n}\n\n.user-details-container {\n display: flex;\n gap: var(--gx-ide-form-items-gap);\n}\n\n.wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--md);\n}\n","/* STENCIL IMPORTS */\nimport {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n State\n} from \"@stencil/core\";\n/* OTHER LIBRARIES IMPORTS */\n/* CUSTOM IMPORTS */\nimport { config } from \"../../common/config\";\nimport { Locale } from \"../../common/locale\";\nimport { formSubmitValidation } from \"../../common/form-validation\";\nimport { ConnectionResultData } from \"../../common/types\";\n\n@Component({\n tag: \"gx-ide-connect-gx-server\",\n styleUrl: \"connect-gx-server.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/connect-gx-server\"]\n})\nexport class GxIdeConnectGxServer {\n // 1.OWN PROPERTIES //\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: HTMLGxIdeConnectGxServerElement;\n\n private serverURLEl!: HTMLGxgComboBoxElement;\n private userNameEl!: HTMLGxgFormTextElement;\n private passwordEl!: HTMLGxgFormTextElement;\n private continueWithGeneXusAccountEl!: HTMLGxgFormCheckboxElement;\n\n // 3.STATE() VARIABLES //\n\n //\n @State() displayLoginControls: boolean = false;\n\n // 4.PUBLIC PROPERTY API | WATCH'S //\n\n /**\n * If true it displays the component title on the header\n */\n @Prop() readonly displayTitle = false;\n\n /**\n * Array of cataloged server URLs\n */\n @Prop() readonly serverUrls: string[];\n\n /**\n * 'true' if the user should be allowed to manually enter a server URL in serverUrls.\n */\n @Prop() readonly enableCustomServer: boolean = false;\n\n /**\n * Initial user values for the case in which the user returns to the login modal after a successful authentication.\n */\n @Prop() readonly defaultConnectionData?: GXServerConnectionData;\n\n /**\n * If 'true', shows the enabled and checked 'Continue with GX Account' checkbox. If 'false', shows the checkbox unchecked and disabled, and displays the options to enter username and password directly. Even if 'true', allow the user to deselect the checkbox and enter username and password.\n */\n @Prop() readonly enableUserLogged: boolean = false;\n\n /**\n * If 'true', shows the enabled and checked 'Continue with GX Account' checkbox. If 'false', shows the checkbox unchecked and disabled, and displays the options to enter username and password directly. Even if 'true', allow the user to deselect the checkbox and enter username and password.\n */\n @Prop() readonly connectCallback: (\n data: GXServerConnectionData\n ) => Promise<ConnectionResultData>;\n\n /**\n * Callback that allows canceling the server connection process.\n */\n @Prop() readonly cancelCallback: () => Promise<void>;\n\n // 5.EVENTS (EMIT) //\n\n /**\n * @description Gets fired when the component has rendered for the first time.\n */\n @Event() componentDidRenderFirstTime: EventEmitter<string>;\n\n // 6.COMPONENT LIFECYCLE METHODS //\n\n async componentWillLoad() {\n this._componentLocale = await Locale.getComponentStrings(this.el);\n this.evaluateDisplayLoginControls();\n }\n\n componentDidRender() {\n if (!this.renderedFirstTime) {\n this.componentDidRenderFirstTime.emit(\n this._componentLocale.componentName\n );\n this.renderedFirstTime = true;\n }\n }\n\n // 7.LISTENERS //\n\n // 8.PUBLIC METHODS API //\n\n // 9.LOCAL METHODS //\n\n private renderServerUrls = (): HTMLGxgComboBoxItemElement[] => {\n if (this.serverUrls?.length) {\n return this.serverUrls.map(serverUrl => {\n return <gxg-combo-box-item>{serverUrl}</gxg-combo-box-item>;\n });\n }\n return [];\n };\n\n private continueWithGxServerHandler = (\n event: CustomEvent<{ id: string; value: boolean; disabled?: boolean }>\n ) => {\n this.displayLoginControls = !event.detail.value;\n };\n\n private evaluateDisplayLoginControls = () => {\n if (this.enableUserLogged) {\n this.displayLoginControls = false;\n } else {\n this.displayLoginControls = true;\n }\n };\n\n private connectHandler = () => {\n if (this.connectCallback) {\n this.connectCallback({\n serverUrl: this.serverURLEl.value,\n continueWithGeneXusAccount: this.continueWithGeneXusAccountEl.checked,\n user: this.userNameEl.value,\n password: this.passwordEl.value\n }).then((formSubmitResult: ConnectionResultData) => {\n console.log(formSubmitResult);\n formSubmitValidation(formSubmitResult, this);\n });\n }\n };\n\n // 10.RENDER() FUNCTION //\n\n render() {\n return (\n <Host class=\"gx-ide-component\">\n <div class=\"gx-ide-main-wrapper\">\n <gx-ide-container\n containerTitle={\n this.displayTitle ? this._componentLocale.componentName : null\n }\n slimmerFooter={config.gxIdeContainer.slimmerFooter}\n >\n <div class=\"wrapper\">\n {/* server url */}\n <gxg-combo-box\n label={this._componentLocale.main.serverUrl}\n disableFilter={!this.enableCustomServer}\n value={this.defaultConnectionData?.serverUrl}\n ref={el => (this.serverURLEl = el as HTMLGxgComboBoxElement)}\n toolTip={config.tooltip}\n >\n {this.renderServerUrls()}\n </gxg-combo-box>\n\n {/* continue with GeneXus account */}\n <gxg-form-checkbox\n label={this._componentLocale.main.continueWithGxAccount}\n onChange={this.continueWithGxServerHandler}\n checked={\n this.defaultConnectionData\n ? this.defaultConnectionData.continueWithGeneXusAccount\n : this.enableUserLogged\n }\n disabled={!this.enableUserLogged}\n ref={el =>\n (this.continueWithGeneXusAccountEl =\n el as HTMLGxgFormCheckboxElement)\n }\n ></gxg-form-checkbox>\n\n {this.displayLoginControls ? (\n <div class=\"user-details-container\">\n {/* username */}\n <gxg-form-text\n label={this._componentLocale.main.userName}\n labelPosition=\"above\"\n disabled={!this.displayLoginControls}\n value={this.defaultConnectionData.user}\n ref={el => (this.userNameEl = el as HTMLGxgFormTextElement)}\n toolTip={config.tooltip}\n ></gxg-form-text>\n {/* password */}\n <gxg-form-text\n label={this._componentLocale.main.password}\n labelPosition=\"above\"\n disabled={!this.displayLoginControls}\n value={this.defaultConnectionData.password}\n ref={el => (this.passwordEl = el as HTMLGxgFormTextElement)}\n password\n toolTip={config.tooltip}\n ></gxg-form-text>\n </div>\n ) : null}\n </div>\n\n {/* cancel and connect buttons */}\n <gxg-button slot=\"footer-end\" type=\"outlined\">\n {this._componentLocale.main.cancel}\n </gxg-button>\n <gxg-button slot=\"footer-end\" onClick={this.connectHandler}>\n {this._componentLocale.main.connect}\n </gxg-button>\n </gx-ide-container>\n </div>\n </Host>\n );\n }\n}\n\nexport type GXServerConnectionData = {\n serverUrl: string;\n continueWithGeneXusAccount: boolean;\n user: string;\n password: string;\n};\n"],"version":3}
@@ -6,6 +6,7 @@ const formSubmitValidation = (result, ref) => {
6
6
  const hasError = element.hasError;
7
7
  const reference = ref[`${key}El`];
8
8
  if (reference && hasError && message.trim()) {
9
+ console.log("hasError");
9
10
  reference.validationStatus = "error";
10
11
  reference.validationMessage = message;
11
12
  }
@@ -18,4 +19,4 @@ const formSubmitValidation = (result, ref) => {
18
19
 
19
20
  export { formSubmitValidation as f };
20
21
 
21
- //# sourceMappingURL=form-validation-39376dc8.js.map
22
+ //# sourceMappingURL=form-validation-9367af5a.js.map
@@ -0,0 +1 @@
1
+ {"file":"form-validation-9367af5a.js","mappings":"MAGa,oBAAoB,GAAG,CAClC,MAA+C,EAC/C,GAAQ;;IAER,MAAA,MAAM,CAAC,WAAW,0CAAE,OAAO,CAAC,OAAO;QACjC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACxB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAElC,MAAM,SAAS,GAAkB,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;QACjD,IAAI,SAAS,IAAI,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE;YAC3C,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACxB,SAAS,CAAC,gBAAgB,GAAG,OAAO,CAAC;YACrC,SAAS,CAAC,iBAAiB,GAAG,OAAO,CAAC;SACvC;aAAM,IAAI,SAAS,IAAI,CAAC,QAAQ,EAAE;YACjC,SAAS,CAAC,gBAAgB,GAAG,eAAe,CAAC;YAC7C,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC;SACpC;KACF,CAAC,CAAC;AACL;;;;","names":[],"sources":["src/common/form-validation.ts"],"sourcesContent":["import { FormSubmitResult, ConnectionResultData } from \"../common/types\";\nimport { FormComponent } from \"@genexus/gemini/dist/types/common/interfaces\";\n\nexport const formSubmitValidation = (\n result: FormSubmitResult | ConnectionResultData,\n ref: any\n) => {\n result.fieldErrors?.forEach(element => {\n const key = element.key;\n const message = element.message;\n const hasError = element.hasError;\n\n const reference: FormComponent = ref[`${key}El`];\n if (reference && hasError && message.trim()) {\n console.log(\"hasError\");\n reference.validationStatus = \"error\";\n reference.validationMessage = message;\n } else if (reference && !hasError) {\n reference.validationStatus = \"indeterminate\";\n reference.validationMessage = null;\n }\n });\n};\n"],"version":3}