-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit be61d2b
Showing
11 changed files
with
251 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: phpsa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Semantic Release | ||
|
||
on: [workflow_dispatch] | ||
|
||
jobs: | ||
release: | ||
name: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v3 | ||
id: semantic | ||
with: | ||
branches: | | ||
[ | ||
'+([0-9])?(.{+([0-9]),x}).x', | ||
'master', | ||
'main', | ||
'next', | ||
'next-major', | ||
{ | ||
name: 'beta', | ||
prerelease: true | ||
}, | ||
{ | ||
name: 'alpha', | ||
prerelease: true | ||
} | ||
] | ||
extra_plugins: | | ||
@semantic-release/commit-analyzer | ||
@semantic-release/git | ||
@semantic-release/changelog | ||
@semantic-release/exec | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SEMANTIC_RELEASE_PACKAGE: Filament Feed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
plugins: | ||
- "@semantic-release/commit-analyzer" | ||
- "@semantic-release/release-notes-generator" | ||
- - "@semantic-release/exec" | ||
- verifyReleaseCmd: "echo ${nextRelease.version} > VERSION.txt" | ||
- - "@semantic-release/changelog" | ||
- changelogFile: CHANGELOG.md | ||
- - "@semantic-release/github" | ||
- - "@semantic-release/git" | ||
- assets: | ||
- CHANGELOG.md | ||
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
branches: | ||
- "master" | ||
- "main" | ||
- "next" | ||
- "next-major" | ||
- "+([0-9])?(.{+([0-9]),x}).x" | ||
- name: "beta" | ||
prerelease: true | ||
- name: "alpha" | ||
prerelease: true |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright 2022 phspa | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[![Latest Version on Packagist](https://img.shields.io/packagist/v/phpsa/filament-password-reveal.svg?style=flat-square)](https://packagist.org/packages/phpsa/filament-password-reveal) | ||
[![Semantic Release](https://github.com/phpsa/filament-password-reveal/actions/workflows/release.yml/badge.svg)](https://github.com/phpsa/filament-password-reveal/actions/workflows/release.yml) | ||
[![Total Downloads](https://img.shields.io/packagist/dt/phpsa/filament-password-reveal.svg?style=flat-square)](https://packagist.org/packages/phpsa/filament-password-reveal) | ||
|
||
# Filament Password Reveal Input | ||
|
||
Password input that shows/hides the password when clicking on the eye | ||
|
||
https://filamentphp.com/docs/2.x/forms/fields#building-custom-fields | ||
https://codepen.io/framansi/pen/oNXEmdm | ||
|
||
## Installation | ||
|
||
You can install the package via composer: | ||
|
||
```bash | ||
composer require phpsa/filament-password-reveal | ||
``` | ||
|
||
## Changelog | ||
|
||
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. | ||
|
||
## Credits | ||
|
||
- [Phpsa](https://github.com/phpsa) | ||
|
||
## License | ||
|
||
The MIT License (MIT). Please see [License File](LICENSE.md) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "phpsa/filament-password-reveal", | ||
"description": "Password Input with optino to show", | ||
"keywords": [ | ||
"laravel", | ||
"user", | ||
"cli", | ||
"resource", | ||
"ui", | ||
"filament", | ||
"widget", | ||
"fun" | ||
], | ||
"homepage": "https://cgs4k.nz", | ||
"license": "MIT", | ||
"autoload": { | ||
"psr-4": { | ||
"Phpsa\\FilamentPasswordReveal\\": "src/" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Craig G Smith", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"minimum-stability": "dev", | ||
"require": { | ||
"php": "^8.0", | ||
"filament/filament": "^2.9", | ||
"spatie/laravel-package-tools": "^1.10" | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Phpsa\\FilamentPasswordReveal\\FilamentPasswordRevealProvider" | ||
] | ||
} | ||
}, | ||
"prefer-stable": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
@php | ||
$datalistOptions = $getDatalistOptions(); | ||
$sideLabelClasses = [ | ||
'whitespace-nowrap group-focus-within:text-primary-500', | ||
'text-gray-400' => ! $errors->has($getStatePath()), | ||
'text-danger-400' => $errors->has($getStatePath()), | ||
]; | ||
@endphp | ||
|
||
<x-dynamic-component :component="$getFieldWrapperView()" :id="$getId()" :label="$getLabel()" | ||
:label-sr-only="$isLabelHidden()" :helper-text="$getHelperText()" :hint="$getHint()" :hint-icon="$getHintIcon()" | ||
:required="$isRequired()" :state-path="$getStatePath()"> | ||
<div {{ $attributes->merge($getExtraAttributes())->class(['flex items-center space-x-1 rtl:space-x-reverse group | ||
filament-forms-text-input-component']) }}> | ||
@if ($label = $getPrefixLabel()) | ||
<span @class($sideLabelClasses)> | ||
{{ $label }} | ||
</span> | ||
@endif | ||
|
||
|
||
|
||
|
||
<div class="flex-1 relative" x-data="{show: false}"> | ||
<input :type="show ? 'text' : 'password'" | ||
dusk="filament.forms.{{ $getStatePath() }}" | ||
{!! ($autocomplete = $getAutocomplete()) ? "autocomplete=\"{$autocomplete}\"" : null !!} | ||
{!! $isAutofocused() ? 'autofocus' : null !!} | ||
{!! $isDisabled() ? 'disabled' : null !!} | ||
id="{{ $getId() }}" | ||
{!! filled($value = $getMaxValue()) ? "max=\"{$value}\"" : null !!} | ||
{!! ($placeholder = $getPlaceholder()) ? "placeholder=\"{$placeholder}\"" : null !!} | ||
{!! $isRequired() ? 'required' : null !!} | ||
{{ $getExtraInputAttributeBag()->class([ | ||
'block w-full transition duration-75 rounded-lg shadow-sm focus:border-primary-600 focus:ring-1 focus:ring-inset focus:ring-primary-600 disabled:opacity-70', | ||
'dark:bg-gray-700 dark:text-white' => config('forms.dark_mode'), | ||
'border-gray-300' => ! $errors->has($getStatePath()), | ||
'dark:border-gray-600' => (! $errors->has($getStatePath())) && config('forms.dark_mode'), | ||
'border-danger-600 ring-danger-600' => $errors->has($getStatePath()), | ||
]) }}> | ||
<div class="absolute inset-y-0 right-0 pr-2 flex items-center text-sm leading-5"> | ||
|
||
<svg class="h-5 dark:bg-gray-700 dark:text-white'" fill="none" @click="show = !show" :class="{'hidden': show, 'block':!show }" | ||
xmlns="http://www.w3.org/2000/svg" viewbox="0 0 576 512"> | ||
<path fill="currentColor" | ||
d="M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"> | ||
</path> | ||
</svg> | ||
|
||
<svg class="h-5 dark:bg-gray-700 dark:text-white'" fill="none" @click="show = !show" :class="{'block': show, 'hidden':!show }" | ||
xmlns="http://www.w3.org/2000/svg" viewbox="0 0 640 512"> | ||
<path fill="currentColor" | ||
d="M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"> | ||
</path> | ||
</svg> | ||
|
||
</div> | ||
</div> | ||
|
||
|
||
|
||
|
||
|
||
@if ($label = $getPostfixLabel()) | ||
<span @class($sideLabelClasses)> | ||
{{ $label }} | ||
</span> | ||
@endif | ||
</div> | ||
|
||
@if ($datalistOptions) | ||
<datalist id="{{ $getId() }}-list"> | ||
@foreach ($datalistOptions as $option) | ||
<option value="{{ $option }}" /> | ||
@endforeach | ||
</datalist> | ||
@endif | ||
</x-dynamic-component> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Phpsa\FilamentPasswordReveal; | ||
|
||
use Filament\PluginServiceProvider; | ||
use Spatie\LaravelPackageTools\Package; | ||
|
||
class FilamentPasswordRevealProvider extends PluginServiceProvider | ||
{ | ||
public static string $name = 'filament-password-reveal'; | ||
|
||
public function configurePackage(Package $package): void | ||
{ | ||
$package->name(static::$name)->hasViews(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Phpsa\FilamentPasswordReveal; | ||
|
||
use Filament\Forms\Components\TextInput; | ||
|
||
class Password extends TextInput | ||
{ | ||
protected string $view = 'filament-password-reveal::password'; | ||
} |