32 lines
783 B
HTML
32 lines
783 B
HTML
---
|
|
copy:
|
|
type: "string"
|
|
confirmation:
|
|
type: "string"
|
|
class:
|
|
type: "string"
|
|
default: ""
|
|
text:
|
|
type: "string"
|
|
icon:
|
|
type: "string"
|
|
confirmation_icon:
|
|
type: "string"
|
|
---
|
|
<button
|
|
data-controller="button-copy"
|
|
data-button-copy-text-value="{{ copy | escape_once }}"
|
|
data-button-copy-initial-text-value="{{ text | escape_once }}"
|
|
data-button-copy-confirmation-value="{{ confirmation | replace: "%s", copy | escape_once }}"
|
|
data-action="button-copy#copy button-copy-reset@window->button-copy#reset"
|
|
class="{{ class }}"
|
|
>
|
|
<span data-button-copy-target="text">{{- text -}}</span>
|
|
<span data-button-copy-target="icon">
|
|
{{- icon -}}
|
|
</span>
|
|
<span data-button-copy-target="confirmationIcon" class="d-none">
|
|
{{- confirmation_icon -}}
|
|
</span>
|
|
</button>
|