Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ features to your password inputs:

## Installation

> Upgrading to 2.0 from 1.x? Be sure to follow the [Upgrade](https://github.com/rawilk/filament-password-input/blob/main/upgrade.md) guide for breaking changes.
> Upgrading to 3.0 from 2.x? Be sure to follow the [Upgrade](https://github.com/rawilk/filament-password-input/blob/main/upgrade.md) guide for breaking changes.

You can install the package via composer:

Expand Down
17 changes: 17 additions & 0 deletions upgrade.md → UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Upgrade Guide

## Upgrade to 3.0 from 2.x

### Breaking changes
* This package now requires [Filament](https://filamentphp.com) 4.0 or greater.
* This package now requires Laravel 11 or greater.
* Change the `copyable()` method parameters to align with the new Filament copyable method:
```php
Password::make()
->copyable(
condition: true,
copyMessage: 'Copied',
copyMessageDuration: 2000,
color: 'primary',
),
```


## Upgrading to 2.0 from 1.x

I've attempted to document every breaking change, however I may have missed some. If you're having an issue upgrading, please raise an issue and/or PR an update to the upgrade guide if applicable.
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
}
],
"require": {
"php": "^8.1",
"filament/forms": "^3.2",
"illuminate/contracts": "^10.0|^11.0|^12.0",
"php": "^8.2",
"filament/forms": "^4.0",
"illuminate/contracts": "^11.0|^12.0",
"spatie/laravel-package-tools": "^1.14"
},
"require-dev": {
"laravel/pint": "^1.0",
"nunomaduro/collision": "^7.9|^8.0",
"orchestra/testbench": "^8.8|^9.0|^10.0",
"pestphp/pest": "^2.20|^3.7",
"pestphp/pest-plugin-laravel": "^2.2|^3.1",
"pestphp/pest-plugin-livewire": "^2.1|^3.0",
"nunomaduro/collision": "^8.0",
"orchestra/testbench": "^9.0|^10.0",
"pestphp/pest": "^3.7",
"pestphp/pest-plugin-laravel": "^3.1",
"pestphp/pest-plugin-livewire": "^3.0",
"spatie/laravel-ray": "^1.31"
},
"autoload": {
Expand Down
10 changes: 6 additions & 4 deletions src/Actions/CopyToClipboardAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

namespace Rawilk\FilamentPasswordInput\Actions;

use Filament\Forms\Components\Actions\Action;
use Filament\Forms\Components\Component;
use Filament\Actions\Action;
use Filament\Schemas\Components\Component;
use Filament\Support\Facades\FilamentIcon;
use Filament\Support\Icons\Heroicon;
use Illuminate\Support\Js;

class CopyToClipboardAction extends Action
Expand All @@ -17,7 +18,7 @@ protected function setUp(): void

$this->label(__('filament-password-input::password.actions.copy.tooltip'));

$this->icon(FilamentIcon::resolve('filament-password-input::copy') ?? 'heroicon-m-clipboard');
$this->icon(FilamentIcon::resolve('filament-password-input::copy') ?? Heroicon::OutlinedClipboardDocument);

$this->color('gray');

Expand Down Expand Up @@ -59,6 +60,7 @@ public function isHidden(): bool
return true;
}

return $this->getComponent()->isDisabled();
return $this->getSchemaComponent()->isDisabled() ||
$this->getSchemaComponent()->isReadOnly();
}
}
13 changes: 7 additions & 6 deletions src/Actions/RegeneratePasswordAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
namespace Rawilk\FilamentPasswordInput\Actions;

use Closure;
use Filament\Actions\Action;
use Filament\Actions\Concerns\CanCustomizeProcess;
use Filament\Forms\Components\Actions\Action;
use Filament\Forms\Components\Component;
use Filament\Forms\Set;
use Filament\Schemas\Components\Component;
use Filament\Schemas\Components\Utilities\Set;
use Filament\Support\Facades\FilamentIcon;
use Filament\Support\Icons\Heroicon;
use Illuminate\Support\Str;

class RegeneratePasswordAction extends Action
Expand All @@ -26,7 +27,7 @@ protected function setUp(): void

$this->label(__('filament-password-input::password.actions.regenerate.tooltip'));

$this->icon(FilamentIcon::resolve('filament-password-input::regenerate') ?? 'heroicon-o-key');
$this->icon(FilamentIcon::resolve('filament-password-input::regenerate') ?? Heroicon::OutlinedKey);

$this->color('gray');

Expand Down Expand Up @@ -79,7 +80,7 @@ public function isHidden(): bool
return true;
}

return $this->getComponent()->isDisabled() ||
$this->getComponent()->isReadOnly();
return $this->getSchemaComponent()->isDisabled() ||
$this->getSchemaComponent()->isReadOnly();
}
}
5 changes: 5 additions & 0 deletions src/Concerns/CanCopyToClipboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ trait CanCopyToClipboard

public function copyable(
bool|Closure $condition = true,
string|Closure|null $copyMessage = null,
int|Closure|null $copyMessageDuration = null,
string|array|Closure|null $color = null,
): static {
$this->copyMessage = $copyMessage;
$this->copyMessageDuration = $copyMessageDuration;

$action = CopyToClipboardAction::make()->visible($condition);

if ($color) {
Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/CanRegeneratePassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Rawilk\FilamentPasswordInput\Actions\RegeneratePasswordAction;

/**
* @mixin \Filament\Forms\Components\Component
* @mixin \Filament\Schemas\Components\Component
*/
trait CanRegeneratePassword
{
Expand Down