Browse Source

add datatables searchpanes plugin

REJack 4 years ago
parent
commit
1f7db49d54

+ 12 - 0
build/npm/Plugins.js

@@ -246,6 +246,18 @@ const Plugins = [
     to: 'plugins/datatables-scroller/css'
   },
   {
+    from: 'node_modules/datatables.net-searchpanes/js',
+    to: 'plugins/datatables-searchpanes/js'
+  },
+  {
+    from: 'node_modules/datatables.net-searchpanes-bs4/js',
+    to: 'plugins/datatables-searchpanes/js'
+  },
+  {
+    from: 'node_modules/datatables.net-searchpanes-bs4/css',
+    to: 'plugins/datatables-searchpanes/css'
+  },
+  {
     from: 'node_modules/datatables.net-select/js',
     to: 'plugins/datatables-select/js'
   },

+ 19 - 0
package-lock.json

@@ -3463,6 +3463,25 @@
         "jquery": ">=1.7"
       }
     },
+    "datatables.net-searchpanes": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/datatables.net-searchpanes/-/datatables.net-searchpanes-1.2.1.tgz",
+      "integrity": "sha512-SnyWsuM86dZPCMgu0Bz7BeZwbQd4yUsGeKll54sRfYLU/zmTt+1wKzrlTsaNVmFCN2xIlnur8uFj2FBNaQmNlQ==",
+      "requires": {
+        "datatables.net": "^1.10.15",
+        "jquery": ">=1.7"
+      }
+    },
+    "datatables.net-searchpanes-bs4": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/datatables.net-searchpanes-bs4/-/datatables.net-searchpanes-bs4-1.2.1.tgz",
+      "integrity": "sha512-SOpMGerNomrar4s+23LDZQRBYrFF+m4flGjigLRTDPEaKFzRR28WXEUR5WJ6ZZlxnE7rSg5YS1qH6pIRMdDdKg==",
+      "requires": {
+        "datatables.net-bs4": "^1.10.15",
+        "datatables.net-searchpanes": "1.2.1",
+        "jquery": ">=1.7"
+      }
+    },
     "datatables.net-select": {
       "version": "1.3.1",
       "resolved": "https://registry.npmjs.org/datatables.net-select/-/datatables.net-select-1.3.1.tgz",

+ 1 - 0
package.json

@@ -92,6 +92,7 @@
     "datatables.net-rowgroup-bs4": "^1.1.2",
     "datatables.net-rowreorder-bs4": "^1.2.7",
     "datatables.net-scroller-bs4": "^2.0.3",
+    "datatables.net-searchpanes-bs4": "^1.2.1",
     "datatables.net-select-bs4": "^1.3.1",
     "daterangepicker": "^3.1.0",
     "dropzone": "^5.7.2",

File diff suppressed because it is too large
+ 339 - 0
plugins/datatables-searchpanes/css/searchPanes.bootstrap4.css


File diff suppressed because it is too large
+ 1 - 0
plugins/datatables-searchpanes/css/searchPanes.bootstrap4.min.css


File diff suppressed because it is too large
+ 2550 - 0
plugins/datatables-searchpanes/js/dataTables.searchPanes.js


File diff suppressed because it is too large
+ 89 - 0
plugins/datatables-searchpanes/js/dataTables.searchPanes.min.js


+ 58 - 0
plugins/datatables-searchpanes/js/searchPanes.bootstrap4.js

@@ -0,0 +1,58 @@
+(function (factory) {
+    if (typeof define === 'function' && define.amd) {
+        // AMD
+        define(['jquery', 'datatables.net-bs4', 'datatables.net-searchpanes'], function ($) {
+            return factory($, window, document);
+        });
+    }
+    else if (typeof exports === 'object') {
+        // CommonJS
+        module.exports = function (root, $) {
+            if (!root) {
+                root = window;
+            }
+            if (!$ || !$.fn.dataTable) {
+                $ = require('datatables.net-bs4')(root, $).$;
+            }
+            console.log($.fn.dataTable);
+            if (!$.fn.dataTable.SearchPanes) {
+                console.log("not present");
+                require('datatables.net-searchpanes')(root, $);
+            }
+            return factory($, root, root.document);
+        };
+    }
+    else {
+        // Browser
+        factory(jQuery, window, document);
+    }
+}(function ($, window, document) {
+    'use strict';
+    var DataTable = $.fn.dataTable;
+    $.extend(true, DataTable.SearchPane.classes, {
+        buttonGroup: 'btn-group col justify-content-end',
+        disabledButton: 'disabled',
+        dull: '',
+        narrow: 'col',
+        pane: {
+            container: 'table'
+        },
+        paneButton: 'btn btn-light',
+        pill: 'pill badge badge-pill badge-secondary',
+        search: 'col-sm form-control search',
+        searchCont: 'input-group col-sm',
+        searchLabelCont: 'input-group-append',
+        subRow1: 'dtsp-subRow1',
+        subRow2: 'dtsp-subRow2',
+        table: 'table table-sm table-borderless',
+        topRow: 'dtsp-topRow row'
+    });
+    $.extend(true, DataTable.SearchPanes.classes, {
+        clearAll: 'dtsp-clearAll col-auto btn btn-light',
+        container: 'dtsp-searchPanes',
+        panes: 'dtsp-panes dtsp-container',
+        title: 'dtsp-title col',
+        titleRow: 'dtsp-titleRow row'
+    });
+    return DataTable.searchPanes;
+}));

File diff suppressed because it is too large
+ 3 - 0
plugins/datatables-searchpanes/js/searchPanes.bootstrap4.min.js