@skyux/list-builder 5.7.2 → 6.0.0-beta.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.
Files changed (277) hide show
  1. package/esm2020/index.mjs +78 -0
  2. package/esm2020/lib/modules/list/list-data-request.model.mjs +18 -0
  3. package/esm2020/lib/modules/list/list-data-response.model.mjs +9 -0
  4. package/esm2020/lib/modules/list/list-data.provider.mjs +9 -0
  5. package/esm2020/lib/modules/list/list-paging.component.mjs +13 -0
  6. package/esm2020/lib/modules/list/list-view.component.mjs +29 -0
  7. package/esm2020/lib/modules/list/list.component.mjs +305 -0
  8. package/esm2020/lib/modules/list/list.module.mjs +18 -0
  9. package/esm2020/lib/modules/list/state/filters/filters.orchestrator.mjs +16 -0
  10. package/esm2020/lib/modules/list/state/filters/update.action.mjs +9 -0
  11. package/esm2020/lib/modules/list/state/items/items.orchestrator.mjs +53 -0
  12. package/esm2020/lib/modules/list/state/items/load.action.mjs +12 -0
  13. package/esm2020/lib/modules/list/state/items/set-items-selected.action.mjs +13 -0
  14. package/esm2020/lib/modules/list/state/items/set-loading.action.mjs +9 -0
  15. package/esm2020/lib/modules/list/state/list-state-action.type.mjs +2 -0
  16. package/esm2020/lib/modules/list/state/list-state.model.mjs +24 -0
  17. package/esm2020/lib/modules/list/state/list-state.rxstate.mjs +80 -0
  18. package/esm2020/lib/modules/list/state/list-state.state-node.mjs +37 -0
  19. package/esm2020/lib/modules/list/state/paging/paging.model.mjs +14 -0
  20. package/esm2020/lib/modules/list/state/paging/paging.orchestrator.mjs +27 -0
  21. package/esm2020/lib/modules/list/state/paging/set-items-per-page.action.mjs +9 -0
  22. package/esm2020/lib/modules/list/state/paging/set-max-pages.action.mjs +9 -0
  23. package/esm2020/lib/modules/list/state/paging/set-page-number.action.mjs +9 -0
  24. package/esm2020/lib/modules/list/state/search/search.model.mjs +32 -0
  25. package/esm2020/lib/modules/list/state/search/search.orchestrator.mjs +47 -0
  26. package/esm2020/lib/modules/list/state/search/set-field-selectors.action.mjs +9 -0
  27. package/esm2020/lib/modules/list/state/search/set-functions.action.mjs +9 -0
  28. package/esm2020/lib/modules/list/state/search/set-options.action.mjs +11 -0
  29. package/esm2020/lib/modules/list/state/search/set-search-text.action.mjs +9 -0
  30. package/esm2020/lib/modules/list/state/selected/load.action.mjs +9 -0
  31. package/esm2020/lib/modules/list/state/selected/selected.model.mjs +9 -0
  32. package/esm2020/lib/modules/list/state/selected/selected.orchestrator.mjs +56 -0
  33. package/esm2020/lib/modules/list/state/selected/set-item-selected.action.mjs +10 -0
  34. package/esm2020/lib/modules/list/state/selected/set-items-selected.action.mjs +11 -0
  35. package/esm2020/lib/modules/list/state/selected/set-loading.action.mjs +9 -0
  36. package/esm2020/lib/modules/list/state/sort/label.model.mjs +25 -0
  37. package/esm2020/lib/modules/list/state/sort/set-available.action.mjs +9 -0
  38. package/esm2020/lib/modules/list/state/sort/set-field-selectors.action.mjs +9 -0
  39. package/esm2020/lib/modules/list/state/sort/set-global.action.mjs +9 -0
  40. package/esm2020/lib/modules/list/state/sort/sort.model.mjs +27 -0
  41. package/esm2020/lib/modules/list/state/sort/sort.orchestrator.mjs +30 -0
  42. package/esm2020/lib/modules/list/state/toolbar/disable.action.mjs +9 -0
  43. package/esm2020/lib/modules/list/state/toolbar/load.action.mjs +10 -0
  44. package/esm2020/lib/modules/list/state/toolbar/remove.action.mjs +9 -0
  45. package/esm2020/lib/modules/list/state/toolbar/set-exists.action.mjs +9 -0
  46. package/esm2020/lib/modules/list/state/toolbar/set-type.action.mjs +9 -0
  47. package/esm2020/lib/modules/list/state/toolbar/show-multiselect-toolbar.action.mjs +9 -0
  48. package/esm2020/lib/modules/list/state/toolbar/toolbar-item.model.mjs +16 -0
  49. package/esm2020/lib/modules/list/state/toolbar/toolbar.model.mjs +17 -0
  50. package/esm2020/lib/modules/list/state/toolbar/toolbar.orchestrator.mjs +80 -0
  51. package/esm2020/lib/modules/list/state/views/load.action.mjs +9 -0
  52. package/esm2020/lib/modules/list/state/views/set-active.action.mjs +9 -0
  53. package/esm2020/lib/modules/list/state/views/view.model.mjs +10 -0
  54. package/esm2020/lib/modules/list/state/views/views.model.mjs +13 -0
  55. package/esm2020/lib/modules/list/state/views/views.orchestrator.mjs +21 -0
  56. package/esm2020/lib/modules/list-data-provider-in-memory/list-data-in-memory.provider.mjs +160 -0
  57. package/esm2020/lib/modules/list-filters/filter.model.mjs +18 -0
  58. package/esm2020/lib/modules/list-filters/list-filter-button.component.mjs +41 -0
  59. package/esm2020/lib/modules/list-filters/list-filter-inline-item-renderer.component.mjs +34 -0
  60. package/esm2020/lib/modules/list-filters/list-filter-inline-item.component.mjs +45 -0
  61. package/esm2020/lib/modules/list-filters/list-filter-inline.component.mjs +71 -0
  62. package/esm2020/lib/modules/list-filters/list-filter-inline.model.mjs +21 -0
  63. package/esm2020/lib/modules/list-filters/list-filter-summary.component.mjs +57 -0
  64. package/esm2020/lib/modules/list-filters/list-filters.module.mjs +41 -0
  65. package/esm2020/lib/modules/list-paging/list-paging.component.mjs +84 -0
  66. package/esm2020/lib/modules/list-paging/list-paging.module.mjs +19 -0
  67. package/esm2020/lib/modules/list-toolbar/list-multiselect-toolbar.component.mjs +148 -0
  68. package/esm2020/lib/modules/list-toolbar/list-secondary-actions/list-secondary-action.component.mjs +30 -0
  69. package/esm2020/lib/modules/list-toolbar/list-secondary-actions/list-secondary-action.mjs +2 -0
  70. package/esm2020/lib/modules/list-toolbar/list-secondary-actions/list-secondary-actions-host.component.mjs +45 -0
  71. package/esm2020/lib/modules/list-toolbar/list-secondary-actions/list-secondary-actions.component.mjs +40 -0
  72. package/esm2020/lib/modules/list-toolbar/list-secondary-actions/list-secondary-actions.module.mjs +46 -0
  73. package/esm2020/lib/modules/list-toolbar/list-secondary-actions/list-secondary-actions.service.mjs +36 -0
  74. package/esm2020/lib/modules/list-toolbar/list-toolbar-item-renderer.component.mjs +30 -0
  75. package/esm2020/lib/modules/list-toolbar/list-toolbar-item.component.mjs +47 -0
  76. package/esm2020/lib/modules/list-toolbar/list-toolbar-search-actions.component.mjs +14 -0
  77. package/esm2020/lib/modules/list-toolbar/list-toolbar-sort.component.mjs +25 -0
  78. package/esm2020/lib/modules/list-toolbar/list-toolbar-view-actions.component.mjs +17 -0
  79. package/esm2020/lib/modules/list-toolbar/list-toolbar.component.mjs +354 -0
  80. package/esm2020/lib/modules/list-toolbar/list-toolbar.module.mjs +87 -0
  81. package/esm2020/lib/modules/list-toolbar/state/config/config.model.mjs +14 -0
  82. package/esm2020/lib/modules/list-toolbar/state/config/config.orchestrator.mjs +21 -0
  83. package/esm2020/lib/modules/list-toolbar/state/config/set-search-enabled.action.mjs +9 -0
  84. package/esm2020/lib/modules/list-toolbar/state/config/set-sort-selector-enabled.action.mjs +10 -0
  85. package/esm2020/lib/modules/list-toolbar/state/toolbar-state-action.type.mjs +2 -0
  86. package/esm2020/lib/modules/list-toolbar/state/toolbar-state.model.mjs +10 -0
  87. package/esm2020/lib/modules/list-toolbar/state/toolbar-state.rxstate.mjs +19 -0
  88. package/esm2020/lib/modules/list-toolbar/state/toolbar-state.state-node.mjs +23 -0
  89. package/esm2020/lib/modules/shared/sky-list-builder-resources.module.mjs +53 -0
  90. package/esm2020/skyux-list-builder.mjs +5 -0
  91. package/fesm2015/{skyux-list-builder.js → skyux-list-builder.mjs} +104 -150
  92. package/fesm2015/skyux-list-builder.mjs.map +1 -0
  93. package/fesm2020/skyux-list-builder.mjs +2667 -0
  94. package/fesm2020/skyux-list-builder.mjs.map +1 -0
  95. package/package.json +33 -17
  96. package/bundles/skyux-list-builder.umd.js +0 -3357
  97. package/esm2015/index.js +0 -78
  98. package/esm2015/index.js.map +0 -1
  99. package/esm2015/lib/modules/list/list-data-request.model.js +0 -18
  100. package/esm2015/lib/modules/list/list-data-request.model.js.map +0 -1
  101. package/esm2015/lib/modules/list/list-data-response.model.js +0 -9
  102. package/esm2015/lib/modules/list/list-data-response.model.js.map +0 -1
  103. package/esm2015/lib/modules/list/list-data.provider.js +0 -9
  104. package/esm2015/lib/modules/list/list-data.provider.js.map +0 -1
  105. package/esm2015/lib/modules/list/list-paging.component.js +0 -13
  106. package/esm2015/lib/modules/list/list-paging.component.js.map +0 -1
  107. package/esm2015/lib/modules/list/list-view.component.js +0 -29
  108. package/esm2015/lib/modules/list/list-view.component.js.map +0 -1
  109. package/esm2015/lib/modules/list/list.component.js +0 -305
  110. package/esm2015/lib/modules/list/list.component.js.map +0 -1
  111. package/esm2015/lib/modules/list/list.module.js +0 -18
  112. package/esm2015/lib/modules/list/list.module.js.map +0 -1
  113. package/esm2015/lib/modules/list/state/filters/filters.orchestrator.js +0 -16
  114. package/esm2015/lib/modules/list/state/filters/filters.orchestrator.js.map +0 -1
  115. package/esm2015/lib/modules/list/state/filters/update.action.js +0 -9
  116. package/esm2015/lib/modules/list/state/filters/update.action.js.map +0 -1
  117. package/esm2015/lib/modules/list/state/items/items.orchestrator.js +0 -53
  118. package/esm2015/lib/modules/list/state/items/items.orchestrator.js.map +0 -1
  119. package/esm2015/lib/modules/list/state/items/load.action.js +0 -12
  120. package/esm2015/lib/modules/list/state/items/load.action.js.map +0 -1
  121. package/esm2015/lib/modules/list/state/items/set-items-selected.action.js +0 -13
  122. package/esm2015/lib/modules/list/state/items/set-items-selected.action.js.map +0 -1
  123. package/esm2015/lib/modules/list/state/items/set-loading.action.js +0 -9
  124. package/esm2015/lib/modules/list/state/items/set-loading.action.js.map +0 -1
  125. package/esm2015/lib/modules/list/state/list-state-action.type.js +0 -2
  126. package/esm2015/lib/modules/list/state/list-state-action.type.js.map +0 -1
  127. package/esm2015/lib/modules/list/state/list-state.model.js +0 -24
  128. package/esm2015/lib/modules/list/state/list-state.model.js.map +0 -1
  129. package/esm2015/lib/modules/list/state/list-state.rxstate.js +0 -80
  130. package/esm2015/lib/modules/list/state/list-state.rxstate.js.map +0 -1
  131. package/esm2015/lib/modules/list/state/list-state.state-node.js +0 -37
  132. package/esm2015/lib/modules/list/state/list-state.state-node.js.map +0 -1
  133. package/esm2015/lib/modules/list/state/paging/paging.model.js +0 -14
  134. package/esm2015/lib/modules/list/state/paging/paging.model.js.map +0 -1
  135. package/esm2015/lib/modules/list/state/paging/paging.orchestrator.js +0 -27
  136. package/esm2015/lib/modules/list/state/paging/paging.orchestrator.js.map +0 -1
  137. package/esm2015/lib/modules/list/state/paging/set-items-per-page.action.js +0 -9
  138. package/esm2015/lib/modules/list/state/paging/set-items-per-page.action.js.map +0 -1
  139. package/esm2015/lib/modules/list/state/paging/set-max-pages.action.js +0 -9
  140. package/esm2015/lib/modules/list/state/paging/set-max-pages.action.js.map +0 -1
  141. package/esm2015/lib/modules/list/state/paging/set-page-number.action.js +0 -9
  142. package/esm2015/lib/modules/list/state/paging/set-page-number.action.js.map +0 -1
  143. package/esm2015/lib/modules/list/state/search/search.model.js +0 -32
  144. package/esm2015/lib/modules/list/state/search/search.model.js.map +0 -1
  145. package/esm2015/lib/modules/list/state/search/search.orchestrator.js +0 -47
  146. package/esm2015/lib/modules/list/state/search/search.orchestrator.js.map +0 -1
  147. package/esm2015/lib/modules/list/state/search/set-field-selectors.action.js +0 -9
  148. package/esm2015/lib/modules/list/state/search/set-field-selectors.action.js.map +0 -1
  149. package/esm2015/lib/modules/list/state/search/set-functions.action.js +0 -9
  150. package/esm2015/lib/modules/list/state/search/set-functions.action.js.map +0 -1
  151. package/esm2015/lib/modules/list/state/search/set-options.action.js +0 -11
  152. package/esm2015/lib/modules/list/state/search/set-options.action.js.map +0 -1
  153. package/esm2015/lib/modules/list/state/search/set-search-text.action.js +0 -9
  154. package/esm2015/lib/modules/list/state/search/set-search-text.action.js.map +0 -1
  155. package/esm2015/lib/modules/list/state/selected/load.action.js +0 -9
  156. package/esm2015/lib/modules/list/state/selected/load.action.js.map +0 -1
  157. package/esm2015/lib/modules/list/state/selected/selected.model.js +0 -9
  158. package/esm2015/lib/modules/list/state/selected/selected.model.js.map +0 -1
  159. package/esm2015/lib/modules/list/state/selected/selected.orchestrator.js +0 -56
  160. package/esm2015/lib/modules/list/state/selected/selected.orchestrator.js.map +0 -1
  161. package/esm2015/lib/modules/list/state/selected/set-item-selected.action.js +0 -10
  162. package/esm2015/lib/modules/list/state/selected/set-item-selected.action.js.map +0 -1
  163. package/esm2015/lib/modules/list/state/selected/set-items-selected.action.js +0 -11
  164. package/esm2015/lib/modules/list/state/selected/set-items-selected.action.js.map +0 -1
  165. package/esm2015/lib/modules/list/state/selected/set-loading.action.js +0 -9
  166. package/esm2015/lib/modules/list/state/selected/set-loading.action.js.map +0 -1
  167. package/esm2015/lib/modules/list/state/sort/label.model.js +0 -25
  168. package/esm2015/lib/modules/list/state/sort/label.model.js.map +0 -1
  169. package/esm2015/lib/modules/list/state/sort/set-available.action.js +0 -9
  170. package/esm2015/lib/modules/list/state/sort/set-available.action.js.map +0 -1
  171. package/esm2015/lib/modules/list/state/sort/set-field-selectors.action.js +0 -9
  172. package/esm2015/lib/modules/list/state/sort/set-field-selectors.action.js.map +0 -1
  173. package/esm2015/lib/modules/list/state/sort/set-global.action.js +0 -9
  174. package/esm2015/lib/modules/list/state/sort/set-global.action.js.map +0 -1
  175. package/esm2015/lib/modules/list/state/sort/sort.model.js +0 -27
  176. package/esm2015/lib/modules/list/state/sort/sort.model.js.map +0 -1
  177. package/esm2015/lib/modules/list/state/sort/sort.orchestrator.js +0 -30
  178. package/esm2015/lib/modules/list/state/sort/sort.orchestrator.js.map +0 -1
  179. package/esm2015/lib/modules/list/state/toolbar/disable.action.js +0 -9
  180. package/esm2015/lib/modules/list/state/toolbar/disable.action.js.map +0 -1
  181. package/esm2015/lib/modules/list/state/toolbar/load.action.js +0 -10
  182. package/esm2015/lib/modules/list/state/toolbar/load.action.js.map +0 -1
  183. package/esm2015/lib/modules/list/state/toolbar/remove.action.js +0 -9
  184. package/esm2015/lib/modules/list/state/toolbar/remove.action.js.map +0 -1
  185. package/esm2015/lib/modules/list/state/toolbar/set-exists.action.js +0 -9
  186. package/esm2015/lib/modules/list/state/toolbar/set-exists.action.js.map +0 -1
  187. package/esm2015/lib/modules/list/state/toolbar/set-type.action.js +0 -9
  188. package/esm2015/lib/modules/list/state/toolbar/set-type.action.js.map +0 -1
  189. package/esm2015/lib/modules/list/state/toolbar/show-multiselect-toolbar.action.js +0 -9
  190. package/esm2015/lib/modules/list/state/toolbar/show-multiselect-toolbar.action.js.map +0 -1
  191. package/esm2015/lib/modules/list/state/toolbar/toolbar-item.model.js +0 -16
  192. package/esm2015/lib/modules/list/state/toolbar/toolbar-item.model.js.map +0 -1
  193. package/esm2015/lib/modules/list/state/toolbar/toolbar.model.js +0 -17
  194. package/esm2015/lib/modules/list/state/toolbar/toolbar.model.js.map +0 -1
  195. package/esm2015/lib/modules/list/state/toolbar/toolbar.orchestrator.js +0 -80
  196. package/esm2015/lib/modules/list/state/toolbar/toolbar.orchestrator.js.map +0 -1
  197. package/esm2015/lib/modules/list/state/views/load.action.js +0 -9
  198. package/esm2015/lib/modules/list/state/views/load.action.js.map +0 -1
  199. package/esm2015/lib/modules/list/state/views/set-active.action.js +0 -9
  200. package/esm2015/lib/modules/list/state/views/set-active.action.js.map +0 -1
  201. package/esm2015/lib/modules/list/state/views/view.model.js +0 -10
  202. package/esm2015/lib/modules/list/state/views/view.model.js.map +0 -1
  203. package/esm2015/lib/modules/list/state/views/views.model.js +0 -13
  204. package/esm2015/lib/modules/list/state/views/views.model.js.map +0 -1
  205. package/esm2015/lib/modules/list/state/views/views.orchestrator.js +0 -21
  206. package/esm2015/lib/modules/list/state/views/views.orchestrator.js.map +0 -1
  207. package/esm2015/lib/modules/list-data-provider-in-memory/list-data-in-memory.provider.js +0 -160
  208. package/esm2015/lib/modules/list-data-provider-in-memory/list-data-in-memory.provider.js.map +0 -1
  209. package/esm2015/lib/modules/list-filters/filter.model.js +0 -18
  210. package/esm2015/lib/modules/list-filters/filter.model.js.map +0 -1
  211. package/esm2015/lib/modules/list-filters/list-filter-button.component.js +0 -44
  212. package/esm2015/lib/modules/list-filters/list-filter-button.component.js.map +0 -1
  213. package/esm2015/lib/modules/list-filters/list-filter-inline-item-renderer.component.js +0 -34
  214. package/esm2015/lib/modules/list-filters/list-filter-inline-item-renderer.component.js.map +0 -1
  215. package/esm2015/lib/modules/list-filters/list-filter-inline-item.component.js +0 -45
  216. package/esm2015/lib/modules/list-filters/list-filter-inline-item.component.js.map +0 -1
  217. package/esm2015/lib/modules/list-filters/list-filter-inline.component.js +0 -74
  218. package/esm2015/lib/modules/list-filters/list-filter-inline.component.js.map +0 -1
  219. package/esm2015/lib/modules/list-filters/list-filter-inline.model.js +0 -21
  220. package/esm2015/lib/modules/list-filters/list-filter-inline.model.js.map +0 -1
  221. package/esm2015/lib/modules/list-filters/list-filter-summary.component.js +0 -60
  222. package/esm2015/lib/modules/list-filters/list-filter-summary.component.js.map +0 -1
  223. package/esm2015/lib/modules/list-filters/list-filters.module.js +0 -41
  224. package/esm2015/lib/modules/list-filters/list-filters.module.js.map +0 -1
  225. package/esm2015/lib/modules/list-paging/list-paging.component.js +0 -89
  226. package/esm2015/lib/modules/list-paging/list-paging.component.js.map +0 -1
  227. package/esm2015/lib/modules/list-paging/list-paging.module.js +0 -19
  228. package/esm2015/lib/modules/list-paging/list-paging.module.js.map +0 -1
  229. package/esm2015/lib/modules/list-toolbar/list-multiselect-toolbar.component.js +0 -152
  230. package/esm2015/lib/modules/list-toolbar/list-multiselect-toolbar.component.js.map +0 -1
  231. package/esm2015/lib/modules/list-toolbar/list-secondary-actions/list-secondary-action.component.js +0 -33
  232. package/esm2015/lib/modules/list-toolbar/list-secondary-actions/list-secondary-action.component.js.map +0 -1
  233. package/esm2015/lib/modules/list-toolbar/list-secondary-actions/list-secondary-action.js +0 -2
  234. package/esm2015/lib/modules/list-toolbar/list-secondary-actions/list-secondary-action.js.map +0 -1
  235. package/esm2015/lib/modules/list-toolbar/list-secondary-actions/list-secondary-actions-host.component.js +0 -50
  236. package/esm2015/lib/modules/list-toolbar/list-secondary-actions/list-secondary-actions-host.component.js.map +0 -1
  237. package/esm2015/lib/modules/list-toolbar/list-secondary-actions/list-secondary-actions.component.js +0 -45
  238. package/esm2015/lib/modules/list-toolbar/list-secondary-actions/list-secondary-actions.component.js.map +0 -1
  239. package/esm2015/lib/modules/list-toolbar/list-secondary-actions/list-secondary-actions.module.js +0 -46
  240. package/esm2015/lib/modules/list-toolbar/list-secondary-actions/list-secondary-actions.module.js.map +0 -1
  241. package/esm2015/lib/modules/list-toolbar/list-secondary-actions/list-secondary-actions.service.js +0 -36
  242. package/esm2015/lib/modules/list-toolbar/list-secondary-actions/list-secondary-actions.service.js.map +0 -1
  243. package/esm2015/lib/modules/list-toolbar/list-toolbar-item-renderer.component.js +0 -30
  244. package/esm2015/lib/modules/list-toolbar/list-toolbar-item-renderer.component.js.map +0 -1
  245. package/esm2015/lib/modules/list-toolbar/list-toolbar-item.component.js +0 -47
  246. package/esm2015/lib/modules/list-toolbar/list-toolbar-item.component.js.map +0 -1
  247. package/esm2015/lib/modules/list-toolbar/list-toolbar-search-actions.component.js +0 -19
  248. package/esm2015/lib/modules/list-toolbar/list-toolbar-search-actions.component.js.map +0 -1
  249. package/esm2015/lib/modules/list-toolbar/list-toolbar-sort.component.js +0 -25
  250. package/esm2015/lib/modules/list-toolbar/list-toolbar-sort.component.js.map +0 -1
  251. package/esm2015/lib/modules/list-toolbar/list-toolbar-view-actions.component.js +0 -21
  252. package/esm2015/lib/modules/list-toolbar/list-toolbar-view-actions.component.js.map +0 -1
  253. package/esm2015/lib/modules/list-toolbar/list-toolbar.component.js +0 -360
  254. package/esm2015/lib/modules/list-toolbar/list-toolbar.component.js.map +0 -1
  255. package/esm2015/lib/modules/list-toolbar/list-toolbar.module.js +0 -87
  256. package/esm2015/lib/modules/list-toolbar/list-toolbar.module.js.map +0 -1
  257. package/esm2015/lib/modules/list-toolbar/state/config/config.model.js +0 -14
  258. package/esm2015/lib/modules/list-toolbar/state/config/config.model.js.map +0 -1
  259. package/esm2015/lib/modules/list-toolbar/state/config/config.orchestrator.js +0 -21
  260. package/esm2015/lib/modules/list-toolbar/state/config/config.orchestrator.js.map +0 -1
  261. package/esm2015/lib/modules/list-toolbar/state/config/set-search-enabled.action.js +0 -9
  262. package/esm2015/lib/modules/list-toolbar/state/config/set-search-enabled.action.js.map +0 -1
  263. package/esm2015/lib/modules/list-toolbar/state/config/set-sort-selector-enabled.action.js +0 -10
  264. package/esm2015/lib/modules/list-toolbar/state/config/set-sort-selector-enabled.action.js.map +0 -1
  265. package/esm2015/lib/modules/list-toolbar/state/toolbar-state-action.type.js +0 -2
  266. package/esm2015/lib/modules/list-toolbar/state/toolbar-state-action.type.js.map +0 -1
  267. package/esm2015/lib/modules/list-toolbar/state/toolbar-state.model.js +0 -10
  268. package/esm2015/lib/modules/list-toolbar/state/toolbar-state.model.js.map +0 -1
  269. package/esm2015/lib/modules/list-toolbar/state/toolbar-state.rxstate.js +0 -19
  270. package/esm2015/lib/modules/list-toolbar/state/toolbar-state.rxstate.js.map +0 -1
  271. package/esm2015/lib/modules/list-toolbar/state/toolbar-state.state-node.js +0 -23
  272. package/esm2015/lib/modules/list-toolbar/state/toolbar-state.state-node.js.map +0 -1
  273. package/esm2015/lib/modules/shared/sky-list-builder-resources.module.js +0 -53
  274. package/esm2015/lib/modules/shared/sky-list-builder-resources.module.js.map +0 -1
  275. package/esm2015/skyux-list-builder.js +0 -5
  276. package/esm2015/skyux-list-builder.js.map +0 -1
  277. package/fesm2015/skyux-list-builder.js.map +0 -1
@@ -0,0 +1,2667 @@
1
+ import * as i4 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ContentChildren, NgModule, TemplateRef, ViewChild, ViewContainerRef, forwardRef } from '@angular/core';
5
+ import { ListItemModel, getData, compare, StateOrchestrator, StateDispatcher, AsyncList, AsyncItem, StateNode, getValue, isObservable } from '@skyux/list-builder-common';
6
+ import { BehaviorSubject, Observable, Subject, of, combineLatest } from 'rxjs';
7
+ import { map, distinctUntilChanged, take, takeUntil, skip, flatMap, scan } from 'rxjs/operators';
8
+ import * as i3 from '@skyux/lists';
9
+ import { SkyFilterModule, SkyPagingModule, SkySortModule } from '@skyux/lists';
10
+ import * as i5 from '@skyux/i18n';
11
+ import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
12
+ import * as i3$1 from '@skyux/indicators';
13
+ import { SkyIconModule } from '@skyux/indicators';
14
+ import * as i2 from '@skyux/popovers';
15
+ import { SkyDropdownModule } from '@skyux/popovers';
16
+ import * as i5$1 from '@skyux/forms';
17
+ import { SkyCheckboxModule } from '@skyux/forms';
18
+ import * as i3$2 from '@skyux/layout';
19
+ import { SkyToolbarModule } from '@skyux/layout';
20
+ import * as i8 from '@skyux/lookup';
21
+ import { SkySearchComponent, SkySearchModule } from '@skyux/lookup';
22
+
23
+ class ListDataRequestModel {
24
+ constructor(data) {
25
+ /**
26
+ * Indicates whether to disable the search bar and filter button.
27
+ * @default false
28
+ */
29
+ this.isToolbarDisabled = false;
30
+ if (data !== undefined) {
31
+ this.filters = data.filters;
32
+ this.pageSize = data.pageSize;
33
+ this.pageNumber = data.pageNumber;
34
+ this.search = data.search;
35
+ this.sort = data.sort;
36
+ this.isToolbarDisabled = data.isToolbarDisabled;
37
+ }
38
+ }
39
+ }
40
+
41
+ class ListDataResponseModel {
42
+ constructor(data) {
43
+ if (data !== undefined) {
44
+ this.count = data.count;
45
+ this.items = data.items;
46
+ }
47
+ }
48
+ }
49
+
50
+ /**
51
+ * @internal
52
+ */
53
+ class ListDataProvider {
54
+ constructor(data) {
55
+ this.data = data;
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Specifies a function to dynamically manage the data source when users change the text
61
+ * in the list field. The search function must return an array or a promise of an array.
62
+ * The `search` property is particularly useful when the data source does not live
63
+ * in the source code.
64
+ */
65
+ class ListSearchModel {
66
+ constructor(data) {
67
+ /**
68
+ * Specifies the text to search.
69
+ * @default ""
70
+ */
71
+ this.searchText = '';
72
+ /**
73
+ * Specifies an array of functions that returns a `boolean` value of `true` when
74
+ * the search is successful. This property accepts a function of type
75
+ * `(data: any, searchText: string) => boolean>.`
76
+ */
77
+ this.functions = [];
78
+ /**
79
+ * Specifies the columns to search. The columns correspond to `field` values that
80
+ * you specify with the list component's `data` property.
81
+ */
82
+ this.fieldSelectors = [];
83
+ if (data) {
84
+ this.searchText = data.searchText;
85
+ this.functions = [...data.functions];
86
+ this.fieldSelectors = data.fieldSelectors;
87
+ }
88
+ }
89
+ }
90
+
91
+ let idIndex$3 = 0;
92
+ class SkyListInMemoryDataProvider extends ListDataProvider {
93
+ constructor(data, searchFunction) {
94
+ super(data);
95
+ this.items = new BehaviorSubject([]);
96
+ this.searchFunction = searchFunction;
97
+ if (data) {
98
+ data.subscribe((items) => {
99
+ this.items.next(items.map((d) => new ListItemModel(d.id || `sky-list-data-in-memory-provider-item-${++idIndex$3}`, d)));
100
+ });
101
+ }
102
+ }
103
+ count() {
104
+ return this.items.pipe(map((items) => items.length));
105
+ }
106
+ get(request) {
107
+ return this.filteredItems(request).pipe(map((result) => {
108
+ if (request.pageNumber && request.pageSize) {
109
+ const itemStart = (request.pageNumber - 1) * request.pageSize;
110
+ const pagedResult = result.slice(itemStart, itemStart + request.pageSize);
111
+ return new ListDataResponseModel({
112
+ count: result.length,
113
+ items: pagedResult,
114
+ });
115
+ }
116
+ else {
117
+ return new ListDataResponseModel({
118
+ count: result.length,
119
+ items: result,
120
+ });
121
+ }
122
+ }));
123
+ }
124
+ filteredItems(request) {
125
+ const showSelectedId = ['show-selected'];
126
+ return this.items.pipe(map((items) => {
127
+ let dataChanged = false;
128
+ let search = request.search;
129
+ const sort = request.sort;
130
+ let filters = request.filters;
131
+ if (this.lastItems === undefined || this.lastItems !== items) {
132
+ dataChanged = true;
133
+ this.lastItems = items;
134
+ }
135
+ let searchChanged = false;
136
+ let filtersChanged = false;
137
+ if (request.isToolbarDisabled) {
138
+ searchChanged = true;
139
+ search = new ListSearchModel();
140
+ filters = filters.filter((f) => showSelectedId.indexOf(f.name) >= 0);
141
+ filtersChanged = true;
142
+ }
143
+ else {
144
+ if (this.lastSearch === undefined || this.lastSearch !== search) {
145
+ searchChanged = true;
146
+ }
147
+ if (this.lastFilters === undefined || this.lastFilters !== filters) {
148
+ filtersChanged = true;
149
+ }
150
+ }
151
+ this.lastSearch = search;
152
+ this.lastFilters = filters;
153
+ let result = items;
154
+ // Apply filters.
155
+ if (!dataChanged &&
156
+ !filtersChanged &&
157
+ this.lastFilterResults !== undefined) {
158
+ result = this.lastFilterResults;
159
+ }
160
+ else if (filters && filters.length > 0) {
161
+ result = result.filter((item) => {
162
+ for (let i = 0; i < filters.length; i++) {
163
+ const filter = filters[i];
164
+ if (filter.value === undefined ||
165
+ filter.value === '' ||
166
+ filter.value === false ||
167
+ filter.value === filter.defaultValue) {
168
+ continue;
169
+ }
170
+ if (!filter.filterFunction(item, filter.value)) {
171
+ return false;
172
+ }
173
+ }
174
+ return true;
175
+ });
176
+ this.lastFilterResults = result;
177
+ }
178
+ else {
179
+ this.lastFilterResults = undefined;
180
+ }
181
+ // Apply search.
182
+ /* istanbul ignore next */
183
+ if (!dataChanged &&
184
+ !searchChanged &&
185
+ this.lastSearchResults !== undefined &&
186
+ !filtersChanged) {
187
+ result = this.lastSearchResults;
188
+ }
189
+ else if (search &&
190
+ search.searchText !== undefined &&
191
+ search.searchText.length > 0) {
192
+ const searchText = search.searchText.toLowerCase();
193
+ let searchFunctions;
194
+ if (this.searchFunction !== undefined) {
195
+ searchFunctions = [this.searchFunction];
196
+ }
197
+ else {
198
+ searchFunctions = search.functions;
199
+ }
200
+ result = result.filter((item) => {
201
+ let isMatch = false;
202
+ for (let i = 0; i < searchFunctions.length; i++) {
203
+ const searchFunction = searchFunctions[i];
204
+ const searchResult = searchFunction(item.data, searchText);
205
+ if ((typeof searchResult === 'string' &&
206
+ searchResult.indexOf(searchText) !== -1) ||
207
+ searchResult === true) {
208
+ isMatch = true;
209
+ break;
210
+ }
211
+ }
212
+ return isMatch;
213
+ });
214
+ this.lastSearchResults = result;
215
+ }
216
+ else {
217
+ this.lastSearchResults = undefined;
218
+ }
219
+ // Apply sort.
220
+ if (sort && sort.fieldSelectors.length > 0) {
221
+ result = result
222
+ .slice()
223
+ .sort((item1, item2) => {
224
+ let compareResult = 0;
225
+ for (let i = 0; i < sort.fieldSelectors.length; i++) {
226
+ const selector = sort.fieldSelectors[i];
227
+ const value1 = getData(item1.data, selector.fieldSelector);
228
+ const value2 = getData(item2.data, selector.fieldSelector);
229
+ compareResult = compare(value1, value2);
230
+ if (selector.descending && compareResult !== 0) {
231
+ compareResult *= -1;
232
+ }
233
+ if (compareResult !== 0) {
234
+ break;
235
+ }
236
+ }
237
+ return compareResult;
238
+ });
239
+ }
240
+ return result;
241
+ }));
242
+ }
243
+ }
244
+
245
+ let idIndex$2 = 0;
246
+ /**
247
+ * @internal
248
+ */
249
+ class ListViewComponent {
250
+ constructor(state, defaultName) {
251
+ this.viewId = `sky-list-view-cmp-${++idIndex$2}`;
252
+ this.state = state;
253
+ this.viewName = defaultName;
254
+ /* istanbul ignore next */
255
+ this.hasToolbar = this.state.pipe(map((s) => s.toolbar.exists));
256
+ this.active = this.state.pipe(map((s) => s.views.active === this.viewId));
257
+ this.active
258
+ .pipe(distinctUntilChanged())
259
+ .subscribe((isActive) => isActive ? this.onViewActive() : this.onViewInactive());
260
+ }
261
+ get id() {
262
+ return this.viewId;
263
+ }
264
+ get label() {
265
+ return this.viewName;
266
+ }
267
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
268
+ onViewActive() { }
269
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
270
+ onViewInactive() { }
271
+ }
272
+
273
+ /**
274
+ * @internal
275
+ */
276
+ class ListItemsLoadAction {
277
+ constructor(items, refresh = false, dataChanged = true, count) {
278
+ this.items = items;
279
+ this.refresh = refresh;
280
+ this.dataChanged = dataChanged;
281
+ this.count = count;
282
+ }
283
+ }
284
+
285
+ /**
286
+ * @internal
287
+ */
288
+ class ListItemsSetLoadingAction {
289
+ constructor(loading = true) {
290
+ this.loading = loading;
291
+ }
292
+ }
293
+
294
+ /**
295
+ * @internal
296
+ */
297
+ class ListFiltersUpdateAction {
298
+ constructor(filters) {
299
+ this.filters = filters;
300
+ }
301
+ }
302
+
303
+ /**
304
+ * @internal
305
+ */
306
+ class ListSearchSetFieldSelectorsAction {
307
+ constructor(fieldSelectors = []) {
308
+ this.fieldSelectors = fieldSelectors;
309
+ }
310
+ }
311
+
312
+ /**
313
+ * @internal
314
+ */
315
+ class ListSearchSetFunctionsAction {
316
+ constructor(functions = []) {
317
+ this.functions = functions;
318
+ }
319
+ }
320
+
321
+ /**
322
+ * @internal
323
+ */
324
+ class ListSearchSetOptionsAction {
325
+ constructor(searchTextAction, setFieldSelectorsAction, setFunctionsAction) {
326
+ this.searchTextAction = searchTextAction;
327
+ this.setFieldSelectorsAction = setFieldSelectorsAction;
328
+ this.setFunctionsAction = setFunctionsAction;
329
+ }
330
+ }
331
+
332
+ /**
333
+ * @internal
334
+ */
335
+ class ListSearchSetSearchTextAction {
336
+ constructor(searchText) {
337
+ this.searchText = searchText;
338
+ }
339
+ }
340
+
341
+ /**
342
+ * @internal
343
+ */
344
+ class ListSelectedSetItemsSelectedAction {
345
+ constructor(items, selected = false, refresh = true) {
346
+ this.items = items;
347
+ this.selected = selected;
348
+ this.refresh = refresh;
349
+ }
350
+ }
351
+
352
+ /**
353
+ * @internal
354
+ */
355
+ class ListSortSetAvailableAction {
356
+ constructor(available) {
357
+ this.available = available;
358
+ }
359
+ }
360
+
361
+ /**
362
+ * @internal
363
+ */
364
+ class ListSortSetFieldSelectorsAction {
365
+ constructor(fieldSelectors) {
366
+ this.fieldSelectors = fieldSelectors;
367
+ }
368
+ }
369
+
370
+ /**
371
+ * @internal
372
+ */
373
+ class ListSortSetGlobalAction {
374
+ constructor(global) {
375
+ this.global = global;
376
+ }
377
+ }
378
+
379
+ /**
380
+ * @internal
381
+ */
382
+ class ListToolbarItemsDisableAction {
383
+ constructor(disable) {
384
+ this.disable = disable;
385
+ }
386
+ }
387
+
388
+ /**
389
+ * @internal
390
+ */
391
+ class ListToolbarItemsLoadAction {
392
+ constructor(items, index = -1) {
393
+ this.items = items;
394
+ this.index = index;
395
+ }
396
+ }
397
+
398
+ /**
399
+ * @internal
400
+ */
401
+ class ListToolbarItemsRemoveAction {
402
+ constructor(ids) {
403
+ this.ids = ids;
404
+ }
405
+ }
406
+
407
+ /**
408
+ * @internal
409
+ */
410
+ class ListToolbarSetExistsAction {
411
+ constructor(exists) {
412
+ this.exists = exists;
413
+ }
414
+ }
415
+
416
+ /**
417
+ * @internal
418
+ */
419
+ class ListToolbarShowMultiselectToolbarAction {
420
+ constructor(exists) {
421
+ this.exists = exists;
422
+ }
423
+ }
424
+
425
+ /**
426
+ * @internal
427
+ */
428
+ class ListViewsSetActiveAction {
429
+ constructor(view) {
430
+ this.view = view;
431
+ }
432
+ }
433
+
434
+ /**
435
+ * @internal
436
+ */
437
+ class ListStateOrchestrator extends StateOrchestrator {
438
+ }
439
+ /**
440
+ * @internal
441
+ */
442
+ class ListStateDispatcher extends StateDispatcher {
443
+ viewsSetActive(id) {
444
+ this.next(new ListViewsSetActiveAction(id));
445
+ }
446
+ toolbarExists(exists) {
447
+ this.next(new ListToolbarSetExistsAction(exists));
448
+ }
449
+ toolbarSetDisabled(disabled) {
450
+ this.next(new ListToolbarItemsDisableAction(disabled));
451
+ }
452
+ toolbarAddItems(items, index = -1) {
453
+ this.next(new ListToolbarItemsLoadAction(items, index));
454
+ }
455
+ toolbarRemoveItems(ids) {
456
+ this.next(new ListToolbarItemsRemoveAction(ids));
457
+ }
458
+ toolbarShowMultiselectToolbar(show) {
459
+ this.next(new ListToolbarShowMultiselectToolbarAction(show));
460
+ }
461
+ searchSetFunctions(sortFunctions) {
462
+ this.next(new ListSearchSetFunctionsAction(sortFunctions));
463
+ }
464
+ /* istanbul ignore next */
465
+ searchSetFieldSelectors(fieldSelectors) {
466
+ this.next(new ListSearchSetFieldSelectorsAction(fieldSelectors));
467
+ }
468
+ searchSetText(searchText) {
469
+ this.next(new ListSearchSetSearchTextAction(searchText));
470
+ }
471
+ searchSetOptions(searchOptions) {
472
+ this.next(new ListSearchSetOptionsAction(new ListSearchSetSearchTextAction(searchOptions.searchText), new ListSearchSetFieldSelectorsAction(searchOptions.fieldSelectors), new ListSearchSetFunctionsAction(searchOptions.functions)));
473
+ }
474
+ sortSetAvailable(sortLabels) {
475
+ this.next(new ListSortSetAvailableAction(sortLabels));
476
+ }
477
+ sortSetFieldSelectors(fieldSelectors) {
478
+ this.next(new ListSortSetFieldSelectorsAction(fieldSelectors));
479
+ }
480
+ sortSetGlobal(sortLabels) {
481
+ this.next(new ListSortSetGlobalAction(sortLabels));
482
+ }
483
+ filtersUpdate(filters) {
484
+ this.next(new ListFiltersUpdateAction(filters));
485
+ }
486
+ setSelected(selectedIds, selected, refresh = false) {
487
+ this.next(new ListSelectedSetItemsSelectedAction(selectedIds, selected, refresh));
488
+ }
489
+ }
490
+ ListStateDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListStateDispatcher, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
491
+ ListStateDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListStateDispatcher });
492
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListStateDispatcher, decorators: [{
493
+ type: Injectable
494
+ }] });
495
+
496
+ /**
497
+ * @internal
498
+ */
499
+ class ListFiltersOrchestrator extends ListStateOrchestrator {
500
+ /* istanbul ignore next */
501
+ constructor() {
502
+ super();
503
+ this.register(ListFiltersUpdateAction, this.update);
504
+ }
505
+ update(state, action) {
506
+ return [...action.filters];
507
+ }
508
+ }
509
+
510
+ /**
511
+ * @internal
512
+ */
513
+ class ListItemsSetSelectedAction {
514
+ constructor(items,
515
+ /* istanbul ignore next */
516
+ selected = false, refresh = true) {
517
+ this.items = items;
518
+ this.selected = selected;
519
+ this.refresh = refresh;
520
+ }
521
+ }
522
+
523
+ /**
524
+ * @internal
525
+ */
526
+ class ListItemsOrchestrator extends ListStateOrchestrator {
527
+ /* istanbul ignore next */
528
+ constructor() {
529
+ super();
530
+ this.register(ListItemsSetLoadingAction, this.setLoading)
531
+ .register(ListItemsLoadAction, this.load)
532
+ .register(ListItemsSetSelectedAction, this.setItemsSelected);
533
+ }
534
+ setLoading(state, action) {
535
+ return new AsyncList(state.items, state.lastUpdate, action.loading, state.count);
536
+ }
537
+ load(state, action) {
538
+ const newListItems = action.items.map((g) => new ListItemModel(g.id, g.data, g.isSelected));
539
+ const resultItems = action.refresh
540
+ ? [...newListItems]
541
+ : [...state.items, ...newListItems];
542
+ const count = action.count === undefined ? resultItems.length : action.count;
543
+ return new AsyncList(resultItems, action.dataChanged ? Date.now() : state.lastUpdate, false, count);
544
+ }
545
+ setItemsSelected(state, action) {
546
+ /* istanbul ignore next */
547
+ const newSelectedIds = action.items || [];
548
+ const newListItemModels = this.cloneListItemModelArray(state.items);
549
+ if (action.refresh) {
550
+ newListItemModels.forEach((item) => (item.isSelected = undefined));
551
+ }
552
+ newSelectedIds.map((s) => {
553
+ const newItem = newListItemModels.find((i) => i.id === s);
554
+ /* istanbul ignore next */
555
+ if (newItem) {
556
+ newItem.isSelected = action.selected;
557
+ }
558
+ });
559
+ return new AsyncList(newListItemModels, Date.now(), state.loading, state.count);
560
+ }
561
+ cloneListItemModelArray(source) {
562
+ const newListItems = [];
563
+ source.forEach((item) => {
564
+ newListItems.push(new ListItemModel(item.id, Object.assign({}, item.data), item.isSelected));
565
+ });
566
+ return newListItems;
567
+ }
568
+ }
569
+
570
+ /**
571
+ * @internal
572
+ */
573
+ class ListPagingModel {
574
+ constructor(data) {
575
+ if (data !== undefined) {
576
+ this.itemsPerPage = data.itemsPerPage || 10;
577
+ this.maxDisplayedPages = data.maxDisplayedPages || 5;
578
+ this.pageCount = data.pageCount || 0;
579
+ this.pageNumber = data.pageNumber || 1;
580
+ }
581
+ }
582
+ }
583
+
584
+ /**
585
+ * Contains data about the selected items in the list.
586
+ */
587
+ class ListSelectedModel {
588
+ constructor() {
589
+ this.selectedIdMap = new Map();
590
+ }
591
+ }
592
+
593
+ /**
594
+ * Specifies a set of fields to sort by.
595
+ */
596
+ class ListSortModel {
597
+ constructor(data) {
598
+ /**
599
+ * Specifies the list of available views to sort.
600
+ */
601
+ this.available = [];
602
+ /**
603
+ * Specifies whether the sort applies to all list views.
604
+ */
605
+ this.global = [];
606
+ /**
607
+ * Specifies the fields to sort.
608
+ * For information about `ListSortFieldSelectorModel`, see the
609
+ * [shared classes for lists](https://developer.blackbaud.com/skyux-list-builder-common/docs/list-builder-common).
610
+ */
611
+ this.fieldSelectors = [];
612
+ if (data) {
613
+ this.available = data.available;
614
+ this.global = data.global;
615
+ this.fieldSelectors = data.fieldSelectors;
616
+ }
617
+ }
618
+ }
619
+
620
+ /**
621
+ * @internal
622
+ */
623
+ class ListToolbarModel {
624
+ constructor(data) {
625
+ this.items = [];
626
+ this.showMultiselectToolbar = false;
627
+ if (data) {
628
+ this.exists = data.exists;
629
+ this.disabled = data.disabled;
630
+ this.items = data.items;
631
+ this.type = data.type;
632
+ this.showMultiselectToolbar = data.showMultiselectToolbar;
633
+ }
634
+ }
635
+ }
636
+
637
+ /**
638
+ * @internal
639
+ */
640
+ class ListViewsModel {
641
+ constructor(data) {
642
+ this.views = [];
643
+ if (data) {
644
+ this.active = data.active;
645
+ this.views = data.views;
646
+ }
647
+ }
648
+ }
649
+
650
+ /**
651
+ * @internal
652
+ */
653
+ class ListStateModel {
654
+ constructor() {
655
+ this.filters = [];
656
+ this.items = new AsyncList();
657
+ this.paging = new ListPagingModel();
658
+ this.search = new ListSearchModel();
659
+ this.selected = new AsyncItem();
660
+ this.sort = new ListSortModel();
661
+ this.toolbar = new ListToolbarModel();
662
+ this.views = new ListViewsModel();
663
+ this.selected.item = new ListSelectedModel();
664
+ }
665
+ }
666
+
667
+ /**
668
+ * @internal
669
+ */
670
+ class ListPagingSetItemsPerPageAction {
671
+ constructor(itemsPerPage) {
672
+ this.itemsPerPage = itemsPerPage;
673
+ }
674
+ }
675
+
676
+ /**
677
+ * @internal
678
+ */
679
+ class ListPagingSetMaxPagesAction {
680
+ constructor(maxPages) {
681
+ this.maxPages = maxPages;
682
+ }
683
+ }
684
+
685
+ /**
686
+ * @internal
687
+ */
688
+ class ListPagingSetPageNumberAction {
689
+ constructor(pageNumber) {
690
+ this.pageNumber = pageNumber;
691
+ }
692
+ }
693
+
694
+ /**
695
+ * @internal
696
+ */
697
+ class ListPagingOrchestrator extends ListStateOrchestrator {
698
+ /* istanbul ignore next */
699
+ constructor() {
700
+ super();
701
+ this.register(ListPagingSetMaxPagesAction, this.setMaxPages)
702
+ .register(ListPagingSetItemsPerPageAction, this.setItemsPerPage)
703
+ .register(ListPagingSetPageNumberAction, this.setPageNumber);
704
+ }
705
+ setMaxPages(state, action) {
706
+ return new ListPagingModel(Object.assign({}, state, { maxDisplayedPages: Number(action.maxPages) }));
707
+ }
708
+ setItemsPerPage(state, action) {
709
+ return new ListPagingModel(Object.assign({}, state, { itemsPerPage: Number(action.itemsPerPage) }));
710
+ }
711
+ setPageNumber(state, action) {
712
+ return new ListPagingModel(Object.assign({}, state, { pageNumber: Number(action.pageNumber) }));
713
+ }
714
+ }
715
+
716
+ /**
717
+ * @internal
718
+ */
719
+ class ListSearchOrchestrator extends ListStateOrchestrator {
720
+ /* istanbul ignore next */
721
+ constructor() {
722
+ super();
723
+ this.register(ListSearchSetSearchTextAction, this.setSearchText)
724
+ .register(ListSearchSetFunctionsAction, this.setFunctions)
725
+ .register(ListSearchSetFieldSelectorsAction, this.setFieldSelectors)
726
+ .register(ListSearchSetOptionsAction, this.setOptions);
727
+ }
728
+ setSearchText(state, action) {
729
+ return new ListSearchModel(Object.assign({}, state, {
730
+ searchText: action.searchText ? action.searchText : '',
731
+ }));
732
+ }
733
+ setFunctions(state, action) {
734
+ return new ListSearchModel(Object.assign({}, state, { functions: [...action.functions] }));
735
+ }
736
+ setFieldSelectors(state, action) {
737
+ return new ListSearchModel(Object.assign({}, state, { fieldSelectors: [...action.fieldSelectors] }));
738
+ }
739
+ setOptions(state, action) {
740
+ let result = state;
741
+ /* istanbul ignore else */
742
+ if (action.searchTextAction) {
743
+ result = this.setSearchText(result, action.searchTextAction);
744
+ }
745
+ /* istanbul ignore else */
746
+ if (action.setFieldSelectorsAction) {
747
+ result = this.setFieldSelectors(result, action.setFieldSelectorsAction);
748
+ }
749
+ /* istanbul ignore else */
750
+ if (action.setFunctionsAction) {
751
+ result = this.setFunctions(result, action.setFunctionsAction);
752
+ }
753
+ return result;
754
+ }
755
+ }
756
+
757
+ /**
758
+ * @internal
759
+ */
760
+ class ListSelectedLoadAction {
761
+ constructor(items) {
762
+ this.items = items;
763
+ }
764
+ }
765
+
766
+ /**
767
+ * @internal
768
+ */
769
+ class ListSelectedSetItemSelectedAction {
770
+ constructor(id, selected) {
771
+ this.id = id;
772
+ this.selected = selected;
773
+ }
774
+ }
775
+
776
+ /**
777
+ * @internal
778
+ */
779
+ class ListSelectedSetLoadingAction {
780
+ constructor(loading = true) {
781
+ this.loading = loading;
782
+ }
783
+ }
784
+
785
+ /**
786
+ * @internal
787
+ */
788
+ class ListSelectedOrchestrator extends ListStateOrchestrator {
789
+ /* istanbul ignore next */
790
+ constructor() {
791
+ super();
792
+ this.register(ListSelectedSetLoadingAction, this.setLoading)
793
+ .register(ListSelectedSetItemSelectedAction, this.setItemSelected)
794
+ .register(ListSelectedSetItemsSelectedAction, this.setItemsSelected)
795
+ .register(ListSelectedLoadAction, this.load);
796
+ }
797
+ setLoading(state, action) {
798
+ return new AsyncItem(state.item, state.lastUpdate, action.loading);
799
+ }
800
+ load(state, action) {
801
+ const newSelected = new ListSelectedModel();
802
+ action.items.map((s) => newSelected.selectedIdMap.set(s, true));
803
+ return new AsyncItem(Object.assign({}, state.item, newSelected), Date.now(), false);
804
+ }
805
+ setItemSelected(state, action) {
806
+ const newSelected = this.cloneListSelectedModel(state.item);
807
+ newSelected.selectedIdMap.set(action.id, action.selected);
808
+ return new AsyncItem(newSelected, state.lastUpdate, state.loading);
809
+ }
810
+ setItemsSelected(state, action) {
811
+ const newSelectedIds = action.items || [];
812
+ const newListSelectedModel = action.refresh
813
+ ? new ListSelectedModel()
814
+ : this.cloneListSelectedModel(state.item);
815
+ if (newSelectedIds instanceof Observable) {
816
+ newSelectedIds.pipe(take(1)).subscribe((selectedIds) => {
817
+ selectedIds.map((s) => newListSelectedModel.selectedIdMap.set(s, action.selected));
818
+ });
819
+ }
820
+ else {
821
+ newSelectedIds.map((s) => newListSelectedModel.selectedIdMap.set(s, action.selected));
822
+ }
823
+ return new AsyncItem(newListSelectedModel, state.lastUpdate, state.loading);
824
+ }
825
+ cloneListSelectedModel(source) {
826
+ const newListItems = new ListSelectedModel();
827
+ newListItems.selectedIdMap = new Map(source.selectedIdMap);
828
+ return newListItems;
829
+ }
830
+ }
831
+
832
+ /**
833
+ * These properties are a work in progress, and we do not recommend using them.
834
+ */
835
+ class ListSortLabelModel {
836
+ constructor(data) {
837
+ /**
838
+ * Indicates whether to sort all fields.
839
+ * @default false
840
+ */
841
+ this.global = false;
842
+ /**
843
+ * Indicates whether to sort in descending order.
844
+ * @default false
845
+ */
846
+ this.descending = false;
847
+ if (data) {
848
+ this.text = data.text;
849
+ this.fieldType = data.fieldType;
850
+ this.fieldSelector = data.fieldSelector;
851
+ this.global = data.global;
852
+ this.descending = data.descending;
853
+ }
854
+ }
855
+ }
856
+
857
+ /**
858
+ * @internal
859
+ */
860
+ class ListSortOrchestrator extends ListStateOrchestrator {
861
+ /* istanbul ignore next */
862
+ constructor() {
863
+ super();
864
+ this.register(ListSortSetFieldSelectorsAction, this.setFieldSelectors)
865
+ .register(ListSortSetAvailableAction, this.setAvailable)
866
+ .register(ListSortSetGlobalAction, this.setGlobal);
867
+ }
868
+ setFieldSelectors(state, action) {
869
+ return new ListSortModel(Object.assign({}, state, { fieldSelectors: action.fieldSelectors }));
870
+ }
871
+ setAvailable(state, action) {
872
+ const newAvailable = action.available.map((available) => new ListSortLabelModel(available));
873
+ return new ListSortModel(Object.assign({}, state, { available: newAvailable }));
874
+ }
875
+ setGlobal(state, action) {
876
+ const newGlobal = action.global.map((global) => new ListSortLabelModel(global));
877
+ return new ListSortModel(Object.assign({}, state, { global: newGlobal }));
878
+ }
879
+ }
880
+
881
+ /**
882
+ * @internal
883
+ */
884
+ class ListToolbarSetTypeAction {
885
+ constructor(type) {
886
+ this.type = type;
887
+ }
888
+ }
889
+
890
+ /**
891
+ * @internal
892
+ */
893
+ class ListToolbarItemModel {
894
+ constructor(data) {
895
+ this.index = -1;
896
+ if (data) {
897
+ this.index = data.index;
898
+ this.template = data.template;
899
+ this.location = data.location;
900
+ this.view = data.view;
901
+ this.id = data.id;
902
+ }
903
+ }
904
+ }
905
+
906
+ /**
907
+ * @internal
908
+ */
909
+ class ListToolbarOrchestrator extends ListStateOrchestrator {
910
+ /* istanbul ignore next */
911
+ constructor() {
912
+ super();
913
+ this.register(ListToolbarSetExistsAction, this.setExists)
914
+ .register(ListToolbarItemsDisableAction, this.setDisabled)
915
+ .register(ListToolbarItemsLoadAction, this.load)
916
+ .register(ListToolbarSetTypeAction, this.setType)
917
+ .register(ListToolbarItemsRemoveAction, this.remove)
918
+ .register(ListToolbarShowMultiselectToolbarAction, this.showMultiselectToolbar);
919
+ }
920
+ setExists(state, action) {
921
+ const newModel = new ListToolbarModel(state);
922
+ newModel.exists = action.exists;
923
+ return newModel;
924
+ }
925
+ setDisabled(state, action) {
926
+ const newModel = new ListToolbarModel(state);
927
+ newModel.disabled = action.disable;
928
+ return newModel;
929
+ }
930
+ setType(state, action) {
931
+ const newModel = new ListToolbarModel(state);
932
+ newModel.type = action.type;
933
+ return newModel;
934
+ }
935
+ load(state, action) {
936
+ const newModel = new ListToolbarModel(state);
937
+ const newListItems = action.items.map((item) => {
938
+ /**
939
+ * NOTE: Originally this function went off the action index and item models did not include
940
+ * the index. We changed this but must leave functionality to convert the action index for
941
+ * backwards compatibility.
942
+ */
943
+ if (!item.index) {
944
+ item.index = action.index;
945
+ }
946
+ return new ListToolbarItemModel(item);
947
+ });
948
+ let items = [...state.items, ...newListItems];
949
+ items = items.sort((a, b) => {
950
+ if (a.index < b.index) {
951
+ return -1;
952
+ }
953
+ else if (a.index > b.index) {
954
+ return 1;
955
+ }
956
+ else {
957
+ return 0;
958
+ }
959
+ });
960
+ newModel.items = items;
961
+ return newModel;
962
+ }
963
+ remove(state, action) {
964
+ const newModel = new ListToolbarModel(state);
965
+ newModel.items = newModel.items.filter((item) => {
966
+ return action.ids.indexOf(item.id) === -1;
967
+ });
968
+ return newModel;
969
+ }
970
+ showMultiselectToolbar(state, action) {
971
+ const newModel = new ListToolbarModel(state);
972
+ newModel.showMultiselectToolbar = action.exists;
973
+ return newModel;
974
+ }
975
+ }
976
+
977
+ /**
978
+ * @internal
979
+ */
980
+ class ListViewsLoadAction {
981
+ constructor(views) {
982
+ this.views = views;
983
+ }
984
+ }
985
+
986
+ /**
987
+ * @internal
988
+ */
989
+ class ListViewsOrchestrator extends ListStateOrchestrator {
990
+ /* istanbul ignore next */
991
+ constructor() {
992
+ super();
993
+ this.register(ListViewsSetActiveAction, this.setActive).register(ListViewsLoadAction, this.load);
994
+ }
995
+ setActive(state, action) {
996
+ return new ListViewsModel(Object.assign({}, state, { active: action.view }));
997
+ }
998
+ load(state, action) {
999
+ return new ListViewsModel(Object.assign({}, state, { views: action.views }));
1000
+ }
1001
+ }
1002
+
1003
+ /**
1004
+ * @internal
1005
+ */
1006
+ class ListState extends StateNode {
1007
+ constructor(dispatcher) {
1008
+ super(new ListStateModel(), dispatcher);
1009
+ this.register('filters', ListFiltersOrchestrator)
1010
+ .register('items', ListItemsOrchestrator)
1011
+ .register('paging', ListPagingOrchestrator)
1012
+ .register('search', ListSearchOrchestrator)
1013
+ .register('sort', ListSortOrchestrator)
1014
+ .register('toolbar', ListToolbarOrchestrator)
1015
+ .register('views', ListViewsOrchestrator)
1016
+ .register('selected', ListSelectedOrchestrator)
1017
+ .begin();
1018
+ }
1019
+ }
1020
+ ListState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListState, deps: [{ token: ListStateDispatcher }], target: i0.ɵɵFactoryTarget.Injectable });
1021
+ ListState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListState });
1022
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListState, decorators: [{
1023
+ type: Injectable
1024
+ }], ctorParameters: function () { return [{ type: ListStateDispatcher }]; } });
1025
+
1026
+ /**
1027
+ * @internal
1028
+ */
1029
+ class ListViewModel {
1030
+ constructor(id, name) {
1031
+ this.id = id;
1032
+ this.name = name;
1033
+ }
1034
+ }
1035
+
1036
+ let idIndex$1 = 0;
1037
+ class SkyListComponent {
1038
+ constructor(state, dispatcher) {
1039
+ this.state = state;
1040
+ this.dispatcher = dispatcher;
1041
+ this.id = `sky-list-cmp-${++idIndex$1}`;
1042
+ /**
1043
+ * Specifies the data to display. The list component requires this property or the
1044
+ * `dataProvider` property. For checklist or multiselect grids, each row requires an
1045
+ * `id` property to manage selected items with the `selectedIds` input and the
1046
+ * `selectedIdsChange` event. If you do not provide an `id`, the list automatically
1047
+ * generates one. To update data in your view outside of a `dataProvider`, you must use
1048
+ * an observable instead of a static array.
1049
+ */
1050
+ this.data = [];
1051
+ /**
1052
+ * Specifies a set of filters to apply to list data.
1053
+ * These filters create a filter summary when the list includes the
1054
+ * [`sky-list-filter-summary`](https://developer.blackbaud.com/skyux/components/list/filters)
1055
+ * component.
1056
+ */
1057
+ this.appliedFilters = [];
1058
+ /**
1059
+ * For list views that support item selection, emits the selected entries.
1060
+ */
1061
+ this.selectedIdsChange = new EventEmitter();
1062
+ /**
1063
+ * Emits the filters applied to the list.
1064
+ */
1065
+ this.appliedFiltersChange = new EventEmitter();
1066
+ this.dataFirstLoad = false;
1067
+ this.lastSelectedIds = [];
1068
+ this.lastFilters = [];
1069
+ this.ngUnsubscribe = new Subject();
1070
+ }
1071
+ ngAfterContentInit() {
1072
+ if (this.data && this.dataProvider && this.initialTotal) {
1073
+ this.dataFirstLoad = true;
1074
+ }
1075
+ if (this.listViews.length > 0) {
1076
+ const defaultView = this.defaultView === undefined
1077
+ ? this.listViews.first
1078
+ : this.defaultView;
1079
+ this.dispatcher.next(new ListViewsLoadAction(this.listViews.map((v) => new ListViewModel(v.id, v.label))));
1080
+ // activate the default view
1081
+ this.dispatcher.next(new ListViewsSetActiveAction(defaultView.id));
1082
+ }
1083
+ else {
1084
+ return;
1085
+ }
1086
+ // set sort fields
1087
+ getValue(this.sortFields, (sortFields) => {
1088
+ let sortArray;
1089
+ if (!Array.isArray(sortFields) && sortFields) {
1090
+ sortArray = [sortFields];
1091
+ }
1092
+ else {
1093
+ sortArray = sortFields;
1094
+ }
1095
+ this.dispatcher.next(new ListSortSetFieldSelectorsAction(sortArray || []));
1096
+ });
1097
+ this.displayedItems.subscribe((result) => {
1098
+ this.dispatcher.next(new ListItemsSetLoadingAction());
1099
+ this.dispatcher.next(new ListItemsLoadAction(result.items, true, true, result.count));
1100
+ });
1101
+ // Watch for selection changes.
1102
+ this.state
1103
+ .pipe(map((current) => current.selected), takeUntil(this.ngUnsubscribe), distinctUntilChanged())
1104
+ .subscribe((selected) => {
1105
+ // Update lastSelectedIds to help us retain user selections.
1106
+ const selectedIdsList = [];
1107
+ selected.item.selectedIdMap.forEach((value, key) => {
1108
+ if (value === true) {
1109
+ selectedIdsList.push(key);
1110
+ }
1111
+ });
1112
+ // If changes are distinct, emit selectedIdsChange.
1113
+ const distinctChanges = !this.arraysEqual(this.lastSelectedIds, selectedIdsList);
1114
+ if (this.selectedIdsChange.observers.length > 0 && distinctChanges) {
1115
+ this.selectedIdsChange.emit(selected.item.selectedIdMap);
1116
+ }
1117
+ this.lastSelectedIds = selectedIdsList;
1118
+ });
1119
+ if (this.appliedFiltersChange.observers.length > 0) {
1120
+ this.state
1121
+ .pipe(map((current) => current.filters), takeUntil(this.ngUnsubscribe), skip(1))
1122
+ .subscribe((filters) => {
1123
+ /**
1124
+ * We are doing this instead of a distinctUntilChange due to memory allocation issues
1125
+ * with the javascript array. To fix fully the array should be changed to an object in
1126
+ * a breaking change.
1127
+ */
1128
+ if (!this.arraysEqual(filters, this.lastFilters)) {
1129
+ this.lastFilters = filters.slice(0);
1130
+ this.appliedFiltersChange.emit(filters);
1131
+ }
1132
+ });
1133
+ }
1134
+ }
1135
+ ngOnChanges(changes) {
1136
+ if (changes['appliedFilters'] &&
1137
+ changes['appliedFilters'].currentValue !==
1138
+ changes['appliedFilters'].previousValue) {
1139
+ this.state.pipe(take(1)).subscribe((currentState) => {
1140
+ if (currentState.paging.pageNumber &&
1141
+ currentState.paging.pageNumber !== 1) {
1142
+ this.dispatcher.next(new ListPagingSetPageNumberAction(Number(1)));
1143
+ }
1144
+ this.dispatcher.filtersUpdate(this.appliedFilters);
1145
+ });
1146
+ }
1147
+ if (changes['selectedIds']) {
1148
+ // Only send selection changes to dispatcher if changes are distinct.
1149
+ const newSelectedIds = changes['selectedIds'].currentValue;
1150
+ if (!this.arraysEqual(newSelectedIds, this.lastSelectedIds)) {
1151
+ this.dispatcher.setSelected(newSelectedIds, true, true);
1152
+ }
1153
+ }
1154
+ }
1155
+ ngOnDestroy() {
1156
+ this.ngUnsubscribe.next();
1157
+ this.ngUnsubscribe.complete();
1158
+ }
1159
+ refreshDisplayedItems() {
1160
+ this.displayedItems.pipe(take(1)).subscribe((result) => {
1161
+ this.dispatcher.next(new ListItemsSetLoadingAction());
1162
+ this.dispatcher.next(new ListItemsLoadAction(result.items, true, true, result.count));
1163
+ });
1164
+ }
1165
+ get displayedItems() {
1166
+ if (!this.data && !this.dataProvider) {
1167
+ throw new Error('List requires data or dataProvider to be set.');
1168
+ }
1169
+ let data = this.data;
1170
+ if (!isObservable(data)) {
1171
+ data = of(this.data);
1172
+ }
1173
+ if (!this.dataProvider) {
1174
+ this.dataProvider = new SkyListInMemoryDataProvider(data, this.searchFunction);
1175
+ }
1176
+ let selectedIds = this.selectedIds || of([]);
1177
+ if (!isObservable(selectedIds)) {
1178
+ selectedIds = of(selectedIds);
1179
+ }
1180
+ let selectedChanged = false;
1181
+ // This subject is used to cancel previous request to the list's data provider when a new change
1182
+ // to the list's state occurs. In a future breaking change this should be replaced or coupled
1183
+ // with adding a debounce time to the Observable which watches for state changes.
1184
+ const cancelLastRequest = new Subject();
1185
+ return combineLatest([
1186
+ this.state.pipe(map((s) => s.filters), distinctUntilChanged()),
1187
+ this.state.pipe(map((s) => s.search), distinctUntilChanged()),
1188
+ this.state.pipe(map((s) => s.sort.fieldSelectors), distinctUntilChanged()),
1189
+ this.state.pipe(map((s) => s.paging.itemsPerPage), distinctUntilChanged()),
1190
+ this.state.pipe(map((s) => s.paging.pageNumber), distinctUntilChanged()),
1191
+ this.state.pipe(map((s) => s.toolbar.disabled), distinctUntilChanged()),
1192
+ selectedIds.pipe(distinctUntilChanged(), map((selected) => {
1193
+ selectedChanged = true;
1194
+ return selected;
1195
+ })),
1196
+ data.pipe(distinctUntilChanged()),
1197
+ ], (filters, search, sortFieldSelectors, itemsPerPage, pageNumber, isToolbarDisabled, selected, itemsData) => {
1198
+ cancelLastRequest.next();
1199
+ cancelLastRequest.complete();
1200
+ if (selectedChanged) {
1201
+ this.dispatcher.next(new ListSelectedSetLoadingAction());
1202
+ this.dispatcher.next(new ListSelectedLoadAction(selected));
1203
+ this.dispatcher.next(new ListSelectedSetLoadingAction(false));
1204
+ selectedChanged = false;
1205
+ }
1206
+ let response;
1207
+ if (this.dataFirstLoad) {
1208
+ this.dataFirstLoad = false;
1209
+ const initialItems = itemsData.map((d) => new ListItemModel(d.id || `sky-list-item-model-${++idIndex$1}`, d));
1210
+ response = of(new ListDataResponseModel({
1211
+ count: this.initialTotal,
1212
+ items: initialItems,
1213
+ })).pipe(takeUntil(cancelLastRequest));
1214
+ }
1215
+ else {
1216
+ response = this.dataProvider
1217
+ .get(new ListDataRequestModel({
1218
+ filters: filters,
1219
+ pageSize: itemsPerPage,
1220
+ pageNumber: pageNumber,
1221
+ search: search,
1222
+ sort: new ListSortModel({ fieldSelectors: sortFieldSelectors }),
1223
+ isToolbarDisabled: isToolbarDisabled,
1224
+ }))
1225
+ .pipe(takeUntil(cancelLastRequest));
1226
+ }
1227
+ return response;
1228
+ }).pipe(takeUntil(this.ngUnsubscribe),
1229
+ // Retain user selections from previous state.
1230
+ // This is only necessary for grids component (based on item.isSelected).
1231
+ map((response) => {
1232
+ return response.pipe(map((listDataResponseModel) => {
1233
+ return new ListDataResponseModel({
1234
+ count: listDataResponseModel.count,
1235
+ items: this.getItemsAndRetainSelections(listDataResponseModel.items, this.lastSelectedIds),
1236
+ });
1237
+ }));
1238
+ }), flatMap((value) => value));
1239
+ }
1240
+ get selectedItems() {
1241
+ return combineLatest(this.state.pipe(map((current) => current.items.items), distinctUntilChanged()), this.state.pipe(map((current) => current.selected), distinctUntilChanged()), (items, selected) => {
1242
+ return items.filter((i) => selected.item.selectedIdMap.get(i.id));
1243
+ }).pipe(takeUntil(this.ngUnsubscribe));
1244
+ }
1245
+ get lastUpdate() {
1246
+ return this.state.pipe(takeUntil(this.ngUnsubscribe), map((s) => s.items.lastUpdate ? new Date(s.items.lastUpdate) : undefined));
1247
+ }
1248
+ get views() {
1249
+ return this.listViews.toArray();
1250
+ }
1251
+ get itemCount() {
1252
+ return this.dataProvider.count();
1253
+ }
1254
+ getItemsAndRetainSelections(newList, selectedIds) {
1255
+ const updatedListModel = newList.slice();
1256
+ updatedListModel.forEach((item) => {
1257
+ item.isSelected = selectedIds.indexOf(item.id) > -1 ? true : false;
1258
+ });
1259
+ return updatedListModel;
1260
+ }
1261
+ arraysEqual(arrayA, arrayB) {
1262
+ /* istanbul ignore next */
1263
+ if (arrayA === arrayB) {
1264
+ return true;
1265
+ }
1266
+ if (arrayA === undefined || arrayB === undefined) {
1267
+ return false;
1268
+ }
1269
+ if (arrayA.length !== arrayB.length) {
1270
+ return false;
1271
+ }
1272
+ for (let i = 0; i < arrayA.length; ++i) {
1273
+ if (arrayA[i] !== arrayB[i]) {
1274
+ return false;
1275
+ }
1276
+ }
1277
+ return true;
1278
+ }
1279
+ }
1280
+ SkyListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListComponent, deps: [{ token: ListState }, { token: ListStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
1281
+ SkyListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListComponent, selector: "sky-list", inputs: { data: "data", dataProvider: "dataProvider", defaultView: "defaultView", initialTotal: "initialTotal", selectedIds: "selectedIds", sortFields: "sortFields", appliedFilters: "appliedFilters", searchFunction: ["search", "searchFunction"] }, outputs: { selectedIdsChange: "selectedIdsChange", appliedFiltersChange: "appliedFiltersChange" }, providers: [ListState, ListStateDispatcher], queries: [{ propertyName: "listViews", predicate: ListViewComponent }], usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1282
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListComponent, decorators: [{
1283
+ type: Component,
1284
+ args: [{
1285
+ selector: 'sky-list',
1286
+ template: '<ng-content></ng-content>',
1287
+ providers: [ListState, ListStateDispatcher],
1288
+ changeDetection: ChangeDetectionStrategy.OnPush,
1289
+ }]
1290
+ }], ctorParameters: function () { return [{ type: ListState }, { type: ListStateDispatcher }]; }, propDecorators: { data: [{
1291
+ type: Input
1292
+ }], dataProvider: [{
1293
+ type: Input
1294
+ }], defaultView: [{
1295
+ type: Input
1296
+ }], initialTotal: [{
1297
+ type: Input
1298
+ }], selectedIds: [{
1299
+ type: Input
1300
+ }], sortFields: [{
1301
+ type: Input
1302
+ }], appliedFilters: [{
1303
+ type: Input
1304
+ }], selectedIdsChange: [{
1305
+ type: Output
1306
+ }], appliedFiltersChange: [{
1307
+ type: Output
1308
+ }], searchFunction: [{
1309
+ type: Input,
1310
+ args: ['search']
1311
+ }], listViews: [{
1312
+ type: ContentChildren,
1313
+ args: [ListViewComponent]
1314
+ }] } });
1315
+
1316
+ class SkyListModule {
1317
+ }
1318
+ SkyListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1319
+ SkyListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListModule, declarations: [SkyListComponent], imports: [CommonModule], exports: [SkyListComponent] });
1320
+ SkyListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListModule, imports: [[CommonModule]] });
1321
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListModule, decorators: [{
1322
+ type: NgModule,
1323
+ args: [{
1324
+ declarations: [SkyListComponent],
1325
+ imports: [CommonModule],
1326
+ exports: [SkyListComponent],
1327
+ }]
1328
+ }] });
1329
+
1330
+ class ListFilterModel {
1331
+ constructor(data) {
1332
+ /**
1333
+ * Indicates whether users can dismiss the filter's summary item.
1334
+ * @default true
1335
+ */
1336
+ this.dismissible = true;
1337
+ if (data) {
1338
+ this.name = data.name;
1339
+ this.label = data.label;
1340
+ this.filterFunction = data.filterFunction;
1341
+ this.value = data.value;
1342
+ this.dismissible = data.dismissible;
1343
+ this.defaultValue = data.defaultValue;
1344
+ }
1345
+ }
1346
+ }
1347
+
1348
+ /**
1349
+ * @internal
1350
+ */
1351
+ class SkyListFilterInlineModel {
1352
+ constructor(data) {
1353
+ this.onChange = new EventEmitter();
1354
+ if (data) {
1355
+ this.name = data.name;
1356
+ this.filterFunction = data.filterFunction;
1357
+ this.value = data.value;
1358
+ this.template = data.template;
1359
+ this.defaultValue = data.defaultValue;
1360
+ }
1361
+ }
1362
+ changed(value) {
1363
+ this.value = value;
1364
+ this.onChange.emit(value);
1365
+ }
1366
+ }
1367
+
1368
+ /**
1369
+ * Contains a filter button for the list toolbar. Place a
1370
+ * [`sky-filter-button`](https://developer.blackbaud.com/skyux/components/filter)
1371
+ * component inside this component to open a modal with filtering options.
1372
+ * To apply filter options, use the
1373
+ * [list component's](https://developer.blackbaud.com/skyux/components/list/overview#list-properties)
1374
+ * `appliedFilters` property.
1375
+ */
1376
+ class SkyListFilterButtonComponent {
1377
+ constructor(dispatcher) {
1378
+ this.dispatcher = dispatcher;
1379
+ this.filterButtonItemToolbarIndex = 5000;
1380
+ }
1381
+ ngAfterViewInit() {
1382
+ this.dispatcher.toolbarAddItems([
1383
+ new ListToolbarItemModel({
1384
+ template: this.filterButtonTemplate,
1385
+ location: 'left',
1386
+ index: this.filterButtonItemToolbarIndex,
1387
+ }),
1388
+ ]);
1389
+ }
1390
+ }
1391
+ SkyListFilterButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListFilterButtonComponent, deps: [{ token: ListStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
1392
+ SkyListFilterButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListFilterButtonComponent, selector: "sky-list-filter-button", viewQueries: [{ propertyName: "filterButtonTemplate", first: true, predicate: ["filterButton"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<ng-template #filterButton>\n <ng-content></ng-content>\n</ng-template>\n" });
1393
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListFilterButtonComponent, decorators: [{
1394
+ type: Component,
1395
+ args: [{ selector: 'sky-list-filter-button', template: "<ng-template #filterButton>\n <ng-content></ng-content>\n</ng-template>\n" }]
1396
+ }], ctorParameters: function () { return [{ type: ListStateDispatcher }]; }, propDecorators: { filterButtonTemplate: [{
1397
+ type: ViewChild,
1398
+ args: ['filterButton', {
1399
+ read: TemplateRef,
1400
+ static: true,
1401
+ }]
1402
+ }] } });
1403
+
1404
+ /**
1405
+ * @internal
1406
+ */
1407
+ class SkyListFilterInlineItemRendererComponent {
1408
+ ngOnInit() {
1409
+ /* istanbul ignore else */
1410
+ /* sanity check */
1411
+ if (this.template !== undefined) {
1412
+ this.container.createEmbeddedView(this.template, this);
1413
+ }
1414
+ }
1415
+ }
1416
+ SkyListFilterInlineItemRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListFilterInlineItemRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1417
+ SkyListFilterInlineItemRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListFilterInlineItemRendererComponent, selector: "sky-list-filter-inline-item-renderer", inputs: { template: "template", filter: "filter" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: '<ng-template #container></ng-template>', isInline: true });
1418
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListFilterInlineItemRendererComponent, decorators: [{
1419
+ type: Component,
1420
+ args: [{
1421
+ selector: 'sky-list-filter-inline-item-renderer',
1422
+ template: '<ng-template #container></ng-template>',
1423
+ }]
1424
+ }], propDecorators: { template: [{
1425
+ type: Input
1426
+ }], filter: [{
1427
+ type: Input
1428
+ }], container: [{
1429
+ type: ViewChild,
1430
+ args: ['container', {
1431
+ read: ViewContainerRef,
1432
+ static: true,
1433
+ }]
1434
+ }] } });
1435
+
1436
+ /**
1437
+ * Creates a filter in the list's inline filter area.
1438
+ */
1439
+ class SkyListFilterInlineItemComponent {
1440
+ constructor() {
1441
+ this.onChange = new EventEmitter();
1442
+ }
1443
+ ngOnInit() {
1444
+ if (this.name === undefined || this.name.length === 0) {
1445
+ throw new Error('Inline filter requires a name.');
1446
+ }
1447
+ }
1448
+ get template() {
1449
+ return this.templates.length > 0
1450
+ ? this.templates.first
1451
+ : this.templateInput;
1452
+ }
1453
+ }
1454
+ SkyListFilterInlineItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListFilterInlineItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1455
+ SkyListFilterInlineItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListFilterInlineItemComponent, selector: "sky-list-filter-inline-item", inputs: { name: "name", value: "value", defaultValue: "defaultValue", filterFunction: ["filter", "filterFunction"], templateInput: ["template", "templateInput"] }, queries: [{ propertyName: "templates", predicate: TemplateRef }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
1456
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListFilterInlineItemComponent, decorators: [{
1457
+ type: Component,
1458
+ args: [{
1459
+ selector: 'sky-list-filter-inline-item',
1460
+ template: '<ng-content></ng-content>',
1461
+ }]
1462
+ }], propDecorators: { name: [{
1463
+ type: Input
1464
+ }], value: [{
1465
+ type: Input
1466
+ }], defaultValue: [{
1467
+ type: Input
1468
+ }], filterFunction: [{
1469
+ type: Input,
1470
+ args: ['filter']
1471
+ }], templateInput: [{
1472
+ type: Input,
1473
+ args: ['template']
1474
+ }], templates: [{
1475
+ type: ContentChildren,
1476
+ args: [TemplateRef]
1477
+ }] } });
1478
+
1479
+ /**
1480
+ * Creates an inline filter area for the list. Place each filter
1481
+ * in a `sky-list-filter-inline-item` component.
1482
+ */
1483
+ class SkyListFilterInlineComponent {
1484
+ constructor(dispatcher, state) {
1485
+ this.dispatcher = dispatcher;
1486
+ this.state = state;
1487
+ this.inlineFilters = [];
1488
+ }
1489
+ ngAfterContentInit() {
1490
+ this.inlineFilters = this.filters.map((filter) => {
1491
+ return new SkyListFilterInlineModel({
1492
+ name: filter.name,
1493
+ filterFunction: filter.filterFunction,
1494
+ template: filter.template,
1495
+ value: filter.value,
1496
+ defaultValue: filter.defaultValue,
1497
+ });
1498
+ });
1499
+ this.inlineFilters.forEach((filter) => {
1500
+ filter.onChange.subscribe((value) => {
1501
+ this.applyFilters();
1502
+ });
1503
+ });
1504
+ this.dispatcher.filtersUpdate(this.getFilterModelFromInline(this.inlineFilters));
1505
+ }
1506
+ applyFilters() {
1507
+ this.state.pipe(take(1)).subscribe((currentState) => {
1508
+ if (currentState.paging.pageNumber &&
1509
+ currentState.paging.pageNumber !== 1) {
1510
+ this.dispatcher.next(new ListPagingSetPageNumberAction(Number(1)));
1511
+ }
1512
+ this.dispatcher.filtersUpdate(this.getFilterModelFromInline(this.inlineFilters));
1513
+ });
1514
+ }
1515
+ getFilterModelFromInline(inlineFilters) {
1516
+ return inlineFilters.map((filter) => {
1517
+ return new ListFilterModel({
1518
+ name: filter.name,
1519
+ value: filter.value,
1520
+ filterFunction: filter.filterFunction,
1521
+ defaultValue: filter.defaultValue,
1522
+ });
1523
+ });
1524
+ }
1525
+ }
1526
+ SkyListFilterInlineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListFilterInlineComponent, deps: [{ token: ListStateDispatcher }, { token: ListState }], target: i0.ɵɵFactoryTarget.Component });
1527
+ SkyListFilterInlineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListFilterInlineComponent, selector: "sky-list-filter-inline", queries: [{ propertyName: "filters", predicate: SkyListFilterInlineItemComponent }], ngImport: i0, template: "<ng-content></ng-content>\n\n<sky-filter-inline>\n <sky-filter-inline-item *ngFor=\"let filter of inlineFilters\">\n <sky-list-filter-inline-item-renderer\n [template]=\"filter.template\"\n [filter]=\"filter\"\n >\n </sky-list-filter-inline-item-renderer>\n </sky-filter-inline-item>\n</sky-filter-inline>\n", components: [{ type: i3.λ2, selector: "sky-filter-inline" }, { type: i3.λ3, selector: "sky-filter-inline-item" }, { type: SkyListFilterInlineItemRendererComponent, selector: "sky-list-filter-inline-item-renderer", inputs: ["template", "filter"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
1528
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListFilterInlineComponent, decorators: [{
1529
+ type: Component,
1530
+ args: [{ selector: 'sky-list-filter-inline', template: "<ng-content></ng-content>\n\n<sky-filter-inline>\n <sky-filter-inline-item *ngFor=\"let filter of inlineFilters\">\n <sky-list-filter-inline-item-renderer\n [template]=\"filter.template\"\n [filter]=\"filter\"\n >\n </sky-list-filter-inline-item-renderer>\n </sky-filter-inline-item>\n</sky-filter-inline>\n" }]
1531
+ }], ctorParameters: function () { return [{ type: ListStateDispatcher }, { type: ListState }]; }, propDecorators: { filters: [{
1532
+ type: ContentChildren,
1533
+ args: [SkyListFilterInlineItemComponent]
1534
+ }] } });
1535
+
1536
+ /**
1537
+ * Creates a filter summary based on the
1538
+ * [list component's](https://developer.blackbaud.com/skyux/components/list/overview#list-properties)
1539
+ * `appliedFilters` property. Place this component within the
1540
+ * [`sky-list-toolbar`](https://developer.blackbaud.com/skyux/components/list/toolbar) component.
1541
+ */
1542
+ class SkyListFilterSummaryComponent {
1543
+ constructor(state, dispatcher) {
1544
+ this.state = state;
1545
+ this.dispatcher = dispatcher;
1546
+ /**
1547
+ * Emits a `ListFilterModel` when users select a summary item. A common use case is
1548
+ * to open a filter modal when this event is received.
1549
+ */
1550
+ this.summaryItemClick = new EventEmitter();
1551
+ }
1552
+ ngAfterContentInit() {
1553
+ // The setTimeout here is to ensure we avoid any ExpressionChangedAfterItHasBeenCheckedError issues.
1554
+ setTimeout(() => {
1555
+ this.appliedFilters = this.state.pipe(map((state) => {
1556
+ return state.filters.filter((filter) => {
1557
+ return (filter.value !== '' &&
1558
+ filter.value !== undefined &&
1559
+ filter.value !== false &&
1560
+ filter.value !== filter.defaultValue);
1561
+ });
1562
+ }));
1563
+ });
1564
+ }
1565
+ filterSummaryItemDismiss(index) {
1566
+ this.appliedFilters.pipe(take(1)).subscribe((filters) => {
1567
+ filters.splice(index, 1);
1568
+ this.dispatcher.filtersUpdate(filters.slice());
1569
+ });
1570
+ }
1571
+ filterSummaryItemClick(item) {
1572
+ this.summaryItemClick.emit(item);
1573
+ }
1574
+ }
1575
+ SkyListFilterSummaryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListFilterSummaryComponent, deps: [{ token: ListState }, { token: ListStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
1576
+ SkyListFilterSummaryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListFilterSummaryComponent, selector: "sky-list-filter-summary", outputs: { summaryItemClick: "summaryItemClick" }, ngImport: i0, template: "<sky-filter-summary>\n <sky-filter-summary-item\n *ngFor=\"let item of appliedFilters | async; let i = index\"\n (dismiss)=\"filterSummaryItemDismiss(i)\"\n (itemClick)=\"filterSummaryItemClick(item)\"\n [dismissible]=\"item.dismissible\"\n >\n {{ item.label || item.value }}\n </sky-filter-summary-item>\n</sky-filter-summary>\n", components: [{ type: i3.λ5, selector: "sky-filter-summary" }, { type: i3.λ4, selector: "sky-filter-summary-item", inputs: ["dismissible"], outputs: ["dismiss", "itemClick"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe } });
1577
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListFilterSummaryComponent, decorators: [{
1578
+ type: Component,
1579
+ args: [{ selector: 'sky-list-filter-summary', template: "<sky-filter-summary>\n <sky-filter-summary-item\n *ngFor=\"let item of appliedFilters | async; let i = index\"\n (dismiss)=\"filterSummaryItemDismiss(i)\"\n (itemClick)=\"filterSummaryItemClick(item)\"\n [dismissible]=\"item.dismissible\"\n >\n {{ item.label || item.value }}\n </sky-filter-summary-item>\n</sky-filter-summary>\n" }]
1580
+ }], ctorParameters: function () { return [{ type: ListState }, { type: ListStateDispatcher }]; }, propDecorators: { summaryItemClick: [{
1581
+ type: Output
1582
+ }] } });
1583
+
1584
+ class SkyListFiltersModule {
1585
+ }
1586
+ SkyListFiltersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListFiltersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1587
+ SkyListFiltersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListFiltersModule, declarations: [SkyListFilterButtonComponent,
1588
+ SkyListFilterSummaryComponent,
1589
+ SkyListFilterInlineItemComponent,
1590
+ SkyListFilterInlineComponent,
1591
+ SkyListFilterInlineItemRendererComponent], imports: [CommonModule, SkyFilterModule], exports: [SkyListFilterButtonComponent,
1592
+ SkyListFilterSummaryComponent,
1593
+ SkyListFilterInlineItemComponent,
1594
+ SkyListFilterInlineComponent] });
1595
+ SkyListFiltersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListFiltersModule, imports: [[CommonModule, SkyFilterModule]] });
1596
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListFiltersModule, decorators: [{
1597
+ type: NgModule,
1598
+ args: [{
1599
+ declarations: [
1600
+ SkyListFilterButtonComponent,
1601
+ SkyListFilterSummaryComponent,
1602
+ SkyListFilterInlineItemComponent,
1603
+ SkyListFilterInlineComponent,
1604
+ SkyListFilterInlineItemRendererComponent,
1605
+ ],
1606
+ imports: [CommonModule, SkyFilterModule],
1607
+ exports: [
1608
+ SkyListFilterButtonComponent,
1609
+ SkyListFilterSummaryComponent,
1610
+ SkyListFilterInlineItemComponent,
1611
+ SkyListFilterInlineComponent,
1612
+ ],
1613
+ }]
1614
+ }] });
1615
+
1616
+ /**
1617
+ * Provides a SKY UX-themed pagination control to display list data across multiple pages.
1618
+ * @internal
1619
+ */
1620
+ class ListPagingComponent {
1621
+ constructor(state, dispatcher) {
1622
+ this.initialized = new BehaviorSubject(false);
1623
+ this.state = state;
1624
+ this.dispatcher = dispatcher;
1625
+ }
1626
+ }
1627
+
1628
+ /* istanbul ignore next */
1629
+ const listPagingComponentRef = forwardRef(() => SkyListPagingComponent);
1630
+ /**
1631
+ * Displays a pagination control for a SKY UX-themed list of data.
1632
+ */
1633
+ class SkyListPagingComponent extends ListPagingComponent {
1634
+ constructor(state, dispatcher) {
1635
+ super(state, dispatcher);
1636
+ /**
1637
+ * Specifies the number of list items per page.
1638
+ * @default 10
1639
+ */
1640
+ this.pageSize = 10;
1641
+ /**
1642
+ * Specifies the maximum pages to display.
1643
+ * @default 5
1644
+ */
1645
+ this.maxPages = 5;
1646
+ /**
1647
+ * Specifies the current page number.
1648
+ * @default 1
1649
+ */
1650
+ this.pageNumber = 1;
1651
+ }
1652
+ ngOnInit() {
1653
+ this.currentPageNumber = this.state.pipe(map((s) => s.paging.pageNumber));
1654
+ this.maxDisplayedPages = this.state.pipe(map((s) => s.paging.maxDisplayedPages));
1655
+ this.itemsPerPage = this.state.pipe(map((s) => s.paging.itemsPerPage));
1656
+ this.itemCount = this.state.pipe(map((s) => {
1657
+ return s.items;
1658
+ }), scan((previousValue, newValue) => {
1659
+ if (previousValue.lastUpdate > newValue.lastUpdate) {
1660
+ return previousValue;
1661
+ }
1662
+ else {
1663
+ return newValue;
1664
+ }
1665
+ }), map((result) => {
1666
+ return result.count;
1667
+ }), distinctUntilChanged());
1668
+ // subscribe to or use inputs
1669
+ getValue(this.pageSize, (pageSize) => this.dispatcher.next(new ListPagingSetItemsPerPageAction(Number(pageSize))));
1670
+ getValue(this.maxPages, (maxPages) => this.dispatcher.next(new ListPagingSetMaxPagesAction(Number(maxPages))));
1671
+ getValue(this.pageNumber, (pageNumber) => this.dispatcher.next(new ListPagingSetPageNumberAction(Number(pageNumber))));
1672
+ }
1673
+ pageChange(currentPage) {
1674
+ // Paging must be updated after list data has been updated.
1675
+ // Adding a setTimeout will pull it out of the stream.
1676
+ setTimeout(() => {
1677
+ this.dispatcher.next(new ListPagingSetPageNumberAction(Number(currentPage)));
1678
+ });
1679
+ }
1680
+ }
1681
+ SkyListPagingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListPagingComponent, deps: [{ token: ListState }, { token: ListStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
1682
+ SkyListPagingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListPagingComponent, selector: "sky-list-paging", inputs: { pageSize: "pageSize", maxPages: "maxPages", pageNumber: "pageNumber" }, providers: [
1683
+ { provide: ListPagingComponent, useExisting: listPagingComponentRef },
1684
+ ], usesInheritance: true, ngImport: i0, template: "<sky-paging\n [pageSize]=\"itemsPerPage | async\"\n [maxPages]=\"maxDisplayedPages | async\"\n [currentPage]=\"currentPageNumber | async\"\n [itemCount]=\"itemCount | async\"\n (currentPageChange)=\"pageChange($event)\"\n>\n</sky-paging>\n", components: [{ type: i3.λ7, selector: "sky-paging", inputs: ["currentPage", "itemCount", "maxPages", "pageSize", "pagingLabel"], outputs: ["currentPageChange"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1685
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListPagingComponent, decorators: [{
1686
+ type: Component,
1687
+ args: [{ selector: 'sky-list-paging', providers: [
1688
+ { provide: ListPagingComponent, useExisting: listPagingComponentRef },
1689
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<sky-paging\n [pageSize]=\"itemsPerPage | async\"\n [maxPages]=\"maxDisplayedPages | async\"\n [currentPage]=\"currentPageNumber | async\"\n [itemCount]=\"itemCount | async\"\n (currentPageChange)=\"pageChange($event)\"\n>\n</sky-paging>\n" }]
1690
+ }], ctorParameters: function () { return [{ type: ListState }, { type: ListStateDispatcher }]; }, propDecorators: { pageSize: [{
1691
+ type: Input
1692
+ }], maxPages: [{
1693
+ type: Input
1694
+ }], pageNumber: [{
1695
+ type: Input
1696
+ }] } });
1697
+
1698
+ class SkyListPagingModule {
1699
+ }
1700
+ SkyListPagingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListPagingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1701
+ SkyListPagingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListPagingModule, declarations: [SkyListPagingComponent], imports: [CommonModule, SkyPagingModule], exports: [SkyListPagingComponent] });
1702
+ SkyListPagingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListPagingModule, imports: [[CommonModule, SkyPagingModule]] });
1703
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListPagingModule, decorators: [{
1704
+ type: NgModule,
1705
+ args: [{
1706
+ declarations: [SkyListPagingComponent],
1707
+ imports: [CommonModule, SkyPagingModule],
1708
+ exports: [SkyListPagingComponent],
1709
+ }]
1710
+ }] });
1711
+
1712
+ /**
1713
+ * NOTICE: DO NOT MODIFY THIS FILE!
1714
+ * The contents of this file were automatically generated by
1715
+ * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-list-builder' schematic.
1716
+ * To update this file, simply rerun the command.
1717
+ */
1718
+ const RESOURCES = {
1719
+ 'EN-US': {
1720
+ skyux_list_show_secondary_actions_button: { message: 'More' },
1721
+ skyux_list_multiselect_clear_all: { message: 'Clear all' },
1722
+ skyux_list_mutliselect_select_all: { message: 'Select all' },
1723
+ skyux_list_mutliselect_show_selected: {
1724
+ message: 'Only show selected items',
1725
+ },
1726
+ skyux_list_view_switcher_dropdown_title: { message: 'Select view' },
1727
+ },
1728
+ };
1729
+ class SkyListBuilderResourcesProvider {
1730
+ getString(localeInfo, name) {
1731
+ return getLibStringForLocale(RESOURCES, localeInfo.locale, name);
1732
+ }
1733
+ }
1734
+ /**
1735
+ * Import into any component library module that needs to use resource strings.
1736
+ */
1737
+ class SkyListBuilderResourcesModule {
1738
+ }
1739
+ SkyListBuilderResourcesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListBuilderResourcesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1740
+ SkyListBuilderResourcesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListBuilderResourcesModule, exports: [SkyI18nModule] });
1741
+ SkyListBuilderResourcesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListBuilderResourcesModule, providers: [
1742
+ {
1743
+ provide: SKY_LIB_RESOURCES_PROVIDERS,
1744
+ useClass: SkyListBuilderResourcesProvider,
1745
+ multi: true,
1746
+ },
1747
+ ], imports: [SkyI18nModule] });
1748
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListBuilderResourcesModule, decorators: [{
1749
+ type: NgModule,
1750
+ args: [{
1751
+ exports: [SkyI18nModule],
1752
+ providers: [
1753
+ {
1754
+ provide: SKY_LIB_RESOURCES_PROVIDERS,
1755
+ useClass: SkyListBuilderResourcesProvider,
1756
+ multi: true,
1757
+ },
1758
+ ],
1759
+ }]
1760
+ }] });
1761
+
1762
+ /**
1763
+ * @internal
1764
+ */
1765
+ class SkyListSecondaryActionsService {
1766
+ constructor() {
1767
+ this.secondaryActionsCount = 0;
1768
+ this.secondaryActionsSubject = new BehaviorSubject(0);
1769
+ this.actionsStream = new BehaviorSubject([]);
1770
+ this.actions = [];
1771
+ }
1772
+ addSecondaryAction(action) {
1773
+ this.secondaryActionsCount++;
1774
+ this.secondaryActionsSubject.next(this.secondaryActionsCount);
1775
+ this.actions.push(action);
1776
+ this.actionsStream.next(this.actions);
1777
+ }
1778
+ removeSecondaryAction(action) {
1779
+ this.secondaryActionsCount--;
1780
+ this.secondaryActionsSubject.next(this.secondaryActionsCount);
1781
+ this.actions = this.actions.filter((existingItem) => existingItem !== action);
1782
+ this.actionsStream.next(this.actions);
1783
+ }
1784
+ ngOnDestroy() {
1785
+ this.secondaryActionsSubject.complete();
1786
+ this.actionsStream.complete();
1787
+ }
1788
+ }
1789
+ SkyListSecondaryActionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListSecondaryActionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1790
+ SkyListSecondaryActionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListSecondaryActionsService });
1791
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListSecondaryActionsService, decorators: [{
1792
+ type: Injectable
1793
+ }] });
1794
+
1795
+ /**
1796
+ * Adds actions to the secondary actions dropdown in the list toolbar.
1797
+ */
1798
+ class SkyListSecondaryActionComponent {
1799
+ constructor(actionService) {
1800
+ this.actionService = actionService;
1801
+ }
1802
+ ngAfterContentInit() {
1803
+ this.actionService.addSecondaryAction({
1804
+ template: this.templateRef,
1805
+ });
1806
+ }
1807
+ }
1808
+ SkyListSecondaryActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListSecondaryActionComponent, deps: [{ token: SkyListSecondaryActionsService }], target: i0.ɵɵFactoryTarget.Component });
1809
+ SkyListSecondaryActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListSecondaryActionComponent, selector: "sky-list-secondary-action", viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["listSecondaryAction"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<ng-template #listSecondaryAction>\n <ng-content></ng-content>\n</ng-template>\n" });
1810
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListSecondaryActionComponent, decorators: [{
1811
+ type: Component,
1812
+ args: [{ selector: 'sky-list-secondary-action', template: "<ng-template #listSecondaryAction>\n <ng-content></ng-content>\n</ng-template>\n" }]
1813
+ }], ctorParameters: function () { return [{ type: SkyListSecondaryActionsService }]; }, propDecorators: { templateRef: [{
1814
+ type: ViewChild,
1815
+ args: ['listSecondaryAction', {
1816
+ read: TemplateRef,
1817
+ static: true,
1818
+ }]
1819
+ }] } });
1820
+
1821
+ // Note: this component is needed to ensure any reactive styles placed in the element have
1822
+ // their host to be based off of. Without this component the host is not written via the dispatcher.
1823
+ /**
1824
+ * @internal
1825
+ */
1826
+ class SkyListSecondaryActionsHostComponent {
1827
+ constructor(changeDetector, actionService) {
1828
+ this.changeDetector = changeDetector;
1829
+ this.actionService = actionService;
1830
+ this.dropdownHidden = false;
1831
+ this.actions = [];
1832
+ this.ngUnsubscribe = new Subject();
1833
+ }
1834
+ ngOnInit() {
1835
+ this.actionService.actionsStream
1836
+ .pipe(takeUntil(this.ngUnsubscribe), distinctUntilChanged())
1837
+ .subscribe((actions) => {
1838
+ const hasSecondaryActions = actions.length > 0;
1839
+ this.dropdownHidden = !hasSecondaryActions;
1840
+ this.actions = actions;
1841
+ this.changeDetector.detectChanges();
1842
+ });
1843
+ }
1844
+ ngOnDestroy() {
1845
+ this.ngUnsubscribe.next();
1846
+ this.ngUnsubscribe.complete();
1847
+ }
1848
+ }
1849
+ SkyListSecondaryActionsHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListSecondaryActionsHostComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: SkyListSecondaryActionsService }], target: i0.ɵɵFactoryTarget.Component });
1850
+ SkyListSecondaryActionsHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListSecondaryActionsHostComponent, selector: "sky-list-secondary-actions-host", ngImport: i0, template: "<div\n class=\"sky-list-secondary-actions\"\n [ngClass]=\"{ 'sky-list-secondary-actions-hidden': dropdownHidden }\"\n>\n <sky-dropdown\n [attr.title]=\"'skyux_list_show_secondary_actions_button' | skyLibResources\"\n [label]=\"'skyux_list_show_secondary_actions_button' | skyLibResources\"\n >\n <sky-dropdown-button>\n <sky-icon icon=\"ellipsis-h\"> </sky-icon>\n <span class=\"sky-list-secondary-actions-btn-text\">\n {{ 'skyux_list_show_secondary_actions_button' | skyLibResources }}\n </span>\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let action of actions\">\n <ng-container *ngTemplateOutlet=\"action.template\"> </ng-container>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n</div>\n<ng-content> </ng-content>\n", styles: [".sky-list-secondary-actions ::ng-deep .sky-dropdown-button-type-select{padding:6px 12px}.sky-list-secondary-actions ::ng-deep .sky-dropdown-button-type-select sky-icon[icon=ellipsis-h]{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.sky-list-secondary-actions-hidden{display:none}:host .sky-list-secondary-actions-btn-text{display:none}:host .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:none}:host-context(.sky-responsive-container-xs) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions-btn-text{display:none}:host-context(.sky-responsive-container-xs) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:none}@media (min-width: 768px){:host .sky-list-secondary-actions-btn-text{display:inline}:host .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:inline-block}}:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions-btn-text{display:inline}:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:inline-block}\n"], components: [{ type: i2.λ3, selector: "sky-dropdown", inputs: ["buttonStyle", "buttonType", "disabled", "dismissOnBlur", "label", "horizontalAlignment", "messageStream", "title", "trigger"] }, { type: i2.λ2, selector: "sky-dropdown-button" }, { type: i3$1.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { type: i2.λ4, selector: "sky-dropdown-menu", inputs: ["ariaLabelledBy", "ariaRole", "useNativeFocus"], outputs: ["menuChanges"] }, { type: i2.λ1, selector: "sky-dropdown-item", inputs: ["ariaRole"] }], directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "skyLibResources": i5.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1851
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListSecondaryActionsHostComponent, decorators: [{
1852
+ type: Component,
1853
+ args: [{ selector: 'sky-list-secondary-actions-host', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"sky-list-secondary-actions\"\n [ngClass]=\"{ 'sky-list-secondary-actions-hidden': dropdownHidden }\"\n>\n <sky-dropdown\n [attr.title]=\"'skyux_list_show_secondary_actions_button' | skyLibResources\"\n [label]=\"'skyux_list_show_secondary_actions_button' | skyLibResources\"\n >\n <sky-dropdown-button>\n <sky-icon icon=\"ellipsis-h\"> </sky-icon>\n <span class=\"sky-list-secondary-actions-btn-text\">\n {{ 'skyux_list_show_secondary_actions_button' | skyLibResources }}\n </span>\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let action of actions\">\n <ng-container *ngTemplateOutlet=\"action.template\"> </ng-container>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n</div>\n<ng-content> </ng-content>\n", styles: [".sky-list-secondary-actions ::ng-deep .sky-dropdown-button-type-select{padding:6px 12px}.sky-list-secondary-actions ::ng-deep .sky-dropdown-button-type-select sky-icon[icon=ellipsis-h]{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.sky-list-secondary-actions-hidden{display:none}:host .sky-list-secondary-actions-btn-text{display:none}:host .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:none}:host-context(.sky-responsive-container-xs) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions-btn-text{display:none}:host-context(.sky-responsive-container-xs) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:none}@media (min-width: 768px){:host .sky-list-secondary-actions-btn-text{display:inline}:host .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:inline-block}}:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions-btn-text{display:inline}:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:inline-block}\n"] }]
1854
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: SkyListSecondaryActionsService }]; } });
1855
+
1856
+ /**
1857
+ * Adds a dropdown to the list toolbar for secondary actions. If the dropdown does not
1858
+ * include actions, the secondary actions dropdown is hidden.
1859
+ */
1860
+ class SkyListSecondaryActionsComponent {
1861
+ constructor(dispatcher) {
1862
+ this.dispatcher = dispatcher;
1863
+ this.actions = [];
1864
+ this.secondaryActionsItemToolbarIndex = 5000;
1865
+ }
1866
+ ngAfterViewInit() {
1867
+ const secondaryActionItem = new ListToolbarItemModel({
1868
+ id: 'secondary-actions',
1869
+ template: this.secondaryActionsTemplate,
1870
+ location: 'center',
1871
+ index: this.secondaryActionsItemToolbarIndex,
1872
+ });
1873
+ this.dispatcher.toolbarAddItems([secondaryActionItem]);
1874
+ }
1875
+ }
1876
+ SkyListSecondaryActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListSecondaryActionsComponent, deps: [{ token: ListStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
1877
+ SkyListSecondaryActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListSecondaryActionsComponent, selector: "sky-list-secondary-actions", providers: [SkyListSecondaryActionsService], viewQueries: [{ propertyName: "secondaryActionsTemplate", first: true, predicate: ["secondaryActions"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<ng-template #secondaryActions>\n <sky-list-secondary-actions-host>\n <ng-content></ng-content>\n </sky-list-secondary-actions-host>\n</ng-template>\n", components: [{ type: SkyListSecondaryActionsHostComponent, selector: "sky-list-secondary-actions-host" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1878
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListSecondaryActionsComponent, decorators: [{
1879
+ type: Component,
1880
+ args: [{ selector: 'sky-list-secondary-actions', providers: [SkyListSecondaryActionsService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #secondaryActions>\n <sky-list-secondary-actions-host>\n <ng-content></ng-content>\n </sky-list-secondary-actions-host>\n</ng-template>\n" }]
1881
+ }], ctorParameters: function () { return [{ type: ListStateDispatcher }]; }, propDecorators: { secondaryActionsTemplate: [{
1882
+ type: ViewChild,
1883
+ args: ['secondaryActions', {
1884
+ read: TemplateRef,
1885
+ static: true,
1886
+ }]
1887
+ }] } });
1888
+
1889
+ class SkyListSecondaryActionsModule {
1890
+ }
1891
+ SkyListSecondaryActionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListSecondaryActionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1892
+ SkyListSecondaryActionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListSecondaryActionsModule, declarations: [SkyListSecondaryActionsComponent,
1893
+ SkyListSecondaryActionsHostComponent,
1894
+ SkyListSecondaryActionComponent], imports: [CommonModule,
1895
+ SkyDropdownModule,
1896
+ SkyI18nModule,
1897
+ SkyIconModule,
1898
+ SkyListBuilderResourcesModule], exports: [SkyListSecondaryActionsComponent, SkyListSecondaryActionComponent] });
1899
+ SkyListSecondaryActionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListSecondaryActionsModule, imports: [[
1900
+ CommonModule,
1901
+ SkyDropdownModule,
1902
+ SkyI18nModule,
1903
+ SkyIconModule,
1904
+ SkyListBuilderResourcesModule,
1905
+ ]] });
1906
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListSecondaryActionsModule, decorators: [{
1907
+ type: NgModule,
1908
+ args: [{
1909
+ declarations: [
1910
+ SkyListSecondaryActionsComponent,
1911
+ SkyListSecondaryActionsHostComponent,
1912
+ SkyListSecondaryActionComponent,
1913
+ ],
1914
+ imports: [
1915
+ CommonModule,
1916
+ SkyDropdownModule,
1917
+ SkyI18nModule,
1918
+ SkyIconModule,
1919
+ SkyListBuilderResourcesModule,
1920
+ ],
1921
+ exports: [SkyListSecondaryActionsComponent, SkyListSecondaryActionComponent],
1922
+ }]
1923
+ }] });
1924
+
1925
+ /**
1926
+ * @internal
1927
+ */
1928
+ class SkyListToolbarItemRendererComponent {
1929
+ ngOnInit() {
1930
+ if (this.template !== undefined) {
1931
+ this.container.createEmbeddedView(this.template, this);
1932
+ }
1933
+ }
1934
+ }
1935
+ SkyListToolbarItemRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarItemRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1936
+ SkyListToolbarItemRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListToolbarItemRendererComponent, selector: "sky-list-toolbar-item-renderer", inputs: { template: "template" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: '<ng-template #container></ng-template>', isInline: true });
1937
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarItemRendererComponent, decorators: [{
1938
+ type: Component,
1939
+ args: [{
1940
+ selector: 'sky-list-toolbar-item-renderer',
1941
+ template: '<ng-template #container></ng-template>',
1942
+ }]
1943
+ }], propDecorators: { template: [{
1944
+ type: Input
1945
+ }], container: [{
1946
+ type: ViewChild,
1947
+ args: ['container', {
1948
+ read: ViewContainerRef,
1949
+ static: true,
1950
+ }]
1951
+ }] } });
1952
+
1953
+ let uniqueId = 0;
1954
+ /**
1955
+ * @internal
1956
+ */
1957
+ class SkyListMultiselectToolbarComponent {
1958
+ constructor(state, dispatcher) {
1959
+ this.state = state;
1960
+ this.dispatcher = dispatcher;
1961
+ this.showOnlySelected = false;
1962
+ this.multiselectToolbarId = `sky-list-multiselect-toolbar-${uniqueId++}`;
1963
+ this.selectedIdMap = new Map();
1964
+ this.ngUnsubscribe = new Subject();
1965
+ }
1966
+ ngOnInit() {
1967
+ this.state
1968
+ .pipe(map((t) => t.selected.item), takeUntil(this.ngUnsubscribe), distinctUntilChanged(this.selectedMapEqual))
1969
+ .subscribe((model) => {
1970
+ this.selectedIdMap = model.selectedIdMap;
1971
+ if (this.showOnlySelected) {
1972
+ this.reapplyFilter(true);
1973
+ }
1974
+ });
1975
+ // If 'show-selected' filter is programatically set from a child component (e.g. checkilst),
1976
+ // make sure the checked state of the 'show-selected' checkbox stays in sync.
1977
+ this.state
1978
+ .pipe(map((t) => t.filters), takeUntil(this.ngUnsubscribe), distinctUntilChanged(this.showSelectedValuesEqual))
1979
+ .subscribe((filters) => {
1980
+ const showSelectedFilter = filters.find((filter) => filter.name === 'show-selected');
1981
+ if (showSelectedFilter) {
1982
+ this.showOnlySelected = showSelectedFilter.value === 'true';
1983
+ }
1984
+ });
1985
+ }
1986
+ ngOnDestroy() {
1987
+ this.ngUnsubscribe.next();
1988
+ this.ngUnsubscribe.complete();
1989
+ }
1990
+ selectAll() {
1991
+ this.state
1992
+ .pipe(map((state) => state.items.items), take(1))
1993
+ .subscribe((items) => {
1994
+ this.dispatcher.setSelected(items.map((item) => item.id), true);
1995
+ if (this.showOnlySelected) {
1996
+ this.reapplyFilter(this.showOnlySelected);
1997
+ }
1998
+ });
1999
+ }
2000
+ clearSelections() {
2001
+ this.state
2002
+ .pipe(map((state) => state.items.items), take(1))
2003
+ .subscribe((items) => {
2004
+ this.dispatcher.setSelected(items.map((item) => item.id), false);
2005
+ if (this.showOnlySelected) {
2006
+ this.reapplyFilter(this.showOnlySelected);
2007
+ }
2008
+ });
2009
+ }
2010
+ changeVisibleItems(change) {
2011
+ this.showOnlySelected = change.checked;
2012
+ this.reapplyFilter(change.checked);
2013
+ }
2014
+ reapplyFilter(isSelected) {
2015
+ this.state
2016
+ .pipe(map((state) => state.filters), take(1))
2017
+ .subscribe((filters) => {
2018
+ filters = filters.filter((filter) => filter.name !== 'show-selected');
2019
+ filters.push(this.getShowSelectedFilter(isSelected));
2020
+ this.dispatcher.filtersUpdate(filters);
2021
+ });
2022
+ // If "show selected" is checked and paging is enabled, go to page one.
2023
+ /* istanbul ignore else */
2024
+ if (isSelected) {
2025
+ this.state.pipe(take(1)).subscribe((currentState) => {
2026
+ if (currentState.paging.pageNumber &&
2027
+ currentState.paging.pageNumber !== 1) {
2028
+ this.dispatcher.next(new ListPagingSetPageNumberAction(Number(1)));
2029
+ }
2030
+ });
2031
+ }
2032
+ this.dispatcher.toolbarSetDisabled(isSelected);
2033
+ }
2034
+ getShowSelectedFilter(isSelected) {
2035
+ return new ListFilterModel({
2036
+ name: 'show-selected',
2037
+ value: isSelected.toString(),
2038
+ filterFunction: (model, showOnlySelected) => {
2039
+ /* istanbul ignore else */
2040
+ if (showOnlySelected.toString() !== false.toString()) {
2041
+ return this.selectedIdMap.get(model.id);
2042
+ }
2043
+ },
2044
+ defaultValue: false.toString(),
2045
+ });
2046
+ }
2047
+ showSelectedValuesEqual(prev, next) {
2048
+ const prevShowSelectedFilter = prev.find((filter) => filter.name === 'show-selected');
2049
+ const nextShowSelectedFilter = next.find((filter) => filter.name === 'show-selected');
2050
+ // Both undefined.
2051
+ if (!prevShowSelectedFilter && !nextShowSelectedFilter) {
2052
+ return true;
2053
+ }
2054
+ // Only one undefined.
2055
+ if ((prevShowSelectedFilter && !nextShowSelectedFilter) ||
2056
+ (!prevShowSelectedFilter && nextShowSelectedFilter)) {
2057
+ return false;
2058
+ }
2059
+ // Defined, but with different "value".
2060
+ return prevShowSelectedFilter.value === nextShowSelectedFilter.value;
2061
+ }
2062
+ selectedMapEqual(prev, next) {
2063
+ if (prev.selectedIdMap.size !== next.selectedIdMap.size) {
2064
+ return false;
2065
+ }
2066
+ for (let i = 0; i < next.selectedIdMap.size; i++) {
2067
+ const key = Array.from(next.selectedIdMap.keys())[i];
2068
+ const value = next.selectedIdMap.get(key);
2069
+ /* istanbul ignore next */
2070
+ if (value !== prev.selectedIdMap.get(key)) {
2071
+ return false;
2072
+ }
2073
+ }
2074
+ return true;
2075
+ }
2076
+ }
2077
+ SkyListMultiselectToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListMultiselectToolbarComponent, deps: [{ token: ListState }, { token: ListStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
2078
+ SkyListMultiselectToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListMultiselectToolbarComponent, selector: "sky-list-multiselect-toolbar", inputs: { showOnlySelected: "showOnlySelected" }, ngImport: i0, template: "<sky-toolbar class=\"sky-list-multiselect-toolbar\">\n <sky-toolbar-section>\n <sky-toolbar-item>\n <sky-list-toolbar-item-renderer [template]=\"selectAllTemplate\">\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item>\n <sky-list-toolbar-item-renderer [template]=\"clearSelectionsTemplate\">\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <ng-container *ngTemplateOutlet=\"showSelectedTemplate\"></ng-container>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n</sky-toolbar>\n\n<ng-template #selectAllTemplate>\n <button\n class=\"sky-btn sky-btn-link\"\n type=\"button\"\n [attr.id]=\"multiselectToolbarId + '-select-all'\"\n (click)=\"selectAll(); $event.preventDefault()\"\n >\n {{ 'skyux_list_mutliselect_select_all' | skyLibResources }}\n </button>\n</ng-template>\n\n<ng-template #clearSelectionsTemplate>\n <button\n class=\"sky-btn sky-btn-link\"\n type=\"button\"\n [attr.id]=\"multiselectToolbarId + '-clear-all'\"\n (click)=\"clearSelections(); $event.preventDefault()\"\n >\n {{ 'skyux_list_multiselect_clear_all' | skyLibResources }}\n </button>\n</ng-template>\n\n<ng-template #showSelectedTemplate>\n <sky-checkbox\n [attr.id]=\"multiselectToolbarId + '-show-selected'\"\n [checked]=\"showOnlySelected\"\n (change)=\"changeVisibleItems($event)\"\n >\n <sky-checkbox-label>\n {{ 'skyux_list_mutliselect_show_selected' | skyLibResources }}\n </sky-checkbox-label>\n </sky-checkbox>\n</ng-template>\n", styles: [":host-context(sky-toolbar +) .sky-list-multiselect-toolbar ::ng-deep .sky-toolbar-container,:host-context(.sky-list-toolbar-search +) .sky-list-multiselect-toolbar ::ng-deep .sky-toolbar-container{border-top:none}\n"], components: [{ type: i3$2.λ37, selector: "sky-toolbar" }, { type: i3$2.λ38, selector: "sky-toolbar-section" }, { type: i3$2.λ39, selector: "sky-toolbar-item" }, { type: SkyListToolbarItemRendererComponent, selector: "sky-list-toolbar-item-renderer", inputs: ["template"] }, { type: i3$2.λ40, selector: "sky-toolbar-view-actions" }, { type: i5$1.λ3, selector: "sky-checkbox", inputs: ["label", "labelledBy", "id", "disabled", "tabindex", "name", "icon", "checkboxType", "checked", "required"], outputs: ["change", "checkedChange", "disabledChange"] }, { type: i5$1.λ4, selector: "sky-checkbox-label" }], directives: [{ type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "skyLibResources": i5.SkyLibResourcesPipe } });
2079
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListMultiselectToolbarComponent, decorators: [{
2080
+ type: Component,
2081
+ args: [{ selector: 'sky-list-multiselect-toolbar', template: "<sky-toolbar class=\"sky-list-multiselect-toolbar\">\n <sky-toolbar-section>\n <sky-toolbar-item>\n <sky-list-toolbar-item-renderer [template]=\"selectAllTemplate\">\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item>\n <sky-list-toolbar-item-renderer [template]=\"clearSelectionsTemplate\">\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <ng-container *ngTemplateOutlet=\"showSelectedTemplate\"></ng-container>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n</sky-toolbar>\n\n<ng-template #selectAllTemplate>\n <button\n class=\"sky-btn sky-btn-link\"\n type=\"button\"\n [attr.id]=\"multiselectToolbarId + '-select-all'\"\n (click)=\"selectAll(); $event.preventDefault()\"\n >\n {{ 'skyux_list_mutliselect_select_all' | skyLibResources }}\n </button>\n</ng-template>\n\n<ng-template #clearSelectionsTemplate>\n <button\n class=\"sky-btn sky-btn-link\"\n type=\"button\"\n [attr.id]=\"multiselectToolbarId + '-clear-all'\"\n (click)=\"clearSelections(); $event.preventDefault()\"\n >\n {{ 'skyux_list_multiselect_clear_all' | skyLibResources }}\n </button>\n</ng-template>\n\n<ng-template #showSelectedTemplate>\n <sky-checkbox\n [attr.id]=\"multiselectToolbarId + '-show-selected'\"\n [checked]=\"showOnlySelected\"\n (change)=\"changeVisibleItems($event)\"\n >\n <sky-checkbox-label>\n {{ 'skyux_list_mutliselect_show_selected' | skyLibResources }}\n </sky-checkbox-label>\n </sky-checkbox>\n</ng-template>\n", styles: [":host-context(sky-toolbar +) .sky-list-multiselect-toolbar ::ng-deep .sky-toolbar-container,:host-context(.sky-list-toolbar-search +) .sky-list-multiselect-toolbar ::ng-deep .sky-toolbar-container{border-top:none}\n"] }]
2082
+ }], ctorParameters: function () { return [{ type: ListState }, { type: ListStateDispatcher }]; }, propDecorators: { showOnlySelected: [{
2083
+ type: Input
2084
+ }] } });
2085
+
2086
+ let idIndex = 0;
2087
+ /**
2088
+ * Defines a toolbar item for the list toolbar.
2089
+ */
2090
+ class SkyListToolbarItemComponent {
2091
+ constructor() {
2092
+ /**
2093
+ * Specifies the ID of the item.
2094
+ */
2095
+ this.id = `sky-list-toolbar-item-${++idIndex}`;
2096
+ /**
2097
+ * Specifies the index of the item at the given item location.
2098
+ * @default -1
2099
+ */
2100
+ this.index = -1;
2101
+ /**
2102
+ * Specifies the toolbar location of the item. The valid options are `"left"`,
2103
+ * `"center"`, and `"right"`.
2104
+ * @default "left"
2105
+ */
2106
+ this.location = 'left';
2107
+ }
2108
+ get template() {
2109
+ return this.templates.length > 0 ? this.templates.first : undefined;
2110
+ }
2111
+ }
2112
+ SkyListToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2113
+ SkyListToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListToolbarItemComponent, selector: "sky-list-toolbar-item", inputs: { id: "id", index: "index", location: "location" }, queries: [{ propertyName: "templates", predicate: TemplateRef }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
2114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarItemComponent, decorators: [{
2115
+ type: Component,
2116
+ args: [{
2117
+ selector: 'sky-list-toolbar-item',
2118
+ template: '<ng-content></ng-content>',
2119
+ }]
2120
+ }], propDecorators: { id: [{
2121
+ type: Input
2122
+ }], index: [{
2123
+ type: Input
2124
+ }], location: [{
2125
+ type: Input
2126
+ }], templates: [{
2127
+ type: ContentChildren,
2128
+ args: [TemplateRef]
2129
+ }] } });
2130
+
2131
+ /**
2132
+ * Displays custom actions in the toolbar beside to the search bar.
2133
+ */
2134
+ class SkyListToolbarSearchActionsComponent {
2135
+ }
2136
+ SkyListToolbarSearchActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarSearchActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2137
+ SkyListToolbarSearchActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListToolbarSearchActionsComponent, selector: "sky-list-toolbar-search-actions", ngImport: i0, template: "<div class=\"sky-list-toolbar-search-actions\">\n <ng-content></ng-content>\n</div>\n", styles: [".sky-list-toolbar-search-actions{margin-left:10px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2138
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarSearchActionsComponent, decorators: [{
2139
+ type: Component,
2140
+ args: [{ selector: 'sky-list-toolbar-search-actions', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sky-list-toolbar-search-actions\">\n <ng-content></ng-content>\n</div>\n", styles: [".sky-list-toolbar-search-actions{margin-left:10px}\n"] }]
2141
+ }] });
2142
+
2143
+ /**
2144
+ * Adds a sort dropdown to the list toolbar.
2145
+ */
2146
+ class SkyListToolbarSortComponent {
2147
+ }
2148
+ SkyListToolbarSortComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarSortComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2149
+ SkyListToolbarSortComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListToolbarSortComponent, selector: "sky-list-toolbar-sort", inputs: { label: "label", field: "field", type: "type", descending: "descending" }, ngImport: i0, template: '', isInline: true });
2150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarSortComponent, decorators: [{
2151
+ type: Component,
2152
+ args: [{
2153
+ selector: 'sky-list-toolbar-sort',
2154
+ template: '',
2155
+ }]
2156
+ }], propDecorators: { label: [{
2157
+ type: Input
2158
+ }], field: [{
2159
+ type: Input
2160
+ }], type: [{
2161
+ type: Input
2162
+ }], descending: [{
2163
+ type: Input
2164
+ }] } });
2165
+
2166
+ /**
2167
+ * Adds a section on the right side of the toolbar for items that substantially change
2168
+ * or affect the view of the list. This includes simple filters and view switchers.
2169
+ * If the view section includes more than one item, simple filters appear on the left
2170
+ * and view switchers appear on the right.
2171
+ */
2172
+ class SkyListToolbarViewActionsComponent {
2173
+ }
2174
+ SkyListToolbarViewActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarViewActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2175
+ SkyListToolbarViewActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListToolbarViewActionsComponent, selector: "sky-list-toolbar-view-actions", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{display:flex;align-items:center}:host::ng-deep>:not(:last-child){margin-right:5px}.sky-list-toolbar-view-actions ::ng-deep>:not(:last-child){margin-right:5px}\n"] });
2176
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarViewActionsComponent, decorators: [{
2177
+ type: Component,
2178
+ args: [{ selector: 'sky-list-toolbar-view-actions', template: "<ng-content></ng-content>\n", styles: [":host{display:flex;align-items:center}:host::ng-deep>:not(:last-child){margin-right:5px}.sky-list-toolbar-view-actions ::ng-deep>:not(:last-child){margin-right:5px}\n"] }]
2179
+ }] });
2180
+
2181
+ /**
2182
+ * @internal
2183
+ */
2184
+ class ListToolbarConfigSetSearchEnabledAction {
2185
+ constructor(enabled) {
2186
+ this.enabled = enabled;
2187
+ }
2188
+ }
2189
+
2190
+ /**
2191
+ * @internal
2192
+ */
2193
+ class ListToolbarConfigSetSortSelectorEnabledAction {
2194
+ /* istanbul ignore next */
2195
+ constructor(enabled = true) {
2196
+ this.enabled = enabled;
2197
+ }
2198
+ }
2199
+
2200
+ /**
2201
+ * @internal
2202
+ */
2203
+ class ListToolbarConfigModel {
2204
+ constructor(data) {
2205
+ this.searchEnabled = true;
2206
+ this.sortSelectorEnabled = true;
2207
+ if (data) {
2208
+ this.searchEnabled = data.searchEnabled;
2209
+ this.sortSelectorEnabled = data.sortSelectorEnabled;
2210
+ }
2211
+ }
2212
+ }
2213
+
2214
+ /**
2215
+ * @internal
2216
+ */
2217
+ class ListToolbarStateModel {
2218
+ constructor() {
2219
+ this.config = new ListToolbarConfigModel();
2220
+ }
2221
+ }
2222
+
2223
+ /**
2224
+ * @internal
2225
+ */
2226
+ class ListToolbarStateDispatcher extends StateDispatcher {
2227
+ }
2228
+ ListToolbarStateDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListToolbarStateDispatcher, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
2229
+ ListToolbarStateDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListToolbarStateDispatcher });
2230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListToolbarStateDispatcher, decorators: [{
2231
+ type: Injectable
2232
+ }] });
2233
+ /**
2234
+ * @internal
2235
+ */
2236
+ class ListToolbarStateOrchestrator extends StateOrchestrator {
2237
+ }
2238
+
2239
+ /**
2240
+ * @internal
2241
+ */
2242
+ class ListToolbarConfigOrchestrator extends ListToolbarStateOrchestrator {
2243
+ /* istanbul ignore next */
2244
+ constructor() {
2245
+ super();
2246
+ this.register(ListToolbarConfigSetSearchEnabledAction, this.setSearchEnabled).register(ListToolbarConfigSetSortSelectorEnabledAction, this.setSortSelectorEnabled);
2247
+ }
2248
+ setSearchEnabled(state, action) {
2249
+ return new ListToolbarConfigModel(Object.assign({}, state, { searchEnabled: action.enabled }));
2250
+ }
2251
+ setSortSelectorEnabled(state, action) {
2252
+ return new ListToolbarConfigModel(Object.assign({}, state, { sortSelectorEnabled: action.enabled }));
2253
+ }
2254
+ }
2255
+
2256
+ /**
2257
+ * @internal
2258
+ */
2259
+ class ListToolbarState extends StateNode {
2260
+ constructor(initialState, dispatcher) {
2261
+ super(initialState, dispatcher);
2262
+ this.register('config', ListToolbarConfigOrchestrator).begin();
2263
+ }
2264
+ }
2265
+ ListToolbarState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListToolbarState, deps: [{ token: ListToolbarStateModel }, { token: ListToolbarStateDispatcher }], target: i0.ɵɵFactoryTarget.Injectable });
2266
+ ListToolbarState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListToolbarState });
2267
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListToolbarState, decorators: [{
2268
+ type: Injectable
2269
+ }], ctorParameters: function () { return [{ type: ListToolbarStateModel }, { type: ListToolbarStateDispatcher }]; } });
2270
+
2271
+ let nextId = 0;
2272
+ /**
2273
+ * Displays a toolbar for a SKY UX-themed list of data.
2274
+ */
2275
+ class SkyListToolbarComponent {
2276
+ constructor(changeDetector, state, dispatcher, toolbarState, toolbarDispatcher) {
2277
+ this.changeDetector = changeDetector;
2278
+ this.state = state;
2279
+ this.dispatcher = dispatcher;
2280
+ this.toolbarState = toolbarState;
2281
+ this.toolbarDispatcher = toolbarDispatcher;
2282
+ /**
2283
+ * Display the search bar in the standard position or in a separate section.
2284
+ * To highlight the search bar in a section above all other toolbar items,
2285
+ * set this property to `search`.
2286
+ * @default "standard"
2287
+ */
2288
+ this.toolbarType = 'standard';
2289
+ this.isToolbarDisabled = false;
2290
+ this.inlineFilterBarExpanded = false;
2291
+ this.hasAdditionalToolbarSection = false;
2292
+ this.hasViewActions = false;
2293
+ this.filterButtonId = `sky-list-toolbar-filter-button-${++nextId}`;
2294
+ this.listFilterInlineId = `sky-list-toolbar-filter-inline-${++nextId}`;
2295
+ /**
2296
+ * Fires when users submit a search.
2297
+ * @internal
2298
+ */
2299
+ this.searchApplied = new Subject();
2300
+ this.customItemIds = [];
2301
+ this.hasSortSelectors = false;
2302
+ this.inlineFiltersItemToolbarIndex = 5000;
2303
+ this.sortSelectorItemToolbarIndex = 6000;
2304
+ this.ngUnsubscribe = new Subject();
2305
+ }
2306
+ /**
2307
+ * Indicates whether to use the in-memory search.
2308
+ * Setting this to `false` will allow consumers to run their own searches remotely,
2309
+ * and push new values to the list component by updating the `data` property.
2310
+ * @default true
2311
+ * @internal
2312
+ */
2313
+ set inMemorySearchEnabled(value) {
2314
+ this._inMemorySearchEnabled = value;
2315
+ }
2316
+ get inMemorySearchEnabled() {
2317
+ if (this._inMemorySearchEnabled === undefined) {
2318
+ return true;
2319
+ }
2320
+ return this._inMemorySearchEnabled;
2321
+ }
2322
+ get isFilterBarDisplayed() {
2323
+ return (!this.isToolbarDisabled &&
2324
+ this.hasInlineFilters &&
2325
+ this.inlineFilterBarExpanded);
2326
+ }
2327
+ get filterButtonAriaControls() {
2328
+ return this.isFilterBarDisplayed ? this.listFilterInlineId : undefined;
2329
+ }
2330
+ ngOnInit() {
2331
+ this.dispatcher.toolbarExists(true);
2332
+ getValue(this.searchText, (searchText) => {
2333
+ this.updateSearchText(searchText);
2334
+ });
2335
+ getValue(this.searchEnabled, (searchEnabled) => {
2336
+ this.toolbarDispatcher.next(new ListToolbarConfigSetSearchEnabledAction(searchEnabled === undefined ? true : searchEnabled));
2337
+ });
2338
+ getValue(this.toolbarType, (type) => {
2339
+ this.dispatcher.next(new ListToolbarSetTypeAction(this.toolbarType));
2340
+ });
2341
+ getValue(this.sortSelectorEnabled, (sortSelectorEnabled) => {
2342
+ this.toolbarDispatcher.next(new ListToolbarConfigSetSortSelectorEnabledAction(sortSelectorEnabled === undefined ? true : sortSelectorEnabled));
2343
+ });
2344
+ this.sortSelectors = this.getSortSelectors();
2345
+ // Initialize the sort toolbar item if necessary
2346
+ this.sortSelectors
2347
+ .pipe(takeUntil(this.ngUnsubscribe), distinctUntilChanged())
2348
+ .subscribe((currentSort) => {
2349
+ if (currentSort.length > 0 && !this.hasSortSelectors) {
2350
+ this.hasSortSelectors = true;
2351
+ this.dispatcher.toolbarAddItems([
2352
+ new ListToolbarItemModel({
2353
+ id: 'sort-selector',
2354
+ template: this.sortSelectorTemplate,
2355
+ location: 'left',
2356
+ index: this.sortSelectorItemToolbarIndex,
2357
+ }),
2358
+ ]);
2359
+ }
2360
+ else if (currentSort.length < 1 && this.hasSortSelectors) {
2361
+ this.hasSortSelectors = false;
2362
+ this.dispatcher.toolbarRemoveItems(['sort-selector']);
2363
+ }
2364
+ });
2365
+ this.searchTextInput = this.state.pipe(takeUntil(this.ngUnsubscribe), map((s) => s.search.searchText), distinctUntilChanged());
2366
+ this.view = this.state.pipe(takeUntil(this.ngUnsubscribe), map((s) => s.views.active), distinctUntilChanged());
2367
+ this.watchTemplates();
2368
+ this.type = this.state.pipe(takeUntil(this.ngUnsubscribe), map((state) => state.toolbar.type), distinctUntilChanged());
2369
+ this.type.pipe(takeUntil(this.ngUnsubscribe)).subscribe((toolbarType) => {
2370
+ if (toolbarType === 'search') {
2371
+ this.dispatcher.toolbarRemoveItems(['search']);
2372
+ }
2373
+ else {
2374
+ this.dispatcher.toolbarAddItems([
2375
+ new ListToolbarItemModel({
2376
+ id: 'search',
2377
+ template: this.searchTemplate,
2378
+ location: 'right',
2379
+ }),
2380
+ ]);
2381
+ }
2382
+ });
2383
+ this.isSearchEnabled = this.toolbarState.pipe(takeUntil(this.ngUnsubscribe), map((s) => s.config), distinctUntilChanged(), map((c) => c.searchEnabled));
2384
+ this.state
2385
+ .pipe(map((s) => s.toolbar), takeUntil(this.ngUnsubscribe), distinctUntilChanged(), map((c) => c.disabled))
2386
+ .subscribe((isDisabled) => (this.isToolbarDisabled = isDisabled));
2387
+ this.isSortSelectorEnabled = this.toolbarState.pipe(takeUntil(this.ngUnsubscribe), map((s) => s.config), distinctUntilChanged(), map((c) => c.sortSelectorEnabled));
2388
+ this.isMultiselectEnabled = this.state.pipe(takeUntil(this.ngUnsubscribe), map((s) => s.toolbar), distinctUntilChanged(), map((t) => t.showMultiselectToolbar));
2389
+ this.hasAppliedFilters = this.state.pipe(takeUntil(this.ngUnsubscribe), map((s) => s.filters), distinctUntilChanged(), map((filters) => {
2390
+ const activeFilters = filters.filter((f) => {
2391
+ return (f.value !== '' &&
2392
+ f.value !== undefined &&
2393
+ f.value !== false &&
2394
+ f.value !== f.defaultValue);
2395
+ });
2396
+ return activeFilters.length > 0;
2397
+ }));
2398
+ this.state.pipe(takeUntil(this.ngUnsubscribe)).subscribe((current) => {
2399
+ this.hasAdditionalToolbarSection = current.toolbar.items.length > 0;
2400
+ this.changeDetector.detectChanges();
2401
+ });
2402
+ }
2403
+ ngAfterContentInit() {
2404
+ // Inject custom toolbar items.
2405
+ this.toolbarItems.forEach((toolbarItem) => {
2406
+ this.dispatcher.toolbarAddItems([new ListToolbarItemModel(toolbarItem)]);
2407
+ this.customItemIds.push(toolbarItem.id);
2408
+ });
2409
+ this.toolbarItems.changes
2410
+ .pipe(takeUntil(this.ngUnsubscribe))
2411
+ .subscribe((newItems) => {
2412
+ newItems.forEach((item) => {
2413
+ if (this.customItemIds.indexOf(item.id) < 0) {
2414
+ this.dispatcher.toolbarAddItems([new ListToolbarItemModel(item)]);
2415
+ this.customItemIds.push(item.id);
2416
+ }
2417
+ });
2418
+ const itemsToRemove = [];
2419
+ this.customItemIds.forEach((itemId, index) => {
2420
+ if (!newItems.find((item) => item.id === itemId)) {
2421
+ itemsToRemove.push(itemId);
2422
+ this.customItemIds.splice(index, 1);
2423
+ }
2424
+ });
2425
+ this.dispatcher.toolbarRemoveItems(itemsToRemove);
2426
+ });
2427
+ const sortModels = this.toolbarSorts.map((sort) => new ListSortLabelModel({
2428
+ text: sort.label,
2429
+ fieldSelector: sort.field,
2430
+ fieldType: sort.type,
2431
+ global: true,
2432
+ descending: sort.descending,
2433
+ }));
2434
+ this.dispatcher.sortSetGlobal(sortModels);
2435
+ // Add inline filters.
2436
+ this.showFilterSummary = this.filterSummary.length > 0;
2437
+ this.hasInlineFilters = this.inlineFilter.length > 0;
2438
+ if (this.hasInlineFilters) {
2439
+ this.dispatcher.toolbarAddItems([
2440
+ new ListToolbarItemModel({
2441
+ template: this.inlineFilterButtonTemplate,
2442
+ location: 'left',
2443
+ index: this.inlineFiltersItemToolbarIndex,
2444
+ }),
2445
+ ]);
2446
+ }
2447
+ // Check for view actions
2448
+ this.hasViewActions = this.viewActions.length > 0;
2449
+ }
2450
+ ngOnDestroy() {
2451
+ this.searchApplied.complete();
2452
+ this.ngUnsubscribe.next();
2453
+ this.ngUnsubscribe.complete();
2454
+ }
2455
+ setSort(sort) {
2456
+ this.state.pipe(take(1)).subscribe((currentState) => {
2457
+ if (currentState.paging.pageNumber &&
2458
+ currentState.paging.pageNumber !== 1) {
2459
+ this.dispatcher.next(new ListPagingSetPageNumberAction(Number(1)));
2460
+ }
2461
+ this.dispatcher.sortSetFieldSelectors([
2462
+ { fieldSelector: sort.fieldSelector, descending: sort.descending },
2463
+ ]);
2464
+ });
2465
+ }
2466
+ inlineFilterButtonClick() {
2467
+ this.inlineFilterBarExpanded = !this.inlineFilterBarExpanded;
2468
+ }
2469
+ updateSearchText(searchText) {
2470
+ this.searchApplied.next(searchText);
2471
+ if (this.inMemorySearchEnabled) {
2472
+ this.state.pipe(take(1)).subscribe((currentState) => {
2473
+ if (currentState.paging.pageNumber &&
2474
+ currentState.paging.pageNumber !== 1) {
2475
+ this.dispatcher.next(new ListPagingSetPageNumberAction(Number(1)));
2476
+ }
2477
+ this.dispatcher.searchSetText(searchText);
2478
+ });
2479
+ }
2480
+ }
2481
+ itemIsInView(itemView, activeView) {
2482
+ return itemView === undefined || itemView === activeView;
2483
+ }
2484
+ getSortSelectors() {
2485
+ return combineLatest(this.state.pipe(map((s) => s.sort.available), distinctUntilChanged()), this.state.pipe(map((s) => s.sort.global), distinctUntilChanged()), this.state.pipe(map((s) => s.sort.fieldSelectors), distinctUntilChanged()), (available, global, fieldSelectors) => {
2486
+ // Get sorts that are in the global that are not in the available
2487
+ const sorts = global.filter((g) => available.filter((a) => a.fieldSelector === g.fieldSelector)
2488
+ .length === 0);
2489
+ const resultSortSelectors = [...sorts, ...available].map((sortLabels) => {
2490
+ const fs = fieldSelectors.filter((f) => {
2491
+ return (f.fieldSelector === sortLabels.fieldSelector &&
2492
+ f.descending === sortLabels.descending);
2493
+ });
2494
+ let selected = false;
2495
+ if (fs.length > 0) {
2496
+ selected = true;
2497
+ }
2498
+ return {
2499
+ sort: sortLabels,
2500
+ selected: selected,
2501
+ };
2502
+ });
2503
+ return resultSortSelectors;
2504
+ }).pipe(takeUntil(this.ngUnsubscribe));
2505
+ }
2506
+ watchTemplates() {
2507
+ combineLatest(this.state.pipe(map((s) => s.toolbar), distinctUntilChanged()), this.view.pipe(distinctUntilChanged()), (toolbar, view) => {
2508
+ const items = toolbar.items.filter((i) => {
2509
+ return this.itemIsInView(i.view, view);
2510
+ });
2511
+ const templates = {};
2512
+ items.forEach((item) => {
2513
+ templates[item.location] = templates[item.location] || [];
2514
+ templates[item.location].push(item);
2515
+ });
2516
+ return templates;
2517
+ })
2518
+ .pipe(takeUntil(this.ngUnsubscribe))
2519
+ .subscribe((value) => {
2520
+ this.leftTemplates = value.left;
2521
+ this.centerTemplates = value.center;
2522
+ this.rightTemplates = value.right;
2523
+ this.changeDetector.markForCheck();
2524
+ });
2525
+ }
2526
+ }
2527
+ SkyListToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: ListState }, { token: ListStateDispatcher }, { token: ListToolbarState }, { token: ListToolbarStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
2528
+ SkyListToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyListToolbarComponent, selector: "sky-list-toolbar", inputs: { inMemorySearchEnabled: "inMemorySearchEnabled", placeholder: "placeholder", searchEnabled: "searchEnabled", sortSelectorEnabled: "sortSelectorEnabled", toolbarType: "toolbarType", searchText: "searchText" }, providers: [
2529
+ ListToolbarState,
2530
+ ListToolbarStateDispatcher,
2531
+ ListToolbarStateModel,
2532
+ ], queries: [{ propertyName: "toolbarItems", predicate: SkyListToolbarItemComponent }, { propertyName: "toolbarSorts", predicate: SkyListToolbarSortComponent }, { propertyName: "filterSummary", predicate: SkyListFilterSummaryComponent }, { propertyName: "inlineFilter", predicate: SkyListFilterInlineComponent }, { propertyName: "viewActions", predicate: SkyListToolbarViewActionsComponent }], viewQueries: [{ propertyName: "searchComponent", first: true, predicate: SkySearchComponent, descendants: true, read: SkySearchComponent }, { propertyName: "searchTemplate", first: true, predicate: ["search"], descendants: true, read: TemplateRef, static: true }, { propertyName: "sortSelectorTemplate", first: true, predicate: ["sortSelector"], descendants: true, read: TemplateRef, static: true }, { propertyName: "inlineFilterButtonTemplate", first: true, predicate: ["inlineFilterButton"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<div class=\"sky-list-toolbar-container\">\n <sky-toolbar *ngIf=\"(type | async) !== 'search'\">\n <sky-toolbar-section>\n <sky-toolbar-item *ngFor=\"let item of leftTemplates\">\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item *ngFor=\"let item of centerTemplates\">\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item\n *ngFor=\"let item of rightTemplates\"\n [attr.sky-toolbar-id]=\"item.id\"\n >\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n\n <ng-content></ng-content>\n\n <sky-toolbar-view-actions *ngIf=\"hasViewActions\">\n <ng-content select=\"sky-list-toolbar-view-actions\"> </ng-content>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n\n <sky-toolbar-section\n *ngIf=\"showFilterSummary && (hasAppliedFilters | async)\"\n >\n <ng-content select=\"sky-list-filter-summary\"> </ng-content>\n </sky-toolbar-section>\n </sky-toolbar>\n\n <div\n *ngIf=\"\n (type | async) === 'search' &&\n ((isSearchEnabled | async) || hasAdditionalToolbarSection)\n \"\n class=\"sky-list-toolbar-search\"\n >\n <sky-toolbar>\n <sky-toolbar-section *ngIf=\"isSearchEnabled | async\">\n <sky-toolbar-item>\n <sky-list-toolbar-item-renderer\n sky-cmp-id=\"search\"\n [template]=\"search\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n </sky-toolbar-section>\n <sky-toolbar-section [hidden]=\"!hasAdditionalToolbarSection\">\n <sky-toolbar-item *ngFor=\"let item of leftTemplates\">\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item *ngFor=\"let item of centerTemplates\">\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item\n *ngFor=\"let item of rightTemplates\"\n [attr.sky-toolbar-id]=\"item.id\"\n >\n <sky-list-toolbar-item-renderer\n *ngIf=\"item.id !== 'search'\"\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <ng-content></ng-content>\n\n <sky-toolbar-view-actions *ngIf=\"hasViewActions\">\n <ng-content select=\"sky-list-toolbar-view-actions\"> </ng-content>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n </div>\n <div\n *ngIf=\"isFilterBarDisplayed\"\n [attr.aria-labelledby]=\"filterButtonId\"\n [id]=\"listFilterInlineId\"\n >\n <ng-content select=\"sky-list-filter-inline\"> </ng-content>\n </div>\n <sky-list-multiselect-toolbar *ngIf=\"isMultiselectEnabled | async\">\n </sky-list-multiselect-toolbar>\n</div>\n\n<ng-template #search>\n <div *ngIf=\"isSearchEnabled | async\" class=\"sky-list-toolbar-search-wrapper\">\n <sky-search\n [disabled]=\"isToolbarDisabled\"\n [expandMode]=\"(type | async) === 'search' ? 'fit' : 'responsive'\"\n [placeholderText]=\"placeholder\"\n [searchText]=\"searchTextInput | async\"\n (searchApply)=\"updateSearchText($event)\"\n >\n </sky-search>\n <ng-content select=\"sky-list-toolbar-search-actions\"></ng-content>\n </div>\n</ng-template>\n\n<ng-template #sortSelector>\n <div\n *ngIf=\"\n (isSortSelectorEnabled | async) && (sortSelectors | async).length > 0\n \"\n class=\"sky-toolbar-item-sort-container\"\n >\n <sky-sort [showButtonText]=\"true\">\n <sky-sort-item\n *ngFor=\"let item of sortSelectors | async\"\n [active]=\"item.selected\"\n (itemSelect)=\"setSort(item.sort)\"\n >\n {{ item.sort.text }}\n </sky-sort-item>\n </sky-sort>\n </div>\n</ng-template>\n\n<ng-template #inlineFilterButton>\n <sky-filter-button\n [active]=\"hasAppliedFilters | async\"\n [ariaControls]=\"filterButtonAriaControls\"\n [ariaExpanded]=\"inlineFilterBarExpanded\"\n [disabled]=\"isToolbarDisabled\"\n [filterButtonId]=\"filterButtonId\"\n [showButtonText]=\"true\"\n (filterButtonClick)=\"inlineFilterButtonClick()\"\n >\n </sky-filter-button>\n</ng-template>\n", styles: [".sky-list-toolbar-search-wrapper{display:flex}.sky-list-toolbar-search-wrapper ::ng-deep .sky-search-dismiss-absolute{padding:0;position:static}.sky-list-toolbar-search-wrapper ::ng-deep .sky-search-container{position:relative;height:100%}.sky-list-toolbar-search-wrapper ::ng-deep sky-search{flex:1 1 auto}.sky-list-toolbar-search-wrapper ::ng-deep sky-list-toolbar-search-actions{flex:0 0 auto;z-index:1}.sky-list-toolbar-container ::ng-deep .sky-toolbar-section-items sky-toolbar-item{flex:0 1 auto;align-self:flex-start}.sky-list-toolbar-search ::ng-deep .sky-toolbar-section{padding-top:0}.sky-list-toolbar-search ::ng-deep .sky-toolbar-section-items{display:block;width:100%}.sky-list-toolbar-search ::ng-deep .sky-toolbar-item{margin:0}.sky-list-toolbar-search ::ng-deep .sky-toolbar-container,.sky-list-toolbar-search ::ng-deep .sky-search-dismiss-absolute{background-color:#eeeeef}.sky-list-toolbar-search ::ng-deep input[type=text]:disabled,.sky-list-toolbar-search ::ng-deep .sky-search-btn:disabled{background-color:#cdcfd2;opacity:1}.sky-list-toolbar-container ::ng-deep sky-toolbar-item[sky-toolbar-id=sort-selector] .sky-toolbar-item{margin-right:0}.sky-list-toolbar-container ::ng-deep sky-checkbox{position:relative;top:-2px}\n"], components: [{ type: i3$2.λ37, selector: "sky-toolbar" }, { type: i3$2.λ38, selector: "sky-toolbar-section" }, { type: i3$2.λ39, selector: "sky-toolbar-item" }, { type: SkyListToolbarItemRendererComponent, selector: "sky-list-toolbar-item-renderer", inputs: ["template"] }, { type: i3$2.λ40, selector: "sky-toolbar-view-actions" }, { type: SkyListMultiselectToolbarComponent, selector: "sky-list-multiselect-toolbar", inputs: ["showOnlySelected"] }, { type: i8.SkySearchComponent, selector: "sky-search", inputs: ["searchText", "expandMode", "debounceTime", "disabled", "placeholderText"], outputs: ["searchApply", "searchChange", "searchClear"] }, { type: i3.λ14, selector: "sky-sort", inputs: ["showButtonText"] }, { type: i3.λ13, selector: "sky-sort-item", inputs: ["active"], outputs: ["itemSelect"] }, { type: i3.λ1, selector: "sky-filter-button", inputs: ["filterButtonId", "ariaControls", "ariaExpanded", "active", "disabled", "showButtonText"], outputs: ["filterButtonClick"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarComponent, decorators: [{
2534
+ type: Component,
2535
+ args: [{ selector: 'sky-list-toolbar', providers: [
2536
+ ListToolbarState,
2537
+ ListToolbarStateDispatcher,
2538
+ ListToolbarStateModel,
2539
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sky-list-toolbar-container\">\n <sky-toolbar *ngIf=\"(type | async) !== 'search'\">\n <sky-toolbar-section>\n <sky-toolbar-item *ngFor=\"let item of leftTemplates\">\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item *ngFor=\"let item of centerTemplates\">\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item\n *ngFor=\"let item of rightTemplates\"\n [attr.sky-toolbar-id]=\"item.id\"\n >\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n\n <ng-content></ng-content>\n\n <sky-toolbar-view-actions *ngIf=\"hasViewActions\">\n <ng-content select=\"sky-list-toolbar-view-actions\"> </ng-content>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n\n <sky-toolbar-section\n *ngIf=\"showFilterSummary && (hasAppliedFilters | async)\"\n >\n <ng-content select=\"sky-list-filter-summary\"> </ng-content>\n </sky-toolbar-section>\n </sky-toolbar>\n\n <div\n *ngIf=\"\n (type | async) === 'search' &&\n ((isSearchEnabled | async) || hasAdditionalToolbarSection)\n \"\n class=\"sky-list-toolbar-search\"\n >\n <sky-toolbar>\n <sky-toolbar-section *ngIf=\"isSearchEnabled | async\">\n <sky-toolbar-item>\n <sky-list-toolbar-item-renderer\n sky-cmp-id=\"search\"\n [template]=\"search\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n </sky-toolbar-section>\n <sky-toolbar-section [hidden]=\"!hasAdditionalToolbarSection\">\n <sky-toolbar-item *ngFor=\"let item of leftTemplates\">\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item *ngFor=\"let item of centerTemplates\">\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item\n *ngFor=\"let item of rightTemplates\"\n [attr.sky-toolbar-id]=\"item.id\"\n >\n <sky-list-toolbar-item-renderer\n *ngIf=\"item.id !== 'search'\"\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <ng-content></ng-content>\n\n <sky-toolbar-view-actions *ngIf=\"hasViewActions\">\n <ng-content select=\"sky-list-toolbar-view-actions\"> </ng-content>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n </div>\n <div\n *ngIf=\"isFilterBarDisplayed\"\n [attr.aria-labelledby]=\"filterButtonId\"\n [id]=\"listFilterInlineId\"\n >\n <ng-content select=\"sky-list-filter-inline\"> </ng-content>\n </div>\n <sky-list-multiselect-toolbar *ngIf=\"isMultiselectEnabled | async\">\n </sky-list-multiselect-toolbar>\n</div>\n\n<ng-template #search>\n <div *ngIf=\"isSearchEnabled | async\" class=\"sky-list-toolbar-search-wrapper\">\n <sky-search\n [disabled]=\"isToolbarDisabled\"\n [expandMode]=\"(type | async) === 'search' ? 'fit' : 'responsive'\"\n [placeholderText]=\"placeholder\"\n [searchText]=\"searchTextInput | async\"\n (searchApply)=\"updateSearchText($event)\"\n >\n </sky-search>\n <ng-content select=\"sky-list-toolbar-search-actions\"></ng-content>\n </div>\n</ng-template>\n\n<ng-template #sortSelector>\n <div\n *ngIf=\"\n (isSortSelectorEnabled | async) && (sortSelectors | async).length > 0\n \"\n class=\"sky-toolbar-item-sort-container\"\n >\n <sky-sort [showButtonText]=\"true\">\n <sky-sort-item\n *ngFor=\"let item of sortSelectors | async\"\n [active]=\"item.selected\"\n (itemSelect)=\"setSort(item.sort)\"\n >\n {{ item.sort.text }}\n </sky-sort-item>\n </sky-sort>\n </div>\n</ng-template>\n\n<ng-template #inlineFilterButton>\n <sky-filter-button\n [active]=\"hasAppliedFilters | async\"\n [ariaControls]=\"filterButtonAriaControls\"\n [ariaExpanded]=\"inlineFilterBarExpanded\"\n [disabled]=\"isToolbarDisabled\"\n [filterButtonId]=\"filterButtonId\"\n [showButtonText]=\"true\"\n (filterButtonClick)=\"inlineFilterButtonClick()\"\n >\n </sky-filter-button>\n</ng-template>\n", styles: [".sky-list-toolbar-search-wrapper{display:flex}.sky-list-toolbar-search-wrapper ::ng-deep .sky-search-dismiss-absolute{padding:0;position:static}.sky-list-toolbar-search-wrapper ::ng-deep .sky-search-container{position:relative;height:100%}.sky-list-toolbar-search-wrapper ::ng-deep sky-search{flex:1 1 auto}.sky-list-toolbar-search-wrapper ::ng-deep sky-list-toolbar-search-actions{flex:0 0 auto;z-index:1}.sky-list-toolbar-container ::ng-deep .sky-toolbar-section-items sky-toolbar-item{flex:0 1 auto;align-self:flex-start}.sky-list-toolbar-search ::ng-deep .sky-toolbar-section{padding-top:0}.sky-list-toolbar-search ::ng-deep .sky-toolbar-section-items{display:block;width:100%}.sky-list-toolbar-search ::ng-deep .sky-toolbar-item{margin:0}.sky-list-toolbar-search ::ng-deep .sky-toolbar-container,.sky-list-toolbar-search ::ng-deep .sky-search-dismiss-absolute{background-color:#eeeeef}.sky-list-toolbar-search ::ng-deep input[type=text]:disabled,.sky-list-toolbar-search ::ng-deep .sky-search-btn:disabled{background-color:#cdcfd2;opacity:1}.sky-list-toolbar-container ::ng-deep sky-toolbar-item[sky-toolbar-id=sort-selector] .sky-toolbar-item{margin-right:0}.sky-list-toolbar-container ::ng-deep sky-checkbox{position:relative;top:-2px}\n"] }]
2540
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: ListState }, { type: ListStateDispatcher }, { type: ListToolbarState }, { type: ListToolbarStateDispatcher }]; }, propDecorators: { inMemorySearchEnabled: [{
2541
+ type: Input
2542
+ }], placeholder: [{
2543
+ type: Input
2544
+ }], searchEnabled: [{
2545
+ type: Input
2546
+ }], searchComponent: [{
2547
+ type: ViewChild,
2548
+ args: [SkySearchComponent, {
2549
+ read: SkySearchComponent,
2550
+ static: false,
2551
+ }]
2552
+ }], sortSelectorEnabled: [{
2553
+ type: Input
2554
+ }], toolbarType: [{
2555
+ type: Input
2556
+ }], searchText: [{
2557
+ type: Input
2558
+ }], toolbarItems: [{
2559
+ type: ContentChildren,
2560
+ args: [SkyListToolbarItemComponent]
2561
+ }], toolbarSorts: [{
2562
+ type: ContentChildren,
2563
+ args: [SkyListToolbarSortComponent]
2564
+ }], filterSummary: [{
2565
+ type: ContentChildren,
2566
+ args: [SkyListFilterSummaryComponent]
2567
+ }], inlineFilter: [{
2568
+ type: ContentChildren,
2569
+ args: [SkyListFilterInlineComponent]
2570
+ }], viewActions: [{
2571
+ type: ContentChildren,
2572
+ args: [SkyListToolbarViewActionsComponent]
2573
+ }], searchTemplate: [{
2574
+ type: ViewChild,
2575
+ args: ['search', {
2576
+ read: TemplateRef,
2577
+ static: true,
2578
+ }]
2579
+ }], sortSelectorTemplate: [{
2580
+ type: ViewChild,
2581
+ args: ['sortSelector', {
2582
+ read: TemplateRef,
2583
+ static: true,
2584
+ }]
2585
+ }], inlineFilterButtonTemplate: [{
2586
+ type: ViewChild,
2587
+ args: ['inlineFilterButton', {
2588
+ read: TemplateRef,
2589
+ static: true,
2590
+ }]
2591
+ }] } });
2592
+
2593
+ class SkyListToolbarModule {
2594
+ }
2595
+ SkyListToolbarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2596
+ SkyListToolbarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarModule, declarations: [SkyListToolbarComponent,
2597
+ SkyListToolbarItemComponent,
2598
+ SkyListToolbarItemRendererComponent,
2599
+ SkyListMultiselectToolbarComponent,
2600
+ SkyListToolbarSearchActionsComponent,
2601
+ SkyListToolbarSortComponent,
2602
+ SkyListToolbarViewActionsComponent], imports: [CommonModule,
2603
+ SkyCheckboxModule,
2604
+ SkyI18nModule,
2605
+ SkyToolbarModule,
2606
+ SkySearchModule,
2607
+ SkySortModule,
2608
+ SkyFilterModule,
2609
+ SkyListFiltersModule,
2610
+ SkyIconModule,
2611
+ SkyListBuilderResourcesModule], exports: [SkyListToolbarComponent,
2612
+ SkyListToolbarItemComponent,
2613
+ SkyListToolbarSearchActionsComponent,
2614
+ SkyListToolbarSortComponent,
2615
+ SkyListToolbarViewActionsComponent] });
2616
+ SkyListToolbarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarModule, imports: [[
2617
+ CommonModule,
2618
+ SkyCheckboxModule,
2619
+ SkyI18nModule,
2620
+ SkyToolbarModule,
2621
+ SkySearchModule,
2622
+ SkySortModule,
2623
+ SkyFilterModule,
2624
+ SkyListFiltersModule,
2625
+ SkyIconModule,
2626
+ SkyListBuilderResourcesModule,
2627
+ ]] });
2628
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyListToolbarModule, decorators: [{
2629
+ type: NgModule,
2630
+ args: [{
2631
+ declarations: [
2632
+ SkyListToolbarComponent,
2633
+ SkyListToolbarItemComponent,
2634
+ SkyListToolbarItemRendererComponent,
2635
+ SkyListMultiselectToolbarComponent,
2636
+ SkyListToolbarSearchActionsComponent,
2637
+ SkyListToolbarSortComponent,
2638
+ SkyListToolbarViewActionsComponent,
2639
+ ],
2640
+ imports: [
2641
+ CommonModule,
2642
+ SkyCheckboxModule,
2643
+ SkyI18nModule,
2644
+ SkyToolbarModule,
2645
+ SkySearchModule,
2646
+ SkySortModule,
2647
+ SkyFilterModule,
2648
+ SkyListFiltersModule,
2649
+ SkyIconModule,
2650
+ SkyListBuilderResourcesModule,
2651
+ ],
2652
+ exports: [
2653
+ SkyListToolbarComponent,
2654
+ SkyListToolbarItemComponent,
2655
+ SkyListToolbarSearchActionsComponent,
2656
+ SkyListToolbarSortComponent,
2657
+ SkyListToolbarViewActionsComponent,
2658
+ ],
2659
+ }]
2660
+ }] });
2661
+
2662
+ /**
2663
+ * Generated bundle index. Do not edit.
2664
+ */
2665
+
2666
+ export { ListDataProvider, ListDataRequestModel, ListDataResponseModel, ListFilterModel, ListFiltersOrchestrator, ListFiltersUpdateAction, ListItemsLoadAction, ListItemsOrchestrator, ListItemsSetLoadingAction, ListItemsSetSelectedAction, ListPagingModel, ListPagingOrchestrator, ListPagingSetItemsPerPageAction, ListPagingSetMaxPagesAction, ListPagingSetPageNumberAction, ListSearchModel, ListSearchOrchestrator, ListSearchSetFieldSelectorsAction, ListSearchSetFunctionsAction, ListSearchSetOptionsAction, ListSearchSetSearchTextAction, ListSelectedLoadAction, ListSelectedModel, ListSelectedOrchestrator, ListSelectedSetItemSelectedAction, ListSelectedSetItemsSelectedAction, ListSelectedSetLoadingAction, ListSortLabelModel, ListSortModel, ListSortOrchestrator, ListSortSetAvailableAction, ListSortSetFieldSelectorsAction, ListSortSetGlobalAction, ListState, ListStateDispatcher, ListStateModel, ListStateOrchestrator, ListToolbarItemModel, ListToolbarItemsDisableAction, ListToolbarItemsLoadAction, ListToolbarItemsRemoveAction, ListToolbarModel, ListToolbarOrchestrator, ListToolbarSetExistsAction, ListToolbarSetTypeAction, ListToolbarShowMultiselectToolbarAction, ListViewComponent, ListViewModel, ListViewsLoadAction, ListViewsModel, ListViewsOrchestrator, ListViewsSetActiveAction, SkyListComponent, SkyListFilterInlineModel, SkyListFiltersModule, SkyListInMemoryDataProvider, SkyListModule, SkyListPagingModule, SkyListSecondaryActionsComponent, SkyListSecondaryActionsModule, SkyListToolbarComponent, SkyListToolbarModule, SkyListFilterButtonComponent as λ1, SkyListToolbarViewActionsComponent as λ10, SkyListToolbarSearchActionsComponent as λ11, SkyListFilterSummaryComponent as λ2, SkyListFilterInlineItemComponent as λ3, SkyListFilterInlineComponent as λ4, SkyListPagingComponent as λ5, SkyListSecondaryActionComponent as λ6, SkyListSecondaryActionsComponent as λ7, SkyListToolbarItemComponent as λ8, SkyListToolbarSortComponent as λ9 };
2667
+ //# sourceMappingURL=skyux-list-builder.mjs.map