Skip to content

Commit b0cca41

Browse files
committed
255656e3a9b77617ee18b47774da06f753491c18
Sync to source repo @255656e3a9b77617ee18b47774da06f753491c18
1 parent 3225a32 commit b0cca41

5 files changed

+106
-7
lines changed

css/searchBuilder.bootstrap4.min.css

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

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/SearchBuilder",
17-
"last-tag": "1.3.4"
18-
}
17+
"last-tag": "1.3.4",
18+
"last-sync": "255656e3a9b77617ee18b47774da06f753491c18"
19+
}

js/searchBuilder.bootstrap4.min.js

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

js/searchBuilder.bootstrap4.min.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
/*! Bootstrap 4 ui integration for DataTables' SearchBuilder
2+
* © SpryMedia Ltd - datatables.net/license
3+
*/
14
import $ from"jquery";import DataTable from"datatables.net-bs4";import DataTable from"datatables.net-searchbuilder";$.extend(!0,DataTable.SearchBuilder.classes,{clearAll:"btn btn-light dtsb-clearAll"}),$.extend(!0,DataTable.Group.classes,{add:"btn btn-light dtsb-add",clearGroup:"btn btn-light dtsb-clearGroup",logic:"btn btn-light dtsb-logic"}),$.extend(!0,DataTable.Criteria.classes,{condition:"form-control dtsb-condition",data:"form-control dtsb-data",delete:"btn btn-light dtsb-delete",left:"btn btn-light dtsb-left",right:"btn btn-light dtsb-right",value:"form-control dtsb-value"});export default DataTable;

types/types.d.ts

+96-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,99 @@
1+
// Type definitions for DataTables SearchBuilder
2+
//
3+
// Project: https://datatables.net/extensions/searchbuilder/, https://datatables.net
14

2-
// Dist-DataTables-SearchBuilder-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 {IDefaults, IDetails, II18n} from './searchBuilder';
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+
* SearchBuilder extension options
24+
*/
25+
searchBuilder?: boolean | string[] | ConfigSearchBuilder | ConfigSearchBuilder[];
26+
}
27+
28+
interface ConfigLanguage {
29+
/**
30+
* SearchBuilder language options
31+
*/
32+
searchBuilder?: ConfigSearchBuilderLanguage;
33+
}
34+
35+
interface Api<T> {
36+
/**
37+
* SearchBuilder methods container
38+
*
39+
* @returns Api for chaining with the additional SearchBuilder methods
40+
*/
41+
searchBuilder: ApiSearchBuilder<T>;
42+
}
43+
44+
interface ApiStatic {
45+
/**
46+
* SearchBuilder class
47+
*/
48+
SearchBuilder: {
49+
/**
50+
* Create a new SearchBuilder instance for the target DataTable
51+
*/
52+
new (dt: Api<any>, settings: string[] | ConfigSearchBuilder | ConfigSearchBuilder[]);
53+
54+
/**
55+
* SearchBuilder version
56+
*/
57+
version: string;
58+
59+
/**
60+
* Default configuration values
61+
*/
62+
defaults: ConfigSearchBuilder;
63+
}
64+
}
65+
}
66+
67+
68+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
69+
* Options
70+
*/
71+
72+
interface ConfigSearchBuilder extends Partial<IDefaults> {}
73+
74+
interface ConfigSearchBuilderLanguage extends DeepPartial<II18n> {}
75+
76+
77+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
78+
* API
79+
*/
80+
interface ApiSearchBuilder<T> extends Api<T> {
81+
/**
82+
* Returns the node of the SearchBuilder Container
83+
*/
84+
container(): JQuery<HTMLElement>;
85+
86+
/**
87+
* Gets the details of the current SearchBuilder setup
88+
*/
89+
getDetails(): IDetails;
90+
91+
/**
92+
* Rebuild the search to a given state.
93+
*
94+
* @param state Object of the same structure that is returned from searchBuilder.getDetails().
95+
* This contains all of the details needed to rebuild the state.
96+
* @returns self for chaining
97+
*/
98+
rebuild(state: IDetails): Api<T>;
99+
}

0 commit comments

Comments
 (0)