<commit_before><template>
    <label :class="attributes.class"
           :disabled="attributes.disabled">
        <slot>
            Upload file
        </slot>
        <input hidden
               type="file"
               v-bind="attributes"
               @change="onFileChange($event.target.files.item(0))">
    </label>
</template>

<style scoped>
    label {
        margin-bottom: initial;
    }

    [disabled] {
        cursor: not-allowed !important;
    }

    [hidden] {
        display: none !important;
    }
</style>

<script>
    export default {
        props: {
            attributes: {
                type: Object,
                default: () => {
                    return {
                        class: "btn btn-secondary",
                    };
                },
            },
        },
        methods: {
            onFileChange: function (file) {
                this.$emit("change", file);
            },
        },
    }
</script>
<commit_msg>Fixed file input issue when select two times the same file<commit_after><template>
    <label :class="attributes.class"
           :disabled="attributes.disabled">
        <slot>
            Upload file
        </slot>
        <input v-if="fileInputReady"
               hidden
               type="file"
               v-bind="attributes"
               @change="onFileChange($event.target.files.item(0))">
    </label>
</template>

<style scoped>
    label {
        margin-bottom: initial;
    }

    [disabled] {
        cursor: not-allowed !important;
    }

    [hidden] {
        display: none !important;
    }
</style>

<script>
    export default {
        props: {
            attributes: {
                type: Object,
                default: () => {
                    return {
                        class: "btn btn-secondary",
                    };
                },
            },
        },
        data: function () {
            return {
                fileInputReady: true,
            };
        },
        methods: {
            onFileChange: function (file) {
                this.$emit("change", file);
                this.clearFileInput();
            },
            clearFileInput: function () {
                this.fileInputReady = false;
                this.$nextTick(() => {
                    this.fileInputReady = true;
                });
            },
        },
    }
</script>

{'fraction_non_alphanumeric': 0.12141372141372142, 'fraction_numerical': 0.0008316008316008316, 'mean_word_length': 1.1329787234042554, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 28, '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': '369338', 'n_tokens_mistral': 630, 'n_tokens_neox': 603, 'n_words': 120}