@coolon/angular-ui-powerups 12.4.0-alpha.38 → 12.4.0-alpha.39

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,9 +1,21 @@
1
1
  export var TrackBy;
2
2
  (function (TrackBy) {
3
3
  TrackBy.byIndex = (index, item) => index;
4
+ /**
5
+ * @deprecated use #track(MyType).by("property") instead.
6
+ * @param property
7
+ */
4
8
  function trackByProperty(property) {
5
9
  return (index, item) => item[property];
6
10
  }
7
11
  TrackBy.trackByProperty = trackByProperty;
12
+ function track(type) {
13
+ return {
14
+ by(property) {
15
+ return (index, item) => item[property];
16
+ }
17
+ };
18
+ }
19
+ TrackBy.track = track;
8
20
  })(TrackBy || (TrackBy = {}));
9
21
  //# sourceMappingURL=track-by.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"track-by.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/components/track-by.ts"],"names":[],"mappings":"AAEA,MAAM,KAAW,OAAO,CAMvB;AAND,WAAiB,OAAO;IACT,eAAO,GAAwB,CAAC,KAAY,EAAE,IAAS,EAAE,EAAE,CAAC,KAAK,CAAC;IAE/E,SAAgB,eAAe,CAAuB,QAAW;QAC/D,OAAO,CAAC,KAAY,EAAE,IAAO,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC;IAFe,uBAAe,kBAE9B,CAAA;AACH,CAAC,EANgB,OAAO,KAAP,OAAO,QAMvB","sourcesContent":["import { TrackByFunction } from '@angular/core';\n\nexport namespace TrackBy {\n export const byIndex:TrackByFunction<any> = (index:number, item: any) => index;\n\n export function trackByProperty<T, P extends keyof T>(property: P):TrackByFunction<T> {\n return (index:number, item: T) => item[property];\n }\n}\n"]}
1
+ {"version":3,"file":"track-by.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/components/track-by.ts"],"names":[],"mappings":"AAIA,MAAM,KAAW,OAAO,CAkBvB;AAlBD,WAAiB,OAAO;IACT,eAAO,GAAyB,CAAC,KAAa,EAAE,IAAS,EAAE,EAAE,CAAC,KAAK,CAAC;IAEjF;;;OAGG;IACH,SAAgB,eAAe,CAAuB,QAAW;QAC/D,OAAO,CAAC,KAAa,EAAE,IAAO,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC;IAFe,uBAAe,kBAE9B,CAAA;IAED,SAAgB,KAAK,CAAI,IAAsB;QAC7C,OAAO;YACL,EAAE,CAAiC,QAAW;gBAC5C,OAAO,CAAC,KAAa,EAAE,IAAO,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACpD,CAAC;SACF,CAAC;IACJ,CAAC;IANe,aAAK,QAMpB,CAAA;AACH,CAAC,EAlBgB,OAAO,KAAP,OAAO,QAkBvB","sourcesContent":["import { TrackByFunction } from '@angular/core';\nimport { Constructable } from '@coolon/pectin';\nimport { ValuePropertiesOf } from '@coolon/typescript-utilities';\n\nexport namespace TrackBy {\n export const byIndex: TrackByFunction<any> = (index: number, item: any) => index;\n\n /**\n * @deprecated use #track(MyType).by(\"property\") instead.\n * @param property\n */\n export function trackByProperty<T, P extends keyof T>(property: P): TrackByFunction<T> {\n return (index: number, item: T) => item[property];\n }\n\n export function track<T>(type: Constructable<T>) {\n return {\n by<P extends ValuePropertiesOf<T>>(property: P) {\n return (index: number, item: T) => item[property];\n }\n };\n }\n}\n"]}
@@ -998,10 +998,22 @@ __decorate([
998
998
  var TrackBy;
999
999
  (function (TrackBy) {
1000
1000
  TrackBy.byIndex = (index, item) => index;
1001
+ /**
1002
+ * @deprecated use #track(MyType).by("property") instead.
1003
+ * @param property
1004
+ */
1001
1005
  function trackByProperty(property) {
1002
1006
  return (index, item) => item[property];
1003
1007
  }
1004
1008
  TrackBy.trackByProperty = trackByProperty;
1009
+ function track(type) {
1010
+ return {
1011
+ by(property) {
1012
+ return (index, item) => item[property];
1013
+ }
1014
+ };
1015
+ }
1016
+ TrackBy.track = track;
1005
1017
  })(TrackBy || (TrackBy = {}));
1006
1018
 
1007
1019
  class CommandContainer extends GarbageCollector {