@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,51 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { ViewContext, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
import { RandomGuard } from './random.guard';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Route hooks allow you to use routes as child routes on a ViewContext. If used with a context
|
|
7
|
+
* the particular data is resolved automatically and the page is extended by a tab. Contexts
|
|
8
|
+
* are currently Application, Device, Group, Tenant and User. Note: All components used here
|
|
9
|
+
* needs to be used as EntryComponent!
|
|
10
|
+
* This example will add a device tab with all the context information as well as a randomly
|
|
11
|
+
* guarded context tab.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
const routeHooks = [
|
|
15
|
+
hookRoute([
|
|
16
|
+
{
|
|
17
|
+
path: 'context',
|
|
18
|
+
context: ViewContext.Device,
|
|
19
|
+
loadComponent: () =>
|
|
20
|
+
import('./device/device-tab-context.component').then(m => m.DeviceTabContextComponent),
|
|
21
|
+
label: 'Context',
|
|
22
|
+
priority: 1000,
|
|
23
|
+
icon: 'bell'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
path: 'info',
|
|
27
|
+
context: ViewContext.Device,
|
|
28
|
+
loadComponent: () =>
|
|
29
|
+
import('./device/device-info.component').then(m => m.DeviceInfoComponent),
|
|
30
|
+
label: 'Info',
|
|
31
|
+
priority: 0,
|
|
32
|
+
icon: 'info',
|
|
33
|
+
/**
|
|
34
|
+
* An example of an route guard which randomly activates
|
|
35
|
+
* the child route. See Guards documentation from Angular
|
|
36
|
+
* for more details.
|
|
37
|
+
*/
|
|
38
|
+
canActivate: [RandomGuard]
|
|
39
|
+
}
|
|
40
|
+
])
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
@NgModule({
|
|
44
|
+
declarations: [],
|
|
45
|
+
imports: [],
|
|
46
|
+
/**
|
|
47
|
+
* Adding the hooks to the providers:
|
|
48
|
+
*/
|
|
49
|
+
providers: [...routeHooks]
|
|
50
|
+
})
|
|
51
|
+
export class RouteModule {}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
declarations: [],
|
|
6
|
+
imports: [],
|
|
7
|
+
exports: [],
|
|
8
|
+
providers: [
|
|
9
|
+
hookNavigator({
|
|
10
|
+
label: 'Hooking via service',
|
|
11
|
+
icon: 'holding-box',
|
|
12
|
+
priority: -40,
|
|
13
|
+
path: 'hooks/service-hook',
|
|
14
|
+
parent: 'Hooks',
|
|
15
|
+
// TODO: clarify why preventDuplicates is needed
|
|
16
|
+
preventDuplicates: true
|
|
17
|
+
}),
|
|
18
|
+
hookRoute({
|
|
19
|
+
path: 'hooks/service-hook',
|
|
20
|
+
loadComponent: () =>
|
|
21
|
+
import('./hook-with-service-example.component').then(m => m.HookWithServiceExampleComponent)
|
|
22
|
+
})
|
|
23
|
+
]
|
|
24
|
+
})
|
|
25
|
+
export class HookStateModule {}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<c8y-title>Hooking via service</c8y-title>
|
|
2
|
+
|
|
3
|
+
<div class="card">
|
|
4
|
+
<div class="card-block">
|
|
5
|
+
<p>This is an example for an Action added via service or factory</p>
|
|
6
|
+
<p>
|
|
7
|
+
See the
|
|
8
|
+
<code>Plus button</code>
|
|
9
|
+
in the upper right corner to see the actions
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<code>
|
|
13
|
+
<pre>{{ actionService.items$ | async | json }}</pre>
|
|
14
|
+
</code>
|
|
15
|
+
|
|
16
|
+
<button
|
|
17
|
+
class="btn btn-primary"
|
|
18
|
+
(click)="addAction()"
|
|
19
|
+
>
|
|
20
|
+
Add a action bar item via service
|
|
21
|
+
</button>
|
|
22
|
+
<button
|
|
23
|
+
class="btn btn-default"
|
|
24
|
+
(click)="removeAction()"
|
|
25
|
+
>
|
|
26
|
+
Remove this action
|
|
27
|
+
</button>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Component, OnDestroy } from '@angular/core';
|
|
2
|
+
import { Action, ActionService, CoreModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Adds a global action (plus button) via a service.
|
|
6
|
+
*/
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'hook-with-service-example',
|
|
9
|
+
templateUrl: `./hook-with-service-example.component.html`,
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [CoreModule]
|
|
12
|
+
})
|
|
13
|
+
export class HookWithServiceExampleComponent implements OnDestroy {
|
|
14
|
+
private action: Action = {
|
|
15
|
+
label: 'Hello from service',
|
|
16
|
+
icon: 'grid',
|
|
17
|
+
action: () => alert('Hello from service')
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
constructor(public actionService: ActionService) {}
|
|
21
|
+
|
|
22
|
+
addAction() {
|
|
23
|
+
// Add a action via service
|
|
24
|
+
this.actionService.add(this.action);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
removeAction() {
|
|
28
|
+
// You need to remove it, otherwise it stays.
|
|
29
|
+
this.actionService.remove(this.action);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
ngOnDestroy(): void {
|
|
33
|
+
// let's clean up the item if user navigates away
|
|
34
|
+
this.actionService.remove(this.action);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!-- The c8y-title component will display the given string (here: "Stepper hook example") in the header as title -->
|
|
2
|
+
<c8y-title>Stepper</c8y-title>
|
|
3
|
+
<div class="card">
|
|
4
|
+
<div class="card-block">
|
|
5
|
+
<p>This is the example of <code>hookStepper</code>.</p>
|
|
6
|
+
<div
|
|
7
|
+
class="container-fluid"
|
|
8
|
+
*ngIf="this.steps?.length > 0"
|
|
9
|
+
>
|
|
10
|
+
<c8y-stepper-outlet
|
|
11
|
+
class="d-contents"
|
|
12
|
+
[showDefaultButtons]="false"
|
|
13
|
+
[steps]="steps"
|
|
14
|
+
></c8y-stepper-outlet>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { SetupStep, StepperService, Steppers } 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-stepper-hook-view',
|
|
10
|
+
templateUrl: './basic-view.component.html'
|
|
11
|
+
})
|
|
12
|
+
export class BasicViewComponent implements OnInit {
|
|
13
|
+
readonly stepperId = Steppers.SETUP;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* All current shown setup steps.
|
|
17
|
+
*/
|
|
18
|
+
steps: SetupStep[];
|
|
19
|
+
|
|
20
|
+
constructor(private stepperService: StepperService) {}
|
|
21
|
+
|
|
22
|
+
async ngOnInit(): Promise<void> {
|
|
23
|
+
this.steps = (await this.stepperService.getById$('test').toPromise()).map(
|
|
24
|
+
(step: SetupStep, index) => ({
|
|
25
|
+
...step,
|
|
26
|
+
index,
|
|
27
|
+
completed: false
|
|
28
|
+
})
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { RouterModule, Routes } from '@angular/router';
|
|
3
|
+
import { CoreModule, SetupStep, hookNavigator, hookStepper } from '@c8y/ngx-components';
|
|
4
|
+
import { BasicViewComponent } from './basic-view/basic-view.component';
|
|
5
|
+
import { Step1Component } from './steps/step1.component';
|
|
6
|
+
import { Step2Component } from './steps/step2.component';
|
|
7
|
+
|
|
8
|
+
const routes: Routes = [
|
|
9
|
+
{
|
|
10
|
+
path: 'stepper-hook',
|
|
11
|
+
component: BasicViewComponent
|
|
12
|
+
}
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
@NgModule({
|
|
16
|
+
declarations: [BasicViewComponent, Step1Component, Step2Component],
|
|
17
|
+
imports: [RouterModule.forChild(routes), CoreModule],
|
|
18
|
+
/**
|
|
19
|
+
* Adding the hooks to the providers:
|
|
20
|
+
*/
|
|
21
|
+
providers: [
|
|
22
|
+
hookNavigator({
|
|
23
|
+
label: 'Stepper',
|
|
24
|
+
icon: 'stairs',
|
|
25
|
+
priority: 30,
|
|
26
|
+
path: 'stepper-hook',
|
|
27
|
+
parent: 'Hooks',
|
|
28
|
+
// TODO: clarify why preventDuplicates is needed
|
|
29
|
+
preventDuplicates: true
|
|
30
|
+
}),
|
|
31
|
+
hookStepper([
|
|
32
|
+
{
|
|
33
|
+
stepperId: 'test',
|
|
34
|
+
component: Step1Component,
|
|
35
|
+
label: 'Step 1',
|
|
36
|
+
setupId: 'step1',
|
|
37
|
+
priority: 100,
|
|
38
|
+
// TODO: proper fix needed
|
|
39
|
+
injector: null
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
stepperId: 'test',
|
|
43
|
+
component: Step2Component,
|
|
44
|
+
label: 'Step 2',
|
|
45
|
+
setupId: 'step2',
|
|
46
|
+
priority: 90,
|
|
47
|
+
// TODO: proper fix needed
|
|
48
|
+
injector: null
|
|
49
|
+
}
|
|
50
|
+
] as SetupStep[])
|
|
51
|
+
]
|
|
52
|
+
})
|
|
53
|
+
export class StepperHookModule {}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<div class="m-l-40 m-r-40 m-t-32">
|
|
2
|
+
<h4
|
|
3
|
+
class="p-b-8"
|
|
4
|
+
title="Device name"
|
|
5
|
+
>
|
|
6
|
+
Enter the device name
|
|
7
|
+
</h4>
|
|
8
|
+
<c8y-form-group>
|
|
9
|
+
<div [formGroup]="formGroupStepOne">
|
|
10
|
+
<input
|
|
11
|
+
class="form-control"
|
|
12
|
+
placeholder="MyDevice"
|
|
13
|
+
type="text"
|
|
14
|
+
formControlName="name"
|
|
15
|
+
/>
|
|
16
|
+
<c8y-messages>
|
|
17
|
+
<c8y-message [text]="'Enter the name of the Device'"></c8y-message>
|
|
18
|
+
</c8y-messages>
|
|
19
|
+
</div>
|
|
20
|
+
</c8y-form-group>
|
|
21
|
+
</div>
|
|
22
|
+
<c8y-stepper-buttons
|
|
23
|
+
[showButtons]="{ next: true, cancel: false, back: false, custom: false }"
|
|
24
|
+
></c8y-stepper-buttons>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'tut-step-1-device',
|
|
6
|
+
templateUrl: './step1.component.html'
|
|
7
|
+
})
|
|
8
|
+
export class Step1Component implements OnInit {
|
|
9
|
+
formGroupStepOne: FormGroup;
|
|
10
|
+
|
|
11
|
+
constructor(private fb: FormBuilder) {}
|
|
12
|
+
|
|
13
|
+
ngOnInit() {
|
|
14
|
+
this.formGroupStepOne = this.fb.group({
|
|
15
|
+
name: ['', Validators.required]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<div class="m-l-40 m-r-40 m-t-32">
|
|
2
|
+
<h4 class="p-b-32 text-center">Your device is now ready to save the world!</h4>
|
|
3
|
+
</div>
|
|
4
|
+
<c8y-stepper-buttons
|
|
5
|
+
[showButtons]="{ next: false, cancel: false, back: true, custom: false }"
|
|
6
|
+
[labels]="{ back: 'Got it!' }"
|
|
7
|
+
></c8y-stepper-buttons>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<!-- The c8y-title component will display the given string (here: "Awesome Tab") in the header as title -->
|
|
2
|
+
<c8y-title>Awesome tab</c8y-title>
|
|
3
|
+
<div class="card">
|
|
4
|
+
<div class="card-block">
|
|
5
|
+
<p>This is the second tab we added with the <code>hookTab</code>.</p>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
* The ExampleTabFactory in ../../hooks/tabs.ts defines two tabs:
|
|
8
|
+
* - Awesome
|
|
9
|
+
* - Outstanding
|
|
10
|
+
*/
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'awesome',
|
|
13
|
+
templateUrl: './awesome.component.html',
|
|
14
|
+
standalone: true,
|
|
15
|
+
imports: [CoreModule]
|
|
16
|
+
})
|
|
17
|
+
export class AwesomeComponent {
|
|
18
|
+
/**
|
|
19
|
+
* Your content of the Awesome-Tab goes in here!
|
|
20
|
+
*/
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tabs.module';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!-- The c8y-title component will display the given string (here: "Outstanding Tab") in the header as title -->
|
|
2
|
+
<c8y-title>Outstanding tab</c8y-title>
|
|
3
|
+
<div class="card">
|
|
4
|
+
<div class="card-block">
|
|
5
|
+
<p>
|
|
6
|
+
This is the first tab we added with the
|
|
7
|
+
<code>hookTab</code>
|
|
8
|
+
. Note: If only one tab is used, the tabs are not rendered at all.
|
|
9
|
+
</p>
|
|
10
|
+
<p>
|
|
11
|
+
Tabs are by default orientated vertical. You can however set an application option or define
|
|
12
|
+
the orientation on the tab interface itself, to change the orientation. The following button
|
|
13
|
+
toggles the orientation for the whole application:
|
|
14
|
+
</p>
|
|
15
|
+
<button
|
|
16
|
+
class="btn btn-primary"
|
|
17
|
+
(click)="toggleOrientation()"
|
|
18
|
+
>
|
|
19
|
+
Toggle orientation
|
|
20
|
+
</button>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CoreModule, OptionsService, TabsService } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This is a standard angular component.
|
|
6
|
+
* Obviously it does not do anything.
|
|
7
|
+
* The ExampleTabFactory in ../../hooks/tabs.ts defines two tabs:
|
|
8
|
+
* - Awesome
|
|
9
|
+
* - Outstanding
|
|
10
|
+
*/
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'outstanding',
|
|
13
|
+
templateUrl: './outstanding.component.html',
|
|
14
|
+
standalone: true,
|
|
15
|
+
imports: [CoreModule]
|
|
16
|
+
})
|
|
17
|
+
export class OutstandingComponent {
|
|
18
|
+
constructor(
|
|
19
|
+
private optionsService: OptionsService,
|
|
20
|
+
private tabsService: TabsService
|
|
21
|
+
) {}
|
|
22
|
+
|
|
23
|
+
toggleOrientation() {
|
|
24
|
+
this.optionsService.tabsHorizontal = !this.optionsService.tabsHorizontal;
|
|
25
|
+
this.tabsService.refresh();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { TabFactory, Tab } from '@c8y/ngx-components';
|
|
3
|
+
import { Router } from '@angular/router';
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class ExampleTabFactory implements TabFactory {
|
|
7
|
+
// Inject the angular Router
|
|
8
|
+
constructor(public router: Router) {}
|
|
9
|
+
|
|
10
|
+
// Implement the get()-method, otherwise the ExampleTabFactory
|
|
11
|
+
// implements the TabFactory interface incorrectly (!)
|
|
12
|
+
get() {
|
|
13
|
+
const tabs: Tab[] = [];
|
|
14
|
+
/**
|
|
15
|
+
* We want to define two tabs:
|
|
16
|
+
* - Awesome
|
|
17
|
+
* - Outstanding
|
|
18
|
+
* but these tabs should only displayed if the URL matches
|
|
19
|
+
* something like: .../apps/tutorial-application/#/world/
|
|
20
|
+
*/
|
|
21
|
+
if (this.router.url.match(/tabs/g)) {
|
|
22
|
+
/**
|
|
23
|
+
* mandatory for a Tab is the path (string) and the label (string)
|
|
24
|
+
* A click on the tab will load the given path and therefore angular loads the
|
|
25
|
+
* specified component (check: ../app.modules.ts)
|
|
26
|
+
*/
|
|
27
|
+
tabs.push({
|
|
28
|
+
path: 'hooks/tabs/awesome',
|
|
29
|
+
priority: 1000,
|
|
30
|
+
label: 'Awesome',
|
|
31
|
+
icon: 'star'
|
|
32
|
+
} as Tab);
|
|
33
|
+
|
|
34
|
+
tabs.push({
|
|
35
|
+
path: 'hooks/tabs/outstanding',
|
|
36
|
+
priority: 1001,
|
|
37
|
+
label: 'Outstanding',
|
|
38
|
+
icon: 'diamond'
|
|
39
|
+
} as Tab);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return tabs;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { NavigatorNode, hookNavigator, hookRoute, hookTab } from '@c8y/ngx-components';
|
|
3
|
+
import { ExampleTabFactory } from './tab';
|
|
4
|
+
|
|
5
|
+
export const hooks = [
|
|
6
|
+
hookTab(ExampleTabFactory),
|
|
7
|
+
hookRoute({
|
|
8
|
+
path: 'hooks/tabs',
|
|
9
|
+
redirectTo: 'hooks/tabs/outstanding'
|
|
10
|
+
}),
|
|
11
|
+
hookRoute({
|
|
12
|
+
path: 'hooks/tabs/outstanding',
|
|
13
|
+
loadComponent: () =>
|
|
14
|
+
import('./outstanding/outstanding.component').then(m => m.OutstandingComponent)
|
|
15
|
+
}),
|
|
16
|
+
hookRoute({
|
|
17
|
+
path: 'hooks/tabs/awesome',
|
|
18
|
+
loadComponent: () => import('./awesome/awesome.component').then(m => m.AwesomeComponent)
|
|
19
|
+
}),
|
|
20
|
+
hookNavigator(
|
|
21
|
+
new NavigatorNode({
|
|
22
|
+
priority: 50,
|
|
23
|
+
path: 'hooks/tabs',
|
|
24
|
+
icon: 'plane',
|
|
25
|
+
label: 'Tabs',
|
|
26
|
+
parent: 'Hooks'
|
|
27
|
+
})
|
|
28
|
+
)
|
|
29
|
+
];
|
|
30
|
+
@NgModule({
|
|
31
|
+
declarations: [],
|
|
32
|
+
/**
|
|
33
|
+
* Adding the hooks to the providers:
|
|
34
|
+
*/
|
|
35
|
+
providers: [...hooks]
|
|
36
|
+
})
|
|
37
|
+
export class TabsModule {}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { ExtensionFactory, Version } from '@c8y/ngx-components';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class CustomVersionFactory implements ExtensionFactory<Version> {
|
|
7
|
+
versions: Version[] = [
|
|
8
|
+
/**
|
|
9
|
+
* Will be shown in right drawer on the top.
|
|
10
|
+
* NOTE: only the first two entries with the highest priority are shown in the right drawer.
|
|
11
|
+
*/
|
|
12
|
+
{
|
|
13
|
+
label: 'Custom',
|
|
14
|
+
type: 'someCustomType',
|
|
15
|
+
version: '0.0.1',
|
|
16
|
+
priority: 100,
|
|
17
|
+
// Is not going to be shown in the UI, but will be part of the JSON that can be copied to clipboard and e.g. sent to support.
|
|
18
|
+
custom: {
|
|
19
|
+
myDetails: 'Some details specific to this version'
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* Will not be shown in right drawer as `hideInRightDrawer` is set.
|
|
24
|
+
* But will show up in modal dialog.
|
|
25
|
+
*/
|
|
26
|
+
{
|
|
27
|
+
label: 'Custom-2',
|
|
28
|
+
type: 'someCustomType',
|
|
29
|
+
version: '0.0.2',
|
|
30
|
+
priority: 99,
|
|
31
|
+
hideInRightDrawer: true
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Will not be shown in the UI as `hidden` is set.
|
|
35
|
+
* But will be part of the JSON that can be copied to clipboard.
|
|
36
|
+
*/
|
|
37
|
+
{
|
|
38
|
+
label: 'Custom-3',
|
|
39
|
+
type: 'someCustomType',
|
|
40
|
+
version: '0.0.3',
|
|
41
|
+
priority: 98,
|
|
42
|
+
hidden: true
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
get(): Version | Version[] | Observable<Version | Version[]> | Promise<Version | Version[]> {
|
|
47
|
+
return this.versions;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './version.module';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { hookVersion } from '@c8y/ngx-components';
|
|
4
|
+
import { CustomVersionFactory } from './custom-version-factory.service';
|
|
5
|
+
|
|
6
|
+
@NgModule({
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
declarations: [],
|
|
9
|
+
providers: [hookVersion(CustomVersionFactory)]
|
|
10
|
+
})
|
|
11
|
+
export class TutorialVersionModule {}
|
package/src/i18n.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internationalizing files in po format (https://en.wikipedia.org/wiki/Gettext#Translating)
|
|
3
|
+
* You can always add additional strings by adding your own po file. All po files are
|
|
4
|
+
* combined to one JSON file per language and are loaded if the specific language is needed.
|
|
5
|
+
*/
|
|
6
|
+
import '@c8y/ngx-components/locales/de.po';
|
|
7
|
+
import '@c8y/ngx-components/locales/en.po';
|
|
8
|
+
import '@c8y/ngx-components/locales/es.po';
|
|
9
|
+
import '@c8y/ngx-components/locales/fr.po';
|
|
10
|
+
import '@c8y/ngx-components/locales/ja_JP.po';
|
|
11
|
+
import '@c8y/ngx-components/locales/ko.po';
|
|
12
|
+
import '@c8y/ngx-components/locales/nl.po';
|
|
13
|
+
import '@c8y/ngx-components/locales/pl.po';
|
|
14
|
+
import '@c8y/ngx-components/locales/pt_BR.po';
|
|
15
|
+
import '@c8y/ngx-components/locales/ru.po';
|
|
16
|
+
import '@c8y/ngx-components/locales/zh_CN.po';
|
|
17
|
+
import '@c8y/ngx-components/locales/zh_TW.po';
|
|
18
|
+
// import './locales/de.po'; // <- adding additional strings to the german translation.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CoreModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'c8y-range-input-example',
|
|
6
|
+
template: `<c8y-title> Range Input examples </c8y-title>
|
|
7
|
+
<div class="p-t-24">
|
|
8
|
+
<div class="form-group">
|
|
9
|
+
<label>Default range slider</label>
|
|
10
|
+
<c8y-range>
|
|
11
|
+
<input type="range" min="0" max="100" steps="1" />
|
|
12
|
+
</c8y-range>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="form-group">
|
|
15
|
+
<label>Range with custom popover</label>
|
|
16
|
+
<c8y-range #range>
|
|
17
|
+
<ng-template #c8yRangeValue>
|
|
18
|
+
<div>
|
|
19
|
+
<span>The <strong>Value</strong> is: {{ range.value }}</span>
|
|
20
|
+
</div>
|
|
21
|
+
</ng-template>
|
|
22
|
+
<input type="range" min="20" max="60" steps="2" />
|
|
23
|
+
</c8y-range>
|
|
24
|
+
</div>
|
|
25
|
+
</div>`,
|
|
26
|
+
standalone: true,
|
|
27
|
+
imports: [CoreModule]
|
|
28
|
+
})
|
|
29
|
+
export class RangeInputExampleComponent {}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { RangeInputExampleComponent } from './range-input-example.component';
|
|
3
|
+
import { hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
providers: [
|
|
7
|
+
hookRoute({
|
|
8
|
+
path: 'range-input',
|
|
9
|
+
component: RangeInputExampleComponent
|
|
10
|
+
}),
|
|
11
|
+
hookNavigator({
|
|
12
|
+
priority: 20,
|
|
13
|
+
path: '/range-input',
|
|
14
|
+
icon: 'form',
|
|
15
|
+
label: 'Range Input examples'
|
|
16
|
+
})
|
|
17
|
+
]
|
|
18
|
+
})
|
|
19
|
+
export class RangeInputExampleModule {}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { InventoryService } from '@c8y/client';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { HeaderModule } from '@c8y/ngx-components';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'cmp-lazy1',
|
|
8
|
+
template: `
|
|
9
|
+
<c8y-title>{{ 'Groups' }}</c8y-title>
|
|
10
|
+
<div class="card">
|
|
11
|
+
<div class="card-block">
|
|
12
|
+
<p *ngFor="let o of mos">{{ o.id }} - {{ o.name }}</p>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
`,
|
|
16
|
+
standalone: true,
|
|
17
|
+
imports: [CommonModule, HeaderModule]
|
|
18
|
+
})
|
|
19
|
+
export class ComponentOne {
|
|
20
|
+
mos: any[];
|
|
21
|
+
constructor(private inventory: InventoryService) {
|
|
22
|
+
this.fetch();
|
|
23
|
+
}
|
|
24
|
+
async fetch() {
|
|
25
|
+
const { data } = await this.inventory.list({ type: 'c8y_DeviceGroup', pageSize: 100 });
|
|
26
|
+
this.mos = data;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { HeaderModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'cmp-lazy2',
|
|
6
|
+
template: `
|
|
7
|
+
<c8y-title>Lazy Component </c8y-title>
|
|
8
|
+
<div class="card">
|
|
9
|
+
<div class="card-block">
|
|
10
|
+
<p>This module was lazy loaded</p>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
`,
|
|
14
|
+
standalone: true,
|
|
15
|
+
imports: [HeaderModule]
|
|
16
|
+
})
|
|
17
|
+
export class ComponentTwo {}
|