mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-18 12:33:17 +08:00
Add definitions for bootstrap-select (#12113)
This commit is contained in:
committed by
Masahiro Wakame
parent
57a716701e
commit
bf5d81c29f
43
bootstrap-select/bootstrap-select-tests.ts
Normal file
43
bootstrap-select/bootstrap-select-tests.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
// Bootstrap Select Test
|
||||
// ================================================================================
|
||||
/// <reference path="bootstrap-select.d.ts" />
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
$(".selectpicker").selectpicker({
|
||||
actionsBox: true,
|
||||
container: "body",
|
||||
countSelectedText: "counts > #",
|
||||
deselectAllText: "test",
|
||||
dropdownAlignRight: true,
|
||||
dropupAuto: true,
|
||||
header: "test",
|
||||
hideDisabled: true,
|
||||
iconBase: "fa",
|
||||
liveSearch: true,
|
||||
liveSearchNormalize: true,
|
||||
liveSearchPlaceholder: "test",
|
||||
liveSearchStyle: "contains",
|
||||
maxOptions: 10,
|
||||
maxOptionsText: "test",
|
||||
mobile: true,
|
||||
multipleSeparator: ", ",
|
||||
noneSelectedText: "test",
|
||||
selectAllText: "test",
|
||||
selectedTextFormat: "values",
|
||||
selectOnTab: true,
|
||||
showContent: true,
|
||||
showIcon: true,
|
||||
showSubtext: true,
|
||||
showTick: true,
|
||||
size: "auto",
|
||||
style: "test",
|
||||
tickIcon: "test",
|
||||
title: "test",
|
||||
width: "auto"
|
||||
})
|
||||
|
||||
$(".selectpicker").selectpicker("val", "foo")
|
||||
$(".selectpicker").selectpicker("val", ["foo", "bar"])
|
||||
$(".selectpicker").selectpicker("selectAll")
|
||||
$(".selectpicker").selectpicker("setStyle", "btn-large", "add")
|
||||
|
||||
44
bootstrap-select/bootstrap-select.d.ts
vendored
Normal file
44
bootstrap-select/bootstrap-select.d.ts
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
// Type definitions for bootstrap-select v1.11.2
|
||||
// Project: https://silviomoreto.github.io/bootstrap-select/
|
||||
// Definitions by: Karol Janyst <https://github.com/LKay>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
interface BootstrapSelectOptions {
|
||||
actionsBox?: boolean
|
||||
container?: string | boolean
|
||||
countSelectedText?: string | Function
|
||||
deselectAllText?: string
|
||||
dropdownAlignRight?: string | boolean
|
||||
dropupAuto?: boolean
|
||||
header?: string
|
||||
hideDisabled?: boolean
|
||||
iconBase?: string
|
||||
liveSearch?: boolean
|
||||
liveSearchNormalize?: boolean
|
||||
liveSearchPlaceholder?: string
|
||||
liveSearchStyle?: string
|
||||
maxOptions?: number | boolean
|
||||
maxOptionsText?: string | Array<any> | Function
|
||||
mobile?: boolean
|
||||
multipleSeparator?: string
|
||||
noneSelectedText?: string
|
||||
selectAllText?: string
|
||||
selectedTextFormat?: string
|
||||
selectOnTab?: boolean
|
||||
showContent?: boolean
|
||||
showIcon?: boolean
|
||||
showSubtext?: boolean
|
||||
showTick?: boolean
|
||||
size?: string | number | boolean
|
||||
style?: string
|
||||
tickIcon?: string
|
||||
title?: string
|
||||
width?: string | boolean
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
selectpicker(opts?: BootstrapSelectOptions): void
|
||||
selectpicker(method: string, ...args: Array<string | Array<string>>): void
|
||||
}
|
||||
Reference in New Issue
Block a user