Skip to content

Commit 3551f1a

Browse files
committed
Missing files in DataTables-DataTables
1 parent 7baf611 commit 3551f1a

4 files changed

Lines changed: 46 additions & 150 deletions

File tree

datatables.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@
1414
"types/types.d.ts"
1515
],
1616
"src-repo": "http://github.com/DataTables/StateRestore",
17-
"last-tag": "1.1.1",
18-
"last-sync": "9272f0a5e26e4a21dab2a5d02a21ee486856a80a"
19-
}
17+
"last-tag": "1.1.1"
18+
}

js/stateRestore.jqueryui.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,41 @@
1+
12
/*! Bootstrap integration for DataTables' StateRestore
23
* © SpryMedia Ltd - datatables.net/license
34
*/
5+
6+
(function( factory ){
7+
if ( typeof define === 'function' && define.amd ) {
8+
// AMD
9+
define( [''], function ( $ ) {
10+
return factory( $, window, document );
11+
} );
12+
}
13+
else if ( typeof exports === 'object' ) {
14+
// CommonJS
15+
module.exports = function (root, $) {
16+
if ( ! root ) {
17+
// CommonJS environments without a window global must pass a
18+
// root. This will give an error otherwise
19+
root = window;
20+
}
21+
22+
if ( ! $.fn.dataTable ) {
23+
require('')(root, $);
24+
}
25+
26+
27+
return factory( $, root, root.document );
28+
};
29+
}
30+
else {
31+
// Browser
32+
factory( jQuery, window, document );
33+
}
34+
}(function( $, window, document, undefined ) {
35+
'use strict';
36+
var DataTable = $.fn.dataTable;
37+
38+
439
$.extend(true, DataTable.StateRestoreCollection.classes, {
540
checkBox: 'dtsr-check-box form-check-input',
641
checkLabel: 'dtsr-check-label form-check-label',
@@ -17,3 +52,7 @@ $.extend(true, DataTable.StateRestore.classes, {
1752
// eslint-disable-next-line max-len
1853
confirmationButton: 'dtsr-confirmation-button ui-button ui-state-default ui-button-text-only ui-corner-all ui-widget'
1954
});
55+
56+
57+
return DataTable;
58+
}));

js/stateRestore.jqueryui.min.js

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

types/types.d.ts

Lines changed: 4 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,7 @@
1-
// Type definitions for DataTables StateRestore
2-
//
3-
// Project: https://datatables.net/extensions/StateRestore/, https://datatables.net
41

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

7-
import DataTables, {Api} from 'datatables.net';
8-
import * as stateRestoreCollectionType from './StateRestoreCollection';
9-
import * as stateRestoreType from './StateRestore';
6+
export default Api;
107

11-
export default DataTables;
12-
13-
type DeepPartial<T> = T extends object ? {
14-
[P in keyof T]?: DeepPartial<T[P]>;
15-
} : T;
16-
17-
18-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
19-
* DataTables' types integration
20-
*/
21-
declare module 'datatables.net' {
22-
interface Config {
23-
/**
24-
* StateRestore extension options
25-
*/
26-
stateRestore?: boolean | string[] | ConfigStateRestore | ConfigStateRestore[];
27-
}
28-
29-
interface ConfigLanguage {
30-
/**
31-
* StateRestore language options
32-
*/
33-
stateRestore?: ConfigStateRestoreLanguage;
34-
}
35-
36-
interface Api<T> {
37-
/**
38-
* StateRestore API Methods
39-
*/
40-
stateRestore: ApiStateRestore<T>;
41-
}
42-
43-
interface ApiStatic {
44-
/**
45-
* StateRestore class
46-
*/
47-
StateRestore: {
48-
/**
49-
* Create a new StateRestore instance for the target DataTable
50-
*/
51-
new (dt: Api<any>, settings: string[] | ConfigStateRestore | ConfigStateRestore[]);
52-
53-
/**
54-
* StateRestore version
55-
*/
56-
version: string;
57-
58-
/**
59-
* Default configuration values
60-
*/
61-
defaults: ConfigStateRestore;
62-
}
63-
}
64-
}
65-
66-
67-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
68-
* Options
69-
*/
70-
interface ConfigStateRestore extends Partial<stateRestoreCollectionType.IDefaults> {}
71-
72-
interface ConfigStateRestoreLanguage extends DeepPartial<stateRestoreCollectionType.II18n> {}
73-
74-
75-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
76-
* API
77-
*/
78-
79-
interface ApiStateRestore<T> {
80-
/**
81-
* Creates a new state, adding it to the collection.
82-
*
83-
* @param identifier The identifier that is to be used for the new state
84-
*
85-
* @returns DatatTables Api for chaining
86-
*/
87-
addState(identifier: string): void | Api<T>;
88-
89-
/**
90-
* Retrieves a state from the collection.
91-
*
92-
* @param identifier The identifier of the state that is to be retrieved.
93-
*
94-
* @returns StateRestore instance, or further api methods.
95-
*/
96-
state(identifier: string): stateRestoreType.default | null | StateRestoreSubApi<T>;
97-
98-
/**
99-
* Retrieves all of the states from the collection.
100-
*
101-
* @returns An array of the StateRestore instances,
102-
* or further api methods that are applicable to multiple states.
103-
*/
104-
states(): stateRestoreType.default[] | StateRestoreMultiSubApi<T>;
105-
}
106-
107-
interface StateRestoreSubApi<T> extends Api<T> {
108-
/**
109-
* Removes the state previously identified in the call to `state()`.
110-
*
111-
* @returns Datatables Api for chaining.
112-
*/
113-
remove(): Api<T>;
114-
115-
/**
116-
* Loads the state previously identified in the call to `state()` into the table.
117-
*
118-
* @returns Datatables Api for chaining.
119-
*/
120-
load(): Api<T>;
121-
122-
/**
123-
* Renames the state previously identified in the call to `state()`.
124-
*
125-
* @returns Datatables Api for chaining.
126-
*/
127-
rename(): Api<T>;
128-
129-
/**
130-
* Saves the state previously identified in the call to `state()`.
131-
*
132-
* @returns Datatables Api for chaining.
133-
*/
134-
save(): Api<T>;
135-
}
136-
137-
interface StateRestoreMultiSubApi<T> extends Api<T> {
138-
/**
139-
* Removes all of the states that were previously identified in the call to `states()`.
140-
*
141-
* @returns Datatables Api for chaining.
142-
*/
143-
remove(): Api<T>;
144-
}

0 commit comments

Comments
 (0)