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/sale/checkout/view/property/src/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/sale/checkout/view/property/src/list-edit.js
import { BitrixVue } from 'ui.vue';
import { Property as Const } from 'sale.checkout.const';

import 'sale.checkout.view.element.input';

import './note-error'

BitrixVue.component('sale-checkout-view-property-list_edit', {
	props: ['items', 'errors', 'propertyVariants'],
	computed: {
		localize()
		{
			return Object.freeze(
				BitrixVue.getFilteredPhrases('CHECKOUT_VIEW_PROPERTY_LIST_'))
		},
	},
	methods: {
		getErrorMessage(item)
		{
			let error = this.errors.find(error => error.propertyId === item.id);
			return typeof error !== 'undefined' ? error.message : null
		},
		isPhone(item)
		{
			return item.type === Const.type.phone
		},
		isName(item)
		{
			return item.type === Const.type.name
		},
		isEmail(item)
		{
			return item.type === Const.type.email
		},
		isNumber(item)
		{
			return item.type === Const.type.number
		},
		isCheckbox(item)
		{
			return item.type === Const.type.checkbox
		},
		isDate(item)
		{
			return item.type === Const.type.date
		},
		isDateTime(item)
		{
			return item.type === Const.type.datetime
		},
		isEnum(item)
		{
			return item.type === Const.type.enum
		},
		isFailure(item)
		{
			return item.validated === Const.validate.failure
		},
		getVariantsByPropertyId(propertyId)
		{
			return this.propertyVariants.filter(variant => variant.propertyId === propertyId);
		},
	},
	// language=Vue
	template: `
		<div class="checkout-basket-section checkout-basket-section-personal-form">
			<h2 class="checkout-basket-title">{{localize.CHECKOUT_VIEW_PROPERTY_LIST_VIEW_SHIPPING_CONTACTS}}</h2>
			<div class="form-group" v-for="(item, index) in items" :key="index">
				<sale-checkout-view-element-input-property-text v-if="isName(item)"
					:item="item" 
					:index="index" 
					autocomplete="name"
				/>
				<sale-checkout-view-element-input-property-phone v-else-if="isPhone(item)" 
					:item="item" 
					:index="index"
				/>
				<sale-checkout-view-element-input-property-email v-else-if="isEmail(item)" 
					:item="item" 
					:index="index" 
					autocomplete="email" 
				/>
				<sale-checkout-view-element-input-property-checkbox v-else-if="isCheckbox(item)" 
					:item="item" 
					:index="index" 
					:autocomplete="item.value" 
				/>
				<sale-checkout-view-element-input-property-number v-else-if="isNumber(item)" 
					:item="item" 
					:index="index"
				/>
				<sale-checkout-view-element-input-property-date v-else-if="isDate(item) || isDateTime(item)"
					:item="item"
					:index="index"
					autocomplete="off"
					:isDateTime="isDateTime(item)"
				/>
				<sale-checkout-view-element-input-property-enum v-else-if="isEnum(item)"
					:item="item"
					:index="index"
					:variants="getVariantsByPropertyId(item.id)"
				/>
				<sale-checkout-view-element-input-property-text v-else
					:item="item" 
					:index="index" 
					autocomplete="off"
				/>

				<sale-checkout-view-property-note_error v-if="isFailure(item)"
					:message="getErrorMessage(item)"
				/>
			</div>
		</div>
	`
});

Youez - 2016 - github.com/yon3zu
LinuXploit