diff --git a/semantic/dist/components/accordion.min.js b/semantic/dist/components/accordion.min.js index 62839635..9344c4c0 100644 --- a/semantic/dist/components/accordion.min.js +++ b/semantic/dist/components/accordion.min.js @@ -8,4 +8,4 @@ * http://opensource.org/licenses/MIT * */ -!function(T,k,F){"use strict";T.isFunction=T.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},k=void 0!==k&&k.Math==Math?k:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),T.fn.accordion=function(s){var h,v=T(this),b=(new Date).getTime(),y=[],C=s,O="string"==typeof C,x=[].slice.call(arguments,1);return v.each(function(){var e,a=T.isPlainObject(s)?T.extend(!0,{},T.fn.accordion.settings,s):T.extend({},T.fn.accordion.settings),l=a.className,n=a.namespace,c=a.selector,r=a.error,t="."+n,i="module-"+n,o=v.selector||"",d=T(this),u=d.find(c.title),g=d.find(c.content),f=this,p=d.data(i),m={initialize:function(){m.debug("Initializing",d),m.bind.events(),a.observeChanges&&m.observeChanges(),m.instantiate()},instantiate:function(){p=m,d.data(i,m)},destroy:function(){m.debug("Destroying previous instance",d),d.off(t).removeData(i)},refresh:function(){u=d.find(c.title),g=d.find(c.content)},observeChanges:function(){"MutationObserver"in k&&((e=new MutationObserver(function(e){m.debug("DOM tree modified, updating selector cache"),m.refresh()})).observe(f,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",e))},bind:{events:function(){m.debug("Binding delegated events"),d.on(a.on+t,c.trigger,m.event.click)}},event:{click:function(){m.toggle.call(this)}},toggle:function(e){var n=e!==F?"number"==typeof e?u.eq(e):T(e).closest(c.title):T(this).closest(c.title),t=n.next(g),i=t.hasClass(l.animating),e=t.hasClass(l.active),t=e&&!i,i=!e&&i;m.debug("Toggling visibility of content",n),t||i?a.collapsible?m.close.call(n):m.debug("Cannot close accordion content collapsing is disabled"):m.open.call(n)},open:function(e){var n=e!==F?"number"==typeof e?u.eq(e):T(e).closest(c.title):T(this).closest(c.title),t=n.next(g),e=t.hasClass(l.animating);t.hasClass(l.active)||e?m.debug("Accordion already open, skipping",t):(m.debug("Opening accordion content",n),a.onOpening.call(t),a.onChanging.call(t),a.exclusive&&m.closeOthers.call(n),n.addClass(l.active),t.stop(!0,!0).addClass(l.animating),a.animateChildren&&(T.fn.transition!==F&&d.transition("is supported")?t.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:a.debug,verbose:a.verbose,duration:a.duration,skipInlineHidden:!0,onComplete:function(){t.children().removeClass(l.transition)}}):t.children().stop(!0,!0).animate({opacity:1},a.duration,m.resetOpacity)),t.slideDown(a.duration,a.easing,function(){t.removeClass(l.animating).addClass(l.active),m.reset.display.call(this),a.onOpen.call(this),a.onChange.call(this)}))},close:function(e){var n=e!==F?"number"==typeof e?u.eq(e):T(e).closest(c.title):T(this).closest(c.title),t=n.next(g),i=t.hasClass(l.animating),e=t.hasClass(l.active);!e&&!(!e&&i)||e&&i||(m.debug("Closing accordion content",t),a.onClosing.call(t),a.onChanging.call(t),n.removeClass(l.active),t.stop(!0,!0).addClass(l.animating),a.animateChildren&&(T.fn.transition!==F&&d.transition("is supported")?t.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:a.debug,verbose:a.verbose,duration:a.duration,skipInlineHidden:!0}):t.children().stop(!0,!0).animate({opacity:0},a.duration,m.resetOpacity)),t.slideUp(a.duration,a.easing,function(){t.removeClass(l.animating).removeClass(l.active),m.reset.display.call(this),a.onClose.call(this),a.onChange.call(this)}))},closeOthers:function(e){var n,t=e!==F?u.eq(e):T(this).closest(c.title),i=t.parents(c.content).prev(c.title),o=t.closest(c.accordion),e=c.title+"."+l.active+":visible",t=c.content+"."+l.active+":visible",s=a.closeNested?(n=o.find(e).not(i)).next(g):(n=o.find(e).not(i),s=o.find(t).find(e).not(i),(n=n.not(s)).next(g));0").addClass(Q.popup)[a](t)),ee.addClass(Q.calendar),te&&ee.addClass(Q.inverted),e=function(){return ae.refreshTooltips(),$.onVisible.apply(ee,arguments)},a=$.onHidden,l.length||(ee.attr("tabindex","0"),e=function(){return ae.refreshTooltips(),ae.focus(),$.onVisible.apply(ee,arguments)},a=function(){return ae.blur(),$.onHidden.apply(ee,arguments)}),t=ae.setting("on"),a=re.extend({},$.popupOptions,{popup:ee,on:t,hoverable:"hover"===t,closable:"click"===t,onShow:function(){return ae.set.focusDate(ae.get.date()),ae.set.mode(ae.get.validatedMode($.startMode)),$.onShow.apply(ee,arguments)},onVisible:e,onHide:$.onHide,onHidden:a}),ae.popup(a)):ae.error(s.popup))},inline:function(){d.length&&!$.inline||($.inline=!0,ee=re("
").addClass(Q.calendar).appendTo(o),l.length||ee.attr("tabindex","0"))},input:function(){$.touchReadonly&&l.length&&c&&l.prop("readonly",!0),ae.check.disabled()},date:function(){var e;$.initialDate?e=a.date($.initialDate,$):o.data(X.date)!==ie?e=a.date(o.data(X.date),$):l.length&&(e=a.date(l.val(),$)),ae.set.date(e,$.formatInput,!1),ae.set.mode(ae.get.mode(),!1)}},trigger:{change:function(){var e,t=l[0];t&&(e=k.createEvent("HTMLEvents"),ae.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},create:{calendar:function(){var e,t,a,n=ae.get.mode(),r=new Date,i=ae.get.date(),o=ae.get.focusDate(),s=ae.helper.dateInRange(o||i||$.initialDate||r);o||ae.set.focusDate(o=s,!1,!1);var l="year"===n,d="month"===n,u="day"===n,c="hour"===n,p="minute"===n,f="time"===$.type,m=Math.max($.multiMonth,1),h=u?ae.get.monthOffset():0,g=s.getMinutes(),D=s.getHours(),y=s.getDate(),v=s.getMonth()+h,b=s.getFullYear(),C=u?$.showWeekNumbers?8:7:c?4:_.column,w=u||c?6:_.row,M=u?m:1,x=ee,T=x.hasClass("left")?"right center":"left center";for(x.empty(),1").addClass(Q.grid).appendTo(x)),t=0;t").addClass(Q.column).appendTo(a));var k=v+t,O=(new Date(b,k,1).getDay()-$.firstDayOfWeek%7+7)%7;!$.constantHeight&&u&&(j=new Date(b,k+1,0).getDate()+O,w=Math.ceil(j/7));var F=l?10:d?1:0,N=u?1:0,A=c||p?1:0,E=c||p?y:1,H=new Date(b-F,k-N,E-A,D),Y=new Date(b+F,k+N,E+A,D),I=l?new Date(10*Math.ceil(b/10)-9,0,0):d?new Date(b,0,0):u?new Date(b,k,0):new Date(b,k,y,-1),j=l?new Date(10*Math.ceil(b/10)+1,0,1):d?new Date(b+1,0,1):u?new Date(b,k+1,1):new Date(b,k,y+1),F=n;u&&$.showWeekNumbers&&(F+=" andweek");N=re("").addClass(Q.table).addClass(F).addClass(ne[C]+" column").appendTo(x);te&&N.addClass(Q.inverted);var S=C;if(!f){var E=re("").appendTo(N),q=re("").appendTo(E),W=re("").appendTo(E),$.showWeekNumbers&&((W=re("").appendTo(N),G=l?10*Math.ceil(b/10)-9:u?1-O:0,P=0;P").appendTo(V),u&&$.showWeekNumbers&&((W=re("").appendTo(V),(O=re("
").attr("colspan",""+C).appendTo(q),A=l||d?new Date(b,0,1):u?new Date(b,k,1):new Date(b,k,y,D,g),F=re("").addClass(Q.link).appendTo(W);F.text(Z.header(A,n,$));var R,A=d?$.disableYear?"day":"year":u?$.disableMonth?"year":"month":"day";if(F.data(X.mode,A),0===t&&((R=re("").addClass(Q.prev).appendTo(W)).data(X.focusDate,H),R.toggleClass(Q.disabledCell,!ae.helper.isDateInRange(I,n)),re("").addClass(Q.prevIcon).appendTo(R)),t===M-1&&((R=re("").addClass(Q.next).appendTo(W)).data(X.focusDate,Y),R.toggleClass(Q.disabledCell,!ae.helper.isDateInRange(j,n)),re("").addClass(Q.nextIcon).appendTo(R)),u)for(q=re("
").appendTo(q)).text($.text.weekNo),W.addClass(Q.weekCell),S--),G=0;G").appendTo(q)).text(Z.dayColumnHeader((G+$.firstDayOfWeek)%7,$))}for(var V=re("
").appendTo(q)).text(ae.get.weekOfYear(b,k,G+1-$.firstDayOfWeek)),W.addClass(Q.weekCell)),e=0;e").addClass(Q.cell).appendTo(q)).text(K),W.data(X.date,B);var U,J=u&&B.getMonth()!==(k+12)%12,z=!$.selectAdjacentDays&&J||!ae.helper.isDateInRange(B,n)||$.isDisabled(B,n)||ae.helper.isDisabled(B,n)||!ae.helper.isEnabled(B,n);z?null!==(L=ae.helper.findDayAsObject(B,n,$.disabledDates))&&L[X.message]&&(W.attr("data-tooltip",L[X.message]),W.attr("data-position",L[X.position]||T),(L[X.inverted]||te&&L[X.inverted]===ie)&&W.attr("data-inverted",""),L[X.variation]&&W.attr("data-variation",L[X.variation])):null!==(U=ae.helper.findDayAsObject(B,n,$.eventDates))&&(W.addClass(U[X.class]||$.eventClass),U[X.message]&&(W.attr("data-tooltip",U[X.message]),W.attr("data-position",U[X.position]||T),(U[X.inverted]||te&&U[X.inverted]===ie)&&W.attr("data-inverted",""),U[X.variation]&&W.attr("data-variation",U[X.variation])));var K=ae.helper.dateEqual(B,i,n),L=ae.helper.dateEqual(B,r,n);W.toggleClass(Q.adjacentCell,J&&!U),W.toggleClass(Q.disabledCell,z),W.toggleClass(Q.activeCell,K&&!(J&&z)),c||p||W.toggleClass(Q.todayCell,!J&&L),Z.cell(W,B,{mode:n,adjacent:J,disabled:z,active:K,today:L}),ae.helper.dateEqual(B,o,n)&&ae.set.focusDate(B,!1,!1)}$.today&&(O=re("
").attr("colspan",""+C).addClass(Q.today).appendTo(O)).text(Z.today($)),O.data(X.date,r)),ae.update.focus(!1,N),$.inline&&ae.refreshTooltips()}}},update:{focus:function(e,t){t=t||ee;var o=ae.get.mode(),a=ae.get.date(),s=ae.get.focusDate(),l=ae.get.startDate(),d=ae.get.endDate(),u=(e?s:null)||a||(c?null:s);t.find("td").each(function(){var e,t,a,n,r=re(this),i=r.data(X.date);i&&(e=r.hasClass(Q.disabledCell),t=r.hasClass(Q.activeCell),a=r.hasClass(Q.adjacentCell),n=ae.helper.dateEqual(i,s,o),i=!!u&&(!!l&&ae.helper.isDateInRange(i,o,l,u)||!!d&&ae.helper.isDateInRange(i,o,u,d)),r.toggleClass(Q.focusCell,n&&(!c||f)&&(!a||$.selectAdjacentDays&&a)&&!e),ae.helper.isTodayButton(r)||r.toggleClass(Q.rangeCell,i&&!t&&!e))})}},refresh:function(){ae.create.calendar()},refreshTooltips:function(){var n=re(T).width();ee.find("td[data-position]").each(function(){var e=re(this),t=T.getComputedStyle(e[0],":after").width.replace(/[^0-9\.]/g,""),a=e.attr("data-position"),t=n-e.width()-(parseInt(t,10)||250)>e.offset().left?"right":"left";-1===a.indexOf(t)&&e.attr("data-position",a.replace(/(left|right)/,t))})},bind:{events:function(){ae.debug("Binding events"),ee.on("mousedown"+r,ae.event.mousedown),ee.on("touchstart"+r,ae.event.mousedown),ee.on("mouseup"+r,ae.event.mouseup),ee.on("touchend"+r,ae.event.mouseup),ee.on("mouseover"+r,ae.event.mouseover),l.length?(l.on("input"+r,ae.event.inputChange),l.on("focus"+r,ae.event.inputFocus),l.on("blur"+r,ae.event.inputBlur),l.on("keydown"+r,ae.event.keydown)):ee.on("keydown"+r,ae.event.keydown)}},unbind:{events:function(){ae.debug("Unbinding events"),ee.off(r),l.length&&l.off(r)}},event:{mouseover:function(e){var t=re(e.target).data(X.date),e=1===e.buttons;t&&ae.set.focusDate(t,!1,!0,e)},mousedown:function(e){l.length&&e.preventDefault(),f=0<=e.type.indexOf("touch");e=re(e.target).data(X.date);e&&ae.set.focusDate(e,!1,!0,!0)},mouseup:function(e){ae.focus(),e.preventDefault(),e.stopPropagation(),f=!1;var t,a,n=re(e.target);n.hasClass("disabled")||(t=(n=(a=n.parent()).data(X.date)||a.data(X.focusDate)||a.data(X.mode)?a:n).data(X.date),e=n.data(X.focusDate),a=n.data(X.mode),t&&!1!==$.onSelect.call(u,t,ae.get.mode())?(n=n.hasClass(Q.today),ae.selectDate(t,n)):e?ae.set.focusDate(e):a&&ae.set.mode(a))},keydown:function(e){var t,a,n,r,i,o,s,l=e.which;27!==l&&9!==l||ae.popup("hide"),ae.popup("is visible")&&(37===l||38===l||39===l||40===l?(i="day"===(o=ae.get.mode())?7:"hour"===o?4:"minute"===o?_.column:3,s=37===l?-1:38===l?-i:39==l?1:i,s*="minute"===o?$.minTimeGap:1,a=(t=ae.get.focusDate()||ae.get.date()||new Date).getFullYear()+("year"===o?s:0),n=t.getMonth()+("month"===o?s:0),r=t.getDate()+("day"===o?s:0),i=t.getHours()+("hour"===o?s:0),s=t.getMinutes()+("minute"===o?s:0),s=new Date(a,n,r,i,s),"time"===$.type&&(s=ae.helper.mergeDateTime(t,s)),ae.helper.isDateInRange(s,o)&&ae.set.focusDate(s)):13===l&&(o=ae.get.mode(),(s=ae.get.focusDate())&&!$.isDisabled(s,o)&&!ae.helper.isDisabled(s,o)&&ae.helper.isEnabled(s,o)&&ae.selectDate(s),e.preventDefault(),e.stopPropagation())),38!==l&&40!==l||(e.preventDefault(),ae.popup("show"))},inputChange:function(){var e=l.val(),e=a.date(e,$);ae.set.date(e,!1)},inputFocus:function(){ee.addClass(Q.active)},inputBlur:function(){var e;ee.removeClass(Q.active),$.formatInput&&(e=ae.get.date(),e=Z.datetime(e,$),l.val(e)),h&&(ae.trigger.change(),h=!1)},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&ae.check.disabled()})}}},observeChanges:function(){"MutationObserver"in T&&(e=new MutationObserver(ae.event.class.mutation),ae.debug("Setting up mutation observer",e),ae.observe.class())},disconnect:{classObserver:function(){l.length&&e&&e.disconnect()}},observe:{class:function(){l.length&&e&&e.observe(o[0],{attributes:!0})}},is:{disabled:function(){return o.hasClass(Q.disabled)}},check:{disabled:function(){l.attr("tabindex",ae.is.disabled()?-1:0)}},get:{weekOfYear:function(e,t,a){return t=Date.UTC(e,t,a+3)/864e5,a=Math.floor(t/7),t=new Date(6048e5*a).getUTCFullYear(),a-Math.floor(Date.UTC(t,0,7)/6048e5)+1},date:function(){return ae.helper.sanitiseDate(o.data(X.date))||null},inputDate:function(){return l.val()},focusDate:function(){return o.data(X.focusDate)||null},startDate:function(){var e=ae.get.calendarModule($.startCalendar);return(e?e.get.date():o.data(X.startDate))||null},endDate:function(){var e=ae.get.calendarModule($.endCalendar);return(e?e.get.date():o.data(X.endDate))||null},minDate:function(){return o.data(X.minDate)||null},maxDate:function(){return o.data(X.maxDate)||null},monthOffset:function(){return o.data(X.monthOffset)||0},mode:function(){var e=o.data(X.mode)||$.startMode;return ae.get.validatedMode(e)},validatedMode:function(e){var t=ae.get.validModes();return 0<=re.inArray(e,t)?e:"time"===$.type?"hour":"month"===$.type?"month":"year"===$.type?"year":"day"},type:function(){return o.data(X.type)||$.type},validModes:function(){var e=[];return"time"!==$.type&&($.disableYear&&"year"!==$.type||e.push("year"),($.disableMonth||"year"===$.type)&&"month"!==$.type||e.push("month"),0<=$.type.indexOf("date")&&e.push("day")),0<=$.type.indexOf("time")&&(e.push("hour"),$.disableMinute||e.push("minute")),e},isTouch:function(){try{return k.createEvent("TouchEvent"),!0}catch(e){return!1}},calendarModule:function(e){return e?(e=!(e instanceof re)?re(e).first():e).data(i):null}},set:{date:function(e,t,a){t=!1!==t,a=!1!==a,e=ae.helper.sanitiseDate(e),e=ae.helper.dateInRange(e);var n=ae.get.mode(),r=Z.datetime(e,$);if(a&&!1===$.onBeforeChange.call(u,e,r,n))return!1;if(ae.set.focusDate(e),$.isDisabled(e,n))return!1;var i=ae.get.endDate();i&&e&&i=e?ae.verbose("Unable to set maxDate variable lower that minDate variable",e,$.minDate):(ae.setting("maxDate",e),ae.set.dataKeyValue(X.maxDate,e))},monthOffset:function(e,t){var a=Math.max($.multiMonth,1);e=Math.max(1-a,Math.min(0,e)),ae.set.dataKeyValue(X.monthOffset,e,t)},mode:function(e,t){ae.set.dataKeyValue(X.mode,e,t)},dataKeyValue:function(e,t,a){var n=o.data(e),n=n===t||n<=t&&t<=n;return t?o.data(e,t):o.removeData(e),(a=!1!==a&&!n)&&ae.refresh(),!n}},selectDate:function(e,t){ae.verbose("New date selection",e);var a,n=ae.get.mode();t||"minute"===n||$.disableMinute&&"hour"===n||"date"===$.type&&"day"===n||"month"===$.type&&"month"===n||"year"===$.type&&"year"===n?!1===ae.set.date(e)||(h=!0,$.closable&&(ae.popup("hide"),(a=ae.get.calendarModule($.endCalendar))&&("focus"!==a.setting("on")&&a.popup("show"),a.focus()))):(a="year"===n?$.disableMonth?"day":"month":"month"===n?"day":"day"===n?"hour":"minute",ae.set.mode(a),"hour"===n||"day"===n&&ae.get.date()?ae.set.date(e,!0,!1):ae.set.focusDate(e))},changeDate:function(e){ae.set.date(e)},clear:function(){ae.set.date(ie)},popup:function(){return d.popup.apply(d,arguments)},focus:function(){(l.length?l:ee).focus()},blur:function(){(l.length?l:ee).blur()},helper:{isDisabled:function(a,n){return("day"===n||"month"===n||"year"===n)&&("day"===n&&-1!==$.disabledDaysOfWeek.indexOf(a.getDay())||$.disabledDates.some(function(e){if((e="string"==typeof e?ae.helper.sanitiseDate(e):e)instanceof Date)return ae.helper.dateEqual(a,e,n);if(null!==e&&"object"==typeof e){if(e[X.year])return"number"==typeof e[X.year]?a.getFullYear()==e[X.year]:Array.isArray(e[X.year])?-1=t.centuryBreak&&a===D.length-1){n<=99&&(n+=t.currentCentury-100),f=n,D.splice(a,1);break}if(p<0)for(a=0;a").addClass(Q.popup)[e](t)),_.addClass(Q.calendar),ae&&_.addClass(Q.inverted),e=function(){return ee.refreshTooltips(),$.onVisible.apply(_,arguments)},t=$.onHidden,i.length||(_.attr("tabindex","0"),e=function(){return ee.refreshTooltips(),ee.focus(),$.onVisible.apply(_,arguments)},t=function(){return ee.blur(),$.onHidden.apply(_,arguments)}),a=ee.setting("on"),a=re.extend({},$.popupOptions,{popup:_,on:a,hoverable:"hover"===a,closable:"click"===a,onShow:function(){return ee.set.focusDate(ee.get.date()),ee.set.mode(ee.get.validatedMode($.startMode)),$.onShow.apply(_,arguments)},onVisible:e,onHide:$.onHide,onHidden:t}),ee.popup(a)):ee.error(l.popup))},inline:function(){u.length&&!$.inline||($.inline=!0,_=re("
").addClass(Q.calendar).appendTo(r),i.length||_.attr("tabindex","0"))},input:function(){$.touchReadonly&&i.length&&c&&i.prop("readonly",!0),ee.check.disabled()},date:function(){var e;$.initialDate?e=o.date($.initialDate,$):r.data(X.date)!==oe?e=o.date(r.data(X.date),$):i.length&&(e=o.date(i.val(),$)),ee.set.date(e,$.formatInput,!1),ee.set.mode(ee.get.mode(),!1)}},trigger:{change:function(){var e,t=i[0];t&&(e=k.createEvent("HTMLEvents"),ee.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},create:{calendar:function(){var u,c,p,e=ee.get.mode(),f=new Date,m=ee.get.date(),h=ee.get.focusDate(),g=ee.helper.dateInRange(h||m||$.initialDate||f),t=(h||ee.set.focusDate(h=g,!1,!1),"year"===e),D="month"===e,a="day"===e,y="hour"===e,v="minute"===e,b="time"===$.type,C=Math.max($.multiMonth,1),w=a?ee.get.monthOffset():0,M=g.getMinutes(),x=g.getHours(),T=g.getDate(),k=g.getMonth()+w,n=g.getFullYear(),O=a?$.showWeekNumbers?8:7:y?4:te.column,F=a||y?6:te.row,N=a?C:1,A=(E=_).hasClass("left")?"right center":"left center";for(E.empty(),1").addClass(Q.grid).appendTo(E)),c=0;c").addClass(Q.column).appendTo(p));var E,r=k+c,H=(new Date(n,r,1).getDay()-$.firstDayOfWeek%7+7)%7,Y=(!$.constantHeight&&a&&(Y=new Date(n,r+1,0).getDate()+H,F=Math.ceil(Y/7)),t?10:D?1:0),I=a?1:0,j=y||v?1:0,S=y||v?T:1,q=new Date(n-Y,r-I,S-j,x),I=new Date(n+Y,r+I,S+j,x),S=t?new Date(10*Math.ceil(n/10)-9,0,0):D?new Date(n,0,0):a?new Date(n,r,0):new Date(n,r,T,-1),j=t?new Date(10*Math.ceil(n/10)+1,0,1):D?new Date(n+1,0,1):a?new Date(n,r+1,1):new Date(n,r,T+1),W=e,W=(a&&$.showWeekNumbers&&(W+=" andweek"),re("").addClass(Q.table).addClass(W).addClass(ne[O]+" column").appendTo(E)),R=(ae&&W.addClass(Q.inverted),O);if(!b){var V=re("").appendTo(W),G=re("").appendTo(V),o=re("").appendTo(V),$.showWeekNumbers&&((o=re("").appendTo(W),i=t?10*Math.ceil(n/10)-9:a?1-H:0,U=0;U").appendTo(K),a&&$.showWeekNumbers&&((o=re("").appendTo(K),(S=re("
").attr("colspan",""+O).appendTo(G),P=t||D?new Date(n,0,1):a?new Date(n,r,1):new Date(n,r,T,x,M),B=re("").addClass(Q.link).appendTo(o),P=(B.text(Z.header(P,e,$)),D?$.disableYear?"day":"year":a?$.disableMonth?"year":"month":"day");if(B.data(X.mode,P),0===c&&((B=re("").addClass(Q.prev).appendTo(o)).data(X.focusDate,q),B.toggleClass(Q.disabledCell,!ee.helper.isDateInRange(S,e)),re("").addClass(Q.prevIcon).appendTo(B)),c===N-1&&((P=re("").addClass(Q.next).appendTo(o)).data(X.focusDate,I),P.toggleClass(Q.disabledCell,!ee.helper.isDateInRange(j,e)),re("").addClass(Q.nextIcon).appendTo(P)),a)for(G=re("
").appendTo(G)).text($.text.weekNo),o.addClass(Q.weekCell),R--),i=0;i").appendTo(G)).text(Z.dayColumnHeader((i+$.firstDayOfWeek)%7,$))}for(var K=re("
").appendTo(G)).text(ee.get.weekOfYear(n,r,i+1-$.firstDayOfWeek)),o.addClass(Q.weekCell)),u=0;u").addClass(Q.cell).appendTo(G)).text(J),o.data(X.date,l),a&&l.getMonth()!==(r+12)%12),z=!$.selectAdjacentDays&&J||!ee.helper.isDateInRange(l,e)||$.isDisabled(l,e)||ee.helper.isDisabled(l,e)||!ee.helper.isEnabled(l,e),d=(z?null!==(d=ee.helper.findDayAsObject(l,e,$.disabledDates))&&d[X.message]&&(o.attr("data-tooltip",d[X.message]),o.attr("data-position",d[X.position]||A),(d[X.inverted]||ae&&d[X.inverted]===oe)&&o.attr("data-inverted",""),d[X.variation]&&o.attr("data-variation",d[X.variation])):null!==(s=ee.helper.findDayAsObject(l,e,$.eventDates))&&(o.addClass(s[X.class]||$.eventClass),s[X.message]&&(o.attr("data-tooltip",s[X.message]),o.attr("data-position",s[X.position]||A),(s[X.inverted]||ae&&s[X.inverted]===oe)&&o.attr("data-inverted",""),s[X.variation]&&o.attr("data-variation",s[X.variation]))),ee.helper.dateEqual(l,m,e)),L=ee.helper.dateEqual(l,f,e),J=(o.toggleClass(Q.adjacentCell,J&&!s),o.toggleClass(Q.disabledCell,z),o.toggleClass(Q.activeCell,d&&!(J&&z)),y||v||o.toggleClass(Q.todayCell,!J&&L),{mode:e,adjacent:J,disabled:z,active:d,today:L});Z.cell(o,l,J),ee.helper.dateEqual(l,h,e)&&ee.set.focusDate(l,!1,!1)}$.today&&(q=re("
").attr("colspan",""+O).addClass(Q.today).appendTo(q)).text(Z.today($)),S.data(X.date,f)),ee.update.focus(!1,W),$.inline&&ee.refreshTooltips()}}},update:{focus:function(e,t){t=t||_;var i=ee.get.mode(),a=ee.get.date(),s=ee.get.focusDate(),l=ee.get.startDate(),d=ee.get.endDate(),u=(e?s:null)||a||(c?null:s);t.find("td").each(function(){var e,t,a,n,r=re(this),o=r.data(X.date);o&&(e=r.hasClass(Q.disabledCell),t=r.hasClass(Q.activeCell),a=r.hasClass(Q.adjacentCell),n=ee.helper.dateEqual(o,s,i),o=!!u&&(!!l&&ee.helper.isDateInRange(o,i,l,u)||!!d&&ee.helper.isDateInRange(o,i,u,d)),r.toggleClass(Q.focusCell,n&&(!c||f)&&(!a||$.selectAdjacentDays&&a)&&!e),ee.helper.isTodayButton(r)||r.toggleClass(Q.rangeCell,o&&!t&&!e))})}},refresh:function(){ee.create.calendar()},refreshTooltips:function(){var n=re(T).width();_.find("td[data-position]").each(function(){var e=re(this),t=T.getComputedStyle(e[0],":after").width.replace(/[^0-9\.]/g,""),a=e.attr("data-position"),t=n-e.width()-(parseInt(t,10)||250)>e.offset().left?"right":"left";-1===a.indexOf(t)&&e.attr("data-position",a.replace(/(left|right)/,t))})},bind:{events:function(){ee.debug("Binding events"),_.on("mousedown"+e,ee.event.mousedown),_.on("touchstart"+e,ee.event.mousedown),_.on("mouseup"+e,ee.event.mouseup),_.on("touchend"+e,ee.event.mouseup),_.on("mouseover"+e,ee.event.mouseover),i.length?(i.on("input"+e,ee.event.inputChange),i.on("focus"+e,ee.event.inputFocus),i.on("blur"+e,ee.event.inputBlur),i.on("keydown"+e,ee.event.keydown)):_.on("keydown"+e,ee.event.keydown)}},unbind:{events:function(){ee.debug("Unbinding events"),_.off(e),i.length&&i.off(e)}},event:{mouseover:function(e){var t=re(e.target).data(X.date),e=1===e.buttons;t&&ee.set.focusDate(t,!1,!0,e)},mousedown:function(e){i.length&&e.preventDefault(),f=0<=e.type.indexOf("touch");e=re(e.target).data(X.date);e&&ee.set.focusDate(e,!1,!0,!0)},mouseup:function(e){ee.focus(),e.preventDefault(),e.stopPropagation(),f=!1;var t,a,n,e=re(e.target);e.hasClass("disabled")||(t=(e=(t=e.parent()).data(X.date)||t.data(X.focusDate)||t.data(X.mode)?t:e).data(X.date),a=e.data(X.focusDate),n=e.data(X.mode),t&&!1!==$.onSelect.call(s,t,ee.get.mode())?(e=e.hasClass(Q.today),ee.selectDate(t,e)):a?ee.set.focusDate(a):n&&ee.set.mode(n))},keydown:function(e){var t,a,n,r,o,i,s,l=e.which;27!==l&&9!==l||ee.popup("hide"),ee.popup("is visible")&&(37===l||38===l||39===l||40===l?(r="day"===(i=ee.get.mode())?7:"hour"===i?4:"minute"===i?te.column:3,r=37===l?-1:38===l?-r:39==l?1:r,r*="minute"===i?$.minTimeGap:1,o=(t=ee.get.focusDate()||ee.get.date()||new Date).getFullYear()+("year"===i?r:0),s=t.getMonth()+("month"===i?r:0),a=t.getDate()+("day"===i?r:0),n=t.getHours()+("hour"===i?r:0),r=t.getMinutes()+("minute"===i?r:0),o=new Date(o,s,a,n,r),"time"===$.type&&(o=ee.helper.mergeDateTime(t,o)),ee.helper.isDateInRange(o,i)&&ee.set.focusDate(o)):13===l&&(i=ee.get.mode(),(s=ee.get.focusDate())&&!$.isDisabled(s,i)&&!ee.helper.isDisabled(s,i)&&ee.helper.isEnabled(s,i)&&ee.selectDate(s),e.preventDefault(),e.stopPropagation())),38!==l&&40!==l||(e.preventDefault(),ee.popup("show"))},inputChange:function(){var e=i.val(),e=o.date(e,$);ee.set.date(e,!1)},inputFocus:function(){_.addClass(Q.active)},inputBlur:function(){var e;_.removeClass(Q.active),$.formatInput&&(e=ee.get.date(),e=Z.datetime(e,$),i.val(e)),h&&(ee.trigger.change(),h=!1)},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&ee.check.disabled()})}}},observeChanges:function(){"MutationObserver"in T&&(t=new MutationObserver(ee.event.class.mutation),ee.debug("Setting up mutation observer",t),ee.observe.class())},disconnect:{classObserver:function(){i.length&&t&&t.disconnect()}},observe:{class:function(){i.length&&t&&t.observe(r[0],{attributes:!0})}},is:{disabled:function(){return r.hasClass(Q.disabled)}},check:{disabled:function(){i.attr("tabindex",ee.is.disabled()?-1:0)}},get:{weekOfYear:function(e,t,a){return e=Date.UTC(e,t,a+3)/864e5,e=Math.floor(e/7),t=new Date(6048e5*e).getUTCFullYear(),e-Math.floor(Date.UTC(t,0,7)/6048e5)+1},date:function(){return ee.helper.sanitiseDate(r.data(X.date))||null},inputDate:function(){return i.val()},focusDate:function(){return r.data(X.focusDate)||null},startDate:function(){var e=ee.get.calendarModule($.startCalendar);return(e?e.get.date():r.data(X.startDate))||null},endDate:function(){var e=ee.get.calendarModule($.endCalendar);return(e?e.get.date():r.data(X.endDate))||null},minDate:function(){return r.data(X.minDate)||null},maxDate:function(){return r.data(X.maxDate)||null},monthOffset:function(){return r.data(X.monthOffset)||0},mode:function(){var e=r.data(X.mode)||$.startMode;return ee.get.validatedMode(e)},validatedMode:function(e){var t=ee.get.validModes();return 0<=re.inArray(e,t)?e:"time"===$.type?"hour":"month"===$.type?"month":"year"===$.type?"year":"day"},type:function(){return r.data(X.type)||$.type},validModes:function(){var e=[];return"time"!==$.type&&($.disableYear&&"year"!==$.type||e.push("year"),($.disableMonth||"year"===$.type)&&"month"!==$.type||e.push("month"),0<=$.type.indexOf("date")&&e.push("day")),0<=$.type.indexOf("time")&&(e.push("hour"),$.disableMinute||e.push("minute")),e},isTouch:function(){try{return k.createEvent("TouchEvent"),!0}catch(e){return!1}},calendarModule:function(e){return e?(e=e instanceof re?e:re(e).first()).data(d):null}},set:{date:function(e,t,a){t=!1!==t,a=!1!==a,e=ee.helper.sanitiseDate(e),e=ee.helper.dateInRange(e);var n=ee.get.mode(),r=Z.datetime(e,$);if(a&&!1===$.onBeforeChange.call(s,e,r,n))return!1;if(ee.set.focusDate(e),$.isDisabled(e,n))return!1;var o=ee.get.endDate();o&&e&&o=e?ee.verbose("Unable to set maxDate variable lower that minDate variable",e,$.minDate):(ee.setting("maxDate",e),ee.set.dataKeyValue(X.maxDate,e))},monthOffset:function(e,t){var a=Math.max($.multiMonth,1);e=Math.max(1-a,Math.min(0,e)),ee.set.dataKeyValue(X.monthOffset,e,t)},mode:function(e,t){ee.set.dataKeyValue(X.mode,e,t)},dataKeyValue:function(e,t,a){var n=r.data(e),n=n===t||n<=t&&t<=n;return t?r.data(e,t):r.removeData(e),(a=!1!==a&&!n)&&ee.refresh(),!n}},selectDate:function(e,t){ee.verbose("New date selection",e);var a=ee.get.mode();t||"minute"===a||$.disableMinute&&"hour"===a||"date"===$.type&&"day"===a||"month"===$.type&&"month"===a||"year"===$.type&&"year"===a?!1===ee.set.date(e)||(h=!0,$.closable&&(ee.popup("hide"),(t=ee.get.calendarModule($.endCalendar))&&("focus"!==t.setting("on")&&t.popup("show"),t.focus()))):(t="year"===a?$.disableMonth?"day":"month":"month"===a?"day":"day"===a?"hour":"minute",ee.set.mode(t),"hour"===a||"day"===a&&ee.get.date()?ee.set.date(e,!0,!1):ee.set.focusDate(e))},changeDate:function(e){ee.set.date(e)},clear:function(){ee.set.date(oe)},popup:function(){return u.popup.apply(u,arguments)},focus:function(){(i.length?i:_).focus()},blur:function(){(i.length?i:_).blur()},helper:{isDisabled:function(a,n){return("day"===n||"month"===n||"year"===n)&&("day"===n&&-1!==$.disabledDaysOfWeek.indexOf(a.getDay())||$.disabledDates.some(function(e){return(e="string"==typeof e?ee.helper.sanitiseDate(e):e)instanceof Date?ee.helper.dateEqual(a,e,n):null!==e&&"object"==typeof e?e[X.year]?"number"==typeof e[X.year]?a.getFullYear()==e[X.year]:Array.isArray(e[X.year])?-1=t.centuryBreak&&a===d.length-1){n<=99&&(n+=t.currentCentury-100),l=n,d.splice(a,1);break}if(s<0)for(a=0;a adjusting invoked element"),p=p.closest(g.checkbox),v.refresh())}},setup:function(){v.set.initialLoad(),v.is.indeterminate()?(v.debug("Initial value is indeterminate"),v.indeterminate()):v.is.checked()?(v.debug("Initial value is checked"),v.check()):(v.debug("Initial value is unchecked"),v.uncheck()),v.remove.initialLoad()},refresh:function(){a=p.children(g.label),f=p.children(g.input),k=f[0]},hide:{input:function(){v.verbose("Modifying z-index to be unselectable"),f.addClass(n.hidden)}},show:{input:function(){v.verbose("Modifying z-index to be selectable"),f.removeClass(n.hidden)}},observeChanges:function(){"MutationObserver"in E&&((e=new MutationObserver(function(e){v.debug("DOM tree modified, updating selector cache"),v.refresh()})).observe(d,{childList:!0,subtree:!0}),v.debug("Setting up mutation observer",e))},attachEvents:function(e,n){var t=I(e);n=I.isFunction(v[n])?v[n]:v.toggle,0").insertAfter(f),v.debug("Creating label",a))}},has:{label:function(){return 0 adjusting invoked element"),p=p.closest(g.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(){e=p.children(g.label),f=p.children(g.input),k=f[0]},hide:{input:function(){m.verbose("Modifying z-index to be unselectable"),f.addClass(n.hidden)}},show:{input:function(){m.verbose("Modifying z-index to be selectable"),f.removeClass(n.hidden)}},observeChanges:function(){"MutationObserver"in E&&((t=new MutationObserver(function(e){m.debug("DOM tree modified, updating selector cache"),m.refresh()})).observe(d,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",t))},attachEvents:function(e,n){var t=I(e);n=I.isFunction(m[n])?m[n]:m.toggle,0").insertAfter(f),m.debug("Creating label",e))}},has:{label:function(){return 0 .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(e){var i,n=T("
").addClass("ui dimmer");return e.displayLoader&&(i=T("
").addClass(e.className.loader).addClass(e.loaderVariation),e.loaderText&&(i.text(e.loaderText),i.addClass("text")),n.append(i)),n}}}}(jQuery,window,document); \ No newline at end of file +!function(T,e,F,D){"use strict";T.isFunction=T.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),T.fn.dimmer=function(p){var h,b=T(this),v=(new Date).getTime(),y=[],C=p,w="string"==typeof C,x=[].slice.call(arguments,1);return b.each(function(){var o,i,a=T.isPlainObject(p)?T.extend(!0,{},T.fn.dimmer.settings,p):T.extend({},T.fn.dimmer.settings),n=a.selector,c=a.namespace,e=a.className,l=a.error,t="."+c,u="module-"+c,f=b.selector||"",g="ontouchstart"in F.documentElement?"touchstart":"click",r=T(this),s=this,d=r.data(u),m={preinitialize:function(){o=m.is.dimmer()?(i=r.parent(),r):(i=r,m.has.dimmer()?a.dimmerName?i.find(n.dimmer).filter("."+a.dimmerName):i.find(n.dimmer):m.create())},initialize:function(){m.debug("Initializing dimmer",a),m.bind.events(),m.set.dimmable(),m.instantiate()},instantiate:function(){m.verbose("Storing instance of module",m),d=m,r.data(u,d)},destroy:function(){m.verbose("Destroying previous module",o),m.unbind.events(),m.remove.variation(),i.off(t)},bind:{events:function(){"hover"==a.on?i.on("mouseenter"+t,m.show).on("mouseleave"+t,m.hide):"click"==a.on&&i.on(g+t,m.toggle),m.is.page()&&(m.debug("Setting as a page dimmer",i),m.set.pageDimmer()),m.is.closable()&&(m.verbose("Adding dimmer close event",o),i.on(g+t,n.dimmer,m.event.click))}},unbind:{events:function(){r.removeData(u),i.off(t)}},event:{click:function(e){m.verbose("Determining if event occurred on dimmer",e),0!==o.find(e.target).length&&!T(e.target).is(n.content)||(m.hide(),e.stopImmediatePropagation())}},addContent:function(e){e=T(e);m.debug("Add content to dimmer",e),e.parent()[0]!==o[0]&&e.detach().appendTo(o)},create:function(){var e=T(a.template.dimmer(a));return a.dimmerName&&(m.debug("Creating named dimmer",a.dimmerName),e.addClass(a.dimmerName)),e.appendTo(i),e},show:function(e){e=T.isFunction(e)?e:function(){},m.debug("Showing dimmer",o,a),m.set.variation(),m.is.dimmed()&&!m.is.animating()||!m.is.enabled()?m.debug("Dimmer is already shown or disabled"):(m.animate.show(e),a.onShow.call(s),a.onChange.call(s))},hide:function(e){e=T.isFunction(e)?e:function(){},m.is.dimmed()||m.is.animating()?(m.debug("Hiding dimmer",o),m.animate.hide(e),a.onHide.call(s),a.onChange.call(s)):m.debug("Dimmer is not visible")},toggle:function(){m.verbose("Toggling dimmer visibility",o),m.is.dimmed()?m.is.closable()&&m.hide():m.show()},animate:{show:function(e){e=T.isFunction(e)?e:function(){},a.useCSS&&T.fn.transition!==D&&o.transition("is supported")?(a.useFlex?(m.debug("Using flex dimmer"),m.remove.legacy()):(m.debug("Using legacy non-flex dimmer"),m.set.legacy()),"auto"!==a.opacity&&m.set.opacity(),o.transition({displayType:a.useFlex?"flex":"block",animation:(a.transition.showMethod||a.transition)+" in",queue:!1,duration:m.get.duration(),useFailSafe:!0,onStart:function(){m.set.dimmed()},onComplete:function(){m.set.active(),e()}})):(m.verbose("Showing dimmer animation with javascript"),m.set.dimmed(),"auto"==a.opacity&&(a.opacity=.8),o.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(m.get.duration(),a.opacity,function(){o.removeAttr("style"),m.set.active(),e()}))},hide:function(e){e=T.isFunction(e)?e:function(){},a.useCSS&&T.fn.transition!==D&&o.transition("is supported")?(m.verbose("Hiding dimmer with css"),o.transition({displayType:a.useFlex?"flex":"block",animation:(a.transition.hideMethod||a.transition)+" out",queue:!1,duration:m.get.duration(),useFailSafe:!0,onComplete:function(){m.remove.dimmed(),m.remove.variation(),m.remove.active(),e()}})):(m.verbose("Hiding dimmer with javascript"),o.stop().fadeOut(m.get.duration(),function(){m.remove.dimmed(),m.remove.active(),o.removeAttr("style"),e()}))}},get:{dimmer:function(){return o},duration:function(){return m.is.active()?a.transition.hideDuration||a.duration.hide||a.duration:a.transition.showDuration||a.duration.show||a.duration}},has:{dimmer:function(){return a.dimmerName?0 .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(e){var i,n=T("
").addClass("ui dimmer");return e.displayLoader&&(i=T("
").addClass(e.className.loader).addClass(e.loaderVariation),e.loaderText&&(i.text(e.loaderText),i.addClass("text")),n.append(i)),n}}}}(jQuery,window,document); \ No newline at end of file diff --git a/semantic/dist/components/dropdown.min.js b/semantic/dist/components/dropdown.min.js index feaff46f..40613225 100644 --- a/semantic/dist/components/dropdown.min.js +++ b/semantic/dist/components/dropdown.min.js @@ -8,4 +8,4 @@ * http://opensource.org/licenses/MIT * */ -!function(te,ne,ie,ae){"use strict";te.isFunction=te.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},ne=void 0!==ne&&ne.Math==Math?ne:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),te.fn.dropdown=function(B){var K,W=te(this),Q=te(ie),Y=W.selector||"",$="ontouchstart"in ie.documentElement,X=$?"touchstart":"click",G=(new Date).getTime(),J=[],Z=B,_="string"==typeof Z,ee=[].slice.call(arguments,1);return W.each(function(n){var d,e,t,i,a,s,o,r,l,v=te.isPlainObject(B)?te.extend(!0,{},te.fn.dropdown.settings,B):te.extend({},te.fn.dropdown.settings),m=v.className,h=v.message,c=v.fields,f=v.keys,g=v.metadata,u=v.namespace,p=v.regExp,b=v.selector,w=v.error,C=v.templates,y="."+u,x="module-"+u,S=te(this),A=te(v.context),T=S.find(b.text),L=S.find(b.search),I=S.find(b.sizer),D=S.find(b.input),k=S.find(b.icon),O=S.find(b.clearIcon),q=0").html(i).attr("data-"+g.value,t).attr("data-"+g.text,t).addClass(m.addition).addClass(m.item),v.hideAdditions&&i.addClass(m.hidden),n=n===ae?i:n.add(i),U.verbose("Creating user choices for value",t,i))}),n)},userLabels:function(e){var t=U.get.userValues();t&&(U.debug("Adding user labels",t),te.each(t,function(e,t){U.verbose("Adding custom user value"),U.add.label(t,t)}))},menu:function(){R=te("
").addClass(m.menu).appendTo(S)},sizer:function(){I=te("").addClass(m.sizer).insertAfter(L)}},search:function(e){e=e!==ae?e:U.get.query(),U.verbose("Searching for query",e),!1===v.fireOnInit&&U.is.initialLoad()?U.verbose("Skipping callback on initial load",v.onSearch):U.has.minCharacters(e)&&!1!==v.onSearch.call(N,e)?U.filter(e):U.hide(null,!0)},select:{firstUnfiltered:function(){U.verbose("Selecting first non-filtered element"),U.remove.selectedItem(),V.not(b.unselectable).not(b.addition+b.hidden).eq(0).addClass(m.selected)},nextAvailable:function(e){var t=(e=e.eq(0)).nextAll(b.item).not(b.unselectable).eq(0),e=e.prevAll(b.item).not(b.unselectable).eq(0);0").addClass("remove icon").insertBefore(T)),U.is.search()&&!U.has.search()&&(U.verbose("Adding search input"),L=te("").addClass(m.search).prop("autocomplete",U.is.chrome()?"fomantic-search":"off").insertBefore(T)),U.is.multiple()&&U.is.searchSelection()&&!U.has.sizer()&&U.create.sizer(),v.allowTab&&U.set.tabbable()},select:function(){var e=U.get.selectValues();U.debug("Dropdown initialized on a select",e),0<(D=S.is("select")?S:D).parent(b.dropdown).length?(U.debug("UI dropdown already exists. Creating dropdown menu only"),S=D.closest(b.dropdown),U.has.menu()||U.create.menu(),R=S.children(b.menu),U.setup.menu(e)):(U.debug("Creating entire dropdown from select"),S=te("
").attr("class",D.attr("class")).addClass(m.selection).addClass(m.dropdown).html(C.dropdown(e,c,v.preserveHTML,v.className)).insertBefore(D),D.hasClass(m.multiple)&&!1===D.prop("multiple")&&(U.error(w.missingMultiple),D.prop("multiple",!0)),D.is("[multiple]")&&U.set.multiple(),D.prop("disabled")&&(U.debug("Disabling dropdown"),S.addClass(m.disabled)),D.removeAttr("required").removeAttr("class").detach().prependTo(S)),U.refresh()},menu:function(e){R.html(C.menu(e,c,v.preserveHTML,v.className)),V=R.find(b.item),E=v.hideDividers?V.parent().children(b.divider):te()},reference:function(){U.debug("Dropdown behavior was called on select, replacing with closest dropdown"),S=S.parent(b.dropdown),j=S.data(x),N=S.get(0),U.refresh(),U.setup.returnedObject()},returnedObject:function(){var e=W.slice(0,n),t=W.slice(n+1);W=e.add(S).add(t)}},refresh:function(){U.refreshSelectors(),U.refreshData()},refreshItems:function(){V=R.find(b.item),E=v.hideDividers?V.parent().children(b.divider):te()},refreshSelectors:function(){U.verbose("Refreshing selector cache"),T=S.find(b.text),L=S.find(b.search),D=S.find(b.input),k=S.find(b.icon),q=0"),te.each(e,function(e,t){var n=v.templates.deQuote(t[c.value]),t=v.templates.escape(t[c.name]||"",v.preserveHTML);D.append('")}),U.observe.select())}},event:{change:function(){F||(U.debug("Input changed, updating selection"),U.set.selected())},focus:function(){v.showOnFocus&&!M&&U.is.hidden()&&!t&&(H=!0,U.show())},blur:function(e){t=ie.activeElement===this,M||t||(U.remove.activeLabel(),U.hide())},mousedown:function(){U.is.searchSelection()?i=!0:M=!0},mouseup:function(){U.is.searchSelection()?i=!1:M=!1},click:function(e){te(e.target).is(S)&&(U.is.focusedOnSearch()?U.show():U.focusSearch())},search:{focus:function(e){M=!0,U.is.multiple()&&U.remove.activeLabel(),H||U.is.active()||!(v.showOnFocus||"focus"!==e.type&&"focusin"!==e.type)||(H=!0,U.search())},blur:function(e){t=ie.activeElement===this,U.is.searchSelection()&&!i&&(z||t||(v.forceSelection?U.forceSelection():v.allowAdditions||U.remove.searchTerm(),U.hide())),i=!1}},clearIcon:{click:function(e){U.clear(),U.is.searchSelection()&&U.remove.searchTerm(),U.hide(),e.stopPropagation()}},icon:{click:function(e){P=!0,U.has.search()?U.is.active()?U.blurSearch():v.showOnFocus?U.focusSearch():U.toggle():U.toggle(),e.stopPropagation()}},text:{focus:function(e){M=!0,U.focusSearch()}},input:function(e){(U.is.multiple()||U.is.searchSelection())&&U.set.filtered(),clearTimeout(U.timer),U.timer=setTimeout(U.search,v.delay.search)},label:{click:function(e){var t=te(this),n=S.find(b.label),i=n.filter("."+m.active),a=t.nextAll("."+m.active),s=t.prevAll("."+m.active),s=(0 modified, recreating menu"),U.is.selectMutation(e)&&(U.disconnect.selectObserver(),U.refresh(),U.setup.select(),U.set.selected(),U.observe.select())}},menu:{mutation:function(e){var t=e[0],e=t.addedNodes?te(t.addedNodes[0]):te(!1),t=t.removedNodes?te(t.removedNodes[0]):te(!1),e=e.add(t),t=e.is(b.addition)||0=v.maxSelections?(U.debug("Maximum selection count reached"),v.useLabels&&(V.addClass(m.filtered),U.add.message(h.maxSelections)),!0):(U.verbose("No longer at maximum selection count"),U.remove.message(),U.remove.filteredItem(),U.is.searchSelection()&&U.filterItems(),!1))},disabled:function(){L.attr("tabindex",U.is.disabled()?-1:0)}},restore:{defaults:function(e){U.clear(e),U.restore.defaultText(),U.restore.defaultValue()},defaultText:function(){var e=U.get.defaultText();e===U.get.placeholderText?(U.debug("Restoring default placeholder text",e),U.set.placeholderText(e)):(U.debug("Restoring default text",e),U.set.text(e))},placeholderText:function(){U.set.placeholderText()},defaultValue:function(){var e=U.get.defaultValue();e!==ae&&(U.debug("Restoring default value",e),""!==e?(U.set.value(e),U.set.selected()):(U.remove.activeItem(),U.remove.selectedItem()))},labels:function(){v.allowAdditions&&(v.useLabels||(U.error(w.labels),v.useLabels=!0),U.debug("Restoring selected values"),U.create.userLabels()),U.check.maxSelections()},selected:function(){U.restore.values(),U.is.multiple()?(U.debug("Restoring previously selected values and labels"),U.restore.labels()):U.debug("Restoring previously selected values")},values:function(){U.set.initialLoad(),v.apiSettings&&v.saveRemoteData&&U.get.remoteValues()?U.restore.remoteValues():U.set.selected();var e=U.get.value();!e||""===e||Array.isArray(e)&&0===e.length?D.addClass(m.noselection):D.removeClass(m.noselection),U.remove.initialLoad()},remoteValues:function(){var e=U.get.remoteValues();U.debug("Recreating selected from session data",e),e&&(U.is.single()?te.each(e,function(e,t){U.set.text(t)}):te.each(e,function(e,t){U.add.label(e,t)}))}},read:{remoteData:function(e){if(ne.Storage!==ae)return(e=sessionStorage.getItem(e))!==ae&&e;U.error(w.noStorage)}},save:{defaults:function(){U.save.defaultText(),U.save.placeholderText(),U.save.defaultValue()},defaultValue:function(){var e=U.get.value();U.verbose("Saving default value as",e),S.data(g.defaultValue,e)},defaultText:function(){var e=U.get.text();U.verbose("Saving default text as",e),S.data(g.defaultText,e)},placeholderText:function(){var e;!1!==v.placeholder&&T.hasClass(m.placeholder)&&(e=U.get.text(),U.verbose("Saving placeholder text as",e),S.data(g.placeholderText,e))},remoteData:function(e,t){ne.Storage!==ae?(U.verbose("Saving remote data to session storage",t,e),sessionStorage.setItem(t,e)):U.error(w.noStorage)}},clear:function(e){U.is.multiple()&&v.useLabels?U.remove.labels(S.find(b.label),e):(U.remove.activeItem(),U.remove.selectedItem(),U.remove.filteredItem()),U.set.placeholderText(),U.clearValue(e)},clearValue:function(e){U.set.value("",null,null,e)},scrollPage:function(e,t){var n=t||U.get.selectedItem(),i=n.closest(b.menu),a=i.outerHeight(),s=i.scrollTop(),t=V.eq(0).outerHeight(),a=Math.floor(a/t),s=(i.prop("scrollHeight"),"up"==e?s-t*a:s+t*a),t=V.not(b.unselectable),a="up"==e?t.index(n)-a:t.index(n)+a,t=("up"==e?0<=a:a").addClass(m.label).attr("data-"+g.value,s).html(C.label(s,t,v.preserveHTML,v.className)),i=v.onLabelCreate.call(i,s,t),U.has.label(e)?U.debug("User selection already exists, skipping",s):(v.label.variation&&i.addClass(v.label.variation),!0===n?(U.debug("Animating in label",i),i.addClass(m.hidden).insertBefore(a).transition({animation:v.label.transition,debug:v.debug,verbose:v.verbose,duration:v.label.duration})):(U.debug("Adding selection label",i),i.insertBefore(a)))},message:function(e){var t=R.children(b.message),e=v.templates.message(U.add.variables(e));0").html(e).addClass(m.message).appendTo(R)},optionValue:function(e){var t=U.escape.value(e);0").prop("value",t).addClass(m.addition).html(e).appendTo(D),U.verbose("Adding user addition as an