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

89
node_modules/@angular/cdk/text-field/_index.scss generated vendored Executable file
View File

@@ -0,0 +1,89 @@
// Structural styles for the autosize text fields.
@mixin text-field-autosize() {
// Remove the resize handle on autosizing textareas, because whatever height
// the user resized to will be overwritten once they start typing again.
textarea.cdk-textarea-autosize {
resize: none;
}
// This class is temporarily applied to the textarea when it is being measured. It is immediately
// removed when measuring is complete. We use `!important` rules here to make sure user-specified
// rules do not interfere with the measurement.
textarea.cdk-textarea-autosize-measuring {
@include _autosize-measuring-base;
height: auto !important;
overflow: hidden !important;
}
// Similar to the `cdk-textarea-autosize-measuring` class, but only applied on Firefox. We need
// to use this class, because Firefox has a bug where changing the `overflow` breaks the user's
// ability to undo/redo what they were typing (see #16629). This class is only scoped to Firefox,
// because the measurements there don't seem to be affected by the `height: 0`, whereas on other
// browsers they are, e.g. Chrome detects longer text and IE does't resize back to normal.
// Identical issue report: https://bugzilla.mozilla.org/show_bug.cgi?id=448784
textarea.cdk-textarea-autosize-measuring-firefox {
@include _autosize-measuring-base;
height: 0 !important;
}
}
// Core styles that enable monitoring autofill state of text fields.
@mixin text-field-autofill() {
// Keyframes that apply no styles, but allow us to monitor when a text field becomes autofilled
// by watching for the animation events that are fired when they start. Note: the /*!*/ comment is
// needed to prevent LibSass from stripping the keyframes out.
// Based on: https://medium.com/@brunn/detecting-autofilled-fields-in-javascript-aed598d25da7
@keyframes cdk-text-field-autofill-start {/*!*/}
@keyframes cdk-text-field-autofill-end {/*!*/}
.cdk-text-field-autofill-monitored:-webkit-autofill {
// Since Chrome 80 we need a 1ms delay, or the animationstart event won't fire.
animation: cdk-text-field-autofill-start 0s 1ms;
}
.cdk-text-field-autofill-monitored:not(:-webkit-autofill) {
// Since Chrome 80 we need a 1ms delay, or the animationstart event won't fire.
animation: cdk-text-field-autofill-end 0s 1ms;
}
}
@mixin _autosize-measuring-base {
// Having 2px top and bottom padding seems to fix a bug where Chrome gets an incorrect
// measurement. We just have to account for it later and subtract it off the final result.
padding: 2px 0 !important;
box-sizing: content-box !important;
}
// Used to generate UIDs for keyframes used to change the text field autofill styles.
$autofill-color-frame-count: 0;
// Mixin used to apply custom background and foreground colors to an autofilled text field.
// Based on: https://stackoverflow.com/questions/2781549/
// removing-input-background-colour-for-chrome-autocomplete#answer-37432260
@mixin text-field-autofill-color($background, $foreground:'') {
@keyframes cdk-text-field-autofill-color-#{$autofill-color-frame-count} {
to {
background: $background;
@if $foreground != '' { color: $foreground; }
}
}
&:-webkit-autofill {
animation: cdk-text-field-autofill-color-#{$autofill-color-frame-count} both;
}
&.cdk-text-field-autofill-monitored:-webkit-autofill {
// Since Chrome 80 we need a 1ms delay for cdk-text-field-autofill-start, or the animationstart
// event won't fire.
animation: cdk-text-field-autofill-start 0s 1ms,
cdk-text-field-autofill-color-#{$autofill-color-frame-count} both;
}
$autofill-color-frame-count: $autofill-color-frame-count + 1 !global;
}
// @deprecated Use `autosize` and `autofill` instead.
@mixin text-field {
@include text-field-autosize();
@include text-field-autofill();
}

154
node_modules/@angular/cdk/text-field/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,154 @@
import * as i0 from '@angular/core';
import { OnDestroy, ElementRef, OnInit, EventEmitter, AfterViewInit, DoCheck } from '@angular/core';
import { Observable } from 'rxjs';
import { NumberInput } from '../number-property.d.js';
/** An event that is emitted when the autofill state of an input changes. */
type AutofillEvent = {
/** The element whose autofill state changes. */
target: Element;
/** Whether the element is currently autofilled. */
isAutofilled: boolean;
};
/**
* An injectable service that can be used to monitor the autofill state of an input.
* Based on the following blog post:
* https://medium.com/@brunn/detecting-autofilled-fields-in-javascript-aed598d25da7
*/
declare class AutofillMonitor implements OnDestroy {
private _platform;
private _ngZone;
private _renderer;
private _styleLoader;
private _monitoredElements;
constructor(...args: unknown[]);
/**
* Monitor for changes in the autofill state of the given input element.
* @param element The element to monitor.
* @return A stream of autofill state changes.
*/
monitor(element: Element): Observable<AutofillEvent>;
/**
* Monitor for changes in the autofill state of the given input element.
* @param element The element to monitor.
* @return A stream of autofill state changes.
*/
monitor(element: ElementRef<Element>): Observable<AutofillEvent>;
/**
* Stop monitoring the autofill state of the given input element.
* @param element The element to stop monitoring.
*/
stopMonitoring(element: Element): void;
/**
* Stop monitoring the autofill state of the given input element.
* @param element The element to stop monitoring.
*/
stopMonitoring(element: ElementRef<Element>): void;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<AutofillMonitor, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<AutofillMonitor>;
}
/** A directive that can be used to monitor the autofill state of an input. */
declare class CdkAutofill implements OnDestroy, OnInit {
private _elementRef;
private _autofillMonitor;
/** Emits when the autofill state of the element changes. */
readonly cdkAutofill: EventEmitter<AutofillEvent>;
constructor(...args: unknown[]);
ngOnInit(): void;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<CdkAutofill, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkAutofill, "[cdkAutofill]", never, {}, { "cdkAutofill": "cdkAutofill"; }, never, never, true, never>;
}
/** Directive to automatically resize a textarea to fit its content. */
declare class CdkTextareaAutosize implements AfterViewInit, DoCheck, OnDestroy {
private _elementRef;
private _platform;
private _ngZone;
private _renderer;
private _resizeEvents;
/** Keep track of the previous textarea value to avoid resizing when the value hasn't changed. */
private _previousValue?;
private _initialHeight;
private readonly _destroyed;
private _listenerCleanups;
private _minRows;
private _maxRows;
private _enabled;
/**
* Value of minRows as of last resize. If the minRows has decreased, the
* height of the textarea needs to be recomputed to reflect the new minimum. The maxHeight
* does not have the same problem because it does not affect the textarea's scrollHeight.
*/
private _previousMinRows;
private _textareaElement;
/** Minimum amount of rows in the textarea. */
get minRows(): number;
set minRows(value: NumberInput);
/** Maximum amount of rows in the textarea. */
get maxRows(): number;
set maxRows(value: NumberInput);
/** Whether autosizing is enabled or not */
get enabled(): boolean;
set enabled(value: boolean);
get placeholder(): string;
set placeholder(value: string);
/** Cached height of a textarea with a single row. */
private _cachedLineHeight?;
/** Cached height of a textarea with only the placeholder. */
private _cachedPlaceholderHeight?;
/** Used to reference correct document/window */
protected _document: Document;
private _hasFocus;
private _isViewInited;
constructor(...args: unknown[]);
/** Sets the minimum height of the textarea as determined by minRows. */
_setMinHeight(): void;
/** Sets the maximum height of the textarea as determined by maxRows. */
_setMaxHeight(): void;
ngAfterViewInit(): void;
ngOnDestroy(): void;
/**
* Cache the height of a single-row textarea if it has not already been cached.
*
* We need to know how large a single "row" of a textarea is in order to apply minRows and
* maxRows. For the initial version, we will assume that the height of a single line in the
* textarea does not ever change.
*/
private _cacheTextareaLineHeight;
private _measureScrollHeight;
private _cacheTextareaPlaceholderHeight;
/** Handles `focus` and `blur` events. */
private _handleFocusEvent;
ngDoCheck(): void;
/**
* Resize the textarea to fit its content.
* @param force Whether to force a height recalculation. By default the height will be
* recalculated only if the value changed since the last call.
*/
resizeToFitContent(force?: boolean): void;
/**
* Resets the textarea to its original size
*/
reset(): void;
_noopInputHandler(): void;
/**
* Scrolls a textarea to the caret position. On Firefox resizing the textarea will
* prevent it from scrolling to the caret position. We need to re-set the selection
* in order for it to scroll to the proper position.
*/
private _scrollToCaretPosition;
static ɵfac: i0.ɵɵFactoryDeclaration<CdkTextareaAutosize, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTextareaAutosize, "textarea[cdkTextareaAutosize]", ["cdkTextareaAutosize"], { "minRows": { "alias": "cdkAutosizeMinRows"; "required": false; }; "maxRows": { "alias": "cdkAutosizeMaxRows"; "required": false; }; "enabled": { "alias": "cdkTextareaAutosize"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; }, {}, never, never, true, never>;
static ngAcceptInputType_enabled: unknown;
}
declare class TextFieldModule {
static ɵfac: i0.ɵɵFactoryDeclaration<TextFieldModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<TextFieldModule, never, [typeof CdkAutofill, typeof CdkTextareaAutosize], [typeof CdkAutofill, typeof CdkTextareaAutosize]>;
static ɵinj: i0.ɵɵInjectorDeclaration<TextFieldModule>;
}
export { AutofillMonitor, CdkAutofill, CdkTextareaAutosize, TextFieldModule };
export type { AutofillEvent };