Wagtail client-side components
    Preparing search index...

    Adds the ability for a button to be clicked and then not allow any further clicks until the duration has elapsed. Will also update the button's label while in progress.

    <button
    type="submit"
    class="button button-longrunning"
    data-controller="w-progress"
    data-w-progress-active-class="button-longrunning-active"
    data-w-progress-active-value="{% trans 'Signing in…' %}"
    data-w-progress-duration-seconds-value="40"
    data-action="w-progress#activate"
    >
    {% icon name="spinner" %}
    <em data-w-progress-target="label">{% trans 'Sign in' %}</em>
    </button>

    Hierarchy

    Index

    Constructors

    • Parameters

      • context: Context

      Returns ProgressController

    Properties

    activeClass: string
    activeValue: string

    Label to use when loading

    context: Context
    durationValue: number
    hasActiveClass: boolean
    hasLabelTarget: boolean
    labelTarget: HTMLElement
    labelValue: string

    Label to store the original text on the button

    loadingValue: boolean
    timer?: number
    blessings: (<T>(constructor: Constructor<T>) => any)[]
    classes: string[] = ...
    outlets: string[]
    targets: string[] = ...
    values: {
        active: { default: string; type: StringConstructor };
        duration: { default: number; type: NumberConstructor };
        label: { default: string; type: StringConstructor };
        loading: { default: boolean; type: BooleanConstructor };
    } = ...

    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

    • 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