Primeiro commit do projeto Angular
This commit is contained in:
+4681
File diff suppressed because it is too large
Load Diff
+1
File diff suppressed because one or more lines are too long
+1621
File diff suppressed because it is too large
Load Diff
+1
File diff suppressed because one or more lines are too long
+34
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @license Angular v21.2.1
|
||||
* (c) 2010-2026 Google LLC. https://angular.dev/
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
export { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultTitleStrategy, DefaultUrlSerializer, EventType, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationCancellationCode, NavigationEnd, NavigationError, NavigationSkipped, NavigationSkippedCode, NavigationStart, OutletContext, PRIMARY_OUTLET, ROUTER_CONFIGURATION, ROUTER_OUTLET_DATA, ROUTES, RedirectCommand, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterOutlet, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, TitleStrategy, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, convertToParamMap, createUrlTreeFromSnapshot, defaultUrlMatcher, destroyDetachedRouteHandle, isActive, ɵEmptyOutletComponent, afterNextNavigation as ɵafterNextNavigation, loadChildren as ɵloadChildren } from './_router-chunk.mjs';
|
||||
export { NoPreloading, PreloadAllModules, PreloadingStrategy, ROUTER_INITIALIZER, RouterLink, RouterLinkActive, RouterLink as RouterLinkWithHref, RouterModule, RouterPreloader, provideRouter, provideRoutes, withComponentInputBinding, withDebugTracing, withDisabledInitialNavigation, withEnabledBlockingInitialNavigation, withExperimentalAutoCleanupInjectors, withExperimentalPlatformNavigation, withHashLocation, withInMemoryScrolling, withNavigationErrorHandler, withPreloading, withRouterConfig, withViewTransitions, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS } from './_router_module-chunk.mjs';
|
||||
import { inject, Version } from '@angular/core';
|
||||
import '@angular/common';
|
||||
import 'rxjs';
|
||||
import 'rxjs/operators';
|
||||
import '@angular/platform-browser';
|
||||
|
||||
function mapToCanMatch(providers) {
|
||||
return providers.map(provider => (...params) => inject(provider).canMatch(...params));
|
||||
}
|
||||
function mapToCanActivate(providers) {
|
||||
return providers.map(provider => (...params) => inject(provider).canActivate(...params));
|
||||
}
|
||||
function mapToCanActivateChild(providers) {
|
||||
return providers.map(provider => (...params) => inject(provider).canActivateChild(...params));
|
||||
}
|
||||
function mapToCanDeactivate(providers) {
|
||||
return providers.map(provider => (...params) => inject(provider).canDeactivate(...params));
|
||||
}
|
||||
function mapToResolve(provider) {
|
||||
return (...params) => inject(provider).resolve(...params);
|
||||
}
|
||||
|
||||
const VERSION = /* @__PURE__ */new Version('21.2.1');
|
||||
|
||||
export { VERSION, mapToCanActivate, mapToCanActivateChild, mapToCanDeactivate, mapToCanMatch, mapToResolve };
|
||||
//# sourceMappingURL=router.mjs.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"router.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/utils/functional_guards.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/version.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\nimport {inject, Type} from '@angular/core';\n\nimport {\n CanActivate,\n CanActivateChild,\n CanActivateChildFn,\n CanActivateFn,\n CanDeactivate,\n CanDeactivateFn,\n CanMatch,\n CanMatchFn,\n Resolve,\n ResolveFn,\n} from '../models';\n\n/**\n * Maps an array of injectable classes with canMatch functions to an array of equivalent\n * `CanMatchFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanMatch(providers: Array<Type<CanMatch>>): CanMatchFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canMatch(...params),\n );\n}\n\n/**\n * Maps an array of injectable classes with canActivate functions to an array of equivalent\n * `CanActivateFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanActivate(providers: Array<Type<CanActivate>>): CanActivateFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canActivate(...params),\n );\n}\n/**\n * Maps an array of injectable classes with canActivateChild functions to an array of equivalent\n * `CanActivateChildFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanActivateChild(\n providers: Array<Type<CanActivateChild>>,\n): CanActivateChildFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canActivateChild(...params),\n );\n}\n/**\n * Maps an array of injectable classes with canDeactivate functions to an array of equivalent\n * `CanDeactivateFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanDeactivate<T = unknown>(\n providers: Array<Type<CanDeactivate<T>>>,\n): CanDeactivateFn<T>[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canDeactivate(...params),\n );\n}\n/**\n * Maps an injectable class with a resolve function to an equivalent `ResolveFn`\n * for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='Resolve'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToResolve<T>(provider: Type<Resolve<T>>): ResolveFn<T> {\n return (...params) => inject(provider).resolve(...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\n/**\n * @module\n * @description\n * Entry point for all public APIs of the router package.\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = /* @__PURE__ */ new Version('21.2.1');\n"],"names":["mapToCanMatch","providers","map","provider","params","inject","canMatch","mapToCanActivate","canActivate","mapToCanActivateChild","canActivateChild","mapToCanDeactivate","canDeactivate","mapToResolve","resolve","VERSION","Version"],"mappings":";;;;;;;;;;;;;;AAgCM,SAAUA,aAAaA,CAACC,SAAgC,EAAA;EAC5D,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACG,QAAQ,CAAC,GAAGF,MAAM,CAAC,CACzC;AACH;AAWM,SAAUG,gBAAgBA,CAACN,SAAmC,EAAA;EAClE,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACK,WAAW,CAAC,GAAGJ,MAAM,CAAC,CAC5C;AACH;AAUM,SAAUK,qBAAqBA,CACnCR,SAAwC,EAAA;EAExC,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACO,gBAAgB,CAAC,GAAGN,MAAM,CAAC,CACjD;AACH;AAUM,SAAUO,kBAAkBA,CAChCV,SAAwC,EAAA;EAExC,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACS,aAAa,CAAC,GAAGR,MAAM,CAAC,CAC9C;AACH;AAUM,SAAUS,YAAYA,CAAIV,QAA0B,EAAA;AACxD,EAAA,OAAO,CAAC,GAAGC,MAAM,KAAKC,MAAM,CAACF,QAAQ,CAAC,CAACW,OAAO,CAAC,GAAGV,MAAM,CAAC;AAC3D;;ACpFO,MAAMW,OAAO,kBAAmB,IAAIC,OAAO,CAAC,mBAAmB;;;;"}
|
||||
+235
@@ -0,0 +1,235 @@
|
||||
/**
|
||||
* @license Angular v21.2.1
|
||||
* (c) 2010-2026 Google LLC. https://angular.dev/
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
import * as i0 from '@angular/core';
|
||||
import { NgModule, Injectable, signal, Component, ViewChild } from '@angular/core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ROUTES, ROUTER_CONFIGURATION, RouterOutlet, Router, afterNextNavigation } from './_router-chunk.mjs';
|
||||
export { ɵEmptyOutletComponent as ɵɵEmptyOutletComponent } from './_router-chunk.mjs';
|
||||
import { RouterModule, ROUTER_PROVIDERS, withPreloading, NoPreloading } from './_router_module-chunk.mjs';
|
||||
export { RouterLink as ɵɵRouterLink, RouterLinkActive as ɵɵRouterLinkActive } from './_router_module-chunk.mjs';
|
||||
import { provideLocationMocks } from '@angular/common/testing';
|
||||
import '@angular/common';
|
||||
import 'rxjs';
|
||||
import 'rxjs/operators';
|
||||
import '@angular/platform-browser';
|
||||
|
||||
class RouterTestingModule {
|
||||
static withRoutes(routes, config) {
|
||||
return {
|
||||
ngModule: RouterTestingModule,
|
||||
providers: [{
|
||||
provide: ROUTES,
|
||||
multi: true,
|
||||
useValue: routes
|
||||
}, {
|
||||
provide: ROUTER_CONFIGURATION,
|
||||
useValue: config ? config : {}
|
||||
}]
|
||||
};
|
||||
}
|
||||
static ɵfac = i0.ɵɵngDeclareFactory({
|
||||
minVersion: "12.0.0",
|
||||
version: "21.2.1",
|
||||
ngImport: i0,
|
||||
type: RouterTestingModule,
|
||||
deps: [],
|
||||
target: i0.ɵɵFactoryTarget.NgModule
|
||||
});
|
||||
static ɵmod = i0.ɵɵngDeclareNgModule({
|
||||
minVersion: "14.0.0",
|
||||
version: "21.2.1",
|
||||
ngImport: i0,
|
||||
type: RouterTestingModule,
|
||||
exports: [RouterModule]
|
||||
});
|
||||
static ɵinj = i0.ɵɵngDeclareInjector({
|
||||
minVersion: "12.0.0",
|
||||
version: "21.2.1",
|
||||
ngImport: i0,
|
||||
type: RouterTestingModule,
|
||||
providers: [ROUTER_PROVIDERS, provideLocationMocks(), withPreloading(NoPreloading).ɵproviders, {
|
||||
provide: ROUTES,
|
||||
multi: true,
|
||||
useValue: []
|
||||
}],
|
||||
imports: [RouterModule]
|
||||
});
|
||||
}
|
||||
i0.ɵɵngDeclareClassMetadata({
|
||||
minVersion: "12.0.0",
|
||||
version: "21.2.1",
|
||||
ngImport: i0,
|
||||
type: RouterTestingModule,
|
||||
decorators: [{
|
||||
type: NgModule,
|
||||
args: [{
|
||||
exports: [RouterModule],
|
||||
providers: [ROUTER_PROVIDERS, provideLocationMocks(), withPreloading(NoPreloading).ɵproviders, {
|
||||
provide: ROUTES,
|
||||
multi: true,
|
||||
useValue: []
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
});
|
||||
|
||||
class RootFixtureService {
|
||||
fixture;
|
||||
harness;
|
||||
createHarness() {
|
||||
if (this.harness) {
|
||||
throw new Error('Only one harness should be created per test.');
|
||||
}
|
||||
this.harness = new RouterTestingHarness(this.getRootFixture());
|
||||
return this.harness;
|
||||
}
|
||||
getRootFixture() {
|
||||
if (this.fixture !== undefined) {
|
||||
return this.fixture;
|
||||
}
|
||||
this.fixture = TestBed.createComponent(RootCmp);
|
||||
this.fixture.detectChanges();
|
||||
return this.fixture;
|
||||
}
|
||||
static ɵfac = i0.ɵɵngDeclareFactory({
|
||||
minVersion: "12.0.0",
|
||||
version: "21.2.1",
|
||||
ngImport: i0,
|
||||
type: RootFixtureService,
|
||||
deps: [],
|
||||
target: i0.ɵɵFactoryTarget.Injectable
|
||||
});
|
||||
static ɵprov = i0.ɵɵngDeclareInjectable({
|
||||
minVersion: "12.0.0",
|
||||
version: "21.2.1",
|
||||
ngImport: i0,
|
||||
type: RootFixtureService,
|
||||
providedIn: 'root'
|
||||
});
|
||||
}
|
||||
i0.ɵɵngDeclareClassMetadata({
|
||||
minVersion: "12.0.0",
|
||||
version: "21.2.1",
|
||||
ngImport: i0,
|
||||
type: RootFixtureService,
|
||||
decorators: [{
|
||||
type: Injectable,
|
||||
args: [{
|
||||
providedIn: 'root'
|
||||
}]
|
||||
}]
|
||||
});
|
||||
class RootCmp {
|
||||
outlet;
|
||||
routerOutletData = signal(undefined, ...(ngDevMode ? [{
|
||||
debugName: "routerOutletData"
|
||||
}] : []));
|
||||
static ɵfac = i0.ɵɵngDeclareFactory({
|
||||
minVersion: "12.0.0",
|
||||
version: "21.2.1",
|
||||
ngImport: i0,
|
||||
type: RootCmp,
|
||||
deps: [],
|
||||
target: i0.ɵɵFactoryTarget.Component
|
||||
});
|
||||
static ɵcmp = i0.ɵɵngDeclareComponent({
|
||||
minVersion: "14.0.0",
|
||||
version: "21.2.1",
|
||||
type: RootCmp,
|
||||
isStandalone: true,
|
||||
selector: "ng-component",
|
||||
viewQueries: [{
|
||||
propertyName: "outlet",
|
||||
first: true,
|
||||
predicate: RouterOutlet,
|
||||
descendants: true
|
||||
}],
|
||||
ngImport: i0,
|
||||
template: '<router-outlet [routerOutletData]="routerOutletData()"></router-outlet>',
|
||||
isInline: true,
|
||||
dependencies: [{
|
||||
kind: "directive",
|
||||
type: RouterOutlet,
|
||||
selector: "router-outlet",
|
||||
inputs: ["name", "routerOutletData"],
|
||||
outputs: ["activate", "deactivate", "attach", "detach"],
|
||||
exportAs: ["outlet"]
|
||||
}]
|
||||
});
|
||||
}
|
||||
i0.ɵɵngDeclareClassMetadata({
|
||||
minVersion: "12.0.0",
|
||||
version: "21.2.1",
|
||||
ngImport: i0,
|
||||
type: RootCmp,
|
||||
decorators: [{
|
||||
type: Component,
|
||||
args: [{
|
||||
template: '<router-outlet [routerOutletData]="routerOutletData()"></router-outlet>',
|
||||
imports: [RouterOutlet]
|
||||
}]
|
||||
}],
|
||||
propDecorators: {
|
||||
outlet: [{
|
||||
type: ViewChild,
|
||||
args: [RouterOutlet]
|
||||
}]
|
||||
}
|
||||
});
|
||||
class RouterTestingHarness {
|
||||
static async create(initialUrl) {
|
||||
const harness = TestBed.inject(RootFixtureService).createHarness();
|
||||
if (initialUrl !== undefined) {
|
||||
await harness.navigateByUrl(initialUrl);
|
||||
}
|
||||
return harness;
|
||||
}
|
||||
fixture;
|
||||
constructor(fixture) {
|
||||
this.fixture = fixture;
|
||||
}
|
||||
detectChanges() {
|
||||
this.fixture.detectChanges();
|
||||
}
|
||||
get routeDebugElement() {
|
||||
const outlet = this.fixture.componentInstance.outlet;
|
||||
if (!outlet || !outlet.isActivated) {
|
||||
return null;
|
||||
}
|
||||
return this.fixture.debugElement.query(v => v.componentInstance === outlet.component);
|
||||
}
|
||||
get routeNativeElement() {
|
||||
return this.routeDebugElement?.nativeElement ?? null;
|
||||
}
|
||||
async navigateByUrl(url, requiredRoutedComponentType) {
|
||||
const router = TestBed.inject(Router);
|
||||
let resolveFn;
|
||||
const redirectTrackingPromise = new Promise(resolve => {
|
||||
resolveFn = resolve;
|
||||
});
|
||||
afterNextNavigation(TestBed.inject(Router), resolveFn);
|
||||
await router.navigateByUrl(url);
|
||||
await redirectTrackingPromise;
|
||||
this.fixture.detectChanges();
|
||||
const outlet = this.fixture.componentInstance.outlet;
|
||||
if (outlet && outlet.isActivated && outlet.activatedRoute.component) {
|
||||
const activatedComponent = outlet.component;
|
||||
if (requiredRoutedComponentType !== undefined && !(activatedComponent instanceof requiredRoutedComponentType)) {
|
||||
throw new Error(`Unexpected routed component type. Expected ${requiredRoutedComponentType.name} but got ${activatedComponent.constructor.name}`);
|
||||
}
|
||||
return activatedComponent;
|
||||
} else {
|
||||
if (requiredRoutedComponentType !== undefined) {
|
||||
throw new Error(`Unexpected routed component type. Expected ${requiredRoutedComponentType.name} but the navigation did not activate any component.`);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { RouterTestingHarness, RouterTestingModule, RouterOutlet as ɵɵRouterOutlet };
|
||||
//# sourceMappingURL=testing.mjs.map
|
||||
+1
File diff suppressed because one or more lines are too long
+67
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* @license Angular v21.2.1
|
||||
* (c) 2010-2026 Google LLC. https://angular.dev/
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
import { Location } from '@angular/common';
|
||||
import { APP_BOOTSTRAP_LISTENER, inject } from '@angular/core';
|
||||
import { UpgradeModule } from '@angular/upgrade/static';
|
||||
import { Router } from './_router-chunk.mjs';
|
||||
import 'rxjs';
|
||||
import 'rxjs/operators';
|
||||
import '@angular/platform-browser';
|
||||
|
||||
const RouterUpgradeInitializer = {
|
||||
provide: APP_BOOTSTRAP_LISTENER,
|
||||
multi: true,
|
||||
useFactory: locationSyncBootstrapListener
|
||||
};
|
||||
function locationSyncBootstrapListener() {
|
||||
const ngUpgrade = inject(UpgradeModule);
|
||||
return () => {
|
||||
setUpLocationSync(ngUpgrade);
|
||||
};
|
||||
}
|
||||
function setUpLocationSync(ngUpgrade, urlType = 'path') {
|
||||
if (!ngUpgrade.$injector) {
|
||||
throw new Error(`
|
||||
RouterUpgradeInitializer can be used only after UpgradeModule.bootstrap has been called.
|
||||
Remove RouterUpgradeInitializer and call setUpLocationSync after UpgradeModule.bootstrap.
|
||||
`);
|
||||
}
|
||||
const router = ngUpgrade.injector.get(Router);
|
||||
const location = ngUpgrade.injector.get(Location);
|
||||
ngUpgrade.$injector.get('$rootScope').$on('$locationChangeStart', (event, newUrl, oldUrl, newState, oldState) => {
|
||||
const currentNavigationId = router.getCurrentNavigation()?.id;
|
||||
const newStateNavigationId = newState?.navigationId;
|
||||
if (newStateNavigationId !== undefined && newStateNavigationId === currentNavigationId) {
|
||||
return;
|
||||
}
|
||||
let url;
|
||||
if (urlType === 'path') {
|
||||
url = resolveUrl(newUrl);
|
||||
} else if (urlType === 'hash') {
|
||||
const hashIdx = newUrl.indexOf('#');
|
||||
url = resolveUrl(newUrl.substring(0, hashIdx) + newUrl.substring(hashIdx + 1));
|
||||
} else {
|
||||
throw 'Invalid URLType passed to setUpLocationSync: ' + urlType;
|
||||
}
|
||||
const path = location.normalize(url.pathname);
|
||||
router.navigateByUrl(path + url.search + url.hash);
|
||||
});
|
||||
}
|
||||
let anchor;
|
||||
function resolveUrl(url) {
|
||||
anchor ??= document.createElement('a');
|
||||
anchor.setAttribute('href', url);
|
||||
anchor.setAttribute('href', anchor.href);
|
||||
return {
|
||||
pathname: `/${anchor.pathname.replace(/^\//, '')}`,
|
||||
search: anchor.search,
|
||||
hash: anchor.hash
|
||||
};
|
||||
}
|
||||
|
||||
export { RouterUpgradeInitializer, locationSyncBootstrapListener, setUpLocationSync };
|
||||
//# sourceMappingURL=upgrade.mjs.map
|
||||
+1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user