Represents a layout component that conditionally renders its children based on given conditions.

  • Type Parameters

    • Data extends unknown = any

      The type of data passed to the layout.

    Parameters

    • props: IConditionLayoutProps<Data, any> & IConditionLayoutPrivate<Data>

      The props object containing the following properties:

      Represents the props for a conditional layout component.

      • Optionalbaseline?: boolean

        Represents an optional property baseline that is picked from the interface IField using the PickProp utility type.

        The type of data associated with the field.

        The type of payload associated with the field.

      • Optionalcondition?:
            | (data: Data, payload: Payload) => boolean
            | (data: Data, payload: Payload) => Promise<boolean>
      • OptionalconditionElse?: any
      • OptionalconditionLoading?: any
      • OptionaldesktopHidden?: boolean | (payload: Payload) => boolean

        Represents the optional property desktopHidden of type PickProp<IField<Data, Payload>, 'desktopHidden'>.

      • Optionaldisabled?: boolean

        Represents the disabled property of a field.

      • Optionalfeatures?: string[]

        Retrieves the 'features' property from a given variable.

        The type of the variable.

        The property name to retrieve.

        The variable to extract the property from.

        • The extracted 'features' property.
      • Optionalhidden?: boolean | (payload: Payload) => boolean

        Represents the 'hidden' property of an object.

        The type of the field object.

        The type of the data object.

        The type of the payload object.

      • OptionalisDisabled?: (v: Data, payload: Payload) => boolean

        Represents the isDisabled property of a field in a form. The isDisabled property determines whether the field is disabled or not.

      • OptionalisReadonly?: (v: Data, payload: Payload) => boolean

        Retrieves the value of the 'isReadonly' property from the given variable.

      • OptionalisVisible?: (v: Data, payload: Payload) => boolean

        Represents the isVisible property of a field in a form.

      • OptionalnoBaseline?: boolean

        Represents an optional property noBaseline that is picked from the interface IField using the PickProp utility type.

        The type of data associated with the field.

        The type of payload associated with the field.

      • OptionalphoneHidden?: boolean | (payload: Payload) => boolean

        Represents the phoneHidden property of a field object.

      • OptionalshouldCondition?: (prevData: Data, nextData: Data, payload: Payload) => boolean
      • OptionaltabletHidden?: boolean | (payload: Payload) => boolean

        Represents the optional property 'tabletHidden' in a field object.

      • OptionaltestId?: string

        Идентификатор для отладки json шаблона

      • children

        The children elements to be rendered inside the layout.

      • condition

        The condition function that determines when the children should be rendered.

      • shouldCondition

        The function to determine if the condition should be re-evaluated.

      • conditionLoading

        The component to be rendered while condition is evaluating/loading.

      • conditionElse

        The component to be rendered if condition evaluates to false.

      • fallback

        The function to handle errors during condition evaluation.

      • object

        The data object to be passed to the condition and children components.

    Returns Element

    The rendered layout component.

Properties

Properties

displayName: string