ngwr 4.0.1 → 4.2.0
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/README.md +2 -2
- package/esm2022/icon/icon.component.mjs +6 -1
- package/esm2022/icon/icons.mjs +76 -1
- package/esm2022/input/input.component.mjs +31 -37
- package/fesm2022/ngwr-icon.mjs +81 -1
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +30 -36
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/icon/icon.component.d.ts +5 -0
- package/icon/icons.d.ts +106 -1
- package/input/input.component.d.ts +14 -19
- package/input/styles/_index.scss +19 -0
- package/input/styles/vars.scss +1 -0
- package/package.json +1 -1
- package/styles/variables.scss +0 -6
package/fesm2022/ngwr-input.mjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, booleanAttribute, forwardRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, NgModule } from '@angular/core';
|
|
3
|
+
import { signal, inject, ChangeDetectorRef, booleanAttribute, forwardRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, NgModule } from '@angular/core';
|
|
3
4
|
import * as i1 from '@angular/forms';
|
|
4
|
-
import {
|
|
5
|
+
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
5
6
|
import { noop } from 'rxjs';
|
|
6
7
|
import { WrAbstractBase } from 'ngwr/cdk';
|
|
7
|
-
import
|
|
8
|
+
import * as i2 from 'ngwr/icon';
|
|
9
|
+
import { provideWrIcons, eye, eyeOff, WrIconModule } from 'ngwr/icon';
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* @license
|
|
@@ -20,11 +22,6 @@ import { provideWrIcons, eye, eyeOff, WrIconComponent } from 'ngwr/icon';
|
|
|
20
22
|
class WrInputComponent extends WrAbstractBase {
|
|
21
23
|
constructor() {
|
|
22
24
|
super(...arguments);
|
|
23
|
-
this.formControl = new FormControl();
|
|
24
|
-
this.eyeOn = signal(true);
|
|
25
|
-
this.isFocused = signal(false);
|
|
26
|
-
this.onChange = noop;
|
|
27
|
-
this.onTouch = noop;
|
|
28
25
|
this.placeholder = '';
|
|
29
26
|
this.prefix = null;
|
|
30
27
|
this.suffix = null;
|
|
@@ -32,30 +29,13 @@ class WrInputComponent extends WrAbstractBase {
|
|
|
32
29
|
this.passwordIcons = false;
|
|
33
30
|
this.readonly = false;
|
|
34
31
|
this.type = 'text';
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
this.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this.
|
|
41
|
-
|
|
42
|
-
setDisabledState(isDisabled) {
|
|
43
|
-
if (isDisabled) {
|
|
44
|
-
return this.formControl.disable();
|
|
45
|
-
}
|
|
46
|
-
return this.formControl.enable();
|
|
47
|
-
}
|
|
48
|
-
writeValue(value) {
|
|
49
|
-
this.formControl.setValue(value, { emitEvent: false });
|
|
50
|
-
}
|
|
51
|
-
ngOnInit() {
|
|
52
|
-
// this.formControl.valueChanges
|
|
53
|
-
// .pipe(
|
|
54
|
-
// debounceTime(200),
|
|
55
|
-
// tap(value => this.onChange(value)),
|
|
56
|
-
// takeUntil(this.destroyed$)
|
|
57
|
-
// )
|
|
58
|
-
// .subscribe();
|
|
32
|
+
this.inputValue = signal(null);
|
|
33
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
34
|
+
this.eyeOn = signal(true);
|
|
35
|
+
this.isFocused = signal(false);
|
|
36
|
+
this.isDisabled = signal(false);
|
|
37
|
+
this.onChange = noop;
|
|
38
|
+
this.onTouch = noop;
|
|
59
39
|
}
|
|
60
40
|
get elClasses() {
|
|
61
41
|
return {
|
|
@@ -64,10 +44,24 @@ class WrInputComponent extends WrAbstractBase {
|
|
|
64
44
|
'wr-input--has-prefix': this.prefix,
|
|
65
45
|
'wr-input--has-suffix': this.suffix,
|
|
66
46
|
'wr-input--password': this.passwordIcons,
|
|
67
|
-
'wr-input--disabled': this.
|
|
47
|
+
'wr-input--disabled': this.isDisabled(),
|
|
68
48
|
'wr-input--focused': this.isFocused(),
|
|
69
49
|
};
|
|
70
50
|
}
|
|
51
|
+
registerOnChange(fn) {
|
|
52
|
+
this.onChange = fn;
|
|
53
|
+
}
|
|
54
|
+
registerOnTouched(fn) {
|
|
55
|
+
this.onTouch = fn;
|
|
56
|
+
}
|
|
57
|
+
setDisabledState(isDisabled) {
|
|
58
|
+
this.isDisabled.set(coerceBooleanProperty(isDisabled));
|
|
59
|
+
}
|
|
60
|
+
writeValue(value) {
|
|
61
|
+
this.value = value;
|
|
62
|
+
this.onChange(value);
|
|
63
|
+
this.cdr.markForCheck();
|
|
64
|
+
}
|
|
71
65
|
onPasswordVisibilityChange() {
|
|
72
66
|
if (this.type === 'password') {
|
|
73
67
|
this.type = 'text';
|
|
@@ -87,11 +81,11 @@ class WrInputComponent extends WrAbstractBase {
|
|
|
87
81
|
useExisting: forwardRef(() => WrInputComponent),
|
|
88
82
|
multi: true,
|
|
89
83
|
},
|
|
90
|
-
], usesInheritance: true, ngImport: i0, template: "@if (prefix) {\n <div class=\"wr-input-prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n </div>\n}\n\n<input\n class=\"wr-input__native\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [
|
|
84
|
+
], usesInheritance: true, ngImport: i0, template: "@if (prefix) {\n <div class=\"wr-input-prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n </div>\n}\n\n<input\n class=\"wr-input__native\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"inputValue()\"\n (ngModelChange)=\"writeValue($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n/>\n\n@if (passwordIcons) {\n <div class=\"wr-input-icon\" [class.wr-input-icon--disabled]=\"isDisabled()\" (click)=\"onPasswordVisibilityChange()\">\n <wr-icon class=\"wr-input-icon__icon\" [name]=\"eyeOn() ? 'eye' : 'eye-off'\" />\n </div>\n}\n\n@if (suffix) {\n <div class=\"wr-input-suffix\">\n <span class=\"wr-input-suffix__text\">{{ suffix }}</span>\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: WrIconModule }, { kind: "component", type: i2.WrIconComponent, selector: "wr-icon", inputs: ["name"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
91
85
|
}
|
|
92
86
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrInputComponent, decorators: [{
|
|
93
87
|
type: Component,
|
|
94
|
-
args: [{ standalone: true, selector: 'wr-input', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [FormsModule,
|
|
88
|
+
args: [{ standalone: true, selector: 'wr-input', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [FormsModule, WrIconModule], providers: [
|
|
95
89
|
provideWrIcons([eye, eyeOff]),
|
|
96
90
|
{
|
|
97
91
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -99,7 +93,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImpor
|
|
|
99
93
|
useExisting: forwardRef(() => WrInputComponent),
|
|
100
94
|
multi: true,
|
|
101
95
|
},
|
|
102
|
-
], template: "@if (prefix) {\n <div class=\"wr-input-prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n </div>\n}\n\n<input\n class=\"wr-input__native\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [
|
|
96
|
+
], template: "@if (prefix) {\n <div class=\"wr-input-prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n </div>\n}\n\n<input\n class=\"wr-input__native\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"inputValue()\"\n (ngModelChange)=\"writeValue($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n/>\n\n@if (passwordIcons) {\n <div class=\"wr-input-icon\" [class.wr-input-icon--disabled]=\"isDisabled()\" (click)=\"onPasswordVisibilityChange()\">\n <wr-icon class=\"wr-input-icon__icon\" [name]=\"eyeOn() ? 'eye' : 'eye-off'\" />\n </div>\n}\n\n@if (suffix) {\n <div class=\"wr-input-suffix\">\n <span class=\"wr-input-suffix__text\">{{ suffix }}</span>\n </div>\n}\n" }]
|
|
103
97
|
}], propDecorators: { placeholder: [{
|
|
104
98
|
type: Input
|
|
105
99
|
}], prefix: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-input.mjs","sources":["../../../projects/lib/input/input.component.ts","../../../projects/lib/input/input.component.html","../../../projects/lib/input/input.module.ts","../../../projects/lib/input/public-api.ts","../../../projects/lib/input/ngwr-input.ts"],"sourcesContent":["/**\n * @license\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://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n forwardRef,\n HostBinding,\n
|
|
1
|
+
{"version":3,"file":"ngwr-input.mjs","sources":["../../../projects/lib/input/input.component.ts","../../../projects/lib/input/input.component.html","../../../projects/lib/input/input.module.ts","../../../projects/lib/input/public-api.ts","../../../projects/lib/input/ngwr-input.ts"],"sourcesContent":["/**\n * @license\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://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n HostBinding,\n inject,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { noop } from 'rxjs';\n\nimport { WrAbstractBase } from 'ngwr/cdk';\nimport { SafeAny } from 'ngwr/cdk/types';\nimport { provideWrIcons, eye, eyeOff, WrIconModule } from 'ngwr/icon';\n\nimport { WrInputType } from './input-types';\n\n/**\n * NGWR input component.\n *\n * {@tutorial} [How to use wr-alert]{@link http://ngwr.dev/docs/components/input}\n */\n@Component({\n standalone: true,\n selector: 'wr-input',\n templateUrl: './input.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [FormsModule, WrIconModule],\n providers: [\n provideWrIcons([eye, eyeOff]),\n {\n provide: NG_VALUE_ACCESSOR,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrInputComponent),\n multi: true,\n },\n ],\n})\nexport class WrInputComponent extends WrAbstractBase implements ControlValueAccessor {\n @Input() placeholder = '';\n @Input() prefix: string | null = null;\n @Input() suffix: string | null = null;\n @Input({ transform: booleanAttribute }) rounded = false;\n @Input({ transform: booleanAttribute }) passwordIcons = false;\n @Input({ transform: booleanAttribute }) readonly = false;\n @Input() type: WrInputType = 'text';\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-input': true,\n 'wr-input--rounded': this.rounded,\n 'wr-input--has-prefix': this.prefix,\n 'wr-input--has-suffix': this.suffix,\n 'wr-input--password': this.passwordIcons,\n 'wr-input--disabled': this.isDisabled(),\n 'wr-input--focused': this.isFocused(),\n };\n }\n\n protected readonly inputValue = signal<string | null>(null);\n\n protected value?: string;\n\n private readonly cdr = inject(ChangeDetectorRef);\n protected readonly eyeOn = signal(true);\n protected readonly isFocused = signal(false);\n protected readonly isDisabled = signal(false);\n\n onChange: (value: string) => void = noop;\n onTouch: () => void = noop;\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.isDisabled.set(coerceBooleanProperty(isDisabled));\n }\n\n writeValue(value: string): void {\n this.value = value;\n this.onChange(value);\n this.cdr.markForCheck();\n }\n\n onPasswordVisibilityChange(): void {\n if (this.type === 'password') {\n this.type = 'text';\n this.eyeOn.set(false);\n } else {\n this.type = 'password';\n this.eyeOn.set(true);\n }\n }\n}\n","@if (prefix) {\n <div class=\"wr-input-prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n </div>\n}\n\n<input\n class=\"wr-input__native\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"inputValue()\"\n (ngModelChange)=\"writeValue($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n/>\n\n@if (passwordIcons) {\n <div class=\"wr-input-icon\" [class.wr-input-icon--disabled]=\"isDisabled()\" (click)=\"onPasswordVisibilityChange()\">\n <wr-icon class=\"wr-input-icon__icon\" [name]=\"eyeOn() ? 'eye' : 'eye-off'\" />\n </div>\n}\n\n@if (suffix) {\n <div class=\"wr-input-suffix\">\n <span class=\"wr-input-suffix__text\">{{ suffix }}</span>\n </div>\n}\n","/**\n * @license\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://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\nimport { NgModule } from '@angular/core';\n\nimport { WrInputComponent } from './input.component';\n\n@NgModule({\n imports: [WrInputComponent],\n exports: [WrInputComponent],\n})\nexport class WrInputModule {}\n","/**\n * @license\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://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './input-types';\nexport * from './input.component';\nexport * from './input.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;AAKG;AAyBH;;;;AAIG;AAkBG,MAAO,gBAAiB,SAAQ,cAAc,CAAA;AAjBpD,IAAA,WAAA,GAAA;;QAkBW,IAAW,CAAA,WAAA,GAAG,EAAE,CAAC;QACjB,IAAM,CAAA,MAAA,GAAkB,IAAI,CAAC;QAC7B,IAAM,CAAA,MAAA,GAAkB,IAAI,CAAC;QACE,IAAO,CAAA,OAAA,GAAG,KAAK,CAAC;QAChB,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC;QACtB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;QAChD,IAAI,CAAA,IAAA,GAAgB,MAAM,CAAC;AAejB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAC;AAI3C,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAC9B,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AACrB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAE9C,IAAQ,CAAA,QAAA,GAA4B,IAAI,CAAC;QACzC,IAAO,CAAA,OAAA,GAAe,IAAI,CAAC;AA6B5B,KAAA;AApD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gBAAgB,EAAE,CAAA;gBAC7B,IAAI,EAAA,CAAA;sBAAZ,KAAK;gBAGF,SAAS,EAAA,CAAA;sBADZ,WAAW;uBAAC,OAAO,CAAA;;;AE7DtB;;;;;AAKG;MASU,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;+GAAb,aAAa,EAAA,OAAA,EAAA,CAHd,gBAAgB,CAAA,EAAA,OAAA,EAAA,CAChB,gBAAgB,CAAA,EAAA,CAAA,CAAA,EAAA;AAEf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YAHd,gBAAgB,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGf,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,OAAO,EAAE,CAAC,gBAAgB,CAAC;AAC5B,iBAAA,CAAA;;;ACbD;;;;;AAKG;;ACLH;;AAEG;;;;"}
|
package/icon/icon.component.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { SafeAny } from 'ngwr/cdk/types';
|
|
2
2
|
import { wrIconName } from './icons';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* NGWR icon component.
|
|
6
|
+
*
|
|
7
|
+
* {@tutorial} [How to use wr-btn]{@link http://ngwr.dev/docs/components/icon}
|
|
8
|
+
*/
|
|
4
9
|
export declare class WrIconComponent {
|
|
5
10
|
set name(value: wrIconName);
|
|
6
11
|
get elClasses(): SafeAny;
|
package/icon/icons.d.ts
CHANGED
|
@@ -242,22 +242,62 @@ export declare const logoAppstore: {
|
|
|
242
242
|
name: 'logo-appstore';
|
|
243
243
|
data: string;
|
|
244
244
|
};
|
|
245
|
+
export declare const logoBankCenterCredit: {
|
|
246
|
+
name: 'logo-bank-center-credit';
|
|
247
|
+
data: string;
|
|
248
|
+
};
|
|
249
|
+
export declare const logoChrome: {
|
|
250
|
+
name: 'logo-chrome';
|
|
251
|
+
data: string;
|
|
252
|
+
};
|
|
253
|
+
export declare const logoDiscord: {
|
|
254
|
+
name: 'logo-discord';
|
|
255
|
+
data: string;
|
|
256
|
+
};
|
|
245
257
|
export declare const logoFirebase: {
|
|
246
258
|
name: 'logo-firebase';
|
|
247
259
|
data: string;
|
|
248
260
|
};
|
|
261
|
+
export declare const logoForteBank: {
|
|
262
|
+
name: 'logo-forte-bank';
|
|
263
|
+
data: string;
|
|
264
|
+
};
|
|
249
265
|
export declare const logoGithub: {
|
|
250
266
|
name: 'logo-github';
|
|
251
267
|
data: string;
|
|
252
268
|
};
|
|
269
|
+
export declare const logoGitlab: {
|
|
270
|
+
name: 'logo-gitlab';
|
|
271
|
+
data: string;
|
|
272
|
+
};
|
|
253
273
|
export declare const logoGooglePlay: {
|
|
254
274
|
name: 'logo-google-play';
|
|
255
275
|
data: string;
|
|
256
276
|
};
|
|
277
|
+
export declare const logoHalykBank: {
|
|
278
|
+
name: 'logo-halyk-bank';
|
|
279
|
+
data: string;
|
|
280
|
+
};
|
|
281
|
+
export declare const logoInstagram: {
|
|
282
|
+
name: 'logo-instagram';
|
|
283
|
+
data: string;
|
|
284
|
+
};
|
|
285
|
+
export declare const logoJusanBank: {
|
|
286
|
+
name: 'logo-jusan-bank';
|
|
287
|
+
data: string;
|
|
288
|
+
};
|
|
289
|
+
export declare const logoKaspiBank: {
|
|
290
|
+
name: 'logo-kaspi-bank';
|
|
291
|
+
data: string;
|
|
292
|
+
};
|
|
257
293
|
export declare const logoNpm: {
|
|
258
294
|
name: 'logo-npm';
|
|
259
295
|
data: string;
|
|
260
296
|
};
|
|
297
|
+
export declare const logoOtbasyBank: {
|
|
298
|
+
name: 'logo-otbasy-bank';
|
|
299
|
+
data: string;
|
|
300
|
+
};
|
|
261
301
|
export declare const logoOversecured: {
|
|
262
302
|
name: 'logo-oversecured';
|
|
263
303
|
data: string;
|
|
@@ -270,6 +310,26 @@ export declare const logoStingray: {
|
|
|
270
310
|
name: 'logo-stingray';
|
|
271
311
|
data: string;
|
|
272
312
|
};
|
|
313
|
+
export declare const logoTelegram: {
|
|
314
|
+
name: 'logo-telegram';
|
|
315
|
+
data: string;
|
|
316
|
+
};
|
|
317
|
+
export declare const logoVk: {
|
|
318
|
+
name: 'logo-vk';
|
|
319
|
+
data: string;
|
|
320
|
+
};
|
|
321
|
+
export declare const logoWhatsapp: {
|
|
322
|
+
name: 'logo-whatsapp';
|
|
323
|
+
data: string;
|
|
324
|
+
};
|
|
325
|
+
export declare const logoYandexCloud: {
|
|
326
|
+
name: 'logo-yandex-cloud';
|
|
327
|
+
data: string;
|
|
328
|
+
};
|
|
329
|
+
export declare const logoYandexTracker: {
|
|
330
|
+
name: 'logo-yandex-tracker';
|
|
331
|
+
data: string;
|
|
332
|
+
};
|
|
273
333
|
export declare const modules: {
|
|
274
334
|
name: 'modules';
|
|
275
335
|
data: string;
|
|
@@ -374,7 +434,7 @@ export declare const warning: {
|
|
|
374
434
|
name: 'warning';
|
|
375
435
|
data: string;
|
|
376
436
|
};
|
|
377
|
-
export type wrIconName = 'add-circle-outline' | 'add-circle' | 'add' | 'alert-circle-outline' | 'alert-circle' | 'alert-squircle' | 'alert' | 'arrow-back-circle' | 'arrow-back' | 'arrow-bottom-circle' | 'arrow-bottom' | 'arrow-forward-circle' | 'arrow-forward' | 'arrow-top-circle' | 'arrow-top' | 'bug-outline' | 'bug' | 'caret-back-circle' | 'caret-back' | 'caret-forward-circle' | 'caret-forward' | 'checkmark-circle-outline' | 'checkmark-circle' | 'checkmark' | 'chevron-down' | 'chevron-up' | 'close-circle-outline' | 'close-circle' | 'close' | 'cog' | 'copy-outline' | 'copy' | 'discover' | 'document' | 'dots-horizontal' | 'dots-vertical' | 'download' | 'external-outline' | 'eye-off' | 'eye' | 'file-aab' | 'file-apk' | 'file-apks' | 'file-ipa' | 'file-zip' | 'filter-outline' | 'filter' | 'flash' | 'folder' | 'help' | 'home' | 'info-circle-outline' | 'lock-opened' | 'lock' | 'logo-android' | 'logo-angular' | 'logo-app-center' | 'logo-app-gallery' | 'logo-apple' | 'logo-appscreener' | 'logo-appstore' | 'logo-firebase' | 'logo-github' | 'logo-google-play' | 'logo-npm' | 'logo-oversecured' | 'logo-rustore' | 'logo-stingray' | 'modules' | 'moon' | 'play-back' | 'play-circle' | 'play-forward' | 'play' | 'plus-circle' | 'reader' | 'repeat' | 'search' | 'shield-checkmark-outline' | 'shield-checkmark' | 'shield-outline' | 'shield' | 'shuffle' | 'stop-circle' | 'stop' | 'sun' | 'terminal' | 'time' | 'trash' | 'user-add' | 'user-circle' | 'user-remove' | 'user' | 'warning';
|
|
437
|
+
export type wrIconName = 'add-circle-outline' | 'add-circle' | 'add' | 'alert-circle-outline' | 'alert-circle' | 'alert-squircle' | 'alert' | 'arrow-back-circle' | 'arrow-back' | 'arrow-bottom-circle' | 'arrow-bottom' | 'arrow-forward-circle' | 'arrow-forward' | 'arrow-top-circle' | 'arrow-top' | 'bug-outline' | 'bug' | 'caret-back-circle' | 'caret-back' | 'caret-forward-circle' | 'caret-forward' | 'checkmark-circle-outline' | 'checkmark-circle' | 'checkmark' | 'chevron-down' | 'chevron-up' | 'close-circle-outline' | 'close-circle' | 'close' | 'cog' | 'copy-outline' | 'copy' | 'discover' | 'document' | 'dots-horizontal' | 'dots-vertical' | 'download' | 'external-outline' | 'eye-off' | 'eye' | 'file-aab' | 'file-apk' | 'file-apks' | 'file-ipa' | 'file-zip' | 'filter-outline' | 'filter' | 'flash' | 'folder' | 'help' | 'home' | 'info-circle-outline' | 'lock-opened' | 'lock' | 'logo-android' | 'logo-angular' | 'logo-app-center' | 'logo-app-gallery' | 'logo-apple' | 'logo-appscreener' | 'logo-appstore' | 'logo-bank-center-credit' | 'logo-chrome' | 'logo-discord' | 'logo-firebase' | 'logo-forte-bank' | 'logo-github' | 'logo-gitlab' | 'logo-google-play' | 'logo-halyk-bank' | 'logo-instagram' | 'logo-jusan-bank' | 'logo-kaspi-bank' | 'logo-npm' | 'logo-otbasy-bank' | 'logo-oversecured' | 'logo-rustore' | 'logo-stingray' | 'logo-telegram' | 'logo-vk' | 'logo-whatsapp' | 'logo-yandex-cloud' | 'logo-yandex-tracker' | 'modules' | 'moon' | 'play-back' | 'play-circle' | 'play-forward' | 'play' | 'plus-circle' | 'reader' | 'repeat' | 'search' | 'shield-checkmark-outline' | 'shield-checkmark' | 'shield-outline' | 'shield' | 'shuffle' | 'stop-circle' | 'stop' | 'sun' | 'terminal' | 'time' | 'trash' | 'user-add' | 'user-circle' | 'user-remove' | 'user' | 'warning';
|
|
378
438
|
export interface WrIcon {
|
|
379
439
|
name: wrIconName;
|
|
380
440
|
data: string;
|
|
@@ -563,18 +623,48 @@ export declare const wrIconSet: ({
|
|
|
563
623
|
} | {
|
|
564
624
|
name: 'logo-appstore';
|
|
565
625
|
data: string;
|
|
626
|
+
} | {
|
|
627
|
+
name: 'logo-bank-center-credit';
|
|
628
|
+
data: string;
|
|
629
|
+
} | {
|
|
630
|
+
name: 'logo-chrome';
|
|
631
|
+
data: string;
|
|
632
|
+
} | {
|
|
633
|
+
name: 'logo-discord';
|
|
634
|
+
data: string;
|
|
566
635
|
} | {
|
|
567
636
|
name: 'logo-firebase';
|
|
568
637
|
data: string;
|
|
638
|
+
} | {
|
|
639
|
+
name: 'logo-forte-bank';
|
|
640
|
+
data: string;
|
|
569
641
|
} | {
|
|
570
642
|
name: 'logo-github';
|
|
571
643
|
data: string;
|
|
644
|
+
} | {
|
|
645
|
+
name: 'logo-gitlab';
|
|
646
|
+
data: string;
|
|
572
647
|
} | {
|
|
573
648
|
name: 'logo-google-play';
|
|
574
649
|
data: string;
|
|
650
|
+
} | {
|
|
651
|
+
name: 'logo-halyk-bank';
|
|
652
|
+
data: string;
|
|
653
|
+
} | {
|
|
654
|
+
name: 'logo-instagram';
|
|
655
|
+
data: string;
|
|
656
|
+
} | {
|
|
657
|
+
name: 'logo-jusan-bank';
|
|
658
|
+
data: string;
|
|
659
|
+
} | {
|
|
660
|
+
name: 'logo-kaspi-bank';
|
|
661
|
+
data: string;
|
|
575
662
|
} | {
|
|
576
663
|
name: 'logo-npm';
|
|
577
664
|
data: string;
|
|
665
|
+
} | {
|
|
666
|
+
name: 'logo-otbasy-bank';
|
|
667
|
+
data: string;
|
|
578
668
|
} | {
|
|
579
669
|
name: 'logo-oversecured';
|
|
580
670
|
data: string;
|
|
@@ -584,6 +674,21 @@ export declare const wrIconSet: ({
|
|
|
584
674
|
} | {
|
|
585
675
|
name: 'logo-stingray';
|
|
586
676
|
data: string;
|
|
677
|
+
} | {
|
|
678
|
+
name: 'logo-telegram';
|
|
679
|
+
data: string;
|
|
680
|
+
} | {
|
|
681
|
+
name: 'logo-vk';
|
|
682
|
+
data: string;
|
|
683
|
+
} | {
|
|
684
|
+
name: 'logo-whatsapp';
|
|
685
|
+
data: string;
|
|
686
|
+
} | {
|
|
687
|
+
name: 'logo-yandex-cloud';
|
|
688
|
+
data: string;
|
|
689
|
+
} | {
|
|
690
|
+
name: 'logo-yandex-tracker';
|
|
691
|
+
data: string;
|
|
587
692
|
} | {
|
|
588
693
|
name: 'modules';
|
|
589
694
|
data: string;
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @license
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
5
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
6
|
-
*/
|
|
7
|
-
import { OnInit } from '@angular/core';
|
|
8
|
-
import { ControlValueAccessor, FormControl } from '@angular/forms';
|
|
1
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
9
2
|
import { WrAbstractBase } from 'ngwr/cdk';
|
|
10
3
|
import { SafeAny } from 'ngwr/cdk/types';
|
|
11
4
|
import { WrInputType } from './input-types';
|
|
@@ -15,17 +8,7 @@ import * as i0 from "@angular/core";
|
|
|
15
8
|
*
|
|
16
9
|
* {@tutorial} [How to use wr-alert]{@link http://ngwr.dev/docs/components/input}
|
|
17
10
|
*/
|
|
18
|
-
export declare class WrInputComponent extends WrAbstractBase implements ControlValueAccessor
|
|
19
|
-
formControl: FormControl;
|
|
20
|
-
protected readonly eyeOn: import("@angular/core").WritableSignal<boolean>;
|
|
21
|
-
protected readonly isFocused: import("@angular/core").WritableSignal<boolean>;
|
|
22
|
-
onChange: (value: string) => void;
|
|
23
|
-
onTouch: () => void;
|
|
24
|
-
registerOnChange(fn: (value: string) => void): void;
|
|
25
|
-
registerOnTouched(fn: () => void): void;
|
|
26
|
-
setDisabledState(isDisabled: boolean): void;
|
|
27
|
-
writeValue(value: string): void;
|
|
28
|
-
ngOnInit(): void;
|
|
11
|
+
export declare class WrInputComponent extends WrAbstractBase implements ControlValueAccessor {
|
|
29
12
|
placeholder: string;
|
|
30
13
|
prefix: string | null;
|
|
31
14
|
suffix: string | null;
|
|
@@ -34,6 +17,18 @@ export declare class WrInputComponent extends WrAbstractBase implements ControlV
|
|
|
34
17
|
readonly: boolean;
|
|
35
18
|
type: WrInputType;
|
|
36
19
|
get elClasses(): SafeAny;
|
|
20
|
+
protected readonly inputValue: import("@angular/core").WritableSignal<string | null>;
|
|
21
|
+
protected value?: string;
|
|
22
|
+
private readonly cdr;
|
|
23
|
+
protected readonly eyeOn: import("@angular/core").WritableSignal<boolean>;
|
|
24
|
+
protected readonly isFocused: import("@angular/core").WritableSignal<boolean>;
|
|
25
|
+
protected readonly isDisabled: import("@angular/core").WritableSignal<boolean>;
|
|
26
|
+
onChange: (value: string) => void;
|
|
27
|
+
onTouch: () => void;
|
|
28
|
+
registerOnChange(fn: (value: string) => void): void;
|
|
29
|
+
registerOnTouched(fn: () => void): void;
|
|
30
|
+
setDisabledState(isDisabled: boolean): void;
|
|
31
|
+
writeValue(value: string): void;
|
|
37
32
|
onPasswordVisibilityChange(): void;
|
|
38
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<WrInputComponent, never>;
|
|
39
34
|
static ɵcmp: i0.ɵɵComponentDeclaration<WrInputComponent, "wr-input", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "suffix": { "alias": "suffix"; "required": false; }; "rounded": { "alias": "rounded"; "required": false; }; "passwordIcons": { "alias": "passwordIcons"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, {}, never, never, true, never>;
|
package/input/styles/_index.scss
CHANGED
|
@@ -104,4 +104,23 @@
|
|
|
104
104
|
--wr-input-icon-color: var(--wr-color-primary);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
+
|
|
108
|
+
&-prefix,
|
|
109
|
+
&-suffix {
|
|
110
|
+
color: var(--wr-input-suffix-prefix-color);
|
|
111
|
+
font-size: inherit;
|
|
112
|
+
font-weight: inherit;
|
|
113
|
+
line-height: inherit;
|
|
114
|
+
|
|
115
|
+
padding-top: var(--wr-input-padding-y);
|
|
116
|
+
padding-bottom: var(--wr-input-padding-y);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&-prefix {
|
|
120
|
+
padding-left: var(--wr-input-padding-x);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&-suffix {
|
|
124
|
+
padding-right: var(--wr-input-padding-x);
|
|
125
|
+
}
|
|
107
126
|
}
|
package/input/styles/vars.scss
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--wr-input-color: var(--wr-color-dark);
|
|
3
3
|
--wr-input-placeholder-color: var(--wr-color-light);
|
|
4
|
+
--wr-input-suffix-prefix-color: var(--wr-color-medium);
|
|
4
5
|
--wr-input-bg-color: var(--wr-color-white);
|
|
5
6
|
--wr-input-border-color: var(--wr-color-light-lighter);
|
|
6
7
|
--wr-input-border-radius: 0.375rem;
|
package/package.json
CHANGED
package/styles/variables.scss
CHANGED
|
@@ -68,11 +68,5 @@ html {
|
|
|
68
68
|
|
|
69
69
|
/* Checkbox */
|
|
70
70
|
--wr-checkbox-color-base: var(--wr-color-white);
|
|
71
|
-
|
|
72
|
-
--wr-input-bg: #18152a;
|
|
73
|
-
--wr-input-suffix-prefix-color: rgba(var(--wr-color-white-rgb), 0.5);
|
|
74
|
-
--wr-input-suffix-prefix-bg: rgba(var(--wr-color-primary-rgb), 0.125);
|
|
75
|
-
--wr-input-border-color: #493d7e;
|
|
76
|
-
--wr-input-color: #fff;
|
|
77
71
|
}
|
|
78
72
|
}
|