@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
1 lines • 4.87 kB
Source Map (JSON)
{"version":3,"file":"c8y-ngx-components-widgets-definitions-kpi.mjs","sources":["../../widgets/definitions/kpi/kpi.constants.ts","../../widgets/definitions/kpi/index.ts","../../widgets/definitions/kpi/c8y-ngx-components-widgets-definitions-kpi.ts"],"sourcesContent":["import { DatapointAttributesFormConfig } from '@c8y/ngx-components/datapoint-selector';\n\nexport const KPI_FORM_OPTIONS: Partial<DatapointAttributesFormConfig> = {\n showRedRange: true,\n showYellowRange: true\n};\n","import { gettext } from '@c8y/ngx-components/gettext';\nimport {\n DynamicComponentErrorStrategy,\n DynamicDatapointsResolver,\n DynamicWidgetDefinition,\n hookWidget\n} from '@c8y/ngx-components';\nimport { defaultWidgetIds } from '@c8y/ngx-components/widgets/definitions';\nimport {\n exportConfigWithTargets,\n importConfigWithTargets\n} from '@c8y/ngx-components/widgets/import-export-config';\nimport {\n GlobalContextSectionComponent,\n hookWidgetConfig\n} from '@c8y/ngx-components/context-dashboard';\nimport { PRESET_NAME } from '@c8y/ngx-components/global-context';\nimport { KPI_FORM_OPTIONS } from './kpi.constants';\n\nexport const kpiWidgetDefinition = {\n id: defaultWidgetIds.KPI,\n label: gettext('KPI'),\n description: gettext('Displays the last measurement value of a device.'),\n loadComponent: () =>\n import('@c8y/ngx-components/widgets/implementations/kpi').then(m => m.KpiWidgetViewComponent),\n loadConfigComponent: () =>\n import('@c8y/ngx-components/widgets/implementations/kpi').then(m => m.KpiWidgetConfigComponent),\n previewImage: 'c8y-style-assets/kpi-widget.png',\n resolve: {\n datapoints: DynamicDatapointsResolver\n },\n errorStrategy: DynamicComponentErrorStrategy.OVERLAY_ERROR,\n data: {\n schema: () =>\n import(\n 'c8y-schema-loader?interfaceName=KpiWidgetConfig&type=widget-config!@c8y/ngx-components/widgets/implementations/kpi'\n ),\n export: exportConfigWithTargets,\n import: importConfigWithTargets,\n controls: PRESET_NAME.KPI_CONFIG,\n settings: {\n noNewWidgets: false,\n widgetDefaults: {\n _width: 4,\n _height: 2\n },\n ng1: {\n options: {\n noDeviceTarget: true,\n groupsSelectable: false\n }\n }\n }\n }\n} satisfies DynamicWidgetDefinition;\n\nexport const kpiWidgetProviders = [\n hookWidget(kpiWidgetDefinition),\n hookWidgetConfig<GlobalContextSectionComponent>({\n widgetId: defaultWidgetIds.KPI,\n priority: 10,\n label: gettext('Time context'),\n initialState: {\n controls: PRESET_NAME.KPI_CONFIG\n },\n loadComponent: () =>\n import('@c8y/ngx-components/context-dashboard').then(m => m.GlobalContextSectionComponent)\n }),\n hookWidgetConfig({\n widgetId: defaultWidgetIds.KPI,\n label: gettext('Data point selection'),\n loadComponent: () =>\n import('@c8y/ngx-components/datapoint-selector').then(\n m => m.WidgetDatapointsSelectorComponent\n ),\n initialState: {\n minActiveCount: 1,\n maxActiveCount: 1,\n defaultFormOptions: KPI_FORM_OPTIONS\n },\n expanded: true,\n priority: 100\n })\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEO,MAAM,gBAAgB,GAA2C;AACtE,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,eAAe,EAAE;CAClB;;ACcM,MAAM,mBAAmB,GAAG;IACjC,EAAE,EAAE,gBAAgB,CAAC,GAAG;AACxB,IAAA,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC;AACrB,IAAA,WAAW,EAAE,OAAO,CAAC,kDAAkD,CAAC;AACxE,IAAA,aAAa,EAAE,MACb,OAAO,iDAAiD,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,sBAAsB,CAAC;AAC/F,IAAA,mBAAmB,EAAE,MACnB,OAAO,iDAAiD,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,wBAAwB,CAAC;AACjG,IAAA,YAAY,EAAE,iCAAiC;AAC/C,IAAA,OAAO,EAAE;AACP,QAAA,UAAU,EAAE;AACb,KAAA;IACD,aAAa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