@invopop/popui 0.1.72 → 0.1.74
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.
|
@@ -484,12 +484,16 @@
|
|
|
484
484
|
{#if item.separator}
|
|
485
485
|
<DrawerContextSeparator />
|
|
486
486
|
{:else}
|
|
487
|
+
{#snippet itemChildren()}
|
|
488
|
+
{@render item.content?.(item)}
|
|
489
|
+
{/snippet}
|
|
487
490
|
<div class:px-1={!item.groupBy} class:cursor-grab={draggable && !item.locked}>
|
|
488
491
|
<DrawerContextItem
|
|
489
492
|
item={{ ...item, focused: item.value === focusedItemValue, flagPosition: item.flagPosition || flagPosition }}
|
|
490
493
|
{multiple}
|
|
491
494
|
{onclick}
|
|
492
495
|
onchange={updateItem}
|
|
496
|
+
children={item.content ? itemChildren : undefined}
|
|
493
497
|
/>
|
|
494
498
|
</div>
|
|
495
499
|
{/if}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
scrollIfSelected = false,
|
|
17
17
|
onchange,
|
|
18
18
|
onclick,
|
|
19
|
-
|
|
19
|
+
children
|
|
20
20
|
}: DrawerContextItemProps = $props()
|
|
21
21
|
|
|
22
22
|
let el: HTMLElement | undefined = $state()
|
|
@@ -96,7 +96,11 @@
|
|
|
96
96
|
{#if item?.country && item?.flagPosition === 'before'}
|
|
97
97
|
<BaseFlag country={item.country} />
|
|
98
98
|
{/if}
|
|
99
|
-
|
|
99
|
+
{#if children}
|
|
100
|
+
{@render children()}
|
|
101
|
+
{:else}
|
|
102
|
+
<span class="{labelStyles} text-base font-medium truncate">{item?.label || ''}</span>
|
|
103
|
+
{/if}
|
|
100
104
|
|
|
101
105
|
{#if item?.country && item?.flagPosition === 'after'}
|
|
102
106
|
<BaseFlag country={item.country} />
|
package/dist/types.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export type DrawerOption = SelectOption & {
|
|
|
42
42
|
groupBy?: string;
|
|
43
43
|
useAvatar?: boolean;
|
|
44
44
|
action?: Snippet<[DrawerOption]>;
|
|
45
|
+
content?: Snippet<[DrawerOption]>;
|
|
45
46
|
flagPosition?: 'before' | 'after';
|
|
46
47
|
};
|
|
47
48
|
export type Company = {
|
|
@@ -359,7 +360,7 @@ export interface DrawerContextItemProps {
|
|
|
359
360
|
scrollIfSelected?: boolean;
|
|
360
361
|
onclick?: (value: AnyProp) => void;
|
|
361
362
|
onchange?: (item: DrawerOption) => void;
|
|
362
|
-
|
|
363
|
+
children?: Snippet;
|
|
363
364
|
}
|
|
364
365
|
export interface DropdownSelectProps {
|
|
365
366
|
value?: AnyProp;
|