Skip to content

Commit c85fa91

Browse files
committed
Rew
1 parent bcb3b3b commit c85fa91

File tree

67 files changed

+1233
-162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1233
-162
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +0,0 @@
1-
parameters:
2-
ignoreErrors:
3-
-
4-
message: '#^Offset ''1'' on array\<string, non\-empty\-list\> in empty\(\) does not exist\.$#'
5-
identifier: empty.offset
6-
count: 1
7-
path: src/DataTableComponent.php
8-
9-
-
10-
message: '#^Offset ''99'' on array\<string, non\-empty\-list\> in isset\(\) does not exist\.$#'
11-
identifier: isset.offset
12-
count: 1
13-
path: src/DataTableComponent.php
14-
15-
-
16-
message: '#^Offset ''99'' on non\-empty\-array\<1\|string, list\> in isset\(\) does not exist\.$#'
17-
identifier: isset.offset
18-
count: 1
19-
path: src/DataTableComponent.php
20-
21-
-
22-
message: '#^Parameter \#1 \$view of function view expects view\-string\|null, string given\.$#'
23-
identifier: argument.type
24-
count: 1
25-
path: src/DataTableComponent.php
26-
27-
-
28-
message: '#^Property Rappasoft\\LaravelLivewireTables\\DataTableComponent\:\:\$model has no type specified\.$#'
29-
identifier: missingType.property
30-
count: 1
31-
path: src/DataTableComponent.php
32-
33-
-
34-
message: '#^Parameter \#1 \$view of function view expects view\-string\|null, string given\.$#'
35-
identifier: argument.type
36-
count: 1
37-
path: src/View/Components/FilterPill.php
38-
39-
-
40-
message: '#^Unsafe usage of new static\(\)\.$#'
41-
identifier: new.static
42-
count: 1
43-
path: src/Views/Action.php
44-
45-
-
46-
message: '#^Unsafe usage of new static\(\)\.$#'
47-
identifier: new.static
48-
count: 1
49-
path: src/Views/Column.php
50-
51-
-
52-
message: '#^Unsafe usage of new static\(\)\.$#'
53-
identifier: new.static
54-
count: 1
55-
path: src/Views/Filter.php
56-
57-
-
58-
message: '#^Parameter \#1 \$callback of method Illuminate\\Support\\Collection\<int,string\>\:\:filter\(\) expects \(callable\(string, int\)\: bool\)\|null, Closure\(mixed\)\: int\<0, max\> given\.$#'
59-
identifier: argument.type
60-
count: 1
61-
path: src/Views/Filters/MultiSelectDropdownFilter.php
62-
63-
-
64-
message: '#^Unable to resolve the template type TMapWithKeysKey in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#'
65-
identifier: argument.templateType
66-
count: 1
67-
path: src/Views/Filters/MultiSelectDropdownFilter.php
68-
69-
-
70-
message: '#^Unable to resolve the template type TMapWithKeysValue in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#'
71-
identifier: argument.templateType
72-
count: 1
73-
path: src/Views/Filters/MultiSelectDropdownFilter.php
74-
75-
-
76-
message: '#^Parameter \#1 \$callback of method Illuminate\\Support\\Collection\<int,string\>\:\:filter\(\) expects \(callable\(string, int\)\: bool\)\|null, Closure\(mixed\)\: int\<0, max\> given\.$#'
77-
identifier: argument.type
78-
count: 1
79-
path: src/Views/Filters/MultiSelectFilter.php
80-
81-
-
82-
message: '#^Parameter \#1 \$callback of method Illuminate\\Support\\Collection\<int,string\>\:\:filter\(\) expects \(callable\(string, int\)\: bool\)\|null, Closure\(mixed\)\: int\<0, max\> given\.$#'
83-
identifier: argument.type
84-
count: 1
85-
path: src/Views/Filters/NumberRangeFilter.php
86-
87-
-
88-
message: '#^Unable to resolve the template type TMapWithKeysKey in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#'
89-
identifier: argument.templateType
90-
count: 1
91-
path: src/Views/Filters/SelectFilter.php
92-
93-
-
94-
message: '#^Unable to resolve the template type TMapWithKeysValue in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#'
95-
identifier: argument.templateType
96-
count: 1
97-
path: src/Views/Filters/SelectFilter.php

phpstan.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ parameters:
1313
treatPhpDocTypesAsCertain: false
1414
reportUnmatchedIgnoredErrors: false
1515
ignoreErrors:
16-
- identifier: missingType.generics
17-
- identifier: missingType.iterableValue
1816
- identifier: trait.unused
1917
- identifier: deadCode.unreachable
2018
- identifier: booleanNot.alwaysTrue

resources/js/partials/core/tools.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*jshint esversion: 6 */
22

3-
function toolbar() {
4-
Alpine.data('toolbar', (wire) => ({
3+
function tools() {
4+
Alpine.data('tools', (wire) => ({
55
filtersOpen: wire.entangle('filterSlideDownDefaultVisible'),
66
externalFilterPillsVals: wire.entangle('externalFilterPillsValues'),
77
internalFilterPillsVals: wire.entangle('internalFilterPillsVals'),
@@ -10,6 +10,7 @@ function toolbar() {
1010
showFilterPillsSection: true,
1111
resetSpecificFilter(filterKey)
1212
{
13+
console.log("tools - resetSpecificFilter");
1314
this.externalFilterPillsVals[filterKey] = [];
1415
wire.call('resetFilter',filterKey);
1516
},
@@ -79,9 +80,9 @@ function toolbar() {
7980
showFilterPillsSeparator(filterKey,index)
8081
{
8182
return ((index+1) < (this.getFilterPillsLength(filterKey)));
82-
},
83+
}
8384

8485
}));
8586
}
8687

87-
export default toolbar;
88+
export default tools;

resources/js/partials/core/tools.min.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ function tools() {
1111
resetSpecificFilter(filterKey)
1212
{
1313
console.log("tools - resetSpecificFilter");
14+
this.internalFilterPillsVals[filterKey] = [];
1415
this.externalFilterPillsVals[filterKey] = [];
15-
this.$wire.call('resetFilter',filterKey);
16+
wire.call('resetFilter',filterKey);
1617
},
1718
resetAllFilters()
1819
{
1920
this.externalFilterPillsVals = [];
20-
this.$wire.call('setFilterDefaults');
21+
wire.call('setFilterDefaults');
2122
},
2223
setInternalFilterPillVal(filterKey, filterValues)
2324
{

resources/js/partials/filters/boolean.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,29 @@ function newBf() {
3737

3838
this.listeners.push(
3939
Livewire.on('filter-was-set', (detail) => {
40-
if(detail.tableName == this.tableName && detail.filterKey == this.booleanFilterKey) {
41-
this.switchOn = detail.value ?? defaultValue;
40+
console.log('filter-was-set-in-boolean');
41+
console.log('detail');
42+
console.log(detail);
43+
44+
if(detail.tableName == tableName && detail.filterKey == this.booleanFilterKey) {
45+
console.log('applies-to-this-table');
46+
console.log('typeof');
47+
console.log(typeof detail.value);
48+
console.log(detail.value);
49+
50+
if(typeof detail.value === null || detail.value === null)
51+
{
52+
console.log("Null Setting to False");
53+
this.value = this.switchOn = false;
54+
}
55+
else
56+
{
57+
let number = Number(detail.value ?? 0);
58+
let boolVal = Boolean(number);
59+
console.log("Setting to "+boolVal);
60+
this.value = this.switchOn = boolVal;
61+
this.setSwitchOn(number);
62+
}
4263
}
4364
})
4465
);

resources/lang/php/en/core.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
'Columns' => 'Columns',
1313
'Debugging Values' => 'Debugging Values',
1414
'Deselect All' => 'Deselect All',
15+
'Disabled' => 'Disabled',
1516
'Done Reordering' => 'Done Reordering',
17+
'Enabled' => 'Enabled',
1618
'Filters' => 'Filters',
1719
'Loading' => 'Loading',
1820
'max' => 'Max',

resources/views/components/tools/tools.blade.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,6 @@
1717
->except(['default','default-styling','default-colors'])
1818
}}
1919
>
20-
<div><div>Test124561</div>
21-
<div class="flex flex-row">
22-
<template x-for="(value, index) in internalFilterPillsVals">
23-
<div class="flex flex-col">
24-
<div><span x-text="index"></span></div>
25-
<div class="flex flex-row">
26-
27-
<template x-for="(value2, index2) in value">
28-
<div class="flex flex-col">
29-
<div><span x-text="index2"></span>:</div>
30-
<div><span x-text="value2"></span></div>
31-
</div>
32-
</template>
33-
</div>
34-
</div>
35-
</template>
36-
</ul>
37-
</div>
3820
@if ($this->showSortPillsSection())
3921
<x-livewire-tables::tools.sorting-pills />
4022
@endif

src/Commands/MakeCommand.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,14 @@ public function getModelImport(): string
141141
return 'App\Models\\'.$this->model;
142142
}
143143

144-
/*
145-
* Credits to Harm Smits: https://stackoverflow.com/a/67099502/2263114
146-
*/
144+
/**
145+
* Undocumented function
146+
* Credits to Harm Smits: https://stackoverflow.com/a/67099502/2263114
147+
*
148+
* @param string $file
149+
*
150+
* @return array<mixed>
151+
*/
147152
private function getClassesList(string $file): array
148153
{
149154
$classes = [];

src/DataTransferObjects/DebuggableData.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ public function __construct(DataTableComponent $component)
1313
$this->component = $component;
1414
}
1515

16+
/**
17+
* Undocumented function
18+
*
19+
* @return array<mixed>
20+
*/
1621
public function toArray(): array
1722
{
1823
return [

src/DataTransferObjects/FilterGenericData.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ public function __construct(string $tableName, string $filterLayout, bool $isTai
2626
$this->isBootstrap5 = $isBootstrap5;
2727
}
2828

29+
/**
30+
* Undocumented function
31+
*
32+
* @return array<mixed>
33+
*/
2934
public function toArray(): array
3035
{
3136
return [

0 commit comments

Comments
 (0)