import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';

import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzMarks, NzSliderModule } from 'ng-zorro-antd/slider';

@Component({
  selector: '<%= selector %>',
  imports: [FormsModule, NzButtonModule, NzSliderModule],
  <% if(inlineTemplate) { %>template: `
    <h4>included=true</h4>
    <nz-slider [nzMarks]="marks" [ngModel]="37"></nz-slider>
    <nz-slider [nzMarks]="marks" nzIncluded nzRange [ngModel]="[26, 37]"></nz-slider>
    <h4>included=false</h4>
    <nz-slider [nzMarks]="marks" [nzIncluded]="false" [ngModel]="37"></nz-slider>
    <h4>marks & step</h4>
    <nz-slider [nzMarks]="marks" [nzStep]="10" [ngModel]="37"></nz-slider>
    <h4>step=null || dots=true</h4>
    <nz-slider [nzMarks]="marks" [nzStep]="null" [ngModel]="37"></nz-slider>
    <nz-slider [nzMarks]="marks" nzDots [ngModel]="37"></nz-slider>
    Change nzMarks dynamically:
    <button nz-button (click)="changeMarks()">Change nzMarks</button>
  `<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>,
  <% if(inlineStyle) { %>styles: [`
      h4 {
        margin: 0 0 16px;
      }

      .ant-slider-with-marks {
        margin-bottom: 44px;
      }
    `]<% } else { %>styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']<% } %>
})
export class <%= classify(name) %>Component {
  marks: NzMarks = {
    0: '0°C',
    26: '26°C',
    37: '37°C',
    100: {
      style: {
        color: '#f50'
      },
      label: '<strong>100°C</strong>'
    }
  };

  changeMarks(): void {
    this.marks = {
      20: '20%',
      99: '99%'
    };
  }
}
