Code Monkey home page Code Monkey logo

nova-text-copy-field's People

Contributors

mattdfloyd avatar sixlive avatar tnorthcutt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nova-text-copy-field's Issues

Nova 4 support

Preflight

  • I have searched the repo for this duplicates

Description

Possible implementation ideas

Create copy field for index

I could see it being nice to add the copy fields in the index as well as the detail view. Might want to implement #1 first since the icons would be used in two components.

Mouse hover text

What are the steps to reproduce this issue?

Hover the icon

What were you expecting to happen?

Hover text with localization to tell the user what clicking it does.

Ability to use TextCopy on Create

I have a key (UUID) that is generated during the creation process that is hashed and never shown again. I was hoping TextCopy would help me quickly add a copy icon, but it does not show on the create screen. Am I missing a setting or is this not currently possible?

Unable to copy integer values t.value.trim is not a function

Preflight

  • I have searched the repo for this duplicates

Description

Expect Result

Copy value to the clippboard

Steps to reproduce

  • use an int instead of a string for the field
  • click the copy button

Logs, error output, etc

Uncaught TypeError: t.value.trim is not a function

image

Version information

nove-text-copy-field 1.5
Laravel Nova v3.8.4

Does not support readonly

The field ignores the readonly attribute.

Example:
Text::make('License Member Sign Up Key','license_key')->readonly(),

Set text label/value next to button

It would be useful to be able to override the text shown by the button. For instance I want to use a generated copyValue that has no corresponding row in the database in meaning only the button shows.

TextCopy::make('Social link')
->copyValue(function () {
	return $this->url;
}),

Other times I might have a long item to copy like a URL and rather and truncate it, it would ne good to supply different word like copy link.

At the moment I work around it by supplying a second argument to the make method which uses an accessor on the model that returns a string.

// resource
TextCopy::make('Social link', 'social_link_copy_label')
->copyValue(function () {
	return $this->url;
}),

// model
public function getSocialLinkCopyLabelAttribute()
{
	return 'Copy url';
}

Hide copy button on empty or null values

The copy button should not be shown if the value is empty or null.

Bildschirmfoto 2020-01-11 um 17 09 15

The copy button is shown without any reference and looks broken. The user might think "there must be something".

Instead it should only show the default symbol for an empty value which is a long dash without the button.

Add ability to truncate long field values

            TextCopy::make('link', function () {
                return url('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=' . $this->id);
            }
            )->exceptOnForms()

it display in index too long , can nova-text-copy-field display short text and copy the real text?

Visual bug (overlapping text)

Preflight

  • I have searched the repo for this duplicates

Description

image

            TextCopy::make('UUID')
                ->exceptOnForms()
                ->copyButtonTitle('Copy URL')
                ->copyValue(function () {
                    if (! $this->uuid) {
                        return null;
                    }

                    return route('xyz', $this->uuid);
                }),

Expect Result

image

            Text::make('UUID')
                ->exceptOnForms(),

Version information

PHP 7.4.9
Laravel 7.26.1
Nova 3.8.4
TextCopyField 1.5.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.