npm.io
1.0.8 • Published 2 years ago

@types/jquery.flagstrap

Licence
MIT
Version
1.0.8
Deps
1
Size
7 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/jquery.flagstrap

Summary

This package contains type definitions for jquery.flagstrap (https://github.com/blazeworx/flagstrap).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jquery.flagstrap.

index.d.ts

/// <reference types="jquery" />

declare namespace jQueryFlagStrap {
    interface FlagStrapOptions {
        /**
         * Default: uniquely generated
         * the `name` attribute for the actual `select` input
         */
        inputName: string;
        /**
         * Default: uniquely generated
         * the `id` attribute for the actual `select` input
         */
        inputId?: string | undefined;
        /**
         * Default: "btn-md"
         * The bootstrap button size `class` for this drop down
         */
        buttonSize: string;
        /**
         * Default: "btn-default"
         * The bootstrap button type `class` for this drop down
         */
        buttonType: string;
        /**
         * Default: "20px"
         * The `margin` between `flag` and `text label`
         */
        labelMargin: string;
        /**
         * Default: false
         * Scrollable or full height drop down
         */
        scrollable: boolean;
        /**
         * Default: "250px"
         * `max-height` for the scrollable drop down
         */
        scrollableHeight?: string | undefined;
        /**
         * Default: (all)
         * Only show specific countries
         * Example:
         *
         * {"GB": "United Kingdom", "US": "United States"}
         *
         * will only show the USA and UK.
         */
        countries?: Object | undefined;
        /**
         * Default: {value: "", text: "Please select a country"}
         * Set the placeholder value and text. To disable the placeholder define as (boolean) false.
         */
        placeholder: boolean | FlagStrapPlaceholderOptions;
        /**
         * Default: null
         * This callback gets called each time the select is changed. It receives two parameters, the new value, and the select element.
         */
        onSelect?(value: any, element: any): void;
    }

    interface FlagStrapStatic {
        flagStrap?: void | undefined;
    }

    interface FlagStrapPlaceholderOptions {
        value: string;
        text: string;
    }
}

interface JQuery {
    /**
     * A lightwieght jQuery plugin for creating Bootstrap 3 compatible country select boxes with flags.
     */

    flagStrap(): void;
    flagStrap(options: jQueryFlagStrap.FlagStrapOptions): void;
}

Additional Details

  • Last updated: Tue, 30 Jan 2024 2145 GMT
  • Dependencies: @types/jquery

Credits

These definitions were written by Felipe de Sena Garcia.