Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Update README.md #82

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f3cc963
Update README.md
jdanino Aug 15, 2022
f6e3644
Add a active-classes prop so the active element color can be configured
jdanino Aug 24, 2022
39efdbe
Add active-filters component
jdanino Aug 24, 2022
5ba89fa
count 0 filters as active
jdanino Aug 24, 2022
be35bd3
Merge branch 'feature/add-active-color-prop' into develop
jdanino Aug 24, 2022
abf550d
Merge branch 'feature/active-filters' into develop
jdanino Aug 24, 2022
b8f89e3
fix merge
jdanino Aug 24, 2022
a49e680
Add Contitional trait to table
jdanino Aug 31, 2022
cba9a43
Update composer.json
jdanino Dec 13, 2022
e9dce78
Support laravel 10
jdanino Feb 15, 2023
f745121
Update composer.json
jdanino Feb 15, 2023
425490f
Fix required parameter order
jdanino Feb 17, 2023
f80e4de
Make php 8.0 a requirement as its features are used in the code base
jdanino Feb 17, 2023
8654ccf
Merge branch 'develop' of https://github.com/jdanino/inertiajs-tables…
jdanino Feb 17, 2023
8cbf427
Merge branch 'develop'
jdanino Feb 17, 2023
7b6d106
add click event
sietzekeuning Mar 21, 2023
e628bb9
Fix styling
sietzekeuning Mar 21, 2023
8ef83fe
Merge pull request #1 from sietzekeuning/patch-1
jdanino Mar 21, 2023
104e809
update packages and add focus classes
sietzekeuning Mar 22, 2023
239e441
Update package.json
sietzekeuning Mar 22, 2023
3bda258
Merge pull request #2 from sietzekeuning/main
jdanino Mar 22, 2023
577184f
Merge branch 'jdanino:main' into main
sietzekeuning Mar 22, 2023
2ed1774
Merge pull request #3 from sietzekeuning/main
jdanino Mar 22, 2023
d1a4aa5
Update illuminate version
jdanino Apr 20, 2023
0c3006e
Laravel 11
sietzekeuning Apr 10, 2024
3f77a7a
Merge pull request #4 from sietzekeuning/patch-1
jdanino Apr 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,18 @@ The `Table` has some additional properties to tweak its front-end behaviour.
:prevent-overlapping-requests="false"
:input-debounce-ms="1000"
:prevent-scroll="true"
:active-classes="{text: 'text-red-500', border: 'border-red-300'}"
/>
</template>
```

| Property | Description | Default |
| --- | --- | --- |
| striped | Adds a *striped* layout to the table. | `false` |
| preventOverlappingRequests | Cancels a previous visit on new user input to prevent an inconsistent state. | `true` |
| inputDebounceMs | Number of ms to wait before refreshing the table on user input. | 350 |
| preventScroll | Configures the [Scroll preservation](https://inertiajs.com/scroll-management#scroll-preservation) behavior. You may also pass `table-top` to this property to scroll to the top of the table on new data. | false |
| Property | Description | Default |
|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|
| striped | Adds a *striped* layout to the table. | `false` |
| preventOverlappingRequests | Cancels a previous visit on new user input to prevent an inconsistent state. | `true` |
| inputDebounceMs | Number of ms to wait before refreshing the table on user input. | 350 |
| preventScroll | Configures the [Scroll preservation](https://inertiajs.com/scroll-management#scroll-preservation) behavior. You may also pass `table-top` to this property to scroll to the top of the table on new data. | false |
| activeClasses | Configures the CSS classes to apply on active elements like filters & column buttons and sorting indicator | {text: 'text-green-400', border: 'border-green-300' } |

#### Custom column cells

Expand Down
2,824 changes: 430 additions & 2,394 deletions app/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
}
],
"require": {
"php": "^7.4|^8.0|^8.1",
"illuminate/support": "^8.67|^v9.0.0-beta.4"
"php": "^8.0|^8.1|^8.2",
"illuminate/support": "^8.0|^9.0|^10.0|^11.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.8",
"inertiajs/inertia-laravel": "^0.5",
"inertiajs/inertia-laravel": "^0.6.9",
"orchestra/testbench": "^6.23|^7.0",
"phpunit/phpunit": "^9.4"
},
Expand Down
11 changes: 9 additions & 2 deletions js/Components/ButtonWithDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
:dusk="dusk"
:disabled="disabled"
class="w-full bg-white border rounded-md shadow-sm px-4 py-2 inline-flex justify-center text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
:class="{'border-green-300': active, 'border-gray-300': !active, 'cursor-not-allowed': disabled }"
:class="{
[activeClasses.border]: props.active,
'border-gray-300': !props.active,
'cursor-not-allowed': props.disabled
}"
aria-haspopup="true"
@click.prevent="toggle"
>
Expand All @@ -32,7 +36,7 @@ import OnClickOutside from "./OnClickOutside.vue";
import { createPopper } from "@popperjs/core/lib/popper-lite";
import preventOverflow from "@popperjs/core/lib/modifiers/preventOverflow";
import flip from "@popperjs/core/lib/modifiers/flip";
import { ref, watch, onMounted } from "vue";
import { ref, watch, onMounted, inject, computed } from "vue";

const props = defineProps({
placement: {
Expand Down Expand Up @@ -86,4 +90,7 @@ onMounted(() => {
});

defineExpose({ hide });

const activeClasses = inject("activeClasses");

</script>
9 changes: 7 additions & 2 deletions js/Components/HeaderCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class="w-3 h-3 ml-2"
:class="{
'text-gray-400': !cell.sorted,
'text-green-500': cell.sorted,
[activeClasses.text]: cell.sorted,
}"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 320 512"
Expand Down Expand Up @@ -49,16 +49,21 @@
</template>

<script setup>

import { inject } from "vue";

const props = defineProps({
cell: {
type: Object,
required: true,
},
});

const activeClasses = inject("activeClasses");

function onClick() {
if (props.cell.sortable) {
props.cell.onSort(props.cell.key);
}
}
</script>
</script>
Loading