| 20 | pagination(method: 'getCurrentPageNum'): number; | 20 | pagination(method: 'getCurrentPageNum'): number; |
| 21 | pagination(method: string, options?: any): JQuery; | 21 | pagination(method: string, options?: any): JQuery; |
| 22 | pagination(options?: any): JQuery; | 22 | pagination(options?: any): JQuery; |
| 23 | transition(options?: any, complete?: function): JQuery; | | |
| 24 | autocomplete(options?: any): JQuery; | | |
| 25 | autocomplete(method: string, options?: any): JQuery; | | |
| 26 | slider(options?: any): JQuery; | | |
| 27 | slider(method: string, func: string, options?: any): JQuery; | | |
| 28 | cropper(options?: any): JQuery; | | |
| 29 | izoomify(options?: any): JQuery; | 23 | izoomify(options?: any): JQuery; |
| 30 | | | |
| 31 | //#region select2 | | |
| 32 | | | |
| 33 | /** | | |
| 34 | * Initializes or modifies a select2 instance with provided options | | |
| 35 | * | | |
| 36 | * @param options - Configuration options for the select2 instance | | |
| 37 | * @returns The jQuery object for chaining | | |
| 38 | */ | | |
| 39 | select2(options?: Select2Options): JQuery; | | |
| 40 | | | |
| 41 | /** | | |
| 42 | * Retrieves data currently selected in the select2 instance | | |
| 43 | * | | |
| 44 | * @param field - A string specifying the 'data' method | | |
| 45 | * @returns An array of selected items | | |
| 46 | */ | | |
| 47 | select2(field: 'data'): any[]; | | |
| 48 | | | |
| 49 | /** | | |
| 50 | * Calls the specified select2 method | | |
| 51 | * | | |
| 52 | * @param method - The name of the select2 method to invoke | | |
| 53 | * @returns The jQuery object for chaining | | |
| 54 | */ | | |
| 55 | select2(method: 'open' | 'close' | 'destroy' | 'focus' | 'val', value?: any): JQuery; | | |
| 56 | | | |
| 57 | //#endregion | | |
| 58 | | | |
| 59 | //#region sortable | | |
| 60 | | | |
| 61 | /** | | |
| 62 | * Initializes or updates a sortable instance with the provided options | | |
| 63 | * | | |
| 64 | * @param options - Configuration options for the sortable instance | | |
| 65 | * @returns The jQuery object for chaining | | |
| 66 | */ | | |
| 67 | sortable(options?: SortableOptions): JQuery; | | |
| 68 | | | |
| 69 | /** | | |
| 70 | * Calls a sortable method to perform actions on the instance | | |
| 71 | * | | |
| 72 | * @param method - The name of the sortable method to invoke | | |
| 73 | * @returns The jQuery object for chaining | | |
| 74 | */ | | |
| 75 | sortable(method: 'destroy' | 'disable' | 'enable' | 'refresh' | 'toArray'): JQuery; | | |
| 76 | | | |
| 77 | /** | | |
| 78 | * Retrieves the sortable's instance object. If the element does not have an associated instance, undefined is returned. | | |
| 79 | * | | |
| 80 | * @returns The instance of the sortable object | | |
| 81 | */ | | |
| 82 | sortable(method: 'instance'): object; | | |
| 83 | | | |
| 84 | /** | | |
| 85 | * Retrieves the current option value for the specified option | | |
| 86 | * | | |
| 87 | * @param method - The string 'option' to retrieve an option value | | |
| 88 | * @param optionName - The name of the option to retrieve | | |
| 89 | * @returns The value of the specified option | | |
| 90 | */ | | |
| 91 | sortable(method: 'option', optionName: string): any; | | |
| 92 | | | |
| 93 | /** | | |
| 94 | * Sets the value of the specified option | | |
| 95 | * | | |
| 96 | * @param method - The string 'option' to set an option value | | |
| 97 | * @param optionName - The name of the option to set | | |
| 98 | * @param value - The value to assign to the option | | |
| 99 | * @returns The jQuery object for chaining | | |
| 100 | */ | | |
| 101 | sortable(method: 'option', optionName: string, value: any): JQuery; | | |
| 102 | | | |
| 103 | /** | | |
| 104 | * Sets multiple options using an object | | |
| 105 | * | | |
| 106 | * @param method - The string 'option' to set options | | |
| 107 | * @param options - An object containing multiple option key-value pairs | | |
| 108 | * @returns The jQuery object for chaining | | |
| 109 | */ | | |
| 110 | sortable(method: 'option', options: SortableOptions): JQuery; | | |
| 111 | | | |
| 112 | //#endregion | | |
| 113 | } | 24 | } |
| 114 | } | | |
| 115 | | | |
| 116 | //#region select2 | | |
| 117 | | | |
| 118 | /** Options for configuring a select2 instance */ | | |
| 119 | interface Select2Options { | | |
| 120 | /** | | |
| 121 | * Provides support for ajax data sources | | |
| 122 | * @param params - Parameters including the search term | | |
| 123 | * @param callback - A callback function to handle the results | | |
| 124 | * @default null | | |
| 125 | */ | | |
| 126 | ajax?: { | | |
| 127 | url: string; | | |
| 128 | dataType?: string; | | |
| 129 | delay?: number; | | |
| 130 | data?: (params: any) => any; | | |
| 131 | processResults?: (data: any, params: any) => any; | | |
| 132 | } | { transport: (params, success, failure) => any }; | | |
| 133 | | | |
| 134 | /** | | |
| 135 | * Provides support for clearable selections | | |
| 136 | * @default false | | |
| 137 | */ | | |
| 138 | allowClear?: boolean; | | |
| 139 | | | |
| 140 | /** | | |
| 141 | * See Using Select2 with AMD or CommonJS loaders | | |
| 142 | * @default './i18n/' | | |
| 143 | */ | | |
| 144 | amdLanguageBase?: string; | | |
| 145 | | | |
| 146 | /** | | |
| 147 | * Controls whether the dropdown is closed after a selection is made | | |
| 148 | * @default true | | |
| 149 | */ | | |
| 150 | closeOnSelect?: boolean; | | |
| 151 | | | |
| 152 | /** | | |
| 153 | * Allows rendering dropdown options from an array | | |
| 154 | * @default null | | |
| 155 | */ | | |
| 156 | data?: object[]; | | |
| 157 | | | |
| 158 | /** | | |
| 159 | * Used to override the built-in DataAdapter | | |
| 160 | * @default SelectAdapter | | |
| 161 | */ | | |
| 162 | dataAdapter?: SelectAdapter; | | |
| 163 | | | |
| 164 | /** | | |
| 165 | * Enable debugging messages in the browser console | | |
| 166 | * @default false | | |
| 167 | */ | | |
| 168 | debug?: boolean; | | |
| 169 | | | |
| 170 | /** | | |
| 171 | * Sets the dir attribute on the selection and dropdown containers to indicate the direction of the text | | |
| 172 | * @default 'ltr' | | |
| 173 | */ | | |
| 174 | dir?: string; | | |
| 175 | | | |
| 176 | /** | | |
| 177 | * When set to true, the select control will be disabled | | |
| 178 | * @default false | | |
| 179 | */ | | |
| 180 | disabled?: boolean; | | |
| 181 | | | |
| 182 | /** | | |
| 183 | * Used to override the built-in DropdownAdapter | | |
| 184 | * @default DropdownAdapter | | |
| 185 | */ | | |
| 186 | dropdownAdapter?: DropdownAdapter; | | |
| 187 | | | |
| 188 | /** | | |
| 189 | * @default false | | |
| 190 | */ | | |
| 191 | dropdownAutoWidth?: boolean; | | |
| 192 | | | |
| 193 | /** | | |
| 194 | * Adds additional CSS classes to the dropdown container. The helper :all: can be used to add all CSS classes present on the original <select> element. | | |
| 195 | * @default '' | | |
| 196 | */ | | |
| 197 | dropdownCssClass?: string; | | |
| 198 | | | |
| 199 | /** | | |
| 200 | * Allows you to customize placement of the dropdown | | |
| 201 | * @default $(document.body) | | |
| 202 | */ | | |
| 203 | dropdownParent?: JQuery | HTMLElement; | | |
| 204 | | | |
| 205 | /** | | |
| 206 | * Handles automatic escaping of content rendered by custom templates | | |
| 207 | * @default Utils.escapeMarkup | | |
| 208 | */ | | |
| 209 | escapeMarkup?: function; | | |
| 210 | | | |
| 211 | /** | | |
| 212 | * Specify the language used for Select2 messages | | |
| 213 | * @default EnglishTranslation | | |
| 214 | */ | | |
| 215 | language?: string | object; | | |
| 216 | | | |
| 217 | /** | | |
| 218 | * Handles custom search matching | | |
| 219 | * @default null | | |
| 220 | */ | | |
| 221 | matcher?: (searchParams: object, data: object) => boolean; | | |
| 222 | | | |
| 223 | /** | | |
| 224 | * Maximum number of characters that may be provided for a search term | | |
| 225 | * @default 0 | | |
| 226 | */ | | |
| 227 | maximumInputLength?: number; | | |
| 228 | | | |
| 229 | /** | | |
| 230 | * The maximum number of items that may be selected in a multi-select control. If the value of this option is less than 1, the number of selected items will not be limited. | | |
| 231 | * @default 0 | | |
| 232 | */ | | |
| 233 | maximumSelectionLength?: number; | | |
| 234 | | | |
| 235 | /** | | |
| 236 | * Minimum number of characters required to start a search | | |
| 237 | * @default 0 | | |
| 238 | */ | | |
| 239 | minimumInputLength?: number; | | |
| 240 | | | |
| 241 | /** | | |
| 242 | * The minimum number of results required to display the search box | | |
| 243 | * @default 0 | | |
| 244 | */ | | |
| 245 | minimumResultsForSearch?: number; | | |
| 246 | | | |
| 247 | /** | | |
| 248 | * This option enables multi-select (pillbox) mode. Select2 will automatically map the value of the multiple HTML attribute to this option during initialization. | | |
| 249 | * @default false | | |
| 250 | */ | | |
| 251 | multiple?: boolean; | | |
| 252 | | | |
| 253 | /** | | |
| 254 | * Specifies the placeholder for the control | | |
| 255 | * @default null | | |
| 256 | */ | | |
| 257 | placeholder?: string; | | |
| 258 | | | |
| 259 | /** | | |
| 260 | * Used to override the built-in ResultsAdapter | | |
| 261 | * @default ResultsAdapter | | |
| 262 | */ | | |
| 263 | resultsAdapter?: ResultsAdapter; | | |
| 264 | | | |
| 265 | /** | | |
| 266 | * Used to override the built-in SelectionAdapter | | |
| 267 | * @default SingleSelection | MultipleSelection | | |
| 268 | */ | | |
| 269 | selectionAdapter?: SingleSelection | MultipleSelection; | | |
| 270 | | | |
| 271 | /** | | |
| 272 | * Adds additional CSS classes to the selection container. The helper :all: can be used to add all CSS classes present on the original <select> element | | |
| 273 | * @default '' | | |
| 274 | */ | | |
| 275 | selectionCssClass?: string; | | |
| 276 | | | |
| 277 | /** | | |
| 278 | * Implements automatic selection when the dropdown is closed | | |
| 279 | * @default false | | |
| 280 | */ | | |
| 281 | selectOnClose?: boolean; | | |
| 282 | | | |
| 283 | sorter?: function; | | |
| 284 | | | |
| 285 | /** | | |
| 286 | * When set to `true`, allows the user to create new tags that aren't pre-populated | | |
| 287 | * Used to enable free text responses | | |
| 288 | * @default false | | |
| 289 | */ | | |
| 290 | tags?: boolean | object[]; | | |
| 291 | | | |
| 292 | /** | | |
| 293 | * Customizes the way that search results are rendered | | |
| 294 | * @param item - The item object to format | | |
| 295 | * @returns The formatted representation | | |
| 296 | * @default null | | |
| 297 | */ | | |
| 298 | templateResult?: (item: any) => JQuery | string; | | |
| 299 | | | |
| 300 | /** | | |
| 301 | * Customizes the way that selections are rendered | | |
| 302 | * @param item - The selected item object to format | | |
| 303 | * @returns The formatted representation | | |
| 304 | * @default null | | |
| 305 | */ | | |
| 306 | templateSelection?: (item: any) => JQuery | string; | | |
| 307 | | | |
| 308 | /** | | |
| 309 | * Allows you to set the theme | | |
| 310 | * @default 'default' | | |
| 311 | */ | | |
| 312 | theme?: string; | | |
| 313 | | | |
| 314 | /** | | |
| 315 | * A callback that handles automatic tokenization of free-text entry | | |
| 316 | * @default null | | |
| 317 | */ | | |
| 318 | tokenizer?: (input: { _type: string, term: string }, selection: { options: object }, callback: (Select2Option) => any) => { term: string }; | | |
| 319 | | | |
| 320 | /** | | |
| 321 | * The list of characters that should be used as token separators | | |
| 322 | * @default null | | |
| 323 | */ | | |
| 324 | tokenSeparators?: string[]; | | |
| 325 | | | |
| 326 | /** | | |
| 327 | * Supports customization of the container width | | |
| 328 | * @default 'resolve' | | |
| 329 | */ | | |
| 330 | width?: string; | | |
| 331 | | | |
| 332 | /** | | |
| 333 | * If true, resolves issue for multiselects using closeOnSelect: false that caused the list of results to scroll to the first selection after each select/unselect | | |
| 334 | * @default false | | |
| 335 | */ | | |
| 336 | scrollAfterSelect?: boolean; | | |
| 337 | | 25 | |
| | 26 | namespace Select2 { |
| | 27 | interface Options<Result = DataFormat | GroupedDataFormat, RemoteResult = any> { |
| 338 | /** | 28 | /** |
| 339 | * Extends Select2 v4 plugin by adding an option to set a placeholder for the 'search' input field | 29 | * Extends Select2 v4 plugin by adding an option to set a placeholder for the 'search' input field |
| 340 | * [Custom Field] | 30 | * [Custom Field] |