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); $img_url = BITFORMS_ASSET_URI . '/../static/countries/'; $req = $fh->required(); $disabled = $fh->disabled(); $readonly = $fh->readonly(); $name = $fh->name(); $ph = $fh->placeholder(); $selectedFlagImage = ''; $tabIndx = isset($field->disabled) ? -1 : 0; $selectedCountryClearable = ''; $searchPlaceholder = ''; $searchClearable = ''; $options = ''; $readonlyCls = isset($field->readonly) ? 'readonly' : ''; $disabledCls = isset($field->disabled) ? 'disabled' : ''; $img = htmlentities("data:image/svg+xml,"); $val = $fh->value(); if ($fh->property_exists_nested($field, 'config->selectedFlagImage', true)) { $selectedFlagImage = << getCustomAttributes('selected-phone-img')} alt="Selected Country image" aria-hidden="true" class="{$fh->getConversationalMultiCls('selected-country-img')} {$fh->getCustomClasses('selected-country-img')}" src="{$img}" /> FLAGIMAGE; } if ($fh->property_exists_nested($field, 'config->selectedCountryClearable', true)) { $selectedCountryClearable = <<getCustomAttributes('input-clear-btn')} type="button" title="Clear value" class="{$fh->getConversationalMultiCls('input-clear-btn')} {$fh->getCustomClasses('input-clear-btn')}" > CLEARABLE; } if ($fh->property_exists_nested($field, 'config->searchPlaceholder', '', 1)) { $searchPlaceholder = "{$field->config->searchPlaceholder}"; } if ($fh->property_exists_nested($field, 'config->searchClearable', true)) { $searchClearable = <<getCustomAttributes('search-clear-btn')} type="button" aria-label="Clear search" class="{$fh->getConversationalMultiCls('icn')} {$fh->getConversationalMultiCls('search-clear-btn')} {$fh->getCustomClasses('search-clear-btn')}" tabIndex="-1" > CLEARABLE; } return <<
getCustomAttributes('phone-fld-wrp')} class="{$fh->getConversationalMultiCls('phone-fld-wrp')} {$fh->getCustomClasses('phone-fld-wrp')} {$readonly} {$disabled}" > disabled()} {$fh->readonly()} {$val} />
getCustomAttributes('phone-number-input')} aria-label="Phone Number" type="tel" class="{$fh->getConversationalMultiCls('phone-number-input')} {$fh->getCustomClasses('phone-number-input')}" autoComplete="tel" {$ph} tabIndex={$tabIndx} /> {$selectedCountryClearable}
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')} aria-label="Search for countries" type="search" class="{$fh->getConversationalMultiCls('opt-search-input')} {$fh->getCustomClasses('opt-search-icn')}" placeholder="{$fh->esc_attr($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="country list" > {$options}
PHONENUMBERFIELD; } }