|
113 | 113 | <tbody class="divide-y divide-gray-200 dark:divide-white/10"> |
114 | 114 | {#each groups as group, groupIndex (group.label)} |
115 | 115 | {#if group.label} |
116 | | - <tr class="border-t border-gray-200 dark:border-white/10"> |
117 | | - <th scope="colgroup" colspan={header.length + 1} class="bg-gray-100 py-2 pr-3 pl-4 text-left text-sm font-semibold text-gray-900 dark:bg-gray-800/50 dark:text-white"> |
118 | | - <div class="flex items-center gap-3"> |
119 | | - <div class="group grid size-4 grid-cols-1"> |
120 | | - <input |
121 | | - type="checkbox" |
122 | | - checked={isGroupSelected(group)} |
123 | | - indeterminate={isGroupPartiallySelected(group)} |
124 | | - onchange={(e) => handleGroupToggle(group, e)} |
125 | | - class={CHECKBOX_CLASSES} |
126 | | - aria-label={`Select all items in ${group.label} group`} |
127 | | - /> |
128 | | - <svg viewBox="0 0 14 14" fill="none" class={SVG_CLASSES} aria-hidden="true"> |
129 | | - <path d="M3 8L6 11L11 3.5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="opacity-0 group-has-checked:opacity-100" /> |
130 | | - <path d="M3 7H11" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="opacity-0 group-has-indeterminate:opacity-100" /> |
131 | | - </svg> |
132 | | - </div> |
133 | | - <span>{group.label}</span> |
| 116 | + <tr class="group border-t border-gray-200 bg-gray-100 dark:border-white/10 dark:bg-gray-800/50"> |
| 117 | + <th scope="colgroup" class="relative px-7 sm:w-12 sm:px-6"> |
| 118 | + <div class="absolute inset-y-0 left-0 hidden w-0.5 bg-primary-600 group-has-checked:block dark:bg-primary-500" aria-hidden="true"></div> |
| 119 | + <div class="group absolute top-1/2 left-4 -mt-2 grid size-4 grid-cols-1"> |
| 120 | + <input type="checkbox" checked={isGroupSelected(group)} indeterminate={isGroupPartiallySelected(group)} onchange={(e) => handleGroupToggle(group, e)} class={CHECKBOX_CLASSES} aria-label={`Select all items in ${group.label} group`} /> |
| 121 | + <svg viewBox="0 0 14 14" fill="none" class={SVG_CLASSES} aria-hidden="true"> |
| 122 | + <path d="M3 8L6 11L11 3.5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="opacity-0 group-has-checked:opacity-100" /> |
| 123 | + <path d="M3 7H11" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="opacity-0 group-has-indeterminate:opacity-100" /> |
| 124 | + </svg> |
134 | 125 | </div> |
135 | 126 | </th> |
| 127 | + <th scope="colgroup" colspan={header.length} class="py-2 pr-3 text-left text-sm font-semibold text-gray-900 dark:text-white"> |
| 128 | + <span>{group.label}</span> |
| 129 | + </th> |
136 | 130 | </tr> |
137 | 131 | {/if} |
138 | 132 | {#each group.items as item, itemIndex (item.value)} |
|
142 | 136 |
|
143 | 137 | <div class="group absolute top-1/2 left-4 -mt-2 grid size-4 grid-cols-1"> |
144 | 138 | <input |
145 | | - checked={values.includes(item.value)} |
146 | 139 | type="checkbox" |
| 140 | + checked={values.includes(item.value)} |
147 | 141 | onchange={() => handleItemToggle(item.value)} |
148 | 142 | class={CHECKBOX_CLASSES} |
149 | 143 | aria-label={`Select ${item.values[0] || item.value}`} |
|
0 commit comments