@onereach/ui-components 4.3.4-beta.2631.0 → 4.3.5-beta.2633.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/bundled/v2/components/OrToastContainerV3/OrToastContainer.js +16 -8
- package/dist/bundled/v2/components/OrToastContainerV3/OrToastContainer.vue.d.ts +2 -0
- package/dist/bundled/v3/{OrToastContainer.vue_vue_type_script_lang-16a49a54.js → OrToastContainer.vue_vue_type_script_lang-16a4b52c.js} +6 -1
- package/dist/bundled/v3/components/OrToastContainerV3/OrToastContainer.js +8 -8
- package/dist/bundled/v3/components/OrToastContainerV3/OrToastContainer.vue.d.ts +2 -0
- package/dist/bundled/v3/components/OrToastContainerV3/index.js +1 -1
- package/dist/bundled/v3/components/OrToastV3/index.js +1 -1
- package/dist/bundled/v3/components/index.js +1 -1
- package/dist/bundled/v3/index.js +1 -1
- package/dist/esm/v2/components/index.js +1 -1
- package/dist/esm/v2/components/or-toast-v3/index.js +2 -2
- package/dist/esm/v2/components/or-toast-v3/or-toast-container-v3/OrToastContainer.vue.d.ts +2 -0
- package/dist/esm/v2/components/or-toast-v3/or-toast-container-v3/index.js +2 -2
- package/dist/esm/v2/index.js +1 -1
- package/dist/esm/v2/{types-b674518e.js → types-5646f386.js} +14 -5
- package/dist/esm/v3/components/index.js +1 -1
- package/dist/esm/v3/components/or-toast-v3/index.js +2 -2
- package/dist/esm/v3/components/or-toast-v3/or-toast-container-v3/OrToastContainer.vue.d.ts +2 -0
- package/dist/esm/v3/components/or-toast-v3/or-toast-container-v3/index.js +2 -2
- package/dist/esm/v3/index.js +1 -1
- package/dist/esm/v3/{types-9034029d.js → types-0a697fe0.js} +10 -5
- package/package.json +1 -1
- package/src/components/or-toast-v3/OrToast.stories3.ts +2 -2
- package/src/components/or-toast-v3/or-toast-container-v3/OrToastContainer.stories3.ts +56 -13
- package/src/components/or-toast-v3/or-toast-container-v3/OrToastContainer.vue +15 -10
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useToggle } from '@vueuse/core';
|
|
2
|
-
import { defineComponent, computed, onBeforeMount, onBeforeUnmount, nextTick } from 'vue-demi';
|
|
2
|
+
import { defineComponent, ref, computed, onBeforeMount, onBeforeUnmount, nextTick } from 'vue-demi';
|
|
3
3
|
import useQueue from '../OrToastV3/composable/useQueue.js';
|
|
4
4
|
import useToastEventBus from '../OrToastV3/composable/useToastEventBus.js';
|
|
5
5
|
import __vue_component__$2 from '../OrToastV3/OrToast.js';
|
|
6
6
|
import { P as PositionsX, a as PositionsY, T as TransitionType } from '../../props-7be029c7.js';
|
|
7
7
|
import { ToastContainer, ToastContainerPositions } from '../OrToastV3/styles.js';
|
|
8
8
|
import __vue_component__$1 from '../OrTeleportV3/OrTeleport.js';
|
|
9
|
+
import { useElevation } from '../../hooks/useElevation.js';
|
|
9
10
|
import { s as styleInject } from '../../style-inject.es-4c6f2515.js';
|
|
10
11
|
import { n as normalizeComponent } from '../../normalize-component-6e8e3d80.js';
|
|
11
12
|
import '../OrIconButtonV3/OrIconButton.js';
|
|
@@ -24,13 +25,12 @@ import '../OrBottomSheetV3/OrBottomSheet.js';
|
|
|
24
25
|
import '../OrBottomSheetV3/styles.js';
|
|
25
26
|
import '../OrOverlayV3/OrOverlay.js';
|
|
26
27
|
import '../OrOverlayV3/styles.js';
|
|
27
|
-
import '../../hooks/useElevation.js';
|
|
28
|
-
import '../../utils/isVisible.js';
|
|
29
28
|
import '../../hooks/useResponsive/useResponsive.js';
|
|
30
29
|
import '../OrLoaderV3/OrLoader.js';
|
|
31
30
|
import '../OrLoaderV3/props.js';
|
|
32
31
|
import '../OrLoaderV3/styles.js';
|
|
33
32
|
import 'portal-vue';
|
|
33
|
+
import '../../utils/isVisible.js';
|
|
34
34
|
|
|
35
35
|
var script = defineComponent({
|
|
36
36
|
name: 'OrToastContainer',
|
|
@@ -56,6 +56,8 @@ var script = defineComponent({
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
setup(props) {
|
|
59
|
+
// Refs
|
|
60
|
+
const root = ref();
|
|
59
61
|
const {
|
|
60
62
|
on,
|
|
61
63
|
off
|
|
@@ -145,6 +147,7 @@ var script = defineComponent({
|
|
|
145
147
|
off('toastUpdate', toastUpdate);
|
|
146
148
|
off('toastCloseAll', clearAll);
|
|
147
149
|
});
|
|
150
|
+
useElevation(root, isActive);
|
|
148
151
|
return {
|
|
149
152
|
on,
|
|
150
153
|
off,
|
|
@@ -157,6 +160,7 @@ var script = defineComponent({
|
|
|
157
160
|
clearAll,
|
|
158
161
|
getItem,
|
|
159
162
|
queue,
|
|
163
|
+
root,
|
|
160
164
|
createToast,
|
|
161
165
|
toastUpdate,
|
|
162
166
|
toastRemove,
|
|
@@ -168,7 +172,7 @@ var script = defineComponent({
|
|
|
168
172
|
}
|
|
169
173
|
});
|
|
170
174
|
|
|
171
|
-
var css_248z = ".or-toast
|
|
175
|
+
var css_248z = ".or-toast--transition-slide-enter-active[data-v-9c5633de],.or-toast--transition-slide-leave-active[data-v-9c5633de]{transition:transform .4s ease}.or-toast--transition-slide-enter-from.or-toast--position-right[data-v-9c5633de],.or-toast--transition-slide-leave-to.or-toast--position-right[data-v-9c5633de]{transform:translateX(999px)}.or-toast--transition-slide-enter-from.or-toast--position-left[data-v-9c5633de],.or-toast--transition-slide-leave-to.or-toast--position-left[data-v-9c5633de]{transform:translateX(-999px)}.or-toast--transition-fade-enter-active[data-v-9c5633de],.or-toast--transition-fade-leave-active[data-v-9c5633de]{transition:opacity .4s ease}.or-toast--transition-fade-enter-from[data-v-9c5633de],.or-toast--transition-fade-leave-to[data-v-9c5633de]{opacity:0}";
|
|
172
176
|
styleInject(css_248z);
|
|
173
177
|
|
|
174
178
|
/* script */
|
|
@@ -178,10 +182,14 @@ var __vue_render__ = function () {
|
|
|
178
182
|
var _vm = this;
|
|
179
183
|
var _h = _vm.$createElement;
|
|
180
184
|
var _c = _vm._self._c || _h;
|
|
181
|
-
return
|
|
185
|
+
return _c('OrTeleport', {
|
|
186
|
+
attrs: {
|
|
187
|
+
"disabled": _vm.isActive
|
|
188
|
+
}
|
|
189
|
+
}, [_c('div', {
|
|
190
|
+
ref: "root",
|
|
182
191
|
class: _vm.classes
|
|
183
192
|
}, [_c('TransitionGroup', {
|
|
184
|
-
class: ['contents'],
|
|
185
193
|
attrs: {
|
|
186
194
|
"name": _vm.transitionName
|
|
187
195
|
},
|
|
@@ -206,14 +214,14 @@ var __vue_render__ = function () {
|
|
|
206
214
|
}
|
|
207
215
|
}
|
|
208
216
|
}, 'OrToast', toastConfiguration.toastProps, false));
|
|
209
|
-
}), 1)], 1)])
|
|
217
|
+
}), 1)], 1)]);
|
|
210
218
|
};
|
|
211
219
|
var __vue_staticRenderFns__ = [];
|
|
212
220
|
|
|
213
221
|
/* style */
|
|
214
222
|
const __vue_inject_styles__ = undefined;
|
|
215
223
|
/* scoped */
|
|
216
|
-
const __vue_scope_id__ = "data-v-
|
|
224
|
+
const __vue_scope_id__ = "data-v-9c5633de";
|
|
217
225
|
/* module identifier */
|
|
218
226
|
const __vue_module_identifier__ = undefined;
|
|
219
227
|
/* functional template */
|
|
@@ -15,6 +15,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
15
15
|
clearAll: () => void;
|
|
16
16
|
getItem: (condition: (i: ToastConfiguration, index: number, queue: import("@vue/composition-api").Ref<ToastConfiguration>[]) => boolean) => import("@vue/composition-api").Ref<ToastConfiguration>;
|
|
17
17
|
queue: import("@vue/composition-api").ComputedRef<ToastConfiguration[]>;
|
|
18
|
+
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
18
19
|
createToast: (toastConfiguration: ToastConfiguration) => void;
|
|
19
20
|
toastUpdate: (toast: ToastConfiguration) => void;
|
|
20
21
|
toastRemove: (toast: ToastConfiguration) => void;
|
|
@@ -66,6 +67,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
66
67
|
clearAll: () => void;
|
|
67
68
|
getItem: (condition: (i: ToastConfiguration, index: number, queue: import("@vue/composition-api").Ref<ToastConfiguration>[]) => boolean) => import("@vue/composition-api").Ref<ToastConfiguration>;
|
|
68
69
|
queue: import("@vue/composition-api").ComputedRef<ToastConfiguration[]>;
|
|
70
|
+
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
69
71
|
createToast: (toastConfiguration: ToastConfiguration) => void;
|
|
70
72
|
toastUpdate: (toast: ToastConfiguration) => void;
|
|
71
73
|
toastRemove: (toast: ToastConfiguration) => void;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useToggle } from '@vueuse/core';
|
|
2
|
-
import { defineComponent, computed, onBeforeMount, onBeforeUnmount, nextTick } from 'vue-demi';
|
|
2
|
+
import { defineComponent, ref, computed, onBeforeMount, onBeforeUnmount, nextTick } from 'vue-demi';
|
|
3
3
|
import useQueue from './components/OrToastV3/composable/useQueue.js';
|
|
4
4
|
import useToastEventBus from './components/OrToastV3/composable/useToastEventBus.js';
|
|
5
5
|
import script$2 from './components/OrToastV3/OrToast.js';
|
|
6
6
|
import { P as PositionsX, a as PositionsY, T as TransitionType } from './props-7be029c7.js';
|
|
7
7
|
import { ToastContainer, ToastContainerPositions } from './components/OrToastV3/styles.js';
|
|
8
8
|
import './components/OrTeleportV3/OrTeleport.js';
|
|
9
|
+
import { useElevation } from './hooks/useElevation.js';
|
|
9
10
|
import { s as script$1 } from './OrTeleport.vue3.vue_vue_type_script_lang-a6ce162e.js';
|
|
10
11
|
|
|
11
12
|
var script = defineComponent({
|
|
@@ -32,6 +33,8 @@ var script = defineComponent({
|
|
|
32
33
|
}
|
|
33
34
|
},
|
|
34
35
|
setup(props) {
|
|
36
|
+
// Refs
|
|
37
|
+
const root = ref();
|
|
35
38
|
const {
|
|
36
39
|
on,
|
|
37
40
|
off
|
|
@@ -121,6 +124,7 @@ var script = defineComponent({
|
|
|
121
124
|
off('toastUpdate', toastUpdate);
|
|
122
125
|
off('toastCloseAll', clearAll);
|
|
123
126
|
});
|
|
127
|
+
useElevation(root, isActive);
|
|
124
128
|
return {
|
|
125
129
|
on,
|
|
126
130
|
off,
|
|
@@ -133,6 +137,7 @@ var script = defineComponent({
|
|
|
133
137
|
clearAll,
|
|
134
138
|
getItem,
|
|
135
139
|
queue,
|
|
140
|
+
root,
|
|
136
141
|
createToast,
|
|
137
142
|
toastUpdate,
|
|
138
143
|
toastRemove,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as script } from '../../OrToastContainer.vue_vue_type_script_lang-
|
|
2
|
-
export { s as default } from '../../OrToastContainer.vue_vue_type_script_lang-
|
|
3
|
-
import { resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, createVNode, TransitionGroup, createElementBlock, Fragment, renderList, mergeProps
|
|
1
|
+
import { s as script } from '../../OrToastContainer.vue_vue_type_script_lang-16a4b52c.js';
|
|
2
|
+
export { s as default } from '../../OrToastContainer.vue_vue_type_script_lang-16a4b52c.js';
|
|
3
|
+
import { resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, createVNode, TransitionGroup, createElementBlock, Fragment, renderList, mergeProps } from 'vue';
|
|
4
4
|
import { s as styleInject } from '../../style-inject.es-4c6f2515.js';
|
|
5
5
|
import '@vueuse/core';
|
|
6
6
|
import 'vue-demi';
|
|
@@ -44,14 +44,14 @@ import '../OrLoaderV3/styles.js';
|
|
|
44
44
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
45
45
|
const _component_OrToast = resolveComponent("OrToast");
|
|
46
46
|
const _component_OrTeleport = resolveComponent("OrTeleport");
|
|
47
|
-
return
|
|
48
|
-
|
|
47
|
+
return openBlock(), createBlock(_component_OrTeleport, {
|
|
48
|
+
disabled: _ctx.isActive
|
|
49
49
|
}, {
|
|
50
50
|
default: withCtx(() => [createElementVNode("div", {
|
|
51
|
+
ref: "root",
|
|
51
52
|
class: normalizeClass(_ctx.classes)
|
|
52
53
|
}, [createVNode(TransitionGroup, {
|
|
53
54
|
name: _ctx.transitionName,
|
|
54
|
-
class: normalizeClass(['contents']),
|
|
55
55
|
onAfterLeave: _ctx.onToastHidden
|
|
56
56
|
}, {
|
|
57
57
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.queue, toastConfiguration => {
|
|
@@ -68,10 +68,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
68
68
|
}, 8 /* PROPS */, ["name", "onAfterLeave"])], 2 /* CLASS */)]),
|
|
69
69
|
|
|
70
70
|
_: 1 /* STABLE */
|
|
71
|
-
}
|
|
71
|
+
}, 8 /* PROPS */, ["disabled"]);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
var css_248z = ".or-toast
|
|
74
|
+
var css_248z = ".or-toast--transition-slide-enter-active[data-v-f1d54776],\n.or-toast--transition-slide-leave-active[data-v-f1d54776] {\n transition: transform 0.4s ease;\n}\n.or-toast--transition-slide-enter-from.or-toast--position-right[data-v-f1d54776],\n.or-toast--transition-slide-leave-to.or-toast--position-right[data-v-f1d54776] {\n transform: translateX(999px);\n}\n.or-toast--transition-slide-enter-from.or-toast--position-left[data-v-f1d54776],\n.or-toast--transition-slide-leave-to.or-toast--position-left[data-v-f1d54776] {\n transform: translateX(-999px);\n}\n.or-toast--transition-fade-enter-active[data-v-f1d54776],\n.or-toast--transition-fade-leave-active[data-v-f1d54776] {\n transition: opacity 0.4s ease;\n}\n.or-toast--transition-fade-enter-from[data-v-f1d54776],\n.or-toast--transition-fade-leave-to[data-v-f1d54776] {\n opacity: 0;\n}";
|
|
75
75
|
styleInject(css_248z);
|
|
76
76
|
|
|
77
77
|
script.render = render;
|
|
@@ -15,6 +15,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
15
15
|
clearAll: () => void;
|
|
16
16
|
getItem: (condition: (i: ToastConfiguration, index: number, queue: import("@vue/composition-api").Ref<ToastConfiguration>[]) => boolean) => import("@vue/composition-api").Ref<ToastConfiguration>;
|
|
17
17
|
queue: import("@vue/composition-api").ComputedRef<ToastConfiguration[]>;
|
|
18
|
+
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
18
19
|
createToast: (toastConfiguration: ToastConfiguration) => void;
|
|
19
20
|
toastUpdate: (toast: ToastConfiguration) => void;
|
|
20
21
|
toastRemove: (toast: ToastConfiguration) => void;
|
|
@@ -66,6 +67,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
66
67
|
clearAll: () => void;
|
|
67
68
|
getItem: (condition: (i: ToastConfiguration, index: number, queue: import("@vue/composition-api").Ref<ToastConfiguration>[]) => boolean) => import("@vue/composition-api").Ref<ToastConfiguration>;
|
|
68
69
|
queue: import("@vue/composition-api").ComputedRef<ToastConfiguration[]>;
|
|
70
|
+
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
69
71
|
createToast: (toastConfiguration: ToastConfiguration) => void;
|
|
70
72
|
toastUpdate: (toast: ToastConfiguration) => void;
|
|
71
73
|
toastRemove: (toast: ToastConfiguration) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { t as TypesV3 } from '../../types-668300dd.js';
|
|
2
2
|
export { p as PropsV3 } from '../../props-7be029c7.js';
|
|
3
|
-
export { s as OrToastContainerV3 } from '../../OrToastContainer.vue_vue_type_script_lang-
|
|
3
|
+
export { s as OrToastContainerV3 } from '../../OrToastContainer.vue_vue_type_script_lang-16a4b52c.js';
|
|
4
4
|
export { default as useToastV3 } from '../OrToastV3/composable/useToast.js';
|
|
5
5
|
export { default as useQueueV3 } from '../OrToastV3/composable/useQueue.js';
|
|
6
6
|
import '@vueuse/core';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { t as TypesV3 } from '../../types-668300dd.js';
|
|
2
2
|
export { p as PropsV3 } from '../../props-7be029c7.js';
|
|
3
3
|
export { default as OrToastV3 } from './OrToast.js';
|
|
4
|
-
export { s as OrToastContainerV3 } from '../../OrToastContainer.vue_vue_type_script_lang-
|
|
4
|
+
export { s as OrToastContainerV3 } from '../../OrToastContainer.vue_vue_type_script_lang-16a4b52c.js';
|
|
5
5
|
export { default as useToastV3 } from './composable/useToast.js';
|
|
6
6
|
export { default as useQueueV3 } from './composable/useQueue.js';
|
|
7
7
|
import 'vue-demi';
|
|
@@ -146,7 +146,7 @@ export { default as useToast } from './OrToast/composable/useToast.js';
|
|
|
146
146
|
export { default as useQueue } from './OrToast/composable/useQueue.js';
|
|
147
147
|
export { PositionsX, PositionsY, ToastType, TransitionType } from './OrToast/constants.js';
|
|
148
148
|
export { default as OrToastV3 } from './OrToastV3/OrToast.js';
|
|
149
|
-
export { s as OrToastContainerV3 } from '../OrToastContainer.vue_vue_type_script_lang-
|
|
149
|
+
export { s as OrToastContainerV3 } from '../OrToastContainer.vue_vue_type_script_lang-16a4b52c.js';
|
|
150
150
|
export { t as TypesV3 } from '../types-668300dd.js';
|
|
151
151
|
export { p as PropsV3 } from '../props-7be029c7.js';
|
|
152
152
|
export { default as useToastV3 } from './OrToastV3/composable/useToast.js';
|
package/dist/bundled/v3/index.js
CHANGED
|
@@ -123,7 +123,7 @@ import './components/OrToastContainer/OrToastContainer.js';
|
|
|
123
123
|
export { s as OrToastContainer } from './OrToastContainer.vue_vue_type_script_lang-70cc38be.js';
|
|
124
124
|
export { default as useToast } from './components/OrToast/composable/useToast.js';
|
|
125
125
|
import './components/OrToastContainerV3/OrToastContainer.js';
|
|
126
|
-
export { s as OrToastContainerV3 } from './OrToastContainer.vue_vue_type_script_lang-
|
|
126
|
+
export { s as OrToastContainerV3 } from './OrToastContainer.vue_vue_type_script_lang-16a4b52c.js';
|
|
127
127
|
export { default as useToastV3 } from './components/OrToastV3/composable/useToast.js';
|
|
128
128
|
export { OR_AVATAR_SIZE } from './components/OrAvatar/constants.js';
|
|
129
129
|
export { AvatarColor, AvatarSize } from './components/OrAvatarV3/props.js';
|
|
@@ -105,7 +105,7 @@ export { _ as OrTextbox, T as TextboxTypes } from '../OrTextbox-0373bd6a.js';
|
|
|
105
105
|
export { _ as OrTimePickerV3 } from '../OrTimePicker-038ceb81.js';
|
|
106
106
|
export { _ as OrToast, a as OrToastContainer } from '../OrToastContainer-1625b803.js';
|
|
107
107
|
export { P as PositionsX, b as PositionsY, c as ToastType, T as TransitionType, a as useQueue, u as useToast } from '../useToast-4fbe0e5a.js';
|
|
108
|
-
export { a as OrToastContainerV3, _ as OrToastV3, t as TypesV3 } from '../types-
|
|
108
|
+
export { a as OrToastContainerV3, _ as OrToastV3, t as TypesV3 } from '../types-5646f386.js';
|
|
109
109
|
export { p as PropsV3, a as useQueueV3, u as useToastV3 } from '../useToast-0665462d.js';
|
|
110
110
|
export { _ as OrTooltip } from '../OrTooltip-97a42707.js';
|
|
111
111
|
export { _ as OrTooltipContent } from '../OrTooltipContent-d85e1071.js';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { a as OrToastContainerV3, _ as OrToastV3, t as TypesV3 } from '../../types-
|
|
1
|
+
export { a as OrToastContainerV3, _ as OrToastV3, t as TypesV3 } from '../../types-5646f386.js';
|
|
2
2
|
export { p as PropsV3, a as useQueueV3, u as useToastV3 } from '../../useToast-0665462d.js';
|
|
3
3
|
import '@vueuse/core';
|
|
4
4
|
import 'vue-demi';
|
|
5
|
+
import '../../useElevation-df91fa50.js';
|
|
5
6
|
import '../../OrTeleport.vue2-fb92f29f.js';
|
|
6
7
|
import 'portal-vue';
|
|
7
8
|
import '../../normalize-component-6e8e3d80.js';
|
|
@@ -10,7 +11,6 @@ import '../../OrIcon-d35a84d8.js';
|
|
|
10
11
|
import '../../OrTooltip-b7290ed1.js';
|
|
11
12
|
import '../../OrPopover-c902e2fd.js';
|
|
12
13
|
import '@floating-ui/dom';
|
|
13
|
-
import '../../useElevation-df91fa50.js';
|
|
14
14
|
import '../../useResponsive-a02e95b7.js';
|
|
15
15
|
import '../../OrBottomSheet-0938dbde.js';
|
|
16
16
|
import '../../OrOverlay-b1609eef.js';
|
|
@@ -15,6 +15,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
15
15
|
clearAll: () => void;
|
|
16
16
|
getItem: (condition: (i: ToastConfiguration, index: number, queue: import("@vue/composition-api").Ref<ToastConfiguration>[]) => boolean) => import("@vue/composition-api").Ref<ToastConfiguration>;
|
|
17
17
|
queue: import("@vue/composition-api").ComputedRef<ToastConfiguration[]>;
|
|
18
|
+
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
18
19
|
createToast: (toastConfiguration: ToastConfiguration) => void;
|
|
19
20
|
toastUpdate: (toast: ToastConfiguration) => void;
|
|
20
21
|
toastRemove: (toast: ToastConfiguration) => void;
|
|
@@ -66,6 +67,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
66
67
|
clearAll: () => void;
|
|
67
68
|
getItem: (condition: (i: ToastConfiguration, index: number, queue: import("@vue/composition-api").Ref<ToastConfiguration>[]) => boolean) => import("@vue/composition-api").Ref<ToastConfiguration>;
|
|
68
69
|
queue: import("@vue/composition-api").ComputedRef<ToastConfiguration[]>;
|
|
70
|
+
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
69
71
|
createToast: (toastConfiguration: ToastConfiguration) => void;
|
|
70
72
|
toastUpdate: (toast: ToastConfiguration) => void;
|
|
71
73
|
toastRemove: (toast: ToastConfiguration) => void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { a as OrToastContainerV3, t as TypesV3 } from '../../../types-
|
|
1
|
+
export { a as OrToastContainerV3, t as TypesV3 } from '../../../types-5646f386.js';
|
|
2
2
|
export { p as PropsV3, a as useQueueV3, u as useToastV3 } from '../../../useToast-0665462d.js';
|
|
3
3
|
import '@vueuse/core';
|
|
4
4
|
import 'vue-demi';
|
|
5
|
+
import '../../../useElevation-df91fa50.js';
|
|
5
6
|
import '../../../OrTeleport.vue2-fb92f29f.js';
|
|
6
7
|
import 'portal-vue';
|
|
7
8
|
import '../../../normalize-component-6e8e3d80.js';
|
|
@@ -10,7 +11,6 @@ import '../../../OrIcon-d35a84d8.js';
|
|
|
10
11
|
import '../../../OrTooltip-b7290ed1.js';
|
|
11
12
|
import '../../../OrPopover-c902e2fd.js';
|
|
12
13
|
import '@floating-ui/dom';
|
|
13
|
-
import '../../../useElevation-df91fa50.js';
|
|
14
14
|
import '../../../useResponsive-a02e95b7.js';
|
|
15
15
|
import '../../../OrBottomSheet-0938dbde.js';
|
|
16
16
|
import '../../../OrOverlay-b1609eef.js';
|
package/dist/esm/v2/index.js
CHANGED
|
@@ -105,7 +105,7 @@ export { _ as OrTextbox, T as TextboxTypes } from './OrTextbox-0373bd6a.js';
|
|
|
105
105
|
export { _ as OrTimePickerV3 } from './OrTimePicker-038ceb81.js';
|
|
106
106
|
export { _ as OrToast, a as OrToastContainer } from './OrToastContainer-1625b803.js';
|
|
107
107
|
export { P as PositionsX, b as PositionsY, c as ToastType, T as TransitionType, a as useQueue, u as useToast } from './useToast-4fbe0e5a.js';
|
|
108
|
-
export { a as OrToastContainerV3, _ as OrToastV3, t as TypesV3 } from './types-
|
|
108
|
+
export { a as OrToastContainerV3, _ as OrToastV3, t as TypesV3 } from './types-5646f386.js';
|
|
109
109
|
export { p as PropsV3, a as useQueueV3, u as useToastV3 } from './useToast-0665462d.js';
|
|
110
110
|
export { _ as OrTooltip } from './OrTooltip-97a42707.js';
|
|
111
111
|
export { _ as OrTooltipContent } from './OrTooltipContent-d85e1071.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useToggle } from '@vueuse/core';
|
|
2
2
|
import { defineComponent, ref, computed, onBeforeMount, onBeforeUnmount, nextTick } from 'vue-demi';
|
|
3
|
+
import { u as useElevation } from './useElevation-df91fa50.js';
|
|
3
4
|
import { _ as __vue_component__$4 } from './OrTeleport.vue2-fb92f29f.js';
|
|
4
5
|
import { T as ToastType, P as PositionsX, b as PositionsY, c as TransitionType, d as useToastEventBus, a as useQueue } from './useToast-0665462d.js';
|
|
5
6
|
import { _ as __vue_component__$2 } from './OrIconButton-0ec2cda6.js';
|
|
@@ -252,6 +253,8 @@ var script = defineComponent({
|
|
|
252
253
|
}
|
|
253
254
|
},
|
|
254
255
|
setup(props) {
|
|
256
|
+
// Refs
|
|
257
|
+
const root = ref();
|
|
255
258
|
const {
|
|
256
259
|
on,
|
|
257
260
|
off
|
|
@@ -341,6 +344,7 @@ var script = defineComponent({
|
|
|
341
344
|
off('toastUpdate', toastUpdate);
|
|
342
345
|
off('toastCloseAll', clearAll);
|
|
343
346
|
});
|
|
347
|
+
useElevation(root, isActive);
|
|
344
348
|
return {
|
|
345
349
|
on,
|
|
346
350
|
off,
|
|
@@ -353,6 +357,7 @@ var script = defineComponent({
|
|
|
353
357
|
clearAll,
|
|
354
358
|
getItem,
|
|
355
359
|
queue,
|
|
360
|
+
root,
|
|
356
361
|
createToast,
|
|
357
362
|
toastUpdate,
|
|
358
363
|
toastRemove,
|
|
@@ -364,7 +369,7 @@ var script = defineComponent({
|
|
|
364
369
|
}
|
|
365
370
|
});
|
|
366
371
|
|
|
367
|
-
var css_248z = ".or-toast
|
|
372
|
+
var css_248z = ".or-toast--transition-slide-enter-active[data-v-9c5633de],.or-toast--transition-slide-leave-active[data-v-9c5633de]{transition:transform .4s ease}.or-toast--transition-slide-enter-from.or-toast--position-right[data-v-9c5633de],.or-toast--transition-slide-leave-to.or-toast--position-right[data-v-9c5633de]{transform:translateX(999px)}.or-toast--transition-slide-enter-from.or-toast--position-left[data-v-9c5633de],.or-toast--transition-slide-leave-to.or-toast--position-left[data-v-9c5633de]{transform:translateX(-999px)}.or-toast--transition-fade-enter-active[data-v-9c5633de],.or-toast--transition-fade-leave-active[data-v-9c5633de]{transition:opacity .4s ease}.or-toast--transition-fade-enter-from[data-v-9c5633de],.or-toast--transition-fade-leave-to[data-v-9c5633de]{opacity:0}";
|
|
368
373
|
styleInject(css_248z);
|
|
369
374
|
|
|
370
375
|
/* script */
|
|
@@ -374,10 +379,14 @@ var __vue_render__ = function () {
|
|
|
374
379
|
var _vm = this;
|
|
375
380
|
var _h = _vm.$createElement;
|
|
376
381
|
var _c = _vm._self._c || _h;
|
|
377
|
-
return
|
|
382
|
+
return _c('OrTeleport', {
|
|
383
|
+
attrs: {
|
|
384
|
+
"disabled": _vm.isActive
|
|
385
|
+
}
|
|
386
|
+
}, [_c('div', {
|
|
387
|
+
ref: "root",
|
|
378
388
|
class: _vm.classes
|
|
379
389
|
}, [_c('TransitionGroup', {
|
|
380
|
-
class: ['contents'],
|
|
381
390
|
attrs: {
|
|
382
391
|
"name": _vm.transitionName
|
|
383
392
|
},
|
|
@@ -402,14 +411,14 @@ var __vue_render__ = function () {
|
|
|
402
411
|
}
|
|
403
412
|
}
|
|
404
413
|
}, 'OrToast', toastConfiguration.toastProps, false));
|
|
405
|
-
}), 1)], 1)])
|
|
414
|
+
}), 1)], 1)]);
|
|
406
415
|
};
|
|
407
416
|
var __vue_staticRenderFns__ = [];
|
|
408
417
|
|
|
409
418
|
/* style */
|
|
410
419
|
const __vue_inject_styles__ = undefined;
|
|
411
420
|
/* scoped */
|
|
412
|
-
const __vue_scope_id__ = "data-v-
|
|
421
|
+
const __vue_scope_id__ = "data-v-9c5633de";
|
|
413
422
|
/* module identifier */
|
|
414
423
|
const __vue_module_identifier__ = undefined;
|
|
415
424
|
/* functional template */
|
|
@@ -103,7 +103,7 @@ export { s as OrTextbox, T as TextboxTypes } from '../OrTextbox-f7388a30.js';
|
|
|
103
103
|
export { s as OrTimePickerV3 } from '../OrTimePicker-2fe3c573.js';
|
|
104
104
|
export { s as OrToast, a as OrToastContainer } from '../OrToastContainer-94ba2803.js';
|
|
105
105
|
export { P as PositionsX, b as PositionsY, c as ToastType, T as TransitionType, a as useQueue, u as useToast } from '../useToast-4fbe0e5a.js';
|
|
106
|
-
export { a as OrToastContainerV3, s as OrToastV3, t as TypesV3 } from '../types-
|
|
106
|
+
export { a as OrToastContainerV3, s as OrToastV3, t as TypesV3 } from '../types-0a697fe0.js';
|
|
107
107
|
export { p as PropsV3, a as useQueueV3, u as useToastV3 } from '../useToast-0665462d.js';
|
|
108
108
|
export { s as OrTooltip } from '../OrTooltip-618ce7c9.js';
|
|
109
109
|
export { s as OrTooltipContent } from '../OrTooltipContent-37a5f562.js';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { a as OrToastContainerV3, s as OrToastV3, t as TypesV3 } from '../../types-
|
|
1
|
+
export { a as OrToastContainerV3, s as OrToastV3, t as TypesV3 } from '../../types-0a697fe0.js';
|
|
2
2
|
export { p as PropsV3, a as useQueueV3, u as useToastV3 } from '../../useToast-0665462d.js';
|
|
3
3
|
import '@vueuse/core';
|
|
4
4
|
import 'vue-demi';
|
|
5
|
+
import '../../useElevation-df91fa50.js';
|
|
5
6
|
import '../../OrTeleport.vue3-8099178c.js';
|
|
6
7
|
import 'vue';
|
|
7
8
|
import '../../OrIconButton-46b3c1e2.js';
|
|
@@ -9,7 +10,6 @@ import '../../OrIcon-62793572.js';
|
|
|
9
10
|
import '../../OrTooltip-e3c85390.js';
|
|
10
11
|
import '../../OrPopover-e34e8f6c.js';
|
|
11
12
|
import '@floating-ui/dom';
|
|
12
|
-
import '../../useElevation-df91fa50.js';
|
|
13
13
|
import '../../useResponsive-a02e95b7.js';
|
|
14
14
|
import '../../OrBottomSheet-6538d9c3.js';
|
|
15
15
|
import '../../OrOverlay-d63d39c3.js';
|
|
@@ -15,6 +15,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
15
15
|
clearAll: () => void;
|
|
16
16
|
getItem: (condition: (i: ToastConfiguration, index: number, queue: import("@vue/composition-api").Ref<ToastConfiguration>[]) => boolean) => import("@vue/composition-api").Ref<ToastConfiguration>;
|
|
17
17
|
queue: import("@vue/composition-api").ComputedRef<ToastConfiguration[]>;
|
|
18
|
+
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
18
19
|
createToast: (toastConfiguration: ToastConfiguration) => void;
|
|
19
20
|
toastUpdate: (toast: ToastConfiguration) => void;
|
|
20
21
|
toastRemove: (toast: ToastConfiguration) => void;
|
|
@@ -66,6 +67,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
66
67
|
clearAll: () => void;
|
|
67
68
|
getItem: (condition: (i: ToastConfiguration, index: number, queue: import("@vue/composition-api").Ref<ToastConfiguration>[]) => boolean) => import("@vue/composition-api").Ref<ToastConfiguration>;
|
|
68
69
|
queue: import("@vue/composition-api").ComputedRef<ToastConfiguration[]>;
|
|
70
|
+
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
69
71
|
createToast: (toastConfiguration: ToastConfiguration) => void;
|
|
70
72
|
toastUpdate: (toast: ToastConfiguration) => void;
|
|
71
73
|
toastRemove: (toast: ToastConfiguration) => void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { a as OrToastContainerV3, t as TypesV3 } from '../../../types-
|
|
1
|
+
export { a as OrToastContainerV3, t as TypesV3 } from '../../../types-0a697fe0.js';
|
|
2
2
|
export { p as PropsV3, a as useQueueV3, u as useToastV3 } from '../../../useToast-0665462d.js';
|
|
3
3
|
import '@vueuse/core';
|
|
4
4
|
import 'vue-demi';
|
|
5
|
+
import '../../../useElevation-df91fa50.js';
|
|
5
6
|
import '../../../OrTeleport.vue3-8099178c.js';
|
|
6
7
|
import 'vue';
|
|
7
8
|
import '../../../OrIconButton-46b3c1e2.js';
|
|
@@ -9,7 +10,6 @@ import '../../../OrIcon-62793572.js';
|
|
|
9
10
|
import '../../../OrTooltip-e3c85390.js';
|
|
10
11
|
import '../../../OrPopover-e34e8f6c.js';
|
|
11
12
|
import '@floating-ui/dom';
|
|
12
|
-
import '../../../useElevation-df91fa50.js';
|
|
13
13
|
import '../../../useResponsive-a02e95b7.js';
|
|
14
14
|
import '../../../OrBottomSheet-6538d9c3.js';
|
|
15
15
|
import '../../../OrOverlay-d63d39c3.js';
|
package/dist/esm/v3/index.js
CHANGED
|
@@ -103,7 +103,7 @@ export { s as OrTextbox, T as TextboxTypes } from './OrTextbox-f7388a30.js';
|
|
|
103
103
|
export { s as OrTimePickerV3 } from './OrTimePicker-2fe3c573.js';
|
|
104
104
|
export { s as OrToast, a as OrToastContainer } from './OrToastContainer-94ba2803.js';
|
|
105
105
|
export { P as PositionsX, b as PositionsY, c as ToastType, T as TransitionType, a as useQueue, u as useToast } from './useToast-4fbe0e5a.js';
|
|
106
|
-
export { a as OrToastContainerV3, s as OrToastV3, t as TypesV3 } from './types-
|
|
106
|
+
export { a as OrToastContainerV3, s as OrToastV3, t as TypesV3 } from './types-0a697fe0.js';
|
|
107
107
|
export { p as PropsV3, a as useQueueV3, u as useToastV3 } from './useToast-0665462d.js';
|
|
108
108
|
export { s as OrTooltip } from './OrTooltip-618ce7c9.js';
|
|
109
109
|
export { s as OrTooltipContent } from './OrTooltipContent-37a5f562.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useToggle } from '@vueuse/core';
|
|
2
2
|
import { defineComponent, ref, computed, onBeforeMount, onBeforeUnmount, nextTick } from 'vue-demi';
|
|
3
|
+
import { u as useElevation } from './useElevation-df91fa50.js';
|
|
3
4
|
import { s as script$4 } from './OrTeleport.vue3-8099178c.js';
|
|
4
5
|
import { T as ToastType, P as PositionsX, b as PositionsY, c as TransitionType, d as useToastEventBus, a as useQueue } from './useToast-0665462d.js';
|
|
5
6
|
import { s as script$2 } from './OrIconButton-46b3c1e2.js';
|
|
@@ -222,6 +223,8 @@ var script = defineComponent({
|
|
|
222
223
|
}
|
|
223
224
|
},
|
|
224
225
|
setup(props) {
|
|
226
|
+
// Refs
|
|
227
|
+
const root = ref();
|
|
225
228
|
const {
|
|
226
229
|
on,
|
|
227
230
|
off
|
|
@@ -311,6 +314,7 @@ var script = defineComponent({
|
|
|
311
314
|
off('toastUpdate', toastUpdate);
|
|
312
315
|
off('toastCloseAll', clearAll);
|
|
313
316
|
});
|
|
317
|
+
useElevation(root, isActive);
|
|
314
318
|
return {
|
|
315
319
|
on,
|
|
316
320
|
off,
|
|
@@ -323,6 +327,7 @@ var script = defineComponent({
|
|
|
323
327
|
clearAll,
|
|
324
328
|
getItem,
|
|
325
329
|
queue,
|
|
330
|
+
root,
|
|
326
331
|
createToast,
|
|
327
332
|
toastUpdate,
|
|
328
333
|
toastRemove,
|
|
@@ -337,14 +342,14 @@ var script = defineComponent({
|
|
|
337
342
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
338
343
|
const _component_OrToast = resolveComponent("OrToast");
|
|
339
344
|
const _component_OrTeleport = resolveComponent("OrTeleport");
|
|
340
|
-
return
|
|
341
|
-
|
|
345
|
+
return openBlock(), createBlock(_component_OrTeleport, {
|
|
346
|
+
disabled: _ctx.isActive
|
|
342
347
|
}, {
|
|
343
348
|
default: withCtx(() => [createElementVNode("div", {
|
|
349
|
+
ref: "root",
|
|
344
350
|
class: normalizeClass(_ctx.classes)
|
|
345
351
|
}, [createVNode(TransitionGroup, {
|
|
346
352
|
name: _ctx.transitionName,
|
|
347
|
-
class: normalizeClass(['contents']),
|
|
348
353
|
onAfterLeave: _ctx.onToastHidden
|
|
349
354
|
}, {
|
|
350
355
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.queue, toastConfiguration => {
|
|
@@ -361,10 +366,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
361
366
|
}, 8 /* PROPS */, ["name", "onAfterLeave"])], 2 /* CLASS */)]),
|
|
362
367
|
|
|
363
368
|
_: 1 /* STABLE */
|
|
364
|
-
}
|
|
369
|
+
}, 8 /* PROPS */, ["disabled"]);
|
|
365
370
|
}
|
|
366
371
|
|
|
367
|
-
var css_248z = ".or-toast
|
|
372
|
+
var css_248z = ".or-toast--transition-slide-enter-active[data-v-f1d54776],\n.or-toast--transition-slide-leave-active[data-v-f1d54776] {\n transition: transform 0.4s ease;\n}\n.or-toast--transition-slide-enter-from.or-toast--position-right[data-v-f1d54776],\n.or-toast--transition-slide-leave-to.or-toast--position-right[data-v-f1d54776] {\n transform: translateX(999px);\n}\n.or-toast--transition-slide-enter-from.or-toast--position-left[data-v-f1d54776],\n.or-toast--transition-slide-leave-to.or-toast--position-left[data-v-f1d54776] {\n transform: translateX(-999px);\n}\n.or-toast--transition-fade-enter-active[data-v-f1d54776],\n.or-toast--transition-fade-leave-active[data-v-f1d54776] {\n transition: opacity 0.4s ease;\n}\n.or-toast--transition-fade-enter-from[data-v-f1d54776],\n.or-toast--transition-fade-leave-to[data-v-f1d54776] {\n opacity: 0;\n}";
|
|
368
373
|
styleInject(css_248z);
|
|
369
374
|
|
|
370
375
|
script.render = render;
|
package/package.json
CHANGED
|
@@ -51,9 +51,9 @@ const Template: StoryFn<typeof OrToast> = (args) => ({
|
|
|
51
51
|
},
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
export const
|
|
54
|
+
export const Toast = Template.bind({});
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
Toast.args = {
|
|
57
57
|
messageText: Faker.lorem.words(7),
|
|
58
58
|
link: {
|
|
59
59
|
href: '#',
|
|
@@ -2,13 +2,14 @@ import { StoryFn } from '@storybook/vue3';
|
|
|
2
2
|
import * as Faker from 'faker';
|
|
3
3
|
import { ref } from 'vue-demi';
|
|
4
4
|
import { OrButtonV3 } from '../../or-button-v3';
|
|
5
|
+
import { OrModalV3 } from '../../or-modal-v3';
|
|
5
6
|
import OrToastContainerV3 from './OrToastContainer.vue';
|
|
6
|
-
import {
|
|
7
|
+
import { useToastV3 } from './index';
|
|
7
8
|
import OrToastContainerDocs from './OrToastContainer.docs.mdx';
|
|
8
9
|
import { PositionsX, PositionsY, TransitionType } from '../props';
|
|
9
10
|
|
|
10
11
|
export default {
|
|
11
|
-
title: 'Components/
|
|
12
|
+
title: 'Components/Toast/Container',
|
|
12
13
|
component: OrToastContainerV3,
|
|
13
14
|
argTypes: {
|
|
14
15
|
position: {
|
|
@@ -39,15 +40,47 @@ export default {
|
|
|
39
40
|
const Template: StoryFn<typeof OrToastContainerV3> = (args) => {
|
|
40
41
|
return {
|
|
41
42
|
components: {
|
|
42
|
-
OrToastContainerV3,
|
|
43
|
+
OrToastContainer: OrToastContainerV3,
|
|
43
44
|
OrButton: OrButtonV3,
|
|
44
45
|
},
|
|
46
|
+
setup() {
|
|
47
|
+
const { success, clearAll } = useToastV3();
|
|
48
|
+
const button = ref();
|
|
49
|
+
return {
|
|
50
|
+
args,
|
|
51
|
+
button,
|
|
52
|
+
success,
|
|
53
|
+
clearAll,
|
|
54
|
+
showToast() {
|
|
55
|
+
success({
|
|
56
|
+
messageText: Faker.lorem.words(7),
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
},
|
|
45
61
|
template: `
|
|
46
62
|
<div class="contents">
|
|
47
|
-
<or-toast-container
|
|
63
|
+
<or-toast-container v-bind="args" />
|
|
48
64
|
<or-button @click="showToast"><span>Click me!!!</span></or-button>
|
|
49
65
|
</div>
|
|
50
66
|
`,
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export const Container = Template.bind({});
|
|
70
|
+
Container.args = {
|
|
71
|
+
position: {
|
|
72
|
+
positionX: PositionsX.Right,
|
|
73
|
+
positionY: PositionsY.Bottom,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const TemplateModal: StoryFn<typeof OrToastContainerV3> = (args) => {
|
|
78
|
+
return {
|
|
79
|
+
components: {
|
|
80
|
+
OrToastContainer: OrToastContainerV3,
|
|
81
|
+
OrButton: OrButtonV3,
|
|
82
|
+
OrModal: OrModalV3,
|
|
83
|
+
},
|
|
51
84
|
setup() {
|
|
52
85
|
const { success, clearAll } = useToastV3();
|
|
53
86
|
const button = ref();
|
|
@@ -56,19 +89,29 @@ const Template: StoryFn<typeof OrToastContainerV3> = (args) => {
|
|
|
56
89
|
button,
|
|
57
90
|
success,
|
|
58
91
|
clearAll,
|
|
92
|
+
showToast() {
|
|
93
|
+
success({
|
|
94
|
+
messageText: Faker.lorem.words(7),
|
|
95
|
+
});
|
|
96
|
+
},
|
|
59
97
|
};
|
|
60
98
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
99
|
+
template: `
|
|
100
|
+
<div class="contents">
|
|
101
|
+
<or-toast-container v-bind="args" />
|
|
102
|
+
<OrModal
|
|
103
|
+
:is-open="true"
|
|
104
|
+
>
|
|
105
|
+
<or-button @click="showToast">
|
|
106
|
+
Trigger toast
|
|
107
|
+
</or-button>
|
|
108
|
+
</OrModal>
|
|
109
|
+
</div>
|
|
110
|
+
`,
|
|
68
111
|
};
|
|
69
112
|
};
|
|
70
|
-
export const
|
|
71
|
-
|
|
113
|
+
export const ContainerWithModal = TemplateModal.bind({});
|
|
114
|
+
ContainerWithModal.args = {
|
|
72
115
|
position: {
|
|
73
116
|
positionX: PositionsX.Right,
|
|
74
117
|
positionY: PositionsY.Bottom,
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<OrTeleport
|
|
3
|
-
|
|
2
|
+
<OrTeleport
|
|
3
|
+
:disabled="isActive"
|
|
4
|
+
>
|
|
5
|
+
<div
|
|
6
|
+
ref="root"
|
|
7
|
+
:class="classes"
|
|
8
|
+
>
|
|
4
9
|
<TransitionGroup
|
|
5
10
|
:name="transitionName"
|
|
6
|
-
:class="['contents']"
|
|
7
11
|
@after-leave="onToastHidden"
|
|
8
12
|
>
|
|
9
13
|
<OrToast
|
|
@@ -22,7 +26,8 @@
|
|
|
22
26
|
|
|
23
27
|
<script lang="ts">
|
|
24
28
|
import { useToggle } from '@vueuse/core';
|
|
25
|
-
import { computed, defineComponent, nextTick, onBeforeMount, onBeforeUnmount, PropType } from 'vue-demi';
|
|
29
|
+
import { computed, defineComponent, nextTick, onBeforeMount, onBeforeUnmount, PropType, ref } from 'vue-demi';
|
|
30
|
+
import { useElevation } from '../../../hooks';
|
|
26
31
|
import { OrTeleportV3 as OrTeleport } from '../../or-teleport-v3';
|
|
27
32
|
import useQueue from '../composable/useQueue';
|
|
28
33
|
import useToastEventBus from '../composable/useToastEventBus';
|
|
@@ -60,6 +65,9 @@ export default defineComponent({
|
|
|
60
65
|
},
|
|
61
66
|
|
|
62
67
|
setup(props) {
|
|
68
|
+
// Refs
|
|
69
|
+
const root = ref<HTMLElement>();
|
|
70
|
+
|
|
63
71
|
const { on, off } = useToastEventBus();
|
|
64
72
|
const { queue: queueRef, addItem, removeItem, clearAll, getItem } = useQueue<ToastConfiguration>();
|
|
65
73
|
const [isActive, toggle] = useToggle(false);
|
|
@@ -150,6 +158,8 @@ export default defineComponent({
|
|
|
150
158
|
off('toastCloseAll', clearAll);
|
|
151
159
|
});
|
|
152
160
|
|
|
161
|
+
useElevation(root, isActive);
|
|
162
|
+
|
|
153
163
|
return {
|
|
154
164
|
on,
|
|
155
165
|
off,
|
|
@@ -162,6 +172,7 @@ export default defineComponent({
|
|
|
162
172
|
clearAll,
|
|
163
173
|
getItem,
|
|
164
174
|
queue,
|
|
175
|
+
root,
|
|
165
176
|
createToast,
|
|
166
177
|
toastUpdate,
|
|
167
178
|
toastRemove,
|
|
@@ -175,15 +186,9 @@ export default defineComponent({
|
|
|
175
186
|
</script>
|
|
176
187
|
|
|
177
188
|
<style lang="scss" scoped>
|
|
178
|
-
$overlay-z-index: 25;
|
|
179
|
-
$or-toast-z-index: $overlay-z-index + 1;
|
|
180
189
|
$header-height: 48px;
|
|
181
190
|
$spacing: 32px;
|
|
182
191
|
|
|
183
|
-
.or-toast-container {
|
|
184
|
-
z-index: $or-toast-z-index;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
192
|
.or-toast--transition-slide-enter-active,
|
|
188
193
|
.or-toast--transition-slide-leave-active {
|
|
189
194
|
transition: transform 0.4s ease;
|