Skip to content

Commit 62c3ef9

Browse files
committed
Further Beta Testing
1 parent 5e305ba commit 62c3ef9

File tree

56 files changed

+1148
-120
lines changed

Some content is hidden

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

56 files changed

+1148
-120
lines changed

docs/columns/available-methods.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,34 @@ Column::make('Name')
316316
->hideOnReorder()
317317
```
318318

319+
### Obscuring Values
320+
321+
If you would like to mask the data displayed for a given column, then you can utilise the new 'setShouldObscureEnabled' method.
322+
323+
This masks the data displayed, until the mask is clicked, at which point it displays as normal.
324+
325+
Note: The data is still returned, and accessible via the browser. This *should not* be utilised to hide data from the end-user. If this is required, then the format() method is recommended.
326+
327+
Supported methods are:
328+
329+
#### Default Click Behaviour
330+
This is enabled by default when Obscuration is enabled.
331+
332+
##### setObscureDefaultClickBehaviourEnabled
333+
Enables the default on-click toggle for the masking
334+
335+
##### setObscureDefaultClickBehaviourDisabled
336+
Disables the default on-click toggle for the masking, you can utilise the Custom Attributes methods if you wish to customise the behaviour.
337+
338+
339+
340+
341+
```php
342+
Column::make('Name')
343+
->setShouldObscureEnabled()
344+
```
345+
346+
319347

320348

321349
## See Also

phpstan-baseline.neon

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Call to function method_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\DataTableComponent\) and ''applyFilters'' will always evaluate to true\.$#'
5+
identifier: function.alreadyNarrowedType
6+
count: 2
7+
path: src/DataTableComponent.php
8+
9+
-
10+
message: '#^Call to function method_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\DataTableComponent\) and ''applySearch'' will always evaluate to true\.$#'
11+
identifier: function.alreadyNarrowedType
12+
count: 1
13+
path: src/DataTableComponent.php
14+
15+
-
16+
message: '#^Call to function method_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\DataTableComponent\) and ''filtersAreEnabled'' will always evaluate to true\.$#'
17+
identifier: function.alreadyNarrowedType
18+
count: 1
19+
path: src/DataTableComponent.php
20+
21+
-
22+
message: '#^Call to function method_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\DataTableComponent\) and ''getFilterGenericData'' will always evaluate to true\.$#'
23+
identifier: function.alreadyNarrowedType
24+
count: 1
25+
path: src/DataTableComponent.php
26+
27+
-
28+
message: '#^Call to function method_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\DataTableComponent\) and ''hasSearch'' will always evaluate to true\.$#'
29+
identifier: function.alreadyNarrowedType
30+
count: 1
31+
path: src/DataTableComponent.php
32+
33+
-
34+
message: '#^Call to function method_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\DataTableComponent\) and ''isFilterLayoutSlide…'' will always evaluate to true\.$#'
35+
identifier: function.alreadyNarrowedType
36+
count: 2
37+
path: src/DataTableComponent.php
38+
39+
-
40+
message: '#^Call to function method_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\DataTableComponent\) and ''searchIsEnabled'' will always evaluate to true\.$#'
41+
identifier: function.alreadyNarrowedType
42+
count: 1
43+
path: src/DataTableComponent.php
44+
45+
-
46+
message: '#^Call to function method_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\DataTableComponent\) and ''searchVisibilityIsE…'' will always evaluate to true\.$#'
47+
identifier: function.alreadyNarrowedType
48+
count: 1
49+
path: src/DataTableComponent.php
50+
51+
-
52+
message: '#^Call to function method_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\DataTableComponent\) and ''showFilterPillsSect…'' will always evaluate to true\.$#'
53+
identifier: function.alreadyNarrowedType
54+
count: 1
55+
path: src/DataTableComponent.php
56+
57+
-
58+
message: '#^Call to function method_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\DataTableComponent\) and ''showFiltersButton'' will always evaluate to true\.$#'
59+
identifier: function.alreadyNarrowedType
60+
count: 1
61+
path: src/DataTableComponent.php
62+
63+
-
64+
message: '#^Call to function method_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\DataTableComponent\) and ''showReorderButton'' will always evaluate to true\.$#'
65+
identifier: function.alreadyNarrowedType
66+
count: 1
67+
path: src/DataTableComponent.php
68+
69+
-
70+
message: '#^Call to function method_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\DataTableComponent\) and ''showSearchField'' will always evaluate to true\.$#'
71+
identifier: function.alreadyNarrowedType
72+
count: 1
73+
path: src/DataTableComponent.php
74+
75+
-
76+
message: '#^Call to function method_exists\(\) with Rappasoft\\LaravelLivewireTables\\DataTableComponent and ''getSearch'' will always evaluate to true\.$#'
77+
identifier: function.alreadyNarrowedType
78+
count: 1
79+
path: src/DataTransferObjects/DebuggableData.php
80+
81+
-
82+
message: '#^Call to function property_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\Features\\Filters\\Views\\DateRangeFilter\) and ''optionsPath'' will always evaluate to true\.$#'
83+
identifier: function.alreadyNarrowedType
84+
count: 1
85+
path: src/Features/Filters/Views/DateRangeFilter.php
86+
87+
-
88+
message: '#^Call to function is_string\(\) with string will always evaluate to true\.$#'
89+
identifier: function.alreadyNarrowedType
90+
count: 1
91+
path: src/Features/Filters/Views/MultiSelectDropdownFilter.php
92+
93+
-
94+
message: '#^Call to function property_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\Features\\Filters\\Views\\MultiSelectDropdownFilter\) and ''optionsPath'' will always evaluate to true\.$#'
95+
identifier: function.alreadyNarrowedType
96+
count: 1
97+
path: src/Features/Filters/Views/MultiSelectDropdownFilter.php
98+
99+
-
100+
message: '#^Call to function property_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\Features\\Filters\\Views\\MultiSelectFilter\) and ''optionsPath'' will always evaluate to true\.$#'
101+
identifier: function.alreadyNarrowedType
102+
count: 1
103+
path: src/Features/Filters/Views/MultiSelectFilter.php
104+
105+
-
106+
message: '#^Call to function property_exists\(\) with \$this\(Rappasoft\\LaravelLivewireTables\\Features\\Filters\\Views\\SelectFilter\) and ''optionsPath'' will always evaluate to true\.$#'
107+
identifier: function.alreadyNarrowedType
108+
count: 1
109+
path: src/Features/Filters/Views/SelectFilter.php

phpstan.neon

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
includes:
22
- vendor/larastan/larastan/extension.neon
33
- phpstan-baseline.neon
4-
4+
55
parameters:
66
paths:
77
- database
@@ -13,10 +13,11 @@ parameters:
1313
treatPhpDocTypesAsCertain: false
1414
reportUnmatchedIgnoredErrors: false
1515
ignoreErrors:
16-
- identifier: argument.type
1716
- identifier: argument.templateType
17+
paths:
18+
- src/Features/Filters/Views/MultiSelectDropdownFilter.php
19+
- src/Features/Filters/Views/SelectFilter.php
1820
- identifier: new.static
19-
- identifier: function.alreadyNarrowedType
2021
- identifier: missingType.generics
2122
paths:
2223
- src/Traits/WithData.php

resources/js/partials/core/externalFilter.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,34 @@ function externalFilter() {
1212
selectedItems: wire.entangle('selectedItems'),
1313
sendValueToPill(value)
1414
{
15+
console.log('tablesExternalFilter - sendValueToPill');
1516
let sentValue = this.removeHTMLTags(value);
17+
console.log(sentValue);
1618
this.$dispatch('filterpillupdate', { dataTableFingerprint: this.dataTableFingerprint, filterKey: this.externalFilterKey, pillItem: sentValue });
1719
},
1820
overridePill(values)
1921
{
22+
console.log('tablesExternalFilter - overridePill');
2023
let sentValue = this.removeHTMLTags(values);
24+
console.log(sentValue);
2125
this.$dispatch('filterpillupdate', { dataTableFingerprint: this.dataTableFingerprint, filterKey: this.externalFilterKey, pillItem: sentValue });
2226
},
2327
syncItems(items) {
28+
console.log('tablesExternalFilter - syncItems');
29+
console.log('items');
30+
console.log(items);
31+
32+
2433
this.pillValues = [];
2534
items.forEach((item) => {
2635
this.pillValues.push(this.optionsAvailable[item]);
2736
});
2837
if(this.pillValues.length > 0)
2938
{
3039
this.pillValues.sort();
40+
console.log('tablesExternalFilter - syncItems - syncExternalFilterPillsValues');
41+
console.log('this.externalFilterKey: '+this.externalFilterKey);
42+
console.log('this.pillValues: '+this.pillValues);
3143
this.syncExternalFilterPillsValues(this.externalFilterKey,this.pillValues);
3244
}
3345
this.optionsSelected = this.selectedItems;
Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,57 @@
11
/*jshint esversion: 6 */
2-
function externalFilter(){Alpine.data("tablesExternalFilter",(e,t)=>({externalFilterKey:t,pillValues:[],optionsAvailable:e.entangle("optionsAvailable"),optionsSelected:e.entangle("optionsSelected").live,selectedItems:e.entangle("selectedItems"),sendValueToPill(e){let t=this.removeHTMLTags(e);this.$dispatch("filterpillupdate",{dataTableFingerprint:this.dataTableFingerprint,filterKey:this.externalFilterKey,pillItem:t})},overridePill(e){let t=this.removeHTMLTags(e);this.$dispatch("filterpillupdate",{dataTableFingerprint:this.dataTableFingerprint,filterKey:this.externalFilterKey,pillItem:t})},syncItems(t){this.pillValues=[],t.forEach(e=>{this.pillValues.push(this.optionsAvailable[e])}),this.pillValues.length>0&&(this.pillValues.sort(),this.syncExternalFilterPillsValues(this.externalFilterKey,this.pillValues)),this.optionsSelected=this.selectedItems,e.set("value",this.selectedItems)},init(){this.selectedItems=this.optionsSelected,this.syncItems(this.selectedItems),this.$watch("selectedItems",e=>this.syncItems(e))}}))}export default externalFilter;
2+
3+
function externalFilter() {
4+
5+
6+
7+
Alpine.data('tablesExternalFilter', (wire, filterKey) => ({
8+
externalFilterKey: filterKey,
9+
pillValues: [],
10+
optionsAvailable: wire.entangle('optionsAvailable'),
11+
optionsSelected: wire.entangle('optionsSelected').live,
12+
selectedItems: wire.entangle('selectedItems'),
13+
sendValueToPill(value)
14+
{
15+
console.log('tablesExternalFilter - sendValueToPill');
16+
let sentValue = this.removeHTMLTags(value);
17+
console.log(sentValue);
18+
this.$dispatch('filterpillupdate', { dataTableFingerprint: this.dataTableFingerprint, filterKey: this.externalFilterKey, pillItem: sentValue });
19+
},
20+
overridePill(values)
21+
{
22+
console.log('tablesExternalFilter - overridePill');
23+
let sentValue = this.removeHTMLTags(values);
24+
console.log(sentValue);
25+
this.$dispatch('filterpillupdate', { dataTableFingerprint: this.dataTableFingerprint, filterKey: this.externalFilterKey, pillItem: sentValue });
26+
},
27+
syncItems(items) {
28+
console.log('tablesExternalFilterMin - syncItems');
29+
console.log('items');
30+
console.log(items);
31+
32+
33+
this.pillValues = [];
34+
items.forEach((item) => {
35+
this.pillValues.push(this.optionsAvailable[item]);
36+
});
37+
if(this.pillValues.length > 0)
38+
{
39+
this.pillValues.sort();
40+
console.log('tablesExternalFilter - syncItems - syncExternalFilterPillsValues');
41+
console.log('this.externalFilterKey: '+this.externalFilterKey);
42+
console.log('this.pillValues: '+this.pillValues);
43+
this.syncExternalFilterPillsValues(this.externalFilterKey,this.pillValues);
44+
}
45+
this.optionsSelected = this.selectedItems;
46+
wire.set('value', this.selectedItems);
47+
48+
},
49+
init() {
50+
this.selectedItems = this.optionsSelected;
51+
this.syncItems(this.selectedItems);
52+
this.$watch('selectedItems', value => this.syncItems(value));
53+
}
54+
}));
55+
}
56+
57+
export default externalFilter;

resources/js/partials/core/filterPills.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ function filterPills() {
1414
displayString: '',
1515
generateLocalFilterPillImplodedValues(filterPillValues)
1616
{
17+
console.log('filterPillsHandler - generateLocalFilterPillImplodedValues');
18+
console.log(filterPillValues);
19+
1720
if(typeof(filterPillValues) !== 'undefined')
1821
{
1922
var temporarySeparatorString = '---tablepillsseparator---';
@@ -56,17 +59,28 @@ function filterPills() {
5659
},
5760
trigger: {
5861
['@filterpillupdate.window'](event) {
62+
console.log('filterpillupdate');
63+
console.log(event);
5964
this.watchForUpdateEvent(event);
6065
},
6166
},
6267
checkEventIsValid(eventdataTableFingerprint, eventFilterKey)
6368
{
69+
console.log('localDataFingerprint: '+this.dataTableFingerprint);
70+
console.log('eventdataTableFingerprint: '+eventdataTableFingerprint);
71+
console.log('localFilterKey: '+this.localFilterKey);
72+
console.log('eventFilterKey: '+eventFilterKey);
73+
6474
return ((this.dataTableFingerprint === eventdataTableFingerprint) && (this.localFilterKey === eventFilterKey));
6575
},
6676
watchForUpdateEvent(event)
6777
{
78+
console.log('filterPillsHandler - watchForUpdateEvent');
79+
6880
if(this.checkEventIsValid(event.detail.dataTableFingerprint ?? '', event.detail.filterKey ?? ''))
6981
{
82+
console.log('filterPillsHandler - watchForUpdateEvent - Valid');
83+
7084
let eventPillItem = event.detail.pillItem ?? '';
7185
if(!this.shouldRenderAsHTML)
7286
{
@@ -88,9 +102,16 @@ function filterPills() {
88102
}
89103
}
90104
}
105+
else
106+
{
107+
console.log('filterPillsHandler - watchForUpdateEvent - Invalid');
108+
}
91109
},
92110
updatePillValues(filterPillValues)
93111
{
112+
console.log('filterPillsHandler - updatePillValues');
113+
console.log(filterPillValues);
114+
94115
this.pillValues = filterPillValues;
95116
this.displayString = this.generateLocalFilterPillImplodedValues(filterPillValues);
96117
this.updatePillHasValues();
@@ -114,15 +135,25 @@ function filterPills() {
114135
this.$nextTick(() => {
115136
if(this.isExternalFilter)
116137
{
138+
console.log('isExternal Filter');
139+
console.log('localFilterKey: '+ this.localFilterKey);
117140
this.updatePillValues(this.externalFilterPillsVals[this.localFilterKey]);
118141
}
119142
else
120143
{
144+
console.log('is NOT External Filter');
145+
console.log('pillValues: '+ this.pillValues);
146+
121147
this.updatePillValues(this.pillValues);
122148
}
123149
});
124150
if(this.isExternalFilter && this.shouldWatchPillValues)
125151
{
152+
console.log('externalPillValsWatcher: '+this.localFilterKey);
153+
console.log('externalPillValsWatcher: '+this.localFilterKey);
154+
console.log('wired: '+'externalFilterPillsVals.'+this.localFilterKey);
155+
console.log('test: '+this.externalFilterPillsVals[this.localFilterKey]);
156+
126157
this.$watch('externalFilterPillsVals.'+this.localFilterKey, filterPillValues => {
127158
this.updatePillValues(filterPillValues);
128159
});

0 commit comments

Comments
 (0)