fomantic-ui 2.9.1-beta.21 → 2.9.1-beta.23
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/.eslintrc.js +95 -75
- package/.github/workflows/ci.yml +2 -2
- package/.github/workflows/nightly.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/.stylelintrc.js +6 -7
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +7 -7
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +54 -53
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +3 -3
- package/dist/components/calendar.js +119 -99
- package/dist/components/calendar.min.css +2 -2
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +8 -8
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +2 -2
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +16 -18
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +1 -1
- package/dist/components/dropdown.js +87 -87
- 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 +17 -23
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- 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 +2 -2
- package/dist/components/flyout.js +32 -30
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +2 -2
- package/dist/components/form.js +113 -89
- package/dist/components/form.min.css +2 -2
- 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/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +22 -22
- 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 +18 -16
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +30 -30
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +23 -21
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +2 -2
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +8 -8
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +41 -46
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +9 -9
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +2 -2
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +21 -19
- 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 +11 -10
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.js +39 -42
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +7 -7
- package/dist/components/state.min.js +2 -2
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +7 -7
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +2 -2
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +36 -38
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +20 -17
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +7 -7
- package/dist/components/transition.js +27 -21
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +8 -8
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +60 -60
- package/dist/semantic.js +780 -735
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/examples/.eslintrc.js +6 -0
- package/examples/responsive.html +1 -1
- package/gulpfile.js +1 -1
- package/package.json +5 -4
- package/scripts/nightly-version.js +3 -3
- package/src/definitions/behaviors/api.js +53 -52
- package/src/definitions/behaviors/form.js +112 -88
- package/src/definitions/behaviors/state.js +6 -6
- package/src/definitions/behaviors/visibility.js +7 -7
- package/src/definitions/collections/menu.less +2 -2
- package/src/definitions/elements/button.less +2 -2
- package/src/definitions/elements/loader.less +4 -4
- package/src/definitions/elements/step.less +1 -1
- package/src/definitions/globals/site.js +10 -9
- package/src/definitions/modules/accordion.js +6 -6
- package/src/definitions/modules/calendar.js +118 -98
- package/src/definitions/modules/calendar.less +2 -2
- package/src/definitions/modules/checkbox.js +7 -7
- package/src/definitions/modules/dimmer.js +15 -17
- package/src/definitions/modules/dimmer.less +10 -10
- package/src/definitions/modules/dropdown.js +86 -86
- package/src/definitions/modules/embed.js +16 -22
- package/src/definitions/modules/flyout.js +31 -29
- package/src/definitions/modules/flyout.less +1 -1
- package/src/definitions/modules/modal.js +21 -21
- package/src/definitions/modules/nag.js +17 -15
- package/src/definitions/modules/popup.js +29 -29
- package/src/definitions/modules/progress.js +22 -20
- package/src/definitions/modules/rating.js +7 -7
- package/src/definitions/modules/search.js +40 -45
- package/src/definitions/modules/shape.js +8 -8
- package/src/definitions/modules/sidebar.js +20 -18
- package/src/definitions/modules/slider.js +38 -41
- package/src/definitions/modules/sticky.js +6 -6
- package/src/definitions/modules/tab.js +35 -37
- package/src/definitions/modules/toast.js +19 -16
- package/src/definitions/modules/transition.js +26 -20
- package/src/themes/amazon/elements/button.overrides +7 -7
- package/src/themes/default/collections/form.variables +1 -1
- package/src/themes/default/elements/reveal.variables +1 -1
- package/src/themes/default/globals/site.variables +1 -1
- package/src/themes/default/modules/dimmer.variables +6 -6
- package/src/themes/default/modules/modal.variables +1 -1
- package/src/themes/default/modules/slider.variables +4 -4
- package/src/themes/default/modules/toast.variables +2 -2
- package/src/themes/default/modules/transition.overrides +12 -12
- package/src/themes/flat/collections/form.overrides +2 -2
- package/src/themes/flat/globals/site.variables +1 -1
- package/src/themes/github/collections/form.overrides +2 -2
- package/src/themes/github/collections/menu.variables +1 -1
- package/src/themes/github/collections/message.overrides +3 -3
- package/src/themes/github/elements/input.overrides +2 -2
- package/src/themes/timeline/views/feed.overrides +3 -3
- package/src/themes/twitter/elements/button.overrides +2 -2
- package/tasks/.eslintrc.js +9 -0
- package/tasks/README.md +1 -3
- package/tasks/admin/components/create.js +9 -16
- package/tasks/admin/components/init.js +7 -7
- package/tasks/admin/components/update.js +7 -7
- package/tasks/admin/distributions/create.js +15 -17
- package/tasks/admin/distributions/init.js +7 -7
- package/tasks/admin/distributions/update.js +7 -7
- package/tasks/admin/publish.js +1 -1
- package/tasks/admin/register.js +2 -2
- package/tasks/admin/release.js +1 -1
- package/tasks/build/assets.js +2 -2
- package/tasks/build/css.js +8 -3
- package/tasks/build/javascript.js +3 -1
- package/tasks/build.js +1 -1
- package/tasks/check-install.js +1 -1
- package/tasks/clean.js +1 -1
- package/tasks/collections/README.md +3 -5
- package/tasks/collections/admin.js +1 -1
- package/tasks/collections/docs.js +1 -1
- package/tasks/collections/install.js +1 -1
- package/tasks/collections/rtl.js +1 -1
- package/tasks/collections/various.js +1 -1
- package/tasks/config/admin/github.js +5 -6
- package/tasks/config/admin/templates/css-package.js +1 -1
- package/tasks/config/admin/templates/less-package.js +1 -1
- package/tasks/config/npm/gulpfile.js +7 -7
- package/tasks/config/project/config.js +9 -16
- package/tasks/config/project/install.js +26 -25
- package/tasks/config/project/release.js +12 -14
- package/tasks/config/tasks.js +17 -19
- package/tasks/config/user.js +1 -1
- package/tasks/docs/build.js +5 -3
- package/tasks/docs/metadata.js +7 -8
- package/tasks/docs/serve.js +5 -3
- package/tasks/install.js +38 -38
- package/tasks/rtl/build.js +1 -1
- package/tasks/rtl/watch.js +1 -1
- package/tasks/version.js +1 -1
- package/tasks/watch.js +1 -1
- package/test/.eslintrc.js +23 -0
- package/test/meteor/assets.js +1 -1
- package/test/modules/module.spec.js +15 -15
- package/test/modules/popup.spec.js +1 -1
- package/test/modules/search.spec.js +1 -1
- package/test/modules/tab.spec.js +1 -1
- package/test/modules/transition.spec.js +1 -1
package/dist/components/modal.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.23+27384cb - Modal
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -15,11 +15,11 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window = (
|
18
|
+
window = (window !== undefined && window.Math === Math)
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
22
|
-
$.
|
22
|
+
$.fn.modal = function (parameters) {
|
23
23
|
var
|
24
24
|
$allModules = $(this),
|
25
25
|
$window = $(window),
|
@@ -28,11 +28,11 @@
|
|
28
28
|
|
29
29
|
moduleSelector = $allModules.selector || '',
|
30
30
|
|
31
|
-
time =
|
31
|
+
time = Date.now(),
|
32
32
|
performance = [],
|
33
33
|
|
34
34
|
query = arguments[0],
|
35
|
-
methodInvoked = (typeof query
|
35
|
+
methodInvoked = (typeof query === 'string'),
|
36
36
|
queryArguments = [].slice.call(arguments, 1),
|
37
37
|
|
38
38
|
requestAnimationFrame = window.requestAnimationFrame
|
@@ -756,7 +756,7 @@
|
|
756
756
|
bodyMargin: function () {
|
757
757
|
initialBodyMargin = $context.css((isBody ? 'margin-' : 'padding-') + (module.can.leftBodyScrollbar() ? 'left' : 'right'));
|
758
758
|
var
|
759
|
-
bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, '')),
|
759
|
+
bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, ''), 10),
|
760
760
|
bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth
|
761
761
|
;
|
762
762
|
tempBodyMargin = bodyMarginRightPixel + bodyScrollbarWidth;
|
@@ -864,8 +864,8 @@
|
|
864
864
|
return string;
|
865
865
|
}
|
866
866
|
var
|
867
|
-
badChars = /[
|
868
|
-
shouldEscape = /[
|
867
|
+
badChars = /["'<>`]/g,
|
868
|
+
shouldEscape = /["&'<>`]/,
|
869
869
|
escape = {
|
870
870
|
'<': '<',
|
871
871
|
'>': '>',
|
@@ -878,7 +878,7 @@
|
|
878
878
|
}
|
879
879
|
;
|
880
880
|
if (shouldEscape.test(string)) {
|
881
|
-
string = string.replace(/&(?![a-
|
881
|
+
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
882
882
|
|
883
883
|
return string.replace(badChars, escapedChar);
|
884
884
|
}
|
@@ -1189,7 +1189,7 @@
|
|
1189
1189
|
previousTime
|
1190
1190
|
;
|
1191
1191
|
if (settings.performance) {
|
1192
|
-
currentTime =
|
1192
|
+
currentTime = Date.now();
|
1193
1193
|
previousTime = time || currentTime;
|
1194
1194
|
executionTime = currentTime - previousTime;
|
1195
1195
|
time = currentTime;
|
@@ -1240,8 +1240,8 @@
|
|
1240
1240
|
;
|
1241
1241
|
passedArguments = passedArguments || queryArguments;
|
1242
1242
|
context = context || element;
|
1243
|
-
if (typeof query
|
1244
|
-
query = query.split(/[
|
1243
|
+
if (typeof query === 'string' && object !== undefined) {
|
1244
|
+
query = query.split(/[ .]/);
|
1245
1245
|
maxDepth = query.length - 1;
|
1246
1246
|
$.each(query, function (depth, value) {
|
1247
1247
|
var camelCaseValue = (depth != maxDepth)
|
@@ -1312,6 +1312,7 @@
|
|
1312
1312
|
? returnedValue
|
1313
1313
|
: this;
|
1314
1314
|
};
|
1315
|
+
$.modal = $.fn.modal;
|
1315
1316
|
|
1316
1317
|
$.fn.modal.settings = {
|
1317
1318
|
|
@@ -1463,17 +1464,16 @@
|
|
1463
1464
|
content: '',
|
1464
1465
|
title: '',
|
1465
1466
|
}, queryArguments[0]);
|
1466
|
-
} else {
|
1467
|
-
if (!isFunction(queryArguments[queryArguments.length - 1])) {
|
1468
|
-
queryArguments.push(function () {});
|
1469
|
-
}
|
1470
|
-
|
1471
|
-
return {
|
1472
|
-
handler: queryArguments.pop(),
|
1473
|
-
content: queryArguments.pop() || '',
|
1474
|
-
title: queryArguments.pop() || '',
|
1475
|
-
};
|
1476
1467
|
}
|
1468
|
+
if (!isFunction(queryArguments[queryArguments.length - 1])) {
|
1469
|
+
queryArguments.push(function () {});
|
1470
|
+
}
|
1471
|
+
|
1472
|
+
return {
|
1473
|
+
handler: queryArguments.pop(),
|
1474
|
+
content: queryArguments.pop() || '',
|
1475
|
+
title: queryArguments.pop() || '',
|
1476
|
+
};
|
1477
1477
|
},
|
1478
1478
|
alert: function () {
|
1479
1479
|
var
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.1-beta.
|
2
|
+
* # Fomantic UI - 2.9.1-beta.23+27384cb
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(Q,X,U,V){"use strict";function _(e){return"function"==typeof e&&"number"!=typeof e.nodeType}X=void 0!==X&&X.Math==Math?X:globalThis,Q.modal=Q.fn.modal=function(E){var L,e=Q(this),I=Q(X),N=Q(U),z=Q("body"),j=e.selector||"",q=(new Date).getTime(),B=[],R=E,W="string"==typeof R,P=[].slice.call(arguments,1),K=X.requestAnimationFrame||X.mozRequestAnimationFrame||X.webkitRequestAnimationFrame||X.msRequestAnimationFrame||function(e){setTimeout(e,0)};return e.each(function(){var t,o,s,e,i,n,a,r,c,l,d,u=Q.isPlainObject(E)?Q.extend(!0,{},Q.fn.modal.settings,E):Q.extend({},Q.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,p=u.error,v="."+h,b="module-"+h,y=Q(this),x=[X,U].indexOf(u.context)<0?N.find(u.context):z,k=x[0]===z[0],w=y.find(f.closeIcon),C=y.hasClass("modal"),S=this,M=C?y.data(b):V,T=!1,A="",D="",H=!1,F=!1,O={initialize:function(){var s;O.create.id(),C||(O.create.modal(),_(u.onHidden)||(u.onHidden=function(){O.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(f.title).html(O.helpers.escape(u.title,u.preserveHTML)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(O.helpers.escape(u.content,u.preserveHTML)).addClass(u.classContent),O.has.configActions()&&(0===(s=y.find(f.actions).addClass(u.classActions)).length?s=Q("<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="'+O.helpers.deQuote(e[g.icon])+' icon"></i>':"",n=O.helpers.escape(e[g.text]||"",u.preserveHTML),i=O.helpers.deQuote(e[g.class]||""),o=e[g.click]&&_(e[g.click])?e[g.click]:function(){};s.append(Q("<button/>",{html:t+n,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+i,on:{click:function(){var e=Q(this);e.is(f.approve)||e.is(f.deny)||!1===o.call(S,y)||O.hide()}}}))})),O.cache={},O.verbose("Initializing dimmer",x),O.create.dimmer(),u.allowMultiple&&O.create.innerDimmer(),u.centered||y.addClass("top aligned"),O.refreshModals(),O.bind.events(),O.observeChanges(),O.instantiate(),u.autoShow&&O.show()},instantiate:function(){O.verbose("Storing instance of modal"),M=O,y.data(b,M)},create:{modal:function(){var e;y=Q("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(w=Q("<i/>",{class:m.close,role:"button",tabindex:0,"aria-label":u.text.close}),y.append(w)),""!==u.title&&(e="_"+O.get.id()+"title",y.attr("aria-labelledby",e),Q("<div/>",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+O.get.id()+"desc",y.attr("aria-describedby",e),Q("<div/>",{class:m.content,id:e}).appendTo(y)),O.has.configActions()&&Q("<div/>",{class:m.actions}).appendTo(y),x.append(y),S=y[0]},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},e=Q.extend(!0,e,u.dimmerSettings);Q.fn.dimmer===V?O.error(p.dimmer):(O.debug("Creating dimmer"),i=x.dimmer(e),H=O.is.scrolling(),u.detachable?(O.verbose("Modal is detachable, moving content into dimmer"),i.dimmer("add content",y)):O.set.undetached(),n=i.dimmer("get dimmer"))},id:function(){l=(Math.random().toString(16)+"000000000").slice(2,10),c="."+l,O.verbose("Creating unique id for element",l)},innerDimmer:function(){0===y.find(f.dimmer).length&&Q("<div/>",{class:m.innerDimmer}).prependTo(y)}},destroy:function(){d&&d.disconnect(),O.verbose("Destroying previous modal"),y.removeData(b).off(v),I.off(c),n.off(c),w.off(c),t&&t.off(c),x.dimmer("destroy")},observeChanges:function(){"MutationObserver"in X&&((d=new MutationObserver(function(e){u.observeChanges&&(O.debug("DOM tree modified, refreshing"),O.refresh()),O.refreshInputs()})).observe(S,{childList:!0,subtree:!0}),O.debug("Setting up mutation observer",d))},refresh:function(){O.remove.scrolling(),O.cacheSizes(),O.can.useFlex()||O.set.modalOffset(),O.set.screenHeight(),O.set.type()},refreshModals:function(){s=y.siblings(f.modal),o=s.add(y)},refreshInputs:function(){t&&t.off("keydown"+c),(t=y.find("[tabindex], :input").filter(":visible").filter(function(){return 0===Q(this).closest(".disabled").length})).first().on("keydown"+c,O.event.inputKeyDown.first),t.last().on("keydown"+c,O.event.inputKeyDown.last)},attachEvents:function(e,t){var n=Q(e);t=_(O[t])?O[t]:O.toggle,0<n.length?(O.debug("Attaching modal events to element",e,t),n.off(v).on("click"+v,t)):O.error(p.notFound,e)},bind:{events:function(){O.verbose("Attaching events"),y.on("click"+v,f.close,O.event.close).on("click"+v,f.approve,O.event.approve).on("click"+v,f.deny,O.event.deny),w.on("keyup"+c,O.event.closeKeyUp),I.on("resize"+c,O.event.resize)},scrollLock:function(){i[0].addEventListener("touchmove",O.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){i[0].removeEventListener("touchmove",O.event.preventScroll,{passive:!1})}},get:{id:function(){return l},element:function(){return y},settings:function(){return u}},event:{approve:function(){T||!1===u.onApprove.call(S,Q(this))?O.verbose("Approve callback returned false cancelling hide"):(T=!0,O.hide(function(){T=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){T||!1===u.onDeny.call(S,Q(this))?O.verbose("Deny callback returned false cancelling hide"):(T=!0,O.hide(function(){T=!1}))},close:function(){O.hide()},closeKeyUp:function(e){e=e.which;e!==u.keys.enter&&e!==u.keys.space||!y.hasClass(m.front)||O.hide()},inputKeyDown:{first:function(e){e.which===u.keys.tab&&e.shiftKey&&(t.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==u.keys.tab||e.shiftKey||(t.first().trigger("focus"),e.preventDefault())}},mousedown:function(e){var t=Q(e.target),n=O.is.rtl();(a=0<t.closest(f.modal).length)&&O.verbose("Mouse down event registered inside the modal"),(r=O.is.scrolling()&&(!n&&I.outerWidth()-u.scrollbarWidth<=e.clientX||n&&u.scrollbarWidth>=e.clientX))&&O.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(e){if(u.closable)if(a)O.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(r)O.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{var t=0<Q(e.target).closest(f.modal).length,e=Q.contains(U.documentElement,e.target);if(!t&&e&&O.is.active()&&y.hasClass(m.front)){if(O.debug("Dimmer clicked, hiding all modals"),u.allowMultiple){if(!O.hideAll())return}else if(!O.hide())return;O.remove.clickaway()}}else O.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(O.timer),O.timer=setTimeout(e,t)},keyboard:function(e){e.which===u.keys.escape&&(u.closable?(O.debug("Escape key pressed hiding modal"),y.hasClass(m.front)&&O.hide()):O.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){i.dimmer("is active")&&(O.is.animating()||O.is.active())&&K(O.refresh)}},toggle:function(){O.is.active()||O.is.animating()?O.hide():O.show()},show:function(e){e=_(e)?e:function(){},O.refreshModals(),O.set.dimmerSettings(),O.set.dimmerStyles(),O.showModal(e)},hide:function(e){return e=_(e)?e:function(){},O.refreshModals(),O.hideModal(e)},showModal:function(e){e=_(e)?e:function(){},O.is.animating()||!O.is.active()?!1===u.onShow.call(S)?O.verbose("Show callback returned false cancelling show"):(F=O.has.scrollbar(),O.showDimmer(),O.cacheSizes(),F&&O.set.bodyMargin(),O.can.useFlex()?O.remove.legacy():(O.set.legacy(),O.set.modalOffset(),O.debug("Using non-flex legacy modal positioning.")),O.set.screenHeight(),O.set.type(),O.set.clickaway(),!u.allowMultiple&&O.others.active()?O.hideOthers(O.showModal):(T=!1,u.allowMultiple&&(O.others.active()&&s.filter("."+m.active).find(f.dimmer).addClass("active"),u.detachable&&y.detach().appendTo(n)),u.transition&&Q.fn.transition!==V&&y.transition("is supported")?(O.debug("Showing modal with css animations"),y.transition({debug:u.debug,verbose:u.verbose,silent:u.silent,animation:(u.transition.showMethod||u.transition)+" in",queue:u.queue,duration:u.transition.showDuration||u.duration,useFailSafe:!0,onComplete:function(){u.onVisible.apply(S),u.keyboardShortcuts&&O.add.keyboardShortcuts(),O.save.focus(),O.set.active(),O.refreshInputs(),u.autofocus&&O.set.autofocus(),e()}})):O.error(p.noTransition))):O.debug("Modal is already visible")},hideModal:function(e,t,n){var i=s.filter("."+m.active).last();if(e=_(e)?e:function(){},!1===u.onHide.call(S,Q(this)))return O.verbose("Hide callback returned false cancelling hide"),T=!1;(O.is.animating()||O.is.active())&&(O.debug("Hiding modal"),u.transition&&Q.fn.transition!==V&&y.transition("is supported")?(O.remove.active(),y.transition({debug:u.debug,verbose:u.verbose,silent:u.silent,animation:(u.transition.hideMethod||u.transition)+" out",queue:u.queue,duration:u.transition.hideDuration||u.duration,useFailSafe:!0,onStart:function(){O.others.active()||O.others.animating()||t||O.hideDimmer(),u.keyboardShortcuts&&!O.others.active()&&O.remove.keyboardShortcuts()},onComplete:function(){O.unbind.scrollLock(),u.allowMultiple&&(i.addClass(m.front),y.removeClass(m.front),(n?o:i).find(f.dimmer).removeClass("active")),_(u.onHidden)&&u.onHidden.call(S),O.remove.dimmerStyles(),O.restore.focus(),e()}})):O.error(p.noTransition))},showDimmer:function(){i.dimmer("is animating")||!i.dimmer("is active")?(F&&(k||n.css("top",i.scrollTop()),O.save.bodyMargin()),O.debug("Showing dimmer"),i.dimmer("show")):O.debug("Dimmer already visible")},hideDimmer:function(){i.dimmer("is animating")||i.dimmer("is active")?(O.unbind.scrollLock(),i.dimmer("hide",function(){F&&O.restore.bodyMargin(),O.remove.clickaway(),O.remove.screenHeight()})):O.debug("Dimmer is not visible cannot hide")},hideAll:function(n){var i,e=o.filter("."+m.active+", ."+m.animating);if(n=_(n)?n:function(){},0<e.length)return O.debug("Hiding all visible modals"),i=!0,Q(e.get().reverse()).each(function(e,t){i=i&&Q(t).modal("hide modal",n,!1,!0)}),i&&O.hideDimmer(),i},hideOthers:function(e){var t=s.filter("."+m.active+", ."+m.animating);e=_(e)?e:function(){},0<t.length&&(O.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(){O.verbose("Adding keyboard shortcuts"),N.on("keydown"+v,O.event.keyboard)}},save:{focus:function(){0<Q(U.activeElement).closest(y).length||(e=Q(U.activeElement).trigger("blur"))},bodyMargin:function(){A=x.css((k?"margin-":"padding-")+(O.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(A.replace(/[^\d.]/g,"")),t=k?X.innerWidth-U.documentElement.clientWidth:x[0].offsetWidth-x[0].clientWidth;D=e+t}},restore:{focus:function(){e&&0<e.length&&u.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var n=O.can.leftBodyScrollbar()?"left":"right";x.css((k?"margin-":"padding-")+n,A),x.find(f.bodyFixed.replace("right",n)).each(function(){var e=Q(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),n.off("mousedown"+c),n.off("mouseup"+c)},dimmerStyles:function(){n.removeClass(m.inverted),i.removeClass(m.blurring)},bodyStyle:function(){""===x.attr("style")&&(O.verbose("Removing style attribute"),x.removeAttr("style"))},screenHeight:function(){O.debug("Removing page height"),x.css("height",""),O.remove.bodyStyle()},keyboardShortcuts:function(){O.verbose("Removing keyboard shortcuts"),N.off("keydown"+v)},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();O.cache.pageHeight!==V&&0===n||(Q.extend(O.cache,{pageHeight:N.outerHeight(),width:t,height:n+u.offset,scrollHeight:e+u.offset,contextHeight:(k?I:i).height()}),O.cache.topOffset=-O.cache.height/2),y.removeClass(m.loading),O.debug("Caching modal and container sizes",O.cache)},helpers:{deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var n={"<":"<",">":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,12};)/gi,"&")).replace(/[<>"'`]/g,function(e){return n[e]}):e}},can:{leftBodyScrollbar:function(){return O.cache.leftBodyScrollbar===V&&(O.cache.leftBodyScrollbar=O.is.rtl()&&(O.is.iframe&&!O.is.firefox()||O.is.safari()||O.is.edge()||O.is.ie())),O.cache.leftBodyScrollbar},useFlex:function(){return"auto"===u.useFlex?u.detachable&&!O.is.ie():(u.useFlex&&O.is.ie()?O.debug("useFlex true is not supported in IE"):u.useFlex&&!u.detachable&&O.debug("useFlex true in combination with detachable false is not supported"),u.useFlex)},fit:function(){var e=O.cache.contextHeight,t=O.cache.contextHeight/2,n=O.cache.topOffset,i=O.cache.scrollHeight,o=O.cache.height,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 O.cache.isIE===V&&(e=!X.ActiveXObject&&"ActiveXObject"in X,t="ActiveXObject"in X,O.cache.isIE=e||t),O.cache.isIE},animating:function(){return y.transition("is supported")?y.transition("is animating"):y.is(":visible")},scrolling:function(){return i.hasClass(m.scrolling)},modernBrowser:function(){return!(X.ActiveXObject||"ActiveXObject"in X)},rtl:function(){return O.cache.isRTL===V&&(O.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")),O.cache.isRTL},safari:function(){return O.cache.isSafari===V&&(O.cache.isSafari=/constructor/i.test(X.HTMLElement)||!!X.ApplePaySession),O.cache.isSafari},edge:function(){return O.cache.isEdge===V&&(O.cache.isEdge=!!X.setImmediate&&!O.is.ie()),O.cache.isEdge},firefox:function(){return O.cache.isFirefox===V&&(O.cache.isFirefox=!!X.InstallTrigger),O.cache.isFirefox},iframe:function(){return!(self===top)}},set:{autofocus:function(){var e=t.filter("[autofocus]"),e=(0<e.length?e:1<t.length?t.filter(":not(i.close)"):t).first();0<e.length&&e.trigger("focus")},bodyMargin:function(){var n=O.can.leftBodyScrollbar()?"left":"right";(u.detachable||O.can.fit())&&x.css((k?"margin-":"padding-")+n,D+"px"),x.find(f.bodyFixed.replace("right",n)).each(function(){var e=Q(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"calc("+e.css(t)+" + "+D+"px)")})},clickaway:function(){u.detachable||y.on("mousedown"+c,O.event.mousedown),n.on("mousedown"+c,O.event.mousedown),n.on("mouseup"+c,O.event.mouseup)},dimmerSettings:function(){var e;Q.fn.dimmer===V?O.error(p.dimmer):(e={debug:u.debug,dimmerName:"modals",closable:"auto",useFlex:O.can.useFlex(),duration:{show:u.transition.showDuration||u.duration,hide:u.transition.hideDuration||u.duration}},e=Q.extend(!0,e,u.dimmerSettings),u.inverted&&(e.variation=e.variation!==V?e.variation+" inverted":"inverted"),x.dimmer("setting",e))},dimmerStyles:function(){u.inverted?n.addClass(m.inverted):n.removeClass(m.inverted),u.blurring?i.addClass(m.blurring):i.removeClass(m.blurring)},modalOffset:function(){var e;u.detachable?y.css({marginTop:!y.hasClass("aligned")&&O.can.fit()?-O.cache.height/2:u.padding/2,marginLeft:-O.cache.width/2}):(e=O.can.fit(),y.css({top:!y.hasClass("aligned")&&e?N.scrollTop()+(O.cache.contextHeight-O.cache.height)/2:!e||y.hasClass("top")?N.scrollTop()+u.padding:N.scrollTop()+(O.cache.contextHeight-O.cache.height-u.padding),marginLeft:-O.cache.width/2})),O.verbose("Setting modal offset for legacy mode")},screenHeight:function(){O.can.fit()?x.css("height",""):y.hasClass("bottom")||(O.debug("Modal is taller than page content, resizing page height"),x.css("height",O.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),O.unbind.scrollLock()},legacy:function(){y.addClass(m.legacy)},type:function(){O.can.fit()?(O.verbose("Modal fits on screen"),O.others.active()||O.others.animating()||(O.remove.scrolling(),O.bind.scrollLock())):y.hasClass("bottom")?O.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(O.verbose("Modal cannot fit on screen setting to scrolling"),O.set.scrolling())},undetached:function(){i.addClass(m.undetached)}},setting:function(e,t){if(O.debug("Changing setting",e,t),Q.isPlainObject(e))Q.extend(!0,u,e);else{if(t===V)return u[e];Q.isPlainObject(u[e])?Q.extend(!0,u[e],t):u[e]=t}},internal:function(e,t){if(Q.isPlainObject(e))Q.extend(!0,O,e);else{if(t===V)return O[e];O[e]=t}},debug:function(){!u.silent&&u.debug&&(u.performance?O.performance.log(arguments):(O.debug=Function.prototype.bind.call(console.info,console,u.name+":"),O.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?O.performance.log(arguments):(O.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),O.verbose.apply(console,arguments)))},error:function(){u.silent||(O.error=Function.prototype.bind.call(console.error,console,u.name+":"),O.error.apply(console,arguments))},performance:{log:function(e){var t,n;u.performance&&(n=(t=(new Date).getTime())-(q||t),q=t,B.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(O.performance.timer),O.performance.timer=setTimeout(O.performance.display,500)},display:function(){var e=u.name+":",n=0;q=!1,clearTimeout(O.performance.timer),Q.each(B,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",j&&(e+=" '"+j+"'"),(console.group!==V||console.table!==V)&&0<B.length&&(console.groupCollapsed(e),console.table?console.table(B):Q.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=M;return e=e||P,t=t||S,"string"==typeof i&&a!==V&&(i=i.split(/[\. ]/),o=i.length-1,Q.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(Q.isPlainObject(a[n])&&e!=o)a=a[n];else{if(a[n]!==V)return s=a[n],!1;{if(!Q.isPlainObject(a[t])||e==o)return a[t]!==V&&(s=a[t]),!1;a=a[t]}}})),_(s)?n=s.apply(t,e):s!==V&&(n=s),Array.isArray(L)?L.push(n):L!==V?L=[L,n]:n!==V&&(L=n),s}};W?(M===V&&(_(u.templates[R])&&(u.autoShow=!0,u.className.modal=u.className.template,u=Q.extend(!0,{},u,u.templates[R].apply(O,P)),m=u.className,u.namespace,g=u.fields,p=u.error),O.initialize()),_(u.templates[R])||O.invoke(R)):(M!==V&&M.invoke("destroy"),O.initialize(),L=y)}),L!==V?L:this},Q.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"}},Q.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return Q.isPlainObject(e[0])?Q.extend({handler:function(){},content:"",title:""},e[0]):(_(e[e.length-1])||e.push(function(){}),{handler:e.pop(),content:e.pop()||"",title:e.pop()||""})},alert:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments),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(Q(e).val())}function t(){o.handler(null)}var n=this,i=this.get.settings(),o=i.templates.getArguments(arguments);return 0===Q(Q.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(Q,X,U,V){"use strict";function _(e){return"function"==typeof e&&"number"!=typeof e.nodeType}X=X!==V&&X.Math===Math?X:globalThis,Q.fn.modal=function(E){var L,e=Q(this),I=Q(X),N=Q(U),z=Q("body"),j=e.selector||"",q=Date.now(),B=[],R=E,W="string"==typeof R,P=[].slice.call(arguments,1),K=X.requestAnimationFrame||X.mozRequestAnimationFrame||X.webkitRequestAnimationFrame||X.msRequestAnimationFrame||function(e){setTimeout(e,0)};return e.each(function(){var t,o,s,e,i,n,a,r,c,l,d,u=Q.isPlainObject(E)?Q.extend(!0,{},Q.fn.modal.settings,E):Q.extend({},Q.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,p=u.error,v="."+h,b="module-"+h,y=Q(this),x=[X,U].indexOf(u.context)<0?N.find(u.context):z,k=x[0]===z[0],w=y.find(f.closeIcon),C=y.hasClass("modal"),S=this,M=C?y.data(b):V,A=!1,T="",D="",H=!1,F=!1,O={initialize:function(){var s;O.create.id(),C||(O.create.modal(),_(u.onHidden)||(u.onHidden=function(){O.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(f.title).html(O.helpers.escape(u.title,u.preserveHTML)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(O.helpers.escape(u.content,u.preserveHTML)).addClass(u.classContent),O.has.configActions()&&(0===(s=y.find(f.actions).addClass(u.classActions)).length?s=Q("<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="'+O.helpers.deQuote(e[g.icon])+' icon"></i>':"",n=O.helpers.escape(e[g.text]||"",u.preserveHTML),i=O.helpers.deQuote(e[g.class]||""),o=e[g.click]&&_(e[g.click])?e[g.click]:function(){};s.append(Q("<button/>",{html:t+n,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+i,on:{click:function(){var e=Q(this);e.is(f.approve)||e.is(f.deny)||!1===o.call(S,y)||O.hide()}}}))})),O.cache={},O.verbose("Initializing dimmer",x),O.create.dimmer(),u.allowMultiple&&O.create.innerDimmer(),u.centered||y.addClass("top aligned"),O.refreshModals(),O.bind.events(),O.observeChanges(),O.instantiate(),u.autoShow&&O.show()},instantiate:function(){O.verbose("Storing instance of modal"),M=O,y.data(b,M)},create:{modal:function(){var e;y=Q("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(w=Q("<i/>",{class:m.close,role:"button",tabindex:0,"aria-label":u.text.close}),y.append(w)),""!==u.title&&(e="_"+O.get.id()+"title",y.attr("aria-labelledby",e),Q("<div/>",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+O.get.id()+"desc",y.attr("aria-describedby",e),Q("<div/>",{class:m.content,id:e}).appendTo(y)),O.has.configActions()&&Q("<div/>",{class:m.actions}).appendTo(y),x.append(y),S=y[0]},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},e=Q.extend(!0,e,u.dimmerSettings);Q.fn.dimmer===V?O.error(p.dimmer):(O.debug("Creating dimmer"),i=x.dimmer(e),H=O.is.scrolling(),u.detachable?(O.verbose("Modal is detachable, moving content into dimmer"),i.dimmer("add content",y)):O.set.undetached(),n=i.dimmer("get dimmer"))},id:function(){l=(Math.random().toString(16)+"000000000").slice(2,10),c="."+l,O.verbose("Creating unique id for element",l)},innerDimmer:function(){0===y.find(f.dimmer).length&&Q("<div/>",{class:m.innerDimmer}).prependTo(y)}},destroy:function(){d&&d.disconnect(),O.verbose("Destroying previous modal"),y.removeData(b).off(v),I.off(c),n.off(c),w.off(c),t&&t.off(c),x.dimmer("destroy")},observeChanges:function(){"MutationObserver"in X&&((d=new MutationObserver(function(e){u.observeChanges&&(O.debug("DOM tree modified, refreshing"),O.refresh()),O.refreshInputs()})).observe(S,{childList:!0,subtree:!0}),O.debug("Setting up mutation observer",d))},refresh:function(){O.remove.scrolling(),O.cacheSizes(),O.can.useFlex()||O.set.modalOffset(),O.set.screenHeight(),O.set.type()},refreshModals:function(){s=y.siblings(f.modal),o=s.add(y)},refreshInputs:function(){t&&t.off("keydown"+c),(t=y.find("[tabindex], :input").filter(":visible").filter(function(){return 0===Q(this).closest(".disabled").length})).first().on("keydown"+c,O.event.inputKeyDown.first),t.last().on("keydown"+c,O.event.inputKeyDown.last)},attachEvents:function(e,t){var n=Q(e);t=_(O[t])?O[t]:O.toggle,0<n.length?(O.debug("Attaching modal events to element",e,t),n.off(v).on("click"+v,t)):O.error(p.notFound,e)},bind:{events:function(){O.verbose("Attaching events"),y.on("click"+v,f.close,O.event.close).on("click"+v,f.approve,O.event.approve).on("click"+v,f.deny,O.event.deny),w.on("keyup"+c,O.event.closeKeyUp),I.on("resize"+c,O.event.resize)},scrollLock:function(){i[0].addEventListener("touchmove",O.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){i[0].removeEventListener("touchmove",O.event.preventScroll,{passive:!1})}},get:{id:function(){return l},element:function(){return y},settings:function(){return u}},event:{approve:function(){A||!1===u.onApprove.call(S,Q(this))?O.verbose("Approve callback returned false cancelling hide"):(A=!0,O.hide(function(){A=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){A||!1===u.onDeny.call(S,Q(this))?O.verbose("Deny callback returned false cancelling hide"):(A=!0,O.hide(function(){A=!1}))},close:function(){O.hide()},closeKeyUp:function(e){e=e.which;e!==u.keys.enter&&e!==u.keys.space||!y.hasClass(m.front)||O.hide()},inputKeyDown:{first:function(e){e.which===u.keys.tab&&e.shiftKey&&(t.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==u.keys.tab||e.shiftKey||(t.first().trigger("focus"),e.preventDefault())}},mousedown:function(e){var t=Q(e.target),n=O.is.rtl();(a=0<t.closest(f.modal).length)&&O.verbose("Mouse down event registered inside the modal"),(r=O.is.scrolling()&&(!n&&I.outerWidth()-u.scrollbarWidth<=e.clientX||n&&u.scrollbarWidth>=e.clientX))&&O.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(e){if(u.closable)if(a)O.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(r)O.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{var t=0<Q(e.target).closest(f.modal).length,e=Q.contains(U.documentElement,e.target);if(!t&&e&&O.is.active()&&y.hasClass(m.front)){if(O.debug("Dimmer clicked, hiding all modals"),u.allowMultiple){if(!O.hideAll())return}else if(!O.hide())return;O.remove.clickaway()}}else O.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(O.timer),O.timer=setTimeout(e,t)},keyboard:function(e){e.which===u.keys.escape&&(u.closable?(O.debug("Escape key pressed hiding modal"),y.hasClass(m.front)&&O.hide()):O.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){i.dimmer("is active")&&(O.is.animating()||O.is.active())&&K(O.refresh)}},toggle:function(){O.is.active()||O.is.animating()?O.hide():O.show()},show:function(e){e=_(e)?e:function(){},O.refreshModals(),O.set.dimmerSettings(),O.set.dimmerStyles(),O.showModal(e)},hide:function(e){return e=_(e)?e:function(){},O.refreshModals(),O.hideModal(e)},showModal:function(e){e=_(e)?e:function(){},O.is.animating()||!O.is.active()?!1===u.onShow.call(S)?O.verbose("Show callback returned false cancelling show"):(F=O.has.scrollbar(),O.showDimmer(),O.cacheSizes(),F&&O.set.bodyMargin(),O.can.useFlex()?O.remove.legacy():(O.set.legacy(),O.set.modalOffset(),O.debug("Using non-flex legacy modal positioning.")),O.set.screenHeight(),O.set.type(),O.set.clickaway(),!u.allowMultiple&&O.others.active()?O.hideOthers(O.showModal):(A=!1,u.allowMultiple&&(O.others.active()&&s.filter("."+m.active).find(f.dimmer).addClass("active"),u.detachable&&y.detach().appendTo(n)),u.transition&&Q.fn.transition!==V&&y.transition("is supported")?(O.debug("Showing modal with css animations"),y.transition({debug:u.debug,verbose:u.verbose,silent:u.silent,animation:(u.transition.showMethod||u.transition)+" in",queue:u.queue,duration:u.transition.showDuration||u.duration,useFailSafe:!0,onComplete:function(){u.onVisible.apply(S),u.keyboardShortcuts&&O.add.keyboardShortcuts(),O.save.focus(),O.set.active(),O.refreshInputs(),u.autofocus&&O.set.autofocus(),e()}})):O.error(p.noTransition))):O.debug("Modal is already visible")},hideModal:function(e,t,n){var i=s.filter("."+m.active).last();if(e=_(e)?e:function(){},!1===u.onHide.call(S,Q(this)))return O.verbose("Hide callback returned false cancelling hide"),A=!1;(O.is.animating()||O.is.active())&&(O.debug("Hiding modal"),u.transition&&Q.fn.transition!==V&&y.transition("is supported")?(O.remove.active(),y.transition({debug:u.debug,verbose:u.verbose,silent:u.silent,animation:(u.transition.hideMethod||u.transition)+" out",queue:u.queue,duration:u.transition.hideDuration||u.duration,useFailSafe:!0,onStart:function(){O.others.active()||O.others.animating()||t||O.hideDimmer(),u.keyboardShortcuts&&!O.others.active()&&O.remove.keyboardShortcuts()},onComplete:function(){O.unbind.scrollLock(),u.allowMultiple&&(i.addClass(m.front),y.removeClass(m.front),(n?o:i).find(f.dimmer).removeClass("active")),_(u.onHidden)&&u.onHidden.call(S),O.remove.dimmerStyles(),O.restore.focus(),e()}})):O.error(p.noTransition))},showDimmer:function(){i.dimmer("is animating")||!i.dimmer("is active")?(F&&(k||n.css("top",i.scrollTop()),O.save.bodyMargin()),O.debug("Showing dimmer"),i.dimmer("show")):O.debug("Dimmer already visible")},hideDimmer:function(){i.dimmer("is animating")||i.dimmer("is active")?(O.unbind.scrollLock(),i.dimmer("hide",function(){F&&O.restore.bodyMargin(),O.remove.clickaway(),O.remove.screenHeight()})):O.debug("Dimmer is not visible cannot hide")},hideAll:function(n){var i,e=o.filter("."+m.active+", ."+m.animating);if(n=_(n)?n:function(){},0<e.length)return O.debug("Hiding all visible modals"),i=!0,Q(e.get().reverse()).each(function(e,t){i=i&&Q(t).modal("hide modal",n,!1,!0)}),i&&O.hideDimmer(),i},hideOthers:function(e){var t=s.filter("."+m.active+", ."+m.animating);e=_(e)?e:function(){},0<t.length&&(O.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(){O.verbose("Adding keyboard shortcuts"),N.on("keydown"+v,O.event.keyboard)}},save:{focus:function(){0<Q(U.activeElement).closest(y).length||(e=Q(U.activeElement).trigger("blur"))},bodyMargin:function(){T=x.css((k?"margin-":"padding-")+(O.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(T.replace(/[^\d.]/g,""),10),t=k?X.innerWidth-U.documentElement.clientWidth:x[0].offsetWidth-x[0].clientWidth;D=e+t}},restore:{focus:function(){e&&0<e.length&&u.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var n=O.can.leftBodyScrollbar()?"left":"right";x.css((k?"margin-":"padding-")+n,T),x.find(f.bodyFixed.replace("right",n)).each(function(){var e=Q(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),n.off("mousedown"+c),n.off("mouseup"+c)},dimmerStyles:function(){n.removeClass(m.inverted),i.removeClass(m.blurring)},bodyStyle:function(){""===x.attr("style")&&(O.verbose("Removing style attribute"),x.removeAttr("style"))},screenHeight:function(){O.debug("Removing page height"),x.css("height",""),O.remove.bodyStyle()},keyboardShortcuts:function(){O.verbose("Removing keyboard shortcuts"),N.off("keydown"+v)},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();O.cache.pageHeight!==V&&0===n||(Q.extend(O.cache,{pageHeight:N.outerHeight(),width:t,height:n+u.offset,scrollHeight:e+u.offset,contextHeight:(k?I:i).height()}),O.cache.topOffset=-O.cache.height/2),y.removeClass(m.loading),O.debug("Caching modal and container sizes",O.cache)},helpers:{deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var n={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return n[e]}):e}},can:{leftBodyScrollbar:function(){return O.cache.leftBodyScrollbar===V&&(O.cache.leftBodyScrollbar=O.is.rtl()&&(O.is.iframe&&!O.is.firefox()||O.is.safari()||O.is.edge()||O.is.ie())),O.cache.leftBodyScrollbar},useFlex:function(){return"auto"===u.useFlex?u.detachable&&!O.is.ie():(u.useFlex&&O.is.ie()?O.debug("useFlex true is not supported in IE"):u.useFlex&&!u.detachable&&O.debug("useFlex true in combination with detachable false is not supported"),u.useFlex)},fit:function(){var e=O.cache.contextHeight,t=O.cache.contextHeight/2,n=O.cache.topOffset,i=O.cache.scrollHeight,o=O.cache.height,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 O.cache.isIE===V&&(e=!X.ActiveXObject&&"ActiveXObject"in X,t="ActiveXObject"in X,O.cache.isIE=e||t),O.cache.isIE},animating:function(){return y.transition("is supported")?y.transition("is animating"):y.is(":visible")},scrolling:function(){return i.hasClass(m.scrolling)},modernBrowser:function(){return!(X.ActiveXObject||"ActiveXObject"in X)},rtl:function(){return O.cache.isRTL===V&&(O.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")),O.cache.isRTL},safari:function(){return O.cache.isSafari===V&&(O.cache.isSafari=/constructor/i.test(X.HTMLElement)||!!X.ApplePaySession),O.cache.isSafari},edge:function(){return O.cache.isEdge===V&&(O.cache.isEdge=!!X.setImmediate&&!O.is.ie()),O.cache.isEdge},firefox:function(){return O.cache.isFirefox===V&&(O.cache.isFirefox=!!X.InstallTrigger),O.cache.isFirefox},iframe:function(){return!(self===top)}},set:{autofocus:function(){var e=t.filter("[autofocus]"),e=(0<e.length?e:1<t.length?t.filter(":not(i.close)"):t).first();0<e.length&&e.trigger("focus")},bodyMargin:function(){var n=O.can.leftBodyScrollbar()?"left":"right";(u.detachable||O.can.fit())&&x.css((k?"margin-":"padding-")+n,D+"px"),x.find(f.bodyFixed.replace("right",n)).each(function(){var e=Q(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"calc("+e.css(t)+" + "+D+"px)")})},clickaway:function(){u.detachable||y.on("mousedown"+c,O.event.mousedown),n.on("mousedown"+c,O.event.mousedown),n.on("mouseup"+c,O.event.mouseup)},dimmerSettings:function(){var e;Q.fn.dimmer===V?O.error(p.dimmer):(e={debug:u.debug,dimmerName:"modals",closable:"auto",useFlex:O.can.useFlex(),duration:{show:u.transition.showDuration||u.duration,hide:u.transition.hideDuration||u.duration}},e=Q.extend(!0,e,u.dimmerSettings),u.inverted&&(e.variation=e.variation!==V?e.variation+" inverted":"inverted"),x.dimmer("setting",e))},dimmerStyles:function(){u.inverted?n.addClass(m.inverted):n.removeClass(m.inverted),u.blurring?i.addClass(m.blurring):i.removeClass(m.blurring)},modalOffset:function(){var e;u.detachable?y.css({marginTop:!y.hasClass("aligned")&&O.can.fit()?-O.cache.height/2:u.padding/2,marginLeft:-O.cache.width/2}):(e=O.can.fit(),y.css({top:!y.hasClass("aligned")&&e?N.scrollTop()+(O.cache.contextHeight-O.cache.height)/2:!e||y.hasClass("top")?N.scrollTop()+u.padding:N.scrollTop()+(O.cache.contextHeight-O.cache.height-u.padding),marginLeft:-O.cache.width/2})),O.verbose("Setting modal offset for legacy mode")},screenHeight:function(){O.can.fit()?x.css("height",""):y.hasClass("bottom")||(O.debug("Modal is taller than page content, resizing page height"),x.css("height",O.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),O.unbind.scrollLock()},legacy:function(){y.addClass(m.legacy)},type:function(){O.can.fit()?(O.verbose("Modal fits on screen"),O.others.active()||O.others.animating()||(O.remove.scrolling(),O.bind.scrollLock())):y.hasClass("bottom")?O.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(O.verbose("Modal cannot fit on screen setting to scrolling"),O.set.scrolling())},undetached:function(){i.addClass(m.undetached)}},setting:function(e,t){if(O.debug("Changing setting",e,t),Q.isPlainObject(e))Q.extend(!0,u,e);else{if(t===V)return u[e];Q.isPlainObject(u[e])?Q.extend(!0,u[e],t):u[e]=t}},internal:function(e,t){if(Q.isPlainObject(e))Q.extend(!0,O,e);else{if(t===V)return O[e];O[e]=t}},debug:function(){!u.silent&&u.debug&&(u.performance?O.performance.log(arguments):(O.debug=Function.prototype.bind.call(console.info,console,u.name+":"),O.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?O.performance.log(arguments):(O.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),O.verbose.apply(console,arguments)))},error:function(){u.silent||(O.error=Function.prototype.bind.call(console.error,console,u.name+":"),O.error.apply(console,arguments))},performance:{log:function(e){var t,n;u.performance&&(n=(t=Date.now())-(q||t),q=t,B.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(O.performance.timer),O.performance.timer=setTimeout(O.performance.display,500)},display:function(){var e=u.name+":",n=0;q=!1,clearTimeout(O.performance.timer),Q.each(B,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",j&&(e+=" '"+j+"'"),(console.group!==V||console.table!==V)&&0<B.length&&(console.groupCollapsed(e),console.table?console.table(B):Q.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=M;return e=e||P,t=t||S,"string"==typeof i&&a!==V&&(i=i.split(/[ .]/),o=i.length-1,Q.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(Q.isPlainObject(a[n])&&e!=o)a=a[n];else{if(a[n]!==V)return s=a[n],!1;{if(!Q.isPlainObject(a[t])||e==o)return a[t]!==V&&(s=a[t]),!1;a=a[t]}}})),_(s)?n=s.apply(t,e):s!==V&&(n=s),Array.isArray(L)?L.push(n):L!==V?L=[L,n]:n!==V&&(L=n),s}};W?(M===V&&(_(u.templates[R])&&(u.autoShow=!0,u.className.modal=u.className.template,u=Q.extend(!0,{},u,u.templates[R].apply(O,P)),m=u.className,u.namespace,g=u.fields,p=u.error),O.initialize()),_(u.templates[R])||O.invoke(R)):(M!==V&&M.invoke("destroy"),O.initialize(),L=y)}),L!==V?L:this},Q.modal=Q.fn.modal,Q.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"}},Q.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return Q.isPlainObject(e[0])?Q.extend({handler:function(){},content:"",title:""},e[0]):(_(e[e.length-1])||e.push(function(){}),{handler:e.pop(),content:e.pop()||"",title:e.pop()||""})},alert:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments),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(Q(e).val())}function t(){o.handler(null)}var n=this,i=this.get.settings(),o=i.templates.getArguments(arguments);return 0===Q(Q.parseHTML(o.content)).filter(".ui.input").length&&(o.content+='<p><div class="'+this.helpers.deQuote(i.className.prompt)+'"><input placeholder="'+this.helpers.deQuote(o.placeholder||"")+'" type="text" value="'+this.helpers.deQuote(o.defaultValue||"")+'"></div></p>'),{title:o.title,content:o.content,onApprove:e,onDeny:t,actions:[{text:i.text.ok,class:i.className.ok,click:e},{text:i.text.cancel,class:i.className.cancel,click:t}]}}}}(jQuery,window,document);
|
package/dist/components/nag.css
CHANGED
package/dist/components/nag.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.23+27384cb - Nag
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -15,7 +15,7 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window = (
|
18
|
+
window = (window !== undefined && window.Math === Math)
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
@@ -24,11 +24,11 @@
|
|
24
24
|
$allModules = $(this),
|
25
25
|
moduleSelector = $allModules.selector || '',
|
26
26
|
|
27
|
-
time =
|
27
|
+
time = Date.now(),
|
28
28
|
performance = [],
|
29
29
|
|
30
30
|
query = arguments[0],
|
31
|
-
methodInvoked = (typeof query
|
31
|
+
methodInvoked = (typeof query === 'string'),
|
32
32
|
queryArguments = [].slice.call(arguments, 1),
|
33
33
|
returnedValue
|
34
34
|
;
|
@@ -162,20 +162,22 @@
|
|
162
162
|
}
|
163
163
|
if (expires instanceof Date && expires.getTime()) {
|
164
164
|
return expires.toUTCString();
|
165
|
-
} else {
|
166
|
-
module.error(error.expiresFormat);
|
167
165
|
}
|
166
|
+
|
167
|
+
module.error(error.expiresFormat);
|
168
168
|
},
|
169
169
|
storage: function () {
|
170
170
|
if (settings.storageMethod === 'localstorage' && window.localStorage !== undefined) {
|
171
171
|
module.debug('Using local storage');
|
172
172
|
|
173
173
|
return window.localStorage;
|
174
|
-
}
|
174
|
+
}
|
175
|
+
if (settings.storageMethod === 'sessionstorage' && window.sessionStorage !== undefined) {
|
175
176
|
module.debug('Using session storage');
|
176
177
|
|
177
178
|
return window.sessionStorage;
|
178
|
-
}
|
179
|
+
}
|
180
|
+
if ('cookie' in document) {
|
179
181
|
module.debug('Using cookie');
|
180
182
|
|
181
183
|
return {
|
@@ -186,12 +188,12 @@
|
|
186
188
|
.replace(/[()]/g, escape)
|
187
189
|
;
|
188
190
|
value = encodeURIComponent(value)
|
189
|
-
.replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[
|
191
|
+
.replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[B-D])/g, decodeURIComponent)
|
190
192
|
;
|
191
193
|
|
192
194
|
var cookieOptions = '';
|
193
195
|
for (var option in options) {
|
194
|
-
if (
|
196
|
+
if (Object.prototype.hasOwnProperty.call(options, option)) {
|
195
197
|
cookieOptions += '; ' + option;
|
196
198
|
if (typeof options[option] === 'string') {
|
197
199
|
cookieOptions += '=' + options[option].split(';')[0];
|
@@ -205,7 +207,7 @@
|
|
205
207
|
for (var i = 0, il = cookies.length; i < il; i++) {
|
206
208
|
var
|
207
209
|
parts = cookies[i].split('='),
|
208
|
-
foundKey = parts[0].replace(/(%[\
|
210
|
+
foundKey = parts[0].replace(/(%[\da-f]{2})+/gi, decodeURIComponent)
|
209
211
|
;
|
210
212
|
if (key === foundKey) {
|
211
213
|
return parts[1] || '';
|
@@ -216,9 +218,9 @@
|
|
216
218
|
storage.setItem(key, '', options);
|
217
219
|
},
|
218
220
|
};
|
219
|
-
} else {
|
220
|
-
module.error(error.noStorage);
|
221
221
|
}
|
222
|
+
|
223
|
+
module.error(error.noStorage);
|
222
224
|
},
|
223
225
|
storageOptions: function () {
|
224
226
|
var
|
@@ -352,7 +354,7 @@
|
|
352
354
|
previousTime
|
353
355
|
;
|
354
356
|
if (settings.performance) {
|
355
|
-
currentTime =
|
357
|
+
currentTime = Date.now();
|
356
358
|
previousTime = time || currentTime;
|
357
359
|
executionTime = currentTime - previousTime;
|
358
360
|
time = currentTime;
|
@@ -403,8 +405,8 @@
|
|
403
405
|
;
|
404
406
|
passedArguments = passedArguments || queryArguments;
|
405
407
|
context = context || element;
|
406
|
-
if (typeof query
|
407
|
-
query = query.split(/[
|
408
|
+
if (typeof query === 'string' && object !== undefined) {
|
409
|
+
query = query.split(/[ .]/);
|
408
410
|
maxDepth = query.length - 1;
|
409
411
|
$.each(query, function (depth, value) {
|
410
412
|
var camelCaseValue = (depth != maxDepth)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.1-beta.
|
2
|
+
* # Fomantic UI - 2.9.1-beta.23+27384cb
|
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,w,S,D){"use strict";w=
|
11
|
+
!function(x,w,S,D){"use strict";w=w!==D&&w.Math===Math?w:globalThis,x.fn.nag=function(d){var p,e=x(this),m=e.selector||"",f=Date.now(),h=[],b=d,y="string"==typeof b,v=[].slice.call(arguments,1);return e.each(function(){var t,i=x.isPlainObject(d)?x.extend(!0,{},x.fn.nag.settings,d):x.extend({},x.fn.nag.settings),e=i.selector,l=i.error,n=i.namespace,o="."+n,a=n+"-module",r=x(this),s=i.context?[w,S].indexOf(i.context)<0?x(S).find(i.context):x(i.context):x("body"),c=this,u=r.data(a),g={initialize:function(){g.verbose("Initializing element"),"string"!=typeof i.value&&(i.value=JSON.stringify(i.value)),t=g.get.storage(),r.on("click"+o,e.close,g.dismiss).data(a,g),i.detachable&&r.parent()[0]!==s[0]&&r.detach().prependTo(s),0<i.displayTime&&setTimeout(g.hide,i.displayTime),g.show()},destroy:function(){g.verbose("Destroying instance"),r.removeData(a).off(o)},show:function(){if(g.should.show()&&!r.is(":visible")){if(!1===i.onShow.call(c))return g.debug("onShow callback returned false, cancelling nag animation"),!1;g.debug("Showing nag",i.animation.show),"fade"===i.animation.show?r.fadeIn(i.duration,i.easing,i.onVisible):r.slideDown(i.duration,i.easing,i.onVisible)}},hide:function(){if(!1===i.onHide.call(c))return g.debug("onHide callback returned false, cancelling nag animation"),!1;g.debug("Hiding nag",i.animation.hide),"fade"===i.animation.hide?r.fadeOut(i.duration,i.easing,i.onHidden):r.slideUp(i.duration,i.easing,i.onHidden)},dismiss:function(e){!1!==g.hide()&&i.storageMethod&&(g.debug("Dismissing nag",i.storageMethod,i.key,i.value,i.expires),g.storage.set(i.key,i.value)),e.stopImmediatePropagation(),e.preventDefault()},should:{show:function(){return i.persist?(g.debug("Persistent nag is set, can show nag"),!0):g.storage.get(i.key)!=i.value.toString()?(g.debug("Stored value is not set, can show nag",g.storage.get(i.key)),!0):(g.debug("Stored value is set, cannot show nag",g.storage.get(i.key)),!1)}},get:{expirationDate:function(e){if((e="number"==typeof e?new Date(Date.now()+864e5*e):e)instanceof Date&&e.getTime())return e.toUTCString();g.error(l.expiresFormat)},storage:function(){return"localstorage"===i.storageMethod&&w.localStorage!==D?(g.debug("Using local storage"),w.localStorage):"sessionstorage"===i.storageMethod&&w.sessionStorage!==D?(g.debug("Using session storage"),w.sessionStorage):"cookie"in S?(g.debug("Using cookie"),{setItem:function(e,n,o){e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),n=encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[B-D])/g,decodeURIComponent);var t,i="";for(t in o)Object.prototype.hasOwnProperty.call(o,t)&&(i+="; "+t,"string"==typeof o[t]&&(i+="="+o[t].split(";")[0]));S.cookie=e+"="+n+i},getItem:function(e){for(var n=S.cookie.split("; "),o=0,t=n.length;o<t;o++){var i=n[o].split("=");if(e===i[0].replace(/(%[\da-f]{2})+/gi,decodeURIComponent))return i[1]||""}},removeItem:function(e,n){t.setItem(e,"",n)}}):void g.error(l.noStorage)},storageOptions:function(){var e={};return i.expires&&(e.expires=g.get.expirationDate(i.expires)),i.domain&&(e.domain=i.domain),i.path&&(e.path=i.path),i.secure&&(e.secure=i.secure),i.samesite&&(e.samesite=i.samesite),e}},clear:function(){g.storage.remove(i.key)},storage:{set:function(e,n){var o=g.get.storageOptions();t===w.localStorage&&o.expires&&(g.debug("Storing expiration value in localStorage",e,o.expires),t.setItem(e+i.expirationKey,o.expires)),g.debug("Value stored",e,n);try{t.setItem(e,n,o)}catch(e){g.error(l.setItem,e)}},get:function(e){var n,o=t.getItem(e);return t===w.localStorage&&null!==(n=t.getItem(e+i.expirationKey))&&n!==D&&new Date(n)<new Date&&(g.debug("Value in localStorage has expired. Deleting key",e),g.storage.remove(e),o=null),o="undefined"!=o&&"null"!=o&&o!==D&&null!==o?o:D},remove:function(e){var n=g.get.storageOptions();n.expires=g.get.expirationDate(-1),t===w.localStorage&&t.removeItem(e+i.expirationKey),t.removeItem(e,n)}},setting:function(e,n){if(g.debug("Changing setting",e,n),x.isPlainObject(e))x.extend(!0,i,e);else{if(n===D)return i[e];x.isPlainObject(i[e])?x.extend(!0,i[e],n):i[e]=n}},internal:function(e,n){if(x.isPlainObject(e))x.extend(!0,g,e);else{if(n===D)return g[e];g[e]=n}},debug:function(){!i.silent&&i.debug&&(i.performance?g.performance.log(arguments):(g.debug=Function.prototype.bind.call(console.info,console,i.name+":"),g.debug.apply(console,arguments)))},verbose:function(){!i.silent&&i.verbose&&i.debug&&(i.performance?g.performance.log(arguments):(g.verbose=Function.prototype.bind.call(console.info,console,i.name+":"),g.verbose.apply(console,arguments)))},error:function(){i.silent||(g.error=Function.prototype.bind.call(console.error,console,i.name+":"),g.error.apply(console,arguments))},performance:{log:function(e){var n,o;i.performance&&(o=(n=Date.now())-(f||n),f=n,h.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:c,"Execution Time":o})),clearTimeout(g.performance.timer),g.performance.timer=setTimeout(g.performance.display,500)},display:function(){var e=i.name+":",o=0;f=!1,clearTimeout(g.performance.timer),x.each(h,function(e,n){o+=n["Execution Time"]}),e+=" "+o+"ms",m&&(e+=" '"+m+"'"),(console.group!==D||console.table!==D)&&0<h.length&&(console.groupCollapsed(e),console.table?console.table(h):x.each(h,function(e,n){console.log(n.Name+": "+n["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(t,e,n){var i,a,o,r,s=u;return e=e||v,n=n||c,"string"==typeof t&&s!==D&&(t=t.split(/[ .]/),i=t.length-1,x.each(t,function(e,n){var o=e!=i?n+t[e+1].charAt(0).toUpperCase()+t[e+1].slice(1):t;if(x.isPlainObject(s[o])&&e!=i)s=s[o];else{if(s[o]!==D)return a=s[o],!1;{if(!x.isPlainObject(s[n])||e==i)return s[n]!==D?a=s[n]:g.error(l.method,t),!1;s=s[n]}}})),"function"==typeof(r=a)&&"number"!=typeof r.nodeType?o=a.apply(n,e):a!==D&&(o=a),Array.isArray(p)?p.push(o):p!==D?p=[p,o]:o!==D&&(p=o),a}};y?(u===D&&g.initialize(),g.invoke(b)):(u!==D&&u.invoke("destroy"),g.initialize())}),p!==D?p:this},x.fn.nag.settings={name:"Nag",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},context:!1,detachable:!1,expires:30,domain:!1,path:"/",secure:!1,samesite:!1,storageMethod:"cookie",key:"nag",value:"dismiss",expirationKey:"ExpirationDate",error:{noStorage:"Unsupported storage method",method:"The method you called is not defined.",setItem:"Unexpected error while setting value",expiresFormat:'"expires" must be a number of days or a Date Object'},className:{bottom:"bottom",fixed:"fixed"},selector:{close:"> .close.icon"},duration:500,easing:"easeOutQuad",onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){}},x.extend(x.easing,{easeOutQuad:function(e){return 1-(1-e)*(1-e)}})}(jQuery,window,document);
|
package/dist/components/popup.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.23+27384cb - Popup
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -15,7 +15,7 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window = (
|
18
|
+
window = (window !== undefined && window.Math === Math)
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
@@ -32,11 +32,11 @@
|
|
32
32
|
? 'touchstart'
|
33
33
|
: 'click',
|
34
34
|
|
35
|
-
time =
|
35
|
+
time = Date.now(),
|
36
36
|
performance = [],
|
37
37
|
|
38
38
|
query = arguments[0],
|
39
|
-
methodInvoked = (typeof query
|
39
|
+
methodInvoked = (typeof query === 'string'),
|
40
40
|
queryArguments = [].slice.call(arguments, 1),
|
41
41
|
|
42
42
|
returnedValue
|
@@ -282,7 +282,7 @@
|
|
282
282
|
if (settings.hoverable) {
|
283
283
|
module.bind.popup();
|
284
284
|
}
|
285
|
-
} else if ($target.next(selector.popup).length
|
285
|
+
} else if ($target.next(selector.popup).length > 0) {
|
286
286
|
module.verbose('Pre-existing popup found');
|
287
287
|
settings.inline = true;
|
288
288
|
settings.popup = $target.next(selector.popup).data(metadata.activator, $module);
|
@@ -325,7 +325,8 @@
|
|
325
325
|
module.debug('onShow callback returned false, cancelling popup animation');
|
326
326
|
|
327
327
|
return;
|
328
|
-
}
|
328
|
+
}
|
329
|
+
if (!settings.preserve && !settings.popup) {
|
329
330
|
module.refresh();
|
330
331
|
}
|
331
332
|
if ($popup && module.set.position()) {
|
@@ -370,11 +371,9 @@
|
|
370
371
|
}
|
371
372
|
if (settings.inline || settings.popup) {
|
372
373
|
return (module.has.popup());
|
373
|
-
} else {
|
374
|
-
return ($popup.closest($context).length >= 1)
|
375
|
-
? true
|
376
|
-
: false;
|
377
374
|
}
|
375
|
+
|
376
|
+
return ($popup.closest($context).length > 0);
|
378
377
|
},
|
379
378
|
|
380
379
|
removePopup: function () {
|
@@ -590,7 +589,8 @@
|
|
590
589
|
startEvent: function () {
|
591
590
|
if (settings.on == 'hover') {
|
592
591
|
return 'mouseenter';
|
593
|
-
}
|
592
|
+
}
|
593
|
+
if (settings.on == 'focus') {
|
594
594
|
return 'focus';
|
595
595
|
}
|
596
596
|
|
@@ -602,7 +602,8 @@
|
|
602
602
|
endEvent: function () {
|
603
603
|
if (settings.on == 'hover') {
|
604
604
|
return 'mouseleave';
|
605
|
-
}
|
605
|
+
}
|
606
|
+
if (settings.on == 'focus') {
|
606
607
|
return 'blur';
|
607
608
|
}
|
608
609
|
|
@@ -912,19 +913,18 @@
|
|
912
913
|
return ($popup)
|
913
914
|
? module.set.position(position, calculations)
|
914
915
|
: false;
|
916
|
+
}
|
917
|
+
if (settings.lastResort) {
|
918
|
+
module.debug('No position found, showing with last position');
|
915
919
|
} else {
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
settings.onUnplaceable.call($popup, element);
|
925
|
-
|
926
|
-
return false;
|
927
|
-
}
|
920
|
+
module.debug('Popup could not find a position to display', $popup);
|
921
|
+
module.error(error.cannotPlace, element);
|
922
|
+
module.remove.attempts();
|
923
|
+
module.remove.loading();
|
924
|
+
module.reset();
|
925
|
+
settings.onUnplaceable.call($popup, element);
|
926
|
+
|
927
|
+
return false;
|
928
928
|
}
|
929
929
|
}
|
930
930
|
module.debug('Position is on stage', position);
|
@@ -1193,7 +1193,7 @@
|
|
1193
1193
|
previousTime
|
1194
1194
|
;
|
1195
1195
|
if (settings.performance) {
|
1196
|
-
currentTime =
|
1196
|
+
currentTime = Date.now();
|
1197
1197
|
previousTime = time || currentTime;
|
1198
1198
|
executionTime = currentTime - previousTime;
|
1199
1199
|
time = currentTime;
|
@@ -1244,8 +1244,8 @@
|
|
1244
1244
|
;
|
1245
1245
|
passedArguments = passedArguments || queryArguments;
|
1246
1246
|
context = context || element;
|
1247
|
-
if (typeof query
|
1248
|
-
query = query.split(/[
|
1247
|
+
if (typeof query === 'string' && object !== undefined) {
|
1248
|
+
query = query.split(/[ .]/);
|
1249
1249
|
maxDepth = query.length - 1;
|
1250
1250
|
$.each(query, function (depth, value) {
|
1251
1251
|
var camelCaseValue = (depth != maxDepth)
|
@@ -1471,8 +1471,8 @@
|
|
1471
1471
|
templates: {
|
1472
1472
|
escape: function (string) {
|
1473
1473
|
var
|
1474
|
-
badChars = /[
|
1475
|
-
shouldEscape = /[
|
1474
|
+
badChars = /["'<>`]/g,
|
1475
|
+
shouldEscape = /["&'<>`]/,
|
1476
1476
|
escape = {
|
1477
1477
|
'<': '<',
|
1478
1478
|
'>': '>',
|
@@ -1485,7 +1485,7 @@
|
|
1485
1485
|
}
|
1486
1486
|
;
|
1487
1487
|
if (shouldEscape.test(string)) {
|
1488
|
-
string = string.replace(/&(?![a-
|
1488
|
+
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
1489
1489
|
|
1490
1490
|
return string.replace(badChars, escapedChar);
|
1491
1491
|
}
|