ngx-utils-lite 0.0.1 → 0.0.2
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Input, Directive, EventEmitter, HostListener, Output, HostBinding
|
|
2
|
+
import { Input, Directive, EventEmitter, HostListener, Output, HostBinding } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
class AutoFocusDirective {
|
|
5
5
|
el;
|
|
@@ -102,42 +102,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
102
102
|
args: ['disabled']
|
|
103
103
|
}] } });
|
|
104
104
|
|
|
105
|
-
class NgxUtilsLiteModule {
|
|
106
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: NgxUtilsLiteModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
107
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.20", ngImport: i0, type: NgxUtilsLiteModule, imports: [AutoFocusDirective,
|
|
108
|
-
ClickOutsideDirective,
|
|
109
|
-
CopyToClipboardDirective,
|
|
110
|
-
EnterSubmitDirective,
|
|
111
|
-
LoadingButtonDirective], exports: [AutoFocusDirective,
|
|
112
|
-
ClickOutsideDirective,
|
|
113
|
-
CopyToClipboardDirective,
|
|
114
|
-
EnterSubmitDirective,
|
|
115
|
-
LoadingButtonDirective] });
|
|
116
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: NgxUtilsLiteModule });
|
|
117
|
-
}
|
|
118
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: NgxUtilsLiteModule, decorators: [{
|
|
119
|
-
type: NgModule,
|
|
120
|
-
args: [{
|
|
121
|
-
imports: [
|
|
122
|
-
AutoFocusDirective,
|
|
123
|
-
ClickOutsideDirective,
|
|
124
|
-
CopyToClipboardDirective,
|
|
125
|
-
EnterSubmitDirective,
|
|
126
|
-
LoadingButtonDirective
|
|
127
|
-
],
|
|
128
|
-
exports: [
|
|
129
|
-
AutoFocusDirective,
|
|
130
|
-
ClickOutsideDirective,
|
|
131
|
-
CopyToClipboardDirective,
|
|
132
|
-
EnterSubmitDirective,
|
|
133
|
-
LoadingButtonDirective
|
|
134
|
-
]
|
|
135
|
-
}]
|
|
136
|
-
}] });
|
|
137
|
-
|
|
138
105
|
/**
|
|
139
106
|
* Generated bundle index. Do not edit.
|
|
140
107
|
*/
|
|
141
108
|
|
|
142
|
-
export { AutoFocusDirective, ClickOutsideDirective, CopyToClipboardDirective, EnterSubmitDirective, LoadingButtonDirective
|
|
109
|
+
export { AutoFocusDirective, ClickOutsideDirective, CopyToClipboardDirective, EnterSubmitDirective, LoadingButtonDirective };
|
|
143
110
|
//# sourceMappingURL=ngx-utils-lite.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-utils-lite.mjs","sources":["../../../projects/ngx-utils-lite/src/lib/auto-focus.directive.ts","../../../projects/ngx-utils-lite/src/lib/click-outside.directive.ts","../../../projects/ngx-utils-lite/src/lib/copy-to-clipboard.directive.ts","../../../projects/ngx-utils-lite/src/lib/enter-submit.directive.ts","../../../projects/ngx-utils-lite/src/lib/loading-button.directive.ts","../../../projects/ngx-utils-lite/src/
|
|
1
|
+
{"version":3,"file":"ngx-utils-lite.mjs","sources":["../../../projects/ngx-utils-lite/src/lib/auto-focus.directive.ts","../../../projects/ngx-utils-lite/src/lib/click-outside.directive.ts","../../../projects/ngx-utils-lite/src/lib/copy-to-clipboard.directive.ts","../../../projects/ngx-utils-lite/src/lib/enter-submit.directive.ts","../../../projects/ngx-utils-lite/src/lib/loading-button.directive.ts","../../../projects/ngx-utils-lite/src/ngx-utils-lite.ts"],"sourcesContent":["import { Directive, ElementRef, Input, OnInit } from '@angular/core';\n@Directive({ selector: '[ngxAutoFocus]' })\nexport class AutoFocusDirective implements OnInit {\n @Input() ngxAutoFocus = true;\n @Input() delay = 0;\n constructor(private el: ElementRef) {}\n ngOnInit() { if (this.ngxAutoFocus) setTimeout(() => this.el.nativeElement.focus(), this.delay); }\n}","import { Directive, ElementRef, EventEmitter, Output, HostListener, Input } from '@angular/core';\n@Directive({ selector: '[ngxClickOutside]' })\nexport class ClickOutsideDirective {\n @Output() ngxClickOutside = new EventEmitter<Event>();\n @Input() exclude: HTMLElement[] = [];\n constructor(private elementRef: ElementRef) {}\n @HostListener('document:click', ['$event'])\n onDocumentClick(event: Event) {\n const target = event.target as HTMLElement;\n const clickedInside = this.elementRef.nativeElement.contains(target);\n const clickedExcluded = this.exclude?.some(el => el.contains(target));\n if (!clickedInside && !clickedExcluded) this.ngxClickOutside.emit(event);\n }\n}","import { Directive, Input, HostListener } from '@angular/core';\n@Directive({ selector: '[ngxCopy]' })\nexport class CopyToClipboardDirective {\n @Input() ngxCopy = '';\n @HostListener('click') copyText() { if (!this.ngxCopy) return; navigator.clipboard.writeText(this.ngxCopy); }\n}","import { Directive, HostListener, Output, EventEmitter } from '@angular/core';\n@Directive({ selector: '[ngxEnterSubmit]' })\nexport class EnterSubmitDirective {\n @Output() ngxEnterSubmit = new EventEmitter<void>();\n @HostListener('keydown.enter', ['$event']) onEnter(event: KeyboardEvent) { event.preventDefault(); this.ngxEnterSubmit.emit(); }\n}","import { Directive, Input, HostBinding } from '@angular/core';\n@Directive({ selector: '[ngxLoading]' })\nexport class LoadingButtonDirective {\n @Input() set ngxLoading(promise: Promise<any>) { if (!promise) return; this.isLoading = true; promise.finally(() => this.isLoading = false); }\n @HostBinding('disabled') get isDisabled() { return this.isLoading; }\n isLoading = false;\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAEa,kBAAkB,CAAA;AAGT,IAAA,EAAA;IAFX,YA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,KAAK,CAAC,CAAC,CAAC;IAC7I,IAA6B,UAAU,KAAK,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;IACnE,SAAS,GAAG,KAAK;wGAHN,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,UAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,SAAS;mBAAC,EAAE,QAAQ,EAAE,cAAc,EAAE;8BAExB,UAAU,EAAA,CAAA;sBAAtB;gBAC4B,UAAU,EAAA,CAAA;sBAAtC,WAAW;uBAAC,UAAU;;;ACJzB;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-utils-lite",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^19.
|
|
6
|
-
"@angular/core": "^19.
|
|
5
|
+
"@angular/common": "^19.0.0",
|
|
6
|
+
"@angular/core": "^19.0.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"tslib": "^2.
|
|
9
|
+
"tslib": "^2.6.0"
|
|
10
10
|
},
|
|
11
|
-
"sideEffects": false,
|
|
12
11
|
"module": "fesm2022/ngx-utils-lite.mjs",
|
|
13
12
|
"typings": "index.d.ts",
|
|
14
13
|
"exports": {
|
|
@@ -19,5 +18,6 @@
|
|
|
19
18
|
"types": "./index.d.ts",
|
|
20
19
|
"default": "./fesm2022/ngx-utils-lite.mjs"
|
|
21
20
|
}
|
|
22
|
-
}
|
|
21
|
+
},
|
|
22
|
+
"sideEffects": false
|
|
23
23
|
}
|
package/public-api.d.ts
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./auto-focus.directive";
|
|
3
|
-
import * as i2 from "./click-outside.directive";
|
|
4
|
-
import * as i3 from "./copy-to-clipboard.directive";
|
|
5
|
-
import * as i4 from "./enter-submit.directive";
|
|
6
|
-
import * as i5 from "./loading-button.directive";
|
|
7
|
-
export declare class NgxUtilsLiteModule {
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgxUtilsLiteModule, never>;
|
|
9
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxUtilsLiteModule, never, [typeof i1.AutoFocusDirective, typeof i2.ClickOutsideDirective, typeof i3.CopyToClipboardDirective, typeof i4.EnterSubmitDirective, typeof i5.LoadingButtonDirective], [typeof i1.AutoFocusDirective, typeof i2.ClickOutsideDirective, typeof i3.CopyToClipboardDirective, typeof i4.EnterSubmitDirective, typeof i5.LoadingButtonDirective]>;
|
|
10
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<NgxUtilsLiteModule>;
|
|
11
|
-
}
|