Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/contributte/datagrid
Browse files Browse the repository at this point in the history
  • Loading branch information
paveljanda committed Jul 5, 2019
2 parents 71a8ab3 + 8902371 commit 4b21655
Show file tree
Hide file tree
Showing 33 changed files with 303 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Table of contents
- [Introduction](index.md)
- [Data sources](data-sources.md)
- [Columns](columns.md)
- [Filter](filter.md)
- [Filters](filters.md)
- [Actions](actions.md)
- [Group action](group-action.md)
- [Row](row.md)
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ Supported features: filtering, sorting, pagination, tree view, table view, trans

| State | Version | Branch | Nette | PHP |
|-------------|-----------|----------|-------|----------|
| stable | `^6.0.0` | `master` | >=3.0 | `>= 7.2` |
| stable | `^5.7.1` | `v5.x` | >=2.3 | `>= 5.6` |
| stable | `^4.4.22` | `v5.x` | >=2.3 | `>= 5.6` |
| stable | `^3.3.1` | `v5.x` | >=2.3 | `>= 5.3` |
| dev | `^6.2.0` | `master` | >=3.0 | `^7.2` |
| stable | `^6.1.0` | `master` | >=3.0 | `^7.2` |
| stable | `^5.7.1` | `v5.x` | >=2.3 | `^5.6` |
| stable | `^4.4.22` | `v5.x` | >=2.3 | `^5.6` |
| stable | `^3.3.1` | `v5.x` | >=2.3 | `^5.3` |

## Maintainers

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "6.1.x-dev"
"dev-master": "6.2.x-dev"
}
},
"prefer-stable": true,
Expand Down
3 changes: 3 additions & 0 deletions src/AggregationFunction/FunctionSum.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public function renderResult()
}


/**
* @return static
*/
public function setRenderer(?callable $callback = null): self
{
$this->renderer = $callback;
Expand Down
2 changes: 2 additions & 0 deletions src/AggregationFunction/TDataGridAggregationFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ trait TDataGridAggregationFunction
private $multipleAggregationFunction = null;

/**
* @return static
* @throws DataGridException
*/
public function addAggregationFunction(
Expand Down Expand Up @@ -58,6 +59,7 @@ public function addAggregationFunction(


/**
* @return static
* @throws DataGridException
*/
public function setMultipleAggregationFunction(
Expand Down
16 changes: 16 additions & 0 deletions src/Column/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ public function render(Row $row)
}


/**
* @return static
*/
public function addParameters(array $parameters): self
{
$this->parameters = $parameters;
Expand All @@ -166,6 +169,7 @@ public function addParameters(array $parameters): self

/**
* @param string|callable $title
* @return static
* @throws DataGridException
*/
public function setTitle($title): self
Expand All @@ -192,6 +196,7 @@ public function getTitle(Row $row): ?string

/**
* @param string|callable $class
* @return static
* @throws DataGridException
*/
public function setClass($class): self
Expand All @@ -218,6 +223,7 @@ public function getClass(Row $row): ?string

/**
* @param string|callable $icon
* @return static
* @throws DataGridException
*/
public function setIcon($icon): self
Expand All @@ -242,6 +248,9 @@ public function getIcon(Row $row): ?string
}


/**
* @return static
*/
public function setConfirmation(IConfirmation $confirmation): self
{
$this->confirmation = $confirmation;
Expand Down Expand Up @@ -281,6 +290,7 @@ public function getConfirmationDialog(Row $row): ?string

/**
* @param mixed $value
* @return static
*/
public function setDataAttribute(string $key, $value): self
{
Expand All @@ -290,6 +300,9 @@ public function setDataAttribute(string $key, $value): self
}


/**
* @return static
*/
public function addAttributes(array $attrs): self
{
$this->attributes += $attrs;
Expand Down Expand Up @@ -352,6 +365,9 @@ public function isOpenInNewTab(): bool
}


/**
* @return static
*/
public function setOpenInNewTab(bool $openInNewTab = true): self
{
$this->openInNewTab = $openInNewTab;
Expand Down
40 changes: 39 additions & 1 deletion src/Column/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ public function render(Row $row)

/**
* Should be column values escaped in latte?
*
* @return static
*/
public function setTemplateEscaping(bool $templateEscaping = true): self
{
Expand All @@ -141,6 +143,8 @@ public function isTemplateEscaped(): bool

/**
* Should be column header escaped in latte?
*
* @return static
*/
public function setHeaderEscaping(bool $headerEscaping = false): self
{
Expand All @@ -160,6 +164,7 @@ public function isHeaderEscaped(): bool
* Set column sortable or not
*
* @param bool|string $sortable
* @return static
*/
public function setSortable($sortable = true): self
{
Expand All @@ -186,6 +191,8 @@ public function isSortable(): bool

/**
* Set column translatable or not
*
* @return static
*/
public function setTranslatableHeader(bool $translatableHeader = true): self
{
Expand All @@ -206,6 +213,8 @@ public function isTranslatableHeader(): bool

/**
* Shoud be the pagination reseted after sorting?
*
* @return static
*/
public function setSortableResetPagination(bool $sortableResetPagination = true): self
{
Expand All @@ -226,6 +235,8 @@ public function sortableResetPagination(): bool

/**
* Set custom ORDER BY clause
*
* @return static
*/
public function setSortableCallback(callable $sortableCallback): self
{
Expand Down Expand Up @@ -275,6 +286,8 @@ public function getName(): string

/**
* Column may have its own template
*
* @return static
*/
public function setTemplate(string $template, array $templateVariables = []): self
{
Expand Down Expand Up @@ -323,6 +336,8 @@ public function isSortedBy(): bool

/**
* Tell column his sorting options
*
* @return static
*/
public function setSort(string $sort): self
{
Expand Down Expand Up @@ -369,6 +384,8 @@ public function isSortAsc(): bool

/**
* Set column alignment
*
* @return static
*/
public function setAlign(string $align): self
{
Expand Down Expand Up @@ -396,6 +413,9 @@ public function getAlign(): string
}


/**
* @return static
*/
public function setFitContent(bool $fitContent = true): self
{
$fitContent
Expand All @@ -408,6 +428,8 @@ public function setFitContent(bool $fitContent = true): self

/**
* Set callback that will be called after inline editing
*
* @return static
*/
public function setEditableCallback(callable $editableCallback): self
{
Expand All @@ -428,6 +450,8 @@ public function getEditableCallback(): ?callable

/**
* Set inline editing just if condition is truthy
*
* @return static
*/
public function setEditableOnConditionCallback(callable $editableConditionCallback): self
{
Expand Down Expand Up @@ -463,6 +487,8 @@ public function isEditable(?Row $row = null): bool

/**
* Element is by default textarea, user can change that
*
* @return static
*/
public function setEditableInputType(string $elType, array $attrs = []): self
{
Expand All @@ -474,6 +500,8 @@ public function setEditableInputType(string $elType, array $attrs = []): self

/**
* Change small inline edit input type to select
*
* @return static
*/
public function setEditableInputTypeSelect(array $options = [], array $attrs = []): self
{
Expand All @@ -491,6 +519,9 @@ public function setEditableInputTypeSelect(array $options = [], array $attrs = [
}


/**
* @return static
*/
public function setEditableValueCallback(callable $editableValueCallback): self
{
$this->editableValueCallback = $editableValueCallback;
Expand All @@ -513,6 +544,8 @@ public function getEditableInputType(): array

/**
* Set attributes for both th and td element
*
* @return static
*/
public function addCellAttributes(array $attrs): self
{
Expand Down Expand Up @@ -578,6 +611,9 @@ public function getElementForRender(string $tag, string $key, ?Row $row = null):
}


/**
* @return static
*/
public function setDefaultHide(bool $defaultHide = true): self
{
$this->defaultHide = $defaultHide;
Expand Down Expand Up @@ -616,7 +652,9 @@ public function getColumn(): string
return $this->column;
}


/**
* @return static
*/
public function setReplacement(array $replacements): self
{
$this->replacements = $replacements;
Expand Down
3 changes: 3 additions & 0 deletions src/Column/ColumnDateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public function getColumnValue(Row $row): string
}


/**
* @return static
*/
public function setFormat(string $format): self
{
$this->format = $format;
Expand Down
16 changes: 16 additions & 0 deletions src/Column/ColumnLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ public function render(Row $row)
}


/**
* @return static
*/
public function addParameters(array $parameters): self
{
$this->parameters = $parameters;
Expand All @@ -146,6 +149,9 @@ public function addParameters(array $parameters): self
}


/**
* @return static
*/
public function setIcon(?string $icon = null): self
{
$this->icon = $icon;
Expand All @@ -156,6 +162,7 @@ public function setIcon(?string $icon = null): self

/**
* @param mixed $value
* @return static
*/
public function setDataAttribute(string $key, $value): self
{
Expand All @@ -165,6 +172,9 @@ public function setDataAttribute(string $key, $value): self
}


/**
* @return static
*/
public function setTitle(string $title): self
{
$this->title = $title;
Expand All @@ -179,6 +189,9 @@ public function getTitle(): ?string
}


/**
* @return static
*/
public function setClass(?string $class): self
{
$this->class = $class;
Expand All @@ -199,6 +212,9 @@ public function isOpenInNewTab(): bool
}


/**
* @return static
*/
public function setOpenInNewTab(bool $openInNewTab = true): self
{
$this->openInNewTab = $openInNewTab;
Expand Down
3 changes: 3 additions & 0 deletions src/Column/ColumnNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public function getColumnValue(Row $row)
}


/**
* @return static
*/
public function setFormat(
int $decimals = 0,
string $decPoint = '.',
Expand Down
2 changes: 2 additions & 0 deletions src/Column/ColumnStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ public function addOption($value, string $text): Option

/**
* Set all options at once
*
* @return static
*/
public function setOptions(array $options): self
{
Expand Down
Loading

0 comments on commit 4b21655

Please sign in to comment.