diff --git a/README.md b/README.md index 8a3d10c0..21bb2cc8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Documentation, Examples, FAQ and License: [https://davidstutz.github.io/bootstra **If you are interested in actively maintaining this project, please contact me (see GitHub profile for contact information).** -Bootstrap Multiselect is featured in an article on [tutorialzine](https://tutorialzine.com/): [50 must-Have Plugins for Extending Twitter Bootstrap](https://tutorialzine.com/2013/07/50-must-have-plugins-for-extending-twitter-bootstrap/); on [Bootsnipp](https://bootsnipp.com/)'s [list of Twitter Bootstrap resources](https://bootsnipp.com/resources); on [Design Your Way](https://www.designyourway.net/blog/resources/jquery-bootstrap-plugins/); and available on [NuGet](https://www.nuget.org/packages/Bootstrap.Multiselect/0.9.9). +Bootstrap Multiselect is featured in an article on [tutorialzine](https://tutorialzine.com/): [50 must-Have Plugins for Extending Twitter Bootstrap](https://tutorialzine.com/2013/07/50-must-have-plugins-for-extending-twitter-bootstrap/); on [Bootsnipp](https://bootsnipp.com/)'s [list of Twitter Bootstrap resources](https://bootsnipp.com/resources); on [Design Your Way](https://www.designyourway.net/blog/resources/jquery-bootstrap-plugins/); and available on [NuGet](https://www.nuget.org/packages/Bootstrap.Multiselect). **If you use this plugin commercially, consider supporting the development by [making a donation](https://davidstutz.de/donate/).** diff --git a/types/bootstrap-multiselect/bootstrap-multiselect-tests.ts b/types/bootstrap-multiselect/bootstrap-multiselect-tests.ts deleted file mode 100644 index 016f370e..00000000 --- a/types/bootstrap-multiselect/bootstrap-multiselect-tests.ts +++ /dev/null @@ -1,20 +0,0 @@ -$('select').multiselect(); -$('select').multiselect('destroy'); -$('select').multiselect({ buttonText: (options, select) => { return 'text'; } }); -$('select').multiselect('dataprovider', [{ - label: 'Group 1', children: [ - { label: 'Option 1.1', value: '1-1', selected: true, attributes: { 'some-attribute': 2 } }, - { label: 'Option 1.2', value: '1-2' }, - { label: 'Option 1.3', value: '1-3' } - ] -}, -{ - label: 'Group 2', children: [ - { label: 'Option 2.1', value: '1' }, - { label: 'Option 2.2', value: '2' }, - { label: 'Option 2.3', value: '3', disabled: true } - ] -}]) - -$('select').multiselect({ filterBehavior: 'text' }); -$('select').multiselect('setOptions', { nonSelectedText: '-- Select --' }) \ No newline at end of file diff --git a/types/bootstrap-multiselect/index.d.ts b/types/bootstrap-multiselect/index.d.ts deleted file mode 100644 index 6bafec09..00000000 --- a/types/bootstrap-multiselect/index.d.ts +++ /dev/null @@ -1,445 +0,0 @@ -// Type definitions for bootstrap-multiselect 0.9 -// Project: https://github.com/davidstutz/bootstrap-multiselect -// Definitions by: Makoto Schoppert -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// - -interface Templates { - button?: string; - popupContainer?: string; - filter?: string; - option?: string; - divider?: string; - optionGroup?: string; - resetButton?: string; -} - -interface MultiSelectOptionElement { - label: string; - title?: string; - value?: string | number; - selected?: boolean; - disabled?: boolean; - children?: Array; - attributes?: {[name: string]: any}; -} - -/** - * See {@link https://davidstutz.github.io/bootstrap-multiselect/#configuration-options|https://davidstutz.github.io/bootstrap-multiselect/#configuration-options} - */ -interface MultiSelectOptions { - /** - * XSS injection is a serious threat for all modern web applications. Setting enableHTML to false (default setting) will create a XSS safe multiselect. - */ - enableHTML?: boolean; - - /** - * If set to true, optgroup's will be clickable, allowing to easily select multiple options belonging to the same group. - * - * enableClickableOptGroups is not available in single selection mode, i.e. when the multiple attribute is not present. - * - * When using selectedClass, the selected classes are also applied on the option groups. - */ - enableClickableOptGroups?: boolean; - - /** - * If set to true, optgroup's will be collapsible. - */ - enableCollapsibleOptGroups?: boolean; - - /** - * This option will collapse all optgroups by default - */ - collapseOptGroupsByDefault?: boolean; - - /** - * If set to true, the multiselect will be disabled if no options are given. - */ - disableIfEmpty?: boolean; - - /** - * The text shown if the multiselect is disabled. - * Note that this option is set to the empty string '' by default, - * that is nonSelectedText is shown if the multiselect is disabled and no options are selected. - */ - disabledText?: string; - - /** - * The dropdown can also be dropped right. - */ - dropRight?: boolean; - - /** - * The dropdown can also be dropped up. Note that it is recommended to also set {@link maxHeight}. - * The plugin calculates the necessary height of the dropdown and takes the minimum of the calculated value and maxHeight. - */ - dropUp?: boolean; - - /** - * The maximum height of the dropdown. This is useful when using the plugin with plenty of options. - */ - maxHeight?: number; - - /** - * The name used for the generated checkboxes. - * See {@link https://davidstutz.github.io/bootstrap-multiselect/#post|Server-Side Processing} for details. - */ - checkboxName?: string; - - /** - * A function which is triggered on the change event of the options. - * Note that the event is not triggered when selecting or deselecting options using the select and deselect methods provided by the plugin. - * @param option The option item that was changed, wrapped in a JQuery object. - * @param checked Whether the checkbox was checked or not. - */ - onChange?: (option: JQuery, checked: boolean) => void; - - /** - * A function which is triggered when the multiselect is finished initializing. - */ - onInitialized?: (select: JQuery, container: JQuery) => void; - - /** - * A callback called when the dropdown is shown. - * - * The onDropdownShow option is not available when using Twitter Bootstrap 2.3. - */ - onDropdownShow?: (event: Event) => void; - - /** - * A callback called when the dropdown is closed. - * - * The onDropdownHide option is not available when using Twitter Bootstrap 2.3. - */ - onDropdownHide?: (event: Event) => void; - - /** - * A callback called after the dropdown has been shown. - * - * The onDropdownShown option is not available when using Twitter Bootstrap 2.3. - */ - onDropdownShown?: (event: Event) => void; - - /** - * A callback called after the dropdown has been closed. - * - * The onDropdownHidden option is not available when using Twitter Bootstrap 2.3. - */ - onDropdownHidden?: (event: Event) => void; - - /** - * The class of the multiselect button. - * - * @example - * $('#example-buttonClass').multiselect({ - buttonClass: 'btn btn-link' - }); - */ - buttonClass?: string; - - /** - * Inherit the class of the button from the original select. - */ - inheritClass?: boolean; - - /** - * The container holding both the button as well as the dropdown. - * - * @example - * $('#example-buttonContainer').multiselect({ - buttonContainer: '
' - }); - */ - buttonContainer?: string; - - /** - * The width of the multiselect button may be fixed using this option. - * - * Actually, buttonWidth describes the width of the .btn-group container and the width of the button is set to 100%. - * - * @example - * $('#example-buttonWidth').multiselect({ - buttonWidth: '400px' - }); - */ - buttonWidth?: string; - - /** - * A callback specifying the text shown on the button dependent on the currently selected options. - * - * The callback gets the currently selected options and the select as argument and returns the string shown as button text. - * The default buttonText callback returns nonSelectedText in the case no option is selected, - * {@link nSelectedText} in the case more than {@link numberDisplayed} options are selected - * and the names of the selected options if less than {@link numberDisplayed} options are selected. - - * @param options - * @param select - * @returns {} - */ - buttonText?: (options: HTMLOptionsCollection, select: HTMLSelectElement) => string; - - /** - * A callback specifying the title of the button. - * - * The callback gets the currently selected options and the select as argument and returns the title of the button as string. - * The default buttonTitle callback returns nonSelectedText in the case no option is selected and the names of the selected options of less than {@link numberDisplayed} options are selected. - * If more than numberDisplayed options are selected, {@link nSelectedText} is returned. - * - * @param options - * @param select - * @returns {} - */ - buttonTitle?: (options: HTMLOptionElement[], select: HTMLSelectElement) => string; - - /** - * The text displayed when no option is selected. This option is used in the default buttonText and buttonTitle functions. - */ - nonSelectedText?: string; - - /** - * The text displayed if more than {@link numberDisplayed} options are selected. This option is used by the default buttonText and buttonTitle callbacks. - */ - nSelectedText?: string; - - /** - * allSelectedText is the text displayed if all options are selected. You can disable displaying the allSelectedText by setting it to false. - */ - allSelectedText?: string | boolean; - - /** - * This option is used by the buttonText and buttonTitle functions to determine of too much options would be displayed. - */ - numberDisplayed?: number; - - /** - * Sets the separator for the list of selected items for mouse-over. Defaults to ', '. Set to '\n' for a neater display. - */ - delimiterText?: string; - - /** - * A callback used to define the labels of the options. - */ - optionLabel?: (element: HTMLElement) => string; - - /** - * A callback used to define the classes for the li elements containing checkboxes and labels. - */ - optionClass?: (element: HTMLElement) => string; - - /** - * This option controls if options insade a optgroup are indented. - */ - indentGroupOptions?: boolean; - - /** - * The class(es) applied on selected options. - */ - selectedClass?: string; - - /** - * Set to true or false to enable or disable the select all option. - */ - includeSelectAllOption?: boolean; - - /** - * Setting both {@link includeSelectAllOption} and {@link enableFiltering} to true, the select all option does always select only the visible option. - * With setting selectAllJustVisible to false this behavior is changed such that always all options (irrespective of whether they are visible) are selected. - */ - selectAllJustVisible?: boolean; - - /** - * The text displayed for the select all option. - */ - selectAllText?: string; - - /** - * The select all option is added as additional option within the select. - * To distinguish this option from the original options the value used for the select all option can be configured using the selectAllValue option. - */ - selectAllValue?: string | number; - - /** - * This option allows to control the name given to the select all option. - * See {@link https://davidstutz.github.io/bootstrap-multiselect/#post|Server-Side Processing} for more details. - */ - selectAllName?: string; - - /** - * If set to true (default), the number of selected options will be shown in parantheses when all options are seleted. - */ - selectAllNumber?: boolean; - - /** - * This function is triggered when the select all option is used to select all options. - * Note that this can also be triggered manually using the {@link .multiselect('selectAll')} method. - * - * Note that the onChange option is not triggered when (de)selecting all options using the select all option. - * - * The onSelectAll option is only triggered if the select all option was checked; - * it is not triggered if all options were checked manually (causing the select all option to be checked as well). - */ - onSelectAll?: () => void; - - /** - * This function is triggered when the select all option is used to deselect all options. - * Note that this can also be triggered manually using the {@link .multiselect('deselectAll')} method. - * - * Note that the onChange option is not triggered when (de)selecting all options using the select all option. - * - * The onDeselectAll option is only triggered if the select all option was unchecked; - * it is not triggered if all options were unchecked manually (causing the select all option to be unchecked as well). - */ - onDeselectAll?: () => void; - - /** - * Set to true or false to enable or disable the filter. A filter input will be added to dynamically filter all options. - */ - enableFiltering?: boolean; - - /** - * If it is not desired to have a clear button for the search it can also be disabled. - */ - includeFilterClearBtn?: boolean; - - /** - * The filter as configured above will use case sensitive filtering, - * by setting enableCaseInsensitiveFiltering to true this behavior can be changed to use case insensitive filtering. - */ - enableCaseInsensitiveFiltering?: boolean; - - /** - * Set to true to enable full value filtering, that is all options are shown where the query is a prefix of. - */ - enableFullValueFiltering?: boolean; - - /** - * The options are filtered based on their text. This behavior can be changed to use the value of the options or both the text and the value. - */ - filterBehavior?: 'text' | 'value' | 'both'; - - /** - * The placeholder used for the filter input. - * @example $('#example-filter-placeholder').multiselect({ - enableFiltering: true, - filterPlaceholder: 'Search for something...' - }); - */ - filterPlaceholder?: string; - - /** - * Add reset button to dropdown. - */ - includeResetOption?: boolean; - - /** - * Add a divider between reset button and options. - */ - includeResetDivider?: boolean; - - /** - * Defines the text of the reset button. - */ - resetText?: string; - - /** - * Synchronizes the width of the select button and the popup. The default value is 'never'. - */ - widthSynchronizationMode?: 'never' | 'always' | 'ifPopupIsSmaller' | 'ifPopupIsWider'; - - /** - * Defines the text alignment in the button. Possible values are left, center and right. The default value is center. - */ - buttonTextAlignment?: 'left' | 'center' | 'right'; - - /** - * The generated HTML markup can be controlled using templates. Basically, templates are simple configuration options. - */ - templates?: Templates; -} - -interface JQuery { - multiselect(options?: MultiSelectOptions): JQuery; - - /** - * This method is used to destroy the plugin on the given element - meaning unbinding the plugin. - */ - multiselect(method: 'destroy'): JQuery; - - /** - * This method is used to refresh the checked checkboxes based on the currently selected options within the select. - * Click 'Select some options' to select some of the options. Then click refresh. - * The plugin will update the checkboxes accordingly. - */ - multiselect(method: 'refresh'): JQuery; - - /** - * Rebuilds the whole dropdown menu. All selected options will remain selected (if still existent!). - */ - multiselect(method: 'rebuild'): JQuery; - - /** - * Selects an option by its value. Works also using an array of values. - * @param triggerOnChange If set to true, the method will manually trigger the onChange option. - */ - multiselect(method: 'select', value: string | Array | number, triggerOnChange?: boolean): JQuery; - - /** - * Deselect an option by its value. Works also using an array of values. - * @param triggerOnChange If set to true, the method will manually trigger the onChange option. - */ - multiselect(method: 'deselect', value: string | Array | number, triggerOnChange?: boolean): JQuery; - - /** - * Selects all options. - * @param justVisible If set to true or not provided, all visible options are selected (when using the filter), - * otherwise (justVisible set to false) all options are selected. - */ - multiselect(method: 'selectAll', justVisible?: boolean): JQuery; - - /** - * Deselects all options. - * @param justVisible If set to true or not provided, all visible options are deselected, - * otherwise (justVisible set to false) all options are deselected. - */ - multiselect(method: 'deselectAll', justVisible?: boolean): JQuery; - - /** - * When manually selecting/deselecting options and the corresponding checkboxes, this function updates the text and title of the button. - * - * Note that usually this method is only needed when using .multiselect('selectAll', justVisible) or .multiselect('deselectAll', justVisible). In all other cases, .multiselect('refresh') should be used. - */ - multiselect(method: 'updateButtonText'): JQuery; - - /** - * Used to change configuration after initializing the multiselect. This may be useful in combination with {@link multiselect('rebuild')}. - * @example - * $('#example-setOptions').multiselect('setOptions', options); - * $('#example-setOptions').multiselect('rebuild'); - */ - multiselect(method: 'setOptions', options: MultiSelectOptions): JQuery; - - /** - * Disable both the underlying select and the dropdown button. - */ - multiselect(method: 'disable'): JQuery; - - /** - * Enable both the underlying select and the dropdown button. - */ - multiselect(method: 'enable'): JQuery; - - /** - * This method is used to provide options programmatically - */ - multiselect(method: 'dataprovider', data: Array): JQuery; - - /** - * This method is used to programmatically provide a new text to display in the button when all options are selected, at runtime. - */ - multiselect(method: 'setAllSelectedText', value: string): JQuery; -} - -declare module "bootstrap-multiselect" { -} \ No newline at end of file diff --git a/types/bootstrap-multiselect/tsconfig.json b/types/bootstrap-multiselect/tsconfig.json deleted file mode 100644 index 6bdfac36..00000000 --- a/types/bootstrap-multiselect/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "dom", - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "bootstrap-multiselect-tests.ts" - ] -} diff --git a/types/bootstrap-multiselect/tslint.json b/types/bootstrap-multiselect/tslint.json deleted file mode 100644 index 3db14f85..00000000 --- a/types/bootstrap-multiselect/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" }