<commit_before>import { getIdSchema, getUiOptions } from '../../utils'
import UnsupportedProp from './unsupported-prop.vue'

const COMPONENT_TYPES = {
  array: 'ArrayProp',
  boolean: 'BooleanProp',
  integer: 'NumberProp',
  number: 'NumberProp',
  object: 'ObjectProp',
  string: 'StringProp'
}

export default {
  functional: true,

  props: {
    name: String,
    schema: Object,
    uiSchema: Object,
    errorSchema: [Object, Boolean],
    idSchema: Object,
    required: Boolean,
    value: null,
    registry: Object,
    handlers: Object,
  },

  render (h, context) {
    let errors
    if (context.props.errorSchema &&
      context.props.errorSchema._errors !== undefined &&
      context.props.errorSchema._errors.length > 0) {
      errors = context.props.errorSchema._errors
    }

    const uiOptions = getUiOptions(
      context.props.schema,
      context.props.uiSchema, {
        name: context.props.name,
        required: context.props.required,
        invalid: errors && errors.length > 0,
        handlers: context.props.handlers,
      }
    )

    function getPropComponent () {
      const prop = uiOptions.prop
      if (typeof prop === 'function') {
        return prop
      }
      if (typeof prop === 'string' && prop in context.props.registry.props) {
        return context.props.registry.props[prop]
      }
      const componentName = COMPONENT_TYPES[context.props.schema.type]
      return componentName in context.props.registry.props
        ? context.props.registry.props[componentName].name : UnsupportedProp.name
    }

    return h(getPropComponent(), {
      props: {
        name: context.props.name,
        schema: context.props.schema,
        uiSchema: context.props.uiSchema,
        errorSchema: context.props.errorSchema,
        idSchema: getIdSchema({
          idSchema: context.props.idSchema,
          id: uiOptions.$id
        }),
        errors: uiOptions.displayErrors ? errors : undefined,
        value: context.props.value,
        registry: context.props.registry,
        uiOptions,
      },
      on: context.listeners,
    })
  },
}<commit_msg>feat: add hidden option to uiOptions<commit_after>import { getIdSchema, getUiOptions } from '../../utils'
import UnsupportedProp from './unsupported-prop.vue'

const COMPONENT_TYPES = {
  array: 'ArrayProp',
  boolean: 'BooleanProp',
  integer: 'NumberProp',
  number: 'NumberProp',
  object: 'ObjectProp',
  string: 'StringProp'
}

export default {
  functional: true,

  props: {
    name: String,
    schema: Object,
    uiSchema: Object,
    errorSchema: [Object, Boolean],
    idSchema: Object,
    required: Boolean,
    value: null,
    registry: Object,
    handlers: Object,
  },

  render (h, context) {
    let errors
    if (context.props.errorSchema &&
      context.props.errorSchema._errors !== undefined &&
      context.props.errorSchema._errors.length > 0) {
      errors = context.props.errorSchema._errors
    }

    const uiOptions = getUiOptions(
      context.props.schema,
      context.props.uiSchema, {
        name: context.props.name,
        required: context.props.required,
        invalid: errors && errors.length > 0,
        handlers: context.props.handlers,
      }
    )

    function getPropComponent () {
      const prop = uiOptions.prop
      if (typeof prop === 'function') {
        return prop
      }
      if (typeof prop === 'string' && prop in context.props.registry.props) {
        return context.props.registry.props[prop]
      }
      const componentName = COMPONENT_TYPES[context.props.schema.type]
      return componentName in context.props.registry.props
        ? context.props.registry.props[componentName].name : UnsupportedProp.name
    }

    if (uiOptions && uiOptions.hidden === true) {
      return
    }

    return h(getPropComponent(), {
      props: {
        name: context.props.name,
        schema: context.props.schema,
        uiSchema: context.props.uiSchema,
        errorSchema: context.props.errorSchema,
        idSchema: getIdSchema({
          idSchema: context.props.idSchema,
          id: uiOptions.$id
        }),
        errors: uiOptions.displayErrors ? errors : undefined,
        value: context.props.value,
        registry: context.props.registry,
        uiOptions,
      },
      on: context.listeners,
    })
  },
}
{'fraction_non_alphanumeric': 0.11542910016192459, 'fraction_numerical': 0.0009252833680314596, 'mean_word_length': 2.529795918367347, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1991457', 'n_tokens_mistral': 1252, 'n_tokens_neox': 1241, 'n_words': 274}