fomantic-ui 2.9.3-beta.1 → 2.9.3-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.all-contributorsrc +9 -0
- package/CONTRIBUTORS.md +102 -99
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +1 -5
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +14 -8
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +6 -6
- package/dist/components/calendar.js +1 -6
- package/dist/components/calendar.min.css +2 -2
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +1 -5
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +2 -2
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +1 -5
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +1 -1
- package/dist/components/dropdown.js +29 -14
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +1 -6
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +38 -27
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +31 -23
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/menu.css +1 -1
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +38 -26
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +16 -8
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +18 -12
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +1 -6
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +2 -2
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +1 -5
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +1 -5
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +3 -2
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +1 -5
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +2 -2
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +15 -8
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +1 -1
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +1 -1
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +1 -6
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +23 -20
- package/dist/components/state.min.js +2 -2
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +17 -16
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +2 -2
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +14 -6
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +17 -9
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +1 -5
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +15 -6
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +60 -59
- package/dist/semantic.js +298 -244
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/src/definitions/behaviors/api.js +13 -7
- package/src/definitions/behaviors/form.js +30 -22
- package/src/definitions/behaviors/state.js +22 -19
- package/src/definitions/behaviors/visibility.js +14 -5
- package/src/definitions/elements/segment.less +2 -1
- package/src/definitions/modules/accordion.js +0 -4
- package/src/definitions/modules/calendar.js +0 -5
- package/src/definitions/modules/calendar.less +1 -1
- package/src/definitions/modules/checkbox.js +0 -4
- package/src/definitions/modules/dimmer.js +0 -4
- package/src/definitions/modules/dropdown.js +28 -13
- package/src/definitions/modules/embed.js +0 -5
- package/src/definitions/modules/flyout.js +37 -26
- package/src/definitions/modules/modal.js +37 -25
- package/src/definitions/modules/nag.js +15 -7
- package/src/definitions/modules/popup.js +17 -11
- package/src/definitions/modules/progress.js +0 -5
- package/src/definitions/modules/rating.js +0 -4
- package/src/definitions/modules/search.js +0 -4
- package/src/definitions/modules/shape.js +0 -4
- package/src/definitions/modules/sidebar.js +14 -7
- package/src/definitions/modules/slider.js +0 -5
- package/src/definitions/modules/sticky.js +16 -15
- package/src/definitions/modules/tab.js +13 -5
- package/src/definitions/modules/toast.js +16 -8
- package/src/definitions/modules/transition.js +0 -4
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.3-beta.
|
2
|
+
* # Fomantic UI - 2.9.3-beta.3+880333c
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(X,R,U){"use strict";function V(e){return"function"==typeof e&&"number"!=typeof e.nodeType}R=void 0!==R&&R.Math===Math?R:globalThis,X.fn.modal=function(L){var N,e=X(this),I=X(R),j=X(U),z=X("body"),q=e.selector||"",B=Date.now(),W=[],P=L,K="string"==typeof P,Q=[].slice.call(arguments,1);return e.each(function(){var i,o,s,e,n,t,a,r,c,l,d,u=X.isPlainObject(L)?X.extend(!0,{},X.fn.modal.settings,L):X.extend({},X.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,v=u.error,p="."+h,b="module-"+h,y=X(this),x=[R,U].indexOf(u.context)<0?j.find(u.context):z,k=x[0]===z[0],w=y.find(f.closeIcon),C=y.hasClass("modal"),S=this,A=C?y.data(b):void 0,M=!1,D="",T="",H=!1,F=!1,O=!1,E={initialize:function(){var s;E.create.id(),C||(E.create.modal(),V(u.onHidden)||(u.onHidden=function(){E.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(f.title).html(E.helpers.escape(u.title,u.preserveHTML)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(E.helpers.escape(u.content,u.preserveHTML)).addClass(u.classContent),E.has.configActions()&&(0===(s=y.find(f.actions).addClass(u.classActions)).length?s=X("<div/>",{class:m.actions+" "+(u.classActions||"")}).appendTo(y):s.empty(),u.actions.forEach(function(e){var t=e[g.icon]?"<i "+(e[g.text]?'aria-hidden="true"':"")+' class="'+E.helpers.deQuote(e[g.icon])+' icon"></i>':"",i=E.helpers.escape(e[g.text]||"",u.preserveHTML),n=E.helpers.deQuote(e[g.class]||""),o=e[g.click]&&V(e[g.click])?e[g.click]:function(){};s.append(X("<button/>",{html:t+i,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+n,on:{click:function(){var e=X(this);e.is(f.approve)||e.is(f.deny)||!1===o.call(S,y)||E.hide()}}}))})),E.cache={},E.verbose("Initializing dimmer",x),E.create.dimmer(),u.allowMultiple&&E.create.innerDimmer(),u.centered||y.addClass("top aligned"),E.refreshModals(),E.bind.events(),E.observeChanges(),E.instantiate(),u.autoShow&&E.show()},instantiate:function(){E.verbose("Storing instance of modal"),A=E,y.data(b,A)},create:{modal:function(){var e;y=X("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(w=X("<i/>",{class:m.close,role:"button",tabindex:0,"aria-label":u.text.close}),y.append(w)),""!==u.title&&(e="_"+E.get.id()+"title",y.attr("aria-labelledby",e),X("<div/>",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+E.get.id()+"desc",y.attr("aria-describedby",e),X("<div/>",{class:m.content,id:e}).appendTo(y)),E.has.configActions()&&X("<div/>",{class:m.actions}).appendTo(y),x.append(y),S=y[0]},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},e=X.extend(!0,e,u.dimmerSettings);void 0===X.fn.dimmer?E.error(v.dimmer):(E.debug("Creating dimmer"),n=x.dimmer(e),H=E.is.scrolling(),u.detachable?(E.verbose("Modal is detachable, moving content into dimmer"),n.dimmer("add content",y)):E.set.undetached(),t=n.dimmer("get dimmer"))},id:function(){l=(Math.random().toString(16)+"000000000").slice(2,10),c="."+l,E.verbose("Creating unique id for element",l)},innerDimmer:function(){0===y.find(f.dimmer).length&&X("<div/>",{class:m.innerDimmer}).prependTo(y)}},destroy:function(){d&&d.disconnect(),E.verbose("Destroying previous modal"),y.removeData(b).off(p),I.off(c),t.off(c),w.off(c),i&&i.off(c),x.dimmer("destroy")},observeChanges:function(){"MutationObserver"in R&&((d=new MutationObserver(function(e){function o(e){for(var t=[],i=0,n=e.length;i<n;i++)Array.prototype.push.apply(t,o(e[i].childNodes)),t.push(e[i]);return t}var i=!1,n=!1;e.every(function(e){var t;return"attributes"===e.type?O&&("disabled"===e.attributeName||0<X(e.target).find(":input").addBack(":input").length)&&(n=!0):(i=!0,t=X(o(e.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),e=X(o(e.removedNodes)).filter("a[href], [tabindex], :input"),(0<t.length||0<e.length)&&(n=!0)),!n}),i&&u.observeChanges&&(E.debug("DOM tree modified, refreshing"),E.refresh()),n&&E.refreshInputs()})).observe(S,{attributeFilter:["class","disabled"],attributes:!0,childList:!0,subtree:!0}),E.debug("Setting up mutation observer",d))},refresh:function(){E.remove.scrolling(),E.cacheSizes(),E.can.useFlex()||E.set.modalOffset(),E.set.screenHeight(),E.set.type()},refreshModals:function(){s=y.siblings(f.modal),o=s.add(y)},refreshInputs:function(){i&&i.off("keydown"+c),0===(i=y.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===X(this).closest(".disabled").length})).length?(i=y).attr("tabindex",-1):y.removeAttr("tabindex"),i.first().on("keydown"+c,E.event.inputKeyDown.first),i.last().on("keydown"+c,E.event.inputKeyDown.last),u.autofocus&&0===i.filter(":focus").length&&E.set.autofocus()},attachEvents:function(e,t){var i=X(e);t=V(E[t])?E[t]:E.toggle,0<i.length?(E.debug("Attaching modal events to element",e,t),i.off(p).on("click"+p,t)):E.error(v.notFound,e)},bind:{events:function(){E.verbose("Attaching events"),y.on("click"+p,f.close,E.event.close).on("click"+p,f.approve,E.event.approve).on("click"+p,f.deny,E.event.deny),w.on("keyup"+c,E.event.closeKeyUp),I.on("resize"+c,E.event.resize).on("focus"+c,E.event.focus)},scrollLock:function(){n[0].addEventListener("touchmove",E.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){n[0].removeEventListener("touchmove",E.event.preventScroll,{passive:!1})}},get:{id:function(){return l},element:function(){return y},settings:function(){return u}},event:{approve:function(){M||!1===u.onApprove.call(S,X(this))?E.verbose("Approve callback returned false cancelling hide"):(M=!0,E.hide(function(){M=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){M||!1===u.onDeny.call(S,X(this))?E.verbose("Deny callback returned false cancelling hide"):(M=!0,E.hide(function(){M=!1}))},close:function(){E.hide()},closeKeyUp:function(e){e=e.which;e!==u.keys.enter&&e!==u.keys.space||!y.hasClass(m.front)||E.hide()},inputKeyDown:{first:function(e){e.which===u.keys.tab&&e.shiftKey&&(i.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==u.keys.tab||e.shiftKey||(i.first().trigger("focus"),e.preventDefault())}},mousedown:function(e){var t=X(e.target),i=E.is.rtl();(a=0<t.closest(f.modal).length)&&E.verbose("Mouse down event registered inside the modal"),(r=E.is.scrolling()&&(!i&&I.outerWidth()-u.scrollbarWidth<=e.clientX||i&&u.scrollbarWidth>=e.clientX))&&E.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(e){if(u.closable)if(a)E.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(r)E.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{var t=0<X(e.target).closest(f.modal).length,e=X.contains(U.documentElement,e.target);if(!t&&e&&E.is.active()&&y.hasClass(m.front)){if(E.debug("Dimmer clicked, hiding all modals"),u.allowMultiple){if(!E.hideAll())return}else if(!E.hide())return;E.remove.clickaway()}}else E.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(E.timer),E.timer=setTimeout(e,t)},keyboard:function(e){e.which===u.keys.escape&&(u.closable?(E.debug("Escape key pressed hiding modal"),y.hasClass(m.front)&&E.hide()):E.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){n.dimmer("is active")&&(E.is.animating()||E.is.active())&&requestAnimationFrame(E.refresh)},focus:function(){n.dimmer("is active")&&E.is.active()&&u.autofocus&&requestAnimationFrame(E.set.autofocus)}},toggle:function(){E.is.active()||E.is.animating()?E.hide():E.show()},show:function(e){e=V(e)?e:function(){},E.refreshModals(),E.set.dimmerSettings(),E.set.dimmerStyles(),E.showModal(e)},hide:function(e){return e=V(e)?e:function(){},E.refreshModals(),E.hideModal(e)},showModal:function(e){e=V(e)?e:function(){},E.is.animating()||!E.is.active()?!1===u.onShow.call(S)?E.verbose("Show callback returned false cancelling show"):(F=E.has.scrollbar(),E.showDimmer(),E.cacheSizes(),F&&E.set.bodyMargin(),E.can.useFlex()?E.remove.legacy():(E.set.legacy(),E.set.modalOffset(),E.debug("Using non-flex legacy modal positioning.")),E.set.screenHeight(),E.set.type(),E.set.clickaway(),!u.allowMultiple&&E.others.active()?E.hideOthers(E.showModal):(M=!1,u.allowMultiple&&(E.others.active()&&s.filter("."+m.active).find(f.dimmer).addClass("active"),u.detachable&&y.detach().appendTo(t)),u.transition&&void 0!==X.fn.transition?(E.debug("Showing modal with css animations"),E.set.observeAttributes(!1),y.transition({debug:u.debug,verbose:u.verbose,silent:u.silent,animation:(u.transition.showMethod||u.transition)+" in",queue:u.queue,duration:u.transition.showDuration||u.duration,useFailSafe:!0,onComplete:function(){u.onVisible.apply(S),u.keyboardShortcuts&&E.add.keyboardShortcuts(),E.save.focus(),E.set.active(),E.refreshInputs(),requestAnimationFrame(E.set.observeAttributes),e()}})):E.error(v.noTransition))):E.debug("Modal is already visible")},hideModal:function(e,t,i){var n=s.filter("."+m.active).last();if(e=V(e)?e:function(){},!1===u.onHide.call(S,X(this)))return E.verbose("Hide callback returned false cancelling hide"),M=!1;(E.is.animating()||E.is.active())&&(E.debug("Hiding modal"),u.transition&&void 0!==X.fn.transition?(E.remove.active(),E.set.observeAttributes(!1),y.transition({debug:u.debug,verbose:u.verbose,silent:u.silent,animation:(u.transition.hideMethod||u.transition)+" out",queue:u.queue,duration:u.transition.hideDuration||u.duration,useFailSafe:!0,onStart:function(){E.others.active()||E.others.animating()||t||E.hideDimmer(),u.keyboardShortcuts&&!E.others.active()&&E.remove.keyboardShortcuts()},onComplete:function(){E.unbind.scrollLock(),E.remove.active(),u.allowMultiple&&(n.addClass(m.front),y.removeClass(m.front),(i?o:n).find(f.dimmer).removeClass("active")),V(u.onHidden)&&u.onHidden.call(S),E.remove.dimmerStyles(),E.restore.focus(),e()}})):E.error(v.noTransition))},showDimmer:function(){n.dimmer("is animating")||!n.dimmer("is active")?(F&&(k||t.css("top",n.scrollTop()),E.save.bodyMargin()),E.debug("Showing dimmer"),n.dimmer("show")):E.debug("Dimmer already visible")},hideDimmer:function(){n.dimmer("is animating")||n.dimmer("is active")?(E.unbind.scrollLock(),n.dimmer("hide",function(){F&&E.restore.bodyMargin(),E.remove.clickaway(),E.remove.screenHeight()})):E.debug("Dimmer is not visible cannot hide")},hideAll:function(i){var n,e=o.filter("."+m.active+", ."+m.animating);if(i=V(i)?i:function(){},0<e.length)return E.debug("Hiding all visible modals"),n=!0,X(e.get().reverse()).each(function(e,t){n=n&&X(t).modal("hide modal",i,!1,!0)}),n&&E.hideDimmer(),n},hideOthers:function(e){var t=s.filter("."+m.active+", ."+m.animating);e=V(e)?e:function(){},0<t.length&&(E.debug("Hiding other modals",s),t.modal("hide modal",e,!0))},others:{active:function(){return 0<s.filter("."+m.active).length},animating:function(){return 0<s.filter("."+m.animating).length}},add:{keyboardShortcuts:function(){E.verbose("Adding keyboard shortcuts"),j.on("keydown"+p,E.event.keyboard)}},save:{focus:function(){0<X(U.activeElement).closest(y).length||(e=X(U.activeElement).trigger("blur"))},bodyMargin:function(){D=x.css((k?"margin-":"padding-")+(E.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(D.replace(/[^\d.]/g,""),10),t=k?R.innerWidth-U.documentElement.clientWidth:x[0].offsetWidth-x[0].clientWidth;T=e+t}},restore:{focus:function(){e&&0<e.length&&u.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var i=E.can.leftBodyScrollbar()?"left":"right";x.css((k?"margin-":"padding-")+i,D),x.find(f.bodyFixed.replace("right",i)).each(function(){var e=X(this),t="fixed"===e.css("position")?"padding-"+i:i;e.css(t,"")})}},remove:{active:function(){y.removeClass(m.active)},legacy:function(){y.removeClass(m.legacy)},clickaway:function(){u.detachable||y.off("mousedown"+c),t.off("mousedown"+c),t.off("mouseup"+c)},dimmerStyles:function(){t.removeClass(m.inverted),n.removeClass(m.blurring)},bodyStyle:function(){""===x.attr("style")&&(E.verbose("Removing style attribute"),x.removeAttr("style"))},screenHeight:function(){E.debug("Removing page height"),x.css("height",""),E.remove.bodyStyle()},keyboardShortcuts:function(){E.verbose("Removing keyboard shortcuts"),j.off("keydown"+p)},scrolling:function(){H||n.removeClass(m.scrolling),y.removeClass(m.scrolling)}},cacheSizes:function(){y.addClass(m.loading);var e=y.prop("scrollHeight"),t=y.outerWidth(),i=y.outerHeight();void 0!==E.cache.pageHeight&&0===i||(X.extend(E.cache,{pageHeight:j.outerHeight(),width:t,height:i+u.offset,scrollHeight:e+u.offset,contextHeight:(k?I:n).height()}),E.cache.topOffset=-E.cache.height/2),y.removeClass(m.loading),E.debug("Caching modal and container sizes",E.cache)},helpers:{deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var i={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return i[e]}):e}},can:{leftBodyScrollbar:function(){return void 0===E.cache.leftBodyScrollbar&&(E.cache.leftBodyScrollbar=E.is.rtl()&&(E.is.iframe&&!E.is.firefox()||E.is.safari()||E.is.edge()||E.is.ie())),E.cache.leftBodyScrollbar},useFlex:function(){return"auto"===u.useFlex?u.detachable&&!E.is.ie():(u.useFlex&&E.is.ie()?E.debug("useFlex true is not supported in IE"):u.useFlex&&!u.detachable&&E.debug("useFlex true in combination with detachable false is not supported"),u.useFlex)},fit:function(){var e=E.cache.contextHeight,t=E.cache.contextHeight/2,i=E.cache.topOffset,n=E.cache.scrollHeight,o=E.cache.height,s=u.padding;return o<n?t+i+n+s<e:o+2*s<e}},has:{configActions:function(){return Array.isArray(u.actions)&&0<u.actions.length},scrollbar:function(){return k||"hidden"!==x.css("overflow-y")}},is:{active:function(){return y.hasClass(m.active)},ie:function(){var e,t;return void 0===E.cache.isIE&&(e=!R.ActiveXObject&&"ActiveXObject"in R,t="ActiveXObject"in R,E.cache.isIE=e||t),E.cache.isIE},animating:function(){return y.transition("is animating")},scrolling:function(){return n.hasClass(m.scrolling)},modernBrowser:function(){return!(R.ActiveXObject||"ActiveXObject"in R)},rtl:function(){return void 0===E.cache.isRTL&&(E.cache.isRTL="rtl"===y.attr("dir")||"rtl"===y.css("direction")||"rtl"===z.attr("dir")||"rtl"===z.css("direction")||"rtl"===x.attr("dir")||"rtl"===x.css("direction")),E.cache.isRTL},safari:function(){return void 0===E.cache.isSafari&&(E.cache.isSafari=/constructor/i.test(R.HTMLElement)||!!R.ApplePaySession),E.cache.isSafari},edge:function(){return void 0===E.cache.isEdge&&(E.cache.isEdge=!!R.setImmediate&&!E.is.ie()),E.cache.isEdge},firefox:function(){return void 0===E.cache.isFirefox&&(E.cache.isFirefox=!!R.InstallTrigger),E.cache.isFirefox},iframe:function(){return!(self===top)}},set:{observeAttributes:function(e){O=!1!==e},autofocus:function(){var e=i.filter("[autofocus]"),t=i.filter(":input"),e=(0<e.length?e:0<t.length?t:i.filter(":not(i.close)")).first();0<(e=0===e.length&&0<i.length?i.first():e).length&&e.trigger("focus")},bodyMargin:function(){var i=E.can.leftBodyScrollbar()?"left":"right";(u.detachable||E.can.fit())&&x.css((k?"margin-":"padding-")+i,T+"px"),x.find(f.bodyFixed.replace("right",i)).each(function(){var e=X(this),t="fixed"===e.css("position")?"padding-"+i:i;e.css(t,"calc("+e.css(t)+" + "+T+"px)")})},clickaway:function(){u.detachable||y.on("mousedown"+c,E.event.mousedown),t.on("mousedown"+c,E.event.mousedown),t.on("mouseup"+c,E.event.mouseup)},dimmerSettings:function(){var e;void 0===X.fn.dimmer?E.error(v.dimmer):(e={debug:u.debug,dimmerName:"modals",closable:"auto",useFlex:E.can.useFlex(),duration:{show:u.transition.showDuration||u.duration,hide:u.transition.hideDuration||u.duration}},e=X.extend(!0,e,u.dimmerSettings),u.inverted&&(e.variation=void 0!==e.variation?e.variation+" inverted":"inverted"),x.dimmer("setting",e))},dimmerStyles:function(){u.inverted?t.addClass(m.inverted):t.removeClass(m.inverted),u.blurring?n.addClass(m.blurring):n.removeClass(m.blurring)},modalOffset:function(){var e;u.detachable?y.css({marginTop:!y.hasClass("aligned")&&E.can.fit()?-E.cache.height/2:u.padding/2,marginLeft:-E.cache.width/2}):(e=E.can.fit(),y.css({top:!y.hasClass("aligned")&&e?j.scrollTop()+(E.cache.contextHeight-E.cache.height)/2:!e||y.hasClass("top")?j.scrollTop()+u.padding:j.scrollTop()+(E.cache.contextHeight-E.cache.height-u.padding),marginLeft:-E.cache.width/2})),E.verbose("Setting modal offset for legacy mode")},screenHeight:function(){E.can.fit()?x.css("height",""):y.hasClass("bottom")||(E.debug("Modal is taller than page content, resizing page height"),x.css("height",E.cache.height+2*u.padding+"px"))},active:function(){y.addClass(m.active+" "+m.front),s.filter("."+m.active).removeClass(m.front)},scrolling:function(){n.addClass(m.scrolling),y.addClass(m.scrolling),E.unbind.scrollLock()},legacy:function(){y.addClass(m.legacy)},type:function(){E.can.fit()?(E.verbose("Modal fits on screen"),E.others.active()||E.others.animating()||(E.remove.scrolling(),E.bind.scrollLock())):y.hasClass("bottom")?E.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(E.verbose("Modal cannot fit on screen setting to scrolling"),E.set.scrolling())},undetached:function(){n.addClass(m.undetached)}},setting:function(e,t){if(E.debug("Changing setting",e,t),X.isPlainObject(e))X.extend(!0,u,e);else{if(void 0===t)return u[e];X.isPlainObject(u[e])?X.extend(!0,u[e],t):u[e]=t}},internal:function(e,t){if(X.isPlainObject(e))X.extend(!0,E,e);else{if(void 0===t)return E[e];E[e]=t}},debug:function(){!u.silent&&u.debug&&(u.performance?E.performance.log(arguments):(E.debug=Function.prototype.bind.call(console.info,console,u.name+":"),E.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?E.performance.log(arguments):(E.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),E.verbose.apply(console,arguments)))},error:function(){u.silent||(E.error=Function.prototype.bind.call(console.error,console,u.name+":"),E.error.apply(console,arguments))},performance:{log:function(e){var t,i;u.performance&&(i=(t=Date.now())-(B||t),B=t,W.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":i})),clearTimeout(E.performance.timer),E.performance.timer=setTimeout(E.performance.display,500)},display:function(){var e=u.name+":",i=0;B=!1,clearTimeout(E.performance.timer),X.each(W,function(e,t){i+=t["Execution Time"]}),e+=" "+i+"ms",q&&(e+=" '"+q+"'"),0<W.length&&(console.groupCollapsed(e),console.table?console.table(W):X.each(W,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),W=[]}},invoke:function(n,e,t){var o,s,i,a=A;return e=e||Q,t=t||S,"string"==typeof n&&void 0!==a&&(n=n.split(/[ .]/),o=n.length-1,X.each(n,function(e,t){var i=e!==o?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(X.isPlainObject(a[i])&&e!==o)a=a[i];else{if(void 0!==a[i])return s=a[i],!1;{if(!X.isPlainObject(a[t])||e===o)return void 0!==a[t]?s=a[t]:E.error(v.method,n),!1;a=a[t]}}})),V(s)?i=s.apply(t,e):void 0!==s&&(i=s),Array.isArray(N)?N.push(i):void 0!==N?N=[N,i]:void 0!==i&&(N=i),s}};K?(void 0===A&&(V(u.templates[P])&&(u.autoShow=!0,u.className.modal=u.className.template,u=X.extend(!0,{},u,u.templates[P].apply(E,Q)),m=u.className,u.namespace,g=u.fields,v=u.error),E.initialize()),V(u.templates[P])||E.invoke(P)):(void 0!==A&&A.invoke("destroy"),E.initialize(),N=y)}),void 0!==N?N:this},X.modal=X.fn.modal,X.fn.modal.settings={name:"Modal",namespace:"modal",useFlex:"auto",offset:0,silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,restoreFocus:!0,autoShow:!1,inverted:!1,blurring:!1,centered:!0,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,transition:"scale",padding:50,scrollbarWidth:10,title:"",content:"",class:"",classTitle:"",classContent:"",classActions:"",closeIcon:!1,actions:!1,preserveHTML:!0,fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:!1,onApprove:function(){return!0},onDeny:function(){return!0},keys:{space:32,enter:13,escape:27,tab:9},selector:{title:"> .header",content:"> .content",actions:"> .actions",close:"> .close",closeIcon:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal",dimmer:"> .ui.dimmer",bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close",prompt:".ui.input > input"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",inverted:"inverted",legacy:"legacy",loading:"loading",scrolling:"scrolling",undetached:"undetached",front:"front",close:"close icon",button:"ui button",modal:"ui modal",title:"header",content:"content",actions:"actions",template:"ui tiny modal",ok:"positive",cancel:"negative",prompt:"ui fluid input",innerDimmer:"ui inverted dimmer"},text:{ok:"Ok",cancel:"Cancel",close:"Close"}},X.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return X.isPlainObject(e[0])?X.extend({handler:function(){},content:"",title:""},e[0]):(V(e[e.length-1])||e.push(function(){}),{handler:e.pop(),content:e.pop()||"",title:e.pop()||""})},alert:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments),i=t.handler;return{title:t.title,content:t.content,onApprove:i,actions:[{text:e.text.ok,class:e.className.ok,click:i}]}},confirm:function(){function e(){n.handler(!0)}function t(){n.handler(!1)}var i=this.get.settings(),n=i.templates.getArguments(arguments);return{title:n.title,content:n.content,onApprove:e,onDeny:t,actions:[{text:i.text.ok,class:i.className.ok,click:e},{text:i.text.cancel,class:i.className.cancel,click:t}]}},prompt:function(){function e(){var e=i.get.settings(),e=i.get.element().find(e.selector.prompt)[0];o.handler(X(e).val())}function t(){o.handler(null)}var i=this,n=this.get.settings(),o=n.templates.getArguments(arguments);return 0===X(X.parseHTML(o.content)).filter(".ui.input").length&&(o.content+='<p><div class="'+this.helpers.deQuote(n.className.prompt)+'"><input placeholder="'+this.helpers.deQuote(o.placeholder||"")+'" type="text" value="'+this.helpers.deQuote(o.defaultValue||"")+'"></div></p>'),{title:o.title,content:o.content,onApprove:e,onDeny:t,actions:[{text:n.text.ok,class:n.className.ok,click:e},{text:n.text.cancel,class:n.className.cancel,click:t}]}}}}(jQuery,window,document);
|
11
|
+
!function(R,U,V){"use strict";function _(e){return"function"==typeof e&&"number"!=typeof e.nodeType}U=void 0!==U&&U.Math===Math?U:globalThis,R.fn.modal=function(N){var I,e=R(this),j=R(U),z=R(V),q=R("body"),B=Date.now(),W=[],P=N,K="string"==typeof P,Q=[].slice.call(arguments,1),X=function(e,t){var i;return 0<=[U,V].indexOf(e)?i=q:0===(i=R(t.document).find(e)).length&&(i=t.frameElement?X(e,t.parent):q),i};return e.each(function(){var i,o,a,e,n,t,s,r,c,l,d,u=R.isPlainObject(N)?R.extend(!0,{},R.fn.modal.settings,N):R.extend({},R.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,v=u.error,p="."+h,b="module-"+h,y=R(this),x=X(u.context,U),k=x[0]===q[0],w=y.find(f.closeIcon),C=y.hasClass("modal"),S=this,A=C?y.data(b):void 0,M=!1,D="",T="",H=!1,F=!1,E=!1,O=!1,L={initialize:function(){var a;L.create.id(),C||(L.create.modal(),_(u.onHidden)||(u.onHidden=function(){L.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(f.title).html(L.helpers.escape(u.title,u.preserveHTML)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(L.helpers.escape(u.content,u.preserveHTML)).addClass(u.classContent),L.has.configActions()&&(0===(a=y.find(f.actions).addClass(u.classActions)).length?a=R("<div/>",{class:m.actions+" "+(u.classActions||"")}).appendTo(y):a.empty(),u.actions.forEach(function(e){var t=e[g.icon]?"<i "+(e[g.text]?'aria-hidden="true"':"")+' class="'+L.helpers.deQuote(e[g.icon])+' icon"></i>':"",i=L.helpers.escape(e[g.text]||"",u.preserveHTML),n=L.helpers.deQuote(e[g.class]||""),o=e[g.click]&&_(e[g.click])?e[g.click]:function(){};a.append(R("<button/>",{html:t+i,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+n,on:{click:function(){var e=R(this);e.is(f.approve)||e.is(f.deny)||!1===o.call(S,y)||L.hide()}}}))})),L.cache={},L.verbose("Initializing dimmer",x),L.create.dimmer(),u.allowMultiple&&L.create.innerDimmer(),u.centered||y.addClass("top aligned"),L.refreshModals(),L.bind.events(),L.observeChanges(),L.instantiate(),u.autoShow&&L.show()},instantiate:function(){L.verbose("Storing instance of modal"),A=L,y.data(b,A)},create:{modal:function(){var e;y=R("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(w=R("<i/>",{class:m.close,role:"button",tabindex:0,"aria-label":u.text.close}),y.append(w)),""!==u.title&&(e="_"+L.get.id()+"title",y.attr("aria-labelledby",e),R("<div/>",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+L.get.id()+"desc",y.attr("aria-describedby",e),R("<div/>",{class:m.content,id:e}).appendTo(y)),L.has.configActions()&&R("<div/>",{class:m.actions}).appendTo(y),x.append(y),S=y[0]},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},e=R.extend(!0,e,u.dimmerSettings);void 0===R.fn.dimmer?L.error(v.dimmer):(L.debug("Creating dimmer"),n=x.dimmer(e),H=L.is.scrolling(),u.detachable?(L.verbose("Modal is detachable, moving content into dimmer"),n.dimmer("add content",y)):L.set.undetached(),t=n.dimmer("get dimmer"))},id:function(){l=(Math.random().toString(16)+"000000000").slice(2,10),c="."+l,L.verbose("Creating unique id for element",l)},innerDimmer:function(){0===y.find(f.dimmer).length&&R("<div/>",{class:m.innerDimmer}).prependTo(y)}},destroy:function(){d&&d.disconnect(),L.verbose("Destroying previous modal"),y.removeData(b).off(p),j.off(c),x.off(c),t.off(c),w.off(c),i&&i.off(c),x.dimmer("destroy")},observeChanges:function(){"MutationObserver"in U&&((d=new MutationObserver(function(e){function o(e){for(var t=[],i=0,n=e.length;i<n;i++)Array.prototype.push.apply(t,o(e[i].childNodes)),t.push(e[i]);return t}var i=!1,n=!1,a=!0;e.every(function(e){var t;return"attributes"===e.type?O&&("disabled"===e.attributeName||0<R(e.target).find(":input").addBack(":input").filter(":visible").length)&&(n=!0):(i=!0,t=R(o(e.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),e=R(o(e.removedNodes)).filter("a[href], [tabindex], :input"),(0<t.length||0<e.length)&&(a=!(n=!0))),!n}),i&&u.observeChanges&&(L.debug("DOM tree modified, refreshing"),L.refresh()),n&&L.refreshInputs(a)})).observe(S,{attributeFilter:["class","disabled"],attributes:!0,childList:!0,subtree:!0}),L.debug("Setting up mutation observer",d))},refresh:function(){L.remove.scrolling(),L.cacheSizes(),L.can.useFlex()||L.set.modalOffset(),L.set.screenHeight(),L.set.type()},refreshModals:function(){a=y.siblings(f.modal),o=a.add(y)},refreshInputs:function(e){i&&i.off("keydown"+c),0===(i=y.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===R(this).closest(".disabled").length})).filter(":input").length?(i=y.add(i),y.attr("tabindex",-1)):y.removeAttr("tabindex"),i.first().on("keydown"+c,L.event.inputKeyDown.first),i.last().on("keydown"+c,L.event.inputKeyDown.last),!e&&u.autofocus&&0===i.filter(":focus").length&&L.set.autofocus()},attachEvents:function(e,t){var i=R(e);t=_(L[t])?L[t]:L.toggle,0<i.length?(L.debug("Attaching modal events to element",e,t),i.off(p).on("click"+p,t)):L.error(v.notFound,e)},bind:{events:function(){L.verbose("Attaching events"),y.on("click"+p,f.close,L.event.close).on("click"+p,f.approve,L.event.approve).on("click"+p,f.deny,L.event.deny),w.on("keyup"+c,L.event.closeKeyUp),j.on("resize"+c,L.event.resize).on("focus"+c,L.event.focus),x.on("click"+c,L.event.click)},scrollLock:function(){n[0].addEventListener("touchmove",L.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){n[0].removeEventListener("touchmove",L.event.preventScroll,{passive:!1})}},get:{id:function(){return l},element:function(){return y},settings:function(){return u}},event:{approve:function(){M||!1===u.onApprove.call(S,R(this))?L.verbose("Approve callback returned false cancelling hide"):(M=!0,L.hide(function(){M=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){M||!1===u.onDeny.call(S,R(this))?L.verbose("Deny callback returned false cancelling hide"):(M=!0,L.hide(function(){M=!1}))},close:function(){L.hide()},closeKeyUp:function(e){e=e.which;e!==u.keys.enter&&e!==u.keys.space||!y.hasClass(m.front)||L.hide()},inputKeyDown:{first:function(e){e.which===u.keys.tab&&e.shiftKey&&(i.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==u.keys.tab||e.shiftKey||(i.first().trigger("focus"),e.preventDefault())}},mousedown:function(e){var t=R(e.target),i=L.is.rtl();(s=0<t.closest(f.modal).length)&&L.verbose("Mouse down event registered inside the modal"),(r=L.is.scrolling()&&(!i&&j.outerWidth()-u.scrollbarWidth<=e.clientX||i&&u.scrollbarWidth>=e.clientX))&&L.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(e){if(u.closable)if(s)L.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(r)L.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{var t=0<R(e.target).closest(f.modal).length,e=R.contains(V.documentElement,e.target);if(!t&&e&&L.is.active()&&y.hasClass(m.front)){if(L.debug("Dimmer clicked, hiding all modals"),u.allowMultiple){if(!L.hideAll())return}else if(!L.hide())return;L.remove.clickaway()}}else L.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(L.timer),L.timer=setTimeout(e,t)},keyboard:function(e){e.which===u.keys.escape&&(u.closable?(L.debug("Escape key pressed hiding modal"),y.hasClass(m.front)&&L.hide()):L.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){n.dimmer("is active")&&(L.is.animating()||L.is.active())&&requestAnimationFrame(L.refresh)},focus:function(){E=!0},click:function(e){E&&V.activeElement!==e.target&&n.dimmer("is active")&&L.is.active()&&u.autofocus&&0===R(V.activeElement).closest(f.modal).length&&requestAnimationFrame(L.set.autofocus),E=!1}},toggle:function(){L.is.active()||L.is.animating()?L.hide():L.show()},show:function(e){e=_(e)?e:function(){},L.refreshModals(),L.set.dimmerSettings(),L.set.dimmerStyles(),L.showModal(e)},hide:function(e){return e=_(e)?e:function(){},L.refreshModals(),L.hideModal(e)},showModal:function(e){e=_(e)?e:function(){},L.is.animating()||!L.is.active()?!1===u.onShow.call(S)?L.verbose("Show callback returned false cancelling show"):(F=L.has.scrollbar(),L.showDimmer(),L.cacheSizes(),F&&L.set.bodyMargin(),L.can.useFlex()?L.remove.legacy():(L.set.legacy(),L.set.modalOffset(),L.debug("Using non-flex legacy modal positioning.")),L.set.screenHeight(),L.set.type(),L.set.clickaway(),!u.allowMultiple&&L.others.active()?L.hideOthers(L.showModal):(M=!1,u.allowMultiple&&(L.others.active()&&a.filter("."+m.active).find(f.dimmer).addClass("active"),u.detachable&&y.detach().appendTo(t)),u.transition&&void 0!==R.fn.transition?(L.debug("Showing modal with css animations"),L.set.observeAttributes(!1),y.transition({debug:u.debug,verbose:u.verbose,silent:u.silent,animation:(u.transition.showMethod||u.transition)+" in",queue:u.queue,duration:u.transition.showDuration||u.duration,useFailSafe:!0,onComplete:function(){u.onVisible.apply(S),u.keyboardShortcuts&&L.add.keyboardShortcuts(),L.save.focus(),L.set.active(),L.refreshInputs(),requestAnimationFrame(L.set.observeAttributes),e()}})):L.error(v.noTransition))):L.debug("Modal is already visible")},hideModal:function(e,t,i){var n=a.filter("."+m.active).last();if(e=_(e)?e:function(){},!1===u.onHide.call(S,R(this)))return L.verbose("Hide callback returned false cancelling hide"),M=!1;(L.is.animating()||L.is.active())&&(L.debug("Hiding modal"),u.transition&&void 0!==R.fn.transition?(L.remove.active(),L.set.observeAttributes(!1),y.transition({debug:u.debug,verbose:u.verbose,silent:u.silent,animation:(u.transition.hideMethod||u.transition)+" out",queue:u.queue,duration:u.transition.hideDuration||u.duration,useFailSafe:!0,onStart:function(){L.others.active()||L.others.animating()||t||L.hideDimmer(),u.keyboardShortcuts&&!L.others.active()&&L.remove.keyboardShortcuts()},onComplete:function(){L.unbind.scrollLock(),L.remove.active(),u.allowMultiple&&(n.addClass(m.front),y.removeClass(m.front),(i?o:n).find(f.dimmer).removeClass("active")),_(u.onHidden)&&u.onHidden.call(S),L.remove.dimmerStyles(),L.restore.focus(),e()}})):L.error(v.noTransition))},showDimmer:function(){n.dimmer("is animating")||!n.dimmer("is active")?(F&&(k||t.css("top",n.scrollTop()),L.save.bodyMargin()),L.debug("Showing dimmer"),n.dimmer("show")):L.debug("Dimmer already visible")},hideDimmer:function(){n.dimmer("is animating")||n.dimmer("is active")?(L.unbind.scrollLock(),n.dimmer("hide",function(){F&&L.restore.bodyMargin(),L.remove.clickaway(),L.remove.screenHeight()})):L.debug("Dimmer is not visible cannot hide")},hideAll:function(i){var n,e=o.filter("."+m.active+", ."+m.animating);if(i=_(i)?i:function(){},0<e.length)return L.debug("Hiding all visible modals"),n=!0,R(e.get().reverse()).each(function(e,t){n=n&&R(t).modal("hide modal",i,!1,!0)}),n&&L.hideDimmer(),n},hideOthers:function(e){var t=a.filter("."+m.active+", ."+m.animating);e=_(e)?e:function(){},0<t.length&&(L.debug("Hiding other modals",a),t.modal("hide modal",e,!0))},others:{active:function(){return 0<a.filter("."+m.active).length},animating:function(){return 0<a.filter("."+m.animating).length}},add:{keyboardShortcuts:function(){L.verbose("Adding keyboard shortcuts"),z.on("keydown"+p,L.event.keyboard)}},save:{focus:function(){0<R(V.activeElement).closest(y).length||(e=R(V.activeElement).trigger("blur"))},bodyMargin:function(){D=x.css((k?"margin-":"padding-")+(L.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(D.replace(/[^\d.]/g,""),10),t=k?U.innerWidth-V.documentElement.clientWidth:x[0].offsetWidth-x[0].clientWidth;T=e+t}},restore:{focus:function(){e&&0<e.length&&u.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var i=L.can.leftBodyScrollbar()?"left":"right";x.css((k?"margin-":"padding-")+i,D),x.find(f.bodyFixed.replace("right",i)).each(function(){var e=R(this),t="fixed"===e.css("position")?"padding-"+i:i;e.css(t,"")})}},remove:{active:function(){y.removeClass(m.active)},legacy:function(){y.removeClass(m.legacy)},clickaway:function(){u.detachable||y.off("mousedown"+c),t.off("mousedown"+c),t.off("mouseup"+c)},dimmerStyles:function(){t.removeClass(m.inverted),n.removeClass(m.blurring)},bodyStyle:function(){""===x.attr("style")&&(L.verbose("Removing style attribute"),x.removeAttr("style"))},screenHeight:function(){L.debug("Removing page height"),x.css("height",""),L.remove.bodyStyle()},keyboardShortcuts:function(){L.verbose("Removing keyboard shortcuts"),z.off("keydown"+p)},scrolling:function(){H||n.removeClass(m.scrolling),y.removeClass(m.scrolling)}},cacheSizes:function(){y.addClass(m.loading);var e=y.prop("scrollHeight"),t=y.outerWidth(),i=y.outerHeight();void 0!==L.cache.pageHeight&&0===i||(R.extend(L.cache,{pageHeight:z.outerHeight(),width:t,height:i+u.offset,scrollHeight:e+u.offset,contextHeight:(k?j:n).height()}),L.cache.topOffset=-L.cache.height/2),y.removeClass(m.loading),L.debug("Caching modal and container sizes",L.cache)},helpers:{deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var i={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return i[e]}):e}},can:{leftBodyScrollbar:function(){return void 0===L.cache.leftBodyScrollbar&&(L.cache.leftBodyScrollbar=L.is.rtl()&&(L.is.iframe&&!L.is.firefox()||L.is.safari()||L.is.edge()||L.is.ie())),L.cache.leftBodyScrollbar},useFlex:function(){return"auto"===u.useFlex?u.detachable&&!L.is.ie():(u.useFlex&&L.is.ie()?L.debug("useFlex true is not supported in IE"):u.useFlex&&!u.detachable&&L.debug("useFlex true in combination with detachable false is not supported"),u.useFlex)},fit:function(){var e=L.cache.contextHeight,t=L.cache.contextHeight/2,i=L.cache.topOffset,n=L.cache.scrollHeight,o=L.cache.height,a=u.padding;return o<n?t+i+n+a<e:o+2*a<e}},has:{configActions:function(){return Array.isArray(u.actions)&&0<u.actions.length},scrollbar:function(){return k||"hidden"!==x.css("overflow-y")}},is:{active:function(){return y.hasClass(m.active)},ie:function(){var e,t;return void 0===L.cache.isIE&&(e=!U.ActiveXObject&&"ActiveXObject"in U,t="ActiveXObject"in U,L.cache.isIE=e||t),L.cache.isIE},animating:function(){return y.transition("is animating")},scrolling:function(){return n.hasClass(m.scrolling)},modernBrowser:function(){return!(U.ActiveXObject||"ActiveXObject"in U)},rtl:function(){return void 0===L.cache.isRTL&&(L.cache.isRTL="rtl"===y.attr("dir")||"rtl"===y.css("direction")||"rtl"===q.attr("dir")||"rtl"===q.css("direction")||"rtl"===x.attr("dir")||"rtl"===x.css("direction")),L.cache.isRTL},safari:function(){return void 0===L.cache.isSafari&&(L.cache.isSafari=/constructor/i.test(U.HTMLElement)||!!U.ApplePaySession),L.cache.isSafari},edge:function(){return void 0===L.cache.isEdge&&(L.cache.isEdge=!!U.setImmediate&&!L.is.ie()),L.cache.isEdge},firefox:function(){return void 0===L.cache.isFirefox&&(L.cache.isFirefox=!!U.InstallTrigger),L.cache.isFirefox},iframe:function(){return!(self===top)}},set:{observeAttributes:function(e){O=!1!==e},autofocus:function(){var e=i.filter("[autofocus]"),t=i.filter(":input");(0<e.length?e:0<t.length?t:y).first().trigger("focus")},bodyMargin:function(){var i=L.can.leftBodyScrollbar()?"left":"right";(u.detachable||L.can.fit())&&x.css((k?"margin-":"padding-")+i,T+"px"),x.find(f.bodyFixed.replace("right",i)).each(function(){var e=R(this),t="fixed"===e.css("position")?"padding-"+i:i;e.css(t,"calc("+e.css(t)+" + "+T+"px)")})},clickaway:function(){u.detachable||y.on("mousedown"+c,L.event.mousedown),t.on("mousedown"+c,L.event.mousedown),t.on("mouseup"+c,L.event.mouseup)},dimmerSettings:function(){var e;void 0===R.fn.dimmer?L.error(v.dimmer):(e={debug:u.debug,dimmerName:"modals",closable:"auto",useFlex:L.can.useFlex(),duration:{show:u.transition.showDuration||u.duration,hide:u.transition.hideDuration||u.duration}},e=R.extend(!0,e,u.dimmerSettings),u.inverted&&(e.variation=void 0!==e.variation?e.variation+" inverted":"inverted"),x.dimmer("setting",e))},dimmerStyles:function(){u.inverted?t.addClass(m.inverted):t.removeClass(m.inverted),u.blurring?n.addClass(m.blurring):n.removeClass(m.blurring)},modalOffset:function(){var e;u.detachable?y.css({marginTop:!y.hasClass("aligned")&&L.can.fit()?-L.cache.height/2:u.padding/2,marginLeft:-L.cache.width/2}):(e=L.can.fit(),y.css({top:!y.hasClass("aligned")&&e?z.scrollTop()+(L.cache.contextHeight-L.cache.height)/2:!e||y.hasClass("top")?z.scrollTop()+u.padding:z.scrollTop()+(L.cache.contextHeight-L.cache.height-u.padding),marginLeft:-L.cache.width/2})),L.verbose("Setting modal offset for legacy mode")},screenHeight:function(){L.can.fit()?x.css("height",""):y.hasClass("bottom")||(L.debug("Modal is taller than page content, resizing page height"),x.css("height",L.cache.height+2*u.padding+"px"))},active:function(){y.addClass(m.active+" "+m.front),a.filter("."+m.active).removeClass(m.front)},scrolling:function(){n.addClass(m.scrolling),y.addClass(m.scrolling),L.unbind.scrollLock()},legacy:function(){y.addClass(m.legacy)},type:function(){L.can.fit()?(L.verbose("Modal fits on screen"),L.others.active()||L.others.animating()||(L.remove.scrolling(),L.bind.scrollLock())):y.hasClass("bottom")?L.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(L.verbose("Modal cannot fit on screen setting to scrolling"),L.set.scrolling())},undetached:function(){n.addClass(m.undetached)}},setting:function(e,t){if(L.debug("Changing setting",e,t),R.isPlainObject(e))R.extend(!0,u,e);else{if(void 0===t)return u[e];R.isPlainObject(u[e])?R.extend(!0,u[e],t):u[e]=t}},internal:function(e,t){if(R.isPlainObject(e))R.extend(!0,L,e);else{if(void 0===t)return L[e];L[e]=t}},debug:function(){!u.silent&&u.debug&&(u.performance?L.performance.log(arguments):(L.debug=Function.prototype.bind.call(console.info,console,u.name+":"),L.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?L.performance.log(arguments):(L.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),L.verbose.apply(console,arguments)))},error:function(){u.silent||(L.error=Function.prototype.bind.call(console.error,console,u.name+":"),L.error.apply(console,arguments))},performance:{log:function(e){var t,i;u.performance&&(i=(t=Date.now())-(B||t),B=t,W.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":i})),clearTimeout(L.performance.timer),L.performance.timer=setTimeout(L.performance.display,500)},display:function(){var e=u.name+":",i=0;B=!1,clearTimeout(L.performance.timer),R.each(W,function(e,t){i+=t["Execution Time"]}),e+=" "+i+"ms",0<W.length&&(console.groupCollapsed(e),console.table?console.table(W):R.each(W,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),W=[]}},invoke:function(n,e,t){var o,a,i,s=A;return e=e||Q,t=t||S,"string"==typeof n&&void 0!==s&&(n=n.split(/[ .]/),o=n.length-1,R.each(n,function(e,t){var i=e!==o?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(R.isPlainObject(s[i])&&e!==o)s=s[i];else{if(void 0!==s[i])return a=s[i],!1;{if(!R.isPlainObject(s[t])||e===o)return void 0!==s[t]?a=s[t]:L.error(v.method,n),!1;s=s[t]}}})),_(a)?i=a.apply(t,e):void 0!==a&&(i=a),Array.isArray(I)?I.push(i):void 0!==I?I=[I,i]:void 0!==i&&(I=i),a}};K?(void 0===A&&(_(u.templates[P])&&(u.autoShow=!0,u.className.modal=u.className.template,u=R.extend(!0,{},u,u.templates[P].apply(L,Q)),m=u.className,u.namespace,g=u.fields,v=u.error),L.initialize()),_(u.templates[P])||L.invoke(P)):(void 0!==A&&A.invoke("destroy"),L.initialize(),I=y)}),void 0!==I?I:this},R.modal=R.fn.modal,R.fn.modal.settings={name:"Modal",namespace:"modal",useFlex:"auto",offset:0,silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,restoreFocus:!0,autoShow:!1,inverted:!1,blurring:!1,centered:!0,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,transition:"scale",padding:50,scrollbarWidth:10,title:"",content:"",class:"",classTitle:"",classContent:"",classActions:"",closeIcon:!1,actions:!1,preserveHTML:!0,fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:!1,onApprove:function(){return!0},onDeny:function(){return!0},keys:{space:32,enter:13,escape:27,tab:9},selector:{title:"> .header",content:"> .content",actions:"> .actions",close:"> .close",closeIcon:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal",dimmer:"> .ui.dimmer",bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close",prompt:".ui.input > input"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",inverted:"inverted",legacy:"legacy",loading:"loading",scrolling:"scrolling",undetached:"undetached",front:"front",close:"close icon",button:"ui button",modal:"ui modal",title:"header",content:"content",actions:"actions",template:"ui tiny modal",ok:"positive",cancel:"negative",prompt:"ui fluid input",innerDimmer:"ui inverted dimmer"},text:{ok:"Ok",cancel:"Cancel",close:"Close"}},R.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return R.isPlainObject(e[0])?R.extend({handler:function(){},content:"",title:""},e[0]):(_(e[e.length-1])||e.push(function(){}),{handler:e.pop(),content:e.pop()||"",title:e.pop()||""})},alert:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments),i=t.handler;return{title:t.title,content:t.content,onApprove:i,actions:[{text:e.text.ok,class:e.className.ok,click:i}]}},confirm:function(){function e(){n.handler(!0)}function t(){n.handler(!1)}var i=this.get.settings(),n=i.templates.getArguments(arguments);return{title:n.title,content:n.content,onApprove:e,onDeny:t,actions:[{text:i.text.ok,class:i.className.ok,click:e},{text:i.text.cancel,class:i.className.cancel,click:t}]}},prompt:function(){function e(){var e=i.get.settings(),e=i.get.element().find(e.selector.prompt)[0];o.handler(R(e).val())}function t(){o.handler(null)}var i=this,n=this.get.settings(),o=n.templates.getArguments(arguments);return 0===R(R.parseHTML(o.content)).filter(".ui.input").length&&(o.content+='<p><div class="'+this.helpers.deQuote(n.className.prompt)+'"><input placeholder="'+this.helpers.deQuote(o.placeholder||"")+'" type="text" value="'+this.helpers.deQuote(o.defaultValue||"")+'"></div></p>'),{title:o.title,content:o.content,onApprove:e,onDeny:t,actions:[{text:n.text.ok,class:n.className.ok,click:e},{text:n.text.cancel,class:n.className.cancel,click:t}]}}}}(jQuery,window,document);
|
package/dist/components/nag.css
CHANGED
package/dist/components/nag.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.3-beta.
|
2
|
+
* # Fomantic-UI 2.9.3-beta.3+880333c - Nag
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -22,7 +22,7 @@
|
|
22
22
|
$.fn.nag = function (parameters) {
|
23
23
|
var
|
24
24
|
$allModules = $(this),
|
25
|
-
|
25
|
+
$body = $('body'),
|
26
26
|
|
27
27
|
time = Date.now(),
|
28
28
|
performance = [],
|
@@ -30,6 +30,19 @@
|
|
30
30
|
query = arguments[0],
|
31
31
|
methodInvoked = typeof query === 'string',
|
32
32
|
queryArguments = [].slice.call(arguments, 1),
|
33
|
+
contextCheck = function (context, win) {
|
34
|
+
var $context;
|
35
|
+
if ([window, document].indexOf(context) >= 0) {
|
36
|
+
$context = $(context);
|
37
|
+
} else {
|
38
|
+
$context = $(win.document).find(context);
|
39
|
+
if ($context.length === 0) {
|
40
|
+
$context = win.frameElement ? contextCheck(context, win.parent) : $body;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
return $context;
|
45
|
+
},
|
33
46
|
returnedValue
|
34
47
|
;
|
35
48
|
$allModules.each(function () {
|
@@ -47,9 +60,7 @@
|
|
47
60
|
|
48
61
|
$module = $(this),
|
49
62
|
|
50
|
-
$context = settings.context
|
51
|
-
? ([window, document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
|
52
|
-
: $('body'),
|
63
|
+
$context = settings.context ? contextCheck(settings.context, window) : $body,
|
53
64
|
|
54
65
|
element = this,
|
55
66
|
instance = $module.data(moduleNamespace),
|
@@ -379,9 +390,6 @@
|
|
379
390
|
totalTime += data['Execution Time'];
|
380
391
|
});
|
381
392
|
title += ' ' + totalTime + 'ms';
|
382
|
-
if (moduleSelector) {
|
383
|
-
title += ' \'' + moduleSelector + '\'';
|
384
|
-
}
|
385
393
|
if (performance.length > 0) {
|
386
394
|
console.groupCollapsed(title);
|
387
395
|
if (console.table) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.3-beta.
|
2
|
+
* # Fomantic UI - 2.9.3-beta.3+880333c
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(
|
11
|
+
!function(w,S,D){"use strict";S=void 0!==S&&S.Math===Math?S:globalThis,w.fn.nag=function(g){var p,e=w(this),m=w("body"),f=Date.now(),h=[],v=g,b="string"==typeof v,y=[].slice.call(arguments,1),x=function(e,n){var o;return 0<=[S,D].indexOf(e)?o=w(e):0===(o=w(n.document).find(e)).length&&(o=n.frameElement?x(e,n.parent):m),o};return e.each(function(){var t,i=w.isPlainObject(g)?w.extend(!0,{},w.fn.nag.settings,g):w.extend({},w.fn.nag.settings),e=i.selector,l=i.error,n=i.namespace,o="."+n,a=n+"-module",r=w(this),s=i.context?x(i.context,S):m,c=this,d=r.data(a),u={initialize:function(){u.verbose("Initializing element"),"string"!=typeof i.value&&(i.value=JSON.stringify(i.value)),t=u.get.storage(),r.on("click"+o,e.close,u.dismiss).data(a,u),i.detachable&&r.parent()[0]!==s[0]&&r.detach().prependTo(s),0<i.displayTime&&setTimeout(u.hide,i.displayTime),u.show()},destroy:function(){u.verbose("Destroying instance"),r.removeData(a).off(o)},show:function(){if(u.should.show()&&!r.is(":visible")){if(!1===i.onShow.call(c))return u.debug("onShow callback returned false, cancelling nag animation"),!1;u.debug("Showing nag",i.animation.show),"fade"===i.animation.show?r.fadeIn(i.duration,i.easing,i.onVisible):r.slideDown(i.duration,i.easing,i.onVisible)}},hide:function(){if(!1===i.onHide.call(c))return u.debug("onHide callback returned false, cancelling nag animation"),!1;u.debug("Hiding nag",i.animation.hide),"fade"===i.animation.hide?r.fadeOut(i.duration,i.easing,i.onHidden):r.slideUp(i.duration,i.easing,i.onHidden)},dismiss:function(e){!1!==u.hide()&&i.storageMethod&&(u.debug("Dismissing nag",i.storageMethod,i.key,i.value,i.expires),u.storage.set(i.key,i.value)),e.stopImmediatePropagation(),e.preventDefault()},should:{show:function(){return i.persist?(u.debug("Persistent nag is set, can show nag"),!0):u.storage.get(i.key)!=i.value.toString()?(u.debug("Stored value is not set, can show nag",u.storage.get(i.key)),!0):(u.debug("Stored value is set, cannot show nag",u.storage.get(i.key)),!1)}},get:{expirationDate:function(e){if((e="number"==typeof e?new Date(Date.now()+864e5*e):e)instanceof Date&&e.getTime())return e.toUTCString();u.error(l.expiresFormat)},storage:function(){return"localstorage"===i.storageMethod&&void 0!==S.localStorage?(u.debug("Using local storage"),S.localStorage):"sessionstorage"===i.storageMethod&&void 0!==S.sessionStorage?(u.debug("Using session storage"),S.sessionStorage):"cookie"in D?(u.debug("Using cookie"),{setItem:function(e,n,o){e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),n=encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[B-D])/g,decodeURIComponent);var t,i="";for(t in o)Object.prototype.hasOwnProperty.call(o,t)&&(i+="; "+t,"string"==typeof o[t]&&(i+="="+o[t].split(";")[0]));D.cookie=e+"="+n+i},getItem:function(e){for(var n=D.cookie.split("; "),o=0,t=n.length;o<t;o++){var i=n[o].split("=");if(e===i[0].replace(/(%[\da-f]{2})+/gi,decodeURIComponent))return i[1]||""}},removeItem:function(e,n){t.setItem(e,"",n)}}):void u.error(l.noStorage)},storageOptions:function(){var e={};return i.expires&&(e.expires=u.get.expirationDate(i.expires)),i.domain&&(e.domain=i.domain),i.path&&(e.path=i.path),i.secure&&(e.secure=i.secure),i.samesite&&(e.samesite=i.samesite),e}},clear:function(){u.storage.remove(i.key)},storage:{set:function(e,n){var o=u.get.storageOptions();t===S.localStorage&&o.expires&&(u.debug("Storing expiration value in localStorage",e,o.expires),t.setItem(e+i.expirationKey,o.expires)),u.debug("Value stored",e,n);try{t.setItem(e,n,o)}catch(e){u.error(l.setItem,e)}},get:function(e){var n,o=t.getItem(e);return t===S.localStorage&&null!=(n=t.getItem(e+i.expirationKey))&&new Date(n)<new Date&&(u.debug("Value in localStorage has expired. Deleting key",e),u.storage.remove(e),o=null),o="undefined"!==o&&"null"!==o&&null!=o?o:void 0},remove:function(e){var n=u.get.storageOptions();n.expires=u.get.expirationDate(-1),t===S.localStorage&&t.removeItem(e+i.expirationKey),t.removeItem(e,n)}},setting:function(e,n){if(u.debug("Changing setting",e,n),w.isPlainObject(e))w.extend(!0,i,e);else{if(void 0===n)return i[e];w.isPlainObject(i[e])?w.extend(!0,i[e],n):i[e]=n}},internal:function(e,n){if(w.isPlainObject(e))w.extend(!0,u,e);else{if(void 0===n)return u[e];u[e]=n}},debug:function(){!i.silent&&i.debug&&(i.performance?u.performance.log(arguments):(u.debug=Function.prototype.bind.call(console.info,console,i.name+":"),u.debug.apply(console,arguments)))},verbose:function(){!i.silent&&i.verbose&&i.debug&&(i.performance?u.performance.log(arguments):(u.verbose=Function.prototype.bind.call(console.info,console,i.name+":"),u.verbose.apply(console,arguments)))},error:function(){i.silent||(u.error=Function.prototype.bind.call(console.error,console,i.name+":"),u.error.apply(console,arguments))},performance:{log:function(e){var n,o;i.performance&&(o=(n=Date.now())-(f||n),f=n,h.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:c,"Execution Time":o})),clearTimeout(u.performance.timer),u.performance.timer=setTimeout(u.performance.display,500)},display:function(){var e=i.name+":",o=0;f=!1,clearTimeout(u.performance.timer),w.each(h,function(e,n){o+=n["Execution Time"]}),e+=" "+o+"ms",0<h.length&&(console.groupCollapsed(e),console.table?console.table(h):w.each(h,function(e,n){console.log(n.Name+": "+n["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(t,e,n){var i,a,o,r,s=d;return e=e||y,n=n||c,"string"==typeof t&&void 0!==s&&(t=t.split(/[ .]/),i=t.length-1,w.each(t,function(e,n){var o=e!==i?n+t[e+1].charAt(0).toUpperCase()+t[e+1].slice(1):t;if(w.isPlainObject(s[o])&&e!==i)s=s[o];else{if(void 0!==s[o])return a=s[o],!1;{if(!w.isPlainObject(s[n])||e===i)return void 0!==s[n]?a=s[n]:u.error(l.method,t),!1;s=s[n]}}})),"function"==typeof(r=a)&&"number"!=typeof r.nodeType?o=a.apply(n,e):void 0!==a&&(o=a),Array.isArray(p)?p.push(o):void 0!==p?p=[p,o]:void 0!==o&&(p=o),a}};b?(void 0===d&&u.initialize(),u.invoke(v)):(void 0!==d&&d.invoke("destroy"),u.initialize())}),void 0!==p?p:this},w.fn.nag.settings={name:"Nag",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},context:!1,detachable:!1,expires:30,domain:!1,path:"/",secure:!1,samesite:!1,storageMethod:"cookie",key:"nag",value:"dismiss",expirationKey:"ExpirationDate",error:{noStorage:"Unsupported storage method",method:"The method you called is not defined.",setItem:"Unexpected error while setting value",expiresFormat:'"expires" must be a number of days or a Date Object'},className:{bottom:"bottom",fixed:"fixed"},selector:{close:"> .close.icon"},duration:500,easing:"easeOutQuad",onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){}},w.extend(w.easing,{easeOutQuad:function(e){return 1-(1-e)*(1-e)}})}(jQuery,window,document);
|
package/dist/components/popup.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.3-beta.
|
2
|
+
* # Fomantic-UI 2.9.3-beta.3+880333c - Popup
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -26,8 +26,6 @@
|
|
26
26
|
$window = $(window),
|
27
27
|
$body = $('body'),
|
28
28
|
|
29
|
-
moduleSelector = $allModules.selector || '',
|
30
|
-
|
31
29
|
clickEvent = 'ontouchstart' in document.documentElement
|
32
30
|
? 'touchstart'
|
33
31
|
: 'click',
|
@@ -38,6 +36,19 @@
|
|
38
36
|
query = arguments[0],
|
39
37
|
methodInvoked = typeof query === 'string',
|
40
38
|
queryArguments = [].slice.call(arguments, 1),
|
39
|
+
contextCheck = function (context, win) {
|
40
|
+
var $context;
|
41
|
+
if ([window, document].indexOf(context) >= 0) {
|
42
|
+
$context = $(context);
|
43
|
+
} else {
|
44
|
+
$context = $(win.document).find(context);
|
45
|
+
if ($context.length === 0) {
|
46
|
+
$context = win.frameElement ? contextCheck(context, win.parent) : $body;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
return $context;
|
51
|
+
},
|
41
52
|
|
42
53
|
returnedValue
|
43
54
|
;
|
@@ -57,12 +68,10 @@
|
|
57
68
|
moduleNamespace = 'module-' + namespace,
|
58
69
|
|
59
70
|
$module = $(this),
|
60
|
-
$context =
|
61
|
-
$scrollContext =
|
62
|
-
$boundary =
|
63
|
-
$target = settings.target
|
64
|
-
? ([window, document].indexOf(settings.target) < 0 ? $document.find(settings.target) : $(settings.target))
|
65
|
-
: $module,
|
71
|
+
$context = contextCheck(settings.context, window),
|
72
|
+
$scrollContext = contextCheck(settings.scrollContext, window),
|
73
|
+
$boundary = contextCheck(settings.boundary, window),
|
74
|
+
$target = settings.target ? contextCheck(settings.target, window) : $module,
|
66
75
|
|
67
76
|
$popup,
|
68
77
|
$offsetParent,
|
@@ -1246,9 +1255,6 @@
|
|
1246
1255
|
totalTime += data['Execution Time'];
|
1247
1256
|
});
|
1248
1257
|
title += ' ' + totalTime + 'ms';
|
1249
|
-
if (moduleSelector) {
|
1250
|
-
title += ' \'' + moduleSelector + '\'';
|
1251
|
-
}
|
1252
1258
|
if (performance.length > 0) {
|
1253
1259
|
console.groupCollapsed(title);
|
1254
1260
|
if (console.table) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.3-beta.
|
2
|
+
* # Fomantic UI - 2.9.3-beta.3+880333c
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(V,W,M){"use strict";function z(t){return"function"==typeof t&&"number"!=typeof t.nodeType}W=void 0!==W&&W.Math===Math?W:globalThis,V.fn.popup=function(T){var E,t=V(this),k=V(M),S=V(W),O=V("body"),A=t.selector||"",D="ontouchstart"in M.documentElement?"touchstart":"click",j=Date.now(),F=[],R=T,H="string"==typeof R,N=[].slice.call(arguments,1);return t.each(function(){var p,s,t,e,o,u=V.isPlainObject(T)?V.extend(!0,{},V.fn.popup.settings,T):V.extend({},V.fn.popup.settings),n=u.selector,c=u.className,d=u.error,f=u.metadata,i=u.namespace,r="."+u.namespace,a="module-"+i,h=V(this),l=[W,M].indexOf(u.context)<0?k.find(u.context):V(u.context),g=[W,M].indexOf(u.scrollContext)<0?k.find(u.scrollContext):V(u.scrollContext),v=[W,M].indexOf(u.boundary)<0?k.find(u.boundary):V(u.boundary),m=u.target?[W,M].indexOf(u.target)<0?k.find(u.target):V(u.target):h,b=0,w=!1,y=!1,P=this,C=h.data(a),x={initialize:function(){x.debug("Initializing",h),x.createID(),x.bind.events(),!x.exists()&&u.preserve&&x.create(),u.observeChanges&&x.observeChanges(),x.instantiate()},instantiate:function(){x.verbose("Storing instance",x),C=x,h.data(a,C)},observeChanges:function(){"MutationObserver"in W&&((t=new MutationObserver(x.event.documentChanged)).observe(M,{childList:!0,subtree:!0}),x.debug("Setting up mutation observer",t))},refresh:function(){u.popup?p=k.find(u.popup).eq(0):u.inline&&(p=m.nextAll(n.popup).eq(0),u.popup=p),u.popup?(x.set.invisible(),s=x.get.offsetParent(),x.remove.invisible(),u.movePopup&&x.has.popup()&&x.get.offsetParent(p)[0]!==s[0]&&(x.debug("Moving popup to the same offset parent as target"),p.detach().appendTo(s))):s=u.inline?x.get.offsetParent(m):x.has.popup()?x.get.offsetParent(p):O,s.is("html")&&s[0]!==O[0]&&(x.debug("Setting page as offset parent"),s=O),x.get.variation()&&x.set.variation()},reposition:function(){x.refresh(),x.set.position()},destroy:function(){x.debug("Destroying previous module"),t&&t.disconnect(),p&&!u.preserve&&x.removePopup(),clearTimeout(x.hideTimer),clearTimeout(x.showTimer),x.unbind.close(),x.unbind.events(),h.removeData(a)},event:{start:function(t){var e=V.isPlainObject(u.delay)?u.delay.show:u.delay;clearTimeout(x.hideTimer),y&&!u.addTouchEvents||(x.showTimer=setTimeout(x.show,e))},end:function(){var t=V.isPlainObject(u.delay)?u.delay.hide:u.delay;clearTimeout(x.showTimer),x.hideTimer=setTimeout(x.hide,t)},touchstart:function(t){y=!0,u.addTouchEvents&&x.show()},resize:function(){x.is.visible()&&x.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t===P||0<V(t).find(P).length)&&(x.debug("Element removed from DOM, tearing down events"),x.destroy())})})},hideGracefully:function(t){var e=V(t.target),o=V.contains(M.documentElement,t.target),e=0<e.closest(n.popup).length;t&&!e&&o?(x.debug("Click occurred outside popup hiding popup"),x.hide()):x.debug("Click was inside popup, keeping popup open")}},create:function(){var t=x.get.html(),e=x.get.title(),o=x.get.content();t||o||e?(x.debug("Creating pop-up html"),t=t||u.templates.popup({title:e,content:o}),p=V("<div/>").addClass(c.popup).data(f.activator,h).html(t),u.inline?(x.verbose("Inserting popup element inline",p),p.insertAfter(h)):(x.verbose("Appending popup element to body",p),p.appendTo(l)),x.refresh(),x.set.variation(),u.hoverable&&x.bind.popup(),u.onCreate.call(p,P)):u.popup?(k.find(u.popup).data(f.activator,h),x.verbose("Used popup specified in settings"),x.refresh(),u.hoverable&&x.bind.popup()):0<m.next(n.popup).length?(x.verbose("Pre-existing popup found"),u.inline=!0,u.popup=m.next(n.popup).data(f.activator,h),x.refresh(),u.hoverable&&x.bind.popup()):x.debug("No content specified skipping display",P)},createID:function(){o=(Math.random().toString(16)+"000000000").slice(2,10),e="."+o,x.verbose("Creating unique id for element",o)},toggle:function(){x.debug("Toggling pop-up"),x.is.hidden()?(x.debug("Popup is hidden, showing pop-up"),x.unbind.close(),x.show()):(x.debug("Popup is visible, hiding pop-up"),x.hide())},show:function(t){t=t||function(){},x.debug("Showing pop-up",u.transition),!x.is.hidden()||x.is.active()&&x.is.dropdown()||(x.exists()||x.create(),!1===u.onShow.call(p,P)?x.debug("onShow callback returned false, cancelling popup animation"):(u.preserve||u.popup||x.refresh(),p&&x.set.position()&&(x.save.conditions(),u.exclusive&&x.hideAll(),x.animate.show(t))))},hide:function(t){t=t||function(){},(x.is.visible()||x.is.animating())&&(!1===u.onHide.call(p,P)?x.debug("onHide callback returned false, cancelling popup animation"):(x.remove.visible(),x.unbind.close(),x.restore.conditions(),x.animate.hide(t)))},hideAll:function(){k.find(n.popup).filter("."+c.popupVisible).each(function(){V(this).data(f.activator).popup("hide")})},exists:function(){return!!p&&(u.inline||u.popup?x.has.popup():0<p.closest(l).length)},removePopup:function(){x.has.popup()&&!u.popup&&(x.debug("Removing popup",p),p.remove(),p=void 0,u.onRemove.call(p,P))},save:{conditions:function(){x.cache={title:h.attr("title")},x.cache.title&&h.removeAttr("title"),x.verbose("Saving original attributes",x.cache.title)}},restore:{conditions:function(){return x.cache&&x.cache.title&&(h.attr("title",x.cache.title),x.verbose("Restoring original attributes",x.cache.title)),!0}},supports:{svg:function(){return"undefined"!=typeof SVGGraphicsElement}},animate:{show:function(t){t=z(t)?t:function(){},u.transition&&x.can.useElement("transition")&&(x.set.visible(),p.transition({animation:(u.transition.showMethod||u.transition)+" in",queue:!1,debug:u.debug,verbose:u.verbose,silent:u.silent,duration:u.transition.showDuration||u.duration,onComplete:function(){x.bind.close(),t.call(p,P),u.onVisible.call(p,P)}}))},hide:function(t){t=z(t)?t:function(){},x.debug("Hiding pop-up"),u.transition&&void 0!==V.fn.transition?p.transition({animation:(u.transition.hideMethod||u.transition)+" out",queue:!1,duration:u.transition.hideDuration||u.duration,debug:u.debug,verbose:u.verbose,silent:u.silent,onComplete:function(){x.reset(),t.call(p,P),u.onHidden.call(p,P)}}):x.error(d.noTransition)}},change:{content:function(t){p.html(t)}},get:{html:function(){return h.removeData(f.html),h.data(f.html)||u.html},title:function(){return h.removeData(f.title),h.data(f.title)||u.title},content:function(){return h.removeData(f.content),h.data(f.content)||u.content||h.attr("title")},variation:function(){return h.removeData(f.variation),h.data(f.variation)||u.variation},popup:function(){return p},popupOffset:function(){return p.offset()},calculations:function(){var t=x.get.offsetParent(p),e=m[0],o=v[0]===W,n=m.offset(),i=u.inline||u.popup&&u.movePopup?m.offsetParent().offset():{top:0,left:0},r=o?{top:0,left:0}:v.offset(),a={},o=o?{top:S.scrollTop(),left:S.scrollLeft()}:{top:0,left:0},a={target:{element:m[0],width:m.outerWidth(),height:m.outerHeight(),top:n.top-i.top,left:n.left-i.left,margin:{}},popup:{width:p.outerWidth(),height:p.outerHeight()},parent:{width:s.outerWidth(),height:s.outerHeight()},screen:{top:r.top,left:r.left,scroll:{top:o.top,left:o.left},width:v.width(),height:v.height()}};return t[0]!==s[0]&&(n=t.offset(),a.target.top-=n.top,a.target.left-=n.left,a.parent.width=t.outerWidth(),a.parent.height=t.outerHeight()),u.setFluidWidth&&x.is.fluid()&&(a.container={width:p.parent().outerWidth()},a.popup.width=a.container.width),a.target.margin.top=u.inline?parseInt(W.getComputedStyle(e).getPropertyValue("margin-top"),10):0,a.target.margin.left=u.inline?x.is.rtl()?parseInt(W.getComputedStyle(e).getPropertyValue("margin-right"),10):parseInt(W.getComputedStyle(e).getPropertyValue("margin-left"),10):0,i=a.screen,a.boundary={top:i.top+i.scroll.top,bottom:i.top+i.scroll.top+i.height,left:i.left+i.scroll.left,right:i.left+i.scroll.left+i.width},a},id:function(){return o},startEvent:function(){return"hover"===u.on?"mouseenter":"focus"===u.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"===u.on?"mouseleave":"focus"===u.on&&"blur"},distanceFromBoundary:function(t,e){var o={},n=(e=e||x.get.calculations()).popup,e=e.boundary;return t&&(o={top:t.top-e.top,left:t.left-e.left,right:e.right-(t.left+n.width),bottom:e.bottom-(t.top+n.height)},x.verbose("Distance from boundaries determined",t,o)),o},offsetParent:function(t){var e=(void 0!==t?t:m)[0].parentNode,o=V(e);if(e)for(var n="none"===o.css("transform"),i="static"===o.css("position"),r=o.is("body");e&&!r&&i&&n;)e=e.parentNode,n="none"===(o=V(e)).css("transform"),i="static"===o.css("position"),r=o.is("body");return o&&0<o.length?o:V()},positions:function(){return{"top left":!1,"top center":!1,"top right":!1,"bottom left":!1,"bottom center":!1,"bottom right":!1,"left center":!1,"right center":!1}},nextPosition:function(t){var e=t.split(" "),o=e[0],e=e[1],n="top"===o||"bottom"===o,i=!1,r=!1,a=!1;return w||(x.verbose("All available positions available"),w=x.get.positions()),x.debug("Recording last position tried",t),w[t]=!0,"opposite"===u.prefer&&(a=(a=[{top:"bottom",bottom:"top",left:"right",right:"left"}[o],e]).join(" "),i=!0===w[a],x.debug("Trying opposite strategy",a)),"adjacent"===u.prefer&&n&&(a=(a=[o,{left:"center",center:"right",right:"left"}[e]]).join(" "),r=!0===w[a],x.debug("Trying adjacent strategy",a)),(r||i)&&(x.debug("Using backup position",a),a={"top left":"top center","top center":"top right","top right":"right center","right center":"bottom right","bottom right":"bottom center","bottom center":"bottom left","bottom left":"left center","left center":"top left"}[t]),a}},set:{position:function(t,e){if(0!==m.length&&0!==p.length){var o,n,i,r,a,s,l;if(e=e||x.get.calculations(),t=t||h.data(f.position)||u.position,o=h.data(f.offset)||u.offset,n=u.distanceAway,i=e.target,r=e.popup,a=e.parent,x.should.centerArrow(e)&&(x.verbose("Adjusting offset to center arrow on small target element"),"top left"!==t&&"bottom left"!==t||(o=(o+=i.width/2)-u.arrowPixelsFromEdge),"top right"!==t&&"bottom right"!==t||(o=(o-=i.width/2)+u.arrowPixelsFromEdge)),0===i.width&&0===i.height&&!x.is.svg(i.element))return x.debug("Popup target is hidden, no action taken"),!1;switch(u.inline&&(x.debug("Adding margin to calculation",i.margin),"left center"===t||"right center"===t?(o+=i.margin.top,n+=-i.margin.left):"top left"===t||"top center"===t||"top right"===t?(o+=i.margin.left,n-=i.margin.top):(o+=i.margin.left,n+=i.margin.top)),x.debug("Determining popup position from calculations",t,e),x.is.rtl()&&(t=t.replace(/left|right/g,function(t){return"left"===t?"right":"left"}),x.debug("RTL: Popup position updated",t)),t=b===u.maxSearchDepth&&"string"==typeof u.lastResort?u.lastResort:t){case"top left":s={top:"auto",bottom:a.height-i.top+n,left:i.left+o,right:"auto"};break;case"top center":s={bottom:a.height-i.top+n,left:i.left+i.width/2-r.width/2+o,top:"auto",right:"auto"};break;case"top right":s={bottom:a.height-i.top+n,right:a.width-i.left-i.width-o,top:"auto",left:"auto"};break;case"left center":s={top:i.top+i.height/2-r.height/2+o,right:a.width-i.left+n,left:"auto",bottom:"auto"};break;case"right center":s={top:i.top+i.height/2-r.height/2+o,left:i.left+i.width+n,bottom:"auto",right:"auto"};break;case"bottom left":s={top:i.top+i.height+n,left:i.left+o,bottom:"auto",right:"auto"};break;case"bottom center":s={top:i.top+i.height+n,left:i.left+i.width/2-r.width/2+o,bottom:"auto",right:"auto"};break;case"bottom right":s={top:i.top+i.height+n,right:a.width-i.left-i.width-o,left:"auto",bottom:"auto"}}if(void 0===s&&x.error(d.invalidPosition,t),x.debug("Calculated popup positioning values",s),p.css(s).removeClass(c.position).addClass(t),x.set.invisible(),l=x.get.popupOffset(),l=x.get.distanceFromBoundary(l,e),!u.forcePosition&&x.is.offstage(l,t)){if(x.debug("Position is outside viewport",t),b<u.maxSearchDepth)return b++,t=x.get.nextPosition(t),x.debug("Trying new position",t),!!p&&x.set.position(t,e);if(!u.lastResort)return x.debug("Popup could not find a position to display",p),x.error(d.cannotPlace,P),x.remove.attempts(),x.remove.invisible(),x.reset(),u.onUnplaceable.call(p,P),!1;x.debug("No position found, showing with last position")}return x.debug("Position is on stage",t),x.remove.attempts(),x.remove.invisible(),u.setFluidWidth&&x.is.fluid()&&x.set.fluidWidth(e),!0}x.error(d.notFound)},fluidWidth:function(t){t=t||x.get.calculations(),x.debug("Automatically setting element width to parent width",t.parent.width),p.css("width",t.container.width)},loading:function(){p.addClass(c.loading)},invisible:function(){p.addClass(c.invisible)},variation:function(t){(t=t||x.get.variation())&&x.has.popup()&&(x.verbose("Adding variation to popup",t),p.addClass(t))},visible:function(){h.addClass(c.visible)}},remove:{loading:function(){p.removeClass(c.loading)},invisible:function(){p.removeClass(c.invisible)},variation:function(t){(t=t||x.get.variation())&&(x.verbose("Removing variation",t),p.removeClass(t))},visible:function(){h.removeClass(c.visible)},attempts:function(){x.verbose("Resetting all searched positions"),b=0,w=!1}},bind:{events:function(){x.debug("Binding popup events to module"),"click"===u.on&&h.on(D+r,x.toggle),"hover"===u.on&&h.on("touchstart"+r,x.event.touchstart),x.get.startEvent()&&h.on(x.get.startEvent()+r,x.event.start).on(x.get.endEvent()+r,x.event.end),u.target&&x.debug("Target set to element",m),S.on("resize"+e,x.event.resize)},popup:function(){x.verbose("Allowing hover events on popup to prevent closing"),p&&x.has.popup()&&p.on("mouseenter"+r,x.event.start).on("mouseleave"+r,x.event.end)},close:function(){(!0===u.hideOnScroll||"auto"===u.hideOnScroll&&"click"!==u.on)&&x.bind.closeOnScroll(),x.is.closable()?x.bind.clickaway():"hover"===u.on&&y&&x.bind.touchClose()},closeOnScroll:function(){x.verbose("Binding scroll close event to document"),g.one(x.get.scrollEvent()+e,x.event.hideGracefully)},touchClose:function(){x.verbose("Binding popup touchclose event to document"),k.on("touchstart"+e,function(t){x.verbose("Touched away from popup"),x.event.hideGracefully.call(P,t)})},clickaway:function(){x.verbose("Binding popup close event to document"),k.on(D+e,function(t){x.verbose("Clicked away from popup"),x.event.hideGracefully.call(P,t)})}},unbind:{events:function(){S.off(e),h.off(r)},close:function(){k.off(e),g.off(e)}},can:{useElement:function(t){return void 0!==V.fn[t]||(x.error(d.noElement.replace("{element}",t)),!1)}},has:{popup:function(){return p&&0<p.length}},should:{centerArrow:function(t){return!x.is.basic()&&t.target.width<=2*u.arrowPixelsFromEdge}},is:{closable:function(){return"auto"===u.closable?"hover"!==u.on:u.closable},offstage:function(t,o){var n=[];return V.each(t,function(t,e){e<-u.jitter&&(x.debug("Position exceeds allowable distance from edge",t,e,o),n.push(t))}),0<n.length},svg:function(t){return x.supports.svg()&&t instanceof SVGGraphicsElement},basic:function(){return h.hasClass(c.basic)},active:function(){return h.hasClass(c.active)},animating:function(){return void 0!==p&&p.hasClass(c.animating)},fluid:function(){return void 0!==p&&p.hasClass(c.fluid)},visible:function(){return void 0!==p&&p.hasClass(c.popupVisible)},dropdown:function(){return h.hasClass(c.dropdown)},hidden:function(){return!x.is.visible()},rtl:function(){return"rtl"===h.attr("dir")||"rtl"===h.css("direction")||"rtl"===O.attr("dir")||"rtl"===O.css("direction")||"rtl"===l.attr("dir")||"rtl"===l.css("direction")}},reset:function(){x.remove.visible(),u.preserve?void 0!==V.fn.transition&&p.transition("remove transition"):x.removePopup()},setting:function(t,e){if(V.isPlainObject(t))V.extend(!0,u,t);else{if(void 0===e)return u[t];u[t]=e}},internal:function(t,e){if(V.isPlainObject(t))V.extend(!0,x,t);else{if(void 0===e)return x[t];x[t]=e}},debug:function(){!u.silent&&u.debug&&(u.performance?x.performance.log(arguments):(x.debug=Function.prototype.bind.call(console.info,console,u.name+":"),x.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?x.performance.log(arguments):(x.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),x.verbose.apply(console,arguments)))},error:function(){u.silent||(x.error=Function.prototype.bind.call(console.error,console,u.name+":"),x.error.apply(console,arguments))},performance:{log:function(t){var e,o;u.performance&&(o=(e=Date.now())-(j||e),j=e,F.push({Name:t[0],Arguments:[].slice.call(t,1)||"",Element:P,"Execution Time":o})),clearTimeout(x.performance.timer),x.performance.timer=setTimeout(x.performance.display,500)},display:function(){var t=u.name+":",o=0;j=!1,clearTimeout(x.performance.timer),V.each(F,function(t,e){o+=e["Execution Time"]}),t+=" "+o+"ms",A&&(t+=" '"+A+"'"),0<F.length&&(console.groupCollapsed(t),console.table?console.table(F):V.each(F,function(t,e){console.log(e.Name+": "+e["Execution Time"]+"ms")}),console.groupEnd()),F=[]}},invoke:function(n,t,e){var i,r,o,a=C;return t=t||N,e=e||P,"string"==typeof n&&void 0!==a&&(n=n.split(/[ .]/),i=n.length-1,V.each(n,function(t,e){var o=t!==i?e+n[t+1].charAt(0).toUpperCase()+n[t+1].slice(1):n;if(V.isPlainObject(a[o])&&t!==i)a=a[o];else{if(void 0!==a[o])return r=a[o],!1;{if(!V.isPlainObject(a[e])||t===i)return void 0!==a[e]?r=a[e]:x.error(d.method,n),!1;a=a[e]}}})),z(r)?o=r.apply(e,t):void 0!==r&&(o=r),Array.isArray(E)?E.push(o):void 0!==E?E=[E,o]:void 0!==o&&(E=o),r}};H?(void 0===C&&x.initialize(),x.invoke(R)):(void 0!==C&&C.invoke("destroy"),x.initialize())}),void 0!==E?E:this},V.fn.popup.settings={name:"Popup",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"popup",observeChanges:!0,onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onUnplaceable:function(){},onHidden:function(){},on:"hover",boundary:W,addTouchEvents:!0,position:"top left",forcePosition:!1,variation:"",movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,content:!1,html:!1,title:!1,closable:!0,hideOnScroll:"auto",exclusive:!1,context:"body",scrollContext:W,prefer:"opposite",lastResort:!1,arrowPixelsFromEdge:20,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,jitter:2,offset:0,maxSearchDepth:15,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"Popup does not fit within the boundaries of the viewport",method:"The method you called is not defined.",noElement:"This module requires ui {element}",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",basic:"basic",animating:"animating",dropdown:"dropdown",invisible:"invisible",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible",popupVisible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(t){var e={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(t)?(t=t.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(t){return e[t]}):t},popup:function(t){var e="",o=V.fn.popup.settings.templates.escape;return void 0!==t&&(t.title&&(t.title=o(t.title),e+='<div class="header">'+t.title+"</div>"),t.content&&(t.content=o(t.content),e+='<div class="content">'+t.content+"</div>")),e}}}}(jQuery,window,document);
|
11
|
+
!function(V,W,M){"use strict";function z(e){return"function"==typeof e&&"number"!=typeof e.nodeType}W=void 0!==W&&W.Math===Math?W:globalThis,V.fn.popup=function(x){var E,e=V(this),k=V(M),S=V(W),A=V("body"),D="ontouchstart"in M.documentElement?"touchstart":"click",O=Date.now(),j=[],F=x,R="string"==typeof F,H=[].slice.call(arguments,1),N=function(e,t){var o;return 0<=[W,M].indexOf(e)?o=V(e):0===(o=V(t.document).find(e)).length&&(o=t.frameElement?N(e,t.parent):A),o};return e.each(function(){var p,s,e,t,o,u=V.isPlainObject(x)?V.extend(!0,{},V.fn.popup.settings,x):V.extend({},V.fn.popup.settings),n=u.selector,c=u.className,d=u.error,f=u.metadata,i=u.namespace,r="."+u.namespace,a="module-"+i,h=V(this),l=N(u.context,W),g=N(u.scrollContext,W),v=N(u.boundary,W),m=u.target?N(u.target,W):h,b=0,w=!1,y=!1,P=this,C=h.data(a),T={initialize:function(){T.debug("Initializing",h),T.createID(),T.bind.events(),!T.exists()&&u.preserve&&T.create(),u.observeChanges&&T.observeChanges(),T.instantiate()},instantiate:function(){T.verbose("Storing instance",T),C=T,h.data(a,C)},observeChanges:function(){"MutationObserver"in W&&((e=new MutationObserver(T.event.documentChanged)).observe(M,{childList:!0,subtree:!0}),T.debug("Setting up mutation observer",e))},refresh:function(){u.popup?p=k.find(u.popup).eq(0):u.inline&&(p=m.nextAll(n.popup).eq(0),u.popup=p),u.popup?(T.set.invisible(),s=T.get.offsetParent(),T.remove.invisible(),u.movePopup&&T.has.popup()&&T.get.offsetParent(p)[0]!==s[0]&&(T.debug("Moving popup to the same offset parent as target"),p.detach().appendTo(s))):s=u.inline?T.get.offsetParent(m):T.has.popup()?T.get.offsetParent(p):A,s.is("html")&&s[0]!==A[0]&&(T.debug("Setting page as offset parent"),s=A),T.get.variation()&&T.set.variation()},reposition:function(){T.refresh(),T.set.position()},destroy:function(){T.debug("Destroying previous module"),e&&e.disconnect(),p&&!u.preserve&&T.removePopup(),clearTimeout(T.hideTimer),clearTimeout(T.showTimer),T.unbind.close(),T.unbind.events(),h.removeData(a)},event:{start:function(e){var t=V.isPlainObject(u.delay)?u.delay.show:u.delay;clearTimeout(T.hideTimer),y&&!u.addTouchEvents||(T.showTimer=setTimeout(T.show,t))},end:function(){var e=V.isPlainObject(u.delay)?u.delay.hide:u.delay;clearTimeout(T.showTimer),T.hideTimer=setTimeout(T.hide,e)},touchstart:function(e){y=!0,u.addTouchEvents&&T.show()},resize:function(){T.is.visible()&&T.set.position()},documentChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e===P||0<V(e).find(P).length)&&(T.debug("Element removed from DOM, tearing down events"),T.destroy())})})},hideGracefully:function(e){var t=V(e.target),o=V.contains(M.documentElement,e.target),t=0<t.closest(n.popup).length;e&&!t&&o?(T.debug("Click occurred outside popup hiding popup"),T.hide()):T.debug("Click was inside popup, keeping popup open")}},create:function(){var e=T.get.html(),t=T.get.title(),o=T.get.content();e||o||t?(T.debug("Creating pop-up html"),e=e||u.templates.popup({title:t,content:o}),p=V("<div/>").addClass(c.popup).data(f.activator,h).html(e),u.inline?(T.verbose("Inserting popup element inline",p),p.insertAfter(h)):(T.verbose("Appending popup element to body",p),p.appendTo(l)),T.refresh(),T.set.variation(),u.hoverable&&T.bind.popup(),u.onCreate.call(p,P)):u.popup?(k.find(u.popup).data(f.activator,h),T.verbose("Used popup specified in settings"),T.refresh(),u.hoverable&&T.bind.popup()):0<m.next(n.popup).length?(T.verbose("Pre-existing popup found"),u.inline=!0,u.popup=m.next(n.popup).data(f.activator,h),T.refresh(),u.hoverable&&T.bind.popup()):T.debug("No content specified skipping display",P)},createID:function(){o=(Math.random().toString(16)+"000000000").slice(2,10),t="."+o,T.verbose("Creating unique id for element",o)},toggle:function(){T.debug("Toggling pop-up"),T.is.hidden()?(T.debug("Popup is hidden, showing pop-up"),T.unbind.close(),T.show()):(T.debug("Popup is visible, hiding pop-up"),T.hide())},show:function(e){e=e||function(){},T.debug("Showing pop-up",u.transition),!T.is.hidden()||T.is.active()&&T.is.dropdown()||(T.exists()||T.create(),!1===u.onShow.call(p,P)?T.debug("onShow callback returned false, cancelling popup animation"):(u.preserve||u.popup||T.refresh(),p&&T.set.position()&&(T.save.conditions(),u.exclusive&&T.hideAll(),T.animate.show(e))))},hide:function(e){e=e||function(){},(T.is.visible()||T.is.animating())&&(!1===u.onHide.call(p,P)?T.debug("onHide callback returned false, cancelling popup animation"):(T.remove.visible(),T.unbind.close(),T.restore.conditions(),T.animate.hide(e)))},hideAll:function(){k.find(n.popup).filter("."+c.popupVisible).each(function(){V(this).data(f.activator).popup("hide")})},exists:function(){return!!p&&(u.inline||u.popup?T.has.popup():0<p.closest(l).length)},removePopup:function(){T.has.popup()&&!u.popup&&(T.debug("Removing popup",p),p.remove(),p=void 0,u.onRemove.call(p,P))},save:{conditions:function(){T.cache={title:h.attr("title")},T.cache.title&&h.removeAttr("title"),T.verbose("Saving original attributes",T.cache.title)}},restore:{conditions:function(){return T.cache&&T.cache.title&&(h.attr("title",T.cache.title),T.verbose("Restoring original attributes",T.cache.title)),!0}},supports:{svg:function(){return"undefined"!=typeof SVGGraphicsElement}},animate:{show:function(e){e=z(e)?e:function(){},u.transition&&T.can.useElement("transition")&&(T.set.visible(),p.transition({animation:(u.transition.showMethod||u.transition)+" in",queue:!1,debug:u.debug,verbose:u.verbose,silent:u.silent,duration:u.transition.showDuration||u.duration,onComplete:function(){T.bind.close(),e.call(p,P),u.onVisible.call(p,P)}}))},hide:function(e){e=z(e)?e:function(){},T.debug("Hiding pop-up"),u.transition&&void 0!==V.fn.transition?p.transition({animation:(u.transition.hideMethod||u.transition)+" out",queue:!1,duration:u.transition.hideDuration||u.duration,debug:u.debug,verbose:u.verbose,silent:u.silent,onComplete:function(){T.reset(),e.call(p,P),u.onHidden.call(p,P)}}):T.error(d.noTransition)}},change:{content:function(e){p.html(e)}},get:{html:function(){return h.removeData(f.html),h.data(f.html)||u.html},title:function(){return h.removeData(f.title),h.data(f.title)||u.title},content:function(){return h.removeData(f.content),h.data(f.content)||u.content||h.attr("title")},variation:function(){return h.removeData(f.variation),h.data(f.variation)||u.variation},popup:function(){return p},popupOffset:function(){return p.offset()},calculations:function(){var e=T.get.offsetParent(p),t=m[0],o=v[0]===W,n=m.offset(),i=u.inline||u.popup&&u.movePopup?m.offsetParent().offset():{top:0,left:0},r=o?{top:0,left:0}:v.offset(),a={},o=o?{top:S.scrollTop(),left:S.scrollLeft()}:{top:0,left:0},a={target:{element:m[0],width:m.outerWidth(),height:m.outerHeight(),top:n.top-i.top,left:n.left-i.left,margin:{}},popup:{width:p.outerWidth(),height:p.outerHeight()},parent:{width:s.outerWidth(),height:s.outerHeight()},screen:{top:r.top,left:r.left,scroll:{top:o.top,left:o.left},width:v.width(),height:v.height()}};return e[0]!==s[0]&&(n=e.offset(),a.target.top-=n.top,a.target.left-=n.left,a.parent.width=e.outerWidth(),a.parent.height=e.outerHeight()),u.setFluidWidth&&T.is.fluid()&&(a.container={width:p.parent().outerWidth()},a.popup.width=a.container.width),a.target.margin.top=u.inline?parseInt(W.getComputedStyle(t).getPropertyValue("margin-top"),10):0,a.target.margin.left=u.inline?T.is.rtl()?parseInt(W.getComputedStyle(t).getPropertyValue("margin-right"),10):parseInt(W.getComputedStyle(t).getPropertyValue("margin-left"),10):0,i=a.screen,a.boundary={top:i.top+i.scroll.top,bottom:i.top+i.scroll.top+i.height,left:i.left+i.scroll.left,right:i.left+i.scroll.left+i.width},a},id:function(){return o},startEvent:function(){return"hover"===u.on?"mouseenter":"focus"===u.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"===u.on?"mouseleave":"focus"===u.on&&"blur"},distanceFromBoundary:function(e,t){var o={},n=(t=t||T.get.calculations()).popup,t=t.boundary;return e&&(o={top:e.top-t.top,left:e.left-t.left,right:t.right-(e.left+n.width),bottom:t.bottom-(e.top+n.height)},T.verbose("Distance from boundaries determined",e,o)),o},offsetParent:function(e){var t=(void 0!==e?e:m)[0].parentNode,o=V(t);if(t)for(var n="none"===o.css("transform"),i="static"===o.css("position"),r=o.is("body");t&&!r&&i&&n;)t=t.parentNode,n="none"===(o=V(t)).css("transform"),i="static"===o.css("position"),r=o.is("body");return o&&0<o.length?o:V()},positions:function(){return{"top left":!1,"top center":!1,"top right":!1,"bottom left":!1,"bottom center":!1,"bottom right":!1,"left center":!1,"right center":!1}},nextPosition:function(e){var t=e.split(" "),o=t[0],t=t[1],n="top"===o||"bottom"===o,i=!1,r=!1,a=!1;return w||(T.verbose("All available positions available"),w=T.get.positions()),T.debug("Recording last position tried",e),w[e]=!0,"opposite"===u.prefer&&(a=(a=[{top:"bottom",bottom:"top",left:"right",right:"left"}[o],t]).join(" "),i=!0===w[a],T.debug("Trying opposite strategy",a)),"adjacent"===u.prefer&&n&&(a=(a=[o,{left:"center",center:"right",right:"left"}[t]]).join(" "),r=!0===w[a],T.debug("Trying adjacent strategy",a)),(r||i)&&(T.debug("Using backup position",a),a={"top left":"top center","top center":"top right","top right":"right center","right center":"bottom right","bottom right":"bottom center","bottom center":"bottom left","bottom left":"left center","left center":"top left"}[e]),a}},set:{position:function(e,t){if(0!==m.length&&0!==p.length){var o,n,i,r,a,s,l;if(t=t||T.get.calculations(),e=e||h.data(f.position)||u.position,o=h.data(f.offset)||u.offset,n=u.distanceAway,i=t.target,r=t.popup,a=t.parent,T.should.centerArrow(t)&&(T.verbose("Adjusting offset to center arrow on small target element"),"top left"!==e&&"bottom left"!==e||(o=(o+=i.width/2)-u.arrowPixelsFromEdge),"top right"!==e&&"bottom right"!==e||(o=(o-=i.width/2)+u.arrowPixelsFromEdge)),0===i.width&&0===i.height&&!T.is.svg(i.element))return T.debug("Popup target is hidden, no action taken"),!1;switch(u.inline&&(T.debug("Adding margin to calculation",i.margin),"left center"===e||"right center"===e?(o+=i.margin.top,n+=-i.margin.left):"top left"===e||"top center"===e||"top right"===e?(o+=i.margin.left,n-=i.margin.top):(o+=i.margin.left,n+=i.margin.top)),T.debug("Determining popup position from calculations",e,t),T.is.rtl()&&(e=e.replace(/left|right/g,function(e){return"left"===e?"right":"left"}),T.debug("RTL: Popup position updated",e)),e=b===u.maxSearchDepth&&"string"==typeof u.lastResort?u.lastResort:e){case"top left":s={top:"auto",bottom:a.height-i.top+n,left:i.left+o,right:"auto"};break;case"top center":s={bottom:a.height-i.top+n,left:i.left+i.width/2-r.width/2+o,top:"auto",right:"auto"};break;case"top right":s={bottom:a.height-i.top+n,right:a.width-i.left-i.width-o,top:"auto",left:"auto"};break;case"left center":s={top:i.top+i.height/2-r.height/2+o,right:a.width-i.left+n,left:"auto",bottom:"auto"};break;case"right center":s={top:i.top+i.height/2-r.height/2+o,left:i.left+i.width+n,bottom:"auto",right:"auto"};break;case"bottom left":s={top:i.top+i.height+n,left:i.left+o,bottom:"auto",right:"auto"};break;case"bottom center":s={top:i.top+i.height+n,left:i.left+i.width/2-r.width/2+o,bottom:"auto",right:"auto"};break;case"bottom right":s={top:i.top+i.height+n,right:a.width-i.left-i.width-o,left:"auto",bottom:"auto"}}if(void 0===s&&T.error(d.invalidPosition,e),T.debug("Calculated popup positioning values",s),p.css(s).removeClass(c.position).addClass(e),T.set.invisible(),l=T.get.popupOffset(),l=T.get.distanceFromBoundary(l,t),!u.forcePosition&&T.is.offstage(l,e)){if(T.debug("Position is outside viewport",e),b<u.maxSearchDepth)return b++,e=T.get.nextPosition(e),T.debug("Trying new position",e),!!p&&T.set.position(e,t);if(!u.lastResort)return T.debug("Popup could not find a position to display",p),T.error(d.cannotPlace,P),T.remove.attempts(),T.remove.invisible(),T.reset(),u.onUnplaceable.call(p,P),!1;T.debug("No position found, showing with last position")}return T.debug("Position is on stage",e),T.remove.attempts(),T.remove.invisible(),u.setFluidWidth&&T.is.fluid()&&T.set.fluidWidth(t),!0}T.error(d.notFound)},fluidWidth:function(e){e=e||T.get.calculations(),T.debug("Automatically setting element width to parent width",e.parent.width),p.css("width",e.container.width)},loading:function(){p.addClass(c.loading)},invisible:function(){p.addClass(c.invisible)},variation:function(e){(e=e||T.get.variation())&&T.has.popup()&&(T.verbose("Adding variation to popup",e),p.addClass(e))},visible:function(){h.addClass(c.visible)}},remove:{loading:function(){p.removeClass(c.loading)},invisible:function(){p.removeClass(c.invisible)},variation:function(e){(e=e||T.get.variation())&&(T.verbose("Removing variation",e),p.removeClass(e))},visible:function(){h.removeClass(c.visible)},attempts:function(){T.verbose("Resetting all searched positions"),b=0,w=!1}},bind:{events:function(){T.debug("Binding popup events to module"),"click"===u.on&&h.on(D+r,T.toggle),"hover"===u.on&&h.on("touchstart"+r,T.event.touchstart),T.get.startEvent()&&h.on(T.get.startEvent()+r,T.event.start).on(T.get.endEvent()+r,T.event.end),u.target&&T.debug("Target set to element",m),S.on("resize"+t,T.event.resize)},popup:function(){T.verbose("Allowing hover events on popup to prevent closing"),p&&T.has.popup()&&p.on("mouseenter"+r,T.event.start).on("mouseleave"+r,T.event.end)},close:function(){(!0===u.hideOnScroll||"auto"===u.hideOnScroll&&"click"!==u.on)&&T.bind.closeOnScroll(),T.is.closable()?T.bind.clickaway():"hover"===u.on&&y&&T.bind.touchClose()},closeOnScroll:function(){T.verbose("Binding scroll close event to document"),g.one(T.get.scrollEvent()+t,T.event.hideGracefully)},touchClose:function(){T.verbose("Binding popup touchclose event to document"),k.on("touchstart"+t,function(e){T.verbose("Touched away from popup"),T.event.hideGracefully.call(P,e)})},clickaway:function(){T.verbose("Binding popup close event to document"),k.on(D+t,function(e){T.verbose("Clicked away from popup"),T.event.hideGracefully.call(P,e)})}},unbind:{events:function(){S.off(t),h.off(r)},close:function(){k.off(t),g.off(t)}},can:{useElement:function(e){return void 0!==V.fn[e]||(T.error(d.noElement.replace("{element}",e)),!1)}},has:{popup:function(){return p&&0<p.length}},should:{centerArrow:function(e){return!T.is.basic()&&e.target.width<=2*u.arrowPixelsFromEdge}},is:{closable:function(){return"auto"===u.closable?"hover"!==u.on:u.closable},offstage:function(e,o){var n=[];return V.each(e,function(e,t){t<-u.jitter&&(T.debug("Position exceeds allowable distance from edge",e,t,o),n.push(e))}),0<n.length},svg:function(e){return T.supports.svg()&&e instanceof SVGGraphicsElement},basic:function(){return h.hasClass(c.basic)},active:function(){return h.hasClass(c.active)},animating:function(){return void 0!==p&&p.hasClass(c.animating)},fluid:function(){return void 0!==p&&p.hasClass(c.fluid)},visible:function(){return void 0!==p&&p.hasClass(c.popupVisible)},dropdown:function(){return h.hasClass(c.dropdown)},hidden:function(){return!T.is.visible()},rtl:function(){return"rtl"===h.attr("dir")||"rtl"===h.css("direction")||"rtl"===A.attr("dir")||"rtl"===A.css("direction")||"rtl"===l.attr("dir")||"rtl"===l.css("direction")}},reset:function(){T.remove.visible(),u.preserve?void 0!==V.fn.transition&&p.transition("remove transition"):T.removePopup()},setting:function(e,t){if(V.isPlainObject(e))V.extend(!0,u,e);else{if(void 0===t)return u[e];u[e]=t}},internal:function(e,t){if(V.isPlainObject(e))V.extend(!0,T,e);else{if(void 0===t)return T[e];T[e]=t}},debug:function(){!u.silent&&u.debug&&(u.performance?T.performance.log(arguments):(T.debug=Function.prototype.bind.call(console.info,console,u.name+":"),T.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?T.performance.log(arguments):(T.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),T.verbose.apply(console,arguments)))},error:function(){u.silent||(T.error=Function.prototype.bind.call(console.error,console,u.name+":"),T.error.apply(console,arguments))},performance:{log:function(e){var t,o;u.performance&&(o=(t=Date.now())-(O||t),O=t,j.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:P,"Execution Time":o})),clearTimeout(T.performance.timer),T.performance.timer=setTimeout(T.performance.display,500)},display:function(){var e=u.name+":",o=0;O=!1,clearTimeout(T.performance.timer),V.each(j,function(e,t){o+=t["Execution Time"]}),e+=" "+o+"ms",0<j.length&&(console.groupCollapsed(e),console.table?console.table(j):V.each(j,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(n,e,t){var i,r,o,a=C;return e=e||H,t=t||P,"string"==typeof n&&void 0!==a&&(n=n.split(/[ .]/),i=n.length-1,V.each(n,function(e,t){var o=e!==i?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(V.isPlainObject(a[o])&&e!==i)a=a[o];else{if(void 0!==a[o])return r=a[o],!1;{if(!V.isPlainObject(a[t])||e===i)return void 0!==a[t]?r=a[t]:T.error(d.method,n),!1;a=a[t]}}})),z(r)?o=r.apply(t,e):void 0!==r&&(o=r),Array.isArray(E)?E.push(o):void 0!==E?E=[E,o]:void 0!==o&&(E=o),r}};R?(void 0===C&&T.initialize(),T.invoke(F)):(void 0!==C&&C.invoke("destroy"),T.initialize())}),void 0!==E?E:this},V.fn.popup.settings={name:"Popup",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"popup",observeChanges:!0,onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onUnplaceable:function(){},onHidden:function(){},on:"hover",boundary:W,addTouchEvents:!0,position:"top left",forcePosition:!1,variation:"",movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,content:!1,html:!1,title:!1,closable:!0,hideOnScroll:"auto",exclusive:!1,context:"body",scrollContext:W,prefer:"opposite",lastResort:!1,arrowPixelsFromEdge:20,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,jitter:2,offset:0,maxSearchDepth:15,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"Popup does not fit within the boundaries of the viewport",method:"The method you called is not defined.",noElement:"This module requires ui {element}",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",basic:"basic",animating:"animating",dropdown:"dropdown",invisible:"invisible",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible",popupVisible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(e){var t={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return t[e]}):e},popup:function(e){var t="",o=V.fn.popup.settings.templates.escape;return void 0!==e&&(e.title&&(e.title=o(e.title),t+='<div class="header">'+e.title+"</div>"),e.content&&(e.content=o(e.content),t+='<div class="content">'+e.content+"</div>")),t}}}}(jQuery,window,document);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.3-beta.
|
2
|
+
* # Fomantic-UI 2.9.3-beta.3+880333c - Progress
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -23,8 +23,6 @@
|
|
23
23
|
var
|
24
24
|
$allModules = $(this),
|
25
25
|
|
26
|
-
moduleSelector = $allModules.selector || '',
|
27
|
-
|
28
26
|
time = Date.now(),
|
29
27
|
performance = [],
|
30
28
|
|
@@ -806,9 +804,6 @@
|
|
806
804
|
totalTime += data['Execution Time'];
|
807
805
|
});
|
808
806
|
title += ' ' + totalTime + 'ms';
|
809
|
-
if (moduleSelector) {
|
810
|
-
title += ' \'' + moduleSelector + '\'';
|
811
|
-
}
|
812
807
|
if (performance.length > 0) {
|
813
808
|
console.groupCollapsed(title);
|
814
809
|
if (console.table) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.3-beta.
|
2
|
+
* # Fomantic UI - 2.9.3-beta.3+880333c
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(P,e,C){"use strict";e=void 0!==e&&e.Math===Math?e:globalThis,P.fn.progress=function(m){var b,e=P(this),h=e.selector||"",x=Date.now(),y=[],w=m,V="string"==typeof w,A=[].slice.call(arguments,1);return e.each(function(){var i=P.isPlainObject(m)?P.extend(!0,{},P.fn.progress.settings,m):P.extend({},P.fn.progress.settings),r=i.className,t=i.metadata,e=i.namespace,n=i.selector,l=i.error,a="."+e,o="module-"+e,c=P(this),u=P(this).find(n.bar),s=P(this).find(n.progress),d=P(this).find(n.label),p=this,v=c.data(o),g=!1,f={helper:{sum:function(e){return Array.isArray(e)?e.reduce(function(e,t){return e+Number(t)},0):0},derivePrecision:function(e,t){for(var r=0,n=1,a=e/t;r<10&&!(1<(a*=n));)n=Math.pow(10,r++);return n},forceArray:function(e){return Array.isArray(e)?e:isNaN(e)?"string"==typeof e?e.split(","):[]:[e]}},initialize:function(){f.set.duration(),f.debug(p),f.read.metadata(),f.read.settings(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of progress",f),v=f,c.data(o,f)},destroy:function(){f.verbose("Destroying previous progress for",c),clearInterval(v.interval),f.remove.state(),c.removeData(o),v=void 0},reset:function(){f.remove.nextValue(),f.update.progress(0)},complete:function(e){(void 0===f.percent||f.percent<100)&&(f.remove.progressPoll(),!0!==e&&f.set.percent(100))},read:{metadata:function(){var e={percent:f.helper.forceArray(c.data(t.percent)),total:c.data(t.total),value:f.helper.forceArray(c.data(t.value))};void 0!==e.total&&(f.debug("Total value set from metadata",e.total),f.set.total(e.total)),0<e.value.length&&(f.debug("Current value set from metadata",e.value),f.set.value(e.value),f.set.progress(e.value)),0<e.percent.length&&(f.debug("Current percent value set from metadata",e.percent),f.set.percent(e.percent))},settings:function(){!1!==i.total&&(f.debug("Current total set in settings",i.total),f.set.total(i.total)),!1!==i.value&&(f.debug("Current value set in settings",i.value),f.set.value(i.value),f.set.progress(f.value)),!1!==i.percent&&(f.debug("Current percent set in settings",i.percent),f.set.percent(i.percent))}},bind:{transitionEnd:function(t){u.one("transitionend"+a,function(e){clearTimeout(f.failSafeTimer),t.call(this,e)}),f.failSafeTimer=setTimeout(function(){u.triggerHandler("transitionend")},i.duration+i.failSafeDelay),f.verbose("Adding fail safe timer",f.timer)}},increment:function(e){var t;e=f.has.total()?(t=f.get.value(),e||1):(t=f.get.percent(),e||f.get.randomValue()),f.debug("Incrementing percentage by",t,t=t+e,e),t=f.get.normalizedValue(t),f.set.progress(t)},decrement:function(e){var t,r;f.get.total()?(r=(t=f.get.value())-(e=e||1),f.debug("Decrementing value by",e,t)):(r=(t=f.get.percent())-(e=e||f.get.randomValue()),f.debug("Decrementing percentage by",e,t)),r=f.get.normalizedValue(r),f.set.progress(r)},has:{progressPoll:function(){return f.progressPoll},total:function(){return!1!==f.get.total()}},get:{text:function(e,t){var r=f.get.value(t=t||0),n=f.get.total(),a=g?f.get.displayPercent(t):f.get.percent(t),o=!1!==n?Math.max(0,n-r):100-a;return e=(e=e||"").replace("{value}",r).replace("{total}",n||0).replace("{left}",o).replace("{percent}",a).replace("{bar}",i.text.bars[t]||""),f.verbose("Adding variables to progress bar text",e),e},normalizedValue:function(e){if(e<0)return f.debug("Value cannot decrement below 0"),0;if(f.has.total()){if(e>f.total)return f.debug("Value cannot increment above total",f.total),f.total}else if(100<e)return f.debug("Value cannot increment above 100 percent"),100;return e},updateInterval:function(){return"auto"===i.updateInterval?i.duration:i.updateInterval},randomValue:function(){return f.debug("Generating random increment percentage"),Math.floor(Math.random()*i.random.max+i.random.min)},numericValue:function(e){return"string"==typeof e?""!==e.replace(/[^\d.]/g,"")&&+e.replace(/[^\d.]/g,""):e},displayPercent:function(e){var e=P(u[e]),t=e.width(),r=c.width(),e=parseInt(e.css("min-width"),10)<t?t/r*100:f.percent;return 0<i.precision?Math.round(e*(10*i.precision))/(10*i.precision):Math.round(e)},percent:function(e){return f.percent&&f.percent[e||0]||0},value:function(e){return f.nextValue||f.value&&f.value[e||0]||0},total:function(){return void 0!==f.total&&f.total}},create:{progressPoll:function(){f.progressPoll=setTimeout(function(){f.update.toNextValue(),f.remove.progressPoll()},f.get.updateInterval())}},is:{complete:function(){return f.is.success()||f.is.warning()||f.is.error()},success:function(){return c.hasClass(r.success)},warning:function(){return c.hasClass(r.warning)},error:function(){return c.hasClass(r.error)},active:function(){return c.hasClass(r.active)},visible:function(){return c.is(":visible")}},remove:{progressPoll:function(){f.verbose("Removing progress poll timer"),f.progressPoll&&(clearTimeout(f.progressPoll),delete f.progressPoll)},nextValue:function(){f.verbose("Removing progress value stored for next update"),delete f.nextValue},state:function(){f.verbose("Removing stored state"),delete f.total,delete f.percent,delete f.value},active:function(){f.verbose("Removing active state"),c.removeClass(r.active)},success:function(){f.verbose("Removing success state"),c.removeClass(r.success)},warning:function(){f.verbose("Removing warning state"),c.removeClass(r.warning)},error:function(){f.verbose("Removing error state"),c.removeClass(r.error)}},set:{barWidth:function(e){f.debug("set bar width with ",e),e=f.helper.forceArray(e);var a=-1,o=-1,i=f.helper.sum(e),s=u.length,l=1<s,t=e.map(function(e,t){var r=t===s-1&&0===i,n=P(u[t]);return 0===e&&l&&!r?n.css("display","none"):(l&&r&&n.css("background","transparent"),-1===a&&(a=t),o=t,n.css({display:"block",width:e+"%"})),parseFloat(e)});e.forEach(function(e,t){P(u[t]).css({borderTopLeftRadius:t===a?"":"0",borderBottomLeftRadius:t===a?"":"0",borderTopRightRadius:t===o?"":"0",borderBottomRightRadius:t===o?"":"0"})}),c.attr("data-percent",t)},duration:function(e){e=e||i.duration,f.verbose("Setting progress bar transition duration",e="number"==typeof e?e+"ms":e),u.css({"transition-duration":e})},percent:function(e){e=f.helper.forceArray(e).map(function(e){return e="string"==typeof e?+e.replace("%",""):e,i.limitValues?Math.max(0,Math.min(100,e)):e});var t,r=f.has.total(),n=f.helper.sum(e),a=1<e.length&&r,o=f.helper.sum(f.helper.forceArray(f.value));a&&o>f.total?f.error(l.sumExceedsTotal,o,f.total):!a&&100<n?f.error(l.tooHigh,n):n<0?f.error(l.tooLow,n):(t=0<i.precision?i.precision:a?f.helper.derivePrecision(Math.min.apply(null,f.value),f.total):0,o=e.map(function(e){return 0<t?Math.round(e*(10*t))/(10*t):Math.round(e)}),f.percent=o,r&&(f.value=e.map(function(e){return 0<t?Math.round(e/100*f.total*(10*t))/(10*t):Math.round(e/100*f.total*10)/10})),f.set.barWidth(e),f.set.labelInterval()),i.onChange.call(p,e,f.value,f.total)},labelInterval:function(){clearInterval(f.interval),f.bind.transitionEnd(function(){f.verbose("Bar finished animating, removing continuous label updates"),clearInterval(f.interval),g=!1,f.set.labels()}),g=!0,f.interval=setInterval(function(){P.contains(C.documentElement,p)||(clearInterval(f.interval),g=!1),f.set.labels()},i.framerate)},labels:function(){f.verbose("Setting both bar progress and outer label text"),f.set.barLabel(),f.set.state()},label:function(e){e&&(e=f.get.text(e),f.verbose("Setting label to text",e),d.text(e))},state:function(e){100===(e=void 0!==e?e:f.helper.sum(f.percent))?i.autoSuccess&&1===u.length&&!(f.is.warning()||f.is.error()||f.is.success())?(f.set.success(),f.debug("Automatically triggering success at 100%")):(f.verbose("Reached 100% removing active state"),f.remove.active(),f.remove.progressPoll()):0<e?(f.verbose("Adjusting active progress bar label",e),f.set.active()):(f.remove.active(),f.remove.warning(),f.remove.error(),f.remove.success(),f.set.label(i.text.active))},barLabel:function(r){s.each(function(e,t){t=P(t);void 0!==r?t.text(f.get.text(r,e)):"ratio"===i.label&&f.has.total()?(f.verbose("Adding ratio to bar label"),t.text(f.get.text(i.text.ratio,e))):"percent"===i.label&&(f.verbose("Adding percentage to bar label"),t.text(f.get.text(i.text.percent,e)))})},active:function(e){e=e||i.text.active,f.debug("Setting active state"),i.showActivity&&!f.is.active()&&c.addClass(r.active),f.remove.warning(),f.remove.error(),f.remove.success(),(e=i.onLabelUpdate("active",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onActive.call(p,f.value,f.total)})},success:function(e,t){e=e||i.text.success||i.text.active,f.debug("Setting success state"),c.addClass(r.success),f.remove.active(),f.remove.warning(),f.remove.error(),f.complete(t),e=i.text.success?i.onLabelUpdate("success",e,f.value,f.total):i.onLabelUpdate("active",e,f.value,f.total),f.set.label(e),f.bind.transitionEnd(function(){i.onSuccess.call(p,f.total)})},warning:function(e,t){e=e||i.text.warning,f.debug("Setting warning state"),c.addClass(r.warning),f.remove.active(),f.remove.success(),f.remove.error(),f.complete(t),(e=i.onLabelUpdate("warning",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onWarning.call(p,f.value,f.total)})},error:function(e,t){e=e||i.text.error,f.debug("Setting error state"),c.addClass(r.error),f.remove.active(),f.remove.success(),f.remove.warning(),f.complete(t),(e=i.onLabelUpdate("error",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onError.call(p,f.value,f.total)})},total:function(e){f.total=e},value:function(e){f.value=f.helper.forceArray(e)},progress:function(e){f.has.progressPoll()?(f.debug("Updated within interval, setting next update to use new value",e),f.set.nextValue(e)):(f.debug("First update in progress update interval, immediately updating",e),f.update.progress(e),f.create.progressPoll())},nextValue:function(e){f.nextValue=e}},update:{toNextValue:function(){var e=f.nextValue;e&&(f.debug("Update interval complete using last updated value",e),f.update.progress(e),f.remove.nextValue())},progress:function(e){var r=f.has.total(),e=(r&&f.set.value(e),f.helper.forceArray(e).map(function(e){var t;return!1===(e=f.get.numericValue(e))&&f.error(l.nonNumeric,e),e=f.get.normalizedValue(e),r?(t=0<f.total?e/f.total*100:100,f.debug("Calculating percent complete from total",t)):(t=e,f.debug("Setting value to exact percentage value",t)),t}));f.set.percent(e)}},setting:function(e,t){if(f.debug("Changing setting",e,t),P.isPlainObject(e))P.extend(!0,i,e);else{if(void 0===t)return i[e];P.isPlainObject(i[e])?P.extend(!0,i[e],t):i[e]=t}},internal:function(e,t){if(P.isPlainObject(e))P.extend(!0,f,e);else{if(void 0===t)return f[e];f[e]=t}},debug:function(){!i.silent&&i.debug&&(i.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,i.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!i.silent&&i.verbose&&i.debug&&(i.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,i.name+":"),f.verbose.apply(console,arguments)))},error:function(){i.silent||(f.error=Function.prototype.bind.call(console.error,console,i.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,r;i.performance&&(r=(t=Date.now())-(x||t),x=t,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:p,"Execution Time":r})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var e=i.name+":",r=0;x=!1,clearTimeout(f.performance.timer),P.each(y,function(e,t){r+=t["Execution Time"]}),e+=" "+r+"ms",h&&(e+=" '"+h+"'"),0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):P.each(y,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(n,e,t){var a,o,r,i,s=v;return e=e||A,t=t||p,"string"==typeof n&&void 0!==s&&(n=n.split(/[ .]/),a=n.length-1,P.each(n,function(e,t){var r=e!==a?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(P.isPlainObject(s[r])&&e!==a)s=s[r];else{if(void 0!==s[r])return o=s[r],!1;{if(!P.isPlainObject(s[t])||e===a)return void 0!==s[t]?o=s[t]:f.error(l.method,n),!1;s=s[t]}}})),"function"==typeof(i=o)&&"number"!=typeof i.nodeType?r=o.apply(t,e):void 0!==o&&(r=o),Array.isArray(b)?b.push(r):void 0!==b?b=[b,r]:void 0!==r&&(b=r),o}};V?(void 0===v&&f.initialize(),f.invoke(w)):(void 0!==v&&v.invoke("destroy"),f.initialize())}),void 0!==b?b:this},P.fn.progress.settings={name:"Progress",namespace:"progress",silent:!1,debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,updateInterval:"auto",autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,failSafeDelay:100,onLabelUpdate:function(e,t,r,n){return t},onChange:function(e,t,r){},onSuccess:function(e){},onActive:function(e,t){},onError:function(e,t){},onWarning:function(e,t){},error:{method:"The method you called is not defined.",nonNumeric:"Progress value is non numeric",tooHigh:"Value specified is above 100%",tooLow:"Value specified is below 0%",sumExceedsTotal:"Sum of multiple values exceed total"},regExp:{variable:/{\$*[\da-z]+}/gi},metadata:{percent:"percent",total:"total",value:"value"},selector:{bar:"> .bar",label:"> .label",progress:".bar > .progress"},text:{active:!1,error:!1,success:!1,warning:!1,percent:"{percent}%",ratio:"{value} of {total}",bars:[""]},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document);
|
11
|
+
!function(A,e,P){"use strict";e=void 0!==e&&e.Math===Math?e:globalThis,A.fn.progress=function(m){var b,e=A(this),h=Date.now(),x=[],y=m,w="string"==typeof y,V=[].slice.call(arguments,1);return e.each(function(){var i=A.isPlainObject(m)?A.extend(!0,{},A.fn.progress.settings,m):A.extend({},A.fn.progress.settings),r=i.className,t=i.metadata,e=i.namespace,n=i.selector,l=i.error,a="."+e,o="module-"+e,c=A(this),u=A(this).find(n.bar),s=A(this).find(n.progress),d=A(this).find(n.label),p=this,v=c.data(o),g=!1,f={helper:{sum:function(e){return Array.isArray(e)?e.reduce(function(e,t){return e+Number(t)},0):0},derivePrecision:function(e,t){for(var r=0,n=1,a=e/t;r<10&&!(1<(a*=n));)n=Math.pow(10,r++);return n},forceArray:function(e){return Array.isArray(e)?e:isNaN(e)?"string"==typeof e?e.split(","):[]:[e]}},initialize:function(){f.set.duration(),f.debug(p),f.read.metadata(),f.read.settings(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of progress",f),v=f,c.data(o,f)},destroy:function(){f.verbose("Destroying previous progress for",c),clearInterval(v.interval),f.remove.state(),c.removeData(o),v=void 0},reset:function(){f.remove.nextValue(),f.update.progress(0)},complete:function(e){(void 0===f.percent||f.percent<100)&&(f.remove.progressPoll(),!0!==e&&f.set.percent(100))},read:{metadata:function(){var e={percent:f.helper.forceArray(c.data(t.percent)),total:c.data(t.total),value:f.helper.forceArray(c.data(t.value))};void 0!==e.total&&(f.debug("Total value set from metadata",e.total),f.set.total(e.total)),0<e.value.length&&(f.debug("Current value set from metadata",e.value),f.set.value(e.value),f.set.progress(e.value)),0<e.percent.length&&(f.debug("Current percent value set from metadata",e.percent),f.set.percent(e.percent))},settings:function(){!1!==i.total&&(f.debug("Current total set in settings",i.total),f.set.total(i.total)),!1!==i.value&&(f.debug("Current value set in settings",i.value),f.set.value(i.value),f.set.progress(f.value)),!1!==i.percent&&(f.debug("Current percent set in settings",i.percent),f.set.percent(i.percent))}},bind:{transitionEnd:function(t){u.one("transitionend"+a,function(e){clearTimeout(f.failSafeTimer),t.call(this,e)}),f.failSafeTimer=setTimeout(function(){u.triggerHandler("transitionend")},i.duration+i.failSafeDelay),f.verbose("Adding fail safe timer",f.timer)}},increment:function(e){var t;e=f.has.total()?(t=f.get.value(),e||1):(t=f.get.percent(),e||f.get.randomValue()),f.debug("Incrementing percentage by",t,t=t+e,e),t=f.get.normalizedValue(t),f.set.progress(t)},decrement:function(e){var t,r;f.get.total()?(r=(t=f.get.value())-(e=e||1),f.debug("Decrementing value by",e,t)):(r=(t=f.get.percent())-(e=e||f.get.randomValue()),f.debug("Decrementing percentage by",e,t)),r=f.get.normalizedValue(r),f.set.progress(r)},has:{progressPoll:function(){return f.progressPoll},total:function(){return!1!==f.get.total()}},get:{text:function(e,t){var r=f.get.value(t=t||0),n=f.get.total(),a=g?f.get.displayPercent(t):f.get.percent(t),o=!1!==n?Math.max(0,n-r):100-a;return e=(e=e||"").replace("{value}",r).replace("{total}",n||0).replace("{left}",o).replace("{percent}",a).replace("{bar}",i.text.bars[t]||""),f.verbose("Adding variables to progress bar text",e),e},normalizedValue:function(e){if(e<0)return f.debug("Value cannot decrement below 0"),0;if(f.has.total()){if(e>f.total)return f.debug("Value cannot increment above total",f.total),f.total}else if(100<e)return f.debug("Value cannot increment above 100 percent"),100;return e},updateInterval:function(){return"auto"===i.updateInterval?i.duration:i.updateInterval},randomValue:function(){return f.debug("Generating random increment percentage"),Math.floor(Math.random()*i.random.max+i.random.min)},numericValue:function(e){return"string"==typeof e?""!==e.replace(/[^\d.]/g,"")&&+e.replace(/[^\d.]/g,""):e},displayPercent:function(e){var e=A(u[e]),t=e.width(),r=c.width(),e=parseInt(e.css("min-width"),10)<t?t/r*100:f.percent;return 0<i.precision?Math.round(e*(10*i.precision))/(10*i.precision):Math.round(e)},percent:function(e){return f.percent&&f.percent[e||0]||0},value:function(e){return f.nextValue||f.value&&f.value[e||0]||0},total:function(){return void 0!==f.total&&f.total}},create:{progressPoll:function(){f.progressPoll=setTimeout(function(){f.update.toNextValue(),f.remove.progressPoll()},f.get.updateInterval())}},is:{complete:function(){return f.is.success()||f.is.warning()||f.is.error()},success:function(){return c.hasClass(r.success)},warning:function(){return c.hasClass(r.warning)},error:function(){return c.hasClass(r.error)},active:function(){return c.hasClass(r.active)},visible:function(){return c.is(":visible")}},remove:{progressPoll:function(){f.verbose("Removing progress poll timer"),f.progressPoll&&(clearTimeout(f.progressPoll),delete f.progressPoll)},nextValue:function(){f.verbose("Removing progress value stored for next update"),delete f.nextValue},state:function(){f.verbose("Removing stored state"),delete f.total,delete f.percent,delete f.value},active:function(){f.verbose("Removing active state"),c.removeClass(r.active)},success:function(){f.verbose("Removing success state"),c.removeClass(r.success)},warning:function(){f.verbose("Removing warning state"),c.removeClass(r.warning)},error:function(){f.verbose("Removing error state"),c.removeClass(r.error)}},set:{barWidth:function(e){f.debug("set bar width with ",e),e=f.helper.forceArray(e);var a=-1,o=-1,i=f.helper.sum(e),s=u.length,l=1<s,t=e.map(function(e,t){var r=t===s-1&&0===i,n=A(u[t]);return 0===e&&l&&!r?n.css("display","none"):(l&&r&&n.css("background","transparent"),-1===a&&(a=t),o=t,n.css({display:"block",width:e+"%"})),parseFloat(e)});e.forEach(function(e,t){A(u[t]).css({borderTopLeftRadius:t===a?"":"0",borderBottomLeftRadius:t===a?"":"0",borderTopRightRadius:t===o?"":"0",borderBottomRightRadius:t===o?"":"0"})}),c.attr("data-percent",t)},duration:function(e){e=e||i.duration,f.verbose("Setting progress bar transition duration",e="number"==typeof e?e+"ms":e),u.css({"transition-duration":e})},percent:function(e){e=f.helper.forceArray(e).map(function(e){return e="string"==typeof e?+e.replace("%",""):e,i.limitValues?Math.max(0,Math.min(100,e)):e});var t,r=f.has.total(),n=f.helper.sum(e),a=1<e.length&&r,o=f.helper.sum(f.helper.forceArray(f.value));a&&o>f.total?f.error(l.sumExceedsTotal,o,f.total):!a&&100<n?f.error(l.tooHigh,n):n<0?f.error(l.tooLow,n):(t=0<i.precision?i.precision:a?f.helper.derivePrecision(Math.min.apply(null,f.value),f.total):0,o=e.map(function(e){return 0<t?Math.round(e*(10*t))/(10*t):Math.round(e)}),f.percent=o,r&&(f.value=e.map(function(e){return 0<t?Math.round(e/100*f.total*(10*t))/(10*t):Math.round(e/100*f.total*10)/10})),f.set.barWidth(e),f.set.labelInterval()),i.onChange.call(p,e,f.value,f.total)},labelInterval:function(){clearInterval(f.interval),f.bind.transitionEnd(function(){f.verbose("Bar finished animating, removing continuous label updates"),clearInterval(f.interval),g=!1,f.set.labels()}),g=!0,f.interval=setInterval(function(){A.contains(P.documentElement,p)||(clearInterval(f.interval),g=!1),f.set.labels()},i.framerate)},labels:function(){f.verbose("Setting both bar progress and outer label text"),f.set.barLabel(),f.set.state()},label:function(e){e&&(e=f.get.text(e),f.verbose("Setting label to text",e),d.text(e))},state:function(e){100===(e=void 0!==e?e:f.helper.sum(f.percent))?i.autoSuccess&&1===u.length&&!(f.is.warning()||f.is.error()||f.is.success())?(f.set.success(),f.debug("Automatically triggering success at 100%")):(f.verbose("Reached 100% removing active state"),f.remove.active(),f.remove.progressPoll()):0<e?(f.verbose("Adjusting active progress bar label",e),f.set.active()):(f.remove.active(),f.remove.warning(),f.remove.error(),f.remove.success(),f.set.label(i.text.active))},barLabel:function(r){s.each(function(e,t){t=A(t);void 0!==r?t.text(f.get.text(r,e)):"ratio"===i.label&&f.has.total()?(f.verbose("Adding ratio to bar label"),t.text(f.get.text(i.text.ratio,e))):"percent"===i.label&&(f.verbose("Adding percentage to bar label"),t.text(f.get.text(i.text.percent,e)))})},active:function(e){e=e||i.text.active,f.debug("Setting active state"),i.showActivity&&!f.is.active()&&c.addClass(r.active),f.remove.warning(),f.remove.error(),f.remove.success(),(e=i.onLabelUpdate("active",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onActive.call(p,f.value,f.total)})},success:function(e,t){e=e||i.text.success||i.text.active,f.debug("Setting success state"),c.addClass(r.success),f.remove.active(),f.remove.warning(),f.remove.error(),f.complete(t),e=i.text.success?i.onLabelUpdate("success",e,f.value,f.total):i.onLabelUpdate("active",e,f.value,f.total),f.set.label(e),f.bind.transitionEnd(function(){i.onSuccess.call(p,f.total)})},warning:function(e,t){e=e||i.text.warning,f.debug("Setting warning state"),c.addClass(r.warning),f.remove.active(),f.remove.success(),f.remove.error(),f.complete(t),(e=i.onLabelUpdate("warning",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onWarning.call(p,f.value,f.total)})},error:function(e,t){e=e||i.text.error,f.debug("Setting error state"),c.addClass(r.error),f.remove.active(),f.remove.success(),f.remove.warning(),f.complete(t),(e=i.onLabelUpdate("error",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onError.call(p,f.value,f.total)})},total:function(e){f.total=e},value:function(e){f.value=f.helper.forceArray(e)},progress:function(e){f.has.progressPoll()?(f.debug("Updated within interval, setting next update to use new value",e),f.set.nextValue(e)):(f.debug("First update in progress update interval, immediately updating",e),f.update.progress(e),f.create.progressPoll())},nextValue:function(e){f.nextValue=e}},update:{toNextValue:function(){var e=f.nextValue;e&&(f.debug("Update interval complete using last updated value",e),f.update.progress(e),f.remove.nextValue())},progress:function(e){var r=f.has.total(),e=(r&&f.set.value(e),f.helper.forceArray(e).map(function(e){var t;return!1===(e=f.get.numericValue(e))&&f.error(l.nonNumeric,e),e=f.get.normalizedValue(e),r?(t=0<f.total?e/f.total*100:100,f.debug("Calculating percent complete from total",t)):(t=e,f.debug("Setting value to exact percentage value",t)),t}));f.set.percent(e)}},setting:function(e,t){if(f.debug("Changing setting",e,t),A.isPlainObject(e))A.extend(!0,i,e);else{if(void 0===t)return i[e];A.isPlainObject(i[e])?A.extend(!0,i[e],t):i[e]=t}},internal:function(e,t){if(A.isPlainObject(e))A.extend(!0,f,e);else{if(void 0===t)return f[e];f[e]=t}},debug:function(){!i.silent&&i.debug&&(i.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,i.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!i.silent&&i.verbose&&i.debug&&(i.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,i.name+":"),f.verbose.apply(console,arguments)))},error:function(){i.silent||(f.error=Function.prototype.bind.call(console.error,console,i.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,r;i.performance&&(r=(t=Date.now())-(h||t),h=t,x.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:p,"Execution Time":r})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var e=i.name+":",r=0;h=!1,clearTimeout(f.performance.timer),A.each(x,function(e,t){r+=t["Execution Time"]}),e+=" "+r+"ms",0<x.length&&(console.groupCollapsed(e),console.table?console.table(x):A.each(x,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),x=[]}},invoke:function(n,e,t){var a,o,r,i,s=v;return e=e||V,t=t||p,"string"==typeof n&&void 0!==s&&(n=n.split(/[ .]/),a=n.length-1,A.each(n,function(e,t){var r=e!==a?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(A.isPlainObject(s[r])&&e!==a)s=s[r];else{if(void 0!==s[r])return o=s[r],!1;{if(!A.isPlainObject(s[t])||e===a)return void 0!==s[t]?o=s[t]:f.error(l.method,n),!1;s=s[t]}}})),"function"==typeof(i=o)&&"number"!=typeof i.nodeType?r=o.apply(t,e):void 0!==o&&(r=o),Array.isArray(b)?b.push(r):void 0!==b?b=[b,r]:void 0!==r&&(b=r),o}};w?(void 0===v&&f.initialize(),f.invoke(y)):(void 0!==v&&v.invoke("destroy"),f.initialize())}),void 0!==b?b:this},A.fn.progress.settings={name:"Progress",namespace:"progress",silent:!1,debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,updateInterval:"auto",autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,failSafeDelay:100,onLabelUpdate:function(e,t,r,n){return t},onChange:function(e,t,r){},onSuccess:function(e){},onActive:function(e,t){},onError:function(e,t){},onWarning:function(e,t){},error:{method:"The method you called is not defined.",nonNumeric:"Progress value is non numeric",tooHigh:"Value specified is above 100%",tooLow:"Value specified is below 0%",sumExceedsTotal:"Sum of multiple values exceed total"},regExp:{variable:/{\$*[\da-z]+}/gi},metadata:{percent:"percent",total:"total",value:"value"},selector:{bar:"> .bar",label:"> .label",progress:".bar > .progress"},text:{active:!1,error:!1,success:!1,warning:!1,percent:"{percent}%",ratio:"{value} of {total}",bars:[""]},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document);
|
package/dist/components/rail.css
CHANGED