true, 'OPTIONS_VALUE_KEY' => 'ID', 'OPTIONS_TEXT_KEY' => 'NAME', 'ADD_CLASS' => '', 'CLASS' => '', 'LABEL_CLASS' => '', 'ID' => '', 'NAME' => '', 'ONCHANGE' => '', 'HIDDEN' => true, // || 'TYPE' => 'hidden' 'SELECTED' => ' id ', 'LABEL' => '', 'MULTIPLE' => '', 'ARROW_IN_LABEL' => false, 'OPTIONS_HTML' => '', // !! 'CHECK_DIRTY' => true, // !! 'OPTIONS' => [], ]; $optionDefault = [ 'ID' => '', 'NAME' => '', 'ATTR' => '', 'VISIBLE' => true, 'SELECTED' => 'Y', 'DISABLED' => 'Y', // || RESTRICTED ]; if(!isset($arParams['AUTO_SELECT'])) { $arParams['AUTO_SELECT'] = $arParamsDefault['AUTO_SELECT']; } $arParams['AUTO_SELECT'] = \Bx\Kit\Tools::isTrue($arParams['AUTO_SELECT']); if(!isset($arParams['OPTIONS_VALUE_KEY'])) { $arParams['OPTIONS_VALUE_KEY'] = $arParamsDefault['OPTIONS_VALUE_KEY']; } if(!isset($arParams['OPTIONS_TEXT_KEY'])) { $arParams['OPTIONS_TEXT_KEY'] = $arParamsDefault['OPTIONS_TEXT_KEY']; } $arParams['OPTIONS'] = (array)$arParams['OPTIONS']; $arrowInLabel = \Bx\Kit\Tools::isTrue($arParams['ARROW_IN_LABEL']); if(!isset($arParams['CHECK_DIRTY'])) { $arParams['CHECK_DIRTY'] = $arParamsDefault['CHECK_DIRTY']; } $checkDirty = \Bx\Kit\Tools::isTrue($arParams['CHECK_DIRTY']); $optionSelectedArray = []; $hidden = \Bx\Kit\Tools::isTrue($arParams['HIDDEN']) || ($arParams['TYPE'] == 'hidden'); $multiple = \Bx\Kit\Tools::isTrue($arParams['MULTIPLE']); $optionsHtml = ''; if($arParams['OPTIONS']) { if(strlen($arParams['SELECTED'])) { foreach ($arParams['OPTIONS'] as $option) { if(isset($option['VISIBLE']) && !\Bx\Kit\Tools::isTrue($option['VISIBLE'])) continue; if($arParams['SELECTED'] == Type\Arr::get($option, $arParams['OPTIONS_VALUE_KEY'])) { $optionSelectedArray = $option; break; } } } if($arParams['AUTO_SELECT']) { if(!$optionSelectedArray) { foreach ($arParams['OPTIONS'] as $option) { if(isset($option['VISIBLE']) && !\Bx\Kit\Tools::isTrue($option['VISIBLE'])) continue; if(\Bx\Kit\Tools::isTrue($option['SELECTED'])) { $optionSelectedArray = $option; break; } } } if(!$optionSelectedArray) { $optionSelectedArray = reset($arParams['OPTIONS']); } } } $optionsCount = 0; foreach ($arParams['OPTIONS'] as $option) { if(isset($option['VISIBLE']) && !\Bx\Kit\Tools::isTrue($option['VISIBLE'])) continue; $isSelected = (Type\Arr::get($optionSelectedArray, $arParams['OPTIONS_VALUE_KEY']) == Type\Arr::get($option, $arParams['OPTIONS_VALUE_KEY'])); $isDisabled = \Bx\Kit\Tools::isTrue($option['DISABLED']) || \Bx\Kit\Tools::isTrue($option['RESTRICTED']); $optionsCount++; $optionsHtml .= ' '.Type\Arr::get($option, $arParams['OPTIONS_TEXT_KEY']).''; } ?> id="=$arParams['ID']?>"}?> multiple}?> onchange="=\Bx\Kit\Lib\Type\Str::safeHtmlAttr($arParams['ONCHANGE'])?>"}?> class="kit-field__input =$arParams['CLASS']?> =$arParams['ADD_CLASS']?>" =\Bx\Kit\Node\Lib::getAttrByArray($arParams['ATTR'])?> data-placeholder="=$arParams['PLACEHOLDER']?>"}?> > echo $optionsHtml?:$arParams['OPTIONS_HTML']; ?> if($arParams['HINT']){ app()->service()->templater()->render('kit:field/hint', ['TITLE' => $arParams['HINT']]); }?> =app()->service()->templater()->get('kit:svg/chevronAnimate')?>}?> =Type\Arr::get($optionSelectedArray, $arParams['OPTIONS_TEXT_KEY'])?:$arParams['PLACEHOLDER']?> =$arParams['LABEL']?:$arParams['NAME']?:''?>=\Bx\Kit\Template::get('svg/chevronAnimate')?>}?> =$arParams['AREA_LEFT']?>}?> =$arParams['AREA_RIGHT']?>}?> ?>