wrapper($input); } private static function field($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error = null, $value = '') { $fh = new ConversationalFieldHelpers($formID, $field, $rowID, $form_atomic_Cls_map); $img_url = BITFORMS_ROOT_URI . '/static/currencies/'; $req = $fh->required(); $disabled = $fh->disabled(); $readonly = $fh->readonly(); $name = $fh->name(); $ph = $fh->placeholder(); $ariaDescribedBy = $fh->ariaDescribedBy(); $ariaRequired = $fh->ariaRequired(); // Get dynamic label ID to properly link the combobox to its label for screen readers $labelId = $fh->getLabelId(); $selectedFlagImage = ''; $tabIndx = isset($field->disabled) ? -1 : 0; $selectedCurrencyClearable = ''; $searchPlaceholder = ''; $searchClearable = ''; $options = ''; $readonlyCls = isset($field->readonly) ? 'readonly' : ''; $disabledCls = isset($field->disabled) ? 'disabled' : ''; $value = is_string($value) ? $value : ''; $numValue = preg_replace('/[^0-9.-]/', '', $value); $img = esc_url(includes_url('images/blank.gif')); if ($fh->property_exists_nested($field, 'config->selectedFlagImage', true)) { $selectedFlagImage = sprintf( '
', $fh->getConversationalMultiCls('selected-currency-wrp'), $fh->getCustomAttributes('selected-currency-img'), $fh->getConversationalMultiCls('selected-currency-img'), $fh->getCustomClasses('selected-currency-img'), $img ); } if ($fh->property_exists_nested($field, 'config->selectedCurrencyClearable', true)) { $selectedCurrencyClearable = sprintf( ' ', $fh->getCustomAttributes('input-clear-btn'), $fh->getConversationalMultiCls('input-clear-btn'), $fh->getCustomClasses('input-clear-btn') ); } if ($fh->property_exists_nested($field, 'config->searchPlaceholder', '', 1)) { $searchPlaceholder = "placeholder='{$fh->esc_attr($field->config->searchPlaceholder)}'"; } if ($fh->property_exists_nested($field, 'config->searchClearable', true)) { $searchClearable = sprintf( ' ', $fh->getCustomAttributes('search-clear-btn'), $fh->getConversationalMultiCls('icn'), $fh->getConversationalMultiCls('search-clear-btn'), $fh->getCustomClasses('search-clear-btn') ); } return '
getCustomAttributes('currency-fld-wrp') . ' class="' . $fh->getConversationalMultiCls('currency-fld-wrp') . ' ' . $fh->getCustomClasses('currency-fld-wrp') . ' ' . $disabled . ' ' . $readonly . '" > getCustomAttributes('currency-hidden-input') . ' ' . $name . ' ' . $req . ' ' . $ariaRequired . ' ' . $ariaDescribedBy . ' type="text" title="Currency Hidden Input" class="' . $fh->getConversationalMultiCls('currency-hidden-input') . ' d-none" ' . $disabled . ' ' . $readonly . ' value="' . $fh->esc_attr($value) . '" />
getCustomAttributes('dpd-wrp') . ' class="' . $fh->getConversationalMultiCls('dpd-wrp') . ' ' . $fh->getCustomClasses('dpd-wrp') . '" role="combobox" aria-controls="currency-dropdown" aria-haspopup="listbox" aria-live="assertive" aria-labelledby="{$labelId}" aria-expanded="false" tabIndex="' . $tabIndx . '" > ' . $selectedFlagImage . '
getCustomAttributes('currency-amount-input') . ' aria-label="Currency Input" type="text" class="' . $fh->getConversationalMultiCls('currency-amount-input') . ' ' . $fh->getCustomClasses('currency-amount-input') . '" ' . $ph . ' tabIndex="' . $tabIndx . '" data-num-value="' . $numValue . '" /> ' . $selectedCurrencyClearable . '
getCustomAttributes('option-wrp') . ' class="' . $fh->getConversationalMultiCls('option-wrp') . ' ' . $fh->getCustomClasses('option-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') . '" ' . $searchPlaceholder . ' autoComplete="off" 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" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > ' . $searchClearable . '
    getCustomAttributes('option-list') . ' class="' . $fh->getConversationalMultiCls('option-list') . ' ' . $fh->getCustomClasses('option-list') . '" tabIndex="-1" role="listbox" aria-label="currency list" > ' . $options . '
'; } }