fomantic-ui 2.10.0-beta.6 → 2.10.0-beta.7
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 +24 -37
- 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 +11 -20
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +11 -19
- 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 +11 -19
- 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 +11 -20
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +1 -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 +11 -20
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +15 -20
- 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 +11 -19
- 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 +120 -189
- 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 +23 -36
- package/src/definitions/modules/embed.js +10 -19
- package/src/definitions/modules/flyout.js +10 -18
- package/src/definitions/modules/modal.js +10 -18
- package/src/definitions/modules/popup.js +10 -19
- package/src/definitions/modules/rating.js +10 -19
- package/src/definitions/modules/search.js +14 -19
- package/src/definitions/modules/toast.js +10 -18
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.10.0-beta.
|
2
|
+
* # Fomantic UI - 2.10.0-beta.7+13b1bae
|
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(W,U,_){"use strict";function Q(e){return"function"==typeof e&&"number"!=typeof e.nodeType}U=void 0!==U&&U.Math===Math?U:globalThis,W.fn.flyout=function(D){var N,e=W(this),O=W(U),B=W(_),L=(W("html"),W("head")),z=W("body"),R=Date.now(),q=[],I=D,j="string"==typeof I,K=[].slice.call(arguments,1),V=function(e,t){var n;return 0<=[U,_].indexOf(e)?n=z:0===(n=W(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,c=W.isPlainObject(D)?W.extend(!0,{},W.fn.flyout.settings,D):W.extend({},W.fn.flyout.settings),l=c.selector,a=c.className,u=c.namespace,d=c.fields,f=c.regExp,h=c.error,g="."+u,p="module-"+u,v=W(this),m=V(c.context,U),b=v.find(l.close),y=v.children(l.flyout),k=m.children(l.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(),Q(c.onHidden)||(c.onHidden=function(){E.destroy(),v.remove()}),c.autoShow||(c.autoShow=!0)),v.addClass(c.class),""!==c.title&&v.find(l.header).html(E.helpers.escape(c.title,c)).addClass(c.classTitle),""!==c.content&&v.find(l.content).html(E.helpers.escape(c.content,c)).addClass(c.classContent),E.has.configActions()&&(0===(s=v.find(l.actions).addClass(c.classActions)).length?s=W("<div/>",{class:a.actions+" "+(c.classActions||"")}).appendTo(v):s.empty(),c.actions.forEach(function(e){var t=e[d.icon]?"<i "+(e[d.text]?'aria-hidden="true"':"")+' class="'+E.helpers.escape(e[d.icon])+' icon"></i>':"",n=E.helpers.escape(e[d.text]||"",c),i=E.helpers.escape(e[d.class]||""),o=e[d.click]&&Q(e[d.click])?e[d.click]:function(){};s.append(W("<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()}}}))})),c.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(),c.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=W("<div/>",{class:a.flyout,role:"dialog","aria-modal":c.dimPage}),c.closeIcon&&(b=W("<i/>",{class:a.close,role:"button",tabindex:0,"aria-label":c.text.close}),v.append(b)),""!==c.title&&(e="_"+E.get.id()+"title",v.attr("aria-labelledby",e),W("<div/>",{class:a.header,id:e}).appendTo(v)),""!==c.content&&(e="_"+E.get.id()+"desc",v.attr("aria-describedby",e),W("<div/>",{class:a.content,id:e}).appendTo(v)),E.has.configActions()&&W("<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===c.keys.escape&&(c.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&&_.activeElement!==e.target&&E.is.visible()&&c.autofocus&&c.dimPage&&0===W(_.activeElement).closest(l.flyout).length&&requestAnimationFrame(E.set.autofocus),P=!1},clickaway:function(e){var t;c.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!==c.keys.enter&&e!==c.keys.space||E.hide()},inputKeyDown:{first:function(e){e.which===c.keys.tab&&e.shiftKey&&(n.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==c.keys.tab||e.shiftKey||(n.first().trigger("focus"),e.preventDefault())}},approve:function(e){w||!1===c.onApprove.call(E.element,W(this))?E.verbose("Approve callback returned false cancelling close"):(w=!0,E.hide(function(){w=!1}))},deny:function(e){w||!1===c.onDeny.call(E.element,W(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===W(e.target).closest(l.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,l.close,E.event.close).on("click"+g,l.approve,E.event.approve).on("click"+g,l.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(){c.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=W(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 U&&((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<W(e.target).find(":input").addBack(":input").filter(":visible").length)&&(n=!0):(t=W(o(e.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),e=W(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(c.context,U),E.refreshFlyouts(),k=m.children(l.pusher),E.clear.cache()},refreshFlyouts:function(){E.verbose("Refreshing other flyouts"),y=m.children(l.flyout)},refreshInputs:function(e){n&&n.off("keydown"+s),c.dimPage&&(0===(n=v.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===W(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&&c.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(l.pusher).length&&(E.debug("Adding wrapper element for flyout"),E.error(h.pusher),k=W('<div class="pusher" />'),m.children().not(l.omitted).not(y).wrapAll(k),E.refresh()),0!==v.nextAll(l.pusher).length&&v.nextAll(l.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(l.header),t=v.children(l.content),n=v.children(l.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=W(e);t=Q(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=Q(e)?e:function(){},E.is.hidden()?!1===c.onShow.call(S)?E.verbose("Show callback returned false cancelling show"):(E.refresh(),E.othersActive()&&(E.debug("Other flyouts currently visible"),c.exclusive?E.hideOthers():w=!1),E.set.dimmerStyles(),E.set.observeAttributes(!1),E.pushPage(function(){e.call(S),c.onVisible.call(S),c.keyboardShortcuts&&E.add.keyboardShortcuts(),E.save.focus(),E.refreshInputs(),requestAnimationFrame(E.set.observeAttributes)}),c.onChange.call(S)):E.debug("Flyout is already visible")},hide:function(e){if(e=Q(e)?e:function(){},!1===c.onHide.call(S,W(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),Q(c.onHidden)&&c.onHidden.call(S),E.restore.focus()}),c.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=Q(t)?t:function(){},E.set.overlay(),c.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),c.dimPage&&!E.othersVisible()&&requestAnimationFrame(n)},pullPage:function(t){var e,n;t=Q(t)?t:function(){},E.verbose("Removing context push state",E.get.direction()),E.unbind.clickaway(),E.othersActive()||(E.unbind.scrollLock(),c.keyboardShortcuts&&E.remove.keyboardShortcuts()),e=function(){E.set.overlay(),E.set.animating(),c.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(),c.returnScroll&&E.scrollBack(),c.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(){c.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(l.bodyFixed.replace("right",n)).each(function(){var e=W(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 c}},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<W(_.activeElement).closest(v).length||(e=W(_.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?U.innerWidth-_.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(U.HTMLElement)||!!U.ApplePaySession),E.cache.isSafari},firefox:function(){return void 0===E.cache.isFirefox&&(E.cache.isFirefox=!!U.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(c.actions)&&0<c.actions.length},scrollbar:function(){return C||"hidden"!==m.css("overflow-y")}},restore:{focus:function(){e&&0<e.length&&c.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var n=E.can.leftBodyScrollbar()?"left":"right";m.css((C?"margin-":"padding-")+n,T),m.find(l.bodyFixed.replace("right",n)).each(function(){var e=W(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"")})}},helpers:{escape:function(e,t){if(void 0!==t&&t.preserveHTML)return e;var n={"<":"<",">":">",'"':""","'":"'"};return e=/["&'<>]/.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),W.isPlainObject(e))W.extend(!0,c,e);else{if(void 0===t)return c[e];W.isPlainObject(c[e])?W.extend(!0,c[e],t):c[e]=t}},internal:function(e,t){if(W.isPlainObject(e))W.extend(!0,E,e);else{if(void 0===t)return E[e];E[e]=t}},debug:function(){!c.silent&&c.debug&&(c.performance?E.performance.log(arguments):(E.debug=Function.prototype.bind.call(console.info,console,c.name+":"),E.debug.apply(console,arguments)))},verbose:function(){!c.silent&&c.verbose&&c.debug&&(c.performance?E.performance.log(arguments):(E.verbose=Function.prototype.bind.call(console.info,console,c.name+":"),E.verbose.apply(console,arguments)))},error:function(){c.silent||(E.error=Function.prototype.bind.call(console.error,console,c.name+":"),E.error.apply(console,arguments))},performance:{log:function(e){var t,n;c.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=c.name+":",n=0;R=!1,clearTimeout(E.performance.timer),W.each(q,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",0<q.length&&(console.groupCollapsed(e),console.table?console.table(q):W.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,W.each(i,function(e,t){var n=e!==o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(W.isPlainObject(r[n])&&e!==o)r=r[n];else{if(void 0!==r[n])return s=r[n],!1;{if(!W.isPlainObject(r[t])||e===o)return void 0!==r[t]?s=r[t]:E.error(h.method,i),!1;r=r[t]}}})),Q(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&&(Q(c.templates[I])&&(c.autoShow=!0,c.className.flyout=c.className.template,c=W.extend(!0,{},c,c.templates[I].apply(E,K)),a=c.className,c.namespace,d=c.fields,h=c.error),E.initialize()),Q(c.templates[I])||E.invoke(I)):(void 0!==A&&A.invoke("destroy"),E.initialize(),N=v)}),void 0!==N?N:this},W.flyout=W.fn.flyout,W.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"}},W.fn.flyout.settings.templates={getArguments:function(e){e=[].slice.call(e);return W.isPlainObject(e[0])?W.extend({handler:function(){},content:"",title:""},e[0]):(Q(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===W(W.parseHTML(n.content)).filter(".ui.input").length&&(n.content+='<p><div class="'+e.className.prompt+'"><input placeholder="'+this.helpers.escape(n.placeholder||"")+'" type="text" value="'+this.helpers.escape(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(W(e).val())}},{text:e.text.cancel,class:e.className.cancel,click:function(){n.handler(null)}}]}}}}(jQuery,window,document);
|
11
|
+
!function(W,U,Z){"use strict";function _(e){return"function"==typeof e&&"number"!=typeof e.nodeType}U=void 0!==U&&U.Math===Math?U:globalThis,W.fn.flyout=function(D){var N,e=W(this),O=W(U),B=W(Z),L=(W("html"),W("head")),z=W("body"),R=Date.now(),q=[],I=D,j="string"==typeof I,K=[].slice.call(arguments,1),V=function(e,t){var n;return 0<=[U,Z].indexOf(e)?n=z:0===(n=W(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,c=W.isPlainObject(D)?W.extend(!0,{},W.fn.flyout.settings,D):W.extend({},W.fn.flyout.settings),l=c.selector,a=c.className,u=c.namespace,d=c.fields,f=c.regExp,h=c.error,g="."+u,p="module-"+u,v=W(this),m=V(c.context,U),b=v.find(l.close),y=v.children(l.flyout),k=m.children(l.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(),_(c.onHidden)||(c.onHidden=function(){E.destroy(),v.remove()}),c.autoShow||(c.autoShow=!0)),v.addClass(c.class),""!==c.title&&v.find(l.header).html(E.helpers.escape(c.title,c)).addClass(c.classTitle),""!==c.content&&v.find(l.content).html(E.helpers.escape(c.content,c)).addClass(c.classContent),E.has.configActions()&&(0===(s=v.find(l.actions).addClass(c.classActions)).length?s=W("<div/>",{class:a.actions+" "+(c.classActions||"")}).appendTo(v):s.empty(),c.actions.forEach(function(e){var t=e[d.icon]?"<i "+(e[d.text]?'aria-hidden="true"':"")+' class="'+E.helpers.escape(e[d.icon])+' icon"></i>':"",n=E.helpers.escape(e[d.text]||"",c),i=E.helpers.escape(e[d.class]||""),o=e[d.click]&&_(e[d.click])?e[d.click]:function(){};s.append(W("<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()}}}))})),c.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(),c.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=W("<div/>",{class:a.flyout,role:"dialog","aria-modal":c.dimPage}),c.closeIcon&&(b=W("<i/>",{class:a.close,role:"button",tabindex:0,"aria-label":c.text.close}),v.append(b)),""!==c.title&&(e="_"+E.get.id()+"title",v.attr("aria-labelledby",e),W("<div/>",{class:a.header,id:e}).appendTo(v)),""!==c.content&&(e="_"+E.get.id()+"desc",v.attr("aria-describedby",e),W("<div/>",{class:a.content,id:e}).appendTo(v)),E.has.configActions()&&W("<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===c.keys.escape&&(c.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&&Z.activeElement!==e.target&&E.is.visible()&&c.autofocus&&c.dimPage&&0===W(Z.activeElement).closest(l.flyout).length&&requestAnimationFrame(E.set.autofocus),P=!1},clickaway:function(e){var t;c.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!==c.keys.enter&&e!==c.keys.space||E.hide()},inputKeyDown:{first:function(e){e.which===c.keys.tab&&e.shiftKey&&(n.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==c.keys.tab||e.shiftKey||(n.first().trigger("focus"),e.preventDefault())}},approve:function(e){w||!1===c.onApprove.call(E.element,W(this))?E.verbose("Approve callback returned false cancelling close"):(w=!0,E.hide(function(){w=!1}))},deny:function(e){w||!1===c.onDeny.call(E.element,W(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===W(e.target).closest(l.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,l.close,E.event.close).on("click"+g,l.approve,E.event.approve).on("click"+g,l.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(){c.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=W(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 U&&((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<W(e.target).find(":input").addBack(":input").filter(":visible").length)&&(n=!0):(t=W(o(e.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),e=W(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(c.context,U),E.refreshFlyouts(),k=m.children(l.pusher),E.clear.cache()},refreshFlyouts:function(){E.verbose("Refreshing other flyouts"),y=m.children(l.flyout)},refreshInputs:function(e){n&&n.off("keydown"+s),c.dimPage&&(0===(n=v.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===W(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&&c.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(l.pusher).length&&(E.debug("Adding wrapper element for flyout"),E.error(h.pusher),k=W('<div class="pusher" />'),m.children().not(l.omitted).not(y).wrapAll(k),E.refresh()),0!==v.nextAll(l.pusher).length&&v.nextAll(l.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(l.header),t=v.children(l.content),n=v.children(l.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=W(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===c.onShow.call(S)?E.verbose("Show callback returned false cancelling show"):(E.refresh(),E.othersActive()&&(E.debug("Other flyouts currently visible"),c.exclusive?E.hideOthers():w=!1),E.set.dimmerStyles(),E.set.observeAttributes(!1),E.pushPage(function(){e.call(S),c.onVisible.call(S),c.keyboardShortcuts&&E.add.keyboardShortcuts(),E.save.focus(),E.refreshInputs(),requestAnimationFrame(E.set.observeAttributes)}),c.onChange.call(S)):E.debug("Flyout is already visible")},hide:function(e){if(e=_(e)?e:function(){},!1===c.onHide.call(S,W(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),_(c.onHidden)&&c.onHidden.call(S),E.restore.focus()}),c.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(),c.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),c.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(),c.keyboardShortcuts&&E.remove.keyboardShortcuts()),e=function(){E.set.overlay(),E.set.animating(),c.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(),c.returnScroll&&E.scrollBack(),c.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(){c.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(l.bodyFixed.replace("right",n)).each(function(){var e=W(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 c}},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<W(Z.activeElement).closest(v).length||(e=W(Z.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?U.innerWidth-Z.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(U.HTMLElement)||!!U.ApplePaySession),E.cache.isSafari},firefox:function(){return void 0===E.cache.isFirefox&&(E.cache.isFirefox=!!U.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(c.actions)&&0<c.actions.length},scrollbar:function(){return C||"hidden"!==m.css("overflow-y")}},restore:{focus:function(){e&&0<e.length&&c.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var n=E.can.leftBodyScrollbar()?"left":"right";m.css((C?"margin-":"padding-")+n,T),m.find(l.bodyFixed.replace("right",n)).each(function(){var e=W(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"")})}},helpers:{escape:function(e,t){if(void 0!==t&&t.preserveHTML)return e;const n={'"':""","&":"&","'":"'","<":"<",">":">"};return e.replace(/["'<>]|&(?![\d#A-Za-z]{1,12};)/g,e=>n[e])}},setting:function(e,t){if(E.debug("Changing setting",e,t),W.isPlainObject(e))W.extend(!0,c,e);else{if(void 0===t)return c[e];W.isPlainObject(c[e])?W.extend(!0,c[e],t):c[e]=t}},internal:function(e,t){if(W.isPlainObject(e))W.extend(!0,E,e);else{if(void 0===t)return E[e];E[e]=t}},debug:function(){!c.silent&&c.debug&&(c.performance?E.performance.log(arguments):(E.debug=Function.prototype.bind.call(console.info,console,c.name+":"),E.debug.apply(console,arguments)))},verbose:function(){!c.silent&&c.verbose&&c.debug&&(c.performance?E.performance.log(arguments):(E.verbose=Function.prototype.bind.call(console.info,console,c.name+":"),E.verbose.apply(console,arguments)))},error:function(){c.silent||(E.error=Function.prototype.bind.call(console.error,console,c.name+":"),E.error.apply(console,arguments))},performance:{log:function(e){var t,n;c.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=c.name+":",n=0;R=!1,clearTimeout(E.performance.timer),W.each(q,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",0<q.length&&(console.groupCollapsed(e),console.table?console.table(q):W.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,W.each(i,function(e,t){var n=e!==o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(W.isPlainObject(r[n])&&e!==o)r=r[n];else{if(void 0!==r[n])return s=r[n],!1;{if(!W.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&&(_(c.templates[I])&&(c.autoShow=!0,c.className.flyout=c.className.template,c=W.extend(!0,{},c,c.templates[I].apply(E,K)),a=c.className,c.namespace,d=c.fields,h=c.error),E.initialize()),_(c.templates[I])||E.invoke(I)):(void 0!==A&&A.invoke("destroy"),E.initialize(),N=v)}),void 0!==N?N:this},W.flyout=W.fn.flyout,W.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"}},W.fn.flyout.settings.templates={getArguments:function(e){e=[].slice.call(e);return W.isPlainObject(e[0])?W.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===W(W.parseHTML(n.content)).filter(".ui.input").length&&(n.content+='<p><div class="'+e.className.prompt+'"><input placeholder="'+this.helpers.escape(n.placeholder||"")+'" type="text" value="'+this.helpers.escape(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(W(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.7+13b1bae - Modal
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -931,25 +931,17 @@
|
|
931
931
|
if (settings !== undefined && settings.preserveHTML) {
|
932
932
|
return string;
|
933
933
|
}
|
934
|
-
var
|
935
|
-
badChars = /["'<>]/g,
|
936
|
-
shouldEscape = /["&'<>]/,
|
937
|
-
escape = {
|
938
|
-
'<': '<',
|
939
|
-
'>': '>',
|
940
|
-
'"': '"',
|
941
|
-
"'": ''',
|
942
|
-
},
|
943
|
-
escapedChar = function (chr) {
|
944
|
-
return escape[chr];
|
945
|
-
}
|
946
|
-
;
|
947
|
-
if (shouldEscape.test(string)) {
|
948
|
-
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
949
|
-
string = string.replace(badChars, escapedChar);
|
950
|
-
}
|
951
934
|
|
952
|
-
|
935
|
+
const badChars = /["'<>]|&(?![\d#A-Za-z]{1,12};)/g;
|
936
|
+
const escape = {
|
937
|
+
'"': '"',
|
938
|
+
'&': '&',
|
939
|
+
"'": ''',
|
940
|
+
'<': '<',
|
941
|
+
'>': '>',
|
942
|
+
};
|
943
|
+
|
944
|
+
return string.replace(badChars, (chr) => escape[chr]);
|
953
945
|
},
|
954
946
|
},
|
955
947
|
can: {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.10.0-beta.
|
2
|
+
* # Fomantic UI - 2.10.0-beta.7+13b1bae
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(V,X,_){"use strict";function Q(e){return"function"==typeof e&&"number"!=typeof e.nodeType}X=void 0!==X&&X.Math===Math?X:globalThis,V.fn.modal=function(L){var z,e=V(this),q=V(X),I=V(_),B=V("body"),W=Date.now(),j=[],P=L,K="string"==typeof P,R=[].slice.call(arguments,1),U=function(e,t){var n;return 0<=[X,_].indexOf(e)?n=B:0===(n=V(t.document).find(e)).length&&(n=t.frameElement?U(e,t.parent):B),n};return e.each(function(){var n,o,a,e,i,t,s,r,c,l,d,u=V.isPlainObject(L)?V.extend(!0,{},V.fn.modal.settings,L):V.extend({},V.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,v=u.error,p="."+h,b="module-"+h,y=V(this),k=U(u.context,X),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(),Q(u.onHidden)||(u.onHidden=function(){E.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(f.title).html(E.helpers.escape(u.title,u)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(E.helpers.escape(u.content,u)).addClass(u.classContent),E.has.configActions()&&(0===(a=y.find(f.actions).addClass(u.classActions)).length?a=V("<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.escape(e[g.icon])+' icon"></i>':"",n=E.helpers.escape(e[g.text]||"",u),i=E.helpers.escape(e[g.class]||""),o=e[g.click]&&Q(e[g.click])?e[g.click]:function(){};a.append(V("<button/>",{html:t+n,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+i,on:{click:function(){var e=V(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=V("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(w=V("<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),V("<div/>",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+E.get.id()+"desc",y.attr("aria-describedby",e),V("<div/>",{class:m.content,id:e}).appendTo(y)),E.has.configActions()&&V("<div/>",{class:m.actions}).appendTo(y),k.append(y),S=y[0]},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},e=V.extend(!0,e,u.dimmerSettings);void 0===V.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&&V("<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 X&&((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<V(e.target).find(":input").addBack(":input").filter(":visible").length)&&(i=!0):(n=!0,t=V(o(e.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),e=V(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===V(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=V(e);t=Q(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,V(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,V(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=V(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<V(e.target).closest(f.modal).length,e=V.contains(_.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&&_.activeElement!==e.target&&i.dimmer("is active")&&E.is.active()&&u.autofocus&&0===V(_.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=Q(e)?e:function(){},E.refreshModals(),E.set.dimmerSettings(),E.set.dimmerStyles(),E.showModal(e)},hide:function(e){return e=Q(e)?e:function(){},E.refreshModals(),E.hideModal(e)},showModal:function(e){e=Q(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!==V.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=Q(e)?e:function(){},!1===u.onHide.call(S,V(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!==V.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")),Q(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=Q(n)?n:function(){},0<e.length)return E.debug("Hiding all visible modals"),i=!0,V(e.get().reverse()).each(function(e,t){i=i&&V(t).modal("hide modal",n,!1,!0)}),i&&E.hideDimmer(),i},hideOthers:function(e){var t=a.filter("."+m.active+", ."+m.animating);e=Q(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<V(_.activeElement).closest(y).length||(e=V(_.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?X.innerWidth-_.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=V(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||(V.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:{escape:function(e,t){if(void 0!==t&&t.preserveHTML)return e;var n={"<":"<",">":">",'"':""","'":"'"};return e=/["&'<>]/.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===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(X.HTMLElement)||!!X.ApplePaySession),E.cache.isSafari},firefox:function(){return void 0===E.cache.isFirefox&&(E.cache.isFirefox=!!X.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=V(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===V.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=V.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),V.isPlainObject(e))V.extend(!0,u,e);else{if(void 0===t)return u[e];V.isPlainObject(u[e])?V.extend(!0,u[e],t):u[e]=t}},internal:function(e,t){if(V.isPlainObject(e))V.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),V.each(j,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",0<j.length&&(console.groupCollapsed(e),console.table?console.table(j):V.each(j,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(i,e,t){var o,a,n,s=M;return e=e||R,t=t||S,"string"==typeof i&&void 0!==s&&(i=i.split(/[ .]/),o=i.length-1,V.each(i,function(e,t){var n=e!==o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(V.isPlainObject(s[n])&&e!==o)s=s[n];else{if(void 0!==s[n])return a=s[n],!1;{if(!V.isPlainObject(s[t])||e===o)return void 0!==s[t]?a=s[t]:E.error(v.method,i),!1;s=s[t]}}})),Q(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&&(Q(u.templates[P])&&(u.autoShow=!0,u.className.modal=u.className.template,u=V.extend(!0,{},u,u.templates[P].apply(E,R)),m=u.className,u.namespace,g=u.fields,v=u.error),E.initialize()),Q(u.templates[P])||E.invoke(P)):(void 0!==M&&M.invoke("destroy"),E.initialize(),z=y)}),void 0!==z?z:this},V.modal=V.fn.modal,V.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"}},V.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return V.isPlainObject(e[0])?V.extend({handler:function(){},content:"",title:""},e[0]):(Q(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(V(e).val())}function t(){o.handler(null)}var n=this,i=this.get.settings(),o=i.templates.getArguments(arguments);return 0===V(V.parseHTML(o.content)).filter(".ui.input").length&&(o.content+='<p><div class="'+this.helpers.escape(i.className.prompt)+'"><input placeholder="'+this.helpers.escape(o.placeholder||"")+'" type="text" value="'+this.helpers.escape(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(V,X,_){"use strict";function Q(e){return"function"==typeof e&&"number"!=typeof e.nodeType}X=void 0!==X&&X.Math===Math?X:globalThis,V.fn.modal=function(L){var z,e=V(this),q=V(X),I=V(_),B=V("body"),W=Date.now(),j=[],P=L,K="string"==typeof P,R=[].slice.call(arguments,1),U=function(e,t){var n;return 0<=[X,_].indexOf(e)?n=B:0===(n=V(t.document).find(e)).length&&(n=t.frameElement?U(e,t.parent):B),n};return e.each(function(){var n,o,a,e,i,t,s,r,c,l,d,u=V.isPlainObject(L)?V.extend(!0,{},V.fn.modal.settings,L):V.extend({},V.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,v=u.error,p="."+h,b="module-"+h,y=V(this),k=U(u.context,X),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(),Q(u.onHidden)||(u.onHidden=function(){E.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(f.title).html(E.helpers.escape(u.title,u)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(E.helpers.escape(u.content,u)).addClass(u.classContent),E.has.configActions()&&(0===(a=y.find(f.actions).addClass(u.classActions)).length?a=V("<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.escape(e[g.icon])+' icon"></i>':"",n=E.helpers.escape(e[g.text]||"",u),i=E.helpers.escape(e[g.class]||""),o=e[g.click]&&Q(e[g.click])?e[g.click]:function(){};a.append(V("<button/>",{html:t+n,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+i,on:{click:function(){var e=V(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=V("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(w=V("<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),V("<div/>",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+E.get.id()+"desc",y.attr("aria-describedby",e),V("<div/>",{class:m.content,id:e}).appendTo(y)),E.has.configActions()&&V("<div/>",{class:m.actions}).appendTo(y),k.append(y),S=y[0]},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},e=V.extend(!0,e,u.dimmerSettings);void 0===V.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&&V("<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 X&&((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<V(e.target).find(":input").addBack(":input").filter(":visible").length)&&(i=!0):(n=!0,t=V(o(e.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),e=V(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===V(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=V(e);t=Q(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,V(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,V(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=V(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<V(e.target).closest(f.modal).length,e=V.contains(_.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&&_.activeElement!==e.target&&i.dimmer("is active")&&E.is.active()&&u.autofocus&&0===V(_.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=Q(e)?e:function(){},E.refreshModals(),E.set.dimmerSettings(),E.set.dimmerStyles(),E.showModal(e)},hide:function(e){return e=Q(e)?e:function(){},E.refreshModals(),E.hideModal(e)},showModal:function(e){e=Q(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!==V.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=Q(e)?e:function(){},!1===u.onHide.call(S,V(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!==V.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")),Q(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=Q(n)?n:function(){},0<e.length)return E.debug("Hiding all visible modals"),i=!0,V(e.get().reverse()).each(function(e,t){i=i&&V(t).modal("hide modal",n,!1,!0)}),i&&E.hideDimmer(),i},hideOthers:function(e){var t=a.filter("."+m.active+", ."+m.animating);e=Q(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<V(_.activeElement).closest(y).length||(e=V(_.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?X.innerWidth-_.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=V(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||(V.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:{escape:function(e,t){if(void 0!==t&&t.preserveHTML)return e;const n={'"':""","&":"&","'":"'","<":"<",">":">"};return e.replace(/["'<>]|&(?![\d#A-Za-z]{1,12};)/g,e=>n[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(X.HTMLElement)||!!X.ApplePaySession),E.cache.isSafari},firefox:function(){return void 0===E.cache.isFirefox&&(E.cache.isFirefox=!!X.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=V(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===V.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=V.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),V.isPlainObject(e))V.extend(!0,u,e);else{if(void 0===t)return u[e];V.isPlainObject(u[e])?V.extend(!0,u[e],t):u[e]=t}},internal:function(e,t){if(V.isPlainObject(e))V.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),V.each(j,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",0<j.length&&(console.groupCollapsed(e),console.table?console.table(j):V.each(j,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(i,e,t){var o,a,n,s=M;return e=e||R,t=t||S,"string"==typeof i&&void 0!==s&&(i=i.split(/[ .]/),o=i.length-1,V.each(i,function(e,t){var n=e!==o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(V.isPlainObject(s[n])&&e!==o)s=s[n];else{if(void 0!==s[n])return a=s[n],!1;{if(!V.isPlainObject(s[t])||e===o)return void 0!==s[t]?a=s[t]:E.error(v.method,i),!1;s=s[t]}}})),Q(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&&(Q(u.templates[P])&&(u.autoShow=!0,u.className.modal=u.className.template,u=V.extend(!0,{},u,u.templates[P].apply(E,R)),m=u.className,u.namespace,g=u.fields,v=u.error),E.initialize()),Q(u.templates[P])||E.invoke(P)):(void 0!==M&&M.invoke("destroy"),E.initialize(),z=y)}),void 0!==z?z:this},V.modal=V.fn.modal,V.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"}},V.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return V.isPlainObject(e[0])?V.extend({handler:function(){},content:"",title:""},e[0]):(Q(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(V(e).val())}function t(){o.handler(null)}var n=this,i=this.get.settings(),o=i.templates.getArguments(arguments);return 0===V(V.parseHTML(o.content)).filter(".ui.input").length&&(o.content+='<p><div class="'+this.helpers.escape(i.className.prompt)+'"><input placeholder="'+this.helpers.escape(o.placeholder||"")+'" type="text" value="'+this.helpers.escape(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