fomantic-ui 2.10.0-beta.4 → 2.10.0-beta.5
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/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +1 -1
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +1 -1
- package/dist/components/api.min.js +1 -1
- 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 +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +1 -1
- 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 -1
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +1 -1
- 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 -1
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +1 -1
- 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 +30 -26
- 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 -1
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +1 -1
- 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 +6 -6
- 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 +1 -1
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +1 -1
- 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 +6 -6
- 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 +1 -1
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +1 -1
- 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 +1 -1
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +1 -1
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +1 -1
- 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 -1
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +1 -1
- 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 +21 -19
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +1 -1
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +1 -1
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +1 -1
- 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 -1
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +1 -1
- package/dist/components/state.js +1 -1
- package/dist/components/state.min.js +1 -1
- 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 +1 -1
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +1 -1
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +1 -1
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +1 -1
- 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 +8 -8
- 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 -1
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +1 -1
- package/dist/components/visibility.js +1 -1
- package/dist/components/visibility.min.js +1 -1
- package/dist/semantic.css +53 -53
- package/dist/semantic.js +92 -86
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/src/definitions/modules/dropdown.js +29 -25
- package/src/definitions/modules/flyout.js +5 -5
- package/src/definitions/modules/modal.js +5 -5
- package/src/definitions/modules/search.js +20 -18
- package/src/definitions/modules/toast.js +7 -7
- package/types/fomantic-ui-dropdown.d.ts +49 -0
- package/types/fomantic-ui-search.d.ts +6 -6
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.10.0-beta.
|
2
|
+
* # Fomantic UI - 2.10.0-beta.5+789e0d0
|
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(Q,W,U){"use strict";function _(e){return"function"==typeof e&&"number"!=typeof e.nodeType}W=void 0!==W&&W.Math===Math?W:globalThis,Q.fn.flyout=function(D){var N,e=Q(this),L=Q(W),O=Q(U),B=(Q("html"),Q("head")),z=Q("body"),R=Date.now(),q=[],I=D,j="string"==typeof I,K=[].slice.call(arguments,1),V=function(e,t){var n;return 0<=[W,U].indexOf(e)?n=z:0===(n=Q(t.document).find(e)).length&&(n=t.frameElement?V(e,t.parent):z),n};return e.each(function(){var n,e,o,s,t,i,r,l=Q.isPlainObject(D)?Q.extend(!0,{},Q.fn.flyout.settings,D):Q.extend({},Q.fn.flyout.settings),c=l.selector,a=l.className,u=l.namespace,d=l.fields,f=l.regExp,h=l.error,g="."+u,p="module-"+u,v=Q(this),m=V(l.context,W),b=v.find(c.close),y=v.children(c.flyout),k=m.children(c.pusher),x=v.hasClass("flyout"),S=this,A=x?v.data(p):void 0,w=!1,C=m[0]===z[0],T="",F="",H=!1,M=!1,P=!1,E={initialize:function(){var s;E.debug("Initializing flyout",D),E.create.id(),x||(E.create.flyout(),_(l.onHidden)||(l.onHidden=function(){E.destroy(),v.remove()}),l.autoShow||(l.autoShow=!0)),v.addClass(l.class),""!==l.title&&v.find(c.header).html(E.helpers.escape(l.title,l.preserveHTML)).addClass(l.classTitle),""!==l.content&&v.find(c.content).html(E.helpers.escape(l.content,l.preserveHTML)).addClass(l.classContent),E.has.configActions()&&(0===(s=v.find(c.actions).addClass(l.classActions)).length?s=Q("<div/>",{class:a.actions+" "+(l.classActions||"")}).appendTo(v):s.empty(),l.actions.forEach(function(e){var t=e[d.icon]?"<i "+(e[d.text]?'aria-hidden="true"':"")+' class="'+E.helpers.deQuote(e[d.icon])+' icon"></i>':"",n=E.helpers.escape(e[d.text]||"",l.preserveHTML),i=E.helpers.deQuote(e[d.class]||""),o=e[d.click]&&_(e[d.click])?e[d.click]:function(){};s.append(Q("<button/>",{html:t+n,"aria-label":(e[d.text]||e[d.icon]||"").replace(/<[^>]+(>|$)/g,""),class:a.button+" "+i,on:{click:function(){!1!==o.call(S,v)&&E.hide()}}}))})),l.delaySetup?requestAnimationFrame(E.setup.layout):E.setup.layout(),requestAnimationFrame(function(){E.setup.cache()}),"left"!==E.get.direction()&&"right"!==E.get.direction()||(E.setup.heights(),E.bind.resize()),E.bind.events(),E.observeChanges(),E.instantiate(),l.autoShow&&E.show()},instantiate:function(){E.verbose("Storing instance of module",E),A=E,v.data(p,A)},create:{flyout:function(){var e;E.verbose("Programmatically create flyout",m),v=Q("<div/>",{class:a.flyout,role:"dialog","aria-modal":l.dimPage}),l.closeIcon&&(b=Q("<i/>",{class:a.close,role:"button",tabindex:0,"aria-label":l.text.close}),v.append(b)),""!==l.title&&(e="_"+E.get.id()+"title",v.attr("aria-labelledby",e),Q("<div/>",{class:a.header,id:e}).appendTo(v)),""!==l.content&&(e="_"+E.get.id()+"desc",v.attr("aria-describedby",e),Q("<div/>",{class:a.content,id:e}).appendTo(v)),E.has.configActions()&&Q("<div/>",{class:a.actions}).appendTo(v),v.prependTo(m),S=v[0]},id:function(){t=(Math.random().toString(16)+"000000000").slice(2,10),s="."+t,E.verbose("Creating unique id for element",t)}},destroy:function(){i&&i.disconnect(),E.verbose("Destroying previous module for",v),v.off(g).removeData(p),b.off(s),n&&n.off(s),m.off(s),L.off(s),O.off(s)},event:{keyboard:function(e){e.which===l.keys.escape&&(l.closable?(E.debug("Escape key pressed hiding flyout"),E.hide()):E.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){E.setup.heights()},focus:function(){M=!0},click:function(e){M&&U.activeElement!==e.target&&E.is.visible()&&l.autofocus&&l.dimPage&&0===Q(U.activeElement).closest(c.flyout).length&&requestAnimationFrame(E.set.autofocus),M=!1},clickaway:function(e){var t;l.closable&&(t=0<k.find(e.target).length||k.is(e.target),e=m.is(e.target),t&&(E.verbose("User clicked on dimmed page"),E.hide()),e&&(E.verbose("User clicked on dimmable context (scaled out page)"),E.hide()))},close:function(e){E.hide()},closeKeyUp:function(e){e=e.which;e!==l.keys.enter&&e!==l.keys.space||E.hide()},inputKeyDown:{first:function(e){e.which===l.keys.tab&&e.shiftKey&&(n.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==l.keys.tab||e.shiftKey||(n.first().trigger("focus"),e.preventDefault())}},approve:function(e){w||!1===l.onApprove.call(E.element,Q(this))?E.verbose("Approve callback returned false cancelling close"):(w=!0,E.hide(function(){w=!1}))},deny:function(e){w||!1===l.onDeny.call(E.element,Q(this))?E.verbose("Deny callback returned false cancelling close"):(w=!0,E.hide(function(){w=!1}))},touch:function(e){},containScroll:function(e){S.scrollTop<=0&&(S.scrollTop=1),S.scrollTop+S.offsetHeight>=S.scrollHeight&&(S.scrollTop=S.scrollHeight-S.offsetHeight-1)},scroll:function(e){0===Q(e.target).closest(c.flyout).length&&e.preventDefault()}},bind:{resize:function(){E.verbose("Adding resize event to window",L),L.on("resize"+s,E.event.resize)},events:function(){E.verbose("Attaching events"),v.on("click"+g,c.close,E.event.close).on("click"+g,c.approve,E.event.approve).on("click"+g,c.deny,E.event.deny),b.on("keyup"+s,E.event.closeKeyUp),L.on("focus"+s,E.event.focus),m.on("click"+s,E.event.click)},clickaway:function(){E.verbose("Adding clickaway events to context",m),m.on("click"+s,E.event.clickaway).on("touchend"+s,E.event.clickaway)},scrollLock:function(){l.scrollLock&&(E.debug("Disabling page scroll"),(H=E.has.scrollbar())&&(E.save.bodyMargin(),E.set.bodyMargin()),m.addClass(a.locked)),E.verbose("Adding events to contain flyout scroll"),O.on("touchmove"+s,E.event.touch),v.on("scroll"+g,E.event.containScroll)}},unbind:{clickaway:function(){E.verbose("Removing clickaway events from context",m),m.off(s)},scrollLock:function(){E.verbose("Removing scroll lock from page"),H&&E.restore.bodyMargin(),m.removeClass(a.locked),O.off(s),v.off("scroll"+g)}},add:{inlineCSS:function(){var e=E.cache.width||v.outerWidth(),t=E.cache.height||v.outerHeight(),n=E.is.rtl(),i=E.get.direction(),t={left:e,right:-e,top:t,bottom:-t};n&&(E.verbose("RTL detected, flipping widths"),t.left=-e,t.right=e),n="<style>","left"===i||"right"===i?(E.debug("Adding CSS rules for animation distance",e),n+=" .ui.visible."+i+".flyout ~ .fixed, .ui.visible."+i+".flyout ~ .pusher { transform: translate3d("+t[i]+"px, 0, 0); }"):"top"!==i&&"bottom"!==i||(n+=" .ui.visible."+i+".flyout ~ .fixed, .ui.visible."+i+".flyout ~ .pusher { transform: translate3d(0, "+t[i]+"px, 0); }"),o=Q(n+="</style>").appendTo(B),E.debug("Adding sizing css to head",o)},keyboardShortcuts:function(){E.verbose("Adding keyboard shortcuts"),O.on("keydown"+g,E.event.keyboard)}},observeChanges:function(){"MutationObserver"in W&&((i=new MutationObserver(function(e){function o(e){for(var t=[],n=0,i=e.length;n<i;n++)Array.prototype.push.apply(t,o(e[n].childNodes)),t.push(e[n]);return t}var n=!1,i=!0;e.every(function(e){var t;return"attributes"===e.type?P&&("disabled"===e.attributeName||0<Q(e.target).find(":input").addBack(":input").filter(":visible").length)&&(n=!0):(t=Q(o(e.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),e=Q(o(e.removedNodes)).filter("a[href], [tabindex], :input"),(0<t.length||0<e.length)&&(n=!0,(0<t.filter(":input").length||0<e.filter(":input").length)&&(i=!1))),!n}),n&&E.refreshInputs(i)})).observe(S,{attributeFilter:["class","disabled"],attributes:!0,childList:!0,subtree:!0}),E.debug("Setting up mutation observer",i))},refresh:function(){E.verbose("Refreshing selector cache"),m=V(l.context,W),E.refreshFlyouts(),k=m.children(c.pusher),E.clear.cache()},refreshFlyouts:function(){E.verbose("Refreshing other flyouts"),y=m.children(c.flyout)},refreshInputs:function(e){n&&n.off("keydown"+s),l.dimPage&&(0===(n=v.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===Q(this).closest(".disabled").length})).filter(":input").length?(n=v.add(n),v.attr("tabindex",-1)):v.removeAttr("tabindex"),n.first().on("keydown"+s,E.event.inputKeyDown.first),n.last().on("keydown"+s,E.event.inputKeyDown.last),!e&&l.autofocus&&0===n.filter(":focus").length&&E.set.autofocus())},setup:{cache:function(){E.cache={width:v.outerWidth(),height:v.outerHeight()}},layout:function(){0===m.children(c.pusher).length&&(E.debug("Adding wrapper element for flyout"),E.error(h.pusher),k=Q('<div class="pusher" />'),m.children().not(c.omitted).not(y).wrapAll(k),E.refresh()),0!==v.nextAll(c.pusher).length&&v.nextAll(c.pusher)[0]===k[0]||(E.debug("Moved flyout to correct parent element"),E.error(h.movedFlyout,S),v.detach().prependTo(m),E.refresh()),E.is.mobile()&&v.addClass(a.fullscreen),E.clear.cache(),E.set.pushable(),E.set.direction()},heights:function(){E.debug("Setting up heights",v);var e=v.children(c.header),t=v.children(c.content),n=v.children(c.actions),e=(m.height()||0)-(e.outerHeight()||0)-(n.outerHeight()||0);0<e&&t.css("min-height",String(e)+"px")}},attachEvents:function(e,t){var n=Q(e);t=_(E[t])?E[t]:E.toggle,0<n.length?(E.debug("Attaching flyout events to element",e,t),n.on("click"+g,t)):E.error(h.notFound,e)},show:function(e){e=_(e)?e:function(){},E.is.hidden()?!1===l.onShow.call(S)?E.verbose("Show callback returned false cancelling show"):(E.refresh(),E.othersActive()&&(E.debug("Other flyouts currently visible"),l.exclusive?E.hideOthers():w=!1),E.set.dimmerStyles(),E.set.observeAttributes(!1),E.pushPage(function(){e.call(S),l.onVisible.call(S),l.keyboardShortcuts&&E.add.keyboardShortcuts(),E.save.focus(),E.refreshInputs(),requestAnimationFrame(E.set.observeAttributes)}),l.onChange.call(S)):E.debug("Flyout is already visible")},hide:function(e){if(e=_(e)?e:function(){},!1===l.onHide.call(S,Q(this)))return E.verbose("Hide callback returned false cancelling hide"),w=!1;(E.is.visible()||E.is.animating())&&(E.debug("Hiding flyout",e),E.refreshFlyouts(),E.set.observeAttributes(!1),E.pullPage(function(){e.call(S),_(l.onHidden)&&l.onHidden.call(S),E.restore.focus()}),l.onChange.call(S))},othersAnimating:function(){return 0<y.not(v).filter("."+a.animating).length},othersVisible:function(){return 0<y.not(v).filter("."+a.visible).length},othersActive:function(){return E.othersVisible()||E.othersAnimating()},hideOthers:function(e){var t=y.not(v).filter("."+a.visible),n=t.length,i=0;e=e||function(){},t.flyout("hide",function(){++i===n&&e()})},toggle:function(){E.verbose("Determining toggled direction"),E.is.hidden()?E.show():E.hide()},pushPage:function(t){var e,n,i;t=_(t)?t:function(){},E.set.overlay(),l.returnScroll&&(r=(C?L:m).scrollTop()),E.bind.scrollLock(),e=function(){E.bind.clickaway(),E.add.inlineCSS(),E.set.animating(),E.set.visible()},n=function(){E.set.dimmed()},i=function(e){e.target===v[0]&&(v.off("transitionend"+s,i),E.remove.animating(),t.call(S))},v.off("transitionend"+s),v.on("transitionend"+s,i),requestAnimationFrame(e),l.dimPage&&!E.othersVisible()&&requestAnimationFrame(n)},pullPage:function(t){var e,n;t=_(t)?t:function(){},E.verbose("Removing context push state",E.get.direction()),E.unbind.clickaway(),E.othersActive()||(E.unbind.scrollLock(),l.keyboardShortcuts&&E.remove.keyboardShortcuts()),e=function(){E.set.overlay(),E.set.animating(),l.dimPage&&!E.othersVisible()&&E.set.closing(),E.remove.visible()},n=function(e){e.target===v[0]&&(v.off("transitionend"+s,n),E.remove.animating(),E.remove.closing(),E.remove.overlay(),E.remove.inlineCSS(),l.returnScroll&&E.scrollBack(),l.dimPage&&!E.othersVisible()&&k.removeClass(a.dimmed),t.call(S))},v.off("transitionend"+s),v.on("transitionend"+s,n),requestAnimationFrame(e)},scrollToTop:function(){E.verbose("Scrolling to top of page to avoid animation issues"),v.scrollTop(0),(C?L:m)[0].scrollTo(0,0)},scrollBack:function(){E.verbose("Scrolling back to original page position"),(C?L:m)[0].scrollTo(0,r)},clear:{cache:function(){E.verbose("Clearing cached dimensions"),E.cache={}}},set:{observeAttributes:function(e){P=!1!==e},autofocus:function(){var e=n.filter("[autofocus]"),t=n.filter(":input");(0<e.length?e:0<t.length?t:v).first().trigger("focus")},dimmerStyles:function(){l.blurring?k.addClass(a.blurring):k.removeClass(a.blurring)},bodyMargin:function(){var n=E.can.leftBodyScrollbar()?"left":"right";m.css((C?"margin-":"padding-")+n,F+"px"),m.find(c.bodyFixed.replace("right",n)).each(function(){var e=Q(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"calc("+e.css(t)+" + "+F+"px)")})},pushed:function(){m.addClass(a.pushed)},pushable:function(){m.addClass(a.pushable)},dimmed:function(){k.addClass(a.dimmed)},active:function(){v.addClass(a.active)},animating:function(){v.addClass(a.animating)},closing:function(){k.addClass(a.closing)},direction:function(e){e=e||E.get.direction(),v.addClass(a[e])},visible:function(){v.addClass(a.visible)},overlay:function(){v.addClass(a.overlay)}},remove:{inlineCSS:function(){E.debug("Removing inline css styles",o),o&&0<o.length&&o.remove()},keyboardShortcuts:function(){E.verbose("Removing keyboard shortcuts"),O.off("keydown"+g)},pushed:function(){m.removeClass(a.pushed)},pushable:function(){m.removeClass(a.pushable)},active:function(){v.removeClass(a.active)},animating:function(){v.removeClass(a.animating)},closing:function(){k.removeClass(a.closing)},direction:function(e){e=e||E.get.direction(),v.removeClass(a[e])},visible:function(){v.removeClass(a.visible)},overlay:function(){v.removeClass(a.overlay)}},get:{direction:function(){return v.hasClass(a.top)?a.top:v.hasClass(a.right)?a.right:v.hasClass(a.bottom)?a.bottom:a.left},id:function(){return t},element:function(){return v},settings:function(){return l}},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.cache.leftBodyScrollbar}},save:{focus:function(){0<Q(U.activeElement).closest(v).length||(e=Q(U.activeElement).trigger("blur"))},bodyMargin:function(){T=m.css((C?"margin-":"padding-")+(E.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(T.replace(/[^\d.]/g,""),10),t=C?W.innerWidth-U.documentElement.clientWidth:m[0].offsetWidth-m[0].clientWidth;F=e+t}},is:{safari:function(){return void 0===E.cache.isSafari&&(E.cache.isSafari=/constructor/i.test(W.HTMLElement)||!!W.ApplePaySession),E.cache.isSafari},firefox:function(){return void 0===E.cache.isFirefox&&(E.cache.isFirefox=!!W.InstallTrigger),E.cache.isFirefox},iframe:function(){return!(self===top)},mobile:function(){var e=navigator.userAgent;return e.match(f.mobile)?(E.verbose("Browser was found to be mobile",e),!0):(E.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!E.is.visible()},visible:function(){return v.hasClass(a.visible)},animating:function(){return m.hasClass(a.animating)},rtl:function(){return void 0===E.cache.isRTL&&(E.cache.isRTL="rtl"===v.attr("dir")||"rtl"===v.css("direction")||"rtl"===z.attr("dir")||"rtl"===z.css("direction")||"rtl"===m.attr("dir")||"rtl"===m.css("direction")),E.cache.isRTL}},has:{configActions:function(){return Array.isArray(l.actions)&&0<l.actions.length},scrollbar:function(){return C||"hidden"!==m.css("overflow-y")}},restore:{focus:function(){e&&0<e.length&&l.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var n=E.can.leftBodyScrollbar()?"left":"right";m.css((C?"margin-":"padding-")+n,T),m.find(c.bodyFixed.replace("right",n)).each(function(){var e=Q(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"")})}},helpers:{deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var n={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return n[e]}):e}},setting:function(e,t){if(E.debug("Changing setting",e,t),Q.isPlainObject(e))Q.extend(!0,l,e);else{if(void 0===t)return l[e];Q.isPlainObject(l[e])?Q.extend(!0,l[e],t):l[e]=t}},internal:function(e,t){if(Q.isPlainObject(e))Q.extend(!0,E,e);else{if(void 0===t)return E[e];E[e]=t}},debug:function(){!l.silent&&l.debug&&(l.performance?E.performance.log(arguments):(E.debug=Function.prototype.bind.call(console.info,console,l.name+":"),E.debug.apply(console,arguments)))},verbose:function(){!l.silent&&l.verbose&&l.debug&&(l.performance?E.performance.log(arguments):(E.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),E.verbose.apply(console,arguments)))},error:function(){l.silent||(E.error=Function.prototype.bind.call(console.error,console,l.name+":"),E.error.apply(console,arguments))},performance:{log:function(e){var t,n;l.performance&&(n=(t=Date.now())-(R||t),R=t,q.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(E.performance.timer),E.performance.timer=setTimeout(function(){E.performance.display()},500)},display:function(){var e=l.name+":",n=0;R=!1,clearTimeout(E.performance.timer),Q.each(q,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",0<q.length&&(console.groupCollapsed(e),console.table?console.table(q):Q.each(q,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),q=[]}},invoke:function(i,e,t){var o,s,n,r=A;return e=e||K,t=S||t,"string"==typeof i&&void 0!==r&&(i=i.split(/[ .]/),o=i.length-1,Q.each(i,function(e,t){var n=e!==o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(Q.isPlainObject(r[n])&&e!==o)r=r[n];else{if(void 0!==r[n])return s=r[n],!1;{if(!Q.isPlainObject(r[t])||e===o)return void 0!==r[t]?s=r[t]:E.error(h.method,i),!1;r=r[t]}}})),_(s)?n=s.apply(t,e):void 0!==s&&(n=s),Array.isArray(N)?N.push(n):void 0!==N?N=[N,n]:void 0!==n&&(N=n),s}};j?(void 0===A&&(_(l.templates[I])&&(l.autoShow=!0,l.className.flyout=l.className.template,l=Q.extend(!0,{},l,l.templates[I].apply(E,K)),a=l.className,l.namespace,d=l.fields,h=l.error),E.initialize()),_(l.templates[I])||E.invoke(I)):(void 0!==A&&A.invoke("destroy"),E.initialize(),N=v)}),void 0!==N?N:this},Q.flyout=Q.fn.flyout,Q.fn.flyout.settings={name:"Flyout",namespace:"flyout",silent:!1,debug:!1,verbose:!1,performance:!0,context:"body",exclusive:!1,closable:!0,autofocus:!0,restoreFocus:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,autoShow:!1,keyboardShortcuts:!0,title:"",content:"",class:"",classTitle:"",classContent:"",classActions:"",closeIcon:!1,actions:!1,preserveHTML:!1,fields:{class:"class",text:"text",icon:"icon",click:"click"},onChange:function(){},onShow:function(){},onHide:function(){return!0},onHidden:!1,onVisible:function(){},onApprove:function(){},onDeny:function(){},keys:{space:32,enter:13,escape:27,tab:9},className:{flyout:"ui flyout",close:"close icon",header:"ui header",content:"content",actions:"actions",active:"active",animating:"animating",blurring:"blurring",closing:"closing",dimmed:"dimmed",locked:"locked",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible",overlay:"overlay",fullscreen:"fullscreen",template:"ui flyout",button:"ui button",ok:"positive",cancel:"negative",prompt:"ui fluid input"},selector:{bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.right.flyout, > .ui.fixed.nag, > .ui.fixed.nag > .close",fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",flyout:".ui.flyout",header:".ui.header",content:".content",actions:".actions",close:".close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel"},regExp:{mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedFlyout:"Had to move flyout. For optimal performance make sure flyout and pusher are direct children of your body tag",notFound:"There were no elements that matched the specified selector"},text:{ok:"Ok",cancel:"Cancel",close:"Close"}},Q.fn.flyout.settings.templates={getArguments:function(e){e=[].slice.call(e);return Q.isPlainObject(e[0])?Q.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);return{title:t.title,content:t.content,actions:[{text:e.text.ok,class:e.className.ok,click:t.handler}]}},confirm:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments);return{title:t.title,content:t.content,actions:[{text:e.text.ok,class:e.className.ok,click:function(){t.handler(!0)}},{text:e.text.cancel,class:e.className.cancel,click:function(){t.handler(!1)}}]}},prompt:function(){var t=this,e=this.get.settings(),n=e.templates.getArguments(arguments);return 0===Q(Q.parseHTML(n.content)).filter(".ui.input").length&&(n.content+='<p><div class="'+e.className.prompt+'"><input placeholder="'+this.helpers.deQuote(n.placeholder||"")+'" type="text" value="'+this.helpers.deQuote(n.defaultValue||"")+'"></div></p>'),{title:n.title,content:n.content,actions:[{text:e.text.ok,class:e.className.ok,click:function(){var e=t.get.settings(),e=t.get.element().find(e.selector.prompt)[0];n.handler(Q(e).val())}},{text:e.text.cancel,class:e.className.cancel,click:function(){n.handler(null)}}]}}}}(jQuery,window,document);
|
11
|
+
!function(Q,W,U){"use strict";function _(e){return"function"==typeof e&&"number"!=typeof e.nodeType}W=void 0!==W&&W.Math===Math?W:globalThis,Q.fn.flyout=function(D){var N,e=Q(this),O=Q(W),B=Q(U),L=(Q("html"),Q("head")),z=Q("body"),R=Date.now(),q=[],I=D,j="string"==typeof I,K=[].slice.call(arguments,1),V=function(e,t){var n;return 0<=[W,U].indexOf(e)?n=z:0===(n=Q(t.document).find(e)).length&&(n=t.frameElement?V(e,t.parent):z),n};return e.each(function(){var n,e,o,s,t,i,r,l=Q.isPlainObject(D)?Q.extend(!0,{},Q.fn.flyout.settings,D):Q.extend({},Q.fn.flyout.settings),c=l.selector,a=l.className,u=l.namespace,d=l.fields,f=l.regExp,h=l.error,g="."+u,p="module-"+u,v=Q(this),m=V(l.context,W),b=v.find(c.close),y=v.children(c.flyout),k=m.children(c.pusher),x=v.hasClass("flyout"),S=this,A=x?v.data(p):void 0,w=!1,C=m[0]===z[0],T="",F="",H=!1,P=!1,M=!1,E={initialize:function(){var s;E.debug("Initializing flyout",D),E.create.id(),x||(E.create.flyout(),_(l.onHidden)||(l.onHidden=function(){E.destroy(),v.remove()}),l.autoShow||(l.autoShow=!0)),v.addClass(l.class),""!==l.title&&v.find(c.header).html(E.helpers.escape(l.title)).addClass(l.classTitle),""!==l.content&&v.find(c.content).html(E.helpers.escape(l.content)).addClass(l.classContent),E.has.configActions()&&(0===(s=v.find(c.actions).addClass(l.classActions)).length?s=Q("<div/>",{class:a.actions+" "+(l.classActions||"")}).appendTo(v):s.empty(),l.actions.forEach(function(e){var t=e[d.icon]?"<i "+(e[d.text]?'aria-hidden="true"':"")+' class="'+E.helpers.deQuote(e[d.icon])+' icon"></i>':"",n=E.helpers.escape(e[d.text]||""),i=E.helpers.deQuote(e[d.class]||""),o=e[d.click]&&_(e[d.click])?e[d.click]:function(){};s.append(Q("<button/>",{html:t+n,"aria-label":(e[d.text]||e[d.icon]||"").replace(/<[^>]+(>|$)/g,""),class:a.button+" "+i,on:{click:function(){!1!==o.call(S,v)&&E.hide()}}}))})),l.delaySetup?requestAnimationFrame(E.setup.layout):E.setup.layout(),requestAnimationFrame(function(){E.setup.cache()}),"left"!==E.get.direction()&&"right"!==E.get.direction()||(E.setup.heights(),E.bind.resize()),E.bind.events(),E.observeChanges(),E.instantiate(),l.autoShow&&E.show()},instantiate:function(){E.verbose("Storing instance of module",E),A=E,v.data(p,A)},create:{flyout:function(){var e;E.verbose("Programmatically create flyout",m),v=Q("<div/>",{class:a.flyout,role:"dialog","aria-modal":l.dimPage}),l.closeIcon&&(b=Q("<i/>",{class:a.close,role:"button",tabindex:0,"aria-label":l.text.close}),v.append(b)),""!==l.title&&(e="_"+E.get.id()+"title",v.attr("aria-labelledby",e),Q("<div/>",{class:a.header,id:e}).appendTo(v)),""!==l.content&&(e="_"+E.get.id()+"desc",v.attr("aria-describedby",e),Q("<div/>",{class:a.content,id:e}).appendTo(v)),E.has.configActions()&&Q("<div/>",{class:a.actions}).appendTo(v),v.prependTo(m),S=v[0]},id:function(){t=(Math.random().toString(16)+"000000000").slice(2,10),s="."+t,E.verbose("Creating unique id for element",t)}},destroy:function(){i&&i.disconnect(),E.verbose("Destroying previous module for",v),v.off(g).removeData(p),b.off(s),n&&n.off(s),m.off(s),O.off(s),B.off(s)},event:{keyboard:function(e){e.which===l.keys.escape&&(l.closable?(E.debug("Escape key pressed hiding flyout"),E.hide()):E.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){E.setup.heights()},focus:function(){P=!0},click:function(e){P&&U.activeElement!==e.target&&E.is.visible()&&l.autofocus&&l.dimPage&&0===Q(U.activeElement).closest(c.flyout).length&&requestAnimationFrame(E.set.autofocus),P=!1},clickaway:function(e){var t;l.closable&&(t=0<k.find(e.target).length||k.is(e.target),e=m.is(e.target),t&&(E.verbose("User clicked on dimmed page"),E.hide()),e&&(E.verbose("User clicked on dimmable context (scaled out page)"),E.hide()))},close:function(e){E.hide()},closeKeyUp:function(e){e=e.which;e!==l.keys.enter&&e!==l.keys.space||E.hide()},inputKeyDown:{first:function(e){e.which===l.keys.tab&&e.shiftKey&&(n.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==l.keys.tab||e.shiftKey||(n.first().trigger("focus"),e.preventDefault())}},approve:function(e){w||!1===l.onApprove.call(E.element,Q(this))?E.verbose("Approve callback returned false cancelling close"):(w=!0,E.hide(function(){w=!1}))},deny:function(e){w||!1===l.onDeny.call(E.element,Q(this))?E.verbose("Deny callback returned false cancelling close"):(w=!0,E.hide(function(){w=!1}))},touch:function(e){},containScroll:function(e){S.scrollTop<=0&&(S.scrollTop=1),S.scrollTop+S.offsetHeight>=S.scrollHeight&&(S.scrollTop=S.scrollHeight-S.offsetHeight-1)},scroll:function(e){0===Q(e.target).closest(c.flyout).length&&e.preventDefault()}},bind:{resize:function(){E.verbose("Adding resize event to window",O),O.on("resize"+s,E.event.resize)},events:function(){E.verbose("Attaching events"),v.on("click"+g,c.close,E.event.close).on("click"+g,c.approve,E.event.approve).on("click"+g,c.deny,E.event.deny),b.on("keyup"+s,E.event.closeKeyUp),O.on("focus"+s,E.event.focus),m.on("click"+s,E.event.click)},clickaway:function(){E.verbose("Adding clickaway events to context",m),m.on("click"+s,E.event.clickaway).on("touchend"+s,E.event.clickaway)},scrollLock:function(){l.scrollLock&&(E.debug("Disabling page scroll"),(H=E.has.scrollbar())&&(E.save.bodyMargin(),E.set.bodyMargin()),m.addClass(a.locked)),E.verbose("Adding events to contain flyout scroll"),B.on("touchmove"+s,E.event.touch),v.on("scroll"+g,E.event.containScroll)}},unbind:{clickaway:function(){E.verbose("Removing clickaway events from context",m),m.off(s)},scrollLock:function(){E.verbose("Removing scroll lock from page"),H&&E.restore.bodyMargin(),m.removeClass(a.locked),B.off(s),v.off("scroll"+g)}},add:{inlineCSS:function(){var e=E.cache.width||v.outerWidth(),t=E.cache.height||v.outerHeight(),n=E.is.rtl(),i=E.get.direction(),t={left:e,right:-e,top:t,bottom:-t};n&&(E.verbose("RTL detected, flipping widths"),t.left=-e,t.right=e),n="<style>","left"===i||"right"===i?(E.debug("Adding CSS rules for animation distance",e),n+=" .ui.visible."+i+".flyout ~ .fixed, .ui.visible."+i+".flyout ~ .pusher { transform: translate3d("+t[i]+"px, 0, 0); }"):"top"!==i&&"bottom"!==i||(n+=" .ui.visible."+i+".flyout ~ .fixed, .ui.visible."+i+".flyout ~ .pusher { transform: translate3d(0, "+t[i]+"px, 0); }"),o=Q(n+="</style>").appendTo(L),E.debug("Adding sizing css to head",o)},keyboardShortcuts:function(){E.verbose("Adding keyboard shortcuts"),B.on("keydown"+g,E.event.keyboard)}},observeChanges:function(){"MutationObserver"in W&&((i=new MutationObserver(function(e){function o(e){for(var t=[],n=0,i=e.length;n<i;n++)Array.prototype.push.apply(t,o(e[n].childNodes)),t.push(e[n]);return t}var n=!1,i=!0;e.every(function(e){var t;return"attributes"===e.type?M&&("disabled"===e.attributeName||0<Q(e.target).find(":input").addBack(":input").filter(":visible").length)&&(n=!0):(t=Q(o(e.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),e=Q(o(e.removedNodes)).filter("a[href], [tabindex], :input"),(0<t.length||0<e.length)&&(n=!0,(0<t.filter(":input").length||0<e.filter(":input").length)&&(i=!1))),!n}),n&&E.refreshInputs(i)})).observe(S,{attributeFilter:["class","disabled"],attributes:!0,childList:!0,subtree:!0}),E.debug("Setting up mutation observer",i))},refresh:function(){E.verbose("Refreshing selector cache"),m=V(l.context,W),E.refreshFlyouts(),k=m.children(c.pusher),E.clear.cache()},refreshFlyouts:function(){E.verbose("Refreshing other flyouts"),y=m.children(c.flyout)},refreshInputs:function(e){n&&n.off("keydown"+s),l.dimPage&&(0===(n=v.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===Q(this).closest(".disabled").length})).filter(":input").length?(n=v.add(n),v.attr("tabindex",-1)):v.removeAttr("tabindex"),n.first().on("keydown"+s,E.event.inputKeyDown.first),n.last().on("keydown"+s,E.event.inputKeyDown.last),!e&&l.autofocus&&0===n.filter(":focus").length&&E.set.autofocus())},setup:{cache:function(){E.cache={width:v.outerWidth(),height:v.outerHeight()}},layout:function(){0===m.children(c.pusher).length&&(E.debug("Adding wrapper element for flyout"),E.error(h.pusher),k=Q('<div class="pusher" />'),m.children().not(c.omitted).not(y).wrapAll(k),E.refresh()),0!==v.nextAll(c.pusher).length&&v.nextAll(c.pusher)[0]===k[0]||(E.debug("Moved flyout to correct parent element"),E.error(h.movedFlyout,S),v.detach().prependTo(m),E.refresh()),E.is.mobile()&&v.addClass(a.fullscreen),E.clear.cache(),E.set.pushable(),E.set.direction()},heights:function(){E.debug("Setting up heights",v);var e=v.children(c.header),t=v.children(c.content),n=v.children(c.actions),e=(m.height()||0)-(e.outerHeight()||0)-(n.outerHeight()||0);0<e&&t.css("min-height",String(e)+"px")}},attachEvents:function(e,t){var n=Q(e);t=_(E[t])?E[t]:E.toggle,0<n.length?(E.debug("Attaching flyout events to element",e,t),n.on("click"+g,t)):E.error(h.notFound,e)},show:function(e){e=_(e)?e:function(){},E.is.hidden()?!1===l.onShow.call(S)?E.verbose("Show callback returned false cancelling show"):(E.refresh(),E.othersActive()&&(E.debug("Other flyouts currently visible"),l.exclusive?E.hideOthers():w=!1),E.set.dimmerStyles(),E.set.observeAttributes(!1),E.pushPage(function(){e.call(S),l.onVisible.call(S),l.keyboardShortcuts&&E.add.keyboardShortcuts(),E.save.focus(),E.refreshInputs(),requestAnimationFrame(E.set.observeAttributes)}),l.onChange.call(S)):E.debug("Flyout is already visible")},hide:function(e){if(e=_(e)?e:function(){},!1===l.onHide.call(S,Q(this)))return E.verbose("Hide callback returned false cancelling hide"),w=!1;(E.is.visible()||E.is.animating())&&(E.debug("Hiding flyout",e),E.refreshFlyouts(),E.set.observeAttributes(!1),E.pullPage(function(){e.call(S),_(l.onHidden)&&l.onHidden.call(S),E.restore.focus()}),l.onChange.call(S))},othersAnimating:function(){return 0<y.not(v).filter("."+a.animating).length},othersVisible:function(){return 0<y.not(v).filter("."+a.visible).length},othersActive:function(){return E.othersVisible()||E.othersAnimating()},hideOthers:function(e){var t=y.not(v).filter("."+a.visible),n=t.length,i=0;e=e||function(){},t.flyout("hide",function(){++i===n&&e()})},toggle:function(){E.verbose("Determining toggled direction"),E.is.hidden()?E.show():E.hide()},pushPage:function(t){var e,n,i;t=_(t)?t:function(){},E.set.overlay(),l.returnScroll&&(r=(C?O:m).scrollTop()),E.bind.scrollLock(),e=function(){E.bind.clickaway(),E.add.inlineCSS(),E.set.animating(),E.set.visible()},n=function(){E.set.dimmed()},i=function(e){e.target===v[0]&&(v.off("transitionend"+s,i),E.remove.animating(),t.call(S))},v.off("transitionend"+s),v.on("transitionend"+s,i),requestAnimationFrame(e),l.dimPage&&!E.othersVisible()&&requestAnimationFrame(n)},pullPage:function(t){var e,n;t=_(t)?t:function(){},E.verbose("Removing context push state",E.get.direction()),E.unbind.clickaway(),E.othersActive()||(E.unbind.scrollLock(),l.keyboardShortcuts&&E.remove.keyboardShortcuts()),e=function(){E.set.overlay(),E.set.animating(),l.dimPage&&!E.othersVisible()&&E.set.closing(),E.remove.visible()},n=function(e){e.target===v[0]&&(v.off("transitionend"+s,n),E.remove.animating(),E.remove.closing(),E.remove.overlay(),E.remove.inlineCSS(),l.returnScroll&&E.scrollBack(),l.dimPage&&!E.othersVisible()&&k.removeClass(a.dimmed),t.call(S))},v.off("transitionend"+s),v.on("transitionend"+s,n),requestAnimationFrame(e)},scrollToTop:function(){E.verbose("Scrolling to top of page to avoid animation issues"),v.scrollTop(0),(C?O:m)[0].scrollTo(0,0)},scrollBack:function(){E.verbose("Scrolling back to original page position"),(C?O:m)[0].scrollTo(0,r)},clear:{cache:function(){E.verbose("Clearing cached dimensions"),E.cache={}}},set:{observeAttributes:function(e){M=!1!==e},autofocus:function(){var e=n.filter("[autofocus]"),t=n.filter(":input");(0<e.length?e:0<t.length?t:v).first().trigger("focus")},dimmerStyles:function(){l.blurring?k.addClass(a.blurring):k.removeClass(a.blurring)},bodyMargin:function(){var n=E.can.leftBodyScrollbar()?"left":"right";m.css((C?"margin-":"padding-")+n,F+"px"),m.find(c.bodyFixed.replace("right",n)).each(function(){var e=Q(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"calc("+e.css(t)+" + "+F+"px)")})},pushed:function(){m.addClass(a.pushed)},pushable:function(){m.addClass(a.pushable)},dimmed:function(){k.addClass(a.dimmed)},active:function(){v.addClass(a.active)},animating:function(){v.addClass(a.animating)},closing:function(){k.addClass(a.closing)},direction:function(e){e=e||E.get.direction(),v.addClass(a[e])},visible:function(){v.addClass(a.visible)},overlay:function(){v.addClass(a.overlay)}},remove:{inlineCSS:function(){E.debug("Removing inline css styles",o),o&&0<o.length&&o.remove()},keyboardShortcuts:function(){E.verbose("Removing keyboard shortcuts"),B.off("keydown"+g)},pushed:function(){m.removeClass(a.pushed)},pushable:function(){m.removeClass(a.pushable)},active:function(){v.removeClass(a.active)},animating:function(){v.removeClass(a.animating)},closing:function(){k.removeClass(a.closing)},direction:function(e){e=e||E.get.direction(),v.removeClass(a[e])},visible:function(){v.removeClass(a.visible)},overlay:function(){v.removeClass(a.overlay)}},get:{direction:function(){return v.hasClass(a.top)?a.top:v.hasClass(a.right)?a.right:v.hasClass(a.bottom)?a.bottom:a.left},id:function(){return t},element:function(){return v},settings:function(){return l}},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.cache.leftBodyScrollbar}},save:{focus:function(){0<Q(U.activeElement).closest(v).length||(e=Q(U.activeElement).trigger("blur"))},bodyMargin:function(){T=m.css((C?"margin-":"padding-")+(E.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(T.replace(/[^\d.]/g,""),10),t=C?W.innerWidth-U.documentElement.clientWidth:m[0].offsetWidth-m[0].clientWidth;F=e+t}},is:{safari:function(){return void 0===E.cache.isSafari&&(E.cache.isSafari=/constructor/i.test(W.HTMLElement)||!!W.ApplePaySession),E.cache.isSafari},firefox:function(){return void 0===E.cache.isFirefox&&(E.cache.isFirefox=!!W.InstallTrigger),E.cache.isFirefox},iframe:function(){return!(self===top)},mobile:function(){var e=navigator.userAgent;return e.match(f.mobile)?(E.verbose("Browser was found to be mobile",e),!0):(E.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!E.is.visible()},visible:function(){return v.hasClass(a.visible)},animating:function(){return m.hasClass(a.animating)},rtl:function(){return void 0===E.cache.isRTL&&(E.cache.isRTL="rtl"===v.attr("dir")||"rtl"===v.css("direction")||"rtl"===z.attr("dir")||"rtl"===z.css("direction")||"rtl"===m.attr("dir")||"rtl"===m.css("direction")),E.cache.isRTL}},has:{configActions:function(){return Array.isArray(l.actions)&&0<l.actions.length},scrollbar:function(){return C||"hidden"!==m.css("overflow-y")}},restore:{focus:function(){e&&0<e.length&&l.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var n=E.can.leftBodyScrollbar()?"left":"right";m.css((C?"margin-":"padding-")+n,T),m.find(c.bodyFixed.replace("right",n)).each(function(){var e=Q(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"")})}},helpers:{deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e){if(l.preserveHTML)return e;var t={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return t[e]}):e}},setting:function(e,t){if(E.debug("Changing setting",e,t),Q.isPlainObject(e))Q.extend(!0,l,e);else{if(void 0===t)return l[e];Q.isPlainObject(l[e])?Q.extend(!0,l[e],t):l[e]=t}},internal:function(e,t){if(Q.isPlainObject(e))Q.extend(!0,E,e);else{if(void 0===t)return E[e];E[e]=t}},debug:function(){!l.silent&&l.debug&&(l.performance?E.performance.log(arguments):(E.debug=Function.prototype.bind.call(console.info,console,l.name+":"),E.debug.apply(console,arguments)))},verbose:function(){!l.silent&&l.verbose&&l.debug&&(l.performance?E.performance.log(arguments):(E.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),E.verbose.apply(console,arguments)))},error:function(){l.silent||(E.error=Function.prototype.bind.call(console.error,console,l.name+":"),E.error.apply(console,arguments))},performance:{log:function(e){var t,n;l.performance&&(n=(t=Date.now())-(R||t),R=t,q.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(E.performance.timer),E.performance.timer=setTimeout(function(){E.performance.display()},500)},display:function(){var e=l.name+":",n=0;R=!1,clearTimeout(E.performance.timer),Q.each(q,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",0<q.length&&(console.groupCollapsed(e),console.table?console.table(q):Q.each(q,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),q=[]}},invoke:function(i,e,t){var o,s,n,r=A;return e=e||K,t=S||t,"string"==typeof i&&void 0!==r&&(i=i.split(/[ .]/),o=i.length-1,Q.each(i,function(e,t){var n=e!==o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(Q.isPlainObject(r[n])&&e!==o)r=r[n];else{if(void 0!==r[n])return s=r[n],!1;{if(!Q.isPlainObject(r[t])||e===o)return void 0!==r[t]?s=r[t]:E.error(h.method,i),!1;r=r[t]}}})),_(s)?n=s.apply(t,e):void 0!==s&&(n=s),Array.isArray(N)?N.push(n):void 0!==N?N=[N,n]:void 0!==n&&(N=n),s}};j?(void 0===A&&(_(l.templates[I])&&(l.autoShow=!0,l.className.flyout=l.className.template,l=Q.extend(!0,{},l,l.templates[I].apply(E,K)),a=l.className,l.namespace,d=l.fields,h=l.error),E.initialize()),_(l.templates[I])||E.invoke(I)):(void 0!==A&&A.invoke("destroy"),E.initialize(),N=v)}),void 0!==N?N:this},Q.flyout=Q.fn.flyout,Q.fn.flyout.settings={name:"Flyout",namespace:"flyout",silent:!1,debug:!1,verbose:!1,performance:!0,context:"body",exclusive:!1,closable:!0,autofocus:!0,restoreFocus:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,autoShow:!1,keyboardShortcuts:!0,title:"",content:"",class:"",classTitle:"",classContent:"",classActions:"",closeIcon:!1,actions:!1,preserveHTML:!1,fields:{class:"class",text:"text",icon:"icon",click:"click"},onChange:function(){},onShow:function(){},onHide:function(){return!0},onHidden:!1,onVisible:function(){},onApprove:function(){},onDeny:function(){},keys:{space:32,enter:13,escape:27,tab:9},className:{flyout:"ui flyout",close:"close icon",header:"ui header",content:"content",actions:"actions",active:"active",animating:"animating",blurring:"blurring",closing:"closing",dimmed:"dimmed",locked:"locked",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible",overlay:"overlay",fullscreen:"fullscreen",template:"ui flyout",button:"ui button",ok:"positive",cancel:"negative",prompt:"ui fluid input"},selector:{bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.right.flyout, > .ui.fixed.nag, > .ui.fixed.nag > .close",fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",flyout:".ui.flyout",header:".ui.header",content:".content",actions:".actions",close:".close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel"},regExp:{mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedFlyout:"Had to move flyout. For optimal performance make sure flyout and pusher are direct children of your body tag",notFound:"There were no elements that matched the specified selector"},text:{ok:"Ok",cancel:"Cancel",close:"Close"}},Q.fn.flyout.settings.templates={getArguments:function(e){e=[].slice.call(e);return Q.isPlainObject(e[0])?Q.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);return{title:t.title,content:t.content,actions:[{text:e.text.ok,class:e.className.ok,click:t.handler}]}},confirm:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments);return{title:t.title,content:t.content,actions:[{text:e.text.ok,class:e.className.ok,click:function(){t.handler(!0)}},{text:e.text.cancel,class:e.className.cancel,click:function(){t.handler(!1)}}]}},prompt:function(){var t=this,e=this.get.settings(),n=e.templates.getArguments(arguments);return 0===Q(Q.parseHTML(n.content)).filter(".ui.input").length&&(n.content+='<p><div class="'+e.className.prompt+'"><input placeholder="'+this.helpers.deQuote(n.placeholder||"")+'" type="text" value="'+this.helpers.deQuote(n.defaultValue||"")+'"></div></p>'),{title:n.title,content:n.content,actions:[{text:e.text.ok,class:e.className.ok,click:function(){var e=t.get.settings(),e=t.get.element().find(e.selector.prompt)[0];n.handler(Q(e).val())}},{text:e.text.cancel,class:e.className.cancel,click:function(){n.handler(null)}}]}}}}(jQuery,window,document);
|
package/dist/components/form.css
CHANGED
package/dist/components/form.js
CHANGED
package/dist/components/grid.css
CHANGED
package/dist/components/icon.css
CHANGED
package/dist/components/item.css
CHANGED
package/dist/components/list.css
CHANGED
package/dist/components/menu.css
CHANGED
package/dist/components/modal.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.10.0-beta.
|
2
|
+
* # Fomantic-UI 2.10.0-beta.5+789e0d0 - Modal
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -111,10 +111,10 @@
|
|
111
111
|
}
|
112
112
|
$module.addClass(settings.class);
|
113
113
|
if (settings.title !== '') {
|
114
|
-
$module.find(selector.title).html(module.helpers.escape(settings.title
|
114
|
+
$module.find(selector.title).html(module.helpers.escape(settings.title)).addClass(settings.classTitle);
|
115
115
|
}
|
116
116
|
if (settings.content !== '') {
|
117
|
-
$module.find(selector.content).html(module.helpers.escape(settings.content
|
117
|
+
$module.find(selector.content).html(module.helpers.escape(settings.content)).addClass(settings.classContent);
|
118
118
|
}
|
119
119
|
if (module.has.configActions()) {
|
120
120
|
var $actions = $module.find(selector.actions).addClass(settings.classActions);
|
@@ -128,7 +128,7 @@
|
|
128
128
|
icon = el[fields.icon]
|
129
129
|
? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '') + ' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>'
|
130
130
|
: '',
|
131
|
-
text = module.helpers.escape(el[fields.text] || ''
|
131
|
+
text = module.helpers.escape(el[fields.text] || ''),
|
132
132
|
cls = module.helpers.deQuote(el[fields.class] || ''),
|
133
133
|
click = el[fields.click] && isFunction(el[fields.click])
|
134
134
|
? el[fields.click]
|
@@ -930,8 +930,8 @@
|
|
930
930
|
deQuote: function (string) {
|
931
931
|
return String(string).replace(/"/g, '');
|
932
932
|
},
|
933
|
-
escape: function (string
|
934
|
-
if (preserveHTML) {
|
933
|
+
escape: function (string) {
|
934
|
+
if (settings.preserveHTML) {
|
935
935
|
return string;
|
936
936
|
}
|
937
937
|
var
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.10.0-beta.
|
2
|
+
* # Fomantic UI - 2.10.0-beta.5+789e0d0
|
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(U,V,X){"use strict";function _(e){return"function"==typeof e&&"number"!=typeof e.nodeType}V=void 0!==V&&V.Math===Math?V:globalThis,U.fn.modal=function(E){var z,e=U(this),q=U(V),I=U(X),B=U("body"),W=Date.now(),j=[],P=E,K="string"==typeof P,Q=[].slice.call(arguments,1),R=function(e,t){var n;return 0<=[V,X].indexOf(e)?n=B:0===(n=U(t.document).find(e)).length&&(n=t.frameElement?R(e,t.parent):B),n};return e.each(function(){var n,o,a,e,i,t,s,r,c,l,d,u=U.isPlainObject(E)?U.extend(!0,{},U.fn.modal.settings,E):U.extend({},U.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,v=u.error,p="."+h,b="module-"+h,y=U(this),k=R(u.context,V),x=k[0]===B[0],w=y.find(f.closeIcon),C=y.hasClass("modal"),S=this,M=C?y.data(b):void 0,A=!1,D="",T="",H=!1,F=!1,L=!1,N=!1,O={initialize:function(){var a;O.create.id(),C||(O.create.modal(),_(u.onHidden)||(u.onHidden=function(){O.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(f.title).html(O.helpers.escape(u.title,u.preserveHTML)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(O.helpers.escape(u.content,u.preserveHTML)).addClass(u.classContent),O.has.configActions()&&(0===(a=y.find(f.actions).addClass(u.classActions)).length?a=U("<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="'+O.helpers.deQuote(e[g.icon])+' icon"></i>':"",n=O.helpers.escape(e[g.text]||"",u.preserveHTML),i=O.helpers.deQuote(e[g.class]||""),o=e[g.click]&&_(e[g.click])?e[g.click]:function(){};a.append(U("<button/>",{html:t+n,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+i,on:{click:function(){var e=U(this);e.is(f.approve)||e.is(f.deny)||!1===o.call(S,y)||O.hide()}}}))})),O.cache={},O.verbose("Initializing dimmer",k),O.create.dimmer(),u.allowMultiple&&O.create.innerDimmer(),u.centered||y.addClass("top aligned"),O.refreshModals(),O.bind.events(),O.observeChanges(),O.instantiate(),u.autoShow&&O.show()},instantiate:function(){O.verbose("Storing instance of modal"),M=O,y.data(b,M)},create:{modal:function(){var e;y=U("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(w=U("<i/>",{class:m.close,role:"button",tabindex:0,"aria-label":u.text.close}),y.append(w)),""!==u.title&&(e="_"+O.get.id()+"title",y.attr("aria-labelledby",e),U("<div/>",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+O.get.id()+"desc",y.attr("aria-describedby",e),U("<div/>",{class:m.content,id:e}).appendTo(y)),O.has.configActions()&&U("<div/>",{class:m.actions}).appendTo(y),k.append(y),S=y[0]},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},e=U.extend(!0,e,u.dimmerSettings);void 0===U.fn.dimmer?O.error(v.dimmer):(O.debug("Creating dimmer"),i=k.dimmer(e),H=O.is.scrolling(),u.detachable?(O.verbose("Modal is detachable, moving content into dimmer"),i.dimmer("add content",y)):O.set.undetached(),t=i.dimmer("get dimmer"))},id:function(){l=(Math.random().toString(16)+"000000000").slice(2,10),c="."+l,O.verbose("Creating unique id for element",l)},innerDimmer:function(){0===y.find(f.dimmer).length&&U("<div/>",{class:m.innerDimmer}).prependTo(y)}},destroy:function(){d&&d.disconnect(),O.verbose("Destroying previous modal"),y.removeData(b).off(p),q.off(c),k.off(c),t.off(c),w.off(c),n&&n.off(c),k.dimmer("destroy")},observeChanges:function(){"MutationObserver"in V&&((d=new MutationObserver(function(e){function o(e){for(var t=[],n=0,i=e.length;n<i;n++)Array.prototype.push.apply(t,o(e[n].childNodes)),t.push(e[n]);return t}var n=!1,i=!1,a=!0;e.every(function(e){var t;return"attributes"===e.type?N&&("disabled"===e.attributeName||0<U(e.target).find(":input").addBack(":input").filter(":visible").length)&&(i=!0):(n=!0,t=U(o(e.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),e=U(o(e.removedNodes)).filter("a[href], [tabindex], :input"),(0<t.length||0<e.length)&&(i=!0,(0<t.filter(":input").length||0<e.filter(":input").length)&&(a=!1))),!i}),n&&u.observeChanges&&(O.debug("DOM tree modified, refreshing"),O.refresh()),i&&O.refreshInputs(a)})).observe(S,{attributeFilter:["class","disabled"],attributes:!0,childList:!0,subtree:!0}),O.debug("Setting up mutation observer",d))},refresh:function(){O.remove.scrolling(),O.cacheSizes(),O.can.useFlex()||O.set.modalOffset(),O.set.screenHeight(),O.set.type()},refreshModals:function(){a=y.siblings(f.modal),o=a.add(y)},refreshInputs:function(e){n&&n.off("keydown"+c),0===(n=y.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===U(this).closest(".disabled").length})).filter(":input").length?(n=y.add(n),y.attr("tabindex",-1)):y.removeAttr("tabindex"),n.first().on("keydown"+c,O.event.inputKeyDown.first),n.last().on("keydown"+c,O.event.inputKeyDown.last),!e&&u.autofocus&&0===n.filter(":focus").length&&O.set.autofocus()},attachEvents:function(e,t){var n=U(e);t=_(O[t])?O[t]:O.toggle,0<n.length?(O.debug("Attaching modal events to element",e,t),n.off(p).on("click"+p,t)):O.error(v.notFound,e)},bind:{events:function(){O.verbose("Attaching events"),y.on("click"+p,f.close,O.event.close).on("click"+p,f.approve,O.event.approve).on("click"+p,f.deny,O.event.deny),w.on("keyup"+c,O.event.closeKeyUp),q.on("resize"+c,O.event.resize).on("focus"+c,O.event.focus),k.on("click"+c,O.event.click)},scrollLock:function(){i[0].addEventListener("touchmove",O.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){i[0].removeEventListener("touchmove",O.event.preventScroll,{passive:!1})}},get:{id:function(){return l},element:function(){return y},settings:function(){return u}},event:{approve:function(){A||!1===u.onApprove.call(S,U(this))?O.verbose("Approve callback returned false cancelling hide"):(A=!0,O.hide(function(){A=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){A||!1===u.onDeny.call(S,U(this))?O.verbose("Deny callback returned false cancelling hide"):(A=!0,O.hide(function(){A=!1}))},close:function(){O.hide()},closeKeyUp:function(e){e=e.which;e!==u.keys.enter&&e!==u.keys.space||!y.hasClass(m.front)||O.hide()},inputKeyDown:{first:function(e){e.which===u.keys.tab&&e.shiftKey&&(n.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==u.keys.tab||e.shiftKey||(n.first().trigger("focus"),e.preventDefault())}},mousedown:function(e){var t=U(e.target),n=O.is.rtl();(s=0<t.closest(f.modal).length)&&O.verbose("Mouse down event registered inside the modal"),(r=O.is.scrolling()&&(!n&&q.outerWidth()-u.scrollbarWidth<=e.clientX||n&&u.scrollbarWidth>=e.clientX))&&O.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(e){if(u.closable)if(s)O.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(r)O.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{var t=0<U(e.target).closest(f.modal).length,e=U.contains(X.documentElement,e.target);if(!t&&e&&O.is.active()&&y.hasClass(m.front)){if(O.debug("Dimmer clicked, hiding all modals"),u.allowMultiple){if(!O.hideAll())return}else if(!O.hide())return;O.remove.clickaway()}}else O.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(O.timer),O.timer=setTimeout(function(){e()},t)},keyboard:function(e){e.which===u.keys.escape&&(u.closable?(O.debug("Escape key pressed hiding modal"),y.hasClass(m.front)&&O.hide()):O.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){i.dimmer("is active")&&(O.is.animating()||O.is.active())&&requestAnimationFrame(O.refresh)},focus:function(){L=!0},click:function(e){L&&X.activeElement!==e.target&&i.dimmer("is active")&&O.is.active()&&u.autofocus&&0===U(X.activeElement).closest(f.modal).length&&requestAnimationFrame(O.set.autofocus),L=!1}},toggle:function(){O.is.active()||O.is.animating()?O.hide():O.show()},show:function(e){e=_(e)?e:function(){},O.refreshModals(),O.set.dimmerSettings(),O.set.dimmerStyles(),O.showModal(e)},hide:function(e){return e=_(e)?e:function(){},O.refreshModals(),O.hideModal(e)},showModal:function(e){e=_(e)?e:function(){},O.is.animating()||!O.is.active()?!1===u.onShow.call(S)?O.verbose("Show callback returned false cancelling show"):(F=O.has.scrollbar(),O.showDimmer(),O.cacheSizes(),F&&O.set.bodyMargin(),O.can.useFlex()?O.remove.legacy():(O.set.legacy(),O.set.modalOffset(),O.debug("Using non-flex legacy modal positioning.")),O.set.screenHeight(),O.set.type(),O.set.clickaway(),!u.allowMultiple&&O.others.active()?O.hideOthers(O.showModal):(A=!1,u.allowMultiple&&(O.others.active()&&a.filter("."+m.active).find(f.dimmer).removeClass("out").addClass("transition fade in active"),u.detachable&&y.detach().appendTo(t)),u.transition&&void 0!==U.fn.transition?(O.debug("Showing modal with css animations"),O.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&&O.add.keyboardShortcuts(),O.save.focus(),O.set.active(),O.refreshInputs(),requestAnimationFrame(O.set.observeAttributes),e()}})):O.error(v.noTransition))):O.debug("Modal is already visible")},hideModal:function(e,t,n){var i=a.filter("."+m.active).last();if(e=_(e)?e:function(){},!1===u.onHide.call(S,U(this)))return O.verbose("Hide callback returned false cancelling hide"),A=!1;(O.is.animating()||O.is.active())&&(O.debug("Hiding modal"),u.transition&&void 0!==U.fn.transition?(O.remove.active(),O.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(){O.others.active()||O.others.animating()||t?u.allowMultiple&&(n?o:i).find(f.dimmer).removeClass("in").addClass("out"):O.hideDimmer(),u.keyboardShortcuts&&!O.others.active()&&O.remove.keyboardShortcuts()},onComplete:function(){O.unbind.scrollLock(),O.remove.active(),u.allowMultiple&&(i.addClass(m.front),y.removeClass(m.front),(n?o:i).find(f.dimmer).removeClass("active")),_(u.onHidden)&&u.onHidden.call(S),O.remove.dimmerStyles(),O.restore.focus(),e()}})):O.error(v.noTransition))},showDimmer:function(){i.dimmer("is animating")||!i.dimmer("is active")?(F&&(x||t.css("top",i.scrollTop()),O.save.bodyMargin()),O.debug("Showing dimmer"),i.dimmer("show")):O.debug("Dimmer already visible")},hideDimmer:function(){i.dimmer("is animating")||i.dimmer("is active")?(O.unbind.scrollLock(),i.dimmer("hide",function(){F&&O.restore.bodyMargin(),O.remove.clickaway(),O.remove.screenHeight()})):O.debug("Dimmer is not visible cannot hide")},hideAll:function(n){var i,e=o.filter("."+m.active+", ."+m.animating);if(n=_(n)?n:function(){},0<e.length)return O.debug("Hiding all visible modals"),i=!0,U(e.get().reverse()).each(function(e,t){i=i&&U(t).modal("hide modal",n,!1,!0)}),i&&O.hideDimmer(),i},hideOthers:function(e){var t=a.filter("."+m.active+", ."+m.animating);e=_(e)?e:function(){},0<t.length&&(O.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(){O.verbose("Adding keyboard shortcuts"),I.on("keydown"+p,O.event.keyboard)}},save:{focus:function(){0<U(X.activeElement).closest(y).length||(e=U(X.activeElement).trigger("blur"))},bodyMargin:function(){D=k.css((x?"margin-":"padding-")+(O.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(D.replace(/[^\d.]/g,""),10),t=x?V.innerWidth-X.documentElement.clientWidth:k[0].offsetWidth-k[0].clientWidth;T=e+t}},restore:{focus:function(){e&&0<e.length&&u.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var n=O.can.leftBodyScrollbar()?"left":"right";k.css((x?"margin-":"padding-")+n,D),k.find(f.bodyFixed.replace("right",n)).each(function(){var e=U(this),t="fixed"===e.css("position")?"padding-"+n:n;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),i.removeClass(m.blurring)},bodyStyle:function(){""===k.attr("style")&&(O.verbose("Removing style attribute"),k.removeAttr("style"))},screenHeight:function(){O.debug("Removing page height"),k.css("height",""),O.remove.bodyStyle()},keyboardShortcuts:function(){O.verbose("Removing keyboard shortcuts"),I.off("keydown"+p)},scrolling:function(){H||i.removeClass(m.scrolling),y.removeClass(m.scrolling)}},cacheSizes:function(){y.addClass(m.loading);var e=y.prop("scrollHeight"),t=y.outerWidth(),n=y.outerHeight();void 0!==O.cache.pageHeight&&0===n||(U.extend(O.cache,{pageHeight:I.outerHeight(),width:t,height:n+u.offset,scrollHeight:e+u.offset,contextHeight:(x?q:i).height()}),O.cache.topOffset=-O.cache.height/2),y.removeClass(m.loading),O.debug("Caching modal and container sizes",O.cache)},helpers:{deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var n={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return n[e]}):e}},can:{leftBodyScrollbar:function(){return void 0===O.cache.leftBodyScrollbar&&(O.cache.leftBodyScrollbar=O.is.rtl()&&(O.is.iframe&&!O.is.firefox()||O.is.safari())),O.cache.leftBodyScrollbar},useFlex:function(){return"auto"===u.useFlex?u.detachable:(u.useFlex&&!u.detachable&&O.debug("useFlex true in combination with detachable false is not supported"),u.useFlex)},fit:function(){var e=O.cache.contextHeight,t=O.cache.contextHeight/2,n=O.cache.topOffset,i=O.cache.scrollHeight,o=O.cache.height,a=u.padding;return o<i?t+n+i+a<e:o+2*a<e}},has:{configActions:function(){return Array.isArray(u.actions)&&0<u.actions.length},scrollbar:function(){return x||"hidden"!==k.css("overflow-y")}},is:{active:function(){return y.hasClass(m.active)},animating:function(){return y.transition("is animating")},scrolling:function(){return i.hasClass(m.scrolling)},rtl:function(){return void 0===O.cache.isRTL&&(O.cache.isRTL="rtl"===y.attr("dir")||"rtl"===y.css("direction")||"rtl"===B.attr("dir")||"rtl"===B.css("direction")||"rtl"===k.attr("dir")||"rtl"===k.css("direction")),O.cache.isRTL},safari:function(){return void 0===O.cache.isSafari&&(O.cache.isSafari=/constructor/i.test(V.HTMLElement)||!!V.ApplePaySession),O.cache.isSafari},firefox:function(){return void 0===O.cache.isFirefox&&(O.cache.isFirefox=!!V.InstallTrigger),O.cache.isFirefox},iframe:function(){return!(self===top)}},set:{observeAttributes:function(e){N=!1!==e},autofocus:function(){var e=n.filter("[autofocus]"),t=n.filter(":input");(0<e.length?e:0<t.length?t:y).first().trigger("focus")},bodyMargin:function(){var n=O.can.leftBodyScrollbar()?"left":"right";(u.detachable||O.can.fit())&&k.css((x?"margin-":"padding-")+n,T+"px"),k.find(f.bodyFixed.replace("right",n)).each(function(){var e=U(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"calc("+e.css(t)+" + "+T+"px)")})},clickaway:function(){u.detachable||y.on("mousedown"+c,O.event.mousedown),t.on("mousedown"+c,O.event.mousedown),t.on("mouseup"+c,O.event.mouseup)},dimmerSettings:function(){var e;void 0===U.fn.dimmer?O.error(v.dimmer):(e={debug:u.debug,dimmerName:"modals",closable:"auto",useFlex:O.can.useFlex(),duration:{show:u.transition.showDuration||u.duration,hide:u.transition.hideDuration||u.duration}},e=U.extend(!0,e,u.dimmerSettings),u.inverted&&(e.variation=void 0!==e.variation?e.variation+" inverted":"inverted"),k.dimmer("setting",e))},dimmerStyles:function(){u.inverted?t.addClass(m.inverted):t.removeClass(m.inverted),u.blurring?i.addClass(m.blurring):i.removeClass(m.blurring)},modalOffset:function(){var e;u.detachable?y.css({marginTop:!y.hasClass("aligned")&&O.can.fit()?-O.cache.height/2:u.padding/2,marginLeft:-O.cache.width/2}):(e=O.can.fit(),y.css({top:!y.hasClass("aligned")&&e?I.scrollTop()+(O.cache.contextHeight-O.cache.height)/2:!e||y.hasClass("top")?I.scrollTop()+u.padding:I.scrollTop()+(O.cache.contextHeight-O.cache.height-u.padding),marginLeft:-O.cache.width/2})),O.verbose("Setting modal offset for legacy mode")},screenHeight:function(){O.can.fit()?k.css("height",""):y.hasClass("bottom")||(O.debug("Modal is taller than page content, resizing page height"),k.css("height",O.cache.height+2*u.padding+"px"))},active:function(){y.addClass(m.active+" "+m.front),a.filter("."+m.active).removeClass(m.front)},scrolling:function(){i.addClass(m.scrolling),y.addClass(m.scrolling),O.unbind.scrollLock()},legacy:function(){y.addClass(m.legacy)},type:function(){O.can.fit()?(O.verbose("Modal fits on screen"),O.others.active()||O.others.animating()||(O.remove.scrolling(),O.bind.scrollLock())):y.hasClass("bottom")?O.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(O.verbose("Modal cannot fit on screen setting to scrolling"),O.set.scrolling())},undetached:function(){i.addClass(m.undetached)}},setting:function(e,t){if(O.debug("Changing setting",e,t),U.isPlainObject(e))U.extend(!0,u,e);else{if(void 0===t)return u[e];U.isPlainObject(u[e])?U.extend(!0,u[e],t):u[e]=t}},internal:function(e,t){if(U.isPlainObject(e))U.extend(!0,O,e);else{if(void 0===t)return O[e];O[e]=t}},debug:function(){!u.silent&&u.debug&&(u.performance?O.performance.log(arguments):(O.debug=Function.prototype.bind.call(console.info,console,u.name+":"),O.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?O.performance.log(arguments):(O.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),O.verbose.apply(console,arguments)))},error:function(){u.silent||(O.error=Function.prototype.bind.call(console.error,console,u.name+":"),O.error.apply(console,arguments))},performance:{log:function(e){var t,n;u.performance&&(n=(t=Date.now())-(W||t),W=t,j.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(O.performance.timer),O.performance.timer=setTimeout(function(){O.performance.display()},500)},display:function(){var e=u.name+":",n=0;W=!1,clearTimeout(O.performance.timer),U.each(j,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",0<j.length&&(console.groupCollapsed(e),console.table?console.table(j):U.each(j,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(i,e,t){var o,a,n,s=M;return e=e||Q,t=t||S,"string"==typeof i&&void 0!==s&&(i=i.split(/[ .]/),o=i.length-1,U.each(i,function(e,t){var n=e!==o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(U.isPlainObject(s[n])&&e!==o)s=s[n];else{if(void 0!==s[n])return a=s[n],!1;{if(!U.isPlainObject(s[t])||e===o)return void 0!==s[t]?a=s[t]:O.error(v.method,i),!1;s=s[t]}}})),_(a)?n=a.apply(t,e):void 0!==a&&(n=a),Array.isArray(z)?z.push(n):void 0!==z?z=[z,n]:void 0!==n&&(z=n),a}};K?(void 0===M&&(_(u.templates[P])&&(u.autoShow=!0,u.className.modal=u.className.template,u=U.extend(!0,{},u,u.templates[P].apply(O,Q)),m=u.className,u.namespace,g=u.fields,v=u.error),O.initialize()),_(u.templates[P])||O.invoke(P)):(void 0!==M&&M.invoke("destroy"),O.initialize(),z=y)}),void 0!==z?z:this},U.modal=U.fn.modal,U.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:!1,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"}},U.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return U.isPlainObject(e[0])?U.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),n=t.handler;return{title:t.title,content:t.content,onApprove:n,actions:[{text:e.text.ok,class:e.className.ok,click:n}]}},confirm:function(){function e(){i.handler(!0)}function t(){i.handler(!1)}var n=this.get.settings(),i=n.templates.getArguments(arguments);return{title:i.title,content:i.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}]}},prompt:function(){function e(){var e=n.get.settings(),e=n.get.element().find(e.selector.prompt)[0];o.handler(U(e).val())}function t(){o.handler(null)}var n=this,i=this.get.settings(),o=i.templates.getArguments(arguments);return 0===U(U.parseHTML(o.content)).filter(".ui.input").length&&(o.content+='<p><div class="'+this.helpers.deQuote(i.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:i.text.ok,class:i.className.ok,click:e},{text:i.text.cancel,class:i.className.cancel,click:t}]}}}}(jQuery,window,document);
|
11
|
+
!function(U,V,X){"use strict";function _(e){return"function"==typeof e&&"number"!=typeof e.nodeType}V=void 0!==V&&V.Math===Math?V:globalThis,U.fn.modal=function(L){var z,e=U(this),q=U(V),I=U(X),B=U("body"),W=Date.now(),j=[],P=L,K="string"==typeof P,Q=[].slice.call(arguments,1),R=function(e,t){var n;return 0<=[V,X].indexOf(e)?n=B:0===(n=U(t.document).find(e)).length&&(n=t.frameElement?R(e,t.parent):B),n};return e.each(function(){var n,o,a,e,i,t,s,r,c,l,d,u=U.isPlainObject(L)?U.extend(!0,{},U.fn.modal.settings,L):U.extend({},U.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,v=u.error,p="."+h,b="module-"+h,y=U(this),k=R(u.context,V),x=k[0]===B[0],w=y.find(f.closeIcon),C=y.hasClass("modal"),S=this,M=C?y.data(b):void 0,A=!1,D="",T="",H=!1,F=!1,N=!1,O=!1,E={initialize:function(){var a;E.create.id(),C||(E.create.modal(),_(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)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(E.helpers.escape(u.content)).addClass(u.classContent),E.has.configActions()&&(0===(a=y.find(f.actions).addClass(u.classActions)).length?a=U("<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="'+E.helpers.deQuote(e[g.icon])+' icon"></i>':"",n=E.helpers.escape(e[g.text]||""),i=E.helpers.deQuote(e[g.class]||""),o=e[g.click]&&_(e[g.click])?e[g.click]:function(){};a.append(U("<button/>",{html:t+n,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+i,on:{click:function(){var e=U(this);e.is(f.approve)||e.is(f.deny)||!1===o.call(S,y)||E.hide()}}}))})),E.cache={},E.verbose("Initializing dimmer",k),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"),M=E,y.data(b,M)},create:{modal:function(){var e;y=U("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(w=U("<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),U("<div/>",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+E.get.id()+"desc",y.attr("aria-describedby",e),U("<div/>",{class:m.content,id:e}).appendTo(y)),E.has.configActions()&&U("<div/>",{class:m.actions}).appendTo(y),k.append(y),S=y[0]},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},e=U.extend(!0,e,u.dimmerSettings);void 0===U.fn.dimmer?E.error(v.dimmer):(E.debug("Creating dimmer"),i=k.dimmer(e),H=E.is.scrolling(),u.detachable?(E.verbose("Modal is detachable, moving content into dimmer"),i.dimmer("add content",y)):E.set.undetached(),t=i.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&&U("<div/>",{class:m.innerDimmer}).prependTo(y)}},destroy:function(){d&&d.disconnect(),E.verbose("Destroying previous modal"),y.removeData(b).off(p),q.off(c),k.off(c),t.off(c),w.off(c),n&&n.off(c),k.dimmer("destroy")},observeChanges:function(){"MutationObserver"in V&&((d=new MutationObserver(function(e){function o(e){for(var t=[],n=0,i=e.length;n<i;n++)Array.prototype.push.apply(t,o(e[n].childNodes)),t.push(e[n]);return t}var n=!1,i=!1,a=!0;e.every(function(e){var t;return"attributes"===e.type?O&&("disabled"===e.attributeName||0<U(e.target).find(":input").addBack(":input").filter(":visible").length)&&(i=!0):(n=!0,t=U(o(e.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),e=U(o(e.removedNodes)).filter("a[href], [tabindex], :input"),(0<t.length||0<e.length)&&(i=!0,(0<t.filter(":input").length||0<e.filter(":input").length)&&(a=!1))),!i}),n&&u.observeChanges&&(E.debug("DOM tree modified, refreshing"),E.refresh()),i&&E.refreshInputs(a)})).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(){a=y.siblings(f.modal),o=a.add(y)},refreshInputs:function(e){n&&n.off("keydown"+c),0===(n=y.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===U(this).closest(".disabled").length})).filter(":input").length?(n=y.add(n),y.attr("tabindex",-1)):y.removeAttr("tabindex"),n.first().on("keydown"+c,E.event.inputKeyDown.first),n.last().on("keydown"+c,E.event.inputKeyDown.last),!e&&u.autofocus&&0===n.filter(":focus").length&&E.set.autofocus()},attachEvents:function(e,t){var n=U(e);t=_(E[t])?E[t]:E.toggle,0<n.length?(E.debug("Attaching modal events to element",e,t),n.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),q.on("resize"+c,E.event.resize).on("focus"+c,E.event.focus),k.on("click"+c,E.event.click)},scrollLock:function(){i[0].addEventListener("touchmove",E.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){i[0].removeEventListener("touchmove",E.event.preventScroll,{passive:!1})}},get:{id:function(){return l},element:function(){return y},settings:function(){return u}},event:{approve:function(){A||!1===u.onApprove.call(S,U(this))?E.verbose("Approve callback returned false cancelling hide"):(A=!0,E.hide(function(){A=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){A||!1===u.onDeny.call(S,U(this))?E.verbose("Deny callback returned false cancelling hide"):(A=!0,E.hide(function(){A=!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&&(n.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==u.keys.tab||e.shiftKey||(n.first().trigger("focus"),e.preventDefault())}},mousedown:function(e){var t=U(e.target),n=E.is.rtl();(s=0<t.closest(f.modal).length)&&E.verbose("Mouse down event registered inside the modal"),(r=E.is.scrolling()&&(!n&&q.outerWidth()-u.scrollbarWidth<=e.clientX||n&&u.scrollbarWidth>=e.clientX))&&E.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(e){if(u.closable)if(s)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<U(e.target).closest(f.modal).length,e=U.contains(X.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(function(){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(){i.dimmer("is active")&&(E.is.animating()||E.is.active())&&requestAnimationFrame(E.refresh)},focus:function(){N=!0},click:function(e){N&&X.activeElement!==e.target&&i.dimmer("is active")&&E.is.active()&&u.autofocus&&0===U(X.activeElement).closest(f.modal).length&&requestAnimationFrame(E.set.autofocus),N=!1}},toggle:function(){E.is.active()||E.is.animating()?E.hide():E.show()},show:function(e){e=_(e)?e:function(){},E.refreshModals(),E.set.dimmerSettings(),E.set.dimmerStyles(),E.showModal(e)},hide:function(e){return e=_(e)?e:function(){},E.refreshModals(),E.hideModal(e)},showModal:function(e){e=_(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):(A=!1,u.allowMultiple&&(E.others.active()&&a.filter("."+m.active).find(f.dimmer).removeClass("out").addClass("transition fade in active"),u.detachable&&y.detach().appendTo(t)),u.transition&&void 0!==U.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,n){var i=a.filter("."+m.active).last();if(e=_(e)?e:function(){},!1===u.onHide.call(S,U(this)))return E.verbose("Hide callback returned false cancelling hide"),A=!1;(E.is.animating()||E.is.active())&&(E.debug("Hiding modal"),u.transition&&void 0!==U.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?u.allowMultiple&&(n?o:i).find(f.dimmer).removeClass("in").addClass("out"):E.hideDimmer(),u.keyboardShortcuts&&!E.others.active()&&E.remove.keyboardShortcuts()},onComplete:function(){E.unbind.scrollLock(),E.remove.active(),u.allowMultiple&&(i.addClass(m.front),y.removeClass(m.front),(n?o:i).find(f.dimmer).removeClass("active")),_(u.onHidden)&&u.onHidden.call(S),E.remove.dimmerStyles(),E.restore.focus(),e()}})):E.error(v.noTransition))},showDimmer:function(){i.dimmer("is animating")||!i.dimmer("is active")?(F&&(x||t.css("top",i.scrollTop()),E.save.bodyMargin()),E.debug("Showing dimmer"),i.dimmer("show")):E.debug("Dimmer already visible")},hideDimmer:function(){i.dimmer("is animating")||i.dimmer("is active")?(E.unbind.scrollLock(),i.dimmer("hide",function(){F&&E.restore.bodyMargin(),E.remove.clickaway(),E.remove.screenHeight()})):E.debug("Dimmer is not visible cannot hide")},hideAll:function(n){var i,e=o.filter("."+m.active+", ."+m.animating);if(n=_(n)?n:function(){},0<e.length)return E.debug("Hiding all visible modals"),i=!0,U(e.get().reverse()).each(function(e,t){i=i&&U(t).modal("hide modal",n,!1,!0)}),i&&E.hideDimmer(),i},hideOthers:function(e){var t=a.filter("."+m.active+", ."+m.animating);e=_(e)?e:function(){},0<t.length&&(E.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(){E.verbose("Adding keyboard shortcuts"),I.on("keydown"+p,E.event.keyboard)}},save:{focus:function(){0<U(X.activeElement).closest(y).length||(e=U(X.activeElement).trigger("blur"))},bodyMargin:function(){D=k.css((x?"margin-":"padding-")+(E.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(D.replace(/[^\d.]/g,""),10),t=x?V.innerWidth-X.documentElement.clientWidth:k[0].offsetWidth-k[0].clientWidth;T=e+t}},restore:{focus:function(){e&&0<e.length&&u.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var n=E.can.leftBodyScrollbar()?"left":"right";k.css((x?"margin-":"padding-")+n,D),k.find(f.bodyFixed.replace("right",n)).each(function(){var e=U(this),t="fixed"===e.css("position")?"padding-"+n:n;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),i.removeClass(m.blurring)},bodyStyle:function(){""===k.attr("style")&&(E.verbose("Removing style attribute"),k.removeAttr("style"))},screenHeight:function(){E.debug("Removing page height"),k.css("height",""),E.remove.bodyStyle()},keyboardShortcuts:function(){E.verbose("Removing keyboard shortcuts"),I.off("keydown"+p)},scrolling:function(){H||i.removeClass(m.scrolling),y.removeClass(m.scrolling)}},cacheSizes:function(){y.addClass(m.loading);var e=y.prop("scrollHeight"),t=y.outerWidth(),n=y.outerHeight();void 0!==E.cache.pageHeight&&0===n||(U.extend(E.cache,{pageHeight:I.outerHeight(),width:t,height:n+u.offset,scrollHeight:e+u.offset,contextHeight:(x?q:i).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){if(u.preserveHTML)return e;var t={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return t[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.cache.leftBodyScrollbar},useFlex:function(){return"auto"===u.useFlex?u.detachable:(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,n=E.cache.topOffset,i=E.cache.scrollHeight,o=E.cache.height,a=u.padding;return o<i?t+n+i+a<e:o+2*a<e}},has:{configActions:function(){return Array.isArray(u.actions)&&0<u.actions.length},scrollbar:function(){return x||"hidden"!==k.css("overflow-y")}},is:{active:function(){return y.hasClass(m.active)},animating:function(){return y.transition("is animating")},scrolling:function(){return i.hasClass(m.scrolling)},rtl:function(){return void 0===E.cache.isRTL&&(E.cache.isRTL="rtl"===y.attr("dir")||"rtl"===y.css("direction")||"rtl"===B.attr("dir")||"rtl"===B.css("direction")||"rtl"===k.attr("dir")||"rtl"===k.css("direction")),E.cache.isRTL},safari:function(){return void 0===E.cache.isSafari&&(E.cache.isSafari=/constructor/i.test(V.HTMLElement)||!!V.ApplePaySession),E.cache.isSafari},firefox:function(){return void 0===E.cache.isFirefox&&(E.cache.isFirefox=!!V.InstallTrigger),E.cache.isFirefox},iframe:function(){return!(self===top)}},set:{observeAttributes:function(e){O=!1!==e},autofocus:function(){var e=n.filter("[autofocus]"),t=n.filter(":input");(0<e.length?e:0<t.length?t:y).first().trigger("focus")},bodyMargin:function(){var n=E.can.leftBodyScrollbar()?"left":"right";(u.detachable||E.can.fit())&&k.css((x?"margin-":"padding-")+n,T+"px"),k.find(f.bodyFixed.replace("right",n)).each(function(){var e=U(this),t="fixed"===e.css("position")?"padding-"+n:n;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===U.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=U.extend(!0,e,u.dimmerSettings),u.inverted&&(e.variation=void 0!==e.variation?e.variation+" inverted":"inverted"),k.dimmer("setting",e))},dimmerStyles:function(){u.inverted?t.addClass(m.inverted):t.removeClass(m.inverted),u.blurring?i.addClass(m.blurring):i.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?I.scrollTop()+(E.cache.contextHeight-E.cache.height)/2:!e||y.hasClass("top")?I.scrollTop()+u.padding:I.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()?k.css("height",""):y.hasClass("bottom")||(E.debug("Modal is taller than page content, resizing page height"),k.css("height",E.cache.height+2*u.padding+"px"))},active:function(){y.addClass(m.active+" "+m.front),a.filter("."+m.active).removeClass(m.front)},scrolling:function(){i.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(){i.addClass(m.undetached)}},setting:function(e,t){if(E.debug("Changing setting",e,t),U.isPlainObject(e))U.extend(!0,u,e);else{if(void 0===t)return u[e];U.isPlainObject(u[e])?U.extend(!0,u[e],t):u[e]=t}},internal:function(e,t){if(U.isPlainObject(e))U.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,n;u.performance&&(n=(t=Date.now())-(W||t),W=t,j.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(E.performance.timer),E.performance.timer=setTimeout(function(){E.performance.display()},500)},display:function(){var e=u.name+":",n=0;W=!1,clearTimeout(E.performance.timer),U.each(j,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",0<j.length&&(console.groupCollapsed(e),console.table?console.table(j):U.each(j,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(i,e,t){var o,a,n,s=M;return e=e||Q,t=t||S,"string"==typeof i&&void 0!==s&&(i=i.split(/[ .]/),o=i.length-1,U.each(i,function(e,t){var n=e!==o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(U.isPlainObject(s[n])&&e!==o)s=s[n];else{if(void 0!==s[n])return a=s[n],!1;{if(!U.isPlainObject(s[t])||e===o)return void 0!==s[t]?a=s[t]:E.error(v.method,i),!1;s=s[t]}}})),_(a)?n=a.apply(t,e):void 0!==a&&(n=a),Array.isArray(z)?z.push(n):void 0!==z?z=[z,n]:void 0!==n&&(z=n),a}};K?(void 0===M&&(_(u.templates[P])&&(u.autoShow=!0,u.className.modal=u.className.template,u=U.extend(!0,{},u,u.templates[P].apply(E,Q)),m=u.className,u.namespace,g=u.fields,v=u.error),E.initialize()),_(u.templates[P])||E.invoke(P)):(void 0!==M&&M.invoke("destroy"),E.initialize(),z=y)}),void 0!==z?z:this},U.modal=U.fn.modal,U.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:!1,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"}},U.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return U.isPlainObject(e[0])?U.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),n=t.handler;return{title:t.title,content:t.content,onApprove:n,actions:[{text:e.text.ok,class:e.className.ok,click:n}]}},confirm:function(){function e(){i.handler(!0)}function t(){i.handler(!1)}var n=this.get.settings(),i=n.templates.getArguments(arguments);return{title:i.title,content:i.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}]}},prompt:function(){function e(){var e=n.get.settings(),e=n.get.element().find(e.selector.prompt)[0];o.handler(U(e).val())}function t(){o.handler(null)}var n=this,i=this.get.settings(),o=i.templates.getArguments(arguments);return 0===U(U.parseHTML(o.content)).filter(".ui.input").length&&(o.content+='<p><div class="'+this.helpers.deQuote(i.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:i.text.ok,class:i.className.ok,click:e},{text:i.text.cancel,class:i.className.cancel,click:t}]}}}}(jQuery,window,document);
|
package/dist/components/nag.css
CHANGED
package/dist/components/nag.js
CHANGED
package/dist/components/popup.js
CHANGED