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

const datapointsTableWidgetControls = {
    presets: ['defaultWithAggregation']
};
const dataPointsTableWidgetDefinition = {
    id: defaultWidgetIds.DATA_POINTS_TABLE,
    label: gettext('Data points table'),
    description: gettext(`A table display of a collection of data points`),
    loadComponent: () => import('@c8y/ngx-components/widgets/implementations/datapoints-table').then(m => m.DatapointsTableViewWidgetComponent),
    loadConfigComponent: () => import('@c8y/ngx-components/widgets/implementations/datapoints-table').then(m => m.DatapointsTableWidgetConfigComponent),
    previewImage: 'c8y-style-assets/data-points-table-widget.png',
    resolve: {
        datapoints: DynamicDatapointsResolver
    },
    errorStrategy: DynamicComponentErrorStrategy.OVERLAY_ERROR,
    data: {
        schema: () => import('c8y-schema-loader?interfaceName=DatapointsTableConfig!@c8y/ngx-components/widgets/implementations/datapoints-table'),
        export: exportConfigWithTargets,
        import: importConfigWithTargets,
        widgetControls: datapointsTableWidgetControls,
        settings: {
            noNewWidgets: false,
            widgetDefaults: {
                _width: 8,
                _height: 4
            },
            ng1: {
                options: {
                    noDeviceTarget: true,
                    minCol: 6,
                    datapointAttributes: ['datapoints']
                }
            }
        },
        displaySettings: {
            globalAutoRefreshContext: true,
            globalTimeContext: true,
            globalRealtimeContext: false,
            globalAggregationContext: true
        }
    }
};
const dataPointsTableWidgetProviders = [
    hookWidget(dataPointsTableWidgetDefinition),
    hookWidgetConfig({
        widgetId: defaultWidgetIds.DATA_POINTS_TABLE,
        priority: 10,
        label: gettext('Time context'),
        initialState: {
            widgetControls: datapointsTableWidgetControls
        },
        loadComponent: () => import('@c8y/ngx-components/context-dashboard').then(m => m.GlobalContextSectionComponent)
    })
];

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

export { dataPointsTableWidgetDefinition, dataPointsTableWidgetProviders };
//# sourceMappingURL=c8y-ngx-components-widgets-definitions-datapoints-table.mjs.map
