@compsych-ui-components/angular 7.0.7 → 7.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm2022/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { HeaderNavComponent } from './lib/header-nav/header-nav';
|
|
|
6
6
|
import { SidebarComponent } from './lib/sidebar/sidebar';
|
|
7
7
|
import { CardComponent } from './lib/card-base/card';
|
|
8
8
|
import { CardGridComponent } from './lib/card-grid/card-grid';
|
|
9
|
+
import { TextInputComponent } from './lib/text-input/text-input';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
export { ButtonComponent } from './lib/button/button';
|
|
11
12
|
export { AccordionComponent } from './lib/accordion/accordion';
|
|
@@ -15,6 +16,7 @@ export { SidebarComponent } from './lib/sidebar/sidebar';
|
|
|
15
16
|
export { CardComponent } from './lib/card-base/card';
|
|
16
17
|
export { RippleDirective } from './lib/card-base/ripple.directive';
|
|
17
18
|
export { CardGridComponent } from './lib/card-grid/card-grid';
|
|
19
|
+
export { TextInputComponent } from './lib/text-input/text-input';
|
|
18
20
|
export class CompsychAngularModule {
|
|
19
21
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: CompsychAngularModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
20
22
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.14", ngImport: i0, type: CompsychAngularModule, imports: [ButtonComponent,
|
|
@@ -23,13 +25,15 @@ export class CompsychAngularModule {
|
|
|
23
25
|
HeaderNavComponent,
|
|
24
26
|
SidebarComponent,
|
|
25
27
|
CardComponent,
|
|
26
|
-
CardGridComponent
|
|
28
|
+
CardGridComponent,
|
|
29
|
+
TextInputComponent], exports: [ButtonComponent,
|
|
27
30
|
AccordionComponent,
|
|
28
31
|
FooterComponent,
|
|
29
32
|
HeaderNavComponent,
|
|
30
33
|
SidebarComponent,
|
|
31
34
|
CardComponent,
|
|
32
|
-
CardGridComponent
|
|
35
|
+
CardGridComponent,
|
|
36
|
+
TextInputComponent] });
|
|
33
37
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: CompsychAngularModule });
|
|
34
38
|
}
|
|
35
39
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: CompsychAngularModule, decorators: [{
|
|
@@ -43,6 +47,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
43
47
|
SidebarComponent,
|
|
44
48
|
CardComponent,
|
|
45
49
|
CardGridComponent,
|
|
50
|
+
TextInputComponent,
|
|
46
51
|
],
|
|
47
52
|
exports: [
|
|
48
53
|
ButtonComponent,
|
|
@@ -52,6 +57,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
52
57
|
SidebarComponent,
|
|
53
58
|
CardComponent,
|
|
54
59
|
CardGridComponent,
|
|
60
|
+
TextInputComponent,
|
|
55
61
|
],
|
|
56
62
|
}]
|
|
57
63
|
}] });
|
package/esm2022/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/angular/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,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BAAkB,aAGlB,eAAe;YACf,kBAAkB;YAClB,eAAe;YACf,kBAAkB;YAClB,gBAAgB;YAChB,aAAa;YACb,iBAAiB;YACjB,kBAAkB;yGAGT,qBAAqB;;4FAArB,qBAAqB;kBAtBjC,QAAQ;mBAAC;oBACR,OAAO,EAAE;wBACP,eAAe;wBACf,kBAAkB;wBAClB,eAAe;wBACf,kBAAkB;wBAClB,gBAAgB;wBAChB,aAAa;wBACb,iBAAiB;wBACjB,kBAAkB;qBACnB;oBACD,OAAO,EAAE;wBACP,eAAe;wBACf,kBAAkB;wBAClB,eAAe;wBACf,kBAAkB;wBAClB,gBAAgB;wBAChB,aAAa;wBACb,iBAAiB;wBACjB,kBAAkB;qBACnB;iBACF","sourcesContent":["import { NgModule } from '@angular/core';\r\nimport { ButtonComponent } from './lib/button/button';\r\nimport { AccordionComponent } from './lib/accordion/accordion';\r\nimport { FooterComponent } from './lib/footer/footer';\r\nimport { HeaderNavComponent } from './lib/header-nav/header-nav';\r\nimport { SidebarComponent } from './lib/sidebar/sidebar';\r\nimport { CardComponent } from './lib/card-base/card';\r\nimport { CardGridComponent } from './lib/card-grid/card-grid';\r\nimport { TextInputComponent } from './lib/text-input/text-input';\r\n\r\nexport { ButtonComponent } from './lib/button/button';\r\nexport type { ButtonVariant, ButtonSize, ButtonType } from './lib/button/button';\r\nexport { AccordionComponent } from './lib/accordion/accordion';\r\nexport type { AccordionItem, AccordionButton, AccordionVariant, NestedAccordionItem } from './lib/accordion/accordion-types';\r\nexport { FooterComponent } from './lib/footer/footer';\r\nexport type { FooterLink } from './lib/footer/footer';\r\nexport { HeaderNavComponent } from './lib/header-nav/header-nav';\r\nexport type { HeaderNavLevel, NavAction } from './lib/header-nav/header-nav';\r\nexport { SidebarComponent } from './lib/sidebar/sidebar';\r\nexport type { SidebarItem } from './lib/sidebar/sidebar';\r\nexport { CardComponent } from './lib/card-base/card';\r\nexport type { CardVariant, CardAppearance, CardRadius, CardPadding, CardOrientation, CardHeadingLevel } from './lib/card-base/card';\r\nexport { RippleDirective } from './lib/card-base/ripple.directive';\r\nexport { CardGridComponent } from './lib/card-grid/card-grid';\r\nexport type { CardGridLayout } from './lib/card-grid/card-grid';\r\nexport { TextInputComponent } from './lib/text-input/text-input';\r\nexport type { TextInputSize, TextInputType } from './lib/text-input/text-input';\r\n\r\n@NgModule({\r\n imports: [\r\n ButtonComponent,\r\n AccordionComponent,\r\n FooterComponent,\r\n HeaderNavComponent,\r\n SidebarComponent,\r\n CardComponent,\r\n CardGridComponent,\r\n TextInputComponent,\r\n ],\r\n exports: [\r\n ButtonComponent,\r\n AccordionComponent,\r\n FooterComponent,\r\n HeaderNavComponent,\r\n SidebarComponent,\r\n CardComponent,\r\n CardGridComponent,\r\n TextInputComponent,\r\n ],\r\n})\r\nexport class CompsychAngularModule {}\r\n"]}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output, booleanAttribute, inject, } from '@angular/core';
|
|
2
|
+
import { NgControl, Validators } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
let nextId = 0;
|
|
5
|
+
/**
|
|
6
|
+
* A labelled text input that wraps a native `<input>` element.
|
|
7
|
+
* Implements `ControlValueAccessor` so it works with both reactive forms
|
|
8
|
+
* (`formControlName`, `[formControl]`) and template-driven forms (`ngModel`).
|
|
9
|
+
* The error visual state is driven automatically by the bound `FormControl`'s
|
|
10
|
+
* validity once the field has been touched, and can also be set explicitly via
|
|
11
|
+
* the `error` input for use outside of Angular forms.
|
|
12
|
+
*/
|
|
13
|
+
export class TextInputComponent {
|
|
14
|
+
_autoId = `cmp-text-input-${++nextId}`;
|
|
15
|
+
cdr = inject(ChangeDetectorRef);
|
|
16
|
+
_onChange = () => { };
|
|
17
|
+
_onTouched = () => { };
|
|
18
|
+
/** Injected when the component is used inside a reactive or template-driven form. */
|
|
19
|
+
ngControl;
|
|
20
|
+
constructor() {
|
|
21
|
+
const ctrl = inject(NgControl, { optional: true, self: true });
|
|
22
|
+
if (ctrl)
|
|
23
|
+
ctrl.valueAccessor = this;
|
|
24
|
+
this.ngControl = ctrl;
|
|
25
|
+
}
|
|
26
|
+
/** Label displayed above the input. */
|
|
27
|
+
label = '';
|
|
28
|
+
/** Placeholder text shown inside the input when empty. */
|
|
29
|
+
placeholder = '';
|
|
30
|
+
/** Current value of the input. When used in a form, the form controls the value. */
|
|
31
|
+
value = '';
|
|
32
|
+
/** Native input type. Defaults to `'text'`. Use `'password'` to mask the value. */
|
|
33
|
+
type = 'text';
|
|
34
|
+
/** Size variant — controls height, padding, and font size. Defaults to `'medium'`. */
|
|
35
|
+
size = 'medium';
|
|
36
|
+
/** Native `name` attribute forwarded to the `<input>`. Defaults to the auto-generated id. */
|
|
37
|
+
name;
|
|
38
|
+
/** Native `id` attribute for the `<input>`. Auto-generated if omitted. */
|
|
39
|
+
id;
|
|
40
|
+
/**
|
|
41
|
+
* Id(s) of external elements that describe the input, space-separated.
|
|
42
|
+
* Forwarded to `aria-describedby` on the native `<input>`.
|
|
43
|
+
*/
|
|
44
|
+
ariaDescribedBy;
|
|
45
|
+
/**
|
|
46
|
+
* Adds a blue asterisk after the label. When used in a form, this is set
|
|
47
|
+
* automatically if the bound `FormControl` has `Validators.required`.
|
|
48
|
+
* Can also be set explicitly for non-form use. Supports boolean coercion.
|
|
49
|
+
*/
|
|
50
|
+
required = false;
|
|
51
|
+
/**
|
|
52
|
+
* Applies the error visual state (red border) explicitly. When used in a form,
|
|
53
|
+
* the error state is driven automatically from the `FormControl`'s validity once
|
|
54
|
+
* the field is touched — this input is only needed outside of forms.
|
|
55
|
+
* Supports boolean coercion.
|
|
56
|
+
*/
|
|
57
|
+
error = false;
|
|
58
|
+
/** Disables the input. When used in a form, also responds to `FormControl.disable()`. Supports boolean coercion. */
|
|
59
|
+
disabled = false;
|
|
60
|
+
/** Makes the input read-only — focusable and copyable but not editable. Value is still submitted with the form. Supports boolean coercion. */
|
|
61
|
+
readonly = false;
|
|
62
|
+
/** Emits the new string value whenever the user types. For use outside Angular forms; inside forms use the `FormControl` value stream. */
|
|
63
|
+
valueChange = new EventEmitter();
|
|
64
|
+
get inputId() {
|
|
65
|
+
return this.id ?? this._autoId;
|
|
66
|
+
}
|
|
67
|
+
/** True when the bound FormControl is invalid and touched, or when `error` is explicitly set. */
|
|
68
|
+
get hasError() {
|
|
69
|
+
return this.error || !!(this.ngControl?.invalid && this.ngControl.touched);
|
|
70
|
+
}
|
|
71
|
+
/** True when `required` is set explicitly, or when the bound FormControl has Validators.required. */
|
|
72
|
+
get isRequired() {
|
|
73
|
+
return this.required || !!(this.ngControl?.control?.hasValidator(Validators.required));
|
|
74
|
+
}
|
|
75
|
+
get wrapperClasses() {
|
|
76
|
+
return ['cmp-text-field', this.size, this.disabled ? 'disabled' : '']
|
|
77
|
+
.filter(Boolean)
|
|
78
|
+
.join(' ');
|
|
79
|
+
}
|
|
80
|
+
// ── ControlValueAccessor ────────────────────────────────────────────────────
|
|
81
|
+
writeValue(value) {
|
|
82
|
+
this.value = value ?? '';
|
|
83
|
+
this.cdr.markForCheck();
|
|
84
|
+
}
|
|
85
|
+
registerOnChange(fn) {
|
|
86
|
+
this._onChange = fn;
|
|
87
|
+
}
|
|
88
|
+
registerOnTouched(fn) {
|
|
89
|
+
this._onTouched = fn;
|
|
90
|
+
}
|
|
91
|
+
/** Called by Angular when the bound FormControl is programmatically disabled or enabled. */
|
|
92
|
+
setDisabledState(isDisabled) {
|
|
93
|
+
this.disabled = isDisabled;
|
|
94
|
+
this.cdr.markForCheck();
|
|
95
|
+
}
|
|
96
|
+
// ── Event handlers ──────────────────────────────────────────────────────────
|
|
97
|
+
onInput(event) {
|
|
98
|
+
const value = event.target.value;
|
|
99
|
+
this.value = value;
|
|
100
|
+
this._onChange(value);
|
|
101
|
+
this.valueChange.emit(value);
|
|
102
|
+
}
|
|
103
|
+
onBlur() {
|
|
104
|
+
this._onTouched();
|
|
105
|
+
this.cdr.markForCheck();
|
|
106
|
+
}
|
|
107
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TextInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
108
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: TextInputComponent, isStandalone: true, selector: "compsych-text-input", inputs: { label: "label", placeholder: "placeholder", value: "value", type: "type", size: "size", name: "name", id: "id", ariaDescribedBy: "ariaDescribedBy", required: ["required", "required", booleanAttribute], error: ["error", "error", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], readonly: ["readonly", "readonly", booleanAttribute] }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
109
|
+
<div [class]="wrapperClasses">
|
|
110
|
+
<label class="label" [for]="inputId">
|
|
111
|
+
{{ label }}
|
|
112
|
+
@if (isRequired) {
|
|
113
|
+
<span class="required-marker" aria-hidden="true"> *</span>
|
|
114
|
+
}
|
|
115
|
+
</label>
|
|
116
|
+
<input
|
|
117
|
+
class="input"
|
|
118
|
+
[id]="inputId"
|
|
119
|
+
[name]="name || inputId"
|
|
120
|
+
[type]="type"
|
|
121
|
+
[placeholder]="placeholder"
|
|
122
|
+
[value]="value"
|
|
123
|
+
[disabled]="disabled"
|
|
124
|
+
[readOnly]="readonly"
|
|
125
|
+
[attr.required]="isRequired ? '' : null"
|
|
126
|
+
[class.error]="hasError"
|
|
127
|
+
[attr.aria-invalid]="hasError ? 'true' : null"
|
|
128
|
+
[attr.aria-describedby]="ariaDescribedBy || null"
|
|
129
|
+
(input)="onInput($event)"
|
|
130
|
+
(blur)="onBlur()"
|
|
131
|
+
/>
|
|
132
|
+
</div>
|
|
133
|
+
`, isInline: true, styles: [":host{display:block}.cmp-text-field{display:flex;flex-direction:column;gap:var(--spacing-padding-sys-padding-4)}.label{font-family:var(--body-small-sys-font-family);font-size:var(--body-small-sys-font-size);font-weight:var(--body-small-sys-font-weight);line-height:var(--body-small-sys-line-height);color:var(--surface-surface-sys-on-surface)}.required-marker{color:var(--accent-primary-sys-primary)}.cmp-text-field.disabled .label{opacity:.48}.input{box-sizing:border-box;width:100%;margin:0;border:var(--border-width-sys-stroke-thin) solid var(--outline-sys-outline);border-radius:var(--border-radius-sys-radius-sm);background-color:var(--surface-surface-container-sys-surface-container-lowest);color:var(--surface-surface-sys-on-surface);font-family:var(--body-medium-sys-font-family);font-size:var(--body-medium-sys-font-size);font-weight:var(--body-medium-sys-font-weight);line-height:var(--body-medium-sys-line-height);appearance:none;-webkit-appearance:none;outline:none;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.input::placeholder{color:var(--surface-surface-sys-on-surface-variant)}.input:hover:not(:disabled):not(:focus){border-color:var(--outline-sys-outline-variant);box-shadow:0 4px 16px var(--transparent-neutral-sys-black-10),0 2px 4px #00000014}.input:focus{border-color:var(--accent-primary-sys-primary);border-width:var(--border-width-sys-stroke-medium);box-shadow:0 0 0 4px var(--transparent-primary-sys-primary-08)}.input.error:not(:disabled):not(:focus){border-color:var(--error-sys-error)}.input.error:focus{border-color:var(--error-sys-error);border-width:var(--border-width-sys-stroke-medium);box-shadow:0 0 0 4px var(--transparent-primary-sys-primary-08)}.input:disabled{background-color:var(--surface-surface-container-sys-surface-container-highest);color:var(--surface-surface-sys-on-surface-variant);border-color:var(--outline-sys-outline);cursor:not-allowed;opacity:.48}.cmp-text-field.small .input{height:44px;padding:var(--spacing-padding-sys-padding-8) var(--spacing-padding-sys-padding-12);font-size:var(--body-small-sys-font-size);line-height:var(--body-small-sys-line-height)}.cmp-text-field.medium .input{height:52px;padding:var(--spacing-padding-sys-padding-12) var(--spacing-padding-sys-padding-16);font-size:var(--body-medium-sys-font-size);line-height:var(--body-medium-sys-line-height)}.cmp-text-field.large .input{height:64px;padding:var(--spacing-padding-sys-padding-20) var(--spacing-padding-sys-padding-16);font-size:var(--body-large-sys-font-size);line-height:var(--body-large-sys-line-height)}@media(forced-colors:active){.input{border:1px solid ButtonText;forced-color-adjust:none}.input:focus{outline:2px solid Highlight;outline-offset:2px}.input:disabled{color:GrayText;border-color:GrayText;background:ButtonFace;opacity:1}.cmp-text-field.disabled .label{color:GrayText;opacity:1}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
134
|
+
}
|
|
135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TextInputComponent, decorators: [{
|
|
136
|
+
type: Component,
|
|
137
|
+
args: [{ selector: 'compsych-text-input', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
138
|
+
<div [class]="wrapperClasses">
|
|
139
|
+
<label class="label" [for]="inputId">
|
|
140
|
+
{{ label }}
|
|
141
|
+
@if (isRequired) {
|
|
142
|
+
<span class="required-marker" aria-hidden="true"> *</span>
|
|
143
|
+
}
|
|
144
|
+
</label>
|
|
145
|
+
<input
|
|
146
|
+
class="input"
|
|
147
|
+
[id]="inputId"
|
|
148
|
+
[name]="name || inputId"
|
|
149
|
+
[type]="type"
|
|
150
|
+
[placeholder]="placeholder"
|
|
151
|
+
[value]="value"
|
|
152
|
+
[disabled]="disabled"
|
|
153
|
+
[readOnly]="readonly"
|
|
154
|
+
[attr.required]="isRequired ? '' : null"
|
|
155
|
+
[class.error]="hasError"
|
|
156
|
+
[attr.aria-invalid]="hasError ? 'true' : null"
|
|
157
|
+
[attr.aria-describedby]="ariaDescribedBy || null"
|
|
158
|
+
(input)="onInput($event)"
|
|
159
|
+
(blur)="onBlur()"
|
|
160
|
+
/>
|
|
161
|
+
</div>
|
|
162
|
+
`, styles: [":host{display:block}.cmp-text-field{display:flex;flex-direction:column;gap:var(--spacing-padding-sys-padding-4)}.label{font-family:var(--body-small-sys-font-family);font-size:var(--body-small-sys-font-size);font-weight:var(--body-small-sys-font-weight);line-height:var(--body-small-sys-line-height);color:var(--surface-surface-sys-on-surface)}.required-marker{color:var(--accent-primary-sys-primary)}.cmp-text-field.disabled .label{opacity:.48}.input{box-sizing:border-box;width:100%;margin:0;border:var(--border-width-sys-stroke-thin) solid var(--outline-sys-outline);border-radius:var(--border-radius-sys-radius-sm);background-color:var(--surface-surface-container-sys-surface-container-lowest);color:var(--surface-surface-sys-on-surface);font-family:var(--body-medium-sys-font-family);font-size:var(--body-medium-sys-font-size);font-weight:var(--body-medium-sys-font-weight);line-height:var(--body-medium-sys-line-height);appearance:none;-webkit-appearance:none;outline:none;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.input::placeholder{color:var(--surface-surface-sys-on-surface-variant)}.input:hover:not(:disabled):not(:focus){border-color:var(--outline-sys-outline-variant);box-shadow:0 4px 16px var(--transparent-neutral-sys-black-10),0 2px 4px #00000014}.input:focus{border-color:var(--accent-primary-sys-primary);border-width:var(--border-width-sys-stroke-medium);box-shadow:0 0 0 4px var(--transparent-primary-sys-primary-08)}.input.error:not(:disabled):not(:focus){border-color:var(--error-sys-error)}.input.error:focus{border-color:var(--error-sys-error);border-width:var(--border-width-sys-stroke-medium);box-shadow:0 0 0 4px var(--transparent-primary-sys-primary-08)}.input:disabled{background-color:var(--surface-surface-container-sys-surface-container-highest);color:var(--surface-surface-sys-on-surface-variant);border-color:var(--outline-sys-outline);cursor:not-allowed;opacity:.48}.cmp-text-field.small .input{height:44px;padding:var(--spacing-padding-sys-padding-8) var(--spacing-padding-sys-padding-12);font-size:var(--body-small-sys-font-size);line-height:var(--body-small-sys-line-height)}.cmp-text-field.medium .input{height:52px;padding:var(--spacing-padding-sys-padding-12) var(--spacing-padding-sys-padding-16);font-size:var(--body-medium-sys-font-size);line-height:var(--body-medium-sys-line-height)}.cmp-text-field.large .input{height:64px;padding:var(--spacing-padding-sys-padding-20) var(--spacing-padding-sys-padding-16);font-size:var(--body-large-sys-font-size);line-height:var(--body-large-sys-line-height)}@media(forced-colors:active){.input{border:1px solid ButtonText;forced-color-adjust:none}.input:focus{outline:2px solid Highlight;outline-offset:2px}.input:disabled{color:GrayText;border-color:GrayText;background:ButtonFace;opacity:1}.cmp-text-field.disabled .label{color:GrayText;opacity:1}}\n"] }]
|
|
163
|
+
}], ctorParameters: () => [], propDecorators: { label: [{
|
|
164
|
+
type: Input
|
|
165
|
+
}], placeholder: [{
|
|
166
|
+
type: Input
|
|
167
|
+
}], value: [{
|
|
168
|
+
type: Input
|
|
169
|
+
}], type: [{
|
|
170
|
+
type: Input
|
|
171
|
+
}], size: [{
|
|
172
|
+
type: Input
|
|
173
|
+
}], name: [{
|
|
174
|
+
type: Input
|
|
175
|
+
}], id: [{
|
|
176
|
+
type: Input
|
|
177
|
+
}], ariaDescribedBy: [{
|
|
178
|
+
type: Input
|
|
179
|
+
}], required: [{
|
|
180
|
+
type: Input,
|
|
181
|
+
args: [{ transform: booleanAttribute }]
|
|
182
|
+
}], error: [{
|
|
183
|
+
type: Input,
|
|
184
|
+
args: [{ transform: booleanAttribute }]
|
|
185
|
+
}], disabled: [{
|
|
186
|
+
type: Input,
|
|
187
|
+
args: [{ transform: booleanAttribute }]
|
|
188
|
+
}], readonly: [{
|
|
189
|
+
type: Input,
|
|
190
|
+
args: [{ transform: booleanAttribute }]
|
|
191
|
+
}], valueChange: [{
|
|
192
|
+
type: Output
|
|
193
|
+
}] } });
|
|
194
|
+
//# sourceMappingURL=text-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-input.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/text-input/text-input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,KAAK,EACL,MAAM,EACN,gBAAgB,EAChB,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAwB,SAAS,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;;AAQ7E,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf;;;;;;;GAOG;AAiCH,MAAM,OAAO,kBAAkB;IACZ,OAAO,GAAG,kBAAk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AAC;QAClB,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;IAC1B,CAAC;wGA7GU,kBAAkB;4FAAlB,kBAAkB,wPAwCT,gBAAgB,6BAOhB,gBAAgB,sCAEhB,gBAAgB,sCAEhB,gBAAgB,sEA/E1B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBT;;4FAGU,kBAAkB;kBAhC9B,SAAS;+BACE,qBAAqB,cACnB,IAAI,mBACC,uBAAuB,CAAC,MAAM,YACrC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBT;;sBAmBA,KAAK;;sBAEL,KAAK;;sBAEL,KAAK;;sBAEL,KAAK;;sBAEL,KAAK;;sBAEL,KAAK;;sBAEL,KAAK;;sBAKL,KAAK;;sBAOL,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAOrC,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAErC,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAErC,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAGrC,MAAM","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n Output,\n booleanAttribute,\n inject,\n} from '@angular/core';\nimport { ControlValueAccessor, NgControl, Validators } from '@angular/forms';\n\n/** Size variant of a `compsych-text-input`. Controls input height, padding, and font size. */\nexport type TextInputSize = 'small' | 'medium' | 'large';\n\n/** Native input type. */\nexport type TextInputType = 'text' | 'password';\n\nlet nextId = 0;\n\n/**\n * A labelled text input that wraps a native `<input>` element.\n * Implements `ControlValueAccessor` so it works with both reactive forms\n * (`formControlName`, `[formControl]`) and template-driven forms (`ngModel`).\n * The error visual state is driven automatically by the bound `FormControl`'s\n * validity once the field has been touched, and can also be set explicitly via\n * the `error` input for use outside of Angular forms.\n */\n@Component({\n selector: 'compsych-text-input',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div [class]=\"wrapperClasses\">\n <label class=\"label\" [for]=\"inputId\">\n {{ label }}\n @if (isRequired) {\n <span class=\"required-marker\" aria-hidden=\"true\"> *</span>\n }\n </label>\n <input\n class=\"input\"\n [id]=\"inputId\"\n [name]=\"name || inputId\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [value]=\"value\"\n [disabled]=\"disabled\"\n [readOnly]=\"readonly\"\n [attr.required]=\"isRequired ? '' : null\"\n [class.error]=\"hasError\"\n [attr.aria-invalid]=\"hasError ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy || null\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n </div>\n `,\n styleUrl: './text-input.css',\n})\nexport class TextInputComponent implements ControlValueAccessor {\n private readonly _autoId = `cmp-text-input-${++nextId}`;\n private readonly cdr = inject(ChangeDetectorRef);\n private _onChange: (value: string) => void = () => {};\n private _onTouched: () => void = () => {};\n\n /** Injected when the component is used inside a reactive or template-driven form. */\n protected readonly ngControl: NgControl | null;\n\n constructor() {\n const ctrl = inject(NgControl, { optional: true, self: true });\n if (ctrl) ctrl.valueAccessor = this;\n this.ngControl = ctrl;\n }\n\n /** Label displayed above the input. */\n @Input() label = '';\n /** Placeholder text shown inside the input when empty. */\n @Input() placeholder = '';\n /** Current value of the input. When used in a form, the form controls the value. */\n @Input() value = '';\n /** Native input type. Defaults to `'text'`. Use `'password'` to mask the value. */\n @Input() type: TextInputType = 'text';\n /** Size variant — controls height, padding, and font size. Defaults to `'medium'`. */\n @Input() size: TextInputSize = 'medium';\n /** Native `name` attribute forwarded to the `<input>`. Defaults to the auto-generated id. */\n @Input() name?: string;\n /** Native `id` attribute for the `<input>`. Auto-generated if omitted. */\n @Input() id?: string;\n /**\n * Id(s) of external elements that describe the input, space-separated.\n * Forwarded to `aria-describedby` on the native `<input>`.\n */\n @Input() ariaDescribedBy?: string;\n\n /**\n * Adds a blue asterisk after the label. When used in a form, this is set\n * automatically if the bound `FormControl` has `Validators.required`.\n * Can also be set explicitly for non-form use. Supports boolean coercion.\n */\n @Input({ transform: booleanAttribute }) required = false;\n /**\n * Applies the error visual state (red border) explicitly. When used in a form,\n * the error state is driven automatically from the `FormControl`'s validity once\n * the field is touched — this input is only needed outside of forms.\n * Supports boolean coercion.\n */\n @Input({ transform: booleanAttribute }) error = false;\n /** Disables the input. When used in a form, also responds to `FormControl.disable()`. Supports boolean coercion. */\n @Input({ transform: booleanAttribute }) disabled = false;\n /** Makes the input read-only — focusable and copyable but not editable. Value is still submitted with the form. Supports boolean coercion. */\n @Input({ transform: booleanAttribute }) readonly = false;\n\n /** Emits the new string value whenever the user types. For use outside Angular forms; inside forms use the `FormControl` value stream. */\n @Output() readonly valueChange = new EventEmitter<string>();\n\n get inputId(): string {\n return this.id ?? this._autoId;\n }\n\n /** True when the bound FormControl is invalid and touched, or when `error` is explicitly set. */\n get hasError(): boolean {\n return this.error || !!(this.ngControl?.invalid && this.ngControl.touched);\n }\n\n /** True when `required` is set explicitly, or when the bound FormControl has Validators.required. */\n get isRequired(): boolean {\n return this.required || !!(this.ngControl?.control?.hasValidator(Validators.required));\n }\n\n get wrapperClasses(): string {\n return ['cmp-text-field', this.size, this.disabled ? 'disabled' : '']\n .filter(Boolean)\n .join(' ');\n }\n\n // ── ControlValueAccessor ────────────────────────────────────────────────────\n\n writeValue(value: string | null): void {\n this.value = value ?? '';\n this.cdr.markForCheck();\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n /** Called by Angular when the bound FormControl is programmatically disabled or enabled. */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.cdr.markForCheck();\n }\n\n // ── Event handlers ──────────────────────────────────────────────────────────\n\n protected onInput(event: Event): void {\n const value = (event.target as HTMLInputElement).value;\n this.value = value;\n this._onChange(value);\n this.valueChange.emit(value);\n }\n\n protected onBlur(): void {\n this._onTouched();\n this.cdr.markForCheck();\n }\n}\n"]}
|
package/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import * as i4 from "./lib/header-nav/header-nav";
|
|
|
6
6
|
import * as i5 from "./lib/sidebar/sidebar";
|
|
7
7
|
import * as i6 from "./lib/card-base/card";
|
|
8
8
|
import * as i7 from "./lib/card-grid/card-grid";
|
|
9
|
+
import * as i8 from "./lib/text-input/text-input";
|
|
9
10
|
export { ButtonComponent } from './lib/button/button';
|
|
10
11
|
export type { ButtonVariant, ButtonSize, ButtonType } from './lib/button/button';
|
|
11
12
|
export { AccordionComponent } from './lib/accordion/accordion';
|
|
@@ -21,8 +22,10 @@ export type { CardVariant, CardAppearance, CardRadius, CardPadding, CardOrientat
|
|
|
21
22
|
export { RippleDirective } from './lib/card-base/ripple.directive';
|
|
22
23
|
export { CardGridComponent } from './lib/card-grid/card-grid';
|
|
23
24
|
export type { CardGridLayout } from './lib/card-grid/card-grid';
|
|
25
|
+
export { TextInputComponent } from './lib/text-input/text-input';
|
|
26
|
+
export type { TextInputSize, TextInputType } from './lib/text-input/text-input';
|
|
24
27
|
export declare class CompsychAngularModule {
|
|
25
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<CompsychAngularModule, never>;
|
|
26
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<CompsychAngularModule, never, [typeof i1.ButtonComponent, typeof i2.AccordionComponent, typeof i3.FooterComponent, typeof i4.HeaderNavComponent, typeof i5.SidebarComponent, typeof i6.CardComponent, typeof i7.CardGridComponent], [typeof i1.ButtonComponent, typeof i2.AccordionComponent, typeof i3.FooterComponent, typeof i4.HeaderNavComponent, typeof i5.SidebarComponent, typeof i6.CardComponent, typeof i7.CardGridComponent]>;
|
|
29
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CompsychAngularModule, never, [typeof i1.ButtonComponent, typeof i2.AccordionComponent, typeof i3.FooterComponent, typeof i4.HeaderNavComponent, typeof i5.SidebarComponent, typeof i6.CardComponent, typeof i7.CardGridComponent, typeof i8.TextInputComponent], [typeof i1.ButtonComponent, typeof i2.AccordionComponent, typeof i3.FooterComponent, typeof i4.HeaderNavComponent, typeof i5.SidebarComponent, typeof i6.CardComponent, typeof i7.CardGridComponent, typeof i8.TextInputComponent]>;
|
|
27
30
|
static ɵinj: i0.ɵɵInjectorDeclaration<CompsychAngularModule>;
|
|
28
31
|
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor, NgControl } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/** Size variant of a `compsych-text-input`. Controls input height, padding, and font size. */
|
|
5
|
+
export type TextInputSize = 'small' | 'medium' | 'large';
|
|
6
|
+
/** Native input type. */
|
|
7
|
+
export type TextInputType = 'text' | 'password';
|
|
8
|
+
/**
|
|
9
|
+
* A labelled text input that wraps a native `<input>` element.
|
|
10
|
+
* Implements `ControlValueAccessor` so it works with both reactive forms
|
|
11
|
+
* (`formControlName`, `[formControl]`) and template-driven forms (`ngModel`).
|
|
12
|
+
* The error visual state is driven automatically by the bound `FormControl`'s
|
|
13
|
+
* validity once the field has been touched, and can also be set explicitly via
|
|
14
|
+
* the `error` input for use outside of Angular forms.
|
|
15
|
+
*/
|
|
16
|
+
export declare class TextInputComponent implements ControlValueAccessor {
|
|
17
|
+
private readonly _autoId;
|
|
18
|
+
private readonly cdr;
|
|
19
|
+
private _onChange;
|
|
20
|
+
private _onTouched;
|
|
21
|
+
/** Injected when the component is used inside a reactive or template-driven form. */
|
|
22
|
+
protected readonly ngControl: NgControl | null;
|
|
23
|
+
constructor();
|
|
24
|
+
/** Label displayed above the input. */
|
|
25
|
+
label: string;
|
|
26
|
+
/** Placeholder text shown inside the input when empty. */
|
|
27
|
+
placeholder: string;
|
|
28
|
+
/** Current value of the input. When used in a form, the form controls the value. */
|
|
29
|
+
value: string;
|
|
30
|
+
/** Native input type. Defaults to `'text'`. Use `'password'` to mask the value. */
|
|
31
|
+
type: TextInputType;
|
|
32
|
+
/** Size variant — controls height, padding, and font size. Defaults to `'medium'`. */
|
|
33
|
+
size: TextInputSize;
|
|
34
|
+
/** Native `name` attribute forwarded to the `<input>`. Defaults to the auto-generated id. */
|
|
35
|
+
name?: string;
|
|
36
|
+
/** Native `id` attribute for the `<input>`. Auto-generated if omitted. */
|
|
37
|
+
id?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Id(s) of external elements that describe the input, space-separated.
|
|
40
|
+
* Forwarded to `aria-describedby` on the native `<input>`.
|
|
41
|
+
*/
|
|
42
|
+
ariaDescribedBy?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Adds a blue asterisk after the label. When used in a form, this is set
|
|
45
|
+
* automatically if the bound `FormControl` has `Validators.required`.
|
|
46
|
+
* Can also be set explicitly for non-form use. Supports boolean coercion.
|
|
47
|
+
*/
|
|
48
|
+
required: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Applies the error visual state (red border) explicitly. When used in a form,
|
|
51
|
+
* the error state is driven automatically from the `FormControl`'s validity once
|
|
52
|
+
* the field is touched — this input is only needed outside of forms.
|
|
53
|
+
* Supports boolean coercion.
|
|
54
|
+
*/
|
|
55
|
+
error: boolean;
|
|
56
|
+
/** Disables the input. When used in a form, also responds to `FormControl.disable()`. Supports boolean coercion. */
|
|
57
|
+
disabled: boolean;
|
|
58
|
+
/** Makes the input read-only — focusable and copyable but not editable. Value is still submitted with the form. Supports boolean coercion. */
|
|
59
|
+
readonly: boolean;
|
|
60
|
+
/** Emits the new string value whenever the user types. For use outside Angular forms; inside forms use the `FormControl` value stream. */
|
|
61
|
+
readonly valueChange: EventEmitter<string>;
|
|
62
|
+
get inputId(): string;
|
|
63
|
+
/** True when the bound FormControl is invalid and touched, or when `error` is explicitly set. */
|
|
64
|
+
get hasError(): boolean;
|
|
65
|
+
/** True when `required` is set explicitly, or when the bound FormControl has Validators.required. */
|
|
66
|
+
get isRequired(): boolean;
|
|
67
|
+
get wrapperClasses(): string;
|
|
68
|
+
writeValue(value: string | null): void;
|
|
69
|
+
registerOnChange(fn: (value: string) => void): void;
|
|
70
|
+
registerOnTouched(fn: () => void): void;
|
|
71
|
+
/** Called by Angular when the bound FormControl is programmatically disabled or enabled. */
|
|
72
|
+
setDisabledState(isDisabled: boolean): void;
|
|
73
|
+
protected onInput(event: Event): void;
|
|
74
|
+
protected onBlur(): void;
|
|
75
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextInputComponent, never>;
|
|
76
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextInputComponent, "compsych-text-input", never, { "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "value": { "alias": "value"; "required": false; }; "type": { "alias": "type"; "required": false; }; "size": { "alias": "size"; "required": false; }; "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; }; "required": { "alias": "required"; "required": false; }; "error": { "alias": "error"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
77
|
+
static ngAcceptInputType_required: unknown;
|
|
78
|
+
static ngAcceptInputType_error: unknown;
|
|
79
|
+
static ngAcceptInputType_disabled: unknown;
|
|
80
|
+
static ngAcceptInputType_readonly: unknown;
|
|
81
|
+
}
|