UNPKG

@angular/common

Version:

Angular - commonly needed directives and services

1 lines 31.1 kB
{"version":3,"file":"_location-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/location/util.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/location/location_strategy.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/location/location.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Joins two parts of a URL with a slash if needed.\n *\n * @param start URL string\n * @param end URL string\n *\n *\n * @returns The joined URL string.\n */\nexport function joinWithSlash(start: string, end: string) {\n // If `start` is an empty string, return `end` as the result.\n if (!start) return end;\n // If `end` is an empty string, return `start` as the result.\n if (!end) return start;\n // If `start` ends with a slash, remove the leading slash from `end`.\n if (start.endsWith('/')) {\n return end.startsWith('/') ? start + end.slice(1) : start + end;\n }\n // If `start` doesn't end with a slash, add one if `end` doesn't start with a slash.\n return end.startsWith('/') ? start + end : `${start}/${end}`;\n}\n\n/**\n * Removes a trailing slash from a URL string if needed.\n * Looks for the first occurrence of either `#`, `?`, or the end of the\n * line as `/` characters and removes the trailing slash if one exists.\n *\n * @param url URL string.\n *\n * @returns The URL string, modified if needed.\n */\nexport function stripTrailingSlash(url: string): string {\n // Find the index of the first occurrence of `#`, `?`, or the end of the string.\n // This marks the start of the query string, fragment, or the end of the URL path.\n const pathEndIdx = url.search(/#|\\?|$/);\n // Check if the character before `pathEndIdx` is a trailing slash.\n // If it is, remove the trailing slash and return the modified URL.\n // Otherwise, return the URL as is.\n return url[pathEndIdx - 1] === '/' ? url.slice(0, pathEndIdx - 1) + url.slice(pathEndIdx) : url;\n}\n\n/**\n * Normalizes URL parameters by prepending with `?` if needed.\n *\n * @param params String of URL parameters.\n *\n * @returns The normalized URL parameters string.\n */\nexport function normalizeQueryParams(params: string): string {\n return params && params[0] !== '?' ? `?${params}` : params;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n DOCUMENT,\n Inject,\n inject,\n Injectable,\n InjectionToken,\n OnDestroy,\n Optional,\n} from '@angular/core';\n\nimport {LocationChangeListener, PlatformLocation} from './platform_location';\nimport {joinWithSlash, normalizeQueryParams} from './util';\n\n/**\n * Enables the `Location` service to read route state from the browser's URL.\n * Angular provides two strategies:\n * `HashLocationStrategy` and `PathLocationStrategy`.\n *\n * Applications should use the `Router` or `Location` services to\n * interact with application route state.\n *\n * For instance, `HashLocationStrategy` produces URLs like\n * <code class=\"no-auto-link\">http://example.com/#/foo</code>,\n * and `PathLocationStrategy` produces\n * <code class=\"no-auto-link\">http://example.com/foo</code> as an equivalent URL.\n *\n * See these two classes for more.\n *\n * @publicApi\n */\n@Injectable({providedIn: 'root', useFactory: () => inject(PathLocationStrategy)})\nexport abstract class LocationStrategy {\n abstract path(includeHash?: boolean): string;\n abstract prepareExternalUrl(internal: string): string;\n abstract getState(): unknown;\n abstract pushState(state: any, title: string, url: string, queryParams: string): void;\n abstract replaceState(state: any, title: string, url: string, queryParams: string): void;\n abstract forward(): void;\n abstract back(): void;\n historyGo?(relativePosition: number): void {\n throw new Error(ngDevMode ? 'Not implemented' : '');\n }\n abstract onPopState(fn: LocationChangeListener): void;\n abstract getBaseHref(): string;\n}\n\n/**\n * A predefined DI token for the base href\n * to be used with the `PathLocationStrategy`.\n * The base href is the URL prefix that should be preserved when generating\n * and recognizing URLs.\n *\n * @usageNotes\n *\n * The following example shows how to use this token to configure the root app injector\n * with a base href value, so that the DI framework can supply the dependency anywhere in the app.\n *\n * ```ts\n * import {NgModule} from '@angular/core';\n * import {APP_BASE_HREF} from '@angular/common';\n *\n * @NgModule({\n * providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}]\n * })\n * class AppModule {}\n * ```\n *\n * @publicApi\n */\nexport const APP_BASE_HREF = new InjectionToken<string>(\n typeof ngDevMode !== 'undefined' && ngDevMode ? 'appBaseHref' : '',\n);\n\n/**\n * @description\n * A {@link LocationStrategy} used to configure the {@link Location} service to\n * represent its state in the\n * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the\n * browser's URL.\n *\n * If you're using `PathLocationStrategy`, you may provide a {@link APP_BASE_HREF}\n * or add a `<base href>` element to the document to override the default.\n *\n * For instance, if you provide an `APP_BASE_HREF` of `'/my/app/'` and call\n * `location.go('/foo')`, the browser's URL will become\n * `example.com/my/app/foo`. To ensure all relative URIs resolve correctly,\n * the `<base href>` and/or `APP_BASE_HREF` should end with a `/`.\n *\n * Similarly, if you add `<base href='/my/app/'/>` to the document and call\n * `location.go('/foo')`, the browser's URL will become\n * `example.com/my/app/foo`.\n *\n * Note that when using `PathLocationStrategy`, neither the query nor\n * the fragment in the `<base href>` will be preserved, as outlined\n * by the [RFC](https://tools.ietf.org/html/rfc3986#section-5.2.2).\n *\n * To ensure that trailing slashes are always present or never present in the URL, use\n * {@link TrailingSlashPathLocationStrategy} or {@link NoTrailingSlashPathLocationStrategy}.\n *\n * @usageNotes\n *\n * ### Example\n *\n * {@example common/location/ts/path_location_component.ts region='LocationComponent'}\n *\n * @publicApi\n */\n@Injectable({providedIn: 'root'})\nexport class PathLocationStrategy extends LocationStrategy implements OnDestroy {\n private _baseHref: string;\n private _removeListenerFns: (() => void)[] = [];\n\n constructor(\n private _platformLocation: PlatformLocation,\n @Optional() @Inject(APP_BASE_HREF) href?: string,\n ) {\n super();\n\n this._baseHref =\n href ??\n this._platformLocation.getBaseHrefFromDOM() ??\n inject(DOCUMENT).location?.origin ??\n '';\n }\n\n /** @docs-private */\n ngOnDestroy(): void {\n while (this._removeListenerFns.length) {\n this._removeListenerFns.pop()!();\n }\n }\n\n override onPopState(fn: LocationChangeListener): void {\n this._removeListenerFns.push(\n this._platformLocation.onPopState(fn),\n this._platformLocation.onHashChange(fn),\n );\n }\n\n override getBaseHref(): string {\n return this._baseHref;\n }\n\n override prepareExternalUrl(internal: string): string {\n return joinWithSlash(this._baseHref, internal);\n }\n\n override path(includeHash: boolean = false): string {\n const pathname =\n this._platformLocation.pathname + normalizeQueryParams(this._platformLocation.search);\n const hash = this._platformLocation.hash;\n return hash && includeHash ? `${pathname}${hash}` : pathname;\n }\n\n override pushState(state: any, title: string, url: string, queryParams: string) {\n const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));\n this._platformLocation.pushState(state, title, externalUrl);\n }\n\n override replaceState(state: any, title: string, url: string, queryParams: string) {\n const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));\n this._platformLocation.replaceState(state, title, externalUrl);\n }\n\n override forward(): void {\n this._platformLocation.forward();\n }\n\n override back(): void {\n this._platformLocation.back();\n }\n\n override getState(): unknown {\n return this._platformLocation.getState();\n }\n\n override historyGo(relativePosition: number = 0): void {\n this._platformLocation.historyGo?.(relativePosition);\n }\n}\n\n/**\n * A `LocationStrategy` that ensures URLs never have a trailing slash.\n * This strategy only affects the URL written to the browser.\n * `Location.path()` and `Location.normalize()` will continue to strip trailing slashes when reading the URL.\n *\n * @publicApi\n */\n@Injectable({providedIn: 'root'})\nexport class NoTrailingSlashPathLocationStrategy extends PathLocationStrategy {\n override prepareExternalUrl(internal: string): string {\n const path = extractUrlPath(internal);\n if (path.endsWith('/') && path.length > 1) {\n internal = path.slice(0, -1) + internal.slice(path.length);\n }\n return super.prepareExternalUrl(internal);\n }\n}\n\n/**\n * A `LocationStrategy` that ensures URLs always have a trailing slash.\n * This strategy only affects the URL written to the browser.\n * `Location.path()` and `Location.normalize()` will continue to strip trailing slashes when reading the URL.\n *\n * @publicApi\n */\n@Injectable({providedIn: 'root'})\nexport class TrailingSlashPathLocationStrategy extends PathLocationStrategy {\n override prepareExternalUrl(internal: string): string {\n const path = extractUrlPath(internal);\n if (!path.endsWith('/')) {\n internal = path + '/' + internal.slice(path.length);\n }\n return super.prepareExternalUrl(internal);\n }\n}\n\nfunction extractUrlPath(url: string): string {\n const questionMarkOrHashIndex = url.search(/[?#]/);\n const pathEnd = questionMarkOrHashIndex > -1 ? questionMarkOrHashIndex : url.length;\n return url.slice(0, pathEnd);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injectable, OnDestroy, ɵɵinject} from '@angular/core';\nimport {Subject, SubscriptionLike} from 'rxjs';\n\nimport {LocationStrategy} from './location_strategy';\nimport {joinWithSlash, normalizeQueryParams, stripTrailingSlash} from './util';\n\n/** @publicApi */\nexport interface PopStateEvent {\n pop?: boolean;\n state?: any;\n type?: string;\n url?: string;\n}\n\n/**\n * @description\n *\n * A service that applications can use to interact with a browser's URL.\n *\n * Depending on the `LocationStrategy` used, `Location` persists\n * to the URL's path or the URL's hash segment.\n *\n * @usageNotes\n *\n * It's better to use the `Router.navigate()` service to trigger route changes. Use\n * `Location` only if you need to interact with or create normalized URLs outside of\n * routing.\n *\n * `Location` is responsible for normalizing the URL against the application's base href.\n * A normalized URL is absolute from the URL host, includes the application's base href, and has no\n * trailing slash:\n * - `/my/app/user/123` is normalized\n * - `my/app/user/123` **is not** normalized\n * - `/my/app/user/123/` **is not** normalized\n *\n * ### Example\n *\n * {@example common/location/ts/path_location_component.ts region='LocationComponent'}\n *\n * @publicApi\n */\n@Injectable({\n providedIn: 'root',\n // See #23917\n useFactory: createLocation,\n})\nexport class Location implements OnDestroy {\n /** @internal */\n _subject = new Subject<PopStateEvent>();\n /** @internal */\n _basePath: string;\n /** @internal */\n _locationStrategy: LocationStrategy;\n /** @internal */\n _urlChangeListeners: ((url: string, state: unknown) => void)[] = [];\n /** @internal */\n _urlChangeSubscription: SubscriptionLike | null = null;\n\n constructor(locationStrategy: LocationStrategy) {\n this._locationStrategy = locationStrategy;\n const baseHref = this._locationStrategy.getBaseHref();\n // Note: This class's interaction with base HREF does not fully follow the rules\n // outlined in the spec https://www.freesoft.org/CIE/RFC/1808/18.htm.\n // Instead of trying to fix individual bugs with more and more code, we should\n // investigate using the URL constructor and providing the base as a second\n // argument.\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/URL#parameters\n this._basePath = _stripOrigin(stripTrailingSlash(_stripIndexHtml(baseHref)));\n this._locationStrategy.onPopState((ev) => {\n this._subject.next({\n 'url': this.path(true),\n 'pop': true,\n 'state': ev.state,\n 'type': ev.type,\n });\n });\n }\n\n /** @docs-private */\n ngOnDestroy(): void {\n this._urlChangeSubscription?.unsubscribe();\n this._urlChangeListeners = [];\n }\n\n /**\n * Normalizes the URL path for this location.\n *\n * @param includeHash True to include an anchor fragment in the path.\n *\n * @returns The normalized URL path.\n */\n // TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is\n // removed.\n path(includeHash: boolean = false): string {\n return this.normalize(this._locationStrategy.path(includeHash));\n }\n\n /**\n * Reports the current state of the location history.\n * @returns The current value of the `history.state` object.\n */\n getState(): unknown {\n return this._locationStrategy.getState();\n }\n\n /**\n * Normalizes the given path and compares to the current normalized path.\n *\n * @param path The given URL path.\n * @param query Query parameters.\n *\n * @returns True if the given URL path is equal to the current normalized path, false\n * otherwise.\n */\n isCurrentPathEqualTo(path: string, query: string = ''): boolean {\n return this.path() == this.normalize(path + normalizeQueryParams(query));\n }\n\n /**\n * Normalizes a URL path by stripping any trailing slashes.\n *\n * @param url String representing a URL.\n *\n * @returns The normalized URL string.\n */\n normalize(url: string): string {\n return Location.stripTrailingSlash(_stripBasePath(this._basePath, _stripIndexHtml(url)));\n }\n\n /**\n * Normalizes an external URL path.\n * If the given URL doesn't begin with a leading slash (`'/'`), adds one\n * before normalizing. Adds a hash if `HashLocationStrategy` is\n * in use, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.\n *\n * @param url String representing a URL.\n *\n * @returns A normalized platform-specific URL.\n */\n prepareExternalUrl(url: string): string {\n if (url && url[0] !== '/') {\n url = '/' + url;\n }\n return this._locationStrategy.prepareExternalUrl(url);\n }\n\n // TODO: rename this method to pushState\n /**\n * Changes the browser's URL to a normalized version of a given URL, and pushes a\n * new item onto the platform's history.\n *\n * @param path URL path to normalize.\n * @param query Query parameters.\n * @param state Location history state.\n *\n */\n go(path: string, query: string = '', state: any = null): void {\n this._locationStrategy.pushState(state, '', path, query);\n this._notifyUrlChangeListeners(\n this.prepareExternalUrl(path + normalizeQueryParams(query)),\n state,\n );\n }\n\n /**\n * Changes the browser's URL to a normalized version of the given URL, and replaces\n * the top item on the platform's history stack.\n *\n * @param path URL path to normalize.\n * @param query Query parameters.\n * @param state Location history state.\n */\n replaceState(path: string, query: string = '', state: any = null): void {\n this._locationStrategy.replaceState(state, '', path, query);\n this._notifyUrlChangeListeners(\n this.prepareExternalUrl(path + normalizeQueryParams(query)),\n state,\n );\n }\n\n /**\n * Navigates forward in the platform's history.\n */\n forward(): void {\n this._locationStrategy.forward();\n }\n\n /**\n * Navigates back in the platform's history.\n */\n back(): void {\n this._locationStrategy.back();\n }\n\n /**\n * Navigate to a specific page from session history, identified by its relative position to the\n * current page.\n *\n * @param relativePosition Position of the target page in the history relative to the current\n * page.\n * A negative value moves backwards, a positive value moves forwards, e.g. `location.historyGo(2)`\n * moves forward two pages and `location.historyGo(-2)` moves back two pages. When we try to go\n * beyond what's stored in the history session, we stay in the current page. Same behaviour occurs\n * when `relativePosition` equals 0.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/History_API#Moving_to_a_specific_point_in_history\n */\n historyGo(relativePosition: number = 0): void {\n this._locationStrategy.historyGo?.(relativePosition);\n }\n\n /**\n * Registers a URL change listener. Use to catch updates performed by the Angular\n * framework that are not detectible through \"popstate\" or \"hashchange\" events.\n *\n * @param fn The change handler function, which take a URL and a location history state.\n * @returns A function that, when executed, unregisters a URL change listener.\n */\n onUrlChange(fn: (url: string, state: unknown) => void): VoidFunction {\n this._urlChangeListeners.push(fn);\n\n this._urlChangeSubscription ??= this.subscribe((v) => {\n this._notifyUrlChangeListeners(v.url, v.state);\n });\n\n return () => {\n const fnIndex = this._urlChangeListeners.indexOf(fn);\n this._urlChangeListeners.splice(fnIndex, 1);\n\n if (this._urlChangeListeners.length === 0) {\n this._urlChangeSubscription?.unsubscribe();\n this._urlChangeSubscription = null;\n }\n };\n }\n\n /** @internal */\n _notifyUrlChangeListeners(url: string = '', state: unknown) {\n this._urlChangeListeners.forEach((fn) => fn(url, state));\n }\n\n /**\n * Subscribes to the platform's `popState` events.\n *\n * Note: `Location.go()` does not trigger the `popState` event in the browser. Use\n * `Location.onUrlChange()` to subscribe to URL changes instead.\n *\n * @param value Event that is triggered when the state history changes.\n * @param exception The exception to throw.\n *\n * @see [onpopstate](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate)\n *\n * @returns Subscribed events.\n */\n subscribe(\n onNext: (value: PopStateEvent) => void,\n onThrow?: ((exception: any) => void) | null,\n onReturn?: (() => void) | null,\n ): SubscriptionLike {\n return this._subject.subscribe({\n next: onNext,\n error: onThrow ?? undefined,\n complete: onReturn ?? undefined,\n });\n }\n\n /**\n * Normalizes URL parameters by prepending with `?` if needed.\n *\n * @param params String of URL parameters.\n *\n * @returns The normalized URL parameters string.\n */\n public static normalizeQueryParams: (params: string) => string = normalizeQueryParams;\n\n /**\n * Joins two parts of a URL with a slash if needed.\n *\n * @param start URL string\n * @param end URL string\n *\n *\n * @returns The joined URL string.\n */\n public static joinWithSlash: (start: string, end: string) => string = joinWithSlash;\n\n /**\n * Removes a trailing slash from a URL string if needed.\n * Looks for the first occurrence of either `#`, `?`, or the end of the\n * line as `/` characters and removes the trailing slash if one exists.\n *\n * @param url URL string.\n *\n * @returns The URL string, modified if needed.\n */\n public static stripTrailingSlash: (url: string) => string = stripTrailingSlash;\n}\n\nexport function createLocation() {\n return new Location(ɵɵinject(LocationStrategy as any));\n}\n\nfunction _stripBasePath(basePath: string, url: string): string {\n if (!basePath || !url.startsWith(basePath)) {\n return url;\n }\n const strippedUrl = url.substring(basePath.length);\n if (strippedUrl === '' || ['/', ';', '?', '#'].includes(strippedUrl[0])) {\n return strippedUrl;\n }\n return url;\n}\n\nfunction _stripIndexHtml(url: string): string {\n return url.replace(/\\/index\\.html$/, '');\n}\n\nfunction _stripOrigin(baseHref: string): string {\n // DO NOT REFACTOR! Previously, this check looked like this:\n // `/^(https?:)?\\/\\//.test(baseHref)`, but that resulted in\n // syntactically incorrect code after Closure Compiler minification.\n // This was likely caused by a bug in Closure Compiler, but\n // for now, the check is rewritten to use `new RegExp` instead.\n const isAbsoluteUrl = new RegExp('^(https?:)?//').test(baseHref);\n if (isAbsoluteUrl) {\n const [, pathname] = baseHref.split(/\\/\\/[^\\/]+/);\n return pathname;\n }\n return baseHref;\n}\n"],"names":["i1.LocationStrategy","ɵɵinject"],"mappings":";;;;;;;;;;;AAiBM,SAAU,aAAa,CAAC,KAAa,EAAE,GAAW,EAAA;AAEtD,EAAA,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG;AAEtB,EAAA,IAAI,CAAC,GAAG,EAAE,OAAO,KAAK;AAEtB,EAAA,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACvB,IAAA,OAAO,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,GAAG;AACjE,EAAA;AAEA,EAAA,OAAO,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG,GAAG,CAAA,EAAG,KAAK,CAAA,CAAA,EAAI,GAAG,CAAA,CAAE;AAC9D;AAWM,SAAU,kBAAkB,CAAC,GAAW,EAAA;AAG5C,EAAA,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;EAIvC,OAAO,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,KAAK,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,GAAG,C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