akar 2.0.20 → 2.0.21
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/Autocomplete/AutocompleteRoot.cjs +8 -2
- package/dist/Autocomplete/AutocompleteRoot.cjs.map +1 -1
- package/dist/Autocomplete/AutocompleteRoot.js +8 -2
- package/dist/Autocomplete/AutocompleteRoot.js.map +1 -1
- package/dist/ColorSwatchPicker/ColorSwatchPickerRoot.cjs +5 -0
- package/dist/ColorSwatchPicker/ColorSwatchPickerRoot.cjs.map +1 -1
- package/dist/ColorSwatchPicker/ColorSwatchPickerRoot.js +5 -0
- package/dist/ColorSwatchPicker/ColorSwatchPickerRoot.js.map +1 -1
- package/dist/Combobox/ComboboxRoot.cjs +7 -1
- package/dist/Combobox/ComboboxRoot.cjs.map +1 -1
- package/dist/Combobox/ComboboxRoot.js +7 -1
- package/dist/Combobox/ComboboxRoot.js.map +1 -1
- package/dist/ContextMenu/ContextMenuRoot.cjs +12 -6
- package/dist/ContextMenu/ContextMenuRoot.cjs.map +1 -1
- package/dist/ContextMenu/ContextMenuRoot.js +13 -7
- package/dist/ContextMenu/ContextMenuRoot.js.map +1 -1
- package/dist/ContextMenu/ContextMenuTrigger.cjs +18 -2
- package/dist/ContextMenu/ContextMenuTrigger.cjs.map +1 -1
- package/dist/ContextMenu/ContextMenuTrigger.js +19 -3
- package/dist/ContextMenu/ContextMenuTrigger.js.map +1 -1
- package/dist/DateField/DateFieldRoot.cjs +1 -0
- package/dist/DateField/DateFieldRoot.cjs.map +1 -1
- package/dist/DateField/DateFieldRoot.js +1 -0
- package/dist/DateField/DateFieldRoot.js.map +1 -1
- package/dist/DateRangeField/DateRangeFieldRoot.cjs +1 -0
- package/dist/DateRangeField/DateRangeFieldRoot.cjs.map +1 -1
- package/dist/DateRangeField/DateRangeFieldRoot.js +1 -0
- package/dist/DateRangeField/DateRangeFieldRoot.js.map +1 -1
- package/dist/DismissableLayer/DismissableLayer.cjs +1 -1
- package/dist/DismissableLayer/DismissableLayer.cjs.map +1 -1
- package/dist/DismissableLayer/DismissableLayer.js +1 -1
- package/dist/DismissableLayer/DismissableLayer.js.map +1 -1
- package/dist/DismissableLayer/utils.cjs +8 -3
- package/dist/DismissableLayer/utils.cjs.map +1 -1
- package/dist/DismissableLayer/utils.js +8 -3
- package/dist/DismissableLayer/utils.js.map +1 -1
- package/dist/Drawer/DrawerContent.cjs +2 -1
- package/dist/Drawer/DrawerContent.cjs.map +1 -1
- package/dist/Drawer/DrawerContent.js +2 -1
- package/dist/Drawer/DrawerContent.js.map +1 -1
- package/dist/Drawer/DrawerContentImpl.cjs +10 -4
- package/dist/Drawer/DrawerContentImpl.cjs.map +1 -1
- package/dist/Drawer/DrawerContentImpl.js +11 -5
- package/dist/Drawer/DrawerContentImpl.js.map +1 -1
- package/dist/Drawer/DrawerRoot.cjs +14 -3
- package/dist/Drawer/DrawerRoot.cjs.map +1 -1
- package/dist/Drawer/DrawerRoot.js +14 -3
- package/dist/Drawer/DrawerRoot.js.map +1 -1
- package/dist/Drawer/DrawerSwipeArea.cjs +5 -2
- package/dist/Drawer/DrawerSwipeArea.cjs.map +1 -1
- package/dist/Drawer/DrawerSwipeArea.js +6 -3
- package/dist/Drawer/DrawerSwipeArea.js.map +1 -1
- package/dist/DropdownMenu/DropdownMenuTrigger.cjs +2 -1
- package/dist/DropdownMenu/DropdownMenuTrigger.cjs.map +1 -1
- package/dist/DropdownMenu/DropdownMenuTrigger.js +2 -1
- package/dist/DropdownMenu/DropdownMenuTrigger.js.map +1 -1
- package/dist/Listbox/ListboxRoot.cjs +25 -2
- package/dist/Listbox/ListboxRoot.cjs.map +1 -1
- package/dist/Listbox/ListboxRoot.js +25 -2
- package/dist/Listbox/ListboxRoot.js.map +1 -1
- package/dist/Menubar/MenubarTrigger.cjs +2 -1
- package/dist/Menubar/MenubarTrigger.cjs.map +1 -1
- package/dist/Menubar/MenubarTrigger.js +2 -1
- package/dist/Menubar/MenubarTrigger.js.map +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.cjs +3 -2
- package/dist/NavigationMenu/NavigationMenuTrigger.cjs.map +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.js +3 -2
- package/dist/NavigationMenu/NavigationMenuTrigger.js.map +1 -1
- package/dist/NumberField/NumberFieldRoot.cjs +12 -3
- package/dist/NumberField/NumberFieldRoot.cjs.map +1 -1
- package/dist/NumberField/NumberFieldRoot.js +12 -3
- package/dist/NumberField/NumberFieldRoot.js.map +1 -1
- package/dist/PinInput/PinInputRoot.cjs +1 -0
- package/dist/PinInput/PinInputRoot.cjs.map +1 -1
- package/dist/PinInput/PinInputRoot.js +1 -0
- package/dist/PinInput/PinInputRoot.js.map +1 -1
- package/dist/RovingFocus/RovingFocusItem.cjs +7 -2
- package/dist/RovingFocus/RovingFocusItem.cjs.map +1 -1
- package/dist/RovingFocus/RovingFocusItem.js +7 -2
- package/dist/RovingFocus/RovingFocusItem.js.map +1 -1
- package/dist/Select/SelectContent.cjs +4 -0
- package/dist/Select/SelectContent.cjs.map +1 -1
- package/dist/Select/SelectContent.js +4 -0
- package/dist/Select/SelectContent.js.map +1 -1
- package/dist/Select/SelectContentImpl.cjs +7 -2
- package/dist/Select/SelectContentImpl.cjs.map +1 -1
- package/dist/Select/SelectContentImpl.js +9 -4
- package/dist/Select/SelectContentImpl.js.map +1 -1
- package/dist/Select/SelectTrigger.cjs +24 -15
- package/dist/Select/SelectTrigger.cjs.map +1 -1
- package/dist/Select/SelectTrigger.js +25 -16
- package/dist/Select/SelectTrigger.js.map +1 -1
- package/dist/Tabs/TabsTrigger.cjs +4 -1
- package/dist/Tabs/TabsTrigger.cjs.map +1 -1
- package/dist/Tabs/TabsTrigger.js +4 -1
- package/dist/Tabs/TabsTrigger.js.map +1 -1
- package/dist/TimeField/TimeFieldRoot.cjs +1 -0
- package/dist/TimeField/TimeFieldRoot.cjs.map +1 -1
- package/dist/TimeField/TimeFieldRoot.js +1 -0
- package/dist/TimeField/TimeFieldRoot.js.map +1 -1
- package/dist/TimeRangeField/TimeRangeFieldRoot.cjs +1 -0
- package/dist/TimeRangeField/TimeRangeFieldRoot.cjs.map +1 -1
- package/dist/TimeRangeField/TimeRangeFieldRoot.js +1 -0
- package/dist/TimeRangeField/TimeRangeFieldRoot.js.map +1 -1
- package/dist/Toast/ToastAction.cjs +14 -6
- package/dist/Toast/ToastAction.cjs.map +1 -1
- package/dist/Toast/ToastAction.js +15 -7
- package/dist/Toast/ToastAction.js.map +1 -1
- package/dist/Toast/ToastArrow.cjs +53 -0
- package/dist/Toast/ToastArrow.cjs.map +1 -0
- package/dist/Toast/ToastArrow.js +47 -0
- package/dist/Toast/ToastArrow.js.map +1 -0
- package/dist/Toast/ToastDescription.cjs +5 -3
- package/dist/Toast/ToastDescription.cjs.map +1 -1
- package/dist/Toast/ToastDescription.js +6 -4
- package/dist/Toast/ToastDescription.js.map +1 -1
- package/dist/Toast/ToastPositioner.cjs +166 -0
- package/dist/Toast/ToastPositioner.cjs.map +1 -0
- package/dist/Toast/ToastPositioner.js +154 -0
- package/dist/Toast/ToastPositioner.js.map +1 -0
- package/dist/Toast/ToastProvider.cjs +74 -3
- package/dist/Toast/ToastProvider.cjs.map +1 -1
- package/dist/Toast/ToastProvider.js +75 -4
- package/dist/Toast/ToastProvider.js.map +1 -1
- package/dist/Toast/ToastRoot.cjs +38 -15
- package/dist/Toast/ToastRoot.cjs.map +1 -1
- package/dist/Toast/ToastRoot.js +39 -16
- package/dist/Toast/ToastRoot.js.map +1 -1
- package/dist/Toast/ToastRootImpl.cjs +69 -12
- package/dist/Toast/ToastRootImpl.cjs.map +1 -1
- package/dist/Toast/ToastRootImpl.js +74 -17
- package/dist/Toast/ToastRootImpl.js.map +1 -1
- package/dist/Toast/ToastTitle.cjs +5 -3
- package/dist/Toast/ToastTitle.cjs.map +1 -1
- package/dist/Toast/ToastTitle.js +6 -4
- package/dist/Toast/ToastTitle.js.map +1 -1
- package/dist/Toast/ToastViewport.cjs +40 -5
- package/dist/Toast/ToastViewport.cjs.map +1 -1
- package/dist/Toast/ToastViewport.js +41 -6
- package/dist/Toast/ToastViewport.js.map +1 -1
- package/dist/Toast/createToastManager.cjs +119 -0
- package/dist/Toast/createToastManager.cjs.map +1 -0
- package/dist/Toast/createToastManager.js +95 -0
- package/dist/Toast/createToastManager.js.map +1 -0
- package/dist/Toast/useToastManager.cjs +25 -0
- package/dist/Toast/useToastManager.cjs.map +1 -0
- package/dist/Toast/useToastManager.js +20 -0
- package/dist/Toast/useToastManager.js.map +1 -0
- package/dist/Toast/useToastStore.cjs +87 -0
- package/dist/Toast/useToastStore.cjs.map +1 -0
- package/dist/Toast/useToastStore.js +81 -0
- package/dist/Toast/useToastStore.js.map +1 -0
- package/dist/Toast/utils.cjs +2 -4
- package/dist/Toast/utils.cjs.map +1 -1
- package/dist/Toast/utils.js +2 -3
- package/dist/Toast/utils.js.map +1 -1
- package/dist/Tree/TreeRoot.cjs +9 -3
- package/dist/Tree/TreeRoot.cjs.map +1 -1
- package/dist/Tree/TreeRoot.js +9 -3
- package/dist/Tree/TreeRoot.js.map +1 -1
- package/dist/Tree/TreeVirtualizer.cjs +10 -1
- package/dist/Tree/TreeVirtualizer.cjs.map +1 -1
- package/dist/Tree/TreeVirtualizer.js +11 -2
- package/dist/Tree/TreeVirtualizer.js.map +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.cjs +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.cjs.map +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.js +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/composables/useSwipeDismiss.cjs +26 -6
- package/dist/composables/useSwipeDismiss.cjs.map +1 -1
- package/dist/composables/useSwipeDismiss.js +26 -6
- package/dist/composables/useSwipeDismiss.js.map +1 -1
- package/dist/constant/components.cjs +6 -2
- package/dist/constant/components.cjs.map +1 -1
- package/dist/constant/components.js +6 -2
- package/dist/constant/components.js.map +1 -1
- package/dist/constant.d.cts +2 -2
- package/dist/constant.d.cts.map +1 -1
- package/dist/constant.d.ts +2 -2
- package/dist/constant.d.ts.map +1 -1
- package/dist/index.cjs +10 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -1
- package/dist/index2.d.cts +21 -9
- package/dist/index2.d.cts.map +1 -1
- package/dist/index2.d.ts +33 -21
- package/dist/index2.d.ts.map +1 -1
- package/dist/index3.d.cts +1681 -1435
- package/dist/index3.d.cts.map +1 -1
- package/dist/index3.d.ts +1678 -1432
- package/dist/index3.d.ts.map +1 -1
- package/dist/internal.cjs +1 -0
- package/dist/internal.d.cts +3 -3
- package/dist/internal.d.cts.map +1 -1
- package/dist/internal.d.ts +3 -3
- package/dist/internal.js +1 -0
- package/dist/namespaced/index.cjs +3 -1
- package/dist/namespaced/index.d.cts +3 -1
- package/dist/namespaced/index.d.mts +3 -1
- package/dist/namespaced/index.mjs +4 -2
- package/dist/shared/isHTMLElement.cjs +16 -0
- package/dist/shared/isHTMLElement.cjs.map +1 -0
- package/dist/shared/isHTMLElement.js +10 -0
- package/dist/shared/isHTMLElement.js.map +1 -0
- package/dist/shared/useForwardPropsEmits.cjs.map +1 -1
- package/dist/shared/useForwardPropsEmits.js.map +1 -1
- package/dist/shared.cjs +2 -0
- package/dist/shared.d.cts +2 -2
- package/dist/shared.d.ts +2 -2
- package/dist/shared.js +2 -1
- package/package.json +18 -18
- package/src/Autocomplete/AutocompleteRoot.vue +4 -1
- package/src/Combobox/ComboboxRoot.vue +2 -1
- package/src/ContextMenu/ContextMenuRoot.vue +8 -7
- package/src/ContextMenu/ContextMenuTrigger.vue +37 -3
- package/src/DateField/DateFieldRoot.vue +1 -0
- package/src/DatePicker/DatePickerContent.vue +1 -1
- package/src/DateRangeField/DateRangeFieldRoot.vue +1 -0
- package/src/DateRangePicker/DateRangePickerContent.vue +1 -1
- package/src/DismissableLayer/DismissableLayer.vue +4 -0
- package/src/DismissableLayer/utils.ts +20 -7
- package/src/Drawer/DrawerContent.vue +2 -2
- package/src/Drawer/DrawerContentImpl.vue +19 -8
- package/src/Drawer/DrawerRoot.vue +23 -5
- package/src/Drawer/DrawerSwipeArea.vue +10 -3
- package/src/Drawer/composables/useSwipeDismiss.ts +51 -5
- package/src/DropdownMenu/DropdownMenuTrigger.vue +2 -1
- package/src/Listbox/ListboxRoot.vue +30 -2
- package/src/Menubar/MenubarTrigger.vue +2 -1
- package/src/NavigationMenu/NavigationMenuTrigger.vue +7 -2
- package/src/NumberField/NumberFieldRoot.vue +28 -4
- package/src/PinInput/PinInputRoot.vue +1 -0
- package/src/RovingFocus/RovingFocusItem.vue +13 -2
- package/src/Select/SelectContentImpl.vue +13 -3
- package/src/Select/SelectTrigger.vue +52 -21
- package/src/Tabs/TabsTrigger.vue +4 -1
- package/src/TimeField/TimeFieldRoot.vue +1 -0
- package/src/TimeRangeField/TimeRangeFieldRoot.vue +1 -0
- package/src/Toast/ToastAction.vue +22 -7
- package/src/Toast/ToastArrow.vue +38 -0
- package/src/Toast/ToastDescription.vue +10 -1
- package/src/Toast/ToastPositioner.vue +76 -0
- package/src/Toast/ToastProvider.vue +113 -5
- package/src/Toast/ToastRoot.vue +39 -8
- package/src/Toast/ToastRootImpl.vue +67 -17
- package/src/Toast/ToastTitle.vue +8 -2
- package/src/Toast/ToastViewport.vue +41 -3
- package/src/Toast/createToastManager.ts +207 -0
- package/src/Toast/index.ts +15 -0
- package/src/Toast/useToastManager.ts +23 -0
- package/src/Toast/useToastStore.ts +92 -0
- package/src/Toast/utils.ts +2 -4
- package/src/Tree/TreeRoot.vue +6 -1
- package/src/Tree/TreeVirtualizer.vue +17 -2
- package/src/VisuallyHidden/VisuallyHidden.vue +11 -1
- package/src/internal.ts +2 -1
- package/src/shared/index.ts +1 -0
- package/src/shared/isHTMLElement.ts +9 -0
- package/src/shared/useForwardPropsEmits.ts +12 -5
|
@@ -11,7 +11,7 @@ var ToastAction_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0
|
|
|
11
11
|
props: {
|
|
12
12
|
altText: {
|
|
13
13
|
type: String,
|
|
14
|
-
required:
|
|
14
|
+
required: false
|
|
15
15
|
},
|
|
16
16
|
closeOnClick: {
|
|
17
17
|
type: Boolean,
|
|
@@ -30,13 +30,21 @@ var ToastAction_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0
|
|
|
30
30
|
},
|
|
31
31
|
setup(__props) {
|
|
32
32
|
const props = __props;
|
|
33
|
-
if (!props.altText) throw new Error("Missing prop `altText` expected on `ToastAction`");
|
|
34
33
|
const rootContext = require_Toast_ToastRootImpl.injectToastRootContext();
|
|
35
34
|
const { forwardRef } = require_shared_useForwardExpose.useForwardExpose();
|
|
35
|
+
const slots = (0, vue.useSlots)();
|
|
36
|
+
const actionProps = (0, vue.computed)(() => rootContext.toast.value?.actionProps);
|
|
37
|
+
const isRendered = (0, vue.computed)(() => !!slots.default || !rootContext.toast.value || !!actionProps.value);
|
|
38
|
+
const altText = (0, vue.computed)(() => props.altText ?? actionProps.value?.altText);
|
|
39
|
+
if (isRendered.value && !altText.value) throw new Error("Missing prop `altText` expected on `ToastAction`");
|
|
40
|
+
function handleClick(event) {
|
|
41
|
+
actionProps.value?.onClick?.(event);
|
|
42
|
+
if (actionProps.value?.closeOnClick ?? props.closeOnClick) rootContext.onClose();
|
|
43
|
+
}
|
|
36
44
|
return (_ctx, _cache) => {
|
|
37
|
-
return
|
|
45
|
+
return isRendered.value && altText.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_Toast_ToastAnnounceExclude.ToastAnnounceExclude_default, {
|
|
38
46
|
key: 0,
|
|
39
|
-
"alt-text":
|
|
47
|
+
"alt-text": altText.value,
|
|
40
48
|
"as-child": ""
|
|
41
49
|
}, {
|
|
42
50
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(require_Primitive_Primitive.Primitive), {
|
|
@@ -44,9 +52,9 @@ var ToastAction_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0
|
|
|
44
52
|
as: __props.as,
|
|
45
53
|
"as-child": __props.asChild,
|
|
46
54
|
type: __props.as === "button" ? "button" : void 0,
|
|
47
|
-
onClick:
|
|
55
|
+
onClick: handleClick
|
|
48
56
|
}, {
|
|
49
|
-
default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
|
|
57
|
+
default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(actionProps.value?.label), 1)])]),
|
|
50
58
|
_: 3
|
|
51
59
|
}, 8, [
|
|
52
60
|
"as",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastAction.cjs","names":[],"sources":["../../src/Toast/ToastAction.vue","../../src/Toast/ToastAction.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ToastAction.cjs","names":[],"sources":["../../src/Toast/ToastAction.vue","../../src/Toast/ToastAction.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BA,MAAM,QAAQ;EAQd,MAAM,cAAc,oDAAwB;EAC5C,MAAM,EAAE,YAAY,GAAG,kDAAkB;EAEzC,MAAM,QAAQ,mBAAU;EAExB,MAAM,cAAc,kBAAS,MAAM,YAAY,MAAM,OAAO,YAAY;EAExE,MAAM,aAAa,kBAAS,QAAQ,MAAM,YAAY,YAAY,MAAM,WAAW,YAAY,MAAM;EACrG,MAAM,UAAU,kBAAS,MAAM,MAAM,WAAW,YAAY,OAAO,QAAQ;AAE3E,MAAI,WAAW,UAAU,QAAQ,MAC/B,OAAM,IAAI,MAAM;EAGlB,SAAS,YAAY,OAAmB;AACtC,eAAY,OAAO,UAAU,MAAM;AACnC,OAAI,YAAY,OAAO,gBAAgB,MAAM,aAC3C,aAAY,SAAS;EAEzB;;UAKU,WAAA,SAAc,QAAA,+BADtB,qBAcuB,iEAAA;;IAZpB,YAAU,QAAA;IACX,YAAA;;8BAEA,MAQY,CARZ,qBAQY,eAAA,sCAAA,EAAA;KAPT,KAAK,eAAA,WAAU;KACf,IAAI,QAAA;KACJ,YAAU,QAAA;KACV,MAAM,QAAA,OAAE,WAAA;KACR,SAAO;;+BAER,MAAqC,CAArC,oBAAqC,KAAA,QAAA,WAAA,CAAA,GAArC,MAAqC,mDAA5B,YAAA,OAAa,MAAK,EAAA,EAAA"}
|
|
@@ -2,7 +2,7 @@ import { useForwardExpose } from "../shared/useForwardExpose.js";
|
|
|
2
2
|
import { Primitive } from "../Primitive/Primitive.js";
|
|
3
3
|
import { ToastAnnounceExclude_default } from "./ToastAnnounceExclude.js";
|
|
4
4
|
import { injectToastRootContext } from "./ToastRootImpl.js";
|
|
5
|
-
import { createBlock, createCommentVNode, createVNode, defineComponent, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
5
|
+
import { computed, createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, openBlock, renderSlot, toDisplayString, unref, useSlots, withCtx } from "vue";
|
|
6
6
|
|
|
7
7
|
//#region src/Toast/ToastAction.vue?vue&type=script&setup=true&lang.ts
|
|
8
8
|
var ToastAction_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
@@ -10,7 +10,7 @@ var ToastAction_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
10
10
|
props: {
|
|
11
11
|
altText: {
|
|
12
12
|
type: String,
|
|
13
|
-
required:
|
|
13
|
+
required: false
|
|
14
14
|
},
|
|
15
15
|
closeOnClick: {
|
|
16
16
|
type: Boolean,
|
|
@@ -29,13 +29,21 @@ var ToastAction_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
29
29
|
},
|
|
30
30
|
setup(__props) {
|
|
31
31
|
const props = __props;
|
|
32
|
-
if (!props.altText) throw new Error("Missing prop `altText` expected on `ToastAction`");
|
|
33
32
|
const rootContext = injectToastRootContext();
|
|
34
33
|
const { forwardRef } = useForwardExpose();
|
|
34
|
+
const slots = useSlots();
|
|
35
|
+
const actionProps = computed(() => rootContext.toast.value?.actionProps);
|
|
36
|
+
const isRendered = computed(() => !!slots.default || !rootContext.toast.value || !!actionProps.value);
|
|
37
|
+
const altText = computed(() => props.altText ?? actionProps.value?.altText);
|
|
38
|
+
if (isRendered.value && !altText.value) throw new Error("Missing prop `altText` expected on `ToastAction`");
|
|
39
|
+
function handleClick(event) {
|
|
40
|
+
actionProps.value?.onClick?.(event);
|
|
41
|
+
if (actionProps.value?.closeOnClick ?? props.closeOnClick) rootContext.onClose();
|
|
42
|
+
}
|
|
35
43
|
return (_ctx, _cache) => {
|
|
36
|
-
return
|
|
44
|
+
return isRendered.value && altText.value ? (openBlock(), createBlock(ToastAnnounceExclude_default, {
|
|
37
45
|
key: 0,
|
|
38
|
-
"alt-text":
|
|
46
|
+
"alt-text": altText.value,
|
|
39
47
|
"as-child": ""
|
|
40
48
|
}, {
|
|
41
49
|
default: withCtx(() => [createVNode(unref(Primitive), {
|
|
@@ -43,9 +51,9 @@ var ToastAction_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
43
51
|
as: __props.as,
|
|
44
52
|
"as-child": __props.asChild,
|
|
45
53
|
type: __props.as === "button" ? "button" : void 0,
|
|
46
|
-
onClick:
|
|
54
|
+
onClick: handleClick
|
|
47
55
|
}, {
|
|
48
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
56
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(actionProps.value?.label), 1)])]),
|
|
49
57
|
_: 3
|
|
50
58
|
}, 8, [
|
|
51
59
|
"as",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastAction.js","names":[],"sources":["../../src/Toast/ToastAction.vue","../../src/Toast/ToastAction.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ToastAction.js","names":[],"sources":["../../src/Toast/ToastAction.vue","../../src/Toast/ToastAction.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BA,MAAM,QAAQ;EAQd,MAAM,cAAc,wBAAwB;EAC5C,MAAM,EAAE,YAAY,GAAG,kBAAkB;EAEzC,MAAM,QAAQ,UAAU;EAExB,MAAM,cAAc,SAAS,MAAM,YAAY,MAAM,OAAO,YAAY;EAExE,MAAM,aAAa,SAAS,QAAQ,MAAM,YAAY,YAAY,MAAM,WAAW,YAAY,MAAM;EACrG,MAAM,UAAU,SAAS,MAAM,MAAM,WAAW,YAAY,OAAO,QAAQ;AAE3E,MAAI,WAAW,UAAU,QAAQ,MAC/B,OAAM,IAAI,MAAM;EAGlB,SAAS,YAAY,OAAmB;AACtC,eAAY,OAAO,UAAU,MAAM;AACnC,OAAI,YAAY,OAAO,gBAAgB,MAAM,aAC3C,aAAY,SAAS;EAEzB;;UAKU,WAAA,SAAc,QAAA,sBADtB,YAcuB,8BAAA;;IAZpB,YAAU,QAAA;IACX,YAAA;;qBAEA,MAQY,CARZ,YAQY,MAAA,UAAA,EAAA;KAPT,KAAK,MAAA,WAAU;KACf,IAAI,QAAA;KACJ,YAAU,QAAA;KACV,MAAM,QAAA,OAAE,WAAA;KACR,SAAO;;sBAER,MAAqC,CAArC,WAAqC,KAAA,QAAA,WAAA,CAAA,GAArC,MAAqC,iCAA5B,YAAA,OAAa,MAAK,EAAA,EAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../rolldown-runtime.cjs');
|
|
2
|
+
const require_shared_useForwardExpose = require('../shared/useForwardExpose.cjs');
|
|
3
|
+
const require_Popper_PopperArrow = require('../Popper/PopperArrow.cjs');
|
|
4
|
+
const vue = require_rolldown_runtime.__toESM(require("vue"));
|
|
5
|
+
|
|
6
|
+
//#region src/Toast/ToastArrow.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var ToastArrow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
8
|
+
__name: "ToastArrow",
|
|
9
|
+
props: {
|
|
10
|
+
width: {
|
|
11
|
+
type: Number,
|
|
12
|
+
required: false,
|
|
13
|
+
default: 10
|
|
14
|
+
},
|
|
15
|
+
height: {
|
|
16
|
+
type: Number,
|
|
17
|
+
required: false,
|
|
18
|
+
default: 5
|
|
19
|
+
},
|
|
20
|
+
asChild: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
required: false
|
|
23
|
+
},
|
|
24
|
+
as: {
|
|
25
|
+
type: null,
|
|
26
|
+
required: false,
|
|
27
|
+
default: "svg"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
setup(__props) {
|
|
31
|
+
const props = __props;
|
|
32
|
+
require_shared_useForwardExpose.useForwardExpose();
|
|
33
|
+
return (_ctx, _cache) => {
|
|
34
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_Popper_PopperArrow.PopperArrow_default), (0, vue.normalizeProps)((0, vue.guardReactiveProps)(props)), {
|
|
35
|
+
default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
|
|
36
|
+
_: 3
|
|
37
|
+
}, 16);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/Toast/ToastArrow.vue
|
|
44
|
+
var ToastArrow_default = ToastArrow_vue_vue_type_script_setup_true_lang_default;
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
Object.defineProperty(exports, 'ToastArrow_default', {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () {
|
|
50
|
+
return ToastArrow_default;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=ToastArrow.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastArrow.cjs","names":[],"sources":["../../src/Toast/ToastArrow.vue","../../src/Toast/ToastArrow.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBA,MAAM,QAAQ;AAMd,oDAAkB;;gCAIhB,qBAEc,eAAA,+CAAA,EAAA,wBAAA,4BAFO,MAAK,CAAA,EAAA;8BACxB,MAAQ,CAAR,oBAAQ,KAAA,QAAA,UAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useForwardExpose } from "../shared/useForwardExpose.js";
|
|
2
|
+
import { PopperArrow_default } from "../Popper/PopperArrow.js";
|
|
3
|
+
import { createBlock, defineComponent, guardReactiveProps, normalizeProps, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/Toast/ToastArrow.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var ToastArrow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "ToastArrow",
|
|
8
|
+
props: {
|
|
9
|
+
width: {
|
|
10
|
+
type: Number,
|
|
11
|
+
required: false,
|
|
12
|
+
default: 10
|
|
13
|
+
},
|
|
14
|
+
height: {
|
|
15
|
+
type: Number,
|
|
16
|
+
required: false,
|
|
17
|
+
default: 5
|
|
18
|
+
},
|
|
19
|
+
asChild: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
required: false
|
|
22
|
+
},
|
|
23
|
+
as: {
|
|
24
|
+
type: null,
|
|
25
|
+
required: false,
|
|
26
|
+
default: "svg"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
setup(__props) {
|
|
30
|
+
const props = __props;
|
|
31
|
+
useForwardExpose();
|
|
32
|
+
return (_ctx, _cache) => {
|
|
33
|
+
return openBlock(), createBlock(unref(PopperArrow_default), normalizeProps(guardReactiveProps(props)), {
|
|
34
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
35
|
+
_: 3
|
|
36
|
+
}, 16);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/Toast/ToastArrow.vue
|
|
43
|
+
var ToastArrow_default = ToastArrow_vue_vue_type_script_setup_true_lang_default;
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { ToastArrow_default };
|
|
47
|
+
//# sourceMappingURL=ToastArrow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastArrow.js","names":[],"sources":["../../src/Toast/ToastArrow.vue","../../src/Toast/ToastArrow.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBA,MAAM,QAAQ;AAMd,oBAAkB;;uBAIhB,YAEc,MAAA,oBAAA,EAAA,eAAA,mBAFO,MAAK,CAAA,EAAA;qBACxB,MAAQ,CAAR,WAAQ,KAAA,QAAA,UAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../rolldown-runtime.cjs');
|
|
2
2
|
const require_shared_useForwardExpose = require('../shared/useForwardExpose.cjs');
|
|
3
3
|
const require_Primitive_Primitive = require('../Primitive/Primitive.cjs');
|
|
4
|
+
const require_Toast_ToastRootImpl = require('./ToastRootImpl.cjs');
|
|
4
5
|
const vue = require_rolldown_runtime.__toESM(require("vue"));
|
|
5
6
|
|
|
6
7
|
//#region src/Toast/ToastDescription.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -19,11 +20,12 @@ var ToastDescription_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
19
20
|
setup(__props) {
|
|
20
21
|
const props = __props;
|
|
21
22
|
require_shared_useForwardExpose.useForwardExpose();
|
|
23
|
+
const rootContext = require_Toast_ToastRootImpl.injectToastRootContext(null);
|
|
22
24
|
return (_ctx, _cache) => {
|
|
23
|
-
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_Primitive_Primitive.Primitive), (0, vue.normalizeProps)((0, vue.
|
|
24
|
-
default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
|
|
25
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [(0, vue.createCommentVNode)(" A managed toast without a description renders nothing, unless slot content is given. "), _ctx.$slots.default || !(0, vue.unref)(rootContext)?.toast.value || (0, vue.unref)(rootContext).toast.value.description ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_Primitive_Primitive.Primitive), (0, vue.normalizeProps)((0, vue.mergeProps)({ key: 0 }, props)), {
|
|
26
|
+
default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(rootContext)?.toast.value?.description), 1)]), (0, vue.renderSlot)(_ctx.$slots, "default")]),
|
|
25
27
|
_: 3
|
|
26
|
-
}, 16);
|
|
28
|
+
}, 16)) : (0, vue.createCommentVNode)("v-if", true)], 2112);
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastDescription.cjs","names":[],"sources":["../../src/Toast/ToastDescription.vue","../../src/Toast/ToastDescription.vue"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToastDescription.cjs","names":["$slots"],"sources":["../../src/Toast/ToastDescription.vue","../../src/Toast/ToastDescription.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;EAWA,MAAM,QAAQ;AAEd,oDAAkB;EAElB,MAAM,cAAc,mDAAuB,KAAK;;iFAI9C,4BAAA,yFAA6F,EAErFA,KAAAA,OAAO,YAAY,eAAA,YAAW,EAAE,MAAM,SAAS,eAAA,YAAW,CAAC,MAAM,MAAM,qCAD/E,qBAMY,eAAA,sCAAA,EAAA,wBAAA,oBAAA,EAAA,KAAA,EAAA,GAJF,MAAK,CAAA,EAAA;8BAEb,MAAwD,CAAxD,oBAAwD,KAAA,QAAA,WAAA,CAAA,GAAxD,MAAwD,mDAA/C,eAAA,YAAW,EAAE,MAAM,OAAO,YAAW,EAAA,EAAA,IAC9C,oBAAQ,KAAA,QAAA,UAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useForwardExpose } from "../shared/useForwardExpose.js";
|
|
2
2
|
import { Primitive } from "../Primitive/Primitive.js";
|
|
3
|
-
import {
|
|
3
|
+
import { injectToastRootContext } from "./ToastRootImpl.js";
|
|
4
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, createTextVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
4
5
|
|
|
5
6
|
//#region src/Toast/ToastDescription.vue?vue&type=script&setup=true&lang.ts
|
|
6
7
|
var ToastDescription_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
@@ -18,11 +19,12 @@ var ToastDescription_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
18
19
|
setup(__props) {
|
|
19
20
|
const props = __props;
|
|
20
21
|
useForwardExpose();
|
|
22
|
+
const rootContext = injectToastRootContext(null);
|
|
21
23
|
return (_ctx, _cache) => {
|
|
22
|
-
return openBlock(), createBlock(unref(Primitive), normalizeProps(
|
|
23
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
24
|
+
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" A managed toast without a description renders nothing, unless slot content is given. "), _ctx.$slots.default || !unref(rootContext)?.toast.value || unref(rootContext).toast.value.description ? (openBlock(), createBlock(unref(Primitive), normalizeProps(mergeProps({ key: 0 }, props)), {
|
|
25
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(unref(rootContext)?.toast.value?.description), 1)]), renderSlot(_ctx.$slots, "default")]),
|
|
24
26
|
_: 3
|
|
25
|
-
}, 16);
|
|
27
|
+
}, 16)) : createCommentVNode("v-if", true)], 2112);
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastDescription.js","names":[],"sources":["../../src/Toast/ToastDescription.vue","../../src/Toast/ToastDescription.vue"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToastDescription.js","names":["$slots"],"sources":["../../src/Toast/ToastDescription.vue","../../src/Toast/ToastDescription.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;EAWA,MAAM,QAAQ;AAEd,oBAAkB;EAElB,MAAM,cAAc,uBAAuB,KAAK;;2DAI9C,mBAAA,yFAA6F,EAErFA,KAAAA,OAAO,YAAY,MAAA,YAAW,EAAE,MAAM,SAAS,MAAA,YAAW,CAAC,MAAM,MAAM,4BAD/E,YAMY,MAAA,UAAA,EAAA,eAAA,WAAA,EAAA,KAAA,EAAA,GAJF,MAAK,CAAA,EAAA;qBAEb,MAAwD,CAAxD,WAAwD,KAAA,QAAA,WAAA,CAAA,GAAxD,MAAwD,iCAA/C,MAAA,YAAW,EAAE,MAAM,OAAO,YAAW,EAAA,EAAA,IAC9C,WAAQ,KAAA,QAAA,UAAA"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../rolldown-runtime.cjs');
|
|
2
|
+
const require_shared_createContext = require('../shared/createContext.cjs');
|
|
3
|
+
const require_shared_useForwardExpose = require('../shared/useForwardExpose.cjs');
|
|
4
|
+
const require_Popper_PopperRoot = require('../Popper/PopperRoot.cjs');
|
|
5
|
+
const require_Popper_PopperContent = require('../Popper/PopperContent.cjs');
|
|
6
|
+
const vue = require_rolldown_runtime.__toESM(require("vue"));
|
|
7
|
+
|
|
8
|
+
//#region src/Toast/ToastPositioner.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
const [injectToastPositionerContext, provideToastPositionerContext] = require_shared_createContext.createContext("ToastPositioner");
|
|
10
|
+
var ToastPositioner_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
__name: "ToastPositioner",
|
|
13
|
+
props: {
|
|
14
|
+
toast: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
anchor: {
|
|
19
|
+
type: null,
|
|
20
|
+
required: false
|
|
21
|
+
},
|
|
22
|
+
side: {
|
|
23
|
+
type: null,
|
|
24
|
+
required: false
|
|
25
|
+
},
|
|
26
|
+
sideOffset: {
|
|
27
|
+
type: Number,
|
|
28
|
+
required: false
|
|
29
|
+
},
|
|
30
|
+
sideFlip: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
required: false,
|
|
33
|
+
default: void 0
|
|
34
|
+
},
|
|
35
|
+
align: {
|
|
36
|
+
type: null,
|
|
37
|
+
required: false
|
|
38
|
+
},
|
|
39
|
+
alignOffset: {
|
|
40
|
+
type: Number,
|
|
41
|
+
required: false
|
|
42
|
+
},
|
|
43
|
+
alignFlip: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
required: false,
|
|
46
|
+
default: void 0
|
|
47
|
+
},
|
|
48
|
+
avoidCollisions: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
required: false,
|
|
51
|
+
default: void 0
|
|
52
|
+
},
|
|
53
|
+
collisionBoundary: {
|
|
54
|
+
type: null,
|
|
55
|
+
required: false
|
|
56
|
+
},
|
|
57
|
+
collisionPadding: {
|
|
58
|
+
type: [Number, Object],
|
|
59
|
+
required: false
|
|
60
|
+
},
|
|
61
|
+
arrowPadding: {
|
|
62
|
+
type: Number,
|
|
63
|
+
required: false
|
|
64
|
+
},
|
|
65
|
+
hideShiftedArrow: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
required: false,
|
|
68
|
+
default: void 0
|
|
69
|
+
},
|
|
70
|
+
sticky: {
|
|
71
|
+
type: String,
|
|
72
|
+
required: false
|
|
73
|
+
},
|
|
74
|
+
hideWhenDetached: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
required: false,
|
|
77
|
+
default: void 0
|
|
78
|
+
},
|
|
79
|
+
positionStrategy: {
|
|
80
|
+
type: String,
|
|
81
|
+
required: false
|
|
82
|
+
},
|
|
83
|
+
updatePositionStrategy: {
|
|
84
|
+
type: String,
|
|
85
|
+
required: false
|
|
86
|
+
},
|
|
87
|
+
disableUpdateOnLayoutShift: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
required: false,
|
|
90
|
+
default: void 0
|
|
91
|
+
},
|
|
92
|
+
prioritizePosition: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
required: false,
|
|
95
|
+
default: void 0
|
|
96
|
+
},
|
|
97
|
+
dir: {
|
|
98
|
+
type: String,
|
|
99
|
+
required: false
|
|
100
|
+
},
|
|
101
|
+
asChild: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
required: false
|
|
104
|
+
},
|
|
105
|
+
as: {
|
|
106
|
+
type: null,
|
|
107
|
+
required: false
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
setup(__props) {
|
|
111
|
+
const props = __props;
|
|
112
|
+
const { forwardRef } = require_shared_useForwardExpose.useForwardExpose();
|
|
113
|
+
const DEFAULTS = {
|
|
114
|
+
...require_Popper_PopperContent.PopperContentPropsDefaultValue,
|
|
115
|
+
side: "top",
|
|
116
|
+
collisionPadding: 5,
|
|
117
|
+
arrowPadding: 5
|
|
118
|
+
};
|
|
119
|
+
const resolvedProps = (0, vue.computed)(() => {
|
|
120
|
+
const fromToast = props.toast.positionerProps ?? {};
|
|
121
|
+
const resolved = {};
|
|
122
|
+
for (const key of Object.keys(props)) {
|
|
123
|
+
if (key === "toast" || key === "anchor") continue;
|
|
124
|
+
resolved[key] = props[key] ?? fromToast[key] ?? DEFAULTS[key];
|
|
125
|
+
}
|
|
126
|
+
if (typeof resolved.collisionBoundary === "function") resolved.collisionBoundary = resolved.collisionBoundary();
|
|
127
|
+
return resolved;
|
|
128
|
+
});
|
|
129
|
+
const anchor = (0, vue.computed)(() => props.anchor ?? props.toast.positionerProps?.anchor ?? void 0);
|
|
130
|
+
provideToastPositionerContext({});
|
|
131
|
+
return (_ctx, _cache) => {
|
|
132
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_Popper_PopperRoot.PopperRoot_default), null, {
|
|
133
|
+
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(require_Popper_PopperContent.PopperContent_default), (0, vue.mergeProps)({
|
|
134
|
+
...resolvedProps.value,
|
|
135
|
+
..._ctx.$attrs
|
|
136
|
+
}, {
|
|
137
|
+
ref: (0, vue.unref)(forwardRef),
|
|
138
|
+
reference: anchor.value
|
|
139
|
+
}), {
|
|
140
|
+
default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
|
|
141
|
+
_: 3
|
|
142
|
+
}, 16, ["reference"])]),
|
|
143
|
+
_: 3
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/Toast/ToastPositioner.vue
|
|
151
|
+
var ToastPositioner_default = ToastPositioner_vue_vue_type_script_setup_true_lang_default;
|
|
152
|
+
|
|
153
|
+
//#endregion
|
|
154
|
+
Object.defineProperty(exports, 'ToastPositioner_default', {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get: function () {
|
|
157
|
+
return ToastPositioner_default;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
Object.defineProperty(exports, 'injectToastPositionerContext', {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: function () {
|
|
163
|
+
return injectToastPositionerContext;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
//# sourceMappingURL=ToastPositioner.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastPositioner.cjs","names":["$attrs"],"sources":["../../src/Toast/ToastPositioner.vue","../../src/Toast/ToastPositioner.vue"],"sourcesContent":[],"mappings":";;;;;;;;AAaA,MAAa,CAAC,8BAA8B,8BAA6B,GACrE,2CAAsB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW5C,MAAM,QAAQ;EAWd,MAAM,EAAE,YAAY,GAAG,kDAAkB;EAEzC,MAAM,WAAW;GACf,GAAG;GACH,MAAM;GACN,kBAAkB;GAClB,cAAc;EACf;EAED,MAAM,gBAAgB,kBAAS,MAAM;GACnC,MAAM,YAAY,MAAM,MAAM,mBAAmB,CAAE;GACnD,MAAM,WAAoC,CAAE;AAC5C,QAAK,MAAM,OAAO,OAAO,KAAK,MAAM,EAAuC;AACzE,QAAI,QAAQ,WAAW,QAAQ,SAC7B;AAEF,aAAS,OAAO,MAAM,QAAQ,UAAU,QAAkC,SAAS;GACrF;AACA,cAAW,SAAS,sBAAsB,WACxC,UAAS,oBAAoB,SAAS,mBAAmB;AAE3D,UAAO;EACR,EAAC;EAEF,MAAM,SAAS,kBAAS,MAAM,MAAM,UAAU,MAAM,MAAM,iBAAiB,iBAAoB;AAE/F,gCAA8B,CAAE,EAAC;;gCAI/B,qBAQa,eAAA,6CAAA,EAAA,MAAA;8BAPX,MAMgB,CANhB,qBAMgB,eAAA,mDAAA,EANhB,oBAMgB;KAAA,GALD,cAAA;KAAa,GAAKA,KAAAA;IAAM,GAAA;KACpC,KAAK,eAAA,WAAU;KACf,WAAW,OAAA;;+BAEZ,MAAQ,CAAR,oBAAQ,KAAA,QAAA,UAAA"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { createContext } from "../shared/createContext.js";
|
|
2
|
+
import { useForwardExpose } from "../shared/useForwardExpose.js";
|
|
3
|
+
import { PopperRoot_default } from "../Popper/PopperRoot.js";
|
|
4
|
+
import { PopperContentPropsDefaultValue, PopperContent_default } from "../Popper/PopperContent.js";
|
|
5
|
+
import { computed, createBlock, createVNode, defineComponent, mergeProps, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
6
|
+
|
|
7
|
+
//#region src/Toast/ToastPositioner.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
const [injectToastPositionerContext, provideToastPositionerContext] = /*#__PURE__*/ createContext("ToastPositioner");
|
|
9
|
+
var ToastPositioner_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
__name: "ToastPositioner",
|
|
12
|
+
props: {
|
|
13
|
+
toast: {
|
|
14
|
+
type: Object,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
anchor: {
|
|
18
|
+
type: null,
|
|
19
|
+
required: false
|
|
20
|
+
},
|
|
21
|
+
side: {
|
|
22
|
+
type: null,
|
|
23
|
+
required: false
|
|
24
|
+
},
|
|
25
|
+
sideOffset: {
|
|
26
|
+
type: Number,
|
|
27
|
+
required: false
|
|
28
|
+
},
|
|
29
|
+
sideFlip: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
required: false,
|
|
32
|
+
default: void 0
|
|
33
|
+
},
|
|
34
|
+
align: {
|
|
35
|
+
type: null,
|
|
36
|
+
required: false
|
|
37
|
+
},
|
|
38
|
+
alignOffset: {
|
|
39
|
+
type: Number,
|
|
40
|
+
required: false
|
|
41
|
+
},
|
|
42
|
+
alignFlip: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
required: false,
|
|
45
|
+
default: void 0
|
|
46
|
+
},
|
|
47
|
+
avoidCollisions: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
required: false,
|
|
50
|
+
default: void 0
|
|
51
|
+
},
|
|
52
|
+
collisionBoundary: {
|
|
53
|
+
type: null,
|
|
54
|
+
required: false
|
|
55
|
+
},
|
|
56
|
+
collisionPadding: {
|
|
57
|
+
type: [Number, Object],
|
|
58
|
+
required: false
|
|
59
|
+
},
|
|
60
|
+
arrowPadding: {
|
|
61
|
+
type: Number,
|
|
62
|
+
required: false
|
|
63
|
+
},
|
|
64
|
+
hideShiftedArrow: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
required: false,
|
|
67
|
+
default: void 0
|
|
68
|
+
},
|
|
69
|
+
sticky: {
|
|
70
|
+
type: String,
|
|
71
|
+
required: false
|
|
72
|
+
},
|
|
73
|
+
hideWhenDetached: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
required: false,
|
|
76
|
+
default: void 0
|
|
77
|
+
},
|
|
78
|
+
positionStrategy: {
|
|
79
|
+
type: String,
|
|
80
|
+
required: false
|
|
81
|
+
},
|
|
82
|
+
updatePositionStrategy: {
|
|
83
|
+
type: String,
|
|
84
|
+
required: false
|
|
85
|
+
},
|
|
86
|
+
disableUpdateOnLayoutShift: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
required: false,
|
|
89
|
+
default: void 0
|
|
90
|
+
},
|
|
91
|
+
prioritizePosition: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
required: false,
|
|
94
|
+
default: void 0
|
|
95
|
+
},
|
|
96
|
+
dir: {
|
|
97
|
+
type: String,
|
|
98
|
+
required: false
|
|
99
|
+
},
|
|
100
|
+
asChild: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
required: false
|
|
103
|
+
},
|
|
104
|
+
as: {
|
|
105
|
+
type: null,
|
|
106
|
+
required: false
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
setup(__props) {
|
|
110
|
+
const props = __props;
|
|
111
|
+
const { forwardRef } = useForwardExpose();
|
|
112
|
+
const DEFAULTS = {
|
|
113
|
+
...PopperContentPropsDefaultValue,
|
|
114
|
+
side: "top",
|
|
115
|
+
collisionPadding: 5,
|
|
116
|
+
arrowPadding: 5
|
|
117
|
+
};
|
|
118
|
+
const resolvedProps = computed(() => {
|
|
119
|
+
const fromToast = props.toast.positionerProps ?? {};
|
|
120
|
+
const resolved = {};
|
|
121
|
+
for (const key of Object.keys(props)) {
|
|
122
|
+
if (key === "toast" || key === "anchor") continue;
|
|
123
|
+
resolved[key] = props[key] ?? fromToast[key] ?? DEFAULTS[key];
|
|
124
|
+
}
|
|
125
|
+
if (typeof resolved.collisionBoundary === "function") resolved.collisionBoundary = resolved.collisionBoundary();
|
|
126
|
+
return resolved;
|
|
127
|
+
});
|
|
128
|
+
const anchor = computed(() => props.anchor ?? props.toast.positionerProps?.anchor ?? void 0);
|
|
129
|
+
provideToastPositionerContext({});
|
|
130
|
+
return (_ctx, _cache) => {
|
|
131
|
+
return openBlock(), createBlock(unref(PopperRoot_default), null, {
|
|
132
|
+
default: withCtx(() => [createVNode(unref(PopperContent_default), mergeProps({
|
|
133
|
+
...resolvedProps.value,
|
|
134
|
+
..._ctx.$attrs
|
|
135
|
+
}, {
|
|
136
|
+
ref: unref(forwardRef),
|
|
137
|
+
reference: anchor.value
|
|
138
|
+
}), {
|
|
139
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
140
|
+
_: 3
|
|
141
|
+
}, 16, ["reference"])]),
|
|
142
|
+
_: 3
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/Toast/ToastPositioner.vue
|
|
150
|
+
var ToastPositioner_default = ToastPositioner_vue_vue_type_script_setup_true_lang_default;
|
|
151
|
+
|
|
152
|
+
//#endregion
|
|
153
|
+
export { ToastPositioner_default, injectToastPositionerContext };
|
|
154
|
+
//# sourceMappingURL=ToastPositioner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastPositioner.js","names":["$attrs"],"sources":["../../src/Toast/ToastPositioner.vue","../../src/Toast/ToastPositioner.vue"],"sourcesContent":[],"mappings":";;;;;;;AAaA,MAAa,CAAC,8BAA8B,8BAA6B,GACrE,cAAsB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW5C,MAAM,QAAQ;EAWd,MAAM,EAAE,YAAY,GAAG,kBAAkB;EAEzC,MAAM,WAAW;GACf,GAAG;GACH,MAAM;GACN,kBAAkB;GAClB,cAAc;EACf;EAED,MAAM,gBAAgB,SAAS,MAAM;GACnC,MAAM,YAAY,MAAM,MAAM,mBAAmB,CAAE;GACnD,MAAM,WAAoC,CAAE;AAC5C,QAAK,MAAM,OAAO,OAAO,KAAK,MAAM,EAAuC;AACzE,QAAI,QAAQ,WAAW,QAAQ,SAC7B;AAEF,aAAS,OAAO,MAAM,QAAQ,UAAU,QAAkC,SAAS;GACrF;AACA,cAAW,SAAS,sBAAsB,WACxC,UAAS,oBAAoB,SAAS,mBAAmB;AAE3D,UAAO;EACR,EAAC;EAEF,MAAM,SAAS,SAAS,MAAM,MAAM,UAAU,MAAM,MAAM,iBAAiB,iBAAoB;AAE/F,gCAA8B,CAAE,EAAC;;uBAI/B,YAQa,MAAA,mBAAA,EAAA,MAAA;qBAPX,MAMgB,CANhB,YAMgB,MAAA,sBAAA,EANhB,WAMgB;KAAA,GALD,cAAA;KAAa,GAAKA,KAAAA;IAAM,GAAA;KACpC,KAAK,MAAA,WAAU;KACf,WAAW,OAAA;;sBAEZ,MAAQ,CAAR,WAAQ,KAAA,QAAA,UAAA"}
|