@simonbackx/vue-app-navigation 2.17.2 → 2.17.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/dist/index.js CHANGED
@@ -478,6 +478,9 @@ class HistoryManagerStatic {
478
478
  * Return to a given history point in time, if needed
479
479
  */
480
480
  returnToHistoryIndex(counter) {
481
+ if (counter < 0) {
482
+ counter = 0;
483
+ }
481
484
  if (this.debug) {
482
485
  console.log("Did return to history index " + counter + ", coming from " + this.counter);
483
486
  }
@@ -1823,7 +1826,7 @@ function useNavigate() {
1823
1826
  url,
1824
1827
  adjustHistory: (options == null ? void 0 : options.adjustHistory) ?? true,
1825
1828
  animated: (options == null ? void 0 : options.animated) ?? true,
1826
- modalDisplayStyle: "present" in route && typeof route.present === "string" ? route.present : void 0,
1829
+ modalDisplayStyle: route.present && typeof route.present === "string" ? route.present : void 0,
1827
1830
  checkRoutes: (options == null ? void 0 : options.checkRoutes) ?? false,
1828
1831
  componentProperties: await componentProperties
1829
1832
  });
@@ -2,7 +2,7 @@ import { UrlMatchResult, UrlParamsConstructors } from './UrlHelper';
2
2
  import { PushOptions } from '../PushOptions';
3
3
  import { PopOptions } from '../PopOptions';
4
4
  import { HistoryUrl } from '../HistoryManager';
5
- import { ComponentWithProperties } from '../ComponentWithProperties';
5
+ import { ComponentWithProperties, ModalDisplayStyle } from '../ComponentWithProperties';
6
6
  import { Component, Ref } from 'vue';
7
7
 
8
8
  export type Route<Params> = {
@@ -11,7 +11,7 @@ export type Route<Params> = {
11
11
  params?: UrlParamsConstructors<Params>;
12
12
  query?: UrlParamsConstructors<unknown>;
13
13
  component: Component | (() => Promise<Component>) | 'self';
14
- present?: 'popup' | 'sheet' | true;
14
+ present?: ModalDisplayStyle | true;
15
15
  show?: true | 'detail';
16
16
  isDefault?: RouteNavigationOptions<Params>;
17
17
  paramsToProps?: (params: Params, query?: URLSearchParams) => Promise<Record<string, unknown>> | Record<string, unknown>;
@@ -27,11 +27,12 @@ export type Route<Params> = {
27
27
  url: string;
28
28
  params?: UrlParamsConstructors<Params>;
29
29
  query?: UrlParamsConstructors<unknown>;
30
+ present?: ModalDisplayStyle | true;
30
31
  handler: (options: {
31
32
  url: string;
32
33
  adjustHistory: boolean;
33
34
  animated: boolean;
34
- modalDisplayStyle: string | undefined;
35
+ modalDisplayStyle: ModalDisplayStyle | undefined;
35
36
  checkRoutes: boolean;
36
37
  componentProperties: Record<string, unknown>;
37
38
  }) => Promise<void>;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@simonbackx/vue-app-navigation",
3
3
  "main": "./dist/index.js",
4
4
  "types": "./dist/index.d.ts",
5
- "version": "2.17.2",
5
+ "version": "2.17.4",
6
6
  "exports": {
7
7
  ".": {
8
8
  "import": "./dist/index.js",