kz-au-fa-input 1.0.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 +7 -0
- package/fesm2022/kz-au-fa-input.mjs +69 -0
- package/fesm2022/kz-au-fa-input.mjs.map +1 -0
- package/package.json +26 -0
- package/types/kz-au-fa-input.d.ts +22 -0
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { HostListener, Directive, HostBinding, ContentChild, Input, Component } from '@angular/core';
|
|
3
|
+
import { NgClass } from '@angular/common';
|
|
4
|
+
|
|
5
|
+
class InputRefDirective {
|
|
6
|
+
focus = false;
|
|
7
|
+
onFocus() {
|
|
8
|
+
this.focus = true;
|
|
9
|
+
}
|
|
10
|
+
onBlur() {
|
|
11
|
+
this.focus = false;
|
|
12
|
+
}
|
|
13
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: InputRefDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
14
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: InputRefDirective, isStandalone: true, selector: "input[auInputRef]", host: { listeners: { "focus": "onFocus()", "blur": "onBlur()" } }, ngImport: i0 });
|
|
15
|
+
}
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: InputRefDirective, decorators: [{
|
|
17
|
+
type: Directive,
|
|
18
|
+
args: [{
|
|
19
|
+
selector: 'input[auInputRef]',
|
|
20
|
+
}]
|
|
21
|
+
}], propDecorators: { onFocus: [{
|
|
22
|
+
type: HostListener,
|
|
23
|
+
args: ['focus']
|
|
24
|
+
}], onBlur: [{
|
|
25
|
+
type: HostListener,
|
|
26
|
+
args: ['blur']
|
|
27
|
+
}] } });
|
|
28
|
+
|
|
29
|
+
class AuFaInput {
|
|
30
|
+
icon = '';
|
|
31
|
+
input = null;
|
|
32
|
+
ngAfterContentInit() {
|
|
33
|
+
if (!this.input) {
|
|
34
|
+
console.error('the au-fa-input needs an input inside its content');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
get isInputFocus() {
|
|
38
|
+
return this.input ? this.input.focus : false;
|
|
39
|
+
}
|
|
40
|
+
get classes() {
|
|
41
|
+
const cssClasses = {};
|
|
42
|
+
if (this.icon) {
|
|
43
|
+
cssClasses['fa-' + this.icon] = true;
|
|
44
|
+
}
|
|
45
|
+
return cssClasses;
|
|
46
|
+
}
|
|
47
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AuFaInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
48
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: AuFaInput, isStandalone: true, selector: "lib-au-fa-input", inputs: { icon: "icon" }, host: { properties: { "class.input-focus": "this.isInputFocus" } }, queries: [{ propertyName: "input", first: true, predicate: InputRefDirective, descendants: true }], ngImport: i0, template: "<i class=\"icon fa\" [ngClass]=\"classes\"></i>\n<ng-content></ng-content>", styles: [".icon{width:20px;text-align:center;padding-left:5px;padding-right:2px;border:none;vertical-align:middle}:host{border-width:1px;border-style:solid;padding:1px 0;display:inline-block}:host(.input-focus){outline:none;border:1px solid #4D90FE;-webkit-box-shadow:0px 0px 5px #4D90FE;box-shadow:0 0 5px #4d90fe}:host ::ng-deep input{border:none;outline:none;height:100%;margin:1px 0;box-sizing:border-box}:host{background:#fff;border-color:#d3d3d3}:host(.input-focus){border-color:#4d90fe;-webkit-box-shadow:0px 0px 5px #4D90FE;box-shadow:0 0 5px #4d90fe}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
49
|
+
}
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AuFaInput, decorators: [{
|
|
51
|
+
type: Component,
|
|
52
|
+
args: [{ selector: 'lib-au-fa-input', imports: [NgClass], template: "<i class=\"icon fa\" [ngClass]=\"classes\"></i>\n<ng-content></ng-content>", styles: [".icon{width:20px;text-align:center;padding-left:5px;padding-right:2px;border:none;vertical-align:middle}:host{border-width:1px;border-style:solid;padding:1px 0;display:inline-block}:host(.input-focus){outline:none;border:1px solid #4D90FE;-webkit-box-shadow:0px 0px 5px #4D90FE;box-shadow:0 0 5px #4d90fe}:host ::ng-deep input{border:none;outline:none;height:100%;margin:1px 0;box-sizing:border-box}:host{background:#fff;border-color:#d3d3d3}:host(.input-focus){border-color:#4d90fe;-webkit-box-shadow:0px 0px 5px #4D90FE;box-shadow:0 0 5px #4d90fe}\n"] }]
|
|
53
|
+
}], propDecorators: { icon: [{
|
|
54
|
+
type: Input,
|
|
55
|
+
args: [{ required: true }]
|
|
56
|
+
}], input: [{
|
|
57
|
+
type: ContentChild,
|
|
58
|
+
args: [InputRefDirective]
|
|
59
|
+
}], isInputFocus: [{
|
|
60
|
+
type: HostBinding,
|
|
61
|
+
args: ['class.input-focus']
|
|
62
|
+
}] } });
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Generated bundle index. Do not edit.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
export { AuFaInput, InputRefDirective };
|
|
69
|
+
//# sourceMappingURL=kz-au-fa-input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kz-au-fa-input.mjs","sources":["../../../../libs/au-fa-input/src/lib/common/input-ref.ts","../../../../libs/au-fa-input/src/lib/au-fa-input/au-fa-input.ts","../../../../libs/au-fa-input/src/lib/au-fa-input/au-fa-input.html","../../../../libs/au-fa-input/src/kz-au-fa-input.ts"],"sourcesContent":["import { Directive, HostListener } from '@angular/core';\n\n@Directive({\n selector: 'input[auInputRef]',\n})\nexport class InputRefDirective {\n focus = false;\n\n @HostListener('focus')\n onFocus() {\n this.focus = true;\n }\n\n @HostListener('blur')\n onBlur() {\n this.focus = false;\n }\n}\n","import { AfterContentInit, Component, ContentChild, HostBinding, Input } from '@angular/core';\n\nimport { InputRefDirective } from './../common/input-ref';\nimport { NgClass } from '@angular/common';\n\n@Component({\n selector: 'lib-au-fa-input',\n imports: [NgClass],\n templateUrl: './au-fa-input.html',\n styleUrl: './au-fa-input.scss',\n})\nexport class AuFaInput implements AfterContentInit {\n @Input({ required: true })\n icon = '';\n\n @ContentChild(InputRefDirective)\n input: InputRefDirective | null = null;\n\n ngAfterContentInit(): void {\n if (!this.input) {\n console.error('the au-fa-input needs an input inside its content');\n }\n }\n\n @HostBinding('class.input-focus')\n get isInputFocus() {\n return this.input ? this.input.focus : false;\n }\n\n get classes(): object {\n const cssClasses: { [key: string]: boolean } = {};\n\n if (this.icon) {\n cssClasses['fa-' + this.icon] = true;\n }\n\n return cssClasses;\n }\n}\n","<i class=\"icon fa\" [ngClass]=\"classes\"></i>\n<ng-content></ng-content>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAKa,iBAAiB,CAAA;IAC5B,KAAK,GAAG,KAAK;IAGb,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI;IACnB;IAGA,MAAM,GAAA;AACJ,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK;IACpB;uGAXW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,MAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAH7B,SAAS;AAAC,Y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yB,imBDMb,OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAIN,SAAS,EAAA,UAAA,EAAA,CAAA;kBANrB,SAAS;+BACE,iBAAiB,EAAA,OAAA,EAClB,CAAC,OAAO,CAAC,EAAA,QAAA,EAAA,4EAAA,EAAA,MAAA,EAAA,CAAA,yiBAAA,CAAA,EAAA;;sBAKjB,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAGxB,YAAY;uBAAC,iBAAiB;;sBAS9B,WAAW;uBAAC,mBAAmB;;;AExBlC;;AAEG;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kz-au-fa-input",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^21.0.0",
|
|
6
|
+
"@angular/core": "^21.0.0",
|
|
7
|
+
"vite": "^7.0.0",
|
|
8
|
+
"@analogjs/vite-plugin-angular": "~2.1.2",
|
|
9
|
+
"@nx/vite": "22.3.3"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"module": "fesm2022/kz-au-fa-input.mjs",
|
|
13
|
+
"typings": "types/kz-au-fa-input.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./types/kz-au-fa-input.d.ts",
|
|
20
|
+
"default": "./fesm2022/kz-au-fa-input.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"tslib": "^2.3.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { AfterContentInit } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
declare class InputRefDirective {
|
|
5
|
+
focus: boolean;
|
|
6
|
+
onFocus(): void;
|
|
7
|
+
onBlur(): void;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InputRefDirective, never>;
|
|
9
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<InputRefDirective, "input[auInputRef]", never, {}, {}, never, never, true, never>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare class AuFaInput implements AfterContentInit {
|
|
13
|
+
icon: string;
|
|
14
|
+
input: InputRefDirective | null;
|
|
15
|
+
ngAfterContentInit(): void;
|
|
16
|
+
get isInputFocus(): boolean;
|
|
17
|
+
get classes(): object;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuFaInput, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AuFaInput, "lib-au-fa-input", never, { "icon": { "alias": "icon"; "required": true; }; }, {}, ["input"], ["*"], true, never>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { AuFaInput, InputRefDirective };
|