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 Feb 24, 2020
1 parent 3c8ec6c commit d5fe7ff
Show file tree
Hide file tree
Showing 31 changed files with 402 additions and 202 deletions.
50 changes: 41 additions & 9 deletions definitions/behaviors/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ $.fn.form = function(parameters) {
module.verbose('Initializing form validation', $module, settings);
module.bindEvents();
module.set.defaults();
if (settings.autoCheckRequired) {
module.set.autoCheck();
}
module.instantiate();
}
},
Expand Down Expand Up @@ -542,18 +545,18 @@ $.fn.form = function(parameters) {
name
;
if(requiresValue) {
prompt = prompt.replace('{value}', $field.val());
prompt = prompt.replace(/\{value\}/g, $field.val());
}
if(requiresName) {
$label = $field.closest(selector.group).find('label').eq(0);
name = ($label.length == 1)
? $label.text()
: $field.prop('placeholder') || settings.text.unspecifiedField
;
prompt = prompt.replace('{name}', name);
prompt = prompt.replace(/\{name\}/g, name);
}
prompt = prompt.replace('{identifier}', field.identifier);
prompt = prompt.replace('{ruleValue}', ancillary);
prompt = prompt.replace(/\{identifier\}/g, field.identifier);
prompt = prompt.replace(/\{ruleValue\}/g, ancillary);
if(!rule.prompt) {
module.verbose('Using default validation prompt for type', prompt, ruleName);
}
Expand Down Expand Up @@ -703,7 +706,7 @@ $.fn.form = function(parameters) {
}
else {
if(isRadio) {
if(values[name] === undefined || values[name] == false) {
if(values[name] === undefined || values[name] === false) {
values[name] = (isChecked)
? value || true
: false
Expand Down Expand Up @@ -1116,6 +1119,32 @@ $.fn.form = function(parameters) {
asDirty: function() {
module.set.defaults();
module.set.dirty();
},
autoCheck: function() {
module.debug('Enabling auto check on required fields');
$field.each(function (_index, el) {
var
$el = $(el),
$elGroup = $(el).closest($group),
isCheckbox = ($el.filter(selector.checkbox).length > 0),
isRequired = $el.prop('required') || $elGroup.hasClass(className.required) || $elGroup.parent().hasClass(className.required),
isDisabled = $el.prop('disabled') || $elGroup.hasClass(className.disabled) || $elGroup.parent().hasClass(className.disabled),
validation = module.get.validation($el),
hasEmptyRule = validation
? $.grep(validation.rules, function(rule) { return rule.type == "empty" }) !== 0
: false,
identifier = validation.identifier || $el.attr('id') || $el.attr('name') || $el.data(metadata.validate)
;
if (isRequired && !isDisabled && !hasEmptyRule && identifier !== undefined) {
if (isCheckbox) {
module.verbose("Adding 'checked' rule on field", identifier);
module.add.rule(identifier, "checked");
} else {
module.verbose("Adding 'empty' rule on field", identifier);
module.add.rule(identifier, "empty");
}
}
});
}
},

Expand Down Expand Up @@ -1455,6 +1484,7 @@ $.fn.form.settings = {
transition : 'scale',
duration : 200,

autoCheckRequired : false,
preventLeaving : false,
dateHandling : 'date', // 'date', 'input', 'formatter'

Expand Down Expand Up @@ -1535,10 +1565,12 @@ $.fn.form.settings = {
},

className : {
error : 'error',
label : 'ui basic red pointing prompt label',
pressed : 'down',
success : 'success'
error : 'error',
label : 'ui basic red pointing prompt label',
pressed : 'down',
success : 'success',
required : 'required',
disabled : 'disabled'
},

error: {
Expand Down
10 changes: 10 additions & 0 deletions definitions/collections/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,16 @@
font-size: @inlineInputSize;
}

.ui.form .inline.fields .field .calendar:not(.popup),
.ui.form .inline.field .calendar:not(.popup) {
display:inline-block;
}

.ui.form .inline.fields .field .calendar:not(.popup) > .input > input,
.ui.form .inline.field .calendar:not(.popup) > .input > input {
width: @inlineCalendarWidth;
}

/* Label */
.ui.form .inline.fields .field > :first-child,
.ui.form .inline.field > :first-child {
Expand Down
4 changes: 2 additions & 2 deletions definitions/collections/menu.less
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ each(@colors, {
@c: @colors[@@color][color];

& when not (@color=secondary) {
.ui.ui.menu .@{color}.active.item,
.ui.ui.ui.menu .@{color}.active.item,
.ui.ui.@{color}.menu .active.item:hover,
.ui.ui.@{color}.menu .active.item {
& when not (@secondaryPointingActiveBorderColor = currentColor) {
Expand Down Expand Up @@ -1485,7 +1485,7 @@ each(@colors, {
@h: @colors[@@color][hover];

& when not (@color=secondary) {
.ui.ui.inverted.menu .@{color}.active.item,
.ui.ui.ui.inverted.menu .@{color}.active.item,
.ui.ui.inverted.@{color}.menu {
background-color: @c;
}
Expand Down
34 changes: 20 additions & 14 deletions definitions/collections/table.less
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
transition: @transition;
}

/* Rowspan helper class */
.ui.table th.rowspanned,
.ui.table td.rowspanned {
display:none;
}

/* Headers */
.ui.table > thead {
box-shadow: @headerBoxShadow;
Expand Down Expand Up @@ -180,13 +186,13 @@
.ui.table:not(.unstackable) > tbody,
.ui.table:not(.unstackable) > tr,
.ui.table:not(.unstackable) > tbody > tr,
.ui.table:not(.unstackable) > tr > th,
.ui.table:not(.unstackable) > thead > tr > th,
.ui.table:not(.unstackable) > tbody > tr > th,
.ui.table:not(.unstackable) > tfoot > tr > th,
.ui.table:not(.unstackable) > tr > td,
.ui.table:not(.unstackable) > tbody > tr > td,
.ui.table:not(.unstackable) > tfoot > tr > td {
.ui.table:not(.unstackable) > tr > th:not(.rowspanned),
.ui.table:not(.unstackable) > thead > tr > th:not(.rowspanned),
.ui.table:not(.unstackable) > tbody > tr > th:not(.rowspanned),
.ui.table:not(.unstackable) > tfoot > tr > th:not(.rowspanned),
.ui.table:not(.unstackable) > tr > td:not(.rowspanned),
.ui.table:not(.unstackable) > tbody > tr > td:not(.rowspanned),
.ui.table:not(.unstackable) > tfoot > tr > td:not(.rowspanned) {
display: block !important;
width: auto !important;
}
Expand Down Expand Up @@ -469,13 +475,13 @@
.ui[class*="tablet stackable"].table > tbody,
.ui[class*="tablet stackable"].table > tbody > tr,
.ui[class*="tablet stackable"].table > tr,
.ui[class*="tablet stackable"].table > thead > tr > th,
.ui[class*="tablet stackable"].table > tbody > tr > th,
.ui[class*="tablet stackable"].table > tfoot > tr > th,
.ui[class*="tablet stackable"].table > tr > th,
.ui[class*="tablet stackable"].table > tbody > tr > td,
.ui[class*="tablet stackable"].table > tfoot > tr > td,
.ui[class*="tablet stackable"].table > tr > td {
.ui[class*="tablet stackable"].table > thead > tr > th:not(.rowspanned),
.ui[class*="tablet stackable"].table > tbody > tr > th:not(.rowspanned),
.ui[class*="tablet stackable"].table > tfoot > tr > th:not(.rowspanned),
.ui[class*="tablet stackable"].table > tr > th:not(.rowspanned),
.ui[class*="tablet stackable"].table > tbody > tr > td:not(.rowspanned),
.ui[class*="tablet stackable"].table > tfoot > tr > td:not(.rowspanned),
.ui[class*="tablet stackable"].table > tr > td:not(.rowspanned) {
display: block !important;
width: 100% !important;
}
Expand Down
2 changes: 1 addition & 1 deletion definitions/elements/emoji.less
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ em[data-emoji].loading:before {
Link
--------------------*/

em[data-emoji].link {
em[data-emoji].link:not(.disabled) {
cursor: pointer;
}

Expand Down
2 changes: 1 addition & 1 deletion definitions/elements/segment.less
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
--------------------*/
& when (@variationSegmentInverted) {
/* Header */
.ui.inverted.segment > .ui.header > .sub.header,
.ui.inverted.segment > .ui.header .sub.header,
.ui.inverted.segment > .ui.header {
color: @white;
}
Expand Down
71 changes: 62 additions & 9 deletions definitions/modules/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -845,15 +845,38 @@ $.fn.calendar = function(parameters) {

helper: {
isDisabled: function(date, mode) {
return mode === 'day' && ((settings.disabledDaysOfWeek.indexOf(date.getDay()) !== -1) || settings.disabledDates.some(function(d){
return (mode === 'day' || mode === 'month' || mode === 'year') && ((settings.disabledDaysOfWeek.indexOf(date.getDay()) !== -1) || settings.disabledDates.some(function(d){
if(typeof d === 'string') {
d = module.helper.sanitiseDate(d);
}
if (d instanceof Date) {
return module.helper.dateEqual(date, d, mode);
}
if (d !== null && typeof d === 'object' && d[metadata.date]) {
return module.helper.dateEqual(date, module.helper.sanitiseDate(d[metadata.date]), mode);
if (d !== null && typeof d === 'object') {
if (d[metadata.year]) {
if (typeof d[metadata.year] === 'number') {
return date.getFullYear() == d[metadata.year];
} else if (Array.isArray(d[metadata.year])) {
return d[metadata.year].indexOf(date.getFullYear()) > -1;
}
} else if (d[metadata.month]) {
if (typeof d[metadata.month] === 'number') {
return date.getMonth() == d[metadata.month];
} else if (Array.isArray(d[metadata.month])) {
return d[metadata.month].indexOf(date.getMonth()) > -1;
} else if (d[metadata.month] instanceof Date) {
var sdate = module.helper.sanitiseDate(d[metadata.month]);
return (date.getMonth() == sdate.getMonth()) && (date.getFullYear() == sdate.getFullYear())
}
} else if (d[metadata.date] && mode === 'day') {
if (d[metadata.date] instanceof Date) {
return module.helper.dateEqual(date, module.helper.sanitiseDate(d[metadata.date]), mode);
} else if (Array.isArray(d[metadata.date])) {
return d[metadata.date].some(function(idate) {
return module.helper.dateEqual(date, idate, mode);
});
}
}
}
}));
},
Expand All @@ -875,10 +898,9 @@ $.fn.calendar = function(parameters) {
}
},
findDayAsObject: function(date, mode, dates) {
if (mode === 'day') {
var i = 0, il = dates.length;
if (mode === 'day' || mode === 'month' || mode === 'year') {
var d;
for (; i < il; i++) {
for (var i = 0; i < dates.length; i++) {
d = dates[i];
if(typeof d === 'string') {
d = module.helper.sanitiseDate(d);
Expand All @@ -888,8 +910,37 @@ $.fn.calendar = function(parameters) {
dateObject[metadata.date] = d;
return dateObject;
}
else if (d !== null && typeof d === 'object' && d[metadata.date] && module.helper.dateEqual(date,module.helper.sanitiseDate(d[metadata.date]), mode) ) {
return d;
else if (d !== null && typeof d === 'object') {
if (d[metadata.year]) {
if (typeof d[metadata.year] === 'number' && date.getFullYear() == d[metadata.year]) {
return d;
} else if (Array.isArray(d[metadata.year])) {
if (d[metadata.year].indexOf(date.getFullYear()) > -1) {
return d;
}
}
} else if (d[metadata.month]) {
if (typeof d[metadata.month] === 'number' && date.getMonth() == d[metadata.month]) {
return d;
} else if (Array.isArray(d[metadata.month])) {
if (d[metadata.month].indexOf(date.getMonth()) > -1) {
return d;
}
} else if (d[metadata.month] instanceof Date) {
var sdate = module.helper.sanitiseDate(d[metadata.month]);
if ((date.getMonth() == sdate.getMonth()) && (date.getFullYear() == sdate.getFullYear())) {
return d;
}
}
} else if (d[metadata.date] && mode === 'day') {
if (d[metadata.date] instanceof Date && module.helper.dateEqual(date, module.helper.sanitiseDate(d[metadata.date]), mode)) {
return d;
} else if (Array.isArray(d[metadata.date])) {
if(d[metadata.date].some(function(idate) { return module.helper.dateEqual(date, idate, mode); })) {
return d;
}
}
}
}
}
}
Expand Down Expand Up @@ -1576,7 +1627,9 @@ $.fn.calendar.settings = {
type: 'type',
monthOffset: 'monthOffset',
message: 'message',
class: 'class'
class: 'class',
month: 'month',
year: 'year'
},

eventClass: 'blue'
Expand Down
1 change: 1 addition & 0 deletions definitions/modules/checkbox.less
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@
cursor: default !important;
opacity: @disabledCheckboxOpacity;
color: @disabledCheckboxLabelColor;
pointer-events: none;
}
}

Expand Down
2 changes: 1 addition & 1 deletion definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -2075,7 +2075,7 @@ $.fn.dropdown = function(parameters) {
return;
}
if(isMultiple) {
if($.inArray(module.escape.htmlEntities(String(optionValue)), value) !== -1) {
if($.inArray(module.escape.htmlEntities(String(optionValue)), value.map(function(v){return String(v);})) !== -1) {
$selectedItem = ($selectedItem)
? $selectedItem.add($choice)
: $choice
Expand Down
2 changes: 1 addition & 1 deletion definitions/modules/dropdown.less
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ select.ui.dropdown {
cursor: text;
position: relative;
left: @textCursorSpacing;
z-index: 3;
z-index: auto;
}

& when (@variationDropdownSelection) {
Expand Down
10 changes: 9 additions & 1 deletion definitions/modules/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,15 @@ $.fn.modal = function(parameters) {
return module.cache.leftBodyScrollbar;
},
useFlex: function() {
return settings.useFlex && settings.detachable && !module.is.ie();
if (settings.useFlex === 'auto') {
return settings.detachable && !module.is.ie();
}
if(settings.useFlex && module.is.ie()) {
module.debug('useFlex true is not supported in IE');
} else if(settings.useFlex && !settings.detachable) {
module.debug('useFlex true in combination with detachable false is not supported');
}
return settings.useFlex;
},
fit: function() {
var
Expand Down
5 changes: 5 additions & 0 deletions definitions/modules/modal.less
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
border-bottom-right-radius: @borderRadius;
}

.ui.modal > .ui.dimmer {
border-radius: inherit;
}

/*******************************
Content
*******************************/
Expand Down Expand Up @@ -309,6 +313,7 @@
}
.ui.basic.modal > .header {
color: @basicModalHeaderColor;
border-bottom: none;
}
.ui.basic.modal > .close {
top: @basicModalCloseTop;
Expand Down
1 change: 1 addition & 0 deletions definitions/modules/shape.less
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
transition: @transition;
}

.ui.shape .side,
.ui.shape .sides {
transform-style: preserve-3d;
}
Expand Down

0 comments on commit d5fe7ff

Please sign in to comment.