<commit_before>import { Question } from "./question";
import { Serializer } from "./jsonobject";
import { QuestionFactory } from "./questionfactory";
import { SurveyError, Event } from "./base";
import { UploadingFileError, ExceedSizeError } from "./error";
import { surveyLocalization } from "./surveyStrings";

/**
 * A Model for a file question
 */
export class QuestionFileModel extends Question {
  private isUploading: boolean = false;
  /**
   * The event is fired after question state has been changed.
   * <br/> sender the question object that fires the event
   * <br/> options.state new question state value.
   */
  public onStateChanged: Event<
    (sender: QuestionFileModel, options: any) => any,
    any
  > = new Event<(sender: QuestionFileModel, options: any) => any, any>();
  public previewValue: any[] = [];
  public currentState = "empty";
  constructor(public name: string) {
    super(name);
  }
  public getType(): string {
    return "file";
  }
  public clearOnDeletingContainer() {
    this.clear();
  }
  /**
   * Set it to true, to show the preview for the image files.
   */
  public get showPreview() {
    return this.getPropertyValue("showPreview");
  }<commit_msg>Fix panel with file not clearing when click remove button<commit_after>import { Question } from "./question";
import { Serializer } from "./jsonobject";
import { QuestionFactory } from "./questionfactory";
import { SurveyError, Event } from "./base";
import { UploadingFileError, ExceedSizeError } from "./error";
import { surveyLocalization } from "./surveyStrings";

/**
 * A Model for a file question
 */
export class QuestionFileModel extends Question {
  private isUploading: boolean = false;
  /**
   * The event is fired after question state has been changed.
   * <br/> sender the question object that fires the event
   * <br/> options.state new question state value.
   */
  public onStateChanged: Event<
    (sender: QuestionFileModel, options: any) => any,
    any
  > = new Event<(sender: QuestionFileModel, options: any) => any, any>();
  public previewValue: any[] = [];
  public currentState = "empty";
  constructor(public name: string) {
    super(name);
  }
  public getType(): string {
    return "file";
  }
  public clearOnDeletingContainer() {
    this.survey.clearFiles(this.name, this.value, null, () => { });
  }
  /**
   * Set it to true, to show the preview for the image files.
   */
  public get showPreview() {
    return this.getPropertyValue("showPreview");
  }
{'fraction_non_alphanumeric': 0.12670408981555734, 'fraction_numerical': 0.0, 'mean_word_length': 3.6810506566604126, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2931322', 'n_tokens_mistral': 694, 'n_tokens_neox': 694, 'n_words': 245}