wrapper($input); } private static function field($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error = null, $value = null) { $fh = new ConversationalFieldHelpers($formID, $field, $rowID, $form_atomic_Cls_map); $ph = isset($field->ph) ? $field->ph : ''; $val = !empty($value) ? $value : $fh->value(); $val = 'array' === gettype($val) ? ("value='" . implode(',', $val) . "'") : $val; $name = $fh->name(); $req = $fh->required(); $ariaDescribedBy = $fh->ariaDescribedBy(); $ariaRequired = $fh->ariaRequired(); $readonlyCls = isset($field->valid->readonly) ? 'readonly' : ''; $disabledCls = isset($field->valid->disabled) ? 'disabled' : ''; $selectedOptImage = ''; $optionsList = ''; $activeList = isset($field->config->activeList) ? $field->config->activeList : null; $optionIcon = ''; $allowCustomOption = isset($field->config->allowCustomOption) ? $field->config->allowCustomOption : false; $img = htmlentities("data:image/svg+xml,"); if ($fh->property_exists_nested($field, 'config->optionIcon', true)) { $optionIcon = sprintf( 'BD ', $fh->getCustomAttributes('opt-icn'), $fh->getCustomClasses('opt-icn'), $img ); } if ($fh->property_exists_nested($field, 'config->selectedOptImage', true)) { $selectedOptImage = sprintf( ' ', $fh->getCustomAttributes('selected-opt-img'), $fh->getConversationalMultiCls('selected-opt-img'), $fh->getCustomClasses('selected-opt-img'), $img ); } if (property_exists($field, 'optionsList')) { foreach ($field->optionsList as $key => $value) { $dataIndex = 0; $valueArr = (array) $value; $listName = array_keys($valueArr)[0]; $options = array_values($valueArr)[0]; $optionsList .= sprintf( ' '; $dataIndex++; } $optionsList .= sprintf( ' ', $fh->getCustomAttributes('option-list'), $fh->getClassWithFieldKey('option-list'), $fh->getConversationalCls('dpd-option-list'), $fh->getCustomClasses('option-list') ); $multiChipClass = ($fh->property_exists_nested($field, 'config->multipleSelect', true) && $fh->property_exists_nested($field, 'config->showChip', true)) ? 'multi-chip' : ''; return '
getCustomAttributes('dpd-fld-wrp') . ' class="' . $fh->getClassWithFieldKey('dpd-fld-wrp') . ' ' . $fh->getConversationalCls('dpd-slct-fld-wrp') . ' ' . $fh->getCustomClasses('dpd-fld-wrp') . ' ' . $readonlyCls . ' ' . $disabledCls . '" > disabled() . ' ' . $fh->readonly() . ' ' . $val . ' />
getCustomAttributes('dpd-wrp') . ' class="' . $fh->getClassWithFieldKey('dpd-wrp') . ' ' . $fh->getConversationalCls('dpd-slct-wrp') . ' ' . $fh->getCustomClasses('dpd-wrp') . '" role="combobox" aria-controls="" aria-haspopup="listbox" aria-live="assertive" aria-expanded="false" tabIndex="0" aria-label="Dropdown" >
getCustomAttributes('selected-opt-wrp') . ' class="' . $fh->getConversationalMultiCls('selected-opt-wrp') . ' ' . $fh->getCustomClasses('selected-opt-wrp') . '" > ' . $selectedOptImage . ' getCustomAttributes('selected-opt-lbl') . ' aria-label="Selected Option Label" class="' . $fh->getConversationalMultiCls('selected-opt-lbl') . ' ' . $multiChipClass . ' ' . $fh->getCustomClasses('selected-opt-lbl') . '" > ' . $fh->esc_html($ph) . '
getCustomAttributes('dpd-btn-wrp') . ' class="' . $fh->getConversationalMultiCls('dpd-btn-wrp') . ' ' . $fh->getCustomClasses('dpd-btn-wrp') . '" >
getCustomAttributes('dpd-down-btn') . ' class="' . $fh->getConversationalMultiCls('dpd-down-btn') . ' ' . $fh->getCustomClasses('dpd-down-btn') . '" >
getCustomAttributes('option-wrp') . ' class="' . $fh->getConversationalMultiCls('option-wrp') . ' ' . $fh->getCustomClasses('option-wrp') . '" >
getCustomAttributes('option-inner-wrp') . ' class="' . $fh->getConversationalMultiCls('option-inner-wrp') . ' ' . $fh->getCustomClasses('option-inner-wrp') . '" >
getCustomAttributes('option-search-wrp') . ' class="' . $fh->getConversationalMultiCls('option-search-wrp') . ' ' . $fh->getCustomClasses('option-search-wrp') . '" > getCustomAttributes('opt-search-input') . ' type="search" class="' . $fh->getConversationalMultiCls('opt-search-input') . ' ' . $fh->getCustomClasses('opt-search-input') . '" placeholder="Search Country" aria-label="Search Options" aria-hidden="true" tabIndex="-1" /> getCustomAttributes('opt-search-icn') . ' class="' . $fh->getConversationalMultiCls('icn') . ' ' . $fh->getConversationalMultiCls('opt-search-icn') . ' ' . $fh->getCustomClasses('opt-search-icn') . '" aria-hidden="true" width="22" height="22" role="img" title="Search icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" >
' . $optionsList . '
'; } } }