Skip to content

Commit af373b4

Browse files
committed
Merge remote-tracking branch 'remotes/origin/develop'
2 parents 75f9b7b + d5a06f7 commit af373b4

File tree

5 files changed

+170
-6
lines changed

5 files changed

+170
-6
lines changed

js/dataTables.checkboxes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* jQuery DataTables Checkboxes (https://www.gyrocode.com/projects/jquery-datatables-checkboxes/)
33
* Checkboxes extension for jQuery DataTables
44
*
5-
* @version 1.2.13
5+
* @version 1.2.14
66
* @author Gyrocode LLC (https://www.gyrocode.com)
77
* @copyright (c) Gyrocode LLC
88
* @license MIT
@@ -1274,7 +1274,7 @@
12741274
* @name Checkboxes.version
12751275
* @static
12761276
*/
1277-
Checkboxes.version = '1.2.13';
1277+
Checkboxes.version = '1.2.14';
12781278

12791279

12801280

js/dataTables.checkboxes.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dataTables.checkboxes.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "jquery-datatables-checkboxes",
33
"title": "jQuery DataTables Checkboxes",
4-
"version": "1.2.13",
4+
"version": "1.2.14",
55
"description": "Checkboxes is an extension for the jQuery DataTables library that provides universal solution for working with checkboxes in a table.",
66
"main": "js/dataTables.checkboxes.js",
7+
"types": "./types/types.d.ts",
78
"keywords": [
89
"jQuery",
910
"DataTables",

types/types.d.ts

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
// Type definitions for jquery-datatables-checkboxes
2+
// Project: https://www.gyrocode.com/projects/jquery-datatables-checkboxes/
3+
4+
/// <reference types="jquery" />
5+
6+
import DataTables, {Api} from 'datatables.net';
7+
8+
export default DataTables;
9+
10+
declare module 'datatables.net' {
11+
interface ConfigColumns {
12+
/**
13+
* Checkboxes plugin options
14+
*/
15+
checkboxes?: boolean | ConfigColumnsCheckboxes;
16+
}
17+
18+
interface ConfigColumnsCheckboxes {
19+
/**
20+
* Enable / disable checkbox state loading/saving if state saving is enabled globally.
21+
*/
22+
stateSave?: boolean;
23+
24+
/**
25+
* Enable / disable row selection.
26+
*/
27+
selectRow?: boolean;
28+
29+
/**
30+
* Enable / disable "select all" control in the header.
31+
*/
32+
selectAll?: boolean;
33+
34+
/**
35+
* Enable / disable ability to select checkboxes from all pages.
36+
*/
37+
selectAllPages?: boolean;
38+
39+
/**
40+
* Checkbox select/deselect callback.
41+
*/
42+
selectCallback?: FunctionCheckboxesSelectCallback;
43+
44+
/**
45+
* "Select all" control select/deselect callback.
46+
*/
47+
selectAllCallback?: FunctionCheckboxesSelectCallback;
48+
49+
/**
50+
* "Select all" control markup.
51+
*/
52+
selectAllRender?: string
53+
54+
}
55+
56+
interface ApiCellMethods<T> {
57+
checkboxes?: ApiCellCheckboxes<T>
58+
}
59+
60+
interface ApiCellsMethods<T> {
61+
checkboxes?: ApiCellsCheckboxes<T>
62+
}
63+
64+
interface ApiColumnMethods {
65+
checkboxes?: ApiColumnCheckboxes
66+
}
67+
68+
interface ApiColumnsMethods {
69+
checkboxes?: ApiColumnsCheckboxes
70+
}
71+
72+
interface ApiCellCheckboxes<T> extends Omit<Api<T>, 'render'> {
73+
/**
74+
* Checks a checkbox in a cell.
75+
*/
76+
select(state?: boolean): Api<T>;
77+
78+
/**
79+
* Unchecks a checkbox in a cell.
80+
*/
81+
deselect(state?: boolean): Api<T>;
82+
83+
/**
84+
* Enables a checkbox in a cell.
85+
*/
86+
enable(state?: boolean): Api<T>;
87+
88+
/**
89+
* Disables a checkbox in a cell.
90+
*/
91+
disable(state?: boolean): Api<T>;
92+
}
93+
94+
interface ApiCellsCheckboxes<T> extends Omit<Api<T>, 'render'> {
95+
/**
96+
* Checks a checkbox in multiple cells.
97+
*/
98+
select(state?: boolean): Api<T>;
99+
100+
/**
101+
* Unchecks a checkbox in multiple cells.
102+
*/
103+
deselect(state?: boolean): Api<T>;
104+
105+
/**
106+
* Enables a checkbox in multiple cells.
107+
*/
108+
enable(state?: boolean): Api<T>;
109+
110+
/**
111+
* Disables a checkbox in multiple cells.
112+
*/
113+
disable(state?: boolean): Api<T>;
114+
}
115+
116+
interface ApiColumnCheckboxes {
117+
/**
118+
* Checks checkboxes in a column.
119+
*/
120+
select(state?: boolean): Api<any>;
121+
122+
/**
123+
* Unchecks checkboxes in a column.
124+
*/
125+
deselect(state?: boolean): Api<any>;
126+
127+
/**
128+
* Unchecks all checkboxes in a column.
129+
*/
130+
deselectAll(): Api<any>;
131+
132+
/**
133+
* Retrieves data for selected checkboxes in a column.
134+
*/
135+
selected(): Api<any>;
136+
}
137+
138+
interface ApiColumnsCheckboxes {
139+
/**
140+
* Checks checkboxes in multiple columns.
141+
*/
142+
select(state?: boolean): Api<any>;
143+
144+
/**
145+
* Unchecks checkboxes in multiple columns.
146+
*/
147+
deselect(state?: boolean): Api<any>;
148+
149+
/**
150+
* Unchecks all checkboxes in multiple columns.
151+
*/
152+
deselectAll(): Api<any>;
153+
154+
/**
155+
* Retrieves data for selected checkboxes in multiple columns.
156+
*/
157+
selected(): Api<any>;
158+
}
159+
}
160+
161+
type FunctionCheckboxesSelectCallback = (nodes: Node[], selected: boolean) => void;
162+
163+
type FunctionCheckboxesSelectAllCallback = (nodes: Node[], selected: boolean, indeterminate: boolean) => void;

0 commit comments

Comments
 (0)