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

const dataPointsListWidgetDefinition = {
    id: defaultWidgetIds.DATA_POINTS_LIST,
    label: gettext('Data points list'),
    description: gettext('A list displaying current values for selected measurements'),
    loadComponent: () => import('@c8y/ngx-components/widgets/implementations/datapoints-list').then(m => m.DatapointsListViewComponent),
    loadConfigComponent: () => import('@c8y/ngx-components/widgets/implementations/datapoints-list').then(m => m.DatapointsListConfigComponent),
    previewImage: 'c8y-style-assets/data-points-list-widget.png',
    resolve: {
        datapoints: DynamicDatapointsResolver
    },
    errorStrategy: DynamicComponentErrorStrategy.OVERLAY_ERROR,
    data: {
        schema: () => import('c8y-schema-loader?interfaceName=DatapointsListConfig!@c8y/ngx-components/widgets/implementations/datapoints-list'),
        export: exportConfigWithTargets,
        import: importConfigWithTargets,
        controls: PRESET_NAME.DATA_POINTS_LIST_CONFIG,
        settings: {
            noNewWidgets: false,
            widgetDefaults: {
                _width: 8,
                _height: 4
            },
            ng1: {
                options: {
                    noDeviceTarget: true,
                    minCol: 6
                }
            }
        },
        displaySettings: {
            globalAutoRefreshContext: true,
            globalTimeContext: true,
            globalRealtimeContext: false,
            globalAggregationContext: true
        }
    }
};
const DATAPOINT_SELECT_DEFAULT_OPTIONS = {
    showTarget: true,
    showRange: true,
    showRedRange: true,
    showYellowRange: true
};
const dataPointsListWidgetProviders = [
    hookWidget(dataPointsListWidgetDefinition),
    hookWidgetConfig({
        widgetId: defaultWidgetIds.DATA_POINTS_LIST,
        priority: 10,
        label: gettext('Time context'),
        initialState: {
            controls: PRESET_NAME.DATA_POINTS_LIST_CONFIG
        },
        loadComponent: () => import('@c8y/ngx-components/context-dashboard').then(m => m.GlobalContextSectionComponent)
    }),
    hookWidgetConfig({
        widgetId: defaultWidgetIds.DATA_POINTS_LIST,
        label: gettext('Data point selection'),
        loadComponent: () => import('@c8y/ngx-components/datapoint-selector').then(m => m.WidgetDatapointsSelectorComponent),
        initialState: {
            minActiveCount: 1,
            defaultFormOptions: DATAPOINT_SELECT_DEFAULT_OPTIONS
        },
        expanded: true,
        priority: 20
    })
];

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

export { dataPointsListWidgetDefinition, dataPointsListWidgetProviders };
//# sourceMappingURL=c8y-ngx-components-widgets-definitions-datapoints-list.mjs.map
