-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename from uui-copy to more explicit uui-text-copy-button
- Loading branch information
1 parent
bf86ac4
commit 8e2bb32
Showing
14 changed files
with
134 additions
and
118 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
# uuui-text-copy-button | ||
|
||
![npm](https://img.shields.io/npm/v/@umbraco-ui/uui-text-copy-button?logoColor=%231B264F) | ||
|
||
Umbraco style copy component. | ||
|
||
## Installation | ||
|
||
### ES imports | ||
|
||
```zsh | ||
npm i @umbraco-ui/uui-text-copy-button | ||
``` | ||
|
||
Import the registration of `<uui-text-copy-button>` via: | ||
|
||
```javascript | ||
import '@umbraco-ui/uui-text-copy-button'; | ||
``` | ||
|
||
When looking to leverage the `UUITextCopyButtonElement` base class as a type and/or for extension purposes, do so via: | ||
|
||
```javascript | ||
import { UUITextCopyButtonElement } from '@umbraco-ui/uui-text-copy-button'; | ||
``` | ||
|
||
## Usage | ||
|
||
```html | ||
<uui-text-copy-button | ||
value="I am copied to the clipboard"></uui-text-copy-button> | ||
``` |
21 changes: 21 additions & 0 deletions
21
packages/uui-text-copy-button/lib/UUITextCopyButtonEvent.ts
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,21 @@ | ||
import { UUIEvent } from '@umbraco-ui/uui-base/lib/events'; | ||
import { UUITextCopyButtonElement } from './uui-text-copy-button.element'; | ||
|
||
interface UUITextCopyButtonEventInit extends EventInit { | ||
detail?: { text: string }; | ||
} | ||
|
||
export class UUITextCopyButtonEvent extends UUIEvent< | ||
{ text: string }, | ||
UUITextCopyButtonElement | ||
> { | ||
public static readonly COPIED: string = 'copied'; | ||
public static readonly COPYING: string = 'copying'; | ||
|
||
constructor(evName: string, eventInit: UUITextCopyButtonEventInit = {}) { | ||
super(evName, { | ||
...{ bubbles: true }, | ||
...eventInit, | ||
}); | ||
} | ||
} |
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,2 @@ | ||
export * from './uui-text-copy-button.element'; | ||
export * from './UUITextCopyButtonEvent'; |
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
Oops, something went wrong.