Build the column resets.

@param array  $definition The grid column definition.
@param Column $column     The column.
@param string $size       The column size.
@param array  $sizes      List of defined sizes.

@return void
351273
private function buildColumnResets(array $definition, Column $column, string $size, array $sizes): void
    {
        switch ($definition['reset']) {
            case '2':
                $key  = array_search($size, $sizes);
                $next = ($sizes[($key + 1)] ?? null);

                if ($next) {
                    $column->limitedReset((string) $next);

                    break;
                }

                // No break here,
            case '1':
                $column->reset();
                break;

            default:
                // Do nothing.
        }
    }
962968
def _resizeColumnsToContents(self, header, data, limit_ms):
        """"""
        max_col = data.model().columnCount()
        if limit_ms is None:
            max_col_ms = None
        else:
            max_col_ms = limit_ms / max(1, max_col)
        for col in range(max_col):
            self._resizeColumnToContents(header, data, col, max_col_ms)
672010
private function createGrid(): void
    {
        $this->grid = new Grid();
        $sizes      = StringUtil::deserialize($this->model->sizes, true);

        $this->buildRow();

        foreach ($sizes as $size) {
            $field      = $size . 'Size';
            $definition = StringUtil::deserialize($this->model->{$field}, true);

            if ($size === 'xs') {
                $size = '';
            }

            $this->buildSize($size, $definition, $sizes);
        }
    }
655863
public function on($columnNames)
    {
        if (!is_array($columnNames)) {
            $columnNames = [(string)$columnNames];
        }

        call_user_func($this->callback, $columnNames);
    }
1206150
public function setMaxColumns($columns, $size = null)
    {
        if (is_null($size)) {
            $size = $this->baseSize;
        }
        $columnAttribute = 'max' . ucfirst($size) . 'Columns';
        $this->{$columnAttribute} = $columns;
    }
361760
protected function createColumn(string $key, array $columnConfiguration): void
    {
        $this->columns[] = new Column($key, $this, $columnConfiguration);
    }
752899
public function buildReset(array $resets, string $size = ''): array
    {
        if ($this->reset === true) {
            $resets[] = sprintf('d-none d%s-block', $size ? '-' . $size : '');
        } elseif ($this->reset !== false) {
            $resets[] = sprintf('d-none d%s-block d-%s-none', $size ? '-' . $size : '', $this->reset);
        }

        return $resets;
    }
1141204
public function addColumn(TableColumn $column): void
  {
    // Add the column to our array of columns.
    $this->columns[$this->columnIndex] = $column;

    $column->onAddColumn($this, $this->columnIndex);

    // Increase the index for the next added column.
    $this->columnIndex += $column->getColSpan();
  }
1335873
public function setValue($size)
    {
        $this->size = $size;
        if (($this->multiplier !== 0) && ($this->size > -1)) {
            $this->sizelimit = $size * $this->multiplier;
        }
    }
284381
public function addColumns($cols) {
        if (sizeof($cols) > 0) {
            foreach($cols as $col) {
                if (sizeof($col) == 3) {
                    $this->addColumn($col[0], $col[1], $col[2]);
                } else if (sizeof($col) == 2) {
                    $this->addColumn($col[0], $col[1]);

                }
            }
        }
    }
609316
@SafeVarargs
  public final TableBuilder columns(String... columns) {
    if (columns == null || columns.length == 0) {
      throw new InvalidOperationException("Columns array is null or empty.");
    }
    if (tableColumns != null) {
      throw new InvalidOperationException("The table columns are already defined.");
    }
    tableColumns = columns.clone();
    return this;
  }
553610
public function declareCreation(string $table, array $columns)
    {
        $source = $this->method('up')->getSource();

        $source->addLine("\$this->table('{$table}')");
        foreach ($columns as $name => $type) {
            $source->addLine("    ->addColumn('{$name}', '{$type}')");
        }

        $source->addLine("    ->create();");

        $this->method('down')->getSource()->addString("\$this->table('{$table}')->drop();");
    }
1149850
public function setSize($size)
    {
        if (strpos($size, 'col-') === false) {
            $size = 'col-'.$size.'-';
        }

        $this->size = $size;

        return $this;
    }
377649
private function executeTableShowHeader(array $columns): void
  {
    $separator = '+';
    $header    = '|';

    foreach ($columns as $column)
    {
      $separator .= str_repeat('-', $column['length'] + 2).'+';
      $spaces    = ($column['length'] + 2) - mb_strlen((string)$column['header']);

      $spacesLeft  = (int)floor($spaces / 2);
      $spacesRight = (int)ceil($spaces / 2);

      $fillerLeft  = ($spacesLeft>0) ? str_repeat(' ', $spacesLeft) : '';
      $fillerRight = ($spacesRight>0) ? str_repeat(' ', $spacesRight) : '';

      $header .= $fillerLeft.$column['header'].$fillerRight.'|';
    }

    echo "\n", $separator, "\n";
    echo $header, "\n";
    echo $separator, "\n";
  }
617022
function reset($columns) {
        collapse();
        chain().removeClass(`${namespace}-selected`);
        breadcrumb();

        // Upon reset ensure no value is returned to the calling code.
        settings.reset($columns);
        if (settings.preview) {
            $(`.${namespace}-preview`).remove();
        }
    }
332110
protected function validateMinColumns($columnsSizes, Constraint $constraint)
    {
        if (null !== $constraint->minColumns) {
            if (!ctype_digit((string) $constraint->minColumns)) {
                throw new ConstraintDefinitionException(
                    sprintf(
                        '"%s" is not a valid column size',
                        $constraint->minColumns
                    )
                );
            }

            foreach ($columnsSizes as $size => $occurrences) {
                if (0 !== $size && $size < $constraint->minColumns) {
                    $this->context->addViolation(
                        $constraint->minColumnsMessage,
                        array(
                            '{{ min_columns }}' => $constraint->minColumns,
                            '{{ occurrences }}' => implode(',', $occurrences)
                        )
                    );

                    return true;
                }
            }
        }
    }
396371
public function setColumns(array $columns, $add = false) {
        if (!$add) {
            $this->columnDefinition = [];
        }
        foreach ($columns as $key => $def) {
            $this->addColumn($key, $def);
        }
        return $this;
    }