fomantic-ui 2.9.3-beta.2 → 2.9.3-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +6 -6
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.min.css +2 -2
- 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 +11 -4
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +1 -1
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +1 -1
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +24 -20
- 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 +26 -18
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/menu.css +1 -1
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +25 -20
- 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 +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 +2 -2
- 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 +58 -58
- package/dist/semantic.js +109 -85
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/src/definitions/behaviors/form.js +25 -17
- package/src/definitions/modules/calendar.less +1 -1
- package/src/definitions/modules/dropdown.js +10 -3
- package/src/definitions/modules/flyout.js +23 -19
- package/src/definitions/modules/modal.js +24 -19
- package/src/definitions/modules/toast.js +1 -1
package/dist/components/modal.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.3-beta.
|
2
|
+
* # Fomantic-UI 2.9.3-beta.3+880333c - Modal
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -88,6 +88,7 @@
|
|
88
88
|
tempBodyMargin = '',
|
89
89
|
keepScrollingClass = false,
|
90
90
|
hadScrollbar = false,
|
91
|
+
windowRefocused = false,
|
91
92
|
|
92
93
|
elementEventNamespace,
|
93
94
|
id,
|
@@ -251,6 +252,7 @@
|
|
251
252
|
.off(eventNamespace)
|
252
253
|
;
|
253
254
|
$window.off(elementEventNamespace);
|
255
|
+
$context.off(elementEventNamespace);
|
254
256
|
$dimmer.off(elementEventNamespace);
|
255
257
|
$closeIcon.off(elementEventNamespace);
|
256
258
|
if ($inputs) {
|
@@ -272,11 +274,12 @@
|
|
272
274
|
return nodes;
|
273
275
|
},
|
274
276
|
shouldRefresh = false,
|
275
|
-
shouldRefreshInputs = false
|
277
|
+
shouldRefreshInputs = false,
|
278
|
+
ignoreAutofocus = true
|
276
279
|
;
|
277
280
|
mutations.every(function (mutation) {
|
278
281
|
if (mutation.type === 'attributes') {
|
279
|
-
if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').length > 0)) {
|
282
|
+
if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').filter(':visible').length > 0)) {
|
280
283
|
shouldRefreshInputs = true;
|
281
284
|
}
|
282
285
|
} else {
|
@@ -287,6 +290,7 @@
|
|
287
290
|
$removedInputs = $(collectNodes(mutation.removedNodes)).filter('a[href], [tabindex], :input');
|
288
291
|
if ($addedInputs.length > 0 || $removedInputs.length > 0) {
|
289
292
|
shouldRefreshInputs = true;
|
293
|
+
ignoreAutofocus = false;
|
290
294
|
}
|
291
295
|
}
|
292
296
|
|
@@ -298,7 +302,7 @@
|
|
298
302
|
module.refresh();
|
299
303
|
}
|
300
304
|
if (shouldRefreshInputs) {
|
301
|
-
module.refreshInputs();
|
305
|
+
module.refreshInputs(ignoreAutofocus);
|
302
306
|
}
|
303
307
|
});
|
304
308
|
observer.observe(element, {
|
@@ -326,7 +330,7 @@
|
|
326
330
|
$allModals = $otherModals.add($module);
|
327
331
|
},
|
328
332
|
|
329
|
-
refreshInputs: function () {
|
333
|
+
refreshInputs: function (ignoreAutofocus) {
|
330
334
|
if ($inputs) {
|
331
335
|
$inputs
|
332
336
|
.off('keydown' + elementEventNamespace)
|
@@ -335,8 +339,8 @@
|
|
335
339
|
$inputs = $module.find('a[href], [tabindex], :input:enabled').filter(':visible').filter(function () {
|
336
340
|
return $(this).closest('.disabled').length === 0;
|
337
341
|
});
|
338
|
-
if ($inputs.length === 0) {
|
339
|
-
$inputs = $module;
|
342
|
+
if ($inputs.filter(':input').length === 0) {
|
343
|
+
$inputs = $module.add($inputs);
|
340
344
|
$module.attr('tabindex', -1);
|
341
345
|
} else {
|
342
346
|
$module.removeAttr('tabindex');
|
@@ -347,7 +351,7 @@
|
|
347
351
|
$inputs.last()
|
348
352
|
.on('keydown' + elementEventNamespace, module.event.inputKeyDown.last)
|
349
353
|
;
|
350
|
-
if (settings.autofocus && $inputs.filter(':focus').length === 0) {
|
354
|
+
if (!ignoreAutofocus && settings.autofocus && $inputs.filter(':focus').length === 0) {
|
351
355
|
module.set.autofocus();
|
352
356
|
}
|
353
357
|
},
|
@@ -385,6 +389,9 @@
|
|
385
389
|
.on('resize' + elementEventNamespace, module.event.resize)
|
386
390
|
.on('focus' + elementEventNamespace, module.event.focus)
|
387
391
|
;
|
392
|
+
$context
|
393
|
+
.on('click' + elementEventNamespace, module.event.click)
|
394
|
+
;
|
388
395
|
},
|
389
396
|
scrollLock: function () {
|
390
397
|
// touch events default to passive, due to changes in chrome to optimize mobile perf
|
@@ -542,9 +549,13 @@
|
|
542
549
|
}
|
543
550
|
},
|
544
551
|
focus: function () {
|
545
|
-
|
552
|
+
windowRefocused = true;
|
553
|
+
},
|
554
|
+
click: function (event) {
|
555
|
+
if (windowRefocused && document.activeElement !== event.target && $dimmable.dimmer('is active') && module.is.active() && settings.autofocus && $(document.activeElement).closest(selector.modal).length === 0) {
|
546
556
|
requestAnimationFrame(module.set.autofocus);
|
547
557
|
}
|
558
|
+
windowRefocused = false;
|
548
559
|
},
|
549
560
|
},
|
550
561
|
|
@@ -1054,20 +1065,14 @@
|
|
1054
1065
|
var
|
1055
1066
|
$autofocus = $inputs.filter('[autofocus]'),
|
1056
1067
|
$rawInputs = $inputs.filter(':input'),
|
1057
|
-
$input = $autofocus.length > 0
|
1058
|
-
? $autofocus
|
1068
|
+
$input = ($autofocus.length > 0
|
1069
|
+
? $autofocus
|
1059
1070
|
: ($rawInputs.length > 0
|
1060
1071
|
? $rawInputs
|
1061
|
-
: $
|
1062
|
-
|
1072
|
+
: $module)
|
1073
|
+
).first()
|
1063
1074
|
;
|
1064
|
-
|
1065
|
-
if ($input.length === 0 && $inputs.length > 0) {
|
1066
|
-
$input = $inputs.first();
|
1067
|
-
}
|
1068
|
-
if ($input.length > 0) {
|
1069
|
-
$input.trigger('focus');
|
1070
|
-
}
|
1075
|
+
$input.trigger('focus');
|
1071
1076
|
},
|
1072
1077
|
bodyMargin: function () {
|
1073
1078
|
var position = module.can.leftBodyScrollbar() ? 'left' : 'right';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.3-beta.
|
2
|
+
* # Fomantic UI - 2.9.3-beta.3+880333c
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(X,R,U){"use strict";function V(e){return"function"==typeof e&&"number"!=typeof e.nodeType}R=void 0!==R&&R.Math===Math?R:globalThis,X.fn.modal=function(L){var N,e=X(this),I=X(R),j=X(U),z=X("body"),q=Date.now(),B=[],W=L,P="string"==typeof W,K=[].slice.call(arguments,1),Q=function(e,t){var n;return 0<=[R,U].indexOf(e)?n=z:0===(n=X(t.document).find(e)).length&&(n=t.frameElement?Q(e,t.parent):z),n};return e.each(function(){var n,o,s,e,i,t,a,r,c,l,d,u=X.isPlainObject(L)?X.extend(!0,{},X.fn.modal.settings,L):X.extend({},X.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,v=u.error,p="."+h,b="module-"+h,y=X(this),x=Q(u.context,R),k=x[0]===z[0],w=y.find(f.closeIcon),C=y.hasClass("modal"),S=this,A=C?y.data(b):void 0,M=!1,D="",T="",H=!1,F=!1,O=!1,E={initialize:function(){var s;E.create.id(),C||(E.create.modal(),V(u.onHidden)||(u.onHidden=function(){E.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(f.title).html(E.helpers.escape(u.title,u.preserveHTML)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(E.helpers.escape(u.content,u.preserveHTML)).addClass(u.classContent),E.has.configActions()&&(0===(s=y.find(f.actions).addClass(u.classActions)).length?s=X("<div/>",{class:m.actions+" "+(u.classActions||"")}).appendTo(y):s.empty(),u.actions.forEach(function(e){var t=e[g.icon]?"<i "+(e[g.text]?'aria-hidden="true"':"")+' class="'+E.helpers.deQuote(e[g.icon])+' icon"></i>':"",n=E.helpers.escape(e[g.text]||"",u.preserveHTML),i=E.helpers.deQuote(e[g.class]||""),o=e[g.click]&&V(e[g.click])?e[g.click]:function(){};s.append(X("<button/>",{html:t+n,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+i,on:{click:function(){var e=X(this);e.is(f.approve)||e.is(f.deny)||!1===o.call(S,y)||E.hide()}}}))})),E.cache={},E.verbose("Initializing dimmer",x),E.create.dimmer(),u.allowMultiple&&E.create.innerDimmer(),u.centered||y.addClass("top aligned"),E.refreshModals(),E.bind.events(),E.observeChanges(),E.instantiate(),u.autoShow&&E.show()},instantiate:function(){E.verbose("Storing instance of modal"),A=E,y.data(b,A)},create:{modal:function(){var e;y=X("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(w=X("<i/>",{class:m.close,role:"button",tabindex:0,"aria-label":u.text.close}),y.append(w)),""!==u.title&&(e="_"+E.get.id()+"title",y.attr("aria-labelledby",e),X("<div/>",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+E.get.id()+"desc",y.attr("aria-describedby",e),X("<div/>",{class:m.content,id:e}).appendTo(y)),E.has.configActions()&&X("<div/>",{class:m.actions}).appendTo(y),x.append(y),S=y[0]},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},e=X.extend(!0,e,u.dimmerSettings);void 0===X.fn.dimmer?E.error(v.dimmer):(E.debug("Creating dimmer"),i=x.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&&X("<div/>",{class:m.innerDimmer}).prependTo(y)}},destroy:function(){d&&d.disconnect(),E.verbose("Destroying previous modal"),y.removeData(b).off(p),I.off(c),t.off(c),w.off(c),n&&n.off(c),x.dimmer("destroy")},observeChanges:function(){"MutationObserver"in R&&((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;e.every(function(e){var t;return"attributes"===e.type?O&&("disabled"===e.attributeName||0<X(e.target).find(":input").addBack(":input").length)&&(i=!0):(n=!0,t=X(o(e.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),e=X(o(e.removedNodes)).filter("a[href], [tabindex], :input"),(0<t.length||0<e.length)&&(i=!0)),!i}),n&&u.observeChanges&&(E.debug("DOM tree modified, refreshing"),E.refresh()),i&&E.refreshInputs()})).observe(S,{attributeFilter:["class","disabled"],attributes:!0,childList:!0,subtree:!0}),E.debug("Setting up mutation observer",d))},refresh:function(){E.remove.scrolling(),E.cacheSizes(),E.can.useFlex()||E.set.modalOffset(),E.set.screenHeight(),E.set.type()},refreshModals:function(){s=y.siblings(f.modal),o=s.add(y)},refreshInputs:function(){n&&n.off("keydown"+c),0===(n=y.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===X(this).closest(".disabled").length})).length?(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),u.autofocus&&0===n.filter(":focus").length&&E.set.autofocus()},attachEvents:function(e,t){var n=X(e);t=V(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),I.on("resize"+c,E.event.resize).on("focus"+c,E.event.focus)},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(){M||!1===u.onApprove.call(S,X(this))?E.verbose("Approve callback returned false cancelling hide"):(M=!0,E.hide(function(){M=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){M||!1===u.onDeny.call(S,X(this))?E.verbose("Deny callback returned false cancelling hide"):(M=!0,E.hide(function(){M=!1}))},close:function(){E.hide()},closeKeyUp:function(e){e=e.which;e!==u.keys.enter&&e!==u.keys.space||!y.hasClass(m.front)||E.hide()},inputKeyDown:{first:function(e){e.which===u.keys.tab&&e.shiftKey&&(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=X(e.target),n=E.is.rtl();(a=0<t.closest(f.modal).length)&&E.verbose("Mouse down event registered inside the modal"),(r=E.is.scrolling()&&(!n&&I.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(a)E.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(r)E.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{var t=0<X(e.target).closest(f.modal).length,e=X.contains(U.documentElement,e.target);if(!t&&e&&E.is.active()&&y.hasClass(m.front)){if(E.debug("Dimmer clicked, hiding all modals"),u.allowMultiple){if(!E.hideAll())return}else if(!E.hide())return;E.remove.clickaway()}}else E.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(E.timer),E.timer=setTimeout(e,t)},keyboard:function(e){e.which===u.keys.escape&&(u.closable?(E.debug("Escape key pressed hiding modal"),y.hasClass(m.front)&&E.hide()):E.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){i.dimmer("is active")&&(E.is.animating()||E.is.active())&&requestAnimationFrame(E.refresh)},focus:function(){i.dimmer("is active")&&E.is.active()&&u.autofocus&&requestAnimationFrame(E.set.autofocus)}},toggle:function(){E.is.active()||E.is.animating()?E.hide():E.show()},show:function(e){e=V(e)?e:function(){},E.refreshModals(),E.set.dimmerSettings(),E.set.dimmerStyles(),E.showModal(e)},hide:function(e){return e=V(e)?e:function(){},E.refreshModals(),E.hideModal(e)},showModal:function(e){e=V(e)?e:function(){},E.is.animating()||!E.is.active()?!1===u.onShow.call(S)?E.verbose("Show callback returned false cancelling show"):(F=E.has.scrollbar(),E.showDimmer(),E.cacheSizes(),F&&E.set.bodyMargin(),E.can.useFlex()?E.remove.legacy():(E.set.legacy(),E.set.modalOffset(),E.debug("Using non-flex legacy modal positioning.")),E.set.screenHeight(),E.set.type(),E.set.clickaway(),!u.allowMultiple&&E.others.active()?E.hideOthers(E.showModal):(M=!1,u.allowMultiple&&(E.others.active()&&s.filter("."+m.active).find(f.dimmer).addClass("active"),u.detachable&&y.detach().appendTo(t)),u.transition&&void 0!==X.fn.transition?(E.debug("Showing modal with css animations"),E.set.observeAttributes(!1),y.transition({debug:u.debug,verbose:u.verbose,silent:u.silent,animation:(u.transition.showMethod||u.transition)+" in",queue:u.queue,duration:u.transition.showDuration||u.duration,useFailSafe:!0,onComplete:function(){u.onVisible.apply(S),u.keyboardShortcuts&&E.add.keyboardShortcuts(),E.save.focus(),E.set.active(),E.refreshInputs(),requestAnimationFrame(E.set.observeAttributes),e()}})):E.error(v.noTransition))):E.debug("Modal is already visible")},hideModal:function(e,t,n){var i=s.filter("."+m.active).last();if(e=V(e)?e:function(){},!1===u.onHide.call(S,X(this)))return E.verbose("Hide callback returned false cancelling hide"),M=!1;(E.is.animating()||E.is.active())&&(E.debug("Hiding modal"),u.transition&&void 0!==X.fn.transition?(E.remove.active(),E.set.observeAttributes(!1),y.transition({debug:u.debug,verbose:u.verbose,silent:u.silent,animation:(u.transition.hideMethod||u.transition)+" out",queue:u.queue,duration:u.transition.hideDuration||u.duration,useFailSafe:!0,onStart:function(){E.others.active()||E.others.animating()||t||E.hideDimmer(),u.keyboardShortcuts&&!E.others.active()&&E.remove.keyboardShortcuts()},onComplete:function(){E.unbind.scrollLock(),E.remove.active(),u.allowMultiple&&(i.addClass(m.front),y.removeClass(m.front),(n?o:i).find(f.dimmer).removeClass("active")),V(u.onHidden)&&u.onHidden.call(S),E.remove.dimmerStyles(),E.restore.focus(),e()}})):E.error(v.noTransition))},showDimmer:function(){i.dimmer("is animating")||!i.dimmer("is active")?(F&&(k||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=V(n)?n:function(){},0<e.length)return E.debug("Hiding all visible modals"),i=!0,X(e.get().reverse()).each(function(e,t){i=i&&X(t).modal("hide modal",n,!1,!0)}),i&&E.hideDimmer(),i},hideOthers:function(e){var t=s.filter("."+m.active+", ."+m.animating);e=V(e)?e:function(){},0<t.length&&(E.debug("Hiding other modals",s),t.modal("hide modal",e,!0))},others:{active:function(){return 0<s.filter("."+m.active).length},animating:function(){return 0<s.filter("."+m.animating).length}},add:{keyboardShortcuts:function(){E.verbose("Adding keyboard shortcuts"),j.on("keydown"+p,E.event.keyboard)}},save:{focus:function(){0<X(U.activeElement).closest(y).length||(e=X(U.activeElement).trigger("blur"))},bodyMargin:function(){D=x.css((k?"margin-":"padding-")+(E.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(D.replace(/[^\d.]/g,""),10),t=k?R.innerWidth-U.documentElement.clientWidth:x[0].offsetWidth-x[0].clientWidth;T=e+t}},restore:{focus:function(){e&&0<e.length&&u.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var n=E.can.leftBodyScrollbar()?"left":"right";x.css((k?"margin-":"padding-")+n,D),x.find(f.bodyFixed.replace("right",n)).each(function(){var e=X(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(){""===x.attr("style")&&(E.verbose("Removing style attribute"),x.removeAttr("style"))},screenHeight:function(){E.debug("Removing page height"),x.css("height",""),E.remove.bodyStyle()},keyboardShortcuts:function(){E.verbose("Removing keyboard shortcuts"),j.off("keydown"+p)},scrolling:function(){H||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||(X.extend(E.cache,{pageHeight:j.outerHeight(),width:t,height:n+u.offset,scrollHeight:e+u.offset,contextHeight:(k?I:i).height()}),E.cache.topOffset=-E.cache.height/2),y.removeClass(m.loading),E.debug("Caching modal and container sizes",E.cache)},helpers:{deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var n={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return n[e]}):e}},can:{leftBodyScrollbar:function(){return void 0===E.cache.leftBodyScrollbar&&(E.cache.leftBodyScrollbar=E.is.rtl()&&(E.is.iframe&&!E.is.firefox()||E.is.safari()||E.is.edge()||E.is.ie())),E.cache.leftBodyScrollbar},useFlex:function(){return"auto"===u.useFlex?u.detachable&&!E.is.ie():(u.useFlex&&E.is.ie()?E.debug("useFlex true is not supported in IE"):u.useFlex&&!u.detachable&&E.debug("useFlex true in combination with detachable false is not supported"),u.useFlex)},fit:function(){var e=E.cache.contextHeight,t=E.cache.contextHeight/2,n=E.cache.topOffset,i=E.cache.scrollHeight,o=E.cache.height,s=u.padding;return o<i?t+n+i+s<e:o+2*s<e}},has:{configActions:function(){return Array.isArray(u.actions)&&0<u.actions.length},scrollbar:function(){return k||"hidden"!==x.css("overflow-y")}},is:{active:function(){return y.hasClass(m.active)},ie:function(){var e,t;return void 0===E.cache.isIE&&(e=!R.ActiveXObject&&"ActiveXObject"in R,t="ActiveXObject"in R,E.cache.isIE=e||t),E.cache.isIE},animating:function(){return y.transition("is animating")},scrolling:function(){return i.hasClass(m.scrolling)},modernBrowser:function(){return!(R.ActiveXObject||"ActiveXObject"in R)},rtl:function(){return void 0===E.cache.isRTL&&(E.cache.isRTL="rtl"===y.attr("dir")||"rtl"===y.css("direction")||"rtl"===z.attr("dir")||"rtl"===z.css("direction")||"rtl"===x.attr("dir")||"rtl"===x.css("direction")),E.cache.isRTL},safari:function(){return void 0===E.cache.isSafari&&(E.cache.isSafari=/constructor/i.test(R.HTMLElement)||!!R.ApplePaySession),E.cache.isSafari},edge:function(){return void 0===E.cache.isEdge&&(E.cache.isEdge=!!R.setImmediate&&!E.is.ie()),E.cache.isEdge},firefox:function(){return void 0===E.cache.isFirefox&&(E.cache.isFirefox=!!R.InstallTrigger),E.cache.isFirefox},iframe:function(){return!(self===top)}},set:{observeAttributes:function(e){O=!1!==e},autofocus:function(){var e=n.filter("[autofocus]"),t=n.filter(":input"),e=(0<e.length?e:0<t.length?t:n.filter(":not(i.close)")).first();0<(e=0===e.length&&0<n.length?n.first():e).length&&e.trigger("focus")},bodyMargin:function(){var n=E.can.leftBodyScrollbar()?"left":"right";(u.detachable||E.can.fit())&&x.css((k?"margin-":"padding-")+n,T+"px"),x.find(f.bodyFixed.replace("right",n)).each(function(){var e=X(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===X.fn.dimmer?E.error(v.dimmer):(e={debug:u.debug,dimmerName:"modals",closable:"auto",useFlex:E.can.useFlex(),duration:{show:u.transition.showDuration||u.duration,hide:u.transition.hideDuration||u.duration}},e=X.extend(!0,e,u.dimmerSettings),u.inverted&&(e.variation=void 0!==e.variation?e.variation+" inverted":"inverted"),x.dimmer("setting",e))},dimmerStyles:function(){u.inverted?t.addClass(m.inverted):t.removeClass(m.inverted),u.blurring?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?j.scrollTop()+(E.cache.contextHeight-E.cache.height)/2:!e||y.hasClass("top")?j.scrollTop()+u.padding:j.scrollTop()+(E.cache.contextHeight-E.cache.height-u.padding),marginLeft:-E.cache.width/2})),E.verbose("Setting modal offset for legacy mode")},screenHeight:function(){E.can.fit()?x.css("height",""):y.hasClass("bottom")||(E.debug("Modal is taller than page content, resizing page height"),x.css("height",E.cache.height+2*u.padding+"px"))},active:function(){y.addClass(m.active+" "+m.front),s.filter("."+m.active).removeClass(m.front)},scrolling:function(){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),X.isPlainObject(e))X.extend(!0,u,e);else{if(void 0===t)return u[e];X.isPlainObject(u[e])?X.extend(!0,u[e],t):u[e]=t}},internal:function(e,t){if(X.isPlainObject(e))X.extend(!0,E,e);else{if(void 0===t)return E[e];E[e]=t}},debug:function(){!u.silent&&u.debug&&(u.performance?E.performance.log(arguments):(E.debug=Function.prototype.bind.call(console.info,console,u.name+":"),E.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?E.performance.log(arguments):(E.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),E.verbose.apply(console,arguments)))},error:function(){u.silent||(E.error=Function.prototype.bind.call(console.error,console,u.name+":"),E.error.apply(console,arguments))},performance:{log:function(e){var t,n;u.performance&&(n=(t=Date.now())-(q||t),q=t,B.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(E.performance.timer),E.performance.timer=setTimeout(E.performance.display,500)},display:function(){var e=u.name+":",n=0;q=!1,clearTimeout(E.performance.timer),X.each(B,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",0<B.length&&(console.groupCollapsed(e),console.table?console.table(B):X.each(B,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),B=[]}},invoke:function(i,e,t){var o,s,n,a=A;return e=e||K,t=t||S,"string"==typeof i&&void 0!==a&&(i=i.split(/[ .]/),o=i.length-1,X.each(i,function(e,t){var n=e!==o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(X.isPlainObject(a[n])&&e!==o)a=a[n];else{if(void 0!==a[n])return s=a[n],!1;{if(!X.isPlainObject(a[t])||e===o)return void 0!==a[t]?s=a[t]:E.error(v.method,i),!1;a=a[t]}}})),V(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}};P?(void 0===A&&(V(u.templates[W])&&(u.autoShow=!0,u.className.modal=u.className.template,u=X.extend(!0,{},u,u.templates[W].apply(E,K)),m=u.className,u.namespace,g=u.fields,v=u.error),E.initialize()),V(u.templates[W])||E.invoke(W)):(void 0!==A&&A.invoke("destroy"),E.initialize(),N=y)}),void 0!==N?N:this},X.modal=X.fn.modal,X.fn.modal.settings={name:"Modal",namespace:"modal",useFlex:"auto",offset:0,silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,restoreFocus:!0,autoShow:!1,inverted:!1,blurring:!1,centered:!0,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,transition:"scale",padding:50,scrollbarWidth:10,title:"",content:"",class:"",classTitle:"",classContent:"",classActions:"",closeIcon:!1,actions:!1,preserveHTML:!0,fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:!1,onApprove:function(){return!0},onDeny:function(){return!0},keys:{space:32,enter:13,escape:27,tab:9},selector:{title:"> .header",content:"> .content",actions:"> .actions",close:"> .close",closeIcon:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal",dimmer:"> .ui.dimmer",bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close",prompt:".ui.input > input"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",inverted:"inverted",legacy:"legacy",loading:"loading",scrolling:"scrolling",undetached:"undetached",front:"front",close:"close icon",button:"ui button",modal:"ui modal",title:"header",content:"content",actions:"actions",template:"ui tiny modal",ok:"positive",cancel:"negative",prompt:"ui fluid input",innerDimmer:"ui inverted dimmer"},text:{ok:"Ok",cancel:"Cancel",close:"Close"}},X.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return X.isPlainObject(e[0])?X.extend({handler:function(){},content:"",title:""},e[0]):(V(e[e.length-1])||e.push(function(){}),{handler:e.pop(),content:e.pop()||"",title:e.pop()||""})},alert:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments),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(X(e).val())}function t(){o.handler(null)}var n=this,i=this.get.settings(),o=i.templates.getArguments(arguments);return 0===X(X.parseHTML(o.content)).filter(".ui.input").length&&(o.content+='<p><div class="'+this.helpers.deQuote(i.className.prompt)+'"><input placeholder="'+this.helpers.deQuote(o.placeholder||"")+'" type="text" value="'+this.helpers.deQuote(o.defaultValue||"")+'"></div></p>'),{title:o.title,content:o.content,onApprove:e,onDeny:t,actions:[{text:i.text.ok,class:i.className.ok,click:e},{text:i.text.cancel,class:i.className.cancel,click:t}]}}}}(jQuery,window,document);
|
11
|
+
!function(R,U,V){"use strict";function _(e){return"function"==typeof e&&"number"!=typeof e.nodeType}U=void 0!==U&&U.Math===Math?U:globalThis,R.fn.modal=function(N){var I,e=R(this),j=R(U),z=R(V),q=R("body"),B=Date.now(),W=[],P=N,K="string"==typeof P,Q=[].slice.call(arguments,1),X=function(e,t){var i;return 0<=[U,V].indexOf(e)?i=q:0===(i=R(t.document).find(e)).length&&(i=t.frameElement?X(e,t.parent):q),i};return e.each(function(){var i,o,a,e,n,t,s,r,c,l,d,u=R.isPlainObject(N)?R.extend(!0,{},R.fn.modal.settings,N):R.extend({},R.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,v=u.error,p="."+h,b="module-"+h,y=R(this),x=X(u.context,U),k=x[0]===q[0],w=y.find(f.closeIcon),C=y.hasClass("modal"),S=this,A=C?y.data(b):void 0,M=!1,D="",T="",H=!1,F=!1,E=!1,O=!1,L={initialize:function(){var a;L.create.id(),C||(L.create.modal(),_(u.onHidden)||(u.onHidden=function(){L.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(f.title).html(L.helpers.escape(u.title,u.preserveHTML)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(L.helpers.escape(u.content,u.preserveHTML)).addClass(u.classContent),L.has.configActions()&&(0===(a=y.find(f.actions).addClass(u.classActions)).length?a=R("<div/>",{class:m.actions+" "+(u.classActions||"")}).appendTo(y):a.empty(),u.actions.forEach(function(e){var t=e[g.icon]?"<i "+(e[g.text]?'aria-hidden="true"':"")+' class="'+L.helpers.deQuote(e[g.icon])+' icon"></i>':"",i=L.helpers.escape(e[g.text]||"",u.preserveHTML),n=L.helpers.deQuote(e[g.class]||""),o=e[g.click]&&_(e[g.click])?e[g.click]:function(){};a.append(R("<button/>",{html:t+i,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+n,on:{click:function(){var e=R(this);e.is(f.approve)||e.is(f.deny)||!1===o.call(S,y)||L.hide()}}}))})),L.cache={},L.verbose("Initializing dimmer",x),L.create.dimmer(),u.allowMultiple&&L.create.innerDimmer(),u.centered||y.addClass("top aligned"),L.refreshModals(),L.bind.events(),L.observeChanges(),L.instantiate(),u.autoShow&&L.show()},instantiate:function(){L.verbose("Storing instance of modal"),A=L,y.data(b,A)},create:{modal:function(){var e;y=R("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(w=R("<i/>",{class:m.close,role:"button",tabindex:0,"aria-label":u.text.close}),y.append(w)),""!==u.title&&(e="_"+L.get.id()+"title",y.attr("aria-labelledby",e),R("<div/>",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+L.get.id()+"desc",y.attr("aria-describedby",e),R("<div/>",{class:m.content,id:e}).appendTo(y)),L.has.configActions()&&R("<div/>",{class:m.actions}).appendTo(y),x.append(y),S=y[0]},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},e=R.extend(!0,e,u.dimmerSettings);void 0===R.fn.dimmer?L.error(v.dimmer):(L.debug("Creating dimmer"),n=x.dimmer(e),H=L.is.scrolling(),u.detachable?(L.verbose("Modal is detachable, moving content into dimmer"),n.dimmer("add content",y)):L.set.undetached(),t=n.dimmer("get dimmer"))},id:function(){l=(Math.random().toString(16)+"000000000").slice(2,10),c="."+l,L.verbose("Creating unique id for element",l)},innerDimmer:function(){0===y.find(f.dimmer).length&&R("<div/>",{class:m.innerDimmer}).prependTo(y)}},destroy:function(){d&&d.disconnect(),L.verbose("Destroying previous modal"),y.removeData(b).off(p),j.off(c),x.off(c),t.off(c),w.off(c),i&&i.off(c),x.dimmer("destroy")},observeChanges:function(){"MutationObserver"in U&&((d=new MutationObserver(function(e){function o(e){for(var t=[],i=0,n=e.length;i<n;i++)Array.prototype.push.apply(t,o(e[i].childNodes)),t.push(e[i]);return t}var i=!1,n=!1,a=!0;e.every(function(e){var t;return"attributes"===e.type?O&&("disabled"===e.attributeName||0<R(e.target).find(":input").addBack(":input").filter(":visible").length)&&(n=!0):(i=!0,t=R(o(e.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),e=R(o(e.removedNodes)).filter("a[href], [tabindex], :input"),(0<t.length||0<e.length)&&(a=!(n=!0))),!n}),i&&u.observeChanges&&(L.debug("DOM tree modified, refreshing"),L.refresh()),n&&L.refreshInputs(a)})).observe(S,{attributeFilter:["class","disabled"],attributes:!0,childList:!0,subtree:!0}),L.debug("Setting up mutation observer",d))},refresh:function(){L.remove.scrolling(),L.cacheSizes(),L.can.useFlex()||L.set.modalOffset(),L.set.screenHeight(),L.set.type()},refreshModals:function(){a=y.siblings(f.modal),o=a.add(y)},refreshInputs:function(e){i&&i.off("keydown"+c),0===(i=y.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===R(this).closest(".disabled").length})).filter(":input").length?(i=y.add(i),y.attr("tabindex",-1)):y.removeAttr("tabindex"),i.first().on("keydown"+c,L.event.inputKeyDown.first),i.last().on("keydown"+c,L.event.inputKeyDown.last),!e&&u.autofocus&&0===i.filter(":focus").length&&L.set.autofocus()},attachEvents:function(e,t){var i=R(e);t=_(L[t])?L[t]:L.toggle,0<i.length?(L.debug("Attaching modal events to element",e,t),i.off(p).on("click"+p,t)):L.error(v.notFound,e)},bind:{events:function(){L.verbose("Attaching events"),y.on("click"+p,f.close,L.event.close).on("click"+p,f.approve,L.event.approve).on("click"+p,f.deny,L.event.deny),w.on("keyup"+c,L.event.closeKeyUp),j.on("resize"+c,L.event.resize).on("focus"+c,L.event.focus),x.on("click"+c,L.event.click)},scrollLock:function(){n[0].addEventListener("touchmove",L.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){n[0].removeEventListener("touchmove",L.event.preventScroll,{passive:!1})}},get:{id:function(){return l},element:function(){return y},settings:function(){return u}},event:{approve:function(){M||!1===u.onApprove.call(S,R(this))?L.verbose("Approve callback returned false cancelling hide"):(M=!0,L.hide(function(){M=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){M||!1===u.onDeny.call(S,R(this))?L.verbose("Deny callback returned false cancelling hide"):(M=!0,L.hide(function(){M=!1}))},close:function(){L.hide()},closeKeyUp:function(e){e=e.which;e!==u.keys.enter&&e!==u.keys.space||!y.hasClass(m.front)||L.hide()},inputKeyDown:{first:function(e){e.which===u.keys.tab&&e.shiftKey&&(i.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==u.keys.tab||e.shiftKey||(i.first().trigger("focus"),e.preventDefault())}},mousedown:function(e){var t=R(e.target),i=L.is.rtl();(s=0<t.closest(f.modal).length)&&L.verbose("Mouse down event registered inside the modal"),(r=L.is.scrolling()&&(!i&&j.outerWidth()-u.scrollbarWidth<=e.clientX||i&&u.scrollbarWidth>=e.clientX))&&L.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(e){if(u.closable)if(s)L.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(r)L.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{var t=0<R(e.target).closest(f.modal).length,e=R.contains(V.documentElement,e.target);if(!t&&e&&L.is.active()&&y.hasClass(m.front)){if(L.debug("Dimmer clicked, hiding all modals"),u.allowMultiple){if(!L.hideAll())return}else if(!L.hide())return;L.remove.clickaway()}}else L.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(L.timer),L.timer=setTimeout(e,t)},keyboard:function(e){e.which===u.keys.escape&&(u.closable?(L.debug("Escape key pressed hiding modal"),y.hasClass(m.front)&&L.hide()):L.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){n.dimmer("is active")&&(L.is.animating()||L.is.active())&&requestAnimationFrame(L.refresh)},focus:function(){E=!0},click:function(e){E&&V.activeElement!==e.target&&n.dimmer("is active")&&L.is.active()&&u.autofocus&&0===R(V.activeElement).closest(f.modal).length&&requestAnimationFrame(L.set.autofocus),E=!1}},toggle:function(){L.is.active()||L.is.animating()?L.hide():L.show()},show:function(e){e=_(e)?e:function(){},L.refreshModals(),L.set.dimmerSettings(),L.set.dimmerStyles(),L.showModal(e)},hide:function(e){return e=_(e)?e:function(){},L.refreshModals(),L.hideModal(e)},showModal:function(e){e=_(e)?e:function(){},L.is.animating()||!L.is.active()?!1===u.onShow.call(S)?L.verbose("Show callback returned false cancelling show"):(F=L.has.scrollbar(),L.showDimmer(),L.cacheSizes(),F&&L.set.bodyMargin(),L.can.useFlex()?L.remove.legacy():(L.set.legacy(),L.set.modalOffset(),L.debug("Using non-flex legacy modal positioning.")),L.set.screenHeight(),L.set.type(),L.set.clickaway(),!u.allowMultiple&&L.others.active()?L.hideOthers(L.showModal):(M=!1,u.allowMultiple&&(L.others.active()&&a.filter("."+m.active).find(f.dimmer).addClass("active"),u.detachable&&y.detach().appendTo(t)),u.transition&&void 0!==R.fn.transition?(L.debug("Showing modal with css animations"),L.set.observeAttributes(!1),y.transition({debug:u.debug,verbose:u.verbose,silent:u.silent,animation:(u.transition.showMethod||u.transition)+" in",queue:u.queue,duration:u.transition.showDuration||u.duration,useFailSafe:!0,onComplete:function(){u.onVisible.apply(S),u.keyboardShortcuts&&L.add.keyboardShortcuts(),L.save.focus(),L.set.active(),L.refreshInputs(),requestAnimationFrame(L.set.observeAttributes),e()}})):L.error(v.noTransition))):L.debug("Modal is already visible")},hideModal:function(e,t,i){var n=a.filter("."+m.active).last();if(e=_(e)?e:function(){},!1===u.onHide.call(S,R(this)))return L.verbose("Hide callback returned false cancelling hide"),M=!1;(L.is.animating()||L.is.active())&&(L.debug("Hiding modal"),u.transition&&void 0!==R.fn.transition?(L.remove.active(),L.set.observeAttributes(!1),y.transition({debug:u.debug,verbose:u.verbose,silent:u.silent,animation:(u.transition.hideMethod||u.transition)+" out",queue:u.queue,duration:u.transition.hideDuration||u.duration,useFailSafe:!0,onStart:function(){L.others.active()||L.others.animating()||t||L.hideDimmer(),u.keyboardShortcuts&&!L.others.active()&&L.remove.keyboardShortcuts()},onComplete:function(){L.unbind.scrollLock(),L.remove.active(),u.allowMultiple&&(n.addClass(m.front),y.removeClass(m.front),(i?o:n).find(f.dimmer).removeClass("active")),_(u.onHidden)&&u.onHidden.call(S),L.remove.dimmerStyles(),L.restore.focus(),e()}})):L.error(v.noTransition))},showDimmer:function(){n.dimmer("is animating")||!n.dimmer("is active")?(F&&(k||t.css("top",n.scrollTop()),L.save.bodyMargin()),L.debug("Showing dimmer"),n.dimmer("show")):L.debug("Dimmer already visible")},hideDimmer:function(){n.dimmer("is animating")||n.dimmer("is active")?(L.unbind.scrollLock(),n.dimmer("hide",function(){F&&L.restore.bodyMargin(),L.remove.clickaway(),L.remove.screenHeight()})):L.debug("Dimmer is not visible cannot hide")},hideAll:function(i){var n,e=o.filter("."+m.active+", ."+m.animating);if(i=_(i)?i:function(){},0<e.length)return L.debug("Hiding all visible modals"),n=!0,R(e.get().reverse()).each(function(e,t){n=n&&R(t).modal("hide modal",i,!1,!0)}),n&&L.hideDimmer(),n},hideOthers:function(e){var t=a.filter("."+m.active+", ."+m.animating);e=_(e)?e:function(){},0<t.length&&(L.debug("Hiding other modals",a),t.modal("hide modal",e,!0))},others:{active:function(){return 0<a.filter("."+m.active).length},animating:function(){return 0<a.filter("."+m.animating).length}},add:{keyboardShortcuts:function(){L.verbose("Adding keyboard shortcuts"),z.on("keydown"+p,L.event.keyboard)}},save:{focus:function(){0<R(V.activeElement).closest(y).length||(e=R(V.activeElement).trigger("blur"))},bodyMargin:function(){D=x.css((k?"margin-":"padding-")+(L.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(D.replace(/[^\d.]/g,""),10),t=k?U.innerWidth-V.documentElement.clientWidth:x[0].offsetWidth-x[0].clientWidth;T=e+t}},restore:{focus:function(){e&&0<e.length&&u.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var i=L.can.leftBodyScrollbar()?"left":"right";x.css((k?"margin-":"padding-")+i,D),x.find(f.bodyFixed.replace("right",i)).each(function(){var e=R(this),t="fixed"===e.css("position")?"padding-"+i:i;e.css(t,"")})}},remove:{active:function(){y.removeClass(m.active)},legacy:function(){y.removeClass(m.legacy)},clickaway:function(){u.detachable||y.off("mousedown"+c),t.off("mousedown"+c),t.off("mouseup"+c)},dimmerStyles:function(){t.removeClass(m.inverted),n.removeClass(m.blurring)},bodyStyle:function(){""===x.attr("style")&&(L.verbose("Removing style attribute"),x.removeAttr("style"))},screenHeight:function(){L.debug("Removing page height"),x.css("height",""),L.remove.bodyStyle()},keyboardShortcuts:function(){L.verbose("Removing keyboard shortcuts"),z.off("keydown"+p)},scrolling:function(){H||n.removeClass(m.scrolling),y.removeClass(m.scrolling)}},cacheSizes:function(){y.addClass(m.loading);var e=y.prop("scrollHeight"),t=y.outerWidth(),i=y.outerHeight();void 0!==L.cache.pageHeight&&0===i||(R.extend(L.cache,{pageHeight:z.outerHeight(),width:t,height:i+u.offset,scrollHeight:e+u.offset,contextHeight:(k?j:n).height()}),L.cache.topOffset=-L.cache.height/2),y.removeClass(m.loading),L.debug("Caching modal and container sizes",L.cache)},helpers:{deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var i={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return i[e]}):e}},can:{leftBodyScrollbar:function(){return void 0===L.cache.leftBodyScrollbar&&(L.cache.leftBodyScrollbar=L.is.rtl()&&(L.is.iframe&&!L.is.firefox()||L.is.safari()||L.is.edge()||L.is.ie())),L.cache.leftBodyScrollbar},useFlex:function(){return"auto"===u.useFlex?u.detachable&&!L.is.ie():(u.useFlex&&L.is.ie()?L.debug("useFlex true is not supported in IE"):u.useFlex&&!u.detachable&&L.debug("useFlex true in combination with detachable false is not supported"),u.useFlex)},fit:function(){var e=L.cache.contextHeight,t=L.cache.contextHeight/2,i=L.cache.topOffset,n=L.cache.scrollHeight,o=L.cache.height,a=u.padding;return o<n?t+i+n+a<e:o+2*a<e}},has:{configActions:function(){return Array.isArray(u.actions)&&0<u.actions.length},scrollbar:function(){return k||"hidden"!==x.css("overflow-y")}},is:{active:function(){return y.hasClass(m.active)},ie:function(){var e,t;return void 0===L.cache.isIE&&(e=!U.ActiveXObject&&"ActiveXObject"in U,t="ActiveXObject"in U,L.cache.isIE=e||t),L.cache.isIE},animating:function(){return y.transition("is animating")},scrolling:function(){return n.hasClass(m.scrolling)},modernBrowser:function(){return!(U.ActiveXObject||"ActiveXObject"in U)},rtl:function(){return void 0===L.cache.isRTL&&(L.cache.isRTL="rtl"===y.attr("dir")||"rtl"===y.css("direction")||"rtl"===q.attr("dir")||"rtl"===q.css("direction")||"rtl"===x.attr("dir")||"rtl"===x.css("direction")),L.cache.isRTL},safari:function(){return void 0===L.cache.isSafari&&(L.cache.isSafari=/constructor/i.test(U.HTMLElement)||!!U.ApplePaySession),L.cache.isSafari},edge:function(){return void 0===L.cache.isEdge&&(L.cache.isEdge=!!U.setImmediate&&!L.is.ie()),L.cache.isEdge},firefox:function(){return void 0===L.cache.isFirefox&&(L.cache.isFirefox=!!U.InstallTrigger),L.cache.isFirefox},iframe:function(){return!(self===top)}},set:{observeAttributes:function(e){O=!1!==e},autofocus:function(){var e=i.filter("[autofocus]"),t=i.filter(":input");(0<e.length?e:0<t.length?t:y).first().trigger("focus")},bodyMargin:function(){var i=L.can.leftBodyScrollbar()?"left":"right";(u.detachable||L.can.fit())&&x.css((k?"margin-":"padding-")+i,T+"px"),x.find(f.bodyFixed.replace("right",i)).each(function(){var e=R(this),t="fixed"===e.css("position")?"padding-"+i:i;e.css(t,"calc("+e.css(t)+" + "+T+"px)")})},clickaway:function(){u.detachable||y.on("mousedown"+c,L.event.mousedown),t.on("mousedown"+c,L.event.mousedown),t.on("mouseup"+c,L.event.mouseup)},dimmerSettings:function(){var e;void 0===R.fn.dimmer?L.error(v.dimmer):(e={debug:u.debug,dimmerName:"modals",closable:"auto",useFlex:L.can.useFlex(),duration:{show:u.transition.showDuration||u.duration,hide:u.transition.hideDuration||u.duration}},e=R.extend(!0,e,u.dimmerSettings),u.inverted&&(e.variation=void 0!==e.variation?e.variation+" inverted":"inverted"),x.dimmer("setting",e))},dimmerStyles:function(){u.inverted?t.addClass(m.inverted):t.removeClass(m.inverted),u.blurring?n.addClass(m.blurring):n.removeClass(m.blurring)},modalOffset:function(){var e;u.detachable?y.css({marginTop:!y.hasClass("aligned")&&L.can.fit()?-L.cache.height/2:u.padding/2,marginLeft:-L.cache.width/2}):(e=L.can.fit(),y.css({top:!y.hasClass("aligned")&&e?z.scrollTop()+(L.cache.contextHeight-L.cache.height)/2:!e||y.hasClass("top")?z.scrollTop()+u.padding:z.scrollTop()+(L.cache.contextHeight-L.cache.height-u.padding),marginLeft:-L.cache.width/2})),L.verbose("Setting modal offset for legacy mode")},screenHeight:function(){L.can.fit()?x.css("height",""):y.hasClass("bottom")||(L.debug("Modal is taller than page content, resizing page height"),x.css("height",L.cache.height+2*u.padding+"px"))},active:function(){y.addClass(m.active+" "+m.front),a.filter("."+m.active).removeClass(m.front)},scrolling:function(){n.addClass(m.scrolling),y.addClass(m.scrolling),L.unbind.scrollLock()},legacy:function(){y.addClass(m.legacy)},type:function(){L.can.fit()?(L.verbose("Modal fits on screen"),L.others.active()||L.others.animating()||(L.remove.scrolling(),L.bind.scrollLock())):y.hasClass("bottom")?L.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(L.verbose("Modal cannot fit on screen setting to scrolling"),L.set.scrolling())},undetached:function(){n.addClass(m.undetached)}},setting:function(e,t){if(L.debug("Changing setting",e,t),R.isPlainObject(e))R.extend(!0,u,e);else{if(void 0===t)return u[e];R.isPlainObject(u[e])?R.extend(!0,u[e],t):u[e]=t}},internal:function(e,t){if(R.isPlainObject(e))R.extend(!0,L,e);else{if(void 0===t)return L[e];L[e]=t}},debug:function(){!u.silent&&u.debug&&(u.performance?L.performance.log(arguments):(L.debug=Function.prototype.bind.call(console.info,console,u.name+":"),L.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?L.performance.log(arguments):(L.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),L.verbose.apply(console,arguments)))},error:function(){u.silent||(L.error=Function.prototype.bind.call(console.error,console,u.name+":"),L.error.apply(console,arguments))},performance:{log:function(e){var t,i;u.performance&&(i=(t=Date.now())-(B||t),B=t,W.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":i})),clearTimeout(L.performance.timer),L.performance.timer=setTimeout(L.performance.display,500)},display:function(){var e=u.name+":",i=0;B=!1,clearTimeout(L.performance.timer),R.each(W,function(e,t){i+=t["Execution Time"]}),e+=" "+i+"ms",0<W.length&&(console.groupCollapsed(e),console.table?console.table(W):R.each(W,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),W=[]}},invoke:function(n,e,t){var o,a,i,s=A;return e=e||Q,t=t||S,"string"==typeof n&&void 0!==s&&(n=n.split(/[ .]/),o=n.length-1,R.each(n,function(e,t){var i=e!==o?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(R.isPlainObject(s[i])&&e!==o)s=s[i];else{if(void 0!==s[i])return a=s[i],!1;{if(!R.isPlainObject(s[t])||e===o)return void 0!==s[t]?a=s[t]:L.error(v.method,n),!1;s=s[t]}}})),_(a)?i=a.apply(t,e):void 0!==a&&(i=a),Array.isArray(I)?I.push(i):void 0!==I?I=[I,i]:void 0!==i&&(I=i),a}};K?(void 0===A&&(_(u.templates[P])&&(u.autoShow=!0,u.className.modal=u.className.template,u=R.extend(!0,{},u,u.templates[P].apply(L,Q)),m=u.className,u.namespace,g=u.fields,v=u.error),L.initialize()),_(u.templates[P])||L.invoke(P)):(void 0!==A&&A.invoke("destroy"),L.initialize(),I=y)}),void 0!==I?I:this},R.modal=R.fn.modal,R.fn.modal.settings={name:"Modal",namespace:"modal",useFlex:"auto",offset:0,silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,restoreFocus:!0,autoShow:!1,inverted:!1,blurring:!1,centered:!0,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,transition:"scale",padding:50,scrollbarWidth:10,title:"",content:"",class:"",classTitle:"",classContent:"",classActions:"",closeIcon:!1,actions:!1,preserveHTML:!0,fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:!1,onApprove:function(){return!0},onDeny:function(){return!0},keys:{space:32,enter:13,escape:27,tab:9},selector:{title:"> .header",content:"> .content",actions:"> .actions",close:"> .close",closeIcon:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal",dimmer:"> .ui.dimmer",bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close",prompt:".ui.input > input"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",inverted:"inverted",legacy:"legacy",loading:"loading",scrolling:"scrolling",undetached:"undetached",front:"front",close:"close icon",button:"ui button",modal:"ui modal",title:"header",content:"content",actions:"actions",template:"ui tiny modal",ok:"positive",cancel:"negative",prompt:"ui fluid input",innerDimmer:"ui inverted dimmer"},text:{ok:"Ok",cancel:"Cancel",close:"Close"}},R.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return R.isPlainObject(e[0])?R.extend({handler:function(){},content:"",title:""},e[0]):(_(e[e.length-1])||e.push(function(){}),{handler:e.pop(),content:e.pop()||"",title:e.pop()||""})},alert:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments),i=t.handler;return{title:t.title,content:t.content,onApprove:i,actions:[{text:e.text.ok,class:e.className.ok,click:i}]}},confirm:function(){function e(){n.handler(!0)}function t(){n.handler(!1)}var i=this.get.settings(),n=i.templates.getArguments(arguments);return{title:n.title,content:n.content,onApprove:e,onDeny:t,actions:[{text:i.text.ok,class:i.className.ok,click:e},{text:i.text.cancel,class:i.className.cancel,click:t}]}},prompt:function(){function e(){var e=i.get.settings(),e=i.get.element().find(e.selector.prompt)[0];o.handler(R(e).val())}function t(){o.handler(null)}var i=this,n=this.get.settings(),o=n.templates.getArguments(arguments);return 0===R(R.parseHTML(o.content)).filter(".ui.input").length&&(o.content+='<p><div class="'+this.helpers.deQuote(n.className.prompt)+'"><input placeholder="'+this.helpers.deQuote(o.placeholder||"")+'" type="text" value="'+this.helpers.deQuote(o.defaultValue||"")+'"></div></p>'),{title:o.title,content:o.content,onApprove:e,onDeny:t,actions:[{text:n.text.ok,class:n.className.ok,click:e},{text:n.text.cancel,class:n.className.cancel,click:t}]}}}}(jQuery,window,document);
|
package/dist/components/nag.css
CHANGED
package/dist/components/nag.js
CHANGED
package/dist/components/popup.js
CHANGED
package/dist/components/rail.css
CHANGED
package/dist/components/shape.js
CHANGED
package/dist/components/site.css
CHANGED
package/dist/components/site.js
CHANGED