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 Jun 1, 2020
1 parent d5fe7ff commit d0d40f8
Show file tree
Hide file tree
Showing 38 changed files with 644 additions and 156 deletions.
14 changes: 4 additions & 10 deletions definitions/behaviors/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ $.fn.form = function(parameters) {
}
},
blank: function($field) {
return $.trim($field.val()) === '';
return String($field.val()).trim() === '';
},
valid: function(field) {
var
Expand Down Expand Up @@ -1128,7 +1128,7 @@ $.fn.form = function(parameters) {
$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),
isDisabled = $el.is(':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
Expand Down Expand Up @@ -1207,13 +1207,7 @@ $.fn.form = function(parameters) {
module.debug('Using field name as identifier', identifier);
field.identifier = identifier;
}
var isDisabled = true;
$.each($field, function(){
if(!$(this).prop('disabled')) {
isDisabled = false;
return false;
}
});
var isDisabled = !$field.filter(':not(:disabled)').length;
if(isDisabled) {
module.debug('Field is disabled. Skipping', identifier);
}
Expand Down Expand Up @@ -1270,7 +1264,7 @@ $.fn.form = function(parameters) {
// cast to string avoiding encoding special values
value = (value === undefined || value === '' || value === null)
? ''
: (settings.shouldTrim) ? $.trim(value + '') : String(value + '')
: (settings.shouldTrim) ? String(value + '').trim() : String(value + '')
;
return ruleFunction.call(field, value, ancillary, $module);
}
Expand Down
2 changes: 1 addition & 1 deletion definitions/behaviors/visibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ $.fn.visibility = function(parameters) {
element.offset.top += $context.scrollTop() - $context.offset().top;
}
if(module.is.horizontallyScrollableContext()) {
element.offset.left += $context.scrollLeft - $context.offset().left;
element.offset.left += $context.scrollLeft() - $context.offset().left;
}
// store
module.cache.element = element;
Expand Down
60 changes: 32 additions & 28 deletions definitions/collections/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -414,36 +414,40 @@
box-shadow: @inputFocusBoxShadow;
}
& when (@variationInputAction) {
.ui.form .ui.action.input:not(.left) input:not([type]):focus,
.ui.form .ui.action.input:not(.left) input[type="date"]:focus,
.ui.form .ui.action.input:not(.left) input[type="datetime-local"]:focus,
.ui.form .ui.action.input:not(.left) input[type="email"]:focus,
.ui.form .ui.action.input:not(.left) input[type="number"]:focus,
.ui.form .ui.action.input:not(.left) input[type="password"]:focus,
.ui.form .ui.action.input:not(.left) input[type="search"]:focus,
.ui.form .ui.action.input:not(.left) input[type="tel"]:focus,
.ui.form .ui.action.input:not(.left) input[type="time"]:focus,
.ui.form .ui.action.input:not(.left) input[type="text"]:focus,
.ui.form .ui.action.input:not(.left) input[type="file"]:focus,
.ui.form .ui.action.input:not(.left) input[type="url"]:focus {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
.ui.form .ui.action.input:not([class*="left action"]) {
& input:not([type]):focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="time"]:focus,
input[type="text"]:focus,
input[type="file"]:focus,
input[type="url"]:focus {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
}

.ui.form .ui.action.input.left input:not([type]),
.ui.form .ui.action.input.left input[type="date"],
.ui.form .ui.action.input.left input[type="datetime-local"],
.ui.form .ui.action.input.left input[type="email"],
.ui.form .ui.action.input.left input[type="number"],
.ui.form .ui.action.input.left input[type="password"],
.ui.form .ui.action.input.left input[type="search"],
.ui.form .ui.action.input.left input[type="tel"],
.ui.form .ui.action.input.left input[type="time"],
.ui.form .ui.action.input.left input[type="text"],
.ui.form .ui.action.input.left input[type="file"],
.ui.form .ui.action.input.left input[type="url"] {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
.ui.form .ui[class*="left action"].input {
& input:not([type]),
input[type="date"],
input[type="datetime-local"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="time"],
input[type="text"],
input[type="file"],
input[type="url"] {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
}
}
.ui.form textarea:focus {
Expand Down
12 changes: 9 additions & 3 deletions definitions/elements/button.less
Original file line number Diff line number Diff line change
Expand Up @@ -615,15 +615,17 @@
.ui.button > .icon:not(.button) {
height: @iconHeight;
opacity: @iconOpacity;
margin: @iconMargin;
transition: @iconTransition;
vertical-align: @iconVerticalAlign;
color: @iconColor;
}

.ui.button:not(.icon) > .icon:not(.button):not(.dropdown),
.ui.button:not(.icon) > .icons:not(.button):not(.dropdown) {
margin: @iconMargin;
vertical-align: @iconVerticalAlign;
}
.ui.button:not(.icon) > .icons:not(.button):not(.dropdown) > .icon {
vertical-align: @iconVerticalAlign;
}
.ui.button:not(.icon) > .right.icon:not(.button):not(.dropdown) {
margin: @rightIconMargin;
Expand Down Expand Up @@ -706,15 +708,19 @@
---------------*/

.ui.icon.buttons .button,
.ui.icon.button {
.ui.icon.button:not(.animated) {
padding: @verticalPadding @verticalPadding ( @verticalPadding + @shadowOffset );
}
.ui.animated.icon.button > .content > .icon,
.ui.icon.buttons .button > .icon,
.ui.icon.button > .icon {
opacity: @iconButtonOpacity;
margin: 0 !important;
vertical-align: top;
}
.ui.animated.button > .content > .icon {
vertical-align: top;
}

& when (@variationButtonBasic) {
/*-------------------
Expand Down
8 changes: 4 additions & 4 deletions definitions/elements/divider.less
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
---------------*/

.ui.divider:not(.vertical):not(.horizontal) {
border-top: @shadowWidth solid @shadowColor;
border-bottom: @highlightWidth solid @highlightColor;
border-top: @shadowWidth @borderStyle @shadowColor;
border-bottom: @highlightWidth @borderStyle @highlightColor;
}

/*--------------
Expand Down Expand Up @@ -117,8 +117,8 @@
content: '';
z-index: 3;

border-left: @shadowWidth solid @shadowColor;
border-right: @highlightWidth solid @highlightColor;
border-left: @shadowWidth @borderStyle @shadowColor;
border-right: @highlightWidth @borderStyle @highlightColor;

width: 0;
height: @verticalDividerHeight;
Expand Down
4 changes: 2 additions & 2 deletions definitions/elements/icon.less
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,14 @@ each(@colors, {
i.icon,
i.icons {
font-size: @medium;
line-height: 1;
vertical-align: middle;
}
& when not (@variationIconSizes = false) {
each(@variationIconSizes, {
@s: @@value;
i.@{value}.@{value}.@{value}.icon,
i.@{value}.@{value}.@{value}.icons {
line-height: 1;
vertical-align: middle;
font-size: @s;
}
})
Expand Down
8 changes: 4 additions & 4 deletions definitions/elements/input.less
Original file line number Diff line number Diff line change
Expand Up @@ -444,15 +444,15 @@
border-top: @borderWidth solid @borderColor;
border-bottom: @borderWidth solid @borderColor;
}
.ui.form > .field.@{state} > .ui.left.action.input > .ui.button,
.ui.form > .field.@{state} > .ui[class*="left action"].input > .ui.button,
.ui.form > .field.@{state} > .ui.labeled.input:not(.right):not([class*="corner labeled"]) > .ui.label,
.ui.left.action.input.@{state} > .ui.button,
.ui[class*="left action"].input.@{state} > .ui.button,
.ui.labeled.input.@{state}:not(.right):not([class*="corner labeled"]) > .ui.label {
border-left: @borderWidth solid @borderColor;
}
.ui.form > .field.@{state} > .ui.action.input:not(.left) > input + .ui.button,
.ui.form > .field.@{state} > .ui.action.input:not([class*="left action"]) > input + .ui.button,
.ui.form > .field.@{state} > .ui.right.labeled.input:not([class*="corner labeled"]) > input + .ui.label,
.ui.action.input.@{state}:not(.left) > input + .ui.button,
.ui.action.input.@{state}:not([class*="left action"]) > input + .ui.button,
.ui.right.labeled.input.@{state}:not([class*="corner labeled"]) > input + .ui.label {
border-right: @borderWidth solid @borderColor;
}
Expand Down
6 changes: 6 additions & 0 deletions definitions/elements/step.less
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@
border-width: @verticalArrowBorderWidth;
display: @verticalArrowDisplay;
}
.ui.right.vertical.steps .step:after {
border-width: @verticalLeftArrowBorderWidth;
left: @verticalLeftArrowLeftOffset;
right: @verticalLeftArrowRightOffset;
transform: translateY(-50%) translateX(-50%) rotate(-45deg);
}

.ui.vertical.steps .active.step:after {
display: @verticalActiveArrowDisplay;
Expand Down
77 changes: 41 additions & 36 deletions definitions/modules/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ $.fn.calendar = function(parameters) {
module.set.maxDate($module.data(metadata.maxDate));
}
module.setting('type', module.get.type());
module.setting('on', settings.on || ($input.length ? 'focus' : 'click'));
},
popup: function () {
if (settings.inline) {
Expand Down Expand Up @@ -159,7 +160,7 @@ $.fn.calendar = function(parameters) {
module.set.mode(settings.startMode);
return settings.onShow.apply($container, arguments);
};
var on = settings.on || ($input.length ? 'focus' : 'click');
var on = module.setting('on');
var options = $.extend({}, settings.popupOptions, {
popup: $container,
on: on,
Expand Down Expand Up @@ -202,33 +203,38 @@ $.fn.calendar = function(parameters) {
calendar: function () {
var i, r, c, p, row, cell, pageGrid;

var mode = module.get.mode();
var today = new Date();
var date = module.get.date();
var focusDate = module.get.focusDate();
var display = focusDate || date || settings.initialDate || today;
display = module.helper.dateInRange(display);
var
mode = module.get.mode(),
today = new Date(),
date = module.get.date(),
focusDate = module.get.focusDate(),
display = module.helper.dateInRange(focusDate || date || settings.initialDate || today)
;

if (!focusDate) {
focusDate = display;
module.set.focusDate(focusDate, false, false);
}

var isYear = mode === 'year';
var isMonth = mode === 'month';
var isDay = mode === 'day';
var isHour = mode === 'hour';
var isMinute = mode === 'minute';
var isTimeOnly = settings.type === 'time';
var
isYear = mode === 'year',
isMonth = mode === 'month',
isDay = mode === 'day',
isHour = mode === 'hour',
isMinute = mode === 'minute',
isTimeOnly = settings.type === 'time'
;

var multiMonth = Math.max(settings.multiMonth, 1);
var monthOffset = !isDay ? 0 : module.get.monthOffset();

var minute = display.getMinutes();
var hour = display.getHours();
var day = display.getDate();
var startMonth = display.getMonth() + monthOffset;
var year = display.getFullYear();
var
minute = display.getMinutes(),
hour = display.getHours(),
day = display.getDate(),
startMonth = display.getMonth() + monthOffset,
year = display.getFullYear()
;

var columns = isDay ? settings.showWeekNumbers ? 8 : 7 : isHour ? 4 : timeGap['column'];
var rows = isDay || isHour ? 6 : timeGap['row'];
Expand All @@ -254,17 +260,18 @@ $.fn.calendar = function(parameters) {
rows = Math.ceil(requiredCells / 7);
}

var yearChange = isYear ? 10 : isMonth ? 1 : 0;
var monthChange = isDay ? 1 : 0;
var dayChange = isHour || isMinute ? 1 : 0;
var prevNextDay = isHour || isMinute ? day : 1;
var prevDate = new Date(year - yearChange, month - monthChange, prevNextDay - dayChange, hour);
var nextDate = new Date(year + yearChange, month + monthChange, prevNextDay + dayChange, hour);

var prevLast = isYear ? new Date(Math.ceil(year / 10) * 10 - 9, 0, 0) :
isMonth ? new Date(year, 0, 0) : isDay ? new Date(year, month, 0) : new Date(year, month, day, -1);
var nextFirst = isYear ? new Date(Math.ceil(year / 10) * 10 + 1, 0, 1) :
isMonth ? new Date(year + 1, 0, 1) : isDay ? new Date(year, month + 1, 1) : new Date(year, month, day + 1);
var
yearChange = isYear ? 10 : isMonth ? 1 : 0,
monthChange = isDay ? 1 : 0,
dayChange = isHour || isMinute ? 1 : 0,
prevNextDay = isHour || isMinute ? day : 1,
prevDate = new Date(year - yearChange, month - monthChange, prevNextDay - dayChange, hour),
nextDate = new Date(year + yearChange, month + monthChange, prevNextDay + dayChange, hour),
prevLast = isYear ? new Date(Math.ceil(year / 10) * 10 - 9, 0, 0) :
isMonth ? new Date(year, 0, 0) : isDay ? new Date(year, month, 0) : new Date(year, month, day, -1),
nextFirst = isYear ? new Date(Math.ceil(year / 10) * 10 + 1, 0, 1) :
isMonth ? new Date(year + 1, 0, 1) : isDay ? new Date(year, month + 1, 1) : new Date(year, month, day + 1)
;

var tempMode = mode;
if (isDay && settings.showWeekNumbers){
Expand Down Expand Up @@ -440,7 +447,6 @@ $.fn.calendar = function(parameters) {
$input.on('input' + eventNamespace, module.event.inputChange);
$input.on('focus' + eventNamespace, module.event.inputFocus);
$input.on('blur' + eventNamespace, module.event.inputBlur);
$input.on('click' + eventNamespace, module.event.inputClick);
$input.on('keydown' + eventNamespace, module.event.keydown);
} else {
$container.on('keydown' + eventNamespace, module.event.keydown);
Expand Down Expand Up @@ -569,9 +575,6 @@ $.fn.calendar = function(parameters) {
var text = formatter.datetime(date, settings);
$input.val(text);
}
},
inputClick: function () {
module.popup('show');
}
},

Expand Down Expand Up @@ -796,10 +799,12 @@ $.fn.calendar = function(parameters) {
var canceled = module.set.date(date) === false;
if (!canceled && settings.closable) {
module.popup('hide');
//if this is a range calendar, show the end date calendar popup and focus the input
//if this is a range calendar, focus the container or input. This will open the popup from its event listeners.
var endModule = module.get.calendarModule(settings.endCalendar);
if (endModule) {
endModule.popup('show');
if (endModule.setting('on') !== 'focus') {
endModule.popup('show');
}
endModule.focus();
}
}
Expand All @@ -809,7 +814,7 @@ $.fn.calendar = function(parameters) {
module.set.mode(newMode);
if (mode === 'hour' || (mode === 'day' && module.get.date())) {
//the user has chosen enough to consider a valid date/time has been chosen
module.set.date(date);
module.set.date(date, true, false);
} else {
module.set.focusDate(date);
}
Expand Down
Loading

0 comments on commit d0d40f8

Please sign in to comment.