datatables.net-select-dt 1.6.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,41 +2,72 @@ table.dataTable > tbody > tr > .selected {
2
2
  background-color: rgba(13, 110, 253, 0.9);
3
3
  color: white;
4
4
  }
5
+ table.dataTable > tbody > tr > .dt-select {
6
+ text-align: center;
7
+ vertical-align: middle;
8
+ }
9
+ table.dataTable > thead > tr > .dt-select {
10
+ text-align: center;
11
+ }
12
+ table.dataTable input.dt-select-checkbox {
13
+ appearance: none;
14
+ position: relative;
15
+ display: inline-block;
16
+ width: 12px;
17
+ height: 12px;
18
+ border: 1px solid;
19
+ border-radius: 3px;
20
+ vertical-align: middle;
21
+ margin-top: 1px;
22
+ color: inherit;
23
+ font-size: 20px;
24
+ line-height: 1em;
25
+ }
26
+ table.dataTable input.dt-select-checkbox:checked:after {
27
+ display: block;
28
+ content: "✓";
29
+ margin-top: -8px;
30
+ }
31
+ table.dataTable input.dt-select-checkbox:indeterminate:after {
32
+ display: block;
33
+ position: absolute;
34
+ content: " ";
35
+ top: 3px;
36
+ left: 3px;
37
+ height: 4px;
38
+ width: 4px;
39
+ background-color: black;
40
+ border-radius: 2px;
41
+ }
42
+ table.dataTable > tbody > tr.selected input.dt-select-checkbox:checked {
43
+ border: 1px solid;
44
+ }
5
45
  table.dataTable > tbody > tr > td.select-checkbox,
6
46
  table.dataTable > tbody > tr > th.select-checkbox {
7
47
  position: relative;
8
48
  }
9
- table.dataTable > tbody > tr > td.select-checkbox:before, table.dataTable > tbody > tr > td.select-checkbox:after,
10
- table.dataTable > tbody > tr > th.select-checkbox:before,
11
- table.dataTable > tbody > tr > th.select-checkbox:after {
49
+ table.dataTable > tbody > tr > td.select-checkbox:before,
50
+ table.dataTable > tbody > tr > th.select-checkbox:before {
12
51
  display: block;
13
52
  position: absolute;
14
- top: 1.2em;
53
+ top: 50%;
15
54
  left: 50%;
16
55
  width: 12px;
17
56
  height: 12px;
18
57
  box-sizing: border-box;
19
- }
20
- table.dataTable > tbody > tr > td.select-checkbox:before,
21
- table.dataTable > tbody > tr > th.select-checkbox:before {
22
58
  content: " ";
23
59
  margin-top: -6px;
24
60
  margin-left: -6px;
25
- border: 1px solid black;
61
+ border: 1px solid;
26
62
  border-radius: 3px;
27
63
  }
28
64
  table.dataTable > tbody > tr.selected > td.select-checkbox:before,
29
65
  table.dataTable > tbody > tr.selected > th.select-checkbox:before {
30
- border: 1px solid white;
31
- }
32
- table.dataTable > tbody > tr.selected > td.select-checkbox:after,
33
- table.dataTable > tbody > tr.selected > th.select-checkbox:after {
66
+ border: 1px solid;
34
67
  content: "✓";
35
68
  font-size: 20px;
36
- margin-top: -19px;
37
- margin-left: -6px;
69
+ line-height: 6px;
38
70
  text-align: center;
39
- text-shadow: 1px 1px #B0BED9, -1px -1px #B0BED9, 1px -1px #B0BED9, -1px 1px #B0BED9;
40
71
  }
41
72
  table.dataTable.compact > tbody > tr > td.select-checkbox:before,
42
73
  table.dataTable.compact > tbody > tr > th.select-checkbox:before {
@@ -47,14 +78,19 @@ table.dataTable.compact > tbody > tr.selected > th.select-checkbox:after {
47
78
  margin-top: -16px;
48
79
  }
49
80
 
50
- div.dataTables_wrapper span.select-info,
51
- div.dataTables_wrapper span.select-item {
81
+ div.dt-container span.select-info,
82
+ div.dt-container span.select-item {
52
83
  margin-left: 0.5em;
53
84
  }
54
85
 
86
+ html.dark table.dataTable input.dt-select-checkbox:indeterminate:after,
87
+ html[data-bs-theme=dark] table.dataTable input.dt-select-checkbox:indeterminate:after {
88
+ background-color: white;
89
+ }
90
+
55
91
  @media screen and (max-width: 640px) {
56
- div.dataTables_wrapper span.select-info,
57
- div.dataTables_wrapper span.select-item {
92
+ div.dt-container span.select-info,
93
+ div.dt-container span.select-item {
58
94
  margin-left: 0;
59
95
  display: block;
60
96
  }
@@ -1 +1 @@
1
- table.dataTable>tbody>tr>.selected{background-color:rgba(13, 110, 253, 0.9);color:white}table.dataTable>tbody>tr>td.select-checkbox,table.dataTable>tbody>tr>th.select-checkbox{position:relative}table.dataTable>tbody>tr>td.select-checkbox:before,table.dataTable>tbody>tr>td.select-checkbox:after,table.dataTable>tbody>tr>th.select-checkbox:before,table.dataTable>tbody>tr>th.select-checkbox:after{display:block;position:absolute;top:1.2em;left:50%;width:12px;height:12px;box-sizing:border-box}table.dataTable>tbody>tr>td.select-checkbox:before,table.dataTable>tbody>tr>th.select-checkbox:before{content:" ";margin-top:-6px;margin-left:-6px;border:1px solid black;border-radius:3px}table.dataTable>tbody>tr.selected>td.select-checkbox:before,table.dataTable>tbody>tr.selected>th.select-checkbox:before{border:1px solid white}table.dataTable>tbody>tr.selected>td.select-checkbox:after,table.dataTable>tbody>tr.selected>th.select-checkbox:after{content:"✓";font-size:20px;margin-top:-19px;margin-left:-6px;text-align:center;text-shadow:1px 1px #b0bed9,-1px -1px #b0bed9,1px -1px #b0bed9,-1px 1px #b0bed9}table.dataTable.compact>tbody>tr>td.select-checkbox:before,table.dataTable.compact>tbody>tr>th.select-checkbox:before{margin-top:-12px}table.dataTable.compact>tbody>tr.selected>td.select-checkbox:after,table.dataTable.compact>tbody>tr.selected>th.select-checkbox:after{margin-top:-16px}div.dataTables_wrapper span.select-info,div.dataTables_wrapper span.select-item{margin-left:.5em}@media screen and (max-width: 640px){div.dataTables_wrapper span.select-info,div.dataTables_wrapper span.select-item{margin-left:0;display:block}}
1
+ table.dataTable>tbody>tr>.selected{background-color:rgba(13, 110, 253, 0.9);color:white}table.dataTable>tbody>tr>.dt-select{text-align:center;vertical-align:middle}table.dataTable>thead>tr>.dt-select{text-align:center}table.dataTable input.dt-select-checkbox{appearance:none;position:relative;display:inline-block;width:12px;height:12px;border:1px solid;border-radius:3px;vertical-align:middle;margin-top:1px;color:inherit;font-size:20px;line-height:1em}table.dataTable input.dt-select-checkbox:checked:after{display:block;content:"✓";margin-top:-8px}table.dataTable input.dt-select-checkbox:indeterminate:after{display:block;position:absolute;content:" ";top:3px;left:3px;height:4px;width:4px;background-color:black;border-radius:2px}table.dataTable>tbody>tr.selected input.dt-select-checkbox:checked{border:1px solid}table.dataTable>tbody>tr>td.select-checkbox,table.dataTable>tbody>tr>th.select-checkbox{position:relative}table.dataTable>tbody>tr>td.select-checkbox:before,table.dataTable>tbody>tr>th.select-checkbox:before{display:block;position:absolute;top:50%;left:50%;width:12px;height:12px;box-sizing:border-box;content:" ";margin-top:-6px;margin-left:-6px;border:1px solid;border-radius:3px}table.dataTable>tbody>tr.selected>td.select-checkbox:before,table.dataTable>tbody>tr.selected>th.select-checkbox:before{border:1px solid;content:"✓";font-size:20px;line-height:6px;text-align:center}table.dataTable.compact>tbody>tr>td.select-checkbox:before,table.dataTable.compact>tbody>tr>th.select-checkbox:before{margin-top:-12px}table.dataTable.compact>tbody>tr.selected>td.select-checkbox:after,table.dataTable.compact>tbody>tr.selected>th.select-checkbox:after{margin-top:-16px}div.dt-container span.select-info,div.dt-container span.select-item{margin-left:.5em}html.dark table.dataTable input.dt-select-checkbox:indeterminate:after,html[data-bs-theme=dark] table.dataTable input.dt-select-checkbox:indeterminate:after{background-color:white}@media screen and (max-width: 640px){div.dt-container span.select-info,div.dt-container span.select-item{margin-left:0;display:block}}
@@ -22,7 +22,7 @@
22
22
  }
23
23
  };
24
24
 
25
- if (typeof window !== 'undefined') {
25
+ if (typeof window === 'undefined') {
26
26
  module.exports = function (root, $) {
27
27
  if ( ! root ) {
28
28
  // CommonJS environments without a window global must pass a
@@ -47,7 +47,7 @@
47
47
  // Browser
48
48
  factory( jQuery, window, document );
49
49
  }
50
- }(function( $, window, document, undefined ) {
50
+ }(function( $, window, document ) {
51
51
  'use strict';
52
52
  var DataTable = $.fn.dataTable;
53
53
 
@@ -1,4 +1,4 @@
1
1
  /*! DataTables styling wrapper for Select
2
2
  * © SpryMedia Ltd - datatables.net/license
3
3
  */
4
- !function(n){var d,o;"function"==typeof define&&define.amd?define(["jquery","datatables.net-dt","datatables.net-select"],function(e){return n(e,window,document)}):"object"==typeof exports?(d=require("jquery"),o=function(e,t){t.fn.dataTable||require("datatables.net-dt")(e,t),t.fn.dataTable.select||require("datatables.net-select")(e,t)},"undefined"!=typeof window?module.exports=function(e,t){return e=e||window,t=t||d(e),o(e,t),n(t,0,e.document)}:(o(window,d),module.exports=n(d,window,window.document))):n(jQuery,window,document)}(function(e,t,n,d){"use strict";return e.fn.dataTable});
4
+ !function(n){var d,o;"function"==typeof define&&define.amd?define(["jquery","datatables.net-dt","datatables.net-select"],function(e){return n(e,window,document)}):"object"==typeof exports?(d=require("jquery"),o=function(e,t){t.fn.dataTable||require("datatables.net-dt")(e,t),t.fn.dataTable.select||require("datatables.net-select")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||d(e),o(e,t),n(t,0,e.document)}:(o(window,d),module.exports=n(d,window,window.document))):n(jQuery,window,document)}(function(e,t,n){"use strict";return e.fn.dataTable});
@@ -1,4 +1,4 @@
1
1
  /*! DataTables styling wrapper for Select
2
2
  * © SpryMedia Ltd - datatables.net/license
3
3
  */
4
- import $ from"jquery";import DataTable from"datatables.net-dt";import select from"datatables.net-select";export default DataTable;
4
+ import jQuery from"jquery";import DataTable from"datatables.net-dt";import select from"datatables.net-select";let $=jQuery;export default DataTable;
@@ -2,10 +2,13 @@
2
2
  * © SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
5
- import $ from 'jquery';
5
+ import jQuery from 'jquery';
6
6
  import DataTable from 'datatables.net-dt';
7
7
  import select from 'datatables.net-select';
8
8
 
9
+ // Allow reassignment of the $ variable
10
+ let $ = jQuery;
11
+
9
12
 
10
13
 
11
14
  export default DataTable;
package/package.json CHANGED
@@ -4,8 +4,8 @@
4
4
  "main": "js/select.dataTables.js",
5
5
  "module": "js/select.dataTables.mjs",
6
6
  "style": "css/select.dataTables.css",
7
- "types": "./types/types.d.ts",
8
- "version": "1.6.2",
7
+ "types": "./types/select.dataTables.d.ts",
8
+ "version": "2.0.0",
9
9
  "files": [
10
10
  "css/**/*.css",
11
11
  "js/**/*.js",
@@ -22,8 +22,8 @@
22
22
  "sort"
23
23
  ],
24
24
  "dependencies": {
25
- "datatables.net-select": ">=1.4.0",
26
- "datatables.net-dt": ">=1.12.1",
25
+ "datatables.net-select": "2.0.0",
26
+ "datatables.net-dt": ">=2.0.0",
27
27
  "jquery": ">=1.7"
28
28
  },
29
29
  "moduleType": [
@@ -0,0 +1,5 @@
1
+
2
+ import DataTable from 'datatables.net-select';
3
+
4
+ export default DataTable;
5
+ export * from 'datatables.net-select';
package/types/types.d.ts DELETED
@@ -1,231 +0,0 @@
1
- // Type definitions for DataTables Select
2
- //
3
- // Project: https://datatables.net/extensions/select/, https://datatables.net
4
- // Definitions by:
5
- // SpryMedia
6
- // Jared Szechy <https://github.com/szechyjs>
7
-
8
- /// <reference types="jquery" />
9
-
10
- import DataTables from 'datatables.net';
11
-
12
- export default DataTables;
13
-
14
- type StyleType = 'api' | 'single' | 'multi' | 'os' | 'multi+shift';
15
-
16
- declare module 'datatables.net' {
17
- interface Config {
18
- /*
19
- * Select extension options
20
- */
21
- select?: boolean | string | ConfigSelect;
22
- }
23
-
24
- interface Api<T> {
25
- select: ApiSelect<Api<T>>
26
- }
27
-
28
- interface ApiSelectorModifier {
29
- /**
30
- * Pick rows / columns / cells which are selected
31
- */
32
- selected?: boolean | undefined;
33
- }
34
-
35
- interface ApiRowMethods<T> {
36
- /**
37
- * Select a row
38
- */
39
- select(): Api<T>;
40
-
41
- /**
42
- * Deselect a row
43
- */
44
- deselect(): Api<T>;
45
- }
46
-
47
- interface ApiRowsMethods<T> {
48
- /**
49
- * Select multiple rows
50
- */
51
- select(): Api<T>;
52
-
53
- /**
54
- * Deselect a row
55
- */
56
- deselect(): Api<T>;
57
- }
58
-
59
- interface ApiCellMethods<T> {
60
- /**
61
- * Select cell
62
- */
63
- select(): Api<T>;
64
-
65
- /**
66
- * Deselect a cell
67
- */
68
- deselect(): Api<T>;
69
- }
70
-
71
- interface ApiCellsMethods<T> {
72
- /**
73
- * Select multiple cells
74
- */
75
- select(): Api<T>;
76
-
77
- /**
78
- * Deselect cells
79
- */
80
- deselect(): Api<T>;
81
- }
82
-
83
- interface ApiStatic {
84
- /**
85
- * Select static methods
86
- */
87
- select: {
88
- /**
89
- * Initialise Select (for use on tables which were not in the document
90
- * when they were initialised).
91
- */
92
- init: <T=any>(api: Api<T>) => void;
93
-
94
- /**
95
- * Select version
96
- */
97
- version: string;
98
- }
99
- }
100
- }
101
-
102
- interface ConfigSelect {
103
- /**
104
- * Indicate if the selected items will be removed when clicking outside of the table
105
- */
106
- blurable?: boolean;
107
-
108
- /**
109
- * Set the class name that will be applied to selected items
110
- */
111
- className?: string;
112
-
113
- /**
114
- * Enable / disable the display for item selection information in the table summary
115
- */
116
- info?: boolean;
117
-
118
- /**
119
- * Set which table items to select (rows, columns or cells)
120
- */
121
- items?: string;
122
-
123
- /**
124
- * Set the element selector used for mouse event capture to select items
125
- */
126
- selector?: string;
127
-
128
- /**
129
- * Set the selection style for end user interaction with the table
130
- */
131
- style?: StyleType;
132
- }
133
-
134
- interface ApiSelect<Api> {
135
- /**
136
- * Initialise Select for a DataTable after the DataTable has been constructed.
137
- *
138
- * @returns DataTables Api instance
139
- */
140
- (): Api;
141
-
142
- /**
143
- * Get the blurable state for the table.
144
- *
145
- * @returns Current state - true if blurable, false otherwise. Note that if multiple tables are defined in the API's context, only the blurable state of the first table will be returned.
146
- */
147
- blurable(): boolean;
148
-
149
- /**
150
- * Set the blurable state for the table's selection options.
151
- *
152
- * @param flag Value to set for the blurable option - true to enable, false to disable.
153
- * @returns DataTables Api instance for chaining
154
- */
155
- blurable(flag): Api;
156
-
157
- /**
158
- * Get the summary information display state for the table.
159
- *
160
- * @returns Current state - true if information summary shown, false otherwise. Note that if multiple tables are defined in the API's context, only the information state of the first table will be returned.
161
- */
162
- info(): boolean;
163
-
164
- /**
165
- * Set the information summary display state for the table's selection options.
166
- *
167
- * @param flag Value to set for the information summary display state - true to enable, false to disable.
168
- * @returns DataTables API instance for chaining.
169
- */
170
- info(flag): Api;
171
-
172
- /**
173
- * Get the items that will be selected by user interaction (i.e. a click on the table).
174
- *
175
- * @returns The current item that will be selected when the user interacts with Select's event listeners - this will be the value row, column or cell.
176
- */
177
- items(): string;
178
-
179
- /**
180
- * Set the item type that will be selected by user interaction.
181
- *
182
- * @param set Items to select - this must be one of row, column or cells.
183
- * @returns DataTables API instance for chaining.
184
- */
185
- items(set: string): Api;
186
-
187
- /**
188
- * Get the current item selector string applied to the table.
189
- *
190
- * @returns the item selector string being used for the table.
191
- */
192
- selector(): string;
193
-
194
- /**
195
- * Set the table's item selector string. Note that any old selectors will be automatically removed if this is used as a selector to ensure that there are no memory leaks in unattached event listeners.
196
- *
197
- * @param set jQuery selector that will select the cells that can trigger item selection.
198
- */
199
- selector(set: string): Api;
200
-
201
- /**
202
- * Get the current selection style applied to the table
203
- *
204
- * @returns The current selection style, this will be one of "api", "single", "multi" or "os".
205
- */
206
- style(): string;
207
-
208
- /**
209
- * Set the table's selection style
210
- *
211
- * @param s Selection style to set - this must be one of "api", "single", "multi" or "os".
212
- * @returns DataTables API instance for chaining.
213
- */
214
- style(s: StyleType): Api;
215
-
216
- /**
217
- * Get the toggle state of Select for the given DataTable.
218
- *
219
- * @returns true if the item can be deselected when clicked on, false if it cannot be.
220
- */
221
- toggleable(): boolean;
222
-
223
- /**
224
- * Set the toggle state of Select for the DataTable.
225
- *
226
- * @param set true to allow item deselection, false to disallow.
227
- * @returns DataTables API instance for chaining.
228
- */
229
- toggleable(set): Api;
230
- }
231
-