Skip to content

Commit

Permalink
chore(release): update dist
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hamilton committed Sep 1, 2019
1 parent 8016e8a commit fd8a83c
Show file tree
Hide file tree
Showing 41 changed files with 440 additions and 136 deletions.
2 changes: 1 addition & 1 deletion dist/components/accordion.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/components/api.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/components/calendar.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/components/checkbox.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/components/dimmer.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions dist/components/dropdown.css
Expand Up @@ -162,16 +162,21 @@
.ui.dropdown .menu > .header {
margin: 1rem 0 0.75rem;
padding: 0 1.14285714rem;
color: rgba(0, 0, 0, 0.85);
font-size: 0.78571429em;
font-weight: bold;
text-transform: uppercase;
}
.ui.dropdown .menu > .header:not(.ui) {
color: rgba(0, 0, 0, 0.85);
font-size: 0.78571429em;
}
.ui.dropdown .menu > .divider {
border-top: 1px solid rgba(34, 36, 38, 0.1);
height: 0;
margin: 0.5em 0;
}
.ui.dropdown .menu > .horizontal.divider {
border-top: none;
}
.ui.dropdown.dropdown .menu > .input {
width: auto;
display: -webkit-box;
Expand Down
65 changes: 46 additions & 19 deletions dist/components/dropdown.js
Expand Up @@ -382,7 +382,7 @@ $.fn.dropdown = function(parameters) {
.attr('class', $input.attr('class') )
.addClass(className.selection)
.addClass(className.dropdown)
.html( templates.dropdown(selectValues,settings.preserveHTML, settings.className) )
.html( templates.dropdown(selectValues, fields, settings.preserveHTML, settings.className) )
.insertBefore($input)
;
if($input.hasClass(className.multiple) && $input.prop('multiple') === false) {
Expand Down Expand Up @@ -1296,7 +1296,7 @@ $.fn.dropdown = function(parameters) {
isBubbledEvent = ($subMenu.find($target).length > 0)
;
// prevents IE11 bug where menu receives focus even though `tabindex=-1`
if (!module.has.search() || !document.activeElement.isEqualNode($search[0])) {
if (document.activeElement.tagName.toLowerCase() !== 'input') {
$(document.activeElement).blur();
}
if(!isBubbledEvent && (!hasSubMenu || settings.allowCategorySelection)) {
Expand Down Expand Up @@ -1865,7 +1865,7 @@ $.fn.dropdown = function(parameters) {
}
return ( !module.has.selectInput() && module.is.multiple() )
? (typeof value == 'string') // delimited string
? value.split(settings.delimiter)
? module.escape.htmlEntities(value).split(settings.delimiter)
: ''
: value
;
Expand Down Expand Up @@ -1942,7 +1942,8 @@ $.fn.dropdown = function(parameters) {
},
selectValues: function() {
var
select = {}
select = {},
oldGroup = []
;
select.values = [];
$module
Expand All @@ -1954,12 +1955,21 @@ $.fn.dropdown = function(parameters) {
disabled = $option.attr('disabled'),
value = ( $option.attr('value') !== undefined )
? $option.attr('value')
: name
: name,
group = $option.parent('optgroup')
;
if(settings.placeholder === 'auto' && value === '') {
select.placeholder = name;
}
else {
if(group.length !== oldGroup.length || group[0] !== oldGroup[0]) {
select.values.push({
type: 'header',
divider: settings.headerDivider,
name: group.attr('label') || ''
});
oldGroup = group;
}
select.values.push({
name : name,
value : value,
Expand Down Expand Up @@ -2428,6 +2438,9 @@ $.fn.dropdown = function(parameters) {
? forceScroll
: false
;
if(module.get.activeItem().length === 0){
forceScroll = false;
}
if($item && $menu.length > 0 && hasActive) {
itemOffset = $item.position().top;

Expand Down Expand Up @@ -3886,6 +3899,8 @@ $.fn.dropdown.settings = {

glyphWidth : 1.037, // widest glyph width in em (W is 1.037 em) used to calculate multiselect input width

headerDivider : true, // whether option headers should have an additional divider line underneath when converted from <select> <optgroup>

// label settings on multi-select
label: {
transition : 'scale',
Expand Down Expand Up @@ -3961,8 +3976,10 @@ $.fn.dropdown.settings = {
type : 'type', // type of dropdown element
image : 'image', // optional image path
imageClass : 'imageClass', // optional individual class for image
icon : 'icon', // optional icon name
iconClass : 'iconClass' // optional individual class for icon (for example to use flag instead)
icon : 'icon', // optional icon name
iconClass : 'iconClass', // optional individual class for icon (for example to use flag instead)
class : 'class', // optional individual class for item/header
divider : 'divider' // optional divider append for group headers
},

keys : {
Expand Down Expand Up @@ -4027,7 +4044,10 @@ $.fn.dropdown.settings = {
visible : 'visible',
clearable : 'clearable',
noselection : 'noselection',
delete : 'delete'
delete : 'delete',
header : 'header',
divider : 'divider',
groupIcon : ''
}

};
Expand Down Expand Up @@ -4062,13 +4082,11 @@ $.fn.dropdown.settings.templates = {
return string;
},
// generates dropdown from select values
dropdown: function(select, preserveHTML, className) {
dropdown: function(select, fields, preserveHTML, className) {
var
placeholder = select.placeholder || false,
values = select.values || [],
html = '',
escape = $.fn.dropdown.settings.templates.escape,
deQuote = $.fn.dropdown.settings.templates.deQuote
escape = $.fn.dropdown.settings.templates.escape
;
html += '<i class="dropdown icon"></i>';
if(placeholder) {
Expand All @@ -4078,9 +4096,7 @@ $.fn.dropdown.settings.templates = {
html += '<div class="text"></div>';
}
html += '<div class="'+className.menu+'">';
$.each(values, function(index, option) {
html += '<div class="'+(option.disabled ? className.disabled+' ':'')+className.item+'" data-value="' + deQuote(option.value) + '">' + escape(option.name,preserveHTML) + '</div>';
});
html += $.fn.dropdown.settings.templates.menu(select, fields, preserveHTML,className);
html += '</div>';
return html;
},
Expand Down Expand Up @@ -4109,7 +4125,7 @@ $.fn.dropdown.settings.templates = {
? className.disabled+' '
: ''
;
html += '<div class="'+ maybeDisabled + className.item+'" data-value="' + deQuote(option[fields.value]) + '"' + maybeText + '>';
html += '<div class="'+ maybeDisabled + (option[fields.class] ? deQuote(option[fields.class]) : className.item)+'" data-value="' + deQuote(option[fields.value]) + '"' + maybeText + '>';
if(option[fields.image]) {
html += '<img class="'+(option[fields.imageClass] ? deQuote(option[fields.imageClass]) : className.image)+'" src="' + deQuote(option[fields.image]) + '">';
}
Expand All @@ -4119,9 +4135,20 @@ $.fn.dropdown.settings.templates = {
html += escape(option[fields.name],preserveHTML);
html += '</div>';
} else if (itemType === 'header') {
html += '<div class="header">';
html += escape(option[fields.name],preserveHTML);
html += '</div>';
var groupName = escape(option[fields.name],preserveHTML),
groupIcon = option[fields.icon] ? deQuote(option[fields.icon]) : className.groupIcon
;
if(groupName !== '' || groupIcon !== '') {
html += '<div class="' + (option[fields.class] ? deQuote(option[fields.class]) : className.header) + '">';
if (groupIcon !== '') {
html += '<i class="' + groupIcon + ' ' + (option[fields.iconClass] ? deQuote(option[fields.iconClass]) : className.icon) + '"></i>';
}
html += groupName;
html += '</div>';
}
if(option[fields.divider]){
html += '<div class="'+className.divider+'"></div>';
}
}
});
return html;
Expand Down
2 changes: 1 addition & 1 deletion dist/components/dropdown.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/components/dropdown.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/components/embed.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 27 additions & 11 deletions dist/components/form.js
Expand Up @@ -192,8 +192,8 @@ $.fn.form = function(parameters) {
$calendar = $field.closest(selector.uiCalendar),
defaultValue = $field.data(metadata.defaultValue) || '',
isCheckbox = $element.is(selector.uiCheckbox),
isDropdown = $element.is(selector.uiDropdown),
isCalendar = ($calendar.length > 0),
isDropdown = $element.is(selector.uiDropdown) && module.can.useElement('dropdown'),
isCalendar = ($calendar.length > 0 && module.can.useElement('calendar')),
isErrored = $fieldGroup.hasClass(className.error)
;
if(isErrored) {
Expand Down Expand Up @@ -228,8 +228,8 @@ $.fn.form = function(parameters) {
$prompt = $fieldGroup.find(selector.prompt),
defaultValue = $field.data(metadata.defaultValue),
isCheckbox = $element.is(selector.uiCheckbox),
isDropdown = $element.is(selector.uiDropdown),
isCalendar = ($calendar.length > 0),
isDropdown = $element.is(selector.uiDropdown) && module.can.useElement('dropdown'),
isCalendar = ($calendar.length > 0 && module.can.useElement('calendar')),
isErrored = $fieldGroup.hasClass(className.error)
;
if(defaultValue === undefined) {
Expand Down Expand Up @@ -678,7 +678,7 @@ $.fn.form = function(parameters) {
isCheckbox = $field.is(selector.checkbox),
isRadio = $field.is(selector.radio),
isMultiple = (name.indexOf('[]') !== -1),
isCalendar = ($calendar.length > 0),
isCalendar = ($calendar.length > 0 && module.can.useElement('calendar')),
isChecked = (isCheckbox)
? $field.is(':checked')
: false
Expand Down Expand Up @@ -795,6 +795,16 @@ $.fn.form = function(parameters) {

},

can: {
useElement: function(element){
if ($.fn[element] !== undefined) {
return true;
}
module.error(error.noElement.replace('{element}',element));
return false;
}
},

escape: {
string: function(text) {
text = String(text);
Expand Down Expand Up @@ -869,7 +879,7 @@ $.fn.form = function(parameters) {
.html(errors[0])
;
if(!promptExists) {
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
if(settings.transition && module.can.useElement('transition') && $module.transition('is supported')) {
module.verbose('Displaying error with css transition', settings.transition);
$prompt.transition(settings.transition + ' in', settings.duration);
}
Expand Down Expand Up @@ -951,7 +961,7 @@ $.fn.form = function(parameters) {
;
if(settings.inline && $prompt.is(':visible')) {
module.verbose('Removing prompt for field', identifier);
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
if(settings.transition && module.can.useElement('transition') && $module.transition('is supported')) {
$prompt.transition(settings.transition + ' out', settings.duration, function() {
$prompt.remove();
});
Expand Down Expand Up @@ -980,7 +990,7 @@ $.fn.form = function(parameters) {
$el = $(el),
$parent = $el.parent(),
isCheckbox = ($el.filter(selector.checkbox).length > 0),
isDropdown = $parent.is(selector.uiDropdown),
isDropdown = $parent.is(selector.uiDropdown) && module.can.useElement('dropdown'),
value = (isCheckbox)
? $el.is(':checked')
: $el.val()
Expand Down Expand Up @@ -1013,10 +1023,12 @@ $.fn.form = function(parameters) {
var
$field = module.get.field(key),
$element = $field.parent(),
$calendar = $field.closest(selector.uiCalendar),
isMultiple = Array.isArray(value),
isCheckbox = $element.is(selector.uiCheckbox),
isDropdown = $element.is(selector.uiDropdown),
isCheckbox = $element.is(selector.uiCheckbox) && module.can.useElement('checkbox'),
isDropdown = $element.is(selector.uiDropdown) && module.can.useElement('dropdown'),
isRadio = ($field.is(selector.radio) && isCheckbox),
isCalendar = ($calendar.length > 0 && module.can.useElement('calendar')),
fieldExists = ($field.length > 0),
$multipleField
;
Expand Down Expand Up @@ -1052,6 +1064,9 @@ $.fn.form = function(parameters) {
module.verbose('Setting dropdown value', value, $element);
$element.dropdown('set selected', value);
}
else if (isCalendar) {
$calendar.calendar('set date',value);
}
else {
module.verbose('Setting field value', value, $field);
$field.val(value);
Expand Down Expand Up @@ -1515,7 +1530,8 @@ $.fn.form.settings = {
identifier : 'You must specify a string identifier for each field',
method : 'The method you called is not defined.',
noRule : 'There is no rule matching the one you specified',
oldSyntax : 'Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.'
oldSyntax : 'Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.',
noElement : 'This module requires ui {element}'
},

templates: {
Expand Down
4 changes: 2 additions & 2 deletions dist/components/form.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/components/label.css
Expand Up @@ -146,7 +146,8 @@ a.ui.label {
}

/* Padding on next content after a label */
.ui.top.attached.label ~ :first-of-type:not(.attached) {
.ui.top.attached.label ~ .ui.bottom.attached.label + :not(.attached),
.ui.top.attached.label + :not(.attached) {
margin-top: 2rem !important;
}
.ui.bottom.attached.label ~ :last-child:not(.attached) {
Expand Down
2 changes: 1 addition & 1 deletion dist/components/label.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/components/modal.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/components/nag.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/components/popup.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/components/progress.js
Expand Up @@ -468,7 +468,7 @@ $.fn.progress = function(parameters) {
width: value + '%'
});
}
return parseInt(value, 10);
return parseFloat(value);
});
values.forEach(function(_, index) {
var $bar = $($bars[index]);
Expand Down Expand Up @@ -523,15 +523,15 @@ $.fn.progress = function(parameters) {
: undefined;

// round display percentage
percents = percents.map(function (percent) {
var roundedPercents = percents.map(function (percent) {
return (autoPrecision > 0)
? Math.round(percent * (10 * autoPrecision)) / (10 * autoPrecision)
: Math.round(percent)
;
});
module.percent = percents;
module.percent = roundedPercents;
if (!hasTotal) {
module.value = percents.map(function (percent) {
module.value = roundedPercents.map(function (percent) {
return (autoPrecision > 0)
? Math.round((percent / 100) * module.total * (10 * autoPrecision)) / (10 * autoPrecision)
: Math.round((percent / 100) * module.total * 10) / 10
Expand Down

0 comments on commit fd8a83c

Please sign in to comment.