fomantic-ui 2.10.0-beta.33 → 2.10.0-beta.34
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 +1 -1
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +1 -1
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +1 -1
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +1 -1
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +6 -5
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +1 -1
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/menu.css +1 -1
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +6 -5
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +1 -1
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +1 -1
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +1 -1
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +1 -1
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +1 -1
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +1 -1
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +1 -1
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +1 -1
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +1 -1
- 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 +6 -5
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +1 -1
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +1 -1
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +1 -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 +1 -1
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +1 -1
- 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 +41 -38
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/src/definitions/modules/flyout.js +5 -4
- package/src/definitions/modules/modal.js +5 -4
- package/src/definitions/modules/sidebar.js +5 -4
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.34+f83a7e7 - Modal
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -82,7 +82,8 @@
|
|
82
82
|
let initialMouseDownInModal;
|
83
83
|
let initialMouseDownInScrollbar;
|
84
84
|
let initialBodyMargin = '';
|
85
|
-
let
|
85
|
+
let initialBodyMarginInt = 0;
|
86
|
+
let tempBodyMargin = 0;
|
86
87
|
let keepScrollingClass = false;
|
87
88
|
let hadScrollbar = false;
|
88
89
|
let windowRefocused = false;
|
@@ -779,9 +780,9 @@
|
|
779
780
|
},
|
780
781
|
bodyMargin: function () {
|
781
782
|
initialBodyMargin = $context.css((isBody ? 'margin-' : 'padding-') + (module.can.leftBodyScrollbar() ? 'left' : 'right'));
|
782
|
-
|
783
|
+
initialBodyMarginInt = parseInt(initialBodyMargin.replace(/[^\d.]/g, ''), 10);
|
783
784
|
let bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth;
|
784
|
-
tempBodyMargin =
|
785
|
+
tempBodyMargin = initialBodyMarginInt + bodyScrollbarWidth;
|
785
786
|
},
|
786
787
|
},
|
787
788
|
|
@@ -793,7 +794,7 @@
|
|
793
794
|
},
|
794
795
|
bodyMargin: function () {
|
795
796
|
let position = module.can.leftBodyScrollbar() ? 'left' : 'right';
|
796
|
-
$context.css((isBody ? 'margin-' : 'padding-') + position, initialBodyMargin);
|
797
|
+
$context.css((isBody ? 'margin-' : 'padding-') + position, initialBodyMarginInt === 0 ? '' : initialBodyMargin);
|
797
798
|
$context.find(selector.bodyFixed.replace('right', position)).each(function () {
|
798
799
|
let el = $(this);
|
799
800
|
let attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.10.0-beta.
|
2
|
+
* # Fomantic UI - 2.10.0-beta.34+f83a7e7
|
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){let e=V(this),z=V(X),q=V(_),I=V("body"),B=Date.now(),W=[],j=L,P="string"==typeof j,K=[].slice.call(arguments,1),R=function(e,t){let n;return 0<=[X,_].indexOf(e)?n=I:0===(n=V(t.document).find(e)).length&&(n=t.frameElement?R(e,t.parent):I),n},U;return e.each(function(){let r=V.isPlainObject(L)?V.extend(!0,{},V.fn.modal.settings,L):V.extend({},V.fn.modal.settings),a=r.selector,c=r.className;var e=r.namespace;let l=r.fields,d=r.error,i="."+e,t="module-"+e,u=V(this),o=R(r.context,X),s=o[0]===I[0],n=u.find(a.closeIcon),f,m,h,g,p,v,b=u.hasClass("modal"),y=this,k=b?u.data(t):void 0,x=!1,w,C,S="",M="",A=!1,D=!1,T=!1,H,F,N,E=!1,O;O={initialize:function(){if(O.create.id(),b||(O.create.modal(),Q(r.onHidden)||(r.onHidden=function(){O.destroy(),u.remove()})),u.addClass(r.class),""!==r.title&&u.find(a.title).html(O.helpers.escape(r.title,r)).addClass(r.classTitle),""!==r.content&&u.find(a.content).html(O.helpers.escape(r.content,r)).addClass(r.classContent),O.has.configActions()){let s=u.find(a.actions).addClass(r.classActions);0===s.length?s=V("<div/>",{class:c.actions+" "+(r.classActions||"")}).appendTo(u):s.empty(),r.actions.forEach(function(e){var t=e[l.icon]?"<i "+(e[l.text]?'aria-hidden="true"':"")+' class="'+O.helpers.escape(e[l.icon])+' icon"></i>':"",n=O.helpers.escape(e[l.text]||"",r),i=O.helpers.escape(e[l.class]||"");let o=e[l.click]&&Q(e[l.click])?e[l.click]:function(){};s.append(V("<button/>",{html:t+n,"aria-label":(e[l.text]||e[l.icon]||"").replace(/<[^>]+(>|$)/g,""),class:c.button+" "+i,on:{click:function(){let e=V(this);e.is(a.approve)||e.is(a.deny)||!1===o.call(y,u)||O.hide()}}}))})}O.cache={},O.verbose("Initializing dimmer",o),O.create.dimmer(),r.allowMultiple&&O.create.innerDimmer(),r.centered||u.addClass("top aligned"),O.refreshModals(),O.bind.events(),O.observeChanges(),O.instantiate(),r.autoShow&&O.show()},instantiate:function(){O.verbose("Storing instance of modal"),k=O,u.data(t,k)},create:{modal:function(){var e;u=V("<div/>",{class:c.modal,role:"dialog","aria-modal":!0}),r.closeIcon&&(n=V("<i/>",{class:c.close,role:"button",tabindex:0,"aria-label":r.text.close}),u.append(n)),""!==r.title&&(e="_"+O.get.id()+"title",u.attr("aria-labelledby",e),V("<div/>",{class:c.title,id:e}).appendTo(u)),""!==r.content&&(e="_"+O.get.id()+"desc",u.attr("aria-describedby",e),V("<div/>",{class:c.content,id:e}).appendTo(u)),O.has.configActions()&&V("<div/>",{class:c.actions}).appendTo(u),o.append(u),y=u[0]},dimmer:function(){var e={debug:r.debug,dimmerName:"modals"},e=V.extend(!0,e,r.dimmerSettings);void 0===V.fn.dimmer?O.error(d.dimmer):(O.debug("Creating dimmer"),p=o.dimmer(e),A=O.is.scrolling(),r.detachable?(O.verbose("Modal is detachable, moving content into dimmer"),p.dimmer("add content",u)):O.set.undetached(),v=p.dimmer("get dimmer"))},id:function(){F=(Math.random().toString(16)+"000000000").slice(2,10),H="."+F,O.verbose("Creating unique id for element",F)},innerDimmer:function(){0===u.find(a.dimmer).length&&V("<div/>",{class:c.innerDimmer}).prependTo(u)}},destroy:function(){N&&N.disconnect(),O.verbose("Destroying previous modal"),u.removeData(t).off(i),z.off(H),o.off(H),v.off(H),n.off(H),f&&f.off(H),o.dimmer("destroy")},observeChanges:function(){(N=new MutationObserver(function(e){function o(n){let i=[];for(let e=0,t=n.length;e<t;e++)Array.prototype.push.apply(i,o(n[e].childNodes)),i.push(n[e]);return i}let i=!1,s=!1,a=!0;e.every(function(n){if("attributes"===n.type)E&&("disabled"===n.attributeName||0<V(n.target).find(":input").addBack(":input").filter(":visible").length)&&(s=!0);else{i=!0;let e=V(o(n.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),t=V(o(n.removedNodes)).filter("a[href], [tabindex], :input");(0<e.length||0<t.length)&&(s=!0,(0<e.filter(":input").length||0<t.filter(":input").length)&&(a=!1))}return!s}),i&&r.observeChanges&&(O.debug("DOM tree modified, refreshing"),O.refresh()),s&&O.refreshInputs(a)})).observe(y,{attributeFilter:["class","disabled"],attributes:!0,childList:!0,subtree:!0}),O.debug("Setting up mutation observer",N)},refresh:function(){O.remove.scrolling(),O.cacheSizes(),O.can.useFlex()||O.set.modalOffset(),O.set.screenHeight(),O.set.type()},refreshModals:function(){h=u.siblings(a.modal),m=h.add(u)},refreshInputs:function(e){f&&f.off("keydown"+H),0===(f=u.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===V(this).closest(".disabled").length})).filter(":input").length?(f=u.add(f),u.attr("tabindex",-1)):u.removeAttr("tabindex"),f.first().on("keydown"+H,O.event.inputKeyDown.first),f.last().on("keydown"+H,O.event.inputKeyDown.last),!e&&r.autofocus&&0===f.filter(":focus").length&&O.set.autofocus()},attachEvents:function(e,t){let n=V(e);t=Q(O[t])?O[t]:O.toggle,0<n.length?(O.debug("Attaching modal events to element",e,t),n.off(i).on("click"+i,t)):O.error(d.notFound,e)},bind:{events:function(){O.verbose("Attaching events"),u.on("click"+i,a.close,O.event.close).on("click"+i,a.approve,O.event.approve).on("click"+i,a.deny,O.event.deny),n.on("keyup"+H,O.event.closeKeyUp),z.on("resize"+H,O.event.resize).on("focus"+H,O.event.focus),o.on("click"+H,O.event.click)},scrollLock:function(){p[0].addEventListener("touchmove",O.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){p[0].removeEventListener("touchmove",O.event.preventScroll,{passive:!1})}},get:{id:function(){return F},element:function(){return u},settings:function(){return r}},event:{approve:function(){x||!1===r.onApprove.call(y,V(this))?O.verbose("Approve callback returned false cancelling hide"):(x=!0,O.hide(function(){x=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){x||!1===r.onDeny.call(y,V(this))?O.verbose("Deny callback returned false cancelling hide"):(x=!0,O.hide(function(){x=!1}))},close:function(){O.hide()},closeKeyUp:function(e){e=e.which;e!==r.keys.enter&&e!==r.keys.space||!u.hasClass(c.front)||O.hide()},inputKeyDown:{first:function(e){e.which===r.keys.tab&&e.shiftKey&&(f.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==r.keys.tab||e.shiftKey||(f.first().trigger("focus"),e.preventDefault())}},mousedown:function(e){let t=V(e.target);var n=O.is.rtl();(w=0<t.closest(a.modal).length)&&O.verbose("Mouse down event registered inside the modal"),(C=O.is.scrolling()&&(!n&&z.outerWidth()-r.scrollbarWidth<=e.clientX||n&&r.scrollbarWidth>=e.clientX))&&O.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(t){if(r.closable)if(w)O.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(C)O.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{let e=V(t.target);var n=0<e.closest(a.modal).length,t=V.contains(_.documentElement,t.target);if(!n&&t&&O.is.active()&&u.hasClass(c.front)){if(O.debug("Dimmer clicked, hiding all modals"),r.allowMultiple){if(!O.hideAll())return}else if(!O.hide())return;O.remove.clickaway()}}else O.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(O.timer),O.timer=setTimeout(function(){e()},t)},keyboard:function(e){e.which===r.keys.escape&&(r.closable?(O.debug("Escape key pressed hiding modal"),u.hasClass(c.front)&&O.hide()):O.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){p.dimmer("is active")&&(O.is.animating()||O.is.active())&&requestAnimationFrame(O.refresh)},focus:function(){T=!0},click:function(e){T&&_.activeElement!==e.target&&p.dimmer("is active")&&O.is.active()&&r.autofocus&&0===V(_.activeElement).closest(a.modal).length&&requestAnimationFrame(O.set.autofocus),T=!1}},toggle:function(){O.is.active()||O.is.animating()?O.hide():O.show()},show:function(e){e=Q(e)?e:function(){},O.refreshModals(),O.set.dimmerSettings(),O.set.dimmerStyles(),O.showModal(e)},hide:function(e){return e=Q(e)?e:function(){},O.refreshModals(),O.hideModal(e)},showModal:function(e){e=Q(e)?e:function(){},O.is.animating()||!O.is.active()?!1===r.onShow.call(y)?O.verbose("Show callback returned false cancelling show"):(D=O.has.scrollbar(),O.showDimmer(),O.cacheSizes(),D&&O.set.bodyMargin(),O.can.useFlex()?O.remove.legacy():(O.set.legacy(),O.set.modalOffset(),O.debug("Using non-flex legacy modal positioning.")),O.set.screenHeight(),O.set.type(),O.set.clickaway(),!r.allowMultiple&&O.others.active()?O.hideOthers(O.showModal):(x=!1,r.allowMultiple&&(O.others.active()&&h.filter("."+c.active).find(a.dimmer).removeClass("out").addClass("transition fade in active"),r.detachable&&u.detach().appendTo(v)),r.transition&&void 0!==V.fn.transition?(O.debug("Showing modal with css animations"),O.set.observeAttributes(!1),u.transition({debug:r.debug,verbose:r.verbose,silent:r.silent,animation:(r.transition.showMethod||r.transition)+" in",queue:r.queue,duration:r.transition.showDuration||r.duration,useFailSafe:!0,onComplete:function(){r.onVisible.apply(y),r.keyboardShortcuts&&O.add.keyboardShortcuts(),O.save.focus(),O.set.active(),O.refreshInputs(),requestAnimationFrame(O.set.observeAttributes),e()}})):O.error(d.noTransition))):O.debug("Modal is already visible")},hideModal:function(e,t,n){let i=h.filter("."+c.active).last();if(e=Q(e)?e:function(){},!1===r.onHide.call(y,V(this)))return O.verbose("Hide callback returned false cancelling hide"),x=!1;(O.is.animating()||O.is.active())&&(O.debug("Hiding modal"),r.transition&&void 0!==V.fn.transition?(O.remove.active(),O.set.observeAttributes(!1),u.transition({debug:r.debug,verbose:r.verbose,silent:r.silent,animation:(r.transition.hideMethod||r.transition)+" out",queue:r.queue,duration:r.transition.hideDuration||r.duration,useFailSafe:!0,onStart:function(){O.others.active()||O.others.animating()||t?r.allowMultiple&&(n?m:i).find(a.dimmer).removeClass("in").addClass("out"):O.hideDimmer(),r.keyboardShortcuts&&!O.others.active()&&O.remove.keyboardShortcuts()},onComplete:function(){O.unbind.scrollLock(),O.remove.active(),r.allowMultiple&&(i.addClass(c.front),u.removeClass(c.front),(n?m:i).find(a.dimmer).removeClass("active")),Q(r.onHidden)&&r.onHidden.call(y),O.remove.dimmerStyles(),O.restore.focus(),e()}})):O.error(d.noTransition))},showDimmer:function(){p.dimmer("is animating")||!p.dimmer("is active")?(D&&(s||v.css("top",p.scrollTop()),O.save.bodyMargin()),O.debug("Showing dimmer"),p.dimmer("show")):O.debug("Dimmer already visible")},hideDimmer:function(){p.dimmer("is animating")||p.dimmer("is active")?(O.unbind.scrollLock(),p.dimmer("hide",function(){D&&O.restore.bodyMargin(),O.remove.clickaway(),O.remove.screenHeight()})):O.debug("Dimmer is not visible cannot hide")},hideAll:function(i){let e=m.filter("."+c.active+", ."+c.animating);if(i=Q(i)?i:function(){},0<e.length){O.debug("Hiding all visible modals");let n=!0;return V(e.get().reverse()).each(function(e,t){n=n&&V(t).modal("hide modal",i,!1,!0)}),n&&O.hideDimmer(),n}},hideOthers:function(e){let t=h.filter("."+c.active+", ."+c.animating);e=Q(e)?e:function(){},0<t.length&&(O.debug("Hiding other modals",h),t.modal("hide modal",e,!0))},others:{active:function(){return 0<h.filter("."+c.active).length},animating:function(){return 0<h.filter("."+c.animating).length}},add:{keyboardShortcuts:function(){O.verbose("Adding keyboard shortcuts"),q.on("keydown"+i,O.event.keyboard)}},save:{focus:function(){let e=V(_.activeElement);0<e.closest(u).length||(g=V(_.activeElement).trigger("blur"))},bodyMargin:function(){S=o.css((s?"margin-":"padding-")+(O.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(S.replace(/[^\d.]/g,""),10),t=s?X.innerWidth-_.documentElement.clientWidth:o[0].offsetWidth-o[0].clientWidth;M=e+t}},restore:{focus:function(){g&&0<g.length&&r.restoreFocus&&g.trigger("focus")},bodyMargin:function(){let n=O.can.leftBodyScrollbar()?"left":"right";o.css((s?"margin-":"padding-")+n,S),o.find(a.bodyFixed.replace("right",n)).each(function(){let e=V(this);var t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"")})}},remove:{active:function(){u.removeClass(c.active)},legacy:function(){u.removeClass(c.legacy)},clickaway:function(){r.detachable||u.off("mousedown"+H),v.off("mousedown"+H),v.off("mouseup"+H)},dimmerStyles:function(){v.removeClass(c.inverted),p.removeClass(c.blurring)},bodyStyle:function(){""===o.attr("style")&&(O.verbose("Removing style attribute"),o.removeAttr("style"))},screenHeight:function(){O.debug("Removing page height"),o.css("height",""),O.remove.bodyStyle()},keyboardShortcuts:function(){O.verbose("Removing keyboard shortcuts"),q.off("keydown"+i)},scrolling:function(){A||p.removeClass(c.scrolling),u.removeClass(c.scrolling)}},cacheSizes:function(){u.addClass(c.loading);var e=u.prop("scrollHeight"),t=u.outerWidth(),n=u.outerHeight();void 0!==O.cache.pageHeight&&0===n||(V.extend(O.cache,{pageHeight:q.outerHeight(),width:t,height:n+r.offset,scrollHeight:e+r.offset,contextHeight:(s?z:p).height()}),O.cache.topOffset=-O.cache.height/2),u.removeClass(c.loading),O.debug("Caching modal and container sizes",O.cache)},helpers:{escape:function(e,t){if(void 0!==t&&t.preserveHTML)return e;const n={'"':""","&":"&","'":"'","<":"<",">":">"};return String(e).replace(/["&'<>]/g,e=>n[e])}},can:{leftBodyScrollbar:function(){return void 0===O.cache.leftBodyScrollbar&&(O.cache.leftBodyScrollbar=O.is.rtl()&&(O.is.iframe&&!O.is.firefox()||O.is.safari())),O.cache.leftBodyScrollbar},useFlex:function(){return"auto"===r.useFlex?r.detachable:(r.useFlex&&!r.detachable&&O.debug("useFlex true in combination with detachable false is not supported"),r.useFlex)},fit:function(){var e=O.cache.contextHeight,t=O.cache.contextHeight/2,n=O.cache.topOffset,i=O.cache.scrollHeight,o=O.cache.height,s=r.padding;return o<i?t+n+i+s<e:o+2*s<e}},has:{configActions:function(){return Array.isArray(r.actions)&&0<r.actions.length},scrollbar:function(){return s||"hidden"!==o.css("overflow-y")}},is:{active:function(){return u.hasClass(c.active)},animating:function(){return u.transition("is animating")},scrolling:function(){return p.hasClass(c.scrolling)},rtl:function(){return void 0===O.cache.isRTL&&(O.cache.isRTL="rtl"===u.attr("dir")||"rtl"===u.css("direction")||"rtl"===I.attr("dir")||"rtl"===I.css("direction")||"rtl"===o.attr("dir")||"rtl"===o.css("direction")),O.cache.isRTL},safari:function(){return void 0===O.cache.isSafari&&(O.cache.isSafari=/constructor/i.test(X.HTMLElement)||!!X.ApplePaySession),O.cache.isSafari},firefox:function(){return void 0===O.cache.isFirefox&&(O.cache.isFirefox=!!X.InstallTrigger),O.cache.isFirefox},iframe:function(){return!(self===top)}},set:{observeAttributes:function(e){E=!1!==e},autofocus:function(){let e=f.filter("[autofocus]"),t=f.filter(":input"),n=(0<e.length?e:0<t.length?t:u).first();n.trigger("focus")},bodyMargin:function(){let n=O.can.leftBodyScrollbar()?"left":"right";(r.detachable||O.can.fit())&&o.css((s?"margin-":"padding-")+n,M+"px"),o.find(a.bodyFixed.replace("right",n)).each(function(){let e=V(this);var t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"calc("+e.css(t)+" + "+M+"px)")})},clickaway:function(){r.detachable||u.on("mousedown"+H,O.event.mousedown),v.on("mousedown"+H,O.event.mousedown),v.on("mouseup"+H,O.event.mouseup)},dimmerSettings:function(){if(void 0===V.fn.dimmer)O.error(d.dimmer);else{var t={debug:r.debug,dimmerName:"modals",closable:"auto",useFlex:O.can.useFlex(),duration:{show:r.transition.showDuration||r.duration,hide:r.transition.hideDuration||r.duration}};let e=V.extend(!0,t,r.dimmerSettings);r.inverted&&(e.variation=void 0!==e.variation?e.variation+" inverted":"inverted"),o.dimmer("setting",e)}},dimmerStyles:function(){r.inverted?v.addClass(c.inverted):v.removeClass(c.inverted),r.blurring?p.addClass(c.blurring):p.removeClass(c.blurring)},modalOffset:function(){var e;r.detachable?u.css({marginTop:!u.hasClass("aligned")&&O.can.fit()?-O.cache.height/2:r.padding/2,marginLeft:-O.cache.width/2}):(e=O.can.fit(),u.css({top:!u.hasClass("aligned")&&e?q.scrollTop()+(O.cache.contextHeight-O.cache.height)/2:!e||u.hasClass("top")?q.scrollTop()+r.padding:q.scrollTop()+(O.cache.contextHeight-O.cache.height-r.padding),marginLeft:-O.cache.width/2})),O.verbose("Setting modal offset for legacy mode")},screenHeight:function(){O.can.fit()?o.css("height",""):u.hasClass("bottom")||(O.debug("Modal is taller than page content, resizing page height"),o.css("height",O.cache.height+2*r.padding+"px"))},active:function(){u.addClass(c.active+" "+c.front),h.filter("."+c.active).removeClass(c.front)},scrolling:function(){p.addClass(c.scrolling),u.addClass(c.scrolling),O.unbind.scrollLock()},legacy:function(){u.addClass(c.legacy)},type:function(){O.can.fit()?(O.verbose("Modal fits on screen"),O.others.active()||O.others.animating()||(O.remove.scrolling(),O.bind.scrollLock())):u.hasClass("bottom")?O.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(O.verbose("Modal cannot fit on screen setting to scrolling"),O.set.scrolling())},undetached:function(){p.addClass(c.undetached)}},setting:function(e,t){if(O.debug("Changing setting",e,t),V.isPlainObject(e))V.extend(!0,r,e);else{if(void 0===t)return r[e];V.isPlainObject(r[e])?V.extend(!0,r[e],t):r[e]=t}},internal:function(e,t){if(V.isPlainObject(e))V.extend(!0,O,e);else{if(void 0===t)return O[e];O[e]=t}},debug:function(){!r.silent&&r.debug&&(r.performance?O.performance.log(arguments):(O.debug=Function.prototype.bind.call(console.info,console,r.name+":"),O.debug.apply(console,arguments)))},verbose:function(){!r.silent&&r.verbose&&r.debug&&(r.performance?O.performance.log(arguments):(O.verbose=Function.prototype.bind.call(console.info,console,r.name+":"),O.verbose.apply(console,arguments)))},error:function(){r.silent||(O.error=Function.prototype.bind.call(console.error,console,r.name+":"),O.error.apply(console,arguments))},performance:{log:function(e){var t,n;r.performance&&(n=(t=Date.now())-(B||t),B=t,W.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:y,"Execution Time":n})),clearTimeout(O.performance.timer),O.performance.timer=setTimeout(function(){O.performance.display()},500)},display:function(){var e=r.name+":";let n=0;B=!1,clearTimeout(O.performance.timer),V.each(W,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",0<W.length&&(console.groupCollapsed(e),console.table?console.table(W):V.each(W,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),W=[]}},invoke:function(i,e,t){let o=k,s,a,n;return e=e||K,t=t||y,"string"==typeof i&&void 0!==o&&(i=i.split(/[ .]/),s=i.length-1,V.each(i,function(e,t){var n=e!==s?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(V.isPlainObject(o[n])&&e!==s)o=o[n];else{if(void 0!==o[n])return a=o[n],!1;{if(!V.isPlainObject(o[t])||e===s)return void 0!==o[t]?a=o[t]:O.error(d.method,i),!1;o=o[t]}}})),Q(a)?n=a.apply(t,e):void 0!==a&&(n=a),Array.isArray(U)?U.push(n):void 0!==U?U=[U,n]:void 0!==n&&(U=n),a}},P?(void 0===k&&(Q(r.templates[j])&&(r.autoShow=!0,r.className.modal=r.className.template,r=V.extend(!0,{},r,r.templates[j].apply(O,K)),c=r.className,r.namespace,l=r.fields,d=r.error),O.initialize()),Q(r.templates[j])||O.invoke(j)):(void 0!==k&&k.invoke("destroy"),O.initialize(),U=u)}),void 0!==U?U: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){let t=[].slice.call(e);return V.isPlainObject(t[0])?V.extend({handler:function(){},content:"",title:""},t[0]):(Q(t[t.length-1])||t.push(function(){}),{handler:t.pop(),content:t.pop()||"",title:t.pop()||""})},alert:function(){let e=this.get.settings();var 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(){let e=this.get.settings(),t=e.templates.getArguments(arguments);function n(){t.handler(!0)}function i(){t.handler(!1)}return{title:t.title,content:t.content,onApprove:n,onDeny:i,actions:[{text:e.text.ok,class:e.className.ok,click:n},{text:e.text.cancel,class:e.className.cancel,click:i}]}},prompt:function(){let t=this,e=this.get.settings(),n=e.templates.getArguments(arguments);function i(){var e=t.get.settings(),e=t.get.element().find(e.selector.prompt)[0];n.handler(V(e).val())}function o(){n.handler(null)}return 0===V(V.parseHTML(n.content)).filter(".ui.input").length&&(n.content+='<p><div class="'+this.helpers.escape(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,onApprove:i,onDeny:o,actions:[{text:e.text.ok,class:e.className.ok,click:i},{text:e.text.cancel,class:e.className.cancel,click:o}]}}}}(jQuery,window,document);
|
11
|
+
!function(X,_,Q){"use strict";function $(e){return"function"==typeof e&&"number"!=typeof e.nodeType}_=void 0!==_&&_.Math===Math?_:globalThis,X.fn.modal=function(z){let e=X(this),q=X(_),I=X(Q),B=X("body"),W=Date.now(),j=[],P=z,K="string"==typeof P,R=[].slice.call(arguments,1),U=function(e,t){let n;return 0<=[_,Q].indexOf(e)?n=B:0===(n=X(t.document).find(e)).length&&(n=t.frameElement?U(e,t.parent):B),n},V;return e.each(function(){let r=X.isPlainObject(z)?X.extend(!0,{},X.fn.modal.settings,z):X.extend({},X.fn.modal.settings),a=r.selector,c=r.className;var e=r.namespace;let l=r.fields,d=r.error,i="."+e,t="module-"+e,u=X(this),o=U(r.context,_),s=o[0]===B[0],n=u.find(a.closeIcon),f,m,h,g,p,v,b=u.hasClass("modal"),y=this,k=b?u.data(t):void 0,x=!1,w,C,S="",M=0,A=0,D=!1,T=!1,H=!1,F,N,E,O=!1,L;L={initialize:function(){if(L.create.id(),b||(L.create.modal(),$(r.onHidden)||(r.onHidden=function(){L.destroy(),u.remove()})),u.addClass(r.class),""!==r.title&&u.find(a.title).html(L.helpers.escape(r.title,r)).addClass(r.classTitle),""!==r.content&&u.find(a.content).html(L.helpers.escape(r.content,r)).addClass(r.classContent),L.has.configActions()){let s=u.find(a.actions).addClass(r.classActions);0===s.length?s=X("<div/>",{class:c.actions+" "+(r.classActions||"")}).appendTo(u):s.empty(),r.actions.forEach(function(e){var t=e[l.icon]?"<i "+(e[l.text]?'aria-hidden="true"':"")+' class="'+L.helpers.escape(e[l.icon])+' icon"></i>':"",n=L.helpers.escape(e[l.text]||"",r),i=L.helpers.escape(e[l.class]||"");let o=e[l.click]&&$(e[l.click])?e[l.click]:function(){};s.append(X("<button/>",{html:t+n,"aria-label":(e[l.text]||e[l.icon]||"").replace(/<[^>]+(>|$)/g,""),class:c.button+" "+i,on:{click:function(){let e=X(this);e.is(a.approve)||e.is(a.deny)||!1===o.call(y,u)||L.hide()}}}))})}L.cache={},L.verbose("Initializing dimmer",o),L.create.dimmer(),r.allowMultiple&&L.create.innerDimmer(),r.centered||u.addClass("top aligned"),L.refreshModals(),L.bind.events(),L.observeChanges(),L.instantiate(),r.autoShow&&L.show()},instantiate:function(){L.verbose("Storing instance of modal"),k=L,u.data(t,k)},create:{modal:function(){var e;u=X("<div/>",{class:c.modal,role:"dialog","aria-modal":!0}),r.closeIcon&&(n=X("<i/>",{class:c.close,role:"button",tabindex:0,"aria-label":r.text.close}),u.append(n)),""!==r.title&&(e="_"+L.get.id()+"title",u.attr("aria-labelledby",e),X("<div/>",{class:c.title,id:e}).appendTo(u)),""!==r.content&&(e="_"+L.get.id()+"desc",u.attr("aria-describedby",e),X("<div/>",{class:c.content,id:e}).appendTo(u)),L.has.configActions()&&X("<div/>",{class:c.actions}).appendTo(u),o.append(u),y=u[0]},dimmer:function(){var e={debug:r.debug,dimmerName:"modals"},e=X.extend(!0,e,r.dimmerSettings);void 0===X.fn.dimmer?L.error(d.dimmer):(L.debug("Creating dimmer"),p=o.dimmer(e),D=L.is.scrolling(),r.detachable?(L.verbose("Modal is detachable, moving content into dimmer"),p.dimmer("add content",u)):L.set.undetached(),v=p.dimmer("get dimmer"))},id:function(){N=(Math.random().toString(16)+"000000000").slice(2,10),F="."+N,L.verbose("Creating unique id for element",N)},innerDimmer:function(){0===u.find(a.dimmer).length&&X("<div/>",{class:c.innerDimmer}).prependTo(u)}},destroy:function(){E&&E.disconnect(),L.verbose("Destroying previous modal"),u.removeData(t).off(i),q.off(F),o.off(F),v.off(F),n.off(F),f&&f.off(F),o.dimmer("destroy")},observeChanges:function(){(E=new MutationObserver(function(e){function o(n){let i=[];for(let e=0,t=n.length;e<t;e++)Array.prototype.push.apply(i,o(n[e].childNodes)),i.push(n[e]);return i}let i=!1,s=!1,a=!0;e.every(function(n){if("attributes"===n.type)O&&("disabled"===n.attributeName||0<X(n.target).find(":input").addBack(":input").filter(":visible").length)&&(s=!0);else{i=!0;let e=X(o(n.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),t=X(o(n.removedNodes)).filter("a[href], [tabindex], :input");(0<e.length||0<t.length)&&(s=!0,(0<e.filter(":input").length||0<t.filter(":input").length)&&(a=!1))}return!s}),i&&r.observeChanges&&(L.debug("DOM tree modified, refreshing"),L.refresh()),s&&L.refreshInputs(a)})).observe(y,{attributeFilter:["class","disabled"],attributes:!0,childList:!0,subtree:!0}),L.debug("Setting up mutation observer",E)},refresh:function(){L.remove.scrolling(),L.cacheSizes(),L.can.useFlex()||L.set.modalOffset(),L.set.screenHeight(),L.set.type()},refreshModals:function(){h=u.siblings(a.modal),m=h.add(u)},refreshInputs:function(e){f&&f.off("keydown"+F),0===(f=u.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===X(this).closest(".disabled").length})).filter(":input").length?(f=u.add(f),u.attr("tabindex",-1)):u.removeAttr("tabindex"),f.first().on("keydown"+F,L.event.inputKeyDown.first),f.last().on("keydown"+F,L.event.inputKeyDown.last),!e&&r.autofocus&&0===f.filter(":focus").length&&L.set.autofocus()},attachEvents:function(e,t){let n=X(e);t=$(L[t])?L[t]:L.toggle,0<n.length?(L.debug("Attaching modal events to element",e,t),n.off(i).on("click"+i,t)):L.error(d.notFound,e)},bind:{events:function(){L.verbose("Attaching events"),u.on("click"+i,a.close,L.event.close).on("click"+i,a.approve,L.event.approve).on("click"+i,a.deny,L.event.deny),n.on("keyup"+F,L.event.closeKeyUp),q.on("resize"+F,L.event.resize).on("focus"+F,L.event.focus),o.on("click"+F,L.event.click)},scrollLock:function(){p[0].addEventListener("touchmove",L.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){p[0].removeEventListener("touchmove",L.event.preventScroll,{passive:!1})}},get:{id:function(){return N},element:function(){return u},settings:function(){return r}},event:{approve:function(){x||!1===r.onApprove.call(y,X(this))?L.verbose("Approve callback returned false cancelling hide"):(x=!0,L.hide(function(){x=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){x||!1===r.onDeny.call(y,X(this))?L.verbose("Deny callback returned false cancelling hide"):(x=!0,L.hide(function(){x=!1}))},close:function(){L.hide()},closeKeyUp:function(e){e=e.which;e!==r.keys.enter&&e!==r.keys.space||!u.hasClass(c.front)||L.hide()},inputKeyDown:{first:function(e){e.which===r.keys.tab&&e.shiftKey&&(f.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==r.keys.tab||e.shiftKey||(f.first().trigger("focus"),e.preventDefault())}},mousedown:function(e){let t=X(e.target);var n=L.is.rtl();(w=0<t.closest(a.modal).length)&&L.verbose("Mouse down event registered inside the modal"),(C=L.is.scrolling()&&(!n&&q.outerWidth()-r.scrollbarWidth<=e.clientX||n&&r.scrollbarWidth>=e.clientX))&&L.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(t){if(r.closable)if(w)L.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(C)L.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{let e=X(t.target);var n=0<e.closest(a.modal).length,t=X.contains(Q.documentElement,t.target);if(!n&&t&&L.is.active()&&u.hasClass(c.front)){if(L.debug("Dimmer clicked, hiding all modals"),r.allowMultiple){if(!L.hideAll())return}else if(!L.hide())return;L.remove.clickaway()}}else L.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(L.timer),L.timer=setTimeout(function(){e()},t)},keyboard:function(e){e.which===r.keys.escape&&(r.closable?(L.debug("Escape key pressed hiding modal"),u.hasClass(c.front)&&L.hide()):L.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){p.dimmer("is active")&&(L.is.animating()||L.is.active())&&requestAnimationFrame(L.refresh)},focus:function(){H=!0},click:function(e){H&&Q.activeElement!==e.target&&p.dimmer("is active")&&L.is.active()&&r.autofocus&&0===X(Q.activeElement).closest(a.modal).length&&requestAnimationFrame(L.set.autofocus),H=!1}},toggle:function(){L.is.active()||L.is.animating()?L.hide():L.show()},show:function(e){e=$(e)?e:function(){},L.refreshModals(),L.set.dimmerSettings(),L.set.dimmerStyles(),L.showModal(e)},hide:function(e){return e=$(e)?e:function(){},L.refreshModals(),L.hideModal(e)},showModal:function(e){e=$(e)?e:function(){},L.is.animating()||!L.is.active()?!1===r.onShow.call(y)?L.verbose("Show callback returned false cancelling show"):(T=L.has.scrollbar(),L.showDimmer(),L.cacheSizes(),T&&L.set.bodyMargin(),L.can.useFlex()?L.remove.legacy():(L.set.legacy(),L.set.modalOffset(),L.debug("Using non-flex legacy modal positioning.")),L.set.screenHeight(),L.set.type(),L.set.clickaway(),!r.allowMultiple&&L.others.active()?L.hideOthers(L.showModal):(x=!1,r.allowMultiple&&(L.others.active()&&h.filter("."+c.active).find(a.dimmer).removeClass("out").addClass("transition fade in active"),r.detachable&&u.detach().appendTo(v)),r.transition&&void 0!==X.fn.transition?(L.debug("Showing modal with css animations"),L.set.observeAttributes(!1),u.transition({debug:r.debug,verbose:r.verbose,silent:r.silent,animation:(r.transition.showMethod||r.transition)+" in",queue:r.queue,duration:r.transition.showDuration||r.duration,useFailSafe:!0,onComplete:function(){r.onVisible.apply(y),r.keyboardShortcuts&&L.add.keyboardShortcuts(),L.save.focus(),L.set.active(),L.refreshInputs(),requestAnimationFrame(L.set.observeAttributes),e()}})):L.error(d.noTransition))):L.debug("Modal is already visible")},hideModal:function(e,t,n){let i=h.filter("."+c.active).last();if(e=$(e)?e:function(){},!1===r.onHide.call(y,X(this)))return L.verbose("Hide callback returned false cancelling hide"),x=!1;(L.is.animating()||L.is.active())&&(L.debug("Hiding modal"),r.transition&&void 0!==X.fn.transition?(L.remove.active(),L.set.observeAttributes(!1),u.transition({debug:r.debug,verbose:r.verbose,silent:r.silent,animation:(r.transition.hideMethod||r.transition)+" out",queue:r.queue,duration:r.transition.hideDuration||r.duration,useFailSafe:!0,onStart:function(){L.others.active()||L.others.animating()||t?r.allowMultiple&&(n?m:i).find(a.dimmer).removeClass("in").addClass("out"):L.hideDimmer(),r.keyboardShortcuts&&!L.others.active()&&L.remove.keyboardShortcuts()},onComplete:function(){L.unbind.scrollLock(),L.remove.active(),r.allowMultiple&&(i.addClass(c.front),u.removeClass(c.front),(n?m:i).find(a.dimmer).removeClass("active")),$(r.onHidden)&&r.onHidden.call(y),L.remove.dimmerStyles(),L.restore.focus(),e()}})):L.error(d.noTransition))},showDimmer:function(){p.dimmer("is animating")||!p.dimmer("is active")?(T&&(s||v.css("top",p.scrollTop()),L.save.bodyMargin()),L.debug("Showing dimmer"),p.dimmer("show")):L.debug("Dimmer already visible")},hideDimmer:function(){p.dimmer("is animating")||p.dimmer("is active")?(L.unbind.scrollLock(),p.dimmer("hide",function(){T&&L.restore.bodyMargin(),L.remove.clickaway(),L.remove.screenHeight()})):L.debug("Dimmer is not visible cannot hide")},hideAll:function(i){let e=m.filter("."+c.active+", ."+c.animating);if(i=$(i)?i:function(){},0<e.length){L.debug("Hiding all visible modals");let n=!0;return X(e.get().reverse()).each(function(e,t){n=n&&X(t).modal("hide modal",i,!1,!0)}),n&&L.hideDimmer(),n}},hideOthers:function(e){let t=h.filter("."+c.active+", ."+c.animating);e=$(e)?e:function(){},0<t.length&&(L.debug("Hiding other modals",h),t.modal("hide modal",e,!0))},others:{active:function(){return 0<h.filter("."+c.active).length},animating:function(){return 0<h.filter("."+c.animating).length}},add:{keyboardShortcuts:function(){L.verbose("Adding keyboard shortcuts"),I.on("keydown"+i,L.event.keyboard)}},save:{focus:function(){let e=X(Q.activeElement);0<e.closest(u).length||(g=X(Q.activeElement).trigger("blur"))},bodyMargin:function(){S=o.css((s?"margin-":"padding-")+(L.can.leftBodyScrollbar()?"left":"right")),M=parseInt(S.replace(/[^\d.]/g,""),10);var e=s?_.innerWidth-Q.documentElement.clientWidth:o[0].offsetWidth-o[0].clientWidth;A=M+e}},restore:{focus:function(){g&&0<g.length&&r.restoreFocus&&g.trigger("focus")},bodyMargin:function(){let n=L.can.leftBodyScrollbar()?"left":"right";o.css((s?"margin-":"padding-")+n,0===M?"":S),o.find(a.bodyFixed.replace("right",n)).each(function(){let e=X(this);var t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"")})}},remove:{active:function(){u.removeClass(c.active)},legacy:function(){u.removeClass(c.legacy)},clickaway:function(){r.detachable||u.off("mousedown"+F),v.off("mousedown"+F),v.off("mouseup"+F)},dimmerStyles:function(){v.removeClass(c.inverted),p.removeClass(c.blurring)},bodyStyle:function(){""===o.attr("style")&&(L.verbose("Removing style attribute"),o.removeAttr("style"))},screenHeight:function(){L.debug("Removing page height"),o.css("height",""),L.remove.bodyStyle()},keyboardShortcuts:function(){L.verbose("Removing keyboard shortcuts"),I.off("keydown"+i)},scrolling:function(){D||p.removeClass(c.scrolling),u.removeClass(c.scrolling)}},cacheSizes:function(){u.addClass(c.loading);var e=u.prop("scrollHeight"),t=u.outerWidth(),n=u.outerHeight();void 0!==L.cache.pageHeight&&0===n||(X.extend(L.cache,{pageHeight:I.outerHeight(),width:t,height:n+r.offset,scrollHeight:e+r.offset,contextHeight:(s?q:p).height()}),L.cache.topOffset=-L.cache.height/2),u.removeClass(c.loading),L.debug("Caching modal and container sizes",L.cache)},helpers:{escape:function(e,t){if(void 0!==t&&t.preserveHTML)return e;const n={'"':""","&":"&","'":"'","<":"<",">":">"};return String(e).replace(/["&'<>]/g,e=>n[e])}},can:{leftBodyScrollbar:function(){return void 0===L.cache.leftBodyScrollbar&&(L.cache.leftBodyScrollbar=L.is.rtl()&&(L.is.iframe&&!L.is.firefox()||L.is.safari())),L.cache.leftBodyScrollbar},useFlex:function(){return"auto"===r.useFlex?r.detachable:(r.useFlex&&!r.detachable&&L.debug("useFlex true in combination with detachable false is not supported"),r.useFlex)},fit:function(){var e=L.cache.contextHeight,t=L.cache.contextHeight/2,n=L.cache.topOffset,i=L.cache.scrollHeight,o=L.cache.height,s=r.padding;return o<i?t+n+i+s<e:o+2*s<e}},has:{configActions:function(){return Array.isArray(r.actions)&&0<r.actions.length},scrollbar:function(){return s||"hidden"!==o.css("overflow-y")}},is:{active:function(){return u.hasClass(c.active)},animating:function(){return u.transition("is animating")},scrolling:function(){return p.hasClass(c.scrolling)},rtl:function(){return void 0===L.cache.isRTL&&(L.cache.isRTL="rtl"===u.attr("dir")||"rtl"===u.css("direction")||"rtl"===B.attr("dir")||"rtl"===B.css("direction")||"rtl"===o.attr("dir")||"rtl"===o.css("direction")),L.cache.isRTL},safari:function(){return void 0===L.cache.isSafari&&(L.cache.isSafari=/constructor/i.test(_.HTMLElement)||!!_.ApplePaySession),L.cache.isSafari},firefox:function(){return void 0===L.cache.isFirefox&&(L.cache.isFirefox=!!_.InstallTrigger),L.cache.isFirefox},iframe:function(){return!(self===top)}},set:{observeAttributes:function(e){O=!1!==e},autofocus:function(){let e=f.filter("[autofocus]"),t=f.filter(":input"),n=(0<e.length?e:0<t.length?t:u).first();n.trigger("focus")},bodyMargin:function(){let n=L.can.leftBodyScrollbar()?"left":"right";(r.detachable||L.can.fit())&&o.css((s?"margin-":"padding-")+n,A+"px"),o.find(a.bodyFixed.replace("right",n)).each(function(){let e=X(this);var t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"calc("+e.css(t)+" + "+A+"px)")})},clickaway:function(){r.detachable||u.on("mousedown"+F,L.event.mousedown),v.on("mousedown"+F,L.event.mousedown),v.on("mouseup"+F,L.event.mouseup)},dimmerSettings:function(){if(void 0===X.fn.dimmer)L.error(d.dimmer);else{var t={debug:r.debug,dimmerName:"modals",closable:"auto",useFlex:L.can.useFlex(),duration:{show:r.transition.showDuration||r.duration,hide:r.transition.hideDuration||r.duration}};let e=X.extend(!0,t,r.dimmerSettings);r.inverted&&(e.variation=void 0!==e.variation?e.variation+" inverted":"inverted"),o.dimmer("setting",e)}},dimmerStyles:function(){r.inverted?v.addClass(c.inverted):v.removeClass(c.inverted),r.blurring?p.addClass(c.blurring):p.removeClass(c.blurring)},modalOffset:function(){var e;r.detachable?u.css({marginTop:!u.hasClass("aligned")&&L.can.fit()?-L.cache.height/2:r.padding/2,marginLeft:-L.cache.width/2}):(e=L.can.fit(),u.css({top:!u.hasClass("aligned")&&e?I.scrollTop()+(L.cache.contextHeight-L.cache.height)/2:!e||u.hasClass("top")?I.scrollTop()+r.padding:I.scrollTop()+(L.cache.contextHeight-L.cache.height-r.padding),marginLeft:-L.cache.width/2})),L.verbose("Setting modal offset for legacy mode")},screenHeight:function(){L.can.fit()?o.css("height",""):u.hasClass("bottom")||(L.debug("Modal is taller than page content, resizing page height"),o.css("height",L.cache.height+2*r.padding+"px"))},active:function(){u.addClass(c.active+" "+c.front),h.filter("."+c.active).removeClass(c.front)},scrolling:function(){p.addClass(c.scrolling),u.addClass(c.scrolling),L.unbind.scrollLock()},legacy:function(){u.addClass(c.legacy)},type:function(){L.can.fit()?(L.verbose("Modal fits on screen"),L.others.active()||L.others.animating()||(L.remove.scrolling(),L.bind.scrollLock())):u.hasClass("bottom")?L.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(L.verbose("Modal cannot fit on screen setting to scrolling"),L.set.scrolling())},undetached:function(){p.addClass(c.undetached)}},setting:function(e,t){if(L.debug("Changing setting",e,t),X.isPlainObject(e))X.extend(!0,r,e);else{if(void 0===t)return r[e];X.isPlainObject(r[e])?X.extend(!0,r[e],t):r[e]=t}},internal:function(e,t){if(X.isPlainObject(e))X.extend(!0,L,e);else{if(void 0===t)return L[e];L[e]=t}},debug:function(){!r.silent&&r.debug&&(r.performance?L.performance.log(arguments):(L.debug=Function.prototype.bind.call(console.info,console,r.name+":"),L.debug.apply(console,arguments)))},verbose:function(){!r.silent&&r.verbose&&r.debug&&(r.performance?L.performance.log(arguments):(L.verbose=Function.prototype.bind.call(console.info,console,r.name+":"),L.verbose.apply(console,arguments)))},error:function(){r.silent||(L.error=Function.prototype.bind.call(console.error,console,r.name+":"),L.error.apply(console,arguments))},performance:{log:function(e){var t,n;r.performance&&(n=(t=Date.now())-(W||t),W=t,j.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:y,"Execution Time":n})),clearTimeout(L.performance.timer),L.performance.timer=setTimeout(function(){L.performance.display()},500)},display:function(){var e=r.name+":";let n=0;W=!1,clearTimeout(L.performance.timer),X.each(j,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",0<j.length&&(console.groupCollapsed(e),console.table?console.table(j):X.each(j,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(i,e,t){let o=k,s,a,n;return e=e||R,t=t||y,"string"==typeof i&&void 0!==o&&(i=i.split(/[ .]/),s=i.length-1,X.each(i,function(e,t){var n=e!==s?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(X.isPlainObject(o[n])&&e!==s)o=o[n];else{if(void 0!==o[n])return a=o[n],!1;{if(!X.isPlainObject(o[t])||e===s)return void 0!==o[t]?a=o[t]:L.error(d.method,i),!1;o=o[t]}}})),$(a)?n=a.apply(t,e):void 0!==a&&(n=a),Array.isArray(V)?V.push(n):void 0!==V?V=[V,n]:void 0!==n&&(V=n),a}},K?(void 0===k&&($(r.templates[P])&&(r.autoShow=!0,r.className.modal=r.className.template,r=X.extend(!0,{},r,r.templates[P].apply(L,R)),c=r.className,r.namespace,l=r.fields,d=r.error),L.initialize()),$(r.templates[P])||L.invoke(P)):(void 0!==k&&k.invoke("destroy"),L.initialize(),V=u)}),void 0!==V?V:this},X.modal=X.fn.modal,X.fn.modal.settings={name:"Modal",namespace:"modal",useFlex:"auto",offset:0,silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,restoreFocus:!0,autoShow:!1,inverted:!1,blurring:!1,centered:!0,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,transition:"scale",padding:50,scrollbarWidth:10,title:"",content:"",class:"",classTitle:"",classContent:"",classActions:"",closeIcon:!1,actions:!1,preserveHTML:!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"}},X.fn.modal.settings.templates={getArguments:function(e){let t=[].slice.call(e);return X.isPlainObject(t[0])?X.extend({handler:function(){},content:"",title:""},t[0]):($(t[t.length-1])||t.push(function(){}),{handler:t.pop(),content:t.pop()||"",title:t.pop()||""})},alert:function(){let e=this.get.settings();var 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(){let e=this.get.settings(),t=e.templates.getArguments(arguments);function n(){t.handler(!0)}function i(){t.handler(!1)}return{title:t.title,content:t.content,onApprove:n,onDeny:i,actions:[{text:e.text.ok,class:e.className.ok,click:n},{text:e.text.cancel,class:e.className.cancel,click:i}]}},prompt:function(){let t=this,e=this.get.settings(),n=e.templates.getArguments(arguments);function i(){var e=t.get.settings(),e=t.get.element().find(e.selector.prompt)[0];n.handler(X(e).val())}function o(){n.handler(null)}return 0===X(X.parseHTML(n.content)).filter(".ui.input").length&&(n.content+='<p><div class="'+this.helpers.escape(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,onApprove:i,onDeny:o,actions:[{text:e.text.ok,class:e.className.ok,click:i},{text:e.text.cancel,class:e.className.cancel,click:o}]}}}}(jQuery,window,document);
|
package/dist/components/nag.css
CHANGED
package/dist/components/nag.js
CHANGED
package/dist/components/popup.js
CHANGED
package/dist/components/rail.css
CHANGED
package/dist/components/shape.js
CHANGED