bits-ui 0.17.0 → 0.18.0
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.
- package/dist/bits/accordion/_export.types.d.ts +1 -1
- package/dist/bits/accordion/components/accordion-content.svelte +3 -18
- package/dist/bits/accordion/ctx.js +3 -3
- package/dist/bits/accordion/types.d.ts +1 -1
- package/dist/bits/alert-dialog/_export.types.d.ts +1 -1
- package/dist/bits/alert-dialog/_types.d.ts +1 -1
- package/dist/bits/alert-dialog/components/alert-dialog-overlay.svelte +2 -12
- package/dist/bits/alert-dialog/components/alert-dialog-title.svelte +1 -6
- package/dist/bits/alert-dialog/ctx.js +4 -4
- package/dist/bits/alert-dialog/types.d.ts +1 -1
- package/dist/bits/aspect-ratio/components/aspect-ratio.svelte +1 -5
- package/dist/bits/avatar/_export.types.d.ts +1 -1
- package/dist/bits/avatar/ctx.js +2 -2
- package/dist/bits/button/_export.types.d.ts +1 -1
- package/dist/bits/button/types.d.ts +1 -1
- package/dist/bits/calendar/_export.types.d.ts +1 -1
- package/dist/bits/calendar/_types.d.ts +1 -1
- package/dist/bits/calendar/components/calendar-next-button.svelte +1 -7
- package/dist/bits/calendar/components/calendar-prev-button.svelte +1 -7
- package/dist/bits/calendar/components/calendar.svelte +2 -12
- package/dist/bits/calendar/ctx.js +2 -2
- package/dist/bits/calendar/types.d.ts +1 -1
- package/dist/bits/checkbox/_export.types.d.ts +1 -1
- package/dist/bits/checkbox/_types.d.ts +1 -1
- package/dist/bits/checkbox/components/checkbox-input.svelte +1 -6
- package/dist/bits/checkbox/ctx.js +2 -2
- package/dist/bits/checkbox/types.d.ts +1 -1
- package/dist/bits/collapsible/_export.types.d.ts +1 -1
- package/dist/bits/collapsible/components/collapsible-content.svelte +3 -18
- package/dist/bits/collapsible/components/collapsible-trigger.svelte +1 -7
- package/dist/bits/collapsible/ctx.js +2 -2
- package/dist/bits/collapsible/types.d.ts +1 -1
- package/dist/bits/combobox/_export.types.d.ts +1 -0
- package/dist/bits/combobox/_export.types.js +1 -0
- package/dist/bits/combobox/_types.d.ts +62 -0
- package/dist/bits/combobox/_types.js +1 -0
- package/dist/bits/combobox/components/combobox-arrow.svelte +21 -0
- package/dist/bits/combobox/components/combobox-arrow.svelte.d.ts +26 -0
- package/dist/bits/combobox/components/combobox-content.svelte +104 -0
- package/dist/bits/combobox/components/combobox-content.svelte.d.ts +27 -0
- package/dist/bits/combobox/components/combobox-group-label.svelte +25 -0
- package/dist/bits/combobox/components/combobox-group-label.svelte.d.ts +23 -0
- package/dist/bits/combobox/components/combobox-group.svelte +19 -0
- package/dist/bits/combobox/components/combobox-group.svelte.d.ts +26 -0
- package/dist/bits/combobox/components/combobox-hidden-input.svelte +25 -0
- package/dist/bits/combobox/components/combobox-hidden-input.svelte.d.ts +32 -0
- package/dist/bits/combobox/components/combobox-input.svelte +31 -0
- package/dist/bits/combobox/components/combobox-input.svelte.d.ts +33 -0
- package/dist/bits/combobox/components/combobox-item-indicator.svelte +16 -0
- package/dist/bits/combobox/components/combobox-item-indicator.svelte.d.ts +20 -0
- package/dist/bits/combobox/components/combobox-item.svelte +47 -0
- package/dist/bits/combobox/components/combobox-item.svelte.d.ts +31 -0
- package/dist/bits/combobox/components/combobox-label.svelte +22 -0
- package/dist/bits/combobox/components/combobox-label.svelte.d.ts +17 -0
- package/dist/bits/combobox/components/combobox.svelte +113 -0
- package/dist/bits/combobox/components/combobox.svelte.d.ts +41 -0
- package/dist/bits/combobox/ctx.d.ts +187 -0
- package/dist/bits/combobox/ctx.js +91 -0
- package/dist/bits/combobox/index.d.ts +12 -0
- package/dist/bits/combobox/index.js +12 -0
- package/dist/bits/combobox/types.d.ts +36 -0
- package/dist/bits/combobox/types.js +1 -0
- package/dist/bits/context-menu/_export.types.d.ts +1 -1
- package/dist/bits/context-menu/components/context-menu-content.svelte +1 -6
- package/dist/bits/context-menu/components/context-menu.svelte +4 -7
- package/dist/bits/context-menu/components/context-menu.svelte.d.ts +2 -2
- package/dist/bits/context-menu/ctx.d.ts +1 -1
- package/dist/bits/context-menu/ctx.js +5 -5
- package/dist/bits/context-menu/types.d.ts +1 -1
- package/dist/bits/date-field/_export.types.d.ts +1 -1
- package/dist/bits/date-field/components/date-field.svelte +1 -5
- package/dist/bits/date-field/ctx.d.ts +1 -1
- package/dist/bits/date-field/ctx.js +2 -2
- package/dist/bits/date-field/types.d.ts +1 -1
- package/dist/bits/date-picker/_export.types.d.ts +1 -1
- package/dist/bits/date-picker/components/date-picker-calendar.svelte +1 -6
- package/dist/bits/date-picker/components/date-picker-content.svelte +3 -18
- package/dist/bits/date-picker/components/date-picker-field.svelte +1 -5
- package/dist/bits/date-picker/components/date-picker-next-button.svelte +1 -7
- package/dist/bits/date-picker/components/date-picker-prev-button.svelte +1 -7
- package/dist/bits/date-picker/components/date-picker.svelte +1 -5
- package/dist/bits/date-picker/ctx.d.ts +2 -2
- package/dist/bits/date-picker/ctx.js +5 -5
- package/dist/bits/date-picker/types.d.ts +1 -1
- package/dist/bits/date-range-field/_export.types.d.ts +1 -1
- package/dist/bits/date-range-field/components/date-range-field.svelte +2 -11
- package/dist/bits/date-range-field/ctx.d.ts +1 -1
- package/dist/bits/date-range-field/ctx.js +1 -1
- package/dist/bits/date-range-picker/_export.types.d.ts +1 -1
- package/dist/bits/date-range-picker/components/date-range-picker-content.svelte +3 -18
- package/dist/bits/date-range-picker/components/date-range-picker-field.svelte +1 -5
- package/dist/bits/date-range-picker/ctx.d.ts +2 -2
- package/dist/bits/date-range-picker/ctx.js +5 -5
- package/dist/bits/date-range-picker/types.d.ts +1 -1
- package/dist/bits/dialog/_export.types.d.ts +1 -1
- package/dist/bits/dialog/_types.d.ts +1 -1
- package/dist/bits/dialog/components/dialog-title.svelte +1 -6
- package/dist/bits/dialog/ctx.js +4 -4
- package/dist/bits/dialog/types.d.ts +1 -1
- package/dist/bits/dropdown-menu/_export.types.d.ts +1 -1
- package/dist/bits/dropdown-menu/types.d.ts +1 -1
- package/dist/bits/floating/helpers.js +3 -3
- package/dist/bits/index.d.ts +1 -0
- package/dist/bits/index.js +1 -0
- package/dist/bits/label/_export.types.d.ts +1 -1
- package/dist/bits/label/components/label.svelte +1 -6
- package/dist/bits/label/ctx.js +1 -1
- package/dist/bits/label/types.d.ts +1 -1
- package/dist/bits/link-preview/_export.types.d.ts +1 -1
- package/dist/bits/link-preview/components/link-preview.svelte +4 -7
- package/dist/bits/link-preview/ctx.js +6 -6
- package/dist/bits/link-preview/types.d.ts +1 -1
- package/dist/bits/menu/components/menu-content.svelte +1 -6
- package/dist/bits/menu/components/menu-sub.svelte +4 -7
- package/dist/bits/menu/components/menu.svelte +4 -7
- package/dist/bits/menu/components/menu.svelte.d.ts +2 -2
- package/dist/bits/menu/ctx.d.ts +8 -8
- package/dist/bits/menu/ctx.js +20 -20
- package/dist/bits/menu/types.d.ts +1 -1
- package/dist/bits/menubar/_export.types.d.ts +1 -1
- package/dist/bits/menubar/components/menubar-menu.svelte +4 -7
- package/dist/bits/menubar/components/menubar-menu.svelte.d.ts +2 -2
- package/dist/bits/menubar/components/menubar-sub.svelte +4 -7
- package/dist/bits/menubar/ctx.d.ts +3 -3
- package/dist/bits/menubar/ctx.js +12 -12
- package/dist/bits/menubar/types.d.ts +1 -1
- package/dist/bits/pagination/_export.types.d.ts +1 -1
- package/dist/bits/pagination/components/pagination-next-button.svelte +1 -7
- package/dist/bits/pagination/components/pagination-page.svelte +1 -7
- package/dist/bits/pagination/components/pagination-prev-button.svelte +1 -7
- package/dist/bits/pagination/ctx.js +2 -2
- package/dist/bits/pagination/types.d.ts +1 -1
- package/dist/bits/pin-input/_export.types.d.ts +1 -1
- package/dist/bits/pin-input/ctx.d.ts +1 -1
- package/dist/bits/pin-input/ctx.js +2 -2
- package/dist/bits/pin-input/types.d.ts +1 -1
- package/dist/bits/popover/_export.types.d.ts +1 -1
- package/dist/bits/popover/components/popover-content.svelte +3 -18
- package/dist/bits/popover/components/popover.svelte +4 -7
- package/dist/bits/popover/ctx.js +7 -7
- package/dist/bits/popover/types.d.ts +1 -1
- package/dist/bits/progress/ctx.js +2 -2
- package/dist/bits/radio-group/_export.types.d.ts +1 -1
- package/dist/bits/radio-group/ctx.js +2 -2
- package/dist/bits/radio-group/types.d.ts +1 -1
- package/dist/bits/range-calendar/_export.types.d.ts +1 -1
- package/dist/bits/range-calendar/_types.d.ts +1 -1
- package/dist/bits/range-calendar/components/range-calendar-next-button.svelte +1 -7
- package/dist/bits/range-calendar/components/range-calendar-prev-button.svelte +1 -7
- package/dist/bits/range-calendar/components/range-calendar.svelte +1 -6
- package/dist/bits/range-calendar/ctx.js +2 -2
- package/dist/bits/range-calendar/types.d.ts +1 -1
- package/dist/bits/select/_export.types.d.ts +1 -1
- package/dist/bits/select/_types.d.ts +1 -1
- package/dist/bits/select/components/select-content.svelte +1 -7
- package/dist/bits/select/components/select-value.svelte +1 -6
- package/dist/bits/select/components/select.svelte.d.ts +1 -1
- package/dist/bits/select/ctx.d.ts +4 -4
- package/dist/bits/select/ctx.js +11 -11
- package/dist/bits/select/types.d.ts +1 -1
- package/dist/bits/separator/ctx.js +2 -2
- package/dist/bits/slider/_export.types.d.ts +1 -1
- package/dist/bits/slider/components/slider-thumb.svelte +1 -6
- package/dist/bits/slider/ctx.js +2 -2
- package/dist/bits/slider/types.d.ts +1 -1
- package/dist/bits/switch/_export.types.d.ts +1 -1
- package/dist/bits/switch/ctx.js +2 -2
- package/dist/bits/switch/types.d.ts +1 -1
- package/dist/bits/tabs/_export.types.d.ts +1 -1
- package/dist/bits/tabs/ctx.js +2 -2
- package/dist/bits/tabs/types.d.ts +1 -1
- package/dist/bits/toggle/_export.types.d.ts +1 -1
- package/dist/bits/toggle/_types.d.ts +1 -1
- package/dist/bits/toggle/ctx.js +2 -2
- package/dist/bits/toggle/types.d.ts +1 -1
- package/dist/bits/toggle-group/_export.types.d.ts +1 -1
- package/dist/bits/toggle-group/ctx.js +2 -2
- package/dist/bits/toggle-group/types.d.ts +1 -1
- package/dist/bits/toolbar/_export.types.d.ts +1 -1
- package/dist/bits/toolbar/components/toolbar-button.svelte +1 -7
- package/dist/bits/toolbar/ctx.js +5 -5
- package/dist/bits/toolbar/types.d.ts +1 -1
- package/dist/bits/tooltip/_export.types.d.ts +1 -1
- package/dist/bits/tooltip/components/tooltip.svelte +4 -7
- package/dist/bits/tooltip/ctx.js +7 -7
- package/dist/bits/tooltip/types.d.ts +1 -1
- package/dist/helpers/builders.js +1 -1
- package/dist/internal/attrs.js +1 -1
- package/dist/internal/focus.js +1 -1
- package/dist/internal/kbd.js +1 -1
- package/dist/internal/style.js +1 -1
- package/package.json +21 -22
|
@@ -5,7 +5,7 @@ function getProgressData() {
|
|
|
5
5
|
const PARTS = ["root"];
|
|
6
6
|
return {
|
|
7
7
|
NAME,
|
|
8
|
-
PARTS
|
|
8
|
+
PARTS,
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
export function setCtx(props) {
|
|
@@ -14,6 +14,6 @@ export function setCtx(props) {
|
|
|
14
14
|
const progress = { ...createProgress(removeUndefined(props)), getAttrs };
|
|
15
15
|
return {
|
|
16
16
|
...progress,
|
|
17
|
-
updateOption: getOptionUpdater(progress.options)
|
|
17
|
+
updateOption: getOptionUpdater(progress.options),
|
|
18
18
|
};
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as RadioGroupProps, InputProps as RadioGroupInputProps, ItemProps as RadioGroupItemProps, ItemIndicatorProps as RadioGroupItemIndicatorProps, ItemEvents as RadioGroupItemEvents } from "./types.js";
|
|
1
|
+
export type { Props as RadioGroupProps, InputProps as RadioGroupInputProps, ItemProps as RadioGroupItemProps, ItemIndicatorProps as RadioGroupItemIndicatorProps, ItemEvents as RadioGroupItemEvents, } from "./types.js";
|
|
@@ -9,7 +9,7 @@ function getRadioGroupData() {
|
|
|
9
9
|
return {
|
|
10
10
|
NAME,
|
|
11
11
|
ITEM_NAME,
|
|
12
|
-
PARTS
|
|
12
|
+
PARTS,
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
export function setCtx(props) {
|
|
@@ -19,7 +19,7 @@ export function setCtx(props) {
|
|
|
19
19
|
setContext(NAME, radioGroup);
|
|
20
20
|
return {
|
|
21
21
|
...radioGroup,
|
|
22
|
-
updateOption: getOptionUpdater(radioGroup.options)
|
|
22
|
+
updateOption: getOptionUpdater(radioGroup.options),
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
export function getCtx() {
|
|
@@ -11,4 +11,4 @@ type ItemEvents<T extends Element = HTMLButtonElement> = {
|
|
|
11
11
|
keydown: CustomEventHandler<KeyboardEvent, T>;
|
|
12
12
|
focus: CustomEventHandler<FocusEvent, T>;
|
|
13
13
|
};
|
|
14
|
-
export type { Props, InputProps, ItemProps, ItemIndicatorProps, ItemEvents };
|
|
14
|
+
export type { Props, InputProps, ItemProps, ItemIndicatorProps, ItemEvents, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as RangeCalendarProps, PrevButtonProps as RangeCalendarPrevButtonProps, NextButtonProps as RangeCalendarNextButtonProps, HeadingProps as RangeCalendarHeadingProps, HeaderProps as RangeCalendarHeaderProps, GridProps as RangeCalendarGridProps, GridHeadProps as RangeCalendarGridHeadProps, HeadCellProps as RangeCalendarHeadCellProps, GridBodyProps as RangeCalendarGridBodyProps, CellProps as RangeCalendarCellProps, GridRowProps as RangeCalendarGridRowProps, DayProps as RangeCalendarDayProps, Events as RangeCalendarEvents, PrevButtonEvents as RangeCalendarPrevButtonEvents, NextButtonEvents as RangeCalendarNextButtonEvents, DayEvents as RangeCalendarDayEvents } from "./types.js";
|
|
1
|
+
export type { Props as RangeCalendarProps, PrevButtonProps as RangeCalendarPrevButtonProps, NextButtonProps as RangeCalendarNextButtonProps, HeadingProps as RangeCalendarHeadingProps, HeaderProps as RangeCalendarHeaderProps, GridProps as RangeCalendarGridProps, GridHeadProps as RangeCalendarGridHeadProps, HeadCellProps as RangeCalendarHeadCellProps, GridBodyProps as RangeCalendarGridBodyProps, CellProps as RangeCalendarCellProps, GridRowProps as RangeCalendarGridRowProps, DayProps as RangeCalendarDayProps, Events as RangeCalendarEvents, PrevButtonEvents as RangeCalendarPrevButtonEvents, NextButtonEvents as RangeCalendarNextButtonEvents, DayEvents as RangeCalendarDayEvents, } from "./types.js";
|
|
@@ -80,4 +80,4 @@ type BaseDayProps = Expand<{
|
|
|
80
80
|
}>;
|
|
81
81
|
type CellProps = Expand<Omit<BaseDayProps, "month"> & DOMElement<HTMLTableCellElement>>;
|
|
82
82
|
type DayProps = Expand<BaseDayProps & DOMElement>;
|
|
83
|
-
export type { Props, PrevButtonProps, NextButtonProps, HeadingProps, HeaderProps, GridProps, GridHeadProps, HeadCellProps, GridBodyProps, GridRowProps, CellProps, DayProps };
|
|
83
|
+
export type { Props, PrevButtonProps, NextButtonProps, HeadingProps, HeaderProps, GridProps, GridHeadProps, HeadCellProps, GridBodyProps, GridRowProps, CellProps, DayProps, };
|
|
@@ -18,13 +18,7 @@ $:
|
|
|
18
18
|
{#if asChild}
|
|
19
19
|
<slot {builder} />
|
|
20
20
|
{:else}
|
|
21
|
-
<button
|
|
22
|
-
bind:this={el}
|
|
23
|
-
{...builder} use:builder.action
|
|
24
|
-
type="button"
|
|
25
|
-
{...$$restProps}
|
|
26
|
-
on:m-click={dispatch}
|
|
27
|
-
>
|
|
21
|
+
<button bind:this={el} {...builder} use:builder.action type="button" {...$$restProps} on:m-click={dispatch}>
|
|
28
22
|
<slot {builder} />
|
|
29
23
|
</button>
|
|
30
24
|
{/if}
|
|
@@ -18,13 +18,7 @@ $:
|
|
|
18
18
|
{#if asChild}
|
|
19
19
|
<slot {builder} />
|
|
20
20
|
{:else}
|
|
21
|
-
<button
|
|
22
|
-
bind:this={el}
|
|
23
|
-
{...builder} use:builder.action
|
|
24
|
-
type="button"
|
|
25
|
-
{...$$restProps}
|
|
26
|
-
on:m-click={dispatch}
|
|
27
|
-
>
|
|
21
|
+
<button bind:this={el} {...builder} use:builder.action type="button" {...$$restProps} on:m-click={dispatch}>
|
|
28
22
|
<slot {builder} />
|
|
29
23
|
</button>
|
|
30
24
|
{/if}
|
|
@@ -134,12 +134,7 @@ $:
|
|
|
134
134
|
endValue={$endValue}
|
|
135
135
|
/>
|
|
136
136
|
{:else}
|
|
137
|
-
<div
|
|
138
|
-
{...builder} use:builder.action
|
|
139
|
-
{...$$restProps}
|
|
140
|
-
on:m-keydown={dispatch}
|
|
141
|
-
bind:this={el}
|
|
142
|
-
>
|
|
137
|
+
<div {...builder} use:builder.action {...$$restProps} on:m-keydown={dispatch} bind:this={el}>
|
|
143
138
|
<slot
|
|
144
139
|
{builder}
|
|
145
140
|
{months}
|
|
@@ -15,7 +15,7 @@ function getRangeCalendarData() {
|
|
|
15
15
|
"head-cell",
|
|
16
16
|
"grid-body",
|
|
17
17
|
"cell",
|
|
18
|
-
"grid-row"
|
|
18
|
+
"grid-row",
|
|
19
19
|
];
|
|
20
20
|
return { NAME, PARTS };
|
|
21
21
|
}
|
|
@@ -26,7 +26,7 @@ export function setCtx(props) {
|
|
|
26
26
|
setContext(NAME, rangeCalendar);
|
|
27
27
|
return {
|
|
28
28
|
...rangeCalendar,
|
|
29
|
-
updateOption: getOptionUpdater(rangeCalendar.options)
|
|
29
|
+
updateOption: getOptionUpdater(rangeCalendar.options),
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
export function getCtx() {
|
|
@@ -30,4 +30,4 @@ type DayEvents = {
|
|
|
30
30
|
type Events = {
|
|
31
31
|
keydown: CustomEventHandler<KeyboardEvent, HTMLDivElement>;
|
|
32
32
|
};
|
|
33
|
-
export type { Props, PrevButtonProps, NextButtonProps, HeadingProps, GridProps, CellProps, GridRowProps, GridBodyProps, HeadCellProps, GridHeadProps, HeaderProps, DayProps, Events, PrevButtonEvents, NextButtonEvents, DayEvents };
|
|
33
|
+
export type { Props, PrevButtonProps, NextButtonProps, HeadingProps, GridProps, CellProps, GridRowProps, GridBodyProps, HeadCellProps, GridHeadProps, HeaderProps, DayProps, Events, PrevButtonEvents, NextButtonEvents, DayEvents, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as SelectProps, ArrowProps as SelectArrowProps, ContentProps as SelectContentProps, GroupProps as SelectGroupProps, InputProps as SelectInputProps, LabelProps as SelectLabelProps, ItemProps as SelectItemProps, IndicatorProps as SelectIndicatorProps, SeparatorProps as SelectSeparatorProps, TriggerProps as SelectTriggerProps, ValueProps as SelectValueProps, ItemEvents as SelectItemEvents, ContentEvents as SelectContentEvents, TriggerEvents as SelectTriggerEvents, LabelEvents as SelectLabelEvents } from "./types.js";
|
|
1
|
+
export type { Props as SelectProps, ArrowProps as SelectArrowProps, ContentProps as SelectContentProps, GroupProps as SelectGroupProps, InputProps as SelectInputProps, LabelProps as SelectLabelProps, ItemProps as SelectItemProps, IndicatorProps as SelectIndicatorProps, SeparatorProps as SelectSeparatorProps, TriggerProps as SelectTriggerProps, ValueProps as SelectValueProps, ItemEvents as SelectItemEvents, ContentEvents as SelectContentEvents, TriggerEvents as SelectTriggerEvents, LabelEvents as SelectLabelEvents, } from "./types.js";
|
|
@@ -59,4 +59,4 @@ type ValueProps = Expand<{
|
|
|
59
59
|
*/
|
|
60
60
|
placeholder?: string;
|
|
61
61
|
} & DOMElement<HTMLSpanElement>>;
|
|
62
|
-
export type { Props, ArrowProps, ContentProps, IndicatorProps, GroupProps, InputProps, LabelProps, ItemProps, SeparatorProps, TriggerProps, ValueProps };
|
|
62
|
+
export type { Props, ArrowProps, ContentProps, IndicatorProps, GroupProps, InputProps, LabelProps, ItemProps, SeparatorProps, TriggerProps, ValueProps, };
|
|
@@ -104,13 +104,7 @@ $:
|
|
|
104
104
|
<slot {builder} />
|
|
105
105
|
</div>
|
|
106
106
|
{:else if $open}
|
|
107
|
-
<div
|
|
108
|
-
bind:this={el}
|
|
109
|
-
{...builder} use:builder.action
|
|
110
|
-
{...$$restProps}
|
|
111
|
-
on:m-pointerleave={dispatch}
|
|
112
|
-
on:keydown
|
|
113
|
-
>
|
|
107
|
+
<div bind:this={el} {...builder} use:builder.action {...$$restProps} on:m-pointerleave={dispatch} on:keydown>
|
|
114
108
|
<slot {builder} />
|
|
115
109
|
</div>
|
|
116
110
|
{/if}
|
|
@@ -14,12 +14,7 @@ $:
|
|
|
14
14
|
{#if asChild}
|
|
15
15
|
<slot {label} {attrs} />
|
|
16
16
|
{:else}
|
|
17
|
-
<span
|
|
18
|
-
bind:this={el}
|
|
19
|
-
{...$$restProps}
|
|
20
|
-
{...attrs}
|
|
21
|
-
data-placeholder={!label ? "" : undefined}
|
|
22
|
-
>
|
|
17
|
+
<span bind:this={el} {...$$restProps} {...attrs} data-placeholder={!label ? "" : undefined}>
|
|
23
18
|
{label ? label : placeholder}
|
|
24
19
|
</span>
|
|
25
20
|
{/if}
|
|
@@ -9,9 +9,9 @@ declare class __sveltets_Render<T, Multiple extends boolean = false> {
|
|
|
9
9
|
portal?: string | HTMLElement | null | undefined;
|
|
10
10
|
required?: boolean | undefined;
|
|
11
11
|
name?: string | undefined;
|
|
12
|
-
loop?: boolean | undefined;
|
|
13
12
|
typeahead?: boolean | undefined;
|
|
14
13
|
scrollAlignment?: "center" | "nearest" | undefined;
|
|
14
|
+
loop?: boolean | undefined;
|
|
15
15
|
highlightOnHover?: boolean | undefined;
|
|
16
16
|
selected?: import("../_types.js").WhenTrue<Multiple, import("../../../index.js").Selected<T>[] | undefined, import("../../../index.js").Selected<T> | undefined, import("../../../index.js").Selected<T> | import("../../../index.js").Selected<T>[] | undefined> | undefined;
|
|
17
17
|
onSelectedChange?: import("../../../internal/types.js").OnChangeFn<import("../_types.js").WhenTrue<Multiple, import("../../../index.js").Selected<T>[] | undefined, import("../../../index.js").Selected<T> | undefined, import("../../../index.js").Selected<T> | import("../../../index.js").Selected<T>[] | undefined>> | undefined;
|
|
@@ -13,7 +13,7 @@ type Props<T = unknown, M extends boolean = false> = CreateSelectProps<T, M> & {
|
|
|
13
13
|
};
|
|
14
14
|
export declare function setCtx<T = unknown, M extends boolean = false>(props: Props<T, M>): {
|
|
15
15
|
updateOption: <K extends string, V extends unknown>(key: K, value: V | undefined) => void;
|
|
16
|
-
getAttrs: (part: "content" | "value" | "
|
|
16
|
+
getAttrs: (part: "content" | "value" | "label" | "arrow" | "group" | "input" | "item" | "trigger" | "indicator") => Record<string, string>;
|
|
17
17
|
elements: {
|
|
18
18
|
trigger: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[{
|
|
19
19
|
update: (updater: import("svelte/store").Updater<boolean>, sideEffect?: ((newValue: boolean) => void) | undefined) => void;
|
|
@@ -141,7 +141,7 @@ export declare function setGroupCtx(): {
|
|
|
141
141
|
'aria-labelledby': string;
|
|
142
142
|
}, string>;
|
|
143
143
|
id: string;
|
|
144
|
-
getAttrs: (part: "content" | "value" | "
|
|
144
|
+
getAttrs: (part: "content" | "value" | "label" | "arrow" | "group" | "input" | "item" | "trigger" | "indicator") => Record<string, string>;
|
|
145
145
|
};
|
|
146
146
|
export declare function setItemCtx(value: unknown): GetReturn;
|
|
147
147
|
export declare function getGroupLabel(): {
|
|
@@ -149,12 +149,12 @@ export declare function getGroupLabel(): {
|
|
|
149
149
|
id: string;
|
|
150
150
|
}, string>;
|
|
151
151
|
id: string;
|
|
152
|
-
getAttrs: (part: "content" | "value" | "
|
|
152
|
+
getAttrs: (part: "content" | "value" | "label" | "arrow" | "group" | "input" | "item" | "trigger" | "indicator") => Record<string, string>;
|
|
153
153
|
};
|
|
154
154
|
export declare function getItemIndicator(): {
|
|
155
155
|
value: unknown;
|
|
156
156
|
isSelected: import("svelte/store").Readable<(value: unknown) => boolean>;
|
|
157
|
-
getAttrs: (part: "content" | "value" | "
|
|
157
|
+
getAttrs: (part: "content" | "value" | "label" | "arrow" | "group" | "input" | "item" | "trigger" | "indicator") => Record<string, string>;
|
|
158
158
|
};
|
|
159
159
|
export declare function setArrow(size?: number): GetReturn;
|
|
160
160
|
export declare function updatePositioning(props: FloatingProps): void;
|
package/dist/bits/select/ctx.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createSelect } from "@melt-ui/svelte";
|
|
2
2
|
import { getContext, setContext } from "svelte";
|
|
3
|
-
import { createBitAttrs, generateId, getOptionUpdater, removeUndefined } from "../../internal/index.js";
|
|
3
|
+
import { createBitAttrs, generateId, getOptionUpdater, removeUndefined, } from "../../internal/index.js";
|
|
4
4
|
import { getPositioningUpdater } from "../floating/helpers.js";
|
|
5
5
|
function getSelectData() {
|
|
6
6
|
const NAME = "select";
|
|
@@ -15,13 +15,13 @@ function getSelectData() {
|
|
|
15
15
|
"input",
|
|
16
16
|
"label",
|
|
17
17
|
"trigger",
|
|
18
|
-
"value"
|
|
18
|
+
"value",
|
|
19
19
|
];
|
|
20
20
|
return {
|
|
21
21
|
NAME,
|
|
22
22
|
GROUP_NAME,
|
|
23
23
|
ITEM_NAME,
|
|
24
|
-
PARTS
|
|
24
|
+
PARTS,
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
export function getCtx() {
|
|
@@ -35,19 +35,19 @@ props) {
|
|
|
35
35
|
const getAttrs = createBitAttrs(NAME, PARTS);
|
|
36
36
|
const select = {
|
|
37
37
|
...createSelect({ ...removeUndefined(props), forceVisible: true }),
|
|
38
|
-
getAttrs
|
|
38
|
+
getAttrs,
|
|
39
39
|
};
|
|
40
40
|
setContext(NAME, select);
|
|
41
41
|
return {
|
|
42
42
|
...select,
|
|
43
|
-
updateOption: getOptionUpdater(select.options)
|
|
43
|
+
updateOption: getOptionUpdater(select.options),
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
export function setGroupCtx() {
|
|
47
47
|
const { GROUP_NAME } = getSelectData();
|
|
48
48
|
const id = generateId();
|
|
49
49
|
setContext(GROUP_NAME, id);
|
|
50
|
-
const { elements: { group }, getAttrs } = getCtx();
|
|
50
|
+
const { elements: { group }, getAttrs, } = getCtx();
|
|
51
51
|
return { group, id, getAttrs };
|
|
52
52
|
}
|
|
53
53
|
export function setItemCtx(value) {
|
|
@@ -59,17 +59,17 @@ export function setItemCtx(value) {
|
|
|
59
59
|
export function getGroupLabel() {
|
|
60
60
|
const { GROUP_NAME } = getSelectData();
|
|
61
61
|
const id = getContext(GROUP_NAME);
|
|
62
|
-
const { elements: { groupLabel }, getAttrs } = getCtx();
|
|
62
|
+
const { elements: { groupLabel }, getAttrs, } = getCtx();
|
|
63
63
|
return { groupLabel, id, getAttrs };
|
|
64
64
|
}
|
|
65
65
|
export function getItemIndicator() {
|
|
66
66
|
const { ITEM_NAME } = getSelectData();
|
|
67
|
-
const { helpers: { isSelected }, getAttrs } = getCtx();
|
|
67
|
+
const { helpers: { isSelected }, getAttrs, } = getCtx();
|
|
68
68
|
const value = getContext(ITEM_NAME);
|
|
69
69
|
return {
|
|
70
70
|
value,
|
|
71
71
|
isSelected,
|
|
72
|
-
getAttrs
|
|
72
|
+
getAttrs,
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
export function setArrow(size = 8) {
|
|
@@ -81,10 +81,10 @@ export function updatePositioning(props) {
|
|
|
81
81
|
const defaultPlacement = {
|
|
82
82
|
side: "bottom",
|
|
83
83
|
align: "center",
|
|
84
|
-
sameWidth: true
|
|
84
|
+
sameWidth: true,
|
|
85
85
|
};
|
|
86
86
|
const withDefaults = { ...defaultPlacement, ...props };
|
|
87
|
-
const { options: { positioning } } = getCtx();
|
|
87
|
+
const { options: { positioning }, } = getCtx();
|
|
88
88
|
const updater = getPositioningUpdater(positioning);
|
|
89
89
|
updater(withDefaults);
|
|
90
90
|
}
|
|
@@ -32,4 +32,4 @@ type ContentEvents<T extends Element = HTMLDivElement> = {
|
|
|
32
32
|
pointerleave: CustomEventHandler<PointerEvent, T>;
|
|
33
33
|
keydown: EventHandler<KeyboardEvent, T>;
|
|
34
34
|
};
|
|
35
|
-
export type { Props, ArrowProps, ContentProps, GroupProps, InputProps, LabelProps, ItemProps, IndicatorProps, SeparatorProps, TriggerProps, ValueProps, ItemEvents, ContentEvents, TriggerEvents, LabelEvents };
|
|
35
|
+
export type { Props, ArrowProps, ContentProps, GroupProps, InputProps, LabelProps, ItemProps, IndicatorProps, SeparatorProps, TriggerProps, ValueProps, ItemEvents, ContentEvents, TriggerEvents, LabelEvents, };
|
|
@@ -5,7 +5,7 @@ function getSeparatorData() {
|
|
|
5
5
|
const PARTS = ["root"];
|
|
6
6
|
return {
|
|
7
7
|
NAME,
|
|
8
|
-
PARTS
|
|
8
|
+
PARTS,
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
export function setCtx(props) {
|
|
@@ -14,6 +14,6 @@ export function setCtx(props) {
|
|
|
14
14
|
const separator = { ...createSeparator(removeUndefined(props)), getAttrs };
|
|
15
15
|
return {
|
|
16
16
|
...separator,
|
|
17
|
-
updateOption: getOptionUpdater(separator.options)
|
|
17
|
+
updateOption: getOptionUpdater(separator.options),
|
|
18
18
|
};
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as SliderProps, RangeProps as SliderRangeProps, ThumbProps as SliderThumbProps, InputProps as SliderInputProps, TickProps as SliderTickProps, ThumbEvents as SliderThumbEvents } from "./types.js";
|
|
1
|
+
export type { Props as SliderProps, RangeProps as SliderRangeProps, ThumbProps as SliderThumbProps, InputProps as SliderInputProps, TickProps as SliderTickProps, ThumbEvents as SliderThumbEvents, } from "./types.js";
|
|
@@ -16,10 +16,5 @@ $:
|
|
|
16
16
|
{#if asChild}
|
|
17
17
|
<slot {builder} />
|
|
18
18
|
{:else}
|
|
19
|
-
<span
|
|
20
|
-
bind:this={el}
|
|
21
|
-
{...builder} use:builder.action
|
|
22
|
-
{...$$restProps}
|
|
23
|
-
on:m-keydown={dispatch}
|
|
24
|
-
/>
|
|
19
|
+
<span bind:this={el} {...builder} use:builder.action {...$$restProps} on:m-keydown={dispatch} />
|
|
25
20
|
{/if}
|
package/dist/bits/slider/ctx.js
CHANGED
|
@@ -6,7 +6,7 @@ function getSliderData() {
|
|
|
6
6
|
const PARTS = ["root", "input", "range", "thumb", "tick"];
|
|
7
7
|
return {
|
|
8
8
|
NAME,
|
|
9
|
-
PARTS
|
|
9
|
+
PARTS,
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export function setCtx(props) {
|
|
@@ -16,7 +16,7 @@ export function setCtx(props) {
|
|
|
16
16
|
setContext(NAME, slider);
|
|
17
17
|
return {
|
|
18
18
|
...slider,
|
|
19
|
-
updateOption: getOptionUpdater(slider.options)
|
|
19
|
+
updateOption: getOptionUpdater(slider.options),
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
export function getCtx() {
|
|
@@ -10,4 +10,4 @@ type InputProps = Omit<HTMLInputAttributes, "value"> & DOMEl<HTMLInputElement>;
|
|
|
10
10
|
type ThumbEvents<T extends Element = HTMLSpanElement> = {
|
|
11
11
|
keydown: CustomEventHandler<KeyboardEvent, T>;
|
|
12
12
|
};
|
|
13
|
-
export type { Props, RangeProps, ThumbProps, InputProps, TickProps, ThumbEvents };
|
|
13
|
+
export type { Props, RangeProps, ThumbProps, InputProps, TickProps, ThumbEvents, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as SwitchProps, ThumbProps as SwitchThumbProps, InputProps as SwitchInputProps, Events as SwitchEvents } from "./types.js";
|
|
1
|
+
export type { Props as SwitchProps, ThumbProps as SwitchThumbProps, InputProps as SwitchInputProps, Events as SwitchEvents, } from "./types.js";
|
package/dist/bits/switch/ctx.js
CHANGED
|
@@ -6,7 +6,7 @@ function getSwitchData() {
|
|
|
6
6
|
const PARTS = ["root", "input", "thumb"];
|
|
7
7
|
return {
|
|
8
8
|
NAME,
|
|
9
|
-
PARTS
|
|
9
|
+
PARTS,
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export function setCtx(props) {
|
|
@@ -16,7 +16,7 @@ export function setCtx(props) {
|
|
|
16
16
|
setContext(NAME, Switch);
|
|
17
17
|
return {
|
|
18
18
|
...Switch,
|
|
19
|
-
updateOption: getOptionUpdater(Switch.options)
|
|
19
|
+
updateOption: getOptionUpdater(Switch.options),
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
export function getCtx() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as TabsProps, ContentProps as TabsContentProps, TriggerProps as TabsTriggerProps, ListProps as TabsListProps, TriggerEvents as TabsTriggerEvents } from "./types.js";
|
|
1
|
+
export type { Props as TabsProps, ContentProps as TabsContentProps, TriggerProps as TabsTriggerProps, ListProps as TabsListProps, TriggerEvents as TabsTriggerEvents, } from "./types.js";
|
package/dist/bits/tabs/ctx.js
CHANGED
|
@@ -6,7 +6,7 @@ function getTabsData() {
|
|
|
6
6
|
const PARTS = ["root", "content", "list", "trigger"];
|
|
7
7
|
return {
|
|
8
8
|
NAME,
|
|
9
|
-
PARTS
|
|
9
|
+
PARTS,
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export function setCtx(props) {
|
|
@@ -16,7 +16,7 @@ export function setCtx(props) {
|
|
|
16
16
|
setContext(NAME, tabs);
|
|
17
17
|
return {
|
|
18
18
|
...tabs,
|
|
19
|
-
updateOption: getOptionUpdater(tabs.options)
|
|
19
|
+
updateOption: getOptionUpdater(tabs.options),
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
export function getCtx() {
|
|
@@ -11,4 +11,4 @@ type TriggerEvents<T extends Element = HTMLButtonElement> = {
|
|
|
11
11
|
keydown: CustomEventHandler<KeyboardEvent, T>;
|
|
12
12
|
focus: CustomEventHandler<FocusEvent, T>;
|
|
13
13
|
};
|
|
14
|
-
export type { Props, ContentProps, TriggerProps, ListProps, TriggerEvents };
|
|
14
|
+
export type { Props, ContentProps, TriggerProps, ListProps, TriggerEvents, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as ToggleProps, Events as ToggleEvents } from "./types.js";
|
|
1
|
+
export type { Props as ToggleProps, Events as ToggleEvents, } from "./types.js";
|
package/dist/bits/toggle/ctx.js
CHANGED
|
@@ -6,7 +6,7 @@ function getToggleData() {
|
|
|
6
6
|
const PARTS = ["root", "input"];
|
|
7
7
|
return {
|
|
8
8
|
NAME,
|
|
9
|
-
PARTS
|
|
9
|
+
PARTS,
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export function setCtx(props) {
|
|
@@ -16,7 +16,7 @@ export function setCtx(props) {
|
|
|
16
16
|
setContext(NAME, toggle);
|
|
17
17
|
return {
|
|
18
18
|
...toggle,
|
|
19
|
-
updateOption: getOptionUpdater(toggle.options)
|
|
19
|
+
updateOption: getOptionUpdater(toggle.options),
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
export function getCtx() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as ToggleGroupProps, ItemProps as ToggleGroupItemProps, ItemEvents as ToggleGroupItemEvents } from "./types.js";
|
|
1
|
+
export type { Props as ToggleGroupProps, ItemProps as ToggleGroupItemProps, ItemEvents as ToggleGroupItemEvents, } from "./types.js";
|
|
@@ -6,7 +6,7 @@ function getToggleGroupData() {
|
|
|
6
6
|
const PARTS = ["root", "item"];
|
|
7
7
|
return {
|
|
8
8
|
NAME,
|
|
9
|
-
PARTS
|
|
9
|
+
PARTS,
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export function setCtx(props) {
|
|
@@ -16,7 +16,7 @@ export function setCtx(props) {
|
|
|
16
16
|
setContext(NAME, toggleGroup);
|
|
17
17
|
return {
|
|
18
18
|
...toggleGroup,
|
|
19
|
-
updateOption: getOptionUpdater(toggleGroup.options)
|
|
19
|
+
updateOption: getOptionUpdater(toggleGroup.options),
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
export function getCtx() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as ToolbarProps, ButtonProps as ToolbarButtonProps, LinkProps as ToolbarLinkProps, GroupProps as ToolbarGroupProps, GroupItemProps as ToolbarItemProps, ButtonEvents as ToolbarButtonEvents, LinkEvents as ToolbarLinkEvents, GroupItemEvents as ToolbarItemEvents } from "./types.js";
|
|
1
|
+
export type { Props as ToolbarProps, ButtonProps as ToolbarButtonProps, LinkProps as ToolbarLinkProps, GroupProps as ToolbarGroupProps, GroupItemProps as ToolbarItemProps, ButtonEvents as ToolbarButtonEvents, LinkEvents as ToolbarLinkEvents, GroupItemEvents as ToolbarItemEvents, } from "./types.js";
|
|
@@ -18,13 +18,7 @@ $:
|
|
|
18
18
|
{#if asChild}
|
|
19
19
|
<slot {builder} />
|
|
20
20
|
{:else}
|
|
21
|
-
<button
|
|
22
|
-
bind:this={el}
|
|
23
|
-
{...builder} use:builder.action
|
|
24
|
-
type="button"
|
|
25
|
-
{...$$restProps}
|
|
26
|
-
on:m-keydown={dispatch}
|
|
27
|
-
>
|
|
21
|
+
<button bind:this={el} {...builder} use:builder.action type="button" {...$$restProps} on:m-keydown={dispatch}>
|
|
28
22
|
<slot {builder} />
|
|
29
23
|
</button>
|
|
30
24
|
{/if}
|
package/dist/bits/toolbar/ctx.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createBitAttrs, getOptionUpdater, removeUndefined } from "../../internal/index.js";
|
|
2
|
-
import { createToolbar } from "@melt-ui/svelte";
|
|
2
|
+
import { createToolbar, } from "@melt-ui/svelte";
|
|
3
3
|
import { getContext, setContext } from "svelte";
|
|
4
4
|
function getToolbarData() {
|
|
5
5
|
const NAME = "toolbar";
|
|
@@ -8,7 +8,7 @@ function getToolbarData() {
|
|
|
8
8
|
return {
|
|
9
9
|
NAME,
|
|
10
10
|
GROUP_NAME,
|
|
11
|
-
PARTS
|
|
11
|
+
PARTS,
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
export function setCtx(props) {
|
|
@@ -18,17 +18,17 @@ export function setCtx(props) {
|
|
|
18
18
|
setContext(NAME, toolbar);
|
|
19
19
|
return {
|
|
20
20
|
...toolbar,
|
|
21
|
-
updateOption: getOptionUpdater(toolbar.options)
|
|
21
|
+
updateOption: getOptionUpdater(toolbar.options),
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
export function setGroupCtx(props) {
|
|
25
|
-
const { builders: { createToolbarGroup }, getAttrs } = getCtx();
|
|
25
|
+
const { builders: { createToolbarGroup }, getAttrs, } = getCtx();
|
|
26
26
|
const group = { ...createToolbarGroup(removeUndefined(props)), getAttrs };
|
|
27
27
|
const { GROUP_NAME } = getToolbarData();
|
|
28
28
|
setContext(GROUP_NAME, group);
|
|
29
29
|
return {
|
|
30
30
|
...group,
|
|
31
|
-
updateOption: getOptionUpdater(group.options)
|
|
31
|
+
updateOption: getOptionUpdater(group.options),
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
export function getCtx() {
|
|
@@ -20,4 +20,4 @@ type GroupItemEvents<T extends Element = HTMLButtonElement> = {
|
|
|
20
20
|
click: CustomEventHandler<MouseEvent, T>;
|
|
21
21
|
keydown: CustomEventHandler<KeyboardEvent, T>;
|
|
22
22
|
};
|
|
23
|
-
export type { Props, ButtonProps, LinkProps, GroupProps, GroupItemProps, ButtonEvents, LinkEvents, GroupItemEvents };
|
|
23
|
+
export type { Props, ButtonProps, LinkProps, GroupProps, GroupItemProps, ButtonEvents, LinkEvents, GroupItemEvents, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as TooltipProps, ArrowProps as TooltipArrowProps, ContentProps as TooltipContentProps, TriggerProps as TooltipTriggerProps, TriggerEvents as TooltipTriggerEvents, ContentEvents as TooltipContentEvents } from "./types.js";
|
|
1
|
+
export type { Props as TooltipProps, ArrowProps as TooltipArrowProps, ContentProps as TooltipContentProps, TriggerProps as TooltipTriggerProps, TriggerEvents as TooltipTriggerEvents, ContentEvents as TooltipContentEvents, } from "./types.js";
|
|
@@ -37,13 +37,10 @@ const {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
-
const idValues = derived(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
trigger: $triggerId
|
|
45
|
-
})
|
|
46
|
-
);
|
|
40
|
+
const idValues = derived([ids.content, ids.trigger], ([$contentId, $triggerId]) => ({
|
|
41
|
+
content: $contentId,
|
|
42
|
+
trigger: $triggerId
|
|
43
|
+
}));
|
|
47
44
|
$:
|
|
48
45
|
open !== void 0 && localOpen.set(open);
|
|
49
46
|
$:
|
package/dist/bits/tooltip/ctx.js
CHANGED
|
@@ -7,7 +7,7 @@ function getTooltipData() {
|
|
|
7
7
|
const PARTS = ["arrow", "content", "trigger"];
|
|
8
8
|
return {
|
|
9
9
|
NAME,
|
|
10
|
-
PARTS
|
|
10
|
+
PARTS,
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
export function setCtx(props) {
|
|
@@ -17,18 +17,18 @@ export function setCtx(props) {
|
|
|
17
17
|
...createTooltip({
|
|
18
18
|
positioning: {
|
|
19
19
|
placement: "top",
|
|
20
|
-
gutter: 0
|
|
20
|
+
gutter: 0,
|
|
21
21
|
},
|
|
22
22
|
openDelay: 700,
|
|
23
23
|
...removeUndefined(props),
|
|
24
|
-
forceVisible: true
|
|
24
|
+
forceVisible: true,
|
|
25
25
|
}),
|
|
26
|
-
getAttrs
|
|
26
|
+
getAttrs,
|
|
27
27
|
};
|
|
28
28
|
setContext(NAME, tooltip);
|
|
29
29
|
return {
|
|
30
30
|
...tooltip,
|
|
31
|
-
updateOption: getOptionUpdater(tooltip.options)
|
|
31
|
+
updateOption: getOptionUpdater(tooltip.options),
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
export function getCtx() {
|
|
@@ -44,10 +44,10 @@ export function updatePositioning(props) {
|
|
|
44
44
|
const defaultPlacement = {
|
|
45
45
|
side: "top",
|
|
46
46
|
align: "center",
|
|
47
|
-
sideOffset: 1
|
|
47
|
+
sideOffset: 1,
|
|
48
48
|
};
|
|
49
49
|
const withDefaults = { ...defaultPlacement, ...props };
|
|
50
|
-
const { options: { positioning } } = getCtx();
|
|
50
|
+
const { options: { positioning }, } = getCtx();
|
|
51
51
|
const updater = getPositioningUpdater(positioning);
|
|
52
52
|
updater({ ...withDefaults });
|
|
53
53
|
}
|