Каталог файловtilda-zero-forms-1.0.js
1801 const inputBlock = t_zeroForms__createWrapper('t-input-block');1802 if (isDefault && !isActive) inputBlock.classList.add('t-contact-method__hidden');1803 inputBlock.appendChild(input);1804 return inputBlock;1805 };1806 1807 if (hasPhone) {1808 const phoneInput = document.createElement('input');1809 phoneInput.type = 'tel';1810 phoneInput.autocomplete = 'tel';1811 phoneInput.classList.add('js-phonemask-input', 't-input-phonemask__wrap');1812
История файла и сравнение версий
phoneInput.setAttribute('data-phonemask-init', 'no');
1813 phoneInput.setAttribute('data-phonemask-id', recid); 1814 phoneInput.setAttribute('data-phonemask-lid', elementObj.lid); 1815 phoneInput.setAttribute('data-phonemask-skip-auto-init', 'true'); 1816 if (elementObj.li_maskcountry) phoneInput.setAttribute('data-phonemask-maskcountry', elementObj.li_maskcountry); 1817 group.appendChild(createInputBlock(phoneInput, 'phone')); 1821 const textInput = document.createElement('input'); 1822 textInput.type = 'text'; 1823 textInput.classList.add('js-username-input'); 1824 textInput.setAttribute('data-contact-method', type); 1825 textInput.placeholder = contactMethod.placeholder || ''; 1826 group.appendChild(createInputBlock(textInput, 'text')); 1833 * Стили для выбранного способа связи и заголовков способов связи 1835 * @param {string} recid 1836 * @param {string} formID 1837 * @param {formObj} formObj 1840function t_zeroForms__getContactMethodStyles(recid, formID, formObj) { 1843 // Выбранный способ связи красится в цвет переключателей и иконок, без него – стили по умолчанию из CSS 1844 const accentColor = formObj.inputaccentcolor; 1846 const selector = t_zeroForms__createSelector(recid, formID, '.t-contact-method__type:has(> .t-radio:checked)'); 1847 const getColorWithOpacity = opacity => 1848 t_zeroForms__fromHEXtoRGBA(accentColor, opacity) || 1849 `color-mix(in srgb, ${accentColor} ${opacity * 100}%, transparent)`; 1851 styles += `${selector} {background-color: ${getColorWithOpacity(0.1)}; border-color: ${getColorWithOpacity(0.4)};}`; 1854 const labelColor = formObj.inputtitlecolor; 1856 const selector = t_zeroForms__createSelector(recid, formID, '.t-contact-method__title'); 1857 styles += `${selector} {color: ${labelColor};}`; 1863/* ============= rating scale field ============= */ 1864// Разметка повторяет tpl_input_rate.tpl, логика поля находится в tilda-ratescale-1.0.js 1867 * Размеры поля "Рейтинг" при высоте полей формы по умолчанию (.t-input в tilda-forms-1.0.css). 1868 * Ширина иконок – из src/tilda-forms/ratescale/styles.css, шкала в зеро-форме по высоте как обычное поле. 1869 * При другой высоте полей поле "Рейтинг" масштабируется пропорционально 1871const RATE_SCALE_SIZES = { 1879 * type: 'numbers' | 'icons', 1882 * iconsAmount: number, 1883 * }} RateScaleSettings 1887 * Возвращает настройки поля "Рейтинг" 1888 * @param {FormObjectEl} elementObj 1889 * @returns {RateScaleSettings} 1891function t_zeroForms__getRateScaleSettings(elementObj) { 1893 type: elementObj.li_ratetype === 'icons' ? 'icons' : 'numbers', 1894 // Как в tpl_input_rate.tpl: шкала начинается с 0, только если это явно указано 1895 min: elementObj.li_ratemin === '0' ? 0 : 1, 1896 // При пустом значении редактор показывает выбранными 10 чисел и 5 иконок 1897 max: parseInt(elementObj.li_ratemax, 10) || 10, 1898 iconsAmount: parseInt(elementObj.li_rateiconsquantity, 10) || 5,