{"version":3,"file":"c8y-ngx-components-services-service-command-tab.mjs","sources":["../../services/service-command-tab/service-command-tab.component.ts","../../services/service-command-tab/service-command-tab.component.html","../../services/service-command-tab/service-command.feature.ts","../../services/service-command-tab/c8y-ngx-components-services-service-command-tab.ts"],"sourcesContent":["import { NgFor } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport {\n  ActionBarItemComponent,\n  ActionControl,\n  C8yTranslatePipe,\n  ContextRouteService,\n  HelpModule,\n  IconDirective\n} from '@c8y/ngx-components';\nimport { OperationsListComponent } from '@c8y/ngx-components/operations/operations-list';\nimport { Service, ServiceCommandService } from '@c8y/ngx-components/services/shared';\n\n@Component({\n  selector: 'c8y-service-command-tab',\n  standalone: true,\n  imports: [\n    NgFor,\n    IconDirective,\n    OperationsListComponent,\n    ActionBarItemComponent,\n    HelpModule,\n    C8yTranslatePipe\n  ],\n  templateUrl: './service-command-tab.component.html'\n})\nexport class ServiceCommandTabComponent {\n  service: Service;\n  actions: ActionControl[] = [];\n\n  constructor(\n    commandService: ServiceCommandService,\n    contextRouteService: ContextRouteService,\n    activatedRoute: ActivatedRoute\n  ) {\n    const { contextData } = contextRouteService.getContextData(activatedRoute);\n    this.service = <Service>contextData;\n    const commands = commandService.getAllSupportedCommands([contextData as unknown as Service]);\n    this.actions = commandService.generateActionControls(commands);\n  }\n}\n","<c8y-action-bar-item\n  *ngFor=\"let action of actions; let i = index\"\n  [placement]=\"i < 3 ? 'right' : 'more'\"\n>\n  <button\n    class=\"d-flex a-i-center {{ i < 3 ? 'btn btn-link' : '' }}\"\n    style=\"max-width: {{ i < 3 ? '160px' : 'unset' }};\"\n    [title]=\"action.text | translate\"\n    (click)=\"action.callback(service)\"\n  >\n    <i\n      class=\"m-r-4\"\n      [class]=\"action.iconClasses\"\n      [c8yIcon]=\"action.icon\"\n    ></i>\n    <span class=\"text-truncate\">\n      {{ action.text | translate }}\n    </span>\n  </button>\n</c8y-action-bar-item>\n\n<c8y-operations-list\n  fragmentType=\"c8y_ServiceCommand\"\n  [readOnlyItems]=\"true\"\n>\n  <!-- TODO Add context help\n  <c8y-help></c8y-help>\n  -->\n</c8y-operations-list>\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { hookRoute, ViewContext } from '@c8y/ngx-components';\nimport { ServiceCommandTabComponent } from './service-command-tab.component';\n\nexport const serviceCommandTabFeatureProvider: EnvironmentProviders = makeEnvironmentProviders([\n  hookRoute({\n    context: ViewContext.Service,\n    path: 'commands',\n    component: ServiceCommandTabComponent,\n    label: gettext('Commands'),\n    icon: 'sliders1',\n    priority: 600\n  })\n]);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MA2Ba,0BAA0B,CAAA;AAIrC,IAAA,WAAA,CACE,cAAqC,EACrC,mBAAwC,EACxC,cAA8B,EAAA;QALhC,IAAA,CAAA,OAAO,GAAoB,EAAE;QAO3B,MAAM,EAAE,WAAW,EAAE,GAAG,mBAAmB,CAAC,cAAc,CAAC,cAAc,CAAC;AAC1E,QAAA,IAAI,CAAC,OAAO,GAAY,WAAW;QACnC,MAAM,QAAQ,GAAG,cAAc,CAAC,uBAAuB,CAAC,CAAC,WAAiC,CAAC,CAAC;QAC5F,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,sBAAsB,CAAC,QAAQ,CAAC;IAChE;+GAbW,0BAA0B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,qBAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,cAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA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