@skyux/lists 7.0.0-beta.9 → 7.1.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.
Files changed (41) hide show
  1. package/documentation.json +85 -72
  2. package/esm2020/lib/modules/filter/filter-button.component.mjs +5 -5
  3. package/esm2020/lib/modules/filter/filter-inline-item.component.mjs +4 -4
  4. package/esm2020/lib/modules/filter/filter-inline.component.mjs +4 -4
  5. package/esm2020/lib/modules/filter/filter-summary-item.component.mjs +4 -4
  6. package/esm2020/lib/modules/filter/filter-summary.component.mjs +4 -4
  7. package/esm2020/lib/modules/filter/filter.module.mjs +5 -5
  8. package/esm2020/lib/modules/infinite-scroll/infinite-scroll-dom-adapter.service.mjs +4 -5
  9. package/esm2020/lib/modules/infinite-scroll/infinite-scroll.component.mjs +5 -5
  10. package/esm2020/lib/modules/infinite-scroll/infinite-scroll.module.mjs +5 -5
  11. package/esm2020/lib/modules/paging/paging.component.mjs +4 -4
  12. package/esm2020/lib/modules/paging/paging.module.mjs +5 -5
  13. package/esm2020/lib/modules/repeater/repeater-adapter.service.mjs +4 -5
  14. package/esm2020/lib/modules/repeater/repeater-item-content.component.mjs +4 -4
  15. package/esm2020/lib/modules/repeater/repeater-item-context-menu.component.mjs +4 -4
  16. package/esm2020/lib/modules/repeater/repeater-item-title.component.mjs +4 -4
  17. package/esm2020/lib/modules/repeater/repeater-item.component.mjs +8 -13
  18. package/esm2020/lib/modules/repeater/repeater.component.mjs +6 -10
  19. package/esm2020/lib/modules/repeater/repeater.module.mjs +5 -5
  20. package/esm2020/lib/modules/repeater/repeater.service.mjs +4 -4
  21. package/esm2020/lib/modules/shared/sky-lists-resources.module.mjs +5 -5
  22. package/esm2020/lib/modules/sort/sort-item.component.mjs +6 -7
  23. package/esm2020/lib/modules/sort/sort-menu-heading.component.mjs +5 -5
  24. package/esm2020/lib/modules/sort/sort.component.mjs +5 -5
  25. package/esm2020/lib/modules/sort/sort.module.mjs +5 -5
  26. package/esm2020/lib/modules/sort/sort.service.mjs +4 -4
  27. package/esm2020/testing/filter/filter-testing.module.mjs +5 -5
  28. package/esm2020/testing/infinite-scroll/infinite-scroll-testing.module.mjs +5 -5
  29. package/esm2020/testing/paging/paging-testing.module.mjs +5 -5
  30. package/esm2020/testing/sort/sort-fixture.mjs +11 -20
  31. package/esm2020/testing/sort/sort-testing.module.mjs +5 -5
  32. package/fesm2015/skyux-lists-testing.mjs +26 -39
  33. package/fesm2015/skyux-lists-testing.mjs.map +1 -1
  34. package/fesm2015/skyux-lists.mjs +91 -95
  35. package/fesm2015/skyux-lists.mjs.map +1 -1
  36. package/fesm2020/skyux-lists-testing.mjs +26 -35
  37. package/fesm2020/skyux-lists-testing.mjs.map +1 -1
  38. package/fesm2020/skyux-lists.mjs +90 -95
  39. package/fesm2020/skyux-lists.mjs.map +1 -1
  40. package/package.json +14 -14
  41. package/testing/sort/sort-fixture.d.ts +1 -1
@@ -669,7 +669,7 @@
669
669
  "sources": [
670
670
  {
671
671
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
672
- "line": 272,
672
+ "line": 271,
673
673
  "character": 2
674
674
  }
675
675
  ],
@@ -781,7 +781,7 @@
781
781
  "sources": [
782
782
  {
783
783
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
784
- "line": 176,
784
+ "line": 175,
785
785
  "character": 9
786
786
  }
787
787
  ],
@@ -810,7 +810,7 @@
810
810
  "sources": [
811
811
  {
812
812
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
813
- "line": 200,
813
+ "line": 199,
814
814
  "character": 9
815
815
  }
816
816
  ],
@@ -845,7 +845,7 @@
845
845
  "sources": [
846
846
  {
847
847
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
848
- "line": 198,
848
+ "line": 197,
849
849
  "character": 9
850
850
  }
851
851
  ],
@@ -888,7 +888,7 @@
888
888
  "sources": [
889
889
  {
890
890
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
891
- "line": 182,
891
+ "line": 181,
892
892
  "character": 9
893
893
  }
894
894
  ],
@@ -932,7 +932,7 @@
932
932
  "sources": [
933
933
  {
934
934
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
935
- "line": 237,
935
+ "line": 236,
936
936
  "character": 9
937
937
  }
938
938
  ],
@@ -960,7 +960,7 @@
960
960
  "sources": [
961
961
  {
962
962
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
963
- "line": 202,
963
+ "line": 201,
964
964
  "character": 9
965
965
  }
966
966
  ],
@@ -996,7 +996,7 @@
996
996
  "sources": [
997
997
  {
998
998
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
999
- "line": 189,
999
+ "line": 188,
1000
1000
  "character": 9
1001
1001
  }
1002
1002
  ],
@@ -1040,7 +1040,7 @@
1040
1040
  "sources": [
1041
1041
  {
1042
1042
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1043
- "line": 105,
1043
+ "line": 104,
1044
1044
  "character": 9
1045
1045
  }
1046
1046
  ],
@@ -1075,7 +1075,7 @@
1075
1075
  "sources": [
1076
1076
  {
1077
1077
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1078
- "line": 112,
1078
+ "line": 111,
1079
1079
  "character": 9
1080
1080
  }
1081
1081
  ],
@@ -1103,7 +1103,7 @@
1103
1103
  "sources": [
1104
1104
  {
1105
1105
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1106
- "line": 204,
1106
+ "line": 203,
1107
1107
  "character": 9
1108
1108
  }
1109
1109
  ],
@@ -1139,7 +1139,7 @@
1139
1139
  "sources": [
1140
1140
  {
1141
1141
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1142
- "line": 195,
1142
+ "line": 194,
1143
1143
  "character": 9
1144
1144
  }
1145
1145
  ],
@@ -1183,7 +1183,7 @@
1183
1183
  "sources": [
1184
1184
  {
1185
1185
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1186
- "line": 240,
1186
+ "line": 239,
1187
1187
  "character": 9
1188
1188
  }
1189
1189
  ],
@@ -1226,7 +1226,7 @@
1226
1226
  "sources": [
1227
1227
  {
1228
1228
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1229
- "line": 243,
1229
+ "line": 242,
1230
1230
  "character": 9
1231
1231
  }
1232
1232
  ],
@@ -1269,7 +1269,7 @@
1269
1269
  "sources": [
1270
1270
  {
1271
1271
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1272
- "line": 97,
1272
+ "line": 96,
1273
1273
  "character": 9
1274
1274
  }
1275
1275
  ],
@@ -1304,7 +1304,7 @@
1304
1304
  "sources": [
1305
1305
  {
1306
1306
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1307
- "line": 246,
1307
+ "line": 245,
1308
1308
  "character": 9
1309
1309
  }
1310
1310
  ],
@@ -1332,7 +1332,7 @@
1332
1332
  "sources": [
1333
1333
  {
1334
1334
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1335
- "line": 223,
1335
+ "line": 222,
1336
1336
  "character": 9
1337
1337
  }
1338
1338
  ],
@@ -1360,7 +1360,7 @@
1360
1360
  "sources": [
1361
1361
  {
1362
1362
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1363
- "line": 225,
1363
+ "line": 224,
1364
1364
  "character": 9
1365
1365
  }
1366
1366
  ],
@@ -1381,7 +1381,7 @@
1381
1381
  "sources": [
1382
1382
  {
1383
1383
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1384
- "line": 227,
1384
+ "line": 226,
1385
1385
  "character": 9
1386
1386
  }
1387
1387
  ],
@@ -1416,7 +1416,7 @@
1416
1416
  "sources": [
1417
1417
  {
1418
1418
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1419
- "line": 149,
1419
+ "line": 148,
1420
1420
  "character": 9
1421
1421
  }
1422
1422
  ],
@@ -1451,7 +1451,7 @@
1451
1451
  "sources": [
1452
1452
  {
1453
1453
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1454
- "line": 249,
1454
+ "line": 248,
1455
1455
  "character": 9
1456
1456
  }
1457
1457
  ],
@@ -1495,7 +1495,7 @@
1495
1495
  "sources": [
1496
1496
  {
1497
1497
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1498
- "line": 155,
1498
+ "line": 154,
1499
1499
  "character": 9
1500
1500
  }
1501
1501
  ],
@@ -1531,7 +1531,7 @@
1531
1531
  "sources": [
1532
1532
  {
1533
1533
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1534
- "line": 162,
1534
+ "line": 161,
1535
1535
  "character": 9
1536
1536
  }
1537
1537
  ],
@@ -1552,7 +1552,7 @@
1552
1552
  "sources": [
1553
1553
  {
1554
1554
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1555
- "line": 229,
1555
+ "line": 228,
1556
1556
  "character": 9
1557
1557
  }
1558
1558
  ],
@@ -1587,7 +1587,7 @@
1587
1587
  "sources": [
1588
1588
  {
1589
1589
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1590
- "line": 170,
1590
+ "line": 169,
1591
1591
  "character": 9
1592
1592
  }
1593
1593
  ],
@@ -1619,7 +1619,7 @@
1619
1619
  "sources": [
1620
1620
  {
1621
1621
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1622
- "line": 69,
1622
+ "line": 68,
1623
1623
  "character": 13
1624
1624
  }
1625
1625
  ],
@@ -1680,7 +1680,7 @@
1680
1680
  "sources": [
1681
1681
  {
1682
1682
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1683
- "line": 206,
1683
+ "line": 205,
1684
1684
  "character": 13
1685
1685
  }
1686
1686
  ],
@@ -1747,7 +1747,7 @@
1747
1747
  "sources": [
1748
1748
  {
1749
1749
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1750
- "line": 119,
1750
+ "line": 118,
1751
1751
  "character": 13
1752
1752
  }
1753
1753
  ],
@@ -1832,7 +1832,7 @@
1832
1832
  "sources": [
1833
1833
  {
1834
1834
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1835
- "line": 133,
1835
+ "line": 132,
1836
1836
  "character": 13
1837
1837
  }
1838
1838
  ],
@@ -1917,7 +1917,7 @@
1917
1917
  "sources": [
1918
1918
  {
1919
1919
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1920
- "line": 232,
1920
+ "line": 231,
1921
1921
  "character": 6
1922
1922
  }
1923
1923
  ],
@@ -1943,22 +1943,10 @@
1943
1943
  "flags": {
1944
1944
  "isPublic": true
1945
1945
  },
1946
- "decorators": [
1947
- {
1948
- "name": "HostBinding",
1949
- "type": {
1950
- "type": "reference",
1951
- "qualifiedName": "HostBindingDecorator",
1952
- "package": "@angular/core",
1953
- "name": "HostBinding"
1954
- },
1955
- "arguments": {}
1956
- }
1957
- ],
1958
1946
  "sources": [
1959
1947
  {
1960
1948
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
1961
- "line": 58,
1949
+ "line": 57,
1962
1950
  "character": 13
1963
1951
  }
1964
1952
  ],
@@ -1999,7 +1987,7 @@
1999
1987
  "sources": [
2000
1988
  {
2001
1989
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
2002
- "line": 435,
1990
+ "line": 434,
2003
1991
  "character": 9
2004
1992
  }
2005
1993
  ],
@@ -2041,7 +2029,7 @@
2041
2029
  "sources": [
2042
2030
  {
2043
2031
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
2044
- "line": 429,
2032
+ "line": 428,
2045
2033
  "character": 9
2046
2034
  }
2047
2035
  ],
@@ -2070,7 +2058,7 @@
2070
2058
  "sources": [
2071
2059
  {
2072
2060
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
2073
- "line": 481,
2061
+ "line": 480,
2074
2062
  "character": 9
2075
2063
  }
2076
2064
  ],
@@ -2114,7 +2102,7 @@
2114
2102
  "sources": [
2115
2103
  {
2116
2104
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
2117
- "line": 331,
2105
+ "line": 330,
2118
2106
  "character": 9
2119
2107
  }
2120
2108
  ],
@@ -2151,7 +2139,7 @@
2151
2139
  "sources": [
2152
2140
  {
2153
2141
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
2154
- "line": 336,
2142
+ "line": 335,
2155
2143
  "character": 9
2156
2144
  }
2157
2145
  ],
@@ -2188,7 +2176,7 @@
2188
2176
  "sources": [
2189
2177
  {
2190
2178
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
2191
- "line": 318,
2179
+ "line": 317,
2192
2180
  "character": 9
2193
2181
  }
2194
2182
  ],
@@ -2225,7 +2213,7 @@
2225
2213
  "sources": [
2226
2214
  {
2227
2215
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
2228
- "line": 473,
2216
+ "line": 472,
2229
2217
  "character": 9
2230
2218
  }
2231
2219
  ],
@@ -2267,7 +2255,7 @@
2267
2255
  "sources": [
2268
2256
  {
2269
2257
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
2270
- "line": 477,
2258
+ "line": 476,
2271
2259
  "character": 9
2272
2260
  }
2273
2261
  ],
@@ -2324,7 +2312,7 @@
2324
2312
  "sources": [
2325
2313
  {
2326
2314
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
2327
- "line": 349,
2315
+ "line": 348,
2328
2316
  "character": 9
2329
2317
  }
2330
2318
  ],
@@ -2368,7 +2356,7 @@
2368
2356
  "sources": [
2369
2357
  {
2370
2358
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
2371
- "line": 547,
2359
+ "line": 546,
2372
2360
  "character": 9
2373
2361
  }
2374
2362
  ],
@@ -2410,7 +2398,7 @@
2410
2398
  "sources": [
2411
2399
  {
2412
2400
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
2413
- "line": 488,
2401
+ "line": 487,
2414
2402
  "character": 9
2415
2403
  }
2416
2404
  ],
@@ -2454,7 +2442,7 @@
2454
2442
  "sources": [
2455
2443
  {
2456
2444
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
2457
- "line": 439,
2445
+ "line": 438,
2458
2446
  "character": 9
2459
2447
  }
2460
2448
  ],
@@ -2498,7 +2486,7 @@
2498
2486
  "sources": [
2499
2487
  {
2500
2488
  "fileName": "projects/lists/src/modules/repeater/repeater-item.component.ts",
2501
- "line": 452,
2489
+ "line": 451,
2502
2490
  "character": 9
2503
2491
  }
2504
2492
  ],
@@ -5564,17 +5552,27 @@
5564
5552
  {
5565
5553
  "fileName": "filter-demo.component.ts",
5566
5554
  "filePath": "/projects/lists/documentation/code-examples/filter/inline/filter-demo.component.ts",
5567
- "rawContents": "import { Component } from '@angular/core';\n\n@Component({\n selector: 'app-filter-demo',\n templateUrl: './filter-demo.component.html',\n})\nexport class FilterDemoComponent {\n public appliedFilters: any[] = [];\n\n public filteredItems: any[];\n\n public filtersActive = false;\n\n public fruitType = 'any';\n\n public hideOrange = false;\n\n public items: any[] = [\n {\n name: 'Orange',\n type: 'citrus',\n color: 'orange',\n },\n {\n name: 'Mango',\n type: 'other',\n color: 'orange',\n },\n {\n name: 'Lime',\n type: 'citrus',\n color: 'green',\n },\n {\n name: 'Strawberry',\n type: 'berry',\n color: 'red',\n },\n {\n name: 'Blueberry',\n type: 'berry',\n color: 'blue',\n },\n ];\n\n public showInlineFilters = false;\n\n constructor() {\n this.filteredItems = this.items.slice();\n }\n\n public filterButtonClicked(): void {\n this.showInlineFilters = !this.showInlineFilters;\n }\n\n public fruitTypeChange(newValue: string): void {\n this.fruitType = newValue;\n this.setFilterActiveState();\n }\n\n public hideOrangeChange(newValue: boolean): void {\n this.hideOrange = newValue;\n this.setFilterActiveState();\n }\n\n private setFilterActiveState(): void {\n this.appliedFilters = [];\n if (this.fruitType !== 'any') {\n this.appliedFilters.push({\n name: 'fruitType',\n value: this.fruitType,\n });\n }\n if (this.hideOrange) {\n this.appliedFilters.push({\n name: 'hideOrange',\n value: true,\n });\n }\n this.filtersActive = this.appliedFilters.length > 0;\n\n this.filteredItems = this.filterItems(this.items, this.appliedFilters);\n }\n\n private orangeFilterFailed(filter: any, item: any): any {\n return (\n filter.name === 'hideOrange' && filter.value && item.color === 'orange'\n );\n }\n\n private fruitTypeFilterFailed(filter: any, item: any): any {\n return (\n filter.name === 'fruitType' &&\n filter.value !== 'any' &&\n filter.value !== item.type\n );\n }\n\n private itemIsShown(filters: any[], item: any[]): boolean {\n let passesFilter = true,\n j: number;\n\n for (j = 0; j < filters.length; j++) {\n if (this.orangeFilterFailed(filters[j], item)) {\n passesFilter = false;\n } else if (this.fruitTypeFilterFailed(filters[j], item)) {\n passesFilter = false;\n }\n }\n\n return passesFilter;\n }\n\n private filterItems(items: any[], filters: any[]): any[] {\n let i: number, passesFilter: boolean;\n const result: any[] = [];\n\n for (i = 0; i < items.length; i++) {\n passesFilter = this.itemIsShown(filters, items[i]);\n if (passesFilter) {\n result.push(items[i]);\n }\n }\n\n return result;\n }\n}\n"
5555
+ "rawContents": "import { Component } from '@angular/core';\n\nimport { Filter } from './filter';\nimport { Fruit } from './fruit';\n\n@Component({\n selector: 'app-filter-demo',\n templateUrl: './filter-demo.component.html',\n})\nexport class FilterDemoComponent {\n public appliedFilters: Filter[] = [];\n\n public filteredItems: Fruit[];\n\n public filtersActive = false;\n\n public fruitType = 'any';\n\n public hideOrange = false;\n\n public items: Fruit[] = [\n {\n name: 'Orange',\n type: 'citrus',\n color: 'orange',\n },\n {\n name: 'Mango',\n type: 'other',\n color: 'orange',\n },\n {\n name: 'Lime',\n type: 'citrus',\n color: 'green',\n },\n {\n name: 'Strawberry',\n type: 'berry',\n color: 'red',\n },\n {\n name: 'Blueberry',\n type: 'berry',\n color: 'blue',\n },\n ];\n\n public showInlineFilters = false;\n\n constructor() {\n this.filteredItems = this.items.slice();\n }\n\n public filterButtonClicked(): void {\n this.showInlineFilters = !this.showInlineFilters;\n }\n\n public fruitTypeChange(newValue: string): void {\n this.fruitType = newValue;\n this.setFilterActiveState();\n }\n\n public hideOrangeChange(newValue: boolean): void {\n this.hideOrange = newValue;\n this.setFilterActiveState();\n }\n\n private setFilterActiveState(): void {\n this.appliedFilters = [];\n if (this.fruitType !== 'any') {\n this.appliedFilters.push({\n name: 'fruitType',\n value: this.fruitType,\n });\n }\n if (this.hideOrange) {\n this.appliedFilters.push({\n name: 'hideOrange',\n value: true,\n });\n }\n this.filtersActive = this.appliedFilters.length > 0;\n\n this.filteredItems = this.filterItems(this.items, this.appliedFilters);\n }\n\n private orangeFilterFailed(filter: Filter, item: Fruit): boolean {\n return (\n filter.name === 'hideOrange' && !!filter.value && item.color === 'orange'\n );\n }\n\n private fruitTypeFilterFailed(filter: Filter, item: Fruit): boolean {\n return (\n filter.name === 'fruitType' &&\n filter.value !== 'any' &&\n filter.value !== item.type\n );\n }\n\n private itemIsShown(filters: Filter[], item: Fruit): boolean {\n let passesFilter = true,\n j: number;\n\n for (j = 0; j < filters.length; j++) {\n if (this.orangeFilterFailed(filters[j], item)) {\n passesFilter = false;\n } else if (this.fruitTypeFilterFailed(filters[j], item)) {\n passesFilter = false;\n }\n }\n\n return passesFilter;\n }\n\n private filterItems(items: Fruit[], filters: Filter[]): Fruit[] {\n let i: number, passesFilter: boolean;\n const result: Fruit[] = [];\n\n for (i = 0; i < items.length; i++) {\n passesFilter = this.itemIsShown(filters, items[i]);\n if (passesFilter) {\n result.push(items[i]);\n }\n }\n\n return result;\n }\n}\n"
5568
5556
  },
5569
5557
  {
5570
5558
  "fileName": "filter-demo.module.ts",
5571
5559
  "filePath": "/projects/lists/documentation/code-examples/filter/inline/filter-demo.module.ts",
5572
5560
  "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyCheckboxModule } from '@skyux/forms';\nimport { SkyToolbarModule } from '@skyux/layout';\nimport { SkyFilterModule, SkyRepeaterModule } from '@skyux/lists';\n\nimport { FilterDemoComponent } from './filter-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n SkyCheckboxModule,\n SkyIdModule,\n SkyFilterModule,\n SkyRepeaterModule,\n SkyToolbarModule,\n ],\n declarations: [FilterDemoComponent],\n exports: [FilterDemoComponent],\n})\nexport class FilterDemoModule {}\n"
5573
5561
  },
5562
+ {
5563
+ "fileName": "filter.ts",
5564
+ "filePath": "/projects/lists/documentation/code-examples/filter/inline/filter.ts",
5565
+ "rawContents": "export interface Filter {\n name: string;\n value: string | boolean;\n}\n"
5566
+ },
5567
+ {
5568
+ "fileName": "fruit.ts",
5569
+ "filePath": "/projects/lists/documentation/code-examples/filter/inline/fruit.ts",
5570
+ "rawContents": "export interface Fruit {\n name: string;\n type: string;\n color: string;\n}\n"
5571
+ },
5574
5572
  {
5575
5573
  "fileName": "filter-demo-modal-context.ts",
5576
5574
  "filePath": "/projects/lists/documentation/code-examples/filter/modal/filter-demo-modal-context.ts",
5577
- "rawContents": "export class FilterDemoModalContext {\n public appliedFilters: any[];\n}\n"
5575
+ "rawContents": "import { Filter } from './filter';\n\nexport class FilterDemoModalContext {\n public appliedFilters: Filter[] = [];\n}\n"
5578
5576
  },
5579
5577
  {
5580
5578
  "fileName": "filter-demo-modal.component.html",
@@ -5584,7 +5582,7 @@
5584
5582
  {
5585
5583
  "fileName": "filter-demo-modal.component.ts",
5586
5584
  "filePath": "/projects/lists/documentation/code-examples/filter/modal/filter-demo-modal.component.ts",
5587
- "rawContents": "import { Component } from '@angular/core';\nimport { SkyModalInstance } from '@skyux/modals';\n\nimport { FilterDemoModalContext } from './filter-demo-modal-context';\n\n@Component({\n selector: 'app-filter-demo-modal',\n templateUrl: './filter-demo-modal.component.html',\n})\nexport class FilterDemoModalComponent {\n public hideOrange: boolean;\n\n public fruitType = 'any';\n\n constructor(\n public context: FilterDemoModalContext,\n public instance: SkyModalInstance\n ) {\n if (\n this.context &&\n this.context.appliedFilters &&\n this.context.appliedFilters.length > 0\n ) {\n this.setFormFilters(this.context.appliedFilters);\n } else {\n this.clearAllFilters();\n }\n }\n\n public applyFilters(): void {\n const result = this.getAppliedFiltersArray();\n this.instance.save(result);\n }\n\n public cancel(): void {\n this.instance.cancel();\n }\n\n public clearAllFilters(): void {\n this.hideOrange = false;\n this.fruitType = 'any';\n }\n\n private getAppliedFiltersArray(): any[] {\n const appliedFilters: any[] = [];\n if (this.fruitType !== 'any') {\n appliedFilters.push({\n name: 'fruitType',\n value: this.fruitType,\n label: this.fruitType,\n });\n }\n\n if (this.hideOrange) {\n appliedFilters.push({\n name: 'hideOrange',\n value: true,\n label: 'hide orange fruits',\n });\n }\n\n return appliedFilters;\n }\n\n private setFormFilters(appliedFilters: any[]): void {\n for (let i = 0; i < appliedFilters.length; i++) {\n if (appliedFilters[i].name === 'fruitType') {\n this.fruitType = appliedFilters[i].value;\n }\n\n if (appliedFilters[i].name === 'hideOrange') {\n this.hideOrange = appliedFilters[i].value;\n }\n }\n }\n}\n"
5585
+ "rawContents": "import { Component } from '@angular/core';\nimport { SkyModalInstance } from '@skyux/modals';\n\nimport { Filter } from './filter';\nimport { FilterDemoModalContext } from './filter-demo-modal-context';\n\n@Component({\n selector: 'app-filter-demo-modal',\n templateUrl: './filter-demo-modal.component.html',\n})\nexport class FilterDemoModalComponent {\n public hideOrange = false;\n\n public fruitType = 'any';\n\n constructor(\n public context: FilterDemoModalContext,\n public instance: SkyModalInstance\n ) {\n if (\n this.context &&\n this.context.appliedFilters &&\n this.context.appliedFilters.length > 0\n ) {\n this.setFormFilters(this.context.appliedFilters);\n } else {\n this.clearAllFilters();\n }\n }\n\n public applyFilters(): void {\n const result = this.getAppliedFiltersArray();\n this.instance.save(result);\n }\n\n public cancel(): void {\n this.instance.cancel();\n }\n\n public clearAllFilters(): void {\n this.hideOrange = false;\n this.fruitType = 'any';\n }\n\n private getAppliedFiltersArray(): Filter[] {\n const appliedFilters: Filter[] = [];\n if (this.fruitType !== 'any') {\n appliedFilters.push({\n name: 'fruitType',\n value: this.fruitType,\n label: this.fruitType,\n });\n }\n\n if (this.hideOrange) {\n appliedFilters.push({\n name: 'hideOrange',\n value: true,\n label: 'hide orange fruits',\n });\n }\n\n return appliedFilters;\n }\n\n private setFormFilters(appliedFilters: Filter[]): void {\n for (let i = 0; i < appliedFilters.length; i++) {\n if (appliedFilters[i].name === 'fruitType') {\n this.fruitType = `${appliedFilters[i].value}`;\n }\n\n if (appliedFilters[i].name === 'hideOrange') {\n this.hideOrange = !!appliedFilters[i].value;\n }\n }\n }\n}\n"
5588
5586
  },
5589
5587
  {
5590
5588
  "fileName": "filter-demo.component.html",
@@ -5594,7 +5592,7 @@
5594
5592
  {
5595
5593
  "fileName": "filter-demo.component.ts",
5596
5594
  "filePath": "/projects/lists/documentation/code-examples/filter/modal/filter-demo.component.ts",
5597
- "rawContents": "import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n} from '@angular/core';\nimport { SkyModalCloseArgs, SkyModalService } from '@skyux/modals';\n\nimport { FilterDemoModalContext } from './filter-demo-modal-context';\nimport { FilterDemoModalComponent } from './filter-demo-modal.component';\n\n@Component({\n selector: 'app-filter-demo',\n templateUrl: './filter-demo.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FilterDemoComponent {\n public appliedFilters: any[] = [];\n\n public filteredItems: any[];\n\n public items: any[] = [\n {\n name: 'Orange',\n type: 'citrus',\n color: 'orange',\n },\n {\n name: 'Mango',\n type: 'other',\n color: 'orange',\n },\n {\n name: 'Lime',\n type: 'citrus',\n color: 'green',\n },\n {\n name: 'Strawberry',\n type: 'berry',\n color: 'red',\n },\n {\n name: 'Blueberry',\n type: 'berry',\n color: 'blue',\n },\n ];\n\n public showInlineFilters = false;\n\n constructor(\n private modal: SkyModalService,\n private changeRef: ChangeDetectorRef\n ) {\n this.filteredItems = this.items.slice();\n }\n\n public onDismiss(index: number): void {\n this.appliedFilters.splice(index, 1);\n this.filteredItems = this.filterItems(this.items, this.appliedFilters);\n }\n\n public onInlineFilterButtonClicked(): void {\n this.showInlineFilters = !this.showInlineFilters;\n }\n\n public onModalFilterButtonClick(): void {\n const modalInstance = this.modal.open(FilterDemoModalComponent, [\n {\n provide: FilterDemoModalContext,\n useValue: {\n appliedFilters: this.appliedFilters,\n },\n },\n ]);\n\n modalInstance.closed.subscribe((result: SkyModalCloseArgs) => {\n if (result.reason === 'save') {\n this.appliedFilters = result.data.slice();\n this.filteredItems = this.filterItems(this.items, this.appliedFilters);\n this.changeRef.markForCheck();\n }\n });\n }\n\n private fruitTypeFilterFailed(filter: any, item: any): boolean {\n return (\n filter.name === 'fruitType' &&\n filter.value !== 'any' &&\n filter.value !== item.type\n );\n }\n\n private itemIsShown(filters: any[], item: any[]): boolean {\n let passesFilter = true,\n j: number;\n\n for (j = 0; j < filters.length; j++) {\n if (this.orangeFilterFailed(filters[j], item)) {\n passesFilter = false;\n } else if (this.fruitTypeFilterFailed(filters[j], item)) {\n passesFilter = false;\n }\n }\n\n return passesFilter;\n }\n\n private filterItems(items: any[], filters: any[]): any[] {\n let i: number, passesFilter: boolean;\n const result: any[] = [];\n\n for (i = 0; i < items.length; i++) {\n passesFilter = this.itemIsShown(filters, items[i]);\n if (passesFilter) {\n result.push(items[i]);\n }\n }\n\n return result;\n }\n\n private orangeFilterFailed(filter: any, item: any): boolean {\n return (\n filter.name === 'hideOrange' && filter.value && item.color === 'orange'\n );\n }\n}\n"
5595
+ "rawContents": "import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n} from '@angular/core';\nimport { SkyModalCloseArgs, SkyModalService } from '@skyux/modals';\n\nimport { Filter } from './filter';\nimport { FilterDemoModalContext } from './filter-demo-modal-context';\nimport { FilterDemoModalComponent } from './filter-demo-modal.component';\nimport { Fruit } from './fruit';\n\n@Component({\n selector: 'app-filter-demo',\n templateUrl: './filter-demo.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FilterDemoComponent {\n public appliedFilters: Filter[] = [];\n\n public filteredItems: Fruit[];\n\n public items: Fruit[] = [\n {\n name: 'Orange',\n type: 'citrus',\n color: 'orange',\n },\n {\n name: 'Mango',\n type: 'other',\n color: 'orange',\n },\n {\n name: 'Lime',\n type: 'citrus',\n color: 'green',\n },\n {\n name: 'Strawberry',\n type: 'berry',\n color: 'red',\n },\n {\n name: 'Blueberry',\n type: 'berry',\n color: 'blue',\n },\n ];\n\n public showInlineFilters = false;\n\n constructor(\n private modal: SkyModalService,\n private changeRef: ChangeDetectorRef\n ) {\n this.filteredItems = this.items.slice();\n }\n\n public onDismiss(index: number): void {\n this.appliedFilters.splice(index, 1);\n this.filteredItems = this.filterItems(this.items, this.appliedFilters);\n }\n\n public onInlineFilterButtonClicked(): void {\n this.showInlineFilters = !this.showInlineFilters;\n }\n\n public onModalFilterButtonClick(): void {\n const modalInstance = this.modal.open(FilterDemoModalComponent, [\n {\n provide: FilterDemoModalContext,\n useValue: {\n appliedFilters: this.appliedFilters,\n },\n },\n ]);\n\n modalInstance.closed.subscribe((result: SkyModalCloseArgs) => {\n if (result.reason === 'save') {\n this.appliedFilters = result.data.slice();\n this.filteredItems = this.filterItems(this.items, this.appliedFilters);\n this.changeRef.markForCheck();\n }\n });\n }\n\n private fruitTypeFilterFailed(filter: Filter, item: Fruit): boolean {\n return (\n filter.name === 'fruitType' &&\n filter.value !== 'any' &&\n filter.value !== item.type\n );\n }\n\n private itemIsShown(filters: Filter[], item: Fruit): boolean {\n let passesFilter = true,\n j: number;\n\n for (j = 0; j < filters.length; j++) {\n if (this.orangeFilterFailed(filters[j], item)) {\n passesFilter = false;\n } else if (this.fruitTypeFilterFailed(filters[j], item)) {\n passesFilter = false;\n }\n }\n\n return passesFilter;\n }\n\n private filterItems(items: Fruit[], filters: Filter[]): Fruit[] {\n let i: number, passesFilter: boolean;\n const result: Fruit[] = [];\n\n for (i = 0; i < items.length; i++) {\n passesFilter = this.itemIsShown(filters, items[i]);\n if (passesFilter) {\n result.push(items[i]);\n }\n }\n\n return result;\n }\n\n private orangeFilterFailed(filter: Filter, item: Fruit): boolean {\n return (\n filter.name === 'hideOrange' && !!filter.value && item.color === 'orange'\n );\n }\n}\n"
5598
5596
  },
5599
5597
  {
5600
5598
  "fileName": "filter-demo.module.ts",
@@ -5602,19 +5600,19 @@
5602
5600
  "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyCheckboxModule } from '@skyux/forms';\nimport { SkyToolbarModule } from '@skyux/layout';\nimport { SkyFilterModule, SkyRepeaterModule } from '@skyux/lists';\nimport { SkyModalModule } from '@skyux/modals';\n\nimport { FilterDemoModalComponent } from './filter-demo-modal.component';\nimport { FilterDemoComponent } from './filter-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n SkyIdModule,\n SkyCheckboxModule,\n SkyFilterModule,\n SkyModalModule,\n SkyRepeaterModule,\n SkyToolbarModule,\n ],\n declarations: [FilterDemoComponent, FilterDemoModalComponent],\n exports: [FilterDemoComponent],\n})\nexport class FilterDemoModule {}\n"
5603
5601
  },
5604
5602
  {
5605
- "fileName": "infinite-scroll-demo.component.html",
5606
- "filePath": "/projects/lists/documentation/code-examples/infinite-scroll/list/infinite-scroll-demo.component.html",
5607
- "rawContents": "<div style=\"overflow-y: auto; max-height: 500px; position: relative\">\n <sky-list [data]=\"items\">\n <sky-list-view-grid fit=\"scroll\">\n <sky-grid-column field=\"name\" heading=\"Name\"></sky-grid-column>\n </sky-list-view-grid>\n </sky-list>\n <sky-infinite-scroll [enabled]=\"itemsHaveMore\" (scrollEnd)=\"onScrollEnd()\">\n </sky-infinite-scroll>\n</div>\n<br />\n<br />\n"
5603
+ "fileName": "filter.ts",
5604
+ "filePath": "/projects/lists/documentation/code-examples/filter/modal/filter.ts",
5605
+ "rawContents": "export interface Filter {\n name: string;\n value: string | boolean;\n label: string;\n}\n"
5608
5606
  },
5609
5607
  {
5610
- "fileName": "infinite-scroll-demo.component.ts",
5611
- "filePath": "/projects/lists/documentation/code-examples/infinite-scroll/list/infinite-scroll-demo.component.ts",
5612
- "rawContents": "import { Component, OnInit } from '@angular/core';\n\nimport { BehaviorSubject } from 'rxjs';\n\nlet nextId = 0;\n\n@Component({\n selector: 'app-infinite-scroll-demo',\n templateUrl: './infinite-scroll-demo.component.html',\n})\nexport class InfiniteScrollDemoComponent implements OnInit {\n public itemsHaveMore = true;\n\n public items = new BehaviorSubject<any[]>([]);\n\n private _items: any[] = [];\n\n public ngOnInit(): void {\n this.addData();\n }\n\n public onScrollEnd(): void {\n if (this.itemsHaveMore) {\n this.addData();\n }\n }\n\n private addData(): void {\n this.mockRemote().then((result: any) => {\n this._items = this._items.concat(result.data);\n this.items.next(this._items);\n this.itemsHaveMore = result.hasMore;\n });\n }\n\n private mockRemote(): Promise<any> {\n const data: any[] = [];\n\n for (let i = 0; i < 8; i++) {\n data.push({\n name: `List item #${++nextId}`,\n });\n }\n\n // Simulate async request.\n return new Promise((resolve: any) => {\n setTimeout(() => {\n resolve({\n data,\n hasMore: nextId < 50,\n });\n }, 1000);\n });\n }\n}\n"
5608
+ "fileName": "fruit.ts",
5609
+ "filePath": "/projects/lists/documentation/code-examples/filter/modal/fruit.ts",
5610
+ "rawContents": "export interface Fruit {\n name: string;\n type: string;\n color: string;\n}\n"
5613
5611
  },
5614
5612
  {
5615
- "fileName": "infinite-scroll-demo.module.ts",
5616
- "filePath": "/projects/lists/documentation/code-examples/infinite-scroll/list/infinite-scroll-demo.module.ts",
5617
- "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SkyBackToTopModule } from '@skyux/layout';\nimport { SkyListModule } from '@skyux/list-builder';\nimport { SkyListViewGridModule } from '@skyux/list-builder-view-grids';\nimport { SkyInfiniteScrollModule } from '@skyux/lists';\n\nimport { InfiniteScrollDemoComponent } from './infinite-scroll-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n SkyBackToTopModule,\n SkyInfiniteScrollModule,\n SkyListModule,\n SkyListViewGridModule,\n ],\n declarations: [InfiniteScrollDemoComponent],\n exports: [InfiniteScrollDemoComponent],\n})\nexport class InfiniteScrollDemoModule {}\n"
5613
+ "fileName": "infinite-scroll-demo-item.ts",
5614
+ "filePath": "/projects/lists/documentation/code-examples/infinite-scroll/repeater/infinite-scroll-demo-item.ts",
5615
+ "rawContents": "export interface InfiniteScrollDemoItem {\n name: string;\n}\n"
5618
5616
  },
5619
5617
  {
5620
5618
  "fileName": "infinite-scroll-demo.component.html",
@@ -5624,7 +5622,7 @@
5624
5622
  {
5625
5623
  "fileName": "infinite-scroll-demo.component.ts",
5626
5624
  "filePath": "/projects/lists/documentation/code-examples/infinite-scroll/repeater/infinite-scroll-demo.component.ts",
5627
- "rawContents": "import { Component, OnInit } from '@angular/core';\n\nlet nextId = 0;\n\n@Component({\n selector: 'app-infinite-scroll-demo',\n templateUrl: './infinite-scroll-demo.component.html',\n})\nexport class InfiniteScrollDemoComponent implements OnInit {\n public items: any[] = [];\n\n public itemsHaveMore = true;\n\n public ngOnInit(): void {\n this.addData();\n }\n\n public onScrollEnd(): void {\n if (this.itemsHaveMore) {\n this.addData();\n }\n }\n\n private addData(): void {\n this.mockRemote().then((result: any) => {\n this.items = this.items.concat(result.data);\n this.itemsHaveMore = result.hasMore;\n });\n }\n\n private mockRemote(): Promise<any> {\n const data: any[] = [];\n\n for (let i = 0; i < 8; i++) {\n data.push({\n name: `Item #${++nextId}`,\n });\n }\n\n // Simulate async request.\n return new Promise((resolve: any) => {\n setTimeout(() => {\n resolve({\n data,\n hasMore: nextId < 50,\n });\n }, 1000);\n });\n }\n}\n"
5625
+ "rawContents": "import { Component, OnInit } from '@angular/core';\n\nimport { InfiniteScrollDemoItem } from './infinite-scroll-demo-item';\n\nlet nextId = 0;\n\n@Component({\n selector: 'app-infinite-scroll-demo',\n templateUrl: './infinite-scroll-demo.component.html',\n})\nexport class InfiniteScrollDemoComponent implements OnInit {\n public items: InfiniteScrollDemoItem[] = [];\n\n public itemsHaveMore = true;\n\n public ngOnInit(): void {\n this.addData();\n }\n\n public onScrollEnd(): void {\n if (this.itemsHaveMore) {\n this.addData();\n }\n }\n\n private addData(): void {\n this.mockRemote().then(\n (result: { data: InfiniteScrollDemoItem[]; hasMore: boolean }) => {\n this.items = this.items.concat(result.data);\n this.itemsHaveMore = result.hasMore;\n }\n );\n }\n\n private mockRemote(): Promise<{\n data: InfiniteScrollDemoItem[];\n hasMore: boolean;\n }> {\n const data: InfiniteScrollDemoItem[] = [];\n\n for (let i = 0; i < 8; i++) {\n data.push({\n name: `Item #${++nextId}`,\n });\n }\n\n // Simulate async request.\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve({\n data,\n hasMore: nextId < 50,\n });\n }, 1000);\n });\n }\n}\n"
5628
5626
  },
5629
5627
  {
5630
5628
  "fileName": "infinite-scroll-demo.module.ts",
@@ -5646,6 +5644,11 @@
5646
5644
  "filePath": "/projects/lists/documentation/code-examples/paging/basic/paging-demo.module.ts",
5647
5645
  "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SkyPagingModule } from '@skyux/lists';\n\nimport { PagingDemoComponent } from './paging-demo.component';\n\n@NgModule({\n imports: [CommonModule, SkyPagingModule],\n declarations: [PagingDemoComponent],\n exports: [PagingDemoComponent],\n})\nexport class PagingDemoModule {}\n"
5648
5646
  },
5647
+ {
5648
+ "fileName": "repeater-demo-item.ts",
5649
+ "filePath": "/projects/lists/documentation/code-examples/repeater/add-remove/repeater-demo-item.ts",
5650
+ "rawContents": "export interface RepeaterDemoItem {\n title: string;\n note: string;\n status: string;\n}\n"
5651
+ },
5649
5652
  {
5650
5653
  "fileName": "repeater-demo.component.html",
5651
5654
  "filePath": "/projects/lists/documentation/code-examples/repeater/add-remove/repeater-demo.component.html",
@@ -5659,7 +5662,7 @@
5659
5662
  {
5660
5663
  "fileName": "repeater-demo.component.ts",
5661
5664
  "filePath": "/projects/lists/documentation/code-examples/repeater/add-remove/repeater-demo.component.ts",
5662
- "rawContents": "import { Component } from '@angular/core';\n\nlet nextId = 0;\n\n@Component({\n selector: 'app-repeater-demo',\n templateUrl: './repeater-demo.component.html',\n styleUrls: ['./repeater-demo.component.scss'],\n})\nexport class RepeaterDemoComponent {\n public items: any[] = [\n {\n title: 'Call Robert Hernandez',\n note: 'Robert recently gave a very generous gift. We should call him to thank him.',\n status: 'Completed',\n },\n {\n title: 'Send invitation to Spring Ball',\n note: \"The Spring Ball is coming up soon. Let's get those invitations out!\",\n status: 'Past due',\n },\n ];\n\n public addItem(): void {\n this.items.push({\n title: 'New reminder ' + ++nextId,\n note: 'This is a new reminder',\n status: 'Active',\n });\n }\n\n public changeItems(tags: any): void {\n this.items = tags;\n }\n\n public onActionClicked(buttonText: string): void {\n alert(buttonText + ' was clicked!');\n }\n\n public removeItem(): void {\n this.items.pop();\n }\n}\n"
5665
+ "rawContents": "import { Component } from '@angular/core';\n\nimport { RepeaterDemoItem } from './repeater-demo-item';\n\nlet nextId = 0;\n\n@Component({\n selector: 'app-repeater-demo',\n templateUrl: './repeater-demo.component.html',\n styleUrls: ['./repeater-demo.component.scss'],\n})\nexport class RepeaterDemoComponent {\n public items: RepeaterDemoItem[] = [\n {\n title: 'Call Robert Hernandez',\n note: 'Robert recently gave a very generous gift. We should call him to thank him.',\n status: 'Completed',\n },\n {\n title: 'Send invitation to Spring Ball',\n note: \"The Spring Ball is coming up soon. Let's get those invitations out!\",\n status: 'Past due',\n },\n ];\n\n public addItem(): void {\n this.items.push({\n title: 'New reminder ' + ++nextId,\n note: 'This is a new reminder',\n status: 'Active',\n });\n }\n\n public changeItems(tags: RepeaterDemoItem[]): void {\n this.items = tags;\n }\n\n public onActionClicked(buttonText: string): void {\n alert(buttonText + ' was clicked!');\n }\n\n public removeItem(): void {\n this.items.pop();\n }\n}\n"
5663
5666
  },
5664
5667
  {
5665
5668
  "fileName": "repeater-demo.module.ts",
@@ -5686,6 +5689,11 @@
5686
5689
  "filePath": "/projects/lists/documentation/code-examples/repeater/basic/repeater-demo.module.ts",
5687
5690
  "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SkyRepeaterModule } from '@skyux/lists';\nimport { SkyDropdownModule } from '@skyux/popovers';\n\nimport { RepeaterDemoComponent } from './repeater-demo.component';\n\n@NgModule({\n imports: [CommonModule, SkyDropdownModule, SkyRepeaterModule],\n declarations: [RepeaterDemoComponent],\n exports: [RepeaterDemoComponent],\n})\nexport class RepeaterDemoModule {}\n"
5688
5691
  },
5692
+ {
5693
+ "fileName": "repeater-demo-item.ts",
5694
+ "filePath": "/projects/lists/documentation/code-examples/sort/basic/repeater-demo-item.ts",
5695
+ "rawContents": "export interface RepeaterDemoItem {\n title: string;\n note: string;\n assignee: string;\n date: Date;\n}\n"
5696
+ },
5689
5697
  {
5690
5698
  "fileName": "sort-demo.component.html",
5691
5699
  "filePath": "/projects/lists/documentation/code-examples/sort/basic/sort-demo.component.html",
@@ -5694,12 +5702,17 @@
5694
5702
  {
5695
5703
  "fileName": "sort-demo.component.ts",
5696
5704
  "filePath": "/projects/lists/documentation/code-examples/sort/basic/sort-demo.component.ts",
5697
- "rawContents": "import { Component, OnInit } from '@angular/core';\n\n@Component({\n selector: 'app-sort-demo',\n templateUrl: './sort-demo.component.html',\n})\nexport class SortDemoComponent implements OnInit {\n public initialState: number;\n\n public sortedItems: any[] = [\n {\n title: 'Call Robert Hernandez',\n note: 'Robert recently gave a very generous gift. We should call to thank him.',\n assignee: 'Debby Fowler',\n date: new Date('12/22/2015'),\n },\n {\n title: 'Send invitation to ball',\n note: \"The Spring Ball is coming up soon. Let's get those invitations out!\",\n assignee: 'Debby Fowler',\n date: new Date('1/1/2016'),\n },\n {\n title: 'Clean up desk',\n note: 'File and organize papers.',\n assignee: 'Tim Howard',\n date: new Date('2/2/2016'),\n },\n {\n title: 'Investigate leads',\n note: 'Check out leads for important charity event funding.',\n assignee: 'Larry Williams',\n date: new Date('4/5/2016'),\n },\n {\n title: 'Send thank you note',\n note: 'Send a thank you note to Timothy for his donation.',\n assignee: 'Catherine Hooper',\n date: new Date('11/11/2015'),\n },\n ];\n\n public sortOptions: any[] = [\n {\n id: 1,\n label: 'Assigned to (A - Z)',\n name: 'assignee',\n descending: false,\n },\n {\n id: 2,\n label: 'Assigned to (Z - A)',\n name: 'assignee',\n descending: true,\n },\n {\n id: 3,\n label: 'Date created (newest first)',\n name: 'date',\n descending: true,\n },\n {\n id: 4,\n label: 'Date created (oldest first)',\n name: 'date',\n descending: false,\n },\n {\n id: 5,\n label: 'Note title (A - Z)',\n name: 'title',\n descending: false,\n },\n {\n id: 6,\n label: 'Note title (Z - A)',\n name: 'title',\n descending: true,\n },\n ];\n\n public ngOnInit(): void {\n this.initialState = 3;\n this.sortItems(this.sortOptions[2]);\n }\n\n public sortItems(item: any): void {\n this.sortedItems = this.sortedItems.sort(function (a: any, b: any) {\n const descending = item.descending ? -1 : 1;\n const sortProperty = item.name;\n\n if (a[sortProperty] > b[sortProperty]) {\n return descending;\n } else if (a[sortProperty] < b[sortProperty]) {\n return -1 * descending;\n } else {\n return 0;\n }\n });\n }\n}\n"
5705
+ "rawContents": "import { Component, OnInit } from '@angular/core';\n\nimport { RepeaterDemoItem } from './repeater-demo-item';\nimport { SortOption } from './sort-option';\n\n@Component({\n selector: 'app-sort-demo',\n templateUrl: './sort-demo.component.html',\n})\nexport class SortDemoComponent implements OnInit {\n public initialState = 3;\n\n public sortedItems: RepeaterDemoItem[] = [\n {\n title: 'Call Robert Hernandez',\n note: 'Robert recently gave a very generous gift. We should call to thank him.',\n assignee: 'Debby Fowler',\n date: new Date('12/22/2015'),\n },\n {\n title: 'Send invitation to ball',\n note: \"The Spring Ball is coming up soon. Let's get those invitations out!\",\n assignee: 'Debby Fowler',\n date: new Date('1/1/2016'),\n },\n {\n title: 'Clean up desk',\n note: 'File and organize papers.',\n assignee: 'Tim Howard',\n date: new Date('2/2/2016'),\n },\n {\n title: 'Investigate leads',\n note: 'Check out leads for important charity event funding.',\n assignee: 'Larry Williams',\n date: new Date('4/5/2016'),\n },\n {\n title: 'Send thank you note',\n note: 'Send a thank you note to Timothy for his donation.',\n assignee: 'Catherine Hooper',\n date: new Date('11/11/2015'),\n },\n ];\n\n public sortOptions: SortOption[] = [\n {\n id: 1,\n label: 'Assigned to (A - Z)',\n name: 'assignee',\n descending: false,\n },\n {\n id: 2,\n label: 'Assigned to (Z - A)',\n name: 'assignee',\n descending: true,\n },\n {\n id: 3,\n label: 'Date created (newest first)',\n name: 'date',\n descending: true,\n },\n {\n id: 4,\n label: 'Date created (oldest first)',\n name: 'date',\n descending: false,\n },\n {\n id: 5,\n label: 'Note title (A - Z)',\n name: 'title',\n descending: false,\n },\n {\n id: 6,\n label: 'Note title (Z - A)',\n name: 'title',\n descending: true,\n },\n ];\n\n public ngOnInit(): void {\n this.sortItems(this.sortOptions[2]);\n }\n\n public sortItems(option: SortOption): void {\n this.sortedItems = this.sortedItems.sort(function (\n a: RepeaterDemoItem,\n b: RepeaterDemoItem\n ) {\n const descending = option.descending ? -1 : 1;\n const sortProperty: keyof typeof a = option.name;\n\n if (a[sortProperty] > b[sortProperty]) {\n return descending;\n } else if (a[sortProperty] < b[sortProperty]) {\n return -1 * descending;\n } else {\n return 0;\n }\n });\n }\n}\n"
5698
5706
  },
5699
5707
  {
5700
5708
  "fileName": "sort-demo.module.ts",
5701
5709
  "filePath": "/projects/lists/documentation/code-examples/sort/basic/sort-demo.module.ts",
5702
5710
  "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SkyToolbarModule } from '@skyux/layout';\nimport { SkyRepeaterModule, SkySortModule } from '@skyux/lists';\n\nimport { SortDemoComponent } from './sort-demo.component';\n\n@NgModule({\n imports: [CommonModule, SkyRepeaterModule, SkySortModule, SkyToolbarModule],\n declarations: [SortDemoComponent],\n exports: [SortDemoComponent],\n})\nexport class SortDemoModule {}\n"
5711
+ },
5712
+ {
5713
+ "fileName": "sort-option.ts",
5714
+ "filePath": "/projects/lists/documentation/code-examples/sort/basic/sort-option.ts",
5715
+ "rawContents": "import { RepeaterDemoItem } from './repeater-demo-item';\n\nexport interface SortOption {\n id: number;\n label: string;\n name: keyof RepeaterDemoItem;\n descending: boolean;\n}\n"
5703
5716
  }
5704
5717
  ]
5705
5718
  }