terminando servicios manipulados y preimpresion

This commit is contained in:
2023-12-04 20:50:58 +01:00
parent 76c815212f
commit ab6763aeaa
329 changed files with 811 additions and 59359 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,272 +0,0 @@
/*! Bootstrap integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net-bs', 'datatables.net-editor'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
var jq = require('jquery');
var cjsRequires = function (root, $) {
if ( ! $.fn.dataTable ) {
require('datatables.net-bs')(root, $);
}
if ( ! $.fn.dataTable.Editor ) {
require('datatables.net-editor')(root, $);
}
};
if (typeof window === 'undefined') {
module.exports = function (root, $) {
if ( ! root ) {
// CommonJS environments without a window global must pass a
// root. This will give an error otherwise
root = window;
}
if ( ! $ ) {
$ = jq( root );
}
cjsRequires( root, $ );
return factory( $, root, root.document );
};
}
else {
cjsRequires( window, jq );
module.exports = factory( jq, window, window.document );
}
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
var Editor = DataTable.Editor;
/*
* Set the default display controller to be our bootstrap control
*/
DataTable.Editor.defaults.display = "bootstrap";
/*
* Change the default classes from Editor to be classes for Bootstrap
*/
$.extend( true, $.fn.dataTable.Editor.classes, {
"header": {
"wrapper": "DTE_Header modal-header",
title: {
tag: 'h4',
class: 'modal-title'
}
},
"body": {
"wrapper": "DTE_Body modal-body"
},
"footer": {
"wrapper": "DTE_Footer modal-footer"
},
"form": {
"tag": "form-horizontal",
"button": "btn btn-default",
"buttonInternal": "btn btn-default"
},
"field": {
"wrapper": "DTE_Field",
"label": "col-lg-4 control-label",
"input": "col-lg-8 controls",
"error": "error has-error",
"msg-labelInfo": "help-block",
"msg-info": "help-block",
"msg-message": "help-block",
"msg-error": "help-block",
"multiValue": "well well-sm multi-value",
"multiInfo": "small",
"multiRestore": "well well-sm multi-restore"
}
} );
$.extend( true, DataTable.ext.buttons, {
create: {
formButtons: {
className: 'btn-primary'
}
},
edit: {
formButtons: {
className: 'btn-primary'
}
},
remove: {
formButtons: {
className: 'btn-danger'
}
}
} );
DataTable.Editor.fieldTypes.datatable.tableClass = 'table';
let shown = false;
let fullyShown = false;
const dom = {
// Note that `modal-dialog-scrollable` is BS4.3+ only. It has no effect on 4.0-4.2
content: $(
'<div class="modal fade DTED">'+
'<div class="modal-dialog">'+
'<div class="modal-content"></div>'+
'</div>'+
'</div>'
),
close: $('<button class="close">&times;</div>')
};
/*
* Bootstrap display controller - this is effectively a proxy to the Bootstrap
* modal control.
*/
DataTable.Editor.display.bootstrap = $.extend( true, {}, DataTable.Editor.models.displayController, {
init: function ( dte ) {
// Add `form-control` to required elements
dte.on( 'displayOrder.dtebs open.dtebs', function ( e, display, action, form ) {
$.each( dte.s.fields, function ( key, field ) {
$('input:not([type=checkbox]):not([type=radio]), select, textarea', field.node() )
.addClass( 'form-control' );
} );
} );
return DataTable.Editor.display.bootstrap;
},
open: function ( dte, append, callback ) {
$(append).addClass('modal-content');
// Special class for DataTable buttons in the form
$(append).find('div.DTE_Field_Type_datatable div.dt-buttons')
.removeClass('btn-group')
.addClass('btn-group-vertical');
var content = dom.content.find('div.modal-dialog');
content.children().detach();
content.append( append );
// Setup events on each show
dom.close
.attr('title', dte.i18n.close)
.off('click.dte-bs3')
.on('click.dte-bs3', function () {
dte.close('icon');
})
.prependTo($('div.modal-header', dom.content));
// This is a bit horrible, but if you mousedown and then drag out of the modal container, we don't
// want to trigger a background action.
var allowBackgroundClick = false;
$(document)
.off('mousedown.dte-bs3')
.on('mousedown.dte-bs3', 'div.modal', function (e) {
if ( ! shown ) {
return;
}
allowBackgroundClick = $(e.target).hasClass('modal') && shown
? true
: false;
} );
$(document)
.off('click.dte-bs3')
.on('click.dte-bs3', 'div.modal', function (e) {
if ( $(e.target).hasClass('modal') && allowBackgroundClick ) {
dte.background();
}
if ( ! $(e.target).hasClass('modal') ) {
return;
}
// If scrollbar shown
if ($('div.modal-dialog').height() > $(e.target).height()) {
// And if clicking inside it - do nothing
if (e.pageX >= document.body.offsetWidth - DataTable.__browser.barWidth) {
return;
}
}
// All checks pass - do background action
dte.background();
} );
if ( shown ) {
if ( callback ) {
callback();
}
return;
}
shown = true;
fullyShown = false;
$(dom.content)
.one('shown.bs.modal', function () {
// Can only give elements focus when shown
if ( dte.s.setFocus ) {
dte.s.setFocus.focus();
}
if ( callback ) {
callback();
}
})
.one('hidden', function () {
shown = false;
})
.appendTo( 'body' )
.modal( {
backdrop: "static",
keyboard: false
} );
dom.close.prependTo($('div.modal-header', dom.content));
},
close: function ( dte, callback ) {
if ( ! shown ) {
if ( callback ) {
callback();
}
return;
}
$(dom.content)
.one( 'hidden.bs.modal', function () {
$(this).detach();
} )
.modal('hide');
shown = false;
if ( callback ) {
callback();
}
},
node: function ( dte ) {
return dom.content[0];
}
} );
return Editor;
}));

View File

@ -1,4 +0,0 @@
/*! Bootstrap integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
!function(o){var d,n;"function"==typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-editor"],function(e){return o(e,window,document)}):"object"==typeof exports?(d=require("jquery"),n=function(e,t){t.fn.dataTable||require("datatables.net-bs")(e,t),t.fn.dataTable.Editor||require("datatables.net-editor")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||d(e),n(e,t),o(t,0,e.document)}:(n(window,d),module.exports=o(d,window,window.document))):o(jQuery,window,document)}(function(a,e,l,t){"use strict";var s=a.fn.dataTable,o=s.Editor;s.Editor.defaults.display="bootstrap",a.extend(!0,a.fn.dataTable.Editor.classes,{header:{wrapper:"DTE_Header modal-header",title:{tag:"h4",class:"modal-title"}},body:{wrapper:"DTE_Body modal-body"},footer:{wrapper:"DTE_Footer modal-footer"},form:{tag:"form-horizontal",button:"btn btn-default",buttonInternal:"btn btn-default"},field:{wrapper:"DTE_Field",label:"col-lg-4 control-label",input:"col-lg-8 controls",error:"error has-error","msg-labelInfo":"help-block","msg-info":"help-block","msg-message":"help-block","msg-error":"help-block",multiValue:"well well-sm multi-value",multiInfo:"small",multiRestore:"well well-sm multi-restore"}}),a.extend(!0,s.ext.buttons,{create:{formButtons:{className:"btn-primary"}},edit:{formButtons:{className:"btn-primary"}},remove:{formButtons:{className:"btn-danger"}}});let r=!(s.Editor.fieldTypes.datatable.tableClass="table");const i={content:a('<div class="modal fade DTED"><div class="modal-dialog"><div class="modal-content"></div></div></div>'),close:a('<button class="close">&times;</div>')};return s.Editor.display.bootstrap=a.extend(!0,{},s.Editor.models.displayController,{init:function(n){return n.on("displayOrder.dtebs open.dtebs",function(e,t,o,d){a.each(n.s.fields,function(e,t){a("input:not([type=checkbox]):not([type=radio]), select, textarea",t.node()).addClass("form-control")})}),s.Editor.display.bootstrap},open:function(t,e,o){a(e).addClass("modal-content"),a(e).find("div.DTE_Field_Type_datatable div.dt-buttons").removeClass("btn-group").addClass("btn-group-vertical");var d=i.content.find("div.modal-dialog"),n=(d.children().detach(),d.append(e),i.close.attr("title",t.i18n.close).off("click.dte-bs3").on("click.dte-bs3",function(){t.close("icon")}).prependTo(a("div.modal-header",i.content)),!1);a(l).off("mousedown.dte-bs3").on("mousedown.dte-bs3","div.modal",function(e){r&&(n=!(!a(e.target).hasClass("modal")||!r))}),a(l).off("click.dte-bs3").on("click.dte-bs3","div.modal",function(e){a(e.target).hasClass("modal")&&n&&t.background(),!a(e.target).hasClass("modal")||a("div.modal-dialog").height()>a(e.target).height()&&e.pageX>=l.body.offsetWidth-s.__browser.barWidth||t.background()}),r?o&&o():(r=!0,a(i.content).one("shown.bs.modal",function(){t.s.setFocus&&t.s.setFocus.focus(),o&&o()}).one("hidden",function(){r=!1}).appendTo("body").modal({backdrop:"static",keyboard:!1}),i.close.prependTo(a("div.modal-header",i.content)))},close:function(e,t){r&&(a(i.content).one("hidden.bs.modal",function(){a(this).detach()}).modal("hide"),r=!1),t&&t()},node:function(e){return i.content[0]}}),o});

View File

@ -1,4 +0,0 @@
/*! Bootstrap integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from"jquery";import DataTable from"datatables.net-bs";import Editor from"datatables.net-editor";let $=jQuery;var Editor=DataTable.Editor;DataTable.Editor.defaults.display="bootstrap",$.extend(!0,$.fn.dataTable.Editor.classes,{header:{wrapper:"DTE_Header modal-header",title:{tag:"h4",class:"modal-title"}},body:{wrapper:"DTE_Body modal-body"},footer:{wrapper:"DTE_Footer modal-footer"},form:{tag:"form-horizontal",button:"btn btn-default",buttonInternal:"btn btn-default"},field:{wrapper:"DTE_Field",label:"col-lg-4 control-label",input:"col-lg-8 controls",error:"error has-error","msg-labelInfo":"help-block","msg-info":"help-block","msg-message":"help-block","msg-error":"help-block",multiValue:"well well-sm multi-value",multiInfo:"small",multiRestore:"well well-sm multi-restore"}}),$.extend(!0,DataTable.ext.buttons,{create:{formButtons:{className:"btn-primary"}},edit:{formButtons:{className:"btn-primary"}},remove:{formButtons:{className:"btn-danger"}}});let shown=!(DataTable.Editor.fieldTypes.datatable.tableClass="table"),fullyShown=!1;const dom={content:$('<div class="modal fade DTED"><div class="modal-dialog"><div class="modal-content"></div></div></div>'),close:$('<button class="close">&times;</div>')};DataTable.Editor.display.bootstrap=$.extend(!0,{},DataTable.Editor.models.displayController,{init:function(d){return d.on("displayOrder.dtebs open.dtebs",function(o,t,e,a){$.each(d.s.fields,function(o,t){$("input:not([type=checkbox]):not([type=radio]), select, textarea",t.node()).addClass("form-control")})}),DataTable.Editor.display.bootstrap},open:function(t,o,e){$(o).addClass("modal-content"),$(o).find("div.DTE_Field_Type_datatable div.dt-buttons").removeClass("btn-group").addClass("btn-group-vertical");var a=dom.content.find("div.modal-dialog"),d=(a.children().detach(),a.append(o),dom.close.attr("title",t.i18n.close).off("click.dte-bs3").on("click.dte-bs3",function(){t.close("icon")}).prependTo($("div.modal-header",dom.content)),!1);$(document).off("mousedown.dte-bs3").on("mousedown.dte-bs3","div.modal",function(o){shown&&(d=!(!$(o.target).hasClass("modal")||!shown))}),$(document).off("click.dte-bs3").on("click.dte-bs3","div.modal",function(o){$(o.target).hasClass("modal")&&d&&t.background(),!$(o.target).hasClass("modal")||$("div.modal-dialog").height()>$(o.target).height()&&o.pageX>=document.body.offsetWidth-DataTable.__browser.barWidth||t.background()}),shown?e&&e():(shown=!0,fullyShown=!1,$(dom.content).one("shown.bs.modal",function(){t.s.setFocus&&t.s.setFocus.focus(),e&&e()}).one("hidden",function(){shown=!1}).appendTo("body").modal({backdrop:"static",keyboard:!1}),dom.close.prependTo($("div.modal-header",dom.content)))},close:function(o,t){shown&&($(dom.content).one("hidden.bs.modal",function(){$(this).detach()}).modal("hide"),shown=!1),t&&t()},node:function(o){return dom.content[0]}});export default Editor;

View File

@ -1,228 +0,0 @@
/*! Bootstrap integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from 'jquery';
import DataTable from 'datatables.net-bs';
import Editor from 'datatables.net-editor';
// Allow reassignment of the $ variable
let $ = jQuery;
var Editor = DataTable.Editor;
/*
* Set the default display controller to be our bootstrap control
*/
DataTable.Editor.defaults.display = "bootstrap";
/*
* Change the default classes from Editor to be classes for Bootstrap
*/
$.extend( true, $.fn.dataTable.Editor.classes, {
"header": {
"wrapper": "DTE_Header modal-header",
title: {
tag: 'h4',
class: 'modal-title'
}
},
"body": {
"wrapper": "DTE_Body modal-body"
},
"footer": {
"wrapper": "DTE_Footer modal-footer"
},
"form": {
"tag": "form-horizontal",
"button": "btn btn-default",
"buttonInternal": "btn btn-default"
},
"field": {
"wrapper": "DTE_Field",
"label": "col-lg-4 control-label",
"input": "col-lg-8 controls",
"error": "error has-error",
"msg-labelInfo": "help-block",
"msg-info": "help-block",
"msg-message": "help-block",
"msg-error": "help-block",
"multiValue": "well well-sm multi-value",
"multiInfo": "small",
"multiRestore": "well well-sm multi-restore"
}
} );
$.extend( true, DataTable.ext.buttons, {
create: {
formButtons: {
className: 'btn-primary'
}
},
edit: {
formButtons: {
className: 'btn-primary'
}
},
remove: {
formButtons: {
className: 'btn-danger'
}
}
} );
DataTable.Editor.fieldTypes.datatable.tableClass = 'table';
let shown = false;
let fullyShown = false;
const dom = {
// Note that `modal-dialog-scrollable` is BS4.3+ only. It has no effect on 4.0-4.2
content: $(
'<div class="modal fade DTED">'+
'<div class="modal-dialog">'+
'<div class="modal-content"></div>'+
'</div>'+
'</div>'
),
close: $('<button class="close">&times;</div>')
};
/*
* Bootstrap display controller - this is effectively a proxy to the Bootstrap
* modal control.
*/
DataTable.Editor.display.bootstrap = $.extend( true, {}, DataTable.Editor.models.displayController, {
init: function ( dte ) {
// Add `form-control` to required elements
dte.on( 'displayOrder.dtebs open.dtebs', function ( e, display, action, form ) {
$.each( dte.s.fields, function ( key, field ) {
$('input:not([type=checkbox]):not([type=radio]), select, textarea', field.node() )
.addClass( 'form-control' );
} );
} );
return DataTable.Editor.display.bootstrap;
},
open: function ( dte, append, callback ) {
$(append).addClass('modal-content');
// Special class for DataTable buttons in the form
$(append).find('div.DTE_Field_Type_datatable div.dt-buttons')
.removeClass('btn-group')
.addClass('btn-group-vertical');
var content = dom.content.find('div.modal-dialog');
content.children().detach();
content.append( append );
// Setup events on each show
dom.close
.attr('title', dte.i18n.close)
.off('click.dte-bs3')
.on('click.dte-bs3', function () {
dte.close('icon');
})
.prependTo($('div.modal-header', dom.content));
// This is a bit horrible, but if you mousedown and then drag out of the modal container, we don't
// want to trigger a background action.
var allowBackgroundClick = false;
$(document)
.off('mousedown.dte-bs3')
.on('mousedown.dte-bs3', 'div.modal', function (e) {
if ( ! shown ) {
return;
}
allowBackgroundClick = $(e.target).hasClass('modal') && shown
? true
: false;
} );
$(document)
.off('click.dte-bs3')
.on('click.dte-bs3', 'div.modal', function (e) {
if ( $(e.target).hasClass('modal') && allowBackgroundClick ) {
dte.background();
}
if ( ! $(e.target).hasClass('modal') ) {
return;
}
// If scrollbar shown
if ($('div.modal-dialog').height() > $(e.target).height()) {
// And if clicking inside it - do nothing
if (e.pageX >= document.body.offsetWidth - DataTable.__browser.barWidth) {
return;
}
}
// All checks pass - do background action
dte.background();
} );
if ( shown ) {
if ( callback ) {
callback();
}
return;
}
shown = true;
fullyShown = false;
$(dom.content)
.one('shown.bs.modal', function () {
// Can only give elements focus when shown
if ( dte.s.setFocus ) {
dte.s.setFocus.focus();
}
if ( callback ) {
callback();
}
})
.one('hidden', function () {
shown = false;
})
.appendTo( 'body' )
.modal( {
backdrop: "static",
keyboard: false
} );
dom.close.prependTo($('div.modal-header', dom.content));
},
close: function ( dte, callback ) {
if ( ! shown ) {
if ( callback ) {
callback();
}
return;
}
$(dom.content)
.one( 'hidden.bs.modal', function () {
$(this).detach();
} )
.modal('hide');
shown = false;
if ( callback ) {
callback();
}
},
node: function ( dte ) {
return dom.content[0];
}
} );
export default Editor;

View File

@ -1,264 +0,0 @@
/*! Bootstrap integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net-bs4', 'datatables.net-editor'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
var jq = require('jquery');
var cjsRequires = function (root, $) {
if ( ! $.fn.dataTable ) {
require('datatables.net-bs4')(root, $);
}
if ( ! $.fn.dataTable.Editor ) {
require('datatables.net-editor')(root, $);
}
};
if (typeof window === 'undefined') {
module.exports = function (root, $) {
if ( ! root ) {
// CommonJS environments without a window global must pass a
// root. This will give an error otherwise
root = window;
}
if ( ! $ ) {
$ = jq( root );
}
cjsRequires( root, $ );
return factory( $, root, root.document );
};
}
else {
cjsRequires( window, jq );
module.exports = factory( jq, window, window.document );
}
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
var Editor = DataTable.Editor;
/*
* Set the default display controller to be our bootstrap control
*/
DataTable.Editor.defaults.display = "bootstrap";
/*
* Change the default classes from Editor to be classes for Bootstrap
*/
$.extend( true, $.fn.dataTable.Editor.classes, {
"header": {
"wrapper": "DTE_Header modal-header",
title: {
tag: 'h5',
class: 'modal-title'
}
},
"body": {
"wrapper": "DTE_Body modal-body"
},
"footer": {
"wrapper": "DTE_Footer modal-footer"
},
"form": {
"tag": "form-horizontal",
"button": "btn",
"buttonInternal": "btn btn-outline-secondary"
},
"field": {
"wrapper": "DTE_Field form-group row",
"label": "col-lg-4 col-form-label",
"input": "col-lg-8",
"error": "error is-invalid",
"msg-labelInfo": "form-text text-secondary small",
"msg-info": "form-text text-secondary small",
"msg-message": "form-text text-secondary small",
"msg-error": "form-text text-danger small",
"multiValue": "card multi-value",
"multiInfo": "small",
"multiRestore": "multi-restore"
}
} );
$.extend( true, DataTable.ext.buttons, {
create: {
formButtons: {
className: 'btn-primary'
}
},
edit: {
formButtons: {
className: 'btn-primary'
}
},
remove: {
formButtons: {
className: 'btn-danger'
}
}
} );
DataTable.Editor.fieldTypes.datatable.tableClass = 'table';
/*
* Bootstrap display controller - this is effectively a proxy to the Bootstrap
* modal control.
*/
let shown = false;
let fullyShown = false;
const dom = {
// Note that `modal-dialog-scrollable` is BS4.3+ only. It has no effect on 4.0-4.2
content: $(
'<div class="modal fade DTED">'+
'<div class="modal-dialog modal-lg modal-dialog-scrollable"></div>'+
'</div>'
),
close: $('<button class="close">&times;</div>')
};
DataTable.Editor.display.bootstrap = $.extend( true, {}, DataTable.Editor.models.displayController, {
init: function ( dte ) {
// Add `form-control` to required elements
dte.on( 'displayOrder.dtebs open.dtebs', function ( e, display, action, form ) {
$.each( dte.s.fields, function ( key, field ) {
$('input:not([type=checkbox]):not([type=radio]), select, textarea', field.node() )
.addClass( 'form-control' );
} );
} );
return DataTable.Editor.display.bootstrap;
},
open: function ( dte, append, callback ) {
$(append).addClass('modal-content');
// Special class for DataTable buttons in the form
$(append).find('div.DTE_Field_Type_datatable div.dt-buttons')
.removeClass('btn-group')
.addClass('btn-group-vertical');
// Setup events on each show
dom.close
.attr('title', dte.i18n.close)
.off('click.dte-bs4')
.on('click.dte-bs4', function () {
dte.close('icon');
})
.appendTo($('div.modal-header', append));
// This is a bit horrible, but if you mousedown and then drag out of the modal container, we don't
// want to trigger a background action.
let allowBackgroundClick = false;
$(document)
.off('mousedown.dte-bs4')
.on('mousedown.dte-bs4', 'div.modal', function (e) {
allowBackgroundClick = $(e.target).hasClass('modal') && shown
? true
: false;
} );
$(document)
.off('click.dte-bs4')
.on('click.dte-bs4', 'div.modal', function (e) {
if ( $(e.target).hasClass('modal') && allowBackgroundClick ) {
dte.background();
}
} );
var content = dom.content.find('div.modal-dialog');
content.children().detach();
content.append( append );
if ( shown ) {
if ( callback ) {
callback();
}
return;
}
shown = true;
fullyShown = false;
$(dom.content)
.one('shown.bs.modal', function () {
// Can only give elements focus when shown
if ( dte.s.setFocus ) {
dte.s.setFocus.focus();
}
fullyShown = true;
if ( callback ) {
callback();
}
})
.one('hidden', function () {
shown = false;
})
.appendTo( 'body' )
.modal( {
backdrop: "static",
keyboard: false
} );
},
close: function ( dte, callback ) {
if ( ! shown ) {
if ( callback ) {
callback();
}
return;
}
// Check if actually displayed or not before hiding. BS4 doesn't like `hide`
// before it has been fully displayed
if ( ! fullyShown ) {
$(dom.content)
.one('shown.bs.modal', function () {
DataTable.Editor.display.bootstrap.close( dte, callback );
} );
return;
}
$(dom.content)
.one( 'hidden.bs.modal', function () {
$(this).detach();
} )
.modal('hide');
shown = false;
fullyShown = false;
if ( callback ) {
callback();
}
},
node: function ( dte ) {
return dom.content[0];
}
} );
return Editor;
}));

View File

@ -1,4 +0,0 @@
/*! Bootstrap integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
!function(o){var n,a;"function"==typeof define&&define.amd?define(["jquery","datatables.net-bs4","datatables.net-editor"],function(t){return o(t,window,document)}):"object"==typeof exports?(n=require("jquery"),a=function(t,e){e.fn.dataTable||require("datatables.net-bs4")(t,e),e.fn.dataTable.Editor||require("datatables.net-editor")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||n(t),a(t,e),o(e,0,t.document)}:(a(window,n),module.exports=o(n,window,window.document))):o(jQuery,window,document)}(function(d,t,l,e){"use strict";var o=d.fn.dataTable,n=o.Editor;o.Editor.defaults.display="bootstrap",d.extend(!0,d.fn.dataTable.Editor.classes,{header:{wrapper:"DTE_Header modal-header",title:{tag:"h5",class:"modal-title"}},body:{wrapper:"DTE_Body modal-body"},footer:{wrapper:"DTE_Footer modal-footer"},form:{tag:"form-horizontal",button:"btn",buttonInternal:"btn btn-outline-secondary"},field:{wrapper:"DTE_Field form-group row",label:"col-lg-4 col-form-label",input:"col-lg-8",error:"error is-invalid","msg-labelInfo":"form-text text-secondary small","msg-info":"form-text text-secondary small","msg-message":"form-text text-secondary small","msg-error":"form-text text-danger small",multiValue:"card multi-value",multiInfo:"small",multiRestore:"multi-restore"}}),d.extend(!0,o.ext.buttons,{create:{formButtons:{className:"btn-primary"}},edit:{formButtons:{className:"btn-primary"}},remove:{formButtons:{className:"btn-danger"}}});let s=!(o.Editor.fieldTypes.datatable.tableClass="table"),r=!1;const i={content:d('<div class="modal fade DTED"><div class="modal-dialog modal-lg modal-dialog-scrollable"></div></div>'),close:d('<button class="close">&times;</div>')};return o.Editor.display.bootstrap=d.extend(!0,{},o.Editor.models.displayController,{init:function(a){return a.on("displayOrder.dtebs open.dtebs",function(t,e,o,n){d.each(a.s.fields,function(t,e){d("input:not([type=checkbox]):not([type=radio]), select, textarea",e.node()).addClass("form-control")})}),o.Editor.display.bootstrap},open:function(e,t,o){d(t).addClass("modal-content"),d(t).find("div.DTE_Field_Type_datatable div.dt-buttons").removeClass("btn-group").addClass("btn-group-vertical"),i.close.attr("title",e.i18n.close).off("click.dte-bs4").on("click.dte-bs4",function(){e.close("icon")}).appendTo(d("div.modal-header",t));let n=!1;d(l).off("mousedown.dte-bs4").on("mousedown.dte-bs4","div.modal",function(t){n=!(!d(t.target).hasClass("modal")||!s)}),d(l).off("click.dte-bs4").on("click.dte-bs4","div.modal",function(t){d(t.target).hasClass("modal")&&n&&e.background()});var a=i.content.find("div.modal-dialog");a.children().detach(),a.append(t),s?o&&o():(s=!0,r=!1,d(i.content).one("shown.bs.modal",function(){e.s.setFocus&&e.s.setFocus.focus(),r=!0,o&&o()}).one("hidden",function(){s=!1}).appendTo("body").modal({backdrop:"static",keyboard:!1}))},close:function(t,e){s?r?(d(i.content).one("hidden.bs.modal",function(){d(this).detach()}).modal("hide"),s=!1,r=!1,e&&e()):d(i.content).one("shown.bs.modal",function(){o.Editor.display.bootstrap.close(t,e)}):e&&e()},node:function(t){return i.content[0]}}),n});

View File

@ -1,4 +0,0 @@
/*! Bootstrap integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from"jquery";import DataTable from"datatables.net-bs4";import Editor from"datatables.net-editor";let $=jQuery;var Editor=DataTable.Editor;DataTable.Editor.defaults.display="bootstrap",$.extend(!0,$.fn.dataTable.Editor.classes,{header:{wrapper:"DTE_Header modal-header",title:{tag:"h5",class:"modal-title"}},body:{wrapper:"DTE_Body modal-body"},footer:{wrapper:"DTE_Footer modal-footer"},form:{tag:"form-horizontal",button:"btn",buttonInternal:"btn btn-outline-secondary"},field:{wrapper:"DTE_Field form-group row",label:"col-lg-4 col-form-label",input:"col-lg-8",error:"error is-invalid","msg-labelInfo":"form-text text-secondary small","msg-info":"form-text text-secondary small","msg-message":"form-text text-secondary small","msg-error":"form-text text-danger small",multiValue:"card multi-value",multiInfo:"small",multiRestore:"multi-restore"}}),$.extend(!0,DataTable.ext.buttons,{create:{formButtons:{className:"btn-primary"}},edit:{formButtons:{className:"btn-primary"}},remove:{formButtons:{className:"btn-danger"}}});let shown=!(DataTable.Editor.fieldTypes.datatable.tableClass="table"),fullyShown=!1;const dom={content:$('<div class="modal fade DTED"><div class="modal-dialog modal-lg modal-dialog-scrollable"></div></div>'),close:$('<button class="close">&times;</div>')};DataTable.Editor.display.bootstrap=$.extend(!0,{},DataTable.Editor.models.displayController,{init:function(l){return l.on("displayOrder.dtebs open.dtebs",function(o,t,e,a){$.each(l.s.fields,function(o,t){$("input:not([type=checkbox]):not([type=radio]), select, textarea",t.node()).addClass("form-control")})}),DataTable.Editor.display.bootstrap},open:function(t,o,e){$(o).addClass("modal-content"),$(o).find("div.DTE_Field_Type_datatable div.dt-buttons").removeClass("btn-group").addClass("btn-group-vertical"),dom.close.attr("title",t.i18n.close).off("click.dte-bs4").on("click.dte-bs4",function(){t.close("icon")}).appendTo($("div.modal-header",o));let a=!1;$(document).off("mousedown.dte-bs4").on("mousedown.dte-bs4","div.modal",function(o){a=!(!$(o.target).hasClass("modal")||!shown)}),$(document).off("click.dte-bs4").on("click.dte-bs4","div.modal",function(o){$(o.target).hasClass("modal")&&a&&t.background()});var l=dom.content.find("div.modal-dialog");l.children().detach(),l.append(o),shown?e&&e():(shown=!0,fullyShown=!1,$(dom.content).one("shown.bs.modal",function(){t.s.setFocus&&t.s.setFocus.focus(),fullyShown=!0,e&&e()}).one("hidden",function(){shown=!1}).appendTo("body").modal({backdrop:"static",keyboard:!1}))},close:function(o,t){shown?fullyShown?($(dom.content).one("hidden.bs.modal",function(){$(this).detach()}).modal("hide"),shown=!1,fullyShown=!1,t&&t()):$(dom.content).one("shown.bs.modal",function(){DataTable.Editor.display.bootstrap.close(o,t)}):t&&t()},node:function(o){return dom.content[0]}});export default Editor;

View File

@ -1,220 +0,0 @@
/*! Bootstrap integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from 'jquery';
import DataTable from 'datatables.net-bs4';
import Editor from 'datatables.net-editor';
// Allow reassignment of the $ variable
let $ = jQuery;
var Editor = DataTable.Editor;
/*
* Set the default display controller to be our bootstrap control
*/
DataTable.Editor.defaults.display = "bootstrap";
/*
* Change the default classes from Editor to be classes for Bootstrap
*/
$.extend( true, $.fn.dataTable.Editor.classes, {
"header": {
"wrapper": "DTE_Header modal-header",
title: {
tag: 'h5',
class: 'modal-title'
}
},
"body": {
"wrapper": "DTE_Body modal-body"
},
"footer": {
"wrapper": "DTE_Footer modal-footer"
},
"form": {
"tag": "form-horizontal",
"button": "btn",
"buttonInternal": "btn btn-outline-secondary"
},
"field": {
"wrapper": "DTE_Field form-group row",
"label": "col-lg-4 col-form-label",
"input": "col-lg-8",
"error": "error is-invalid",
"msg-labelInfo": "form-text text-secondary small",
"msg-info": "form-text text-secondary small",
"msg-message": "form-text text-secondary small",
"msg-error": "form-text text-danger small",
"multiValue": "card multi-value",
"multiInfo": "small",
"multiRestore": "multi-restore"
}
} );
$.extend( true, DataTable.ext.buttons, {
create: {
formButtons: {
className: 'btn-primary'
}
},
edit: {
formButtons: {
className: 'btn-primary'
}
},
remove: {
formButtons: {
className: 'btn-danger'
}
}
} );
DataTable.Editor.fieldTypes.datatable.tableClass = 'table';
/*
* Bootstrap display controller - this is effectively a proxy to the Bootstrap
* modal control.
*/
let shown = false;
let fullyShown = false;
const dom = {
// Note that `modal-dialog-scrollable` is BS4.3+ only. It has no effect on 4.0-4.2
content: $(
'<div class="modal fade DTED">'+
'<div class="modal-dialog modal-lg modal-dialog-scrollable"></div>'+
'</div>'
),
close: $('<button class="close">&times;</div>')
};
DataTable.Editor.display.bootstrap = $.extend( true, {}, DataTable.Editor.models.displayController, {
init: function ( dte ) {
// Add `form-control` to required elements
dte.on( 'displayOrder.dtebs open.dtebs', function ( e, display, action, form ) {
$.each( dte.s.fields, function ( key, field ) {
$('input:not([type=checkbox]):not([type=radio]), select, textarea', field.node() )
.addClass( 'form-control' );
} );
} );
return DataTable.Editor.display.bootstrap;
},
open: function ( dte, append, callback ) {
$(append).addClass('modal-content');
// Special class for DataTable buttons in the form
$(append).find('div.DTE_Field_Type_datatable div.dt-buttons')
.removeClass('btn-group')
.addClass('btn-group-vertical');
// Setup events on each show
dom.close
.attr('title', dte.i18n.close)
.off('click.dte-bs4')
.on('click.dte-bs4', function () {
dte.close('icon');
})
.appendTo($('div.modal-header', append));
// This is a bit horrible, but if you mousedown and then drag out of the modal container, we don't
// want to trigger a background action.
let allowBackgroundClick = false;
$(document)
.off('mousedown.dte-bs4')
.on('mousedown.dte-bs4', 'div.modal', function (e) {
allowBackgroundClick = $(e.target).hasClass('modal') && shown
? true
: false;
} );
$(document)
.off('click.dte-bs4')
.on('click.dte-bs4', 'div.modal', function (e) {
if ( $(e.target).hasClass('modal') && allowBackgroundClick ) {
dte.background();
}
} );
var content = dom.content.find('div.modal-dialog');
content.children().detach();
content.append( append );
if ( shown ) {
if ( callback ) {
callback();
}
return;
}
shown = true;
fullyShown = false;
$(dom.content)
.one('shown.bs.modal', function () {
// Can only give elements focus when shown
if ( dte.s.setFocus ) {
dte.s.setFocus.focus();
}
fullyShown = true;
if ( callback ) {
callback();
}
})
.one('hidden', function () {
shown = false;
})
.appendTo( 'body' )
.modal( {
backdrop: "static",
keyboard: false
} );
},
close: function ( dte, callback ) {
if ( ! shown ) {
if ( callback ) {
callback();
}
return;
}
// Check if actually displayed or not before hiding. BS4 doesn't like `hide`
// before it has been fully displayed
if ( ! fullyShown ) {
$(dom.content)
.one('shown.bs.modal', function () {
DataTable.Editor.display.bootstrap.close( dte, callback );
} );
return;
}
$(dom.content)
.one( 'hidden.bs.modal', function () {
$(this).detach();
} )
.modal('hide');
shown = false;
fullyShown = false;
if ( callback ) {
callback();
}
},
node: function ( dte ) {
return dom.content[0];
}
} );
export default Editor;

View File

@ -1,315 +0,0 @@
/*! Bootstrap integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net-bs5', 'datatables.net-editor'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
var jq = require('jquery');
var cjsRequires = function (root, $) {
if ( ! $.fn.dataTable ) {
require('datatables.net-bs5')(root, $);
}
if ( ! $.fn.dataTable.Editor ) {
require('datatables.net-editor')(root, $);
}
};
if (typeof window === 'undefined') {
module.exports = function (root, $) {
if ( ! root ) {
// CommonJS environments without a window global must pass a
// root. This will give an error otherwise
root = window;
}
if ( ! $ ) {
$ = jq( root );
}
cjsRequires( root, $ );
return factory( $, root, root.document );
};
}
else {
cjsRequires( window, jq );
module.exports = factory( jq, window, window.document );
}
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
var Editor = DataTable.Editor;
/*
* Set the default display controller to be our bootstrap control
*/
DataTable.Editor.defaults.display = "bootstrap";
/*
* Change the default classes from Editor to be classes for Bootstrap
*/
$.extend( true, $.fn.dataTable.Editor.classes, {
"header": {
"wrapper": "DTE_Header",
title: {
tag: 'h5',
class: 'modal-title'
}
},
"body": {
"wrapper": "DTE_Body"
},
"footer": {
"wrapper": "DTE_Footer"
},
"form": {
"tag": "form-horizontal",
"button": "btn",
"buttonInternal": "btn btn-outline-secondary"
},
"field": {
"wrapper": "DTE_Field form-group row",
"label": "col-lg-4 col-form-label",
"input": "col-lg-8",
"error": "error is-invalid",
"msg-labelInfo": "form-text text-secondary small",
"msg-info": "form-text text-secondary small",
"msg-message": "form-text text-secondary small",
"msg-error": "form-text text-danger small",
"multiValue": "card multi-value",
"multiInfo": "small",
"multiRestore": "multi-restore"
}
} );
$.extend( true, DataTable.ext.buttons, {
create: {
formButtons: {
className: 'btn-primary'
}
},
edit: {
formButtons: {
className: 'btn-primary'
}
},
remove: {
formButtons: {
className: 'btn-danger'
}
}
} );
DataTable.Editor.fieldTypes.datatable.tableClass = 'table';
/*
* Bootstrap display controller - this is effectively a proxy to the Bootstrap
* modal control.
*/
let shown = false;
let fullyShown = false;
const dom = {
content: $(
'<div class="modal fade DTED">'+
'<div class="modal-dialog"></div>'+
'</div>'
),
close: $('<button class="btn-close"></div>')
};
let modal;
let _bs = window.bootstrap;
DataTable.Editor.bootstrap = function (bs) {
_bs = bs;
}
DataTable.Editor.display.bootstrap = $.extend( true, {}, DataTable.Editor.models.displayController, {
/*
* API methods
*/
init: function ( dte ) {
// Add `form-control` to required elements
dte.on( 'displayOrder.dtebs open.dtebs', function ( e, display, action, form ) {
$.each( dte.s.fields, function ( key, field ) {
$('input:not([type=checkbox]):not([type=radio]), select, textarea', field.node() )
.addClass( 'form-control' );
$('input[type=checkbox], input[type=radio]', field.node() )
.addClass( 'form-check-input' );
$('select', field.node() )
.addClass( 'form-select' );
} );
} );
return DataTable.Editor.display.bootstrap;
},
open: function ( dte, append, callback ) {
if (! modal) {
modal = new _bs.Modal(dom.content[0], {
backdrop: "static",
keyboard: false
});
}
$(append).addClass('modal-content');
$('.DTE_Header', append).addClass('modal-header');
$('.DTE_Body', append).addClass('modal-body');
$('.DTE_Footer', append).addClass('modal-footer');
// Special class for DataTable buttons in the form
$(append).find('div.DTE_Field_Type_datatable div.dt-buttons')
.removeClass('btn-group')
.addClass('btn-group-vertical');
// Setup events on each show
dom.close
.attr('title', dte.i18n.close)
.off('click.dte-bs5')
.on('click.dte-bs5', function () {
dte.close('icon');
})
.appendTo($('div.modal-header', append));
// This is a bit horrible, but if you mousedown and then drag out of the modal container, we don't
// want to trigger a background action.
let allowBackgroundClick = false;
$(document)
.off('mousedown.dte-bs5')
.on('mousedown.dte-bs5', 'div.modal', function (e) {
allowBackgroundClick = $(e.target).hasClass('modal') && shown
? true
: false;
} );
$(document)
.off('click.dte-bs5')
.on('click.dte-bs5', 'div.modal', function (e) {
if ( $(e.target).hasClass('modal') && allowBackgroundClick ) {
dte.background();
}
} );
var content = dom.content.find('div.modal-dialog');
content.addClass(DataTable.Editor.display.bootstrap.classes.modal);
content.children().detach();
content.append( append );
// Floating label support - rearrange the DOM for the inputs
if (dte.c.bootstrap && dte.c.bootstrap.floatingLabels) {
var floating_label_types = ['readonly', 'text', 'textarea', 'select', 'datetime']
var fields = dte.order();
fields
.filter(function (f) {
var type = dte.field(f).s.opts.type;
return floating_label_types.includes(type);
})
.forEach(function(f) {
var node = $(dte.field(f).node());
var wrapper = node.find('.DTE_Field_InputControl');
var control = wrapper.children(':first-child');
var label = node.find('label');
wrapper.parent().removeClass('col-lg-8').addClass('col-lg-12');
wrapper.addClass('form-floating');
control.addClass('form-control').attr("placeholder", f);
label.appendTo(wrapper);
});
}
if ( shown ) {
if ( callback ) {
callback();
}
return;
}
shown = true;
fullyShown = false;
$(dom.content)
.one('shown.bs.modal', function () {
// Can only give elements focus when shown
if ( dte.s.setFocus ) {
dte.s.setFocus.focus();
}
fullyShown = true;
if ( callback ) {
callback();
}
})
.one('hidden', function () {
shown = false;
})
.appendTo( 'body' );
modal.show();
},
close: function ( dte, callback ) {
if ( ! shown ) {
if ( callback ) {
callback();
}
return;
}
// Check if actually displayed or not before hiding. BS4 doesn't like `hide`
// before it has been fully displayed
if ( ! fullyShown ) {
$(dom.content)
.one('shown.bs.modal', function () {
DataTable.Editor.display.bootstrap.close( dte, callback );
} );
return;
}
$(dom.content)
.one( 'hidden.bs.modal', function () {
$(this).detach();
} );
modal.hide();
shown = false;
fullyShown = false;
if ( callback ) {
callback();
}
},
node: function ( dte ) {
return dom.content[0];
},
classes: {
modal: 'modal-dialog-scrollable modal-dialog-centered'
}
} );
return Editor;
}));

View File

@ -1,4 +0,0 @@
/*! Bootstrap integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
!function(o){var a,d;"function"==typeof define&&define.amd?define(["jquery","datatables.net-bs5","datatables.net-editor"],function(t){return o(t,window,document)}):"object"==typeof exports?(a=require("jquery"),d=function(t,e){e.fn.dataTable||require("datatables.net-bs5")(t,e),e.fn.dataTable.Editor||require("datatables.net-editor")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||a(t),d(t,e),o(e,t,t.document)}:(d(window,a),module.exports=o(a,window,window.document))):o(jQuery,window,document)}(function(l,t,s,e){"use strict";var r=l.fn.dataTable,o=r.Editor;r.Editor.defaults.display="bootstrap",l.extend(!0,l.fn.dataTable.Editor.classes,{header:{wrapper:"DTE_Header",title:{tag:"h5",class:"modal-title"}},body:{wrapper:"DTE_Body"},footer:{wrapper:"DTE_Footer"},form:{tag:"form-horizontal",button:"btn",buttonInternal:"btn btn-outline-secondary"},field:{wrapper:"DTE_Field form-group row",label:"col-lg-4 col-form-label",input:"col-lg-8",error:"error is-invalid","msg-labelInfo":"form-text text-secondary small","msg-info":"form-text text-secondary small","msg-message":"form-text text-secondary small","msg-error":"form-text text-danger small",multiValue:"card multi-value",multiInfo:"small",multiRestore:"multi-restore"}}),l.extend(!0,r.ext.buttons,{create:{formButtons:{className:"btn-primary"}},edit:{formButtons:{className:"btn-primary"}},remove:{formButtons:{className:"btn-danger"}}});let i=!(r.Editor.fieldTypes.datatable.tableClass="table"),c=!1;const f={content:l('<div class="modal fade DTED"><div class="modal-dialog"></div></div>'),close:l('<button class="btn-close"></div>')};let u,m=t.bootstrap;return r.Editor.bootstrap=function(t){m=t},r.Editor.display.bootstrap=l.extend(!0,{},r.Editor.models.displayController,{init:function(d){return d.on("displayOrder.dtebs open.dtebs",function(t,e,o,a){l.each(d.s.fields,function(t,e){l("input:not([type=checkbox]):not([type=radio]), select, textarea",e.node()).addClass("form-control"),l("input[type=checkbox], input[type=radio]",e.node()).addClass("form-check-input"),l("select",e.node()).addClass("form-select")})}),r.Editor.display.bootstrap},open:function(d,t,e){u=u||new m.Modal(f.content[0],{backdrop:"static",keyboard:!1}),l(t).addClass("modal-content"),l(".DTE_Header",t).addClass("modal-header"),l(".DTE_Body",t).addClass("modal-body"),l(".DTE_Footer",t).addClass("modal-footer"),l(t).find("div.DTE_Field_Type_datatable div.dt-buttons").removeClass("btn-group").addClass("btn-group-vertical"),f.close.attr("title",d.i18n.close).off("click.dte-bs5").on("click.dte-bs5",function(){d.close("icon")}).appendTo(l("div.modal-header",t));let o=!1;l(s).off("mousedown.dte-bs5").on("mousedown.dte-bs5","div.modal",function(t){o=!(!l(t.target).hasClass("modal")||!i)}),l(s).off("click.dte-bs5").on("click.dte-bs5","div.modal",function(t){l(t.target).hasClass("modal")&&o&&d.background()});var a,n=f.content.find("div.modal-dialog");n.addClass(r.Editor.display.bootstrap.classes.modal),n.children().detach(),n.append(t),d.c.bootstrap&&d.c.bootstrap.floatingLabels&&(a=["readonly","text","textarea","select","datetime"],d.order().filter(function(t){t=d.field(t).s.opts.type;return a.includes(t)}).forEach(function(t){var e=l(d.field(t).node()),o=e.find(".DTE_Field_InputControl"),a=o.children(":first-child"),e=e.find("label");o.parent().removeClass("col-lg-8").addClass("col-lg-12"),o.addClass("form-floating"),a.addClass("form-control").attr("placeholder",t),e.appendTo(o)})),i?e&&e():(i=!0,c=!1,l(f.content).one("shown.bs.modal",function(){d.s.setFocus&&d.s.setFocus.focus(),c=!0,e&&e()}).one("hidden",function(){i=!1}).appendTo("body"),u.show())},close:function(t,e){i?c?(l(f.content).one("hidden.bs.modal",function(){l(this).detach()}),u.hide(),i=!1,c=!1,e&&e()):l(f.content).one("shown.bs.modal",function(){r.Editor.display.bootstrap.close(t,e)}):e&&e()},node:function(t){return f.content[0]},classes:{modal:"modal-dialog-scrollable modal-dialog-centered"}}),o});

View File

@ -1,4 +0,0 @@
/*! Bootstrap integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from"jquery";import DataTable from"datatables.net-bs5";import Editor from"datatables.net-editor";let $=jQuery;var Editor=DataTable.Editor;DataTable.Editor.defaults.display="bootstrap",$.extend(!0,$.fn.dataTable.Editor.classes,{header:{wrapper:"DTE_Header",title:{tag:"h5",class:"modal-title"}},body:{wrapper:"DTE_Body"},footer:{wrapper:"DTE_Footer"},form:{tag:"form-horizontal",button:"btn",buttonInternal:"btn btn-outline-secondary"},field:{wrapper:"DTE_Field form-group row",label:"col-lg-4 col-form-label",input:"col-lg-8",error:"error is-invalid","msg-labelInfo":"form-text text-secondary small","msg-info":"form-text text-secondary small","msg-message":"form-text text-secondary small","msg-error":"form-text text-danger small",multiValue:"card multi-value",multiInfo:"small",multiRestore:"multi-restore"}}),$.extend(!0,DataTable.ext.buttons,{create:{formButtons:{className:"btn-primary"}},edit:{formButtons:{className:"btn-primary"}},remove:{formButtons:{className:"btn-danger"}}});let shown=!(DataTable.Editor.fieldTypes.datatable.tableClass="table"),fullyShown=!1;const dom={content:$('<div class="modal fade DTED"><div class="modal-dialog"></div></div>'),close:$('<button class="btn-close"></div>')};let modal,_bs=window.bootstrap;DataTable.Editor.bootstrap=function(o){_bs=o},DataTable.Editor.display.bootstrap=$.extend(!0,{},DataTable.Editor.models.displayController,{init:function(l){return l.on("displayOrder.dtebs open.dtebs",function(o,t,e,a){$.each(l.s.fields,function(o,t){$("input:not([type=checkbox]):not([type=radio]), select, textarea",t.node()).addClass("form-control"),$("input[type=checkbox], input[type=radio]",t.node()).addClass("form-check-input"),$("select",t.node()).addClass("form-select")})}),DataTable.Editor.display.bootstrap},open:function(l,o,t){modal=modal||new _bs.Modal(dom.content[0],{backdrop:"static",keyboard:!1}),$(o).addClass("modal-content"),$(".DTE_Header",o).addClass("modal-header"),$(".DTE_Body",o).addClass("modal-body"),$(".DTE_Footer",o).addClass("modal-footer"),$(o).find("div.DTE_Field_Type_datatable div.dt-buttons").removeClass("btn-group").addClass("btn-group-vertical"),dom.close.attr("title",l.i18n.close).off("click.dte-bs5").on("click.dte-bs5",function(){l.close("icon")}).appendTo($("div.modal-header",o));let e=!1;$(document).off("mousedown.dte-bs5").on("mousedown.dte-bs5","div.modal",function(o){e=!(!$(o.target).hasClass("modal")||!shown)}),$(document).off("click.dte-bs5").on("click.dte-bs5","div.modal",function(o){$(o.target).hasClass("modal")&&e&&l.background()});var a,d=dom.content.find("div.modal-dialog");d.addClass(DataTable.Editor.display.bootstrap.classes.modal),d.children().detach(),d.append(o),l.c.bootstrap&&l.c.bootstrap.floatingLabels&&(a=["readonly","text","textarea","select","datetime"],l.order().filter(function(o){o=l.field(o).s.opts.type;return a.includes(o)}).forEach(function(o){var t=$(l.field(o).node()),e=t.find(".DTE_Field_InputControl"),a=e.children(":first-child"),t=t.find("label");e.parent().removeClass("col-lg-8").addClass("col-lg-12"),e.addClass("form-floating"),a.addClass("form-control").attr("placeholder",o),t.appendTo(e)})),shown?t&&t():(shown=!0,fullyShown=!1,$(dom.content).one("shown.bs.modal",function(){l.s.setFocus&&l.s.setFocus.focus(),fullyShown=!0,t&&t()}).one("hidden",function(){shown=!1}).appendTo("body"),modal.show())},close:function(o,t){shown?fullyShown?($(dom.content).one("hidden.bs.modal",function(){$(this).detach()}),modal.hide(),shown=!1,fullyShown=!1,t&&t()):$(dom.content).one("shown.bs.modal",function(){DataTable.Editor.display.bootstrap.close(o,t)}):t&&t()},node:function(o){return dom.content[0]},classes:{modal:"modal-dialog-scrollable modal-dialog-centered"}});export default Editor;

View File

@ -1,271 +0,0 @@
/*! Bootstrap integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from 'jquery';
import DataTable from 'datatables.net-bs5';
import Editor from 'datatables.net-editor';
// Allow reassignment of the $ variable
let $ = jQuery;
var Editor = DataTable.Editor;
/*
* Set the default display controller to be our bootstrap control
*/
DataTable.Editor.defaults.display = "bootstrap";
/*
* Change the default classes from Editor to be classes for Bootstrap
*/
$.extend( true, $.fn.dataTable.Editor.classes, {
"header": {
"wrapper": "DTE_Header",
title: {
tag: 'h5',
class: 'modal-title'
}
},
"body": {
"wrapper": "DTE_Body"
},
"footer": {
"wrapper": "DTE_Footer"
},
"form": {
"tag": "form-horizontal",
"button": "btn",
"buttonInternal": "btn btn-outline-secondary"
},
"field": {
"wrapper": "DTE_Field form-group row",
"label": "col-lg-4 col-form-label",
"input": "col-lg-8",
"error": "error is-invalid",
"msg-labelInfo": "form-text text-secondary small",
"msg-info": "form-text text-secondary small",
"msg-message": "form-text text-secondary small",
"msg-error": "form-text text-danger small",
"multiValue": "card multi-value",
"multiInfo": "small",
"multiRestore": "multi-restore"
}
} );
$.extend( true, DataTable.ext.buttons, {
create: {
formButtons: {
className: 'btn-primary'
}
},
edit: {
formButtons: {
className: 'btn-primary'
}
},
remove: {
formButtons: {
className: 'btn-danger'
}
}
} );
DataTable.Editor.fieldTypes.datatable.tableClass = 'table';
/*
* Bootstrap display controller - this is effectively a proxy to the Bootstrap
* modal control.
*/
let shown = false;
let fullyShown = false;
const dom = {
content: $(
'<div class="modal fade DTED">'+
'<div class="modal-dialog"></div>'+
'</div>'
),
close: $('<button class="btn-close"></div>')
};
let modal;
let _bs = window.bootstrap;
DataTable.Editor.bootstrap = function (bs) {
_bs = bs;
}
DataTable.Editor.display.bootstrap = $.extend( true, {}, DataTable.Editor.models.displayController, {
/*
* API methods
*/
init: function ( dte ) {
// Add `form-control` to required elements
dte.on( 'displayOrder.dtebs open.dtebs', function ( e, display, action, form ) {
$.each( dte.s.fields, function ( key, field ) {
$('input:not([type=checkbox]):not([type=radio]), select, textarea', field.node() )
.addClass( 'form-control' );
$('input[type=checkbox], input[type=radio]', field.node() )
.addClass( 'form-check-input' );
$('select', field.node() )
.addClass( 'form-select' );
} );
} );
return DataTable.Editor.display.bootstrap;
},
open: function ( dte, append, callback ) {
if (! modal) {
modal = new _bs.Modal(dom.content[0], {
backdrop: "static",
keyboard: false
});
}
$(append).addClass('modal-content');
$('.DTE_Header', append).addClass('modal-header');
$('.DTE_Body', append).addClass('modal-body');
$('.DTE_Footer', append).addClass('modal-footer');
// Special class for DataTable buttons in the form
$(append).find('div.DTE_Field_Type_datatable div.dt-buttons')
.removeClass('btn-group')
.addClass('btn-group-vertical');
// Setup events on each show
dom.close
.attr('title', dte.i18n.close)
.off('click.dte-bs5')
.on('click.dte-bs5', function () {
dte.close('icon');
})
.appendTo($('div.modal-header', append));
// This is a bit horrible, but if you mousedown and then drag out of the modal container, we don't
// want to trigger a background action.
let allowBackgroundClick = false;
$(document)
.off('mousedown.dte-bs5')
.on('mousedown.dte-bs5', 'div.modal', function (e) {
allowBackgroundClick = $(e.target).hasClass('modal') && shown
? true
: false;
} );
$(document)
.off('click.dte-bs5')
.on('click.dte-bs5', 'div.modal', function (e) {
if ( $(e.target).hasClass('modal') && allowBackgroundClick ) {
dte.background();
}
} );
var content = dom.content.find('div.modal-dialog');
content.addClass(DataTable.Editor.display.bootstrap.classes.modal);
content.children().detach();
content.append( append );
// Floating label support - rearrange the DOM for the inputs
if (dte.c.bootstrap && dte.c.bootstrap.floatingLabels) {
var floating_label_types = ['readonly', 'text', 'textarea', 'select', 'datetime']
var fields = dte.order();
fields
.filter(function (f) {
var type = dte.field(f).s.opts.type;
return floating_label_types.includes(type);
})
.forEach(function(f) {
var node = $(dte.field(f).node());
var wrapper = node.find('.DTE_Field_InputControl');
var control = wrapper.children(':first-child');
var label = node.find('label');
wrapper.parent().removeClass('col-lg-8').addClass('col-lg-12');
wrapper.addClass('form-floating');
control.addClass('form-control').attr("placeholder", f);
label.appendTo(wrapper);
});
}
if ( shown ) {
if ( callback ) {
callback();
}
return;
}
shown = true;
fullyShown = false;
$(dom.content)
.one('shown.bs.modal', function () {
// Can only give elements focus when shown
if ( dte.s.setFocus ) {
dte.s.setFocus.focus();
}
fullyShown = true;
if ( callback ) {
callback();
}
})
.one('hidden', function () {
shown = false;
})
.appendTo( 'body' );
modal.show();
},
close: function ( dte, callback ) {
if ( ! shown ) {
if ( callback ) {
callback();
}
return;
}
// Check if actually displayed or not before hiding. BS4 doesn't like `hide`
// before it has been fully displayed
if ( ! fullyShown ) {
$(dom.content)
.one('shown.bs.modal', function () {
DataTable.Editor.display.bootstrap.close( dte, callback );
} );
return;
}
$(dom.content)
.one( 'hidden.bs.modal', function () {
$(this).detach();
} );
modal.hide();
shown = false;
fullyShown = false;
if ( callback ) {
callback();
}
},
node: function ( dte ) {
return dom.content[0];
},
classes: {
modal: 'modal-dialog-scrollable modal-dialog-centered'
}
} );
export default Editor;

View File

@ -1,216 +0,0 @@
/*! Bulma integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net-bm', 'datatables.net-editor'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
var jq = require('jquery');
var cjsRequires = function (root, $) {
if ( ! $.fn.dataTable ) {
require('datatables.net-bm')(root, $);
}
if ( ! $.fn.dataTable.Editor ) {
require('datatables.net-editor')(root, $);
}
};
if (typeof window === 'undefined') {
module.exports = function (root, $) {
if ( ! root ) {
// CommonJS environments without a window global must pass a
// root. This will give an error otherwise
root = window;
}
if ( ! $ ) {
$ = jq( root );
}
cjsRequires( root, $ );
return factory( $, root, root.document );
};
}
else {
cjsRequires( window, jq );
module.exports = factory( jq, window, window.document );
}
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
var Editor = DataTable.Editor;
/*
* Set the default display controller to be our bulma control
*/
DataTable.Editor.defaults.display = "bulma";
/*
* Change the default classes from Editor to be classes for Bulma
*/
$.extend( true, $.fn.dataTable.Editor.classes, {
"header": {
"wrapper": "DTE_Header modal-header",
title: {
tag: 'h5',
class: 'modal-title'
}
},
"body": {
"wrapper": "DTE_Body modal-body"
},
"footer": {
"wrapper": "DTE_Footer modal-footer"
},
"form": {
"tag": "form-horizontal",
"button": "button",
"buttonInternal": "button",
"error": "DTE_Form_Error help is-danger"
},
"field": {
"wrapper": "DTE_Field field",
"label": "label",
"error": "DTE_Field_Error help is-danger",
"multiValue": "card multi-value",
"multiInfo": "small",
"multiRestore": "card multi-restore"
},
} );
$.extend( true, DataTable.ext.buttons, {
create: {
formButtons: {
className: 'button is-primary'
}
},
edit: {
formButtons: {
className: 'button is-primary'
}
},
remove: {
formButtons: {
className: 'button is-danger'
}
}
} );
DataTable.Editor.fieldTypes.datatable.tableClass = 'table';
/*
* Bulma display controller - this is effectively a proxy to the Bulma
* modal control.
*/
let shown = false;
let fullyShown = false;
const dom = {
content: $(
'<div class="modal DTED">'+
'<div class="modal-background"></div>'+
'<div class="modal-content"></div>'+
'<button class="modal-close is-large" aria-label="close"></button>'+
'</div>'
)
};
DataTable.Editor.display.bulma = $.extend( true, {}, DataTable.Editor.models.displayController, {
/*
* API methods
*/
init: function ( dte ) {
// Add `form-control` to required elements
dte.on( 'displayOrder.dtebm open.dtebm', function ( e, display, action, form ) {
$.each( dte.s.fields, function ( key, field ) {
$('input:not([type=checkbox]):not([type=radio]), select, textarea', field.node() )
.addClass( 'input' );
$('input[type=checkbox], input[type=radio]', field.node() )
.removeClass('input');
$('select', field.node() )
.addClass( 'select' )
.parent().addClass('select');
$('select[multiple]', field.node() )
.parent().addClass('is-multiple');
} );
} );
return DataTable.Editor.display.bulma;
},
open: function ( dte, append, callback ) {
$(append).removeClass('is-hidden').addClass('is-active');
$(append).find('.modal-title').addClass('title');
dom.content.find('.modal-content').append(append);
dom.content.addClass('is-active is-clipped');
dom.content.appendTo("body");
// Setup events on each show
$('.modal-close')
.attr('title', dte.i18n.close)
.one('click', function () {
dte.close('icon');
})
.appendTo($('div.modal-header', append));
// This is a bit horrible, but if you mousedown and then drag out of the modal container, we don't
// want to trigger a background action.
let allowBackgroundClick = false;
$(document)
.off('mousedown.dte-bs5')
.on('mousedown.dte-bs5', 'div.modal-background', function (e) {
allowBackgroundClick = $(e.target).hasClass('modal-background');
} );
$(document)
.off('click.dte-bs5')
.on('click.dte-bs5', 'div.modal-background', function (e) {
if ( $(e.target).hasClass('modal-background') && allowBackgroundClick ) {
dte.background();
}
} );
if ( callback ) {
callback();
}
return;
},
close: function ( dte, callback ) {
dom.content
.find('.is-active')
.removeClass('is-active')
.addClass('is-hidden');
dom.content.removeClass('is-active is-clipped');
if ( callback ) {
callback();
}
},
node: function ( dte ) {
return dom.content[0];
}
} );
return Editor;
}));

View File

@ -1,4 +0,0 @@
/*! Bulma integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
!function(o){var a,d;"function"==typeof define&&define.amd?define(["jquery","datatables.net-bm","datatables.net-editor"],function(e){return o(e,window,document)}):"object"==typeof exports?(a=require("jquery"),d=function(e,t){t.fn.dataTable||require("datatables.net-bm")(e,t),t.fn.dataTable.Editor||require("datatables.net-editor")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||a(e),d(e,t),o(t,0,e.document)}:(d(window,a),module.exports=o(a,window,window.document))):o(jQuery,window,document)}(function(n,e,d,t){"use strict";var o=n.fn.dataTable,a=o.Editor;o.Editor.defaults.display="bulma",n.extend(!0,n.fn.dataTable.Editor.classes,{header:{wrapper:"DTE_Header modal-header",title:{tag:"h5",class:"modal-title"}},body:{wrapper:"DTE_Body modal-body"},footer:{wrapper:"DTE_Footer modal-footer"},form:{tag:"form-horizontal",button:"button",buttonInternal:"button",error:"DTE_Form_Error help is-danger"},field:{wrapper:"DTE_Field field",label:"label",error:"DTE_Field_Error help is-danger",multiValue:"card multi-value",multiInfo:"small",multiRestore:"card multi-restore"}}),n.extend(!0,o.ext.buttons,{create:{formButtons:{className:"button is-primary"}},edit:{formButtons:{className:"button is-primary"}},remove:{formButtons:{className:"button is-danger"}}}),o.Editor.fieldTypes.datatable.tableClass="table";const i={content:n('<div class="modal DTED"><div class="modal-background"></div><div class="modal-content"></div><button class="modal-close is-large" aria-label="close"></button></div>')};return o.Editor.display.bulma=n.extend(!0,{},o.Editor.models.displayController,{init:function(d){return d.on("displayOrder.dtebm open.dtebm",function(e,t,o,a){n.each(d.s.fields,function(e,t){n("input:not([type=checkbox]):not([type=radio]), select, textarea",t.node()).addClass("input"),n("input[type=checkbox], input[type=radio]",t.node()).removeClass("input"),n("select",t.node()).addClass("select").parent().addClass("select"),n("select[multiple]",t.node()).parent().addClass("is-multiple")})}),o.Editor.display.bulma},open:function(t,e,o){n(e).removeClass("is-hidden").addClass("is-active"),n(e).find(".modal-title").addClass("title"),i.content.find(".modal-content").append(e),i.content.addClass("is-active is-clipped"),i.content.appendTo("body"),n(".modal-close").attr("title",t.i18n.close).one("click",function(){t.close("icon")}).appendTo(n("div.modal-header",e));let a=!1;n(d).off("mousedown.dte-bs5").on("mousedown.dte-bs5","div.modal-background",function(e){a=n(e.target).hasClass("modal-background")}),n(d).off("click.dte-bs5").on("click.dte-bs5","div.modal-background",function(e){n(e.target).hasClass("modal-background")&&a&&t.background()}),o&&o()},close:function(e,t){i.content.find(".is-active").removeClass("is-active").addClass("is-hidden"),i.content.removeClass("is-active is-clipped"),t&&t()},node:function(e){return i.content[0]}}),a});

View File

@ -1,4 +0,0 @@
/*! Bulma integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from"jquery";import DataTable from"datatables.net-bm";import Editor from"datatables.net-editor";let $=jQuery;var Editor=DataTable.Editor;DataTable.Editor.defaults.display="bulma",$.extend(!0,$.fn.dataTable.Editor.classes,{header:{wrapper:"DTE_Header modal-header",title:{tag:"h5",class:"modal-title"}},body:{wrapper:"DTE_Body modal-body"},footer:{wrapper:"DTE_Footer modal-footer"},form:{tag:"form-horizontal",button:"button",buttonInternal:"button",error:"DTE_Form_Error help is-danger"},field:{wrapper:"DTE_Field field",label:"label",error:"DTE_Field_Error help is-danger",multiValue:"card multi-value",multiInfo:"small",multiRestore:"card multi-restore"}}),$.extend(!0,DataTable.ext.buttons,{create:{formButtons:{className:"button is-primary"}},edit:{formButtons:{className:"button is-primary"}},remove:{formButtons:{className:"button is-danger"}}});let shown=!(DataTable.Editor.fieldTypes.datatable.tableClass="table"),fullyShown=!1;const dom={content:$('<div class="modal DTED"><div class="modal-background"></div><div class="modal-content"></div><button class="modal-close is-large" aria-label="close"></button></div>')};DataTable.Editor.display.bulma=$.extend(!0,{},DataTable.Editor.models.displayController,{init:function(d){return d.on("displayOrder.dtebm open.dtebm",function(e,t,a,o){$.each(d.s.fields,function(e,t){$("input:not([type=checkbox]):not([type=radio]), select, textarea",t.node()).addClass("input"),$("input[type=checkbox], input[type=radio]",t.node()).removeClass("input"),$("select",t.node()).addClass("select").parent().addClass("select"),$("select[multiple]",t.node()).parent().addClass("is-multiple")})}),DataTable.Editor.display.bulma},open:function(t,e,a){$(e).removeClass("is-hidden").addClass("is-active"),$(e).find(".modal-title").addClass("title"),dom.content.find(".modal-content").append(e),dom.content.addClass("is-active is-clipped"),dom.content.appendTo("body"),$(".modal-close").attr("title",t.i18n.close).one("click",function(){t.close("icon")}).appendTo($("div.modal-header",e));let o=!1;$(document).off("mousedown.dte-bs5").on("mousedown.dte-bs5","div.modal-background",function(e){o=$(e.target).hasClass("modal-background")}),$(document).off("click.dte-bs5").on("click.dte-bs5","div.modal-background",function(e){$(e.target).hasClass("modal-background")&&o&&t.background()}),a&&a()},close:function(e,t){dom.content.find(".is-active").removeClass("is-active").addClass("is-hidden"),dom.content.removeClass("is-active is-clipped"),t&&t()},node:function(e){return dom.content[0]}});export default Editor;

View File

@ -1,172 +0,0 @@
/*! Bulma integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from 'jquery';
import DataTable from 'datatables.net-bm';
import Editor from 'datatables.net-editor';
// Allow reassignment of the $ variable
let $ = jQuery;
var Editor = DataTable.Editor;
/*
* Set the default display controller to be our bulma control
*/
DataTable.Editor.defaults.display = "bulma";
/*
* Change the default classes from Editor to be classes for Bulma
*/
$.extend( true, $.fn.dataTable.Editor.classes, {
"header": {
"wrapper": "DTE_Header modal-header",
title: {
tag: 'h5',
class: 'modal-title'
}
},
"body": {
"wrapper": "DTE_Body modal-body"
},
"footer": {
"wrapper": "DTE_Footer modal-footer"
},
"form": {
"tag": "form-horizontal",
"button": "button",
"buttonInternal": "button",
"error": "DTE_Form_Error help is-danger"
},
"field": {
"wrapper": "DTE_Field field",
"label": "label",
"error": "DTE_Field_Error help is-danger",
"multiValue": "card multi-value",
"multiInfo": "small",
"multiRestore": "card multi-restore"
},
} );
$.extend( true, DataTable.ext.buttons, {
create: {
formButtons: {
className: 'button is-primary'
}
},
edit: {
formButtons: {
className: 'button is-primary'
}
},
remove: {
formButtons: {
className: 'button is-danger'
}
}
} );
DataTable.Editor.fieldTypes.datatable.tableClass = 'table';
/*
* Bulma display controller - this is effectively a proxy to the Bulma
* modal control.
*/
let shown = false;
let fullyShown = false;
const dom = {
content: $(
'<div class="modal DTED">'+
'<div class="modal-background"></div>'+
'<div class="modal-content"></div>'+
'<button class="modal-close is-large" aria-label="close"></button>'+
'</div>'
)
};
DataTable.Editor.display.bulma = $.extend( true, {}, DataTable.Editor.models.displayController, {
/*
* API methods
*/
init: function ( dte ) {
// Add `form-control` to required elements
dte.on( 'displayOrder.dtebm open.dtebm', function ( e, display, action, form ) {
$.each( dte.s.fields, function ( key, field ) {
$('input:not([type=checkbox]):not([type=radio]), select, textarea', field.node() )
.addClass( 'input' );
$('input[type=checkbox], input[type=radio]', field.node() )
.removeClass('input');
$('select', field.node() )
.addClass( 'select' )
.parent().addClass('select');
$('select[multiple]', field.node() )
.parent().addClass('is-multiple');
} );
} );
return DataTable.Editor.display.bulma;
},
open: function ( dte, append, callback ) {
$(append).removeClass('is-hidden').addClass('is-active');
$(append).find('.modal-title').addClass('title');
dom.content.find('.modal-content').append(append);
dom.content.addClass('is-active is-clipped');
dom.content.appendTo("body");
// Setup events on each show
$('.modal-close')
.attr('title', dte.i18n.close)
.one('click', function () {
dte.close('icon');
})
.appendTo($('div.modal-header', append));
// This is a bit horrible, but if you mousedown and then drag out of the modal container, we don't
// want to trigger a background action.
let allowBackgroundClick = false;
$(document)
.off('mousedown.dte-bs5')
.on('mousedown.dte-bs5', 'div.modal-background', function (e) {
allowBackgroundClick = $(e.target).hasClass('modal-background');
} );
$(document)
.off('click.dte-bs5')
.on('click.dte-bs5', 'div.modal-background', function (e) {
if ( $(e.target).hasClass('modal-background') && allowBackgroundClick ) {
dte.background();
}
} );
if ( callback ) {
callback();
}
return;
},
close: function ( dte, callback ) {
dom.content
.find('.is-active')
.removeClass('is-active')
.addClass('is-hidden');
dom.content.removeClass('is-active is-clipped');
if ( callback ) {
callback();
}
},
node: function ( dte ) {
return dom.content[0];
}
} );
export default Editor;

View File

@ -1,59 +0,0 @@
/*! DataTables styling integration for DataTables' Editor
* ©SpryMedia Ltd - datatables.net/license
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net-dt', 'datatables.net-editor'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
var jq = require('jquery');
var cjsRequires = function (root, $) {
if ( ! $.fn.dataTable ) {
require('datatables.net-dt')(root, $);
}
if ( ! $.fn.dataTable.Editor ) {
require('datatables.net-editor')(root, $);
}
};
if (typeof window === 'undefined') {
module.exports = function (root, $) {
if ( ! root ) {
// CommonJS environments without a window global must pass a
// root. This will give an error otherwise
root = window;
}
if ( ! $ ) {
$ = jq( root );
}
cjsRequires( root, $ );
return factory( $, root, root.document );
};
}
else {
cjsRequires( window, jq );
module.exports = factory( jq, window, window.document );
}
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
var Editor = DataTable.Editor;
return Editor;
}));

View File

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

View File

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

View File

@ -1,15 +0,0 @@
/*! DataTables styling integration for DataTables' Editor
* ©SpryMedia Ltd - datatables.net/license
*/
import jQuery from 'jquery';
import DataTable from 'datatables.net-dt';
import Editor from 'datatables.net-editor';
// Allow reassignment of the $ variable
let $ = jQuery;
var Editor = DataTable.Editor;
export default Editor;

View File

@ -1,171 +0,0 @@
/*! Foundation integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net-zf', 'datatables.net-editor'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
var jq = require('jquery');
var cjsRequires = function (root, $) {
if ( ! $.fn.dataTable ) {
require('datatables.net-zf')(root, $);
}
if ( ! $.fn.dataTable.Editor ) {
require('datatables.net-editor')(root, $);
}
};
if (typeof window === 'undefined') {
module.exports = function (root, $) {
if ( ! root ) {
// CommonJS environments without a window global must pass a
// root. This will give an error otherwise
root = window;
}
if ( ! $ ) {
$ = jq( root );
}
cjsRequires( root, $ );
return factory( $, root, root.document );
};
}
else {
cjsRequires( window, jq );
module.exports = factory( jq, window, window.document );
}
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
var Editor = DataTable.Editor;
/*
* Set the default display controller to be our foundation control
*/
DataTable.Editor.defaults.display = "foundation";
/*
* Change the default classes from Editor to be classes for Foundation
*/
$.extend( true, $.fn.dataTable.Editor.classes, {
field: {
wrapper: "DTE_Field row",
label: "small-4 columns inline",
input: "small-8 columns",
error: "error",
multiValue: "panel radius multi-value",
multiInfo: "small",
multiRestore: "panel radius multi-restore",
"msg-labelInfo": "label secondary",
"msg-info": "label secondary",
"msg-message": "label secondary",
"msg-error": "label alert"
},
form: {
button: "button small",
buttonInternal: "button small"
}
} );
/*
* Foundation display controller - this is effectively a proxy to the Foundation
* modal control.
*/
var shown = false;
var reveal;
const dom = {
content: $(
'<div class="reveal reveal-modal DTED" data-reveal></div>'
),
close: $('<button class="close close-button">&times;</div>')
};
DataTable.Editor.display.foundation = $.extend( true, {}, DataTable.Editor.models.displayController, {
init: function ( dte ) {
if (! reveal) {
reveal = new window.Foundation.Reveal( dom.content, {
closeOnClick: false
} );
}
return DataTable.Editor.display.foundation;
},
open: function ( dte, append, callback ) {
var content = dom.content;
content.children().detach();
content.append( append );
content.prepend( dom.close );
dom.close
.attr('title', dte.i18n.close)
.off('click.dte-zf')
.on('click.dte-zf', function () {
dte.close('icon');
});
$(document)
.off('click.dte-zf')
.on('click.dte-zf', 'div.reveal-modal-bg, div.reveal-overlay', function (e) {
if ( $(e.target).closest(dom.content).length ) {
return;
}
dte.background();
} );
if ( shown ) {
if ( callback ) {
callback();
}
return;
}
shown = true;
$(dom.content)
.one('open.zf.reveal', function () {
if ( callback ) {
callback();
}
});
reveal.open();
},
close: function ( dte, callback ) {
if (shown) {
reveal.close();
shown = false;
}
if ( callback ) {
callback();
}
},
node: function ( dte ) {
return dom.content[0];
}
} );
return Editor;
}));

View File

@ -1,4 +0,0 @@
/*! Foundation integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
!function(t){var o,l;"function"==typeof define&&define.amd?define(["jquery","datatables.net-zf","datatables.net-editor"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),l=function(e,n){n.fn.dataTable||require("datatables.net-zf")(e,n),n.fn.dataTable.Editor||require("datatables.net-editor")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),l(e,n),t(n,e,e.document)}:(l(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(l,n,a,e){"use strict";var i,t=l.fn.dataTable,o=t.Editor,d=(t.Editor.defaults.display="foundation",l.extend(!0,l.fn.dataTable.Editor.classes,{field:{wrapper:"DTE_Field row",label:"small-4 columns inline",input:"small-8 columns",error:"error",multiValue:"panel radius multi-value",multiInfo:"small",multiRestore:"panel radius multi-restore","msg-labelInfo":"label secondary","msg-info":"label secondary","msg-message":"label secondary","msg-error":"label alert"},form:{button:"button small",buttonInternal:"button small"}}),!1);const r={content:l('<div class="reveal reveal-modal DTED" data-reveal></div>'),close:l('<button class="close close-button">&times;</div>')};return t.Editor.display.foundation=l.extend(!0,{},t.Editor.models.displayController,{init:function(e){return i=i||new n.Foundation.Reveal(r.content,{closeOnClick:!1}),t.Editor.display.foundation},open:function(n,e,t){var o=r.content;o.children().detach(),o.append(e),o.prepend(r.close),r.close.attr("title",n.i18n.close).off("click.dte-zf").on("click.dte-zf",function(){n.close("icon")}),l(a).off("click.dte-zf").on("click.dte-zf","div.reveal-modal-bg, div.reveal-overlay",function(e){l(e.target).closest(r.content).length||n.background()}),d?t&&t():(d=!0,l(r.content).one("open.zf.reveal",function(){t&&t()}),i.open())},close:function(e,n){d&&(i.close(),d=!1),n&&n()},node:function(e){return r.content[0]}}),o});

View File

@ -1,4 +0,0 @@
/*! Foundation integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from"jquery";import DataTable from"datatables.net-zf";import Editor from"datatables.net-editor";let $=jQuery;var reveal,Editor=DataTable.Editor,shown=(DataTable.Editor.defaults.display="foundation",$.extend(!0,$.fn.dataTable.Editor.classes,{field:{wrapper:"DTE_Field row",label:"small-4 columns inline",input:"small-8 columns",error:"error",multiValue:"panel radius multi-value",multiInfo:"small",multiRestore:"panel radius multi-restore","msg-labelInfo":"label secondary","msg-info":"label secondary","msg-message":"label secondary","msg-error":"label alert"},form:{button:"button small",buttonInternal:"button small"}}),!1);const dom={content:$('<div class="reveal reveal-modal DTED" data-reveal></div>'),close:$('<button class="close close-button">&times;</div>')};DataTable.Editor.display.foundation=$.extend(!0,{},DataTable.Editor.models.displayController,{init:function(e){return reveal=reveal||new window.Foundation.Reveal(dom.content,{closeOnClick:!1}),DataTable.Editor.display.foundation},open:function(o,e,t){var l=dom.content;l.children().detach(),l.append(e),l.prepend(dom.close),dom.close.attr("title",o.i18n.close).off("click.dte-zf").on("click.dte-zf",function(){o.close("icon")}),$(document).off("click.dte-zf").on("click.dte-zf","div.reveal-modal-bg, div.reveal-overlay",function(e){$(e.target).closest(dom.content).length||o.background()}),shown?t&&t():(shown=!0,$(dom.content).one("open.zf.reveal",function(){t&&t()}),reveal.open())},close:function(e,o){shown&&(reveal.close(),shown=!1),o&&o()},node:function(e){return dom.content[0]}});export default Editor;

View File

@ -1,127 +0,0 @@
/*! Foundation integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from 'jquery';
import DataTable from 'datatables.net-zf';
import Editor from 'datatables.net-editor';
// Allow reassignment of the $ variable
let $ = jQuery;
var Editor = DataTable.Editor;
/*
* Set the default display controller to be our foundation control
*/
DataTable.Editor.defaults.display = "foundation";
/*
* Change the default classes from Editor to be classes for Foundation
*/
$.extend( true, $.fn.dataTable.Editor.classes, {
field: {
wrapper: "DTE_Field row",
label: "small-4 columns inline",
input: "small-8 columns",
error: "error",
multiValue: "panel radius multi-value",
multiInfo: "small",
multiRestore: "panel radius multi-restore",
"msg-labelInfo": "label secondary",
"msg-info": "label secondary",
"msg-message": "label secondary",
"msg-error": "label alert"
},
form: {
button: "button small",
buttonInternal: "button small"
}
} );
/*
* Foundation display controller - this is effectively a proxy to the Foundation
* modal control.
*/
var shown = false;
var reveal;
const dom = {
content: $(
'<div class="reveal reveal-modal DTED" data-reveal></div>'
),
close: $('<button class="close close-button">&times;</div>')
};
DataTable.Editor.display.foundation = $.extend( true, {}, DataTable.Editor.models.displayController, {
init: function ( dte ) {
if (! reveal) {
reveal = new window.Foundation.Reveal( dom.content, {
closeOnClick: false
} );
}
return DataTable.Editor.display.foundation;
},
open: function ( dte, append, callback ) {
var content = dom.content;
content.children().detach();
content.append( append );
content.prepend( dom.close );
dom.close
.attr('title', dte.i18n.close)
.off('click.dte-zf')
.on('click.dte-zf', function () {
dte.close('icon');
});
$(document)
.off('click.dte-zf')
.on('click.dte-zf', 'div.reveal-modal-bg, div.reveal-overlay', function (e) {
if ( $(e.target).closest(dom.content).length ) {
return;
}
dte.background();
} );
if ( shown ) {
if ( callback ) {
callback();
}
return;
}
shown = true;
$(dom.content)
.one('open.zf.reveal', function () {
if ( callback ) {
callback();
}
});
reveal.open();
},
close: function ( dte, callback ) {
if (shown) {
reveal.close();
shown = false;
}
if ( callback ) {
callback();
}
},
node: function ( dte ) {
return dom.content[0];
}
} );
export default Editor;

View File

@ -1,186 +0,0 @@
/*! jQuery UI integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net-jqui', 'datatables.net-editor'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
var jq = require('jquery');
var cjsRequires = function (root, $) {
if ( ! $.fn.dataTable ) {
require('datatables.net-jqui')(root, $);
}
if ( ! $.fn.dataTable.Editor ) {
require('datatables.net-editor')(root, $);
}
};
if (typeof window === 'undefined') {
module.exports = function (root, $) {
if ( ! root ) {
// CommonJS environments without a window global must pass a
// root. This will give an error otherwise
root = window;
}
if ( ! $ ) {
$ = jq( root );
}
cjsRequires( root, $ );
return factory( $, root, root.document );
};
}
else {
cjsRequires( window, jq );
module.exports = factory( jq, window, window.document );
}
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
var Editor = DataTable.Editor;
var doingClose = false;
/*
* Set the default display controller to be our foundation control
*/
Editor.defaults.display = "jqueryui";
/*
* Change the default classes from Editor to be classes for Bootstrap
*/
var buttonClass = "btn ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only";
$.extend( true, $.fn.dataTable.Editor.classes, {
form: {
button: buttonClass,
buttonInternal: buttonClass
}
} );
var dialouge;
var shown = false;
/*
* jQuery UI display controller - this is effectively a proxy to the jQuery UI
* modal control.
*/
Editor.display.jqueryui = $.extend( true, {}, Editor.models.displayController, {
init: function ( dte ) {
if (! dialouge) {
dialouge = $('<div class="DTED"></div>')
.css('display', 'none')
.appendTo('body')
.dialog( $.extend( true, Editor.display.jqueryui.modalOptions, {
autoOpen: false,
buttons: { "A": function () {} }, // fake button so the button container is created
closeOnEscape: false // allow editor's escape function to run
} ) );
}
return Editor.display.jqueryui;
},
open: function ( dte, append, callback ) {
dialouge
.children()
.detach();
dialouge
.append( append )
.dialog( 'open' );
$(dte.dom.formError).appendTo(
dialouge.parent().find('div.ui-dialog-buttonpane')
);
dialouge.parent().find('.ui-dialog-title').html( dte.dom.header.innerHTML );
dialouge.parent().addClass('DTED');
// Modify the Editor buttons to be jQuery UI suitable
var buttons = $(dte.dom.buttons)
.children()
.addClass( 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only' )
.each( function () {
$(this).wrapInner( '<span class="ui-button-text"></span>' );
} );
// Move the buttons into the jQuery UI button set
dialouge.parent().find('div.ui-dialog-buttonset')
.children()
.detach();
dialouge.parent().find('div.ui-dialog-buttonset')
.append( buttons.parent() );
dialouge
.parent()
.find('button.ui-dialog-titlebar-close')
.off('click.dte-ju')
.on('click.dte-ju', function () {
dte.close('icon');
});
// Need to know when the dialogue is closed using its own trigger
// so we can reset the form
$(dialouge)
.off( 'dialogclose.dte-ju' )
.on( 'dialogclose.dte-ju', function (e) {
if ( ! doingClose ) {
dte.close();
}
} );
shown = true;
if ( callback ) {
callback();
}
},
close: function ( dte, callback ) {
if ( dialouge ) {
// Don't want to trigger a close() call from dialogclose!
doingClose = true;
dialouge.dialog( 'close' );
doingClose = false;
}
shown = false;
if ( callback ) {
callback();
}
},
node: function ( dte ) {
return dialouge[0];
},
// jQuery UI dialogues perform their own focus capture
captureFocus: false
} );
Editor.display.jqueryui.modalOptions = {
width: 600,
modal: true
};
return Editor;
}));

View File

@ -1,4 +0,0 @@
/*! jQuery UI integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
!function(n){var o,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net-jqui","datatables.net-editor"],function(t){return n(t,window,document)}):"object"==typeof exports?(o=require("jquery"),i=function(t,e){e.fn.dataTable||require("datatables.net-jqui")(t,e),e.fn.dataTable.Editor||require("datatables.net-editor")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||o(t),i(t,e),n(e,0,t.document)}:(i(window,o),module.exports=n(o,window,window.document))):n(jQuery,window,document)}(function(o,t,e,n){"use strict";var i,d=o.fn.dataTable.Editor,a=!1,u=(d.defaults.display="jqueryui","btn ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only");o.extend(!0,o.fn.dataTable.Editor.classes,{form:{button:u,buttonInternal:u}});return d.display.jqueryui=o.extend(!0,{},d.models.displayController,{init:function(t){return i=i||o('<div class="DTED"></div>').css("display","none").appendTo("body").dialog(o.extend(!0,d.display.jqueryui.modalOptions,{autoOpen:!1,buttons:{A:function(){}},closeOnEscape:!1})),d.display.jqueryui},open:function(e,t,n){i.children().detach(),i.append(t).dialog("open"),o(e.dom.formError).appendTo(i.parent().find("div.ui-dialog-buttonpane")),i.parent().find(".ui-dialog-title").html(e.dom.header.innerHTML),i.parent().addClass("DTED");t=o(e.dom.buttons).children().addClass("ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only").each(function(){o(this).wrapInner('<span class="ui-button-text"></span>')});i.parent().find("div.ui-dialog-buttonset").children().detach(),i.parent().find("div.ui-dialog-buttonset").append(t.parent()),i.parent().find("button.ui-dialog-titlebar-close").off("click.dte-ju").on("click.dte-ju",function(){e.close("icon")}),o(i).off("dialogclose.dte-ju").on("dialogclose.dte-ju",function(t){a||e.close()}),n&&n()},close:function(t,e){i&&(a=!0,i.dialog("close"),a=!1),e&&e()},node:function(t){return i[0]},captureFocus:!1}),d.display.jqueryui.modalOptions={width:600,modal:!0},d});

View File

@ -1,4 +0,0 @@
/*! jQuery UI integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from"jquery";import DataTable from"datatables.net-jqui";import Editor from"datatables.net-editor";let $=jQuery;var dialouge,Editor=DataTable.Editor,doingClose=!1,buttonClass=(Editor.defaults.display="jqueryui","btn ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"),shown=($.extend(!0,$.fn.dataTable.Editor.classes,{form:{button:buttonClass,buttonInternal:buttonClass}}),!1);Editor.display.jqueryui=$.extend(!0,{},Editor.models.displayController,{init:function(o){return dialouge=dialouge||$('<div class="DTED"></div>').css("display","none").appendTo("body").dialog($.extend(!0,Editor.display.jqueryui.modalOptions,{autoOpen:!1,buttons:{A:function(){}},closeOnEscape:!1})),Editor.display.jqueryui},open:function(t,o,i){dialouge.children().detach(),dialouge.append(o).dialog("open"),$(t.dom.formError).appendTo(dialouge.parent().find("div.ui-dialog-buttonpane")),dialouge.parent().find(".ui-dialog-title").html(t.dom.header.innerHTML),dialouge.parent().addClass("DTED");o=$(t.dom.buttons).children().addClass("ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only").each(function(){$(this).wrapInner('<span class="ui-button-text"></span>')});dialouge.parent().find("div.ui-dialog-buttonset").children().detach(),dialouge.parent().find("div.ui-dialog-buttonset").append(o.parent()),dialouge.parent().find("button.ui-dialog-titlebar-close").off("click.dte-ju").on("click.dte-ju",function(){t.close("icon")}),$(dialouge).off("dialogclose.dte-ju").on("dialogclose.dte-ju",function(o){doingClose||t.close()}),shown=!0,i&&i()},close:function(o,t){dialouge&&(doingClose=!0,dialouge.dialog("close"),doingClose=!1),shown=!1,t&&t()},node:function(o){return dialouge[0]},captureFocus:!1}),Editor.display.jqueryui.modalOptions={width:600,modal:!0};export default Editor;

View File

@ -1,142 +0,0 @@
/*! jQuery UI integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from 'jquery';
import DataTable from 'datatables.net-jqui';
import Editor from 'datatables.net-editor';
// Allow reassignment of the $ variable
let $ = jQuery;
var Editor = DataTable.Editor;
var doingClose = false;
/*
* Set the default display controller to be our foundation control
*/
Editor.defaults.display = "jqueryui";
/*
* Change the default classes from Editor to be classes for Bootstrap
*/
var buttonClass = "btn ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only";
$.extend( true, $.fn.dataTable.Editor.classes, {
form: {
button: buttonClass,
buttonInternal: buttonClass
}
} );
var dialouge;
var shown = false;
/*
* jQuery UI display controller - this is effectively a proxy to the jQuery UI
* modal control.
*/
Editor.display.jqueryui = $.extend( true, {}, Editor.models.displayController, {
init: function ( dte ) {
if (! dialouge) {
dialouge = $('<div class="DTED"></div>')
.css('display', 'none')
.appendTo('body')
.dialog( $.extend( true, Editor.display.jqueryui.modalOptions, {
autoOpen: false,
buttons: { "A": function () {} }, // fake button so the button container is created
closeOnEscape: false // allow editor's escape function to run
} ) );
}
return Editor.display.jqueryui;
},
open: function ( dte, append, callback ) {
dialouge
.children()
.detach();
dialouge
.append( append )
.dialog( 'open' );
$(dte.dom.formError).appendTo(
dialouge.parent().find('div.ui-dialog-buttonpane')
);
dialouge.parent().find('.ui-dialog-title').html( dte.dom.header.innerHTML );
dialouge.parent().addClass('DTED');
// Modify the Editor buttons to be jQuery UI suitable
var buttons = $(dte.dom.buttons)
.children()
.addClass( 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only' )
.each( function () {
$(this).wrapInner( '<span class="ui-button-text"></span>' );
} );
// Move the buttons into the jQuery UI button set
dialouge.parent().find('div.ui-dialog-buttonset')
.children()
.detach();
dialouge.parent().find('div.ui-dialog-buttonset')
.append( buttons.parent() );
dialouge
.parent()
.find('button.ui-dialog-titlebar-close')
.off('click.dte-ju')
.on('click.dte-ju', function () {
dte.close('icon');
});
// Need to know when the dialogue is closed using its own trigger
// so we can reset the form
$(dialouge)
.off( 'dialogclose.dte-ju' )
.on( 'dialogclose.dte-ju', function (e) {
if ( ! doingClose ) {
dte.close();
}
} );
shown = true;
if ( callback ) {
callback();
}
},
close: function ( dte, callback ) {
if ( dialouge ) {
// Don't want to trigger a close() call from dialogclose!
doingClose = true;
dialouge.dialog( 'close' );
doingClose = false;
}
shown = false;
if ( callback ) {
callback();
}
},
node: function ( dte ) {
return dialouge[0];
},
// jQuery UI dialogues perform their own focus capture
captureFocus: false
} );
Editor.display.jqueryui.modalOptions = {
width: 600,
modal: true
};
export default Editor;

View File

@ -1,256 +0,0 @@
/*! Semantic UI integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net-se', 'datatables.net-editor'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
var jq = require('jquery');
var cjsRequires = function (root, $) {
if ( ! $.fn.dataTable ) {
require('datatables.net-se')(root, $);
}
if ( ! $.fn.dataTable.Editor ) {
require('datatables.net-editor')(root, $);
}
};
if (typeof window === 'undefined') {
module.exports = function (root, $) {
if ( ! root ) {
// CommonJS environments without a window global must pass a
// root. This will give an error otherwise
root = window;
}
if ( ! $ ) {
$ = jq( root );
}
cjsRequires( root, $ );
return factory( $, root, root.document );
};
}
else {
cjsRequires( window, jq );
module.exports = factory( jq, window, window.document );
}
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
var Editor = DataTable.Editor;
/*
* Set the default display controller to be Semantic UI modal
*/
DataTable.Editor.defaults.display = "semanticui";
/*
* Change the default classes from Editor to be classes for Bootstrap
*/
$.extend( true, $.fn.dataTable.Editor.classes, {
"header": {
"wrapper": "DTE_Header header"
},
"body": {
"wrapper": "DTE_Body content"
},
"footer": {
"wrapper": "DTE_Footer actions"
},
"form": {
"tag": "ui form",
"button": "ui button",
"buttonInternal": "ui button",
"content": 'DTE_Form_Content'
},
"field": {
"wrapper": "DTE_Field inline fields",
"label": "right aligned five wide field",
"input": "eight wide field DTE_Field_Input",
"error": "error has-error",
"msg-labelInfo": "ui small",
"msg-info": "ui small",
"msg-message": "ui message small",
"msg-error": "ui error message small",
"multiValue": "ui message multi-value",
"multiInfo": "small",
"multiRestore": "ui message multi-restore"
},
inline: {
wrapper: "DTE DTE_Inline ui form"
},
bubble: {
table: "DTE_Bubble_Table ui form",
bg: "ui dimmer modals page transition visible active"
}
} );
$.extend( true, DataTable.ext.buttons, {
create: {
formButtons: {
className: 'primary'
}
},
edit: {
formButtons: {
className: 'primary'
}
},
remove: {
formButtons: {
className: 'negative'
}
}
} );
DataTable.Editor.fieldTypes.datatable.tableClass = 'ui table';
/*
* Bootstrap display controller - this is effectively a proxy to the Bootstrap
* modal control.
*/
// Single shared model for all Editor instances
const dom = {
modal: $('<div class="ui modal DTED"></div>'),
close: $('<i class="close icon"/>')
}
let shown = false;
let lastAppend;
DataTable.Editor.display.semanticui = $.extend( true, {}, DataTable.Editor.models.displayController, {
/*
* API methods
*/
init: function ( dte ) {
// Make select lists semantic ui dropdowns if possible
if ($.fn.dropdown) {
dte.on( 'displayOrder.dtesu open.dtesu', function ( e, display, action, form ) {
$.each( dte.s.fields, function ( key, field ) {
$('select', field.node())
.addClass('fluid')
.dropdown();
} );
} );
}
return DataTable.Editor.display.semanticui;
},
open: function ( dte, append, callback ) {
var modal = dom.modal;
var appendChildren = $(append).children();
// Because we can't use a single element, we need to insert the existing
// children back into their previous host so that can be reused later
if (lastAppend) {
modal.children().appendTo(lastAppend);
}
lastAppend = append;
// Clean up any existing elements and then insert the elements to
// display. In Semantic UI we need to have the header, content and
// actions at the top level of the modal rather than as children of a
// wrapper.
modal
.children()
.detach();
modal
.append( appendChildren )
.prepend( modal.children('.header') ) // order is important
.addClass( append.className )
.prepend( dom.close );
dom.close
.attr('title', dte.i18n.close)
.off( 'click.dte-se' )
.on( 'click.dte-se', function (e) {
dte.close('icon');
return false;
} );
$(document)
.off('click.dte-se')
.on('click.dte-se', 'div.ui.dimmer.modals', function (e) {
if ( $(e.target).hasClass('dimmer') ) {
dte.background();
}
} );
if ( shown ) {
if ( callback ) {
callback();
}
return;
}
shown = true;
$(modal)
.modal( 'setting', {
autofocus: false,
closable: false,
onVisible: function () {
// Can only give elements focus when shown
if ( dte.s.setFocus ) {
dte.s.setFocus.focus();
}
if ( callback ) {
callback();
}
},
onHidden: function () {
$(append).append( appendChildren );
shown = false;
}
} )
.modal( 'show' );
},
close: function ( dte, callback ) {
if ( ! shown ) {
if ( callback ) {
callback();
}
return;
}
dom.modal.modal('hide');
lastAppend = null;
shown = false;
if ( callback ) {
callback();
}
},
node: function ( dte ) {
return dom.modal[0];
}
} );
return Editor;
}));

View File

@ -1,4 +0,0 @@
/*! Semantic UI integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
!function(n){var o,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net-se","datatables.net-editor"],function(e){return n(e,window,document)}):"object"==typeof exports?(o=require("jquery"),i=function(e,t){t.fn.dataTable||require("datatables.net-se")(e,t),t.fn.dataTable.Editor||require("datatables.net-editor")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||o(e),i(e,t),n(t,0,e.document)}:(i(window,o),module.exports=n(o,window,window.document))):n(jQuery,window,document)}(function(a,e,d,t){"use strict";var n=a.fn.dataTable,o=n.Editor;n.Editor.defaults.display="semanticui",a.extend(!0,a.fn.dataTable.Editor.classes,{header:{wrapper:"DTE_Header header"},body:{wrapper:"DTE_Body content"},footer:{wrapper:"DTE_Footer actions"},form:{tag:"ui form",button:"ui button",buttonInternal:"ui button",content:"DTE_Form_Content"},field:{wrapper:"DTE_Field inline fields",label:"right aligned five wide field",input:"eight wide field DTE_Field_Input",error:"error has-error","msg-labelInfo":"ui small","msg-info":"ui small","msg-message":"ui message small","msg-error":"ui error message small",multiValue:"ui message multi-value",multiInfo:"small",multiRestore:"ui message multi-restore"},inline:{wrapper:"DTE DTE_Inline ui form"},bubble:{table:"DTE_Bubble_Table ui form",bg:"ui dimmer modals page transition visible active"}}),a.extend(!0,n.ext.buttons,{create:{formButtons:{className:"primary"}},edit:{formButtons:{className:"primary"}},remove:{formButtons:{className:"negative"}}}),n.Editor.fieldTypes.datatable.tableClass="ui table";const r={modal:a('<div class="ui modal DTED"></div>'),close:a('<i class="close icon"/>')};let s=!1,l;return n.Editor.display.semanticui=a.extend(!0,{},n.Editor.models.displayController,{init:function(i){return a.fn.dropdown&&i.on("displayOrder.dtesu open.dtesu",function(e,t,n,o){a.each(i.s.fields,function(e,t){a("select",t.node()).addClass("fluid").dropdown()})}),n.Editor.display.semanticui},open:function(t,e,n){var o=r.modal,i=a(e).children();l&&o.children().appendTo(l),l=e,o.children().detach(),o.append(i).prepend(o.children(".header")).addClass(e.className).prepend(r.close),r.close.attr("title",t.i18n.close).off("click.dte-se").on("click.dte-se",function(e){return t.close("icon"),!1}),a(d).off("click.dte-se").on("click.dte-se","div.ui.dimmer.modals",function(e){a(e.target).hasClass("dimmer")&&t.background()}),s?n&&n():(s=!0,a(o).modal("setting",{autofocus:!1,closable:!1,onVisible:function(){t.s.setFocus&&t.s.setFocus.focus(),n&&n()},onHidden:function(){a(e).append(i),s=!1}}).modal("show"))},close:function(e,t){s&&(r.modal.modal("hide"),l=null,s=!1),t&&t()},node:function(e){return r.modal[0]}}),o});

View File

@ -1,4 +0,0 @@
/*! Semantic UI integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from"jquery";import DataTable from"datatables.net-se";import Editor from"datatables.net-editor";let $=jQuery;var Editor=DataTable.Editor;DataTable.Editor.defaults.display="semanticui",$.extend(!0,$.fn.dataTable.Editor.classes,{header:{wrapper:"DTE_Header header"},body:{wrapper:"DTE_Body content"},footer:{wrapper:"DTE_Footer actions"},form:{tag:"ui form",button:"ui button",buttonInternal:"ui button",content:"DTE_Form_Content"},field:{wrapper:"DTE_Field inline fields",label:"right aligned five wide field",input:"eight wide field DTE_Field_Input",error:"error has-error","msg-labelInfo":"ui small","msg-info":"ui small","msg-message":"ui message small","msg-error":"ui error message small",multiValue:"ui message multi-value",multiInfo:"small",multiRestore:"ui message multi-restore"},inline:{wrapper:"DTE DTE_Inline ui form"},bubble:{table:"DTE_Bubble_Table ui form",bg:"ui dimmer modals page transition visible active"}}),$.extend(!0,DataTable.ext.buttons,{create:{formButtons:{className:"primary"}},edit:{formButtons:{className:"primary"}},remove:{formButtons:{className:"negative"}}}),DataTable.Editor.fieldTypes.datatable.tableClass="ui table";const dom={modal:$('<div class="ui modal DTED"></div>'),close:$('<i class="close icon"/>')};let shown=!1,lastAppend;DataTable.Editor.display.semanticui=$.extend(!0,{},DataTable.Editor.models.displayController,{init:function(l){return $.fn.dropdown&&l.on("displayOrder.dtesu open.dtesu",function(e,t,a,o){$.each(l.s.fields,function(e,t){$("select",t.node()).addClass("fluid").dropdown()})}),DataTable.Editor.display.semanticui},open:function(t,e,a){var o=dom.modal,l=$(e).children();lastAppend&&o.children().appendTo(lastAppend),lastAppend=e,o.children().detach(),o.append(l).prepend(o.children(".header")).addClass(e.className).prepend(dom.close),dom.close.attr("title",t.i18n.close).off("click.dte-se").on("click.dte-se",function(e){return t.close("icon"),!1}),$(document).off("click.dte-se").on("click.dte-se","div.ui.dimmer.modals",function(e){$(e.target).hasClass("dimmer")&&t.background()}),shown?a&&a():(shown=!0,$(o).modal("setting",{autofocus:!1,closable:!1,onVisible:function(){t.s.setFocus&&t.s.setFocus.focus(),a&&a()},onHidden:function(){$(e).append(l),shown=!1}}).modal("show"))},close:function(e,t){shown&&(dom.modal.modal("hide"),lastAppend=null,shown=!1),t&&t()},node:function(e){return dom.modal[0]}});export default Editor;

View File

@ -1,212 +0,0 @@
/*! Semantic UI integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from 'jquery';
import DataTable from 'datatables.net-se';
import Editor from 'datatables.net-editor';
// Allow reassignment of the $ variable
let $ = jQuery;
var Editor = DataTable.Editor;
/*
* Set the default display controller to be Semantic UI modal
*/
DataTable.Editor.defaults.display = "semanticui";
/*
* Change the default classes from Editor to be classes for Bootstrap
*/
$.extend( true, $.fn.dataTable.Editor.classes, {
"header": {
"wrapper": "DTE_Header header"
},
"body": {
"wrapper": "DTE_Body content"
},
"footer": {
"wrapper": "DTE_Footer actions"
},
"form": {
"tag": "ui form",
"button": "ui button",
"buttonInternal": "ui button",
"content": 'DTE_Form_Content'
},
"field": {
"wrapper": "DTE_Field inline fields",
"label": "right aligned five wide field",
"input": "eight wide field DTE_Field_Input",
"error": "error has-error",
"msg-labelInfo": "ui small",
"msg-info": "ui small",
"msg-message": "ui message small",
"msg-error": "ui error message small",
"multiValue": "ui message multi-value",
"multiInfo": "small",
"multiRestore": "ui message multi-restore"
},
inline: {
wrapper: "DTE DTE_Inline ui form"
},
bubble: {
table: "DTE_Bubble_Table ui form",
bg: "ui dimmer modals page transition visible active"
}
} );
$.extend( true, DataTable.ext.buttons, {
create: {
formButtons: {
className: 'primary'
}
},
edit: {
formButtons: {
className: 'primary'
}
},
remove: {
formButtons: {
className: 'negative'
}
}
} );
DataTable.Editor.fieldTypes.datatable.tableClass = 'ui table';
/*
* Bootstrap display controller - this is effectively a proxy to the Bootstrap
* modal control.
*/
// Single shared model for all Editor instances
const dom = {
modal: $('<div class="ui modal DTED"></div>'),
close: $('<i class="close icon"/>')
}
let shown = false;
let lastAppend;
DataTable.Editor.display.semanticui = $.extend( true, {}, DataTable.Editor.models.displayController, {
/*
* API methods
*/
init: function ( dte ) {
// Make select lists semantic ui dropdowns if possible
if ($.fn.dropdown) {
dte.on( 'displayOrder.dtesu open.dtesu', function ( e, display, action, form ) {
$.each( dte.s.fields, function ( key, field ) {
$('select', field.node())
.addClass('fluid')
.dropdown();
} );
} );
}
return DataTable.Editor.display.semanticui;
},
open: function ( dte, append, callback ) {
var modal = dom.modal;
var appendChildren = $(append).children();
// Because we can't use a single element, we need to insert the existing
// children back into their previous host so that can be reused later
if (lastAppend) {
modal.children().appendTo(lastAppend);
}
lastAppend = append;
// Clean up any existing elements and then insert the elements to
// display. In Semantic UI we need to have the header, content and
// actions at the top level of the modal rather than as children of a
// wrapper.
modal
.children()
.detach();
modal
.append( appendChildren )
.prepend( modal.children('.header') ) // order is important
.addClass( append.className )
.prepend( dom.close );
dom.close
.attr('title', dte.i18n.close)
.off( 'click.dte-se' )
.on( 'click.dte-se', function (e) {
dte.close('icon');
return false;
} );
$(document)
.off('click.dte-se')
.on('click.dte-se', 'div.ui.dimmer.modals', function (e) {
if ( $(e.target).hasClass('dimmer') ) {
dte.background();
}
} );
if ( shown ) {
if ( callback ) {
callback();
}
return;
}
shown = true;
$(modal)
.modal( 'setting', {
autofocus: false,
closable: false,
onVisible: function () {
// Can only give elements focus when shown
if ( dte.s.setFocus ) {
dte.s.setFocus.focus();
}
if ( callback ) {
callback();
}
},
onHidden: function () {
$(append).append( appendChildren );
shown = false;
}
} )
.modal( 'show' );
},
close: function ( dte, callback ) {
if ( ! shown ) {
if ( callback ) {
callback();
}
return;
}
dom.modal.modal('hide');
lastAppend = null;
shown = false;
if ( callback ) {
callback();
}
},
node: function ( dte ) {
return dom.modal[0];
}
} );
export default Editor;