From 6736c1a085ca7df3c9c42fb2cb23cca9f3dd6b91 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Nov 2024 00:23:33 +0000 Subject: [PATCH] Development to Master v3.5.0 (#2026) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add explanation of setRefreshMethod (#1857) * Unlocking Entangled Items (#1859) * Unlock properties locked in error --------- Co-authored-by: lrljoe * Add dispatch on updated filter components (#1861) * Add additional dispatch * Add FilterApplied Event * Add Filter Event Dispatch Tests --------- Co-authored-by: lrljoe * v3.4.8 * Fix superfluous bulk actions tr < (#1868) * Default useComputedProperties to False (#1869) * Update ChangeLog * Add Action Buttons (#1864) * Make ActionButtons An Optional Feature in Beta --------- Co-authored-by: lrljoe * FixDateRangeFilter (#1872) * Adjust Methods - useComputedProperties (#1873) * Adjust Methods - useComputedProperties * Adjust ActionTest * Update ChangeLog * AllowDeleteDateRangeFilter (#1875) * Fix ChangeLog * Update Docs (#1876) * Update ChangeLog - Add Docs Update * Add setIconLeft/setIconRight (#1877) * Add setIconLeft/setIconRight * Fix styling * Adjust Test * Adjust ActionTest --------- Co-authored-by: lrljoe * Adjust ChangeLog * Adjust Action Button Icon Margin (#1880) * Adjust Action Button Icon Margin * Adjust ChangeLog * Change Order of "Getting Started" section (#1883) * Change Order of "Getting Started" section * Change to "UsersTable" * Add Button with No Icon (#1887) * Add a "Recommended" approach (#1886) * Add a "Recommended" approach * Add blurb to Recommended * v3.4.13 * Set actions position (#1889) * Add displayActionsInToolbar and actionsPosition * Add docs and tests for setActionsInToolbar * Fix styling --------- Co-authored-by: lrljoe * Update ChangeLog * Doc Type Fixes (#1891) * Update NumberFilter and TypeHints * Update DateFilter/DateTimeFilter and ConfigurableAreasHelpers for typehints and array key exists * Add Float Test for NumberFilter * Add ColorColumn View Test * Adjust ColumnSelectConfigurationTest --------- Co-authored-by: lrljoe * BooleanColumn - Toggleable Callback (#1892) * Add Docs, Code for Toggleable Columns * Add Confirmation Option * Tweak Blade - Standardise * Add Tests for Toggleable --------- Co-authored-by: lrljoe * Update ChangeLog * Enable/Disable Tools/Toolbar (#1896) * Customised Toolbar Approach --------- Co-authored-by: lrljoe * Use Computed Properties By Default (#1898) * Fix has actions (#1901) * Fix Action Repetitive Calling * Fix validActionsCount --------- Co-authored-by: lrljoe * Add icon column (#1902) * Initial Commit - Awaiting Docs & Tests * Tweak to IconColumn label behaviour * Adding IconColumn documentation * Add Additional Tests - Replace Test Database * Add Visuals Test for IconColumn * Add Icon Columns to Other Column Types * Undo FrontendAssetsTest Changes --------- Co-authored-by: lrljoe * Add Baseline - Convert phpstan.neon to tabs (#1903) * Update ChangeLog * Save filter selection to session (BETA) (#1910) * Initial Commit * Fix styling * Initial Commit * Fix styling * Fix nullable return * Add Initial Tests - Remove Non-Required Method * Fix styling * Swap methods * Add default docs * Remove errant note * Adjust docs * Adjust Docs for storeFiltersInSessionEnabled --------- Co-authored-by: lrljoe * Add hide table option (#1914) * Initial Commit * Fix styling * Further adjustments * Fix styling * Improve Tests - Extend PetsTable * Fix styling --------- Co-authored-by: lrljoe * Add column select session methods (#1913) * Initial Commit * Fix styling * Minor Tweaks * Fix styling * Fix Tests * Add Tests for StoredColumnSelect * Fix styling * Add Missing Tests * Fix styling --------- Co-authored-by: lrljoe * Use Core HasTheme Methods (#1915) * Centralise Theme Methods * Fix styling * Fix for broken tests * Fix styling * Remove persisted computed properties --------- Co-authored-by: lrljoe * Use Core Attribute Bag (#1916) * Initial Commit * Fix styling * Add Missing Test * Fix styling * Adjustments * Fix styling * Adjust Test * Fix styling * Fix Sorting Visual Test --------- Co-authored-by: lrljoe * Fix ChangeLog * Add Polish translation by @meavric (#1925) * Add Polish translation by @meavric * Update ChangeLog to reflect translation * Add Vertical Scrolling Example (#1926) * Adjusting contributing * Fix missing variable in workflow (#1933) * Fix missing variable name * Remove phpunit failOnWarning * Tests * PCOV Use Laravel 11 * Fixes for ButtonGroupColumn, ImageColumn, LinkColumn - to not default as label if has a "from" property. (#1932) * Initial Commit - Allowing Labels with "From" to be included in queries * Fix styling * Fixes for ButtonGroupColumn, ImageColumn, LinkColumn - to not default as label if has a "from" property. --------- Co-authored-by: lrljoe * Add button type to tailwind pagination blade template (#1928) * v3.4.19 ChangeLog * Revert tableName to be public (#1937) * v3.4.20 ChangeLog * Migration to Core attribute management (#1943) * Migration to Core attribute management * Fix styling * Fix missing type hint, update tests * Fix styling * Remove defaults from being output * Fix styling * Adjust defaults * Adjust behaviour for Bulk Actions TH * Add "styling" to Columns docs * Docs Adjust, add missing test * Fix styling * Adjust workflows - use L11 for PHPStan, use PHPUnit for L10 * Add missing test for thSortIconAttributes * Fix styling * Add CustomAttributesTest * Fix styling * Add missing tests - correct attribute to respect defaults * Fix styling * Remove defined processes in workflows * Add test for setShouldBeHidden and setShouldBeDisplayed * Fix styling --------- Co-authored-by: lrljoe * Update docs - add Action setLabelAttributes method (#1952) * Reset Page on "Per Page" changing (#1953) * Localisation - Avoid Conflicts With Other Packages (#1955) * Merging Localisation Tweaks * Fix styling * Tweak localisations * Fix styling * Tweaks to sorting pill direction label * Fix styling * Fixes for Sorting Pill Labels --------- Co-authored-by: lrljoe * Add filterComponents into queryString (#1957) * Fix syntax for DateColumn outputFormat in docs (#1960) * Fix Filter Pills Icon - Tailwind (#1961) * Add original translation strings - for use in published views (#1959) * Fix for Search Field Attribute Defaults (#1962) * Fix for Search Field Attribute Defaults * SearchFieldAttributes -> Defaults To False * Change the type of LaravelLivewireTablesEvent::$user from Illuminate\Foundation\Auth\User to Illuminate\Contracts\Auth\Authenticatable (#1963) * Remove persist from getFilterGenericData (#1966) * Update ChangeLog * Update Pint Workflow (#1967) * Update Pint Workflow * Update ChangeLog * Test Styling Workflow * Fix styling * Test Workflow * Fix styling --------- Co-authored-by: lrljoe * Update Discord Releases Workflow (#1968) * Update ChangeLog * Fix Loading Placeholder Bug - Breaking Table (#1969) * FixLoadingPlaceholderBug * Adjust tests for new Loading blade * v3.4.22 ChangeLog * Update ChangeLog * Add comment on getTitle (#1976) * Add before-wrapper and after-wrapper configurable areas (#1977) * Add initial commit for setPaginationWrapperAttributes (#1978) * Add initial commit for setPaginationWrapperAttributes * Fix styling * Update ChangeLog * Adjust Tests & Methods * Fix styling --------- Co-authored-by: lrljoe * Update ChangeLog * Update ChangeLog * Adjust ChangeLog Date * Add ToolsAttributes and ToolbarAttributes (#1982) * Initial Commit * Fix styling * Add getCustomAttributesBagFromArray * Fix styling * Reorder Array * Reorder Initial Array - Add Additional Test * Fix styling * Add More Tests --------- Co-authored-by: lrljoe * Add docs for the ColumnSelect lifecycle hooks (#1983) * Add setToolsAttributes and setToolBarAttributes docs (#1984) * Update ChangeLog * Adding Tools/Toolbar Enable Tests (#1986) * Adding Tools/Toolbar Enable Tests * Fix styling --------- Co-authored-by: lrljoe * Add lang Norwegian and Albanian (#1988) * Add Norwegian Bokmål nb.json GTP translated verified by human * Added Albanian sq.json GTP translated, not verified by human * Fix missing i18n keys for FR, IT, EN, DE (#1993) * Clean localization files by adding missing keys (in english) and re-ordering a few misplaced ones * Update localization for french * Update localization for spanish * Update localization for italian * Update localization for german * Revert "Clean localization files by adding missing keys (in english) and re-ordering a few misplaced ones" This reverts commit d440bd2da68f05333ff6e1e1835cf09f2517ac39. * Loading Placeholder Adjustments (#1987) * Move LoadingPlaceholderStyling into new method * Add "Loading" default translation * Move Placeholder Blade Config backwards * Adjustments to Placeholder Attributes * Tweak Row Behaviour --------- Co-authored-by: lrljoe * Livewire column doesn't have title() method (#2002) Adjusting Documentation -> The Livewire column type doesn't have the `HasTitleCallback` trait, so you can't use `->title()`. * Add Value to BooleanColumn custom view (#2010) * Add Value to BooleanColumn view * Fix styling --------- Co-authored-by: lrljoe * Add config option to bypass setting User on Events. (#2006) Co-authored-by: julianmedwards <82068546+julianmedwards@users.noreply.github.com> * Fix styling * Improve Workflow Caches (#2013) * Improve Workflow Caches * Fix styling --------- Co-authored-by: lrljoe * Add customisation for QueryString specific to Filters (#2011) * Add customisation for QueryString specific to Filters * Move all QueryString Filter Code to HasQueryStringForFilter --------- Co-authored-by: lrljoe * Adjust Workflow Cache for Issue (#2015) * Fix bug with FilterQueryString (#2014) * Fix bug with FilterQueryString * Fix styling --------- Co-authored-by: lrljoe * Add Customisation for "Search" in QueryString (#2017) * AddSearchQueryString * Add tests for hasQueryStringAliasFor... * Additional Tests For SearchQueryString * Move Livewire to Visuals section * Simplify the queryString methods * Add hasQueryStringAliasForSearch test * PCOV Runs as PHPUnit not ParaTest * Remove PCOV From Workflows Where Not Used * Fix styling --------- Co-authored-by: lrljoe * Add QueryStringForSort (#2018) * Add QueryStringForSort * Adjust for SortQueryString * Tests * Tweaks to Configure Approach --------- Co-authored-by: lrljoe * BETA: Livewire Custom Filter (Array) (#2025) * Initial Commit * Add blade for Livewire Component Array Filter - not live --------- Co-authored-by: lrljoe * Fix bug #1997 - Found the issue elsewhere also, so I fixed them too. (#2021) * Adds Swedish translations (#2027) * Adds Swedish translations * Update weird translation strings I was stressed (: * Update sv.json --------- Co-authored-by: lrljoe Co-authored-by: Matthias Schmitt <126666060+matzeschmitt@users.noreply.github.com> Co-authored-by: Paoulo Riveros Co-authored-by: Christian Co-authored-by: Chris Thompson Co-authored-by: Julian Edwards <82068546+me-julian@users.noreply.github.com> Co-authored-by: julianmedwards <82068546+julianmedwards@users.noreply.github.com> Co-authored-by: Richard Leishman Co-authored-by: Alex Bierhance --- .github/workflows/pint.yml | 2 +- .github/workflows/run-phpstan-pull.yml | 89 ++++++++ .github/workflows/run-phpstan.yml | 17 +- .github/workflows/run-tests-pcov-pull.yml | 14 +- .github/workflows/run-tests-pull.yml | 26 +-- .github/workflows/run-tests.yml | 28 +-- config/livewire-tables.php | 10 + .../column-types/livewire_component_column.md | 3 +- docs/datatable/available-methods.md | 38 +--- docs/datatable/events.md | 2 + docs/datatable/query-string.md | 207 ++++++++++++++++++ docs/datatable/styling.md | 2 +- docs/misc/loading-placeholder.md | 20 +- docs/start/configuration.md | 19 ++ resources/lang/de.json | 4 + resources/lang/en.json | 2 + resources/lang/es.json | 2 + resources/lang/fr.json | 8 +- resources/lang/it.json | 8 +- resources/lang/nb.json | 70 ++++++ resources/lang/sq.json | 70 ++++++ resources/lang/sv.json | 36 +++ .../components/includes/loading.blade.php | 54 ++--- resources/views/components/table/th.blade.php | 12 +- .../views/components/table/th/plain.blade.php | 4 +- .../components/table/th/reorder.blade.php | 4 +- .../livewire-component-array-filter.blade.php | 4 + .../livewire-component-filter.blade.php | 3 +- .../toolbar/items/search-field.blade.php | 8 +- src/Events/LaravelLivewireTablesEvent.php | 2 +- src/Traits/ComponentUtilities.php | 32 ++- .../LoadingPlaceholderConfiguration.php | 21 -- .../QueryStringConfiguration.php | 2 +- .../Core/QueryStrings/HasQueryString.php | 59 +++++ .../QueryStrings/HasQueryStringForFilter.php | 84 +++++++ .../QueryStrings/HasQueryStringForSearch.php | 66 ++++++ .../QueryStrings/HasQueryStringForSort.php | 66 ++++++ src/Traits/HasAllTraits.php | 2 +- src/Traits/Helpers/FilterHelpers.php | 10 + .../Helpers/LoadingPlaceholderHelpers.php | 18 +- ...LoadingPlaceholderStylingConfiguration.php | 34 +++ .../Styling/HasLoadingPlaceholderStyling.php | 22 ++ .../LoadingPlaceholderStylingHelpers.php | 36 +++ src/Traits/WithFilters.php | 14 +- src/Traits/WithLoadingPlaceholder.php | 10 +- src/Traits/WithQueryString.php | 2 + src/Traits/WithSearch.php | 13 +- src/Traits/WithSorting.php | 13 +- src/Views/Columns/BooleanColumn.php | 1 + .../Filters/LivewireComponentArrayFilter.php | 58 +++++ src/Views/Filters/LivewireComponentFilter.php | 38 +--- src/Views/Traits/Filters/HasOptions.php | 2 +- .../Filters/IsLivewireComponentFilter.php | 44 ++++ src/Views/Traits/IsExternalArrayFilter.php | 73 ++++++ tests/Events/ColumnsSelectedTest.php | 20 ++ tests/Events/FilterAppliedTest.php | 20 ++ tests/Events/SearchAppliedTest.php | 20 ++ .../LoadingPlaceholderConfigurationTest.php | 64 +++++- .../QueryStringForFiltersTest.php | 110 ++++++++++ .../QueryStrings/QueryStringForSearchTest.php | 110 ++++++++++ .../QueryStrings/QueryStringForSortTest.php | 110 ++++++++++ tests/Traits/Helpers/ToolsHelpersTest.php | 11 + tests/Traits/Visuals/SearchVisualsTest.php | 46 ++++ tests/Views/Columns/BooleanColumnTest.php | 13 ++ 64 files changed, 1751 insertions(+), 261 deletions(-) create mode 100644 .github/workflows/run-phpstan-pull.yml create mode 100644 docs/datatable/query-string.md create mode 100644 resources/lang/nb.json create mode 100644 resources/lang/sq.json create mode 100644 resources/lang/sv.json create mode 100644 resources/views/components/tools/filters/livewire-component-array-filter.blade.php create mode 100644 src/Traits/Core/QueryStrings/HasQueryString.php create mode 100644 src/Traits/Core/QueryStrings/HasQueryStringForFilter.php create mode 100644 src/Traits/Core/QueryStrings/HasQueryStringForSearch.php create mode 100644 src/Traits/Core/QueryStrings/HasQueryStringForSort.php create mode 100644 src/Traits/Styling/Configuration/LoadingPlaceholderStylingConfiguration.php create mode 100644 src/Traits/Styling/HasLoadingPlaceholderStyling.php create mode 100644 src/Traits/Styling/Helpers/LoadingPlaceholderStylingHelpers.php create mode 100644 src/Views/Filters/LivewireComponentArrayFilter.php create mode 100644 src/Views/Traits/Filters/IsLivewireComponentFilter.php create mode 100644 src/Views/Traits/IsExternalArrayFilter.php create mode 100644 tests/Traits/Core/QueryStrings/QueryStringForFiltersTest.php create mode 100644 tests/Traits/Core/QueryStrings/QueryStringForSearchTest.php create mode 100644 tests/Traits/Core/QueryStrings/QueryStringForSortTest.php diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml index 356103132..c533df969 100644 --- a/.github/workflows/pint.yml +++ b/.github/workflows/pint.yml @@ -26,7 +26,7 @@ jobs: - name: Fix PHP code style issues uses: aglipanci/laravel-pint-action@latest - - name: Commit changes + - name: Commit styling changes uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Fix styling diff --git a/.github/workflows/run-phpstan-pull.yml b/.github/workflows/run-phpstan-pull.yml new file mode 100644 index 000000000..9f8b7a5d7 --- /dev/null +++ b/.github/workflows/run-phpstan-pull.yml @@ -0,0 +1,89 @@ +name: run-phpstan-pull + +on: + pull_request: + branches: + - 'master' + - 'development' + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest] + php: [8.3] + laravel: [11] + stability: [prefer-dist] + + name: PHPStan - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + env: + extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup cache environment + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ matrix.php }} + extensions: ${{ env.extensions }} + key: ${{ env.extensionKey }} + + - name: Cache extensions + uses: actions/cache@v4 + with: + path: ${{ steps.extcache.outputs.dir }} + key: ${{ steps.extcache.outputs.key }} + restore-keys: ${{ steps.extcache.outputs.key }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: ${{ env.extensions }} + coverage: pcov + tools: phpunit:9.5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup problem matchers for PHP + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + + - name: Get composer cache directory + id: composer-cache + run: | + echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: phpstan-${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: phpstan-${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer- + + - name: Add token + run: | + composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer require "laravel/framework:${{ matrix.laravel }}.*" --no-interaction --no-update + + - name: Update dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer update --${{ matrix.stability }} --no-interaction + + - name: Install PHPStan + run: composer require larastan/larastan:^2.0 --no-interaction + + - uses: actions/cache@v4 + with: + path: ./build/phpstan + key: phpstan-${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }} + + - name: Run PHPStan Tests + run: ./vendor/bin/phpstan analyse \ No newline at end of file diff --git a/.github/workflows/run-phpstan.yml b/.github/workflows/run-phpstan.yml index 3701660df..742eb28a7 100644 --- a/.github/workflows/run-phpstan.yml +++ b/.github/workflows/run-phpstan.yml @@ -1,10 +1,6 @@ name: run-phpstan on: - pull_request: - branches: - - 'master' - - 'development' push: branches: - '*' # matches every branch that doesn't contain a '/' @@ -26,7 +22,7 @@ jobs: name: PHPStan - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} env: - extensionKey: phpextensions + extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo steps: @@ -69,8 +65,8 @@ jobs: - uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-PHPStan-P${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-PHPStan-P${{ matrix.php }}-L${{ matrix.laravel }}-composer- + key: phpstan-${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: phpstan-${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer- - name: Add token run: | @@ -87,5 +83,10 @@ jobs: - name: Install PHPStan run: composer require larastan/larastan:^2.0 --dev --no-interaction + - uses: actions/cache@v4 + with: + path: ./build/phpstan + key: phpstan-${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }} + - name: Run PHPStan Tests - run: ./vendor/bin/phpstan analyse + run: ./vendor/bin/phpstan analyse \ No newline at end of file diff --git a/.github/workflows/run-tests-pcov-pull.yml b/.github/workflows/run-tests-pcov-pull.yml index fffe0618f..785b3c173 100644 --- a/.github/workflows/run-tests-pcov-pull.yml +++ b/.github/workflows/run-tests-pcov-pull.yml @@ -26,6 +26,14 @@ jobs: extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pcov,pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo steps: + - name: Wait for tests to finish + uses: lewagon/wait-on-check-action@v1.3.4 + with: + ref: ${{ github.ref }} + running-workflow-name: 'Run Tests Pull' + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 20 + - name: Checkout code uses: actions/checkout@v4 @@ -66,8 +74,8 @@ jobs: - uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-PCOV-PULL-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-PCOV-PULL-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- + key: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer- - name: Add token run: | @@ -85,7 +93,7 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Run Unit Tests - run: php ./vendor/bin/paratest --cache-directory=".phpunit.cache/code-coverage" --strict-coverage --coverage-clover ./coverage.xml + run: php ./vendor/bin/phpunit --cache-directory=".phpunit.cache/code-coverage" --strict-coverage --coverage-clover ./coverage.xml - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4 diff --git a/.github/workflows/run-tests-pull.yml b/.github/workflows/run-tests-pull.yml index 80c625554..8b0fdd2c4 100644 --- a/.github/workflows/run-tests-pull.yml +++ b/.github/workflows/run-tests-pull.yml @@ -1,4 +1,4 @@ -name: run-tests-pull +name: Run Tests Pull on: pull_request: @@ -20,8 +20,8 @@ jobs: name: PULL PHP-${{ matrix.php }} - Laravel-10 env: - extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr + extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr steps: - name: Checkout code @@ -39,8 +39,8 @@ jobs: uses: actions/cache@v4 with: path: ${{ steps.extcache.outputs.dir }} - key: ${{ runner.os }}-${{ steps.extcache.outputs.key }} - restore-keys: ${{ runner.os }}-${{ steps.extcache.outputs.key }} + key: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} + restore-keys: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -64,8 +64,8 @@ jobs: - uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-STDPUSH-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-STDPUSH-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer- + key: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer- - name: Add token run: | @@ -100,7 +100,7 @@ jobs: name: PULL PHP-${{ matrix.php }} - Laravel-11 env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr steps: - name: Checkout code @@ -118,8 +118,8 @@ jobs: uses: actions/cache@v4 with: path: ${{ steps.extcache.outputs.dir }} - key: ${{ runner.os }}-${{ steps.extcache.outputs.key }} - restore-keys: ${{ runner.os }}-${{ steps.extcache.outputs.key }} + key: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} + restore-keys: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -143,8 +143,8 @@ jobs: - uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-STDPUSH-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-STDPUSH-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer- + key: ${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }}-composer- - name: Add token run: | @@ -162,4 +162,4 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Run Unit Tests - run: php ./vendor/bin/paratest --no-coverage + run: php ./vendor/bin/phpunit --no-coverage diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index bcb0d7031..8078c1ddb 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,4 +1,4 @@ -name: run-tests +name: Run Standard Tests on: push: @@ -22,8 +22,8 @@ jobs: name: PHP-${{ matrix.php }} - Laravel-10 env: - extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr + extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr steps: - name: Checkout code @@ -41,8 +41,8 @@ jobs: uses: actions/cache@v4 with: path: ${{ steps.extcache.outputs.dir }} - key: ${{ runner.os }}-${{ steps.extcache.outputs.key }} - restore-keys: ${{ runner.os }}-${{ steps.extcache.outputs.key }} + key: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} + restore-keys: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -66,8 +66,8 @@ jobs: - uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-STDPUSH-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-STDPUSH-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer- + key: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer- - name: Add token run: | @@ -101,8 +101,8 @@ jobs: name: PHP-${{ matrix.php }} - Laravel-11 env: - extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr + extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr steps: - name: Checkout code @@ -120,8 +120,8 @@ jobs: uses: actions/cache@v4 with: path: ${{ steps.extcache.outputs.dir }} - key: ${{ runner.os }}-${{ steps.extcache.outputs.key }} - restore-keys: ${{ runner.os }}-${{ steps.extcache.outputs.key }} + key: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} + restore-keys: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -145,8 +145,8 @@ jobs: - uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-STDPUSH-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-STDPUSH-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer- + key: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer- - name: Add token run: | @@ -164,4 +164,4 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Run Unit Tests - run: php ./vendor/bin/paratest --no-coverage + run: php ./vendor/bin/phpunit --no-coverage diff --git a/config/livewire-tables.php b/config/livewire-tables.php index 4cc3dccab..7c2e20983 100644 --- a/config/livewire-tables.php +++ b/config/livewire-tables.php @@ -114,4 +114,14 @@ 'defaultConfig' => [], ], + /** + * Configuration options for Events + */ + 'events' => [ + /** + * Enable or disable passing the user from Laravel's Auth service to events + */ + 'enableUserForEvent' => true, + ], + ]; diff --git a/docs/column-types/livewire_component_column.md b/docs/column-types/livewire_component_column.md index 9b1851299..6a6af2eea 100644 --- a/docs/column-types/livewire_component_column.md +++ b/docs/column-types/livewire_component_column.md @@ -10,7 +10,6 @@ This is **not recommended** as due to the nature of Livewire, it becomes ineffic ## component ``` LivewireComponentColumn::make('Action') - ->title(fn($row) => 'Edit') ->component('PathToLivewireComponent'), ``` @@ -29,4 +28,4 @@ Please also see the following for other available methods:
  • Footer
  • - \ No newline at end of file + diff --git a/docs/datatable/available-methods.md b/docs/datatable/available-methods.md index 13d4091b3..3cf5c303c 100644 --- a/docs/datatable/available-methods.md +++ b/docs/datatable/available-methods.md @@ -76,43 +76,7 @@ public function configure(): void ## Query String -The query string is **enabled by default**, but if you ever needed to toggle it you can use the following methods: - -### setQueryStringStatus - -Enable/disable the query string. - -```php -public function configure(): void -{ - $this->setQueryStringStatus(true); - $this->setQueryStringStatus(false); -} -``` - -### setQueryStringEnabled - -Enable the query string. - -```php -public function configure(): void -{ - // Shorthand for $this->setQueryStringStatus(true) - $this->setQueryStringEnabled(); -} -``` - -### setQueryStringDisabled - -Disable the query string. - -```php -public function configure(): void -{ - // Shorthand for $this->setQueryStringStatus(false) - $this->setQueryStringDisabled(); -} -``` +The documentation for Query String now lives: [here](./query-string) ## Relationships diff --git a/docs/datatable/events.md b/docs/datatable/events.md index 2a64763a7..dc81a5695 100644 --- a/docs/datatable/events.md +++ b/docs/datatable/events.md @@ -55,6 +55,8 @@ There are several events, all in the Rappasoft\LaravelLivewireTables\Events name | FilterApplied | Applied when a Filter is applied (not when removed) | The Table Name ($tableName), Filter Key ($key), Filter Value ($value), Logged In User ($user) | | SearchApplied | Applied when a Search is applied (not when removed) | The Table Name ($tableName), Search Term ($value), Logged In User ($user) | +Passing the user with an event is optional and [can be disabled in the config](../start/configuration.md#bypassing-laravels-auth-service). + By default, the Tables will dispatch an event when the Selected Columns is changed, you may customise this behaviour: #### enableAllEvents diff --git a/docs/datatable/query-string.md b/docs/datatable/query-string.md new file mode 100644 index 000000000..c830ef15a --- /dev/null +++ b/docs/datatable/query-string.md @@ -0,0 +1,207 @@ +--- +title: Query String +weight: 5 +--- + +The query string is **enabled by default**, but if you ever needed to toggle it you can use the following methods: + +## Global +### setQueryStringStatus + +Enable/disable the query string. + +```php +public function configure(): void +{ + $this->setQueryStringStatus(true); + $this->setQueryStringStatus(false); +} +``` + +### setQueryStringEnabled + +Enable the query string. + +```php +public function configure(): void +{ + // Shorthand for $this->setQueryStringStatus(true) + $this->setQueryStringEnabled(); +} +``` + +### setQueryStringDisabled + +Disable the query string. + +```php +public function configure(): void +{ + // Shorthand for $this->setQueryStringStatus(false) + $this->setQueryStringDisabled(); +} +``` + +### setQueryStringAlias + +Change the Alias in the URL, otherwise defaults to "$tablename" + +```php +public function configure(): void +{ + $this->setQueryStringAlias('table1'); +} +``` + +## Filters + +The filter query string is **enabled by default**, but if you ever needed to toggle it you can use the following methods: + +### setQueryStringStatusForFilter + +Enable/disable the query string for the filters + +```php +public function configure(): void +{ + $this->setQueryStringStatusForFilter(true); + $this->setQueryStringStatusForFilter(false); +} +``` + +### setQueryStringForFilterEnabled + +Enable the query string for the filters + +```php +public function configure(): void +{ + // Shorthand for $this->setQueryStringStatusForFilter(true) + $this->setQueryStringForFilterEnabled(); +} +``` + +### setQueryStringForFilterDisabled + +Disable the query string for the filters + +```php +public function configure(): void +{ + // Shorthand for $this->setQueryStringStatusForFilter(false) + $this->setQueryStringForFilterDisabled(); +} +``` + +### setQueryStringAliasForFilter + +Change the Alias in the URL for the filter, otherwise defaults to "$tablename-filters" + +```php +public function configure(): void +{ + $this->setQueryStringAliasForFilter('filtervalues'); +} +``` + +## Search + +The search query string is **enabled by default**, but if you ever needed to toggle it you can use the following methods: + +### setQueryStringStatusForSearch + +Enable/disable the query string for search + +```php +public function configure(): void +{ + $this->setQueryStringStatusForSearch(true); + $this->setQueryStringStatusForSearch(false); +} +``` + +### setQueryStringForSearchEnabled + +Enable the query string for search + +```php +public function configure(): void +{ + // Shorthand for $this->setQueryStringStatusForSearch(true) + $this->setQueryStringForSearchEnabled(); +} +``` + +### setQueryStringForSearchDisabled + +Disable the query string for search + +```php +public function configure(): void +{ + // Shorthand for $this->setQueryStringStatusForSearch(false) + $this->setQueryStringForSearchDisabled(); +} +``` + +### setQueryStringAliasForSearch + +Change the Alias in the URL for the search, otherwise defaults to "$tablename-search" + +```php +public function configure(): void +{ + $this->setQueryStringAliasForSearch('search'); +} +``` + +## Sorts + +The sorts query string is **enabled by default**, but if you ever needed to toggle it you can use the following methods: + +### setQueryStringStatusForSort + +Enable/disable the query string for sort + +```php +public function configure(): void +{ + $this->setQueryStringStatusForSort(true); + $this->setQueryStringStatusForSort(false); +} +``` + +### setQueryStringForSortEnabled + +Enable the query string for sort + +```php +public function configure(): void +{ + // Shorthand for $this->setQueryStringStatusForSort(true) + $this->setQueryStringForSortEnabled(); +} +``` + +### setQueryStringForSortDisabled + +Disable the query string for sort + +```php +public function configure(): void +{ + // Shorthand for $this->setQueryStringStatusForSort(false) + $this->setQueryStringForSortDisabled(); +} +``` + +### setQueryStringAliasForSort + +Change the Alias in the URL for the sorts, otherwise defaults to "$tablename-sorts" + +```php +public function configure(): void +{ + $this->setQueryStringAliasForSort('sorts'); +} +``` \ No newline at end of file diff --git a/docs/datatable/styling.md b/docs/datatable/styling.md index 9353ad00e..937a6df94 100644 --- a/docs/datatable/styling.md +++ b/docs/datatable/styling.md @@ -1,6 +1,6 @@ --- title: Styling -weight: 5 +weight: 6 --- The package offers significant opportunities to customise the look & feel of the core table, as well as other elements (which are documented in the relevant sections). diff --git a/docs/misc/loading-placeholder.md b/docs/misc/loading-placeholder.md index 20ca7f9b5..67c4977ac 100644 --- a/docs/misc/loading-placeholder.md +++ b/docs/misc/loading-placeholder.md @@ -47,7 +47,9 @@ You may use this method to set custom text for the placeholder: $this->setLoadingPlaceholderContent('Text To Display'); } ``` -### setLoadingPlaceHolderWrapperAttributes +### setLoadingPlaceHolderWrapperAttributes (Deprecated) + +This is replaced by setLoadingPlaceHolderRowAttributes, but remains functional. This method allows you to customise the attributes for the <tr> element used as a Placeholder when the table is loading. Similar to other setAttribute methods, this accepts a range of attributes, and a boolean "default", which will enable/disable the default attributes. @@ -62,6 +64,22 @@ This method allows you to customise the attributes for the <tr> element us ``` +### setLoadingPlaceHolderRowAttributes + +Replaces setLoadingPlaceHolderWrapperAttributes +This method allows you to customise the attributes for the <tr> element used as a Placeholder when the table is loading. Similar to other setAttribute methods, this accepts a range of attributes, and a boolean "default", which will enable/disable the default attributes. + +```php + public function configure(): void + { + $this->setLoadingPlaceHolderRowAttributes([ + 'class' => 'text-bold', + 'default' => false, + ]); + } + +``` + ### setLoadingPlaceHolderIconAttributes This method allows you to customise the attributes for the <div> element that is used solely for the PlaceholderIcon. Similar to other setAttribute methods, this accepts a range of attributes, and a boolean "default", which will enable/disable the default attributes. diff --git a/docs/start/configuration.md b/docs/start/configuration.md index 3e264c578..01725843f 100644 --- a/docs/start/configuration.md +++ b/docs/start/configuration.md @@ -81,3 +81,22 @@ You must also make sure you have this Alpine style available globally. Note that [x-cloak] { display: none !important; } ``` + +## Bypassing Laravel's Auth Service + +By default, all [events](../datatable/events#dispatched) will retrieve any currently authenticated user from Laravel's [Auth service](https://laravel.com/docs/authentication) and pass it along with the event. + +If your project doesn't include the Illuminate/Auth package, or you otherwise want to prevent this, you can set the `enableUserForEvent` config option to false. + +```php +// config/livewire-tables.php +return [ + // ... + 'events' => [ + /** + * Enable or disable passing the user from Laravel's Auth service to events + */ + 'enableUserForEvent' => false, + ], +]; +``` diff --git a/resources/lang/de.json b/resources/lang/de.json index 2ddfa94cc..6ef76e8bf 100644 --- a/resources/lang/de.json +++ b/resources/lang/de.json @@ -5,6 +5,7 @@ "livewire-tables::Applied Sorting": "Angewendete Sortierung", "livewire-tables::Bulk Actions": "Aktionen", "livewire-tables::Clear": "Zurücksetzen", + "livewire-tables::Bulk Actions Confirm": "Bist du sicher?", "livewire-tables::Columns": "Spalten", "livewire-tables::Debugging Values": "Werte debuggen", "livewire-tables::Deselect All": "Alle abwählen", @@ -23,6 +24,7 @@ "livewire-tables::rows, do you want to select all": "Zeilen, sollen alle ausgewählt werden", "livewire-tables::Search": "Suche", "livewire-tables::Select All": "Alle auswählen", + "livewire-tables::Select All On Page": "Alle auf der Seite auswählen", "livewire-tables::Showing": "Anzeigen", "livewire-tables::to": "nach", "livewire-tables::Yes": "Ja", @@ -34,6 +36,7 @@ "Applied Filters": "Angewendete Filter", "Applied Sorting": "Angewendete Sortierung", "Bulk Actions": "Aktionen", + "Bulk Actions Confirm": "Bist du sicher?", "Clear": "Zurücksetzen", "Columns": "Spalten", "Debugging Values": "Werte debuggen", @@ -53,6 +56,7 @@ "rows, do you want to select all": "Zeilen, sollen alle ausgewählt werden", "Search": "Suche", "Select All": "Alle auswählen", + "Select All On Page": "Alle auf der Seite auswählen", "Showing": "Anzeigen", "to": "nach", "Yes": "Ja", diff --git a/resources/lang/en.json b/resources/lang/en.json index dcf30f145..1579cbbe2 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -11,6 +11,7 @@ "livewire-tables::Deselect All": "Deselect All", "livewire-tables::Done Reordering": "Done Reordering", "livewire-tables::Filters": "Filters", + "livewire-tables::loading": "Loading", "livewire-tables::max": "Max", "livewire-tables::min": "Min", "livewire-tables::not_applicable": "N/A", @@ -45,6 +46,7 @@ "Deselect All": "Deselect All", "Done Reordering": "Done Reordering", "Filters": "Filters", + "loading": "Loading", "max": "Max", "min": "Min", "not_applicable": "N/A", diff --git a/resources/lang/es.json b/resources/lang/es.json index b03b2e25f..8654e82ca 100644 --- a/resources/lang/es.json +++ b/resources/lang/es.json @@ -4,6 +4,7 @@ "livewire-tables::Applied Filters": "Filtros Aplicados", "livewire-tables::Applied Sorting": "Ordenamiento Aplicado", "livewire-tables::Bulk Actions": "Acciones Masivas", + "livewire-tables::Bulk Actions Confirm": "Está seguro?", "livewire-tables::Clear": "Borrar", "livewire-tables::Columns": "Columnas", "livewire-tables::Debugging Values": "Valores de depuración", @@ -35,6 +36,7 @@ "Applied Filters": "Filtros Aplicados", "Applied Sorting": "Ordenamiento Aplicado", "Bulk Actions": "Acciones Masivas", + "Bulk Actions Confirm": "Está seguro?", "Clear": "Borrar", "Columns": "Columnas", "Debugging Values": "Valores de depuración", diff --git a/resources/lang/fr.json b/resources/lang/fr.json index 89323dc4a..9cb399d08 100644 --- a/resources/lang/fr.json +++ b/resources/lang/fr.json @@ -4,6 +4,7 @@ "livewire-tables::Applied Filters": "Filtres appliqués", "livewire-tables::Applied Sorting": "Tris appliqués", "livewire-tables::Bulk Actions": "Actions en masse", + "livewire-tables::Bulk Actions Confirm": "Êtes-vous sûr ?", "livewire-tables::Clear": "Effacer", "livewire-tables::Columns": "Colonnes", "livewire-tables::Debugging Values": "Valeurs de débogage", @@ -23,7 +24,8 @@ "livewire-tables::rows, do you want to select all": "lignes, voulez-vous tout sélectionner ?", "livewire-tables::Search": "Rechercher", "livewire-tables::Select All": "Tout sélectionner", - "livewire-tables::Showing": "Montrant", + "livewire-tables::Select All On Page": "Tout sélectionner sur la page", + "livewire-tables::Showing": "Résultats", "livewire-tables::to": "à", "livewire-tables::Yes": "Oui", "livewire-tables::You are currently selecting all": "Vous êtes en train de sélectionner ", @@ -34,6 +36,7 @@ "Applied Filters": "Filtres appliqués", "Applied Sorting": "Tris appliqués", "Bulk Actions": "Actions en masse", + "Bulk Actions Confirm": "Êtes-vous sûr ?", "Clear": "Effacer", "Columns": "Colonnes", "Debugging Values": "Valeurs de débogage", @@ -53,7 +56,8 @@ "rows, do you want to select all": "lignes, voulez-vous tout sélectionner ?", "Search": "Rechercher", "Select All": "Tout sélectionner", - "Showing": "Montrant", + "Select All On Page": "Tout sélectionner sur la page", + "Showing": "Résultats", "to": "à", "Yes": "Oui", "You are currently selecting all": "Vous êtes en train de sélectionner ", diff --git a/resources/lang/it.json b/resources/lang/it.json index a1c50fb21..ceaffa5fc 100644 --- a/resources/lang/it.json +++ b/resources/lang/it.json @@ -4,6 +4,7 @@ "livewire-tables::Applied Filters": "Filtri Applicati", "livewire-tables::Applied Sorting": "Ordinamento Applicato", "livewire-tables::Bulk Actions": "Azioni di Gruppo", + "livewire-tables::Bulk Actions Confirm": "Sei sicuro?", "livewire-tables::Clear": "Pulisci", "livewire-tables::Columns": "Colonne", "livewire-tables::Debugging Values": "Valori di debug", @@ -22,7 +23,8 @@ "livewire-tables::rows": "righe", "livewire-tables::rows, do you want to select all": "righe, vuoi selezionarle tutte", "livewire-tables::Search": "Cerca", - "livewire-tables::Select All": "Seleziona Tutto", + "livewire-tables::Select All": "Seleziona tutto", + "livewire-tables::Select All On Page": "Seleziona tutto sulla pagina", "livewire-tables::Showing": "Visualizzati", "livewire-tables::to": "a", "livewire-tables::Yes": "SÌ", @@ -34,6 +36,7 @@ "Applied Filters": "Filtri Applicati", "Applied Sorting": "Ordinamento Applicato", "Bulk Actions": "Azioni di Gruppo", + "Bulk Actions Confirm": "Sei sicuro?", "Clear": "Pulisci", "Columns": "Colonne", "Debugging Values": "Valori di debug", @@ -52,7 +55,8 @@ "rows": "righe", "rows, do you want to select all": "righe, vuoi selezionarle tutte", "Search": "Cerca", - "Select All": "Seleziona Tutto", + "Select All": "Seleziona tutto", + "Select All On Page": "Seleziona tutto sulla pagina", "Showing": "Visualizzati", "to": "a", "Yes": "SÌ", diff --git a/resources/lang/nb.json b/resources/lang/nb.json new file mode 100644 index 000000000..b7bb83929 --- /dev/null +++ b/resources/lang/nb.json @@ -0,0 +1,70 @@ +{ + "livewire-tables::All": "Alle", + "livewire-tables::All Columns": "Alle kolonner", + "livewire-tables::Applied Filters": "Anvendte filtre", + "livewire-tables::Applied Sorting": "Anvendt sortering", + "livewire-tables::Bulk Actions": "Massehandlinger", + "livewire-tables::Bulk Actions Confirm": "Er du sikker?", + "livewire-tables::Clear": "Tøm", + "livewire-tables::Columns": "Kolonner", + "livewire-tables::Debugging Values": "Debugger Verdier", + "livewire-tables::Deselect All": "Opphev alle", + "livewire-tables::Done Reordering": "Ferdig med omorganisering", + "livewire-tables::Filters": "Filtre", + "livewire-tables::max": "Maks", + "livewire-tables::min": "Min", + "livewire-tables::not_applicable": "I/T", + "livewire-tables::No": "Nei", + "livewire-tables::No items found. Try to broaden your search.": "Ingen elementer funnet. Prøv å utvide søket.", + "livewire-tables::of": "av", + "livewire-tables::Remove filter option": "Fjern filtervalg", + "livewire-tables::Remove sort option": "Fjern sorteringsvalg", + "livewire-tables::Reorder": "Omorganiser", + "livewire-tables::results": "resultater", + "livewire-tables::row": "rad", + "livewire-tables::rows": "rader", + "livewire-tables::rows, do you want to select all": "rader, vil du velge alle", + "livewire-tables::Search": "Søk", + "livewire-tables::Select All": "Velg alle", + "livewire-tables::Select All On Page": "Velg alle på siden", + "livewire-tables::Showing": "Viser", + "livewire-tables::to": "til", + "livewire-tables::Yes": "Ja", + "livewire-tables::You are currently selecting all": "Du velger for øyeblikket alle", + "livewire-tables::You are not connected to the internet.": "Du er ikke tilkoblet internett.", + "livewire-tables::You have selected": "Du har valgt", + "All": "Alle", + "All Columns": "Alle kolonner", + "Applied Filters": "Anvendte filtre", + "Applied Sorting": "Anvendt sortering", + "Bulk Actions": "Massehandlinger", + "Bulk Actions Confirm": "Er du sikker?", + "Clear": "Tøm", + "Columns": "Kolonner", + "Debugging Values": "Debugger verdier", + "Deselect All": "Opphev valg for alle", + "Done Reordering": "Ferdig med omorganisering", + "Filters": "Filtre", + "max": "Maks", + "min": "Min", + "not_applicable": "I/T", + "No": "Nei", + "No items found. Try to broaden your search.": "Ingen elementer funnet. Prøv å utvide søket.", + "of": "av", + "Remove filter option": "Fjern filtervalg", + "Remove sort option": "Fjern sorteringsvalg", + "Reorder": "Omorganiser", + "results": "resultater", + "row": "rad", + "rows": "rader", + "rows, do you want to select all": "rader, vil du velge alle", + "Search": "Søk", + "Select All": "Velg alle", + "Select All On Page": "Velg alle på siden", + "Showing": "Viser", + "to": "til", + "Yes": "Ja", + "You are currently selecting all": "Du velger for øyeblikket alle", + "You are not connected to the internet.": "Du er ikke tilkoblet internett.", + "You have selected": "Du har valgt" +} diff --git a/resources/lang/sq.json b/resources/lang/sq.json new file mode 100644 index 000000000..1784fa2cc --- /dev/null +++ b/resources/lang/sq.json @@ -0,0 +1,70 @@ +{ + "livewire-tables::All": "Të gjitha", + "livewire-tables::All Columns": "Të gjitha kolonat", + "livewire-tables::Applied Filters": "Filtrat e aplikuara", + "livewire-tables::Applied Sorting": "Renditja e aplikuar", + "livewire-tables::Bulk Actions": "Veprime në masë", + "livewire-tables::Bulk Actions Confirm": "A jeni i sigurt?", + "livewire-tables::Clear": "Pastro", + "livewire-tables::Columns": "Kolonat", + "livewire-tables::Debugging Values": "Vlerat e korrigjimit", + "livewire-tables::Deselect All": "Heq të gjitha", + "livewire-tables::Done Reordering": "Përfundoi riorganizimi", + "livewire-tables::Filters": "Filtrat", + "livewire-tables::max": "Maksimumi", + "livewire-tables::min": "Minimumi", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "Jo", + "livewire-tables::No items found. Try to broaden your search.": "Nuk u gjetën artikuj. Provoni të zgjeroni kërkimin tuaj.", + "livewire-tables::of": "nga", + "livewire-tables::Remove filter option": "Hiq opsionin e filtrit", + "livewire-tables::Remove sort option": "Hiq opsionin e renditjes", + "livewire-tables::Reorder": "Riorganizo", + "livewire-tables::results": "rezultate", + "livewire-tables::row": "rreshti", + "livewire-tables::rows": "rreshtat", + "livewire-tables::rows, do you want to select all": "rreshtat, dëshironi të zgjidhni të gjitha", + "livewire-tables::Search": "Kërko", + "livewire-tables::Select All": "Zgjidh të gjitha", + "livewire-tables::Select All On Page": "Zgjidh të gjitha në faqe", + "livewire-tables::Showing": "Duke treguar", + "livewire-tables::to": "te", + "livewire-tables::Yes": "Po", + "livewire-tables::You are currently selecting all": "Po zgjedhni të gjitha aktualisht", + "livewire-tables::You are not connected to the internet.": "Nuk jeni të lidhur me internetin.", + "livewire-tables::You have selected": "Keni zgjedhur", + "All": "Të gjitha", + "All Columns": "Të gjitha kolonat", + "Applied Filters": "Filtrat e aplikuara", + "Applied Sorting": "Renditja e aplikuar", + "Bulk Actions": "Veprime në masë", + "Bulk Actions Confirm": "A jeni i sigurt?", + "Clear": "Pastro", + "Columns": "Kolonat", + "Debugging Values": "Vlerat e korrigjimit", + "Deselect All": "Heq të gjitha", + "Done Reordering": "Përfundoi riorganizimi", + "Filters": "Filtrat", + "max": "Maksimumi", + "min": "Minimumi", + "not_applicable": "N/A", + "No": "Jo", + "No items found. Try to broaden your search.": "Nuk u gjetën artikuj. Provoni të zgjeroni kërkimin tuaj.", + "of": "nga", + "Remove filter option": "Hiq opsionin e filtrit", + "Remove sort option": "Hiq opsionin e renditjes", + "Reorder": "Riorganizo", + "results": "rezultate", + "row": "rreshti", + "rows": "rreshtat", + "rows, do you want to select all": "rreshtat, dëshironi të zgjidhni të gjitha", + "Search": "Kërko", + "Select All": "Zgjidh të gjitha", + "Select All On Page": "Zgjidh të gjitha në faqe", + "Showing": "Duke treguar", + "to": "te", + "Yes": "Po", + "You are currently selecting all": "Po zgjedhni të gjitha aktualisht", + "You are not connected to the internet.": "Nuk jeni të lidhur me internetin.", + "You have selected": "Keni zgjedhur" +} diff --git a/resources/lang/sv.json b/resources/lang/sv.json new file mode 100644 index 000000000..4bfd4cbfb --- /dev/null +++ b/resources/lang/sv.json @@ -0,0 +1,36 @@ +{ + "livewire-tables::All": "Alla", + "livewire-tables::All Columns": "Alla Columner", + "livewire-tables::Applied Filters": "Valda filter", + "livewire-tables::Applied Sorting": "Vald sortering", + "livewire-tables::Bulk Actions": "Bulk Modifiering", + "livewire-tables::Bulk Actions Confirm": "Är du säker?", + "livewire-tables::Clear": "Rensa", + "livewire-tables::Columns": "Columner", + "livewire-tables::Debugging Values": "Debug Värden", + "livewire-tables::Deselect All": "Avmarkera alla", + "livewire-tables::Done Reordering": "Omordning klart", + "livewire-tables::Filters": "Filter", + "livewire-tables::max": "Max", + "livewire-tables::min": "Min", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "Nej", + "livewire-tables::No items found. Try to broaden your search.": "Inga föremål hittades. Försök vidga din sökning.", + "livewire-tables::of": "av", + "livewire-tables::Remove filter option": "Rensa valt filter", + "livewire-tables::Remove sort option": "Rensa vald sortering", + "livewire-tables::Reorder": "Omordna", + "livewire-tables::results": "resultat", + "livewire-tables::row": "rad", + "livewire-tables::rows": "rader", + "livewire-tables::rows, do you want to select all": "rader, vill du markera alla", + "livewire-tables::Search": "Sök", + "livewire-tables::Select All": "Markera alla", + "livewire-tables::Select All On Page": "Markera alla på sidan", + "livewire-tables::Showing": "Visar", + "livewire-tables::to": "till", + "livewire-tables::Yes": "Ja", + "livewire-tables::You are currently selecting all": "Du markerar för närvarande alla", + "livewire-tables::You are not connected to the internet.": "Du är inte uppkopplad till internet.", + "livewire-tables::You have selected": "Du har markerat" +} diff --git a/resources/views/components/includes/loading.blade.php b/resources/views/components/includes/loading.blade.php index f22096321..b8c988e88 100644 --- a/resources/views/components/includes/loading.blade.php +++ b/resources/views/components/includes/loading.blade.php @@ -1,35 +1,37 @@ -@aware(['isTailwind', 'isBootstrap', 'tableName', 'component']) +@aware(['tableName']) @props(['colCount' => 1]) @php -$customAttributes['loader-wrapper'] = $this->getLoadingPlaceHolderWrapperAttributes(); -$customAttributes['loader-icon'] = $this->getLoadingPlaceHolderIconAttributes(); +$loaderRow = $this->getLoadingPlaceHolderRowAttributes(); +$loaderCell = $this->getLoadingPlaceHolderCellAttributes(); +$loaderIcon = $this->getLoadingPlaceHolderIconAttributes(); @endphp -@if($this->hasLoadingPlaceholderBlade()) - @include($this->getLoadingPlaceHolderBlade(), ['colCount' => $colCount]) -@else - merge($customAttributes['loader-wrapper']) - ->class(['hidden w-full text-center h-screen place-items-center align-middle' => $isTailwind && ($customAttributes['loader-wrapper']['default'] ?? true)]) - ->class(['d-none w-100 text-center h-100 align-items-center' => $isBootstrap && ($customAttributes['loader-wrapper']['default'] ?? true)]); - }} - wire:loading.class.remove="hidden d-none" - > - +merge($loaderRow) + ->class(['hidden w-full text-center place-items-center align-middle' => $this->isTailwind && ($loaderRow['default'] ?? true)]) + ->class(['d-none w-100 text-center align-items-center' => $this->isBootstrap && ($loaderRow['default'] ?? true)]) + ->except(['default','default-styling','default-colors']) +}}> + merge($loaderCell) + ->class(['py-4' => $this->isTailwind && ($loaderCell['default'] ?? true)]) + ->class(['py-4' => $this->isBootstrap && ($loaderCell['default'] ?? true)]) + ->except(['default','default-styling','default-colors', 'colspan','wire:key']) + }}> + @if($this->hasLoadingPlaceholderBlade()) + @include($this->getLoadingPlaceHolderBlade(), ['colCount' => $colCount]) + @else
    -
    merge($customAttributes['loader-icon']) - ->class(['lds-hourglass' => $isTailwind && ($customAttributes['loader-icon']['default'] ?? true)]) - ->class(['lds-hourglass' => $isBootstrap && ($customAttributes['loader-icon']['default'] ?? true)]) +
    merge($loaderIcon) + ->class(['lds-hourglass' => $this->isTailwind && ($loaderIcon['default'] ?? true)]) + ->class(['lds-hourglass' => $this->isBootstrap && ($loaderIcon['default'] ?? true)]) ->except(['default','default-styling','default-colors']); - }} - >
    -
    {{ $this->getLoadingPlaceholderContent() }}
    + }}>
    +
    {!! $this->getLoadingPlaceholderContent() !!}
    - - + @endif + + -@endif diff --git a/resources/views/components/table/th.blade.php b/resources/views/components/table/th.blade.php index b12366dc7..3afee536c 100644 --- a/resources/views/components/table/th.blade.php +++ b/resources/views/components/table/th.blade.php @@ -20,8 +20,8 @@ @if ($isTailwind) merge($customThAttributes) - ->class(['text-gray-500 dark:bg-gray-800 dark:text-gray-400' => ($customThAttributes['default-colors'] ?? true || $customThAttributes['default'] ?? true)]) - ->class(['px-6 py-3 text-left text-xs font-medium whitespace-nowrap uppercase tracking-wider' => ($customThAttributes['default-styling'] ?? true || $customThAttributes['default'] ?? true)]) + ->class(['text-gray-500 dark:bg-gray-800 dark:text-gray-400' => (($customThAttributes['default-colors'] ?? true) || ($customThAttributes['default'] ?? true))]) + ->class(['px-6 py-3 text-left text-xs font-medium whitespace-nowrap uppercase tracking-wider' => (($customThAttributes['default-styling'] ?? true) || ($customThAttributes['default'] ?? true))]) ->class(['hidden' => $column->shouldCollapseAlways()]) ->class(['hidden md:table-cell' => $column->shouldCollapseOnMobile()]) ->class(['hidden lg:table-cell' => $column->shouldCollapseOnTablet()]) @@ -35,8 +35,8 @@