Это первая доступная в Git версия файла.
1/**2* В данном скрипте генерируется форма, которая в последствии добавляется в .tn-atom зеро-блока.3* Элементы генерируются при помощи document.createElement.4* Форма, которая находится за пределами видимости, или внутри скрытого зеро-блока, не рендерится.5* Зеро-форма используется некоторые скрипты и стили из других библиотек Тильды, например,6* tilda-phone-mask, tilda-calc, и тд.7*8* Все сгенерированные скрипты и стили добавляются вниз тега <body>.9*10* Строки формируются в функции t_zeroForms__parseIntoElement, при помощи условий внутри11* конструкции switch...case, где при итерации объекта проверяется определенное условие и если оно
* true, создаётся HTML-элементы, сопутствующие к нему стили и скрипты (если они нужны). */import { t396__decodeHtmlText, t396__getZeroBlocks, t396_elem__getFormInputsValue, t396__initScaleFactorFlags, t396__isGlobalStyleCSSVar, t396__parseGlobalStyleCSSVar,} from './tilda-zero-shared.module';// Стили поля "Способ связи" встраиваются в скрипт, чтобы поле не отображалось без стилей, пока они загружаютсяimport '../css/tilda-contact-method-1.0.css';// Стили поля "Рейтинг" есть в tilda-forms-1.0.css, но в редакторе Zero Block он не подключаетсяimport '../src/tilda-forms/ratescale/styles.css';// Стили кнопочного вида поля "Вопрос с вариантами ответа" в Zero Block, в редакторе tilda-forms-1.0.css тоже нетimport '../src/tilda-forms/zero-variants-button/styles.css';// Формы с разбиением на шаги. Общие стили шагов – те же, что в обычных блоках: в редакторе Zero Block их нет,// а на сайте tilda-step-form-1.1 подключает их только для обычных блоковimport '../css/tilda-step-form-1.1.css';// Дополнения только для Zero-форм: раскладка кнопок шагов и счетчика, скрытие шагов до инициализацииimport '../src/tilda-forms/zero-stepform/styles.css';/** * Main property of this object - is li_type. * It's meat what type of form element user use: * 'em' - email * 'ph' - phone * 'nm' - name * 'in' - input (one line input field) * 'ta' - textarea * 'sb' - select box (dropdown) * 'rd' - radio (question with answers) * 'ri' - radio image (question with img answers) * 'cb' - checkbox * 'uw' - upload widget (file) * 'uc' - uploadcare plugin (file) * 'da' - date * 'tm' - time * 'qn' - plus/minus btn (quantity) * 'rg' - range slider (quantity) * 'ur' - website url * 'tx' - text comment * 'ws' - white space * 'hd' - hidden * 'fr' - formula (calculation field) * 'contact_method' - contact method (phone, telegram, whatsapp, etc.) * 'rs' - rating scale (numbers or icons) * * li_ph - placeholder value * li_name and li_nm in many types of elements contains same value - variable name * lid - id of current element * ls - index of current element * 10 (10, 20, 30, etc.) * loff - field is switched off, or not * * li_rule - validation rule, used in one line input field * li_rows used only in textarea and white space * li_value used in quantity (range, plus/minus btn) and hidden input * * properties for selects: * li_defselitem - default selected item * li_variants - list of options * li_selfirstvar - selected first option * * properties for 'question with img answers': * li_gallery - objects with img url, alts * li_imgratio - image ratio * in this type element value of 'li_name' can be different with 'li_nm' * * properties for 'checkbox': * li_checked - is checkbox checked by default * li_belowsubmit - is checkbox show below button * * properties for 'upload widget': * li_multiupl - can upload more than one file * li_uwkey - uplad widget public key * * properties for 'uploadcare': * li_inp - local lang * li_uckey - upladcare public key * * properties for 'date': * li_dateUnavailFr - unavailable Friday * li_dateUnavailToday - unavailable Today * li_dateUnavailFuture - unavailable Future * li_dateUnavailMo - unavailable Monday * li_dateUnavailPast - unavailable Past * li_dateUnavailSa - unavailable Saturday * li_dateUnavailSu - unavailable Sunday