How to use the formiojs/utils.default function in formiojs

To help you get started, we’ve selected a few formiojs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github formio / formio / src / util / util.js View on Github external
*   A submission object to search.
   * @param {String} key
   *   A for components API key to search for.
   */
  getValue: formioUtils.getValue.bind(formioUtils),

  /**
   * Determine if a component is a layout component or not.
   *
   * @param {Object} component
   *   The component to check.
   *
   * @returns {Boolean}
   *   Whether or not the component is a layout component.
   */
  isLayoutComponent: formioUtils.isLayoutComponent.bind(formioUtils),

  /**
   * Apply JSON logic functionality.
   *
   * @param component
   * @param row
   * @param data
   */
  jsonLogic: formioUtils.jsonLogic,

  /**
   * Check if the condition for a component is true or not.
   *
   * @param component
   * @param row
   * @param data
github formio / formio / src / util / util.js View on Github external
*
   * @returns {Object}
   *   The component that matches the given key, or undefined if not found.
   */
  getComponent: formioUtils.getComponent.bind(formioUtils),

  /**
   * Define if component should be considered input component
   *
   * @param {Object} componentJson
   *   JSON of component to check
   *
   * @returns {Boolean}
   *   If component is input or not
   */
  isInputComponent: formioUtils.isInputComponent.bind(formioUtils),

  /**
   * Flatten the form components for data manipulation.
   *
   * @param {Object} components
   *   The components to iterate.
   * @param {Boolean} includeAll
   *   Whether or not to include layout components.
   *
   * @returns {Object}
   *   The flattened components map.
   */
  flattenComponents: formioUtils.flattenComponents.bind(formioUtils),

  /**
   * Get the value for a component key, in the given submission.
github formio / formio / src / util / util.js View on Github external
return childReq;
  },

  /**
   * Iterate through each component within a form.
   *
   * @param {Object} components
   *   The components to iterate.
   * @param {Function} fn
   *   The iteration function to invoke for each component.
   * @param {Boolean} includeAll
   *   Whether or not to include layout components.
   * @param {String} path
   */
  eachComponent: formioUtils.eachComponent.bind(formioUtils),

  /**
   * Get a component by its key
   *
   * @param {Object} components
   *   The components to iterate.
   * @param {String} key
   *   The key of the component to get.
   *
   * @returns {Object}
   *   The component that matches the given key, or undefined if not found.
   */
  getComponent: formioUtils.getComponent.bind(formioUtils),

  /**
   * Define if component should be considered input component
github formio / formio / src / util / util.js View on Github external
*   If component is input or not
   */
  isInputComponent: formioUtils.isInputComponent.bind(formioUtils),

  /**
   * Flatten the form components for data manipulation.
   *
   * @param {Object} components
   *   The components to iterate.
   * @param {Boolean} includeAll
   *   Whether or not to include layout components.
   *
   * @returns {Object}
   *   The flattened components map.
   */
  flattenComponents: formioUtils.flattenComponents.bind(formioUtils),

  /**
   * Get the value for a component key, in the given submission.
   *
   * @param {Object} submission
   *   A submission object to search.
   * @param {String} key
   *   A for components API key to search for.
   */
  getValue: formioUtils.getValue.bind(formioUtils),

  /**
   * Determine if a component is a layout component or not.
   *
   * @param {Object} component
   *   The component to check.
github formio / formio / src / util / util.js View on Github external
* Apply JSON logic functionality.
   *
   * @param component
   * @param row
   * @param data
   */
  jsonLogic: formioUtils.jsonLogic,

  /**
   * Check if the condition for a component is true or not.
   *
   * @param component
   * @param row
   * @param data
   */
  checkCondition: formioUtils.checkCondition.bind(formioUtils),

  /**
   * Return the objectId.
   *
   * @param id
   * @returns {*}
   * @constructor
   */
  ObjectId(id) {
    try {
      return _.isObject(id)
        ? id
        : mongoose.Types.ObjectId(id);
    }
    catch (e) {
      return id;
github formio / formio / src / util / util.js View on Github external
*   Whether or not to include layout components.
   *
   * @returns {Object}
   *   The flattened components map.
   */
  flattenComponents: formioUtils.flattenComponents.bind(formioUtils),

  /**
   * Get the value for a component key, in the given submission.
   *
   * @param {Object} submission
   *   A submission object to search.
   * @param {String} key
   *   A for components API key to search for.
   */
  getValue: formioUtils.getValue.bind(formioUtils),

  /**
   * Determine if a component is a layout component or not.
   *
   * @param {Object} component
   *   The component to check.
   *
   * @returns {Boolean}
   *   Whether or not the component is a layout component.
   */
  isLayoutComponent: formioUtils.isLayoutComponent.bind(formioUtils),

  /**
   * Apply JSON logic functionality.
   *
   * @param component
github formio / formio / src / util / util.js View on Github external
* @param {String} path
   */
  eachComponent: formioUtils.eachComponent.bind(formioUtils),

  /**
   * Get a component by its key
   *
   * @param {Object} components
   *   The components to iterate.
   * @param {String} key
   *   The key of the component to get.
   *
   * @returns {Object}
   *   The component that matches the given key, or undefined if not found.
   */
  getComponent: formioUtils.getComponent.bind(formioUtils),

  /**
   * Define if component should be considered input component
   *
   * @param {Object} componentJson
   *   JSON of component to check
   *
   * @returns {Boolean}
   *   If component is input or not
   */
  isInputComponent: formioUtils.isInputComponent.bind(formioUtils),

  /**
   * Flatten the form components for data manipulation.
   *
   * @param {Object} components