@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.
- package/.browserslistrc +16 -0
- package/NOTICES +41743 -0
- package/cumulocity.config.ts +643 -0
- package/package.json +22 -0
- package/src/__mocks/README.md +73 -0
- package/src/__mocks/global-mocks/inventory.interceptor.ts +145 -0
- package/src/__mocks/global-mocks/measurements.interceptor.ts +58 -0
- package/src/__mocks/index.ts +5 -0
- package/src/__mocks/mock.model.ts +76 -0
- package/src/__mocks/mock.module.ts +121 -0
- package/src/__mocks/mock.realtime-subject.ts +68 -0
- package/src/__mocks/mock.realtime.ts +31 -0
- package/src/__mocks/mock.service.ts +113 -0
- package/src/__mocks/scoped-mocks/boilerplate.ts +54 -0
- package/src/__mocks/scoped-mocks/context-dashboard.ts +47 -0
- package/src/__mocks/scoped-mocks/device-data-grid.ts +44 -0
- package/src/__mocks/scoped-mocks/named-context-dashboard.ts +42 -0
- package/src/__mocks/scoped-mocks/server-side-data-grid.ts +47 -0
- package/src/__mocks/scoped-mocks/service-dashboard.ts +42 -0
- package/src/__mocks/utils/clean.realtime.ts +23 -0
- package/src/__mocks/utils/common.ts +114 -0
- package/src/__mocks/utils/generators/alarms.ts +30 -0
- package/src/__mocks/utils/generators/events.ts +14 -0
- package/src/__mocks/utils/generators/managedObjects.ts +208 -0
- package/src/__mocks/utils/generators/measurement.ts +22 -0
- package/src/__mocks/utils/generators/operations.ts +67 -0
- package/src/__mocks/utils/grid.ts +87 -0
- package/src/__mocks/utils/realtime.ts +59 -0
- package/src/alert/alert-example.components.html +110 -0
- package/src/alert/alert-example.components.ts +77 -0
- package/src/alert/alert-example.module.ts +21 -0
- package/src/app/app.module.ts +72 -0
- package/src/bootstrap.ts +19 -0
- package/src/branding/branding.less +78 -0
- package/src/client-interceptor/client-interceptor.module.ts +12 -0
- package/src/client-interceptor/client-interceptor.service.ts +61 -0
- package/src/client-interceptor/index.ts +1 -0
- package/src/component-styles/cascading-style-sheets-example/cascading-style-sheets-example.component.css +17 -0
- package/src/component-styles/cascading-style-sheets-example/cascading-style-sheets-example.component.ts +11 -0
- package/src/component-styles/cascading-style-sheets-example/cascading-style-sheets-example.module.ts +26 -0
- package/src/component-styles/leaner-style-sheets-example/leaner-style-sheets-example.component.less +14 -0
- package/src/component-styles/leaner-style-sheets-example/leaner-style-sheets-example.component.ts +11 -0
- package/src/component-styles/leaner-style-sheets-example/leaner-style-sheets-example.module.ts +26 -0
- package/src/component-styles/syntactically-awesome-style-sheets-example/syntactically-awesome-style-sheets-example.component.scss +13 -0
- package/src/component-styles/syntactically-awesome-style-sheets-example/syntactically-awesome-style-sheets-example.component.ts +11 -0
- package/src/component-styles/syntactically-awesome-style-sheets-example/syntactically-awesome-style-sheets-example.module.ts +26 -0
- package/src/dashboard/context-dashboard/context-dashboard.component.ts +32 -0
- package/src/dashboard/context-dashboard/context-dashboard.module.ts +22 -0
- package/src/dashboard/custom-dashboard/custom-dashboard.component.html +180 -0
- package/src/dashboard/custom-dashboard/custom-dashboard.component.ts +52 -0
- package/src/dashboard/custom-dashboard/custom-dashboard.module.ts +22 -0
- package/src/dashboard/index.ts +4 -0
- package/src/dashboard/named-context-dashboard/named-context-dashboard.component.ts +51 -0
- package/src/dashboard/named-context-dashboard/named-context-dashboard.module.ts +37 -0
- package/src/dashboard/service-dashboard/service-dashboard.component.ts +51 -0
- package/src/dashboard/service-dashboard/service-dashboard.module.ts +35 -0
- package/src/dashboard/widget-dashboard/widget-dashboard.component.ts +65 -0
- package/src/dashboard/widget-dashboard/widget-dashboard.module.ts +22 -0
- package/src/date-time-range/date-time-range-example.component.ts +109 -0
- package/src/date-time-range/date-time-range-example.module.ts +21 -0
- package/src/dynamic-forms/custom-element-example/custom-element-example.component.ts +70 -0
- package/src/dynamic-forms/custom-element-example/custom-element-example.module.ts +38 -0
- package/src/dynamic-forms/custom-element-example/types/checkbox/checkbox.type.component.html +26 -0
- package/src/dynamic-forms/custom-element-example/types/checkbox/checkbox.type.component.ts +21 -0
- package/src/dynamic-forms/dynamic-forms.module.ts +16 -0
- package/src/dynamic-forms/index.ts +2 -0
- package/src/dynamic-forms/introduction-example/introduction-example.component.ts +116 -0
- package/src/dynamic-forms/introduction-example/introduction-example.module.ts +24 -0
- package/src/dynamic-forms/json-schema-example/json-schema-example.component.html +33 -0
- package/src/dynamic-forms/json-schema-example/json-schema-example.component.ts +102 -0
- package/src/dynamic-forms/json-schema-example/json-schema-example.module.ts +24 -0
- package/src/for-of-directive/for-of-example.component.html +19 -0
- package/src/for-of-directive/for-of-example.component.ts +39 -0
- package/src/for-of-directive/for-of.module.ts +18 -0
- package/src/forms/form-validation/forms-validation.component.html +105 -0
- package/src/forms/form-validation/forms-validation.component.ts +52 -0
- package/src/forms/form-validation/forms.module.ts +22 -0
- package/src/forms/index.ts +1 -0
- package/src/grids/client-grid-example/client-grid-example.component.html +16 -0
- package/src/grids/client-grid-example/client-grid-example.component.ts +166 -0
- package/src/grids/client-grid-example/client-grid-example.module.ts +24 -0
- package/src/grids/client-grid-example/data.ts +427 -0
- package/src/grids/device-grid-example/device-grid-example.component.html +58 -0
- package/src/grids/device-grid-example/device-grid-example.component.ts +134 -0
- package/src/grids/device-grid-example/device-grid-example.module.ts +24 -0
- package/src/grids/grids-tabs.ts +37 -0
- package/src/grids/grids.module.ts +17 -0
- package/src/grids/index.ts +1 -0
- package/src/grids/server-grid-example/server-grid-example.component.html +26 -0
- package/src/grids/server-grid-example/server-grid-example.component.ts +121 -0
- package/src/grids/server-grid-example/server-grid-example.module.ts +24 -0
- package/src/grids/server-grid-example/server-grid-example.service.ts +266 -0
- package/src/grids/server-grid-example/type-data-grid-column/type.cell-renderer.component.ts +31 -0
- package/src/grids/server-grid-example/type-data-grid-column/type.data-grid-column.ts +47 -0
- package/src/grids/server-grid-example/type-data-grid-column/type.filtering-form-renderer.component.ts +107 -0
- package/src/grids/server-grid-example/type-data-grid-column/type.header-cell-renderer.component.ts +20 -0
- package/src/hello/hello.component.ts +55 -0
- package/src/hello/hello.module.ts +20 -0
- package/src/hello/index.ts +1 -0
- package/src/help/help-example.component.ts +23 -0
- package/src/help/help-example.module.ts +20 -0
- package/src/hooks/action/action.module.ts +34 -0
- package/src/hooks/action/action.ts +41 -0
- package/src/hooks/action/basic-view/basic-view.component.html +8 -0
- package/src/hooks/action/basic-view/basic-view.component.ts +18 -0
- package/src/hooks/action/index.ts +1 -0
- package/src/hooks/action/logout-action/logout-action.component.ts +18 -0
- package/src/hooks/action-bar/action-bar.module.ts +34 -0
- package/src/hooks/action-bar/action-bar.ts +28 -0
- package/src/hooks/action-bar/basic-view/basic-view.component.html +8 -0
- package/src/hooks/action-bar/basic-view/basic-view.component.ts +18 -0
- package/src/hooks/action-bar/index.ts +1 -0
- package/src/hooks/action-bar/refresh-element/refresh-element.component.html +15 -0
- package/src/hooks/action-bar/refresh-element/refresh-element.component.ts +21 -0
- package/src/hooks/breadcrumbs/basic-view/basic-view.component.html +7 -0
- package/src/hooks/breadcrumbs/basic-view/basic-view.component.ts +18 -0
- package/src/hooks/breadcrumbs/breadcrumbs.module.ts +34 -0
- package/src/hooks/breadcrumbs/breadcrumbs.ts +93 -0
- package/src/hooks/breadcrumbs/index.ts +1 -0
- package/src/hooks/component/basic-view/basic-view.component.html +11 -0
- package/src/hooks/component/basic-view/basic-view.component.ts +16 -0
- package/src/hooks/component/basic-view/simple.component.ts +8 -0
- package/src/hooks/component/component.module.ts +38 -0
- package/src/hooks/component/index.ts +1 -0
- package/src/hooks/drawer/index.ts +2 -0
- package/src/hooks/drawer/left-drawer-tutorial/left-drawer-tutorial.component.ts +8 -0
- package/src/hooks/drawer/left-drawer-tutorial/left-drawer.module.ts +10 -0
- package/src/hooks/drawer/right-drawer-tutorial/right-drawer-tutorial.component.ts +8 -0
- package/src/hooks/drawer/right-drawer-tutorial/right-drawer.module.ts +10 -0
- package/src/hooks/generic-wizard/index.ts +1 -0
- package/src/hooks/generic-wizard/minimal-setup/minimal-setup.component.ts +12 -0
- package/src/hooks/generic-wizard/minimal-setup/multiple-entries-one.component.ts +25 -0
- package/src/hooks/generic-wizard/minimal-setup/multiple-entries-two.component.ts +25 -0
- package/src/hooks/generic-wizard/minimal-setup/stepper-example.component.html +38 -0
- package/src/hooks/generic-wizard/minimal-setup/stepper-example.component.ts +33 -0
- package/src/hooks/generic-wizard/wizard-tabs.ts +22 -0
- package/src/hooks/generic-wizard/wizard.component.html +51 -0
- package/src/hooks/generic-wizard/wizard.component.ts +86 -0
- package/src/hooks/generic-wizard/wizard.module.ts +79 -0
- package/src/hooks/hooks.module.ts +19 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/navigator/index.ts +1 -0
- package/src/hooks/navigator/navigator.module.ts +21 -0
- package/src/hooks/navigator/navigator.ts +35 -0
- package/src/hooks/navigator/time-navigator-node/time-navigator-node.component.ts +19 -0
- package/src/hooks/navigator-route/basic-view/basic-view.component.html +7 -0
- package/src/hooks/navigator-route/basic-view/basic-view.component.ts +18 -0
- package/src/hooks/navigator-route/index.ts +1 -0
- package/src/hooks/navigator-route/navigator-route.module.ts +27 -0
- package/src/hooks/route/device/device-info.component.html +2 -0
- package/src/hooks/route/device/device-info.component.ts +13 -0
- package/src/hooks/route/device/device-tab-context.component.html +15 -0
- package/src/hooks/route/device/device-tab-context.component.ts +13 -0
- package/src/hooks/route/index.ts +1 -0
- package/src/hooks/route/random.guard.ts +12 -0
- package/src/hooks/route/route.module.ts +51 -0
- package/src/hooks/state/hook-state.module.ts +25 -0
- package/src/hooks/state/hook-with-service-example.component.html +29 -0
- package/src/hooks/state/hook-with-service-example.component.ts +36 -0
- package/src/hooks/stepper/basic-view/basic-view.component.html +17 -0
- package/src/hooks/stepper/basic-view/basic-view.component.ts +31 -0
- package/src/hooks/stepper/index.ts +4 -0
- package/src/hooks/stepper/stepper-hook.module.ts +53 -0
- package/src/hooks/stepper/steps/step1.component.html +24 -0
- package/src/hooks/stepper/steps/step1.component.ts +18 -0
- package/src/hooks/stepper/steps/step2.component.html +7 -0
- package/src/hooks/stepper/steps/step2.component.ts +11 -0
- package/src/hooks/tabs/awesome/awesome.component.html +7 -0
- package/src/hooks/tabs/awesome/awesome.component.ts +21 -0
- package/src/hooks/tabs/index.ts +1 -0
- package/src/hooks/tabs/outstanding/outstanding.component.html +22 -0
- package/src/hooks/tabs/outstanding/outstanding.component.ts +27 -0
- package/src/hooks/tabs/tab.ts +44 -0
- package/src/hooks/tabs/tabs.module.ts +37 -0
- package/src/hooks/version/custom-version-factory.service.ts +49 -0
- package/src/hooks/version/index.ts +1 -0
- package/src/hooks/version/version.module.ts +11 -0
- package/src/i18n.ts +18 -0
- package/src/input/range-input-example.component.ts +29 -0
- package/src/input/range-input-example.module.ts +19 -0
- package/src/lazy/component-one.component.ts +28 -0
- package/src/lazy/component-two.component.ts +17 -0
- package/src/lazy/index.ts +1 -0
- package/src/lazy/lazy-loaded.module.ts +21 -0
- package/src/lazy/lazy-routing.module.ts +21 -0
- package/src/lazy/lazy.hooks.ts +24 -0
- package/src/lazy-widget/index.ts +1 -0
- package/src/lazy-widget/lazy-widget-config/index.ts +1 -0
- package/src/lazy-widget/lazy-widget-config/lazy-widget-config.component.ts +10 -0
- package/src/lazy-widget/lazy-widget-view/index.ts +1 -0
- package/src/lazy-widget/lazy-widget-view/lazy-widget-view.component.ts +10 -0
- package/src/lazy-widget/lazy-widget.module.ts +27 -0
- package/src/list/index.ts +1 -0
- package/src/list/list/list-check/list-check.component.html +35 -0
- package/src/list/list/list-check/list-check.component.ts +47 -0
- package/src/list/list/list-check/list-check.module.ts +21 -0
- package/src/list/list/list-timeline/list-timeline.component.html +30 -0
- package/src/list/list/list-timeline/list-timeline.component.ts +46 -0
- package/src/list/list/list-timeline/list-timeline.module.ts +21 -0
- package/src/list/list-virtual-scroll/list-virtual-scroll-check/list-virtual-scroll-check.component.html +105 -0
- package/src/list/list-virtual-scroll/list-virtual-scroll-check/list-virtual-scroll-check.component.ts +70 -0
- package/src/list/list-virtual-scroll/list-virtual-scroll-check/list-virtual-scroll-check.module.ts +22 -0
- package/src/list/list-virtual-scroll/list-virtual-scroll-timeline/list-virtual-scroll-timeline.component.html +37 -0
- package/src/list/list-virtual-scroll/list-virtual-scroll-timeline/list-virtual-scroll-timeline.component.ts +69 -0
- package/src/list/list-virtual-scroll/list-virtual-scroll-timeline/list-virtual-scroll-timeline.module.ts +24 -0
- package/src/list/lists.module.ts +17 -0
- package/src/main.ts +23 -0
- package/src/maps/cluster-map/cluster-map-example.component.html +60 -0
- package/src/maps/cluster-map/cluster-map-example.component.ts +39 -0
- package/src/maps/cluster-map/cluster-map-example.module.ts +24 -0
- package/src/maps/cluster-map-root-node/cluster-map-root-node-example.component.html +54 -0
- package/src/maps/cluster-map-root-node/cluster-map-root-node-example.component.ts +54 -0
- package/src/maps/cluster-map-root-node/cluster-map-root-node-example.module.ts +26 -0
- package/src/maps/map-examples.module.ts +18 -0
- package/src/maps/map-popup/map-popup-example.component.html +34 -0
- package/src/maps/map-popup/map-popup-example.component.ts +43 -0
- package/src/maps/map-popup/map-popup-example.module.ts +24 -0
- package/src/maps/simple-map/simple-map-example.component.html +59 -0
- package/src/maps/simple-map/simple-map-example.component.ts +70 -0
- package/src/maps/simple-map/simple-map-example.module.ts +24 -0
- package/src/modal/confirm-modal/confirm-modal-example.component.ts +69 -0
- package/src/modal/confirm-modal/confirm-modal-example.module.ts +22 -0
- package/src/modal/ngx-modal/ngx-modal-example.component.ts +34 -0
- package/src/modal/ngx-modal/ngx-modal-example.module.ts +22 -0
- package/src/modal/simple-modal/modal-example.component.ts +34 -0
- package/src/modal/simple-modal/modal.example.module.ts +21 -0
- package/src/polyfills.ts +33 -0
- package/src/popconfirm/pop-confirm-example.component.ts +61 -0
- package/src/popconfirm/pop-confirm-example.module.ts +23 -0
- package/src/properties-list/properties-list-example.component.ts +49 -0
- package/src/properties-list/properties-list-example.module.ts +21 -0
- package/src/provider-configuration/index.ts +3 -0
- package/src/provider-configuration/introduction-example/introduction.component.ts +69 -0
- package/src/provider-configuration/introduction-example/introduction.module.ts +21 -0
- package/src/provider-configuration/provider-configuration-example/demo-provider.guard.ts +9 -0
- package/src/provider-configuration/provider-configuration-example/provider-configuration.module.ts +48 -0
- package/src/quick-link/quick-link-example.component.ts +39 -0
- package/src/quick-link/quick-link-example.module.ts +23 -0
- package/src/realtime/index.ts +1 -0
- package/src/realtime/realtime-tutorial.component.html +52 -0
- package/src/realtime/realtime-tutorial.component.ts +91 -0
- package/src/realtime/realtime-tutorial.module.ts +21 -0
- package/src/redirect-to-last-route/index.ts +1 -0
- package/src/redirect-to-last-route/redirect-to-last-route-guard.service.ts +16 -0
- package/src/redirect-to-last-route/redirect-to-last-route.module.ts +20 -0
- package/src/redirect-to-last-route/view-context-redirect.service.ts +53 -0
- package/src/selector/asset-selector-example/child-devices/asset-selector-child-devices.component.ts +49 -0
- package/src/selector/asset-selector-example/child-devices/asset-selector-child-devices.module.ts +24 -0
- package/src/selector/asset-selector-example/column-header/asset-selector-column-header.component.ts +46 -0
- package/src/selector/asset-selector-example/column-header/asset-selector-column-header.module.ts +24 -0
- package/src/selector/asset-selector-example/different-root/asset-selector-different-root.component.ts +87 -0
- package/src/selector/asset-selector-example/different-root/asset-selector-different-root.module.ts +24 -0
- package/src/selector/asset-selector-example/general-example/asset-selector-example.component.html +342 -0
- package/src/selector/asset-selector-example/general-example/asset-selector-example.component.ts +34 -0
- package/src/selector/asset-selector-example/general-example/asset-selector-example.module.ts +22 -0
- package/src/selector/asset-selector-example/global-search/asset-selector-global-search.component.ts +50 -0
- package/src/selector/asset-selector-example/global-search/asset-selector-global-search.module.ts +24 -0
- package/src/selector/asset-selector-example/miller-columns-options/asset-selector-miller-example.component.ts +85 -0
- package/src/selector/asset-selector-example/miller-columns-options/asset-selector-miller-example.module.ts +26 -0
- package/src/selector/asset-selector-example/multi-select/asset-selector-multi-select.component.ts +50 -0
- package/src/selector/asset-selector-example/multi-select/asset-selector-multi-select.module.ts +24 -0
- package/src/selector/asset-selector-example/only-devices/asset-selector-only-devices.component.ts +44 -0
- package/src/selector/asset-selector-example/only-devices/asset-selector-only-devices.module.ts +24 -0
- package/src/selector/asset-selector-example/single-search/asset-selector-single-search.component.ts +71 -0
- package/src/selector/asset-selector-example/single-search/asset-selector-single-search.module.ts +24 -0
- package/src/selector/asset-selector-example/single-select/asset-selector-single-select.component.ts +47 -0
- package/src/selector/asset-selector-example/single-select/asset-single-select.module.ts +24 -0
- package/src/selector/asset-selector-example/tree-devices/asset-selector-tree-devices.component.ts +62 -0
- package/src/selector/asset-selector-example/tree-devices/asset-selector-tree-devices.module.ts +24 -0
- package/src/selector/asset-selector-example/tree-options/asset-selector-tree-example.component.ts +83 -0
- package/src/selector/asset-selector-example/tree-options/asset-selector-tree-example.module.ts +26 -0
- package/src/selector/asset-selector-example/tree-search/asset-selector-tree-search.component.ts +75 -0
- package/src/selector/asset-selector-example/tree-search/asset-selector-tree-search.module.ts +24 -0
- package/src/selector/asset-selector-example/tree-single/asset-selector-tree-single.component.ts +66 -0
- package/src/selector/asset-selector-example/tree-single/asset-selector-tree-single.module.ts +24 -0
- package/src/selector/datapoint-selection-example/context-example/datapoint-selection-context-example.component.ts +54 -0
- package/src/selector/datapoint-selection-example/context-example/datapoint-selection-context-example.module.ts +24 -0
- package/src/selector/datapoint-selection-example/dragdrop-example/datapoint-selection-dragdrop-example.component.ts +43 -0
- package/src/selector/datapoint-selection-example/dragdrop-example/datapoint-selection-dragdrop-example.module.ts +24 -0
- package/src/selector/datapoint-selection-example/general-example/datapoint-selection-example.component.html +202 -0
- package/src/selector/datapoint-selection-example/general-example/datapoint-selection-example.component.ts +51 -0
- package/src/selector/datapoint-selection-example/general-example/datapoint-selection-example.module.ts +24 -0
- package/src/selector/datapoint-selection-example/list-example/datapoint-selection-list-example.component.ts +42 -0
- package/src/selector/datapoint-selection-example/list-example/datapoint-selection-list-example.module.ts +24 -0
- package/src/selector/datapoint-selection-example/modal-example/datapoint-selection-modal-example.component.ts +51 -0
- package/src/selector/datapoint-selection-example/modal-example/datapoint-selection-modal-example.module.ts +24 -0
- package/src/selector/datapoint-selection-example/no-templates-example/datapoint-selection-notemplates-example.component.ts +43 -0
- package/src/selector/datapoint-selection-example/no-templates-example/datapoint-selection-notemplates-example.module.ts +24 -0
- package/src/selector/datapoint-selection-example/selector/datapoint-selection-selector-example.component.ts +43 -0
- package/src/selector/datapoint-selection-example/selector/datapoint-selection-selector-example.module.ts +24 -0
- package/src/selector/datapoint-selection-example/validation-example/datapoint-selection-validation-example.component.ts +46 -0
- package/src/selector/datapoint-selection-example/validation-example/datapoint-selection-validation-example.module.ts +24 -0
- package/src/standalone-demo/index.ts +1 -0
- package/src/standalone-demo/standalone-component/standalone-component.component.html +4 -0
- package/src/standalone-demo/standalone-component/standalone-component.component.ts +11 -0
- package/src/standalone-demo/standalone-demo.module.ts +23 -0
- package/src/stepper/device-stepper.component.html +70 -0
- package/src/stepper/device-stepper.component.ts +98 -0
- package/src/stepper/device.model.ts +5 -0
- package/src/stepper/index.ts +1 -0
- package/src/stepper/stepper.component.ts +19 -0
- package/src/stepper/stepper.module.ts +24 -0
- package/src/stepper/stepper.service.ts +32 -0
- package/src/time/time-picker-example.component.ts +19 -0
- package/src/time/time-picker-example.module.ts +21 -0
- package/src/translations/date-translation/c8y-translation/c8y-date-translation.component.ts +23 -0
- package/src/translations/date-translation/c8y-translation/c8y-date-translation.module.ts +22 -0
- package/src/translations/date-translation/ng-translation/date-translation.component.ts +17 -0
- package/src/translations/date-translation/ng-translation/date-translation.module.ts +22 -0
- package/src/translations/dynamic-form-translation/dynamic-form-translation.component.ts +58 -0
- package/src/translations/dynamic-form-translation/dynamic-form-translation.module.ts +22 -0
- package/src/translations/index.ts +1 -0
- package/src/translations/locales/it.po +18 -0
- package/src/translations/locales/pt_BR.po +33 -0
- package/src/translations/new-language/new-language.component.html +45 -0
- package/src/translations/new-language/new-language.component.ts +19 -0
- package/src/translations/new-language/new-language.module.ts +21 -0
- package/src/translations/new-translate/new-translation.component.html +92 -0
- package/src/translations/new-translate/new-translation.component.ts +9 -0
- package/src/translations/new-translate/new-translation.module.ts +22 -0
- package/src/translations/text-translation/gettext-translation/text-translation-gettext.component.ts +18 -0
- package/src/translations/text-translation/gettext-translation/text-translation-gettext.module.ts +22 -0
- package/src/translations/text-translation/ngNonBindable-translation/text-translation-ngnonbindable.component.ts +22 -0
- package/src/translations/text-translation/ngNonBindable-translation/text-translation-ngnonbindable.module.ts +24 -0
- package/src/translations/text-translation/service-translation/text-translation-by-service.component.ts +38 -0
- package/src/translations/text-translation/service-translation/text-translation-by-service.module.ts +24 -0
- package/src/translations/translation-tabs.ts +50 -0
- package/src/translations/translations.module.ts +18 -0
- package/src/user-menu/index.ts +1 -0
- package/src/user-menu/user-menu.module.ts +13 -0
- package/src/user-menu/user-menu.ts +26 -0
- package/src/widget/demo-widget-config.component.ts +81 -0
- package/src/widget/demo-widget.component.ts +35 -0
- package/src/widget/demo-widget.module.ts +47 -0
- package/src/widget/index.ts +1 -0
- package/src/widget-resolvers/alternative-event.resolver.ts +21 -0
- package/src/widget-resolvers/event-property.resolver.ts +52 -0
- package/src/widget-resolvers/event.resolver.ts +100 -0
- package/src/widget-resolvers/index.ts +1 -0
- package/src/widget-resolvers/widget-resolvers-config/widget-resolvers-config.component.html +31 -0
- package/src/widget-resolvers/widget-resolvers-config/widget-resolvers-config.component.ts +67 -0
- package/src/widget-resolvers/widget-resolvers.component.html +13 -0
- package/src/widget-resolvers/widget-resolvers.component.ts +37 -0
- package/src/widget-resolvers/widget-resolvers.module.ts +50 -0
- 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
|
+
}
|
package/src/list/list-virtual-scroll/list-virtual-scroll-check/list-virtual-scroll-check.module.ts
ADDED
|
@@ -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 {}
|