@c8y/ngx-components 1023.71.1 → 1023.76.0
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/asset-properties/index.d.ts +19 -1
- package/asset-properties/index.d.ts.map +1 -1
- package/cockpit-config/index.d.ts +4 -3
- package/cockpit-config/index.d.ts.map +1 -1
- package/context-dashboard/index.d.ts +202 -4
- package/context-dashboard/index.d.ts.map +1 -1
- package/datapoints-export-selector/index.d.ts +8 -1
- package/datapoints-export-selector/index.d.ts.map +1 -1
- package/device-profile/index.d.ts +8 -1
- package/device-profile/index.d.ts.map +1 -1
- package/events/cockpit/index.d.ts +6 -0
- package/events/cockpit/index.d.ts.map +1 -0
- package/events/devicemanagement/index.d.ts +6 -0
- package/events/devicemanagement/index.d.ts.map +1 -0
- package/events/events-timeline/index.d.ts +10 -10
- package/events/events-timeline/index.d.ts.map +1 -1
- package/events/index.d.ts +363 -5
- package/events/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs +1 -1
- package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-alarms.mjs +1 -1
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-asset-properties.mjs +2 -2
- package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-auth-configuration.mjs +1 -1
- package/fesm2022/c8y-ngx-components-auth-configuration.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-branding-plain-branding-editor.mjs +1 -1
- package/fesm2022/c8y-ngx-components-branding-plain-branding-editor.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-branding-shared-lazy-add-branding-modal.mjs +1 -1
- package/fesm2022/c8y-ngx-components-branding-shared-lazy-add-branding-modal.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-branding-shared-lazy.mjs +2 -2
- package/fesm2022/c8y-ngx-components-branding-shared-lazy.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-cockpit-config.mjs +8 -11
- package/fesm2022/c8y-ngx-components-cockpit-config.mjs.map +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-alarm-count-config.component-CPLDClTp.mjs → c8y-ngx-components-computed-asset-properties-alarm-count-config.component-DX9Rgjgl.mjs} +2 -2
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-alarm-count-config.component-CPLDClTp.mjs.map → c8y-ngx-components-computed-asset-properties-alarm-count-config.component-DX9Rgjgl.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-9be_iMQg.mjs → c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-CRpLJ5H7.mjs} +8 -8
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-9be_iMQg.mjs.map → c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-CRpLJ5H7.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-B2em01_W.mjs → c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-2rDsrxcs.mjs} +2 -2
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-B2em01_W.mjs.map → c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-2rDsrxcs.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-event-count-config.component-CQuGa1RI.mjs → c8y-ngx-components-computed-asset-properties-event-count-config.component-BJNoqWZf.mjs} +2 -2
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-event-count-config.component-CQuGa1RI.mjs.map → c8y-ngx-components-computed-asset-properties-event-count-config.component-BJNoqWZf.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-CkmurxJv.mjs → c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-DYac6foX.mjs} +3 -3
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-CkmurxJv.mjs.map → c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-DYac6foX.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-last-measurement-config.component-CTK9zNUh.mjs → c8y-ngx-components-computed-asset-properties-last-measurement-config.component-3yTe6lIr.mjs} +3 -3
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-last-measurement-config.component-CTK9zNUh.mjs.map → c8y-ngx-components-computed-asset-properties-last-measurement-config.component-3yTe6lIr.mjs.map} +1 -1
- package/fesm2022/c8y-ngx-components-computed-asset-properties.mjs +1 -1
- package/fesm2022/{c8y-ngx-components-context-dashboard-dashboard-appearance-settings.component-DsCDppJx.mjs → c8y-ngx-components-context-dashboard-dashboard-appearance-settings.component-C7yXSDYC.mjs} +3 -3
- package/fesm2022/{c8y-ngx-components-context-dashboard-dashboard-appearance-settings.component-DsCDppJx.mjs.map → c8y-ngx-components-context-dashboard-dashboard-appearance-settings.component-C7yXSDYC.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-context-dashboard-dashboard-general-settings.component-RdLW5nde.mjs → c8y-ngx-components-context-dashboard-dashboard-general-settings.component-w8N16Z3t.mjs} +4 -4
- package/fesm2022/{c8y-ngx-components-context-dashboard-dashboard-general-settings.component-RdLW5nde.mjs.map → c8y-ngx-components-context-dashboard-dashboard-general-settings.component-w8N16Z3t.mjs.map} +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs +561 -21
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/{c8y-ngx-components-dashboard-details-advanced-tab-dashboard-details-advanced-tab.component-Cek3_qZQ.mjs → c8y-ngx-components-dashboard-details-advanced-tab-dashboard-details-advanced-tab.component-DVEnCRzW.mjs} +2 -2
- package/fesm2022/c8y-ngx-components-dashboard-details-advanced-tab-dashboard-details-advanced-tab.component-DVEnCRzW.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-dashboard-details-advanced-tab.mjs +2 -2
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +2 -2
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-library-details.mjs +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-library-details.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs +41 -8
- package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-profile.mjs +38 -12
- package/fesm2022/c8y-ngx-components-device-profile.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-license-confirm.mjs +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-license-confirm.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-shared.mjs +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-shared.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem.mjs +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-events-cockpit.mjs +54 -0
- package/fesm2022/c8y-ngx-components-events-cockpit.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-events-devicemanagement.mjs +79 -0
- package/fesm2022/c8y-ngx-components-events-devicemanagement.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-events-events-timeline.mjs +30 -23
- package/fesm2022/c8y-ngx-components-events-events-timeline.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-events.mjs +1080 -4
- package/fesm2022/c8y-ngx-components-events.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-file-preview.mjs +48 -41
- package/fesm2022/c8y-ngx-components-file-preview.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-files-repository.mjs +1 -1
- package/fesm2022/c8y-ngx-components-files-repository.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-global-context.mjs +108 -52
- package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-interval-picker.mjs +3 -3
- package/fesm2022/c8y-ngx-components-interval-picker.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-location.mjs +1 -1
- package/fesm2022/c8y-ngx-components-location.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operation-picker.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operation-picker.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-bulk-operation-scheduler.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-bulk-operation-scheduler.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-device-profile.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-device-profile.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-software.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-software.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-protocol-lpwan.mjs +5 -5
- package/fesm2022/c8y-ngx-components-protocol-lpwan.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-protocol-opcua.mjs +2 -2
- package/fesm2022/c8y-ngx-components-protocol-opcua.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-shared.mjs +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-shared.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-ssh-remote-access-ssh-endpoint-modal.mjs +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-ssh-remote-access-ssh-endpoint-modal.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-vnc-remote-access-vnc-endpoint-modal.mjs +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-vnc-remote-access-vnc-endpoint-modal.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-vnc-vnc-viewer.mjs +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-vnc-vnc-viewer.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs +1 -1
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-static-assets-modal.mjs +1 -1
- package/fesm2022/c8y-ngx-components-static-assets-modal.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-time-context.mjs +1 -1
- package/fesm2022/c8y-ngx-components-time-context.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs +1 -1
- package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-alarms-alarm-list.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-alarms-alarm-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-alarms-all-critical-alarms.mjs +4 -5
- package/fesm2022/c8y-ngx-components-widgets-definitions-alarms-all-critical-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-alarms-recent-alarms.mjs +4 -5
- package/fesm2022/c8y-ngx-components-widgets-definitions-alarms-recent-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-asset-notes.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-asset-notes.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-asset-table.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-asset-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-graph.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-table.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-device-control-message.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-device-control-message.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-event-list.mjs +39 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-event-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs +77 -5
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-image.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-image.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-info-gauge.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-info-gauge.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-kpi.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-kpi.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-linear-gauge.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-linear-gauge.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-map.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-markdown.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-markdown.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-radial-gauge.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-radial-gauge.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-silo.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-silo.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-three-d-rotation.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-three-d-rotation.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs +67 -60
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-events.mjs +236 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-events.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs +271 -31
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-image.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-image.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-info-gauge.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-info-gauge.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-linear-gauge.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-linear-gauge.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +380 -170
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/file-preview/index.d.ts +7 -6
- package/file-preview/index.d.ts.map +1 -1
- package/global-context/index.d.ts +90 -1
- package/global-context/index.d.ts.map +1 -1
- package/index.d.ts +116 -15
- package/index.d.ts.map +1 -1
- package/locales/de.po +120 -3
- package/locales/es.po +120 -3
- package/locales/fr.po +120 -3
- package/locales/ja_JP.po +120 -3
- package/locales/ko.po +120 -3
- package/locales/locales.pot +120 -3
- package/locales/nl.po +120 -3
- package/locales/pl.po +120 -3
- package/locales/pt_BR.po +120 -3
- package/locales/zh_CN.po +120 -3
- package/locales/zh_TW.po +120 -3
- package/package.json +1 -1
- package/widgets/definitions/alarms/all-critical-alarms/index.d.ts +1 -2
- package/widgets/definitions/alarms/all-critical-alarms/index.d.ts.map +1 -1
- package/widgets/definitions/alarms/recent-alarms/index.d.ts +1 -2
- package/widgets/definitions/alarms/recent-alarms/index.d.ts.map +1 -1
- package/widgets/definitions/event-list/index.d.ts +44 -1
- package/widgets/definitions/event-list/index.d.ts.map +1 -1
- package/widgets/implementations/alarms/index.d.ts +8 -1
- package/widgets/implementations/alarms/index.d.ts.map +1 -1
- package/widgets/implementations/events/index.d.ts +89 -0
- package/widgets/implementations/events/index.d.ts.map +1 -0
- package/widgets/implementations/html-widget/index.d.ts +69 -9
- package/widgets/implementations/html-widget/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-dashboard-details-advanced-tab-dashboard-details-advanced-tab.component-Cek3_qZQ.mjs.map +0 -1
|
@@ -95,13 +95,13 @@ class IntervalPickerComponent {
|
|
|
95
95
|
this.disabled = disabled;
|
|
96
96
|
}
|
|
97
97
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: IntervalPickerComponent, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
98
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
98
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: IntervalPickerComponent, isStandalone: true, selector: "c8y-interval-picker", inputs: { INTERVALS: "INTERVALS" }, providers: [
|
|
99
99
|
{
|
|
100
100
|
provide: NG_VALUE_ACCESSOR,
|
|
101
101
|
useExisting: forwardRef(() => IntervalPickerComponent),
|
|
102
102
|
multi: true
|
|
103
103
|
}
|
|
104
|
-
], ngImport: i0, template: "
|
|
104
|
+
], ngImport: i0, template: "@for (interval of translatedIntervals; track interval.id) {\n <li\n [ngClass]=\"{\n active: interval.id === value\n }\"\n >\n <button\n type=\"button\"\n [attr.data-cy]=\"'interval-picker--' + interval.id\"\n (click)=\"onChange(interval.id)\"\n >\n <span\n [ngClass]=\"{\n 'text-primary': interval.id === value\n }\"\n >\n <span\n c8yIcon=\"check\"\n [ngStyle]=\"{ visibility: interval.id === value ? 'visible' : 'hidden' }\"\n ></span>\n {{ interval.title }}\n </span>\n </button>\n </li>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: A11yModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: BsDropdownModule }] }); }
|
|
105
105
|
}
|
|
106
106
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: IntervalPickerComponent, decorators: [{
|
|
107
107
|
type: Component,
|
|
@@ -111,7 +111,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
111
111
|
useExisting: forwardRef(() => IntervalPickerComponent),
|
|
112
112
|
multi: true
|
|
113
113
|
}
|
|
114
|
-
], template: "
|
|
114
|
+
], template: "@for (interval of translatedIntervals; track interval.id) {\n <li\n [ngClass]=\"{\n active: interval.id === value\n }\"\n >\n <button\n type=\"button\"\n [attr.data-cy]=\"'interval-picker--' + interval.id\"\n (click)=\"onChange(interval.id)\"\n >\n <span\n [ngClass]=\"{\n 'text-primary': interval.id === value\n }\"\n >\n <span\n c8yIcon=\"check\"\n [ngStyle]=\"{ visibility: interval.id === value ? 'visible' : 'hidden' }\"\n ></span>\n {{ interval.title }}\n </span>\n </button>\n </li>\n}\n" }]
|
|
115
115
|
}], ctorParameters: () => [{ type: i1.TranslateService }], propDecorators: { INTERVALS: [{
|
|
116
116
|
type: Input
|
|
117
117
|
}] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-interval-picker.mjs","sources":["../../interval-picker/interval-picker.model.ts","../../interval-picker/interval-picker.component.ts","../../interval-picker/interval-picker.component.html","../../interval-picker/c8y-ngx-components-interval-picker.ts"],"sourcesContent":["import { gettext } from '@c8y/ngx-components/gettext';\n\nconst todayDate = new Date();\nexport enum TimeSpanInMs {\n 'MINUTE' = 1000 * 60,\n 'HOUR' = 1000 * 60 * 60,\n 'DAY' = 1000 * 60 * 60 * 24,\n 'WEEK' = 1000 * 60 * 60 * 24 * 7,\n 'MONTH' = todayDate.valueOf() - new Date(todayDate.setMonth(todayDate.getMonth() - 1)).valueOf()\n}\nexport type Interval = {\n id: 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'custom';\n title: string;\n timespanInMs?: number;\n};\n\nexport type AlarmFilterInterval =\n | Interval\n | {\n id: 'none';\n title: string;\n timespanInMs?: number;\n };\n\nexport const INTERVALS: Interval[] = [\n {\n id: 'minutes',\n title: gettext('Last minute'),\n timespanInMs: TimeSpanInMs.MINUTE\n },\n {\n id: 'hours',\n title: gettext('Last hour'),\n timespanInMs: TimeSpanInMs.HOUR\n },\n {\n id: 'days',\n title: gettext('Last day'),\n timespanInMs: TimeSpanInMs.DAY\n },\n {\n id: 'weeks',\n title: gettext('Last week'),\n timespanInMs: TimeSpanInMs.WEEK\n },\n {\n id: 'months',\n title: gettext('Last month'),\n timespanInMs: TimeSpanInMs.MONTH\n },\n { id: 'custom', title: gettext('Custom') }\n];\n\nexport const INTERVAL_TITLES: Record<Interval['id'], string> = {\n minutes: gettext('Last minute'),\n hours: gettext('Last hour'),\n days: gettext('Last day'),\n weeks: gettext('Last week'),\n months: gettext('Last month'),\n custom: gettext('Custom')\n};\n\ntype IntervalKey = Interval['id'];\ntype IntervalMap = { [K in IntervalKey]: K };\n\nexport const INTERVAL_VALUES = Object.keys(INTERVAL_TITLES).reduce(\n (acc, key) => ({\n ...acc,\n [key]: key\n }),\n {} as IntervalMap\n);\n","import { Component, forwardRef, Input } from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR,\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { AlarmFilterInterval, Interval, INTERVALS } from './interval-picker.model';\nimport { TranslateService } from '@ngx-translate/core';\n\n@Component({\n selector: 'c8y-interval-picker',\n templateUrl: './interval-picker.component.html',\n standalone: true,\n imports: [CommonModule, FormsModule, A11yModule, ReactiveFormsModule, BsDropdownModule],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => IntervalPickerComponent),\n multi: true\n }\n ]\n})\nexport class IntervalPickerComponent implements ControlValueAccessor {\n @Input() INTERVALS: Interval[] | AlarmFilterInterval[] = INTERVALS;\n\n value: Interval['id'];\n touched = false;\n disabled = false;\n\n translatedIntervals: { id: string; title: string }[] = [];\n\n constructor(private translate: TranslateService) {}\n\n ngOnInit() {\n this.translatedIntervals = this.INTERVALS.map(interval => ({\n ...interval,\n title: this.translate.instant(interval.title)\n }));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onChange = _ => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onTouched = () => {};\n\n writeValue(value: Interval['id']) {\n this.value = value;\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(onTouched: any) {\n this.onTouched = onTouched;\n }\n\n markAsTouched() {\n if (!this.touched) {\n this.onTouched();\n this.touched = true;\n }\n }\n\n setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n}\n","
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-interval-picker.mjs","sources":["../../interval-picker/interval-picker.model.ts","../../interval-picker/interval-picker.component.ts","../../interval-picker/interval-picker.component.html","../../interval-picker/c8y-ngx-components-interval-picker.ts"],"sourcesContent":["import { gettext } from '@c8y/ngx-components/gettext';\n\nconst todayDate = new Date();\nexport enum TimeSpanInMs {\n 'MINUTE' = 1000 * 60,\n 'HOUR' = 1000 * 60 * 60,\n 'DAY' = 1000 * 60 * 60 * 24,\n 'WEEK' = 1000 * 60 * 60 * 24 * 7,\n 'MONTH' = todayDate.valueOf() - new Date(todayDate.setMonth(todayDate.getMonth() - 1)).valueOf()\n}\nexport type Interval = {\n id: 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'custom';\n title: string;\n timespanInMs?: number;\n};\n\nexport type AlarmFilterInterval =\n | Interval\n | {\n id: 'none';\n title: string;\n timespanInMs?: number;\n };\n\nexport const INTERVALS: Interval[] = [\n {\n id: 'minutes',\n title: gettext('Last minute'),\n timespanInMs: TimeSpanInMs.MINUTE\n },\n {\n id: 'hours',\n title: gettext('Last hour'),\n timespanInMs: TimeSpanInMs.HOUR\n },\n {\n id: 'days',\n title: gettext('Last day'),\n timespanInMs: TimeSpanInMs.DAY\n },\n {\n id: 'weeks',\n title: gettext('Last week'),\n timespanInMs: TimeSpanInMs.WEEK\n },\n {\n id: 'months',\n title: gettext('Last month'),\n timespanInMs: TimeSpanInMs.MONTH\n },\n { id: 'custom', title: gettext('Custom') }\n];\n\nexport const INTERVAL_TITLES: Record<Interval['id'], string> = {\n minutes: gettext('Last minute'),\n hours: gettext('Last hour'),\n days: gettext('Last day'),\n weeks: gettext('Last week'),\n months: gettext('Last month'),\n custom: gettext('Custom')\n};\n\ntype IntervalKey = Interval['id'];\ntype IntervalMap = { [K in IntervalKey]: K };\n\nexport const INTERVAL_VALUES = Object.keys(INTERVAL_TITLES).reduce(\n (acc, key) => ({\n ...acc,\n [key]: key\n }),\n {} as IntervalMap\n);\n","import { Component, forwardRef, Input } from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR,\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { AlarmFilterInterval, Interval, INTERVALS } from './interval-picker.model';\nimport { TranslateService } from '@ngx-translate/core';\n\n@Component({\n selector: 'c8y-interval-picker',\n templateUrl: './interval-picker.component.html',\n standalone: true,\n imports: [CommonModule, FormsModule, A11yModule, ReactiveFormsModule, BsDropdownModule],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => IntervalPickerComponent),\n multi: true\n }\n ]\n})\nexport class IntervalPickerComponent implements ControlValueAccessor {\n @Input() INTERVALS: Interval[] | AlarmFilterInterval[] = INTERVALS;\n\n value: Interval['id'];\n touched = false;\n disabled = false;\n\n translatedIntervals: { id: string; title: string }[] = [];\n\n constructor(private translate: TranslateService) {}\n\n ngOnInit() {\n this.translatedIntervals = this.INTERVALS.map(interval => ({\n ...interval,\n title: this.translate.instant(interval.title)\n }));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onChange = _ => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onTouched = () => {};\n\n writeValue(value: Interval['id']) {\n this.value = value;\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(onTouched: any) {\n this.onTouched = onTouched;\n }\n\n markAsTouched() {\n if (!this.touched) {\n this.onTouched();\n this.touched = true;\n }\n }\n\n setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n}\n","@for (interval of translatedIntervals; track interval.id) {\n <li\n [ngClass]=\"{\n active: interval.id === value\n }\"\n >\n <button\n type=\"button\"\n [attr.data-cy]=\"'interval-picker--' + interval.id\"\n (click)=\"onChange(interval.id)\"\n >\n <span\n [ngClass]=\"{\n 'text-primary': interval.id === value\n }\"\n >\n <span\n c8yIcon=\"check\"\n [ngStyle]=\"{ visibility: interval.id === value ? 'visible' : 'hidden' }\"\n ></span>\n {{ interval.title }}\n </span>\n </button>\n </li>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAEA,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE;IAChB;AAAZ,CAAA,UAAY,YAAY,EAAA;AACtB,IAAA,YAAA,CAAA,YAAA,CAAA,QAAA,CAAA,GAAA,KAAA,CAAA,GAAA,QAAoB;AACpB,IAAA,YAAA,CAAA,YAAA,CAAA,MAAA,CAAA,GAAA,OAAA,CAAA,GAAA,MAAuB;AACvB,IAAA,YAAA,CAAA,YAAA,CAAA,KAAA,CAAA,GAAA,QAAA,CAAA,GAAA,KAA2B;AAC3B,IAAA,YAAA,CAAA,YAAA,CAAA,MAAA,CAAA,GAAA,SAAA,CAAA,GAAA,MAAgC;IAChC,YAAA,CAAA,YAAA,CAAA,OAAA,CAAA,GAAU,SAAS,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA,GAAA,OAAA;AAClG,CAAC,EANW,YAAY,KAAZ,YAAY,GAAA,EAAA,CAAA,CAAA;AAqBjB,MAAM,SAAS,GAAe;AACnC,IAAA;AACE,QAAA,EAAE,EAAE,SAAS;AACb,QAAA,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC;QAC7B,YAAY,EAAE,YAAY,CAAC;AAC5B,KAAA;AACD,IAAA;AACE,QAAA,EAAE,EAAE,OAAO;AACX,QAAA,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC;QAC3B,YAAY,EAAE,YAAY,CAAC;AAC5B,KAAA;AACD,IAAA;AACE,QAAA,EAAE,EAAE,MAAM;AACV,QAAA,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC;QAC1B,YAAY,EAAE,YAAY,CAAC;AAC5B,KAAA;AACD,IAAA;AACE,QAAA,EAAE,E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ationComponent, deps: [{ token: i1$1.ContextRouteService }, { token: i3.ActivatedRoute }, { token: i1.InventoryService }, { token: i1$1.Permissions }, { token: i1$1.OptionsService }, { token: i1$1.AlertService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
237
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: LocationComponent, isStandalone: true, selector: "c8y-location", viewQueries: [{ propertyName: "map", first: true, predicate: MapComponent, descendants: true }], ngImport: i0, template: "<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link c8y-realtime\"\n title=\"{{ 'Toggle realtime' | translate }}\"\n type=\"button\"\n (click)=\"toggleRealtime()\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{ active: config.realtime, inactive: !config.realtime }\"\n ></span>\n <span translate>Realtime</span>\n </button>\n</c8y-action-bar-item>\n<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-clean\"\n title=\"{{ 'Center`verb`' | translate }}\"\n (click)=\"centerMap()\"\n >\n <i [c8yIcon]=\"'target1'\"></i>\n <span translate>Center`verb`</span>\n </button>\n</c8y-action-bar-item>\n\n<div class=\"card card--grid content-fullpage d-grid grid__col--8-4--md\">\n <div\n class=\"bg-white p-relative\"\n style=\"min-height: 30vh\"\n >\n <c8y-map\n [assets]=\"[position]\"\n [config]=\"config\"\n (onRealtimeUpdate)=\"positionChanged($event)\"\n ></c8y-map>\n </div>\n\n <form\n class=\"d-flex d-col bg-inherit content-fullpage bg-gray-white\"\n #positionForm=\"ngForm\"\n (ngSubmit)=\"save()\"\n >\n <div class=\"card-header large-padding separator sticky-top\">\n <span\n class=\"card-title\"\n translate\n >\n Device location\n </span>\n </div>\n <div class=\"inner-scroll\">\n <div\n class=\"m-16\"\n *ngIf=\"!isEdit\"\n >\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Latitude (\u00B0)\n </div>\n {{ position.c8y_Position.lat }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Longitude (\u00B0)\n </div>\n {{ position.c8y_Position.lng }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Altitude (m)\n </div>\n {{ position.c8y_Position.alt }}\n </div>\n </div>\n <div\n class=\"m-16\"\n *ngIf=\"isEdit\"\n >\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Latitude (\u00B0)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Latitude (\u00B0)' | translate\"\n id=\"lat\"\n name=\"lat\"\n type=\"number\"\n required\n min=\"-90\"\n max=\"90\"\n (blur)=\"positionForm.valid && updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lat\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum latitude value is -90\u00B0.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum latitude value is 90\u00B0.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Longitude (\u00B0)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Longitude (\u00B0)' | translate\"\n id=\"lng\"\n name=\"lng\"\n type=\"number\"\n required\n min=\"-180\"\n max=\"180\"\n (blur)=\"positionForm.valid && updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lng\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum longitude value is -180\u00B0.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum longitude value is 180\u00B0.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"alt\"\n translate\n >\n Altitude (m)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Altitude (m)' | translate\"\n id=\"alt\"\n name=\"alt\"\n type=\"number\"\n [(ngModel)]=\"position.c8y_Position.alt\"\n />\n </c8y-form-group>\n </div>\n\n <form\n class=\"card-block bg-level-1\"\n #addressSearch=\"ngForm\"\n novalidate\n (submit)=\"searchAddress(addressSearchTerm)\"\n *ngIf=\"isEdit && !hideAddressSearchFeature\"\n >\n <div class=\"form-group\">\n <label\n for=\"searchAddress\"\n translate\n >\n Find lat/long by address\n </label>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n id=\"searchAddress\"\n name=\"addressSearchTerm\"\n type=\"text\"\n [placeholder]=\"'e.g. Speditionstra\u00DFe 13, D\u00FCsseldorf`LOCALIZE`' | translate\"\n [(ngModel)]=\"addressSearchTerm\"\n />\n <span class=\"input-group-btn\">\n <button\n class=\"btn btn-dot\"\n [title]=\"'Search' | translate\"\n type=\"submit\"\n >\n <i\n class=\"dlt-c8y-icon-search\"\n c8y-icon=\"search\"\n ></i>\n </button>\n </span>\n </div>\n </div>\n </form>\n </div>\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Edit location' | translate\"\n type=\"button\"\n *ngIf=\"canEdit && !isEdit\"\n (click)=\"edit()\"\n translate\n >\n Edit location\n </button>\n <button\n class=\"btn btn-default\"\n [title]=\"'Cancel' | translate\"\n type=\"button\"\n (click)=\"cancel()\"\n *ngIf=\"isEdit\"\n translate\n >\n Cancel\n </button>\n <button\n class=\"btn btn-primary\"\n [title]=\"'Save' | translate\"\n type=\"submit\"\n *ngIf=\"isEdit\"\n translate\n [disabled]=\"!positionForm.valid\"\n >\n Save\n </button>\n </div>\n </form>\n</div>\n", dependencies: [{ kind: "component", type: ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "component", type: MapComponent, selector: "c8y-map", inputs: ["config", "assets", "polyline$", "polylineOptions"], outputs: ["onRealtimeUpdate", "onMove", "onMoveEnd", "onZoomStart", "onZoomEnd", "onMap", "onInit"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i4$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i4$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i4$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "directive", type: RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: MinValidationDirective, selector: "[min]", inputs: ["min"] }, { kind: "directive", type: MaxValidationDirective, selector: "[max]", inputs: ["max"] }, { kind: "component", type: MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: MessageDirective, selector: "c8y-message", inputs: ["name", "text"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
237
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: LocationComponent, isStandalone: true, selector: "c8y-location", viewQueries: [{ propertyName: "map", first: true, predicate: MapComponent, descendants: true }], ngImport: i0, template: "<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link c8y-realtime\"\n title=\"{{ 'Toggle realtime' | translate }}\"\n type=\"button\"\n (click)=\"toggleRealtime()\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{ active: config.realtime, inactive: !config.realtime }\"\n ></span>\n <span translate>Realtime</span>\n </button>\n</c8y-action-bar-item>\n<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-clean\"\n title=\"{{ 'Center`verb`' | translate }}\"\n (click)=\"centerMap()\"\n >\n <i [c8yIcon]=\"'target1'\"></i>\n <span translate>Center`verb`</span>\n </button>\n</c8y-action-bar-item>\n\n<div class=\"card card--grid content-fullpage d-grid grid__col--8-4--md\">\n <div\n class=\"bg-white p-relative\"\n style=\"min-height: 30vh\"\n >\n <c8y-map\n [assets]=\"[position]\"\n [config]=\"config\"\n (onRealtimeUpdate)=\"positionChanged($event)\"\n ></c8y-map>\n </div>\n\n <form\n class=\"d-flex d-col bg-inherit content-fullpage bg-gray-white\"\n #positionForm=\"ngForm\"\n (ngSubmit)=\"save()\"\n >\n <div class=\"card-header large-padding separator sticky-top\">\n <span\n class=\"card-title\"\n translate\n >\n Device location\n </span>\n </div>\n <div class=\"inner-scroll\">\n <div\n class=\"m-16\"\n *ngIf=\"!isEdit\"\n >\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Latitude (\u00B0)\n </div>\n {{ position.c8y_Position.lat }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Longitude (\u00B0)\n </div>\n {{ position.c8y_Position.lng }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Altitude (m)\n </div>\n {{ position.c8y_Position.alt }}\n </div>\n </div>\n <div\n class=\"m-16\"\n *ngIf=\"isEdit\"\n >\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Latitude (\u00B0)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Latitude (\u00B0)' | translate\"\n id=\"lat\"\n name=\"lat\"\n type=\"number\"\n required\n min=\"-90\"\n max=\"90\"\n (blur)=\"positionForm.valid && updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lat\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum latitude value is -90\u00B0.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum latitude value is 90\u00B0.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Longitude (\u00B0)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Longitude (\u00B0)' | translate\"\n id=\"lng\"\n name=\"lng\"\n type=\"number\"\n required\n min=\"-180\"\n max=\"180\"\n (blur)=\"positionForm.valid && updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lng\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum longitude value is -180\u00B0.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum longitude value is 180\u00B0.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"alt\"\n translate\n >\n Altitude (m)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Altitude (m)' | translate\"\n id=\"alt\"\n name=\"alt\"\n type=\"number\"\n [(ngModel)]=\"position.c8y_Position.alt\"\n />\n </c8y-form-group>\n </div>\n\n <form\n class=\"card-block bg-level-1\"\n #addressSearch=\"ngForm\"\n novalidate\n (submit)=\"searchAddress(addressSearchTerm)\"\n *ngIf=\"isEdit && !hideAddressSearchFeature\"\n >\n <div class=\"form-group\">\n <label\n for=\"searchAddress\"\n translate\n >\n Find lat/long by address\n </label>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n id=\"searchAddress\"\n name=\"addressSearchTerm\"\n type=\"text\"\n [placeholder]=\"'e.g. Speditionstra\u00DFe 13, D\u00FCsseldorf`LOCALIZE`' | translate\"\n [(ngModel)]=\"addressSearchTerm\"\n />\n <span class=\"input-group-btn\">\n <button\n class=\"btn btn-dot\"\n [title]=\"'Search' | translate\"\n type=\"submit\"\n >\n <i\n class=\"dlt-c8y-icon-search\"\n c8y-icon=\"search\"\n ></i>\n </button>\n </span>\n </div>\n </div>\n </form>\n </div>\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Edit location' | translate\"\n type=\"button\"\n *ngIf=\"canEdit && !isEdit\"\n (click)=\"edit()\"\n translate\n >\n Edit location\n </button>\n <button\n class=\"btn btn-default\"\n [title]=\"'Cancel' | translate\"\n type=\"button\"\n (click)=\"cancel()\"\n *ngIf=\"isEdit\"\n translate\n >\n Cancel\n </button>\n <button\n class=\"btn btn-primary\"\n [title]=\"'Save' | translate\"\n type=\"submit\"\n *ngIf=\"isEdit\"\n translate\n [disabled]=\"!positionForm.valid\"\n >\n Save\n </button>\n </div>\n </form>\n</div>\n", dependencies: [{ kind: "component", type: ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "component", type: MapComponent, selector: "c8y-map", inputs: ["config", "assets", "polyline$", "polylineOptions"], outputs: ["onRealtimeUpdate", "onMove", "onMoveEnd", "onZoomStart", "onZoomEnd", "onMap", "onInit"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i4$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i4$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i4$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "directive", type: RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: MinValidationDirective, selector: "[min]", inputs: ["min"] }, { kind: "directive", type: MaxValidationDirective, selector: "[max]", inputs: ["max"] }, { kind: "component", type: MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage", "additionalMessages"] }, { kind: "directive", type: MessageDirective, selector: "c8y-message", inputs: ["name", "text"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
238
238
|
}
|
|
239
239
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: LocationComponent, decorators: [{
|
|
240
240
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-location.mjs","sources":["../../location/add-location.component.ts","../../location/add-location.component.html","../../location/add-location.factory.ts","../../location/location-tab.factory.ts","../../location/location.component.ts","../../location/location.component.html","../../location/location.module.ts","../../location/c8y-ngx-components-location.ts"],"sourcesContent":["import {\n Component,\n Inject,\n OnInit,\n Optional,\n TemplateRef,\n ViewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { IManagedObject, InventoryService } from '@c8y/client';\nimport {\n AlertService,\n ContextRouteService,\n IconDirective,\n C8yTranslateDirective,\n C8yTranslatePipe\n} from '@c8y/ngx-components';\nimport type { MapDefaultConfig } from '@c8y/options';\nimport { Router } from '@angular/router';\nimport { MAP_DEFAULT_CONFIG, defaultMapConfig } from '@c8y/ngx-components/map';\nimport { Observable, of } from 'rxjs';\nimport { first } from 'rxjs/operators';\n\n@Component({\n selector: 'c8y-add-location',\n templateUrl: './add-location.component.html',\n imports: [IconDirective, C8yTranslateDirective, C8yTranslatePipe]\n})\nexport class AddLocationComponent implements OnInit {\n @ViewChild('templateCopy', { read: TemplateRef, static: true }) templateCopy;\n\n constructor(\n private inventoryService: InventoryService,\n private contextRouteService: ContextRouteService,\n @Optional()\n @Inject(MAP_DEFAULT_CONFIG)\n private defaultConfig$: Observable<MapDefaultConfig>,\n private router: Router,\n private alertService: AlertService,\n private vcRef: ViewContainerRef\n ) {}\n\n ngOnInit() {\n this.vcRef.createEmbeddedView(this.templateCopy);\n }\n\n onClick(): void {\n const mapConfig$ = this.defaultConfig$ || of(defaultMapConfig);\n mapConfig$.pipe(first()).subscribe(async config => {\n const context = this.contextRouteService.activatedContextData;\n context.contextData.c8y_Position = {\n lat: config.center[0],\n lng: config.center[1]\n };\n try {\n await this.inventoryService.update(context.contextData as IManagedObject);\n } catch (ex) {\n this.alertService.addServerFailure(ex);\n }\n\n const route = this.contextRouteService.getContextRoute(context);\n this.contextRouteService.refreshContext();\n this.router.navigateByUrl(route + '/location');\n });\n }\n}\n","<ng-template #templateCopy>\n <button\n class=\"btn btn-link\"\n [title]=\"'Add location' | translate\"\n (click)=\"onClick()\"\n >\n <i c8yIcon=\"location-arrow\"></i>\n <span translate>Add location</span>\n </button>\n</ng-template>\n","import { Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport {\n ActionBarFactory,\n ActionBarItem,\n ContextRouteService,\n ViewContext\n} from '@c8y/ngx-components';\nimport { AddLocationComponent } from './add-location.component';\nimport { isUndefined } from 'lodash-es';\n\n@Injectable({ providedIn: 'root' })\nexport class AddLocationFactory implements ActionBarFactory {\n private action: ActionBarItem = {\n component: AddLocationComponent,\n placement: 'more'\n };\n\n constructor(private contextRouteService: ContextRouteService) {}\n\n get(activatedRoute?: ActivatedRoute): ActionBarItem {\n const routeData = this.contextRouteService.getContextData(activatedRoute);\n if (!routeData) {\n return;\n }\n if (\n routeData.context === ViewContext.Device &&\n isUndefined(routeData.contextData.c8y_Position)\n ) {\n return this.action;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { ContextRouteService, Tab, ViewContext, ExtensionFactory } from '@c8y/ngx-components';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LocationTabFactory implements ExtensionFactory<Tab> {\n constructor(private contextRouteService: ContextRouteService) {}\n\n get(activatedRoute: ActivatedRoute): Tab[] {\n const contextData = this.contextRouteService.getContextData(activatedRoute);\n const isDeviceOrGroupWithPosition =\n (contextData?.context === ViewContext.Device || contextData?.context === ViewContext.Group) &&\n contextData?.contextData.c8y_Position;\n if (isDeviceOrGroupWithPosition) {\n return [\n {\n label: gettext('Location'),\n icon: 'location-arrow',\n path: `${this.contextRouteService.getContextRoute(contextData)}/location`\n }\n ];\n }\n return [];\n }\n}\n","import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport { MapComponent, MapConfig, PositionManagedObject } from '@c8y/ngx-components/map';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport {\n AlertService,\n ContextRouteService,\n OptionsService,\n Permissions,\n ActionBarItemComponent,\n C8yTranslateDirective,\n IconDirective,\n FormGroupComponent,\n RequiredInputPlaceholderDirective,\n MinValidationDirective,\n MaxValidationDirective,\n MessagesComponent,\n MessageDirective,\n C8yTranslatePipe\n} from '@c8y/ngx-components';\nimport { ActivatedRoute } from '@angular/router';\nimport { InventoryService } from '@c8y/client';\nimport { isUndefined, cloneDeep } from 'lodash-es';\nimport { takeUntil } from 'rxjs/operators';\nimport { Subject } from 'rxjs';\nimport { NgClass, NgIf } from '@angular/common';\n\nimport { FormsModule } from '@angular/forms';\n\n@Component({\n selector: 'c8y-location',\n templateUrl: './location.component.html',\n imports: [\n ActionBarItemComponent,\n NgClass,\n C8yTranslateDirective,\n IconDirective,\n MapComponent,\n FormsModule,\n NgIf,\n FormGroupComponent,\n RequiredInputPlaceholderDirective,\n MinValidationDirective,\n MaxValidationDirective,\n MessagesComponent,\n MessageDirective,\n C8yTranslatePipe\n ]\n})\nexport class LocationComponent implements OnInit, OnDestroy {\n position: PositionManagedObject;\n originalPosition: PositionManagedObject;\n isEdit = false;\n canEdit = true;\n config: MapConfig = { realtime: false, follow: true, zoomLevel: 12 };\n addressSearchTerm = '';\n hideAddressSearchFeature = false;\n\n private destroy$ = new Subject<void>();\n private mapNominatimUrl = 'https://nominatim.openstreetmap.org/search?format=json&q={searchTerm}';\n\n @ViewChild(MapComponent)\n map: MapComponent;\n\n constructor(\n private contextRouteService: ContextRouteService,\n private activatedRoute: ActivatedRoute,\n private inventoryService: InventoryService,\n private permissions: Permissions,\n private optionsService: OptionsService,\n private alertService: AlertService\n ) {}\n\n ngOnInit(): void {\n this.activatedRoute.url.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.updateMap();\n });\n }\n\n async updateMap() {\n const { contextData } = this.contextRouteService.getContextData(this.activatedRoute);\n this.position = contextData as PositionManagedObject;\n this.canEdit = await this.permissions.canEdit(\n [Permissions.ROLE_INVENTORY_ADMIN, Permissions.ROLE_INVENTORY_CREATE],\n contextData\n );\n\n const hasCustomSetting = !isUndefined(this.optionsService.mapNominatimUrl);\n this.hideAddressSearchFeature = hasCustomSetting && !this.optionsService.mapNominatimUrl;\n\n if (hasCustomSetting) {\n this.mapNominatimUrl = this.optionsService.mapNominatimUrl;\n }\n\n this.map.refresh();\n }\n\n toggleRealtime() {\n this.config = { ...this.config, realtime: !this.config.realtime };\n }\n\n disableRealtime() {\n this.config = { ...this.config, realtime: false };\n }\n\n centerMap() {\n this.config = {\n ...this.config,\n center: [this.position.c8y_Position.lat, this.position.c8y_Position.lng]\n };\n }\n\n edit() {\n this.originalPosition = cloneDeep(this.position);\n this.enableMarkerDragging();\n this.disableRealtime();\n this.isEdit = true;\n }\n\n cancel() {\n this.position = this.originalPosition;\n this.isEdit = false;\n this.map.markers[0]?.dragging.disable();\n this.centerMap();\n }\n\n async save() {\n try {\n const { data } = await this.inventoryService.update({\n id: this.position.id,\n c8y_Position: this.position.c8y_Position\n });\n this.position = data as PositionManagedObject;\n } catch (ex) {\n this.alertService.addServerFailure(ex);\n }\n this.map.markers[0]?.dragging.disable();\n this.centerMap();\n this.isEdit = false;\n }\n\n positionChanged(position: PositionManagedObject) {\n this.position = position;\n }\n\n async searchAddress(searchTerm: string) {\n const fetchResponse = await fetch(this.mapNominatimUrl.replace('{searchTerm}', searchTerm));\n if (fetchResponse.status !== 200) {\n this.alertService.danger(gettext('Failed to search for address.'));\n return;\n }\n const data: Array<{ lat: string | number; lon: string | number; licence?: string }> =\n await fetchResponse.json();\n const latLng = data[0];\n if (!latLng) {\n this.alertService.warning(gettext('Address could not be found.'));\n return;\n }\n this.position.c8y_Position.lat = Number(latLng.lat);\n this.position.c8y_Position.lng = Number(latLng.lon);\n this.updateMarkerPosition();\n if (latLng.licence) {\n this.map.map.attributionControl.addAttribution(latLng.licence);\n }\n }\n\n updateMarkerPosition() {\n this.map.refreshMarkers();\n this.enableMarkerDragging();\n this.centerMap();\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n }\n\n private enableMarkerDragging() {\n const marker = this.map.markers[0];\n if (marker) {\n marker.dragging.enable();\n marker.on('dragend', () => {\n const latlng = marker.getLatLng();\n this.position.c8y_Position = {\n ...this.position.c8y_Position,\n lat: latlng.lat,\n lng: latlng.lng\n };\n this.centerMap();\n });\n }\n }\n}\n","<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link c8y-realtime\"\n title=\"{{ 'Toggle realtime' | translate }}\"\n type=\"button\"\n (click)=\"toggleRealtime()\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{ active: config.realtime, inactive: !config.realtime }\"\n ></span>\n <span translate>Realtime</span>\n </button>\n</c8y-action-bar-item>\n<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-clean\"\n title=\"{{ 'Center`verb`' | translate }}\"\n (click)=\"centerMap()\"\n >\n <i [c8yIcon]=\"'target1'\"></i>\n <span translate>Center`verb`</span>\n </button>\n</c8y-action-bar-item>\n\n<div class=\"card card--grid content-fullpage d-grid grid__col--8-4--md\">\n <div\n class=\"bg-white p-relative\"\n style=\"min-height: 30vh\"\n >\n <c8y-map\n [assets]=\"[position]\"\n [config]=\"config\"\n (onRealtimeUpdate)=\"positionChanged($event)\"\n ></c8y-map>\n </div>\n\n <form\n class=\"d-flex d-col bg-inherit content-fullpage bg-gray-white\"\n #positionForm=\"ngForm\"\n (ngSubmit)=\"save()\"\n >\n <div class=\"card-header large-padding separator sticky-top\">\n <span\n class=\"card-title\"\n translate\n >\n Device location\n </span>\n </div>\n <div class=\"inner-scroll\">\n <div\n class=\"m-16\"\n *ngIf=\"!isEdit\"\n >\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Latitude (°)\n </div>\n {{ position.c8y_Position.lat }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Longitude (°)\n </div>\n {{ position.c8y_Position.lng }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Altitude (m)\n </div>\n {{ position.c8y_Position.alt }}\n </div>\n </div>\n <div\n class=\"m-16\"\n *ngIf=\"isEdit\"\n >\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Latitude (°)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Latitude (°)' | translate\"\n id=\"lat\"\n name=\"lat\"\n type=\"number\"\n required\n min=\"-90\"\n max=\"90\"\n (blur)=\"positionForm.valid && updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lat\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum latitude value is -90°.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum latitude value is 90°.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Longitude (°)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Longitude (°)' | translate\"\n id=\"lng\"\n name=\"lng\"\n type=\"number\"\n required\n min=\"-180\"\n max=\"180\"\n (blur)=\"positionForm.valid && updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lng\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum longitude value is -180°.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum longitude value is 180°.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"alt\"\n translate\n >\n Altitude (m)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Altitude (m)' | translate\"\n id=\"alt\"\n name=\"alt\"\n type=\"number\"\n [(ngModel)]=\"position.c8y_Position.alt\"\n />\n </c8y-form-group>\n </div>\n\n <form\n class=\"card-block bg-level-1\"\n #addressSearch=\"ngForm\"\n novalidate\n (submit)=\"searchAddress(addressSearchTerm)\"\n *ngIf=\"isEdit && !hideAddressSearchFeature\"\n >\n <div class=\"form-group\">\n <label\n for=\"searchAddress\"\n translate\n >\n Find lat/long by address\n </label>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n id=\"searchAddress\"\n name=\"addressSearchTerm\"\n type=\"text\"\n [placeholder]=\"'e.g. Speditionstraße 13, Düsseldorf`LOCALIZE`' | translate\"\n [(ngModel)]=\"addressSearchTerm\"\n />\n <span class=\"input-group-btn\">\n <button\n class=\"btn btn-dot\"\n [title]=\"'Search' | translate\"\n type=\"submit\"\n >\n <i\n class=\"dlt-c8y-icon-search\"\n c8y-icon=\"search\"\n ></i>\n </button>\n </span>\n </div>\n </div>\n </form>\n </div>\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Edit location' | translate\"\n type=\"button\"\n *ngIf=\"canEdit && !isEdit\"\n (click)=\"edit()\"\n translate\n >\n Edit location\n </button>\n <button\n class=\"btn btn-default\"\n [title]=\"'Cancel' | translate\"\n type=\"button\"\n (click)=\"cancel()\"\n *ngIf=\"isEdit\"\n translate\n >\n Cancel\n </button>\n <button\n class=\"btn btn-primary\"\n [title]=\"'Save' | translate\"\n type=\"submit\"\n *ngIf=\"isEdit\"\n translate\n [disabled]=\"!positionForm.valid\"\n >\n Save\n </button>\n </div>\n </form>\n</div>\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CoreModule, hookActionBar, hookRoute, hookTab, ViewContext } from '@c8y/ngx-components';\nimport { MapModule } from '@c8y/ngx-components/map';\nimport { AddLocationComponent } from './add-location.component';\nimport { AddLocationFactory } from './add-location.factory';\nimport { LocationTabFactory } from './location-tab.factory';\nimport { LocationComponent } from './location.component';\nimport { LocationConfiguration } from './location.model';\n\n@NgModule({\n imports: [MapModule, CoreModule, RouterModule, LocationComponent],\n exports: [LocationComponent],\n providers: [\n hookRoute({\n path: 'location',\n component: LocationComponent,\n context: ViewContext.Device,\n tabs: []\n }),\n hookRoute({\n path: 'location',\n component: LocationComponent,\n context: ViewContext.Group,\n tabs: []\n })\n ]\n})\nexport class LocationRouteModule {}\n\n@NgModule({\n imports: [LocationRouteModule],\n providers: [hookTab(LocationTabFactory)]\n})\nexport class LocationTabModule {}\n\n/**\n * @deprecated has been splitted into `LocationTabModule` and `AddLocationModule`.\n */\n@NgModule({\n imports: [LocationTabModule]\n})\nexport class LocationModule {\n /**\n *\n * @deprecated use the `LocationTabModule` and optionally `AddLocationModule` instead.\n */\n static config(\n config: LocationConfiguration = { addLocation: false }\n ): ModuleWithProviders<LocationModule> {\n return {\n ngModule: LocationModule,\n providers: config.addLocation ? [hookActionBar(AddLocationFactory)] : []\n };\n }\n}\n\n@NgModule({\n imports: [CoreModule, LocationRouteModule, AddLocationComponent],\n exports: [AddLocationComponent],\n providers: [hookActionBar(AddLocationFactory)]\n})\nexport class AddLocationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":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,kBAAkB,CAAC,CAAC,EAAA,OAAA,EAAA,CAFpC,UAAU,EAAE,mBAAmB,CAAA,EAAA,CAAA,CAAA;;4FAI9B,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAL7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,mBAAmB,EAAE,oBAAoB,CAAC;oBAChE,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAC/B,oBAAA,SAAS,EAAE,CAAC,aAAa,CAAC,kBAAkB,CAAC;AAC9C,iBAAA;;;AC7DD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-location.mjs","sources":["../../location/add-location.component.ts","../../location/add-location.component.html","../../location/add-location.factory.ts","../../location/location-tab.factory.ts","../../location/location.component.ts","../../location/location.component.html","../../location/location.module.ts","../../location/c8y-ngx-components-location.ts"],"sourcesContent":["import {\n Component,\n Inject,\n OnInit,\n Optional,\n TemplateRef,\n ViewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { IManagedObject, InventoryService } from '@c8y/client';\nimport {\n AlertService,\n ContextRouteService,\n IconDirective,\n C8yTranslateDirective,\n C8yTranslatePipe\n} from '@c8y/ngx-components';\nimport type { MapDefaultConfig } from '@c8y/options';\nimport { Router } from '@angular/router';\nimport { MAP_DEFAULT_CONFIG, defaultMapConfig } from '@c8y/ngx-components/map';\nimport { Observable, of } from 'rxjs';\nimport { first } from 'rxjs/operators';\n\n@Component({\n selector: 'c8y-add-location',\n templateUrl: './add-location.component.html',\n imports: [IconDirective, C8yTranslateDirective, C8yTranslatePipe]\n})\nexport class AddLocationComponent implements OnInit {\n @ViewChild('templateCopy', { read: TemplateRef, static: true }) templateCopy;\n\n constructor(\n private inventoryService: InventoryService,\n private contextRouteService: ContextRouteService,\n @Optional()\n @Inject(MAP_DEFAULT_CONFIG)\n private defaultConfig$: Observable<MapDefaultConfig>,\n private router: Router,\n private alertService: AlertService,\n private vcRef: ViewContainerRef\n ) {}\n\n ngOnInit() {\n this.vcRef.createEmbeddedView(this.templateCopy);\n }\n\n onClick(): void {\n const mapConfig$ = this.defaultConfig$ || of(defaultMapConfig);\n mapConfig$.pipe(first()).subscribe(async config => {\n const context = this.contextRouteService.activatedContextData;\n context.contextData.c8y_Position = {\n lat: config.center[0],\n lng: config.center[1]\n };\n try {\n await this.inventoryService.update(context.contextData as IManagedObject);\n } catch (ex) {\n this.alertService.addServerFailure(ex);\n }\n\n const route = this.contextRouteService.getContextRoute(context);\n this.contextRouteService.refreshContext();\n this.router.navigateByUrl(route + '/location');\n });\n }\n}\n","<ng-template #templateCopy>\n <button\n class=\"btn btn-link\"\n [title]=\"'Add location' | translate\"\n (click)=\"onClick()\"\n >\n <i c8yIcon=\"location-arrow\"></i>\n <span translate>Add location</span>\n </button>\n</ng-template>\n","import { Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport {\n ActionBarFactory,\n ActionBarItem,\n ContextRouteService,\n ViewContext\n} from '@c8y/ngx-components';\nimport { AddLocationComponent } from './add-location.component';\nimport { isUndefined } from 'lodash-es';\n\n@Injectable({ providedIn: 'root' })\nexport class AddLocationFactory implements ActionBarFactory {\n private action: ActionBarItem = {\n component: AddLocationComponent,\n placement: 'more'\n };\n\n constructor(private contextRouteService: ContextRouteService) {}\n\n get(activatedRoute?: ActivatedRoute): ActionBarItem {\n const routeData = this.contextRouteService.getContextData(activatedRoute);\n if (!routeData) {\n return;\n }\n if (\n routeData.context === ViewContext.Device &&\n isUndefined(routeData.contextData.c8y_Position)\n ) {\n return this.action;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { ContextRouteService, Tab, ViewContext, ExtensionFactory } from '@c8y/ngx-components';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LocationTabFactory implements ExtensionFactory<Tab> {\n constructor(private contextRouteService: ContextRouteService) {}\n\n get(activatedRoute: ActivatedRoute): Tab[] {\n const contextData = this.contextRouteService.getContextData(activatedRoute);\n const isDeviceOrGroupWithPosition =\n (contextData?.context === ViewContext.Device || contextData?.context === ViewContext.Group) &&\n contextData?.contextData.c8y_Position;\n if (isDeviceOrGroupWithPosition) {\n return [\n {\n label: gettext('Location'),\n icon: 'location-arrow',\n path: `${this.contextRouteService.getContextRoute(contextData)}/location`\n }\n ];\n }\n return [];\n }\n}\n","import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport { MapComponent, MapConfig, PositionManagedObject } from '@c8y/ngx-components/map';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport {\n AlertService,\n ContextRouteService,\n OptionsService,\n Permissions,\n ActionBarItemComponent,\n C8yTranslateDirective,\n IconDirective,\n FormGroupComponent,\n RequiredInputPlaceholderDirective,\n MinValidationDirective,\n MaxValidationDirective,\n MessagesComponent,\n MessageDirective,\n C8yTranslatePipe\n} from '@c8y/ngx-components';\nimport { ActivatedRoute } from '@angular/router';\nimport { InventoryService } from '@c8y/client';\nimport { isUndefined, cloneDeep } from 'lodash-es';\nimport { takeUntil } from 'rxjs/operators';\nimport { Subject } from 'rxjs';\nimport { NgClass, NgIf } from '@angular/common';\n\nimport { FormsModule } from '@angular/forms';\n\n@Component({\n selector: 'c8y-location',\n templateUrl: './location.component.html',\n imports: [\n ActionBarItemComponent,\n NgClass,\n C8yTranslateDirective,\n IconDirective,\n MapComponent,\n FormsModule,\n NgIf,\n FormGroupComponent,\n RequiredInputPlaceholderDirective,\n MinValidationDirective,\n MaxValidationDirective,\n MessagesComponent,\n MessageDirective,\n C8yTranslatePipe\n ]\n})\nexport class LocationComponent implements OnInit, OnDestroy {\n position: PositionManagedObject;\n originalPosition: PositionManagedObject;\n isEdit = false;\n canEdit = true;\n config: MapConfig = { realtime: false, follow: true, zoomLevel: 12 };\n addressSearchTerm = '';\n hideAddressSearchFeature = false;\n\n private destroy$ = new Subject<void>();\n private mapNominatimUrl = 'https://nominatim.openstreetmap.org/search?format=json&q={searchTerm}';\n\n @ViewChild(MapComponent)\n map: MapComponent;\n\n constructor(\n private contextRouteService: ContextRouteService,\n private activatedRoute: ActivatedRoute,\n private inventoryService: InventoryService,\n private permissions: Permissions,\n private optionsService: OptionsService,\n private alertService: AlertService\n ) {}\n\n ngOnInit(): void {\n this.activatedRoute.url.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.updateMap();\n });\n }\n\n async updateMap() {\n const { contextData } = this.contextRouteService.getContextData(this.activatedRoute);\n this.position = contextData as PositionManagedObject;\n this.canEdit = await this.permissions.canEdit(\n [Permissions.ROLE_INVENTORY_ADMIN, Permissions.ROLE_INVENTORY_CREATE],\n contextData\n );\n\n const hasCustomSetting = !isUndefined(this.optionsService.mapNominatimUrl);\n this.hideAddressSearchFeature = hasCustomSetting && !this.optionsService.mapNominatimUrl;\n\n if (hasCustomSetting) {\n this.mapNominatimUrl = this.optionsService.mapNominatimUrl;\n }\n\n this.map.refresh();\n }\n\n toggleRealtime() {\n this.config = { ...this.config, realtime: !this.config.realtime };\n }\n\n disableRealtime() {\n this.config = { ...this.config, realtime: false };\n }\n\n centerMap() {\n this.config = {\n ...this.config,\n center: [this.position.c8y_Position.lat, this.position.c8y_Position.lng]\n };\n }\n\n edit() {\n this.originalPosition = cloneDeep(this.position);\n this.enableMarkerDragging();\n this.disableRealtime();\n this.isEdit = true;\n }\n\n cancel() {\n this.position = this.originalPosition;\n this.isEdit = false;\n this.map.markers[0]?.dragging.disable();\n this.centerMap();\n }\n\n async save() {\n try {\n const { data } = await this.inventoryService.update({\n id: this.position.id,\n c8y_Position: this.position.c8y_Position\n });\n this.position = data as PositionManagedObject;\n } catch (ex) {\n this.alertService.addServerFailure(ex);\n }\n this.map.markers[0]?.dragging.disable();\n this.centerMap();\n this.isEdit = false;\n }\n\n positionChanged(position: PositionManagedObject) {\n this.position = position;\n }\n\n async searchAddress(searchTerm: string) {\n const fetchResponse = await fetch(this.mapNominatimUrl.replace('{searchTerm}', searchTerm));\n if (fetchResponse.status !== 200) {\n this.alertService.danger(gettext('Failed to search for address.'));\n return;\n }\n const data: Array<{ lat: string | number; lon: string | number; licence?: string }> =\n await fetchResponse.json();\n const latLng = data[0];\n if (!latLng) {\n this.alertService.warning(gettext('Address could not be found.'));\n return;\n }\n this.position.c8y_Position.lat = Number(latLng.lat);\n this.position.c8y_Position.lng = Number(latLng.lon);\n this.updateMarkerPosition();\n if (latLng.licence) {\n this.map.map.attributionControl.addAttribution(latLng.licence);\n }\n }\n\n updateMarkerPosition() {\n this.map.refreshMarkers();\n this.enableMarkerDragging();\n this.centerMap();\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n }\n\n private enableMarkerDragging() {\n const marker = this.map.markers[0];\n if (marker) {\n marker.dragging.enable();\n marker.on('dragend', () => {\n const latlng = marker.getLatLng();\n this.position.c8y_Position = {\n ...this.position.c8y_Position,\n lat: latlng.lat,\n lng: latlng.lng\n };\n this.centerMap();\n });\n }\n }\n}\n","<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link c8y-realtime\"\n title=\"{{ 'Toggle realtime' | translate }}\"\n type=\"button\"\n (click)=\"toggleRealtime()\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{ active: config.realtime, inactive: !config.realtime }\"\n ></span>\n <span translate>Realtime</span>\n </button>\n</c8y-action-bar-item>\n<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-clean\"\n title=\"{{ 'Center`verb`' | translate }}\"\n (click)=\"centerMap()\"\n >\n <i [c8yIcon]=\"'target1'\"></i>\n <span translate>Center`verb`</span>\n </button>\n</c8y-action-bar-item>\n\n<div class=\"card card--grid content-fullpage d-grid grid__col--8-4--md\">\n <div\n class=\"bg-white p-relative\"\n style=\"min-height: 30vh\"\n >\n <c8y-map\n [assets]=\"[position]\"\n [config]=\"config\"\n (onRealtimeUpdate)=\"positionChanged($event)\"\n ></c8y-map>\n </div>\n\n <form\n class=\"d-flex d-col bg-inherit content-fullpage bg-gray-white\"\n #positionForm=\"ngForm\"\n (ngSubmit)=\"save()\"\n >\n <div class=\"card-header large-padding separator sticky-top\">\n <span\n class=\"card-title\"\n translate\n >\n Device location\n </span>\n </div>\n <div class=\"inner-scroll\">\n <div\n class=\"m-16\"\n *ngIf=\"!isEdit\"\n >\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Latitude (°)\n </div>\n {{ position.c8y_Position.lat }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Longitude (°)\n </div>\n {{ position.c8y_Position.lng }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Altitude (m)\n </div>\n {{ position.c8y_Position.alt }}\n </div>\n </div>\n <div\n class=\"m-16\"\n *ngIf=\"isEdit\"\n >\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Latitude (°)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Latitude (°)' | translate\"\n id=\"lat\"\n name=\"lat\"\n type=\"number\"\n required\n min=\"-90\"\n max=\"90\"\n (blur)=\"positionForm.valid && updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lat\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum latitude value is -90°.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum latitude value is 90°.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Longitude (°)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Longitude (°)' | translate\"\n id=\"lng\"\n name=\"lng\"\n type=\"number\"\n required\n min=\"-180\"\n max=\"180\"\n (blur)=\"positionForm.valid && updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lng\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum longitude value is -180°.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum longitude value is 180°.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"alt\"\n translate\n >\n Altitude (m)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Altitude (m)' | translate\"\n id=\"alt\"\n name=\"alt\"\n type=\"number\"\n [(ngModel)]=\"position.c8y_Position.alt\"\n />\n </c8y-form-group>\n </div>\n\n <form\n class=\"card-block bg-level-1\"\n #addressSearch=\"ngForm\"\n novalidate\n (submit)=\"searchAddress(addressSearchTerm)\"\n *ngIf=\"isEdit && !hideAddressSearchFeature\"\n >\n <div class=\"form-group\">\n <label\n for=\"searchAddress\"\n translate\n >\n Find lat/long by address\n </label>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n id=\"searchAddress\"\n name=\"addressSearchTerm\"\n type=\"text\"\n [placeholder]=\"'e.g. Speditionstraße 13, Düsseldorf`LOCALIZE`' | translate\"\n [(ngModel)]=\"addressSearchTerm\"\n />\n <span class=\"input-group-btn\">\n <button\n class=\"btn btn-dot\"\n [title]=\"'Search' | translate\"\n type=\"submit\"\n >\n <i\n class=\"dlt-c8y-icon-search\"\n c8y-icon=\"search\"\n ></i>\n </button>\n </span>\n </div>\n </div>\n </form>\n </div>\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Edit location' | translate\"\n type=\"button\"\n *ngIf=\"canEdit && !isEdit\"\n (click)=\"edit()\"\n translate\n >\n Edit location\n </button>\n <button\n class=\"btn btn-default\"\n [title]=\"'Cancel' | translate\"\n type=\"button\"\n (click)=\"cancel()\"\n *ngIf=\"isEdit\"\n translate\n >\n Cancel\n </button>\n <button\n class=\"btn btn-primary\"\n [title]=\"'Save' | translate\"\n type=\"submit\"\n *ngIf=\"isEdit\"\n translate\n [disabled]=\"!positionForm.valid\"\n >\n Save\n </button>\n </div>\n </form>\n</div>\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CoreModule, hookActionBar, hookRoute, hookTab, ViewContext } from '@c8y/ngx-components';\nimport { MapModule } from '@c8y/ngx-components/map';\nimport { AddLocationComponent } from './add-location.component';\nimport { AddLocationFactory } from './add-location.factory';\nimport { LocationTabFactory } from './location-tab.factory';\nimport { LocationComponent } from './location.component';\nimport { LocationConfiguration } from './location.model';\n\n@NgModule({\n imports: [MapModule, CoreModule, RouterModule, LocationComponent],\n exports: [LocationComponent],\n providers: [\n hookRoute({\n path: 'location',\n component: LocationComponent,\n context: ViewContext.Device,\n tabs: []\n }),\n hookRoute({\n path: 'location',\n component: LocationComponent,\n context: ViewContext.Group,\n tabs: []\n })\n ]\n})\nexport class LocationRouteModule {}\n\n@NgModule({\n imports: [LocationRouteModule],\n providers: [hookTab(LocationTabFactory)]\n})\nexport class LocationTabModule {}\n\n/**\n * @deprecated has been splitted into `LocationTabModule` and `AddLocationModule`.\n */\n@NgModule({\n imports: [LocationTabModule]\n})\nexport class LocationModule {\n /**\n *\n * @deprecated use the `LocationTabModule` and optionally `AddLocationModule` instead.\n */\n static config(\n config: LocationConfiguration = { addLocation: false }\n ): ModuleWithProviders<LocationModule> {\n return {\n ngModule: LocationModule,\n providers: config.addLocation ? [hookActionBar(AddLocationFactory)] : []\n };\n }\n}\n\n@NgModule({\n imports: [CoreModule, LocationRouteModule, AddLocationComponent],\n exports: [AddLocationComponent],\n providers: [hookActionBar(AddLocationFactory)]\n})\nexport class AddLocationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2","i1","i3","i4"],"mappings":";;;;;;;;;;;;;;;;;MA4Ba,oBAAoB,CAAA;IAG/B,WAAA,CACU,gBAAkC,EAClC,mBAAwC,EAGxC,cAA4C,EAC5C,MAAc,EACd,YAA0B,EAC1B,KAAuB,EAAA;QAPvB,IAAA,CAAA,gBAAgB,GAAhB,gBAAgB;QAChB,IAAA,CAAA,mBAAmB,GAAnB,mBAAmB;QAGnB,IAAA,CA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E,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAC/B,oBAAA,SAAS,EAAE,CAAC,aAAa,CAAC,kBAAkB,CAAC;AAC9C,iBAAA;;;AC7DD;;AAEG;;;;"}
|
|
@@ -161,7 +161,7 @@ class OperationModalComponent {
|
|
|
161
161
|
this._cancel();
|
|
162
162
|
}
|
|
163
163
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: OperationModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
164
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: OperationModalComponent, isStandalone: true, selector: "c8y-operation-render-type-modal", providers: [DeviceShellService], ngImport: i0, template: "<c8y-modal\n [title]=\"modalTitle\"\n (onClose)=\"onClose($event)\"\n (onDismiss)=\"onDismiss($event)\"\n [labels]=\"labels\"\n [disabled]=\"form?.invalid\"\n [headerClasses]=\"'dialog-header'\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'cog'\"></span>\n </ng-container>\n <form\n class=\"p-24\"\n [formGroup]=\"form\"\n >\n <c8y-form-group>\n <label\n for=\"buttonLabel\"\n translate\n >\n Button label\n </label>\n <input\n class=\"form-control\"\n id=\"buttonLabel\"\n placeholder=\"{{ 'e.g. Execute operation' | translate }}\"\n type=\"text\"\n formControlName=\"buttonLabel\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n @if (!showButtonLabelOnly) {\n <div class=\"form-group\">\n <label\n for=\"operation\"\n translate\n >\n Operation\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control\"\n id=\"operation\"\n formControlName=\"operation\"\n >\n <optgroup label=\"{{ 'Predefined' | translate }}\">\n @for (op of predefinedOperations; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n @let pluginTemplates = pluginTemplates$ | async;\n @if (pluginTemplates?.length) {\n <optgroup label=\"{{ 'Plugin templates' | translate }}\">\n @for (op of pluginTemplates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n @if (templates.length) {\n <optgroup label=\"{{ 'Device templates' | translate }}\">\n @for (op of templates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n </select>\n </div>\n </div>\n <div class=\"form-group\">\n <label\n for=\"command\"\n translate\n >\n Command\n </label>\n <textarea\n class=\"form-control no-resize inner-scroll\"\n style=\"max-height: 300px\"\n id=\"command\"\n c8y-textarea-autoresize\n formControlName=\"command\"\n maxlength=\"900\"\n ></textarea>\n </div>\n }\n </form>\n</c8y-modal>\n", dependencies: [{ kind: "ngmodule", type: ModalModule }, { kind: "component", type: i1.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: C8yTranslateModule }, { kind: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i1.TextareaAutoresizeDirective, selector: "[c8y-textarea-autoresize]" }, { kind: "ngmodule", type: CoreModule }, { kind: "component", type: i1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i1.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: i1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] }); }
|
|
164
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: OperationModalComponent, isStandalone: true, selector: "c8y-operation-render-type-modal", providers: [DeviceShellService], ngImport: i0, template: "<c8y-modal\n [title]=\"modalTitle\"\n (onClose)=\"onClose($event)\"\n (onDismiss)=\"onDismiss($event)\"\n [labels]=\"labels\"\n [disabled]=\"form?.invalid\"\n [headerClasses]=\"'dialog-header'\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'cog'\"></span>\n </ng-container>\n <form\n class=\"p-24\"\n [formGroup]=\"form\"\n >\n <c8y-form-group>\n <label\n for=\"buttonLabel\"\n translate\n >\n Button label\n </label>\n <input\n class=\"form-control\"\n id=\"buttonLabel\"\n placeholder=\"{{ 'e.g. Execute operation' | translate }}\"\n type=\"text\"\n formControlName=\"buttonLabel\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n @if (!showButtonLabelOnly) {\n <div class=\"form-group\">\n <label\n for=\"operation\"\n translate\n >\n Operation\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control\"\n id=\"operation\"\n formControlName=\"operation\"\n >\n <optgroup label=\"{{ 'Predefined' | translate }}\">\n @for (op of predefinedOperations; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n @let pluginTemplates = pluginTemplates$ | async;\n @if (pluginTemplates?.length) {\n <optgroup label=\"{{ 'Plugin templates' | translate }}\">\n @for (op of pluginTemplates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n @if (templates.length) {\n <optgroup label=\"{{ 'Device templates' | translate }}\">\n @for (op of templates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n </select>\n </div>\n </div>\n <div class=\"form-group\">\n <label\n for=\"command\"\n translate\n >\n Command\n </label>\n <textarea\n class=\"form-control no-resize inner-scroll\"\n style=\"max-height: 300px\"\n id=\"command\"\n c8y-textarea-autoresize\n formControlName=\"command\"\n maxlength=\"900\"\n ></textarea>\n </div>\n }\n </form>\n</c8y-modal>\n", dependencies: [{ kind: "ngmodule", type: ModalModule }, { kind: "component", type: i1.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: C8yTranslateModule }, { kind: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i1.TextareaAutoresizeDirective, selector: "[c8y-textarea-autoresize]" }, { kind: "ngmodule", type: CoreModule }, { kind: "component", type: i1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i1.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage", "additionalMessages"] }, { kind: "directive", type: i1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] }); }
|
|
165
165
|
}
|
|
166
166
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: OperationModalComponent, decorators: [{
|
|
167
167
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-operation-picker.mjs","sources":["../../operation-picker/operation-template.hook.ts","../../operation-picker/operation-template.service.ts","../../operation-picker/modal/operation-modal.component.ts","../../operation-picker/modal/operation-modal.component.html","../../operation-picker/operation-picker.service.ts","../../operation-picker/c8y-ngx-components-operation-picker.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { GenericHookOptions, GenericHookType, hookGeneric } from '@c8y/ngx-components';\n\n/**\n * Represents a predefined operation template that can be registered\n * and selected in the operation render type modal.\n */\nexport interface OperationTemplate {\n /** Display name shown in the dropdown. */\n name: string;\n /** The operation command object that will be serialized as JSON into the command field.\n * The command object must contain a `description` property, which will be used as the description of the operation in the UI.\n * The rest of the properties can be defined based on the requirements of the specific operation.\n * For example, a restart operation might look like this:\n * ```\n * {\n * description: 'Restart device',\n * c8y_Restart: {}\n * }\n * ```\n * Or a more complex command with parameters:\n * ```\n * {\n * description: 'Set relay status to OPEN',\n * c8y_Relay: {\n * relayState: 'OPEN'\n * }\n * }\n * ```\n */\n command: Record<string, unknown>;\n}\n\n/**\n * Injection token for registering additional operation templates.\n *\n * Use the `hookOperationTemplate` helper to register templates from a plugin:\n *\n * ```typescript\n * // Provide a single template\n * hookOperationTemplate({ name: 'Restart device', command: { c8y_Restart: {} } })\n *\n * // Provide multiple templates\n * hookOperationTemplate([\n * { name: 'Restart device', command: { c8y_Restart: {} } },\n * { name: 'Set relay OPEN', command: { c8y_Relay: { relayState: 'OPEN' } } }\n * ])\n * ```\n */\nexport const HOOK_OPERATION_TEMPLATE = new InjectionToken<OperationTemplate[]>(\n 'HOOK_OPERATION_TEMPLATE'\n);\n\n/**\n * Registers one or more operation templates to be shown in the operation modal selector.\n *\n * @example\n * ```typescript\n * \\@NgModule({\n * providers: [\n * hookOperationTemplate({ name: 'Restart device', command: { c8y_Restart: {} } })\n * ]\n * })\n * export class MyPlugin {}\n * ```\n */\nexport function hookOperationTemplate(\n template: GenericHookType<OperationTemplate>,\n options?: Partial<GenericHookOptions>\n) {\n return hookGeneric<OperationTemplate>(template, HOOK_OPERATION_TEMPLATE, options);\n}\n","import { Injectable, Injector } from '@angular/core';\nimport {\n ExtensionPointForPlugins,\n fromTriggerOnce,\n getInjectedHooks,\n PluginsResolveService\n} from '@c8y/ngx-components';\nimport { distinctUntilChanged, Observable, shareReplay } from 'rxjs';\nimport { HOOK_OPERATION_TEMPLATE, OperationTemplate } from './operation-template.hook';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class OperationTemplateService extends ExtensionPointForPlugins<OperationTemplate> {\n items$: Observable<OperationTemplate[]>;\n\n constructor(rootInjector: Injector, pluginService: PluginsResolveService) {\n super(rootInjector, pluginService);\n this.items$ = this.setupItemsObservable();\n }\n\n get state() {\n return this.state$.value;\n }\n\n protected setupItemsObservable(): Observable<OperationTemplate[]> {\n return fromTriggerOnce<OperationTemplate>(undefined, this.refresh$, [\n getInjectedHooks<OperationTemplate>(HOOK_OPERATION_TEMPLATE, this.injectors),\n () => this.factories\n ]).pipe(distinctUntilChanged(), shareReplay(1));\n }\n}\n","import { Component, DestroyRef, inject, OnInit } from '@angular/core';\nimport {\n FormBuilder,\n FormControl,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\nimport {\n CommonModule,\n CoreModule,\n ModalModule,\n ModalLabels,\n C8yTranslateModule\n} from '@c8y/ngx-components';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { TranslateService } from '@ngx-translate/core';\nimport { DeviceShellService, DeviceShellTemplate } from '@c8y/ngx-components/device-shell';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Observable, startWith, withLatestFrom } from 'rxjs';\nimport { OperationTemplate } from '../operation-template.hook';\nimport { OperationTemplateService } from '../operation-template.service';\nimport { OperationModalInitialConfig } from '../operation-picker.model';\n\ninterface OperationRenderForm {\n buttonLabel: FormControl<string>;\n operation: FormControl<string | null>;\n command: FormControl<string>;\n}\n\ninterface OperationRenderFormValue {\n buttonLabel: string;\n operation: string | null;\n command: string;\n}\n\ninterface PredefinedOperation {\n name: string;\n command: Record<string, unknown>;\n}\n\n@Component({\n selector: 'c8y-operation-render-type-modal',\n templateUrl: './operation-modal.component.html',\n standalone: true,\n imports: [\n ModalModule,\n FormsModule,\n ReactiveFormsModule,\n C8yTranslateModule,\n CommonModule,\n CoreModule\n ],\n providers: [DeviceShellService]\n})\nexport class OperationModalComponent implements OnInit {\n showButtonLabelOnly = false;\n initialConfig: OperationModalInitialConfig = {};\n deviceTypes: string[] = [];\n templates: DeviceShellTemplate[] = [];\n pluginTemplates$!: Observable<OperationTemplate[]>;\n predefinedOperations: PredefinedOperation[] = [\n {\n name: gettext('Restart device'),\n command: { description: gettext('Restart device'), c8y_Restart: {} }\n },\n {\n name: gettext('Change relay status to OPEN'),\n command: {\n description: gettext('Change relay status to OPEN.'),\n c8y_Relay: { relayState: 'OPEN' }\n }\n },\n {\n name: gettext('Change relay status to CLOSED'),\n command: {\n description: gettext('Change relay status to CLOSED.'),\n c8y_Relay: { relayState: 'CLOSED' }\n }\n }\n ];\n\n labels: ModalLabels = { ok: gettext('Save'), cancel: gettext('Cancel') };\n form!: FormGroup<OperationRenderForm>;\n\n result: Promise<OperationRenderFormValue> = new Promise((resolve, reject) => {\n this._save = resolve;\n this._cancel = reject;\n });\n\n get modalTitle(): string {\n if (this.showButtonLabelOnly) {\n return this.translate.instant(gettext('Maintenance mode'));\n }\n const buttonLabel = this.form?.get('buttonLabel')?.value;\n return buttonLabel\n ? this.translate.instant(gettext('Edit operation'))\n : this.translate.instant(gettext('Create operation'));\n }\n\n private _save!: (value: OperationRenderFormValue) => void;\n private _cancel!: () => void;\n\n private readonly fb = inject(FormBuilder);\n private readonly translate = inject(TranslateService);\n private readonly deviceShellService = inject(DeviceShellService);\n private readonly operationTemplateService = inject(OperationTemplateService);\n private readonly destroyRef = inject(DestroyRef);\n\n async ngOnInit(): Promise<void> {\n const defaultCommand = JSON.stringify(\n { description: 'Command description', c8y_Command: { text: '<command>' } },\n null,\n 2\n );\n\n this.form = this.fb.group<OperationRenderForm>({\n buttonLabel: new FormControl(this.initialConfig?.buttonLabel ?? '', {\n validators: [Validators.required]\n }),\n operation: new FormControl<string | null>(this.initialConfig?.operationType ?? null),\n command: new FormControl(this.initialConfig?.command ?? defaultCommand, {\n validators: [Validators.required]\n })\n });\n\n if (this.deviceTypes?.length) {\n const loadedTemplates = await this.deviceShellService.getCommandTemplatesForDeviceType(\n this.deviceTypes\n );\n this.templates = loadedTemplates.map(t => ({\n name: t.name,\n text: t.text,\n category: t.category\n }));\n }\n\n this.pluginTemplates$ = this.operationTemplateService.items$;\n\n this.form\n .get('operation')\n ?.valueChanges.pipe(\n withLatestFrom(this.pluginTemplates$.pipe(startWith([] as OperationTemplate[]))),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe(([selectedName, pluginTemplates]) => {\n const predefined = [...this.predefinedOperations, ...pluginTemplates].find(\n p => p.name === selectedName\n );\n if (predefined) {\n this.form.get('command')?.setValue(JSON.stringify(predefined.command, null, 2));\n return;\n }\n\n const template = this.templates.find(t => t.name === selectedName);\n if (template) {\n const cmd = JSON.stringify(\n { description: template.name, c8y_Command: { text: template.text } },\n null,\n 2\n );\n this.form.get('command')?.setValue(cmd);\n }\n });\n }\n\n onClose(_: unknown) {\n if (this.form.valid) {\n this._save(this.form.getRawValue());\n }\n }\n\n onDismiss(_: unknown) {\n this._cancel();\n }\n}\n","<c8y-modal\n [title]=\"modalTitle\"\n (onClose)=\"onClose($event)\"\n (onDismiss)=\"onDismiss($event)\"\n [labels]=\"labels\"\n [disabled]=\"form?.invalid\"\n [headerClasses]=\"'dialog-header'\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'cog'\"></span>\n </ng-container>\n <form\n class=\"p-24\"\n [formGroup]=\"form\"\n >\n <c8y-form-group>\n <label\n for=\"buttonLabel\"\n translate\n >\n Button label\n </label>\n <input\n class=\"form-control\"\n id=\"buttonLabel\"\n placeholder=\"{{ 'e.g. Execute operation' | translate }}\"\n type=\"text\"\n formControlName=\"buttonLabel\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n @if (!showButtonLabelOnly) {\n <div class=\"form-group\">\n <label\n for=\"operation\"\n translate\n >\n Operation\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control\"\n id=\"operation\"\n formControlName=\"operation\"\n >\n <optgroup label=\"{{ 'Predefined' | translate }}\">\n @for (op of predefinedOperations; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n @let pluginTemplates = pluginTemplates$ | async;\n @if (pluginTemplates?.length) {\n <optgroup label=\"{{ 'Plugin templates' | translate }}\">\n @for (op of pluginTemplates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n @if (templates.length) {\n <optgroup label=\"{{ 'Device templates' | translate }}\">\n @for (op of templates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n </select>\n </div>\n </div>\n <div class=\"form-group\">\n <label\n for=\"command\"\n translate\n >\n Command\n </label>\n <textarea\n class=\"form-control no-resize inner-scroll\"\n style=\"max-height: 300px\"\n id=\"command\"\n c8y-textarea-autoresize\n formControlName=\"command\"\n maxlength=\"900\"\n ></textarea>\n </div>\n }\n </form>\n</c8y-modal>\n","import { inject, Injectable } from '@angular/core';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { OperationModalInitialConfig, OperationModalResult } from './operation-picker.model';\nimport { OperationModalComponent } from './modal/operation-modal.component';\n\n@Injectable({ providedIn: 'root' })\nexport class OperationPickerService {\n private readonly modalService = inject(BsModalService);\n\n /**\n *\n * @param options Modal configuration options\n * `showButtonLabelOnly` - if `true`, only button label will be shown in the modal, otherwise user will be able to select both operation and command. This is useful when you want to allow users to select only predefined operations (e.g. restart, shutdown) without showing them the underlying operation types and commands.\n * `deviceTypes` - list of device types to filter available operations. Only operations applicable to the provided device types will be shown in the modal.\n * `initialConfig` - initial configuration for the modal form. This is useful when you want to edit existing configuration, so you can prefill the form with existing values.\n * @returns\n */\n async openModal(options: {\n showButtonLabelOnly: boolean;\n deviceTypes: string[];\n initialConfig?: Partial<OperationModalInitialConfig>;\n }): Promise<OperationModalResult> {\n const modal = this.modalService.show(OperationModalComponent, {\n class: 'modal-sm',\n ariaDescribedby: 'modal-body',\n ariaLabelledBy: 'modal-title',\n ignoreBackdropClick: true,\n initialState: {\n initialConfig: options.initialConfig ?? {},\n showButtonLabelOnly: options.showButtonLabelOnly,\n deviceTypes: options.deviceTypes\n }\n }).content;\n\n return modal.result;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAiCA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,uBAAuB,GAAG,IAAI,cAAc,CACvD,yBAAyB,CAC1B;AAED;;;;;;;;;;;;AAYG;AACG,SAAU,qBAAqB,CACnC,QAA4C,EAC5C,OAAqC,EAAA;IAErC,OAAO,WAAW,CAAoB,QAAQ,EAAE,uBAAuB,EAAE,OAAO,CAAC;AACnF;;AC1DM,MAAO,wBAAyB,SAAQ,wBAA2C,CAAA;IAGvF,WAAA,CAAY,YAAsB,EAAE,aAAoC,EAAA;AACtE,QAAA,KAAK,CAAC,YAAY,EAAE,aAAa,CAAC;AAClC,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,oBAAoB,EAAE;IAC3C;AAEA,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;IAC1B;IAEU,oBAAoB,GAAA;AAC5B,QAAA,OAAO,eAAe,CAAoB,SAAS,EAAE,IAAI,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,CAAC,cAAc,CAAC;AA6BvD,IAAA;AA3BC;;;;;;;AAOG;IACH,MAAM,SAAS,CAAC,OAIf,EAAA;QACC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,uBAAuB,EAAE;AAC5D,YAAA,KAAK,EAAE,UAAU;AACjB,YAAA,eAAe,EAAE,YAAY;AAC7B,YAAA,cAAc,EAAE,aAAa;AAC7B,YAAA,mBAAmB,EAAE,IAAI;AACzB,YAAA,YAAY,EAAE;AACZ,gBAAA,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,EAAE;gBAC1C,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;gBAChD,WAAW,EAAE,OAAO,CAAC;AACtB;SACF,CAAC,CAAC,OAAO;QAEV,OAAO,KAAK,CAAC,MAAM;IACrB;+GA7BW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cADT,MAAM,EAAA,CAAA,CAAA;;4FACnB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACLlC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-operation-picker.mjs","sources":["../../operation-picker/operation-template.hook.ts","../../operation-picker/operation-template.service.ts","../../operation-picker/modal/operation-modal.component.ts","../../operation-picker/modal/operation-modal.component.html","../../operation-picker/operation-picker.service.ts","../../operation-picker/c8y-ngx-components-operation-picker.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { GenericHookOptions, GenericHookType, hookGeneric } from '@c8y/ngx-components';\n\n/**\n * Represents a predefined operation template that can be registered\n * and selected in the operation render type modal.\n */\nexport interface OperationTemplate {\n /** Display name shown in the dropdown. */\n name: string;\n /** The operation command object that will be serialized as JSON into the command field.\n * The command object must contain a `description` property, which will be used as the description of the operation in the UI.\n * The rest of the properties can be defined based on the requirements of the specific operation.\n * For example, a restart operation might look like this:\n * ```\n * {\n * description: 'Restart device',\n * c8y_Restart: {}\n * }\n * ```\n * Or a more complex command with parameters:\n * ```\n * {\n * description: 'Set relay status to OPEN',\n * c8y_Relay: {\n * relayState: 'OPEN'\n * }\n * }\n * ```\n */\n command: Record<string, unknown>;\n}\n\n/**\n * Injection token for registering additional operation templates.\n *\n * Use the `hookOperationTemplate` helper to register templates from a plugin:\n *\n * ```typescript\n * // Provide a single template\n * hookOperationTemplate({ name: 'Restart device', command: { c8y_Restart: {} } })\n *\n * // Provide multiple templates\n * hookOperationTemplate([\n * { name: 'Restart device', command: { c8y_Restart: {} } },\n * { name: 'Set relay OPEN', command: { c8y_Relay: { relayState: 'OPEN' } } }\n * ])\n * ```\n */\nexport const HOOK_OPERATION_TEMPLATE = new InjectionToken<OperationTemplate[]>(\n 'HOOK_OPERATION_TEMPLATE'\n);\n\n/**\n * Registers one or more operation templates to be shown in the operation modal selector.\n *\n * @example\n * ```typescript\n * \\@NgModule({\n * providers: [\n * hookOperationTemplate({ name: 'Restart device', command: { c8y_Restart: {} } })\n * ]\n * })\n * export class MyPlugin {}\n * ```\n */\nexport function hookOperationTemplate(\n template: GenericHookType<OperationTemplate>,\n options?: Partial<GenericHookOptions>\n) {\n return hookGeneric<OperationTemplate>(template, HOOK_OPERATION_TEMPLATE, options);\n}\n","import { Injectable, Injector } from '@angular/core';\nimport {\n ExtensionPointForPlugins,\n fromTriggerOnce,\n getInjectedHooks,\n PluginsResolveService\n} from '@c8y/ngx-components';\nimport { distinctUntilChanged, Observable, shareReplay } from 'rxjs';\nimport { HOOK_OPERATION_TEMPLATE, OperationTemplate } from './operation-template.hook';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class OperationTemplateService extends ExtensionPointForPlugins<OperationTemplate> {\n items$: Observable<OperationTemplate[]>;\n\n constructor(rootInjector: Injector, pluginService: PluginsResolveService) {\n super(rootInjector, pluginService);\n this.items$ = this.setupItemsObservable();\n }\n\n get state() {\n return this.state$.value;\n }\n\n protected setupItemsObservable(): Observable<OperationTemplate[]> {\n return fromTriggerOnce<OperationTemplate>(undefined, this.refresh$, [\n getInjectedHooks<OperationTemplate>(HOOK_OPERATION_TEMPLATE, this.injectors),\n () => this.factories\n ]).pipe(distinctUntilChanged(), shareReplay(1));\n }\n}\n","import { Component, DestroyRef, inject, OnInit } from '@angular/core';\nimport {\n FormBuilder,\n FormControl,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\nimport {\n CommonModule,\n CoreModule,\n ModalModule,\n ModalLabels,\n C8yTranslateModule\n} from '@c8y/ngx-components';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { TranslateService } from '@ngx-translate/core';\nimport { DeviceShellService, DeviceShellTemplate } from '@c8y/ngx-components/device-shell';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Observable, startWith, withLatestFrom } from 'rxjs';\nimport { OperationTemplate } from '../operation-template.hook';\nimport { OperationTemplateService } from '../operation-template.service';\nimport { OperationModalInitialConfig } from '../operation-picker.model';\n\ninterface OperationRenderForm {\n buttonLabel: FormControl<string>;\n operation: FormControl<string | null>;\n command: FormControl<string>;\n}\n\ninterface OperationRenderFormValue {\n buttonLabel: string;\n operation: string | null;\n command: string;\n}\n\ninterface PredefinedOperation {\n name: string;\n command: Record<string, unknown>;\n}\n\n@Component({\n selector: 'c8y-operation-render-type-modal',\n templateUrl: './operation-modal.component.html',\n standalone: true,\n imports: [\n ModalModule,\n FormsModule,\n ReactiveFormsModule,\n C8yTranslateModule,\n CommonModule,\n CoreModule\n ],\n providers: [DeviceShellService]\n})\nexport class OperationModalComponent implements OnInit {\n showButtonLabelOnly = false;\n initialConfig: OperationModalInitialConfig = {};\n deviceTypes: string[] = [];\n templates: DeviceShellTemplate[] = [];\n pluginTemplates$!: Observable<OperationTemplate[]>;\n predefinedOperations: PredefinedOperation[] = [\n {\n name: gettext('Restart device'),\n command: { description: gettext('Restart device'), c8y_Restart: {} }\n },\n {\n name: gettext('Change relay status to OPEN'),\n command: {\n description: gettext('Change relay status to OPEN.'),\n c8y_Relay: { relayState: 'OPEN' }\n }\n },\n {\n name: gettext('Change relay status to CLOSED'),\n command: {\n description: gettext('Change relay status to CLOSED.'),\n c8y_Relay: { relayState: 'CLOSED' }\n }\n }\n ];\n\n labels: ModalLabels = { ok: gettext('Save'), cancel: gettext('Cancel') };\n form!: FormGroup<OperationRenderForm>;\n\n result: Promise<OperationRenderFormValue> = new Promise((resolve, reject) => {\n this._save = resolve;\n this._cancel = reject;\n });\n\n get modalTitle(): string {\n if (this.showButtonLabelOnly) {\n return this.translate.instant(gettext('Maintenance mode'));\n }\n const buttonLabel = this.form?.get('buttonLabel')?.value;\n return buttonLabel\n ? this.translate.instant(gettext('Edit operation'))\n : this.translate.instant(gettext('Create operation'));\n }\n\n private _save!: (value: OperationRenderFormValue) => void;\n private _cancel!: () => void;\n\n private readonly fb = inject(FormBuilder);\n private readonly translate = inject(TranslateService);\n private readonly deviceShellService = inject(DeviceShellService);\n private readonly operationTemplateService = inject(OperationTemplateService);\n private readonly destroyRef = inject(DestroyRef);\n\n async ngOnInit(): Promise<void> {\n const defaultCommand = JSON.stringify(\n { description: 'Command description', c8y_Command: { text: '<command>' } },\n null,\n 2\n );\n\n this.form = this.fb.group<OperationRenderForm>({\n buttonLabel: new FormControl(this.initialConfig?.buttonLabel ?? '', {\n validators: [Validators.required]\n }),\n operation: new FormControl<string | null>(this.initialConfig?.operationType ?? null),\n command: new FormControl(this.initialConfig?.command ?? defaultCommand, {\n validators: [Validators.required]\n })\n });\n\n if (this.deviceTypes?.length) {\n const loadedTemplates = await this.deviceShellService.getCommandTemplatesForDeviceType(\n this.deviceTypes\n );\n this.templates = loadedTemplates.map(t => ({\n name: t.name,\n text: t.text,\n category: t.category\n }));\n }\n\n this.pluginTemplates$ = this.operationTemplateService.items$;\n\n this.form\n .get('operation')\n ?.valueChanges.pipe(\n withLatestFrom(this.pluginTemplates$.pipe(startWith([] as OperationTemplate[]))),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe(([selectedName, pluginTemplates]) => {\n const predefined = [...this.predefinedOperations, ...pluginTemplates].find(\n p => p.name === selectedName\n );\n if (predefined) {\n this.form.get('command')?.setValue(JSON.stringify(predefined.command, null, 2));\n return;\n }\n\n const template = this.templates.find(t => t.name === selectedName);\n if (template) {\n const cmd = JSON.stringify(\n { description: template.name, c8y_Command: { text: template.text } },\n null,\n 2\n );\n this.form.get('command')?.setValue(cmd);\n }\n });\n }\n\n onClose(_: unknown) {\n if (this.form.valid) {\n this._save(this.form.getRawValue());\n }\n }\n\n onDismiss(_: unknown) {\n this._cancel();\n }\n}\n","<c8y-modal\n [title]=\"modalTitle\"\n (onClose)=\"onClose($event)\"\n (onDismiss)=\"onDismiss($event)\"\n [labels]=\"labels\"\n [disabled]=\"form?.invalid\"\n [headerClasses]=\"'dialog-header'\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'cog'\"></span>\n </ng-container>\n <form\n class=\"p-24\"\n [formGroup]=\"form\"\n >\n <c8y-form-group>\n <label\n for=\"buttonLabel\"\n translate\n >\n Button label\n </label>\n <input\n class=\"form-control\"\n id=\"buttonLabel\"\n placeholder=\"{{ 'e.g. Execute operation' | translate }}\"\n type=\"text\"\n formControlName=\"buttonLabel\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n @if (!showButtonLabelOnly) {\n <div class=\"form-group\">\n <label\n for=\"operation\"\n translate\n >\n Operation\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control\"\n id=\"operation\"\n formControlName=\"operation\"\n >\n <optgroup label=\"{{ 'Predefined' | translate }}\">\n @for (op of predefinedOperations; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n @let pluginTemplates = pluginTemplates$ | async;\n @if (pluginTemplates?.length) {\n <optgroup label=\"{{ 'Plugin templates' | translate }}\">\n @for (op of pluginTemplates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n @if (templates.length) {\n <optgroup label=\"{{ 'Device templates' | translate }}\">\n @for (op of templates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n </select>\n </div>\n </div>\n <div class=\"form-group\">\n <label\n for=\"command\"\n translate\n >\n Command\n </label>\n <textarea\n class=\"form-control no-resize inner-scroll\"\n style=\"max-height: 300px\"\n id=\"command\"\n c8y-textarea-autoresize\n formControlName=\"command\"\n maxlength=\"900\"\n ></textarea>\n </div>\n }\n </form>\n</c8y-modal>\n","import { inject, Injectable } from '@angular/core';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { OperationModalInitialConfig, OperationModalResult } from './operation-picker.model';\nimport { OperationModalComponent } from './modal/operation-modal.component';\n\n@Injectable({ providedIn: 'root' })\nexport class OperationPickerService {\n private readonly modalService = inject(BsModalService);\n\n /**\n *\n * @param options Modal configuration options\n * `showButtonLabelOnly` - if `true`, only button label will be shown in the modal, otherwise user will be able to select both operation and command. This is useful when you want to allow users to select only predefined operations (e.g. restart, shutdown) without showing them the underlying operation types and commands.\n * `deviceTypes` - list of device types to filter available operations. Only operations applicable to the provided device types will be shown in the modal.\n * `initialConfig` - initial configuration for the modal form. This is useful when you want to edit existing configuration, so you can prefill the form with existing values.\n * @returns\n */\n async openModal(options: {\n showButtonLabelOnly: boolean;\n deviceTypes: string[];\n initialConfig?: Partial<OperationModalInitialConfig>;\n }): Promise<OperationModalResult> {\n const modal = this.modalService.show(OperationModalComponent, {\n class: 'modal-sm',\n ariaDescribedby: 'modal-body',\n ariaLabelledBy: 'modal-title',\n ignoreBackdropClick: true,\n initialState: {\n initialConfig: options.initialConfig ?? {},\n showButtonLabelOnly: options.showButtonLabelOnly,\n deviceTypes: options.deviceTypes\n }\n }).content;\n\n return modal.result;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAiCA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,uBAAuB,GAAG,IAAI,cAAc,CACvD,yBAAyB,CAC1B;AAED;;;;;;;;;;;;AAYG;AACG,SAAU,qBAAqB,CACnC,QAA4C,EAC5C,OAAqC,EAAA;IAErC,OAAO,WAAW,CAAoB,QAAQ,EAAE,uBAAuB,EAAE,OAAO,CAAC;AACnF;;AC1DM,MAAO,wBAAyB,SAAQ,wBAA2C,CAAA;IAGvF,WAAA,CAAY,YAAsB,EAAE,aAAoC,EAAA;AACtE,QAAA,KAAK,CAAC,YAAY,EAAE,aAAa,CAAC;AAClC,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,oBAAoB,EAAE;IAC3C;AAEA,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;IAC1B;IAEU,oBAAoB,GAAA;AAC5B,QAAA,OAAO,eAAe,CAAoB,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE;AAClE,YAAA,gBAAgB,CAAoB,uBAAuB,EAAE,IAAI,CAAC,SAAS,CAAC;AAC5E,YAAA,MAAM,IAAI,CAAC;SACZ,CAAC,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACjD;+GAjBW,wBAAwB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,QAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,qBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,KAAA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OAAO,CAAC;AACtB;SACF,CAAC,CAAC,OAAO;QAEV,OAAO,KAAK,CAAC,MAAM;IACrB;+GA7BW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cADT,MAAM,EAAA,CAAA,CAAA;;4FACnB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACLlC;;AAEG;;;;"}
|
|
@@ -220,7 +220,7 @@ class OperationSchedulerComponent {
|
|
|
220
220
|
multi: true,
|
|
221
221
|
useExisting: forwardRef(() => OperationSchedulerComponent)
|
|
222
222
|
}
|
|
223
|
-
], ngImport: i0, template: "<div [formGroup]=\"fgOperationScheduler\">\n <div class=\"form-group\">\n <label translate>Start date</label>\n <div class=\"datetime-picker\">\n <c8y-form-group class=\"datepicker\">\n <input\n class=\"form-control\"\n placeholder=\"{{ placeholder | translate }}\"\n required\n formControlName=\"picker\"\n [bsConfig]=\"{ customTodayClass: 'today', dateInputFormat: dateInputFormat }\"\n [minDate]=\"minDate\"\n bsDatepicker\n (blur)=\"markAsTouched()\"\n />\n <c8y-messages>\n <c8y-message\n [name]=\"'dateValidation'\"\n [text]=\"'Select time in the future.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <timepicker\n class=\"form-group\"\n [showSpinners]=\"false\"\n [showMeridian]=\"false\"\n formControlName=\"time\"\n (blur)=\"markAsTouched()\"\n ></timepicker>\n </div>\n </div>\n <div class=\"form-group\">\n <c8y-form-group [hasError]=\"delayErrors\">\n <label translate>Delay</label>\n <div class=\"input-group\">\n <input\n class=\"form-control\"\n placeholder=\"{{ 'e.g.' | translate }} 15\"\n type=\"number\"\n required\n formControlName=\"delay\"\n (blur)=\"markAsTouched()\"\n />\n <div class=\"input-group-btn\">\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control m-r-sm-32 m-r-xs-56\"\n [attr.aria-label]=\"'Delay units' | translate\"\n formControlName=\"unit\"\n (blur)=\"markAsTouched()\"\n >\n <option\n value=\"seconds\"\n translate\n >\n Seconds\n </option>\n <option\n value=\"milliseconds\"\n translate\n >\n Milliseconds\n </option>\n </select>\n <span></span>\n </div>\n </div>\n </div>\n </c8y-form-group>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "directive", type: RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: BsDatepickerInputDirective, selector: "input[bsDatepicker]" }, { kind: "directive", type: BsDatepickerDirective, selector: "[bsDatepicker]", inputs: ["placement", "triggers", "outsideClick", "container", "outsideEsc", "isDisabled", "minDate", "maxDate", "ignoreMinMaxErrors", "minMode", "daysDisabled", "datesDisabled", "datesEnabled", "dateCustomClasses", "dateTooltipTexts", "isOpen", "bsValue", "bsConfig"], outputs: ["onShown", "onHidden", "bsValueChange"], exportAs: ["bsDatepicker"] }, { kind: "component", type: MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: MessageDirective, selector: "c8y-message", inputs: ["name", "text"] }, { kind: "component", type: TimepickerComponent, selector: "timepicker", inputs: ["hourStep", "minuteStep", "secondsStep", "readonlyInput", "disabled", "mousewheel", "arrowkeys", "showSpinners", "showMeridian", "showMinutes", "showSeconds", "meridians", "min", "max", "hoursPlaceholder", "minutesPlaceholder", "secondsPlaceholder"], outputs: ["isValid", "meridianChange"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
223
|
+
], ngImport: i0, template: "<div [formGroup]=\"fgOperationScheduler\">\n <div class=\"form-group\">\n <label translate>Start date</label>\n <div class=\"datetime-picker\">\n <c8y-form-group class=\"datepicker\">\n <input\n class=\"form-control\"\n placeholder=\"{{ placeholder | translate }}\"\n required\n formControlName=\"picker\"\n [bsConfig]=\"{ customTodayClass: 'today', dateInputFormat: dateInputFormat }\"\n [minDate]=\"minDate\"\n bsDatepicker\n (blur)=\"markAsTouched()\"\n />\n <c8y-messages>\n <c8y-message\n [name]=\"'dateValidation'\"\n [text]=\"'Select time in the future.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <timepicker\n class=\"form-group\"\n [showSpinners]=\"false\"\n [showMeridian]=\"false\"\n formControlName=\"time\"\n (blur)=\"markAsTouched()\"\n ></timepicker>\n </div>\n </div>\n <div class=\"form-group\">\n <c8y-form-group [hasError]=\"delayErrors\">\n <label translate>Delay</label>\n <div class=\"input-group\">\n <input\n class=\"form-control\"\n placeholder=\"{{ 'e.g.' | translate }} 15\"\n type=\"number\"\n required\n formControlName=\"delay\"\n (blur)=\"markAsTouched()\"\n />\n <div class=\"input-group-btn\">\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control m-r-sm-32 m-r-xs-56\"\n [attr.aria-label]=\"'Delay units' | translate\"\n formControlName=\"unit\"\n (blur)=\"markAsTouched()\"\n >\n <option\n value=\"seconds\"\n translate\n >\n Seconds\n </option>\n <option\n value=\"milliseconds\"\n translate\n >\n Milliseconds\n </option>\n </select>\n <span></span>\n </div>\n </div>\n </div>\n </c8y-form-group>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "directive", type: RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: BsDatepickerInputDirective, selector: "input[bsDatepicker]" }, { kind: "directive", type: BsDatepickerDirective, selector: "[bsDatepicker]", inputs: ["placement", "triggers", "outsideClick", "container", "outsideEsc", "isDisabled", "minDate", "maxDate", "ignoreMinMaxErrors", "minMode", "daysDisabled", "datesDisabled", "datesEnabled", "dateCustomClasses", "dateTooltipTexts", "isOpen", "bsValue", "bsConfig"], outputs: ["onShown", "onHidden", "bsValueChange"], exportAs: ["bsDatepicker"] }, { kind: "component", type: MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage", "additionalMessages"] }, { kind: "directive", type: MessageDirective, selector: "c8y-message", inputs: ["name", "text"] }, { kind: "component", type: TimepickerComponent, selector: "timepicker", inputs: ["hourStep", "minuteStep", "secondsStep", "readonlyInput", "disabled", "mousewheel", "arrowkeys", "showSpinners", "showMeridian", "showMinutes", "showSeconds", "meridians", "min", "max", "hoursPlaceholder", "minutesPlaceholder", "secondsPlaceholder"], outputs: ["isValid", "meridianChange"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
224
224
|
}
|
|
225
225
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: OperationSchedulerComponent, decorators: [{
|
|
226
226
|
type: Component,
|