@onereach/ui-components 2.77.0-beta.2456.0 → 2.77.0-beta.2460.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/OrCarousel/OrCarouselItem.vue.d.ts +2 -0
- package/dist/bundled/v2/components/OrCarousel/index.d.ts +1 -2
- package/dist/bundled/v2/components/OrChips/OrChip.vue.d.ts +58 -0
- package/dist/bundled/v2/components/OrChips/index.d.ts +1 -2
- package/dist/bundled/v2/components/OrColorPicker/OrColorPicker.js +1 -1
- package/dist/bundled/v2/components/OrColorPicker/defultPalette.d.ts +2 -0
- package/dist/bundled/v2/components/OrColorPicker/index.js +1 -1
- package/dist/bundled/v2/components/OrColorPicker/utils/defultPalette.js +15 -0
- package/dist/bundled/v2/components/OrSkeleton/OrSkeletonCircle.vue.d.ts +43 -0
- package/dist/bundled/v2/components/OrSkeleton/OrSkeletonRect.vue.d.ts +56 -0
- package/dist/bundled/v2/components/OrSkeleton/OrSkeletonText.vue.d.ts +73 -0
- package/dist/bundled/v2/components/OrSkeleton/index.d.ts +2 -4
- package/dist/bundled/v2/components/OrSkeletonV3/OrSkeletonCircle.vue.d.ts +51 -0
- package/dist/bundled/v2/components/OrSkeletonV3/OrSkeletonRect.vue.d.ts +60 -0
- package/dist/bundled/v2/components/OrSkeletonV3/OrSkeletonText.vue.d.ts +96 -0
- package/dist/bundled/v2/components/OrSkeletonV3/index.d.ts +1 -3
- package/dist/bundled/v2/components/OrToast/OrToastContainer.vue.d.ts +93 -0
- package/dist/bundled/v2/components/OrToast/composable/index.js +7 -0
- package/dist/bundled/v2/components/OrToast/composable/useQueue.js +33 -0
- package/dist/bundled/v2/components/OrToast/composable/useToast.js +82 -0
- package/dist/bundled/v2/components/OrToast/composable/useToastEventBus.js +24 -0
- package/dist/bundled/v2/components/OrToast/index.d.ts +5 -5
- package/dist/bundled/v2/components/OrToast/index.js +3 -3
- package/dist/bundled/v2/components/OrToast/useQueue.d.ts +8 -0
- package/dist/bundled/v2/components/OrToast/useToast.d.ts +13 -0
- package/dist/bundled/v2/components/OrToast/useToastEventBus.d.ts +9 -0
- package/dist/bundled/v2/components/OrToastContainer/OrToastContainer.js +2 -2
- package/dist/bundled/v2/components/OrToastContainer/index.js +3 -3
- package/dist/bundled/v2/components/OrToastContainerV3/OrToastContainer.js +2 -2
- package/dist/bundled/v2/components/OrToastContainerV3/index.js +3 -3
- package/dist/bundled/v2/components/OrToastV3/OrToastContainer.vue.d.ts +85 -0
- package/dist/bundled/v2/components/OrToastV3/composable/index.js +7 -0
- package/dist/bundled/v2/components/OrToastV3/composable/useQueue.js +33 -0
- package/dist/bundled/v2/components/OrToastV3/composable/useToast.js +82 -0
- package/dist/bundled/v2/components/OrToastV3/composable/useToastEventBus.js +24 -0
- package/dist/bundled/v2/components/OrToastV3/index.d.ts +4 -5
- package/dist/bundled/v2/components/OrToastV3/index.js +3 -3
- package/dist/bundled/v2/components/OrToastV3/useQueue.d.ts +8 -0
- package/dist/bundled/v2/components/OrToastV3/useToast.d.ts +13 -0
- package/dist/bundled/v2/components/OrToastV3/useToastEventBus.d.ts +9 -0
- package/dist/bundled/v2/components/OrTooltip/OrTooltipContent.vue.d.ts +38 -0
- package/dist/bundled/v2/components/OrTooltip/index.d.ts +1 -2
- package/dist/bundled/v2/components/index.js +7 -7
- package/dist/bundled/v2/index.js +7 -7
- package/dist/bundled/v3/{OrColorPicker.vue_vue_type_script_lang-c29579b4.js → OrColorPicker.vue_vue_type_script_lang-3a799e23.js} +1 -1
- package/dist/bundled/v3/{OrToastContainer.vue_vue_type_script_lang-3bb6f082.js → OrToastContainer.vue_vue_type_script_lang-51a3ba56.js} +2 -2
- package/dist/bundled/v3/{OrToastContainer.vue_vue_type_script_lang-e98944bc.js → OrToastContainer.vue_vue_type_script_lang-59d729a6.js} +2 -2
- package/dist/bundled/v3/components/OrCarousel/OrCarouselItem.vue.d.ts +2 -0
- package/dist/bundled/v3/components/OrCarousel/index.d.ts +1 -2
- package/dist/bundled/v3/components/OrChips/OrChip.vue.d.ts +58 -0
- package/dist/bundled/v3/components/OrChips/index.d.ts +1 -2
- package/dist/bundled/v3/components/OrColorPicker/OrColorPicker.js +3 -3
- package/dist/bundled/v3/components/OrColorPicker/defultPalette.d.ts +2 -0
- package/dist/bundled/v3/components/OrColorPicker/index.js +2 -2
- package/dist/bundled/v3/components/OrColorPicker/utils/defultPalette.js +15 -0
- package/dist/bundled/v3/components/OrSkeleton/OrSkeletonCircle.vue.d.ts +43 -0
- package/dist/bundled/v3/components/OrSkeleton/OrSkeletonRect.vue.d.ts +56 -0
- package/dist/bundled/v3/components/OrSkeleton/OrSkeletonText.vue.d.ts +73 -0
- package/dist/bundled/v3/components/OrSkeleton/index.d.ts +2 -4
- package/dist/bundled/v3/components/OrSkeletonV3/OrSkeletonCircle.vue.d.ts +51 -0
- package/dist/bundled/v3/components/OrSkeletonV3/OrSkeletonRect.vue.d.ts +60 -0
- package/dist/bundled/v3/components/OrSkeletonV3/OrSkeletonText.vue.d.ts +96 -0
- package/dist/bundled/v3/components/OrSkeletonV3/index.d.ts +1 -3
- package/dist/bundled/v3/components/OrToast/OrToastContainer.vue.d.ts +93 -0
- package/dist/bundled/v3/components/OrToast/composable/index.js +7 -0
- package/dist/bundled/v3/components/OrToast/composable/useQueue.js +33 -0
- package/dist/bundled/v3/components/OrToast/composable/useToast.js +82 -0
- package/dist/bundled/v3/components/OrToast/composable/useToastEventBus.js +24 -0
- package/dist/bundled/v3/components/OrToast/index.d.ts +2 -5
- package/dist/bundled/v3/components/OrToast/index.js +4 -4
- package/dist/bundled/v3/components/OrToast/useQueue.d.ts +8 -0
- package/dist/bundled/v3/components/OrToast/useToast.d.ts +13 -0
- package/dist/bundled/v3/components/OrToast/useToastEventBus.d.ts +9 -0
- package/dist/bundled/v3/components/OrToastContainer/OrToastContainer.js +4 -4
- package/dist/bundled/v3/components/OrToastContainer/index.js +4 -4
- package/dist/bundled/v3/components/OrToastContainerV3/OrToastContainer.js +4 -4
- package/dist/bundled/v3/components/OrToastContainerV3/index.js +4 -4
- package/dist/bundled/v3/components/OrToastV3/OrToastContainer.vue.d.ts +85 -0
- package/dist/bundled/v3/components/OrToastV3/composable/index.js +7 -0
- package/dist/bundled/v3/components/OrToastV3/composable/useQueue.js +33 -0
- package/dist/bundled/v3/components/OrToastV3/composable/useToast.js +82 -0
- package/dist/bundled/v3/components/OrToastV3/composable/useToastEventBus.js +24 -0
- package/dist/bundled/v3/components/OrToastV3/index.d.ts +2 -5
- package/dist/bundled/v3/components/OrToastV3/index.js +4 -4
- package/dist/bundled/v3/components/OrToastV3/useQueue.d.ts +8 -0
- package/dist/bundled/v3/components/OrToastV3/useToast.d.ts +13 -0
- package/dist/bundled/v3/components/OrToastV3/useToastEventBus.d.ts +9 -0
- package/dist/bundled/v3/components/OrTooltip/OrTooltipContent.vue.d.ts +38 -0
- package/dist/bundled/v3/components/OrTooltip/index.d.ts +1 -2
- package/dist/bundled/v3/components/index.js +10 -10
- package/dist/bundled/v3/index.js +10 -10
- package/package.json +2 -2
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import Timer from '../Timer.js';
|
|
2
|
+
import useToastEventBus from './useToastEventBus.js';
|
|
3
|
+
import { ToastType } from '../constants.js';
|
|
4
|
+
import '@vueuse/core';
|
|
5
|
+
|
|
6
|
+
function useToast(globalToastProps = {}) {
|
|
7
|
+
const {
|
|
8
|
+
emit
|
|
9
|
+
} = useToastEventBus();
|
|
10
|
+
function notify(props, behaviour = {}) {
|
|
11
|
+
const {
|
|
12
|
+
duration = 5000,
|
|
13
|
+
pauseOnHover = true,
|
|
14
|
+
onToastClose,
|
|
15
|
+
onToastClick
|
|
16
|
+
} = behaviour;
|
|
17
|
+
const propsData = {
|
|
18
|
+
...props,
|
|
19
|
+
...globalToastProps
|
|
20
|
+
};
|
|
21
|
+
const config = {
|
|
22
|
+
toastProps: propsData,
|
|
23
|
+
//generate ToastHash
|
|
24
|
+
hash: Math.random().toString(36).slice(2),
|
|
25
|
+
...(Number.isInteger(duration) && {
|
|
26
|
+
timer: new Timer()
|
|
27
|
+
}),
|
|
28
|
+
toastBehaviour: {
|
|
29
|
+
duration,
|
|
30
|
+
pauseOnHover,
|
|
31
|
+
onToastClose,
|
|
32
|
+
onToastClick
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
emit('toastNotify', config);
|
|
36
|
+
return {
|
|
37
|
+
close: () => emit('toastClose', config),
|
|
38
|
+
update: data => emit('toastUpdate', {
|
|
39
|
+
...config,
|
|
40
|
+
toastProps: {
|
|
41
|
+
...config.toastProps,
|
|
42
|
+
...data
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function clearAll() {
|
|
48
|
+
emit('toastCloseAll');
|
|
49
|
+
}
|
|
50
|
+
function success(props, behaviour = {}) {
|
|
51
|
+
return notify({
|
|
52
|
+
...props,
|
|
53
|
+
toastType: ToastType.success
|
|
54
|
+
}, behaviour);
|
|
55
|
+
}
|
|
56
|
+
function error(props, behaviour = {}) {
|
|
57
|
+
return notify({
|
|
58
|
+
...props,
|
|
59
|
+
toastType: ToastType.error
|
|
60
|
+
}, behaviour);
|
|
61
|
+
}
|
|
62
|
+
function loading(props, behaviour = {}) {
|
|
63
|
+
return notify({
|
|
64
|
+
...props,
|
|
65
|
+
toastType: ToastType.loading,
|
|
66
|
+
dismissible: false
|
|
67
|
+
}, {
|
|
68
|
+
...behaviour,
|
|
69
|
+
duration: 0 // <- toast with type "loading" will not cloe automatically
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
notify,
|
|
75
|
+
clearAll,
|
|
76
|
+
success,
|
|
77
|
+
error,
|
|
78
|
+
loading
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export { useToast as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createSharedComposable, useEventBus } from '@vueuse/core';
|
|
2
|
+
|
|
3
|
+
const useToastEventBus = () => {
|
|
4
|
+
const busPull = {
|
|
5
|
+
toastNotify: useEventBus('toastNotify'),
|
|
6
|
+
toastClose: useEventBus('toastClose'),
|
|
7
|
+
toastCloseAll: useEventBus('toastCloseAll'),
|
|
8
|
+
toastUpdate: useEventBus('toastUpdate')
|
|
9
|
+
};
|
|
10
|
+
return {
|
|
11
|
+
on: (namedQueue, listener) => {
|
|
12
|
+
busPull[namedQueue].on(listener);
|
|
13
|
+
},
|
|
14
|
+
off: (namedQueue, listener) => {
|
|
15
|
+
busPull[namedQueue].off(listener);
|
|
16
|
+
},
|
|
17
|
+
emit: (namedQueue, data) => {
|
|
18
|
+
busPull[namedQueue].emit(data);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
var useToastEventBus$1 = createSharedComposable(useToastEventBus);
|
|
23
|
+
|
|
24
|
+
export { useToastEventBus$1 as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
1
|
+
export { default as useToast } from './useToast';
|
|
2
|
+
export { default as useQueue } from './useQueue';
|
|
3
|
+
|
|
4
|
+
export * from '../types';
|
|
5
|
+
export * from '../constants';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { default as OrToast } from './OrToast.js';
|
|
2
2
|
export { default as OrToastContainer } from '../OrToastContainer/OrToastContainer.js';
|
|
3
3
|
export { PositionsX, PositionsY, ToastType, TransitionType } from './constants.js';
|
|
4
|
-
export { default as useToast } from '
|
|
5
|
-
export { default as useQueue } from '
|
|
4
|
+
export { default as useToast } from './composable/useToast.js';
|
|
5
|
+
export { default as useQueue } from './composable/useQueue.js';
|
|
6
6
|
import 'vue-demi';
|
|
7
7
|
import '../OrProgress/OrProgress.js';
|
|
8
8
|
import 'lodash';
|
|
@@ -26,5 +26,5 @@ import '../../utils/functions/px-to-rem.js';
|
|
|
26
26
|
import '../OrLoader/OrLoader.js';
|
|
27
27
|
import '../OrLoader/constants.js';
|
|
28
28
|
import '@vueuse/core';
|
|
29
|
-
import '
|
|
29
|
+
import './composable/useToastEventBus.js';
|
|
30
30
|
import './Timer.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Ref } from 'vue-demi';
|
|
2
|
+
export default function useQueue<T>(initialValue?: Array<T>): {
|
|
3
|
+
queue: Ref<Ref<T>[]>;
|
|
4
|
+
addItem: (item: T) => void;
|
|
5
|
+
removeItem: (condition: (i: T, index: number, queue: Ref<T>[]) => boolean) => void;
|
|
6
|
+
clearAll: () => void;
|
|
7
|
+
getItem: (condition: (i: T, index: number, queue: Ref<T>[]) => boolean) => Ref<T>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ToastBehaviour, ToastProps } from '../types';
|
|
2
|
+
interface UseToastNotifyReturns {
|
|
3
|
+
close: () => void;
|
|
4
|
+
update: (data: ToastProps) => void;
|
|
5
|
+
}
|
|
6
|
+
export default function useToast(globalToastProps?: ToastProps): {
|
|
7
|
+
notify: (props: ToastProps, behaviour?: ToastBehaviour) => UseToastNotifyReturns;
|
|
8
|
+
clearAll: () => void;
|
|
9
|
+
success: (props: ToastProps, behaviour?: ToastBehaviour) => UseToastNotifyReturns;
|
|
10
|
+
error: (props: ToastProps, behaviour?: ToastBehaviour) => UseToastNotifyReturns;
|
|
11
|
+
loading: (props: ToastProps, behaviour?: ToastBehaviour) => UseToastNotifyReturns;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EventBusListener } from '@vueuse/core';
|
|
2
|
+
import { ToastConfiguration } from '../types';
|
|
3
|
+
export type ToastEventsBusEvents = 'toastNotify' | 'toastClose' | 'toastCloseAll' | 'toastUpdate';
|
|
4
|
+
declare const _default: () => {
|
|
5
|
+
on: (namedQueue: ToastEventsBusEvents, listener: EventBusListener<ToastConfiguration, any>) => void;
|
|
6
|
+
off: (namedQueue: ToastEventsBusEvents, listener: EventBusListener<ToastConfiguration, any>) => void;
|
|
7
|
+
emit: (namedQueue: ToastEventsBusEvents, data?: ToastConfiguration | undefined) => void;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -2,8 +2,8 @@ import __vue_component__$1 from '../OrToast/OrToast.js';
|
|
|
2
2
|
import __vue_component__$2 from '../OrTeleport/OrTeleport.js';
|
|
3
3
|
import { defineComponent, nextTick } from 'vue-demi';
|
|
4
4
|
import { useToggle } from '@vueuse/core';
|
|
5
|
-
import useQueue from '../
|
|
6
|
-
import useToastEventBus from '../
|
|
5
|
+
import useQueue from '../OrToast/composable/useQueue.js';
|
|
6
|
+
import useToastEventBus from '../OrToast/composable/useToastEventBus.js';
|
|
7
7
|
import { PositionsX, PositionsY, TransitionType } from '../OrToast/constants.js';
|
|
8
8
|
import { s as styleInject } from '../../style-inject.es-4c6f2515.js';
|
|
9
9
|
import { n as normalizeComponent } from '../../normalize-component-6e8e3d80.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as OrToastContainer } from './OrToastContainer.js';
|
|
2
2
|
export { PositionsX, PositionsY, ToastType, TransitionType } from '../OrToast/constants.js';
|
|
3
|
-
export { default as useToast } from '../
|
|
4
|
-
export { default as useQueue } from '../
|
|
3
|
+
export { default as useToast } from '../OrToast/composable/useToast.js';
|
|
4
|
+
export { default as useQueue } from '../OrToast/composable/useQueue.js';
|
|
5
5
|
import '../OrToast/OrToast.js';
|
|
6
6
|
import 'vue-demi';
|
|
7
7
|
import '../OrProgress/OrProgress.js';
|
|
@@ -26,5 +26,5 @@ import '../../utils/functions/px-to-rem.js';
|
|
|
26
26
|
import '../OrLoader/OrLoader.js';
|
|
27
27
|
import '../OrLoader/constants.js';
|
|
28
28
|
import '@vueuse/core';
|
|
29
|
-
import '../
|
|
29
|
+
import '../OrToast/composable/useToastEventBus.js';
|
|
30
30
|
import '../OrToast/Timer.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useToggle } from '@vueuse/core';
|
|
2
2
|
import { defineComponent, computed, onBeforeMount, onBeforeUnmount, nextTick } from 'vue-demi';
|
|
3
|
-
import useQueue from '../
|
|
4
|
-
import useToastEventBus from '../
|
|
3
|
+
import useQueue from '../OrToastV3/composable/useQueue.js';
|
|
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';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { default as OrToastContainerV3 } from './OrToastContainer.js';
|
|
2
2
|
export { t as TypesV3 } from '../../types-668300dd.js';
|
|
3
3
|
export { p as PropsV3 } from '../../props-7be029c7.js';
|
|
4
|
-
export { default as useToastV3 } from '../
|
|
5
|
-
export { default as useQueueV3 } from '../
|
|
4
|
+
export { default as useToastV3 } from '../OrToastV3/composable/useToast.js';
|
|
5
|
+
export { default as useQueueV3 } from '../OrToastV3/composable/useQueue.js';
|
|
6
6
|
import '@vueuse/core';
|
|
7
7
|
import 'vue-demi';
|
|
8
|
-
import '../
|
|
8
|
+
import '../OrToastV3/composable/useToastEventBus.js';
|
|
9
9
|
import '../OrToastV3/OrToast.js';
|
|
10
10
|
import '../OrToastV3/styles.js';
|
|
11
11
|
import '../OrIconButtonV3/OrIconButton.js';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { PropType } from 'vue-demi';
|
|
2
|
+
import { TransitionType } from '../props';
|
|
3
|
+
import { Position, ToastBehaviour, ToastConfiguration } from '../types';
|
|
4
|
+
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
5
|
+
on: (namedQueue: import("../composable/useToastEventBus").ToastEventsBusEvents, listener: import("@vueuse/core").EventBusListener<ToastConfiguration, any>) => void;
|
|
6
|
+
off: (namedQueue: import("../composable/useToastEventBus").ToastEventsBusEvents, listener: import("@vueuse/core").EventBusListener<ToastConfiguration, any>) => void;
|
|
7
|
+
classes: import("@vue/composition-api").ComputedRef<(string | {
|
|
8
|
+
'position--top--with-header': boolean;
|
|
9
|
+
})[]>;
|
|
10
|
+
transitionName: import("@vue/composition-api").ComputedRef<string>;
|
|
11
|
+
isActive: import("@vue/composition-api").Ref<boolean>;
|
|
12
|
+
toggle: (value?: boolean | undefined) => boolean;
|
|
13
|
+
addItem: (item: ToastConfiguration) => void;
|
|
14
|
+
removeItem: (condition: (i: ToastConfiguration, index: number, queue: import("@vue/composition-api").Ref<ToastConfiguration>[]) => boolean) => void;
|
|
15
|
+
clearAll: () => void;
|
|
16
|
+
getItem: (condition: (i: ToastConfiguration, index: number, queue: import("@vue/composition-api").Ref<ToastConfiguration>[]) => boolean) => import("@vue/composition-api").Ref<ToastConfiguration>;
|
|
17
|
+
queue: import("@vue/composition-api").ComputedRef<ToastConfiguration[]>;
|
|
18
|
+
createToast: (toastConfiguration: ToastConfiguration) => void;
|
|
19
|
+
toastUpdate: (toast: ToastConfiguration) => void;
|
|
20
|
+
toastRemove: (toast: ToastConfiguration) => void;
|
|
21
|
+
onToastEnter: (toast: ToastConfiguration) => void;
|
|
22
|
+
onToastLeave: (toast: ToastConfiguration) => void;
|
|
23
|
+
onClick: (toastBehaviour: ToastBehaviour) => void;
|
|
24
|
+
onToastHidden: () => void;
|
|
25
|
+
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
26
|
+
includeHeaderHeight: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: boolean;
|
|
29
|
+
};
|
|
30
|
+
position: {
|
|
31
|
+
type: PropType<Position>;
|
|
32
|
+
default: Position;
|
|
33
|
+
};
|
|
34
|
+
transition: {
|
|
35
|
+
type: PropType<TransitionType>;
|
|
36
|
+
default: TransitionType;
|
|
37
|
+
};
|
|
38
|
+
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
39
|
+
includeHeaderHeight: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
43
|
+
position: {
|
|
44
|
+
type: PropType<Position>;
|
|
45
|
+
default: Position;
|
|
46
|
+
};
|
|
47
|
+
transition: {
|
|
48
|
+
type: PropType<TransitionType>;
|
|
49
|
+
default: TransitionType;
|
|
50
|
+
};
|
|
51
|
+
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
52
|
+
includeHeaderHeight: boolean;
|
|
53
|
+
position: Position;
|
|
54
|
+
transition: TransitionType;
|
|
55
|
+
} & {}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
56
|
+
on: (namedQueue: import("../composable/useToastEventBus").ToastEventsBusEvents, listener: import("@vueuse/core").EventBusListener<ToastConfiguration, any>) => void;
|
|
57
|
+
off: (namedQueue: import("../composable/useToastEventBus").ToastEventsBusEvents, listener: import("@vueuse/core").EventBusListener<ToastConfiguration, any>) => void;
|
|
58
|
+
classes: import("@vue/composition-api").ComputedRef<(string | {
|
|
59
|
+
'position--top--with-header': boolean;
|
|
60
|
+
})[]>;
|
|
61
|
+
transitionName: import("@vue/composition-api").ComputedRef<string>;
|
|
62
|
+
isActive: import("@vue/composition-api").Ref<boolean>;
|
|
63
|
+
toggle: (value?: boolean | undefined) => boolean;
|
|
64
|
+
addItem: (item: ToastConfiguration) => void;
|
|
65
|
+
removeItem: (condition: (i: ToastConfiguration, index: number, queue: import("@vue/composition-api").Ref<ToastConfiguration>[]) => boolean) => void;
|
|
66
|
+
clearAll: () => void;
|
|
67
|
+
getItem: (condition: (i: ToastConfiguration, index: number, queue: import("@vue/composition-api").Ref<ToastConfiguration>[]) => boolean) => import("@vue/composition-api").Ref<ToastConfiguration>;
|
|
68
|
+
queue: import("@vue/composition-api").ComputedRef<ToastConfiguration[]>;
|
|
69
|
+
createToast: (toastConfiguration: ToastConfiguration) => void;
|
|
70
|
+
toastUpdate: (toast: ToastConfiguration) => void;
|
|
71
|
+
toastRemove: (toast: ToastConfiguration) => void;
|
|
72
|
+
onToastEnter: (toast: ToastConfiguration) => void;
|
|
73
|
+
onToastLeave: (toast: ToastConfiguration) => void;
|
|
74
|
+
onClick: (toastBehaviour: ToastBehaviour) => void;
|
|
75
|
+
onToastHidden: () => void;
|
|
76
|
+
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, {}, {
|
|
77
|
+
includeHeaderHeight: boolean;
|
|
78
|
+
position: Position;
|
|
79
|
+
transition: TransitionType;
|
|
80
|
+
} & {}, {
|
|
81
|
+
includeHeaderHeight: boolean;
|
|
82
|
+
position: Position;
|
|
83
|
+
transition: TransitionType;
|
|
84
|
+
}, true>);
|
|
85
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ref } from 'vue-demi';
|
|
2
|
+
|
|
3
|
+
function useQueue(initialValue) {
|
|
4
|
+
//generic needed! see https://github.com/vuejs/core/issues/2136
|
|
5
|
+
const queue = ref(initialValue || []);
|
|
6
|
+
const addItem = item => {
|
|
7
|
+
const refItem = ref(item);
|
|
8
|
+
queue.value.push(refItem);
|
|
9
|
+
};
|
|
10
|
+
const removeItem = condition => {
|
|
11
|
+
const index = queue.value.findIndex((i, idx, q) => {
|
|
12
|
+
return condition === null || condition === void 0 ? void 0 : condition(i.value, idx, q);
|
|
13
|
+
});
|
|
14
|
+
if (index !== -1) queue.value.splice(index, 1);
|
|
15
|
+
};
|
|
16
|
+
const getItem = condition => {
|
|
17
|
+
return queue.value.filter((i, idx, q) => {
|
|
18
|
+
return condition === null || condition === void 0 ? void 0 : condition(i.value, idx, q);
|
|
19
|
+
})[0];
|
|
20
|
+
};
|
|
21
|
+
const clearAll = () => {
|
|
22
|
+
queue.value = [];
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
queue,
|
|
26
|
+
addItem,
|
|
27
|
+
removeItem,
|
|
28
|
+
clearAll,
|
|
29
|
+
getItem
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { useQueue as default };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { b as ToastType } from '../../../props-7be029c7.js';
|
|
2
|
+
import Timer from '../Timer.js';
|
|
3
|
+
import useToastEventBus from './useToastEventBus.js';
|
|
4
|
+
import '@vueuse/core';
|
|
5
|
+
|
|
6
|
+
function useToast(globalToastProps = {}) {
|
|
7
|
+
const {
|
|
8
|
+
emit
|
|
9
|
+
} = useToastEventBus();
|
|
10
|
+
function notify(props, behaviour = {}) {
|
|
11
|
+
const {
|
|
12
|
+
duration = 5000,
|
|
13
|
+
pauseOnHover = true,
|
|
14
|
+
onToastClose,
|
|
15
|
+
onToastClick
|
|
16
|
+
} = behaviour;
|
|
17
|
+
const propsData = {
|
|
18
|
+
...props,
|
|
19
|
+
...globalToastProps
|
|
20
|
+
};
|
|
21
|
+
const config = {
|
|
22
|
+
toastProps: propsData,
|
|
23
|
+
//generate ToastHash
|
|
24
|
+
hash: Math.random().toString(36).slice(2),
|
|
25
|
+
...(Number.isInteger(duration) && {
|
|
26
|
+
timer: new Timer()
|
|
27
|
+
}),
|
|
28
|
+
toastBehaviour: {
|
|
29
|
+
duration,
|
|
30
|
+
pauseOnHover,
|
|
31
|
+
onToastClose,
|
|
32
|
+
onToastClick
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
emit('toastNotify', config);
|
|
36
|
+
return {
|
|
37
|
+
close: () => emit('toastClose', config),
|
|
38
|
+
update: data => emit('toastUpdate', {
|
|
39
|
+
...config,
|
|
40
|
+
toastProps: {
|
|
41
|
+
...config.toastProps,
|
|
42
|
+
...data
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function clearAll() {
|
|
48
|
+
emit('toastCloseAll');
|
|
49
|
+
}
|
|
50
|
+
function success(props, behaviour = {}) {
|
|
51
|
+
return notify({
|
|
52
|
+
...props,
|
|
53
|
+
toastType: ToastType.Success
|
|
54
|
+
}, behaviour);
|
|
55
|
+
}
|
|
56
|
+
function error(props, behaviour = {}) {
|
|
57
|
+
return notify({
|
|
58
|
+
...props,
|
|
59
|
+
toastType: ToastType.Error
|
|
60
|
+
}, behaviour);
|
|
61
|
+
}
|
|
62
|
+
function loading(props, behaviour = {}) {
|
|
63
|
+
return notify({
|
|
64
|
+
...props,
|
|
65
|
+
toastType: ToastType.Loading,
|
|
66
|
+
dismissible: false
|
|
67
|
+
}, {
|
|
68
|
+
...behaviour,
|
|
69
|
+
duration: 0 // <- toast with type "loading" will not cloe automatically
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
notify,
|
|
75
|
+
clearAll,
|
|
76
|
+
success,
|
|
77
|
+
error,
|
|
78
|
+
loading
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export { useToast as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createSharedComposable, useEventBus } from '@vueuse/core';
|
|
2
|
+
|
|
3
|
+
const useToastEventBus = () => {
|
|
4
|
+
const busPull = {
|
|
5
|
+
toastNotify: useEventBus('toastNotify'),
|
|
6
|
+
toastClose: useEventBus('toastClose'),
|
|
7
|
+
toastCloseAll: useEventBus('toastCloseAll'),
|
|
8
|
+
toastUpdate: useEventBus('toastUpdate')
|
|
9
|
+
};
|
|
10
|
+
return {
|
|
11
|
+
on: (namedQueue, listener) => {
|
|
12
|
+
busPull[namedQueue].on(listener);
|
|
13
|
+
},
|
|
14
|
+
off: (namedQueue, listener) => {
|
|
15
|
+
busPull[namedQueue].off(listener);
|
|
16
|
+
},
|
|
17
|
+
emit: (namedQueue, data) => {
|
|
18
|
+
busPull[namedQueue].emit(data);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
var useToastEventBus$1 = createSharedComposable(useToastEventBus);
|
|
23
|
+
|
|
24
|
+
export { useToastEventBus$1 as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
|
|
4
|
-
export * as
|
|
5
|
-
export * as PropsV3 from './props';
|
|
1
|
+
export { default as useToastV3 } from './useToast';
|
|
2
|
+
export { default as useQueueV3 } from './useQueue';
|
|
3
|
+
xport * as TypesV3 from '../types';
|
|
4
|
+
export * as PropsV3 from '../props';
|
|
@@ -2,8 +2,8 @@ export { default as OrToastV3 } from './OrToast.js';
|
|
|
2
2
|
export { default as OrToastContainerV3 } from '../OrToastContainerV3/OrToastContainer.js';
|
|
3
3
|
export { t as TypesV3 } from '../../types-668300dd.js';
|
|
4
4
|
export { p as PropsV3 } from '../../props-7be029c7.js';
|
|
5
|
-
export { default as useToastV3 } from '
|
|
6
|
-
export { default as useQueueV3 } from '
|
|
5
|
+
export { default as useToastV3 } from './composable/useToast.js';
|
|
6
|
+
export { default as useQueueV3 } from './composable/useQueue.js';
|
|
7
7
|
import 'vue-demi';
|
|
8
8
|
import './styles.js';
|
|
9
9
|
import '../OrIconButtonV3/OrIconButton.js';
|
|
@@ -33,5 +33,5 @@ import '../OrLoaderV3/OrLoader.js';
|
|
|
33
33
|
import '../OrLoaderV3/props.js';
|
|
34
34
|
import '../OrLoaderV3/styles.js';
|
|
35
35
|
import '../../style-inject.es-4c6f2515.js';
|
|
36
|
-
import '
|
|
36
|
+
import './composable/useToastEventBus.js';
|
|
37
37
|
import './Timer.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Ref } from 'vue-demi';
|
|
2
|
+
export default function useQueue<T>(initialValue?: Array<T>): {
|
|
3
|
+
queue: Ref<Ref<T>[]>;
|
|
4
|
+
addItem: (item: T) => void;
|
|
5
|
+
removeItem: (condition: (i: T, index: number, queue: Ref<T>[]) => boolean) => void;
|
|
6
|
+
clearAll: () => void;
|
|
7
|
+
getItem: (condition: (i: T, index: number, queue: Ref<T>[]) => boolean) => Ref<T>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ToastBehaviour, ToastProps } from '../types';
|
|
2
|
+
interface UseToastNotifyReturns {
|
|
3
|
+
close: () => void;
|
|
4
|
+
update: (data: ToastProps) => void;
|
|
5
|
+
}
|
|
6
|
+
export default function useToast(globalToastProps?: ToastProps): {
|
|
7
|
+
notify: (props: ToastProps, behaviour?: ToastBehaviour) => UseToastNotifyReturns;
|
|
8
|
+
clearAll: () => void;
|
|
9
|
+
success: (props: ToastProps, behaviour?: ToastBehaviour) => UseToastNotifyReturns;
|
|
10
|
+
error: (props: ToastProps, behaviour?: ToastBehaviour) => UseToastNotifyReturns;
|
|
11
|
+
loading: (props: ToastProps, behaviour?: ToastBehaviour) => UseToastNotifyReturns;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EventBusListener } from '@vueuse/core';
|
|
2
|
+
import { ToastConfiguration } from '../types';
|
|
3
|
+
export type ToastEventsBusEvents = 'toastNotify' | 'toastClose' | 'toastCloseAll' | 'toastUpdate';
|
|
4
|
+
declare const _default: () => {
|
|
5
|
+
on: (namedQueue: ToastEventsBusEvents, listener: EventBusListener<ToastConfiguration, any>) => void;
|
|
6
|
+
off: (namedQueue: ToastEventsBusEvents, listener: EventBusListener<ToastConfiguration, any>) => void;
|
|
7
|
+
emit: (namedQueue: ToastEventsBusEvents, data?: ToastConfiguration | undefined) => void;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PropType } from 'vue-demi';
|
|
2
|
+
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<import("@vue/composition-api").Data> & import("@vue/composition-api").Data, {}, {}, {
|
|
3
|
+
isShown: {
|
|
4
|
+
type: PropType<boolean>;
|
|
5
|
+
required: false;
|
|
6
|
+
default: boolean;
|
|
7
|
+
validator: (value?: any) => value is boolean;
|
|
8
|
+
};
|
|
9
|
+
content: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
required: false;
|
|
12
|
+
default: string;
|
|
13
|
+
validator: (value?: any) => value is string;
|
|
14
|
+
};
|
|
15
|
+
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
16
|
+
isShown: {
|
|
17
|
+
type: PropType<boolean>;
|
|
18
|
+
required: false;
|
|
19
|
+
default: boolean;
|
|
20
|
+
validator: (value?: any) => value is boolean;
|
|
21
|
+
};
|
|
22
|
+
content: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
required: false;
|
|
25
|
+
default: string;
|
|
26
|
+
validator: (value?: any) => value is string;
|
|
27
|
+
};
|
|
28
|
+
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
29
|
+
isShown: boolean;
|
|
30
|
+
content: string;
|
|
31
|
+
} & {}, import("@vue/composition-api").ShallowUnwrapRef<import("@vue/composition-api").Data>, import("@vue/composition-api").Data, {}, {}, {}, {}, {}, {
|
|
32
|
+
isShown: boolean;
|
|
33
|
+
content: string;
|
|
34
|
+
} & {}, {
|
|
35
|
+
isShown: boolean;
|
|
36
|
+
content: string;
|
|
37
|
+
}, true>);
|
|
38
|
+
export default _default;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as OrTooltipContent } from './or-tooltip-content/OrTooltipContent.vue';
|
|
1
|
+
export { default as OrTooltipContent } from './OrTooltipContent.vue';
|
|
@@ -139,15 +139,15 @@ export { default as OrTextbox } from './OrTextbox/OrTextbox.js';
|
|
|
139
139
|
export { TextboxTypes } from './OrTextbox/constants.js';
|
|
140
140
|
export { default as OrToast } from './OrToast/OrToast.js';
|
|
141
141
|
export { default as OrToastContainer } from './OrToastContainer/OrToastContainer.js';
|
|
142
|
-
export { default as useToast } from './
|
|
143
|
-
export { default as useQueue } from './
|
|
142
|
+
export { default as useToast } from './OrToast/composable/useToast.js';
|
|
143
|
+
export { default as useQueue } from './OrToast/composable/useQueue.js';
|
|
144
144
|
export { PositionsX, PositionsY, ToastType, TransitionType } from './OrToast/constants.js';
|
|
145
145
|
export { default as OrToastV3 } from './OrToastV3/OrToast.js';
|
|
146
146
|
export { default as OrToastContainerV3 } from './OrToastContainerV3/OrToastContainer.js';
|
|
147
147
|
export { t as TypesV3 } from '../types-668300dd.js';
|
|
148
148
|
export { p as PropsV3 } from '../props-7be029c7.js';
|
|
149
|
-
export { default as useToastV3 } from './
|
|
150
|
-
export { default as useQueueV3 } from './
|
|
149
|
+
export { default as useToastV3 } from './OrToastV3/composable/useToast.js';
|
|
150
|
+
export { default as useQueueV3 } from './OrToastV3/composable/useQueue.js';
|
|
151
151
|
export { default as OrTooltip } from './OrTooltip/OrTooltip.js';
|
|
152
152
|
export { default as OrTooltipContent } from './OrTooltipContent/OrTooltipContent.js';
|
|
153
153
|
export { default as OrTooltipV3 } from './OrTooltipV3/OrTooltip.js';
|
|
@@ -196,7 +196,7 @@ import './OrChips/constants.js';
|
|
|
196
196
|
import '../index-6976c52a.js';
|
|
197
197
|
import '../lang-02d2bb2d.js';
|
|
198
198
|
import './OrCode/theme.js';
|
|
199
|
-
import './
|
|
199
|
+
import './OrColorPicker/utils/defultPalette.js';
|
|
200
200
|
import '../index-63e094a0.js';
|
|
201
201
|
import './OrConfirmV3/styles.js';
|
|
202
202
|
import './OrErrorTagV3/styles.js';
|
|
@@ -229,8 +229,8 @@ import './OrTabV3/styles.js';
|
|
|
229
229
|
import './OrTabsV3/styles.js';
|
|
230
230
|
import './OrTextV3/styles.js';
|
|
231
231
|
import './OrTextareaV3/styles.js';
|
|
232
|
-
import './
|
|
232
|
+
import './OrToast/composable/useToastEventBus.js';
|
|
233
233
|
import './OrToast/Timer.js';
|
|
234
234
|
import './OrToastV3/styles.js';
|
|
235
|
-
import './
|
|
235
|
+
import './OrToastV3/composable/useToastEventBus.js';
|
|
236
236
|
import './OrToastV3/Timer.js';
|