{{-- format-ignore-start --}} @props([ // name of the input field for use in forms 'name' => defaultBladewindName('input-'), // what type of input box are you displaying // available options are text, password, email, search, tel 'type' => 'text', // label to display on the input box 'label' => '', // should the input accept numbers only. Default is false 'numeric' => false, // minimum number a user can enter when numeric=true 'min' => null, // maximum number a user can enter when numeric=true 'max' => null, // is this a required field. Default is false 'required' => false, // adds margin after the input box 'addClearing' => config('bladewind.input.add_clearing', true), // placeholder text 'placeholder' => '', // value to set when in edit mode or if you want to load the input with default text 'selectedValue' => '', // should the placeholder always be visible even if a label is set // by default the label overwrites the placeholder // useful if you don't want this overwriting 'showPlaceholderAlways' => config('bladewind.input.show_placeholder_always', false), // message to display when validation fails for this field // this is just attached to the input field as a data attribute 'errorMessage' => '', // this is an easy way to pass a translatable heading to the notification component // since it is triggered from Javascript, it is hard to translate any text from within js 'errorHeading' => 'Error', // how should error messages be displayed for this input // by default error messages are displayed in the Bladewind notification component // the component should exist on the page 'showErrorInline' => config('bladewind.input.show_error_inline', false), // for numeric input only: should the numbers include dots 'withDots' => false, // determines if the input field has a label 'hasLabel' => false, 'isDatepicker' => false, // set the prefix for the input field 'prefix' => '', // set the suffix for the input field 'suffix' => '', // define if prefix background is transparent 'transparentPrefix' => config('bladewind.input.transparent_prefix', true), // define if suffix background is transparent 'transparentSuffix' => config('bladewind.input.transparent_suffix', true), // force (or not) prefix to be an icon 'prefixIsIcon' => false, // force (or not) suffix to be an icon 'suffixIsIcon' => false, // define if icon prefix is outline or solid 'prefixIconType' => 'outline', // force (or not) suffix to be an icon 'suffixIconType' => 'outline', // should password be viewable 'viewable' => false, // should field be clearable 'clearable' => config('bladewind.input.clearable', false), // additional css for prefix 'prefixIconCss' => '', // additional css for suffix 'suffixIconCss' => '', // additional css for div containing the prefix 'prefixIconDivCss' => '', // additional css for div containing the suffix 'suffixIconDivCss' => 'rtl:!right-[unset] rtl:!left-0', // javascript to execute when suffix icon is clicked 'action' => null, 'size' => config('bladewind.input.size', 'regular'), 'enforceLimits' => false, 'nonce' => config('bladewind.script.nonce', null), ]) @php $name = parseBladewindName($name); $add_clearing = parseBladewindVariable($addClearing); $show_placeholder_always = parseBladewindVariable($showPlaceholderAlways); $show_error_inline = parseBladewindVariable($showErrorInline); $with_dots = parseBladewindVariable($withDots); $has_label = parseBladewindVariable($hasLabel); $is_datepicker = parseBladewindVariable($isDatepicker); $transparent_prefix = parseBladewindVariable($transparentPrefix); $transparent_suffix = parseBladewindVariable($transparentSuffix); $prefix_is_icon = parseBladewindVariable($prefixIsIcon); $suffix_is_icon = parseBladewindVariable($suffixIsIcon); $required = parseBladewindVariable($required); $numeric = parseBladewindVariable($numeric); $viewable = parseBladewindVariable($viewable); $clearable = parseBladewindVariable($clearable); $enforce_limits = parseBladewindVariable($enforceLimits); $required_symbol = ($label == '' && $required) ? ' *' : ''; $is_required = ($required) ? 'required' : ''; $placeholder_color = ($show_placeholder_always || $label == '') ? '' : 'placeholder-transparent dark:placeholder-transparent'; $placeholder_label = ($show_placeholder_always) ? $placeholder : (($label !== '') ? $label : $placeholder); $with_dots = ($with_dots) ? 1 : 0; $type = ($numeric) ? 'number' : $type; if($type == "password" && $viewable) { $suffix = 'eye'; $suffixIconCss = 'show-pwd'; $action = "togglePassword('$name', 'show')"; $suffix_is_icon = true; } if($clearable) { $suffix = 'x-mark'; $suffix_is_icon = true; $suffixIconCss = 'hidden cursor-pointer dark:!bg-dark-900/60 dark:hover:!bg-dark-900 !p-0.5 !rounded-full bg-gray-400 !stroke-2 hover:bg-gray-600 text-white'; } if($attributes->has('readonly') || $attributes->has('disabled')) { if($attributes->get('readonly') == 'false') $attributes = $attributes->except('readonly'); if($attributes->get('disabled') == 'false') $attributes = $attributes->except('disabled'); } @endphp {{-- format-ignore-end --}}