From e49faf0c01dd1f19017edcfae8bae139fa5413f2 Mon Sep 17 00:00:00 2001 From: Andrew Gerasimovich Date: Mon, 23 Jul 2018 19:55:46 +0300 Subject: [PATCH 01/89] Fixed scrolling for mobile devices while using dimmer --- src/definitions/modules/dimmer.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/definitions/modules/dimmer.js b/src/definitions/modules/dimmer.js index bdfc39abb2..985d4f3c84 100755 --- a/src/definitions/modules/dimmer.js +++ b/src/definitions/modules/dimmer.js @@ -114,10 +114,6 @@ $.fn.dimmer = function(parameters) { bind: { events: function() { - if(module.is.page()) { - // touch events default to passive, due to changes in chrome to optimize mobile perf - $dimmable.get(0).addEventListener('touchmove', module.event.preventScroll, { passive: false }); - } if(settings.on == 'hover') { $dimmable .on('mouseenter' + eventNamespace, module.show) @@ -145,9 +141,6 @@ $.fn.dimmer = function(parameters) { unbind: { events: function() { - if(module.is.page()) { - $dimmable.get(0).removeEventListener('touchmove', module.event.preventScroll, { passive: false }); - } $module .removeData(moduleNamespace) ; @@ -204,6 +197,11 @@ $.fn.dimmer = function(parameters) { module.animate.show(callback); settings.onShow.call(element); settings.onChange.call(element); + + if(module.is.page()) { + // touch events default to passive, due to changes in chrome to optimize mobile perf + $dimmable.get(0).addEventListener('touchmove', module.event.preventScroll, { passive: false }); + } } else { module.debug('Dimmer is already shown or disabled'); @@ -220,6 +218,10 @@ $.fn.dimmer = function(parameters) { module.animate.hide(callback); settings.onHide.call(element); settings.onChange.call(element); + + if(module.is.page()) { + $dimmable.get(0).removeEventListener('touchmove', module.event.preventScroll, { passive: false }); + } } else { module.debug('Dimmer is not visible'); From 9707e40448212aa24ed74a58b838c14dceca4120 Mon Sep 17 00:00:00 2001 From: Jack Lukic Date: Sun, 19 Aug 2018 22:07:33 -0400 Subject: [PATCH 02/89] Working on legacy setting for modals --- src/definitions/modules/dimmer.js | 19 ++++++++++++++++++- src/definitions/modules/dimmer.less | 12 ++++++++++++ src/definitions/modules/modal.js | 9 +++++++++ src/definitions/modules/modal.less | 1 + 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/definitions/modules/dimmer.js b/src/definitions/modules/dimmer.js index bdfc39abb2..092cac2871 100755 --- a/src/definitions/modules/dimmer.js +++ b/src/definitions/modules/dimmer.js @@ -92,6 +92,10 @@ $.fn.dimmer = function(parameters) { module.bind.events(); module.set.dimmable(); + if(!module.can.useFlex()) { + module.debug('Absolutely positioned flex not supported. Using legacy positioning.'); + module.set.legacy(); + } module.instantiate(); }, @@ -248,7 +252,9 @@ $.fn.dimmer = function(parameters) { } $dimmer .transition({ - displayType : 'flex', + displayType : settings.useFlex + ? 'flex' + : 'block', animation : settings.transition + ' in', queue : false, duration : module.get.duration(), @@ -391,6 +397,10 @@ $.fn.dimmer = function(parameters) { }, can: { + useFlex: function() { + // test for IE11/edge + return true; + }, show: function() { return !$dimmer.hasClass(className.disabled); } @@ -415,6 +425,9 @@ $.fn.dimmer = function(parameters) { module.debug('Setting opacity to', opacity); $dimmer.css('background-color', color); }, + legacy: function() { + $dimmer.addClass(className.legacy); + }, active: function() { $dimmer.addClass(className.active); }, @@ -652,6 +665,9 @@ $.fn.dimmer.settings = { name : 'Dimmer', namespace : 'dimmer', + // whether should use flex layout + useFlex : 'auto', + silent : false, debug : false, verbose : false, @@ -700,6 +716,7 @@ $.fn.dimmer.settings = { dimmer : 'dimmer', disabled : 'disabled', hide : 'hide', + legacy : 'legacy', pageDimmer : 'page', show : 'show' }, diff --git a/src/definitions/modules/dimmer.less b/src/definitions/modules/dimmer.less index 3e534bc282..fb0ce54c5d 100755 --- a/src/definitions/modules/dimmer.less +++ b/src/definitions/modules/dimmer.less @@ -113,6 +113,18 @@ Variations *******************************/ + +/*-------------- + Legacy +---------------*/ + +/* Animating / Active / Visible */ +.dimmed.dimmable > .ui.animating.legacy.dimmer, +.dimmed.dimmable > .ui.visible.legacy.dimmer, +.ui.active.legacy.dimmer { + display: block; +} + /*-------------- Alignment ---------------*/ diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index b2ccea05e7..edac20513e 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -107,6 +107,7 @@ $.fn.modal = function(parameters) { dimmer: function() { var defaultSettings = { + flex : settings.flex, debug : settings.debug, variation : settings.centered ? false @@ -335,6 +336,9 @@ $.fn.modal = function(parameters) { else { if(settings.allowMultiple && settings.detachable) { $module.detach().appendTo($dimmer); + } + if(!module.can.useFlex()) { + } settings.onShow.call(element); if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) { @@ -564,6 +568,9 @@ $.fn.modal = function(parameters) { }, can: { + useFlex: function() { + return $dimmer.dimmer('can use flex'); + }, fit: function() { var contextHeight = module.cache.contextHeight, @@ -880,6 +887,8 @@ $.fn.modal.settings = { name : 'Modal', namespace : 'modal', + useFlex : 'auto', + silent : false, debug : false, verbose : false, diff --git a/src/definitions/modules/modal.less b/src/definitions/modules/modal.less index 6f0236ce76..0b59b5d61c 100755 --- a/src/definitions/modules/modal.less +++ b/src/definitions/modules/modal.less @@ -23,6 +23,7 @@ *******************************/ .ui.modal { + position: absolute; display: none; z-index: @zIndex; text-align: left; From e60921288810a60870f0676b9e65e8e4e06d9576 Mon Sep 17 00:00:00 2001 From: Jack Lukic Date: Sun, 19 Aug 2018 22:27:20 -0400 Subject: [PATCH 03/89] Finish adding useFlex setting for dimmer/modal --- RELEASE-NOTES.md | 11 +++++++++++ src/definitions/modules/dimmer.js | 16 ++++++++++++---- src/definitions/modules/dimmer.less | 6 ++++++ src/definitions/modules/modal.js | 25 +++++++++++++++++++++++-- 4 files changed, 52 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 96812b762d..c6a82c298d 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,5 +1,16 @@ ## RELEASE NOTES +### Version 2.3.4 - Aug xx, 2018 + +**Enhancements** + +- **Modal/Dimmer** - Modals and dimmers now include a new setting `useFlex` which defaults to `auto`. Modals and dimmers will automatically revert to using non-flex layouts when there may be layout issues with using flexbox. + +For example when `attachable: false` is used with a modal, or if IE11/Edge is used (Absolutely positioned elements inside flex containers in IE behave differently) + + + + ### Version 2.3.3 - June 18, 2018 **Bug Fixes** diff --git a/src/definitions/modules/dimmer.js b/src/definitions/modules/dimmer.js index 092cac2871..9c15779209 100755 --- a/src/definitions/modules/dimmer.js +++ b/src/definitions/modules/dimmer.js @@ -252,7 +252,7 @@ $.fn.dimmer = function(parameters) { } $dimmer .transition({ - displayType : settings.useFlex + displayType : module.can.useFlex() ? 'flex' : 'block', animation : settings.transition + ' in', @@ -299,7 +299,9 @@ $.fn.dimmer = function(parameters) { module.verbose('Hiding dimmer with css'); $dimmer .transition({ - displayType : 'flex', + displayType : module.can.useFlex() + ? 'flex' + : 'block', animation : settings.transition + ' out', queue : false, duration : module.get.duration(), @@ -361,6 +363,13 @@ $.fn.dimmer = function(parameters) { active: function() { return $dimmer.hasClass(className.active); }, + ie: function() { + var + isIE11 = (!(window.ActiveXObject) && 'ActiveXObject' in window), + isIE = ('ActiveXObject' in window) + ; + return (isIE11 || isIE); + }, animating: function() { return ( $dimmer.is(':animated') || $dimmer.hasClass(className.animating) ); }, @@ -398,8 +407,7 @@ $.fn.dimmer = function(parameters) { can: { useFlex: function() { - // test for IE11/edge - return true; + return !module.is.ie(); }, show: function() { return !$dimmer.hasClass(className.disabled); diff --git a/src/definitions/modules/dimmer.less b/src/definitions/modules/dimmer.less index fb0ce54c5d..24faa4680a 100755 --- a/src/definitions/modules/dimmer.less +++ b/src/definitions/modules/dimmer.less @@ -125,6 +125,12 @@ display: block; } +/* Resort to normal positioning */ +.ui.legacy.page.dimmer > .ui.modal { + top: 50%; + left: 50%; +} + /*-------------- Alignment ---------------*/ diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index edac20513e..8a654cee4d 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -168,6 +168,9 @@ $.fn.modal = function(parameters) { refresh: function() { module.remove.scrolling(); module.cacheSizes(); + if(!module.can.useFlex()) { + module.set.modalOffset(); + } module.set.screenHeight(); module.set.type(); }, @@ -326,6 +329,9 @@ $.fn.modal = function(parameters) { module.showDimmer(); module.cacheSizes(); + if(!module.can.useFlex()) { + module.set.modalOffset(); + } module.set.screenHeight(); module.set.type(); module.set.clickaway(); @@ -550,11 +556,13 @@ $.fn.modal = function(parameters) { $module.addClass(className.loading); var scrollHeight = $module.prop('scrollHeight'), + modalWidth = $module.outerWidth(), modalHeight = $module.outerHeight() ; if(module.cache === undefined || modalHeight !== 0) { module.cache = { pageHeight : $(document).outerHeight(), + width : modalWidth, height : modalHeight + settings.offset, scrollHeight : scrollHeight + settings.offset, contextHeight : (settings.context == 'body') @@ -569,7 +577,7 @@ $.fn.modal = function(parameters) { can: { useFlex: function() { - return $dimmer.dimmer('can use flex'); + return settings.detachable && $dimmer.dimmer('can use flex'); }, fit: function() { var @@ -633,6 +641,7 @@ $.fn.modal = function(parameters) { var defaultSettings = { debug : settings.debug, + useFlex : module.can.useFlex(), dimmerName : 'modals', closable : 'auto', variation : settings.centered @@ -664,6 +673,18 @@ $.fn.modal = function(parameters) { } $context.dimmer('setting', dimmerSettings); }, + modalOffset: function() { + var + width = module.cache.width, + height = module.cache.height + ; + $module + .css({ + marginTop: -(height / 2), + marginLeft: -(width / 2) + }) + ; + }, screenHeight: function() { if( module.can.fit() ) { $body.css('height', ''); @@ -888,6 +909,7 @@ $.fn.modal.settings = { namespace : 'modal', useFlex : 'auto', + offset : 0, silent : false, debug : false, @@ -918,7 +940,6 @@ $.fn.modal.settings = { queue : false, duration : 500, - offset : 0, transition : 'scale', // padding with edge of page From fa55d1f1081bc499dec9ceba39da8a5c931c6949 Mon Sep 17 00:00:00 2001 From: Jack Lukic Date: Sun, 19 Aug 2018 22:38:32 -0400 Subject: [PATCH 04/89] Finish adding legacy settings --- src/definitions/modules/dimmer.js | 22 ++++++---------------- src/definitions/modules/modal.js | 16 ++++++++++------ 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/definitions/modules/dimmer.js b/src/definitions/modules/dimmer.js index 9c15779209..232854e127 100755 --- a/src/definitions/modules/dimmer.js +++ b/src/definitions/modules/dimmer.js @@ -92,7 +92,7 @@ $.fn.dimmer = function(parameters) { module.bind.events(); module.set.dimmable(); - if(!module.can.useFlex()) { + if(!settings.useFlex) { module.debug('Absolutely positioned flex not supported. Using legacy positioning.'); module.set.legacy(); } @@ -252,7 +252,7 @@ $.fn.dimmer = function(parameters) { } $dimmer .transition({ - displayType : module.can.useFlex() + displayType : settings.useFlex ? 'flex' : 'block', animation : settings.transition + ' in', @@ -299,7 +299,7 @@ $.fn.dimmer = function(parameters) { module.verbose('Hiding dimmer with css'); $dimmer .transition({ - displayType : module.can.useFlex() + displayType : settings.useFlex ? 'flex' : 'block', animation : settings.transition + ' out', @@ -363,13 +363,6 @@ $.fn.dimmer = function(parameters) { active: function() { return $dimmer.hasClass(className.active); }, - ie: function() { - var - isIE11 = (!(window.ActiveXObject) && 'ActiveXObject' in window), - isIE = ('ActiveXObject' in window) - ; - return (isIE11 || isIE); - }, animating: function() { return ( $dimmer.is(':animated') || $dimmer.hasClass(className.animating) ); }, @@ -406,9 +399,6 @@ $.fn.dimmer = function(parameters) { }, can: { - useFlex: function() { - return !module.is.ie(); - }, show: function() { return !$dimmer.hasClass(className.disabled); } @@ -673,14 +663,14 @@ $.fn.dimmer.settings = { name : 'Dimmer', namespace : 'dimmer', - // whether should use flex layout - useFlex : 'auto', - silent : false, debug : false, verbose : false, performance : true, + // whether should use flex layout + useFlex : true, + // name to distinguish between multiple dimmers in context dimmerName : false, diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index 8a654cee4d..6c55c2e6d5 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -107,7 +107,7 @@ $.fn.modal = function(parameters) { dimmer: function() { var defaultSettings = { - flex : settings.flex, + useFlex : module.can.useFlex(), debug : settings.debug, variation : settings.centered ? false @@ -342,9 +342,6 @@ $.fn.modal = function(parameters) { else { if(settings.allowMultiple && settings.detachable) { $module.detach().appendTo($dimmer); - } - if(!module.can.useFlex()) { - } settings.onShow.call(element); if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) { @@ -577,7 +574,7 @@ $.fn.modal = function(parameters) { can: { useFlex: function() { - return settings.detachable && $dimmer.dimmer('can use flex'); + return settings.detachable && !module.is.ie(); }, fit: function() { var @@ -600,6 +597,13 @@ $.fn.modal = function(parameters) { active: function() { return $module.hasClass(className.active); }, + ie: function() { + var + isIE11 = (!(window.ActiveXObject) && 'ActiveXObject' in window), + isIE = ('ActiveXObject' in window) + ; + return (isIE11 || isIE); + }, animating: function() { return $module.transition('is supported') ? $module.transition('is animating') @@ -641,7 +645,6 @@ $.fn.modal = function(parameters) { var defaultSettings = { debug : settings.debug, - useFlex : module.can.useFlex(), dimmerName : 'modals', closable : 'auto', variation : settings.centered @@ -684,6 +687,7 @@ $.fn.modal = function(parameters) { marginLeft: -(width / 2) }) ; + module.verbose('Setting modal offset for legacy mode'); }, screenHeight: function() { if( module.can.fit() ) { From cddcc364c35c4d66f5e8e7a299562b68af1ea803 Mon Sep 17 00:00:00 2001 From: Jack Lukic Date: Sun, 19 Aug 2018 22:40:19 -0400 Subject: [PATCH 05/89] Respect useFlex settinng if its a boolean --- src/definitions/modules/modal.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index 6c55c2e6d5..b0432a1a74 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -574,7 +574,10 @@ $.fn.modal = function(parameters) { can: { useFlex: function() { - return settings.detachable && !module.is.ie(); + return (settings.useFlex == 'auto') + ? settings.detachable && !module.is.ie() + : settings.useFlex + ; }, fit: function() { var From bbad43026d0d0c6f52a62d2d1260039f4657b397 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 3 Sep 2018 15:37:25 -0700 Subject: [PATCH 06/89] Finish refactor of modal to support legacy positioning for IE11 --- src/definitions/modules/dimmer.js | 15 +++++++++++---- src/definitions/modules/dimmer.less | 6 ------ src/definitions/modules/modal.js | 26 ++++++++++++++++++-------- src/definitions/modules/modal.less | 7 +++++++ 4 files changed, 36 insertions(+), 18 deletions(-) diff --git a/src/definitions/modules/dimmer.js b/src/definitions/modules/dimmer.js index 232854e127..f622e925a5 100755 --- a/src/definitions/modules/dimmer.js +++ b/src/definitions/modules/dimmer.js @@ -92,10 +92,6 @@ $.fn.dimmer = function(parameters) { module.bind.events(); module.set.dimmable(); - if(!settings.useFlex) { - module.debug('Absolutely positioned flex not supported. Using legacy positioning.'); - module.set.legacy(); - } module.instantiate(); }, @@ -247,6 +243,14 @@ $.fn.dimmer = function(parameters) { : function(){} ; if(settings.useCSS && $.fn.transition !== undefined && $dimmer.transition('is supported')) { + if(settings.useFlex) { + module.debug('Using flex dimmer'); + module.remove.legacy(); + } + else { + module.debug('Using legacy non-flex dimmer'); + module.set.legacy(); + } if(settings.opacity !== 'auto') { module.set.opacity(); } @@ -455,6 +459,9 @@ $.fn.dimmer = function(parameters) { .removeClass(className.active) ; }, + legacy: function() { + $dimmer.removeClass(className.legacy); + }, dimmed: function() { $dimmable.removeClass(className.dimmed); }, diff --git a/src/definitions/modules/dimmer.less b/src/definitions/modules/dimmer.less index 24faa4680a..fb0ce54c5d 100755 --- a/src/definitions/modules/dimmer.less +++ b/src/definitions/modules/dimmer.less @@ -125,12 +125,6 @@ display: block; } -/* Resort to normal positioning */ -.ui.legacy.page.dimmer > .ui.modal { - top: 50%; - left: 50%; -} - /*-------------- Alignment ---------------*/ diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index b0432a1a74..f281a3b083 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -107,7 +107,6 @@ $.fn.modal = function(parameters) { dimmer: function() { var defaultSettings = { - useFlex : module.can.useFlex(), debug : settings.debug, variation : settings.centered ? false @@ -133,7 +132,7 @@ $.fn.modal = function(parameters) { $dimmer = $dimmable.dimmer('get dimmer'); }, id: function() { - id = (Math.random().toString(16) + '000000000').substr(2,8); + id = (Math.random().toString(16) + '000000000').substr(2, 8); elementEventNamespace = '.' + id; module.verbose('Creating unique id for element', id); } @@ -216,7 +215,7 @@ $.fn.modal = function(parameters) { get: { id: function() { - return (Math.random().toString(16) + '000000000').substr(2,8); + return (Math.random().toString(16) + '000000000').substr(2, 8); } }, @@ -326,11 +325,15 @@ $.fn.modal = function(parameters) { : function(){} ; if( module.is.animating() || !module.is.active() ) { - module.showDimmer(); module.cacheSizes(); - if(!module.can.useFlex()) { + if(module.can.useFlex()) { + module.remove.legacy(); + } + else { + module.set.legacy(); module.set.modalOffset(); + module.debug('Using non-flex legacy modal positioning.'); } module.set.screenHeight(); module.set.type(); @@ -520,6 +523,9 @@ $.fn.modal = function(parameters) { active: function() { $module.removeClass(className.active); }, + legacy: function() { + $module.removeClass(className.legacy); + }, clickaway: function() { $dimmer .off('click' + elementEventNamespace) @@ -618,7 +624,7 @@ $.fn.modal = function(parameters) { }, modernBrowser: function() { // appName for IE11 reports 'Netscape' can no longer use - return !(window.ActiveXObject || "ActiveXObject" in window); + return !(window.ActiveXObject || 'ActiveXObject' in window); } }, @@ -650,10 +656,10 @@ $.fn.modal = function(parameters) { debug : settings.debug, dimmerName : 'modals', closable : 'auto', + useFlex : module.can.useFlex(), variation : settings.centered ? false - : 'top aligned' - , + : 'top aligned', duration : { show : settings.duration, hide : settings.duration @@ -710,6 +716,9 @@ $.fn.modal = function(parameters) { $dimmable.addClass(className.scrolling); $module.addClass(className.scrolling); }, + legacy: function() { + $module.addClass(className.legacy); + }, type: function() { if(module.can.fit()) { module.verbose('Modal fits on screen'); @@ -986,6 +995,7 @@ $.fn.modal.settings = { animating : 'animating', blurring : 'blurring', inverted : 'inverted', + legacy : 'legacy', loading : 'loading', scrolling : 'scrolling', undetached : 'undetached' diff --git a/src/definitions/modules/modal.less b/src/definitions/modules/modal.less index 0b59b5d61c..03e12b9543 100755 --- a/src/definitions/modules/modal.less +++ b/src/definitions/modules/modal.less @@ -310,6 +310,13 @@ color: @basicInvertedModalHeaderColor; } +/* Resort to margin positioning if legacy */ +.ui.legacy.modal, +.ui.legacy.page.dimmer > .ui.modal { + top: 50%; + left: 50%; +} + /* Tablet and Mobile */ @media only screen and (max-width : @largestTabletScreen) { .ui.basic.modal > .close { From 06f2213d4cff0e3d4396f31892a0b98b0b62e165 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 3 Sep 2018 15:49:39 -0700 Subject: [PATCH 07/89] #6218 - Allow popup to use settings.closable without onclick --- src/definitions/modules/popup.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/definitions/modules/popup.js b/src/definitions/modules/popup.js index 26e59cb1f3..2209e9c40c 100644 --- a/src/definitions/modules/popup.js +++ b/src/definitions/modules/popup.js @@ -1015,7 +1015,7 @@ $.fn.popup = function(parameters) { if(settings.on == 'hover' && openedWithTouch) { module.bind.touchClose(); } - if(settings.on == 'click' && settings.closable) { + if(module.should.useClickaway()) { module.bind.clickaway(); } }, @@ -1073,6 +1073,12 @@ $.fn.popup = function(parameters) { should: { centerArrow: function(calculations) { return !module.is.basic() && calculations.target.width <= (settings.arrowPixelsFromEdge * 2); + }, + useClickaway: function() { + return (settings.closable == 'auto') + ? (settings.on == 'click') + : settings.closable + ; } }, From 588ef9b4cf0614c7caf4879003073f58473eb602 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 3 Sep 2018 15:54:47 -0700 Subject: [PATCH 08/89] #6218 - Reuse closable pattern from dimmer --- src/definitions/modules/popup.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/definitions/modules/popup.js b/src/definitions/modules/popup.js index 2209e9c40c..f8a201ce0a 100644 --- a/src/definitions/modules/popup.js +++ b/src/definitions/modules/popup.js @@ -1012,12 +1012,12 @@ $.fn.popup = function(parameters) { if(settings.hideOnScroll === true || (settings.hideOnScroll == 'auto' && settings.on != 'click')) { module.bind.closeOnScroll(); } - if(settings.on == 'hover' && openedWithTouch) { - module.bind.touchClose(); - } - if(module.should.useClickaway()) { + if(module.is.closable()) { module.bind.clickaway(); } + else if(settings.on == 'hover' && openedWithTouch) { + module.bind.touchClose(); + } }, closeOnScroll: function() { module.verbose('Binding scroll close event to document'); @@ -1074,15 +1074,18 @@ $.fn.popup = function(parameters) { centerArrow: function(calculations) { return !module.is.basic() && calculations.target.width <= (settings.arrowPixelsFromEdge * 2); }, - useClickaway: function() { - return (settings.closable == 'auto') - ? (settings.on == 'click') - : settings.closable - ; - } }, is: { + closable: function() { + if(settings.closable == 'auto') { + if(settings.on == 'hover') { + return false; + } + return true; + } + return settings.closable; + }, offstage: function(distanceFromBoundary, position) { var offstage = [] From 0a560d8285a3256243c7c02b8336700b15bc9c97 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 3 Sep 2018 18:21:43 -0700 Subject: [PATCH 09/89] Work on content loader --- src/definitions/elements/loader.less | 204 +++++++++++++++++++ src/themes/default/elements/loader.variables | 12 ++ 2 files changed, 216 insertions(+) diff --git a/src/definitions/elements/loader.less b/src/definitions/elements/loader.less index 40d5de67b3..59c56119dc 100755 --- a/src/definitions/elements/loader.less +++ b/src/definitions/elements/loader.less @@ -162,6 +162,210 @@ Types *******************************/ +/*------------------- + Content +--------------------*/ + +/* Placeholder Paragraph */ +.ui.content.loader { + position: relative; + left: 0px; + top: 0px; + transform: none; + width: auto; + height: 96px; + margin: 0em; + will-change: background-position, transform; + overflow: hidden; + backface-visibility: hidden; + animation: placeholderShimmer 1s linear; + animation-iteration-count: infinite; + background-color: @white; + background-image: linear-gradient(to right, + #EEEEEE 0%, + #DDDDDD 15%, + #EEEEEE 30% + ); + background-size: 800px 104px; + max-width: 420px; +} +.ui.content.loader .line { + background-color: @white; +} +.ui.inverted.content.loader { + background-color: @black; + background-image: linear-gradient(to right, + #222222 0%, + #333333 15%, + #222222 30% + ); +} +.ui.inverted.content.loader .line { + background-color: @black; +} +.ui.content.loader:not(:first-child) { + margin-top: 1rem; +} +.ui.content.loader:not(:last-child) { + margin-bottom: 1rem; +} +.ui.content.loader:before, +.ui.content.loader:after { + display: none; +} +@keyframes placeholderShimmer{ + 0% { + background-position: -500px 0 + } + 100% { + background-position: 500px 0 + } +} +.ui.content.loader + .ui.content.loader { + margin-top: 2rem; + animation-delay: 0.1s; +} +.ui.content.loader + .ui.content.loader + .ui.content.loader { + animation-delay: 0.2s; +} +.ui.content.loader + .ui.content.loader + .ui.content.loader + .ui.content.loader { + animation-delay: 0.3s; +} +.ui.content.loader + .ui.content.loader + .ui.content.loader + .ui.content.loader + .ui.content.loader { + animation-delay: 0.4s; +} + +/* Lines */ +.ui.content.loader .line { + position: relative; + height: @contentLineDistance; +} +.ui.content.loader .line:before, +.ui.content.loader .line:after { + top: 100%; + position: absolute; + height: @contentLineHeight; + content: ''; + background-color: inherit; +} +.ui.content.loader .line:before { + left: 0px; +} +.ui.content.loader .line:after { + right: 0px; +} + +/* Both Lines */ +.ui.content.loader .header { + position: relative; + overflow: hidden; +} +.ui.content.loader .header .line { + margin-left: @contentImageWidth; +} +.ui.content.loader .header .line:before { + width: @contentTextIndent; +} + +/* Line 1 (Outdent from right) */ +.ui.content.loader .header .line:after { + width: @contentLineOneOutdent; +} +/* Line 2 (Outdent from right) */ +.ui.content.loader .header .line:nth-child(2) { + margin-top: @contentLineHeight; + margin-bottom: @contentLineTotalHeight; +} +.ui.content.loader .header .line:nth-child(2):after { + width: @contentLineTwoOutdent; +} +/* Space below Line 2 */ +.ui.content.loader .header:before { + background-color: @white; + position: absolute; + top: auto; + right: 0px; + bottom: 0px; + width: ~"calc(100% - "(@contentImageWidth)~")"; + height: @contentLineDistance; + content: ''; +} + + +/* Line 2 (Negative Space) */ + +/* +.ui.content.loader .header .line:first-child, +.ui.content.loader .header .line:last-child, +.ui.content.loader .subheader .line:last-child { + top: 0; + left: 40px; + right: 0; + height: 10px; +} + +.ui.content.loader .header .line:nth-child(2), +.ui.content.loader .header .line:nth-child(3), +.ui.content.loader .subheader .line:first-child, +.ui.content.loader .subheader .line:nth-child(2) { + top: 10px; + left: 40px; + height: 8px; + width: 10px; +} +.ui.content.loader .header .line:last-child { + top: 18px; + height: 6px; +} +.ui.content.loader .subheader .line:first-child, +.ui.content.loader .subheader .line:nth-child(2) { + top: 24px; + height: 6px; +} +.ui.content.loader .header .line:nth-child(3), +.ui.content.loader .subheader .line:nth-child(2) { + width: 120px; + left: auto; + right: 0px; +} +.ui.content.loader .subheader .line:nth-child(2) { + width: 50px; +} +.ui.content.loader .subheader .line:last-child { + top: 30px; + height: 10px; +} +.ui.content.loader .line { + top: 40px; + left: 0; + right: 0; + height: 6px; +} +.ui.content.loader .content .line:first-child { + height: 20px; +} +.ui.content.loader .content .line:nth-child(2n) { + width: auto; + left: 380px; + right: 0; + top: 60px; + height: 8px; +} +.ui.content.loader .content .line:nth-child(3) { + top: 68px; +} +.ui.content.loader .content .line:nth-child(4) { + left: 420px; + top: 74px; +} +.ui.content.loader .content .line:nth-child(5) { + top: 82px; +} +.ui.content.loader .content .line:nth-child(6) { + left: 300px; + top: 88px; +}*/ + /*------------------- Text diff --git a/src/themes/default/elements/loader.variables b/src/themes/default/elements/loader.variables index 5cb1b9d3ee..f886a31fe4 100644 --- a/src/themes/default/elements/loader.variables +++ b/src/themes/default/elements/loader.variables @@ -29,6 +29,18 @@ @loaderTextColor: @textColor; @invertedLoaderTextColor: @invertedTextColor; +/* Content */ + +@contentImageWidth: 40px; +@contentTextIndent: 10px; + +@contentLineDistance: 8px; +@contentLineHeight: 4px; +@contentLineTotalHeight: (@contentLineDistance + @contentLineHeight); + +@contentLineOneOutdent: 0px; +@contentLineTwoOutdent: 120px; + /*------------------- States --------------------*/ From d382de69fc34f0e805a38551b8d65eff0b447b22 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 3 Sep 2018 20:11:01 -0700 Subject: [PATCH 10/89] Finish content loader --- src/definitions/elements/loader.less | 193 +++++++------------ src/themes/default/elements/loader.variables | 46 +++-- 2 files changed, 110 insertions(+), 129 deletions(-) diff --git a/src/definitions/elements/loader.less b/src/definitions/elements/loader.less index 59c56119dc..998f9a1f2e 100755 --- a/src/definitions/elements/loader.less +++ b/src/definitions/elements/loader.less @@ -173,52 +173,35 @@ top: 0px; transform: none; width: auto; - height: 96px; + height: auto; margin: 0em; will-change: background-position, transform; overflow: hidden; backface-visibility: hidden; - animation: placeholderShimmer 1s linear; + animation: placeholderShimmer @contentLoadingAnimationDuration linear; animation-iteration-count: infinite; background-color: @white; - background-image: linear-gradient(to right, - #EEEEEE 0%, - #DDDDDD 15%, - #EEEEEE 30% - ); - background-size: 800px 104px; - max-width: 420px; + background-image: @contentLoadingGradient; + background-size: @contentLoadingGradientWidth 100%; + max-width: @contentLoaderMaxWidth; } -.ui.content.loader .line { + +.ui.content.loader, +.ui.content.loader .line, +.ui.content.loader .image.header:after { background-color: @white; } -.ui.inverted.content.loader { - background-color: @black; - background-image: linear-gradient(to right, - #222222 0%, - #333333 15%, - #222222 30% - ); -} -.ui.inverted.content.loader .line { - background-color: @black; -} -.ui.content.loader:not(:first-child) { - margin-top: 1rem; -} -.ui.content.loader:not(:last-child) { - margin-bottom: 1rem; -} + .ui.content.loader:before, .ui.content.loader:after { display: none; } @keyframes placeholderShimmer{ 0% { - background-position: -500px 0 + background-position: -@contentLoadingGradientWidth 0 } 100% { - background-position: 500px 0 + background-position: @contentLoadingGradientWidth 0 } } .ui.content.loader + .ui.content.loader { @@ -238,13 +221,15 @@ /* Lines */ .ui.content.loader .line { position: relative; - height: @contentLineDistance; + height: @contentLineMargin; +} +.ui.content.loader .line:first-child { + height: 0px; } .ui.content.loader .line:before, .ui.content.loader .line:after { top: 100%; position: absolute; - height: @contentLineHeight; content: ''; background-color: inherit; } @@ -255,116 +240,88 @@ right: 0px; } -/* Both Lines */ +/* Any Lines */ +.ui.content.loader .line { + margin-bottom: @contentLineHeight; +} +.ui.content.loader .line:before, +.ui.content.loader .line:after { + height: @contentLineHeight; +} +.ui.content.loader .line:not(:first-child) { + margin-top: @contentLineHeight; +} + +/* Header Image + 2 Lines */ .ui.content.loader .header { position: relative; overflow: hidden; } -.ui.content.loader .header .line { - margin-left: @contentImageWidth; -} -.ui.content.loader .header .line:before { - width: @contentTextIndent; -} -/* Line 1 (Outdent from right) */ -.ui.content.loader .header .line:after { +/* Line Outdent */ +.ui.content.loader .line:nth-child(1):after { width: @contentLineOneOutdent; } -/* Line 2 (Outdent from right) */ -.ui.content.loader .header .line:nth-child(2) { - margin-top: @contentLineHeight; - margin-bottom: @contentLineTotalHeight; -} -.ui.content.loader .header .line:nth-child(2):after { +.ui.content.loader .line:nth-child(2):after { width: @contentLineTwoOutdent; } -/* Space below Line 2 */ -.ui.content.loader .header:before { - background-color: @white; - position: absolute; - top: auto; - right: 0px; - bottom: 0px; - width: ~"calc(100% - "(@contentImageWidth)~")"; - height: @contentLineDistance; - content: ''; +.ui.content.loader .line:nth-child(3):after { + width: @contentLineThreeOutdent; } - - -/* Line 2 (Negative Space) */ - -/* -.ui.content.loader .header .line:first-child, -.ui.content.loader .header .line:last-child, -.ui.content.loader .subheader .line:last-child { - top: 0; - left: 40px; - right: 0; - height: 10px; +.ui.content.loader .line:nth-child(4):after { + width: @contentLineFourOutdent; } - -.ui.content.loader .header .line:nth-child(2), -.ui.content.loader .header .line:nth-child(3), -.ui.content.loader .subheader .line:first-child, -.ui.content.loader .subheader .line:nth-child(2) { - top: 10px; - left: 40px; - height: 8px; - width: 10px; +.ui.content.loader .line:nth-child(5):after { + width: @contentLineFiveOutdent; } -.ui.content.loader .header .line:last-child { - top: 18px; - height: 6px; + +/* Header Line 1 & 2*/ +.ui.content.loader .header .line { + margin-bottom: @contentHeaderLineHeight; } -.ui.content.loader .subheader .line:first-child, -.ui.content.loader .subheader .line:nth-child(2) { - top: 24px; - height: 6px; +.ui.content.loader .header .line:before, +.ui.content.loader .header .line:after { + height: @contentHeaderLineHeight; } -.ui.content.loader .header .line:nth-child(3), -.ui.content.loader .subheader .line:nth-child(2) { - width: 120px; - left: auto; - right: 0px; +.ui.content.loader .header .line:not(:first-child) { + margin-top: @contentHeaderLineHeight; } -.ui.content.loader .subheader .line:nth-child(2) { - width: 50px; +.ui.content.loader .header .line:after { + width: @contentHeaderLineOneOutdent; } -.ui.content.loader .subheader .line:last-child { - top: 30px; - height: 10px; +.ui.content.loader .header .line:nth-child(2):after { + width: @contentHeaderLineTwoOutdent; } -.ui.content.loader .line { - top: 40px; - left: 0; - right: 0; - height: 6px; + +/* Image Header */ +.ui.content.loader .image.header .line { + margin-left: @contentImageWidth; } -.ui.content.loader .content .line:first-child { - height: 20px; +.ui.content.loader .image.header .line:before { + width: @contentImageTextIndent; } -.ui.content.loader .content .line:nth-child(2n) { - width: auto; - left: 380px; - right: 0; - top: 60px; - height: 8px; +.ui.content.loader .image.header:after { + display: block; + height: @contentLineMargin; + content: ''; + margin-left: @contentImageWidth; } -.ui.content.loader .content .line:nth-child(3) { - top: 68px; + +/* Paragraph */ +.ui.content.loader .paragraph + .paragraph .line:first-child, +.ui.content.loader .header + .paragraph .line:first-child { + height: @contentParagraphMarginTop; } -.ui.content.loader .content .line:nth-child(4) { - left: 420px; - top: 74px; + +/* Inverted Content Loader */ +.ui.inverted.content.loader { + background-image: @contentInvertedLoadingGradient; } -.ui.content.loader .content .line:nth-child(5) { - top: 82px; +.ui.inverted.content.loader, +.ui.inverted.content.loader .line, +.ui.inverted.content.loader .image.header:after { + background-color: @black; } -.ui.content.loader .content .line:nth-child(6) { - left: 300px; - top: 88px; -}*/ /*------------------- diff --git a/src/themes/default/elements/loader.variables b/src/themes/default/elements/loader.variables index f886a31fe4..3edc549b1c 100644 --- a/src/themes/default/elements/loader.variables +++ b/src/themes/default/elements/loader.variables @@ -25,21 +25,45 @@ --------------------*/ /* Text */ +@contentLoaderMaxWidth: 30rem; @textDistance: @relativeMini; @loaderTextColor: @textColor; @invertedLoaderTextColor: @invertedTextColor; -/* Content */ - -@contentImageWidth: 40px; -@contentTextIndent: 10px; - -@contentLineDistance: 8px; -@contentLineHeight: 4px; -@contentLineTotalHeight: (@contentLineDistance + @contentLineHeight); - -@contentLineOneOutdent: 0px; -@contentLineTwoOutdent: 120px; +/* Content Loader Lines */ +@contentLineMargin: 12px; +@contentHeaderLineHeight: 9px; +@contentLineHeight: 7px; +@contentParagraphLineHeight: @contentLineHeight; + +/* Header Image */ +@contentImageWidth: 50px; +@contentImageTextIndent: 10px; + +/* Paragraph */ +@contentHeaderLineOneOutdent: 0px; +@contentHeaderLineTwoOutdent: 120px; +@contentParagraphMarginTop: 20px; + +@contentLineOneOutdent: 4rem; +@contentLineTwoOutdent: 7rem; +@contentLineThreeOutdent: 2rem; +@contentLineFourOutdent: 6rem; +@contentLineFiveOutdent: 10rem; + +/* Glow Gradient */ +@contentLoadingAnimationDuration: 2s; +@contentLoadingGradientWidth: 1200px; +@contentLoadingGradient: linear-gradient(to right, + #EEEEEE 0%, + #DDDDDD 15%, + #EEEEEE 30% +); +@contentInvertedLoadingGradient: linear-gradient(to right, + #222222 0%, + #333333 15%, + #222222 30% +); /*------------------- States From a0366085fc4910eb304af6155dfefc2bf4200fc3 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 3 Sep 2018 21:25:32 -0700 Subject: [PATCH 11/89] Finish content loader images --- src/definitions/elements/loader.less | 23 +++++++++++++++----- src/definitions/modules/search.less | 2 ++ src/themes/default/elements/loader.variables | 6 ++++- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/definitions/elements/loader.less b/src/definitions/elements/loader.less index 998f9a1f2e..0462bf9269 100755 --- a/src/definitions/elements/loader.less +++ b/src/definitions/elements/loader.less @@ -187,8 +187,10 @@ } .ui.content.loader, +.ui.content.loader > :before, +.ui.content.loader .image.header:after, .ui.content.loader .line, -.ui.content.loader .image.header:after { +.ui.content.loader .line:after { background-color: @white; } @@ -218,6 +220,11 @@ animation-delay: 0.4s; } +/* Image */ +.ui.content.loader .image:not(.header) { + height: @contentImageHeight; +} + /* Lines */ .ui.content.loader .line { position: relative; @@ -308,9 +315,12 @@ } /* Paragraph */ -.ui.content.loader .paragraph + .paragraph .line:first-child, -.ui.content.loader .header + .paragraph .line:first-child { - height: @contentParagraphMarginTop; +.ui.content.loader .image:not(:first-child):before, +.ui.content.loader .paragraph:not(:first-child):before, +.ui.content.loader .header:not(:first-child):before { + height: @contentSpacing; + content: ''; + display: block; } /* Inverted Content Loader */ @@ -318,12 +328,15 @@ background-image: @contentInvertedLoadingGradient; } .ui.inverted.content.loader, +.ui.inverted.content.loader > :before, +.ui.inverted.content.loader .image.header:after, .ui.inverted.content.loader .line, -.ui.inverted.content.loader .image.header:after { +.ui.inverted.content.loader .line:after { background-color: @black; } + /*------------------- Text --------------------*/ diff --git a/src/definitions/modules/search.less b/src/definitions/modules/search.less index 06e7eced14..fc34dcfaac 100755 --- a/src/definitions/modules/search.less +++ b/src/definitions/modules/search.less @@ -72,6 +72,8 @@ left: 0%; transform-origin: center top; white-space: normal; + text-align: left; + text-transform: none; background: @resultsBackground; diff --git a/src/themes/default/elements/loader.variables b/src/themes/default/elements/loader.variables index 3edc549b1c..0d240ffb62 100644 --- a/src/themes/default/elements/loader.variables +++ b/src/themes/default/elements/loader.variables @@ -30,12 +30,17 @@ @loaderTextColor: @textColor; @invertedLoaderTextColor: @invertedTextColor; +@contentSpacing: 20px; + /* Content Loader Lines */ @contentLineMargin: 12px; @contentHeaderLineHeight: 9px; @contentLineHeight: 7px; @contentParagraphLineHeight: @contentLineHeight; +/* Image */ +@contentImageHeight: 100px; + /* Header Image */ @contentImageWidth: 50px; @contentImageTextIndent: 10px; @@ -43,7 +48,6 @@ /* Paragraph */ @contentHeaderLineOneOutdent: 0px; @contentHeaderLineTwoOutdent: 120px; -@contentParagraphMarginTop: 20px; @contentLineOneOutdent: 4rem; @contentLineTwoOutdent: 7rem; From bb0b9b90886a661456d17f90a36ed39d807becdd Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 3 Sep 2018 21:25:44 -0700 Subject: [PATCH 12/89] Add rlsnotes and placeholder segment --- RELEASE-NOTES.md | 8 ++- src/definitions/elements/segment.less | 49 +++++++++++++++++++ src/themes/default/elements/segment.variables | 37 +++++++++----- 3 files changed, 80 insertions(+), 14 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index c6a82c298d..17266724f2 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -2,12 +2,16 @@ ### Version 2.3.4 - Aug xx, 2018 -**Enhancements** - +**Major Enhancements** - **Modal/Dimmer** - Modals and dimmers now include a new setting `useFlex` which defaults to `auto`. Modals and dimmers will automatically revert to using non-flex layouts when there may be layout issues with using flexbox. For example when `attachable: false` is used with a modal, or if IE11/Edge is used (Absolutely positioned elements inside flex containers in IE behave differently) +**New UI** + +- **Segment** - Segment now include a `placeholder` type, which can be used to save place for content when content is empty. + +- **Loader** - Loader now includes `content loader` which let you specify arbitrary mocked up content to appear before content loads. diff --git a/src/definitions/elements/segment.less b/src/definitions/elements/segment.less index 0294551da3..7a7337e07f 100755 --- a/src/definitions/elements/segment.less +++ b/src/definitions/elements/segment.less @@ -110,6 +110,55 @@ Types *******************************/ + +/*------------------- + Placeholder +--------------------*/ + +.ui.placeholder.segment { + display: flex; + flex-direction: column; + justify-content: center; + align-items: stretch; + padding: @placeholderPadding; + min-height: @placeholderMinHeight; + background: @placeholderBackground; + border-color: @placeholderBorderColor; + box-shadow: @placeholderBoxShadow; +} + +.ui.placeholder.segment .button, +.ui.placeholder.segment textarea { + display: block; +} +.ui.placeholder.segment .button, +.ui.placeholder.segment .field, +.ui.placeholder.segment textarea, +.ui.placeholder.segment > .ui.input { + max-width: 300px; + margin-left: auto; + margin-right: auto; +} +.ui.placeholder.segment .column .button, +.ui.placeholder.segment .column .field, +.ui.placeholder.segment .column textarea, +.ui.placeholder.segment .column > .ui.input { + max-width: 250px; +} + +.ui.placeholder.segment > .inline { + align-self: center; +} +.ui.placeholder.segment > .inline > .button { + display: inline-block; + width: auto; + margin: 0px @5px 0px 0px; +} +.ui.placeholder.segment > .inline > .button:last-child { + margin-right: 0px; +} + + /*------------------- Piled --------------------*/ diff --git a/src/themes/default/elements/segment.variables b/src/themes/default/elements/segment.variables index 16a545e665..510751e137 100644 --- a/src/themes/default/elements/segment.variables +++ b/src/themes/default/elements/segment.variables @@ -45,22 +45,17 @@ @pageGridMargin: (2 * @verticalPadding); /******************************* - States + Types *******************************/ -/* Loading Dimmer */ -@loaderDimmerColor: rgba(255, 255, 255, 0.8); -@loaderDimmerZIndex: 100; - -/* Loading Spinner */ -@loaderSize: 3em; -@loaderLineZIndex: 101; +/* Placeholder */ +@placeholderBackground: @offWhite; +@placeholderPadding: @padding; +@placeholderBorderColor: @borderColor; +@placeholderBoxShadow: 0px 2px 25px 0 rgba(34, 36, 38, 0.05) inset; +@placeholderMinHeight: 18rem; -/******************************* - Variations -*******************************/ - /* Piled */ @piledZIndex: auto; @piledMargin: 3em; @@ -77,6 +72,24 @@ @stackedPadding: @verticalPadding + (0.4em); @tallStackedPadding: @verticalPadding + (0.8em); +/******************************* + States +*******************************/ + +/* Loading Dimmer */ +@loaderDimmerColor: rgba(255, 255, 255, 0.8); +@loaderDimmerZIndex: 100; + +/* Loading Spinner */ +@loaderSize: 3em; +@loaderLineZIndex: 101; + + +/******************************* + Variations +*******************************/ + + /* Raised */ @raisedBoxShadow: @floatingShadow; From 1a64cac5261445c38d28fac594ffcaea4250a838 Mon Sep 17 00:00:00 2001 From: ColinFrick Date: Tue, 4 Sep 2018 08:08:50 +0200 Subject: [PATCH 13/89] fix(accordion): Modify "not active" rule to only hide siblings of the title inside the accordion Closes #102 --- src/definitions/modules/accordion.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/definitions/modules/accordion.less b/src/definitions/modules/accordion.less index f9502eb4a3..21e3315cba 100755 --- a/src/definitions/modules/accordion.less +++ b/src/definitions/modules/accordion.less @@ -183,8 +183,8 @@ Not Active ---------------*/ -.ui.accordion .content:not(.active), -.ui.accordion .accordion .content:not(.active) { +.ui.accordion .title ~ .content:not(.active), +.ui.accordion .accordion .title ~ .content:not(.active) { display: none; } From 47406ecdc8852dab2d34cf3615c71d220f6cc3ad Mon Sep 17 00:00:00 2001 From: Pierrick Prudhomme Date: Tue, 4 Sep 2018 10:38:20 +0200 Subject: [PATCH 14/89] [Menu] Fix the inconsistent icon-text spacing in labeled icon menu dropdown --- src/definitions/collections/menu.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/definitions/collections/menu.less b/src/definitions/collections/menu.less index 24fdd9cf39..c5e2d3b22e 100755 --- a/src/definitions/collections/menu.less +++ b/src/definitions/collections/menu.less @@ -1212,7 +1212,7 @@ Floated Menu / Item } /* Icon */ -.ui.labeled.icon.menu .item > .icon:not(.dropdown) { +.ui.labeled.icon.menu > .item > .icon:not(.dropdown) { height: 1em; display: block; font-size: @labeledIconSize !important; From 8390e094ce5106a89829e106c92dbd920fd82098 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 4 Sep 2018 17:15:45 -0700 Subject: [PATCH 15/89] Fix #6555 onChange is missing final param when used with action: 'hide' --- RELEASE-NOTES.md | 3 +++ src/definitions/modules/dropdown.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 17266724f2..62726d86e2 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -13,6 +13,9 @@ For example when `attachable: false` is used with a modal, or if IE11/Edge is us - **Loader** - Loader now includes `content loader` which let you specify arbitrary mocked up content to appear before content loads. +**Bugs** + +- **Dropdown** - Fixed issue where `onChange` when used with `action: hide` would be missing the third param `$item` #6555 ### Version 2.3.3 - June 18, 2018 diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 13652cc100..756281560d 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -1646,7 +1646,7 @@ $.fn.dropdown = function(parameters) { }, hide: function(text, value, element) { - module.set.value(value, text); + module.set.value(value, text, $(element)); module.hideAndClear(); } From e70e659dd99ae543a217af2f489ca82baf2b2ee7 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 4 Sep 2018 17:19:10 -0700 Subject: [PATCH 16/89] Fix #6557, specifity issue with dropdown in some menu types --- RELEASE-NOTES.md | 1 + src/definitions/collections/menu.less | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 62726d86e2..f4e332e1e2 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -16,6 +16,7 @@ For example when `attachable: false` is used with a modal, or if IE11/Edge is us **Bugs** - **Dropdown** - Fixed issue where `onChange` when used with `action: hide` would be missing the third param `$item` #6555 +- **Menu/Dropdown** - Fixes dropdown item margin not obeyed inside `labeled icon menu` #6557 ### Version 2.3.3 - June 18, 2018 diff --git a/src/definitions/collections/menu.less b/src/definitions/collections/menu.less index 10ae94fc86..cd40d5b3bb 100755 --- a/src/definitions/collections/menu.less +++ b/src/definitions/collections/menu.less @@ -254,7 +254,7 @@ display: inline-block; font-size: @dropdownItemIconFontSize !important; float: @dropdownItemIconFloat; - margin: @dropdownItemIconMargin; + margin: @dropdownItemIconMargin !important; } @@ -1193,7 +1193,7 @@ Floated Menu / Item } /* Item */ -.ui.labeled.icon.menu .item { +.ui.labeled.icon.menu .item { min-width: @labeledIconMinWidth; flex-direction: column; } From b44e647422f7df14ef5d58746eeeb676da9ed868 Mon Sep 17 00:00:00 2001 From: lubber-de Date: Thu, 6 Sep 2018 19:23:36 +0200 Subject: [PATCH 17/89] Support optional Weeknumbers in Calendar Day View --- dist/components/calendar.css | 3 ++ dist/components/calendar.js | 49 +++++++++++++++++++++------ src/definitions/modules/calendar.js | 49 +++++++++++++++++++++------ src/definitions/modules/calendar.less | 4 +++ 4 files changed, 85 insertions(+), 20 deletions(-) diff --git a/dist/components/calendar.css b/dist/components/calendar.css index 18a2a88ab5..eb5d3c193a 100644 --- a/dist/components/calendar.css +++ b/dist/components/calendar.css @@ -58,6 +58,9 @@ .ui.calendar .ui.table.day { min-width: 18em; } +.ui.calendar .ui.table.day.andweek { + min-width: 22em; +} .ui.calendar .ui.table.hour { min-width: 20em; } diff --git a/dist/components/calendar.js b/dist/components/calendar.js index 2fda463dc1..5208d5e296 100644 --- a/dist/components/calendar.js +++ b/dist/components/calendar.js @@ -1,5 +1,5 @@ /*! - * # Semantic UI 2.5.0 - Dropdown + * # Semantic UI 2.5.0 - Calendar * http://github.com/semantic-org/semantic-ui/ * * @@ -19,6 +19,20 @@ window = (typeof window != 'undefined' && window.Math == Math) : Function('return this')() ; +//support existing momentjs or date-fns library +Date.prototype.getWeekOfYear = Date.prototype.week || Date.prototype.getWeek || function() { + // adapted from http://www.merlyn.demon.co.uk/weekcalc.htm + var ms1d = 864e5, // milliseconds in a day + ms7d = 7 * ms1d; // milliseconds in a week + + return function() { // return a closure so constants get calculated only once + var DC3 = Date.UTC(this.getFullYear(), this.getMonth(), this.getDate() + 3) / ms1d, // an Absolute Day Number + AWN = Math.floor(DC3 / 7), // an Absolute Week Number + Wyr = new Date(AWN * ms7d).getUTCFullYear(); + + return AWN - Math.floor(Date.UTC(Wyr, 0, 7) / ms7d) + 1; + }; +}(); $.fn.calendar = function(parameters) { var $allModules = $(this), @@ -202,8 +216,8 @@ $.fn.calendar = function(parameters) { var startMonth = display.getMonth() + monthOffset; var year = display.getFullYear(); - var columns = isDay ? 7 : isHour ? 4 : 3; - var columnsString = columns === 7 ? 'seven' : columns === 4 ? 'four' : 'three'; + var columns = isDay ? settings.showWeekNumbers ? 8 : 7 : isHour ? 4 : 3; + var columnsString = columns === 8 ? 'eight' : columns === 7 ? 'seven' : columns === 4 ? 'four' : 'three'; var rows = isDay || isHour ? 6 : 4; var pages = isDay ? multiMonth : 1; @@ -238,8 +252,12 @@ $.fn.calendar = function(parameters) { 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 table = $('').addClass(className.table).addClass(columnsString + ' column').addClass(mode).appendTo(container); - + var tempMode = mode; + if (isDay && settings.showWeekNumbers){ + tempMode += ' andweek'; + } + var table = $('
').addClass(className.table).addClass(columnsString + ' column').addClass(tempMode).appendTo(container); + var textColumns = columns; //no header for time-only mode if (!isTimeOnly) { var thead = $('').appendTo(table); @@ -268,10 +286,15 @@ $.fn.calendar = function(parameters) { next.toggleClass(className.disabledCell, !module.helper.isDateInRange(nextFirst, mode)); $('').addClass(className.nextIcon).appendTo(next); } - if (isDay) { row = $('').appendTo(thead); - for (i = 0; i < columns; i++) { + if(settings.showWeekNumbers) { + cell = $('').appendTo(tbody); - for (c = 0; c < columns; c++, i++) { + if(isDay && settings.showWeekNumbers){ + cell = $('
').appendTo(row); + cell.text(settings.text.weekNo); + cell.addClass(className.disabledCell); + textColumns--; + } + for (i = 0; i < textColumns; i++) { cell = $('').appendTo(row); cell.text(formatter.dayColumnHeader((i + settings.firstDayOfWeek) % 7, settings)); } @@ -282,7 +305,12 @@ $.fn.calendar = function(parameters) { i = isYear ? Math.ceil(year / 10) * 10 - 9 : isDay ? 1 - firstMonthDayColumn : 0; for (r = 0; r < rows; r++) { row = $('
').appendTo(row); + cell.text(new Date(year,month,i,hour,minute).getWeekOfYear()); + cell.addClass(className.disabledCell); + } + for (c = 0; c < textColumns; c++, i++) { var cellDate = isYear ? new Date(i, month, 1, hour, minute) : isMonth ? new Date(year, i, 1, hour, minute) : isDay ? new Date(year, month, i, hour, minute) : isHour ? new Date(year, month, day, i) : new Date(year, month, day, hour, i * 5); @@ -1007,7 +1035,7 @@ $.fn.calendar.settings = { startCalendar: null, // jquery object or selector for another calendar that represents the start date of a date range endCalendar: null, // jquery object or selector for another calendar that represents the end date of a date range multiMonth: 1, // show multiple months when in 'day' mode - + showWeekNumbers: null,// show Number of Week at the very first column of a dayView // popup options ('popup', 'on', 'hoverable', and show/hide callbacks are overridden) popupOptions: { position: 'bottom left', @@ -1023,7 +1051,8 @@ $.fn.calendar.settings = { today: 'Today', now: 'Now', am: 'AM', - pm: 'PM' + pm: 'PM', + weekNo: 'Week' }, formatter: { diff --git a/src/definitions/modules/calendar.js b/src/definitions/modules/calendar.js index f11b26497e..2bd6f45574 100644 --- a/src/definitions/modules/calendar.js +++ b/src/definitions/modules/calendar.js @@ -1,5 +1,5 @@ /*! - * # Semantic UI - Dropdown + * # Semantic UI - Calendar * http://github.com/semantic-org/semantic-ui/ * * @@ -19,6 +19,20 @@ window = (typeof window != 'undefined' && window.Math == Math) : Function('return this')() ; +//support existing momentjs or date-fns library +Date.prototype.getWeekOfYear = Date.prototype.week || Date.prototype.getWeek || function() { + // adapted from http://www.merlyn.demon.co.uk/weekcalc.htm + var ms1d = 864e5, // milliseconds in a day + ms7d = 7 * ms1d; // milliseconds in a week + + return function() { // return a closure so constants get calculated only once + var DC3 = Date.UTC(this.getFullYear(), this.getMonth(), this.getDate() + 3) / ms1d, // an Absolute Day Number + AWN = Math.floor(DC3 / 7), // an Absolute Week Number + Wyr = new Date(AWN * ms7d).getUTCFullYear(); + + return AWN - Math.floor(Date.UTC(Wyr, 0, 7) / ms7d) + 1; + }; +}(); $.fn.calendar = function(parameters) { var $allModules = $(this), @@ -202,8 +216,8 @@ $.fn.calendar = function(parameters) { var startMonth = display.getMonth() + monthOffset; var year = display.getFullYear(); - var columns = isDay ? 7 : isHour ? 4 : 3; - var columnsString = columns === 7 ? 'seven' : columns === 4 ? 'four' : 'three'; + var columns = isDay ? settings.showWeekNumbers ? 8 : 7 : isHour ? 4 : 3; + var columnsString = columns === 8 ? 'eight' : columns === 7 ? 'seven' : columns === 4 ? 'four' : 'three'; var rows = isDay || isHour ? 6 : 4; var pages = isDay ? multiMonth : 1; @@ -238,8 +252,12 @@ $.fn.calendar = function(parameters) { 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 table = $('').addClass(className.table).addClass(columnsString + ' column').addClass(mode).appendTo(container); - + var tempMode = mode; + if (isDay && settings.showWeekNumbers){ + tempMode += ' andweek'; + } + var table = $('
').addClass(className.table).addClass(columnsString + ' column').addClass(tempMode).appendTo(container); + var textColumns = columns; //no header for time-only mode if (!isTimeOnly) { var thead = $('').appendTo(table); @@ -268,10 +286,15 @@ $.fn.calendar = function(parameters) { next.toggleClass(className.disabledCell, !module.helper.isDateInRange(nextFirst, mode)); $('').addClass(className.nextIcon).appendTo(next); } - if (isDay) { row = $('').appendTo(thead); - for (i = 0; i < columns; i++) { + if(settings.showWeekNumbers) { + cell = $('').appendTo(tbody); - for (c = 0; c < columns; c++, i++) { + if(isDay && settings.showWeekNumbers){ + cell = $('
').appendTo(row); + cell.text(settings.text.weekNo); + cell.addClass(className.disabledCell); + textColumns--; + } + for (i = 0; i < textColumns; i++) { cell = $('').appendTo(row); cell.text(formatter.dayColumnHeader((i + settings.firstDayOfWeek) % 7, settings)); } @@ -282,7 +305,12 @@ $.fn.calendar = function(parameters) { i = isYear ? Math.ceil(year / 10) * 10 - 9 : isDay ? 1 - firstMonthDayColumn : 0; for (r = 0; r < rows; r++) { row = $('
').appendTo(row); + cell.text(new Date(year,month,i,hour,minute).getWeekOfYear()); + cell.addClass(className.disabledCell); + } + for (c = 0; c < textColumns; c++, i++) { var cellDate = isYear ? new Date(i, month, 1, hour, minute) : isMonth ? new Date(year, i, 1, hour, minute) : isDay ? new Date(year, month, i, hour, minute) : isHour ? new Date(year, month, day, i) : new Date(year, month, day, hour, i * 5); @@ -1007,7 +1035,7 @@ $.fn.calendar.settings = { startCalendar: null, // jquery object or selector for another calendar that represents the start date of a date range endCalendar: null, // jquery object or selector for another calendar that represents the end date of a date range multiMonth: 1, // show multiple months when in 'day' mode - + showWeekNumbers: null,// show Number of Week at the very first column of a dayView // popup options ('popup', 'on', 'hoverable', and show/hide callbacks are overridden) popupOptions: { position: 'bottom left', @@ -1023,7 +1051,8 @@ $.fn.calendar.settings = { today: 'Today', now: 'Now', am: 'AM', - pm: 'PM' + pm: 'PM', + weekNo: 'Week' }, formatter: { diff --git a/src/definitions/modules/calendar.less b/src/definitions/modules/calendar.less index 73eac7d03d..ca205443e7 100644 --- a/src/definitions/modules/calendar.less +++ b/src/definitions/modules/calendar.less @@ -63,6 +63,10 @@ min-width: 18em; } +.ui.calendar .ui.table.day.andweek { + min-width: 22em; +} + .ui.calendar .ui.table.hour { min-width: 20em; } From 3f9852142e61ef1f051ce1411c12d74803dda4e8 Mon Sep 17 00:00:00 2001 From: lubber-de Date: Fri, 7 Sep 2018 00:27:18 +0200 Subject: [PATCH 18/89] Fix Multimonth display. table does not need/support to have semantic amount of column names to be specified --- dist/components/calendar.js | 3 +-- src/definitions/modules/calendar.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dist/components/calendar.js b/dist/components/calendar.js index 5208d5e296..58a1cdc2d2 100644 --- a/dist/components/calendar.js +++ b/dist/components/calendar.js @@ -217,7 +217,6 @@ $.fn.calendar = function(parameters) { var year = display.getFullYear(); var columns = isDay ? settings.showWeekNumbers ? 8 : 7 : isHour ? 4 : 3; - var columnsString = columns === 8 ? 'eight' : columns === 7 ? 'seven' : columns === 4 ? 'four' : 'three'; var rows = isDay || isHour ? 6 : 4; var pages = isDay ? multiMonth : 1; @@ -256,7 +255,7 @@ $.fn.calendar = function(parameters) { if (isDay && settings.showWeekNumbers){ tempMode += ' andweek'; } - var table = $('').addClass(className.table).addClass(columnsString + ' column').addClass(tempMode).appendTo(container); + var table = $('
').addClass(className.table).addClass(tempMode).appendTo(container); var textColumns = columns; //no header for time-only mode if (!isTimeOnly) { diff --git a/src/definitions/modules/calendar.js b/src/definitions/modules/calendar.js index 2bd6f45574..e4b138656a 100644 --- a/src/definitions/modules/calendar.js +++ b/src/definitions/modules/calendar.js @@ -217,7 +217,6 @@ $.fn.calendar = function(parameters) { var year = display.getFullYear(); var columns = isDay ? settings.showWeekNumbers ? 8 : 7 : isHour ? 4 : 3; - var columnsString = columns === 8 ? 'eight' : columns === 7 ? 'seven' : columns === 4 ? 'four' : 'three'; var rows = isDay || isHour ? 6 : 4; var pages = isDay ? multiMonth : 1; @@ -256,7 +255,7 @@ $.fn.calendar = function(parameters) { if (isDay && settings.showWeekNumbers){ tempMode += ' andweek'; } - var table = $('
').addClass(className.table).addClass(columnsString + ' column').addClass(tempMode).appendTo(container); + var table = $('
').addClass(className.table).addClass(tempMode).appendTo(container); var textColumns = columns; //no header for time-only mode if (!isTimeOnly) { From 74f5d47e25bfa448908e78116ae4991ae5ca8f87 Mon Sep 17 00:00:00 2001 From: lubber-de Date: Fri, 7 Sep 2018 11:27:57 +0200 Subject: [PATCH 19/89] Fix Week calculation display (needs to start with monday at least), moved calculation inside of get methods --- dist/components/calendar.js | 29 ++++++++++++++--------------- src/definitions/modules/calendar.js | 29 ++++++++++++++--------------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/dist/components/calendar.js b/dist/components/calendar.js index 58a1cdc2d2..82a3d7b571 100644 --- a/dist/components/calendar.js +++ b/dist/components/calendar.js @@ -19,20 +19,6 @@ window = (typeof window != 'undefined' && window.Math == Math) : Function('return this')() ; -//support existing momentjs or date-fns library -Date.prototype.getWeekOfYear = Date.prototype.week || Date.prototype.getWeek || function() { - // adapted from http://www.merlyn.demon.co.uk/weekcalc.htm - var ms1d = 864e5, // milliseconds in a day - ms7d = 7 * ms1d; // milliseconds in a week - - return function() { // return a closure so constants get calculated only once - var DC3 = Date.UTC(this.getFullYear(), this.getMonth(), this.getDate() + 3) / ms1d, // an Absolute Day Number - AWN = Math.floor(DC3 / 7), // an Absolute Week Number - Wyr = new Date(AWN * ms7d).getUTCFullYear(); - - return AWN - Math.floor(Date.UTC(Wyr, 0, 7) / ms7d) + 1; - }; -}(); $.fn.calendar = function(parameters) { var $allModules = $(this), @@ -306,7 +292,7 @@ $.fn.calendar = function(parameters) { row = $('').appendTo(tbody); if(isDay && settings.showWeekNumbers){ cell = $('').appendTo(tbody); if(isDay && settings.showWeekNumbers){ cell = $('
').appendTo(row); - cell.text(new Date(year,month,i,hour,minute).getWeekOfYear()); + cell.text(module.get.weekOfYear(year,month,i+1-settings.firstDayOfWeek)); cell.addClass(className.disabledCell); } for (c = 0; c < textColumns; c++, i++) { @@ -535,6 +521,19 @@ $.fn.calendar = function(parameters) { }, get: { + weekOfYear: function(weekYear,weekMonth,weekDay) { + // adapted from http://www.merlyn.demon.co.uk/weekcalc.htm + var ms1d = 864e5, // milliseconds in a day + ms7d = 7 * ms1d; // milliseconds in a week + + return function() { // return a closure so constants get calculated only once + var DC3 = Date.UTC(weekYear, weekMonth, weekDay + 3) / ms1d, // an Absolute Day Number + AWN = Math.floor(DC3 / 7), // an Absolute Week Number + Wyr = new Date(AWN * ms7d).getUTCFullYear(); + + return AWN - Math.floor(Date.UTC(Wyr, 0, 7) / ms7d) + 1; + }(); + }, date: function () { return $module.data(metadata.date) || null; }, diff --git a/src/definitions/modules/calendar.js b/src/definitions/modules/calendar.js index e4b138656a..5e00c4b921 100644 --- a/src/definitions/modules/calendar.js +++ b/src/definitions/modules/calendar.js @@ -19,20 +19,6 @@ window = (typeof window != 'undefined' && window.Math == Math) : Function('return this')() ; -//support existing momentjs or date-fns library -Date.prototype.getWeekOfYear = Date.prototype.week || Date.prototype.getWeek || function() { - // adapted from http://www.merlyn.demon.co.uk/weekcalc.htm - var ms1d = 864e5, // milliseconds in a day - ms7d = 7 * ms1d; // milliseconds in a week - - return function() { // return a closure so constants get calculated only once - var DC3 = Date.UTC(this.getFullYear(), this.getMonth(), this.getDate() + 3) / ms1d, // an Absolute Day Number - AWN = Math.floor(DC3 / 7), // an Absolute Week Number - Wyr = new Date(AWN * ms7d).getUTCFullYear(); - - return AWN - Math.floor(Date.UTC(Wyr, 0, 7) / ms7d) + 1; - }; -}(); $.fn.calendar = function(parameters) { var $allModules = $(this), @@ -306,7 +292,7 @@ $.fn.calendar = function(parameters) { row = $('
').appendTo(row); - cell.text(new Date(year,month,i,hour,minute).getWeekOfYear()); + cell.text(module.get.weekOfYear(year,month,i+1-settings.firstDayOfWeek)); cell.addClass(className.disabledCell); } for (c = 0; c < textColumns; c++, i++) { @@ -535,6 +521,19 @@ $.fn.calendar = function(parameters) { }, get: { + weekOfYear: function(weekYear,weekMonth,weekDay) { + // adapted from http://www.merlyn.demon.co.uk/weekcalc.htm + var ms1d = 864e5, // milliseconds in a day + ms7d = 7 * ms1d; // milliseconds in a week + + return function() { // return a closure so constants get calculated only once + var DC3 = Date.UTC(weekYear, weekMonth, weekDay + 3) / ms1d, // an Absolute Day Number + AWN = Math.floor(DC3 / 7), // an Absolute Week Number + Wyr = new Date(AWN * ms7d).getUTCFullYear(); + + return AWN - Math.floor(Date.UTC(Wyr, 0, 7) / ms7d) + 1; + }(); + }, date: function () { return $module.data(metadata.date) || null; }, From a7cf20e34f9d498139286b653b13b5296a89be32 Mon Sep 17 00:00:00 2001 From: ColinFrick Date: Fri, 7 Sep 2018 20:13:14 +0200 Subject: [PATCH 20/89] fix(checkbox): prevent before callbacks on init if fireOnInit is false Closes #114 --- src/definitions/modules/checkbox.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/definitions/modules/checkbox.js b/src/definitions/modules/checkbox.js index b3a6c1da8b..7e84d4bac3 100644 --- a/src/definitions/modules/checkbox.js +++ b/src/definitions/modules/checkbox.js @@ -339,7 +339,7 @@ $.fn.checkbox = function(parameters) { module.debug('Should not allow check, checkbox is already checked'); return false; } - if(settings.beforeChecked.apply(input) === false) { + if(!module.should.ignoreCallbacks() && settings.beforeChecked.apply(input) === false) { module.debug('Should not allow check, beforeChecked cancelled'); return false; } @@ -350,7 +350,7 @@ $.fn.checkbox = function(parameters) { module.debug('Should not allow uncheck, checkbox is already unchecked'); return false; } - if(settings.beforeUnchecked.apply(input) === false) { + if(!module.should.ignoreCallbacks() && settings.beforeUnchecked.apply(input) === false) { module.debug('Should not allow uncheck, beforeUnchecked cancelled'); return false; } @@ -361,7 +361,7 @@ $.fn.checkbox = function(parameters) { module.debug('Should not allow indeterminate, checkbox is already indeterminate'); return false; } - if(settings.beforeIndeterminate.apply(input) === false) { + if(!module.should.ignoreCallbacks() && settings.beforeIndeterminate.apply(input) === false) { module.debug('Should not allow indeterminate, beforeIndeterminate cancelled'); return false; } @@ -372,7 +372,7 @@ $.fn.checkbox = function(parameters) { module.debug('Should not allow determinate, checkbox is already determinate'); return false; } - if(settings.beforeDeterminate.apply(input) === false) { + if(!module.should.ignoreCallbacks() && settings.beforeDeterminate.apply(input) === false) { module.debug('Should not allow determinate, beforeDeterminate cancelled'); return false; } From 35c583f10ba8c82ddddfb998af3a5c7daebb37fa Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 9 Sep 2018 17:23:00 -0700 Subject: [PATCH 21/89] Re-subset dropdown to include close --- src/themes/default/modules/dropdown.overrides | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/themes/default/modules/dropdown.overrides b/src/themes/default/modules/dropdown.overrides index 729e201d67..744898e86a 100644 --- a/src/themes/default/modules/dropdown.overrides +++ b/src/themes/default/modules/dropdown.overrides @@ -6,8 +6,7 @@ @font-face { font-family: 'Dropdown'; src: - url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMggjB5AAAAC8AAAAYGNtYXAPfuIIAAABHAAAAExnYXNwAAAAEAAAAWgAAAAIZ2x5Zjo82LgAAAFwAAABVGhlYWQAQ88bAAACxAAAADZoaGVhAwcB6QAAAvwAAAAkaG10eAS4ABIAAAMgAAAAIGxvY2EBNgDeAAADQAAAABJtYXhwAAoAFgAAA1QAAAAgbmFtZVcZpu4AAAN0AAABRXBvc3QAAwAAAAAEvAAAACAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDX//3//wAB/+MPLQADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAIABJQElABMAABM0NzY3BTYXFhUUDwEGJwYvASY1AAUGBwEACAUGBoAFCAcGgAUBEgcGBQEBAQcECQYHfwYBAQZ/BwYAAQAAAG4BJQESABMAADc0PwE2MzIfARYVFAcGIyEiJyY1AAWABgcIBYAGBgUI/wAHBgWABwaABQWABgcHBgUFBgcAAAABABIASQC3AW4AEwAANzQ/ATYXNhcWHQEUBwYnBi8BJjUSBoAFCAcFBgYFBwgFgAbbBwZ/BwEBBwQJ/wgEBwEBB38GBgAAAAABAAAASQClAW4AEwAANxE0NzYzMh8BFhUUDwEGIyInJjUABQYHCAWABgaABQgHBgVbAQAIBQYGgAUIBwWABgYFBwAAAAEAAAABAADZuaKOXw889QALAgAAAAAA0ABHWAAAAADQAEdYAAAAAAElAW4AAAAIAAIAAAAAAAAAAQAAAeD/4AAAAgAAAAAAASUAAQAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAABAAAAASUAAAElAAAAtwASALcAAAAAAAAACgAUAB4AQgBkAIgAqgAAAAEAAAAIABQAAQAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAOAK4AAQAAAAAAAQAOAAAAAQAAAAAAAgAOAEcAAQAAAAAAAwAOACQAAQAAAAAABAAOAFUAAQAAAAAABQAWAA4AAQAAAAAABgAHADIAAQAAAAAACgA0AGMAAwABBAkAAQAOAAAAAwABBAkAAgAOAEcAAwABBAkAAwAOACQAAwABBAkABAAOAFUAAwABBAkABQAWAA4AAwABBAkABgAOADkAAwABBAkACgA0AGMAaQBjAG8AbQBvAG8AbgBWAGUAcgBzAGkAbwBuACAAMQAuADAAaQBjAG8AbQBvAG8Abmljb21vb24AaQBjAG8AbQBvAG8AbgBSAGUAZwB1AGwAYQByAGkAYwBvAG0AbwBvAG4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=) format('truetype'), - url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AAAVwAAoAAAAABSgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAAA9AAAAdkAAAHZLDXE/09TLzIAAALQAAAAYAAAAGAIIweQY21hcAAAAzAAAABMAAAATA9+4ghnYXNwAAADfAAAAAgAAAAIAAAAEGhlYWQAAAOEAAAANgAAADYAQ88baGhlYQAAA7wAAAAkAAAAJAMHAelobXR4AAAD4AAAACAAAAAgBLgAEm1heHAAAAQAAAAABgAAAAYACFAAbmFtZQAABAgAAAFFAAABRVcZpu5wb3N0AAAFUAAAACAAAAAgAAMAAAEABAQAAQEBCGljb21vb24AAQIAAQA6+BwC+BsD+BgEHgoAGVP/i4seCgAZU/+LiwwHi2v4lPh0BR0AAACIDx0AAACNER0AAAAJHQAAAdASAAkBAQgPERMWGyAlKmljb21vb25pY29tb29udTB1MXUyMHVGMEQ3dUYwRDh1RjBEOXVGMERBAAACAYkABgAIAgABAAQABwAKAA0AVgCfAOgBL/yUDvyUDvyUDvuUDvtvi/emFYuQjZCOjo+Pj42Qiwj3lIsFkIuQiY6Hj4iNhouGi4aJh4eHCPsU+xQFiIiGiYaLhouHjYeOCPsU9xQFiI+Jj4uQCA77b4v3FBWLkI2Pjo8I9xT3FAWPjo+NkIuQi5CJjogI9xT7FAWPh42Hi4aLhomHh4eIiIaJhosI+5SLBYaLh42HjoiPiY+LkAgO+92d928Vi5CNkI+OCPcU9xQFjo+QjZCLkIuPiY6Hj4iNhouGCIv7lAWLhomHh4iIh4eJhouGi4aNiI8I+xT3FAWHjomPi5AIDvvdi+YVi/eUBYuQjZCOjo+Pj42Qi5CLkImOhwj3FPsUBY+IjYaLhouGiYeHiAj7FPsUBYiHhomGi4aLh42Hj4iOiY+LkAgO+JQU+JQViwwKAAAAAAMCAAGQAAUAAAFMAWYAAABHAUwBZgAAAPUAGQCEAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA8NoB4P/g/+AB4AAgAAAAAQAAAAAAAAAAAAAAIAAAAAAAAgAAAAMAAAAUAAMAAQAAABQABAA4AAAACgAIAAIAAgABACDw2v/9//8AAAAAACDw1//9//8AAf/jDy0AAwABAAAAAAAAAAAAAAABAAH//wAPAAEAAAABAAA5emozXw889QALAgAAAAAA0ABHWAAAAADQAEdYAAAAAAElAW4AAAAIAAIAAAAAAAAAAQAAAeD/4AAAAgAAAAAAASUAAQAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAABAAAAASUAAAElAAAAtwASALcAAAAAUAAACAAAAAAADgCuAAEAAAAAAAEADgAAAAEAAAAAAAIADgBHAAEAAAAAAAMADgAkAAEAAAAAAAQADgBVAAEAAAAAAAUAFgAOAAEAAAAAAAYABwAyAAEAAAAAAAoANABjAAMAAQQJAAEADgAAAAMAAQQJAAIADgBHAAMAAQQJAAMADgAkAAMAAQQJAAQADgBVAAMAAQQJAAUAFgAOAAMAAQQJAAYADgA5AAMAAQQJAAoANABjAGkAYwBvAG0AbwBvAG4AVgBlAHIAcwBpAG8AbgAgADEALgAwAGkAYwBvAG0AbwBvAG5pY29tb29uAGkAYwBvAG0AbwBvAG4AUgBlAGcAdQBsAGEAcgBpAGMAbwBtAG8AbwBuAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('woff') + url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAVgAA8AAAAACFAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABWAAAABwAAAAchGgaq0dERUYAAAF0AAAAHAAAAB4AJwAPT1MvMgAAAZAAAABDAAAAVnW4TJdjbWFwAAAB1AAAAEsAAAFS8CcaqmN2dCAAAAIgAAAABAAAAAQAEQFEZ2FzcAAAAiQAAAAIAAAACP//AANnbHlmAAACLAAAAQoAAAGkrRHP9WhlYWQAAAM4AAAAMAAAADYPK8YyaGhlYQAAA2gAAAAdAAAAJANCAb1obXR4AAADiAAAACIAAAAiCBkAOGxvY2EAAAOsAAAAFAAAABQBnAIybWF4cAAAA8AAAAAfAAAAIAEVAF5uYW1lAAAD4AAAATAAAAKMFGlj5HBvc3QAAAUQAAAARgAAAHJoedjqd2ViZgAABVgAAAAGAAAABrO7W5UAAAABAAAAANXulPUAAAAA1r4hgAAAAADXu2Q1eNpjYGRgYOABYjEgZmJgBEIOIGYB8xgAA/YAN3jaY2BktGOcwMDKwMI4jTGNgYHBHUp/ZZBkaGFgYGJgZWbACgLSXFMYHFT/fLjFeOD/AQY9xjMMbkBhRpAcAN48DQYAeNpjYGBgZoBgGQZGBhDwAfIYwXwWBgMgzQGETAwMqn8+8H649f8/lHX9//9b7Pzf+fWgusCAkY0BzmUE6gHpQwGMDMMeAACbxg7SAAARAUQAAAAB//8AAnjadZBPSsNAGMXfS+yMqYgOhpSuSlKadmUhiVEhEMQzFF22m17BbbvzCh5BXCUn6EG8gjeQ4DepwYo4i+/ffL95j4EDA+CFC7jQuKyIeVHrI3wkleq9F7XrSInKteOeHdda8bOoaeepSc00NWPz/LRec9G8GabyGtEdF7h19z033GAMTK7zbM42xNEZpzYof0RtQ5CUHAQJ73OtVyutc+3b7Ou//b8XNlsPx3jgjUifABdhEohKJJL5iM5p39uqc7X1+sRQSqmGrUVhlsJ4lpmEUVwyT8SUYtg0P9DyNzPADDs+tjrGV6KRCRfsui3eHcL4/p8ZXvfMlcnEU+CLv7hDykOP+AKTPTxbAAB42mNgZGBgAGKuf5KP4vltvjLIMzGAwLV9ig0g+vruFFMQzdjACOJzMIClARh0CTJ42mNgZGBgPPD/AJD8wgAEjA0MjAyogAMAbOQEAQAAAAC7ABEAAAAAAKoAAAH0AAABgAAAAUAACAFAAAgAwAAXAAAAAAAAACoAKgAqADIAbACGAKAAugDSeNpjYGRgYOBkUGFgYgABEMkFhAwM/xn0QAIADdUBdAB42qWQvUoDQRSFv3GjaISUQaymSmGxJoGAsRC0iPYLsU50Y6IxrvlRtPCJJKUPIBb+PIHv4EN4djKuKAqCDHfmu+feOdwZoMCUAJNbAlYUMzaUlM14jjxbngOq7HnOia89z1Pk1vMCa9x7ztPkzfMyJbPj+ZGi6Xp+omxuPD+zaD7meaFg7mb8GrBqHmhwxoAxlm0uiRkpP9X5m26pKRoMxTGR1D49Dv/Yb/91o6l8qL6eu5n2hZQzn68utR9m3FU2cB4t9cdSLG2utI+44Eh/P9bqKO+oJ/WxmXssj77YkrjasZQD6SFddythk3Wtzrf+UF2p076Udla1VNzsERP3kkjVRKel7mp1udXYcHtZSlV7RfmJe1GiFWveluaeKD5/MuJcSk8Tpm/vvwPIbmJleNpjYGKAAFYG7ICTgYGRiZGZkYWRlZGNkZ2Rg5GTLT2nsiDDEEIZsZfmZRqZujmDaDcDAxcI7WIOpS2gtCWUdgQAZkcSmQAAAAFblbO6AAA=) format('woff') ; font-weight: normal; font-style: normal; @@ -46,17 +45,15 @@ content: "\f0da"/*rtl:"\f0d9"*/; } -/* Icons for Reference -.dropdown.down.icon { - content: "\f0d7"; -} -.dropdown.up.icon { - content: "\f0d8"; -} -.dropdown.left.icon { - content: "\f0d9"; -} -.dropdown.icon.icon { - content: "\f0da"; +.ui.dropdown > .clear.icon:before { + content: "\f00d"; } + +/* Icons for Reference (Subsetted in 2.4.0) + .dropdown.down:before { content: "\f0d7"; } + .dropdown.up:before { content: "\f0d8"; } + .dropdown.left:before { content: "\f0d9"; } + .dropdown.right:before { content: "\f0da"; } + .dropdown.close:before { content: "\f00d"; } */ + From 33d08ec920c95b0ef9ee84bc31fbdb304916c212 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 9 Sep 2018 17:23:08 -0700 Subject: [PATCH 22/89] Simplest implementation of clearable dropdown --- src/definitions/modules/dropdown.js | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 756281560d..8b75ca2650 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -1019,7 +1019,12 @@ $.fn.dropdown = function(parameters) { }, icon: { click: function(event) { - module.toggle(); + if($icon.hasClass(className.clear)) { + module.clear(); + } + else { + module.toggle(); + } } }, text: { @@ -2481,6 +2486,15 @@ $.fn.dropdown = function(parameters) { $module.data(metadata.value, stringValue); } } + if(module.is.single() && settings.clearable) { + // treat undefined or '' as empty + if(!escapedValue) { + module.remove.clearable(); + } + else { + module.set.clearable(); + } + } if(settings.fireOnInit === false && module.is.initialLoad()) { module.verbose('No callback on initial load', settings.onChange); } @@ -2576,7 +2590,10 @@ $.fn.dropdown = function(parameters) { } }) ; - } + }, + clearable: function() { + $icon.addClass(className.clear); + }, }, add: { @@ -2774,7 +2791,7 @@ $.fn.dropdown = function(parameters) { } module.set.value(newValue, addedValue, addedText, $selectedItem); module.check.maxSelections(); - } + }, }, remove: { @@ -2999,6 +3016,9 @@ $.fn.dropdown = function(parameters) { .removeAttr('tabindex') ; } + }, + clearable: function() { + $icon.removeClass(className.clear); } }, @@ -3686,6 +3706,8 @@ $.fn.dropdown.settings = { values : false, // specify values to use for dropdown + clearable : true, // whether the value of the dropdown can be cleared + apiSettings : false, selectOnKeydown : true, // Whether selection should occur automatically when keyboard shortcuts used minCharacters : 0, // Minimum characters required to trigger API call @@ -3838,6 +3860,7 @@ $.fn.dropdown.settings = { active : 'active', addition : 'addition', animating : 'animating', + clear : 'clear', disabled : 'disabled', empty : 'empty', dropdown : 'ui dropdown', From a4688f101caa4b0bbdb4bbb02237673f0245aa8d Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 9 Sep 2018 17:31:55 -0700 Subject: [PATCH 23/89] Add styling for clear icon --- src/definitions/modules/dropdown.less | 12 ++++++++++++ src/themes/default/modules/dropdown.variables | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/definitions/modules/dropdown.less b/src/definitions/modules/dropdown.less index ee81f3dd4b..4e8ce57f53 100755 --- a/src/definitions/modules/dropdown.less +++ b/src/definitions/modules/dropdown.less @@ -925,6 +925,18 @@ select.ui.dropdown { } +/*-------------------- + Clear +----------------------*/ + +.ui.dropdown > .clear.dropdown.icon { + opacity: @clearableIconOpacity; + transition: opacity @defaultDuration @defaultEasing; +} +.ui.dropdown > .clear.dropdown.icon:hover { + opacity: @clearableIconActiveOpacity; +} + /*-------------------- Disabled diff --git a/src/themes/default/modules/dropdown.variables b/src/themes/default/modules/dropdown.variables index 4c947e1b24..8653fb6b72 100755 --- a/src/themes/default/modules/dropdown.variables +++ b/src/themes/default/modules/dropdown.variables @@ -211,7 +211,7 @@ @selectionActiveHoverMenuBoxShadow: @selectionVisibleMenuBoxShadow; @selectionVisibleConnectingBorder: 0em; -@selectionVisibleIconOpacity: 1; +@selectionVisibleIconOpacity: ''; /*-------------- Search @@ -309,6 +309,10 @@ @errorItemHoverBackground: #FFF2F2; @errorItemActiveBackground: #FDCFCF; +/* Clearable */ +@clearableIconOpacity: 0.8; +@clearableIconActiveOpacity: 1; + /*------------------- Variations --------------------*/ From 079dc7d9a7ad92f7eea6f40138bf01315f44696d Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 9 Sep 2018 17:32:00 -0700 Subject: [PATCH 24/89] Rlsnotes --- RELEASE-NOTES.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index f4e332e1e2..4a36fa737c 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,20 +1,18 @@ ## RELEASE NOTES -### Version 2.3.4 - Aug xx, 2018 +### Version 2.4.0 - Sep xx, 2018 + +**New Components** +- **Segment** - Added new `ui placeholder segment` used to reserve space for UI when no content is available. +- **Loader** - Added `ui content loader` that can be used to mimic content while its loading **Major Enhancements** +- **Dropdown** - Added `clearable` dropdowns. When `clearable: true` is specified, you can - **Modal/Dimmer** - Modals and dimmers now include a new setting `useFlex` which defaults to `auto`. Modals and dimmers will automatically revert to using non-flex layouts when there may be layout issues with using flexbox. For example when `attachable: false` is used with a modal, or if IE11/Edge is used (Absolutely positioned elements inside flex containers in IE behave differently) -**New UI** - -- **Segment** - Segment now include a `placeholder` type, which can be used to save place for content when content is empty. - -- **Loader** - Loader now includes `content loader` which let you specify arbitrary mocked up content to appear before content loads. - **Bugs** - - **Dropdown** - Fixed issue where `onChange` when used with `action: hide` would be missing the third param `$item` #6555 - **Menu/Dropdown** - Fixes dropdown item margin not obeyed inside `labeled icon menu` #6557 From e468419074f8c7f21ae9b2aa1c90494b22149d4a Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 9 Sep 2018 17:35:00 -0700 Subject: [PATCH 25/89] Disable clearable by default --- src/definitions/modules/dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 8b75ca2650..9af348a553 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -3706,7 +3706,7 @@ $.fn.dropdown.settings = { values : false, // specify values to use for dropdown - clearable : true, // whether the value of the dropdown can be cleared + clearable : false, // whether the value of the dropdown can be cleared apiSettings : false, selectOnKeydown : true, // Whether selection should occur automatically when keyboard shortcuts used From 9a3079ba58ea54534160cabfc7b6227a77e2665e Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 9 Sep 2018 20:18:08 -0700 Subject: [PATCH 26/89] Make content loaders support image aspect ratios --- src/definitions/elements/loader.less | 15 ++++++++++++++- src/themes/default/elements/loader.variables | 12 ++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/definitions/elements/loader.less b/src/definitions/elements/loader.less index 0462bf9269..8e8b0ad74d 100755 --- a/src/definitions/elements/loader.less +++ b/src/definitions/elements/loader.less @@ -168,7 +168,7 @@ /* Placeholder Paragraph */ .ui.content.loader { - position: relative; + position: static; left: 0px; top: 0px; transform: none; @@ -224,6 +224,19 @@ .ui.content.loader .image:not(.header) { height: @contentImageHeight; } +.ui.content.loader .square.image:not(.header) { + height: 0px; + overflow: hidden; + /* 1/1 aspect ratio */ + padding-top: 100%; +} +.ui.content.loader .rectangular.image:not(.header) { + height: 0px; + overflow: hidden; + /* 4/3 aspect ratio */ + padding-top: 75%; +} + /* Lines */ .ui.content.loader .line { diff --git a/src/themes/default/elements/loader.variables b/src/themes/default/elements/loader.variables index 0d240ffb62..499266525f 100644 --- a/src/themes/default/elements/loader.variables +++ b/src/themes/default/elements/loader.variables @@ -25,7 +25,7 @@ --------------------*/ /* Text */ -@contentLoaderMaxWidth: 30rem; +@contentLoaderMaxWidth: 50rem; @textDistance: @relativeMini; @loaderTextColor: @textColor; @invertedLoaderTextColor: @invertedTextColor; @@ -33,9 +33,9 @@ @contentSpacing: 20px; /* Content Loader Lines */ -@contentLineMargin: 12px; -@contentHeaderLineHeight: 9px; -@contentLineHeight: 7px; +@contentLineMargin: @12px; +@contentHeaderLineHeight: @9px; +@contentLineHeight: @7px; @contentParagraphLineHeight: @contentLineHeight; /* Image */ @@ -43,11 +43,11 @@ /* Header Image */ @contentImageWidth: 50px; -@contentImageTextIndent: 10px; +@contentImageTextIndent: @10px; /* Paragraph */ @contentHeaderLineOneOutdent: 0px; -@contentHeaderLineTwoOutdent: 120px; +@contentHeaderLineTwoOutdent: 8rem; @contentLineOneOutdent: 4rem; @contentLineTwoOutdent: 7rem; From b4861d1e492d9b1f7cba61cb7a16575a6ab8adb5 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 9 Sep 2018 20:35:52 -0700 Subject: [PATCH 27/89] Set dimmer variation at run-time --- src/definitions/modules/dimmer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/definitions/modules/dimmer.js b/src/definitions/modules/dimmer.js index f622e925a5..0ff404262f 100755 --- a/src/definitions/modules/dimmer.js +++ b/src/definitions/modules/dimmer.js @@ -83,7 +83,6 @@ $.fn.dimmer = function(parameters) { else { $dimmer = module.create(); } - module.set.variation(); } }, @@ -200,6 +199,7 @@ $.fn.dimmer = function(parameters) { : function(){} ; module.debug('Showing dimmer', $dimmer, settings); + module.set.variation(); if( (!module.is.dimmed() || module.is.animating()) && module.is.enabled() ) { module.animate.show(callback); settings.onShow.call(element); @@ -314,6 +314,7 @@ $.fn.dimmer = function(parameters) { module.remove.dimmed(); }, onComplete : function() { + module.remove.variation(); module.remove.active(); callback(); } From e35ce81e2777b37712982c4297866ef35ffb9a3c Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 9 Sep 2018 20:36:59 -0700 Subject: [PATCH 28/89] Fix legacy modals to support top aligned, fix bug in ie11 for swapping between top/middle aligned --- src/definitions/modules/modal.js | 9 ++++++--- src/definitions/modules/modal.less | 23 ++++++++++++++++++++++- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index f281a3b083..40bb02f834 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -110,8 +110,7 @@ $.fn.modal = function(parameters) { debug : settings.debug, variation : settings.centered ? false - : 'top aligned' - , + : 'top aligned', dimmerName : 'modals' }, dimmerSettings = $.extend(true, defaultSettings, settings.dimmerSettings) @@ -305,6 +304,7 @@ $.fn.modal = function(parameters) { ? callback : function(){} ; + console.log('test'); module.refreshModals(); module.set.dimmerSettings(); module.showModal(callback); @@ -690,9 +690,12 @@ $.fn.modal = function(parameters) { width = module.cache.width, height = module.cache.height ; + console.log(module.can.fit()); $module .css({ - marginTop: -(height / 2), + marginTop: (settings.centered && module.can.fit()) + ? -(height / 2) + : 0, marginLeft: -(width / 2) }) ; diff --git a/src/definitions/modules/modal.less b/src/definitions/modules/modal.less index 03e12b9543..479786a1de 100755 --- a/src/definitions/modules/modal.less +++ b/src/definitions/modules/modal.less @@ -317,6 +317,13 @@ left: 50%; } +.ui.legacy.page.dimmer > .ui.scrolling.modal, +.ui.page.dimmer > .ui.scrolling.legacy.modal, +.ui.top.aligned.legacy.page.dimmer > .ui.modal, +.ui.top.aligned.dimmer > .ui.legacy.modal { + top: auto; +} + /* Tablet and Mobile */ @media only screen and (max-width : @largestTabletScreen) { .ui.basic.modal > .close { @@ -351,6 +358,20 @@ .modals.dimmer[class*="top aligned"] .modal { margin: @topAlignedMargin auto; } +@media only screen and (max-width : @largestMobileScreen) { + .modals.dimmer[class*="top aligned"] .modal { + margin: @mobileTopAlignedMargin auto; + } +} +/* Legacy Top Aligned */ +.legacy.modals.dimmer[class*="top aligned"] { + padding-top: @topAlignedMargin; +} +@media only screen and (max-width : @largestMobileScreen) { + .legacy.modals.dimmer[class*="top aligned"] { + padding-top: @mobileTopAlignedMargin; + } +} /*-------------- Scrolling @@ -371,7 +392,7 @@ position: fixed; } .modals.dimmer .ui.scrolling.modal { - margin: @scrollingMargin auto !important; + margin: @scrollingMargin auto; } /* Undetached Scrolling */ From 6f2e1a85a07c198d13866dd1135677aa64583d07 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 9 Sep 2018 20:37:27 -0700 Subject: [PATCH 29/89] Fix list issue where table-cell on content would cause content to collapse inappropriately --- src/definitions/elements/list.less | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/definitions/elements/list.less b/src/definitions/elements/list.less index f1eda4bbc9..eb747d3a5a 100755 --- a/src/definitions/elements/list.less +++ b/src/definitions/elements/list.less @@ -154,12 +154,14 @@ ol.ui.list ol li, .ui.list > .item > .image + .content, .ui.list > .item > .icon + .content { display: table-cell; + width: 100%; padding: 0em 0em 0em @contentDistance; vertical-align: @contentVerticalAlign; } .ui.list .list > .item > img.image + .content, .ui.list > .item > img.image + .content { display: inline-block; + width: auto; } .ui.list .list > .item > .content > .list, .ui.list > .item > .content > .list { From bed86bad9a4c387421fb9cd6900451d9d8cd82a7 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 9 Sep 2018 20:37:34 -0700 Subject: [PATCH 30/89] Release notes --- RELEASE-NOTES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 4a36fa737c..417f5c2211 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -15,7 +15,8 @@ For example when `attachable: false` is used with a modal, or if IE11/Edge is us **Bugs** - **Dropdown** - Fixed issue where `onChange` when used with `action: hide` would be missing the third param `$item` #6555 - **Menu/Dropdown** - Fixes dropdown item margin not obeyed inside `labeled icon menu` #6557 - +- **Modal** - Fixes `@mobileTopAlignedMargin` theming variable was not implemented +- **List** - Fixed issue where `content` would not take up 100% width when used alongside `img` or `icon` ### Version 2.3.3 - June 18, 2018 From 824fc8ed1a4d88523d90d91c007f083e117fc27c Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 9 Sep 2018 20:51:15 -0700 Subject: [PATCH 31/89] Slightly modify inline dropdown icon right margin --- src/themes/default/modules/dropdown.variables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/themes/default/modules/dropdown.variables b/src/themes/default/modules/dropdown.variables index 8653fb6b72..6a1cee6153 100755 --- a/src/themes/default/modules/dropdown.variables +++ b/src/themes/default/modules/dropdown.variables @@ -232,7 +232,7 @@ @searchWidescreenMaxMenuHeight: @selectionWidescreenMaxMenuHeight; /* Inline */ -@inlineIconMargin: 0em @relative7px 0em @relative3px; +@inlineIconMargin: 0em @relative3px 0em @relative3px; @inlineTextColor: inherit; @inlineTextFontWeight: @bold; @inlineMenuDistance: @relative3px; From b81abbdf01f2a72718683c3c5f18d281bde2763e Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 9 Sep 2018 21:15:42 -0700 Subject: [PATCH 32/89] #6363 Fixes IE11 placeholder color --- src/definitions/collections/form.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/definitions/collections/form.less b/src/definitions/collections/form.less index 6839e9a083..73ef2a2dbe 100755 --- a/src/definitions/collections/form.less +++ b/src/definitions/collections/form.less @@ -323,7 +323,7 @@ color: @inputPlaceholderColor; } .ui.form :-ms-input-placeholder { - color: @inputPlaceholderColor; + color: @inputPlaceholderColor !important; } .ui.form ::-moz-placeholder { color: @inputPlaceholderColor; @@ -333,7 +333,7 @@ color: @inputPlaceholderFocusColor; } .ui.form :focus:-ms-input-placeholder { - color: @inputPlaceholderFocusColor; + color: @inputPlaceholderFocusColor !important; } .ui.form :focus::-moz-placeholder { color: @inputPlaceholderFocusColor; From 288270661431f4abda0280acc7f3480d84d0e6a2 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 9 Sep 2018 21:57:09 -0700 Subject: [PATCH 33/89] Make values relative --- src/themes/default/elements/loader.variables | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/themes/default/elements/loader.variables b/src/themes/default/elements/loader.variables index 499266525f..a6335add98 100644 --- a/src/themes/default/elements/loader.variables +++ b/src/themes/default/elements/loader.variables @@ -30,30 +30,30 @@ @loaderTextColor: @textColor; @invertedLoaderTextColor: @invertedTextColor; -@contentSpacing: 20px; /* Content Loader Lines */ -@contentLineMargin: @12px; -@contentHeaderLineHeight: @9px; -@contentLineHeight: @7px; +@contentSpacing: @relative20px; +@contentLineMargin: @relative12px; +@contentHeaderLineHeight: @relative9px; +@contentLineHeight: @relative7px; @contentParagraphLineHeight: @contentLineHeight; /* Image */ @contentImageHeight: 100px; /* Header Image */ -@contentImageWidth: 50px; +@contentImageWidth: 3em; @contentImageTextIndent: @10px; /* Paragraph */ @contentHeaderLineOneOutdent: 0px; -@contentHeaderLineTwoOutdent: 8rem; +@contentHeaderLineTwoOutdent: 8em; -@contentLineOneOutdent: 4rem; -@contentLineTwoOutdent: 7rem; -@contentLineThreeOutdent: 2rem; -@contentLineFourOutdent: 6rem; -@contentLineFiveOutdent: 10rem; +@contentLineOneOutdent: 4em; +@contentLineTwoOutdent: 7em; +@contentLineThreeOutdent: 2em; +@contentLineFourOutdent: 6em; +@contentLineFiveOutdent: 10em; /* Glow Gradient */ @contentLoadingAnimationDuration: 2s; From 4944e523672056d64b9bdc964f4775f4874e506f Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 9 Sep 2018 21:57:22 -0700 Subject: [PATCH 34/89] Work on release notes --- RELEASE-NOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 417f5c2211..ae52cc7555 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -14,9 +14,11 @@ For example when `attachable: false` is used with a modal, or if IE11/Edge is us **Bugs** - **Dropdown** - Fixed issue where `onChange` when used with `action: hide` would be missing the third param `$item` #6555 +- **Dimmer** - Dimmer now sets `variation` at runtime, to support run-time swapping between `top aligned` and `middle aligned` using `.dimmer('setting', 'variation', 'top aligned')` - **Menu/Dropdown** - Fixes dropdown item margin not obeyed inside `labeled icon menu` #6557 - **Modal** - Fixes `@mobileTopAlignedMargin` theming variable was not implemented - **List** - Fixed issue where `content` would not take up 100% width when used alongside `img` or `icon` +- **Dropdown** - `inline dropdown` `close icon` default right margin default spacing slightly modified. ### Version 2.3.3 - June 18, 2018 From 41180a760436b2fa93f12b702f8250690298ddd3 Mon Sep 17 00:00:00 2001 From: Pierrick Prudhomme Date: Thu, 13 Sep 2018 11:47:50 +0200 Subject: [PATCH 35/89] Pressing the ESC key won't close all open modals anymore --- src/definitions/modules/modal.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index 4791f63982..4d2d34e274 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -288,7 +288,9 @@ $.fn.modal = function(parameters) { if(keyCode == escapeKey) { if(settings.closable) { module.debug('Escape key pressed hiding modal'); - module.hide(); + if ( $module.hasClass(className.top) ) { + module.hide(); + } } else { module.debug('Escape key pressed, but closable is set to false'); @@ -400,6 +402,8 @@ $.fn.modal = function(parameters) { if( module.is.animating() || module.is.active() ) { if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) { module.remove.active(); + $otherModals.filter('.' + className.active).last().addClass(className.top) + $module.removeClass(className.top); $module .transition({ debug : settings.debug, @@ -411,7 +415,7 @@ $.fn.modal = function(parameters) { if(!module.others.active() && !keepDimmed) { module.hideDimmer(); } - if(settings.keyboardShortcuts) { + if( settings.keyboardShortcuts && !module.others.active() ) { module.remove.keyboardShortcuts(); } }, @@ -690,7 +694,8 @@ $.fn.modal = function(parameters) { } }, active: function() { - $module.addClass(className.active); + $module.addClass(className.active + ' ' + className.top); + $otherModals.filter('.' + className.active).removeClass(className.top) }, scrolling: function() { $dimmable.addClass(className.scrolling); @@ -972,7 +977,8 @@ $.fn.modal.settings = { inverted : 'inverted', loading : 'loading', scrolling : 'scrolling', - undetached : 'undetached' + undetached : 'undetached', + top : 'top' } }; From effcf62ef3aa214218072356a1b05ebd810351d7 Mon Sep 17 00:00:00 2001 From: Sean Date: Thu, 13 Sep 2018 15:06:09 +0100 Subject: [PATCH 36/89] refactor: redesign the README Redesign the README to be more adequate for Fomantic --- README.md | 62 +++++++++++++++++++++++-------------------------------- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 90bcf8c6ea..d0937f5aa1 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,25 @@ -![Semantic](http://fomantic-ui.com/images/logo.png#128) -# Fomantic UI +

+ +

+

Fomantic UI

+

A community fork of the popular Semantic-UI framework

- -[![Discord](https://img.shields.io/discord/453127116427493376.svg?label=Discord)](https://discord.gg/YChxjJ3) -[![npm downloads](https://img.shields.io/npm/dw/fomantic-ui.svg)](https://www.npmjs.com/package/fomantic-ui) -[![npm version](https://img.shields.io/npm/v/fomantic-ui.svg)](https://www.npmjs.com/package/fomantic-ui) -[![last commit](https://img.shields.io/github/last-commit/hammy2899/fomantic-ui.svg)](https://github.com/fomantic/Fomantic-UI/commits/master) - -[Fomantic](http://fomantic-ui.com) is a community fork of the popular Semantic-UI framework. +

+ + + + +

*NOTE:* Fomantic was created to continue active development of Semantic-UI and has the intent to be merged back into the master repository once active development can restart. For more info please read the following issues https://github.com/Semantic-Org/Semantic-UI/issues/6109 https://github.com/Semantic-Org/Semantic-UI/issues/6413 -Key Features -* 50+ UI elements -* 3000 + CSS variables -* 3 Levels of variable inheritance (similar to SublimeText) -* Built with EM values for responsive design -* Flexbox friendly - -Semantic allows developers to build beautiful websites fast, with **concise HTML**, **intuitive javascript**, and **simplified debugging**, helping make front-end development a delightful experience. Semantic is responsively designed allowing your website to scale on multiple devices. Semantic is production ready and partnered with frameworks such as **React**, **Angular**, **Meteor**, and **Ember**, which means you can integrate it with any of these frameworks to organize your UI layer alongside your application logic. - -## User Support - -Please help us keep the issue tracker organized. When creating an issue please complete the issue template and include a test case this helps us solve and label your issues. You can also ask questions on [StackOverflow](http://stackoverflow.com/questions/tagged/semantic-ui) or our [Discord](https://discord.gg/YChxjJ3) - -For more info take a look at our [contributing guide](https://github.com/Semantic-Org/Semantic-UI/blob/master/CONTRIBUTING.md). +Fomantic allows developers to build beautiful websites fast, with **concise HTML**, **intuitive javascript**, and **simplified debugging**, helping make front-end development a delightful experience. Fomantic is responsively designed allowing your website to scale on multiple devices. -## Install +## :satellite: Installation ```bash -npm install fomantic-ui --save +$ npm install fomantic-ui --save ``` Fomantic UI includes an interactive installer to help setup your project. @@ -38,7 +27,7 @@ Fomantic UI includes an interactive installer to help setup your project. * For more details on setup visit our [getting started guide](http://fomantic-ui.com/introduction/getting-started.html). * To learn more about theming please read our [theming guide](http://fomantic-ui.com/usage/theming.html) -#### Browser Support +### :computer: Browser Support * Last 2 Versions FF, Chrome, Safari Mac * IE 11+ @@ -48,25 +37,26 @@ Fomantic UI includes an interactive installer to help setup your project. Although some components will work in IE9, [grids](http://semantic-ui.com/collections/grid.html) and other [flexbox](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes) components are not supported by IE9 and may not appear correctly. -## Community +## :speech_balloon: Community -#### Getting Help +### :bulb: Getting Help -If you have a usage question please **do not post** post it to GitHub Issues. You can ask for usage help via [StackOverflow](http://stackoverflow.com/questions/tagged/semantic-ui) or our [Discord](https://discord.gg/YChxjJ3). +If you have a usage question please **do not post** post it to GitHub Issues. You can ask for usage help via our [Discord](https://discord.gg/YChxjJ3) server. Please only create Github issues for bug's and feature requests or any other related issue. -#### Submitting Bugs and Enhancements -[GitHub Issues](https://github.com/Semantic-Org/Semantic-UI/issues) is for suggesting enhancements and reporting bugs. Before submiting a bug make sure you do the following: +### :bug: Submitting Bugs and Enhancements +[GitHub Issues](https://github.com/fomantic/Fomantic-UI/issues) is for suggesting enhancements and reporting bugs. Before submiting a bug make sure you do the following: * Check to see if the issue has already been raised. -* [Fork this boilerplate JSFiddle](https://jsfiddle.net/ca0rovs3/) to create a test case for your bug. If a bug is apparent in the docs, that's ok as a test case, just make it clear exactly how to reproduce the issue. Only bugs that include a test case can be triaged. -* If submitting an enhancement try and create it in the [JSFiddle](https://jsfiddle.net/ca0rovs3/) if not it's fine but explain clearly what you want. +* [Fork this boilerplate JSFiddle](https://jsfiddle.net/31d6y7mn) to create a test case for your bug. If a bug is apparent in the docs, that's ok as a test case, just make it clear exactly how to reproduce the issue. Only bugs that include a test case can be triaged. +* If submitting an enhancement try and create it in the [JSFiddle](https://jsfiddle.net/31d6y7mn) if not it's fine but explain clearly what you want. +### :memo: Pull Requests -#### Pull Requests +Before creating a pull request be sure to read the [contributing](CONTRIBUTING.md) guide, this is where we explain everything you need to know about contributing to Fomantic-UI. -When adding pull requests, be sure to merge into the [beta](https://github.com/fomantic/Fomantic-UI/tree/beta) branch. +## Sponsors -### Cross-browser testing provided by +#### Cross-browser testing provided by [BrowserStack](https://www.browserstack.com) [![BrowserStack](https://cdn.rawgit.com/fomantic/Fomantic-UI-Docs/35180e95/server/raw/images/browserstack.png)](https://www.browserstack.com) #### Credit From 8f95ac6c25526c781f600dd5b0b1fc87b79638bc Mon Sep 17 00:00:00 2001 From: Pierrick Prudhomme Date: Fri, 14 Sep 2018 10:23:28 +0200 Subject: [PATCH 37/89] Lower modals are not accessible anymore in multiple modals --- src/definitions/modules/modal.js | 47 ++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index 4d2d34e274..e2aa472284 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -88,6 +88,11 @@ $.fn.modal = function(parameters) { module.create.id(); module.create.dimmer(); + + if ( settings.allowMultiple ) { + module.create.innerDimmer(); + } + module.refreshModals(); module.bind.events(); @@ -137,6 +142,11 @@ $.fn.modal = function(parameters) { id = (Math.random().toString(16) + '000000000').substr(2,8); elementEventNamespace = '.' + id; module.verbose('Creating unique id for element', id); + }, + innerDimmer: function() { + if ( $module.find(selector.dimmer).length == 0 ) { + $module.prepend('
'); + } } }, @@ -269,10 +279,10 @@ $.fn.modal = function(parameters) { module.debug('Dimmer clicked, hiding all modals'); module.remove.clickaway(); if(settings.allowMultiple) { - module.hide(); + module.hideAll(); } else { - module.hideAll(); + module.hide(); } } }, @@ -350,8 +360,14 @@ $.fn.modal = function(parameters) { module.hideOthers(module.showModal); } else { - if(settings.allowMultiple && settings.detachable) { - $module.detach().appendTo($dimmer); + if( settings.allowMultiple ) { + if ( module.others.active() ) { + $otherModals.filter('.' + className.active).find(selector.dimmer).addClass('active') + } + + if ( settings.detachable ) { + $module.detach().appendTo($dimmer); + } } settings.onShow.call(element); if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) { @@ -388,7 +404,10 @@ $.fn.modal = function(parameters) { } }, - hideModal: function(callback, keepDimmed) { + hideModal: function(callback, keepDimmed, hideOthersToo) { + var + $previousModal = $otherModals.filter('.' + className.active).last() + ; callback = $.isFunction(callback) ? callback : function(){} @@ -402,8 +421,6 @@ $.fn.modal = function(parameters) { if( module.is.animating() || module.is.active() ) { if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) { module.remove.active(); - $otherModals.filter('.' + className.active).last().addClass(className.top) - $module.removeClass(className.top); $module .transition({ debug : settings.debug, @@ -420,6 +437,17 @@ $.fn.modal = function(parameters) { } }, onComplete : function() { + if ( settings.allowMultiple ) { + $previousModal.addClass(className.top); + $module.removeClass(className.top); + + if ( hideOthersToo ) { + $allModals.find(selector.dimmer).removeClass('active') + } + else { + $previousModal.find(selector.dimmer).removeClass('active') + } + } settings.onHidden.call(element); module.restore.focus(); callback(); @@ -468,7 +496,7 @@ $.fn.modal = function(parameters) { module.debug('Hiding all visible modals'); module.hideDimmer(); $visibleModals - .modal('hide modal', callback) + .modal('hide modal', callback, false, true) ; } }, @@ -963,7 +991,8 @@ $.fn.modal.settings = { close : '> .close', approve : '.actions .positive, .actions .approve, .actions .ok', deny : '.actions .negative, .actions .deny, .actions .cancel', - modal : '.ui.modal' + modal : '.ui.modal', + dimmer : '> .ui.dimmer' }, error : { dimmer : 'UI Dimmer, a required component is not included in this page', From bd47451f254ec84f3c89f18f21357a36c0d72c5b Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 16 Sep 2018 16:02:22 -0700 Subject: [PATCH 38/89] Force auto width/height for content loaders --- src/definitions/elements/loader.less | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/definitions/elements/loader.less b/src/definitions/elements/loader.less index 8e8b0ad74d..060c6684ea 100755 --- a/src/definitions/elements/loader.less +++ b/src/definitions/elements/loader.less @@ -172,8 +172,6 @@ left: 0px; top: 0px; transform: none; - width: auto; - height: auto; margin: 0em; will-change: background-position, transform; overflow: hidden; @@ -185,6 +183,10 @@ background-size: @contentLoadingGradientWidth 100%; max-width: @contentLoaderMaxWidth; } +.ui.content.content.loader { + width: auto; + height: auto; +} .ui.content.loader, .ui.content.loader > :before, From d6ebab1e6c171cd8870d903c7761ed4cc9b525f1 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 16 Sep 2018 16:24:56 -0700 Subject: [PATCH 39/89] #6449 #6495 - Adapt fix for dimmer scroll. Move to modal from dimmer. Blocking scroll requires determining content height which only modal can do --- src/definitions/modules/dimmer.js | 12 ------------ src/definitions/modules/modal.js | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/definitions/modules/dimmer.js b/src/definitions/modules/dimmer.js index a3ce995e88..49bf63e601 100755 --- a/src/definitions/modules/dimmer.js +++ b/src/definitions/modules/dimmer.js @@ -157,9 +157,6 @@ $.fn.dimmer = function(parameters) { event.stopImmediatePropagation(); } }, - preventScroll: function(event) { - event.preventDefault(); - } }, addContent: function(element) { @@ -197,11 +194,6 @@ $.fn.dimmer = function(parameters) { module.animate.show(callback); settings.onShow.call(element); settings.onChange.call(element); - - if(module.is.page()) { - // touch events default to passive, due to changes in chrome to optimize mobile perf - $dimmable.get(0).addEventListener('touchmove', module.event.preventScroll, { passive: false }); - } } else { module.debug('Dimmer is already shown or disabled'); @@ -218,10 +210,6 @@ $.fn.dimmer = function(parameters) { module.animate.hide(callback); settings.onHide.call(element); settings.onChange.call(element); - - if(module.is.page()) { - $dimmable.get(0).removeEventListener('touchmove', module.event.preventScroll, { passive: false }); - } } else { module.debug('Dimmer is not visible'); diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index 40bb02f834..9f402a6973 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -209,6 +209,16 @@ $.fn.modal = function(parameters) { $window .on('resize' + elementEventNamespace, module.event.resize) ; + }, + scrollLock: function() { + // touch events default to passive, due to changes in chrome to optimize mobile perf + $dimmable.get(0).addEventListener('touchmove', module.event.preventScroll, { passive: false }); + } + }, + + unbind: { + scrollLock: function() { + $dimmable.get(0).removeEventListener('touchmove', module.event.preventScroll, { passive: false }); } }, @@ -229,6 +239,9 @@ $.fn.modal = function(parameters) { ignoreRepeatedEvents = false; }); }, + preventScroll: function(event) { + event.preventDefault(); + }, deny: function() { if(ignoreRepeatedEvents || settings.onDeny.call(element, $(this)) === false) { module.verbose('Deny callback returned false cancelling hide'); @@ -304,7 +317,6 @@ $.fn.modal = function(parameters) { ? callback : function(){} ; - console.log('test'); module.refreshModals(); module.set.dimmerSettings(); module.showModal(callback); @@ -315,6 +327,7 @@ $.fn.modal = function(parameters) { ? callback : function(){} ; + module.unbind.scrollLock(); module.refreshModals(); module.hideModal(callback); }, @@ -718,15 +731,18 @@ $.fn.modal = function(parameters) { scrolling: function() { $dimmable.addClass(className.scrolling); $module.addClass(className.scrolling); + module.unbind.scrollLock(); }, legacy: function() { $module.addClass(className.legacy); }, type: function() { + console.log('setting'); if(module.can.fit()) { module.verbose('Modal fits on screen'); if(!module.others.active() && !module.others.animating()) { module.remove.scrolling(); + module.bind.scrollLock(); } } else { From 3b452eebc111e71b014e507d0043e191c6ab128d Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 16 Sep 2018 16:26:05 -0700 Subject: [PATCH 40/89] Rlsnotes #6449 #6495 --- RELEASE-NOTES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index ae52cc7555..4c7eb20dc1 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -12,6 +12,9 @@ For example when `attachable: false` is used with a modal, or if IE11/Edge is used (Absolutely positioned elements inside flex containers in IE behave differently) +**Critical Bugs** +- **Modal** - Fixed issue where `scrolling modal` would not allow for scrolling with touch devices (including mobile). #6449 + **Bugs** - **Dropdown** - Fixed issue where `onChange` when used with `action: hide` would be missing the third param `$item` #6555 - **Dimmer** - Dimmer now sets `variation` at runtime, to support run-time swapping between `top aligned` and `middle aligned` using `.dimmer('setting', 'variation', 'top aligned')` From cd3850fcc3cd1ee5d43c5fbc798d4f02a65dedf7 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 16 Sep 2018 16:31:24 -0700 Subject: [PATCH 41/89] Fix #6439, basic colored labels do not have correct background --- src/definitions/elements/label.less | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/definitions/elements/label.less b/src/definitions/elements/label.less index fcd066a1d7..786930587e 100755 --- a/src/definitions/elements/label.less +++ b/src/definitions/elements/label.less @@ -566,7 +566,7 @@ a.ui.red.label:hover{ } /* Basic */ .ui.basic.red.label { - background-color: @basicBackground !important; + background: @basicBackground !important; color: @red !important; border-color: @red !important; } @@ -602,7 +602,7 @@ a.ui.orange.label:hover{ } /* Basic */ .ui.basic.orange.label { - background-color: @basicBackground !important; + background: @basicBackground !important; color: @orange !important; border-color: @orange !important; } @@ -638,7 +638,7 @@ a.ui.yellow.label:hover{ } /* Basic */ .ui.basic.yellow.label { - background-color: @basicBackground !important; + background: @basicBackground !important; color: @yellow !important; border-color: @yellow !important; } @@ -674,7 +674,7 @@ a.ui.olive.label:hover{ } /* Basic */ .ui.basic.olive.label { - background-color: @basicBackground !important; + background: @basicBackground !important; color: @olive !important; border-color: @olive !important; } @@ -710,7 +710,7 @@ a.ui.green.label:hover{ } /* Basic */ .ui.basic.green.label { - background-color: @basicBackground !important; + background: @basicBackground !important; color: @green !important; border-color: @green !important; } @@ -746,7 +746,7 @@ a.ui.teal.label:hover{ } /* Basic */ .ui.basic.teal.label { - background-color: @basicBackground !important; + background: @basicBackground !important; color: @teal !important; border-color: @teal !important; } @@ -782,7 +782,7 @@ a.ui.blue.label:hover{ } /* Basic */ .ui.basic.blue.label { - background-color: @basicBackground !important; + background: @basicBackground !important; color: @blue !important; border-color: @blue !important; } @@ -818,7 +818,7 @@ a.ui.violet.label:hover{ } /* Basic */ .ui.basic.violet.label { - background-color: @basicBackground !important; + background: @basicBackground !important; color: @violet !important; border-color: @violet !important; } @@ -854,7 +854,7 @@ a.ui.purple.label:hover{ } /* Basic */ .ui.basic.purple.label { - background-color: @basicBackground !important; + background: @basicBackground !important; color: @purple !important; border-color: @purple !important; } @@ -890,7 +890,7 @@ a.ui.pink.label:hover{ } /* Basic */ .ui.basic.pink.label { - background-color: @basicBackground !important; + background: @basicBackground !important; color: @pink !important; border-color: @pink !important; } @@ -926,7 +926,7 @@ a.ui.brown.label:hover{ } /* Basic */ .ui.basic.brown.label { - background-color: @basicBackground !important; + background: @basicBackground !important; color: @brown !important; border-color: @brown !important; } @@ -962,7 +962,7 @@ a.ui.grey.label:hover{ } /* Basic */ .ui.basic.grey.label { - background-color: @basicBackground !important; + background: @basicBackground !important; color: @grey !important; border-color: @grey !important; } @@ -998,7 +998,7 @@ a.ui.black.label:hover{ } /* Basic */ .ui.basic.black.label { - background-color: @basicBackground !important; + background: @basicBackground !important; color: @black !important; border-color: @black !important; } From 8a1ad49be101a99987f4818eb4d37f967ccfac11 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 16 Sep 2018 17:23:47 -0700 Subject: [PATCH 42/89] #6520 - remove blurring on dimmer hide. Remove console logs. --- RELEASE-NOTES.md | 3 ++- src/definitions/modules/modal.js | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 4c7eb20dc1..7e76f7e23f 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -13,11 +13,12 @@ For example when `attachable: false` is used with a modal, or if IE11/Edge is used (Absolutely positioned elements inside flex containers in IE behave differently) **Critical Bugs** -- **Modal** - Fixed issue where `scrolling modal` would not allow for scrolling with touch devices (including mobile). #6449 +- **Modal** - Fixed issue where `scrolling modal` would not allow for scrolling with touch devices. #6449 **Bugs** - **Dropdown** - Fixed issue where `onChange` when used with `action: hide` would be missing the third param `$item` #6555 - **Dimmer** - Dimmer now sets `variation` at runtime, to support run-time swapping between `top aligned` and `middle aligned` using `.dimmer('setting', 'variation', 'top aligned')` +- **Modal** - Modal now will remove `blurring` after undimming, to prevent issues with position: fixed #6520 - **Menu/Dropdown** - Fixes dropdown item margin not obeyed inside `labeled icon menu` #6557 - **Modal** - Fixes `@mobileTopAlignedMargin` theming variable was not implemented - **List** - Fixed issue where `content` would not take up 100% width when used alongside `img` or `icon` diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index 9f402a6973..d2793ee0a7 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -319,6 +319,8 @@ $.fn.modal = function(parameters) { ; module.refreshModals(); module.set.dimmerSettings(); + module.set.dimmerStyles(); + module.showModal(callback); }, @@ -327,7 +329,6 @@ $.fn.modal = function(parameters) { ? callback : function(){} ; - module.unbind.scrollLock(); module.refreshModals(); module.hideModal(callback); }, @@ -425,6 +426,7 @@ $.fn.modal = function(parameters) { }, onComplete : function() { settings.onHidden.call(element); + module.remove.dimmerStyles(); module.restore.focus(); callback(); } @@ -449,6 +451,7 @@ $.fn.modal = function(parameters) { hideDimmer: function() { if( $dimmable.dimmer('is animating') || ($dimmable.dimmer('is active')) ) { + module.unbind.scrollLock(); $dimmable.dimmer('hide', function() { module.remove.clickaway(); module.remove.screenHeight(); @@ -544,6 +547,10 @@ $.fn.modal = function(parameters) { .off('click' + elementEventNamespace) ; }, + dimmerStyles: function() { + $dimmer.removeClass(className.inverted); + $dimmable.removeClass(className.blurring); + }, bodyStyle: function() { if($body.attr('style') === '') { module.verbose('Removing style attribute'); @@ -685,6 +692,11 @@ $.fn.modal = function(parameters) { ? dimmerSettings.variation + ' inverted' : 'inverted' ; + } + $context.dimmer('setting', dimmerSettings); + }, + dimmerStyles: function() { + if(settings.inverted) { $dimmer.addClass(className.inverted); } else { @@ -696,14 +708,12 @@ $.fn.modal = function(parameters) { else { $dimmable.removeClass(className.blurring); } - $context.dimmer('setting', dimmerSettings); }, modalOffset: function() { var width = module.cache.width, height = module.cache.height ; - console.log(module.can.fit()); $module .css({ marginTop: (settings.centered && module.can.fit()) @@ -737,7 +747,6 @@ $.fn.modal = function(parameters) { $module.addClass(className.legacy); }, type: function() { - console.log('setting'); if(module.can.fit()) { module.verbose('Modal fits on screen'); if(!module.others.active() && !module.others.animating()) { From 39a4348d541ec6060d07bc72ae58a03c7d5999db Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 16 Sep 2018 17:29:39 -0700 Subject: [PATCH 43/89] Fix alias for disk outline icon #6556 --- RELEASE-NOTES.md | 1 + src/themes/default/elements/icon.overrides | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/themes/default/elements/icon.overrides diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 7e76f7e23f..7bb8fff3ec 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -23,6 +23,7 @@ For example when `attachable: false` is used with a modal, or if IE11/Edge is us - **Modal** - Fixes `@mobileTopAlignedMargin` theming variable was not implemented - **List** - Fixed issue where `content` would not take up 100% width when used alongside `img` or `icon` - **Dropdown** - `inline dropdown` `close icon` default right margin default spacing slightly modified. +- **Icon** - Fixes missing `disk outline icon` alias #6556 ### Version 2.3.3 - June 18, 2018 diff --git a/src/themes/default/elements/icon.overrides b/src/themes/default/elements/icon.overrides old mode 100644 new mode 100755 index 6c10b6c9ec..8dbaaa5d63 --- a/src/themes/default/elements/icon.overrides +++ b/src/themes/default/elements/icon.overrides @@ -1350,9 +1350,9 @@ i.icon.youtube.play:before { content: "\f167"; } i.icon.window.maximize.outline:before { content: "\f2d0"; } i.icon.window.minimize.outline:before { content: "\f2d1"; } i.icon.window.restore.outline:before { content: "\f2d2"; } - i.icon.disk.outline:before { content: "\f369"; } /* Outline Aliases */ + i.icon.disk.outline:before { content: "\f0A0"; } i.icon.heart.empty, i.icon.star.empty { font-family: @outlineFontName; From 4326ad8a060008207acfce1af0af4a507dd58157 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 16 Sep 2018 17:30:13 -0700 Subject: [PATCH 44/89] hex case for disk #6556 --- src/themes/default/elements/icon.overrides | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/themes/default/elements/icon.overrides b/src/themes/default/elements/icon.overrides index 8dbaaa5d63..f7471586ff 100755 --- a/src/themes/default/elements/icon.overrides +++ b/src/themes/default/elements/icon.overrides @@ -1352,7 +1352,7 @@ i.icon.youtube.play:before { content: "\f167"; } i.icon.window.restore.outline:before { content: "\f2d2"; } /* Outline Aliases */ - i.icon.disk.outline:before { content: "\f0A0"; } + i.icon.disk.outline:before { content: "\f0a0"; } i.icon.heart.empty, i.icon.star.empty { font-family: @outlineFontName; From 1626dc1a0808e72661ec863382ef9fffa8e8f645 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 16 Sep 2018 17:59:23 -0700 Subject: [PATCH 45/89] #6531 - Add UK alias for united kingdom --- RELEASE-NOTES.md | 1 + src/themes/default/elements/flag.overrides | 1 + 2 files changed, 2 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index fca02e69f9..48352aa9c1 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -24,6 +24,7 @@ For example when `attachable: false` is used with a modal, or if IE11/Edge is us - **List** - Fixed issue where `content` would not take up 100% width when used alongside `img` or `icon` - **Dropdown** - `inline dropdown` `close icon` default right margin default spacing slightly modified. - **Icon** - Fixes missing `disk outline icon` alias #6556 +- **Flag** - Add `uk` alias for `united kingdom` #6531 ### Version 2.3.3 - July 8th, 2018 diff --git a/src/themes/default/elements/flag.overrides b/src/themes/default/elements/flag.overrides index 20f5056eb1..6a0f9216c1 100644 --- a/src/themes/default/elements/flag.overrides +++ b/src/themes/default/elements/flag.overrides @@ -310,6 +310,7 @@ i.flag.gabon:before { background-position: -36px 0px; } i.flag.gb:before, +i.flag.uk:before, i.flag.united.kingdom:before { background-position: -36px -26px; } From 14dc9179c15b390fcd3644d0a6d68341565c0191 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 16 Sep 2018 18:11:34 -0700 Subject: [PATCH 46/89] Thanks #6531 --- RELEASE-NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 48352aa9c1..71f45e54ff 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -24,7 +24,7 @@ For example when `attachable: false` is used with a modal, or if IE11/Edge is us - **List** - Fixed issue where `content` would not take up 100% width when used alongside `img` or `icon` - **Dropdown** - `inline dropdown` `close icon` default right margin default spacing slightly modified. - **Icon** - Fixes missing `disk outline icon` alias #6556 -- **Flag** - Add `uk` alias for `united kingdom` #6531 +- **Flag** - Add `uk` alias for `united kingdom` **Thanks @PhilipGarnero** #6531 ### Version 2.3.3 - July 8th, 2018 From 56366b96d31af4253eb8c4bfc37b6f2b376cec65 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 16 Sep 2018 18:26:55 -0700 Subject: [PATCH 47/89] Fix dropdown opening leftward inside menu --- RELEASE-NOTES.md | 3 ++- src/definitions/collections/menu.less | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 71f45e54ff..5b6d644d7b 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -17,8 +17,9 @@ For example when `attachable: false` is used with a modal, or if IE11/Edge is us **Bugs** - **Dropdown** - Fixed issue where `onChange` when used with `action: hide` would be missing the third param `$item` #6555 +- **Menu/Dropdown** - Fixed `left menu` inside `ui menu` would display horizontally as `flex` #6359 - **Dimmer** - Dimmer now sets `variation` at runtime, to support run-time swapping between `top aligned` and `middle aligned` using `.dimmer('setting', 'variation', 'top aligned')` -- **Modal** - Modal now will remove `blurring` after undimming, to prevent issues with position: fixed #6520 +- **Modal** - Modal now will remove `blurring` after undimming, to prevent issues with `position: fixed` #6520 - **Menu/Dropdown** - Fixes dropdown item margin not obeyed inside `labeled icon menu` #6557 - **Modal** - Fixes `@mobileTopAlignedMargin` theming variable was not implemented - **List** - Fixed issue where `content` would not take up 100% width when used alongside `img` or `icon` diff --git a/src/definitions/collections/menu.less b/src/definitions/collections/menu.less index cd40d5b3bb..3806b0075e 100755 --- a/src/definitions/collections/menu.less +++ b/src/definitions/collections/menu.less @@ -468,7 +468,7 @@ Floated Menu / Item /* Left Floated */ .ui.menu:not(.vertical) .left.item, -.ui.menu:not(.vertical) .left.menu { +.ui.menu:not(.vertical) :not(.dropdown) > .left.menu { display: flex; margin-right: auto !important; } From 0c61a7e72c61751a97bc694f47e1f920e386329b Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 16 Sep 2018 18:27:25 -0700 Subject: [PATCH 48/89] Remove comment --- src/definitions/elements/loader.less | 1 - 1 file changed, 1 deletion(-) diff --git a/src/definitions/elements/loader.less b/src/definitions/elements/loader.less index 060c6684ea..c1d9d3d9cb 100755 --- a/src/definitions/elements/loader.less +++ b/src/definitions/elements/loader.less @@ -166,7 +166,6 @@ Content --------------------*/ -/* Placeholder Paragraph */ .ui.content.loader { position: static; left: 0px; From e83855cdd351b752c988b5e608471ac6ae1882e7 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 16 Sep 2018 19:44:19 -0700 Subject: [PATCH 49/89] Move content loader to new component, placeholder. Modify placeholder segment to be 'empty segment' --- dist/components/dimmer.js | 39 ++-- dist/components/dimmer.min.js | 2 +- dist/components/dropdown.js | 31 ++- dist/components/dropdown.min.js | 2 +- dist/components/flag.css | 1 + dist/components/flag.min.css | 2 +- dist/components/icon.css | 6 +- dist/components/icon.min.css | 2 +- dist/components/label.css | 26 +-- dist/components/label.min.css | 2 +- dist/components/list.css | 2 + dist/components/list.min.css | 2 +- dist/components/modal.js | 95 +++++++- dist/components/modal.min.js | 2 +- dist/components/popup.js | 19 +- dist/components/popup.min.js | 2 +- dist/semantic.css | 35 +-- dist/semantic.js | 184 ++++++++++++--- dist/semantic.min.css | 8 +- dist/semantic.min.js | 2 +- src/definitions/elements/loader.less | 189 ---------------- src/definitions/elements/placeholder.less | 213 ++++++++++++++++++ src/definitions/elements/segment.less | 38 ++-- src/theme.config.example | 1 + src/themes/default/elements/loader.variables | 39 ---- .../default/elements/placeholder.overrides | 3 + .../default/elements/placeholder.variables | 49 ++++ src/themes/default/elements/segment.variables | 10 +- tasks/config/admin/release.js | 1 + tasks/config/defaults.js | 1 + tasks/config/project/install.js | 1 + 31 files changed, 648 insertions(+), 361 deletions(-) create mode 100644 src/definitions/elements/placeholder.less create mode 100644 src/themes/default/elements/placeholder.overrides create mode 100644 src/themes/default/elements/placeholder.variables diff --git a/dist/components/dimmer.js b/dist/components/dimmer.js index fa5862d1b8..4a2f6b11b9 100755 --- a/dist/components/dimmer.js +++ b/dist/components/dimmer.js @@ -83,7 +83,6 @@ $.fn.dimmer = function(parameters) { else { $dimmer = module.create(); } - module.set.variation(); } }, @@ -114,10 +113,6 @@ $.fn.dimmer = function(parameters) { bind: { events: function() { - if(module.is.page()) { - // touch events default to passive, due to changes in chrome to optimize mobile perf - $dimmable.get(0).addEventListener('touchmove', module.event.preventScroll, { passive: false }); - } if(settings.on == 'hover') { $dimmable .on('mouseenter' + eventNamespace, module.show) @@ -145,9 +140,6 @@ $.fn.dimmer = function(parameters) { unbind: { events: function() { - if(module.is.page()) { - $dimmable.get(0).removeEventListener('touchmove', module.event.preventScroll, { passive: false }); - } $module .removeData(moduleNamespace) ; @@ -165,9 +157,6 @@ $.fn.dimmer = function(parameters) { event.stopImmediatePropagation(); } }, - preventScroll: function(event) { - event.preventDefault(); - } }, addContent: function(element) { @@ -200,6 +189,7 @@ $.fn.dimmer = function(parameters) { : function(){} ; module.debug('Showing dimmer', $dimmer, settings); + module.set.variation(); if( (!module.is.dimmed() || module.is.animating()) && module.is.enabled() ) { module.animate.show(callback); settings.onShow.call(element); @@ -243,12 +233,22 @@ $.fn.dimmer = function(parameters) { : function(){} ; if(settings.useCSS && $.fn.transition !== undefined && $dimmer.transition('is supported')) { + if(settings.useFlex) { + module.debug('Using flex dimmer'); + module.remove.legacy(); + } + else { + module.debug('Using legacy non-flex dimmer'); + module.set.legacy(); + } if(settings.opacity !== 'auto') { module.set.opacity(); } $dimmer .transition({ - displayType : 'flex', + displayType : settings.useFlex + ? 'flex' + : 'block', animation : settings.transition + ' in', queue : false, duration : module.get.duration(), @@ -293,7 +293,9 @@ $.fn.dimmer = function(parameters) { module.verbose('Hiding dimmer with css'); $dimmer .transition({ - displayType : 'flex', + displayType : settings.useFlex + ? 'flex' + : 'block', animation : settings.transition + ' out', queue : false, duration : module.get.duration(), @@ -302,6 +304,7 @@ $.fn.dimmer = function(parameters) { module.remove.dimmed(); }, onComplete : function() { + module.remove.variation(); module.remove.active(); callback(); } @@ -415,6 +418,9 @@ $.fn.dimmer = function(parameters) { module.debug('Setting opacity to', opacity); $dimmer.css('background-color', color); }, + legacy: function() { + $dimmer.addClass(className.legacy); + }, active: function() { $dimmer.addClass(className.active); }, @@ -444,6 +450,9 @@ $.fn.dimmer = function(parameters) { .removeClass(className.active) ; }, + legacy: function() { + $dimmer.removeClass(className.legacy); + }, dimmed: function() { $dimmable.removeClass(className.dimmed); }, @@ -657,6 +666,9 @@ $.fn.dimmer.settings = { verbose : false, performance : true, + // whether should use flex layout + useFlex : true, + // name to distinguish between multiple dimmers in context dimmerName : false, @@ -700,6 +712,7 @@ $.fn.dimmer.settings = { dimmer : 'dimmer', disabled : 'disabled', hide : 'hide', + legacy : 'legacy', pageDimmer : 'page', show : 'show' }, diff --git a/dist/components/dimmer.min.js b/dist/components/dimmer.min.js index 94fa317df8..a23a505eb2 100755 --- a/dist/components/dimmer.min.js +++ b/dist/components/dimmer.min.js @@ -1 +1 @@ -!function(e,i,n,t){"use strict";i=void 0!==i&&i.Math==Math?i:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.dimmer=function(i){var o,a=e(this),r=(new Date).getTime(),s=[],m=arguments[0],d="string"==typeof m,c=[].slice.call(arguments,1);return a.each(function(){var l,u,f,g=e.isPlainObject(i)?e.extend(!0,{},e.fn.dimmer.settings,i):e.extend({},e.fn.dimmer.settings),p=g.selector,v=g.namespace,h=g.className,b=g.error,y="."+v,C="module-"+v,w=a.selector||"",S="ontouchstart"in n.documentElement?"touchstart":"click",D=e(this),T=this,N=D.data(C);(f={preinitialize:function(){f.is.dimmer()?(u=D.parent(),l=D):(u=D,l=f.has.dimmer()?g.dimmerName?u.find(p.dimmer).filter("."+g.dimmerName):u.find(p.dimmer):f.create(),f.set.variation())},initialize:function(){f.debug("Initializing dimmer",g),f.bind.events(),f.set.dimmable(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),N=f,D.data(C,N)},destroy:function(){f.verbose("Destroying previous module",l),f.unbind.events(),f.remove.variation(),u.off(y)},bind:{events:function(){f.is.page()&&u.get(0).addEventListener("touchmove",f.event.preventScroll,{passive:!1}),"hover"==g.on?u.on("mouseenter"+y,f.show).on("mouseleave"+y,f.hide):"click"==g.on&&u.on(S+y,f.toggle),f.is.page()&&(f.debug("Setting as a page dimmer",u),f.set.pageDimmer()),f.is.closable()&&(f.verbose("Adding dimmer close event",l),u.on(S+y,p.dimmer,f.event.click))}},unbind:{events:function(){f.is.page()&&u.get(0).removeEventListener("touchmove",f.event.preventScroll,{passive:!1}),D.removeData(C),u.off(y)}},event:{click:function(i){f.verbose("Determining if event occured on dimmer",i),(0===l.find(i.target).length||e(i.target).is(p.content))&&(f.hide(),i.stopImmediatePropagation())},preventScroll:function(e){e.preventDefault()}},addContent:function(i){var n=e(i);f.debug("Add content to dimmer",n),n.parent()[0]!==l[0]&&n.detach().appendTo(l)},create:function(){var i=e(g.template.dimmer());return g.dimmerName&&(f.debug("Creating named dimmer",g.dimmerName),i.addClass(g.dimmerName)),i.appendTo(u),i},show:function(i){i=e.isFunction(i)?i:function(){},f.debug("Showing dimmer",l,g),f.is.dimmed()&&!f.is.animating()||!f.is.enabled()?f.debug("Dimmer is already shown or disabled"):(f.animate.show(i),g.onShow.call(T),g.onChange.call(T))},hide:function(i){i=e.isFunction(i)?i:function(){},f.is.dimmed()||f.is.animating()?(f.debug("Hiding dimmer",l),f.animate.hide(i),g.onHide.call(T),g.onChange.call(T)):f.debug("Dimmer is not visible")},toggle:function(){f.verbose("Toggling dimmer visibility",l),f.is.dimmed()?f.hide():f.show()},animate:{show:function(i){i=e.isFunction(i)?i:function(){},g.useCSS&&e.fn.transition!==t&&l.transition("is supported")?("auto"!==g.opacity&&f.set.opacity(),l.transition({displayType:"flex",animation:g.transition+" in",queue:!1,duration:f.get.duration(),useFailSafe:!0,onStart:function(){f.set.dimmed()},onComplete:function(){f.set.active(),i()}})):(f.verbose("Showing dimmer animation with javascript"),f.set.dimmed(),"auto"==g.opacity&&(g.opacity=.8),l.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(f.get.duration(),g.opacity,function(){l.removeAttr("style"),f.set.active(),i()}))},hide:function(i){i=e.isFunction(i)?i:function(){},g.useCSS&&e.fn.transition!==t&&l.transition("is supported")?(f.verbose("Hiding dimmer with css"),l.transition({displayType:"flex",animation:g.transition+" out",queue:!1,duration:f.get.duration(),useFailSafe:!0,onStart:function(){f.remove.dimmed()},onComplete:function(){f.remove.active(),i()}})):(f.verbose("Hiding dimmer with javascript"),f.remove.dimmed(),l.stop().fadeOut(f.get.duration(),function(){f.remove.active(),l.removeAttr("style"),i()}))}},get:{dimmer:function(){return l},duration:function(){return"object"==typeof g.duration?f.is.active()?g.duration.hide:g.duration.show:g.duration}},has:{dimmer:function(){return g.dimmerName?D.find(p.dimmer).filter("."+g.dimmerName).length>0:D.find(p.dimmer).length>0}},is:{active:function(){return l.hasClass(h.active)},animating:function(){return l.is(":animated")||l.hasClass(h.animating)},closable:function(){return"auto"==g.closable?"hover"!=g.on:g.closable},dimmer:function(){return D.hasClass(h.dimmer)},dimmable:function(){return D.hasClass(h.dimmable)},dimmed:function(){return u.hasClass(h.dimmed)},disabled:function(){return u.hasClass(h.disabled)},enabled:function(){return!f.is.disabled()},page:function(){return u.is("body")},pageDimmer:function(){return l.hasClass(h.pageDimmer)}},can:{show:function(){return!l.hasClass(h.disabled)}},set:{opacity:function(e){var i=l.css("background-color"),n=i.split(","),t=n&&3==n.length,o=n&&4==n.length;e=0===g.opacity?0:g.opacity||e,t||o?(n[3]=e+")",i=n.join(",")):i="rgba(0, 0, 0, "+e+")",f.debug("Setting opacity to",e),l.css("background-color",i)},active:function(){l.addClass(h.active)},dimmable:function(){u.addClass(h.dimmable)},dimmed:function(){u.addClass(h.dimmed)},pageDimmer:function(){l.addClass(h.pageDimmer)},disabled:function(){l.addClass(h.disabled)},variation:function(e){(e=e||g.variation)&&l.addClass(e)}},remove:{active:function(){l.removeClass(h.active)},dimmed:function(){u.removeClass(h.dimmed)},disabled:function(){l.removeClass(h.disabled)},variation:function(e){(e=e||g.variation)&&l.removeClass(e)}},setting:function(i,n){if(f.debug("Changing setting",i,n),e.isPlainObject(i))e.extend(!0,g,i);else{if(n===t)return g[i];e.isPlainObject(g[i])?e.extend(!0,g[i],n):g[i]=n}},internal:function(i,n){if(e.isPlainObject(i))e.extend(!0,f,i);else{if(n===t)return f[i];f[i]=n}},debug:function(){!g.silent&&g.debug&&(g.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,g.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!g.silent&&g.verbose&&g.debug&&(g.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),f.verbose.apply(console,arguments)))},error:function(){g.silent||(f.error=Function.prototype.bind.call(console.error,console,g.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var i,n;g.performance&&(n=(i=(new Date).getTime())-(r||i),r=i,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:T,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var i=g.name+":",n=0;r=!1,clearTimeout(f.performance.timer),e.each(s,function(e,i){n+=i["Execution Time"]}),i+=" "+n+"ms",w&&(i+=" '"+w+"'"),a.length>1&&(i+=" ("+a.length+")"),(console.group!==t||console.table!==t)&&s.length>0&&(console.groupCollapsed(i),console.table?console.table(s):e.each(s,function(e,i){console.log(i.Name+": "+i["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(i,n,a){var r,s,m,d=N;return n=n||c,a=T||a,"string"==typeof i&&d!==t&&(i=i.split(/[\. ]/),r=i.length-1,e.each(i,function(n,o){var a=n!=r?o+i[n+1].charAt(0).toUpperCase()+i[n+1].slice(1):i;if(e.isPlainObject(d[a])&&n!=r)d=d[a];else{if(d[a]!==t)return s=d[a],!1;if(!e.isPlainObject(d[o])||n==r)return d[o]!==t?(s=d[o],!1):(f.error(b.method,i),!1);d=d[o]}})),e.isFunction(s)?m=s.apply(a,n):s!==t&&(m=s),e.isArray(o)?o.push(m):o!==t?o=[o,m]:m!==t&&(o=m),s}}).preinitialize(),d?(N===t&&f.initialize(),f.invoke(m)):(N!==t&&N.invoke("destroy"),f.initialize())}),o!==t?o:this},e.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",silent:!1,debug:!1,verbose:!1,performance:!0,dimmerName:!1,variation:!1,closable:"auto",useCSS:!0,transition:"fade",on:!1,opacity:"auto",duration:{show:500,hide:500},onChange:function(){},onShow:function(){},onHide:function(){},error:{method:"The method you called is not defined."},className:{active:"active",animating:"animating",dimmable:"dimmable",dimmed:"dimmed",dimmer:"dimmer",disabled:"disabled",hide:"hide",pageDimmer:"page",show:"show"},selector:{dimmer:"> .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(){return e("
").attr("class","ui dimmer")}}}}(jQuery,window,document); \ No newline at end of file +!function(e,i,n,t){"use strict";i=void 0!==i&&i.Math==Math?i:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.dimmer=function(i){var o,a=e(this),r=(new Date).getTime(),s=[],m=arguments[0],d="string"==typeof m,c=[].slice.call(arguments,1);return a.each(function(){var l,u,f,g=e.isPlainObject(i)?e.extend(!0,{},e.fn.dimmer.settings,i):e.extend({},e.fn.dimmer.settings),p=g.selector,b=g.namespace,v=g.className,h=g.error,y="."+b,C="module-"+b,w=a.selector||"",S="ontouchstart"in n.documentElement?"touchstart":"click",x=e(this),F=this,T=x.data(C);(f={preinitialize:function(){f.is.dimmer()?(u=x.parent(),l=x):(u=x,l=f.has.dimmer()?g.dimmerName?u.find(p.dimmer).filter("."+g.dimmerName):u.find(p.dimmer):f.create())},initialize:function(){f.debug("Initializing dimmer",g),f.bind.events(),f.set.dimmable(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),T=f,x.data(C,T)},destroy:function(){f.verbose("Destroying previous module",l),f.unbind.events(),f.remove.variation(),u.off(y)},bind:{events:function(){"hover"==g.on?u.on("mouseenter"+y,f.show).on("mouseleave"+y,f.hide):"click"==g.on&&u.on(S+y,f.toggle),f.is.page()&&(f.debug("Setting as a page dimmer",u),f.set.pageDimmer()),f.is.closable()&&(f.verbose("Adding dimmer close event",l),u.on(S+y,p.dimmer,f.event.click))}},unbind:{events:function(){x.removeData(C),u.off(y)}},event:{click:function(i){f.verbose("Determining if event occured on dimmer",i),(0===l.find(i.target).length||e(i.target).is(p.content))&&(f.hide(),i.stopImmediatePropagation())}},addContent:function(i){var n=e(i);f.debug("Add content to dimmer",n),n.parent()[0]!==l[0]&&n.detach().appendTo(l)},create:function(){var i=e(g.template.dimmer());return g.dimmerName&&(f.debug("Creating named dimmer",g.dimmerName),i.addClass(g.dimmerName)),i.appendTo(u),i},show:function(i){i=e.isFunction(i)?i:function(){},f.debug("Showing dimmer",l,g),f.set.variation(),f.is.dimmed()&&!f.is.animating()||!f.is.enabled()?f.debug("Dimmer is already shown or disabled"):(f.animate.show(i),g.onShow.call(F),g.onChange.call(F))},hide:function(i){i=e.isFunction(i)?i:function(){},f.is.dimmed()||f.is.animating()?(f.debug("Hiding dimmer",l),f.animate.hide(i),g.onHide.call(F),g.onChange.call(F)):f.debug("Dimmer is not visible")},toggle:function(){f.verbose("Toggling dimmer visibility",l),f.is.dimmed()?f.hide():f.show()},animate:{show:function(i){i=e.isFunction(i)?i:function(){},g.useCSS&&e.fn.transition!==t&&l.transition("is supported")?(g.useFlex?(f.debug("Using flex dimmer"),f.remove.legacy()):(f.debug("Using legacy non-flex dimmer"),f.set.legacy()),"auto"!==g.opacity&&f.set.opacity(),l.transition({displayType:g.useFlex?"flex":"block",animation:g.transition+" in",queue:!1,duration:f.get.duration(),useFailSafe:!0,onStart:function(){f.set.dimmed()},onComplete:function(){f.set.active(),i()}})):(f.verbose("Showing dimmer animation with javascript"),f.set.dimmed(),"auto"==g.opacity&&(g.opacity=.8),l.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(f.get.duration(),g.opacity,function(){l.removeAttr("style"),f.set.active(),i()}))},hide:function(i){i=e.isFunction(i)?i:function(){},g.useCSS&&e.fn.transition!==t&&l.transition("is supported")?(f.verbose("Hiding dimmer with css"),l.transition({displayType:g.useFlex?"flex":"block",animation:g.transition+" out",queue:!1,duration:f.get.duration(),useFailSafe:!0,onStart:function(){f.remove.dimmed()},onComplete:function(){f.remove.variation(),f.remove.active(),i()}})):(f.verbose("Hiding dimmer with javascript"),f.remove.dimmed(),l.stop().fadeOut(f.get.duration(),function(){f.remove.active(),l.removeAttr("style"),i()}))}},get:{dimmer:function(){return l},duration:function(){return"object"==typeof g.duration?f.is.active()?g.duration.hide:g.duration.show:g.duration}},has:{dimmer:function(){return g.dimmerName?x.find(p.dimmer).filter("."+g.dimmerName).length>0:x.find(p.dimmer).length>0}},is:{active:function(){return l.hasClass(v.active)},animating:function(){return l.is(":animated")||l.hasClass(v.animating)},closable:function(){return"auto"==g.closable?"hover"!=g.on:g.closable},dimmer:function(){return x.hasClass(v.dimmer)},dimmable:function(){return x.hasClass(v.dimmable)},dimmed:function(){return u.hasClass(v.dimmed)},disabled:function(){return u.hasClass(v.disabled)},enabled:function(){return!f.is.disabled()},page:function(){return u.is("body")},pageDimmer:function(){return l.hasClass(v.pageDimmer)}},can:{show:function(){return!l.hasClass(v.disabled)}},set:{opacity:function(e){var i=l.css("background-color"),n=i.split(","),t=n&&3==n.length,o=n&&4==n.length;e=0===g.opacity?0:g.opacity||e,t||o?(n[3]=e+")",i=n.join(",")):i="rgba(0, 0, 0, "+e+")",f.debug("Setting opacity to",e),l.css("background-color",i)},legacy:function(){l.addClass(v.legacy)},active:function(){l.addClass(v.active)},dimmable:function(){u.addClass(v.dimmable)},dimmed:function(){u.addClass(v.dimmed)},pageDimmer:function(){l.addClass(v.pageDimmer)},disabled:function(){l.addClass(v.disabled)},variation:function(e){(e=e||g.variation)&&l.addClass(e)}},remove:{active:function(){l.removeClass(v.active)},legacy:function(){l.removeClass(v.legacy)},dimmed:function(){u.removeClass(v.dimmed)},disabled:function(){l.removeClass(v.disabled)},variation:function(e){(e=e||g.variation)&&l.removeClass(e)}},setting:function(i,n){if(f.debug("Changing setting",i,n),e.isPlainObject(i))e.extend(!0,g,i);else{if(n===t)return g[i];e.isPlainObject(g[i])?e.extend(!0,g[i],n):g[i]=n}},internal:function(i,n){if(e.isPlainObject(i))e.extend(!0,f,i);else{if(n===t)return f[i];f[i]=n}},debug:function(){!g.silent&&g.debug&&(g.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,g.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!g.silent&&g.verbose&&g.debug&&(g.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),f.verbose.apply(console,arguments)))},error:function(){g.silent||(f.error=Function.prototype.bind.call(console.error,console,g.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var i,n;g.performance&&(n=(i=(new Date).getTime())-(r||i),r=i,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:F,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var i=g.name+":",n=0;r=!1,clearTimeout(f.performance.timer),e.each(s,function(e,i){n+=i["Execution Time"]}),i+=" "+n+"ms",w&&(i+=" '"+w+"'"),a.length>1&&(i+=" ("+a.length+")"),(console.group!==t||console.table!==t)&&s.length>0&&(console.groupCollapsed(i),console.table?console.table(s):e.each(s,function(e,i){console.log(i.Name+": "+i["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(i,n,a){var r,s,m,d=T;return n=n||c,a=F||a,"string"==typeof i&&d!==t&&(i=i.split(/[\. ]/),r=i.length-1,e.each(i,function(n,o){var a=n!=r?o+i[n+1].charAt(0).toUpperCase()+i[n+1].slice(1):i;if(e.isPlainObject(d[a])&&n!=r)d=d[a];else{if(d[a]!==t)return s=d[a],!1;if(!e.isPlainObject(d[o])||n==r)return d[o]!==t?(s=d[o],!1):(f.error(h.method,i),!1);d=d[o]}})),e.isFunction(s)?m=s.apply(a,n):s!==t&&(m=s),e.isArray(o)?o.push(m):o!==t?o=[o,m]:m!==t&&(o=m),s}}).preinitialize(),d?(T===t&&f.initialize(),f.invoke(m)):(T!==t&&T.invoke("destroy"),f.initialize())}),o!==t?o:this},e.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",silent:!1,debug:!1,verbose:!1,performance:!0,useFlex:!0,dimmerName:!1,variation:!1,closable:"auto",useCSS:!0,transition:"fade",on:!1,opacity:"auto",duration:{show:500,hide:500},onChange:function(){},onShow:function(){},onHide:function(){},error:{method:"The method you called is not defined."},className:{active:"active",animating:"animating",dimmable:"dimmable",dimmed:"dimmed",dimmer:"dimmer",disabled:"disabled",hide:"hide",legacy:"legacy",pageDimmer:"page",show:"show"},selector:{dimmer:"> .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(){return e("
").attr("class","ui dimmer")}}}}(jQuery,window,document); \ No newline at end of file diff --git a/dist/components/dropdown.js b/dist/components/dropdown.js index e2bbbc615e..dcf1a6236c 100644 --- a/dist/components/dropdown.js +++ b/dist/components/dropdown.js @@ -1019,7 +1019,12 @@ $.fn.dropdown = function(parameters) { }, icon: { click: function(event) { - module.toggle(); + if($icon.hasClass(className.clear)) { + module.clear(); + } + else { + module.toggle(); + } } }, text: { @@ -1646,7 +1651,7 @@ $.fn.dropdown = function(parameters) { }, hide: function(text, value, element) { - module.set.value(value, text); + module.set.value(value, text, $(element)); module.hideAndClear(); } @@ -2481,6 +2486,15 @@ $.fn.dropdown = function(parameters) { $module.data(metadata.value, stringValue); } } + if(module.is.single() && settings.clearable) { + // treat undefined or '' as empty + if(!escapedValue) { + module.remove.clearable(); + } + else { + module.set.clearable(); + } + } if(settings.fireOnInit === false && module.is.initialLoad()) { module.verbose('No callback on initial load', settings.onChange); } @@ -2576,7 +2590,10 @@ $.fn.dropdown = function(parameters) { } }) ; - } + }, + clearable: function() { + $icon.addClass(className.clear); + }, }, add: { @@ -2774,7 +2791,7 @@ $.fn.dropdown = function(parameters) { } module.set.value(newValue, addedValue, addedText, $selectedItem); module.check.maxSelections(); - } + }, }, remove: { @@ -2999,6 +3016,9 @@ $.fn.dropdown = function(parameters) { .removeAttr('tabindex') ; } + }, + clearable: function() { + $icon.removeClass(className.clear); } }, @@ -3686,6 +3706,8 @@ $.fn.dropdown.settings = { values : false, // specify values to use for dropdown + clearable : false, // whether the value of the dropdown can be cleared + apiSettings : false, selectOnKeydown : true, // Whether selection should occur automatically when keyboard shortcuts used minCharacters : 0, // Minimum characters required to trigger API call @@ -3838,6 +3860,7 @@ $.fn.dropdown.settings = { active : 'active', addition : 'addition', animating : 'animating', + clear : 'clear', disabled : 'disabled', empty : 'empty', dropdown : 'ui dropdown', diff --git a/dist/components/dropdown.min.js b/dist/components/dropdown.min.js index e2987573ba..f62f31524b 100644 --- a/dist/components/dropdown.min.js +++ b/dist/components/dropdown.min.js @@ -1 +1 @@ -!function(e,t,n,i){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.dropdown=function(a){var o,s=e(this),r=e(n),l=s.selector||"",c="ontouchstart"in n.documentElement,u=(new Date).getTime(),d=[],v=arguments[0],f="string"==typeof v,m=[].slice.call(arguments,1);return s.each(function(h){var g,p,b,w,x,C,S,y,A=e.isPlainObject(a)?e.extend(!0,{},e.fn.dropdown.settings,a):e.extend({},e.fn.dropdown.settings),T=A.className,k=A.message,L=A.fields,I=A.keys,D=A.metadata,q=A.namespace,R=A.regExp,O=A.selector,V=A.error,E=A.templates,M="."+q,F="module-"+q,z=e(this),P=e(A.context),H=z.find(O.text),j=z.find(O.search),N=z.find(O.sizer),U=z.find(O.input),K=z.find(O.icon),W=z.prev().find(O.text).length>0?z.prev().find(O.text):z.prev(),B=z.children(O.menu),$=B.find(O.item),Q=!1,X=!1,Y=!1,G=this,J=z.data(F);y={initialize:function(){y.debug("Initializing dropdown",A),y.is.alreadySetup()?y.setup.reference():(y.setup.layout(),A.values&&y.change.values(A.values),y.refreshData(),y.save.defaults(),y.restore.selected(),y.create.id(),y.bind.events(),y.observeChanges(),y.instantiate())},instantiate:function(){y.verbose("Storing instance of dropdown",y),J=y,z.data(F,y)},destroy:function(){y.verbose("Destroying previous dropdown",z),y.remove.tabbable(),z.off(M).removeData(F),B.off(M),r.off(w),y.disconnect.menuObserver(),y.disconnect.selectObserver()},observeChanges:function(){"MutationObserver"in t&&(C=new MutationObserver(y.event.select.mutation),S=new MutationObserver(y.event.menu.mutation),y.debug("Setting up mutation observer",C,S),y.observe.select(),y.observe.menu())},disconnect:{menuObserver:function(){S&&S.disconnect()},selectObserver:function(){C&&C.disconnect()}},observe:{select:function(){y.has.input()&&C.observe(z[0],{childList:!0,subtree:!0})},menu:function(){y.has.menu()&&S.observe(B[0],{childList:!0,subtree:!0})}},create:{id:function(){x=(Math.random().toString(16)+"000000000").substr(2,8),w="."+x,y.verbose("Creating unique id for element",x)},userChoice:function(t){var n,a,o;return!!(t=t||y.get.userValues())&&(t=e.isArray(t)?t:[t],e.each(t,function(t,s){!1===y.get.item(s)&&(o=A.templates.addition(y.add.variables(k.addResult,s)),a=e("
").html(o).attr("data-"+D.value,s).attr("data-"+D.text,s).addClass(T.addition).addClass(T.item),A.hideAdditions&&a.addClass(T.hidden),n=n===i?a:n.add(a),y.verbose("Creating user choices for value",s,a))}),n)},userLabels:function(t){var n=y.get.userValues();n&&(y.debug("Adding user labels",n),e.each(n,function(e,t){y.verbose("Adding custom user value"),y.add.label(t,t)}))},menu:function(){B=e("
").addClass(T.menu).appendTo(z)},sizer:function(){N=e("").addClass(T.sizer).insertAfter(j)}},search:function(e){e=e!==i?e:y.get.query(),y.verbose("Searching for query",e),y.has.minCharacters(e)?y.filter(e):y.hide()},select:{firstUnfiltered:function(){y.verbose("Selecting first non-filtered element"),y.remove.selectedItem(),$.not(O.unselectable).not(O.addition+O.hidden).eq(0).addClass(T.selected)},nextAvailable:function(e){var t=(e=e.eq(0)).nextAll(O.item).not(O.unselectable).eq(0),n=e.prevAll(O.item).not(O.unselectable).eq(0);t.length>0?(y.verbose("Moving selection to",t),t.addClass(T.selected)):(y.verbose("Moving selection to",n),n.addClass(T.selected))}},setup:{api:function(){var e={debug:A.debug,urlData:{value:y.get.value(),query:y.get.query()},on:!1};y.verbose("First request, initializing API"),z.api(e)},layout:function(){z.is("select")&&(y.setup.select(),y.setup.returnedObject()),y.has.menu()||y.create.menu(),y.is.search()&&!y.has.search()&&(y.verbose("Adding search input"),j=e("").addClass(T.search).prop("autocomplete","off").insertBefore(H)),y.is.multiple()&&y.is.searchSelection()&&!y.has.sizer()&&y.create.sizer(),A.allowTab&&y.set.tabbable()},select:function(){var t=y.get.selectValues();y.debug("Dropdown initialized on a select",t),z.is("select")&&(U=z),U.parent(O.dropdown).length>0?(y.debug("UI dropdown already exists. Creating dropdown menu only"),z=U.closest(O.dropdown),y.has.menu()||y.create.menu(),B=z.children(O.menu),y.setup.menu(t)):(y.debug("Creating entire dropdown from select"),z=e("
").attr("class",U.attr("class")).addClass(T.selection).addClass(T.dropdown).html(E.dropdown(t)).insertBefore(U),U.hasClass(T.multiple)&&!1===U.prop("multiple")&&(y.error(V.missingMultiple),U.prop("multiple",!0)),U.is("[multiple]")&&y.set.multiple(),U.prop("disabled")&&(y.debug("Disabling dropdown"),z.addClass(T.disabled)),U.removeAttr("class").detach().prependTo(z)),y.refresh()},menu:function(e){B.html(E.menu(e,L)),$=B.find(O.item)},reference:function(){y.debug("Dropdown behavior was called on select, replacing with closest dropdown"),z=z.parent(O.dropdown),J=z.data(F),G=z.get(0),y.refresh(),y.setup.returnedObject()},returnedObject:function(){var e=s.slice(0,h),t=s.slice(h+1);s=e.add(z).add(t)}},refresh:function(){y.refreshSelectors(),y.refreshData()},refreshItems:function(){$=B.find(O.item)},refreshSelectors:function(){y.verbose("Refreshing selector cache"),H=z.find(O.text),j=z.find(O.search),U=z.find(O.input),K=z.find(O.icon),W=z.prev().find(O.text).length>0?z.prev().find(O.text):z.prev(),B=z.children(O.menu),$=B.find(O.item)},refreshData:function(){y.verbose("Refreshing cached metadata"),$.removeData(D.text).removeData(D.value)},clearData:function(){y.verbose("Clearing metadata"),$.removeData(D.text).removeData(D.value),z.removeData(D.defaultText).removeData(D.defaultValue).removeData(D.placeholderText)},toggle:function(){y.verbose("Toggling menu visibility"),y.is.active()?y.hide():y.show()},show:function(t){if(t=e.isFunction(t)?t:function(){},!y.can.show()&&y.is.remote()&&(y.debug("No API results retrieved, searching before show"),y.queryRemote(y.get.query(),y.show)),y.can.show()&&!y.is.active()){if(y.debug("Showing dropdown"),!y.has.message()||y.has.maxSelections()||y.has.allResultsFiltered()||y.remove.message(),y.is.allFiltered())return!0;!1!==A.onShow.call(G)&&y.animate.show(function(){y.can.click()&&y.bind.intent(),y.has.menuSearch()&&y.focusSearch(),y.set.visible(),t.call(G)})}},hide:function(t){t=e.isFunction(t)?t:function(){},y.is.active()&&!y.is.animatingOutward()&&(y.debug("Hiding dropdown"),!1!==A.onHide.call(G)&&y.animate.hide(function(){y.remove.visible(),t.call(G)}))},hideOthers:function(){y.verbose("Finding other dropdowns to hide"),s.not(z).has(O.menu+"."+T.visible).dropdown("hide")},hideMenu:function(){y.verbose("Hiding menu instantaneously"),y.remove.active(),y.remove.visible(),B.transition("hide")},hideSubMenus:function(){var e=B.children(O.item).find(O.menu);y.verbose("Hiding sub menus",e),e.transition("hide")},bind:{events:function(){c&&y.bind.touchEvents(),y.bind.keyboardEvents(),y.bind.inputEvents(),y.bind.mouseEvents()},touchEvents:function(){y.debug("Touch device detected binding additional touch events"),y.is.searchSelection()||y.is.single()&&z.on("touchstart"+M,y.event.test.toggle),B.on("touchstart"+M,O.item,y.event.item.mouseenter)},keyboardEvents:function(){y.verbose("Binding keyboard events"),z.on("keydown"+M,y.event.keydown),y.has.search()&&z.on(y.get.inputEvent()+M,O.search,y.event.input),y.is.multiple()&&r.on("keydown"+w,y.event.document.keydown)},inputEvents:function(){y.verbose("Binding input change events"),z.on("change"+M,O.input,y.event.change)},mouseEvents:function(){y.verbose("Binding mouse events"),y.is.multiple()&&z.on("click"+M,O.label,y.event.label.click).on("click"+M,O.remove,y.event.remove.click),y.is.searchSelection()?(z.on("mousedown"+M,y.event.mousedown).on("mouseup"+M,y.event.mouseup).on("mousedown"+M,O.menu,y.event.menu.mousedown).on("mouseup"+M,O.menu,y.event.menu.mouseup).on("click"+M,O.icon,y.event.icon.click).on("focus"+M,O.search,y.event.search.focus).on("click"+M,O.search,y.event.search.focus).on("blur"+M,O.search,y.event.search.blur).on("click"+M,O.text,y.event.text.focus),y.is.multiple()&&z.on("click"+M,y.event.click)):("click"==A.on?z.on("click"+M,O.icon,y.event.icon.click).on("click"+M,y.event.test.toggle):"hover"==A.on?z.on("mouseenter"+M,y.delay.show).on("mouseleave"+M,y.delay.hide):z.on(A.on+M,y.toggle),z.on("mousedown"+M,y.event.mousedown).on("mouseup"+M,y.event.mouseup).on("focus"+M,y.event.focus),y.has.menuSearch()?z.on("blur"+M,O.search,y.event.search.blur):z.on("blur"+M,y.event.blur)),B.on("mouseenter"+M,O.item,y.event.item.mouseenter).on("mouseleave"+M,O.item,y.event.item.mouseleave).on("click"+M,O.item,y.event.item.click)},intent:function(){y.verbose("Binding hide intent event to document"),c&&r.on("touchstart"+w,y.event.test.touch).on("touchmove"+w,y.event.test.touch),r.on("click"+w,y.event.test.hide)}},unbind:{intent:function(){y.verbose("Removing hide intent event from document"),c&&r.off("touchstart"+w).off("touchmove"+w),r.off("click"+w)}},filter:function(e){var t=e!==i?e:y.get.query(),n=function(){y.is.multiple()&&y.filterActive(),(e||!e&&0==y.get.activeItem().length)&&y.select.firstUnfiltered(),y.has.allResultsFiltered()?A.onNoResults.call(G,t)?A.allowAdditions?A.hideAdditions&&(y.verbose("User addition with no menu, setting empty style"),y.set.empty(),y.hideMenu()):(y.verbose("All items filtered, showing message",t),y.add.message(k.noResults)):(y.verbose("All items filtered, hiding dropdown",t),y.hideMenu()):(y.remove.empty(),y.remove.message()),A.allowAdditions&&y.add.userSuggestion(e),y.is.searchSelection()&&y.can.show()&&y.is.focusedOnSearch()&&y.show()};A.useLabels&&y.has.maxSelections()||(A.apiSettings?y.can.useAPI()?y.queryRemote(t,function(){A.filterRemoteData&&y.filterItems(t),n()}):y.error(V.noAPI):(y.filterItems(t),n()))},queryRemote:function(t,n){var i={errorDuration:!1,cache:"local",throttle:A.throttle,urlData:{query:t},onError:function(){y.add.message(k.serverError),n()},onFailure:function(){y.add.message(k.serverError),n()},onSuccess:function(t){var i=t[L.remoteValues];e.isArray(i)&&i.length>0?(y.remove.message(),y.setup.menu({values:t[L.remoteValues]})):y.add.message(k.noResults),n()}};z.api("get request")||y.setup.api(),i=e.extend(!0,{},i,A.apiSettings),z.api("setting",i).api("query")},filterItems:function(t){var n=t!==i?t:y.get.query(),a=null,o=y.escape.string(n),s=new RegExp("^"+o,"igm");y.has.query()&&(a=[],y.verbose("Searching for matching values",n),$.each(function(){var t,i,o=e(this);if("both"==A.match||"text"==A.match){if(-1!==(t=String(y.get.choiceText(o,!1))).search(s))return a.push(this),!0;if("exact"===A.fullTextSearch&&y.exactSearch(n,t))return a.push(this),!0;if(!0===A.fullTextSearch&&y.fuzzySearch(n,t))return a.push(this),!0}if("both"==A.match||"value"==A.match){if(-1!==(i=String(y.get.choiceValue(o,t))).search(s))return a.push(this),!0;if("exact"===A.fullTextSearch&&y.exactSearch(n,i))return a.push(this),!0;if(!0===A.fullTextSearch&&y.fuzzySearch(n,i))return a.push(this),!0}})),y.debug("Showing only matched items",n),y.remove.filteredItem(),a&&$.not(a).addClass(T.filtered)},fuzzySearch:function(e,t){var n=t.length,i=e.length;if(e=e.toLowerCase(),t=t.toLowerCase(),i>n)return!1;if(i===n)return e===t;e:for(var a=0,o=0;a-1},filterActive:function(){A.useLabels&&$.filter("."+T.active).addClass(T.filtered)},focusSearch:function(e){y.has.search()&&!y.is.focusedOnSearch()&&(e?(z.off("focus"+M,O.search),j.focus(),z.on("focus"+M,O.search,y.event.search.focus)):j.focus())},forceSelection:function(){var e=$.not(T.filtered).filter("."+T.selected).eq(0),t=$.not(T.filtered).filter("."+T.active).eq(0),n=e.length>0?e:t;if(n.length>0&&!y.is.multiple())return y.debug("Forcing partial selection to selected item",n),void y.event.item.click.call(n,{},!0);A.allowAdditions?(y.set.selected(y.get.query()),y.remove.searchTerm()):y.remove.searchTerm()},change:{values:function(t){A.allowAdditions||y.clear(),y.debug("Creating dropdown with specified values",t),y.setup.menu({values:t}),e.each(t,function(e,t){if(1==t.selected)return y.debug("Setting initial selection to",t.value),y.set.selected(t.value),!0})}},event:{change:function(){Y||(y.debug("Input changed, updating selection"),y.set.selected())},focus:function(){A.showOnFocus&&!Q&&y.is.hidden()&&!p&&y.show()},blur:function(e){p=n.activeElement===this,Q||p||(y.remove.activeLabel(),y.hide())},mousedown:function(){y.is.searchSelection()?b=!0:Q=!0},mouseup:function(){y.is.searchSelection()?b=!1:Q=!1},click:function(t){e(t.target).is(z)&&(y.is.focusedOnSearch()?y.show():y.focusSearch())},search:{focus:function(){Q=!0,y.is.multiple()&&y.remove.activeLabel(),A.showOnFocus&&y.search()},blur:function(e){p=n.activeElement===this,y.is.searchSelection()&&!b&&(X||p||(A.forceSelection&&y.forceSelection(),y.hide())),b=!1}},icon:{click:function(e){y.toggle()}},text:{focus:function(e){Q=!0,y.focusSearch()}},input:function(e){(y.is.multiple()||y.is.searchSelection())&&y.set.filtered(),clearTimeout(y.timer),y.timer=setTimeout(y.search,A.delay.search)},label:{click:function(t){var n=e(this),i=z.find(O.label),a=i.filter("."+T.active),o=n.nextAll("."+T.active),s=n.prevAll("."+T.active),r=o.length>0?n.nextUntil(o).add(a).add(n):n.prevUntil(s).add(a).add(n);t.shiftKey?(a.removeClass(T.active),r.addClass(T.active)):t.ctrlKey?n.toggleClass(T.active):(a.removeClass(T.active),n.addClass(T.active)),A.onLabelSelect.apply(this,i.filter("."+T.active))}},remove:{click:function(){var t=e(this).parent();t.hasClass(T.active)?y.remove.activeLabels():y.remove.activeLabels(t)}},test:{toggle:function(e){var t=y.is.multiple()?y.show:y.toggle;y.is.bubbledLabelClick(e)||y.is.bubbledIconClick(e)||y.determine.eventOnElement(e,t)&&e.preventDefault()},touch:function(e){y.determine.eventOnElement(e,function(){"touchstart"==e.type?y.timer=setTimeout(function(){y.hide()},A.delay.touch):"touchmove"==e.type&&clearTimeout(y.timer)}),e.stopPropagation()},hide:function(e){y.determine.eventInModule(e,y.hide)}},select:{mutation:function(t){y.debug(" removing selected option",e),i=y.remove.arrayValue(e,a),y.remove.optionValue(e)):(y.verbose("Removing from delimited values",e),i=(i=y.remove.arrayValue(e,a)).join(A.delimiter)),!1===A.fireOnInit&&y.is.initialLoad()?y.verbose("No callback on initial load",A.onRemove):A.onRemove.call(G,e,t,n),y.set.value(i,t,n),y.check.maxSelections()},arrayValue:function(t,n){return e.isArray(n)||(n=[n]),n=e.grep(n,function(e){return t!=e}),y.verbose("Removed value from delimited string",t,n),n},label:function(e,t){var n=z.find(O.label).filter("[data-"+D.value+'="'+y.escape.string(e)+'"]');y.verbose("Removing label",n),n.remove()},activeLabels:function(e){e=e||z.find(O.label).filter("."+T.active),y.verbose("Removing active label selections",e),y.remove.labels(e)},labels:function(t){t=t||z.find(O.label),y.verbose("Removing labels",t),t.each(function(){var t=e(this),n=t.data(D.value),a=n!==i?String(n):n,o=y.is.userValue(a);!1!==A.onLabelRemove.call(t,n)?(y.remove.message(),o?(y.remove.value(a),y.remove.label(a)):y.remove.selected(a)):y.debug("Label remove callback cancelled removal")})},tabbable:function(){y.is.searchSelection()?(y.debug("Searchable dropdown initialized"),j.removeAttr("tabindex"),B.removeAttr("tabindex")):(y.debug("Simple selection dropdown initialized"),z.removeAttr("tabindex"),B.removeAttr("tabindex"))}},has:{menuSearch:function(){return y.has.search()&&j.closest(B).length>0},search:function(){return j.length>0},sizer:function(){return N.length>0},selectInput:function(){return U.is("select")},minCharacters:function(e){return!A.minCharacters||(e=e!==i?String(e):String(y.get.query())).length>=A.minCharacters},firstLetter:function(e,t){var n;return!(!e||0===e.length||"string"!=typeof t)&&(n=y.get.choiceText(e,!1),(t=t.toLowerCase())==String(n).charAt(0).toLowerCase())},input:function(){return U.length>0},items:function(){return $.length>0},menu:function(){return B.length>0},message:function(){return 0!==B.children(O.message).length},label:function(e){var t=y.escape.value(e),n=z.find(O.label);return A.ignoreCase&&(t=t.toLowerCase()),n.filter("[data-"+D.value+'="'+y.escape.string(t)+'"]').length>0},maxSelections:function(){return A.maxSelections&&y.get.selectionCount()>=A.maxSelections},allResultsFiltered:function(){var e=$.not(O.addition);return e.filter(O.unselectable).length===e.length},userSuggestion:function(){return B.children(O.addition).length>0},query:function(){return""!==y.get.query()},value:function(e){return A.ignoreCase?y.has.valueIgnoringCase(e):y.has.valueMatchingCase(e)},valueMatchingCase:function(t){var n=y.get.values();return!!(e.isArray(n)?n&&-1!==e.inArray(t,n):n==t)},valueIgnoringCase:function(t){var n=y.get.values(),i=!1;return e.isArray(n)||(n=[n]),e.each(n,function(e,n){if(String(t).toLowerCase()==String(n).toLowerCase())return i=!0,!1}),i}},is:{active:function(){return z.hasClass(T.active)},animatingInward:function(){return B.transition("is inward")},animatingOutward:function(){return B.transition("is outward")},bubbledLabelClick:function(t){return e(t.target).is("select, input")&&z.closest("label").length>0},bubbledIconClick:function(t){return e(t.target).closest(K).length>0},alreadySetup:function(){return z.is("select")&&z.parent(O.dropdown).data(F)!==i&&0===z.prev().length},animating:function(e){return e?e.transition&&e.transition("is animating"):B.transition&&B.transition("is animating")},leftward:function(e){return(e||B).hasClass(T.leftward)},disabled:function(){return z.hasClass(T.disabled)},focused:function(){return n.activeElement===z[0]},focusedOnSearch:function(){return n.activeElement===j[0]},allFiltered:function(){return(y.is.multiple()||y.has.search())&&!(0==A.hideAdditions&&y.has.userSuggestion())&&!y.has.message()&&y.has.allResultsFiltered()},hidden:function(e){return!y.is.visible(e)},initialLoad:function(){return g},inObject:function(t,n){var i=!1;return e.each(n,function(e,n){if(n==t)return i=!0,!0}),i},multiple:function(){return z.hasClass(T.multiple)},remote:function(){return A.apiSettings&&y.can.useAPI()},single:function(){return!y.is.multiple()},selectMutation:function(t){var n=!1;return e.each(t,function(t,i){if(i.target&&e(i.target).is("select"))return n=!0,!0}),n},search:function(){return z.hasClass(T.search)},searchSelection:function(){return y.has.search()&&1===j.parent(O.dropdown).length},selection:function(){return z.hasClass(T.selection)},userValue:function(t){return-1!==e.inArray(t,y.get.userValues())},upward:function(e){return(e||z).hasClass(T.upward)},visible:function(e){return e?e.hasClass(T.visible):B.hasClass(T.visible)},verticallyScrollableContext:function(){var e=P.get(0)!==t&&P.css("overflow-y");return"auto"==e||"scroll"==e},horizontallyScrollableContext:function(){var e=P.get(0)!==t&&P.css("overflow-X");return"auto"==e||"scroll"==e}},can:{activate:function(e){return!!A.useLabels||(!y.has.maxSelections()||!(!y.has.maxSelections()||!e.hasClass(T.active)))},openDownward:function(e){var n,i,a=e||B,o=!0;return a.addClass(T.loading),i={context:{offset:P.get(0)===t?{top:0,left:0}:P.offset(),scrollTop:P.scrollTop(),height:P.outerHeight()},menu:{offset:a.offset(),height:a.outerHeight()}},y.is.verticallyScrollableContext()&&(i.menu.offset.top+=i.context.scrollTop),(n={above:i.context.scrollTop<=i.menu.offset.top-i.context.offset.top-i.menu.height,below:i.context.scrollTop+i.context.height>=i.menu.offset.top-i.context.offset.top+i.menu.height}).below?(y.verbose("Dropdown can fit in context downward",n),o=!0):n.below||n.above?(y.verbose("Dropdown cannot fit below, opening upward",n),o=!1):(y.verbose("Dropdown cannot fit in either direction, favoring downward",n),o=!0),a.removeClass(T.loading),o},openRightward:function(e){var n,i,a=e||B,o=!0;return a.addClass(T.loading),i={context:{offset:P.get(0)===t?{top:0,left:0}:P.offset(),scrollLeft:P.scrollLeft(),width:P.outerWidth()},menu:{offset:a.offset(),width:a.outerWidth()}},y.is.horizontallyScrollableContext()&&(i.menu.offset.left+=i.context.scrollLeft),(n=i.menu.offset.left-i.context.offset.left+i.menu.width>=i.context.scrollLeft+i.context.width)&&(y.verbose("Dropdown cannot fit in context rightward",n),o=!1),a.removeClass(T.loading),o},click:function(){return c||"click"==A.on},extendSelect:function(){return A.allowAdditions||A.apiSettings},show:function(){return!y.is.disabled()&&(y.has.items()||y.has.message())},useAPI:function(){return e.fn.api!==i}},animate:{show:function(t,n){var a,o=n||B,s=n?function(){}:function(){y.hideSubMenus(),y.hideOthers(),y.set.active()};t=e.isFunction(t)?t:function(){},y.verbose("Doing menu show animation",o),y.set.direction(n),a=y.get.transition(n),y.is.selection()&&y.set.scrollPosition(y.get.selectedItem(),!0),(y.is.hidden(o)||y.is.animating(o))&&("none"==a?(s(),o.transition("show"),t.call(G)):e.fn.transition!==i&&z.transition("is supported")?o.transition({animation:a+" in",debug:A.debug,verbose:A.verbose,duration:A.duration,queue:!0,onStart:s,onComplete:function(){t.call(G)}}):y.error(V.noTransition,a))},hide:function(t,n){var a=n||B,o=(n?A.duration:A.duration,n?function(){}:function(){y.can.click()&&y.unbind.intent(),y.remove.active()}),s=y.get.transition(n);t=e.isFunction(t)?t:function(){},(y.is.visible(a)||y.is.animating(a))&&(y.verbose("Doing menu hide animation",a),"none"==s?(o(),a.transition("hide"),t.call(G)):e.fn.transition!==i&&z.transition("is supported")?a.transition({animation:s+" out",duration:A.duration,debug:A.debug,verbose:A.verbose,queue:!1,onStart:o,onComplete:function(){t.call(G)}}):y.error(V.transition))}},hideAndClear:function(){y.remove.searchTerm(),y.has.maxSelections()||(y.has.search()?y.hide(function(){y.remove.filteredItem()}):y.hide())},delay:{show:function(){y.verbose("Delaying show event to ensure user intent"),clearTimeout(y.timer),y.timer=setTimeout(y.show,A.delay.show)},hide:function(){y.verbose("Delaying hide event to ensure user intent"),clearTimeout(y.timer),y.timer=setTimeout(y.hide,A.delay.hide)}},escape:{value:function(t){var n=e.isArray(t),i="string"==typeof t,a=!i&&!n,o=i&&-1!==t.search(R.quote),s=[];return a||!o?t:(y.debug("Encoding quote values for use in select",t),n?(e.each(t,function(e,t){s.push(t.replace(R.quote,"""))}),s):t.replace(R.quote,"""))},string:function(e){return(e=String(e)).replace(R.escape,"\\$&")}},setting:function(t,n){if(y.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,A,t);else{if(n===i)return A[t];e.isPlainObject(A[t])?e.extend(!0,A[t],n):A[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,y,t);else{if(n===i)return y[t];y[t]=n}},debug:function(){!A.silent&&A.debug&&(A.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,A.name+":"),y.debug.apply(console,arguments)))},verbose:function(){!A.silent&&A.verbose&&A.debug&&(A.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,A.name+":"),y.verbose.apply(console,arguments)))},error:function(){A.silent||(y.error=Function.prototype.bind.call(console.error,console,A.name+":"),y.error.apply(console,arguments))},performance:{log:function(e){var t,n;A.performance&&(n=(t=(new Date).getTime())-(u||t),u=t,d.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:G,"Execution Time":n})),clearTimeout(y.performance.timer),y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var t=A.name+":",n=0;u=!1,clearTimeout(y.performance.timer),e.each(d,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",l&&(t+=" '"+l+"'"),(console.group!==i||console.table!==i)&&d.length>0&&(console.groupCollapsed(t),console.table?console.table(d):e.each(d,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),d=[]}},invoke:function(t,n,a){var s,r,l,c=J;return n=n||m,a=G||a,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(n,a){var o=n!=s?a+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[o])&&n!=s)c=c[o];else{if(c[o]!==i)return r=c[o],!1;if(!e.isPlainObject(c[a])||n==s)return c[a]!==i?(r=c[a],!1):(y.error(V.method,t),!1);c=c[a]}})),e.isFunction(r)?l=r.apply(a,n):r!==i&&(l=r),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),r}},f?(J===i&&y.initialize(),y.invoke(v)):(J!==i&&J.invoke("destroy"),y.initialize())}),o!==i?o:s},e.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",values:!1,apiSettings:!1,selectOnKeydown:!0,minCharacters:0,filterRemoteData:!1,saveRemoteData:!0,throttle:200,context:t,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,ignoreCase:!1,hideAdditions:!0,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowReselection:!1,allowTab:!0,allowCategorySelection:!1,fireOnInit:!1,transition:"auto",duration:200,glyphWidth:1.037,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:20,touch:50},onChange:function(e,t,n){},onAdd:function(e,t,n){},onRemove:function(e,t,n){},onLabelSelect:function(e){},onLabelCreate:function(t,n){return e(this)},onLabelRemove:function(e){return!0},onNoResults:function(e){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add {term}",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found.",serverError:"There was an error contacting the server"},error:{action:"You called a dropdown action that was not defined",alreadySetup:"Once a select has been initialized behaviors must be called on the created ui dropdown",labels:"Allowing user additions currently requires the use of labels.",missingMultiple:"").addClass(T.search).prop("autocomplete","off").insertBefore(H)),y.is.multiple()&&y.is.searchSelection()&&!y.has.sizer()&&y.create.sizer(),A.allowTab&&y.set.tabbable()},select:function(){var t=y.get.selectValues();y.debug("Dropdown initialized on a select",t),z.is("select")&&(U=z),U.parent(O.dropdown).length>0?(y.debug("UI dropdown already exists. Creating dropdown menu only"),z=U.closest(O.dropdown),y.has.menu()||y.create.menu(),B=z.children(O.menu),y.setup.menu(t)):(y.debug("Creating entire dropdown from select"),z=e("
").attr("class",U.attr("class")).addClass(T.selection).addClass(T.dropdown).html(E.dropdown(t)).insertBefore(U),U.hasClass(T.multiple)&&!1===U.prop("multiple")&&(y.error(V.missingMultiple),U.prop("multiple",!0)),U.is("[multiple]")&&y.set.multiple(),U.prop("disabled")&&(y.debug("Disabling dropdown"),z.addClass(T.disabled)),U.removeAttr("class").detach().prependTo(z)),y.refresh()},menu:function(e){B.html(E.menu(e,L)),$=B.find(O.item)},reference:function(){y.debug("Dropdown behavior was called on select, replacing with closest dropdown"),z=z.parent(O.dropdown),J=z.data(F),G=z.get(0),y.refresh(),y.setup.returnedObject()},returnedObject:function(){var e=s.slice(0,h),t=s.slice(h+1);s=e.add(z).add(t)}},refresh:function(){y.refreshSelectors(),y.refreshData()},refreshItems:function(){$=B.find(O.item)},refreshSelectors:function(){y.verbose("Refreshing selector cache"),H=z.find(O.text),j=z.find(O.search),U=z.find(O.input),K=z.find(O.icon),W=z.prev().find(O.text).length>0?z.prev().find(O.text):z.prev(),B=z.children(O.menu),$=B.find(O.item)},refreshData:function(){y.verbose("Refreshing cached metadata"),$.removeData(D.text).removeData(D.value)},clearData:function(){y.verbose("Clearing metadata"),$.removeData(D.text).removeData(D.value),z.removeData(D.defaultText).removeData(D.defaultValue).removeData(D.placeholderText)},toggle:function(){y.verbose("Toggling menu visibility"),y.is.active()?y.hide():y.show()},show:function(t){if(t=e.isFunction(t)?t:function(){},!y.can.show()&&y.is.remote()&&(y.debug("No API results retrieved, searching before show"),y.queryRemote(y.get.query(),y.show)),y.can.show()&&!y.is.active()){if(y.debug("Showing dropdown"),!y.has.message()||y.has.maxSelections()||y.has.allResultsFiltered()||y.remove.message(),y.is.allFiltered())return!0;!1!==A.onShow.call(G)&&y.animate.show(function(){y.can.click()&&y.bind.intent(),y.has.menuSearch()&&y.focusSearch(),y.set.visible(),t.call(G)})}},hide:function(t){t=e.isFunction(t)?t:function(){},y.is.active()&&!y.is.animatingOutward()&&(y.debug("Hiding dropdown"),!1!==A.onHide.call(G)&&y.animate.hide(function(){y.remove.visible(),t.call(G)}))},hideOthers:function(){y.verbose("Finding other dropdowns to hide"),s.not(z).has(O.menu+"."+T.visible).dropdown("hide")},hideMenu:function(){y.verbose("Hiding menu instantaneously"),y.remove.active(),y.remove.visible(),B.transition("hide")},hideSubMenus:function(){var e=B.children(O.item).find(O.menu);y.verbose("Hiding sub menus",e),e.transition("hide")},bind:{events:function(){c&&y.bind.touchEvents(),y.bind.keyboardEvents(),y.bind.inputEvents(),y.bind.mouseEvents()},touchEvents:function(){y.debug("Touch device detected binding additional touch events"),y.is.searchSelection()||y.is.single()&&z.on("touchstart"+M,y.event.test.toggle),B.on("touchstart"+M,O.item,y.event.item.mouseenter)},keyboardEvents:function(){y.verbose("Binding keyboard events"),z.on("keydown"+M,y.event.keydown),y.has.search()&&z.on(y.get.inputEvent()+M,O.search,y.event.input),y.is.multiple()&&r.on("keydown"+w,y.event.document.keydown)},inputEvents:function(){y.verbose("Binding input change events"),z.on("change"+M,O.input,y.event.change)},mouseEvents:function(){y.verbose("Binding mouse events"),y.is.multiple()&&z.on("click"+M,O.label,y.event.label.click).on("click"+M,O.remove,y.event.remove.click),y.is.searchSelection()?(z.on("mousedown"+M,y.event.mousedown).on("mouseup"+M,y.event.mouseup).on("mousedown"+M,O.menu,y.event.menu.mousedown).on("mouseup"+M,O.menu,y.event.menu.mouseup).on("click"+M,O.icon,y.event.icon.click).on("focus"+M,O.search,y.event.search.focus).on("click"+M,O.search,y.event.search.focus).on("blur"+M,O.search,y.event.search.blur).on("click"+M,O.text,y.event.text.focus),y.is.multiple()&&z.on("click"+M,y.event.click)):("click"==A.on?z.on("click"+M,O.icon,y.event.icon.click).on("click"+M,y.event.test.toggle):"hover"==A.on?z.on("mouseenter"+M,y.delay.show).on("mouseleave"+M,y.delay.hide):z.on(A.on+M,y.toggle),z.on("mousedown"+M,y.event.mousedown).on("mouseup"+M,y.event.mouseup).on("focus"+M,y.event.focus),y.has.menuSearch()?z.on("blur"+M,O.search,y.event.search.blur):z.on("blur"+M,y.event.blur)),B.on("mouseenter"+M,O.item,y.event.item.mouseenter).on("mouseleave"+M,O.item,y.event.item.mouseleave).on("click"+M,O.item,y.event.item.click)},intent:function(){y.verbose("Binding hide intent event to document"),c&&r.on("touchstart"+w,y.event.test.touch).on("touchmove"+w,y.event.test.touch),r.on("click"+w,y.event.test.hide)}},unbind:{intent:function(){y.verbose("Removing hide intent event from document"),c&&r.off("touchstart"+w).off("touchmove"+w),r.off("click"+w)}},filter:function(e){var t=e!==i?e:y.get.query(),n=function(){y.is.multiple()&&y.filterActive(),(e||!e&&0==y.get.activeItem().length)&&y.select.firstUnfiltered(),y.has.allResultsFiltered()?A.onNoResults.call(G,t)?A.allowAdditions?A.hideAdditions&&(y.verbose("User addition with no menu, setting empty style"),y.set.empty(),y.hideMenu()):(y.verbose("All items filtered, showing message",t),y.add.message(k.noResults)):(y.verbose("All items filtered, hiding dropdown",t),y.hideMenu()):(y.remove.empty(),y.remove.message()),A.allowAdditions&&y.add.userSuggestion(e),y.is.searchSelection()&&y.can.show()&&y.is.focusedOnSearch()&&y.show()};A.useLabels&&y.has.maxSelections()||(A.apiSettings?y.can.useAPI()?y.queryRemote(t,function(){A.filterRemoteData&&y.filterItems(t),n()}):y.error(V.noAPI):(y.filterItems(t),n()))},queryRemote:function(t,n){var i={errorDuration:!1,cache:"local",throttle:A.throttle,urlData:{query:t},onError:function(){y.add.message(k.serverError),n()},onFailure:function(){y.add.message(k.serverError),n()},onSuccess:function(t){var i=t[L.remoteValues];e.isArray(i)&&i.length>0?(y.remove.message(),y.setup.menu({values:t[L.remoteValues]})):y.add.message(k.noResults),n()}};z.api("get request")||y.setup.api(),i=e.extend(!0,{},i,A.apiSettings),z.api("setting",i).api("query")},filterItems:function(t){var n=t!==i?t:y.get.query(),a=null,o=y.escape.string(n),s=new RegExp("^"+o,"igm");y.has.query()&&(a=[],y.verbose("Searching for matching values",n),$.each(function(){var t,i,o=e(this);if("both"==A.match||"text"==A.match){if(-1!==(t=String(y.get.choiceText(o,!1))).search(s))return a.push(this),!0;if("exact"===A.fullTextSearch&&y.exactSearch(n,t))return a.push(this),!0;if(!0===A.fullTextSearch&&y.fuzzySearch(n,t))return a.push(this),!0}if("both"==A.match||"value"==A.match){if(-1!==(i=String(y.get.choiceValue(o,t))).search(s))return a.push(this),!0;if("exact"===A.fullTextSearch&&y.exactSearch(n,i))return a.push(this),!0;if(!0===A.fullTextSearch&&y.fuzzySearch(n,i))return a.push(this),!0}})),y.debug("Showing only matched items",n),y.remove.filteredItem(),a&&$.not(a).addClass(T.filtered)},fuzzySearch:function(e,t){var n=t.length,i=e.length;if(e=e.toLowerCase(),t=t.toLowerCase(),i>n)return!1;if(i===n)return e===t;e:for(var a=0,o=0;a-1},filterActive:function(){A.useLabels&&$.filter("."+T.active).addClass(T.filtered)},focusSearch:function(e){y.has.search()&&!y.is.focusedOnSearch()&&(e?(z.off("focus"+M,O.search),j.focus(),z.on("focus"+M,O.search,y.event.search.focus)):j.focus())},forceSelection:function(){var e=$.not(T.filtered).filter("."+T.selected).eq(0),t=$.not(T.filtered).filter("."+T.active).eq(0),n=e.length>0?e:t;if(n.length>0&&!y.is.multiple())return y.debug("Forcing partial selection to selected item",n),void y.event.item.click.call(n,{},!0);A.allowAdditions?(y.set.selected(y.get.query()),y.remove.searchTerm()):y.remove.searchTerm()},change:{values:function(t){A.allowAdditions||y.clear(),y.debug("Creating dropdown with specified values",t),y.setup.menu({values:t}),e.each(t,function(e,t){if(1==t.selected)return y.debug("Setting initial selection to",t.value),y.set.selected(t.value),!0})}},event:{change:function(){Y||(y.debug("Input changed, updating selection"),y.set.selected())},focus:function(){A.showOnFocus&&!Q&&y.is.hidden()&&!p&&y.show()},blur:function(e){p=n.activeElement===this,Q||p||(y.remove.activeLabel(),y.hide())},mousedown:function(){y.is.searchSelection()?b=!0:Q=!0},mouseup:function(){y.is.searchSelection()?b=!1:Q=!1},click:function(t){e(t.target).is(z)&&(y.is.focusedOnSearch()?y.show():y.focusSearch())},search:{focus:function(){Q=!0,y.is.multiple()&&y.remove.activeLabel(),A.showOnFocus&&y.search()},blur:function(e){p=n.activeElement===this,y.is.searchSelection()&&!b&&(X||p||(A.forceSelection&&y.forceSelection(),y.hide())),b=!1}},icon:{click:function(e){K.hasClass(T.clear)?y.clear():y.toggle()}},text:{focus:function(e){Q=!0,y.focusSearch()}},input:function(e){(y.is.multiple()||y.is.searchSelection())&&y.set.filtered(),clearTimeout(y.timer),y.timer=setTimeout(y.search,A.delay.search)},label:{click:function(t){var n=e(this),i=z.find(O.label),a=i.filter("."+T.active),o=n.nextAll("."+T.active),s=n.prevAll("."+T.active),r=o.length>0?n.nextUntil(o).add(a).add(n):n.prevUntil(s).add(a).add(n);t.shiftKey?(a.removeClass(T.active),r.addClass(T.active)):t.ctrlKey?n.toggleClass(T.active):(a.removeClass(T.active),n.addClass(T.active)),A.onLabelSelect.apply(this,i.filter("."+T.active))}},remove:{click:function(){var t=e(this).parent();t.hasClass(T.active)?y.remove.activeLabels():y.remove.activeLabels(t)}},test:{toggle:function(e){var t=y.is.multiple()?y.show:y.toggle;y.is.bubbledLabelClick(e)||y.is.bubbledIconClick(e)||y.determine.eventOnElement(e,t)&&e.preventDefault()},touch:function(e){y.determine.eventOnElement(e,function(){"touchstart"==e.type?y.timer=setTimeout(function(){y.hide()},A.delay.touch):"touchmove"==e.type&&clearTimeout(y.timer)}),e.stopPropagation()},hide:function(e){y.determine.eventInModule(e,y.hide)}},select:{mutation:function(t){y.debug(" removing selected option",e),i=y.remove.arrayValue(e,a),y.remove.optionValue(e)):(y.verbose("Removing from delimited values",e),i=(i=y.remove.arrayValue(e,a)).join(A.delimiter)),!1===A.fireOnInit&&y.is.initialLoad()?y.verbose("No callback on initial load",A.onRemove):A.onRemove.call(G,e,t,n),y.set.value(i,t,n),y.check.maxSelections()},arrayValue:function(t,n){return e.isArray(n)||(n=[n]),n=e.grep(n,function(e){return t!=e}),y.verbose("Removed value from delimited string",t,n),n},label:function(e,t){var n=z.find(O.label).filter("[data-"+D.value+'="'+y.escape.string(e)+'"]');y.verbose("Removing label",n),n.remove()},activeLabels:function(e){e=e||z.find(O.label).filter("."+T.active),y.verbose("Removing active label selections",e),y.remove.labels(e)},labels:function(t){t=t||z.find(O.label),y.verbose("Removing labels",t),t.each(function(){var t=e(this),n=t.data(D.value),a=n!==i?String(n):n,o=y.is.userValue(a);!1!==A.onLabelRemove.call(t,n)?(y.remove.message(),o?(y.remove.value(a),y.remove.label(a)):y.remove.selected(a)):y.debug("Label remove callback cancelled removal")})},tabbable:function(){y.is.searchSelection()?(y.debug("Searchable dropdown initialized"),j.removeAttr("tabindex"),B.removeAttr("tabindex")):(y.debug("Simple selection dropdown initialized"),z.removeAttr("tabindex"),B.removeAttr("tabindex"))},clearable:function(){K.removeClass(T.clear)}},has:{menuSearch:function(){return y.has.search()&&j.closest(B).length>0},search:function(){return j.length>0},sizer:function(){return N.length>0},selectInput:function(){return U.is("select")},minCharacters:function(e){return!A.minCharacters||(e=e!==i?String(e):String(y.get.query())).length>=A.minCharacters},firstLetter:function(e,t){var n;return!(!e||0===e.length||"string"!=typeof t)&&(n=y.get.choiceText(e,!1),(t=t.toLowerCase())==String(n).charAt(0).toLowerCase())},input:function(){return U.length>0},items:function(){return $.length>0},menu:function(){return B.length>0},message:function(){return 0!==B.children(O.message).length},label:function(e){var t=y.escape.value(e),n=z.find(O.label);return A.ignoreCase&&(t=t.toLowerCase()),n.filter("[data-"+D.value+'="'+y.escape.string(t)+'"]').length>0},maxSelections:function(){return A.maxSelections&&y.get.selectionCount()>=A.maxSelections},allResultsFiltered:function(){var e=$.not(O.addition);return e.filter(O.unselectable).length===e.length},userSuggestion:function(){return B.children(O.addition).length>0},query:function(){return""!==y.get.query()},value:function(e){return A.ignoreCase?y.has.valueIgnoringCase(e):y.has.valueMatchingCase(e)},valueMatchingCase:function(t){var n=y.get.values();return!!(e.isArray(n)?n&&-1!==e.inArray(t,n):n==t)},valueIgnoringCase:function(t){var n=y.get.values(),i=!1;return e.isArray(n)||(n=[n]),e.each(n,function(e,n){if(String(t).toLowerCase()==String(n).toLowerCase())return i=!0,!1}),i}},is:{active:function(){return z.hasClass(T.active)},animatingInward:function(){return B.transition("is inward")},animatingOutward:function(){return B.transition("is outward")},bubbledLabelClick:function(t){return e(t.target).is("select, input")&&z.closest("label").length>0},bubbledIconClick:function(t){return e(t.target).closest(K).length>0},alreadySetup:function(){return z.is("select")&&z.parent(O.dropdown).data(F)!==i&&0===z.prev().length},animating:function(e){return e?e.transition&&e.transition("is animating"):B.transition&&B.transition("is animating")},leftward:function(e){return(e||B).hasClass(T.leftward)},disabled:function(){return z.hasClass(T.disabled)},focused:function(){return n.activeElement===z[0]},focusedOnSearch:function(){return n.activeElement===j[0]},allFiltered:function(){return(y.is.multiple()||y.has.search())&&!(0==A.hideAdditions&&y.has.userSuggestion())&&!y.has.message()&&y.has.allResultsFiltered()},hidden:function(e){return!y.is.visible(e)},initialLoad:function(){return g},inObject:function(t,n){var i=!1;return e.each(n,function(e,n){if(n==t)return i=!0,!0}),i},multiple:function(){return z.hasClass(T.multiple)},remote:function(){return A.apiSettings&&y.can.useAPI()},single:function(){return!y.is.multiple()},selectMutation:function(t){var n=!1;return e.each(t,function(t,i){if(i.target&&e(i.target).is("select"))return n=!0,!0}),n},search:function(){return z.hasClass(T.search)},searchSelection:function(){return y.has.search()&&1===j.parent(O.dropdown).length},selection:function(){return z.hasClass(T.selection)},userValue:function(t){return-1!==e.inArray(t,y.get.userValues())},upward:function(e){return(e||z).hasClass(T.upward)},visible:function(e){return e?e.hasClass(T.visible):B.hasClass(T.visible)},verticallyScrollableContext:function(){var e=P.get(0)!==t&&P.css("overflow-y");return"auto"==e||"scroll"==e},horizontallyScrollableContext:function(){var e=P.get(0)!==t&&P.css("overflow-X");return"auto"==e||"scroll"==e}},can:{activate:function(e){return!!A.useLabels||(!y.has.maxSelections()||!(!y.has.maxSelections()||!e.hasClass(T.active)))},openDownward:function(e){var n,i,a=e||B,o=!0;return a.addClass(T.loading),i={context:{offset:P.get(0)===t?{top:0,left:0}:P.offset(),scrollTop:P.scrollTop(),height:P.outerHeight()},menu:{offset:a.offset(),height:a.outerHeight()}},y.is.verticallyScrollableContext()&&(i.menu.offset.top+=i.context.scrollTop),(n={above:i.context.scrollTop<=i.menu.offset.top-i.context.offset.top-i.menu.height,below:i.context.scrollTop+i.context.height>=i.menu.offset.top-i.context.offset.top+i.menu.height}).below?(y.verbose("Dropdown can fit in context downward",n),o=!0):n.below||n.above?(y.verbose("Dropdown cannot fit below, opening upward",n),o=!1):(y.verbose("Dropdown cannot fit in either direction, favoring downward",n),o=!0),a.removeClass(T.loading),o},openRightward:function(e){var n,i,a=e||B,o=!0;return a.addClass(T.loading),i={context:{offset:P.get(0)===t?{top:0,left:0}:P.offset(),scrollLeft:P.scrollLeft(),width:P.outerWidth()},menu:{offset:a.offset(),width:a.outerWidth()}},y.is.horizontallyScrollableContext()&&(i.menu.offset.left+=i.context.scrollLeft),(n=i.menu.offset.left-i.context.offset.left+i.menu.width>=i.context.scrollLeft+i.context.width)&&(y.verbose("Dropdown cannot fit in context rightward",n),o=!1),a.removeClass(T.loading),o},click:function(){return c||"click"==A.on},extendSelect:function(){return A.allowAdditions||A.apiSettings},show:function(){return!y.is.disabled()&&(y.has.items()||y.has.message())},useAPI:function(){return e.fn.api!==i}},animate:{show:function(t,n){var a,o=n||B,s=n?function(){}:function(){y.hideSubMenus(),y.hideOthers(),y.set.active()};t=e.isFunction(t)?t:function(){},y.verbose("Doing menu show animation",o),y.set.direction(n),a=y.get.transition(n),y.is.selection()&&y.set.scrollPosition(y.get.selectedItem(),!0),(y.is.hidden(o)||y.is.animating(o))&&("none"==a?(s(),o.transition("show"),t.call(G)):e.fn.transition!==i&&z.transition("is supported")?o.transition({animation:a+" in",debug:A.debug,verbose:A.verbose,duration:A.duration,queue:!0,onStart:s,onComplete:function(){t.call(G)}}):y.error(V.noTransition,a))},hide:function(t,n){var a=n||B,o=(n?A.duration:A.duration,n?function(){}:function(){y.can.click()&&y.unbind.intent(),y.remove.active()}),s=y.get.transition(n);t=e.isFunction(t)?t:function(){},(y.is.visible(a)||y.is.animating(a))&&(y.verbose("Doing menu hide animation",a),"none"==s?(o(),a.transition("hide"),t.call(G)):e.fn.transition!==i&&z.transition("is supported")?a.transition({animation:s+" out",duration:A.duration,debug:A.debug,verbose:A.verbose,queue:!1,onStart:o,onComplete:function(){t.call(G)}}):y.error(V.transition))}},hideAndClear:function(){y.remove.searchTerm(),y.has.maxSelections()||(y.has.search()?y.hide(function(){y.remove.filteredItem()}):y.hide())},delay:{show:function(){y.verbose("Delaying show event to ensure user intent"),clearTimeout(y.timer),y.timer=setTimeout(y.show,A.delay.show)},hide:function(){y.verbose("Delaying hide event to ensure user intent"),clearTimeout(y.timer),y.timer=setTimeout(y.hide,A.delay.hide)}},escape:{value:function(t){var n=e.isArray(t),i="string"==typeof t,a=!i&&!n,o=i&&-1!==t.search(R.quote),s=[];return a||!o?t:(y.debug("Encoding quote values for use in select",t),n?(e.each(t,function(e,t){s.push(t.replace(R.quote,"""))}),s):t.replace(R.quote,"""))},string:function(e){return(e=String(e)).replace(R.escape,"\\$&")}},setting:function(t,n){if(y.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,A,t);else{if(n===i)return A[t];e.isPlainObject(A[t])?e.extend(!0,A[t],n):A[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,y,t);else{if(n===i)return y[t];y[t]=n}},debug:function(){!A.silent&&A.debug&&(A.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,A.name+":"),y.debug.apply(console,arguments)))},verbose:function(){!A.silent&&A.verbose&&A.debug&&(A.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,A.name+":"),y.verbose.apply(console,arguments)))},error:function(){A.silent||(y.error=Function.prototype.bind.call(console.error,console,A.name+":"),y.error.apply(console,arguments))},performance:{log:function(e){var t,n;A.performance&&(n=(t=(new Date).getTime())-(u||t),u=t,d.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:G,"Execution Time":n})),clearTimeout(y.performance.timer),y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var t=A.name+":",n=0;u=!1,clearTimeout(y.performance.timer),e.each(d,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",l&&(t+=" '"+l+"'"),(console.group!==i||console.table!==i)&&d.length>0&&(console.groupCollapsed(t),console.table?console.table(d):e.each(d,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),d=[]}},invoke:function(t,n,a){var s,r,l,c=J;return n=n||m,a=G||a,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(n,a){var o=n!=s?a+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[o])&&n!=s)c=c[o];else{if(c[o]!==i)return r=c[o],!1;if(!e.isPlainObject(c[a])||n==s)return c[a]!==i?(r=c[a],!1):(y.error(V.method,t),!1);c=c[a]}})),e.isFunction(r)?l=r.apply(a,n):r!==i&&(l=r),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),r}},f?(J===i&&y.initialize(),y.invoke(v)):(J!==i&&J.invoke("destroy"),y.initialize())}),o!==i?o:s},e.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",values:!1,clearable:!1,apiSettings:!1,selectOnKeydown:!0,minCharacters:0,filterRemoteData:!1,saveRemoteData:!0,throttle:200,context:t,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,ignoreCase:!1,hideAdditions:!0,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowReselection:!1,allowTab:!0,allowCategorySelection:!1,fireOnInit:!1,transition:"auto",duration:200,glyphWidth:1.037,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:20,touch:50},onChange:function(e,t,n){},onAdd:function(e,t,n){},onRemove:function(e,t,n){},onLabelSelect:function(e){},onLabelCreate:function(t,n){return e(this)},onLabelRemove:function(e){return!0},onNoResults:function(e){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add {term}",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found.",serverError:"There was an error contacting the server"},error:{action:"You called a dropdown action that was not defined",alreadySetup:"Once a select has been initialized behaviors must be called on the created ui dropdown",labels:"Allowing user additions currently requires the use of labels.",missingMultiple:"")},fields:function(t){var n=e();return e.each(t,function(e,t){n=n.add(P.get.field(t))}),n},validation:function(t){var n,i;return!!b&&(e.each(b,function(e,o){i=o.identifier||e,P.get.field(i)[0]==t[0]&&(o.identifier=i,n=o)}),n||!1)},value:function(e){var t=[];return t.push(e),P.get.values.call(F,t)[e]},values:function(t){var n={};return(e.isArray(t)?P.get.fields(t):m).each(function(t,o){var a=e(o),r=(a.prop("type"),a.prop("name")),s=a.val(),l=a.is(x.checkbox),c=a.is(x.radio),u=-1!==r.indexOf("[]"),d=!!l&&a.is(":checked");r&&(u?(r=r.replace("[]",""),n[r]||(n[r]=[]),l?d?n[r].push(s||!0):n[r].push(!1):n[r].push(s)):c?n[r]!==i&&0!=n[r]||(n[r]=!!d&&(s||!0)):n[r]=l?!!d&&(s||!0):s)}),n}},has:{field:function(e){return P.verbose("Checking for existence of a field with identifier",e),"string"!=typeof(e=P.escape.string(e))&&P.error(S.identifier,e),m.filter("#"+e).length>0||(m.filter('[name="'+e+'"]').length>0||m.filter("[data-"+y.validate+'="'+e+'"]').length>0)}},escape:{string:function(e){return(e=String(e)).replace(w.escape,"\\$&")}},add:{rule:function(e,t){P.add.field(e,t)},field:function(t,n){var i={};P.is.shorthandRules(n)?(n=e.isArray(n)?n:[n],i[t]={rules:[]},e.each(n,function(e,n){i[t].rules.push({type:n})})):i[t]=n,b=e.extend({},b,i),P.debug("Adding rules",i,b)},fields:function(t){var n;n=t&&P.is.shorthandFields(t)?P.get.fieldsFromShorthand(t):t,b=e.extend({},b,n)},prompt:function(t,n){var o=P.get.field(t).closest(g),a=o.children(x.prompt),r=0!==a.length;n="string"==typeof n?[n]:n,P.verbose("Adding field error state",t),o.addClass(C.error),v.inline&&(r||(a=v.templates.prompt(n)).appendTo(o),a.html(n[0]),r?P.verbose("Inline errors are disabled, no inline error added",t):v.transition&&e.fn.transition!==i&&E.transition("is supported")?(P.verbose("Displaying error with css transition",v.transition),a.transition(v.transition+" in",v.duration)):(P.verbose("Displaying error with fallback javascript animation"),a.fadeIn(v.duration)))},errors:function(e){P.debug("Adding form error messages",e),P.set.error(),p.html(v.templates.error(e))}},remove:{rule:function(t,n){var o=e.isArray(n)?n:[n];if(n==i)return P.debug("Removed all rules"),void(b[t].rules=[]);b[t]!=i&&e.isArray(b[t].rules)&&e.each(b[t].rules,function(e,n){-1!==o.indexOf(n.type)&&(P.debug("Removed rule",n.type),b[t].rules.splice(e,1))})},field:function(t){var n=e.isArray(t)?t:[t];e.each(n,function(e,t){P.remove.rule(t)})},rules:function(t,n){e.isArray(t)?e.each(fields,function(e,t){P.remove.rule(t,n)}):P.remove.rule(t,n)},fields:function(e){P.remove.field(e)},prompt:function(t){var n=P.get.field(t).closest(g),o=n.children(x.prompt);n.removeClass(C.error),v.inline&&o.is(":visible")&&(P.verbose("Removing prompt for field",t),v.transition&&e.fn.transition!==i&&E.transition("is supported")?o.transition(v.transition+" out",v.duration,function(){o.remove()}):o.fadeOut(v.duration,function(){o.remove()}))}},set:{success:function(){E.removeClass(C.error).addClass(C.success)},defaults:function(){m.each(function(){var t=e(this),n=t.filter(x.checkbox).length>0?t.is(":checked"):t.val();t.data(y.defaultValue,n)})},error:function(){E.removeClass(C.success).addClass(C.error)},value:function(e,t){var n={};return n[e]=t,P.set.values.call(F,n)},values:function(t){e.isEmptyObject(t)||e.each(t,function(t,n){var i,o=P.get.field(t),a=o.parent(),r=e.isArray(n),s=a.is(x.uiCheckbox),l=a.is(x.uiDropdown),c=o.is(x.radio)&&s;o.length>0&&(r&&s?(P.verbose("Selecting multiple",n,o),a.checkbox("uncheck"),e.each(n,function(e,t){i=o.filter('[value="'+t+'"]'),a=i.parent(),i.length>0&&a.checkbox("check")})):c?(P.verbose("Selecting radio value",n,o),o.filter('[value="'+n+'"]').parent(x.uiCheckbox).checkbox("check")):s?(P.verbose("Setting checkbox value",n,a),!0===n?a.checkbox("check"):a.checkbox("uncheck")):l?(P.verbose("Setting dropdown value",n,a),a.dropdown("set selected",n)):(P.verbose("Setting field value",n,o),o.val(n)))})}},validate:{form:function(e,t){var n=P.get.values();if(D)return!1;if(O=[],P.determine.isValid()){if(P.debug("Form has no validation errors, submitting"),P.set.success(),!0!==t)return v.onSuccess.call(F,e,n)}else if(P.debug("Form has errors"),P.set.error(),v.inline||P.add.errors(O),E.data("moduleApi")!==i&&e.stopImmediatePropagation(),!0!==t)return v.onFailure.call(F,O,n)},field:function(t,n,o){o=o===i||o,"string"==typeof t&&(P.verbose("Validating field",t),n=t,t=b[t]);var a=t.identifier||n,r=P.get.field(a),s=!!t.depends&&P.get.field(t.depends),l=!0,c=[];return t.identifier||(P.debug("Using field name as identifier",a),t.identifier=a),r.prop("disabled")?(P.debug("Field is disabled. Skipping",a),l=!0):t.optional&&P.is.blank(r)?(P.debug("Field is optional and blank. Skipping",a),l=!0):t.depends&&P.is.empty(s)?(P.debug("Field depends on another value that is not present or empty. Skipping",s),l=!0):t.rules!==i&&e.each(t.rules,function(e,n){P.has.field(a)&&!P.validate.rule(t,n)&&(P.debug("Field is invalid",a,n.type),c.push(P.get.prompt(n,t)),l=!1)}),l?(o&&(P.remove.prompt(a,c),v.onValid.call(r)),!0):(o&&(O=O.concat(c),P.add.prompt(a,c),v.onInvalid.call(r,c)),!1)},rule:function(t,n){var o=P.get.field(t.identifier),a=(n.type,o.val()),r=P.get.ancillaryValue(n),s=P.get.ruleName(n),l=v.rules[s];if(e.isFunction(l))return a=a===i||""===a||null===a?"":e.trim(a+""),l.call(o,a,r);P.error(S.noRule,s)}},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,v,t);else{if(n===i)return v[t];v[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,P,t);else{if(n===i)return P[t];P[t]=n}},debug:function(){!v.silent&&v.debug&&(v.performance?P.performance.log(arguments):(P.debug=Function.prototype.bind.call(console.info,console,v.name+":"),P.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?P.performance.log(arguments):(P.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),P.verbose.apply(console,arguments)))},error:function(){v.silent||(P.error=Function.prototype.bind.call(console.error,console,v.name+":"),P.error.apply(console,arguments))},performance:{log:function(e){var t,n;v.performance&&(n=(t=(new Date).getTime())-(s||t),s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:F,"Execution Time":n})),clearTimeout(P.performance.timer),P.performance.timer=setTimeout(P.performance.display,500)},display:function(){var t=v.name+":",n=0;s=!1,clearTimeout(P.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),a.length>1&&(t+=" ("+a.length+")"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,a){var r,s,l,c=R;return n=n||f,a=F||a,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i&&(s=c[o],!1);c=c[o]}})),e.isFunction(s)?l=s.apply(a,n):s!==i&&(l=s),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),s}}).initialize()}),o!==i?o:this},e.fn.form.settings={name:"Form",namespace:"form",debug:!1,verbose:!1,performance:!0,fields:!1,keyboardShortcuts:!0,on:"submit",inline:!1,delay:200,revalidate:!0,transition:"scale",duration:200,onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},metadata:{defaultValue:"default",validate:"validate"},regExp:{htmlID:/^[a-zA-Z][\w:.-]*$/g,bracket:/\[(.*)\]/i,decimal:/^\d+\.?\d*$/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,flags:/^\/(.*)\/(.*)?/,integer:/^\-?\d+$/,number:/^\-?\d*(\.\d+)?$/,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i},text:{unspecifiedRule:"Please enter a valid value",unspecifiedField:"This field"},prompt:{empty:"{name} must have a value",checked:"{name} must be checked",email:"{name} must be a valid e-mail",url:"{name} must be a valid url",regExp:"{name} is not formatted correctly",integer:"{name} must be an integer",decimal:"{name} must be a decimal number",number:"{name} must be set to a number",is:'{name} must be "{ruleValue}"',isExactly:'{name} must be exactly "{ruleValue}"',not:'{name} cannot be set to "{ruleValue}"',notExactly:'{name} cannot be set to exactly "{ruleValue}"',contain:'{name} must contain "{ruleValue}"',containExactly:'{name} must contain exactly "{ruleValue}"',doesntContain:'{name} cannot contain "{ruleValue}"',doesntContainExactly:'{name} cannot contain exactly "{ruleValue}"',minLength:"{name} must be at least {ruleValue} characters",length:"{name} must be at least {ruleValue} characters",exactLength:"{name} must be exactly {ruleValue} characters",maxLength:"{name} cannot be longer than {ruleValue} characters",match:"{name} must match {ruleValue} field",different:"{name} must have a different value than {ruleValue} field",creditCard:"{name} must be a valid credit card number",minCount:"{name} must have at least {ruleValue} choices",exactCount:"{name} must have exactly {ruleValue} choices",maxCount:"{name} must have {ruleValue} or less choices"},selector:{checkbox:'input[type="checkbox"], input[type="radio"]',clear:".clear",field:"input, textarea, select",group:".field",input:"input",message:".error.message",prompt:".prompt.label",radio:'input[type="radio"]',reset:'.reset:not([type="reset"])',submit:'.submit:not([type="submit"])',uiCheckbox:".ui.checkbox",uiDropdown:".ui.dropdown"},className:{error:"error",label:"ui prompt label",pressed:"down",success:"success"},error:{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."},templates:{error:function(t){var n='
    ';return e.each(t,function(e,t){n+="
  • "+t+"
  • "}),e(n+="
")},prompt:function(t){return e("
").addClass("ui basic red pointing prompt label").html(t[0])}},rules:{empty:function(t){return!(t===i||""===t||e.isArray(t)&&0===t.length)},checked:function(){return e(this).filter(":checked").length>0},email:function(t){return e.fn.form.settings.regExp.email.test(t)},url:function(t){return e.fn.form.settings.regExp.url.test(t)},regExp:function(t,n){if(n instanceof RegExp)return t.match(n);var i,o=n.match(e.fn.form.settings.regExp.flags);return o&&(n=o.length>=2?o[1]:n,i=o.length>=3?o[2]:""),t.match(new RegExp(n,i))},integer:function(t,n){var o,a,r,s=e.fn.form.settings.regExp.integer;return n&&-1===["",".."].indexOf(n)&&(-1==n.indexOf("..")?s.test(n)&&(o=a=n-0):(r=n.split("..",2),s.test(r[0])&&(o=r[0]-0),s.test(r[1])&&(a=r[1]-0))),s.test(t)&&(o===i||t>=o)&&(a===i||t<=a)},decimal:function(t){return e.fn.form.settings.regExp.decimal.test(t)},number:function(t){return e.fn.form.settings.regExp.number.test(t)},is:function(e,t){return t="string"==typeof t?t.toLowerCase():t,(e="string"==typeof e?e.toLowerCase():e)==t},isExactly:function(e,t){return e==t},not:function(e,t){return(e="string"==typeof e?e.toLowerCase():e)!=(t="string"==typeof t?t.toLowerCase():t)},notExactly:function(e,t){return e!=t},contains:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(n,"i"))},containsExactly:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(n))},doesntContain:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1===t.search(new RegExp(n,"i"))},doesntContainExactly:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1===t.search(new RegExp(n))},minLength:function(e,t){return e!==i&&e.length>=t},length:function(e,t){return e!==i&&e.length>=t},exactLength:function(e,t){return e!==i&&e.length==t},maxLength:function(e,t){return e!==i&&e.length<=t},match:function(t,n){var o;e(this);return e('[data-validate="'+n+'"]').length>0?o=e('[data-validate="'+n+'"]').val():e("#"+n).length>0?o=e("#"+n).val():e('[name="'+n+'"]').length>0?o=e('[name="'+n+'"]').val():e('[name="'+n+'[]"]').length>0&&(o=e('[name="'+n+'[]"]')),o!==i&&t.toString()==o.toString()},different:function(t,n){var o;e(this);return e('[data-validate="'+n+'"]').length>0?o=e('[data-validate="'+n+'"]').val():e("#"+n).length>0?o=e("#"+n).val():e('[name="'+n+'"]').length>0?o=e('[name="'+n+'"]').val():e('[name="'+n+'[]"]').length>0&&(o=e('[name="'+n+'[]"]')),o!==i&&t.toString()!==o.toString()},creditCard:function(t,n){var i,o,a={visa:{pattern:/^4/,length:[16]},amex:{pattern:/^3[47]/,length:[15]},mastercard:{pattern:/^5[1-5]/,length:[16]},discover:{pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,length:[16]},unionPay:{pattern:/^(62|88)/,length:[16,17,18,19]},jcb:{pattern:/^35(2[89]|[3-8][0-9])/,length:[16]},maestro:{pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,length:[12,13,14,15,16,17,18,19]},dinersClub:{pattern:/^(30[0-5]|^36)/,length:[14]},laser:{pattern:/^(6304|670[69]|6771)/,length:[16,17,18,19]},visaElectron:{pattern:/^(4026|417500|4508|4844|491(3|7))/,length:[16]}},r={},s=!1,l="string"==typeof n&&n.split(",");if("string"==typeof t&&0!==t.length){if(t=t.replace(/[\-]/g,""),l&&(e.each(l,function(n,i){(o=a[i])&&(r={length:-1!==e.inArray(t.length,o.length),pattern:-1!==t.search(o.pattern)}).length&&r.pattern&&(s=!0)}),!s))return!1;if((i={number:-1!==e.inArray(t.length,a.unionPay.length),pattern:-1!==t.search(a.unionPay.pattern)}).number&&i.pattern)return!0;for(var c=t.length,u=0,d=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],f=0;c--;)f+=d[u][parseInt(t.charAt(c),10)],u^=1;return f%10==0&&f>0}},minCount:function(e,t){return 0==t||(1==t?""!==e:e.split(",").length>=t)},exactCount:function(e,t){return 0==t?""===e:1==t?""!==e&&-1===e.search(","):e.split(",").length==t},maxCount:function(e,t){return 0!=t&&(1==t?-1===e.search(","):e.split(",").length<=t)}}}}(jQuery,window,document),function(e,t,n,i){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.accordion=function(n){var o,a=e(this),r=(new Date).getTime(),s=[],l=arguments[0],c="string"==typeof l,u=[].slice.call(arguments,1);t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame;return a.each(function(){var d,f,m=e.isPlainObject(n)?e.extend(!0,{},e.fn.accordion.settings,n):e.extend({},e.fn.accordion.settings),g=m.className,p=m.namespace,h=m.selector,v=m.error,b="."+p,y="module-"+p,x=a.selector||"",C=e(this),w=C.find(h.title),S=C.find(h.content),k=this,T=C.data(y);f={initialize:function(){f.debug("Initializing",C),f.bind.events(),m.observeChanges&&f.observeChanges(),f.instantiate()},instantiate:function(){T=f,C.data(y,f)},destroy:function(){f.debug("Destroying previous instance",C),C.off(b).removeData(y)},refresh:function(){w=C.find(h.title),S=C.find(h.content)},observeChanges:function(){"MutationObserver"in t&&((d=new MutationObserver(function(e){f.debug("DOM tree modified, updating selector cache"),f.refresh()})).observe(k,{childList:!0,subtree:!0}),f.debug("Setting up mutation observer",d))},bind:{events:function(){f.debug("Binding delegated events"),C.on(m.on+b,h.trigger,f.event.click)}},event:{click:function(){f.toggle.call(this)}},toggle:function(t){var n=t!==i?"number"==typeof t?w.eq(t):e(t).closest(h.title):e(this).closest(h.title),o=n.next(S),a=o.hasClass(g.animating),r=o.hasClass(g.active),s=r&&!a,l=!r&&a;f.debug("Toggling visibility of content",n),s||l?m.collapsible?f.close.call(n):f.debug("Cannot close accordion content collapsing is disabled"):f.open.call(n)},open:function(t){var n=t!==i?"number"==typeof t?w.eq(t):e(t).closest(h.title):e(this).closest(h.title),o=n.next(S),a=o.hasClass(g.animating);o.hasClass(g.active)||a?f.debug("Accordion already open, skipping",o):(f.debug("Opening accordion content",n),m.onOpening.call(o),m.onChanging.call(o),m.exclusive&&f.closeOthers.call(n),n.addClass(g.active),o.stop(!0,!0).addClass(g.animating),m.animateChildren&&(e.fn.transition!==i&&C.transition("is supported")?o.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:m.debug,verbose:m.verbose,duration:m.duration}):o.children().stop(!0,!0).animate({opacity:1},m.duration,f.resetOpacity)),o.slideDown(m.duration,m.easing,function(){o.removeClass(g.animating).addClass(g.active),f.reset.display.call(this),m.onOpen.call(this),m.onChange.call(this)}))},close:function(t){var n=t!==i?"number"==typeof t?w.eq(t):e(t).closest(h.title):e(this).closest(h.title),o=n.next(S),a=o.hasClass(g.animating),r=o.hasClass(g.active);!r&&!(!r&&a)||r&&a||(f.debug("Closing accordion content",o),m.onClosing.call(o),m.onChanging.call(o),n.removeClass(g.active),o.stop(!0,!0).addClass(g.animating),m.animateChildren&&(e.fn.transition!==i&&C.transition("is supported")?o.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:m.debug,verbose:m.verbose,duration:m.duration}):o.children().stop(!0,!0).animate({opacity:0},m.duration,f.resetOpacity)),o.slideUp(m.duration,m.easing,function(){o.removeClass(g.animating).removeClass(g.active),f.reset.display.call(this),m.onClose.call(this),m.onChange.call(this)}))},closeOthers:function(t){var n,o,a,r=t!==i?w.eq(t):e(this).closest(h.title),s=r.parents(h.content).prev(h.title),l=r.closest(h.accordion),c=h.title+"."+g.active+":visible",u=h.content+"."+g.active+":visible";m.closeNested?a=(n=l.find(c).not(s)).next(S):(n=l.find(c).not(s),o=l.find(u).find(c).not(s),a=(n=n.not(o)).next(S)),n.length>0&&(f.debug("Exclusive enabled, closing other content",n),n.removeClass(g.active),a.removeClass(g.animating).stop(!0,!0),m.animateChildren&&(e.fn.transition!==i&&C.transition("is supported")?a.children().transition({animation:"fade out",useFailSafe:!0,debug:m.debug,verbose:m.verbose,duration:m.duration}):a.children().stop(!0,!0).animate({opacity:0},m.duration,f.resetOpacity)),a.slideUp(m.duration,m.easing,function(){e(this).removeClass(g.active),f.reset.display.call(this)}))},reset:{display:function(){f.verbose("Removing inline display from element",this),e(this).css("display",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")},opacity:function(){f.verbose("Removing inline opacity from element",this),e(this).css("opacity",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")}},setting:function(t,n){if(f.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];e.isPlainObject(m[t])?e.extend(!0,m[t],n):m[t]=n}},internal:function(t,n){if(f.debug("Changing internal",t,n),n===i)return f[t];e.isPlainObject(t)?e.extend(!0,f,t):f[t]=n},debug:function(){!m.silent&&m.debug&&(m.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,m.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!m.silent&&m.verbose&&m.debug&&(m.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),f.verbose.apply(console,arguments)))},error:function(){m.silent||(f.error=Function.prototype.bind.call(console.error,console,m.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,n;m.performance&&(n=(t=(new Date).getTime())-(r||t),r=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:k,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=m.name+":",n=0;r=!1,clearTimeout(f.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",x&&(t+=" '"+x+"'"),(console.group!==i||console.table!==i)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,n,a){var r,s,l,c=T;return n=n||u,a=k||a,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):(f.error(v.method,t),!1);c=c[o]}})),e.isFunction(s)?l=s.apply(a,n):s!==i&&(l=s),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),s}},c?(T===i&&f.initialize(),f.invoke(l)):(T!==i&&T.invoke("destroy"),f.initialize())}),o!==i?o:this},e.fn.accordion.settings={name:"Accordion",namespace:"accordion",silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",observeChanges:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",onOpening:function(){},onClosing:function(){},onChanging:function(){},onOpen:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active",animating:"animating"},selector:{accordion:".accordion",title:".title",trigger:".title",content:".content"}},e.extend(e.easing,{easeOutQuad:function(e,t,n,i,o){return-i*(t/=o)*(t-2)+n}})}(jQuery,window,document),function(e,t,n,i){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.checkbox=function(o){var a,r=e(this),s=r.selector||"",l=(new Date).getTime(),c=[],u=arguments[0],d="string"==typeof u,f=[].slice.call(arguments,1);return r.each(function(){var r,m,g=e.extend(!0,{},e.fn.checkbox.settings,o),p=g.className,h=g.namespace,v=g.selector,b=g.error,y="."+h,x="module-"+h,C=e(this),w=e(this).children(v.label),S=e(this).children(v.input),k=S[0],T=!1,A=!1,R=C.data(x),P=this;m={initialize:function(){m.verbose("Initializing checkbox",g),m.create.label(),m.bind.events(),m.set.tabbable(),m.hide.input(),m.observeChanges(),m.instantiate(),m.setup()},instantiate:function(){m.verbose("Storing instance of module",m),R=m,C.data(x,m)},destroy:function(){m.verbose("Destroying module"),m.unbind.events(),m.show.input(),C.removeData(x)},fix:{reference:function(){C.is(v.input)&&(m.debug("Behavior called on adjusting invoked element"),C=C.closest(v.checkbox),m.refresh())}},setup:function(){m.set.initialLoad(),m.is.indeterminate()?(m.debug("Initial value is indeterminate"),m.indeterminate()):m.is.checked()?(m.debug("Initial value is checked"),m.check()):(m.debug("Initial value is unchecked"),m.uncheck()),m.remove.initialLoad()},refresh:function(){w=C.children(v.label),S=C.children(v.input),k=S[0]},hide:{input:function(){m.verbose("Modifying z-index to be unselectable"),S.addClass(p.hidden)}},show:{input:function(){m.verbose("Modifying z-index to be selectable"),S.removeClass(p.hidden)}},observeChanges:function(){"MutationObserver"in t&&((r=new MutationObserver(function(e){m.debug("DOM tree modified, updating selector cache"),m.refresh()})).observe(P,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",r))},attachEvents:function(t,n){var i=e(t);n=e.isFunction(m[n])?m[n]:m.toggle,i.length>0?(m.debug("Attaching checkbox events to element",t,n),i.on("click"+y,n)):m.error(b.notFound)},event:{click:function(t){var n=e(t.target);n.is(v.input)?m.verbose("Using default check action on initialized checkbox"):n.is(v.link)?m.debug("Clicking link inside checkbox, skipping toggle"):(m.toggle(),S.focus(),t.preventDefault())},keydown:function(e){var t=e.which,n=13,i=32;t==27?(m.verbose("Escape key pressed blurring field"),S.blur(),A=!0):e.ctrlKey||t!=i&&t!=n?A=!1:(m.verbose("Enter/space key pressed, toggling checkbox"),m.toggle(),A=!0)},keyup:function(e){A&&e.preventDefault()}},check:function(){m.should.allowCheck()&&(m.debug("Checking checkbox",S),m.set.checked(),m.should.ignoreCallbacks()||(g.onChecked.call(k),g.onChange.call(k)))},uncheck:function(){m.should.allowUncheck()&&(m.debug("Unchecking checkbox"),m.set.unchecked(),m.should.ignoreCallbacks()||(g.onUnchecked.call(k),g.onChange.call(k)))},indeterminate:function(){m.should.allowIndeterminate()?m.debug("Checkbox is already indeterminate"):(m.debug("Making checkbox indeterminate"),m.set.indeterminate(),m.should.ignoreCallbacks()||(g.onIndeterminate.call(k),g.onChange.call(k)))},determinate:function(){m.should.allowDeterminate()?m.debug("Checkbox is already determinate"):(m.debug("Making checkbox determinate"),m.set.determinate(),m.should.ignoreCallbacks()||(g.onDeterminate.call(k),g.onChange.call(k)))},enable:function(){m.is.enabled()?m.debug("Checkbox is already enabled"):(m.debug("Enabling checkbox"),m.set.enabled(),g.onEnable.call(k),g.onEnabled.call(k))},disable:function(){m.is.disabled()?m.debug("Checkbox is already disabled"):(m.debug("Disabling checkbox"),m.set.disabled(),g.onDisable.call(k),g.onDisabled.call(k))},get:{radios:function(){var t=m.get.name();return e('input[name="'+t+'"]').closest(v.checkbox)},otherRadios:function(){return m.get.radios().not(C)},name:function(){return S.attr("name")}},is:{initialLoad:function(){return T},radio:function(){return S.hasClass(p.radio)||"radio"==S.attr("type")},indeterminate:function(){return S.prop("indeterminate")!==i&&S.prop("indeterminate")},checked:function(){return S.prop("checked")!==i&&S.prop("checked")},disabled:function(){return S.prop("disabled")!==i&&S.prop("disabled")},enabled:function(){return!m.is.disabled()},determinate:function(){return!m.is.indeterminate()},unchecked:function(){return!m.is.checked()}},should:{allowCheck:function(){return m.is.determinate()&&m.is.checked()&&!m.should.forceCallbacks()?(m.debug("Should not allow check, checkbox is already checked"),!1):!1!==g.beforeChecked.apply(k)||(m.debug("Should not allow check, beforeChecked cancelled"),!1)},allowUncheck:function(){return m.is.determinate()&&m.is.unchecked()&&!m.should.forceCallbacks()?(m.debug("Should not allow uncheck, checkbox is already unchecked"),!1):!1!==g.beforeUnchecked.apply(k)||(m.debug("Should not allow uncheck, beforeUnchecked cancelled"),!1)},allowIndeterminate:function(){return m.is.indeterminate()&&!m.should.forceCallbacks()?(m.debug("Should not allow indeterminate, checkbox is already indeterminate"),!1):!1!==g.beforeIndeterminate.apply(k)||(m.debug("Should not allow indeterminate, beforeIndeterminate cancelled"),!1)},allowDeterminate:function(){return m.is.determinate()&&!m.should.forceCallbacks()?(m.debug("Should not allow determinate, checkbox is already determinate"),!1):!1!==g.beforeDeterminate.apply(k)||(m.debug("Should not allow determinate, beforeDeterminate cancelled"),!1)},forceCallbacks:function(){return m.is.initialLoad()&&g.fireOnInit},ignoreCallbacks:function(){return T&&!g.fireOnInit}},can:{change:function(){return!(C.hasClass(p.disabled)||C.hasClass(p.readOnly)||S.prop("disabled")||S.prop("readonly"))},uncheck:function(){return"boolean"==typeof g.uncheckable?g.uncheckable:!m.is.radio()}},set:{initialLoad:function(){T=!0},checked:function(){m.verbose("Setting class to checked"),C.removeClass(p.indeterminate).addClass(p.checked),m.is.radio()&&m.uncheckOthers(),m.is.indeterminate()||!m.is.checked()?(m.verbose("Setting state to checked",k),S.prop("indeterminate",!1).prop("checked",!0),m.trigger.change()):m.debug("Input is already checked, skipping input property change")},unchecked:function(){m.verbose("Removing checked class"),C.removeClass(p.indeterminate).removeClass(p.checked),m.is.indeterminate()||!m.is.unchecked()?(m.debug("Setting state to unchecked"),S.prop("indeterminate",!1).prop("checked",!1),m.trigger.change()):m.debug("Input is already unchecked")},indeterminate:function(){m.verbose("Setting class to indeterminate"),C.addClass(p.indeterminate),m.is.indeterminate()?m.debug("Input is already indeterminate, skipping input property change"):(m.debug("Setting state to indeterminate"),S.prop("indeterminate",!0),m.trigger.change())},determinate:function(){m.verbose("Removing indeterminate class"),C.removeClass(p.indeterminate),m.is.determinate()?m.debug("Input is already determinate, skipping input property change"):(m.debug("Setting state to determinate"),S.prop("indeterminate",!1))},disabled:function(){m.verbose("Setting class to disabled"),C.addClass(p.disabled),m.is.disabled()?m.debug("Input is already disabled, skipping input property change"):(m.debug("Setting state to disabled"),S.prop("disabled","disabled"),m.trigger.change())},enabled:function(){m.verbose("Removing disabled class"),C.removeClass(p.disabled),m.is.enabled()?m.debug("Input is already enabled, skipping input property change"):(m.debug("Setting state to enabled"),S.prop("disabled",!1),m.trigger.change())},tabbable:function(){m.verbose("Adding tabindex to checkbox"),S.attr("tabindex")===i&&S.attr("tabindex",0)}},remove:{initialLoad:function(){T=!1}},trigger:{change:function(){var e=n.createEvent("HTMLEvents"),t=S[0];t&&(m.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},create:{label:function(){S.prevAll(v.label).length>0?(S.prev(v.label).detach().insertAfter(S),m.debug("Moving existing label",w)):m.has.label()||(w=e("