Каталог файловtilda-zero-forms-1.0.js
2101 const accentColor = formObj.inputaccentcolor;2102 const sizeRatio = t_zeroForms__getRateScaleSizeRatio(formObj);2103 const inputFontSize = parseFloat(formObj.inputfontsize);2104 const fontSize = inputFontSize > 1 ? `${inputFontSize - 1}px` : '';2105 // prettier-ignore2106 const fontWeight = formObj.inputfontweight === 'variation' ? formObj.inputvariationweight : formObj.inputfontweight;2107 2108 let styles = `${selector('.t-rate__control')} {height: ${RATE_SCALE_SIZES.numbersHeight * sizeRatio}px;}`;2109 if (fontSize || fontWeight) {2110 styles += `${selector('.t-rate__indicator')} {`;2111
История файла и сравнение версий
if (fontSize) styles += `font-size: ${fontSize};`;
2112 if (fontWeight) styles += `font-weight: ${fontWeight};`; 2115 if (accentColor) styles += `${activeSelector} {background-color: ${accentColor};}`; 2117 const bgColor = formObj.inputbgcolor; 2118 const borderSize = t_zeroForms__toPx(formObj.inputbordersize); 2119 const borderColor = formObj.inputbordercolor; 2120 const borderRadius = t_zeroForms__toPx(formObj.inputradius); 2122 if (!bgColor && !borderSize && !borderColor && !borderRadius) return styles; 2124 const radius = borderRadius || '0'; 2125 const isWithoutBorder = borderSize === '0px'; 2126 const sideBorderWidth = isWithoutBorder ? '0' : borderSize; 2128 styles += `${selector('.t-rate__control:first-of-type .t-rate__indicator')} {border-top-left-radius: ${radius}; border-bottom-left-radius: ${radius};}`; 2129 styles += `${selector('.t-rate__control:last-of-type .t-rate__indicator')} {border-top-right-radius: ${radius}; border-bottom-right-radius: ${radius};}`; 2130 if (!accentColor) styles += `${activeSelector} {background-color: #e5e5e5;}`; 2131 styles += `${selector('.t-rate__indicator')} {`; 2132 if (bgColor) styles += `background-color: ${bgColor};`; 2133 styles += `border-top-width: ${borderSize || '1px'}; border-bottom-width: ${borderSize || '1px'};`; 2134 if (sideBorderWidth) styles += `border-right-width: ${sideBorderWidth}; border-left-width: ${sideBorderWidth};`; 2135 styles += `border-style: solid; border-color: ${borderColor || '#000000'};}`; 2137 if (isWithoutBorder) { 2138 styles += `${selector('.t-rate__control')} {margin-right: 1px;}`; 2139 styles += `${selector('.t-rate__control:last-of-type')} {margin-right: 0;}`; 2140 styles += `${selector('.t-rate__control:first-of-type .t-rate__indicator')} {border-left: none;}`; 2141 styles += `${selector('.t-rate__control:last-of-type .t-rate__indicator')} {border-right: none;}`; 2148 * @param {string | undefined} value 2149 * @returns {string} число из настроек формы с px, остальное – как есть 2151function t_zeroForms__toPx(value) { 2152 const isNumber = /^\d+(\.\d+)?$/.test(value); 2153 if (isNumber) return `${value}px`; 2155 if (!value) return ''; 2161 * Стили вариантов-кнопок поля "Вопрос с вариантами ответа" из настроек полей формы, как в tpl_input_variants.tpl. 2162 * Высота – из высоты полей формы, чтобы кнопки были вровень с остальными полями, без нее – 60px как в шаблоне 2163 * (src/tilda-forms/zero-variants-button/styles.css). Через min-height, чтобы длинный вариант переносился внутри кнопки. 2165 * @param {string} recid 2166 * @param {string} formID 2167 * @param {formObj} formObj 2170function t_zeroForms__getVariantButtonStyles(recid, formID, formObj) { 2171 const bgColor = formObj.inputbgcolor; 2172 const borderSize = t_zeroForms__toPx(formObj.inputbordersize); 2173 const borderColor = formObj.inputbordercolor; 2174 const borderRadius = t_zeroForms__toPx(formObj.inputradius); 2175 const height = t_zeroForms__toPx(formObj.inputheight); 2177 if (!bgColor && !borderSize && !borderColor && !borderRadius && !height) return ''; 2180 '.t-radio__wrapper_button > fieldset > .t-radio__control', 2181 '.t-radio__wrapper_button > fieldset > .t-input__own-answer-wrapper', 2182 '.t-checkboxes__wrapper_button > fieldset > .t-checkbox__control', 2183 '.t-checkboxes__wrapper_button > fieldset > .t-input__own-answer-wrapper', 2185 .map(item => t_zeroForms__createSelector(recid, formID, item)) 2188 let styles = `${selector} {`; 2189 if (bgColor) styles += `background-color: ${bgColor};`; 2190 styles += `border: ${borderSize || '1px'} solid ${borderColor || '#000000'};`; 2191 if (borderRadius) styles += `border-radius: ${borderRadius};`; 2192 if (height) styles += `min-height: ${height};`; 2198function t_zeroForms__createInput(elementObj, inputStyles, inputPreferences, type) { 2199 var input = document.createElement(type === 'textarea' ? 'textarea' : 'input'); 2200 if (!elementObj.li_title && !elementObj.li_subtitle) {