initIndeterminateStates()

in src/components/base/form/form_checkbox_tree/models/tree.js [67:85]


  initIndeterminateStates() {
    const nodes = [...this.nodesList];
    for (let i = this.treeDepth; i >= 0; i -= 1) {
      const removeIndices = [];
      nodes.forEach((node, nodeIndex) => {
        if (node.depth === i && node.isUnchecked) {
          node.setCheckedState(
            this.optionHasSomeChildrenChecked(node)
              ? CHECKED_STATE.INDETERMINATE
              : node.checkedState
          );
          removeIndices.push(nodeIndex);
        }
      });
      removeIndices.reverse().forEach((index) => {
        nodes.splice(index, 1);
      });
    }
  }