@ntlab/ntjs-assets 2.17.0 → 2.18.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.
@@ -231,62 +231,100 @@ div.dt-datetime-error {
231
231
  color: #b11f1f;
232
232
  }
233
233
 
234
- html.dark input.dt-datetime {
234
+ html.dark input.dt-datetime,
235
+ :root[data-theme=dark] input.dt-datetime,
236
+ :root[data-bs-theme=dark] input.dt-datetime {
235
237
  color-scheme: dark;
236
238
  }
237
- html.dark div.dt-datetime {
239
+ html.dark div.dt-datetime,
240
+ :root[data-theme=dark] div.dt-datetime,
241
+ :root[data-bs-theme=dark] div.dt-datetime {
238
242
  border: 1px solid #595b5e;
239
243
  background-color: #212529;
240
244
  box-shadow: 3px 4px 10px 1px rgba(0, 0, 0, 0.8);
241
245
  }
242
- html.dark div.dt-datetime table th {
246
+ html.dark div.dt-datetime table th,
247
+ :root[data-theme=dark] div.dt-datetime table th,
248
+ :root[data-bs-theme=dark] div.dt-datetime table th {
243
249
  color: #ccc;
244
250
  }
245
- html.dark div.dt-datetime table td {
251
+ html.dark div.dt-datetime table td,
252
+ :root[data-theme=dark] div.dt-datetime table td,
253
+ :root[data-bs-theme=dark] div.dt-datetime table td {
246
254
  color: #eee;
247
255
  }
248
- html.dark div.dt-datetime table td.selectable {
256
+ html.dark div.dt-datetime table td.selectable,
257
+ :root[data-theme=dark] div.dt-datetime table td.selectable,
258
+ :root[data-bs-theme=dark] div.dt-datetime table td.selectable {
249
259
  background: #373c41;
250
260
  }
251
- html.dark div.dt-datetime table td.selectable.disabled {
261
+ html.dark div.dt-datetime table td.selectable.disabled,
262
+ :root[data-theme=dark] div.dt-datetime table td.selectable.disabled,
263
+ :root[data-bs-theme=dark] div.dt-datetime table td.selectable.disabled {
252
264
  color: #aaa;
253
265
  background: #171b1f;
254
266
  }
255
- html.dark div.dt-datetime table td.selectable.disabled button:hover {
267
+ html.dark div.dt-datetime table td.selectable.disabled button:hover,
268
+ :root[data-theme=dark] div.dt-datetime table td.selectable.disabled button:hover,
269
+ :root[data-bs-theme=dark] div.dt-datetime table td.selectable.disabled button:hover {
256
270
  color: #aaa;
257
271
  background: #171b1f;
258
272
  }
259
- html.dark div.dt-datetime table td.selectable.now {
273
+ html.dark div.dt-datetime table td.selectable.now,
274
+ :root[data-theme=dark] div.dt-datetime table td.selectable.now,
275
+ :root[data-bs-theme=dark] div.dt-datetime table td.selectable.now {
260
276
  background: #4b5055;
261
277
  }
262
- html.dark div.dt-datetime table td.selectable.selected button {
278
+ html.dark div.dt-datetime table td.selectable.selected button,
279
+ :root[data-theme=dark] div.dt-datetime table td.selectable.selected button,
280
+ :root[data-bs-theme=dark] div.dt-datetime table td.selectable.selected button {
263
281
  background: #6ea8fe;
264
282
  color: black;
265
283
  }
266
- html.dark div.dt-datetime table td.selectable button:hover {
284
+ html.dark div.dt-datetime table td.selectable button:hover,
285
+ :root[data-theme=dark] div.dt-datetime table td.selectable button:hover,
286
+ :root[data-bs-theme=dark] div.dt-datetime table td.selectable button:hover {
267
287
  background: #ff8000;
268
288
  color: black;
269
289
  }
270
- html.dark div.dt-datetime div.dt-datetime-label:hover {
290
+ html.dark div.dt-datetime div.dt-datetime-label:hover,
291
+ :root[data-theme=dark] div.dt-datetime div.dt-datetime-label:hover,
292
+ :root[data-bs-theme=dark] div.dt-datetime div.dt-datetime-label:hover {
271
293
  border: 1px solid transparent;
272
294
  background-color: rgba(255, 255, 255, 0.1);
273
295
  }
274
296
  html.dark div.dt-datetime div.dt-datetime-iconLeft:hover,
275
297
  html.dark div.dt-datetime div.dt-datetime-iconRight:hover,
276
298
  html.dark div.dt-datetime div.dt-datetime-iconUp:hover,
277
- html.dark div.dt-datetime div.dt-datetime-iconDown:hover {
299
+ html.dark div.dt-datetime div.dt-datetime-iconDown:hover,
300
+ :root[data-theme=dark] div.dt-datetime div.dt-datetime-iconLeft:hover,
301
+ :root[data-theme=dark] div.dt-datetime div.dt-datetime-iconRight:hover,
302
+ :root[data-theme=dark] div.dt-datetime div.dt-datetime-iconUp:hover,
303
+ :root[data-theme=dark] div.dt-datetime div.dt-datetime-iconDown:hover,
304
+ :root[data-bs-theme=dark] div.dt-datetime div.dt-datetime-iconLeft:hover,
305
+ :root[data-bs-theme=dark] div.dt-datetime div.dt-datetime-iconRight:hover,
306
+ :root[data-bs-theme=dark] div.dt-datetime div.dt-datetime-iconUp:hover,
307
+ :root[data-bs-theme=dark] div.dt-datetime div.dt-datetime-iconDown:hover {
278
308
  border: 1px solid transparent;
279
309
  background-color: rgba(255, 255, 255, 0.1);
280
310
  }
281
- html.dark div.dt-datetime div.dt-datetime-iconLeft:after {
311
+ html.dark div.dt-datetime div.dt-datetime-iconLeft:after,
312
+ :root[data-theme=dark] div.dt-datetime div.dt-datetime-iconLeft:after,
313
+ :root[data-bs-theme=dark] div.dt-datetime div.dt-datetime-iconLeft:after {
282
314
  border-right-color: white;
283
315
  }
284
- html.dark div.dt-datetime div.dt-datetime-iconRight:after {
316
+ html.dark div.dt-datetime div.dt-datetime-iconRight:after,
317
+ :root[data-theme=dark] div.dt-datetime div.dt-datetime-iconRight:after,
318
+ :root[data-bs-theme=dark] div.dt-datetime div.dt-datetime-iconRight:after {
285
319
  border-left-color: white;
286
320
  }
287
- html.dark div.dt-datetime select {
321
+ html.dark div.dt-datetime select,
322
+ :root[data-theme=dark] div.dt-datetime select,
323
+ :root[data-bs-theme=dark] div.dt-datetime select {
288
324
  color-scheme: dark;
289
325
  }
290
- html.dark div.dt-datetime-error {
326
+ html.dark div.dt-datetime-error,
327
+ :root[data-theme=dark] div.dt-datetime-error,
328
+ :root[data-bs-theme=dark] div.dt-datetime-error {
291
329
  color: #b11f1f;
292
330
  }
@@ -1 +1 @@
1
- div.dt-datetime{position:absolute;background-color:white;z-index:2050;border:1px solid #ccc;box-shadow:0 5px 15px -5px rgba(0, 0, 0, 0.5);padding:6px 20px;width:275px;border-radius:5px}div.dt-datetime.inline{position:relative;box-shadow:none}div.dt-datetime div.dt-datetime-title{text-align:center;padding:5px 0px 3px}div.dt-datetime div.dt-datetime-buttons{text-align:center}div.dt-datetime div.dt-datetime-buttons a{display:inline-block;padding:0 .5em .5em .5em;margin:0;font-size:.9em}div.dt-datetime div.dt-datetime-buttons a:hover{text-decoration:underline}div.dt-datetime table{border-spacing:0;margin:12px 0;width:100%}div.dt-datetime table.dt-datetime-table-nospace{margin-top:-12px}div.dt-datetime table th{font-size:.8em;color:#777;font-weight:normal;width:14.285714286%;padding:0 0 4px 0;text-align:center}div.dt-datetime table td{font-size:.9em;color:#444;padding:0}div.dt-datetime table td.selectable{text-align:center;background:#f5f5f5}div.dt-datetime table td.selectable.disabled{color:#aaa;background:white}div.dt-datetime table td.selectable.disabled button:hover{color:#aaa;background:white}div.dt-datetime table td.selectable.now{background-color:#ddd}div.dt-datetime table td.selectable.now button{font-weight:bold}div.dt-datetime table td.selectable.selected button{background:#4e6ca3;color:white;border-radius:2px}div.dt-datetime table td.selectable button:hover{background:#ff8000;color:white;border-radius:2px}div.dt-datetime table td.dt-datetime-week{font-size:.7em}div.dt-datetime table button{width:100%;box-sizing:border-box;border:none;background:transparent;font-size:inherit;color:inherit;text-align:center;padding:4px 0;cursor:pointer;margin:0}div.dt-datetime table button span{display:inline-block;min-width:14px;text-align:right}div.dt-datetime table.weekNumber th{width:12.5%}div.dt-datetime div.dt-datetime-calendar table{margin-top:0}div.dt-datetime div.dt-datetime-label{position:relative;display:inline-block;height:30px;padding:5px 6px;border:1px solid transparent;box-sizing:border-box;cursor:pointer}div.dt-datetime div.dt-datetime-label:hover{border:1px solid #ddd;border-radius:2px;background-color:#f5f5f5}div.dt-datetime div.dt-datetime-label select{position:absolute;top:6px;left:0;cursor:pointer;opacity:0}div.dt-datetime.horizontal{width:550px}div.dt-datetime.horizontal div.dt-datetime-date,div.dt-datetime.horizontal div.dt-datetime-time{width:48%}div.dt-datetime.horizontal div.dt-datetime-time{margin-left:4%}div.dt-datetime div.dt-datetime-date{position:relative;float:left;width:100%}div.dt-datetime div.dt-datetime-time{position:relative;float:left;width:100%;text-align:center}div.dt-datetime div.dt-datetime-time>span{vertical-align:middle}div.dt-datetime div.dt-datetime-time th{text-align:left}div.dt-datetime div.dt-datetime-time div.dt-datetime-timeblock{display:inline-block;vertical-align:middle}div.dt-datetime div.dt-datetime-iconLeft,div.dt-datetime div.dt-datetime-iconRight{width:30px;height:30px;background-position:center;background-repeat:no-repeat;opacity:.3;overflow:hidden;box-sizing:border-box;border:1px solid transparent}div.dt-datetime div.dt-datetime-iconLeft:hover,div.dt-datetime div.dt-datetime-iconRight:hover{border:1px solid #ccc;border-radius:2px;background-color:#f0f0f0;opacity:.6}div.dt-datetime div.dt-datetime-iconLeft button,div.dt-datetime div.dt-datetime-iconRight button{border:none;background:transparent;text-indent:30px;height:100%;width:100%;cursor:pointer}div.dt-datetime div.dt-datetime-iconLeft{position:absolute;top:5px;left:5px}div.dt-datetime div.dt-datetime-iconLeft button{position:relative;z-index:1}div.dt-datetime div.dt-datetime-iconLeft:after{position:absolute;top:7px;left:10px;display:block;content:"";border-top:7px solid transparent;border-right:7px solid black;border-bottom:7px solid transparent}div.dt-datetime div.dt-datetime-iconRight{position:absolute;top:5px;right:5px}div.dt-datetime div.dt-datetime-iconRight button{position:relative;z-index:1}div.dt-datetime div.dt-datetime-iconRight:after{position:absolute;top:7px;left:12px;display:block;content:"";border-top:7px solid transparent;border-left:7px solid black;border-bottom:7px solid transparent}div.dt-datetime-error{clear:both;padding:0 1em;max-width:240px;font-size:11px;line-height:1.25em;text-align:center;color:#b11f1f}html.dark input.dt-datetime{color-scheme:dark}html.dark div.dt-datetime{border:1px solid #595b5e;background-color:#212529;box-shadow:3px 4px 10px 1px rgba(0, 0, 0, 0.8)}html.dark div.dt-datetime table th{color:#ccc}html.dark div.dt-datetime table td{color:#eee}html.dark div.dt-datetime table td.selectable{background:#373c41}html.dark div.dt-datetime table td.selectable.disabled{color:#aaa;background:#171b1f}html.dark div.dt-datetime table td.selectable.disabled button:hover{color:#aaa;background:#171b1f}html.dark div.dt-datetime table td.selectable.now{background:#4b5055}html.dark div.dt-datetime table td.selectable.selected button{background:#6ea8fe;color:black}html.dark div.dt-datetime table td.selectable button:hover{background:#ff8000;color:black}html.dark div.dt-datetime div.dt-datetime-label:hover{border:1px solid transparent;background-color:rgba(255, 255, 255, 0.1)}html.dark div.dt-datetime div.dt-datetime-iconLeft:hover,html.dark div.dt-datetime div.dt-datetime-iconRight:hover,html.dark div.dt-datetime div.dt-datetime-iconUp:hover,html.dark div.dt-datetime div.dt-datetime-iconDown:hover{border:1px solid transparent;background-color:rgba(255, 255, 255, 0.1)}html.dark div.dt-datetime div.dt-datetime-iconLeft:after{border-right-color:white}html.dark div.dt-datetime div.dt-datetime-iconRight:after{border-left-color:white}html.dark div.dt-datetime select{color-scheme:dark}html.dark div.dt-datetime-error{color:#b11f1f}
1
+ div.dt-datetime{position:absolute;background-color:white;z-index:2050;border:1px solid #ccc;box-shadow:0 5px 15px -5px rgba(0, 0, 0, 0.5);padding:6px 20px;width:275px;border-radius:5px}div.dt-datetime.inline{position:relative;box-shadow:none}div.dt-datetime div.dt-datetime-title{text-align:center;padding:5px 0px 3px}div.dt-datetime div.dt-datetime-buttons{text-align:center}div.dt-datetime div.dt-datetime-buttons a{display:inline-block;padding:0 .5em .5em .5em;margin:0;font-size:.9em}div.dt-datetime div.dt-datetime-buttons a:hover{text-decoration:underline}div.dt-datetime table{border-spacing:0;margin:12px 0;width:100%}div.dt-datetime table.dt-datetime-table-nospace{margin-top:-12px}div.dt-datetime table th{font-size:.8em;color:#777;font-weight:normal;width:14.285714286%;padding:0 0 4px 0;text-align:center}div.dt-datetime table td{font-size:.9em;color:#444;padding:0}div.dt-datetime table td.selectable{text-align:center;background:#f5f5f5}div.dt-datetime table td.selectable.disabled{color:#aaa;background:white}div.dt-datetime table td.selectable.disabled button:hover{color:#aaa;background:white}div.dt-datetime table td.selectable.now{background-color:#ddd}div.dt-datetime table td.selectable.now button{font-weight:bold}div.dt-datetime table td.selectable.selected button{background:#4e6ca3;color:white;border-radius:2px}div.dt-datetime table td.selectable button:hover{background:#ff8000;color:white;border-radius:2px}div.dt-datetime table td.dt-datetime-week{font-size:.7em}div.dt-datetime table button{width:100%;box-sizing:border-box;border:none;background:transparent;font-size:inherit;color:inherit;text-align:center;padding:4px 0;cursor:pointer;margin:0}div.dt-datetime table button span{display:inline-block;min-width:14px;text-align:right}div.dt-datetime table.weekNumber th{width:12.5%}div.dt-datetime div.dt-datetime-calendar table{margin-top:0}div.dt-datetime div.dt-datetime-label{position:relative;display:inline-block;height:30px;padding:5px 6px;border:1px solid transparent;box-sizing:border-box;cursor:pointer}div.dt-datetime div.dt-datetime-label:hover{border:1px solid #ddd;border-radius:2px;background-color:#f5f5f5}div.dt-datetime div.dt-datetime-label select{position:absolute;top:6px;left:0;cursor:pointer;opacity:0}div.dt-datetime.horizontal{width:550px}div.dt-datetime.horizontal div.dt-datetime-date,div.dt-datetime.horizontal div.dt-datetime-time{width:48%}div.dt-datetime.horizontal div.dt-datetime-time{margin-left:4%}div.dt-datetime div.dt-datetime-date{position:relative;float:left;width:100%}div.dt-datetime div.dt-datetime-time{position:relative;float:left;width:100%;text-align:center}div.dt-datetime div.dt-datetime-time>span{vertical-align:middle}div.dt-datetime div.dt-datetime-time th{text-align:left}div.dt-datetime div.dt-datetime-time div.dt-datetime-timeblock{display:inline-block;vertical-align:middle}div.dt-datetime div.dt-datetime-iconLeft,div.dt-datetime div.dt-datetime-iconRight{width:30px;height:30px;background-position:center;background-repeat:no-repeat;opacity:.3;overflow:hidden;box-sizing:border-box;border:1px solid transparent}div.dt-datetime div.dt-datetime-iconLeft:hover,div.dt-datetime div.dt-datetime-iconRight:hover{border:1px solid #ccc;border-radius:2px;background-color:#f0f0f0;opacity:.6}div.dt-datetime div.dt-datetime-iconLeft button,div.dt-datetime div.dt-datetime-iconRight button{border:none;background:transparent;text-indent:30px;height:100%;width:100%;cursor:pointer}div.dt-datetime div.dt-datetime-iconLeft{position:absolute;top:5px;left:5px}div.dt-datetime div.dt-datetime-iconLeft button{position:relative;z-index:1}div.dt-datetime div.dt-datetime-iconLeft:after{position:absolute;top:7px;left:10px;display:block;content:"";border-top:7px solid transparent;border-right:7px solid black;border-bottom:7px solid transparent}div.dt-datetime div.dt-datetime-iconRight{position:absolute;top:5px;right:5px}div.dt-datetime div.dt-datetime-iconRight button{position:relative;z-index:1}div.dt-datetime div.dt-datetime-iconRight:after{position:absolute;top:7px;left:12px;display:block;content:"";border-top:7px solid transparent;border-left:7px solid black;border-bottom:7px solid transparent}div.dt-datetime-error{clear:both;padding:0 1em;max-width:240px;font-size:11px;line-height:1.25em;text-align:center;color:#b11f1f}html.dark input.dt-datetime,:root[data-theme=dark] input.dt-datetime,:root[data-bs-theme=dark] input.dt-datetime{color-scheme:dark}html.dark div.dt-datetime,:root[data-theme=dark] div.dt-datetime,:root[data-bs-theme=dark] div.dt-datetime{border:1px solid #595b5e;background-color:#212529;box-shadow:3px 4px 10px 1px rgba(0, 0, 0, 0.8)}html.dark div.dt-datetime table th,:root[data-theme=dark] div.dt-datetime table th,:root[data-bs-theme=dark] div.dt-datetime table th{color:#ccc}html.dark div.dt-datetime table td,:root[data-theme=dark] div.dt-datetime table td,:root[data-bs-theme=dark] div.dt-datetime table td{color:#eee}html.dark div.dt-datetime table td.selectable,:root[data-theme=dark] div.dt-datetime table td.selectable,:root[data-bs-theme=dark] div.dt-datetime table td.selectable{background:#373c41}html.dark div.dt-datetime table td.selectable.disabled,:root[data-theme=dark] div.dt-datetime table td.selectable.disabled,:root[data-bs-theme=dark] div.dt-datetime table td.selectable.disabled{color:#aaa;background:#171b1f}html.dark div.dt-datetime table td.selectable.disabled button:hover,:root[data-theme=dark] div.dt-datetime table td.selectable.disabled button:hover,:root[data-bs-theme=dark] div.dt-datetime table td.selectable.disabled button:hover{color:#aaa;background:#171b1f}html.dark div.dt-datetime table td.selectable.now,:root[data-theme=dark] div.dt-datetime table td.selectable.now,:root[data-bs-theme=dark] div.dt-datetime table td.selectable.now{background:#4b5055}html.dark div.dt-datetime table td.selectable.selected button,:root[data-theme=dark] div.dt-datetime table td.selectable.selected button,:root[data-bs-theme=dark] div.dt-datetime table td.selectable.selected button{background:#6ea8fe;color:black}html.dark div.dt-datetime table td.selectable button:hover,:root[data-theme=dark] div.dt-datetime table td.selectable button:hover,:root[data-bs-theme=dark] div.dt-datetime table td.selectable button:hover{background:#ff8000;color:black}html.dark div.dt-datetime div.dt-datetime-label:hover,:root[data-theme=dark] div.dt-datetime div.dt-datetime-label:hover,:root[data-bs-theme=dark] div.dt-datetime div.dt-datetime-label:hover{border:1px solid transparent;background-color:rgba(255, 255, 255, 0.1)}html.dark div.dt-datetime div.dt-datetime-iconLeft:hover,html.dark div.dt-datetime div.dt-datetime-iconRight:hover,html.dark div.dt-datetime div.dt-datetime-iconUp:hover,html.dark div.dt-datetime div.dt-datetime-iconDown:hover,:root[data-theme=dark] div.dt-datetime div.dt-datetime-iconLeft:hover,:root[data-theme=dark] div.dt-datetime div.dt-datetime-iconRight:hover,:root[data-theme=dark] div.dt-datetime div.dt-datetime-iconUp:hover,:root[data-theme=dark] div.dt-datetime div.dt-datetime-iconDown:hover,:root[data-bs-theme=dark] div.dt-datetime div.dt-datetime-iconLeft:hover,:root[data-bs-theme=dark] div.dt-datetime div.dt-datetime-iconRight:hover,:root[data-bs-theme=dark] div.dt-datetime div.dt-datetime-iconUp:hover,:root[data-bs-theme=dark] div.dt-datetime div.dt-datetime-iconDown:hover{border:1px solid transparent;background-color:rgba(255, 255, 255, 0.1)}html.dark div.dt-datetime div.dt-datetime-iconLeft:after,:root[data-theme=dark] div.dt-datetime div.dt-datetime-iconLeft:after,:root[data-bs-theme=dark] div.dt-datetime div.dt-datetime-iconLeft:after{border-right-color:white}html.dark div.dt-datetime div.dt-datetime-iconRight:after,:root[data-theme=dark] div.dt-datetime div.dt-datetime-iconRight:after,:root[data-bs-theme=dark] div.dt-datetime div.dt-datetime-iconRight:after{border-left-color:white}html.dark div.dt-datetime select,:root[data-theme=dark] div.dt-datetime select,:root[data-bs-theme=dark] div.dt-datetime select{color-scheme:dark}html.dark div.dt-datetime-error,:root[data-theme=dark] div.dt-datetime-error,:root[data-bs-theme=dark] div.dt-datetime-error{color:#b11f1f}
@@ -1,4 +1,4 @@
1
- /*! DateTime picker for DataTables.net v1.5.4
1
+ /*! DateTime picker for DataTables.net v1.5.5
2
2
  *
3
3
  * © SpryMedia Ltd, all rights reserved.
4
4
  * License: MIT datatables.net/license/mit
@@ -48,7 +48,7 @@
48
48
 
49
49
  /**
50
50
  * @summary DateTime picker for DataTables.net
51
- * @version 1.5.4
51
+ * @version 1.5.5
52
52
  * @file dataTables.dateTime.js
53
53
  * @author SpryMedia Ltd
54
54
  * @contact www.datatables.net/contact
@@ -183,7 +183,10 @@ var DateTime = function (input, opts) {
183
183
  time: this.c.format.match(/[Hhm]|LT|LTS/) !== null,
184
184
  seconds: this.c.format.indexOf('s') !== -1,
185
185
  hours12: this.c.format.match(/[haA]/) !== null
186
- }
186
+ },
187
+
188
+ /** Timeout when showing the control to listen for a blur */
189
+ showTo: null
187
190
  };
188
191
 
189
192
  this.dom.container
@@ -210,6 +213,7 @@ $.extend(DateTime.prototype, {
210
213
  * Destroy the control
211
214
  */
212
215
  destroy: function () {
216
+ clearTimeout(this.s.showTo);
213
217
  this._hide(true);
214
218
  this.dom.container.off().empty();
215
219
  this.dom.input
@@ -303,6 +307,8 @@ $.extend(DateTime.prototype, {
303
307
  return this.s.d;
304
308
  }
305
309
 
310
+ var oldVal = this.s.d;
311
+
306
312
  if (set instanceof Date) {
307
313
  this.s.d = this._dateToUtc(set);
308
314
  }
@@ -320,7 +326,12 @@ $.extend(DateTime.prototype, {
320
326
 
321
327
  if (write || write === undefined) {
322
328
  if (this.s.d) {
323
- this._writeOutput();
329
+ this._writeOutput(
330
+ false,
331
+ (oldVal === null && this.s.d !== null) ||
332
+ (oldVal !== null && this.s.d === null) ||
333
+ oldVal.toString() !== this.s.d.toString()
334
+ );
324
335
  }
325
336
  else {
326
337
  // The input value was not valid...
@@ -1559,6 +1570,29 @@ $.extend(DateTime.prototype, {
1559
1570
  }
1560
1571
  });
1561
1572
 
1573
+ clearTimeout(this.s.showTo);
1574
+
1575
+ // We can't use blur to hide, as we want to keep the picker open while
1576
+ // to let the user select from it. But if focus is moved outside of of
1577
+ // the picker, then we auto hide.
1578
+ this.dom.input.on('blur', function (e) {
1579
+ that.s.showTo = setTimeout(function () {
1580
+ let name = document.activeElement.tagName.toLowerCase();
1581
+
1582
+ if (document.activeElement === that.dom.input[0]) {
1583
+ return;
1584
+ }
1585
+
1586
+ if (that.dom.container.find(document.activeElement).length) {
1587
+ return;
1588
+ }
1589
+
1590
+ if (['input', 'select', 'button'].includes(name)) {
1591
+ that.hide();
1592
+ }
1593
+ }, 10);
1594
+ });
1595
+
1562
1596
  // Hide if clicking outside of the widget - but in a different click
1563
1597
  // event from the one that was used to trigger the show (bubble and
1564
1598
  // inline)
@@ -1579,7 +1613,7 @@ $.extend(DateTime.prototype, {
1579
1613
  *
1580
1614
  * @private
1581
1615
  */
1582
- _writeOutput: function (focus) {
1616
+ _writeOutput: function (focus, change) {
1583
1617
  var date = this.s.d;
1584
1618
  var out = '';
1585
1619
  var input = this.dom.input;
@@ -1590,10 +1624,12 @@ $.extend(DateTime.prototype, {
1590
1624
 
1591
1625
  input.val(out);
1592
1626
 
1593
- // Create a DOM synthetic event. Can't use $().trigger() as
1594
- // that doesn't actually trigger non-jQuery event listeners
1595
- var event = new Event('change', { bubbles: true });
1596
- input[0].dispatchEvent(event);
1627
+ if (change === undefined || change) {
1628
+ // Create a DOM synthetic event. Can't use $().trigger() as
1629
+ // that doesn't actually trigger non-jQuery event listeners
1630
+ var event = new Event('change', { bubbles: true });
1631
+ input[0].dispatchEvent(event);
1632
+ }
1597
1633
 
1598
1634
  if (input.attr('type') === 'hidden') {
1599
1635
  this.val(out, false);
@@ -1690,7 +1726,7 @@ DateTime.defaults = {
1690
1726
  yearRange: 25
1691
1727
  };
1692
1728
 
1693
- DateTime.version = '1.5.4';
1729
+ DateTime.version = '1.5.5';
1694
1730
 
1695
1731
  /**
1696
1732
  * CommonJS factory function pass through. Matches DataTables.
@@ -1,6 +1,6 @@
1
- /*! DateTime picker for DataTables.net v1.5.4
1
+ /*! DateTime picker for DataTables.net v1.5.5
2
2
  *
3
3
  * © SpryMedia Ltd, all rights reserved.
4
4
  * License: MIT datatables.net/license/mit
5
5
  */
6
- !function(s){var i;"function"==typeof define&&define.amd?define(["jquery"],function(t){return s(t,window,document)}):"object"==typeof exports?(i=require("jquery"),"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||i(t),s(e,t,t.document)}:module.exports=s(i,window,window.document)):s(jQuery,window,document)}(function(g,o,i){"use strict";function n(t,e){if(n.factory(t,e))return n;if(void 0===a&&(a=o.moment||o.dayjs||o.luxon||null),this.c=g.extend(!0,{},n.defaults,e),e=this.c.classPrefix,!a&&"YYYY-MM-DD"!==this.c.format)throw"DateTime: Without momentjs, dayjs or luxon only the format 'YYYY-MM-DD' can be used";"string"==typeof this.c.minDate&&(this.c.minDate=new Date(this.c.minDate)),"string"==typeof this.c.maxDate&&(this.c.maxDate=new Date(this.c.maxDate));var s=g('<div class="'+e+'"><div class="'+e+'-date"><div class="'+e+'-title"><div class="'+e+'-iconLeft"><button type="button"></button></div><div class="'+e+'-iconRight"><button type="button"></button></div><div class="'+e+'-label"><span></span><select class="'+e+'-month"></select></div><div class="'+e+'-label"><span></span><select class="'+e+'-year"></select></div></div><div class="'+e+'-buttons"><a class="'+e+'-clear"></a><a class="'+e+'-today"></a></div><div class="'+e+'-calendar"></div></div><div class="'+e+'-time"><div class="'+e+'-hours"></div><div class="'+e+'-minutes"></div><div class="'+e+'-seconds"></div></div><div class="'+e+'-error"></div></div>');this.dom={container:s,date:s.find("."+e+"-date"),title:s.find("."+e+"-title"),calendar:s.find("."+e+"-calendar"),time:s.find("."+e+"-time"),error:s.find("."+e+"-error"),buttons:s.find("."+e+"-buttons"),clear:s.find("."+e+"-clear"),today:s.find("."+e+"-today"),previous:s.find("."+e+"-iconLeft"),next:s.find("."+e+"-iconRight"),input:g(t)},this.s={d:null,display:null,minutesRange:null,secondsRange:null,namespace:"dateime-"+n._instance++,parts:{date:null!==this.c.format.match(/[YMD]|L(?!T)|l/),time:null!==this.c.format.match(/[Hhm]|LT|LTS/),seconds:-1!==this.c.format.indexOf("s"),hours12:null!==this.c.format.match(/[haA]/)}},this.dom.container.append(this.dom.date).append(this.dom.time).append(this.dom.error),this.dom.date.append(this.dom.title).append(this.dom.buttons).append(this.dom.calendar),this.dom.input.addClass("dt-datetime"),this._constructor()}var a;return g.extend(n.prototype,{destroy:function(){this._hide(!0),this.dom.container.off().empty(),this.dom.input.removeClass("dt-datetime").removeAttr("autocomplete").off(".datetime")},display:function(t,e){return void 0!==t&&this.s.display.setUTCFullYear(t),void 0!==e&&this.s.display.setUTCMonth(e-1),void 0!==t||void 0!==e?(this._setTitle(),this._setCalander(),this):{month:this.s.display.getUTCMonth()+1,year:this.s.display.getUTCFullYear()}},errorMsg:function(t){var e=this.dom.error;return t?e.html(t):e.empty(),this},hide:function(){return this._hide(),this},max:function(t){return this.c.maxDate="string"==typeof t?new Date(t):t,this._optionsTitle(),this._setCalander(),this},min:function(t){return this.c.minDate="string"==typeof t?new Date(t):t,this._optionsTitle(),this._setCalander(),this},owns:function(t){return 0<g(t).parents().filter(this.dom.container).length},val:function(t,e){return void 0===t?this.s.d:(t instanceof Date?this.s.d=this._dateToUtc(t):null===t||""===t?this.s.d=null:"--now"===t?this.s.d=this._dateToUtc(new Date):"string"==typeof t&&(this.s.d=this._dateToUtc(this._convert(t,this.c.format,null))),!e&&void 0!==e||(this.s.d?this._writeOutput():this.dom.input.val(t)),this.s.display=this.s.d?new Date(this.s.d.toString()):new Date,this.s.display.setUTCDate(1),this._setTitle(),this._setCalander(),this._setTime(),this)},valFormat:function(t,e){return e?(this.val(this._convert(e,t,null)),this):this._convert(this.val(),null,t)},_constructor:function(){function a(){var t=o.dom.input.val();t!==e&&(o.c.onChange.call(o,t,o.s.d,o.dom.input),e=t)}var o=this,r=this.c.classPrefix,e=this.dom.input.val();this.s.parts.date||this.dom.date.css("display","none"),this.s.parts.time||this.dom.time.css("display","none"),this.s.parts.seconds||(this.dom.time.children("div."+r+"-seconds").remove(),this.dom.time.children("span").eq(1).remove()),this.c.buttons.clear||this.dom.clear.css("display","none"),this.c.buttons.today||this.dom.today.css("display","none"),this._optionsTitle(),g(i).on("i18n.dt",function(t,e){e.oLanguage.datetime&&(g.extend(!0,o.c.i18n,e.oLanguage.datetime),o._optionsTitle())}),"hidden"===this.dom.input.attr("type")&&(this.dom.container.addClass("inline"),this.c.attachTo="input",this.val(this.dom.input.val(),!1),this._show()),e&&this.val(e,!1),this.dom.input.attr("autocomplete","off").on("focus.datetime click.datetime",function(){o.dom.container.is(":visible")||o.dom.input.is(":disabled")||(o.val(o.dom.input.val(),!1),o._show())}).on("keyup.datetime",function(){o.dom.container.is(":visible")&&o.val(o.dom.input.val(),!1)}),this.dom.container[0].addEventListener("focusin",function(t){t.stopPropagation()}),this.dom.container.on("change","select",function(){var t,e,s=g(this),i=s.val();s.hasClass(r+"-month")?(o._correctMonth(o.s.display,i),o._setTitle(),o._setCalander()):s.hasClass(r+"-year")?(o.s.display.setUTCFullYear(i),o._setTitle(),o._setCalander()):s.hasClass(r+"-hours")||s.hasClass(r+"-ampm")?(o.s.parts.hours12?(t=+g(o.dom.container).find("."+r+"-hours").val(),e="pm"===g(o.dom.container).find("."+r+"-ampm").val(),o.s.d.setUTCHours(12!=t||e?e&&12!=t?12+t:t:0)):o.s.d.setUTCHours(i),o._setTime(),o._writeOutput(!0),a()):s.hasClass(r+"-minutes")?(o.s.d.setUTCMinutes(i),o._setTime(),o._writeOutput(!0),a()):s.hasClass(r+"-seconds")&&(o.s.d.setSeconds(i),o._setTime(),o._writeOutput(!0),a()),o.dom.input.focus(),o._position()}).on("click",function(t){var e=o.s.d,s="span"===t.target.nodeName.toLowerCase()?t.target.parentNode:t.target,i=s.nodeName.toLowerCase();if("select"!==i)if(t.stopPropagation(),"a"===i&&(t.preventDefault(),g(s).hasClass(r+"-clear")?(o.s.d=null,o.dom.input.val(""),o._writeOutput(),o._setCalander(),o._setTime(),a()):g(s).hasClass(r+"-today")&&(o.s.display=new Date,o._setTitle(),o._setCalander())),"button"===i){t=g(s),i=t.parent();if(i.hasClass("disabled")&&!i.hasClass("range"))t.blur();else if(i.hasClass(r+"-iconLeft"))o.s.display.setUTCMonth(o.s.display.getUTCMonth()-1),o._setTitle(),o._setCalander(),o.dom.input.focus();else if(i.hasClass(r+"-iconRight"))o._correctMonth(o.s.display,o.s.display.getUTCMonth()+1),o._setTitle(),o._setCalander(),o.dom.input.focus();else{if(t.parents("."+r+"-time").length){var s=t.data("value"),n=t.data("unit"),e=o._needValue();if("minutes"===n){if(i.hasClass("disabled")&&i.hasClass("range"))return o.s.minutesRange=s,void o._setTime();o.s.minutesRange=null}if("seconds"===n){if(i.hasClass("disabled")&&i.hasClass("range"))return o.s.secondsRange=s,void o._setTime();o.s.secondsRange=null}if("am"===s){if(!(12<=e.getUTCHours()))return;s=e.getUTCHours()-12}else if("pm"===s){if(!(e.getUTCHours()<12))return;s=e.getUTCHours()+12}e["hours"===n?"setUTCHours":"minutes"===n?"setUTCMinutes":"setSeconds"](s),o._setCalander(),o._setTime(),o._writeOutput(!0)}else(e=o._needValue()).setUTCDate(1),e.setUTCFullYear(t.data("year")),e.setUTCMonth(t.data("month")),e.setUTCDate(t.data("day")),o._writeOutput(!0),o.s.parts.time?(o._setCalander(),o._setTime()):setTimeout(function(){o._hide()},10);a()}}else o.dom.input.focus()})},_compareDates:function(t,e){return this._isLuxon()?a.DateTime.fromJSDate(t).toUTC().toISODate()===a.DateTime.fromJSDate(e).toUTC().toISODate():this._dateToUtcString(t)===this._dateToUtcString(e)},_convert:function(t,e,s){var i;return t&&(a?this._isLuxon()?(i=t instanceof Date?a.DateTime.fromJSDate(t).toUTC():a.DateTime.fromFormat(t,e)).isValid?s?i.toFormat(s):i.toJSDate():null:(i=t instanceof Date?a.utc(t,void 0,this.c.locale,this.c.strict):a(t,e,this.c.locale,this.c.strict)).isValid()?s?i.format(s):i.toDate():null:!e&&!s||e&&s?t:e?(i=t.match(/(\d{4})\-(\d{2})\-(\d{2})/))?new Date(i[1],i[2]-1,i[3]):null:t.getUTCFullYear()+"-"+this._pad(t.getUTCMonth()+1)+"-"+this._pad(t.getUTCDate()))},_correctMonth:function(t,e){var s=this._daysInMonth(t.getUTCFullYear(),e),i=t.getUTCDate()>s;t.setUTCMonth(e),i&&(t.setUTCDate(s),t.setUTCMonth(e))},_daysInMonth:function(t,e){return[31,t%4==0&&(t%100!=0||t%400==0)?29:28,31,30,31,30,31,31,30,31,30,31][e]},_dateToUtc:function(t){return t&&new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds()))},_dateToUtcString:function(t){return this._isLuxon()?a.DateTime.fromJSDate(t).toUTC().toISODate():t.getUTCFullYear()+"-"+this._pad(t.getUTCMonth()+1)+"-"+this._pad(t.getUTCDate())},_hide:function(t){!t&&"hidden"===this.dom.input.attr("type")||(t=this.s.namespace,this.dom.container.detach(),g(o).off("."+t),g(i).off("keydown."+t),g("div.dataTables_scrollBody").off("scroll."+t),g("div.DTE_Body_Content").off("scroll."+t),g(i).off("click."+t),g(this.dom.input[0].offsetParent).off("."+t))},_hours24To12:function(t){return 0===t?12:12<t?t-12:t},_htmlDay:function(t){var e,s;return t.empty?'<td class="empty"></td>':(e=["selectable"],s=this.c.classPrefix,t.disabled&&e.push("disabled"),t.today&&e.push("now"),t.selected&&e.push("selected"),'<td data-day="'+t.day+'" class="'+e.join(" ")+'"><button class="'+s+"-button "+s+'-day" type="button" data-year="'+t.year+'" data-month="'+t.month+'" data-day="'+t.day+'"><span>'+t.day+"</span></button></td>")},_htmlMonth:function(t,e){for(var s=this._dateToUtc(new Date),i=this._daysInMonth(t,e),n=new Date(Date.UTC(t,e,1)).getUTCDay(),a=[],o=[],r=(0<this.c.firstDay&&(n-=this.c.firstDay)<0&&(n+=7),i+n),d=r;7<d;)d-=7;r+=7-d;var l=this.c.minDate,h=this.c.maxDate;l&&(l.setUTCHours(0),l.setUTCMinutes(0),l.setSeconds(0)),h&&(h.setUTCHours(23),h.setUTCMinutes(59),h.setSeconds(59));for(var u=0,c=0;u<r;u++){var m=new Date(Date.UTC(t,e,u-n+1)),f=!!this.s.d&&this._compareDates(m,this.s.d),p=this._compareDates(m,s),y=u<n||i+n<=u,T=l&&m<l||h&&h<m,v=this.c.disableDays,f={day:u-n+1,month:e,year:t,selected:f,today:p,disabled:T=Array.isArray(v)&&-1!==g.inArray(m.getUTCDay(),v)||"function"==typeof v&&!0===v(m)?!0:T,empty:y};o.push(this._htmlDay(f)),7==++c&&(this.c.showWeekNumber&&o.unshift(this._htmlWeekOfYear(u-n,e,t)),a.push("<tr>"+o.join("")+"</tr>"),o=[],c=0)}var _,D=this.c.classPrefix,C=D+"-table";return this.c.showWeekNumber&&(C+=" weekNumber"),l&&(_=l>=new Date(Date.UTC(t,e,1,0,0,0)),this.dom.title.find("div."+D+"-iconLeft").css("display",_?"none":"block")),h&&(_=h<new Date(Date.UTC(t,e+1,1,0,0,0)),this.dom.title.find("div."+D+"-iconRight").css("display",_?"none":"block")),'<table class="'+C+'"><thead>'+this._htmlMonthHead()+"</thead><tbody>"+a.join("")+"</tbody></table>"},_htmlMonthHead:function(){var t=[],e=this.c.firstDay,s=this.c.i18n;this.c.showWeekNumber&&t.push("<th></th>");for(var i=0;i<7;i++)t.push("<th>"+function(t){for(t+=e;7<=t;)t-=7;return s.weekdays[t]}(i)+"</th>");return t.join("")},_htmlWeekOfYear:function(t,e,s){e=new Date(s,e,t,0,0,0,0),e.setDate(e.getDate()+4-(e.getDay()||7)),t=new Date(s,0,1),s=Math.ceil(((e-t)/864e5+1)/7);return'<td class="'+this.c.classPrefix+'-week">'+s+"</td>"},_isLuxon:function(){return!!(a&&a.DateTime&&a.Duration&&a.Settings)},_needValue:function(){return this.s.d||(this.s.d=this._dateToUtc(new Date),this.s.parts.time)||(this.s.d.setUTCHours(0),this.s.d.setUTCMinutes(0),this.s.d.setSeconds(0),this.s.d.setMilliseconds(0)),this.s.d},_options:function(t,e,s){s=s||e;var i=this.dom.container.find("select."+this.c.classPrefix+"-"+t);i.empty();for(var n=0,a=e.length;n<a;n++)i.append('<option value="'+e[n]+'">'+s[n]+"</option>")},_optionSet:function(t,e){var t=this.dom.container.find("select."+this.c.classPrefix+"-"+t),s=t.parent().children("span"),e=(t.val(e),t.find("option:selected"));s.html(0!==e.length?e.text():this.c.i18n.unknown)},_optionsTime:function(n,a,o,r,t){var e,d=this.c.classPrefix,s=this.dom.container.find("div."+d+"-"+n),i=12===a?function(t){return t}:this._pad,l=d+"-table",h=this.c.i18n;if(s.length){var u="",c=10,m=function(t,e,s){12===a&&"number"==typeof t&&(12<=o&&(t+=12),12==t?t=0:24==t&&(t=12));var i=o===t||"am"===t&&o<12||"pm"===t&&12<=o?"selected":"";return"number"==typeof t&&r&&-1===g.inArray(t,r)&&(i+=" disabled"),s&&(i+=" "+s),'<td class="selectable '+i+'"><button class="'+d+"-button "+d+'-day" type="button" data-unit="'+n+'" data-value="'+t+'"><span>'+e+"</span></button></td>"};if(12===a){for(u+="<tr>",e=1;e<=6;e++)u+=m(e,i(e));for(u=(u+=m("am",h.amPm[0]))+"</tr>"+"<tr>",e=7;e<=12;e++)u+=m(e,i(e));u=u+m("pm",h.amPm[1])+"</tr>",c=7}else{if(24===a)for(var f=0,p=0;p<4;p++){for(u+="<tr>",e=0;e<6;e++)u+=m(f,i(f)),f++;u+="</tr>"}else{for(u+="<tr>",p=0;p<60;p+=10)u+=m(p,i(p),"range");var u=u+"</tr>"+('</tbody></thead><table class="'+l+" "+l+'-nospace"><tbody>'),y=null!==t?t:-1===o?0:10*Math.floor(o/10);for(u+="<tr>",p=y+1;p<y+10;p++)u+=m(p,i(p));u+="</tr>"}c=6}s.empty().append('<table class="'+l+'"><thead><tr><th colspan="'+c+'">'+h[n]+"</th></tr></thead><tbody>"+u+"</tbody></table>")}},_optionsTitle:function(){var t=this.c.i18n,e=this.c.minDate,s=this.c.maxDate,e=e?e.getFullYear():null,s=s?s.getFullYear():null,e=null!==e?e:(new Date).getFullYear()-this.c.yearRange,s=null!==s?s:(new Date).getFullYear()+this.c.yearRange;this._options("month",this._range(0,11),t.months),this._options("year",this._range(e,s)),this.dom.today.text(t.today).text(t.today),this.dom.clear.text(t.clear).text(t.clear),this.dom.previous.attr("title",t.previous).children("button").text(t.previous),this.dom.next.attr("title",t.next).children("button").text(t.next)},_pad:function(t){return t<10?"0"+t:t},_position:function(){var t,e,s,i="input"===this.c.attachTo?this.dom.input.position():this.dom.input.offset(),n=this.dom.container,a=this.dom.input.outerHeight();n.hasClass("inline")?n.insertAfter(this.dom.input):(this.s.parts.date&&this.s.parts.time&&550<g(o).width()?n.addClass("horizontal"):n.removeClass("horizontal"),"input"===this.c.attachTo?n.css({top:i.top+a,left:i.left}).insertAfter(this.dom.input):n.css({top:i.top+a,left:i.left}).appendTo("body"),t=n.outerHeight(),e=n.outerWidth(),s=g(o).scrollTop(),i.top+a+t-s>g(o).height()&&(a=i.top-t,n.css("top",a<0?0:a)),e+i.left>g(o).width()&&(s=g(o).width()-e-5,"input"===this.c.attachTo&&(s-=g(n).offsetParent().offset().left),n.css("left",s<0?0:s)))},_range:function(t,e,s){var i=[];s=s||1;for(var n=t;n<=e;n+=s)i.push(n);return i},_setCalander:function(){this.s.display&&this.dom.calendar.empty().append(this._htmlMonth(this.s.display.getUTCFullYear(),this.s.display.getUTCMonth()))},_setTitle:function(){this._optionSet("month",this.s.display.getUTCMonth()),this._optionSet("year",this.s.display.getUTCFullYear())},_setTime:function(){function t(t){return e.c[t+"Available"]||e._range(0,59,e.c[t+"Increment"])}var e=this,s=this.s.d,i=null,n=null!=(i=this._isLuxon()?a.DateTime.fromJSDate(s).toUTC():i)?i.hour:s?s.getUTCHours():-1;this._optionsTime("hours",this.s.parts.hours12?12:24,n,this.c.hoursAvailable),this._optionsTime("minutes",60,null!=i?i.minute:s?s.getUTCMinutes():-1,t("minutes"),this.s.minutesRange),this._optionsTime("seconds",60,null!=i?i.second:s?s.getSeconds():-1,t("seconds"),this.s.secondsRange)},_show:function(){var e=this,t=this.s.namespace,s=(this._position(),g(o).on("scroll."+t+" resize."+t,function(){e._position()}),g("div.DTE_Body_Content").on("scroll."+t,function(){e._position()}),g("div.dataTables_scrollBody").on("scroll."+t,function(){e._position()}),this.dom.input[0].offsetParent);s!==i.body&&g(s).on("scroll."+t,function(){e._position()}),g(i).on("keydown."+t,function(t){9!==t.keyCode&&27!==t.keyCode&&13!==t.keyCode||e._hide()}),setTimeout(function(){g(i).on("click."+t,function(t){g(t.target).parents().filter(e.dom.container).length||t.target===e.dom.input[0]||e._hide()})},10)},_writeOutput:function(t){var e=this.s.d,s="",i=this.dom.input,e=(e&&(s=this._convert(e,null,this.c.format)),i.val(s),new Event("change",{bubbles:!0}));i[0].dispatchEvent(e),"hidden"===i.attr("type")&&this.val(s,!1),t&&i.focus()}}),n.use=function(t){a=t},n._instance=0,n.type="DateTime",n.defaults={attachTo:"body",buttons:{clear:!1,today:!1},classPrefix:"dt-datetime",disableDays:null,firstDay:1,format:"YYYY-MM-DD",hoursAvailable:null,i18n:{clear:"Clear",previous:"Previous",next:"Next",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],amPm:["am","pm"],hours:"Hour",minutes:"Minute",seconds:"Second",unknown:"-",today:"Today"},maxDate:null,minDate:null,minutesAvailable:null,minutesIncrement:1,strict:!0,locale:"en",onChange:function(){},secondsAvailable:null,secondsIncrement:1,showWeekNumber:!1,yearRange:25},n.version="1.5.4",n.factory=function(t,e){var s=!1;return t&&t.document&&(i=(o=t).document),e&&e.fn&&e.fn.jquery&&(g=e,s=!0),s},o.DateTime||(o.DateTime=n),o.DataTable&&(o.DataTable.DateTime=n),g.fn.dtDateTime=function(t){return this.each(function(){new n(this,t)})},g.fn.dataTable&&(g.fn.dataTable.DateTime=n,g.fn.DataTable.DateTime=n,g.fn.dataTable.Editor)&&(g.fn.dataTable.Editor.DateTime=n),n});
6
+ !function(s){var i;"function"==typeof define&&define.amd?define(["jquery"],function(t){return s(t,window,document)}):"object"==typeof exports?(i=require("jquery"),"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||i(t),s(e,t,t.document)}:module.exports=s(i,window,window.document)):s(jQuery,window,document)}(function(g,o,i){"use strict";function n(t,e){if(n.factory(t,e))return n;if(void 0===a&&(a=o.moment||o.dayjs||o.luxon||null),this.c=g.extend(!0,{},n.defaults,e),e=this.c.classPrefix,!a&&"YYYY-MM-DD"!==this.c.format)throw"DateTime: Without momentjs, dayjs or luxon only the format 'YYYY-MM-DD' can be used";"string"==typeof this.c.minDate&&(this.c.minDate=new Date(this.c.minDate)),"string"==typeof this.c.maxDate&&(this.c.maxDate=new Date(this.c.maxDate));var s=g('<div class="'+e+'"><div class="'+e+'-date"><div class="'+e+'-title"><div class="'+e+'-iconLeft"><button type="button"></button></div><div class="'+e+'-iconRight"><button type="button"></button></div><div class="'+e+'-label"><span></span><select class="'+e+'-month"></select></div><div class="'+e+'-label"><span></span><select class="'+e+'-year"></select></div></div><div class="'+e+'-buttons"><a class="'+e+'-clear"></a><a class="'+e+'-today"></a></div><div class="'+e+'-calendar"></div></div><div class="'+e+'-time"><div class="'+e+'-hours"></div><div class="'+e+'-minutes"></div><div class="'+e+'-seconds"></div></div><div class="'+e+'-error"></div></div>');this.dom={container:s,date:s.find("."+e+"-date"),title:s.find("."+e+"-title"),calendar:s.find("."+e+"-calendar"),time:s.find("."+e+"-time"),error:s.find("."+e+"-error"),buttons:s.find("."+e+"-buttons"),clear:s.find("."+e+"-clear"),today:s.find("."+e+"-today"),previous:s.find("."+e+"-iconLeft"),next:s.find("."+e+"-iconRight"),input:g(t)},this.s={d:null,display:null,minutesRange:null,secondsRange:null,namespace:"dateime-"+n._instance++,parts:{date:null!==this.c.format.match(/[YMD]|L(?!T)|l/),time:null!==this.c.format.match(/[Hhm]|LT|LTS/),seconds:-1!==this.c.format.indexOf("s"),hours12:null!==this.c.format.match(/[haA]/)},showTo:null},this.dom.container.append(this.dom.date).append(this.dom.time).append(this.dom.error),this.dom.date.append(this.dom.title).append(this.dom.buttons).append(this.dom.calendar),this.dom.input.addClass("dt-datetime"),this._constructor()}var a;return g.extend(n.prototype,{destroy:function(){clearTimeout(this.s.showTo),this._hide(!0),this.dom.container.off().empty(),this.dom.input.removeClass("dt-datetime").removeAttr("autocomplete").off(".datetime")},display:function(t,e){return void 0!==t&&this.s.display.setUTCFullYear(t),void 0!==e&&this.s.display.setUTCMonth(e-1),void 0!==t||void 0!==e?(this._setTitle(),this._setCalander(),this):{month:this.s.display.getUTCMonth()+1,year:this.s.display.getUTCFullYear()}},errorMsg:function(t){var e=this.dom.error;return t?e.html(t):e.empty(),this},hide:function(){return this._hide(),this},max:function(t){return this.c.maxDate="string"==typeof t?new Date(t):t,this._optionsTitle(),this._setCalander(),this},min:function(t){return this.c.minDate="string"==typeof t?new Date(t):t,this._optionsTitle(),this._setCalander(),this},owns:function(t){return 0<g(t).parents().filter(this.dom.container).length},val:function(t,e){var s;return void 0===t?this.s.d:(s=this.s.d,t instanceof Date?this.s.d=this._dateToUtc(t):null===t||""===t?this.s.d=null:"--now"===t?this.s.d=this._dateToUtc(new Date):"string"==typeof t&&(this.s.d=this._dateToUtc(this._convert(t,this.c.format,null))),!e&&void 0!==e||(this.s.d?this._writeOutput(!1,null===s&&null!==this.s.d||null!==s&&null===this.s.d||s.toString()!==this.s.d.toString()):this.dom.input.val(t)),this.s.display=this.s.d?new Date(this.s.d.toString()):new Date,this.s.display.setUTCDate(1),this._setTitle(),this._setCalander(),this._setTime(),this)},valFormat:function(t,e){return e?(this.val(this._convert(e,t,null)),this):this._convert(this.val(),null,t)},_constructor:function(){function a(){var t=o.dom.input.val();t!==e&&(o.c.onChange.call(o,t,o.s.d,o.dom.input),e=t)}var o=this,r=this.c.classPrefix,e=this.dom.input.val();this.s.parts.date||this.dom.date.css("display","none"),this.s.parts.time||this.dom.time.css("display","none"),this.s.parts.seconds||(this.dom.time.children("div."+r+"-seconds").remove(),this.dom.time.children("span").eq(1).remove()),this.c.buttons.clear||this.dom.clear.css("display","none"),this.c.buttons.today||this.dom.today.css("display","none"),this._optionsTitle(),g(i).on("i18n.dt",function(t,e){e.oLanguage.datetime&&(g.extend(!0,o.c.i18n,e.oLanguage.datetime),o._optionsTitle())}),"hidden"===this.dom.input.attr("type")&&(this.dom.container.addClass("inline"),this.c.attachTo="input",this.val(this.dom.input.val(),!1),this._show()),e&&this.val(e,!1),this.dom.input.attr("autocomplete","off").on("focus.datetime click.datetime",function(){o.dom.container.is(":visible")||o.dom.input.is(":disabled")||(o.val(o.dom.input.val(),!1),o._show())}).on("keyup.datetime",function(){o.dom.container.is(":visible")&&o.val(o.dom.input.val(),!1)}),this.dom.container[0].addEventListener("focusin",function(t){t.stopPropagation()}),this.dom.container.on("change","select",function(){var t,e,s=g(this),i=s.val();s.hasClass(r+"-month")?(o._correctMonth(o.s.display,i),o._setTitle(),o._setCalander()):s.hasClass(r+"-year")?(o.s.display.setUTCFullYear(i),o._setTitle(),o._setCalander()):s.hasClass(r+"-hours")||s.hasClass(r+"-ampm")?(o.s.parts.hours12?(t=+g(o.dom.container).find("."+r+"-hours").val(),e="pm"===g(o.dom.container).find("."+r+"-ampm").val(),o.s.d.setUTCHours(12!=t||e?e&&12!=t?12+t:t:0)):o.s.d.setUTCHours(i),o._setTime(),o._writeOutput(!0),a()):s.hasClass(r+"-minutes")?(o.s.d.setUTCMinutes(i),o._setTime(),o._writeOutput(!0),a()):s.hasClass(r+"-seconds")&&(o.s.d.setSeconds(i),o._setTime(),o._writeOutput(!0),a()),o.dom.input.focus(),o._position()}).on("click",function(t){var e=o.s.d,s="span"===t.target.nodeName.toLowerCase()?t.target.parentNode:t.target,i=s.nodeName.toLowerCase();if("select"!==i)if(t.stopPropagation(),"a"===i&&(t.preventDefault(),g(s).hasClass(r+"-clear")?(o.s.d=null,o.dom.input.val(""),o._writeOutput(),o._setCalander(),o._setTime(),a()):g(s).hasClass(r+"-today")&&(o.s.display=new Date,o._setTitle(),o._setCalander())),"button"===i){t=g(s),i=t.parent();if(i.hasClass("disabled")&&!i.hasClass("range"))t.blur();else if(i.hasClass(r+"-iconLeft"))o.s.display.setUTCMonth(o.s.display.getUTCMonth()-1),o._setTitle(),o._setCalander(),o.dom.input.focus();else if(i.hasClass(r+"-iconRight"))o._correctMonth(o.s.display,o.s.display.getUTCMonth()+1),o._setTitle(),o._setCalander(),o.dom.input.focus();else{if(t.parents("."+r+"-time").length){var s=t.data("value"),n=t.data("unit"),e=o._needValue();if("minutes"===n){if(i.hasClass("disabled")&&i.hasClass("range"))return o.s.minutesRange=s,void o._setTime();o.s.minutesRange=null}if("seconds"===n){if(i.hasClass("disabled")&&i.hasClass("range"))return o.s.secondsRange=s,void o._setTime();o.s.secondsRange=null}if("am"===s){if(!(12<=e.getUTCHours()))return;s=e.getUTCHours()-12}else if("pm"===s){if(!(e.getUTCHours()<12))return;s=e.getUTCHours()+12}e["hours"===n?"setUTCHours":"minutes"===n?"setUTCMinutes":"setSeconds"](s),o._setCalander(),o._setTime(),o._writeOutput(!0)}else(e=o._needValue()).setUTCDate(1),e.setUTCFullYear(t.data("year")),e.setUTCMonth(t.data("month")),e.setUTCDate(t.data("day")),o._writeOutput(!0),o.s.parts.time?(o._setCalander(),o._setTime()):setTimeout(function(){o._hide()},10);a()}}else o.dom.input.focus()})},_compareDates:function(t,e){return this._isLuxon()?a.DateTime.fromJSDate(t).toUTC().toISODate()===a.DateTime.fromJSDate(e).toUTC().toISODate():this._dateToUtcString(t)===this._dateToUtcString(e)},_convert:function(t,e,s){var i;return t&&(a?this._isLuxon()?(i=t instanceof Date?a.DateTime.fromJSDate(t).toUTC():a.DateTime.fromFormat(t,e)).isValid?s?i.toFormat(s):i.toJSDate():null:(i=t instanceof Date?a.utc(t,void 0,this.c.locale,this.c.strict):a(t,e,this.c.locale,this.c.strict)).isValid()?s?i.format(s):i.toDate():null:!e&&!s||e&&s?t:e?(i=t.match(/(\d{4})\-(\d{2})\-(\d{2})/))?new Date(i[1],i[2]-1,i[3]):null:t.getUTCFullYear()+"-"+this._pad(t.getUTCMonth()+1)+"-"+this._pad(t.getUTCDate()))},_correctMonth:function(t,e){var s=this._daysInMonth(t.getUTCFullYear(),e),i=t.getUTCDate()>s;t.setUTCMonth(e),i&&(t.setUTCDate(s),t.setUTCMonth(e))},_daysInMonth:function(t,e){return[31,t%4==0&&(t%100!=0||t%400==0)?29:28,31,30,31,30,31,31,30,31,30,31][e]},_dateToUtc:function(t){return t&&new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds()))},_dateToUtcString:function(t){return this._isLuxon()?a.DateTime.fromJSDate(t).toUTC().toISODate():t.getUTCFullYear()+"-"+this._pad(t.getUTCMonth()+1)+"-"+this._pad(t.getUTCDate())},_hide:function(t){!t&&"hidden"===this.dom.input.attr("type")||(t=this.s.namespace,this.dom.container.detach(),g(o).off("."+t),g(i).off("keydown."+t),g("div.dataTables_scrollBody").off("scroll."+t),g("div.DTE_Body_Content").off("scroll."+t),g(i).off("click."+t),g(this.dom.input[0].offsetParent).off("."+t))},_hours24To12:function(t){return 0===t?12:12<t?t-12:t},_htmlDay:function(t){var e,s;return t.empty?'<td class="empty"></td>':(e=["selectable"],s=this.c.classPrefix,t.disabled&&e.push("disabled"),t.today&&e.push("now"),t.selected&&e.push("selected"),'<td data-day="'+t.day+'" class="'+e.join(" ")+'"><button class="'+s+"-button "+s+'-day" type="button" data-year="'+t.year+'" data-month="'+t.month+'" data-day="'+t.day+'"><span>'+t.day+"</span></button></td>")},_htmlMonth:function(t,e){for(var s=this._dateToUtc(new Date),i=this._daysInMonth(t,e),n=new Date(Date.UTC(t,e,1)).getUTCDay(),a=[],o=[],r=(0<this.c.firstDay&&(n-=this.c.firstDay)<0&&(n+=7),i+n),d=r;7<d;)d-=7;r+=7-d;var l=this.c.minDate,h=this.c.maxDate;l&&(l.setUTCHours(0),l.setUTCMinutes(0),l.setSeconds(0)),h&&(h.setUTCHours(23),h.setUTCMinutes(59),h.setSeconds(59));for(var u=0,c=0;u<r;u++){var m=new Date(Date.UTC(t,e,u-n+1)),f=!!this.s.d&&this._compareDates(m,this.s.d),p=this._compareDates(m,s),T=u<n||i+n<=u,y=l&&m<l||h&&h<m,v=this.c.disableDays,f={day:u-n+1,month:e,year:t,selected:f,today:p,disabled:y=Array.isArray(v)&&-1!==g.inArray(m.getUTCDay(),v)||"function"==typeof v&&!0===v(m)?!0:y,empty:T};o.push(this._htmlDay(f)),7==++c&&(this.c.showWeekNumber&&o.unshift(this._htmlWeekOfYear(u-n,e,t)),a.push("<tr>"+o.join("")+"</tr>"),o=[],c=0)}var _,D=this.c.classPrefix,C=D+"-table";return this.c.showWeekNumber&&(C+=" weekNumber"),l&&(_=l>=new Date(Date.UTC(t,e,1,0,0,0)),this.dom.title.find("div."+D+"-iconLeft").css("display",_?"none":"block")),h&&(_=h<new Date(Date.UTC(t,e+1,1,0,0,0)),this.dom.title.find("div."+D+"-iconRight").css("display",_?"none":"block")),'<table class="'+C+'"><thead>'+this._htmlMonthHead()+"</thead><tbody>"+a.join("")+"</tbody></table>"},_htmlMonthHead:function(){var t=[],e=this.c.firstDay,s=this.c.i18n;this.c.showWeekNumber&&t.push("<th></th>");for(var i=0;i<7;i++)t.push("<th>"+function(t){for(t+=e;7<=t;)t-=7;return s.weekdays[t]}(i)+"</th>");return t.join("")},_htmlWeekOfYear:function(t,e,s){e=new Date(s,e,t,0,0,0,0),e.setDate(e.getDate()+4-(e.getDay()||7)),t=new Date(s,0,1),s=Math.ceil(((e-t)/864e5+1)/7);return'<td class="'+this.c.classPrefix+'-week">'+s+"</td>"},_isLuxon:function(){return!!(a&&a.DateTime&&a.Duration&&a.Settings)},_needValue:function(){return this.s.d||(this.s.d=this._dateToUtc(new Date),this.s.parts.time)||(this.s.d.setUTCHours(0),this.s.d.setUTCMinutes(0),this.s.d.setSeconds(0),this.s.d.setMilliseconds(0)),this.s.d},_options:function(t,e,s){s=s||e;var i=this.dom.container.find("select."+this.c.classPrefix+"-"+t);i.empty();for(var n=0,a=e.length;n<a;n++)i.append('<option value="'+e[n]+'">'+s[n]+"</option>")},_optionSet:function(t,e){var t=this.dom.container.find("select."+this.c.classPrefix+"-"+t),s=t.parent().children("span"),e=(t.val(e),t.find("option:selected"));s.html(0!==e.length?e.text():this.c.i18n.unknown)},_optionsTime:function(n,a,o,r,t){var e,d=this.c.classPrefix,s=this.dom.container.find("div."+d+"-"+n),i=12===a?function(t){return t}:this._pad,l=d+"-table",h=this.c.i18n;if(s.length){var u="",c=10,m=function(t,e,s){12===a&&"number"==typeof t&&(12<=o&&(t+=12),12==t?t=0:24==t&&(t=12));var i=o===t||"am"===t&&o<12||"pm"===t&&12<=o?"selected":"";return"number"==typeof t&&r&&-1===g.inArray(t,r)&&(i+=" disabled"),s&&(i+=" "+s),'<td class="selectable '+i+'"><button class="'+d+"-button "+d+'-day" type="button" data-unit="'+n+'" data-value="'+t+'"><span>'+e+"</span></button></td>"};if(12===a){for(u+="<tr>",e=1;e<=6;e++)u+=m(e,i(e));for(u=(u+=m("am",h.amPm[0]))+"</tr>"+"<tr>",e=7;e<=12;e++)u+=m(e,i(e));u=u+m("pm",h.amPm[1])+"</tr>",c=7}else{if(24===a)for(var f=0,p=0;p<4;p++){for(u+="<tr>",e=0;e<6;e++)u+=m(f,i(f)),f++;u+="</tr>"}else{for(u+="<tr>",p=0;p<60;p+=10)u+=m(p,i(p),"range");var u=u+"</tr>"+('</tbody></thead><table class="'+l+" "+l+'-nospace"><tbody>'),T=null!==t?t:-1===o?0:10*Math.floor(o/10);for(u+="<tr>",p=T+1;p<T+10;p++)u+=m(p,i(p));u+="</tr>"}c=6}s.empty().append('<table class="'+l+'"><thead><tr><th colspan="'+c+'">'+h[n]+"</th></tr></thead><tbody>"+u+"</tbody></table>")}},_optionsTitle:function(){var t=this.c.i18n,e=this.c.minDate,s=this.c.maxDate,e=e?e.getFullYear():null,s=s?s.getFullYear():null,e=null!==e?e:(new Date).getFullYear()-this.c.yearRange,s=null!==s?s:(new Date).getFullYear()+this.c.yearRange;this._options("month",this._range(0,11),t.months),this._options("year",this._range(e,s)),this.dom.today.text(t.today).text(t.today),this.dom.clear.text(t.clear).text(t.clear),this.dom.previous.attr("title",t.previous).children("button").text(t.previous),this.dom.next.attr("title",t.next).children("button").text(t.next)},_pad:function(t){return t<10?"0"+t:t},_position:function(){var t,e,s,i="input"===this.c.attachTo?this.dom.input.position():this.dom.input.offset(),n=this.dom.container,a=this.dom.input.outerHeight();n.hasClass("inline")?n.insertAfter(this.dom.input):(this.s.parts.date&&this.s.parts.time&&550<g(o).width()?n.addClass("horizontal"):n.removeClass("horizontal"),"input"===this.c.attachTo?n.css({top:i.top+a,left:i.left}).insertAfter(this.dom.input):n.css({top:i.top+a,left:i.left}).appendTo("body"),t=n.outerHeight(),e=n.outerWidth(),s=g(o).scrollTop(),i.top+a+t-s>g(o).height()&&(a=i.top-t,n.css("top",a<0?0:a)),e+i.left>g(o).width()&&(s=g(o).width()-e-5,"input"===this.c.attachTo&&(s-=g(n).offsetParent().offset().left),n.css("left",s<0?0:s)))},_range:function(t,e,s){var i=[];s=s||1;for(var n=t;n<=e;n+=s)i.push(n);return i},_setCalander:function(){this.s.display&&this.dom.calendar.empty().append(this._htmlMonth(this.s.display.getUTCFullYear(),this.s.display.getUTCMonth()))},_setTitle:function(){this._optionSet("month",this.s.display.getUTCMonth()),this._optionSet("year",this.s.display.getUTCFullYear())},_setTime:function(){function t(t){return e.c[t+"Available"]||e._range(0,59,e.c[t+"Increment"])}var e=this,s=this.s.d,i=null,n=null!=(i=this._isLuxon()?a.DateTime.fromJSDate(s).toUTC():i)?i.hour:s?s.getUTCHours():-1;this._optionsTime("hours",this.s.parts.hours12?12:24,n,this.c.hoursAvailable),this._optionsTime("minutes",60,null!=i?i.minute:s?s.getUTCMinutes():-1,t("minutes"),this.s.minutesRange),this._optionsTime("seconds",60,null!=i?i.second:s?s.getSeconds():-1,t("seconds"),this.s.secondsRange)},_show:function(){var e=this,t=this.s.namespace,s=(this._position(),g(o).on("scroll."+t+" resize."+t,function(){e._position()}),g("div.DTE_Body_Content").on("scroll."+t,function(){e._position()}),g("div.dataTables_scrollBody").on("scroll."+t,function(){e._position()}),this.dom.input[0].offsetParent);s!==i.body&&g(s).on("scroll."+t,function(){e._position()}),g(i).on("keydown."+t,function(t){9!==t.keyCode&&27!==t.keyCode&&13!==t.keyCode||e._hide()}),clearTimeout(this.s.showTo),this.dom.input.on("blur",function(t){e.s.showTo=setTimeout(function(){var t=i.activeElement.tagName.toLowerCase();i.activeElement===e.dom.input[0]||e.dom.container.find(i.activeElement).length||["input","select","button"].includes(t)&&e.hide()},10)}),setTimeout(function(){g(i).on("click."+t,function(t){g(t.target).parents().filter(e.dom.container).length||t.target===e.dom.input[0]||e._hide()})},10)},_writeOutput:function(t,e){var s=this.s.d,i="",n=this.dom.input;s&&(i=this._convert(s,null,this.c.format)),n.val(i),void 0!==e&&!e||(s=new Event("change",{bubbles:!0}),n[0].dispatchEvent(s)),"hidden"===n.attr("type")&&this.val(i,!1),t&&n.focus()}}),n.use=function(t){a=t},n._instance=0,n.type="DateTime",n.defaults={attachTo:"body",buttons:{clear:!1,today:!1},classPrefix:"dt-datetime",disableDays:null,firstDay:1,format:"YYYY-MM-DD",hoursAvailable:null,i18n:{clear:"Clear",previous:"Previous",next:"Next",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],amPm:["am","pm"],hours:"Hour",minutes:"Minute",seconds:"Second",unknown:"-",today:"Today"},maxDate:null,minDate:null,minutesAvailable:null,minutesIncrement:1,strict:!0,locale:"en",onChange:function(){},secondsAvailable:null,secondsIncrement:1,showWeekNumber:!1,yearRange:25},n.version="1.5.5",n.factory=function(t,e){var s=!1;return t&&t.document&&(i=(o=t).document),e&&e.fn&&e.fn.jquery&&(g=e,s=!0),s},o.DateTime||(o.DateTime=n),o.DataTable&&(o.DataTable.DateTime=n),g.fn.dtDateTime=function(t){return this.each(function(){new n(this,t)})},g.fn.dataTable&&(g.fn.dataTable.DateTime=n,g.fn.DataTable.DateTime=n,g.fn.dataTable.Editor)&&(g.fn.dataTable.Editor.DateTime=n),n});
@@ -1,4 +1,4 @@
1
- /*! Select for DataTables 2.1.0
1
+ /*! Select for DataTables 3.0.0
2
2
  * © SpryMedia Ltd - datatables.net/license/mit
3
3
  */
4
4
 
@@ -56,7 +56,7 @@ DataTable.select.classes = {
56
56
  checkbox: 'dt-select-checkbox'
57
57
  };
58
58
 
59
- DataTable.select.version = '2.1.0';
59
+ DataTable.select.version = '3.0.0';
60
60
 
61
61
  DataTable.select.init = function (dt) {
62
62
  var ctx = dt.settings()[0];
@@ -132,6 +132,7 @@ DataTable.select.init = function (dt) {
132
132
  var className = 'selected';
133
133
  var headerCheckbox = true;
134
134
  var setStyle = false;
135
+ var keys = false;
135
136
 
136
137
  ctx._select = {
137
138
  infoEls: []
@@ -187,6 +188,10 @@ DataTable.select.init = function (dt) {
187
188
  if (opts.selectable !== undefined) {
188
189
  selectable = opts.selectable;
189
190
  }
191
+
192
+ if (opts.keys !== undefined) {
193
+ keys = opts.keys;
194
+ }
190
195
  }
191
196
 
192
197
  dt.select.selector(selector);
@@ -195,6 +200,7 @@ DataTable.select.init = function (dt) {
195
200
  dt.select.blurable(blurable);
196
201
  dt.select.toggleable(toggleable);
197
202
  dt.select.info(info);
203
+ dt.select.keys(keys);
198
204
  dt.select.selectable(selectable);
199
205
  ctx._select.className = className;
200
206
 
@@ -574,14 +580,18 @@ function info(api, node) {
574
580
  return;
575
581
  }
576
582
 
577
- // If _select_set has any length, then ids are available and should be used
578
- // as the counter. Otherwise use the API to workout how many rows are
579
- // selected.
580
- var rowSetLength = api.settings()[0]._select_set.length;
583
+ var ctx = api.settings()[0];
584
+ var rowSetLength = ctx._select_set.length;
581
585
  var rows = rowSetLength ? rowSetLength : api.rows({ selected: true }).count();
582
586
  var columns = api.columns({ selected: true }).count();
583
587
  var cells = api.cells({ selected: true }).count();
584
588
 
589
+ // If subtractive selection, then we need to take the number of rows and
590
+ // subtract those that have been deselected
591
+ if (ctx._select_mode === 'subtractive') {
592
+ rows = api.page.info().recordsDisplay - rowSetLength;
593
+ }
594
+
585
595
  var add = function (el, name, num) {
586
596
  el.append(
587
597
  $('<span class="select-item"/>').append(
@@ -646,7 +656,8 @@ function initCheckboxHeader( dt, headerCheckbox ) {
646
656
  if (this.checked) {
647
657
  if (headerCheckbox == 'select-page') {
648
658
  dt.rows({page: 'current'}).select();
649
- } else {
659
+ }
660
+ else {
650
661
  dt.rows({search: 'applied'}).select();
651
662
  }
652
663
  }
@@ -690,6 +701,140 @@ function initCheckboxHeader( dt, headerCheckbox ) {
690
701
  });
691
702
  }
692
703
 
704
+ function keysSet(dt) {
705
+ var ctx = dt.settings()[0];
706
+ var flag = ctx._select.keys;
707
+ var namespace = 'dts-keys-' + ctx.sTableId;
708
+
709
+ if (flag) {
710
+ // Need a tabindex of the `tr` elements to make them focusable by the browser
711
+ $(dt.rows({page: 'current'}).nodes()).attr('tabindex', 0);
712
+
713
+ dt.on('draw.' + namespace, function () {
714
+ $(dt.rows({page: 'current'}).nodes()).attr('tabindex', 0);
715
+ });
716
+
717
+ // Listen on document for tab, up and down
718
+ $(document).on('keydown.' + namespace, function (e) {
719
+ var key = e.keyCode;
720
+ var active = document.activeElement;
721
+
722
+ // Can't use e.key as it wasn't widely supported until 2017
723
+ // 9 Tab
724
+ // 13 Return
725
+ // 32 Space
726
+ // 38 ArrowUp
727
+ // 40 ArrowDown
728
+ if (! [9, 13, 32, 38, 40].includes(key)) {
729
+ return;
730
+ }
731
+
732
+ var nodes = dt.rows({page: 'current'}).nodes().toArray();
733
+ var idx = nodes.indexOf(active);
734
+ var preventDefault = true;
735
+
736
+ // Only take an action if a row has focus
737
+ if (idx === -1) {
738
+ return;
739
+ }
740
+
741
+ if (key === 9) {
742
+ // Tab focus change
743
+ if (e.shift === false && idx === nodes.length - 1) {
744
+ keysPageDown(dt);
745
+ }
746
+ else if (e.shift === true && idx === 0) {
747
+ keysPageUp(dt);
748
+ }
749
+ else {
750
+ // Browser will do it for us
751
+ preventDefault = false;
752
+ }
753
+ }
754
+ else if (key === 13 || key === 32) {
755
+ // Row selection / deselection
756
+ var row = dt.row(active);
757
+
758
+ if (row.selected()) {
759
+ row.deselect();
760
+ }
761
+ else {
762
+ row.select();
763
+ }
764
+ }
765
+ else if (key === 38) {
766
+ // Move up
767
+ if (idx > 0) {
768
+ nodes[idx-1].focus();
769
+ }
770
+ else {
771
+ keysPageUp(dt);
772
+ }
773
+ }
774
+ else {
775
+ // Move down
776
+ if (idx < nodes.length -1) {
777
+ nodes[idx+1].focus();
778
+ }
779
+ else {
780
+ keysPageDown(dt);
781
+ }
782
+ }
783
+
784
+ if (preventDefault) {
785
+ e.stopPropagation();
786
+ e.preventDefault();
787
+ }
788
+ });
789
+ }
790
+ else {
791
+ // Stop the rows from being able to gain focus
792
+ $(dt.rows().nodes()).removeAttr('tabindex');
793
+
794
+ // Nuke events
795
+ dt.off('draw.' + namespace);
796
+ $(document).off('keydown.' + namespace);
797
+ }
798
+ }
799
+
800
+ /**
801
+ * Change to the next page and focus on the first row
802
+ *
803
+ * @param {DataTable.Api} dt DataTable instance
804
+ */
805
+ function keysPageDown(dt) {
806
+ // Is there another page to turn to?
807
+ var info = dt.page.info();
808
+
809
+ if (info.page < info.pages - 1) {
810
+ dt
811
+ .one('draw', function () {
812
+ dt.row(':first-child').node().focus();
813
+ })
814
+ .page('next')
815
+ .draw(false);
816
+ }
817
+ }
818
+
819
+ /**
820
+ * Change to the previous page and focus on the last row
821
+ *
822
+ * @param {DataTable.Api} dt DataTable instance
823
+ */
824
+ function keysPageUp(dt) {
825
+ // Is there another page to turn to?
826
+ var info = dt.page.info();
827
+
828
+ if (info.page > 0) {
829
+ dt
830
+ .one('draw', function () {
831
+ dt.row(':last-child').node().focus();
832
+ })
833
+ .page('previous')
834
+ .draw(false);
835
+ }
836
+ }
837
+
693
838
  /**
694
839
  * Determine the counts used to define the header checkbox's state
695
840
  *
@@ -752,7 +897,10 @@ function init(ctx) {
752
897
  var api = new DataTable.Api(ctx);
753
898
  ctx._select_init = true;
754
899
 
755
- // _select_set contains a list of the ids of all rows that are selected
900
+ // When `additive` then `_select_set` contains a list of the row ids that
901
+ // are selected. If `subtractive` then all rows are selected, except those
902
+ // in `_select_set`, which is a list of ids.
903
+ ctx._select_mode = 'additive';
756
904
  ctx._select_set = [];
757
905
 
758
906
  // Row callback so that classes can be added to rows and cells if the item
@@ -770,7 +918,8 @@ function init(ctx) {
770
918
  // Row
771
919
  if (
772
920
  d._select_selected ||
773
- (id !== 'undefined' && ctx._select_set.includes(id))
921
+ (ctx._select_mode === 'additive' && ctx._select_set.includes(id)) ||
922
+ (ctx._select_mode === 'subtractive' && ! ctx._select_set.includes(id))
774
923
  ) {
775
924
  d._select_selected = true;
776
925
 
@@ -980,7 +1129,16 @@ function _cumulativeEvents(api) {
980
1129
 
981
1130
  var ctx = api.settings()[0];
982
1131
 
983
- _add(api, ctx._select_set, indexes);
1132
+ if (ctx._select_mode === 'additive') {
1133
+ // Add row to the selection list if it isn't already there
1134
+ _add(api, ctx._select_set, indexes);
1135
+ }
1136
+ else {
1137
+ // Subtractive - if a row is selected it should not in the list
1138
+ // as in subtractive mode the list gives the rows which are not
1139
+ // selected
1140
+ _remove(api, ctx._select_set, indexes);
1141
+ }
984
1142
  });
985
1143
 
986
1144
  api.on('deselect', function (e, dt, type, indexes) {
@@ -991,7 +1149,14 @@ function _cumulativeEvents(api) {
991
1149
 
992
1150
  var ctx = api.settings()[0];
993
1151
 
994
- _remove(api, ctx._select_set, indexes);
1152
+ if (ctx._select_mode === 'additive') {
1153
+ // List is of those rows selected, so remove it
1154
+ _remove(api, ctx._select_set, indexes);
1155
+ }
1156
+ else {
1157
+ // List is of rows which are deselected, so add it!
1158
+ _add(api, ctx._select_set, indexes);
1159
+ }
995
1160
  });
996
1161
  }
997
1162
 
@@ -1143,6 +1308,22 @@ apiRegister('select.items()', function (items) {
1143
1308
  });
1144
1309
  });
1145
1310
 
1311
+ apiRegister('select.keys()', function (flag) {
1312
+ if (flag === undefined) {
1313
+ return this.context[0]._select.keys;
1314
+ }
1315
+
1316
+ return this.iterator('table', function (ctx) {
1317
+ if (!ctx._select) {
1318
+ DataTable.select.init(new DataTable.Api(ctx));
1319
+ }
1320
+
1321
+ ctx._select.keys = flag;
1322
+
1323
+ keysSet(new DataTable.Api(ctx));
1324
+ });
1325
+ });
1326
+
1146
1327
  // Takes effect from the _next_ selection. None disables future selection, but
1147
1328
  // does not clear the current selection. Use the `deselect` methods for that
1148
1329
  apiRegister('select.style()', function (style) {
@@ -1226,12 +1407,45 @@ apiRegister('select.last()', function (set) {
1226
1407
  return ctx._select_lastCell;
1227
1408
  });
1228
1409
 
1229
- apiRegister('select.cumulative()', function () {
1410
+ apiRegister('select.cumulative()', function (mode) {
1411
+ if (mode) {
1412
+ return this.iterator('table', function (ctx) {
1413
+ if (ctx._select_mode === mode) {
1414
+ return;
1415
+ }
1416
+
1417
+ var dt = new DataTable.Api(ctx);
1418
+
1419
+ // Convert from the current mode, to the new
1420
+ if (mode === 'subtractive') {
1421
+ // For subtractive mode we track the row ids which are not selected
1422
+ var unselected = dt.rows({selected: false}).ids().toArray();
1423
+
1424
+ ctx._select_mode = mode;
1425
+ ctx._select_set.length = 0;
1426
+ ctx._select_set.push.apply(ctx._select_set, unselected);
1427
+ }
1428
+ else {
1429
+ // Switching to additive, so selected rows are to be used
1430
+ var selected = dt.rows({selected: true}).ids().toArray();
1431
+
1432
+ ctx._select_mode = mode;
1433
+ ctx._select_set.length = 0;
1434
+ ctx._select_set.push.apply(ctx._select_set, selected);
1435
+ }
1436
+ }).draw(false);
1437
+ }
1438
+
1230
1439
  let ctx = this.context[0];
1231
1440
 
1232
- return ctx && ctx._select_set
1233
- ? ctx._select_set
1234
- : [];
1441
+ if (ctx && ctx._select_set) {
1442
+ return {
1443
+ mode: ctx._select_mode,
1444
+ rows: ctx._select_set
1445
+ };
1446
+ }
1447
+
1448
+ return null;
1235
1449
  });
1236
1450
 
1237
1451
  apiRegisterPlural('rows().select()', 'row().select()', function (select) {
@@ -1306,6 +1520,22 @@ apiRegister('row().selected()', function () {
1306
1520
  return false;
1307
1521
  });
1308
1522
 
1523
+ apiRegister('row().focus()', function () {
1524
+ var ctx = this.context[0];
1525
+
1526
+ if (ctx && this.length && ctx.aoData[this[0]] && ctx.aoData[this[0]].nTr) {
1527
+ ctx.aoData[this[0]].nTr.focus();
1528
+ }
1529
+ });
1530
+
1531
+ apiRegister('row().blur()', function () {
1532
+ var ctx = this.context[0];
1533
+
1534
+ if (ctx && this.length && ctx.aoData[this[0]] && ctx.aoData[this[0]].nTr) {
1535
+ ctx.aoData[this[0]].nTr.blur();
1536
+ }
1537
+ });
1538
+
1309
1539
  apiRegisterPlural('columns().select()', 'column().select()', function (select) {
1310
1540
  var api = this;
1311
1541
 
@@ -1,4 +1,4 @@
1
- /*! Select for DataTables 2.1.0
1
+ /*! Select for DataTables 3.0.0
2
2
  * © SpryMedia Ltd - datatables.net/license/mit
3
3
  */
4
- !function(l){var s,c;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return l(e,window,document)}):"object"==typeof exports?(s=require("jquery"),c=function(e,t){t.fn.dataTable||require("datatables.net")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||s(e),c(e,t),l(t,e,e.document)}:(c(window,s),module.exports=l(s,window,window.document))):l(jQuery,window,document)}(function(m,i,e){"use strict";var p=m.fn.dataTable;function r(n,e,t){function l(t,l){l<t&&(e=l,l=t,t=e);var e,s=!1;return n.columns(":visible").indexes().filter(function(e){return e===t&&(s=!0),e===l?!(s=!1):s})}function s(t,l){var e,s=n.rows({search:"applied"}).indexes(),c=(s.indexOf(t)>s.indexOf(l)&&(e=l,l=t,t=e),!1);return s.filter(function(e){return e===t&&(c=!0),e===l?!(c=!1):c})}var c,t=n.cells({selected:!0}).any()||t?(c=l(t.column,e.column),s(t.row,e.row)):(c=l(0,e.column),s(0,e.row)),t=n.cells(t,c).flatten();n.cells(e,{selected:!0}).any()?n.cells(t).deselect():n.cells(t).select()}function v(e){var t=p.select.classes.checkbox;return e?t.replace(/ /g,"."):t}function c(e){var t=e.settings()[0]._select.selector;m(e.table().container()).off("mousedown.dtSelect",t).off("mouseup.dtSelect",t).off("click.dtSelect",t),m("body").off("click.dtSelect"+_(e.table().node()))}function n(o){var a,t=m(o.table().container()),l=o.settings()[0],s=l._select.selector;t.on("mousedown.dtSelect",s,function(e){(e.shiftKey||e.metaKey||e.ctrlKey)&&t.css("-moz-user-select","none").one("selectstart.dtSelect",s,function(){return!1}),i.getSelection&&(a=i.getSelection())}).on("mouseup.dtSelect",s,function(){t.css("-moz-user-select","")}).on("click.dtSelect",s,function(e){var t,l=o.select.items();if(a){var s=i.getSelection();if((!s.anchorNode||m(s.anchorNode).closest("table")[0]===o.table().node())&&s!==a)return}var c,s=o.settings()[0],n=o.table().container();m(e.target).closest("div.dt-container")[0]==n&&(n=o.cell(m(e.target).closest("td, th"))).any()&&(c=m.Event("user-select.dt"),u(o,c,[l,n,e]),c.isDefaultPrevented()||(c=n.index(),"row"===l?(t=c.row,h(e,o,s,"row",t)):"column"===l?(t=n.index().column,h(e,o,s,"column",t)):"cell"===l&&(t=n.index(),h(e,o,s,"cell",t)),s._select_lastCell=c))}),m("body").on("click.dtSelect"+_(o.table().node()),function(e){var t;!l._select.blurable||m(e.target).parents().filter(o.table().container()).length||0===m(e.target).parents("html").length||m(e.target).parents("div.DTE").length||(t=m.Event("select-blur.dt"),u(o,t,[e.target,e]),t.isDefaultPrevented())||f(l,!0)})}function u(e,t,l,s){s&&!e.flatten().length||("string"==typeof t&&(t+=".dt"),l.unshift(e),m(e.table().node()).trigger(t,l))}function b(e){return e.mRender&&"selectCheckbox"===e.mRender._name}function s(s,e){var t,l,c,n,o;"api"!==s.select.style()&&!1!==s.select.info()&&(o=s.settings()[0]._select_set.length||s.rows({selected:!0}).count(),t=s.columns({selected:!0}).count(),l=s.cells({selected:!0}).count(),c=function(e,t,l){e.append(m('<span class="select-item"/>').append(s.i18n("select."+t+"s",{_:"%d "+t+"s selected",0:"",1:"1 "+t+" selected"},l)))},e=m(e),c(n=m('<span class="select-info"/>'),"row",o),c(n,"column",t),c(n,"cell",l),(o=e.children("span.select-info")).length&&o.remove(),""!==n.text())&&e.append(n)}function o(o){var r,a=new p.Api(o);o._select_init=!0,o._select_set=[],o.aoRowCreatedCallback.push(function(e,t,l){var s,c,n=o.aoData[l],l=a.row(l).id();for((n._select_selected||"undefined"!==l&&o._select_set.includes(l))&&(n._select_selected=!0,m(e).addClass(o._select.className).find("input."+v(!0)).prop("checked",!0)),s=0,c=o.aoColumns.length;s<c;s++)(o.aoColumns[s]._select_selected||n._selected_cells&&n._selected_cells[s])&&m(n.anCells[s]).addClass(o._select.className)}),(r=a).on("select",function(e,t,l,s){if("row"===l)for(var l=r.settings()[0],c=r,n=l._select_set,o=s,a=0;a<o.length;a++){var i=c.row(o[a]).id();i&&"undefined"!==i&&!n.includes(i)&&n.push(i)}}),r.on("deselect",function(e,t,l,s){if("row"===l)for(var l=r.settings()[0],c=r,n=l._select_set,o=s,a=0;a<o.length;a++){var i=c.row(o[a]).id(),i=n.indexOf(i);-1!==i&&n.splice(i,1)}}),a.on("info.dt",function(e,t,l){t._select.infoEls.includes(l)||t._select.infoEls.push(l),s(a,l)}),a.on("select.dtSelect.dt deselect.dtSelect.dt",function(){o._select.infoEls.forEach(function(e){s(a,e)}),a.state.save()}),a.on("destroy.dtSelect",function(){m(a.rows({selected:!0}).nodes()).removeClass(a.settings()[0]._select.className),m("input."+v(!0),a.table().header()).remove(),c(a),a.off(".dtSelect"),m("body").off(".dtSelect"+_(a.table().node()))})}function d(e,t,l,s){var c,n=e[t+"s"]({search:"applied"}).indexes(),s=n.indexOf(s),o=n.indexOf(l);e[t+"s"]({selected:!0}).any()||-1!==s?(o<s&&(c=o,o=s,s=c),n.splice(o+1,n.length),n.splice(0,s)):n.splice(n.indexOf(l)+1,n.length),e[t](l,{selected:!0}).any()?(n.splice(n.indexOf(l),1),e[t+"s"](n).deselect()):e[t+"s"](n).select()}function f(e,t){!t&&"single"!==e._select.style||((t=new p.Api(e)).rows({selected:!0}).deselect(),t.columns({selected:!0}).deselect(),t.cells({selected:!0}).deselect())}function h(e,t,l,s,c){var n=t.select.style(),o=t.select.toggleable(),a=t[s](c,{selected:!0}).any();a&&!o||("os"===n?e.ctrlKey||e.metaKey?t[s](c).select(!a):e.shiftKey?"cell"===s?r(t,c,l._select_lastCell||null):d(t,s,c,l._select_lastCell?l._select_lastCell[s]:null):(o=t[s+"s"]({selected:!0}),a&&1===o.flatten().length?t[s](c).deselect():(o.deselect(),t[s](c).select())):"multi+shift"==n&&e.shiftKey?"cell"===s?r(t,c,l._select_lastCell||null):d(t,s,c,l._select_lastCell?l._select_lastCell[s]:null):t[s](c).select(!a))}function _(e){return e.id.replace(/[^a-zA-Z0-9\-\_]/g,"-")}p.select={},p.select.classes={checkbox:"dt-select-checkbox"},p.select.version="2.1.0",p.select.init=function(o){var e,t,l,s,c,n,a,i,r,u,d,f,h,_=o.settings()[0];if(!p.versionCheck("2"))throw"Warning: Select requires DataTables 2 or newer";!_._select&&(e=o.state.loaded(),t=function(e,t,l){if(null!==l&&void 0!==l.select){if(o.rows({selected:!0}).any()&&o.rows().deselect(),void 0!==l.select.rows&&o.rows(l.select.rows).select(),o.columns({selected:!0}).any()&&o.columns().deselect(),void 0!==l.select.columns&&o.columns(l.select.columns).select(),o.cells({selected:!0}).any()&&o.cells().deselect(),void 0!==l.select.cells)for(var s=0;s<l.select.cells.length;s++)o.cell(l.select.cells[s].row,l.select.cells[s].column).select();o.state.save()}},o.on("stateSaveParams",function(e,t,l){l.select={},l.select.rows=o.rows({selected:!0}).ids(!0).toArray(),l.select.columns=o.columns({selected:!0})[0],l.select.cells=o.cells({selected:!0})[0].map(function(e){return{row:o.row(e.row).id(!0),column:e.column}})}).on("stateLoadParams",t).one("init",function(){t(0,0,e)}),s=_.oInit.select,l=p.defaults.select,l=void 0===s?l:s,s="row",a=!(n=!(c="api")),u="td, th",d="selected",h=!(f=r=!(i=null)),_._select={infoEls:[]},!0===l?(c="os",h=!0):"string"==typeof l?(c=l,h=!0):m.isPlainObject(l)&&(void 0!==l.blurable&&(n=l.blurable),void 0!==l.toggleable&&(a=l.toggleable),void 0!==l.info&&(r=l.info),void 0!==l.items&&(s=l.items),h=(c=void 0!==l.style?l.style:"os",!0),void 0!==l.selector&&(u=l.selector),void 0!==l.className&&(d=l.className),void 0!==l.headerCheckbox&&(f=l.headerCheckbox),void 0!==l.selectable)&&(i=l.selectable),o.select.selector(u),o.select.items(s),o.select.style(c),o.select.blurable(n),o.select.toggleable(a),o.select.info(r),o.select.selectable(i),_._select.className=d,!h&&m(o.table().node()).hasClass("selectable")&&o.select.style("os"),f||"select-page"===f||"select-all"===f)&&o.ready(function(){var c,n,l;n=f,l=(c=o).settings()[0].aoColumns,c.columns().iterator("column",function(e,t){var s;b(l[t])&&(t=c.column(t).header(),m("input",t).length||(s=m("<input>").attr({class:v(!0),type:"checkbox","aria-label":c.i18n("select.aria.headerCheckbox")||"Select all rows"}).appendTo(t).on("change",function(){this.checked?("select-page"==n?c.rows({page:"current"}):c.rows({search:"applied"})).select():("select-page"==n?c.rows({page:"current",selected:!0}):c.rows({selected:!0})).deselect()}).on("click",function(e){e.stopPropagation()}),c.on("draw select deselect",function(e,t,l){"row"!==l&&l||((l=function(e,t){var l=e.settings()[0],s=l._select.selectable,c=0,n=("select-page"==t?e.rows({page:"current",selected:!0}):e.rows({selected:!0})).count(),o=("select-page"==t?e.rows({page:"current",selected:!0}):e.rows({search:"applied",selected:!0})).count();if(s)for(var a=("select-page"==t?e.rows({page:"current"}):e.rows({search:"applied"})).indexes(),i=0;i<a.length;i++){var r=l.aoData[a[i]];s(r._aData,r.nTr,a[i])&&c++}else c=("select-page"==t?e.rows({page:"current"}):e.rows({search:"applied"})).count();return{available:c,count:n,search:o}}(c,n)).search&&l.search<=l.count&&l.search===l.available?s.prop("checked",!0).prop("indeterminate",!1):0===l.search&&0===l.count?s.prop("checked",!1).prop("indeterminate",!1):s.prop("checked",!1).prop("indeterminate",!0))})))})})},m.each([{type:"row",prop:"aoData"},{type:"column",prop:"aoColumns"}],function(e,i){p.ext.selector[i.type].push(function(e,t,l){var s,c=t.selected,n=[];if(!0!==c&&!1!==c)return l;for(var o=0,a=l.length;o<a;o++)(s=e[i.prop][l[o]])&&(!0===c&&!0===s._select_selected||!1===c&&!s._select_selected)&&n.push(l[o]);return n})}),p.ext.selector.cell.push(function(e,t,l){var s,c=t.selected,n=[];if(void 0===c)return l;for(var o=0,a=l.length;o<a;o++)(s=e.aoData[l[o].row])&&(!0===c&&s._selected_cells&&!0===s._selected_cells[l[o].column]||!1===c&&(!s._selected_cells||!s._selected_cells[l[o].column]))&&n.push(l[o]);return n});var t=p.Api.register,l=p.Api.registerPlural;function a(t,l){return function(e){return e.i18n("buttons."+t,l)}}function w(e){e=e._eventNamespace;return"draw.dt.DT"+e+" select.dt.DT"+e+" deselect.dt.DT"+e}t("select()",function(){return this.iterator("table",function(e){p.select.init(new p.Api(e))})}),t("select.blurable()",function(t){return void 0===t?this.context[0]._select.blurable:this.iterator("table",function(e){e._select.blurable=t})}),t("select.toggleable()",function(t){return void 0===t?this.context[0]._select.toggleable:this.iterator("table",function(e){e._select.toggleable=t})}),t("select.info()",function(t){return void 0===t?this.context[0]._select.info:this.iterator("table",function(e){e._select.info=t})}),t("select.items()",function(t){return void 0===t?this.context[0]._select.items:this.iterator("table",function(e){e._select.items=t,u(new p.Api(e),"selectItems",[t])})}),t("select.style()",function(l){return void 0===l?this.context[0]._select.style:this.iterator("table",function(e){e._select||p.select.init(new p.Api(e)),e._select_init||o(e),e._select.style=l;var t=new p.Api(e);"api"!==l?t.ready(function(){c(t),n(t)}):c(t),u(new p.Api(e),"selectStyle",[l])})}),t("select.selector()",function(s){return void 0===s?this.context[0]._select.selector:this.iterator("table",function(e){var t=new p.Api(e),l=e._select.style;c(t),e._select.selector=s,l&&"api"!==l?t.ready(function(){c(t),n(t)}):c(t)})}),t("select.selectable()",function(e){var t=this.context[0];return e?(t._select.selectable=e,this):t._select.selectable}),t("select.last()",function(e){var t=this.context[0];return e?(t._select_lastCell=e,this):t._select_lastCell}),t("select.cumulative()",function(){var e=this.context[0];return e&&e._select_set?e._select_set:[]}),l("rows().select()","row().select()",function(e){var o=this,a=[];return!1===e?this.deselect():(this.iterator("row",function(e,t){f(e);var l=e.aoData[t],s=e.aoColumns;if(e._select.selectable&&!1===e._select.selectable(l._aData,l.nTr,t))return;m(l.nTr).addClass(e._select.className),l._select_selected=!0,a.push(t);for(var c=0;c<s.length;c++){var n=s[c];null===n.sType&&o.columns().types(),b(n)&&((n=l.anCells)&&n[c]&&m("input."+v(!0),n[c]).prop("checked",!0),null!==l._aSortData)&&(l._aSortData[c]=null)}}),this.iterator("table",function(e){u(o,"select",["row",a],!0)}),this)}),t("row().selected()",function(){var e=this.context[0];return!!(e&&this.length&&e.aoData[this[0]]&&e.aoData[this[0]]._select_selected)}),l("columns().select()","column().select()",function(e){var l=this;return!1===e?this.deselect():(this.iterator("column",function(e,t){f(e),e.aoColumns[t]._select_selected=!0;t=new p.Api(e).column(t);m(t.header()).addClass(e._select.className),m(t.footer()).addClass(e._select.className),t.nodes().to$().addClass(e._select.className)}),this.iterator("table",function(e,t){u(l,"select",["column",l[t]],!0)}),this)}),t("column().selected()",function(){var e=this.context[0];return!!(e&&this.length&&e.aoColumns[this[0]]&&e.aoColumns[this[0]]._select_selected)}),l("cells().select()","cell().select()",function(e){var l=this;return!1===e?this.deselect():(this.iterator("cell",function(e,t,l){f(e);t=e.aoData[t];void 0===t._selected_cells&&(t._selected_cells=[]),t._selected_cells[l]=!0,t.anCells&&m(t.anCells[l]).addClass(e._select.className)}),this.iterator("table",function(e,t){u(l,"select",["cell",l.cells(l[t]).indexes().toArray()],!0)}),this)}),t("cell().selected()",function(){var e=this.context[0];if(e&&this.length){e=e.aoData[this[0][0].row];if(e&&e._selected_cells&&e._selected_cells[this[0][0].column])return!0}return!1}),l("rows().deselect()","row().deselect()",function(){var o=this;return this.iterator("row",function(e,t){var l=e.aoData[t],s=e.aoColumns;m(l.nTr).removeClass(e._select.className),l._select_selected=!1,e._select_lastCell=null;for(var c=0;c<s.length;c++){var n=s[c];null===n.sType&&o.columns().types(),b(n)&&((n=l.anCells)&&n[c]&&m("input."+v(!0),l.anCells[c]).prop("checked",!1),null!==l._aSortData)&&(l._aSortData[c]=null)}}),this.iterator("table",function(e,t){u(o,"deselect",["row",o[t]],!0)}),this}),l("columns().deselect()","column().deselect()",function(){var l=this;return this.iterator("column",function(s,e){s.aoColumns[e]._select_selected=!1;var t=new p.Api(s),l=t.column(e);m(l.header()).removeClass(s._select.className),m(l.footer()).removeClass(s._select.className),t.cells(null,e).indexes().each(function(e){var t=s.aoData[e.row],l=t._selected_cells;!t.anCells||l&&l[e.column]||m(t.anCells[e.column]).removeClass(s._select.className)})}),this.iterator("table",function(e,t){u(l,"deselect",["column",l[t]],!0)}),this}),l("cells().deselect()","cell().deselect()",function(){var l=this;return this.iterator("cell",function(e,t,l){t=e.aoData[t];void 0!==t._selected_cells&&(t._selected_cells[l]=!1),t.anCells&&!e.aoColumns[l]._select_selected&&m(t.anCells[l]).removeClass(e._select.className)}),this.iterator("table",function(e,t){u(l,"deselect",["cell",l[t]],!0)}),this});var g=0;return m.extend(p.ext.buttons,{selected:{text:a("selected","Selected"),className:"buttons-selected",limitTo:["rows","columns","cells"],init:function(l,e,s){var c=this;s._eventNamespace=".select"+g++,l.on(w(s),function(){var e,t;c.enable((e=l,!(-1===(t=s).limitTo.indexOf("rows")||!e.rows({selected:!0}).any())||!(-1===t.limitTo.indexOf("columns")||!e.columns({selected:!0}).any())||!(-1===t.limitTo.indexOf("cells")||!e.cells({selected:!0}).any())))}),this.disable()},destroy:function(e,t,l){e.off(l._eventNamespace)}},selectedSingle:{text:a("selectedSingle","Selected single"),className:"buttons-selected-single",init:function(t,e,l){var s=this;l._eventNamespace=".select"+g++,t.on(w(l),function(){var e=t.rows({selected:!0}).flatten().length+t.columns({selected:!0}).flatten().length+t.cells({selected:!0}).flatten().length;s.enable(1===e)}),this.disable()},destroy:function(e,t,l){e.off(l._eventNamespace)}},selectAll:{text:a("selectAll","Select all"),className:"buttons-select-all",action:function(e,t,l,s){var c=this.select.items(),n=s.selectorModifier;(n?("function"==typeof n&&(n=n.call(t,e,t,l,s)),this[c+"s"](n)):this[c+"s"]()).select()}},selectNone:{text:a("selectNone","Deselect all"),className:"buttons-select-none",action:function(){f(this.settings()[0],!0)},init:function(t,e,l){var s=this;l._eventNamespace=".select"+g++,t.on(w(l),function(){var e=t.rows({selected:!0}).flatten().length+t.columns({selected:!0}).flatten().length+t.cells({selected:!0}).flatten().length;s.enable(0<e)}),this.disable()},destroy:function(e,t,l){e.off(l._eventNamespace)}},showSelected:{text:a("showSelected","Show only selected"),className:"buttons-show-selected",action:function(e,t){var s;t.search.fixed("dt-select")?(t.search.fixed("dt-select",null),this.active(!1)):(s=t.settings()[0].aoData,t.search.fixed("dt-select",function(e,t,l){return s[l]._select_selected}),this.active(!0)),t.draw()}}}),m.each(["Row","Column","Cell"],function(e,t){var c=t.toLowerCase();p.ext.buttons["select"+t+"s"]={text:a("select"+t+"s","Select "+c+"s"),className:"buttons-select-"+c+"s",action:function(){this.select.items(c)},init:function(e){var s=this;this.active(e.select.items()===c),e.on("selectItems.dt.DT",function(e,t,l){s.active(l===c)})}}}),p.type("select-checkbox",{className:"dt-select",detect:p.versionCheck("2.1")?{oneOf:function(){return!1},allOf:function(){return!1},init:function(e,t,l){return b(t)}}:function(e){return"select-checkbox"===e&&e},order:{pre:function(e){return"X"===e?-1:0}}}),m.extend(!0,p.defaults.oLanguage,{select:{aria:{rowCheckbox:"Select row"}}}),p.render.select=function(e,t){function l(e,t,l,s){var c=s.settings.aoData[s.row],n=c._select_selected,o=s.settings.oLanguage.select.aria.rowCheckbox,a=s.settings._select.selectable;return"display"!==t?"type"===t?"select-checkbox":"filter"!==t&&n?"X":"":a&&!1===a(l,c.nTr,s.row)?"":m("<input>").attr({"aria-label":o,class:v(),name:r?r(l):null,type:"checkbox",value:i?i(l):null,checked:n}).on("input",function(e){e.preventDefault(),this.checked=m(this).closest("tr").hasClass("selected")})[0]}var i=e?p.util.get(e):null,r=t?p.util.get(t):null;return l._name="selectCheckbox",l},p.ext.order["select-checkbox"]=function(t,e){return this.api().column(e,{order:"index"}).nodes().map(function(e){return"row"===t._select.items?m(e).parent().hasClass(t._select.className).toString():"cell"===t._select.items&&m(e).hasClass(t._select.className).toString()})},m.fn.DataTable.select=p.select,m(e).on("i18n.dt.dtSelect preInit.dt.dtSelect",function(e,t){"dt"===e.namespace&&p.select.init(new p.Api(t))}),p});
4
+ !function(s){var l,c;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return s(e,window,document)}):"object"==typeof exports?(l=require("jquery"),c=function(e,t){t.fn.dataTable||require("datatables.net")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||l(e),c(e,t),s(t,e,e.document)}:(c(window,l),module.exports=s(l,window,window.document))):s(jQuery,window,document)}(function(m,i,a){"use strict";var v=m.fn.dataTable;function r(n,e,t){function s(t,s){s<t&&(e=s,s=t,t=e);var e,l=!1;return n.columns(":visible").indexes().filter(function(e){return e===t&&(l=!0),e===s?!(l=!1):l})}function l(t,s){var e,l=n.rows({search:"applied"}).indexes(),c=(l.indexOf(t)>l.indexOf(s)&&(e=s,s=t,t=e),!1);return l.filter(function(e){return e===t&&(c=!0),e===s?!(c=!1):c})}var c,t=n.cells({selected:!0}).any()||t?(c=s(t.column,e.column),l(t.row,e.row)):(c=s(0,e.column),l(0,e.row)),t=n.cells(t,c).flatten();n.cells(e,{selected:!0}).any()?n.cells(t).deselect():n.cells(t).select()}function w(e){var t=v.select.classes.checkbox;return e?t.replace(/ /g,"."):t}function n(e){var t=e.settings()[0]._select.selector;m(e.table().container()).off("mousedown.dtSelect",t).off("mouseup.dtSelect",t).off("click.dtSelect",t),m("body").off("click.dtSelect"+b(e.table().node()))}function c(o){var a,t=m(o.table().container()),s=o.settings()[0],l=s._select.selector;t.on("mousedown.dtSelect",l,function(e){(e.shiftKey||e.metaKey||e.ctrlKey)&&t.css("-moz-user-select","none").one("selectstart.dtSelect",l,function(){return!1}),i.getSelection&&(a=i.getSelection())}).on("mouseup.dtSelect",l,function(){t.css("-moz-user-select","")}).on("click.dtSelect",l,function(e){var t,s=o.select.items();if(a){var l=i.getSelection();if((!l.anchorNode||m(l.anchorNode).closest("table")[0]===o.table().node())&&l!==a)return}var c,l=o.settings()[0],n=o.table().container();m(e.target).closest("div.dt-container")[0]==n&&(n=o.cell(m(e.target).closest("td, th"))).any()&&(c=m.Event("user-select.dt"),u(o,c,[s,n,e]),c.isDefaultPrevented()||(c=n.index(),"row"===s?(t=c.row,p(e,o,l,"row",t)):"column"===s?(t=n.index().column,p(e,o,l,"column",t)):"cell"===s&&(t=n.index(),p(e,o,l,"cell",t)),l._select_lastCell=c))}),m("body").on("click.dtSelect"+b(o.table().node()),function(e){var t;!s._select.blurable||m(e.target).parents().filter(o.table().container()).length||0===m(e.target).parents("html").length||m(e.target).parents("div.DTE").length||(t=m.Event("select-blur.dt"),u(o,t,[e.target,e]),t.isDefaultPrevented())||_(s,!0)})}function u(e,t,s,l){l&&!e.flatten().length||("string"==typeof t&&(t+=".dt"),s.unshift(e),m(e.table().node()).trigger(t,s))}function g(e){return e.mRender&&"selectCheckbox"===e.mRender._name}function l(l,e){var t,s,c,n,o;"api"!==l.select.style()&&!1!==l.select.info()&&(o=(n=(c=l.settings()[0])._select_set.length)||l.rows({selected:!0}).count(),t=l.columns({selected:!0}).count(),s=l.cells({selected:!0}).count(),"subtractive"===c._select_mode&&(o=l.page.info().recordsDisplay-n),c=function(e,t,s){e.append(m('<span class="select-item"/>').append(l.i18n("select."+t+"s",{_:"%d "+t+"s selected",0:"",1:"1 "+t+" selected"},s)))},n=m(e),c(e=m('<span class="select-info"/>'),"row",o),c(e,"column",t),c(e,"cell",s),(o=n.children("span.select-info")).length&&o.remove(),""!==e.text())&&n.append(e)}function d(e){var t=e.page.info();t.page<t.pages-1&&e.one("draw",function(){e.row(":first-child").node().focus()}).page("next").draw(!1)}function f(e){0<e.page.info().page&&e.one("draw",function(){e.row(":last-child").node().focus()}).page("previous").draw(!1)}function o(o){var c,a=new v.Api(o);o._select_init=!0,o._select_mode="additive",o._select_set=[],o.aoRowCreatedCallback.push(function(e,t,s){var l,c,n=o.aoData[s],s=a.row(s).id();for((n._select_selected||"additive"===o._select_mode&&o._select_set.includes(s)||"subtractive"===o._select_mode&&!o._select_set.includes(s))&&(n._select_selected=!0,m(e).addClass(o._select.className).find("input."+w(!0)).prop("checked",!0)),l=0,c=o.aoColumns.length;l<c;l++)(o.aoColumns[l]._select_selected||n._selected_cells&&n._selected_cells[l])&&m(n.anCells[l]).addClass(o._select.className)}),(c=a).on("select",function(e,t,s,l){"row"===s&&("additive"===(s=c.settings()[0])._select_mode?y:x)(c,s._select_set,l)}),c.on("deselect",function(e,t,s,l){"row"===s&&("additive"===(s=c.settings()[0])._select_mode?x:y)(c,s._select_set,l)}),a.on("info.dt",function(e,t,s){t._select.infoEls.includes(s)||t._select.infoEls.push(s),l(a,s)}),a.on("select.dtSelect.dt deselect.dtSelect.dt",function(){o._select.infoEls.forEach(function(e){l(a,e)}),a.state.save()}),a.on("destroy.dtSelect",function(){m(a.rows({selected:!0}).nodes()).removeClass(a.settings()[0]._select.className),m("input."+w(!0),a.table().header()).remove(),n(a),a.off(".dtSelect"),m("body").off(".dtSelect"+b(a.table().node()))})}function h(e,t,s,l){var c,n=e[t+"s"]({search:"applied"}).indexes(),l=n.indexOf(l),o=n.indexOf(s);e[t+"s"]({selected:!0}).any()||-1!==l?(o<l&&(c=o,o=l,l=c),n.splice(o+1,n.length),n.splice(0,l)):n.splice(n.indexOf(s)+1,n.length),e[t](s,{selected:!0}).any()?(n.splice(n.indexOf(s),1),e[t+"s"](n).deselect()):e[t+"s"](n).select()}function _(e,t){!t&&"single"!==e._select.style||((t=new v.Api(e)).rows({selected:!0}).deselect(),t.columns({selected:!0}).deselect(),t.cells({selected:!0}).deselect())}function p(e,t,s,l,c){var n=t.select.style(),o=t.select.toggleable(),a=t[l](c,{selected:!0}).any();a&&!o||("os"===n?e.ctrlKey||e.metaKey?t[l](c).select(!a):e.shiftKey?"cell"===l?r(t,c,s._select_lastCell||null):h(t,l,c,s._select_lastCell?s._select_lastCell[l]:null):(o=t[l+"s"]({selected:!0}),a&&1===o.flatten().length?t[l](c).deselect():(o.deselect(),t[l](c).select())):"multi+shift"==n&&e.shiftKey?"cell"===l?r(t,c,s._select_lastCell||null):h(t,l,c,s._select_lastCell?s._select_lastCell[l]:null):t[l](c).select(!a))}function b(e){return e.id.replace(/[^a-zA-Z0-9\-\_]/g,"-")}function y(e,t,s){for(var l=0;l<s.length;l++){var c=e.row(s[l]).id();c&&"undefined"!==c&&!t.includes(c)&&t.push(c)}}function x(e,t,s){for(var l=0;l<s.length;l++){var c=e.row(s[l]).id(),c=t.indexOf(c);-1!==c&&t.splice(c,1)}}v.select={},v.select.classes={checkbox:"dt-select-checkbox"},v.select.version="3.0.0",v.select.init=function(o){var e,t,s,l,c,n,a,i,r,u,d,f,h,_,p=o.settings()[0];if(!v.versionCheck("2"))throw"Warning: Select requires DataTables 2 or newer";!p._select&&(e=o.state.loaded(),t=function(e,t,s){if(null!==s&&void 0!==s.select){if(o.rows({selected:!0}).any()&&o.rows().deselect(),void 0!==s.select.rows&&o.rows(s.select.rows).select(),o.columns({selected:!0}).any()&&o.columns().deselect(),void 0!==s.select.columns&&o.columns(s.select.columns).select(),o.cells({selected:!0}).any()&&o.cells().deselect(),void 0!==s.select.cells)for(var l=0;l<s.select.cells.length;l++)o.cell(s.select.cells[l].row,s.select.cells[l].column).select();o.state.save()}},o.on("stateSaveParams",function(e,t,s){s.select={},s.select.rows=o.rows({selected:!0}).ids(!0).toArray(),s.select.columns=o.columns({selected:!0})[0],s.select.cells=o.cells({selected:!0})[0].map(function(e){return{row:o.row(e.row).id(!0),column:e.column}})}).on("stateLoadParams",t).one("init",function(){t(0,0,e)}),l=p.oInit.select,s=v.defaults.select,s=void 0===l?s:l,l="row",a=!(n=!(c="api")),u="td, th",d="selected",_=h=!(f=r=!(i=null)),p._select={infoEls:[]},!0===s?(c="os",h=!0):"string"==typeof s?(c=s,h=!0):m.isPlainObject(s)&&(void 0!==s.blurable&&(n=s.blurable),void 0!==s.toggleable&&(a=s.toggleable),void 0!==s.info&&(r=s.info),void 0!==s.items&&(l=s.items),h=(c=void 0!==s.style?s.style:"os",!0),void 0!==s.selector&&(u=s.selector),void 0!==s.className&&(d=s.className),void 0!==s.headerCheckbox&&(f=s.headerCheckbox),void 0!==s.selectable&&(i=s.selectable),void 0!==s.keys)&&(_=s.keys),o.select.selector(u),o.select.items(l),o.select.style(c),o.select.blurable(n),o.select.toggleable(a),o.select.info(r),o.select.keys(_),o.select.selectable(i),p._select.className=d,!h&&m(o.table().node()).hasClass("selectable")&&o.select.style("os"),f||"select-page"===f||"select-all"===f)&&o.ready(function(){var c,n,s;n=f,s=(c=o).settings()[0].aoColumns,c.columns().iterator("column",function(e,t){var l;g(s[t])&&(t=c.column(t).header(),m("input",t).length||(l=m("<input>").attr({class:w(!0),type:"checkbox","aria-label":c.i18n("select.aria.headerCheckbox")||"Select all rows"}).appendTo(t).on("change",function(){this.checked?("select-page"==n?c.rows({page:"current"}):c.rows({search:"applied"})).select():("select-page"==n?c.rows({page:"current",selected:!0}):c.rows({selected:!0})).deselect()}).on("click",function(e){e.stopPropagation()}),c.on("draw select deselect",function(e,t,s){"row"!==s&&s||((s=function(e,t){var s=e.settings()[0],l=s._select.selectable,c=0,n=("select-page"==t?e.rows({page:"current",selected:!0}):e.rows({selected:!0})).count(),o=("select-page"==t?e.rows({page:"current",selected:!0}):e.rows({search:"applied",selected:!0})).count();if(l)for(var a=("select-page"==t?e.rows({page:"current"}):e.rows({search:"applied"})).indexes(),i=0;i<a.length;i++){var r=s.aoData[a[i]];l(r._aData,r.nTr,a[i])&&c++}else c=("select-page"==t?e.rows({page:"current"}):e.rows({search:"applied"})).count();return{available:c,count:n,search:o}}(c,n)).search&&s.search<=s.count&&s.search===s.available?l.prop("checked",!0).prop("indeterminate",!1):0===s.search&&0===s.count?l.prop("checked",!1).prop("indeterminate",!1):l.prop("checked",!1).prop("indeterminate",!0))})))})})},m.each([{type:"row",prop:"aoData"},{type:"column",prop:"aoColumns"}],function(e,i){v.ext.selector[i.type].push(function(e,t,s){var l,c=t.selected,n=[];if(!0!==c&&!1!==c)return s;for(var o=0,a=s.length;o<a;o++)(l=e[i.prop][s[o]])&&(!0===c&&!0===l._select_selected||!1===c&&!l._select_selected)&&n.push(s[o]);return n})}),v.ext.selector.cell.push(function(e,t,s){var l,c=t.selected,n=[];if(void 0===c)return s;for(var o=0,a=s.length;o<a;o++)(l=e.aoData[s[o].row])&&(!0===c&&l._selected_cells&&!0===l._selected_cells[s[o].column]||!1===c&&(!l._selected_cells||!l._selected_cells[s[o].column]))&&n.push(s[o]);return n});var e=v.Api.register,t=v.Api.registerPlural;function s(t,s){return function(e){return e.i18n("buttons."+t,s)}}function C(e){e=e._eventNamespace;return"draw.dt.DT"+e+" select.dt.DT"+e+" deselect.dt.DT"+e}e("select()",function(){return this.iterator("table",function(e){v.select.init(new v.Api(e))})}),e("select.blurable()",function(t){return void 0===t?this.context[0]._select.blurable:this.iterator("table",function(e){e._select.blurable=t})}),e("select.toggleable()",function(t){return void 0===t?this.context[0]._select.toggleable:this.iterator("table",function(e){e._select.toggleable=t})}),e("select.info()",function(t){return void 0===t?this.context[0]._select.info:this.iterator("table",function(e){e._select.info=t})}),e("select.items()",function(t){return void 0===t?this.context[0]._select.items:this.iterator("table",function(e){e._select.items=t,u(new v.Api(e),"selectItems",[t])})}),e("select.keys()",function(s){return void 0===s?this.context[0]._select.keys:this.iterator("table",function(e){var o,t;e._select||v.select.init(new v.Api(e)),e._select.keys=s,o=new v.Api(e),t=(e=o.settings()[0])._select.keys,e="dts-keys-"+e.sTableId,t?(m(o.rows({page:"current"}).nodes()).attr("tabindex",0),o.on("draw."+e,function(){m(o.rows({page:"current"}).nodes()).attr("tabindex",0)}),m(a).on("keydown."+e,function(e){var t,s,l,c=e.keyCode,n=a.activeElement;[9,13,32,38,40].includes(c)&&(l=!0,-1!==(s=(t=o.rows({page:"current"}).nodes().toArray()).indexOf(n)))&&(9===c?!1===e.shift&&s===t.length-1?d(o):!0===e.shift&&0===s?f(o):l=!1:13===c||32===c?(n=o.row(n)).selected()?n.deselect():n.select():38===c?0<s?t[s-1].focus():f(o):s<t.length-1?t[s+1].focus():d(o),l)&&(e.stopPropagation(),e.preventDefault())})):(m(o.rows().nodes()).removeAttr("tabindex"),o.off("draw."+e),m(a).off("keydown."+e))})}),e("select.style()",function(s){return void 0===s?this.context[0]._select.style:this.iterator("table",function(e){e._select||v.select.init(new v.Api(e)),e._select_init||o(e),e._select.style=s;var t=new v.Api(e);"api"!==s?t.ready(function(){n(t),c(t)}):n(t),u(new v.Api(e),"selectStyle",[s])})}),e("select.selector()",function(l){return void 0===l?this.context[0]._select.selector:this.iterator("table",function(e){var t=new v.Api(e),s=e._select.style;n(t),e._select.selector=l,s&&"api"!==s?t.ready(function(){n(t),c(t)}):n(t)})}),e("select.selectable()",function(e){var t=this.context[0];return e?(t._select.selectable=e,this):t._select.selectable}),e("select.last()",function(e){var t=this.context[0];return e?(t._select_lastCell=e,this):t._select_lastCell}),e("select.cumulative()",function(l){var e;return l?this.iterator("table",function(e){var t,s;e._select_mode!==l&&(t=new v.Api(e),"subtractive"===l?(s=t.rows({selected:!1}).ids().toArray(),e._select_mode=l,e._select_set.length=0,e._select_set.push.apply(e._select_set,s)):(s=t.rows({selected:!0}).ids().toArray(),e._select_mode=l,e._select_set.length=0,e._select_set.push.apply(e._select_set,s)))}).draw(!1):(e=this.context[0])&&e._select_set?{mode:e._select_mode,rows:e._select_set}:null}),t("rows().select()","row().select()",function(e){var o=this,a=[];return!1===e?this.deselect():(this.iterator("row",function(e,t){_(e);var s=e.aoData[t],l=e.aoColumns;if(e._select.selectable&&!1===e._select.selectable(s._aData,s.nTr,t))return;m(s.nTr).addClass(e._select.className),s._select_selected=!0,a.push(t);for(var c=0;c<l.length;c++){var n=l[c];null===n.sType&&o.columns().types(),g(n)&&((n=s.anCells)&&n[c]&&m("input."+w(!0),n[c]).prop("checked",!0),null!==s._aSortData)&&(s._aSortData[c]=null)}}),this.iterator("table",function(e){u(o,"select",["row",a],!0)}),this)}),e("row().selected()",function(){var e=this.context[0];return!!(e&&this.length&&e.aoData[this[0]]&&e.aoData[this[0]]._select_selected)}),e("row().focus()",function(){var e=this.context[0];e&&this.length&&e.aoData[this[0]]&&e.aoData[this[0]].nTr&&e.aoData[this[0]].nTr.focus()}),e("row().blur()",function(){var e=this.context[0];e&&this.length&&e.aoData[this[0]]&&e.aoData[this[0]].nTr&&e.aoData[this[0]].nTr.blur()}),t("columns().select()","column().select()",function(e){var s=this;return!1===e?this.deselect():(this.iterator("column",function(e,t){_(e),e.aoColumns[t]._select_selected=!0;t=new v.Api(e).column(t);m(t.header()).addClass(e._select.className),m(t.footer()).addClass(e._select.className),t.nodes().to$().addClass(e._select.className)}),this.iterator("table",function(e,t){u(s,"select",["column",s[t]],!0)}),this)}),e("column().selected()",function(){var e=this.context[0];return!!(e&&this.length&&e.aoColumns[this[0]]&&e.aoColumns[this[0]]._select_selected)}),t("cells().select()","cell().select()",function(e){var s=this;return!1===e?this.deselect():(this.iterator("cell",function(e,t,s){_(e);t=e.aoData[t];void 0===t._selected_cells&&(t._selected_cells=[]),t._selected_cells[s]=!0,t.anCells&&m(t.anCells[s]).addClass(e._select.className)}),this.iterator("table",function(e,t){u(s,"select",["cell",s.cells(s[t]).indexes().toArray()],!0)}),this)}),e("cell().selected()",function(){var e=this.context[0];if(e&&this.length){e=e.aoData[this[0][0].row];if(e&&e._selected_cells&&e._selected_cells[this[0][0].column])return!0}return!1}),t("rows().deselect()","row().deselect()",function(){var o=this;return this.iterator("row",function(e,t){var s=e.aoData[t],l=e.aoColumns;m(s.nTr).removeClass(e._select.className),s._select_selected=!1,e._select_lastCell=null;for(var c=0;c<l.length;c++){var n=l[c];null===n.sType&&o.columns().types(),g(n)&&((n=s.anCells)&&n[c]&&m("input."+w(!0),s.anCells[c]).prop("checked",!1),null!==s._aSortData)&&(s._aSortData[c]=null)}}),this.iterator("table",function(e,t){u(o,"deselect",["row",o[t]],!0)}),this}),t("columns().deselect()","column().deselect()",function(){var s=this;return this.iterator("column",function(l,e){l.aoColumns[e]._select_selected=!1;var t=new v.Api(l),s=t.column(e);m(s.header()).removeClass(l._select.className),m(s.footer()).removeClass(l._select.className),t.cells(null,e).indexes().each(function(e){var t=l.aoData[e.row],s=t._selected_cells;!t.anCells||s&&s[e.column]||m(t.anCells[e.column]).removeClass(l._select.className)})}),this.iterator("table",function(e,t){u(s,"deselect",["column",s[t]],!0)}),this}),t("cells().deselect()","cell().deselect()",function(){var s=this;return this.iterator("cell",function(e,t,s){t=e.aoData[t];void 0!==t._selected_cells&&(t._selected_cells[s]=!1),t.anCells&&!e.aoColumns[s]._select_selected&&m(t.anCells[s]).removeClass(e._select.className)}),this.iterator("table",function(e,t){u(s,"deselect",["cell",s[t]],!0)}),this});var k=0;return m.extend(v.ext.buttons,{selected:{text:s("selected","Selected"),className:"buttons-selected",limitTo:["rows","columns","cells"],init:function(s,e,l){var c=this;l._eventNamespace=".select"+k++,s.on(C(l),function(){var e,t;c.enable((e=s,!(-1===(t=l).limitTo.indexOf("rows")||!e.rows({selected:!0}).any())||!(-1===t.limitTo.indexOf("columns")||!e.columns({selected:!0}).any())||!(-1===t.limitTo.indexOf("cells")||!e.cells({selected:!0}).any())))}),this.disable()},destroy:function(e,t,s){e.off(s._eventNamespace)}},selectedSingle:{text:s("selectedSingle","Selected single"),className:"buttons-selected-single",init:function(t,e,s){var l=this;s._eventNamespace=".select"+k++,t.on(C(s),function(){var e=t.rows({selected:!0}).flatten().length+t.columns({selected:!0}).flatten().length+t.cells({selected:!0}).flatten().length;l.enable(1===e)}),this.disable()},destroy:function(e,t,s){e.off(s._eventNamespace)}},selectAll:{text:s("selectAll","Select all"),className:"buttons-select-all",action:function(e,t,s,l){var c=this.select.items(),n=l.selectorModifier;(n?("function"==typeof n&&(n=n.call(t,e,t,s,l)),this[c+"s"](n)):this[c+"s"]()).select()}},selectNone:{text:s("selectNone","Deselect all"),className:"buttons-select-none",action:function(){_(this.settings()[0],!0)},init:function(t,e,s){var l=this;s._eventNamespace=".select"+k++,t.on(C(s),function(){var e=t.rows({selected:!0}).flatten().length+t.columns({selected:!0}).flatten().length+t.cells({selected:!0}).flatten().length;l.enable(0<e)}),this.disable()},destroy:function(e,t,s){e.off(s._eventNamespace)}},showSelected:{text:s("showSelected","Show only selected"),className:"buttons-show-selected",action:function(e,t){var l;t.search.fixed("dt-select")?(t.search.fixed("dt-select",null),this.active(!1)):(l=t.settings()[0].aoData,t.search.fixed("dt-select",function(e,t,s){return l[s]._select_selected}),this.active(!0)),t.draw()}}}),m.each(["Row","Column","Cell"],function(e,t){var c=t.toLowerCase();v.ext.buttons["select"+t+"s"]={text:s("select"+t+"s","Select "+c+"s"),className:"buttons-select-"+c+"s",action:function(){this.select.items(c)},init:function(e){var l=this;this.active(e.select.items()===c),e.on("selectItems.dt.DT",function(e,t,s){l.active(s===c)})}}}),v.type("select-checkbox",{className:"dt-select",detect:v.versionCheck("2.1")?{oneOf:function(){return!1},allOf:function(){return!1},init:function(e,t,s){return g(t)}}:function(e){return"select-checkbox"===e&&e},order:{pre:function(e){return"X"===e?-1:0}}}),m.extend(!0,v.defaults.oLanguage,{select:{aria:{rowCheckbox:"Select row"}}}),v.render.select=function(e,t){function s(e,t,s,l){var c=l.settings.aoData[l.row],n=c._select_selected,o=l.settings.oLanguage.select.aria.rowCheckbox,a=l.settings._select.selectable;return"display"!==t?"type"===t?"select-checkbox":"filter"!==t&&n?"X":"":a&&!1===a(s,c.nTr,l.row)?"":m("<input>").attr({"aria-label":o,class:w(),name:r?r(s):null,type:"checkbox",value:i?i(s):null,checked:n}).on("input",function(e){e.preventDefault(),this.checked=m(this).closest("tr").hasClass("selected")})[0]}var i=e?v.util.get(e):null,r=t?v.util.get(t):null;return s._name="selectCheckbox",s},v.ext.order["select-checkbox"]=function(t,e){return this.api().column(e,{order:"index"}).nodes().map(function(e){return"row"===t._select.items?m(e).parent().hasClass(t._select.className).toString():"cell"===t._select.items&&m(e).hasClass(t._select.className).toString()})},m.fn.DataTable.select=v.select,m(a).on("i18n.dt.dtSelect preInit.dt.dtSelect",function(e,t){"dt"===e.namespace&&v.select.init(new v.Api(t))}),v});
@@ -70,7 +70,7 @@
70
70
  "datatables-extension": "colreorder"
71
71
  },
72
72
  "DataTables-DateTime": {
73
- "version": "1.5.4",
73
+ "version": "1.5.5",
74
74
  "datatables-extension": "datetime"
75
75
  },
76
76
  "DataTables-FixedColumns": {
@@ -114,7 +114,7 @@
114
114
  "datatables-extension": "searchpanes"
115
115
  },
116
116
  "DataTables-Select": {
117
- "version": "2.1.0",
117
+ "version": "3.0.0",
118
118
  "datatables-extension": "select"
119
119
  },
120
120
  "DataTables-StateRestore": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ntlab/ntjs-assets",
3
- "version": "2.17.0",
3
+ "version": "2.18.0",
4
4
  "description": "Node Javascript assets",
5
5
  "main": "index.js",
6
6
  "scripts": {