@genexus/genexus-ide-ui 3.0.2 → 3.1.1
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-file-item.cjs.entry.js +21 -2
- package/dist/cjs/gx-ide-file-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-file-uploader.cjs.entry.js +11 -8
- package/dist/cjs/gx-ide-file-uploader.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-launchpad.cjs.entry.js +4 -16
- package/dist/cjs/gx-ide-launchpad.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-multi-select.cjs.entry.js +113 -0
- package/dist/cjs/gx-ide-multi-select.cjs.entry.js.map +1 -0
- package/dist/cjs/gx-ide-search.cjs.entry.js +171 -0
- package/dist/cjs/gx-ide-search.cjs.entry.js.map +1 -0
- package/dist/cjs/gx-ide-ww-files.cjs.entry.js +3 -4
- package/dist/cjs/gx-ide-ww-files.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/_helpers/multi-select/gx-ide-multi-select.css +193 -0
- package/dist/collection/components/_helpers/multi-select/gx-ide-multi-select.js +209 -0
- package/dist/collection/components/_helpers/multi-select/gx-ide-multi-select.js.map +1 -0
- package/dist/collection/components/file-uploader/file-item/file-item.css +23 -28
- package/dist/collection/components/file-uploader/file-item/file-item.js +37 -1
- package/dist/collection/components/file-uploader/file-item/file-item.js.map +1 -1
- package/dist/collection/components/file-uploader/file-uploader.css +11 -22
- package/dist/collection/components/file-uploader/file-uploader.js +10 -7
- package/dist/collection/components/file-uploader/file-uploader.js.map +1 -1
- package/dist/collection/components/file-uploader/gx-ide-assets/file-uploader/langs/file-uploader.lang.en.json +7 -3
- package/dist/collection/components/file-uploader/gx-ide-assets/file-uploader/langs/file-uploader.lang.ja.json +7 -3
- package/dist/collection/components/file-uploader/gx-ide-assets/file-uploader/langs/file-uploader.lang.zh.json +8 -3
- package/dist/collection/components/launchpad/root/gx-ide-assets/launchpad/shortcuts.json +1 -26
- package/dist/collection/components/launchpad/root/launchpad.js +5 -42
- package/dist/collection/components/launchpad/root/launchpad.js.map +1 -1
- package/dist/collection/components/search/gx-ide-assets/search/langs/search.lang.en.json +37 -0
- package/dist/collection/components/search/gx-ide-assets/search/langs/search.lang.ja.json +37 -0
- package/dist/collection/components/search/gx-ide-assets/search/langs/search.lang.zh.json +37 -0
- package/dist/collection/components/search/search.css +44 -0
- package/dist/collection/components/search/search.js +275 -0
- package/dist/collection/components/search/search.js.map +1 -0
- package/dist/collection/components/ww-files/ww-files.js +3 -4
- package/dist/collection/components/ww-files/ww-files.js.map +1 -1
- package/dist/collection/testing/locale.e2e.js +4 -1
- package/dist/collection/testing/locale.e2e.js.map +1 -1
- package/dist/components/file-item.js +22 -2
- package/dist/components/file-item.js.map +1 -1
- package/dist/components/gx-ide-file-uploader.js +11 -8
- package/dist/components/gx-ide-file-uploader.js.map +1 -1
- package/dist/components/gx-ide-launchpad.js +6 -19
- package/dist/components/gx-ide-launchpad.js.map +1 -1
- package/dist/components/gx-ide-multi-select.d.ts +11 -0
- package/dist/components/gx-ide-multi-select.js +132 -0
- package/dist/components/gx-ide-multi-select.js.map +1 -0
- package/dist/components/gx-ide-search.d.ts +11 -0
- package/dist/components/gx-ide-search.js +206 -0
- package/dist/components/gx-ide-search.js.map +1 -0
- package/dist/components/gx-ide-ww-files.js +3 -4
- package/dist/components/gx-ide-ww-files.js.map +1 -1
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-file-item.entry.js +21 -2
- package/dist/esm/gx-ide-file-item.entry.js.map +1 -1
- package/dist/esm/gx-ide-file-uploader.entry.js +11 -8
- package/dist/esm/gx-ide-file-uploader.entry.js.map +1 -1
- package/dist/esm/gx-ide-launchpad.entry.js +5 -17
- package/dist/esm/gx-ide-launchpad.entry.js.map +1 -1
- package/dist/esm/gx-ide-multi-select.entry.js +109 -0
- package/dist/esm/gx-ide-multi-select.entry.js.map +1 -0
- package/dist/esm/gx-ide-search.entry.js +167 -0
- package/dist/esm/gx-ide-search.entry.js.map +1 -0
- package/dist/esm/gx-ide-ww-files.entry.js +3 -4
- package/dist/esm/gx-ide-ww-files.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/gx-ide-assets/file-uploader/langs/file-uploader.lang.en.json +7 -3
- package/dist/genexus-ide-ui/gx-ide-assets/file-uploader/langs/file-uploader.lang.ja.json +7 -3
- package/dist/genexus-ide-ui/gx-ide-assets/file-uploader/langs/file-uploader.lang.zh.json +8 -3
- package/dist/genexus-ide-ui/gx-ide-assets/launchpad/shortcuts.json +1 -26
- package/dist/genexus-ide-ui/gx-ide-assets/search/langs/search.lang.en.json +37 -0
- package/dist/genexus-ide-ui/gx-ide-assets/search/langs/search.lang.ja.json +37 -0
- package/dist/genexus-ide-ui/gx-ide-assets/search/langs/search.lang.zh.json +37 -0
- package/dist/genexus-ide-ui/p-0745a565.entry.js +152 -0
- package/dist/genexus-ide-ui/p-0745a565.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-6246204f.entry.js → p-25e749c7.entry.js} +44 -57
- package/dist/genexus-ide-ui/p-25e749c7.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-50dae653.entry.js → p-7bdeae77.entry.js} +211 -213
- package/dist/genexus-ide-ui/p-7bdeae77.entry.js.map +1 -0
- package/dist/genexus-ide-ui/p-8b5c826b.entry.js +212 -0
- package/dist/genexus-ide-ui/p-8b5c826b.entry.js.map +1 -0
- package/dist/genexus-ide-ui/p-c460c9e7.entry.js +187 -0
- package/dist/genexus-ide-ui/p-c460c9e7.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-aad714a5.entry.js → p-e2b88bea.entry.js} +70 -67
- package/dist/genexus-ide-ui/p-e2b88bea.entry.js.map +1 -0
- package/dist/types/components/_helpers/multi-select/gx-ide-multi-select.d.ts +29 -0
- package/dist/types/components/file-uploader/file-item/file-item.d.ts +2 -0
- package/dist/types/components/launchpad/root/launchpad.d.ts +0 -4
- package/dist/types/components/search/search.d.ts +60 -0
- package/dist/types/components.d.ts +121 -4
- package/package.json +1 -1
- package/dist/genexus-ide-ui/p-50dae653.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-6246204f.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-aad714a5.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-f3c3e830.entry.js +0 -163
- package/dist/genexus-ide-ui/p-f3c3e830.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gx-ide-file-uploader.entry.cjs.js","mappings":";;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,46GAA46G;;;;;;;;;;;;;;;;;;;ACiBp8G,MAAM,SAAS,GAAGA,yBAAW,CAAC;IAC5B,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,KAAK;IACX,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,qBAAqB;IACrB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,YAAY;IACZ,cAAc;IACd,iBAAiB;IACjB,qBAAqB;CACtB,CAAC;MAaW,YAAY;;;;QACvB,iDAAuB;QACvB,4CAAgC;QAiEhC,oCAAe,CAAC,EAAC;;QAQjB,mCAAc;YACZ,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAChD,EAAC;;QAwDF,wCAAmB,CAAC,CAAY;;YAC9B,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CA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,CAAC,OAAO,EAAE;YACtB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACvB;aAAM;YACL,MAAA,IAAI,CAAC,2BAA2B,qDAAG;gBACjC,QAAQ,EAAE,IAAI,CAAC,IAAI;gBACnB,KAAK,EAAE,UAAU,CAAC,KAAK;aACxB,CAAC,CAAC;SACJ;KACF,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC;;;;;","names":["getIconPath","Locale","h","Host"],"sources":["src/components/file-uploader/file-uploader.scss?tag=gx-ide-file-uploader&encapsulation=shadow","src/components/file-uploader/file-uploader.tsx"],"sourcesContent":["@import \"../../global/gx-ide-common.scss\";\n@import \"../../global/gx-ide-mixins.scss\";\n@import \"../../global/temporary-mercury-overrides/_button.scss\";\n@import \"../../../node_modules/@genexus/mercury/dist/assets/scss/helpers.scss\";\n\n:host {\n display: block;\n inline-size: 100%;\n block-size: 100%;\n padding-inline-end: 0 !important;\n}\n\n.file-uploader-dialog {\n display: flex;\n flex-direction: column;\n block-size: 100%;\n position: relative;\n\n .dialog-content {\n flex: 1;\n min-block-size: 0;\n overflow: auto;\n }\n\n .dialog-footer {\n padding-inline-end: var(--spacing-body-inline-end);\n }\n}\n\n.file-uploader {\n display: flex;\n flex-direction: column;\n inline-size: 100%;\n block-size: 100%;\n\n &__list {\n display: flex;\n flex-direction: column;\n inline-size: 100%;\n block-size: 100%;\n\n &-header {\n position: sticky;\n top: 0;\n z-index: 1;\n background-color: var(--color-accent-surface-elevation-1);\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-inline-end: var(--spacing-body-inline-end);\n }\n\n &-content {\n flex: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: var(--spacing-gap-m);\n padding-inline-end: var(--spacing-body-inline-end);\n padding-block-end: 16px;\n }\n }\n\n &__list-title-container {\n display: flex;\n align-items: center;\n gap: var(--spacing-gap-xs);\n white-space: nowrap;\n }\n\n &__drop-zone {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n inline-size: calc(100% - var(--spacing-body-inline-end));\n block-size: calc(100% - 12px);\n min-block-size: 200px;\n margin-block-end: 12px;\n background: var(--color-accent-surface-elevation-1);\n border: 2px dashed var(--color-border-neutral-default);\n border-radius: 8px;\n transition:\n border-color 0.3s ease,\n background-color 0.3s ease,\n opacity 0.3s ease;\n\n &--dragging {\n border-color: var(--color-accent-primary-default);\n background: var(--color-accent-primary-hover);\n opacity: 0.7;\n }\n\n .text-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--spacing-gap-xs);\n margin-block-start: 8px;\n }\n }\n}\n\n.hidden-input {\n display: none;\n}\n\n.label-primary-row {\n display: flex;\n align-items: center;\n gap: var(--spacing-gap-m);\n}\n","/* eslint-disable @stencil-community/own-methods-must-be-private */\n/* eslint-disable @stencil-community/own-props-must-be-private */\n/* STENCIL IMPORTS */\nimport {\n Component,\n Host,\n h,\n Prop,\n Element,\n State,\n Method\n} from \"@stencil/core\";\n\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\nimport { Locale } from \"../../common/locale\";\nimport { UploadedFile, FileUploadState, UploadResult } from \"./types\";\n\nconst PLUS_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"add\",\n colorType: \"primary\"\n});\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/button\",\n \"components/icon\",\n \"components/list-box\",\n \"components/edit\",\n \"utils/typography\",\n \"utils/spacing\",\n \"utils/form\",\n \"utils/layout\",\n \"utils/elevation\",\n \"chameleon/scrollbar\"\n];\n\ntype FileValidationResult = {\n isValid: boolean;\n error?: string;\n};\n\n@Component({\n tag: \"gx-ide-file-uploader\",\n styleUrl: \"file-uploader.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/file-uploader\"]\n})\nexport class FileUploader {\n #_componentLocale: any;\n #fileInputEl!: HTMLInputElement;\n\n @Element() el!: HTMLGxIdeFileUploaderElement;\n\n /** Allowed file types/extensions (e.g. ['.jpg', '.png', 'image/*', 'application/pdf']) */\n @Prop() readonly types?: string[] = [];\n\n /** Whether multiple files can be selected */\n @Prop() readonly multiple: boolean = false;\n\n /** Whether file names can be edited */\n @Prop() readonly canEditName: boolean = false;\n\n /** Label to display in the uploader dialog */\n @Prop() readonly label?: string;\n\n /** Function to handle file upload */\n @Prop() readonly uploadFunction!: (\n file: File,\n progressCallback: (progress: number) => void\n ) => Promise<UploadResult>;\n\n /** Function to cancel file upload */\n @Prop() readonly cancelUploadFunction?: (fileId: string) => Promise<void>;\n\n /** Callback when a file is uploaded successfully */\n @Prop() readonly fileUploadedCallback?: (file: UploadedFile) => Promise<void>;\n\n /** Callback when the dialog is canceled */\n @Prop() readonly dialogCanceledCallback?: () => Promise<void>;\n\n /** Callback when the dialog is confirmed with files */\n @Prop() readonly dialogConfirmedCallback?: (\n files: UploadedFile[]\n ) => Promise<void>;\n\n /** Callback when upload is cancelled */\n @Prop() readonly uploadCancelledCallback?: (fileId: string) => Promise<void>;\n\n /** Callback when file is renamed */\n @Prop() readonly fileRenamedCallback?: (data: {\n fileId: string;\n newName: string;\n }) => Promise<void>;\n\n /** Callback when a file validation error occurs */\n @Prop() readonly fileValidationErrorCallback?: (data: {\n fileName: string;\n error: string;\n }) => Promise<void>;\n\n /** Callback when a file deletion error occurs */\n @Prop() readonly fileDeletionErrorCallback?: (data: {\n fileName: string;\n error: string;\n }) => Promise<void>;\n\n /** Callback when a file is deleted */\n @Prop() readonly fileDeletedCallback?: (file: UploadedFile) => Promise<void>;\n\n /** Callback before deleting a file to get confirmation */\n @Prop() readonly onBeforeDelete?: (file: UploadedFile) => Promise<boolean>;\n\n @State() private fileStates: Map<string, FileUploadState> = new Map();\n @State() private isDragging: boolean = false;\n #dragCounter = 0;\n\n /** Initializes component with locale strings */\n async componentWillLoad() {\n this.#_componentLocale = await Locale.getComponentStrings(this.el);\n }\n\n /** Generates a unique ID for file identification */\n #generateId = (): string => {\n return Math.random().toString(36).substr(2, 9);\n };\n\n /** Validates if a file matches the allowed types */\n #isValidFile(file: File): FileValidationResult {\n // If no types specified, accept any file\n if (!this.types || this.types.length === 0) {\n return { isValid: true };\n }\n\n for (const type of this.types) {\n // Handle wildcards like 'image/*'\n if (type.includes(\"/*\")) {\n const baseType = type.split(\"/\")[0];\n if (file.type.startsWith(baseType)) {\n return { isValid: true };\n }\n }\n // Handle extensions like '.jpg'\n else if (type.startsWith(\".\")) {\n if (file.name.toLowerCase().endsWith(type.toLowerCase())) {\n return { isValid: true };\n }\n }\n // Handle specific MIME types\n else if (file.type === type || file.type === `application/${type}`) {\n return { isValid: true };\n }\n }\n\n return {\n isValid: false,\n error:\n this.#_componentLocale?.errors?.invalidFileType || \"Invalid file type\"\n };\n }\n\n /** Filters valid files from a FileList */\n #getValidFiles(files: FileList): File[] {\n const validFiles: File[] = [];\n\n Array.from(files).forEach(file => {\n const validation = this.#isValidFile(file);\n if (validation.isValid) {\n validFiles.push(file);\n } else {\n this.fileValidationErrorCallback?.({\n fileName: file.name,\n error: validation.error\n });\n }\n });\n\n return validFiles;\n }\n\n /** Handles drag enter event */\n #handleDragEnter = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.#dragCounter++;\n this.isDragging = true;\n };\n\n /** Handles drag leave event */\n #handleDragLeave = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.#dragCounter--;\n if (this.#dragCounter === 0) {\n this.isDragging = false;\n }\n };\n\n /** Handles drag over event */\n #handleDragOver = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n };\n\n /** Handles drop event */\n #handleDrop = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.isDragging = false;\n this.#dragCounter = 0;\n\n const files = e.dataTransfer?.files;\n if (files) {\n this.#handleFiles(files);\n }\n };\n\n /** Triggers file input click */\n #handleFileSelect = () => {\n this.#fileInputEl?.click();\n };\n\n /** Handles file input change event */\n #handleFileInput = (e: Event) => {\n const files = (e.target as HTMLInputElement).files;\n if (files) {\n this.#handleFiles(files);\n }\n };\n\n /** Processes files and starts upload */\n #handleFiles = (files: FileList) => {\n const validFiles: File[] = this.#getValidFiles(files);\n\n validFiles.forEach(async file => {\n const id = this.#generateId();\n const fileState: FileUploadState = {\n id,\n name: file.name,\n file,\n pending: true,\n progress: 0\n };\n\n if (!this.multiple) {\n this.fileStates.clear();\n }\n\n this.fileStates = new Map(this.fileStates.set(id, fileState));\n\n if (this.uploadFunction) {\n try {\n const uploadPromise = this.uploadFunction(file, progress => {\n const state = this.fileStates.get(id);\n if (state) {\n const updatedState = {\n ...state,\n progress: progress,\n pending: progress < 100\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n }\n });\n\n // Store the upload promise/object for potential cancellation\n const stateWithPromise = {\n ...this.fileStates.get(id),\n uploadPromise\n };\n this.fileStates = new Map(this.fileStates.set(id, stateWithPromise));\n\n const result = await uploadPromise;\n\n const state = this.fileStates.get(id);\n if (state) {\n if (result.success && result.remoteId) {\n const updatedState = {\n ...state,\n remoteId: result.remoteId,\n pending: false,\n progress: 100\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n\n await this.fileUploadedCallback?.({\n name: state.name,\n originalName: state.file.name,\n remoteId: result.remoteId\n });\n } else {\n const updatedState = {\n ...state,\n error: result.errors?.upload || \"Upload failed\",\n pending: false\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n }\n }\n } catch (error) {\n const state = this.fileStates.get(id);\n if (state) {\n const updatedState = {\n ...state,\n error:\n error instanceof Error\n ? error.message\n : \"Unknown error occurred\",\n pending: false\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n }\n }\n }\n });\n\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n };\n\n /** Handles file name change */\n #handleNameChange = async (\n event: CustomEvent<{ id: string; name: string }>\n ) => {\n const { id, name } = event.detail;\n const file = this.fileStates.get(id);\n\n if (file) {\n const updatedFile = {\n ...file,\n name: name.trim(),\n isEditing: false\n };\n\n this.fileStates = new Map(this.fileStates.set(id, updatedFile));\n await this.fileRenamedCallback?.({ fileId: id, newName: name.trim() });\n }\n };\n\n /** Handles individual file cancellation or deletion */\n #handleFileCancel = async (event: CustomEvent<string>) => {\n const id = event.detail;\n const state = this.fileStates.get(id);\n if (state) {\n try {\n if (state.pending) {\n // Cancel upload in progress\n if (\n state.uploadPromise &&\n typeof state.uploadPromise.cancel === \"function\"\n ) {\n state.uploadPromise.cancel();\n } else if (this.cancelUploadFunction) {\n await this.cancelUploadFunction(id);\n }\n\n await this.uploadCancelledCallback?.(id);\n\n this.fileStates.delete(id);\n this.fileStates = new Map(this.fileStates);\n } else {\n const fileToDelete: UploadedFile = {\n name: state.name,\n originalName: state.file.name,\n remoteId: state.remoteId\n };\n\n const shouldDelete = await this.onBeforeDelete?.(fileToDelete);\n\n if (shouldDelete) {\n await this.fileDeletedCallback?.(fileToDelete);\n this.fileStates.delete(id);\n this.fileStates = new Map(this.fileStates);\n }\n }\n } catch (error) {\n await this.fileDeletionErrorCallback?.({\n fileName: state.name,\n error:\n error instanceof Error ? error.message : \"Unknown error occurred\"\n });\n }\n }\n };\n\n /** Handles dialog confirmation */\n #handleConfirm = async () => {\n // Verificar si hay subidas en progreso\n const hasPendingUploads = Array.from(this.fileStates.values()).some(\n file => file.pending\n );\n\n if (hasPendingUploads) {\n return; // No permitir confirmar si hay subidas en progreso\n }\n\n // Obtener todos los archivos que están completamente subidos\n const uploadedFiles: UploadedFile[] = Array.from(this.fileStates.values())\n .filter(file => {\n const isValid = !file.pending && file.remoteId && !file.error;\n return isValid;\n })\n .map(file => ({\n name: file.name,\n originalName: file.file.name,\n remoteId: file.remoteId as string\n }));\n\n if (uploadedFiles.length > 0) {\n await this.dialogConfirmedCallback?.(uploadedFiles);\n }\n\n // Clear file states\n this.fileStates.clear();\n this.fileStates = new Map();\n\n // Reset file input\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n };\n\n /** Handles dialog cancellation */\n #handleCancel = async () => {\n try {\n // Cancelamos todas las subidas en progreso\n for (const [id, state] of this.fileStates.entries()) {\n if (state.pending && this.cancelUploadFunction) {\n try {\n await this.cancelUploadFunction(id);\n await this.uploadCancelledCallback?.(id);\n } catch (error) {\n // Error handling for upload cancellation\n }\n }\n }\n\n // Limpiamos todos los estados\n this.fileStates.clear();\n this.fileStates = new Map();\n\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n\n await this.dialogCanceledCallback?.();\n } catch (error) {\n this.fileStates.clear();\n this.fileStates = new Map();\n await this.dialogCanceledCallback?.();\n }\n };\n\n /** Clears the current file selection */\n @Method()\n async clear() {\n for (const [id, state] of this.fileStates.entries()) {\n if (state.pending && this.cancelUploadFunction) {\n try {\n await this.cancelUploadFunction(id);\n await this.uploadCancelledCallback?.(id);\n } catch (error) {\n // Error handling for upload cancellation\n }\n }\n }\n this.fileStates.clear();\n }\n\n render() {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <input\n type=\"file\"\n class=\"hidden-input\"\n multiple={this.multiple}\n accept={this.types\n ?.map(type => (type.startsWith(\".\") ? type : `.${type}`))\n .join(\",\")}\n onChange={this.#handleFileInput}\n ref={el => (this.#fileInputEl = el as HTMLInputElement)}\n aria-hidden=\"true\"\n tabIndex={-1}\n style={{ display: \"none\" }}\n />\n <div class=\"file-uploader-dialog\">\n <div class=\"dialog-content\">\n {this.isDragging || this.fileStates.size === 0 ? (\n <div\n class={{\n \"file-uploader__drop-zone\": true,\n \"file-uploader__drop-zone--dragging\": this.isDragging\n }}\n onDragEnter={this.#handleDragEnter}\n onDragLeave={this.#handleDragLeave}\n onDragOver={this.#handleDragOver}\n onDrop={this.#handleDrop}\n >\n <button\n class=\"button-tertiary button-icon-and-text\"\n type=\"button\"\n onClick={this.#handleFileSelect}\n >\n <ch-image class=\"icon-m\" src={PLUS_ICON}></ch-image>\n <label class=\"label\">\n {this.multiple\n ? this.#_componentLocale?.header.uploadButtonMultiple\n : this.#_componentLocale?.header.uploadButtonSingle}\n </label>\n </button>\n <div class=\"text-container\">\n <div class=\"label-primary-row\">\n <label class=\"label\">\n {this.label || this.#_componentLocale?.header.orText}\n </label>\n <label class=\"label\">\n {this.#_componentLocale?.header.dragAndDrop}\n </label>\n </div>\n <span class=\"caption\">\n {this.types && this.types.length > 0\n ? this.#_componentLocale?.header.acceptedFiles.replace(\n \"{0}\",\n this.types.join(\", \")\n )\n : this.#_componentLocale?.header.allFilesAccepted}\n </span>\n </div>\n </div>\n ) : (\n <div class=\"file-uploader__list\">\n <div class=\"file-uploader__list-header spacing-body-block-end\">\n <div class=\"file-uploader__list-title-container\">\n <label class=\"label\">\n {this.label ||\n this.#_componentLocale?.fileList.attachedFiles}\n </label>\n <span class=\"caption\">\n {this.#_componentLocale?.fileList.filesCount.replace(\n \"{0}\",\n this.fileStates.size.toString()\n )}\n </span>\n </div>\n {this.multiple && (\n <button\n class=\"button-tertiary button-icon-and-text\"\n type=\"button\"\n onClick={this.#handleFileSelect}\n >\n <ch-image class=\"icon-m\" src={PLUS_ICON}></ch-image>\n <label class=\"label\">\n {this.multiple\n ? this.#_componentLocale?.header.uploadButtonMultiple\n : this.#_componentLocale?.header.uploadButtonSingle}\n </label>\n </button>\n )}\n </div>\n <div class=\"file-uploader__list-content scrollable\">\n {Array.from(this.fileStates.values()).map(file => (\n <gx-ide-file-item\n key={file.id}\n file={file}\n editable={this.canEditName}\n onFileNameChange={this.#handleNameChange}\n onFileDelete={this.#handleFileCancel}\n onFileCancel={this.#handleFileCancel}\n />\n ))}\n </div>\n </div>\n )}\n </div>\n <div class=\"dialog-footer dialog-footer dialog-footer-with-border\">\n <div class=\"buttons-spacer\">\n <button\n class=\"button-secondary\"\n type=\"button\"\n onClick={this.#handleCancel}\n >\n {this.#_componentLocale?.buttons.cancel}\n </button>\n <button\n class=\"button-primary\"\n type=\"button\"\n onClick={this.#handleConfirm}\n disabled={\n this.fileStates.size === 0 ||\n Array.from(this.fileStates.values()).some(\n file => file.pending\n )\n }\n >\n {this.#_componentLocale?.buttons.confirm}\n </button>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"gx-ide-file-uploader.entry.cjs.js","mappings":";;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,wjGAAwjG;;;;;;;;;;;;;;;;;;;ACiBhlG,MAAM,SAAS,GAAGA,yBAAW,CAAC;IAC5B,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,KAAK;IACX,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,qBAAqB;IACrB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,YAAY;IACZ,cAAc;IACd,iBAAiB;IACjB,qBAAqB;CACtB,CAAC;MAaW,YAAY;;;;QACvB,iDAAuB;QACvB,4CAAgC;QAiEhC,oCAAe,CAAC,EAAC;;QAQjB,mCAAc;YACZ,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAChD,EAAC;;QAwDF,wCAAmB,CAAC,CAAY;;YAC9B,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,yDAAA,iEAAiB,EAAjB,IAAmB,IAAA,OAAA,CAAC;YACpB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;SACxB,EAAC;;QAGF,wCAAmB,CAAC,CAAY;;YAC9B,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,yDAAA,iEAAiB,EAAjB,IAAmB,IAAA,OAAA,CAAC;YACpB,IAAI,uBAAA,IAAI,iCAAa,KAAK,CAAC,EAAE;gBAC3B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;aACzB;SACF,EAAC;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AC;;;;;","names":["getIconPath","Locale","h","Host"],"sources":["src/components/file-uploader/file-uploader.scss?tag=gx-ide-file-uploader&encapsulation=shadow","src/components/file-uploader/file-uploader.tsx"],"sourcesContent":["@import \"../../global/gx-ide-common.scss\";\n@import \"../../global/gx-ide-mixins.scss\";\n@import \"../../global/temporary-mercury-overrides/_button.scss\";\n@import \"../../../node_modules/@genexus/mercury/dist/assets/scss/helpers.scss\";\n\n:host {\n display: grid;\n inline-size: 100%;\n block-size: 100%;\n}\n\n.file-uploader-dialog {\n display: grid;\n grid-template-rows: 1fr max-content;\n block-size: 100%;\n min-block-size: 0;\n position: relative;\n\n .dialog-content {\n min-block-size: 0;\n overflow: auto;\n }\n}\n\n.file-uploader {\n display: flex;\n flex-direction: column;\n inline-size: 100%;\n block-size: 100%;\n\n &__list {\n display: flex;\n flex-direction: column;\n inline-size: 100%;\n block-size: 100%;\n\n &-header {\n position: sticky;\n top: 0;\n z-index: 1;\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n &-content {\n flex: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: var(--spacing-gap-l);\n @include list-reset;\n padding-block-end: var(--spacing-padding-l);\n }\n }\n\n &__list-title-container {\n display: flex;\n align-items: center;\n gap: var(--spacing-gap-xs);\n white-space: nowrap;\n }\n\n &__drop-zone {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n inline-size: 100%;\n block-size: 100%;\n border: 2px dashed var(--color-border-neutral-default);\n border-radius: 8px;\n transition:\n border-color 0.3s ease,\n background-color 0.3s ease,\n opacity 0.3s ease;\n\n &--dragging {\n border-color: var(--color-accent-primary-default);\n background: var(--color-accent-primary-hover);\n opacity: 0.7;\n }\n\n .text-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--spacing-gap-xs);\n margin-block-start: 8px;\n }\n }\n}\n\n.label-primary-row {\n display: flex;\n align-items: center;\n gap: var(--spacing-gap-m);\n}\n","/* eslint-disable @stencil-community/own-methods-must-be-private */\n/* eslint-disable @stencil-community/own-props-must-be-private */\n/* STENCIL IMPORTS */\nimport {\n Component,\n Host,\n h,\n Prop,\n Element,\n State,\n Method\n} from \"@stencil/core\";\n\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\nimport { Locale } from \"../../common/locale\";\nimport { UploadedFile, FileUploadState, UploadResult } from \"./types\";\n\nconst PLUS_ICON = getIconPath({\n category: \"system\",\n name: \"add\",\n colorType: \"primary\"\n});\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/button\",\n \"components/icon\",\n \"components/list-box\",\n \"components/edit\",\n \"utils/typography\",\n \"utils/spacing\",\n \"utils/form\",\n \"utils/layout\",\n \"utils/elevation\",\n \"chameleon/scrollbar\"\n];\n\ntype FileValidationResult = {\n isValid: boolean;\n error?: string;\n};\n\n@Component({\n tag: \"gx-ide-file-uploader\",\n styleUrl: \"file-uploader.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/file-uploader\"]\n})\nexport class FileUploader {\n #_componentLocale: any;\n #fileInputEl!: HTMLInputElement;\n\n @Element() el!: HTMLGxIdeFileUploaderElement;\n\n /** Allowed file types/extensions (e.g. ['.jpg', '.png', 'image/*', 'application/pdf']) */\n @Prop() readonly types?: string[] = [];\n\n /** Whether multiple files can be selected */\n @Prop() readonly multiple: boolean = false;\n\n /** Whether file names can be edited */\n @Prop() readonly canEditName: boolean = false;\n\n /** Label to display in the uploader dialog */\n @Prop() readonly label?: string;\n\n /** Function to handle file upload */\n @Prop() readonly uploadFunction!: (\n file: File,\n progressCallback: (progress: number) => void\n ) => Promise<UploadResult>;\n\n /** Function to cancel file upload */\n @Prop() readonly cancelUploadFunction?: (fileId: string) => Promise<void>;\n\n /** Callback when a file is uploaded successfully */\n @Prop() readonly fileUploadedCallback?: (file: UploadedFile) => Promise<void>;\n\n /** Callback when the dialog is canceled */\n @Prop() readonly dialogCanceledCallback?: () => Promise<void>;\n\n /** Callback when the dialog is confirmed with files */\n @Prop() readonly dialogConfirmedCallback?: (\n files: UploadedFile[]\n ) => Promise<void>;\n\n /** Callback when upload is cancelled */\n @Prop() readonly uploadCancelledCallback?: (fileId: string) => Promise<void>;\n\n /** Callback when file is renamed */\n @Prop() readonly fileRenamedCallback?: (data: {\n fileId: string;\n newName: string;\n }) => Promise<void>;\n\n /** Callback when a file validation error occurs */\n @Prop() readonly fileValidationErrorCallback?: (data: {\n fileName: string;\n error: string;\n }) => Promise<void>;\n\n /** Callback when a file deletion error occurs */\n @Prop() readonly fileDeletionErrorCallback?: (data: {\n fileName: string;\n error: string;\n }) => Promise<void>;\n\n /** Callback when a file is deleted */\n @Prop() readonly fileDeletedCallback?: (file: UploadedFile) => Promise<void>;\n\n /** Callback before deleting a file to get confirmation */\n @Prop() readonly onBeforeDelete?: (file: UploadedFile) => Promise<boolean>;\n\n @State() private fileStates: Map<string, FileUploadState> = new Map();\n @State() private isDragging: boolean = false;\n #dragCounter = 0;\n\n /** Initializes component with locale strings */\n async componentWillLoad() {\n this.#_componentLocale = await Locale.getComponentStrings(this.el);\n }\n\n /** Generates a unique ID for file identification */\n #generateId = (): string => {\n return Math.random().toString(36).substr(2, 9);\n };\n\n /** Validates if a file matches the allowed types */\n #isValidFile(file: File): FileValidationResult {\n // If no types specified, accept any file\n if (!this.types || this.types.length === 0) {\n return { isValid: true };\n }\n\n for (const type of this.types) {\n // Handle wildcards like 'image/*'\n if (type.includes(\"/*\")) {\n const baseType = type.split(\"/\")[0];\n if (file.type.startsWith(baseType)) {\n return { isValid: true };\n }\n }\n // Handle extensions like '.jpg'\n else if (type.startsWith(\".\")) {\n if (file.name.toLowerCase().endsWith(type.toLowerCase())) {\n return { isValid: true };\n }\n }\n // Handle specific MIME types\n else if (file.type === type || file.type === `application/${type}`) {\n return { isValid: true };\n }\n }\n\n return {\n isValid: false,\n error:\n this.#_componentLocale?.errors?.invalidFileType || \"Invalid file type\"\n };\n }\n\n /** Filters valid files from a FileList */\n #getValidFiles(files: FileList): File[] {\n const validFiles: File[] = [];\n\n Array.from(files).forEach(file => {\n const validation = this.#isValidFile(file);\n if (validation.isValid) {\n validFiles.push(file);\n } else {\n this.fileValidationErrorCallback?.({\n fileName: file.name,\n error: validation.error\n });\n }\n });\n\n return validFiles;\n }\n\n /** Handles drag enter event */\n #handleDragEnter = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.#dragCounter++;\n this.isDragging = true;\n };\n\n /** Handles drag leave event */\n #handleDragLeave = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.#dragCounter--;\n if (this.#dragCounter === 0) {\n this.isDragging = false;\n }\n };\n\n /** Handles drag over event */\n #handleDragOver = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n };\n\n /** Handles drop event */\n #handleDrop = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.isDragging = false;\n this.#dragCounter = 0;\n\n const files = e.dataTransfer?.files;\n if (files) {\n this.#handleFiles(files);\n }\n };\n\n /** Triggers file input click */\n #handleFileSelect = () => {\n this.#fileInputEl?.click();\n };\n\n /** Handles file input change event */\n #handleFileInput = (e: Event) => {\n const files = (e.target as HTMLInputElement).files;\n if (files) {\n this.#handleFiles(files);\n }\n };\n\n /** Processes files and starts upload */\n #handleFiles = (files: FileList) => {\n const validFiles: File[] = this.#getValidFiles(files);\n\n validFiles.forEach(async file => {\n const id = this.#generateId();\n const fileState: FileUploadState = {\n id,\n name: file.name,\n file,\n pending: true,\n progress: 0\n };\n\n if (!this.multiple) {\n this.fileStates.clear();\n }\n\n this.fileStates = new Map(this.fileStates.set(id, fileState));\n\n if (this.uploadFunction) {\n try {\n const uploadPromise = this.uploadFunction(file, progress => {\n const state = this.fileStates.get(id);\n if (state) {\n const updatedState = {\n ...state,\n progress: progress,\n pending: progress < 100\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n }\n });\n\n // Store the upload promise/object for potential cancellation\n const stateWithPromise = {\n ...this.fileStates.get(id),\n uploadPromise\n };\n this.fileStates = new Map(this.fileStates.set(id, stateWithPromise));\n\n const result = await uploadPromise;\n\n const state = this.fileStates.get(id);\n if (state) {\n if (result.success && result.remoteId) {\n const updatedState = {\n ...state,\n remoteId: result.remoteId,\n pending: false,\n progress: 100\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n\n await this.fileUploadedCallback?.({\n name: state.name,\n originalName: state.file.name,\n remoteId: result.remoteId\n });\n } else {\n const updatedState = {\n ...state,\n error: result.errors?.upload || \"Upload failed\",\n pending: false\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n }\n }\n } catch (error) {\n const state = this.fileStates.get(id);\n if (state) {\n const updatedState = {\n ...state,\n error:\n error instanceof Error\n ? error.message\n : \"Unknown error occurred\",\n pending: false\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n }\n }\n }\n });\n\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n };\n\n /** Handles file name change */\n #handleNameChange = async (\n event: CustomEvent<{ id: string; name: string }>\n ) => {\n const { id, name } = event.detail;\n const file = this.fileStates.get(id);\n\n if (file) {\n const updatedFile = {\n ...file,\n name: name.trim(),\n isEditing: false\n };\n\n this.fileStates = new Map(this.fileStates.set(id, updatedFile));\n await this.fileRenamedCallback?.({ fileId: id, newName: name.trim() });\n }\n };\n\n /** Handles individual file cancellation or deletion */\n #handleFileCancel = async (event: CustomEvent<string>) => {\n const id = event.detail;\n const state = this.fileStates.get(id);\n if (state) {\n try {\n if (state.pending) {\n // Cancel upload in progress\n if (\n state.uploadPromise &&\n typeof state.uploadPromise.cancel === \"function\"\n ) {\n state.uploadPromise.cancel();\n } else if (this.cancelUploadFunction) {\n await this.cancelUploadFunction(id);\n }\n\n await this.uploadCancelledCallback?.(id);\n\n this.fileStates.delete(id);\n this.fileStates = new Map(this.fileStates);\n } else {\n const fileToDelete: UploadedFile = {\n name: state.name,\n originalName: state.file.name,\n remoteId: state.remoteId\n };\n\n const shouldDelete = await this.onBeforeDelete?.(fileToDelete);\n\n if (shouldDelete) {\n await this.fileDeletedCallback?.(fileToDelete);\n this.fileStates.delete(id);\n this.fileStates = new Map(this.fileStates);\n }\n }\n } catch (error) {\n await this.fileDeletionErrorCallback?.({\n fileName: state.name,\n error:\n error instanceof Error ? error.message : \"Unknown error occurred\"\n });\n }\n }\n };\n\n /** Handles dialog confirmation */\n #handleConfirm = async () => {\n // Verificar si hay subidas en progreso\n const hasPendingUploads = Array.from(this.fileStates.values()).some(\n file => file.pending\n );\n\n if (hasPendingUploads) {\n return; // No permitir confirmar si hay subidas en progreso\n }\n\n // Obtener todos los archivos que están completamente subidos\n const uploadedFiles: UploadedFile[] = Array.from(this.fileStates.values())\n .filter(file => {\n const isValid = !file.pending && file.remoteId && !file.error;\n return isValid;\n })\n .map(file => ({\n name: file.name,\n originalName: file.file.name,\n remoteId: file.remoteId as string\n }));\n\n if (uploadedFiles.length > 0) {\n await this.dialogConfirmedCallback?.(uploadedFiles);\n }\n\n // Clear file states\n this.fileStates.clear();\n this.fileStates = new Map();\n\n // Reset file input\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n };\n\n /** Handles dialog cancellation */\n #handleCancel = async () => {\n try {\n // Cancelamos todas las subidas en progreso\n for (const [id, state] of this.fileStates.entries()) {\n if (state.pending && this.cancelUploadFunction) {\n try {\n await this.cancelUploadFunction(id);\n await this.uploadCancelledCallback?.(id);\n } catch (error) {\n // Error handling for upload cancellation\n }\n }\n }\n\n // Limpiamos todos los estados\n this.fileStates.clear();\n this.fileStates = new Map();\n\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n\n await this.dialogCanceledCallback?.();\n } catch (error) {\n this.fileStates.clear();\n this.fileStates = new Map();\n await this.dialogCanceledCallback?.();\n }\n };\n\n /** Clears the current file selection */\n @Method()\n async clear() {\n for (const [id, state] of this.fileStates.entries()) {\n if (state.pending && this.cancelUploadFunction) {\n try {\n await this.cancelUploadFunction(id);\n await this.uploadCancelledCallback?.(id);\n } catch (error) {\n // Error handling for upload cancellation\n }\n }\n }\n this.fileStates.clear();\n }\n\n render() {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n {/* Native file input required: ch-edit is for text only; no Chameleon file picker. */}\n <input\n type=\"file\"\n hidden\n multiple={this.multiple}\n accept={this.types\n ?.map(type => (type.startsWith(\".\") ? type : `.${type}`))\n .join(\",\")}\n onChange={this.#handleFileInput}\n ref={el => (this.#fileInputEl = el as HTMLInputElement)}\n aria-hidden=\"true\"\n tabIndex={-1}\n />\n <div class=\"file-uploader-dialog\">\n <div class=\"dialog-content\">\n {this.isDragging || this.fileStates.size === 0 ? (\n <div\n class={{\n \"file-uploader__drop-zone elevation-1\": true,\n \"file-uploader__drop-zone--dragging\": this.isDragging\n }}\n onDragEnter={this.#handleDragEnter}\n onDragLeave={this.#handleDragLeave}\n onDragOver={this.#handleDragOver}\n onDrop={this.#handleDrop}\n >\n <button\n class=\"button-tertiary button-icon-and-text\"\n type=\"button\"\n onClick={this.#handleFileSelect}\n >\n <ch-image class=\"icon-m\" src={PLUS_ICON}></ch-image>\n <label class=\"label\">\n {this.multiple\n ? this.#_componentLocale?.header.uploadButtonMultiple\n : this.#_componentLocale?.header.uploadButtonSingle}\n </label>\n </button>\n <div class=\"text-container\">\n <div class=\"label-primary-row\">\n <label class=\"label\">\n {this.label || this.#_componentLocale?.header.orText}\n </label>\n <label class=\"label\">\n {this.#_componentLocale?.header.dragAndDrop}\n </label>\n </div>\n <span class=\"caption\">\n {this.types && this.types.length > 0\n ? this.#_componentLocale?.header.acceptedFiles.replace(\n \"{0}\",\n this.types.join(\", \")\n )\n : this.#_componentLocale?.header.allFilesAccepted}\n </span>\n </div>\n </div>\n ) : (\n <div class=\"file-uploader__list\">\n <div class=\"file-uploader__list-header elevation-1 spacing-body-block-end spacing-inline-end\">\n <div class=\"file-uploader__list-title-container\">\n <label class=\"label\">\n {this.label ||\n this.#_componentLocale?.fileList.attachedFiles}\n </label>\n <span class=\"caption\">\n {this.#_componentLocale?.fileList.filesCount.replace(\n \"{0}\",\n this.fileStates.size.toString()\n )}\n </span>\n </div>\n {this.multiple && (\n <button\n class=\"button-tertiary button-icon-and-text\"\n type=\"button\"\n onClick={this.#handleFileSelect}\n >\n <ch-image class=\"icon-m\" src={PLUS_ICON}></ch-image>\n <label class=\"label\">\n {this.multiple\n ? this.#_componentLocale?.header.uploadButtonMultiple\n : this.#_componentLocale?.header.uploadButtonSingle}\n </label>\n </button>\n )}\n </div>\n <ul\n class=\"file-uploader__list-content scrollable spacing-inline-end spacing-block-end\"\n aria-live=\"polite\"\n aria-label={this.#_componentLocale?.fileList.selectedFilesAriaLabel}\n >\n {Array.from(this.fileStates.values()).map(file => (\n <gx-ide-file-item\n key={file.id}\n file={file}\n editable={this.canEditName}\n componentLocale={this.#_componentLocale}\n onFileNameChange={this.#handleNameChange}\n onFileDelete={this.#handleFileCancel}\n onFileCancel={this.#handleFileCancel}\n />\n ))}\n </ul>\n </div>\n )}\n </div>\n <div class={{\n \"dialog-footer\": true,\n \"dialog-footer-with-border\": this.fileStates.size > 0\n }}>\n <div class=\"buttons-spacer\">\n <button\n class=\"button-secondary\"\n type=\"button\"\n onClick={this.#handleCancel}\n >\n {this.#_componentLocale?.buttons.cancel}\n </button>\n <button\n class=\"button-primary\"\n type=\"button\"\n onClick={this.#handleConfirm}\n disabled={\n this.fileStates.size === 0 ||\n Array.from(this.fileStates.values()).some(\n file => file.pending\n )\n }\n >\n {this.#_componentLocale?.buttons.confirm}\n </button>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -23,7 +23,7 @@ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) ||
|
|
|
23
23
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
24
24
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
25
25
|
};
|
|
26
|
-
var
|
|
26
|
+
var _GxIdeLaunchpad_componentLocale;
|
|
27
27
|
const CSS_BUNDLES = [
|
|
28
28
|
"resets/box-sizing",
|
|
29
29
|
"components/tab",
|
|
@@ -45,8 +45,6 @@ const GxIdeLaunchpad = class {
|
|
|
45
45
|
this.objectSelected = index.createEvent(this, "objectSelected", 7);
|
|
46
46
|
this.copyToClipboard = index.createEvent(this, "copyToClipboard", 7);
|
|
47
47
|
this.openOnTheAppStore = index.createEvent(this, "openOnTheAppStore", 7);
|
|
48
|
-
_GxIdeLaunchpad_chShortcutsEl.set(this, void 0);
|
|
49
|
-
_GxIdeLaunchpad_shortcutsSrc.set(this, index.getAssetPath(`./gx-ide-assets/launchpad/shortcuts.json`));
|
|
50
48
|
_GxIdeLaunchpad_componentLocale.set(this, void 0);
|
|
51
49
|
this.data = undefined;
|
|
52
50
|
this.isStandalone = true;
|
|
@@ -77,17 +75,6 @@ const GxIdeLaunchpad = class {
|
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
77
|
componentDidLoad() { }
|
|
80
|
-
/**
|
|
81
|
-
* Suspends or reactivates the shortcuts
|
|
82
|
-
*/
|
|
83
|
-
async suspendShortcuts(suspendShortcuts) {
|
|
84
|
-
if (suspendShortcuts) {
|
|
85
|
-
__classPrivateFieldGet(this, _GxIdeLaunchpad_chShortcutsEl, "f").suspend = true;
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
__classPrivateFieldGet(this, _GxIdeLaunchpad_chShortcutsEl, "f").suspend = false;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
78
|
/**
|
|
92
79
|
* Organizes received data and builds tab model
|
|
93
80
|
*/
|
|
@@ -167,7 +154,8 @@ const GxIdeLaunchpad = class {
|
|
|
167
154
|
if (!this.data || !this.sections || this.sections.length === 0) {
|
|
168
155
|
return null;
|
|
169
156
|
}
|
|
170
|
-
|
|
157
|
+
// TODO: Revisit re-enabling keyboard shortcuts 1, 2, 3 for switching launchpad tabs (Web Apps, Native Apps, APIs)
|
|
158
|
+
return (index.h(index.Host, null, index.h("ch-theme", { model: CSS_BUNDLES }), index.h("ch-tab-render", { class: {
|
|
171
159
|
scrollable: true,
|
|
172
160
|
tab: true,
|
|
173
161
|
[MAIN_SECTION_CLASSES]: true
|
|
@@ -196,7 +184,7 @@ const GxIdeLaunchpad = class {
|
|
|
196
184
|
"data": ["watchDataHandler"]
|
|
197
185
|
}; }
|
|
198
186
|
};
|
|
199
|
-
|
|
187
|
+
_GxIdeLaunchpad_componentLocale = new WeakMap();
|
|
200
188
|
GxIdeLaunchpad.style = launchpadCss;
|
|
201
189
|
|
|
202
190
|
exports.gx_ide_launchpad = GxIdeLaunchpad;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gx-ide-launchpad.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,YAAY,GAAG,itBAAitB;;;;;;;;;;;;;;;;;;;ACkBtuB,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,gBAAgB;IAChB,kBAAkB;IAClB,cAAc;IACd,kBAAkB;IAClB,eAAe;IACf,qBAAqB;CACtB,CAAC;AAEF,MAAM,oBAAoB,GAAW,MAAM,CAAC;AAC5C,MAAM,qBAAqB,GAAW,UAAU,CAAC;AACjD,MAAM,wBAAwB,GAAW,aAAa,CAAC;AACvD,MAAM,iBAAiB,GAAW,MAAM,CAAC;AAEzC;AACA,MAAM,8BAA8B,GAAW,uBAAuB,CAAC;MAQ1D,cAAc;;;;;;QACzB,gDAAuC;QACvC,uCAAgBA,kBAAY,CAAC,0CAA0C,CAAC,EAAC;QACzE,kDAAsB;oBAOa,SAAS;4BAKZ,IAAI;wBAKJ,EAAE;wBAKJ,EAAE;;IAoBhC,gBAAgB,CAAC,QAA4B;QAC3C,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,IAAI,CAAC,YAAY,EAAE,CAAC;SACrB;KACF;IAED,MAAM,iBAAiB;QACrB,IAAI;YACF,uBAAA,IAAI,mCAAoB,MAAMC,aAAM,CAAC,mBAAmB,CAAC,IAAI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,qBAAqB,CAAC,KAAK,CAAC;SAC5B,EACT,CACE,EAENA,iBACE,IAAI,EAAE,wBAAwB,EAC9B,KAAK,EAAE;gBACL,aAAa,EAAE,IAAI;gBACnB,CAAC,8BAA8B,GAAG,IAAI;aACvC,EACD,IAAI,EAAC,wBAAwB,IAE7BA,wDACE,OAAO,EACL,CAAA,MAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,aAAa,CAAC,0CAAE,OAAO,KAAI,EAAE,IAE3D;YACH,gBAAgB,EAAE,CAAC,KAAU,KAC3B,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC;SAC5B,EACJ;YACH,iBAAiB,EAAE,CAAC,KAAU,KAC5B,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC;SAC5B,EACJ;YACH,mBAAmB,EAAE,CAAC,KAAU,KAC9B,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;SACzB,EACT,CACE,EAENA,iBACE,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,8BAA8B,GAAG,IAAI,EAAE,EAC7D,IAAI,EAAC,iBAAiB,IAEtBA,iDACE,IAAI,EAAE,CAAA,MAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,0CAAE,IAAI,KAAI,EAAE,IACrD;YACH,gBAAgB,EAAE,CAAC,KAAU,KAC3B,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC;SAC5B,EACJ;YACH,iBAAiB,EAAE,CAAC,KAAU,KAC5B,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC;SAC5B,EACT,CACE,CACQ,CACX,EACP;KACH;;;;;;;;;;;;","names":["getAssetPath","Locale","h","Host"],"sources":["src/components/launchpad/root/launchpad.scss?tag=gx-ide-launchpad&encapsulation=shadow","src/components/launchpad/root/launchpad.tsx"],"sourcesContent":["@use \"../../../global/temporary-mercury-overrides/tab.scss\" as *;\n\n:host {\n display: grid;\n block-size: 100%;\n overflow: auto;\n grid-template-rows: 1fr;\n}\n\n.web-apps,\n.native-apps,\n.apis {\n padding-block-start: 16px;\n overflow: auto;\n block-size: 100%;\n}\n\n// WA: Add scrollbar styling for ch-tab-render until Mercury provides proper support\n.tab::part(page) {\n scrollbar-width: thin;\n}\n\n// WA: Apply spacing body to tab slots, instad of the whole component.\n// TODO: Resolve this on Mercury, with some addition class maybe.\n.spacing-body,\n:host(.spacing-body) {\n > ch-tab-render > .tab-slot-spacing-body {\n padding-block: var(--spacing-body-block-start) var(--spacing-body-block-end);\n padding-inline: var(--spacing-body-inline-start)\n var(--spacing-body-inline-end);\n }\n}\n","import {\n Component,\n Host,\n Prop,\n Element,\n State,\n getAssetPath,\n Method,\n h,\n Watch,\n Event,\n EventEmitter\n} from \"@stencil/core\";\n\nimport { MercuryBundles } from \"@genexus/mercury\";\nimport { TabModel } from \"@genexus/chameleon-controls-library\";\nimport { Locale } from \"../../../common/locale\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/tab\",\n \"utils/form--full\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\n\nconst MAIN_SECTION_CLASSES: string = \"main\";\nconst WEB_APPS_TAB_SELECTOR: string = \"web-apps\";\nconst NATIVE_APPS_TAB_SELECTOR: string = \"native-apps\";\nconst APIS_TAB_SELECTOR: string = \"apis\";\n\n// Temporary WA (Read WA in launchpad.scss)\nconst TAB_SLOT_SPACING_BODY_SELECTOR: string = \"tab-slot-spacing-body\";\n\n@Component({\n tag: \"gx-ide-launchpad\",\n styleUrl: \"launchpad.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/launchpad\"]\n})\nexport class GxIdeLaunchpad {\n #chShortcutsEl: HTMLChShortcutsElement;\n #shortcutsSrc = getAssetPath(`./gx-ide-assets/launchpad/shortcuts.json`);\n #componentLocale: any;\n\n @Element() el: HTMLGxIdeLaunchpadElement;\n\n /**\n * JSON data containing section structure\n */\n @Prop() data: string | undefined = undefined;\n\n /**\n * Determines if the component runs in standalone mode\n */\n @Prop() isStandalone: boolean = true;\n\n /**\n * Array of sections for tabs\n */\n @State() sections: Array<any> = [];\n\n /**\n * Tab model for ch-tab-render\n */\n @State() tabModel: TabModel = [];\n\n /**\n * Event emitted when an object is selected for execution\n */\n @Event() objectSelected: EventEmitter<{\n key: { type: string; id: string } | string;\n }>;\n\n /**\n * Event emitted when copying to clipboard\n */\n @Event() copyToClipboard: EventEmitter<{ url: string }>;\n\n /**\n * Event emitted when opening app store\n */\n @Event() openOnTheAppStore: EventEmitter<{ url: string }>;\n\n @Watch(\"data\")\n watchDataHandler(newValue: string | undefined) {\n if (newValue !== undefined) {\n this.organizeData();\n }\n }\n\n async componentWillLoad() {\n try {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n } catch (error) {\n console.error(\"Error loading locale:\", error);\n this.#componentLocale = {\n tabs: {\n webApps: \"WEB APPS\",\n nativeApps: \"NATIVE APPS\",\n apis: \"APIS\"\n }\n };\n }\n\n if (this.data) {\n this.organizeData();\n }\n }\n\n componentDidLoad() {}\n\n /**\n * Suspends or reactivates the shortcuts\n */\n @Method()\n async suspendShortcuts(suspendShortcuts: boolean) {\n if (suspendShortcuts) {\n this.#chShortcutsEl.suspend = true;\n } else {\n this.#chShortcutsEl.suspend = false;\n }\n }\n\n /**\n * Organizes received data and builds tab model\n */\n private organizeData(): void {\n if (this.data) {\n try {\n const parsedData =\n typeof this.data === \"string\" ? JSON.parse(this.data) : this.data;\n this.sections = parsedData.sections || [];\n this.buildTabModel();\n } catch (error) {\n console.error(\"Error parsing launchpad data:\", error);\n this.sections = [];\n this.tabModel = [];\n }\n }\n }\n\n /**\n * Builds tab model based on sections\n */\n private buildTabModel(): void {\n if (this.sections && this.sections.length > 0) {\n this.tabModel = this.sections.map(section => ({\n id: section.id,\n name: this.getLocalizedTabName(section.id)\n }));\n }\n }\n\n /**\n * Gets localized tab name based on section ID\n */\n private getLocalizedTabName(sectionId: string): string {\n const tabNames = this.#componentLocale?.tabs || {};\n\n switch (sectionId) {\n case \"web-apps\":\n return tabNames.webApps || \"WEB APPS\";\n case \"native-apps\":\n return tabNames.nativeApps || \"NATIVE APPS\";\n case \"apis\":\n return tabNames.apis || \"APIS\";\n default:\n return sectionId.toUpperCase().replace(/-/g, \" \");\n }\n }\n\n /**\n * Handles object selection from subcomponents\n */\n private handleObjectSelection(event: any) {\n let key = event.detail.key;\n\n // Convert string format \"type|id\" to object format\n if (typeof key === \"string\" && key.includes(\"|\")) {\n const parts = key.split(\"|\");\n if (parts.length === 2) {\n key = {\n type: parts[0],\n id: parts[1]\n };\n }\n }\n\n this.objectSelected.emit({ key });\n }\n\n /**\n * Handles copy to clipboard from subcomponents\n */\n private handleCopyToClipboard(event: any) {\n this.copyToClipboard.emit({ url: event.detail.url });\n }\n\n /**\n * Handles open app store from subcomponents\n */\n private handleOpenAppStore(event: any) {\n this.openOnTheAppStore.emit({ url: event.detail.url });\n }\n\n render() {\n if (!this.data || !this.sections || this.sections.length === 0) {\n return null;\n }\n\n return (\n <Host>\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\n <ch-tab-render\n class={{\n scrollable: true,\n tab: true,\n [MAIN_SECTION_CLASSES]: true\n }}\n tabListPosition=\"block-start\"\n model={this.tabModel}\n selectedId={WEB_APPS_TAB_SELECTOR}\n overflow=\"auto\"\n contain=\"size\"\n >\n <div\n slot={WEB_APPS_TAB_SELECTOR}\n class={{ \"web-apps\": true, [TAB_SLOT_SPACING_BODY_SELECTOR]: true }}\n part=\"tab-button-web-apps\"\n >\n <gx-ide-launchpad-web-apps\n objects={\n this.sections.find(s => s.id === \"web-apps\")?.objects || []\n }\n {...({\n onObjectSelected: (event: any) =>\n this.handleObjectSelection(event)\n } as any)}\n {...({\n onCopyToClipboard: (event: any) =>\n this.handleCopyToClipboard(event)\n } as any)}\n />\n </div>\n\n <div\n slot={NATIVE_APPS_TAB_SELECTOR}\n class={{\n \"native-apps\": true,\n [TAB_SLOT_SPACING_BODY_SELECTOR]: true\n }}\n part=\"tab-button-native-apps\"\n >\n <gx-ide-launchpad-native-apps\n objects={\n this.sections.find(s => s.id === \"native-apps\")?.objects || []\n }\n {...({\n onObjectSelected: (event: any) =>\n this.handleObjectSelection(event)\n } as any)}\n {...({\n onCopyToClipboard: (event: any) =>\n this.handleCopyToClipboard(event)\n } as any)}\n {...({\n onOpenOnTheAppStore: (event: any) =>\n this.handleOpenAppStore(event)\n } as any)}\n />\n </div>\n\n <div\n slot={APIS_TAB_SELECTOR}\n class={{ apis: true, [TAB_SLOT_SPACING_BODY_SELECTOR]: true }}\n part=\"tab-button-apis\"\n >\n <gx-ide-launchpad-apis\n apis={this.sections.find(s => s.id === \"apis\")?.apis || []}\n {...({\n onObjectSelected: (event: any) =>\n this.handleObjectSelection(event)\n } as any)}\n {...({\n onCopyToClipboard: (event: any) =>\n this.handleCopyToClipboard(event)\n } as any)}\n />\n </div>\n </ch-tab-render>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"gx-ide-launchpad.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,YAAY,GAAG,itBAAitB;;;;;;;;;;;;;;;;;;;ACgBtuB,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,gBAAgB;IAChB,kBAAkB;IAClB,cAAc;IACd,kBAAkB;IAClB,eAAe;IACf,qBAAqB;CACtB,CAAC;AAEF,MAAM,oBAAoB,GAAW,MAAM,CAAC;AAC5C,MAAM,qBAAqB,GAAW,UAAU,CAAC;AACjD,MAAM,wBAAwB,GAAW,aAAa,CAAC;AACvD,MAAM,iBAAiB,GAAW,MAAM,CAAC;AA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,KAC5B,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC;SAC5B,EACT,CACE,EAENA,iBACE,IAAI,EAAE,wBAAwB,EAC9B,KAAK,EAAE;gBACL,aAAa,EAAE,IAAI;gBACnB,CAAC,8BAA8B,GAAG,IAAI;aACvC,EACD,IAAI,EAAC,wBAAwB,IAE7BA,wDACE,OAAO,EACL,CAAA,MAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,aAAa,CAAC,0CAAE,OAAO,KAAI,EAAE,IAE3D;YACH,gBAAgB,EAAE,CAAC,KAAU,KAC3B,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC;SAC5B,EACJ;YACH,iBAAiB,EAAE,CAAC,KAAU,KAC5B,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC;SAC5B,EACJ;YACH,mBAAmB,EAAE,CAAC,KAAU,KAC9B,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;SACzB,EACT,CACE,EAENA,iBACE,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,8BAA8B,GAAG,IAAI,EAAE,EAC7D,IAAI,EAAC,iBAAiB,IAEtBA,iDACE,IAAI,EAAE,CAAA,MAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,0CAAE,IAAI,KAAI,EAAE,IACrD;YACH,gBAAgB,EAAE,CAAC,KAAU,KAC3B,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC;SAC5B,EACJ;YACH,iBAAiB,EAAE,CAAC,KAAU,KAC5B,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC;SAC5B,EACT,CACE,CACQ,CACX,EACP;KACH;;;;;;;;;;;;","names":["Locale","h","Host"],"sources":["src/components/launchpad/root/launchpad.scss?tag=gx-ide-launchpad&encapsulation=shadow","src/components/launchpad/root/launchpad.tsx"],"sourcesContent":["@use \"../../../global/temporary-mercury-overrides/tab.scss\" as *;\n\n:host {\n display: grid;\n block-size: 100%;\n overflow: auto;\n grid-template-rows: 1fr;\n}\n\n.web-apps,\n.native-apps,\n.apis {\n padding-block-start: 16px;\n overflow: auto;\n block-size: 100%;\n}\n\n// WA: Add scrollbar styling for ch-tab-render until Mercury provides proper support\n.tab::part(page) {\n scrollbar-width: thin;\n}\n\n// WA: Apply spacing body to tab slots, instad of the whole component.\n// TODO: Resolve this on Mercury, with some addition class maybe.\n.spacing-body,\n:host(.spacing-body) {\n > ch-tab-render > .tab-slot-spacing-body {\n padding-block: var(--spacing-body-block-start) var(--spacing-body-block-end);\n padding-inline: var(--spacing-body-inline-start)\n var(--spacing-body-inline-end);\n }\n}\n","import {\n Component,\n Host,\n Prop,\n Element,\n State,\n h,\n Watch,\n Event,\n EventEmitter\n} from \"@stencil/core\";\n\nimport { MercuryBundles } from \"@genexus/mercury\";\nimport { TabModel } from \"@genexus/chameleon-controls-library\";\nimport { Locale } from \"../../../common/locale\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/tab\",\n \"utils/form--full\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\n\nconst MAIN_SECTION_CLASSES: string = \"main\";\nconst WEB_APPS_TAB_SELECTOR: string = \"web-apps\";\nconst NATIVE_APPS_TAB_SELECTOR: string = \"native-apps\";\nconst APIS_TAB_SELECTOR: string = \"apis\";\n\n// Temporary WA (Read WA in launchpad.scss)\nconst TAB_SLOT_SPACING_BODY_SELECTOR: string = \"tab-slot-spacing-body\";\n\n@Component({\n tag: \"gx-ide-launchpad\",\n styleUrl: \"launchpad.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/launchpad\"]\n})\nexport class GxIdeLaunchpad {\n #componentLocale: any;\n\n @Element() el: HTMLGxIdeLaunchpadElement;\n\n /**\n * JSON data containing section structure\n */\n @Prop() data: string | undefined = undefined;\n\n /**\n * Determines if the component runs in standalone mode\n */\n @Prop() isStandalone: boolean = true;\n\n /**\n * Array of sections for tabs\n */\n @State() sections: Array<any> = [];\n\n /**\n * Tab model for ch-tab-render\n */\n @State() tabModel: TabModel = [];\n\n /**\n * Event emitted when an object is selected for execution\n */\n @Event() objectSelected: EventEmitter<{\n key: { type: string; id: string } | string;\n }>;\n\n /**\n * Event emitted when copying to clipboard\n */\n @Event() copyToClipboard: EventEmitter<{ url: string }>;\n\n /**\n * Event emitted when opening app store\n */\n @Event() openOnTheAppStore: EventEmitter<{ url: string }>;\n\n @Watch(\"data\")\n watchDataHandler(newValue: string | undefined) {\n if (newValue !== undefined) {\n this.organizeData();\n }\n }\n\n async componentWillLoad() {\n try {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n } catch (error) {\n console.error(\"Error loading locale:\", error);\n this.#componentLocale = {\n tabs: {\n webApps: \"WEB APPS\",\n nativeApps: \"NATIVE APPS\",\n apis: \"APIS\"\n }\n };\n }\n\n if (this.data) {\n this.organizeData();\n }\n }\n\n componentDidLoad() {}\n\n /**\n * Organizes received data and builds tab model\n */\n private organizeData(): void {\n if (this.data) {\n try {\n const parsedData =\n typeof this.data === \"string\" ? JSON.parse(this.data) : this.data;\n this.sections = parsedData.sections || [];\n this.buildTabModel();\n } catch (error) {\n console.error(\"Error parsing launchpad data:\", error);\n this.sections = [];\n this.tabModel = [];\n }\n }\n }\n\n /**\n * Builds tab model based on sections\n */\n private buildTabModel(): void {\n if (this.sections && this.sections.length > 0) {\n this.tabModel = this.sections.map(section => ({\n id: section.id,\n name: this.getLocalizedTabName(section.id)\n }));\n }\n }\n\n /**\n * Gets localized tab name based on section ID\n */\n private getLocalizedTabName(sectionId: string): string {\n const tabNames = this.#componentLocale?.tabs || {};\n\n switch (sectionId) {\n case \"web-apps\":\n return tabNames.webApps || \"WEB APPS\";\n case \"native-apps\":\n return tabNames.nativeApps || \"NATIVE APPS\";\n case \"apis\":\n return tabNames.apis || \"APIS\";\n default:\n return sectionId.toUpperCase().replace(/-/g, \" \");\n }\n }\n\n /**\n * Handles object selection from subcomponents\n */\n private handleObjectSelection(event: any) {\n let key = event.detail.key;\n\n // Convert string format \"type|id\" to object format\n if (typeof key === \"string\" && key.includes(\"|\")) {\n const parts = key.split(\"|\");\n if (parts.length === 2) {\n key = {\n type: parts[0],\n id: parts[1]\n };\n }\n }\n\n this.objectSelected.emit({ key });\n }\n\n /**\n * Handles copy to clipboard from subcomponents\n */\n private handleCopyToClipboard(event: any) {\n this.copyToClipboard.emit({ url: event.detail.url });\n }\n\n /**\n * Handles open app store from subcomponents\n */\n private handleOpenAppStore(event: any) {\n this.openOnTheAppStore.emit({ url: event.detail.url });\n }\n\n render() {\n if (!this.data || !this.sections || this.sections.length === 0) {\n return null;\n }\n\n // TODO: Revisit re-enabling keyboard shortcuts 1, 2, 3 for switching launchpad tabs (Web Apps, Native Apps, APIs)\n return (\n <Host>\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n\n <ch-tab-render\n class={{\n scrollable: true,\n tab: true,\n [MAIN_SECTION_CLASSES]: true\n }}\n tabListPosition=\"block-start\"\n model={this.tabModel}\n selectedId={WEB_APPS_TAB_SELECTOR}\n overflow=\"auto\"\n contain=\"size\"\n >\n <div\n slot={WEB_APPS_TAB_SELECTOR}\n class={{ \"web-apps\": true, [TAB_SLOT_SPACING_BODY_SELECTOR]: true }}\n part=\"tab-button-web-apps\"\n >\n <gx-ide-launchpad-web-apps\n objects={\n this.sections.find(s => s.id === \"web-apps\")?.objects || []\n }\n {...({\n onObjectSelected: (event: any) =>\n this.handleObjectSelection(event)\n } as any)}\n {...({\n onCopyToClipboard: (event: any) =>\n this.handleCopyToClipboard(event)\n } as any)}\n />\n </div>\n\n <div\n slot={NATIVE_APPS_TAB_SELECTOR}\n class={{\n \"native-apps\": true,\n [TAB_SLOT_SPACING_BODY_SELECTOR]: true\n }}\n part=\"tab-button-native-apps\"\n >\n <gx-ide-launchpad-native-apps\n objects={\n this.sections.find(s => s.id === \"native-apps\")?.objects || []\n }\n {...({\n onObjectSelected: (event: any) =>\n this.handleObjectSelection(event)\n } as any)}\n {...({\n onCopyToClipboard: (event: any) =>\n this.handleCopyToClipboard(event)\n } as any)}\n {...({\n onOpenOnTheAppStore: (event: any) =>\n this.handleOpenAppStore(event)\n } as any)}\n />\n </div>\n\n <div\n slot={APIS_TAB_SELECTOR}\n class={{ apis: true, [TAB_SLOT_SPACING_BODY_SELECTOR]: true }}\n part=\"tab-button-apis\"\n >\n <gx-ide-launchpad-apis\n apis={this.sections.find(s => s.id === \"apis\")?.apis || []}\n {...({\n onObjectSelected: (event: any) =>\n this.handleObjectSelection(event)\n } as any)}\n {...({\n onCopyToClipboard: (event: any) =>\n this.handleCopyToClipboard(event)\n } as any)}\n />\n </div>\n </ch-tab-render>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-75aef097.js');
|
|
6
|
+
const assetsManager = require('./assets-manager-089e91b1.js');
|
|
7
|
+
require('./mer-animated-dots-78490ca4.js');
|
|
8
|
+
require('lit');
|
|
9
|
+
require('lit/directives/when.js');
|
|
10
|
+
require('lit/directives/if-defined.js');
|
|
11
|
+
|
|
12
|
+
const gxIdeMultiSelectCss = ":host{display:grid;block-size:100%}.opacity-0{opacity:0}.gxi-hidden{display:none !important}.align-center{display:flex;align-items:center}.align-end{display:flex;align-items:end}.overflow-auto{overflow:auto}:host(.gx-ide-component){height:100% !important;display:flex !important;flex-direction:column !important}.gx-ide-main-wrapper{color:var(--gx-ide-component-text-color);font-weight:var(--font-style-regular);font-size:var(--font-size-body-m);font-family:var(--font-family-body);height:100%;display:flex;flex-direction:column;flex-grow:1;box-sizing:border-box}.buttons-container{display:flex;gap:var(--spacing-gap-m)}.giu-static-pill-icon-and-text,.giu-static-pill{background-color:var(--elevation-background-color, var(--color-accent-surface-elevation-1));padding-inline:var(--spacing-padding-m);color:var(--color-text-neutral-default);font-size:var(--font-size-body-s);line-height:var(--line-height-relaxed);font-weight:var(--font-style-regular);border-radius:4px;min-block-size:25px;display:inline-grid;align-items:center;pointer-events:none;inline-size:max-content}.giu-static-pill-icon-and-text{display:inline-grid;grid-auto-flow:column;grid-auto-columns:max-content;gap:var(--spacing-gap-m)}.tab-full-width-buttons::part(tab-list block-start),.tab-full-width-buttons::part(tab-list block-end){grid-auto-columns:1fr}.tab-full-width-buttons::part(tab block-start){justify-content:center}.tree-view::part(item__header){--icon__system_warning_warning--disabled:var(\n --icon__system_warning_warning--enabled\n )}.tabular-grid{--focus-outline-width:1px}ch-popover{background-color:var(--color-accent-surface-elevation-1);border:1px solid var(--color-border-surface-on-surface);border-radius:var(--border-radius-s);box-shadow:var(--shadow-elevation-2)}ch-popover>div{display:flex;flex-direction:column;gap:0;padding:var(--spacing-padding-m);max-block-size:300px;overflow-y:auto}.checkbox-item{display:flex;inline-size:100%;padding-block:var(--spacing-padding-xs);padding-inline:var(--spacing-padding-m);cursor:pointer;border-radius:var(--border-radius-s)}.checkbox-item:hover{background-color:var(--color-accent-item-selected)}.checkbox-item::part(checkbox){inline-size:100%}.checkbox-item::part(label){inline-size:100%;cursor:pointer;flex:1}.multi-select__button{display:flex;align-items:center;gap:var(--spacing-gap-s);overflow:hidden}.multi-select__chevron{flex-shrink:0;margin-inline-start:auto}.multi-select__placeholder{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.multi-select__items{display:flex;flex-wrap:wrap;gap:var(--spacing-gap-xs);flex:1;align-items:center}.multi-select__item{display:inline-flex;align-items:center;gap:var(--spacing-gap-xs);padding:2px var(--spacing-padding-xs);background-color:var(--color-accent-item-pressed);border-radius:var(--border-radius-s)}.multi-select__item button{padding:0}.multi-select__caption{color:var(--color-text-neutral-on-disabled)}.multi-select__close{padding:0;margin:0}ch-checkbox.checkbox::part(label){font-weight:var(--font-style-regular);color:var(--color-text-neutral-default)}";
|
|
13
|
+
|
|
14
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
15
|
+
if (kind === "a" && !f)
|
|
16
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
17
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
18
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
19
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
20
|
+
};
|
|
21
|
+
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
22
|
+
if (kind === "m")
|
|
23
|
+
throw new TypeError("Private method is not writable");
|
|
24
|
+
if (kind === "a" && !f)
|
|
25
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
26
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
27
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
28
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
29
|
+
};
|
|
30
|
+
var _GxIdeMultiSelect_multiButtonEl, _GxIdeMultiSelect_popoverEl, _GxIdeMultiSelect_togglePopover, _GxIdeMultiSelect_checkboxChangeHandler, _GxIdeMultiSelect_removeSelectedItemHandler, _GxIdeMultiSelect_isItemSelected, _GxIdeMultiSelect_renderSelectedItems;
|
|
31
|
+
const CSS_BUNDLES = [
|
|
32
|
+
"resets/box-sizing",
|
|
33
|
+
"components/button",
|
|
34
|
+
"components/icon",
|
|
35
|
+
"components/checkbox",
|
|
36
|
+
"utils/typography",
|
|
37
|
+
"utils/spacing",
|
|
38
|
+
"chameleon/scrollbar",
|
|
39
|
+
"components/combo-box"
|
|
40
|
+
];
|
|
41
|
+
const CHEVRON_DOWN_ICON = assetsManager.getIconPath({
|
|
42
|
+
category: "navigation",
|
|
43
|
+
name: "chevron-down",
|
|
44
|
+
colorType: "on-interactive"
|
|
45
|
+
});
|
|
46
|
+
const CLOSE_ICON = assetsManager.getIconPath({
|
|
47
|
+
category: "system",
|
|
48
|
+
name: "close",
|
|
49
|
+
colorType: "on-interactive"
|
|
50
|
+
});
|
|
51
|
+
const GxIdeMultiSelect = class {
|
|
52
|
+
constructor(hostRef) {
|
|
53
|
+
index.registerInstance(this, hostRef);
|
|
54
|
+
this.gxSelectionChange = index.createEvent(this, "gxSelectionChange", 7);
|
|
55
|
+
_GxIdeMultiSelect_multiButtonEl.set(this, void 0);
|
|
56
|
+
_GxIdeMultiSelect_popoverEl.set(this, void 0);
|
|
57
|
+
_GxIdeMultiSelect_togglePopover.set(this, () => {
|
|
58
|
+
if (!this.disabled) {
|
|
59
|
+
this.showPopover = !this.showPopover;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
_GxIdeMultiSelect_checkboxChangeHandler.set(this, (optionValue, event) => {
|
|
63
|
+
const target = event.target;
|
|
64
|
+
const isChecked = target.value === target.checkedValue;
|
|
65
|
+
let newValue;
|
|
66
|
+
if (isChecked) {
|
|
67
|
+
newValue = [...this.value, optionValue];
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
newValue = this.value.filter(val => val !== optionValue);
|
|
71
|
+
}
|
|
72
|
+
this.gxSelectionChange.emit(newValue);
|
|
73
|
+
});
|
|
74
|
+
_GxIdeMultiSelect_removeSelectedItemHandler.set(this, (itemValue) => {
|
|
75
|
+
const newValue = this.value.filter(val => val !== itemValue);
|
|
76
|
+
this.gxSelectionChange.emit(newValue);
|
|
77
|
+
});
|
|
78
|
+
_GxIdeMultiSelect_isItemSelected.set(this, (itemValue) => {
|
|
79
|
+
return this.value.includes(itemValue);
|
|
80
|
+
});
|
|
81
|
+
_GxIdeMultiSelect_renderSelectedItems.set(this, () => {
|
|
82
|
+
if (this.value.length === 0) {
|
|
83
|
+
return (index.h("span", { class: "multi-select__placeholder body-italic-m" }, this.placeholder));
|
|
84
|
+
}
|
|
85
|
+
const selectedOptions = this.model.filter(opt => this.value.includes(opt.value));
|
|
86
|
+
return (index.h("div", { class: "multi-select__items" }, selectedOptions.map(item => (index.h("div", { class: "multi-select__item", key: item.value }, index.h("span", { class: "multi-select__caption body-regular-s" }, item.caption), index.h("button", { type: "button", class: "button-tertiary button-icon-only multi-select__close", onClick: e => {
|
|
87
|
+
e.stopPropagation();
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
__classPrivateFieldGet(this, _GxIdeMultiSelect_removeSelectedItemHandler, "f").call(this, item.value);
|
|
90
|
+
}, "aria-label": `Remove ${item.caption}` }, index.h("ch-image", { class: "icon-xs", src: CLOSE_ICON, type: "mask" })))))));
|
|
91
|
+
});
|
|
92
|
+
this.showPopover = false;
|
|
93
|
+
this.model = [];
|
|
94
|
+
this.value = [];
|
|
95
|
+
this.placeholder = "Select options";
|
|
96
|
+
this.disabled = false;
|
|
97
|
+
}
|
|
98
|
+
componentDidLoad() {
|
|
99
|
+
if (__classPrivateFieldGet(this, _GxIdeMultiSelect_popoverEl, "f") && __classPrivateFieldGet(this, _GxIdeMultiSelect_multiButtonEl, "f")) {
|
|
100
|
+
__classPrivateFieldGet(this, _GxIdeMultiSelect_popoverEl, "f").actionElement = __classPrivateFieldGet(this, _GxIdeMultiSelect_multiButtonEl, "f");
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
render() {
|
|
104
|
+
return (index.h(index.Host, null, index.h("ch-theme", { model: CSS_BUNDLES }), index.h("button", { class: "combo-box multi-select__button", type: "button", ref: (el) => (__classPrivateFieldSet(this, _GxIdeMultiSelect_multiButtonEl, el, "f")), onClick: __classPrivateFieldGet(this, _GxIdeMultiSelect_togglePopover, "f"), disabled: this.disabled }, __classPrivateFieldGet(this, _GxIdeMultiSelect_renderSelectedItems, "f").call(this), index.h("ch-image", { class: "icon-m multi-select__chevron", src: CHEVRON_DOWN_ICON, type: "mask" })), index.h("ch-popover", { ref: (el) => (__classPrivateFieldSet(this, _GxIdeMultiSelect_popoverEl, el, "f")), closeOnClickOutside: true, show: this.showPopover, blockAlign: "outside-end", inlineAlign: "inside-end", inlineSizeMatch: "action-element", class: "scrollable" }, index.h("div", null, this.model.map(option => (index.h("ch-checkbox", { class: "checkbox checkbox-item", caption: option.caption, checkedValue: "true", value: __classPrivateFieldGet(this, _GxIdeMultiSelect_isItemSelected, "f").call(this, option.value) ? "true" : "false", startImgSrc: option.startImgSrc, onInput: e => __classPrivateFieldGet(this, _GxIdeMultiSelect_checkboxChangeHandler, "f").call(this, option.value, e) })))))));
|
|
105
|
+
}
|
|
106
|
+
get el() { return index.getElement(this); }
|
|
107
|
+
};
|
|
108
|
+
_GxIdeMultiSelect_multiButtonEl = new WeakMap(), _GxIdeMultiSelect_popoverEl = new WeakMap(), _GxIdeMultiSelect_togglePopover = new WeakMap(), _GxIdeMultiSelect_checkboxChangeHandler = new WeakMap(), _GxIdeMultiSelect_removeSelectedItemHandler = new WeakMap(), _GxIdeMultiSelect_isItemSelected = new WeakMap(), _GxIdeMultiSelect_renderSelectedItems = new WeakMap();
|
|
109
|
+
GxIdeMultiSelect.style = gxIdeMultiSelectCss;
|
|
110
|
+
|
|
111
|
+
exports.gx_ide_multi_select = GxIdeMultiSelect;
|
|
112
|
+
|
|
113
|
+
//# sourceMappingURL=gx-ide-multi-select.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"gx-ide-multi-select.entry.cjs.js","mappings":";;;;;;;;;;;AAAA,MAAM,mBAAmB,GAAG,2/FAA2/F;;;;;;;;;;;;;;;;;;;ACavhG,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,qBAAqB;IACrB,kBAAkB;IAClB,eAAe;IACf,qBAAqB;IACrB,sBAAsB;CACvB,CAAC;AAEF,MAAM,iBAAiB,GAAGA,yBAAW,CAAC;IACpC,QAAQ,EAAE,YAAY;IACtB,IAAI,EA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Q,EACb,GAAG,EAAE,CAAC,EAAqB,MAAM,uBAAA,IAAI,mCAAkB,EAAE,MAAA,CAAC,EAC1D,OAAO,EAAE,uBAAA,IAAI,uCAAe,EAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAEtB,uBAAA,IAAI,6CAAqB,MAAzB,IAAI,CAAuB,EAC5BA,sBACE,KAAK,EAAC,8BAA8B,EACpC,GAAG,EAAE,iBAAiB,EACtB,IAAI,EAAC,MAAM,GACX,CACK,EAETA,wBACE,GAAG,EAAE,CAAC,EAAwB,MAAM,uBAAA,IAAI,+BAAc,EAAE,MAAA,CAAC,EACzD,mBAAmB,QACnB,IAAI,EAAE,IAAI,CAAC,WAAW,EACtB,UAAU,EAAC,aAAa,EACxB,WAAW,EAAC,YAAY,EACxB,eAAe,EAAC,gBAAgB,EAChC,KAAK,EAAE,YAAY,IAEnBA,qBACG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,KACpBA,yBACE,KAAK,EAAC,wBAAwB,EAC9B,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,YAAY,EAAC,MAAM,EACnB,KAAK,EAAE,uBAAA,IAAI,wCAAgB,MAApB,IAAI,EAAiB,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,GAAG,OAAO,EAC5D,WAAW,EAAE,MAAM,CAAC,WAAW,EAC/B,OAAO,EAAE,CAAC,IAAI,uBAAA,IAAI,+CAAuB,MAA3B,IAAI,EAAwB,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,GAC1D,CACH,CAAC,CACE,CACK,CACR,EACP;KACH;;;;;;;;","names":["getIconPath","h","Host"],"sources":["src/components/_helpers/multi-select/gx-ide-multi-select.scss?tag=gx-ide-multi-select&encapsulation=shadow","src/components/_helpers/multi-select/gx-ide-multi-select.tsx"],"sourcesContent":["@import \"../../../global/gx-ide-common\";\n\nch-popover {\n background-color: var(--color-accent-surface-elevation-1);\n border: 1px solid var(--color-border-surface-on-surface);\n border-radius: var(--border-radius-s);\n box-shadow: var(--shadow-elevation-2);\n\n > div {\n display: flex;\n flex-direction: column;\n gap: 0;\n padding: var(--spacing-padding-m);\n max-block-size: 300px;\n overflow-y: auto;\n }\n}\n\n.checkbox-item {\n display: flex;\n inline-size: 100%;\n padding-block: var(--spacing-padding-xs);\n padding-inline: var(--spacing-padding-m);\n cursor: pointer;\n border-radius: var(--border-radius-s);\n\n &:hover {\n background-color: var(--color-accent-item-selected);\n }\n\n &::part(checkbox) {\n inline-size: 100%;\n }\n\n &::part(label) {\n inline-size: 100%;\n cursor: pointer;\n flex: 1;\n }\n}\n\n.multi-select {\n &__button {\n display: flex;\n align-items: center;\n gap: var(--spacing-gap-s);\n overflow: hidden;\n }\n\n &__chevron {\n flex-shrink: 0;\n margin-inline-start: auto;\n }\n\n &__placeholder {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &__items {\n display: flex;\n flex-wrap: wrap;\n gap: var(--spacing-gap-xs);\n flex: 1;\n align-items: center;\n }\n\n &__item {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-gap-xs);\n padding: 2px var(--spacing-padding-xs);\n background-color: var(--color-accent-item-pressed);\n border-radius: var(--border-radius-s);\n\n & button {\n padding: 0;\n }\n }\n\n &__caption {\n color: var(--color-text-neutral-on-disabled);\n }\n\n &__close {\n padding: 0;\n margin: 0;\n }\n}\n\nch-checkbox.checkbox::part(label) {\n font-weight: var(--font-style-regular);\n color: var(--color-text-neutral-default);\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n State,\n Element,\n Event,\n EventEmitter\n} from \"@stencil/core\";\nimport { getIconPath, MercuryBundles } from \"@genexus/mercury\";\nimport { ComboBoxModel } from \"@genexus/chameleon-controls-library\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/button\",\n \"components/icon\",\n \"components/checkbox\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\",\n \"components/combo-box\"\n];\n\nconst CHEVRON_DOWN_ICON = getIconPath({\n category: \"navigation\",\n name: \"chevron-down\",\n colorType: \"on-interactive\"\n});\n\nconst CLOSE_ICON = getIconPath({\n category: \"system\",\n name: \"close\",\n colorType: \"on-interactive\"\n});\n\n@Component({\n tag: \"gx-ide-multi-select\",\n styleUrl: \"gx-ide-multi-select.scss\",\n shadow: true\n})\nexport class GxIdeMultiSelect {\n #multiButtonEl: HTMLButtonElement;\n #popoverEl: HTMLChPopoverElement;\n\n @Element() el: HTMLGxIdeMultiSelectElement;\n\n @State() showPopover = false;\n\n /**\n * Model with available options to select from\n */\n @Prop() readonly model: ComboBoxModel = [];\n\n /**\n * Currently selected item values\n */\n @Prop() readonly value: string[] = [];\n\n /**\n * Placeholder text when no items are selected\n */\n @Prop() readonly placeholder: string = \"Select options\";\n\n /**\n * Disabled state\n */\n @Prop() readonly disabled: boolean = false;\n\n /**\n * Emitted when the selection changes\n */\n @Event() gxSelectionChange: EventEmitter<string[]>;\n\n componentDidLoad() {\n if (this.#popoverEl && this.#multiButtonEl) {\n this.#popoverEl.actionElement = this.#multiButtonEl;\n }\n }\n\n #togglePopover = () => {\n if (!this.disabled) {\n this.showPopover = !this.showPopover;\n }\n };\n\n #checkboxChangeHandler = (\n optionValue: string,\n event: CustomEvent | InputEvent\n ) => {\n const target = event.target as HTMLChCheckboxElement;\n const isChecked = target.value === target.checkedValue;\n\n let newValue: string[];\n if (isChecked) {\n newValue = [...this.value, optionValue];\n } else {\n newValue = this.value.filter(val => val !== optionValue);\n }\n\n this.gxSelectionChange.emit(newValue);\n };\n\n #removeSelectedItemHandler = (itemValue: string) => {\n const newValue = this.value.filter(val => val !== itemValue);\n this.gxSelectionChange.emit(newValue);\n };\n\n #isItemSelected = (itemValue: string): boolean => {\n return this.value.includes(itemValue);\n };\n\n #renderSelectedItems = () => {\n if (this.value.length === 0) {\n return (\n <span class=\"multi-select__placeholder body-italic-m\">\n {this.placeholder}\n </span>\n );\n }\n\n const selectedOptions = this.model.filter(opt =>\n this.value.includes(opt.value)\n );\n\n return (\n <div class=\"multi-select__items\">\n {selectedOptions.map(item => (\n <div class=\"multi-select__item\" key={item.value}>\n <span class=\"multi-select__caption body-regular-s\">\n {item.caption}\n </span>\n <button\n type=\"button\"\n class=\"button-tertiary button-icon-only multi-select__close\"\n onClick={e => {\n e.stopPropagation();\n e.preventDefault();\n this.#removeSelectedItemHandler(item.value);\n }}\n aria-label={`Remove ${item.caption}`}\n >\n <ch-image class=\"icon-xs\" src={CLOSE_ICON} type=\"mask\"></ch-image>\n </button>\n </div>\n ))}\n </div>\n );\n };\n\n render() {\n return (\n <Host>\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n\n <button\n class=\"combo-box multi-select__button\"\n type=\"button\"\n ref={(el: HTMLButtonElement) => (this.#multiButtonEl = el)}\n onClick={this.#togglePopover}\n disabled={this.disabled}\n >\n {this.#renderSelectedItems()}\n <ch-image\n class=\"icon-m multi-select__chevron\"\n src={CHEVRON_DOWN_ICON}\n type=\"mask\"\n />\n </button>\n\n <ch-popover\n ref={(el: HTMLChPopoverElement) => (this.#popoverEl = el)}\n closeOnClickOutside\n show={this.showPopover}\n blockAlign=\"outside-end\"\n inlineAlign=\"inside-end\"\n inlineSizeMatch=\"action-element\"\n class={\"scrollable\"}\n >\n <div>\n {this.model.map(option => (\n <ch-checkbox\n class=\"checkbox checkbox-item\"\n caption={option.caption}\n checkedValue=\"true\"\n value={this.#isItemSelected(option.value) ? \"true\" : \"false\"}\n startImgSrc={option.startImgSrc}\n onInput={e => this.#checkboxChangeHandler(option.value, e)}\n />\n ))}\n </div>\n </ch-popover>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-75aef097.js');
|
|
6
|
+
const assetsManager = require('./assets-manager-089e91b1.js');
|
|
7
|
+
require('./mer-animated-dots-78490ca4.js');
|
|
8
|
+
require('lit');
|
|
9
|
+
require('lit/directives/when.js');
|
|
10
|
+
require('lit/directives/if-defined.js');
|
|
11
|
+
const config = require('./config-3bb95f39.js');
|
|
12
|
+
const locale = require('./locale-ff30a5f3.js');
|
|
13
|
+
|
|
14
|
+
const searchCss = ":host{display:grid;block-size:100%}.search{display:grid;grid-template-rows:max-content 1fr;gap:var(--spacing-gap-xl)}.search__header{display:grid;grid-template-columns:1fr}.search__results{position:relative}ch-tree-view-render::part(root-item item__header){padding-inline-start:0;font-weight:var(--font-style-semi-bold);font-size:var(--font-size-body-s);line-height:var(--line-height-relaxed);font-family:var(--font-family-body)}ch-tree-view-render::part(search-item item__header){padding-inline-start:0;font-weight:var(--font-style-regular);font-size:var(--font-size-body-s);line-height:var(--line-height-relaxed);font-family:var(--font-family-body);color:var(--color-text-neutral-neutral) !important}.input--loading::part(start-img){animation:spin 1s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}";
|
|
15
|
+
|
|
16
|
+
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
17
|
+
if (kind === "m")
|
|
18
|
+
throw new TypeError("Private method is not writable");
|
|
19
|
+
if (kind === "a" && !f)
|
|
20
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
21
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
22
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
23
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
24
|
+
};
|
|
25
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
26
|
+
if (kind === "a" && !f)
|
|
27
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
28
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
29
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
30
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
31
|
+
};
|
|
32
|
+
var _GxIdeSearch_componentLocale, _GxIdeSearch_searchInputValue, _GxIdeSearch_searchInputHandler, _GxIdeSearch_searchInputKeyDownHandler, _GxIdeSearch_mapSearchResultToTreeViewModel, _GxIdeSearch_treeItemDoubleClickHandler, _GxIdeSearch_renderSearchResults;
|
|
33
|
+
const CSS_BUNDLES = [
|
|
34
|
+
"resets/box-sizing",
|
|
35
|
+
"components/edit",
|
|
36
|
+
"components/tree-view",
|
|
37
|
+
"utils/typography",
|
|
38
|
+
"utils/spacing",
|
|
39
|
+
"chameleon/scrollbar"
|
|
40
|
+
];
|
|
41
|
+
const SEARCH_ICON = assetsManager.getIconPath({
|
|
42
|
+
category: "system",
|
|
43
|
+
name: "search",
|
|
44
|
+
colorType: "on-surface"
|
|
45
|
+
});
|
|
46
|
+
const INFORMATION_ICON = assetsManager.getIconPath({
|
|
47
|
+
category: "system",
|
|
48
|
+
name: "information",
|
|
49
|
+
colorType: "on-interactive"
|
|
50
|
+
});
|
|
51
|
+
const GxIdeSearch = class {
|
|
52
|
+
constructor(hostRef) {
|
|
53
|
+
index.registerInstance(this, hostRef);
|
|
54
|
+
_GxIdeSearch_componentLocale.set(this, void 0);
|
|
55
|
+
_GxIdeSearch_searchInputValue.set(this, "");
|
|
56
|
+
_GxIdeSearch_searchInputHandler.set(this, async (event) => {
|
|
57
|
+
var _a;
|
|
58
|
+
if (!this.isKbOpen) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const inputElement = event.target;
|
|
62
|
+
const searchText = (_a = inputElement === null || inputElement === void 0 ? void 0 : inputElement.value) === null || _a === void 0 ? void 0 : _a.trim();
|
|
63
|
+
__classPrivateFieldSet(this, _GxIdeSearch_searchInputValue, searchText, "f");
|
|
64
|
+
if (!searchText) {
|
|
65
|
+
this.searchResultModel = [];
|
|
66
|
+
this.hasSearched = false;
|
|
67
|
+
this.isSearching = false;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this.hasSearched = true;
|
|
71
|
+
this.isSearching = true;
|
|
72
|
+
this.searchResultModel = [];
|
|
73
|
+
try {
|
|
74
|
+
const searchResultData = await this.searchCallback({
|
|
75
|
+
text: searchText,
|
|
76
|
+
onlyTitles: false,
|
|
77
|
+
includeSubModules: true,
|
|
78
|
+
allBranches: false,
|
|
79
|
+
forLLM: false
|
|
80
|
+
});
|
|
81
|
+
this.searchResultModel =
|
|
82
|
+
__classPrivateFieldGet(this, _GxIdeSearch_mapSearchResultToTreeViewModel, "f").call(this, searchResultData);
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
this.isSearching = false;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
_GxIdeSearch_searchInputKeyDownHandler.set(this, (event) => {
|
|
89
|
+
if (event.key === "Enter") {
|
|
90
|
+
__classPrivateFieldGet(this, _GxIdeSearch_searchInputHandler, "f").call(this, event);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
_GxIdeSearch_mapSearchResultToTreeViewModel.set(this, (searchResultData) => {
|
|
94
|
+
if (!searchResultData || searchResultData.length === 0) {
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
return [
|
|
98
|
+
{
|
|
99
|
+
id: "root",
|
|
100
|
+
caption: `${__classPrivateFieldGet(this, _GxIdeSearch_componentLocale, "f").labels.results} (${searchResultData.length})`,
|
|
101
|
+
expanded: true,
|
|
102
|
+
parts: "root-item",
|
|
103
|
+
items: searchResultData.map((item) => ({
|
|
104
|
+
id: item.objectId,
|
|
105
|
+
startImgSrc: item.objectIcon,
|
|
106
|
+
caption: item.objectName,
|
|
107
|
+
leaf: true,
|
|
108
|
+
parts: "search-item"
|
|
109
|
+
}))
|
|
110
|
+
}
|
|
111
|
+
];
|
|
112
|
+
});
|
|
113
|
+
_GxIdeSearch_treeItemDoubleClickHandler.set(this, async (event) => {
|
|
114
|
+
var _a;
|
|
115
|
+
const itemId = event.detail.id;
|
|
116
|
+
await ((_a = this.itemDoubleClickCallback) === null || _a === void 0 ? void 0 : _a.call(this, itemId));
|
|
117
|
+
});
|
|
118
|
+
_GxIdeSearch_renderSearchResults.set(this, () => {
|
|
119
|
+
if (!this.isKbOpen) {
|
|
120
|
+
return (index.h("gx-ide-empty-state", { stateTitle: __classPrivateFieldGet(this, _GxIdeSearch_componentLocale, "f").noKbOpenState.title, stateDescription: __classPrivateFieldGet(this, _GxIdeSearch_componentLocale, "f").noKbOpenState.description, stateIconSrc: INFORMATION_ICON, isAnimated: true }));
|
|
121
|
+
}
|
|
122
|
+
if (this.isSearching) {
|
|
123
|
+
return (index.h("gx-ide-loader", { loaderTitle: __classPrivateFieldGet(this, _GxIdeSearch_componentLocale, "f").loader.title, show: true }));
|
|
124
|
+
}
|
|
125
|
+
if (this.searchResultModel.length > 0) {
|
|
126
|
+
return (index.h("ch-tree-view-render", { class: "tree-view", model: this.searchResultModel, expandableButton: "no", expandOnClick: false, onItemOpenReference: __classPrivateFieldGet(this, _GxIdeSearch_treeItemDoubleClickHandler, "f") }));
|
|
127
|
+
}
|
|
128
|
+
if (this.hasSearched) {
|
|
129
|
+
return (index.h("gx-ide-empty-state", { stateTitle: __classPrivateFieldGet(this, _GxIdeSearch_componentLocale, "f").emptyState.title, stateDescription: __classPrivateFieldGet(this, _GxIdeSearch_componentLocale, "f").emptyState.description, stateIconSrc: INFORMATION_ICON, isAnimated: true }));
|
|
130
|
+
}
|
|
131
|
+
return null;
|
|
132
|
+
});
|
|
133
|
+
this.searchResultModel = [];
|
|
134
|
+
this.hasSearched = false;
|
|
135
|
+
this.isSearching = false;
|
|
136
|
+
this.isKbOpen = false;
|
|
137
|
+
this.searchCallback = undefined;
|
|
138
|
+
this.itemDoubleClickCallback = undefined;
|
|
139
|
+
}
|
|
140
|
+
valueChangeHandler(newValue) {
|
|
141
|
+
if (!newValue) {
|
|
142
|
+
__classPrivateFieldSet(this, _GxIdeSearch_searchInputValue, "", "f");
|
|
143
|
+
this.searchResultModel = [];
|
|
144
|
+
this.hasSearched = false;
|
|
145
|
+
this.isSearching = false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Method to show or hide the settings panel, can be called from the outside to control the visibility of the settings
|
|
150
|
+
*/
|
|
151
|
+
async showSettings(_show) {
|
|
152
|
+
return Promise.resolve();
|
|
153
|
+
}
|
|
154
|
+
async componentWillLoad() {
|
|
155
|
+
__classPrivateFieldSet(this, _GxIdeSearch_componentLocale, await locale.Locale.getComponentStrings(this.el), "f");
|
|
156
|
+
}
|
|
157
|
+
render() {
|
|
158
|
+
return (index.h(index.Host, { class: "widget" }, index.h("ch-theme", { model: CSS_BUNDLES }), index.h("section", { class: "spacing-body search" }, index.h("header", { class: "search__header" }, index.h("ch-edit", { id: "search-input", class: "input", accessibleName: __classPrivateFieldGet(this, _GxIdeSearch_componentLocale, "f").accessibleName, placeholder: __classPrivateFieldGet(this, _GxIdeSearch_componentLocale, "f").placeholders.search, debounce: config.config.inputDebounce, onInput: __classPrivateFieldGet(this, _GxIdeSearch_searchInputHandler, "f"), onKeyDown: __classPrivateFieldGet(this, _GxIdeSearch_searchInputKeyDownHandler, "f"), type: "search", startImgSrc: SEARCH_ICON, disabled: !this.isKbOpen, value: __classPrivateFieldGet(this, _GxIdeSearch_searchInputValue, "f") })), index.h("main", { class: "search__results" }, __classPrivateFieldGet(this, _GxIdeSearch_renderSearchResults, "f").call(this)))));
|
|
159
|
+
}
|
|
160
|
+
static get assetsDirs() { return ["gx-ide-assets/search"]; }
|
|
161
|
+
get el() { return index.getElement(this); }
|
|
162
|
+
static get watchers() { return {
|
|
163
|
+
"isKbOpen": ["valueChangeHandler"]
|
|
164
|
+
}; }
|
|
165
|
+
};
|
|
166
|
+
_GxIdeSearch_componentLocale = new WeakMap(), _GxIdeSearch_searchInputValue = new WeakMap(), _GxIdeSearch_searchInputHandler = new WeakMap(), _GxIdeSearch_searchInputKeyDownHandler = new WeakMap(), _GxIdeSearch_mapSearchResultToTreeViewModel = new WeakMap(), _GxIdeSearch_treeItemDoubleClickHandler = new WeakMap(), _GxIdeSearch_renderSearchResults = new WeakMap();
|
|
167
|
+
GxIdeSearch.style = searchCss;
|
|
168
|
+
|
|
169
|
+
exports.gx_ide_search = GxIdeSearch;
|
|
170
|
+
|
|
171
|
+
//# sourceMappingURL=gx-ide-search.cjs.entry.js.map
|