From c89d43a8cf3525700ea62dd16b304096371a99c6 Mon Sep 17 00:00:00 2001 From: bedroesb Date: Wed, 6 Nov 2024 16:17:37 +0100 Subject: [PATCH 1/4] add docs --- pages/documentation/configuring_theme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pages/documentation/configuring_theme.md b/pages/documentation/configuring_theme.md index 5b4375a..cd324e4 100644 --- a/pages/documentation/configuring_theme.md +++ b/pages/documentation/configuring_theme.md @@ -52,6 +52,8 @@ theme_variables: edit_me: true open_issue: true history: true + datatables: + searchbuilder: False headings: related-pages: Related pages more-information-tiles: More information @@ -83,6 +85,8 @@ More detailed information about these settings can be found here: * `edit_me`: Enable the 'propose an edit on this page' button. * `open_issue`: Enable the 'open an issue on this page' button. * `history`: Enable the 'history of this page' button. +* **datatables**: Settings related to the DataTables JS library + * `searchbuilder`: SearchBuilder provides the end user with an easy to use UI for them to create their own complex custom search expression for a DataTable. Default: False. * **headings**: Change the subtitles or collapse the page sections that are automatically generated `related-pages`: Default: Related pages `more-information-tiles`: Default: More information From 8114818c4dc639fd5a6ee36fd33bc8002f2b7424 Mon Sep 17 00:00:00 2001 From: bedroesb Date: Wed, 6 Nov 2024 16:17:48 +0100 Subject: [PATCH 2/4] add searchbuilder dep --- assets/css/searchBuilder.bootstrap5.min.css | 1 + assets/js/dataTables.searchBuilder.min.js | 4 ++++ assets/js/searchBuilder.bootstrap5.min.js | 4 ++++ 3 files changed, 9 insertions(+) create mode 100644 assets/css/searchBuilder.bootstrap5.min.css create mode 100644 assets/js/dataTables.searchBuilder.min.js create mode 100644 assets/js/searchBuilder.bootstrap5.min.js diff --git a/assets/css/searchBuilder.bootstrap5.min.css b/assets/css/searchBuilder.bootstrap5.min.css new file mode 100644 index 0000000..b1e7b31 --- /dev/null +++ b/assets/css/searchBuilder.bootstrap5.min.css @@ -0,0 +1 @@ +div.dt-button-collection{overflow:visible !important;z-index:2002 !important}div.dt-button-collection div.dtsb-searchBuilder{box-sizing:border-box;padding-left:1em !important;padding-right:1em !important}div.dt-button-collection.dtb-collection-closeable div.dtsb-titleRow{padding-right:40px}.dtsb-greyscale{border:1px solid #cecece !important}div.dtsb-logicContainer .dtsb-greyscale{border:none !important}div.dtsb-searchBuilder{justify-content:space-evenly;cursor:default;margin-bottom:1em;text-align:left;width:100%}div.dtsb-searchBuilder button.dtsb-button,div.dtsb-searchBuilder select{font-size:1em}div.dtsb-searchBuilder div.dtsb-titleRow{justify-content:space-evenly;margin-bottom:.5em}div.dtsb-searchBuilder div.dtsb-titleRow div.dtsb-title{display:inline-block;padding-top:14px}div.dtsb-searchBuilder div.dtsb-titleRow div.dtsb-title:empty{display:inline}div.dtsb-searchBuilder div.dtsb-titleRow button.dtsb-clearAll{float:right;margin-bottom:.8em}div.dtsb-searchBuilder div.dtsb-vertical .dtsb-value,div.dtsb-searchBuilder div.dtsb-vertical .dtsb-data,div.dtsb-searchBuilder div.dtsb-vertical .dtsb-condition{display:block}div.dtsb-searchBuilder div.dtsb-group{position:relative;clear:both;margin-bottom:.8em}div.dtsb-searchBuilder div.dtsb-group button.dtsb-search{float:right}div.dtsb-searchBuilder div.dtsb-group button.dtsb-clearGroup{margin:2px;text-align:center;padding:0}div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-o-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);position:absolute;margin-top:.8em;margin-right:.8em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria{margin-bottom:.8em;display:flex;justify-content:start;flex-flow:row wrap}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-dropDown,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria input.dtsb-input{padding:.4em;margin-right:.8em;min-width:5em;max-width:20em;color:inherit;font-size:1em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-dropDown option.dtsb-notItalic,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria input.dtsb-input option.dtsb-notItalic{font-style:normal}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-italic{font-style:italic}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-inputCont{flex:1;white-space:nowrap}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-inputCont span.dtsb-joiner{margin-right:.8em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-inputCont input.dtsb-value{width:33%}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-inputCont select,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-inputCont input{height:100%;box-sizing:border-box}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer{margin-left:auto;display:inline-block}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-delete,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-right,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-left{margin-right:.8em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-delete:last-child,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-right:last-child,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-left:last-child{margin-right:0}@media screen and (max-width: 550px){div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria{display:flex;flex-flow:none;flex-direction:column;justify-content:start;padding-right:calc(35px + .8em);margin-bottom:0px}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria:not(:first-child),div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria:not(:nth-child(2)),div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria:not(:last-child){padding-top:.8em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria:first-child,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria:nth-child(2),div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria:last-child{padding-top:0em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-dropDown,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria input.dtsb-input{max-width:none;width:100%;margin-bottom:.8em;margin-right:.8em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-inputCont{margin-right:.8em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer{position:absolute;width:35px;display:flex;flex-wrap:wrap-reverse;right:0}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button{margin-right:0px !important}}div.dtsb-searchBuilder div.dtsb-titleRow{height:40px}div.dtsb-searchBuilder div.dtsb-titleRow div.dtsb-title{padding-top:10px}div.dtsb-searchBuilder div.dtsb-group button.dtsb-clearGroup{margin-right:8px}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria .form-select{width:auto;display:inline-block;padding-right:30px !important}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-condition{border-color:#28a745}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-data{border-color:#dc3545}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-value,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria input.dtsb-value{border-color:#007bff}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria .form-control{display:inline-block;font-size:1em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer{border-radius:4px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-content:flex-start;align-items:flex-start;margin-top:10px;overflow:hidden}div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer button.dtsb-logic{border:none;border-radius:0px;flex-grow:1;flex-shrink:0;flex-basis:3em;margin:0px;padding:.375rem .7rem}div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer button.dtsb-clearGroup{border:none;border-radius:0px;width:2em;margin:0px}div.dt-button-collection div.dtsb-searchBuilder{padding-left:10px;padding-right:10px} diff --git a/assets/js/dataTables.searchBuilder.min.js b/assets/js/dataTables.searchBuilder.min.js new file mode 100644 index 0000000..6a0e314 --- /dev/null +++ b/assets/js/dataTables.searchBuilder.min.js @@ -0,0 +1,4 @@ +/*! SearchBuilder 1.8.1 + * ©SpryMedia Ltd - datatables.net/license/mit + */ +!function(e){var n,s;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return e(t,window,document)}):"object"==typeof exports?(n=require("jquery"),s=function(t,i){i.fn.dataTable||require("datatables.net")(t,i)},"undefined"==typeof window?module.exports=function(t,i){return t=t||window,i=i||n(t),s(t,i),e(i,t,t.document)}:(s(window,n),module.exports=e(n,window,window.document))):e(jQuery,window,document)}(function(s,u,t){"use strict";var w,c,a,d,l,h,p,e,i,B=s.fn.dataTable;function o(){var t=B.use("moment");return t||u.moment}function r(){var t=B.use("luxon");return t||u.luxon}function D(t,i,e,n,s,o,r){void 0===n&&(n=0),void 0===s&&(s=1),void 0===o&&(o=void 0),void 0===r&&(r=!1);var a=this,i=(this.classes=w.extend(!0,{},D.classes),this.c=w.extend(!0,{},D.defaults,w.fn.dataTable.ext.searchBuilder,i),this.c.i18n);if(this.s={condition:void 0,conditions:{},data:void 0,dataIdx:-1,dataPoints:[],dateFormat:!1,depth:s,dt:t,filled:!1,index:n,liveSearch:r,origData:void 0,preventRedraw:!1,serverData:o,topGroup:e,type:"",value:[]},this.dom={buttons:w("
").addClass(this.classes.buttonContainer),condition:w("").addClass(this.classes.data).addClass(this.classes.dropDown).addClass(this.classes.italic),dataTitle:w('