import { gettext } from '@c8y/ngx-components/gettext';
import { DynamicDatapointsResolver, hookWidget } from '@c8y/ngx-components';
import { importConfigWithTargets, exportConfigWithTargets } from '@c8y/ngx-components/widgets/import-export-config';
import { defaultWidgetIds } from '@c8y/ngx-components/widgets/definitions';
import { hookWidgetConfig } from '@c8y/ngx-components/context-dashboard';

const RADIAL_GAUGE_OPTIONS = {
    showRedRange: true,
    showYellowRange: true,
    showRange: true,
    selectableChartRenderTypes: []
};

const radialGaugeWidgetDefinition = {
    id: defaultWidgetIds.RADIAL_GAUGE,
    label: gettext('Radial gauge'),
    // Info gauge config and view components are used for the radial gauge. Eventually both will be merged into one component.
    description: gettext('Shows the device measurements in a radial gauge.'),
    loadComponent: () => import('@c8y/ngx-components/widgets/implementations/info-gauge').then(m => m.InfoGaugeWidgetViewComponent),
    // Gauge type is determined in the component
    loadConfigComponent: () => import('@c8y/ngx-components/widgets/implementations/info-gauge').then(m => m.InfoGaugeWidgetConfigComponent),
    previewImage: 'c8y-style-assets/radial-gauge-pr.png',
    resolve: {
        datapoints: DynamicDatapointsResolver
    },
    data: {
        schema: () => import('c8y-schema-loader?interfaceName=InfoGaugeWidgetConfig&type=widget-config!@c8y/ngx-components/widgets/implementations/info-gauge'),
        export: exportConfigWithTargets,
        import: importConfigWithTargets,
        settings: {
            noNewWidgets: false,
            widgetDefaults: {
                _width: 8,
                _height: 4
            },
            ng1: {
                options: {
                    noDeviceTarget: true,
                    groupsSelectable: false
                }
            }
        }
    }
};
const radialGaugeWidgetProviders = [
    hookWidget(radialGaugeWidgetDefinition),
    hookWidgetConfig({
        widgetId: defaultWidgetIds.RADIAL_GAUGE,
        label: gettext('Data point selection'),
        loadComponent: () => import('@c8y/ngx-components/datapoint-selector').then(m => m.WidgetDatapointsSelectorComponent),
        initialState: {
            minActiveCount: 1,
            maxActiveCount: 1,
            defaultFormOptions: RADIAL_GAUGE_OPTIONS,
            controlName: 'datapointsGauge'
        },
        expanded: true,
        priority: 100
    })
];

/**
 * Generated bundle index. Do not edit.
 */

export { radialGaugeWidgetDefinition, radialGaugeWidgetProviders };
//# sourceMappingURL=c8y-ngx-components-widgets-definitions-radial-gauge.mjs.map
