@genexus/genexus-ide-ui 1.1.18 → 1.1.20
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-connect-gx-server.cjs.entry.js +8 -10
- package/dist/cjs/gx-ide-connect-gx-server.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-json-import.cjs.entry.js +31 -7
- package/dist/cjs/gx-ide-json-import.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/json-import/json-import.js +33 -9
- package/dist/collection/components/json-import/json-import.js.map +1 -1
- package/dist/collection/components/team-dev/connect-gx-server/connect-gx-server.js +8 -10
- package/dist/collection/components/team-dev/connect-gx-server/connect-gx-server.js.map +1 -1
- package/dist/components/gx-ide-connect-gx-server.js +8 -10
- package/dist/components/gx-ide-connect-gx-server.js.map +1 -1
- package/dist/components/gx-ide-json-import.js +32 -8
- package/dist/components/gx-ide-json-import.js.map +1 -1
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-connect-gx-server.entry.js +8 -10
- package/dist/esm/gx-ide-connect-gx-server.entry.js.map +1 -1
- package/dist/esm/gx-ide-json-import.entry.js +31 -7
- package/dist/esm/gx-ide-json-import.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
- package/dist/genexus-ide-ui/{p-2bfae98b.entry.js → p-8bb9242a.entry.js} +129 -106
- package/dist/genexus-ide-ui/p-8bb9242a.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-e502c2fd.entry.js → p-b822181c.entry.js} +21 -21
- package/dist/genexus-ide-ui/p-b822181c.entry.js.map +1 -0
- package/dist/types/components/json-import/json-import.d.ts +3 -1
- package/package.json +1 -1
- package/dist/genexus-ide-ui/p-2bfae98b.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-e502c2fd.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-import.js","sourceRoot":"","sources":["../../../src/components/json-import/json-import.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,KAAK,EACL,YAAY,EACZ,MAAM,EACN,CAAC,EACF,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAkB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,gBAAgB;IAChB,oBAAoB;IACpB,kBAAkB;IAClB,cAAc;IACd,kBAAkB;IAClB,eAAe;IACf,qBAAqB;CACtB,CAAC;AAEF,MAAM,SAAS,GAAG,WAAW,CAAC;IAC5B,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,WAAW,CAAC;IAC9B,QAAQ,EAAE,OAAO;IACjB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAQH,MAAM,OAAO,eAAe;;QAC1B,mDAAsB;QACtB,gCAAwB;YACtB,IAAI,EAAE,EAAE;YACR,WAAW,EAAE,EAAE;YACf,oBAAoB,EAAE,KAAK;YAC3B,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;SACT,EAAC;QACF,6CAA4C,EAAE,EAAC;QAC/C,wCAAgB,YAAY,CAAC,4CAA4C,CAAC,EAAC;QAG3E,8CAAoC;QACpC,iDAAuC;QACvC,iDAAmC;QACnC,qDAAsC;QACtC,wDAAuD;QACvD,0CAA4B;QAC5B,8CAA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CAAC,KAAK,oBAGxB,CACd,CACG;oBACN,mBACE,KAAK,EAAC,2DAA2D,EACjE,OAAO,EAAE,uBAAA,IAAI,wCAAiB,CAAC,IAAI,CAAC,aAAa,EACjD,YAAY,EAAC,MAAM,EACnB,GAAG,EAAE,CAAC,EAAyB,EAAE,EAAE,CACjC,CAAC,uBAAA,IAAI,+BAAe,EAA2B,MAAA,CAAC,GAErC,CACX;gBAEN,cAAQ,KAAK,EAAC,sFAAsF;oBAClG,WAAK,KAAK,EAAC,gBAAgB;wBACzB,cACE,KAAK,EAAC,kBAAkB,EACxB,EAAE,EAAC,eAAe,EAClB,OAAO,EAAE,IAAI,CAAC,cAAc,EAC5B,IAAI,EAAC,eAAe,IAEnB,uBAAA,IAAI,wCAAiB,CAAC,MAAM,CAAC,SAAS,CAChC;wBACT,cACE,KAAK,EAAC,gBAAgB,EACtB,EAAE,EAAC,WAAW,EACd,OAAO,EAAE,uBAAA,IAAI,sCAAe,EAC5B,IAAI,EAAC,WAAW,EAChB,QAAQ,EAAE,CAAC,IAAI,CAAC,WAAW,IAE1B,uBAAA,IAAI,wCAAiB,CAAC,MAAM,CAAC,KAAK,CAC5B,CACL,CACC,CACD,CACL,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n Prop,\n Element,\n State,\n getAssetPath,\n Method,\n h\n} from \"@stencil/core\";\n\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\nimport { config } from \"../../common/config\";\n\nimport { Locale } from \"../../common/locale\";\nimport { FormSubmitResult } from \"../../common/types\";\nimport { RadioGroupItemModel } from \"@genexus/chameleon-controls-library/dist/types/components/radio-group/types\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/tab\",\n \"components/tooltip\",\n \"utils/form--full\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\n\nconst FILE_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"file\",\n colorType: \"primary\"\n});\n\nconst MENU_DELETE = getIconPath({\n category: \"menus\",\n name: \"delete\",\n colorType: \"primary\"\n});\n\n@Component({\n tag: \"gx-ide-json-import\",\n styleUrl: \"json-import.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/json-import\"]\n})\nexport class GxIdeJsonImport {\n #componentLocale: any;\n #data: JsonImportData = {\n name: \"\",\n description: \"\",\n assumeVarcharForNull: false,\n parentId: \"\",\n json: \"\"\n };\n #radioOptionsModel: RadioGroupItemModel[] = [];\n #shortcutsSrc = getAssetPath(`./gx-ide-assets/json-import/shortcuts.json`);\n\n @Element() el: HTMLGxIdeJsonImportElement;\n #checkBoxEl!: HTMLChCheckboxElement;\n #chShortcutsEl: HTMLChShortcutsElement;\n #descriptionEl!: HTMLChEditElement;\n #fileInputHiddenEl!: HTMLInputElement;\n #moduleEntitySelector!: HTMLGxIdeEntitySelectorElement;\n #nameEl!: HTMLChEditElement;\n #radioGroup!: HTMLChRadioGroupRenderElement;\n\n @State() fileName: string;\n @State() radioGroupValue: string = \"file\";\n @State() showTooltipError: boolean = false;\n @State() isFormValid: boolean = false;\n @State() jsonContent: string = \"\";\n\n /**\n * Callback that must be invoked when the user want to cancel the operation\n */\n @Prop() readonly cancelCallback: () => Promise<void>;\n\n /**\n * Callback that must be invoked when the user confirms the creation of the SDT. It receives as parameters the data necessary to create the SDT.\n */\n @Prop() readonly confirmCallback!: (\n data: JsonImportData\n ) => Promise<FormSubmitResult>;\n\n /**\n * Default value for Module/Folder field\n */\n @Prop() readonly defaultParent: EntityData;\n\n /**\n * Default value for Module/Folder field\n */\n @Prop() readonly defaultRadioValue: string;\n\n /**\n * Actual value for Module/Folder field\n */\n @Prop() readonly parent: EntityData;\n\n /**\n * Callback invoked when the action is executed in the Module/Folder filter. It returns the information of the selected object (id and name) or 'undefined' if it was canceled.\n */\n @Prop() readonly selectModuleCallback: SelectModuleCallback;\n\n /**\n * Callback invoked when the input mode changes between file and text.\n */\n @Prop() readonly modeChangeCallback?: (\n mode: \"file\" | \"text\"\n ) => Promise<void>;\n\n /**\n * Callback invoked when a file is selected or removed.\n */\n @Prop() readonly fileChangeCallback?: (file: File | null) => Promise<void>;\n\n /**\n * Callback para validar el nombre del objeto. Debe retornar true si el nombre es válido, false en caso contrario.\n */\n @Prop() readonly validateNameCallback?: (name: string) => boolean;\n\n /**\n * Callback para validar el JSON. Debe retornar true si el JSON es válido, false en caso contrario.\n */\n @Prop() readonly validateJSONCallback?: (json: string) => boolean;\n\n /**\n * Callback invocado cuando el contenido del JSON cambia\n */\n @Prop() readonly onJsonContentChange?: (content: string) => void;\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n this.#radioOptionsModel = [\n {\n value: \"file\",\n caption: this.#componentLocale.header.filePathLabel\n },\n { value: \"text\", caption: this.#componentLocale.main.jsonAreaLabel }\n ];\n }\n\n /**\n * Suspends or reactivates the shortcuts\n */\n @Method()\n async suspendShortcuts(suspendShortcuts: boolean) {\n this.#chShortcutsEl.suspend = suspendShortcuts;\n }\n\n #validateForm = () => {\n const name = this.#nameEl?.value?.trim() || \"\";\n const json =\n this.radioGroupValue === \"file\" ? this.fileName : this.jsonContent;\n\n const isNameValid = this.validateNameCallback\n ? this.validateNameCallback(name)\n : Boolean(name);\n\n const isJsonValid =\n this.radioGroupValue === \"file\"\n ? Boolean(this.fileName)\n : this.validateJSONCallback\n ? this.validateJSONCallback(json)\n : false;\n\n this.isFormValid = isNameValid && isJsonValid;\n };\n\n #nameChangedHandler = () => {\n this.#validateForm();\n };\n\n #changeRadioHandler = () => {\n this.radioGroupValue = this.#radioGroup.value;\n if (this.radioGroupValue === \"file\") {\n this.#checkBoxEl.value = \"false\";\n } else {\n this.#data.json = null;\n this.#removeFileSelection();\n this.#validateForm();\n }\n this.modeChangeCallback?.(this.radioGroupValue as \"file\" | \"text\");\n };\n\n #createHandler = () => {\n this.#data.name = this.#nameEl.value;\n this.#data.description = this.#descriptionEl.value;\n this.#data.parentId = this.#moduleEntitySelector.value?.id;\n this.#data.assumeVarcharForNull = this.#checkBoxEl.value === \"true\";\n this.confirmCallback(this.#data).then(\n (formSubmitResult: FormSubmitResult) => {\n this.showTooltipError = !formSubmitResult.success;\n }\n );\n };\n\n #removeFileSelection = () => {\n this.#data.json = null;\n this.#fileInputHiddenEl.value = null;\n this.fileName = null;\n this.fileChangeCallback?.(null);\n this.#validateForm();\n };\n\n #selectFileInputChangedHandler = (event: InputEvent) => {\n const target = event.target as HTMLInputElement;\n if (target.files?.length > 0 && this.radioGroupValue === \"file\") {\n this.#data.json = target.files[0];\n this.fileName = target.files[0].name;\n this.fileChangeCallback?.(target.files[0]);\n this.#validateForm();\n }\n };\n\n #selectFileInputHandler = () => {\n this.#fileInputHiddenEl.click();\n };\n\n #handleEditorChange = () => {\n this.#validateForm();\n };\n\n #handleSlotChange = (e: Event) => {\n const elements = (e.target as HTMLSlotElement).assignedElements();\n if (elements.length > 0) {\n const element = elements[0];\n element.addEventListener(\"json-content-change\", ((event: CustomEvent) => {\n if (this.radioGroupValue === \"text\") {\n this.jsonContent = event.detail.content;\n this.#handleEditorChange();\n }\n }) as EventListener);\n }\n };\n\n render(): void {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <ch-shortcuts\n src={this.#shortcutsSrc}\n ref={(el: HTMLChShortcutsElement) =>\n (this.#chShortcutsEl = el as HTMLChShortcutsElement)\n }\n ></ch-shortcuts>\n <section class=\"section\">\n <header class=\"header field-group spacing-body control-header-with-border\">\n <div class=\"field-group field-group-name-description-module\">\n <label\n // name\n class=\"label name-label\"\n htmlFor=\"input-name\"\n >\n {this.#componentLocale.header.nameFieldLabel}\n </label>\n <ch-edit\n class=\"input name-input\"\n id=\"input-name\"\n ref={(el: HTMLChEditElement) =>\n (this.#nameEl = el as HTMLChEditElement)\n }\n onInput={this.#nameChangedHandler}\n ></ch-edit>\n\n <label\n // description\n class=\"label description-label\"\n htmlFor=\"input-description\"\n >\n {this.#componentLocale.header.descriptionFieldLabel}\n </label>\n <ch-edit\n class=\"input description-input\"\n id=\"input-description\"\n ref={(el: HTMLChEditElement) =>\n (this.#descriptionEl = el as HTMLChEditElement)\n }\n ></ch-edit>\n\n <label\n // module/folder\n class=\"label module-label\"\n htmlFor=\"input-module\"\n >\n {this.#componentLocale.header.moduleFolderLabel}\n </label>\n <gx-ide-entity-selector\n class=\"module module-entity-selector\"\n id=\"module\"\n value={this.defaultParent}\n ref={(el: HTMLGxIdeEntitySelectorElement) =>\n (this.#moduleEntitySelector =\n el as HTMLGxIdeEntitySelectorElement)\n }\n labelPosition=\"none\"\n defaultValue={this.defaultParent}\n selectEntityCallback={this.selectModuleCallback}\n ></gx-ide-entity-selector>\n </div>\n\n <div class=\"radio-file-input-wrapper field-group\">\n <ch-radio-group-render\n // file url/text\n class=\"radio-group\"\n model={this.#radioOptionsModel}\n onChange={this.#changeRadioHandler}\n value={this.defaultRadioValue}\n ref={(el: HTMLChRadioGroupRenderElement) =>\n (this.#radioGroup = el as HTMLChRadioGroupRenderElement)\n }\n ></ch-radio-group-render>\n <div class=\"field field-inline field-file-input\">\n <ch-edit\n autoFocus\n id=\"file-name\"\n class=\"input\"\n part=\"file-name\"\n type=\"text\"\n value={this.fileName}\n readonly\n placeholder={this.#componentLocale.header.fileNamePlaceholder}\n startImgSrc={FILE_ICON}\n disabled={this.radioGroupValue !== \"file\"}\n ></ch-edit>\n <input\n hidden\n type=\"file\"\n accept=\".json\"\n onChange={this.#selectFileInputChangedHandler}\n ref={(el: HTMLInputElement) =>\n (this.#fileInputHiddenEl = el as HTMLInputElement)\n }\n />\n <div class=\"buttons-spacer\">\n <button\n aria-label={\n this.#componentLocale.header.removeFileSelection\n }\n title={this.#componentLocale.header.removeFileSelection}\n id=\"reset-all-button\"\n class=\"button-tertiary button-icon-only\"\n part=\"reset-all-button\"\n onClick={this.#removeFileSelection}\n disabled={this.radioGroupValue !== \"file\"}\n >\n <ch-image class=\"icon-md\" src={MENU_DELETE}></ch-image>\n </button>\n\n <button\n id=\"select-file-load-button\"\n class=\"button-primary\"\n part=\"select-file-load-button\"\n onClick={this.#selectFileInputHandler}\n disabled={this.radioGroupValue !== \"file\"}\n >\n {this.#componentLocale.header.selectfileButton}\n </button>\n </div>\n </div>\n </div>\n </header>\n <div class=\"main field-group\">\n <div class=\"json-area\">\n <div class=\"slotted-container scrollable\">\n <slot\n name=\"JsonTextEditor\"\n onSlotchange={this.#handleSlotChange}\n ></slot>\n </div>\n {this.showTooltipError && (\n <ch-tooltip\n class=\"tooltip\"\n blockAlign={config.tooltipSettings.blockAlign}\n inlineAlign={config.tooltipSettings.inlineAlign}\n delay={config.tooltipSettings.delay}\n >\n Error message\n </ch-tooltip>\n )}\n </div>\n <ch-checkbox\n class=\"checkbox spacing-body-block-end spacing-body-inline-start\"\n caption={this.#componentLocale.main.checkBoxLabel}\n checkedValue=\"true\"\n ref={(el: HTMLChCheckboxElement) =>\n (this.#checkBoxEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n </div>\n\n <footer class=\"control-footer control-footer-with-border spacing-body-block-end spacing-body-inline\">\n <div class=\"buttons-spacer\">\n <button\n class=\"button-secondary\"\n id=\"button-cancel\"\n onClick={this.cancelCallback}\n part=\"button-cancel\"\n >\n {this.#componentLocale.footer.btnCancel}\n </button>\n <button\n class=\"button-primary\"\n id=\"button-ok\"\n onClick={this.#createHandler}\n part=\"button-ok\"\n disabled={!this.isFormValid}\n >\n {this.#componentLocale.footer.btnOk}\n </button>\n </div>\n </footer>\n </section>\n </Host>\n );\n }\n}\n\nexport type JsonImportData = {\n name: string;\n description: string;\n parentId: string;\n json: File | string;\n assumeVarcharForNull: boolean;\n};\n\nexport type EntityData = {\n id: string;\n name: string;\n iconSrc?: string;\n};\n\nexport type SelectModuleCallback = () => Promise<EntityData | undefined>;\n"]}
|
|
1
|
+
{"version":3,"file":"json-import.js","sourceRoot":"","sources":["../../../src/components/json-import/json-import.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,KAAK,EACL,YAAY,EACZ,MAAM,EACN,CAAC,EACF,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAkB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,OAAO,EAEL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,gBAAgB;IAChB,oBAAoB;IACpB,kBAAkB;IAClB,cAAc;IACd,kBAAkB;IAClB,eAAe;IACf,qBAAqB;CACtB,CAAC;AAEF,MAAM,SAAS,GAAG,WAAW,CAAC;IAC5B,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,WAAW,CAAC;IAC9B,QAAQ,EAAE,OAAO;IACjB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAQH,MAAM,OAAO,eAAe;;QAC1B,mDAAsB;QACtB,gCAAwB;YACtB,IAAI,EAAE,EAAE;YACR,WAAW,EAAE,EAAE;YACf,oBAAoB,EAAE,KAAK;YAC3B,QAAQ,EAAE,EAAE;YACZ,IAAI,EAA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C,YACE,IAAI,EAAC,gBAAgB,EACrB,YAAY,EAAE,uBAAA,IAAI,yCAAkB,GAC9B,CACJ,CACF;oBACN,mBACE,KAAK,EAAC,2DAA2D,EACjE,OAAO,EAAE,uBAAA,IAAI,wCAAiB,CAAC,IAAI,CAAC,aAAa,EACjD,YAAY,EAAC,MAAM,EACnB,GAAG,EAAE,CAAC,EAAyB,EAAE,EAAE,CACjC,CAAC,uBAAA,IAAI,+BAAe,EAA2B,MAAA,CAAC,GAErC,CACX;gBAEN,cAAQ,KAAK,EAAC,sFAAsF;oBAClG,WAAK,KAAK,EAAC,gBAAgB;wBACzB,cACE,KAAK,EAAC,kBAAkB,EACxB,EAAE,EAAC,eAAe,EAClB,OAAO,EAAE,IAAI,CAAC,cAAc,EAC5B,IAAI,EAAC,eAAe,IAEnB,uBAAA,IAAI,wCAAiB,CAAC,MAAM,CAAC,SAAS,CAChC;wBACT,cACE,KAAK,EAAC,gBAAgB,EACtB,EAAE,EAAC,WAAW,EACd,OAAO,EAAE,uBAAA,IAAI,sCAAe,EAC5B,IAAI,EAAC,WAAW,EAChB,QAAQ,EAAE,CAAC,IAAI,CAAC,WAAW,IAE1B,uBAAA,IAAI,wCAAiB,CAAC,MAAM,CAAC,KAAK,CAC5B,CACL,CACC,CACD,CACL,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n Prop,\n Element,\n State,\n getAssetPath,\n Method,\n h\n} from \"@stencil/core\";\n\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\nimport { config } from \"../../common/config\";\n\nimport { Locale } from \"../../common/locale\";\nimport { FormSubmitResult } from \"../../common/types\";\nimport { RadioGroupItemModel } from \"@genexus/chameleon-controls-library/dist/types/components/radio-group/types\";\nimport {\n ControlValidation,\n validateControls\n} from \"../../common/form-validation\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/tab\",\n \"components/tooltip\",\n \"utils/form--full\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\n\nconst FILE_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"file\",\n colorType: \"primary\"\n});\n\nconst MENU_DELETE = getIconPath({\n category: \"menus\",\n name: \"delete\",\n colorType: \"primary\"\n});\n\n@Component({\n tag: \"gx-ide-json-import\",\n styleUrl: \"json-import.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/json-import\"]\n})\nexport class GxIdeJsonImport {\n #componentLocale: any;\n #data: JsonImportData = {\n name: \"\",\n description: \"\",\n assumeVarcharForNull: false,\n parentId: \"\",\n json: \"\"\n };\n #radioOptionsModel: RadioGroupItemModel[] = [];\n #shortcutsSrc = getAssetPath(`./gx-ide-assets/json-import/shortcuts.json`);\n\n @Element() el: HTMLGxIdeJsonImportElement;\n #checkBoxEl!: HTMLChCheckboxElement;\n #chShortcutsEl: HTMLChShortcutsElement;\n #descriptionEl!: HTMLChEditElement;\n #fileInputHiddenEl!: HTMLInputElement;\n #moduleEntitySelector!: HTMLGxIdeEntitySelectorElement;\n #nameEl!: HTMLChEditElement;\n #radioGroup!: HTMLChRadioGroupRenderElement;\n\n @State() fileName: string;\n @State() radioGroupValue: string = \"file\";\n @State() isFormValid: boolean = false;\n @State() jsonContent: string = \"\";\n @State() validatableControls = new Map<string, ControlValidation>();\n\n /**\n * Callback that must be invoked when the user want to cancel the operation\n */\n @Prop() readonly cancelCallback: () => Promise<void>;\n\n /**\n * Callback that must be invoked when the user confirms the creation of the SDT. It receives as parameters the data necessary to create the SDT.\n */\n @Prop() readonly confirmCallback!: (\n data: JsonImportData\n ) => Promise<FormSubmitResult>;\n\n /**\n * Default value for Module/Folder field\n */\n @Prop() readonly defaultParent: EntityData;\n\n /**\n * Default value for Module/Folder field\n */\n @Prop() readonly defaultRadioValue: string;\n\n /**\n * Actual value for Module/Folder field\n */\n @Prop() readonly parent: EntityData;\n\n /**\n * Callback invoked when the action is executed in the Module/Folder filter. It returns the information of the selected object (id and name) or 'undefined' if it was canceled.\n */\n @Prop() readonly selectModuleCallback: SelectModuleCallback;\n\n /**\n * Callback invoked when the input mode changes between file and text.\n */\n @Prop() readonly modeChangeCallback?: (\n mode: \"file\" | \"text\"\n ) => Promise<void>;\n\n /**\n * Callback invoked when a file is selected or removed.\n */\n @Prop() readonly fileChangeCallback?: (file: File | null) => Promise<void>;\n\n /**\n * Callback para validar el nombre del objeto. Debe retornar true si el nombre es válido, false en caso contrario.\n */\n @Prop() readonly validateNameCallback?: (name: string) => boolean;\n\n /**\n * Callback para validar el JSON. Debe retornar true si el JSON es válido, false en caso contrario.\n */\n @Prop() readonly validateJSONCallback?: (json: string) => boolean;\n\n /**\n * Callback invocado cuando el contenido del JSON cambia\n */\n @Prop() readonly onJsonContentChange?: (content: string) => void;\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n this.#radioOptionsModel = [\n {\n value: \"file\",\n caption: this.#componentLocale.header.filePathLabel\n },\n { value: \"text\", caption: this.#componentLocale.main.jsonAreaLabel }\n ];\n }\n\n componentDidLoad() {\n this.#initializeValidatableControls();\n }\n\n /**\n * Suspends or reactivates the shortcuts\n */\n @Method()\n async suspendShortcuts(suspendShortcuts: boolean) {\n this.#chShortcutsEl.suspend = suspendShortcuts;\n }\n\n #initializeValidatableControls = () => {\n const validatableControls: HTMLElement[] = [\n this.#nameEl,\n this.#moduleEntitySelector\n ];\n validatableControls.forEach(validatableControl => {\n if (validatableControl.id) {\n this.validatableControls.set(validatableControl.id, {\n reference: validatableControl,\n hasError: false,\n message: undefined\n });\n }\n });\n };\n\n #evaluateTooltipRender = (\n controlReference: HTMLElement\n ): HTMLChTooltipElement =>\n this.validatableControls?.get(controlReference?.id)?.hasError &&\n this.validatableControls.get(controlReference.id)?.message && (\n <ch-tooltip\n class=\"tooltip\"\n actionElement={controlReference as unknown as HTMLButtonElement}\n blockAlign={config.tooltipSettings.blockAlign}\n inlineAlign={config.tooltipSettings.inlineAlign}\n delay={config.tooltipSettings.delay}\n >\n {this.validatableControls.get(controlReference.id).message}\n </ch-tooltip>\n );\n\n #validateForm = () => {\n const name = this.#nameEl?.value?.trim() || \"\";\n const json =\n this.radioGroupValue === \"file\" ? this.fileName : this.jsonContent;\n\n const isNameValid = this.validateNameCallback\n ? this.validateNameCallback(name)\n : Boolean(name);\n\n const isJsonValid =\n this.radioGroupValue === \"file\"\n ? Boolean(this.fileName)\n : this.validateJSONCallback\n ? this.validateJSONCallback(json)\n : false;\n\n this.isFormValid = isNameValid && isJsonValid;\n };\n\n #nameChangedHandler = () => {\n this.#validateForm();\n };\n\n #changeRadioHandler = () => {\n this.radioGroupValue = this.#radioGroup.value;\n if (this.radioGroupValue === \"file\") {\n this.#checkBoxEl.value = \"false\";\n } else {\n this.#data.json = null;\n this.#removeFileSelection();\n this.#validateForm();\n }\n this.modeChangeCallback?.(this.radioGroupValue as \"file\" | \"text\");\n };\n\n #createHandler = () => {\n this.#data.name = this.#nameEl.value;\n this.#data.description = this.#descriptionEl.value;\n this.#data.parentId = this.#moduleEntitySelector.value?.id;\n this.#data.assumeVarcharForNull = this.#checkBoxEl.value === \"true\";\n this.confirmCallback(this.#data).then(\n (formSubmitResult: FormSubmitResult) => {\n this.validatableControls = validateControls(\n formSubmitResult,\n this.validatableControls\n );\n }\n );\n };\n\n #removeFileSelection = () => {\n this.#data.json = null;\n this.#fileInputHiddenEl.value = null;\n this.fileName = null;\n this.fileChangeCallback?.(null);\n this.#validateForm();\n };\n\n #selectFileInputChangedHandler = (event: InputEvent) => {\n const target = event.target as HTMLInputElement;\n if (target.files?.length > 0 && this.radioGroupValue === \"file\") {\n this.#data.json = target.files[0];\n this.fileName = target.files[0].name;\n this.fileChangeCallback?.(target.files[0]);\n this.#validateForm();\n }\n };\n\n #selectFileInputHandler = () => {\n this.#fileInputHiddenEl.click();\n };\n\n #handleEditorChange = () => {\n this.#validateForm();\n };\n\n #handleSlotChange = (e: Event) => {\n const elements = (e.target as HTMLSlotElement).assignedElements();\n if (elements.length > 0) {\n const element = elements[0];\n element.addEventListener(\"json-content-change\", ((event: CustomEvent) => {\n if (this.radioGroupValue === \"text\") {\n this.jsonContent = event.detail.content;\n this.#handleEditorChange();\n }\n }) as EventListener);\n }\n };\n\n render(): void {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <ch-shortcuts\n src={this.#shortcutsSrc}\n ref={(el: HTMLChShortcutsElement) =>\n (this.#chShortcutsEl = el as HTMLChShortcutsElement)\n }\n ></ch-shortcuts>\n <section class=\"section\">\n <header class=\"header field-group spacing-body control-header-with-border\">\n <div class=\"field-group field-group-name-description-module\">\n <label\n // name\n class=\"label name-label\"\n htmlFor=\"input-name\"\n >\n {this.#componentLocale.header.nameFieldLabel}\n </label>\n <ch-edit\n class=\"input name-input\"\n id=\"input-name\"\n ref={(el: HTMLChEditElement) =>\n (this.#nameEl = el as HTMLChEditElement)\n }\n onInput={this.#nameChangedHandler}\n ></ch-edit>\n {this.#evaluateTooltipRender(this.#nameEl)}\n\n <label\n // description\n class=\"label description-label\"\n htmlFor=\"input-description\"\n >\n {this.#componentLocale.header.descriptionFieldLabel}\n </label>\n <ch-edit\n class=\"input description-input\"\n id=\"input-description\"\n ref={(el: HTMLChEditElement) =>\n (this.#descriptionEl = el as HTMLChEditElement)\n }\n ></ch-edit>\n\n <label\n // module/folder\n class=\"label module-label\"\n htmlFor=\"input-module\"\n >\n {this.#componentLocale.header.moduleFolderLabel}\n </label>\n <gx-ide-entity-selector\n class=\"module module-entity-selector\"\n id=\"module\"\n value={this.defaultParent}\n ref={(el: HTMLGxIdeEntitySelectorElement) =>\n (this.#moduleEntitySelector =\n el as HTMLGxIdeEntitySelectorElement)\n }\n labelPosition=\"none\"\n defaultValue={this.defaultParent}\n selectEntityCallback={this.selectModuleCallback}\n ></gx-ide-entity-selector>\n {this.#evaluateTooltipRender(this.#moduleEntitySelector)}\n </div>\n\n <div class=\"radio-file-input-wrapper field-group\">\n <ch-radio-group-render\n // file url/text\n class=\"radio-group\"\n model={this.#radioOptionsModel}\n onChange={this.#changeRadioHandler}\n value={this.defaultRadioValue}\n ref={(el: HTMLChRadioGroupRenderElement) =>\n (this.#radioGroup = el as HTMLChRadioGroupRenderElement)\n }\n ></ch-radio-group-render>\n <div class=\"field field-inline field-file-input\">\n <ch-edit\n autoFocus\n id=\"file-name\"\n class=\"input\"\n part=\"file-name\"\n type=\"text\"\n value={this.fileName}\n readonly\n placeholder={this.#componentLocale.header.fileNamePlaceholder}\n startImgSrc={FILE_ICON}\n disabled={this.radioGroupValue !== \"file\"}\n ></ch-edit>\n <input\n hidden\n type=\"file\"\n accept=\".json\"\n onChange={this.#selectFileInputChangedHandler}\n ref={(el: HTMLInputElement) =>\n (this.#fileInputHiddenEl = el as HTMLInputElement)\n }\n />\n <div class=\"buttons-spacer\">\n <button\n aria-label={\n this.#componentLocale.header.removeFileSelection\n }\n title={this.#componentLocale.header.removeFileSelection}\n id=\"reset-all-button\"\n class=\"button-tertiary button-icon-only\"\n part=\"reset-all-button\"\n onClick={this.#removeFileSelection}\n disabled={this.radioGroupValue !== \"file\"}\n >\n <ch-image class=\"icon-md\" src={MENU_DELETE}></ch-image>\n </button>\n\n <button\n id=\"select-file-load-button\"\n class=\"button-primary\"\n part=\"select-file-load-button\"\n onClick={this.#selectFileInputHandler}\n disabled={this.radioGroupValue !== \"file\"}\n >\n {this.#componentLocale.header.selectfileButton}\n </button>\n </div>\n </div>\n </div>\n </header>\n <div class=\"main field-group\">\n <div class=\"json-area\">\n <div class=\"slotted-container scrollable\">\n <slot\n name=\"JsonTextEditor\"\n onSlotchange={this.#handleSlotChange}\n ></slot>\n </div>\n </div>\n <ch-checkbox\n class=\"checkbox spacing-body-block-end spacing-body-inline-start\"\n caption={this.#componentLocale.main.checkBoxLabel}\n checkedValue=\"true\"\n ref={(el: HTMLChCheckboxElement) =>\n (this.#checkBoxEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n </div>\n\n <footer class=\"control-footer control-footer-with-border spacing-body-block-end spacing-body-inline\">\n <div class=\"buttons-spacer\">\n <button\n class=\"button-secondary\"\n id=\"button-cancel\"\n onClick={this.cancelCallback}\n part=\"button-cancel\"\n >\n {this.#componentLocale.footer.btnCancel}\n </button>\n <button\n class=\"button-primary\"\n id=\"button-ok\"\n onClick={this.#createHandler}\n part=\"button-ok\"\n disabled={!this.isFormValid}\n >\n {this.#componentLocale.footer.btnOk}\n </button>\n </div>\n </footer>\n </section>\n </Host>\n );\n }\n}\n\nexport type JsonImportData = {\n name: string;\n description: string;\n parentId: string;\n json: File | string;\n assumeVarcharForNull: boolean;\n};\n\nexport type EntityData = {\n id: string;\n name: string;\n iconSrc?: string;\n};\n\nexport type SelectModuleCallback = () => Promise<EntityData | undefined>;\n"]}
|
|
@@ -58,25 +58,23 @@ export class HTMLGxIdeConnectGxServer {
|
|
|
58
58
|
((_c = this.validatableControls.get(controlReference.id)) === null || _c === void 0 ? void 0 : _c.message) && (h("ch-tooltip", { class: "tooltip", actionElement: controlReference, blockAlign: config.tooltipSettings.blockAlign, inlineAlign: config.tooltipSettings.inlineAlign, delay: config.tooltipSettings.delay }, this.validatableControls.get(controlReference.id).message));
|
|
59
59
|
});
|
|
60
60
|
_HTMLGxIdeConnectGxServer_init.set(this, () => {
|
|
61
|
-
var _a, _b, _c, _d, _e, _f
|
|
61
|
+
var _a, _b, _c, _d, _e, _f;
|
|
62
62
|
this.authenticationTypesChanged(this.authenticationTypes);
|
|
63
63
|
this.serverUrlsChanged(this.serverUrls);
|
|
64
64
|
// set initial values:
|
|
65
65
|
// server url
|
|
66
|
-
this.gxServerConnectionData.serverUrl =
|
|
67
|
-
((_a = this.defaultConnectionData) === null || _a === void 0 ? void 0 : _a.serverUrl) ||
|
|
68
|
-
((_b = this.serverUrlsComboBoxModel[0]) === null || _b === void 0 ? void 0 : _b.value);
|
|
66
|
+
this.gxServerConnectionData.serverUrl = "";
|
|
69
67
|
// authentication type
|
|
70
68
|
this.gxServerConnectionData.authenticationType = {
|
|
71
|
-
id: ((
|
|
72
|
-
((
|
|
73
|
-
name: ((
|
|
74
|
-
((
|
|
69
|
+
id: ((_a = this.defaultConnectionData) === null || _a === void 0 ? void 0 : _a.authenticationType.id) ||
|
|
70
|
+
((_b = this.authenticationTypesComboBoxModel[0]) === null || _b === void 0 ? void 0 : _b.value),
|
|
71
|
+
name: ((_c = this.defaultConnectionData) === null || _c === void 0 ? void 0 : _c.authenticationType.name) ||
|
|
72
|
+
((_d = this.authenticationTypesComboBoxModel[0]) === null || _d === void 0 ? void 0 : _d.caption)
|
|
75
73
|
};
|
|
76
74
|
// user name
|
|
77
|
-
this.gxServerConnectionData.userName = (
|
|
75
|
+
this.gxServerConnectionData.userName = (_e = this.defaultConnectionData) === null || _e === void 0 ? void 0 : _e.userName;
|
|
78
76
|
this.gxServerConnectionData.userPassword =
|
|
79
|
-
(
|
|
77
|
+
(_f = this.defaultConnectionData) === null || _f === void 0 ? void 0 : _f.userPassword;
|
|
80
78
|
});
|
|
81
79
|
_HTMLGxIdeConnectGxServer_initializeValidatableControls.set(this, () => {
|
|
82
80
|
// populate #controlsValidation with the controls that could have errors.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect-gx-server.js","sourceRoot":"","sources":["../../../../src/components/team-dev/connect-gx-server/connect-gx-server.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,UAAU;AACV,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE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DAAiB,CAAC,MAAM,CAAC,mBAAmB,CAC1C;wBAET;4BACE,iBAAiB;4BACjB,KAAK,EAAC,gBAAgB,EACtB,OAAO,EAAE,uBAAA,IAAI,qDAAqB,IAEjC,uBAAA,IAAI,iDAAiB,CAAC,MAAM,CAAC,oBAAoB,CAC3C,CACL,CACC,CACD,CACL,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["// Stencil\nimport { Component, Host, h, Prop, Element, State, Watch } from \"@stencil/core\";\n\n// Other Libraries\nimport { ComboBoxModel } from \"@genexus/chameleon-controls-library\";\nimport { MercuryBundles } from \"@genexus/mercury\";\n\n// Custom Imports\nimport { config } from \"../../../common/config\";\nimport {\n mapAuthenticationTypeToComboBoxModel,\n mapServerUrlsToComboBoxModel\n} from \"./helpers\";\nimport { Locale } from \"../../../common/locale\";\nimport { FormSubmitResult } from \"../../../common/types\";\nimport {\n ControlValidation,\n validateControls\n} from \"../../../common/form-validation\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/tab\",\n \"components/tooltip\",\n \"utils/form--full\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\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 HTMLGxIdeConnectGxServer {\n /**\n * The component hard-coded strings translations.\n */\n // eslint-disable-next-line @stencil-community/own-props-must-be-private\n #componentLocale: any;\n\n @Element() el: HTMLGxIdeConnectGxServerElement;\n #usernameRef!: HTMLChEditElement;\n #passwordRef!: HTMLChEditElement;\n #serverUrlRef!: HTMLChComboBoxRenderElement;\n\n @State() authenticationTypesComboBoxModel: ComboBoxModel;\n @State() gxServerConnectionData: GXServerConnectionData = {\n authenticationType: {\n id: null,\n name: null\n },\n serverUrl: null,\n userName: null,\n userPassword: null\n };\n @State() serverUrlsComboBoxModel: ComboBoxModel;\n @State() validatableControls = new Map<string, ControlValidation>();\n\n /**\n * List of authentication types.\n */\n @Prop() readonly authenticationTypes!: AuthenticationType[];\n @Watch(\"authenticationTypes\")\n authenticationTypesChanged(newAuthenticationTypes: AuthenticationType[]) {\n if (newAuthenticationTypes?.length) {\n this.authenticationTypesComboBoxModel =\n mapAuthenticationTypeToComboBoxModel(newAuthenticationTypes);\n }\n }\n\n /**\n * Callback that must be invoked when the 'Cancel' button is pressed.\n */\n @Prop() readonly cancelCallback!: () => Promise<void>;\n\n /**\n * Callback that must be invoked when the 'Connect' button is pressed.\n */\n @Prop() readonly connectCallback!: (\n data: GXServerConnectionData\n ) => Promise<FormSubmitResult>;\n\n /**\n * Initial user values for the case in which the user returns to the login modal after successful authentication.\n */\n @Prop() readonly defaultConnectionData?: GXServerConnectionData;\n\n /**\n * true if the user should be allowed to manually enter a server URL.\n */\n @Prop() readonly enableCustomServer: boolean = false;\n\n /**\n * Array of cataloged server URLs to be displayed in the combo.\n */\n @Prop() readonly serverUrls: string[];\n @Watch(\"serverUrls\")\n serverUrlsChanged(newServerUrls: string[]) {\n if (newServerUrls?.length) {\n this.serverUrlsComboBoxModel =\n mapServerUrlsToComboBoxModel(newServerUrls);\n }\n }\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n\n this.#init();\n }\n\n async componentDidLoad() {\n this.#initializeValidatableControls();\n }\n\n #cancelClickHandler = () => {\n this.cancelCallback();\n };\n\n #connectClickHandler = async () => {\n this.connectCallback(this.gxServerConnectionData).then(\n (formSubmitResult: FormSubmitResult) => {\n this.validatableControls = validateControls(\n formSubmitResult,\n this.validatableControls\n );\n }\n );\n };\n\n // TODO: evaluate if this should be a global helper function.\n // It is used on other dialogs as well.\n #evaluateTooltipRender = (\n controlReference: HTMLElement\n ): HTMLChTooltipElement =>\n this.validatableControls?.get(controlReference?.id)?.hasError &&\n this.validatableControls.get(controlReference.id)?.message && (\n <ch-tooltip\n class=\"tooltip\"\n actionElement={controlReference as unknown as HTMLButtonElement}\n blockAlign={config.tooltipSettings.blockAlign}\n inlineAlign={config.tooltipSettings.inlineAlign}\n delay={config.tooltipSettings.delay}\n >\n {this.validatableControls.get(controlReference.id).message}\n </ch-tooltip>\n );\n\n #init = () => {\n this.authenticationTypesChanged(this.authenticationTypes);\n this.serverUrlsChanged(this.serverUrls);\n // set initial values:\n // server url\n this.gxServerConnectionData.serverUrl =\n this.defaultConnectionData?.serverUrl ||\n this.serverUrlsComboBoxModel[0]?.value;\n // authentication type\n this.gxServerConnectionData.authenticationType = {\n id:\n (this.defaultConnectionData?.authenticationType.id as string) ||\n this.authenticationTypesComboBoxModel[0]?.value,\n name:\n (this.defaultConnectionData?.authenticationType.name as string) ||\n this.authenticationTypesComboBoxModel[0]?.caption\n };\n\n // user name\n this.gxServerConnectionData.userName = this.defaultConnectionData?.userName;\n this.gxServerConnectionData.userPassword =\n this.defaultConnectionData?.userPassword;\n };\n\n #initializeValidatableControls = () => {\n // populate #controlsValidation with the controls that could have errors.\n const validatableControls: HTMLElement[] = [\n this.#usernameRef,\n this.#passwordRef,\n this.#serverUrlRef\n ];\n validatableControls.forEach(validatableControl => {\n if (validatableControl.id) {\n this.validatableControls.set(validatableControl.id, {\n reference: validatableControl,\n hasError: false,\n message: undefined\n });\n }\n });\n };\n\n // handlers that update this.gxServerConnectionData:\n #serverUrlInputEventHandler = (event: CustomEvent<string> | InputEvent) => {\n this.gxServerConnectionData.serverUrl = event.detail as string;\n };\n #authenticationInputEventHandler = (\n event: CustomEvent<string> | InputEvent\n ) => {\n const authenticationTypeId = event.detail as string;\n const authenticationTypeIndex = this.authenticationTypes.findIndex(\n authType => {\n return authType.id === authenticationTypeId;\n }\n );\n const authenticationTypeName =\n this.authenticationTypes[authenticationTypeIndex].name;\n\n this.gxServerConnectionData.authenticationType = {\n id: authenticationTypeId,\n name: authenticationTypeName\n };\n };\n #usernameInputEventHandler = (event: CustomEvent<string> | InputEvent) => {\n this.gxServerConnectionData.userName = event.detail as string;\n };\n #passwordInputEventHandler = (event: CustomEvent<string> | InputEvent) => {\n this.gxServerConnectionData.userPassword = event.detail as string;\n };\n\n render() {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n\n <section class=\"section\">\n <div class=\"main field-group spacing-body\">\n <div\n // server urls\n class=\"field field-block server-url\"\n >\n <label class=\"label\" htmlFor=\"server-url\">\n {this.#componentLocale.main.serverURLLabel}\n </label>\n <ch-combo-box-render\n id=\"server-url\"\n class=\"combo-box\"\n accessibleName=\"Server Url\"\n model={this.serverUrlsComboBoxModel}\n placeholder=\"Select a server URL\"\n value={this.gxServerConnectionData?.serverUrl}\n onChange={this.#serverUrlInputEventHandler}\n suggest={this.enableCustomServer}\n suggestOptions={{\n alreadyProcessed: false,\n autoExpand: false,\n hideMatchesAndShowNonMatches: false,\n highlightMatchedItems: false,\n matchCase: false,\n regularExpression: false,\n renderActiveItemIconOnExpand: true,\n strict: false\n }}\n ref={(el: HTMLChComboBoxRenderElement) =>\n (this.#serverUrlRef = el as HTMLChComboBoxRenderElement)\n }\n ></ch-combo-box-render>\n {this.#evaluateTooltipRender(this.#serverUrlRef)}\n </div>\n\n <div\n // authentication types\n class=\"field field-block authentication-type\"\n >\n <label class=\"label\" htmlFor=\"authentication-type\">\n {this.#componentLocale.main.authenticationTypeLabel}\n </label>\n <ch-combo-box-render\n id=\"authentication-type\"\n class=\"combo-box\"\n accessibleName=\"Authentication Types\"\n model={this.authenticationTypesComboBoxModel}\n placeholder=\"Select an authentication type\"\n value={this.gxServerConnectionData?.authenticationType.id}\n onInput={this.#authenticationInputEventHandler}\n ></ch-combo-box-render>\n </div>\n\n <div\n // username\n class=\"field field-block user-name\"\n >\n <label class=\"label\" htmlFor=\"username\">\n {this.#componentLocale.main.usernameLabel}\n </label>\n <ch-edit\n type=\"text\"\n id=\"username\"\n class=\"input\"\n value={this.gxServerConnectionData?.userName}\n onInput={this.#usernameInputEventHandler}\n ref={(el: HTMLChEditElement) =>\n (this.#usernameRef = el as HTMLChEditElement)\n }\n ></ch-edit>\n {this.#evaluateTooltipRender(this.#usernameRef)}\n </div>\n\n <div\n // user password\n class=\"field field-block user-password\"\n >\n <label class=\"label\" htmlFor=\"password\">\n {this.#componentLocale.main.passwordLabel}\n </label>\n <ch-edit\n type=\"password\"\n id=\"password\"\n class=\"input\"\n value={this.gxServerConnectionData?.userPassword}\n onInput={this.#passwordInputEventHandler}\n ref={(el: HTMLChEditElement) =>\n (this.#passwordRef = el as HTMLChEditElement)\n }\n ></ch-edit>\n {this.#evaluateTooltipRender(this.#passwordRef)}\n </div>\n </div>\n\n <footer class=\"control-footer-with-border spacing-body\">\n <div class=\"buttons-spacer\">\n <button\n // cancel button\n class=\"button-secondary\"\n onClick={this.#cancelClickHandler}\n >\n {this.#componentLocale.footer.cancelButtonCaption}\n </button>\n\n <button\n // connect button\n class=\"button-primary\"\n onClick={this.#connectClickHandler}\n >\n {this.#componentLocale.footer.connectButtonCaption}\n </button>\n </div>\n </footer>\n </section>\n </Host>\n );\n }\n}\n\nexport type GXServerConnectionData = {\n authenticationType: AuthenticationType;\n serverUrl: string;\n userName: string;\n userPassword: string;\n};\n\nexport type AuthenticationType = {\n id: string;\n name: string;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"connect-gx-server.js","sourceRoot":"","sources":["../../../../src/components/team-dev/connect-gx-server/connect-gx-server.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;AAMhF,iBAAiB;AACjB,OAAO,EAAE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CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["// Stencil\nimport { Component, Host, h, Prop, Element, State, Watch } from \"@stencil/core\";\n\n// Other Libraries\nimport { ComboBoxModel } from \"@genexus/chameleon-controls-library\";\nimport { MercuryBundles } from \"@genexus/mercury\";\n\n// Custom Imports\nimport { config } from \"../../../common/config\";\nimport {\n mapAuthenticationTypeToComboBoxModel,\n mapServerUrlsToComboBoxModel\n} from \"./helpers\";\nimport { Locale } from \"../../../common/locale\";\nimport { FormSubmitResult } from \"../../../common/types\";\nimport {\n ControlValidation,\n validateControls\n} from \"../../../common/form-validation\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/tab\",\n \"components/tooltip\",\n \"utils/form--full\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\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 HTMLGxIdeConnectGxServer {\n /**\n * The component hard-coded strings translations.\n */\n // eslint-disable-next-line @stencil-community/own-props-must-be-private\n #componentLocale: any;\n\n @Element() el: HTMLGxIdeConnectGxServerElement;\n #usernameRef!: HTMLChEditElement;\n #passwordRef!: HTMLChEditElement;\n #serverUrlRef!: HTMLChComboBoxRenderElement;\n\n @State() authenticationTypesComboBoxModel: ComboBoxModel;\n @State() gxServerConnectionData: GXServerConnectionData = {\n authenticationType: {\n id: null,\n name: null\n },\n serverUrl: null,\n userName: null,\n userPassword: null\n };\n @State() serverUrlsComboBoxModel: ComboBoxModel;\n @State() validatableControls = new Map<string, ControlValidation>();\n\n /**\n * List of authentication types.\n */\n @Prop() readonly authenticationTypes!: AuthenticationType[];\n @Watch(\"authenticationTypes\")\n authenticationTypesChanged(newAuthenticationTypes: AuthenticationType[]) {\n if (newAuthenticationTypes?.length) {\n this.authenticationTypesComboBoxModel =\n mapAuthenticationTypeToComboBoxModel(newAuthenticationTypes);\n }\n }\n\n /**\n * Callback that must be invoked when the 'Cancel' button is pressed.\n */\n @Prop() readonly cancelCallback!: () => Promise<void>;\n\n /**\n * Callback that must be invoked when the 'Connect' button is pressed.\n */\n @Prop() readonly connectCallback!: (\n data: GXServerConnectionData\n ) => Promise<FormSubmitResult>;\n\n /**\n * Initial user values for the case in which the user returns to the login modal after successful authentication.\n */\n @Prop() readonly defaultConnectionData?: GXServerConnectionData;\n\n /**\n * true if the user should be allowed to manually enter a server URL.\n */\n @Prop() readonly enableCustomServer: boolean = false;\n\n /**\n * Array of cataloged server URLs to be displayed in the combo.\n */\n @Prop() readonly serverUrls: string[];\n @Watch(\"serverUrls\")\n serverUrlsChanged(newServerUrls: string[]) {\n if (newServerUrls?.length) {\n this.serverUrlsComboBoxModel =\n mapServerUrlsToComboBoxModel(newServerUrls);\n }\n }\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n\n this.#init();\n }\n\n async componentDidLoad() {\n this.#initializeValidatableControls();\n }\n\n #cancelClickHandler = () => {\n this.cancelCallback();\n };\n\n #connectClickHandler = async () => {\n this.connectCallback(this.gxServerConnectionData).then(\n (formSubmitResult: FormSubmitResult) => {\n this.validatableControls = validateControls(\n formSubmitResult,\n this.validatableControls\n );\n }\n );\n };\n\n // TODO: evaluate if this should be a global helper function.\n // It is used on other dialogs as well.\n #evaluateTooltipRender = (\n controlReference: HTMLElement\n ): HTMLChTooltipElement =>\n this.validatableControls?.get(controlReference?.id)?.hasError &&\n this.validatableControls.get(controlReference.id)?.message && (\n <ch-tooltip\n class=\"tooltip\"\n actionElement={controlReference as unknown as HTMLButtonElement}\n blockAlign={config.tooltipSettings.blockAlign}\n inlineAlign={config.tooltipSettings.inlineAlign}\n delay={config.tooltipSettings.delay}\n >\n {this.validatableControls.get(controlReference.id).message}\n </ch-tooltip>\n );\n\n #init = () => {\n this.authenticationTypesChanged(this.authenticationTypes);\n this.serverUrlsChanged(this.serverUrls);\n // set initial values:\n // server url\n this.gxServerConnectionData.serverUrl = \"\";\n // authentication type\n this.gxServerConnectionData.authenticationType = {\n id:\n (this.defaultConnectionData?.authenticationType.id as string) ||\n this.authenticationTypesComboBoxModel[0]?.value,\n name:\n (this.defaultConnectionData?.authenticationType.name as string) ||\n this.authenticationTypesComboBoxModel[0]?.caption\n };\n\n // user name\n this.gxServerConnectionData.userName = this.defaultConnectionData?.userName;\n this.gxServerConnectionData.userPassword =\n this.defaultConnectionData?.userPassword;\n };\n\n #initializeValidatableControls = () => {\n // populate #controlsValidation with the controls that could have errors.\n const validatableControls: HTMLElement[] = [\n this.#usernameRef,\n this.#passwordRef,\n this.#serverUrlRef\n ];\n validatableControls.forEach(validatableControl => {\n if (validatableControl.id) {\n this.validatableControls.set(validatableControl.id, {\n reference: validatableControl,\n hasError: false,\n message: undefined\n });\n }\n });\n };\n\n // handlers that update this.gxServerConnectionData:\n #serverUrlInputEventHandler = (event: CustomEvent<string> | InputEvent) => {\n this.gxServerConnectionData.serverUrl = event.detail as string;\n };\n #authenticationInputEventHandler = (\n event: CustomEvent<string> | InputEvent\n ) => {\n const authenticationTypeId = event.detail as string;\n const authenticationTypeIndex = this.authenticationTypes.findIndex(\n authType => {\n return authType.id === authenticationTypeId;\n }\n );\n const authenticationTypeName =\n this.authenticationTypes[authenticationTypeIndex].name;\n\n this.gxServerConnectionData.authenticationType = {\n id: authenticationTypeId,\n name: authenticationTypeName\n };\n };\n #usernameInputEventHandler = (event: CustomEvent<string> | InputEvent) => {\n this.gxServerConnectionData.userName = event.detail as string;\n };\n #passwordInputEventHandler = (event: CustomEvent<string> | InputEvent) => {\n this.gxServerConnectionData.userPassword = event.detail as string;\n };\n\n render() {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n\n <section class=\"section\">\n <div class=\"main field-group spacing-body\">\n <div\n // server urls\n class=\"field field-block server-url\"\n >\n <label class=\"label\" htmlFor=\"server-url\">\n {this.#componentLocale.main.serverURLLabel}\n </label>\n <ch-combo-box-render\n id=\"server-url\"\n class=\"combo-box\"\n accessibleName=\"Server Url\"\n model={this.serverUrlsComboBoxModel}\n placeholder=\"Select a server URL\"\n value={this.gxServerConnectionData?.serverUrl}\n onChange={this.#serverUrlInputEventHandler}\n suggest={this.enableCustomServer}\n suggestOptions={{\n alreadyProcessed: false,\n autoExpand: false,\n hideMatchesAndShowNonMatches: false,\n highlightMatchedItems: false,\n matchCase: false,\n regularExpression: false,\n renderActiveItemIconOnExpand: true,\n strict: false\n }}\n ref={(el: HTMLChComboBoxRenderElement) =>\n (this.#serverUrlRef = el as HTMLChComboBoxRenderElement)\n }\n ></ch-combo-box-render>\n {this.#evaluateTooltipRender(this.#serverUrlRef)}\n </div>\n\n <div\n // authentication types\n class=\"field field-block authentication-type\"\n >\n <label class=\"label\" htmlFor=\"authentication-type\">\n {this.#componentLocale.main.authenticationTypeLabel}\n </label>\n <ch-combo-box-render\n id=\"authentication-type\"\n class=\"combo-box\"\n accessibleName=\"Authentication Types\"\n model={this.authenticationTypesComboBoxModel}\n placeholder=\"Select an authentication type\"\n value={this.gxServerConnectionData?.authenticationType.id}\n onInput={this.#authenticationInputEventHandler}\n ></ch-combo-box-render>\n </div>\n\n <div\n // username\n class=\"field field-block user-name\"\n >\n <label class=\"label\" htmlFor=\"username\">\n {this.#componentLocale.main.usernameLabel}\n </label>\n <ch-edit\n type=\"text\"\n id=\"username\"\n class=\"input\"\n value={this.gxServerConnectionData?.userName}\n onInput={this.#usernameInputEventHandler}\n ref={(el: HTMLChEditElement) =>\n (this.#usernameRef = el as HTMLChEditElement)\n }\n ></ch-edit>\n {this.#evaluateTooltipRender(this.#usernameRef)}\n </div>\n\n <div\n // user password\n class=\"field field-block user-password\"\n >\n <label class=\"label\" htmlFor=\"password\">\n {this.#componentLocale.main.passwordLabel}\n </label>\n <ch-edit\n type=\"password\"\n id=\"password\"\n class=\"input\"\n value={this.gxServerConnectionData?.userPassword}\n onInput={this.#passwordInputEventHandler}\n ref={(el: HTMLChEditElement) =>\n (this.#passwordRef = el as HTMLChEditElement)\n }\n ></ch-edit>\n {this.#evaluateTooltipRender(this.#passwordRef)}\n </div>\n </div>\n\n <footer class=\"control-footer-with-border spacing-body\">\n <div class=\"buttons-spacer\">\n <button\n // cancel button\n class=\"button-secondary\"\n onClick={this.#cancelClickHandler}\n >\n {this.#componentLocale.footer.cancelButtonCaption}\n </button>\n\n <button\n // connect button\n class=\"button-primary\"\n onClick={this.#connectClickHandler}\n >\n {this.#componentLocale.footer.connectButtonCaption}\n </button>\n </div>\n </footer>\n </section>\n </Host>\n );\n }\n}\n\nexport type GXServerConnectionData = {\n authenticationType: AuthenticationType;\n serverUrl: string;\n userName: string;\n userPassword: string;\n};\n\nexport type AuthenticationType = {\n id: string;\n name: string;\n};\n"]}
|
|
@@ -78,25 +78,23 @@ const HTMLGxIdeConnectGxServer = /*@__PURE__*/ proxyCustomElement(class HTMLGxId
|
|
|
78
78
|
((_c = this.validatableControls.get(controlReference.id)) === null || _c === void 0 ? void 0 : _c.message) && (h("ch-tooltip", { class: "tooltip", actionElement: controlReference, blockAlign: config.tooltipSettings.blockAlign, inlineAlign: config.tooltipSettings.inlineAlign, delay: config.tooltipSettings.delay }, this.validatableControls.get(controlReference.id).message));
|
|
79
79
|
});
|
|
80
80
|
_HTMLGxIdeConnectGxServer_init.set(this, () => {
|
|
81
|
-
var _a, _b, _c, _d, _e, _f
|
|
81
|
+
var _a, _b, _c, _d, _e, _f;
|
|
82
82
|
this.authenticationTypesChanged(this.authenticationTypes);
|
|
83
83
|
this.serverUrlsChanged(this.serverUrls);
|
|
84
84
|
// set initial values:
|
|
85
85
|
// server url
|
|
86
|
-
this.gxServerConnectionData.serverUrl =
|
|
87
|
-
((_a = this.defaultConnectionData) === null || _a === void 0 ? void 0 : _a.serverUrl) ||
|
|
88
|
-
((_b = this.serverUrlsComboBoxModel[0]) === null || _b === void 0 ? void 0 : _b.value);
|
|
86
|
+
this.gxServerConnectionData.serverUrl = "";
|
|
89
87
|
// authentication type
|
|
90
88
|
this.gxServerConnectionData.authenticationType = {
|
|
91
|
-
id: ((
|
|
92
|
-
((
|
|
93
|
-
name: ((
|
|
94
|
-
((
|
|
89
|
+
id: ((_a = this.defaultConnectionData) === null || _a === void 0 ? void 0 : _a.authenticationType.id) ||
|
|
90
|
+
((_b = this.authenticationTypesComboBoxModel[0]) === null || _b === void 0 ? void 0 : _b.value),
|
|
91
|
+
name: ((_c = this.defaultConnectionData) === null || _c === void 0 ? void 0 : _c.authenticationType.name) ||
|
|
92
|
+
((_d = this.authenticationTypesComboBoxModel[0]) === null || _d === void 0 ? void 0 : _d.caption)
|
|
95
93
|
};
|
|
96
94
|
// user name
|
|
97
|
-
this.gxServerConnectionData.userName = (
|
|
95
|
+
this.gxServerConnectionData.userName = (_e = this.defaultConnectionData) === null || _e === void 0 ? void 0 : _e.userName;
|
|
98
96
|
this.gxServerConnectionData.userPassword =
|
|
99
|
-
(
|
|
97
|
+
(_f = this.defaultConnectionData) === null || _f === void 0 ? void 0 : _f.userPassword;
|
|
100
98
|
});
|
|
101
99
|
_HTMLGxIdeConnectGxServer_initializeValidatableControls.set(this, () => {
|
|
102
100
|
// populate #controlsValidation with the controls that could have errors.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gx-ide-connect-gx-server.js","mappings":";;;;;AAGO,MAAM,oCAAoC,GAAG,CAClD,mBAAyC;IAEzC,OAAO,mBAAmB,CAAC,GAAG,CAAC,kBAAkB;QAC/C,OAAO;YACL,KAAK,EAAE,kBAAkB,CAAC,EAAE;YAC5B,OAAO,EAAE,kBAAkB,CAAC,IAAI;SACjC,CAAC;KACH,CAAC,CAAC;AAC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C3C,EAEN;;YAEE,KAAK,EAAC,iCAAiC;WAEvC,aAAO,KAAK,EAAC,OAAO,EAAC,OAAO,EAAC,UAAU,IACpC,uBAAA,IAAI,iDAAiB,CAAC,IAAI,CAAC,aAAa,CACnC,EACR,eACE,IAAI,EAAC,UAAU,EACf,EAAE,EAAC,UAAU,EACb,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,MAAA,IAAI,CAAC,sBAAsB,0CAAE,YAAY,EAChD,OAAO,EAAE,uBAAA,IAAI,2DAA2B,EACxC,GAAG,EAAE,CAAC,EAAqB,MACxB,uBAAA,IAAI,yCAAgB,EAAuB,MAAA,CAAC,GAEtC,EACV,uBAAA,IAAI,uDAAuB,MAA3B,IAAI,EAAwB,uBAAA,IAAI,6CAAa,CAAC,CAC3C,CACF,EAEN,cAAQ,KAAK,EAAC,yCAAyC,IACrD,WAAK,KAAK,EAAC,gBAAgB,IACzB;;YAEE,KAAK,EAAC,kBAAkB,EACxB,OAAO,EAAE,uBAAA,IAAI,oDAAoB;WAEhC,uBAAA,IAAI,iDAAiB,CAAC,MAAM,CAAC,mBAAmB,CAC1C,EAET;;YAEE,KAAK,EAAC,gBAAgB,EACtB,OAAO,EAAE,uBAAA,IAAI,qDAAqB;WAEjC,uBAAA,IAAI,iDAAiB,CAAC,MAAM,CAAC,oBAAoB,CAC3C,CACL,CACC,CACD,CACL,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/team-dev/connect-gx-server/helpers.ts","src/components/team-dev/connect-gx-server/connect-gx-server.scss?tag=gx-ide-connect-gx-server&encapsulation=shadow","src/components/team-dev/connect-gx-server/connect-gx-server.tsx"],"sourcesContent":["import { AuthenticationType } from \"./connect-gx-server\";\nimport { ComboBoxModel } from \"@genexus/chameleon-controls-library\";\n\nexport const mapAuthenticationTypeToComboBoxModel = (\n authenticationTypes: AuthenticationType[]\n): ComboBoxModel => {\n return authenticationTypes.map(authenticationType => {\n return {\n value: authenticationType.id,\n caption: authenticationType.name\n };\n });\n};\n\nexport const mapServerUrlsToComboBoxModel = (\n serverUrls: string[]\n): ComboBoxModel => {\n return serverUrls.map(serverUrl => {\n return {\n value: serverUrl,\n caption: serverUrl\n };\n });\n};\n",":host {\n display: grid;\n block-size: 100%;\n overflow: auto;\n grid-template-rows: 1fr max-content;\n}\n\n.main {\n display: grid;\n grid-template-areas:\n \"server-url server-url\"\n \"authentication-type .\"\n \"user-name user-password\";\n grid-auto-rows: max-content;\n grid-template-columns: 1fr 1fr;\n}\n\n.section {\n display: contents;\n}\n\n.authentication-type {\n grid-area: authentication-type;\n}\n.server-url {\n grid-area: server-url;\n}\n.user-name {\n grid-area: user-name;\n}\n.user-password {\n grid-area: user-password;\n}\n","// Stencil\nimport { Component, Host, h, Prop, Element, State, Watch } from \"@stencil/core\";\n\n// Other Libraries\nimport { ComboBoxModel } from \"@genexus/chameleon-controls-library\";\nimport { MercuryBundles } from \"@genexus/mercury\";\n\n// Custom Imports\nimport { config } from \"../../../common/config\";\nimport {\n mapAuthenticationTypeToComboBoxModel,\n mapServerUrlsToComboBoxModel\n} from \"./helpers\";\nimport { Locale } from \"../../../common/locale\";\nimport { FormSubmitResult } from \"../../../common/types\";\nimport {\n ControlValidation,\n validateControls\n} from \"../../../common/form-validation\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/tab\",\n \"components/tooltip\",\n \"utils/form--full\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\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 HTMLGxIdeConnectGxServer {\n /**\n * The component hard-coded strings translations.\n */\n // eslint-disable-next-line @stencil-community/own-props-must-be-private\n #componentLocale: any;\n\n @Element() el: HTMLGxIdeConnectGxServerElement;\n #usernameRef!: HTMLChEditElement;\n #passwordRef!: HTMLChEditElement;\n #serverUrlRef!: HTMLChComboBoxRenderElement;\n\n @State() authenticationTypesComboBoxModel: ComboBoxModel;\n @State() gxServerConnectionData: GXServerConnectionData = {\n authenticationType: {\n id: null,\n name: null\n },\n serverUrl: null,\n userName: null,\n userPassword: null\n };\n @State() serverUrlsComboBoxModel: ComboBoxModel;\n @State() validatableControls = new Map<string, ControlValidation>();\n\n /**\n * List of authentication types.\n */\n @Prop() readonly authenticationTypes!: AuthenticationType[];\n @Watch(\"authenticationTypes\")\n authenticationTypesChanged(newAuthenticationTypes: AuthenticationType[]) {\n if (newAuthenticationTypes?.length) {\n this.authenticationTypesComboBoxModel =\n mapAuthenticationTypeToComboBoxModel(newAuthenticationTypes);\n }\n }\n\n /**\n * Callback that must be invoked when the 'Cancel' button is pressed.\n */\n @Prop() readonly cancelCallback!: () => Promise<void>;\n\n /**\n * Callback that must be invoked when the 'Connect' button is pressed.\n */\n @Prop() readonly connectCallback!: (\n data: GXServerConnectionData\n ) => Promise<FormSubmitResult>;\n\n /**\n * Initial user values for the case in which the user returns to the login modal after successful authentication.\n */\n @Prop() readonly defaultConnectionData?: GXServerConnectionData;\n\n /**\n * true if the user should be allowed to manually enter a server URL.\n */\n @Prop() readonly enableCustomServer: boolean = false;\n\n /**\n * Array of cataloged server URLs to be displayed in the combo.\n */\n @Prop() readonly serverUrls: string[];\n @Watch(\"serverUrls\")\n serverUrlsChanged(newServerUrls: string[]) {\n if (newServerUrls?.length) {\n this.serverUrlsComboBoxModel =\n mapServerUrlsToComboBoxModel(newServerUrls);\n }\n }\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n\n this.#init();\n }\n\n async componentDidLoad() {\n this.#initializeValidatableControls();\n }\n\n #cancelClickHandler = () => {\n this.cancelCallback();\n };\n\n #connectClickHandler = async () => {\n this.connectCallback(this.gxServerConnectionData).then(\n (formSubmitResult: FormSubmitResult) => {\n this.validatableControls = validateControls(\n formSubmitResult,\n this.validatableControls\n );\n }\n );\n };\n\n // TODO: evaluate if this should be a global helper function.\n // It is used on other dialogs as well.\n #evaluateTooltipRender = (\n controlReference: HTMLElement\n ): HTMLChTooltipElement =>\n this.validatableControls?.get(controlReference?.id)?.hasError &&\n this.validatableControls.get(controlReference.id)?.message && (\n <ch-tooltip\n class=\"tooltip\"\n actionElement={controlReference as unknown as HTMLButtonElement}\n blockAlign={config.tooltipSettings.blockAlign}\n inlineAlign={config.tooltipSettings.inlineAlign}\n delay={config.tooltipSettings.delay}\n >\n {this.validatableControls.get(controlReference.id).message}\n </ch-tooltip>\n );\n\n #init = () => {\n this.authenticationTypesChanged(this.authenticationTypes);\n this.serverUrlsChanged(this.serverUrls);\n // set initial values:\n // server url\n this.gxServerConnectionData.serverUrl =\n this.defaultConnectionData?.serverUrl ||\n this.serverUrlsComboBoxModel[0]?.value;\n // authentication type\n this.gxServerConnectionData.authenticationType = {\n id:\n (this.defaultConnectionData?.authenticationType.id as string) ||\n this.authenticationTypesComboBoxModel[0]?.value,\n name:\n (this.defaultConnectionData?.authenticationType.name as string) ||\n this.authenticationTypesComboBoxModel[0]?.caption\n };\n\n // user name\n this.gxServerConnectionData.userName = this.defaultConnectionData?.userName;\n this.gxServerConnectionData.userPassword =\n this.defaultConnectionData?.userPassword;\n };\n\n #initializeValidatableControls = () => {\n // populate #controlsValidation with the controls that could have errors.\n const validatableControls: HTMLElement[] = [\n this.#usernameRef,\n this.#passwordRef,\n this.#serverUrlRef\n ];\n validatableControls.forEach(validatableControl => {\n if (validatableControl.id) {\n this.validatableControls.set(validatableControl.id, {\n reference: validatableControl,\n hasError: false,\n message: undefined\n });\n }\n });\n };\n\n // handlers that update this.gxServerConnectionData:\n #serverUrlInputEventHandler = (event: CustomEvent<string> | InputEvent) => {\n this.gxServerConnectionData.serverUrl = event.detail as string;\n };\n #authenticationInputEventHandler = (\n event: CustomEvent<string> | InputEvent\n ) => {\n const authenticationTypeId = event.detail as string;\n const authenticationTypeIndex = this.authenticationTypes.findIndex(\n authType => {\n return authType.id === authenticationTypeId;\n }\n );\n const authenticationTypeName =\n this.authenticationTypes[authenticationTypeIndex].name;\n\n this.gxServerConnectionData.authenticationType = {\n id: authenticationTypeId,\n name: authenticationTypeName\n };\n };\n #usernameInputEventHandler = (event: CustomEvent<string> | InputEvent) => {\n this.gxServerConnectionData.userName = event.detail as string;\n };\n #passwordInputEventHandler = (event: CustomEvent<string> | InputEvent) => {\n this.gxServerConnectionData.userPassword = event.detail as string;\n };\n\n render() {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n\n <section class=\"section\">\n <div class=\"main field-group spacing-body\">\n <div\n // server urls\n class=\"field field-block server-url\"\n >\n <label class=\"label\" htmlFor=\"server-url\">\n {this.#componentLocale.main.serverURLLabel}\n </label>\n <ch-combo-box-render\n id=\"server-url\"\n class=\"combo-box\"\n accessibleName=\"Server Url\"\n model={this.serverUrlsComboBoxModel}\n placeholder=\"Select a server URL\"\n value={this.gxServerConnectionData?.serverUrl}\n onChange={this.#serverUrlInputEventHandler}\n suggest={this.enableCustomServer}\n suggestOptions={{\n alreadyProcessed: false,\n autoExpand: false,\n hideMatchesAndShowNonMatches: false,\n highlightMatchedItems: false,\n matchCase: false,\n regularExpression: false,\n renderActiveItemIconOnExpand: true,\n strict: false\n }}\n ref={(el: HTMLChComboBoxRenderElement) =>\n (this.#serverUrlRef = el as HTMLChComboBoxRenderElement)\n }\n ></ch-combo-box-render>\n {this.#evaluateTooltipRender(this.#serverUrlRef)}\n </div>\n\n <div\n // authentication types\n class=\"field field-block authentication-type\"\n >\n <label class=\"label\" htmlFor=\"authentication-type\">\n {this.#componentLocale.main.authenticationTypeLabel}\n </label>\n <ch-combo-box-render\n id=\"authentication-type\"\n class=\"combo-box\"\n accessibleName=\"Authentication Types\"\n model={this.authenticationTypesComboBoxModel}\n placeholder=\"Select an authentication type\"\n value={this.gxServerConnectionData?.authenticationType.id}\n onInput={this.#authenticationInputEventHandler}\n ></ch-combo-box-render>\n </div>\n\n <div\n // username\n class=\"field field-block user-name\"\n >\n <label class=\"label\" htmlFor=\"username\">\n {this.#componentLocale.main.usernameLabel}\n </label>\n <ch-edit\n type=\"text\"\n id=\"username\"\n class=\"input\"\n value={this.gxServerConnectionData?.userName}\n onInput={this.#usernameInputEventHandler}\n ref={(el: HTMLChEditElement) =>\n (this.#usernameRef = el as HTMLChEditElement)\n }\n ></ch-edit>\n {this.#evaluateTooltipRender(this.#usernameRef)}\n </div>\n\n <div\n // user password\n class=\"field field-block user-password\"\n >\n <label class=\"label\" htmlFor=\"password\">\n {this.#componentLocale.main.passwordLabel}\n </label>\n <ch-edit\n type=\"password\"\n id=\"password\"\n class=\"input\"\n value={this.gxServerConnectionData?.userPassword}\n onInput={this.#passwordInputEventHandler}\n ref={(el: HTMLChEditElement) =>\n (this.#passwordRef = el as HTMLChEditElement)\n }\n ></ch-edit>\n {this.#evaluateTooltipRender(this.#passwordRef)}\n </div>\n </div>\n\n <footer class=\"control-footer-with-border spacing-body\">\n <div class=\"buttons-spacer\">\n <button\n // cancel button\n class=\"button-secondary\"\n onClick={this.#cancelClickHandler}\n >\n {this.#componentLocale.footer.cancelButtonCaption}\n </button>\n\n <button\n // connect button\n class=\"button-primary\"\n onClick={this.#connectClickHandler}\n >\n {this.#componentLocale.footer.connectButtonCaption}\n </button>\n </div>\n </footer>\n </section>\n </Host>\n );\n }\n}\n\nexport type GXServerConnectionData = {\n authenticationType: AuthenticationType;\n serverUrl: string;\n userName: string;\n userPassword: string;\n};\n\nexport type AuthenticationType = {\n id: string;\n name: string;\n};\n"],"version":3}
|
|
1
|
+
{"file":"gx-ide-connect-gx-server.js","mappings":";;;;;AAGO,MAAM,oCAAoC,GAAG,CAClD,mBAAyC;IAEzC,OAAO,mBAAmB,CAAC,GAAG,CAAC,kBAAkB;QAC/C,OAAO;YACL,KAAK,EAAE,kBAAkB,CAAC,EAAE;YAC5B,OAAO,EAAE,kBAAkB,CAAC,IAAI;SACjC,C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UAAU,IACpC,uBAAA,IAAI,iDAAiB,CAAC,IAAI,CAAC,aAAa,CACnC,EACR,eACE,IAAI,EAAC,UAAU,EACf,EAAE,EAAC,UAAU,EACb,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,MAAA,IAAI,CAAC,sBAAsB,0CAAE,YAAY,EAChD,OAAO,EAAE,uBAAA,IAAI,2DAA2B,EACxC,GAAG,EAAE,CAAC,EAAqB,MACxB,uBAAA,IAAI,yCAAgB,EAAuB,MAAA,CAAC,GAEtC,EACV,uBAAA,IAAI,uDAAuB,MAA3B,IAAI,EAAwB,uBAAA,IAAI,6CAAa,CAAC,CAC3C,CACF,EAEN,cAAQ,KAAK,EAAC,yCAAyC,IACrD,WAAK,KAAK,EAAC,gBAAgB,IACzB;;YAEE,KAAK,EAAC,kBAAkB,EACxB,OAAO,EAAE,uBAAA,IAAI,oDAAoB;WAEhC,uBAAA,IAAI,iDAAiB,CAAC,MAAM,CAAC,mBAAmB,CAC1C,EAET;;YAEE,KAAK,EAAC,gBAAgB,EACtB,OAAO,EAAE,uBAAA,IAAI,qDAAqB;WAEjC,uBAAA,IAAI,iDAAiB,CAAC,MAAM,CAAC,oBAAoB,CAC3C,CACL,CACC,CACD,CACL,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/team-dev/connect-gx-server/helpers.ts","src/components/team-dev/connect-gx-server/connect-gx-server.scss?tag=gx-ide-connect-gx-server&encapsulation=shadow","src/components/team-dev/connect-gx-server/connect-gx-server.tsx"],"sourcesContent":["import { AuthenticationType } from \"./connect-gx-server\";\nimport { ComboBoxModel } from \"@genexus/chameleon-controls-library\";\n\nexport const mapAuthenticationTypeToComboBoxModel = (\n authenticationTypes: AuthenticationType[]\n): ComboBoxModel => {\n return authenticationTypes.map(authenticationType => {\n return {\n value: authenticationType.id,\n caption: authenticationType.name\n };\n });\n};\n\nexport const mapServerUrlsToComboBoxModel = (\n serverUrls: string[]\n): ComboBoxModel => {\n return serverUrls.map(serverUrl => {\n return {\n value: serverUrl,\n caption: serverUrl\n };\n });\n};\n",":host {\n display: grid;\n block-size: 100%;\n overflow: auto;\n grid-template-rows: 1fr max-content;\n}\n\n.main {\n display: grid;\n grid-template-areas:\n \"server-url server-url\"\n \"authentication-type .\"\n \"user-name user-password\";\n grid-auto-rows: max-content;\n grid-template-columns: 1fr 1fr;\n}\n\n.section {\n display: contents;\n}\n\n.authentication-type {\n grid-area: authentication-type;\n}\n.server-url {\n grid-area: server-url;\n}\n.user-name {\n grid-area: user-name;\n}\n.user-password {\n grid-area: user-password;\n}\n","// Stencil\nimport { Component, Host, h, Prop, Element, State, Watch } from \"@stencil/core\";\n\n// Other Libraries\nimport { ComboBoxModel } from \"@genexus/chameleon-controls-library\";\nimport { MercuryBundles } from \"@genexus/mercury\";\n\n// Custom Imports\nimport { config } from \"../../../common/config\";\nimport {\n mapAuthenticationTypeToComboBoxModel,\n mapServerUrlsToComboBoxModel\n} from \"./helpers\";\nimport { Locale } from \"../../../common/locale\";\nimport { FormSubmitResult } from \"../../../common/types\";\nimport {\n ControlValidation,\n validateControls\n} from \"../../../common/form-validation\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/tab\",\n \"components/tooltip\",\n \"utils/form--full\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\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 HTMLGxIdeConnectGxServer {\n /**\n * The component hard-coded strings translations.\n */\n // eslint-disable-next-line @stencil-community/own-props-must-be-private\n #componentLocale: any;\n\n @Element() el: HTMLGxIdeConnectGxServerElement;\n #usernameRef!: HTMLChEditElement;\n #passwordRef!: HTMLChEditElement;\n #serverUrlRef!: HTMLChComboBoxRenderElement;\n\n @State() authenticationTypesComboBoxModel: ComboBoxModel;\n @State() gxServerConnectionData: GXServerConnectionData = {\n authenticationType: {\n id: null,\n name: null\n },\n serverUrl: null,\n userName: null,\n userPassword: null\n };\n @State() serverUrlsComboBoxModel: ComboBoxModel;\n @State() validatableControls = new Map<string, ControlValidation>();\n\n /**\n * List of authentication types.\n */\n @Prop() readonly authenticationTypes!: AuthenticationType[];\n @Watch(\"authenticationTypes\")\n authenticationTypesChanged(newAuthenticationTypes: AuthenticationType[]) {\n if (newAuthenticationTypes?.length) {\n this.authenticationTypesComboBoxModel =\n mapAuthenticationTypeToComboBoxModel(newAuthenticationTypes);\n }\n }\n\n /**\n * Callback that must be invoked when the 'Cancel' button is pressed.\n */\n @Prop() readonly cancelCallback!: () => Promise<void>;\n\n /**\n * Callback that must be invoked when the 'Connect' button is pressed.\n */\n @Prop() readonly connectCallback!: (\n data: GXServerConnectionData\n ) => Promise<FormSubmitResult>;\n\n /**\n * Initial user values for the case in which the user returns to the login modal after successful authentication.\n */\n @Prop() readonly defaultConnectionData?: GXServerConnectionData;\n\n /**\n * true if the user should be allowed to manually enter a server URL.\n */\n @Prop() readonly enableCustomServer: boolean = false;\n\n /**\n * Array of cataloged server URLs to be displayed in the combo.\n */\n @Prop() readonly serverUrls: string[];\n @Watch(\"serverUrls\")\n serverUrlsChanged(newServerUrls: string[]) {\n if (newServerUrls?.length) {\n this.serverUrlsComboBoxModel =\n mapServerUrlsToComboBoxModel(newServerUrls);\n }\n }\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n\n this.#init();\n }\n\n async componentDidLoad() {\n this.#initializeValidatableControls();\n }\n\n #cancelClickHandler = () => {\n this.cancelCallback();\n };\n\n #connectClickHandler = async () => {\n this.connectCallback(this.gxServerConnectionData).then(\n (formSubmitResult: FormSubmitResult) => {\n this.validatableControls = validateControls(\n formSubmitResult,\n this.validatableControls\n );\n }\n );\n };\n\n // TODO: evaluate if this should be a global helper function.\n // It is used on other dialogs as well.\n #evaluateTooltipRender = (\n controlReference: HTMLElement\n ): HTMLChTooltipElement =>\n this.validatableControls?.get(controlReference?.id)?.hasError &&\n this.validatableControls.get(controlReference.id)?.message && (\n <ch-tooltip\n class=\"tooltip\"\n actionElement={controlReference as unknown as HTMLButtonElement}\n blockAlign={config.tooltipSettings.blockAlign}\n inlineAlign={config.tooltipSettings.inlineAlign}\n delay={config.tooltipSettings.delay}\n >\n {this.validatableControls.get(controlReference.id).message}\n </ch-tooltip>\n );\n\n #init = () => {\n this.authenticationTypesChanged(this.authenticationTypes);\n this.serverUrlsChanged(this.serverUrls);\n // set initial values:\n // server url\n this.gxServerConnectionData.serverUrl = \"\";\n // authentication type\n this.gxServerConnectionData.authenticationType = {\n id:\n (this.defaultConnectionData?.authenticationType.id as string) ||\n this.authenticationTypesComboBoxModel[0]?.value,\n name:\n (this.defaultConnectionData?.authenticationType.name as string) ||\n this.authenticationTypesComboBoxModel[0]?.caption\n };\n\n // user name\n this.gxServerConnectionData.userName = this.defaultConnectionData?.userName;\n this.gxServerConnectionData.userPassword =\n this.defaultConnectionData?.userPassword;\n };\n\n #initializeValidatableControls = () => {\n // populate #controlsValidation with the controls that could have errors.\n const validatableControls: HTMLElement[] = [\n this.#usernameRef,\n this.#passwordRef,\n this.#serverUrlRef\n ];\n validatableControls.forEach(validatableControl => {\n if (validatableControl.id) {\n this.validatableControls.set(validatableControl.id, {\n reference: validatableControl,\n hasError: false,\n message: undefined\n });\n }\n });\n };\n\n // handlers that update this.gxServerConnectionData:\n #serverUrlInputEventHandler = (event: CustomEvent<string> | InputEvent) => {\n this.gxServerConnectionData.serverUrl = event.detail as string;\n };\n #authenticationInputEventHandler = (\n event: CustomEvent<string> | InputEvent\n ) => {\n const authenticationTypeId = event.detail as string;\n const authenticationTypeIndex = this.authenticationTypes.findIndex(\n authType => {\n return authType.id === authenticationTypeId;\n }\n );\n const authenticationTypeName =\n this.authenticationTypes[authenticationTypeIndex].name;\n\n this.gxServerConnectionData.authenticationType = {\n id: authenticationTypeId,\n name: authenticationTypeName\n };\n };\n #usernameInputEventHandler = (event: CustomEvent<string> | InputEvent) => {\n this.gxServerConnectionData.userName = event.detail as string;\n };\n #passwordInputEventHandler = (event: CustomEvent<string> | InputEvent) => {\n this.gxServerConnectionData.userPassword = event.detail as string;\n };\n\n render() {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n\n <section class=\"section\">\n <div class=\"main field-group spacing-body\">\n <div\n // server urls\n class=\"field field-block server-url\"\n >\n <label class=\"label\" htmlFor=\"server-url\">\n {this.#componentLocale.main.serverURLLabel}\n </label>\n <ch-combo-box-render\n id=\"server-url\"\n class=\"combo-box\"\n accessibleName=\"Server Url\"\n model={this.serverUrlsComboBoxModel}\n placeholder=\"Select a server URL\"\n value={this.gxServerConnectionData?.serverUrl}\n onChange={this.#serverUrlInputEventHandler}\n suggest={this.enableCustomServer}\n suggestOptions={{\n alreadyProcessed: false,\n autoExpand: false,\n hideMatchesAndShowNonMatches: false,\n highlightMatchedItems: false,\n matchCase: false,\n regularExpression: false,\n renderActiveItemIconOnExpand: true,\n strict: false\n }}\n ref={(el: HTMLChComboBoxRenderElement) =>\n (this.#serverUrlRef = el as HTMLChComboBoxRenderElement)\n }\n ></ch-combo-box-render>\n {this.#evaluateTooltipRender(this.#serverUrlRef)}\n </div>\n\n <div\n // authentication types\n class=\"field field-block authentication-type\"\n >\n <label class=\"label\" htmlFor=\"authentication-type\">\n {this.#componentLocale.main.authenticationTypeLabel}\n </label>\n <ch-combo-box-render\n id=\"authentication-type\"\n class=\"combo-box\"\n accessibleName=\"Authentication Types\"\n model={this.authenticationTypesComboBoxModel}\n placeholder=\"Select an authentication type\"\n value={this.gxServerConnectionData?.authenticationType.id}\n onInput={this.#authenticationInputEventHandler}\n ></ch-combo-box-render>\n </div>\n\n <div\n // username\n class=\"field field-block user-name\"\n >\n <label class=\"label\" htmlFor=\"username\">\n {this.#componentLocale.main.usernameLabel}\n </label>\n <ch-edit\n type=\"text\"\n id=\"username\"\n class=\"input\"\n value={this.gxServerConnectionData?.userName}\n onInput={this.#usernameInputEventHandler}\n ref={(el: HTMLChEditElement) =>\n (this.#usernameRef = el as HTMLChEditElement)\n }\n ></ch-edit>\n {this.#evaluateTooltipRender(this.#usernameRef)}\n </div>\n\n <div\n // user password\n class=\"field field-block user-password\"\n >\n <label class=\"label\" htmlFor=\"password\">\n {this.#componentLocale.main.passwordLabel}\n </label>\n <ch-edit\n type=\"password\"\n id=\"password\"\n class=\"input\"\n value={this.gxServerConnectionData?.userPassword}\n onInput={this.#passwordInputEventHandler}\n ref={(el: HTMLChEditElement) =>\n (this.#passwordRef = el as HTMLChEditElement)\n }\n ></ch-edit>\n {this.#evaluateTooltipRender(this.#passwordRef)}\n </div>\n </div>\n\n <footer class=\"control-footer-with-border spacing-body\">\n <div class=\"buttons-spacer\">\n <button\n // cancel button\n class=\"button-secondary\"\n onClick={this.#cancelClickHandler}\n >\n {this.#componentLocale.footer.cancelButtonCaption}\n </button>\n\n <button\n // connect button\n class=\"button-primary\"\n onClick={this.#connectClickHandler}\n >\n {this.#componentLocale.footer.connectButtonCaption}\n </button>\n </div>\n </footer>\n </section>\n </Host>\n );\n }\n}\n\nexport type GXServerConnectionData = {\n authenticationType: AuthenticationType;\n serverUrl: string;\n userName: string;\n userPassword: string;\n};\n\nexport type AuthenticationType = {\n id: string;\n name: string;\n};\n"],"version":3}
|
|
@@ -2,6 +2,7 @@ import { proxyCustomElement, HTMLElement, getAssetPath, h, Host } from '@stencil
|
|
|
2
2
|
import { g as getIconPath } from './MERCURY_ASSETS.js';
|
|
3
3
|
import { c as config } from './config.js';
|
|
4
4
|
import { L as Locale } from './locale.js';
|
|
5
|
+
import { v as validateControls } from './form-validation.js';
|
|
5
6
|
import { d as defineCustomElement$2 } from './entity-selector.js';
|
|
6
7
|
|
|
7
8
|
const jsonImportCss = ":host{display:grid;grid-template-rows:max-content 1fr max-content;block-size:100%;overflow:auto}.section{display:contents}.main{display:grid;grid-template-rows:1fr max-content;overflow:auto}.field-group-name-description-module{grid-template-areas:\"name-label name-input\" \"description-label description-input\" \"module-label module-entity-selector\";grid-template-columns:max-content 1fr}.name-label{grid-area:name-label}.name-input{grid-area:name-input}.description-label{grid-area:description-label}.description-input{grid-area:description-input}.module-label{grid-area:module-label}.module-entity-selector{grid-area:module-entity-selector}.radio-file-input-wrapper{grid-template-columns:max-content 1fr}div.field-file-input{grid-template-columns:1fr max-content}.json-area{display:grid;grid-template-rows:1fr max-content;overflow:auto}.slotted-container{overflow:auto;block-size:100%}.input-file{display:grid;grid-template-columns:1fr max-content}.radio-group{gap:30px !important}.tooltip{height:0px}";
|
|
@@ -22,7 +23,7 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
|
|
|
22
23
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
23
24
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
24
25
|
};
|
|
25
|
-
var _GxIdeJsonImport_componentLocale, _GxIdeJsonImport_data, _GxIdeJsonImport_radioOptionsModel, _GxIdeJsonImport_shortcutsSrc, _GxIdeJsonImport_checkBoxEl, _GxIdeJsonImport_chShortcutsEl, _GxIdeJsonImport_descriptionEl, _GxIdeJsonImport_fileInputHiddenEl, _GxIdeJsonImport_moduleEntitySelector, _GxIdeJsonImport_nameEl, _GxIdeJsonImport_radioGroup, _GxIdeJsonImport_validateForm, _GxIdeJsonImport_nameChangedHandler, _GxIdeJsonImport_changeRadioHandler, _GxIdeJsonImport_createHandler, _GxIdeJsonImport_removeFileSelection, _GxIdeJsonImport_selectFileInputChangedHandler, _GxIdeJsonImport_selectFileInputHandler, _GxIdeJsonImport_handleEditorChange, _GxIdeJsonImport_handleSlotChange;
|
|
26
|
+
var _GxIdeJsonImport_componentLocale, _GxIdeJsonImport_data, _GxIdeJsonImport_radioOptionsModel, _GxIdeJsonImport_shortcutsSrc, _GxIdeJsonImport_checkBoxEl, _GxIdeJsonImport_chShortcutsEl, _GxIdeJsonImport_descriptionEl, _GxIdeJsonImport_fileInputHiddenEl, _GxIdeJsonImport_moduleEntitySelector, _GxIdeJsonImport_nameEl, _GxIdeJsonImport_radioGroup, _GxIdeJsonImport_initializeValidatableControls, _GxIdeJsonImport_evaluateTooltipRender, _GxIdeJsonImport_validateForm, _GxIdeJsonImport_nameChangedHandler, _GxIdeJsonImport_changeRadioHandler, _GxIdeJsonImport_createHandler, _GxIdeJsonImport_removeFileSelection, _GxIdeJsonImport_selectFileInputChangedHandler, _GxIdeJsonImport_selectFileInputHandler, _GxIdeJsonImport_handleEditorChange, _GxIdeJsonImport_handleSlotChange;
|
|
26
27
|
const CSS_BUNDLES = [
|
|
27
28
|
"resets/box-sizing",
|
|
28
29
|
"components/tab",
|
|
@@ -65,6 +66,26 @@ const GxIdeJsonImport$1 = /*@__PURE__*/ proxyCustomElement(class GxIdeJsonImport
|
|
|
65
66
|
_GxIdeJsonImport_moduleEntitySelector.set(this, void 0);
|
|
66
67
|
_GxIdeJsonImport_nameEl.set(this, void 0);
|
|
67
68
|
_GxIdeJsonImport_radioGroup.set(this, void 0);
|
|
69
|
+
_GxIdeJsonImport_initializeValidatableControls.set(this, () => {
|
|
70
|
+
const validatableControls = [
|
|
71
|
+
__classPrivateFieldGet(this, _GxIdeJsonImport_nameEl, "f"),
|
|
72
|
+
__classPrivateFieldGet(this, _GxIdeJsonImport_moduleEntitySelector, "f")
|
|
73
|
+
];
|
|
74
|
+
validatableControls.forEach(validatableControl => {
|
|
75
|
+
if (validatableControl.id) {
|
|
76
|
+
this.validatableControls.set(validatableControl.id, {
|
|
77
|
+
reference: validatableControl,
|
|
78
|
+
hasError: false,
|
|
79
|
+
message: undefined
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
_GxIdeJsonImport_evaluateTooltipRender.set(this, (controlReference) => {
|
|
85
|
+
var _a, _b, _c;
|
|
86
|
+
return ((_b = (_a = this.validatableControls) === null || _a === void 0 ? void 0 : _a.get(controlReference === null || controlReference === void 0 ? void 0 : controlReference.id)) === null || _b === void 0 ? void 0 : _b.hasError) &&
|
|
87
|
+
((_c = this.validatableControls.get(controlReference.id)) === null || _c === void 0 ? void 0 : _c.message) && (h("ch-tooltip", { class: "tooltip", actionElement: controlReference, blockAlign: config.tooltipSettings.blockAlign, inlineAlign: config.tooltipSettings.inlineAlign, delay: config.tooltipSettings.delay }, this.validatableControls.get(controlReference.id).message));
|
|
88
|
+
});
|
|
68
89
|
_GxIdeJsonImport_validateForm.set(this, () => {
|
|
69
90
|
var _a, _b;
|
|
70
91
|
const name = ((_b = (_a = __classPrivateFieldGet(this, _GxIdeJsonImport_nameEl, "f")) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.trim()) || "";
|
|
@@ -102,7 +123,7 @@ const GxIdeJsonImport$1 = /*@__PURE__*/ proxyCustomElement(class GxIdeJsonImport
|
|
|
102
123
|
__classPrivateFieldGet(this, _GxIdeJsonImport_data, "f").parentId = (_a = __classPrivateFieldGet(this, _GxIdeJsonImport_moduleEntitySelector, "f").value) === null || _a === void 0 ? void 0 : _a.id;
|
|
103
124
|
__classPrivateFieldGet(this, _GxIdeJsonImport_data, "f").assumeVarcharForNull = __classPrivateFieldGet(this, _GxIdeJsonImport_checkBoxEl, "f").value === "true";
|
|
104
125
|
this.confirmCallback(__classPrivateFieldGet(this, _GxIdeJsonImport_data, "f")).then((formSubmitResult) => {
|
|
105
|
-
this.
|
|
126
|
+
this.validatableControls = validateControls(formSubmitResult, this.validatableControls);
|
|
106
127
|
});
|
|
107
128
|
});
|
|
108
129
|
_GxIdeJsonImport_removeFileSelection.set(this, () => {
|
|
@@ -143,9 +164,9 @@ const GxIdeJsonImport$1 = /*@__PURE__*/ proxyCustomElement(class GxIdeJsonImport
|
|
|
143
164
|
});
|
|
144
165
|
this.fileName = undefined;
|
|
145
166
|
this.radioGroupValue = "file";
|
|
146
|
-
this.showTooltipError = false;
|
|
147
167
|
this.isFormValid = false;
|
|
148
168
|
this.jsonContent = "";
|
|
169
|
+
this.validatableControls = new Map();
|
|
149
170
|
this.cancelCallback = undefined;
|
|
150
171
|
this.confirmCallback = undefined;
|
|
151
172
|
this.defaultParent = undefined;
|
|
@@ -168,6 +189,9 @@ const GxIdeJsonImport$1 = /*@__PURE__*/ proxyCustomElement(class GxIdeJsonImport
|
|
|
168
189
|
{ value: "text", caption: __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").main.jsonAreaLabel }
|
|
169
190
|
], "f");
|
|
170
191
|
}
|
|
192
|
+
componentDidLoad() {
|
|
193
|
+
__classPrivateFieldGet(this, _GxIdeJsonImport_initializeValidatableControls, "f").call(this);
|
|
194
|
+
}
|
|
171
195
|
/**
|
|
172
196
|
* Suspends or reactivates the shortcuts
|
|
173
197
|
*/
|
|
@@ -178,16 +202,16 @@ const GxIdeJsonImport$1 = /*@__PURE__*/ proxyCustomElement(class GxIdeJsonImport
|
|
|
178
202
|
return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("ch-shortcuts", { src: __classPrivateFieldGet(this, _GxIdeJsonImport_shortcutsSrc, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeJsonImport_chShortcutsEl, el, "f")) }), h("section", { class: "section" }, h("header", { class: "header field-group spacing-body control-header-with-border" }, h("div", { class: "field-group field-group-name-description-module" }, h("label", {
|
|
179
203
|
// name
|
|
180
204
|
class: "label name-label", htmlFor: "input-name"
|
|
181
|
-
}, __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").header.nameFieldLabel), h("ch-edit", { class: "input name-input", id: "input-name", ref: (el) => (__classPrivateFieldSet(this, _GxIdeJsonImport_nameEl, el, "f")), onInput: __classPrivateFieldGet(this, _GxIdeJsonImport_nameChangedHandler, "f") }), h("label", {
|
|
205
|
+
}, __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").header.nameFieldLabel), h("ch-edit", { class: "input name-input", id: "input-name", ref: (el) => (__classPrivateFieldSet(this, _GxIdeJsonImport_nameEl, el, "f")), onInput: __classPrivateFieldGet(this, _GxIdeJsonImport_nameChangedHandler, "f") }), __classPrivateFieldGet(this, _GxIdeJsonImport_evaluateTooltipRender, "f").call(this, __classPrivateFieldGet(this, _GxIdeJsonImport_nameEl, "f")), h("label", {
|
|
182
206
|
// description
|
|
183
207
|
class: "label description-label", htmlFor: "input-description"
|
|
184
208
|
}, __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").header.descriptionFieldLabel), h("ch-edit", { class: "input description-input", id: "input-description", ref: (el) => (__classPrivateFieldSet(this, _GxIdeJsonImport_descriptionEl, el, "f")) }), h("label", {
|
|
185
209
|
// module/folder
|
|
186
210
|
class: "label module-label", htmlFor: "input-module"
|
|
187
|
-
}, __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").header.moduleFolderLabel), h("gx-ide-entity-selector", { class: "module module-entity-selector", id: "module", value: this.defaultParent, ref: (el) => (__classPrivateFieldSet(this, _GxIdeJsonImport_moduleEntitySelector, el, "f")), labelPosition: "none", defaultValue: this.defaultParent, selectEntityCallback: this.selectModuleCallback })), h("div", { class: "radio-file-input-wrapper field-group" }, h("ch-radio-group-render", {
|
|
211
|
+
}, __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").header.moduleFolderLabel), h("gx-ide-entity-selector", { class: "module module-entity-selector", id: "module", value: this.defaultParent, ref: (el) => (__classPrivateFieldSet(this, _GxIdeJsonImport_moduleEntitySelector, el, "f")), labelPosition: "none", defaultValue: this.defaultParent, selectEntityCallback: this.selectModuleCallback }), __classPrivateFieldGet(this, _GxIdeJsonImport_evaluateTooltipRender, "f").call(this, __classPrivateFieldGet(this, _GxIdeJsonImport_moduleEntitySelector, "f"))), h("div", { class: "radio-file-input-wrapper field-group" }, h("ch-radio-group-render", {
|
|
188
212
|
// file url/text
|
|
189
213
|
class: "radio-group", model: __classPrivateFieldGet(this, _GxIdeJsonImport_radioOptionsModel, "f"), onChange: __classPrivateFieldGet(this, _GxIdeJsonImport_changeRadioHandler, "f"), value: this.defaultRadioValue, ref: (el) => (__classPrivateFieldSet(this, _GxIdeJsonImport_radioGroup, el, "f"))
|
|
190
|
-
}), h("div", { class: "field field-inline field-file-input" }, h("ch-edit", { autoFocus: true, id: "file-name", class: "input", part: "file-name", type: "text", value: this.fileName, readonly: true, placeholder: __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").header.fileNamePlaceholder, startImgSrc: FILE_ICON, disabled: this.radioGroupValue !== "file" }), h("input", { hidden: true, type: "file", accept: ".json", onChange: __classPrivateFieldGet(this, _GxIdeJsonImport_selectFileInputChangedHandler, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeJsonImport_fileInputHiddenEl, el, "f")) }), h("div", { class: "buttons-spacer" }, h("button", { "aria-label": __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").header.removeFileSelection, title: __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").header.removeFileSelection, id: "reset-all-button", class: "button-tertiary button-icon-only", part: "reset-all-button", onClick: __classPrivateFieldGet(this, _GxIdeJsonImport_removeFileSelection, "f"), disabled: this.radioGroupValue !== "file" }, h("ch-image", { class: "icon-md", src: MENU_DELETE })), h("button", { id: "select-file-load-button", class: "button-primary", part: "select-file-load-button", onClick: __classPrivateFieldGet(this, _GxIdeJsonImport_selectFileInputHandler, "f"), disabled: this.radioGroupValue !== "file" }, __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").header.selectfileButton))))), h("div", { class: "main field-group" }, h("div", { class: "json-area" }, h("div", { class: "slotted-container scrollable" }, h("slot", { name: "JsonTextEditor", onSlotchange: __classPrivateFieldGet(this, _GxIdeJsonImport_handleSlotChange, "f") }))
|
|
214
|
+
}), h("div", { class: "field field-inline field-file-input" }, h("ch-edit", { autoFocus: true, id: "file-name", class: "input", part: "file-name", type: "text", value: this.fileName, readonly: true, placeholder: __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").header.fileNamePlaceholder, startImgSrc: FILE_ICON, disabled: this.radioGroupValue !== "file" }), h("input", { hidden: true, type: "file", accept: ".json", onChange: __classPrivateFieldGet(this, _GxIdeJsonImport_selectFileInputChangedHandler, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeJsonImport_fileInputHiddenEl, el, "f")) }), h("div", { class: "buttons-spacer" }, h("button", { "aria-label": __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").header.removeFileSelection, title: __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").header.removeFileSelection, id: "reset-all-button", class: "button-tertiary button-icon-only", part: "reset-all-button", onClick: __classPrivateFieldGet(this, _GxIdeJsonImport_removeFileSelection, "f"), disabled: this.radioGroupValue !== "file" }, h("ch-image", { class: "icon-md", src: MENU_DELETE })), h("button", { id: "select-file-load-button", class: "button-primary", part: "select-file-load-button", onClick: __classPrivateFieldGet(this, _GxIdeJsonImport_selectFileInputHandler, "f"), disabled: this.radioGroupValue !== "file" }, __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").header.selectfileButton))))), h("div", { class: "main field-group" }, h("div", { class: "json-area" }, h("div", { class: "slotted-container scrollable" }, h("slot", { name: "JsonTextEditor", onSlotchange: __classPrivateFieldGet(this, _GxIdeJsonImport_handleSlotChange, "f") }))), h("ch-checkbox", { class: "checkbox spacing-body-block-end spacing-body-inline-start", caption: __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").main.checkBoxLabel, checkedValue: "true", ref: (el) => (__classPrivateFieldSet(this, _GxIdeJsonImport_checkBoxEl, el, "f")) })), h("footer", { class: "control-footer control-footer-with-border spacing-body-block-end spacing-body-inline" }, h("div", { class: "buttons-spacer" }, h("button", { class: "button-secondary", id: "button-cancel", onClick: this.cancelCallback, part: "button-cancel" }, __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").footer.btnCancel), h("button", { class: "button-primary", id: "button-ok", onClick: __classPrivateFieldGet(this, _GxIdeJsonImport_createHandler, "f"), part: "button-ok", disabled: !this.isFormValid }, __classPrivateFieldGet(this, _GxIdeJsonImport_componentLocale, "f").footer.btnOk))))));
|
|
191
215
|
}
|
|
192
216
|
static get assetsDirs() { return ["gx-ide-assets/json-import"]; }
|
|
193
217
|
get el() { return this; }
|
|
@@ -206,12 +230,12 @@ const GxIdeJsonImport$1 = /*@__PURE__*/ proxyCustomElement(class GxIdeJsonImport
|
|
|
206
230
|
"onJsonContentChange": [16],
|
|
207
231
|
"fileName": [32],
|
|
208
232
|
"radioGroupValue": [32],
|
|
209
|
-
"showTooltipError": [32],
|
|
210
233
|
"isFormValid": [32],
|
|
211
234
|
"jsonContent": [32],
|
|
235
|
+
"validatableControls": [32],
|
|
212
236
|
"suspendShortcuts": [64]
|
|
213
237
|
}]);
|
|
214
|
-
_GxIdeJsonImport_componentLocale = new WeakMap(), _GxIdeJsonImport_data = new WeakMap(), _GxIdeJsonImport_radioOptionsModel = new WeakMap(), _GxIdeJsonImport_shortcutsSrc = new WeakMap(), _GxIdeJsonImport_checkBoxEl = new WeakMap(), _GxIdeJsonImport_chShortcutsEl = new WeakMap(), _GxIdeJsonImport_descriptionEl = new WeakMap(), _GxIdeJsonImport_fileInputHiddenEl = new WeakMap(), _GxIdeJsonImport_moduleEntitySelector = new WeakMap(), _GxIdeJsonImport_nameEl = new WeakMap(), _GxIdeJsonImport_radioGroup = new WeakMap(), _GxIdeJsonImport_validateForm = new WeakMap(), _GxIdeJsonImport_nameChangedHandler = new WeakMap(), _GxIdeJsonImport_changeRadioHandler = new WeakMap(), _GxIdeJsonImport_createHandler = new WeakMap(), _GxIdeJsonImport_removeFileSelection = new WeakMap(), _GxIdeJsonImport_selectFileInputChangedHandler = new WeakMap(), _GxIdeJsonImport_selectFileInputHandler = new WeakMap(), _GxIdeJsonImport_handleEditorChange = new WeakMap(), _GxIdeJsonImport_handleSlotChange = new WeakMap();
|
|
238
|
+
_GxIdeJsonImport_componentLocale = new WeakMap(), _GxIdeJsonImport_data = new WeakMap(), _GxIdeJsonImport_radioOptionsModel = new WeakMap(), _GxIdeJsonImport_shortcutsSrc = new WeakMap(), _GxIdeJsonImport_checkBoxEl = new WeakMap(), _GxIdeJsonImport_chShortcutsEl = new WeakMap(), _GxIdeJsonImport_descriptionEl = new WeakMap(), _GxIdeJsonImport_fileInputHiddenEl = new WeakMap(), _GxIdeJsonImport_moduleEntitySelector = new WeakMap(), _GxIdeJsonImport_nameEl = new WeakMap(), _GxIdeJsonImport_radioGroup = new WeakMap(), _GxIdeJsonImport_initializeValidatableControls = new WeakMap(), _GxIdeJsonImport_evaluateTooltipRender = new WeakMap(), _GxIdeJsonImport_validateForm = new WeakMap(), _GxIdeJsonImport_nameChangedHandler = new WeakMap(), _GxIdeJsonImport_changeRadioHandler = new WeakMap(), _GxIdeJsonImport_createHandler = new WeakMap(), _GxIdeJsonImport_removeFileSelection = new WeakMap(), _GxIdeJsonImport_selectFileInputChangedHandler = new WeakMap(), _GxIdeJsonImport_selectFileInputHandler = new WeakMap(), _GxIdeJsonImport_handleEditorChange = new WeakMap(), _GxIdeJsonImport_handleSlotChange = new WeakMap();
|
|
215
239
|
function defineCustomElement$1() {
|
|
216
240
|
if (typeof customElements === "undefined") {
|
|
217
241
|
return;
|