@simonbackx/vue-app-navigation 1.28.0 → 2.0.0-alpha.1

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.
@@ -1,9 +1,28 @@
1
- import { Vue } from "vue-property-decorator";
2
- import { ComponentWithProperties } from "./ComponentWithProperties";
3
- import FramedComponent from "./FramedComponent.vue";
4
- import { PopOptions } from "./PopOptions";
5
- import { PushOptions } from "./PushOptions";
6
- export default class NavigationController extends Vue {
1
+ import { PushOptions } from './PushOptions';
2
+ import { PopOptions } from './PopOptions';
3
+ import { ComponentWithProperties } from './ComponentWithProperties';
4
+ import { PropType } from 'vue';
5
+
6
+ declare const _default: import('vue').DefineComponent<{
7
+ root: {
8
+ required: true;
9
+ type: typeof ComponentWithProperties;
10
+ };
11
+ initialComponents: {
12
+ default: null;
13
+ type: PropType<ComponentWithProperties[] | null>;
14
+ };
15
+ animationType: {
16
+ default: string;
17
+ type: StringConstructor;
18
+ };
19
+ customProvide: {
20
+ type: ObjectConstructor;
21
+ default: null;
22
+ };
23
+ }, {
24
+ originalPop: (options?: PopOptions | undefined) => void;
25
+ }, {
7
26
  components: ComponentWithProperties[];
8
27
  mainComponent: ComponentWithProperties | null;
9
28
  transitionName: string;
@@ -12,41 +31,53 @@ export default class NavigationController extends Vue {
12
31
  previousScrollPosition: number;
13
32
  nextInternalScrollPosition: number;
14
33
  savedInternalScrollPositions: number[];
15
- root: ComponentWithProperties;
16
- initialComponents: ComponentWithProperties[] | null;
17
- animationType: string;
18
- child: FramedComponent;
19
- beforeMount(): void;
34
+ }, {}, {
20
35
  freezeSize(): void;
21
36
  growSize(width: number, height: number): void;
22
37
  unfreezeSize(): void;
23
- getInternalScrollElement(element?: HTMLElement | null): HTMLElement | null;
38
+ getInternalScrollElement(element?: Element | null): HTMLElement | null;
24
39
  getScrollElement(element?: HTMLElement | null): HTMLElement;
25
40
  shouldAnimate(): boolean;
26
- /**
27
- * popOptions = how to handle the pop of replace. animated and count are ignored
28
- * -> should get moved to separate configurations in the future
29
- */
30
41
  push(options: PushOptions): Promise<void>;
31
- /**
32
- * Whether user interaction might prevent destructive navigation away from components.
33
- */
34
42
  shouldNavigateAway(): Promise<boolean>;
35
43
  popToRoot(options?: PopOptions): Promise<ComponentWithProperties[] | undefined>;
36
- getPoppableParent(): any | null;
37
- /**
38
- * force: whether "shouldNavigateAway" of child components is ignored
39
- */
44
+ getPoppableParent(): import('vue').ComponentInternalInstance | null;
40
45
  pop(options?: PopOptions): Promise<ComponentWithProperties[] | undefined>;
41
- beforeEnter(insertedElement: HTMLElement): void;
42
- beforeLeave(_element: HTMLElement): void;
46
+ beforeEnter(insertedElement: Element): void;
47
+ beforeLeave(_element: Element): void;
43
48
  beforeBeforeEnterAnimation(): void;
44
49
  finishedEnterAnimation(): void;
45
- enter(element: HTMLElement, done: any): void;
50
+ enter(element: any, done: () => void): void;
46
51
  getScrollOuterHeight(scrollElement: HTMLElement): number;
47
- leave(element: HTMLElement, done: any): void;
48
- afterLeave(element: HTMLElement): void;
49
- afterEnter(element: HTMLElement): void;
50
- enterCancelled(_element: HTMLElement): void;
51
- destroyed(): void;
52
- }
52
+ leave(element: any, done: () => void): void;
53
+ afterLeave(element: any): void;
54
+ afterEnter(element: any): void;
55
+ enterCancelled(_element: any): void;
56
+ }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("didPush" | "didPop" | "showDetail" | "present")[], "didPush" | "didPop" | "showDetail" | "present", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
57
+ root: {
58
+ required: true;
59
+ type: typeof ComponentWithProperties;
60
+ };
61
+ initialComponents: {
62
+ default: null;
63
+ type: PropType<ComponentWithProperties[] | null>;
64
+ };
65
+ animationType: {
66
+ default: string;
67
+ type: StringConstructor;
68
+ };
69
+ customProvide: {
70
+ type: ObjectConstructor;
71
+ default: null;
72
+ };
73
+ }>> & {
74
+ onDidPush?: ((...args: any[]) => any) | undefined;
75
+ onDidPop?: ((...args: any[]) => any) | undefined;
76
+ onShowDetail?: ((...args: any[]) => any) | undefined;
77
+ onPresent?: ((...args: any[]) => any) | undefined;
78
+ }, {
79
+ customProvide: Record<string, any>;
80
+ initialComponents: ComponentWithProperties[] | null;
81
+ animationType: string;
82
+ }, {}>;
83
+ export default _default;
@@ -1,48 +1,29 @@
1
- import { Vue } from "vue-property-decorator";
2
- import { ComponentWithProperties } from "..";
3
- import NavigationController from "./NavigationController.vue";
1
+ import { PushOptions } from './PushOptions';
2
+ import { default as Popup } from './Popup.vue';
4
3
  import { PopOptions } from './PopOptions';
5
- import Popup from "./Popup.vue";
6
- import { PushOptions } from "./PushOptions";
7
- import Sheet from "./Sheet.vue";
8
- import SideView from "./SideView.vue";
9
- import SplitViewController from "./SplitViewController.vue";
10
- export declare class NavigationMixin extends Vue {
11
- emitParents(event: string, data: any): void;
12
- show(options: PushOptions | ComponentWithProperties): void;
13
- present(options: PushOptions | ComponentWithProperties): void;
14
- showDetail(options: PushOptions | ComponentWithProperties): void;
15
- /**
16
- * Call one of the pop listeners of a parent or grandparent. E.g. to go back in a navigation controller.
17
- * @param options Options that should get applied to the pop of the first parent that listens for the pop event
18
- */
19
- pop(options?: PopOptions): void;
20
- /**
21
- * Same as pop, but instead dismisses the first parent that was displayed as a modal
22
- * @param options Options that should get applied to the pop of the first modal navigation controller or popup that listens for the pop event
23
- */
24
- dismiss(options?: PopOptions): void;
25
- get navigationController(): NavigationController | null;
26
- get modalOrPopup(): NavigationController | Popup | Sheet | SideView | null;
27
- get modalNavigationController(): NavigationController | null;
28
- get splitViewController(): SplitViewController | null;
29
- /**
30
- * Return the first child of a parent that listens for the pop event
31
- */
32
- getPoppableParent(): any | null;
33
- /**
34
- * Whether the current navivation controller above this component can pop (it has more than one child). Excluding modal view controllers
35
- */
36
- canPop: boolean;
37
- canDismiss: boolean;
38
- activated(): void;
39
- beforeMount(): void;
40
- /**
41
- * Return the first navigation controller that can get popped, excluding the modal navigation controller and the stack component
42
- * Note: this shouldn't be a getter to disable vue caching getters
43
- */
44
- private getPoppableNavigationController;
45
- isFocused(): boolean;
46
- calculateCanPop(): boolean;
47
- calculateCanDismiss(): boolean;
48
- }
4
+ import { ComponentWithProperties } from './ComponentWithProperties';
5
+ import { DefineComponent, Ref } from 'vue';
6
+
7
+ export declare function usePop(): (options?: PopOptions) => void;
8
+ export declare function useShowDetail(): (options: PushOptions | ComponentWithProperties) => Promise<void>;
9
+ export declare function useShow(): (options: PushOptions | ComponentWithProperties) => Promise<void>;
10
+ export declare function usePresent(): (options: PushOptions | ComponentWithProperties) => Promise<void>;
11
+ export declare function useDismiss(): (options?: PopOptions) => Promise<void>;
12
+ export declare function useCanPop(): Ref<boolean>;
13
+ export declare function useCanDismiss(): Ref<boolean>;
14
+ export declare function useFocused(): boolean | Ref<boolean>;
15
+ /**
16
+ * @returns To detect whether you are in a popup
17
+ */
18
+ export declare function usePopup(): Ref<InstanceType<typeof Popup> | null> | InstanceType<typeof Popup> | null;
19
+ export declare const NavigationMixin: DefineComponent<{}, {
20
+ show: ReturnType<typeof useShow>;
21
+ showDetail: ReturnType<typeof useShowDetail>;
22
+ present: ReturnType<typeof usePresent>;
23
+ pop: ReturnType<typeof usePop>;
24
+ dismiss: ReturnType<typeof useDismiss>;
25
+ canPop: ReturnType<typeof useCanPop>;
26
+ canDismiss: ReturnType<typeof useCanDismiss>;
27
+ isFocused: ReturnType<typeof useFocused>;
28
+ popup: ReturnType<typeof usePopup>;
29
+ }>;
@@ -0,0 +1,5 @@
1
+ import { App } from 'vue';
2
+
3
+ export declare const VueAppNavigationPlugin: {
4
+ install(app: App): void;
5
+ };
@@ -1,17 +1,37 @@
1
- import { ComponentWithProperties } from "./ComponentWithProperties";
2
1
  import { PopOptions } from './PopOptions';
3
- import { ModalMixin } from './ModalMixin';
4
- export default class Popup extends ModalMixin {
2
+ import { ComponentWithProperties } from './ComponentWithProperties';
3
+
4
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
5
  root: ComponentWithProperties;
6
6
  className: string;
7
- get buildClass(): string;
8
- get shouldAppear(): boolean;
9
- get pushDown(): 1 | 0 | 2;
10
- get isFocused(): boolean;
11
- onClick(event: any): void;
12
- activated(): void;
13
- deactivated(): void;
14
- dismiss(options?: PopOptions): Promise<false | undefined>;
15
- onKey(event: any): void;
16
- shouldNavigateAway(): Promise<boolean>;
17
- }
7
+ }>, {
8
+ className: string;
9
+ }>, {
10
+ dismiss: import('vue').ShallowRef<(options?: PopOptions | undefined) => Promise<false | undefined>>;
11
+ pop: import('vue').ShallowRef<(options?: PopOptions | undefined) => Promise<false | undefined>>;
12
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
13
+ root: ComponentWithProperties;
14
+ className: string;
15
+ }>, {
16
+ className: string;
17
+ }>>>, {
18
+ className: string;
19
+ }, {}>;
20
+ export default _default;
21
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
22
+ type __VLS_TypePropsToRuntimeProps<T> = {
23
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
24
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
25
+ } : {
26
+ type: import('vue').PropType<T[K]>;
27
+ required: true;
28
+ };
29
+ };
30
+ type __VLS_WithDefaults<P, D> = {
31
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
32
+ default: D[K];
33
+ }> : P[K];
34
+ };
35
+ type __VLS_Prettify<T> = {
36
+ [K in keyof T]: T[K];
37
+ } & {};
@@ -1,4 +1,5 @@
1
- import { ComponentWithProperties, ModalDisplayStyle } from "./ComponentWithProperties";
1
+ import { ComponentWithProperties, ModalDisplayStyle } from './ComponentWithProperties';
2
+
2
3
  export interface PushOptions {
3
4
  /**
4
5
  * Insert one or multiple components. Only the last one is animated if animations are required