eco-vue-js 0.21.2 → 0.21.3
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/components/Button/WButtonAction.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/Modal/components/OverlayDropdown.vue.d.ts.map +1 -1
- package/dist/components/Modal/components/OverlayDropdown.vue_vue_type_script_setup_true_lang.js +14 -7
- package/dist/components/Notify/WNotify.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/Notify/WNotifyCenter.vue.d.ts.map +1 -1
- package/dist/components/Notify/WNotifyCenter.vue_vue_type_script_setup_true_lang.js +59 -35
- package/dist/components/Notify/WNotifyCenterButton.vue.d.ts +3 -0
- package/dist/components/Notify/WNotifyCenterButton.vue.d.ts.map +1 -1
- package/dist/components/Notify/WNotifyCenterButton.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/Notify/use/useNotifyCenter.d.ts +6 -0
- package/dist/components/Notify/use/useNotifyCenter.d.ts.map +1 -1
- package/dist/components/Notify/use/useNotifyCenter.js +4 -1
- package/dist/utils/Overlay.d.ts +4 -1
- package/dist/utils/Overlay.d.ts.map +1 -1
- package/docs/components/notify.md +8 -3
- package/docs/llms.txt +1 -1
- package/package.json +1 -1
|
@@ -91,7 +91,7 @@ var WButtonAction_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
91
91
|
key: 2,
|
|
92
92
|
class: normalizeClass(["text-3xs mt-1 text-center", { "self-center": !__props.skeleton }])
|
|
93
93
|
}, [__props.skeleton ? (openBlock(), createBlock(WSkeleton_default, { key: 0 })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(__props.title), 1)], 64))], 2)) : createCommentVNode("", true),
|
|
94
|
-
__props.tooltipText || !__props.titleText && __props.title ? (openBlock(), createBlock(WTooltip_default, {
|
|
94
|
+
(__props.tooltipText || !__props.titleText && __props.title) && !__props.active ? (openBlock(), createBlock(WTooltip_default, {
|
|
95
95
|
key: 3,
|
|
96
96
|
ref: "tooltip",
|
|
97
97
|
text: __props.tooltipText ?? (__props.titleText ? void 0 : __props.title),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Modal/components/OverlayDropdown.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OverlayDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Modal/components/OverlayDropdown.vue"],"names":[],"mappings":"AA2GA;AAAA,OA+MO,KAAK,EAAC,aAAa,EAAE,sBAAsB,EAAC,MAAM,iBAAiB,CAAA;AAU1E,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAOvD,KAAK,WAAW,GAAG,sBAAsB,GAAG;IACxC,MAAM,EAAE,aAAa,CAAA;IACrB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kGAAkG;IAClG,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAC;AAgVJ,QAAA,IAAuB,QAAQ,IAAW,EAAuB,QAAQ,IAAY,CAAE;AACvF,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAShD,QAAA,MAAM,UAAU;;;;;;;;;;6EAId,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
package/dist/components/Modal/components/OverlayDropdown.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -11,7 +11,7 @@ import { Fragment, Teleport, computed, createBlock, createCommentVNode, createEl
|
|
|
11
11
|
//#region src/components/Modal/components/OverlayDropdown.vue?vue&type=script&setup=true&lang.ts
|
|
12
12
|
var _hoisted_1 = {
|
|
13
13
|
key: 0,
|
|
14
|
-
class: "
|
|
14
|
+
class: "px-3 pb-4 pt-3"
|
|
15
15
|
};
|
|
16
16
|
var OverlayDropdown_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
17
17
|
__name: "OverlayDropdown",
|
|
@@ -43,7 +43,8 @@ var OverlayDropdown_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
43
43
|
});
|
|
44
44
|
const dropdownRef = useTemplateRef("dropdown");
|
|
45
45
|
if (props.onTop && !isMobile) watch(() => dropdownRef.value?.isTop ?? false, props.onTop, { immediate: true });
|
|
46
|
-
const
|
|
46
|
+
const isBeside = computed(() => props.align === HorizontalAlign.LEFT_CENTER || props.align === HorizontalAlign.RIGHT_CENTER);
|
|
47
|
+
const hasTip = computed(() => (props.align === void 0 || isBeside.value) && !props.cornered);
|
|
47
48
|
const zIndex = inject(wBaseZIndex, 0) + 2;
|
|
48
49
|
const dismiss = () => {
|
|
49
50
|
if (props.busy || props.closing) return;
|
|
@@ -96,24 +97,30 @@ var OverlayDropdown_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
96
97
|
"horizontal-align": __props.cornered ? unref(HorizontalAlign).RIGHT_INNER : __props.align ?? unref(HorizontalAlign).CENTER,
|
|
97
98
|
"update-align": !__props.cornered,
|
|
98
99
|
freeze: __props.detached,
|
|
99
|
-
"inner-class": hasTip.value ? "w-max tone-surface-raised flex flex-col items-center" : void 0,
|
|
100
|
+
"inner-class": hasTip.value ? isBeside.value ? "w-max tone-surface-raised flex items-center" : "w-max tone-surface-raised flex flex-col items-center" : void 0,
|
|
100
101
|
style: normalizeStyle({ zIndex })
|
|
101
102
|
}, {
|
|
102
103
|
default: withCtx(({ isTop, isLeft, isRight }) => [hasTip.value ? (openBlock(), createBlock(WDropdownTip_default, {
|
|
103
104
|
key: 0,
|
|
104
|
-
top: isTop
|
|
105
|
-
|
|
105
|
+
top: !isBeside.value && isTop,
|
|
106
|
+
left: isBeside.value && isLeft,
|
|
107
|
+
right: isBeside.value && isRight
|
|
108
|
+
}, null, 8, [
|
|
109
|
+
"top",
|
|
110
|
+
"left",
|
|
111
|
+
"right"
|
|
112
|
+
])) : createCommentVNode("", true), createVNode(WClickOutside_default, {
|
|
106
113
|
"no-filter": __props.closeOnClick,
|
|
107
114
|
class: normalizeClass([[
|
|
108
115
|
__props.frameClass ?? "w-dropdown-frame",
|
|
109
|
-
hasTip.value ? "w-tooltip-center-x" : void 0,
|
|
116
|
+
hasTip.value ? isBeside.value ? "w-tooltip-center-y" : "w-tooltip-center-x" : void 0,
|
|
110
117
|
__props.cornered && __props.frameClass === void 0 && {
|
|
111
118
|
"rounded-bl-none": isRight && isTop,
|
|
112
119
|
"rounded-tl-none": isRight && !isTop,
|
|
113
120
|
"rounded-br-none": isLeft && isTop,
|
|
114
121
|
"rounded-tr-none": isLeft && !isTop
|
|
115
122
|
}
|
|
116
|
-
], "
|
|
123
|
+
], "grid grid-rows-[auto_1fr]"]),
|
|
117
124
|
onClick: dismissOutside
|
|
118
125
|
}, {
|
|
119
126
|
default: withCtx(() => [headers.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(headers.value, (render, index) => {
|
|
@@ -37,7 +37,7 @@ var WNotify_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
|
|
|
37
37
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(notifyCenterToastEntries), (item) => {
|
|
38
38
|
return openBlock(), createElementBlock("div", {
|
|
39
39
|
key: unref(getNotifyItemKey)(item),
|
|
40
|
-
class: normalizeClass(["grid transition-[translate,opacity,grid-template-rows] duration-
|
|
40
|
+
class: normalizeClass(["grid transition-[translate,opacity,grid-template-rows] duration-300", isCenter.value ? "justify-center" : "justify-end"])
|
|
41
41
|
}, [createElementVNode("div", _hoisted_1, [createVNode(NotifyCard_default, {
|
|
42
42
|
item,
|
|
43
43
|
"onClick:close": _cache[0] || (_cache[0] = (entry) => (entry.items ?? [entry]).forEach((value) => unref(hideToast)(value.id)))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WNotifyCenter.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Notify/WNotifyCenter.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WNotifyCenter.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Notify/WNotifyCenter.vue"],"names":[],"mappings":"AA6GA;AA8IA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAuB9C,KAAK,WAAW,GAAG;IACjB,wHAAwH;IACxH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB,CAAC;AAwRF,QAAA,MAAM,UAAU,8SAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -4,22 +4,27 @@ import { clearNotifyHistory, getNotifyItemKey, notifyCenterActionEntries, notify
|
|
|
4
4
|
import { useOverlayFrame } from "../../utils/Overlay.js";
|
|
5
5
|
import OverlayHeader_default from "../Modal/components/OverlayHeader.vue.js";
|
|
6
6
|
import NotifyCard_default from "./components/NotifyCard.vue.js";
|
|
7
|
-
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, renderSlot, toDisplayString, unref, withCtx, withModifiers } from "vue";
|
|
7
|
+
import { Fragment, TransitionGroup, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, renderSlot, toDisplayString, unref, withCtx, withModifiers } from "vue";
|
|
8
8
|
//#region src/components/Notify/WNotifyCenter.vue?vue&type=script&setup=true&lang.ts
|
|
9
9
|
var _hoisted_1 = ["aria-label"];
|
|
10
|
-
var _hoisted_2 = { class: "text-accent font-semibold" };
|
|
10
|
+
var _hoisted_2 = { class: "text-accent font-semibold h-8 flex items-center" };
|
|
11
11
|
var _hoisted_3 = {
|
|
12
12
|
key: 0,
|
|
13
|
-
class: "text-description py-
|
|
13
|
+
class: "text-description py-2 text-center self-center"
|
|
14
14
|
};
|
|
15
|
-
var _hoisted_4 = {
|
|
16
|
-
var _hoisted_5 = {
|
|
15
|
+
var _hoisted_4 = {
|
|
17
16
|
key: 0,
|
|
18
|
-
class: "
|
|
17
|
+
class: "tone-negative text-tone py-1 text-xs font-semibold uppercase"
|
|
19
18
|
};
|
|
19
|
+
var _hoisted_5 = { class: "min-h-0" };
|
|
20
20
|
var _hoisted_6 = {
|
|
21
|
-
key:
|
|
22
|
-
class: "
|
|
21
|
+
key: 1,
|
|
22
|
+
class: "text-description pt-2 pb-1 text-xs font-semibold uppercase"
|
|
23
|
+
};
|
|
24
|
+
var _hoisted_7 = { class: "min-h-0" };
|
|
25
|
+
var _hoisted_8 = {
|
|
26
|
+
key: 2,
|
|
27
|
+
class: "border-line-subtle border-t border-solid sticky bottom-0 bg-surface"
|
|
23
28
|
};
|
|
24
29
|
var WNotifyCenter_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
25
30
|
__name: "WNotifyCenter",
|
|
@@ -34,18 +39,15 @@ var WNotifyCenter_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
34
39
|
const frame = useOverlayFrame();
|
|
35
40
|
return (_ctx, _cache) => {
|
|
36
41
|
return openBlock(), createElementBlock("div", {
|
|
37
|
-
class: normalizeClass({
|
|
38
|
-
"bg-surface border-line-subtle grid max-h-[min(40rem,calc(100vh-2rem))] w-[min(28rem,calc(100vw-
|
|
42
|
+
class: normalizeClass([{
|
|
43
|
+
"bg-surface border-line-subtle grid max-h-[min(40rem,calc(100vh-2rem))] w-[min(28rem,calc(100vw-var(--inner-margin,1fr)*2))] grid-rows-[auto_1fr_auto] overflow-hidden rounded-2xl border border-solid": unref(frame) === null,
|
|
39
44
|
"pb-[50vh]": unref(frame) === "sheet"
|
|
40
|
-
}),
|
|
45
|
+
}, "grid grid-rows-[1fr_auto] h-full"]),
|
|
41
46
|
role: "region",
|
|
42
47
|
"aria-label": __props.title ?? "Notifications"
|
|
43
48
|
}, [
|
|
44
49
|
createVNode(OverlayHeader_default, null, {
|
|
45
|
-
default: withCtx(() => [createElementVNode("div", { class: normalizeClass(["flex items-center justify-between gap-4", {
|
|
46
|
-
"border-line-subtle border-b border-solid px-4 py-3": unref(frame) === null,
|
|
47
|
-
"pb-4": unref(frame) === "sheet"
|
|
48
|
-
}]) }, [createElementVNode("div", _hoisted_2, toDisplayString(__props.title ?? "Notifications"), 1), unref(notifyCenterActivityItems).length ? (openBlock(), createBlock(WButton_default, {
|
|
50
|
+
default: withCtx(() => [createElementVNode("div", { class: normalizeClass(["flex items-center justify-between gap-4", unref(frame) === null ? "border-line-subtle border-b border-solid px-4 py-3" : unref(frame) === "sheet" ? "pb-4" : void 0]) }, [createElementVNode("div", _hoisted_2, toDisplayString(__props.title ?? "Notifications"), 1), unref(notifyCenterActivityItems).length ? (openBlock(), createBlock(WButton_default, {
|
|
49
51
|
key: 0,
|
|
50
52
|
"semantic-type": unref(SemanticType).SECONDARY,
|
|
51
53
|
class: "w-button-h-8 text-xs",
|
|
@@ -56,30 +58,52 @@ var WNotifyCenter_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
56
58
|
}, 8, ["semantic-type", "onClick"])) : createCommentVNode("", true)], 2)]),
|
|
57
59
|
_: 1
|
|
58
60
|
}),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
unref(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
!unref(notifyCenterItems).length ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(__props.emptyText ?? "No notifications yet"), 1)) : (openBlock(), createElementBlock("div", {
|
|
62
|
+
key: 1,
|
|
63
|
+
class: normalizeClass(["grid content-start", unref(frame) === null ? "overflow-y-auto overscroll-contain px-4 py-3" : unref(frame) === "dropdown" ? "px-3 pb-2 pt-1" : "px-3 py-1"])
|
|
64
|
+
}, [
|
|
65
|
+
unref(notifyCenterActionItems).length ? (openBlock(), createElementBlock("div", _hoisted_4, toDisplayString(__props.actionText ?? "Action required"), 1)) : createCommentVNode("", true),
|
|
66
|
+
createVNode(TransitionGroup, {
|
|
67
|
+
"enter-from-class": "opacity-0 grid-rows-[0fr]",
|
|
68
|
+
"enter-to-class": "opacity-1 grid-rows-[1fr]",
|
|
69
|
+
"leave-from-class": "opacity-1 grid-rows-[1fr]",
|
|
70
|
+
"leave-to-class": "opacity-0 grid-rows-[0fr]"
|
|
71
|
+
}, {
|
|
72
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(notifyCenterActionEntries), (item) => {
|
|
73
|
+
return openBlock(), createElementBlock("div", {
|
|
65
74
|
key: unref(getNotifyItemKey)(item),
|
|
75
|
+
class: "grid transition-[transform,grid-template-rows] duration-300"
|
|
76
|
+
}, [createElementVNode("div", _hoisted_5, [createVNode(NotifyCard_default, {
|
|
66
77
|
item,
|
|
67
78
|
history: "",
|
|
79
|
+
class: "my-1",
|
|
68
80
|
"onClick:close": unref(removeNotifyEntry)
|
|
69
|
-
}, null, 8, ["item", "onClick:close"]);
|
|
70
|
-
}), 128)),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
(openBlock(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
}, null, 8, ["item", "onClick:close"])])]);
|
|
82
|
+
}), 128))]),
|
|
83
|
+
_: 1
|
|
84
|
+
}),
|
|
85
|
+
unref(notifyCenterActivityItems).length && unref(notifyCenterActionItems).length ? (openBlock(), createElementBlock("div", _hoisted_6, toDisplayString(__props.activityText ?? "Activity"), 1)) : createCommentVNode("", true),
|
|
86
|
+
createVNode(TransitionGroup, {
|
|
87
|
+
"enter-from-class": "opacity-0 grid-rows-[0fr]",
|
|
88
|
+
"enter-to-class": "opacity-1 grid-rows-[1fr]",
|
|
89
|
+
"leave-from-class": "opacity-1 grid-rows-[1fr]",
|
|
90
|
+
"leave-to-class": "opacity-0 grid-rows-[0fr]"
|
|
91
|
+
}, {
|
|
92
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(notifyCenterActivityEntries), (item) => {
|
|
93
|
+
return openBlock(), createElementBlock("div", {
|
|
94
|
+
key: unref(getNotifyItemKey)(item),
|
|
95
|
+
class: "grid transition-[transform,grid-template-rows] duration-300"
|
|
96
|
+
}, [createElementVNode("div", _hoisted_7, [createVNode(NotifyCard_default, {
|
|
97
|
+
item,
|
|
98
|
+
history: "",
|
|
99
|
+
class: "my-1",
|
|
100
|
+
"onClick:close": unref(removeNotifyEntry)
|
|
101
|
+
}, null, 8, ["item", "onClick:close"])])]);
|
|
102
|
+
}), 128))]),
|
|
103
|
+
_: 1
|
|
104
|
+
})
|
|
105
|
+
], 2)),
|
|
106
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_8, [renderSlot(_ctx.$slots, "footer")])) : createCommentVNode("", true)
|
|
83
107
|
], 10, _hoisted_1);
|
|
84
108
|
};
|
|
85
109
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { NotifyCenterProps } from './types';
|
|
2
|
+
import { HorizontalAlign } from '../../utils/HorizontalAlign';
|
|
2
3
|
import { VNode } from 'vue';
|
|
3
4
|
interface Props extends NotifyCenterProps {
|
|
4
5
|
/** Tooltip of the button and heading of the notify center. Defaults to `Notifications`. */
|
|
5
6
|
title?: string;
|
|
6
7
|
/** Icon of the button. Defaults to a bell. */
|
|
7
8
|
icon?: SVGComponent;
|
|
9
|
+
/** Aligns the notify center to the button — such as `HorizontalAlign.LEFT_INNER` to grow left from its right edge, without a tip, or `HorizontalAlign.LEFT_CENTER` beside it with a tip, for a button in a side rail. Defaults to centered under the button with a tip. */
|
|
10
|
+
horizontalAlign?: HorizontalAlign;
|
|
8
11
|
}
|
|
9
12
|
type __VLS_Slots = {
|
|
10
13
|
/** Footer of the notify center. Close the center from it with `closeNotifyCenter`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WNotifyCenterButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Notify/WNotifyCenterButton.vue"],"names":[],"mappings":"AAYA;
|
|
1
|
+
{"version":3,"file":"WNotifyCenterButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Notify/WNotifyCenterButton.vue"],"names":[],"mappings":"AAYA;AA0DA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EAAC,KAAK,KAAK,EAAiB,MAAM,KAAK,CAAA;AAS9C,UAAU,KAAM,SAAQ,iBAAiB;IACvC,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8CAA8C;IAC9C,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,2QAA2Q;IAC3Q,eAAe,CAAC,EAAE,eAAe,CAAA;CAClC;AAKD,KAAK,WAAW,GAAG;IACjB,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,KAAK,EAAE,CAAA;CACvB,CAAC;AA+EF,QAAA,MAAM,UAAU,sRAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -9,6 +9,7 @@ var WNotifyCenterButton_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
|
|
|
9
9
|
props: {
|
|
10
10
|
title: {},
|
|
11
11
|
icon: {},
|
|
12
|
+
horizontalAlign: {},
|
|
12
13
|
clearText: {},
|
|
13
14
|
emptyText: {},
|
|
14
15
|
actionText: {},
|
|
@@ -26,7 +27,8 @@ var WNotifyCenterButton_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
|
|
|
26
27
|
actionText: props.actionText,
|
|
27
28
|
activityText: props.activityText
|
|
28
29
|
}),
|
|
29
|
-
footer: slots.footer ? () => slots.footer?.() : void 0
|
|
30
|
+
footer: slots.footer ? () => slots.footer?.() : void 0,
|
|
31
|
+
horizontalAlign: () => props.horizontalAlign
|
|
30
32
|
});
|
|
31
33
|
return (_ctx, _cache) => {
|
|
32
34
|
return openBlock(), createBlock(WButtonAction_default, {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NotifyCenterProps } from '../types';
|
|
2
|
+
import { HorizontalAlign } from '../../../utils/HorizontalAlign';
|
|
2
3
|
import { VNode } from 'vue';
|
|
3
4
|
import { OverlayAnchor } from '../../../utils/Overlay';
|
|
4
5
|
type NotifyCenterOptions = {
|
|
@@ -6,6 +7,11 @@ type NotifyCenterOptions = {
|
|
|
6
7
|
props?: () => NotifyCenterProps;
|
|
7
8
|
/** Footer of WNotifyCenter, such as a component's slot. */
|
|
8
9
|
footer?: () => VNode[] | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Aligns the center to the anchor, read as it opens — such as `HorizontalAlign.LEFT_INNER` to grow left from its right edge, without a tip.
|
|
12
|
+
* `LEFT_CENTER` and `RIGHT_CENTER` open it beside the anchor with a tip, kept on screen — for a button in a side rail. Defaults to centered under the anchor with a tip.
|
|
13
|
+
*/
|
|
14
|
+
horizontalAlign?: () => HorizontalAlign | undefined;
|
|
9
15
|
};
|
|
10
16
|
/**
|
|
11
17
|
* Opens WNotifyCenter as a dropdown at an anchor — a bottom sheet on phones — for a custom trigger. Called in setup; needs WModal on the page.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNotifyCenter.d.ts","sourceRoot":"","sources":["../../../../../src/components/Notify/use/useNotifyCenter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"useNotifyCenter.d.ts","sourceRoot":"","sources":["../../../../../src/components/Notify/use/useNotifyCenter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAA;AAC/C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EAAC,KAAK,KAAK,EAAuB,MAAM,KAAK,CAAA;AAEpD,OAAO,EAAC,KAAK,aAAa,EAAa,MAAM,iBAAiB,CAAA;AAK9D,KAAK,mBAAmB,GAAG;IACzB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,iBAAiB,CAAA;IAC/B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,KAAK,EAAE,GAAG,SAAS,CAAA;IAClC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,eAAe,GAAG,SAAS,CAAA;CACpD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,UAAS,mBAAwB;;mBAQzC,aAAa,KAAG,IAAI;;qBAyBlB,aAAa,KAAG,IAAI;CAW7C,CAAA"}
|
|
@@ -16,7 +16,10 @@ var useNotifyCenter = (options = {}) => {
|
|
|
16
16
|
present: "dropdown",
|
|
17
17
|
anchor,
|
|
18
18
|
content,
|
|
19
|
-
dropdown: {
|
|
19
|
+
dropdown: {
|
|
20
|
+
frameClass: "w-dropdown-frame min-h-80 max-h-[min(40rem,calc(100vh-1.5rem))] w-[min(28rem,calc(100vw-1rem))]",
|
|
21
|
+
align: options.horizontalAlign?.()
|
|
22
|
+
},
|
|
20
23
|
onClose: () => {
|
|
21
24
|
if (closeCenter !== value) return;
|
|
22
25
|
closeCenter = null;
|
package/dist/utils/Overlay.d.ts
CHANGED
|
@@ -20,7 +20,10 @@ export type OverlayDropdownOptions = {
|
|
|
20
20
|
* Otherwise the dropdown is centered on the anchor with a tip pointing at it, and shifts aside near the edge of the screen while the tip stays.
|
|
21
21
|
*/
|
|
22
22
|
cornered?: boolean;
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Aligns the dropdown to the anchor without a tip, such as a field's menu with `HorizontalAlign.FILL`.
|
|
25
|
+
* `LEFT_CENTER` and `RIGHT_CENTER` open it beside the anchor with a tip pointing at it, such as from a button in a side rail; near the top or bottom of the screen the box shifts while the tip stays.
|
|
26
|
+
*/
|
|
24
27
|
align?: HorizontalAlign;
|
|
25
28
|
/** Classes of the dropdown's box, replacing the default frame. */
|
|
26
29
|
frameClass?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../../src/utils/Overlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AAC3C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EAAC,KAAK,SAAS,EAAoD,MAAM,KAAK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IAAmC,CAAA;AAErF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,OAAO,EAAE,SAAS,MAAM,EAAE,SAAS,MAAM,KAAG,aAatF,CAAA"}
|
|
@@ -91,7 +91,7 @@ A pending notification can't be closed in the notify center; closing its toast o
|
|
|
91
91
|
|
|
92
92
|
## Notify center
|
|
93
93
|
|
|
94
|
-
Every notification is also kept in a history of the last 50, shown by `WNotifyCenter`. `WNotifyCenterButton` is a bell for the [actions bar](../guide/app-shell.md) that opens it as a dropdown — a bottom sheet on phones. It counts the notifications that need action and runs a shimmer while any is pending. Toasts are hidden while the center is open.
|
|
94
|
+
Every notification is also kept in a history of the last 50, shown by `WNotifyCenter`. `WNotifyCenterButton` is a bell for the [actions bar](../guide/app-shell.md) that opens it as a dropdown — a bottom sheet on phones. It counts the notifications that need action and runs a shimmer while any is pending. Toasts are hidden while the center is open. The center opens under the button with a tip; `horizontal-align` places it otherwise. `HorizontalAlign.LEFT_INNER` suits a bell at the right end of the header — it grows left from the button's right edge, without a tip. `HorizontalAlign.LEFT_CENTER` suits a bell in a side rail — it opens beside the button with the tip pointing at it, and near the top or bottom of the screen only the box shifts, keeping a margin from the edge.
|
|
95
95
|
|
|
96
96
|
```vue
|
|
97
97
|
<template>
|
|
@@ -120,12 +120,16 @@ import WNotifyCenterButton from 'eco-vue-js/dist/components/Notify/WNotifyCenter
|
|
|
120
120
|
</script>
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
-
For a trigger of your own, such as the bell in this site's header, open it with `useNotifyCenter`, called in setup. It returns `isOpen`, `open(anchor)`, `close` and `toggle(anchor)`, and takes the center's props and
|
|
123
|
+
For a trigger of your own, such as the bell in this site's header, open it with `useNotifyCenter`, called in setup. It returns `isOpen`, `open(anchor)`, `close` and `toggle(anchor)`, and takes the center's props, footer and `horizontalAlign`:
|
|
124
124
|
|
|
125
125
|
```ts
|
|
126
|
+
import {HorizontalAlign} from 'eco-vue-js/dist/utils/HorizontalAlign'
|
|
126
127
|
import {useNotifyCenter} from 'eco-vue-js/dist/utils/NotifyCenter'
|
|
127
128
|
|
|
128
|
-
const {isOpen, toggle} = useNotifyCenter({
|
|
129
|
+
const {isOpen, toggle} = useNotifyCenter({
|
|
130
|
+
props: () => ({title: 'Alerts'}),
|
|
131
|
+
horizontalAlign: () => HorizontalAlign.LEFT_INNER,
|
|
132
|
+
})
|
|
129
133
|
```
|
|
130
134
|
|
|
131
135
|
`WNotifyCenter` can also be placed on a page as it is. Notifications on the `ACTION` channel need the user: they are pinned on top under their own heading, their toast stays until closed, and clearing the history keeps them — as it keeps pending ones.
|
|
@@ -269,6 +273,7 @@ import WNotifyCenterButton from 'eco-vue-js/dist/components/Notify/WNotifyCenter
|
|
|
269
273
|
| --- | --- | --- | --- |
|
|
270
274
|
| `title` | `string` | — | Tooltip of the button and heading of the notify center. Defaults to `Notifications`. |
|
|
271
275
|
| `icon` | `SVGComponent` | — | Icon of the button. Defaults to a bell. |
|
|
276
|
+
| `horizontalAlign` | `HorizontalAlign` | — | Aligns the notify center to the button — such as `HorizontalAlign.LEFT_INNER` to grow left from its right edge, without a tip, or `HorizontalAlign.LEFT_CENTER` beside it with a tip, for a button in a side rail. Defaults to centered under the button with a tip. |
|
|
272
277
|
| `clearText` | `string` | — | Text of the button that clears the history. Defaults to `Clear`. |
|
|
273
278
|
| `emptyText` | `string` | — | Shown when there are no notifications. Defaults to `No notifications yet`. |
|
|
274
279
|
| `actionText` | `string` | — | Heading of the notifications that need action (`NotifyChannel.ACTION`). Defaults to `Action required`. |
|
package/docs/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# eco-vue-js
|
|
2
2
|
|
|
3
|
-
> Vue 3 UI kit with Tailwind v4 — components, utilities, icons and recipes. These are the docs of version 0.21.
|
|
3
|
+
> Vue 3 UI kit with Tailwind v4 — components, utilities, icons and recipes. These are the docs of version 0.21.3, the one installed next to them. Start with Getting started and Conventions; each component page lists its props, events and slots with examples.
|
|
4
4
|
|
|
5
5
|
Release notes, for what changed between versions: https://github.com/rsmple/eco-vue-js/releases. The docs site, with live demos: https://rsmple.github.io/eco-vue-js/
|
|
6
6
|
|