-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Livewire V2 #23
Changes from 7 commits
79bef5c
a2d7450
34fa9ff
715d9b0
cf96081
dea8d26
38f8f08
243993b
de81b87
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<button {{ $attributes->merge(['type' => 'submit', 'class' => 'inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray transition ease-in-out duration-150']) }}> | ||
<button {{ $attributes->merge(['type' => 'submit', 'class' => 'inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray disabled:opacity-25 transition ease-in-out duration-150']) }}> | ||
{{ $slot }} | ||
</button> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
@props(['id' => null, 'show', 'maxWidth']) | ||
@props(['id' => null, 'maxWidth' => null]) | ||
|
||
<x-jet-modal :id="$id" :show="$show" :max-width="$maxWidth ?? '2xl'"> | ||
<x-jet-modal :id="$id" :maxWidth="$maxWidth" {{ $attributes }}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default of I figure it's best to forward all props as well as |
||
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"> | ||
<div class="sm:flex sm:items-start"> | ||
<div class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
<!-- Token Name --> | ||
<div class="col-span-6 sm:col-span-4"> | ||
<x-jet-label for="name" value="Token Name" /> | ||
<x-jet-input id="name" type="text" class="mt-1 block w-full" wire:model="createApiTokenForm.name" autofocus /> | ||
<x-jet-input id="name" type="text" class="mt-1 block w-full" wire:model.defer="createApiTokenForm.name" autofocus /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've deferred all input updating. This way network requests will only be sent when a user performs a meaningful action like pressing "Create". |
||
<x-jet-input-error for="name" class="mt-2" /> | ||
</div> | ||
|
||
|
@@ -39,7 +39,7 @@ | |
Created. | ||
</x-jet-action-message> | ||
|
||
<x-jet-button wire:loading.class="opacity-25" wire:loading.attr="disabled"> | ||
<x-jet-button> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Livewire automatically disables submit buttons on form submission. Also, because we added |
||
Create | ||
</x-jet-button> | ||
</x-slot> | ||
|
@@ -94,7 +94,7 @@ | |
@endif | ||
|
||
<!-- Token Value Modal --> | ||
<x-jet-dialog-modal show="displayingToken"> | ||
<x-jet-dialog-modal wire:model="displayingToken"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To me
|
||
<x-slot name="title"> | ||
API Token | ||
</x-slot> | ||
|
@@ -110,14 +110,14 @@ | |
</x-slot> | ||
|
||
<x-slot name="footer"> | ||
<x-jet-secondary-button wire:click="$set('displayingToken', false)" wire:loading.class="opacity-25" wire:loading.attr="disabled"> | ||
<x-jet-secondary-button wire:click="$set('displayingToken', false)" wire:loading.attr="disabled"> | ||
Close | ||
</x-jet-secondary-button> | ||
</x-slot> | ||
</x-jet-dialog-modal> | ||
|
||
<!-- API Token Permissions Modal --> | ||
<x-jet-dialog-modal show="managingApiTokenPermissions"> | ||
<x-jet-dialog-modal wire:model="managingApiTokenPermissions"> | ||
<x-slot name="title"> | ||
API Token Permissions | ||
</x-slot> | ||
|
@@ -134,18 +134,18 @@ | |
</x-slot> | ||
|
||
<x-slot name="footer"> | ||
<x-jet-secondary-button wire:click="$set('managingApiTokenPermissions', false)" wire:loading.class="opacity-25" wire:loading.attr="disabled"> | ||
<x-jet-secondary-button wire:click="$set('managingApiTokenPermissions', false)" wire:loading.attr="disabled"> | ||
Nevermind | ||
</x-jet-secondary-button> | ||
|
||
<x-jet-button class="ml-2" wire:click="updateApiToken" wire:loading.class="opacity-25" wire:loading.attr="disabled"> | ||
<x-jet-button class="ml-2" wire:click="updateApiToken" wire:loading.attr="disabled"> | ||
Save | ||
</x-jet-button> | ||
</x-slot> | ||
</x-jet-dialog-modal> | ||
|
||
<!-- Delete Token Confirmation Modal --> | ||
<x-jet-confirmation-modal show="confirmingApiTokenDeletion"> | ||
<x-jet-confirmation-modal wire:model="confirmingApiTokenDeletion"> | ||
<x-slot name="title"> | ||
Delete API Token | ||
</x-slot> | ||
|
@@ -155,11 +155,11 @@ | |
</x-slot> | ||
|
||
<x-slot name="footer"> | ||
<x-jet-secondary-button wire:click="$toggle('confirmingApiTokenDeletion')" wire:loading.class="opacity-25" wire:loading.attr="disabled"> | ||
<x-jet-secondary-button wire:click="$toggle('confirmingApiTokenDeletion')" wire:loading.attr="disabled"> | ||
Nevermind | ||
</x-jet-secondary-button> | ||
|
||
<x-jet-danger-button class="ml-2" wire:click="deleteApiToken" wire:loading.class="opacity-25" wire:loading.attr="disabled"> | ||
<x-jet-danger-button class="ml-2" wire:click="deleteApiToken" wire:loading.attr="disabled"> | ||
Delete | ||
</x-jet-danger-button> | ||
</x-slot> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
@livewireStyles | ||
|
||
<!-- Scripts --> | ||
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.2.1/dist/alpine.js" defer></script> | ||
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.6.0/dist/alpine.js" defer></script> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a fix somewhere along the way in Alpine that prevents an obscure bug in the password forms caused by the One Password chrome extension. Moving to the most recent version fixes it. |
||
</head> | ||
<body class="font-sans antialiased"> | ||
<div class="min-h-screen bg-gray-100"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added
disabled:opacity-25
so that opacity is automatically handled by CSS rather thanwire:loading.class="opacity-25"
.