@shival99/z-ui-svelte 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1084,10 +1084,16 @@
1084
1084
  {#snippet fades(edges: ZScrollEdges)}
1085
1085
  <!-- Soft edges while a list is scrolled: the top once it left the start, the bottom while there is more below. -->
1086
1086
  {#if !edges.atTop}
1087
- <div class="pointer-events-none absolute inset-x-0 top-0 h-6 bg-gradient-to-b from-popover to-transparent" aria-hidden="true"></div>
1087
+ <div
1088
+ class="from-popover pointer-events-none absolute inset-x-0 top-0 h-6 bg-gradient-to-b to-transparent"
1089
+ aria-hidden="true"
1090
+ ></div>
1088
1091
  {/if}
1089
1092
  {#if !edges.atTop && !edges.atEnd}
1090
- <div class="pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-popover to-transparent" aria-hidden="true"></div>
1093
+ <div
1094
+ class="from-popover pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t to-transparent"
1095
+ aria-hidden="true"
1096
+ ></div>
1091
1097
  {/if}
1092
1098
  {/snippet}
1093
1099
 
@@ -1235,77 +1241,77 @@
1235
1241
  </div>
1236
1242
  {:else if useVirtual}
1237
1243
  <div class="relative">
1238
- <div
1239
- bind:this={optionsEl}
1240
- {@attach zHoverGlide({ class: 'bg-primary/15 rounded-(--radius-sm)' })}
1241
- {@attach zScrollEdges(edges => (listEdges = edges))}
1242
- class="z-autocomplete-content-state z-autocomplete-options z-autocomplete-virtual-scroll relative overflow-x-hidden overflow-y-auto overscroll-y-contain p-1"
1243
- style:height={`${heightExpand}px`}
1244
- onscroll={onOptionsScroll}
1245
- >
1246
- <div class="z-autocomplete-virtual-inner relative" style:height={`${$virtualizer.getTotalSize()}px`}>
1247
- {#each $virtualizer.getVirtualItems() as item (item.key)}
1248
- {@const option = filteredOptions[item.index]}
1249
- {#if option}
1250
- <!-- svelte-ignore a11y_click_events_have_key_events (keyboard is handled by the input) -->
1251
- <div
1252
- data-glide-item
1253
- data-index={item.index}
1254
- role="option"
1255
- tabindex="-1"
1256
- aria-selected={activeIndex === item.index}
1257
- aria-disabled={option.disabled || undefined}
1258
- class={['z-autocomplete-option absolute right-0 left-0 min-w-0', optionClass(option, item.index)]}
1259
- style:display={hasTemplate ? 'block' : null}
1260
- style:height={zDynamicSize ? null : `${optionHeight}px`}
1261
- style:min-height={zDynamicSize ? `${optionHeight}px` : null}
1262
- style:overflow={hasTemplate ? 'visible' : null}
1263
- style:transform={`translateY(${item.start}px) translateZ(0)`}
1264
- onmouseenter={() => (activeIndex = item.index)}
1265
- onclick={() => selectOption(option)}
1266
- {@attach zDynamicSize ? (node: HTMLDivElement) => $virtualizer.measureElement(node) : null}
1267
- >
1268
- {@render optionBody(option, item.index)}
1269
- </div>
1270
- {/if}
1271
- {/each}
1244
+ <div
1245
+ bind:this={optionsEl}
1246
+ {@attach zHoverGlide({ class: 'bg-primary/15 rounded-(--radius-sm)' })}
1247
+ {@attach zScrollEdges(edges => (listEdges = edges))}
1248
+ class="z-autocomplete-content-state z-autocomplete-options z-autocomplete-virtual-scroll relative overflow-x-hidden overflow-y-auto overscroll-y-contain p-1"
1249
+ style:height={`${heightExpand}px`}
1250
+ onscroll={onOptionsScroll}
1251
+ >
1252
+ <div class="z-autocomplete-virtual-inner relative" style:height={`${$virtualizer.getTotalSize()}px`}>
1253
+ {#each $virtualizer.getVirtualItems() as item (item.key)}
1254
+ {@const option = filteredOptions[item.index]}
1255
+ {#if option}
1256
+ <!-- svelte-ignore a11y_click_events_have_key_events (keyboard is handled by the input) -->
1257
+ <div
1258
+ data-glide-item
1259
+ data-index={item.index}
1260
+ role="option"
1261
+ tabindex="-1"
1262
+ aria-selected={activeIndex === item.index}
1263
+ aria-disabled={option.disabled || undefined}
1264
+ class={['z-autocomplete-option absolute right-0 left-0 min-w-0', optionClass(option, item.index)]}
1265
+ style:display={hasTemplate ? 'block' : null}
1266
+ style:height={zDynamicSize ? null : `${optionHeight}px`}
1267
+ style:min-height={zDynamicSize ? `${optionHeight}px` : null}
1268
+ style:overflow={hasTemplate ? 'visible' : null}
1269
+ style:transform={`translateY(${item.start}px) translateZ(0)`}
1270
+ onmouseenter={() => (activeIndex = item.index)}
1271
+ onclick={() => selectOption(option)}
1272
+ {@attach zDynamicSize ? (node: HTMLDivElement) => $virtualizer.measureElement(node) : null}
1273
+ >
1274
+ {@render optionBody(option, item.index)}
1275
+ </div>
1276
+ {/if}
1277
+ {/each}
1278
+ </div>
1279
+ {#if isLoadingMore}{@render loadingMore()}{/if}
1272
1280
  </div>
1273
- {#if isLoadingMore}{@render loadingMore()}{/if}
1274
- </div>
1275
- {@render fades(listEdges)}
1281
+ {@render fades(listEdges)}
1276
1282
  </div>
1277
1283
  {:else}
1278
1284
  <div class="relative">
1279
- <div
1280
- bind:this={optionsEl}
1281
- {@attach zHoverGlide({ class: 'bg-primary/15 rounded-(--radius-sm)' })}
1282
- {@attach zScrollEdges(edges => (listEdges = edges))}
1283
- class="z-autocomplete-content-state z-autocomplete-options flex flex-col gap-0.75 overflow-x-hidden overflow-y-auto overscroll-y-contain p-1"
1284
- style:min-height={`${heightExpand}px`}
1285
- style:max-height={`${heightExpand}px`}
1286
- >
1287
- {#each filteredOptions as option, index (trackKey(option, index))}
1288
- <!-- svelte-ignore a11y_click_events_have_key_events (keyboard is handled by the input) -->
1289
- <div
1290
- data-glide-item
1291
- role="option"
1292
- tabindex="-1"
1293
- aria-selected={activeIndex === index}
1294
- aria-disabled={option.disabled || undefined}
1295
- class={['z-autocomplete-option relative min-w-0', optionClass(option, index)]}
1296
- style:display={hasTemplate ? 'block' : null}
1297
- style:min-height={hasTemplate ? null : `${optionHeight}px`}
1298
- style:overflow={hasTemplate ? 'visible' : null}
1299
- onmouseenter={() => (activeIndex = index)}
1300
- onclick={() => selectOption(option)}
1301
- >
1302
- {@render optionBody(option, index)}
1303
- </div>
1304
- {/each}
1305
- {#if canLoadMore}<div bind:this={sentinel} class="h-px w-full shrink-0"></div>{/if}
1306
- {#if isLoadingMore}{@render loadingMore()}{/if}
1307
- </div>
1308
- {@render fades(listEdges)}
1285
+ <div
1286
+ bind:this={optionsEl}
1287
+ {@attach zHoverGlide({ class: 'bg-primary/15 rounded-(--radius-sm)' })}
1288
+ {@attach zScrollEdges(edges => (listEdges = edges))}
1289
+ class="z-autocomplete-content-state z-autocomplete-options flex flex-col gap-0.75 overflow-x-hidden overflow-y-auto overscroll-y-contain p-1"
1290
+ style:min-height={`${heightExpand}px`}
1291
+ style:max-height={`${heightExpand}px`}
1292
+ >
1293
+ {#each filteredOptions as option, index (trackKey(option, index))}
1294
+ <!-- svelte-ignore a11y_click_events_have_key_events (keyboard is handled by the input) -->
1295
+ <div
1296
+ data-glide-item
1297
+ role="option"
1298
+ tabindex="-1"
1299
+ aria-selected={activeIndex === index}
1300
+ aria-disabled={option.disabled || undefined}
1301
+ class={['z-autocomplete-option relative min-w-0', optionClass(option, index)]}
1302
+ style:display={hasTemplate ? 'block' : null}
1303
+ style:min-height={hasTemplate ? null : `${optionHeight}px`}
1304
+ style:overflow={hasTemplate ? 'visible' : null}
1305
+ onmouseenter={() => (activeIndex = index)}
1306
+ onclick={() => selectOption(option)}
1307
+ >
1308
+ {@render optionBody(option, index)}
1309
+ </div>
1310
+ {/each}
1311
+ {#if canLoadMore}<div bind:this={sentinel} class="h-px w-full shrink-0"></div>{/if}
1312
+ {#if isLoadingMore}{@render loadingMore()}{/if}
1313
+ </div>
1314
+ {@render fades(listEdges)}
1309
1315
  </div>
1310
1316
  {/if}
1311
1317
  </div>