This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
<% if(displayBlock){ if(style != 'sass') { %>:host {
display: block;
}
<% } else { %>\:host
display: block;
<% }} %>

View File

@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import <% if(!exportDefault) { %>{ <% }%><%= classify(name) %><%= classify(type) %> <% if(!exportDefault) {%>} <% }%>from './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>';
describe('<%= classify(name) %><%= classify(type) %>', () => {
let component: <%= classify(name) %><%= classify(type) %>;
let fixture: ComponentFixture<<%= classify(name) %><%= classify(type) %>>;
beforeEach(async () => {
await TestBed.configureTestingModule({
<%= standalone ? 'imports' : 'declarations' %>: [<%= classify(name) %><%= classify(type) %>]
})
.compileComponents();
fixture = TestBed.createComponent(<%= classify(name) %><%= classify(type) %>);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,24 @@
import { <% if(changeDetection !== 'Default') { %>ChangeDetectionStrategy, <% }%>Component<% if(!!viewEncapsulation) { %>, ViewEncapsulation<% }%> } from '@angular/core';
@Component({<% if(!skipSelector) {%>
selector: '<%= selector %>',<%}%><% if(standalone) {%>
imports: [],<%} else { %>
standalone: false,<% }%><% if(inlineTemplate) { %>
template: `
<p>
<%= dasherize(name) %> works!
</p>
`,<% } else { %>
templateUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %><%= ngext %>.html',<% } if(inlineStyle) { %>
styles: `<% if(displayBlock){ %>
:host {
display: block;
}
<% } %>`,<% } else if (style !== 'none') { %>
styleUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>.<%= style %>',<% } %><% if(!!viewEncapsulation) { %>
encapsulation: ViewEncapsulation.<%= viewEncapsulation %>,<% } if (changeDetection !== 'Default') { %>
changeDetection: ChangeDetectionStrategy.<%= changeDetection %>,<% } %>
})
export <% if(exportDefault) {%>default <%}%>class <%= classify(name) %><%= classify(type) %> {
}

View File

@@ -0,0 +1 @@
<p><%= dasherize(name) %> works!</p>

10
node_modules/@schematics/angular/component/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,10 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { Rule } from '@angular-devkit/schematics';
import { Schema as ComponentOptions } from './schema';
export default function (options: ComponentOptions): Rule;

79
node_modules/@schematics/angular/component/index.js generated vendored Executable file
View File

@@ -0,0 +1,79 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const schematics_1 = require("@angular-devkit/schematics");
const add_declaration_to_ng_module_1 = require("../utility/add-declaration-to-ng-module");
const find_module_1 = require("../utility/find-module");
const parse_name_1 = require("../utility/parse-name");
const validation_1 = require("../utility/validation");
const workspace_1 = require("../utility/workspace");
const schema_1 = require("./schema");
function buildSelector(options, projectPrefix) {
let selector = schematics_1.strings.dasherize(options.name);
if (options.prefix) {
selector = `${options.prefix}-${selector}`;
}
else if (options.prefix === undefined && projectPrefix) {
selector = `${projectPrefix}-${selector}`;
}
return selector;
}
function default_1(options) {
return async (host) => {
const workspace = await (0, workspace_1.getWorkspace)(host);
const project = workspace.projects.get(options.project);
if (!project) {
throw new schematics_1.SchematicsException(`Project "${options.project}" does not exist.`);
}
if (options.path === undefined) {
options.path = (0, workspace_1.buildDefaultPath)(project);
}
options.module = (0, find_module_1.findModuleFromOptions)(host, options);
// Schematic templates require a defined type value
options.type ??= '';
const parsedPath = (0, parse_name_1.parseName)(options.path, options.name);
options.name = parsedPath.name;
options.path = parsedPath.path;
options.selector =
options.selector || buildSelector(options, (project && project.prefix) || '');
(0, validation_1.validateHtmlSelector)(options.selector);
(0, validation_1.validateClassName)(schematics_1.strings.classify(options.name));
const skipStyleFile = options.inlineStyle || options.style === schema_1.Style.None;
const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
options.skipTests ? (0, schematics_1.filter)((path) => !path.endsWith('.spec.ts.template')) : (0, schematics_1.noop)(),
skipStyleFile ? (0, schematics_1.filter)((path) => !path.endsWith('.__style__.template')) : (0, schematics_1.noop)(),
options.inlineTemplate ? (0, schematics_1.filter)((path) => !path.endsWith('.html.template')) : (0, schematics_1.noop)(),
(0, schematics_1.applyTemplates)({
...schematics_1.strings,
'if-flat': (s) => (options.flat ? '' : s),
'ngext': options.ngHtml ? '.ng' : '',
...options,
}),
!options.type
? (0, schematics_1.forEach)(((file) => {
return file.path.includes('..')
? {
content: file.content,
path: file.path.replace('..', '.'),
}
: file;
}))
: (0, schematics_1.noop)(),
(0, schematics_1.move)(parsedPath.path),
]);
return (0, schematics_1.chain)([
(0, add_declaration_to_ng_module_1.addDeclarationToNgModule)({
type: 'component',
...options,
}),
(0, schematics_1.mergeWith)(templateSource),
]);
};
}

136
node_modules/@schematics/angular/component/schema.d.ts generated vendored Executable file
View File

@@ -0,0 +1,136 @@
/**
* Creates a new Angular component. Components are the basic building blocks of Angular
* applications. Each component consists of a TypeScript class, an HTML template, and an
* optional CSS stylesheet. Use this schematic to generate a new component in your project.
*/
export type Schema = {
/**
* Configures the change detection strategy for the component.
*/
changeDetection?: ChangeDetection;
/**
* Adds `:host { display: block; }` to the component's stylesheet, ensuring the component
* renders as a block-level element. This is useful for layout purposes.
*/
displayBlock?: boolean;
/**
* Automatically export the component from the specified NgModule, making it accessible to
* other modules in the application.
*/
export?: boolean;
/**
* Use a default export for the component in its TypeScript file instead of a named export.
*/
exportDefault?: boolean;
/**
* Create the component files directly in the project's `src/app` directory instead of
* creating a new folder for them.
*/
flat?: boolean;
/**
* Include the component's styles directly in the `component.ts` file. By default, a
* separate stylesheet file (e.g., `my-component.css`) is created.
*/
inlineStyle?: boolean;
/**
* Include the component's HTML template directly in the `component.ts` file. By default, a
* separate template file (e.g., `my-component.html`) is created.
*/
inlineTemplate?: boolean;
/**
* Specify the NgModule where the component should be declared. If not provided, the CLI
* will attempt to find the closest NgModule in the component's path.
*/
module?: string;
/**
* The name for the new component. This will be used to create the component's class,
* template, and stylesheet files. For example, if you provide `my-component`, the files
* will be named `my-component.ts`, `my-component.html`, and `my-component.css`.
*/
name: string;
/**
* Generate component template files with an '.ng.html' file extension instead of '.html'.
*/
ngHtml?: boolean;
/**
* The path where the component files should be created, relative to the current workspace.
* If not provided, a folder with the same name as the component will be created in the
* project's `src/app` directory.
*/
path?: string;
/**
* A prefix to be added to the component's selector. For example, if the prefix is `app` and
* the component name is `my-component`, the selector will be `app-my-component`.
*/
prefix?: string;
/**
* The name of the project where the component should be added. If not specified, the CLI
* will determine the project from the current directory.
*/
project: string;
/**
* The HTML selector to use for this component. If not provided, a selector will be
* generated based on the component name (e.g., `app-my-component`).
*/
selector?: string;
/**
* Do not automatically import the new component into its closest NgModule.
*/
skipImport?: boolean;
/**
* Skip the generation of an HTML selector for the component.
*/
skipSelector?: boolean;
/**
* Skip the generation of unit test files `spec.ts`.
*/
skipTests?: boolean;
/**
* Generate a standalone component. Standalone components are self-contained and don't need
* to be declared in an NgModule. They can be used independently or imported directly into
* other standalone components.
*/
standalone?: boolean;
/**
* Specify the type of stylesheet to be created for the component, or `none` to skip
* creating a stylesheet.
*/
style?: Style;
/**
* Append a custom type to the component's filename. For example, if you set the type to
* `container`, the file will be named `my-component.container.ts`.
*/
type?: string;
/**
* Sets the view encapsulation mode for the component. This determines how the component's
* styles are scoped and applied.
*/
viewEncapsulation?: ViewEncapsulation;
};
/**
* Configures the change detection strategy for the component.
*/
export declare enum ChangeDetection {
Default = "Default",
OnPush = "OnPush"
}
/**
* Specify the type of stylesheet to be created for the component, or `none` to skip
* creating a stylesheet.
*/
export declare enum Style {
Css = "css",
Less = "less",
None = "none",
Sass = "sass",
Scss = "scss"
}
/**
* Sets the view encapsulation mode for the component. This determines how the component's
* styles are scoped and applied.
*/
export declare enum ViewEncapsulation {
Emulated = "Emulated",
None = "None",
ShadowDom = "ShadowDom"
}

35
node_modules/@schematics/angular/component/schema.js generated vendored Executable file
View File

@@ -0,0 +1,35 @@
"use strict";
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
Object.defineProperty(exports, "__esModule", { value: true });
exports.ViewEncapsulation = exports.Style = exports.ChangeDetection = void 0;
/**
* Configures the change detection strategy for the component.
*/
var ChangeDetection;
(function (ChangeDetection) {
ChangeDetection["Default"] = "Default";
ChangeDetection["OnPush"] = "OnPush";
})(ChangeDetection || (exports.ChangeDetection = ChangeDetection = {}));
/**
* Specify the type of stylesheet to be created for the component, or `none` to skip
* creating a stylesheet.
*/
var Style;
(function (Style) {
Style["Css"] = "css";
Style["Less"] = "less";
Style["None"] = "none";
Style["Sass"] = "sass";
Style["Scss"] = "scss";
})(Style || (exports.Style = Style = {}));
/**
* Sets the view encapsulation mode for the component. This determines how the component's
* styles are scoped and applied.
*/
var ViewEncapsulation;
(function (ViewEncapsulation) {
ViewEncapsulation["Emulated"] = "Emulated";
ViewEncapsulation["None"] = "None";
ViewEncapsulation["ShadowDom"] = "ShadowDom";
})(ViewEncapsulation || (exports.ViewEncapsulation = ViewEncapsulation = {}));

145
node_modules/@schematics/angular/component/schema.json generated vendored Executable file
View File

@@ -0,0 +1,145 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "SchematicsAngularComponent",
"title": "Angular Component Options Schema",
"type": "object",
"description": "Creates a new Angular component. Components are the basic building blocks of Angular applications. Each component consists of a TypeScript class, an HTML template, and an optional CSS stylesheet. Use this schematic to generate a new component in your project.",
"additionalProperties": false,
"properties": {
"path": {
"type": "string",
"format": "path",
"$default": {
"$source": "workingDirectory"
},
"description": "The path where the component files should be created, relative to the current workspace. If not provided, a folder with the same name as the component will be created in the project's `src/app` directory.",
"visible": false
},
"project": {
"type": "string",
"description": "The name of the project where the component should be added. If not specified, the CLI will determine the project from the current directory.",
"$default": {
"$source": "projectName"
}
},
"name": {
"type": "string",
"description": "The name for the new component. This will be used to create the component's class, template, and stylesheet files. For example, if you provide `my-component`, the files will be named `my-component.ts`, `my-component.html`, and `my-component.css`.",
"$default": {
"$source": "argv",
"index": 0
},
"x-prompt": "What name would you like to use for the component?"
},
"displayBlock": {
"description": "Adds `:host { display: block; }` to the component's stylesheet, ensuring the component renders as a block-level element. This is useful for layout purposes.",
"type": "boolean",
"default": false,
"alias": "b"
},
"inlineStyle": {
"description": "Include the component's styles directly in the `component.ts` file. By default, a separate stylesheet file (e.g., `my-component.css`) is created.",
"type": "boolean",
"default": false,
"alias": "s",
"x-user-analytics": "ep.ng_inline_style"
},
"inlineTemplate": {
"description": "Include the component's HTML template directly in the `component.ts` file. By default, a separate template file (e.g., `my-component.html`) is created.",
"type": "boolean",
"default": false,
"alias": "t",
"x-user-analytics": "ep.ng_inline_template"
},
"standalone": {
"description": "Generate a standalone component. Standalone components are self-contained and don't need to be declared in an NgModule. They can be used independently or imported directly into other standalone components.",
"type": "boolean",
"default": true,
"x-user-analytics": "ep.ng_standalone"
},
"viewEncapsulation": {
"description": "Sets the view encapsulation mode for the component. This determines how the component's styles are scoped and applied.",
"enum": ["Emulated", "None", "ShadowDom"],
"type": "string",
"alias": "v"
},
"changeDetection": {
"description": "Configures the change detection strategy for the component.",
"enum": ["Default", "OnPush"],
"type": "string",
"default": "Default",
"alias": "c"
},
"prefix": {
"type": "string",
"description": "A prefix to be added to the component's selector. For example, if the prefix is `app` and the component name is `my-component`, the selector will be `app-my-component`.",
"alias": "p",
"oneOf": [
{
"maxLength": 0
},
{
"minLength": 1,
"format": "html-selector"
}
]
},
"style": {
"description": "Specify the type of stylesheet to be created for the component, or `none` to skip creating a stylesheet.",
"type": "string",
"default": "css",
"enum": ["css", "scss", "sass", "less", "none"],
"x-user-analytics": "ep.ng_style"
},
"type": {
"type": "string",
"description": "Append a custom type to the component's filename. For example, if you set the type to `container`, the file will be named `my-component.container.ts`."
},
"skipTests": {
"type": "boolean",
"description": "Skip the generation of unit test files `spec.ts`.",
"default": false
},
"flat": {
"type": "boolean",
"description": "Create the component files directly in the project's `src/app` directory instead of creating a new folder for them.",
"default": false
},
"skipImport": {
"type": "boolean",
"description": "Do not automatically import the new component into its closest NgModule.",
"default": false
},
"selector": {
"type": "string",
"format": "html-selector",
"description": "The HTML selector to use for this component. If not provided, a selector will be generated based on the component name (e.g., `app-my-component`)."
},
"skipSelector": {
"type": "boolean",
"default": false,
"description": "Skip the generation of an HTML selector for the component."
},
"module": {
"type": "string",
"description": "Specify the NgModule where the component should be declared. If not provided, the CLI will attempt to find the closest NgModule in the component's path.",
"alias": "m"
},
"export": {
"type": "boolean",
"default": false,
"description": "Automatically export the component from the specified NgModule, making it accessible to other modules in the application."
},
"exportDefault": {
"type": "boolean",
"default": false,
"description": "Use a default export for the component in its TypeScript file instead of a named export."
},
"ngHtml": {
"type": "boolean",
"default": false,
"description": "Generate component template files with an '.ng.html' file extension instead of '.html'."
}
},
"required": ["name", "project"]
}