Wagtail client-side components
    Preparing search index...

    Adds the ability for an element to copy the value from a target to the clipboard.

    <div data-controller="w-clipboard">
    <input type="text" value="Hello World" data-w-clipboard-target="value" />
    <button type="button" data-action="w-clipboard#copy">Copy</button>
    </div>

    Hierarchy

    Index

    Constructors

    • Parameters

      • context: Context

      Returns ClipboardController

    Properties

    context: Context
    hasValueTarget: boolean
    blessings: (<T>(constructor: Constructor<T>) => any)[]
    outlets: string[]
    targets: string[] = ...
    values: ValueDefinitionMap

    Accessors

    • get application(): Application

      Returns Application

    • get classes(): ClassMap

      Returns ClassMap

    • get data(): DataMap

      Returns DataMap

    • get element(): ElementType

      Returns ElementType

    • get identifier(): string

      Returns string

    • get outlets(): OutletSet

      Returns OutletSet

    • get scope(): Scope

      Returns Scope

    • get targets(): TargetSet

      Returns TargetSet

    • get shouldLoad(): boolean

      Returns boolean

    Methods

    • Returns void

    • Copies the value from either the Custom Event detail, Stimulus action params or the value target to the clipboard. If no value is found, nothing happens. If the clipboard is not available an error event is dispatched and it will intentionally fail silently.

      Parameters

      • event: CustomEvent<CopyOptions> & { params?: CopyOptions }

      Returns void

    • Returns void

    • Parameters

      • eventName: string
      • Optional__namedParameters: Partial<
            {
                bubbles: boolean;
                cancelable: boolean;
                detail: Object;
                prefix: string;
                target: Element
                | Window
                | Document;
            },
        >

      Returns CustomEvent<Object>

    • Returns void

    • Parameters

      • _identifier: string
      • _application: Application

      Returns void