datatables.net-autofill-bs 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/autoFill.bootstrap.css +27 -2
- package/css/autoFill.bootstrap.min.css +1 -1
- package/js/autoFill.bootstrap.js +14 -3
- package/js/autoFill.bootstrap.min.js +4 -5
- package/js/autoFill.bootstrap.min.mjs +4 -0
- package/js/autoFill.bootstrap.mjs +15 -0
- package/package.json +6 -4
- package/types/types.d.ts +182 -0
|
@@ -35,11 +35,25 @@ div.dt-autofill-list {
|
|
|
35
35
|
margin-left: -250px;
|
|
36
36
|
background-color: white;
|
|
37
37
|
border-radius: 6px;
|
|
38
|
-
box-shadow: 0 0
|
|
39
|
-
border:
|
|
38
|
+
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
|
|
39
|
+
border: 1px solid black;
|
|
40
40
|
z-index: 11;
|
|
41
41
|
box-sizing: border-box;
|
|
42
42
|
padding: 1.5em 2em;
|
|
43
|
+
padding-top: 2em;
|
|
44
|
+
}
|
|
45
|
+
div.dt-autofill-list div.dtaf-popover-close {
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: 6px;
|
|
48
|
+
right: 6px;
|
|
49
|
+
width: 22px;
|
|
50
|
+
height: 22px;
|
|
51
|
+
border: 1px solid #eaeaea;
|
|
52
|
+
background-color: #f9f9f9;
|
|
53
|
+
text-align: center;
|
|
54
|
+
border-radius: 3px;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
z-index: 12;
|
|
43
57
|
}
|
|
44
58
|
div.dt-autofill-list ul {
|
|
45
59
|
display: table;
|
|
@@ -50,6 +64,7 @@ div.dt-autofill-list ul {
|
|
|
50
64
|
}
|
|
51
65
|
div.dt-autofill-list ul li {
|
|
52
66
|
display: table-row;
|
|
67
|
+
cursor: pointer;
|
|
53
68
|
}
|
|
54
69
|
div.dt-autofill-list ul li:last-child div.dt-autofill-question, div.dt-autofill-list ul li:last-child div.dt-autofill-button {
|
|
55
70
|
border-bottom: none;
|
|
@@ -57,9 +72,13 @@ div.dt-autofill-list ul li:last-child div.dt-autofill-question, div.dt-autofill-
|
|
|
57
72
|
div.dt-autofill-list ul li:hover {
|
|
58
73
|
background-color: #f6f6f6;
|
|
59
74
|
}
|
|
75
|
+
div.dt-autofill-list ul li:hover button.btn {
|
|
76
|
+
background-color: #548bbb;
|
|
77
|
+
}
|
|
60
78
|
div.dt-autofill-list div.dt-autofill-question {
|
|
61
79
|
display: table-cell;
|
|
62
80
|
padding: 0.5em 0;
|
|
81
|
+
padding-left: 5px;
|
|
63
82
|
border-bottom: 1px solid #ccc;
|
|
64
83
|
}
|
|
65
84
|
div.dt-autofill-list div.dt-autofill-question input[type=number] {
|
|
@@ -70,7 +89,13 @@ div.dt-autofill-list div.dt-autofill-question input[type=number] {
|
|
|
70
89
|
div.dt-autofill-list div.dt-autofill-button {
|
|
71
90
|
display: table-cell;
|
|
72
91
|
padding: 0.5em 0;
|
|
92
|
+
padding-right: 5px;
|
|
73
93
|
border-bottom: 1px solid #ccc;
|
|
94
|
+
text-align: right;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
div.dtaf-popover-closeable {
|
|
98
|
+
padding-top: 2.5em;
|
|
74
99
|
}
|
|
75
100
|
|
|
76
101
|
div.dt-autofill-background {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
div.dt-autofill-handle{position:absolute;height:8px;width:8px;z-index:102;box-sizing:border-box;background:#337ab7;cursor:pointer}div.dtk-focus-alt div.dt-autofill-handle{background:#ff8b33}div.dt-autofill-select{position:absolute;z-index:1001;background-color:#337ab7;background-image:repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 255, 255, 0.5) 5px, rgba(255, 255, 255, 0.5) 10px)}div.dt-autofill-select.top,div.dt-autofill-select.bottom{height:3px;margin-top:-1px}div.dt-autofill-select.left,div.dt-autofill-select.right{width:3px;margin-left:-1px}div.dt-autofill-list{position:fixed;top:50%;left:50%;width:500px;margin-left:-250px;background-color:white;border-radius:6px;box-shadow:0 0
|
|
1
|
+
div.dt-autofill-handle{position:absolute;height:8px;width:8px;z-index:102;box-sizing:border-box;background:#337ab7;cursor:pointer}div.dtk-focus-alt div.dt-autofill-handle{background:#ff8b33}div.dt-autofill-select{position:absolute;z-index:1001;background-color:#337ab7;background-image:repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 255, 255, 0.5) 5px, rgba(255, 255, 255, 0.5) 10px)}div.dt-autofill-select.top,div.dt-autofill-select.bottom{height:3px;margin-top:-1px}div.dt-autofill-select.left,div.dt-autofill-select.right{width:3px;margin-left:-1px}div.dt-autofill-list{position:fixed;top:50%;left:50%;width:500px;margin-left:-250px;background-color:white;border-radius:6px;box-shadow:0 12px 30px rgba(0, 0, 0, 0.6);border:1px solid black;z-index:11;box-sizing:border-box;padding:1.5em 2em;padding-top:2em}div.dt-autofill-list div.dtaf-popover-close{position:absolute;top:6px;right:6px;width:22px;height:22px;border:1px solid #eaeaea;background-color:#f9f9f9;text-align:center;border-radius:3px;cursor:pointer;z-index:12}div.dt-autofill-list ul{display:table;margin:0;padding:0;list-style:none;width:100%}div.dt-autofill-list ul li{display:table-row;cursor:pointer}div.dt-autofill-list ul li:last-child div.dt-autofill-question,div.dt-autofill-list ul li:last-child div.dt-autofill-button{border-bottom:none}div.dt-autofill-list ul li:hover{background-color:#f6f6f6}div.dt-autofill-list ul li:hover button.btn{background-color:#548bbb}div.dt-autofill-list div.dt-autofill-question{display:table-cell;padding:.5em 0;padding-left:5px;border-bottom:1px solid #ccc}div.dt-autofill-list div.dt-autofill-question input[type=number]{padding:6px;width:30px;margin:-2px 0}div.dt-autofill-list div.dt-autofill-button{display:table-cell;padding:.5em 0;padding-right:5px;border-bottom:1px solid #ccc;text-align:right}div.dtaf-popover-closeable{padding-top:2.5em}div.dt-autofill-background{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%);z-index:10}@media screen and (max-width: 767px){div.dt-autofill-handle{height:16px;width:16px}div.dt-autofill-list{width:90%;left:74.5%}}div.dt-autofill-list div.dt-autofill-question input[type=number]{padding:6px;width:60px;margin:-2px 0}
|
package/js/autoFill.bootstrap.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
/*! Bootstrap integration for DataTables' AutoFill
|
|
2
3
|
* ©2015 SpryMedia Ltd - datatables.net/license
|
|
3
4
|
*/
|
|
@@ -13,17 +14,26 @@
|
|
|
13
14
|
// CommonJS
|
|
14
15
|
module.exports = function (root, $) {
|
|
15
16
|
if ( ! root ) {
|
|
17
|
+
// CommonJS environments without a window global must pass a
|
|
18
|
+
// root. This will give an error otherwise
|
|
16
19
|
root = window;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
|
-
if ( ! $
|
|
20
|
-
$ =
|
|
22
|
+
if ( ! $ ) {
|
|
23
|
+
$ = typeof window !== 'undefined' ? // jQuery's factory checks for a global window
|
|
24
|
+
require('jquery') :
|
|
25
|
+
require('jquery')( root );
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if ( ! $.fn.dataTable ) {
|
|
29
|
+
require('datatables.net-bs')(root, $);
|
|
21
30
|
}
|
|
22
31
|
|
|
23
32
|
if ( ! $.fn.dataTable.AutoFill ) {
|
|
24
33
|
require('datatables.net-autofill')(root, $);
|
|
25
34
|
}
|
|
26
35
|
|
|
36
|
+
|
|
27
37
|
return factory( $, root, root.document );
|
|
28
38
|
};
|
|
29
39
|
}
|
|
@@ -36,8 +46,9 @@
|
|
|
36
46
|
var DataTable = $.fn.dataTable;
|
|
37
47
|
|
|
38
48
|
|
|
49
|
+
|
|
39
50
|
DataTable.AutoFill.classes.btn = 'btn btn-primary';
|
|
40
51
|
|
|
41
52
|
|
|
42
53
|
return DataTable;
|
|
43
|
-
}));
|
|
54
|
+
}));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-autofill"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,c){a||(a=window);c&&c.fn.dataTable||(c=require("datatables.net-bs")(a,c).$);c.fn.dataTable.AutoFill||require("datatables.net-autofill")(a,c);return b(c,a,a.document)}:b(jQuery,window,document)})(function(b,a,c,d){b=b.fn.dataTable;b.AutoFill.classes.btn="btn btn-primary";return b});
|
|
1
|
+
/*! Bootstrap integration for DataTables' AutoFill
|
|
2
|
+
* ©2015 SpryMedia Ltd - datatables.net/license
|
|
3
|
+
*/
|
|
4
|
+
!function(n){"function"==typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-autofill"],function(e){return n(e,window,document)}):"object"==typeof exports?module.exports=function(e,t){return e=e||window,(t=t||("undefined"!=typeof window?require("jquery"):require("jquery")(e))).fn.dataTable||require("datatables.net-bs")(e,t),t.fn.dataTable.AutoFill||require("datatables.net-autofill")(e,t),n(t,0,e.document)}:n(jQuery,window,document)}(function(e,t,n,a){"use strict";e=e.fn.dataTable;return e.AutoFill.classes.btn="btn btn-primary",e});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Bootstrap integration for DataTables' AutoFill
|
|
2
|
+
* ©2015 SpryMedia Ltd - datatables.net/license
|
|
3
|
+
*/
|
|
4
|
+
import $ from"jquery";import DataTable from"datatables.net-bs";import AutoFill from"datatables.net-autofill";DataTable.AutoFill.classes.btn="btn btn-primary";export default DataTable;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
/*! Bootstrap integration for DataTables' AutoFill
|
|
3
|
+
* ©2015 SpryMedia Ltd - datatables.net/license
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import $ from 'jquery';
|
|
7
|
+
import DataTable from 'datatables.net-bs';
|
|
8
|
+
import AutoFill from 'datatables.net-autofill';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
DataTable.AutoFill.classes.btn = 'btn btn-primary';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export default DataTable;
|
package/package.json
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
"name": "datatables.net-autofill-bs",
|
|
3
3
|
"description": "AutoFill for DataTables with styling for [Bootstrap](https://getbootstrap.com/docs/3.3/)",
|
|
4
4
|
"main": "js/autoFill.bootstrap.js",
|
|
5
|
+
"module": "js/autoFill.bootstrap.mjs",
|
|
5
6
|
"style": "css/autoFill.bootstrap.css",
|
|
6
|
-
"types": "./types/
|
|
7
|
-
"version": "2.
|
|
7
|
+
"types": "./types/types.d.ts",
|
|
8
|
+
"version": "2.5.0",
|
|
8
9
|
"files": [
|
|
9
10
|
"css/**/*.css",
|
|
10
11
|
"js/**/*.js",
|
|
12
|
+
"js/**/*.mjs",
|
|
11
13
|
"types/**/*.d.ts"
|
|
12
14
|
],
|
|
13
15
|
"keywords": [
|
|
@@ -21,8 +23,8 @@
|
|
|
21
23
|
"sort"
|
|
22
24
|
],
|
|
23
25
|
"dependencies": {
|
|
24
|
-
"datatables.net-autofill": ">=2.
|
|
25
|
-
"datatables.net-bs": ">=1.
|
|
26
|
+
"datatables.net-autofill": ">=2.4.0",
|
|
27
|
+
"datatables.net-bs": ">=1.12.1",
|
|
26
28
|
"jquery": ">=1.7"
|
|
27
29
|
},
|
|
28
30
|
"moduleType": [
|
package/types/types.d.ts
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
// Type definitions for DataTables AutoFill
|
|
2
|
+
//
|
|
3
|
+
// Project: https://datatables.net/extensions/autofill/, https://datatables.net
|
|
4
|
+
// Definitions by:
|
|
5
|
+
// SpryMedia
|
|
6
|
+
// Andy Ma <https://github.com/andy-maca>
|
|
7
|
+
|
|
8
|
+
/// <reference types="jquery" />
|
|
9
|
+
|
|
10
|
+
import DataTables, {Api} from 'datatables.net';
|
|
11
|
+
|
|
12
|
+
export default DataTables;
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
16
|
+
* DataTables' types integration
|
|
17
|
+
*/
|
|
18
|
+
declare module 'datatables.net' {
|
|
19
|
+
interface Config {
|
|
20
|
+
/**
|
|
21
|
+
* autoFill extension options
|
|
22
|
+
*/
|
|
23
|
+
autoFill?: boolean | ConfigAutoFill;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface ConfigLanguage {
|
|
27
|
+
/**
|
|
28
|
+
* AutoFill language options
|
|
29
|
+
*/
|
|
30
|
+
autoFill?: ConfigAutoFillLanguage;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface Api<T> {
|
|
34
|
+
/**
|
|
35
|
+
* AutoFill methods container
|
|
36
|
+
*
|
|
37
|
+
* @returns Api for chaining with the additional autoFill methods
|
|
38
|
+
*/
|
|
39
|
+
autoFill: ApiAutoFill<T>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface ApiStatic {
|
|
43
|
+
/**
|
|
44
|
+
* AutoFill class
|
|
45
|
+
*/
|
|
46
|
+
AutoFill: {
|
|
47
|
+
/**
|
|
48
|
+
* Create a new AutoFill instance for the target DataTable
|
|
49
|
+
*/
|
|
50
|
+
new (dt: Api<any>, settings: boolean | ConfigAutoFill);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* AutoFill version
|
|
54
|
+
*/
|
|
55
|
+
version: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Default configuration values
|
|
59
|
+
*/
|
|
60
|
+
defaults: ConfigAutoFill;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
67
|
+
* Options
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
interface ConfigAutoFill {
|
|
71
|
+
/**
|
|
72
|
+
* Always ask the end user if an action should be taken or not
|
|
73
|
+
*/
|
|
74
|
+
alwaysAsk?: boolean;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Select the columns that can be auto filled
|
|
78
|
+
*/
|
|
79
|
+
columns?: string | number[];
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
* Attach an Editor instance for database updating
|
|
84
|
+
*/
|
|
85
|
+
editor?: any;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* Initial enablement state of AutoFill
|
|
90
|
+
*/
|
|
91
|
+
enable?: boolean;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Action that will cause the auto fill drag handle to appear in a cell
|
|
95
|
+
*/
|
|
96
|
+
focus?: 'click' | 'focus' | 'hover' | null;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Enable / disable user ability to horizontally drag and fill
|
|
100
|
+
*/
|
|
101
|
+
horizontal?: boolean;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Control automatic update of data when a fill drag is completed
|
|
105
|
+
*/
|
|
106
|
+
update?: boolean;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Enable / disable user ability to vertically drag and fill
|
|
110
|
+
*/
|
|
111
|
+
vertical?: boolean;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface ConfigAutoFillLanguage {
|
|
115
|
+
/**
|
|
116
|
+
* Multi-fill selector button text
|
|
117
|
+
*/
|
|
118
|
+
button?: string;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Multi-fill selector cancel option message
|
|
122
|
+
*/
|
|
123
|
+
cancel?: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Multi-fill selector message for the _full fill_ fill type
|
|
127
|
+
*/
|
|
128
|
+
fill?: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Multi-fill selector message for the _horizontal fill_ fill type
|
|
132
|
+
*/
|
|
133
|
+
fillHorizontal?: string;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Multi-fill selector message for the _vertical fill_ fill type
|
|
137
|
+
*/
|
|
138
|
+
fillVertical?: string;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Multi-fill selector message for the _increment_ fill type
|
|
142
|
+
*/
|
|
143
|
+
increment?: string;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Information message shown at the top of the fill type selector
|
|
147
|
+
*/
|
|
148
|
+
info?: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
153
|
+
* API
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
interface ApiAutoFill<T> {
|
|
157
|
+
(): ApiAutoFillMethods<T>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
interface ApiAutoFillMethods<T> extends Api<T> {
|
|
161
|
+
/**
|
|
162
|
+
* Disable AutoFill. Please note that this disallows future interactions with the table (until re-enabled).
|
|
163
|
+
*
|
|
164
|
+
* @returns DataTables Api instance
|
|
165
|
+
*/
|
|
166
|
+
disable(): Api<T>;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Enable end user and API modification of the focused cells in the DataTable. Differing levels of enablement are available via the optional parameter.
|
|
170
|
+
*
|
|
171
|
+
* @param flag can be true or false to signify whether to enable or disable
|
|
172
|
+
* @returns DataTables Api instance
|
|
173
|
+
*/
|
|
174
|
+
enable(flag?: string | boolean): Api<T>;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* This method will return a boolean value indicating if AutoFill is enabled or not on the selected table.
|
|
178
|
+
*
|
|
179
|
+
* @returns boolean signifying if autofill is enables
|
|
180
|
+
*/
|
|
181
|
+
enabled(): boolean;
|
|
182
|
+
}
|