<commit_before><script>
  export default {
    render: function (c) {
      var self = this;
      var clearEl, cancelEl, inputEl, inputWrapEl;
      inputEl = c('input', {
        attrs: {
          'placeholder': self.placeholder,
          'type': 'search'
        },
        on: {
          input: self.onInput,
          change: self.onChange,
          focus: self.onFocus,
          blur: self.onBlur
        }
      });
      if (self.clear) {
        clearEl = c('a', {
          staticClass: 'searchbar-clear',
          attrs: {
            'href' : '#'
          },
          on: {
            click: self.onClearClick
          }
        });
      }
      if (self.cancelLink) {
        cancelEl = c('a', {
          staticClass: 'searchbar-cancel',
          attrs: {
            'href' : '#'
          },
          domProps: {
            innerHTML: self.cancelLink
          },
          on: {
            click: self.onCancelClick
          }
        });
      }
      inputWrapEl = c('div', {staticClass:'searchbar-input'}, [inputEl, clearEl])

      return c(self.form ? 'form' : 'div', {
        staticClass: 'searchbar',
        on: {
          'searchbar:search': self.onSearch,
          'searchbar:enable': self.onEnable,
          'searchbar:disable': self.onDisable,
          'searchbar:clear': self.onClear
        }
      }, [self.$slots['before-input'], inputWrapEl, self.$slots['after-input'], cancelEl, self.$slots.default]);
    },
    beforeDestroy: function () {
      if (this.f7Searchbar && this.f7Searchbar.destroy) this.f7Searchbar.destroy();
    },
    props: {
      form: {
        type: Boolean,
        default: true
      },
      placeholder: {
        type: String,
        default: 'Search'
      },
      cancelLink: String,
      clear: {
        type: Boolean,
        default: true
      },

      // SB Params
      params: Object,
      searchList: [String, Object],
      searchIn: {
        type: String,
        default: '.item-title'
      },
      searchBy: String,
      found: [String, Object],
      notFound: [String, Object],
      overlay: [String, Object],
      ignore: {
        type: String,
        default: '.searchbar-ignore'
      },
      customSearch: {
        type: Boolean,
        default: false
      },
      removeDiacritics: {
        type: Boolean,
        default: false
      },
      hideDividers: {
        type: Boolean,
        default: true
      },
      hideGroups: {
        type: Boolean,
        default: true
      },
      init: {
        type: Boolean,
        default: true
      }
    },
    methods: {
      onChange: function (event) {
        this.$emit('change', event);
      },
      onInput: function (event) {
        this.$emit('input', event.target.value);
      },
      onFocus: function (event) {
        this.$emit('focus', event);
      },
      onBlur: function (event) {
        this.$emit('blur', event);
      },
      onSearch: function (event) {
        if(!event.detail) return;
        this.$emit('searchbar:search', event.detail.query, event.detail.foundItems);
      },
      onClear: function (event) {
        this.$emit('searchbar:clear', event);
      },
      onEnable: function (event) {
        this.$emit('searchbar:enable', event);
      },
      onDisable: function (event) {
        this.$emit('searchbar:disable', event);
      },
      onClearClick: function (event) {
        this.$emit('click:clear', event);
      },
      onCancelClick: function (event) {
        this.$emit('click:cancel', event);
      },
      onF7Init: function () {<commit_msg>Add submit event for searchbar to allow custom search on submit<commit_after><script>
  export default {
    render: function (c) {
      var self = this;
      var clearEl, cancelEl, inputEl, inputWrapEl;
      inputEl = c('input', {
        attrs: {
          'placeholder': self.placeholder,
          'type': 'search'
        },
        on: {
          input: self.onInput,
          change: self.onChange,
          focus: self.onFocus,
          blur: self.onBlur
        }
      });
      if (self.clear) {
        clearEl = c('a', {
          staticClass: 'searchbar-clear',
          attrs: {
            'href' : '#'
          },
          on: {
            click: self.onClearClick
          }
        });
      }
      if (self.cancelLink) {
        cancelEl = c('a', {
          staticClass: 'searchbar-cancel',
          attrs: {
            'href' : '#'
          },
          domProps: {
            innerHTML: self.cancelLink
          },
          on: {
            click: self.onCancelClick
          }
        });
      }
      inputWrapEl = c('div', {staticClass:'searchbar-input'}, [inputEl, clearEl])

      return c(self.form ? 'form' : 'div', {
        staticClass: 'searchbar',
        on: {
          'submit': self.onSubmit,
          'searchbar:search': self.onSearch,
          'searchbar:enable': self.onEnable,
          'searchbar:disable': self.onDisable,
          'searchbar:clear': self.onClear
        }
      }, [self.$slots['before-input'], inputWrapEl, self.$slots['after-input'], cancelEl, self.$slots.default]);
    },
    beforeDestroy: function () {
      if (this.f7Searchbar && this.f7Searchbar.destroy) this.f7Searchbar.destroy();
    },
    props: {
      form: {
        type: Boolean,
        default: true
      },
      placeholder: {
        type: String,
        default: 'Search'
      },
      cancelLink: String,
      clear: {
        type: Boolean,
        default: true
      },

      // SB Params
      params: Object,
      searchList: [String, Object],
      searchIn: {
        type: String,
        default: '.item-title'
      },
      searchBy: String,
      found: [String, Object],
      notFound: [String, Object],
      overlay: [String, Object],
      ignore: {
        type: String,
        default: '.searchbar-ignore'
      },
      customSearch: {
        type: Boolean,
        default: false
      },
      removeDiacritics: {
        type: Boolean,
        default: false
      },
      hideDividers: {
        type: Boolean,
        default: true
      },
      hideGroups: {
        type: Boolean,
        default: true
      },
      init: {
        type: Boolean,
        default: true
      }
    },
    methods: {
      onChange: function (event) {
        this.$emit('change', event);
      },
      onInput: function (event) {
        this.$emit('input', event.target.value);
      },
      onFocus: function (event) {
        this.$emit('focus', event);
      },
      onBlur: function (event) {
        this.$emit('blur', event);
      },
      onSubmit: function (event) {
        this.$emit('submit', event);
      },
      onSearch: function (event) {
        if(!event.detail) return;
        this.$emit('searchbar:search', event.detail.query, event.detail.foundItems);
      },
      onClear: function (event) {
        this.$emit('searchbar:clear', event);
      },
      onEnable: function (event) {
        this.$emit('searchbar:enable', event);
      },
      onDisable: function (event) {
        this.$emit('searchbar:disable', event);
      },
      onClearClick: function (event) {
        this.$emit('click:clear', event);
      },
      onCancelClick: function (event) {
        this.$emit('click:cancel', event);
      },
      onF7Init: function () {
{'fraction_non_alphanumeric': 0.14, 'fraction_numerical': 0.0010884353741496598, 'mean_word_length': 1.6328796561604584, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1755549', 'n_tokens_mistral': 2147, 'n_tokens_neox': 2139, 'n_words': 443}