Comments (10)
It is currently not possible but I'm willing to implement it. I'll take a look later this week or this weekend!
from nova-text-copy-field.
from nova-text-copy-field.
I ended up going down a rabbit hole trying to get this thing tested. I'll work on getting these couple open features merged and tagged over the next couple of days.
from nova-text-copy-field.
from nova-text-copy-field.
@pritchard67 can you take a look at #26 and make sure its what you are looking for?
from nova-text-copy-field.
from nova-text-copy-field.
@sixlive I like it. Megre it!
from nova-text-copy-field.
from nova-text-copy-field.
Maybe I am blind: On detail and index, everything works fine, but on the form field, nothing is show. This is my Field definition:
TextCopy::make('Tag', function($item) {
return '{{ diashow(' . $item->id . ',"u") }}';
})->showOnUpdating(true),
I am currently on v1.5.0
:
$composer show | grep copy-field
sixlive/nova-text-copy-field v1.5.0 Laravel Nova text field with click to copy support
from nova-text-copy-field.
Ok, its because ComputedField
aren't shown on forms (see nova/ResolvesFields::removeNonUpdateFields
).
If I now use the other syntax:
TextCopy::make('Tag')
->copyValue(function () {
return '{{ diashow(' . $this->id . ',"u") }}';
}),
it "works" somehow. It shows me an empty Input field with the copy icon. I can copy the correct value which I would expect. I can hide the input field by css, which would be OK, but I cant save the form, since Nova tries to store now the none existing field "tag" (since now its not a ComputedField anymore).
Edit:
Ok, if I add ->readonly(true)
, than it works. Kind of hacky, but it works.
from nova-text-copy-field.
Related Issues (19)
- Cleanup SVG Usage
- Add ability to truncate long field values HOT 2
- Mouse hover text HOT 8
- Different data in clipboard HOT 9
- Create copy field for index
- Show icon only on text hover HOT 11
- Missing docblocks HOT 1
- Set text label/value next to button HOT 1
- Add Tests
- How can I change copy icon?
- Hide copy button on empty or null values
- Visual bug (overlapping text)
- Unable to copy integer values t.value.trim is not a function HOT 2
- Does not support readonly
- Nova 4 support HOT 6
- [READY] Update badge for stable release
- Review cliboard library
- Add screenshots for resource index
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nova-text-copy-field.