Update to latest js components

This commit is contained in:
2024-12-17 16:18:29 +00:00
parent 6274bad976
commit 0ae4d44b70
204 changed files with 48323 additions and 42969 deletions

View File

@@ -0,0 +1,22 @@
MIT license
Copyright (c) 2019 SpryMedia Limited
http://datatables.net
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,37 @@
# StateRestore
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.
# Installation
The StateRestore extension is available on the [DataTables CDN](https://cdn.datatables.net/#StateRestore) and in the [download builder](/download). See the [documentation](http://datatables.net/extensions/staterestore/) for full details.
# NPM
You can also install it from [NPM](/download/npm/#StateRestore)
If you prefer to use a package manager such as NPM or Bower, distribution repositories are available with software built from this repository under the name `datatables.net-staterestore. Styling packages for Bootstrap, Foundation and other styling libraries are also available by adding a suffix to the package name.
Please see the DataTables [NPM](//datatables.net/download/npm) installation page for further information. The [DataTables installation manual](//datatables.net/manual/installation) also has details on how to use package managers with DataTables.
# Basic Usage
StateRestore is initialised by adding the `createState` and `savedStates` buttons into the DataTables [`buttons`](https://datatables.net/reference/option/buttons) option. Further options can be specified using these button's `config` property - see the documentation for details. For example:
```js
$(document).ready(function() {
$('#example').DataTable({
dom: 'Blfrtip',
buttons:['createState', 'savedStates']
});
});
```
# Documentation / Support
* [Documentation](https://datatables.net/extensions/staterestore/)
* [DataTables support forums](http://datatables.net/forums)
# GitHub
If you fancy getting involved with the development of StateRestore and help make it better, please refer to its [GitHub repo](https://github.com/DataTables/StateRestore)

View File

@@ -0,0 +1,200 @@
div.dtsr-confirmation,
div.dtsr-creation {
position: fixed;
top: 20%;
left: 50%;
width: 500px;
margin-left: -250px;
background-color: white;
border-radius: 0.75em;
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
z-index: 2003;
box-sizing: border-box;
padding: 2em;
div.dtsr-creation-text,
div.dtsr-confirmation-title-row {
text-align: left;
h2 {
padding-left: 0;
border-bottom: 0px;
margin-top: 0px;
padding-top: 0px;
margin-bottom: 1rem;
}
}
div.dtsr-confirmation-text {
text-align: center;
}
div.dtsr-modal-foot,
div.dtsr-confirmation-buttons {
text-align: right;
margin-top: 1em;
button {
margin: 0px;
}
}
div.dtsr-creation-text {
text-align: left;
padding: 0px;
border: none;
span {
font-size: 20px;
}
}
div.dtsr-creation-form {
div.dtsr-left, div.dtsr-right {
display: inline-block;
width: 50%;
}
div.dtsr-left {
text-align: right;
}
div.dtsr-right, div.dtsr-name-row {
text-align: left;
}
div.dtsr-form-row {
display: flex;
margin: 0.5em 0;
&:first-child {
margin-top: 1em;
margin-bottom: 1em;
}
&:last-child {
margin-bottom: 0;
}
label {
width: 25%;
padding-right: 1em;
text-align: right;
padding-top: 2px;
}
div.dtsr-input {
width: 75%;
div.dtsr-check-label {
margin-bottom: 0.5em;
input {
margin-right: 0.5em;
}
}
}
}
}
div.dtsr-confirmation-text {
text-align: left;
label.dtsr-name-label {
width: auto;
display: inline-block;
text-align: right;
padding-right: 15px;
}
input.dtsr-name-input {
width: 66.6%;
display: inline-block;
}
}
div.dtsr-modal-foot {
text-align: right;
padding-top: 10px;
}
span.dtsr-modal-error {
color: red;
font-size: 0.9em;
}
}
div.dtsr-creation {
top: 10%;
}
div.dtsr-check-row {
padding-top: 0px;
}
div.dtsr-popover-close {
position: absolute;
top: 10px;
right: 10px;
width: 22px;
height: 22px;
text-align: center;
border-radius: 3px;
cursor: pointer;
z-index: 12;
}
div.dtsr-background {
z-index: 2002;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
background: radial-gradient(ellipse farthest-corner at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
}
div.dt-button-collection {
h3 {
text-align: center;
margin-top: 4px;
margin-bottom: 8px;
font-size: 1.5em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
span.dtsr-emptyStates {
border-radius: 5px;
display: inline-block;
line-height: 1.6em;
white-space: nowrap;
text-align: center;
vertical-align: middle;
width:100%;
padding-bottom: 7px;
padding-top: 3px;
}
}
html.dark,
html[data-bs-theme="dark"] {
div.dtsr-confirmation,
div.dtsr-creation {
background-color: rgb(33, 37, 41);
border: 1px solid rgba(255, 255, 255, 0.15);
button {
color: inherit;
border: 1px solid rgba(255, 255, 255, 0.175);
background-color: rgb(47, 52, 56);
&:hover {
background-color: rgb(64, 69, 73);
}
}
}
}

View File

@@ -12,21 +12,6 @@ div.dtsr-creation {
box-sizing: border-box;
padding: 2em;
}
div.dtsr-confirmation button,
div.dtsr-creation button {
display: inline-block;
margin: 1em;
padding: 0.5em 1em;
border-radius: 0.5em;
border: 1px solid rgba(0, 0, 0, 0.175);
background-color: #f6f6f6;
text-align: left;
cursor: pointer;
}
div.dtsr-confirmation button:hover,
div.dtsr-creation button:hover {
background-color: #ebebeb;
}
div.dtsr-confirmation div.dtsr-creation-text,
div.dtsr-confirmation div.dtsr-confirmation-title-row,
div.dtsr-creation div.dtsr-creation-text,
@@ -37,6 +22,7 @@ div.dtsr-confirmation div.dtsr-creation-text h2,
div.dtsr-confirmation div.dtsr-confirmation-title-row h2,
div.dtsr-creation div.dtsr-creation-text h2,
div.dtsr-creation div.dtsr-confirmation-title-row h2 {
padding-left: 0;
border-bottom: 0px;
margin-top: 0px;
padding-top: 0px;
@@ -86,34 +72,36 @@ div.dtsr-creation div.dtsr-creation-form div.dtsr-name-row {
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row {
display: flex;
margin: 0.5em 0;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:first-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:first-child {
margin-top: 0;
margin-top: 1em;
margin-bottom: 1em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:last-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:last-child {
margin-bottom: 0;
}
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 {
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row label {
width: 25%;
display: inline-block;
padding-right: 1em;
text-align: right;
padding-right: 15px;
padding-left: 15px;
padding-top: 2px;
}
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 {
width: 66.6%;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input {
width: 75%;
}
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 {
margin-left: 25%;
margin-right: 14px;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label {
margin-bottom: 0.5em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input {
margin-right: 0.5em;
}
div.dtsr-confirmation div.dtsr-confirmation-text,
div.dtsr-creation div.dtsr-confirmation-text {
@@ -131,12 +119,6 @@ div.dtsr-creation div.dtsr-confirmation-text input.dtsr-name-input {
width: 66.6%;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-confirmation-text input.dtsr-check-box,
div.dtsr-creation div.dtsr-confirmation-text input.dtsr-check-box {
margin-left: 33.3%;
margin-right: 14px;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-modal-foot,
div.dtsr-creation div.dtsr-modal-foot {
text-align: right;
@@ -226,39 +208,6 @@ span.dtsr-check-label {
padding-left: 3px;
}
div.dt-button-collection h3 {
margin-top: 8px;
}
div.dt-button-collection ul.dropdown-menu {
padding-top: 0px;
}
div.dt-button-collection ul.dropdown-menu div.dt-btn-split-wrapper {
width: 96% !important;
margin-left: 4px !important;
margin-top: 4px;
}
div.dt-button-collection ul.dropdown-menu div.dt-btn-split-wrapper button.btn {
width: calc(100% - 32px);
}
div.dt-button-collection ul.dropdown-menu div.dt-btn-split-wrapper button.dt-btn-split-drop {
width: 32px;
}
div.dt-button-split-left div.dropdown-menu {
padding-left: 4px;
padding-right: 4px;
padding-top: 0px;
}
div.dt-button-split-left div.dropdown-menu button.dt-btn-split-drop-button {
background-color: white;
border: 1px solid rgb(204, 204, 204);
border-radius: 4px;
margin-top: 4px;
}
div.dt-button-split-left div.dropdown-menu button.dt-btn-split-drop-button:hover {
background-color: #f5f5f5;
}
input.dtsr-input {
display: inline-block;
width: auto;

File diff suppressed because one or more lines are too long

View File

@@ -12,21 +12,6 @@ div.dtsr-creation {
box-sizing: border-box;
padding: 2em;
}
div.dtsr-confirmation button,
div.dtsr-creation button {
display: inline-block;
margin: 1em;
padding: 0.5em 1em;
border-radius: 0.5em;
border: 1px solid rgba(0, 0, 0, 0.175);
background-color: #f6f6f6;
text-align: left;
cursor: pointer;
}
div.dtsr-confirmation button:hover,
div.dtsr-creation button:hover {
background-color: #ebebeb;
}
div.dtsr-confirmation div.dtsr-creation-text,
div.dtsr-confirmation div.dtsr-confirmation-title-row,
div.dtsr-creation div.dtsr-creation-text,
@@ -37,6 +22,7 @@ div.dtsr-confirmation div.dtsr-creation-text h2,
div.dtsr-confirmation div.dtsr-confirmation-title-row h2,
div.dtsr-creation div.dtsr-creation-text h2,
div.dtsr-creation div.dtsr-confirmation-title-row h2 {
padding-left: 0;
border-bottom: 0px;
margin-top: 0px;
padding-top: 0px;
@@ -86,34 +72,36 @@ div.dtsr-creation div.dtsr-creation-form div.dtsr-name-row {
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row {
display: flex;
margin: 0.5em 0;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:first-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:first-child {
margin-top: 0;
margin-top: 1em;
margin-bottom: 1em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:last-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:last-child {
margin-bottom: 0;
}
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 {
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row label {
width: 25%;
display: inline-block;
padding-right: 1em;
text-align: right;
padding-right: 15px;
padding-left: 15px;
padding-top: 2px;
}
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 {
width: 66.6%;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input {
width: 75%;
}
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 {
margin-left: 25%;
margin-right: 14px;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label {
margin-bottom: 0.5em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input {
margin-right: 0.5em;
}
div.dtsr-confirmation div.dtsr-confirmation-text,
div.dtsr-creation div.dtsr-confirmation-text {
@@ -131,12 +119,6 @@ div.dtsr-creation div.dtsr-confirmation-text input.dtsr-name-input {
width: 66.6%;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-confirmation-text input.dtsr-check-box,
div.dtsr-creation div.dtsr-confirmation-text input.dtsr-check-box {
margin-left: 33.3%;
margin-right: 14px;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-modal-foot,
div.dtsr-creation div.dtsr-modal-foot {
text-align: right;
@@ -222,35 +204,6 @@ html[data-bs-theme=dark] div.dtsr-creation button:hover {
background-color: rgb(64, 69, 73);
}
div.dt-button-collection h3 {
margin-top: 8px;
font-size: 1.5rem;
}
div.dt-button-collection div.dropdown-menu {
padding-top: 0px;
padding-bottom: 4px;
padding-left: 4px;
padding-right: 4px;
}
div.dt-button-collection div.dropdown-menu div.dt-btn-split-wrapper {
margin-top: 4px;
}
div.dt-button-split-left div.dropdown-menu {
padding-right: 4px;
padding-left: 4px;
padding-bottom: 4px;
}
div.dt-button-split-left div.dropdown-menu button.dt-btn-split-drop-button {
color: rgb(255, 255, 255);
border-radius: 4px;
background-color: rgb(107, 117, 125);
margin-top: 4px;
}
div.dt-button-split-left div.dropdown-menu button.dt-btn-split-drop-button:hover {
background-color: rgb(90, 98, 104);
}
input.dtsr-input {
display: inline-block;
width: auto;
@@ -268,12 +221,6 @@ div.dtsr-creation-form div.dtsr-form-row input.dtsr-name-input {
width: 66.6%;
display: inline-block;
}
div.dtsr-creation-form div.dtsr-form-row input.dtsr-check-box {
margin-left: 33.3%;
margin-right: 14px;
display: inline-block;
position: relative;
}
div.dtsr-confirmation-text {
margin-top: 1.5em;
@@ -289,9 +236,3 @@ div.dtsr-confirmation-text input.dtsr-name-input {
width: 66.6%;
display: inline-block;
}
div.dtsr-confirmation-text input.dtsr-check-box {
margin-left: 33.3%;
margin-right: 14px;
display: inline-block;
position: relative;
}

File diff suppressed because one or more lines are too long

View File

@@ -12,21 +12,6 @@ div.dtsr-creation {
box-sizing: border-box;
padding: 2em;
}
div.dtsr-confirmation button,
div.dtsr-creation button {
display: inline-block;
margin: 1em;
padding: 0.5em 1em;
border-radius: 0.5em;
border: 1px solid rgba(0, 0, 0, 0.175);
background-color: #f6f6f6;
text-align: left;
cursor: pointer;
}
div.dtsr-confirmation button:hover,
div.dtsr-creation button:hover {
background-color: #ebebeb;
}
div.dtsr-confirmation div.dtsr-creation-text,
div.dtsr-confirmation div.dtsr-confirmation-title-row,
div.dtsr-creation div.dtsr-creation-text,
@@ -37,6 +22,7 @@ div.dtsr-confirmation div.dtsr-creation-text h2,
div.dtsr-confirmation div.dtsr-confirmation-title-row h2,
div.dtsr-creation div.dtsr-creation-text h2,
div.dtsr-creation div.dtsr-confirmation-title-row h2 {
padding-left: 0;
border-bottom: 0px;
margin-top: 0px;
padding-top: 0px;
@@ -86,34 +72,36 @@ div.dtsr-creation div.dtsr-creation-form div.dtsr-name-row {
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row {
display: flex;
margin: 0.5em 0;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:first-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:first-child {
margin-top: 0;
margin-top: 1em;
margin-bottom: 1em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:last-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:last-child {
margin-bottom: 0;
}
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 {
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row label {
width: 25%;
display: inline-block;
padding-right: 1em;
text-align: right;
padding-right: 15px;
padding-left: 15px;
padding-top: 2px;
}
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 {
width: 66.6%;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input {
width: 75%;
}
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 {
margin-left: 25%;
margin-right: 14px;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label {
margin-bottom: 0.5em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input {
margin-right: 0.5em;
}
div.dtsr-confirmation div.dtsr-confirmation-text,
div.dtsr-creation div.dtsr-confirmation-text {
@@ -131,12 +119,6 @@ div.dtsr-creation div.dtsr-confirmation-text input.dtsr-name-input {
width: 66.6%;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-confirmation-text input.dtsr-check-box,
div.dtsr-creation div.dtsr-confirmation-text input.dtsr-check-box {
margin-left: 33.3%;
margin-right: 14px;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-modal-foot,
div.dtsr-creation div.dtsr-modal-foot {
text-align: right;
@@ -226,43 +208,6 @@ span.dtsr-check-label {
padding-left: 3px;
}
div.dt-button-collection h3 {
margin-top: 8px;
}
div.dt-button-collection div.dropdown-menu {
padding-top: 0px;
padding-bottom: 4px;
}
div.dt-button-collection div.dropdown-menu div.dt-btn-split-wrapper {
margin-top: 4px;
padding-left: 3px;
padding-right: 3px;
}
div.dt-button-collection div.dropdown-menu div.dt-btn-split-wrapper button.btn {
width: calc(100% - 30px);
}
div.dt-button-collection div.dropdown-menu div.dt-btn-split-wrapper button.dt-btn-split-drop {
width: 30px;
}
div.dt-button-collection div.dropdown-menu button.dt-btn-split-drop-button {
margin-left: -2px;
margin-right: -2px;
}
div.dt-button-split-left div.dropdown-menu {
padding-left: 4px;
padding-right: 4px;
}
div.dt-button-split-left div.dropdown-menu button.dt-btn-split-drop-button {
color: rgb(255, 255, 255);
border-radius: 4px;
background-color: rgb(107, 117, 125);
margin-top: 4px;
}
div.dt-button-split-left div.dropdown-menu button.dt-btn-split-drop-button:hover {
background-color: rgb(90, 98, 104);
}
input.dtsr-input {
margin-left: 3px;
display: inline-block;
@@ -283,14 +228,6 @@ div.dtsr-creation-form div.dtsr-form-row input.dtsr-name-input {
width: 66.6%;
display: inline-block;
}
div.dtsr-creation-form div.dtsr-form-row input.dtsr-check-box {
margin-left: 33.3%;
margin-right: 14px;
display: inline-block;
position: relative;
float: none;
line-height: normal;
}
div.dtsr-confirmation-text {
margin-top: 1.5em;

File diff suppressed because one or more lines are too long

View File

@@ -12,21 +12,6 @@ div.dtsr-creation {
box-sizing: border-box;
padding: 2em;
}
div.dtsr-confirmation button,
div.dtsr-creation button {
display: inline-block;
margin: 1em;
padding: 0.5em 1em;
border-radius: 0.5em;
border: 1px solid rgba(0, 0, 0, 0.175);
background-color: #f6f6f6;
text-align: left;
cursor: pointer;
}
div.dtsr-confirmation button:hover,
div.dtsr-creation button:hover {
background-color: #ebebeb;
}
div.dtsr-confirmation div.dtsr-creation-text,
div.dtsr-confirmation div.dtsr-confirmation-title-row,
div.dtsr-creation div.dtsr-creation-text,
@@ -37,6 +22,7 @@ div.dtsr-confirmation div.dtsr-creation-text h2,
div.dtsr-confirmation div.dtsr-confirmation-title-row h2,
div.dtsr-creation div.dtsr-creation-text h2,
div.dtsr-creation div.dtsr-confirmation-title-row h2 {
padding-left: 0;
border-bottom: 0px;
margin-top: 0px;
padding-top: 0px;
@@ -86,34 +72,36 @@ div.dtsr-creation div.dtsr-creation-form div.dtsr-name-row {
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row {
display: flex;
margin: 0.5em 0;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:first-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:first-child {
margin-top: 0;
margin-top: 1em;
margin-bottom: 1em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:last-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:last-child {
margin-bottom: 0;
}
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 {
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row label {
width: 25%;
display: inline-block;
padding-right: 1em;
text-align: right;
padding-right: 15px;
padding-left: 15px;
padding-top: 2px;
}
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 {
width: 66.6%;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input {
width: 75%;
}
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 {
margin-left: 25%;
margin-right: 14px;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label {
margin-bottom: 0.5em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input {
margin-right: 0.5em;
}
div.dtsr-confirmation div.dtsr-confirmation-text,
div.dtsr-creation div.dtsr-confirmation-text {
@@ -131,12 +119,6 @@ div.dtsr-creation div.dtsr-confirmation-text input.dtsr-name-input {
width: 66.6%;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-confirmation-text input.dtsr-check-box,
div.dtsr-creation div.dtsr-confirmation-text input.dtsr-check-box {
margin-left: 33.3%;
margin-right: 14px;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-modal-foot,
div.dtsr-creation div.dtsr-modal-foot {
text-align: right;
@@ -250,38 +232,6 @@ span.dtsr-confirmation-message {
line-height: 2.5em;
}
div.dt-button-collection {
width: auto;
padding-left: 0.5rem;
padding-right: 0.5rem;
}
div.dt-button-collection div.dropdown-content {
width: 100%;
padding-top: 0.5rem;
padding-bottom: 0px;
}
div.dt-button-collection div.dropdown-content div.dropdown-trigger {
margin-bottom: 0px !important;
padding-right: 0.5rem;
padding-left: 0.5rem;
}
div.dt-button-collection div.dropdown-content div.dropdown-trigger button.dt-button {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
div.dt-button-split-left div.dropdown-content {
padding-left: 0.5rem;
padding-right: 0.5rem;
padding-top: 1rem;
padding-bottom: 0.5rem;
width: 100%;
}
div.dt-button-split-left div.dropdown-content button.dt-btn-split-drop-button {
width: 100%;
margin-top: 0.5rem;
}
div.dtsr-form-row label.dtsr-name-label, div.dtsr-confirmation-text label.dtsr-name-label {
line-height: 1.5;
padding-top: 10px;

File diff suppressed because one or more lines are too long

View File

@@ -12,21 +12,6 @@ div.dtsr-creation {
box-sizing: border-box;
padding: 2em;
}
div.dtsr-confirmation button,
div.dtsr-creation button {
display: inline-block;
margin: 1em;
padding: 0.5em 1em;
border-radius: 0.5em;
border: 1px solid rgba(0, 0, 0, 0.175);
background-color: #f6f6f6;
text-align: left;
cursor: pointer;
}
div.dtsr-confirmation button:hover,
div.dtsr-creation button:hover {
background-color: #ebebeb;
}
div.dtsr-confirmation div.dtsr-creation-text,
div.dtsr-confirmation div.dtsr-confirmation-title-row,
div.dtsr-creation div.dtsr-creation-text,
@@ -37,6 +22,7 @@ div.dtsr-confirmation div.dtsr-creation-text h2,
div.dtsr-confirmation div.dtsr-confirmation-title-row h2,
div.dtsr-creation div.dtsr-creation-text h2,
div.dtsr-creation div.dtsr-confirmation-title-row h2 {
padding-left: 0;
border-bottom: 0px;
margin-top: 0px;
padding-top: 0px;
@@ -86,34 +72,36 @@ div.dtsr-creation div.dtsr-creation-form div.dtsr-name-row {
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row {
display: flex;
margin: 0.5em 0;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:first-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:first-child {
margin-top: 0;
margin-top: 1em;
margin-bottom: 1em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:last-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:last-child {
margin-bottom: 0;
}
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 {
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row label {
width: 25%;
display: inline-block;
padding-right: 1em;
text-align: right;
padding-right: 15px;
padding-left: 15px;
padding-top: 2px;
}
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 {
width: 66.6%;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input {
width: 75%;
}
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 {
margin-left: 25%;
margin-right: 14px;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label {
margin-bottom: 0.5em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input {
margin-right: 0.5em;
}
div.dtsr-confirmation div.dtsr-confirmation-text,
div.dtsr-creation div.dtsr-confirmation-text {
@@ -131,12 +119,6 @@ div.dtsr-creation div.dtsr-confirmation-text input.dtsr-name-input {
width: 66.6%;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-confirmation-text input.dtsr-check-box,
div.dtsr-creation div.dtsr-confirmation-text input.dtsr-check-box {
margin-left: 33.3%;
margin-right: 14px;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-modal-foot,
div.dtsr-creation div.dtsr-modal-foot {
text-align: right;
@@ -222,19 +204,30 @@ html[data-bs-theme=dark] div.dtsr-creation button:hover {
background-color: rgb(64, 69, 73);
}
div.dt-button-collection h3 {
font-size: 1.1em;
div.dtsr-confirmation h2,
div.dtsr-creation h2 {
font-size: 24px;
}
div.dtsr-creation-form div.dtsr-form-row input.dtsr-name-input {
width: 57% !important;
padding: 5px 4px;
border: 1px solid #aaa;
border-radius: 3px;
div.dtsr-confirmation input[type=text],
div.dtsr-creation input[type=text] {
padding: 3px;
}
div.dtsr-creation-form div.dtsr-form-row input.dtsr-check-box {
margin-left: calc(25% + 30px) !important;
div.dtsr-confirmation div.dtsr-creation-text,
div.dtsr-creation div.dtsr-creation-text {
margin-bottom: 2em;
}
div.dtsr-creation-form div.dtsr-form-row label.dtsr-toggle-title {
margin-right: calc(-25% - 30px) !important;
div.dtsr-confirmation button,
div.dtsr-creation button {
display: inline-block;
margin: 1em;
padding: 0.5em 1em;
border-radius: 0.5em;
border: 1px solid rgba(0, 0, 0, 0.175);
background-color: #f6f6f6;
text-align: left;
cursor: pointer;
}
div.dtsr-confirmation button:hover,
div.dtsr-creation button:hover {
background-color: #ebebeb;
}

File diff suppressed because one or more lines are too long

View File

@@ -12,21 +12,6 @@ div.dtsr-creation {
box-sizing: border-box;
padding: 2em;
}
div.dtsr-confirmation button,
div.dtsr-creation button {
display: inline-block;
margin: 1em;
padding: 0.5em 1em;
border-radius: 0.5em;
border: 1px solid rgba(0, 0, 0, 0.175);
background-color: #f6f6f6;
text-align: left;
cursor: pointer;
}
div.dtsr-confirmation button:hover,
div.dtsr-creation button:hover {
background-color: #ebebeb;
}
div.dtsr-confirmation div.dtsr-creation-text,
div.dtsr-confirmation div.dtsr-confirmation-title-row,
div.dtsr-creation div.dtsr-creation-text,
@@ -37,6 +22,7 @@ div.dtsr-confirmation div.dtsr-creation-text h2,
div.dtsr-confirmation div.dtsr-confirmation-title-row h2,
div.dtsr-creation div.dtsr-creation-text h2,
div.dtsr-creation div.dtsr-confirmation-title-row h2 {
padding-left: 0;
border-bottom: 0px;
margin-top: 0px;
padding-top: 0px;
@@ -86,34 +72,36 @@ div.dtsr-creation div.dtsr-creation-form div.dtsr-name-row {
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row {
display: flex;
margin: 0.5em 0;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:first-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:first-child {
margin-top: 0;
margin-top: 1em;
margin-bottom: 1em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:last-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:last-child {
margin-bottom: 0;
}
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 {
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row label {
width: 25%;
display: inline-block;
padding-right: 1em;
text-align: right;
padding-right: 15px;
padding-left: 15px;
padding-top: 2px;
}
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 {
width: 66.6%;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input {
width: 75%;
}
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 {
margin-left: 25%;
margin-right: 14px;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label {
margin-bottom: 0.5em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input {
margin-right: 0.5em;
}
div.dtsr-confirmation div.dtsr-confirmation-text,
div.dtsr-creation div.dtsr-confirmation-text {
@@ -131,12 +119,6 @@ div.dtsr-creation div.dtsr-confirmation-text input.dtsr-name-input {
width: 66.6%;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-confirmation-text input.dtsr-check-box,
div.dtsr-creation div.dtsr-confirmation-text input.dtsr-check-box {
margin-left: 33.3%;
margin-right: 14px;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-modal-foot,
div.dtsr-creation div.dtsr-modal-foot {
text-align: right;
@@ -234,40 +216,6 @@ button.dtsr-creation-button {
margin-bottom: 0px;
}
div.dt-button-collection {
width: 150px;
}
div.dt-button-collection h3 {
font-size: 1.35rem;
}
div.dt-button-collection div.dropdown-pane {
width: 150px;
padding: 4px !important;
padding-bottom: 0px !important;
}
div.dt-button-collection div.dropdown-pane div.dt-btn-split-wrapper {
margin-bottom: 4px;
}
div.dt-button-collection div.dropdown-pane div.dt-btn-split-wrapper a.button {
width: calc(100% - 43px);
flex: none !important;
height: 41px;
}
div.dt-button-collection div.dropdown-pane div.dt-btn-split-wrapper button.dt-btn-split-drop {
width: 43px;
flex: none !important;
margin-left: -1px;
height: 41px;
}
div.dt-button-collection div.dropdown-pane button.dt-btn-split-drop-button {
width: 100%;
margin-bottom: 4px;
}
div.dt-button-split-left div.dropdown-pane {
padding-bottom: 4px !important;
}
input.dtsr-input {
display: inline-block;
width: auto;

File diff suppressed because one or more lines are too long

View File

@@ -12,21 +12,6 @@ div.dtsr-creation {
box-sizing: border-box;
padding: 2em;
}
div.dtsr-confirmation button,
div.dtsr-creation button {
display: inline-block;
margin: 1em;
padding: 0.5em 1em;
border-radius: 0.5em;
border: 1px solid rgba(0, 0, 0, 0.175);
background-color: #f6f6f6;
text-align: left;
cursor: pointer;
}
div.dtsr-confirmation button:hover,
div.dtsr-creation button:hover {
background-color: #ebebeb;
}
div.dtsr-confirmation div.dtsr-creation-text,
div.dtsr-confirmation div.dtsr-confirmation-title-row,
div.dtsr-creation div.dtsr-creation-text,
@@ -37,6 +22,7 @@ div.dtsr-confirmation div.dtsr-creation-text h2,
div.dtsr-confirmation div.dtsr-confirmation-title-row h2,
div.dtsr-creation div.dtsr-creation-text h2,
div.dtsr-creation div.dtsr-confirmation-title-row h2 {
padding-left: 0;
border-bottom: 0px;
margin-top: 0px;
padding-top: 0px;
@@ -86,34 +72,36 @@ div.dtsr-creation div.dtsr-creation-form div.dtsr-name-row {
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row {
display: flex;
margin: 0.5em 0;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:first-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:first-child {
margin-top: 0;
margin-top: 1em;
margin-bottom: 1em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:last-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:last-child {
margin-bottom: 0;
}
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 {
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row label {
width: 25%;
display: inline-block;
padding-right: 1em;
text-align: right;
padding-right: 15px;
padding-left: 15px;
padding-top: 2px;
}
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 {
width: 66.6%;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input {
width: 75%;
}
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 {
margin-left: 25%;
margin-right: 14px;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label {
margin-bottom: 0.5em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input {
margin-right: 0.5em;
}
div.dtsr-confirmation div.dtsr-confirmation-text,
div.dtsr-creation div.dtsr-confirmation-text {
@@ -131,12 +119,6 @@ div.dtsr-creation div.dtsr-confirmation-text input.dtsr-name-input {
width: 66.6%;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-confirmation-text input.dtsr-check-box,
div.dtsr-creation div.dtsr-confirmation-text input.dtsr-check-box {
margin-left: 33.3%;
margin-right: 14px;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-modal-foot,
div.dtsr-creation div.dtsr-modal-foot {
text-align: right;
@@ -221,62 +203,3 @@ html[data-bs-theme=dark] div.dtsr-confirmation button:hover,
html[data-bs-theme=dark] div.dtsr-creation button:hover {
background-color: rgb(64, 69, 73);
}
div.dt-button-collection {
z-index: 2002;
}
div.dt-button-collection div, div.dt-button-collection ul {
background: none;
}
span.dtsr-emptyStates {
background: white;
padding-top: 2px !important;
}
div.dt-btn-split-wrapper {
display: inline-block !important;
width: 100%;
}
div.dt-btn-split-wrapper button.ui-button {
display: inline-block !important;
width: calc(100% - 24px);
}
div.dt-btn-split-wrapper button.dt-btn-split-drop {
display: inline-block !important;
width: 24px;
}
div.dt-button-split-left {
padding-bottom: 0px;
}
div.dt-button-split-left button.dt-btn-split-drop-button {
width: 100%;
display: block;
margin-bottom: 8px;
}
span.dtsr-confirmation-message {
padding-right: 3px;
}
div.dtsr-creation-form div.dtsr-form-row label.dtsr-name-label {
width: 33.3%;
display: inline-block;
text-align: left !important;
padding-right: 0px;
padding-left: 0px;
}
div.dtsr-creation-form div.dtsr-form-row input.dtsr-name-input {
width: 57.6% !important;
display: inline-block;
}
div.dtsr-creation-form div.dtsr-form-row input.dtsr-check-box {
margin-left: calc(33.3% + 30px) !important;
margin-right: 14px;
display: inline-block;
position: relative;
}
div.dtsr-creation-form div.dtsr-form-row label.dtsr-toggle-title {
margin-right: calc(-33.3% - 30px) !important;
}

File diff suppressed because one or more lines are too long

View File

@@ -12,21 +12,6 @@ div.dtsr-creation {
box-sizing: border-box;
padding: 2em;
}
div.dtsr-confirmation button,
div.dtsr-creation button {
display: inline-block;
margin: 1em;
padding: 0.5em 1em;
border-radius: 0.5em;
border: 1px solid rgba(0, 0, 0, 0.175);
background-color: #f6f6f6;
text-align: left;
cursor: pointer;
}
div.dtsr-confirmation button:hover,
div.dtsr-creation button:hover {
background-color: #ebebeb;
}
div.dtsr-confirmation div.dtsr-creation-text,
div.dtsr-confirmation div.dtsr-confirmation-title-row,
div.dtsr-creation div.dtsr-creation-text,
@@ -37,6 +22,7 @@ div.dtsr-confirmation div.dtsr-creation-text h2,
div.dtsr-confirmation div.dtsr-confirmation-title-row h2,
div.dtsr-creation div.dtsr-creation-text h2,
div.dtsr-creation div.dtsr-confirmation-title-row h2 {
padding-left: 0;
border-bottom: 0px;
margin-top: 0px;
padding-top: 0px;
@@ -86,34 +72,36 @@ div.dtsr-creation div.dtsr-creation-form div.dtsr-name-row {
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row {
display: flex;
margin: 0.5em 0;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:first-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:first-child {
margin-top: 0;
margin-top: 1em;
margin-bottom: 1em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row:last-child,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row:last-child {
margin-bottom: 0;
}
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 {
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row label {
width: 25%;
display: inline-block;
padding-right: 1em;
text-align: right;
padding-right: 15px;
padding-left: 15px;
padding-top: 2px;
}
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 {
width: 66.6%;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input {
width: 75%;
}
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 {
margin-left: 25%;
margin-right: 14px;
display: inline-block;
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label {
margin-bottom: 0.5em;
}
div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input,
div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row div.dtsr-input div.dtsr-check-label input {
margin-right: 0.5em;
}
div.dtsr-confirmation div.dtsr-confirmation-text,
div.dtsr-creation div.dtsr-confirmation-text {
@@ -131,12 +119,6 @@ div.dtsr-creation div.dtsr-confirmation-text input.dtsr-name-input {
width: 66.6%;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-confirmation-text input.dtsr-check-box,
div.dtsr-creation div.dtsr-confirmation-text input.dtsr-check-box {
margin-left: 33.3%;
margin-right: 14px;
display: inline-block;
}
div.dtsr-confirmation div.dtsr-modal-foot,
div.dtsr-creation div.dtsr-modal-foot {
text-align: right;
@@ -240,25 +222,6 @@ span.dtsr-confirmation-message {
font-size: 1rem;
}
div.dt-btn-split-wrapper {
background-color: white !important;
}
div.dt-btn-split-wrapper button.button {
width: calc(100% - 36px) !important;
margin: 0px !important;
display: inline-block !important;
border-top-left-radius: 0.28571429rem !important;
border-bottom-left-radius: 0.28571429rem !important;
border-top-right-radius: 0px !important;
}
div.dt-btn-split-wrapper button.dt-btn-split-drop {
border-top-right-radius: 0.28571429rem !important;
border-bottom-right-radius: 0.28571429rem !important;
border-top-left-radius: 0px !important;
border-bottom-left-radius: 0px !important;
width: 36px !important;
}
span.dtsr-emptyStates {
font-size: 1rem;
padding: 5px !important;
@@ -307,24 +270,6 @@ div.dtsr-form-row label.dtsr-name-label, div.dtsr-confirmation-text label.dtsr-n
padding-top: 5px;
}
div.dtsr-confirmation-text, div.dtsr-creation-form {
margin-top: 1.5em;
width: 100%;
}
div.dtsr-confirmation-text label.dtsr-name-label, div.dtsr-creation-form label.dtsr-name-label {
width: 33.3%;
display: inline-block;
text-align: left !important;
padding-right: 15px;
padding-left: 15px;
}
div.dtsr-confirmation-text input.dtsr-name-input, div.dtsr-creation-form input.dtsr-name-input {
width: 66.6%;
display: inline-block;
}
div.dtsr-confirmation-text input.dtsr-check-box, div.dtsr-creation-form input.dtsr-check-box {
margin-left: 33.3%;
margin-right: 14px;
display: inline-block;
position: relative;
div.dtsr-creation {
padding: 1em;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
"stateRestore": {
"Scroll and Order 3": {"start":1046,"length":54,"order":[[2,"asc"]],"scroller":{"topRow":1069.1081081081081,"baseScrollTop":39557,"baseRowTop":1069.1081081081081,"scrollTop":39557},"childRows":[],"stateRestore":{"state":"State 1"}}
}

View File

@@ -0,0 +1,517 @@
{
"data": [
{
"id": "1",
"name": "Tiger Nixon",
"position": "System Architect",
"salary": "$320,800",
"start_date": "2011/04/25",
"office": "Edinburgh",
"extn": "5421"
},
{
"id": "2",
"name": "Garrett Winters",
"position": "Accountant",
"salary": "$170,750",
"start_date": "2011/07/25",
"office": "Tokyo",
"extn": "8422"
},
{
"id": "3",
"name": "Ashton Cox",
"position": "Junior Technical Author",
"salary": "$86,000",
"start_date": "2009/01/12",
"office": "San Francisco",
"extn": "1562"
},
{
"id": "4",
"name": "Cedric Kelly",
"position": "Senior Javascript Developer",
"salary": "$433,060",
"start_date": "2012/03/29",
"office": "Edinburgh",
"extn": "6224"
},
{
"id": "5",
"name": "Airi Satou",
"position": "Accountant",
"salary": "$162,700",
"start_date": "2008/11/28",
"office": "Tokyo",
"extn": "5407"
},
{
"id": "6",
"name": "Brielle Williamson",
"position": "Integration Specialist",
"salary": "$372,000",
"start_date": "2012/12/02",
"office": "New York",
"extn": "4804"
},
{
"id": "7",
"name": "Herrod Chandler",
"position": "Sales Assistant",
"salary": "$137,500",
"start_date": "2012/08/06",
"office": "San Francisco",
"extn": "9608"
},
{
"id": "8",
"name": "Rhona Davidson",
"position": "Integration Specialist",
"salary": "$327,900",
"start_date": "2010/10/14",
"office": "Tokyo",
"extn": "6200"
},
{
"id": "9",
"name": "Colleen Hurst",
"position": "Javascript Developer",
"salary": "$205,500",
"start_date": "2009/09/15",
"office": "San Francisco",
"extn": "2360"
},
{
"id": "10",
"name": "Sonya Frost",
"position": "Software Engineer",
"salary": "$103,600",
"start_date": "2008/12/13",
"office": "Edinburgh",
"extn": "1667"
},
{
"id": "11",
"name": "Jena Gaines",
"position": "Office Manager",
"salary": "$90,560",
"start_date": "2008/12/19",
"office": "London",
"extn": "3814"
},
{
"id": "12",
"name": "Quinn Flynn",
"position": "Support Lead",
"salary": "$342,000",
"start_date": "2013/03/03",
"office": "Edinburgh",
"extn": "9497"
},
{
"id": "13",
"name": "Charde Marshall",
"position": "Regional Director",
"salary": "$470,600",
"start_date": "2008/10/16",
"office": "San Francisco",
"extn": "6741"
},
{
"id": "14",
"name": "Haley Kennedy",
"position": "Senior Marketing Designer",
"salary": "$313,500",
"start_date": "2012/12/18",
"office": "London",
"extn": "3597"
},
{
"id": "15",
"name": "Tatyana Fitzpatrick",
"position": "Regional Director",
"salary": "$385,750",
"start_date": "2010/03/17",
"office": "London",
"extn": "1965"
},
{
"id": "16",
"name": "Michael Silva",
"position": "Marketing Designer",
"salary": "$198,500",
"start_date": "2012/11/27",
"office": "London",
"extn": "1581"
},
{
"id": "17",
"name": "Paul Byrd",
"position": "Chief Financial Officer (CFO)",
"salary": "$725,000",
"start_date": "2010/06/09",
"office": "New York",
"extn": "3059"
},
{
"id": "18",
"name": "Gloria Little",
"position": "Systems Administrator",
"salary": "$237,500",
"start_date": "2009/04/10",
"office": "New York",
"extn": "1721"
},
{
"id": "19",
"name": "Bradley Greer",
"position": "Software Engineer",
"salary": "$132,000",
"start_date": "2012/10/13",
"office": "London",
"extn": "2558"
},
{
"id": "20",
"name": "Dai Rios",
"position": "Personnel Lead",
"salary": "$217,500",
"start_date": "2012/09/26",
"office": "Edinburgh",
"extn": "2290"
},
{
"id": "21",
"name": "Jenette Caldwell",
"position": "Development Lead",
"salary": "$345,000",
"start_date": "2011/09/03",
"office": "New York",
"extn": "1937"
},
{
"id": "22",
"name": "Yuri Berry",
"position": "Chief Marketing Officer (CMO)",
"salary": "$675,000",
"start_date": "2009/06/25",
"office": "New York",
"extn": "6154"
},
{
"id": "23",
"name": "Caesar Vance",
"position": "Pre-Sales Support",
"salary": "$106,450",
"start_date": "2011/12/12",
"office": "New York",
"extn": "8330"
},
{
"id": "24",
"name": "Doris Wilder",
"position": "Sales Assistant",
"salary": "$85,600",
"start_date": "2010/09/20",
"office": "Sydney",
"extn": "3023"
},
{
"id": "25",
"name": "Angelica Ramos",
"position": "Chief Executive Officer (CEO)",
"salary": "$1,200,000",
"start_date": "2009/10/09",
"office": "London",
"extn": "5797"
},
{
"id": "26",
"name": "Gavin Joyce",
"position": "Developer",
"salary": "$92,575",
"start_date": "2010/12/22",
"office": "Edinburgh",
"extn": "8822"
},
{
"id": "27",
"name": "Jennifer Chang",
"position": "Regional Director",
"salary": "$357,650",
"start_date": "2010/11/14",
"office": "Singapore",
"extn": "9239"
},
{
"id": "28",
"name": "Brenden Wagner",
"position": "Software Engineer",
"salary": "$206,850",
"start_date": "2011/06/07",
"office": "San Francisco",
"extn": "1314"
},
{
"id": "29",
"name": "Fiona Green",
"position": "Chief Operating Officer (COO)",
"salary": "$850,000",
"start_date": "2010/03/11",
"office": "San Francisco",
"extn": "2947"
},
{
"id": "30",
"name": "Shou Itou",
"position": "Regional Marketing",
"salary": "$163,000",
"start_date": "2011/08/14",
"office": "Tokyo",
"extn": "8899"
},
{
"id": "31",
"name": "Michelle House",
"position": "Integration Specialist",
"salary": "$95,400",
"start_date": "2011/06/02",
"office": "Sydney",
"extn": "2769"
},
{
"id": "32",
"name": "Suki Burks",
"position": "Developer",
"salary": "$114,500",
"start_date": "2009/10/22",
"office": "London",
"extn": "6832"
},
{
"id": "33",
"name": "Prescott Bartlett",
"position": "Technical Author",
"salary": "$145,000",
"start_date": "2011/05/07",
"office": "London",
"extn": "3606"
},
{
"id": "34",
"name": "Gavin Cortez",
"position": "Team Leader",
"salary": "$235,500",
"start_date": "2008/10/26",
"office": "San Francisco",
"extn": "2860"
},
{
"id": "35",
"name": "Martena Mccray",
"position": "Post-Sales support",
"salary": "$324,050",
"start_date": "2011/03/09",
"office": "Edinburgh",
"extn": "8240"
},
{
"id": "36",
"name": "Unity Butler",
"position": "Marketing Designer",
"salary": "$85,675",
"start_date": "2009/12/09",
"office": "San Francisco",
"extn": "5384"
},
{
"id": "37",
"name": "Howard Hatfield",
"position": "Office Manager",
"salary": "$164,500",
"start_date": "2008/12/16",
"office": "San Francisco",
"extn": "7031"
},
{
"id": "38",
"name": "Hope Fuentes",
"position": "Secretary",
"salary": "$109,850",
"start_date": "2010/02/12",
"office": "San Francisco",
"extn": "6318"
},
{
"id": "39",
"name": "Vivian Harrell",
"position": "Financial Controller",
"salary": "$452,500",
"start_date": "2009/02/14",
"office": "San Francisco",
"extn": "9422"
},
{
"id": "40",
"name": "Timothy Mooney",
"position": "Office Manager",
"salary": "$136,200",
"start_date": "2008/12/11",
"office": "London",
"extn": "7580"
},
{
"id": "41",
"name": "Jackson Bradshaw",
"position": "Director",
"salary": "$645,750",
"start_date": "2008/09/26",
"office": "New York",
"extn": "1042"
},
{
"id": "42",
"name": "Olivia Liang",
"position": "Support Engineer",
"salary": "$234,500",
"start_date": "2011/02/03",
"office": "Singapore",
"extn": "2120"
},
{
"id": "43",
"name": "Bruno Nash",
"position": "Software Engineer",
"salary": "$163,500",
"start_date": "2011/05/03",
"office": "London",
"extn": "6222"
},
{
"id": "44",
"name": "Sakura Yamamoto",
"position": "Support Engineer",
"salary": "$139,575",
"start_date": "2009/08/19",
"office": "Tokyo",
"extn": "9383"
},
{
"id": "45",
"name": "Thor Walton",
"position": "Developer",
"salary": "$98,540",
"start_date": "2013/08/11",
"office": "New York",
"extn": "8327"
},
{
"id": "46",
"name": "Finn Camacho",
"position": "Support Engineer",
"salary": "$87,500",
"start_date": "2009/07/07",
"office": "San Francisco",
"extn": "2927"
},
{
"id": "47",
"name": "Serge Baldwin",
"position": "Data Coordinator",
"salary": "$138,575",
"start_date": "2012/04/09",
"office": "Singapore",
"extn": "8352"
},
{
"id": "48",
"name": "Zenaida Frank",
"position": "Software Engineer",
"salary": "$125,250",
"start_date": "2010/01/04",
"office": "New York",
"extn": "7439"
},
{
"id": "49",
"name": "Zorita Serrano",
"position": "Software Engineer",
"salary": "$115,000",
"start_date": "2012/06/01",
"office": "San Francisco",
"extn": "4389"
},
{
"id": "50",
"name": "Jennifer Acosta",
"position": "Junior Javascript Developer",
"salary": "$75,650",
"start_date": "2013/02/01",
"office": "Edinburgh",
"extn": "3431"
},
{
"id": "51",
"name": "Cara Stevens",
"position": "Sales Assistant",
"salary": "$145,600",
"start_date": "2011/12/06",
"office": "New York",
"extn": "3990"
},
{
"id": "52",
"name": "Hermione Butler",
"position": "Regional Director",
"salary": "$356,250",
"start_date": "2011/03/21",
"office": "London",
"extn": "1016"
},
{
"id": "53",
"name": "Lael Greer",
"position": "Systems Administrator",
"salary": "$103,500",
"start_date": "2009/02/27",
"office": "London",
"extn": "6733"
},
{
"id": "54",
"name": "Jonas Alexander",
"position": "Developer",
"salary": "$86,500",
"start_date": "2010/07/14",
"office": "San Francisco",
"extn": "8196"
},
{
"id": "55",
"name": "Shad Decker",
"position": "Regional Director",
"salary": "$183,000",
"start_date": "2008/11/13",
"office": "Edinburgh",
"extn": "6373"
},
{
"id": "56",
"name": "Michael Bruce",
"position": "Javascript Developer",
"salary": "$183,000",
"start_date": "2011/06/27",
"office": "Singapore",
"extn": "5384"
},
{
"id": "57",
"name": "Donna Snider",
"position": "Customer Support",
"salary": "$112,000",
"start_date": "2011/01/25",
"office": "New York",
"extn": "4226"
}
]
}

View File

@@ -0,0 +1,15 @@
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
session_start();
$data = file_get_contents('2500.txt');
$json = json_decode($data, true);
if(isset($_SESSION['stateRestore'])) {
$json['stateRestore'] = $_SESSION['stateRestore'];
}
echo json_encode($json);

View File

@@ -0,0 +1,24 @@
<?php
session_start();
if(isset($_POST) && isset($_POST['stateRestore']) && isset($_POST['action'])) {
$keys = array_keys($_POST['stateRestore']);
if($_POST['action'] === 'rename') {
foreach($keys as $key) {
$tempState = $_SESSION['stateRestore'][$key];
$_SESSION['stateRestore'][$_POST['stateRestore'][$key]] = $tempState;
unset($_SESSION['stateRestore'][$key]);
}
}
else if($_POST['action'] === 'save') {
foreach($keys as $key) {
$_SESSION['stateRestore'][$key] = $_POST['stateRestore'][$key];
}
}
else if($_POST['action'] === 'remove') {
foreach($keys as $key) {
unset($_SESSION['stateRestore'][$key]);
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,799 @@
var $;
var dataTable;
export function setJQuery(jq) {
$ = jq;
dataTable = jq.fn.dataTable;
}
var StateRestore = /** @class */ (function () {
function StateRestore(settings, opts, identifier, state, isPreDefined, successCallback) {
if (state === void 0) { state = undefined; }
if (isPreDefined === void 0) { isPreDefined = false; }
if (successCallback === void 0) { successCallback = function () { return null; }; }
// Check that the required version of DataTables is included
if (!dataTable || !dataTable.versionCheck || !dataTable.versionCheck('1.10.0')) {
throw new Error('StateRestore requires DataTables 1.10 or newer');
}
// Check that Select is included
// eslint-disable-next-line no-extra-parens
if (!dataTable.Buttons) {
throw new Error('StateRestore requires Buttons');
}
var table = new dataTable.Api(settings);
this.classes = $.extend(true, {}, StateRestore.classes);
// Get options from user
this.c = $.extend(true, {}, StateRestore.defaults, opts);
this.s = {
dt: table,
identifier: identifier,
isPreDefined: isPreDefined,
savedState: null,
tableId: state && state.stateRestore ? state.stateRestore.tableId : undefined
};
this.dom = {
background: $('<div class="' + this.classes.background + '"/>'),
closeButton: $('<div class="' + this.classes.closeButton + '">&times;</div>'),
confirmation: $('<div class="' + this.classes.confirmation + '"/>'),
confirmationButton: $('<button class="' + this.classes.confirmationButton + ' ' + this.classes.dtButton + '">'),
confirmationTitleRow: $('<div class="' + this.classes.confirmationTitleRow + '"></div>'),
dtContainer: $(this.s.dt.table().container()),
duplicateError: $('<span class="' + this.classes.modalError + '">' +
this.s.dt.i18n('stateRestore.duplicateError', this.c.i18n.duplicateError) +
'</span>'),
emptyError: $('<span class="' + this.classes.modalError + '">' +
this.s.dt.i18n('stateRestore.emptyError', this.c.i18n.emptyError) +
'</span>'),
removeContents: $('<div class="' + this.classes.confirmationText + '"><span>' +
this.s.dt
.i18n('stateRestore.removeConfirm', this.c.i18n.removeConfirm)
.replace(/%s/g, StateRestore.entityEncode(this.s.identifier)) +
'</span></div>'),
removeError: $('<span class="' + this.classes.modalError + '">' +
this.s.dt.i18n('stateRestore.removeError', this.c.i18n.removeError) +
'</span>'),
removeTitle: $('<h2 class="' + this.classes.confirmationTitle + '">' +
this.s.dt.i18n('stateRestore.removeTitle', this.c.i18n.removeTitle) +
'</h2>'),
renameContents: $('<div class="' + this.classes.confirmationText + ' ' + this.classes.renameModal + '">' +
'<label class="' + this.classes.confirmationMessage + '">' +
this.s.dt
.i18n('stateRestore.renameLabel', this.c.i18n.renameLabel)
.replace(/%s/g, StateRestore.entityEncode(this.s.identifier)) +
'</label>' +
'</div>'),
renameInput: $('<input class="' + this.classes.input + '" type="text"></input>'),
renameTitle: $('<h2 class="' + this.classes.confirmationTitle + '">' +
this.s.dt.i18n('stateRestore.renameTitle', this.c.i18n.renameTitle) +
'</h2>')
};
// When a StateRestore instance is created the current state of the table should also be saved.
this.save(state, successCallback);
}
/**
* Removes a state from storage and then triggers the dtsr-remove event
* so that the StateRestoreCollection class can remove it's references as well.
*
* @param skipModal Flag to indicate if the modal should be skipped or not
*/
StateRestore.prototype.remove = function (skipModal) {
var _a;
var _this = this;
if (skipModal === void 0) { skipModal = false; }
// Check if removal of states is allowed
if (!this.c.remove) {
return false;
}
var removeFunction;
var ajaxData = {
action: 'remove',
stateRestore: (_a = {},
_a[this.s.identifier] = this.s.savedState,
_a)
};
var successCallback = function () {
_this.dom.confirmation.trigger('dtsr-remove');
$(_this.s.dt.table().node()).trigger('stateRestore-change');
_this.dom.background.click();
_this.dom.confirmation.remove();
$(document).unbind('keyup', function (e) { return _this._keyupFunction(e); });
_this.dom.confirmationButton.off('click');
};
// If the remove is not happening over ajax remove it from local storage and then trigger the event
if (!this.c.ajax) {
removeFunction = function () {
try {
localStorage.removeItem('DataTables_stateRestore_' + _this.s.identifier + '_' + location.pathname +
(_this.s.tableId ? '_' + _this.s.tableId : ''));
successCallback();
}
catch (e) {
_this.dom.confirmation.children('.' + _this.classes.modalError).remove();
_this.dom.confirmation.append(_this.dom.removeError);
return 'remove';
}
return true;
};
}
// Ajax property has to be a string, not just true
// Also only want to save if the table has been initialised and the states have been loaded in
else if (typeof this.c.ajax === 'string' && this.s.dt.settings()[0]._bInitComplete) {
removeFunction = function () {
$.ajax({
data: ajaxData,
success: successCallback,
type: 'POST',
url: _this.c.ajax
});
return true;
};
}
else if (typeof this.c.ajax === 'function') {
removeFunction = function () {
if (typeof _this.c.ajax === 'function') {
_this.c.ajax.call(_this.s.dt, ajaxData, successCallback);
}
return true;
};
}
// If the modal is to be skipped then remove straight away
if (skipModal) {
this.dom.confirmation.appendTo(this.dom.dtContainer);
$(this.s.dt.table().node()).trigger('dtsr-modal-inserted');
removeFunction();
this.dom.confirmation.remove();
}
// Otherwise display the modal
else {
this._newModal(this.dom.removeTitle, this.s.dt.i18n('stateRestore.removeSubmit', this.c.i18n.removeSubmit), removeFunction, this.dom.removeContents);
}
return true;
};
/**
* Compares the state held within this instance with a state that is passed in
*
* @param state The state that is to be compared against
* @returns boolean indicating if the states match
*/
StateRestore.prototype.compare = function (state) {
// Order
if (!this.c.saveState.order) {
state.order = undefined;
}
// Search
if (!this.c.saveState.search) {
state.search = undefined;
}
// Columns
if (this.c.saveState.columns && state.columns) {
for (var i = 0, ien = state.columns.length; i < ien; i++) {
// Visibility
if (typeof this.c.saveState.columns !== 'boolean' && !this.c.saveState.columns.visible) {
state.columns[i].visible = undefined;
}
// Search
if (typeof this.c.saveState.columns !== 'boolean' && !this.c.saveState.columns.search) {
state.columns[i].search = undefined;
}
}
}
else if (!this.c.saveState.columns) {
state.columns = undefined;
}
// Paging
if (!this.c.saveState.paging) {
state.page = undefined;
}
// SearchBuilder
if (!this.c.saveState.searchBuilder) {
state.searchBuilder = undefined;
}
// SearchPanes
if (!this.c.saveState.searchPanes) {
state.searchPanes = undefined;
}
// Select
if (!this.c.saveState.select) {
state.select = undefined;
}
// ColReorder
if (!this.c.saveState.colReorder) {
state.ColReorder = undefined;
}
// Scroller
if (!this.c.saveState.scroller) {
state.scroller = undefined;
if (dataTable.Scroller !== undefined) {
state.start = 0;
}
}
// Paging
if (!this.c.saveState.paging) {
state.start = 0;
}
// Page Length
if (!this.c.saveState.length) {
state.length = undefined;
}
// Need to delete properties that we do not want to compare
delete state.time;
var copyState = this.s.savedState;
delete copyState.time;
delete copyState.c;
delete copyState.stateRestore;
// Perform a deep compare of the two state objects
return this._deepCompare(state, copyState);
};
/**
* Removes all of the dom elements from the document
*/
StateRestore.prototype.destroy = function () {
$.each(this.dom, function (name, el) {
el.off().remove();
});
};
/**
* Loads the state referenced by the identifier from storage
*
* @param state The identifier of the state that should be loaded
* @returns the state that has been loaded
*/
StateRestore.prototype.load = function () {
var _this = this;
var loadedState = this.s.savedState;
var settings = this.s.dt.settings()[0];
// Always want the states stored here to be loaded in - regardless of when they were created
loadedState.time = +new Date();
settings.oLoadedState = $.extend(true, {}, loadedState);
// Click on a background if there is one to shut the collection
$('div.dt-button-background').click();
var loaded = function () {
var correctPaging = function (e, preSettings) {
setTimeout(function () {
var currpage = preSettings._iDisplayStart / preSettings._iDisplayLength;
var intendedPage = loadedState.start / loadedState.length;
// If the paging is incorrect then we have to set it again so that it is correct
// This happens when a searchpanes filter is removed
// This has to happen in a timeout because searchpanes only deselects after a timeout
if (currpage >= 0 && intendedPage >= 0 && currpage !== intendedPage) {
_this.s.dt.page(intendedPage).draw(false);
}
}, 50);
};
_this.s.dt.one('preDraw', correctPaging);
_this.s.dt.draw(false);
};
// Call the internal datatables function to implement the state on the table
if (DataTable.versionCheck('2')) {
this.s.dt.state(loadedState);
loaded();
}
else {
// Legacy
DataTable.ext.oApi._fnImplementState(settings, loadedState, loaded);
}
return loadedState;
};
/**
* Shows a modal that allows a state to be renamed
*
* @param newIdentifier Optional. The new identifier for this state
*/
StateRestore.prototype.rename = function (newIdentifier, currentIdentifiers) {
var _this = this;
if (newIdentifier === void 0) { newIdentifier = null; }
// Check if renaming of states is allowed
if (!this.c.rename) {
return;
}
var renameFunction = function () {
var _a;
if (newIdentifier === null) {
var tempIdentifier = $('input.' + _this.classes.input.replace(/ /g, '.')).val();
if (tempIdentifier.length === 0) {
_this.dom.confirmation.children('.' + _this.classes.modalError).remove();
_this.dom.confirmation.append(_this.dom.emptyError);
return 'empty';
}
else if (currentIdentifiers.includes(tempIdentifier)) {
_this.dom.confirmation.children('.' + _this.classes.modalError).remove();
_this.dom.confirmation.append(_this.dom.duplicateError);
return 'duplicate';
}
else {
newIdentifier = tempIdentifier;
}
}
var ajaxData = {
action: 'rename',
stateRestore: (_a = {},
_a[_this.s.identifier] = newIdentifier,
_a)
};
var successCallback = function () {
_this.s.identifier = newIdentifier;
_this.save(_this.s.savedState, function () { return null; }, false);
_this.dom.removeContents = $('<div class="' + _this.classes.confirmationText + '"><span>' +
_this.s.dt
.i18n('stateRestore.removeConfirm', _this.c.i18n.removeConfirm)
.replace(/%s/g, _this.s.identifier) +
'</span></div>');
_this.dom.confirmation.trigger('dtsr-rename');
_this.dom.background.click();
_this.dom.confirmation.remove();
$(document).unbind('keyup', function (e) { return _this._keyupFunction(e); });
_this.dom.confirmationButton.off('click');
};
if (!_this.c.ajax) {
try {
localStorage.removeItem('DataTables_stateRestore_' + _this.s.identifier + '_' + location.pathname +
(_this.s.tableId ? '_' + _this.s.tableId : ''));
successCallback();
}
catch (e) {
_this.dom.confirmation.children('.' + _this.classes.modalError).remove();
_this.dom.confirmation.append(_this.dom.removeError);
return false;
}
}
else if (typeof _this.c.ajax === 'string' && _this.s.dt.settings()[0]._bInitComplete) {
$.ajax({
data: ajaxData,
success: successCallback,
type: 'POST',
url: _this.c.ajax
});
}
else if (typeof _this.c.ajax === 'function') {
_this.c.ajax.call(_this.s.dt, ajaxData, successCallback);
}
return true;
};
// Check if a new identifier has been provided, if so no need for a modal
if (newIdentifier !== null) {
if (currentIdentifiers.includes(newIdentifier)) {
throw new Error(this.s.dt.i18n('stateRestore.duplicateError', this.c.i18n.duplicateError));
}
else if (newIdentifier.length === 0) {
throw new Error(this.s.dt.i18n('stateRestore.emptyError', this.c.i18n.emptyError));
}
else {
this.dom.confirmation.appendTo(this.dom.dtContainer);
$(this.s.dt.table().node()).trigger('dtsr-modal-inserted');
renameFunction();
this.dom.confirmation.remove();
}
}
else {
this.dom.renameInput.val(this.s.identifier);
this.dom.renameContents.append(this.dom.renameInput);
this._newModal(this.dom.renameTitle, this.s.dt.i18n('stateRestore.renameButton', this.c.i18n.renameButton), renameFunction, this.dom.renameContents);
}
};
/**
* Saves the tables current state using the identifier that is passed in.
*
* @param state Optional. If provided this is the state that will be saved rather than using the current state
*/
StateRestore.prototype.save = function (state, passedSuccessCallback, callAjax) {
var _a;
var _this = this;
if (callAjax === void 0) { callAjax = true; }
// Check if saving states is allowed
if (!this.c.save) {
if (passedSuccessCallback) {
passedSuccessCallback.call(this);
}
return;
}
// this.s.dt.state.save();
var savedState;
// If no state has been provided then create a new one from the current state
this.s.dt.state.save();
if (state === undefined) {
savedState = this.s.dt.state();
}
else if (typeof state !== 'object') {
return;
}
else {
savedState = state;
}
if (savedState.stateRestore) {
savedState.stateRestore.isPreDefined = this.s.isPreDefined;
savedState.stateRestore.state = this.s.identifier;
savedState.stateRestore.tableId = this.s.tableId;
}
else {
savedState.stateRestore = {
isPreDefined: this.s.isPreDefined,
state: this.s.identifier,
tableId: this.s.tableId
};
}
this.s.savedState = savedState;
// Order
if (!this.c.saveState.order) {
this.s.savedState.order = undefined;
}
// Search
if (!this.c.saveState.search) {
this.s.savedState.search = undefined;
}
// Columns
if (this.c.saveState.columns && this.s.savedState.columns) {
for (var i = 0, ien = this.s.savedState.columns.length; i < ien; i++) {
// Visibility
if (typeof this.c.saveState.columns !== 'boolean' && !this.c.saveState.columns.visible) {
this.s.savedState.columns[i].visible = undefined;
}
// Search
if (typeof this.c.saveState.columns !== 'boolean' && !this.c.saveState.columns.search) {
this.s.savedState.columns[i].search = undefined;
}
}
}
else if (!this.c.saveState.columns) {
this.s.savedState.columns = undefined;
}
// SearchBuilder
if (!this.c.saveState.searchBuilder) {
this.s.savedState.searchBuilder = undefined;
}
// SearchPanes
if (!this.c.saveState.searchPanes) {
this.s.savedState.searchPanes = undefined;
}
// Select
if (!this.c.saveState.select) {
this.s.savedState.select = undefined;
}
// ColReorder
if (!this.c.saveState.colReorder) {
this.s.savedState.ColReorder = undefined;
}
// Scroller
if (!this.c.saveState.scroller) {
this.s.savedState.scroller = undefined;
if (dataTable.Scroller !== undefined) {
this.s.savedState.start = 0;
}
}
// Paging
if (!this.c.saveState.paging) {
this.s.savedState.start = 0;
}
// Page Length
if (!this.c.saveState.length) {
this.s.savedState.length = undefined;
}
this.s.savedState.c = this.c;
// Need to remove the parent reference before we save the state
// Its not needed to rebuild, but it does cause a circular reference when converting to JSON
if (this.s.savedState.c.splitSecondaries.length) {
for (var _i = 0, _b = this.s.savedState.c.splitSecondaries; _i < _b.length; _i++) {
var secondary = _b[_i];
if (secondary.parent) {
secondary.parent = undefined;
}
}
}
// If the state is predefined there is no need to save it over ajax or to local storage
if (this.s.isPreDefined) {
if (passedSuccessCallback) {
passedSuccessCallback.call(this);
}
return;
}
var ajaxData = {
action: 'save',
stateRestore: (_a = {},
_a[this.s.identifier] = this.s.savedState,
_a)
};
var successCallback = function () {
if (passedSuccessCallback) {
passedSuccessCallback.call(_this);
}
_this.dom.confirmation.trigger('dtsr-save');
$(_this.s.dt.table().node()).trigger('stateRestore-change');
};
if (!this.c.ajax) {
localStorage.setItem('DataTables_stateRestore_' + this.s.identifier + '_' + location.pathname +
(this.s.tableId ? '_' + this.s.tableId : ''), JSON.stringify(this.s.savedState));
successCallback();
}
else if (typeof this.c.ajax === 'string' && callAjax) {
if (this.s.dt.settings()[0]._bInitComplete) {
$.ajax({
data: ajaxData,
success: successCallback,
type: 'POST',
url: this.c.ajax
});
}
else {
this.s.dt.one('init', function () {
$.ajax({
data: ajaxData,
success: successCallback,
type: 'POST',
url: _this.c.ajax
});
});
}
}
else if (typeof this.c.ajax === 'function' && callAjax) {
this.c.ajax.call(this.s.dt, ajaxData, successCallback);
}
};
/**
* Encode HTML entities
*
* @param d String to encode
* @returns Encoded string
* @todo When DT1 support is dropped, switch to using `DataTable.util.escapeHtml`
*/
StateRestore.entityEncode = function (d) {
return typeof d === 'string' ?
d
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;') :
d;
};
/**
* Performs a deep compare of two state objects, returning true if they match
*
* @param state1 The first object to compare
* @param state2 The second object to compare
* @returns boolean indicating if the objects match
*/
StateRestore.prototype._deepCompare = function (state1, state2) {
// Put keys and states into arrays as this makes the later code easier to work
var states = [state1, state2];
var keys = [Object.keys(state1).sort(), Object.keys(state2).sort()];
var startIdx, i;
// If scroller is included then we need to remove the start value
// as it can be different but yield the same results
if (keys[0].includes('scroller')) {
startIdx = keys[0].indexOf('start');
if (startIdx) {
keys[0].splice(startIdx, 1);
}
}
if (keys[1].includes('scroller')) {
startIdx = keys[1].indexOf('start');
if (startIdx) {
keys[1].splice(startIdx, 1);
}
}
// We want to remove any private properties within the states
for (i = 0; i < keys[0].length; i++) {
if (keys[0][i].indexOf('_') === 0) {
keys[0].splice(i, 1);
i--;
continue;
}
// If scroller is included then we need to remove the following values
// as they can be different but yield the same results
if (keys[0][i] === 'baseRowTop' ||
keys[0][i] === 'baseScrollTop' ||
keys[0][i] === 'scrollTop' ||
(!this.c.saveState.paging && keys[0][i] === 'page')) {
keys[0].splice(i, 1);
i--;
continue;
}
}
for (i = 0; i < keys[1].length; i++) {
if (keys[1][i].indexOf('_') === 0) {
keys[1].splice(i, 1);
i--;
continue;
}
if (keys[1][i] === 'baseRowTop' ||
keys[1][i] === 'baseScrollTop' ||
keys[1][i] === 'scrollTop' ||
(!this.c.saveState.paging && keys[0][i] === 'page')) {
keys[1].splice(i, 1);
i--;
continue;
}
}
if (keys[0].length === 0 && keys[1].length > 0 ||
keys[1].length === 0 && keys[0].length > 0) {
return false;
}
// We are only going to compare the keys that are common between both states
for (i = 0; i < keys[0].length; i++) {
if (!keys[1].includes(keys[0][i])) {
keys[0].splice(i, 1);
i--;
}
}
for (i = 0; i < keys[1].length; i++) {
if (!keys[0].includes(keys[1][i])) {
keys[1].splice(i, 1);
i--;
}
}
// Then each key and value has to be checked against each other
for (i = 0; i < keys[0].length; i++) {
// If the keys dont equal, or their corresponding types are different we can return false
if (keys[0][i] !== keys[1][i] || typeof states[0][keys[0][i]] !== typeof states[1][keys[1][i]]) {
return false;
}
// If the type is an object then further deep comparisons are required
if (typeof states[0][keys[0][i]] === 'object') {
if (!this._deepCompare(states[0][keys[0][i]], states[1][keys[1][i]])) {
return false;
}
}
else if (typeof states[0][keys[0][i]] === 'number' && typeof states[1][keys[1][i]] === 'number') {
if (Math.round(states[0][keys[0][i]]) !== Math.round(states[1][keys[1][i]])) {
return false;
}
}
// Otherwise we can just check the value
else if (states[0][keys[0][i]] !== states[1][keys[1][i]]) {
return false;
}
}
// If we get all the way to here there are no differences so return true for this object
return true;
};
StateRestore.prototype._keyupFunction = function (e) {
// If enter same action as pressing the button
if (e.key === 'Enter') {
this.dom.confirmationButton.click();
}
// If escape close modal
else if (e.key === 'Escape') {
$('div.' + this.classes.background.replace(/ /g, '.')).click();
}
};
/**
* Creates a new confirmation modal for the user to approve an action
*
* @param title The title that is to be displayed at the top of the modal
* @param buttonText The text that is to be displayed in the confirmation button of the modal
* @param buttonAction The action that should be taken when the confirmation button is pressed
* @param modalContents The contents for the main body of the modal
*/
StateRestore.prototype._newModal = function (title, buttonText, buttonAction, modalContents) {
var _this = this;
this.dom.background.appendTo(this.dom.dtContainer);
this.dom.confirmationTitleRow.empty().append(title);
this.dom.confirmationButton.html(buttonText);
this.dom.confirmation
.empty()
.append(this.dom.confirmationTitleRow)
.append(modalContents)
.append($('<div class="' + this.classes.confirmationButtons + '"></div>')
.append(this.dom.confirmationButton))
.appendTo(this.dom.dtContainer);
$(this.s.dt.table().node()).trigger('dtsr-modal-inserted');
var inputs = modalContents.children('input');
// If there is an input focus on that
if (inputs.length > 0) {
$(inputs[0]).focus();
}
// Otherwise focus on the confirmation button
else {
this.dom.confirmationButton.focus();
}
var background = $('div.' + this.classes.background.replace(/ /g, '.'));
if (this.c.modalCloseButton) {
this.dom.confirmation.append(this.dom.closeButton);
this.dom.closeButton.on('click', function () { return background.click(); });
}
// When the button is clicked, call the appropriate action,
// remove the background and modal from the screen and unbind the keyup event.
this.dom.confirmationButton.on('click', function () { return buttonAction(); });
this.dom.confirmation.on('click', function (e) {
e.stopPropagation();
});
// When the button is clicked, remove the background and modal from the screen and unbind the keyup event.
background.one('click', function () {
_this.dom.background.remove();
_this.dom.confirmation.remove();
$(document).unbind('keyup', function (e) { return _this._keyupFunction(e); });
});
$(document).on('keyup', function (e) { return _this._keyupFunction(e); });
};
StateRestore.version = '1.4.1';
StateRestore.classes = {
background: 'dtsr-background',
closeButton: 'dtsr-popover-close',
confirmation: 'dtsr-confirmation',
confirmationButton: 'dtsr-confirmation-button',
confirmationButtons: 'dtsr-confirmation-buttons',
confirmationMessage: 'dtsr-confirmation-message dtsr-name-label',
confirmationText: 'dtsr-confirmation-text',
confirmationTitle: 'dtsr-confirmation-title',
confirmationTitleRow: 'dtsr-confirmation-title-row',
dtButton: 'dt-button',
input: 'dtsr-input',
modalError: 'dtsr-modal-error',
renameModal: 'dtsr-rename-modal'
};
StateRestore.defaults = {
_createInSaved: false,
ajax: false,
create: true,
creationModal: false,
i18n: {
creationModal: {
button: 'Create',
colReorder: 'Column Order:',
columns: {
search: 'Column Search:',
visible: 'Column Visibility:'
},
length: 'Page Length:',
name: 'Name:',
order: 'Sorting:',
paging: 'Paging:',
scroller: 'Scroll Position:',
search: 'Search:',
searchBuilder: 'SearchBuilder:',
searchPanes: 'SearchPanes:',
select: 'Select:',
title: 'Create New State',
toggleLabel: 'Includes:'
},
duplicateError: 'A state with this name already exists.',
emptyError: 'Name cannot be empty.',
emptyStates: 'No saved states',
removeConfirm: 'Are you sure you want to remove %s?',
removeError: 'Failed to remove state.',
removeJoiner: ' and ',
removeSubmit: 'Remove',
removeTitle: 'Remove State',
renameButton: 'Rename',
renameLabel: 'New Name for %s:',
renameTitle: 'Rename State'
},
modalCloseButton: true,
remove: true,
rename: true,
save: true,
saveState: {
colReorder: true,
columns: {
search: true,
visible: true
},
length: true,
order: true,
paging: true,
scroller: true,
search: true,
searchBuilder: true,
searchPanes: true,
select: true
},
splitSecondaries: [
'updateState',
'renameState',
'removeState'
],
toggle: {
colReorder: false,
columns: {
search: false,
visible: false
},
length: false,
order: false,
paging: false,
scroller: false,
search: false,
searchBuilder: false,
searchPanes: false,
select: false
}
};
return StateRestore;
}());
export default StateRestore;

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
/*! StateRestore 1.3.0
/*! StateRestore 1.4.1
* © SpryMedia Ltd - datatables.net/license
*/
@@ -43,7 +43,7 @@
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
}(function( $, window, document ) {
'use strict';
var DataTable = $.fn.dataTable;
@@ -98,7 +98,7 @@ var DataTable = $.fn.dataTable;
removeContents: $$2('<div class="' + this.classes.confirmationText + '"><span>' +
this.s.dt
.i18n('stateRestore.removeConfirm', this.c.i18n.removeConfirm)
.replace(/%s/g, this.s.identifier) +
.replace(/%s/g, StateRestore.entityEncode(this.s.identifier)) +
'</span></div>'),
removeError: $$2('<span class="' + this.classes.modalError + '">' +
this.s.dt.i18n('stateRestore.removeError', this.c.i18n.removeError) +
@@ -110,7 +110,7 @@ var DataTable = $.fn.dataTable;
'<label class="' + this.classes.confirmationMessage + '">' +
this.s.dt
.i18n('stateRestore.renameLabel', this.c.i18n.renameLabel)
.replace(/%s/g, this.s.identifier) +
.replace(/%s/g, StateRestore.entityEncode(this.s.identifier)) +
'</label>' +
'</div>'),
renameInput: $$2('<input class="' + this.classes.input + '" type="text"></input>'),
@@ -279,7 +279,9 @@ var DataTable = $.fn.dataTable;
* Removes all of the dom elements from the document
*/
StateRestore.prototype.destroy = function () {
Object.values(this.dom).forEach(function (node) { return node.off().remove(); });
$$2.each(this.dom, function (name, el) {
el.off().remove();
});
};
/**
* Loads the state referenced by the identifier from storage
@@ -296,8 +298,7 @@ var DataTable = $.fn.dataTable;
settings.oLoadedState = $$2.extend(true, {}, loadedState);
// Click on a background if there is one to shut the collection
$$2('div.dt-button-background').click();
// Call the internal datatables function to implement the state on the table
$$2.fn.dataTable.ext.oApi._fnImplementState(settings, loadedState, function () {
var loaded = function () {
var correctPaging = function (e, preSettings) {
setTimeout(function () {
var currpage = preSettings._iDisplayStart / preSettings._iDisplayLength;
@@ -312,7 +313,16 @@ var DataTable = $.fn.dataTable;
};
_this.s.dt.one('preDraw', correctPaging);
_this.s.dt.draw(false);
});
};
// Call the internal datatables function to implement the state on the table
if (DataTable.versionCheck('2')) {
this.s.dt.state(loadedState);
loaded();
}
else {
// Legacy
DataTable.ext.oApi._fnImplementState(settings, loadedState, loaded);
}
return loadedState;
};
/**
@@ -568,6 +578,22 @@ var DataTable = $.fn.dataTable;
this.c.ajax.call(this.s.dt, ajaxData, successCallback);
}
};
/**
* Encode HTML entities
*
* @param d String to encode
* @returns Encoded string
* @todo When DT1 support is dropped, switch to using `DataTable.util.escapeHtml`
*/
StateRestore.entityEncode = function (d) {
return typeof d === 'string' ?
d
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;') :
d;
};
/**
* Performs a deep compare of two state objects, returning true if they match
*
@@ -579,22 +605,23 @@ var DataTable = $.fn.dataTable;
// Put keys and states into arrays as this makes the later code easier to work
var states = [state1, state2];
var keys = [Object.keys(state1).sort(), Object.keys(state2).sort()];
var startIdx, i;
// If scroller is included then we need to remove the start value
// as it can be different but yield the same results
if (keys[0].includes('scroller')) {
var startIdx = keys[0].indexOf('start');
startIdx = keys[0].indexOf('start');
if (startIdx) {
keys[0].splice(startIdx, 1);
}
}
if (keys[1].includes('scroller')) {
var startIdx = keys[1].indexOf('start');
startIdx = keys[1].indexOf('start');
if (startIdx) {
keys[1].splice(startIdx, 1);
}
}
// We want to remove any private properties within the states
for (var i = 0; i < keys[0].length; i++) {
for (i = 0; i < keys[0].length; i++) {
if (keys[0][i].indexOf('_') === 0) {
keys[0].splice(i, 1);
i--;
@@ -611,7 +638,7 @@ var DataTable = $.fn.dataTable;
continue;
}
}
for (var i = 0; i < keys[1].length; i++) {
for (i = 0; i < keys[1].length; i++) {
if (keys[1][i].indexOf('_') === 0) {
keys[1].splice(i, 1);
i--;
@@ -631,20 +658,20 @@ var DataTable = $.fn.dataTable;
return false;
}
// We are only going to compare the keys that are common between both states
for (var i = 0; i < keys[0].length; i++) {
for (i = 0; i < keys[0].length; i++) {
if (!keys[1].includes(keys[0][i])) {
keys[0].splice(i, 1);
i--;
}
}
for (var i = 0; i < keys[1].length; i++) {
for (i = 0; i < keys[1].length; i++) {
if (!keys[0].includes(keys[1][i])) {
keys[1].splice(i, 1);
i--;
}
}
// Then each key and value has to be checked against each other
for (var i = 0; i < keys[0].length; i++) {
for (i = 0; i < keys[0].length; i++) {
// If the keys dont equal, or their corresponding types are different we can return false
if (keys[0][i] !== keys[1][i] || typeof states[0][keys[0][i]] !== typeof states[1][keys[1][i]]) {
return false;
@@ -727,23 +754,7 @@ var DataTable = $.fn.dataTable;
});
$$2(document).on('keyup', function (e) { return _this._keyupFunction(e); });
};
/**
* Convert from camelCase notation to the internal Hungarian.
* We could use the Hungarian convert function here, but this is cleaner
*
* @param {object} obj Object to convert
* @returns {object} Inverted object
* @memberof DataTable#oApi
*/
StateRestore.prototype._searchToHung = function (obj) {
return {
bCaseInsensitive: obj.caseInsensitive,
bRegex: obj.regex,
bSmart: obj.smart,
sSearch: obj.search
};
};
StateRestore.version = '1.3.0';
StateRestore.version = '1.4.1';
StateRestore.classes = {
background: 'dtsr-background',
closeButton: 'dtsr-popover-close',
@@ -881,33 +892,33 @@ var DataTable = $.fn.dataTable;
});
this.dom = {
background: $$1('<div class="' + this.classes.background + '"/>'),
checkboxInputRow: $$1('<div class="' + this.classes.formRow + '">' +
'<label class="' + this.classes.nameLabel + '">' +
this.s.dt.i18n('stateRestore.creationModal.toggleLabel', this.c.i18n.creationModal.toggleLabel) +
'</label>' +
'<div class="dtsr-input"></div>' +
'</div>'),
closeButton: $$1('<div class="' + this.classes.closeButton + '">x</div>'),
colReorderToggle: $$1('<div class="' + this.classes.formRow + ' ' + this.classes.checkRow + '">' +
colReorderToggle: $$1('<div class="' + this.classes.checkLabel + '">' +
'<input type="checkbox" class="' +
this.classes.colReorderToggle + ' ' +
this.classes.checkBox +
'" checked>' +
'<label class="' + this.classes.checkLabel + '">' +
this.s.dt.i18n('stateRestore.creationModal.colReorder', this.c.i18n.creationModal.colReorder) +
'</label>' +
'</div>'),
columnsSearchToggle: $$1('<div class="' + this.classes.formRow + ' ' + this.classes.checkRow + '">' +
columnsSearchToggle: $$1('<div class="' + this.classes.checkLabel + '">' +
'<input type="checkbox" class="' +
this.classes.columnsSearchToggle + ' ' +
this.classes.checkBox +
'" checked>' +
'<label class="' + this.classes.checkLabel + '">' +
this.s.dt.i18n('stateRestore.creationModal.columns.search', this.c.i18n.creationModal.columns.search) +
'</label>' +
'</div>'),
columnsVisibleToggle: $$1('<div class="' + this.classes.formRow + ' ' + this.classes.checkRow + ' ' + '">' +
columnsVisibleToggle: $$1('<div class="' + this.classes.checkLabel + '">' +
'<input type="checkbox" class="' +
this.classes.columnsVisibleToggle + ' ' +
this.classes.checkBox +
'" checked>' +
'<label class="' + this.classes.checkLabel + '">' +
this.s.dt.i18n('stateRestore.creationModal.columns.visible', this.c.i18n.creationModal.columns.visible) +
'</label>' +
'</div>'),
confirmation: $$1('<div class="' + this.classes.confirmation + '"/>'),
confirmationTitleRow: $$1('<div class="' + this.classes.confirmationTitleRow + '"></div>'),
@@ -930,38 +941,34 @@ var DataTable = $.fn.dataTable;
emptyError: $$1('<span class="' + this.classes.modalError + '">' +
this.s.dt.i18n('stateRestore.emptyError', this.c.i18n.emptyError) +
'</span>'),
lengthToggle: $$1('<div class="' + this.classes.formRow + ' ' + this.classes.checkRow + '">' +
lengthToggle: $$1('<div class="' + this.classes.checkLabel + '">' +
'<input type="checkbox" class="' +
this.classes.lengthToggle + ' ' +
this.classes.checkBox +
'" checked>' +
'<label class="' + this.classes.checkLabel + '">' +
this.s.dt.i18n('stateRestore.creationModal.length', this.c.i18n.creationModal.length) +
'</label>' +
'</div>'),
nameInputRow: $$1('<div class="' + this.classes.formRow + '">' +
'<label class="' + this.classes.nameLabel + '">' +
this.s.dt.i18n('stateRestore.creationModal.name', this.c.i18n.creationModal.name) +
'</label>' +
'<div class="dtsr-input">' +
'<input class="' + this.classes.nameInput + '" type="text">' +
'</div>' +
'</div>'),
orderToggle: $$1('<div class="' + this.classes.formRow + ' ' + this.classes.checkRow + '">' +
orderToggle: $$1('<div class="' + this.classes.checkLabel + '">' +
'<input type="checkbox" class="' +
this.classes.orderToggle + ' ' +
this.classes.checkBox +
'" checked>' +
'<label class="' + this.classes.checkLabel + '">' +
this.s.dt.i18n('stateRestore.creationModal.order', this.c.i18n.creationModal.order) +
'</label>' +
'</div>'),
pagingToggle: $$1('<div class="' + this.classes.formRow + ' ' + this.classes.checkRow + '">' +
pagingToggle: $$1('<div class="' + this.classes.checkLabel + '">' +
'<input type="checkbox" class="' +
this.classes.pagingToggle + ' ' +
this.classes.checkBox +
'" checked>' +
'<label class="' + this.classes.checkLabel + '">' +
this.s.dt.i18n('stateRestore.creationModal.paging', this.c.i18n.creationModal.paging) +
'</label>' +
'</div>'),
removeContents: $$1('<div class="' + this.classes.confirmationText + '"><span></span></div>'),
removeTitle: $$1('<div class="' + this.classes.creationText + '">' +
@@ -969,54 +976,41 @@ var DataTable = $.fn.dataTable;
this.s.dt.i18n('stateRestore.removeTitle', this.c.i18n.removeTitle) +
'</h2>' +
'</div>'),
scrollerToggle: $$1('<div class="' + this.classes.formRow + ' ' + this.classes.checkRow + '">' +
scrollerToggle: $$1('<div class="' + this.classes.checkLabel + '">' +
'<input type="checkbox" class="' +
this.classes.scrollerToggle + ' ' +
this.classes.checkBox +
'" checked>' +
'<label class="' + this.classes.checkLabel + '">' +
this.s.dt.i18n('stateRestore.creationModal.scroller', this.c.i18n.creationModal.scroller) +
'</label>' +
'</div>'),
searchBuilderToggle: $$1('<div class="' + this.classes.formRow + ' ' + this.classes.checkRow + '">' +
searchBuilderToggle: $$1('<div class="' + this.classes.checkLabel + '">' +
'<input type="checkbox" class="' +
this.classes.searchBuilderToggle + ' ' +
this.classes.checkBox +
'" checked>' +
'<label class="' + this.classes.checkLabel + '">' +
this.s.dt.i18n('stateRestore.creationModal.searchBuilder', this.c.i18n.creationModal.searchBuilder) +
'</label>' +
'</div>'),
searchPanesToggle: $$1('<div class="' + this.classes.formRow + ' ' + this.classes.checkRow + '">' +
searchPanesToggle: $$1('<div class="' + this.classes.checkLabel + '">' +
'<input type="checkbox" class="' +
this.classes.searchPanesToggle + ' ' +
this.classes.checkBox +
'" checked>' +
'<label class="' + this.classes.checkLabel + '">' +
this.s.dt.i18n('stateRestore.creationModal.searchPanes', this.c.i18n.creationModal.searchPanes) +
'</label>' +
'</div>'),
searchToggle: $$1('<div class="' + this.classes.formRow + ' ' + this.classes.checkRow + '">' +
searchToggle: $$1('<div class="' + this.classes.checkLabel + '">' +
'<input type="checkbox" class="' +
this.classes.searchToggle + ' ' +
this.classes.checkBox +
'" checked>' +
'<label class="' + this.classes.checkLabel + '">' +
this.s.dt.i18n('stateRestore.creationModal.search', this.c.i18n.creationModal.search) +
'</label>' +
'</div>'),
selectToggle: $$1('<div class="' + this.classes.formRow + ' ' + this.classes.checkRow + '">' +
selectToggle: $$1('<div class="' + this.classes.checkLabel + '">' +
'<input type="checkbox" class="' +
this.classes.selectToggle + ' ' +
this.classes.checkBox +
'" checked>' +
'<label class="' + this.classes.checkLabel + '">' +
this.s.dt.i18n('stateRestore.creationModal.select', this.c.i18n.creationModal.select) +
'</label>' +
'</div>'),
toggleLabel: $$1('<label class="' + this.classes.nameLabel + ' ' + this.classes.toggleLabel + '">' +
this.s.dt.i18n('stateRestore.creationModal.toggleLabel', this.c.i18n.creationModal.toggleLabel) +
'</label>')
'</div>')
};
table.settings()[0]._stateRestore = this;
this._searchForStates();
@@ -1099,7 +1093,15 @@ var DataTable = $.fn.dataTable;
// We don't want to extend, but instead AND all properties of the saveState option
for (var _i = 0, _a = Object.keys(toggles.saveState); _i < _a.length; _i++) {
var key = _a[_i];
if (!toggles.saveState[key]) {
if (typeof toggles.saveState[key] === 'object') {
for (var _b = 0, _c = Object.keys(toggles.saveState[key]); _b < _c.length; _b++) {
var nestedKey = _c[_b];
if (!toggles.saveState[key][nestedKey]) {
opts[key][nestedKey] = false;
}
}
}
else if (!toggles.saveState[key]) {
opts[key] = false;
}
}
@@ -1162,9 +1164,8 @@ var DataTable = $.fn.dataTable;
var state = _a[_i];
state.destroy();
}
Object.values(this.dom).forEach(function (node) {
node.off();
node.remove();
$$1.each(this.dom, function (name, el) {
el.off().remove();
});
this.s.states = [];
this.s.dt.off('.dtsr');
@@ -1179,15 +1180,14 @@ var DataTable = $.fn.dataTable;
// Make sure that the state is up to date
this.s.dt.state.save();
var currState = this.s.dt.state();
var button;
// Make all of the buttons inactive so that only any that match will be marked as active
var buttons = $$1('button.' + $$1.fn.DataTable.Buttons.defaults.dom.button.className.replace(/ /g, '.'));
// Some of the styling libraries use a tags instead of buttons
if (buttons.length === 0) {
buttons = $$1('a.' + $$1.fn.DataTable.Buttons.defaults.dom.button.className.replace(/ /g, '.'));
}
var buttons = this.s.dt.buttons().nodes();
for (var _i = 0, buttons_1 = buttons; _i < buttons_1.length; _i++) {
var button = buttons_1[_i];
this.s.dt.button($$1(button).parent()[0]).active(false);
button = buttons_1[_i];
if ($$1(button).hasClass('dtsr-state') || $$1(button).children().hasClass('dtsr-state')) {
this.s.dt.button(button).active(false);
}
}
var results = [];
// Go through all of the states comparing if their state is the same to the current one
@@ -1200,9 +1200,10 @@ var DataTable = $.fn.dataTable;
});
// If so, find the corresponding button and mark it as active
for (var _c = 0, buttons_2 = buttons; _c < buttons_2.length; _c++) {
var button = buttons_2[_c];
if ($$1(button).text() === state.s.identifier) {
this.s.dt.button($$1(button).parent()[0]).active(true);
button = buttons_2[_c];
var btn = this.s.dt.button(button);
if (btn.text() === state.s.identifier) {
btn.active(true);
break;
}
}
@@ -1299,12 +1300,13 @@ var DataTable = $.fn.dataTable;
StateRestoreCollection.prototype._collectionRebuild = function () {
var button = this.s.dt.button('SaveStateRestore:name');
var stateButtons = [];
var i;
// Need to get the original configuration object, so we can rebuild it
// It might be nested, so need to traverse down the tree
if (button[0]) {
var idxs = button.index().split('-');
stateButtons = button[0].inst.c.buttons;
for (var i = 0; i < idxs.length; i++) {
for (i = 0; i < idxs.length; i++) {
if (stateButtons[idxs[i]].buttons) {
stateButtons = stateButtons[idxs[i]].buttons;
}
@@ -1315,7 +1317,7 @@ var DataTable = $.fn.dataTable;
}
}
// remove any states from the previous rebuild - if they are still there they will be added later
for (var i = 0; i < stateButtons.length; i++) {
for (i = 0; i < stateButtons.length; i++) {
if (stateButtons[i].extend === 'stateRestore') {
stateButtons.splice(i, 1);
i--;
@@ -1354,7 +1356,7 @@ var DataTable = $.fn.dataTable;
// Construct the split property of each button
for (var _i = 0, _a = this.s.states; _i < _a.length; _i++) {
var state = _a[_i];
var split = Object.assign([], this.c.splitSecondaries);
var split = this.c.splitSecondaries.slice();
if (split.includes('updateState') && (!this.c.save || !state.c.save)) {
split.splice(split.indexOf('updateState'), 1);
}
@@ -1365,10 +1367,6 @@ var DataTable = $.fn.dataTable;
if (split.includes('removeState') && (!this.c.remove || !state.c.remove)) {
split.splice(split.indexOf('removeState'), 1);
}
if (split.length > 0 &&
!split.includes('<h3>' + state.s.identifier + '</h3>')) {
split.unshift('<h3>' + state.s.identifier + '</h3>');
}
stateButtons.push({
_stateRestore: state,
attr: {
@@ -1378,7 +1376,8 @@ var DataTable = $.fn.dataTable;
split: split
},
extend: 'stateRestore',
text: state.s.identifier
text: StateRestore.entityEncode(state.s.identifier),
popoverTitle: StateRestore.entityEncode(state.s.identifier)
});
}
}
@@ -1407,9 +1406,10 @@ var DataTable = $.fn.dataTable;
var _this = this;
this.dom.creation.empty();
this.dom.creationForm.empty();
this.dom.nameInputRow.children('input').val(identifier);
this.dom.nameInputRow.find('input').val(identifier);
this.dom.creationForm.append(this.dom.nameInputRow);
var tableConfig = this.s.dt.settings()[0].oInit;
var toggle;
var togglesToInsert = [];
var toggleDefined = options !== undefined && options.toggle !== undefined;
// Order toggle - check toggle and saving enabled
@@ -1526,8 +1526,8 @@ var DataTable = $.fn.dataTable;
}
// Make sure that the toggles are displayed alphabetically
togglesToInsert.sort(function (a, b) {
var aVal = a.children('label.dtsr-check-label')[0].innerHTML;
var bVal = b.children('label.dtsr-check-label')[0].innerHTML;
var aVal = a.text();
var bVal = b.text();
if (aVal < bVal) {
return -1;
}
@@ -1539,12 +1539,18 @@ var DataTable = $.fn.dataTable;
}
});
// Append all of the toggles that are to be inserted
var checkboxesEl = this.dom.checkboxInputRow
.appendTo(this.dom.creationForm)
.find('div.dtsr-input')
.empty();
// let checkboxes = $('<div class="'+this.classes.formRow+' '+this.classes.checkRow+'"></div>')
// .appendTo(this.dom.creationForm);
for (var _i = 0, togglesToInsert_1 = togglesToInsert; _i < togglesToInsert_1.length; _i++) {
var toggle = togglesToInsert_1[_i];
this.dom.creationForm.append(toggle);
toggle = togglesToInsert_1[_i];
checkboxesEl.append(toggle);
}
// Insert the toggle label next to the first check box
$$1(this.dom.creationForm.children('div.' + this.classes.checkRow)[0]).prepend(this.dom.toggleLabel);
// $(this.dom.creationForm.children('div.'+this.classes.checkRow)[0]).prepend(this.dom.toggleLabel);
// Insert the creation modal and the background
this.dom.background.appendTo(this.dom.dtContainer);
this.dom.creation
@@ -1553,15 +1559,12 @@ var DataTable = $.fn.dataTable;
.append(this.dom.createButtonRow)
.appendTo(this.dom.dtContainer);
$$1(this.s.dt.table().node()).trigger('dtsr-modal-inserted');
var _loop_2 = function (toggle) {
// Allow the label to be clicked to toggle the checkbox
for (var _a = 0, togglesToInsert_2 = togglesToInsert; _a < togglesToInsert_2.length; _a++) {
toggle = togglesToInsert_2[_a];
$$1(toggle.children('label:last-child')).on('click', function () {
toggle.children('input').prop('checked', !toggle.children('input').prop('checked'));
});
};
// Allow the label to be clicked to toggle the checkbox
for (var _a = 0, togglesToInsert_2 = togglesToInsert; _a < togglesToInsert_2.length; _a++) {
var toggle = togglesToInsert_2[_a];
_loop_2(toggle);
}
var creationButton = $$1('button.' + this.classes.creationButton.replace(/ /g, '.'));
var inputs = this.dom.creationForm.find('input');
@@ -1589,19 +1592,19 @@ var DataTable = $.fn.dataTable;
creationButton.on('click', function () {
// Get the values of the checkBoxes
var saveState = {
colReorder: _this.dom.colReorderToggle.children('input').is(':checked'),
colReorder: _this.dom.colReorderToggle.find('input').is(':checked'),
columns: {
search: _this.dom.columnsSearchToggle.children('input').is(':checked'),
visible: _this.dom.columnsVisibleToggle.children('input').is(':checked')
search: _this.dom.columnsSearchToggle.find('input').is(':checked'),
visible: _this.dom.columnsVisibleToggle.find('input').is(':checked')
},
length: _this.dom.lengthToggle.children('input').is(':checked'),
order: _this.dom.orderToggle.children('input').is(':checked'),
paging: _this.dom.pagingToggle.children('input').is(':checked'),
scroller: _this.dom.scrollerToggle.children('input').is(':checked'),
search: _this.dom.searchToggle.children('input').is(':checked'),
searchBuilder: _this.dom.searchBuilderToggle.children('input').is(':checked'),
searchPanes: _this.dom.searchPanesToggle.children('input').is(':checked'),
select: _this.dom.selectToggle.children('input').is(':checked')
length: _this.dom.lengthToggle.find('input').is(':checked'),
order: _this.dom.orderToggle.find('input').is(':checked'),
paging: _this.dom.pagingToggle.find('input').is(':checked'),
scroller: _this.dom.scrollerToggle.find('input').is(':checked'),
search: _this.dom.searchToggle.find('input').is(':checked'),
searchBuilder: _this.dom.searchBuilderToggle.find('input').is(':checked'),
searchPanes: _this.dom.searchPanesToggle.find('input').is(':checked'),
select: _this.dom.selectToggle.find('input').is(':checked')
};
// Call the buttons functionality passing in the identifier and what should be saved
var success = buttonAction($$1('input.' + _this.classes.nameInput.replace(/ /g, '.')).val(), { saveState: saveState });
@@ -1722,10 +1725,10 @@ var DataTable = $.fn.dataTable;
StateRestoreCollection.prototype._searchForStates = function () {
var _this = this;
var keys = Object.keys(localStorage);
var _loop_3 = function (key) {
var _loop_2 = function (key) {
// eslint-disable-next-line no-useless-escape
if (key.match(new RegExp('^DataTables_stateRestore_.*_' + location.pathname.replace(/\//g, '/') + '$')) ||
key.match(new RegExp('^DataTables_stateRestore_.*_' + location.pathname.replace(/\//g, '/') +
if (key.match(new RegExp('^DataTables_stateRestore_.*_' + location.pathname + '$')) ||
key.match(new RegExp('^DataTables_stateRestore_.*_' + location.pathname +
'_' + this_2.s.dt.table().node().id + '$'))) {
var loadedState_1 = JSON.parse(localStorage.getItem(key));
if (loadedState_1.stateRestore.isPreDefined ||
@@ -1750,7 +1753,7 @@ var DataTable = $.fn.dataTable;
var this_2 = this;
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
var key = keys_1[_i];
_loop_3(key);
_loop_2(key);
}
};
StateRestoreCollection.version = '1.0.0';
@@ -1817,7 +1820,7 @@ var DataTable = $.fn.dataTable;
searchPanes: 'SearchPanes',
select: 'Select',
title: 'Create New State',
toggleLabel: 'Includes:'
toggleLabel: 'Include:'
},
duplicateError: 'A state with this name already exists.',
emptyError: 'Name cannot be empty.',
@@ -1875,7 +1878,7 @@ var DataTable = $.fn.dataTable;
return StateRestoreCollection;
}());
/*! StateRestore 1.3.0
/*! StateRestore 1.4.1
* © SpryMedia Ltd - datatables.net/license
*/
setJQuery$1($);
@@ -2016,6 +2019,7 @@ var DataTable = $.fn.dataTable;
config._stateRestore.load();
node.blur();
},
className: 'dtsr-state',
config: {
split: ['updateState', 'renameState', 'removeState']
},
@@ -2090,8 +2094,8 @@ var DataTable = $.fn.dataTable;
var splitString = defaultString.split('%d');
replaceRegex = [];
for (var _i = 0, splitString_1 = splitString; _i < splitString_1.length; _i++) {
var split = splitString_1[_i];
replaceRegex.push(new RegExp(split));
var parts = splitString_1[_i];
replaceRegex.push(new RegExp(parts));
}
}
var getId = function (identifier) {
@@ -2148,11 +2152,10 @@ var DataTable = $.fn.dataTable;
}
if (stateRestoreOpts._createInSaved) {
stateButtons.push('createState');
stateButtons.push('');
}
for (var _a = 0, states_3 = states; _a < states_3.length; _a++) {
var state = states_3[_a];
var split = Object.assign([], stateRestoreOpts.splitSecondaries);
var split = stateRestoreOpts.splitSecondaries.slice();
if (split.includes('updateState') && !stateRestoreOpts.save) {
split.splice(split.indexOf('updateState'), 1);
}
@@ -2163,10 +2166,6 @@ var DataTable = $.fn.dataTable;
if (split.includes('removeState') && !stateRestoreOpts.remove) {
split.splice(split.indexOf('removeState'), 1);
}
if (split.length > 0 &&
!split.includes('<h3>' + state.s.identifier + '</h3>')) {
split.unshift('<h3>' + state.s.identifier + '</h3>');
}
stateButtons.push({
_stateRestore: state,
attr: {
@@ -2176,7 +2175,8 @@ var DataTable = $.fn.dataTable;
split: split
},
extend: 'stateRestore',
text: state.s.identifier
text: StateRestore.entityEncode(state.s.identifier),
popoverTitle: StateRestore.entityEncode(state.s.identifier)
});
}
dt.button('SaveStateRestore:name').collectionRebuild(stateButtons);
@@ -2267,12 +2267,13 @@ var DataTable = $.fn.dataTable;
var states = dt.stateRestore.states();
var button = dt.button('SaveStateRestore:name');
var stateButtons = [];
var i;
// Need to get the original configuration object, so we can rebuild it
// It might be nested, so need to traverse down the tree
if (button[0]) {
var idxs = button.index().split('-');
stateButtons = button[0].inst.c.buttons;
for (var i = 0; i < idxs.length; i++) {
for (i = 0; i < idxs.length; i++) {
if (stateButtons[idxs[i]].buttons) {
stateButtons = stateButtons[idxs[i]].buttons;
}
@@ -2284,7 +2285,7 @@ var DataTable = $.fn.dataTable;
}
var stateRestoreOpts = dt.settings()[0]._stateRestore.c;
// remove any states from the previous rebuild - if they are still there they will be added later
for (var i = 0; i < stateButtons.length; i++) {
for (i = 0; i < stateButtons.length; i++) {
if (stateButtons[i].extend === 'stateRestore') {
stateButtons.splice(i, 1);
i--;
@@ -2301,7 +2302,7 @@ var DataTable = $.fn.dataTable;
else {
for (var _i = 0, states_5 = states; _i < states_5.length; _i++) {
var state = states_5[_i];
var split = Object.assign([], stateRestoreOpts.splitSecondaries);
var split = stateRestoreOpts.splitSecondaries.slice();
if (split.includes('updateState') && !stateRestoreOpts.save) {
split.splice(split.indexOf('updateState'), 1);
}
@@ -2312,10 +2313,6 @@ var DataTable = $.fn.dataTable;
if (split.includes('removeState') && !stateRestoreOpts.remove) {
split.splice(split.indexOf('removeState'), 1);
}
if (split.length > 0 &&
!split.includes('<h3>' + state.s.identifier + '</h3>')) {
split.unshift('<h3>' + state.s.identifier + '</h3>');
}
stateButtons.push({
_stateRestore: state,
attr: {
@@ -2325,7 +2322,8 @@ var DataTable = $.fn.dataTable;
split: split
},
extend: 'stateRestore',
text: state.s.identifier
text: StateRestore.entityEncode(state.s.identifier),
popoverTitle: StateRestore.entityEncode(state.s.identifier)
});
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,497 @@
/*! StateRestore 1.4.1
* © SpryMedia Ltd - datatables.net/license
*/
/**
* @summary StateRestore
* @description StateRestore extension for DataTables
* @version 1.4.1
* @author SpryMedia Ltd
* @contact datatables.net
* @copyright Copyright SpryMedia Ltd.
*
* This source file is free software, available under the following license:
* MIT license - http://datatables.net/license/mit
*
* This source file is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
*
* For details please refer to: http://www.datatables.net
*/
/// <reference path = '../node_modules/@types/jquery/index.d.ts'
import StateRestore, { setJQuery as stateRestoreJQuery } from './StateRestore';
import StateRestoreCollection, { setJQuery as stateRestoreCollectionJQuery } from './StateRestoreCollection';
stateRestoreJQuery($);
stateRestoreCollectionJQuery($);
$.fn.dataTable.StateRestore = StateRestore;
$.fn.DataTable.StateRestore = StateRestore;
$.fn.dataTable.StateRestoreCollection = StateRestoreCollection;
$.fn.DataTable.StateRestoreCollection = StateRestoreCollection;
var apiRegister = DataTable.Api.register;
apiRegister('stateRestore()', function () {
return this;
});
apiRegister('stateRestore.state()', function (identifier) {
var ctx = this.context[0];
if (!ctx._stateRestore) {
var api = DataTable.Api(ctx);
var src = new DataTable.StateRestoreCollection(api, {});
_stateRegen(api, src);
}
this[0] = ctx._stateRestore.getState(identifier);
return this;
});
apiRegister('stateRestore.state.add()', function (identifier, options) {
var ctx = this.context[0];
if (!ctx._stateRestore) {
var api = DataTable.Api(ctx);
var src = new DataTable.StateRestoreCollection(api, {});
_stateRegen(api, src);
}
if (!ctx._stateRestore.c.create) {
return this;
}
if (ctx._stateRestore.addState) {
var states = ctx._stateRestore.s.states;
var ids = [];
for (var _i = 0, states_1 = states; _i < states_1.length; _i++) {
var intState = states_1[_i];
ids.push(intState.s.identifier);
}
ctx._stateRestore.addState(identifier, ids, options);
return this;
}
});
apiRegister('stateRestore.states()', function (ids) {
var ctx = this.context[0];
if (!ctx._stateRestore) {
var api = DataTable.Api(ctx);
var src = new DataTable.StateRestoreCollection(api, {});
_stateRegen(api, src);
}
this.length = 0;
this.push.apply(this, ctx._stateRestore.getStates(ids));
return this;
});
apiRegister('stateRestore.state().save()', function () {
var ctx = this[0];
// Check if saving states is allowed
if (ctx.c.save) {
ctx.save();
}
return this;
});
apiRegister('stateRestore.state().rename()', function (newIdentifier) {
var ctx = this.context[0];
var state = this[0];
// Check if renaming states is allowed
if (state.c.save) {
var states = ctx._stateRestore.s.states;
var ids = [];
for (var _i = 0, states_2 = states; _i < states_2.length; _i++) {
var intState = states_2[_i];
ids.push(intState.s.identifier);
}
state.rename(newIdentifier, ids);
}
return this;
});
apiRegister('stateRestore.state().load()', function () {
var ctx = this[0];
ctx.load();
return this;
});
apiRegister('stateRestore.state().remove()', function (skipModal) {
var ctx = this[0];
// Check if removal of states is allowed
if (ctx.c.remove) {
ctx.remove(skipModal);
}
return this;
});
apiRegister('stateRestore.states().remove()', function (skipModal) {
var _this = this;
var removeAllCallBack = function (skipModalIn) {
var success = true;
var that = _this.toArray();
while (that.length > 0) {
var set = that[0];
if (set !== undefined && set.c.remove) {
var tempSuccess = set.remove(skipModalIn);
if (tempSuccess !== true) {
success = tempSuccess;
}
else {
that.splice(0, 1);
}
}
else {
break;
}
}
return success;
};
if (this.context[0]._stateRestore && this.context[0]._stateRestore.c.remove) {
if (skipModal) {
removeAllCallBack(skipModal);
}
else {
this.context[0]._stateRestore.removeAll(removeAllCallBack);
}
}
return this;
});
apiRegister('stateRestore.activeStates()', function () {
var ctx = this.context[0];
this.length = 0;
if (!ctx._stateRestore) {
var api = DataTable.Api(ctx);
var src = new DataTable.StateRestoreCollection(api, {});
_stateRegen(api, src);
}
if (ctx._stateRestore) {
this.push.apply(this, ctx._stateRestore.findActive());
}
return this;
});
DataTable.ext.buttons.stateRestore = {
action: function (e, dt, node, config) {
config._stateRestore.load();
node.blur();
},
className: 'dtsr-state',
config: {
split: ['updateState', 'renameState', 'removeState']
},
text: function (dt) {
return dt.i18n('buttons.stateRestore', 'State %d', dt.stateRestore.states()[0].length + 1);
}
};
DataTable.ext.buttons.updateState = {
action: function (e, dt, node, config) {
$('div.dt-button-background').click();
config.parent._stateRestore.save();
},
text: function (dt) {
return dt.i18n('buttons.updateState', 'Update');
}
};
DataTable.ext.buttons.savedStates = {
buttons: [],
extend: 'collection',
init: function (dt, node, config) {
dt.on('stateRestore-change', function () {
dt.button(node).text(dt.i18n('buttons.savedStates', 'Saved States', dt.stateRestore.states().length));
});
if (dt.settings()[0]._stateRestore === undefined) {
_buttonInit(dt, config);
}
},
name: 'SaveStateRestore',
text: function (dt) {
return dt.i18n('buttons.savedStates', 'Saved States', 0);
}
};
DataTable.ext.buttons.savedStatesCreate = {
buttons: [],
extend: 'collection',
init: function (dt, node, config) {
dt.on('stateRestore-change', function () {
dt.button(node).text(dt.i18n('buttons.savedStates', 'Saved States', dt.stateRestore.states().length));
});
if (dt.settings()[0]._stateRestore === undefined) {
if (config.config === undefined) {
config.config = {};
}
config.config._createInSaved = true;
_buttonInit(dt, config);
}
},
name: 'SaveStateRestore',
text: function (dt) {
return dt.i18n('buttons.savedStates', 'Saved States', 0);
}
};
DataTable.ext.buttons.createState = {
action: function (e, dt, node, config) {
e.stopPropagation();
var stateRestoreOpts = dt.settings()[0]._stateRestore.c;
var language = dt.settings()[0].oLanguage;
// If creation/saving is not allowed then return
if (!stateRestoreOpts.create || !stateRestoreOpts.save) {
return;
}
var prevStates = dt.stateRestore.states().toArray();
// Create a replacement regex based on the i18n values
var defaultString = language.buttons !== undefined && language.buttons.stateRestore !== undefined ?
language.buttons.stateRestore :
'State ';
var replaceRegex;
if (defaultString.indexOf('%d') === defaultString.length - 3) {
replaceRegex = new RegExp(defaultString.replace(/%d/g, ''));
}
else {
var splitString = defaultString.split('%d');
replaceRegex = [];
for (var _i = 0, splitString_1 = splitString; _i < splitString_1.length; _i++) {
var parts = splitString_1[_i];
replaceRegex.push(new RegExp(parts));
}
}
var getId = function (identifier) {
var id;
if (Array.isArray(replaceRegex)) {
id = identifier;
for (var _i = 0, replaceRegex_1 = replaceRegex; _i < replaceRegex_1.length; _i++) {
var reg = replaceRegex_1[_i];
id = id.replace(reg, '');
}
}
else {
id = identifier.replace(replaceRegex, '');
}
// If the id after replacement is not a number, or the length is the same as before,
// it has been customised so return 0
if (isNaN(+id) || id.length === identifier) {
return 0;
}
// Otherwise return the number that has been assigned previously
else {
return +id;
}
};
// Extract the numbers from the identifiers that use the standard naming convention
var identifiers = prevStates
.map(function (state) { return getId(state.s.identifier); })
.sort(function (a, b) { return +a < +b ?
1 :
+a > +b ?
-1 :
0; });
var lastNumber = identifiers[0];
dt.stateRestore.state.add(dt.i18n('buttons.stateRestore', 'State %d', lastNumber !== undefined ? lastNumber + 1 : 1), config.config);
var states = dt.stateRestore.states().sort(function (a, b) {
var aId = +getId(a.s.identifier);
var bId = +getId(b.s.identifier);
return aId > bId ?
1 :
aId < bId ?
-1 :
0;
});
var button = dt.button('SaveStateRestore:name');
var stateButtons = button[0] !== undefined && button[0].inst.c.buttons[0].buttons !== undefined ?
button[0].inst.c.buttons[0].buttons :
[];
// remove any states from the previous rebuild - if they are still there they will be added later
for (var i = 0; i < stateButtons.length; i++) {
if (stateButtons[i].extend === 'stateRestore') {
stateButtons.splice(i, 1);
i--;
}
}
if (stateRestoreOpts._createInSaved) {
stateButtons.push('createState');
}
for (var _a = 0, states_3 = states; _a < states_3.length; _a++) {
var state = states_3[_a];
var split = stateRestoreOpts.splitSecondaries.slice();
if (split.includes('updateState') && !stateRestoreOpts.save) {
split.splice(split.indexOf('updateState'), 1);
}
if (split.includes('renameState') &&
(!stateRestoreOpts.save || !stateRestoreOpts.rename)) {
split.splice(split.indexOf('renameState'), 1);
}
if (split.includes('removeState') && !stateRestoreOpts.remove) {
split.splice(split.indexOf('removeState'), 1);
}
stateButtons.push({
_stateRestore: state,
attr: {
title: state.s.identifier
},
config: {
split: split
},
extend: 'stateRestore',
text: StateRestore.entityEncode(state.s.identifier),
popoverTitle: StateRestore.entityEncode(state.s.identifier)
});
}
dt.button('SaveStateRestore:name').collectionRebuild(stateButtons);
node.blur();
// Need to disable the removeAllStates button if there are no states and it is present
var buttons = dt.buttons();
for (var _b = 0, buttons_1 = buttons; _b < buttons_1.length; _b++) {
var butt = buttons_1[_b];
if ($(butt.node).hasClass('dtsr-removeAllStates')) {
if (states.length === 0) {
dt.button(butt.node).disable();
}
else {
dt.button(butt.node).enable();
}
}
}
},
init: function (dt, node, config) {
if (dt.settings()[0]._stateRestore === undefined && dt.button('SaveStateRestore:name').length > 1) {
_buttonInit(dt, config);
}
},
text: function (dt) {
return dt.i18n('buttons.createState', 'Create State');
}
};
DataTable.ext.buttons.removeState = {
action: function (e, dt, node, config) {
config.parent._stateRestore.remove();
node.blur();
},
text: function (dt) {
return dt.i18n('buttons.removeState', 'Remove');
}
};
DataTable.ext.buttons.removeAllStates = {
action: function (e, dt, node) {
dt.stateRestore.states().remove(true);
node.blur();
},
className: 'dt-button dtsr-removeAllStates',
init: function (dt, node) {
if (!dt.settings()[0]._stateRestore || dt.stateRestore.states().length === 0) {
$(node).addClass('disabled');
}
},
text: function (dt) {
return dt.i18n('buttons.removeAllStates', 'Remove All States');
}
};
DataTable.ext.buttons.renameState = {
action: function (e, dt, node, config) {
var states = dt.settings()[0]._stateRestore.s.states;
var ids = [];
for (var _i = 0, states_4 = states; _i < states_4.length; _i++) {
var state = states_4[_i];
ids.push(state.s.identifier);
}
config.parent._stateRestore.rename(undefined, ids);
node.blur();
},
text: function (dt) {
return dt.i18n('buttons.renameState', 'Rename');
}
};
function _init(settings, options) {
if (options === void 0) { options = null; }
var api = new DataTable.Api(settings);
var opts = options
? options
: api.init().stateRestore || DataTable.defaults.stateRestore;
var stateRestore = new StateRestoreCollection(api, opts);
_stateRegen(api, stateRestore);
return stateRestore;
}
/**
* Initialisation function if initialising using a button
*
* @param dt The datatables instance
* @param config the config for the button
*/
function _buttonInit(dt, config) {
var SRC = new DataTable.StateRestoreCollection(dt, config.config);
_stateRegen(dt, SRC);
}
function _stateRegen(dt, src) {
var states = dt.stateRestore.states();
var button = dt.button('SaveStateRestore:name');
var stateButtons = [];
var i;
// Need to get the original configuration object, so we can rebuild it
// It might be nested, so need to traverse down the tree
if (button[0]) {
var idxs = button.index().split('-');
stateButtons = button[0].inst.c.buttons;
for (i = 0; i < idxs.length; i++) {
if (stateButtons[idxs[i]].buttons) {
stateButtons = stateButtons[idxs[i]].buttons;
}
else {
stateButtons = [];
break;
}
}
}
var stateRestoreOpts = dt.settings()[0]._stateRestore.c;
// remove any states from the previous rebuild - if they are still there they will be added later
for (i = 0; i < stateButtons.length; i++) {
if (stateButtons[i].extend === 'stateRestore') {
stateButtons.splice(i, 1);
i--;
}
}
if (stateRestoreOpts._createInSaved) {
stateButtons.push('createState');
}
if (states === undefined || states.length === 0) {
stateButtons.push('<span class="' + src.classes.emptyStates + '">' +
dt.i18n('stateRestore.emptyStates', src.c.i18n.emptyStates) +
'</span>');
}
else {
for (var _i = 0, states_5 = states; _i < states_5.length; _i++) {
var state = states_5[_i];
var split = stateRestoreOpts.splitSecondaries.slice();
if (split.includes('updateState') && !stateRestoreOpts.save) {
split.splice(split.indexOf('updateState'), 1);
}
if (split.includes('renameState') &&
(!stateRestoreOpts.save || !stateRestoreOpts.rename)) {
split.splice(split.indexOf('renameState'), 1);
}
if (split.includes('removeState') && !stateRestoreOpts.remove) {
split.splice(split.indexOf('removeState'), 1);
}
stateButtons.push({
_stateRestore: state,
attr: {
title: state.s.identifier
},
config: {
split: split
},
extend: 'stateRestore',
text: StateRestore.entityEncode(state.s.identifier),
popoverTitle: StateRestore.entityEncode(state.s.identifier)
});
}
}
dt.button('SaveStateRestore:name').collectionRebuild(stateButtons);
// Need to disable the removeAllStates button if there are no states and it is present
var buttons = dt.buttons();
for (var _a = 0, buttons_2 = buttons; _a < buttons_2.length; _a++) {
var butt = buttons_2[_a];
if ($(butt.node).hasClass('dtsr-removeAllStates')) {
if (states.length === 0) {
dt.button(butt.node).disable();
}
else {
dt.button(butt.node).enable();
}
}
}
}
// Attach a listener to the document which listens for DataTables initialisation
// events so we can automatically initialise
$(document).on('preInit.dt.dtsr', function (e, settings) {
if (e.namespace !== 'dt') {
return;
}
if (settings.oInit.stateRestore ||
DataTable.defaults.stateRestore) {
if (!settings._stateRestore) {
_init(settings, null);
}
}
});

View File

@@ -47,7 +47,7 @@
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
}(function( $, window, document ) {
'use strict';
var DataTable = $.fn.dataTable;

View File

@@ -1,4 +1,4 @@
/*! Bootstrap integration for DataTables' StateRestore
* © SpryMedia Ltd - datatables.net/license
*/
!function(n){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-staterestore"],function(t){return n(t,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(t,e){e.fn.dataTable||require("datatables.net-bs")(t,e),e.fn.dataTable.StateRestore||require("datatables.net-staterestore")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||o(t),r(t,e),n(e,0,t.document)}:(r(window,o),module.exports=n(o,window,window.document))):n(jQuery,window,document)}(function(t,e,n,o){"use strict";var r=t.fn.dataTable;return t.extend(!0,r.StateRestoreCollection.classes,{checkBox:"dtsr-check-box form-check-input",creationButton:"dtsr-creation-button btn btn-default",creationForm:"dtsr-creation-form modal-body",creationText:"dtsr-creation-text modal-header",creationTitle:"dtsr-creation-title modal-title",nameInput:"dtsr-name-input form-control"}),t.extend(!0,r.StateRestore.classes,{confirmationButton:"dtsr-confirmation-button btn btn-default",confirmationTitle:"dtsr-confirmation title modal-header",input:"dtsr-input form-control"}),r});
!function(n){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-staterestore"],function(t){return n(t,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(t,e){e.fn.dataTable||require("datatables.net-bs")(t,e),e.fn.dataTable.StateRestore||require("datatables.net-staterestore")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||o(t),r(t,e),n(e,0,t.document)}:(r(window,o),module.exports=n(o,window,window.document))):n(jQuery,window,document)}(function(t,e,n){"use strict";var o=t.fn.dataTable;return t.extend(!0,o.StateRestoreCollection.classes,{checkBox:"dtsr-check-box form-check-input",creationButton:"dtsr-creation-button btn btn-default",creationForm:"dtsr-creation-form modal-body",creationText:"dtsr-creation-text modal-header",creationTitle:"dtsr-creation-title modal-title",nameInput:"dtsr-name-input form-control"}),t.extend(!0,o.StateRestore.classes,{confirmationButton:"dtsr-confirmation-button btn btn-default",confirmationTitle:"dtsr-confirmation title modal-header",input:"dtsr-input form-control"}),o});

View File

@@ -0,0 +1,4 @@
/*! Bootstrap integration for DataTables' StateRestore
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from"jquery";import DataTable from"datatables.net-bs";import StateRestore from"datatables.net-staterestore";let $=jQuery;$.extend(!0,DataTable.StateRestoreCollection.classes,{checkBox:"dtsr-check-box form-check-input",creationButton:"dtsr-creation-button btn btn-default",creationForm:"dtsr-creation-form modal-body",creationText:"dtsr-creation-text modal-header",creationTitle:"dtsr-creation-title modal-title",nameInput:"dtsr-name-input form-control"}),$.extend(!0,DataTable.StateRestore.classes,{confirmationButton:"dtsr-confirmation-button btn btn-default",confirmationTitle:"dtsr-confirmation title modal-header",input:"dtsr-input form-control"});export default DataTable;

View File

@@ -0,0 +1,27 @@
/*! Bootstrap integration for DataTables' StateRestore
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from 'jquery';
import DataTable from 'datatables.net-bs';
import StateRestore from 'datatables.net-staterestore';
// Allow reassignment of the $ variable
let $ = jQuery;
$.extend(true, DataTable.StateRestoreCollection.classes, {
checkBox: 'dtsr-check-box form-check-input',
creationButton: 'dtsr-creation-button btn btn-default',
creationForm: 'dtsr-creation-form modal-body',
creationText: 'dtsr-creation-text modal-header',
creationTitle: 'dtsr-creation-title modal-title',
nameInput: 'dtsr-name-input form-control'
});
$.extend(true, DataTable.StateRestore.classes, {
confirmationButton: 'dtsr-confirmation-button btn btn-default',
confirmationTitle: 'dtsr-confirmation title modal-header',
input: 'dtsr-input form-control'
});
export default DataTable;

View File

@@ -47,13 +47,13 @@
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
}(function( $, window, document ) {
'use strict';
var DataTable = $.fn.dataTable;
$.extend(true, DataTable.StateRestoreCollection.classes, {
checkBox: 'dtsr-check-box form-check-input',
checkBox: 'dtsr-check-box',
creationButton: 'dtsr-creation-button btn btn-secondary',
creationForm: 'dtsr-creation-form modal-body',
creationText: 'dtsr-creation-text modal-header',

View File

@@ -1,4 +1,4 @@
/*! Bootstrap integration for DataTables' StateRestore
* © SpryMedia Ltd - datatables.net/license
*/
!function(n){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net-bs4","datatables.net-staterestore"],function(t){return n(t,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(t,e){e.fn.dataTable||require("datatables.net-bs4")(t,e),e.fn.dataTable.StateRestore||require("datatables.net-staterestore")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||o(t),r(t,e),n(e,0,t.document)}:(r(window,o),module.exports=n(o,window,window.document))):n(jQuery,window,document)}(function(t,e,n,o){"use strict";var r=t.fn.dataTable;return t.extend(!0,r.StateRestoreCollection.classes,{checkBox:"dtsr-check-box form-check-input",creationButton:"dtsr-creation-button btn btn-secondary",creationForm:"dtsr-creation-form modal-body",creationText:"dtsr-creation-text modal-header",creationTitle:"dtsr-creation-title modal-title",nameInput:"dtsr-name-input form-control"}),t.extend(!0,r.StateRestore.classes,{confirmationButton:"dtsr-confirmation-button btn btn-secondary",input:"dtsr-input form-control"}),r});
!function(n){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net-bs4","datatables.net-staterestore"],function(t){return n(t,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(t,e){e.fn.dataTable||require("datatables.net-bs4")(t,e),e.fn.dataTable.StateRestore||require("datatables.net-staterestore")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||o(t),r(t,e),n(e,0,t.document)}:(r(window,o),module.exports=n(o,window,window.document))):n(jQuery,window,document)}(function(t,e,n){"use strict";var o=t.fn.dataTable;return t.extend(!0,o.StateRestoreCollection.classes,{checkBox:"dtsr-check-box",creationButton:"dtsr-creation-button btn btn-secondary",creationForm:"dtsr-creation-form modal-body",creationText:"dtsr-creation-text modal-header",creationTitle:"dtsr-creation-title modal-title",nameInput:"dtsr-name-input form-control"}),t.extend(!0,o.StateRestore.classes,{confirmationButton:"dtsr-confirmation-button btn btn-secondary",input:"dtsr-input form-control"}),o});

View File

@@ -0,0 +1,4 @@
/*! Bootstrap integration for DataTables' StateRestore
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from"jquery";import DataTable from"datatables.net-bs4";import StateRestore from"datatables.net-staterestore";let $=jQuery;$.extend(!0,DataTable.StateRestoreCollection.classes,{checkBox:"dtsr-check-box",creationButton:"dtsr-creation-button btn btn-secondary",creationForm:"dtsr-creation-form modal-body",creationText:"dtsr-creation-text modal-header",creationTitle:"dtsr-creation-title modal-title",nameInput:"dtsr-name-input form-control"}),$.extend(!0,DataTable.StateRestore.classes,{confirmationButton:"dtsr-confirmation-button btn btn-secondary",input:"dtsr-input form-control"});export default DataTable;

View File

@@ -0,0 +1,26 @@
/*! Bootstrap integration for DataTables' StateRestore
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from 'jquery';
import DataTable from 'datatables.net-bs4';
import StateRestore from 'datatables.net-staterestore';
// Allow reassignment of the $ variable
let $ = jQuery;
$.extend(true, DataTable.StateRestoreCollection.classes, {
checkBox: 'dtsr-check-box',
creationButton: 'dtsr-creation-button btn btn-secondary',
creationForm: 'dtsr-creation-form modal-body',
creationText: 'dtsr-creation-text modal-header',
creationTitle: 'dtsr-creation-title modal-title',
nameInput: 'dtsr-name-input form-control'
});
$.extend(true, DataTable.StateRestore.classes, {
confirmationButton: 'dtsr-confirmation-button btn btn-secondary',
input: 'dtsr-input form-control'
});
export default DataTable;

View File

@@ -47,7 +47,7 @@
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
}(function( $, window, document ) {
'use strict';
var DataTable = $.fn.dataTable;

View File

@@ -1,4 +1,4 @@
/*! Bootstrap integration for DataTables' StateRestore
* © SpryMedia Ltd - datatables.net/license
*/
!function(n){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net-bs5","datatables.net-staterestore"],function(e){return n(e,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(e,t){t.fn.dataTable||require("datatables.net-bs5")(e,t),t.fn.dataTable.StateRestore||require("datatables.net-staterestore")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||o(e),r(e,t),n(t,0,e.document)}:(r(window,o),module.exports=n(o,window,window.document))):n(jQuery,window,document)}(function(e,t,n,o){"use strict";var r=e.fn.dataTable;return e.extend(!0,r.StateRestoreCollection.classes,{checkBox:"dtsr-check-box form-check-input",checkLabel:"dtsr-check-label form-check-label",checkRow:"dtsr-check-row form-check",creationButton:"dtsr-creation-button btn btn-secondary",creationForm:"dtsr-creation-form modal-body",creationText:"dtsr-creation-text modal-header",creationTitle:"dtsr-creation-title modal-title",nameInput:"dtsr-name-input form-control",nameLabel:"dtsr-name-label form-label"}),e.extend(!0,r.StateRestore.classes,{confirmationButton:"dtsr-confirmation-button btn btn-secondary",input:"dtsr-input form-control"}),r});
!function(n){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net-bs5","datatables.net-staterestore"],function(e){return n(e,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(e,t){t.fn.dataTable||require("datatables.net-bs5")(e,t),t.fn.dataTable.StateRestore||require("datatables.net-staterestore")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||o(e),r(e,t),n(t,0,e.document)}:(r(window,o),module.exports=n(o,window,window.document))):n(jQuery,window,document)}(function(e,t,n){"use strict";var o=e.fn.dataTable;return e.extend(!0,o.StateRestoreCollection.classes,{checkBox:"dtsr-check-box form-check-input",checkLabel:"dtsr-check-label form-check-label",checkRow:"dtsr-check-row form-check",creationButton:"dtsr-creation-button btn btn-secondary",creationForm:"dtsr-creation-form modal-body",creationText:"dtsr-creation-text modal-header",creationTitle:"dtsr-creation-title modal-title",nameInput:"dtsr-name-input form-control",nameLabel:"dtsr-name-label form-label"}),e.extend(!0,o.StateRestore.classes,{confirmationButton:"dtsr-confirmation-button btn btn-secondary",input:"dtsr-input form-control"}),o});

View File

@@ -0,0 +1,4 @@
/*! Bootstrap integration for DataTables' StateRestore
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from"jquery";import DataTable from"datatables.net-bs5";import StateRestore from"datatables.net-staterestore";let $=jQuery;$.extend(!0,DataTable.StateRestoreCollection.classes,{checkBox:"dtsr-check-box form-check-input",checkLabel:"dtsr-check-label form-check-label",checkRow:"dtsr-check-row form-check",creationButton:"dtsr-creation-button btn btn-secondary",creationForm:"dtsr-creation-form modal-body",creationText:"dtsr-creation-text modal-header",creationTitle:"dtsr-creation-title modal-title",nameInput:"dtsr-name-input form-control",nameLabel:"dtsr-name-label form-label"}),$.extend(!0,DataTable.StateRestore.classes,{confirmationButton:"dtsr-confirmation-button btn btn-secondary",input:"dtsr-input form-control"});export default DataTable;

View File

@@ -0,0 +1,29 @@
/*! Bootstrap integration for DataTables' StateRestore
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from 'jquery';
import DataTable from 'datatables.net-bs5';
import StateRestore from 'datatables.net-staterestore';
// Allow reassignment of the $ variable
let $ = jQuery;
$.extend(true, DataTable.StateRestoreCollection.classes, {
checkBox: 'dtsr-check-box form-check-input',
checkLabel: 'dtsr-check-label form-check-label',
checkRow: 'dtsr-check-row form-check',
creationButton: 'dtsr-creation-button btn btn-secondary',
creationForm: 'dtsr-creation-form modal-body',
creationText: 'dtsr-creation-text modal-header',
creationTitle: 'dtsr-creation-title modal-title',
nameInput: 'dtsr-name-input form-control',
nameLabel: 'dtsr-name-label form-label'
});
$.extend(true, DataTable.StateRestore.classes, {
confirmationButton: 'dtsr-confirmation-button btn btn-secondary',
input: 'dtsr-input form-control'
});
export default DataTable;

View File

@@ -47,7 +47,7 @@
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
}(function( $, window, document ) {
'use strict';
var DataTable = $.fn.dataTable;

View File

@@ -1,4 +1,4 @@
/*! Bootstrap integration for DataTables' StateRestore
* © SpryMedia Ltd - datatables.net/license
*/
!function(n){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net-bm","datatables.net-staterestore"],function(t){return n(t,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(t,e){e.fn.dataTable||require("datatables.net-bm")(t,e),e.fn.dataTable.StateRestore||require("datatables.net-staterestore")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||o(t),r(t,e),n(e,0,t.document)}:(r(window,o),module.exports=n(o,window,window.document))):n(jQuery,window,document)}(function(t,e,n,o){"use strict";var r=t.fn.dataTable;return t.extend(!0,r.StateRestoreCollection.classes,{checkRow:"dtsr-check-row checkbox",creationButton:"dtsr-creation-button button",creationForm:"dtsr-creation-form modal-content",creationText:"dtsr-creation-text modal-header",creationTitle:"dtsr-creation-title modal-card-title",nameInput:"dtsr-name-input input"}),t.extend(!0,r.StateRestore.classes,{confirmationButton:"dtsr-confirmation-button button",confirmationTitle:"dtsr-confirmation-title modal-card-title",input:"dtsr-input input"}),r});
!function(n){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net-bm","datatables.net-staterestore"],function(t){return n(t,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(t,e){e.fn.dataTable||require("datatables.net-bm")(t,e),e.fn.dataTable.StateRestore||require("datatables.net-staterestore")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||o(t),r(t,e),n(e,0,t.document)}:(r(window,o),module.exports=n(o,window,window.document))):n(jQuery,window,document)}(function(t,e,n){"use strict";var o=t.fn.dataTable;return t.extend(!0,o.StateRestoreCollection.classes,{checkRow:"dtsr-check-row checkbox",creationButton:"dtsr-creation-button button",creationForm:"dtsr-creation-form modal-content",creationText:"dtsr-creation-text modal-header",creationTitle:"dtsr-creation-title modal-card-title",nameInput:"dtsr-name-input input"}),t.extend(!0,o.StateRestore.classes,{confirmationButton:"dtsr-confirmation-button button",confirmationTitle:"dtsr-confirmation-title modal-card-title",input:"dtsr-input input"}),o});

View File

@@ -0,0 +1,4 @@
/*! Bootstrap integration for DataTables' StateRestore
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from"jquery";import DataTable from"datatables.net-bm";import StateRestore from"datatables.net-staterestore";let $=jQuery;$.extend(!0,DataTable.StateRestoreCollection.classes,{checkRow:"dtsr-check-row checkbox",creationButton:"dtsr-creation-button button",creationForm:"dtsr-creation-form modal-content",creationText:"dtsr-creation-text modal-header",creationTitle:"dtsr-creation-title modal-card-title",nameInput:"dtsr-name-input input"}),$.extend(!0,DataTable.StateRestore.classes,{confirmationButton:"dtsr-confirmation-button button",confirmationTitle:"dtsr-confirmation-title modal-card-title",input:"dtsr-input input"});export default DataTable;

View File

@@ -0,0 +1,27 @@
/*! Bootstrap integration for DataTables' StateRestore
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from 'jquery';
import DataTable from 'datatables.net-bm';
import StateRestore from 'datatables.net-staterestore';
// Allow reassignment of the $ variable
let $ = jQuery;
$.extend(true, DataTable.StateRestoreCollection.classes, {
checkRow: 'dtsr-check-row checkbox',
creationButton: 'dtsr-creation-button button',
creationForm: 'dtsr-creation-form modal-content',
creationText: 'dtsr-creation-text modal-header',
creationTitle: 'dtsr-creation-title modal-card-title',
nameInput: 'dtsr-name-input input'
});
$.extend(true, DataTable.StateRestore.classes, {
confirmationButton: 'dtsr-confirmation-button button',
confirmationTitle: 'dtsr-confirmation-title modal-card-title',
input: 'dtsr-input input'
});
export default DataTable;

View File

@@ -47,7 +47,7 @@
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
}(function( $, window, document ) {
'use strict';
var DataTable = $.fn.dataTable;

View File

@@ -1,4 +1,4 @@
/*! Bootstrap integration for DataTables' StateRestore
* © SpryMedia Ltd - datatables.net/license
*/
!function(n){var o,d;"function"==typeof define&&define.amd?define(["jquery","datatables.net-dt","datatables.net-staterestore"],function(e){return n(e,window,document)}):"object"==typeof exports?(o=require("jquery"),d=function(e,t){t.fn.dataTable||require("datatables.net-dt")(e,t),t.fn.dataTable.StateRestore||require("datatables.net-staterestore")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||o(e),d(e,t),n(t,0,e.document)}:(d(window,o),module.exports=n(o,window,window.document))):n(jQuery,window,document)}(function(e,t,n,o){"use strict";return e.fn.dataTable});
!function(n){var o,d;"function"==typeof define&&define.amd?define(["jquery","datatables.net-dt","datatables.net-staterestore"],function(e){return n(e,window,document)}):"object"==typeof exports?(o=require("jquery"),d=function(e,t){t.fn.dataTable||require("datatables.net-dt")(e,t),t.fn.dataTable.StateRestore||require("datatables.net-staterestore")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||o(e),d(e,t),n(t,0,e.document)}:(d(window,o),module.exports=n(o,window,window.document))):n(jQuery,window,document)}(function(e,t,n){"use strict";return e.fn.dataTable});

View File

@@ -0,0 +1,4 @@
/*! Bootstrap integration for DataTables' StateRestore
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from"jquery";import DataTable from"datatables.net-dt";import StateRestore from"datatables.net-staterestore";let $=jQuery;export default DataTable;

Some files were not shown because too many files have changed in this diff Show More