Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/ui/uploader/vue/src/ |
Upload File : |
import { Type } from 'main.core'; import { EventEmitter } from 'main.core.events'; import type { UploaderOptions, Uploader } from 'ui.uploader.core'; import { BitrixVue, VueCreateAppResult } from 'ui.vue3'; import VueUploaderAdapter from './vue-uploader-adapter'; /** * @memberof BX.UI.Uploader */ export default class VueUploaderWidget extends EventEmitter { #vueAdapter: VueUploaderAdapter = null; #uploaderOptions: UploaderOptions = null; #widgetOptions = {}; #vueApp = null; #rootComponent = null; constructor(uploaderOptions: UploaderOptions, widgetOptions: {[key: string]: any} = {}) { super(); this.setEventNamespace('BX.UI.Uploader.Vue.Widget'); this.#uploaderOptions = uploaderOptions; this.#widgetOptions = widgetOptions; } defineComponent(): ?Function { return null; } getAdapter(): VueUploaderAdapter { if (this.#vueAdapter === null) { this.#vueAdapter = new VueUploaderAdapter(this.#uploaderOptions); } return this.#vueAdapter; } getUploader(): Uploader { return this.getAdapter().getUploader(); } getVueApp(): VueCreateAppResult { if (this.#vueApp !== null) { return this.#vueApp; } this.#vueApp = BitrixVue.createApp(this.defineComponent(), { uploaderOptions: this.#uploaderOptions, widgetOptions: this.#widgetOptions, uploaderAdapter: this.getAdapter(), }); return this.#vueApp; } getRootComponent() { return this.#rootComponent; } renderTo(node: HTMLElement) { if (Type.isDomNode(node) && this.#rootComponent === null) { this.#rootComponent = this.getVueApp().mount(node); } return this.#rootComponent; } }