@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,43 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { DatapointSelectorModule, KPIDetails } from '@c8y/ngx-components/datapoint-selector';
|
|
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: 'datapoint-selection-selector-example',
|
|
9
|
+
template: `<c8y-title>Data point selector</c8y-title>
|
|
10
|
+
<div class="container-fluid p-t-24">
|
|
11
|
+
<div class="row">
|
|
12
|
+
<div class="col-xs-12 col-sm-8 col-md-9">
|
|
13
|
+
<div class="card">
|
|
14
|
+
<div class="card-block d-flex d-col p-0" style="height: 300px">
|
|
15
|
+
<!-- important -->
|
|
16
|
+
<c8y-datapoint-selector
|
|
17
|
+
class="d-contents"
|
|
18
|
+
[allowDatapointsFromMultipleAssets]="true"
|
|
19
|
+
[(ngModel)]="datapoints"
|
|
20
|
+
>
|
|
21
|
+
</c8y-datapoint-selector>
|
|
22
|
+
<!-- /important -->
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="col-xs-12 col-sm-4 col-md-3">
|
|
27
|
+
<div class="card">
|
|
28
|
+
<div class="card-header separator">
|
|
29
|
+
<h4 class="card-title">Model</h4>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="card-inner-scroll">
|
|
32
|
+
<pre style="min-height: 98px"><code>{{ datapoints | json }}</code></pre>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div> `,
|
|
38
|
+
standalone: true,
|
|
39
|
+
imports: [CommonModule, CoreModule, AssetSelectorModule, DatapointSelectorModule]
|
|
40
|
+
})
|
|
41
|
+
export class DatapointSelectionSelectorExampleComponent {
|
|
42
|
+
datapoints: KPIDetails[] = [];
|
|
43
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
providers: [
|
|
6
|
+
hookRoute({
|
|
7
|
+
path: 'selector/datapoint-selection-example/selector',
|
|
8
|
+
loadComponent: () =>
|
|
9
|
+
import('./datapoint-selection-selector-example.component').then(
|
|
10
|
+
m => m.DatapointSelectionSelectorExampleComponent
|
|
11
|
+
)
|
|
12
|
+
}),
|
|
13
|
+
hookNavigator(
|
|
14
|
+
new NavigatorNode({
|
|
15
|
+
label: 'selector',
|
|
16
|
+
path: '/selector/datapoint-selection-example/selector',
|
|
17
|
+
icon: 'th-list',
|
|
18
|
+
priority: -1,
|
|
19
|
+
parent: 'Datapoint selection'
|
|
20
|
+
})
|
|
21
|
+
)
|
|
22
|
+
]
|
|
23
|
+
})
|
|
24
|
+
export class DatapointSelectionSelectorExampleModule {}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { DatapointSelectorModule, KPIDetails } from '@c8y/ngx-components/datapoint-selector';
|
|
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: 'datapoint-selection-validation-example',
|
|
9
|
+
template: `<c8y-title>Data point selector</c8y-title>
|
|
10
|
+
<div class="container-fluid p-t-24">
|
|
11
|
+
<div class="row">
|
|
12
|
+
<div class="col-xs-12 col-sm-8 col-md-9">
|
|
13
|
+
<div class="card">
|
|
14
|
+
<div class="card-inner-scroll d-flex d-col bg-component" style="height: 350px">
|
|
15
|
+
<!-- important -->
|
|
16
|
+
<c8y-datapoint-selection-list
|
|
17
|
+
class="d-contents"
|
|
18
|
+
[(ngModel)]="datapoints"
|
|
19
|
+
[allowDragAndDrop]="false"
|
|
20
|
+
>
|
|
21
|
+
<div class="alert alert-danger" role="alert" translate>
|
|
22
|
+
Some validation error message
|
|
23
|
+
</div>
|
|
24
|
+
</c8y-datapoint-selection-list>
|
|
25
|
+
<!-- /important -->
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="col-xs-12 col-sm-4 col-md-3">
|
|
30
|
+
<div class="card">
|
|
31
|
+
<div class="card-header separator">
|
|
32
|
+
<h4 class="card-title">Model</h4>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="card-inner-scroll">
|
|
35
|
+
<pre style="min-height: 98px"><code>{{ datapoints | json }}</code></pre>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div> `,
|
|
41
|
+
standalone: true,
|
|
42
|
+
imports: [CommonModule, CoreModule, AssetSelectorModule, DatapointSelectorModule]
|
|
43
|
+
})
|
|
44
|
+
export class DatapointSelectionValidationExampleComponent {
|
|
45
|
+
datapoints: KPIDetails[] = [];
|
|
46
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
providers: [
|
|
6
|
+
hookRoute({
|
|
7
|
+
path: 'selector/datapoint-selection-example/validation-example',
|
|
8
|
+
loadComponent: () =>
|
|
9
|
+
import('./datapoint-selection-validation-example.component').then(
|
|
10
|
+
m => m.DatapointSelectionValidationExampleComponent
|
|
11
|
+
)
|
|
12
|
+
}),
|
|
13
|
+
hookNavigator(
|
|
14
|
+
new NavigatorNode({
|
|
15
|
+
label: 'validation error',
|
|
16
|
+
path: '/selector/datapoint-selection-example/validation-example',
|
|
17
|
+
icon: 'th-list',
|
|
18
|
+
priority: -1,
|
|
19
|
+
parent: 'Datapoint selection'
|
|
20
|
+
})
|
|
21
|
+
)
|
|
22
|
+
]
|
|
23
|
+
})
|
|
24
|
+
export class DatapointSelectionValidationExampleModule {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './standalone-demo.module';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { HeaderModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-standalone-component',
|
|
6
|
+
templateUrl: './standalone-component.component.html',
|
|
7
|
+
standalone: true,
|
|
8
|
+
// imports done here instead of a separate ng module.
|
|
9
|
+
imports: [HeaderModule]
|
|
10
|
+
})
|
|
11
|
+
export class StandaloneComponentComponent {}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
imports: [CommonModule],
|
|
7
|
+
// no declaration of StandaloneComponentComponent here.
|
|
8
|
+
providers: [
|
|
9
|
+
hookRoute({
|
|
10
|
+
path: 'standalone-demo',
|
|
11
|
+
loadComponent: () =>
|
|
12
|
+
import('./standalone-component/standalone-component.component').then(
|
|
13
|
+
m => m.StandaloneComponentComponent
|
|
14
|
+
)
|
|
15
|
+
}),
|
|
16
|
+
hookNavigator({
|
|
17
|
+
path: 'standalone-demo',
|
|
18
|
+
icon: 'single-page-mode',
|
|
19
|
+
label: 'NG Standalone Component'
|
|
20
|
+
})
|
|
21
|
+
]
|
|
22
|
+
})
|
|
23
|
+
export class StandaloneDemoModule {}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<div class="p-b-16">
|
|
2
|
+
<div *ngIf="isModal" class="modal-header modal-header-primary text-center">
|
|
3
|
+
<i [c8yIcon]="'diamond'" style="font-size: 32px"></i>
|
|
4
|
+
<h3 id="modal-title" class="p-t-16">{{ 'Create a new device ' }}</h3>
|
|
5
|
+
</div>
|
|
6
|
+
<c8y-stepper
|
|
7
|
+
(onStepChange)="navigate($event)"
|
|
8
|
+
[disableDefaultIcons]="{ edit: true, done: false }"
|
|
9
|
+
[customClasses]="['m-l-40', 'm-r-40', 'm-t-32']"
|
|
10
|
+
id="modal-body"
|
|
11
|
+
linear
|
|
12
|
+
>
|
|
13
|
+
<!-- override icons -->
|
|
14
|
+
<ng-template c8yStepperIcon="final">
|
|
15
|
+
<span [c8yIcon]="'hand-peace-o'"></span>
|
|
16
|
+
</ng-template>
|
|
17
|
+
<cdk-step [stepControl]="formGroupStepOne" label="Device name">
|
|
18
|
+
<div class="m-l-40 m-r-40 m-t-32">
|
|
19
|
+
<h4 title="Device name" class="p-b-8">Enter the device name</h4>
|
|
20
|
+
<c8y-form-group>
|
|
21
|
+
<div [formGroup]="formGroupStepOne">
|
|
22
|
+
<input
|
|
23
|
+
class="form-control"
|
|
24
|
+
type="text"
|
|
25
|
+
formControlName="name"
|
|
26
|
+
placeholder="MyDevice"
|
|
27
|
+
#nameRef
|
|
28
|
+
required
|
|
29
|
+
/>
|
|
30
|
+
<c8y-messages>
|
|
31
|
+
<c8y-message [name]="'required'" [text]="'Enter the name of the Device'"></c8y-message>
|
|
32
|
+
</c8y-messages>
|
|
33
|
+
</div>
|
|
34
|
+
</c8y-form-group>
|
|
35
|
+
</div>
|
|
36
|
+
<c8y-stepper-buttons></c8y-stepper-buttons>
|
|
37
|
+
</cdk-step>
|
|
38
|
+
<cdk-step [stepControl]="formGroupStepTwo" label="Device type">
|
|
39
|
+
<div class="m-l-40 m-r-40 m-t-32">
|
|
40
|
+
<h4 title="Enter device type" class="p-b-8">Enter the device type</h4>
|
|
41
|
+
<c8y-form-group>
|
|
42
|
+
<div [formGroup]="formGroupStepTwo">
|
|
43
|
+
<input
|
|
44
|
+
class="form-control"
|
|
45
|
+
type="any"
|
|
46
|
+
formControlName="type"
|
|
47
|
+
placeholder="e.g. phone"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
</c8y-form-group>
|
|
51
|
+
</div>
|
|
52
|
+
<c8y-stepper-buttons
|
|
53
|
+
title="Save device"
|
|
54
|
+
(onNext)="save()"
|
|
55
|
+
[labels]="{ next: 'Save' }"
|
|
56
|
+
[pending]="pendingStatus"
|
|
57
|
+
></c8y-stepper-buttons>
|
|
58
|
+
</cdk-step>
|
|
59
|
+
<!-- Final step -->
|
|
60
|
+
<cdk-step state="final" label="Job done!">
|
|
61
|
+
<div class="m-l-40 m-r-40 m-t-32">
|
|
62
|
+
<h4 class="p-b-32 text-center">Your device is now ready to save the world!</h4>
|
|
63
|
+
</div>
|
|
64
|
+
<c8y-stepper-buttons
|
|
65
|
+
(onBack)="close(isModal)"
|
|
66
|
+
[labels]="{ back: 'Got it!' }"
|
|
67
|
+
></c8y-stepper-buttons>
|
|
68
|
+
</cdk-step>
|
|
69
|
+
</c8y-stepper>
|
|
70
|
+
</div>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Component, OnInit, ViewChild } from '@angular/core';
|
|
2
|
+
import {
|
|
3
|
+
FormGroup,
|
|
4
|
+
Validators,
|
|
5
|
+
FormBuilder,
|
|
6
|
+
FormsModule,
|
|
7
|
+
ReactiveFormsModule
|
|
8
|
+
} from '@angular/forms';
|
|
9
|
+
import { C8yStepper, CoreModule } from '@c8y/ngx-components';
|
|
10
|
+
import { StepperService } from './stepper.service';
|
|
11
|
+
import { BsModalRef } from 'ngx-bootstrap/modal';
|
|
12
|
+
import { Subject } from 'rxjs';
|
|
13
|
+
import { upperFirst } from 'lodash';
|
|
14
|
+
|
|
15
|
+
enum step {
|
|
16
|
+
FIRST = 0,
|
|
17
|
+
SECOND = 1,
|
|
18
|
+
THIRD = 2
|
|
19
|
+
}
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'c8y-stepper-device',
|
|
22
|
+
templateUrl: './device-stepper.component.html',
|
|
23
|
+
standalone: true,
|
|
24
|
+
imports: [CoreModule, FormsModule, ReactiveFormsModule]
|
|
25
|
+
})
|
|
26
|
+
export class DeviceStepperComponent implements OnInit {
|
|
27
|
+
formGroupStepOne: FormGroup;
|
|
28
|
+
formGroupStepTwo: FormGroup;
|
|
29
|
+
|
|
30
|
+
pendingStatus = false;
|
|
31
|
+
|
|
32
|
+
@ViewChild(C8yStepper, { static: true })
|
|
33
|
+
stepper: C8yStepper;
|
|
34
|
+
isModal: boolean;
|
|
35
|
+
|
|
36
|
+
private onClose: Subject<any> = new Subject();
|
|
37
|
+
constructor(
|
|
38
|
+
private fb: FormBuilder,
|
|
39
|
+
private stepperService: StepperService,
|
|
40
|
+
private bsModalRef: BsModalRef
|
|
41
|
+
) {}
|
|
42
|
+
|
|
43
|
+
ngOnInit() {
|
|
44
|
+
this.formGroupStepOne = this.fb.group({
|
|
45
|
+
name: ['', Validators.required]
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
this.formGroupStepTwo = this.fb.group({
|
|
49
|
+
type: ['']
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
navigate(clickedStepIDX: number) {
|
|
54
|
+
console.log('Index is: ', clickedStepIDX);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
onMovingForward(clickedStepIDX: number, selectedStepIDX: number) {
|
|
58
|
+
this.stepper.next();
|
|
59
|
+
if (clickedStepIDX === step.THIRD && selectedStepIDX === step.SECOND) {
|
|
60
|
+
this.save();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
onMovingBackward(clickedStepIDX: number, selectedStepIDX: number) {
|
|
64
|
+
if ((clickedStepIDX === step.FIRST || step.SECOND) && selectedStepIDX === step.THIRD) {
|
|
65
|
+
this.resetStepper();
|
|
66
|
+
} else if (clickedStepIDX === step.FIRST && selectedStepIDX === step.SECOND) {
|
|
67
|
+
this.stepper.previous();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async save() {
|
|
71
|
+
this.pendingStatus = true;
|
|
72
|
+
await this.addDevice();
|
|
73
|
+
this.pendingStatus = false;
|
|
74
|
+
this.stepper.next();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
close(isModal: boolean) {
|
|
78
|
+
if (isModal) {
|
|
79
|
+
this.onClose.next(null);
|
|
80
|
+
this.bsModalRef.hide();
|
|
81
|
+
} else {
|
|
82
|
+
this.resetStepper();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private async addDevice() {
|
|
87
|
+
await this.stepperService.addDevice({
|
|
88
|
+
id: Math.random() * 1000,
|
|
89
|
+
name: upperFirst(this.formGroupStepOne.get('name').value),
|
|
90
|
+
type: upperFirst(this.formGroupStepTwo.get('type').value)
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private resetStepper() {
|
|
95
|
+
this.stepper.reset();
|
|
96
|
+
this.stepper.selectedIndex = 1;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './stepper.module';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { HeaderModule } from '@c8y/ngx-components';
|
|
3
|
+
import { DeviceStepperComponent } from './device-stepper.component';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'stepper',
|
|
7
|
+
template: `<c8y-title>Stepper</c8y-title>
|
|
8
|
+
<div class="card">
|
|
9
|
+
<div class="card-header separator">
|
|
10
|
+
<h4 class="card-title">Create new device</h4>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="card-block">
|
|
13
|
+
<c8y-stepper-device></c8y-stepper-device>
|
|
14
|
+
</div>
|
|
15
|
+
</div> `,
|
|
16
|
+
standalone: true,
|
|
17
|
+
imports: [HeaderModule, DeviceStepperComponent]
|
|
18
|
+
})
|
|
19
|
+
export class StepperComponent {}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
+
import { CoreModule, NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
4
|
+
import { StepperService } from './stepper.service';
|
|
5
|
+
|
|
6
|
+
@NgModule({
|
|
7
|
+
imports: [CoreModule, FormsModule, ReactiveFormsModule],
|
|
8
|
+
providers: [
|
|
9
|
+
StepperService,
|
|
10
|
+
hookRoute({
|
|
11
|
+
path: 'stepper',
|
|
12
|
+
loadComponent: () => import('./stepper.component').then(m => m.StepperComponent)
|
|
13
|
+
}),
|
|
14
|
+
hookNavigator(
|
|
15
|
+
new NavigatorNode({
|
|
16
|
+
label: 'Stepper',
|
|
17
|
+
path: '/stepper',
|
|
18
|
+
icon: 'step-forward',
|
|
19
|
+
priority: 10
|
|
20
|
+
})
|
|
21
|
+
)
|
|
22
|
+
]
|
|
23
|
+
})
|
|
24
|
+
export class StepperModule {}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { Device } from './device.model';
|
|
3
|
+
import { BsModalService } from 'ngx-bootstrap/modal';
|
|
4
|
+
import { DeviceStepperComponent } from './device-stepper.component';
|
|
5
|
+
/**
|
|
6
|
+
* With the help of this service you can add or remove devices.
|
|
7
|
+
*/
|
|
8
|
+
@Injectable()
|
|
9
|
+
export class StepperService {
|
|
10
|
+
private devices: Device[];
|
|
11
|
+
|
|
12
|
+
constructor(private modalService: BsModalService) {
|
|
13
|
+
this.devices = [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
addDevice(device: Device) {
|
|
17
|
+
return new Promise(resolve => {
|
|
18
|
+
setTimeout(() => {
|
|
19
|
+
this.devices.push(device);
|
|
20
|
+
resolve(true);
|
|
21
|
+
}, 2000);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
modalCreateDevice() {
|
|
26
|
+
this.modalService.show(DeviceStepperComponent, {
|
|
27
|
+
class: 'modal-lg',
|
|
28
|
+
ariaDescribedby: 'modal-body',
|
|
29
|
+
ariaLabelledBy: 'modal-title'
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
+
import { HeaderModule, TimePickerModule } from '@c8y/ngx-components';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'time-picker-example',
|
|
7
|
+
template: `<c8y-title>Time picker</c8y-title>
|
|
8
|
+
<c8y-time-picker [formControl]="form.get('time')"></c8y-time-picker>`,
|
|
9
|
+
standalone: true,
|
|
10
|
+
imports: [TimePickerModule, ReactiveFormsModule, HeaderModule]
|
|
11
|
+
})
|
|
12
|
+
export class TimePickerExampleComponent {
|
|
13
|
+
form: FormGroup;
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
this.form = new FormGroup({});
|
|
17
|
+
this.form.addControl('time', new FormControl(null));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
providers: [
|
|
6
|
+
hookRoute({
|
|
7
|
+
path: 'time-picker',
|
|
8
|
+
loadComponent: () =>
|
|
9
|
+
import('./time-picker-example.component').then(m => m.TimePickerExampleComponent)
|
|
10
|
+
}),
|
|
11
|
+
hookNavigator(
|
|
12
|
+
new NavigatorNode({
|
|
13
|
+
label: 'Time picker',
|
|
14
|
+
path: '/time-picker',
|
|
15
|
+
icon: 'realtime',
|
|
16
|
+
priority: 10
|
|
17
|
+
})
|
|
18
|
+
)
|
|
19
|
+
]
|
|
20
|
+
})
|
|
21
|
+
export class TimePickerExampleModule {}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CoreModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'c8y-date-translation',
|
|
6
|
+
template: `
|
|
7
|
+
<c8y-title>Date translation by c8yDate pipe</c8y-title>
|
|
8
|
+
<div class="card">
|
|
9
|
+
<div class="card-block">
|
|
10
|
+
<div>This date will be translated: {{ currentDate | c8yDate }}.</div>
|
|
11
|
+
<div>
|
|
12
|
+
This date exceeding the range supported by ECMAScript will be translated:
|
|
13
|
+
{{ 8640000000000000 + 1 | c8yDate }}.
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
`,
|
|
18
|
+
standalone: true,
|
|
19
|
+
imports: [CoreModule]
|
|
20
|
+
})
|
|
21
|
+
export class C8yDateTranslationComponent {
|
|
22
|
+
currentDate = new Date();
|
|
23
|
+
}
|
|
@@ -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: 'translations/date-translation/c8y-translation',
|
|
8
|
+
loadComponent: () =>
|
|
9
|
+
import('./c8y-date-translation.component').then(m => m.C8yDateTranslationComponent)
|
|
10
|
+
}),
|
|
11
|
+
hookNavigator(
|
|
12
|
+
new NavigatorNode({
|
|
13
|
+
priority: 996,
|
|
14
|
+
path: 'translations/date-translation/c8y-translation',
|
|
15
|
+
icon: 'rocket',
|
|
16
|
+
label: 'Date translation by c8y pipe',
|
|
17
|
+
parent: 'Translations'
|
|
18
|
+
})
|
|
19
|
+
)
|
|
20
|
+
]
|
|
21
|
+
})
|
|
22
|
+
export class C8yDateTranslationModule {}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CoreModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'date-translation',
|
|
6
|
+
template: `<c8y-title>Date translation by Angular pipe</c8y-title>
|
|
7
|
+
<div class="card">
|
|
8
|
+
<div class="card-block">
|
|
9
|
+
This date will be translated: {{ currentDate | date: 'medium' }}.
|
|
10
|
+
</div>
|
|
11
|
+
</div>`,
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [CoreModule]
|
|
14
|
+
})
|
|
15
|
+
export class DateTranslationComponent {
|
|
16
|
+
currentDate = new Date();
|
|
17
|
+
}
|
|
@@ -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: 'translations/text-translation/ng-translation',
|
|
8
|
+
loadComponent: () =>
|
|
9
|
+
import('./date-translation.component').then(m => m.DateTranslationComponent)
|
|
10
|
+
}),
|
|
11
|
+
hookNavigator(
|
|
12
|
+
new NavigatorNode({
|
|
13
|
+
priority: 995,
|
|
14
|
+
path: 'translations/text-translation/ng-translation',
|
|
15
|
+
icon: 'rocket',
|
|
16
|
+
label: 'Date translation by Angular pipe',
|
|
17
|
+
parent: 'Translations'
|
|
18
|
+
})
|
|
19
|
+
)
|
|
20
|
+
]
|
|
21
|
+
})
|
|
22
|
+
export class DateTranslationModule {}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
4
|
+
import { CoreModule, DynamicFormsModule, gettext } from '@c8y/ngx-components';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'dynamic-form-translation',
|
|
8
|
+
template: `
|
|
9
|
+
<c8y-title>Dynamic form translation</c8y-title>
|
|
10
|
+
<form class="card" [formGroup]="form" (ngSubmit)="onSubmit()">
|
|
11
|
+
<div class="card-block">
|
|
12
|
+
<formly-form [form]="form" [fields]="fields"></formly-form>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="card-footer">
|
|
15
|
+
<button class="btn btn-default" title="Reset" type="reset">Reset</button>
|
|
16
|
+
<button class="btn btn-primary" title="Submit" type="submit">Submit</button>
|
|
17
|
+
</div>
|
|
18
|
+
</form>
|
|
19
|
+
`,
|
|
20
|
+
standalone: true,
|
|
21
|
+
imports: [CoreModule, DynamicFormsModule]
|
|
22
|
+
})
|
|
23
|
+
export class DynamicFormTranslationComponent {
|
|
24
|
+
form = new FormGroup({});
|
|
25
|
+
fields: FormlyFieldConfig[] = [
|
|
26
|
+
{
|
|
27
|
+
key: 'radio',
|
|
28
|
+
type: 'radio',
|
|
29
|
+
templateOptions: {
|
|
30
|
+
label: gettext('Select action'),
|
|
31
|
+
description: gettext('some description…'),
|
|
32
|
+
options: [
|
|
33
|
+
{
|
|
34
|
+
value: '1',
|
|
35
|
+
label: gettext('Upload web application')
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: '2',
|
|
39
|
+
label: gettext('Upload microservice')
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: 'text',
|
|
46
|
+
type: 'input',
|
|
47
|
+
templateOptions: {
|
|
48
|
+
label: gettext('Text input'),
|
|
49
|
+
placeholder: gettext('You can provide some examples displayed as placeholder…'),
|
|
50
|
+
description: gettext('…and some short description.')
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
onSubmit() {
|
|
56
|
+
console.log('The form is submitted.');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -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: 'translations/dynamic-form-translation',
|
|
8
|
+
loadComponent: () =>
|
|
9
|
+
import('./dynamic-form-translation.component').then(m => m.DynamicFormTranslationComponent)
|
|
10
|
+
}),
|
|
11
|
+
hookNavigator(
|
|
12
|
+
new NavigatorNode({
|
|
13
|
+
priority: 994,
|
|
14
|
+
path: 'translations/dynamic-form-translation',
|
|
15
|
+
icon: 'rocket',
|
|
16
|
+
label: 'Dynamic form translation',
|
|
17
|
+
parent: 'Translations'
|
|
18
|
+
})
|
|
19
|
+
)
|
|
20
|
+
]
|
|
21
|
+
})
|
|
22
|
+
export class DynamicFormTranslationModule {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './translations.module';
|