Skip to content

Commit

Permalink
Build SUI assets
Browse files Browse the repository at this point in the history
  • Loading branch information
hugopeek committed Jan 29, 2020
1 parent 0bfbfc7 commit 3533e1b
Show file tree
Hide file tree
Showing 35 changed files with 2,622 additions and 569 deletions.
2 changes: 1 addition & 1 deletion assets/semantic/dist/components/icon.min.css

Large diffs are not rendered by default.

295 changes: 227 additions & 68 deletions assets/semantic/dist/project/semantic.css

Large diffs are not rendered by default.

117 changes: 62 additions & 55 deletions assets/semantic/dist/project/semantic.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* # Fomantic UI - 2.8.2
* # Fomantic UI - 2.8.3
* https://github.com/fomantic/Fomantic-UI
* http://fomantic-ui.com/
*
Expand Down Expand Up @@ -1322,26 +1322,36 @@ $.fn.form = function(parameters) {
module.add.field(name, rules);
},
field: function(name, rules) {
// Validation should have at least a standard format
if(validation[name] === undefined || validation[name].rules === undefined) {
validation[name] = {
rules: []
};
}
var
newValidation = {}
newValidation = {
rules: []
}
;
if(module.is.shorthandRules(rules)) {
rules = Array.isArray(rules)
? rules
: [rules]
;
newValidation[name] = {
rules: []
};
$.each(rules, function(index, rule) {
newValidation[name].rules.push({ type: rule });
$.each(rules, function(_index, rule) {
newValidation.rules.push({ type: rule });
});
}
else {
newValidation[name] = rules;
newValidation.rules = rules.rules;
}
validation = $.extend({}, validation, newValidation);
module.debug('Adding rules', newValidation, validation);
// For each new rule, check if there's not already one with the same type
$.each(newValidation.rules, function (_index, rule) {
if ($.grep(validation[name].rules, function(item){ return item.type == rule.type; }).length == 0) {
validation[name].rules.push(rule);
}
});
module.debug('Adding rules', newValidation.rules, validation);
},
fields: function(fields) {
var
Expand Down Expand Up @@ -3270,7 +3280,7 @@ $.fn.checkbox = function(parameters) {
},

preventDefaultOnInputTarget: function() {
if(typeof event !== 'undefined' && $(event.target).is(selector.input)) {
if(typeof event !== 'undefined' && event !== null && $(event.target).is(selector.input)) {
module.verbose('Preventing default check action after manual check action');
event.preventDefault();
}
Expand Down Expand Up @@ -4757,6 +4767,10 @@ $.fn.dropdown = function(parameters) {
moduleSelector = $allModules.selector || '',

hasTouch = ('ontouchstart' in document.documentElement),
clickEvent = hasTouch
? 'touchstart'
: 'click',

time = new Date().getTime(),
performance = [],

Expand Down Expand Up @@ -5291,27 +5305,10 @@ $.fn.dropdown = function(parameters) {

bind: {
events: function() {
if(hasTouch) {
module.bind.touchEvents();
}
module.bind.keyboardEvents();
module.bind.inputEvents();
module.bind.mouseEvents();
},
touchEvents: function() {
module.debug('Touch device detected binding additional touch events');
if( module.is.searchSelection() ) {
// do nothing special yet
}
else if( module.is.single() ) {
$module
.on('touchstart' + eventNamespace, module.event.test.toggle)
;
}
$menu
.on('touchstart' + eventNamespace, selector.item, module.event.item.mouseenter)
;
},
keyboardEvents: function() {
module.verbose('Binding keyboard events');
$module
Expand All @@ -5338,8 +5335,8 @@ $.fn.dropdown = function(parameters) {
module.verbose('Binding mouse events');
if(module.is.multiple()) {
$module
.on('click' + eventNamespace, selector.label, module.event.label.click)
.on('click' + eventNamespace, selector.remove, module.event.remove.click)
.on(clickEvent + eventNamespace, selector.label, module.event.label.click)
.on(clickEvent + eventNamespace, selector.remove, module.event.remove.click)
;
}
if( module.is.searchSelection() ) {
Expand All @@ -5348,24 +5345,24 @@ $.fn.dropdown = function(parameters) {
.on('mouseup' + eventNamespace, module.event.mouseup)
.on('mousedown' + eventNamespace, selector.menu, module.event.menu.mousedown)
.on('mouseup' + eventNamespace, selector.menu, module.event.menu.mouseup)
.on('click' + eventNamespace, selector.icon, module.event.icon.click)
.on('click' + eventNamespace, selector.clearIcon, module.event.clearIcon.click)
.on(clickEvent + eventNamespace, selector.icon, module.event.icon.click)
.on(clickEvent + eventNamespace, selector.clearIcon, module.event.clearIcon.click)
.on('focus' + eventNamespace, selector.search, module.event.search.focus)
.on('click' + eventNamespace, selector.search, module.event.search.focus)
.on(clickEvent + eventNamespace, selector.search, module.event.search.focus)
.on('blur' + eventNamespace, selector.search, module.event.search.blur)
.on('click' + eventNamespace, selector.text, module.event.text.focus)
.on(clickEvent + eventNamespace, selector.text, module.event.text.focus)
;
if(module.is.multiple()) {
$module
.on('click' + eventNamespace, module.event.click)
.on(clickEvent + eventNamespace, module.event.click)
;
}
}
else {
if(settings.on == 'click') {
$module
.on('click' + eventNamespace, selector.icon, module.event.icon.click)
.on('click' + eventNamespace, module.event.test.toggle)
.on(clickEvent + eventNamespace, selector.icon, module.event.icon.click)
.on(clickEvent + eventNamespace, module.event.test.toggle)
;
}
else if(settings.on == 'hover') {
Expand All @@ -5383,7 +5380,7 @@ $.fn.dropdown = function(parameters) {
.on('mousedown' + eventNamespace, module.event.mousedown)
.on('mouseup' + eventNamespace, module.event.mouseup)
.on('focus' + eventNamespace, module.event.focus)
.on('click' + eventNamespace, selector.clearIcon, module.event.clearIcon.click)
.on(clickEvent + eventNamespace, selector.clearIcon, module.event.clearIcon.click)
;
if(module.has.menuSearch() ) {
$module
Expand All @@ -5397,7 +5394,7 @@ $.fn.dropdown = function(parameters) {
}
}
$menu
.on('mouseenter' + eventNamespace, selector.item, module.event.item.mouseenter)
.on((hasTouch ? 'touchstart' : 'mouseenter') + eventNamespace, selector.item, module.event.item.mouseenter)
.on('mouseleave' + eventNamespace, selector.item, module.event.item.mouseleave)
.on('click' + eventNamespace, selector.item, module.event.item.click)
;
Expand All @@ -5411,7 +5408,7 @@ $.fn.dropdown = function(parameters) {
;
}
$document
.on('click' + elementNamespace, module.event.test.hide)
.on(clickEvent + elementNamespace, module.event.test.hide)
;
}
},
Expand All @@ -5426,7 +5423,7 @@ $.fn.dropdown = function(parameters) {
;
}
$document
.off('click' + elementNamespace)
.off(clickEvent + elementNamespace)
;
}
},
Expand Down Expand Up @@ -5574,6 +5571,10 @@ $.fn.dropdown = function(parameters) {
text,
value
;
if($choice.hasClass(className.unfilterable)) {
results.push(this);
return true;
}
if(settings.match === 'both' || settings.match === 'text') {
text = module.remove.diacritics(String(module.get.choiceText($choice, false)));
if(text.search(beginsWithRegExp) !== -1) {
Expand Down Expand Up @@ -5743,7 +5744,7 @@ $.fn.dropdown = function(parameters) {
var
value = settings.templates.deQuote(item[fields.value]),
name = settings.templates.escape(
item[fields.name] || item[fields.value],
item[fields.name] || '',
settings.preserveHTML
)
;
Expand Down Expand Up @@ -6701,6 +6702,9 @@ $.fn.dropdown = function(parameters) {
value = ( $option.attr('value') !== undefined )
? $option.attr('value')
: name,
text = ( $option.data(metadata.text) !== undefined )
? $option.data(metadata.text)
: name,
group = $option.parent('optgroup')
;
if(settings.placeholder === 'auto' && value === '') {
Expand All @@ -6718,6 +6722,7 @@ $.fn.dropdown = function(parameters) {
select.values.push({
name : name,
value : value,
text : text,
disabled : disabled
});
}
Expand Down Expand Up @@ -6806,7 +6811,7 @@ $.fn.dropdown = function(parameters) {
return;
}
if(isMultiple) {
if($.inArray( String(optionValue), value) !== -1) {
if($.inArray(module.escape.htmlEntities(String(optionValue)), value) !== -1) {
$selectedItem = ($selectedItem)
? $selectedItem.add($choice)
: $choice
Expand All @@ -6825,7 +6830,7 @@ $.fn.dropdown = function(parameters) {
optionValue = optionValue.toLowerCase();
value = value.toLowerCase();
}
if( String(optionValue) == String(value)) {
if(module.escape.htmlEntities(String(optionValue)) === module.escape.htmlEntities(String(value))) {
module.verbose('Found select item by value', optionValue, value);
$selectedItem = $choice;
return true;
Expand Down Expand Up @@ -7798,6 +7803,7 @@ $.fn.dropdown = function(parameters) {
values = module.get.values(),
newValue
;
removedValue = module.escape.htmlEntities(removedValue);
if( module.has.selectInput() ) {
module.verbose('Input is <select> removing selected option', removedValue);
newValue = module.remove.arrayValue(removedValue, values);
Expand Down Expand Up @@ -8387,10 +8393,9 @@ $.fn.dropdown = function(parameters) {
},
htmlEntities: function(string) {
var
badChars = /[&<>"'`]/g,
badChars = /[<>"'`]/g,
shouldEscape = /[&<>"'`]/,
escape = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
Expand All @@ -8402,6 +8407,7 @@ $.fn.dropdown = function(parameters) {
}
;
if(shouldEscape.test(string)) {
string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&amp;");
return string.replace(badChars, escapedChar);
}
return string;
Expand Down Expand Up @@ -8798,7 +8804,8 @@ $.fn.dropdown.settings = {
delete : 'delete',
header : 'header',
divider : 'divider',
groupIcon : ''
groupIcon : '',
unfilterable : 'unfilterable'
}

};
Expand All @@ -8813,10 +8820,9 @@ $.fn.dropdown.settings.templates = {
return string;
}
var
badChars = /[&<>"'`]/g,
badChars = /[<>"'`]/g,
shouldEscape = /[&<>"'`]/,
escape = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
Expand All @@ -8828,6 +8834,7 @@ $.fn.dropdown.settings.templates = {
}
;
if(shouldEscape.test(string)) {
string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&amp;");
return string.replace(badChars, escapedChar);
}
return string;
Expand Down Expand Up @@ -8883,10 +8890,10 @@ $.fn.dropdown.settings.templates = {
if(option[fields.icon]) {
html += '<i class="'+deQuote(option[fields.icon])+' '+(option[fields.iconClass] ? deQuote(option[fields.iconClass]) : className.icon)+'"></i>';
}
html += escape(option[fields.name] || option[fields.value],preserveHTML);
html += escape(option[fields.name] || '', preserveHTML);
html += '</div>';
} else if (itemType === 'header') {
var groupName = escape(option[fields.name],preserveHTML),
var groupName = escape(option[fields.name] || '', preserveHTML),
groupIcon = option[fields.icon] ? deQuote(option[fields.icon]) : className.groupIcon
;
if(groupName !== '' || groupIcon !== '') {
Expand Down Expand Up @@ -11135,10 +11142,9 @@ $.fn.popup.settings = {
templates: {
escape: function(string) {
var
badChars = /[&<>"'`]/g,
badChars = /[<>"'`]/g,
shouldEscape = /[&<>"'`]/,
escape = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
Expand All @@ -11150,6 +11156,7 @@ $.fn.popup.settings = {
}
;
if(shouldEscape.test(string)) {
string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&amp;");
return string.replace(badChars, escapedChar);
}
return string;
Expand Down Expand Up @@ -13104,10 +13111,9 @@ $.fn.search.settings = {
return string;
}
var
badChars = /[&<>"'`]/g,
badChars = /[<>"'`]/g,
shouldEscape = /[&<>"'`]/,
escape = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
Expand All @@ -13119,6 +13125,7 @@ $.fn.search.settings = {
}
;
if(shouldEscape.test(string)) {
string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&amp;");
return string.replace(badChars, escapedChar);
}
return string;
Expand Down
18 changes: 9 additions & 9 deletions assets/semantic/dist/project/semantic.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/semantic/dist/project/semantic.min.js

Large diffs are not rendered by default.

Binary file not shown.
Loading

0 comments on commit 3533e1b

Please sign in to comment.