@simonbackx/vue-app-navigation 1.23.0 → 1.23.4

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@simonbackx/vue-app-navigation",
3
3
  "main": "./dist/main.js",
4
4
  "types": "./dist/index.d.ts",
5
- "version": "1.23.0",
5
+ "version": "1.23.4",
6
6
  "sideEffects": [
7
7
  "*.vue",
8
8
  "*.css"
@@ -15,31 +15,32 @@
15
15
  "dist"
16
16
  ],
17
17
  "devDependencies": {
18
- "@typescript-eslint/eslint-plugin": "^2.28.0",
19
- "@typescript-eslint/parser": "^2.28.0",
18
+ "@typescript-eslint/eslint-plugin": "^5.8.1",
19
+ "@typescript-eslint/parser": "^5.8.1",
20
20
  "clean-webpack-plugin": "^3.0.0",
21
- "css-loader": "^5.0.1",
21
+ "css-loader": "^6.5.1",
22
22
  "eslint": "^7.32.0",
23
23
  "eslint-plugin-jest": "^24.3",
24
24
  "eslint-plugin-simple-import-sort": "^7.0.0",
25
25
  "eslint-plugin-vue": "^7.16.0",
26
+ "fork-ts-checker-webpack-plugin": "^6.5.0",
26
27
  "friendly-errors-webpack-plugin": "^1.7.0",
27
- "mini-css-extract-plugin": "^1.3.4",
28
+ "mini-css-extract-plugin": "^2.4.5",
28
29
  "sass": "^1.32.4",
29
30
  "sass-loader": "^10.1.1",
30
- "ts-loader": "^8.0.14",
31
- "typescript": "^4.1.3",
32
- "vue": "^2.6.12",
31
+ "ts-loader": "^9.2.6",
32
+ "typescript": "^4.5.4",
33
+ "vue": "^2.6.14",
33
34
  "vue-class-component": "^7.2.6",
34
- "vue-loader": "^15.9.6",
35
+ "vue-loader": "15.9.8",
35
36
  "vue-property-decorator": "^9.1.2",
36
- "vue-template-compiler": "^2.6.12",
37
- "webpack": "^5.15.0",
38
- "webpack-cli": "^4.3.1"
37
+ "vue-template-compiler": "^2.6.14",
38
+ "webpack": "^5.65.0",
39
+ "webpack-cli": "^4.9.1"
39
40
  },
40
41
  "peerDependencies": {
41
- "vue": "^2.6.12",
42
- "vue-class-component": "^7.0.2",
42
+ "vue": "^2.6.14",
43
+ "vue-class-component": "^7.2.6",
43
44
  "vue-property-decorator": "^9.1.2"
44
45
  }
45
46
  }
package/dist/index.d.ts DELETED
@@ -1,14 +0,0 @@
1
- export * from "./src/ComponentWithProperties";
2
- export { default as ComponentWithPropertiesInstance } from "./src/ComponentWithPropertiesInstance";
3
- export { default as FramedComponent } from "./src/FramedComponent.vue";
4
- export { default as ModalStackComponent } from "./src/ModalStackComponent.vue";
5
- export { default as NavigationController } from "./src/NavigationController.vue";
6
- export * from "./src/NavigationMixin";
7
- export { default as Popup } from "./src/Popup.vue";
8
- export { default as Sheet } from "./src/Sheet.vue";
9
- export { default as SideView } from "./src/SideView.vue";
10
- export { default as SplitViewController } from "./src/SplitViewController.vue";
11
- export { default as StackComponent } from "./src/StackComponent.vue";
12
- export * from "./src/HistoryManager";
13
- export * from "./src/PopOptions";
14
- export * from "./src/PushOptions";
@@ -1,37 +0,0 @@
1
- import { VNode } from "vue";
2
- export declare type ModalDisplayStyle = "cover" | "popup" | "overlay" | "sheet" | "side-view";
3
- export declare class ComponentWithProperties {
4
- component: any;
5
- properties: Record<string, any>;
6
- key: number | null;
7
- type: string | null;
8
- hide: boolean;
9
- vnode: VNode | null;
10
- keepAlive: boolean;
11
- isKeptAlive: boolean;
12
- isMounted: boolean;
13
- static keepAliveCounter: number;
14
- static keyCounter: number;
15
- static debug: boolean;
16
- modalDisplayStyle: ModalDisplayStyle;
17
- animated: boolean;
18
- historyIndex: number | null;
19
- isContainerView: boolean;
20
- private static ignoreActivate;
21
- constructor(component: any, properties?: Record<string, any>);
22
- beforeMount(): void;
23
- getHistoryIndex(): number | null | undefined;
24
- mounted(): void;
25
- onMountedChildComponent(child: ComponentWithProperties): void;
26
- onActivatedChildComponent(child: ComponentWithProperties): void;
27
- /**
28
- * Call this method to assign a history index to this component (you should only call this when you want to assign a history index to this component that will not get mounted already)
29
- */
30
- assignHistoryIndex(): void;
31
- activated(): void;
32
- componentInstance(): Vue | undefined;
33
- shouldNavigateAway(): Promise<boolean>;
34
- destroy(): void;
35
- setDisplayStyle(style: ModalDisplayStyle): ComponentWithProperties;
36
- setAnimated(animated: boolean): ComponentWithProperties;
37
- }
@@ -1,6 +0,0 @@
1
- import Vue from "vue";
2
- import { ComponentWithProperties } from "./ComponentWithProperties";
3
- declare const ComponentWithPropertiesInstance: import("vue/types/vue").ExtendedVue<Vue, unknown, unknown, unknown, {
4
- component: ComponentWithProperties;
5
- }>;
6
- export default ComponentWithPropertiesInstance;
@@ -1,8 +0,0 @@
1
- import { Vue } from "vue-property-decorator";
2
- import { ComponentWithProperties } from "./ComponentWithProperties";
3
- export default class FramedComponent extends Vue {
4
- root: ComponentWithProperties;
5
- scrollContainer: HTMLElement;
6
- pop(data: any): void;
7
- push(data: any): void;
8
- }
@@ -1,31 +0,0 @@
1
- declare type HistoryState = {
2
- url?: string;
3
- index: number;
4
- adjustHistory: boolean;
5
- undoAction?: (animate: boolean) => void;
6
- };
7
- declare class HistoryManagerStatic {
8
- states: HistoryState[];
9
- counter: number;
10
- active: boolean;
11
- animateHistoryPop: boolean;
12
- isAdjustingState: boolean;
13
- manualStateAction: boolean;
14
- /**
15
- * Sometimes we need to set an URL when the history api is already popping the state (async!). Then it is not possible
16
- * to set the URL. To fix this, we need to delay the replaceState until after the state is popped.
17
- */
18
- delayedUrlSetting: {
19
- url: string;
20
- counter: number;
21
- } | null;
22
- setUrl(url: string): void;
23
- pushState(url: string | undefined, undoAction: (animate: boolean) => void, adjustHistory: boolean): void;
24
- /**
25
- * Return to a given history point in time, if needed
26
- */
27
- returnToHistoryIndex(counter: number): number;
28
- activate(): void;
29
- }
30
- export declare const HistoryManager: HistoryManagerStatic;
31
- export {};
@@ -1,15 +0,0 @@
1
- import { Vue } from "vue-property-decorator";
2
- import ModalStackComponent from "./ModalStackComponent.vue";
3
- import { PopOptions } from "./PopOptions";
4
- export declare class ModalMixin extends Vue {
5
- get modalStackComponent(): ModalStackComponent | null;
6
- /**
7
- * Call one of the pop listeners of a parent or grandparent. E.g. to go back in a navigation controller.
8
- * @param options Options that should get applied to the pop of the first parent that listens for the pop event
9
- */
10
- pop(options?: PopOptions): void;
11
- /**
12
- * Return the first child of a parent that listens for the pop event
13
- */
14
- getPoppableParent(): any | null;
15
- }
@@ -1,13 +0,0 @@
1
- import { Vue } from "vue-property-decorator";
2
- import { ComponentWithProperties } from "./ComponentWithProperties";
3
- import StackComponent from "./StackComponent.vue";
4
- import { PushOptions } from "./PushOptions";
5
- export default class ModalStackComponent extends Vue {
6
- readonly root: ComponentWithProperties;
7
- stackComponent: StackComponent;
8
- present(options: PushOptions): void;
9
- /**
10
- * @deprecated
11
- */
12
- replace(component: ComponentWithProperties, animated?: boolean): void;
13
- }
@@ -1,52 +0,0 @@
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 {
7
- components: ComponentWithProperties[];
8
- mainComponent: ComponentWithProperties | null;
9
- transitionName: string;
10
- savedScrollPositions: number[];
11
- nextScrollPosition: number;
12
- previousScrollPosition: number;
13
- nextInternalScrollPosition: number;
14
- savedInternalScrollPositions: number[];
15
- root: ComponentWithProperties;
16
- initialComponents: ComponentWithProperties[] | null;
17
- animationType: string;
18
- child: FramedComponent;
19
- beforeMount(): void;
20
- freezeSize(): void;
21
- growSize(width: number, height: number): void;
22
- unfreezeSize(): void;
23
- getInternalScrollElement(element?: HTMLElement | null): HTMLElement | null;
24
- getScrollElement(element?: HTMLElement | null): HTMLElement;
25
- 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
- push(options: PushOptions): Promise<void>;
31
- /**
32
- * Whether user interaction might prevent destructive navigation away from components.
33
- */
34
- shouldNavigateAway(): Promise<boolean>;
35
- popToRoot(options?: PopOptions): Promise<ComponentWithProperties[] | undefined>;
36
- getPoppableParent(): any | null;
37
- /**
38
- * force: whether "shouldNavigateAway" of child components is ignored
39
- */
40
- pop(options?: PopOptions): Promise<ComponentWithProperties[] | undefined>;
41
- beforeEnter(insertedElement: HTMLElement): void;
42
- beforeLeave(_element: HTMLElement): void;
43
- beforeBeforeEnterAnimation(): void;
44
- finishedEnterAnimation(): void;
45
- enter(element: HTMLElement, done: any): void;
46
- 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
- }
@@ -1,46 +0,0 @@
1
- import { Vue } from "vue-property-decorator";
2
- import { ComponentWithProperties } from "..";
3
- import NavigationController from "./NavigationController.vue";
4
- 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
- /**
40
- * Return the first navigation controller that can get popped, excluding the modal navigation controller and the stack component
41
- */
42
- private get poppableNavigationController();
43
- isFocused(): boolean;
44
- calculateCanPop(): boolean;
45
- calculateCanDismiss(): boolean;
46
- }
@@ -1,25 +0,0 @@
1
- export interface PopOptions {
2
- /**
3
- * Use animations if possible. Default to true.
4
- */
5
- animated?: boolean;
6
- /**
7
- * Whether the "shouldNavigateAway" popped components will get called and respected. Set force to true to ignore
8
- * shouldNavigateAway. Most of the time you'll need to set this to true for programmatic navigation (e.g. as a result of an API call).
9
- * Set to false (= default) for user interaction (e.g. when he pressed the close button, when he tapped outside a popup, pressed the ESC key)
10
- */
11
- force?: boolean;
12
- /**
13
- * Default behaviour should be 'true'. Set to true to indicate that the popped component(s) should get removed from the
14
- * vdom. If you set this to false, they will be kept in memory. This will set keepAlive to 'true' for the removed
15
- * components, making it possible to move them around in the DOM.
16
- */
17
- destroy?: boolean;
18
- /**
19
- * How many components you need to pop on the same level. E.g. to pop multiple components from a navigation controller.
20
- * This doesn't work across modal controllers, specifying 2 will only pop 1 component if the parent navigation controller
21
- * only has one child component.
22
- * Default to 1.
23
- */
24
- count?: number;
25
- }
@@ -1,16 +0,0 @@
1
- import { ComponentWithProperties } from "./ComponentWithProperties";
2
- import { PopOptions } from './PopOptions';
3
- import { ModalMixin } from './ModalMixin';
4
- export default class Popup extends ModalMixin {
5
- root: ComponentWithProperties;
6
- sticky: boolean;
7
- get shouldAppear(): boolean;
8
- get pushDown(): 0 | 1 | 2;
9
- get isFocused(): boolean;
10
- activated(): void;
11
- deactivated(): void;
12
- dismiss(options?: PopOptions): Promise<false | undefined>;
13
- resize(): void;
14
- onKey(event: any): void;
15
- shouldNavigateAway(): Promise<boolean>;
16
- }
@@ -1,41 +0,0 @@
1
- import { ComponentWithProperties, ModalDisplayStyle } from "./ComponentWithProperties";
2
- export interface PushOptions {
3
- /**
4
- * Insert one or multiple components. Only the last one is animated if animations are required
5
- */
6
- components: ComponentWithProperties[];
7
- /**
8
- * The url for this new route.
9
- */
10
- url?: string;
11
- /**
12
- * Whether we should push a new real state in the browser history
13
- */
14
- adjustHistory?: boolean;
15
- /**
16
- * Use animations if possible. Default value is the animated property of ComponentWithProperties.
17
- * In the future, we might remove the animated property of ComponentWithProperties and enable animations by default here.
18
- */
19
- animated?: boolean;
20
- /**
21
- * Whether the "shouldNavigateAway" popped components will get called and respected. Set force to true to ignore
22
- * shouldNavigateAway. Most of the time you'll need to set this to true for programmatic navigation (e.g. as a result of an API call).
23
- * Set to false (= default) for user interaction (e.g. when he pressed the close button, when he tapped outside a popup, pressed the ESC key)
24
- */
25
- force?: boolean;
26
- /**
27
- * Default behaviour should be 'true'. Set to true to indicate that the popped component(s) should get removed from the
28
- * vdom. If you set this to false, they will be kept in memory. This will set keepAlive to 'true' for the removed
29
- * components, making it possible to move them around in the DOM.
30
- */
31
- destroy?: boolean;
32
- /**
33
- * How many components that need to be popped first (in the same animations, so the pop is invisible). Defaults to 0
34
- */
35
- replace?: number;
36
- /**
37
- * Reverse the animation if possible. Defaults to false
38
- */
39
- reverse?: boolean;
40
- modalDisplayStyle?: ModalDisplayStyle;
41
- }
@@ -1,13 +0,0 @@
1
- import { ComponentWithProperties } from "./ComponentWithProperties";
2
- import { PopOptions } from './PopOptions';
3
- import { ModalMixin } from './ModalMixin';
4
- export default class Sheet extends ModalMixin {
5
- root: ComponentWithProperties;
6
- get shouldAppear(): boolean;
7
- activated(): void;
8
- deactivated(): void;
9
- get isFocused(): boolean;
10
- dismiss(options?: PopOptions): Promise<false | undefined>;
11
- onKey(event: any): void;
12
- shouldNavigateAway(): Promise<boolean>;
13
- }
@@ -1,15 +0,0 @@
1
- import { ComponentWithProperties } from "./ComponentWithProperties";
2
- import { PopOptions } from './PopOptions';
3
- import { ModalMixin } from './ModalMixin';
4
- export default class SideView extends ModalMixin {
5
- root: ComponentWithProperties;
6
- get shouldAppear(): boolean;
7
- get pushDown(): 0 | 1 | 2;
8
- get isFocused(): boolean;
9
- activated(): void;
10
- deactivated(): void;
11
- dismiss(options?: PopOptions): Promise<false | undefined>;
12
- resize(): void;
13
- onKey(event: any): void;
14
- shouldNavigateAway(): Promise<boolean>;
15
- }
@@ -1,24 +0,0 @@
1
- import { Vue } from "vue-property-decorator";
2
- import { ComponentWithProperties } from "./ComponentWithProperties";
3
- import NavigationController from "./NavigationController.vue";
4
- import { PushOptions } from "./PushOptions";
5
- export default class SplitViewController extends Vue {
6
- root: ComponentWithProperties;
7
- detail: ComponentWithProperties | null;
8
- detailWidth?: string;
9
- navigationController: NavigationController;
10
- detailKeepAlive: Vue;
11
- masterElement: HTMLElement;
12
- detailKey: number | null;
13
- activated(): void;
14
- mounted(): void;
15
- deactivated(): void;
16
- onResize(): void;
17
- get lastIsDetail(): boolean;
18
- getScrollElement(element?: HTMLElement | null): HTMLElement;
19
- shouldNavigateAway(): Promise<boolean>;
20
- showDetail(options: PushOptions): Promise<boolean>;
21
- shouldCollapse(): boolean;
22
- collapse(): void;
23
- expand(): Promise<void>;
24
- }
@@ -1,8 +0,0 @@
1
- import { Vue } from "vue-property-decorator";
2
- import { ComponentWithProperties } from "./ComponentWithProperties";
3
- export default class StackComponent extends Vue {
4
- components: ComponentWithProperties[];
5
- show(component: ComponentWithProperties): void;
6
- removeAt(index: any, key: any): void;
7
- beforeDestroy(): void;
8
- }