mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Update AdminLTE
- from 2.4.5 to 2.4.18 (cannot detect any issues) - set default scancycle for Apple Devices to 1
This commit is contained in:
@@ -3,6 +3,16 @@ module('Data adapters - Array');
|
||||
var ArrayData = require('select2/data/array');
|
||||
var $ = require('jquery');
|
||||
var Options = require('select2/options');
|
||||
var Utils = require('select2/utils');
|
||||
|
||||
var UserDefinedType = function (id, text) {
|
||||
var self = this;
|
||||
|
||||
self.id = id;
|
||||
self.text = text;
|
||||
|
||||
return self;
|
||||
};
|
||||
|
||||
var arrayOptions = new Options({
|
||||
data: [
|
||||
@@ -17,7 +27,8 @@ var arrayOptions = new Options({
|
||||
{
|
||||
id: '2',
|
||||
text: '2'
|
||||
}
|
||||
},
|
||||
new UserDefinedType(1, 'aaaaaa')
|
||||
]
|
||||
});
|
||||
|
||||
@@ -182,7 +193,10 @@ test('multiple sets the value', function (assert) {
|
||||
|
||||
var data = new ArrayData($select, arrayOptions);
|
||||
|
||||
assert.equal($select.val(), null);
|
||||
assert.ok(
|
||||
$select.val() == null || $select.val().length == 0,
|
||||
'nothing should be selected'
|
||||
);
|
||||
|
||||
data.select({
|
||||
id: 'default',
|
||||
@@ -216,7 +230,7 @@ test('option tags are automatically generated', function (assert) {
|
||||
|
||||
assert.equal(
|
||||
$select.find('option').length,
|
||||
3,
|
||||
4,
|
||||
'An <option> element should be created for each object'
|
||||
);
|
||||
});
|
||||
@@ -237,7 +251,7 @@ test('option tags can receive new data', function(assert) {
|
||||
});
|
||||
|
||||
assert.ok(
|
||||
$select.find(':selected').data('data').extra,
|
||||
Utils.GetData($select.find(':selected')[0], 'data').extra,
|
||||
'<option> default should have new data'
|
||||
);
|
||||
|
||||
@@ -246,7 +260,7 @@ test('option tags can receive new data', function(assert) {
|
||||
});
|
||||
|
||||
assert.ok(
|
||||
$select.find(':selected').data('data').extra,
|
||||
Utils.GetData($select.find(':selected')[0], 'data').extra,
|
||||
'<option> One should have new data'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -130,7 +130,10 @@ test('multiple sets the value', function (assert) {
|
||||
|
||||
var data = new SelectData($select, selectOptions);
|
||||
|
||||
assert.equal($select.val(), null);
|
||||
assert.ok(
|
||||
$select.val() == null || $select.val().length == 0,
|
||||
'nothing should be selected'
|
||||
);
|
||||
|
||||
data.select({
|
||||
id: 'Two',
|
||||
@@ -487,3 +490,68 @@ test('select option construction accepts id="" (empty string) value',
|
||||
'Built option value should be an empty string.'
|
||||
);
|
||||
});
|
||||
|
||||
test('user-defined types are normalized properly', function (assert) {
|
||||
var $select = $('#qunit-fixture .user-defined'),
|
||||
|
||||
UserDefinedType = function (id, text) {
|
||||
var self = this;
|
||||
|
||||
self.id = id;
|
||||
self.text = text;
|
||||
|
||||
return self;
|
||||
};
|
||||
|
||||
var testData = [
|
||||
'Test',
|
||||
{
|
||||
id: 4,
|
||||
text: 'item'
|
||||
},
|
||||
new UserDefinedType(1, 'aaaaaa')
|
||||
];
|
||||
|
||||
var data = new SelectData($select, selectOptions);
|
||||
|
||||
var normalizedItem = data._normalizeItem(testData[0]);
|
||||
var normalizedItem2 = data._normalizeItem(testData[1]);
|
||||
var normalizedItem3 = data._normalizeItem(testData[2]);
|
||||
|
||||
assert.equal(
|
||||
testData[0],
|
||||
normalizedItem.id,
|
||||
'id property should be equal to text after normalize'
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
testData[0],
|
||||
normalizedItem.text,
|
||||
'text property should be equal after normalize'
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
testData[1].id,
|
||||
normalizedItem2.id,
|
||||
'id property should be equal after normalize'
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
testData[1].text,
|
||||
normalizedItem2.text,
|
||||
'text property should be equal after normalize'
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
testData[2].id,
|
||||
normalizedItem3.id,
|
||||
'id property should be equal after normalize'
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
testData[2].text,
|
||||
normalizedItem3.text,
|
||||
'text property should be equal after normalize'
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
@@ -106,7 +106,7 @@ test('dropdown is positioned down with static margins', function (assert) {
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
$dropdown.css('top').substring(0, 2),
|
||||
$dropdown.css('top').replace(/\D+/, ''),
|
||||
$container.outerHeight() + 5,
|
||||
'The offset should be 5px at the top'
|
||||
);
|
||||
@@ -164,7 +164,7 @@ test('dropdown is positioned down with absolute offsets', function (assert) {
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
$dropdown.css('top').substring(0, 2),
|
||||
$dropdown.css('top').replace(/\D+/, ''),
|
||||
$container.outerHeight(),
|
||||
'There should not be an extra top offset'
|
||||
);
|
||||
|
||||
@@ -44,3 +44,7 @@ QUnit.testStart(function(testDetails){
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
define('qunit', function () {
|
||||
return QUnit;
|
||||
})
|
||||
21
front/lib/AdminLTE/bower_components/select2/tests/integration-jq2.html
vendored
Normal file
21
front/lib/AdminLTE/bower_components/select2/tests/integration-jq2.html
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="vendor/qunit-1.23.1.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../dist/css/select2.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture"></div>
|
||||
|
||||
<script src="vendor/qunit-1.23.1.js" type="text/javascript"></script>
|
||||
<script src="vendor/jquery-2.2.4.js" type="text/javascript"></script>
|
||||
<script src="../dist/js/select2.full.js" type="text/javascript"></script>
|
||||
|
||||
<script src="helpers.js" type="text/javascript"></script>
|
||||
|
||||
<script src="integration/dom-changes.js" type="text/javascript"></script>
|
||||
<script src="integration/jquery-calls.js" type="text/javascript"></script>
|
||||
<script src="integration/select2-methods.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
21
front/lib/AdminLTE/bower_components/select2/tests/integration-jq3.html
vendored
Normal file
21
front/lib/AdminLTE/bower_components/select2/tests/integration-jq3.html
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="vendor/qunit-1.23.1.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../dist/css/select2.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture"></div>
|
||||
|
||||
<script src="vendor/qunit-1.23.1.js" type="text/javascript"></script>
|
||||
<script src="vendor/jquery-3.4.1.js" type="text/javascript"></script>
|
||||
<script src="../dist/js/select2.full.js" type="text/javascript"></script>
|
||||
|
||||
<script src="helpers.js" type="text/javascript"></script>
|
||||
|
||||
<script src="integration/dom-changes.js" type="text/javascript"></script>
|
||||
<script src="integration/jquery-calls.js" type="text/javascript"></script>
|
||||
<script src="integration/select2-methods.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -254,4 +254,35 @@ test('removing a selected option changes the value', function (assert) {
|
||||
);
|
||||
|
||||
syncDone();
|
||||
});
|
||||
});
|
||||
|
||||
test('searching tags does not loose focus', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var asyncDone = assert.async();
|
||||
var $ = require('jquery');
|
||||
var Options = require('select2/options');
|
||||
var Select2 = require('select2/core');
|
||||
|
||||
var $select = $(
|
||||
'<select multiple="multiple">' +
|
||||
' <option value="1">Text1</option>' +
|
||||
' <option value="2">Text2</option>' +
|
||||
'</select>'
|
||||
);
|
||||
|
||||
$('#qunit-fixture').append($select);
|
||||
|
||||
var select = new Select2($select, {tags: true});
|
||||
|
||||
var inputEl = select.selection.$search[0];
|
||||
inputEl.focus();
|
||||
|
||||
select.on('selection:update', function() {
|
||||
assert.equal(document.activeElement, inputEl);
|
||||
asyncDone();
|
||||
});
|
||||
|
||||
select.selection.trigger('query', {term: 'f'});
|
||||
select.selection.trigger('query', {term: 'ff'});
|
||||
});
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
module('select2(val)');
|
||||
|
||||
var Utils = require('select2/utils');
|
||||
|
||||
test('multiple elements with arguments works', function (assert) {
|
||||
var $ = require('jquery');
|
||||
require('jquery.select2');
|
||||
@@ -27,4 +29,70 @@ test('multiple elements with arguments works', function (assert) {
|
||||
'2',
|
||||
'The call should also change the value on the second element'
|
||||
);
|
||||
});
|
||||
|
||||
test('initializes when jQuery $.data contains' +
|
||||
' cyclic reference', function (assert) {
|
||||
var $ = require('jquery');
|
||||
require('jquery.select2');
|
||||
|
||||
var $select = $(
|
||||
'<select>' +
|
||||
'<option>One</option>' +
|
||||
'<option>Two</option>' +
|
||||
'<option value="3" selected>Three</option>' +
|
||||
'</select>'
|
||||
);
|
||||
|
||||
// Add a circular reference object using jQuery.
|
||||
var recursiveObject = {};
|
||||
|
||||
recursiveObject.same = recursiveObject;
|
||||
|
||||
$select.data('same', recursiveObject);
|
||||
|
||||
$select.select2();
|
||||
|
||||
assert.equal(
|
||||
$select.val(),
|
||||
'3',
|
||||
'The option value should be pulled correctly'
|
||||
);
|
||||
});
|
||||
|
||||
test('$element.data returns instance and options correctly',
|
||||
function (assert) {
|
||||
var $ = require('jquery');
|
||||
require('jquery.select2');
|
||||
|
||||
var $select = $(
|
||||
'<select>' +
|
||||
'<option value="1">One</option>' +
|
||||
'<option value="2">Two</option>' +
|
||||
'<option value="3" selected>Three</option>' +
|
||||
'</select>'
|
||||
);
|
||||
|
||||
// Initialize.
|
||||
$select.select2({maximumSelectionLength: 2, multiple: true});
|
||||
|
||||
assert.equal(
|
||||
$select.val(),
|
||||
'3',
|
||||
'Only 1 option should be pulled.'
|
||||
);
|
||||
|
||||
// Try to resolve instance via .data('select2').
|
||||
var $instance = $select.data('select2');
|
||||
assert.ok($instance);
|
||||
assert.ok($instance.options);
|
||||
|
||||
// Ensure $select.data('select2') is the same instance
|
||||
// created by .select2()
|
||||
assert.equal($instance, Utils.GetData($instance.$element[0],
|
||||
'select2'));
|
||||
|
||||
// Ensure initialized property matches.
|
||||
assert.equal($instance.options.options.maximumSelectionLength,
|
||||
2);
|
||||
});
|
||||
@@ -29,4 +29,22 @@ test('options are merged recursively with default options', function (assert) {
|
||||
);
|
||||
|
||||
defaults.reset();
|
||||
});
|
||||
});
|
||||
|
||||
test('more than one default option can be changed via set()', function(assert) {
|
||||
var defaults = require('select2/defaults');
|
||||
var ajaxDelay = 123;
|
||||
var dataDataType = 'xml';
|
||||
defaults.set('ajax--delay', ajaxDelay);
|
||||
defaults.set('ajax--data-type', dataDataType);
|
||||
|
||||
assert.equal(
|
||||
defaults.defaults.ajax.delay,
|
||||
ajaxDelay,
|
||||
'Both ajax.delay and ajax.dataType present in defaults');
|
||||
assert.equal(
|
||||
defaults.defaults.ajax.dataType,
|
||||
dataDataType,
|
||||
'Both ajax.delay and ajax.dataType present in defaults');
|
||||
defaults.reset();
|
||||
});
|
||||
|
||||
@@ -64,3 +64,21 @@ test('resolve falls back to element if there is no style', function (assert) {
|
||||
|
||||
assert.equal(width, '500px');
|
||||
});
|
||||
|
||||
test('computedstyle gets the style if parent is invisible', function (assert) {
|
||||
var $style = $(
|
||||
'<style type="text/css">.css-set-width { width: 500px; }</style>'
|
||||
);
|
||||
var $test = $(
|
||||
'<div style="display:none;">' +
|
||||
'<select class="css-set-width"></select>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
$('#qunit-fixture').append($style);
|
||||
$('#qunit-fixture').append($test);
|
||||
|
||||
var width = select._resolveWidth($test.find('select'), 'computedstyle');
|
||||
|
||||
assert.equal(width, '500px');
|
||||
});
|
||||
|
||||
@@ -135,4 +135,107 @@ test('results:append does not trigger results:focus', function (assert) {
|
||||
]
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('scrollAfterSelect triggers results:focus', function (assert) {
|
||||
assert.expect(3);
|
||||
|
||||
var $ = require('jquery');
|
||||
|
||||
var $select = $('<select></select>');
|
||||
var $parent = $('<div></div>');
|
||||
|
||||
var $container = $('<span></span>');
|
||||
var container = new MockContainer();
|
||||
|
||||
$parent.appendTo($('#qunit-fixture'));
|
||||
$select.appendTo($parent);
|
||||
|
||||
var Utils = require('select2/utils');
|
||||
var Options = require('select2/options');
|
||||
|
||||
var Results = require('select2/results');
|
||||
|
||||
var options = new Options({ scrollAfterSelect: true });
|
||||
var results = new Results($select, options);
|
||||
|
||||
// Fake the data adapter for the `setClasses` method
|
||||
results.data = {};
|
||||
results.data.current = function (callback) {
|
||||
callback([{ id: 'test' }]);
|
||||
};
|
||||
|
||||
results.render();
|
||||
|
||||
results.bind(container, $container);
|
||||
|
||||
// check that default for scrollAfterSelect is true
|
||||
assert.equal(options.get('scrollAfterSelect'), true);
|
||||
|
||||
results.append({
|
||||
results: [
|
||||
{
|
||||
id: 'test',
|
||||
text: 'Test'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
results.on('results:focus', function (params) {
|
||||
assert.equal(params.data.id, 'test');
|
||||
assert.equal(params.data.text, 'Test');
|
||||
});
|
||||
|
||||
container.trigger('select', {});
|
||||
});
|
||||
|
||||
test('!scrollAfterSelect does not trigger results:focus', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var $ = require('jquery');
|
||||
|
||||
var $select = $('<select></select>');
|
||||
var $parent = $('<div></div>');
|
||||
|
||||
var $container = $('<span></span>');
|
||||
var container = new MockContainer();
|
||||
|
||||
$parent.appendTo($('#qunit-fixture'));
|
||||
$select.appendTo($parent);
|
||||
|
||||
var Utils = require('select2/utils');
|
||||
var Options = require('select2/options');
|
||||
|
||||
var Results = require('select2/results');
|
||||
|
||||
var options = new Options({ scrollAfterSelect: false });
|
||||
var results = new Results($select, options);
|
||||
|
||||
// Fake the data adapter for the `setClasses` method
|
||||
results.data = {};
|
||||
results.data.current = function (callback) {
|
||||
callback([{ id: 'test' }]);
|
||||
};
|
||||
|
||||
results.render();
|
||||
|
||||
results.bind(container, $container);
|
||||
|
||||
// check that default for scrollAfterSelect is false
|
||||
assert.equal(options.get('scrollAfterSelect'), false);
|
||||
|
||||
results.append({
|
||||
results: [
|
||||
{
|
||||
id: 'test',
|
||||
text: 'Test'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
results.on('results:focus', function () {
|
||||
assert.ok(false, 'The results:focus event was triggered');
|
||||
});
|
||||
|
||||
container.trigger('select', {});
|
||||
});
|
||||
|
||||
126
front/lib/AdminLTE/bower_components/select2/tests/results/infiniteScroll-tests.js
vendored
Normal file
126
front/lib/AdminLTE/bower_components/select2/tests/results/infiniteScroll-tests.js
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
module('Results - Infinite scrolling');
|
||||
|
||||
test('loadingMore is triggered even without a scrollbar', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var $ = require('jquery');
|
||||
|
||||
var $select = $('<select></select>');
|
||||
|
||||
var $container = $('<span></span>');
|
||||
var container = new MockContainer();
|
||||
|
||||
var Utils = require('select2/utils');
|
||||
var Options = require('select2/options');
|
||||
|
||||
var Results = require('select2/results');
|
||||
var InfiniteScroll = require('select2/dropdown/infiniteScroll');
|
||||
|
||||
var InfiniteScrollResults = Utils.Decorate(Results, InfiniteScroll);
|
||||
|
||||
var results = new InfiniteScrollResults($select, new Options({}));
|
||||
|
||||
// Fake the data adapter for the `setClasses` method
|
||||
results.data = {};
|
||||
results.data.current = function (callback) {
|
||||
callback([{ id: 'test' }]);
|
||||
};
|
||||
|
||||
$('#qunit-fixture').append(results.render());
|
||||
|
||||
results.bind(container, $container);
|
||||
|
||||
results.on('query:append', function () {
|
||||
assert.ok(true, 'It tried to load more immediately');
|
||||
});
|
||||
|
||||
container.trigger('results:all', {
|
||||
data: {
|
||||
results: [
|
||||
{
|
||||
id: 'test',
|
||||
text: 'Test'
|
||||
}
|
||||
],
|
||||
pagination: {
|
||||
more: true
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('loadingMore is not triggered without scrolling', function (assert) {
|
||||
assert.expect(0);
|
||||
|
||||
var $ = require('jquery');
|
||||
|
||||
var $select = $('<select></select>');
|
||||
|
||||
var $container = $('<span></span>');
|
||||
var container = new MockContainer();
|
||||
|
||||
var Utils = require('select2/utils');
|
||||
var Options = require('select2/options');
|
||||
|
||||
var Results = require('select2/results');
|
||||
var InfiniteScroll = require('select2/dropdown/infiniteScroll');
|
||||
|
||||
var InfiniteScrollResults = Utils.Decorate(Results, InfiniteScroll);
|
||||
|
||||
var results = new InfiniteScrollResults($select, new Options({}));
|
||||
|
||||
// Fake the data adapter for the `setClasses` method
|
||||
results.data = {};
|
||||
results.data.current = function (callback) {
|
||||
callback([{ id: 'test' }]);
|
||||
};
|
||||
|
||||
var $results = results.render();
|
||||
|
||||
$('#qunit-fixture').append($results);
|
||||
$results.css('max-height', '100px');
|
||||
|
||||
results.bind(container, $container);
|
||||
|
||||
results.on('query:append', function () {
|
||||
assert.ok(false, 'It tried to load more immediately');
|
||||
});
|
||||
|
||||
container.trigger('results:all', {
|
||||
data: {
|
||||
results: [
|
||||
{
|
||||
id: 'test',
|
||||
text: 'Test'
|
||||
},
|
||||
{
|
||||
id: 'test',
|
||||
text: 'Test'
|
||||
},
|
||||
{
|
||||
id: 'test',
|
||||
text: 'Test'
|
||||
},
|
||||
{
|
||||
id: 'test',
|
||||
text: 'Test'
|
||||
},
|
||||
{
|
||||
id: 'test',
|
||||
text: 'Test'
|
||||
},
|
||||
{
|
||||
id: 'test',
|
||||
text: 'Test'
|
||||
},
|
||||
{
|
||||
id: 'test',
|
||||
text: 'Test'
|
||||
}
|
||||
],
|
||||
pagination: {
|
||||
more: true
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
63
front/lib/AdminLTE/bower_components/select2/tests/results/option-tests.js
vendored
Normal file
63
front/lib/AdminLTE/bower_components/select2/tests/results/option-tests.js
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
module('Results - option');
|
||||
|
||||
var $ = require('jquery');
|
||||
|
||||
var Options = require('select2/options');
|
||||
|
||||
var Results = require('select2/results');
|
||||
|
||||
test('disabled property on option is respected - enabled', function (assert) {
|
||||
var results = new Results($('<select></select>'), new Options({}));
|
||||
|
||||
var $option = $('<option></option>');
|
||||
var option = results.option({
|
||||
element: $option[0]
|
||||
});
|
||||
|
||||
assert.notEqual(option.getAttribute('aria-disabled'), 'true');
|
||||
});
|
||||
|
||||
test('disabled property on option is respected - disabled', function (assert) {
|
||||
var results = new Results($('<select></select>'), new Options({}));
|
||||
|
||||
var $option = $('<option disabled></option>');
|
||||
var option = results.option({
|
||||
element: $option[0]
|
||||
});
|
||||
|
||||
assert.equal(option.getAttribute('aria-disabled'), 'true');
|
||||
});
|
||||
|
||||
test('disabled property on enabled optgroup is respected', function (assert) {
|
||||
var results = new Results($('<select></select>'), new Options({}));
|
||||
|
||||
var $option = $('<optgroup></optgroup>');
|
||||
var option = results.option({
|
||||
element: $option[0]
|
||||
});
|
||||
|
||||
assert.notEqual(option.getAttribute('aria-disabled'), 'true');
|
||||
});
|
||||
|
||||
test('disabled property on disabled optgroup is respected', function (assert) {
|
||||
var results = new Results($('<select></select>'), new Options({}));
|
||||
|
||||
var $option = $('<optgroup disabled></optgroup>');
|
||||
var option = results.option({
|
||||
element: $option[0]
|
||||
});
|
||||
|
||||
assert.equal(option.getAttribute('aria-disabled'), 'true');
|
||||
});
|
||||
|
||||
test('option in disabled optgroup is disabled', function (assert) {
|
||||
var results = new Results($('<select></select>'), new Options({}));
|
||||
|
||||
var $option = $('<optgroup disabled><option></option></optgroup>')
|
||||
.find('option');
|
||||
var option = results.option({
|
||||
element: $option[0]
|
||||
});
|
||||
|
||||
assert.equal(option.getAttribute('aria-disabled'), 'true');
|
||||
});
|
||||
@@ -43,7 +43,7 @@ test('clear is not displayed for single placeholder', function (assert) {
|
||||
|
||||
test('clear is not displayed for multiple placeholder', function (assert) {
|
||||
var selection = new AllowClearPlaceholder(
|
||||
$('#qunit-fixture .single-with-placeholder'),
|
||||
$('#qunit-fixture .multiple'),
|
||||
allowClearOptions
|
||||
);
|
||||
|
||||
@@ -79,6 +79,26 @@ test('clear is displayed for placeholder', function (assert) {
|
||||
);
|
||||
});
|
||||
|
||||
test('clear icon should have title displayed', function (assert) {
|
||||
var selection = new AllowClearPlaceholder(
|
||||
$('#qunit-fixture .single-with-placeholder'),
|
||||
allowClearOptions
|
||||
);
|
||||
|
||||
var $selection = selection.render();
|
||||
|
||||
selection.update([{
|
||||
id: 'one',
|
||||
test: 'one'
|
||||
}]);
|
||||
|
||||
assert.equal(
|
||||
$selection.find('.select2-selection__clear').attr('title'),
|
||||
'Remove all items',
|
||||
'The clear icon should have title displayed'
|
||||
);
|
||||
});
|
||||
|
||||
test('clicking clear will set the placeholder value', function (assert) {
|
||||
var $element = $('#qunit-fixture .single-with-placeholder');
|
||||
|
||||
@@ -90,7 +110,7 @@ test('clicking clear will set the placeholder value', function (assert) {
|
||||
|
||||
var $selection = selection.render();
|
||||
|
||||
selection.bind(container, $('<div></div'));
|
||||
selection.bind(container, $('<div></div>'));
|
||||
|
||||
$element.val('One');
|
||||
selection.update([{
|
||||
@@ -109,7 +129,7 @@ test('clicking clear will set the placeholder value', function (assert) {
|
||||
});
|
||||
|
||||
test('clicking clear will trigger the unselect event', function (assert) {
|
||||
assert.expect(3);
|
||||
assert.expect(4);
|
||||
|
||||
var $element = $('#qunit-fixture .single-with-placeholder');
|
||||
|
||||
@@ -121,7 +141,7 @@ test('clicking clear will trigger the unselect event', function (assert) {
|
||||
|
||||
var $selection = selection.render();
|
||||
|
||||
selection.bind(container, $('<div></div'));
|
||||
selection.bind(container, $('<div></div>'));
|
||||
|
||||
$element.val('One');
|
||||
selection.update([{
|
||||
@@ -143,7 +163,13 @@ test('clicking clear will trigger the unselect event', function (assert) {
|
||||
assert.equal(
|
||||
ev.data.id,
|
||||
'One',
|
||||
'The previous object should be unselected'
|
||||
'The data should be the unselected object'
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
$element.val(),
|
||||
'placeholder',
|
||||
'The previous value should be unselected'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -151,8 +177,6 @@ test('clicking clear will trigger the unselect event', function (assert) {
|
||||
$remove.trigger('mousedown');
|
||||
});
|
||||
|
||||
|
||||
|
||||
test('preventing the unselect event cancels the clearing', function (assert) {
|
||||
var $element = $('#qunit-fixture .single-with-placeholder');
|
||||
|
||||
@@ -164,7 +188,7 @@ test('preventing the unselect event cancels the clearing', function (assert) {
|
||||
|
||||
var $selection = selection.render();
|
||||
|
||||
selection.bind(container, $('<div></div'));
|
||||
selection.bind(container, $('<div></div>'));
|
||||
|
||||
$element.val('One');
|
||||
selection.update([{
|
||||
@@ -186,6 +210,94 @@ test('preventing the unselect event cancels the clearing', function (assert) {
|
||||
);
|
||||
});
|
||||
|
||||
test('clicking clear will trigger the clear event', function (assert) {
|
||||
assert.expect(5);
|
||||
|
||||
var $element = $('#qunit-fixture .single-with-placeholder');
|
||||
|
||||
var selection = new AllowClearPlaceholder(
|
||||
$element,
|
||||
allowClearOptions
|
||||
);
|
||||
var container = new MockContainer();
|
||||
|
||||
var $selection = selection.render();
|
||||
|
||||
selection.bind(container, $('<div></div>'));
|
||||
|
||||
$element.val('One');
|
||||
selection.update([{
|
||||
id: 'One',
|
||||
text: 'One'
|
||||
}]);
|
||||
|
||||
selection.on('clear', function (ev) {
|
||||
assert.ok(
|
||||
'data' in ev && ev.data,
|
||||
'The event should have been triggered with the data property'
|
||||
);
|
||||
|
||||
assert.ok(
|
||||
$.isArray(ev.data),
|
||||
'The data should be an array'
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
ev.data.length,
|
||||
1,
|
||||
'The data should contain one item for each value'
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
ev.data[0].id,
|
||||
'One',
|
||||
'The data should contain unselected objects'
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
$element.val(),
|
||||
'placeholder',
|
||||
'The previous value should be unselected'
|
||||
);
|
||||
});
|
||||
|
||||
var $remove = $selection.find('.select2-selection__clear');
|
||||
$remove.trigger('mousedown');
|
||||
});
|
||||
|
||||
test('preventing the clear event cancels the clearing', function (assert) {
|
||||
var $element = $('#qunit-fixture .single-with-placeholder');
|
||||
|
||||
var selection = new AllowClearPlaceholder(
|
||||
$element,
|
||||
allowClearOptions
|
||||
);
|
||||
var container = new MockContainer();
|
||||
|
||||
var $selection = selection.render();
|
||||
|
||||
selection.bind(container, $('<div></div>'));
|
||||
|
||||
$element.val('One');
|
||||
selection.update([{
|
||||
id: 'One',
|
||||
text: 'One'
|
||||
}]);
|
||||
|
||||
selection.on('clear', function (ev) {
|
||||
ev.prevented = true;
|
||||
});
|
||||
|
||||
var $remove = $selection.find('.select2-selection__clear');
|
||||
$remove.trigger('mousedown');
|
||||
|
||||
assert.equal(
|
||||
$element.val(),
|
||||
'One',
|
||||
'The placeholder should not have been set'
|
||||
);
|
||||
});
|
||||
|
||||
test('clear does not work when disabled', function (assert) {
|
||||
var $element = $('#qunit-fixture .single-with-placeholder');
|
||||
|
||||
@@ -197,7 +309,7 @@ test('clear does not work when disabled', function (assert) {
|
||||
|
||||
var $selection = selection.render();
|
||||
|
||||
selection.bind(container, $('<div></div'));
|
||||
selection.bind(container, $('<div></div>'));
|
||||
|
||||
selection.update([{
|
||||
id: 'One',
|
||||
|
||||
41
front/lib/AdminLTE/bower_components/select2/tests/selection/focusing-tests.js
vendored
Normal file
41
front/lib/AdminLTE/bower_components/select2/tests/selection/focusing-tests.js
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
module('Selection containers - Managing focus');
|
||||
|
||||
var SingleSelection = require('select2/selection/single');
|
||||
|
||||
var $ = require('jquery');
|
||||
var Options = require('select2/options');
|
||||
|
||||
var options = new Options({});
|
||||
|
||||
test('close sets the focus to the selection', function (assert) {
|
||||
var $container = $('#qunit-fixture .event-container');
|
||||
var container = new MockContainer();
|
||||
var selection = new SingleSelection(
|
||||
$('#qunit-fixture .single'),
|
||||
options
|
||||
);
|
||||
|
||||
var $selection = selection.render();
|
||||
selection.bind(container, $container);
|
||||
|
||||
selection.update([{
|
||||
id: 'test',
|
||||
text: 'test'
|
||||
}]);
|
||||
|
||||
$container.append($selection);
|
||||
|
||||
assert.notEqual(
|
||||
document.activeElement,
|
||||
$selection[0],
|
||||
'The selection had focus originally'
|
||||
);
|
||||
|
||||
container.trigger('close');
|
||||
|
||||
assert.equal(
|
||||
document.activeElement,
|
||||
$selection[0],
|
||||
'After close, focus must be set to selection'
|
||||
);
|
||||
});
|
||||
@@ -72,10 +72,12 @@ test('empty update clears the selection', function (assert) {
|
||||
var $rendered = $selection.find('.select2-selection__rendered');
|
||||
|
||||
$rendered.text('testing');
|
||||
$rendered.attr('title', 'testing');
|
||||
|
||||
selection.update([]);
|
||||
|
||||
assert.equal($rendered.text(), '');
|
||||
assert.equal($rendered.attr('title'), undefined);
|
||||
});
|
||||
|
||||
test('escapeMarkup is being used', function (assert) {
|
||||
|
||||
@@ -72,10 +72,12 @@ test('empty update clears the selection', function (assert) {
|
||||
var $rendered = $selection.find('.select2-selection__rendered');
|
||||
|
||||
$rendered.text('testing');
|
||||
$rendered.attr('title', 'testing');
|
||||
|
||||
selection.update([]);
|
||||
|
||||
assert.equal($rendered.text(), '');
|
||||
assert.equal($rendered.attr('title'), undefined);
|
||||
});
|
||||
|
||||
test('update renders the data text', function (assert) {
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
<option value="two">Two</option>
|
||||
<option value="one">Uno</option>
|
||||
</select>
|
||||
|
||||
<select class="user-defined"></select>
|
||||
</div>
|
||||
|
||||
<script src="vendor/qunit-1.23.1.js" type="text/javascript"></script>
|
||||
@@ -80,9 +82,12 @@
|
||||
<script src="options/width-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="results/focusing-tests.js" type="text/javascript"></script>
|
||||
<script src="results/infiniteScroll-tests.js" type="text/javascript"></script>
|
||||
<script src="results/option-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="selection/allowClear-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/containerCss-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/focusing-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/multiple-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/placeholder-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/search-tests.js" type="text/javascript"></script>
|
||||
100
front/lib/AdminLTE/bower_components/select2/tests/unit-jq2.html
vendored
Normal file
100
front/lib/AdminLTE/bower_components/select2/tests/unit-jq2.html
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="vendor/qunit-1.23.1.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../dist/css/select2.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture">
|
||||
<div class="event-container">
|
||||
<select></select>
|
||||
</div>
|
||||
|
||||
<select class="single">
|
||||
<option>One</option>
|
||||
</select>
|
||||
|
||||
<select class="single-empty"></select>
|
||||
|
||||
<select class="single-with-placeholder">
|
||||
<option>placeholder</option>
|
||||
<option>One</option>
|
||||
</select>
|
||||
|
||||
<select class="multiple" multiple="multiple">
|
||||
<option>One</option>
|
||||
<option>Two</option>
|
||||
</select>
|
||||
|
||||
<select class="groups">
|
||||
<optgroup label="Test">
|
||||
<option value="one">One</option>
|
||||
<option value="two">Two</option>
|
||||
</optgroup>
|
||||
<optgroup label="Empty"></optgroup>
|
||||
</select>
|
||||
|
||||
<select class="duplicates">
|
||||
<option value="one">One</option>
|
||||
<option value="two">Two</option>
|
||||
<option value="one">Uno</option>
|
||||
</select>
|
||||
|
||||
<select class="duplicates-multi" multiple="multiple">
|
||||
<option value="one">One</option>
|
||||
<option value="two">Two</option>
|
||||
<option value="one">Uno</option>
|
||||
</select>
|
||||
|
||||
<select class="user-defined"></select>
|
||||
</div>
|
||||
|
||||
<script src="vendor/qunit-1.23.1.js" type="text/javascript"></script>
|
||||
<script src="vendor/jquery-2.2.4.js" type="text/javascript"></script>
|
||||
<script src="../dist/js/select2.full.js" type="text/javascript"></script>
|
||||
|
||||
<script src="helpers.js" type="text/javascript"></script>
|
||||
|
||||
<script src="a11y/selection-tests.js" type="text/javascript"></script>
|
||||
<script src="a11y/search-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="data/array-tests.js" type="text/javascript"></script>
|
||||
<script src="data/base-tests.js" type="text/javascript"></script>
|
||||
<script src="data/inputData-tests.js" type="text/javascript"></script>
|
||||
<script src="data/select-tests.js" type="text/javascript"></script>
|
||||
<script src="data/tags-tests.js" type="text/javascript"></script>
|
||||
<script src="data/tokenizer-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="data/maximumInputLength-tests.js" type="text/javascript"></script>
|
||||
<script src="data/maximumSelectionLength-tests.js" type="text/javascript"></script>
|
||||
<script src="data/minimumInputLength-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="dropdown/dropdownCss-tests.js" type="text/javascript"></script>
|
||||
<script src="dropdown/positioning-tests.js" type="text/javascript"></script>
|
||||
<script src="dropdown/selectOnClose-tests.js" type="text/javascript"></script>
|
||||
<script src="dropdown/stopPropagation-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="options/ajax-tests.js" type="text/javascript"></script>
|
||||
<script src="options/data-tests.js" type="text/javascript"></script>
|
||||
<script src="options/deprecated-tests.js" type="text/javascript"></script>
|
||||
<script src="options/translation-tests.js" type="text/javascript"></script>
|
||||
<script src="options/width-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="results/focusing-tests.js" type="text/javascript"></script>
|
||||
<script src="results/infiniteScroll-tests.js" type="text/javascript"></script>
|
||||
<script src="results/option-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="selection/allowClear-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/containerCss-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/focusing-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/multiple-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/placeholder-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/search-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/single-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/stopPropagation-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="utils/decorator-tests.js" type="text/javascript"></script>
|
||||
<script src="utils/escapeMarkup-tests.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
100
front/lib/AdminLTE/bower_components/select2/tests/unit-jq3.html
vendored
Normal file
100
front/lib/AdminLTE/bower_components/select2/tests/unit-jq3.html
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="vendor/qunit-1.23.1.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../dist/css/select2.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture">
|
||||
<div class="event-container">
|
||||
<select></select>
|
||||
</div>
|
||||
|
||||
<select class="single">
|
||||
<option>One</option>
|
||||
</select>
|
||||
|
||||
<select class="single-empty"></select>
|
||||
|
||||
<select class="single-with-placeholder">
|
||||
<option>placeholder</option>
|
||||
<option>One</option>
|
||||
</select>
|
||||
|
||||
<select class="multiple" multiple="multiple">
|
||||
<option>One</option>
|
||||
<option>Two</option>
|
||||
</select>
|
||||
|
||||
<select class="groups">
|
||||
<optgroup label="Test">
|
||||
<option value="one">One</option>
|
||||
<option value="two">Two</option>
|
||||
</optgroup>
|
||||
<optgroup label="Empty"></optgroup>
|
||||
</select>
|
||||
|
||||
<select class="duplicates">
|
||||
<option value="one">One</option>
|
||||
<option value="two">Two</option>
|
||||
<option value="one">Uno</option>
|
||||
</select>
|
||||
|
||||
<select class="duplicates-multi" multiple="multiple">
|
||||
<option value="one">One</option>
|
||||
<option value="two">Two</option>
|
||||
<option value="one">Uno</option>
|
||||
</select>
|
||||
|
||||
<select class="user-defined"></select>
|
||||
</div>
|
||||
|
||||
<script src="vendor/qunit-1.23.1.js" type="text/javascript"></script>
|
||||
<script src="vendor/jquery-3.4.1.js" type="text/javascript"></script>
|
||||
<script src="../dist/js/select2.full.js" type="text/javascript"></script>
|
||||
|
||||
<script src="helpers.js" type="text/javascript"></script>
|
||||
|
||||
<script src="a11y/selection-tests.js" type="text/javascript"></script>
|
||||
<script src="a11y/search-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="data/array-tests.js" type="text/javascript"></script>
|
||||
<script src="data/base-tests.js" type="text/javascript"></script>
|
||||
<script src="data/inputData-tests.js" type="text/javascript"></script>
|
||||
<script src="data/select-tests.js" type="text/javascript"></script>
|
||||
<script src="data/tags-tests.js" type="text/javascript"></script>
|
||||
<script src="data/tokenizer-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="data/maximumInputLength-tests.js" type="text/javascript"></script>
|
||||
<script src="data/maximumSelectionLength-tests.js" type="text/javascript"></script>
|
||||
<script src="data/minimumInputLength-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="dropdown/dropdownCss-tests.js" type="text/javascript"></script>
|
||||
<script src="dropdown/positioning-tests.js" type="text/javascript"></script>
|
||||
<script src="dropdown/selectOnClose-tests.js" type="text/javascript"></script>
|
||||
<script src="dropdown/stopPropagation-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="options/ajax-tests.js" type="text/javascript"></script>
|
||||
<script src="options/data-tests.js" type="text/javascript"></script>
|
||||
<script src="options/deprecated-tests.js" type="text/javascript"></script>
|
||||
<script src="options/translation-tests.js" type="text/javascript"></script>
|
||||
<script src="options/width-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="results/focusing-tests.js" type="text/javascript"></script>
|
||||
<script src="results/infiniteScroll-tests.js" type="text/javascript"></script>
|
||||
<script src="results/option-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="selection/allowClear-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/containerCss-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/focusing-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/multiple-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/placeholder-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/search-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/single-tests.js" type="text/javascript"></script>
|
||||
<script src="selection/stopPropagation-tests.js" type="text/javascript"></script>
|
||||
|
||||
<script src="utils/decorator-tests.js" type="text/javascript"></script>
|
||||
<script src="utils/escapeMarkup-tests.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
9814
front/lib/AdminLTE/bower_components/select2/tests/vendor/jquery-2.2.4.js
vendored
Normal file
9814
front/lib/AdminLTE/bower_components/select2/tests/vendor/jquery-2.2.4.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10598
front/lib/AdminLTE/bower_components/select2/tests/vendor/jquery-3.4.1.js
vendored
Normal file
10598
front/lib/AdminLTE/bower_components/select2/tests/vendor/jquery-3.4.1.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user