@c8y/tutorial 1019.0.3

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 (345) hide show
  1. package/.browserslistrc +16 -0
  2. package/NOTICES +41743 -0
  3. package/cumulocity.config.ts +643 -0
  4. package/package.json +22 -0
  5. package/src/__mocks/README.md +73 -0
  6. package/src/__mocks/global-mocks/inventory.interceptor.ts +145 -0
  7. package/src/__mocks/global-mocks/measurements.interceptor.ts +58 -0
  8. package/src/__mocks/index.ts +5 -0
  9. package/src/__mocks/mock.model.ts +76 -0
  10. package/src/__mocks/mock.module.ts +121 -0
  11. package/src/__mocks/mock.realtime-subject.ts +68 -0
  12. package/src/__mocks/mock.realtime.ts +31 -0
  13. package/src/__mocks/mock.service.ts +113 -0
  14. package/src/__mocks/scoped-mocks/boilerplate.ts +54 -0
  15. package/src/__mocks/scoped-mocks/context-dashboard.ts +47 -0
  16. package/src/__mocks/scoped-mocks/device-data-grid.ts +44 -0
  17. package/src/__mocks/scoped-mocks/named-context-dashboard.ts +42 -0
  18. package/src/__mocks/scoped-mocks/server-side-data-grid.ts +47 -0
  19. package/src/__mocks/scoped-mocks/service-dashboard.ts +42 -0
  20. package/src/__mocks/utils/clean.realtime.ts +23 -0
  21. package/src/__mocks/utils/common.ts +114 -0
  22. package/src/__mocks/utils/generators/alarms.ts +30 -0
  23. package/src/__mocks/utils/generators/events.ts +14 -0
  24. package/src/__mocks/utils/generators/managedObjects.ts +208 -0
  25. package/src/__mocks/utils/generators/measurement.ts +22 -0
  26. package/src/__mocks/utils/generators/operations.ts +67 -0
  27. package/src/__mocks/utils/grid.ts +87 -0
  28. package/src/__mocks/utils/realtime.ts +59 -0
  29. package/src/alert/alert-example.components.html +110 -0
  30. package/src/alert/alert-example.components.ts +77 -0
  31. package/src/alert/alert-example.module.ts +21 -0
  32. package/src/app/app.module.ts +72 -0
  33. package/src/bootstrap.ts +19 -0
  34. package/src/branding/branding.less +78 -0
  35. package/src/client-interceptor/client-interceptor.module.ts +12 -0
  36. package/src/client-interceptor/client-interceptor.service.ts +61 -0
  37. package/src/client-interceptor/index.ts +1 -0
  38. package/src/component-styles/cascading-style-sheets-example/cascading-style-sheets-example.component.css +17 -0
  39. package/src/component-styles/cascading-style-sheets-example/cascading-style-sheets-example.component.ts +11 -0
  40. package/src/component-styles/cascading-style-sheets-example/cascading-style-sheets-example.module.ts +26 -0
  41. package/src/component-styles/leaner-style-sheets-example/leaner-style-sheets-example.component.less +14 -0
  42. package/src/component-styles/leaner-style-sheets-example/leaner-style-sheets-example.component.ts +11 -0
  43. package/src/component-styles/leaner-style-sheets-example/leaner-style-sheets-example.module.ts +26 -0
  44. package/src/component-styles/syntactically-awesome-style-sheets-example/syntactically-awesome-style-sheets-example.component.scss +13 -0
  45. package/src/component-styles/syntactically-awesome-style-sheets-example/syntactically-awesome-style-sheets-example.component.ts +11 -0
  46. package/src/component-styles/syntactically-awesome-style-sheets-example/syntactically-awesome-style-sheets-example.module.ts +26 -0
  47. package/src/dashboard/context-dashboard/context-dashboard.component.ts +32 -0
  48. package/src/dashboard/context-dashboard/context-dashboard.module.ts +22 -0
  49. package/src/dashboard/custom-dashboard/custom-dashboard.component.html +180 -0
  50. package/src/dashboard/custom-dashboard/custom-dashboard.component.ts +52 -0
  51. package/src/dashboard/custom-dashboard/custom-dashboard.module.ts +22 -0
  52. package/src/dashboard/index.ts +4 -0
  53. package/src/dashboard/named-context-dashboard/named-context-dashboard.component.ts +51 -0
  54. package/src/dashboard/named-context-dashboard/named-context-dashboard.module.ts +37 -0
  55. package/src/dashboard/service-dashboard/service-dashboard.component.ts +51 -0
  56. package/src/dashboard/service-dashboard/service-dashboard.module.ts +35 -0
  57. package/src/dashboard/widget-dashboard/widget-dashboard.component.ts +65 -0
  58. package/src/dashboard/widget-dashboard/widget-dashboard.module.ts +22 -0
  59. package/src/date-time-range/date-time-range-example.component.ts +109 -0
  60. package/src/date-time-range/date-time-range-example.module.ts +21 -0
  61. package/src/dynamic-forms/custom-element-example/custom-element-example.component.ts +70 -0
  62. package/src/dynamic-forms/custom-element-example/custom-element-example.module.ts +38 -0
  63. package/src/dynamic-forms/custom-element-example/types/checkbox/checkbox.type.component.html +26 -0
  64. package/src/dynamic-forms/custom-element-example/types/checkbox/checkbox.type.component.ts +21 -0
  65. package/src/dynamic-forms/dynamic-forms.module.ts +16 -0
  66. package/src/dynamic-forms/index.ts +2 -0
  67. package/src/dynamic-forms/introduction-example/introduction-example.component.ts +116 -0
  68. package/src/dynamic-forms/introduction-example/introduction-example.module.ts +24 -0
  69. package/src/dynamic-forms/json-schema-example/json-schema-example.component.html +33 -0
  70. package/src/dynamic-forms/json-schema-example/json-schema-example.component.ts +102 -0
  71. package/src/dynamic-forms/json-schema-example/json-schema-example.module.ts +24 -0
  72. package/src/for-of-directive/for-of-example.component.html +19 -0
  73. package/src/for-of-directive/for-of-example.component.ts +39 -0
  74. package/src/for-of-directive/for-of.module.ts +18 -0
  75. package/src/forms/form-validation/forms-validation.component.html +105 -0
  76. package/src/forms/form-validation/forms-validation.component.ts +52 -0
  77. package/src/forms/form-validation/forms.module.ts +22 -0
  78. package/src/forms/index.ts +1 -0
  79. package/src/grids/client-grid-example/client-grid-example.component.html +16 -0
  80. package/src/grids/client-grid-example/client-grid-example.component.ts +166 -0
  81. package/src/grids/client-grid-example/client-grid-example.module.ts +24 -0
  82. package/src/grids/client-grid-example/data.ts +427 -0
  83. package/src/grids/device-grid-example/device-grid-example.component.html +58 -0
  84. package/src/grids/device-grid-example/device-grid-example.component.ts +134 -0
  85. package/src/grids/device-grid-example/device-grid-example.module.ts +24 -0
  86. package/src/grids/grids-tabs.ts +37 -0
  87. package/src/grids/grids.module.ts +17 -0
  88. package/src/grids/index.ts +1 -0
  89. package/src/grids/server-grid-example/server-grid-example.component.html +26 -0
  90. package/src/grids/server-grid-example/server-grid-example.component.ts +121 -0
  91. package/src/grids/server-grid-example/server-grid-example.module.ts +24 -0
  92. package/src/grids/server-grid-example/server-grid-example.service.ts +266 -0
  93. package/src/grids/server-grid-example/type-data-grid-column/type.cell-renderer.component.ts +31 -0
  94. package/src/grids/server-grid-example/type-data-grid-column/type.data-grid-column.ts +47 -0
  95. package/src/grids/server-grid-example/type-data-grid-column/type.filtering-form-renderer.component.ts +107 -0
  96. package/src/grids/server-grid-example/type-data-grid-column/type.header-cell-renderer.component.ts +20 -0
  97. package/src/hello/hello.component.ts +55 -0
  98. package/src/hello/hello.module.ts +20 -0
  99. package/src/hello/index.ts +1 -0
  100. package/src/help/help-example.component.ts +23 -0
  101. package/src/help/help-example.module.ts +20 -0
  102. package/src/hooks/action/action.module.ts +34 -0
  103. package/src/hooks/action/action.ts +41 -0
  104. package/src/hooks/action/basic-view/basic-view.component.html +8 -0
  105. package/src/hooks/action/basic-view/basic-view.component.ts +18 -0
  106. package/src/hooks/action/index.ts +1 -0
  107. package/src/hooks/action/logout-action/logout-action.component.ts +18 -0
  108. package/src/hooks/action-bar/action-bar.module.ts +34 -0
  109. package/src/hooks/action-bar/action-bar.ts +28 -0
  110. package/src/hooks/action-bar/basic-view/basic-view.component.html +8 -0
  111. package/src/hooks/action-bar/basic-view/basic-view.component.ts +18 -0
  112. package/src/hooks/action-bar/index.ts +1 -0
  113. package/src/hooks/action-bar/refresh-element/refresh-element.component.html +15 -0
  114. package/src/hooks/action-bar/refresh-element/refresh-element.component.ts +21 -0
  115. package/src/hooks/breadcrumbs/basic-view/basic-view.component.html +7 -0
  116. package/src/hooks/breadcrumbs/basic-view/basic-view.component.ts +18 -0
  117. package/src/hooks/breadcrumbs/breadcrumbs.module.ts +34 -0
  118. package/src/hooks/breadcrumbs/breadcrumbs.ts +93 -0
  119. package/src/hooks/breadcrumbs/index.ts +1 -0
  120. package/src/hooks/component/basic-view/basic-view.component.html +11 -0
  121. package/src/hooks/component/basic-view/basic-view.component.ts +16 -0
  122. package/src/hooks/component/basic-view/simple.component.ts +8 -0
  123. package/src/hooks/component/component.module.ts +38 -0
  124. package/src/hooks/component/index.ts +1 -0
  125. package/src/hooks/drawer/index.ts +2 -0
  126. package/src/hooks/drawer/left-drawer-tutorial/left-drawer-tutorial.component.ts +8 -0
  127. package/src/hooks/drawer/left-drawer-tutorial/left-drawer.module.ts +10 -0
  128. package/src/hooks/drawer/right-drawer-tutorial/right-drawer-tutorial.component.ts +8 -0
  129. package/src/hooks/drawer/right-drawer-tutorial/right-drawer.module.ts +10 -0
  130. package/src/hooks/generic-wizard/index.ts +1 -0
  131. package/src/hooks/generic-wizard/minimal-setup/minimal-setup.component.ts +12 -0
  132. package/src/hooks/generic-wizard/minimal-setup/multiple-entries-one.component.ts +25 -0
  133. package/src/hooks/generic-wizard/minimal-setup/multiple-entries-two.component.ts +25 -0
  134. package/src/hooks/generic-wizard/minimal-setup/stepper-example.component.html +38 -0
  135. package/src/hooks/generic-wizard/minimal-setup/stepper-example.component.ts +33 -0
  136. package/src/hooks/generic-wizard/wizard-tabs.ts +22 -0
  137. package/src/hooks/generic-wizard/wizard.component.html +51 -0
  138. package/src/hooks/generic-wizard/wizard.component.ts +86 -0
  139. package/src/hooks/generic-wizard/wizard.module.ts +79 -0
  140. package/src/hooks/hooks.module.ts +19 -0
  141. package/src/hooks/index.ts +1 -0
  142. package/src/hooks/navigator/index.ts +1 -0
  143. package/src/hooks/navigator/navigator.module.ts +21 -0
  144. package/src/hooks/navigator/navigator.ts +35 -0
  145. package/src/hooks/navigator/time-navigator-node/time-navigator-node.component.ts +19 -0
  146. package/src/hooks/navigator-route/basic-view/basic-view.component.html +7 -0
  147. package/src/hooks/navigator-route/basic-view/basic-view.component.ts +18 -0
  148. package/src/hooks/navigator-route/index.ts +1 -0
  149. package/src/hooks/navigator-route/navigator-route.module.ts +27 -0
  150. package/src/hooks/route/device/device-info.component.html +2 -0
  151. package/src/hooks/route/device/device-info.component.ts +13 -0
  152. package/src/hooks/route/device/device-tab-context.component.html +15 -0
  153. package/src/hooks/route/device/device-tab-context.component.ts +13 -0
  154. package/src/hooks/route/index.ts +1 -0
  155. package/src/hooks/route/random.guard.ts +12 -0
  156. package/src/hooks/route/route.module.ts +51 -0
  157. package/src/hooks/state/hook-state.module.ts +25 -0
  158. package/src/hooks/state/hook-with-service-example.component.html +29 -0
  159. package/src/hooks/state/hook-with-service-example.component.ts +36 -0
  160. package/src/hooks/stepper/basic-view/basic-view.component.html +17 -0
  161. package/src/hooks/stepper/basic-view/basic-view.component.ts +31 -0
  162. package/src/hooks/stepper/index.ts +4 -0
  163. package/src/hooks/stepper/stepper-hook.module.ts +53 -0
  164. package/src/hooks/stepper/steps/step1.component.html +24 -0
  165. package/src/hooks/stepper/steps/step1.component.ts +18 -0
  166. package/src/hooks/stepper/steps/step2.component.html +7 -0
  167. package/src/hooks/stepper/steps/step2.component.ts +11 -0
  168. package/src/hooks/tabs/awesome/awesome.component.html +7 -0
  169. package/src/hooks/tabs/awesome/awesome.component.ts +21 -0
  170. package/src/hooks/tabs/index.ts +1 -0
  171. package/src/hooks/tabs/outstanding/outstanding.component.html +22 -0
  172. package/src/hooks/tabs/outstanding/outstanding.component.ts +27 -0
  173. package/src/hooks/tabs/tab.ts +44 -0
  174. package/src/hooks/tabs/tabs.module.ts +37 -0
  175. package/src/hooks/version/custom-version-factory.service.ts +49 -0
  176. package/src/hooks/version/index.ts +1 -0
  177. package/src/hooks/version/version.module.ts +11 -0
  178. package/src/i18n.ts +18 -0
  179. package/src/input/range-input-example.component.ts +29 -0
  180. package/src/input/range-input-example.module.ts +19 -0
  181. package/src/lazy/component-one.component.ts +28 -0
  182. package/src/lazy/component-two.component.ts +17 -0
  183. package/src/lazy/index.ts +1 -0
  184. package/src/lazy/lazy-loaded.module.ts +21 -0
  185. package/src/lazy/lazy-routing.module.ts +21 -0
  186. package/src/lazy/lazy.hooks.ts +24 -0
  187. package/src/lazy-widget/index.ts +1 -0
  188. package/src/lazy-widget/lazy-widget-config/index.ts +1 -0
  189. package/src/lazy-widget/lazy-widget-config/lazy-widget-config.component.ts +10 -0
  190. package/src/lazy-widget/lazy-widget-view/index.ts +1 -0
  191. package/src/lazy-widget/lazy-widget-view/lazy-widget-view.component.ts +10 -0
  192. package/src/lazy-widget/lazy-widget.module.ts +27 -0
  193. package/src/list/index.ts +1 -0
  194. package/src/list/list/list-check/list-check.component.html +35 -0
  195. package/src/list/list/list-check/list-check.component.ts +47 -0
  196. package/src/list/list/list-check/list-check.module.ts +21 -0
  197. package/src/list/list/list-timeline/list-timeline.component.html +30 -0
  198. package/src/list/list/list-timeline/list-timeline.component.ts +46 -0
  199. package/src/list/list/list-timeline/list-timeline.module.ts +21 -0
  200. package/src/list/list-virtual-scroll/list-virtual-scroll-check/list-virtual-scroll-check.component.html +105 -0
  201. package/src/list/list-virtual-scroll/list-virtual-scroll-check/list-virtual-scroll-check.component.ts +70 -0
  202. package/src/list/list-virtual-scroll/list-virtual-scroll-check/list-virtual-scroll-check.module.ts +22 -0
  203. package/src/list/list-virtual-scroll/list-virtual-scroll-timeline/list-virtual-scroll-timeline.component.html +37 -0
  204. package/src/list/list-virtual-scroll/list-virtual-scroll-timeline/list-virtual-scroll-timeline.component.ts +69 -0
  205. package/src/list/list-virtual-scroll/list-virtual-scroll-timeline/list-virtual-scroll-timeline.module.ts +24 -0
  206. package/src/list/lists.module.ts +17 -0
  207. package/src/main.ts +23 -0
  208. package/src/maps/cluster-map/cluster-map-example.component.html +60 -0
  209. package/src/maps/cluster-map/cluster-map-example.component.ts +39 -0
  210. package/src/maps/cluster-map/cluster-map-example.module.ts +24 -0
  211. package/src/maps/cluster-map-root-node/cluster-map-root-node-example.component.html +54 -0
  212. package/src/maps/cluster-map-root-node/cluster-map-root-node-example.component.ts +54 -0
  213. package/src/maps/cluster-map-root-node/cluster-map-root-node-example.module.ts +26 -0
  214. package/src/maps/map-examples.module.ts +18 -0
  215. package/src/maps/map-popup/map-popup-example.component.html +34 -0
  216. package/src/maps/map-popup/map-popup-example.component.ts +43 -0
  217. package/src/maps/map-popup/map-popup-example.module.ts +24 -0
  218. package/src/maps/simple-map/simple-map-example.component.html +59 -0
  219. package/src/maps/simple-map/simple-map-example.component.ts +70 -0
  220. package/src/maps/simple-map/simple-map-example.module.ts +24 -0
  221. package/src/modal/confirm-modal/confirm-modal-example.component.ts +69 -0
  222. package/src/modal/confirm-modal/confirm-modal-example.module.ts +22 -0
  223. package/src/modal/ngx-modal/ngx-modal-example.component.ts +34 -0
  224. package/src/modal/ngx-modal/ngx-modal-example.module.ts +22 -0
  225. package/src/modal/simple-modal/modal-example.component.ts +34 -0
  226. package/src/modal/simple-modal/modal.example.module.ts +21 -0
  227. package/src/polyfills.ts +33 -0
  228. package/src/popconfirm/pop-confirm-example.component.ts +61 -0
  229. package/src/popconfirm/pop-confirm-example.module.ts +23 -0
  230. package/src/properties-list/properties-list-example.component.ts +49 -0
  231. package/src/properties-list/properties-list-example.module.ts +21 -0
  232. package/src/provider-configuration/index.ts +3 -0
  233. package/src/provider-configuration/introduction-example/introduction.component.ts +69 -0
  234. package/src/provider-configuration/introduction-example/introduction.module.ts +21 -0
  235. package/src/provider-configuration/provider-configuration-example/demo-provider.guard.ts +9 -0
  236. package/src/provider-configuration/provider-configuration-example/provider-configuration.module.ts +48 -0
  237. package/src/quick-link/quick-link-example.component.ts +39 -0
  238. package/src/quick-link/quick-link-example.module.ts +23 -0
  239. package/src/realtime/index.ts +1 -0
  240. package/src/realtime/realtime-tutorial.component.html +52 -0
  241. package/src/realtime/realtime-tutorial.component.ts +91 -0
  242. package/src/realtime/realtime-tutorial.module.ts +21 -0
  243. package/src/redirect-to-last-route/index.ts +1 -0
  244. package/src/redirect-to-last-route/redirect-to-last-route-guard.service.ts +16 -0
  245. package/src/redirect-to-last-route/redirect-to-last-route.module.ts +20 -0
  246. package/src/redirect-to-last-route/view-context-redirect.service.ts +53 -0
  247. package/src/selector/asset-selector-example/child-devices/asset-selector-child-devices.component.ts +49 -0
  248. package/src/selector/asset-selector-example/child-devices/asset-selector-child-devices.module.ts +24 -0
  249. package/src/selector/asset-selector-example/column-header/asset-selector-column-header.component.ts +46 -0
  250. package/src/selector/asset-selector-example/column-header/asset-selector-column-header.module.ts +24 -0
  251. package/src/selector/asset-selector-example/different-root/asset-selector-different-root.component.ts +87 -0
  252. package/src/selector/asset-selector-example/different-root/asset-selector-different-root.module.ts +24 -0
  253. package/src/selector/asset-selector-example/general-example/asset-selector-example.component.html +342 -0
  254. package/src/selector/asset-selector-example/general-example/asset-selector-example.component.ts +34 -0
  255. package/src/selector/asset-selector-example/general-example/asset-selector-example.module.ts +22 -0
  256. package/src/selector/asset-selector-example/global-search/asset-selector-global-search.component.ts +50 -0
  257. package/src/selector/asset-selector-example/global-search/asset-selector-global-search.module.ts +24 -0
  258. package/src/selector/asset-selector-example/miller-columns-options/asset-selector-miller-example.component.ts +85 -0
  259. package/src/selector/asset-selector-example/miller-columns-options/asset-selector-miller-example.module.ts +26 -0
  260. package/src/selector/asset-selector-example/multi-select/asset-selector-multi-select.component.ts +50 -0
  261. package/src/selector/asset-selector-example/multi-select/asset-selector-multi-select.module.ts +24 -0
  262. package/src/selector/asset-selector-example/only-devices/asset-selector-only-devices.component.ts +44 -0
  263. package/src/selector/asset-selector-example/only-devices/asset-selector-only-devices.module.ts +24 -0
  264. package/src/selector/asset-selector-example/single-search/asset-selector-single-search.component.ts +71 -0
  265. package/src/selector/asset-selector-example/single-search/asset-selector-single-search.module.ts +24 -0
  266. package/src/selector/asset-selector-example/single-select/asset-selector-single-select.component.ts +47 -0
  267. package/src/selector/asset-selector-example/single-select/asset-single-select.module.ts +24 -0
  268. package/src/selector/asset-selector-example/tree-devices/asset-selector-tree-devices.component.ts +62 -0
  269. package/src/selector/asset-selector-example/tree-devices/asset-selector-tree-devices.module.ts +24 -0
  270. package/src/selector/asset-selector-example/tree-options/asset-selector-tree-example.component.ts +83 -0
  271. package/src/selector/asset-selector-example/tree-options/asset-selector-tree-example.module.ts +26 -0
  272. package/src/selector/asset-selector-example/tree-search/asset-selector-tree-search.component.ts +75 -0
  273. package/src/selector/asset-selector-example/tree-search/asset-selector-tree-search.module.ts +24 -0
  274. package/src/selector/asset-selector-example/tree-single/asset-selector-tree-single.component.ts +66 -0
  275. package/src/selector/asset-selector-example/tree-single/asset-selector-tree-single.module.ts +24 -0
  276. package/src/selector/datapoint-selection-example/context-example/datapoint-selection-context-example.component.ts +54 -0
  277. package/src/selector/datapoint-selection-example/context-example/datapoint-selection-context-example.module.ts +24 -0
  278. package/src/selector/datapoint-selection-example/dragdrop-example/datapoint-selection-dragdrop-example.component.ts +43 -0
  279. package/src/selector/datapoint-selection-example/dragdrop-example/datapoint-selection-dragdrop-example.module.ts +24 -0
  280. package/src/selector/datapoint-selection-example/general-example/datapoint-selection-example.component.html +202 -0
  281. package/src/selector/datapoint-selection-example/general-example/datapoint-selection-example.component.ts +51 -0
  282. package/src/selector/datapoint-selection-example/general-example/datapoint-selection-example.module.ts +24 -0
  283. package/src/selector/datapoint-selection-example/list-example/datapoint-selection-list-example.component.ts +42 -0
  284. package/src/selector/datapoint-selection-example/list-example/datapoint-selection-list-example.module.ts +24 -0
  285. package/src/selector/datapoint-selection-example/modal-example/datapoint-selection-modal-example.component.ts +51 -0
  286. package/src/selector/datapoint-selection-example/modal-example/datapoint-selection-modal-example.module.ts +24 -0
  287. package/src/selector/datapoint-selection-example/no-templates-example/datapoint-selection-notemplates-example.component.ts +43 -0
  288. package/src/selector/datapoint-selection-example/no-templates-example/datapoint-selection-notemplates-example.module.ts +24 -0
  289. package/src/selector/datapoint-selection-example/selector/datapoint-selection-selector-example.component.ts +43 -0
  290. package/src/selector/datapoint-selection-example/selector/datapoint-selection-selector-example.module.ts +24 -0
  291. package/src/selector/datapoint-selection-example/validation-example/datapoint-selection-validation-example.component.ts +46 -0
  292. package/src/selector/datapoint-selection-example/validation-example/datapoint-selection-validation-example.module.ts +24 -0
  293. package/src/standalone-demo/index.ts +1 -0
  294. package/src/standalone-demo/standalone-component/standalone-component.component.html +4 -0
  295. package/src/standalone-demo/standalone-component/standalone-component.component.ts +11 -0
  296. package/src/standalone-demo/standalone-demo.module.ts +23 -0
  297. package/src/stepper/device-stepper.component.html +70 -0
  298. package/src/stepper/device-stepper.component.ts +98 -0
  299. package/src/stepper/device.model.ts +5 -0
  300. package/src/stepper/index.ts +1 -0
  301. package/src/stepper/stepper.component.ts +19 -0
  302. package/src/stepper/stepper.module.ts +24 -0
  303. package/src/stepper/stepper.service.ts +32 -0
  304. package/src/time/time-picker-example.component.ts +19 -0
  305. package/src/time/time-picker-example.module.ts +21 -0
  306. package/src/translations/date-translation/c8y-translation/c8y-date-translation.component.ts +23 -0
  307. package/src/translations/date-translation/c8y-translation/c8y-date-translation.module.ts +22 -0
  308. package/src/translations/date-translation/ng-translation/date-translation.component.ts +17 -0
  309. package/src/translations/date-translation/ng-translation/date-translation.module.ts +22 -0
  310. package/src/translations/dynamic-form-translation/dynamic-form-translation.component.ts +58 -0
  311. package/src/translations/dynamic-form-translation/dynamic-form-translation.module.ts +22 -0
  312. package/src/translations/index.ts +1 -0
  313. package/src/translations/locales/it.po +18 -0
  314. package/src/translations/locales/pt_BR.po +33 -0
  315. package/src/translations/new-language/new-language.component.html +45 -0
  316. package/src/translations/new-language/new-language.component.ts +19 -0
  317. package/src/translations/new-language/new-language.module.ts +21 -0
  318. package/src/translations/new-translate/new-translation.component.html +92 -0
  319. package/src/translations/new-translate/new-translation.component.ts +9 -0
  320. package/src/translations/new-translate/new-translation.module.ts +22 -0
  321. package/src/translations/text-translation/gettext-translation/text-translation-gettext.component.ts +18 -0
  322. package/src/translations/text-translation/gettext-translation/text-translation-gettext.module.ts +22 -0
  323. package/src/translations/text-translation/ngNonBindable-translation/text-translation-ngnonbindable.component.ts +22 -0
  324. package/src/translations/text-translation/ngNonBindable-translation/text-translation-ngnonbindable.module.ts +24 -0
  325. package/src/translations/text-translation/service-translation/text-translation-by-service.component.ts +38 -0
  326. package/src/translations/text-translation/service-translation/text-translation-by-service.module.ts +24 -0
  327. package/src/translations/translation-tabs.ts +50 -0
  328. package/src/translations/translations.module.ts +18 -0
  329. package/src/user-menu/index.ts +1 -0
  330. package/src/user-menu/user-menu.module.ts +13 -0
  331. package/src/user-menu/user-menu.ts +26 -0
  332. package/src/widget/demo-widget-config.component.ts +81 -0
  333. package/src/widget/demo-widget.component.ts +35 -0
  334. package/src/widget/demo-widget.module.ts +47 -0
  335. package/src/widget/index.ts +1 -0
  336. package/src/widget-resolvers/alternative-event.resolver.ts +21 -0
  337. package/src/widget-resolvers/event-property.resolver.ts +52 -0
  338. package/src/widget-resolvers/event.resolver.ts +100 -0
  339. package/src/widget-resolvers/index.ts +1 -0
  340. package/src/widget-resolvers/widget-resolvers-config/widget-resolvers-config.component.html +31 -0
  341. package/src/widget-resolvers/widget-resolvers-config/widget-resolvers-config.component.ts +67 -0
  342. package/src/widget-resolvers/widget-resolvers.component.html +13 -0
  343. package/src/widget-resolvers/widget-resolvers.component.ts +37 -0
  344. package/src/widget-resolvers/widget-resolvers.module.ts +50 -0
  345. package/tsconfig.app.json +18 -0
@@ -0,0 +1 @@
1
+ export * from './lazy-routing.module';
@@ -0,0 +1,21 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { RouterModule, Routes } from '@angular/router';
4
+ import { ComponentTwo } from './component-two.component';
5
+ import { ComponentOne } from './component-one.component';
6
+
7
+ const routes: Routes = [
8
+ {
9
+ path: 'one',
10
+ component: ComponentOne
11
+ },
12
+ {
13
+ path: 'two',
14
+ component: ComponentTwo
15
+ }
16
+ ];
17
+
18
+ @NgModule({
19
+ imports: [CommonModule, RouterModule.forChild(routes)]
20
+ })
21
+ export class LazyLoadedModule {}
@@ -0,0 +1,21 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule as NgCommonModule } from '@angular/common';
3
+ import { RouterModule, Routes } from '@angular/router';
4
+ import { CoreModule } from '@c8y/ngx-components';
5
+ import { hooks as lazyHooks } from './lazy.hooks';
6
+
7
+ /**
8
+ * Angular Routes.
9
+ * Within this array at least path (url) and components are linked.
10
+ */
11
+ const routes: Routes = [
12
+ {
13
+ path: 'lazy',
14
+ loadChildren: () => import('./lazy-loaded.module').then(m => m.LazyLoadedModule)
15
+ }
16
+ ];
17
+ @NgModule({
18
+ imports: [NgCommonModule, RouterModule.forChild(routes), CoreModule],
19
+ providers: [...lazyHooks]
20
+ })
21
+ export class LazyRoutingModule {}
@@ -0,0 +1,24 @@
1
+ import { NavigatorNode, hookNavigator } from '@c8y/ngx-components';
2
+
3
+ const root = new NavigatorNode({
4
+ label: 'Lazy loaded',
5
+ icon: 'hourglass-start'
6
+ });
7
+
8
+ root.add(
9
+ new NavigatorNode({
10
+ path: '/lazy/one',
11
+ label: 'One',
12
+ icon: 'thermometer'
13
+ })
14
+ );
15
+
16
+ root.add(
17
+ new NavigatorNode({
18
+ path: '/lazy/two',
19
+ label: 'Two',
20
+ icon: 'thermometer-3'
21
+ })
22
+ );
23
+
24
+ export const hooks = [hookNavigator(root)];
@@ -0,0 +1 @@
1
+ export * from './lazy-widget.module';
@@ -0,0 +1 @@
1
+ export * from './lazy-widget-config.component';
@@ -0,0 +1,10 @@
1
+ import { Component } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+
4
+ @Component({
5
+ selector: 'tutorial-lazy-widget-config',
6
+ template: `<p>This widget's configuration component/module is only loaded when needed.</p>`,
7
+ standalone: true,
8
+ imports: [CommonModule]
9
+ })
10
+ export class LazyWidgetConfigComponent {}
@@ -0,0 +1 @@
1
+ export * from './lazy-widget-view.component';
@@ -0,0 +1,10 @@
1
+ import { Component } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+
4
+ @Component({
5
+ selector: 'tutorial-lazy-widget-view',
6
+ template: `<p>This widget's view component/module is only loaded when needed.</p>`,
7
+ standalone: true,
8
+ imports: [CommonModule]
9
+ })
10
+ export class LazyWidgetViewComponent {}
@@ -0,0 +1,27 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { hookComponent } from '@c8y/ngx-components';
4
+
5
+ async function loadViewComponent() {
6
+ const { LazyWidgetViewComponent } = await import('./lazy-widget-view');
7
+ return LazyWidgetViewComponent;
8
+ }
9
+
10
+ async function loadConfigComponent() {
11
+ const { LazyWidgetConfigComponent } = await import('./lazy-widget-config');
12
+ return LazyWidgetConfigComponent;
13
+ }
14
+
15
+ @NgModule({
16
+ imports: [CommonModule],
17
+ providers: [
18
+ hookComponent({
19
+ id: 'tutorial-lazy-widget',
20
+ label: 'Lazy Loaded Widget',
21
+ description: 'Lazy Loaded Widget',
22
+ loadComponent: loadViewComponent,
23
+ loadConfigComponent: loadConfigComponent
24
+ })
25
+ ]
26
+ })
27
+ export class LazyWidgetModule {}
@@ -0,0 +1 @@
1
+ export * from './lists.module';
@@ -0,0 +1,35 @@
1
+ <c8y-title>List example</c8y-title>
2
+
3
+ <c8y-list-group>
4
+ <c8y-li>
5
+ <c8y-li-checkbox (onSelect)="checkAll = $event"></c8y-li-checkbox>
6
+ <label>All devices</label>
7
+ </c8y-li>
8
+ <c8y-li
9
+ *c8yFor="let device of devices; loadMore: 'show'"
10
+ #li
11
+ >
12
+ <c8y-li-checkbox
13
+ [selected]="checkAll"
14
+ (onSelect)="updateSelected($event, device)"
15
+ (click)="$event.stopPropagation()"
16
+ ></c8y-li-checkbox>
17
+ <c8y-li-icon [icon]="'file'"></c8y-li-icon>
18
+ <button
19
+ class="btn-clean"
20
+ (click)="li.collapsed = !li.collapsed"
21
+ >
22
+ {{ device.name || '-' }}
23
+ </button>
24
+ <c8y-li-action
25
+ icon="times"
26
+ (click)="deleteDevice(device.id)"
27
+ >
28
+ Delete
29
+ </c8y-li-action>
30
+ <c8y-li-collapse>
31
+ id:
32
+ <a [routerLink]="['/device', device.id]">{{ device.id }}</a>
33
+ </c8y-li-collapse>
34
+ </c8y-li>
35
+ </c8y-list-group>
@@ -0,0 +1,47 @@
1
+ import { Component } from '@angular/core';
2
+ import { IManagedObject, InventoryService, IResultList } from '@c8y/client';
3
+ import { CoreModule } from '@c8y/ngx-components';
4
+ import { RouterModule } from '@angular/router';
5
+
6
+ @Component({
7
+ selector: 'list-check',
8
+ templateUrl: './list-check.component.html',
9
+ standalone: true,
10
+ imports: [CoreModule, RouterModule]
11
+ })
12
+ export class ListCheckComponent {
13
+ devices: IResultList<IManagedObject>;
14
+ selected = { id: null, name: '' };
15
+ checkAll;
16
+
17
+ // The filter object will add query parameters
18
+ // to the request which is made by the service.
19
+ private filter: object = {
20
+ fragmentType: 'c8y_IsDevice',
21
+ // paging information will be a part of the response now
22
+ withTotalPages: true,
23
+ pageSize: 10
24
+ };
25
+
26
+ constructor(public inventory: InventoryService) {
27
+ this.loadDevices();
28
+ }
29
+
30
+ // Promise-based usage of InventoryService.
31
+ async loadDevices() {
32
+ this.devices = await this.inventory.list(this.filter);
33
+ }
34
+
35
+ // Delete a managedObject (as device) with given id from database.
36
+ async deleteDevice(id: string) {
37
+ if (id && id.length > 0) {
38
+ await this.inventory.delete(id);
39
+ this.loadDevices();
40
+ }
41
+ }
42
+
43
+ // triggered if a device is selected
44
+ updateSelected(checked, device) {
45
+ console.log(checked, device);
46
+ }
47
+ }
@@ -0,0 +1,21 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { hookNavigator, hookRoute, NavigatorNode } from '@c8y/ngx-components';
4
+
5
+ @NgModule({
6
+ imports: [CommonModule],
7
+ providers: [
8
+ hookRoute({
9
+ path: 'lists/list-check',
10
+ loadComponent: () => import('./list-check.component').then(m => m.ListCheckComponent)
11
+ }),
12
+ hookNavigator(
13
+ new NavigatorNode({
14
+ label: 'Basic list with checkboxes',
15
+ path: 'lists/list-check',
16
+ parent: 'Lists'
17
+ })
18
+ )
19
+ ]
20
+ })
21
+ export class ListCheckModule {}
@@ -0,0 +1,30 @@
1
+ <c8y-title>List example</c8y-title>
2
+
3
+ <c8y-list-group class="m-t-16">
4
+ <c8y-li-timeline *c8yFor="let device of devices; let i = index">
5
+ {{ device.creationTime | date }}
6
+ <c8y-li>
7
+ <c8y-li-radio (onSelect)="updateSelected($event, device)"></c8y-li-radio>
8
+ <c8y-li-icon [icon]="'rocket'"></c8y-li-icon>
9
+ {{ i + 1 }}. {{ device.name || '-' }}
10
+ <c8y-li-footer>
11
+ Device id:
12
+ <a [routerLink]="['/device', device.id]">{{ device.id }}</a>
13
+ {{ device.creationTime }}
14
+ </c8y-li-footer>
15
+
16
+ <c8y-li-action
17
+ icon="times"
18
+ (click)="deleteDevice(device.id)"
19
+ >
20
+ Delete
21
+ </c8y-li-action>
22
+ <c8y-li-action
23
+ icon="rocket"
24
+ (click)="(false)"
25
+ >
26
+ Launch to space
27
+ </c8y-li-action>
28
+ </c8y-li>
29
+ </c8y-li-timeline>
30
+ </c8y-list-group>
@@ -0,0 +1,46 @@
1
+ import { Component } from '@angular/core';
2
+ import { IManagedObject, InventoryService, IResultList } from '@c8y/client';
3
+ import { CoreModule } from '@c8y/ngx-components';
4
+ import { RouterModule } from '@angular/router';
5
+
6
+ @Component({
7
+ selector: 'list-timeline',
8
+ templateUrl: './list-timeline.component.html',
9
+ standalone: true,
10
+ imports: [CoreModule, RouterModule]
11
+ })
12
+ export class ListTimelineComponent {
13
+ devices: IResultList<IManagedObject>;
14
+ selected = { id: null, name: '' };
15
+
16
+ // The filter object will add query parameters
17
+ // to the request which is made by the service.
18
+ private filter: object = {
19
+ fragmentType: 'c8y_IsDevice',
20
+ // paging information will be a part of the response now
21
+ withTotalPages: true,
22
+ pageSize: 10
23
+ };
24
+
25
+ constructor(public inventory: InventoryService) {
26
+ this.loadDevices();
27
+ }
28
+
29
+ // Promise-based usage of InventoryService.
30
+ async loadDevices() {
31
+ this.devices = await this.inventory.list(this.filter);
32
+ }
33
+
34
+ // Delete a managedObject (as device) with given id from database.
35
+ async deleteDevice(id: string) {
36
+ if (id && id.length > 0) {
37
+ await this.inventory.delete(id);
38
+ this.loadDevices();
39
+ }
40
+ }
41
+
42
+ // triggered if a device is selected
43
+ updateSelected(checked, device) {
44
+ console.log(checked, device);
45
+ }
46
+ }
@@ -0,0 +1,21 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
4
+
5
+ @NgModule({
6
+ imports: [CommonModule],
7
+ providers: [
8
+ hookRoute({
9
+ path: 'lists/list-timeline',
10
+ loadComponent: () => import('./list-timeline.component').then(m => m.ListTimelineComponent)
11
+ }),
12
+ hookNavigator(
13
+ new NavigatorNode({
14
+ label: 'Basic list with timeline',
15
+ path: 'lists/list-timeline',
16
+ parent: 'Lists'
17
+ })
18
+ )
19
+ ]
20
+ })
21
+ export class ListTimelineModule {}
@@ -0,0 +1,105 @@
1
+ <c8y-title>List example</c8y-title>
2
+
3
+ <c8y-range>
4
+ <input
5
+ id="range"
6
+ type="range"
7
+ min="0"
8
+ max="10000"
9
+ step="100"
10
+ [(ngModel)]="dataMultiplier"
11
+ (ngModelChange)="loadDevicesContainerStrategy()"
12
+ />
13
+ </c8y-range>
14
+ <p>number of loaded objects: {{ devicesContainerStrategy?.data?.length }}</p>
15
+ <c8y-list-group>
16
+ <c8y-li>
17
+ <c8y-li-checkbox (onSelect)="checkAll = $event"></c8y-li-checkbox>
18
+ <label>All devices</label>
19
+ </c8y-li>
20
+ <c8y-li
21
+ *c8yFor="
22
+ let device of devicesContainerStrategy;
23
+ loadMore: 'show';
24
+ enableVirtualScroll: true;
25
+ virtualScrollElementSize: 40;
26
+ virtualScrollStrategy: 'fixed';
27
+ virtualScrollContainerHeight: 400
28
+ "
29
+ #li
30
+ >
31
+ <c8y-li-checkbox
32
+ [selected]="checkAll"
33
+ (onSelect)="updateSelected($event, device)"
34
+ (click)="$event.stopPropagation()"
35
+ ></c8y-li-checkbox>
36
+ <c8y-li-icon [icon]="'file'"></c8y-li-icon>
37
+ <button
38
+ class="btn-clean"
39
+ (click)="li.collapsed = !li.collapsed"
40
+ >
41
+ {{ device.name || '-' }}
42
+ </button>
43
+ <c8y-li-action
44
+ icon="times"
45
+ (click)="deleteDevice(device.id)"
46
+ >
47
+ Delete
48
+ </c8y-li-action>
49
+ <c8y-li-collapse>
50
+ id:
51
+ <a [routerLink]="['/device', device.id]">{{ device.id }}</a>
52
+ </c8y-li-collapse>
53
+ </c8y-li>
54
+ </c8y-list-group>
55
+
56
+ <hr />
57
+
58
+ <label
59
+ class="c8y-checkbox"
60
+ title="Enable basic c8yFor with same number of elements as above:"
61
+ >
62
+ <input
63
+ type="checkbox"
64
+ [(ngModel)]="enableBasicList"
65
+ />
66
+ <span></span>
67
+ <span>
68
+ Enable basic (non virtual scroll) c8yFor with same number of elements as above (this might crash
69
+ Your browser if input data is big):
70
+ </span>
71
+ </label>
72
+
73
+ <c8y-list-group *ngIf="enableBasicList">
74
+ <c8y-li>
75
+ <c8y-li-checkbox (onSelect)="checkAll = $event"></c8y-li-checkbox>
76
+ <label>All devices</label>
77
+ </c8y-li>
78
+ <c8y-li
79
+ *c8yFor="let device of devicesContainerStrategy"
80
+ #li
81
+ >
82
+ <c8y-li-checkbox
83
+ [selected]="checkAll"
84
+ (onSelect)="updateSelected($event, device)"
85
+ (click)="$event.stopPropagation()"
86
+ ></c8y-li-checkbox>
87
+ <c8y-li-icon [icon]="'file'"></c8y-li-icon>
88
+ <button
89
+ class="btn-clean"
90
+ (click)="li.collapsed = !li.collapsed"
91
+ >
92
+ {{ device.name || '-' }}
93
+ </button>
94
+ <c8y-li-action
95
+ icon="times"
96
+ (click)="deleteDevice(device.id)"
97
+ >
98
+ Delete
99
+ </c8y-li-action>
100
+ <c8y-li-collapse>
101
+ id:
102
+ <a [routerLink]="['/device', device.id]">{{ device.id }}</a>
103
+ </c8y-li-collapse>
104
+ </c8y-li>
105
+ </c8y-list-group>
@@ -0,0 +1,70 @@
1
+ import { CoreModule, StepperService, throttle } from '@c8y/ngx-components';
2
+ import { Component } from '@angular/core';
3
+ import { IManagedObject, InventoryService, IResultList } from '@c8y/client';
4
+ import { RouterModule } from '@angular/router';
5
+
6
+ /**
7
+ * The ListComponent shows how to generate a list.
8
+ */
9
+ @Component({
10
+ selector: 'list-virtual-scroll-check',
11
+ templateUrl: './list-virtual-scroll-check.component.html',
12
+ standalone: true,
13
+ imports: [CoreModule, RouterModule],
14
+ providers: [StepperService]
15
+ })
16
+ export class ListVirtualScrollCheckComponent {
17
+ devices: IResultList<IManagedObject>;
18
+ devicesContainerStrategy: IResultList<IManagedObject>;
19
+ selected = { id: null, name: '' };
20
+ checkAll;
21
+ enableBasicList = false;
22
+ dataMultiplier = 1;
23
+
24
+ // The filter object will add query parameters
25
+ // to the request which is made by the service.
26
+ private filter: object = {
27
+ fragmentType: 'c8y_IsDevice',
28
+ // paging information will be a part of the response now
29
+ withTotalPages: true,
30
+ pageSize: 10
31
+ };
32
+
33
+ constructor(public inventory: InventoryService) {
34
+ this.loadDevices();
35
+ this.loadDevicesContainerStrategy();
36
+ }
37
+
38
+ // Promise-based usage of InventoryService.
39
+ async loadDevices() {
40
+ this.devices = await this.inventory.list(this.filter);
41
+ }
42
+
43
+ @throttle(500, { trailing: false })
44
+ async loadDevicesContainerStrategy() {
45
+ const filter: any = { ...this.filter };
46
+ filter.pageSize = 999999999;
47
+
48
+ const items = await this.inventory.list(filter);
49
+
50
+ // Let us simulate that we have very large amount of data to display:
51
+ const template = [...items.data];
52
+ while (items.data.length < this.dataMultiplier) {
53
+ items.data.push(...template);
54
+ }
55
+ this.devicesContainerStrategy = items;
56
+ }
57
+
58
+ // Delete a managedObject (as device) with given id from database.
59
+ async deleteDevice(id: string) {
60
+ if (id && id.length > 0) {
61
+ await this.inventory.delete(id);
62
+ this.loadDevices();
63
+ }
64
+ }
65
+
66
+ // triggered if a device is selected
67
+ updateSelected(checked, device) {
68
+ console.log(checked, device);
69
+ }
70
+ }
@@ -0,0 +1,22 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { hookNavigator, hookRoute, NavigatorNode } from '@c8y/ngx-components';
4
+
5
+ @NgModule({
6
+ imports: [CommonModule],
7
+ providers: [
8
+ hookRoute({
9
+ path: 'lists/list-virtual-scroll-check',
10
+ loadComponent: () =>
11
+ import('./list-virtual-scroll-check.component').then(m => m.ListVirtualScrollCheckComponent)
12
+ }),
13
+ hookNavigator(
14
+ new NavigatorNode({
15
+ label: 'Virtual scroll with checkboxes',
16
+ path: 'lists/list-virtual-scroll-check',
17
+ parent: 'Lists'
18
+ })
19
+ )
20
+ ]
21
+ })
22
+ export class ListVirtualScrollCheckModule {}
@@ -0,0 +1,37 @@
1
+ <c8y-title>List example</c8y-title>
2
+
3
+ <c8y-list-group class="m-t-16">
4
+ <c8y-li-timeline
5
+ *c8yFor="
6
+ let device of devices;
7
+ let i = index;
8
+ enableVirtualScroll: true;
9
+ virtualScrollElementSize: 68
10
+ "
11
+ >
12
+ {{ device.creationTime | date }}
13
+ <c8y-li>
14
+ <c8y-li-radio (onSelect)="updateSelected($event, device)"></c8y-li-radio>
15
+ <c8y-li-icon [icon]="'rocket'"></c8y-li-icon>
16
+ {{ i + 1 }}. {{ device.name || '-' }}
17
+ <c8y-li-footer>
18
+ Device id:
19
+ <a [routerLink]="['/device', device.id]">{{ device.id }}</a>
20
+ {{ device.creationTime }}
21
+ </c8y-li-footer>
22
+
23
+ <c8y-li-action
24
+ icon="times"
25
+ (click)="deleteDevice(device.id)"
26
+ >
27
+ Delete
28
+ </c8y-li-action>
29
+ <c8y-li-action
30
+ icon="rocket"
31
+ (click)="(false)"
32
+ >
33
+ Launch to space
34
+ </c8y-li-action>
35
+ </c8y-li>
36
+ </c8y-li-timeline>
37
+ </c8y-list-group>
@@ -0,0 +1,69 @@
1
+ import { CoreModule, StepperService, throttle } from '@c8y/ngx-components';
2
+ import { Component } from '@angular/core';
3
+ import { IManagedObject, InventoryService, IResultList } from '@c8y/client';
4
+ import { RouterModule } from '@angular/router';
5
+
6
+ /**
7
+ * The ListComponent shows how to generate a list.
8
+ */
9
+ @Component({
10
+ selector: 'list-virtual-scroll-timeline',
11
+ templateUrl: './list-virtual-scroll-timeline.component.html',
12
+ standalone: true,
13
+ imports: [CoreModule, RouterModule],
14
+ providers: [StepperService]
15
+ })
16
+ export class ListVirtualScrollTimelineComponent {
17
+ devices: IResultList<IManagedObject>;
18
+ devicesContainerStrategy: IResultList<IManagedObject>;
19
+ selected = { id: null, name: '' };
20
+ dataMultiplier = 1;
21
+
22
+ // The filter object will add query parameters
23
+ // to the request which is made by the service.
24
+ private filter: object = {
25
+ fragmentType: 'c8y_IsDevice',
26
+ // paging information will be a part of the response now
27
+ withTotalPages: true,
28
+ pageSize: 10
29
+ };
30
+
31
+ constructor(public inventory: InventoryService) {
32
+ // _ annotation to mark this string as translatable string.
33
+ this.loadDevices();
34
+ this.loadDevicesContainerStrategy();
35
+ }
36
+
37
+ // Promise-based usage of InventoryService.
38
+ async loadDevices() {
39
+ this.devices = await this.inventory.list(this.filter);
40
+ }
41
+
42
+ @throttle(500, { trailing: false })
43
+ async loadDevicesContainerStrategy() {
44
+ const filter: any = { ...this.filter };
45
+ filter.pageSize = 999999999;
46
+
47
+ const items = await this.inventory.list(filter);
48
+
49
+ // Let us simulate that we have very large amount of data to display:
50
+ const template = [...items.data];
51
+ while (items.data.length < this.dataMultiplier) {
52
+ items.data.push(...template);
53
+ }
54
+ this.devicesContainerStrategy = items;
55
+ }
56
+
57
+ // Delete a managedObject (as device) with given id from database.
58
+ async deleteDevice(id: string) {
59
+ if (id && id.length > 0) {
60
+ await this.inventory.delete(id);
61
+ this.loadDevices();
62
+ }
63
+ }
64
+
65
+ // triggered if a device is selected
66
+ updateSelected(checked, device) {
67
+ console.log(checked, device);
68
+ }
69
+ }
@@ -0,0 +1,24 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
4
+
5
+ @NgModule({
6
+ imports: [CommonModule],
7
+ providers: [
8
+ hookRoute({
9
+ path: 'lists/list-virtual-scroll-timeline',
10
+ loadComponent: () =>
11
+ import('./list-virtual-scroll-timeline.component').then(
12
+ m => m.ListVirtualScrollTimelineComponent
13
+ )
14
+ }),
15
+ hookNavigator(
16
+ new NavigatorNode({
17
+ label: 'Virtual scroll with filter',
18
+ path: 'lists/list-virtual-scroll-timeline',
19
+ parent: 'Lists'
20
+ })
21
+ )
22
+ ]
23
+ })
24
+ export class ListVirtualScrollTimelineModule {}