Skip to content

Commit 4fa5169

Browse files
committed
e43de6a84a29e2fbf692c2e1d06f97dce03cf9a2
Sync to source repo @e43de6a84a29e2fbf692c2e1d06f97dce03cf9a2
1 parent d510e35 commit 4fa5169

4 files changed

+116
-6
lines changed

datatables.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
"types/types.d.ts"
1515
],
1616
"src-repo": "http://github.com/DataTables/SearchPanes",
17-
"last-tag": "2.0.2"
18-
}
17+
"last-tag": "2.0.2",
18+
"last-sync": "e43de6a84a29e2fbf692c2e1d06f97dce03cf9a2"
19+
}

js/searchPanes.bootstrap4.min.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/searchPanes.bootstrap4.min.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
/*! Bootstrap integration for DataTables' SearchPanes
2+
* © SpryMedia Ltd - datatables.net/license
3+
*/
14
import $ from"jquery";import DataTable from"datatables.net-bs4";import DataTable from"datatables.net-searchpanes";$.extend(!0,DataTable.SearchPane.classes,{buttonGroup:"btn-group",disabledButton:"disabled",narrow:"col",pane:{container:"table"},paneButton:"btn btn-light",pill:"pill badge badge-pill badge-secondary",search:"form-control search",searchCont:"input-group",searchLabelCont:"input-group-append",subRow1:"dtsp-subRow1",subRow2:"dtsp-subRow2",table:"table table-sm table-borderless",topRow:"dtsp-topRow"}),$.extend(!0,DataTable.SearchPanes.classes,{clearAll:"dtsp-clearAll btn btn-light",collapseAll:"dtsp-collapseAll btn btn-light",container:"dtsp-searchPanes",disabledButton:"disabled",panes:"dtsp-panes dtsp-panesContainer",showAll:"dtsp-showAll btn btn-light",title:"dtsp-title",titleRow:"dtsp-titleRow"});export default DataTable;

types/types.d.ts

+107-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,110 @@
1+
// Type definitions for DataTables SearchPanes
2+
//
3+
// Project: https://datatables.net/extensions/SearchPanes/, https://datatables.net
14

2-
// Dist-DataTables-SearchPanes-Bootstrap4 integration with Bootstrap4 exports the DataTables API having
3-
// set default values to complete the ingeration.
4-
import Api from "datatables.net";
5+
/// <reference types="jquery" />
56

6-
export default Api;
7+
import DataTables, {Api} from 'datatables.net';
8+
import * as paneType from './paneType';
79

10+
export default DataTables;
11+
12+
type DeepPartial<T> = T extends object ? {
13+
[P in keyof T]?: DeepPartial<T[P]>;
14+
} : T;
15+
16+
17+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
18+
* DataTables' types integration
19+
*/
20+
declare module 'datatables.net' {
21+
interface Config {
22+
/**
23+
* SearchPanes extension options
24+
*/
25+
searchPanes?: boolean | string[] | ConfigSearchPanes | ConfigSearchPanes[];
26+
}
27+
28+
interface ConfigLanguage {
29+
/**
30+
* SearchBuilder language options
31+
*/
32+
searchPanes?: ConfigSearchPanesLanguage;
33+
}
34+
35+
interface Api<T> {
36+
/**
37+
* SearchPanes methods container
38+
*
39+
* @returns Api for chaining with the additional SearchPanes methods
40+
*/
41+
searchPanes: ApiSearchPanes<T>;
42+
}
43+
44+
interface ApiStatic {
45+
/**
46+
* SearchPanes class
47+
*/
48+
SearchPanes: {
49+
/**
50+
* Create a new SearchPanes instance for the target DataTable
51+
*/
52+
new (dt: Api<any>, settings: string[] | ConfigSearchPanes | ConfigSearchPanes[]);
53+
54+
/**
55+
* SearchPanes version
56+
*/
57+
version: string;
58+
59+
/**
60+
* Default configuration values
61+
*/
62+
defaults: ConfigSearchPanes;
63+
}
64+
}
65+
}
66+
67+
68+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
69+
* Options
70+
*/
71+
72+
interface ConfigSearchPanes extends DeepPartial<paneType.IDefaults> {}
73+
74+
interface ConfigSearchPanesLanguage extends DeepPartial<paneType.IDefaults['i18n']> {}
75+
76+
77+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
78+
* API
79+
*/
80+
interface ApiSearchPanes<T> extends Api<T> {
81+
/**
82+
* Clears the selections in all of the panes
83+
*
84+
* @returns self for chaining
85+
*/
86+
clearSelections(): Api<T>;
87+
88+
/**
89+
* Returns the node of the SearchPanes container
90+
*
91+
* @returns The node of the SearchPanes container
92+
*/
93+
container(): JQuery<HTMLElement>;
94+
95+
/**
96+
* Rebuilds the SearchPanes, regathering the options from the table.
97+
*
98+
* @param index Optional. The index of a specific pane to rebuild
99+
* @param maintainSelect Optional. Whether to remake the selections once the pane has been rebuilt.
100+
* @returns self for chaining
101+
*/
102+
rebuildPane(index?: number, maintainSelect?: boolean): Api<T>;
103+
104+
/**
105+
* Resize all of the SearchPanes to fill the container appropriately.
106+
*
107+
* @returns self for chaining
108+
*/
109+
resizePanes(): Api<T>;
110+
}

0 commit comments

Comments
 (0)