diff --git a/.gitattributes b/.gitattributes index 5fb810aac..70d99ed4c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -37,3 +37,4 @@ /resources/js/partials/filter-date-range.js export-ignore /resources/js/partials/filter-number-range.js export-ignore /resources/js/partials/reorder.js export-ignore +/minifyJs export-ignore \ No newline at end of file diff --git a/.github/workflows/discord-releases.yml b/.github/workflows/discord-releases.yml index c75bedd41..236cea737 100644 --- a/.github/workflows/discord-releases.yml +++ b/.github/workflows/discord-releases.yml @@ -4,14 +4,16 @@ on: jobs: github-releases-to-discord: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Package Releases - uses: SethCohen/github-releases-to-discord@v1.13.1 + uses: SethCohen/github-releases-to-discord@latest + env: + WEBHOOK_DISCORD_RELEASE_URL: ${{ secrets.WEBHOOK_DISCORD_RELEASE_URL }} with: - webhook_url: ${{ secrets.WEBHOOK_DISCORD_RELEASE_URL }} + webhook_url: $WEBHOOK_DISCORD_RELEASE_URL color: "2105893" username: "GitHub Release-Bot" avatar_url: "https://cdn.discordapp.com/avatars/487431320314576937/bd64361e4ba6313d561d54e78c9e7171.png" diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml index 097689b83..c533df969 100644 --- a/.github/workflows/pint.yml +++ b/.github/workflows/pint.yml @@ -2,6 +2,11 @@ name: Fix PHP code style issues on: push: + branches: + - '*' # matches every branch that doesn't contain a '/' + - '*/*' # matches every branch containing a single '/' + - '**' # matches every branch + - '!master' paths: - '**.php' @@ -14,14 +19,14 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - name: Fix PHP code style issues - uses: aglipanci/laravel-pint-action@2.2.0 + uses: aglipanci/laravel-pint-action@latest - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 + - 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..bacc60816 --- /dev/null +++ b/.github/workflows/run-phpstan-pull.yml @@ -0,0 +1,91 @@ +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.4] + laravel: [12] + 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, exif, iconv, 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:11.4 + 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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + composer config github-oauth.github.com $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 -W + + - name: Install PHPStan + run: composer require larastan/larastan:^3.0 --no-interaction -W + + - 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 a94ed2a24..e3069324c 100644 --- a/.github/workflows/run-phpstan.yml +++ b/.github/workflows/run-phpstan.yml @@ -1,6 +1,13 @@ name: run-phpstan -on: [push, pull_request] +on: + push: + branches: + - '*' # matches every branch that doesn't contain a '/' + - '*/*' # matches every branch containing a single '/' + - '**' # matches every branch + - '!master' + - '!development' jobs: test: @@ -9,18 +16,18 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.3] - laravel: [10] + php: [8.4] + laravel: [12] stability: [prefer-dist] name: PHPStan - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} env: - extensionKey: phpextensions - extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, exif, iconv, fileinfo steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup cache environment id: extcache @@ -31,7 +38,7 @@ jobs: key: ${{ env.extensionKey }} - name: Cache extensions - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.extcache.outputs.dir }} key: ${{ steps.extcache.outputs.key }} @@ -43,7 +50,7 @@ jobs: php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} coverage: pcov - tools: phpunit:9.5 + tools: phpunit:11.4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -55,15 +62,17 @@ jobs: run: | echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 + - 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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} + composer config github-oauth.github.com $GITHUB_TOKEN - name: Install dependencies if: steps.composer-cache.outputs.cache-hit != 'true' @@ -71,10 +80,15 @@ jobs: - name: Update dependencies if: steps.composer-cache.outputs.cache-hit != 'true' - run: composer update --${{ matrix.stability }} --no-interaction + run: composer update --${{ matrix.stability }} --no-interaction -W - name: Install PHPStan - run: composer require nunomaduro/larastan:^2.0 --dev --no-interaction + run: composer require larastan/larastan:^3.0 --dev --no-interaction -W + + - 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 08e7eea08..38c961e84 100644 --- a/.github/workflows/run-tests-pcov-pull.yml +++ b/.github/workflows/run-tests-pcov-pull.yml @@ -1,9 +1,13 @@ name: run-tests-pcov-pull on: + push: + branches: + - 'development' + - 'master' pull_request: branches: - - 'develop' + - 'development' - 'master' jobs: @@ -12,19 +16,19 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] + os: [ubuntu-24.04] php: [8.3] - laravel: [10] + laravel: [11] stability: [prefer-dist] - name: PCOV-PULL - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} + name: PCOV - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-withpcov - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pcov,pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pcov,pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup cache environment id: extcache @@ -33,7 +37,14 @@ jobs: 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: @@ -45,13 +56,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Cache extensions - uses: actions/cache@v3 - with: - path: ${{ steps.extcache.outputs.dir }} - key: ${{ steps.extcache.outputs.key }} - restore-keys: ${{ steps.extcache.outputs.key }} - - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" @@ -60,15 +64,17 @@ jobs: run: | echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 + - 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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} + composer config github-oauth.github.com $GITHUB_TOKEN - name: Install dependencies if: steps.composer-cache.outputs.cache-hit != 'true' @@ -82,14 +88,14 @@ 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 --processes=4 + run: php ./vendor/bin/phpunit --cache-directory=".phpunit.cache/code-coverage" --strict-coverage --coverage-clover ./coverage.xml --testsuite "Laravel Livewire Tables Unit Test Suite","Laravel Livewire Tables Visuals Test Suite" - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: - token: ${{ secrets.CODE_COV_TOKEN }} + token: $CODECOV_TOKEN files: ./coverage.xml verbose: true diff --git a/.github/workflows/run-tests-pull.yml b/.github/workflows/run-tests-pull.yml index 50c0c38be..257e1d43d 100644 --- a/.github/workflows/run-tests-pull.yml +++ b/.github/workflows/run-tests-pull.yml @@ -1,33 +1,31 @@ -name: run-tests-pull +name: Run Tests Pull on: pull_request: branches: - - 'develop' + - 'development' - 'master' jobs: - test: + test-laravel10: runs-on: ${{ matrix.os }} strategy: fail-fast: false + max-parallel: 2 matrix: os: [ubuntu-latest] - php: [8.1, 8.2, 8.3] - laravel: [10.*,11.*] + php: [8.2, 8.3] + laravel: [10.*] stability: [prefer-dist] - exclude: - - laravel: 11.* - php: 8.1 - name: STD-PULL - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} + name: PULL PHP-${{ matrix.php }} - Laravel-10 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, :psr + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup cache environment id: extcache @@ -35,14 +33,180 @@ jobs: with: php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} - key: ${{ runner.os }}-${{ env.extensionKey }} + key: ${{ env.extensionKey }} - name: Cache extensions - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.extcache.outputs.dir }} - key: ${{ steps.extcache.outputs.key }} - restore-keys: ${{ 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 + with: + php-version: ${{ matrix.php }} + extensions: ${{ env.extensions }} + tools: phpunit:9.6 + ini-values: memory_limit=512M + coverage: none + 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: ${{ 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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + composer config github-oauth.github.com $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: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Run Unit Tests + run: php ./vendor/bin/paratest --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage + + - name: Run Visuals Tests + run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage + + test-laravel11: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + max-parallel: 2 + matrix: + os: [ubuntu-latest] + php: [8.2, 8.3, 8.4] + laravel: [11.*] + stability: [prefer-dist] + + name: PULL PHP-${{ matrix.php }} - Laravel-11 + env: + extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }} + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr + + 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: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} + restore-keys: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: ${{ env.extensions }} + tools: phpunit:latest + ini-values: memory_limit=512M + coverage: none + 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: ${{ 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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + composer config github-oauth.github.com $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: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Run Unit Tests + run: php ./vendor/bin/paratest --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage + + - name: Run Visuals Tests + run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage + + test-laravel12: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + max-parallel: 2 + matrix: + os: [ubuntu-latest] + php: [8.2, 8.3, 8.4] + laravel: [12.*] + stability: [prefer-dist] + + name: PULL PHP-${{ matrix.php }} - Laravel-12 + env: + extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }} + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr + + 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: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} + restore-keys: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -63,22 +227,31 @@ jobs: run: | echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-STDPULL-PHP-${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-STDPULL-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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} + composer config github-oauth.github.com $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: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + - name: Run Unit Tests - run: php ./vendor/bin/paratest --no-coverage --processes=4 + run: php ./vendor/bin/paratest --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage + + - name: Run Visuals Tests + run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ce258214d..70fb43bd8 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,29 +1,33 @@ -name: run-tests +name: Run Standard Tests -on: [push] +on: + push: + branches: + - '*' # matches every branch that doesn't contain a '/' + - '*/*' # matches every branch containing a single '/' + - '**' # matches every branch + - '!master' jobs: - test: + test-laravel10: runs-on: ${{ matrix.os }} strategy: fail-fast: false + max-parallel: 2 matrix: - os: [ubuntu-latest] - php: [8.1, 8.2, 8.3] - laravel: [10.*,11.*] + os: [ubuntu-24.04] + php: [8.2, 8.3] + laravel: [10.*] stability: [prefer-dist] - exclude: - - laravel: 11.* - php: 8.1 - name: STD-PUSH - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} + name: PHP-${{ matrix.php }} - Laravel-10 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, :psr + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup cache environment id: extcache @@ -34,11 +38,177 @@ jobs: key: ${{ env.extensionKey }} - name: Cache extensions - uses: actions/cache@v3 + 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 + with: + php-version: ${{ matrix.php }} + extensions: ${{ env.extensions }} + tools: phpunit:9.6 + ini-values: memory_limit=512M + coverage: none + 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: ${{ 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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + composer config github-oauth.github.com $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: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Run Unit Tests + run: php ./vendor/bin/paratest --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage + + - name: Run Visuals Tests + run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage + + test-laravel11: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + max-parallel: 2 + matrix: + os: [ubuntu-24.04] + php: [8.2, 8.3, 8.4] + laravel: [11.*] + stability: [prefer-dist] + + name: PHP-${{ matrix.php }} - Laravel-11 + env: + extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr + + 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: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} + restore-keys: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: ${{ env.extensions }} + tools: phpunit:latest + ini-values: memory_limit=512M + coverage: none + 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: ${{ 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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + composer config github-oauth.github.com $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: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Run Unit Tests + run: php ./vendor/bin/paratest --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage + + - name: Run Visuals Tests + run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage + + test-laravel12: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + max-parallel: 2 + matrix: + os: [ubuntu-24.04] + php: [8.2, 8.3, 8.4] + laravel: [12.*] + stability: [prefer-dist] + + name: PHP-${{ matrix.php }} - Laravel-12 + env: + extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr + + 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: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} + restore-keys: ${{ matrix.os }}-${{ steps.extcache.outputs.key }} - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -59,15 +229,17 @@ jobs: run: | echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 + - 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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} + composer config github-oauth.github.com $GITHUB_TOKEN - name: Install dependencies if: steps.composer-cache.outputs.cache-hit != 'true' @@ -81,4 +253,7 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Run Unit Tests - run: php ./vendor/bin/paratest --no-coverage --processes=4 + run: php ./vendor/bin/paratest --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage + + - name: Run Visuals Tests + run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage diff --git a/.gitignore b/.gitignore index a36981422..848cfaa9b 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,6 @@ phpunit.xml.dist.dev .history/* .env phpunit.xml.bak -phpstan.txt \ No newline at end of file +phpstan.txt +coverage.xml +./tmp/** diff --git a/CHANGELOG.md b/CHANGELOG.md index 438e9610b..ce9dd01ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,464 @@ All notable changes to `laravel-livewire-tables` will be documented in this file -## [v3.2.6] - UNRELEASED +## [v3.7.3] - 2025-05-03 +### Bug Fixes +- Interim fix for Livewire Component Columns to mitigate core Livewire bug by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2258 + +## [v3.7.2] - 2025-05-03 +### Bug Fixes +- Improved Pagination UX for Bootstrap 4 by @daniel-skopek in https://github.com/rappasoft/laravel-livewire-tables/pull/2251 +- Fixes for livewire component column by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2245 +- Boolean filter for bootstrap by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2244 +- Update IsNumericFilter.php by @G4Zz0L1 in https://github.com/rappasoft/laravel-livewire-tables/pull/2230 +- Fixed collapsed function bug with tailwind CSS on mobile version by CarlosChub27 in https://github.com/rappasoft/laravel-livewire-tables/pull/2228 + +### New Features +- Add Wrapper Options to ArrayColumn by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2255 + +### Tweaks +- Tidying PHPDocs by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2246 + +## [v3.7.1] - 2025-02-28 +### Bug Fixes +- Ensure that LinkColumn is included in query if "from" is defined by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2224 + +## [v3.7.0] - 2025-02-27 + +### Bug Fixes +- Filters urgent fixes - correct Filter Default QueryString by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2188 +- Fix Search Field in bootstrap by @yparitcher in https://github.com/rappasoft/laravel-livewire-tables/pull/2183 +- Add "after-tools" configurable area by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2180 + +### New Features +- Add setFilterPillTitleAsHtml by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2204 +- Enable setting styles for sorting pills as a configuration by @HussamAlhennawi in https://github.com/rappasoft/laravel-livewire-tables/pull/2179 +- Enable setting styles for filter pills as a configuration by @HussamAlhennawi in https://github.com/rappasoft/laravel-livewire-tables/pull/2178 +- Enable setting styles for column select as a configuration by @HussamAlhennawi in https://github.com/rappasoft/laravel-livewire-tables/pull/2175 +- BulkActionTweaks - Adding default checkbox, customising attribute behaviours by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2203 +- Laravel v12 Support by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2217 + +### Tweaks +- Tweak for text pill title by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2206 +- Tweak Return Types by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2205 +- Migrate Column/Filter Traits by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2202 +- Filter Rationalisation & Livewire Array Filter improvements by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2191 +- Move Filter View Traits by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2189 +- Filter Trait - Reorganization by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2181 + +## [v3.6.0] - 2025-01-16 + +### Bug Fixes +- Ensure Default Sorting Is Shown in Pills by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2138 +- Filters + - Find Filters Before Query by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2143 + - Migrate Filter Code Appropriately by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2146 + - Migrate Filter Status into Own Trait by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2147 + +### Tweaks +- Enable InputAttributes for SelectFilter by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2133 +- Tidy ComponentUtilities, Migrate ColumnSelectQueryString by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2135 +- TH Fixes - Clean-up, efficiency, and Sort Icons fixes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2140 +- Add hasCollapsedColumns as Computed by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2141 +- Tidy up Blade Class Definitions by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2145 +- Tidy ColumnSelectHelpers & displayToolbarFilters Method by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2150 +- Tidy & Improve Collapsed Columns Behaviour by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2159 +- Tidy computed properties behaviour by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2160 +- WithSearch Tweaks by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2163 +- Optimize Header/Footer by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2164 +- Clean up Column Component View and Slot behaviours by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2169 +- Adjustments for ComponentColumn - cleaning up behaviours by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2173 + +### Testing +- Add Missing Test for getCustomSortingPillDirectionsLabel with invalid direction by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2130 +- Add Custom FIlter Input Attributes, Cleanup Filter Tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2131 +- Separate the Unit and Visuals Test Suites by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2144 +- Update PCOV Workflow by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2148 +- Add configurable area test by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2149 +- Add SortingConfiguration Missing Test by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2151 +- Add Missing Search Tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2152 +- Adjust SearchHelpersTest by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2153 +- Add test queryStringWithQueryString by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2154 +- Add missing tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2157 +- Add queryStringAliasTest by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2161 +- Migrate LivewireComponentColumn methods and add some missing basic tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2168 +- Add initial tests for LivewireComponentArrayFilter by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2170 +- Improve centralisation of tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2172 + +## [v3.5.10] - 2024-12-11 +### Tweaks +- Migrate additional Styling into separate traits by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2127 + +## [v3.5.9] - 2024-12-11 +### Tweaks +- Optimize Imports by @edwinvdpol in https://github.com/rappasoft/laravel-livewire-tables/pull/2124 + +## [v3.5.8] - 2024-12-10 +### New Features +- Set bulk action row button attributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2117 +- Add setFilterSlidedownWrapperAttributes and setFilterSlidedownRowAttributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2120 + +### Bug Fixes +- Respect setDisplayPaginationDetailsDisabled for unpaginated tables by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2119 + +### Localisation +- Added neccessary files for Farsi translation by @AmirMehrabi in https://github.com/rappasoft/laravel-livewire-tables/pull/2100 + +### Testing +- Workflow Adjustments by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2108 +- Add extra Search Lazy Tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2107 +- Restore Missing Lazy Search Tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2106 +- Ignore WithEvents Coverage by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2105 +- Add missing tests for WithCustomisations by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2104 +- Add missing LivewireComponentFilterTest and BooleanFilterTest by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2121 + +## [v3.5.7] - 2024-12-01 +### New Features +- IncrementColumn by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2096 +- Add setFilterPopoverAttributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2101 + +### Tweaks +- Remove View TypeHinting in blades due to reported errors by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2097 + +### Blades +- Remove $component from blades to improve performance by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2098 + +### Testing +- Exclude config/database from sources by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2102 +- Add missing tests for WithCustomisations by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2104 +- Ignore WithEvents Coverage by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2105 +- Add Search Lazy Tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2106 +- Add extra Search Lazy Tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2107 + + +## [v3.5.6] - 2024-11-28 +### New Features +- Add Icon to Search Input by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2092 + +### Tweaks +- Search - Rationalisation of blades into files by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2094 +- Columns() Setup Improvements by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2089 +- Typehinting in blade components by @edwinvdpol in https://github.com/rappasoft/laravel-livewire-tables/pull/2081 + +### Testing +- Tweak Workflows to use an env key by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2090 + +## [v3.5.5] - 2024-11-22 +### Bug Fixes +- Fix date range filter default value by @edwinvdpol in https://github.com/rappasoft/laravel-livewire-tables/pull/2082 + +## [v3.5.4] - 2024-11-21 +### Bug Fixes +- Allow JSON and PHP type localisations by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2071 +- Allow lazy loading of tables by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2072 + +### Testing +- RemoveConfigFileFromCoverage by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2080 +- Test for ViewComponentColumn - Cannot return non-array attributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2078 +- BooleanFilter - Add Tests for Null in IsEmpty and Validate by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2077 +- Add Attributes Check For ViewComponentColumn by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2076 +- Add ViewComponentColumn label test by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2075 +- Add ColorColumnTests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2074 + +## [v3.5.3] - 2024-11-18 +### Bug Fixes +- FixSetDefaultPerPage by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2067 +- Fix BooleanColumn unexpected truthy behaviour by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2066 +- Adjustment for DateRangeFilter by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2064 + +### Testing +- Adjust SessionStorageHelpersTest by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2065 +- Add updatedSelectedColumns test for Event by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2060 +- Add test for FilterApplied Event being dispatched by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2059 +- Add Simple updatedSearch tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2058 +- Add test for No Columns defined - throws correct Exception by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2057 + +## [v3.5.2] - 2024-11-09 +## Bug Fixes +- Migrate Localisation back to PHP Files from JSON by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2038 + +## [v3.5.1] - 2024-11-09 +### Bug Fixes +- Fix NumberFilter bug for string values by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2034 +- Fixes for Filter Pills - Split blades, and ensure invalid filter alues are removed by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2035 + +## [v3.5.0] - 2024-11-06 +### Bug Fixes +- Issue in multiple places where there is incorrect brackets in conjunction with coalescing operator (??) by @mrl22 in https://github.com/rappasoft/laravel-livewire-tables/pull/2021 +- Add Value to BooleanColumn custom view by @lrjoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2010 +- Add config option to bypass setting User on Events. by @me-julian in https://github.com/rappasoft/laravel-livewire-tables/pull/2006 +- Livewire column doesn't have title() method by @ChrisThompsonTLDR in https://github.com/rappasoft/laravel-livewire-tables/pull/2002 +- Loading Placeholder Adjustments by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1987 + +### New Features +- Add Sort in QueryString by @lrjoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2018 +- Add Search in QueryString by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2017 +- Add Filter in QueryString by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2011 +- BETA: Livewire Custom Filter (Array) by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2025 + +### Localisation +- Adds Swedish translations by @Aiiion in https://github.com/rappasoft/laravel-livewire-tables/pull/2027 +- Fix missing i18n keys for FR, IT, EN, DE by @khwadj in https://github.com/rappasoft/laravel-livewire-tables/pull/1993 +- Add lang Norwegian and Albanian by @channor in https://github.com/rappasoft/laravel-livewire-tables/pull/1988 + +## [v3.4.22] - 2024-09-29 +### Bug Fixes +- Fix Loading Placeholder Bug - Breaking Table by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1969 + +### New Features +- Add setPaginationWrapperAttributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1978 +- Add configurable areas - before-wrapper and after-wrapper by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1977 +- Add ToolsAttributes and ToolbarAttributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1982 + +### Docs +- Add getTitle reference for setTdAttributes/setTrAttributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1976 +- Add setToolsAttributes and setToolBarAttributes docs by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1984 +- Add docs for the ColumnSelect lifecycle hooks by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1983 + +## [v3.4.21] - 2024-09-25 +### Bug Fixes +- Remove persist from getFilterGenericData by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1966 +- In LaravelLivewireTablesEvent, change the type to Illuminate\Contracts\Auth\Authenticatable by @khwadj in https://github.com/rappasoft/laravel-livewire-tables/pull/1963 +- Fix for Search Field Attribute Defaults by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1962 +- Fix Filter Pills Icon - Tailwind by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1961 +- Add filterComponents into queryString to ensure they're maintained by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1957 +- Reset Current Page on "Per Page" changing by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1953 + +### New Features +- Add setLabelAttributes method to Action, and update Docs for Filter by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1952 + +### Tweaks +- Migration to Core attribute management by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1943 +- Localisation - Avoid Conflicts With Other Packages by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1955 +- GitHub Workflow Tweak for Styling Fixes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1967 +- GitHub Workflow Tweak for Discord - Updates by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1968 + +### Docs +- Fix syntax for DateColumn outputFormat in docs by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1960 + + +## [v3.4.20] - 2024-09-10 +### Bug Fixes +- Revert tableName to be public by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1937 + +## [v3.4.19] - 2024-09-08 +### Bug Fixes +- Adjustment for Laravel 10 GH Workflows by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1933 +- Fixes for ButtonGroupColumn, ImageColumn, LinkColumn - to not default as label if has a "from" property. by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1932 +- Add button type to tailwind pagination blade template by @matzeschmitt in https://github.com/rappasoft/laravel-livewire-tables/pull/1928 + +## [v3.4.18] - 2024-09-08 +### New Features +- Added translation to Polish by @meavric in https://github.com/rappasoft/laravel-livewire-tables/pull/1925 + +### Docs +- Added example for Vertical Scrolling table by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1926 + +## [v3.4.17] - 2024-09-01 +### New Features +- Add hide table option by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1914 +- Add column select session methods by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1913 +- Save filter selection to session (BETA) by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1910 + +### Tweaks +- Use Core Attribute Bag by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1916 +- Use Core HasTheme Methods by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1915 + +## [v3.4.16] - 2024-08-27 +### New Features +- Add icon column by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1902 +- Enable/Disable Tools/Toolbar by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1896 + +### Bug Fixes +- Fix has actions by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1901 +- Use Computed Properties By Default by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1898 + +### Tweaks +- PHPStan - Config File Update and Baseline by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1903 + +## [v3.4.15] - 2024-08-25 +### New Features +- BooleanColumn - Toggleable Callback by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1892 + +### Tweaks +- Doc Type Fixes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1891 + +## [v3.4.14] - 2024-08-25 +### New Features +- Set Action Position (Left/Center/Right) and Set Actions in Toolbar by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1889 + +## [v3.4.13] - 2024-08-25 +### Bug Fixes +- Fix for Action Button with no icon by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1887 + +### Docs +- Add a Recommended Approach document by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1886 +- Reorder the "Getting Started" docs by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1884 + +## [v3.4.12] - 2024-08-23 +### Tweaks +- Adjust Action Button Margins by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1880 + +## [v3.4.11] - 2024-08-23 +### New Features +- Add setIconLeft/setIconRight for Actions by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1877 + +## [v3.4.10] - 2024-08-23 +### Bug Fixes +- Default UseComputedProperties to True to default to new views by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1873 +- Allow Single Date DateRangeFilter by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1872 +- Allow clearing of DateRangeFilter by Text Box by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1875 + +### Docs +- Docs Update by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1876 + +## [v3.4.9] - 2024-08-21 +### Bug Fixes +- Default UseComputedProperties to False to allow previously published views to work by default by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1869 +- Fix superfluous bulk actions tr > by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1868 + +## [v3.4.8] - 2024-08-18 +### New Features +- Add an event dispatch for Filter Was Set when filterComponents is updated by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1861 + +## [v3.4.7] - 2024-08-18 +### Bug Fixes +- Correct a locked property that is entangled in js, and add comments around some key properties to prevent reoccurrence by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1859 + +## [v3.4.6] - 2024-08-15 +### New Features +- Column Features - deselectedIf/selectedIf by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1846 +- Add setTrimSearchStringEnabled/setTrimSearchStringDisabled by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1843 + +### Bug Fixes +- Restore the original JS methods for users with published views by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1848 + +### Tweaks +- Remove Component from Column, move getRows into ComputedProperty by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1838 +- Clean up filter generic data by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1837 +- Further work to clean up Blades, and use Computed Properties by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1850 + +## [v3.4.5] - 2024-08-10 +### Bug Fixes +- Fix sort queryString bug by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1835 + +## [v3.4.4] - 2024-08-10 +### New Features +- Boolean/Toggle Filter by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1830 + +### Bug Fixes +- Merge Column Attributes Back in if Sortable by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1833 + +### Tweaks +- Moving JS to Simplified Method in datatable by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1832 + +## [v3.4.3] - 2024-08-08 +### New Features +- Boolean/Toggle Filter by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1830 + +### Bug Fixes +- View component column fixes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1825 + +### Docs +- Update setDelaySelectAllEnabled Docs by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1829 +- ViewComponentColumn - New method docs by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1828 + +## [v3.4.2] - 2024-08-04 +### New Features +- Additional Events & Customisable Behaviour by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1820 + +### Bug Fixes +- Typehinting to allow events to be used to update Multi-Value Filters by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1822 + +### Tweaks +- Add missing ReturnTypes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1823 +- Removing old $listeners approach, now using the Livewire v3 On attribute by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1821 + +## [v3.4.1] - 2024-08-04 +### Bug Fixes +- Fix ViewComponentColumn issue with not accepting parameters cleanly by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1818 + +## [v3.4.0] - 2024-08-04 +### New Features +- Add Helpers for TextFilters by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1812 +- Change method names for TextFilters handler by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1814 +- Capability to set Reorder Column TH Attributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1811 +- Bulk Actions - Customise Select All Behaviours by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1810 + +### Bug Fixes +- Fix loading spinner for dark tailwind theme by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1809 + +### Tweaks +- Blade Minimisation & ColumnSelect Cleanup by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1806 +- Adjust DateColumn with Missing Tests and Coping with DateTime Casts by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1813 + +### Docs +- Add reference to Bulk Actions TH styling in main styling by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1808 +- Update docs for setPillsLocale by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1800 +- Add note on label method for setAdditionalSelects by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1816 + +## [v3.3.4] - 2024-07-27 +### New Features +- Added capability to setFilterDefaultValue for a DateRangeFilter by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1796 +- Add localised pill values for DateFilter, DateTimeFilter, DateRangeFilter by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1797 + +### Tweaks +- Migrating Carbon usage into Trait, Adding Filter/Search Lifecycle Hooks by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1798 + +## [v3.3.3] - 2024-07-23 +### New Features +- Add additional DateRangeFilter options by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1793 + +## [v3.3.2] - 2024-07-20 +### New Features +- Add a new ViewComponentColumn that runs the construction for a View Component by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1786 +- Set Custom Classes for Collapsing Column - Collapse/Expand buttons by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1785 + +### Bug Fixes +- Fix DateTimeFilter by @RenoLooijmans in https://github.com/rappasoft/laravel-livewire-tables/pull/1784 +- Fix AggregateColumn SnakeCase issue by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1777 + +## [v3.3.1] - 2024-07-16 +### Bug Fixes +- Fix NumberRangeFilter initial state when loaded by querystring by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1774 +- Fix SnakeCase issue with snake-cased relations for AggregateColumn types (AvgColumn, CountColumn, SumColumn) by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1777 + +### New Features +- Set a Prefix for NumberRangeFilter by @RenoLooijmans in https://github.com/rappasoft/laravel-livewire-tables/pull/1773 +- Add Separator customisation for Array Filters for FilterPills by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1772 +- Add bulk actions button/dropdown customisations by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1771 + +## [v3.3.0] - 2024-07-11 +### New Features +- Add new columns (ArrayColumn, AvgColumn, CountColumn, SumColumn) by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1761 +- Add new column WireLinkColumn by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1763 +- Add Option to Retain Selected when Searching/Filtering by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1762 +- Add Option to set locale and default date to DateRangeFilter by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1766 + +## [v3.2.8] - 2024-07-03 +### Bug Fixes +- Fix hide bulk actions when empty not reflecting in frontend by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1747 +- Apply cursor pointer only on clickable columns when using Bootstrap by @MP70 in https://github.com/rappasoft/laravel-livewire-tables/pull/1742 + +### New Features +- Always hide bulk actions option by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1752 +- Add ArrayColumn (BETA) by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1751 +- Optionally disable total item count for simple pagination by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1755 + +### Tweaks +- TypeHint fixes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1750 +- Change Return Type for attributes() to static by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1749 +- Switch to using Composer\InstalledVersions for AboutCommand by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1748 + +## [v3.2.7] - 2024-06-05 +### Bug Fixes +- Ensure HTML Columns return HTML correctly by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1737 + +## [v3.2.6] - 2024-06-05 ### New Features - Add configurable wire:model for filters by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1699 - Customisable Model paths for Make command by @marvoh in https://github.com/rappasoft/laravel-livewire-tables/pull/1714 +- Add HTML Support for LinkColumn by @codecreeper in https://github.com/rappasoft/laravel-livewire-tables/pull/1728 ### Bug Fixes - Fix error with DateColumn when empty by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1726 @@ -1185,4 +1639,4 @@ Ground Up Rebuild [0.1.4]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.3...v0.1.4 [0.1.3]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.2...v0.1.3 [0.1.2]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.1...v0.1.2 -[0.1.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.0...v0.1.1 \ No newline at end of file +[0.1.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.0...v0.1.1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f4e9fea06..af96ac892 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,44 @@ # Contributing -Contributions are very welcome, please find below a summary of what is expected from contributions: +This package is maintained by a core team, backed by a strong community effort, and contributions are extremely welcome! -- Follow the conventions for methods, adding to the relevant configuration/helper trait -- Add properties to the "With" trait +Please find below a brief summary of how to make a good contribution. This helps to ensure a smooth review and merge of a PR. + +## Discussing A Feature +Please do feel free to raise a Discussion topic, a Feature Request Issue, or reach out on the official Discord to discuss any ideas! + +## Starting A Contribution +- Always create a fresh branch in your fork for every change. This should be based on the "development" branch, as other branches may be outdated, or lack the change history. +- Ensure that a PR contains a single feature/fix. PRs with multiple features often end up with merge conflicts! +- Avoid introducing a breaking change. If your change makes a radical or substantial change, then the existing behaviour should be maintained as the default. The core team tracks these, and as major versions are reached, may introduce new default behaviours. + +## Generic Information +- Avoid adding any additional dependencies/requirements to the package unless discussed and approved by the core team. - Typehint both properties and return values -- Add a comment to the method -- Add tests for new methods -- Add documentation for new methods \ No newline at end of file +- Add a comment to the method to explain what it does, this does not/should not be lengthy! + +## Views +- Where amending/appending to Views/Blades, ensure that you cater for Tailwind, Bootstrap-4 and Bootstrap-5 to ensure continued support + +## Tests +- Always add tests for new methods +- Review existing tests if you make changes. +- The project maintains a very high level of test coverage. A PR that reduces this coverage is less likely to be readily accepted. + +## Documentation +There is comprehensive documentation available for existing features. Please add documentation for any new/amended methods, as otherwise this may result in delays, which may be significant! + +## Conventions +- Please follow the project conventions below: + +### Core Features +A feature set typically exists in a "With" trait (For example - Rappasoft\LaravelLivewireTables\Traits\WithColumns.php) +- The "WithColumns" contains any properties, and any key methods +- Each feature set has a "Helper" and "Configuration" trait associated with it, for setting and getting properties, both server-side, and client-side. + +## Actions, Columns and Filters +An Action/Column/Filter type exists in the "Views" section (For example Rappasoft\LaravelLivewireTables\Views\Columns\DateColumn.php) +- Each Action/Column/Filter again has a "Helper" and "Configuration" trait associated with it, for setting and getting properties +- Actions should extend Rappasoft\LaravelLivewireTables\Views\Action (or a class that extends this) +- Columns should extend Rappasoft\LaravelLivewireTables\Views\Column (or a class that extends this) +- Filters should extend Rappasoft\LaravelLivewireTables\Views\Filter (or a class that extends this) + diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ffd644706..f4a2f3e2d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -5,22 +5,27 @@ # Localisation Contributors | Language | Contributor(s) | | --- | --- | +| Albanian (SQ) | [channor] (https://github.com/channor) | | Arabic (AR) | None | | Catalan (CA) | None | | Brazilian (pt_BR) | [irineujunior](https://github.com/irineujunior)| | Chinese - Taiwan (TW) | None | | Danish (DA) | [jeppeolesen](https://github.com/jeppeolesen) | | Dutch (NL) | [siebsie23](https://github.com/siebsie23), [spekkie2002](https://github.com/spekkie2002), [Jerimu](https://github.com/Jerimu) | -| English (EN) | Core Team | +| English (EN) | Core Maintainers | +| Farsi (FA) | [AmirMehrabi](https://github.com/AmirMehrabi) | | Finnish (FI) | [devmikromike](https://github.com/devmikromike) | -| French (FR) | [dgillier](https://github.com/dgillier) | -| German (DE) | None | +| French (FR) | [dgillier](https://github.com/dgillier), [khwadj](https://github.com/khwadj)| +| German (DE) | [khwadj](https://github.com/khwadj) | | Indonesian (ID) | None | -| Italian (IT) | Core Team | +| Italian (IT) | Core Maintainers, [khwadj](https://github.com/khwadj) | | Malay (MS) | [wanadri](https://github.com/wanadri) | +| Norwegian (NB) | [channor] (https://github.com/channor) | +| Polish (PL) | [meavric](https://github.com/meavric) | | Portugese (PT) | None | | Russian (RU) | None | | Spanish (ES) | [CristhoferMF](https://github.com/CristhoferMF) | +| Swedish (SV) | [Aiiion](https://github.com/Aiiion) | | Thai (TH) | None | | Turkish (TK) | None | | Ukrainian (UK) | [Oleksandr-Moik](https://github.com/Oleksandr-Moik) | \ No newline at end of file diff --git a/README.md b/README.md index 61e6523ef..16e4c36ee 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Tests](https://github.com/rappasoft/laravel-livewire-tables/actions/workflows/run-tests.yml/badge.svg)](https://github.com/rappasoft/laravel-livewire-tables/actions/workflows/run-tests.yml) [![Total Downloads](https://img.shields.io/packagist/dt/rappasoft/laravel-livewire-tables.svg?style=flat-square)](https://packagist.org/packages/rappasoft/laravel-livewire-tables) [![codecov](https://codecov.io/gh/rappasoft/laravel-livewire-tables/graph/badge.svg?token=1B9VKO9KWG)](https://codecov.io/gh/rappasoft/laravel-livewire-tables) -![PHP Stan Level 5](https://img.shields.io/badge/PHPStan-level%205-brightgreen.svg?style=flat) +![PHP Stan Level 6](https://img.shields.io/badge/PHPStan-level%206-brightgreen.svg?style=flat) ### Enjoying this package? [Buy me a beer 🍺](https://www.buymeacoffee.com/rappasoft) diff --git a/composer.json b/composer.json index d3e9e6372..bd58755ef 100644 --- a/composer.json +++ b/composer.json @@ -23,21 +23,21 @@ } ], "require": { - "php": "^8.1|^8.2|^8.3", + "php": "^8.1|^8.2|^8.3|^8.4", "blade-ui-kit/blade-heroicons": "^2.1", - "illuminate/contracts": "^10.0|^11.0", - "illuminate/support": "^10.0|^11.0", + "illuminate/contracts": "^10.0|^11.0|^12.0", + "illuminate/support": "^10.0|^11.0|^12.0", "livewire/livewire": "^3.0|dev-main" }, "require-dev": { "ext-sqlite3": "*", - "brianium/paratest": "^5.0|^6.0|^7.0|^8.0", + "brianium/paratest": "^5.0|^6.0|^7.0|^8.0|^9.0", + "larastan/larastan": "^2.6|^3.0", "laravel/pint": "^1.10", "monolog/monolog": "*", - "nunomaduro/collision": "^6.0|^7.0|^8.0", - "nunomaduro/larastan": "^2.6", - "orchestra/testbench": "^7.0|^8.0|^9.0", - "phpunit/phpunit": "^9.0|^10.0|^11.0" + "nunomaduro/collision": "^6.0|^7.0|^8.0|^9.0", + "orchestra/testbench": "^7.0|^8.0|^9.0|^10.0", + "phpunit/phpunit": "^9.0|^10.0|^11.0|^12.0" }, "autoload": { "psr-4": { diff --git a/config/livewire-tables.php b/config/livewire-tables.php index 1e0b0b04c..dad9ea43c 100644 --- a/config/livewire-tables.php +++ b/config/livewire-tables.php @@ -30,6 +30,11 @@ */ 'enable_blade_directives' => false, + /** + * Use JSON Translations instead of PHP Array + */ + 'use_json_translations' => false, + /** * Customise Script & Styles Paths */ @@ -72,6 +77,7 @@ 'dateFormat' => 'Y-m-d', // Date format that will be received by the filter 'earliestDate' => null, // The earliest acceptable date 'latestDate' => null, // The latest acceptable date + 'locale' => 'en', // The default locale ], ], @@ -87,6 +93,7 @@ 'minRange' => 0, // The minimum possible value 'maxRange' => 100, // The maximum possible value 'suffix' => '', // A suffix to append to the values when displayed + 'prefix' => '', // A prefix to prepend to the values when displayed ], ], /** @@ -105,11 +112,21 @@ ], /** - * Configuration options for MultiSelectFilter + * Configuration options for MultiSelectDropdownFilter */ 'multiSelectDropdownFilter' => [ 'defaultOptions' => [], 'defaultConfig' => [], ], + /** + * Configuration options for Events + */ + 'events' => [ + /** + * Enable or disable passing the user from Laravel's Auth service to events + */ + 'enableUserForEvent' => true, + ], + ]; diff --git a/coverage.xml b/coverage.xml deleted file mode 100644 index 7428459d2..000000000 --- a/coverage.xml +++ /dev/null @@ -1,2894 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/database/database.sqlite b/database/database.sqlite index 6ab3c4998..1a9e27435 100644 Binary files a/database/database.sqlite and b/database/database.sqlite differ diff --git a/database/migrations/create_test_tables.php.stub b/database/migrations/create_test_tables.php.stub index ef7720eae..4afbd0e13 100644 --- a/database/migrations/create_test_tables.php.stub +++ b/database/migrations/create_test_tables.php.stub @@ -25,6 +25,12 @@ class CreateTestTables extends Migration $table->foreign('species_id')->references('id')->on('species'); }); + Schema::create('owners', function (Blueprint $table) { + $table->id(); + $table->string('name'); + $table->date('date_of_birth')->nullable(); + }); + Schema::create('pets', function (Blueprint $table) { $table->id(); $table->integer('sort')->default(0); @@ -34,10 +40,13 @@ class CreateTestTables extends Migration $table->string('favorite_color')->nullable(); $table->integer('species_id')->unsigned()->nullable(); $table->integer('breed_id')->unsigned()->nullable(); + $table->integer('owner_id')->unsigned()->nullable(); $table->foreign('species_id')->references('id')->on('species'); $table->foreign('breed_id')->references('id')->on('breeds'); + $table->foreign('owner_id')->references('id')->on('owners'); }); + Schema::create('veterinaries', function (Blueprint $table) { $table->id(); $table->string('name')->index(); diff --git a/database/sqlite.database b/database/sqlite.database deleted file mode 100644 index e3c6f68a2..000000000 Binary files a/database/sqlite.database and /dev/null differ diff --git a/docs/bulk-actions/_index.md b/docs/bulk-actions/_index.md index f76ab3244..48cb71a17 100644 --- a/docs/bulk-actions/_index.md +++ b/docs/bulk-actions/_index.md @@ -1,4 +1,4 @@ --- title: Bulk Actions -weight: 9 +weight: 10 --- diff --git a/docs/bulk-actions/available-methods.md b/docs/bulk-actions/available-methods.md index 22b8210ee..74c98e214 100644 --- a/docs/bulk-actions/available-methods.md +++ b/docs/bulk-actions/available-methods.md @@ -184,58 +184,150 @@ public function configure(): void } ``` -## setBulkActionsThAttributes -You may pass an array to this method, which allows you to pass Custom Attributes into the table header +## setShouldAlwaysHideBulkActionsDropdownOption + +Allows hiding the Bulk Actions button & menu, regardless of whether there are any items selected, or hideBulkActionsWhenEmptyEnabled behaviour ```php public function configure(): void { - $this->setBulkActionsThAttributes([ - 'class' => 'bg-red-500', - 'default' => false - ]); + $this->setShouldAlwaysHideBulkActionsDropdownOption(true); } ``` -## setBulkActionsThCheckboxAttributes -You may pass an array to this method, which allows you to pass Custom Attributes into the Select All/None checkbox in the Table Header +## setShouldAlwaysHideBulkActionsDropdownOptionEnabled + +Allows hiding the Bulk Actions button & menu, regardless of whether there are any items selected, or hideBulkActionsWhenEmptyEnabled behaviour ```php public function configure(): void { - $this->setBulkActionsThCheckboxAttributes([ - 'class' => 'bg-blue-500', - 'default' => false - ]); + $this->setShouldAlwaysHideBulkActionsDropdownOptionEnabled(); } ``` -## setBulkActionsTdAttributes -You may pass an array to this method, which allows you to pass Custom Attributes into the td containing the Bulk Actions Checkbox for the row +## setShouldAlwaysHideBulkActionsDropdownOptionDisabled + +Restores the Bulk Actions to default functionality, so it will respect the hideBulkActionsWhenEmptyEnabled behaviour ```php public function configure(): void { - $this->setBulkActionsTdAttributes([ - 'class' => 'bg-green-500', - 'default' => true - ]); + $this->setShouldAlwaysHideBulkActionsDropdownOptionDisabled(); } ``` -## setBulkActionsTdCheckboxAttributes -You may pass an array to this method, which allows you to pass Custom Attributes into the Bulk Actions Checkbox for the row +## setClearSelectedOnSearch + +By default, any selected items for Bulk Actions are cleared upon searching. You may configure this behaviour here. ```php public function configure(): void { - $this->setBulkActionsTdCheckboxAttributes([ - 'class' => 'bg-green-500', - 'default' => true - ]); + $this->setClearSelectedOnSearch(true); +} +``` + + +## setClearSelectedOnSearchEnabled + +By default, any selected items for Bulk Actions are cleared upon searching. This enables this behaviour. + +```php +public function configure(): void +{ + $this->setClearSelectedOnSearchEnabled(); +} +``` + + +## setClearSelectedOnSearchDisabled + +By default, any selected items for Bulk Actions are cleared upon searching. This disables this behaviour, ensuring that selected items are retained after searching. + +```php +public function configure(): void +{ + $this->setClearSelectedOnSearchDisabled(); +} +``` + + +## setClearSelectedOnFilter + +By default, any selected items for Bulk Actions are cleared upon filtering. You may configure this behaviour here. + +```php +public function configure(): void +{ + $this->setClearSelectedOnFilter(true); +} +``` + + +## setClearSelectedOnFilterEnabled + +By default, any selected items for Bulk Actions are cleared upon filtering. This enables this behaviour. + +```php +public function configure(): void +{ + $this->setClearSelectedOnFilterEnabled(); +} +``` + + +## setClearSelectedOnFilterDisabled + +By default, any selected items for Bulk Actions are cleared upon filtering. This disables this behaviour, ensuring that selected items are retained after filtering. + +```php +public function configure(): void +{ + $this->setClearSelectedOnFilterDisabled(); +} +``` + +## setDelaySelectAllEnabled + +By default, using the "Select All", immediately makes a call to the backend to populate the "selected" array with the primary key of all resultant rows (based on Filter/Search). This can be slow with large result sets, but gives a good user experience with smaller results, as it allows them to "Select All" and then deselect some rows. + +```php +public function configure(): void +{ + $this->setDelaySelectAllEnabled(); } ``` + +This prevents the default behaviour from firing, which improves performance when working with very large sets of data. With this feature enabled, the backend update will not fire, however an indication that all result rows have been selected will be passed to the backend, and the frontend will behave as if all rows are selected. + + +When running your Bulk Action, having used "Select All", you may then access the array of "all rows" based on your most recent search/filter results: +```php +$rows = $this->getSelectedRows(); +``` + +Once your bulk action completes, ensure that you call: +```php +$this->clearSelected(); +``` + +### IMPORTANT NOTES +#### Actions After Frontend Select All +If you apply a filter/search/sort, then the delay select will be abandoned, and the array will be populated. Ensure that you do not do this! + +#### Use of setSelectAll +Do NOT call either of these methods, as they will prevent the correct method from working. These two methods SELECT ALL regardless of what the frontend is doing. +```php +$this->setSelectAllStatus(true); +$this->setSelectAllEnabled(); +``` + + +## setDelaySelectAllDisabled + +This is the default behaviour, see setDelaySelectEnabled for details on what enabling this does. \ No newline at end of file diff --git a/docs/bulk-actions/styling.md b/docs/bulk-actions/styling.md new file mode 100644 index 000000000..af4d26b38 --- /dev/null +++ b/docs/bulk-actions/styling.md @@ -0,0 +1,106 @@ +--- +title: Styling +weight: 5 +--- + +## setBulkActionsThAttributes + +You may pass an array to this method, which allows you to pass Custom Attributes into the table header + +```php +public function configure(): void +{ + $this->setBulkActionsThAttributes([ + 'class' => 'bg-red-500', + 'default' => false + ]); +} +``` + +## setBulkActionsThCheckboxAttributes + +You may pass an array to this method, which allows you to pass Custom Attributes into the Select All/None checkbox in the Table Header + +```php +public function configure(): void +{ + $this->setBulkActionsThCheckboxAttributes([ + 'class' => 'bg-blue-500', + 'default' => false + ]); +} +``` + +## setBulkActionsTdAttributes + +You may pass an array to this method, which allows you to pass Custom Attributes into the td containing the Bulk Actions Checkbox for the row + +```php +public function configure(): void +{ + $this->setBulkActionsTdAttributes([ + 'class' => 'bg-green-500', + 'default' => true + ]); +} +``` + +## setBulkActionsTdCheckboxAttributes + +You may pass an array to this method, which allows you to pass Custom Attributes into the Bulk Actions Checkbox for the row + +```php +public function configure(): void +{ + $this->setBulkActionsTdCheckboxAttributes([ + 'class' => 'bg-green-500', + 'default' => true + ]); +} +``` + +## setBulkActionsButtonAttributes + +You may pass an array to this method, which allows you to pass Custom Attributes into the Bulk Actions Button in the Toolbar + +```php +public function configure(): void +{ + $this->setBulkActionsButtonAttributes([ + 'class' => 'bg-green-500', + 'default-colors' => true, + 'default-styling' => true, + ]); +} +``` + +## setBulkActionsMenuAttributes + +You may pass an array to this method, which allows you to pass Custom Attributes into the Bulk Actions Menu + +```php +public function configure(): void +{ + $this->setBulkActionsMenuAttributes([ + 'class' => 'bg-green-500', + 'default-colors' => true, + 'default-styling' => true, + ]); +} +``` + + +## setBulkActionsMenuItemAttributes + +You may pass an array to this method, which allows you to pass Custom Attributes into Items on the Bulk Actions Menu + +```php +public function configure(): void +{ + $this->setBulkActionsMenuItemAttributes([ + 'class' => 'bg-green-500', + 'default-colors' => true, + 'default-styling' => true, + ]); +} +``` diff --git a/docs/column-types/_index.md b/docs/column-types/_index.md new file mode 100644 index 000000000..821c869a2 --- /dev/null +++ b/docs/column-types/_index.md @@ -0,0 +1,4 @@ +--- +title: Column Types +weight: 5 +--- diff --git a/docs/column-types/array_column.md b/docs/column-types/array_column.md new file mode 100644 index 000000000..c0799bf3a --- /dev/null +++ b/docs/column-types/array_column.md @@ -0,0 +1,88 @@ +--- +title: Array Columns (beta) +weight: 2 +--- + +Array columns provide an easy way to work with and display an array of data from a field. + +```php +ArrayColumn::make('notes', 'name') + ->data(fn($value, $row) => ($row->notes)) + ->outputFormat(fn($index, $value) => "".$value->name."") + ->separator('
') + ->sortable(), +``` + +## Empty Value +You may define the default/empty value using the "emptyValue" method + +```php +ArrayColumn::make('notes', 'name') + ->emptyValue('Unknown'), +``` + +## Wrapping the Output + +As the ArrayColumn is designed to handle multiple related records, you can choose to wrap these for improved UX. + +It is recommended that you utilise the built-in flexCol or flexRow approaches, which will also disable the separator + +### flexCol +This adds either: +- Tailwind: 'flex flex-col' +- Bootstrap: 'd-flex d-flex-col' + +And merges any attributes specified in the sole parameter (as an array) +```php +ArrayColumn::make('notes', 'name') + ->data(fn($value, $row) => ($row->notes)) + ->outputFormat(fn($index, $value) => "".$value->name."") + ->flexCol(['class' => 'bg-red-500']) + ->sortable(), +``` + +### flexRow + +This adds either: +- Tailwind: 'flex flex-row' +- Bootstrap: 'd-flex d-flex-row' + +And merges any attributes specified in the sole parameter (as an array) +```php +ArrayColumn::make('notes', 'name') + ->data(fn($value, $row) => ($row->notes)) + ->outputFormat(fn($index, $value) => "".$value->name."") + ->flexRow(['class' => 'bg-red-500']) + ->sortable(), +``` + +### Manually + +You can also specify a wrapperStart and wrapperEnd, for example, for an unordered list: + +```php +ArrayColumn::make('notes', 'name') + ->data(fn($value, $row) => ($row->notes)) + ->outputFormat(fn($index, $value) => "
  • ".$value->name."
  • ") + ->wrapperStart("") + ->sortable(), +``` + +## See Also + +Please also see the following for other available methods: + \ No newline at end of file diff --git a/docs/column-types/avg_column.md b/docs/column-types/avg_column.md new file mode 100644 index 000000000..f0f7680ac --- /dev/null +++ b/docs/column-types/avg_column.md @@ -0,0 +1,30 @@ +--- +title: Avg Columns (beta) +weight: 3 +--- + +Avg columns provide an easy way to display the "Average" of a field on a relation. + +```php + AvgColumn::make('Average Related User Age') + ->setDataSource('users','age') + ->sortable(), +``` + +The "sortable()" callback can accept a callback, or you can use the default behaviour, which calculates the correct field to sort on. + +Please also see the following for other available methods: + \ No newline at end of file diff --git a/docs/column-types/boolean_columns.md b/docs/column-types/boolean_columns.md new file mode 100644 index 000000000..51c3702e4 --- /dev/null +++ b/docs/column-types/boolean_columns.md @@ -0,0 +1,137 @@ +--- +title: Boolean Columns +weight: 4 +--- + +Boolean columns are good if you have a column type that is a true/false, or 0/1 value. + +For example: + +```php +BooleanColumn::make('Active') +``` + +Would yield: + +![Boolean Column](https://imgur.com/LAk6gHY.png) + +### Using your own view + +If you don't want to use the default view and icons you can set your own: + +```php +BooleanColumn::make('Active') + ->setView('my.active.view') +``` + +You will have access to `$component`, `$status`, and `$successValue`. + +To help you better understand, this is the Tailwind implementation of BooleanColumn: + +```html +@if ($status) + + + +@else + + + +@endif +``` + +### Setting the truthy value + +If you want the false value to be the green option, you can set: + +```php +BooleanColumn::make('Active') + ->setSuccessValue(false); // Makes false the 'successful' option +``` + +That would swap the colors of the icons in the image above. + +### Setting the status value + +By default, the `$status` is set to: + +```php +(bool)$value === true +``` + +You can override this functionality: + +```php +BooleanColumn::make('Active') + // Note: Parameter `$row` available as of v2.4 + ->setCallback(function(string $value, $row) { + // Figure out what makes $value true + }), +``` + +### Different types of boolean display + +By default, the BooleanColumn displays icons. + +If you would like the BooleanColumn to display a plain Yes/No, you can set: + +```php +BooleanColumn::make('Active') + ->yesNo() +``` + +### Toggleable + +You may call a defined public function, which should live within your Table Component, to allow "toggling" against your database: + +```php +BooleanColumn::make('Active', 'status') + ->toggleable('changeStatus'), +``` + +Then your "changeStatus" method may look like (make sure you are selecting the `id` in the query) +```php + public function changeStatus(int $id) + { + $item = $this->model::find($id); + $item->status = !$item->status; + $item->save(); + } +``` + +### Toggleable Confirmation Message + +You may define a confirmation message prior to executing your toggleable() method. The method will only be executed upon confirming. +```php +BooleanColumn::make('Active', 'status') + ->confirmMessage('Are you sure that you want to change the status?') + ->toggleable('changeStatus'), +``` + +Then your "changeStatus" method may look like (make sure you are selecting the `id` in the query) +```php + public function changeStatus(int $id) + { + $item = $this->model::find($id); + $item->status = !$item->status; + $item->save(); + } +``` + + +### Additional Methods +Please also see the following for other available methods: + \ No newline at end of file diff --git a/docs/column-types/button_group_column.md b/docs/column-types/button_group_column.md new file mode 100644 index 000000000..da8ff7399 --- /dev/null +++ b/docs/column-types/button_group_column.md @@ -0,0 +1,41 @@ +--- +title: Button Group Columns +weight: 5 +--- + +Button group columns let you provide an array of LinkColumns to display in a single cell. + +```php +ButtonGroupColumn::make('Actions') + ->attributes(function($row) { + return [ + 'class' => 'space-x-2', + ]; + }) + ->buttons([ + LinkColumn::make('View') // make() has no effect in this case but needs to be set anyway + ->title(fn($row) => 'View ' . $row->name) + ->location(fn($row) => route('user.show', $row)) + ->attributes(function($row) { + return [ + 'class' => 'underline text-blue-500 hover:no-underline', + ]; + }), + LinkColumn::make('Edit') + ->title(fn($row) => 'Edit ' . $row->name) + ->location(fn($row) => route('user.edit', $row)) + ->attributes(function($row) { + return [ + 'target' => '_blank', + 'class' => 'underline text-blue-500 hover:no-underline', + ]; + }), + ]), +``` + + +Please also see the following for other available methods: +- [https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/available-methods](Available Methods) +- [https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/column-selection](Column Selection) +- [https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/secondary-header](Secondary Header) +- [https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/footer](Footer) diff --git a/docs/column-types/color_columns.md b/docs/column-types/color_columns.md new file mode 100644 index 000000000..eeae20b2f --- /dev/null +++ b/docs/column-types/color_columns.md @@ -0,0 +1,57 @@ +--- +title: Color Columns +weight: 6 +--- + +Color columns provide an easy way to a Color in a Column + +You may pass either pass a CSS-compliant colour as a field +```php +ColorColumn::make('Favourite Colour', 'favourite_color'), +``` + +Or you may use a Callback +```php +ColorColumn::make('Favourite Colour') + ->color( + function ($row) { + if ($row->success_rate < 40) + { + return '#ff0000'; + } + else if ($row->success_rate > 90) + { + return '#008000'; + } + else return '#ffa500'; + + } + ), +``` + +You may also specify attributes to use on the div displaying the color, to adjust the size or appearance, this receives the full row. By default, this will replace the standard classes, to retain them, set "default" to true. To then over-ride, you should prefix your classes with "!" to signify importance. +```php + ColorColumn::make('Favourite Colour') + ->attributes(function ($row) { + return [ + 'class' => '!rounded-lg self-center', + 'default' => true, + ]; + }), +``` + +Please also see the following for other available methods: + \ No newline at end of file diff --git a/docs/column-types/component_column.md b/docs/column-types/component_column.md new file mode 100644 index 000000000..79611121f --- /dev/null +++ b/docs/column-types/component_column.md @@ -0,0 +1,43 @@ +--- +title: Component Columns +weight: 7 +--- + +Component columns let you specify a component name and attributes and provides the column value to the slot. + +```php +// Before +Column::make("Email", "email") + ->format(function ($value) { + return view('components.alert') + ->with('attributes', new ComponentAttributeBag([ + 'type' => Str::endsWith($value, 'example.org') ? 'success' : 'danger', + 'dismissible' => true, + ])) + ->with('slot', $value); + }), + +// After +ComponentColumn::make('E-mail', 'email') + ->component('email') + ->attributes(fn ($value, $row, Column $column) => [ + 'type' => Str::endsWith($value, 'example.org') ? 'success' : 'danger', + 'dismissible' => true, + ]), +``` + +Please also see the following for other available methods: + \ No newline at end of file diff --git a/docs/column-types/count_column.md b/docs/column-types/count_column.md new file mode 100644 index 000000000..beb7d3437 --- /dev/null +++ b/docs/column-types/count_column.md @@ -0,0 +1,30 @@ +--- +title: Count Columns (beta) +weight: 8 +--- + +Count columns provide an easy way to display the "Count" of a relation. + +```php + CountColumn::make('Related Users') + ->setDataSource('users') + ->sortable(), +``` + +The "sortable()" callback can accept a callback, or you can use the default behaviour, which calculates the correct field to sort on. + +Please also see the following for other available methods: + \ No newline at end of file diff --git a/docs/column-types/date_columns.md b/docs/column-types/date_columns.md new file mode 100644 index 000000000..17ffa581b --- /dev/null +++ b/docs/column-types/date_columns.md @@ -0,0 +1,43 @@ +--- +title: Date Columns +weight: 9 +--- + +Date columns provide an easy way to display dates in a given format, without having to use repetitive format() methods or partial views. + +You may pass either a DateTime object, in which you can define an "outputFormat" +```php +DateColumn::make('Updated At', 'updated_at') + ->outputFormat('Y-m-d H:i:s'), +``` + +Or you may pass a string, in which case you can define an "inputFormat" in addition to the outputFormat: +```php +DateColumn::make('Last Charged', 'last_charged_at') + ->inputFormat('Y-m-d H:i:s') + ->outputFormat('Y-m-d'), +``` + +You may also set an "emptyValue" to use when there is no value from the database: +```php +DateColumn::make('Last Charged', 'last_charged_at') + ->inputFormat('Y-m-d H:i:s') + ->outputFormat('Y-m-d') + ->emptyValue('Not Found'), +``` + +Please also see the following for other available methods: + \ No newline at end of file diff --git a/docs/column-types/icon_column.md b/docs/column-types/icon_column.md new file mode 100644 index 000000000..28c74458f --- /dev/null +++ b/docs/column-types/icon_column.md @@ -0,0 +1,87 @@ +--- +title: Icon Columns (beta) +weight: 10 +--- + +Icon columns provide a way to display icons in your table without having to use `format()` or partial views. + +### setIcon +setIcon requires a valid path to an SVG (Directly or via a Library), it receives the $row, and $value (if available) to help you customise which icon to use +```php +IconColumn::make('Icon', 'status') + ->setIcon(function ($row, $value) { + if($value == 1) { + return "heroicon-o-check-circle"; + } + else + { + return "heroicon-o-x-circle"; + } + }), +``` + +### attributes +Attributes receives the $row, and $value (if available) to help you customise which attributes to apply, you may pass both classes, and other SVG specific attributes. +```php +IconColumn::make('Icon', 'status') + ->setIcon(function ($row, $value) { if($value == 1) { return "heroicon-o-check-circle"; } else { return "heroicon-o-x-circle"; } }) + ->attributes(function ($row, $value) { + if($value == 1) { + return [ + 'class' => 'w-6 h-6', + 'stroke' => '#008000' + ]; + } + else + { + return [ + 'class' => 'w-3 h-3', + 'stroke' => '#FF0000' + ]; + } + }), +``` + +For example: +### Example +```php +IconColumn::make('Icon', 'status') + ->setIcon(function ($row, $value) { if($value == 1) { return "heroicon-o-check-circle"; } else { return "heroicon-o-x-circle"; } }) + ->attributes(function ($row, $value) { + if($value == 3) { + return [ + 'class' => 'w-3 h-3', + 'stroke' => '#008000' + ]; + } + else if($value == 2) { + return [ + 'class' => 'w-3 h-3', + 'stroke' => '#0000FF' + ]; + } + else + { + return [ + 'class' => 'w-3 h-3', + 'stroke' => '#FF0000' + ]; + } + }), +``` + +Please also see the following for other available methods: + \ No newline at end of file diff --git a/docs/column-types/image_columns.md b/docs/column-types/image_columns.md new file mode 100644 index 000000000..4225593b3 --- /dev/null +++ b/docs/column-types/image_columns.md @@ -0,0 +1,42 @@ +--- +title: Image Columns +weight: 11 +--- + +Image columns provide a way to display images in your table without having to use `format()` or partial views: + +```php +ImageColumn::make('Avatar') + ->location( + fn($row) => storage_path('app/public/avatars/' . $row->id . '.jpg') + ), +``` + +You may also pass an array of attributes to apply to the image tag: + +```php +ImageColumn::make('Avatar') + ->location( + fn($row) => storage_path('app/public/avatars/' . $row->id . '.jpg') + ) + ->attributes(fn($row) => [ + 'class' => 'rounded-full', + 'alt' => $row->name . ' Avatar', + ]), +``` + +Please also see the following for other available methods: + \ No newline at end of file diff --git a/docs/column-types/increment_column.md b/docs/column-types/increment_column.md new file mode 100644 index 000000000..76ea7496c --- /dev/null +++ b/docs/column-types/increment_column.md @@ -0,0 +1,12 @@ +--- +title: Increment Column (beta) +weight: 12 +--- + +The IncrementColumn provides an easy way to display the row's index in the loop. + +Please note - this is not linked to the row's primary key! + +```php + IncrementColumn::make('#'), +``` \ No newline at end of file diff --git a/docs/column-types/link_columns.md b/docs/column-types/link_columns.md new file mode 100644 index 000000000..7c36ee077 --- /dev/null +++ b/docs/column-types/link_columns.md @@ -0,0 +1,40 @@ +--- +title: Link Columns +weight: 13 +--- + +Link columns provide a way to display HTML links in your table without having to use `format()` or partial views: + +```php +LinkColumn::make('Action') + ->title(fn($row) => 'Edit') + ->location(fn($row) => route('admin.users.edit', $row)), +``` + +You may also pass an array of attributes to apply to the `a` tag: + +```php +LinkColumn::make('Action') + ->title(fn($row) => 'Edit') + ->location(fn($row) => route('admin.users.edit', $row)) + ->attributes(fn($row) => [ + 'class' => 'rounded-full', + 'alt' => $row->name . ' Avatar', + ]), +``` + +Please also see the following for other available methods: + \ No newline at end of file diff --git a/docs/column-types/livewire_component_column.md b/docs/column-types/livewire_component_column.md new file mode 100644 index 000000000..f48859641 --- /dev/null +++ b/docs/column-types/livewire_component_column.md @@ -0,0 +1,31 @@ +--- +title: Livewire Component (beta) +weight: 14 +--- + +Livewire Component Columns allow for the use of a Livewire Component as a Column. + +This is **not recommended** as due to the nature of Livewire, it becomes inefficient at scale. + +## component +```php +LivewireComponentColumn::make('Action') + ->component('PathToLivewireComponent'), + +``` + +Please also see the following for other available methods: + diff --git a/docs/column-types/standard_column.md b/docs/column-types/standard_column.md new file mode 100644 index 000000000..7d5b4ede3 --- /dev/null +++ b/docs/column-types/standard_column.md @@ -0,0 +1,31 @@ +--- +title: Standard Column +weight: 1 +--- + +A standard Column has a multitude of different options, making it simple for you to display your data, as documented below: + + \ No newline at end of file diff --git a/docs/column-types/sum_column.md b/docs/column-types/sum_column.md new file mode 100644 index 000000000..638818b23 --- /dev/null +++ b/docs/column-types/sum_column.md @@ -0,0 +1,30 @@ +--- +title: Sum Columns (beta) +weight: 15 +--- + +Sum columns provide an easy way to display the "Sum" of a field on a relation. + +```php + SumColumn::make('Total Age of Related Users') + ->setDataSource('users','age') + ->sortable(), +``` + +The "sortable()" callback can accept a callback, or you can use the default behaviour, which calculates the correct field to sort on. + +Please also see the following for other available methods: + \ No newline at end of file diff --git a/docs/column-types/view_component_column.md b/docs/column-types/view_component_column.md new file mode 100644 index 000000000..5fdb4b46d --- /dev/null +++ b/docs/column-types/view_component_column.md @@ -0,0 +1,44 @@ +--- +title: View Component Columns +weight: 16 +--- + +View Component columns let you specify a component name and attributes and provide attributes to the View Component. This will render the View Component in it's entirety. + +```php + +ViewComponentColumn::make('E-mail', 'email') + ->component('email') + ->attributes(fn ($value, $row, Column $column) => [ + 'id' => $row->id, + 'email' => $value, + ]), +``` + +### customComponent + +Should you wish to render the Custom Component in it's entirety, then you may use the customComponent method. Otherwise it will pass in the values directly to the blade, rather than executing your View Component. + +```php +ViewComponentColumn::make('Weight', 'grams') + ->customComponent(\App\View\Components\TestWeight::class) + ->attributes(fn ($value, $row, Column $column) => [ + 'weight' => new Weight($value), + ]), +``` + +Please also see the following for other available methods: + \ No newline at end of file diff --git a/docs/column-types/wire_link_column.md b/docs/column-types/wire_link_column.md new file mode 100644 index 000000000..63c23e8a2 --- /dev/null +++ b/docs/column-types/wire_link_column.md @@ -0,0 +1,53 @@ +--- +title: Wire Link Column (beta) +weight: 17 +--- + +WireLink columns provide a way to display Wired Links in your table without having to use `format()` or partial views, with or without a Confirmation Message + +WireLinkColumn requires title, and an "action", which must be a valid LiveWire method in the current class, or a global method + +Without a Confirmation Message +```php + WireLinkColumn::make("Delete Item") + ->title(fn($row) => 'Delete Item') + ->action(fn($row) => 'delete("'.$row->id.'")'), +``` + +You may also pass a string to "confirmMessage", which will utilise LiveWire 3's "wire:confirm" approach to display a confirmation modal. + +```php + WireLinkColumn::make("Delete Item") + ->title(fn($row) => 'Delete Item') + ->confirmMessage('Are you sure you want to delete this item?') + ->action(fn($row) => 'delete("'.$row->id.'")') + ->attributes(fn($row) => [ + 'class' => 'btn btn-danger', + ]), +``` + +And you may also pass an array of attributes, which will be applied to the "button" element used within the Column +```php + WireLinkColumn::make("Delete Item") + ->title(fn($row) => 'Delete Item') + ->action(fn($row) => 'delete("'.$row->id.'")') + ->attributes(fn($row) => [ + 'class' => 'btn btn-danger', + ]), +``` + +Please also see the following for other available methods: + \ No newline at end of file diff --git a/docs/columns/available-methods.md b/docs/columns/available-methods.md index ab41c7095..18f840b5d 100644 --- a/docs/columns/available-methods.md +++ b/docs/columns/available-methods.md @@ -3,6 +3,10 @@ title: Available Methods weight: 3 --- +## Styling + +To change the CSS classes or other attributes assigned to a Column, use can use [setTdAttributes](../datatable/styling), which allows customising attributes based on column type, name or value. + ## Sorting See also [component sorting configuration](../sorting/available-methods). @@ -25,7 +29,7 @@ Column::make(__('Address')) ### [Multi-column sorting](../sorting/available-methods#setsinglesortingstatus) -In v2, multi-column sorting is **disabled by default**. To enable it you can set the `setSingleSortingDisabled()` method on the component. +Multi-column sorting is **disabled by default**. To enable it you can set the `setSingleSortingDisabled()` method on the component. ```php public function configure(): void @@ -156,6 +160,23 @@ Column::make('My one off column') ), ``` +Note that any field not used elsewhere in the table, that is required (for example creating an attribute based on two unused fields, these must be added to the query with setAdditionalSelects() in the configure() method (See Here)[https://rappasoft.com/docs/laravel-livewire-tables/v3/datatable/available-methods#content-builder]) +```php + public function configure(): void + { + $this->setAdditionalSelects(['users.forename as forename', 'users.surname as surname']); + } +``` + +You can then use the fields: +```php +Column::make('My one off column') + ->label( + fn($row, Column $column) => $row->forename.' '.$row->surname + ) + ->html(), +``` + ## Collapsing The component has the ability to collapse certain columns at different screen sizes. It will add a plus icon as the left most column that will open up a view below the row with the information of the collapsed columns: @@ -281,3 +302,7 @@ Labels are visible by default, but should you wish to override a previous "hideC Column::make('Name') ->setColumnLabelStatusEnabled() ``` + +## See Also +[Column Styling](./styling) + diff --git a/docs/columns/column-selection.md b/docs/columns/column-selection.md index 94c0674a5..0d5872fbb 100644 --- a/docs/columns/column-selection.md +++ b/docs/columns/column-selection.md @@ -23,6 +23,41 @@ Column::make('Address', 'address.address') ->deselected(), ``` +## DeselectedIf + +If you would like a column to be included in the column select but deselected based on an external parameter/callback, you may use this approach. + +Returning "true" will deselect the Column by default, returning "false" will select the Column by default + +```php +Column::make('Address', 'address.address') + ->deselectedIf(fn() => 2 > 1), +``` + +or + +```php +Column::make('Address', 'address.address') + ->deselectedIf(!Auth::user()), +``` + +## SelectedIf + +If you would like a column to be included in the column select and selected based on an external parameter/callback, you may use this approach. + +Returning "true" will select the Column by default, returning "false" will deselect the Column by default + +```php +Column::make('Address', 'address.address') + ->selectedIf(fn() => 2 > 1), +``` +or + +```php +Column::make('Address', 'address.address') + ->selectedIf(Auth::user()), +``` + ## Available Methods ### setColumnSelectStatus @@ -187,4 +222,68 @@ class DataTableColumnsSelectedListener } } -``` \ No newline at end of file +``` + +## Styling + +### setColumnSelectButtonAttributes +Allows for customisation of the appearance of the "Column Select" button + +Note that this utilises a refreshed approach for attributes, and allows for appending to, or replacing the styles and colors independently, via the below methods. + +#### default-colors +Setting to false will disable the default colors for the Column Select button, the default colors are: + +Bootstrap: None + +Tailwind: `text-gray-700 bg-white border-gray-300 hover:bg-gray-50 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600` + +#### default-styling +Setting to false will disable the default styling for the Column Select button, the default styling is: + +Bootstrap: `btn dropdown-toggle d-block w-100 d-md-inline` + +Tailwind: `inline-flex justify-center px-4 py-2 w-full text-sm font-medium rounded-md border shadow-sm focus:ring focus:ring-opacity-50` + +```php +public function configure(): void +{ + $this->setColumnSelectButtonAttributes([ + 'class' => 'focus:border-rose-300 focus:ring-1 focus:ring-rose-300 focus-visible:outline-rose-300', // Add these classes to the column select button + 'default-colors' => false, // Do not output the default colors + 'default-styling' => true // Output the default styling + ]); +} +``` + +### setColumnSelectMenuOptionCheckboxAttributes +Allows for customisation of the appearance of the "Column Select" menu option checkbox + +Note that this utilises a refreshed approach for attributes, and allows for appending to, or replacing the styles and colors independently, via the below methods. + +#### default-colors +Setting to false will disable the default colors for the Column Select menu option checkbox, the default colors are: + +Bootstrap: None + +Tailwind: `text-indigo-600 border-gray-300 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600` +#### default-styling + +Setting to false will disable the default styling for the Column Select menu option checkbox, the default styling is: + +Bootstrap 4: None + +Bootstrap 5: `form-check-input` + +Tailwind: `transition duration-150 ease-in-out rounded shadow-sm focus:ring focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-wait` + +```php +public function configure(): void +{ + $this->setColumnSelectMenuOptionCheckboxAttributes([ + 'class' => 'text-rose-300 focus:border-rose-300 focus:ring-rose-300', // Add these classes to the column select menu option checkbox + 'default-colors' => false, // Do not output the default colors + 'default-styling' => true // Output the default styling + ]); +} +``` diff --git a/docs/columns/footer.md b/docs/columns/footer.md index caf9a45d4..c4b3877e7 100644 --- a/docs/columns/footer.md +++ b/docs/columns/footer.md @@ -21,7 +21,7 @@ See also [footer component configuration](../footer/available-methods). ## Using a filter as a footer -As of version 2.7, you can use a filter as a footer. +You can use a filter as a footer. ```php // Example filter diff --git a/docs/columns/other-column-types.md b/docs/columns/other-column-types.md index dc80da449..f12adf6e7 100644 --- a/docs/columns/other-column-types.md +++ b/docs/columns/other-column-types.md @@ -3,247 +3,48 @@ title: Other Column Types weight: 4 --- -## Boolean Columns - -Boolean columns are good if you have a column type that is a true/false, or 0/1 value. - -For example: - -```php -BooleanColumn::make('Active') -``` - -Would yield: - -![Boolean Column](https://imgur.com/LAk6gHY.png) - -### Using your own view - -If you don't want to use the default view and icons you can set your own: - -```php -BooleanColumn::make('Active') - ->setView('my.active.view') -``` - -You will have access to `$component`, `$status`, and `$successValue`. - -To help you better understand, this is the Tailwind implementation of BooleanColumn: - -```html -@if ($status) - - - -@else - - - -@endif -``` - -### Setting the truthy value - -If you want the false value to be the green option, you can set: - -```php -BooleanColumn::make('Active') - ->setSuccessValue(false); // Makes false the 'successful' option -``` - -That would swap the colors of the icons in the image above. - -### Setting the status value - -By default, the `$status` is set to: - -```php -(bool)$value === true -``` - -You can override this functionality: - -```php -BooleanColumn::make('Active') - // Note: Parameter `$row` available as of v2.4 - ->setCallback(function(string $value, $row) { - // Figure out what makes $value true - }), -``` - -### Different types of boolean display - -By default, the BooleanColumn displays icons. - -If you would like the BooleanColumn to display a plain Yes/No, you can set: - -```php -BooleanColumn::make('Active') - ->yesNo() -``` -## Color Columns - -Color columns provide an easy way to a Color in a Column - -You may pass either pass a CSS-compliant colour as a field -```php -ColorColumn::make('Favourite Colour', 'favourite_color'), -``` - -Or you may use a Callback -```php -ColorColumn::make('Favourite Colour') - ->color( - function ($row) { - if ($row->success_rate < 40) - { - return '#ff0000'; - } - else if ($row->success_rate > 90) - { - return '#008000'; - } - else return '#ffa500'; - - } - ), -``` - -You may also specify attributes to use on the div displaying the color, to adjust the size or appearance, this receives the full row. By default, this will replace the standard classes, to retain them, set "default" to true. To then over-ride, you should prefix your classes with "!" to signify importance. -```php - ColorColumn::make('Favourite Colour') - ->attributes(function ($row) { - return [ - 'class' => '!rounded-lg self-center', - 'default' => true, - ]; - }), -``` - -## Date Columns - -Date columns provide an easy way to display dates in a given format, without having to use repetitive format() methods or partial views. - -You may pass either a DateTime object, in which you can define an "outputFormat" -```php -DateColumn::make('Updated At', 'updated_at') - ->outputFormat('Y-m-d H:i:s), -``` - -Or you may pass a string, in which case you can define an "inputFormat" in addition to the outputFormat: -```php -DateColumn::make('Last Charged', 'last_charged_at') - ->inputFormat('Y-m-d H:i:s') - ->outputFormat('Y-m-d'), -``` - -You may also set an "emptyValue" to use when there is no value from the database: -```php -DateColumn::make('Last Charged', 'last_charged_at') - ->inputFormat('Y-m-d H:i:s') - ->outputFormat('Y-m-d') - ->emptyValue('Not Found'), -``` - -## Image Columns - -Image columns provide a way to display images in your table without having to use `format()` or partial views: - -```php -ImageColumn::make('Avatar') - ->location( - fn($row) => storage_path('app/public/avatars/' . $row->id . '.jpg') - ), -``` - -You may also pass an array of attributes to apply to the image tag: - -```php -ImageColumn::make('Avatar') - ->location( - fn($row) => storage_path('app/public/avatars/' . $row->id . '.jpg') - ) - ->attributes(fn($row) => [ - 'class' => 'rounded-full', - 'alt' => $row->name . ' Avatar', - ]), -``` - -## Link Columns - -Link columns provide a way to display HTML links in your table without having to use `format()` or partial views: - -```php -LinkColumn::make('Action') - ->title(fn($row) => 'Edit') - ->location(fn($row) => route('admin.users.edit', $row)), -``` - -You may also pass an array of attributes to apply to the `a` tag: - -```php -LinkColumn::make('Action') - ->title(fn($row) => 'Edit') - ->location(fn($row) => route('admin.users.edit', $row)) - ->attributes(fn($row) => [ - 'class' => 'rounded-full', - 'alt' => $row->name . ' Avatar', - ]), -``` - -## Button Group Columns - -Button group columns let you provide an array of LinkColumns to display in a single cell. - -```php -ButtonGroupColumn::make('Actions') - ->attributes(function($row) { - return [ - 'class' => 'space-x-2', - ]; - }) - ->buttons([ - LinkColumn::make('View') // make() has no effect in this case but needs to be set anyway - ->title(fn($row) => 'View ' . $row->name) - ->location(fn($row) => route('user.show', $row)) - ->attributes(function($row) { - return [ - 'class' => 'underline text-blue-500 hover:no-underline', - ]; - }), - LinkColumn::make('Edit') - ->title(fn($row) => 'Edit ' . $row->name) - ->location(fn($row) => route('user.edit', $row)) - ->attributes(function($row) { - return [ - 'target' => '_blank', - 'class' => 'underline text-blue-500 hover:no-underline', - ]; - }), - ]), -``` - -## Component Columns - -Component columns let you specify a component name and attributes and provides the column value to the slot. - -```php -// Before -Column::make("Email", "email") - ->format(function ($value) { - return view('components.alert') - ->with('attributes', new ComponentAttributeBag([ - 'type' => Str::endsWith($value, 'example.org') ? 'success' : 'danger', - 'dismissible' => true, - ])) - ->with('slot', $value); - }), - -// After -ComponentColumn::make('E-mail', 'email') - ->component('email') - ->attributes(fn ($value, $row, Column $column) => [ - 'type' => Str::endsWith($value, 'example.org') ? 'success' : 'danger', - 'dismissible' => true, - ]), -``` + \ No newline at end of file diff --git a/docs/columns/reusable-columns.md b/docs/columns/reusable-columns.md index 53b5865b2..d913d80d3 100644 --- a/docs/columns/reusable-columns.md +++ b/docs/columns/reusable-columns.md @@ -10,7 +10,7 @@ To mitigate the pain of maintaining this, two new methods have been introduced. These methods both function in exactly the same way as your standard columns(), and expect an array of columns. Any columns defined in prependColumns() will be the first columns in your list of columns. -``` +```php public function prependColumns(): array { return []; @@ -18,7 +18,7 @@ public function prependColumns(): array ``` Any columns defined in appendColumns() will be the last columns in your list of columns. -``` +```php public function appendColumns(): array { return []; @@ -28,7 +28,7 @@ public function appendColumns(): array You can call these in your trait, and they will be automatically appended/prepended to tables. For example, to append a Column for Updated At -``` +```php public function appendColumns(): array { return [ diff --git a/docs/columns/secondary-header.md b/docs/columns/secondary-header.md index 31790b3e8..258db8d30 100644 --- a/docs/columns/secondary-header.md +++ b/docs/columns/secondary-header.md @@ -21,7 +21,7 @@ See also [secondary header component configuration](../secondary-header/availabl ## Using a filter as a secondary header -As of version 2.7, you can use a filter as a header. +You can use a filter as a header. ```php // Example filter diff --git a/docs/columns/styling.md b/docs/columns/styling.md new file mode 100644 index 000000000..7862c9566 --- /dev/null +++ b/docs/columns/styling.md @@ -0,0 +1,302 @@ +--- +title: Styling +weight: 10 +--- + +## Keeping Defaults +To allow simpler customisation on a per-table basis, there are numerous methods available to over-ride the default CSS classes. +Historically, this was provided by a simple toggleable "default" flag. However - in many cases, the original "default" has been expanded to include: + +### Keep Default Colors And Default Styles +- set default flag to true +or +- set default-colors flag to true +- set default-styling flag to true + +### Keep Default Colors Only +- set default flag to false +- set default-colors flag to true +- set default-styling flag to false + +### Keep Default Styling Only +- set default flag to false +- set default-colors flag to false +- set default-styling flag to true + +## Styling The Column Label + +The Column itself provides the capability to style the Label shown in the "th" element. You can set custom attributes to pass to the Column Label on a per-Column basis: + +For example: +```php +Column::make('Name') + ->setLabelAttributes(['class' => 'text-2xl']) +``` +By default, this replaces the default classes on the label, if you would like to keep them, set the default/default-styling/default-colors flags to true as appropriate. + +## Styling Table Elements + +It is important to note that you can also customise the parent TH and TD elements, customising both classes and attributes for each Column's header (using setThAttributes) and each row of that Column (using setTdAttributes), these are available in the configure() method of the table. +This allows you to customise attributes based on the value of the table as well! + +Below is a copy of the relevant sections from [datatable styling](../datatable/styling) to ensure visibility of the options. More are documented on the main datatable styling page. + +## setThAttributes + +Set a list of attributes to override on the th elements. + +If your Column does not have a field (e.g. a label column), then you may use the following, which will utilise the first parameter in Column::make() +```php + $column->getTitle() +``` + +```php +public function configure(): void +{ + // Takes a callback that gives you the current column. + $this->setThAttributes(function(Column $column) { + if ($column->isField('name')) { + return [ + 'class' => 'bg-green-500', + ]; + } + + return []; + }); +} +``` + +### Keeping Default Colors and Default Styling +```php +public function configure(): void +{ + $this->setThAttributes(function(Column $column) { + if ($column->isField('name')) { + return [ + 'default' => true, + 'class' => 'bg-green-500', + ]; + } + + return ['default' => true]; + }); +} +``` + +### Keeping Default Styling Only For the "Name" Column +```php +public function configure(): void +{ + $this->setThAttributes(function(Column $column) { + if ($column->isField('name')) { + return [ + 'default' => false, + 'default-styling' => true, + 'class' => 'text-black bg-green-500 dark:text-white dark:bg-green-900', + ]; + } + + return ['default' => true]; + }); +} +``` + +### Reorder Column +Note: If you are using Reorder, then the th for Reorder can be [styled separately](../reordering/available-methods). However this is now replaced with the following to ensure consistent behaviour. The separate method will be supported until at least v3.6 + +You can also use the "title" of the Column, which will be "reorder" for the "reorder" Column: +```php +public function configure(): void +{ + $this->setThAttributes(function(Column $column) { + if ($column->getTitle() == 'reorder') + { + return [ + 'class' => 'bg-green-500 dark:bg-green-800', + 'default' => false, + 'default-colors' => false, + ]; + + } + + return ['default' => true]; + }); +} +``` + +### Bulk Actions Column +Note: If you are using Bulk Actions, then the th for Bulk Actions can be [styled separately](../bulk-actions/customisations). However this is now replaced with the following to ensure consistent behaviour. The separate method will be supported until at least v3.6 + +You can also use the "title" of the Column, which will be "bulkactions" for the "Bulk Actions" Column: +```php +public function configure(): void +{ + $this->setThAttributes(function(Column $column) { + if ($column->getTitle() == 'bulkactions') + { + return [ + 'class' => 'bg-yellow-500 dark:bg-yellow-800', + 'default' => false, + 'default-colors' => false, + ]; + + } + + return ['default' => true]; + }); +} +``` + +## setThSortButtonAttributes + +Set a list of attributes to override on the th sort button elements + +```php +public function configure(): void +{ + // Takes a callback that gives you the current column. + $this->setThSortButtonAttributes(function(Column $column) { + if ($column->isField('name')) { + return [ + 'class' => 'bg-green-500', + ]; + } + + return []; + }); +} +``` + +## setTrAttributes + +Set a list of attributes to override on the tr elements + +```php +public function configure(): void +{ + // Takes a callback that gives you the current row and its index + $this->setTrAttributes(function($row, $index) { + if ($index % 2 === 0) { + return [ + 'class' => 'bg-gray-200', + ]; + } + + return []; + }); +} +``` + +By default, this replaces the default classes on the tr, if you would like to keep them, set the appropriate default flag (see above) + +```php +public function configure(): void +{ + $this->setTrAttributes(function($row, $index) { + if ($index % 2 === 0) { + return [ + 'default' => true, + 'class' => 'bg-gray-200', + ]; + } + + return ['default' => true]; + }); +} +``` + +## setTdAttributes + +Set a list of attributes to override on the td elements. For example, changing the background color between red/green based on whether the "total" field is over or under 1000. + +If your Column does not have a field (e.g. a label column), then you may use the following, which will utilise the first parameter in Column::make() +```php + $column->getTitle() +``` + +```php +public function configure(): void +{ + // Takes a callback that gives you the current column, row, column index, and row index + $this->setTdAttributes(function(Column $column, $row, $columnIndex, $rowIndex) { + if ($column->isField('total') && $row->total < 1000) { + return [ + 'class' => 'bg-red-500 text-white', + ]; + } + elseif ($column->isField('total') && $row->total >= 1000) { + return [ + 'class' => 'bg-green-500 text-white', + ]; + } + + return []; + }); +} +``` + +By default, this replaces the default classes on the td, if you would like to keep them, set the appropriate default flag (see above). + +```php +public function configure(): void +{ + // Takes a callback that gives you the current column, row, column index, and row index + $this->setTdAttributes(function(Column $column, $row, $columnIndex, $rowIndex) { + if ($column->isField('total') && $row->total < 1000) { + return [ + 'default' => true, + 'class' => 'bg-red-500 text-white', + ]; + } + + return ['default' => true]; + }); +} + +``` + +### Reorder Column +Note: If you are using Reorder, then the td for Reorder can be [styled separately](../reordering/available-methods). However this is now replaced with the following to ensure consistent behaviour. The separate method will be supported until at least v3.6 + +You can use the "title" of the Column, which will be "reorder" for the "reorder" Column: +```php +public function configure(): void +{ + $this->setTdAttributes(function(Column $column) { + if ($column->getTitle() == 'reorder') + { + return [ + 'class' => 'bg-green-500 dark:bg-green-800', + 'default' => false, + 'default-colors' => false, + ]; + + } + + return ['default' => true]; + }); +} +``` + +### Bulk Actions Column +Note: If you are using Bulk Actions, then the td for Bulk Actions can be [styled separately](../bulk-actions/customisations). However this is now replaced with the following to ensure consistent behaviour. The separate method will be supported until at least v3.6 + +You can use the "title" of the Column, which will be "bulkactions" for the "Bulk Actions" Column: +```php +public function configure(): void +{ + $this->setTdAttributes(function(Column $column) { + if ($column->getTitle() == 'bulkactions') + { + return [ + 'class' => 'bg-yellow-500 dark:bg-yellow-800', + 'default' => false, + 'default-colors' => false, + ]; + + } + + return ['default' => true]; + }); +} +``` diff --git a/docs/datatable/available-methods.md b/docs/datatable/available-methods.md index f774367f4..01023973e 100644 --- a/docs/datatable/available-methods.md +++ b/docs/datatable/available-methods.md @@ -18,285 +18,21 @@ public function configure(): void } ``` -## Attributes - -### setComponentWrapperAttributes - -Set a list of attributes to override on the main wrapper of the component - -```php -public function configure(): void -{ - $this->setComponentWrapperAttributes([ - 'id' => 'my-id', - 'class' => 'this that', - ]); -} -``` - -### setTableWrapperAttributes - -Set a list of attributes to override on the div that wraps the table - -```php -public function configure(): void -{ - $this->setTableWrapperAttributes([ - 'id' => 'my-id', - 'class' => 'this that', - ]); -} -``` - -By default, this replaces the default classes on the table wrapper, if you would like to keep them, set the default flag to true. - -```php -public function configure(): void -{ - $this->setTableWrapperAttributes([ - 'default' => true, - 'class' => 'added these classes', - ]); -} -``` - -### setTableAttributes - -Set a list of attributes to override on the table element - -```php -public function configure(): void -{ - $this->setTableAttributes([ - 'id' => 'my-id', - 'class' => 'this that', - ]); -} -``` - -By default, this replaces the default classes on the table, if you would like to keep them, set the default flag to true. - -```php -public function configure(): void -{ - $this->setTableAttributes([ - 'default' => true, - 'class' => 'added these classes', - ]); -} -``` - -### setTheadAttributes - -Set a list of attributes to override on the thead element - -```php -public function configure(): void -{ - $this->setTheadAttributes([ - 'id' => 'my-id', - 'class' => 'this that', - ]); -} -``` - -By default, this replaces the default classes on the thead, if you would like to keep them, set the default flag to true. - -```php -public function configure(): void -{ - $this->setTheadAttributes([ - 'default' => true, - 'class' => 'added these classes', - ]); -} -``` - -### setTbodyAttributes - -Set a list of attributes to override on the tbody element - -```php -public function configure(): void -{ - $this->setTbodyAttributes([ - 'id' => 'my-id', - 'class' => 'this that', - ]); -} -``` - -By default, this replaces the default classes on the tbody, if you would like to keep them, set the default flag to true. - -```php -public function configure(): void -{ - $this->setTbodyAttributes([ - 'default' => true, - 'class' => 'added these classes', - ]); -} -``` - -### setThAttributes - -Set a list of attributes to override on the th elements - -```php -public function configure(): void -{ - // Takes a callback that gives you the current column. - $this->setThAttributes(function(Column $column) { - if ($column->isField('name')) { - return [ - 'class' => 'bg-green-500', - ]; - } - - return []; - }); -} -``` +### useComputedPropertiesDisabled -By default, this replaces the default classes on the th, if you would like to keep them, set the default flag to true. +If you have published the Views **prior to v3.4.5**, and do not wish to remove the published views, then you should add the following call, which will disable the new Computed Properties behaviour. Note that publishing the views is not recommended! ```php public function configure(): void { - $this->setThAttributes(function(Column $column) { - if ($column->isField('name')) { - return [ - 'default' => true, - 'class' => 'bg-green-500', - ]; - } - - return ['default' => true]; - }); + $this->useComputedPropertiesDisabled(); } ``` -### setThSortButtonAttributes -Set a list of attributes to override on the th sort button elements - -```php -public function configure(): void -{ - // Takes a callback that gives you the current column. - $this->setThSortButtonAttributes(function(Column $column) { - if ($column->isField('name')) { - return [ - 'class' => 'bg-green-500', - ]; - } - - return []; - }); -} -``` - -### setTrAttributes - -Set a list of attributes to override on the tr elements - -```php -public function configure(): void -{ - // Takes a callback that gives you the current row and its index - $this->setTrAttributes(function($row, $index) { - if ($index % 2 === 0) { - return [ - 'class' => 'bg-gray-200', - ]; - } - - return []; - }); -} -``` - -By default, this replaces the default classes on the tr, if you would like to keep them, set the default flag to true. - -```php -public function configure(): void -{ - $this->setTrAttributes(function($row, $index) { - if ($index % 2 === 0) { - return [ - 'default' => true, - 'class' => 'bg-gray-200', - ]; - } - - return ['default' => true]; - }); -} -``` - -### setTdAttributes - -Set a list of attributes to override on the td elements - -```php -public function configure(): void -{ - // Takes a callback that gives you the current column, row, column index, and row index - $this->setTdAttributes(function(Column $column, $row, $columnIndex, $rowIndex) { - if ($column->isField('total') && $row->total < 1000) { - return [ - 'class' => 'bg-red-500 text-white', - ]; - } - - return []; - }); -} -``` - -By default, this replaces the default classes on the td, if you would like to keep them, set the default flag to true. - -```php -public function configure(): void -{ - // Takes a callback that gives you the current column, row, column index, and row index - $this->setTdAttributes(function(Column $column, $row, $columnIndex, $rowIndex) { - if ($column->isField('total') && $row->total < 1000) { - return [ - 'default' => true, - 'class' => 'bg-red-500 text-white', - ]; - } - - return ['default' => true]; - }); -} - -``` -### setSearchFieldAttributes - -Set a list of attributes to override on the search field - -```php -public function configure(): void -{ - $this->setSearchFieldAttributes([ - 'class' => 'this that', - ]); -} -``` +## Attributes -By default, this replaces the default classes on the search field, if you would like to keep them, set the default flag to true. - -```php -public function configure(): void -{ - $this->setSearchFieldAttributes([ - 'default' => true, - 'class' => 'added these classes', - ]); -} -``` +Documentation for Data Table Styling/Attributes is now: [Here](../datatable/styling) ## Offline @@ -340,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 @@ -454,11 +154,11 @@ public function configure(): void Set the message displayed when the table is filtered but there are no results to show. -Defaults to: "_No items found. Try to broaden your search._" +Defaults to: "_No items found, try to broaden your search._" ```php public function configure(): void { $this->setEmptyMessage('No results found'); } -``` +``` \ No newline at end of file diff --git a/docs/datatable/configurable-areas.md b/docs/datatable/configurable-areas.md index bb9d78a5b..489a42cd6 100644 --- a/docs/datatable/configurable-areas.md +++ b/docs/datatable/configurable-areas.md @@ -26,6 +26,7 @@ You can use the `setConfigurableAreas` method to set multiple areas that you wan public function configure(): void { $this->setConfigurableAreas([ + 'before-wrapper' => 'path.to.my.view', 'before-tools' => 'path.to.my.view', 'toolbar-left-start' => 'path.to.my.view', 'toolbar-left-end' => 'path.to.my.view', @@ -33,8 +34,10 @@ public function configure(): void 'toolbar-right-end' => 'path.to.my.view', 'before-toolbar' => 'path.to.my.view', 'after-toolbar' => 'path.to.my.view', + 'after-tools' => 'path.to.my.view', 'before-pagination' => 'path.to.my.view', 'after-pagination' => 'path.to.my.view', + 'after-wrapper' => 'path.to.my.view', ]); } ``` diff --git a/docs/datatable/events.md b/docs/datatable/events.md index 69f52a104..dc81a5695 100644 --- a/docs/datatable/events.md +++ b/docs/datatable/events.md @@ -3,9 +3,10 @@ title: Events weight: 2 --- -These are the available events on the datatable component that you can fire from your application: +### Listened For +These are the available events on the datatable component that you can fire from your application, or client-side -### refreshDatatable +#### refreshDatatable ```php $this->dispatch('refreshDatatable'); @@ -13,7 +14,7 @@ $this->dispatch('refreshDatatable'); Calls `$refresh` on the component. Good for updating from external sources or as an alternative to polling. -### setSort +#### setSort You can have the table sort a specific column: @@ -21,7 +22,7 @@ You can have the table sort a specific column: $this->dispatch('setSort', 'name', 'asc'); ``` -### clearSorts +#### clearSorts You can clear all the applied sorts: @@ -29,7 +30,7 @@ You can clear all the applied sorts: $this->dispatch('clearSorts'); ``` -### setFilter +#### setFilter You can have the table run a specific filter: @@ -37,10 +38,111 @@ You can have the table run a specific filter: $this->dispatch('setFilter', 'status', '1'); ``` -### clearFilters +#### clearFilters You can have the table clear all filters: ```php $this->dispatch('clearFilters'); ``` + +### Dispatched + +There are several events, all in the Rappasoft\LaravelLivewireTables\Events namespace +| Event Name | Event Purpose | Data Passed | +| --- | --- | --- | +| ColumnsSelected | Applied whenever a Column is selected/deselected from view | The Table Name ($tableName), Selected Columns ($value), Logged In User ($user) | +| 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 + +This enables all Dispatched Events. This should be used with caution, as more events will be introduced in the future. + +```php +public function configure(): void +{ + $this->enableAllEvents(); +} +``` + +#### disableAllEvents + +This disables all Dispatched Events. + +```php +public function configure(): void +{ + $this->disableAllEvents(); +} +``` + +#### enableColumnSelectEvent + +Enables the Column Select Event, has no impact on other events + +```php +public function configure(): void +{ + $this->enableColumnSelectEvent(); +} +``` + +#### disableColumnSelectEvent + +Disables the Column Select Event, has no impact on other events + +```php +public function configure(): void +{ + $this->disableColumnSelectEvent(); +} +``` + +#### enableSearchAppliedEvent + +Enables the Search Applied Event, has no impact on other events + +```php +public function configure(): void +{ + $this->enableSearchAppliedEvent(); +} +``` + +#### disableSearchAppliedEvent + +Disables the Search Applied Event, has no impact on other events + +```php +public function configure(): void +{ + $this->disableSearchAppliedEvent(); +} +``` + +#### enableFilterAppliedEvent + +Enables the Filter Applied Event, has no impact on other events + +```php +public function configure(): void +{ + $this->enableFilterAppliedEvent(); +} +``` + +#### disableFilterAppliedEvent + +Disables the Filter Applied Event, has no impact on other events + +```php +public function configure(): void +{ + $this->disableFilterAppliedEvent(); +} +``` 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 new file mode 100644 index 000000000..937a6df94 --- /dev/null +++ b/docs/datatable/styling.md @@ -0,0 +1,499 @@ +--- +title: Styling +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). + +## Keeping Defaults +To allow simpler customisation on a per-table basis, there are numerous methods available to over-ride the default CSS classes. +Historically, this was provided by a simple toggleable "default" flag. However - in many cases, the original "default" has been expanded to include: + +### Keep Default Colors And Default Styles +- set default flag to true +or +- set default-colors flag to true +- set default-styling flag to true + +### Keep Default Colors Only +- set default flag to false +- set default-colors flag to true +- set default-styling flag to false + +### Keep Default Styling Only +- set default flag to false +- set default-colors flag to false +- set default-styling flag to true + + +## Attributes + +### setComponentWrapperAttributes + +Set a list of attributes to override on the main wrapper of the component + +```php +public function configure(): void +{ + $this->setComponentWrapperAttributes([ + 'id' => 'my-id', + 'class' => 'this that', + ]); +} +``` + +### setTableWrapperAttributes + +Set a list of attributes to override on the div that wraps the table + +```php +public function configure(): void +{ + $this->setTableWrapperAttributes([ + 'id' => 'my-id', + 'class' => 'this that', + ]); +} +``` + +By default, this replaces the default classes on the table wrapper, if you would like to keep them, set the default flag to true. + +```php +public function configure(): void +{ + $this->setTableWrapperAttributes([ + 'default' => true, + 'class' => 'added these classes', + ]); +} +``` + +### setTableAttributes + +Set a list of attributes to override on the table element + +```php +public function configure(): void +{ + $this->setTableAttributes([ + 'id' => 'my-id', + 'class' => 'this that', + ]); +} +``` + +By default, this replaces the default classes on the table, if you would like to keep them, set the default flag to true. + +```php +public function configure(): void +{ + $this->setTableAttributes([ + 'default' => true, + 'class' => 'added these classes', + ]); +} +``` + +### setTheadAttributes + +Set a list of attributes to override on the thead element + +```php +public function configure(): void +{ + $this->setTheadAttributes([ + 'id' => 'my-id', + 'class' => 'this that', + ]); +} +``` + +By default, this replaces the default classes on the thead, if you would like to keep them, set the default flag to true. + +```php +public function configure(): void +{ + $this->setTheadAttributes([ + 'default' => true, + 'class' => 'added these classes', + ]); +} +``` + +### setTbodyAttributes + +Set a list of attributes to override on the tbody element + +```php +public function configure(): void +{ + $this->setTbodyAttributes([ + 'id' => 'my-id', + 'class' => 'this that', + ]); +} +``` + +By default, this replaces the default classes on the tbody, if you would like to keep them, set the default flag to true. + +```php +public function configure(): void +{ + $this->setTbodyAttributes([ + 'default' => true, + 'class' => 'added these classes', + ]); +} +``` + +### setThAttributes + +Set a list of attributes to override on the th elements. + +If your Column does not have a field (e.g. a label column), then you may use the following, which will utilise the first parameter in Column::make() +```php + $column->getTitle() +``` + +```php +public function configure(): void +{ + // Takes a callback that gives you the current column. + $this->setThAttributes(function(Column $column) { + if ($column->isField('name')) { + return [ + 'class' => 'bg-green-500', + ]; + } + + return []; + }); +} +``` + +#### Keeping Default Colors and Default Styling +```php +public function configure(): void +{ + $this->setThAttributes(function(Column $column) { + if ($column->isField('name')) { + return [ + 'default' => true, + 'class' => 'bg-green-500', + ]; + } + + return ['default' => true]; + }); +} +``` + +#### Keeping Default Styling Only For the "Name" Column +```php +public function configure(): void +{ + $this->setThAttributes(function(Column $column) { + if ($column->isField('name')) { + return [ + 'default' => false, + 'default-styling' => true, + 'class' => 'text-black bg-green-500 dark:text-white dark:bg-green-900', + ]; + } + + return ['default' => true]; + }); +} +``` + +#### Reorder Column +Note: If you are using Reorder, then the th for Reorder can be [styled separately](../reordering/available-methods). However this is now replaced with the following to ensure consistent behaviour. The separate method will be supported until at least v3.6 + +You can also use the "title" of the Column, which will be "reorder" for the "reorder" Column: +```php +public function configure(): void +{ + $this->setThAttributes(function(Column $column) { + if ($column->getTitle() == 'reorder') + { + return [ + 'class' => 'bg-green-500 dark:bg-green-800', + 'default' => false, + 'default-colors' => false, + ]; + + } + + return ['default' => true]; + }); +} +``` +#### Bulk Actions Column +Note: If you are using Bulk Actions, then the th for Bulk Actions can be [styled separately](../bulk-actions/customisations). However this is now replaced with the following to ensure consistent behaviour. The separate method will be supported until at least v3.6 + +You can also use the "title" of the Column, which will be "bulkactions" for the "Bulk Actions" Column: +```php +public function configure(): void +{ + $this->setThAttributes(function(Column $column) { + if ($column->getTitle() == 'bulkactions') + { + return [ + 'class' => 'bg-yellow-500 dark:bg-yellow-800', + 'default' => false, + 'default-colors' => false, + ]; + + } + + return ['default' => true]; + }); +} +``` + + + + +### setThSortButtonAttributes + +Set a list of attributes to override on the th sort button elements + +```php +public function configure(): void +{ + // Takes a callback that gives you the current column. + $this->setThSortButtonAttributes(function(Column $column) { + if ($column->isField('name')) { + return [ + 'class' => 'bg-green-500', + ]; + } + + return []; + }); +} +``` + +### setTrAttributes + +Set a list of attributes to override on the tr elements + +```php +public function configure(): void +{ + // Takes a callback that gives you the current row and its index + $this->setTrAttributes(function($row, $index) { + if ($index % 2 === 0) { + return [ + 'class' => 'bg-gray-200', + ]; + } + + return []; + }); +} +``` + +By default, this replaces the default classes on the tr, if you would like to keep them, set the default flag to true. + +```php +public function configure(): void +{ + $this->setTrAttributes(function($row, $index) { + if ($index % 2 === 0) { + return [ + 'default' => true, + 'class' => 'bg-gray-200', + ]; + } + + return ['default' => true]; + }); +} +``` + +### setTdAttributes + +Set a list of attributes to override on the td elements + +If your Column does not have a field (e.g. a label column), then you may use the following, which will utilise the first parameter in Column::make() +```php + $column->getTitle() +``` + +```php +public function configure(): void +{ + // Takes a callback that gives you the current column, row, column index, and row index + $this->setTdAttributes(function(Column $column, $row, $columnIndex, $rowIndex) { + if ($column->isField('total') && $row->total < 1000) { + return [ + 'class' => 'bg-red-500 text-white', + ]; + } + + return []; + }); +} +``` + +By default, this replaces the default classes on the td, if you would like to keep them, set the default flag to true. + +```php +public function configure(): void +{ + // Takes a callback that gives you the current column, row, column index, and row index + $this->setTdAttributes(function(Column $column, $row, $columnIndex, $rowIndex) { + if ($column->isField('total') && $row->total < 1000) { + return [ + 'default' => true, + 'class' => 'bg-red-500 text-white', + ]; + } + + return ['default' => true]; + }); +} + +``` +### setSearchFieldAttributes + +Set a list of attributes to override on the search field + +```php +public function configure(): void +{ + $this->setSearchFieldAttributes([ + 'class' => 'this that', + ]); +} +``` + +By default, this replaces the default classes on the search field, if you would like to keep them, set the default flag to true. + +```php +public function configure(): void +{ + $this->setSearchFieldAttributes([ + 'default' => true, + 'class' => 'added these classes', + ]); +} +``` + +### setCollapsingColumnButtonCollapseAttributes + +This customises the look & feel of the button displayed to Collapse an expanded Collapsed Column + +```php +public function configure(): void +{ + $this->setCollapsingColumnButtonCollapseAttributes([ + 'class' => 'text-blue-500', + ]); +} +``` + +By default, this replaces the default classes on the button, if you would like to keep: +Default Colors: set default-colors flag to true. +Default Styling: set default-styling flag to true. + +#### Keeping the Default Styling +```php +public function configure(): void +{ + $this->setCollapsingColumnButtonCollapseAttributes([ + 'default-styling' => true, + 'class' => 'text-blue-500', + ]); +} +``` + +#### Keeping the Default Colors +```php +public function configure(): void +{ + $this->setCollapsingColumnButtonCollapseAttributes([ + 'default-colors' => true, + 'class' => 'h-12 w-12', + ]); +} +``` + +#### Replacing All +```php +public function configure(): void +{ + $this->setCollapsingColumnButtonCollapseAttributes([ + 'class' => 'h-12 w-12 text-blue-500', + ]); +} +``` + + +### setCollapsingColumnButtonExpandAttributes + +This customises the look & feel of the button displayed to Expand a collapsed Collapsed Column + +```php +public function configure(): void +{ + $this->setCollapsingColumnButtonExpandAttributes([ + 'class' => 'text-red-500', + ]); +} +``` + +By default, this replaces the default classes on the button, if you would like to keep: +Default Colors: set default-colors flag to true. +Default Styling: set default-styling flag to true. + +#### Keeping the Default Styling +```php +public function configure(): void +{ + $this->setCollapsingColumnButtonExpandAttributes([ + 'default-styling' => true, + 'class' => 'text-red-500', + ]); +} +``` + +#### Keeping the Default Colors +```php +public function configure(): void +{ + $this->setCollapsingColumnButtonExpandAttributes([ + 'default-colors' => true, + 'class' => 'h-12 w-12', + ]); +} +``` + +#### Replacing All +```php +public function configure(): void +{ + $this->setCollapsingColumnButtonExpandAttributes([ + 'class' => 'h-12 w-12 text-red-500', + ]); +} +``` + +### Vertical Scrolling Example +Should you wish to implement a table with a responsive height, and vertical scrolling for additional rows, a basic example is below that demonstrates the approach, noting that you will likely wish to adjust the break-points! + +```php +public function configure(): void +{ + + $this->setTableWrapperAttributes([ + 'class' => 'max-h-56 md:max-h-72 lg:max-h-96 overflow-y-scroll', + ]); + $this->setTheadAttributes([ + 'class' => 'sticky top-0 ' + ]); +} +``` + +Keep in mind that you must only call methods from configure() once to avoid overriding or conflicting results. \ No newline at end of file diff --git a/docs/examples/_index.md b/docs/examples/_index.md index a831d1a26..03b1d982b 100644 --- a/docs/examples/_index.md +++ b/docs/examples/_index.md @@ -1,4 +1,4 @@ --- title: Examples -weight: 14 +weight: 16 --- diff --git a/docs/filter-types/_index.md b/docs/filter-types/_index.md index 6c6d8ccf4..3631183ba 100644 --- a/docs/filter-types/_index.md +++ b/docs/filter-types/_index.md @@ -1,4 +1,4 @@ --- title: Filter Types -weight: 11 +weight: 12 --- diff --git a/docs/filter-types/filters-boolean.md b/docs/filter-types/filters-boolean.md new file mode 100644 index 000000000..e73343afd --- /dev/null +++ b/docs/filter-types/filters-boolean.md @@ -0,0 +1,39 @@ +--- +title: Boolean Filters (beta) +weight: 2 +--- + +## Beta +This is currently in beta, but should work with Tailwind, Bootstrap 4 and Bootstrap 5 as of latest version + +## Details + +The BooleanFilter is designed so that you can toggle a more complex query/filter, as opposed to being a yes/no type of filter (which is what the SelectFilter is perfect for) + +For example, your filter may look like this, toggling the filter from true to false would apply/not apply a more complex query to the query. + +```php + BooleanFilter::make('Limit to Older Enabled Users') + ->filter(function (Builder $builder, bool $enabled) { + if ($enabled) + { + $builder->where('status',true)->where('age', '>', 60); + } + }) +``` + +Many of the standard methods are available, for example +```php + BooleanFilter::make('Limit to Older Enabled Users') + ->filter(function (Builder $builder, bool $enabled) { + if ($enabled) + { + $builder->where('status',true)->where('age', '>', 60); + } + }) + ->setFilterPillValues([ + true => 'Active', + false => 'Inactive', + ]) + ->setFilterDefaultValue(true) +``` \ No newline at end of file diff --git a/docs/filter-types/filters-date.md b/docs/filter-types/filters-date.md index 488cda84f..f59cda5d4 100644 --- a/docs/filter-types/filters-date.md +++ b/docs/filter-types/filters-date.md @@ -1,10 +1,8 @@ --- title: Date Filters -weight: 2 +weight: 3 --- -## Date Filters - Date filters are HTML date elements. ```php @@ -35,6 +33,7 @@ public function filters(): array } ``` +## setFilterDefaultValue Date filters also support the setFilterDefaultValue() method, which must be a valid date in the "Y-m-d" format. This will apply as a default until removed. ```php public function filters(): array @@ -49,5 +48,22 @@ public function filters(): array ]; } ``` - + +## setPillsLocale +Date Filters also support the setPillsLocale method, which allows you to set a locale for use in generating the Filter Pills values +```php +public function filters(): array +{ + return [ + DateFilter::make('Verified From') + ->setPillsLocale('fr ') // Use French localisation for the Filter Pills values + ->config([ + 'min' => '2020-01-01', // Earliest Acceptable Date + 'max' => '2021-12-31', // Latest Acceptable Date + 'pillFormat' => 'd M Y', // Format for use in Filter Pills + 'placeholder' => 'Enter Date', // A placeholder value + ]) + ]; +} +``` diff --git a/docs/filter-types/filters-daterange.md b/docs/filter-types/filters-daterange.md index 37d0ea552..71241daba 100644 --- a/docs/filter-types/filters-daterange.md +++ b/docs/filter-types/filters-daterange.md @@ -1,10 +1,8 @@ --- title: DateRange Filters -weight: 3 +weight: 4 --- -## DateRange Filters - DateRange filters are Flatpickr based components, and simply filtering by a date range. If you would like to more smoothly filter your query by a start and end date, you can use the DateRangeFilter: ```php @@ -33,6 +31,7 @@ public function filters(): array 'earliestDate' => '2020-01-01', // The earliest acceptable date 'latestDate' => '2023-08-01', // The latest acceptable date 'placeholder' => 'Enter Date Range', // A placeholder value + 'locale' => 'en', ]) ->setFilterPillValues([0 => 'minDate', 1 => 'maxDate']) // The values that will be displayed for the Min/Max Date Values ->filter(function (Builder $builder, array $dateRange) { // Expects an array. @@ -44,31 +43,156 @@ public function filters(): array } ``` +A full list of options is below, please see the Flatpickr documentation for reference as to purpose: +| Config Option | Type | Default | Description | +| ------------- | ------------- | ------------- | ------------- | +| allowInvalidPreload | Boolean | true | Allows the preloading of an invalid date. When disabled, the field will be cleared if the provided date is invalid | +| allowInput | Boolean | false | Allows the user to enter a date directly into the input field. By default, direct entry is disabled. | +| altFormat | String | "F j, Y" | Exactly the same as date format, but for the altInput field | +| altInput | Boolean | false | Show the user a readable date (as per altFormat), but return something totally different to the server. | +| ariaDateFormat | String | "F j, Y" | Defines how the date will be formatted in the aria-label for calendar days, using the same tokens as dateFormat. If you change this, you should choose a value that will make sense if a screen reader reads it out loud. | +| dateFormat | String | 'Y-m-d' | A string of characters which are used to define how the date will be displayed in the input box | +| defaultDate | String | null | Sets the initial selected date | +| defaultHour | Number | 12 | Initial value of the hour element. | +| defaultMinute | Number | 0 | Initial value of the minute element. | +| earliestDate | String/Date | null | The minimum date that a user can start picking from (inclusive) | +| enableTime | Boolean | false | Enables time picker | +| enableSeconds | Boolean | false | Enables seconds in the time picker. | +| hourIncrement | Integer | 1 | Adjusts the step for the hour input (incl. scrolling) | +| latestDate | String/Date | null | The maximum date that a user can pick to (inclusive) | +| locale | String | en | The locale used (see below) | +| minuteIncrement | Integer | 5 | Adjusts the step for the minute input (incl. scrolling) | +| placeholder | String | null | Set a placeholder value for the input field | +| shorthandCurrentMonth | Boolean | false | Show the month using the shorthand version (ie, Sep instead of September). | +| time_24hr | Boolean | false | Displays time picker in 24 hour mode without AM/PM selection when enabled. | +| weekNumbers | Boolean | false | Enables display of week numbers in calendar. | + +## setFilterDefaultValue +You may use this to set a default value for the filter that will be applied on first load (but may be cleared by the user). This should be an array: + +```php + DateRangeFilter::make('EMail Verified Range') + ->setFilterDefaultValue(['minDate' => '2024-05-05', 'maxDate' => '2024-06-06']) +``` +or +```php + DateRangeFilter::make('EMail Verified Range') + ->setFilterDefaultValue(['min' => '2024-05-05', 'max' => '2024-06-06']) +``` +or +```php + DateRangeFilter::make('EMail Verified Range') + ->setFilterDefaultValue(['2024-05-05', '2024-06-06']) +``` + +## setPillsLocale +DateRange Filters also support the setPillsLocale method, which allows you to set a locale for use in generating the Filter Pills values +```php +public function filters(): array +{ + return [ + DateRangeFilter::make('EMail Verified Range') + ->setPillsLocale('fr ') // Use French localisation for the Filter Pills values + ->config([ + 'allowInput' => true, // Allow manual input of dates + 'altFormat' => 'F j, Y', // Date format that will be displayed once selected + 'ariaDateFormat' => 'F j, Y', // An aria-friendly date format + 'dateFormat' => 'Y-m-d', // Date format that will be received by the filter + 'earliestDate' => '2020-01-01', // The earliest acceptable date + 'latestDate' => '2023-08-01', // The latest acceptable date + 'placeholder' => 'Enter Date Range', // A placeholder value + 'locale' => 'en', + ]) + ->setFilterPillValues([0 => 'minDate', 1 => 'maxDate']) // The values that will be displayed for the Min/Max Date Values + ->filter(function (Builder $builder, array $dateRange) { // Expects an array. + $builder + ->whereDate('users.email_verified_at', '>=', $dateRange['minDate']) // minDate is the start date selected + ->whereDate('users.email_verified_at', '<=', $dateRange['maxDate']); // maxDate is the end date selected + }), + ]; +} +``` ## Configuration -By default, this filter will use a CDN to include the Flatpickr JS Library and CSS. However, you can customise this behaviour using the configuration file. +By default, this filter will inject the Flatpickr JS Library and CSS. However, you can customise this behaviour using the configuration file. -### Option 1 - The default CDN behaviour: +### Option 1 - The default behaviour: +```php + 'inject_third_party_assets_enabled' => true, ``` - 'published_third_party_assets' => false, - 'remote_third_party_assets' => true, + +### Option 2 - Bundled +If you choose to bundle the Tables JS/CSS (recommended) by adding the following to your build process: + +```js +'vendor/rappasoft/laravel-livewire-tables/resources/js/laravel-livewire-tables-thirdparty.min.js'; ``` -### Option 2 - Publish included version -You may publish the included version of Flatpickr. To do so, run: +or in your app.js + +```js +import '../../vendor/rappasoft/livewire-tables/resources/js/laravel-livewire-tables-thirdparty.min.js'; ``` -php artisan vendor:publish --tag=livewire-tables-public + +Then you should disable injection to avoid conflicts: + +```php + 'inject_third_party_assets_enabled' => false, ``` -This will publish the tested version of Flatpickr to your public directory. You should then set + +### Option 3 - CDN +You must ensure that Flatpickr is present PRIOR to the tables loading. For example, to add Flatpickr with the Spanish locale, ensure that the following is present in your Layout head section. Noting the "async" presence to ensure that the script is present before a page renders. + +It is typically recommended not to utilise the CDN approach, as changes to core code may impact behaviour, and you may need to implement changes to your CSP if present. + +If using the CDN approach, ensure the following config matches: +```js + 'inject_third_party_assets_enabled' => false, ``` - 'published_third_party_assets' => true, - 'remote_third_party_assets' => false, + +Then include the following in your layout: +```html +// Flatpickr Core Script + + +// Flatpickr Core CSS + ``` -### Option 3 - Locally Installed -If you have a locally installed version of Flatpickr already, you can set both options to false, and your local version will be used instead. +### Option 4 - Locally Installed +If you have a locally installed version of Flatpickr already, you can set injection to false, and your local version will be used instead. +```js + 'inject_third_party_assets_enabled' => false, ``` - 'published_third_party_assets' => false, - 'remote_third_party_assets' => false, + +## Localisation (BETA) +The default installation includes only the English (en) locale. + +### Bundling +Should you wish to localise, you must include the Flatpickr locale files in your build pipeline. This applies to only the specific locales that you require in your app.js (requires adding the flatpickr library to your package.json by executing "npm i flatpickr --save") +```js +import { Arabic } from "../imports/flatpickr/l10n/ar.js"; +import { Catalan } from "../imports/flatpickr/l10n/cat.js"; +import { Danish } from "../imports/flatpickr/l10n/da.js"; +import { German } from "../imports/flatpickr/l10n/de.js"; +import { Spanish } from "../imports/flatpickr/l10n/es.js"; +import { French } from "../imports/flatpickr/l10n/fr.js"; +import { Indonesian } from "../imports/flatpickr/l10n/id.js"; +import { Italian } from "../imports/flatpickr/l10n/it.js"; +import { Malaysian } from "../imports/flatpickr/l10n/ms.js"; +import { Dutch } from "../imports/flatpickr/l10n/nl.js"; +import { Portuguese } from "../imports/flatpickr/l10n/pt.js"; +import { Russian } from "../imports/flatpickr/l10n/ru.js" +import { Thai } from "../imports/flatpickr/l10n/th.js" +import { Turkish } from "../imports/flatpickr/l10n/tr.js" +import { Ukrainian } from "../imports/flatpickr/l10n/uk.js" ``` + +### CDN +You can also add locales using the Flatpickr CDN, ensuring that these are loaded before the page renders. + +For example to add German (de), ensure that the following is in the "head" section of your layout, ideally before your app.js +```html + +``` \ No newline at end of file diff --git a/docs/filter-types/filters-datetime.md b/docs/filter-types/filters-datetime.md index 288d90b4b..cceef28d5 100644 --- a/docs/filter-types/filters-datetime.md +++ b/docs/filter-types/filters-datetime.md @@ -1,10 +1,8 @@ --- title: DateTime Filters -weight: 4 +weight: 5 --- -## DateTime Filters - DateTime filters are HTML datetime-local elements and act the same as date filters. ```php @@ -35,6 +33,7 @@ public function filters(): array } ``` +## setFilterDefaultValue DateTime filters also support the setFilterDefaultValue() method, which must be a valid datetime in the "Y-m-dTH:i" format. This will apply as a default until removed. ```php public function filters(): array @@ -49,6 +48,23 @@ public function filters(): array ->setFilterDefaultValue('2023-07-07T06:27') ]; } +``` + +## setPillsLocale +DateTime Filters also support the setPillsLocale method, which allows you to set a locale for use in generating the Filter Pills values +```php +public function filters(): array +{ + return [ + DateTimeFilter::make('Verified From') + ->setPillsLocale('fr ') // Use French localisation for the Filter Pills values + ->config([ + 'min' => '2020-01-01', // Earliest Acceptable Date + 'max' => '2021-12-31', // Latest Acceptable Date + 'pillFormat' => 'd M Y - H:i', // Format for use in Filter Pills + 'placeholder' => 'Enter Date', // A placeholder value + ]) + ]; +} ``` - diff --git a/docs/filter-types/filters-livewire-component-array.md b/docs/filter-types/filters-livewire-component-array.md new file mode 100644 index 000000000..86b2491dc --- /dev/null +++ b/docs/filter-types/filters-livewire-component-array.md @@ -0,0 +1,51 @@ +--- +title: Livewire Custom Array Filter (Beta) +weight: 13 +--- + +**IN BETA** +This feature is currently in beta, and use in production is not recommended. + +### Usage +This allows you to use a child/nested Livewire Component in place of the existing Filters, giving you more control over the look/feel/behaviour of a filter. This version supports use of returning an array of values for use in filtering. + +To use a LivewireComponentArrayFilter, you must include it in your namespace: +```php +use Rappasoft\LaravelLivewireTables\Views\Filters\LivewireComponentArrayFilter; +``` + +When creating a filter: +- Specify a unique name +- Set the path to a valid Livewire Component +- Define a filter() callback to define how the returned value will be used. + +```php + public function filters(): array + { + return [ + LivewireComponentArrayFilter::make('My External Filter') + ->setLivewireComponent('my-test-external-filter') + ->filter(function (Builder $builder, array $values) { + $builder->whereIn('foreign_id', $values); + }), + ]; + } +``` + +### setPillsSeparator +As this is an array, you can define the separator to use between pills values, by default this is set to ", " + +```php + public function filters(): array + { + return [ + LivewireComponentArrayFilter::make('My External Filter') + ->setLivewireComponent('my-test-external-filter') + ->setPillsSeparator(' OR ') + ->filter(function (Builder $builder, array $values) { + $builder->whereIn('foreign_id', $values); + }), + ]; + } +``` + diff --git a/docs/filter-types/filters-livewire-component.md b/docs/filter-types/filters-livewire-component.md index d11d337f9..7d5e3b7ae 100644 --- a/docs/filter-types/filters-livewire-component.md +++ b/docs/filter-types/filters-livewire-component.md @@ -1,10 +1,8 @@ --- title: Livewire Custom Filter (Beta) -weight: 11 +weight: 12 --- -## Livewire Custom Filter - **IN BETA** This feature is currently in beta, and use in production is not recommended. diff --git a/docs/filter-types/filters-multiselect-dropdown.md b/docs/filter-types/filters-multiselect-dropdown.md index d81c14570..8b4158975 100644 --- a/docs/filter-types/filters-multiselect-dropdown.md +++ b/docs/filter-types/filters-multiselect-dropdown.md @@ -1,11 +1,8 @@ --- title: Multi-Select Dropdown Filters -weight: 5 +weight: 6 --- - -## Multi-select dropdown Filters - Multi-select dropdown filters are a simple dropdown list. The user can select multiple options from the list. There is also an 'All' option that will select all values ```php @@ -27,3 +24,26 @@ public function filters(): array ]; } ``` + +## Filter Pills Separator + +As this filter returns one or more values, you have the option to utilise a custom separator for the values displayed in the Filter Pills section at the top of the table. The default is ", ", but you may use any HTML string to separate the selected values + +```php +public function filters(): array +{ + return [ + MultiSelectFilter::make('Tags') + ->options( + Tag::query() + ->orderBy('name') + ->get() + ->keyBy('id') + ->map(fn($tag) => $tag->name) + ->toArray() + ) + ->setPillsSeparator('
    '), + ]; +} + +``` \ No newline at end of file diff --git a/docs/filter-types/filters-multiselect.md b/docs/filter-types/filters-multiselect.md index f6c6bfa37..8535e8fef 100644 --- a/docs/filter-types/filters-multiselect.md +++ b/docs/filter-types/filters-multiselect.md @@ -1,10 +1,8 @@ --- title: Multi-Select Filters -weight: 6 +weight: 7 --- -## Multi-select Filters - Multi-select filters are a list of checkboxes. The user can select multiple options from the list. There is also an 'All' option that will select all values. ```php @@ -25,3 +23,26 @@ public function filters(): array ]; } ``` + +## Filter Pills Separator + +As this filter returns one or more values, you have the option to utilise a custom separator for the values displayed in the Filter Pills section at the top of the table. The default is ", ", but you may use any HTML string to separate the selected values + +```php +public function filters(): array +{ + return [ + MultiSelectFilter::make('Tags') + ->options( + Tag::query() + ->orderBy('name') + ->get() + ->keyBy('id') + ->map(fn($tag) => $tag->name) + ->toArray() + ) + ->setPillsSeparator('
    '), + ]; +} + +``` \ No newline at end of file diff --git a/docs/filter-types/filters-number-range.md b/docs/filter-types/filters-number-range.md index 0969e5c33..d051bfd99 100644 --- a/docs/filter-types/filters-number-range.md +++ b/docs/filter-types/filters-number-range.md @@ -1,10 +1,8 @@ --- title: NumberRange Filters -weight: 7 +weight: 8 --- -## NumberRange Filters - NumberRange filters allow for a minimum and maximum value to be input on a single slider. ```php @@ -22,6 +20,7 @@ public function filters(): array 'minRange' => 0, 'maxRange' => 100, 'suffix' => '%', + 'prefix' => '$', ]) ->filter(function (Builder $builder, array $values) { $builder->where('users.success_rate', '>=', intval($values['min'])) @@ -34,4 +33,6 @@ public function filters(): array The default values should be set in the options() method. -You may also specify a minimum and maximum range in the config() options, and should you wish to use real values instead of a percentage, you can change the "suffix" to a metric of your choosing. +You may also specify a minimum and maximum range in the config() options, and should you wish to use real values instead of a percentage. +You can change the "suffix" to a metric of your choosing. +You can change the "prefix" to an item of your choosing (e.g $/£/€) diff --git a/docs/filter-types/filters-number.md b/docs/filter-types/filters-number.md index 3b629dd0a..78dd191a3 100644 --- a/docs/filter-types/filters-number.md +++ b/docs/filter-types/filters-number.md @@ -1,12 +1,31 @@ --- title: Number Filters -weight: 8 +weight: 9 --- -## Number Filters - Number filters are just HTML number inputs. +```php +public function filters(): array +{ + return [ + NumberFilter::make('Amount') + ->filter(function(Builder $builder, string $value) { + $builder->where('amount', '<', $value); + }), + ]; +} +``` + +Historically, min/max/placeholders were set using the "config" option, which is still available. However, it is strongly recommended to use the new setInputAttributes for enhanced customisation. + +## Old Behaviour +The following would: +- Set a min of 0 +- Set a max of 100 +- Add a placeholder +- Keep the default colors & styling + ```php public function filters(): array { @@ -23,3 +42,28 @@ public function filters(): array ]; } ``` + +## New Behaviour +The following would: +- Set a min of 5 +- Set a max of 20 +- Set steps to be 0.5 +- Add a placeholder +- Keep the default colors & styling + +```php +public function filters(): array +{ + return [ + NumberFilter::make('Age') + ->setInputAttributes([ + 'min' => '5', // Minimum Value Accepted + 'max' => '20', // Maximum Value Accepted + 'step' => '0.5', // Set step + 'placeholder' => 'Enter Number 0 - 100', // A placeholder value + 'default-colors' => true, + 'default-styling' => true, + ]), + ]; +} +``` \ No newline at end of file diff --git a/docs/filter-types/filters-select.md b/docs/filter-types/filters-select.md index d28cfba94..d0b67a48c 100644 --- a/docs/filter-types/filters-select.md +++ b/docs/filter-types/filters-select.md @@ -1,10 +1,8 @@ --- title: Select Filters -weight: 9 +weight: 10 --- -## Select Filters - Select filters are a simple dropdown list. The user selects one choice from the list. ```php @@ -56,6 +54,6 @@ public function filters(): array } ``` To set a default "All" option at the start of the dropdown, you can do so by utilising the -``` +```php ->setFirstOption('NAME') ``` diff --git a/docs/filter-types/filters-text.md b/docs/filter-types/filters-text.md index 649384915..d6affde29 100644 --- a/docs/filter-types/filters-text.md +++ b/docs/filter-types/filters-text.md @@ -1,11 +1,9 @@ --- title: Text Filters -weight: 10 +weight: 11 --- -## Text Filters - -Text filters are just HTML text fields. +Text filters are just simple text filters, allowing you to pass a string value into a builder query. ```php public function filters(): array @@ -22,3 +20,133 @@ public function filters(): array ]; } ``` + +### Extra Helpers + +There are a number of helpers to simplify your code, should you not wish to rewrite the filter function repeatedly for a Text Filter. You can only use one of the below methods per-filter. + +#### Contains + +This executes the filter and returns results where the field contains the filter value + +```php +public function filters(): array +{ + return [ + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->contains('users.name'), + ]; +} +``` + +#### notContains + +This executes the filter and returns results where the field does not contain filter value + +```php +public function filters(): array +{ + return [ + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->notContains('users.name'), + ]; +} +``` + +#### startsWith + +This executes the filter and returns results where the field starts with the filter value + +```php +public function filters(): array +{ + return [ + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->startsWith('users.name'), + ]; +} +``` + +#### notStartsWith + +This executes the filter and returns results where the field does not start with the filter value + +```php +public function filters(): array +{ + return [ + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->notStartsWith('users.name'), + ]; +} +``` + +#### endsWith + +This executes the filter and returns results where the field ends with the filter value + +```php +public function filters(): array +{ + return [ + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->endsWith('users.name'), + ]; +} +``` + +#### notEndsWith + +This executes the filter and returns results where the field does not end with the filter value + +```php +public function filters(): array +{ + return [ + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->notEndsWith('users.name'), + ]; +} +``` + +#### setFieldName +An optional method for setting the field to use when filtering, if used, you may omit the field from the above methods, for example: + +```php +public function filters(): array +{ + return [ + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->setFieldName('users.name') + ->contains(), + ]; +} +``` diff --git a/docs/filter-types/introduction.md b/docs/filter-types/introduction.md index d509cdc39..0e4d099cc 100644 --- a/docs/filter-types/introduction.md +++ b/docs/filter-types/introduction.md @@ -4,3 +4,39 @@ weight: 1 --- There are several Filter types available for use, offering a range of capabilities to filter your data. + + \ No newline at end of file diff --git a/docs/filters/_index.md b/docs/filters/_index.md index 43af373bd..e0ac299f1 100644 --- a/docs/filters/_index.md +++ b/docs/filters/_index.md @@ -1,4 +1,4 @@ --- title: Filters -weight: 10 +weight: 11 --- diff --git a/docs/filters/available-component-methods.md b/docs/filters/available-component-methods.md new file mode 100644 index 000000000..ffa02f29c --- /dev/null +++ b/docs/filters/available-component-methods.md @@ -0,0 +1,241 @@ +--- +title: Available Component Methods +weight: 5 +--- + +These are the available filters configuration methods on the component. These are "table-wide" methods. + +--- + +Filters are **enabled by default** but will only show up if you have at least one defined. + +## setFiltersStatus + +Enable/disable filters for the whole component. + +```php +public function configure(): void +{ + $this->setFiltersStatus(true); + $this->setFiltersStatus(false); +} +``` + +## setFiltersEnabled + +Enable filters for the component. + +```php +public function configure(): void +{ + // Shorthand for $this->setFiltersStatus(true) + $this->setFiltersEnabled(); +} +``` + +## setFiltersDisabled + +Disable filters for the component. + +```php +public function configure(): void +{ + // Shorthand for $this->setFiltersStatus(false) + $this->setFiltersDisabled(); +} +``` + +--- + +## setFiltersVisibilityStatus + +**Enabled by default**, show/hide the filters dropdown. + +```php +public function configure(): void +{ + $this->setFiltersVisibilityStatus(true); + $this->setFiltersVisibilityStatus(false); +} +``` + +## setFiltersVisibilityEnabled + +Show the filters dropdown for the component. + +```php +public function configure(): void +{ + // Shorthand for $this->setFiltersVisibilityStatus(true) + $this->setFiltersVisibilityEnabled(); +} +``` + +## setFiltersVisibilityDisabled + +Hide the filters dropdown for the component. + +```php +public function configure(): void +{ + // Shorthand for $this->setFiltersVisibilityStatus(false) + $this->setFiltersVisibilityDisabled(); +} +``` + +--- + +## Pills + +See the [Filter Pills](./filter-pills) documentation for help with configuring the pills + +--- + +## setFilterLayout + +Set the filter layout for the component. + +```php +public function configure(): void +{ + $this->setFilterLayout('slide-down'); +} +``` + +## setFilterLayoutPopover + +Set the filter layout to popover. + +```php +public function configure(): void +{ + $this->setFilterLayoutPopover(); +} +``` + +Set the filter layout to slide down. + +## setFilterLayoutSlideDown + +```php +public function configure(): void +{ + $this->setFilterLayoutSlideDown(); +} +``` + +## setFilterSlideDownDefaultStatusEnabled + +Set the filter slide down to visible by default + +```php +public function configure(): void +{ + // Shorthand for $this->setFilterSlideDownDefaultStatus(true) + $this->setFilterSlideDownDefaultStatusEnabled(); +} +``` + +## setFilterSlideDownDefaultStatusDisabled + +Set the filter slide down to collapsed by default + +```php +public function configure(): void +{ + // Shorthand for $this->setFilterSlideDownDefaultStatus(false) + $this->setFilterSlideDownDefaultStatusDisabled(); +} +``` + +## storeFiltersInSessionEnabled + +Optional behaviour - stores filter values in the session (specific to table - based on the table name) + +### Exercise Caution +If re-using the same Livewire Table Component multiple times in your site, with the same table name, this may cause clashes in filter values + +```php +public function configure(): void +{ + $this->storeFiltersInSessionEnabled(); +} +``` +## storeFiltersInSessionDisabled + +Default behaviour - does not store filters in the session + +```php +public function configure(): void +{ + $this->storeFiltersInSessionDisabled(); +} +``` + +## setFilterPopoverAttributes + +Allows for the customisation of the appearance of the Filter Popover Menu. + +Note the addition of a "default-width" boolean, allowing you to customise the width more smoothly without impacting other applied classes. + +You may also replace default colors by setting "default-colors" to false, or default styling by setting "default-styling" to false, and specifying replacement classes in the "class" property. + +You can also replace the default transition behaviours (Tailwind) by specifying replacement attributes in the array. + +```php +public function configure(): void +{ + $this->setFilterPopoverAttributes( + [ + 'class' => 'w-96', + 'default-width' => false, + 'default-colors' => true, + 'default-styling' => true, + 'x-transition:enter' => 'transition ease-out duration-100', + ] + ); +} +``` + +## setFilterSlidedownWrapperAttributes + +Allows for the customisation of the appearance of the Filter Slidedown Wrapper. + +You may also replace default colors by setting "default-colors" to false, or default styling by setting "default-styling" to false, and specifying replacement classes in the "class" property. + +You can also replace the default transition behaviours (Tailwind) by specifying replacement attributes in the array, for example to extend the duration of the transition effect from the default duration-100 to duration-1000: + +```php +public function configure(): void +{ + $this->setFilterSlidedownWrapperAttributes([ + 'x-transition:enter' => 'transition ease-out duration-1000', + 'class' => 'text-black', + 'default-colors' => true, + 'default-styling' => true, + ]); +} +``` + +## setFilterSlidedownRowAttributes + +Allows for the customisation of the appearance of the Filter Slidedown Row. Note that this uses a callback, which receives the "rowIndex" of the Slidedown Row + +You may replace default colors by setting "default-colors" to false, or default styling by setting "default-styling" to false, and specifying replacement classes in the "class" property. + +```php +public function configure(): void +{ + $this->setFilterSlidedownRowAttributes(fn($rowIndex) => $rowIndex % 2 === 0 ? + [ + 'class' => 'bg-red-500', + 'default-colors' => true, + 'default-styling' => true, + ] : [ + 'class' => 'bg-blue-500', + 'default-colors' => true, + 'default-styling' => true, + ] + ); +} +``` diff --git a/docs/filters/available-filter-methods.md b/docs/filters/available-filter-methods.md new file mode 100644 index 000000000..249273109 --- /dev/null +++ b/docs/filters/available-filter-methods.md @@ -0,0 +1,296 @@ +--- +title: Available Filter Methods +weight: 6 +--- + +The following methods are available on the filter object. These are "filter-specific" methods. + +Ensure you check out: +- [Available Component Methods](./available-component-methods) documentation for Table Wide configuration +- [Filter Pills](./filter-pills) documentation for help with configuring the pills for a filter + + +## hiddenFromMenus + +Hide the filter from both the filter popover and the filter slide down. + +```php +SelectFilter::make('Active') + ->hiddenFromMenus() +``` + +## hiddenFromPills + +Hide the filter from the filter pills when applied. + +```php +SelectFilter::make('Active') + ->hiddenFromPills() +``` + +## hiddenFromFilterCount + +Hide the filter from the filter count when applied. + +```php +SelectFilter::make('Active') + ->hiddenFromFilterCount() +``` + +## hiddenFromAll + +Hide the filter from the menus, pills, and count. + +```php +SelectFilter::make('Active') + ->hiddenFromAll() +``` + +## notResetByClearButton + +By default the `clear` button will reset all filters to their defaults. You can prevent this on a specific filter by using this method. + +```php +SelectFilter::make('Active') + ->notResetByClearButton() +``` + +## setCustomView +Use a fully custom view for a filter. This will utilise solely your view when rendering this filter. Note that the following methods will no longer apply to a filter using this: +- setCustomFilterLabel +- setFilterLabelAttributes + +```php +TextFilter::make('Name') + ->setCustomView('text-custom-view'), +``` + +## Config + +If the filter takes any config options, you can set them with the `config` method: + +```php + DateFilter::make('Date') + ->config([ + 'min' => '2020-01-01', + 'max' => '2021-12-31', + ]) +``` + +## Customising Wireable Behaviour + +For the following Filters, you may customise how the input is wire:model into the Table Component: + +- DateFilter (Defaults to Live) +- DateTimeFilter (Defaults to Live) +- MultiSelectDropdownFilter (Defaults to live.debounce.250ms) +- MultiSelectFilter (Defaults to live.debounce.250ms) +- NumberFilter (Defaults to Blur) +- SelectFilter (Defaults to Live) +- TextFilter (Defaults to Blur) + +You may override this using the following methods, on any of the above Filter types: + +### setWireBlur() +Forces the filter to use a wire:model.blur approach +```php + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->setWireBlur() +``` + +### setWireDefer() +Forces the filter to use a wire:model approach +```php + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->setWireDefer() +``` + +### setWireLive() +Forces the fitler to use a wire:model.live approach +```php + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->setWireLive() +``` + +### setWireDebounce(int $debounceDelay) +Allows you to pass a string to use a wire:model.live.debounce.Xms approach +```php + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->setWireDebounce(50) +``` + +--- + +## Styling + +These methods allow you to over-ride default styling for individual Filters + +--- + +### setFilterSlidedownRow + +This method applies only when using the Slide Down approach to filter display. +By default the filters will be displayed in the order that they are listed in the filters() method. This method allows you to specify the row that the filter will be listed. When multiple filters are placed on the same row, and a mobile device is used, then the first filter listed will "win" that row. +You may use either a string or an integer to pass to this method, and it can be used in conjunction with setFilterSlidedownColspan + +```php +SelectFilter::make('Active') + ->setFilterSlidedownRow(1) +``` + +### setFilterSlidedownColspan + +This method applies only when using the Slide Down approach to filter display. +By default each filter will take up one column, with the number of columns determined by the size of the screen, this ranges from 1 on a mobile device, to a maximum of 5 on a large display. This method allows you to specify the number of columns that the filter should span. It will span the number of columns specified, up to the number of columns available (depending on screen size). +You may use either a string or an integer to pass to this method, and it can be used in conjunction with setFilterSlidedownRow + +```php +DateFilter::make('Date') + ->config([ + 'min' => '2020-01-01', + 'max' => '2021-12-31', + ]) + ->setFilterSlidedownColspan('2') +``` + +--- + +### setCustomFilterLabel + +Set a custom blade file for the filter's label. This will be used in both the Pop-Over and SlideDown filter displays, you should therefore ensure that you cater for the different filter layouts. + +```php +SelectFilter::make('Active') + ->setCustomFilterLabel('path.to.blade') +``` + +You will receive several properties to your blade, explained here: +- $filter (the filter instance) +- $filterLayout ('slide-down' or 'popover') +- $tableName (the table name) +- $isTailwind (bool - is theme Tailwind) +- $isBootstrap (bool - is theme Bootstrap 4 or Bootstrap 5) +- $isBootstrap4 (bool - is theme Bootstrap 4) +- $isBootstrap5 (bool - is theme Bootstrap 5) +- $customLabelAttributes (array -> any customLabel attributes set using setFilterLabelAttributes()) + +Example label blade: +```php +@aware([ 'tableName']) +@props(['filter', 'filterLayout' => 'popover', 'tableName' => 'table', 'isTailwind' => false, 'isBootstrap' => false, 'isBootstrap4' => false, 'isBootstrap5' => false, 'for' => null]) + + +``` + +### setFilterLabelAttributes + +#### Old Method (Still Supported) +Set custom attributes for a Filter Label. At present it is recommended to only use this for "class" and "style" attributes to avoid conflicts. + +By default, this replaces the default classes on the Filter Label wrapper, if you would like to keep them, set the default flag to true. + +```php +TextFilter::make('Name') + ->setFilterLabelAttributes( + [ + 'class' => 'text-xl', + 'default' => true, + ] + ), +``` + +#### New Method (Recommended) +Set custom attributes for a Filter Label. At present it is recommended to only use this for "class" and "style" attributes to avoid conflicts. + +By default, this replaces the default classes on the Filter Label wrapper, if you would like to keep them, set the default flag to true. + +```php +TextFilter::make('Name') + ->setLabelAttributes( + [ + 'class' => 'text-xl', + 'default' => true, + ] + ), +``` + +--- + +### setInputAttributes +Allows for customising the attributes that will apply to the input field for the filter. + +By default, this replaces the default classes on the Filter Input, if you would like to keep them, set the default-styling and/or default-colors flags to true. + +#### TextFilter Example +The following would: +- Set a maxlength of 75 +- Set a placeholder of "Enter a Name" +- Replace the default colors +- Retain the default styling (e.g. rounding/shadow) + +```php +public function filters(): array +{ + return [ + TextFilter::make('Name') + ->setInputAttributes([ + 'maxlength' => '75', + 'placeholder' => 'Enter a Name', + 'class' => 'text-white bg-red-500 dark:bg-red-500', + 'default-colors' => false, + 'default-styling' => true, + ]), + ]; +} +``` + +#### NumberFilter Example +The following would: +- Set a min of 5 +- Set a max of 20 +- Set steps to be 0.5 +- Keep the default colors & styling + +```php +public function filters(): array +{ + return [ + NumberFilter::make('Age') + ->setInputAttributes([ + 'min' => '5', + 'max' => '20', + 'step' => '0.5', + 'default-colors' => true, + 'default-styling' => true, + ]), + ]; +} +``` \ No newline at end of file diff --git a/docs/filters/available-methods.md b/docs/filters/available-methods.md index 53701d07b..2fd27f523 100644 --- a/docs/filters/available-methods.md +++ b/docs/filters/available-methods.md @@ -3,458 +3,7 @@ title: Available Methods weight: 4 --- -## Component Methods +The documentation has now been split into two sections to enhance clarity. -These are the available filters configuration methods on the component. - ---- - -Filters are **enabled by default** but will only show up if you have at least one defined. - -### setFiltersStatus - -Enable/disable filters for the whole component. - -```php -public function configure(): void -{ - $this->setFiltersStatus(true); - $this->setFiltersStatus(false); -} -``` - -### setFiltersEnabled - -Enable filters for the component. - -```php -public function configure(): void -{ - // Shorthand for $this->setFiltersStatus(true) - $this->setFiltersEnabled(); -} -``` - -### setFiltersDisabled - -Disable filters for the component. - -```php -public function configure(): void -{ - // Shorthand for $this->setFiltersStatus(false) - $this->setFiltersDisabled(); -} -``` - ---- - -### setFiltersVisibilityStatus - -**Enabled by default**, show/hide the filters dropdown. - -```php -public function configure(): void -{ - $this->setFiltersVisibilityStatus(true); - $this->setFiltersVisibilityStatus(false); -} -``` - -### setFiltersVisibilityEnabled - -Show the filters dropdown for the component. - -```php -public function configure(): void -{ - // Shorthand for $this->setFiltersVisibilityStatus(true) - $this->setFiltersVisibilityEnabled(); -} -``` - -### setFiltersVisibilityDisabled - -Hide the filters dropdown for the component. - -```php -public function configure(): void -{ - // Shorthand for $this->setFiltersVisibilityStatus(false) - $this->setFiltersVisibilityDisabled(); -} -``` - ---- - -### setFilterPillsStatus - -**Enabled by default**, show/hide the filter pills. - -```php -public function configure(): void -{ - $this->setFilterPillsStatus(true); - $this->setFilterPillsStatus(false); -} -``` - -### setFilterPillsEnabled - -Show the filter pills for the component. - -```php -public function configure(): void -{ - // Shorthand for $this->setFilterPillsStatus(true) - $this->setFilterPillsEnabled(); -} -``` - -### setFilterPillsDisabled - -Hide the filter pills for the component. - -```php -public function configure(): void -{ - // Shorthand for $this->setFilterPillsStatus(false) - $this->setFilterPillsDisabled(); -} -``` - ---- - -### setFilterLayout - -Set the filter layout for the component. - -```php -public function configure(): void -{ - $this->setFilterLayout('slide-down'); -} -``` - -### setFilterLayoutPopover - -Set the filter layout to popover. - -```php -public function configure(): void -{ - $this->setFilterLayoutPopover(); -} -``` - -Set the filter layout to slide down. - -### setFilterLayoutSlideDown - -```php -public function configure(): void -{ - $this->setFilterLayoutSlideDown(); -} -``` - -### setFilterSlideDownDefaultStatusEnabled - -Set the filter slide down to visible by default - -```php -public function configure(): void -{ - // Shorthand for $this->setFilterSlideDownDefaultStatus(true) - $this->setFilterSlideDownDefaultStatusEnabled(); -} -``` - -### setFilterSlideDownDefaultStatusDisabled - -Set the filter slide down to collapsed by default - -```php -public function configure(): void -{ - // Shorthand for $this->setFilterSlideDownDefaultStatus(false) - $this->setFilterSlideDownDefaultStatusDisabled(); -} -``` - - ----- - -## Filter Methods - -The following methods are available on the filter object. - ----- - -### setFilterPillTitle - -By default, the filter pill title is the filter name, but you can make it whatever you want: - -```php -SelectFilter::make('Active') - ->setFilterPillTitle('User Status') -``` - -### setFilterPillValues - -If you have numeric, or generated keys as your filter option values, they probably don't look too nice in the filter pill. You can set the values to be displayed in the filter pill: - -```php -SelectFilter::make('Active') - ->setFilterPillTitle('User Status') - ->setFilterPillValues([ - '1' => 'Active', - '0' => 'Inactive', - ]) - ->options([ - '' => 'All', - '1' => 'Yes', - '0' => 'No', - ]) -``` - -Now instead of `Active: Yes` it will say `User Status: Active` - -### hiddenFromMenus - -Hide the filter from both the filter popover and the filter slide down. - -```php -SelectFilter::make('Active') - ->hiddenFromMenus() -``` - -### hiddenFromPills - -Hide the filter from the filter pills when applied. - -```php -SelectFilter::make('Active') - ->hiddenFromPills() -``` - -### hiddenFromFilterCount - -Hide the filter from the filter count when applied. - -```php -SelectFilter::make('Active') - ->hiddenFromFilterCount() -``` - -### hiddenFromAll - -Hide the filter from the menus, pills, and count. - -```php -SelectFilter::make('Active') - ->hiddenFromAll() -``` - -### notResetByClearButton - -By default the `clear` button will reset all filters to their defaults. You can prevent this on a specific filter by using this method. - -```php -SelectFilter::make('Active') - ->notResetByClearButton() -``` - -### setFilterSlidedownRow - -This method applies only when using the Slide Down approach to filter display. -By default the filters will be displayed in the order that they are listed in the filters() method. This method allows you to specify the row that the filter will be listed. When multiple filters are placed on the same row, and a mobile device is used, then the first filter listed will "win" that row. -You may use either a string or an integer to pass to this method, and it can be used in conjunction with setFilterSlidedownColspan - -```php -SelectFilter::make('Active') - ->setFilterSlidedownRow(1) -``` - -### setFilterSlidedownColspan - -This method applies only when using the Slide Down approach to filter display. -By default each filter will take up one column, with the number of columns determined by the size of the screen, this ranges from 1 on a mobile device, to a maximum of 5 on a large display. This method allows you to specify the number of columns that the filter should span. It will span the number of columns specified, up to the number of columns available (depending on screen size). -You may use either a string or an integer to pass to this method, and it can be used in conjunction with setFilterSlidedownRow - -```php -DateFilter::make('Date') - ->config([ - 'min' => '2020-01-01', - 'max' => '2021-12-31', - ]) - ->setFilterSlidedownColspan('2') -``` - -### setFilterPillBlade - -Set a blade file for use in displaying the filter values in the pills area. You can use this in conjunction with setFilterPillValues() to prettify your applied filter values display. You will receive two properties ($filter) containing the filter instance, and ($value) containing the filter value. - -```php -SelectFilter::make('Active') - ->setFilterPillBlade('path.to.blade') -``` - -Example blade: -```php -@aware(['component']) -@props(['filter']) - - - {{ $filter->getFilterPillTitle() }} - ({{ $filter->getFilterPillValue($value) }}) - - - -``` - -### setCustomFilterLabel - -Set a custom blade file for the filter's label. This will be used in both the Pop-Over and SlideDown filter displays, you should therefore ensure that you cater for the different filter layouts. - -```php -SelectFilter::make('Active') - ->setCustomFilterLabel('path.to.blade') -``` - -You will receive several properties to your blade, explained here: -- $filter (the filter instance) -- $filterLayout ('slide-down' or 'popover') -- $tableName (the table name) -- $isTailwind (bool - is theme Tailwind) -- $isBootstrap (bool - is theme Bootstrap 4 or Bootstrap 5) -- $isBootstrap4 (bool - is theme Bootstrap 4) -- $isBootstrap5 (bool - is theme Bootstrap 5) -- $customLabelAttributes (array -> any customLabel attributes set using setFilterLabelAttributes()) - -Example label blade: -```php -@props(['filter', 'filterLayout' => 'popover', 'tableName' => 'table', 'isTailwind' => false, 'isBootstrap' => false, 'isBootstrap4' => false, 'isBootstrap5' => false, 'customLabelAttributes' => []) - - - -``` - -### setFilterLabelAttributes -Set custom attributes for a Filter Label. At present it is recommended to only use this for "class" and "style" attributes to avoid conflicts. - -By default, this replaces the default classes on the Filter Label wrapper, if you would like to keep them, set the default flag to true. - -```php -TextFilter::make('Name') - ->setFilterLabelAttributes( - [ - 'class' => 'text-xl', - 'default' => true, - ] - ), -``` - -### setCustomView -Use a fully custom view for a filter. This will utilise solely your view when rendering this filter. Note that the following methods will no longer apply to a filter using this: -- setCustomFilterLabel -- setFilterLabelAttributes - -```php -TextFilter::make('Name') - ->setCustomView('text-custom-view'), -``` - -### Config - -If the filter takes any config options, you can set them with the `config` method: - -```php - DateFilter::make('Date') - ->config([ - 'min' => '2020-01-01', - 'max' => '2021-12-31', - ]) -``` - -### Customising Wireable Behaviour - -For the following Filters, you may customise how the input is wire:model into the Table Component: - -- DateFilter (Defaults to Live) -- DateTimeFilter (Defaults to Live) -- MultiSelectDropdownFilter (Defaults to live.debounce.250ms) -- MultiSelectFilter (Defaults to live.debounce.250ms) -- NumberFilter (Defaults to Blur) -- SelectFilter (Defaults to Live) -- TextFilter (Defaults to Blur) - -You may override this using the following methods, on any of the above Filter types: - -#### setWireBlur() -Forces the filter to use a wire:model.blur approach -``` - TextFilter::make('Name') - ->config([ - 'placeholder' => 'Search Name', - 'maxlength' => '25', - ]) - ->setWireBlur() -``` - -#### setWireDefer() -Forces the filter to use a wire:model approach -``` - TextFilter::make('Name') - ->config([ - 'placeholder' => 'Search Name', - 'maxlength' => '25', - ]) - ->setWireDefer() -``` - -#### setWireLive() -Forces the fitler to use a wire:model.live approach -``` - TextFilter::make('Name') - ->config([ - 'placeholder' => 'Search Name', - 'maxlength' => '25', - ]) - ->setWireLive() -``` - -#### setWireDebounce(int $debounceDelay) -Allows you to pass a string to use a wire:model.live.debounce.Xms approach -``` -``` - TextFilter::make('Name') - ->config([ - 'placeholder' => 'Search Name', - 'maxlength' => '25', - ]) - ->setWireDebounce(50) -``` -``` \ No newline at end of file +Documentation for Available Component Methods is now: [Here](./available-component-methods) +Documentation for Available Filter Methods is now: [Here](./available-filter-methods) diff --git a/docs/filters/creating-filters.md b/docs/filters/creating-filters.md index e940c5952..e13e98563 100644 --- a/docs/filters/creating-filters.md +++ b/docs/filters/creating-filters.md @@ -3,7 +3,7 @@ title: Creating Filters weight: 2 --- -To create filters, you must implement the `filters()` method on your component. +To create filters, you must implement the `filters()` method on your component, which must return an array. ```php public function filters(): array diff --git a/docs/filters/filter-pills.md b/docs/filters/filter-pills.md new file mode 100644 index 000000000..8ab0c20e7 --- /dev/null +++ b/docs/filters/filter-pills.md @@ -0,0 +1,315 @@ +--- +title: Filter Pills +weight: 7 +--- + +When a Filter is set/applied, it will be displayed at the top of your Table in a "filter pills" section, contained within the Tools area + +There are both Component/Table wide, and Filter specific configurations available: + +--- + +## Component Methods + +These methods apply across your whole table + +### setFilterPillsStatus + +**Enabled by default**, show/hide the filter pills. + +```php +public function configure(): void +{ + $this->setFilterPillsStatus(true); + $this->setFilterPillsStatus(false); +} +``` + +### setFilterPillsEnabled + +Show the filter pills for the component. + +```php +public function configure(): void +{ + // Shorthand for $this->setFilterPillsStatus(true) + $this->setFilterPillsEnabled(); +} +``` + +### setFilterPillsDisabled + +Hide the filter pills for the component. + +```php +public function configure(): void +{ + // Shorthand for $this->setFilterPillsStatus(false) + $this->setFilterPillsDisabled(); +} +``` + +--- + +### setFilterPillsItemAttributes +Allows for customisation of the appearance of each "Filter Pills Item" + +Note that this allows for appending to, or replacing the styles and colors independently, via the below methods. + +#### default-colors +Setting to false will disable the default colors for the Filter Pills Item, the default colors are: + +Bootstrap: None + +Tailwind: `bg-indigo-100 text-indigo-800 dark:bg-indigo-200 dark:text-indigo-900` + +#### default-styling +Setting to false will disable the default styling for the Filter Pills Item, the default styling is: + +Bootstrap 4: `badge badge-pill badge-info d-inline-flex align-items-center` + +Bootstrap 5: `badge rounded-pill bg-info d-inline-flex align-items-center` + +Tailwind: `inline-flex items-center px-2.5 py-0.5 rounded-full leading-4` + +#### default-text +Setting to false will disable the default text styling for the Filter Pills Item, the default text styling is: + +Bootstrap 4: none + +Bootstrap 5: none + +Tailwind: `text-xs font-medium capitalize` + +Note that colors are handled via default-colours + + +```php +public function configure(): void +{ + $this->setFilterPillsItemAttributes([ + 'class' => 'bg-rose-300 text-rose-800 dark:bg-indigo-200 dark:text-indigo-900', // Add these classes to the filter pills item + 'default-colors' => false, // Do not output the default colors + 'default-styling' => true // Output the default styling + ]); +} +``` + +--- + +### setFilterPillsResetFilterButtonAttributes +Allows for customisation of the appearance of the "Filter Pills Reset Filter Button" + +Note that this utilises allows for appending to, or replacing the styles and colors independently, via the below methods. + +#### default-colors +Setting to false will disable the default colors for the Filter Pills Reset Filter Button, the default colors are: + +Bootstrap: None + +Tailwind: `text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:bg-indigo-500 focus:text-white` + +#### default-styling +Setting to false will disable the default styling for the Filter Pills Reset Filter Button, the default styling is: + +Bootstrap: `text-white ml-2` + +Tailwind: `flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center focus:outline-none` + +```php +public function configure(): void +{ + $this->setFilterPillsResetFilterButtonAttributes([ + 'class' => 'text-rose-400 hover:bg-rose-200 hover:text-rose-500 focus:bg-rose-500', // Add these classes to the filter pills reset filter button + 'default-colors' => false, // Do not output the default colors + 'default-styling' => true // Output the default styling + ]); +} +``` + +--- + +### setFilterPillsResetAllButtonAttributes +Allows for customisation of the appearance of the "Filter Pills Reset All Button" + +Note that this allows for appending to, or replacing the styles and colors independently, via the below methods. + +#### default-colors +Setting to false will disable the default colors for the Filter Pills Reset All Button, the default colors are: + +Bootstrap: None + +Tailwind: `bg-gray-100 text-gray-800 dark:bg-gray-200 dark:text-gray-900` + +#### default-styling +Setting to false will disable the default styling for the Filter Pills Reset All Button, the default styling is: + +Bootstrap 4: `badge badge-pill badge-light` + +Bootstrap 5: `badge rounded-pill bg-light text-dark text-decoration-none` + +Tailwind: `inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium` + +```php +public function configure(): void +{ + $this->setFilterPillsResetAllButtonAttributes([ + 'class' => 'bg-rose-100 text-rose-800 dark:bg-gray-200 dark:text-gray-900', // Add these classes to the filter pills reset all button + 'default-colors' => false, // Do not output the default colors + 'default-styling' => true // Output the default styling + ]); +} +``` + +--- + +## Filter Methods + +These methods apply to individual filters + +### setFilterPillTitle + +By default, the filter pill title is the filter name, but you can make it whatever you want: + +```php +SelectFilter::make('Active') + ->setFilterPillTitle('User Status') +``` + +### setFilterPillValues + +If you have numeric, or generated keys as your filter option values, they probably don't look too nice in the filter pill. You can set the values to be displayed in the filter pill: + +```php +SelectFilter::make('Active') + ->setFilterPillTitle('User Status') + ->setFilterPillValues([ + '1' => 'Active', + '0' => 'Inactive', + ]) + ->options([ + '' => 'All', + '1' => 'Yes', + '0' => 'No', + ]) +``` + +Now instead of `Active: Yes` it will say `User Status: Active` + + +### hiddenFromPills + +Hide the filter from the filter pills when applied. + +```php +SelectFilter::make('Active') + ->hiddenFromPills() +``` + +--- + +### setFilterPillBlade + +Set a blade file for use in displaying the filter values in the pills area. You can use this in conjunction with setFilterPillValues() to prettify your applied filter values display. You will receive two properties: +- $filter which contains the filter instance +- $filterPillData which contains an instance of "Rappasoft\LaravelLivewireTables\DataTransferObjects\Filters\FilterPillData" + This provides ready access to configured pills elements + +```php +SelectFilter::make('Active') + ->setFilterPillBlade('path.to.blade') +``` + +Example blade: +```php +@aware(['tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5']) +@props(['filterKey', 'filterPillData']) + + + getFilterPillDisplayData() }}> + + +``` + +#### $filterPillData +An example of the returned object is below: + +```php +Rappasoft\LaravelLivewireTables\DataTransferObjects\Filters\FilterPillData { + #filterPillTitle: "Name" + #filterSelectName: "name" + #filterPillValue: "A Value Here" + #separator: ", " + +isAnExternalLivewireFilter: false + +hasCustomPillBlade: true + #customPillBlade: "tests.tables.pills.test" + #filterPillsItemAttributes: array:4 [▼ + // Any Custom Defined Attributes + ] + #separatedValues: null + #renderPillsAsHtml: false + #watchForEvents: false +} +``` + +### setPillAttributes + +This may be used in conjunction with, or instead of the setFilterPillsItemAttributes method, and applies to an individual Filter's pills. + +Note that if used, this will **replace** any matching array keys defined in the setFilterPillsItemAttributes method. + +Note that this allows for appending to, or replacing the styles and colors independently + +#### default-colors +Setting to false will disable the default colors for this Filter's Pills Item, the default colors are: + +Bootstrap: None + +Tailwind: `bg-indigo-100 text-indigo-800 dark:bg-indigo-200 dark:text-indigo-900` + +#### default-styling +Setting to false will disable the default styling for this Filter's Pills Item, the default styling is: + +Bootstrap 4: `badge badge-pill badge-info d-inline-flex align-items-center` + +Bootstrap 5: `badge rounded-pill bg-info d-inline-flex align-items-center` + +Tailwind: `inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium leading-4 capitalize` + +```php +SelectFilter::make('Active') + ->options([ + '' => 'All', + '1' => 'Yes', + '0' => 'No', + ]) + ->setFilterPillTitle('User Status') + ->setFilterPillValues([ + '1' => 'Active', + '0' => 'Inactive', + ]) + ->setPillAttributes([ + 'class' => 'bg-rose-300 text-rose-800 dark:bg-indigo-200 dark:text-indigo-900', + 'default-colors' => false, // Replace the default colors classes + 'default-styling' => true // Use the default styling classes + ]) +``` + +### setPillResetButtonAttributes + +This method allows for customisation of the filter's reset button within the Pills. This will merge/over-ride anything set in the Component setFilterPillsResetFilterButtonAttributes() method. + +```php +SelectFilter::make('Active') + ->options([ + '' => 'All', + '1' => 'Yes', + '0' => 'No', + ]) + ->setFilterPillTitle('User Status') + ->setPillResetButtonAttributes([ + 'class' => 'bg-red-500 text-cyan-500', + 'default-colors' => false, // Replace the default colors classes + 'default-styling' => true // Use the default styling classes + ]) +``` \ No newline at end of file diff --git a/docs/filters/introduction.md b/docs/filters/introduction.md index 11f0d9e76..b0888514b 100644 --- a/docs/filters/introduction.md +++ b/docs/filters/introduction.md @@ -3,7 +3,7 @@ title: Introduction weight: 1 --- -Filters are a good way to narrow down your data. Version 2 has two ways to interact with filters, either by a popover menu or a slide down area. +Filters are a good way to narrow down your data. Version 2 has two ways to interact with filters, either by a popover menu or a slide down area, which are configurable on a per-table basis. ## Popover Menu diff --git a/docs/footer/_index.md b/docs/footer/_index.md index e16f7efb5..4edcb2460 100644 --- a/docs/footer/_index.md +++ b/docs/footer/_index.md @@ -1,4 +1,4 @@ --- title: Footer -weight: 13 +weight: 15 --- diff --git a/docs/footer/available-methods.md b/docs/footer/available-methods.md index 455b4d9d3..5dca23f70 100644 --- a/docs/footer/available-methods.md +++ b/docs/footer/available-methods.md @@ -82,66 +82,9 @@ public function configure(): void } ``` ---- - -## setFooterTrAttributes - -Set any attributes on the footer row element. - -```php -public function configure(): void -{ - $this->setFooterTrAttributes(function($rows) { - return ['class' => 'bg-gray-100']; - }); -} -``` - -By default, this replaces the default classes on the tr element, if you would like to keep them, set the default flag to true. - -```php -public function configure(): void -{ - $this->setFooterTrAttributes(function($rows) { - return [ - 'default' => true, - 'class' => 'bg-gray-100' - ]; - }); -} -``` - -## setFooterTdAttributes - -Set any attributes on the footer row cells. - -```php -public function configure(): void -{ - $this->setFooterTdAttributes(function(Column $column, $rows) { - if ($column->isField('id')) { - return ['class' => 'text-red-500']; - } - }); -} -``` - -By default, this replaces the default classes on the td element, if you would like to keep them, set the default flag to true. - -```php -public function configure(): void -{ - $this->setFooterTdAttributes(function(Column $column, $rows) { - if ($column->isField('id')) { - return [ - 'default' => true, - 'class' => 'text-red-500' - ]; - } - }); -} -``` --- -See also [footer column configuration](../columns/footer). \ No newline at end of file +See also +[footer styling](./styling). +[footer column configuration](../columns/footer). \ No newline at end of file diff --git a/docs/footer/styling.md b/docs/footer/styling.md new file mode 100644 index 000000000..e1685896a --- /dev/null +++ b/docs/footer/styling.md @@ -0,0 +1,62 @@ +--- +title: Styling +weight: 2 +--- + +## setFooterTrAttributes + +Set any attributes on the footer row element. + +```php +public function configure(): void +{ + $this->setFooterTrAttributes(function($rows) { + return ['class' => 'bg-gray-100']; + }); +} +``` + +By default, this replaces the default classes on the tr element, if you would like to keep them, set the default flag to true. + +```php +public function configure(): void +{ + $this->setFooterTrAttributes(function($rows) { + return [ + 'default' => true, + 'class' => 'bg-gray-100' + ]; + }); +} +``` + +## setFooterTdAttributes + +Set any attributes on the footer row cells. + +```php +public function configure(): void +{ + $this->setFooterTdAttributes(function(Column $column, $rows) { + if ($column->isField('id')) { + return ['class' => 'text-red-500']; + } + }); +} +``` + +By default, this replaces the default classes on the td element, if you would like to keep them, set the default flag to true. + +```php +public function configure(): void +{ + $this->setFooterTdAttributes(function(Column $column, $rows) { + if ($column->isField('id')) { + return [ + 'default' => true, + 'class' => 'text-red-500' + ]; + } + }); +} +``` diff --git a/docs/misc/_index.md b/docs/misc/_index.md index 9f806b32e..193fabdf4 100644 --- a/docs/misc/_index.md +++ b/docs/misc/_index.md @@ -1,4 +1,4 @@ --- title: Misc. -weight: 15 +weight: 17 --- diff --git a/docs/misc/actions.md b/docs/misc/actions.md new file mode 100644 index 000000000..089b71139 --- /dev/null +++ b/docs/misc/actions.md @@ -0,0 +1,302 @@ +--- +title: Actions (beta) +weight: 4 +--- + +Actions is a beta feature, that allows for the creation of Action Buttons that appear above the toolbar. These are ideal for common Actions that do not impact existing records, such as a "Create", "Assign", "Back" buttons. + +This is NOT recommended for production use at this point in time. + +## Component Available Methods +### setActionWrapperAttributes + +This is used to set attributes for the "div" that wraps all defined Action Buttons: + +```php + public function configure(): void + { + $this->setActionWrapperAttributes([ + 'class' => 'space-x-4' + ]); + } +``` + +### setActionsInToolbarEnabled + +Displays the Actions within the Toolbar. Default is displaying above the Toolbar. + +```php + public function configure(): void + { + $this->setActionsInToolbarEnabled(); + } +``` + +### setActionsInToolbarDisabled + +Displays the Actions above the Toolbar, default behaviour +```php + public function configure(): void + { + $this->setActionsInToolbarDisabled(); + } +``` + + +### setActionsLeft + +Displays the Actions justified to the left + +```php + public function configure(): void + { + $this->setActionsLeft(); + } +``` + +### setActionsCenter + +Displays the Actions justified to the center + +```php + public function configure(): void + { + $this->setActionsCenter(); + } +``` + +### setActionsRight + +Displays the Actions justified to the right + +```php + public function configure(): void + { + $this->setActionsRight(); + } +``` + +### actions() + +Define your actions using the actions() method: + +```php +public function actions(): array +{ + return [ + Action::make('View Dashboard') + ->setRoute('dashboard'), + ]; +} +``` + +## Button Available Methods + +### setLabelAttributes +Set custom attributes for an Action Label. At present it is recommended to only use this for "class" and "style" attributes to avoid conflicts. + +By default, this replaces the default classes on the Action Label, if you would like to keep them, set the default flag to true. + +```php +Action::make('Dashboard') + ->setRoute('dashboard') + ->wireNavigate() + ->setLabelAttributes([ + 'class' => 'text-xl', + 'default' => true, + ]), +``` + +### setActionAttributes + +setActionAttributes is used to pass any attributes that you wish to implement on the "button" element for the action button. By default it will merge with the default classes. + +You can set "default-styling" and "default-colors" to false to replace, rather than over-ride either default-styling or default-colors. +```php +public function actions(): array +{ + return [ + Action::make('View Dashboard') + ->setActionAttributes([ + 'class' => 'dark:bg-blue-500 dark:text-white dark:border-blue-600 dark:hover:border-blue-900 dark:hover:bg-blue-800', + 'default-colors' => false, // Will over-ride the default colors + 'default-styling' => true // Will use the default styling + ]), + ]; +} +``` + +### setIcon + +setIcon is used to set an icon for the action button + +```php +public function actions(): array +{ + return [ + Action::make('Edit Item') + ->setIcon("fas fa-edit"), + ]; +} +``` + +### setIconAttributes + +setIconAttributes is used to set any additional attributes for the Icon for the action button +```php +public function actions(): array +{ + return [ + Action::make('Edit Item') + ->setIcon("fas fa-edit") + ->setIconAttributes(['class' => 'font-4xl text-4xl']), + ]; +} +``` + +### setIconLeft + +setIconLeft is used to prepend the Icon to the Text (Non-Default Behaviour) + +```php +public function actions(): array +{ + return [ + Action::make('Edit Item') + ->setIcon("fas fa-edit") + ->setIconAttributes(['class' => 'font-4xl text-4xl']) + ->setIconLeft(), + ]; +} +``` + +### setIconRight + +setIconRight is used to append the Icon to the Text (Default Behaviour) + +```php +public function actions(): array +{ + return [ + Action::make('Edit Item') + ->setIcon("fas fa-edit") + ->setIconAttributes(['class' => 'font-4xl text-4xl']) + ->setIconRight(), + ]; +} +``` + +### setRoute + +Used for non-wireable butons, to set the route that the action button should take the user to upon clicking. +```php +public function actions(): array +{ + return [ + Action::make('Dashboard') + ->setRoute('dashboard') + ]; +} +``` + +### wireNavigate + +Used in conjunction with setRoute - makes the link "wire:navigate" rather than default behaviour +```php +public function actions(): array +{ + return [ + Action::make('Dashboard') + ->setRoute('dashboard') + ->wireNavigate() + ]; +} +``` + +### setWireAction +```php +public function actions(): array +{ + return [ + Action::make('Create 2') + ->setWireAction("wire:click") + ]; +} +``` + +### setWireActionParams +Specify the action & parameters to pass to the wire:click method + +```php +public function actions(): array +{ + return [ + Action::make('Create 2') + ->setWireAction("wire:click") + ->setWireActionParams(['id' => 'test']), + ]; +} +``` + +### setWireActionDispatchParams + +Use $dispatch rather than a typical wire:click action + +```php +public function actions(): array +{ + return [ + Action::make('Create 2') + ->setWireAction("wire:click") + ->setWireActionDispatchParams("'openModal', { component: 'test-modal' }"), + ]; +} +``` + +### setView + +This is used to set a Custom View for the Button + +```php +public function actions(): array +{ + return [ + Action::make('Edit Item') + ->setView("buttons.edit"), + ]; +} +``` + + +## Extending + +You can extend the Base Action class which can be a useful timesaver, when you wish to re-use the same look/feel of an Action, but wish to set a different route (for example). +You can set any defaults in the __construct method, ensuring that the parent constructor is called first! + +```php +use Rappasoft\LaravelLivewireTables\Views\Action; + +class EditAction extends Action +{ + public function __construct(?string $label = null) + { + parent::__construct($label); + $this + ->setActionAttributes([ + 'class' => 'dark:bg-blue-500 dark:text-white dark:border-blue-600 dark:hover:border-blue-900 dark:hover:bg-blue-800', + 'default-colors' => false, + 'default-styling' => true + ]) + ->setIcon("fas fa-edit") + ->setIconAttributes([ + 'class' => 'font-4xl text-4xl' + ]); + } +} +``` + +You may define a Custom View to be used via either the setView method, or by defining the view directly in your class. +```php + protected string $view = 'buttons.edit-action'; +``` + diff --git a/docs/misc/hiding-the-table.md b/docs/misc/hiding-the-table.md new file mode 100644 index 000000000..b607ff52b --- /dev/null +++ b/docs/misc/hiding-the-table.md @@ -0,0 +1,78 @@ +--- +title: Hiding The Table (beta) +weight: 8 +--- + +You may wish to hide the table on load. To do so, you should use the following in the mount method. Note that this is in mount, not boot nor configure! + +```php + public function mount() + { + $this->setShouldBeHidden(); + } +``` + +### Using Events To Display/Hide + +For example, you may have a "Sales" table that you wish to hide by default: +```php +class SalesTable extends DataTableComponent +{ + public string $tableName = 'sales'; // Required to keep the call specific + + public function mount() + { + $this->setShouldBeHidden(); // Defaults the table to be hidden, note that this is in MOUNT and not CONFIGURE + } + + // Configure/Columns/Filters etc +} +``` + +The Table allows for different approaches, out-of-the-box it supports the more efficient client-side listeners. + +However - should you wish to use Livewire listeners in your table component, for example if you wish to pass more detail into the Table then you can: + +```php + #[On('showTable.{tableName}')] + public function showTable(): void + { + $this->setShouldBeDisplayed(); + } + + #[On('hideTable.{tableName}')] + public function hideTable(): void + { + $this->setShouldBeHidden(); + } +``` + + +### Secondary Table +Below are the two approaches. Note that you can customise the Livewire "On" to pass additional details should you wish. + +#### Using Client Side Listeners +```php + Column::make('Show') + ->label( + fn($row, Column $column) => "" + )->html(), + Column::make('Hide') + ->label( + fn($row, Column $column) => "" + )->html(), +``` + + +#### Using Livewire "On" Style Listeners: +```php + Column::make('Show') + ->label( + fn($row, Column $column) => "" + )->html(), + Column::make('Hide') + ->label( + fn($row, Column $column) => "" + )->html(), + +``` \ No newline at end of file diff --git a/docs/misc/lifecycle-hooks.md b/docs/misc/lifecycle-hooks.md index 05f490ae8..f56ce1f9a 100644 --- a/docs/misc/lifecycle-hooks.md +++ b/docs/misc/lifecycle-hooks.md @@ -19,9 +19,33 @@ This is called prior to setting up the available Columns via the columns() metho ## columnsSet This is called immediately after the Columns are set up +## configuringColumnSelect +This is called immediately prior to setting up Column Select + +## configuredColumnSelect +This is called immediately after setting up Column Select + ## rowsRetrieved This is called immediately after the query is executed, and is passed the result from the executed query. +## searchUpdated +This is called whenever the search is updated, and is passed the value that has been searched for + +## filterApplying +This is called whenever a Filter is applying + +## filterReset +This is called whenever a Filter is reset + +## filterSet +This is called whenever a Filter is set + +## filterUpdated +This is called whenever a Filter is updated/used + +## filterRemoved +This is called whenever a Filter is removed from the table + ## Use in Traits To use these in a trait, allowing you to easily set defaults across multiple tables, you should ensure that you append the Lifecycle Hook with your trait name, e.g. 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/misc/one-of-many-example.md b/docs/misc/one-of-many-example.md new file mode 100644 index 000000000..b90f558ad --- /dev/null +++ b/docs/misc/one-of-many-example.md @@ -0,0 +1,59 @@ +--- +title: One Of Many Example +weight: 8 +--- + +When trying to retrieve "OneOfMany", you may experience duplicate records. + +Core functionality for this will be added in due course, this is simply a work-around. + +In the meantime, to avoid this, you can use the following approach. + +This example assumes two Models: +User -> HasMany -> Things + +### Models +#### User +id +name +created_at +updated_at +etc + +```php + public function things(): \Illuminate\Database\Eloquent\Relations\HasMany + { + return $this->hasMany(Things::class); + } +``` + +#### Things +id +name +user_id +created_at +updated_at + +### Table +The following is the table code for this example, and retrieves the most recently created "Thing" + +#### Column +```php + Column::make('Latest Thing') + ->label( + fn ($row, Column $column) => $row->things->first()->name + ), +``` + +#### Builder +```php + public function builder(): Builder { + + return User::query()->with(['things' => function ($query) { + $query->select(['id','user_id','name'])->orderBy('created_at', 'desc')->limit(1); + }]); + + } +``` + +Core functionality for this will be added in due course, this is simply a work-around. \ No newline at end of file diff --git a/docs/misc/refreshing.md b/docs/misc/refreshing.md index e318bfdc7..5e07f69b6 100644 --- a/docs/misc/refreshing.md +++ b/docs/misc/refreshing.md @@ -42,11 +42,16 @@ public function configure(): void ## setRefreshMethod -Fire a specific action when polling. +Fire a specific action when polling. This is only necessary when you wish to call additional actions on each refresh. You must have a public function with the same name as the refresh method. ```php public function configure(): void { - $this->setRefreshMethod('refresh'); + $this->setRefreshMethod('refreshTable'); +} + +public function refreshTable() +{ + // Custom Code Here } ``` diff --git a/docs/misc/saving-state.md b/docs/misc/saving-state.md index 8d85acd26..26f031a0d 100644 --- a/docs/misc/saving-state.md +++ b/docs/misc/saving-state.md @@ -6,11 +6,11 @@ weight: 6 There may be occasions that you'd like to save the table state, for example if you have a complex set of filters, search parameters, or simply to remember which page you were on! You may call the following method to retrieve the state of the table: -``` +```php $this->getTableStateToArray(); ``` And to restore it, you should call the following method, passing the stored array. -``` +```php $this->restoreStateFromArray(array $storedArray) ``` diff --git a/docs/misc/tools.md b/docs/misc/tools.md new file mode 100644 index 000000000..0d9dbc390 --- /dev/null +++ b/docs/misc/tools.md @@ -0,0 +1,83 @@ +--- +title: Tools +weight: 9 +--- + +The Table offers additional configuration to show/hide the Tools/Toolbar sections: +## Tools +Contains: +- Filter Pills +- Sorting Pills +- The Toolbar + +## Toolbar +Contains: +- Actions (if set to Toolbar) +- Column Select dropdown +- Configurable Areas for Toolbar +- Filters Button/Dropdown/Popover +- Pagination dropdown +- Reorder Button +- Search Input + +## Component Available Methods + +### setToolsEnabled +The Default Behaviour, Tools Are Enabled. But will only be rendered if there are available/enabled elements. If the Toolbar is enabled, this takes into account any Toolbar elements that are present. +```php + public function configure(): void + { + $this->setToolsEnabled(); + } +``` + +### setToolsDisabled +Disables the Tools section, this includes the Toolbar, and Sort/Filter pills +```php + public function configure(): void + { + $this->setToolsDisabled(); + } +``` + +### setToolBarEnabled +The Default Behaviour, ToolBar is Enabled. But will only be rendered if there are available/enabled elements +```php + public function configure(): void + { + $this->setToolBarEnabled(); + } +``` + +### setToolBarDisabled +Disables the Toolbar, which contains the Reorder, Filters, Search, Column Select, Pagination buttons/options. Does not impact the Filter/Sort pills (if enabled) +```php + public function configure(): void + { + $this->setToolBarDisabled(); + } +``` + +### setToolsAttributes +Allows setting of attributes for the parent element in the tools blade + +By default, this replaces the default classes on the tools blade, if you would like to keep them, set the default-colors/default-styling flags to true as appropriate + +```php + public function configure(): void + { + $this->setToolsAttributes(['class' => ' bg-green-500', 'default-colors' => false, 'default-styling' => true]); + } +``` + +### setToolBarAttributes +Allows setting of attributes for the parent element in the toolbar blade. + +By default, this replaces the default classes on the toolbar blade, if you would like to keep them, set the default-colors/default-styling flags to true as appropriate + +```php + public function configure(): void + { + $this->setToolBarAttributes(['class' => ' bg-red-500', 'default-colors' => false, 'default-styling' => true]); + } +``` diff --git a/docs/pagination/_index.md b/docs/pagination/_index.md index 723cb0c11..50491640d 100644 --- a/docs/pagination/_index.md +++ b/docs/pagination/_index.md @@ -1,4 +1,4 @@ --- title: Pagination -weight: 7 +weight: 8 --- diff --git a/docs/pagination/available-methods.md b/docs/pagination/available-methods.md index d1b60a375..eae078132 100644 --- a/docs/pagination/available-methods.md +++ b/docs/pagination/available-methods.md @@ -263,3 +263,47 @@ public function configure(): void ]); } ``` + +## setShouldRetrieveTotalItemCountStatus + +Used when "simple" pagination is being used, allows the enabling/disabling of the "total records" count. This may be desirable to disable in larger data sets. This is enabled by default. + +```php +public function configure(): void +{ + $this->setShouldRetrieveTotalItemCountStatus(false); +} +``` + +## setShouldRetrieveTotalItemCountEnabled + +Used when "simple" pagination is being used, enables the "total records" count. + +```php +public function configure(): void +{ + $this->setShouldRetrieveTotalItemCountEnabled(); +} +``` + +## setShouldRetrieveTotalItemCountDisabled + +Used when "simple" pagination is being used, disables the "total records" count. + +```php +public function configure(): void +{ + $this->setShouldRetrieveTotalItemCountDisabled(); +} +``` + +## setPaginationWrapperAttributes + +Used to set attributes for the "div" that wraps the pagination section + +```php +public function configure(): void +{ + $this->setPaginationWrapperAttributes(['class' => 'text-lg']); +} +``` diff --git a/docs/reordering/_index.md b/docs/reordering/_index.md index bc21a450b..e66081c28 100644 --- a/docs/reordering/_index.md +++ b/docs/reordering/_index.md @@ -1,4 +1,4 @@ --- title: Reordering -weight: 11 +weight: 13 --- diff --git a/docs/reordering/available-methods.md b/docs/reordering/available-methods.md index 101848599..6534c92ec 100644 --- a/docs/reordering/available-methods.md +++ b/docs/reordering/available-methods.md @@ -142,3 +142,19 @@ public function configure(): void $this->setDefaultReorderSort('order', 'desc'); } ``` + + +## setReorderThAttributes + +You may pass an array to this method, which allows you to pass Custom Attributes into the table header for the Reorder Column + +```php +public function configure(): void +{ + + $this->setReorderThAttributes([ + 'class' => 'bg-red-500', + 'default' => false + ]); +} +``` \ No newline at end of file diff --git a/docs/rows/_index.md b/docs/rows/_index.md index f731c19d2..7d5ebba99 100644 --- a/docs/rows/_index.md +++ b/docs/rows/_index.md @@ -1,4 +1,4 @@ --- title: Rows -weight: 5 +weight: 6 --- diff --git a/docs/search/_index.md b/docs/search/_index.md index edb174fde..4aac1542b 100644 --- a/docs/search/_index.md +++ b/docs/search/_index.md @@ -1,4 +1,4 @@ --- title: Search -weight: 8 +weight: 9 --- diff --git a/docs/search/available-methods.md b/docs/search/available-methods.md index e05ce7649..422757c37 100644 --- a/docs/search/available-methods.md +++ b/docs/search/available-methods.md @@ -168,3 +168,63 @@ public function configure(): void $this->setSearchThrottle(1000); } ``` + +## setTrimSearchStringEnabled + +A new behaviour, which will trim search strings of whitespace at either end + +```php +public function configure(): void +{ + // Will trim whitespace from either end of search strings + $this->setTrimSearchStringEnabled(); +} +``` + +## setTrimSearchStringDisabled + +The default behaviour, does not trim search strings of whitespace. + +```php +public function configure(): void +{ + // Will not trim whitespace from either end of search strings + $this->setTrimSearchStringDisabled(); +} +``` + +## Search Icon + +To help customise, a "Search Input Icon" has been added, allowing for the addition of an icon to the search input field. + +At present, the Search Icon is only available as a "left aligned" icon. + +This is presently only available for Tailwind implementations + +### setSearchIcon + +This adds an Icon to the Search Input Field, which expects an icon path (e.g. heroicon-m-magnifying-glass) + +```php +public function configure(): void +{ + $this->setSearchIcon('heroicon-m-magnifying-glass'); +} +``` + +### setSearchIconAttributes + +This allows you to specify attributes for the Search Icon for the Input Field. + +Note that classes will be injected prior to styles, due to the behaviour of icons. + +```php +public function configure(): void +{ + $this->setSearchIconAttributes([ + 'class' => 'h-4 w-4', + 'style' => 'color: #000000', + ]); +} + +``` \ No newline at end of file diff --git a/docs/secondary-header/_index.md b/docs/secondary-header/_index.md index 5e2b9aba5..f334c9e68 100644 --- a/docs/secondary-header/_index.md +++ b/docs/secondary-header/_index.md @@ -1,4 +1,4 @@ --- title: Secondary Header -weight: 12 +weight: 14 --- diff --git a/docs/secondary-header/available-methods.md b/docs/secondary-header/available-methods.md index 740c02db5..6bd85d5c3 100644 --- a/docs/secondary-header/available-methods.md +++ b/docs/secondary-header/available-methods.md @@ -43,66 +43,9 @@ public function configure(): void } ``` ---- - -## setSecondaryHeaderTrAttributes - -Set any attributes on the secondary header row element. - -```php -public function configure(): void -{ - $this->setSecondaryHeaderTrAttributes(function($rows) { - return ['class' => 'bg-gray-100']; - }); -} -``` - -By default, this replaces the default classes on the tr element, if you would like to keep them, set the default flag to true. - -```php -public function configure(): void -{ - $this->setSecondaryHeaderTrAttributes(function($rows) { - return [ - 'default' => true, - 'class' => 'bg-gray-100' - ]; - }); -} -``` - -## setSecondaryHeaderTdAttributes - -Set any attributes on the secondary header row cells. - -```php -public function configure(): void -{ - $this->setSecondaryHeaderTdAttributes(function(Column $column, $rows) { - if ($column->isField('id')) { - return ['class' => 'text-red-500']; - } - }); -} -``` - -By default, this replaces the default classes on the td element, if you would like to keep them, set the default flag to true. - -```php -public function configure(): void -{ - $this->setSecondaryHeaderTdAttributes(function(Column $column, $rows) { - if ($column->isField('id')) { - return [ - 'default' => true, - 'class' => 'text-red-500' - ]; - } - }); -} -``` --- -See also [secondary header column configuration](../columns/secondary-header). \ No newline at end of file +See also: +[secondary header styling](./styling). +[secondary header column configuration](../columns/secondary-header). \ No newline at end of file diff --git a/docs/secondary-header/styling.md b/docs/secondary-header/styling.md new file mode 100644 index 000000000..8eb97e517 --- /dev/null +++ b/docs/secondary-header/styling.md @@ -0,0 +1,62 @@ +--- +title: Styling +weight: 2 +--- + +## setSecondaryHeaderTrAttributes + +Set any attributes on the secondary header row element. + +```php +public function configure(): void +{ + $this->setSecondaryHeaderTrAttributes(function($rows) { + return ['class' => 'bg-gray-100']; + }); +} +``` + +By default, this replaces the default classes on the tr element, if you would like to keep them, set the default flag to true. + +```php +public function configure(): void +{ + $this->setSecondaryHeaderTrAttributes(function($rows) { + return [ + 'default' => true, + 'class' => 'bg-gray-100' + ]; + }); +} +``` + +## setSecondaryHeaderTdAttributes + +Set any attributes on the secondary header row cells. + +```php +public function configure(): void +{ + $this->setSecondaryHeaderTdAttributes(function(Column $column, $rows) { + if ($column->isField('id')) { + return ['class' => 'text-red-500']; + } + }); +} +``` + +By default, this replaces the default classes on the td element, if you would like to keep them, set the default flag to true. + +```php +public function configure(): void +{ + $this->setSecondaryHeaderTdAttributes(function(Column $column, $rows) { + if ($column->isField('id')) { + return [ + 'default' => true, + 'class' => 'text-red-500' + ]; + } + }); +} +``` diff --git a/docs/sorting/_index.md b/docs/sorting/_index.md index a99eabf1d..422739fb6 100644 --- a/docs/sorting/_index.md +++ b/docs/sorting/_index.md @@ -1,4 +1,4 @@ --- title: Sorting -weight: 6 +weight: 7 --- diff --git a/docs/sorting/available-methods.md b/docs/sorting/available-methods.md index 85b181ae5..bd58d7064 100644 --- a/docs/sorting/available-methods.md +++ b/docs/sorting/available-methods.md @@ -153,6 +153,102 @@ public function configure(): void } ``` +## setSortingPillsItemAttributes +Allows for customisation of the appearance of the "Sorting Pills Item" + +Note that this utilises a refreshed approach for attributes, and allows for appending to, or replacing the styles and colors independently, via the below methods. + +#### default-colors +Setting to false will disable the default colors for the Sorting Pills Item, the default colors are: + +Bootstrap: None + +Tailwind: `bg-indigo-100 text-indigo-800 dark:bg-indigo-200 dark:text-indigo-900` + +#### default-styling +Setting to false will disable the default styling for the Sorting Pills Item, the default styling is: + +Bootstrap 4: `badge badge-pill badge-info d-inline-flex align-items-center` + +Bootstrap 5: `badge rounded-pill bg-info d-inline-flex align-items-center` + +Tailwind: `inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium leading-4 capitalize` + +```php +public function configure(): void +{ + $this->setSortingPillsItemAttributes([ + 'class' => 'bg-rose-300 text-rose-800 dark:bg-indigo-200 dark:text-indigo-900', // Add these classes to the sorting pills item + 'default-colors' => false, // Do not output the default colors + 'default-styling' => true // Output the default styling + ]); +} +``` + +## setSortingPillsClearSortButtonAttributes +Allows for customisation of the appearance of the "Sorting Pills Clear Sort Button" + +Note that this utilises a refreshed approach for attributes, and allows for appending to, or replacing the styles and colors independently, via the below methods. + +#### default-colors +Setting to false will disable the default colors for the Sorting Pills Clear Sort Button, the default colors are: + +Bootstrap: None + +Tailwind: `text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:bg-indigo-500 focus:text-white` + +#### default-styling +Setting to false will disable the default styling for the Sorting Pills Clear Sort Button, the default styling is: + +Bootstrap 4: `text-white ml-2` + +Bootstrap 5: `text-white ms-2` + +Tailwind: `flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center focus:outline-none` + +```php +public function configure(): void +{ + $this->setSortingPillsClearSortButtonAttributes([ + 'class' => 'text-rose-400 hover:bg-rose-200 hover:text-rose-500 focus:bg-rose-500', // Add these classes to the sorting pills clear sort button + 'default-colors' => false, // Do not output the default colors + 'default-styling' => true // Output the default styling + ]); +} +``` + +## setSortingPillsClearAllButtonAttributes +Allows for customisation of the appearance of the "Sorting Pills Clear All Button" + +Note that this utilises a refreshed approach for attributes, and allows for appending to, or replacing the styles and colors independently, via the below methods. + +#### default-colors +Setting to false will disable the default colors for the Sorting Pills Clear All Button, the default colors are: + +Bootstrap: None + +Tailwind: `bg-gray-100 text-gray-800 dark:bg-gray-200 dark:text-gray-900` + +#### default-styling +Setting to false will disable the default styling for the Sorting Pills Clear All Button, the default styling is: + +Bootstrap 4: `badge badge-pill badge-light` + +Bootstrap 5: `badge rounded-pill bg-light text-dark text-decoration-none` + +Tailwind: `inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium` + +```php +public function configure(): void +{ + $this->setSortingPillsClearAllButtonAttributes([ + 'class' => 'bg-rose-100 text-rose-800 dark:bg-gray-200 dark:text-gray-900', // Add these classes to the sorting pills clear all button + 'default-colors' => false, // Do not output the default colors + 'default-styling' => true // Output the default styling + ]); +} +``` + --- ## setDefaultSortingLabels diff --git a/docs/start/commands.md b/docs/start/commands.md index 21759f770..606b57dfc 100644 --- a/docs/start/commands.md +++ b/docs/start/commands.md @@ -1,16 +1,16 @@ --- title: Commands -weight: 6 +weight: 5 --- ## Generating Datatable Components To generate a new datatable component you can use the `make:datatable` command: -Create a new datatable component called `UserTable` in `App\Livewire` that uses the `App\Models\User` model. +Create a new datatable component called `UsersTable` in `App\Livewire` that uses the `App\Models\User` model. ```bash -php artisan make:datatable UserTable User +php artisan make:datatable UsersTable User ``` ### Custom Model Path diff --git a/docs/start/configuration.md b/docs/start/configuration.md index 75aef5083..01725843f 100644 --- a/docs/start/configuration.md +++ b/docs/start/configuration.md @@ -1,6 +1,6 @@ --- title: Configuration -weight: 4 +weight: 5 --- ## Publishing Assets @@ -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/docs/start/including-assets.md b/docs/start/including-assets.md index cbc25cb70..b0c782fe8 100644 --- a/docs/start/including-assets.md +++ b/docs/start/including-assets.md @@ -1,6 +1,6 @@ --- title: Including Assets -weight: 3 +weight: 4 --- ## Package Specific Code diff --git a/docs/start/installation.md b/docs/start/installation.md index d09a68879..11d07fa01 100644 --- a/docs/start/installation.md +++ b/docs/start/installation.md @@ -1,6 +1,6 @@ --- title: Installation -weight: 2 +weight: 3 --- You can install the package via composer: diff --git a/docs/start/recommended.md b/docs/start/recommended.md new file mode 100644 index 000000000..71f29e468 --- /dev/null +++ b/docs/start/recommended.md @@ -0,0 +1,90 @@ +--- +title: Recommended +weight: 2 +--- + +While the package is very customisable, and supports a number of different approaches. The below is the recommended approach, that gives the best performance for the tables: + +## Installation +``` +composer require rappasoft/laravel-livewire-tables +``` + +## Publish the Tables Config +``` +php artisan vendor:publish --tag="livewire-tables-config" +``` + +## Livewire Tables Config Updates +Update the published Livewire Tables Config (config/livewire-tables.php) and set the following to false: +```php + /** + * Cache Rappasoft Frontend Assets + */ + 'cache_assets' => false, + + /** + * Enable or Disable automatic injection of core assets + */ + 'inject_core_assets_enabled' => false, + + /** + * Enable or Disable automatic injection of third-party assets + */ + 'inject_third_party_assets_enabled' => false, + + /** + * Enable Blade Directives (Not required if automatically injecting or using bundler approaches) + */ + 'enable_blade_directives' => false, +``` + +## Bundling the Assets +As you have now told the package not to inject the assets, add the following to your resources/js/app.js file: + +```js +import '../../vendor/rappasoft/laravel-livewire-tables/resources/imports/laravel-livewire-tables-all.js'; +``` + +## Update Layouts +Ensure that your layouts do not reference any of the following blade directives, as these are not required with the above approach +```html + + @rappasoftTableStyles + + + @rappasoftTableThirdPartyStyles + + + @rappasoftTableScripts + + + @rappasoftTableThirdPartyScripts +``` + +## Tailwind Specific +If using Tailwind, you should update your tailwind.config.js file, adding the following to the "content" section under module.exports. This ensures that the Livewire Tables specific core classes are included. + +```js + './vendor/rappasoft/laravel-livewire-tables/resources/views/*.blade.php', + './vendor/rappasoft/laravel-livewire-tables/resources/views/**/*.blade.php', +``` + +It is also recommended to add the paths to any Livewire Tables components, for example: +```js + './app/Livewire/*.php', + './app/Livewire/**/*.php', +``` +So that any classes used in setTdAttributes or similar are included! + +## Run your build process +``` +npm run build +``` + +## Clear Cached Views +``` +php artisan view:clear +``` + +You may of course run view:cache at this point. \ No newline at end of file diff --git a/docs/start/rendering.md b/docs/start/rendering.md index e21320aca..4e9e1e4fe 100644 --- a/docs/start/rendering.md +++ b/docs/start/rendering.md @@ -1,6 +1,6 @@ --- title: Rendering -weight: 5 +weight: 7 --- ## Rendering Components diff --git a/docs/usage/common-issues.md b/docs/usage/common-issues.md new file mode 100644 index 000000000..34b3b5eb1 --- /dev/null +++ b/docs/usage/common-issues.md @@ -0,0 +1,23 @@ +--- +title: Common Issues +weight: 4 +--- + +### Property Errors + +The strong recommendation is to not publish the views for this package. The vast majority of elements can be customised using methods within the package. + +See "Available Methods" in most sections for details, some examples: +[DataTable Styling](../datatable/styling) +[Bulk Actions Styling](../bulk-actions/styling) + +### Previously Published Views + +The strong recommendation is to not publish the views for this package. If you have published the views prior to v3.4.5, and do not wish to remove these, then you should add the following method, to disable the newer (more efficient) behaviour: + +```php +public function configure(): void +{ + $this->useComputedPropertiesDisabled(); +} +``` diff --git a/minifyJs b/minifyJs new file mode 100755 index 000000000..a25ec833e --- /dev/null +++ b/minifyJs @@ -0,0 +1,6 @@ +minify ./resources/js/partials/filter-boolean.js > ./resources/js/partials/filter-boolean.min.js \ +&& minify ./resources/js/partials/filter-date-range.js > ./resources/js/partials/filter-date-range.min.js \ +&& minify ./resources/js/partials/filter-number-range.js > ./resources/js/partials/filter-number-range.min.js \ +&& minify ./resources/js/partials/reorder.js > ./resources/js/partials/reorder.min.js \ +&& minify ./resources/js/partials/tableWrapper.js > ./resources/js/partials/tableWrapper.min.js \ +&& minify ./resources/js/laravel-livewire-tables.js > ./resources/js/laravel-livewire-tables.min.js diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 000000000..d1ed59250 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,97 @@ +parameters: + ignoreErrors: + - + message: '#^Offset ''1'' on array\ in empty\(\) does not exist\.$#' + identifier: empty.offset + count: 1 + path: src/DataTableComponent.php + + - + message: '#^Offset ''99'' on array\ in isset\(\) does not exist\.$#' + identifier: isset.offset + count: 1 + path: src/DataTableComponent.php + + - + message: '#^Offset ''99'' on non\-empty\-array\<1\|string, list\> in isset\(\) does not exist\.$#' + identifier: isset.offset + count: 1 + path: src/DataTableComponent.php + + - + message: '#^Parameter \#1 \$view of function view expects view\-string\|null, string given\.$#' + identifier: argument.type + count: 1 + path: src/DataTableComponent.php + + - + message: '#^Property Rappasoft\\LaravelLivewireTables\\DataTableComponent\:\:\$model has no type specified\.$#' + identifier: missingType.property + count: 1 + path: src/DataTableComponent.php + + - + message: '#^Parameter \#1 \$view of function view expects view\-string\|null, string given\.$#' + identifier: argument.type + count: 1 + path: src/View/Components/FilterPill.php + + - + message: '#^Unsafe usage of new static\(\)\.$#' + identifier: new.static + count: 1 + path: src/Views/Action.php + + - + message: '#^Unsafe usage of new static\(\)\.$#' + identifier: new.static + count: 1 + path: src/Views/Column.php + + - + message: '#^Unsafe usage of new static\(\)\.$#' + identifier: new.static + count: 1 + path: src/Views/Filter.php + + - + message: '#^Parameter \#1 \$callback of method Illuminate\\Support\\Collection\\:\:filter\(\) expects \(callable\(string, int\)\: bool\)\|null, Closure\(mixed\)\: int\<0, max\> given\.$#' + identifier: argument.type + count: 1 + path: src/Views/Filters/MultiSelectDropdownFilter.php + + - + message: '#^Unable to resolve the template type TMapWithKeysKey in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#' + identifier: argument.templateType + count: 1 + path: src/Views/Filters/MultiSelectDropdownFilter.php + + - + message: '#^Unable to resolve the template type TMapWithKeysValue in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#' + identifier: argument.templateType + count: 1 + path: src/Views/Filters/MultiSelectDropdownFilter.php + + - + message: '#^Parameter \#1 \$callback of method Illuminate\\Support\\Collection\\:\:filter\(\) expects \(callable\(string, int\)\: bool\)\|null, Closure\(mixed\)\: int\<0, max\> given\.$#' + identifier: argument.type + count: 1 + path: src/Views/Filters/MultiSelectFilter.php + + - + message: '#^Parameter \#1 \$callback of method Illuminate\\Support\\Collection\\:\:filter\(\) expects \(callable\(string, int\)\: bool\)\|null, Closure\(mixed\)\: int\<0, max\> given\.$#' + identifier: argument.type + count: 1 + path: src/Views/Filters/NumberRangeFilter.php + + - + message: '#^Unable to resolve the template type TMapWithKeysKey in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#' + identifier: argument.templateType + count: 1 + path: src/Views/Filters/SelectFilter.php + + - + message: '#^Unable to resolve the template type TMapWithKeysValue in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#' + identifier: argument.templateType + count: 1 + path: src/Views/Filters/SelectFilter.php diff --git a/phpstan.neon b/phpstan.neon index 7ed8f5027..096099854 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,24 +1,42 @@ includes: - - vendor/nunomaduro/larastan/extension.neon + - vendor/larastan/larastan/extension.neon + - phpstan-baseline.neon parameters: paths: - - config - database - src - level: 5 + level: 6 tmpDir: build/phpstan checkOctaneCompatibility: true checkModelProperties: true - checkMissingIterableValueType: false treatPhpDocTypesAsCertain: false reportUnmatchedIgnoredErrors: false - checkGenericClassInNonGenericObjectType: false ignoreErrors: - - '#Access to an undefined property Rappasoft\\LaravelLivewireTables\\Views\\Column\:\:\$view#' - - "#Unsafe usage of new static#" - - '#on array\, mixed\>\> in empty\(\) does not exist.#' - - '#on array, mixed>> in isset\(\) does not exist#' - - '#on non-empty-array<1|string, array, mixed>> in isset\(\) does not exist.#' - - '#\$callback of method Illuminate\\Support\\Collection::filter\(\) expects \(callable\(string, int\): bool\)\|null, Closure\(mixed\): int<0, max> given.#' - - '#Property Illuminate\\Database\\Query\\Builder\:\:\$joins \(array\) on left side of \?\? is not nullable.#' + - identifier: missingType.generics + - identifier: missingType.iterableValue + - identifier: trait.unused + - identifier: deadCode.unreachable + - identifier: booleanNot.alwaysTrue + paths: + - src/Views/Columns/Traits/HasDataTableComponent.php + - identifier: notIdentical.alwaysTrue + paths: + - src/Traits/Filters/Helpers/FilterPillsHelpers.php + - src/Traits/Helpers/CustomisationsHelpers.php + - src/Traits/Helpers/QueryHelpers.php + - src/Views/Columns/Traits/HasSlot.php + - src/Views/Columns/Traits/Helpers/ArrayColumnHelpers.php + - identifier: function.alreadyNarrowedType + paths: + - src/Views/Columns/Traits/Helpers/ArrayColumnHelpers.php + - src/Features/AutoInjectRappasoftAssets.php + - src/Traits/WithBulkActions.php + - src/Views/Actions/Traits/HasActionAttributes.php + - src/Views/Filters/MultiSelectDropdownFilter.php + - src/Views/Filters/Traits/HasOptions.php + - src/Views/Traits/Core/HasTheme.php + - src/Views/Traits/Core/HasView.php + - identifier: unset.possiblyHookedProperty + paths: + - src/Traits/Configuration/CollapsingColumnConfiguration.php diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 5ff33415f..30d511e6d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -5,19 +5,25 @@ colors="false" cacheResult="false" executionOrder="random" - failOnWarning="false" failOnRisky="false" failOnEmptyTestSuite="false" beStrictAboutOutputDuringTests="true" > - - tests + + tests/Unit + + + tests/Visuals + + + tests/Localisations/Unit + + + tests/Localisations/Presence - config - database src diff --git a/resources/css/bootstrap-custom.css b/resources/css/bootstrap-custom.css new file mode 100644 index 000000000..edd9e2ee6 --- /dev/null +++ b/resources/css/bootstrap-custom.css @@ -0,0 +1,31 @@ +.laravel-livewire-tables-cursor { + cursor:pointer; +} + +.laravel-livewire-tables-btn-tiny { + width:0.5em; + height:0.5em; +} + +.laravel-livewire-tables-btn-smaller { + width:1em; + height:1em; +} + +.laravel-livewire-tables-btn-small +{ + width:1.2em; + height:1.2em; +} + +.laravel-livewire-tables-btn-md +{ + width:1.3em; + height:1.3em; +} + +.laravel-livewire-tables-btn-lg +{ + width:1.4em; + height:1.4em; +} diff --git a/resources/css/bootstrap-custom.min.css b/resources/css/bootstrap-custom.min.css new file mode 100644 index 000000000..40bb25da2 --- /dev/null +++ b/resources/css/bootstrap-custom.min.css @@ -0,0 +1 @@ +.laravel-livewire-tables-cursor{cursor:pointer}.laravel-livewire-tables-btn-tiny{width:.5em;height:.5em}.laravel-livewire-tables-btn-smaller{width:1em;height:1em}.laravel-livewire-tables-btn-small{width:1.2em;height:1.2em}.laravel-livewire-tables-btn-md{width:1.3em;height:1.3em}.laravel-livewire-tables-btn-lg{width:1.4em;height:1.4em} \ No newline at end of file diff --git a/resources/css/laravel-livewire-tables.css b/resources/css/laravel-livewire-tables.css index 77c564573..a9c1e186d 100644 --- a/resources/css/laravel-livewire-tables.css +++ b/resources/css/laravel-livewire-tables.css @@ -5,9 +5,37 @@ border-color: var(--rappasoft-table-highlight-color, rgb(255 255 255)) !important; } +.laravel-livewire-tables-cursor { + cursor:pointer; +} +.laravel-livewire-tables-btn-tiny { + width:0.5em; + height:0.5em; +} +.laravel-livewire-tables-btn-smaller { + width:1em; + height:1em; +} +.laravel-livewire-tables-btn-small +{ + width:1.2em; + height:1.2em; +} + +.laravel-livewire-tables-btn-md +{ + width:1.3em; + height:1.3em; +} + +.laravel-livewire-tables-btn-lg +{ + width:1.4em; + height:1.4em; +} .laravel-livewire-tables-highlight-top { border-style: solid !important; @@ -137,13 +165,11 @@ .range-slider::before { --before: 1; - --at-edge: var(--thumb-close-to-min); counter-reset: x var(--min); left: var(--offset); } .range-slider::after { - --at-edge: var(--thumb-close-to-max); counter-reset: x var(--max); right: var(--offset); } @@ -383,7 +409,7 @@ label[dir=rtl] .range-slider { } .dark .lds-hourglass:after { border: 32px solid #FFF; - + border-color: #000 transparent #000 transparent; } diff --git a/resources/css/laravel-livewire-tables.min.css b/resources/css/laravel-livewire-tables.min.css index bf77392cc..778bf1e21 100644 --- a/resources/css/laravel-livewire-tables.min.css +++ b/resources/css/laravel-livewire-tables.min.css @@ -1,7 +1 @@ -.laravel-livewire-tables-highlight{border-style:solid!important;border-top-width:2px!important;border-bottom-width:2px!important;border-color:var(--rappasoft-table-highlight-color,rgb(255 255 255))!important}.laravel-livewire-tables-highlight-top{border-style:solid!important;border-top-width:2px!important;border-bottom-width:0!important;border-color:var(--rappasoft-table-top-highlight-color,var(--rappasoft-table-highlight-color,rgb(255 255 255)))!important}.laravel-livewire-tables-highlight-bottom{border-style:solid!important;border-top-width:0!important;border-bottom-width:2px!important;border-color:var(--rappasoft-table-bottom-highlight-color,var(--rappasoft-table-highlight-color,rgb(255 255 255)))!important}.laravel-livewire-tables-reorderingMinimised{width:0}.laravel-livewire-table-dragging{opacity:.5!important}.range-slider.grad{--progress-shadow:2px 2px 4px rgba(0, 0, 0, 0.2) inset;--progress-flll-shadow:var(--progress-shadow);--fill-color:linear-gradient(to right, LightCyan, var(--primary-color, #0366d6));--thumb-shadow:0 0 4px rgba(0, 0, 0, 0.3),-3px 9px 9px rgba(255, 241, 241, 0.33) inset,-1px 3px 2px rgba(255, 255, 255, 0.33) inset,0 0 0 99px var(--primary-color, #0366d6) inset}.range-slider.grad input:hover{--thumb-transform:scale(1.2)}.range-slider.grad input:active{--thumb-shadow:inherit;--thumb-transform:scale(1)}.range-slider.flat{--thumb-size:25px;--track-height:calc(var(--thumb-size) / 3);--progress-shadow:none;--progress-flll-shadow:none;--thumb-shadow:0 0 0 7px var(--primary-color, #0366d6) inset,0 0 0 99px white inset;--thumb-shadow-hover:0 0 0 9px var(--primary-color, #0366d6) inset,0 0 0 99px white inset;--thumb-shadow-active:0 0 0 13px var(--primary-color, #0366d6) inset}.range-slider{--value-offset-y:var(--ticks-gap);--value-background:transparent;--value-font:700 12px/1 Arial;--progress-radius:20px;--track-height:calc(var(--thumb-size) / 2);--min-max-opacity:1;--min-max-x-offset:10%;--thumb-size:22px;--thumb-shadow:0 0 3px rgba(0, 0, 0, 0.4),0 0 1px rgba(0, 0, 0, 0.5) inset,0 0 0 99px var(--thumb-color, white) inset;--thumb-shadow-active:0 0 0 calc(var(--thumb-size) / 4) inset var(--thumb-color, white),0 0 0 99px var(--primary-color, #0366d6) inset,0 0 3px rgba(0, 0, 0, 0.4);--thumb-shadow-hover:var(--thumb-shadow);--ticks-thickness:1px;--ticks-height:5px;--ticks-gap:var(--ticks-height, - 0);--step:1;--ticks-count:Calc(var(--max) - var(--min))/var(--step);--maxTicksAllowed:30;--too-many-ticks:Min(1, Max(var(--ticks-count) - var(--maxTicksAllowed), 0));--x-step:Max(var(--step), - var(--too-many-ticks) * (var(--max) - var(--min)));--tickInterval:100/((var(--max) - var(--min)) / var(--step)) * var(--tickEvery, 1);--tickIntervalPerc:calc((100% - var(--thumb-size)) / ((var(--max) - var(--min)) / var(--x-step)) * var(--tickEvery, 1));--value-a:Clamp(var(--min), - var(--value, 0), - var(--max));--value-b:var(--value, 0);--text-value-a:var(--text-value, "");--completed-a:calc((var(--value-a) - var(--min)) / (var(--max) - var(--min)) * 100);--completed-b:calc((var(--value-b) - var(--min)) / (var(--max) - var(--min)) * 100);--ca:Min(var(--completed-a), - var(--completed-b));--cb:Max(var(--completed-a), var(--completed-b));--thumbs-too-close:Clamp(-1, 1000 * (Min(1, Max(var(--cb) - var(--ca) - 5, -1)) + 0.001), 1);--thumb-close-to-min:Min(1, Max(var(--ca) - 2, - 0));--thumb-close-to-max:Min(1, Max(98 - var(--cb), 0));display:inline-block;height:max(var(--track-height),var(--thumb-size));background:linear-gradient(to right,var(--ticks-color,silver) var(--ticks-thickness),transparent 1px) repeat-x;background-size:var(--tickIntervalPerc) var(--ticks-height);background-position-x:calc(var(--thumb-size)/ 2 - var(--ticks-thickness)/ 2);background-position-y:var(--flip-y,bottom);padding-bottom:var(--flip-y,var(--ticks-gap));padding-top:calc(var(--flip-y) * var(--ticks-gap));position:relative;z-index:1}.range-slider::after,.range-slider::before{--offset:calc(var(--thumb-size) / 2);content:counter(x);display:var(--show-min-max,block);font:var(--min-max-font, 12px Arial);position:absolute;bottom:var(--flip-y,-2.5ch);top:calc(-2.5ch * var(--flip-y));opacity:clamp(0, var(--at-edge), var(--min-max-opacity));transform:translateX(calc(var(--min-max-x-offset) * var(--before,-1) * -1)) scale(var(--at-edge));pointer-events:none}.dark .range-slider::after,.dark .range-slider::before,.dark .range-slider>input+output::after,.dark .range-slider>input:first-of-type+output::after{color:#fff}.range-slider::before{--before:1;--at-edge:var(--thumb-close-to-min);counter-reset:x var(--min);left:var(--offset)}.range-slider::after{--at-edge:var(--thumb-close-to-max);counter-reset:x var(--max);right:var(--offset)}.range-slider__progress::after,.range-slider__progress::before{content:"";top:0;right:0;bottom:0;border-radius:inherit;left:0}.range-slider__values{position:relative;top:50%;line-height:0;text-align:justify;width:100%;pointer-events:none;margin:0 auto;z-index:5}.range-slider__values::after{content:"";width:100%;display:inline-block;height:0;background:red}.range-slider__progress{--start-end:calc(var(--thumb-size) / 2);--clip-end:calc(100% - (var(--cb)) * 1%);--clip-start:calc(var(--ca) * 1%);--clip:inset(-20px var(--clip-end) -20px var(--clip-start));position:absolute;left:var(--start-end);right:var(--start-end);top:calc(var(--ticks-gap) * var(--flip-y,0) + var(--thumb-size)/ 2 - var(--track-height)/ 2);height:calc(var(--track-height));background:var(--progress-background,#eee);pointer-events:none;z-index:-1;border-radius:var(--progress-radius)}.range-slider__progress::before{position:absolute;-webkit-clip-path:var(--clip);clip-path:var(--clip);background:var(--fill-color,#0366d6);box-shadow:var(--progress-flll-shadow);z-index:1}.range-slider__progress::after{position:absolute;box-shadow:var(--progress-shadow);pointer-events:none}.range-slider>input{-webkit-appearance:none;width:100%;height:var(--thumb-size);margin:0;position:absolute;left:0;top:calc(50% - Max(var(--track-height),var(--thumb-size))/ 2 + calc(var(--ticks-gap)/ 2 * var(--flip-y,-1)));cursor:-webkit-grab;cursor:grab;outline:0;background:0 0}.range-slider>input:not(:only-of-type){pointer-events:none}.range-slider>input::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;height:var(--thumb-size);width:var(--thumb-size);transform:var(--thumb-transform);border-radius:var(--thumb-radius,50%);background:var(--thumb-color,#fff);box-shadow:var(--thumb-shadow);border:none;pointer-events:auto;-webkit-transition:.1s;transition:.1s}.range-slider>input::-moz-range-thumb{-moz-appearance:none;appearance:none;height:var(--thumb-size);width:var(--thumb-size);transform:var(--thumb-transform);border-radius:var(--thumb-radius,50%);background:var(--thumb-color,#fff);box-shadow:var(--thumb-shadow);border:none;pointer-events:auto;-moz-transition:.1s;transition:.1s}.range-slider>input::-ms-thumb{appearance:none;height:var(--thumb-size);width:var(--thumb-size);transform:var(--thumb-transform);border-radius:var(--thumb-radius,50%);background:var(--thumb-color,#fff);box-shadow:var(--thumb-shadow);border:none;pointer-events:auto;-ms-transition:.1s;transition:.1s}.range-slider>input:hover{--thumb-shadow:var(--thumb-shadow-hover)}.range-slider>input:hover+output{--value-background:var(--value-background-hover, #0366d6);--y-offset:-5px;color:var(--value-active-color,#fff);box-shadow:0 0 0 3px var(--value-background)}.range-slider>input:active{--thumb-shadow:var(--thumb-shadow-active);cursor:-webkit-grabbing;cursor:grabbing;z-index:2}.range-slider>input:active+output{transition:none}.range-slider>input:first-of-type{--is-left-most:Clamp(0, (var(--value-a) - var(--value-b)) * 99999, 1)}.range-slider>input:first-of-type+output{--value:var(--value-a);--x-offset:calc(var(--completed-a) * -1%)}.range-slider>input:first-of-type+output:not(:only-of-type){--flip:calc(var(--thumbs-too-close) * -1)}.range-slider>input:first-of-type+output::after{content:var(--prefix, "") var(--text-value-a) var(--suffix, "")}.range-slider>input:nth-of-type(2){--is-left-most:Clamp(0, (var(--value-b) - var(--value-a)) * 99999, 1)}.range-slider>input:nth-of-type(2)+output{--value:var(--value-b)}.range-slider>input:only-of-type~.range-slider__progress{--clip-start:0}.range-slider>input+output{--flip:-1;--x-offset:calc(var(--completed-b) * -1%);--pos:calc(((var(--value) - var(--min)) / (var(--max) - var(--min))) * 100%);pointer-events:none;position:absolute;z-index:5;background:var(--value-background);border-radius:10px;padding:2px 4px;left:var(--pos);transform:translate(var(--x-offset),calc(150% * var(--flip) - (var(--y-offset,0px) + var(--value-offset-y)) * var(--flip)));transition:.12s ease-out,left}.range-slider>input+output::after{content:var(--prefix, "") var(--text-value-b) var(--suffix, "");font:var(--value-font)}body>.range-slider,label[dir=rtl] .range-slider{width:clamp(300px,50vw,800px);min-width:200px}.superhide{display:none}.lds-hourglass{display:inline-block;position:relative;width:80px;height:80px}.lds-hourglass:after{content:" ";display:block;border-radius:50%;width:0;height:0;margin:8px;box-sizing:border-box;border:32px solid #000;border-color:#000 transparent #fff;animation:1.2s infinite lds-hourglass}.dark .lds-hourglass:after{border:32px solid #fff;border-color:#fff transparent #000}@keyframes lds-hourglass{0%{transform:rotate(0);animation-timing-function:cubic-bezier(0.55,0.055,0.675,0.19)}50%{transform:rotate(900deg);animation-timing-function:cubic-bezier(0.215,0.61,0.355,1)}100%{transform:rotate(1800deg)}} \ No newline at end of file +.laravel-livewire-tables-highlight{border-style:solid!important;border-top-width:2px!important;border-bottom-width:2px!important;border-color:var(--rappasoft-table-highlight-color,rgb(255 255 255))!important}.laravel-livewire-tables-cursor{cursor:pointer}.laravel-livewire-tables-btn-tiny{width:.5em;height:.5em}.laravel-livewire-tables-btn-smaller{width:1em;height:1em}.laravel-livewire-tables-btn-small{width:1.2em;height:1.2em}.laravel-livewire-tables-btn-md{width:1.3em;height:1.3em}.laravel-livewire-tables-btn-lg{width:1.4em;height:1.4em}.laravel-livewire-tables-highlight-top{border-style:solid!important;border-top-width:2px!important;border-bottom-width:0!important;border-color:var(--rappasoft-table-top-highlight-color,var(--rappasoft-table-highlight-color,rgb(255 255 255)))!important}.laravel-livewire-tables-highlight-bottom{border-style:solid!important;border-top-width:0!important;border-bottom-width:2px!important;border-color:var(--rappasoft-table-bottom-highlight-color,var(--rappasoft-table-highlight-color,rgb(255 255 255)))!important}.laravel-livewire-tables-reorderingMinimised{width:0}.laravel-livewire-table-dragging{opacity:.5!important}.range-slider.grad{--progress-shadow:2px 2px 4px rgba(0, 0, 0, 0.2) inset;--progress-flll-shadow:var(--progress-shadow);--fill-color:linear-gradient(to right, LightCyan, var(--primary-color, #0366d6));--thumb-shadow:0 0 4px rgba(0, 0, 0, 0.3),-3px 9px 9px rgba(255, 241, 241, 0.33) inset,-1px 3px 2px rgba(255, 255, 255, 0.33) inset,0 0 0 99px var(--primary-color, #0366d6) inset}.range-slider.grad input:hover{--thumb-transform:scale(1.2)}.range-slider.grad input:active{--thumb-shadow:inherit;--thumb-transform:scale(1)}.range-slider.flat{--thumb-size:25px;--track-height:calc(var(--thumb-size) / 3);--progress-shadow:none;--progress-flll-shadow:none;--thumb-shadow:0 0 0 7px var(--primary-color, #0366d6) inset,0 0 0 99px white inset;--thumb-shadow-hover:0 0 0 9px var(--primary-color, #0366d6) inset,0 0 0 99px white inset;--thumb-shadow-active:0 0 0 13px var(--primary-color, #0366d6) inset}.range-slider{--value-offset-y:var(--ticks-gap);--value-background:transparent;--value-font:700 12px/1 Arial;--progress-radius:20px;--track-height:calc(var(--thumb-size) / 2);--min-max-opacity:1;--min-max-x-offset:10%;--thumb-size:22px;--thumb-shadow:0 0 3px rgba(0, 0, 0, 0.4),0 0 1px rgba(0, 0, 0, 0.5) inset,0 0 0 99px var(--thumb-color, white) inset;--thumb-shadow-active:0 0 0 calc(var(--thumb-size) / 4) inset var(--thumb-color, white),0 0 0 99px var(--primary-color, #0366d6) inset,0 0 3px rgba(0, 0, 0, 0.4);--thumb-shadow-hover:var(--thumb-shadow);--ticks-thickness:1px;--ticks-height:5px;--ticks-gap:var(--ticks-height, 0);--step:1;--ticks-count:Calc(var(--max) - var(--min))/var(--step);--maxTicksAllowed:30;--too-many-ticks:Min(1, Max(var(--ticks-count) - var(--maxTicksAllowed), 0));--x-step:Max(var(--step), var(--too-many-ticks) * (var(--max) - var(--min)));--tickInterval:100/((var(--max) - var(--min)) / var(--step)) * var(--tickEvery, 1);--tickIntervalPerc:calc((100% - var(--thumb-size)) / ((var(--max) - var(--min)) / var(--x-step)) * var(--tickEvery, 1));--value-a:Clamp(var(--min), var(--value, 0), var(--max));--value-b:var(--value, 0);--text-value-a:var(--text-value, "");--completed-a:calc((var(--value-a) - var(--min)) / (var(--max) - var(--min)) * 100);--completed-b:calc((var(--value-b) - var(--min)) / (var(--max) - var(--min)) * 100);--ca:Min(var(--completed-a), var(--completed-b));--cb:Max(var(--completed-a), var(--completed-b));--thumbs-too-close:Clamp(-1, 1000 * (Min(1, Max(var(--cb) - var(--ca) - 5, -1)) + 0.001), 1);--thumb-close-to-min:Min(1, Max(var(--ca) - 2, 0));--thumb-close-to-max:Min(1, Max(98 - var(--cb), 0));display:inline-block;height:max(var(--track-height),var(--thumb-size));background:linear-gradient(to right,var(--ticks-color,silver) var(--ticks-thickness),transparent 1px) repeat-x;background-size:var(--tickIntervalPerc) var(--ticks-height);background-position-x:calc(var(--thumb-size)/ 2 - var(--ticks-thickness)/ 2);background-position-y:var(--flip-y,bottom);padding-bottom:var(--flip-y,var(--ticks-gap));padding-top:calc(var(--flip-y) * var(--ticks-gap));position:relative;z-index:1}.range-slider::after,.range-slider::before{--offset:calc(var(--thumb-size) / 2);content:counter(x);display:var(--show-min-max,block);font:var(--min-max-font, 12px Arial);position:absolute;bottom:var(--flip-y,-2.5ch);top:calc(-2.5ch * var(--flip-y));opacity:clamp(0, var(--at-edge), var(--min-max-opacity));transform:translateX(calc(var(--min-max-x-offset) * var(--before,-1) * -1)) scale(var(--at-edge));pointer-events:none}.dark .range-slider::after,.dark .range-slider::before,.dark .range-slider>input+output::after,.dark .range-slider>input:first-of-type+output::after{color:#fff}.range-slider::before{--before:1;counter-reset:x var(--min);left:var(--offset)}.range-slider::after{counter-reset:x var(--max);right:var(--offset)}.range-slider__progress::after,.range-slider__progress::before{content:"";top:0;right:0;bottom:0;border-radius:inherit;left:0}.range-slider__values{position:relative;top:50%;line-height:0;text-align:justify;width:100%;pointer-events:none;margin:0 auto;z-index:5}.range-slider__values::after{content:"";width:100%;display:inline-block;height:0;background:red}.range-slider__progress{--start-end:calc(var(--thumb-size) / 2);--clip-end:calc(100% - (var(--cb)) * 1%);--clip-start:calc(var(--ca) * 1%);--clip:inset(-20px var(--clip-end) -20px var(--clip-start));position:absolute;left:var(--start-end);right:var(--start-end);top:calc(var(--ticks-gap) * var(--flip-y,0) + var(--thumb-size)/ 2 - var(--track-height)/ 2);height:calc(var(--track-height));background:var(--progress-background,#eee);pointer-events:none;z-index:-1;border-radius:var(--progress-radius)}.range-slider__progress::before{position:absolute;-webkit-clip-path:var(--clip);clip-path:var(--clip);background:var(--fill-color,#0366d6);box-shadow:var(--progress-flll-shadow);z-index:1}.range-slider__progress::after{position:absolute;box-shadow:var(--progress-shadow);pointer-events:none}.range-slider>input{-webkit-appearance:none;width:100%;height:var(--thumb-size);margin:0;position:absolute;left:0;top:calc(50% - Max(var(--track-height),var(--thumb-size))/ 2 + calc(var(--ticks-gap)/ 2 * var(--flip-y,-1)));cursor:-webkit-grab;cursor:grab;outline:0;background:0 0}.range-slider>input:not(:only-of-type){pointer-events:none}.range-slider>input::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;height:var(--thumb-size);width:var(--thumb-size);transform:var(--thumb-transform);border-radius:var(--thumb-radius,50%);background:var(--thumb-color,#fff);box-shadow:var(--thumb-shadow);border:none;pointer-events:auto;-webkit-transition:.1s;transition:.1s}.range-slider>input::-moz-range-thumb{-moz-appearance:none;appearance:none;height:var(--thumb-size);width:var(--thumb-size);transform:var(--thumb-transform);border-radius:var(--thumb-radius,50%);background:var(--thumb-color,#fff);box-shadow:var(--thumb-shadow);border:none;pointer-events:auto;-moz-transition:.1s;transition:.1s}.range-slider>input::-ms-thumb{appearance:none;height:var(--thumb-size);width:var(--thumb-size);transform:var(--thumb-transform);border-radius:var(--thumb-radius,50%);background:var(--thumb-color,#fff);box-shadow:var(--thumb-shadow);border:none;pointer-events:auto;-ms-transition:.1s;transition:.1s}.range-slider>input:hover{--thumb-shadow:var(--thumb-shadow-hover)}.range-slider>input:hover+output{--value-background:var(--value-background-hover, #0366d6);--y-offset:-5px;color:var(--value-active-color,#fff);box-shadow:0 0 0 3px var(--value-background)}.range-slider>input:active{--thumb-shadow:var(--thumb-shadow-active);cursor:-webkit-grabbing;cursor:grabbing;z-index:2}.range-slider>input:active+output{transition:none}.range-slider>input:first-of-type{--is-left-most:Clamp(0, (var(--value-a) - var(--value-b)) * 99999, 1)}.range-slider>input:first-of-type+output{--value:var(--value-a);--x-offset:calc(var(--completed-a) * -1%)}.range-slider>input:first-of-type+output:not(:only-of-type){--flip:calc(var(--thumbs-too-close) * -1)}.range-slider>input:first-of-type+output::after{content:var(--prefix, "") var(--text-value-a) var(--suffix, "")}.range-slider>input:nth-of-type(2){--is-left-most:Clamp(0, (var(--value-b) - var(--value-a)) * 99999, 1)}.range-slider>input:nth-of-type(2)+output{--value:var(--value-b)}.range-slider>input:only-of-type~.range-slider__progress{--clip-start:0}.range-slider>input+output{--flip:-1;--x-offset:calc(var(--completed-b) * -1%);--pos:calc(((var(--value) - var(--min)) / (var(--max) - var(--min))) * 100%);pointer-events:none;position:absolute;z-index:5;background:var(--value-background);border-radius:10px;padding:2px 4px;left:var(--pos);transform:translate(var(--x-offset),calc(150% * var(--flip) - (var(--y-offset,0px) + var(--value-offset-y)) * var(--flip)));transition:.12s ease-out,left}.range-slider>input+output::after{content:var(--prefix, "") var(--text-value-b) var(--suffix, "");font:var(--value-font)}body>.range-slider,label[dir=rtl] .range-slider{width:clamp(300px,50vw,800px);min-width:200px}.superhide{display:none}.lds-hourglass{display:inline-block;position:relative;width:80px;height:80px}.lds-hourglass:after{content:" ";display:block;border-radius:50%;width:0;height:0;margin:8px;box-sizing:border-box;border:32px solid #000;border-color:#fff transparent;animation:1.2s infinite lds-hourglass}.dark .lds-hourglass:after{border:32px solid #fff;border-color:#000 transparent}@keyframes lds-hourglass{0%{transform:rotate(0);animation-timing-function:cubic-bezier(0.55,0.055,0.675,0.19)}50%{transform:rotate(900deg);animation-timing-function:cubic-bezier(0.215,0.61,0.355,1)}100%{transform:rotate(1800deg)}} \ No newline at end of file diff --git a/resources/js/laravel-livewire-tables.js b/resources/js/laravel-livewire-tables.js index 532a615ea..9641f02ee 100644 --- a/resources/js/laravel-livewire-tables.js +++ b/resources/js/laravel-livewire-tables.js @@ -1,41 +1,297 @@ /*jshint esversion: 6 */ document.addEventListener('alpine:init', () => { - Alpine.data('tableWrapper', (wire, showBulkActionsAlpine) => ({ + + Alpine.data('laravellivewiretable', (wire) => ({ + tableId: '', + showBulkActionsAlpine: false, + primaryKeyName: '', + shouldBeDisplayed: wire.entangle('shouldBeDisplayed'), + tableName: wire.entangle('tableName'), + dataTableFingerprint: wire.entangle('dataTableFingerprint'), + listeners: [], childElementOpen: false, filtersOpen: wire.entangle('filterSlideDownDefaultVisible'), paginationCurrentCount: wire.entangle('paginationCurrentCount'), paginationTotalItemCount: wire.entangle('paginationTotalItemCount'), paginationCurrentItems: wire.entangle('paginationCurrentItems'), selectedItems: wire.entangle('selected'), - alwaysShowBulkActions: !wire.entangle('hideBulkActionsWhenEmpty'), + selectAllStatus: wire.entangle('selectAll'), + delaySelectAll: wire.entangle('delaySelectAll'), + hideBulkActionsWhenEmpty: wire.entangle('hideBulkActionsWhenEmpty'), + dragging: false, + reorderEnabled: false, + sourceID: '', + targetID: '', + evenRowClasses: '', + oddRowClasses: '', + currentlyHighlightedElement: '', + evenRowClassArray: {}, + oddRowClassArray: {}, + evenNotInOdd: {}, + oddNotInEven: {}, + orderedRows: [], + defaultReorderColumn: wire.entangle('defaultReorderColumn'), + reorderStatus: wire.entangle('reorderStatus'), + currentlyReorderingStatus: wire.entangle('currentlyReorderingStatus'), + hideReorderColumnUnlessReorderingStatus: wire.entangle('hideReorderColumnUnlessReorderingStatus'), + reorderDisplayColumn: wire.entangle('reorderDisplayColumn'), + externalFilterPillsVals: wire.entangle('externalFilterPillsValues'), + internalFilterPillsVals: wire.entangle('internalFilterPillsVals'), + showFilterPillLabel: [], + filterPillsSeparator: ', ', + showFilterPillsSection: true, + removeHTMLTags(htmlString) { + // Create a new DOMParser instance + const parser = new DOMParser(); + // Parse the HTML string + let doc = parser.parseFromString(htmlString, 'text/html'); + // Extract text content + let textContent = doc.body.innerText || ""; + // Trim whitespace + let trimmedContent = textContent.trim(); + + return trimmedContent; + }, + resetSpecificFilter(filterKey) + { + this.externalFilterPillsVals[filterKey] = []; + wire.call('resetFilter',filterKey); + }, + resetAllFilters() + { + this.externalFilterPillsVals = []; + wire.call('setFilterDefaults'); + }, + setInternalFilterPillVal(filterKey, filterValues) + { + + if(typeof(filterValues) !== 'undefined') + { + this.internalFilterPillsVals[filterKey] = filterValues; + } + }, + syncExternalFilterPillsValues(filterKey,filterValues) { + this.externalFilterPillsVals[filterKey] = filterValues; + this.showFilterPillLabel[filterKey] = this.getFilterPillsLength(filterKey); + }, + getFilterPillsLength(filterKey) + { + return Object.keys(this.externalFilterPillsVals[filterKey]).length ?? 0; + }, + showFilterPillsValue(filterKey, filterPillValue) + { + if(typeof(filterPillValue) !== "undefined") + { + this.externalFilterPillsVals[filterKey] = filterPillValue; + } + else + { + this.externalFilterPillsVals[filterKey] = null; + } + + }, + setFilterPillsLength(externalFilterPillsValues) + { + let filterValueLength = 0; + if (typeof(externalFilterPillsValues) !== 'undefined') + { + filterValueLength = Object.keys(externalFilterPillsValues).length ?? 0; + } + else + { + filterValueLength = 0; + } + return filterValueLength; + }, + showFilterPillsLabel(filterKey) + { + let pillsLength = this.getFilterPillsLength(filterKey); + return (this.getFilterPillsLength(filterKey) > 0); + }, + getFilterPillImplodedValues(filterKey, separator) + { + let filterPillValues = this.externalFilterPillsVals[filterKey]; + if(filterPillValues !== 'undefined') + { + let joinedValues = filterPillValues.join(separator); + + return joinedValues; + } + + return ''; + }, + showFilterPillsSeparator(filterKey,index) + { + return ((index+1) < (this.getFilterPillsLength(filterKey))); + }, + dragStart(event) { + this.$nextTick(() => { this.setupEvenOddClasses() }); + this.sourceID = event.target.id; + event.dataTransfer.effectAllowed = 'move'; + event.dataTransfer.setData('text/plain', event.target.id); + event.target.classList.add("laravel-livewire-tables-dragging"); + }, + dragOverEvent(event) { + if (typeof this.currentlyHighlightedElement == 'object') { + this.currentlyHighlightedElement.classList.remove('laravel-livewire-tables-highlight-bottom', 'laravel-livewire-tables-highlight-top'); + } + let target = event.target.closest('tr'); + this.currentlyHighlightedElement = target; + + if (event.offsetY < (target.getBoundingClientRect().height / 2)) { + target.classList.add('laravel-livewire-tables-highlight-top'); + target.classList.remove('laravel-livewire-tables-highlight-bottom'); + } + else { + target.classList.remove('laravel-livewire-tables-highlight-top'); + target.classList.add('laravel-livewire-tables-highlight-bottom'); + } + }, + dragLeaveEvent(event) { + event.target.closest('tr').classList.remove('laravel-livewire-tables-highlight-bottom', 'laravel-livewire-tables-highlight-top'); + }, + dropEvent(event) { + if (typeof this.currentlyHighlightedElement == 'object') { + this.currentlyHighlightedElement.classList.remove('laravel-livewire-tables-highlight-bottom', 'laravel-livewire-tables-highlight-top'); + } + + let target = event.target.closest('tr'); + let parent = event.target.closest('tr').parentNode; + let element = document.getElementById(this.sourceID).closest('tr'); + element.classList.remove("laravel-livewire-table-dragging"); + let originalPosition = element.rowIndex; + let newPosition = target.rowIndex; + let table = document.getElementById(this.tableId); + let loopStart = originalPosition; + if (event.offsetY > (target.getBoundingClientRect().height / 2)) { + parent.insertBefore(element, target.nextSibling); + } + else { + parent.insertBefore(element, target); + } + if (newPosition < originalPosition) { + loopStart = newPosition; + } + + /* + let evenList = parentNode.querySelectorAll("table[tableType='rappasoft-laravel-livewire-tables']>tbody>tr:nth-child(even of tr.rappasoft-striped-row) ").forEach(function (elem) { + elem.classList.remove(...this.oddNotInEven); + row.classList.add(...this.evenNotInOdd); + }); + */ + let nextLoop = 'even'; + for (let i = 1, row; row = table.rows[i]; i++) { + if (!row.classList.contains('hidden') && !row.classList.contains('md:hidden') ) { + if (nextLoop === 'even') { + row.classList.remove(...this.oddNotInEven); + row.classList.add(...this.evenNotInOdd); + nextLoop = 'odd'; + } + else { + row.classList.remove(...this.evenNotInOdd); + row.classList.add(...this.oddNotInEven); + nextLoop = 'even'; + } + } + } + }, + reorderToggle() { + if (this.currentlyReorderingStatus) { + wire.disableReordering(); + } + else { + if (this.hideReorderColumnUnlessReorderingStatus) { + this.reorderDisplayColumn = true; + } + this.setupEvenOddClasses(); + wire.enableReordering(); + } + this.$nextTick(() => { this.setupEvenOddClasses() }); + }, + cancelReorder() { + if (this.hideReorderColumnUnlessReorderingStatus) { + this.reorderDisplayColumn = false; + } + + wire.disableReordering(); + + }, + updateOrderedItems() { + let table = document.getElementById(this.tableId); + let orderedRows = []; + for (let i = 1, row; row = table.rows[i]; i++) { + orderedRows.push({ [this.primaryKeyName]: row.getAttribute('rowpk'), [this.defaultReorderColumn]: i }); + } + wire.storeReorder(orderedRows); + }, + setupEvenOddClasses() { + if (this.evenNotInOdd.length === undefined || this.evenNotInOdd.length == 0 || this.oddNotInEven.length === undefined || this.oddNotInEven.length == 0) + { + let tbody = document.getElementById(this.tableId).getElementsByTagName('tbody')[0]; + let evenRowClassArray = []; + let oddRowClassArray = []; + + if (tbody.rows[0] !== undefined && tbody.rows[1] !== undefined) { + evenRowClassArray = Array.from(tbody.rows[0].classList); + oddRowClassArray = Array.from(tbody.rows[1].classList); + this.evenNotInOdd = evenRowClassArray.filter(element => !oddRowClassArray.includes(element)); + this.oddNotInEven = oddRowClassArray.filter(element => !evenRowClassArray.includes(element)); + + evenRowClassArray = [] + oddRowClassArray = [] + } + } + }, toggleSelectAll() { - if (!showBulkActionsAlpine) { + if (!this.showBulkActionsAlpine) { return; } if (this.paginationTotalItemCount === this.selectedItems.length) { this.clearSelected(); + this.selectAllStatus = false; } else { - this.setAllSelected(); + if (this.delaySelectAll) + { + this.setAllItemsSelected(); + } + else + { + this.setAllSelected(); + } } }, + setAllItemsSelected() { + if (!this.showBulkActionsAlpine) { + return; + } + this.selectAllStatus = true; + this.selectAllOnPage(); + }, setAllSelected() { - if (!showBulkActionsAlpine) { + if (!this.showBulkActionsAlpine) { return; } - - wire.setAllSelected(); + if (this.delaySelectAll) + { + this.selectAllStatus = true; + this.selectAllOnPage(); + } + else + { + wire.setAllSelected(); + } }, clearSelected() { - if (!showBulkActionsAlpine) { + if (!this.showBulkActionsAlpine) { return; } - + this.selectAllStatus = false; wire.clearSelected(); }, selectAllOnPage() { - if (!showBulkActionsAlpine) { + if (!this.showBulkActionsAlpine) { return; } @@ -45,8 +301,157 @@ document.addEventListener('alpine:init', () => { tempSelectedItems.push(value.toString()); } this.selectedItems = [...new Set(tempSelectedItems)]; + }, + setTableId(tableId) + { + this.tableId = tableId; + }, + setAlpineBulkActions(showBulkActionsAlpine) + { + this.showBulkActionsAlpine = showBulkActionsAlpine; + }, + setPrimaryKeyName(primaryKeyName) + { + this.primaryKeyName = primaryKeyName; + }, + showTable(event) + { + let eventTableName = event.detail.tableName ?? ''; + let eventTableFingerprint = event.detail.tableFingerpint ?? ''; + + if (((eventTableName ?? '') != '' && eventTableName === this.tableName) || (eventTableFingerprint != '' && eventTableFingerpint === this.dataTableFingerprint)) { + this.shouldBeDisplayed = true; + } + }, + hideTable(event) + { + let eventTableName = event.detail.tableName ?? ''; + let eventTableFingerprint = event.detail.tableFingerpint ?? ''; + + if ((eventTableName != '' && eventTableName === this.tableName) || (eventTableFingerprint != '' && eventTableFingerpint === this.dataTableFingerprint)) { + this.shouldBeDisplayed = false; + } + }, + destroy() { + this.listeners.forEach((listener) => { + listener(); + }); + }, + })); + + Alpine.data('booleanFilter', (wire,filterKey,tableName,defaultValue) => ({ + localListeners: [], + switchOn: false, + value: wire.entangle('filterComponents.'+filterKey).live, + init() { + this.switchOn = false; + if (typeof this.value !== 'undefined') { + this.switchOn = Boolean(Number(this.value)); + } + this.localListeners.push( + Livewire.on('filter-was-set', (detail) => { + if(detail.tableName == this.tableName && detail.filterKey == filterKey) { + this.switchOn = detail.value ?? defaultValue; + } + }) + ); + }, + destroy() { + this.localListeners.forEach((listener) => { + listener(); + }); + }, + })); + + Alpine.data('newBooleanFilter', (filterKey,tableName,defaultValue) => ({ + booleanFilterKey: filterKey, + switchOn: false, + value: false, + toggleStatus() + { + let tempValue = Boolean(Number(this.$wire.get('filterComponents.'+this.booleanFilterKey) ?? this.value)); + let newBoolean = !tempValue; + this.switchOn = this.value = newBoolean; + return Number(newBoolean); + }, + toggleStatusWithUpdate() + { + let newValue = this.toggleStatus(); + this.$wire.set('filterComponents.'+this.booleanFilterKey, newValue); + }, + toggleStatusWithReset() + { + let newValue = this.toggleStatus(); + this.$wire.call('resetFilter',this.booleanFilterKey); + }, + setSwitchOn(val) + { + let number = Number(val ?? 0); + this.switchOn = Boolean(number); + }, + init() { + + this.$nextTick(() => { + this.value = this.$wire.get('filterComponents.'+this.booleanFilterKey) ?? defaultValue; + this.setSwitchOn(this.value ?? 0); + }); + + this.listeners.push( + Livewire.on('filter-was-set', (detail) => { + if(detail.tableName == this.tableName && detail.filterKey == this.booleanFilterKey) { + this.switchOn = detail.value ?? defaultValue; + } + }) + ); + } + })); + + Alpine.data('booleanFilterLatest', (data) => ({ + booleanFilterKey: data.filterKey, + booleanFilterDefaultValue: data.defaultValue, + switchOn: false, + value: false, + toggleStatus() + { + let tempValue = Boolean(Number(this.$wire.get('filterComponents.'+this.booleanFilterKey) ?? this.value)); + let newBoolean = !tempValue; + this.switchOn = this.value = newBoolean; + return Number(newBoolean); + }, + toggleStatusWithUpdate() + { + let newValue = this.toggleStatus(); + this.$wire.set('filterComponents.'+this.booleanFilterKey, newValue); + }, + toggleStatusWithReset() + { + let newValue = this.toggleStatus(); + this.$wire.call('resetFilter',this.booleanFilterKey); + }, + setSwitchOn(val) + { + let number = Number(val ?? 0); + this.switchOn = Boolean(number); + }, + init() { + + this.$nextTick(() => { + this.value = this.$wire.get('filterComponents.'+this.booleanFilterKey) ?? this.booleanFilterDefaultValue; + this.setSwitchOn(this.value ?? 0); + }); + + this.listeners.push( + Livewire.on('filter-was-set', (detail) => { + if(detail.tableName == this.tableName && detail.filterKey == this.booleanFilterKey) { + this.switchOn = detail.value ?? this.booleanFilterDefaultValue; + } + }) + ); } })); + + + Alpine.data('numberRangeFilter', (wire, filterKey, parentElementPath, filterConfig, childElementRoot) => ({ allFilters: wire.entangle('filterComponents', false), originalMin: 0, @@ -60,14 +465,20 @@ document.addEventListener('alpine:init', () => { defaultMin: filterConfig['minRange'], defaultMax: filterConfig['maxRange'], restrictUpdates: false, - updateStyles() { + initialiseStyles() + { + let numRangeFilterContainer = document.getElementById(parentElementPath); + numRangeFilterContainer.style.setProperty('--value-a', this.wireValues['min'] ?? this.filterMin); + numRangeFilterContainer.style.setProperty('--text-value-a', JSON.stringify(this.wireValues['min'] ?? this.filterMin)); + numRangeFilterContainer.style.setProperty('--value-b', this.wireValues['max'] ?? this.filterMax); + numRangeFilterContainer.style.setProperty('--text-value-b', JSON.stringify(this.wireValues['max'] ?? this.filterMax)); + }, + updateStyles(filterMin, filterMax) { let numRangeFilterContainer = document.getElementById(parentElementPath); - let currentFilterMin = document.getElementById(childElementRoot + "-min"); - let currentFilterMax = document.getElementById(childElementRoot + "-max"); - numRangeFilterContainer.style.setProperty('--value-a', currentFilterMin.value); - numRangeFilterContainer.style.setProperty('--text-value-a', JSON.stringify(currentFilterMin.value)); - numRangeFilterContainer.style.setProperty('--value-b', currentFilterMax.value); - numRangeFilterContainer.style.setProperty('--text-value-b', JSON.stringify(currentFilterMax.value)); + numRangeFilterContainer.style.setProperty('--value-a', filterMin); + numRangeFilterContainer.style.setProperty('--text-value-a', JSON.stringify(filterMin)); + numRangeFilterContainer.style.setProperty('--value-b', filterMax); + numRangeFilterContainer.style.setProperty('--text-value-b', JSON.stringify(filterMax)); }, setupWire() { if (this.wireValues !== undefined) { @@ -77,7 +488,7 @@ document.addEventListener('alpine:init', () => { this.filterMin = this.originalMin = this.defaultMin; this.filterMax = this.originalMax = this.defaultMax; } - this.updateStyles(); + this.updateStyles(this.filterMin, this.filterMax); }, allowUpdates() { this.updateWire(); @@ -95,7 +506,7 @@ document.addEventListener('alpine:init', () => { this.originalMin = tmpFilterMin; this.originalMax = tmpFilterMax; } - this.updateStyles(); + this.updateStyles(this.filterMin,this.filterMax); }, updateWireable() { if (this.hasUpdate) { @@ -103,9 +514,9 @@ document.addEventListener('alpine:init', () => { this.wireValues = { 'min': this.filterMin, 'max': this.filterMax }; wire.set('filterComponents.' + filterKey, this.wireValues); } - }, init() { + this.initialiseStyles(); this.setupWire(); this.$watch('allFilters', value => this.setupWire()); }, @@ -115,32 +526,47 @@ document.addEventListener('alpine:init', () => { wireValues: wire.entangle('filterComponents.' + filterKey), flatpickrInstance: flatpickr(refLocation, { mode: 'range', + altFormat: filterConfig['altFormat'] ?? "F j, Y", + altInput: filterConfig['altInput'] ?? false, + allowInput: filterConfig['allowInput'] ?? false, + allowInvalidPreload: filterConfig['allowInvalidPreload'] ?? true, + ariaDateFormat: filterConfig['ariaDateFormat'] ?? "F j, Y", clickOpens: true, - allowInvalidPreload: true, - defaultDate: [], - ariaDateFormat: filterConfig['ariaDateFormat'], - allowInput: filterConfig['allowInput'], - altFormat: filterConfig['altFormat'], - altInput: filterConfig['altInput'], - dateFormat: filterConfig['dateFormat'], - locale: 'en', - minDate: filterConfig['earliestDate'], - maxDate: filterConfig['latestDate'], + dateFormat: filterConfig['dateFormat'] ?? "Y-m-d", + defaultDate: filterConfig['defaultDate'] ?? null, + defaultHour: filterConfig['defaultHour'] ?? 12, + defaultMinute: filterConfig['defaultMinute'] ?? 0, + enableTime: filterConfig['enableTime'] ?? false, + enableSeconds: filterConfig['enableSeconds'] ?? false, + hourIncrement: filterConfig['hourIncrement'] ?? 1, + locale: filterConfig['locale'] ?? 'en', + minDate: filterConfig['earliestDate'] ?? null, + maxDate: filterConfig['latestDate'] ?? null, + minuteIncrement: filterConfig['minuteIncrement'] ?? 5, + shorthandCurrentMonth: filterConfig['shorthandCurrentMonth'] ?? false, + time_24hr: filterConfig['time_24hr'] ?? false, + weekNumbers: filterConfig['weekNumbers'] ?? false, onOpen: function () { window.childElementOpen = true; }, onChange: function (selectedDates, dateStr, instance) { if (selectedDates.length > 1) { - var startDate = dateStr.split(' ')[0]; - var endDate = dateStr.split(' ')[2]; + var dates = dateStr.split(' '); var wireDateArray = {}; window.childElementOpen = false; window.filterPopoverOpen = false; - wireDateArray = { 'minDate': startDate, 'maxDate': endDate }; + wireDateArray = { 'minDate': dates[0], 'maxDate': (typeof dates[2] === "undefined") ? dates[0] : dates[2] }; wire.set('filterComponents.' + filterKey, wireDateArray); } - } + }, }), + changedValue: function(value) { + if (value.length < 5) + { + this.flatpickrInstance.setDate([]); + wire.set('filterComponents.' + filterKey, {}); + } + }, setupWire() { if (this.wireValues !== undefined) { if (this.wireValues.minDate !== undefined && this.wireValues.maxDate !== undefined) { @@ -162,6 +588,85 @@ document.addEventListener('alpine:init', () => { })); + + Alpine.data('tableWrapper', (wire, showBulkActionsAlpine) => ({ + shouldBeDisplayed: wire.entangle('shouldBeDisplayed'), + listeners: [], + childElementOpen: false, + filtersOpen: wire.entangle('filterSlideDownDefaultVisible'), + paginationCurrentCount: wire.entangle('paginationCurrentCount'), + paginationTotalItemCount: wire.entangle('paginationTotalItemCount'), + paginationCurrentItems: wire.entangle('paginationCurrentItems'), + selectedItems: wire.entangle('selected'), + selectAllStatus: wire.entangle('selectAll'), + delaySelectAll: wire.entangle('delaySelectAll'), + hideBulkActionsWhenEmpty: wire.entangle('hideBulkActionsWhenEmpty'), + toggleSelectAll() { + if (!showBulkActionsAlpine) { + return; + } + + if (this.paginationTotalItemCount === this.selectedItems.length) { + this.clearSelected(); + this.selectAllStatus = false; + } else { + if (this.delaySelectAll) + { + this.setAllItemsSelected(); + } + else + { + this.setAllSelected(); + } + } + }, + setAllItemsSelected() { + if (!showBulkActionsAlpine) { + return; + } + this.selectAllStatus = true; + this.selectAllOnPage(); + }, + setAllSelected() { + if (!showBulkActionsAlpine) { + return; + } + if (this.delaySelectAll) + { + this.selectAllStatus = true; + this.selectAllOnPage(); + } + else + { + wire.setAllSelected(); + } + }, + clearSelected() { + if (!showBulkActionsAlpine) { + return; + } + this.selectAllStatus = false; + wire.clearSelected(); + }, + selectAllOnPage() { + if (!showBulkActionsAlpine) { + return; + } + + let tempSelectedItems = this.selectedItems; + const iterator = this.paginationCurrentItems.values(); + for (const value of iterator) { + tempSelectedItems.push(value.toString()); + } + this.selectedItems = [...new Set(tempSelectedItems)]; + }, + destroy() { + this.listeners.forEach((listener) => { + listener(); + }); + } + })); + Alpine.data('reorderFunction', (wire, tableID, primaryKeyName) => ({ dragging: false, reorderEnabled: false, @@ -181,6 +686,7 @@ document.addEventListener('alpine:init', () => { hideReorderColumnUnlessReorderingStatus: wire.entangle('hideReorderColumnUnlessReorderingStatus'), reorderDisplayColumn: wire.entangle('reorderDisplayColumn'), dragStart(event) { + this.$nextTick(() => { this.setupEvenOddClasses() }); this.sourceID = event.target.id; event.dataTransfer.effectAllowed = 'move'; event.dataTransfer.setData('text/plain', event.target.id); @@ -227,13 +733,6 @@ document.addEventListener('alpine:init', () => { if (newPosition < originalPosition) { loopStart = newPosition; } - - /* - let evenList = parentNode.querySelectorAll("table[tableType='rappasoft-laravel-livewire-tables']>tbody>tr:nth-child(even of tr.rappasoft-striped-row) ").forEach(function (elem) { - elem.classList.remove(...this.oddNotInEven); - row.classList.add(...this.evenNotInOdd); - }); - */ let nextLoop = 'even'; for (let i = 1, row; row = table.rows[i]; i++) { if (!row.classList.contains('hidden') && !row.classList.contains('md:hidden') ) { @@ -251,11 +750,13 @@ document.addEventListener('alpine:init', () => { } }, reorderToggle() { + this.$nextTick(() => { this.setupEvenOddClasses() }); if (this.currentlyReorderingStatus) { wire.disableReordering(); } else { + this.setupEvenOddClasses(); if (this.hideReorderColumnUnlessReorderingStatus) { this.reorderDisplayColumn = true; } @@ -279,8 +780,8 @@ document.addEventListener('alpine:init', () => { wire.storeReorder(orderedRows); }, setupEvenOddClasses() { - if (this.currentlyReorderingStatus === true) { - + if (this.evenNotInOdd.length === undefined || this.evenNotInOdd.length == 0 || this.oddNotInEven.length === undefined || this.oddNotInEven.length == 0) + { let tbody = document.getElementById(tableID).getElementsByTagName('tbody')[0]; let evenRowClassArray = []; let oddRowClassArray = []; @@ -290,15 +791,185 @@ document.addEventListener('alpine:init', () => { oddRowClassArray = Array.from(tbody.rows[1].classList); this.evenNotInOdd = evenRowClassArray.filter(element => !oddRowClassArray.includes(element)); this.oddNotInEven = oddRowClassArray.filter(element => !evenRowClassArray.includes(element)); + evenRowClassArray = [] oddRowClassArray = [] } } }, init() { - this.$watch('currentlyReorderingStatus', value => this.setupEvenOddClasses()); - } })); - + + Alpine.data('filterPillsHandler', (data) => ({ + localData: data, + localFilterKey: '', + localFilterTitle: '', + isExternalFilter: false, + shouldRenderAsHTML: false, + shouldWatchPillValues: false, + pillsSeparator: ',', + pillValues: null, + pillHasValues: false, + displayString: '', + generateLocalFilterPillImplodedValues(filterPillValues) + { + if(typeof(filterPillValues) !== 'undefined') + { + var temporarySeparatorString = '---tablepillsseparator---'; + var regex = new RegExp(temporarySeparatorString, 'g'); + var joinedValues; + + if(Array.isArray(filterPillValues)) + { + joinedValues = filterPillValues.join(temporarySeparatorString); + } + else + { + joinedValues = filterPillValues; + } + + if(!this.shouldRenderAsHTML) + { + joinedValues = this.removeHTMLTags(joinedValues); + } + + if (joinedValues !== null) + { + let replacedJoinedValues = joinedValues.replace(regex, this.pillsSeparator); + return replacedJoinedValues; + + } + return ""; + } + return ""; + }, + clearExternalFilterPill() + { + if(this.isExternalFilter) + { + this.externalFilterPillsVals[this.localFilterKey] = []; + this.displayString = this.generateLocalFilterPillImplodedValues(this.externalFilterPillsVals[this.localFilterKey]); + this.updatePillHasValues(); + this.resetSpecificFilter(this.localFilterKey); + } + }, + trigger: { + ['@filterpillupdate.window'](event) { + this.watchForUpdateEvent(event); + }, + }, + checkEventIsValid(eventTableName, eventFilterKey) + { + return ((this.tableName === eventTableName) && (this.localFilterKey === eventFilterKey)); + }, + watchForUpdateEvent(event) + { + if(this.checkEventIsValid(event.detail.tableName ?? '', event.detail.filterKey ?? '')) + { + let eventPillItem = event.detail.pillItem ?? ''; + if(!this.shouldRenderAsHTML) + { + eventPillItem = this.removeHTMLTags(eventPillItem); + } + + if(eventPillItem != "") + { + if(this.isExternalFilter) + { + let filterPillValues = this.externalFilterPillsVals[this.localFilterKey]; + + filterPillValues.push(eventPillItem); + this.updatePillValues(filterPillValues); + } + else + { + this.updatePillValues(eventPillItem); + } + } + } + }, + updatePillValues(filterPillValues) + { + this.pillValues = filterPillValues; + this.displayString = this.generateLocalFilterPillImplodedValues(filterPillValues); + this.updatePillHasValues(); + + return this.displayString; + }, + updatePillHasValues() + { + this.pillHasValues = (this.displayString.length > 0); + }, + init() + { + this.localFilterKey = this.localData['filterKey'] ?? 'unknown'; + this.localFilterTitle = this.localData['filterPillTitle'] ?? 'Unknown'; + this.pillsSeparator = this.localData['separator'] ?? ','; + this.shouldWatchPillValues = Boolean(this.localData['watchForEvents'] ?? 0); + this.isExternalFilter = Boolean(this.localData['isAnExternalLivewireFilter'] ?? 0); + this.shouldRenderAsHTML = Boolean(this.localData['renderPillsAsHtml'] ?? 0); + this.pillValues = this.localData['pillValues'] ?? null; + + this.$nextTick(() => { + if(this.isExternalFilter) + { + this.updatePillValues(this.externalFilterPillsVals[this.localFilterKey]); + } + else + { + this.updatePillValues(this.pillValues); + } + }); + if(this.isExternalFilter && this.shouldWatchPillValues) + { + this.$watch('externalFilterPillsVals.'+this.localFilterKey, filterPillValues => { + this.updatePillValues(filterPillValues); + }); + } + } + })); + + + Alpine.data('tablesExternalFilter', (wire, filterKey) => ({ + externalFilterKey: filterKey, + pillValues: [], + optionsAvailable: wire.entangle('optionsAvailable'), + optionsSelected: wire.entangle('optionsSelected').live, + selectedItems: wire.entangle('selectedItems'), + sendValueToPill(value) + { + let sentValue = this.removeHTMLTags(value); + this.$dispatch('filterpillupdate', { tableName: this.tableName, filterKey: this.externalFilterKey, pillItem: sentValue }); + }, + overridePill(values) + { + let sentValue = this.removeHTMLTags(values); + this.$dispatch('filterpillupdate', { tableName: this.tableName, filterKey: this.externalFilterKey, pillItem: sentValue }); + }, + syncItems(items) { + this.pillValues = []; + items.forEach((item) => { + this.pillValues.push(this.optionsAvailable[item]); + }); + if(this.pillValues.length > 0) + { + this.pillValues.sort(); + this.syncExternalFilterPillsValues(this.externalFilterKey,this.pillValues); + } + this.optionsSelected = this.selectedItems; + wire.set('value', this.selectedItems); + + }, + init() { + this.selectedItems = this.optionsSelected; + this.syncItems(this.selectedItems); + this.$watch('selectedItems', value => this.syncItems(value)); + } + + + })); + + + }); \ No newline at end of file diff --git a/resources/js/laravel-livewire-tables.min.js b/resources/js/laravel-livewire-tables.min.js index 6d78ed178..5e0980c39 100644 --- a/resources/js/laravel-livewire-tables.min.js +++ b/resources/js/laravel-livewire-tables.min.js @@ -1 +1 @@ -document.addEventListener("alpine:init",()=>{Alpine.data("tableWrapper",(e,t)=>({childElementOpen:!1,filtersOpen:e.entangle("filterSlideDownDefaultVisible"),paginationCurrentCount:e.entangle("paginationCurrentCount"),paginationTotalItemCount:e.entangle("paginationTotalItemCount"),paginationCurrentItems:e.entangle("paginationCurrentItems"),selectedItems:e.entangle("selected"),alwaysShowBulkActions:!e.entangle("hideBulkActionsWhenEmpty"),toggleSelectAll(){t&&(this.paginationTotalItemCount===this.selectedItems.length?this.clearSelected():this.setAllSelected())},setAllSelected(){t&&e.setAllSelected()},clearSelected(){t&&e.clearSelected()},selectAllOnPage(){if(!t)return;let e=this.selectedItems,i=this.paginationCurrentItems.values();for(let l of i)e.push(l.toString());this.selectedItems=[...new Set(e)]}})),Alpine.data("numberRangeFilter",(e,t,i,l,a)=>({allFilters:e.entangle("filterComponents",!1),originalMin:0,originalMax:100,filterMin:0,filterMax:100,currentMin:0,currentMax:100,hasUpdate:!1,wireValues:e.entangle("filterComponents."+t,!1),defaultMin:l.minRange,defaultMax:l.maxRange,restrictUpdates:!1,updateStyles(){let e=document.getElementById(i),t=document.getElementById(a+"-min"),l=document.getElementById(a+"-max");e.style.setProperty("--value-a",t.value),e.style.setProperty("--text-value-a",JSON.stringify(t.value)),e.style.setProperty("--value-b",l.value),e.style.setProperty("--text-value-b",JSON.stringify(l.value))},setupWire(){void 0!==this.wireValues?(this.filterMin=this.originalMin=void 0!==this.wireValues.min?this.wireValues.min:this.defaultMin,this.filterMax=this.originalMax=void 0!==this.wireValues.max?this.wireValues.max:this.defaultMax):(this.filterMin=this.originalMin=this.defaultMin,this.filterMax=this.originalMax=this.defaultMax),this.updateStyles()},allowUpdates(){this.updateWire()},updateWire(){let e=parseInt(this.filterMin),t=parseInt(this.filterMax);(e!=this.originalMin||t!=this.originalMax)&&(tthis.setupWire())}})),Alpine.data("flatpickrFilter",(e,t,i,l,a)=>({wireValues:e.entangle("filterComponents."+t),flatpickrInstance:flatpickr(l,{mode:"range",clickOpens:!0,allowInvalidPreload:!0,defaultDate:[],ariaDateFormat:i.ariaDateFormat,allowInput:i.allowInput,altFormat:i.altFormat,altInput:i.altInput,dateFormat:i.dateFormat,locale:"en",minDate:i.earliestDate,maxDate:i.latestDate,onOpen:function(){window.childElementOpen=!0},onChange:function(i,l,a){if(i.length>1){var s=l.split(" ")[0],r=l.split(" ")[2],n={};window.childElementOpen=!1,window.filterPopoverOpen=!1,n={minDate:s,maxDate:r},e.set("filterComponents."+t,n)}}}),setupWire(){if(void 0!==this.wireValues){if(void 0!==this.wireValues.minDate&&void 0!==this.wireValues.maxDate){let e=[this.wireValues.minDate,this.wireValues.maxDate];this.flatpickrInstance.setDate(e)}else this.flatpickrInstance.setDate([])}else this.flatpickrInstance.setDate([])},init(){this.setupWire(),this.$watch("wireValues",e=>this.setupWire())}})),Alpine.data("reorderFunction",(e,t,i)=>({dragging:!1,reorderEnabled:!1,sourceID:"",targetID:"",evenRowClasses:"",oddRowClasses:"",currentlyHighlightedElement:"",evenRowClassArray:{},oddRowClassArray:{},evenNotInOdd:{},oddNotInEven:{},orderedRows:[],defaultReorderColumn:e.get("defaultReorderColumn"),reorderStatus:e.get("reorderStatus"),currentlyReorderingStatus:e.entangle("currentlyReorderingStatus"),hideReorderColumnUnlessReorderingStatus:e.entangle("hideReorderColumnUnlessReorderingStatus"),reorderDisplayColumn:e.entangle("reorderDisplayColumn"),dragStart(e){this.sourceID=e.target.id,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id),e.target.classList.add("laravel-livewire-tables-dragging")},dragOverEvent(e){"object"==typeof this.currentlyHighlightedElement&&this.currentlyHighlightedElement.classList.remove("laravel-livewire-tables-highlight-bottom","laravel-livewire-tables-highlight-top");let t=e.target.closest("tr");this.currentlyHighlightedElement=t,e.offsetYi.getBoundingClientRect().height/2?l.insertBefore(a,i.nextSibling):l.insertBefore(a,i),r!l.includes(e)),this.oddNotInEven=l.filter(e=>!i.includes(e)),i=[],l=[])}},init(){this.$watch("currentlyReorderingStatus",e=>this.setupEvenOddClasses())}}))}); \ No newline at end of file +document.addEventListener("alpine:init",()=>{Alpine.data("laravellivewiretable",e=>({tableId:"",showBulkActionsAlpine:!1,primaryKeyName:"",shouldBeDisplayed:e.entangle("shouldBeDisplayed"),tableName:e.entangle("tableName"),dataTableFingerprint:e.entangle("dataTableFingerprint"),listeners:[],childElementOpen:!1,filtersOpen:e.entangle("filterSlideDownDefaultVisible"),paginationCurrentCount:e.entangle("paginationCurrentCount"),paginationTotalItemCount:e.entangle("paginationTotalItemCount"),paginationCurrentItems:e.entangle("paginationCurrentItems"),selectedItems:e.entangle("selected"),selectAllStatus:e.entangle("selectAll"),delaySelectAll:e.entangle("delaySelectAll"),hideBulkActionsWhenEmpty:e.entangle("hideBulkActionsWhenEmpty"),dragging:!1,reorderEnabled:!1,sourceID:"",targetID:"",evenRowClasses:"",oddRowClasses:"",currentlyHighlightedElement:"",evenRowClassArray:{},oddRowClassArray:{},evenNotInOdd:{},oddNotInEven:{},orderedRows:[],defaultReorderColumn:e.entangle("defaultReorderColumn"),reorderStatus:e.entangle("reorderStatus"),currentlyReorderingStatus:e.entangle("currentlyReorderingStatus"),hideReorderColumnUnlessReorderingStatus:e.entangle("hideReorderColumnUnlessReorderingStatus"),reorderDisplayColumn:e.entangle("reorderDisplayColumn"),externalFilterPillsVals:e.entangle("externalFilterPillsValues"),internalFilterPillsVals:e.entangle("internalFilterPillsVals"),showFilterPillLabel:[],filterPillsSeparator:", ",showFilterPillsSection:!0,removeHTMLTags(e){let t=new DOMParser;return(t.parseFromString(e,"text/html").body.innerText||"").trim()},resetSpecificFilter(t){this.externalFilterPillsVals[t]=[],e.call("resetFilter",t)},resetAllFilters(){this.externalFilterPillsVals=[],e.call("setFilterDefaults")},setInternalFilterPillVal(e,t){void 0!==t&&(this.internalFilterPillsVals[e]=t)},syncExternalFilterPillsValues(e,t){this.externalFilterPillsVals[e]=t,this.showFilterPillLabel[e]=this.getFilterPillsLength(e)},getFilterPillsLength(e){return Object.keys(this.externalFilterPillsVals[e]).length??0},showFilterPillsValue(e,t){void 0!==t?this.externalFilterPillsVals[e]=t:this.externalFilterPillsVals[e]=null},setFilterPillsLength(e){let t=0;return void 0!==e?Object.keys(e).length??0:0},showFilterPillsLabel(e){return this.getFilterPillsLength(e),this.getFilterPillsLength(e)>0},getFilterPillImplodedValues(e,t){let l=this.externalFilterPillsVals[e];return"undefined"!==l?l.join(t):""},showFilterPillsSeparator(e,t){return t+1{this.setupEvenOddClasses()}),this.sourceID=e.target.id,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id),e.target.classList.add("laravel-livewire-tables-dragging")},dragOverEvent(e){"object"==typeof this.currentlyHighlightedElement&&this.currentlyHighlightedElement.classList.remove("laravel-livewire-tables-highlight-bottom","laravel-livewire-tables-highlight-top");let t=e.target.closest("tr");this.currentlyHighlightedElement=t,e.offsetYt.getBoundingClientRect().height/2?l.insertBefore(i,t.nextSibling):l.insertBefore(i,t),a{this.setupEvenOddClasses()})},cancelReorder(){this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!1),e.disableReordering()},updateOrderedItems(){let t=document.getElementById(this.tableId),l=[];for(let i=1,s;s=t.rows[i];i++)l.push({[this.primaryKeyName]:s.getAttribute("rowpk"),[this.defaultReorderColumn]:i});e.storeReorder(l)},setupEvenOddClasses(){if(void 0===this.evenNotInOdd.length||0==this.evenNotInOdd.length||void 0===this.oddNotInEven.length||0==this.oddNotInEven.length){let e=document.getElementById(this.tableId).getElementsByTagName("tbody")[0],t=[],l=[];void 0!==e.rows[0]&&void 0!==e.rows[1]&&(t=Array.from(e.rows[0].classList),l=Array.from(e.rows[1].classList),this.evenNotInOdd=t.filter(e=>!l.includes(e)),this.oddNotInEven=l.filter(e=>!t.includes(e)),t=[],l=[])}},toggleSelectAll(){this.showBulkActionsAlpine&&(this.paginationTotalItemCount===this.selectedItems.length?(this.clearSelected(),this.selectAllStatus=!1):this.delaySelectAll?this.setAllItemsSelected():this.setAllSelected())},setAllItemsSelected(){this.showBulkActionsAlpine&&(this.selectAllStatus=!0,this.selectAllOnPage())},setAllSelected(){this.showBulkActionsAlpine&&(this.delaySelectAll?(this.selectAllStatus=!0,this.selectAllOnPage()):e.setAllSelected())},clearSelected(){this.showBulkActionsAlpine&&(this.selectAllStatus=!1,e.clearSelected())},selectAllOnPage(){if(!this.showBulkActionsAlpine)return;let e=this.selectedItems,t=this.paginationCurrentItems.values();for(let l of t)e.push(l.toString());this.selectedItems=[...new Set(e)]},setTableId(e){this.tableId=e},setAlpineBulkActions(e){this.showBulkActionsAlpine=e},setPrimaryKeyName(e){this.primaryKeyName=e},showTable(e){let t=e.detail.tableName??"",l=e.detail.tableFingerpint??"";((t??"")!=""&&t===this.tableName||""!=l&&eventTableFingerpint===this.dataTableFingerprint)&&(this.shouldBeDisplayed=!0)},hideTable(e){let t=e.detail.tableName??"",l=e.detail.tableFingerpint??"";(""!=t&&t===this.tableName||""!=l&&eventTableFingerpint===this.dataTableFingerprint)&&(this.shouldBeDisplayed=!1)},destroy(){this.listeners.forEach(e=>{e()})}})),Alpine.data("booleanFilter",(e,t,l,i)=>({localListeners:[],switchOn:!1,value:e.entangle("filterComponents."+t).live,init(){this.switchOn=!1,void 0!==this.value&&(this.switchOn=Boolean(Number(this.value))),this.localListeners.push(Livewire.on("filter-was-set",e=>{e.tableName==this.tableName&&e.filterKey==t&&(this.switchOn=e.value??i)}))},destroy(){this.localListeners.forEach(e=>{e()})}})),Alpine.data("newBooleanFilter",(e,t,l)=>({booleanFilterKey:e,switchOn:!1,value:!1,toggleStatus(){let e=!Boolean(Number(this.$wire.get("filterComponents."+this.booleanFilterKey)??this.value));return this.switchOn=this.value=e,Number(e)},toggleStatusWithUpdate(){let e=this.toggleStatus();this.$wire.set("filterComponents."+this.booleanFilterKey,e)},toggleStatusWithReset(){this.toggleStatus(),this.$wire.call("resetFilter",this.booleanFilterKey)},setSwitchOn(e){let t=Number(e??0);this.switchOn=Boolean(t)},init(){this.$nextTick(()=>{this.value=this.$wire.get("filterComponents."+this.booleanFilterKey)??l,this.setSwitchOn(this.value??0)}),this.listeners.push(Livewire.on("filter-was-set",e=>{e.tableName==this.tableName&&e.filterKey==this.booleanFilterKey&&(this.switchOn=e.value??l)}))}})),Alpine.data("booleanFilterLatest",e=>({booleanFilterKey:e.filterKey,booleanFilterDefaultValue:e.defaultValue,switchOn:!1,value:!1,toggleStatus(){let e=!Boolean(Number(this.$wire.get("filterComponents."+this.booleanFilterKey)??this.value));return this.switchOn=this.value=e,Number(e)},toggleStatusWithUpdate(){let e=this.toggleStatus();this.$wire.set("filterComponents."+this.booleanFilterKey,e)},toggleStatusWithReset(){this.toggleStatus(),this.$wire.call("resetFilter",this.booleanFilterKey)},setSwitchOn(e){let t=Number(e??0);this.switchOn=Boolean(t)},init(){this.$nextTick(()=>{this.value=this.$wire.get("filterComponents."+this.booleanFilterKey)??this.booleanFilterDefaultValue,this.setSwitchOn(this.value??0)}),this.listeners.push(Livewire.on("filter-was-set",e=>{e.tableName==this.tableName&&e.filterKey==this.booleanFilterKey&&(this.switchOn=e.value??this.booleanFilterDefaultValue)}))}})),Alpine.data("numberRangeFilter",(e,t,l,i,s)=>({allFilters:e.entangle("filterComponents",!1),originalMin:0,originalMax:100,filterMin:0,filterMax:100,currentMin:0,currentMax:100,hasUpdate:!1,wireValues:e.entangle("filterComponents."+t,!1),defaultMin:i.minRange,defaultMax:i.maxRange,restrictUpdates:!1,initialiseStyles(){let e=document.getElementById(l);e.style.setProperty("--value-a",this.wireValues.min??this.filterMin),e.style.setProperty("--text-value-a",JSON.stringify(this.wireValues.min??this.filterMin)),e.style.setProperty("--value-b",this.wireValues.max??this.filterMax),e.style.setProperty("--text-value-b",JSON.stringify(this.wireValues.max??this.filterMax))},updateStyles(e,t){let i=document.getElementById(l);i.style.setProperty("--value-a",e),i.style.setProperty("--text-value-a",JSON.stringify(e)),i.style.setProperty("--value-b",t),i.style.setProperty("--text-value-b",JSON.stringify(t))},setupWire(){void 0!==this.wireValues?(this.filterMin=this.originalMin=void 0!==this.wireValues.min?this.wireValues.min:this.defaultMin,this.filterMax=this.originalMax=void 0!==this.wireValues.max?this.wireValues.max:this.defaultMax):(this.filterMin=this.originalMin=this.defaultMin,this.filterMax=this.originalMax=this.defaultMax),this.updateStyles(this.filterMin,this.filterMax)},allowUpdates(){this.updateWire()},updateWire(){let e=parseInt(this.filterMin),t=parseInt(this.filterMax);(e!=this.originalMin||t!=this.originalMax)&&(tthis.setupWire())}})),Alpine.data("flatpickrFilter",(e,t,l,i,s)=>({wireValues:e.entangle("filterComponents."+t),flatpickrInstance:flatpickr(i,{mode:"range",altFormat:l.altFormat??"F j, Y",altInput:l.altInput??!1,allowInput:l.allowInput??!1,allowInvalidPreload:l.allowInvalidPreload??!0,ariaDateFormat:l.ariaDateFormat??"F j, Y",clickOpens:!0,dateFormat:l.dateFormat??"Y-m-d",defaultDate:l.defaultDate??null,defaultHour:l.defaultHour??12,defaultMinute:l.defaultMinute??0,enableTime:l.enableTime??!1,enableSeconds:l.enableSeconds??!1,hourIncrement:l.hourIncrement??1,locale:l.locale??"en",minDate:l.earliestDate??null,maxDate:l.latestDate??null,minuteIncrement:l.minuteIncrement??5,shorthandCurrentMonth:l.shorthandCurrentMonth??!1,time_24hr:l.time_24hr??!1,weekNumbers:l.weekNumbers??!1,onOpen:function(){window.childElementOpen=!0},onChange:function(l,i,s){if(l.length>1){var a=i.split(" "),r={};window.childElementOpen=!1,window.filterPopoverOpen=!1,r={minDate:a[0],maxDate:void 0===a[2]?a[0]:a[2]},e.set("filterComponents."+t,r)}}}),changedValue:function(l){l.length<5&&(this.flatpickrInstance.setDate([]),e.set("filterComponents."+t,{}))},setupWire(){if(void 0!==this.wireValues){if(void 0!==this.wireValues.minDate&&void 0!==this.wireValues.maxDate){let e=[this.wireValues.minDate,this.wireValues.maxDate];this.flatpickrInstance.setDate(e)}else this.flatpickrInstance.setDate([])}else this.flatpickrInstance.setDate([])},init(){this.setupWire(),this.$watch("wireValues",e=>this.setupWire())}})),Alpine.data("tableWrapper",(e,t)=>({shouldBeDisplayed:e.entangle("shouldBeDisplayed"),listeners:[],childElementOpen:!1,filtersOpen:e.entangle("filterSlideDownDefaultVisible"),paginationCurrentCount:e.entangle("paginationCurrentCount"),paginationTotalItemCount:e.entangle("paginationTotalItemCount"),paginationCurrentItems:e.entangle("paginationCurrentItems"),selectedItems:e.entangle("selected"),selectAllStatus:e.entangle("selectAll"),delaySelectAll:e.entangle("delaySelectAll"),hideBulkActionsWhenEmpty:e.entangle("hideBulkActionsWhenEmpty"),toggleSelectAll(){t&&(this.paginationTotalItemCount===this.selectedItems.length?(this.clearSelected(),this.selectAllStatus=!1):this.delaySelectAll?this.setAllItemsSelected():this.setAllSelected())},setAllItemsSelected(){t&&(this.selectAllStatus=!0,this.selectAllOnPage())},setAllSelected(){t&&(this.delaySelectAll?(this.selectAllStatus=!0,this.selectAllOnPage()):e.setAllSelected())},clearSelected(){t&&(this.selectAllStatus=!1,e.clearSelected())},selectAllOnPage(){if(!t)return;let e=this.selectedItems,l=this.paginationCurrentItems.values();for(let i of l)e.push(i.toString());this.selectedItems=[...new Set(e)]},destroy(){this.listeners.forEach(e=>{e()})}})),Alpine.data("reorderFunction",(e,t,l)=>({dragging:!1,reorderEnabled:!1,sourceID:"",targetID:"",evenRowClasses:"",oddRowClasses:"",currentlyHighlightedElement:"",evenRowClassArray:{},oddRowClassArray:{},evenNotInOdd:{},oddNotInEven:{},orderedRows:[],defaultReorderColumn:e.get("defaultReorderColumn"),reorderStatus:e.get("reorderStatus"),currentlyReorderingStatus:e.entangle("currentlyReorderingStatus"),hideReorderColumnUnlessReorderingStatus:e.entangle("hideReorderColumnUnlessReorderingStatus"),reorderDisplayColumn:e.entangle("reorderDisplayColumn"),dragStart(e){this.$nextTick(()=>{this.setupEvenOddClasses()}),this.sourceID=e.target.id,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id),e.target.classList.add("laravel-livewire-tables-dragging")},dragOverEvent(e){"object"==typeof this.currentlyHighlightedElement&&this.currentlyHighlightedElement.classList.remove("laravel-livewire-tables-highlight-bottom","laravel-livewire-tables-highlight-top");let t=e.target.closest("tr");this.currentlyHighlightedElement=t,e.offsetYl.getBoundingClientRect().height/2?i.insertBefore(s,l.nextSibling):i.insertBefore(s,l),r{this.setupEvenOddClasses()}),this.currentlyReorderingStatus?e.disableReordering():(this.setupEvenOddClasses(),this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!0),e.enableReordering())},cancelReorder(){this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!1),e.disableReordering()},updateOrderedItems(){let i=document.getElementById(t),s=[];for(let a=1,r;r=i.rows[a];a++)s.push({[l]:r.getAttribute("rowpk"),[this.defaultReorderColumn]:a});e.storeReorder(s)},setupEvenOddClasses(){if(void 0===this.evenNotInOdd.length||0==this.evenNotInOdd.length||void 0===this.oddNotInEven.length||0==this.oddNotInEven.length){let e=document.getElementById(t).getElementsByTagName("tbody")[0],l=[],i=[];void 0!==e.rows[0]&&void 0!==e.rows[1]&&(l=Array.from(e.rows[0].classList),i=Array.from(e.rows[1].classList),this.evenNotInOdd=l.filter(e=>!i.includes(e)),this.oddNotInEven=i.filter(e=>!l.includes(e)),l=[],i=[])}},init(){}})),Alpine.data("filterPillsHandler",e=>({localData:e,localFilterKey:"",localFilterTitle:"",isExternalFilter:!1,shouldRenderAsHTML:!1,shouldWatchPillValues:!1,pillsSeparator:",",pillValues:null,pillHasValues:!1,displayString:"",generateLocalFilterPillImplodedValues(e){if(void 0!==e){var t,l="---tablepillsseparator---",i=RegExp(l,"g");if(t=Array.isArray(e)?e.join(l):e,this.shouldRenderAsHTML||(t=this.removeHTMLTags(t)),null!==t)return t.replace(i,this.pillsSeparator)}return""},clearExternalFilterPill(){this.isExternalFilter&&(this.externalFilterPillsVals[this.localFilterKey]=[],this.displayString=this.generateLocalFilterPillImplodedValues(this.externalFilterPillsVals[this.localFilterKey]),this.updatePillHasValues(),this.resetSpecificFilter(this.localFilterKey))},trigger:{"@filterpillupdate.window"(e){this.watchForUpdateEvent(e)}},checkEventIsValid(e,t){return this.tableName===e&&this.localFilterKey===t},watchForUpdateEvent(e){if(this.checkEventIsValid(e.detail.tableName??"",e.detail.filterKey??"")){let t=e.detail.pillItem??"";if(this.shouldRenderAsHTML||(t=this.removeHTMLTags(t)),""!=t){if(this.isExternalFilter){let l=this.externalFilterPillsVals[this.localFilterKey];l.push(t),this.updatePillValues(l)}else this.updatePillValues(t)}}},updatePillValues(e){return this.pillValues=e,this.displayString=this.generateLocalFilterPillImplodedValues(e),this.updatePillHasValues(),this.displayString},updatePillHasValues(){this.pillHasValues=this.displayString.length>0},init(){this.localFilterKey=this.localData.filterKey??"unknown",this.localFilterTitle=this.localData.filterPillTitle??"Unknown",this.pillsSeparator=this.localData.separator??",",this.shouldWatchPillValues=Boolean(this.localData.watchForEvents??0),this.isExternalFilter=Boolean(this.localData.isAnExternalLivewireFilter??0),this.shouldRenderAsHTML=Boolean(this.localData.renderPillsAsHtml??0),this.pillValues=this.localData.pillValues??null,this.$nextTick(()=>{this.isExternalFilter?this.updatePillValues(this.externalFilterPillsVals[this.localFilterKey]):this.updatePillValues(this.pillValues)}),this.isExternalFilter&&this.shouldWatchPillValues&&this.$watch("externalFilterPillsVals."+this.localFilterKey,e=>{this.updatePillValues(e)})}})),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",{tableName:this.tableName,filterKey:this.externalFilterKey,pillItem:t})},overridePill(e){let t=this.removeHTMLTags(e);this.$dispatch("filterpillupdate",{tableName:this.tableName,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))}}))}); \ No newline at end of file diff --git a/resources/js/partials/filter-boolean.js b/resources/js/partials/filter-boolean.js new file mode 100644 index 000000000..1f49ca461 --- /dev/null +++ b/resources/js/partials/filter-boolean.js @@ -0,0 +1,19 @@ +document.addEventListener('alpine:init', () => { + Alpine.data('booleanFilter', (wire,filterKey,tableName,defaultValue) => ({ + switchOn: false, + value: wire.entangle('filterComponents.'+filterKey).live, + init() { + this.switchOn = false; + if (typeof this.value !== 'undefined') { + this.switchOn = Boolean(Number(this.value)); + } + this.listeners.push( + Livewire.on('filter-was-set', (detail) => { + if(detail.tableName == tableName && detail.filterKey == filterKey) { + this.switchOn = detail.value ?? defaultValue; + } + }) + ); + } + })); +}); \ No newline at end of file diff --git a/resources/js/partials/filter-boolean.min.js b/resources/js/partials/filter-boolean.min.js new file mode 100644 index 000000000..d53fb4f35 --- /dev/null +++ b/resources/js/partials/filter-boolean.min.js @@ -0,0 +1 @@ +document.addEventListener('alpine:init',()=>Alpine.data('booleanFilter',(a,b,c,d)=>({switchOn:!1,value:a.entangle(`filterComponents.${b}`).live,init(){this.switchOn=!1;this.value!==void 0&&(this.switchOn=!!+this.value);this.listeners.push(Livewire.on('filter-was-set',A=>{(A.tableName==c&&A.filterKey==b)&&(this.switchOn=A.value??d)}))}}))); diff --git a/resources/js/partials/filter-date-range.js b/resources/js/partials/filter-date-range.js index 4755b5d17..aa630347e 100644 --- a/resources/js/partials/filter-date-range.js +++ b/resources/js/partials/filter-date-range.js @@ -2,56 +2,67 @@ function fpf() { Alpine.data('flatpickrFilter', (wire, filterKey, filterConfig, refLocation, locale) => ({ - wireValues: wire.entangle('filterComponents.' + filterKey), - flatpickrInstance: flatpickr(refLocation, { - mode: 'range', - clickOpens: true, - allowInvalidPreload: true, - defaultDate: [], - ariaDateFormat: filterConfig['ariaDateFormat'], - allowInput: filterConfig['allowInput'], - altFormat: filterConfig['altFormat'], - altInput: filterConfig['altInput'], - dateFormat: filterConfig['dateFormat'], - locale: 'en', - minDate: filterConfig['earliestDate'], - maxDate: filterConfig['latestDate'], - onOpen: function () { - window.childElementOpen = true; - }, - onChange: function (selectedDates, dateStr, instance) { - if (selectedDates.length > 1) { - var startDate = dateStr.split(' ')[0]; - var endDate = dateStr.split(' ')[2]; - var wireDateArray = {}; - window.childElementOpen = false; - window.filterPopoverOpen = false; - wireDateArray = { 'minDate': startDate, 'maxDate': endDate }; - wire.set('filterComponents.' + filterKey, wireDateArray); - } - } - }), - setupWire() { - if (this.wireValues !== undefined) { - if (this.wireValues.minDate !== undefined && this.wireValues.maxDate !== undefined) { - let initialDateArray = [this.wireValues.minDate, this.wireValues.maxDate]; - this.flatpickrInstance.setDate(initialDateArray); + wireValues: wire.entangle('filterComponents.' + filterKey), + flatpickrInstance: flatpickr(refLocation, { + mode: 'range', + altFormat: filterConfig['altFormat'] ?? "F j, Y", + altInput: filterConfig['altInput'] ?? false, + allowInput: filterConfig['allowInput'] ?? false, + allowInvalidPreload: filterConfig['allowInvalidPreload'] ?? true, + ariaDateFormat: filterConfig['ariaDateFormat'] ?? "F j, Y", + clickOpens: true, + dateFormat: filterConfig['dateFormat'] ?? "Y-m-d", + defaultDate: filterConfig['defaultDate'] ?? null, + defaultHour: filterConfig['defaultHour'] ?? 12, + defaultMinute: filterConfig['defaultMinute'] ?? 0, + enableTime: filterConfig['enableTime'] ?? false, + enableSeconds: filterConfig['enableSeconds'] ?? false, + hourIncrement: filterConfig['hourIncrement'] ?? 1, + locale: filterConfig['locale'] ?? 'en', + minDate: filterConfig['earliestDate'] ?? null, + maxDate: filterConfig['latestDate'] ?? null, + minuteIncrement: filterConfig['minuteIncrement'] ?? 5, + shorthandCurrentMonth: filterConfig['shorthandCurrentMonth'] ?? false, + time_24hr: filterConfig['time_24hr'] ?? false, + weekNumbers: filterConfig['weekNumbers'] ?? false, + onOpen: function () { + window.childElementOpen = true; + }, + onChange: function (selectedDates, dateStr, instance) { + if (selectedDates.length > 1) { + var dates = dateStr.split(' '); + + var wireDateArray = {}; + window.childElementOpen = false; + window.filterPopoverOpen = false; + wireDateArray = { 'minDate': dates[0], 'maxDate': (typeof dates[2] === "undefined") ? dates[0] : dates[2] }; + wire.set('filterComponents.' + filterKey, wireDateArray); + } + + }, + }), + setupWire() { + if (this.wireValues !== undefined) { + if (this.wireValues.minDate !== undefined && this.wireValues.maxDate !== undefined) { + let initialDateArray = [this.wireValues.minDate, this.wireValues.maxDate]; + this.flatpickrInstance.setDate(initialDateArray); + } + else { + this.flatpickrInstance.setDate([]); + } } else { this.flatpickrInstance.setDate([]); } + }, + init() { + this.setupWire(); + this.$watch('wireValues', value => this.setupWire()); } - else { - this.flatpickrInstance.setDate([]); - } - }, - init() { - this.setupWire(); - this.$watch('wireValues', value => this.setupWire()); - } - + + + })); -})); } export default fpf; \ No newline at end of file diff --git a/resources/js/partials/filter-date-range.min.js b/resources/js/partials/filter-date-range.min.js index 5178ea8c6..e789c0b05 100644 --- a/resources/js/partials/filter-date-range.min.js +++ b/resources/js/partials/filter-date-range.min.js @@ -1 +1 @@ -function fpf(){Alpine.data("flatpickrFilter",(t,e,a,i,l)=>({wireValues:t.entangle("filterComponents."+e),flatpickrInstance:flatpickr(i,{mode:"range",clickOpens:!0,allowInvalidPreload:!0,defaultDate:[],ariaDateFormat:a.ariaDateFormat,allowInput:a.allowInput,altFormat:a.altFormat,altInput:a.altInput,dateFormat:a.dateFormat,locale:"en",minDate:a.earliestDate,maxDate:a.latestDate,onOpen:function(){window.childElementOpen=!0},onChange:function(a,i,l){if(a.length>1){var n=i.split(" ")[0],s=i.split(" ")[2],r={};window.childElementOpen=!1,window.filterPopoverOpen=!1,r={minDate:n,maxDate:s},t.set("filterComponents."+e,r)}}}),setupWire(){if(void 0!==this.wireValues){if(void 0!==this.wireValues.minDate&&void 0!==this.wireValues.maxDate){let t=[this.wireValues.minDate,this.wireValues.maxDate];this.flatpickrInstance.setDate(t)}else this.flatpickrInstance.setDate([])}else this.flatpickrInstance.setDate([])},init(){this.setupWire(),this.$watch("wireValues",t=>this.setupWire())}}))}export default fpf; \ No newline at end of file +function fpf(){Alpine.data("flatpickrFilter",(e,t,a,n,l)=>({wireValues:e.entangle("filterComponents."+t),flatpickrInstance:flatpickr(n,{mode:"range",altFormat:a.altFormat??"F j, Y",altInput:a.altInput??!1,allowInput:a.allowInput??!1,allowInvalidPreload:a.allowInvalidPreload??!0,ariaDateFormat:a.ariaDateFormat??"F j, Y",clickOpens:!0,dateFormat:a.dateFormat??"Y-m-d",defaultDate:a.defaultDate??null,defaultHour:a.defaultHour??12,defaultMinute:a.defaultMinute??0,enableTime:a.enableTime??!1,enableSeconds:a.enableSeconds??!1,hourIncrement:a.hourIncrement??1,locale:a.locale??"en",minDate:a.earliestDate??null,maxDate:a.latestDate??null,minuteIncrement:a.minuteIncrement??5,shorthandCurrentMonth:a.shorthandCurrentMonth??!1,time_24hr:a.time_24hr??!1,weekNumbers:a.weekNumbers??!1,onOpen:function(){window.childElementOpen=!0},onChange:function(a,n,l){if(a.length>1){var i=n.split(" "),r={};window.childElementOpen=!1,window.filterPopoverOpen=!1,r={minDate:i[0],maxDate:void 0===i[2]?i[0]:i[2]},e.set("filterComponents."+t,r)}}}),setupWire(){if(void 0!==this.wireValues){if(void 0!==this.wireValues.minDate&&void 0!==this.wireValues.maxDate){let e=[this.wireValues.minDate,this.wireValues.maxDate];this.flatpickrInstance.setDate(e)}else this.flatpickrInstance.setDate([])}else this.flatpickrInstance.setDate([])},init(){this.setupWire(),this.$watch("wireValues",e=>this.setupWire())}}))}export default fpf; \ No newline at end of file diff --git a/resources/js/partials/filter-number-range.js b/resources/js/partials/filter-number-range.js index 8aff53043..bf50c65ba 100644 --- a/resources/js/partials/filter-number-range.js +++ b/resources/js/partials/filter-number-range.js @@ -1,68 +1,75 @@ /*jshint esversion: 6 */ export function nrf() { Alpine.data('numberRangeFilter', (wire, filterKey, parentElementPath, filterConfig, childElementRoot) => ({ - allFilters: wire.entangle('filterComponents', false), - originalMin: 0, - originalMax: 100, - filterMin: 0, - filterMax: 100, - currentMin: 0, - currentMax: 100, - hasUpdate: false, - wireValues: wire.entangle('filterComponents.' + filterKey, false), - defaultMin: filterConfig['minRange'], - defaultMax: filterConfig['maxRange'], - restrictUpdates: false, - updateStyles() { - let numRangeFilterContainer = document.getElementById(parentElementPath); - let currentFilterMin = document.getElementById(childElementRoot + "-min"); - let currentFilterMax = document.getElementById(childElementRoot + "-max"); - numRangeFilterContainer.style.setProperty('--value-a', currentFilterMin.value); - numRangeFilterContainer.style.setProperty('--text-value-a', JSON.stringify(currentFilterMin.value)); - numRangeFilterContainer.style.setProperty('--value-b', currentFilterMax.value); - numRangeFilterContainer.style.setProperty('--text-value-b', JSON.stringify(currentFilterMax.value)); - }, - setupWire() { - if (this.wireValues !== undefined) { - this.filterMin = this.originalMin = (this.wireValues['min'] !== undefined) ? this.wireValues['min'] : this.defaultMin; - this.filterMax = this.originalMax = (this.wireValues['max'] !== undefined) ? this.wireValues['max'] : this.defaultMax; - } else { - this.filterMin = this.originalMin = this.defaultMin; - this.filterMax = this.originalMax = this.defaultMax; - } - this.updateStyles(); - }, - allowUpdates() { - this.updateWire(); - }, - updateWire() { - let tmpFilterMin = parseInt(this.filterMin); - let tmpFilterMax = parseInt(this.filterMax); - - if (tmpFilterMin != this.originalMin || tmpFilterMax != this.originalMax) { - if (tmpFilterMax < tmpFilterMin) { - this.filterMin = tmpFilterMax; - this.filterMax = tmpFilterMin; + allFilters: wire.entangle('filterComponents', false), + originalMin: 0, + originalMax: 100, + filterMin: 0, + filterMax: 100, + currentMin: 0, + currentMax: 100, + hasUpdate: false, + wireValues: wire.entangle('filterComponents.' + filterKey, false), + defaultMin: filterConfig['minRange'], + defaultMax: filterConfig['maxRange'], + restrictUpdates: false, + initialiseStyles() + { + let numRangeFilterContainer = document.getElementById(parentElementPath); + numRangeFilterContainer.style.setProperty('--value-a', this.wireValues['min'] ?? this.filterMin); + numRangeFilterContainer.style.setProperty('--text-value-a', JSON.stringify(this.wireValues['min'] ?? this.filterMin)); + numRangeFilterContainer.style.setProperty('--value-b', this.wireValues['max'] ?? this.filterMax); + numRangeFilterContainer.style.setProperty('--text-value-b', JSON.stringify(this.wireValues['max'] ?? this.filterMax)); + }, + updateStyles(filterMin, filterMax) { + let numRangeFilterContainer = document.getElementById(parentElementPath); + numRangeFilterContainer.style.setProperty('--value-a', filterMin); + numRangeFilterContainer.style.setProperty('--text-value-a', JSON.stringify(filterMin)); + numRangeFilterContainer.style.setProperty('--value-b', filterMax); + numRangeFilterContainer.style.setProperty('--text-value-b', JSON.stringify(filterMax)); + }, + setupWire() { + if (this.wireValues !== undefined) { + this.filterMin = this.originalMin = (this.wireValues['min'] !== undefined) ? this.wireValues['min'] : this.defaultMin; + this.filterMax = this.originalMax = (this.wireValues['max'] !== undefined) ? this.wireValues['max'] : this.defaultMax; + } else { + this.filterMin = this.originalMin = this.defaultMin; + this.filterMax = this.originalMax = this.defaultMax; + } + this.updateStyles(this.filterMin, this.filterMax); + }, + allowUpdates() { + this.updateWire(); + }, + updateWire() { + let tmpFilterMin = parseInt(this.filterMin); + let tmpFilterMax = parseInt(this.filterMax); + + if (tmpFilterMin != this.originalMin || tmpFilterMax != this.originalMax) { + if (tmpFilterMax < tmpFilterMin) { + this.filterMin = tmpFilterMax; + this.filterMax = tmpFilterMin; + } + this.hasUpdate = true; + this.originalMin = tmpFilterMin; + this.originalMax = tmpFilterMax; + } + this.updateStyles(this.filterMin,this.filterMax); + }, + updateWireable() { + if (this.hasUpdate) { + this.hasUpdate = false; + this.wireValues = { 'min': this.filterMin, 'max': this.filterMax }; + wire.set('filterComponents.' + filterKey, this.wireValues); } - this.hasUpdate = true; - this.originalMin = tmpFilterMin; - this.originalMax = tmpFilterMax; - } - this.updateStyles(); - }, - updateWireable() { - if (this.hasUpdate) { - this.hasUpdate = false; - this.wireValues = { 'min': this.filterMin, 'max': this.filterMax }; - wire.set('filterComponents.' + filterKey, this.wireValues); - } + }, + init() { + this.initialiseStyles(); + this.setupWire(); + this.$watch('allFilters', value => this.setupWire()); + }, + })); - }, - init() { - this.setupWire(); - this.$watch('allFilters', value => this.setupWire()); - }, -})); } export default nrf; diff --git a/resources/js/partials/filter-number-range.min.js b/resources/js/partials/filter-number-range.min.js index 40f63cc71..3c9aa3d13 100644 --- a/resources/js/partials/filter-number-range.min.js +++ b/resources/js/partials/filter-number-range.min.js @@ -1 +1 @@ -export function nrf(){Alpine.data("numberRangeFilter",(t,i,e,a,s)=>({allFilters:t.entangle("filterComponents",!1),originalMin:0,originalMax:100,filterMin:0,filterMax:100,currentMin:0,currentMax:100,hasUpdate:!1,wireValues:t.entangle("filterComponents."+i,!1),defaultMin:a.minRange,defaultMax:a.maxRange,restrictUpdates:!1,updateStyles(){let t=document.getElementById(e),i=document.getElementById(s+"-min"),a=document.getElementById(s+"-max");t.style.setProperty("--value-a",i.value),t.style.setProperty("--text-value-a",JSON.stringify(i.value)),t.style.setProperty("--value-b",a.value),t.style.setProperty("--text-value-b",JSON.stringify(a.value))},setupWire(){void 0!==this.wireValues?(this.filterMin=this.originalMin=void 0!==this.wireValues.min?this.wireValues.min:this.defaultMin,this.filterMax=this.originalMax=void 0!==this.wireValues.max?this.wireValues.max:this.defaultMax):(this.filterMin=this.originalMin=this.defaultMin,this.filterMax=this.originalMax=this.defaultMax),this.updateStyles()},allowUpdates(){this.updateWire()},updateWire(){let t=parseInt(this.filterMin),i=parseInt(this.filterMax);(t!=this.originalMin||i!=this.originalMax)&&(ithis.setupWire())}}))}export default nrf; \ No newline at end of file +function a(){Alpine.data('numberRangeFilter',(A,b,c,d,e)=>({allFilters:A.entangle('filterComponents',!1),originalMin:0,originalMax:100,filterMin:0,filterMax:100,currentMin:0,currentMax:100,hasUpdate:!1,wireValues:A.entangle(`filterComponents.${b}`,!1),defaultMin:d['minRange'],defaultMax:d['maxRange'],restrictUpdates:!1,initialiseStyles(){let _=document.getElementById(c);_.style.setProperty('--value-a',this.wireValues['min']??this.filterMin);_.style.setProperty('--text-value-a',JSON.stringify(this.wireValues['min']??this.filterMin));_.style.setProperty('--value-b',this.wireValues['max']??this.filterMax);_.style.setProperty('--text-value-b',JSON.stringify(this.wireValues['max']??this.filterMax))},updateStyles(B,C){let _c=document.getElementById(c);_c.style.setProperty('--value-a',B);_c.style.setProperty('--text-value-a',JSON.stringify(B));_c.style.setProperty('--value-b',C);_c.style.setProperty('--text-value-b',JSON.stringify(C))},setupWire(){this.wireValues!==void 0?(this.filterMin=this.originalMin=(this.wireValues['min']!==void 0)?this.wireValues['min']:this.defaultMin,this.filterMax=this.originalMax=(this.wireValues['max']!==void 0)?this.wireValues['max']:this.defaultMax):(this.filterMin=this.originalMin=this.defaultMin,this.filterMax=this.originalMax=this.defaultMax);this.updateStyles(this.filterMin,this.filterMax)},allowUpdates(){this.updateWire()},updateWire(){let _a=parseInt(this.filterMin);let _b=parseInt(this.filterMax);if(_a!=this.originalMin||_b!=this.originalMax){_b<_a&&(this.filterMin=_b,this.filterMax=_a);this.hasUpdate=!0;this.originalMin=_a;this.originalMax=_b}this.updateStyles(this.filterMin,this.filterMax)},updateWireable(){this.hasUpdate&&(this.hasUpdate=!1,this.wireValues={'min':this.filterMin,'max':this.filterMax},A.set(`filterComponents.${b}`,this.wireValues))},init(){this.initialiseStyles();this.setupWire();this.$watch('allFilters',value=>this.setupWire())}}))}export{a as nrf};export default a; diff --git a/resources/js/partials/reorder.js b/resources/js/partials/reorder.js index b6ede2ec0..a6115025e 100644 --- a/resources/js/partials/reorder.js +++ b/resources/js/partials/reorder.js @@ -2,142 +2,146 @@ function tableReorder() { Alpine.data('reorderFunction', (wire, tableID, primaryKeyName) => ({ - dragging: false, - reorderEnabled: false, - sourceID: '', - targetID: '', - evenRowClasses: '', - oddRowClasses: '', - currentlyHighlightedElement: '', - evenRowClassArray: {}, - oddRowClassArray: {}, - evenNotInOdd: {}, - oddNotInEven: {}, - orderedRows: [], - defaultReorderColumn: wire.get('defaultReorderColumn'), - reorderStatus: wire.get('reorderStatus'), - currentlyReorderingStatus: wire.entangle('currentlyReorderingStatus'), - hideReorderColumnUnlessReorderingStatus: wire.entangle('hideReorderColumnUnlessReorderingStatus'), - reorderDisplayColumn: wire.entangle('reorderDisplayColumn'), - dragStart(event) { - this.sourceID = event.target.id; - event.dataTransfer.effectAllowed = 'move'; - event.dataTransfer.setData('text/plain', event.target.id); - event.target.classList.add("laravel-livewire-tables-dragging"); - }, - dragOverEvent(event) { - if (typeof this.currentlyHighlightedElement == 'object') { - this.currentlyHighlightedElement.classList.remove('laravel-livewire-tables-highlight-bottom', 'laravel-livewire-tables-highlight-top'); - } - let target = event.target.closest('tr'); - this.currentlyHighlightedElement = target; + dragging: false, + reorderEnabled: false, + sourceID: '', + targetID: '', + evenRowClasses: '', + oddRowClasses: '', + currentlyHighlightedElement: '', + evenRowClassArray: {}, + oddRowClassArray: {}, + evenNotInOdd: {}, + oddNotInEven: {}, + orderedRows: [], + defaultReorderColumn: wire.get('defaultReorderColumn'), + reorderStatus: wire.get('reorderStatus'), + currentlyReorderingStatus: wire.entangle('currentlyReorderingStatus'), + hideReorderColumnUnlessReorderingStatus: wire.entangle('hideReorderColumnUnlessReorderingStatus'), + reorderDisplayColumn: wire.entangle('reorderDisplayColumn'), + dragStart(event) { + this.$nextTick(() => { this.setupEvenOddClasses() }); - if (event.offsetY < (target.getBoundingClientRect().height / 2)) { - target.classList.add('laravel-livewire-tables-highlight-top'); - target.classList.remove('laravel-livewire-tables-highlight-bottom'); - } - else { - target.classList.remove('laravel-livewire-tables-highlight-top'); - target.classList.add('laravel-livewire-tables-highlight-bottom'); - } - }, - dragLeaveEvent(event) { - event.target.closest('tr').classList.remove('laravel-livewire-tables-highlight-bottom', 'laravel-livewire-tables-highlight-top'); - }, - dropEvent(event) { - if (typeof this.currentlyHighlightedElement == 'object') { - this.currentlyHighlightedElement.classList.remove('laravel-livewire-tables-highlight-bottom', 'laravel-livewire-tables-highlight-top'); - } - let target = event.target.closest('tr'); - let parent = event.target.closest('tr').parentNode; - let element = document.getElementById(this.sourceID).closest('tr'); - element.classList.remove("laravel-livewire-table-dragging"); - let originalPosition = element.rowIndex; - let newPosition = target.rowIndex; - let table = document.getElementById(tableID); - let loopStart = originalPosition; - if (event.offsetY > (target.getBoundingClientRect().height / 2)) { - parent.insertBefore(element, target.nextSibling); - } - else { - parent.insertBefore(element, target); - } - if (newPosition < originalPosition) { - loopStart = newPosition; - } + this.sourceID = event.target.id; + event.dataTransfer.effectAllowed = 'move'; + event.dataTransfer.setData('text/plain', event.target.id); + event.target.classList.add("laravel-livewire-tables-dragging"); + }, + dragOverEvent(event) { + if (typeof this.currentlyHighlightedElement == 'object') { + this.currentlyHighlightedElement.classList.remove('laravel-livewire-tables-highlight-bottom', 'laravel-livewire-tables-highlight-top'); + } + let target = event.target.closest('tr'); + this.currentlyHighlightedElement = target; + + if (event.offsetY < (target.getBoundingClientRect().height / 2)) { + target.classList.add('laravel-livewire-tables-highlight-top'); + target.classList.remove('laravel-livewire-tables-highlight-bottom'); + } + else { + target.classList.remove('laravel-livewire-tables-highlight-top'); + target.classList.add('laravel-livewire-tables-highlight-bottom'); + } + }, + dragLeaveEvent(event) { + event.target.closest('tr').classList.remove('laravel-livewire-tables-highlight-bottom', 'laravel-livewire-tables-highlight-top'); + }, + dropEvent(event) { + if (typeof this.currentlyHighlightedElement == 'object') { + this.currentlyHighlightedElement.classList.remove('laravel-livewire-tables-highlight-bottom', 'laravel-livewire-tables-highlight-top'); + } + + let target = event.target.closest('tr'); + let parent = event.target.closest('tr').parentNode; + let element = document.getElementById(this.sourceID).closest('tr'); + element.classList.remove("laravel-livewire-table-dragging"); + let originalPosition = element.rowIndex; + let newPosition = target.rowIndex; + let table = document.getElementById(tableID); + let loopStart = originalPosition; + if (event.offsetY > (target.getBoundingClientRect().height / 2)) { + parent.insertBefore(element, target.nextSibling); + } + else { + parent.insertBefore(element, target); + } + if (newPosition < originalPosition) { + loopStart = newPosition; + } + + /* + let evenList = parentNode.querySelectorAll("table[tableType='rappasoft-laravel-livewire-tables']>tbody>tr:nth-child(even of tr.rappasoft-striped-row) ").forEach(function (elem) { + elem.classList.remove(...this.oddNotInEven); + row.classList.add(...this.evenNotInOdd); + }); + */ + let nextLoop = 'even'; + for (let i = 1, row; row = table.rows[i]; i++) { + if (!row.classList.contains('hidden') && !row.classList.contains('md:hidden') ) { + if (nextLoop === 'even') { + row.classList.remove(...this.oddNotInEven); + row.classList.add(...this.evenNotInOdd); + nextLoop = 'odd'; + } + else { + row.classList.remove(...this.evenNotInOdd); + row.classList.add(...this.oddNotInEven); + nextLoop = 'even'; + } + } + } + }, + reorderToggle() { + this.$nextTick(() => { this.setupEvenOddClasses() }); + if (this.currentlyReorderingStatus) { + wire.disableReordering(); + + } + else { + this.setupEvenOddClasses(); + if (this.hideReorderColumnUnlessReorderingStatus) { + this.reorderDisplayColumn = true; + } + wire.enableReordering(); + + } + }, + cancelReorder() { + if (this.hideReorderColumnUnlessReorderingStatus) { + this.reorderDisplayColumn = false; + } + wire.disableReordering(); + + }, + updateOrderedItems() { + let table = document.getElementById(tableID); + let orderedRows = []; + for (let i = 1, row; row = table.rows[i]; i++) { + orderedRows.push({ [primaryKeyName]: row.getAttribute('rowpk'), [this.defaultReorderColumn]: i }); + } + wire.storeReorder(orderedRows); + }, + setupEvenOddClasses() { + if (this.evenNotInOdd.length === undefined || this.evenNotInOdd.length == 0 || this.oddNotInEven.length === undefined || this.oddNotInEven.length == 0) + { + let tbody = document.getElementById(tableID).getElementsByTagName('tbody')[0]; + let evenRowClassArray = []; + let oddRowClassArray = []; + + if (tbody.rows[0] !== undefined && tbody.rows[1] !== undefined) { + evenRowClassArray = Array.from(tbody.rows[0].classList); + oddRowClassArray = Array.from(tbody.rows[1].classList); + this.evenNotInOdd = evenRowClassArray.filter(element => !oddRowClassArray.includes(element)); + this.oddNotInEven = oddRowClassArray.filter(element => !evenRowClassArray.includes(element)); - /* - let evenList = parentNode.querySelectorAll("table[tableType='rappasoft-laravel-livewire-tables']>tbody>tr:nth-child(even of tr.rappasoft-striped-row) ").forEach(function (elem) { - elem.classList.remove(...this.oddNotInEven); - row.classList.add(...this.evenNotInOdd); - }); - */ - let nextLoop = 'even'; - for (let i = 1, row; row = table.rows[i]; i++) { - if (!row.classList.contains('hidden') && !row.classList.contains('md:hidden') ) { - if (nextLoop === 'even') { - row.classList.remove(...this.oddNotInEven); - row.classList.add(...this.evenNotInOdd); - nextLoop = 'odd'; - } - else { - row.classList.remove(...this.evenNotInOdd); - row.classList.add(...this.oddNotInEven); - nextLoop = 'even'; - } - } - } - }, - reorderToggle() { - if (this.currentlyReorderingStatus) { - wire.disableReordering(); - - } - else { - if (this.hideReorderColumnUnlessReorderingStatus) { - this.reorderDisplayColumn = true; - } - wire.enableReordering(); - - } - }, - cancelReorder() { - if (this.hideReorderColumnUnlessReorderingStatus) { - this.reorderDisplayColumn = false; - } - wire.disableReordering(); - - }, - updateOrderedItems() { - let table = document.getElementById(tableID); - let orderedRows = []; - for (let i = 1, row; row = table.rows[i]; i++) { - orderedRows.push({ [primaryKeyName]: row.getAttribute('rowpk'), [this.defaultReorderColumn]: i }); - } - wire.storeReorder(orderedRows); - }, - setupEvenOddClasses() { - if (this.currentlyReorderingStatus === true) { - - let tbody = document.getElementById(tableID).getElementsByTagName('tbody')[0]; - let evenRowClassArray = []; - let oddRowClassArray = []; - - if (tbody.rows[0] !== undefined && tbody.rows[1] !== undefined) { - evenRowClassArray = Array.from(tbody.rows[0].classList); - oddRowClassArray = Array.from(tbody.rows[1].classList); - this.evenNotInOdd = evenRowClassArray.filter(element => !oddRowClassArray.includes(element)); - this.oddNotInEven = oddRowClassArray.filter(element => !evenRowClassArray.includes(element)); - evenRowClassArray = [] - oddRowClassArray = [] - } - } - }, - init() { - this.$watch('currentlyReorderingStatus', value => this.setupEvenOddClasses()); - - } - })); + evenRowClassArray = [] + oddRowClassArray = [] + } + } + }, + init() { + } + })); } export default tableReorder; \ No newline at end of file diff --git a/resources/js/partials/reorder.min.js b/resources/js/partials/reorder.min.js index c0da29df6..84ad82e43 100644 --- a/resources/js/partials/reorder.min.js +++ b/resources/js/partials/reorder.min.js @@ -1 +1 @@ -function tableReorder(){Alpine.data("reorderFunction",(e,t,r)=>({dragging:!1,reorderEnabled:!1,sourceID:"",targetID:"",evenRowClasses:"",oddRowClasses:"",currentlyHighlightedElement:"",evenRowClassArray:{},oddRowClassArray:{},evenNotInOdd:{},oddNotInEven:{},orderedRows:[],defaultReorderColumn:e.get("defaultReorderColumn"),reorderStatus:e.get("reorderStatus"),currentlyReorderingStatus:e.entangle("currentlyReorderingStatus"),hideReorderColumnUnlessReorderingStatus:e.entangle("hideReorderColumnUnlessReorderingStatus"),reorderDisplayColumn:e.entangle("reorderDisplayColumn"),dragStart(e){this.sourceID=e.target.id,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id),e.target.classList.add("laravel-livewire-tables-dragging")},dragOverEvent(e){"object"==typeof this.currentlyHighlightedElement&&this.currentlyHighlightedElement.classList.remove("laravel-livewire-tables-highlight-bottom","laravel-livewire-tables-highlight-top");let t=e.target.closest("tr");this.currentlyHighlightedElement=t,e.offsetYr.getBoundingClientRect().height/2?l.insertBefore(s,r.nextSibling):l.insertBefore(s,r),o!l.includes(e)),this.oddNotInEven=l.filter(e=>!r.includes(e)),r=[],l=[])}},init(){this.$watch("currentlyReorderingStatus",e=>this.setupEvenOddClasses())}}))}export default tableReorder; \ No newline at end of file +function a(){Alpine.data('reorderFunction',(wire,tableID,primaryKeyName)=>({dragging:!1,reorderEnabled:!1,sourceID:'',targetID:'',evenRowClasses:'',oddRowClasses:'',currentlyHighlightedElement:'',evenRowClassArray:{},oddRowClassArray:{},evenNotInOdd:{},oddNotInEven:{},orderedRows:[],defaultReorderColumn:wire.get('defaultReorderColumn'),reorderStatus:wire.get('reorderStatus'),currentlyReorderingStatus:wire.entangle('currentlyReorderingStatus'),hideReorderColumnUnlessReorderingStatus:wire.entangle('hideReorderColumnUnlessReorderingStatus'),reorderDisplayColumn:wire.entangle('reorderDisplayColumn'),dragStart(A){this.$nextTick(()=>this.setupEvenOddClasses());this.sourceID=A.target.id;A.dataTransfer.effectAllowed='move';A.dataTransfer.setData('text/plain',A.target.id);A.target.classList.add('laravel-livewire-tables-dragging')},dragOverEvent(_){typeof this.currentlyHighlightedElement=='object'&&this.currentlyHighlightedElement.classList.remove('laravel-livewire-tables-highlight-bottom','laravel-livewire-tables-highlight-top');let b=_.target.closest('tr');this.currentlyHighlightedElement=b;_.offsetY<(b.getBoundingClientRect().height/2)?(b.classList.add('laravel-livewire-tables-highlight-top'),b.classList.remove('laravel-livewire-tables-highlight-bottom')):(b.classList.remove('laravel-livewire-tables-highlight-top'),b.classList.add('laravel-livewire-tables-highlight-bottom'))},dragLeaveEvent(B){B.target.closest('tr').classList.remove('laravel-livewire-tables-highlight-bottom','laravel-livewire-tables-highlight-top')},dropEvent(c){typeof this.currentlyHighlightedElement=='object'&&this.currentlyHighlightedElement.classList.remove('laravel-livewire-tables-highlight-bottom','laravel-livewire-tables-highlight-top');let C=c.target.closest('tr');let _c=c.target.closest('tr').parentNode;let d=document.getElementById(this.sourceID).closest('tr');d.classList.remove('laravel-livewire-table-dragging');let e=d.rowIndex;let f=C.rowIndex;let g=document.getElementById(tableID);c.offsetY>(C.getBoundingClientRect().height/2)?_c.insertBefore(d,C.nextSibling):_c.insertBefore(d,C);fthis.setupEvenOddClasses());if(this.currentlyReorderingStatus)wire.disableReordering();else{this.setupEvenOddClasses();this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!0);wire.enableReordering()}},cancelReorder(){this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!1);wire.disableReordering()},updateOrderedItems(){let _a=document.getElementById(tableID);let D=[];for(let i=1,_B;_B=_a.rows[i];i++)D.push({[primaryKeyName]:_B.getAttribute('rowpk'),[this.defaultReorderColumn]:i});wire.storeReorder(D)},setupEvenOddClasses(){if(this.evenNotInOdd.length===void 0||this.evenNotInOdd.length==0||this.oddNotInEven.length===void 0||this.oddNotInEven.length==0){let _A=document.getElementById(tableID).getElementsByTagName('tbody')[0];let E=[];let _C=[];(_A.rows[0]!==void 0&&_A.rows[1]!==void 0)&&(E=[..._A.rows[0].classList],_C=[..._A.rows[1].classList],this.evenNotInOdd=E.filter(aA=>!_C.includes(aA)),this.oddNotInEven=_C.filter(aB=>!E.includes(aB)),E=[],_C=[])}},init(){}}))}export default a; diff --git a/resources/js/partials/tableWrapper.js b/resources/js/partials/tableWrapper.js new file mode 100644 index 000000000..9bf1aaaeb --- /dev/null +++ b/resources/js/partials/tableWrapper.js @@ -0,0 +1,82 @@ +/*jshint esversion: 6 */ + +function tableWrapper() { + Alpine.data('tableWrapper', (wire, showBulkActionsAlpine) => ({ + listeners: [], + childElementOpen: false, + filtersOpen: wire.entangle('filterSlideDownDefaultVisible'), + paginationCurrentCount: wire.entangle('paginationCurrentCount'), + paginationTotalItemCount: wire.entangle('paginationTotalItemCount'), + paginationCurrentItems: wire.entangle('paginationCurrentItems'), + selectedItems: wire.entangle('selected'), + selectAllStatus: wire.entangle('selectAll'), + delaySelectAll: wire.entangle('delaySelectAll'), + hideBulkActionsWhenEmpty: wire.entangle('hideBulkActionsWhenEmpty'), + toggleSelectAll() { + if (!showBulkActionsAlpine) { + return; + } + + if (this.paginationTotalItemCount === this.selectedItems.length) { + this.clearSelected(); + this.selectAllStatus = false; + } else { + if (this.delaySelectAll) + { + this.setAllItemsSelected(); + } + else + { + this.setAllSelected(); + } + } + }, + setAllItemsSelected() { + if (!showBulkActionsAlpine) { + return; + } + this.selectAllStatus = true; + this.selectAllOnPage(); + }, + setAllSelected() { + if (!showBulkActionsAlpine) { + return; + } + if (this.delaySelectAll) + { + this.selectAllStatus = true; + this.selectAllOnPage(); + } + else + { + wire.setAllSelected(); + } + }, + clearSelected() { + if (!showBulkActionsAlpine) { + return; + } + this.selectAllStatus = false; + wire.clearSelected(); + }, + selectAllOnPage() { + if (!showBulkActionsAlpine) { + return; + } + + let tempSelectedItems = this.selectedItems; + const iterator = this.paginationCurrentItems.values(); + for (const value of iterator) { + tempSelectedItems.push(value.toString()); + } + this.selectedItems = [...new Set(tempSelectedItems)]; + }, + destroy() { + this.listeners.forEach((listener) => { + listener(); + }); + } + })); +} + +export default tableWrapper; \ No newline at end of file diff --git a/resources/js/partials/tableWrapper.min.js b/resources/js/partials/tableWrapper.min.js new file mode 100644 index 000000000..b89a83af6 --- /dev/null +++ b/resources/js/partials/tableWrapper.min.js @@ -0,0 +1 @@ +function a(){Alpine.data('tableWrapper',(wire,showBulkActionsAlpine)=>({listeners:[],childElementOpen:!1,filtersOpen:wire.entangle('filterSlideDownDefaultVisible'),paginationCurrentCount:wire.entangle('paginationCurrentCount'),paginationTotalItemCount:wire.entangle('paginationTotalItemCount'),paginationCurrentItems:wire.entangle('paginationCurrentItems'),selectedItems:wire.entangle('selected'),selectAllStatus:wire.entangle('selectAll'),delaySelectAll:wire.entangle('delaySelectAll'),hideBulkActionsWhenEmpty:wire.entangle('hideBulkActionsWhenEmpty'),toggleSelectAll(){if(!showBulkActionsAlpine)return;if(this.paginationTotalItemCount===this.selectedItems.length){this.clearSelected();this.selectAllStatus=!1}else this.delaySelectAll?this.setAllItemsSelected():this.setAllSelected()},setAllItemsSelected(){if(!showBulkActionsAlpine)return;this.selectAllStatus=!0;this.selectAllOnPage()},setAllSelected(){if(!showBulkActionsAlpine)return;this.delaySelectAll?(this.selectAllStatus=!0,this.selectAllOnPage()):(wire.setAllSelected())},clearSelected(){if(!showBulkActionsAlpine)return;this.selectAllStatus=!1;wire.clearSelected()},selectAllOnPage(){if(!showBulkActionsAlpine)return;let A=this.selectedItems;var b=this.paginationCurrentItems.values();for(const _ of b)A.push(`${_}`);this.selectedItems=[...new Set(A)]},destroy(){for(const B of this.listeners)B()}}))}export default a; diff --git a/resources/lang/ar.json b/resources/lang/ar.json deleted file mode 100644 index bb39d9ab5..000000000 --- a/resources/lang/ar.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "All": "الجميع", - "All Columns": "كافة الأعمدة", - "Applied Filters": "المرشحات التطبيقية", - "Applied Sorting": "الفرز التطبيقي", - "Bulk Actions": "إجراءات جملة", - "Clear": "واضح", - "Columns": "الأعمدة", - "Debugging Values": "قيم التصحيح", - "Deselect All": "الغاء تحديد الكل", - "Done Reordering": "تمت إعادة الترتيب", - "Filters": "المرشحات", - "No": "لا", - "No items found. Try to broaden your search.": "لم يتم العثور على العناصر. حاول توسيع نطاق البحث.", - "of": "ل", - "Remove filter option": "إزالة خيار التصفية", - "Remove sort option": "إزالة خيار الفرز", - "Reorder": "إعادة ترتيب", - "results": "نتائج", - "row": "صف", - "rows": "صفوف", - "rows, do you want to select all": "الصفوف ، هل تريد تحديد الكل", - "Search": "يبحث", - "Select All": "اختر الكل", - "Showing": "عرض", - "to": "ل", - "Yes": "نعم", - "You are currently selecting all": "أنت الآن تختار الكل", - "You are not connected to the internet.": "أنت غير متصل بالإنترنت.", - "You have selected": "قمت بتحديدها" -} \ No newline at end of file diff --git a/resources/lang/ca.json b/resources/lang/ca.json deleted file mode 100644 index 7e8eb6691..000000000 --- a/resources/lang/ca.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "All": "Tot", - "All Columns": "Totes les columnes", - "Applied Filters": "Filtres Aplicats", - "Applied Sorting": "Ordenació Aplicada", - "Bulk Actions": "Accions Massives", - "Clear": "Esborra", - "Columns": "Columnes", - "Debugging Values": "Valors de depuració", - "Deselect All": "Deselecciona tot", - "Done Reordering": "Reordenació finalitzada", - "Filters": "Filtres", - "No": "No", - "No items found. Try to broaden your search.": "No s'han trobat elements. Intenti ampliar la cerca.", - "of": "de", - "Remove filter option": "Elimina opció de filtre", - "Remove sort option": "Elimina opció d'ordenació", - "Reorder": "Reordena", - "results": "resultats", - "row": "fila", - "rows": "files", - "rows, do you want to select all": "files, vol seleccionar totes", - "to": "a", - "Search": "Cerca", - "Select All": "Selecciona tot", - "Showing": "Mostrant", - "Yes": "Sí", - "You are currently selecting all": "Actualment està seleccionant tot", - "You are not connected to the internet.": "No està conectat a Internet.", - "You have selected": "Ha seleccionat" -} \ No newline at end of file diff --git a/resources/lang/da.json b/resources/lang/da.json deleted file mode 100644 index e90e13ce2..000000000 --- a/resources/lang/da.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "All": "Alle", - "All Columns": "Alle kolonner", - "Applied Filters": "Anvendte filtre", - "Applied Sorting": "Anvendt sortering", - "Bulk Actions": "Massehandlinger", - "Clear": "Ryd", - "Columns": "Kolonner", - "Debugging Values": "Debugging-værdier", - "Deselect All": "Fravælg alle", - "Done Reordering": "Færdig med omorganisering", - "Filters": "Filtre", - "No": "Nej", - "No items found. Try to broaden your search.": "Ingen elementer fundet. Prøv at udvide din søgning.", - "of": "af", - "Remove filter option": "Fjern filtermulighed", - "Remove sort option": "Fjern sorteringsmulighed", - "Reorder": "Omorganisér", - "results": "resultater", - "row": "række", - "rows": "rækker", - "rows, do you want to select all": "rækker, vil du vælge alle", - "Search": "Søg", - "Select All": "Vælg alle", - "Showing": "Viser", - "to": "til", - "Yes": "Ja", - "You are currently selecting all": "Du vælger i øjeblikket alle", - "You are not connected to the internet.": "Du er ikke forbundet til internettet.", - "You have selected": "Du har valgt" -} diff --git a/resources/lang/de.json b/resources/lang/de.json deleted file mode 100644 index cc49b1b2a..000000000 --- a/resources/lang/de.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "All": "Alle", - "All Columns": "Alle Spalten", - "Applied Filters": "Angewendete Filter", - "Applied Sorting": "Angewendete Sortierung", - "Bulk Actions": "Aktionen", - "Clear": "Zurücksetzen", - "Columns": "Spalten", - "Debugging Values": "Werte debuggen", - "Deselect All": "Alle abwählen", - "Done Reordering": "Sortieren abgeschlossen", - "Filters": "Filter", - "No": "Nein", - "No items found. Try to broaden your search.": "Es gibt keine Ergebnisse/Einträge. Versuche die Suche zu erweitern.", - "of": "von", - "Remove filter option": "Entferne Filterauswahl", - "Remove sort option": "Entferne Sortierauswahl", - "Reorder": "erneut Sortieren", - "results": "Ergebnisse", - "row": "Zeile", - "rows": "Zeilen", - "rows, do you want to select all": "Zeilen, sollen alle ausgewählt werden", - "Search": "Suche", - "Select All": "Alle auswählen", - "Showing": "Anzeigen", - "to": "nach", - "Yes": "Ja", - "You are currently selecting all": "Es sind schon alle ausgewählt", - "You are not connected to the internet.": "Es liegt keine Verbindung zum Internet vor.", - "You have selected": "Es sind ausgewählt" -} \ No newline at end of file diff --git a/resources/lang/en.json b/resources/lang/en.json deleted file mode 100644 index 87b34925e..000000000 --- a/resources/lang/en.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "All": "All", - "All Columns": "All Columns", - "Applied Filters": "Applied Filters", - "Applied Sorting": "Applied Sorting", - "Bulk Actions": "Bulk Actions", - "Bulk Actions Confirm": "Are you sure?", - "Clear": "Clear", - "Columns": "Columns", - "Debugging Values": "Debugging Values", - "Deselect All": "Deselect All", - "Done Reordering": "Done Reordering", - "Filters": "Filters", - "No": "No", - "No items found. Try to broaden your search.": "No items found. Try to broaden your search.", - "of": "of", - "Remove filter option": "Remove filter option", - "Remove sort option": "Remove sort option", - "Reorder": "Reorder", - "results": "results", - "row": "row", - "rows": "rows", - "rows, do you want to select all": "rows, do you want to select all", - "Search": "Search", - "Select All": "Select All", - "Select All On Page": "Select All On Page", - "Showing": "Showing", - "to": "to", - "Yes": "Yes", - "You are currently selecting all": "You are currently selecting all", - "You are not connected to the internet.": "You are not connected to the internet.", - "You have selected": "You have selected" -} diff --git a/resources/lang/es.json b/resources/lang/es.json deleted file mode 100644 index a337cb094..000000000 --- a/resources/lang/es.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "All": "Todo", - "All Columns": "Todas las columnas", - "Applied Filters": "Filtros Aplicados", - "Applied Sorting": "Ordenamiento Aplicado", - "Bulk Actions": "Acciones Masivas", - "Clear": "Borrar", - "Columns": "Columnas", - "Debugging Values": "Valores de depuración", - "Deselect All": "Deseleccionar todo", - "Done Reordering": "Reordenación finalizada", - "Filters": "Filtros", - "No": "No", - "No items found. Try to broaden your search.": "No se encontraron elementos. Intente ampliar la búsqueda.", - "of": "de", - "Remove filter option": "Remover opción de filtro", - "Remove sort option": "Remover opción de ordenamineto", - "Reorder": "Reordenar", - "results": "resultados", - "row": "fila", - "rows": "filas", - "rows, do you want to select all": "filas, desea seleccionar todas", - "Search": "Buscar", - "Select All": "Seleccionar todo", - "Select All On Page": "Seleccionar todo en la página", - "Showing": "Mostrando", - "to": "a", - "Yes": "Sí", - "You are currently selecting all": "Actualmente está seleccionando todo", - "You are not connected to the internet.": "No está conectado a Internet.", - "You have selected": "Ha seleccionado" -} \ No newline at end of file diff --git a/resources/lang/fr.json b/resources/lang/fr.json deleted file mode 100644 index b6f21093b..000000000 --- a/resources/lang/fr.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "All": "Tous", - "All Columns": "Toutes les colonnes", - "Applied Filters": "Filtres appliqués", - "Applied Sorting": "Tris appliqués", - "Bulk Actions": "Actions en masse", - "Clear": "Effacer", - "Columns": "Colonnes", - "Debugging Values": "Valeurs de débogage", - "Deselect All": "Tout désélectionner ", - "Done Reordering": "Réordonnancement terminé", - "Filters": "Filtres", - "No": "Non", - "No items found. Try to broaden your search.": "Aucun élément trouvé. Essayez d'élargir votre recherche.", - "of": "sur", - "Remove filter option": "Supprimer l'option de filtrage", - "Remove sort option": "Supprimer l'option de tri", - "Reorder": "Réordonner", - "results": "résultats", - "row": "ligne", - "rows": "lignes", - "rows, do you want to select all": "lignes, voulez-vous tout sélectionner ?", - "Search": "Rechercher", - "Select All": "Tout sélectionner", - "Showing": "Montrant", - "to": "à", - "Yes": "Oui", - "You are currently selecting all": "Vous êtes en train de sélectionner ", - "You are not connected to the internet.": "Vous n'êtes pas connecté à l'Internet.", - "You have selected": "Vous avez sélectionné" -} \ No newline at end of file diff --git a/resources/lang/id.json b/resources/lang/id.json deleted file mode 100644 index 3ba72de81..000000000 --- a/resources/lang/id.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "All": "Semua", - "All Columns": "Semua Kolom", - "Applied Filters": "Filter Diterapkan", - "Applied Sorting": "Penyortiran Diterapkan", - "Bulk Actions": "Aksi", - "Clear": "Bersihkan", - "Columns": "Kolom", - "Debugging Values": "Nilai Debug", - "Deselect All": "Batalkan Semua Pilihan", - "Done Reordering": "Selesai Mengurutkan Ulang", - "Filters": "Filter", - "No": "Tidak", - "No items found. Try to broaden your search.": "Tidak ada data yang ditemukan. Cobalah untuk memperluas pencarian Anda.", - "of": "dari", - "Remove filter option": "Hapus opsi filter", - "Remove sort option": "Hapus opsi pengurutan", - "Reorder": "Urutkan ulang", - "results": "hasil", - "row": "baris", - "rows": "baris", - "rows, do you want to select all": "baris, apakah Anda ingin memilih semua?", - "Search": "Cari", - "Select All": "Pilih Semua", - "Showing": "Menampilkan", - "to": "ke", - "Yes": "Ya", - "You are currently selecting all": "Anda sedang memilih semua", - "You are not connected to the internet.": "Anda sedang tidak terhubung ke internet.", - "You have selected": "Anda telah memilih" -} \ No newline at end of file diff --git a/resources/lang/it.json b/resources/lang/it.json deleted file mode 100644 index 4cb15d436..000000000 --- a/resources/lang/it.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "All": "Tutti", - "All Columns": "Tutte le colonne", - "Applied Filters": "Filtri Applicati", - "Applied Sorting": "Ordinamento Applicato", - "Bulk Actions": "Azioni di Gruppo", - "Clear": "Pulisci", - "Columns": "Colonne", - "Debugging Values": "Valori di debug", - "Deselect All": "Deseleziona tutto", - "Done Reordering": "Ordinamento Terminato", - "Filters": "Filtri", - "No": "No", - "No items found. Try to broaden your search.": "Nessun risultato trovato. Prova ad ampliare la tua ricerca.", - "of": "di", - "Remove filter option": "Rimuovi filtro", - "Remove sort option": "Rimuovi ordinamento", - "Reorder": "Riordina", - "results": "risultati", - "row": "righe", - "rows": "righe", - "rows, do you want to select all": "righe, vuoi selezionarle tutte", - "Search": "Cerca", - "Select All": "Seleziona Tutto", - "Showing": "Visualizzati", - "to": "a", - "Yes": "SÌ", - "You are currently selecting all": "Stai selezionando tutto", - "You are not connected to the internet.": "Non sei connesso a internet", - "You have selected": "Hai selezionato" -} \ No newline at end of file diff --git a/resources/lang/json/ar.json b/resources/lang/json/ar.json new file mode 100644 index 000000000..8ed603244 --- /dev/null +++ b/resources/lang/json/ar.json @@ -0,0 +1,62 @@ +{ + "livewire-tables::All": "الجميع", + "livewire-tables::All Columns": "كافة الأعمدة", + "livewire-tables::Applied Filters": "المرشحات التطبيقية", + "livewire-tables::Applied Sorting": "الفرز التطبيقي", + "livewire-tables::Bulk Actions": "إجراءات جملة", + "livewire-tables::Clear": "واضح", + "livewire-tables::Columns": "الأعمدة", + "livewire-tables::Debugging Values": "قيم التصحيح", + "livewire-tables::Deselect All": "الغاء تحديد الكل", + "livewire-tables::Done Reordering": "تمت إعادة الترتيب", + "livewire-tables::Filters": "المرشحات", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "لا", + "livewire-tables::No items found. Try to broaden your search.": "لم يتم العثور على العناصر. حاول توسيع نطاق البحث.", + "livewire-tables::of": "ل", + "livewire-tables::Remove filter option": "إزالة خيار التصفية", + "livewire-tables::Remove sort option": "إزالة خيار الفرز", + "livewire-tables::Reorder": "إعادة ترتيب", + "livewire-tables::results": "نتائج", + "livewire-tables::row": "صف", + "livewire-tables::rows": "صفوف", + "livewire-tables::rows, do you want to select all": "الصفوف ، هل تريد تحديد الكل", + "livewire-tables::Search": "يبحث", + "livewire-tables::Select All": "اختر الكل", + "livewire-tables::Showing": "عرض", + "livewire-tables::to": "ل", + "livewire-tables::Yes": "نعم", + "livewire-tables::You are currently selecting all": "أنت الآن تختار الكل", + "livewire-tables::You are not connected to the internet.": "أنت غير متصل بالإنترنت.", + "livewire-tables::You have selected": "قمت بتحديدها", + "All": "الجميع", + "All Columns": "كافة الأعمدة", + "Applied Filters": "المرشحات التطبيقية", + "Applied Sorting": "الفرز التطبيقي", + "Bulk Actions": "إجراءات جملة", + "Clear": "واضح", + "Columns": "الأعمدة", + "Debugging Values": "قيم التصحيح", + "Deselect All": "الغاء تحديد الكل", + "Done Reordering": "تمت إعادة الترتيب", + "Filters": "المرشحات", + "not_applicable": "N/A", + "No": "لا", + "No items found. Try to broaden your search.": "لم يتم العثور على العناصر. حاول توسيع نطاق البحث.", + "of": "ل", + "Remove filter option": "إزالة خيار التصفية", + "Remove sort option": "إزالة خيار الفرز", + "Reorder": "إعادة ترتيب", + "results": "نتائج", + "row": "صف", + "rows": "صفوف", + "rows, do you want to select all": "الصفوف ، هل تريد تحديد الكل", + "Search": "يبحث", + "Select All": "اختر الكل", + "Showing": "عرض", + "to": "ل", + "Yes": "نعم", + "You are currently selecting all": "أنت الآن تختار الكل", + "You are not connected to the internet.": "أنت غير متصل بالإنترنت.", + "You have selected": "قمت بتحديدها" +} \ No newline at end of file diff --git a/resources/lang/json/ca.json b/resources/lang/json/ca.json new file mode 100644 index 000000000..532ff38b3 --- /dev/null +++ b/resources/lang/json/ca.json @@ -0,0 +1,62 @@ +{ + "livewire-tables::All": "Tot", + "livewire-tables::All Columns": "Totes les columnes", + "livewire-tables::Applied Filters": "Filtres Aplicats", + "livewire-tables::Applied Sorting": "Ordenació Aplicada", + "livewire-tables::Bulk Actions": "Accions Massives", + "livewire-tables::Clear": "Esborra", + "livewire-tables::Columns": "Columnes", + "livewire-tables::Debugging Values": "Valors de depuració", + "livewire-tables::Deselect All": "Deselecciona tot", + "livewire-tables::Done Reordering": "Reordenació finalitzada", + "livewire-tables::Filters": "Filtres", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "No", + "livewire-tables::No items found. Try to broaden your search.": "No s'han trobat elements. Intenti ampliar la cerca.", + "livewire-tables::of": "de", + "livewire-tables::Remove filter option": "Elimina opció de filtre", + "livewire-tables::Remove sort option": "Elimina opció d'ordenació", + "livewire-tables::Reorder": "Reordena", + "livewire-tables::results": "resultats", + "livewire-tables::row": "fila", + "livewire-tables::rows": "files", + "livewire-tables::rows, do you want to select all": "files, vol seleccionar totes", + "livewire-tables::to": "a", + "livewire-tables::Search": "Cerca", + "livewire-tables::Select All": "Selecciona tot", + "livewire-tables::Showing": "Mostrant", + "livewire-tables::Yes": "Sí", + "livewire-tables::You are currently selecting all": "Actualment està seleccionant tot", + "livewire-tables::You are not connected to the internet.": "No està conectat a Internet.", + "livewire-tables::You have selected": "Ha seleccionat", + "All": "Tot", + "All Columns": "Totes les columnes", + "Applied Filters": "Filtres Aplicats", + "Applied Sorting": "Ordenació Aplicada", + "Bulk Actions": "Accions Massives", + "Clear": "Esborra", + "Columns": "Columnes", + "Debugging Values": "Valors de depuració", + "Deselect All": "Deselecciona tot", + "Done Reordering": "Reordenació finalitzada", + "Filters": "Filtres", + "not_applicable": "N/A", + "No": "No", + "No items found. Try to broaden your search.": "No s'han trobat elements. Intenti ampliar la cerca.", + "of": "de", + "Remove filter option": "Elimina opció de filtre", + "Remove sort option": "Elimina opció d'ordenació", + "Reorder": "Reordena", + "results": "resultats", + "row": "fila", + "rows": "files", + "rows, do you want to select all": "files, vol seleccionar totes", + "to": "a", + "Search": "Cerca", + "Select All": "Selecciona tot", + "Showing": "Mostrant", + "Yes": "Sí", + "You are currently selecting all": "Actualment està seleccionant tot", + "You are not connected to the internet.": "No està conectat a Internet.", + "You have selected": "Ha seleccionat" +} \ No newline at end of file diff --git a/resources/lang/json/da.json b/resources/lang/json/da.json new file mode 100644 index 000000000..0ce769f43 --- /dev/null +++ b/resources/lang/json/da.json @@ -0,0 +1,62 @@ +{ + "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::Clear": "Ryd", + "livewire-tables::Columns": "Kolonner", + "livewire-tables::Debugging Values": "Debugging-værdier", + "livewire-tables::Deselect All": "Fravælg alle", + "livewire-tables::Done Reordering": "Færdig med omorganisering", + "livewire-tables::Filters": "Filtre", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "Nej", + "livewire-tables::No items found. Try to broaden your search.": "Ingen elementer fundet. Prøv at udvide din søgning.", + "livewire-tables::of": "af", + "livewire-tables::Remove filter option": "Fjern filtermulighed", + "livewire-tables::Remove sort option": "Fjern sorteringsmulighed", + "livewire-tables::Reorder": "Omorganisér", + "livewire-tables::results": "resultater", + "livewire-tables::row": "række", + "livewire-tables::rows": "rækker", + "livewire-tables::rows, do you want to select all": "rækker, vil du vælge alle", + "livewire-tables::Search": "Søg", + "livewire-tables::Select All": "Vælg alle", + "livewire-tables::Showing": "Viser", + "livewire-tables::to": "til", + "livewire-tables::Yes": "Ja", + "livewire-tables::You are currently selecting all": "Du vælger i øjeblikket alle", + "livewire-tables::You are not connected to the internet.": "Du er ikke forbundet til internettet.", + "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", + "Clear": "Ryd", + "Columns": "Kolonner", + "Debugging Values": "Debugging-værdier", + "Deselect All": "Fravælg alle", + "Done Reordering": "Færdig med omorganisering", + "Filters": "Filtre", + "not_applicable": "N/A", + "No": "Nej", + "No items found. Try to broaden your search.": "Ingen elementer fundet. Prøv at udvide din søgning.", + "of": "af", + "Remove filter option": "Fjern filtermulighed", + "Remove sort option": "Fjern sorteringsmulighed", + "Reorder": "Omorganisér", + "results": "resultater", + "row": "række", + "rows": "rækker", + "rows, do you want to select all": "rækker, vil du vælge alle", + "Search": "Søg", + "Select All": "Vælg alle", + "Showing": "Viser", + "to": "til", + "Yes": "Ja", + "You are currently selecting all": "Du vælger i øjeblikket alle", + "You are not connected to the internet.": "Du er ikke forbundet til internettet.", + "You have selected": "Du har valgt" +} diff --git a/resources/lang/json/de.json b/resources/lang/json/de.json new file mode 100644 index 000000000..2ddfa94cc --- /dev/null +++ b/resources/lang/json/de.json @@ -0,0 +1,62 @@ +{ + "livewire-tables::All": "Alle", + "livewire-tables::All Columns": "Alle Spalten", + "livewire-tables::Applied Filters": "Angewendete Filter", + "livewire-tables::Applied Sorting": "Angewendete Sortierung", + "livewire-tables::Bulk Actions": "Aktionen", + "livewire-tables::Clear": "Zurücksetzen", + "livewire-tables::Columns": "Spalten", + "livewire-tables::Debugging Values": "Werte debuggen", + "livewire-tables::Deselect All": "Alle abwählen", + "livewire-tables::Done Reordering": "Sortieren abgeschlossen", + "livewire-tables::Filters": "Filter", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "Nein", + "livewire-tables::No items found. Try to broaden your search.": "Es gibt keine Ergebnisse/Einträge. Versuche die Suche zu erweitern.", + "livewire-tables::of": "von", + "livewire-tables::Remove filter option": "Entferne Filterauswahl", + "livewire-tables::Remove sort option": "Entferne Sortierauswahl", + "livewire-tables::Reorder": "erneut Sortieren", + "livewire-tables::results": "Ergebnisse", + "livewire-tables::row": "Zeile", + "livewire-tables::rows": "Zeilen", + "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::Showing": "Anzeigen", + "livewire-tables::to": "nach", + "livewire-tables::Yes": "Ja", + "livewire-tables::You are currently selecting all": "Es sind schon alle ausgewählt", + "livewire-tables::You are not connected to the internet.": "Es liegt keine Verbindung zum Internet vor.", + "livewire-tables::You have selected": "Es sind ausgewählt", + "All": "Alle", + "All Columns": "Alle Spalten", + "Applied Filters": "Angewendete Filter", + "Applied Sorting": "Angewendete Sortierung", + "Bulk Actions": "Aktionen", + "Clear": "Zurücksetzen", + "Columns": "Spalten", + "Debugging Values": "Werte debuggen", + "Deselect All": "Alle abwählen", + "Done Reordering": "Sortieren abgeschlossen", + "Filters": "Filter", + "not_applicable": "N/A", + "No": "Nein", + "No items found. Try to broaden your search.": "Es gibt keine Ergebnisse/Einträge. Versuche die Suche zu erweitern.", + "of": "von", + "Remove filter option": "Entferne Filterauswahl", + "Remove sort option": "Entferne Sortierauswahl", + "Reorder": "erneut Sortieren", + "results": "Ergebnisse", + "row": "Zeile", + "rows": "Zeilen", + "rows, do you want to select all": "Zeilen, sollen alle ausgewählt werden", + "Search": "Suche", + "Select All": "Alle auswählen", + "Showing": "Anzeigen", + "to": "nach", + "Yes": "Ja", + "You are currently selecting all": "Es sind schon alle ausgewählt", + "You are not connected to the internet.": "Es liegt keine Verbindung zum Internet vor.", + "You have selected": "Es sind ausgewählt" +} \ No newline at end of file diff --git a/resources/lang/json/en.json b/resources/lang/json/en.json new file mode 100644 index 000000000..1579cbbe2 --- /dev/null +++ b/resources/lang/json/en.json @@ -0,0 +1,72 @@ +{ + "livewire-tables::All": "All", + "livewire-tables::All Columns": "All Columns", + "livewire-tables::Applied Filters": "Applied Filters", + "livewire-tables::Applied Sorting": "Applied Sorting", + "livewire-tables::Bulk Actions": "Bulk Actions", + "livewire-tables::Bulk Actions Confirm": "Are you sure?", + "livewire-tables::Clear": "Clear", + "livewire-tables::Columns": "Columns", + "livewire-tables::Debugging Values": "Debugging Values", + "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", + "livewire-tables::No": "No", + "livewire-tables::No items found. Try to broaden your search.": "No items found. Try to broaden your search.", + "livewire-tables::of": "of", + "livewire-tables::Remove filter option": "Remove filter option", + "livewire-tables::Remove sort option": "Remove sort option", + "livewire-tables::Reorder": "Reorder", + "livewire-tables::results": "results", + "livewire-tables::row": "row", + "livewire-tables::rows": "rows", + "livewire-tables::rows, do you want to select all": "rows, do you want to select all", + "livewire-tables::Search": "Search", + "livewire-tables::Select All": "Select All", + "livewire-tables::Select All On Page": "Select All On Page", + "livewire-tables::Showing": "Showing", + "livewire-tables::to": "to", + "livewire-tables::Yes": "Yes", + "livewire-tables::You are currently selecting all": "You are currently selecting all", + "livewire-tables::You are not connected to the internet.": "You are not connected to the internet.", + "livewire-tables::You have selected": "You have selected", + "All": "All", + "All Columns": "All Columns", + "Applied Filters": "Applied Filters", + "Applied Sorting": "Applied Sorting", + "Bulk Actions": "Bulk Actions", + "Bulk Actions Confirm": "Are you sure?", + "Clear": "Clear", + "Columns": "Columns", + "Debugging Values": "Debugging Values", + "Deselect All": "Deselect All", + "Done Reordering": "Done Reordering", + "Filters": "Filters", + "loading": "Loading", + "max": "Max", + "min": "Min", + "not_applicable": "N/A", + "No": "No", + "No items found. Try to broaden your search.": "No items found. Try to broaden your search.", + "of": "of", + "Remove filter option": "Remove filter option", + "Remove sort option": "Remove sort option", + "Reorder": "Reorder", + "results": "results", + "row": "row", + "rows": "rows", + "rows, do you want to select all": "rows, do you want to select all", + "Search": "Search", + "Select All": "Select All", + "Select All On Page": "Select All On Page", + "Showing": "Showing", + "to": "to", + "Yes": "Yes", + "You are currently selecting all": "You are currently selecting all", + "You are not connected to the internet.": "You are not connected to the internet.", + "You have selected": "You have selected" +} diff --git a/resources/lang/json/es.json b/resources/lang/json/es.json new file mode 100644 index 000000000..b03b2e25f --- /dev/null +++ b/resources/lang/json/es.json @@ -0,0 +1,64 @@ +{ + "livewire-tables::All": "Todo", + "livewire-tables::All Columns": "Todas las columnas", + "livewire-tables::Applied Filters": "Filtros Aplicados", + "livewire-tables::Applied Sorting": "Ordenamiento Aplicado", + "livewire-tables::Bulk Actions": "Acciones Masivas", + "livewire-tables::Clear": "Borrar", + "livewire-tables::Columns": "Columnas", + "livewire-tables::Debugging Values": "Valores de depuración", + "livewire-tables::Deselect All": "Deseleccionar todo", + "livewire-tables::Done Reordering": "Reordenación finalizada", + "livewire-tables::Filters": "Filtros", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "No", + "livewire-tables::No items found. Try to broaden your search.": "No se encontraron elementos. Intente ampliar la búsqueda.", + "livewire-tables::of": "de", + "livewire-tables::Remove filter option": "Remover opción de filtro", + "livewire-tables::Remove sort option": "Remover opción de ordenamineto", + "livewire-tables::Reorder": "Reordenar", + "livewire-tables::results": "resultados", + "livewire-tables::row": "fila", + "livewire-tables::rows": "filas", + "livewire-tables::rows, do you want to select all": "filas, desea seleccionar todas", + "livewire-tables::Search": "Buscar", + "livewire-tables::Select All": "Seleccionar todo", + "livewire-tables::Select All On Page": "Seleccionar todo en la página", + "livewire-tables::Showing": "Mostrando", + "livewire-tables::to": "a", + "livewire-tables::Yes": "Sí", + "livewire-tables::You are currently selecting all": "Actualmente está seleccionando todo", + "livewire-tables::You are not connected to the internet.": "No está conectado a Internet.", + "livewire-tables::You have selected": "Ha seleccionado", + "All": "Todo", + "All Columns": "Todas las columnas", + "Applied Filters": "Filtros Aplicados", + "Applied Sorting": "Ordenamiento Aplicado", + "Bulk Actions": "Acciones Masivas", + "Clear": "Borrar", + "Columns": "Columnas", + "Debugging Values": "Valores de depuración", + "Deselect All": "Deseleccionar todo", + "Done Reordering": "Reordenación finalizada", + "Filters": "Filtros", + "not_applicable": "N/A", + "No": "No", + "No items found. Try to broaden your search.": "No se encontraron elementos. Intente ampliar la búsqueda.", + "of": "de", + "Remove filter option": "Remover opción de filtro", + "Remove sort option": "Remover opción de ordenamineto", + "Reorder": "Reordenar", + "results": "resultados", + "row": "fila", + "rows": "filas", + "rows, do you want to select all": "filas, desea seleccionar todas", + "Search": "Buscar", + "Select All": "Seleccionar todo", + "Select All On Page": "Seleccionar todo en la página", + "Showing": "Mostrando", + "to": "a", + "Yes": "Sí", + "You are currently selecting all": "Actualmente está seleccionando todo", + "You are not connected to the internet.": "No está conectado a Internet.", + "You have selected": "Ha seleccionado" +} \ No newline at end of file diff --git a/resources/lang/json/fa.json b/resources/lang/json/fa.json new file mode 100644 index 000000000..7bcf32940 --- /dev/null +++ b/resources/lang/json/fa.json @@ -0,0 +1,72 @@ +{ + "livewire-tables::All": "همه", + "livewire-tables::All Columns": "تمام ستون‌ها", + "livewire-tables::Applied Filters": "فیلترهای اعمال‌شده", + "livewire-tables::Applied Sorting": "مرتب‌سازی اعمال‌شده", + "livewire-tables::Bulk Actions": "اقدامات گروهی", + "livewire-tables::Bulk Actions Confirm": "آیا مطمئن هستید؟", + "livewire-tables::Clear": "پاک کردن", + "livewire-tables::Columns": "ستون‌ها", + "livewire-tables::Debugging Values": "مقادیر اشکال‌زدایی", + "livewire-tables::Deselect All": "لغو انتخاب همه", + "livewire-tables::Done Reordering": "مرتب‌سازی تمام شد", + "livewire-tables::Filters": "فیلترها", + "livewire-tables::loading": "در حال بارگذاری", + "livewire-tables::max": "حداکثر", + "livewire-tables::min": "حداقل", + "livewire-tables::not_applicable": "نامعتبر", + "livewire-tables::No": "خیر", + "livewire-tables::No items found. Try to broaden your search.": "موردی یافت نشد. جستجوی خود را گسترش دهید.", + "livewire-tables::of": "از", + "livewire-tables::Remove filter option": "حذف گزینه فیلتر", + "livewire-tables::Remove sort option": "حذف گزینه مرتب‌سازی", + "livewire-tables::Reorder": "دوباره مرتب کنید", + "livewire-tables::results": "نتایج", + "livewire-tables::row": "ردیف", + "livewire-tables::rows": "ردیف‌ها", + "livewire-tables::rows, do you want to select all": "ردیف‌ها، آیا می‌خواهید همه را انتخاب کنید", + "livewire-tables::Search": "جستجو", + "livewire-tables::Select All": "انتخاب همه", + "livewire-tables::Select All On Page": "انتخاب همه در صفحه", + "livewire-tables::Showing": "در حال نمایش", + "livewire-tables::to": "تا", + "livewire-tables::Yes": "بله", + "livewire-tables::You are currently selecting all": "شما در حال حاضر همه را انتخاب کرده‌اید", + "livewire-tables::You are not connected to the internet.": "شما به اینترنت متصل نیستید.", + "livewire-tables::You have selected": "شما انتخاب کرده‌اید", + "All": "همه", + "All Columns": "تمام ستون‌ها", + "Applied Filters": "فیلترهای اعمال‌شده", + "Applied Sorting": "مرتب‌سازی اعمال‌شده", + "Bulk Actions": "اقدامات گروهی", + "Bulk Actions Confirm": "آیا مطمئن هستید؟", + "Clear": "پاک کردن", + "Columns": "ستون‌ها", + "Debugging Values": "مقادیر اشکال‌زدایی", + "Deselect All": "لغو انتخاب همه", + "Done Reordering": "مرتب‌سازی تمام شد", + "Filters": "فیلترها", + "loading": "در حال بارگذاری", + "max": "حداکثر", + "min": "حداقل", + "not_applicable": "نامعتبر", + "No": "خیر", + "No items found. Try to broaden your search.": "موردی یافت نشد. جستجوی خود را گسترش دهید.", + "of": "از", + "Remove filter option": "حذف گزینه فیلتر", + "Remove sort option": "حذف گزینه مرتب‌سازی", + "Reorder": "دوباره مرتب کنید", + "results": "نتایج", + "row": "ردیف", + "rows": "ردیف‌ها", + "rows, do you want to select all": "ردیف‌ها، آیا می‌خواهید همه را انتخاب کنید", + "Search": "جستجو", + "Select All": "انتخاب همه", + "Select All On Page": "انتخاب همه در صفحه", + "Showing": "در حال نمایش", + "to": "تا", + "Yes": "بله", + "You are currently selecting all": "شما در حال حاضر همه را انتخاب کرده‌اید", + "You are not connected to the internet.": "شما به اینترنت متصل نیستید.", + "You have selected": "شما انتخاب کرده‌اید" +} \ No newline at end of file diff --git a/resources/lang/json/fr.json b/resources/lang/json/fr.json new file mode 100644 index 000000000..89323dc4a --- /dev/null +++ b/resources/lang/json/fr.json @@ -0,0 +1,62 @@ +{ + "livewire-tables::All": "Tous", + "livewire-tables::All Columns": "Toutes les colonnes", + "livewire-tables::Applied Filters": "Filtres appliqués", + "livewire-tables::Applied Sorting": "Tris appliqués", + "livewire-tables::Bulk Actions": "Actions en masse", + "livewire-tables::Clear": "Effacer", + "livewire-tables::Columns": "Colonnes", + "livewire-tables::Debugging Values": "Valeurs de débogage", + "livewire-tables::Deselect All": "Tout désélectionner ", + "livewire-tables::Done Reordering": "Réordonnancement terminé", + "livewire-tables::Filters": "Filtres", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "Non", + "livewire-tables::No items found. Try to broaden your search.": "Aucun élément trouvé. Essayez d'élargir votre recherche.", + "livewire-tables::of": "sur", + "livewire-tables::Remove filter option": "Supprimer l'option de filtrage", + "livewire-tables::Remove sort option": "Supprimer l'option de tri", + "livewire-tables::Reorder": "Réordonner", + "livewire-tables::results": "résultats", + "livewire-tables::row": "ligne", + "livewire-tables::rows": "lignes", + "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::to": "à", + "livewire-tables::Yes": "Oui", + "livewire-tables::You are currently selecting all": "Vous êtes en train de sélectionner ", + "livewire-tables::You are not connected to the internet.": "Vous n'êtes pas connecté à l'Internet.", + "livewire-tables::You have selected": "Vous avez sélectionné", + "All": "Tous", + "All Columns": "Toutes les colonnes", + "Applied Filters": "Filtres appliqués", + "Applied Sorting": "Tris appliqués", + "Bulk Actions": "Actions en masse", + "Clear": "Effacer", + "Columns": "Colonnes", + "Debugging Values": "Valeurs de débogage", + "Deselect All": "Tout désélectionner ", + "Done Reordering": "Réordonnancement terminé", + "Filters": "Filtres", + "not_applicable": "N/A", + "No": "Non", + "No items found. Try to broaden your search.": "Aucun élément trouvé. Essayez d'élargir votre recherche.", + "of": "sur", + "Remove filter option": "Supprimer l'option de filtrage", + "Remove sort option": "Supprimer l'option de tri", + "Reorder": "Réordonner", + "results": "résultats", + "row": "ligne", + "rows": "lignes", + "rows, do you want to select all": "lignes, voulez-vous tout sélectionner ?", + "Search": "Rechercher", + "Select All": "Tout sélectionner", + "Showing": "Montrant", + "to": "à", + "Yes": "Oui", + "You are currently selecting all": "Vous êtes en train de sélectionner ", + "You are not connected to the internet.": "Vous n'êtes pas connecté à l'Internet.", + "You have selected": "Vous avez sélectionné" +} \ No newline at end of file diff --git a/resources/lang/json/id.json b/resources/lang/json/id.json new file mode 100644 index 000000000..06a9f38cf --- /dev/null +++ b/resources/lang/json/id.json @@ -0,0 +1,63 @@ +{ + "livewire-tables::All": "Semua", + "livewire-tables::All Columns": "Semua Kolom", + "livewire-tables::Applied Filters": "Filter Diterapkan", + "livewire-tables::Applied Sorting": "Penyortiran Diterapkan", + "livewire-tables::Bulk Actions": "Aksi", + "livewire-tables::Clear": "Bersihkan", + "livewire-tables::Columns": "Kolom", + "livewire-tables::Debugging Values": "Nilai Debug", + "livewire-tables::Deselect All": "Batalkan Semua Pilihan", + "livewire-tables::Done Reordering": "Selesai Mengurutkan Ulang", + "livewire-tables::Filters": "Filter", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "Tidak", + "livewire-tables::No items found. Try to broaden your search.": "Tidak ada data yang ditemukan. Cobalah untuk memperluas pencarian Anda.", + "livewire-tables::of": "dari", + "livewire-tables::Remove filter option": "Hapus opsi filter", + "livewire-tables::Remove sort option": "Hapus opsi pengurutan", + "livewire-tables::Reorder": "Urutkan ulang", + "livewire-tables::results": "hasil", + "livewire-tables::row": "baris", + "livewire-tables::rows": "baris", + "livewire-tables::rows, do you want to select all": "baris, apakah Anda ingin memilih semua?", + "livewire-tables::Search": "Cari", + "livewire-tables::Select All": "Pilih Semua", + "livewire-tables::Showing": "Menampilkan", + "livewire-tables::to": "ke", + "livewire-tables::Yes": "Ya", + "livewire-tables::You are currently selecting all": "Anda sedang memilih semua", + "livewire-tables::You are not connected to the internet.": "Anda sedang tidak terhubung ke internet.", + "livewire-tables::You have selected": "Anda telah memilih", + "All": "Semua", + "All Columns": "Semua Kolom", + "Applied Filters": "Filter Diterapkan", + "Applied Sorting": "Penyortiran Diterapkan", + "Bulk Actions": "Aksi", + "Clear": "Bersihkan", + "Columns": "Kolom", + "Debugging Values": "Nilai Debug", + "Deselect All": "Batalkan Semua Pilihan", + "Done Reordering": "Selesai Mengurutkan Ulang", + "Filters": "Filter", + "not_applicable": "N/A", + "No": "Tidak", + "No items found. Try to broaden your search.": "Tidak ada data yang ditemukan. Cobalah untuk memperluas pencarian Anda.", + "of": "dari", + "Remove filter option": "Hapus opsi filter", + "Remove sort option": "Hapus opsi pengurutan", + "Reorder": "Urutkan ulang", + "results": "hasil", + "row": "baris", + "rows": "baris", + "rows, do you want to select all": "baris, apakah Anda ingin memilih semua?", + "Search": "Cari", + "Select All": "Pilih Semua", + "Showing": "Menampilkan", + "to": "ke", + "Yes": "Ya", + "You are currently selecting all": "Anda sedang memilih semua", + "You are not connected to the internet.": "Anda sedang tidak terhubung ke internet.", + "You have selected": "Anda telah memilih" + +} \ No newline at end of file diff --git a/resources/lang/json/it.json b/resources/lang/json/it.json new file mode 100644 index 000000000..a1c50fb21 --- /dev/null +++ b/resources/lang/json/it.json @@ -0,0 +1,63 @@ +{ + "livewire-tables::All": "Tutti", + "livewire-tables::All Columns": "Tutte le colonne", + "livewire-tables::Applied Filters": "Filtri Applicati", + "livewire-tables::Applied Sorting": "Ordinamento Applicato", + "livewire-tables::Bulk Actions": "Azioni di Gruppo", + "livewire-tables::Clear": "Pulisci", + "livewire-tables::Columns": "Colonne", + "livewire-tables::Debugging Values": "Valori di debug", + "livewire-tables::Deselect All": "Deseleziona tutto", + "livewire-tables::Done Reordering": "Ordinamento Terminato", + "livewire-tables::Filters": "Filtri", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "No", + "livewire-tables::No items found. Try to broaden your search.": "Nessun risultato trovato. Prova ad ampliare la tua ricerca.", + "livewire-tables::of": "di", + "livewire-tables::Remove filter option": "Rimuovi filtro", + "livewire-tables::Remove sort option": "Rimuovi ordinamento", + "livewire-tables::Reorder": "Riordina", + "livewire-tables::results": "risultati", + "livewire-tables::row": "righe", + "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::Showing": "Visualizzati", + "livewire-tables::to": "a", + "livewire-tables::Yes": "SÌ", + "livewire-tables::You are currently selecting all": "Stai selezionando tutto", + "livewire-tables::You are not connected to the internet.": "Non sei connesso a internet", + "livewire-tables::You have selected": "Hai selezionato", + "All": "Tutti", + "All Columns": "Tutte le colonne", + "Applied Filters": "Filtri Applicati", + "Applied Sorting": "Ordinamento Applicato", + "Bulk Actions": "Azioni di Gruppo", + "Clear": "Pulisci", + "Columns": "Colonne", + "Debugging Values": "Valori di debug", + "Deselect All": "Deseleziona tutto", + "Done Reordering": "Ordinamento Terminato", + "Filters": "Filtri", + "not_applicable": "N/A", + "No": "No", + "No items found. Try to broaden your search.": "Nessun risultato trovato. Prova ad ampliare la tua ricerca.", + "of": "di", + "Remove filter option": "Rimuovi filtro", + "Remove sort option": "Rimuovi ordinamento", + "Reorder": "Riordina", + "results": "risultati", + "row": "righe", + "rows": "righe", + "rows, do you want to select all": "righe, vuoi selezionarle tutte", + "Search": "Cerca", + "Select All": "Seleziona Tutto", + "Showing": "Visualizzati", + "to": "a", + "Yes": "SÌ", + "You are currently selecting all": "Stai selezionando tutto", + "You are not connected to the internet.": "Non sei connesso a internet", + "You have selected": "Hai selezionato" + +} \ No newline at end of file diff --git a/resources/lang/json/ms.json b/resources/lang/json/ms.json new file mode 100644 index 000000000..e7e725fa7 --- /dev/null +++ b/resources/lang/json/ms.json @@ -0,0 +1,62 @@ +{ + "livewire-tables::All": "Semua", + "livewire-tables::All Columns": "Semua Lajur", + "livewire-tables::Applied Filters": "Tapisan Digunakan", + "livewire-tables::Applied Sorting": "Susunan Digunakan", + "livewire-tables::Bulk Actions": "Tindakan Pukal", + "livewire-tables::Clear": "Kosongkan", + "livewire-tables::Columns": "Kolum", + "livewire-tables::Debugging Values": "Menyahpepijat Nilai", + "livewire-tables::Deselect All": "Nyahpilih semua", + "livewire-tables::Done Reordering": "Selesai Menyusun Semula", + "livewire-tables::Filters": "Tapisan", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "Tidak", + "livewire-tables::No items found. Try to broaden your search.": "Tiada data ditemui. Sila perluaskan carian anda", + "livewire-tables::of": "daripada", + "livewire-tables::Remove filter option": "Keluarkan pilihan tapisan", + "livewire-tables::Remove sort option": "Keluarkan pilihan sususan", + "livewire-tables::Reorder": "menyusun semula", + "livewire-tables::results": "keputusan", + "livewire-tables::row": "barisan", + "livewire-tables::rows": "barisan", + "livewire-tables::rows, do you want to select all": "barisan, adakah anda mahu pilih semua?", + "livewire-tables::Search": "Carian", + "livewire-tables::Select All": "Pilih Semua", + "livewire-tables::Showing": "Menunjukkan", + "livewire-tables::to": "ke", + "livewire-tables::Yes": "ya", + "livewire-tables::You are currently selecting all": "Anda sedang memilih semua", + "livewire-tables::You are not connected to the internet.": "Anda tidak disambungkan ke internet.", + "livewire-tables::You have selected": "Anda telah memilih", + "All": "Semua", + "All Columns": "Semua Lajur", + "Applied Filters": "Tapisan Digunakan", + "Applied Sorting": "Susunan Digunakan", + "Bulk Actions": "Tindakan Pukal", + "Clear": "Kosongkan", + "Columns": "Kolum", + "Debugging Values": "Menyahpepijat Nilai", + "Deselect All": "Nyahpilih semua", + "Done Reordering": "Selesai Menyusun Semula", + "Filters": "Tapisan", + "not_applicable": "N/A", + "No": "Tidak", + "No items found. Try to broaden your search.": "Tiada data ditemui. Sila perluaskan carian anda", + "of": "daripada", + "Remove filter option": "Keluarkan pilihan tapisan", + "Remove sort option": "Keluarkan pilihan sususan", + "Reorder": "menyusun semula", + "results": "keputusan", + "row": "barisan", + "rows": "barisan", + "rows, do you want to select all": "barisan, adakah anda mahu pilih semua?", + "Search": "Carian", + "Select All": "Pilih Semua", + "Showing": "Menunjukkan", + "to": "ke", + "Yes": "ya", + "You are currently selecting all": "Anda sedang memilih semua", + "You are not connected to the internet.": "Anda tidak disambungkan ke internet.", + "You have selected": "Anda telah memilih" +} \ No newline at end of file diff --git a/resources/lang/json/nl.json b/resources/lang/json/nl.json new file mode 100644 index 000000000..a6223018c --- /dev/null +++ b/resources/lang/json/nl.json @@ -0,0 +1,66 @@ +{ + "livewire-tables::All": "Alle", + "livewire-tables::All Columns": "Alle kolommen", + "livewire-tables::Applied Filters": "Toegepaste filters", + "livewire-tables::Applied Sorting": "Toegepaste sortering", + "livewire-tables::Bulk Actions": "Bulkacties", + "livewire-tables::Bulk Actions Confirm": "Weet u het zeker?", + "livewire-tables::Clear": "Wissen", + "livewire-tables::Columns": "Kolommen", + "livewire-tables::Debugging Values": "Debugging waarden", + "livewire-tables::Deselect All": "Alles deselecteren", + "livewire-tables::Done Reordering": "Hersortering voltooid", + "livewire-tables::Filters": "Filters", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "Nee", + "livewire-tables::No items found. Try to broaden your search.": "Er zijn geen items gevonden. Probeer uw zoekopdracht te verfijnen.", + "livewire-tables::of": "van", + "livewire-tables::Remove filter option": "Filteroptie verwijderen", + "livewire-tables::Remove sort option": "Sorteeroptie verwijderen", + "livewire-tables::Reorder": "Hersorteren", + "livewire-tables::results": "resultaten", + "livewire-tables::row": "rij", + "livewire-tables::rows": "rijen", + "livewire-tables::rows, do you want to select all": "rijen, wilt u alles selecteren", + "livewire-tables::Search": "Zoeken", + "livewire-tables::Select All": "Alles selecteren", + "livewire-tables::Showing": "Toont", + "livewire-tables::to": "tot", + "livewire-tables::Yes": "Ja", + "livewire-tables::You are currently selecting all": "Huidig heeft u alles geselecteerd", + "livewire-tables::You are not connected to the internet.": "U bent niet verbonden met het internet.", + "livewire-tables::You have selected": "U selecteerde", + "livewire-tables::Select All On Page": "Alles op deze pagina selecteren", + "All": "Alle", + "All Columns": "Alle kolommen", + "Applied Filters": "Toegepaste filters", + "Applied Sorting": "Toegepaste sortering", + "Bulk Actions": "Bulkacties", + "Bulk Actions Confirm": "Weet u het zeker?", + "Clear": "Wissen", + "Columns": "Kolommen", + "Debugging Values": "Debugging waarden", + "Deselect All": "Alles deselecteren", + "Done Reordering": "Hersortering voltooid", + "Filters": "Filters", + "not_applicable": "N/A", + "No": "Nee", + "No items found. Try to broaden your search.": "Er zijn geen items gevonden. Probeer uw zoekopdracht te verfijnen.", + "of": "van", + "Remove filter option": "Filteroptie verwijderen", + "Remove sort option": "Sorteeroptie verwijderen", + "Reorder": "Hersorteren", + "results": "resultaten", + "row": "rij", + "rows": "rijen", + "rows, do you want to select all": "rijen, wilt u alles selecteren", + "Search": "Zoeken", + "Select All": "Alles selecteren", + "Showing": "Toont", + "to": "tot", + "Yes": "Ja", + "You are currently selecting all": "Huidig heeft u alles geselecteerd", + "You are not connected to the internet.": "U bent niet verbonden met het internet.", + "You have selected": "U selecteerde", + "Select All On Page": "Alles op deze pagina selecteren" +} diff --git a/resources/lang/json/pl.json b/resources/lang/json/pl.json new file mode 100644 index 000000000..12469dc82 --- /dev/null +++ b/resources/lang/json/pl.json @@ -0,0 +1,66 @@ +{ + "livewire-tables::All": "Wszystko", + "livewire-tables::All Columns": "Wszystkie kolumny", + "livewire-tables::Applied Filters": "Użyte filtry", + "livewire-tables::Applied Sorting": "Użyte sortowanie", + "livewire-tables::Bulk Actions": "Akcje zbiorowe", + "livewire-tables::Bulk Actions Confirm": "Czy zastosować ?", + "livewire-tables::Clear": "Wyczyść", + "livewire-tables::Columns": "Kolumny", + "livewire-tables::Debugging Values": "Wartości debugowania", + "livewire-tables::Deselect All": "Odznacz wszystko", + "livewire-tables::Done Reordering": "Done Reordering", + "livewire-tables::Filters": "Filtry", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "Nie", + "livewire-tables::No items found. Try to broaden your search.": "Brak rezultatów do wyświetlenia.", + "livewire-tables::of": "z", + "livewire-tables::Remove filter option": "Usuń opcję filtra", + "livewire-tables::Remove sort option": "Usuń opcję sortowania", + "livewire-tables::Reorder": "Zmień kolejność", + "livewire-tables::results": "wyniki", + "livewire-tables::row": "wiersz", + "livewire-tables::rows": "wiersze", + "livewire-tables::rows, do you want to select all": "czy chcesz zaznaczyć wszystkie wiersze", + "livewire-tables::Search": "Szukaj", + "livewire-tables::Select All": "Zaznacz wszystko", + "livewire-tables::Select All On Page": "Zaznacz wszystko na stronie", + "livewire-tables::Showing": "Pokazywanie", + "livewire-tables::to": "do", + "livewire-tables::Yes": "Tak", + "livewire-tables::You are currently selecting all": "Aktualnie masz wszystko zaznaczone", + "livewire-tables::You are not connected to the internet.": "Brak połączenia z internetem.", + "livewire-tables::You have selected": "Masz wybrane", + "All": "Wszystko", + "All Columns": "Wszystkie kolumny", + "Applied Filters": "Użyte filtry", + "Applied Sorting": "Użyte sortowanie", + "Bulk Actions": "Akcje zbiorowe", + "Bulk Actions Confirm": "Czy zastosować ?", + "Clear": "Wyczyść", + "Columns": "Kolumny", + "Debugging Values": "Wartości debugowania", + "Deselect All": "Odznacz wszystko", + "Done Reordering": "Done Reordering", + "Filters": "Filtry", + "not_applicable": "N/A", + "No": "Nie", + "No items found. Try to broaden your search.": "Brak rezultatów do wyświetlenia.", + "of": "z", + "Remove filter option": "Usuń opcję filtra", + "Remove sort option": "Usuń opcję sortowania", + "Reorder": "Zmień kolejność", + "results": "wyniki", + "row": "wiersz", + "rows": "wiersze", + "rows, do you want to select all": "czy chcesz zaznaczyć wszystkie wiersze", + "Search": "Szukaj", + "Select All": "Zaznacz wszystko", + "Select All On Page": "Zaznacz wszystko na stronie", + "Showing": "Pokazywanie", + "to": "do", + "Yes": "Tak", + "You are currently selecting all": "Aktualnie masz wszystko zaznaczone", + "You are not connected to the internet.": "Brak połączenia z internetem.", + "You have selected": "Masz wybrane" +} \ No newline at end of file diff --git a/resources/lang/json/pt.json b/resources/lang/json/pt.json new file mode 100644 index 000000000..f38578da1 --- /dev/null +++ b/resources/lang/json/pt.json @@ -0,0 +1,64 @@ +{ + "livewire-tables::All": "Tudo", + "livewire-tables::All Columns": "Todas as colunas", + "livewire-tables::Applied Filters": "Filtros Aplicados", + "livewire-tables::Applied Sorting": "Ordenação Aplicada", + "livewire-tables::Bulk Actions": "Ações Massivas", + "livewire-tables::Clear": "Limpar", + "livewire-tables::Columns": "Colunas", + "livewire-tables::Debugging Values": "Valores de depuração", + "livewire-tables::Deselect All": "Desmarcar Tudo", + "livewire-tables::Done Reordering": "Ordeanação finalizada", + "livewire-tables::Filters": "Filtros", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "Não", + "livewire-tables::No items found. Try to broaden your search.": "Nenhum resultado encontrado. Tente ampliar a sua pesquisa.", + "livewire-tables::of": "de", + "livewire-tables::Remove filter option": "Remover opção de filtro", + "livewire-tables::Remove sort option": "Remover opção de ordenação", + "livewire-tables::Reorder": "Reordenar", + "livewire-tables::results": "resultados", + "livewire-tables::row": "linha", + "livewire-tables::rows": "linhas", + "livewire-tables::rows, do you want to select all": "linhas, pretende selecionar tudo", + "livewire-tables::Search": "Pesquisar", + "livewire-tables::Select All": "Seleccionar Tudo", + "livewire-tables::Select All On Page": "Selecione tudo na página", + "livewire-tables::Showing": "A mostrar", + "livewire-tables::to": "a", + "livewire-tables::Yes": "Sim", + "livewire-tables::You are currently selecting all": "Atualmente está a selecionar tudo", + "livewire-tables::You are not connected to the internet.": "Não está ligado à internet.", + "livewire-tables::You have selected": "Selecionou", + "All": "Tudo", + "All Columns": "Todas as colunas", + "Applied Filters": "Filtros Aplicados", + "Applied Sorting": "Ordenação Aplicada", + "Bulk Actions": "Ações Massivas", + "Clear": "Limpar", + "Columns": "Colunas", + "Debugging Values": "Valores de depuração", + "Deselect All": "Desmarcar Tudo", + "Done Reordering": "Ordeanação finalizada", + "Filters": "Filtros", + "not_applicable": "N/A", + "No": "Não", + "No items found. Try to broaden your search.": "Nenhum resultado encontrado. Tente ampliar a sua pesquisa.", + "of": "de", + "Remove filter option": "Remover opção de filtro", + "Remove sort option": "Remover opção de ordenação", + "Reorder": "Reordenar", + "results": "resultados", + "row": "linha", + "rows": "linhas", + "rows, do you want to select all": "linhas, pretende selecionar tudo", + "Search": "Pesquisar", + "Select All": "Seleccionar Tudo", + "Select All On Page": "Selecione tudo na página", + "Showing": "A mostrar", + "to": "a", + "Yes": "Sim", + "You are currently selecting all": "Atualmente está a selecionar tudo", + "You are not connected to the internet.": "Não está ligado à internet.", + "You have selected": "Selecionou" +} \ No newline at end of file diff --git a/resources/lang/json/pt_BR.json b/resources/lang/json/pt_BR.json new file mode 100644 index 000000000..09a0e2906 --- /dev/null +++ b/resources/lang/json/pt_BR.json @@ -0,0 +1,66 @@ +{ + "livewire-tables::All": "Tudo", + "livewire-tables::All Columns": "Todas as colunas", + "livewire-tables::Applied Filters": "Filtros aplicados", + "livewire-tables::Applied Sorting": "Ordenação aplicada", + "livewire-tables::Bulk Actions": "Ações em massa", + "livewire-tables::Bulk Actions Confirm": "Tem certeza", + "livewire-tables::Clear": "Limpar", + "livewire-tables::Columns": "Colunas", + "livewire-tables::Debugging Values": "Valores de depuração", + "livewire-tables::Deselect All": "Desmarcar Tudo", + "livewire-tables::Done Reordering": "Ordenação finalizada", + "livewire-tables::Filters": "Filtros", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "Não", + "livewire-tables::No items found. Try to broaden your search.": "Nenhum resultado encontrado. Tente ampliar a sua pesquisa.", + "livewire-tables::of": "de", + "livewire-tables::Reorder": "Reordenar", + "livewire-tables::results": "resultados", + "livewire-tables::Remove filter option": "Remover opção de filtro", + "livewire-tables::Remove sort option": "Remover opção de ordenação", + "livewire-tables::row": "linha", + "livewire-tables::rows": "linhas", + "livewire-tables::rows, do you want to select all": "linhas, você deseja selecionar tudo?", + "livewire-tables::Search": "Pesquisar", + "livewire-tables::Select All": "Selecionar tudo", + "livewire-tables::Select All On Page": "Selecione tudo na página", + "livewire-tables::Showing": "Exibindo", + "livewire-tables::to": "a", + "livewire-tables::Yes": "Sim", + "livewire-tables::You are currently selecting all": "Você selecionou tudo", + "livewire-tables::You are not connected to the internet.": "Você não está conectado na internet.", + "livewire-tables::You have selected": "Você selecionou", + "All": "Tudo", + "All Columns": "Todas as colunas", + "Applied Filters": "Filtros aplicados", + "Applied Sorting": "Ordenação aplicada", + "Bulk Actions": "Ações em massa", + "Bulk Actions Confirm": "Tem certeza", + "Clear": "Limpar", + "Columns": "Colunas", + "Debugging Values": "Valores de depuração", + "Deselect All": "Desmarcar Tudo", + "Done Reordering": "Ordenação finalizada", + "Filters": "Filtros", + "not_applicable": "N/A", + "No": "Não", + "No items found. Try to broaden your search.": "Nenhum resultado encontrado. Tente ampliar a sua pesquisa.", + "of": "de", + "Reorder": "Reordenar", + "results": "resultados", + "Remove filter option": "Remover opção de filtro", + "Remove sort option": "Remover opção de ordenação", + "row": "linha", + "rows": "linhas", + "rows, do you want to select all": "linhas, você deseja selecionar tudo?", + "Search": "Pesquisar", + "Select All": "Selecionar tudo", + "Select All On Page": "Selecione tudo na página", + "Showing": "Exibindo", + "to": "a", + "Yes": "Sim", + "You are currently selecting all": "Você selecionou tudo", + "You are not connected to the internet.": "Você não está conectado na internet.", + "You have selected": "Você selecionou" +} \ No newline at end of file diff --git a/resources/lang/json/ru.json b/resources/lang/json/ru.json new file mode 100644 index 000000000..53b9fbf1b --- /dev/null +++ b/resources/lang/json/ru.json @@ -0,0 +1,62 @@ +{ + "livewire-tables::All": "Все", + "livewire-tables::All Columns": "Все столбцы", + "livewire-tables::Applied Filters": "Примененные фильтры", + "livewire-tables::Applied Sorting": "Примененная сортировка", + "livewire-tables::Bulk Actions": "Массовые действия", + "livewire-tables::Clear": "Очистить", + "livewire-tables::Columns": "Столбцы", + "livewire-tables::Debugging Values": "Отладочные значения", + "livewire-tables::Deselect All": "Снять выделение", + "livewire-tables::Done Reordering": "Сортировка выполнена", + "livewire-tables::Filters": "Фильтры", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "Нет", + "livewire-tables::No items found. Try to broaden your search.": "Ничего не найдено. Попробуйте расширить поиск.", + "livewire-tables::of": "из", + "livewire-tables::Remove filter option": "Удалить фильтр", + "livewire-tables::Remove sort option": "Удалить параметр сортировки", + "livewire-tables::Reorder": "Переупорядочить", + "livewire-tables::results": "результатов", + "livewire-tables::row": "ряды", + "livewire-tables::rows": "ряды", + "livewire-tables::rows, do you want to select all": "ряды, вы хотите выбрать все", + "livewire-tables::Search": "Поиск", + "livewire-tables::Select All": "Выбрать все", + "livewire-tables::Showing": "Показано с", + "livewire-tables::to": "к", + "livewire-tables::Yes": "Да", + "livewire-tables::You are currently selecting all": "Вы выбираете все", + "livewire-tables::You are not connected to the internet.": "Вы не подключены к Интернету", + "livewire-tables::You have selected": "Вы выбрали", + "All": "Все", + "All Columns": "Все столбцы", + "Applied Filters": "Примененные фильтры", + "Applied Sorting": "Примененная сортировка", + "Bulk Actions": "Массовые действия", + "Clear": "Очистить", + "Columns": "Столбцы", + "Debugging Values": "Отладочные значения", + "Deselect All": "Снять выделение", + "Done Reordering": "Сортировка выполнена", + "Filters": "Фильтры", + "not_applicable": "N/A", + "No": "Нет", + "No items found. Try to broaden your search.": "Ничего не найдено. Попробуйте расширить поиск.", + "of": "из", + "Remove filter option": "Удалить фильтр", + "Remove sort option": "Удалить параметр сортировки", + "Reorder": "Переупорядочить", + "results": "результатов", + "row": "ряды", + "rows": "ряды", + "rows, do you want to select all": "ряды, вы хотите выбрать все", + "Search": "Поиск", + "Select All": "Выбрать все", + "Showing": "Показано с", + "to": "к", + "Yes": "Да", + "You are currently selecting all": "Вы выбираете все", + "You are not connected to the internet.": "Вы не подключены к Интернету", + "You have selected": "Вы выбрали" +} \ No newline at end of file diff --git a/resources/lang/json/th.json b/resources/lang/json/th.json new file mode 100644 index 000000000..35c21b7fd --- /dev/null +++ b/resources/lang/json/th.json @@ -0,0 +1,66 @@ +{ + "livewire-tables::All": "ทั้งหมด", + "livewire-tables::All Columns": "คอลัมน์ทั้งหมด", + "livewire-tables::Applied Filters": "กรองข้อมูลตาม", + "livewire-tables::Applied Sorting": "เรียงลำดับตาม", + "livewire-tables::Bulk Actions": "เลือกการกระทำ", + "livewire-tables::Bulk Actions Confirm": "คุณแน่ใจ?", + "livewire-tables::Clear": "ล้างทั้งหมด", + "livewire-tables::Columns": "เลือกคอลัมน์", + "livewire-tables::Debugging Values": "ค่าการดีบัก", + "livewire-tables::Deselect All": "ไม่เลือกทั้งหมด", + "livewire-tables::Done Reordering": "จัดลำดับแล้ว", + "livewire-tables::Filters": "ตัวกรอง", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "เลขที่", + "livewire-tables::No items found. Try to broaden your search.": "ไม่พบรายการที่ค้นหา", + "livewire-tables::of": "จาก", + "livewire-tables::Remove filter option": "เอาตัวกรองออก", + "livewire-tables::Remove sort option": "เอาการเรียงลำดับออก", + "livewire-tables::Reorder": "จัดลำดับ", + "livewire-tables::results": "รายการ", + "livewire-tables::row": "รายการ", + "livewire-tables::rows": "รายการ", + "livewire-tables::rows, do you want to select all": "รายการ, คุณต้องการเลือกทั้งหมด", + "livewire-tables::Search": "ค้นหา...", + "livewire-tables::Select All": "เลือกทั้งหมด", + "livewire-tables::Select All On Page": "เลือกทั้งหมดบนหน้า", + "livewire-tables::Showing": "แสดง", + "livewire-tables::to": "-", + "livewire-tables::Yes": "ใช่", + "livewire-tables::You are currently selecting all": "ขณะนี้คุณได้เลือกทุกรายการ", + "livewire-tables::You are not connected to the internet.": "ขณะนี้คุณไม่ได้เชื่อมต่อกับอินเทอร์เน็ต", + "livewire-tables::You have selected": "คุณเลือก", + "All": "ทั้งหมด", + "All Columns": "คอลัมน์ทั้งหมด", + "Applied Filters": "กรองข้อมูลตาม", + "Applied Sorting": "เรียงลำดับตาม", + "Bulk Actions": "เลือกการกระทำ", + "Bulk Actions Confirm": "คุณแน่ใจ?", + "Clear": "ล้างทั้งหมด", + "Columns": "เลือกคอลัมน์", + "Debugging Values": "ค่าการดีบัก", + "Deselect All": "ไม่เลือกทั้งหมด", + "Done Reordering": "จัดลำดับแล้ว", + "Filters": "ตัวกรอง", + "not_applicable": "N/A", + "No": "เลขที่", + "No items found. Try to broaden your search.": "ไม่พบรายการที่ค้นหา", + "of": "จาก", + "Remove filter option": "เอาตัวกรองออก", + "Remove sort option": "เอาการเรียงลำดับออก", + "Reorder": "จัดลำดับ", + "results": "รายการ", + "row": "รายการ", + "rows": "รายการ", + "rows, do you want to select all": "รายการ, คุณต้องการเลือกทั้งหมด", + "Search": "ค้นหา...", + "Select All": "เลือกทั้งหมด", + "Select All On Page": "เลือกทั้งหมดบนหน้า", + "Showing": "แสดง", + "to": "-", + "Yes": "ใช่", + "You are currently selecting all": "ขณะนี้คุณได้เลือกทุกรายการ", + "You are not connected to the internet.": "ขณะนี้คุณไม่ได้เชื่อมต่อกับอินเทอร์เน็ต", + "You have selected": "คุณเลือก" +} \ No newline at end of file diff --git a/resources/lang/json/tk.json b/resources/lang/json/tk.json new file mode 100644 index 000000000..2099d845f --- /dev/null +++ b/resources/lang/json/tk.json @@ -0,0 +1,62 @@ +{ + "livewire-tables::All": "Hemmesi", + "livewire-tables::All Columns": "Colhli sütünler", + "livewire-tables::Applied Filters": "Ulanylýan Süzgüçler", + "livewire-tables::Applied Sorting": "Ulanylýan Tertipleşdirme", + "livewire-tables::Bulk Actions": "Köpçülikleýin Hereketler", + "livewire-tables::Clear": "Arassala", + "livewire-tables::Columns": "Sütünler", + "livewire-tables::Debugging Values": "Gymmatlyklary düzetmek", + "livewire-tables::Deselect All": "Hemmesini Aýyr", + "livewire-tables::Done Reordering": "Täzeden Tertiplendi", + "livewire-tables::Filters": "Süzgüçler", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "Hayir", + "livewire-tables::No items found. Try to broaden your search.": "Hiç zat tapylmady. Gözlegiňizi giňeltmäge synanyşyň.", + "livewire-tables::of": "aralygy", + "livewire-tables::Remove filter option": "Süzgüç görnüşini aýyryň", + "livewire-tables::Remove sort option": "Tertiplemek görnüşini aýyryň", + "livewire-tables::Reorder": "Tertibe salmak", + "livewire-tables::results": "netijeler", + "livewire-tables::row": "hatarlar", + "livewire-tables::rows": "hatarlar", + "livewire-tables::rows, do you want to select all": "hatarlar, hemmesini saýlamak isleýärsiňizmi?", + "livewire-tables::Search": "Gözlemek", + "livewire-tables::Select All": "Hepsini seç", + "livewire-tables::Showing": "Görkezmek", + "livewire-tables::to": "-", + "livewire-tables::Yes": "Evet", + "livewire-tables::You are currently selecting all": "Häzirki wagtda hemmesini saýlap alýarsyňyz", + "livewire-tables::You are not connected to the internet.": "Siz internete birikmediksiňiz.", + "livewire-tables::You have selected": "Saýladyňyz", + "All": "Hemmesi", + "All Columns": "Colhli sütünler", + "Applied Filters": "Ulanylýan Süzgüçler", + "Applied Sorting": "Ulanylýan Tertipleşdirme", + "Bulk Actions": "Köpçülikleýin Hereketler", + "Clear": "Arassala", + "Columns": "Sütünler", + "Debugging Values": "Gymmatlyklary düzetmek", + "Deselect All": "Hemmesini Aýyr", + "Done Reordering": "Täzeden Tertiplendi", + "Filters": "Süzgüçler", + "not_applicable": "N/A", + "No": "Hayir", + "No items found. Try to broaden your search.": "Hiç zat tapylmady. Gözlegiňizi giňeltmäge synanyşyň.", + "of": "aralygy", + "Remove filter option": "Süzgüç görnüşini aýyryň", + "Remove sort option": "Tertiplemek görnüşini aýyryň", + "Reorder": "Tertibe salmak", + "results": "netijeler", + "row": "hatarlar", + "rows": "hatarlar", + "rows, do you want to select all": "hatarlar, hemmesini saýlamak isleýärsiňizmi?", + "Search": "Gözlemek", + "Select All": "Hepsini seç", + "Showing": "Görkezmek", + "to": "-", + "Yes": "Evet", + "You are currently selecting all": "Häzirki wagtda hemmesini saýlap alýarsyňyz", + "You are not connected to the internet.": "Siz internete birikmediksiňiz.", + "You have selected": "Saýladyňyz" +} \ No newline at end of file diff --git a/resources/lang/json/tr.json b/resources/lang/json/tr.json new file mode 100644 index 000000000..f1218ae2b --- /dev/null +++ b/resources/lang/json/tr.json @@ -0,0 +1,62 @@ +{ + "livewire-tables::All": "Tümü", + "livewire-tables::All Columns": "Tüm Sütunlar", + "livewire-tables::Applied Filters": "Aktif Filtreler", + "livewire-tables::Applied Sorting": "Aktif Sıralamalar", + "livewire-tables::Bulk Actions": "Toplu İşlemler", + "livewire-tables::Clear": "Kaldır", + "livewire-tables::Columns": "Kolonlar", + "livewire-tables::Debugging Values": "Debug Değerleri", + "livewire-tables::Deselect All": "Seçimleri kaldır", + "livewire-tables::Done Reordering": "Sıralamayı Tamamla", + "livewire-tables::Filters": "Filtreler", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "HAYIR", + "livewire-tables::No items found. Try to broaden your search.": "Kayıt bulunamadı.", + "livewire-tables::of": " ", + "livewire-tables::Remove filter option": "Filtre seçeneğini kaldır", + "livewire-tables::Remove sort option": "Sıralama seçeneğini kaldır", + "livewire-tables::Reorder": "Yeniden Sırala", + "livewire-tables::results": "toplam sonuç", + "livewire-tables::row": "satır", + "livewire-tables::rows": "satır", + "livewire-tables::rows, do you want to select all": "satır seçtiniz. Hepsini seçmek ister misiniz?", + "livewire-tables::Search": "Ara", + "livewire-tables::Select All": "Hepsini seç", + "livewire-tables::Showing": "Gösterilen", + "livewire-tables::to": " - ", + "livewire-tables::Yes": "Evet", + "livewire-tables::You are currently selecting all": "Hepsini seçtiniz.", + "livewire-tables::You are not connected to the internet.": "İnternet bağlantınız kesildi.", + "livewire-tables::You have selected": "Siz seçildiniz", + "All": "Tümü", + "All Columns": "Tüm Sütunlar", + "Applied Filters": "Aktif Filtreler", + "Applied Sorting": "Aktif Sıralamalar", + "Bulk Actions": "Toplu İşlemler", + "Clear": "Kaldır", + "Columns": "Kolonlar", + "Debugging Values": "Debug Değerleri", + "Deselect All": "Seçimleri kaldır", + "Done Reordering": "Sıralamayı Tamamla", + "Filters": "Filtreler", + "not_applicable": "N/A", + "No": "HAYIR", + "No items found. Try to broaden your search.": "Kayıt bulunamadı.", + "of": " ", + "Remove filter option": "Filtre seçeneğini kaldır", + "Remove sort option": "Sıralama seçeneğini kaldır", + "Reorder": "Yeniden Sırala", + "results": "toplam sonuç", + "row": "satır", + "rows": "satır", + "rows, do you want to select all": "satır seçtiniz. Hepsini seçmek ister misiniz?", + "Search": "Ara", + "Select All": "Hepsini seç", + "Showing": "Gösterilen", + "to": " - ", + "Yes": "Evet", + "You are currently selecting all": "Hepsini seçtiniz.", + "You are not connected to the internet.": "İnternet bağlantınız kesildi.", + "You have selected": "Siz seçildiniz" +} \ No newline at end of file diff --git a/resources/lang/json/tw.json b/resources/lang/json/tw.json new file mode 100644 index 000000000..b675a47c7 --- /dev/null +++ b/resources/lang/json/tw.json @@ -0,0 +1,66 @@ +{ + "livewire-tables::All": "全部", + "livewire-tables::All Columns": "所有專欄", + "livewire-tables::Applied Filters": "已套用的過濾規則", + "livewire-tables::Applied Sorting": "已套用的搜尋規則", + "livewire-tables::Bulk Actions": "批次操作", + "livewire-tables::Bulk Actions Confirm": "你確定嗎", + "livewire-tables::Clear": "清除", + "livewire-tables::Columns": "欄位", + "livewire-tables::Debugging Values": "調試值", + "livewire-tables::Deselect All": "取消選擇", + "livewire-tables::Done Reordering": "排序完成", + "livewire-tables::Filters": "過濾規則", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "不", + "livewire-tables::No items found. Try to broaden your search.": "無資料呈現。請嘗試擴大搜尋範圍。", + "livewire-tables::of": "筆資料,共", + "livewire-tables::Reorder": "重新排序", + "livewire-tables::Remove filter option": "移除過濾規則", + "livewire-tables::Remove sort option": "移除排序規則", + "livewire-tables::results": "筆資料", + "livewire-tables::row": "筆資料", + "livewire-tables::rows": "筆資料", + "livewire-tables::rows, do you want to select all": "筆資料,您是否要全選", + "livewire-tables::Search": "搜尋", + "livewire-tables::Select All": "搜尋全部", + "livewire-tables::Select All On Page": "选择页面上的所有内容", + "livewire-tables::Showing": "顯示", + "livewire-tables::to": "至", + "livewire-tables::Yes": "是的", + "livewire-tables::You are currently selecting all": "您目前已選擇全部資料", + "livewire-tables::You are not connected to the internet.": "目前為離線模式", + "livewire-tables::You have selected": "您已選擇", + "All": "全部", + "All Columns": "所有專欄", + "Applied Filters": "已套用的過濾規則", + "Applied Sorting": "已套用的搜尋規則", + "Bulk Actions": "批次操作", + "Bulk Actions Confirm": "你確定嗎", + "Clear": "清除", + "Columns": "欄位", + "Debugging Values": "調試值", + "Deselect All": "取消選擇", + "Done Reordering": "排序完成", + "Filters": "過濾規則", + "not_applicable": "N/A", + "No": "不", + "No items found. Try to broaden your search.": "無資料呈現。請嘗試擴大搜尋範圍。", + "of": "筆資料,共", + "Reorder": "重新排序", + "Remove filter option": "移除過濾規則", + "Remove sort option": "移除排序規則", + "results": "筆資料", + "row": "筆資料", + "rows": "筆資料", + "rows, do you want to select all": "筆資料,您是否要全選", + "Search": "搜尋", + "Select All": "搜尋全部", + "Select All On Page": "选择页面上的所有内容", + "Showing": "顯示", + "to": "至", + "Yes": "是的", + "You are currently selecting all": "您目前已選擇全部資料", + "You are not connected to the internet.": "目前為離線模式", + "You have selected": "您已選擇" +} \ No newline at end of file diff --git a/resources/lang/json/uk.json b/resources/lang/json/uk.json new file mode 100644 index 000000000..540684056 --- /dev/null +++ b/resources/lang/json/uk.json @@ -0,0 +1,68 @@ +{ + "livewire-tables::All": "Всі", + "livewire-tables::All Columns": "Усі стовпці", + "livewire-tables::Applied Filters": "Застосовані фільтри", + "livewire-tables::Applied Sorting": "Застосовані сортування", + "livewire-tables::Bulk Actions": "Масові дії", + "livewire-tables::Bulk Actions Confirm": "Vy vpevneni?", + "livewire-tables::Clear": "Очистити", + "livewire-tables::Columns": "Колонки", + "livewire-tables::Debugging Values": "Значення налагодження", + "livewire-tables::Deselect All": "Зняти вибір із усіх", + "livewire-tables::Done Reordering": "Сортування виконанно", + "livewire-tables::Filters": "Фільтри", + "livewire-tables::not_applicable": "N/A", + "livewire-tables::No": "Немає", + "livewire-tables::No items found. Try to broaden your search.": "Немає елементів. Спробуйте розширити пошук.", + "livewire-tables::of": "від", + "livewire-tables::Remove filter option": "Видалити опцію фільтра", + "livewire-tables::Remove sort option": "Видалити параметр сортування", + "livewire-tables::Reorder": "Змінити порядок", + "livewire-tables::results": "результатів", + "livewire-tables::row": "рядки", + "livewire-tables::rows": "рядки", + "livewire-tables::rows, do you want to select all": "рядків, ви хочете вибрати всі", + "livewire-tables::Search": "Пошук", + "livewire-tables::Select All": "Вибрати все", + "livewire-tables::Select All On Page": "Виберіть «Усі на сторінці", + "livewire-tables::Showing": "Показано", + "livewire-tables::to": "до", + "livewire-tables::Unselect All": "Прибрати вибір усіх", + "livewire-tables::Yes": "Так", + "livewire-tables::You are currently selecting all": "Наразі ви вибираєте всі", + "livewire-tables::You are not connected to the internet.": "Ви не підключені до Інтернету.", + "livewire-tables::You have selected": "Ви вибрали", + "All": "Всі", + "All Columns": "Усі стовпці", + "Applied Filters": "Застосовані фільтри", + "Applied Sorting": "Застосовані сортування", + "Bulk Actions": "Масові дії", + "Bulk Actions Confirm": "Vy vpevneni?", + "Clear": "Очистити", + "Columns": "Колонки", + "Debugging Values": "Значення налагодження", + "Deselect All": "Зняти вибір із усіх", + "Done Reordering": "Сортування виконанно", + "Filters": "Фільтри", + "not_applicable": "N/A", + "No": "Немає", + "No items found. Try to broaden your search.": "Немає елементів. Спробуйте розширити пошук.", + "of": "від", + "Remove filter option": "Видалити опцію фільтра", + "Remove sort option": "Видалити параметр сортування", + "Reorder": "Змінити порядок", + "results": "результатів", + "row": "рядки", + "rows": "рядки", + "rows, do you want to select all": "рядків, ви хочете вибрати всі", + "Search": "Пошук", + "Select All": "Вибрати все", + "Select All On Page": "Виберіть «Усі на сторінці", + "Showing": "Показано", + "to": "до", + "Unselect All": "Прибрати вибір усіх", + "Yes": "Так", + "You are currently selecting all": "Наразі ви вибираєте всі", + "You are not connected to the internet.": "Ви не підключені до Інтернету.", + "You have selected": "Ви вибрали" +} \ No newline at end of file diff --git a/resources/lang/ms.json b/resources/lang/ms.json deleted file mode 100644 index ff04ae499..000000000 --- a/resources/lang/ms.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "All": "Semua", - "All Columns": "Semua Lajur", - "Applied Filters": "Tapisan Digunakan", - "Applied Sorting": "Susunan Digunakan", - "Bulk Actions": "Tindakan Pukal", - "Clear": "Kosongkan", - "Columns": "Kolum", - "Debugging Values": "Menyahpepijat Nilai", - "Deselect All": "Nyahpilih semua", - "Done Reordering": "Selesai Menyusun Semula", - "Filters": "Tapisan", - "No": "Tidak", - "No items found. Try to broaden your search.": "Tiada data ditemui. Sila perluaskan carian anda", - "of": "daripada", - "Remove filter option": "Keluarkan pilihan tapisan", - "Remove sort option": "Keluarkan pilihan sususan", - "Reorder": "menyusun semula", - "results": "keputusan", - "row": "barisan", - "rows": "barisan", - "rows, do you want to select all": "barisan, adakah anda mahu pilih semua?", - "Search": "Carian", - "Select All": "Pilih Semua", - "Showing": "Menunjukkan", - "to": "ke", - "Yes": "ya", - "You are currently selecting all": "Anda sedang memilih semua", - "You are not connected to the internet.": "Anda tidak disambungkan ke internet.", - "You have selected": "Anda telah memilih" -} \ No newline at end of file diff --git a/resources/lang/nl.json b/resources/lang/nl.json deleted file mode 100644 index e2f681d4d..000000000 --- a/resources/lang/nl.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "All": "Alle", - "All Columns": "Alle kolommen", - "Applied Filters": "Toegepaste filters", - "Applied Sorting": "Toegepaste sortering", - "Bulk Actions": "Bulkacties", - "Bulk Actions Confirm": "Weet u het zeker?", - "Clear": "Wissen", - "Columns": "Kolommen", - "Debugging Values": "Debugging waarden", - "Deselect All": "Alles deselecteren", - "Done Reordering": "Hersortering voltooid", - "Filters": "Filters", - "No": "Nee", - "No items found. Try to broaden your search.": "Er zijn geen items gevonden. Probeer uw zoekopdracht te verfijnen.", - "of": "van", - "Remove filter option": "Filteroptie verwijderen", - "Remove sort option": "Sorteeroptie verwijderen", - "Reorder": "Hersorteren", - "results": "resultaten", - "row": "rij", - "rows": "rijen", - "rows, do you want to select all": "rijen, wilt u alles selecteren", - "Search": "Zoeken", - "Select All": "Alles selecteren", - "Showing": "Toont", - "to": "tot", - "Yes": "Ja", - "You are currently selecting all": "Huidig heeft u alles geselecteerd", - "You are not connected to the internet.": "U bent niet verbonden met het internet.", - "You have selected": "U selecteerde", - "Select All On Page": "Alles op deze pagina selecteren" -} diff --git a/resources/lang/php/ar/core.php b/resources/lang/php/ar/core.php new file mode 100644 index 000000000..7a61e7327 --- /dev/null +++ b/resources/lang/php/ar/core.php @@ -0,0 +1,34 @@ + 'الجميع', + 'All Columns' => 'كافة الأعمدة', + 'Applied Filters' => 'المرشحات التطبيقية', + 'Applied Sorting' => 'الفرز التطبيقي', + 'Bulk Actions' => 'إجراءات جملة', + 'Clear' => 'واضح', + 'Columns' => 'الأعمدة', + 'Debugging Values' => 'قيم التصحيح', + 'Deselect All' => 'الغاء تحديد الكل', + 'Done Reordering' => 'تمت إعادة الترتيب', + 'Filters' => 'المرشحات', + 'not_applicable' => 'N/A', + 'No' => 'لا', + 'No items found, try to broaden your search' => 'لم يتم العثور على العناصر. حاول توسيع نطاق البحث', + 'of' => 'ل', + 'Remove filter option' => 'إزالة خيار التصفية', + 'Remove sort option' => 'إزالة خيار الفرز', + 'Reorder' => 'إعادة ترتيب', + 'results' => 'نتائج', + 'row' => 'صف', + 'rows' => 'صفوف', + 'rows, do you want to select all' => 'الصفوف ، هل تريد تحديد الكل', + 'Search' => 'يبحث', + 'Select All' => 'اختر الكل', + 'Showing' => 'عرض', + 'to' => 'ل', + 'Yes' => 'نعم', + 'You are currently selecting all' => 'أنت الآن تختار الكل', + 'You are not connected to the internet' => 'أنت غير متصل بالإنترنت', + 'You have selected' => 'قمت بتحديدها', +]; diff --git a/resources/lang/php/ca/core.php b/resources/lang/php/ca/core.php new file mode 100644 index 000000000..475148fa6 --- /dev/null +++ b/resources/lang/php/ca/core.php @@ -0,0 +1,34 @@ + 'Tot', + 'All Columns' => 'Totes les columnes', + 'Applied Filters' => 'Filtres Aplicats', + 'Applied Sorting' => 'Ordenació Aplicada', + 'Bulk Actions' => 'Accions Massives', + 'Clear' => 'Esborra', + 'Columns' => 'Columnes', + 'Debugging Values' => 'Valors de depuració', + 'Deselect All' => 'Deselecciona tot', + 'Done Reordering' => 'Reordenació finalitzada', + 'Filters' => 'Filtres', + 'not_applicable' => 'N/A', + 'No' => 'No', + 'No items found, try to broaden your search' => "No s'han trobat elements. Intenti ampliar la cerca", + 'of' => 'de', + 'Remove filter option' => 'Elimina opció de filtre', + 'Remove sort option' => "Elimina opció d'ordenació", + 'Reorder' => 'Reordena', + 'results' => 'resultats', + 'row' => 'fila', + 'rows' => 'files', + 'rows, do you want to select all' => 'files, vol seleccionar totes', + 'to' => 'a', + 'Search' => 'Cerca', + 'Select All' => 'Selecciona tot', + 'Showing' => 'Mostrant', + 'Yes' => 'Sí', + 'You are currently selecting all' => 'Actualment està seleccionant tot', + 'You are not connected to the internet' => 'No està conectat a Internet', + 'You have selected' => 'Ha seleccionat', +]; diff --git a/resources/lang/php/da/core.php b/resources/lang/php/da/core.php new file mode 100644 index 000000000..8ec69ce38 --- /dev/null +++ b/resources/lang/php/da/core.php @@ -0,0 +1,34 @@ + 'Alle', + 'All Columns' => 'Alle kolonner', + 'Applied Filters' => 'Anvendte filtre', + 'Applied Sorting' => 'Anvendt sortering', + 'Bulk Actions' => 'Massehandlinger', + 'Clear' => 'Ryd', + 'Columns' => 'Kolonner', + 'Debugging Values' => 'Debugging-værdier', + 'Deselect All' => 'Fravælg alle', + 'Done Reordering' => 'Færdig med omorganisering', + 'Filters' => 'Filtre', + 'not_applicable' => 'N/A', + 'No' => 'Nej', + 'No items found, try to broaden your search' => 'Ingen elementer fundet. Prøv at udvide din søgning', + 'of' => 'af', + 'Remove filter option' => 'Fjern filtermulighed', + 'Remove sort option' => 'Fjern sorteringsmulighed', + 'Reorder' => 'Omorganisér', + 'results' => 'resultater', + 'row' => 'række', + 'rows' => 'rækker', + 'rows, do you want to select all' => 'rækker, vil du vælge alle', + 'Search' => 'Søg', + 'Select All' => 'Vælg alle', + 'Showing' => 'Viser', + 'to' => 'til', + 'Yes' => 'Ja', + 'You are currently selecting all' => 'Du vælger i øjeblikket alle', + 'You are not connected to the internet' => 'Du er ikke forbundet til internettet', + 'You have selected' => 'Du har valgt', +]; diff --git a/resources/lang/php/de/core.php b/resources/lang/php/de/core.php new file mode 100644 index 000000000..04963e20a --- /dev/null +++ b/resources/lang/php/de/core.php @@ -0,0 +1,36 @@ + 'Alle', + 'All Columns' => 'Alle Spalten', + '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', + 'Deselect All' => 'Alle abwählen', + 'Done Reordering' => 'Sortieren abgeschlossen', + 'Filters' => 'Filter', + 'not_applicable' => 'N/A', + 'No' => 'Nein', + 'No items found, try to broaden your search' => 'Es gibt keine Ergebnisse/Einträge. Versuche die Suche zu erweitern', + 'of' => 'von', + 'Remove filter option' => 'Entferne Filterauswahl', + 'Remove sort option' => 'Entferne Sortierauswahl', + 'Reorder' => 'erneut Sortieren', + 'results' => 'Ergebnisse', + 'row' => 'Zeile', + 'rows' => 'Zeilen', + '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', + 'You are currently selecting all' => 'Es sind schon alle ausgewählt', + 'You are not connected to the internet' => 'Es liegt keine Verbindung zum Internet vor.', + 'You have selected' => 'Es sind ausgewählt', +]; diff --git a/resources/lang/php/en/core.php b/resources/lang/php/en/core.php new file mode 100644 index 000000000..631762dba --- /dev/null +++ b/resources/lang/php/en/core.php @@ -0,0 +1,41 @@ + 'All', + 'All Columns' => 'All Columns', + 'Applied Filters' => 'Applied Filters', + 'Applied Sorting' => 'Applied Sorting', + 'Bulk Actions' => 'Bulk Actions', + 'Bulk Actions Confirm' => 'Are you sure?', + 'cancel' => 'Cancel', + 'Clear' => 'Clear', + 'Columns' => 'Columns', + 'Debugging Values' => 'Debugging Values', + 'Deselect All' => 'Deselect All', + 'Done Reordering' => 'Done Reordering', + 'Filters' => 'Filters', + 'loading' => 'Loading', + 'max' => 'Max', + 'min' => 'Min', + 'not_applicable' => 'N/A', + 'No' => 'No', + 'No items found, try to broaden your search' => 'No items found, try to broaden your search', + 'of' => 'of', + 'Remove filter option' => 'Remove filter option', + 'Remove sort option' => 'Remove sort option', + 'Reorder' => 'Reorder', + 'results' => 'results', + 'row' => 'row', + 'rows' => 'rows', + 'rows, do you want to select all' => 'rows, do you want to select all', + 'save' => 'Save', + 'Search' => 'Search', + 'Select All' => 'Select All', + 'Select All On Page' => 'Select All On Page', + 'Showing' => 'Showing', + 'to' => 'to', + 'Yes' => 'Yes', + 'You are currently selecting all' => 'You are currently selecting all', + 'You are not connected to the internet' => 'You are not connected to the internet', + 'You have selected' => 'You have selected', +]; diff --git a/resources/lang/php/es/core.php b/resources/lang/php/es/core.php new file mode 100644 index 000000000..6abcb91ea --- /dev/null +++ b/resources/lang/php/es/core.php @@ -0,0 +1,36 @@ + 'Todo', + 'All Columns' => 'Todas las columnas', + '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', + 'Deselect All' => 'Deseleccionar todo', + 'Done Reordering' => 'Reordenación finalizada', + 'Filters' => 'Filtros', + 'not_applicable' => 'N/A', + 'No' => 'No', + 'No items found, try to broaden your search' => 'No se encontraron elementos. Intente ampliar la búsqueda', + 'of' => 'de', + 'Remove filter option' => 'Remover opción de filtro', + 'Remove sort option' => 'Remover opción de ordenamineto', + 'Reorder' => 'Reordenar', + 'results' => 'resultados', + 'row' => 'fila', + 'rows' => 'filas', + 'rows, do you want to select all' => 'filas, desea seleccionar todas', + 'Search' => 'Buscar', + 'Select All' => 'Seleccionar todo', + 'Select All On Page' => 'Seleccionar todo en la página', + 'Showing' => 'Mostrando', + 'to' => 'a', + 'Yes' => 'Sí', + 'You are currently selecting all' => 'Actualmente está seleccionando todo', + 'You are not connected to the internet' => 'No está conectado a Internet', + 'You have selected' => 'Ha seleccionado', +]; diff --git a/resources/lang/php/fa/core.php b/resources/lang/php/fa/core.php new file mode 100644 index 000000000..bf880aaeb --- /dev/null +++ b/resources/lang/php/fa/core.php @@ -0,0 +1,41 @@ + 'همه', + 'All Columns' => 'تمام ستون‌ها', + 'Applied Filters' => 'فیلترهای اعمال‌شده', + 'Applied Sorting' => 'مرتب‌سازی اعمال‌شده', + 'Bulk Actions' => 'اقدامات گروهی', + 'Bulk Actions Confirm' => 'آیا مطمئن هستید؟', + 'cancel' => 'لغو', + 'Clear' => 'پاک کردن', + 'Columns' => 'ستون‌ها', + 'Debugging Values' => 'مقادیر اشکال‌زدایی', + 'Deselect All' => 'لغو انتخاب همه', + 'Done Reordering' => 'مرتب‌سازی تمام شد', + 'Filters' => 'فیلترها', + 'loading' => 'در حال بارگذاری', + 'max' => 'حداکثر', + 'min' => 'حداقل', + 'not_applicable' => 'نامعتبر', + 'No' => 'خیر', + 'No items found, try to broaden your search' => 'موردی یافت نشد، جستجوی خود را گسترش دهید', + 'of' => 'از', + 'Remove filter option' => 'حذف گزینه فیلتر', + 'Remove sort option' => 'حذف گزینه مرتب‌سازی', + 'Reorder' => 'دوباره مرتب کنید', + 'results' => 'نتایج', + 'row' => 'ردیف', + 'rows' => 'ردیف‌ها', + 'rows, do you want to select all' => 'ردیف‌ها، آیا می‌خواهید همه را انتخاب کنید', + 'save' => 'ذخیره', + 'Search' => 'جستجو', + 'Select All' => 'انتخاب همه', + 'Select All On Page' => 'انتخاب همه در صفحه', + 'Showing' => 'در حال نمایش', + 'to' => 'تا', + 'Yes' => 'بله', + 'You are currently selecting all' => 'شما در حال حاضر همه را انتخاب کرده‌اید', + 'You are not connected to the internet' => 'شما به اینترنت متصل نیستید', + 'You have selected' => 'شما انتخاب کرده‌اید', +]; diff --git a/resources/lang/php/fr/core.php b/resources/lang/php/fr/core.php new file mode 100644 index 000000000..a81d0b8ad --- /dev/null +++ b/resources/lang/php/fr/core.php @@ -0,0 +1,36 @@ + 'Tous', + 'All Columns' => 'Toutes les colonnes', + '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', + 'Deselect All' => 'Tout désélectionner ', + 'Done Reordering' => 'Réordonnancement terminé', + 'Filters' => 'Filtres', + 'not_applicable' => 'N/A', + 'No' => 'Non', + 'No items found, try to broaden your search' => "Aucun élément trouvé. Essayez d'élargir votre recherche.", + 'of' => 'sur', + 'Remove filter option' => "Supprimer l'option de filtrage", + 'Remove sort option' => "Supprimer l'option de tri", + 'Reorder' => 'Réordonner', + 'results' => 'résultats', + 'row' => 'ligne', + 'rows' => 'lignes', + 'rows, do you want to select all' => 'lignes, voulez-vous tout sélectionner ?', + 'Search' => 'Rechercher', + 'Select All' => 'Tout sélectionner', + '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 ', + 'You are not connected to the internet' => "Vous n'êtes pas connecté à l'Internet", + 'You have selected' => 'Vous avez sélectionné', +]; diff --git a/resources/lang/php/id/core.php b/resources/lang/php/id/core.php new file mode 100644 index 000000000..47aac75f3 --- /dev/null +++ b/resources/lang/php/id/core.php @@ -0,0 +1,34 @@ + 'Semua', + 'All Columns' => 'Semua Kolom', + 'Applied Filters' => 'Filter Diterapkan', + 'Applied Sorting' => 'Penyortiran Diterapkan', + 'Bulk Actions' => 'Aksi', + 'Clear' => 'Bersihkan', + 'Columns' => 'Kolom', + 'Debugging Values' => 'Nilai Debug', + 'Deselect All' => 'Batalkan Semua Pilihan', + 'Done Reordering' => 'Selesai Mengurutkan Ulang', + 'Filters' => 'Filter', + 'not_applicable' => 'N/A', + 'No' => 'Tidak', + 'No items found, try to broaden your search' => 'Tidak ada data yang ditemukan. Cobalah untuk memperluas pencarian Anda.', + 'of' => 'dari', + 'Remove filter option' => 'Hapus opsi filter', + 'Remove sort option' => 'Hapus opsi pengurutan', + 'Reorder' => 'Urutkan ulang', + 'results' => 'hasil', + 'row' => 'baris', + 'rows' => 'baris', + 'rows, do you want to select all' => 'baris, apakah Anda ingin memilih semua?', + 'Search' => 'Cari', + 'Select All' => 'Pilih Semua', + 'Showing' => 'Menampilkan', + 'to' => 'ke', + 'Yes' => 'Ya', + 'You are currently selecting all' => 'Anda sedang memilih semua', + 'You are not connected to the internet' => 'Anda sedang tidak terhubung ke internet', + 'You have selected' => 'Anda telah memilih', +]; diff --git a/resources/lang/php/it/core.php b/resources/lang/php/it/core.php new file mode 100644 index 000000000..b29208f25 --- /dev/null +++ b/resources/lang/php/it/core.php @@ -0,0 +1,36 @@ + 'Tutti', + 'All Columns' => 'Tutte le colonne', + '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', + 'Deselect All' => 'Deseleziona tutto', + 'Done Reordering' => 'Ordinamento Terminato', + 'Filters' => 'Filtri', + 'not_applicable' => 'N/A', + 'No' => 'No', + 'No items found, try to broaden your search' => 'Nessun risultato trovato. Prova ad ampliare la tua ricerca.', + 'of' => 'di', + 'Remove filter option' => 'Rimuovi filtro', + 'Remove sort option' => 'Rimuovi ordinamento', + 'Reorder' => 'Riordina', + 'results' => 'risultati', + 'row' => 'righe', + 'rows' => 'righe', + 'rows, do you want to select all' => 'righe, vuoi selezionarle tutte', + 'Search' => 'Cerca', + 'Select All' => 'Seleziona tutto', + 'Select All On Page' => 'Seleziona tutto sulla pagina', + 'Showing' => 'Visualizzati', + 'to' => 'a', + 'Yes' => 'SÌ', + 'You are currently selecting all' => 'Stai selezionando tutto', + 'You are not connected to the internet' => 'Non sei connesso a internet', + 'You have selected' => 'Hai selezionato', +]; diff --git a/resources/lang/php/ms/core.php b/resources/lang/php/ms/core.php new file mode 100644 index 000000000..89c38f699 --- /dev/null +++ b/resources/lang/php/ms/core.php @@ -0,0 +1,34 @@ + 'Semua', + 'All Columns' => 'Semua Lajur', + 'Applied Filters' => 'Tapisan Digunakan', + 'Applied Sorting' => 'Susunan Digunakan', + 'Bulk Actions' => 'Tindakan Pukal', + 'Clear' => 'Kosongkan', + 'Columns' => 'Kolum', + 'Debugging Values' => 'Menyahpepijat Nilai', + 'Deselect All' => 'Nyahpilih semua', + 'Done Reordering' => 'Selesai Menyusun Semula', + 'Filters' => 'Tapisan', + 'not_applicable' => 'N/A', + 'No' => 'Tidak', + 'No items found, try to broaden your search' => 'Tiada data ditemui. Sila perluaskan carian anda', + 'of' => 'daripada', + 'Remove filter option' => 'Keluarkan pilihan tapisan', + 'Remove sort option' => 'Keluarkan pilihan sususan', + 'Reorder' => 'menyusun semula', + 'results' => 'keputusan', + 'row' => 'barisan', + 'rows' => 'barisan', + 'rows, do you want to select all' => 'barisan, adakah anda mahu pilih semua?', + 'Search' => 'Carian', + 'Select All' => 'Pilih Semua', + 'Showing' => 'Menunjukkan', + 'to' => 'ke', + 'Yes' => 'ya', + 'You are currently selecting all' => 'Anda sedang memilih semua', + 'You are not connected to the internet' => 'Anda tidak disambungkan ke internet', + 'You have selected' => 'Anda telah memilih', +]; diff --git a/resources/lang/php/nb/core.php b/resources/lang/php/nb/core.php new file mode 100644 index 000000000..9bcef1082 --- /dev/null +++ b/resources/lang/php/nb/core.php @@ -0,0 +1,38 @@ + '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/php/nl/core.php b/resources/lang/php/nl/core.php new file mode 100644 index 000000000..ad1eb4c29 --- /dev/null +++ b/resources/lang/php/nl/core.php @@ -0,0 +1,36 @@ + 'Alle', + 'All Columns' => 'Alle kolommen', + 'Applied Filters' => 'Toegepaste filters', + 'Applied Sorting' => 'Toegepaste sortering', + 'Bulk Actions' => 'Bulkacties', + 'Bulk Actions Confirm' => 'Weet u het zeker?', + 'Clear' => 'Wissen', + 'Columns' => 'Kolommen', + 'Debugging Values' => 'Debugging waarden', + 'Deselect All' => 'Alles deselecteren', + 'Done Reordering' => 'Hersortering voltooid', + 'Filters' => 'Filters', + 'not_applicable' => 'N/A', + 'No' => 'Nee', + 'No items found, try to broaden your search' => 'Er zijn geen items gevonden. Probeer uw zoekopdracht te verfijnen', + 'of' => 'van', + 'Remove filter option' => 'Filteroptie verwijderen', + 'Remove sort option' => 'Sorteeroptie verwijderen', + 'Reorder' => 'Hersorteren', + 'results' => 'resultaten', + 'row' => 'rij', + 'rows' => 'rijen', + 'rows, do you want to select all' => 'rijen, wilt u alles selecteren', + 'Search' => 'Zoeken', + 'Select All' => 'Alles selecteren', + 'Select All On Page' => 'Alles op deze pagina selecteren', + 'Showing' => 'Toont', + 'to' => 'tot', + 'Yes' => 'Ja', + 'You are currently selecting all' => 'Huidig heeft u alles geselecteerd', + 'You are not connected to the internet' => 'U bent niet verbonden met het internet', + 'You have selected' => 'U selecteerde', +]; diff --git a/resources/lang/php/pl/core.php b/resources/lang/php/pl/core.php new file mode 100644 index 000000000..144c73d8a --- /dev/null +++ b/resources/lang/php/pl/core.php @@ -0,0 +1,36 @@ + 'Wszystko', + 'All Columns' => 'Wszystkie kolumny', + 'Applied Filters' => 'Użyte filtry', + 'Applied Sorting' => 'Użyte sortowanie', + 'Bulk Actions' => 'Akcje zbiorowe', + 'Bulk Actions Confirm' => 'Czy zastosować ?', + 'Clear' => 'Wyczyść', + 'Columns' => 'Kolumny', + 'Debugging Values' => 'Wartości debugowania', + 'Deselect All' => 'Odznacz wszystko', + 'Done Reordering' => 'Done Reordering', + 'Filters' => 'Filtry', + 'not_applicable' => 'N/A', + 'No' => 'Nie', + 'No items found, try to broaden your search' => 'Brak rezultatów do wyświetlenia', + 'of' => 'z', + 'Remove filter option' => 'Usuń opcję filtra', + 'Remove sort option' => 'Usuń opcję sortowania', + 'Reorder' => 'Zmień kolejność', + 'results' => 'wyniki', + 'row' => 'wiersz', + 'rows' => 'wiersze', + 'rows, do you want to select all' => 'czy chcesz zaznaczyć wszystkie wiersze', + 'Search' => 'Szukaj', + 'Select All' => 'Zaznacz wszystko', + 'Select All On Page' => 'Zaznacz wszystko na stronie', + 'Showing' => 'Pokazywanie', + 'to' => 'do', + 'Yes' => 'Tak', + 'You are currently selecting all' => 'Aktualnie masz wszystko zaznaczone', + 'You are not connected to the internet' => 'Brak połączenia z internetem', + 'You have selected' => 'Masz wybrane', +]; diff --git a/resources/lang/php/pt/core.php b/resources/lang/php/pt/core.php new file mode 100644 index 000000000..308f853f1 --- /dev/null +++ b/resources/lang/php/pt/core.php @@ -0,0 +1,35 @@ + 'Tudo', + 'All Columns' => 'Todas as colunas', + 'Applied Filters' => 'Filtros Aplicados', + 'Applied Sorting' => 'Ordenação Aplicada', + 'Bulk Actions' => 'Ações Massivas', + 'Clear' => 'Limpar', + 'Columns' => 'Colunas', + 'Debugging Values' => 'Valores de depuração', + 'Deselect All' => 'Desmarcar Tudo', + 'Done Reordering' => 'Ordeanação finalizada', + 'Filters' => 'Filtros', + 'not_applicable' => 'N/A', + 'No' => 'Não', + 'No items found, try to broaden your search' => 'Nenhum resultado encontrado. Tente ampliar a sua pesquisa', + 'of' => 'de', + 'Remove filter option' => 'Remover opção de filtro', + 'Remove sort option' => 'Remover opção de ordenação', + 'Reorder' => 'Reordenar', + 'results' => 'resultados', + 'row' => 'linha', + 'rows' => 'linhas', + 'rows, do you want to select all' => 'linhas, pretende selecionar tudo', + 'Search' => 'Pesquisar', + 'Select All' => 'Seleccionar Tudo', + 'Select All On Page' => 'Selecione tudo na página', + 'Showing' => 'A mostrar', + 'to' => 'a', + 'Yes' => 'Sim', + 'You are currently selecting all' => 'Atualmente está a selecionar tudo', + 'You are not connected to the internet' => 'Não está ligado à internet', + 'You have selected' => 'Selecionou', +]; diff --git a/resources/lang/php/pt_BR/core.php b/resources/lang/php/pt_BR/core.php new file mode 100644 index 000000000..af83595e6 --- /dev/null +++ b/resources/lang/php/pt_BR/core.php @@ -0,0 +1,36 @@ + 'Tudo', + 'All Columns' => 'Todas as colunas', + 'Applied Filters' => 'Filtros aplicados', + 'Applied Sorting' => 'Ordenação aplicada', + 'Bulk Actions' => 'Ações em massa', + 'Bulk Actions Confirm' => 'Tem certeza', + 'Clear' => 'Limpar', + 'Columns' => 'Colunas', + 'Debugging Values' => 'Valores de depuração', + 'Deselect All' => 'Desmarcar Tudo', + 'Done Reordering' => 'Ordenação finalizada', + 'Filters' => 'Filtros', + 'not_applicable' => 'N/A', + 'No' => 'Não', + 'No items found, try to broaden your search' => 'Nenhum resultado encontrado. Tente ampliar a sua pesquisa', + 'of' => 'de', + 'Reorder' => 'Reordenar', + 'results' => 'resultados', + 'Remove filter option' => 'Remover opção de filtro', + 'Remove sort option' => 'Remover opção de ordenação', + 'row' => 'linha', + 'rows' => 'linhas', + 'rows, do you want to select all' => 'linhas, você deseja selecionar tudo?', + 'Search' => 'Pesquisar', + 'Select All' => 'Selecionar tudo', + 'Select All On Page' => 'Selecione tudo na página', + 'Showing' => 'Exibindo', + 'to' => 'a', + 'Yes' => 'Sim', + 'You are currently selecting all' => 'Você selecionou tudo', + 'You are not connected to the internet' => 'Você não está conectado na internet', + 'You have selected' => 'Você selecionou', +]; diff --git a/resources/lang/php/ru/core.php b/resources/lang/php/ru/core.php new file mode 100644 index 000000000..0cf6dcbce --- /dev/null +++ b/resources/lang/php/ru/core.php @@ -0,0 +1,34 @@ + 'Все', + 'All Columns' => 'Все столбцы', + 'Applied Filters' => 'Примененные фильтры', + 'Applied Sorting' => 'Примененная сортировка', + 'Bulk Actions' => 'Массовые действия', + 'Clear' => 'Очистить', + 'Columns' => 'Столбцы', + 'Debugging Values' => 'Отладочные значения', + 'Deselect All' => 'Снять выделение', + 'Done Reordering' => 'Сортировка выполнена', + 'Filters' => 'Фильтры', + 'not_applicable' => 'N/A', + 'No' => 'Нет', + 'No items found, try to broaden your search' => 'Ничего не найдено. Попробуйте расширить поиск', + 'of' => 'из', + 'Remove filter option' => 'Удалить фильтр', + 'Remove sort option' => 'Удалить параметр сортировки', + 'Reorder' => 'Переупорядочить', + 'results' => 'результатов', + 'row' => 'ряды', + 'rows' => 'ряды', + 'rows, do you want to select all' => 'ряды, вы хотите выбрать все', + 'Search' => 'Поиск', + 'Select All' => 'Выбрать все', + 'Showing' => 'Показано с', + 'to' => 'к', + 'Yes' => 'Да', + 'You are currently selecting all' => 'Вы выбираете все', + 'You are not connected to the internet' => 'Вы не подключены к Интернету', + 'You have selected' => 'Вы выбрали', +]; diff --git a/resources/lang/php/sq/core.php b/resources/lang/php/sq/core.php new file mode 100644 index 000000000..3ea3ea6b9 --- /dev/null +++ b/resources/lang/php/sq/core.php @@ -0,0 +1,38 @@ + '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/php/sv/core.php b/resources/lang/php/sv/core.php new file mode 100644 index 000000000..b3630fe7c --- /dev/null +++ b/resources/lang/php/sv/core.php @@ -0,0 +1,38 @@ + 'Alla', + 'All Columns' => 'Alla Kolumner', + 'Applied Filters' => 'Valda filter', + 'Applied Sorting' => 'Vald sortering', + 'Bulk Actions' => 'Bulk Modifiering', + 'Bulk Actions Confirm' => 'Är du säker?', + 'Clear' => 'Rensa', + 'Columns' => 'Kolumner', + 'Debugging Values' => 'Debug Värden', + 'Deselect All' => 'Avmarkera alla', + 'Done Reordering' => 'Omordning klart', + 'Filters' => 'Filter', + 'max' => 'Max', + 'min' => 'Min', + 'not_applicable' => 'N/A', + 'No' => 'Nej', + 'No items found, try to broaden your search' => 'Inga föremål hittades. Försök vidga din sökning', + 'of' => 'av', + 'Remove filter option' => 'Rensa valt filter', + 'Remove sort option' => 'Rensa vald sortering', + 'Reorder' => 'Omordna', + 'results' => 'resultat', + 'row' => 'rad', + 'rows' => 'rader', + 'rows, do you want to select all' => 'rader, vill du markera alla', + 'Search' => 'Sök', + 'Select All' => 'Markera alla', + 'Select All On Page' => 'Markera alla på sidan', + 'Showing' => 'Visar', + 'to' => 'till', + 'Yes' => 'Ja', + 'You are currently selecting all' => 'Du markerar för närvarande alla', + 'You are not connected to the internet' => 'Du är inte uppkopplad till internet', + 'You have selected' => 'Du har markerat', +]; diff --git a/resources/lang/php/th/core.php b/resources/lang/php/th/core.php new file mode 100644 index 000000000..bcbe31590 --- /dev/null +++ b/resources/lang/php/th/core.php @@ -0,0 +1,36 @@ + 'ทั้งหมด', + 'All Columns' => 'คอลัมน์ทั้งหมด', + 'Applied Filters' => 'กรองข้อมูลตาม', + 'Applied Sorting' => 'เรียงลำดับตาม', + 'Bulk Actions' => 'เลือกการกระทำ', + 'Bulk Actions Confirm' => 'คุณแน่ใจ?', + 'Clear' => 'ล้างทั้งหมด', + 'Columns' => 'เลือกคอลัมน์', + 'Debugging Values' => 'ค่าการดีบัก', + 'Deselect All' => 'ไม่เลือกทั้งหมด', + 'Done Reordering' => 'จัดลำดับแล้ว', + 'Filters' => 'ตัวกรอง', + 'not_applicable' => 'N/A', + 'No' => 'เลขที่', + 'No items found, try to broaden your search' => 'ไม่พบรายการที่ค้นหา', + 'of' => 'จาก', + 'Remove filter option' => 'เอาตัวกรองออก', + 'Remove sort option' => 'เอาการเรียงลำดับออก', + 'Reorder' => 'จัดลำดับ', + 'results' => 'รายการ', + 'row' => 'รายการ', + 'rows' => 'รายการ', + 'rows, do you want to select all' => 'รายการ, คุณต้องการเลือกทั้งหมด', + 'Search' => 'ค้นหา...', + 'Select All' => 'เลือกทั้งหมด', + 'Select All On Page' => 'เลือกทั้งหมดบนหน้า', + 'Showing' => 'แสดง', + 'to' => '-', + 'Yes' => 'ใช่', + 'You are currently selecting all' => 'ขณะนี้คุณได้เลือกทุกรายการ', + 'You are not connected to the internet' => 'ขณะนี้คุณไม่ได้เชื่อมต่อกับอินเทอร์เน็ต', + 'You have selected' => 'คุณเลือก', +]; diff --git a/resources/lang/php/tk/core.php b/resources/lang/php/tk/core.php new file mode 100644 index 000000000..33eaedc68 --- /dev/null +++ b/resources/lang/php/tk/core.php @@ -0,0 +1,34 @@ + 'Hemmesi', + 'All Columns' => 'Colhli sütünler', + 'Applied Filters' => 'Ulanylýan Süzgüçler', + 'Applied Sorting' => 'Ulanylýan Tertipleşdirme', + 'Bulk Actions' => 'Köpçülikleýin Hereketler', + 'Clear' => 'Arassala', + 'Columns' => 'Sütünler', + 'Debugging Values' => 'Gymmatlyklary düzetmek', + 'Deselect All' => 'Hemmesini Aýyr', + 'Done Reordering' => 'Täzeden Tertiplendi', + 'Filters' => 'Süzgüçler', + 'not_applicable' => 'N/A', + 'No' => 'Hayir', + 'No items found, try to broaden your search' => 'Hiç zat tapylmady. Gözlegiňizi giňeltmäge synanyşyň', + 'of' => 'aralygy', + 'Remove filter option' => 'Süzgüç görnüşini aýyryň', + 'Remove sort option' => 'Tertiplemek görnüşini aýyryň', + 'Reorder' => 'Tertibe salmak', + 'results' => 'netijeler', + 'row' => 'hatarlar', + 'rows' => 'hatarlar', + 'rows, do you want to select all' => 'hatarlar, hemmesini saýlamak isleýärsiňizmi?', + 'Search' => 'Gözlemek', + 'Select All' => 'Hepsini seç', + 'Showing' => 'Görkezmek', + 'to' => '-', + 'Yes' => 'Evet', + 'You are currently selecting all' => 'Häzirki wagtda hemmesini saýlap alýarsyňyz', + 'You are not connected to the internet' => 'Siz internete birikmediksiňiz', + 'You have selected' => 'Saýladyňyz', +]; diff --git a/resources/lang/php/tr/core.php b/resources/lang/php/tr/core.php new file mode 100644 index 000000000..6bb8b12e9 --- /dev/null +++ b/resources/lang/php/tr/core.php @@ -0,0 +1,34 @@ + 'Tümü', + 'All Columns' => 'Tüm Sütunlar', + 'Applied Filters' => 'Aktif Filtreler', + 'Applied Sorting' => 'Aktif Sıralamalar', + 'Bulk Actions' => 'Toplu İşlemler', + 'Clear' => 'Kaldır', + 'Columns' => 'Kolonlar', + 'Debugging Values' => 'Debug Değerleri', + 'Deselect All' => 'Seçimleri kaldır', + 'Done Reordering' => 'Sıralamayı Tamamla', + 'Filters' => 'Filtreler', + 'not_applicable' => 'N/A', + 'No' => 'HAYIR', + 'No items found, try to broaden your search' => 'Kayıt bulunamadı', + 'of' => ' ', + 'Remove filter option' => 'Filtre seçeneğini kaldır', + 'Remove sort option' => 'Sıralama seçeneğini kaldır', + 'Reorder' => 'Yeniden Sırala', + 'results' => 'toplam sonuç', + 'row' => 'satır', + 'rows' => 'satır', + 'rows, do you want to select all' => 'satır seçtiniz. Hepsini seçmek ister misiniz?', + 'Search' => 'Ara', + 'Select All' => 'Hepsini seç', + 'Showing' => 'Gösterilen', + 'to' => ' - ', + 'Yes' => 'Evet', + 'You are currently selecting all' => 'Hepsini seçtiniz.', + 'You are not connected to the internet' => 'İnternet bağlantınız kesildi', + 'You have selected' => 'Siz seçildiniz', +]; diff --git a/resources/lang/php/tw/core.php b/resources/lang/php/tw/core.php new file mode 100644 index 000000000..ff83d8a17 --- /dev/null +++ b/resources/lang/php/tw/core.php @@ -0,0 +1,36 @@ + '全部', + 'All Columns' => '所有專欄', + 'Applied Filters' => '已套用的過濾規則', + 'Applied Sorting' => '已套用的搜尋規則', + 'Bulk Actions' => '批次操作', + 'Bulk Actions Confirm' => '你確定嗎', + 'Clear' => '清除', + 'Columns' => '欄位', + 'Debugging Values' => '調試值', + 'Deselect All' => '取消選擇', + 'Done Reordering' => '排序完成', + 'Filters' => '過濾規則', + 'not_applicable' => 'N/A', + 'No' => '不', + 'No items found, try to broaden your search' => '無資料呈現。請嘗試擴大搜尋範圍', + 'of' => '筆資料,共', + 'Reorder' => '重新排序', + 'Remove filter option' => '移除過濾規則', + 'Remove sort option' => '移除排序規則', + 'results' => '筆資料', + 'row' => '筆資料', + 'rows' => '筆資料', + 'rows, do you want to select all' => '筆資料,您是否要全選', + 'Search' => '搜尋', + 'Select All' => '搜尋全部', + 'Select All On Page' => '选择页面上的所有内容', + 'Showing' => '顯示', + 'to' => '至', + 'Yes' => '是的', + 'You are currently selecting all' => '您目前已選擇全部資料', + 'You are not connected to the internet' => '目前為離線模式', + 'You have selected' => '您已選擇', +]; diff --git a/resources/lang/php/uk/core.php b/resources/lang/php/uk/core.php new file mode 100644 index 000000000..c0ea65f92 --- /dev/null +++ b/resources/lang/php/uk/core.php @@ -0,0 +1,37 @@ + 'Всі', + 'All Columns' => 'Усі стовпці', + 'Applied Filters' => 'Застосовані фільтри', + 'Applied Sorting' => 'Застосовані сортування', + 'Bulk Actions' => 'Масові дії', + 'Bulk Actions Confirm' => 'Vy vpevneni?', + 'Clear' => 'Очистити', + 'Columns' => 'Колонки', + 'Debugging Values' => 'Значення налагодження', + 'Deselect All' => 'Зняти вибір із усіх', + 'Done Reordering' => 'Сортування виконанно', + 'Filters' => 'Фільтри', + 'not_applicable' => 'N/A', + 'No' => 'Немає', + 'No items found, try to broaden your search' => 'Немає елементів. Спробуйте розширити пошук', + 'of' => 'від', + 'Remove filter option' => 'Видалити опцію фільтра', + 'Remove sort option' => 'Видалити параметр сортування', + 'Reorder' => 'Змінити порядок', + 'results' => 'результатів', + 'row' => 'рядки', + 'rows' => 'рядки', + 'rows, do you want to select all' => 'рядків, ви хочете вибрати всі', + 'Search' => 'Пошук', + 'Select All' => 'Вибрати все', + 'Select All On Page' => 'Виберіть «Усі на сторінці', + 'Showing' => 'Показано', + 'to' => 'до', + 'Unselect All' => 'Прибрати вибір усіх', + 'Yes' => 'Так', + 'You are currently selecting all' => 'Наразі ви вибираєте всі', + 'You are not connected to the internet' => 'Ви не підключені до Інтернету', + 'You have selected' => 'Ви вибрали', +]; diff --git a/resources/lang/pt.json b/resources/lang/pt.json deleted file mode 100644 index fd12aafbf..000000000 --- a/resources/lang/pt.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "All": "Tudo", - "All Columns": "Todas as colunas", - "Applied Filters": "Filtros Aplicados", - "Applied Sorting": "Ordenação Aplicada", - "Bulk Actions": "Ações Massivas", - "Clear": "Limpar", - "Columns": "Colunas", - "Debugging Values": "Valores de depuração", - "Deselect All": "Desmarcar Tudo", - "Done Reordering": "Ordeanação finalizada", - "Filters": "Filtros", - "No": "Não", - "No items found. Try to broaden your search.": "Nenhum resultado encontrado. Tente ampliar a sua pesquisa.", - "of": "de", - "Remove filter option": "Remover opção de filtro", - "Remove sort option": "Remover opção de ordenação", - "Reorder": "Reordenar", - "results": "resultados", - "row": "linha", - "rows": "linhas", - "rows, do you want to select all": "linhas, pretende selecionar tudo", - "Search": "Pesquisar", - "Select All": "Seleccionar Tudo", - "Showing": "A mostrar", - "to": "a", - "Yes": "Sim", - "You are currently selecting all": "Atualmente está a selecionar tudo", - "You are not connected to the internet.": "Não está ligado à internet.", - "You have selected": "Selecionou" -} \ No newline at end of file diff --git a/resources/lang/pt_BR.json b/resources/lang/pt_BR.json deleted file mode 100644 index 9bf168d13..000000000 --- a/resources/lang/pt_BR.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "All": "Tudo", - "Applied Filters": "Filtros aplicados", - "Applied Sorting": "Ordenação aplicada", - "Bulk Actions": "Ações em massa", - "Clear": "Limpar", - "Columns": "Colunas", - "Debugging Values": "Valores de depuração", - "Deselect All": "Desmarcar Tudo", - "Done Reordering": "Ordenação finalizada", - "Filters": "Filtros", - "No": "Não", - "No items found. Try to broaden your search.": "Nenhum resultado encontrado. Tente ampliar a sua pesquisa.", - "of": "de", - "Reorder": "Reordenar", - "results": "resultados", - "Remove filter option": "Remover opção de filtro", - "Remove sort option": "Remover opção de ordenação", - "row": "linha", - "rows": "linhas", - "rows, do you want to select all": "linhas, você deseja selecionar tudo?", - "Search": "Pesquisar", - "Select All": "Selecionar tudo", - "Showing": "Exibindo", - "to": "a", - "Yes": "Sim", - "You are currently selecting all": "Você selecionou tudo", - "You are not connected to the internet.": "Você não está conectado na internet.", - "You have selected": "Você selecionou" -} \ No newline at end of file diff --git a/resources/lang/ru.json b/resources/lang/ru.json deleted file mode 100644 index 7eb99d1f9..000000000 --- a/resources/lang/ru.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "All": "Все", - "All Columns": "Все столбцы", - "Applied Filters": "Примененные фильтры", - "Applied Sorting": "Примененная сортировка", - "Bulk Actions": "Массовые действия", - "Clear": "Очистить", - "Columns": "Столбцы", - "Debugging Values": "Отладочные значения", - "Deselect All": "Снять выделение", - "Done Reordering": "Сортировка выполнена", - "Filters": "Фильтры", - "No": "Нет", - "No items found. Try to broaden your search.": "Ничего не найдено. Попробуйте расширить поиск.", - "of": "из", - "Remove filter option": "Удалить фильтр", - "Remove sort option": "Удалить параметр сортировки", - "Reorder": "Переупорядочить", - "results": "результатов", - "row": "ряды", - "rows": "ряды", - "rows, do you want to select all": "ряды, вы хотите выбрать все", - "Search": "Поиск", - "Select All": "Выбрать все", - "Showing": "Показано с", - "to": "к", - "Yes": "Да", - "You are currently selecting all": "Вы выбираете все", - "You are not connected to the internet.": "Вы не подключены к Интернету", - "You have selected": "Вы выбрали" -} \ No newline at end of file diff --git a/resources/lang/th.json b/resources/lang/th.json deleted file mode 100644 index 34904172c..000000000 --- a/resources/lang/th.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "All": "ทั้งหมด", - "Applied Filters": "กรองข้อมูลตาม", - "Applied Sorting": "เรียงลำดับตาม", - "Bulk Actions": "เลือกการกระทำ", - "Clear": "ล้างทั้งหมด", - "Columns": "เลือกคอลัมน์", - "Debugging Values": "ค่าการดีบัก", - "Deselect All": "ไม่เลือกทั้งหมด", - "Done Reordering": "จัดลำดับแล้ว", - "Filters": "ตัวกรอง", - "No": "เลขที่", - "No items found. Try to broaden your search.": "ไม่พบรายการที่ค้นหา", - "of": "จาก", - "Remove filter option": "เอาตัวกรองออก", - "Remove sort option": "เอาการเรียงลำดับออก", - "Reorder": "จัดลำดับ", - "results": "รายการ", - "row": "รายการ", - "rows": "รายการ", - "rows, do you want to select all": "รายการ, คุณต้องการเลือกทั้งหมด", - "Search": "ค้นหา...", - "Select All": "เลือกทั้งหมด", - "Showing": "แสดง", - "to": "-", - "Yes": "ใช่", - "You are currently selecting all": "ขณะนี้คุณได้เลือกทุกรายการ", - "You are not connected to the internet.": "ขณะนี้คุณไม่ได้เชื่อมต่อกับอินเทอร์เน็ต", - "You have selected": "คุณเลือก" -} \ No newline at end of file diff --git a/resources/lang/tk.json b/resources/lang/tk.json deleted file mode 100644 index 78bb1460b..000000000 --- a/resources/lang/tk.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "All": "Hemmesi", - "All Columns": "Colhli sütünler", - "Applied Filters": "Ulanylýan Süzgüçler", - "Applied Sorting": "Ulanylýan Tertipleşdirme", - "Bulk Actions": "Köpçülikleýin Hereketler", - "Clear": "Arassala", - "Columns": "Sütünler", - "Debugging Values": "Gymmatlyklary düzetmek", - "Deselect All": "Hemmesini Aýyr", - "Done Reordering": "Täzeden Tertiplendi", - "Filters": "Süzgüçler", - "No": "Hayir", - "No items found. Try to broaden your search.": "Hiç zat tapylmady. Gözlegiňizi giňeltmäge synanyşyň.", - "of": "aralygy", - "Remove filter option": "Süzgüç görnüşini aýyryň", - "Remove sort option": "Tertiplemek görnüşini aýyryň", - "Reorder": "Tertibe salmak", - "results": "netijeler", - "row": "hatarlar", - "rows": "hatarlar", - "rows, do you want to select all": "hatarlar, hemmesini saýlamak isleýärsiňizmi?", - "Search": "Gözlemek", - "Select All": "Hepsini seç", - "Showing": "Görkezmek", - "to": "-", - "Yes": "Evet", - "You are currently selecting all": "Häzirki wagtda hemmesini saýlap alýarsyňyz", - "You are not connected to the internet.": "Siz internete birikmediksiňiz.", - "You have selected": "Saýladyňyz" -} \ No newline at end of file diff --git a/resources/lang/tr.json b/resources/lang/tr.json deleted file mode 100644 index a6c5c01f1..000000000 --- a/resources/lang/tr.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "All": "Tümü", - "All Columns": "Tüm Sütunlar", - "Applied Filters": "Aktif Filtreler", - "Applied Sorting": "Aktif Sıralamalar", - "Bulk Actions": "Toplu İşlemler", - "Clear": "Kaldır", - "Columns": "Kolonlar", - "Debugging Values": "Debug Değerleri", - "Deselect All": "Seçimleri kaldır", - "Done Reordering": "Sıralamayı Tamamla", - "Filters": "Filtreler", - "No": "HAYIR", - "No items found. Try to broaden your search.": "Kayıt bulunamadı.", - "of": " ", - "Remove filter option": "Filtre seçeneğini kaldır", - "Remove sort option": "Sıralama seçeneğini kaldır", - "Reorder": "Yeniden Sırala", - "results": "toplam sonuç", - "row": "satır", - "rows": "satır", - "rows, do you want to select all": "satır seçtiniz. Hepsini seçmek ister misiniz?", - "Search": "Ara", - "Select All": "Hepsini seç", - "Showing": "Gösterilen", - "to": " - ", - "Yes": "Evet", - "You are currently selecting all": "Hepsini seçtiniz.", - "You are not connected to the internet.": "İnternet bağlantınız kesildi.", - "You have selected": "Siz seçildiniz" -} \ No newline at end of file diff --git a/resources/lang/tw.json b/resources/lang/tw.json deleted file mode 100644 index 6599bfdb7..000000000 --- a/resources/lang/tw.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "All": "全部", - "All Columns": "所有專欄", - "Applied Filters": "已套用的過濾規則", - "Applied Sorting": "已套用的搜尋規則", - "Bulk Actions": "批次操作", - "Clear": "清除", - "Columns": "欄位", - "Debugging Values": "調試值", - "Deselect All": "取消選擇", - "Done Reordering": "排序完成", - "Filters": "過濾規則", - "No": "不", - "No items found. Try to broaden your search.": "無資料呈現。請嘗試擴大搜尋範圍。", - "of": "筆資料,共", - "Reorder": "重新排序", - "Remove filter option": "移除過濾規則", - "Remove sort option": "移除排序規則", - "results": "筆資料", - "row": "筆資料", - "rows": "筆資料", - "rows, do you want to select all": "筆資料,您是否要全選", - "Search": "搜尋", - "Select All": "搜尋全部", - "Showing": "顯示", - "to": "至", - "Yes": "是的", - "You are currently selecting all": "您目前已選擇全部資料", - "You are not connected to the internet.": "目前為離線模式", - "You have selected": "您已選擇" -} \ No newline at end of file diff --git a/resources/lang/uk.json b/resources/lang/uk.json deleted file mode 100644 index 778560124..000000000 --- a/resources/lang/uk.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "All": "Всі", - "All Columns": "Усі стовпці", - "Applied Filters": "Застосовані фільтри", - "Applied Sorting": "Застосовані сортування", - "Bulk Actions": "Масові дії", - "Clear": "Очистити", - "Columns": "Колонки", - "Debugging Values": "Значення налагодження", - "Deselect All": "Зняти вибір із усіх", - "Done Reordering": "Сортування виконанно", - "Filters": "Фільтри", - "No": "Немає", - "No items found. Try to broaden your search.": "Немає елементів. Спробуйте розширити пошук.", - "of": "від", - "Remove filter option": "Видалити опцію фільтра", - "Remove sort option": "Видалити параметр сортування", - "Reorder": "Змінити порядок", - "results": "результатів", - "row": "рядки", - "rows": "рядки", - "rows, do you want to select all": "рядків, ви хочете вибрати всі", - "Search": "Пошук", - "Select All": "Вибрати все", - "Showing": "Показано", - "to": "до", - "Unselect All": "Прибрати вибір усіх", - "Yes": "Так", - "You are currently selecting all": "Наразі ви вибираєте всі", - "You are not connected to the internet.": "Ви не підключені до Інтернету.", - "You have selected": "Ви вибрали" -} \ No newline at end of file diff --git a/resources/views/components/external/filters/livewire-array-filter.blade.php b/resources/views/components/external/filters/livewire-array-filter.blade.php new file mode 100644 index 000000000..6a5bd30d0 --- /dev/null +++ b/resources/views/components/external/filters/livewire-array-filter.blade.php @@ -0,0 +1,4 @@ +
    + {{ $slot }} +
    \ No newline at end of file diff --git a/resources/views/components/forms/checkbox.blade.php b/resources/views/components/forms/checkbox.blade.php new file mode 100644 index 000000000..4b2b9b940 --- /dev/null +++ b/resources/views/components/forms/checkbox.blade.php @@ -0,0 +1,11 @@ +@aware(['tableName','primaryKey', 'isTailwind', 'isBootstrap', 'isBootstrap4', 'isBootstrap5']) +@props(['checkboxAttributes']) +merge($checkboxAttributes)->class([ + 'border-gray-300 text-indigo-600 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600' => ($isTailwind) && ($checkboxAttributes['default-colors'] ?? ($checkboxAttributes['default'] ?? true)), + 'rounded shadow-sm transition duration-150 ease-in-out focus:ring focus:ring-opacity-50' => ($isTailwind) && ($checkboxAttributes['default-styling'] ?? ($checkboxAttributes['default'] ?? true)), + 'form-check-input' => ($isBootstrap5) && ($checkboxAttributes['default'] ?? true), + ])->except(['default','default-styling','default-colors']) + }} +/> \ No newline at end of file diff --git a/resources/views/components/includes/actions.blade.php b/resources/views/components/includes/actions.blade.php new file mode 100644 index 000000000..837d6a136 --- /dev/null +++ b/resources/views/components/includes/actions.blade.php @@ -0,0 +1,21 @@ +@aware(['isTailwind', 'isBootstrap']) +@php($actionWrapperAttributes = $this->getActionWrapperAttributes()) +
    merge($this->actionWrapperAttributes) + ->class([ + 'flex flex-cols py-2 space-x-2' => $isTailwind && ($actionWrapperAttributes['default-styling'] ?? true), + '' => $isTailwind && ($actionWrapperAttributes['default-colors'] ?? true), + 'd-flex flex-cols py-2 space-x-2' => $isBootstrap && ($this->actionWrapperAttributes['default-styling'] ?? true), + '' => $isBootstrap && ($actionWrapperAttributes['default-colors'] ?? true), + 'justify-start' => $this->getActionsPosition === 'left', + 'justify-center' => $this->getActionsPosition === 'center', + 'justify-end' => $this->getActionsPosition === 'right', + 'pl-2' => $this->showActionsInToolbar && $this->getActionsPosition === 'left', + 'pr-2' => $this->showActionsInToolbar && $this->getActionsPosition === 'right', + ]) + ->except(['default','default-styling','default-colors']) + }} > + @foreach($this->getActions as $action) + {{ $action->render() }} + @endforeach +
    diff --git a/resources/views/components/includes/loading.blade.php b/resources/views/components/includes/loading.blade.php index 7c71772ed..6d7eaf7a3 100644 --- a/resources/views/components/includes/loading.blade.php +++ b/resources/views/components/includes/loading.blade.php @@ -1,35 +1,42 @@ -@aware(['isTailwind', 'isBootstrap', 'tableName', 'component']) +@aware(['tableName','isTailwind','isBootstrap']) @props(['colCount' => 1]) @php -$customAttributes['loader-wrapper'] = $component->getLoadingPlaceHolderWrapperAttributes(); -$customAttributes['loader-icon'] = $component->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(['w-full text-center h-screen place-items-center align-middle' => $isTailwind && ($customAttributes['loader-wrapper']['default'] ?? true)]) - ->class(['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' => $isTailwind && ($loaderRow['default'] ?? true), + 'd-none w-100 text-center align-items-center' => $isBootstrap && ($loaderRow['default'] ?? true), + ]) + ->except(['default','default-styling','default-colors']) +}}> + merge($loaderCell) + ->class([ + 'py-4' => $isTailwind && ($loaderCell['default'] ?? true), + 'py-4' => $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)]) - ->except('default'); - }} - >
    -
    {{ $component->getLoadingPlaceholderContent() }}
    +
    merge($loaderIcon) + ->class([ + 'lds-hourglass' => $isTailwind && ($loaderIcon['default'] ?? true), + 'lds-hourglass' => $isBootstrap && ($loaderIcon['default'] ?? true), + ]) + ->except(['default','default-styling','default-colors']) + }}>
    +
    {!! $this->getLoadingPlaceholderContent() !!}
    - - - -@endif + @endif + + diff --git a/resources/views/components/pagination.blade.php b/resources/views/components/pagination.blade.php index 82a87b373..633b31b24 100644 --- a/resources/views/components/pagination.blade.php +++ b/resources/views/components/pagination.blade.php @@ -1,158 +1,114 @@ -@aware(['component']) -@props(['rows']) +@aware(['isTailwind','isBootstrap','isBootstrap4', 'isBootstrap5', 'localisationPath']) +@props(['currentRows']) +@includeWhen( + $this->hasConfigurableAreaFor('before-pagination'), + $this->getConfigurableAreaFor('before-pagination'), + $this->getParametersForConfigurableArea('before-pagination') +) -@if ($component->hasConfigurableAreaFor('before-pagination')) - @include($component->getConfigurableAreaFor('before-pagination'), $component->getParametersForConfigurableArea('before-pagination')) -@endif - -@if ($component->isTailwind()) -
    - @if ($component->paginationVisibilityIsEnabled()) +
    getPaginationWrapperAttributesBag() }}> + @if ($this->paginationVisibilityIsEnabled()) + @if ($isTailwind)
    - @if ($component->paginationIsEnabled() && $component->isPaginationMethod('standard') && $rows->lastPage() > 1) + @if ($this->paginationIsEnabled && $this->isPaginationMethod('standard') && $currentRows->lastPage() > 1 && $this->showPaginationDetails)

    - @if($component->showPaginationDetails()) - @lang('Showing') - {{ $rows->firstItem() }} - @lang('to') - {{ $rows->lastItem() }} - @lang('of') + {{ __($localisationPath.'Showing') }} + {{ $currentRows->firstItem() }} + {{ __($localisationPath.'to') }} + {{ $currentRows->lastItem() }} + {{ __($localisationPath.'of') }} - @lang('results') - @endif + {{ __($localisationPath.'results') }}

    - @elseif ($component->paginationIsEnabled() && $component->isPaginationMethod('simple')) + @elseif ($this->paginationIsEnabled && $this->isPaginationMethod('simple') && $this->showPaginationDetails)

    - @if($component->showPaginationDetails()) - @lang('Showing') - {{ $rows->firstItem() }} - @lang('to') - {{ $rows->lastItem() }} - @endif + {{ __($localisationPath.'Showing') }} + {{ $currentRows->firstItem() }} + {{ __($localisationPath.'to') }} + {{ $currentRows->lastItem() }}

    - @elseif ($component->paginationIsEnabled() && $component->isPaginationMethod('cursor')) + @elseif ($this->paginationIsEnabled && $this->isPaginationMethod('cursor')) @else -

    - @lang('Showing') - {{ $rows->count() }} - @lang('results') -

    + @if($this->showPaginationDetails) +

    + {{ __($localisationPath.'Showing') }} + {{ $currentRows->count() }} + {{ __($localisationPath.'results') }} +

    + @endif @endif
    - @if ($component->paginationIsEnabled()) - {{ $rows->links('livewire-tables::specific.tailwind.'.(!$component->isPaginationMethod('standard') ? 'simple-' : '').'pagination') }} + @if ($this->paginationIsEnabled) + {{ $currentRows->links('livewire-tables::specific.tailwind.'.(!$this->isPaginationMethod('standard') ? 'simple-' : '').'pagination') }} @endif
    - @endif -
    -@elseif ($component->isBootstrap4()) -
    - @if ($component->paginationVisibilityIsEnabled()) - @if ($component->paginationIsEnabled() && $component->isPaginationMethod('standard') && $rows->lastPage() > 1) + @else + @if ($this->paginationIsEnabled && $this->isPaginationMethod('standard') && $currentRows->lastPage() > 1)
    - {{ $rows->links('livewire-tables::specific.bootstrap-4.pagination') }} + {{ $currentRows->links('livewire-tables::specific.bootstrap-4.pagination') }}
    -
    - @if($component->showPaginationDetails()) - @lang('Showing') - {{ $rows->count() ? $rows->firstItem() : 0 }} - @lang('to') - {{ $rows->count() ? $rows->lastItem() : 0 }} - @lang('of') +
    $isBootstrap4, + "text-md-end" => $isBootstrap5, + ])> + @if($this->showPaginationDetails) + {{ __($localisationPath.'Showing') }} + {{ $currentRows->count() ? $currentRows->firstItem() : 0 }} + {{ __($localisationPath.'to') }} + {{ $currentRows->count() ? $currentRows->lastItem() : 0 }} + {{ __($localisationPath.'of') }} - @lang('results') + {{ __($localisationPath.'results') }} @endif
    - @elseif ($component->paginationIsEnabled() && $component->isPaginationMethod('simple')) + @elseif ($this->paginationIsEnabled && $this->isPaginationMethod('simple'))
    - {{ $rows->links('livewire-tables::specific.bootstrap-4.simple-pagination') }} + {{ $currentRows->links('livewire-tables::specific.bootstrap-4.simple-pagination') }}
    -
    - @if($component->showPaginationDetails()) - @lang('Showing') - {{ $rows->count() ? $rows->firstItem() : 0 }} - @lang('to') - {{ $rows->count() ? $rows->lastItem() : 0 }} +
    $isBootstrap4, + "text-md-end" => $isBootstrap5, + ])> + @if($this->showPaginationDetails) + {{ __($localisationPath.'Showing') }} + {{ $currentRows->count() ? $currentRows->firstItem() : 0 }} + {{ __($localisationPath.'to') }} + {{ $currentRows->count() ? $currentRows->lastItem() : 0 }} @endif
    - @elseif ($component->paginationIsEnabled() && $component->isPaginationMethod('cursor')) + @elseif ($this->paginationIsEnabled && $this->isPaginationMethod('cursor'))
    - {{ $rows->links('livewire-tables::specific.bootstrap-4.simple-pagination') }} + {{ $currentRows->links('livewire-tables::specific.bootstrap-4.simple-pagination') }}
    @else
    - @lang('Showing') - {{ $rows->count() }} - @lang('results') -
    -
    - @endif - @endif -
    -@elseif ($component->isBootstrap5()) -
    - @if ($component->paginationVisibilityIsEnabled()) - @if ($component->paginationIsEnabled() && $component->isPaginationMethod('standard') && $rows->lastPage() > 1) -
    -
    - {{ $rows->links('livewire-tables::specific.bootstrap-4.pagination') }} -
    -
    - @if($component->showPaginationDetails()) - @lang('Showing') - {{ $rows->count() ? $rows->firstItem() : 0 }} - @lang('to') - {{ $rows->count() ? $rows->lastItem() : 0 }} - @lang('of') - - @lang('results') + @if($this->showPaginationDetails) + {{ __($localisationPath.'Showing') }} + {{ $currentRows->count() }} + {{ __($localisationPath.'results') }} @endif
    - @elseif ($component->paginationIsEnabled() && $component->isPaginationMethod('simple')) -
    -
    - {{ $rows->links('livewire-tables::specific.bootstrap-4.simple-pagination') }} -
    -
    - @if($component->showPaginationDetails()) - @lang('Showing') - {{ $rows->count() ? $rows->firstItem() : 0 }} - @lang('to') - {{ $rows->count() ? $rows->lastItem() : 0 }} - @endif -
    -
    - @elseif ($component->paginationIsEnabled() && $component->isPaginationMethod('cursor')) -
    -
    - {{ $rows->links('livewire-tables::specific.bootstrap-4.simple-pagination') }} -
    -
    - @else -
    -
    - @lang('Showing') - {{ $rows->count() }} - @lang('results') -
    -
    @endif @endif -
    -@endif + @endif +
    -@if ($component->hasConfigurableAreaFor('after-pagination')) - @include($component->getConfigurableAreaFor('after-pagination'), $component->getParametersForConfigurableArea('after-pagination')) -@endif \ No newline at end of file +@includeWhen( + $this->hasConfigurableAreaFor('after-pagination'), + $this->getConfigurableAreaFor('after-pagination'), + $this->getParametersForConfigurableArea('after-pagination') +) diff --git a/resources/views/components/table.blade.php b/resources/views/components/table.blade.php index 58b3366fa..a972275b0 100644 --- a/resources/views/components/table.blade.php +++ b/resources/views/components/table.blade.php @@ -1,4 +1,4 @@ -@aware(['component', 'tableName']) +@aware([ 'tableName','isTailwind','isBootstrap']) @php $customAttributes = [ @@ -9,23 +9,28 @@ ]; @endphp -@if ($component->isTailwind()) +@if ($isTailwind)
    merge($customAttributes['wrapper']) - ->class(['shadow overflow-y-auto border-b border-gray-200 dark:border-gray-700 sm:rounded-lg' => $customAttributes['wrapper']['default'] ?? true]) - ->except('default') }} + ->class([ + 'shadow overflow-y-auto border-b border-gray-200 dark:border-gray-700 sm:rounded-lg' => $customAttributes['wrapper']['default'] ?? true + ]) + ->except(['default','default-styling','default-colors']) }} > merge($customAttributes['table']) ->class(['min-w-full divide-y divide-gray-200 dark:divide-none' => $customAttributes['table']['default'] ?? true]) - ->except('default') }} + ->except(['default','default-styling','default-colors']) }} + > merge($customAttributes['thead']) - ->class(['bg-gray-50 dark:bg-gray-800' => $customAttributes['thead']['default'] ?? true]) - ->except('default') }} + ->class([ + 'bg-gray-50 dark:bg-gray-800' => $customAttributes['thead']['default'] ?? true + ]) + ->except(['default','default-styling','default-colors']) }} > {{ $thead }} @@ -36,37 +41,39 @@ wire:key="{{ $tableName }}-tbody" id="{{ $tableName }}-tbody" {{ $attributes->merge($customAttributes['tbody']) - ->class(['bg-white divide-y divide-gray-200 dark:bg-gray-800 dark:divide-none' => $customAttributes['tbody']['default'] ?? true]) - ->except('default') }} + ->class([ + 'bg-white divide-y divide-gray-200 dark:bg-gray-800 dark:divide-none' => $customAttributes['tbody']['default'] ?? true + ]) + ->except(['default','default-styling','default-colors']) }} > {{ $slot }} - @if (isset($tfoot)) + @isset($tfoot) {{ $tfoot }} - @endif + @endisset
    -@elseif ($component->isBootstrap()) +@elseif ($isBootstrap)
    merge($customAttributes['wrapper']) ->class(['table-responsive' => $customAttributes['wrapper']['default'] ?? true]) - ->except('default') }} + ->except(['default','default-styling','default-colors']) }} > merge($customAttributes['table']) ->class(['laravel-livewire-table table' => $customAttributes['table']['default'] ?? true]) - ->except('default') + ->except(['default','default-styling','default-colors']) }} > merge($customAttributes['thead']) ->class(['' => $customAttributes['thead']['default'] ?? true]) - ->except('default') }} + ->except(['default','default-styling','default-colors']) }} > {{ $thead }} @@ -78,16 +85,16 @@ id="{{ $tableName }}-tbody" {{ $attributes->merge($customAttributes['tbody']) ->class(['' => $customAttributes['tbody']['default'] ?? true]) - ->except('default') }} + ->except(['default','default-styling','default-colors']) }} > {{ $slot }} - @if (isset($tfoot)) + @isset($tfoot) {{ $tfoot }} - @endif + @endisset
    @endif diff --git a/resources/views/components/table/collapsed-columns.blade.php b/resources/views/components/table/collapsed-columns.blade.php index 49569281a..c46097a7f 100644 --- a/resources/views/components/table/collapsed-columns.blade.php +++ b/resources/views/components/table/collapsed-columns.blade.php @@ -1,67 +1,49 @@ -@aware(['component', 'tableName']) +@aware([ 'tableName', 'primaryKey','isTailwind','isBootstrap']) @props(['row', 'rowIndex']) -@if ($component->collapsingColumnsAreEnabled() && $component->hasCollapsedColumns()) - @php - $colspan = $component->getColspanCount(); - $columns = collect(); - - if($component->shouldCollapseAlways()) - { - $columns->push($component->getCollapsedAlwaysColumns()); - } - if ($component->shouldCollapseOnMobile() && $component->shouldCollapseOnTablet()) { - $columns->push($component->getCollapsedMobileColumns()); - $columns->push($component->getCollapsedTabletColumns()); - } elseif ($component->shouldCollapseOnTablet() && ! $component->shouldCollapseOnMobile()) { - $columns->push($component->getCollapsedTabletColumns()); - } elseif ($component->shouldCollapseOnMobile() && ! $component->shouldCollapseOnTablet()) { - $columns->push($component->getCollapsedMobileColumns()); - } - - $columns = $columns->collapse(); - @endphp - - $component->isTailwind(), - 'd-none' => $component->isBootstrap() - ]) +@if ($this->collapsingColumnsAreEnabled && $this->hasCollapsedColumns) + @php($customAttributes = $this->getTrAttributes($row, $rowIndex)) + merge([ + 'wire:loading.class.delay' => 'opacity-50 dark:bg-gray-900 dark:opacity-60', + 'wire:key' => $tableName.'-row-'.$row->{$primaryKey}.'-collapsed-contents', + ]) + ->merge($customAttributes) + ->class([ + 'hidden bg-white dark:bg-gray-700 dark:text-white rappasoft-striped-row' => ($isTailwind && ($customAttributes['default'] ?? true) && $rowIndex % 2 === 0), + 'hidden bg-gray-50 dark:bg-gray-800 dark:text-white rappasoft-striped-row' => ($isTailwind && ($customAttributes['default'] ?? true) && $rowIndex % 2 !== 0), + 'd-none bg-light rappasoft-striped-row' => ($isBootstrap && $rowIndex % 2 === 0 && ($customAttributes['default'] ?? true)), + 'd-none bg-white rappasoft-striped-row' => ($isBootstrap && $rowIndex % 2 !== 0 && ($customAttributes['default'] ?? true)), + ]) + ->except(['default','default-styling','default-colors']) + }} > - $component->isTailwind(), - 'pt-3 p-2' => $component->isBootstrap(), - ]) - colspan="{{ $colspan }}" - > + $isTailwind, + 'text-start pt-3 p-2' => $isBootstrap, + ])>
    - @foreach($columns as $colIndex => $column) - @continue($column->isHidden()) - @continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column)) - -

    $component->isTailwind() && $column->shouldCollapseAlways(), - 'block mb-2 sm:hidden' => $component->isTailwind() && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && !$column->shouldCollapseOnMobile(), - 'block mb-2 md:hidden' => $component->isTailwind() && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && $column->shouldCollapseOnMobile(), - 'block mb-2 lg:hidden' => $component->isTailwind() && !$column->shouldCollapseAlways() && ($column->shouldCollapseOnTablet() || $column->shouldCollapseOnMobile()), - - 'd-block mb-2' => $component->isBootstrap() && $column->shouldCollapseAlways(), - 'd-block mb-2 d-sm-none' => $component->isBootstrap() && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && !$column->shouldCollapseOnMobile(), - 'd-block mb-2 d-md-none' => $component->isBootstrap() && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && $column->shouldCollapseOnMobile(), - 'd-block mb-2 d-lg-none' => $component->isBootstrap() && !$column->shouldCollapseAlways() && ($column->shouldCollapseOnTablet() || $column->shouldCollapseOnMobile()), - - ]) - > - {{ $column->getTitle() }}: {{ $column->renderContents($row) }} + @foreach($this->getCollapsedColumnsForContent as $colIndex => $column) + +

    $isTailwind, + 'sm:block' => $isTailwind && $column->shouldCollapseAlways(), + 'sm:block md:hidden' => $isTailwind && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && $column->shouldCollapseOnMobile(), + 'sm:block lg:hidden' => $isTailwind && !$column->shouldCollapseAlways() && ($column->shouldCollapseOnTablet() || $column->shouldCollapseOnMobile()), + + 'd-block mb-2' => $isBootstrap, + 'd-sm-none' => $isBootstrap && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && !$column->shouldCollapseOnMobile(), + 'd-md-none' => $isBootstrap && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && $column->shouldCollapseOnMobile(), + 'd-lg-none' => $isBootstrap && !$column->shouldCollapseAlways() && ($column->shouldCollapseOnTablet() || $column->shouldCollapseOnMobile()), + ])> + {{ $column->getTitle() }}: + @if($column->isHtml()) + {!! $column->setIndexes($rowIndex, $colIndex)->renderContents($row) !!} + @else + {{ $column->setIndexes($rowIndex, $colIndex)->renderContents($row) }} + @endif

    @endforeach
    diff --git a/resources/views/components/table/empty.blade.php b/resources/views/components/table/empty.blade.php index d854ad890..705f93d48 100644 --- a/resources/views/components/table/empty.blade.php +++ b/resources/views/components/table/empty.blade.php @@ -1,19 +1,19 @@ -@aware(['component']) +@aware(['isTailwind','isBootstrap']) -@php($attributes = $attributes->merge(['wire:key' => 'empty-message-'.$component->getId()])) +@php($attributes = $attributes->merge(['wire:key' => 'empty-message-'.$this->getId()])) -@if ($component->isTailwind()) +@if ($isTailwind) - +
    - {{ $component->getEmptyMessage() }} + {{ $this->getEmptyMessage() }}
    -@elseif ($component->isBootstrap()) +@elseif ($isBootstrap) - - {{ $component->getEmptyMessage() }} + + {{ $this->getEmptyMessage() }} @endif diff --git a/resources/views/components/table/td.blade.php b/resources/views/components/table/td.blade.php index 1ae7e41d6..9fae459d3 100644 --- a/resources/views/components/table/td.blade.php +++ b/resources/views/components/table/td.blade.php @@ -1,28 +1,30 @@ -@aware(['component', 'row', 'rowIndex', 'tableName']) +@aware([ 'row', 'rowIndex', 'tableName', 'primaryKey','isTailwind','isBootstrap']) @props(['column', 'colIndex']) @php - $customAttributes = $component->getTdAttributes($column, $row, $colIndex, $rowIndex) + $customAttributes = $this->getTdAttributes($column, $row, $colIndex, $rowIndex) @endphp -isClickable()) - @if($component->getTableRowUrlTarget($row) === "navigate") wire:navigate href="{{ $component->getTableRowUrl($row) }}" - @else onclick="window.open('{{ $component->getTableRowUrl($row) }}', '{{ $component->getTableRowUrlTarget($row) ?? '_self' }}')" + @if($this->getTableRowUrlTarget($row) === 'navigate') wire:navigate href="{{ $this->getTableRowUrl($row) }}" + @else onclick="window.open('{{ $this->getTableRowUrl($row) }}', '{{ $this->getTableRowUrlTarget($row) ?? '_self' }}')" @endif @endif {{ $attributes->merge($customAttributes) - ->class(['px-6 py-4 whitespace-nowrap text-sm font-medium dark:text-white' => $component->isTailwind() && ($customAttributes['default'] ?? true)]) - ->class(['hidden' => $component->isTailwind() && $column && $column->shouldCollapseAlways()]) - ->class(['hidden md:table-cell' => $component->isTailwind() && $column && $column->shouldCollapseOnMobile()]) - ->class(['hidden lg:table-cell' => $component->isTailwind() && $column && $column->shouldCollapseOnTablet()]) - ->class(['' => $component->isBootstrap() && ($customAttributes['default'] ?? true)]) - ->class(['d-none' => $component->isBootstrap() && $column && $column->shouldCollapseAlways()]) - ->class(['d-none d-md-table-cell' => $component->isBootstrap() && $column && $column->shouldCollapseOnMobile()]) - ->class(['d-none d-lg-table-cell' => $component->isBootstrap() && $column && $column->shouldCollapseOnTablet()]) - ->style(['cursor:pointer' => $component->isBootstrap()]) - ->except('default') + ->class([ + 'px-6 py-4 whitespace-nowrap text-sm font-medium dark:text-white' => $isTailwind && ($customAttributes['default'] ?? true), + 'hidden' => $isTailwind && $column && $column->shouldCollapseAlways(), + 'hidden md:table-cell' => $isTailwind && $column && $column->shouldCollapseOnMobile(), + 'hidden lg:table-cell' => $isTailwind && $column && $column->shouldCollapseOnTablet(), + '' => $isBootstrap && ($customAttributes['default'] ?? true), + 'd-none' => $isBootstrap && $column && $column->shouldCollapseAlways(), + 'd-none d-md-table-cell' => $isBootstrap && $column && $column->shouldCollapseOnMobile(), + 'd-none d-lg-table-cell' => $isBootstrap && $column && $column->shouldCollapseOnTablet(), + 'laravel-livewire-tables-cursor' => $isBootstrap && $column && $column->isClickable(), + ]) + ->except(['default','default-styling','default-colors']) }} > {{ $slot }} diff --git a/resources/views/components/table/td/bulk-actions.blade.php b/resources/views/components/table/td/bulk-actions.blade.php index f9b4db46b..1b4049042 100644 --- a/resources/views/components/table/td/bulk-actions.blade.php +++ b/resources/views/components/table/td/bulk-actions.blade.php @@ -1,32 +1,21 @@ -@aware(['component', 'tableName']) +@aware([ 'tableName','primaryKey', 'isTailwind', 'isBootstrap', 'isBootstrap4', 'isBootstrap5']) @props(['row', 'rowIndex']) @php - $customAttributes = $component->getBulkActionsTdAttributes(); - $bulkActionsTdCheckboxAttributes = $component->getBulkActionsTdCheckboxAttributes(); - $theme = $component->getTheme(); + $tdAttributes = $this->getBulkActionsTdAttributes; + $tdCheckboxAttributes = $this->getBulkActionsTdCheckboxAttributes; @endphp -@if ($component->bulkActionsAreEnabled() && $component->hasBulkActions()) - +@if ($this->showBulkActionsSections()) +
    $theme === 'tailwind', - 'form-check' => $theme === 'bootstrap-5', + 'inline-flex rounded-md shadow-sm' => $isTailwind, + 'form-check' => $isBootstrap5, ])> - merge($bulkActionsTdCheckboxAttributes)->class([ - 'rounded border-gray-300 text-indigo-600 shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600' => ($theme === 'tailwind') && ($bulkActionsTdCheckboxAttributes['default'] ?? true), - 'form-check-input' => ($theme === 'bootstrap-5') && ($bulkActionsTdCheckboxAttributes['default'] ?? true), - 'except' => 'default', - ]) - }} +
    diff --git a/resources/views/components/table/td/collapsed-columns.blade.php b/resources/views/components/table/td/collapsed-columns.blade.php index 29248b1cd..078c1e39b 100644 --- a/resources/views/components/table/td/collapsed-columns.blade.php +++ b/resources/views/components/table/td/collapsed-columns.blade.php @@ -1,49 +1,52 @@ -@aware(['component', 'tableName']) +@aware([ 'tableName','isTailwind','isBootstrap']) @props(['rowIndex', 'hidden' => false]) -@if ($component->collapsingColumnsAreEnabled() && $component->hasCollapsedColumns()) - @if ($component->isTailwind()) - merge(['class' => 'p-3 table-cell text-center ']) - ->class(['sm:hidden' => !$component->shouldCollapseAlways() && !$component->shouldCollapseOnTablet()]) - ->class(['md:hidden' => !$component->shouldCollapseAlways() && !$component->shouldCollapseOnTablet() && $component->shouldCollapseOnMobile()]) - ->class(['lg:hidden' => !$component->shouldCollapseAlways() && ($component->shouldCollapseOnTablet() || $component->shouldCollapseOnMobile())]) - }} - :class="currentlyReorderingStatus ? 'laravel-livewire-tables-reorderingMinimised' : ''" - > - @if (! $hidden) - - @endif - - @elseif ($component->isBootstrap()) - class(['d-sm-none' => !$component->shouldCollapseAlways() && !$component->shouldCollapseOnTablet()]) - ->class(['d-md-none' => !$component->shouldCollapseAlways() && !$component->shouldCollapseOnTablet() && $component->shouldCollapseOnMobile()]) - ->class(['d-lg-none' => !$component->shouldCollapseAlways() && ($component->shouldCollapseOnTablet() || $component->shouldCollapseOnMobile())]) - }} - :class="currentlyReorderingStatus ? 'laravel-livewire-tables-reorderingMinimised' : ''" - > - @if (! $hidden) - - @endif - - @endif +@if ($this->collapsingColumnsAreEnabled && $this->hasCollapsedColumns) + merge() + ->class([ + 'p-3 table-cell text-center' => $isTailwind, + 'sm:hidden' => $isTailwind && !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet(), + 'md:hidden' => $isTailwind && !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet() && $this->shouldCollapseOnMobile(), + 'lg:hidden' => $isTailwind && !$this->shouldCollapseAlways() && ($this->shouldCollapseOnTablet() || $this->shouldCollapseOnMobile()), + 'd-sm-none' => $isBootstrap && !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet(), + 'd-md-none' => $isBootstrap && !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet() && $this->shouldCollapseOnMobile(), + 'd-lg-none' => $isBootstrap && !$this->shouldCollapseAlways() && ($this->shouldCollapseOnTablet() || $this->shouldCollapseOnMobile()), + ]) + }} + :class="currentlyReorderingStatus ? 'laravel-livewire-tables-reorderingMinimised' : ''" + > + @if (! $hidden) + + @endif + @endif diff --git a/resources/views/components/table/td/plain.blade.php b/resources/views/components/table/td/plain.blade.php index f59391b4c..d47872a03 100644 --- a/resources/views/components/table/td/plain.blade.php +++ b/resources/views/components/table/td/plain.blade.php @@ -1,25 +1,30 @@ -@aware(['component', 'rowIndex', 'rowID']) +@aware([ 'rowIndex', 'rowID','isTailwind','isBootstrap']) @props(['column' => null, 'customAttributes' => [], 'displayMinimisedOnReorder' => false, 'hideUntilReorder' => false]) -@if ($component->isTailwind()) + +@if ($isTailwind) merge($customAttributes) - ->class(['px-6 py-4 whitespace-nowrap text-sm font-medium dark:text-white' => $customAttributes['default'] ?? true]) - ->class(['hidden' => $column && $column->shouldCollapseAlways()]) - ->class(['hidden md:table-cell' => $column && $column->shouldCollapseOnMobile()]) - ->class(['hidden lg:table-cell' => $column && $column->shouldCollapseOnTablet()]) - ->except('default') + ->class([ + 'px-6 py-4 whitespace-nowrap text-sm font-medium dark:text-white' => $customAttributes['default'] ?? true, + 'hidden' => $column && $column->shouldCollapseAlways(), + 'hidden md:table-cell' => $column && $column->shouldCollapseOnMobile(), + 'hidden lg:table-cell' => $column && $column->shouldCollapseOnTablet(), + ]) + ->except(['default','default-styling','default-colors']) }} @if($hideUntilReorder) x-show="reorderDisplayColumn" @endif > {{ $slot }} -@elseif ($component->isBootstrap()) +@elseif ($isBootstrap) merge($customAttributes) - ->class(['' => $customAttributes['default'] ?? true]) - ->class(['d-none' => $column && $column->shouldCollapseAlways()]) - ->class(['d-none d-md-table-cell' => $column && $column->shouldCollapseOnMobile()]) - ->class(['d-none d-lg-table-cell' => $column && $column->shouldCollapseOnTablet()]) - ->except('default') + ->class([ + '' => $customAttributes['default'] ?? true, + 'd-none' => $column && $column->shouldCollapseAlways(), + 'd-none d-md-table-cell' => $column && $column->shouldCollapseOnMobile(), + 'd-none d-lg-table-cell' => $column && $column->shouldCollapseOnTablet(), + ]) + ->except(['default','default-styling','default-colors']) }}> {{ $slot }} diff --git a/resources/views/components/table/td/reorder.blade.php b/resources/views/components/table/td/reorder.blade.php index 90cce509e..6b8c9b7a5 100644 --- a/resources/views/components/table/td/reorder.blade.php +++ b/resources/views/components/table/td/reorder.blade.php @@ -1,8 +1,6 @@ -@aware(['component', 'tableName']) +@aware([ 'tableName', 'isTailwind', 'isBootstrap', 'isBootstrap4', 'isBootstrap5']) @props(['rowID', 'rowIndex']) -@php($theme = $component->getTheme()) - $theme === 'tailwind', - 'd-inline' => $theme === 'bootstrap-4' || $theme === 'bootstrap-5', + 'inline w-4 h-4' => $isTailwind, + 'd-inline' => ($isBootstrap4 || $isBootstrap5), ]) @style([ - 'width:1em; height:1em;' => $theme === 'bootstrap-4' || $theme === 'bootstrap-5', + 'width:1em; height:1em;' => ($isBootstrap4 || $isBootstrap5), ]) > diff --git a/resources/views/components/table/th.blade.php b/resources/views/components/table/th.blade.php index ee6333ee6..3562f4cf6 100644 --- a/resources/views/components/table/th.blade.php +++ b/resources/views/components/table/th.blade.php @@ -1,84 +1,61 @@ -@aware(['component', 'tableName']) +@aware(['isTailwind','isBootstrap']) @props(['column', 'index']) @php - $attributes = $attributes->merge(['wire:key' => $tableName . '-header-col-'.$column->getSlug()]); - $customAttributes = $component->getThAttributes($column); - $customSortButtonAttributes = $component->getThSortButtonAttributes($column); - $direction = $column->hasField() ? $component->getSort($column->getColumnSelectName()) : $component->getSort($column->getSlug()) ?? null ; + $allThAttributes = $this->getAllThAttributes($column); + $customThAttributes = $allThAttributes['customAttributes']; + $customSortButtonAttributes = $allThAttributes['sortButtonAttributes']; + $customLabelAttributes = $allThAttributes['labelAttributes']; + $customIconAttributes = $this->getThSortIconAttributes($column); + $direction = $column->hasField() ? $this->getSort($column->getColumnSelectName()) : $this->getSort($column->getSlug()) ?? null; @endphp -@if ($component->isTailwind()) - merge($customAttributes) - ->class(['px-6 py-3 text-left text-xs font-medium whitespace-nowrap text-gray-500 uppercase tracking-wider dark:bg-gray-800 dark:text-gray-400' => $customAttributes['default'] ?? true]) - ->class(['hidden' => $column->shouldCollapseAlways()]) - ->class(['hidden md:table-cell' => $column->shouldCollapseOnMobile()]) - ->class(['hidden lg:table-cell' => $column->shouldCollapseOnTablet()]) - ->except('default') - }} - > - @if($column->getColumnLabelStatus()) - @unless ($component->sortingIsEnabled() && ($column->isSortable() || $column->getSortCallback())) - {{ $column->getTitle() }} - @else - {{ $column->getTitle() }} +merge($customThAttributes) + ->class([ + 'text-gray-500 dark:bg-gray-800 dark:text-gray-400' => $isTailwind && (($customThAttributes['default-colors'] ?? true) || ($customThAttributes['default'] ?? true)), + 'px-6 py-3 text-left text-xs font-medium whitespace-nowrap uppercase tracking-wider' => $isTailwind && (($customThAttributes['default-styling'] ?? true) || ($customThAttributes['default'] ?? true)), + 'hidden' => $isTailwind && $column->shouldCollapseAlways(), + 'hidden md:table-cell' => $isTailwind && $column->shouldCollapseOnMobile(), + 'hidden lg:table-cell' => $isTailwind && $column->shouldCollapseOnTablet(), + '' => $isBootstrap && ($customThAttributes['default'] ?? true), + 'd-none' => $isBootstrap && $column->shouldCollapseAlways(), + 'd-none d-md-table-cell' => $isBootstrap && $column->shouldCollapseOnMobile(), + 'd-none d-lg-table-cell' => $isBootstrap && $column->shouldCollapseOnTablet(), + ]) + ->except(['default', 'default-colors', 'default-styling']) +}}> + @if($column->getColumnLabelStatus()) + @unless ($this->sortingIsEnabled() && ($column->isSortable() || $column->getSortCallback())) + + @else + @if ($isTailwind) - - @if ($direction === 'asc') - - - @elseif ($direction === 'desc') - - - @else - - @endif - + - @endunless - @endif - -@elseif ($component->isBootstrap()) - merge($customAttributes) - ->class(['' => $customAttributes['default'] ?? true]) - ->class(['d-none' => $column->shouldCollapseAlways()]) - ->class(['d-none d-md-table-cell' => $column->shouldCollapseOnMobile()]) - ->class(['d-none d-lg-table-cell' => $column->shouldCollapseOnTablet()]) - ->except('default') - }} - > - @if($column->getColumnLabelStatus()) - @unless ($component->sortingIsEnabled() && ($column->isSortable() || $column->getSortCallback())) - {{ $column->getTitle() }} - @else -
    - {{ $column->getTitle() }} + @elseif ($isBootstrap) +
    merge($customSortButtonAttributes) + ->class([ + 'd-flex align-items-center laravel-livewire-tables-cursor' => (($customSortButtonAttributes['default-styling'] ?? true) || ($customSortButtonAttributes['default'] ?? true)) + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) + }}> + + - - @if ($direction === 'asc') - - @elseif ($direction === 'desc') - - @else - - @endif -
    - @endunless - @endif - -@endif + @endif + + @endunless + @endif + diff --git a/resources/views/components/table/th/bulk-actions.blade.php b/resources/views/components/table/th/bulk-actions.blade.php index 2d846ff3d..64bc3632c 100644 --- a/resources/views/components/table/th/bulk-actions.blade.php +++ b/resources/views/components/table/th/bulk-actions.blade.php @@ -1,19 +1,18 @@ -@aware(['component', 'tableName']) +@aware(['tableName','isTailwind', 'isBootstrap']) @php - $customAttributes = $component->getBulkActionsThAttributes(); - $bulkActionsThCheckboxAttributes = $component->getBulkActionsThCheckboxAttributes(); - $theme = $component->getTheme(); + $customAttributes = $this->hasBulkActionsThAttributes ? $this->getBulkActionsThAttributes : $this->getAllThAttributes($this->getBulkActionsColumn())['customAttributes']; + $bulkActionsThCheckboxAttributes = $this->getBulkActionsThCheckboxAttributes(); @endphp -@if ($component->bulkActionsAreEnabled() && $component->hasBulkActions()) - +@if ($this->bulkActionsAreEnabled() && $this->hasBulkActions()) +
    $theme === 'tailwind', - 'form-check' => $theme === 'bootstrap-5', + 'inline-flex rounded-md shadow-sm' => $isTailwind, + 'form-check' => $isBootstrap, ]) > merge($bulkActionsThCheckboxAttributes)->class([ - 'rounded border-gray-300 text-indigo-600 shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600' => ($theme === 'tailwind') && ($bulkActionsThCheckboxAttributes['default'] ?? true), - 'form-check-input' => ($theme === 'bootstrap-5') && ($bulkActionsThCheckboxAttributes['default'] ?? true), - 'except' => 'default', - ]) + 'border-gray-300 text-indigo-600 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600' => $isTailwind && (($bulkActionsThCheckboxAttributes['default'] ?? true) || ($bulkActionsThCheckboxAttributes['default-colors'] ?? true)), + 'rounded shadow-sm transition duration-150 ease-in-out focus:ring focus:ring-opacity-50 ' => $isTailwind && (($bulkActionsThCheckboxAttributes['default'] ?? true) || ($bulkActionsThCheckboxAttributes['default-styling'] ?? true)), + 'form-check-input' => $isBootstrap && ($bulkActionsThCheckboxAttributes['default'] ?? true), + ])->except(['default','default-styling','default-colors']) }} />
    -@endif +@endif \ No newline at end of file diff --git a/resources/views/components/table/th/collapsed-columns.blade.php b/resources/views/components/table/th/collapsed-columns.blade.php index 2faf3e91e..e05021bd2 100644 --- a/resources/views/components/table/th/collapsed-columns.blade.php +++ b/resources/views/components/table/th/collapsed-columns.blade.php @@ -1,29 +1,16 @@ -@aware(['component', 'tableName']) - -@if ($component->collapsingColumnsAreEnabled() && $component->hasCollapsedColumns()) - @if ($component->isTailwind()) - merge(['class' => 'table-cell dark:bg-gray-800 laravel-livewire-tables-reorderingMinimised']) - ->class(['sm:hidden' => !$component->shouldCollapseOnTablet() && !$component->shouldCollapseAlways()]) - ->class(['md:hidden' => !$component->shouldCollapseOnMobile() && !$component->shouldCollapseOnTablet() && !$component->shouldCollapseAlways()]) - ->class(['lg:hidden' => !$component->shouldCollapseAlways()]) - }} - :class="{ 'laravel-livewire-tables-reorderingMinimised': ! currentlyReorderingStatus }" - > - @elseif ($component->isBootstrap()) - merge(['class' => 'd-table-cell laravel-livewire-tables-reorderingMinimised']) - ->class(['d-sm-none' => !$component->shouldCollapseOnTablet() && !$component->shouldCollapseAlways()]) - ->class(['d-md-none' => !$component->shouldCollapseOnMobile() && !$component->shouldCollapseOnTablet() && !$component->shouldCollapseAlways()]) - ->class(['d-lg-none' => !$component->shouldCollapseAlways()]) - }} - :class="{ 'laravel-livewire-tables-reorderingMinimised': ! currentlyReorderingStatus }" - > - @endif +@aware(['isTailwind', 'isBootstrap']) +@if ($this->collapsingColumnsAreEnabled && $this->hasCollapsedColumns) + merge() + ->class([ + 'table-cell dark:bg-gray-800 laravel-livewire-tables-reorderingMinimised' => $isTailwind, + 'sm:hidden' => $isTailwind && !$this->shouldCollapseOnTablet && !$this->shouldCollapseAlways, + 'md:hidden' => $isTailwind && !$this->shouldCollapseOnMobile && !$this->shouldCollapseOnTablet && !$this->shouldCollapseAlways, + 'lg:hidden' => $isTailwind && !$this->shouldCollapseAlways, + 'd-table-cell laravel-livewire-tables-reorderingMinimised' => $isBootstrap, + 'd-sm-none' => $isBootstrap && !$this->shouldCollapseOnTablet && !$this->shouldCollapseAlways, + 'd-md-none' => $isBootstrap && !$this->shouldCollapseOnMobile && !$this->shouldCollapseOnTablet && !$this->shouldCollapseAlways, + 'd-lg-none' => $isBootstrap && !$this->shouldCollapseAlways, + ]) + }}> @endif diff --git a/resources/views/components/table/th/label.blade.php b/resources/views/components/table/th/label.blade.php new file mode 100644 index 000000000..bafe25fdb --- /dev/null +++ b/resources/views/components/table/th/label.blade.php @@ -0,0 +1,4 @@ +@props(['columnTitle' => '', 'customLabelAttributes' => ['default' => true]]) +except(['default', 'default-colors', 'default-styling']) }}> + {{ $columnTitle }} + diff --git a/resources/views/components/table/th/plain.blade.php b/resources/views/components/table/th/plain.blade.php index eba3a091f..929bf1630 100644 --- a/resources/views/components/table/th/plain.blade.php +++ b/resources/views/components/table/th/plain.blade.php @@ -1,14 +1,12 @@ -@aware(['component']) +@aware(['isTailwind', 'isBootstrap']) @props(['displayMinimisedOnReorder' => false, 'hideUntilReorder' => false, 'customAttributes' => ['default' => true]]) -merge($customAttributes)->class([ - 'table-cell px-3 py-2 md:px-6 md:py-3 text-center md:text-left bg-gray-50 dark:bg-gray-800 laravel-livewire-tables-reorderingMinimised' => ($component->isTailwind()) && ($customAttributes['default'] ?? true), - 'laravel-livewire-tables-reorderingMinimised' => ($component->isBootstrap()) && ($customAttributes['default'] ?? true), - ]) - }} - @if($hideUntilReorder) :class="!reorderDisplayColumn && 'w-0 p-0 hidden'" @endif -> + 'table-cell px-3 py-2 md:px-6 md:py-3 text-center md:text-left laravel-livewire-tables-reorderingMinimised' => $isTailwind && (($customAttributes['default-styling'] ?? true) || ($customAttributes['default'] ?? true)), + 'bg-gray-50 dark:bg-gray-800' => $isTailwind && (($customAttributes['default-colors'] ?? true) || ($customAttributes['default'] ?? true)), + 'laravel-livewire-tables-reorderingMinimised' => $isBootstrap && (($customAttributes['default-colors'] ?? true) || ($customAttributes['default'] ?? true)), + ])->except(['default','default-styling','default-colors']) +}}> {{ $slot }} diff --git a/resources/views/components/table/th/reorder.blade.php b/resources/views/components/table/th/reorder.blade.php index 24efb20a5..a3b1f7e86 100644 --- a/resources/views/components/table/th/reorder.blade.php +++ b/resources/views/components/table/th/reorder.blade.php @@ -1,5 +1,18 @@ -@aware(['component', 'tableName']) +@php + $customThAttributes = $this->hasReorderThAttributes() ? $this->getReorderThAttributes() : $this->getAllThAttributes($this->getReorderColumn())['customAttributes']; +@endphp - +merge($customThAttributes) + ->class([ + 'table-cell px-6 py-3 text-left text-xs font-medium whitespace-nowrap uppercase tracking-wider' => $this->isTailwind && (($customThAttributes['default-styling'] ?? true) || ($customThAttributes['default'] ?? true)), + 'text-gray-500 dark:bg-gray-800 dark:text-gray-400' => $this->isTailwind && (($customThAttributes['default-colors'] ?? true) || ($customThAttributes['default'] ?? true)), + 'laravel-livewire-tables-reorderingMinimised' => $this->isBootstrap && ($customThAttributes['default'] ?? true), + ]) + ->except(['default','default-styling','default-colors']) + }} +>
    + diff --git a/resources/views/components/table/th/sort-icons.blade.php b/resources/views/components/table/th/sort-icons.blade.php new file mode 100644 index 000000000..26b077bbb --- /dev/null +++ b/resources/views/components/table/th/sort-icons.blade.php @@ -0,0 +1,80 @@ +@aware(['isTailwind', 'isBootstrap']) +@props(['direction' => 'none', 'customIconAttributes']) + $isTailwind, + 'relative d-flex align-items-center' => $isBootstrap + ]) +> + + @if($isTailwind) + @switch($direction) + @case('asc') + merge($customIconAttributes) + ->class([ + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + 'absolute opacity-100 group-hover:opacity-0', + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + merge($customIconAttributes) + ->class([ + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + 'absolute opacity-0 group-hover:opacity-100', + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + @break + @case('desc') + merge($customIconAttributes) + ->class([ + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + 'absolute opacity-100 group-hover:opacity-0', + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + merge($customIconAttributes) + ->class([ + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + 'absolute opacity-0 group-hover:opacity-100', + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + + @break + @default + merge($customIconAttributes) + ->class([ + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + 'absolute opacity-100 group-hover:opacity-0', + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + merge($customIconAttributes) + ->class([ + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + 'absolute opacity-0 group-hover:opacity-100', + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + @endswitch + + + @else + @switch($direction) + @case('asc') + merge($customIconAttributes) + ->class([ + 'laravel-livewire-tables-btn-smaller ms-1' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + @break + @case('desc') + merge($customIconAttributes) + ->class([ + 'laravel-livewire-tables-btn-smaller ms-1' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + @break + @default + merge($customIconAttributes) + ->class([ + 'laravel-livewire-tables-btn-smaller ms-1' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + @endswitch + @endif + diff --git a/resources/views/components/table/tr.blade.php b/resources/views/components/table/tr.blade.php index fba5f1601..92ef2955e 100644 --- a/resources/views/components/table/tr.blade.php +++ b/resources/views/components/table/tr.blade.php @@ -1,33 +1,35 @@ -@aware(['component', 'tableName']) +@aware([ 'tableName','primaryKey','isTailwind','isBootstrap']) @props(['row', 'rowIndex']) @php - $customAttributes = $component->getTrAttributes($row, $rowIndex); + $customAttributes = $this->getTrAttributes($row, $rowIndex); @endphp hasDisplayLoadingPlaceholder()) - wire:loading.remove + @if($this->hasDisplayLoadingPlaceholder()) + wire:loading.class.add="hidden d-none" @else - wire:loading.class.delay="opacity-50 dark:bg-gray-900 dark:opacity-60" + wire:loading.class.delay="opacity-50 dark:bg-gray-900 dark:opacity-60" @endif - id="{{ $tableName }}-row-{{ $row->{$component->getPrimaryKey()} }}" + id="{{ $tableName }}-row-{{ $row->{$primaryKey} }}" :draggable="currentlyReorderingStatus" - wire:key="{{ $tableName }}-tablerow-tr-{{ $row->{$component->getPrimaryKey()} }}" + wire:key="{{ $tableName }}-tablerow-tr-{{ $row->{$primaryKey} }}" loopType="{{ ($rowIndex % 2 === 0) ? 'even' : 'odd' }}" {{ $attributes->merge($customAttributes) - ->class(['bg-white dark:bg-gray-700 dark:text-white rappasoft-striped-row' => ($component->isTailwind() && ($customAttributes['default'] ?? true) && $rowIndex % 2 === 0)]) - ->class(['bg-gray-50 dark:bg-gray-800 dark:text-white rappasoft-striped-row' => ($component->isTailwind() && ($customAttributes['default'] ?? true) && $rowIndex % 2 !== 0)]) - ->class(['cursor-pointer' => ($component->isTailwind() && $component->hasTableRowUrl() && ($customAttributes['default'] ?? true))]) - ->class(['bg-light rappasoft-striped-row' => ($component->isBootstrap() && $rowIndex % 2 === 0 && ($customAttributes['default'] ?? true))]) - ->class(['bg-white rappasoft-striped-row' => ($component->isBootstrap() && $rowIndex % 2 !== 0 && ($customAttributes['default'] ?? true))]) - ->except(['default']) + ->class([ + 'bg-white dark:bg-gray-700 dark:text-white rappasoft-striped-row' => ($isTailwind && ($customAttributes['default'] ?? true) && $rowIndex % 2 === 0), + 'bg-gray-50 dark:bg-gray-800 dark:text-white rappasoft-striped-row' => ($isTailwind && ($customAttributes['default'] ?? true) && $rowIndex % 2 !== 0), + 'cursor-pointer' => ($isTailwind && $this->hasTableRowUrl() && ($customAttributes['default'] ?? true)), + 'bg-light rappasoft-striped-row' => ($isBootstrap && $rowIndex % 2 === 0 && ($customAttributes['default'] ?? true)), + 'bg-white rappasoft-striped-row' => ($isBootstrap && $rowIndex % 2 !== 0 && ($customAttributes['default'] ?? true)), + ]) + ->except(['default','default-styling','default-colors']) }} > diff --git a/resources/views/components/table/tr/bulk-actions.blade.php b/resources/views/components/table/tr/bulk-actions.blade.php index dc61e89ab..64a788d99 100644 --- a/resources/views/components/table/tr/bulk-actions.blade.php +++ b/resources/views/components/table/tr/bulk-actions.blade.php @@ -1,141 +1,100 @@ -@aware(['component', 'tableName']) -@props(['rows']) +@aware([ 'tableName', 'isTailwind', 'isBootstrap', 'localisationPath']) -@if ($component->bulkActionsAreEnabled() && $component->hasBulkActions()) +@if ($this->bulkActionsAreEnabled() && $this->hasBulkActions()) @php - $colspan = $component->getColspanCount(); - $selectAll = $component->selectAllIsEnabled(); - $simplePagination = $component->isPaginationMethod('simple'); + $colspan = $this->getColspanCount(); + $selectAll = $this->selectAllIsEnabled(); + $simplePagination = $this->isPaginationMethod('simple'); @endphp - @if ($component->isTailwind()) - - - - + + @endif diff --git a/resources/views/components/table/tr/footer.blade.php b/resources/views/components/table/tr/footer.blade.php index 041a3a027..d9681d779 100644 --- a/resources/views/components/table/tr/footer.blade.php +++ b/resources/views/components/table/tr/footer.blade.php @@ -1,8 +1,7 @@ -@aware(['component', 'tableName']) -@props(['rows', 'filterGenericData']) +@aware([ 'tableName']) {{-- Adds a Column For Bulk Actions--}} @@ -17,12 +16,19 @@ @endif - @foreach($this->getColumns() as $colIndex => $column) - @continue($column->isHidden()) - @continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column)) - @continue($column->isReorderColumn() && !$this->getCurrentlyReorderingStatus() && $this->getHideReorderColumnUnlessReorderingStatus()) - - {{ $column->getFooterContents($rows, $filterGenericData) }} + @foreach($this->selectedVisibleColumns as $colIndex => $column) + + + @if($column->hasFooter() && $column->hasFooterCallback()) + @if($column->footerCallbackIsFilter()) + {{ $column->getFooterFilter($column->getFooterCallback(), $this->getFilterGenericData) }} + @elseif($column->footerCallbackIsString()) + {{ $column->getFooterFilter($this->getFilterByKey($column->getFooterCallback()), $this->getFilterGenericData) }} + @else + {{ $column->getNewFooterContents($this->getRows) }} + @endif + @endif + @endforeach diff --git a/resources/views/components/table/tr/plain.blade.php b/resources/views/components/table/tr/plain.blade.php index 1650d5ed7..ba7c3d695 100644 --- a/resources/views/components/table/tr/plain.blade.php +++ b/resources/views/components/table/tr/plain.blade.php @@ -1,22 +1,26 @@ -@aware(['component']) +@aware(['isTailwind','isBootstrap']) @props(['customAttributes' => [], 'displayMinimisedOnReorder' => true]) -@if ($component->isTailwind()) +@if ($isTailwind) merge($customAttributes) - ->class(['bg-white dark:bg-gray-700 dark:text-white' => $customAttributes['default'] ?? true]) - ->class(['laravel-livewire-tables-reorderingMinimised']) - ->except('default') + ->class([ + 'laravel-livewire-tables-reorderingMinimised', + 'bg-white dark:bg-gray-700 dark:text-white' => ($customAttributes['default'] ?? true), + ]) + ->except(['default','default-styling','default-colors']) }} > {{ $slot }} -@elseif ($component->isBootstrap()) +@elseif ($isBootstrap) merge($customAttributes) - ->class(['' => $customAttributes['default'] ?? true]) - ->class(['laravel-livewire-tables-reorderingMinimised']) - ->except('default') + ->class([ + 'laravel-livewire-tables-reorderingMinimised', + '' => $customAttributes['default'] ?? true, + ]) + ->except(['default','default-styling','default-colors']) }} > {{ $slot }} diff --git a/resources/views/components/table/tr/secondary-header.blade.php b/resources/views/components/table/tr/secondary-header.blade.php index 629f4a1ab..6e3ca28c0 100644 --- a/resources/views/components/table/tr/secondary-header.blade.php +++ b/resources/views/components/table/tr/secondary-header.blade.php @@ -1,14 +1,13 @@ -@aware(['component', 'tableName']) -@props(['rows', 'filterGenericData']) +@aware([ 'tableName']) {{-- TODO: Remove --}} - @if ($this->bulkActionsAreEnabled() && $this->hasBulkActions()) + @if ($this->showBulkActionsSections) @endif @@ -16,13 +15,17 @@ @endif - @foreach($this->getColumns() as $colIndex => $column) - @continue($column->isHidden()) - @continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column)) - @continue($column->isReorderColumn() && !$this->getCurrentlyReorderingStatus() && $this->getHideReorderColumnUnlessReorderingStatus()) - - - {{ $column->getSecondaryHeaderContents($rows, $filterGenericData) }} + @foreach($this->selectedVisibleColumns as $colIndex => $column) + + @if($column->hasSecondaryHeader() && $column->hasSecondaryHeaderCallback()) + @if( $column->secondaryHeaderCallbackIsFilter()) + {{ $column->getSecondaryHeaderFilter($column->getSecondaryHeaderCallback(), $this->getFilterGenericData) }} + @elseif($column->secondaryHeaderCallbackIsString()) + {{ $column->getSecondaryHeaderFilter($this->getFilterByKey($column->getSecondaryHeaderCallback()), $this->getFilterGenericData) }} + @else + {{ $column->getNewSecondaryHeaderContents($this->getRows) }} + @endif + @endif @endforeach diff --git a/resources/views/components/tools.blade.php b/resources/views/components/tools.blade.php index 6e0b2f489..e2d2ef574 100644 --- a/resources/views/components/tools.blade.php +++ b/resources/views/components/tools.blade.php @@ -1,8 +1,13 @@ -@aware(['component']) +@aware(['isTailwind','isBootstrap']) -
    $component->isTailwind(), - 'd-flex flex-column ' => ($component->isBootstrap()), -])> +
    merge($this->getToolsAttributes) + ->class([ + 'flex-col' => $isTailwind && ($this->getToolsAttributes['default-styling'] ?? true), + 'd-flex flex-column' => $isBootstrap && ($this->getToolsAttributes['default-styling'] ?? true) + ]) + ->except(['default','default-styling','default-colors']) + }} +> {{ $slot }}
    diff --git a/resources/views/components/tools/filter-label.blade.php b/resources/views/components/tools/filter-label.blade.php index aca95ed29..2274d74d4 100644 --- a/resources/views/components/tools/filter-label.blade.php +++ b/resources/views/components/tools/filter-label.blade.php @@ -1,25 +1,25 @@ -@aware(['component', 'tableName']) -@props(['filter', 'filterLayout' => 'popover', 'tableName' => 'table', 'isTailwind' => false, 'isBootstrap' => false, 'isBootstrap4' => false, 'isBootstrap5' => false]) +@aware([ 'tableName']) +@props(['filter', 'filterLayout' => 'popover', 'tableName' => 'table', 'isTailwind' => false, 'isBootstrap' => false, 'isBootstrap4' => false, 'isBootstrap5' => false, 'for' => null]) @php - $customLabelAttributes = $filter->getFilterLabelAttributes(); + $filterLabelAttributes = $filter->getFilterLabelAttributes(); + $customLabelAttributes = $filter->getLabelAttributes(); @endphp @if($filter->hasCustomFilterLabel() && !$filter->hasCustomPosition()) @include($filter->getCustomFilterLabel(),['filter' => $filter, 'filterLayout' => $filterLayout, 'tableName' => $tableName, 'isTailwind' => $isTailwind, 'isBootstrap' => $isBootstrap, 'isBootstrap4' => $isBootstrap4, 'isBootstrap5' => $isBootstrap5, 'customLabelAttributes' => $customLabelAttributes]) @elseif(!$filter->hasCustomPosition()) -
    diff --git a/resources/views/components/tools/filters/date.blade.php b/resources/views/components/tools/filters/date.blade.php index 6191a299e..b32b38bbb 100644 --- a/resources/views/components/tools/filters/date.blade.php +++ b/resources/views/components/tools/filters/date.blade.php @@ -1,20 +1,17 @@
    $isTailwind, - "mb-3 mb-md-0 input-group" => $isBootstrap, + 'rounded-md shadow-sm' => $isTailwind, + 'mb-3 mb-md-0 input-group' => $isBootstrap, ])> - getWireMethod("filterComponents.".$filter->getKey()) }} - wire:key="{{ $filter->generateWireKey($tableName, 'date') }}" - id="{{ $tableName }}-filter-{{ $filter->getKey() }}@if($filter->hasCustomPosition())-{{ $filter->getCustomPosition() }}@endif" - type="date" - @if($filter->hasConfig('min')) min="{{ $filter->getConfig('min') }}" @endif - @if($filter->hasConfig('max')) max="{{ $filter->getConfig('max') }}" @endif - @if($filter->hasConfig('placeholder')) placeholder="{{ $filter->getConfig('placeholder') }}" @endif - @class([ - "block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:text-white dark:border-gray-600" => $isTailwind, - "form-control" => $isBootstrap, - ]) - /> + getWireMethod('filterComponents.'.$filter->getKey()) !!} {{ + $filterInputAttributes->merge() + ->class([ + 'block w-full rounded-md shadow-sm transition duration-150 ease-in-out focus:ring focus:ring-opacity-50' => $isTailwind && ($filterInputAttributes['default-styling'] ?? true), + 'border-gray-300 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-800 dark:text-white dark:border-gray-600' => $isTailwind && ($filterInputAttributes['default-colors'] ?? true), + 'form-control' => $isBootstrap, + ]) + ->except(['default-styling','default-colors']) + }} />
    -
    \ No newline at end of file +
    diff --git a/resources/views/components/tools/filters/datetime.blade.php b/resources/views/components/tools/filters/datetime.blade.php index 5abd43c94..74d80455a 100644 --- a/resources/views/components/tools/filters/datetime.blade.php +++ b/resources/views/components/tools/filters/datetime.blade.php @@ -2,20 +2,17 @@
    $isTailwind, - "mb-3 mb-md-0 input-group" => $isBootstrap, + 'rounded-md shadow-sm' => $isTailwind, + 'mb-3 mb-md-0 input-group' => $isBootstrap, ])> - hasConfig('min')) min="{{ $filter->getConfig('min') }}" @endif - @if($filter->hasConfig('max')) max="{{ $filter->getConfig('max') }}" @endif - @if($filter->hasConfig('placeholder')) placeholder="{{ $filter->getConfig('placeholder') }}" @endif - @class([ - "block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:text-white dark:border-gray-600" => $isTailwind, - "form-control" => $isBootstrap, - ]) - /> + getWireMethod('filterComponents.'.$filter->getKey()) !!} {{ + $filterInputAttributes->merge() + ->class([ + 'block w-full rounded-md shadow-sm transition duration-150 ease-in-out focus:ring focus:ring-opacity-50' => $isTailwind && ($filterInputAttributes['default-styling'] ?? true), + 'border-gray-300 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-800 dark:text-white dark:border-gray-600' => $isTailwind && ($filterInputAttributes['default-colors'] ?? true), + 'form-control' => $isBootstrap, + ]) + ->except(['default-styling','default-colors']) + }} />
    -
    \ No newline at end of file + diff --git a/resources/views/components/tools/filters/livewire-component-array-filter.blade.php b/resources/views/components/tools/filters/livewire-component-array-filter.blade.php new file mode 100644 index 000000000..237d062fa --- /dev/null +++ b/resources/views/components/tools/filters/livewire-component-array-filter.blade.php @@ -0,0 +1,4 @@ +
    + + +
    diff --git a/resources/views/components/tools/filters/livewire-component-filter.blade.php b/resources/views/components/tools/filters/livewire-component-filter.blade.php index 89b407133..a430faf9f 100644 --- a/resources/views/components/tools/filters/livewire-component-filter.blade.php +++ b/resources/views/components/tools/filters/livewire-component-filter.blade.php @@ -1,5 +1,4 @@
    - - +
    diff --git a/resources/views/components/tools/filters/multi-select-dropdown.blade.php b/resources/views/components/tools/filters/multi-select-dropdown.blade.php index 76cbc55c5..a0f1a580b 100644 --- a/resources/views/components/tools/filters/multi-select-dropdown.blade.php +++ b/resources/views/components/tools/filters/multi-select-dropdown.blade.php @@ -1,39 +1,23 @@
    - @if ($isTailwind) -
    - -
    - @elseif ($isBootstrap) +
    + @endif + @if ($isTailwind) +
    @endif -
    \ No newline at end of file + diff --git a/resources/views/components/tools/filters/multi-select.blade.php b/resources/views/components/tools/filters/multi-select.blade.php index 884a84441..6ee391a71 100644 --- a/resources/views/components/tools/filters/multi-select.blade.php +++ b/resources/views/components/tools/filters/multi-select.blade.php @@ -1,63 +1,58 @@
    - @if ($isTailwind) -
    -
    - -
    \ No newline at end of file +
    diff --git a/resources/views/components/tools/filters/number-range.blade.php b/resources/views/components/tools/filters/number-range.blade.php index b05c4fd7d..ecdc29573 100644 --- a/resources/views/components/tools/filters/number-range.blade.php +++ b/resources/views/components/tools/filters/number-range.blade.php @@ -2,37 +2,38 @@ $filterKey = $filter->getKey(); $currentMin = $minRange = $filter->getConfig('minRange'); $currentMax = $maxRange = $filter->getConfig('maxRange'); + $suffix = $filter->hasConfig('suffix') ? '--suffix:"'. $filter->getConfig('suffix') .'";' : ''; + $prefix = $filter->hasConfig('prefix') ? '--prefix:"'.$filter->getConfig('prefix').'";' : ''; @endphp -
    - - -
    + +
    $isTailwind, 'mt-4 h-22 w-100 pb-4 pt-2 grid gap-10' => $isBootstrap, - ]) wire:ignore> -
    $isTailwind, - 'range-slider flat w-100' => $isBootstrap, - ]) - style='--min:{{ $minRange }}; - --max:{{ $maxRange }}; - --suffix:"{{ $filter->getConfig('suffix') }}"; - ' x-init="updateStyles"> - - - - - -
    -
    + ]) + wire:ignore + > +
    $isTailwind, + 'range-slider flat w-100' => $isBootstrap, + ]) + style=' --min:{{ $minRange }}; --max:{{ $maxRange }}; {{ $suffix . $prefix }}' + > + + + + +
    -
    \ No newline at end of file +
    +
    diff --git a/resources/views/components/tools/filters/number.blade.php b/resources/views/components/tools/filters/number.blade.php index e31854848..0c8e766cb 100644 --- a/resources/views/components/tools/filters/number.blade.php +++ b/resources/views/components/tools/filters/number.blade.php @@ -1,22 +1,18 @@
    -
    $isTailwind, - "mb-3 mb-md-0 input-group" => $isBootstrap, + 'rounded-md shadow-sm' => $isTailwind, + 'mb-3 mb-md-0 input-group' => $isBootstrap, ])> - getWireMethod("filterComponents.".$filter->getKey()) }} - wire:key="{{ $filter->generateWireKey($tableName, 'number') }}" - id="{{ $tableName }}-filter-{{ $filter->getKey() }}@if($filter->hasCustomPosition())-{{ $filter->getCustomPosition() }}@endif" - type="number" - @if($filter->hasConfig('min')) min="{{ $filter->getConfig('min') }}" @endif - @if($filter->hasConfig('max')) max="{{ $filter->getConfig('max') }}" @endif - @if($filter->hasConfig('placeholder')) placeholder="{{ $filter->getConfig('placeholder') }}" @endif - @class([ - "block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:text-white dark:border-gray-600" => $isTailwind, - "form-control" => $isBootstrap, - ]) - /> + getWireMethod('filterComponents.'.$filter->getKey()) !!} {{ + $filterInputAttributes->merge() + ->class([ + 'block w-full rounded-md shadow-sm transition duration-150 ease-in-out focus:ring focus:ring-opacity-50' => $isTailwind && ($filterInputAttributes['default-styling'] ?? true), + 'border-gray-300 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-800 dark:text-white dark:border-gray-600' => $isTailwind && ($filterInputAttributes['default-colors'] ?? true), + 'form-control' => $isBootstrap, + ]) + ->except(['default-styling','default-colors']) + }} />
    -
    \ No newline at end of file +
    diff --git a/resources/views/components/tools/filters/select.blade.php b/resources/views/components/tools/filters/select.blade.php index 42fcdad08..9a0ca9683 100644 --- a/resources/views/components/tools/filters/select.blade.php +++ b/resources/views/components/tools/filters/select.blade.php @@ -5,15 +5,16 @@ 'rounded-md shadow-sm' => $isTailwind, 'inline' => $isBootstrap, ])> - getWireMethod('filterComponents.'.$filter->getKey()) !!} {{ + $filterInputAttributes->merge() + ->class([ + 'block w-full transition duration-150 ease-in-out rounded-md shadow-sm focus:ring focus:ring-opacity-50' => $isTailwind && ($filterInputAttributes['default-styling'] ?? true), + 'border-gray-300 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-800 dark:text-white dark:border-gray-600' => $isTailwind && ($filterInputAttributes['default-colors'] ?? true), + 'form-control' => $isBootstrap4 && ($filterInputAttributes['default-styling'] ?? true), + 'form-select' => $isBootstrap5 && ($filterInputAttributes['default-styling'] ?? true), ]) - > + ->except(['default-styling','default-colors']) + }}> @foreach($filter->getOptions() as $key => $value) @if (is_iterable($value)) @@ -27,4 +28,4 @@ @endforeach - \ No newline at end of file + diff --git a/resources/views/components/tools/filters/text-field.blade.php b/resources/views/components/tools/filters/text-field.blade.php index 11bc7af79..74d80455a 100644 --- a/resources/views/components/tools/filters/text-field.blade.php +++ b/resources/views/components/tools/filters/text-field.blade.php @@ -2,19 +2,17 @@
    $isTailwind, - "mb-3 mb-md-0 input-group" => $isBootstrap, + 'rounded-md shadow-sm' => $isTailwind, + 'mb-3 mb-md-0 input-group' => $isBootstrap, ])> - getWireMethod("filterComponents.".$filter->getKey()) }} - wire:key="{{ $filter->generateWireKey($tableName, 'text') }}" - id="{{ $tableName }}-filter-{{ $filter->getKey() }}@if($filter->hasCustomPosition())-{{ $filter->getCustomPosition() }}@endif" - type="text" - @if($filter->hasConfig('placeholder')) placeholder="{{ $filter->getConfig('placeholder') }}" @endif - @if($filter->hasConfig('maxlength')) maxlength="{{ $filter->getConfig('maxlength') }}" @endif - @class([ - "block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:text-white dark:border-gray-600" => $isTailwind, - "form-control" => $isBootstrap, - ]) - /> + getWireMethod('filterComponents.'.$filter->getKey()) !!} {{ + $filterInputAttributes->merge() + ->class([ + 'block w-full rounded-md shadow-sm transition duration-150 ease-in-out focus:ring focus:ring-opacity-50' => $isTailwind && ($filterInputAttributes['default-styling'] ?? true), + 'border-gray-300 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-800 dark:text-white dark:border-gray-600' => $isTailwind && ($filterInputAttributes['default-colors'] ?? true), + 'form-control' => $isBootstrap, + ]) + ->except(['default-styling','default-colors']) + }} />
    - \ No newline at end of file + diff --git a/resources/views/components/tools/sorting-pills.blade.php b/resources/views/components/tools/sorting-pills.blade.php index 2ecd4cb53..25a2bc973 100644 --- a/resources/views/components/tools/sorting-pills.blade.php +++ b/resources/views/components/tools/sorting-pills.blade.php @@ -1,30 +1,44 @@ -@aware(['component', 'tableName']) +@aware([ 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5', 'localisationPath']) -@if ($component->isTailwind()) +@if ($isTailwind)
    - @if ($component->sortingPillsAreEnabled() && $component->hasSorts()) + @if ($this->sortingPillsAreEnabled() && $this->hasSorts())
    - @lang('Applied Sorting'): + {{ __($localisationPath.'Applied Sorting') }}: - @foreach($component->getSorts() as $columnSelectName => $direction) - @php($column = $component->getColumnBySelectName($columnSelectName) ?? $component->getColumnBySlug($columnSelectName)) + @foreach($this->getSorts() as $columnSelectName => $direction) + @php($column = $this->getColumnBySelectName($columnSelectName) ?? $this->getColumnBySlug($columnSelectName)) @continue(is_null($column)) @continue($column->isHidden()) - @continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column)) + @continue($this->columnSelectIsEnabled && ! $this->columnSelectIsEnabledForColumn($column)) merge($this->getSortingPillsItemAttributes()) + ->class([ + 'inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium leading-4 capitalize' => $this->getSortingPillsItemAttributes()['default-styling'], + 'bg-indigo-100 text-indigo-800 dark:bg-indigo-200 dark:text-indigo-900' => $this->getSortingPillsItemAttributes()['default-colors'], + ]) + ->except(['default-styling', 'default-colors']) + }} > - {{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirection($component, $direction) }} + {{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirectionLabel($direction, $this->getDefaultSortingLabelAsc, $this->getDefaultSortingLabelDesc) }} @@ -34,39 +48,60 @@ class="flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justif wire:click.prevent="clearSorts" class="focus:outline-none active:outline-none" > - - @lang('Clear') + merge($this->getSortingPillsClearAllButtonAttributes()) + ->class([ + 'inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium' => $this->getSortingPillsClearAllButtonAttributes()['default-styling'], + 'bg-gray-100 text-gray-800 dark:bg-gray-200 dark:text-gray-900' => $this->getSortingPillsClearAllButtonAttributes()['default-colors'], + ]) + ->except(['default-styling', 'default-colors']) + }} + > + {{ __($localisationPath.'Clear') }}
    @endif
    -@elseif ($component->isBootstrap4()) +@elseif ($isBootstrap4)
    - @if ($component->sortingPillsAreEnabled() && $component->hasSorts()) + @if ($this->sortingPillsAreEnabled() && $this->hasSorts())
    - @lang('Applied Sorting'): + {{ __($localisationPath.'Applied Sorting') }}: - @foreach($component->getSorts() as $columnSelectName => $direction) - @php($column = $component->getColumnBySelectName($columnSelectName) ?? $component->getColumnBySlug($columnSelectName)) + @foreach($this->getSorts() as $columnSelectName => $direction) + @php($column = $this->getColumnBySelectName($columnSelectName) ?? $this->getColumnBySlug($columnSelectName)) @continue(is_null($column)) @continue($column->isHidden()) - @continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column)) + @continue($this->columnSelectIsEnabled && ! $this->columnSelectIsEnabledForColumn($column)) merge($this->getSortingPillsItemAttributes()) + ->class([ + 'badge badge-pill badge-info d-inline-flex align-items-center' => $this->getSortingPillsItemAttributes()['default-styling'], + ]) + ->except(['default-styling', 'default-colors']) + }} > - {{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirection($component, $direction) }} + {{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirectionLabel($direction, $this->getDefaultSortingLabelAsc, $this->getDefaultSortingLabelDesc) }} merge($this->getSortingPillsClearSortButtonAttributes()) + ->class([ + 'text-white ml-2' => $this->getSortingPillsClearSortButtonAttributes()['default-styling'], + ]) + ->except(['default-styling', 'default-colors']) + }} > - @lang('Remove sort option') - + {{ __($localisationPath.'Remove sort option') }} + @endforeach @@ -74,39 +109,57 @@ class="text-white ml-2" merge($this->getSortingPillsClearAllButtonAttributes()) + ->class([ + 'badge badge-pill badge-light' => $this->getSortingPillsClearAllButtonAttributes()['default-styling'], + ]) + ->except(['default-styling', 'default-colors']) + }} > - @lang('Clear') + {{ __($localisationPath.'Clear') }}
    @endif
    -@elseif ($component->isBootstrap5()) +@elseif ($isBootstrap5)
    - @if ($component->sortingPillsAreEnabled() && $component->hasSorts()) + @if ($this->sortingPillsAreEnabled() && $this->hasSorts())
    - @lang('Applied Sorting'): + {{ __($localisationPath.'Applied Sorting') }}: - @foreach($component->getSorts() as $columnSelectName => $direction) - @php($column = $component->getColumnBySelectName($columnSelectName) ?? $component->getColumnBySlug($columnSelectName)) + @foreach($this->getSorts() as $columnSelectName => $direction) + @php($column = $this->getColumnBySelectName($columnSelectName) ?? $this->getColumnBySlug($columnSelectName)) @continue(is_null($column)) @continue($column->isHidden()) - @continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column)) + @continue($this->columnSelectIsEnabled && ! $this->columnSelectIsEnabledForColumn($column)) merge($this->getSortingPillsItemAttributes()) + ->class([ + 'badge rounded-pill bg-info d-inline-flex align-items-center' => $this->getSortingPillsItemAttributes()['default-styling'], + ]) + ->except(['default-styling', 'default-colors']) + }} > - {{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirection($component, $direction) }} + {{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirectionLabel($direction, $this->getDefaultSortingLabelAsc, $this->getDefaultSortingLabelDesc) }} merge($this->getSortingPillsClearSortButtonAttributes()) + ->class([ + 'text-white ms-2' => $this->getSortingPillsClearSortButtonAttributes()['default-styling'], + ]) + ->except(['default-styling', 'default-colors']) + }} > - @lang('Remove sort option') - + {{ __($localisationPath.'Remove sort option') }} + @endforeach @@ -114,9 +167,15 @@ class="text-white ms-2" merge($this->getSortingPillsClearAllButtonAttributes()) + ->class([ + 'badge rounded-pill bg-light text-dark text-decoration-none' => $this->getSortingPillsClearAllButtonAttributes()['default-styling'], + ]) + ->except(['default-styling', 'default-colors']) + }} > - @lang('Clear') + {{ __($localisationPath.'Clear') }}
    @endif diff --git a/resources/views/components/tools/toolbar.blade.php b/resources/views/components/tools/toolbar.blade.php index a753403c6..6f4a482fd 100644 --- a/resources/views/components/tools/toolbar.blade.php +++ b/resources/views/components/tools/toolbar.blade.php @@ -1,90 +1,82 @@ -@aware(['component', 'tableName']) -@props(['filterGenericData']) +@aware([ 'tableName','isTailwind','isBootstrap']) +@props([]) +@php($toolBarAttributes = $this->getToolBarAttributesBag) -@if ($component->hasConfigurableAreaFor('before-toolbar')) - @include($component->getConfigurableAreaFor('before-toolbar'), $component->getParametersForConfigurableArea('before-toolbar')) -@endif - -
    $component->isBootstrap(), - 'md:flex md:justify-between mb-4 px-4 md:p-0' => $component->isTailwind(), - ]) +
    merge() + ->class([ + 'md:flex md:justify-between mb-4 px-4 md:p-0' => $isTailwind && ($toolBarAttributes['default-styling'] ?? true), + 'd-md-flex justify-content-between mb-3' => $isBootstrap && ($toolBarAttributes['default-styling'] ?? true), + ]) + ->except(['default','default-styling','default-colors']) + }} >
    $component->isBootstrap(), - 'w-full mb-4 md:mb-0 md:w-2/4 md:flex space-y-4 md:space-y-0 md:space-x-2' => $component->isTailwind(), + 'd-md-flex' => $isBootstrap, + 'w-full mb-4 md:mb-0 md:w-2/4 md:flex space-y-4 md:space-y-0 md:space-x-2' => $isTailwind, ]) > - @if ($component->hasConfigurableAreaFor('toolbar-left-start')) + @if ($this->hasConfigurableAreaFor('toolbar-left-start'))
    $component->isBootstrap(), - 'flex rounded-md shadow-sm' => $component->isTailwind(), + 'mb-3 mb-md-0 input-group' => $isBootstrap, + 'flex rounded-md shadow-sm' => $isTailwind, ])> - @include($component->getConfigurableAreaFor('toolbar-left-start'), $component->getParametersForConfigurableArea('toolbar-left-start')) + @include($this->getConfigurableAreaFor('toolbar-left-start'), $this->getParametersForConfigurableArea('toolbar-left-start'))
    @endif - @if ($component->reorderIsEnabled()) + @if ($this->showReorderButton()) @endif - @if ($component->searchIsEnabled() && $component->searchVisibilityIsEnabled()) + @if ($this->showSearchField()) @endif - @if ($component->filtersAreEnabled() && $component->filtersVisibilityIsEnabled() && $component->hasVisibleFilters()) - + @if ($this->showFiltersButton()) + + @endif + + @if($this->showActionsInToolbarLeft()) + @endif - @if ($component->hasConfigurableAreaFor('toolbar-left-end')) + @if ($this->hasConfigurableAreaFor('toolbar-left-end'))
    $component->isBootstrap(), - 'flex rounded-md shadow-sm' => $component->isTailwind(), + 'mb-3 mb-md-0 input-group' => $isBootstrap, + 'flex rounded-md shadow-sm' => $isTailwind, ])> - @include($component->getConfigurableAreaFor('toolbar-left-end'), $component->getParametersForConfigurableArea('toolbar-left-end')) + @include($this->getConfigurableAreaFor('toolbar-left-end'), $this->getParametersForConfigurableArea('toolbar-left-end'))
    @endif
    $component->isBootstrap(), - 'md:flex md:items-center space-y-4 md:space-y-0 md:space-x-2' => $component->isTailwind(), + 'd-md-flex' => $isBootstrap, + 'md:flex md:items-center space-y-4 md:space-y-0 md:space-x-2' => $isTailwind, ]) > - @if ($component->hasConfigurableAreaFor('toolbar-right-start')) - @include($component->getConfigurableAreaFor('toolbar-right-start'), $component->getParametersForConfigurableArea('toolbar-right-start')) + @includeWhen($this->hasConfigurableAreaFor('toolbar-right-start'), $this->getConfigurableAreaFor('toolbar-right-start'), $this->getParametersForConfigurableArea('toolbar-right-start')) + + @if($this->showActionsInToolbarRight()) + @endif - @if ($component->showBulkActionsDropdownAlpine()) + @if ($this->showBulkActionsDropdownAlpine() && $this->shouldAlwaysHideBulkActionsDropdownOption != true) @endif - @if ($component->columnSelectIsEnabled()) + @if ($this->columnSelectIsEnabled) @endif - @if ($component->paginationIsEnabled() && $component->perPageVisibilityIsEnabled()) + @if ($this->showPaginationDropdown()) @endif - @if ($component->hasConfigurableAreaFor('toolbar-right-end')) - @include($component->getConfigurableAreaFor('toolbar-right-end'), $component->getParametersForConfigurableArea('toolbar-right-end')) - @endif + @includeWhen($this->hasConfigurableAreaFor('toolbar-right-end'), $this->getConfigurableAreaFor('toolbar-right-end'), $this->getParametersForConfigurableArea('toolbar-right-end'))
    -@if ( - $component->filtersAreEnabled() && - $component->filtersVisibilityIsEnabled() && - $component->hasVisibleFilters() && - $component->isFilterLayoutSlideDown() -) - -@endif - -@if ($component->hasConfigurableAreaFor('after-toolbar')) -
    - @include($component->getConfigurableAreaFor('after-toolbar'), $component->getParametersForConfigurableArea('after-toolbar')) -
    -@endif diff --git a/resources/views/components/tools/toolbar/items/bulk-actions.blade.php b/resources/views/components/tools/toolbar/items/bulk-actions.blade.php index 82fe34ca1..12ea6bb18 100644 --- a/resources/views/components/tools/toolbar/items/bulk-actions.blade.php +++ b/resources/views/components/tools/toolbar/items/bulk-actions.blade.php @@ -1,40 +1,47 @@ -@aware(['component', 'tableName']) +@aware([ 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5', 'localisationPath'])
    $component->isBootstrap(), - 'w-full md:w-auto mb-4 md:mb-0' => $component->isTailwind(), + 'mb-3 mb-md-0' => $isBootstrap, + 'w-full md:w-auto mb-4 md:mb-0' => $isTailwind, ]) >
    $component->isBootstrap(), - 'relative inline-block text-left z-10 w-full md:w-auto' => $component->isTailwind(), + 'dropdown d-block d-md-inline' => $isBootstrap, + 'relative inline-block text-left z-10 w-full md:w-auto' => $isTailwind, ]) > - @if($component->isTailwind()) + @if($isTailwind)
    -
    +
    merge($this->getBulkActionsMenuAttributes) + ->class([ + 'bg-white dark:bg-gray-700 dark:text-white' => $isTailwind && ($this->getBulkActionsMenuAttributes['default-colors'] ?? true), + 'rounded-md shadow-xs' => $isTailwind && ($this->getBulkActionsMenuAttributes['default-styling'] ?? true), + ]) + ->except(['default','default-styling','default-colors']) + }} + > @else
    $component->isBootstrap4(), - 'dropdown-menu dropdown-menu-end w-100' => $component->isBootstrap5(), - ]) + {{ + $attributes->merge($this->getBulkActionsMenuAttributes) + ->class([ + 'dropdown-menu dropdown-menu-right w-100' => $isBootstrap4 && ($this->getBulkActionsMenuAttributes['default-styling'] ?? true), + 'dropdown-menu dropdown-menu-end w-100' => $isBootstrap5 && ($this->getBulkActionsMenuAttributes['default-styling'] ?? true), + ]) + ->except(['default','default-styling','default-colors']) + }} aria-labelledby="{{ $tableName }}-bulkActionsDropdown" > - @foreach ($component->getBulkActions() as $action => $title) + @foreach ($this->getBulkActions() as $action => $title) hasConfirmationMessage($action)) - wire:confirm="{{ $component->getBulkActionConfirmMessage($action) }}" + @if($this->hasConfirmationMessage($action)) + wire:confirm="{{ $this->getBulkActionConfirmMessage($action) }}" @endif wire:click="{{ $action }}" wire:key="{{ $tableName }}-bulk-action-{{ $action }}" - @class([ - 'dropdown-item' => $component->isBootstrap(), - ]) + {{ + $attributes->merge($this->getBulkActionsMenuItemAttributes) + ->class([ + 'dropdown-item' => $isBootstrap && ($this->getBulkActionsMenuItemAttributes['default-styling'] ?? true), + ]) + ->except(['default','default-styling','default-colors']) + }} > {{ $title }} diff --git a/resources/views/components/tools/toolbar/items/column-select.blade.php b/resources/views/components/tools/toolbar/items/column-select.blade.php index 040677d51..388b9171c 100644 --- a/resources/views/components/tools/toolbar/items/column-select.blade.php +++ b/resources/views/components/tools/toolbar/items/column-select.blade.php @@ -1,191 +1,229 @@ -@aware(['component', 'tableName']) -@if ($component->isTailwind()) - -@elseif ($component->isBootstrap()) -
    $component->getColumnSelectIsHiddenOnMobile() && $component->isBootstrap4(), - 'd-none d-md-block mb-3 mb-md-0 pl-0 pl-md-2' => $component->getColumnSelectIsHiddenOnTablet() && $component->isBootstrap4(), - 'd-none d-sm-block mb-3 mb-md-0 md-0 ms-md-2' => $component->getColumnSelectIsHiddenOnMobile() && $component->isBootstrap5(), - 'd-none d-md-block mb-3 mb-md-0 md-0 ms-md-2' => $component->getColumnSelectIsHiddenOnTablet() && $component->isBootstrap5(), - ]) -> -
    $component->isBootstrap(), - ]) - wire:key="{{ $tableName }}-column-select-button" - > - - -
    $component->isBootstrap4(), - 'dropdown-menu dropdown-menu-end w-100' => $component->isBootstrap5(), - ]) - aria-labelledby="columnSelect-{{ $tableName }}" - > - @if($component->isBootstrap4()) -
    - -
    - @elseif($component->isBootstrap5()) -
    - getSelectableSelectedColumns()->count() == $component->getSelectableColumns()->count()) checked wire:click="deselectAllColumns" @else unchecked wire:click="selectAllColumns" @endif - /> - - -
    - @endif - - @foreach ($component->getColumnsForColumnSelect() as $columnSlug => $columnTitle) -
    $component->isBootstrap5(), - ]) - > - @if ($component->isBootstrap4()) - - @elseif($component->isBootstrap5()) - - - @endif -
    - @endforeach -
    -
    -
    - -@endif +@aware([ 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5', 'localisationPath']) +@if ($isTailwind) + +@elseif ($isBootstrap) +
    $this->getColumnSelectIsHiddenOnMobile() && $isBootstrap4, + 'd-none d-md-block mb-3 mb-md-0 pl-0 pl-md-2' => $this->getColumnSelectIsHiddenOnTablet() && $isBootstrap4, + 'd-none d-sm-block mb-3 mb-md-0 md-0 ms-md-2' => $this->getColumnSelectIsHiddenOnMobile() && $isBootstrap5, + 'd-none d-md-block mb-3 mb-md-0 md-0 ms-md-2' => $this->getColumnSelectIsHiddenOnTablet() && $isBootstrap5, + ]) + > +
    $isBootstrap, + ]) + wire:key="{{ $tableName }}-column-select-button" + > + + +
    $isBootstrap4, + 'dropdown-menu dropdown-menu-end w-100' => $isBootstrap5, + ]) + aria-labelledby="columnSelect-{{ $tableName }}" + > + @if($isBootstrap4) +
    + +
    + @elseif($isBootstrap5) +
    + merge($this->getColumnSelectMenuOptionCheckboxAttributes()) + ->class([ + 'form-check-input' => $this->getColumnSelectMenuOptionCheckboxAttributes()['default-styling'], + ]) + ->except(['default-styling', 'default-colors']) + }} + @if($this->getSelectableSelectedColumns()->count() == $this->getSelectableColumns()->count()) checked wire:click="deselectAllColumns" @else unchecked wire:click="selectAllColumns" @endif + /> + + +
    + @endif + + @foreach ($this->getColumnsForColumnSelect() as $columnSlug => $columnTitle) +
    $isBootstrap5, + ]) + > + @if ($isBootstrap4) + + @elseif($isBootstrap5) + merge($this->getColumnSelectMenuOptionCheckboxAttributes()) + ->class([ + 'form-check-input' => $this->getColumnSelectMenuOptionCheckboxAttributes()['default-styling'], + ]) + ->except(['default-styling', 'default-colors']) + }} + value="{{ $columnSlug }}" + /> + + @endif +
    + @endforeach +
    +
    +
    +@endif diff --git a/resources/views/components/tools/toolbar/items/filter-button.blade.php b/resources/views/components/tools/toolbar/items/filter-button.blade.php index 70e7b66fc..9340e7691 100644 --- a/resources/views/components/tools/toolbar/items/filter-button.blade.php +++ b/resources/views/components/tools/toolbar/items/filter-button.blade.php @@ -1,62 +1,62 @@ -@aware(['component', 'tableName']) -@props(['filterGenericData']) +@aware([ 'tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5', 'localisationPath']) +@props([]) -
    $component->isBootstrap4(), - 'ms-0 ms-md-2 mb-3 mb-md-0' => $component->isBootstrap5() && $component->searchIsEnabled(), - 'mb-3 mb-md-0' => $component->isBootstrap5() && !$component->searchIsEnabled(), + 'ml-0 ml-md-2 mb-3 mb-md-0' => $isBootstrap4, + 'ms-0 ms-md-2 mb-3 mb-md-0' => $isBootstrap5 && $this->searchIsEnabled(), + 'mb-3 mb-md-0' => $isBootstrap5 && !$this->searchIsEnabled(), ]) >
    isFilterLayoutPopover()) + @if ($this->isFilterLayoutPopover()) x-data="{ filterPopoverOpen: false }" x-on:keydown.escape.stop="if (!this.childElementOpen) { filterPopoverOpen = false }" x-on:mousedown.away="if (!this.childElementOpen) { filterPopoverOpen = false }" @endif @class([ - 'btn-group d-block d-md-inline' => $component->isBootstrap(), - 'relative block md:inline-block text-left' => $component->isTailwind(), + 'btn-group d-block d-md-inline' => $isBootstrap, + 'relative block md:inline-block text-left' => $isTailwind, ]) >
    - @if ($component->isFilterLayoutPopover()) - + @if ($this->isFilterLayoutPopover()) + @endif
    diff --git a/resources/views/components/tools/toolbar/items/filter-popover.blade.php b/resources/views/components/tools/toolbar/items/filter-popover.blade.php index ab36f3f63..2321f9f18 100644 --- a/resources/views/components/tools/toolbar/items/filter-popover.blade.php +++ b/resources/views/components/tools/toolbar/items/filter-popover.blade.php @@ -1,81 +1,59 @@ -@aware(['component', 'tableName']) -@if($component->isBootstrap()) -
      $component->isBootstrap4(), - 'dropdown-menu w-100' => $component->isBootstrap5(), - ]) - x-bind:class="{ 'show': filterPopoverOpen }" - role="menu" - > - @foreach ($component->getVisibleFilters() as $filter) -
      $component->isBootstrap(), - ]) - id="{{ $tableName }}-filter-{{ $filter->getKey() }}-wrapper" - > - {{ $filter->setGenericDisplayData($filterGenericData)->render() }} +@aware(['tableName']) +@if($this->isBootstrap) +
        merge($this->getFilterPopoverAttributes) + ->merge(['role' => 'menu']) + ->class([ + 'w-100' => $this->getFilterPopoverAttributes['default-width'] ?? true, + 'dropdown-menu mt-md-5' => $this->isBootstrap4, + 'dropdown-menu' => $this->isBootstrap5, + ]) }} x-bind:class="{ 'show': filterPopoverOpen }"> + @foreach ($this->getVisibleFilters() as $filter) +
        + {{ $filter->setGenericDisplayData($this->getFilterGenericData)->render() }}
        @endforeach - @if ($component->hasAppliedVisibleFiltersWithValuesThatCanBeCleared()) -
        $component->isBootstrap(), - ]) - > -
        - - + @if ($this->hasAppliedVisibleFiltersWithValuesThatCanBeCleared()) + + @endif
      @else -