Skip to content

Commit a87a1af

Browse files
Add StateRestore DistRepos
0 parents  commit a87a1af

10 files changed

Lines changed: 462 additions & 0 deletions

License.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright SpryMedia Limited and other contributors
4+
http://datatables.net
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

Readme.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# StateRestore for DataTables with styling for [jQueryUI](http://jqueryui.com/)
2+
3+
This package contains a built distribution of the [StateRestore extension](https://datatables.net/extensions/staterestore) for [DataTables](https://datatables.net/) with styling for [jQueryUI](http://jqueryui.com/).
4+
5+
The StateRestore extension for DataTables builds on the `stateSave` option within DataTable's core. This allows users to save multiple different states and reload them at any time, not just at initialisation.
6+
7+
8+
## Installation
9+
10+
### Browser
11+
12+
For inclusion of this library using a standard `<script>` tag, rather than using this package, it is recommended that you use the [DataTables download builder](//datatables.net/download) which can create CDN or locally hosted packages for you, will all dependencies satisfied.
13+
14+
### npm
15+
16+
```
17+
npm install datatables.net-staterestore-jqui
18+
```
19+
20+
ES3 Syntax
21+
```
22+
var $ = require( 'jquery' );
23+
var dt = require( 'datatables.net-staterestore-jqui' )( window, $ );
24+
```
25+
26+
ES6 Syntax
27+
```
28+
import 'datatables.net-staterestore-jqui'
29+
```
30+
31+
### bower
32+
33+
```
34+
bower install --save datatables.net-staterestore-jqui
35+
```
36+
37+
38+
39+
## Documentation
40+
41+
Full documentation and examples for StateRestore can be found [on the website](https://datatables.net/extensions/staterestore).
42+
43+
44+
## Bug / Support
45+
46+
Support for DataTables is available through the [DataTables forums](//datatables.net/forums) and [commercial support options](//datatables.net/support) are available.
47+
48+
49+
### Contributing
50+
51+
If you are thinking of contributing code to DataTables, first of all, thank you! All fixes, patches and enhancements to DataTables are very warmly welcomed. This repository is a distribution repo, so patches and issues sent to this repo will not be accepted. Instead, please direct pull requests to the [DataTables/StateRestore](http://github.com/DataTables/StateRestore). For issues / bugs, please direct your questions to the [DataTables forums](//datatables.net/forums).
52+
53+
54+
## License
55+
56+
This software is released under the [MIT license](//datatables.net/license). You are free to use, modify and distribute this software, but all copyright information must remain.
57+

composer.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "null",
3+
"name": "datatables.net/datatables.net-staterestore-jqui",
4+
"description": "The StateRestore extension for DataTables builds on the `stateSave` option within DataTable's core. This allows users to save multiple different states and reload them at any time, not just at initialisation. This is StateRestore for DataTables with styling for [jQueryUI](http://jqueryui.com/)",
5+
"support": {
6+
"forum": "https://datatables.net/forums",
7+
"source": "https://github.com/DataTables/Dist-DataTables-StateRestore-jQueryUI"
8+
},
9+
"homepage": "http://www.datatables.net/",
10+
"authors": [
11+
{
12+
"name": "SpryMedia",
13+
"homepage": "https://datatables.net"
14+
}
15+
],
16+
"license": [
17+
"MIT"
18+
],
19+
"prefer-stable": true,
20+
"minimum-stability": "dev",
21+
"keywords": [
22+
"StateRestore",
23+
"stateSave",
24+
"state",
25+
"reload",
26+
"jQuery UI",
27+
"jQueryUI",
28+
"Datatables",
29+
"jQuery",
30+
"table"
31+
],
32+
"require": {
33+
"datatables.net/datatables.net-staterestore": ">=null",
34+
"datatables.net/datatables.net-jqui": ">=1.11.3"
35+
}
36+
}

css/stateRestore.jqueryui.css

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
div.dtsr-confirmation, div.dtsr-creation {
2+
position: fixed;
3+
top: 20%;
4+
left: 50%;
5+
width: 500px;
6+
background-color: white;
7+
margin-left: -250px;
8+
border-radius: 6px;
9+
box-shadow: 0 0 5px #555;
10+
border: 2px solid #444;
11+
z-index: 2003;
12+
box-sizing: border-box;
13+
padding: 1em;
14+
}
15+
div.dtsr-confirmation div.dtsr-confirmation-title-row, div.dtsr-creation div.dtsr-confirmation-title-row {
16+
text-align: left;
17+
}
18+
div.dtsr-confirmation div.dtsr-confirmation-title-row h2, div.dtsr-creation div.dtsr-confirmation-title-row h2 {
19+
border-bottom: 0px;
20+
margin-top: 0px;
21+
padding-top: 0px;
22+
}
23+
div.dtsr-confirmation div.dtsr-confirmation-text, div.dtsr-creation div.dtsr-confirmation-text {
24+
text-align: center;
25+
}
26+
div.dtsr-confirmation div.dtsr-confirmation-buttons, div.dtsr-creation div.dtsr-confirmation-buttons {
27+
text-align: right;
28+
margin-top: 1em;
29+
}
30+
div.dtsr-confirmation div.dtsr-confirmation-buttons button.dtsr-confirmation-button, div.dtsr-creation div.dtsr-confirmation-buttons button.dtsr-confirmation-button {
31+
margin: 0px;
32+
}
33+
div.dtsr-confirmation div.dtsr-creation-text, div.dtsr-creation div.dtsr-creation-text {
34+
text-align: left;
35+
padding: 0px;
36+
border: none;
37+
}
38+
div.dtsr-confirmation div.dtsr-creation-text span, div.dtsr-creation div.dtsr-creation-text span {
39+
font-size: 20px;
40+
}
41+
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-left, div.dtsr-confirmation div.dtsr-creation-form div.dtsr-right, div.dtsr-creation div.dtsr-creation-form div.dtsr-left, div.dtsr-creation div.dtsr-creation-form div.dtsr-right {
42+
display: inline-block;
43+
width: 50%;
44+
}
45+
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-left, div.dtsr-creation div.dtsr-creation-form div.dtsr-left {
46+
text-align: right;
47+
}
48+
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-right, div.dtsr-confirmation div.dtsr-creation-form div.dtsr-name-row, div.dtsr-creation div.dtsr-creation-form div.dtsr-right, div.dtsr-creation div.dtsr-creation-form div.dtsr-name-row {
49+
text-align: left;
50+
}
51+
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row label.dtsr-name-label, div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row label.dtsr-name-label {
52+
width: 33.3%;
53+
display: inline-block;
54+
text-align: right;
55+
padding-right: 15px;
56+
padding-left: 15px;
57+
}
58+
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row input.dtsr-name-input, div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row input.dtsr-name-input {
59+
width: 66.6%;
60+
display: inline-block;
61+
}
62+
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row input.dtsr-check-box, div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row input.dtsr-check-box {
63+
margin-left: 33.3%;
64+
margin-right: 14px;
65+
display: inline-block;
66+
}
67+
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row label.dtsr-toggle-title, div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row label.dtsr-toggle-title {
68+
margin-right: -33.3%;
69+
}
70+
div.dtsr-confirmation div.dtsr-confirmation-text, div.dtsr-creation div.dtsr-confirmation-text {
71+
text-align: left;
72+
}
73+
div.dtsr-confirmation div.dtsr-confirmation-text label.dtsr-name-label, div.dtsr-creation div.dtsr-confirmation-text label.dtsr-name-label {
74+
width: auto;
75+
display: inline-block;
76+
text-align: right;
77+
padding-right: 15px;
78+
}
79+
div.dtsr-confirmation div.dtsr-confirmation-text input.dtsr-name-input, div.dtsr-creation div.dtsr-confirmation-text input.dtsr-name-input {
80+
width: 66.6%;
81+
display: inline-block;
82+
}
83+
div.dtsr-confirmation div.dtsr-confirmation-text input.dtsr-check-box, div.dtsr-creation div.dtsr-confirmation-text input.dtsr-check-box {
84+
margin-left: 33.3%;
85+
margin-right: 14px;
86+
display: inline-block;
87+
}
88+
div.dtsr-confirmation div.dtsr-modal-foot, div.dtsr-creation div.dtsr-modal-foot {
89+
text-align: right;
90+
padding-top: 10px;
91+
}
92+
div.dtsr-confirmation span.dtsr-modal-error, div.dtsr-creation span.dtsr-modal-error {
93+
color: red;
94+
font-size: 0.9em;
95+
}
96+
97+
div.dtsr-creation {
98+
top: 10%;
99+
}
100+
101+
div.dtsr-form-row {
102+
padding: 10px;
103+
}
104+
105+
div.dtsr-check-row {
106+
padding-top: 0px;
107+
}
108+
109+
div.dtsr-creation-text {
110+
padding: 10px;
111+
}
112+
113+
div.dtsr-background {
114+
z-index: 2002;
115+
position: fixed;
116+
top: 0;
117+
left: 0;
118+
width: 100%;
119+
height: 100%;
120+
background: rgba(0, 0, 0, 0.7);
121+
background: radial-gradient(ellipse farthest-corner at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
122+
}
123+
124+
div.dt-button-collection h3 {
125+
text-align: center;
126+
margin-top: 4px;
127+
margin-bottom: 8px;
128+
font-size: 1.5em;
129+
white-space: nowrap;
130+
overflow: hidden;
131+
text-overflow: ellipsis;
132+
}
133+
div.dt-button-collection span.dtsr-emptyStates {
134+
border-radius: 5px;
135+
display: inline-block;
136+
line-height: 1.6em;
137+
white-space: nowrap;
138+
text-align: center;
139+
vertical-align: middle;
140+
width: 100%;
141+
padding-bottom: 3px;
142+
padding-top: 7px;
143+
}
144+
145+
div.dt-button-collection {
146+
z-index: 2002;
147+
}
148+
div.dt-button-collection div, div.dt-button-collection ul {
149+
background: none;
150+
}
151+
152+
span.dtsr-emptyStates {
153+
background: white;
154+
padding-top: 2px !important;
155+
}
156+
157+
div.dt-btn-split-wrapper {
158+
display: inline-block !important;
159+
width: 100%;
160+
}
161+
div.dt-btn-split-wrapper button.ui-button {
162+
display: inline-block !important;
163+
width: calc(100% - 24px);
164+
}
165+
div.dt-btn-split-wrapper button.dt-btn-split-drop {
166+
display: inline-block !important;
167+
width: 24px;
168+
}
169+
170+
div.dt-button-split-left {
171+
padding-bottom: 0px;
172+
}
173+
div.dt-button-split-left button.dt-btn-split-drop-button {
174+
width: 100%;
175+
display: block;
176+
margin-bottom: 8px;
177+
}
178+
179+
span.dtsr-confirmation-message {
180+
padding-right: 3px;
181+
}
182+
183+
div.dtsr-creation-form div.dtsr-form-row label.dtsr-name-label {
184+
width: 33.3%;
185+
display: inline-block;
186+
text-align: left !important;
187+
padding-right: 0px;
188+
padding-left: 0px;
189+
}
190+
div.dtsr-creation-form div.dtsr-form-row input.dtsr-name-input {
191+
width: 57.6% !important;
192+
display: inline-block;
193+
}
194+
div.dtsr-creation-form div.dtsr-form-row input.dtsr-check-box {
195+
margin-left: calc(33.3% + 30px) !important;
196+
margin-right: 14px;
197+
display: inline-block;
198+
position: relative;
199+
}
200+
div.dtsr-creation-form div.dtsr-form-row label.dtsr-toggle-title {
201+
margin-right: calc(-33.3% - 30px) !important;
202+
}

css/stateRestore.jqueryui.min.css

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

js/stateRestore.jqueryui.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*! Bootstrap integration for DataTables' StateRestore
2+
* ©2016 SpryMedia Ltd - datatables.net/license
3+
*/
4+
(function (factory) {
5+
if (typeof define === 'function' && define.amd) {
6+
// AMD
7+
define(['jquery', 'datatables.net-jq', 'datatables.net-staterestore'], function ($) {
8+
return factory($);
9+
});
10+
}
11+
else if (typeof exports === 'object') {
12+
// CommonJS
13+
module.exports = function (root, $) {
14+
if (!root) {
15+
root = window;
16+
}
17+
if (!$ || !$.fn.dataTable) {
18+
// eslint-disable-next-line @typescript-eslint/no-var-requires
19+
$ = require('datatables.net-jq')(root, $).$;
20+
}
21+
if (!$.fn.dataTable.StateRestore) {
22+
// eslint-disable-next-line @typescript-eslint/no-var-requires
23+
require('datatables.net-staterestore')(root, $);
24+
}
25+
return factory($);
26+
};
27+
}
28+
else {
29+
// Browser
30+
factory(jQuery);
31+
}
32+
}(function ($) {
33+
'use strict';
34+
var dataTable = $.fn.dataTable;
35+
$.extend(true, dataTable.StateRestoreCollection.classes, {
36+
checkBox: 'dtsr-check-box form-check-input',
37+
checkLabel: 'dtsr-check-label form-check-label',
38+
checkRow: 'dtsr-check-row form',
39+
creationButton: 'dtsr-creation-button ui-button ui-corner-all ui-widget',
40+
creationForm: 'dtsr-creation-form modal-body',
41+
creationText: 'dtsr-creation-text modal-header',
42+
creationTitle: 'dtsr-creation-title modal-title',
43+
nameInput: 'dtsr-name-input form-control',
44+
nameLabel: 'dtsr-name-label form-label',
45+
nameRow: 'dtsr-name-row medium-6 cell'
46+
});
47+
$.extend(true, dataTable.StateRestore.classes, {
48+
// eslint-disable-next-line max-len
49+
confirmationButton: 'dtsr-confirmation-button ui-button ui-state-default ui-button-text-only ui-corner-all ui-widget'
50+
});
51+
return dataTable.stateRestore;
52+
}));

js/stateRestore.jqueryui.min.js

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

0 commit comments

Comments
 (0)