nmce-directives 1.4.4 → 1.5.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/fesm2022/nmce-directives.mjs +17 -49
- package/fesm2022/nmce-directives.mjs.map +1 -1
- package/index.d.ts +4 -16
- package/package.json +1 -1
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Input, Directive
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
-
import { FormsModule } from '@angular/forms';
|
|
2
|
+
import { Input, Directive } from '@angular/core';
|
|
5
3
|
|
|
6
4
|
/**
|
|
7
5
|
* Use as a parameterized input parameter in html element.
|
|
@@ -39,14 +37,14 @@ class AutofocusDirective {
|
|
|
39
37
|
set autofocus(condition) {
|
|
40
38
|
this.toFocus = condition !== false;
|
|
41
39
|
}
|
|
42
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
43
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.
|
|
40
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AutofocusDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
41
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: AutofocusDirective, isStandalone: true, selector: "[autofocus]", inputs: { autofocus: "autofocus" }, ngImport: i0 });
|
|
44
42
|
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AutofocusDirective, decorators: [{
|
|
46
44
|
type: Directive,
|
|
47
45
|
args: [{
|
|
48
46
|
selector: '[autofocus]',
|
|
49
|
-
standalone:
|
|
47
|
+
standalone: true
|
|
50
48
|
}]
|
|
51
49
|
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { autofocus: [{
|
|
52
50
|
type: Input
|
|
@@ -57,14 +55,14 @@ class DataComponentDirective {
|
|
|
57
55
|
constructor(viewContainerRef) {
|
|
58
56
|
this.viewContainerRef = viewContainerRef;
|
|
59
57
|
}
|
|
60
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
61
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.
|
|
58
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: DataComponentDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
59
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: DataComponentDirective, isStandalone: true, selector: "[dataComponentHost]", ngImport: i0 });
|
|
62
60
|
}
|
|
63
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: DataComponentDirective, decorators: [{
|
|
64
62
|
type: Directive,
|
|
65
63
|
args: [{
|
|
66
64
|
selector: '[dataComponentHost]',
|
|
67
|
-
standalone:
|
|
65
|
+
standalone: true
|
|
68
66
|
}]
|
|
69
67
|
}], ctorParameters: () => [{ type: i0.ViewContainerRef }] });
|
|
70
68
|
|
|
@@ -83,57 +81,27 @@ class ScrollIntoDirective {
|
|
|
83
81
|
this.el.nativeElement.scrollIntoView();
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
87
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.
|
|
84
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: ScrollIntoDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
85
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: ScrollIntoDirective, isStandalone: true, selector: "[scrollInto]", inputs: { scrollInto: "scrollInto" }, ngImport: i0 });
|
|
88
86
|
}
|
|
89
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: ScrollIntoDirective, decorators: [{
|
|
90
88
|
type: Directive,
|
|
91
89
|
args: [{
|
|
92
90
|
selector: '[scrollInto]',
|
|
93
|
-
standalone:
|
|
91
|
+
standalone: true
|
|
94
92
|
}]
|
|
95
93
|
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { scrollInto: [{
|
|
96
94
|
type: Input
|
|
97
95
|
}] } });
|
|
98
96
|
|
|
99
|
-
|
|
100
|
-
*
|
|
101
|
-
*
|
|
97
|
+
/*
|
|
98
|
+
* Public API Surface of nmce-directives
|
|
102
99
|
*/
|
|
103
|
-
|
|
104
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: NmceDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
105
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.3", ngImport: i0, type: NmceDirectivesModule, declarations: [AutofocusDirective,
|
|
106
|
-
ScrollIntoDirective,
|
|
107
|
-
DataComponentDirective], imports: [CommonModule,
|
|
108
|
-
FormsModule], exports: [AutofocusDirective,
|
|
109
|
-
ScrollIntoDirective,
|
|
110
|
-
DataComponentDirective] });
|
|
111
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: NmceDirectivesModule, imports: [CommonModule,
|
|
112
|
-
FormsModule] });
|
|
113
|
-
}
|
|
114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: NmceDirectivesModule, decorators: [{
|
|
115
|
-
type: NgModule,
|
|
116
|
-
args: [{
|
|
117
|
-
imports: [
|
|
118
|
-
CommonModule,
|
|
119
|
-
FormsModule,
|
|
120
|
-
],
|
|
121
|
-
declarations: [
|
|
122
|
-
AutofocusDirective,
|
|
123
|
-
ScrollIntoDirective,
|
|
124
|
-
DataComponentDirective,
|
|
125
|
-
],
|
|
126
|
-
exports: [
|
|
127
|
-
AutofocusDirective,
|
|
128
|
-
ScrollIntoDirective,
|
|
129
|
-
DataComponentDirective,
|
|
130
|
-
]
|
|
131
|
-
}]
|
|
132
|
-
}] });
|
|
100
|
+
/// <reference types="@angular/localize" />
|
|
133
101
|
|
|
134
102
|
/**
|
|
135
103
|
* Generated bundle index. Do not edit.
|
|
136
104
|
*/
|
|
137
105
|
|
|
138
|
-
export { AutofocusDirective, DataComponentDirective,
|
|
106
|
+
export { AutofocusDirective, DataComponentDirective, ScrollIntoDirective };
|
|
139
107
|
//# sourceMappingURL=nmce-directives.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nmce-directives.mjs","sources":["../../../projects/nmce-directives/src/_directives/autofocus.ts","../../../projects/nmce-directives/src/_directives/dataComponent.directive.ts","../../../projects/nmce-directives/src/_directives/scrollInto.directive.ts","../../../projects/nmce-directives/src/
|
|
1
|
+
{"version":3,"file":"nmce-directives.mjs","sources":["../../../projects/nmce-directives/src/_directives/autofocus.ts","../../../projects/nmce-directives/src/_directives/dataComponent.directive.ts","../../../projects/nmce-directives/src/_directives/scrollInto.directive.ts","../../../projects/nmce-directives/src/public-api.ts","../../../projects/nmce-directives/src/nmce-directives.ts"],"sourcesContent":["import { AfterViewInit, Directive, DoCheck, ElementRef, Input } from '@angular/core';\r\n\r\n/**\r\n * Use as a parameterized input parameter in html element.\r\n * When used inside a material dialog, this directive may be at odd against the autofocus config parameter of MatDialogConfig, \r\n * if the autofocus config is not false. Generally speaking, no need to use this directive in a component presented in a mateiral dialog.\r\n */\r\n@Directive({\r\n selector: '[autofocus]',\r\n standalone: true\r\n})\r\nexport class AutofocusDirective implements AfterViewInit, DoCheck {\r\n\tprivate toFocus = false;\r\n\tprivate focused = false;\r\n\tprivate initialized = false;\r\n\tprivate everFocused = false;\r\n\tconstructor(private el: ElementRef) {\r\n\t\t//console.debug('autofocusDirective created.');\r\n\t}\r\n\r\n\tngAfterViewInit() {\r\n\t\tthis.initialized = true;\r\n\t\tthis.ngDoCheck();\r\n\t}\r\n\r\n\tngDoCheck() {\r\n\t\tif (!this.initialized) { return; }\r\n\t\tif (this.toFocus && !this.everFocused && !this.focused) {\r\n\t\t\tthis.el.nativeElement.focus();\r\n\t\t\tthis.focused = true;\r\n\t\t\tthis.everFocused = true;\r\n\t\t\tconsole.debug('focused now.');\r\n\t\t}\r\n\t}\r\n\r\n\t@Input() \r\n\tget autofocus(){\r\n\t\treturn this.focused;\r\n\t}\r\n\tset autofocus(condition: boolean) {\r\n\t\tthis.toFocus = condition !== false;\r\n\t}\r\n}\r\n","import { Directive, ViewContainerRef } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[dataComponentHost]',\r\n standalone: true\r\n})\r\nexport class DataComponentDirective {\r\n\tconstructor(public viewContainerRef: ViewContainerRef) { }\r\n}\r\n","import { AfterViewInit, Directive, ElementRef, Input } from '@angular/core';\r\n\r\n/**\r\n * Scroll to element attached. And the element may be an Angular Material component too.\r\n */\r\n@Directive({\r\n selector: '[scrollInto]',\r\n standalone: true\r\n})\r\nexport class ScrollIntoDirective implements AfterViewInit {\r\n\tconstructor(private el: ElementRef) {\r\n\t\t//\tconsole.debug('ScrollIntoDirective created.');\r\n\t}\r\n\r\n\t@Input()\r\n\tscrollInto: boolean = false;\r\n\r\n\tngAfterViewInit() {\r\n\t\tif (this.scrollInto) {\r\n\t\t\tthis.el.nativeElement.scrollIntoView();\r\n\t\t}\r\n\t}\r\n}\r\n","/*\r\n * Public API Surface of nmce-directives\r\n */\r\n/// <reference types=\"@angular/localize\" />\r\n\r\nexport * from './_directives/autofocus';\r\nexport * from './_directives/dataComponent.directive';\r\nexport * from './_directives/scrollInto.directive';\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAEA;;;;AAIG;MAKU,kBAAkB,CAAA;AAKV,IAAA,EAAA;IAJZ,OAAO,GAAG,KAAK;IACf,OAAO,GAAG,KAAK;IACf,WAAW,GAAG,KAAK;IACnB,WAAW,GAAG,KAAK;AAC3B,IAAA,WAAA,CAAoB,EAAc,EAAA;QAAd,IAAA,CAAA,EAAE,GAAF,EAAE;;IAEtB;IAEA,eAAe,GAAA;AACd,QAAA,IAAI,CAAC,WAAW,GAAG,IAAI;QACvB,IAAI,CAAC,SAAS,EAAE;IACjB;IAEA,SAAS,GAAA;AACR,QAAA,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YAAE;QAAQ;AACjC,QAAA,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;AACvD,YAAA,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE;AAC7B,YAAA,IAAI,CAAC,OAAO,GAAG,IAAI;AACnB,YAAA,IAAI,CAAC,WAAW,GAAG,IAAI;AACvB,YAAA,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC;QAC9B;IACD;AAEA,IAAA,IACI,SAAS,GAAA;QACZ,OAAO,IAAI,CAAC,OAAO;IACpB;IACA,IAAI,SAAS,CAAC,SAAkB,EAAA;AAC/B,QAAA,IAAI,CAAC,OAAO,GAAG,SAAS,KAAK,KAAK;IACnC;wGA9BY,kBAAkB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,CAAA,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IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAnB,mBAAmB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,UAAU,EAAE;AACf,iBAAA;;sBAMC;;;ACdF;;AAEG;AACH;;ACHA;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { AfterViewInit, DoCheck, ElementRef, ViewContainerRef } from '@angular/core';
|
|
3
|
-
import * as i4 from '@angular/common';
|
|
4
|
-
import * as i5 from '@angular/forms';
|
|
5
3
|
|
|
6
4
|
/**
|
|
7
5
|
* Use as a parameterized input parameter in html element.
|
|
@@ -20,14 +18,14 @@ declare class AutofocusDirective implements AfterViewInit, DoCheck {
|
|
|
20
18
|
get autofocus(): boolean;
|
|
21
19
|
set autofocus(condition: boolean);
|
|
22
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<AutofocusDirective, never>;
|
|
23
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AutofocusDirective, "[autofocus]", never, { "autofocus": { "alias": "autofocus"; "required": false; }; }, {}, never, never,
|
|
21
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AutofocusDirective, "[autofocus]", never, { "autofocus": { "alias": "autofocus"; "required": false; }; }, {}, never, never, true, never>;
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
declare class DataComponentDirective {
|
|
27
25
|
viewContainerRef: ViewContainerRef;
|
|
28
26
|
constructor(viewContainerRef: ViewContainerRef);
|
|
29
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataComponentDirective, never>;
|
|
30
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DataComponentDirective, "[dataComponentHost]", never, {}, {}, never, never,
|
|
28
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DataComponentDirective, "[dataComponentHost]", never, {}, {}, never, never, true, never>;
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
/**
|
|
@@ -39,17 +37,7 @@ declare class ScrollIntoDirective implements AfterViewInit {
|
|
|
39
37
|
scrollInto: boolean;
|
|
40
38
|
ngAfterViewInit(): void;
|
|
41
39
|
static ɵfac: i0.ɵɵFactoryDeclaration<ScrollIntoDirective, never>;
|
|
42
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ScrollIntoDirective, "[scrollInto]", never, { "scrollInto": { "alias": "scrollInto"; "required": false; }; }, {}, never, never,
|
|
40
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ScrollIntoDirective, "[scrollInto]", never, { "scrollInto": { "alias": "scrollInto"; "required": false; }; }, {}, never, never, true, never>;
|
|
43
41
|
}
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
* Contain components. Other feature/lazy modules that need to access custom html element of components like my-datetimepicker still need to import this module explicitly.
|
|
47
|
-
*
|
|
48
|
-
*/
|
|
49
|
-
declare class NmceDirectivesModule {
|
|
50
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NmceDirectivesModule, never>;
|
|
51
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NmceDirectivesModule, [typeof AutofocusDirective, typeof ScrollIntoDirective, typeof DataComponentDirective], [typeof i4.CommonModule, typeof i5.FormsModule], [typeof AutofocusDirective, typeof ScrollIntoDirective, typeof DataComponentDirective]>;
|
|
52
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<NmceDirectivesModule>;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export { AutofocusDirective, DataComponentDirective, NmceDirectivesModule, ScrollIntoDirective };
|
|
43
|
+
export { AutofocusDirective, DataComponentDirective, ScrollIntoDirective };
|