@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,17 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { hookNavigator, NavigatorNode } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
declarations: [],
|
|
6
|
+
imports: [],
|
|
7
|
+
providers: [
|
|
8
|
+
hookNavigator(
|
|
9
|
+
new NavigatorNode({
|
|
10
|
+
label: 'Lists',
|
|
11
|
+
icon: 'c8y-device',
|
|
12
|
+
priority: 97
|
|
13
|
+
})
|
|
14
|
+
)
|
|
15
|
+
]
|
|
16
|
+
})
|
|
17
|
+
export class ListsModule {}
|
package/src/main.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import './i18n';
|
|
2
|
+
import { applyOptions, loadOptions, loginOptions } from '@c8y/bootstrap';
|
|
3
|
+
|
|
4
|
+
/** Verify that custom webpack config is working */
|
|
5
|
+
declare const HELLO_WORLD: string;
|
|
6
|
+
console.log(`${HELLO_WORLD} from custom webpack config`);
|
|
7
|
+
|
|
8
|
+
const barHolder: HTMLElement = document.querySelector('body > .init-load');
|
|
9
|
+
export const removeProgress = () => barHolder && barHolder.parentNode.removeChild(barHolder);
|
|
10
|
+
|
|
11
|
+
applicationSetup();
|
|
12
|
+
|
|
13
|
+
async function applicationSetup() {
|
|
14
|
+
const options = await applyOptions({
|
|
15
|
+
...(await loadOptions()),
|
|
16
|
+
...((await loginOptions()) as object)
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const mod = await import('./bootstrap');
|
|
20
|
+
const bootstrapApp = mod.bootstrap || (window as any).bootstrap || (() => null);
|
|
21
|
+
|
|
22
|
+
return Promise.resolve(bootstrapApp(options)).then(removeProgress);
|
|
23
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<c8y-title>Cluster map example</c8y-title>
|
|
2
|
+
<div class="d-flex p-16">
|
|
3
|
+
<div class="d-flex d-col j-c-center p-16">
|
|
4
|
+
<button
|
|
5
|
+
class="btn btn-default btn-block"
|
|
6
|
+
(click)="setRandomZoomLevel()"
|
|
7
|
+
>
|
|
8
|
+
Set random zoom level
|
|
9
|
+
</button>
|
|
10
|
+
<button
|
|
11
|
+
class="btn btn-default btn-block"
|
|
12
|
+
(click)="setCenter()"
|
|
13
|
+
>
|
|
14
|
+
Set map to Düsseldorf
|
|
15
|
+
</button>
|
|
16
|
+
<button
|
|
17
|
+
class="btn btn-default btn-block"
|
|
18
|
+
(click)="changeIcon()"
|
|
19
|
+
>
|
|
20
|
+
Change icon
|
|
21
|
+
</button>
|
|
22
|
+
<button
|
|
23
|
+
class="btn btn-default btn-block"
|
|
24
|
+
(click)="changeColor()"
|
|
25
|
+
>
|
|
26
|
+
Change color
|
|
27
|
+
</button>
|
|
28
|
+
<button
|
|
29
|
+
class="btn btn-default btn-block"
|
|
30
|
+
(click)="toggleAutorefresh()"
|
|
31
|
+
>
|
|
32
|
+
Toggle auto refresh every 5s
|
|
33
|
+
</button>
|
|
34
|
+
<button
|
|
35
|
+
class="btn btn-default btn-block"
|
|
36
|
+
(click)="showClusterColor = !showClusterColor"
|
|
37
|
+
>
|
|
38
|
+
Show cluster color
|
|
39
|
+
</button>
|
|
40
|
+
</div>
|
|
41
|
+
<!-- important -->
|
|
42
|
+
<div style="height: 350px; width: 100%; position: relative;">
|
|
43
|
+
<c8y-map-status
|
|
44
|
+
[clusterMap]="map"
|
|
45
|
+
[(config)]="config"
|
|
46
|
+
></c8y-map-status>
|
|
47
|
+
<c8y-cluster-map
|
|
48
|
+
#map
|
|
49
|
+
[config]="config"
|
|
50
|
+
[showClusterColor]="showClusterColor"
|
|
51
|
+
></c8y-cluster-map>
|
|
52
|
+
</div>
|
|
53
|
+
<!-- /important -->
|
|
54
|
+
<code
|
|
55
|
+
class="a-s-stretch p-16"
|
|
56
|
+
style="width: 200px"
|
|
57
|
+
>
|
|
58
|
+
<pre>{{ config | json }} </pre>
|
|
59
|
+
</code>
|
|
60
|
+
</div>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { ClusterMapConfig, defaultMapConfig, MapModule } from '@c8y/ngx-components/map';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { CoreModule } from '@c8y/ngx-components';
|
|
5
|
+
import { AssetSelectorModule } from '@c8y/ngx-components/assets-navigator';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'tut-cluster-map-example',
|
|
9
|
+
templateUrl: './cluster-map-example.component.html',
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [CommonModule, MapModule, CoreModule, AssetSelectorModule]
|
|
12
|
+
})
|
|
13
|
+
export class ClusterMapExampleComponent {
|
|
14
|
+
config: ClusterMapConfig = { center: defaultMapConfig.center, zoomLevel: 4 };
|
|
15
|
+
showClusterColor = false;
|
|
16
|
+
|
|
17
|
+
setRandomZoomLevel() {
|
|
18
|
+
this.config = { ...this.config, zoomLevel: Math.floor(1 + Math.random() * 11) };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
setCenter() {
|
|
22
|
+
this.config = { ...this.config, center: defaultMapConfig.center };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
changeIcon() {
|
|
26
|
+
this.config = { ...this.config, icon: this.config.icon ? undefined : 'map' };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
changeColor() {
|
|
30
|
+
this.config = { ...this.config, color: this.config.color ? undefined : '#0f0' };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
toggleAutorefresh() {
|
|
34
|
+
this.config = {
|
|
35
|
+
...this.config,
|
|
36
|
+
refreshInterval: this.config.refreshInterval ? undefined : 5000
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
imports: [CommonModule],
|
|
7
|
+
providers: [
|
|
8
|
+
hookRoute({
|
|
9
|
+
path: 'maps/cluster',
|
|
10
|
+
loadComponent: () =>
|
|
11
|
+
import('./cluster-map-example.component').then(m => m.ClusterMapExampleComponent)
|
|
12
|
+
}),
|
|
13
|
+
hookNavigator(
|
|
14
|
+
new NavigatorNode({
|
|
15
|
+
priority: 10,
|
|
16
|
+
path: 'maps/cluster',
|
|
17
|
+
icon: 'address',
|
|
18
|
+
label: 'Cluster map',
|
|
19
|
+
parent: 'Map examples'
|
|
20
|
+
})
|
|
21
|
+
)
|
|
22
|
+
]
|
|
23
|
+
})
|
|
24
|
+
export class ClusterMapExampleModule {}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<c8y-title>Cluster map with root node</c8y-title>
|
|
2
|
+
|
|
3
|
+
<div class="d-flex p-16">
|
|
4
|
+
<div class="d-flex d-col j-c-center p-16" style="min-width: 150px;">
|
|
5
|
+
<c8y-asset-selector
|
|
6
|
+
[(ngModel)]="rootNode"
|
|
7
|
+
[config]="{
|
|
8
|
+
groupsSelectable: true,
|
|
9
|
+
groupsOnly: false
|
|
10
|
+
}"
|
|
11
|
+
(change)="resetConfig()"
|
|
12
|
+
></c8y-asset-selector>
|
|
13
|
+
</div>
|
|
14
|
+
<!-- important -->
|
|
15
|
+
<div style="height: 350px; width: 100%; position: relative;">
|
|
16
|
+
<c8y-map-status
|
|
17
|
+
[clusterMap]="map"
|
|
18
|
+
[(config)]="followConfig"
|
|
19
|
+
></c8y-map-status>
|
|
20
|
+
<c8y-cluster-map
|
|
21
|
+
#map
|
|
22
|
+
[rootNode]="rootNode"
|
|
23
|
+
[config]="followConfig"
|
|
24
|
+
>
|
|
25
|
+
<div *c8yMapPopup="let context">
|
|
26
|
+
Hello World from:
|
|
27
|
+
<br />
|
|
28
|
+
{{ context.name }}
|
|
29
|
+
<button
|
|
30
|
+
class="btn btn-primary btn-small"
|
|
31
|
+
(click)="startFollow(context)"
|
|
32
|
+
>
|
|
33
|
+
Follow
|
|
34
|
+
</button>
|
|
35
|
+
</div>
|
|
36
|
+
</c8y-cluster-map>
|
|
37
|
+
</div>
|
|
38
|
+
<!-- /important -->
|
|
39
|
+
<code
|
|
40
|
+
class="a-s-stretch p-16"
|
|
41
|
+
style="width: 200px"
|
|
42
|
+
>
|
|
43
|
+
RootNode:
|
|
44
|
+
<code>
|
|
45
|
+
<pre style="max-height: 120px">{{ rootNode | json }} </pre>
|
|
46
|
+
</code>
|
|
47
|
+
<br />
|
|
48
|
+
<br />
|
|
49
|
+
Config:
|
|
50
|
+
<code>
|
|
51
|
+
<pre style="max-height: 120px">{{ followConfig | json }} </pre>
|
|
52
|
+
</code>
|
|
53
|
+
</code>
|
|
54
|
+
</div>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { ClusterMapConfig, defaultMapConfig, MapModule } from '@c8y/ngx-components/map';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { CoreModule } from '@c8y/ngx-components';
|
|
5
|
+
import { AssetSelectorModule } from '@c8y/ngx-components/assets-navigator';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'tut-cluster-map-root-node-example',
|
|
9
|
+
templateUrl: './cluster-map-root-node-example.component.html',
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [CommonModule, MapModule, CoreModule, AssetSelectorModule]
|
|
12
|
+
})
|
|
13
|
+
export class ClusterMapRootNodeExampleComponent {
|
|
14
|
+
config: ClusterMapConfig = { center: defaultMapConfig.center, zoomLevel: 4 };
|
|
15
|
+
followConfig: ClusterMapConfig = { center: defaultMapConfig.center, zoomLevel: 4 };
|
|
16
|
+
|
|
17
|
+
rootNode: unknown;
|
|
18
|
+
oldRootNode: unknown;
|
|
19
|
+
|
|
20
|
+
toggleAutorefresh() {
|
|
21
|
+
this.config = {
|
|
22
|
+
...this.config,
|
|
23
|
+
refreshInterval: this.config.refreshInterval ? undefined : 5000
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
startFollow(device) {
|
|
28
|
+
this.oldRootNode = this.rootNode;
|
|
29
|
+
this.rootNode = device;
|
|
30
|
+
this.followConfig = {
|
|
31
|
+
...this.followConfig,
|
|
32
|
+
follow: true,
|
|
33
|
+
disablePan: true,
|
|
34
|
+
disableZoom: true,
|
|
35
|
+
realtime: true,
|
|
36
|
+
zoomLevel: 14
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
stopFollow() {
|
|
41
|
+
this.rootNode = this.oldRootNode;
|
|
42
|
+
this.resetConfig();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
resetConfig() {
|
|
46
|
+
this.followConfig = {
|
|
47
|
+
...this.followConfig,
|
|
48
|
+
follow: false,
|
|
49
|
+
disablePan: false,
|
|
50
|
+
disableZoom: false,
|
|
51
|
+
realtime: false
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
imports: [CommonModule],
|
|
7
|
+
providers: [
|
|
8
|
+
hookRoute({
|
|
9
|
+
path: 'maps/cluster-root-node',
|
|
10
|
+
loadComponent: () =>
|
|
11
|
+
import('./cluster-map-root-node-example.component').then(
|
|
12
|
+
m => m.ClusterMapRootNodeExampleComponent
|
|
13
|
+
)
|
|
14
|
+
}),
|
|
15
|
+
hookNavigator(
|
|
16
|
+
new NavigatorNode({
|
|
17
|
+
priority: 10,
|
|
18
|
+
path: 'maps/cluster-root-node',
|
|
19
|
+
icon: 'c8y-find-map',
|
|
20
|
+
label: 'Cluster map with different root node',
|
|
21
|
+
parent: 'Map examples'
|
|
22
|
+
})
|
|
23
|
+
)
|
|
24
|
+
]
|
|
25
|
+
})
|
|
26
|
+
export class ClusterMapRootNodeExampleModule {}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { hookNavigator, NavigatorNode } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
declarations: [],
|
|
6
|
+
imports: [],
|
|
7
|
+
exports: [],
|
|
8
|
+
providers: [
|
|
9
|
+
hookNavigator(
|
|
10
|
+
new NavigatorNode({
|
|
11
|
+
priority: 20,
|
|
12
|
+
icon: 'map',
|
|
13
|
+
label: 'Map examples'
|
|
14
|
+
})
|
|
15
|
+
)
|
|
16
|
+
]
|
|
17
|
+
})
|
|
18
|
+
export class MapExamplesModule {}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<c8y-title>Map with popup example</c8y-title>
|
|
2
|
+
|
|
3
|
+
<div class="d-flex p-16">
|
|
4
|
+
<div class="d-flex d-col j-c-center p-16">
|
|
5
|
+
<button
|
|
6
|
+
class="btn btn-primary btn-block"
|
|
7
|
+
(click)="showFirstPopup()"
|
|
8
|
+
>
|
|
9
|
+
Show first popup
|
|
10
|
+
</button>
|
|
11
|
+
<button
|
|
12
|
+
class="btn btn-default btn-block"
|
|
13
|
+
(click)="changeDevices()"
|
|
14
|
+
>
|
|
15
|
+
Toogle device amount
|
|
16
|
+
</button>
|
|
17
|
+
</div>
|
|
18
|
+
<!-- important -->
|
|
19
|
+
<div style="height: 350px; width: 100%">
|
|
20
|
+
<c8y-map
|
|
21
|
+
[assets]="exampleDevices"
|
|
22
|
+
[config]="config"
|
|
23
|
+
>
|
|
24
|
+
<div *c8yMapPopup="let context">
|
|
25
|
+
Hello World from:
|
|
26
|
+
<br />
|
|
27
|
+
name: {{ context.name }}
|
|
28
|
+
<br />
|
|
29
|
+
id: {{ context.id }}
|
|
30
|
+
</div>
|
|
31
|
+
</c8y-map>
|
|
32
|
+
</div>
|
|
33
|
+
<!-- /important -->
|
|
34
|
+
</div>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Component, OnInit, ViewChild } from '@angular/core';
|
|
2
|
+
import { MapComponent, MapModule, MapService } from '@c8y/ngx-components/map';
|
|
3
|
+
import { MapConfig, PositionManagedObject } from '@c8y/ngx-components/map';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { CoreModule } from '@c8y/ngx-components';
|
|
6
|
+
import { AssetSelectorModule } from '@c8y/ngx-components/assets-navigator';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'tut-map-popup-examples',
|
|
10
|
+
templateUrl: './map-popup-example.component.html',
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [CommonModule, MapModule, CoreModule, AssetSelectorModule]
|
|
13
|
+
})
|
|
14
|
+
export class MapPopupExampleComponent implements OnInit {
|
|
15
|
+
exampleDevices: PositionManagedObject | PositionManagedObject[];
|
|
16
|
+
config: MapConfig = {};
|
|
17
|
+
private oneDevice: PositionManagedObject;
|
|
18
|
+
private allDevices: PositionManagedObject[];
|
|
19
|
+
|
|
20
|
+
@ViewChild(MapComponent)
|
|
21
|
+
map: MapComponent;
|
|
22
|
+
|
|
23
|
+
constructor(private mapService: MapService) {}
|
|
24
|
+
|
|
25
|
+
async ngOnInit() {
|
|
26
|
+
const devices = await this.mapService.getPositionDevices();
|
|
27
|
+
this.oneDevice = devices[0];
|
|
28
|
+
this.allDevices = devices as PositionManagedObject[];
|
|
29
|
+
this.exampleDevices = this.oneDevice;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
changeDevices() {
|
|
33
|
+
if (Array.isArray(this.exampleDevices)) {
|
|
34
|
+
this.exampleDevices = this.oneDevice;
|
|
35
|
+
} else {
|
|
36
|
+
this.exampleDevices = this.allDevices;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
showFirstPopup() {
|
|
41
|
+
this.map.markers[0].fireEvent('click');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
imports: [CommonModule],
|
|
7
|
+
providers: [
|
|
8
|
+
hookRoute({
|
|
9
|
+
path: 'maps/popup',
|
|
10
|
+
loadComponent: () =>
|
|
11
|
+
import('./map-popup-example.component').then(m => m.MapPopupExampleComponent)
|
|
12
|
+
}),
|
|
13
|
+
hookNavigator(
|
|
14
|
+
new NavigatorNode({
|
|
15
|
+
priority: 20,
|
|
16
|
+
path: 'maps/popup',
|
|
17
|
+
icon: 'map-marker',
|
|
18
|
+
label: 'Map with popup',
|
|
19
|
+
parent: 'Map examples'
|
|
20
|
+
})
|
|
21
|
+
)
|
|
22
|
+
]
|
|
23
|
+
})
|
|
24
|
+
export class MapPopupExampleModule {}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<c8y-title>Simple map example</c8y-title>
|
|
2
|
+
|
|
3
|
+
<div class="d-flex p-16">
|
|
4
|
+
<div class="d-flex d-col j-c-center p-16">
|
|
5
|
+
<button
|
|
6
|
+
class="btn btn-default btn-block"
|
|
7
|
+
(click)="changeDevices()"
|
|
8
|
+
>
|
|
9
|
+
Toggle device amount
|
|
10
|
+
</button>
|
|
11
|
+
<button
|
|
12
|
+
class="btn btn-default btn-block"
|
|
13
|
+
(click)="setRandomZoomLevel()"
|
|
14
|
+
>
|
|
15
|
+
Set random zoom level
|
|
16
|
+
</button>
|
|
17
|
+
<button
|
|
18
|
+
class="btn btn-default btn-block"
|
|
19
|
+
(click)="setCenter()"
|
|
20
|
+
>
|
|
21
|
+
Set map to Düsseldorf
|
|
22
|
+
</button>
|
|
23
|
+
<button
|
|
24
|
+
class="btn btn-default btn-block"
|
|
25
|
+
(click)="changeIcon()"
|
|
26
|
+
>
|
|
27
|
+
Change icon
|
|
28
|
+
</button>
|
|
29
|
+
<button
|
|
30
|
+
class="btn btn-default btn-block"
|
|
31
|
+
(click)="changeColor()"
|
|
32
|
+
>
|
|
33
|
+
Change color
|
|
34
|
+
</button>
|
|
35
|
+
<button
|
|
36
|
+
class="btn btn-default btn-block"
|
|
37
|
+
(click)="toggleRealtime()"
|
|
38
|
+
>
|
|
39
|
+
{{ config.realtime ? 'Disable realtime' : 'Enable realtime' }}
|
|
40
|
+
</button>
|
|
41
|
+
<button
|
|
42
|
+
class="btn btn-default btn-block"
|
|
43
|
+
(click)="toggleFollow()"
|
|
44
|
+
>
|
|
45
|
+
{{ config.follow ? 'Unfollow' : 'Follow' }}
|
|
46
|
+
</button>
|
|
47
|
+
</div>
|
|
48
|
+
<!-- important -->
|
|
49
|
+
<div style="height: 350px; width: 100%;">
|
|
50
|
+
<c8y-map
|
|
51
|
+
[assets]="exampleDevices"
|
|
52
|
+
[config]="config"
|
|
53
|
+
></c8y-map>
|
|
54
|
+
</div>
|
|
55
|
+
<!-- /important -->
|
|
56
|
+
<code style="width: 200px;" class="a-s-stretch p-16">
|
|
57
|
+
<pre>{{ config | json }} </pre>
|
|
58
|
+
</code>
|
|
59
|
+
</div>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { Component, OnInit } from '@angular/core';
|
|
3
|
+
import { CoreModule } from '@c8y/ngx-components';
|
|
4
|
+
import { AssetSelectorModule } from '@c8y/ngx-components/assets-navigator';
|
|
5
|
+
import {
|
|
6
|
+
MapConfig,
|
|
7
|
+
MapModule,
|
|
8
|
+
MapService,
|
|
9
|
+
PositionManagedObject,
|
|
10
|
+
defaultMapConfig
|
|
11
|
+
} from '@c8y/ngx-components/map';
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'c8y-simple-map-examples',
|
|
15
|
+
templateUrl: './simple-map-example.component.html',
|
|
16
|
+
standalone: true,
|
|
17
|
+
imports: [CommonModule, MapModule, CoreModule, AssetSelectorModule]
|
|
18
|
+
})
|
|
19
|
+
export class SimpleMapExampleComponent implements OnInit {
|
|
20
|
+
exampleDevices: PositionManagedObject | PositionManagedObject[];
|
|
21
|
+
config: MapConfig = {};
|
|
22
|
+
private oneDevice: PositionManagedObject;
|
|
23
|
+
private allDevices: PositionManagedObject[];
|
|
24
|
+
|
|
25
|
+
constructor(private mapService: MapService) {}
|
|
26
|
+
|
|
27
|
+
async ngOnInit() {
|
|
28
|
+
const devices = await this.mapService.getPositionDevices();
|
|
29
|
+
this.oneDevice = devices[0];
|
|
30
|
+
this.allDevices = devices as PositionManagedObject[];
|
|
31
|
+
this.exampleDevices = this.oneDevice;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
changeDevices() {
|
|
35
|
+
if (Array.isArray(this.exampleDevices)) {
|
|
36
|
+
this.exampleDevices = this.oneDevice;
|
|
37
|
+
} else {
|
|
38
|
+
this.exampleDevices = this.allDevices;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
setRandomZoomLevel() {
|
|
43
|
+
this.config = { ...this.config, zoomLevel: Math.floor(1 + Math.random() * 11) };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
setCenter() {
|
|
47
|
+
this.config = { ...this.config, center: defaultMapConfig.center };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
changeIcon() {
|
|
51
|
+
this.config = { ...this.config, icon: this.config.icon ? undefined : 'map' };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
changeColor() {
|
|
55
|
+
this.config = { ...this.config, color: this.config.color ? undefined : '#0f0' };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
toggleRealtime() {
|
|
59
|
+
this.config = { ...this.config, realtime: !this.config.realtime };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
toggleFollow() {
|
|
63
|
+
this.config = {
|
|
64
|
+
...this.config,
|
|
65
|
+
follow: !this.config.follow,
|
|
66
|
+
disablePan: !this.config.follow,
|
|
67
|
+
disableZoom: !this.config.follow
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
imports: [CommonModule],
|
|
7
|
+
providers: [
|
|
8
|
+
hookRoute({
|
|
9
|
+
path: 'maps/simple',
|
|
10
|
+
loadComponent: () =>
|
|
11
|
+
import('./simple-map-example.component').then(m => m.SimpleMapExampleComponent)
|
|
12
|
+
}),
|
|
13
|
+
hookNavigator(
|
|
14
|
+
new NavigatorNode({
|
|
15
|
+
priority: 30,
|
|
16
|
+
path: 'maps/simple',
|
|
17
|
+
icon: 'marker',
|
|
18
|
+
label: 'Simple map',
|
|
19
|
+
parent: 'Map examples'
|
|
20
|
+
})
|
|
21
|
+
)
|
|
22
|
+
]
|
|
23
|
+
})
|
|
24
|
+
export class SimpleMapExampleModule {}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Component, ViewChild } from '@angular/core';
|
|
2
|
+
import {
|
|
3
|
+
ConfirmModalComponent,
|
|
4
|
+
CoreModule,
|
|
5
|
+
FormsModule,
|
|
6
|
+
ModalLabels,
|
|
7
|
+
ModalModule,
|
|
8
|
+
Status,
|
|
9
|
+
StatusType
|
|
10
|
+
} from '@c8y/ngx-components';
|
|
11
|
+
import { DeleteModalCheckboxes } from '@c8y/ngx-components/sub-assets';
|
|
12
|
+
import { Subject } from 'rxjs';
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'confirm-modal',
|
|
16
|
+
template: `<c8y-confirm-modal
|
|
17
|
+
[title]="'Delete device'"
|
|
18
|
+
[status]="status"
|
|
19
|
+
[labels]="labels"
|
|
20
|
+
#modalRef
|
|
21
|
+
>
|
|
22
|
+
<form>
|
|
23
|
+
<p class="text-wrap m-b-16">
|
|
24
|
+
{{ 'You are about to delete device. Do you want to proceed?' }}
|
|
25
|
+
</p>
|
|
26
|
+
<c8y-form-group class="m-b-0">
|
|
27
|
+
<label class="c8y-checkbox" title="{{ 'Delete devices' }}">
|
|
28
|
+
<input name="cascade" type="checkbox" [(ngModel)]="config.cascade" />
|
|
29
|
+
<span></span>
|
|
30
|
+
<span class="text-break-word">
|
|
31
|
+
{{ 'Also delete all devices inside asset and its subassets' }}
|
|
32
|
+
</span>
|
|
33
|
+
</label>
|
|
34
|
+
</c8y-form-group>
|
|
35
|
+
</form>
|
|
36
|
+
</c8y-confirm-modal>`,
|
|
37
|
+
standalone: true,
|
|
38
|
+
imports: [ModalModule, FormsModule, CoreModule]
|
|
39
|
+
})
|
|
40
|
+
export class ConfirmModalExampleComponent {
|
|
41
|
+
@ViewChild('modalRef', { static: false }) modalRef: ConfirmModalComponent;
|
|
42
|
+
labels: ModalLabels = { ok: 'Delete', cancel: 'Cancel' };
|
|
43
|
+
status: StatusType = Status.DANGER;
|
|
44
|
+
closeSubject: Subject<DeleteModalCheckboxes> = new Subject();
|
|
45
|
+
config: DeleteModalCheckboxes = {
|
|
46
|
+
cascade: false
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
async ngAfterViewInit() {
|
|
50
|
+
try {
|
|
51
|
+
await this.modalRef.result;
|
|
52
|
+
this.onClose();
|
|
53
|
+
} catch (error) {
|
|
54
|
+
this.onDismiss();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
onClose() {
|
|
59
|
+
console.log('You have clicked "Delete" button the modal!');
|
|
60
|
+
this.closeSubject.next(this.config);
|
|
61
|
+
console.log('cascade is true -> you checked the checkbox', this.config);
|
|
62
|
+
this.closeSubject.complete();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
onDismiss() {
|
|
66
|
+
console.log('You have clicked "Cancel" button the modal!');
|
|
67
|
+
this.closeSubject.complete();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
providers: [
|
|
6
|
+
hookRoute({
|
|
7
|
+
path: 'modal/confirm-modal',
|
|
8
|
+
loadComponent: () =>
|
|
9
|
+
import('./confirm-modal-example.component').then(m => m.ConfirmModalExampleComponent)
|
|
10
|
+
}),
|
|
11
|
+
hookNavigator(
|
|
12
|
+
new NavigatorNode({
|
|
13
|
+
label: 'Confirm Modal',
|
|
14
|
+
path: '/modal/confirm-modal',
|
|
15
|
+
icon: 'list-alt',
|
|
16
|
+
priority: 1,
|
|
17
|
+
parent: 'Modal'
|
|
18
|
+
})
|
|
19
|
+
)
|
|
20
|
+
]
|
|
21
|
+
})
|
|
22
|
+
export class ConfirmModalExampleModule {}
|