@theseam/ui-common 0.2.11 → 0.2.15

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 (352) hide show
  1. package/assets/vendor/intl-tel-input/js/utils.js +255 -254
  2. package/bundles/theseam-ui-common-asset-reader.umd.js +7 -9
  3. package/bundles/theseam-ui-common-asset-reader.umd.js.map +1 -1
  4. package/bundles/theseam-ui-common-breadcrumbs.umd.js +6 -8
  5. package/bundles/theseam-ui-common-breadcrumbs.umd.js.map +1 -1
  6. package/bundles/theseam-ui-common-buttons.umd.js +5 -5
  7. package/bundles/theseam-ui-common-buttons.umd.js.map +1 -1
  8. package/bundles/theseam-ui-common-card.umd.js +6 -6
  9. package/bundles/theseam-ui-common-card.umd.js.map +1 -1
  10. package/bundles/theseam-ui-common-checkbox.umd.js +4 -4
  11. package/bundles/theseam-ui-common-checkbox.umd.js.map +1 -1
  12. package/bundles/theseam-ui-common-confirm-dialog.umd.js +4 -4
  13. package/bundles/theseam-ui-common-confirm-dialog.umd.js.map +1 -1
  14. package/bundles/theseam-ui-common-core.umd.js +4 -4
  15. package/bundles/theseam-ui-common-core.umd.js.map +1 -1
  16. package/bundles/theseam-ui-common-data-exporter.umd.js +5 -5
  17. package/bundles/theseam-ui-common-data-filters.umd.js +9 -6
  18. package/bundles/theseam-ui-common-data-filters.umd.js.map +1 -1
  19. package/bundles/theseam-ui-common-datatable-dynamic.umd.js +7 -7
  20. package/bundles/theseam-ui-common-datatable-dynamic.umd.js.map +1 -1
  21. package/bundles/theseam-ui-common-datatable.umd.js +1314 -378
  22. package/bundles/theseam-ui-common-datatable.umd.js.map +1 -1
  23. package/bundles/theseam-ui-common-dynamic-component-loader.umd.js +5 -7
  24. package/bundles/theseam-ui-common-dynamic-component-loader.umd.js.map +1 -1
  25. package/bundles/theseam-ui-common-dynamic.umd.js +7 -9
  26. package/bundles/theseam-ui-common-dynamic.umd.js.map +1 -1
  27. package/bundles/theseam-ui-common-footer-bar.umd.js +3 -3
  28. package/bundles/theseam-ui-common-form-field-error.umd.js +5 -5
  29. package/bundles/theseam-ui-common-form-field-error.umd.js.map +1 -1
  30. package/bundles/theseam-ui-common-form-field.umd.js +5 -5
  31. package/bundles/theseam-ui-common-form-field.umd.js.map +1 -1
  32. package/bundles/theseam-ui-common-framework.umd.js +27 -29
  33. package/bundles/theseam-ui-common-framework.umd.js.map +1 -1
  34. package/bundles/theseam-ui-common-graphql.umd.js +958 -8
  35. package/bundles/theseam-ui-common-graphql.umd.js.map +1 -1
  36. package/bundles/theseam-ui-common-icon.umd.js +5 -5
  37. package/bundles/theseam-ui-common-icon.umd.js.map +1 -1
  38. package/bundles/theseam-ui-common-layout.umd.js +5 -7
  39. package/bundles/theseam-ui-common-layout.umd.js.map +1 -1
  40. package/bundles/theseam-ui-common-loading.umd.js +4 -4
  41. package/bundles/theseam-ui-common-menu.umd.js +5 -5
  42. package/bundles/theseam-ui-common-menu.umd.js.map +1 -1
  43. package/bundles/theseam-ui-common-modal.umd.js +6 -6
  44. package/bundles/theseam-ui-common-modal.umd.js.map +1 -1
  45. package/bundles/theseam-ui-common-models.umd.js +3 -3
  46. package/bundles/theseam-ui-common-popover.umd.js +4 -4
  47. package/bundles/theseam-ui-common-progress.umd.js +5 -5
  48. package/bundles/theseam-ui-common-progress.umd.js.map +1 -1
  49. package/bundles/theseam-ui-common-scrollbar.umd.js +7 -9
  50. package/bundles/theseam-ui-common-scrollbar.umd.js.map +1 -1
  51. package/bundles/theseam-ui-common-services.umd.js +6 -8
  52. package/bundles/theseam-ui-common-services.umd.js.map +1 -1
  53. package/bundles/theseam-ui-common-shared.umd.js +4 -4
  54. package/bundles/theseam-ui-common-shared.umd.js.map +1 -1
  55. package/bundles/theseam-ui-common-storage.umd.js +5 -7
  56. package/bundles/theseam-ui-common-storage.umd.js.map +1 -1
  57. package/bundles/theseam-ui-common-story-helpers.umd.js +4 -4
  58. package/bundles/theseam-ui-common-story-helpers.umd.js.map +1 -1
  59. package/bundles/theseam-ui-common-tabbed.umd.js +5 -5
  60. package/bundles/theseam-ui-common-tabbed.umd.js.map +1 -1
  61. package/bundles/theseam-ui-common-table-cell-type.umd.js +5 -7
  62. package/bundles/theseam-ui-common-table-cell-type.umd.js.map +1 -1
  63. package/bundles/theseam-ui-common-table-cell-types.umd.js +258 -32
  64. package/bundles/theseam-ui-common-table-cell-types.umd.js.map +1 -1
  65. package/bundles/theseam-ui-common-table.umd.js +5 -5
  66. package/bundles/theseam-ui-common-table.umd.js.map +1 -1
  67. package/bundles/theseam-ui-common-tel-input.umd.js +6 -6
  68. package/bundles/theseam-ui-common-tel-input.umd.js.map +1 -1
  69. package/bundles/theseam-ui-common-testing.umd.js +568 -0
  70. package/bundles/theseam-ui-common-testing.umd.js.map +1 -0
  71. package/bundles/theseam-ui-common-tiled-select.umd.js +56 -39
  72. package/bundles/theseam-ui-common-tiled-select.umd.js.map +1 -1
  73. package/bundles/theseam-ui-common-toggle-edit.umd.js +8 -10
  74. package/bundles/theseam-ui-common-toggle-edit.umd.js.map +1 -1
  75. package/bundles/theseam-ui-common-toggle-group.umd.js +4 -4
  76. package/bundles/theseam-ui-common-toggle-group.umd.js.map +1 -1
  77. package/bundles/theseam-ui-common-unsaved-changes-dialog.umd.js +5 -7
  78. package/bundles/theseam-ui-common-unsaved-changes-dialog.umd.js.map +1 -1
  79. package/bundles/theseam-ui-common-utils.umd.js +174 -81
  80. package/bundles/theseam-ui-common-utils.umd.js.map +1 -1
  81. package/bundles/theseam-ui-common-validators.umd.js +3 -3
  82. package/bundles/theseam-ui-common-viewers.umd.js +6 -8
  83. package/bundles/theseam-ui-common-viewers.umd.js.map +1 -1
  84. package/bundles/theseam-ui-common-widget.umd.js +18 -20
  85. package/bundles/theseam-ui-common-widget.umd.js.map +1 -1
  86. package/bundles/theseam-ui-common.umd.js +2 -2
  87. package/buttons/theseam-ui-common-buttons.metadata.json +1 -1
  88. package/card/theseam-ui-common-card.metadata.json +1 -1
  89. package/data-filters/data-filter.d.ts +10 -6
  90. package/data-filters/theseam-ui-common-data-filters.metadata.json +1 -1
  91. package/datatable/datatable/datatable.component.d.ts +46 -32
  92. package/datatable/datatable-column/datatable-column.component.d.ts +26 -25
  93. package/datatable/datatable-column-preferences/datatable-column-preferences.component.d.ts +7 -5
  94. package/datatable/datatable-column-preferences-button/datatable-column-preferences-button.component.d.ts +7 -1
  95. package/datatable/datatable-menu-bar/datatable-menu-bar.component.d.ts +1 -1
  96. package/datatable/directives/datatable-filter.directive.d.ts +1 -1
  97. package/datatable/models/columns-alteration.d.ts +61 -0
  98. package/datatable/models/columns-alterations/hide-column.columns-alteration.d.ts +15 -0
  99. package/datatable/models/columns-alterations/order.columns-alteration.d.ts +20 -0
  100. package/datatable/models/columns-alterations/sort.columns-alteration.d.ts +14 -0
  101. package/datatable/models/columns-alterations/width.columns-alteration.d.ts +16 -0
  102. package/datatable/models/datatable-accessor.d.ts +5 -3
  103. package/datatable/models/internal-column-props.d.ts +7 -0
  104. package/datatable/models/page-info.d.ts +12 -0
  105. package/datatable/models/preferences-accessor.d.ts +1 -1
  106. package/datatable/models/preferences.d.ts +11 -3
  107. package/datatable/models/sort-item.d.ts +2 -1
  108. package/datatable/services/columns-alterations-manager.service.d.ts +39 -0
  109. package/datatable/services/columns-manager.service.d.ts +55 -0
  110. package/datatable/services/datatable-preferences.service.d.ts +10 -7
  111. package/datatable/theseam-ui-common-datatable.d.ts +2 -0
  112. package/datatable/theseam-ui-common-datatable.metadata.json +1 -1
  113. package/datatable/tokens/datatable-preferences-accessor.d.ts +2 -2
  114. package/datatable/utils/create-action-menu-column.d.ts +3 -0
  115. package/datatable/utils/create-checkbox-column.d.ts +3 -0
  116. package/datatable/utils/get-column-prop.d.ts +5 -0
  117. package/datatable/utils/map-columns-alterations-states.d.ts +2 -0
  118. package/datatable/utils/remove-unused-diffs.d.ts +7 -0
  119. package/datatable/utils/set-column-defaults.d.ts +2 -0
  120. package/datatable/utils/translate-templates.d.ts +2 -0
  121. package/datatable/utils/with-stored-column-info.d.ts +2 -2
  122. package/datatable-dynamic/theseam-ui-common-datatable-dynamic.metadata.json +1 -1
  123. package/esm2015/buttons/progress-circle-button/progress-circle-button.component.js +1 -1
  124. package/esm2015/card/card-action/card-action.component.js +1 -1
  125. package/esm2015/card/card-body/card-body.component.js +1 -1
  126. package/esm2015/data-filters/data-filter.js +5 -2
  127. package/esm2015/data-filters/filters/data-filter-search/data-filter-search.component.js +1 -1
  128. package/esm2015/data-filters/filters/data-filter-text/data-filter-text.component.js +1 -1
  129. package/esm2015/datatable/datatable/datatable.component.js +195 -211
  130. package/esm2015/datatable/datatable-action-menu/datatable-action-menu.component.js +1 -1
  131. package/esm2015/datatable/datatable-column/datatable-column.component.js +1 -1
  132. package/esm2015/datatable/datatable-column-preferences/datatable-column-preferences.component.js +42 -19
  133. package/esm2015/datatable/datatable-column-preferences-button/datatable-column-preferences-button.component.js +38 -4
  134. package/esm2015/datatable/datatable-export-button/datatable-export-button.component.js +9 -6
  135. package/esm2015/datatable/datatable-menu-bar/datatable-menu-bar.component.js +1 -1
  136. package/esm2015/datatable/datatable-menu-bar-column-center/datatable-menu-bar-column-center.component.js +1 -1
  137. package/esm2015/datatable/datatable-menu-bar-column-left/datatable-menu-bar-column-left.component.js +1 -1
  138. package/esm2015/datatable/datatable-menu-bar-column-right/datatable-menu-bar-column-right.component.js +1 -1
  139. package/esm2015/datatable/datatable-menu-bar-row/datatable-menu-bar-row.component.js +1 -1
  140. package/esm2015/datatable/models/columns-alteration.js +38 -0
  141. package/esm2015/datatable/models/columns-alterations/hide-column.columns-alteration.js +38 -0
  142. package/esm2015/datatable/models/columns-alterations/order.columns-alteration.js +81 -0
  143. package/esm2015/datatable/models/columns-alterations/sort.columns-alteration.js +33 -0
  144. package/esm2015/datatable/models/columns-alterations/width.columns-alteration.js +41 -0
  145. package/esm2015/datatable/models/datatable-accessor.js +1 -1
  146. package/esm2015/datatable/models/internal-column-props.js +15 -0
  147. package/esm2015/datatable/models/page-info.js +1 -1
  148. package/esm2015/datatable/models/preferences-accessor.js +1 -1
  149. package/esm2015/datatable/models/preferences.js +6 -2
  150. package/esm2015/datatable/models/sort-item.js +1 -1
  151. package/esm2015/datatable/services/columns-alterations-manager.service.js +134 -0
  152. package/esm2015/datatable/services/columns-manager.service.js +257 -0
  153. package/esm2015/datatable/services/datatable-preferences.service.js +78 -32
  154. package/esm2015/datatable/theseam-ui-common-datatable.js +3 -1
  155. package/esm2015/datatable/tokens/datatable-preferences-accessor.js +2 -2
  156. package/esm2015/datatable/utils/create-action-menu-column.js +18 -0
  157. package/esm2015/datatable/utils/create-checkbox-column.js +15 -0
  158. package/esm2015/datatable/utils/get-column-prop.js +9 -0
  159. package/esm2015/datatable/utils/map-columns-alterations-states.js +39 -0
  160. package/esm2015/datatable/utils/remove-unused-diffs.js +9 -0
  161. package/esm2015/datatable/utils/set-column-defaults.js +10 -0
  162. package/esm2015/datatable/utils/translate-templates.js +12 -0
  163. package/esm2015/datatable/utils/with-stored-column-info.js +1 -1
  164. package/esm2015/datatable-dynamic/datatable-dynamic-action-menu/datatable-dynamic-action-menu.component.js +1 -1
  165. package/esm2015/datatable-dynamic/datatable-dynamic-filter-container/datatable-dynamic-filter-container.component.js +1 -1
  166. package/esm2015/datatable-dynamic/datatable-dynamic.component.js +1 -1
  167. package/esm2015/form-field/form-field.component.js +1 -1
  168. package/esm2015/form-field-error/form-field-error/form-field-error.component.js +1 -1
  169. package/esm2015/framework/base-layout/base-layout.component.js +1 -1
  170. package/esm2015/framework/dashboard/dashboard-widgets/dashboard-widgets.component.js +1 -1
  171. package/esm2015/framework/dynamic-router/hierarchy-router-outlet/hierarchy-router-outlet.component.js +1 -1
  172. package/esm2015/framework/schema-form-controls/schema-form-input/schema-form-input.component.js +1 -1
  173. package/esm2015/framework/schema-form-controls/schema-form-number/schema-form-number.component.js +1 -1
  174. package/esm2015/framework/schema-form-controls/schema-form-select/schema-form-select.component.js +1 -1
  175. package/esm2015/framework/schema-form-controls/schema-form-submit-split/schema-form-submit-split.component.js +1 -1
  176. package/esm2015/framework/side-nav/side-nav-item/side-nav-item.component.js +1 -1
  177. package/esm2015/framework/side-nav/side-nav-toggle/side-nav-toggle.component.js +1 -1
  178. package/esm2015/framework/side-nav/side-nav.component.js +1 -1
  179. package/esm2015/framework/top-bar/top-bar-menu-button/top-bar-menu-button.component.js +1 -1
  180. package/esm2015/framework/top-bar/top-bar-title/top-bar-title.component.js +1 -1
  181. package/esm2015/framework/top-bar/top-bar.component.js +1 -1
  182. package/esm2015/graphql/datatable/create-page-info-observable.js +38 -0
  183. package/esm2015/graphql/datatable/datatable-graphql-query-ref.js +236 -0
  184. package/esm2015/graphql/datatable/datatable-graphql.service.js +35 -0
  185. package/esm2015/graphql/datatable/datatable-helpers.js +170 -0
  186. package/esm2015/graphql/datatable/get-page-info.js +11 -0
  187. package/esm2015/graphql/datatable/index.js +7 -0
  188. package/esm2015/graphql/datatable/map-filter-states.js +64 -0
  189. package/esm2015/graphql/datatable/map-page-info.js +14 -0
  190. package/esm2015/graphql/datatable/mapper-context.js +2 -0
  191. package/esm2015/graphql/models/gql-datatable-accessor.js +2 -0
  192. package/esm2015/graphql/models/index.js +2 -1
  193. package/esm2015/graphql/models/query-processing-config.js +1 -1
  194. package/esm2015/graphql/public-api.js +2 -1
  195. package/esm2015/graphql/utils/parse-hints.js +3 -3
  196. package/esm2015/icon/icon/icon.component.js +1 -1
  197. package/esm2015/loading/loading/loading.component.js +1 -1
  198. package/esm2015/menu/menu.component.js +1 -1
  199. package/esm2015/modal/modal-body/modal-body.component.js +1 -1
  200. package/esm2015/modal/modal-container/modal-container.component.js +1 -1
  201. package/esm2015/popover/popover/popover.component.js +1 -1
  202. package/esm2015/progress/progress-circle/progress-circle.component.js +1 -1
  203. package/esm2015/tabbed/tabbed.component.js +1 -1
  204. package/esm2015/table/table/table.component.js +1 -1
  205. package/esm2015/table-cell-types/public-api.js +8 -1
  206. package/esm2015/table-cell-types/table-cell-type-currency/table-cell-type-currency-config.js +2 -0
  207. package/esm2015/table-cell-types/table-cell-type-currency/table-cell-type-currency.component.js +74 -0
  208. package/esm2015/table-cell-types/table-cell-type-currency/table-cell-type-currency.js +2 -0
  209. package/esm2015/table-cell-types/table-cell-type-decimal/table-cell-type-decimal-config.js +1 -1
  210. package/esm2015/table-cell-types/table-cell-type-decimal/table-cell-type-decimal.component.js +73 -0
  211. package/esm2015/table-cell-types/table-cell-type-decimal/table-cell-type-decimal.js +2 -0
  212. package/esm2015/table-cell-types/table-cell-type-icon/table-cell-type-icon.component.js +1 -1
  213. package/esm2015/table-cell-types/table-cell-type-integer/table-cell-type-integer-config.js +1 -1
  214. package/esm2015/table-cell-types/table-cell-type-integer/table-cell-type-integer.component.js +71 -0
  215. package/esm2015/table-cell-types/table-cell-type-integer/table-cell-type-integer.js +2 -0
  216. package/esm2015/table-cell-types/table-cell-type-manifests.js +29 -17
  217. package/esm2015/table-cell-types/table-cell-type-progress-circle/table-cell-type-progress-circle.component.js +1 -1
  218. package/esm2015/table-cell-types/table-cell-types.module.js +9 -2
  219. package/esm2015/tel-input/tel-input/tel-input.component.js +1 -1
  220. package/esm2015/testing/current-tick-time.js +16 -0
  221. package/esm2015/testing/fake-toastr.js +29 -0
  222. package/esm2015/testing/get-harness.js +16 -0
  223. package/esm2015/testing/public-api.js +7 -0
  224. package/esm2015/testing/render-story.js +12 -0
  225. package/esm2015/testing/story-expect.js +39 -0
  226. package/esm2015/testing/theseam-ui-common-testing.js +5 -0
  227. package/esm2015/testing/tick-helper.js +74 -0
  228. package/esm2015/tiled-select/components/tiled-select/tiled-select.component.js +25 -17
  229. package/esm2015/tiled-select/components/tiled-select-tile/tiled-select-tile.component.js +5 -2
  230. package/esm2015/tiled-select/components/tiled-select-tile-icon/tiled-select-tile-icon.component.js +1 -1
  231. package/esm2015/tiled-select/public-api.js +2 -1
  232. package/esm2015/tiled-select/tiled-select.models.js +1 -1
  233. package/esm2015/tiled-select/tiled-select.module.js +4 -4
  234. package/esm2015/toggle-edit/toggle-edit-actions-container/toggle-edit-actions-container.component.js +1 -1
  235. package/esm2015/toggle-edit/toggle-edit.component.js +1 -1
  236. package/esm2015/utils/array-move.js +62 -0
  237. package/esm2015/utils/public-api.js +2 -1
  238. package/esm2015/utils/router/is-empty-url-route.js +1 -1
  239. package/esm2015/utils/subscriber-count.js +31 -4
  240. package/esm2015/widget/widget/widget.component.js +1 -1
  241. package/esm2015/widget/widget-content-components/widget-button-group/widget-button-group.component.js +1 -1
  242. package/esm2015/widget/widget-content-components/widget-content-header/widget-content-header.component.js +1 -1
  243. package/esm2015/widget/widget-content-components/widget-empty-label/widget-empty-label.component.js +1 -1
  244. package/esm2015/widget/widget-content-components/widget-footer-link/widget-footer-link.component.js +1 -1
  245. package/esm2015/widget/widget-content-components/widget-footer-text/widget-footer-text.component.js +1 -1
  246. package/esm2015/widget/widget-content-components/widget-header-badge/widget-header-badge.component.js +1 -1
  247. package/esm2015/widget/widget-content-components/widget-tile/widget-tile-footer-item/widget-tile-footer-item.component.js +1 -1
  248. package/esm2015/widget/widget-content-components/widget-tile/widget-tile-group/widget-tile-group.component.js +1 -1
  249. package/esm2015/widget/widget-content-components/widget-tile/widget-tile.component.js +1 -1
  250. package/esm2015/widget/widget-content-components/widget-tile-list/widget-tile-list.component.js +1 -1
  251. package/esm2015/widget/widget-footer/widget-footer.component.js +1 -1
  252. package/fesm2015/theseam-ui-common-buttons.js +1 -1
  253. package/fesm2015/theseam-ui-common-card.js +2 -2
  254. package/fesm2015/theseam-ui-common-data-filters.js +6 -3
  255. package/fesm2015/theseam-ui-common-data-filters.js.map +1 -1
  256. package/fesm2015/theseam-ui-common-datatable-dynamic.js +3 -3
  257. package/fesm2015/theseam-ui-common-datatable.js +1106 -319
  258. package/fesm2015/theseam-ui-common-datatable.js.map +1 -1
  259. package/fesm2015/theseam-ui-common-form-field-error.js +1 -1
  260. package/fesm2015/theseam-ui-common-form-field.js +1 -1
  261. package/fesm2015/theseam-ui-common-framework.js +13 -13
  262. package/fesm2015/theseam-ui-common-graphql.js +555 -5
  263. package/fesm2015/theseam-ui-common-graphql.js.map +1 -1
  264. package/fesm2015/theseam-ui-common-icon.js +1 -1
  265. package/fesm2015/theseam-ui-common-loading.js +1 -1
  266. package/fesm2015/theseam-ui-common-menu.js +1 -1
  267. package/fesm2015/theseam-ui-common-modal.js +2 -2
  268. package/fesm2015/theseam-ui-common-popover.js +1 -1
  269. package/fesm2015/theseam-ui-common-progress.js +1 -1
  270. package/fesm2015/theseam-ui-common-tabbed.js +1 -1
  271. package/fesm2015/theseam-ui-common-table-cell-types.js +234 -22
  272. package/fesm2015/theseam-ui-common-table-cell-types.js.map +1 -1
  273. package/fesm2015/theseam-ui-common-table.js +1 -1
  274. package/fesm2015/theseam-ui-common-tel-input.js +1 -1
  275. package/fesm2015/theseam-ui-common-testing.js +191 -0
  276. package/fesm2015/theseam-ui-common-testing.js.map +1 -0
  277. package/fesm2015/theseam-ui-common-tiled-select.js +34 -21
  278. package/fesm2015/theseam-ui-common-tiled-select.js.map +1 -1
  279. package/fesm2015/theseam-ui-common-toggle-edit.js +2 -2
  280. package/fesm2015/theseam-ui-common-utils.js +92 -4
  281. package/fesm2015/theseam-ui-common-utils.js.map +1 -1
  282. package/fesm2015/theseam-ui-common-widget.js +12 -12
  283. package/form-field/theseam-ui-common-form-field.metadata.json +1 -1
  284. package/form-field-error/theseam-ui-common-form-field-error.metadata.json +1 -1
  285. package/framework/theseam-ui-common-framework.metadata.json +1 -1
  286. package/graphql/datatable/create-page-info-observable.d.ts +4 -0
  287. package/graphql/datatable/datatable-graphql-query-ref.d.ts +65 -0
  288. package/graphql/datatable/datatable-graphql.service.d.ts +26 -0
  289. package/graphql/datatable/datatable-helpers.d.ts +12 -0
  290. package/graphql/datatable/get-page-info.d.ts +4 -0
  291. package/graphql/datatable/index.d.ts +6 -0
  292. package/graphql/datatable/map-filter-states.d.ts +18 -0
  293. package/graphql/datatable/map-page-info.d.ts +11 -0
  294. package/graphql/datatable/mapper-context.d.ts +6 -0
  295. package/graphql/models/gql-datatable-accessor.d.ts +9 -0
  296. package/graphql/models/index.d.ts +1 -0
  297. package/graphql/models/query-processing-config.d.ts +4 -0
  298. package/graphql/public-api.d.ts +1 -0
  299. package/graphql/theseam-ui-common-graphql.metadata.json +1 -1
  300. package/icon/theseam-ui-common-icon.metadata.json +1 -1
  301. package/loading/theseam-ui-common-loading.metadata.json +1 -1
  302. package/menu/theseam-ui-common-menu.metadata.json +1 -1
  303. package/modal/theseam-ui-common-modal.metadata.json +1 -1
  304. package/package.json +1 -1
  305. package/popover/theseam-ui-common-popover.metadata.json +1 -1
  306. package/progress/theseam-ui-common-progress.metadata.json +1 -1
  307. package/styles/vendor/ngx-datatable/_ngx-datatable.scss +54 -52
  308. package/tabbed/theseam-ui-common-tabbed.metadata.json +1 -1
  309. package/table/theseam-ui-common-table.metadata.json +1 -1
  310. package/table-cell-types/public-api.d.ts +7 -0
  311. package/table-cell-types/table-cell-type-currency/table-cell-type-currency-config.d.ts +39 -0
  312. package/table-cell-types/table-cell-type-currency/table-cell-type-currency.component.d.ts +19 -0
  313. package/table-cell-types/table-cell-type-currency/table-cell-type-currency.d.ts +3 -0
  314. package/table-cell-types/table-cell-type-decimal/table-cell-type-decimal-config.d.ts +31 -1
  315. package/table-cell-types/table-cell-type-decimal/table-cell-type-decimal.component.d.ts +19 -0
  316. package/table-cell-types/table-cell-type-decimal/table-cell-type-decimal.d.ts +3 -0
  317. package/table-cell-types/table-cell-type-integer/table-cell-type-integer-config.d.ts +23 -1
  318. package/table-cell-types/table-cell-type-integer/table-cell-type-integer.component.d.ts +19 -0
  319. package/table-cell-types/table-cell-type-integer/table-cell-type-integer.d.ts +3 -0
  320. package/table-cell-types/table-cell-type-manifests.d.ts +2 -1
  321. package/table-cell-types/theseam-ui-common-table-cell-types.metadata.json +1 -1
  322. package/tel-input/theseam-ui-common-tel-input.metadata.json +1 -1
  323. package/testing/current-tick-time.d.ts +13 -0
  324. package/testing/fake-toastr.d.ts +30 -0
  325. package/testing/get-harness.d.ts +7 -0
  326. package/testing/package.json +11 -0
  327. package/testing/public-api.d.ts +6 -0
  328. package/testing/render-story.d.ts +2 -0
  329. package/testing/story-expect.d.ts +5 -0
  330. package/{test-helpers/theseam-ui-common-test-helpers.d.ts → testing/theseam-ui-common-testing.d.ts} +0 -0
  331. package/testing/theseam-ui-common-testing.metadata.json +1 -0
  332. package/{test-helpers → testing}/tick-helper.d.ts +0 -0
  333. package/tiled-select/components/tiled-select/tiled-select.component.d.ts +7 -3
  334. package/tiled-select/components/tiled-select-tile/tiled-select-tile.component.d.ts +1 -0
  335. package/tiled-select/theseam-ui-common-tiled-select.metadata.json +1 -1
  336. package/tiled-select/tiled-select.models.d.ts +3 -1
  337. package/toggle-edit/theseam-ui-common-toggle-edit.metadata.json +1 -1
  338. package/utils/array-move.d.ts +49 -0
  339. package/utils/public-api.d.ts +1 -0
  340. package/utils/subscriber-count.d.ts +13 -1
  341. package/utils/theseam-ui-common-utils.metadata.json +1 -1
  342. package/widget/theseam-ui-common-widget.metadata.json +1 -1
  343. package/bundles/theseam-ui-common-test-helpers.umd.js +0 -94
  344. package/bundles/theseam-ui-common-test-helpers.umd.js.map +0 -1
  345. package/esm2015/test-helpers/public-api.js +0 -2
  346. package/esm2015/test-helpers/theseam-ui-common-test-helpers.js +0 -5
  347. package/esm2015/test-helpers/tick-helper.js +0 -74
  348. package/fesm2015/theseam-ui-common-test-helpers.js +0 -81
  349. package/fesm2015/theseam-ui-common-test-helpers.js.map +0 -1
  350. package/test-helpers/package.json +0 -11
  351. package/test-helpers/public-api.d.ts +0 -1
  352. package/test-helpers/theseam-ui-common-test-helpers.metadata.json +0 -1
@@ -1,8 +1,29 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('graphql/language'), require('@angular/core'), require('@theseam/ui-common/utils'), require('graphql')) :
3
- typeof define === 'function' && define.amd ? define('@theseam/ui-common/graphql', ['exports', 'graphql/language', '@angular/core', '@theseam/ui-common/utils', 'graphql'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.theseam = global.theseam || {}, global.theseam['ui-common'] = global.theseam['ui-common'] || {}, global.theseam['ui-common'].graphql = {}), global.language, global.ng.core, global.theseam['ui-common'].utils, global.graphql));
5
- }(this, (function (exports, language, core, utils, graphql) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('graphql/language'), require('@angular/core'), require('@theseam/ui-common/utils'), require('graphql'), require('rxjs'), require('rxjs/operators'), require('apollo-angular'), require('@apollo/client/core')) :
3
+ typeof define === 'function' && define.amd ? define('@theseam/ui-common/graphql', ['exports', 'graphql/language', '@angular/core', '@theseam/ui-common/utils', 'graphql', 'rxjs', 'rxjs/operators', 'apollo-angular', '@apollo/client/core'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.theseam = global.theseam || {}, global.theseam["ui-common"] = global.theseam["ui-common"] || {}, global.theseam["ui-common"].graphql = {}), global.language, global.ng.core, global.theseam["ui-common"].utils, global.graphql, global.rxjs, global.rxjs.operators, global.i1, global.core));
5
+ })(this, (function (exports, language, i0, utils, graphql, rxjs, operators, i1, core) { 'use strict';
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n["default"] = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
+ var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
6
27
 
7
28
  function containsVariable(node, variableName) {
8
29
  var found = false;
@@ -40,7 +61,7 @@
40
61
  // console.log('~inlineVariable', variableName, variableValue)
41
62
  // TODO: Decide if this is a good solution.
42
63
  if (utils.hasProperty(variableValue, 'value') && variableValue.value === 'undefined') {
43
- if (core.isDevMode()) {
64
+ if (i0.isDevMode()) {
44
65
  console.warn("Ignoring attempt to inline '" + variableName + "', because it is undefined.");
45
66
  }
46
67
  return graphql.visit(query, {
@@ -178,7 +199,7 @@
178
199
  };
179
200
  }
180
201
  function getHintsToken(token, ast) {
181
- console.log('getHintsToken', token);
202
+ // console.log('getHintsToken', token)
182
203
  var appliesTo = getTokenAppliesTo(token);
183
204
  if (appliesTo === null) {
184
205
  return null;
@@ -225,7 +246,7 @@
225
246
  }
226
247
  function parseHints(ast) {
227
248
  var _ast = parseAst(ast);
228
- console.log('_ast', _ast);
249
+ // console.log('_ast', _ast)
229
250
  return parseComments(_ast)
230
251
  .filter(isHintToken)
231
252
  .map(function (r) { return getHintsToken(r, _ast); })
@@ -326,15 +347,942 @@
326
347
  return hintsTokens.filter(function (r) { return r.hints.indexOf(hint) !== -1; });
327
348
  }
328
349
 
350
+ /*! *****************************************************************************
351
+ Copyright (c) Microsoft Corporation.
352
+
353
+ Permission to use, copy, modify, and/or distribute this software for any
354
+ purpose with or without fee is hereby granted.
355
+
356
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
357
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
358
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
359
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
360
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
361
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
362
+ PERFORMANCE OF THIS SOFTWARE.
363
+ ***************************************************************************** */
364
+ /* global Reflect, Promise */
365
+ var extendStatics = function (d, b) {
366
+ extendStatics = Object.setPrototypeOf ||
367
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
368
+ function (d, b) { for (var p in b)
369
+ if (Object.prototype.hasOwnProperty.call(b, p))
370
+ d[p] = b[p]; };
371
+ return extendStatics(d, b);
372
+ };
373
+ function __extends(d, b) {
374
+ if (typeof b !== "function" && b !== null)
375
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
376
+ extendStatics(d, b);
377
+ function __() { this.constructor = d; }
378
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
379
+ }
380
+ var __assign = function () {
381
+ __assign = Object.assign || function __assign(t) {
382
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
383
+ s = arguments[i];
384
+ for (var p in s)
385
+ if (Object.prototype.hasOwnProperty.call(s, p))
386
+ t[p] = s[p];
387
+ }
388
+ return t;
389
+ };
390
+ return __assign.apply(this, arguments);
391
+ };
392
+ function __rest(s, e) {
393
+ var t = {};
394
+ for (var p in s)
395
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
396
+ t[p] = s[p];
397
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
398
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
399
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
400
+ t[p[i]] = s[p[i]];
401
+ }
402
+ return t;
403
+ }
404
+ function __decorate(decorators, target, key, desc) {
405
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
406
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
407
+ r = Reflect.decorate(decorators, target, key, desc);
408
+ else
409
+ for (var i = decorators.length - 1; i >= 0; i--)
410
+ if (d = decorators[i])
411
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
412
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
413
+ }
414
+ function __param(paramIndex, decorator) {
415
+ return function (target, key) { decorator(target, key, paramIndex); };
416
+ }
417
+ function __metadata(metadataKey, metadataValue) {
418
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
419
+ return Reflect.metadata(metadataKey, metadataValue);
420
+ }
421
+ function __awaiter(thisArg, _arguments, P, generator) {
422
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
423
+ return new (P || (P = Promise))(function (resolve, reject) {
424
+ function fulfilled(value) { try {
425
+ step(generator.next(value));
426
+ }
427
+ catch (e) {
428
+ reject(e);
429
+ } }
430
+ function rejected(value) { try {
431
+ step(generator["throw"](value));
432
+ }
433
+ catch (e) {
434
+ reject(e);
435
+ } }
436
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
437
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
438
+ });
439
+ }
440
+ function __generator(thisArg, body) {
441
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
442
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
443
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
444
+ function verb(n) { return function (v) { return step([n, v]); }; }
445
+ function step(op) {
446
+ if (f)
447
+ throw new TypeError("Generator is already executing.");
448
+ while (_)
449
+ try {
450
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
451
+ return t;
452
+ if (y = 0, t)
453
+ op = [op[0] & 2, t.value];
454
+ switch (op[0]) {
455
+ case 0:
456
+ case 1:
457
+ t = op;
458
+ break;
459
+ case 4:
460
+ _.label++;
461
+ return { value: op[1], done: false };
462
+ case 5:
463
+ _.label++;
464
+ y = op[1];
465
+ op = [0];
466
+ continue;
467
+ case 7:
468
+ op = _.ops.pop();
469
+ _.trys.pop();
470
+ continue;
471
+ default:
472
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
473
+ _ = 0;
474
+ continue;
475
+ }
476
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
477
+ _.label = op[1];
478
+ break;
479
+ }
480
+ if (op[0] === 6 && _.label < t[1]) {
481
+ _.label = t[1];
482
+ t = op;
483
+ break;
484
+ }
485
+ if (t && _.label < t[2]) {
486
+ _.label = t[2];
487
+ _.ops.push(op);
488
+ break;
489
+ }
490
+ if (t[2])
491
+ _.ops.pop();
492
+ _.trys.pop();
493
+ continue;
494
+ }
495
+ op = body.call(thisArg, _);
496
+ }
497
+ catch (e) {
498
+ op = [6, e];
499
+ y = 0;
500
+ }
501
+ finally {
502
+ f = t = 0;
503
+ }
504
+ if (op[0] & 5)
505
+ throw op[1];
506
+ return { value: op[0] ? op[1] : void 0, done: true };
507
+ }
508
+ }
509
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
510
+ if (k2 === undefined)
511
+ k2 = k;
512
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
513
+ }) : (function (o, m, k, k2) {
514
+ if (k2 === undefined)
515
+ k2 = k;
516
+ o[k2] = m[k];
517
+ });
518
+ function __exportStar(m, o) {
519
+ for (var p in m)
520
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
521
+ __createBinding(o, m, p);
522
+ }
523
+ function __values(o) {
524
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
525
+ if (m)
526
+ return m.call(o);
527
+ if (o && typeof o.length === "number")
528
+ return {
529
+ next: function () {
530
+ if (o && i >= o.length)
531
+ o = void 0;
532
+ return { value: o && o[i++], done: !o };
533
+ }
534
+ };
535
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
536
+ }
537
+ function __read(o, n) {
538
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
539
+ if (!m)
540
+ return o;
541
+ var i = m.call(o), r, ar = [], e;
542
+ try {
543
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
544
+ ar.push(r.value);
545
+ }
546
+ catch (error) {
547
+ e = { error: error };
548
+ }
549
+ finally {
550
+ try {
551
+ if (r && !r.done && (m = i["return"]))
552
+ m.call(i);
553
+ }
554
+ finally {
555
+ if (e)
556
+ throw e.error;
557
+ }
558
+ }
559
+ return ar;
560
+ }
561
+ /** @deprecated */
562
+ function __spread() {
563
+ for (var ar = [], i = 0; i < arguments.length; i++)
564
+ ar = ar.concat(__read(arguments[i]));
565
+ return ar;
566
+ }
567
+ /** @deprecated */
568
+ function __spreadArrays() {
569
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
570
+ s += arguments[i].length;
571
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
572
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
573
+ r[k] = a[j];
574
+ return r;
575
+ }
576
+ function __spreadArray(to, from, pack) {
577
+ if (pack || arguments.length === 2)
578
+ for (var i = 0, l = from.length, ar; i < l; i++) {
579
+ if (ar || !(i in from)) {
580
+ if (!ar)
581
+ ar = Array.prototype.slice.call(from, 0, i);
582
+ ar[i] = from[i];
583
+ }
584
+ }
585
+ return to.concat(ar || Array.prototype.slice.call(from));
586
+ }
587
+ function __await(v) {
588
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
589
+ }
590
+ function __asyncGenerator(thisArg, _arguments, generator) {
591
+ if (!Symbol.asyncIterator)
592
+ throw new TypeError("Symbol.asyncIterator is not defined.");
593
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
594
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
595
+ function verb(n) { if (g[n])
596
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
597
+ function resume(n, v) { try {
598
+ step(g[n](v));
599
+ }
600
+ catch (e) {
601
+ settle(q[0][3], e);
602
+ } }
603
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
604
+ function fulfill(value) { resume("next", value); }
605
+ function reject(value) { resume("throw", value); }
606
+ function settle(f, v) { if (f(v), q.shift(), q.length)
607
+ resume(q[0][0], q[0][1]); }
608
+ }
609
+ function __asyncDelegator(o) {
610
+ var i, p;
611
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
612
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
613
+ }
614
+ function __asyncValues(o) {
615
+ if (!Symbol.asyncIterator)
616
+ throw new TypeError("Symbol.asyncIterator is not defined.");
617
+ var m = o[Symbol.asyncIterator], i;
618
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
619
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
620
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
621
+ }
622
+ function __makeTemplateObject(cooked, raw) {
623
+ if (Object.defineProperty) {
624
+ Object.defineProperty(cooked, "raw", { value: raw });
625
+ }
626
+ else {
627
+ cooked.raw = raw;
628
+ }
629
+ return cooked;
630
+ }
631
+ ;
632
+ var __setModuleDefault = Object.create ? (function (o, v) {
633
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
634
+ }) : function (o, v) {
635
+ o["default"] = v;
636
+ };
637
+ function __importStar(mod) {
638
+ if (mod && mod.__esModule)
639
+ return mod;
640
+ var result = {};
641
+ if (mod != null)
642
+ for (var k in mod)
643
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
644
+ __createBinding(result, mod, k);
645
+ __setModuleDefault(result, mod);
646
+ return result;
647
+ }
648
+ function __importDefault(mod) {
649
+ return (mod && mod.__esModule) ? mod : { default: mod };
650
+ }
651
+ function __classPrivateFieldGet(receiver, state, kind, f) {
652
+ if (kind === "a" && !f)
653
+ throw new TypeError("Private accessor was defined without a getter");
654
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
655
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
656
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
657
+ }
658
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
659
+ if (kind === "m")
660
+ throw new TypeError("Private method is not writable");
661
+ if (kind === "a" && !f)
662
+ throw new TypeError("Private accessor was defined without a setter");
663
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
664
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
665
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
666
+ }
667
+
668
+ var DEFAULT_PAGE_SIZE = 20;
669
+ function getPageInfo(datatable, defaultPageSize) {
670
+ if (defaultPageSize === void 0) { defaultPageSize = DEFAULT_PAGE_SIZE; }
671
+ var _a, _b, _c, _d, _e, _f, _g;
672
+ return {
673
+ offset: (_b = (_a = datatable === null || datatable === void 0 ? void 0 : datatable.ngxDatatable) === null || _a === void 0 ? void 0 : _a.offset) !== null && _b !== void 0 ? _b : 0,
674
+ pageSize: (_d = (_c = datatable === null || datatable === void 0 ? void 0 : datatable.ngxDatatable) === null || _c === void 0 ? void 0 : _c.pageSize) !== null && _d !== void 0 ? _d : defaultPageSize,
675
+ limit: (_e = datatable === null || datatable === void 0 ? void 0 : datatable.ngxDatatable) === null || _e === void 0 ? void 0 : _e.limit,
676
+ count: (_g = (_f = datatable === null || datatable === void 0 ? void 0 : datatable.ngxDatatable) === null || _f === void 0 ? void 0 : _f.count) !== null && _g !== void 0 ? _g : 0
677
+ };
678
+ }
679
+
680
+ function createPageInfoObservable(datatable$, defaultPageSize) {
681
+ if (defaultPageSize === void 0) { defaultPageSize = 20; }
682
+ return new rxjs.Observable(function (subscriber) {
683
+ var prev = null;
684
+ var handlePageInfo = function (pageInfo) {
685
+ if (!_isPageInfoSame(prev, pageInfo)) {
686
+ if (pageInfo !== null) {
687
+ subscriber.next(pageInfo);
688
+ }
689
+ prev = pageInfo;
690
+ }
691
+ };
692
+ var dtSub = datatable$.pipe(operators.switchMap(function (dt) {
693
+ if (!utils.notNullOrUndefined(dt)) {
694
+ handlePageInfo(null);
695
+ return rxjs.EMPTY;
696
+ }
697
+ handlePageInfo(getPageInfo(dt, defaultPageSize));
698
+ return dt.page.pipe(operators.tap(function (p) { return handlePageInfo(p); }));
699
+ })).subscribe();
700
+ return function () {
701
+ dtSub.unsubscribe();
702
+ };
703
+ });
704
+ }
705
+ function _isPageInfoSame(prev, curr) {
706
+ if ((prev === null || prev === void 0 ? void 0 : prev.offset) === (curr === null || curr === void 0 ? void 0 : curr.offset) &&
707
+ (prev === null || prev === void 0 ? void 0 : prev.pageSize) === (curr === null || curr === void 0 ? void 0 : curr.pageSize) &&
708
+ (prev === null || prev === void 0 ? void 0 : prev.limit) === (curr === null || curr === void 0 ? void 0 : curr.limit) &&
709
+ (prev === null || prev === void 0 ? void 0 : prev.count) === (curr === null || curr === void 0 ? void 0 : curr.count)) {
710
+ return true;
711
+ }
712
+ return false;
713
+ }
714
+
715
+ function resolveMapper(filterState, filterStateMappers, context) {
716
+ var mapper = filterStateMappers[filterState.name];
717
+ if (!utils.notNullOrUndefined(mapper)) {
718
+ throw Error("Mapper for filter '" + filterState.name + "' not found.");
719
+ }
720
+ return utils.wrapIntoObservable(mapper(filterState, context)).pipe(
721
+ // Require each mapper to complete.
722
+ operators.take(1));
723
+ }
724
+ function resolveMappers(filterStates, filterStateMappers, context) {
725
+ return rxjs.from(filterStates).pipe(operators.concatMap(function (filterState) { return resolveMapper(filterState, filterStateMappers, context); }), operators.filter(utils.notNullOrUndefined), operators.toArray());
726
+ }
727
+ function mergeFilters(filters) {
728
+ return { or: filters };
729
+ }
730
+ /**
731
+ * Merges variable objects.
732
+ *
733
+ * NOTE: This does not try to deep merge, so if two objects define the same
734
+ * variable then the last object's value will be in the merged object. *In
735
+ * devMode an error will be thrown.*
736
+ */
737
+ function mergeVariables(variableObjects) {
738
+ var e_1, _a, e_2, _b, e_3, _c;
739
+ var variables = {};
740
+ try {
741
+ for (var variableObjects_1 = __values(variableObjects), variableObjects_1_1 = variableObjects_1.next(); !variableObjects_1_1.done; variableObjects_1_1 = variableObjects_1.next()) {
742
+ var v = variableObjects_1_1.value;
743
+ var props = Object.keys(v);
744
+ if (i0.isDevMode()) {
745
+ try {
746
+ for (var props_1 = (e_2 = void 0, __values(props)), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) {
747
+ var p = props_1_1.value;
748
+ if (utils.notNullOrUndefined(variables[p]) && variables[p] !== v[p]) {
749
+ console.warn("Multiple filters adding the same variable with a different result. This could cause unexpected results.");
750
+ break;
751
+ }
752
+ }
753
+ }
754
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
755
+ finally {
756
+ try {
757
+ if (props_1_1 && !props_1_1.done && (_b = props_1.return)) _b.call(props_1);
758
+ }
759
+ finally { if (e_2) throw e_2.error; }
760
+ }
761
+ }
762
+ try {
763
+ for (var props_2 = (e_3 = void 0, __values(props)), props_2_1 = props_2.next(); !props_2_1.done; props_2_1 = props_2.next()) {
764
+ var p = props_2_1.value;
765
+ variables[p] = v[p];
766
+ }
767
+ }
768
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
769
+ finally {
770
+ try {
771
+ if (props_2_1 && !props_2_1.done && (_c = props_2.return)) _c.call(props_2);
772
+ }
773
+ finally { if (e_3) throw e_3.error; }
774
+ }
775
+ }
776
+ }
777
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
778
+ finally {
779
+ try {
780
+ if (variableObjects_1_1 && !variableObjects_1_1.done && (_a = variableObjects_1.return)) _a.call(variableObjects_1);
781
+ }
782
+ finally { if (e_1) throw e_1.error; }
783
+ }
784
+ return variables;
785
+ }
786
+ function mapFilterStates(filterStates, filterStateMappers, context) {
787
+ return __awaiter(this, void 0, void 0, function () {
788
+ var results, filters, variableObjs;
789
+ return __generator(this, function (_a) {
790
+ switch (_a.label) {
791
+ case 0: return [4 /*yield*/, resolveMappers(filterStates, filterStateMappers, context).toPromise()];
792
+ case 1:
793
+ results = _a.sent();
794
+ if (results.length === 0) {
795
+ return [2 /*return*/, null];
796
+ }
797
+ filters = results
798
+ .map(function (r) { return r.filter; })
799
+ .filter(utils.notNullOrUndefined);
800
+ variableObjs = results
801
+ .map(function (r) { return r.variables; })
802
+ .filter(utils.notNullOrUndefined);
803
+ return [2 /*return*/, {
804
+ filter: mergeFilters(filters),
805
+ variables: mergeVariables(variableObjs)
806
+ }];
807
+ }
808
+ });
809
+ });
810
+ }
811
+
812
+ /**
813
+ * Maps to a range that fetches the page before the current page, the current
814
+ * page, and the page after the current page.
815
+ */
816
+ function mapPageInfo(pageInfo) {
817
+ var _skip = pageInfo.offset * pageInfo.pageSize;
818
+ var skipWithWindowOffset = _skip - pageInfo.pageSize;
819
+ var takeOffset = skipWithWindowOffset < 0 ? skipWithWindowOffset : 0;
820
+ return {
821
+ skip: Math.max(skipWithWindowOffset, 0),
822
+ take: Math.max((pageInfo.pageSize * 3) + takeOffset, 0)
823
+ };
824
+ }
825
+
826
+ function observeRowsWithGqlInputsHandling(queryRef, rows, datatable, extraVariables, sortsMapper, filterStateMappers) {
827
+ return new rxjs.Observable(function (subscriber) {
828
+ var datatable$ = utils.wrapIntoObservable(datatable);
829
+ var extraVariables$ = utils.wrapIntoObservable(extraVariables);
830
+ var context$ = extraVariables$.pipe(operators.map(function (_extraVariables) {
831
+ var context = {
832
+ extraVariables: _extraVariables
833
+ };
834
+ return context;
835
+ }), operators.shareReplay({ bufferSize: 1, refCount: true }));
836
+ var datatableMappers = {
837
+ pageInfo: mapPageInfo,
838
+ sorts: sortsMapper,
839
+ filters: filterStateMappers,
840
+ };
841
+ var datatableResults$ = _createDatatableResultsObservable(datatable$, datatableMappers, context$);
842
+ var queryVariablesChanged$ = datatableResults$.pipe(operators.tap(function (results) {
843
+ var _a, _b;
844
+ queryRef.setVariables(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (results.context || {})), results.pageInfo), (results.sorts.length > 0 ? { order: results.sorts } : {})), (((_a = results.filter) === null || _a === void 0 ? void 0 : _a.variables) || {})), (((_b = results.filter) === null || _b === void 0 ? void 0 : _b.filter) ? { where: results.filter.filter } : {})));
845
+ }));
846
+ // const _emitSubject = new Subject<void>()
847
+ // const queryVarsChangedSub = queryVariablesChanged$.pipe(
848
+ // switchMap(() => subscriberCount(rows, 'rows'))
849
+ // ).subscribe(subscriber)
850
+ var queryVarsChangedSub = queryVariablesChanged$.subscribe();
851
+ var _sub = utils.subscriberCount(rows, 'rows').subscribe(subscriber);
852
+ return function () {
853
+ queryVarsChangedSub.unsubscribe();
854
+ _sub.unsubscribe();
855
+ };
856
+ });
857
+ // const context$ = extraVariables$.pipe(
858
+ // map(_extraVariables => {
859
+ // const context: MapperContext = {
860
+ // extraVariables: _extraVariables
861
+ // }
862
+ // return context
863
+ // })
864
+ // )
865
+ // const datatableMappers: DatatableMappers = {
866
+ // pageInfo: mapPageInfo,
867
+ // sorts: sortsMapper,
868
+ // filters: filterStateMappers,
869
+ // }
870
+ // const datatableResults$ = _createDatatableResultsObservable(
871
+ // datatable$,
872
+ // datatableMappers,
873
+ // context$,
874
+ // )
875
+ // const queryVariablesChanged$ = datatableResults$.pipe(
876
+ // tap(results => {
877
+ // queryRef.setVariables({
878
+ // ...(results.extraVariables || {}),
879
+ // ...results.pageInfo,
880
+ // ...(results.sorts.length > 0 ? { order: results.sorts } : {}),
881
+ // ...(results.filterInfo?.variables || {}),
882
+ // ...(results.filterInfo?.filter ? { where: results.filterInfo.filter } : {})
883
+ // } as any)
884
+ // })
885
+ // )
886
+ // const handleQueryInputs = combineLatest([ extraVariables$, pageInfo$ ]).pipe(
887
+ // switchMap(([ _extraVariables, pageInfo ]) => {
888
+ // // console.log('_extraVariables, pageInfo', _extraVariables, pageInfo)
889
+ // const context: MapperContext = {
890
+ // extraVariables: _extraVariables
891
+ // }
892
+ // return combineLatest([ sorts$, filterInfo$ ]).pipe(
893
+ // // map(([ sorts, filterInfo ]) => ({ extraVariables: _extraVariables, pageInfo, sorts, filterInfo }))
894
+ // map(([ sorts, filterInfo ]) => {
895
+ // // console.log('sorts, filterInfo', sorts, filterInfo)
896
+ // return { extraVariables: _extraVariables, pageInfo, sorts, filterInfo }
897
+ // })
898
+ // )
899
+ // }),
900
+ // tap(v => {
901
+ // // console.log('~~~', v)
902
+ // queryRef.setVariables({
903
+ // ...(v.extraVariables || {}),
904
+ // ...v.pageInfo,
905
+ // ...(v.sorts.length > 0 ? { order: v.sorts } : {}),
906
+ // ...(v.filterInfo?.variables || {}),
907
+ // ...(v.filterInfo?.filter ? { where: v.filterInfo.filter } : {})
908
+ // } as any)
909
+ // })
910
+ // )
911
+ // return defer(() => {
912
+ // const _emitted = new Subject<void>()
913
+ // const handlerSub = handleQueryInputs.pipe(
914
+ // // skip(1)
915
+ // // ).subscribe(() => _emitted.next())
916
+ // ).subscribe(() => {
917
+ // _emitted.next()
918
+ // })
919
+ // return _emitted.pipe(
920
+ // // tap(v => {
921
+ // // console.log('emitted', v)
922
+ // // }),
923
+ // distinctUntilChanged(),
924
+ // switchMap(() => subscriberCount(rows, 'rows')),
925
+ // // tap(v => {
926
+ // // console.log('emitting rows', v)
927
+ // // }),
928
+ // finalize(() => handlerSub.unsubscribe())
929
+ // )
930
+ // }).pipe(
931
+ // // tap(v => {
932
+ // // console.log('rows', v)
933
+ // // }),
934
+ // catchError(err => {
935
+ // console.error(err)
936
+ // return of([] as TRow[])
937
+ // }),
938
+ // shareReplay({ bufferSize: 1, refCount: true })
939
+ // )
940
+ }
941
+ function _createSortsObservable(datatable$) {
942
+ return datatable$.pipe(
943
+ // tap(v => console.log('sorts got dt', v)),
944
+ operators.switchMap(function (dt) { return dt
945
+ ? dt.sort.pipe(operators.map(function (v) { return v.sorts; }), operators.startWith(dt.sorts)) // .pipe(tap(v => console.log('sorts 1', v)))
946
+ : rxjs.of([]); } // .pipe(tap(v => console.log('sorts 2', v)))
947
+ ), operators.shareReplay({ bufferSize: 1, refCount: true }));
948
+ }
949
+ function _createFilterStatesObservable(datatable$) {
950
+ return datatable$.pipe(
951
+ // tap(v => console.log('filters got dt', v)),
952
+ operators.switchMap(function (dt) { return dt
953
+ ? dt.filterStates // .pipe(tap(v => console.log('filterStates 1', v)))
954
+ : rxjs.of([]); } // .pipe(tap(v => console.log('filterStates 2', v)))
955
+ ),
956
+ // TODO: Remove when the datatable fixes the bug causing it to emit more than it should.
957
+ operators.distinctUntilChanged(function (x, y) { return JSON.stringify(x) === JSON.stringify(y); }));
958
+ }
959
+ function _createDatatableResultsObservable(datatable$, mappers, context$) {
960
+ return new rxjs.Observable(function (subscriber) {
961
+ var datatableSubject = new rxjs.ReplaySubject();
962
+ var dtSub = datatable$.subscribe(function (dt) { return datatableSubject.next(dt); }, function (err) { return datatableSubject.error(err); }, function () { return datatableSubject.complete(); });
963
+ var ctxSub = context$.pipe(operators.switchMap(function (context) {
964
+ // TODO: Decide if the disabled paging feature will be reimplemented in a way
965
+ // that it should be considered here. `_isPagingDisabled(queryRef)`
966
+ var pageInfo$ = createPageInfoObservable(datatable$).pipe(operators.map(function (info) { return mappers.pageInfo(info); }));
967
+ var sorts$ = _createSortsObservable(datatable$).pipe(operators.switchMap(function (m) { return utils.wrapIntoObservable(mappers.sorts(m, context)); }));
968
+ var filterInfo$ = _createFilterStatesObservable(datatable$).pipe(operators.switchMap(function (x) { return mapFilterStates(x, mappers.filters, context); }));
969
+ return rxjs.combineLatest([
970
+ pageInfo$,
971
+ sorts$,
972
+ filterInfo$,
973
+ ]).pipe(operators.map(function (_c) {
974
+ var _d = __read(_c, 3), pageInfo = _d[0], sorts = _d[1], filterInfo = _d[2];
975
+ return ({
976
+ pageInfo: pageInfo,
977
+ sorts: sorts,
978
+ filter: filterInfo,
979
+ context: context
980
+ });
981
+ }));
982
+ })).subscribe(subscriber);
983
+ return function () {
984
+ dtSub.unsubscribe();
985
+ ctxSub.unsubscribe();
986
+ };
987
+ });
988
+ }
989
+ // function _isPagingDisabled<TData, TVariables, TRow>(queryRef: DatatableGraphQLQueryRef<TData, TVariables, TRow>): boolean {
990
+ // return queryRef.getQueryProcessingConfig()?.disablePaging ?? false
991
+ // }
992
+
993
+ /**
994
+ * Partially wraps ApolloClient's QueryRef with some of our datatable boilerplate.
995
+ *
996
+ * TODO: Decide how to handle/display errors.
997
+ */
998
+ var DatatableGraphQLQueryRef = /** @class */ (function () {
999
+ function DatatableGraphQLQueryRef(
1000
+ /** Original ApolloClient's QueryRef. */
1001
+ _queryRef,
1002
+ /**
1003
+ * How long to wait before refetching from an update to the query or variables.
1004
+ */
1005
+ _updatesPollDelay) {
1006
+ var _this = this;
1007
+ if (_updatesPollDelay === void 0) { _updatesPollDelay = 500; }
1008
+ this._queryRef = _queryRef;
1009
+ this._updatesPollDelay = _updatesPollDelay;
1010
+ this._variablesSubject = new rxjs.BehaviorSubject({});
1011
+ this._observingChangesSubject = new rxjs.BehaviorSubject(false);
1012
+ /**
1013
+ * Temporary way of tracking total count when paging is disabled.
1014
+ */
1015
+ this._totalCount = DEFAULT_PAGE_SIZE;
1016
+ this._variablesUpdatePending = false;
1017
+ this._variablesSubject.next(this._queryRef.obsQuery.options.variables || {});
1018
+ // this._getValueChanges().subscribe(v => this._logNetworkStatus(v.networkStatus))
1019
+ this._valueChanges = rxjs.defer(function () {
1020
+ // console.log('Observing value changes')
1021
+ var varChangesSub = _this._variablesSubject.pipe(operators.skip(1), operators.tap(function () {
1022
+ _this._variablesUpdatePending = true;
1023
+ }), operators.auditTime(_this._updatesPollDelay), operators.finalize(function () {
1024
+ // If the query stopped being observed before setting the pending
1025
+ // variables, set them now.
1026
+ if (_this._variablesUpdatePending) {
1027
+ _this.refetch();
1028
+ _this._variablesUpdatePending = false;
1029
+ }
1030
+ })).subscribe(function (variables) {
1031
+ // console.log('set vars', variables)
1032
+ _this._setVariablesImmediate(variables);
1033
+ // this.refetch()
1034
+ _this._variablesUpdatePending = false;
1035
+ });
1036
+ _this._observingChanges = true;
1037
+ return _this._queryRef.valueChanges.pipe(
1038
+ // tap(v => {
1039
+ // console.log('v', v)
1040
+ // }),
1041
+ operators.filter(function (v) { return v.networkStatus === core.NetworkStatus.ready; }), operators.finalize(function () {
1042
+ // console.log('Done observing value changes')
1043
+ varChangesSub.unsubscribe();
1044
+ _this._observingChanges = false;
1045
+ }));
1046
+ }).pipe(
1047
+ // share()
1048
+ operators.shareReplay({ bufferSize: 1, refCount: true }));
1049
+ this.loading$ = this._observingChangesSubject.pipe(operators.switchMap(function (observingChanges) {
1050
+ if (!observingChanges) {
1051
+ return rxjs.of(false);
1052
+ }
1053
+ return _this._valueChanges.pipe(operators.map(function (result) { return result.loading; }), operators.startWith(_this._queryRef.getCurrentResult().loading), operators.auditTime(0), operators.shareReplay({ bufferSize: 1, refCount: true }));
1054
+ }));
1055
+ }
1056
+ Object.defineProperty(DatatableGraphQLQueryRef.prototype, "_observingChanges", {
1057
+ get: function () { return this._observingChangesSubject.value; },
1058
+ set: function (value) { this._observingChangesSubject.next(value); },
1059
+ enumerable: false,
1060
+ configurable: true
1061
+ });
1062
+ Object.defineProperty(DatatableGraphQLQueryRef.prototype, "updatesPollDelay", {
1063
+ get: function () { return this._updatesPollDelay; },
1064
+ enumerable: false,
1065
+ configurable: true
1066
+ });
1067
+ Object.defineProperty(DatatableGraphQLQueryRef.prototype, "variablesUpdatePending", {
1068
+ get: function () { return this._variablesUpdatePending; },
1069
+ enumerable: false,
1070
+ configurable: true
1071
+ });
1072
+ DatatableGraphQLQueryRef.prototype._logNetworkStatus = function (status) {
1073
+ switch (status) {
1074
+ case core.NetworkStatus.loading:
1075
+ console.log('%cNetworkStatus: ', 'color:limegreen', 'Loading');
1076
+ break;
1077
+ case core.NetworkStatus.setVariables:
1078
+ console.log('%cNetworkStatus: ', 'color:limegreen', 'SetVariables');
1079
+ break;
1080
+ case core.NetworkStatus.fetchMore:
1081
+ console.log('%cNetworkStatus: ', 'color:limegreen', 'FetchMore');
1082
+ break;
1083
+ case core.NetworkStatus.refetch:
1084
+ console.log('%cNetworkStatus: ', 'color:limegreen', 'Refetch');
1085
+ break;
1086
+ case core.NetworkStatus.poll:
1087
+ console.log('%cNetworkStatus: ', 'color:limegreen', 'Poll');
1088
+ break;
1089
+ case core.NetworkStatus.ready:
1090
+ console.log('%cNetworkStatus: ', 'color:limegreen', 'Ready');
1091
+ break;
1092
+ case core.NetworkStatus.error:
1093
+ console.log('%cNetworkStatus: ', 'color:limegreen', 'Error');
1094
+ break;
1095
+ default: console.log('%cNetworkStatus: ', 'color:red', 'Unknown');
1096
+ }
1097
+ };
1098
+ DatatableGraphQLQueryRef.prototype.rows = function (mapper) {
1099
+ return this._rowsObservable(mapper);
1100
+ };
1101
+ DatatableGraphQLQueryRef.prototype._rowsObservable = function (mapper) {
1102
+ var _this = this;
1103
+ return new rxjs.Observable(function (subscriber) {
1104
+ // const rowsBufferSubject = new BehaviorSubject<TRow[]>([])
1105
+ // console.log('obs _rowsObservable')
1106
+ var rowsBuffer = [];
1107
+ // const rowsBufferSubject = new ReplaySubject<TRow[]>()
1108
+ var rowsBufferSubject = new rxjs.Subject();
1109
+ var querySub = _this._valueChanges.pipe(operators.switchMap(function (result) {
1110
+ if (result.data === undefined) {
1111
+ return rxjs.of([]);
1112
+ }
1113
+ return _this._resolveRowMapper(mapper(result.data)).pipe(operators.tap(function (mapperResult) {
1114
+ var _a, _b;
1115
+ // console.log('mapperResult', mapperResult)
1116
+ if (_this._needsToRequeryWithAllRecords(mapperResult)) {
1117
+ _this.patchVariables({ take: mapperResult.totalCount });
1118
+ }
1119
+ if (utils.hasProperty(mapperResult, 'totalCount')) {
1120
+ _this._totalCount = mapperResult.totalCount;
1121
+ }
1122
+ // let rows = rowsBufferSubject.value || []
1123
+ var rows = rowsBuffer || [];
1124
+ var hasTotalCount = mapperResult.totalCount !== undefined && mapperResult.totalCount !== null;
1125
+ // If the rows buffer is not the same size as the totalCount, create a
1126
+ // new buffer.
1127
+ //
1128
+ // TODO: Find out if this is resetting the buffer too eagerly.
1129
+ // ApolloClient may have a better solution.
1130
+ if (hasTotalCount) {
1131
+ if (mapperResult.totalCount !== rows.length) {
1132
+ rows = new Array(mapperResult.totalCount || 0);
1133
+ }
1134
+ var startIndex = (_a = _this.getVariables().skip) !== null && _a !== void 0 ? _a : 0;
1135
+ if ((_b = _this.getQueryProcessingConfig()) === null || _b === void 0 ? void 0 : _b.disablePaging) {
1136
+ startIndex = 0;
1137
+ }
1138
+ // Insert rows into buffer location.
1139
+ rows.splice.apply(rows, __spreadArray([startIndex, mapperResult.rows.length], __read(mapperResult.rows)));
1140
+ rows = __spreadArray([], __read(rows));
1141
+ }
1142
+ else {
1143
+ rows = __spreadArray([], __read(mapperResult.rows));
1144
+ }
1145
+ rowsBuffer = rows;
1146
+ rowsBufferSubject.next(rows);
1147
+ }));
1148
+ })).subscribe();
1149
+ var rowsSub = rowsBufferSubject.subscribe(subscriber);
1150
+ return function () {
1151
+ // console.log('unsub')
1152
+ querySub.unsubscribe();
1153
+ rowsSub.unsubscribe();
1154
+ rowsBufferSubject.next([]);
1155
+ rowsBufferSubject.complete();
1156
+ };
1157
+ });
1158
+ };
1159
+ DatatableGraphQLQueryRef.prototype._needsToRequeryWithAllRecords = function (data) {
1160
+ var _a;
1161
+ if (!((_a = this.getQueryProcessingConfig()) === null || _a === void 0 ? void 0 : _a.disablePaging)) {
1162
+ return false;
1163
+ }
1164
+ return utils.hasProperty(data, 'totalCount') &&
1165
+ utils.hasProperty(data, 'rows') &&
1166
+ Array.isArray(data.rows) &&
1167
+ data.totalCount > data.rows.length &&
1168
+ this._totalCount !== data.totalCount;
1169
+ };
1170
+ DatatableGraphQLQueryRef.prototype._resolveRowMapper = function (mapperReturn) {
1171
+ if (rxjs.isObservable(mapperReturn)) {
1172
+ return mapperReturn.pipe(operators.take(1));
1173
+ }
1174
+ return rxjs.from(Promise.resolve(mapperReturn));
1175
+ };
1176
+ DatatableGraphQLQueryRef.prototype.getVariables = function () {
1177
+ // The types aren't accurate or Apollo has a bug, so I had to use `any`.
1178
+ // return (this._queryRef as any).obsQuery.options.variables || {}
1179
+ // TODO: Look into debouncing our variable setting, while still depending on Apollo for managing them.
1180
+ return this._variablesSubject.value;
1181
+ };
1182
+ DatatableGraphQLQueryRef.prototype._setVariablesImmediate = function (variables) {
1183
+ var _vars = this._withVariableOverrides(variables);
1184
+ return this._queryRef.setVariables(_vars || {});
1185
+ };
1186
+ DatatableGraphQLQueryRef.prototype._patchVariablesImmediate = function (variables) {
1187
+ var _variables = Object.assign(Object.assign({}, this.getVariables()), variables);
1188
+ var _vars = this._withVariableOverrides(_variables);
1189
+ return this._queryRef.setVariables(_vars || {});
1190
+ };
1191
+ DatatableGraphQLQueryRef.prototype.setVariables = function (variables) {
1192
+ this._variablesSubject.next(variables);
1193
+ if (!this._observingChanges) {
1194
+ this._setVariablesImmediate(variables);
1195
+ }
1196
+ };
1197
+ DatatableGraphQLQueryRef.prototype.patchVariables = function (variables) {
1198
+ var _variables = Object.assign(Object.assign({}, this.getVariables()), variables);
1199
+ this._variablesSubject.next(_variables);
1200
+ if (!this._observingChanges) {
1201
+ this._setVariablesImmediate(_variables);
1202
+ }
1203
+ };
1204
+ DatatableGraphQLQueryRef.prototype.refetch = function (variables) {
1205
+ var _vars = this._withVariableOverrides(variables);
1206
+ return this._queryRef.refetch(_vars);
1207
+ };
1208
+ DatatableGraphQLQueryRef.prototype.setQuery = function (query, triggerRefetch) {
1209
+ if (triggerRefetch === void 0) { triggerRefetch = false; }
1210
+ this._queryRef.setOptions({ query: query });
1211
+ if (triggerRefetch) {
1212
+ // TODO: Consider refactoring the refetch process. I can't call Apollo's
1213
+ // refetch directly, because I want it to share the update triggered
1214
+ // polling delay with the setting of variables.
1215
+ // this._queryRef.refetch(this.getVariables())
1216
+ // Fake variables update to trigger a refetch that shares it's refetch delay.
1217
+ this.setVariables(this.getVariables());
1218
+ }
1219
+ };
1220
+ DatatableGraphQLQueryRef.prototype.getOptions = function () {
1221
+ return this._queryRef.obsQuery.options;
1222
+ };
1223
+ DatatableGraphQLQueryRef.prototype.getQueryProcessingConfig = function () {
1224
+ var _a, _b;
1225
+ return (_b = (_a = this.getOptions()) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.queryProcessingConfig;
1226
+ };
1227
+ DatatableGraphQLQueryRef.prototype._withVariableOverrides = function (variables) {
1228
+ var _a, _b;
1229
+ if (!utils.notNullOrUndefined(variables) && !((_a = this.getQueryProcessingConfig()) === null || _a === void 0 ? void 0 : _a.disablePaging)) {
1230
+ return undefined;
1231
+ }
1232
+ var _vars = Object.assign({}, (variables || {}));
1233
+ if ((_b = this.getQueryProcessingConfig()) === null || _b === void 0 ? void 0 : _b.disablePaging) {
1234
+ _vars.take = this._totalCount;
1235
+ }
1236
+ return _vars;
1237
+ };
1238
+ return DatatableGraphQLQueryRef;
1239
+ }());
1240
+
1241
+ var DATATABLE_GRAPHQL_SERVICE_CONFIG = new i0.InjectionToken('DATATABLE_GRAPHQL_SERVICE_CONFIG');
1242
+ var _CONFIG_DEFAULTS = {
1243
+ pollingIntervalTime: 1 * 60 * 1000
1244
+ };
1245
+ var DatatableGraphqlService = /** @class */ (function () {
1246
+ function DatatableGraphqlService(_apollo, _config) {
1247
+ this._apollo = _apollo;
1248
+ this._config = Object.assign(Object.assign({}, _CONFIG_DEFAULTS), (_config || {}));
1249
+ }
1250
+ DatatableGraphqlService.prototype.watchQuery = function (options, queryProcessingConfig) {
1251
+ var _a;
1252
+ var _options = Object.assign(Object.assign(Object.assign({ useInitialLoading: true }, _CONFIG_DEFAULTS), { pollInterval: this._config.pollingIntervalTime }), options);
1253
+ if (queryProcessingConfig) {
1254
+ _options.context = Object.assign(Object.assign({}, (_options.context || {})), { queryProcessingConfig: Object.assign(Object.assign({}, (((_a = _options.context) === null || _a === void 0 ? void 0 : _a.queryProcessingConfig) || {})), queryProcessingConfig) });
1255
+ }
1256
+ var queryRef = this._apollo.watchQuery(_options);
1257
+ return new DatatableGraphQLQueryRef(queryRef);
1258
+ };
1259
+ return DatatableGraphqlService;
1260
+ }());
1261
+ DatatableGraphqlService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function DatatableGraphqlService_Factory() { return new DatatableGraphqlService(i0__namespace.ɵɵinject(i1__namespace.Apollo), i0__namespace.ɵɵinject(DATATABLE_GRAPHQL_SERVICE_CONFIG, 8)); }, token: DatatableGraphqlService, providedIn: "root" });
1262
+ DatatableGraphqlService.decorators = [
1263
+ { type: i0.Injectable, args: [{
1264
+ providedIn: 'root'
1265
+ },] }
1266
+ ];
1267
+ DatatableGraphqlService.ctorParameters = function () { return [
1268
+ { type: i1.Apollo },
1269
+ { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [DATATABLE_GRAPHQL_SERVICE_CONFIG,] }] }
1270
+ ]; };
1271
+
329
1272
  /**
330
1273
  * Generated bundle index. Do not edit.
331
1274
  */
332
1275
 
1276
+ exports.DATATABLE_GRAPHQL_SERVICE_CONFIG = DATATABLE_GRAPHQL_SERVICE_CONFIG;
1277
+ exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE;
1278
+ exports.DatatableGraphQLQueryRef = DatatableGraphQLQueryRef;
1279
+ exports.DatatableGraphqlService = DatatableGraphqlService;
333
1280
  exports.HINT_NAMES_CAPTURE_REGEX = HINT_NAMES_CAPTURE_REGEX;
334
1281
  exports.HINT_PREFIX_REGEX = HINT_PREFIX_REGEX;
335
1282
  exports.containsVariable = containsVariable;
336
1283
  exports.createHintsToken = createHintsToken;
337
1284
  exports.getHintsToken = getHintsToken;
1285
+ exports.getPageInfo = getPageInfo;
338
1286
  exports.getTokenAppliesTo = getTokenAppliesTo;
339
1287
  exports.gqlVar = gqlVar;
340
1288
  exports.hintNamesFromHintToken = hintNamesFromHintToken;
@@ -343,6 +1291,8 @@
343
1291
  exports.isCommentToken = isCommentToken;
344
1292
  exports.isHintToken = isHintToken;
345
1293
  exports.isInlineComment = isInlineComment;
1294
+ exports.mapFilterStates = mapFilterStates;
1295
+ exports.observeRowsWithGqlInputsHandling = observeRowsWithGqlInputsHandling;
346
1296
  exports.parseAst = parseAst;
347
1297
  exports.parseComments = parseComments;
348
1298
  exports.parseHints = parseHints;
@@ -353,5 +1303,5 @@
353
1303
 
354
1304
  Object.defineProperty(exports, '__esModule', { value: true });
355
1305
 
356
- })));
1306
+ }));
357
1307
  //# sourceMappingURL=theseam-ui-common-graphql.umd.js.map