@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,55 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CoreModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The hello.component shows a short introduction text and
|
|
6
|
+
* a little list of things that you can discover within this
|
|
7
|
+
* tutorial application.
|
|
8
|
+
*/
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'hello',
|
|
11
|
+
template: `
|
|
12
|
+
<!-- The c8y-title component will display the given string (here: "Hello") in the header as title -->
|
|
13
|
+
<c8y-title>Hello</c8y-title>
|
|
14
|
+
<div class="card">
|
|
15
|
+
<div class="card-header separator">
|
|
16
|
+
<h4 class="card-title">{{ introductionText }}</h4>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="card-block">
|
|
19
|
+
<ul>
|
|
20
|
+
<li>Navigator (panel on the left)</li>
|
|
21
|
+
<li><a href="#/lists/list-check">Lists</a></li>
|
|
22
|
+
<li><a href="#/hooks/action">Hooks</a></li>
|
|
23
|
+
<li><a href="#/quick-link">Quick link</a></li>
|
|
24
|
+
<li><a href="#/dynamic-forms/introduction">Dynamic forms</a></li>
|
|
25
|
+
<li><a href="#/help">Help</a></li>
|
|
26
|
+
<li><a href="#/popconfirm">Pop confirm</a></li>
|
|
27
|
+
<li><a href="#/css">Styles</a></li>
|
|
28
|
+
<li><a href="#/grids/client-grid-example">Grid</a></li>
|
|
29
|
+
<li><a href="#/css">Styles</a></li>
|
|
30
|
+
<li><a href="#/input">Input</a></li>
|
|
31
|
+
<li><a href="#/maps/simple">Maps</a></li>
|
|
32
|
+
<li><a href="#/translations/text-translation/service-translation">Translations</a></li>
|
|
33
|
+
<li><a href="#/realtime">Realtime</a></li>
|
|
34
|
+
<li><a href="#/stepper">Stepper</a></li>
|
|
35
|
+
<li><a href="#/time-picker">Time picker</a></li>
|
|
36
|
+
<li><a href="#/dashboards/custom">Dashboards</a></li>
|
|
37
|
+
<li>
|
|
38
|
+
<a href="#/provider-configuration/introduction-example">Providers configuration </a>
|
|
39
|
+
</li>
|
|
40
|
+
<li><a href="#/properties-list">Properties list</a></li>
|
|
41
|
+
</ul>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
`,
|
|
45
|
+
standalone: true,
|
|
46
|
+
imports: [CoreModule]
|
|
47
|
+
})
|
|
48
|
+
export class HelloComponent {
|
|
49
|
+
introductionText: string;
|
|
50
|
+
|
|
51
|
+
constructor() {
|
|
52
|
+
this.introductionText =
|
|
53
|
+
'... this basic Application will show you some concepts and components about';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { RouterModule, Routes } from '@angular/router';
|
|
3
|
+
import { HelloComponent } from './hello.component';
|
|
4
|
+
|
|
5
|
+
const routes: Routes = [
|
|
6
|
+
{
|
|
7
|
+
path: '',
|
|
8
|
+
redirectTo: 'hello',
|
|
9
|
+
pathMatch: 'full'
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
path: 'hello',
|
|
13
|
+
component: HelloComponent
|
|
14
|
+
}
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
@NgModule({
|
|
18
|
+
imports: [RouterModule.forChild(routes)]
|
|
19
|
+
})
|
|
20
|
+
export class HelloModule {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './hello.module';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CommonModule, CoreModule } from '@c8y/ngx-components';
|
|
3
|
+
import { DeviceGridModule } from '@c8y/ngx-components/device-grid';
|
|
4
|
+
import { DeviceListModule } from '@c8y/ngx-components/device-list';
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'help-example',
|
|
7
|
+
template: `<c8y-title>Context help</c8y-title>
|
|
8
|
+
<div class="card">
|
|
9
|
+
<div class="card-block">
|
|
10
|
+
<div>
|
|
11
|
+
The "Help" component adds contextual help to the action bar(question mark icon). The
|
|
12
|
+
content of contextual help comes from the user guide.
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<c8y-help
|
|
18
|
+
src="/docs/device-management-application/viewing-all-devices/#viewing-all-devices"
|
|
19
|
+
></c8y-help> `,
|
|
20
|
+
standalone: true,
|
|
21
|
+
imports: [CoreModule, CommonModule, DeviceGridModule, DeviceListModule]
|
|
22
|
+
})
|
|
23
|
+
export class HelpExampleComponent {}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
providers: [
|
|
6
|
+
hookRoute({
|
|
7
|
+
path: 'help',
|
|
8
|
+
loadComponent: () => import('./help-example.component').then(m => m.HelpExampleComponent)
|
|
9
|
+
}),
|
|
10
|
+
hookNavigator(
|
|
11
|
+
new NavigatorNode({
|
|
12
|
+
path: '/help',
|
|
13
|
+
label: 'Help',
|
|
14
|
+
icon: 'hand-o-right',
|
|
15
|
+
priority: 80
|
|
16
|
+
})
|
|
17
|
+
)
|
|
18
|
+
]
|
|
19
|
+
})
|
|
20
|
+
export class HelpExampleModule {}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { NavigatorNode, hookAction, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
import { ExampleActionFactory } from './action';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Use our predefined InjectionTokens and provide your own classes to extend behavior
|
|
7
|
+
* and functionality of existing ones. Implement your own NavigationNodes, Tabs, Actions and Breadcrumbs.
|
|
8
|
+
* Note: Hooks should always be implemented in the module where they are used, so that
|
|
9
|
+
* a module can act standalone and has no dependencies on other modules.
|
|
10
|
+
*/
|
|
11
|
+
export const hooks = [
|
|
12
|
+
hookAction(ExampleActionFactory),
|
|
13
|
+
hookRoute({
|
|
14
|
+
path: 'hooks/action',
|
|
15
|
+
loadComponent: () => import('./basic-view/basic-view.component').then(m => m.BasicViewComponent)
|
|
16
|
+
}),
|
|
17
|
+
hookNavigator(
|
|
18
|
+
new NavigatorNode({
|
|
19
|
+
priority: 100,
|
|
20
|
+
path: 'hooks/action',
|
|
21
|
+
icon: 'increase',
|
|
22
|
+
label: 'Action',
|
|
23
|
+
parent: 'Hooks'
|
|
24
|
+
})
|
|
25
|
+
)
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
@NgModule({
|
|
29
|
+
/**
|
|
30
|
+
* Adding the hooks to the providers:
|
|
31
|
+
*/
|
|
32
|
+
providers: [...hooks]
|
|
33
|
+
})
|
|
34
|
+
export class ActionModule {}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute } from '@angular/router';
|
|
3
|
+
import { Action, ActionFactory } from '@c8y/ngx-components';
|
|
4
|
+
import { get } from 'lodash-es';
|
|
5
|
+
import { LogoutActionComponent } from './logout-action/logout-action.component';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Actions are available through a button (+) within the header.
|
|
9
|
+
* The actions button is always visible within the header.
|
|
10
|
+
*/
|
|
11
|
+
@Injectable()
|
|
12
|
+
export class ExampleActionFactory implements ActionFactory {
|
|
13
|
+
// Implement the get()-method, otherwise the ExampleActionFactory
|
|
14
|
+
// implements the ActionFactory interface incorrectly (!)
|
|
15
|
+
get(activatedRoute?: ActivatedRoute) {
|
|
16
|
+
// You can have more than one action
|
|
17
|
+
// The actions button is rendered as a dropdown of buttons
|
|
18
|
+
const actions: Action[] = [];
|
|
19
|
+
|
|
20
|
+
const isActionNode: boolean = get(activatedRoute, 'snapshot.url[1].path') === 'action';
|
|
21
|
+
|
|
22
|
+
if (isActionNode) {
|
|
23
|
+
// Mandatory for an Action is just a label (string)
|
|
24
|
+
const someDeviceAction: Action = {
|
|
25
|
+
label: 'Custom action',
|
|
26
|
+
action: () => console.log('Custom action is triggered.'),
|
|
27
|
+
disabled: true,
|
|
28
|
+
priority: 1
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const customLogoutButton: Action = {
|
|
32
|
+
component: LogoutActionComponent
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
actions.push(someDeviceAction);
|
|
36
|
+
actions.push(customLogoutButton);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return actions;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<!-- The c8y-title component will display the given string (here: "Action hook example") in the header as title -->
|
|
2
|
+
<c8y-title>Action</c8y-title>
|
|
3
|
+
<div class="card">
|
|
4
|
+
<div class="card-block">
|
|
5
|
+
<p>This is the example of <code>hookAction</code>.</p>
|
|
6
|
+
<p>See the <code>Logout</code> and <code>Actions</code> buttons in the upper right corner.</p>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CoreModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This is a standard angular component.
|
|
6
|
+
* Obviously it does not do anything.
|
|
7
|
+
*/
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'tut-basic-action-hook-view',
|
|
10
|
+
templateUrl: './basic-view.component.html',
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [CoreModule]
|
|
13
|
+
})
|
|
14
|
+
export class BasicViewComponent {
|
|
15
|
+
/**
|
|
16
|
+
* Your content of the Basic View goes in here!
|
|
17
|
+
*/
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './action.module';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CoreModule, LoginService } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-logout-action',
|
|
6
|
+
template: `<button class="main-header-button" title="Logout" type="button" (click)="logout()">
|
|
7
|
+
<i class="icon-2x" c8yIcon="sign-out"></i>
|
|
8
|
+
</button> `,
|
|
9
|
+
standalone: true,
|
|
10
|
+
imports: [CoreModule]
|
|
11
|
+
})
|
|
12
|
+
export class LogoutActionComponent {
|
|
13
|
+
constructor(private loginService: LoginService) {}
|
|
14
|
+
|
|
15
|
+
logout() {
|
|
16
|
+
this.loginService.logout();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { NavigatorNode, hookActionBar, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
import { ExampleActionBarFactory } from './action-bar';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Use our predefined InjectionTokens and provide your own classes to extend behavior
|
|
7
|
+
* and functionality of existing ones. Implement your own NavigationNodes, Tabs, Actions and Breadcrumbs.
|
|
8
|
+
* Note: Hooks should always be implemented in the module where they are used, so that
|
|
9
|
+
* a module can act standalone and has no dependencies on other modules.
|
|
10
|
+
*/
|
|
11
|
+
export const hooks = [
|
|
12
|
+
hookActionBar(ExampleActionBarFactory),
|
|
13
|
+
hookRoute({
|
|
14
|
+
path: 'hooks/action-bar',
|
|
15
|
+
loadComponent: () => import('./basic-view/basic-view.component').then(m => m.BasicViewComponent)
|
|
16
|
+
}),
|
|
17
|
+
hookNavigator(
|
|
18
|
+
new NavigatorNode({
|
|
19
|
+
priority: 100,
|
|
20
|
+
path: 'hooks/action-bar',
|
|
21
|
+
icon: 'arrows-left-right-diagonal',
|
|
22
|
+
label: 'Action Bar',
|
|
23
|
+
parent: 'Hooks'
|
|
24
|
+
})
|
|
25
|
+
)
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
@NgModule({
|
|
29
|
+
/**
|
|
30
|
+
* Adding the hooks to the providers:
|
|
31
|
+
*/
|
|
32
|
+
providers: [...hooks]
|
|
33
|
+
})
|
|
34
|
+
export class ActionBarModule {}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute } from '@angular/router';
|
|
3
|
+
import { ActionBarFactory, ActionBarItem } from '@c8y/ngx-components';
|
|
4
|
+
import { get } from 'lodash-es';
|
|
5
|
+
import { RefreshActionComponent } from './refresh-element/refresh-element.component';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* This actions bar button is only visible at 'action-bar' path.
|
|
9
|
+
*/
|
|
10
|
+
@Injectable()
|
|
11
|
+
export class ExampleActionBarFactory implements ActionBarFactory {
|
|
12
|
+
get(activatedRoute?: ActivatedRoute) {
|
|
13
|
+
const actions: ActionBarItem[] = [];
|
|
14
|
+
|
|
15
|
+
const isActionBarNode: boolean = get(activatedRoute, 'snapshot.url[1].path') === 'action-bar';
|
|
16
|
+
|
|
17
|
+
if (isActionBarNode) {
|
|
18
|
+
actions.push({
|
|
19
|
+
priority: 500,
|
|
20
|
+
// If the element is enclosed withing "c8y-action-bar-item" then placement refers to this element.
|
|
21
|
+
placement: 'right',
|
|
22
|
+
component: RefreshActionComponent
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return actions;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<!-- The c8y-title component will display the given string (here: "Action bar hook example") in the header as title -->
|
|
2
|
+
<c8y-title>Action bar</c8y-title>
|
|
3
|
+
<div class="card">
|
|
4
|
+
<div class="card-block">
|
|
5
|
+
<p>This is the example of <code>hookActionBar</code>.</p>
|
|
6
|
+
<p>See the <code>"Refresh"</code> button in the action bar.</p>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CoreModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This is a standard angular component.
|
|
6
|
+
* Obviously it does not do anything.
|
|
7
|
+
*/
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'tut-basic-action-bar-hook-view',
|
|
10
|
+
templateUrl: './basic-view.component.html',
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [CoreModule]
|
|
13
|
+
})
|
|
14
|
+
export class BasicViewComponent {
|
|
15
|
+
/**
|
|
16
|
+
* Your content of the Basic View goes in here!
|
|
17
|
+
*/
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './action-bar.module';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<c8y-action-bar-item [placement]="'right'">
|
|
2
|
+
<li>
|
|
3
|
+
<a
|
|
4
|
+
class="btn btn-link"
|
|
5
|
+
title="{{ 'Only pretends to do something...' }}"
|
|
6
|
+
(click)="refresh()"
|
|
7
|
+
>
|
|
8
|
+
<i
|
|
9
|
+
c8yIcon="refresh"
|
|
10
|
+
[ngClass]="{ 'icon-spin': requestInProgress }"
|
|
11
|
+
></i>
|
|
12
|
+
{{ 'Refresh' }}
|
|
13
|
+
</a>
|
|
14
|
+
</li>
|
|
15
|
+
</c8y-action-bar-item>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CoreModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'tut-refresh-element',
|
|
6
|
+
templateUrl: './refresh-element.component.html',
|
|
7
|
+
standalone: true,
|
|
8
|
+
imports: [CoreModule]
|
|
9
|
+
})
|
|
10
|
+
export class RefreshActionComponent {
|
|
11
|
+
requestInProgress: boolean;
|
|
12
|
+
|
|
13
|
+
refresh(): void {
|
|
14
|
+
this.requestInProgress = true;
|
|
15
|
+
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
console.log('Carbon footprint enlarged.');
|
|
18
|
+
this.requestInProgress = false;
|
|
19
|
+
}, 1000);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<!-- The c8y-title component will display the given string (here: "Breadcrumb hook example") in the header as title -->
|
|
2
|
+
<c8y-title>Breadcrumb</c8y-title>
|
|
3
|
+
<div class="card">
|
|
4
|
+
<div class="card-block">
|
|
5
|
+
<p>This is the example of <code>hookBreadcrumb</code>.</p>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CoreModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This is a standard angular component.
|
|
6
|
+
* Obviously it does not do anything.
|
|
7
|
+
*/
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'tut-basic-breadcrumb-view',
|
|
10
|
+
templateUrl: './basic-view.component.html',
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [CoreModule]
|
|
13
|
+
})
|
|
14
|
+
export class BasicViewComponent {
|
|
15
|
+
/**
|
|
16
|
+
* Your content of the Basic View goes in here!
|
|
17
|
+
*/
|
|
18
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { NavigatorNode, hookBreadcrumb, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
import { ExampleBreadcrumbFactory } from './breadcrumbs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Use our predefined InjectionTokens and provide your own classes to extend behavior
|
|
7
|
+
* and functionality of existing ones. Implement your own NavigationNodes, Tabs, Actions and Breadcrumbs.
|
|
8
|
+
* Note: Hooks should always be implemented in the module where they are used, so that
|
|
9
|
+
* a module can act standalone and has no dependencies on other modules.
|
|
10
|
+
*/
|
|
11
|
+
export const hooks = [
|
|
12
|
+
hookBreadcrumb(ExampleBreadcrumbFactory),
|
|
13
|
+
hookRoute({
|
|
14
|
+
path: 'hooks/breadcrumbs',
|
|
15
|
+
loadComponent: () => import('./basic-view/basic-view.component').then(m => m.BasicViewComponent)
|
|
16
|
+
}),
|
|
17
|
+
hookNavigator(
|
|
18
|
+
new NavigatorNode({
|
|
19
|
+
priority: 80,
|
|
20
|
+
path: 'hooks/breadcrumbs',
|
|
21
|
+
icon: 'forward',
|
|
22
|
+
label: 'Breadcrumbs',
|
|
23
|
+
parent: 'Hooks'
|
|
24
|
+
})
|
|
25
|
+
)
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
@NgModule({
|
|
29
|
+
/**
|
|
30
|
+
* Adding the hooks to the providers:
|
|
31
|
+
*/
|
|
32
|
+
providers: [...hooks]
|
|
33
|
+
})
|
|
34
|
+
export class BreadcrumbsModule {}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
|
+
import { Breadcrumb, BreadcrumbFactory, BreadcrumbItem } from '@c8y/ngx-components';
|
|
4
|
+
import { get } from 'lodash-es';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A breadcrumb is a type of secondary navigation scheme that reveals the user’s location
|
|
8
|
+
* in the application.
|
|
9
|
+
*/
|
|
10
|
+
@Injectable()
|
|
11
|
+
export class ExampleBreadcrumbFactory implements BreadcrumbFactory {
|
|
12
|
+
// Inject the angular Router
|
|
13
|
+
constructor(private router: Router) {}
|
|
14
|
+
|
|
15
|
+
// Implement the get()-method, otherwise the ExampleBreadcrumbFactory
|
|
16
|
+
// implements the BreadcrumbFactory interface incorrectly (!)
|
|
17
|
+
get(activatedRoute?: ActivatedRoute) {
|
|
18
|
+
// Mandatory for a Breadcrumb is an array of BreadcrumbItem
|
|
19
|
+
const breadcrumb: Breadcrumb = { items: [] };
|
|
20
|
+
// Mandatory for a BreadcrumbItem is:
|
|
21
|
+
// - path (string)
|
|
22
|
+
// - label (string)
|
|
23
|
+
const breadcrumbItems: BreadcrumbItem[] = [];
|
|
24
|
+
|
|
25
|
+
const isTabNode: boolean =
|
|
26
|
+
get(activatedRoute, 'snapshot.routeConfig.path') === 'tabs/outstanding' ||
|
|
27
|
+
get(activatedRoute, 'snapshot.routeConfig.path') === 'tabs/awesome';
|
|
28
|
+
|
|
29
|
+
const isBreadcrumbsNode: boolean =
|
|
30
|
+
get(activatedRoute, 'snapshot.routeConfig.path') === 'hooks/breadcrumbs';
|
|
31
|
+
|
|
32
|
+
if (isTabNode) {
|
|
33
|
+
/**
|
|
34
|
+
* Use angular router to decide if breadcrumbs should be shown.
|
|
35
|
+
* The following breadcrumbs are displayed if the URL matches
|
|
36
|
+
* something like: .../apps/tutorial-application/#/tabs/
|
|
37
|
+
*/
|
|
38
|
+
if (this.router.url.match(/tabs/g)) {
|
|
39
|
+
breadcrumbItems.push({
|
|
40
|
+
label: 'tabs',
|
|
41
|
+
icon: 'plane',
|
|
42
|
+
path: '/tabs'
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// if the URL is: .../apps/tutorial-application/#/tabs/awesome
|
|
46
|
+
// we add another breadcrumb to show!
|
|
47
|
+
if (this.router.url.match(/awesome/g)) {
|
|
48
|
+
breadcrumbItems.push({
|
|
49
|
+
label: 'awesome',
|
|
50
|
+
path: '/tabs/awesome'
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// if the URL is: .../apps/tutorial-application/#/tabs/outstanding
|
|
55
|
+
// we add another breadcrumb to show!
|
|
56
|
+
if (this.router.url.match(/outstanding/g)) {
|
|
57
|
+
breadcrumbItems.push({
|
|
58
|
+
label: 'outstanding',
|
|
59
|
+
path: '/tabs/outstanding'
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (isBreadcrumbsNode) {
|
|
66
|
+
/**
|
|
67
|
+
* Use angular router to decide if breadcrumbs should be shown.
|
|
68
|
+
* The following breadcrumbs are displayed if the URL matches
|
|
69
|
+
* something like: .../apps/tutorial-application/#/hooks/
|
|
70
|
+
*/
|
|
71
|
+
if (this.router.url.match(/hooks/g)) {
|
|
72
|
+
breadcrumbItems.push({
|
|
73
|
+
label: 'hooks',
|
|
74
|
+
icon: 'forward',
|
|
75
|
+
path: '/hooks/action'
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// if the URL is: .../apps/tutorial-application/#/hooks/breadcrumb
|
|
79
|
+
// we add another breadcrumb to show!
|
|
80
|
+
if (this.router.url.match(/hooks\/breadcrumbs/g)) {
|
|
81
|
+
breadcrumbItems.push({
|
|
82
|
+
label: 'breadcrumbs',
|
|
83
|
+
icon: 'forward',
|
|
84
|
+
path: '/hooks/breadcrumbs'
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
breadcrumb.items = breadcrumbItems;
|
|
90
|
+
return breadcrumb;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './breadcrumbs.module';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- The c8y-title component will display the given string (here: "Component hook example") in the header as title -->
|
|
2
|
+
<c8y-title>Component</c8y-title>
|
|
3
|
+
<div class="card">
|
|
4
|
+
<div class="card-block">
|
|
5
|
+
<c8y-dynamic-component
|
|
6
|
+
componentId="simple.component"
|
|
7
|
+
[config]="{ text: 'Hello world' }"
|
|
8
|
+
[mode]="editComponent ? 'config' : 'component'"
|
|
9
|
+
></c8y-dynamic-component>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CoreModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This is a standard angular component.
|
|
6
|
+
* Obviously it does not do anything.
|
|
7
|
+
*/
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'tut-basic-component-hook-view',
|
|
10
|
+
templateUrl: './basic-view.component.html',
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [CoreModule]
|
|
13
|
+
})
|
|
14
|
+
export class BasicViewComponent {
|
|
15
|
+
editComponent = false;
|
|
16
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { NavigatorNode, hookComponent, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Use our predefined InjectionTokens and provide your own classes to extend behavior
|
|
6
|
+
* and functionality of existing ones. Implement your own NavigationNodes, Tabs, Actions and Breadcrumbs.
|
|
7
|
+
* Note: Hooks should always be implemented in the module where they are used, so that
|
|
8
|
+
* a module can act standalone and has no dependencies on other modules.
|
|
9
|
+
*/
|
|
10
|
+
export const hooks = [
|
|
11
|
+
hookRoute({
|
|
12
|
+
path: 'hooks/component',
|
|
13
|
+
loadComponent: () => import('./basic-view/basic-view.component').then(m => m.BasicViewComponent)
|
|
14
|
+
}),
|
|
15
|
+
hookNavigator(
|
|
16
|
+
new NavigatorNode({
|
|
17
|
+
priority: 70,
|
|
18
|
+
path: 'hooks/component',
|
|
19
|
+
icon: 'blockly',
|
|
20
|
+
label: 'Component',
|
|
21
|
+
parent: 'Hooks'
|
|
22
|
+
})
|
|
23
|
+
),
|
|
24
|
+
hookComponent({
|
|
25
|
+
id: 'simple.component',
|
|
26
|
+
label: 'My simple component',
|
|
27
|
+
description: 'Nothing to describe',
|
|
28
|
+
loadComponent: () => import('./basic-view/simple.component').then(m => m.SimpleComponent)
|
|
29
|
+
})
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
@NgModule({
|
|
33
|
+
/**
|
|
34
|
+
* Adding the hooks to the providers:
|
|
35
|
+
*/
|
|
36
|
+
providers: [...hooks]
|
|
37
|
+
})
|
|
38
|
+
export class ComponentModule {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './component.module';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { hookDrawer } from '@c8y/ngx-components';
|
|
3
|
+
import { LeftDrawerTutorialComponent } from './left-drawer-tutorial.component';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
providers: [
|
|
7
|
+
hookDrawer([{ component: LeftDrawerTutorialComponent, position: 'left', priority: 10 }])
|
|
8
|
+
]
|
|
9
|
+
})
|
|
10
|
+
export class LeftDrawerModule {}
|