<commit_before><template>
    <span class="viu-menu">
        <slot></slot>
    </span>
</template>

<script>
    import Helper from "../plugin/class.js"
    export default {
        mounted() {
            let self = this;
            self.$nextTick(() => {
                self.root = self.$root.$el;
                self.triggerElement = self.$el.querySelector("[trigger-menu]");
                self.childElement = self.$el.querySelector(".viu-menu-content")
                self.childElement = self.root.appendChild(self.childElement);
                self.reposition();

                self.triggerElement.addEventListener("mousedown", function(e) {
                    self.reposition();
                });
                self.triggerElement.addEventListener("click", function(e) {
                    var matches = document.querySelectorAll(".viu-menu-content");
                    matches.forEach(function(element) {
                        Helper.removeClass(element, "show");
                    });

                    Helper.addClass(self.childElement, "show");
                    let ancestor = Helper.findAncestor(self.$el, "simplebar-scroll-content");
                    if(!ancestor) {
                        ancestor = Helper.findAncestor(self.$el, "simplebar");
                    }
                    Helper.one(ancestor,"scroll", function(e) {
                        Helper.removeClass(self.childElement, "show");
                    })
                    e.stopPropagation();
                    

                    Helper.one(document, 'click', function(e) {
                        Helper.removeClass(self.childElement, "show");
                    })
                });
            });<commit_msg>Add delat to dropdown select<commit_after><template>
    <span class="viu-menu">
        <slot></slot>
    </span>
</template>

<script>
    import Helper from "../plugin/class.js"
    export default {
        mounted() {
            let self = this;
            self.$nextTick(() => {
                self.root = self.$root.$el;
                self.triggerElement = self.$el.querySelector("[trigger-menu]");
                self.childElement = self.$el.querySelector(".viu-menu-content")
                self.childElement = self.root.appendChild(self.childElement);
                self.reposition();

                self.triggerElement.addEventListener("mousedown", function(e) {
                    self.reposition();
                });
                self.triggerElement.addEventListener("click", function(e) {
                    var matches = document.querySelectorAll(".viu-menu-content");
                    matches.forEach(function(element) {
                        Helper.removeClass(element, "show");
                    });
                    setTimeout(()=> {
                        Helper.addClass(self.childElement, "show");
                    }, 100)
                    
                    let ancestor = Helper.findAncestor(self.$el, "simplebar-scroll-content");
                    if(!ancestor) {
                        ancestor = Helper.findAncestor(self.$el, "simplebar");
                    }
                    Helper.one(ancestor,"scroll", function(e) {
                        Helper.removeClass(self.childElement, "show");
                    })
                    e.stopPropagation();
                    

                    Helper.one(document, 'click', function(e) {
                        Helper.removeClass(self.childElement, "show");
                    })
                });
            });
{'fraction_non_alphanumeric': 0.12657166806370496, 'fraction_numerical': 0.0008382229673093043, 'mean_word_length': 1.3383409536250817, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 20, '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': '248940', 'n_tokens_mistral': 899, 'n_tokens_neox': 835, 'n_words': 122}