1
0

input-group.blade.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. @props([
  2. 'name' => null,
  3. 'id' => null,
  4. 'label' => null,
  5. 'type' => 'text',
  6. 'placeholder' => '',
  7. 'value' => '',
  8. 'required' => false,
  9. 'attribute' => null,
  10. 'help' => null,
  11. 'prepend' => null,
  12. 'append' => null,
  13. 'prependIcon' => null,
  14. 'appendIcon' => null,
  15. 'button' => null,
  16. 'buttonType' => 'button',
  17. 'buttonClass' => 'btn-outline btn-primary',
  18. 'buttonOnclick' => null,
  19. 'label_grid' => 'col-xxl-2 col-lg-3 col-sm-4',
  20. 'input_grid' => 'col-xxl-4 col-xl-6 col-sm-8',
  21. 'container' => 'form-group row',
  22. ])
  23. <div class="{{ $container }}">
  24. @if ($label)
  25. <label class="{{ $label_grid }} col-form-label" for="{{ $id ?? $name }}">{{ $label }}</label>
  26. @endif
  27. <div class="{{ $input_grid }}">
  28. <div class="input-group">
  29. @if ($prepend || $prependIcon)
  30. <div class="input-group-prepend">
  31. <span class="input-group-text">
  32. @if ($prependIcon)
  33. <i class="{{ $prependIcon }}" aria-hidden="true"></i>
  34. @else
  35. {!! $prepend !!}
  36. @endif
  37. </span>
  38. </div>
  39. @endif
  40. <input class="form-control" id="{{ $id ?? $name }}" name="{{ $name }}" type="{{ $type }}" value="{{ $value }}"
  41. placeholder="{{ $placeholder }}" @if ($required) required @endif {{ $attribute }} />
  42. @if ($append || $appendIcon || $button)
  43. <div class="input-group-append">
  44. @if ($button)
  45. <button class="btn {{ $buttonClass }}" type="{{ $buttonType }}"
  46. @if ($buttonOnclick) onclick="{{ $buttonOnclick }}" @endif {{ $buttonAttributes ?? '' }}>
  47. {!! $button !!}
  48. </button>
  49. @else
  50. <span class="input-group-text">
  51. @if ($appendIcon)
  52. <i class="{{ $appendIcon }}" aria-hidden="true"></i>
  53. @else
  54. {!! $append !!}
  55. @endif
  56. </span>
  57. @endif
  58. </div>
  59. @endif
  60. </div>
  61. @if ($help)
  62. <span class="text-help">{{ $help }}</span>
  63. @endif
  64. </div>
  65. </div>