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,8 @@
import { <%= classify(name) %><%= classify(type) %> } from './<%= dasherize(name) %><%= type ? '.' + dasherize(type) : '' %>';
describe('<%= classify(name) %><%= classify(type) %>', () => {
it('should create an instance', () => {
const directive = new <%= classify(name) %><%= classify(type) %>();
expect(directive).toBeTruthy();
});
});

View File

@@ -0,0 +1,11 @@
import { Directive } from '@angular/core';
@Directive({
selector: '[<%= selector %>]'<% if(!standalone) {%>,
standalone: false<%}%>
})
export class <%= classify(name) %><%= classify(type) %> {
constructor() { }
}

10
node_modules/@schematics/angular/directive/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 DirectiveOptions } from './schema';
export default function (options: DirectiveOptions): Rule;

53
node_modules/@schematics/angular/directive/index.js generated vendored Executable file
View File

@@ -0,0 +1,53 @@
"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 generate_from_files_1 = require("../utility/generate-from-files");
const parse_name_1 = require("../utility/parse-name");
const validation_1 = require("../utility/validation");
const workspace_1 = require("../utility/workspace");
function buildSelector(options, projectPrefix) {
let selector = options.name;
if (options.prefix) {
selector = `${options.prefix}-${selector}`;
}
else if (options.prefix === undefined && projectPrefix) {
selector = `${projectPrefix}-${selector}`;
}
return schematics_1.strings.camelize(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);
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.prefix || '');
(0, validation_1.validateHtmlSelector)(options.selector);
(0, validation_1.validateClassName)(schematics_1.strings.classify(options.name));
return (0, schematics_1.chain)([
(0, add_declaration_to_ng_module_1.addDeclarationToNgModule)({
type: 'directive',
...options,
}),
(0, generate_from_files_1.generateFromFiles)(options),
]);
};
}

67
node_modules/@schematics/angular/directive/schema.d.ts generated vendored Executable file
View File

@@ -0,0 +1,67 @@
/**
* Creates a new directive in your project. Directives are used to extend the behavior or
* appearance of HTML elements and components. They allow you to manipulate the DOM, add
* custom attributes, and respond to events. This schematic generates the necessary files
* and boilerplate code for a new directive.
*/
export type Schema = {
/**
* Automatically export the directive from the specified NgModule, making it accessible to
* other modules in the application.
*/
export?: boolean;
/**
* Creates the new directive files at the top level of the current project. If set to false,
* a new folder with the directive's name will be created to contain the files.
*/
flat?: boolean;
/**
* Specify the NgModule where the directive should be declared. If not provided, the CLI
* will attempt to find the closest NgModule in the directive's path.
*/
module?: string;
/**
* The name for the new directive. This will be used to create the directive's class and
* spec files (e.g., `my-directive.directive.ts` and `my-directive.directive.spec.ts`).
*/
name: string;
/**
* The path where the directive files should be created, relative to the workspace root. If
* not provided, the directive will be created in the current directory.
*/
path?: string;
/**
* A prefix to be added to the directive's selector. For example, if the prefix is `app` and
* the directive name is `highlight`, the selector will be `appHighlight`.
*/
prefix?: string;
/**
* The name of the project where the directive 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 directive. If not provided, a selector will be
* generated based on the directive's name (e.g., `appHighlight`).
*/
selector?: string;
/**
* Do not automatically import the new directive into its closest NgModule.
*/
skipImport?: boolean;
/**
* Skip the generation of a unit test file `spec.ts` for the new directive.
*/
skipTests?: boolean;
/**
* Generate a standalone directive. Standalone directives 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 or directives.
*/
standalone?: boolean;
/**
* Append a custom type to the directive's filename. For example, if you set the type to
* `directive`, the file will be named `example.directive.ts`.
*/
type?: string;
};

4
node_modules/@schematics/angular/directive/schema.js generated vendored Executable file
View File

@@ -0,0 +1,4 @@
"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 });

90
node_modules/@schematics/angular/directive/schema.json generated vendored Executable file
View File

@@ -0,0 +1,90 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "SchematicsAngularDirective",
"title": "Angular Directive Options Schema",
"type": "object",
"description": "Creates a new directive in your project. Directives are used to extend the behavior or appearance of HTML elements and components. They allow you to manipulate the DOM, add custom attributes, and respond to events. This schematic generates the necessary files and boilerplate code for a new directive.",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "The name for the new directive. This will be used to create the directive's class and spec files (e.g., `my-directive.directive.ts` and `my-directive.directive.spec.ts`).",
"$default": {
"$source": "argv",
"index": 0
},
"x-prompt": "What name would you like to use for the directive?"
},
"path": {
"type": "string",
"format": "path",
"$default": {
"$source": "workingDirectory"
},
"description": "The path where the directive files should be created, relative to the workspace root. If not provided, the directive will be created in the current directory.",
"visible": false
},
"project": {
"type": "string",
"description": "The name of the project where the directive should be added. If not specified, the CLI will determine the project from the current directory.",
"$default": {
"$source": "projectName"
}
},
"prefix": {
"type": "string",
"description": "A prefix to be added to the directive's selector. For example, if the prefix is `app` and the directive name is `highlight`, the selector will be `appHighlight`.",
"alias": "p",
"oneOf": [
{
"maxLength": 0
},
{
"minLength": 1,
"format": "html-selector"
}
]
},
"skipTests": {
"type": "boolean",
"description": "Skip the generation of a unit test file `spec.ts` for the new directive.",
"default": false
},
"skipImport": {
"type": "boolean",
"description": "Do not automatically import the new directive into its closest NgModule.",
"default": false
},
"selector": {
"type": "string",
"format": "html-selector",
"description": "The HTML selector to use for this directive. If not provided, a selector will be generated based on the directive's name (e.g., `appHighlight`)."
},
"standalone": {
"description": "Generate a standalone directive. Standalone directives 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 or directives.",
"type": "boolean",
"default": true,
"x-user-analytics": "ep.ng_standalone"
},
"flat": {
"type": "boolean",
"description": "Creates the new directive files at the top level of the current project. If set to false, a new folder with the directive's name will be created to contain the files.",
"default": true
},
"module": {
"type": "string",
"description": "Specify the NgModule where the directive should be declared. If not provided, the CLI will attempt to find the closest NgModule in the directive's path.",
"alias": "m"
},
"export": {
"type": "boolean",
"default": false,
"description": "Automatically export the directive from the specified NgModule, making it accessible to other modules in the application."
},
"type": {
"type": "string",
"description": "Append a custom type to the directive's filename. For example, if you set the type to `directive`, the file will be named `example.directive.ts`."
}
},
"required": ["name", "project"]
}