Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. @php
  2. $isAside = $isAside();
  3. $isCollapsed = $isCollapsed();
  4. $isCollapsible = $isCollapsible() && (! $isAside);
  5. $isCompact = $isCompact();
  6. $isFormBefore = $isFormBefore();
  7. @endphp
  8. <div
  9. @if ($isCollapsible)
  10. x-data="{
  11. isCollapsed: @js($isCollapsed),
  12. }"
  13. x-on:open-form-section.window="if ($event.detail.id == $el.id) isCollapsed = false"
  14. x-on:collapse-form-section.window="if ($event.detail.id == $el.id) isCollapsed = true"
  15. x-on:toggle-form-section.window="if ($event.detail.id == $el.id) isCollapsed = ! isCollapsed"
  16. x-on:expand-concealing-component.window="
  17. error = $el.querySelector('[data-validation-error]')
  18. if (! error) {
  19. return
  20. }
  21. isCollapsed = false
  22. if (document.body.querySelector('[data-validation-error]') !== error) {
  23. return
  24. }
  25. setTimeout(
  26. () =>
  27. $el.scrollIntoView({
  28. behavior: 'smooth',
  29. block: 'start',
  30. inline: 'start',
  31. }),
  32. 200,
  33. )
  34. "
  35. @endif
  36. id="{{ $getId() }}"
  37. {{
  38. $attributes
  39. ->merge($getExtraAttributes())
  40. ->class([
  41. 'filament-forms-section-component',
  42. 'rounded-xl border border-gray-300 bg-moonlight' => ! $isAside,
  43. 'grid grid-cols-1' => $isAside,
  44. 'md:grid-cols-2' => $isAside && ! $isCompact,
  45. 'md:grid-cols-3' => $isAside && $isCompact,
  46. 'md:order-last' => $isFormBefore,
  47. 'dark:border-gray-600 dark:bg-gray-800' => config('forms.dark_mode') && ! $isAside,
  48. ])
  49. }}
  50. {{ $getExtraAlpineAttributeBag() }}
  51. >
  52. <div
  53. @class([
  54. 'filament-forms-section-header-wrapper flex overflow-hidden rounded-t-xl rtl:space-x-reverse',
  55. 'min-h-[40px]' => $isCompact,
  56. 'min-h-[56px]' => ! $isCompact,
  57. 'pb-4' => $isAside,
  58. 'pr-6' => $isAside && ! $isFormBefore,
  59. 'pl-6' => $isAside && $isFormBefore,
  60. 'items-center bg-moonlight px-6 py-4 border-b-2 border-b-platinum' => ! $isAside,
  61. 'dark:bg-gray-800 dark:border-b-gray-900' => config('forms.dark_mode') && (! $isAside),
  62. ])
  63. @if ($isCollapsible)
  64. x-bind:class="{ 'rounded-b-xl': isCollapsed }"
  65. x-on:click="isCollapsed = ! isCollapsed"
  66. @endif
  67. >
  68. <div
  69. @class([
  70. 'filament-forms-section-header flex-1 space-y-1',
  71. 'cursor-pointer' => $isCollapsible,
  72. ])
  73. >
  74. <h3
  75. @class([
  76. 'pointer-events-none flex flex-row items-center font-bold tracking-tight',
  77. 'text-xl' => ! $isCompact || $isAside,
  78. ])
  79. >
  80. @if ($icon = $getIcon())
  81. <x-dynamic-component
  82. :component="$icon"
  83. @class([
  84. 'mr-1',
  85. 'h-4 w-4' => $isCompact && ! $isAside,
  86. 'h-6 w-6' => ! $isCompact || $isAside,
  87. ])
  88. />
  89. @endif
  90. {{ $getHeading() }}
  91. </h3>
  92. @if ($description = $getDescription())
  93. <p
  94. @class([
  95. 'text-gray-500',
  96. 'text-sm' => $isCompact && ! $isAside,
  97. 'text-base' => ! $isCompact || $isAside,
  98. ])
  99. >
  100. {{ $description }}
  101. </p>
  102. @endif
  103. </div>
  104. @if ($isCollapsible)
  105. <button
  106. x-on:click.stop="isCollapsed = ! isCollapsed"
  107. x-bind:class="{
  108. '-rotate-180': ! isCollapsed,
  109. }"
  110. type="button"
  111. @class([
  112. 'flex transform items-center justify-center rounded-full text-primary-500 outline-none hover:bg-gray-500/5 focus:bg-primary-500/10',
  113. 'h-10 w-10' => ! $isCompact,
  114. '-my-1 h-8 w-8' => $isCompact,
  115. '-rotate-180' => ! $isCollapsed,
  116. ])
  117. >
  118. <svg
  119. @class([
  120. 'h-7 w-7' => ! $isCompact,
  121. 'h-5 w-5' => $isCompact,
  122. ])
  123. xmlns="http://www.w3.org/2000/svg"
  124. fill="none"
  125. viewBox="0 0 24 24"
  126. stroke="currentColor"
  127. >
  128. <path
  129. stroke-linecap="round"
  130. stroke-linejoin="round"
  131. stroke-width="2"
  132. d="M19 9l-7 7-7-7"
  133. />
  134. </svg>
  135. </button>
  136. @endif
  137. </div>
  138. <div
  139. @if ($isCollapsible)
  140. x-bind:class="{ 'invisible h-0 !m-0 overflow-y-hidden': isCollapsed }"
  141. x-bind:aria-expanded="(! isCollapsed).toString()"
  142. @if ($isCollapsed) x-cloak @endif
  143. @endif
  144. @class([
  145. 'filament-forms-section-content-wrapper',
  146. 'col-span-2' => $isAside && $isCompact,
  147. 'md:order-first' => $isFormBefore,
  148. ])
  149. >
  150. <div
  151. @class([
  152. 'filament-forms-section-content',
  153. 'rounded-xl border border-gray-300 bg-moonlight' => $isAside,
  154. 'dark:border-gray-600 dark:bg-gray-800' => config('forms.dark_mode') && $isAside,
  155. 'p-6' => ! $isCompact || $isAside,
  156. 'p-4' => $isCompact && ! $isAside,
  157. ])
  158. >
  159. {{ $getChildComponentContainer() }}
  160. </div>
  161. </div>
  162. </div>