ngx-repeat 4.0.1 → 5.0.1
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
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
> Angular directive for repeating HTML element by count
|
|
16
16
|
|
|
17
|
-
> ✓ _Angular
|
|
17
|
+
> ✓ _Angular 22 compatible_
|
|
18
18
|
|
|
19
19
|
Here's the [demo](http://celtian.github.io/ngx-repeat/) or [stackblitz live preview](https://stackblitz.com/edit/ngx-repeat) or [codesandbox live preview](https://codesandbox.io/s/ngx-repeat-bew8f)
|
|
20
20
|
|
|
@@ -85,7 +85,8 @@ import { NgxRepeatDirective } from 'ngx-repeat';
|
|
|
85
85
|
|
|
86
86
|
| Angular | ngx-repeat | Install |
|
|
87
87
|
| --------- | ---------- | ----------------------- |
|
|
88
|
-
| >=
|
|
88
|
+
| >= 22 | 5.x | `yarn add ngx-repeat` |
|
|
89
|
+
| >= 20 | 4.x | `yarn add ngx-repeat@4` |
|
|
89
90
|
| >= 19 | 3.x | `yarn add ngx-repeat@3` |
|
|
90
91
|
| >= 14 | 2.x | `yarn add ngx-repeat@2` |
|
|
91
92
|
| >= 12 | 1.x | `yarn add ngx-repeat@1` |
|
|
@@ -97,7 +98,7 @@ _None_
|
|
|
97
98
|
|
|
98
99
|
## 🪪 License
|
|
99
100
|
|
|
100
|
-
Copyright © 2021 -
|
|
101
|
+
Copyright © 2021 - 2026 [Dominik Hladik](https://github.com/Celtian)
|
|
101
102
|
|
|
102
103
|
All contents are licensed under the [MIT license].
|
|
103
104
|
|
package/fesm2022/ngx-repeat.mjs
CHANGED
|
@@ -30,7 +30,7 @@ class RepeatDirectiveContext {
|
|
|
30
30
|
class NgxRepeatDirective {
|
|
31
31
|
templateRef = inject(TemplateRef);
|
|
32
32
|
viewContainer = inject(ViewContainerRef);
|
|
33
|
-
count = input.required(...(ngDevMode ?
|
|
33
|
+
count = input.required({ ...(ngDevMode ? { debugName: "count" } : /* istanbul ignore next */ {}), alias: 'ngxRepeat' });
|
|
34
34
|
constructor() {
|
|
35
35
|
effect(() => {
|
|
36
36
|
const count = this.count();
|
|
@@ -44,13 +44,13 @@ class NgxRepeatDirective {
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
48
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
47
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: NgxRepeatDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
48
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: NgxRepeatDirective, isStandalone: true, selector: "[ngxRepeat]", inputs: { count: { classPropertyName: "count", publicName: "ngxRepeat", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
49
49
|
}
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: NgxRepeatDirective, decorators: [{
|
|
51
51
|
type: Directive,
|
|
52
52
|
args: [{ selector: '[ngxRepeat]' }]
|
|
53
|
-
}], ctorParameters: () => [] });
|
|
53
|
+
}], ctorParameters: () => [], propDecorators: { count: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngxRepeat", required: true }] }] } });
|
|
54
54
|
|
|
55
55
|
/*
|
|
56
56
|
* Public API Surface of ngx-repeat
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-repeat.mjs","sources":["../../../projects/ngx-repeat/src/lib/ngx-repeat.directive.ts","../../../projects/ngx-repeat/src/public-api.ts","../../../projects/ngx-repeat/src/ngx-repeat.ts"],"sourcesContent":["import { Directive, EmbeddedViewRef, TemplateRef, ViewContainerRef, effect, inject, input } from '@angular/core';\n\n/**\n * @publicApi\n */\nexport class RepeatDirectiveContext {\n constructor(\n public $implicit: number,\n public count: number\n ) {}\n\n public get index(): number {\n return this.$implicit;\n }\n\n public get first(): boolean {\n return this.$implicit === 0;\n }\n\n public get last(): boolean {\n return this.index === this.count - 1;\n }\n\n public get even(): boolean {\n return this.$implicit % 2 === 0;\n }\n\n public get odd(): boolean {\n return this.$implicit % 2 === 1;\n }\n}\n\n@Directive({ selector: '[ngxRepeat]' })\nexport class NgxRepeatDirective {\n private readonly templateRef = inject<TemplateRef<RepeatDirectiveContext>>(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n public readonly count = input.required<number>({ alias: 'ngxRepeat' });\n\n constructor() {\n effect(() => {\n const count = this.count();\n for (let i = this.viewContainer.length; i > count; i--) this.viewContainer.remove(i - 1);\n\n for (let i = this.viewContainer.length; i < count; i++)\n this.viewContainer.createEmbeddedView(this.templateRef, new RepeatDirectiveContext(i, count));\n\n for (let i = 0; i < this.viewContainer.length; i++) {\n const viewRef = this.viewContainer.get(i) as EmbeddedViewRef<RepeatDirectiveContext>;\n viewRef.context.count = count;\n }\n });\n }\n}\n","/*\n * Public API Surface of ngx-repeat\n */\n\nexport * from './lib/ngx-repeat.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAEA;;AAEG;MACU,sBAAsB,CAAA;AAExB,IAAA,SAAA;AACA,IAAA,KAAA;IAFT,
|
|
1
|
+
{"version":3,"file":"ngx-repeat.mjs","sources":["../../../projects/ngx-repeat/src/lib/ngx-repeat.directive.ts","../../../projects/ngx-repeat/src/public-api.ts","../../../projects/ngx-repeat/src/ngx-repeat.ts"],"sourcesContent":["import { Directive, EmbeddedViewRef, TemplateRef, ViewContainerRef, effect, inject, input } from '@angular/core';\n\n/**\n * @publicApi\n */\nexport class RepeatDirectiveContext {\n constructor(\n public $implicit: number,\n public count: number\n ) {}\n\n public get index(): number {\n return this.$implicit;\n }\n\n public get first(): boolean {\n return this.$implicit === 0;\n }\n\n public get last(): boolean {\n return this.index === this.count - 1;\n }\n\n public get even(): boolean {\n return this.$implicit % 2 === 0;\n }\n\n public get odd(): boolean {\n return this.$implicit % 2 === 1;\n }\n}\n\n@Directive({ selector: '[ngxRepeat]' })\nexport class NgxRepeatDirective {\n private readonly templateRef = inject<TemplateRef<RepeatDirectiveContext>>(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n public readonly count = input.required<number>({ alias: 'ngxRepeat' });\n\n constructor() {\n effect(() => {\n const count = this.count();\n for (let i = this.viewContainer.length; i > count; i--) this.viewContainer.remove(i - 1);\n\n for (let i = this.viewContainer.length; i < count; i++)\n this.viewContainer.createEmbeddedView(this.templateRef, new RepeatDirectiveContext(i, count));\n\n for (let i = 0; i < this.viewContainer.length; i++) {\n const viewRef = this.viewContainer.get(i) as EmbeddedViewRef<RepeatDirectiveContext>;\n viewRef.context.count = count;\n }\n });\n }\n}\n","/*\n * Public API Surface of ngx-repeat\n */\n\nexport * from './lib/ngx-repeat.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAEA;;AAEG;MACU,sBAAsB,CAAA;AAExB,IAAA,SAAA;AACA,IAAA,KAAA;IAFT,WAAA,CACS,SAAiB,EACjB,KAAa,EAAA;QADb,IAAA,CAAA,SAAS,GAAT,SAAS;QACT,IAAA,CAAA,KAAK,GAAL,KAAK;IACX;AAEH,IAAA,IAAW,KAAK,GAAA;QACd,OAAO,IAAI,CAAC,SAAS;IACvB;AAEA,IAAA,IAAW,KAAK,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,SAAS,KAAK,CAAC;IAC7B;AAEA,IAAA,IAAW,IAAI,GAAA;QACb,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,GAAG,CAAC;IACtC;AAEA,IAAA,IAAW,IAAI,GAAA;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CAAA,SAAA,EAAA,CAAA;2FAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B,SAAS;mBAAC,EAAE,QAAQ,EAAE,aAAa,EAAE;;;AChCtC;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-repeat",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Dominik Hladík",
|
|
6
6
|
"email": "dominik.hladik@seznam.cz",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"description": "Angular directive for repeating HTML element by count",
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@angular/core": ">=
|
|
13
|
+
"@angular/core": ">=22"
|
|
14
14
|
},
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"registry": "https://registry.npmjs.org"
|
|
@@ -33,17 +33,18 @@
|
|
|
33
33
|
"node": ">=20"
|
|
34
34
|
},
|
|
35
35
|
"module": "fesm2022/ngx-repeat.mjs",
|
|
36
|
-
"typings": "
|
|
36
|
+
"typings": "types/ngx-repeat.d.ts",
|
|
37
37
|
"exports": {
|
|
38
38
|
"./package.json": {
|
|
39
39
|
"default": "./package.json"
|
|
40
40
|
},
|
|
41
41
|
".": {
|
|
42
|
-
"types": "./
|
|
42
|
+
"types": "./types/ngx-repeat.d.ts",
|
|
43
43
|
"default": "./fesm2022/ngx-repeat.mjs"
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"sideEffects": false,
|
|
47
|
+
"type": "module",
|
|
47
48
|
"dependencies": {
|
|
48
49
|
"tslib": "^2.3.0"
|
|
49
50
|
}
|
|
File without changes
|