register-device/extensible/single/extensible-device-registration-stepper.component.ts
selector | c8y-extensible-device-registration-stepper |
templateUrl | extensible-device-registration-stepper.component.html |
Properties |
Methods |
Inputs |
constructor(customProviderService: ExtensibleDeviceRegistrationService, registerDeviceService: RegisterDeviceService, bsModalRef: BsModalRef)
|
||||||||||||
Parameters :
|
contextPath |
Type : string
|
labels |
Type : string[]
|
steps |
Type : FormlyFieldConfig[][]
|
close |
close()
|
Returns :
void
|
complete |
complete()
|
Returns :
void
|
finalStepStatus |
finalStepStatus()
|
Returns :
any
|
goToFirstStep |
goToFirstStep()
|
Returns :
void
|
isRegistrationStep |
isRegistrationStep()
|
Returns :
boolean
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
Async save |
save()
|
Returns :
any
|
errorMessage |
Type : string
|
forms |
Type : FormGroup[]
|
Default value : []
|
message |
Type : string
|
model |
Type : any
|
Default value : {}
|
pendingStatus |
Type : boolean
|
Default value : false
|
stepper |
Type : C8yStepper
|
Decorators :
@ViewChild(C8yStepper, {static: true})
|
<c8y-stepper
[disableDefaultIcons]="{ edit: true, done: false }"
[customClasses]="['m-40', 'm-t-16', 'm-b-16']"
>
<cdk-step *ngFor="let step of steps; let i = index" [stepControl]="forms[i]" [label]="labels[i]">
<c8y-form-group class="form-group p-24 p-b-0 p-t-16">
<formly-form [form]="forms[i]" [fields]="step" [model]="model"></formly-form>
</c8y-form-group>
<c8y-stepper-buttons
class="sticky-bottom d-block p-t-16 p-b-16 separator-top bg-white"
*ngIf="isRegistrationStep()"
[showButtons]="{ cancel: true, back: true, next: true }"
[labels]="{ next: 'Register' }"
(onCancel)="close()"
(onNext)="save()"
[pending]="pendingStatus"
[disabled]="forms[i].invalid"
></c8y-stepper-buttons>
<c8y-stepper-buttons
class="sticky-bottom d-block p-t-16 p-b-16 separator-top bg-white"
*ngIf="!isRegistrationStep()"
[showButtons]="{ cancel: true, back: i !== 0, next: true }"
[disabled]="forms[i].invalid"
(onCancel)="close()"
></c8y-stepper-buttons>
</cdk-step>
<cdk-step [state]="finalStepStatus()" label="{{ 'Summary' | translate }}">
<c8y-operation-result
*ngIf="!errorMessage; else errorInfo"
text="{{ message | translate }}"
[size]="84"
[vertical]="true"
type="success"
class="lead"
></c8y-operation-result>
<ng-template #errorInfo>
<c8y-operation-result
text="{{ errorMessage | translate }}"
[size]="84"
[vertical]="true"
type="error"
class="lead"
></c8y-operation-result>
</ng-template>
<c8y-stepper-buttons
class="sticky-bottom d-block p-t-16 p-b-16 separator-top bg-white"
[showButtons]="{ cancel: errorMessage, back: errorMessage, next: !errorMessage }"
[labels]="{ back: 'Fix issue', next: 'Close' }"
(onCancel)="close()"
(onNext)="complete()"
(onBack)="goToFirstStep()"
></c8y-stepper-buttons>
</cdk-step>
</c8y-stepper>