update plugin files

This commit is contained in:
REJack 2021-02-23 12:22:20 +01:00
parent d5f41bfd34
commit 1ac5eeaaa1
13 changed files with 255 additions and 180 deletions

View file

@ -4798,19 +4798,19 @@
});
}
function History(startGen) {
function History(prev) {
// Arrays of change events and selections. Doing something adds an
// event to done and clears undo. Undoing moves events from done
// to undone, redoing moves them in the other direction.
this.done = []; this.undone = [];
this.undoDepth = Infinity;
this.undoDepth = prev ? prev.undoDepth : Infinity;
// Used to track when changes can be merged into a single undo
// event
this.lastModTime = this.lastSelTime = 0;
this.lastOp = this.lastSelOp = null;
this.lastOrigin = this.lastSelOrigin = null;
// Used by the isClean() method
this.generation = this.maxGeneration = startGen || 1;
this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1;
}
// Create a history change event from an updateDoc-style change
@ -6244,7 +6244,7 @@
clearHistory: function() {
var this$1 = this;
this.history = new History(this.history.maxGeneration);
this.history = new History(this.history);
linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true);
},
@ -6265,7 +6265,7 @@
undone: copyHistoryArray(this.history.undone)}
},
setHistory: function(histData) {
var hist = this.history = new History(this.history.maxGeneration);
var hist = this.history = new History(this.history);
hist.done = copyHistoryArray(histData.done.slice(0), null, true);
hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);
},
@ -7708,7 +7708,7 @@
for (var i = newBreaks.length - 1; i >= 0; i--)
{ replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }
});
option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) {
option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) {
cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g");
if (old != Init) { cm.refresh(); }
});
@ -9793,7 +9793,7 @@
addLegacyProps(CodeMirror);
CodeMirror.version = "5.59.2";
CodeMirror.version = "5.59.3";
return CodeMirror;

View file

@ -233,9 +233,19 @@
cm.setCursor(cm.getCursor());
}
function makePrompt(msg) {
var fragment = document.createDocumentFragment();
var input = document.createElement("input");
input.setAttribute("type", "text");
input.style.width = "10em";
fragment.appendChild(document.createTextNode(msg + ": "));
fragment.appendChild(input);
return fragment;
}
function getInput(cm, msg, f) {
if (cm.openDialog)
cm.openDialog(msg + ": <input type=\"text\" style=\"width: 10em\"/>", f, {bottom: true});
cm.openDialog(makePrompt(msg), f, {bottom: true});
else
f(prompt(msg, ""));
}

View file

@ -244,6 +244,7 @@
{ name: 'yank', shortName: 'y' },
{ name: 'delmarks', shortName: 'delm' },
{ name: 'registers', shortName: 'reg', excludeFromCommandHistory: true },
{ name: 'vglobal', shortName: 'v' },
{ name: 'global', shortName: 'g' }
];
@ -353,7 +354,7 @@
return cmd;
}
var modifiers = {'Shift': 'S', 'Ctrl': 'C', 'Alt': 'A', 'Cmd': 'D', 'Mod': 'A'};
var modifiers = {Shift:'S',Ctrl:'C',Alt:'A',Cmd:'D',Mod:'A',CapsLock:''};
var specialKeys = {Enter:'CR',Backspace:'BS',Delete:'Del',Insert:'Ins'};
function cmKeyToVimKey(key) {
if (key.charAt(0) == '\'') {
@ -1450,7 +1451,7 @@
showPrompt(cm, {
onClose: onPromptClose,
prefix: promptPrefix,
desc: searchPromptDesc,
desc: '(JavaScript regexp)',
onKeyUp: onPromptKeyUp,
onKeyDown: onPromptKeyDown
});
@ -4110,16 +4111,6 @@
var vim = cm.state.vim;
return vim.searchState_ || (vim.searchState_ = new SearchState());
}
function dialog(cm, template, shortText, onClose, options) {
if (cm.openDialog) {
cm.openDialog(template, onClose, { bottom: true, value: options.value,
onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp,
selectValueOnOpen: false});
}
else {
onClose(prompt(shortText, ''));
}
}
function splitBySlash(argString) {
return splitBySeparator(argString, '/');
}
@ -4306,28 +4297,64 @@
(ignoreCase || forceIgnoreCase) ? 'i' : undefined);
return regexp;
}
function showConfirm(cm, text) {
/**
* dom - Document Object Manipulator
* Usage:
* dom('<tag>'|<node>[, ...{<attributes>|<$styles>}|<child-node>|'<text>'])
* Examples:
* dom('div', {id:'xyz'}, dom('p', 'CM rocks!', {$color:'red'}))
* dom(document.head, dom('script', 'alert("hello!")'))
* Not supported:
* dom('p', ['arrays are objects'], Error('objects specify attributes'))
*/
function dom(n) {
if (typeof n === 'string') n = document.createElement(n);
for (var a, i = 1; i < arguments.length; i++) {
if (!(a = arguments[i])) continue;
if (typeof a !== 'object') a = document.createTextNode(a);
if (a.nodeType) n.appendChild(a);
else for (var key in a) {
if (!Object.prototype.hasOwnProperty.call(a, key)) continue;
if (key[0] === '$') n.style[key.slice(1)] = a[key];
else n.setAttribute(key, a[key]);
}
}
return n;
}
function showConfirm(cm, template) {
var pre = dom('pre', {$color: 'red'}, template);
if (cm.openNotification) {
cm.openNotification('<span style="color: red">' + text + '</span>',
{bottom: true, duration: 5000});
cm.openNotification(pre, {bottom: true, duration: 5000});
} else {
alert(text);
alert(pre.innerText);
}
}
function makePrompt(prefix, desc) {
var raw = '<span style="font-family: monospace; white-space: pre">' +
(prefix || "") + '<input type="text" autocorrect="off" ' +
'autocapitalize="off" spellcheck="false"></span>';
if (desc)
raw += ' <span style="color: #888">' + desc + '</span>';
return raw;
return dom(document.createDocumentFragment(),
dom('span', {$fontFamily: 'monospace', $whiteSpace: 'pre'},
prefix,
dom('input', {type: 'text', autocorrect: 'off',
autocapitalize: 'off', spellcheck: 'false'})),
desc && dom('span', {$color: '#888'}, desc));
}
var searchPromptDesc = '(JavaScript regexp)';
function showPrompt(cm, options) {
var shortText = (options.prefix || '') + ' ' + (options.desc || '');
var prompt = makePrompt(options.prefix, options.desc);
dialog(cm, prompt, shortText, options.onClose, options);
var template = makePrompt(options.prefix, options.desc);
if (cm.openDialog) {
cm.openDialog(template, options.onClose, {
onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp,
bottom: true, selectValueOnOpen: false, value: options.value
});
}
else {
options.onClose(prompt(shortText, ''));
}
}
function regexEqual(r1, r2) {
if (r1 instanceof RegExp && r2 instanceof RegExp) {
var props = ['global', 'multiline', 'ignoreCase', 'source'];
@ -4501,7 +4528,7 @@
if (start instanceof Array) {
return inArray(pos, start);
} else {
if (end) {
if (typeof end == 'number') {
return (pos >= start && pos <= end);
} else {
return pos == start;
@ -4564,7 +4591,7 @@
try {
this.parseInput_(cm, inputStream, params);
} catch(e) {
showConfirm(cm, e);
showConfirm(cm, e.toString());
throw e;
}
var command;
@ -4608,7 +4635,7 @@
params.callback();
}
} catch(e) {
showConfirm(cm, e);
showConfirm(cm, e.toString());
throw e;
}
},
@ -4880,12 +4907,12 @@
registers: function(cm, params) {
var regArgs = params.args;
var registers = vimGlobalState.registerController.registers;
var regInfo = '----------Registers----------<br><br>';
var regInfo = '----------Registers----------\n\n';
if (!regArgs) {
for (var registerName in registers) {
var text = registers[registerName].toString();
if (text.length) {
regInfo += '"' + registerName + ' ' + text + '<br>';
regInfo += '"' + registerName + ' ' + text + '\n'
}
}
} else {
@ -4897,7 +4924,7 @@
continue;
}
var register = registers[registerName] || new Register();
regInfo += '"' + registerName + ' ' + register.toString() + '<br>';
regInfo += '"' + registerName + ' ' + register.toString() + '\n'
}
}
showConfirm(cm, regInfo);
@ -4992,6 +5019,10 @@
}
cm.replaceRange(text.join('\n'), curStart, curEnd);
},
vglobal: function(cm, params) {
// global inspects params.commandName
this.global(cm, params);
},
global: function(cm, params) {
// a global command is of the form
// :[range]g/pattern/[cmd]
@ -5001,6 +5032,7 @@
showConfirm(cm, 'Regular Expression missing from global');
return;
}
var inverted = params.commandName[0] === 'v';
// range is specified here
var lineStart = (params.line !== undefined) ? params.line : cm.firstLine();
var lineEnd = params.lineEnd || params.line || cm.lastLine();
@ -5025,28 +5057,33 @@
// now that we have the regexPart, search for regex matches in the
// specified range of lines
var query = getSearchState(cm).getQuery();
var matchedLines = [], content = '';
var matchedLines = [];
for (var i = lineStart; i <= lineEnd; i++) {
var matched = query.test(cm.getLine(i));
if (matched) {
matchedLines.push(i+1);
content+= cm.getLine(i) + '<br>';
var line = cm.getLineHandle(i);
var matched = query.test(line.text);
if (matched !== inverted) {
matchedLines.push(cmd ? line : line.text);
}
}
// if there is no [cmd], just display the list of matched lines
if (!cmd) {
showConfirm(cm, content);
showConfirm(cm, matchedLines.join('\n'));
return;
}
var index = 0;
var nextCommand = function() {
if (index < matchedLines.length) {
var command = matchedLines[index] + cmd;
var line = matchedLines[index++];
var lineNum = cm.getLineNumber(line);
if (lineNum == null) {
nextCommand();
return;
}
var command = (lineNum + 1) + cmd;
exCommandDispatcher.processCommand(cm, command, {
callback: nextCommand
});
}
index++;
};
nextCommand();
},
@ -5066,9 +5103,11 @@
regexPart = new RegExp(regexPart).source; //normalize not escaped characters
}
replacePart = tokens[1];
if (regexPart && regexPart[regexPart.length - 1] === '$') {
regexPart = regexPart.slice(0, regexPart.length - 1) + '\\n';
replacePart = replacePart ? replacePart + '\n' : '\n';
// If the pattern ends with $ (line boundary assertion), change $ to \n.
// Caveat: this workaround cannot match on the last line of the document.
if (/(^|[^\\])(\\\\)*\$$/.test(regexPart)) {
regexPart = regexPart.slice(0, -1) + '\\n';
replacePart = (replacePart || '') + '\n';
}
if (replacePart !== undefined) {
if (getOption('pcre')) {
@ -5097,11 +5136,9 @@
if (flagsPart) {
if (flagsPart.indexOf('c') != -1) {
confirm = true;
flagsPart.replace('c', '');
}
if (flagsPart.indexOf('g') != -1) {
global = true;
flagsPart.replace('g', '');
}
if (getOption('pcre')) {
regexPart = regexPart + '/' + flagsPart;
@ -5242,7 +5279,7 @@
// Set up all the functions.
cm.state.vim.exMode = true;
var done = false;
var lastPos = searchCursor.from();
var lastPos, modifiedLineNumber, joined;
function replaceAll() {
cm.operation(function() {
while (!done) {
@ -5255,14 +5292,18 @@
function replace() {
var text = cm.getRange(searchCursor.from(), searchCursor.to());
var newText = text.replace(query, replaceWith);
var unmodifiedLineNumber = searchCursor.to().line;
searchCursor.replace(newText);
modifiedLineNumber = searchCursor.to().line;
lineEnd += modifiedLineNumber - unmodifiedLineNumber;
joined = modifiedLineNumber < unmodifiedLineNumber;
}
function next() {
// The below only loops to skip over multiple occurrences on the same
// line when 'global' is not true.
while(searchCursor.findNext() &&
isInRange(searchCursor.from(), lineStart, lineEnd)) {
if (!global && lastPos && searchCursor.from().line == lastPos.line) {
if (!global && searchCursor.from().line == modifiedLineNumber && !joined) {
continue;
}
cm.scrollIntoView(searchCursor.from(), 30);
@ -5327,7 +5368,7 @@
return;
}
showPrompt(cm, {
prefix: 'replace with <strong>' + replaceWith + '</strong> (y/n/a/q/l)',
prefix: dom('span', 'replace with ', dom('strong', replaceWith), ' (y/n/a/q/l)'),
onKeyDown: onPromptKeyDown
});
}
@ -5535,9 +5576,7 @@
clearFakeCursor(vim);
// In visual mode, the cursor may be positioned over EOL.
if (from.ch == cm.getLine(from.line).length) {
var widget = document.createElement("span");
widget.textContent = "\u00a0";
widget.className = className;
var widget = dom('span', { 'class': className }, '\u00a0');
vim.fakeCursorBookmark = cm.setBookmark(from, {widget: widget});
} else {
vim.fakeCursor = cm.markText(from, to, {className: className});

View file

@ -735,7 +735,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
if (stream.peek() === undefined) { // End of line, set flag to check next line
state.linkTitle = true;
} else { // More content on line, check if link title
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true);
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\.)+\)))?/, true);
}
state.f = state.inline = inlineNormal;
return tokenTypes.linkHref + " url";

View file

@ -1,11 +1,11 @@
/*! KeyTable 2.6.0
/*! KeyTable 2.6.1
* ©2009-2021 SpryMedia Ltd - datatables.net/license
*/
/**
* @summary KeyTable
* @description Spreadsheet like keyboard navigation for DataTables
* @version 2.6.0
* @version 2.6.1
* @file dataTables.keyTable.js
* @author SpryMedia Ltd (www.sprymedia.co.uk)
* @contact www.sprymedia.co.uk/contact
@ -524,7 +524,7 @@ $.extend( KeyTable.prototype, {
}
// DataTables draw event
if (orig.type === 'draw') {
if (orig && orig.type === 'draw') {
return;
}
@ -551,12 +551,14 @@ $.extend( KeyTable.prototype, {
return;
}
orig.stopPropagation();
if ( orig ) {
orig.stopPropagation();
// Return key should do nothing - for textareas it would empty the
// contents
if ( key === 13 ) {
orig.preventDefault();
// Return key should do nothing - for textareas it would empty the
// contents
if ( key === 13 ) {
orig.preventDefault();
}
}
var editInline = function () {
@ -604,6 +606,7 @@ $.extend( KeyTable.prototype, {
$( dt.table().container() ).removeClass('dtk-focus-alt');
if (that.s.returnSubmit) {
that.s.returnSubmit = false;
that._emitEvent( 'key-return-submit', [dt, editCell] );
}
} );
@ -1207,7 +1210,7 @@ KeyTable.defaults = {
KeyTable.version = "2.6.0";
KeyTable.version = "2.6.1";
$.fn.dataTable.KeyTable = KeyTable;
@ -1247,7 +1250,7 @@ DataTable.Api.register( 'keys.enable()', function ( opts ) {
} );
DataTable.Api.register( 'keys.enabled()', function ( opts ) {
let ctx = this.context;
var ctx = this.context;
if (ctx.length) {
return ctx[0].keytable

View file

@ -0,0 +1,26 @@
/*!
KeyTable 2.6.1
©2009-2021 SpryMedia Ltd - datatables.net/license
*/
(function(e){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(j){return e(j,window,document)}):"object"===typeof exports?module.exports=function(j,k){j||(j=window);if(!k||!k.fn.dataTable)k=require("datatables.net")(j,k).$;return e(k,j,j.document)}:e(jQuery,window,document)})(function(e,j,k,n){var l=e.fn.dataTable,o=0,p=0,m=function(a,b){if(!l.versionCheck||!l.versionCheck("1.10.8"))throw"KeyTable requires DataTables 1.10.8 or newer";this.c=e.extend(!0,{},l.defaults.keyTable,
m.defaults,b);this.s={dt:new l.Api(a),enable:!0,focusDraw:!1,waitingForDraw:!1,lastFocus:null,namespace:".keyTable-"+o++,tabInput:null};this.dom={};var d=this.s.dt.settings()[0],c=d.keytable;if(c)return c;d.keytable=this;this._constructor()};e.extend(m.prototype,{blur:function(){this._blur()},enable:function(a){this.s.enable=a},enabled:function(){return this.s.enable},focus:function(a,b){this._focus(this.s.dt.cell(a,b))},focused:function(a){if(!this.s.lastFocus)return!1;var b=this.s.lastFocus.cell.index();
return a.row===b.row&&a.column===b.column},_constructor:function(){this._tabInput();var a=this,b=this.s.dt,d=e(b.table().node()),c=this.s.namespace,f=!1;"static"===d.css("position")&&d.css("position","relative");e(b.table().body()).on("click"+c,"th, td",function(c){if(!1!==a.s.enable){var d=b.cell(this);d.any()&&a._focus(d,null,!1,c)}});e(k).on("keydown"+c,function(b){f||a._key(b)});if(this.c.blurable)e(k).on("mousedown"+c,function(c){e(c.target).parents(".dataTables_filter").length&&a._blur();e(c.target).parents().filter(b.table().container()).length||
e(c.target).parents("div.DTE").length||!e(c.target).parents("div.editor-datetime").length&&!e(c.target).parents("div.dt-datetime").length&&(e(c.target).parents().filter(".DTFC_Cloned").length||a._blur())});if(this.c.editor){var i=this.c.editor;i.on("open.keyTableMain",function(b,d){"inline"!==d&&a.s.enable&&(a.enable(!1),i.one("close"+c,function(){a.enable(!0)}))});if(this.c.editOnFocus)b.on("key-focus"+c+" key-refocus"+c,function(b,c,d,f){a._editor(null,f,!0)});b.on("key"+c,function(b,c,d,f,g){a._editor(d,
g,!1)});e(b.table().body()).on("dblclick"+c,"th, td",function(c){!1!==a.s.enable&&b.cell(this).any()&&(a.s.lastFocus&&this!==a.s.lastFocus.cell.node()||a._editor(null,c,!0))});i.on("preSubmit",function(){f=!0}).on("preSubmitCancelled",function(){f=!1}).on("submitComplete",function(){f=!1})}if(b.settings()[0].oFeatures.bStateSave)b.on("stateSaveParams"+c,function(b,c,d){d.keyTable=a.s.lastFocus?a.s.lastFocus.cell.index():null});b.on("column-visibility"+c,function(){a._tabInput()});b.on("draw"+c,function(c){a._tabInput();
if(!a.s.focusDraw&&a.s.lastFocus){var d=a.s.lastFocus.relative,f=b.page.info(),g=d.row+f.start;0!==f.recordsDisplay&&(g>=f.recordsDisplay&&(g=f.recordsDisplay-1),a._focus(g,d.column,!0,c))}});this.c.clipboard&&this._clipboard();b.on("destroy"+c,function(){a._blur(!0);b.off(c);e(b.table().body()).off("click"+c,"th, td").off("dblclick"+c,"th, td");e(k).off("mousedown"+c).off("keydown"+c).off("copy"+c).off("paste"+c)});var g=b.state.loaded();if(g&&g.keyTable)b.one("init",function(){var a=b.cell(g.keyTable);
a.any()&&a.focus()});else this.c.focus&&b.cell(this.c.focus).focus()},_blur:function(a){if(this.s.enable&&this.s.lastFocus){var b=this.s.lastFocus.cell;e(b.node()).removeClass(this.c.className);this.s.lastFocus=null;a||(this._updateFixedColumns(b.index().column),this._emitEvent("key-blur",[this.s.dt,b]))}},_clipboard:function(){var a=this.s.dt,b=this,d=this.s.namespace;j.getSelection&&(e(k).on("copy"+d,function(a){var a=a.originalEvent,d=j.getSelection().toString(),e=b.s.lastFocus;!d&&e&&(a.clipboardData.setData("text/plain",
e.cell.render(b.c.clipboardOrthogonal)),a.preventDefault())}),e(k).on("paste"+d,function(c){var c=c.originalEvent,d=b.s.lastFocus,e=k.activeElement,g=b.c.editor,h;if(d&&(!e||"body"===e.nodeName.toLowerCase()))c.preventDefault(),j.clipboardData&&j.clipboardData.getData?h=j.clipboardData.getData("Text"):c.clipboardData&&c.clipboardData.getData&&(h=c.clipboardData.getData("text/plain")),g?g.inline(d.cell.index()).set(g.displayed()[0],h).submit():(d.cell.data(h),a.draw(!1))}))},_columns:function(){var a=
this.s.dt,b=a.columns(this.c.columns).indexes(),d=[];a.columns(":visible").every(function(a){-1!==b.indexOf(a)&&d.push(a)});return d},_editor:function(a,b,d){if(this.s.lastFocus&&!(b&&"draw"===b.type)){var c=this,f=this.s.dt,i=this.c.editor,g=this.s.lastFocus.cell,h=this.s.namespace+"e"+p++;if(!e("div.DTE",g.node()).length&&!(null!==a&&(0<=a&&9>=a||11===a||12===a||14<=a&&31>=a||112<=a&&123>=a||127<=a&&159>=a))){b&&(b.stopPropagation(),13===a&&b.preventDefault());var j=function(){i.one("open"+h,function(){i.off("cancelOpen"+
h);d||e("div.DTE_Field_InputControl input, div.DTE_Field_InputControl textarea").select();f.keys.enable(d?"tab-only":"navigation-only");f.on("key-blur.editor",function(a,b,c){i.displayed()&&c.node()===g.node()&&i.submit()});d&&e(f.table().container()).addClass("dtk-focus-alt");i.on("preSubmitCancelled"+h,function(){setTimeout(function(){c._focus(g,null,false)},50)});i.on("submitUnsuccessful"+h,function(){c._focus(g,null,false)});i.one("close"+h,function(){f.keys.enable(true);f.off("key-blur.editor");
i.off(h);e(f.table().container()).removeClass("dtk-focus-alt");if(c.s.returnSubmit){c.s.returnSubmit=false;c._emitEvent("key-return-submit",[f,g])}})}).one("cancelOpen"+h,function(){i.off(h)}).inline(g.index())};13===a?(d=!0,e(k).one("keyup",function(){j()})):j()}}},_emitEvent:function(a,b){this.s.dt.iterator("table",function(d){e(d.nTable).triggerHandler(a,b)})},_focus:function(a,b,d,c){var f=this,i=this.s.dt,g=i.page.info(),h=this.s.lastFocus;c||(c=null);if(this.s.enable){if("number"!==typeof a){if(!a.any())return;
var l=a.index(),b=l.column,a=i.rows({filter:"applied",order:"applied"}).indexes().indexOf(l.row);if(0>a)return;g.serverSide&&(a+=g.start)}if(-1!==g.length&&(a<g.start||a>=g.start+g.length))this.s.focusDraw=!0,this.s.waitingForDraw=!0,i.one("draw",function(){f.s.focusDraw=!1;f.s.waitingForDraw=!1;f._focus(a,b,n,c)}).page(Math.floor(a/g.length)).draw(!1);else if(-1!==e.inArray(b,this._columns())){g.serverSide&&(a-=g.start);g=i.cells(null,b,{search:"applied",order:"applied"}).flatten();g=i.cell(g[a]);
if(h){if(h.node===g.node()){this._emitEvent("key-refocus",[this.s.dt,g,c||null]);return}this._blur()}this._removeOtherFocus();h=e(g.node());h.addClass(this.c.className);this._updateFixedColumns(b);if(d===n||!0===d)this._scroll(e(j),e(k.body),h,"offset"),d=i.table().body().parentNode,d!==i.table().header().parentNode&&(d=e(d.parentNode),this._scroll(d,d,h,"position"));this.s.lastFocus={cell:g,node:g.node(),relative:{row:i.rows({page:"current"}).indexes().indexOf(g.index().row),column:g.index().column}};
this._emitEvent("key-focus",[this.s.dt,g,c||null]);i.state.save()}}},_key:function(a){if(this.s.waitingForDraw)a.preventDefault();else{var b=this.s.enable;this.s.returnSubmit=("navigation-only"===b||"tab-only"===b)&&13===a.keyCode?!0:!1;var d=!0===b||"navigation-only"===b;if(b&&(!(0===a.keyCode||a.ctrlKey||a.metaKey||a.altKey)||a.ctrlKey&&a.altKey)){var c=this.s.lastFocus;if(c)if(this.s.dt.cell(c.node).any()){var c=this.s.dt,f=this.s.dt.settings()[0].oScroll.sY?!0:!1;if(!(this.c.keys&&-1===e.inArray(a.keyCode,
this.c.keys)))switch(a.keyCode){case 9:this._shift(a,a.shiftKey?"left":"right",!0);break;case 27:this.s.blurable&&!0===b&&this._blur();break;case 33:case 34:d&&!f&&(a.preventDefault(),c.page(33===a.keyCode?"previous":"next").draw(!1));break;case 35:case 36:d&&(a.preventDefault(),b=c.cells({page:"current"}).indexes(),d=this._columns(),this._focus(c.cell(b[35===a.keyCode?b.length-1:d[0]]),null,!0,a));break;case 37:d&&this._shift(a,"left");break;case 38:d&&this._shift(a,"up");break;case 39:d&&this._shift(a,
"right");break;case 40:d&&this._shift(a,"down");break;case 113:if(this.c.editor){this._editor(null,a,!0);break}default:!0===b&&this._emitEvent("key",[c,a.keyCode,this.s.lastFocus.cell,a])}}else this.s.lastFocus=null}}},_removeOtherFocus:function(){var a=this.s.dt.table().node();e.fn.dataTable.tables({api:!0}).iterator("table",function(){this.table().node()!==a&&this.cell.blur()})},_scroll:function(a,b,d,c){var f=d[c](),e=d.outerHeight(),g=d.outerWidth(),h=b.scrollTop(),j=b.scrollLeft(),k=a.height(),
a=a.width();"position"===c&&(f.top+=parseInt(d.closest("table").css("top"),10));f.top<h&&b.scrollTop(f.top);f.left<j&&b.scrollLeft(f.left);f.top+e>h+k&&e<k&&b.scrollTop(f.top+e-k);f.left+g>j+a&&g<a&&b.scrollLeft(f.left+g-a)},_shift:function(a,b,d){var c=this.s.dt,f=c.page.info(),i=f.recordsDisplay,g=this._columns(),h=this.s.lastFocus;if(h){var j=h.cell;j&&((h=c.rows({filter:"applied",order:"applied"}).indexes().indexOf(j.index().row),f.serverSide&&(h+=f.start),c=c.columns(g).indexes().indexOf(j.index().column),
f=h,h=g[c],"right"===b?c>=g.length-1?(f++,h=g[0]):h=g[c+1]:"left"===b?0===c?(f--,h=g[g.length-1]):h=g[c-1]:"up"===b?f--:"down"===b&&f++,0<=f&&f<i&&-1!==e.inArray(h,g))?(a&&a.preventDefault(),this._focus(f,h,!0,a)):!d||!this.c.blurable?a&&a.preventDefault():this._blur())}},_tabInput:function(){var a=this,b=this.s.dt,d=null!==this.c.tabIndex?this.c.tabIndex:b.settings()[0].iTabIndex;-1!=d&&(this.s.tabInput||(d=e('<div><input type="text" tabindex="'+d+'"/></div>').css({position:"absolute",height:1,width:0,
overflow:"hidden"}),d.children().on("focus",function(c){var d=b.cell(":eq(0)",a._columns(),{page:"current"});d.any()&&a._focus(d,null,!0,c)}),this.s.tabInput=d),(d=this.s.dt.cell(":eq(0)","0:visible",{page:"current",order:"current"}).node())&&e(d).prepend(this.s.tabInput))},_updateFixedColumns:function(a){var b=this.s.dt,d=b.settings()[0];if(d._oFixedColumns){var c=d.aoColumns.length-d._oFixedColumns.s.iRightColumns;(a<d._oFixedColumns.s.iLeftColumns||a>=c)&&b.fixedColumns().update()}}});m.defaults=
{blurable:!0,className:"focus",clipboard:!0,clipboardOrthogonal:"display",columns:"",editor:null,editOnFocus:!1,focus:null,keys:null,tabIndex:null};m.version="2.6.1";e.fn.dataTable.KeyTable=m;e.fn.DataTable.KeyTable=m;l.Api.register("cell.blur()",function(){return this.iterator("table",function(a){a.keytable&&a.keytable.blur()})});l.Api.register("cell().focus()",function(){return this.iterator("cell",function(a,b,d){a.keytable&&a.keytable.focus(b,d)})});l.Api.register("keys.disable()",function(){return this.iterator("table",
function(a){a.keytable&&a.keytable.enable(!1)})});l.Api.register("keys.enable()",function(a){return this.iterator("table",function(b){b.keytable&&b.keytable.enable(a===n?!0:a)})});l.Api.register("keys.enabled()",function(){var a=this.context;return a.length?a[0].keytable?a[0].keytable.enabled():!1:!1});l.Api.register("keys.move()",function(a){return this.iterator("table",function(b){b.keytable&&b.keytable._shift(null,a,!1)})});l.ext.selector.cell.push(function(a,b,d){var b=b.focused,a=a.keytable,
c=[];if(!a||b===n)return d;for(var f=0,e=d.length;f<e;f++)(!0===b&&a.focused(d[f])||!1===b&&!a.focused(d[f]))&&c.push(d[f]);return c});e(k).on("preInit.dt.dtk",function(a,b){if("dt"===a.namespace){var d=b.oInit.keys,c=l.defaults.keys;if(d||c)c=e.extend({},c,d),!1!==d&&new m(b,c)}});return m});

View file

@ -1,5 +1,5 @@
/*
* @sweetalert2/themes v4.0.2
* @sweetalert2/themes v4.0.3
* Released under the MIT License.
*/
@ -529,7 +529,7 @@
width: 5em;
height: 5em;
margin: 1.25em auto 1.875em;
border: .25em solid transparent;
border: 0.25em solid transparent;
border-radius: 50%;
font-family: inherit;
line-height: 5em;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -594,6 +594,7 @@
margin: 1.25em auto 1.875em;
border: 0.25em solid transparent;
border-radius: 50%;
border-color: #000;
font-family: inherit;
line-height: 5em;
cursor: default;
@ -614,7 +615,6 @@
.swal2-icon.swal2-error .swal2-x-mark {
position: relative;
flex-grow: 1;
zoom: 1;
}
.swal2-icon.swal2-error [class^=swal2-x-mark-line] {
display: block;
@ -667,7 +667,6 @@
.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left] {
top: -0.4375em;
left: -2.0635em;
zoom: 1;
transform: rotate(-45deg);
transform-origin: 3.75em 3.75em;
border-radius: 7.5em 0 0 7.5em;
@ -675,7 +674,6 @@
.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right] {
top: -0.6875em;
left: 1.875em;
zoom: 1;
transform: rotate(-45deg);
transform-origin: 0 3.75em;
border-radius: 0 7.5em 7.5em 0;
@ -688,7 +686,6 @@
box-sizing: content-box;
width: 100%;
height: 100%;
zoom: 1;
border: 0.25em solid rgba(165, 220, 134, 0.3);
border-radius: 50%;
}
@ -699,7 +696,6 @@
left: 1.625em;
width: 0.4375em;
height: 5.625em;
zoom: 1;
transform: rotate(-45deg);
}
.swal2-icon.swal2-success [class^=swal2-success-line] {
@ -707,7 +703,6 @@
position: absolute;
z-index: 2;
height: 0.3125em;
zoom: 1;
border-radius: 0.125em;
background-color: #a5dc86;
}

View file

@ -1,5 +1,5 @@
/*!
* sweetalert2 v10.14.1
* sweetalert2 v10.15.5
* Released under the MIT License.
*/
(function (global, factory) {
@ -357,15 +357,8 @@
var getPopup = function getPopup() {
return elementByClass(swalClasses.popup);
};
var getIcons = function getIcons() {
var popup = getPopup();
return toArray(popup.querySelectorAll(".".concat(swalClasses.icon)));
};
var getIcon = function getIcon() {
var visibleIcon = getIcons().filter(function (icon) {
return icon.style.display !== 'none';
});
return visibleIcon.length ? visibleIcon[0] : null;
return elementByClass(swalClasses.icon);
};
var getTitle = function getTitle() {
return elementByClass(swalClasses.title);
@ -649,7 +642,7 @@
return typeof window === 'undefined' || typeof document === 'undefined';
};
var sweetHTML = "\n <div aria-labelledby=\"".concat(swalClasses.title, "\" aria-describedby=\"").concat(swalClasses.content, "\" class=\"").concat(swalClasses.popup, "\" tabindex=\"-1\">\n <div class=\"").concat(swalClasses.header, "\">\n <ul class=\"").concat(swalClasses['progress-steps'], "\"></ul>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.error, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.question, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.warning, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.info, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.success, "\"></div>\n <img class=\"").concat(swalClasses.image, "\" />\n <h2 class=\"").concat(swalClasses.title, "\" id=\"").concat(swalClasses.title, "\"></h2>\n <button type=\"button\" class=\"").concat(swalClasses.close, "\"></button>\n </div>\n <div class=\"").concat(swalClasses.content, "\">\n <div id=\"").concat(swalClasses.content, "\" class=\"").concat(swalClasses['html-container'], "\"></div>\n <input class=\"").concat(swalClasses.input, "\" />\n <input type=\"file\" class=\"").concat(swalClasses.file, "\" />\n <div class=\"").concat(swalClasses.range, "\">\n <input type=\"range\" />\n <output></output>\n </div>\n <select class=\"").concat(swalClasses.select, "\"></select>\n <div class=\"").concat(swalClasses.radio, "\"></div>\n <label for=\"").concat(swalClasses.checkbox, "\" class=\"").concat(swalClasses.checkbox, "\">\n <input type=\"checkbox\" />\n <span class=\"").concat(swalClasses.label, "\"></span>\n </label>\n <textarea class=\"").concat(swalClasses.textarea, "\"></textarea>\n <div class=\"").concat(swalClasses['validation-message'], "\" id=\"").concat(swalClasses['validation-message'], "\"></div>\n </div>\n <div class=\"").concat(swalClasses.actions, "\">\n <div class=\"").concat(swalClasses.loader, "\"></div>\n <button type=\"button\" class=\"").concat(swalClasses.confirm, "\"></button>\n <button type=\"button\" class=\"").concat(swalClasses.deny, "\"></button>\n <button type=\"button\" class=\"").concat(swalClasses.cancel, "\"></button>\n </div>\n <div class=\"").concat(swalClasses.footer, "\"></div>\n <div class=\"").concat(swalClasses['timer-progress-bar-container'], "\">\n <div class=\"").concat(swalClasses['timer-progress-bar'], "\"></div>\n </div>\n </div>\n").replace(/(^|\n)\s*/g, '');
var sweetHTML = "\n <div aria-labelledby=\"".concat(swalClasses.title, "\" aria-describedby=\"").concat(swalClasses.content, "\" class=\"").concat(swalClasses.popup, "\" tabindex=\"-1\">\n <div class=\"").concat(swalClasses.header, "\">\n <ul class=\"").concat(swalClasses['progress-steps'], "\"></ul>\n <div class=\"").concat(swalClasses.icon, "\"></div>\n <img class=\"").concat(swalClasses.image, "\" />\n <h2 class=\"").concat(swalClasses.title, "\" id=\"").concat(swalClasses.title, "\"></h2>\n <button type=\"button\" class=\"").concat(swalClasses.close, "\"></button>\n </div>\n <div class=\"").concat(swalClasses.content, "\">\n <div id=\"").concat(swalClasses.content, "\" class=\"").concat(swalClasses['html-container'], "\"></div>\n <input class=\"").concat(swalClasses.input, "\" />\n <input type=\"file\" class=\"").concat(swalClasses.file, "\" />\n <div class=\"").concat(swalClasses.range, "\">\n <input type=\"range\" />\n <output></output>\n </div>\n <select class=\"").concat(swalClasses.select, "\"></select>\n <div class=\"").concat(swalClasses.radio, "\"></div>\n <label for=\"").concat(swalClasses.checkbox, "\" class=\"").concat(swalClasses.checkbox, "\">\n <input type=\"checkbox\" />\n <span class=\"").concat(swalClasses.label, "\"></span>\n </label>\n <textarea class=\"").concat(swalClasses.textarea, "\"></textarea>\n <div class=\"").concat(swalClasses['validation-message'], "\" id=\"").concat(swalClasses['validation-message'], "\"></div>\n </div>\n <div class=\"").concat(swalClasses.actions, "\">\n <div class=\"").concat(swalClasses.loader, "\"></div>\n <button type=\"button\" class=\"").concat(swalClasses.confirm, "\"></button>\n <button type=\"button\" class=\"").concat(swalClasses.deny, "\"></button>\n <button type=\"button\" class=\"").concat(swalClasses.cancel, "\"></button>\n </div>\n <div class=\"").concat(swalClasses.footer, "\"></div>\n <div class=\"").concat(swalClasses['timer-progress-bar-container'], "\">\n <div class=\"").concat(swalClasses['timer-progress-bar'], "\"></div>\n </div>\n </div>\n").replace(/(^|\n)\s*/g, '');
var resetOldContainer = function resetOldContainer() {
var oldContainer = getContainer();
@ -1144,16 +1137,17 @@
};
var renderContent = function renderContent(instance, params) {
var content = getContent().querySelector("#".concat(swalClasses.content)); // Content as HTML
var htmlContainer = getHtmlContainer();
applyCustomClass(htmlContainer, params, 'htmlContainer'); // Content as HTML
if (params.html) {
parseHtmlToContainer(params.html, content);
show(content, 'block'); // Content as plain text
parseHtmlToContainer(params.html, htmlContainer);
show(htmlContainer, 'block'); // Content as plain text
} else if (params.text) {
content.textContent = params.text;
show(content, 'block'); // No content
htmlContainer.textContent = params.text;
show(htmlContainer, 'block'); // No content
} else {
hide(content);
hide(htmlContainer);
}
renderInput(instance, params); // Custom class
@ -1183,42 +1177,42 @@
};
var renderIcon = function renderIcon(instance, params) {
var innerParams = privateProps.innerParams.get(instance); // if the given icon already rendered, apply the styling without re-rendering the icon
if (innerParams && params.icon === innerParams.icon && getIcon()) {
applyStyles(getIcon(), params);
return;
}
hideAllIcons();
if (!params.icon) {
return;
}
if (Object.keys(iconTypes).indexOf(params.icon) !== -1) {
var icon = elementBySelector(".".concat(swalClasses.icon, ".").concat(iconTypes[params.icon]));
show(icon); // Custom or default content
var innerParams = privateProps.innerParams.get(instance);
var icon = getIcon(); // if the given icon already rendered, apply the styling without re-rendering the icon
if (innerParams && params.icon === innerParams.icon) {
// Custom or default content
setContent(icon, params);
applyStyles(icon, params); // Animate icon
applyStyles(icon, params);
return;
}
addClass(icon, params.showClass.icon);
} else {
if (!params.icon && !params.iconHtml) {
return hide(icon);
}
if (params.icon && Object.keys(iconTypes).indexOf(params.icon) === -1) {
error("Unknown icon! Expected \"success\", \"error\", \"warning\", \"info\" or \"question\", got \"".concat(params.icon, "\""));
return hide(icon);
}
};
var hideAllIcons = function hideAllIcons() {
var icons = getIcons();
show(icon); // Custom or default content
for (var i = 0; i < icons.length; i++) {
hide(icons[i]);
}
setContent(icon, params);
applyStyles(icon, params); // Animate icon
addClass(icon, params.showClass.icon);
};
var applyStyles = function applyStyles(icon, params) {
// Icon color
for (var iconType in iconTypes) {
if (params.icon !== iconType) {
removeClass(icon, iconTypes[iconType]);
}
}
addClass(icon, iconTypes[params.icon]); // Icon color
setColor(icon, params); // Success icon background color
adjustSuccessIconBackgoundColor(); // Custom class
@ -1441,9 +1435,17 @@
};
var renderPopup = function renderPopup(instance, params) {
var container = getContainer();
var popup = getPopup(); // Width
applyNumericalStyle(popup, 'width', params.width); // Padding
if (params.toast) {
// #2170
applyNumericalStyle(container, 'width', params.width);
popup.style.width = '100%';
} else {
applyNumericalStyle(popup, 'width', params.width);
} // Padding
applyNumericalStyle(popup, 'padding', params.padding); // Background
@ -1565,8 +1567,8 @@
_createClass(MixinSwal, [{
key: "_main",
value: function _main(params, prevMixinParams) {
return _get(_getPrototypeOf(MixinSwal.prototype), "_main", this).call(this, params, _extends({}, prevMixinParams, mixinParams));
value: function _main(params, priorityMixinParams) {
return _get(_getPrototypeOf(MixinSwal.prototype), "_main", this).call(this, params, _extends({}, mixinParams, priorityMixinParams));
}
}]);
@ -1828,7 +1830,7 @@
didDestroy: undefined,
scrollbarPadding: true
};
var updatableParams = ['allowEscapeKey', 'allowOutsideClick', 'background', 'buttonsStyling', 'cancelButtonAriaLabel', 'cancelButtonColor', 'cancelButtonText', 'closeButtonAriaLabel', 'closeButtonHtml', 'confirmButtonAriaLabel', 'confirmButtonColor', 'confirmButtonText', 'currentProgressStep', 'customClass', 'denyButtonAriaLabel', 'denyButtonColor', 'denyButtonText', 'didClose', 'didDestroy', 'footer', 'hideClass', 'html', 'icon', 'iconColor', 'imageAlt', 'imageHeight', 'imageUrl', 'imageWidth', 'onAfterClose', 'onClose', 'onDestroy', 'progressSteps', 'reverseButtons', 'showCancelButton', 'showCloseButton', 'showConfirmButton', 'showDenyButton', 'text', 'title', 'titleText', 'willClose'];
var updatableParams = ['allowEscapeKey', 'allowOutsideClick', 'background', 'buttonsStyling', 'cancelButtonAriaLabel', 'cancelButtonColor', 'cancelButtonText', 'closeButtonAriaLabel', 'closeButtonHtml', 'confirmButtonAriaLabel', 'confirmButtonColor', 'confirmButtonText', 'currentProgressStep', 'customClass', 'denyButtonAriaLabel', 'denyButtonColor', 'denyButtonText', 'didClose', 'didDestroy', 'footer', 'hideClass', 'html', 'icon', 'iconColor', 'iconHtml', 'imageAlt', 'imageHeight', 'imageUrl', 'imageWidth', 'onAfterClose', 'onClose', 'onDestroy', 'progressSteps', 'reverseButtons', 'showCancelButton', 'showCloseButton', 'showConfirmButton', 'showDenyButton', 'text', 'title', 'titleText', 'willClose'];
var deprecatedParams = {
animation: 'showClass" and "hideClass',
onBeforeOpen: 'willOpen',
@ -1918,7 +1920,6 @@
getHtmlContainer: getHtmlContainer,
getImage: getImage,
getIcon: getIcon,
getIcons: getIcons,
getInputLabel: getInputLabel,
getCloseButton: getCloseButton,
getActions: getActions,
@ -2826,7 +2827,7 @@
};
if (hasToPromiseFn(params.inputOptions) || isPromise(params.inputOptions)) {
showLoading();
showLoading(getConfirmButton());
asPromise(params.inputOptions).then(function (inputOptions) {
instance.hideLoading();
processInputOptions(inputOptions);
@ -3627,7 +3628,7 @@
};
});
SweetAlert.DismissReason = DismissReason;
SweetAlert.version = '10.14.1';
SweetAlert.version = '10.15.5';
var Swal = SweetAlert;
Swal["default"] = Swal;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long