AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.143.235.219
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/bitrix/www/bitrix/js/sale/checkout/view/property/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/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>
	`
});

Anon7 - 2022
AnonSec Team