@simonbackx/vue-app-navigation 2.4.2 → 2.5.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/index.js CHANGED
@@ -705,6 +705,10 @@ const _ComponentWithProperties = class _ComponentWithProperties {
705
705
  ownsHistoryIndex() {
706
706
  return this.historyIndex !== null && _ComponentWithProperties.historyIndexOwners.get(this.historyIndex) === this;
707
707
  }
708
+ overrideUrl(url, title) {
709
+ this.provide.reactive_navigation_url = url;
710
+ this.setUrl(url, title);
711
+ }
708
712
  setUrl(url, title) {
709
713
  if (this.historyIndex === null) {
710
714
  if (_ComponentWithProperties.debug)
@@ -2146,6 +2150,12 @@ function setTitle(title) {
2146
2150
  urlHelpers.setTitle(title);
2147
2151
  });
2148
2152
  }
2153
+ function setUrl(url, title) {
2154
+ const urlHelpers = useUrl();
2155
+ onMounted(() => {
2156
+ urlHelpers.overrideUrl(url, title);
2157
+ });
2158
+ }
2149
2159
  function useUrl() {
2150
2160
  const currentComponent = useCurrentComponent();
2151
2161
  const navigationUrl = inject("reactive_navigation_url", null);
@@ -2184,6 +2194,16 @@ function useUrl() {
2184
2194
  matchCurrent(template, params) {
2185
2195
  const helper = new UrlHelper(void 0, this.getUrl());
2186
2196
  return helper.match(template, params);
2197
+ },
2198
+ overrideUrl(url, title) {
2199
+ if (!currentComponent) {
2200
+ console.error("No current component while setting title", title);
2201
+ return;
2202
+ }
2203
+ if (unref(disableUrl)) {
2204
+ return;
2205
+ }
2206
+ currentComponent == null ? void 0 : currentComponent.overrideUrl(url, title);
2187
2207
  }
2188
2208
  };
2189
2209
  }
@@ -2946,6 +2966,7 @@ export {
2946
2966
  onNotCheckRoutes,
2947
2967
  setTitle,
2948
2968
  setTitleSuffix,
2969
+ setUrl,
2949
2970
  templateToUrl,
2950
2971
  useCanDismiss,
2951
2972
  useCanPop,
@@ -46,6 +46,7 @@ export declare class ComponentWithProperties {
46
46
  assignHistoryIndex(): void;
47
47
  inheritHistoryIndex(index: number): void;
48
48
  ownsHistoryIndex(): boolean;
49
+ overrideUrl(url: string, title?: string): void;
49
50
  setUrl(url: string, title?: string): void;
50
51
  setTitle(title: string): void;
51
52
  /**
@@ -66,6 +66,7 @@ export declare const ModalMixin: import('vue').DefineComponent<{}, {}, {}, {}, {
66
66
  assignHistoryIndex: () => void;
67
67
  inheritHistoryIndex: (index: number) => void;
68
68
  ownsHistoryIndex: () => boolean;
69
+ overrideUrl: (url: string, title?: string | undefined) => void;
69
70
  setUrl: (url: string, title?: string | undefined) => void;
70
71
  setTitle: (title: string) => void;
71
72
  returnToHistoryIndex: () => boolean;
@@ -136,6 +137,7 @@ export declare const ModalMixin: import('vue').DefineComponent<{}, {}, {}, {}, {
136
137
  assignHistoryIndex: () => void;
137
138
  inheritHistoryIndex: (index: number) => void;
138
139
  ownsHistoryIndex: () => boolean;
140
+ overrideUrl: (url: string, title?: string | undefined) => void;
139
141
  setUrl: (url: string, title?: string | undefined) => void;
140
142
  setTitle: (title: string) => void;
141
143
  returnToHistoryIndex: () => boolean;
@@ -440,6 +442,7 @@ export declare const ModalMixin: import('vue').DefineComponent<{}, {}, {}, {}, {
440
442
  assignHistoryIndex: () => void;
441
443
  inheritHistoryIndex: (index: number) => void;
442
444
  ownsHistoryIndex: () => boolean;
445
+ overrideUrl: (url: string, title?: string | undefined) => void;
443
446
  setUrl: (url: string, title?: string | undefined) => void;
444
447
  setTitle: (title: string) => void;
445
448
  returnToHistoryIndex: () => boolean;
@@ -510,6 +513,7 @@ export declare const ModalMixin: import('vue').DefineComponent<{}, {}, {}, {}, {
510
513
  assignHistoryIndex: () => void;
511
514
  inheritHistoryIndex: (index: number) => void;
512
515
  ownsHistoryIndex: () => boolean;
516
+ overrideUrl: (url: string, title?: string | undefined) => void;
513
517
  setUrl: (url: string, title?: string | undefined) => void;
514
518
  setTitle: (title: string) => void;
515
519
  returnToHistoryIndex: () => boolean;
@@ -65,6 +65,7 @@ declare const ModalStackComponent: import('vue').DefineComponent<{
65
65
  assignHistoryIndex: () => void;
66
66
  inheritHistoryIndex: (index: number) => void;
67
67
  ownsHistoryIndex: () => boolean;
68
+ overrideUrl: (url: string, title?: string | undefined) => void;
68
69
  setUrl: (url: string, title?: string | undefined) => void;
69
70
  setTitle: (title: string) => void;
70
71
  returnToHistoryIndex: () => boolean;
@@ -135,6 +136,7 @@ declare const ModalStackComponent: import('vue').DefineComponent<{
135
136
  assignHistoryIndex: () => void;
136
137
  inheritHistoryIndex: (index: number) => void;
137
138
  ownsHistoryIndex: () => boolean;
139
+ overrideUrl: (url: string, title?: string | undefined) => void;
138
140
  setUrl: (url: string, title?: string | undefined) => void;
139
141
  setTitle: (title: string) => void;
140
142
  returnToHistoryIndex: () => boolean;
@@ -45,6 +45,7 @@ declare const StackComponent: import('vue').DefineComponent<{}, {}, {
45
45
  assignHistoryIndex: () => void;
46
46
  inheritHistoryIndex: (index: number) => void;
47
47
  ownsHistoryIndex: () => boolean;
48
+ overrideUrl: (url: string, title?: string | undefined) => void;
48
49
  setUrl: (url: string, title?: string | undefined) => void;
49
50
  setTitle: (title: string) => void;
50
51
  returnToHistoryIndex: () => boolean;
@@ -86,6 +86,7 @@ export declare function useFocused(): boolean | Ref<boolean>;
86
86
  export declare function extendUrl(url: string | Ref<string>): void;
87
87
  export declare function setTitleSuffix(title: string): void;
88
88
  export declare function setTitle(title: string): void;
89
+ export declare function setUrl(url: string, title?: string): void;
89
90
  export declare function useUrl(): {
90
91
  getUrl(): string;
91
92
  /**
@@ -95,4 +96,5 @@ export declare function useUrl(): {
95
96
  extendUrl(url: string): string;
96
97
  match<Params>(template: string, params?: UrlParamsConstructors<Params>): UrlMatchResult<Params> | undefined;
97
98
  matchCurrent<Params_1>(template: string, params?: UrlParamsConstructors<Params_1> | undefined): UrlMatchResult<Params_1> | undefined;
99
+ overrideUrl(url: string, title?: string): void;
98
100
  };
@@ -129,6 +129,7 @@ declare const EditWebshopMixin_base: new (...args: any) => import('../src/class-
129
129
  assignHistoryIndex: () => void;
130
130
  inheritHistoryIndex: (index: number) => void;
131
131
  ownsHistoryIndex: () => boolean;
132
+ overrideUrl: (url: string, title?: string | undefined) => void;
132
133
  setUrl: (url: string, title?: string | undefined) => void;
133
134
  setTitle: (title: string) => void;
134
135
  returnToHistoryIndex: () => boolean;
@@ -199,6 +200,7 @@ declare const EditWebshopMixin_base: new (...args: any) => import('../src/class-
199
200
  assignHistoryIndex: () => void;
200
201
  inheritHistoryIndex: (index: number) => void;
201
202
  ownsHistoryIndex: () => boolean;
203
+ overrideUrl: (url: string, title?: string | undefined) => void;
202
204
  setUrl: (url: string, title?: string | undefined) => void;
203
205
  setTitle: (title: string) => void;
204
206
  returnToHistoryIndex: () => boolean;
@@ -503,6 +505,7 @@ declare const EditWebshopMixin_base: new (...args: any) => import('../src/class-
503
505
  assignHistoryIndex: () => void;
504
506
  inheritHistoryIndex: (index: number) => void;
505
507
  ownsHistoryIndex: () => boolean;
508
+ overrideUrl: (url: string, title?: string | undefined) => void;
506
509
  setUrl: (url: string, title?: string | undefined) => void;
507
510
  setTitle: (title: string) => void;
508
511
  returnToHistoryIndex: () => boolean;
@@ -573,6 +576,7 @@ declare const EditWebshopMixin_base: new (...args: any) => import('../src/class-
573
576
  assignHistoryIndex: () => void;
574
577
  inheritHistoryIndex: (index: number) => void;
575
578
  ownsHistoryIndex: () => boolean;
579
+ overrideUrl: (url: string, title?: string | undefined) => void;
576
580
  setUrl: (url: string, title?: string | undefined) => void;
577
581
  setTitle: (title: string) => void;
578
582
  returnToHistoryIndex: () => boolean;
@@ -1533,6 +1537,7 @@ declare const EditWebshopMixin_base: new (...args: any) => import('../src/class-
1533
1537
  extendUrl(url: string): string;
1534
1538
  match<Params>(template: string, params?: import('..').UrlParamsConstructors<Params> | undefined): import('..').UrlMatchResult<Params> | undefined;
1535
1539
  matchCurrent<Params_1>(template: string, params?: import('..').UrlParamsConstructors<Params_1> | undefined): import('..').UrlMatchResult<Params_1> | undefined;
1540
+ overrideUrl(url: string, title?: string | undefined): void;
1536
1541
  };
1537
1542
  $navigate: <Params_2 extends Record<string, unknown>>(prop1: string | import('..').Route<Params_2, unknown>, prop2?: import('..').RouteNavigationOptions<Params_2> | undefined) => Promise<void>;
1538
1543
  }, {}, {
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.4.2",
5
+ "version": "2.5.0",
6
6
  "exports": {
7
7
  ".": {
8
8
  "import": "./dist/index.js",