Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

tilda-zero-forms-1.0.js

Код файла
Версия от 04.12.2026, 04:03:53 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
4001		'tilda-step-form-1.1.min.js',4002	].includes(path);4003 4004	if (!isAllowed) {4005		throw new Error(4006			`${path} is not allowed. Make sure the file is included in form export dependencies and then add it to the white list.`4007		);4008	}4009}4010 4011/**4012 * create label for checkboxes, radio or img-select
История файла и сравнение версий
  • 04.12.2026, 04:03:53 · 56c3b845
4013
*
4014 * @param {'checkbox' | 'radio' | 'img-select'} type
4015 * @param {Object} labelStyles
4016 * @param {formObj | false} formObj
4017 * @returns {HTMLLabelElement}
4018 */
4019function t_zeroForms__createLabel(type, labelStyles, formObj) {
4020 var label = document.createElement('label');
4021 label.classList.add('t-' + type + '__control');
4022 if (labelStyles && labelStyles.fontSize) label.style.fontSize = labelStyles.fontSize + 'px';
4023 if (labelStyles) label.style.fontWeight = labelStyles.fontWeight;
4024
4025 const labelColor = formObj && formObj.togglelabelcolor;
4026 if (labelColor) label.style.color = labelColor;
4027
4028 const fontFamily = formObj && formObj.togglefontfamily;
4029 if (fontFamily) {
4030 label.style.fontFamily = fontFamily;
4031 if (!label.style.fontFamily) label.style.fontFamily = '"' + fontFamily + '"';
4032 }
4033
4034 const size = formObj.togglesize;
4035 if (size) {
4036 label.style.setProperty('--size', `${size}px`);
4037 }
4038
4039 const borderSize = formObj.togglebordersize;
4040 if (borderSize) {
4041 label.style.setProperty('--border-width', `${borderSize}px`);
4042 }
4043
4044 const checkboxBorderRadius = formObj.checkboxborderradius;
4045 if (type === 'checkbox' && checkboxBorderRadius) {
4046 label.style.setProperty('--border-radius', `${checkboxBorderRadius}px`);
4047 }
4048
4049 return label;
4050}
4051
4052/**
4053 * create indicator for radio, checkbox and img-select fields
4054 *
4055 * @param {'checkbox' | 'radio' | 'img-select'} type
4056 * @param {string | undefined | false} colorStyle
4057 * @param {{ratio: string, img: string, size: string, borderSize: string, checkboxBorderRadius: string} | false} options
4058 * @returns {HTMLDivElement}
4059 */
4060function t_zeroForms__createIndicator(type, colorStyle, options) {
4061 var indicator = document.createElement('div');
4062 indicator.classList.add('t-' + type + '__indicator');
4063 if (colorStyle) indicator.style.borderColor = colorStyle;
4064 if (type === 'img-select') {
4065 indicator.classList.add('t-bgimg');
4066 indicator.classList.add(options.ratio);
4067 indicator.setAttribute('data-original', options.img);
4068 indicator.style.backgroundImage = options.img;
4069 }
4070
4071 return indicator;
4072}
4073
4074/**
4075 * create hidden input to contain checked checkboxes values
4076 *
4077 * @param {Object} inputPreferences
4078 * @param {HTMLDivElement} wrapper
4079 * @param {'img-select' | 'checkboxes'} type
4080 * @returns {HTMLInputElement}
4081 */
4082function t_zeroForms__createNameFieldForCheckbox(inputPreferences, wrapper, type) {
4083 var hiddenInput = document.createElement('input');
4084 t_zeroForms__appendMainSettingToField(hiddenInput, inputPreferences, 'hidden', 't-' + type + '__hiddeninput');
4085 hiddenInput.tabIndex = -1;
4086 if (inputPreferences.require) hiddenInput.setAttribute('data-tilda-req', '1');
4087 return hiddenInput;
4088}
4089
4090/**
4091 * create hidden input
4092 *
4093 * @param {string} value
4094 * @param {string} name
4095 * @param {string} fieldClass
4096 * @returns {HTMLInputElement}
4097 */
4098function t_zeroForms__createHiddenField(value, name, fieldClass) {
4099 var input = document.createElement('input');
4100 input.type = 'hidden';
Предыдущие 100 строкСледующие 100 строк