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/cvetdv.ru/bitrix/js/im/v2/component/elements/attach/src/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/im/v2/component/elements/attach/src/attach.js
import { AttachType, ColorToken } from 'im.v2.const';

import { AttachDelimiter } from './components/delimiter/delimiter';
import { AttachFile } from './components/file/file';
import { AttachGrid } from './components/grid/grid';
import { AttachHtml } from './components/html/html';
import { AttachImage } from './components/image/image';
import { AttachLink } from './components/link/link';
import { AttachMessage } from './components/message/message';
import { AttachRich } from './components/rich/rich';
import { AttachUser } from './components/user/user';

import './attach.css';

import type { AttachConfig, AttachConfigBlock } from 'im.v2.const';
import type { BitrixVueComponentProps } from 'ui.vue3';

const PropertyToComponentMap = {
	[AttachType.Delimiter]: AttachDelimiter,
	[AttachType.File]: AttachFile,
	[AttachType.Grid]: AttachGrid,
	[AttachType.Html]: AttachHtml,
	[AttachType.Image]: AttachImage,
	[AttachType.Link]: AttachLink,
	[AttachType.Message]: AttachMessage,
	[AttachType.Rich]: AttachRich,
	[AttachType.User]: AttachUser,
};

// @vue/component
export const Attach = {
	name: 'MessengerAttach',
	components: {
		AttachDelimiter,
		AttachFile,
		AttachGrid,
		AttachHtml,
		AttachImage,
		AttachLink,
		AttachMessage,
		AttachRich,
		AttachUser,
	},
	props:
	{
		config: {
			type: Object,
			default: () => {},
		},
	},
	computed:
	{
		internalConfig(): AttachConfig
		{
			return this.config;
		},
		blocks(): AttachConfigBlock[]
		{
			return this.internalConfig.blocks;
		},
		colorToken(): string
		{
			const { colorToken = ColorToken.base } = this.internalConfig;

			return colorToken;
		},
	},
	methods:
	{
		getComponentForBlock(block: AttachConfigBlock): BitrixVueComponentProps | ''
		{
			const [blockType] = Object.keys(block);
			if (!PropertyToComponentMap[blockType])
			{
				return '';
			}

			return PropertyToComponentMap[blockType];
		},
	},
	template: `
		<div class="bx-im-attach__container bx-im-attach__scope">
			<div class="bx-im-attach__border" :class="colorToken"></div>
			<div class="bx-im-attach__content">
				<component
					v-for="(block, index) in blocks"
					:is="getComponentForBlock(block)"
					:config="block"
					:colorToken="colorToken"
					:key="index"
					:attachId="internalConfig.id.toString()"
				/>
			</div>
		</div>
	`,
};

Youez - 2016 - github.com/yon3zu
LinuXploit