fomantic-ui 2.10.0-beta.7 → 2.10.0-beta.9
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 +0 -10
- package/README.md +4 -5
- package/changelog-setup.js +64 -70
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +94 -131
- 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 +152 -205
- 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 +1 -1
- package/dist/components/calendar.js +305 -341
- package/dist/components/calendar.min.css +1 -1
- 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 +76 -116
- 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 +58 -91
- 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 +7 -5
- package/dist/components/dropdown.js +653 -943
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +71 -109
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +183 -257
- 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 +325 -429
- 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 +212 -296
- 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 +67 -97
- 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 +176 -236
- 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 +103 -138
- 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 +80 -121
- 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 +240 -334
- 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 +157 -223
- 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 +122 -163
- 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 +38 -57
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +242 -325
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +68 -98
- 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 +116 -159
- 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 +168 -233
- 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 +90 -115
- 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 +86 -141
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +134 -210
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +59 -57
- package/dist/semantic.js +4015 -5567
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/examples/assets/show-examples.js +2 -4
- package/gulpfile.js +5 -7
- package/package.json +1 -1
- package/scripts/nightly-version.js +7 -10
- package/src/definitions/behaviors/api.js +151 -204
- package/src/definitions/behaviors/form.js +324 -428
- package/src/definitions/behaviors/state.js +67 -97
- package/src/definitions/behaviors/visibility.js +133 -209
- package/src/definitions/globals/site.js +37 -56
- package/src/definitions/modules/accordion.js +93 -130
- package/src/definitions/modules/calendar.js +304 -340
- package/src/definitions/modules/checkbox.js +75 -115
- package/src/definitions/modules/dimmer.js +57 -90
- package/src/definitions/modules/dropdown.js +652 -942
- package/src/definitions/modules/dropdown.less +11 -5
- package/src/definitions/modules/embed.js +70 -108
- package/src/definitions/modules/flyout.js +182 -256
- package/src/definitions/modules/modal.js +211 -295
- package/src/definitions/modules/nag.js +66 -96
- package/src/definitions/modules/popup.js +175 -235
- package/src/definitions/modules/progress.js +102 -137
- package/src/definitions/modules/rating.js +79 -120
- package/src/definitions/modules/search.js +239 -333
- package/src/definitions/modules/shape.js +156 -222
- package/src/definitions/modules/sidebar.js +121 -162
- package/src/definitions/modules/slider.js +241 -324
- package/src/definitions/modules/sticky.js +115 -158
- package/src/definitions/modules/tab.js +167 -232
- package/src/definitions/modules/toast.js +89 -114
- package/src/definitions/modules/transition.js +85 -140
- package/src/themes/default/modules/dropdown.variables +1 -0
- package/tasks/admin/components/create.js +88 -108
- package/tasks/admin/components/init.js +26 -32
- package/tasks/admin/components/update.js +46 -53
- package/tasks/admin/distributions/create.js +71 -101
- package/tasks/admin/distributions/init.js +27 -33
- package/tasks/admin/distributions/update.js +45 -52
- package/tasks/admin/register.js +11 -15
- package/tasks/build/assets.js +14 -18
- package/tasks/build/css.js +54 -63
- package/tasks/build/javascript.js +45 -53
- package/tasks/build.js +4 -6
- package/tasks/check-install.js +5 -7
- package/tasks/clean.js +2 -4
- package/tasks/collections/admin.js +13 -15
- package/tasks/collections/build.js +6 -8
- package/tasks/collections/docs.js +2 -4
- package/tasks/collections/install.js +2 -4
- package/tasks/collections/rtl.js +2 -4
- package/tasks/collections/various.js +2 -4
- package/tasks/config/admin/github.js +7 -9
- package/tasks/config/admin/templates/css-package.js +1 -3
- package/tasks/config/admin/templates/less-package.js +1 -3
- package/tasks/config/npm/gulpfile.js +4 -6
- package/tasks/config/project/config.js +22 -30
- package/tasks/config/project/install.js +56 -70
- package/tasks/config/project/release.js +6 -8
- package/tasks/config/tasks.js +8 -12
- package/tasks/config/user.js +13 -17
- package/tasks/docs/build.js +26 -31
- package/tasks/docs/metadata.js +24 -30
- package/tasks/docs/serve.js +20 -26
- package/tasks/install.js +71 -98
- package/tasks/rtl/build.js +2 -4
- package/tasks/rtl/watch.js +2 -4
- package/tasks/watch.js +9 -11
- package/test/meteor/fonts.js +1 -2
- package/test/modules/module.spec.js +16 -18
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.10.0-beta.
|
2
|
+
* # Fomantic UI - 2.10.0-beta.9+45ac3fe
|
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(j,U,n){"use strict";function k(e){return"function"==typeof e&&"number"!=typeof e.nodeType}U=void 0!==U&&U.Math===Math?U:globalThis,j.fn.tab=function(c){var l,d=k(this)?j(U):j(this),u=j(n),g=Date.now(),L=[],E=c,S="string"==typeof E,w=[].slice.call(arguments,1),O=function(e,t){var a;return 0<=[U,n].indexOf(e)?a=j(e):0===(a=j(t.document).find(e)).length&&(a=t.frameElement?O(e,t.parent):U),a},F=!1;return d.each(function(){var b,i,f,h,p,v=j.isPlainObject(c)?j.extend(!0,{},j.fn.tab.settings,c):j.extend({},j.fn.tab.settings),m=v.className,y=v.metadata,t=v.selector,T=v.error,a=v.regExp,n="."+v.namespace,e="module-"+v.namespace,A=j(this),o={},C=!0,r=0,x=this,s=A.data(e),P={initialize:function(){P.debug("Initializing tab menu item",A),P.determineTabs(),P.debug("Determining tabs",v.context,i),v.auto&&P.set.auto(),P.bind.events(),v.history&&!F&&(v.history=P.initializeHistory(),F=!0);var e,t=P.determine.activeTab();v.autoTabActivation&&void 0===s&&null===t&&(t=!0===v.autoTabActivation?P.get.initialPath():v.autoTabActivation,P.debug("No active tab detected, setting tab active",t),P.changeTab(t)),null!==t&&v.history&&"state"===v.historyType&&(e=j.address.autoUpdate(),j.address.autoUpdate(!1),j.address.value(t),j.address.autoUpdate(e)),P.instantiate()},instantiate:function(){P.verbose("Storing instance of module",P),s=P,A.data(e,P)},destroy:function(){P.debug("Destroying tabs",A),A.removeData(e).off(n)},bind:{events:function(){var e;null!==(e=x)&&e===e.window||(P.debug("Attaching tab activation events to element",A),A.on("click"+n,P.event.click))}},determineTabs:function(){var e;"parent"===v.context?(0<A.closest(t.ui).length?(e=A.closest(t.ui),P.verbose("Using closest UI element as parent",e)):e=A,b=e.parent(),P.verbose("Determined parent element for creating context",b)):v.context?(b=O(v.context,U),P.verbose("Using selector for tab context",v.context,b)):b=j("body"),v.childrenOnly?(i=b.children(t.tabs),P.debug("Searching tab context children for tabs",b,i)):(i=b.find(t.tabs),P.debug("Searching tab context for tabs",b,i))},initializeHistory:function(){if(P.debug("Initializing page state"),void 0===j.address)return P.error(T.state),!1;if("state"===v.historyType){if(P.debug("Using HTML5 to manage state"),!1===v.path)return P.error(T.path),!1;j.address.history(!0).state(v.path),j(U).trigger("popstate")}return j.address.bind("change",P.event.history.change),!0},event:{click:function(e){var t=j(this).data(y.tab);void 0!==t?(v.history?(P.verbose("Updating page state",e),j.address.value(t)):(P.verbose("Changing tab",e),P.changeTab(t)),e.preventDefault()):P.debug("No tab specified")},history:{change:function(e){var t=e.pathNames.join("/")||P.get.initialPath(),a=v.templates.determineTitle(t)||!1;P.performance.display(),P.debug("History change event",t,e),p=e,void 0!==t&&P.changeTab(t),a&&j.address.title(a)}}},refresh:function(){f&&(P.debug("Refreshing tab",f),P.changeTab(f))},cache:{read:function(e){return void 0!==e&&o[e]},add:function(e,t){e=e||f,P.debug("Adding cached content for",e),o[e]=t},remove:function(e){e=e||f,P.debug("Removing cached content for",e),delete o[e]}},escape:{string:function(e){return(e=String(e)).replace(a.escape,"\\$&")}},set:{auto:function(){var e="string"==typeof v.path?v.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";P.verbose("Setting up automatic tab retrieval from server",e),j.isPlainObject(v.apiSettings)?v.apiSettings.url=e:v.apiSettings={url:e}},loading:function(e){var t=P.get.tabElement(e);t.hasClass(m.loading)||(P.verbose("Setting loading state for",t),t.addClass(m.loading).siblings(i).removeClass(m.active+" "+m.loading),0<t.length&&v.onRequest.call(t[0],e))},state:function(e){j.address.value(e)}},changeTab:function(l){var d=U.history&&U.history.pushState&&v.ignoreFirstLoad&&C,u=v.auto||j.isPlainObject(v.apiSettings),g=u&&!d?P.utilities.pathToArray(l):P.get.defaultPathArray(l);l=P.utilities.arrayToPath(g),j.each(g,function(e,t){var a,n,i=g.slice(0,e+1),o=P.utilities.arrayToPath(i),r=P.is.tab(o),s=e+1===g.length,c=P.get.tabElement(o);return P.verbose("Looking for tab",t),r?(P.verbose("Tab was found",t),f=o,h=P.utilities.filterArray(g,i),s?n=!0:(r=g.slice(0,e+2),t=P.utilities.arrayToPath(r),(n=!P.is.tab(t))&&P.verbose("Tab parameters found",r)),!1===v.onBeforeChange.call(x,o)?(P.debug("onBeforeChange returned false, cancelling tab change",c),!1):n&&u?(d?(P.debug("Ignoring remote content on first tab load",o),C=!1,P.cache.add(l,c.html()),P.activate.all(o),v.onFirstLoad.call(c[0],o,h,p),v.onLoad.call(c[0],o,h,p)):(P.activate.navigation(o),P.fetch.content(o,l)),!1):(P.debug("Opened local tab",o),P.activate.all(o),P.cache.read(o)||(P.cache.add(o,!0),P.debug("First time tab loaded calling tab init"),v.onFirstLoad.call(c[0],o,h,p)),void v.onLoad.call(c[0],o,h,p))):-1!==l.search("/")||""===l?(P.error(T.missingTab,A,b,o),!1):(l=P.escape.string(l),o=(a=j("#"+l+', a[name="'+l+'"]')).closest("[data-tab]").data(y.tab),c=P.get.tabElement(o),a&&0<a.length&&o?(P.debug("Anchor link used, opening parent tab",c,a),!1===v.onBeforeChange.call(x,o)?P.debug("onBeforeChange returned false, cancelling tab change",c):(c.hasClass(m.active)||setTimeout(function(){P.scrollTo(a)},0),P.activate.all(o),P.cache.read(o)||(P.cache.add(o,!0),P.debug("First time tab loaded calling tab init"),v.onFirstLoad.call(c[0],o,h,p)),v.onLoad.call(c[0],o,h,p)),!1):void 0)})},scrollTo:function(e){var t=!!(e&&0<e.length)&&e.offset().top;!1!==t&&(P.debug("Forcing scroll to an in-page link in a hidden tab",t,e),u.scrollTop(t))},update:{content:function(e,t,a){var n=P.get.tabElement(e),i=n[0];a=void 0!==a?a:v.evaluateScripts,"string"==typeof v.cacheType&&"dom"===v.cacheType.toLowerCase()&&"string"!=typeof t?n.empty().append(j(t).clone(!0)):a?(P.debug("Updating HTML and evaluating inline scripts",e,t),n.html(t)):(P.debug("Updating HTML",e,t),i.innerHTML=t)}},fetch:{content:function(t,a){var e,n=P.get.tabElement(t),i={dataType:"html",encodeParameters:!1,on:"now",cache:v.alwaysRefresh,onSuccess:function(e){"response"===v.cacheType&&P.cache.add(a,e),P.update.content(t,e),t==f?(P.debug("Content loaded",t),P.activate.tab(t)):P.debug("Content loaded in background",t),v.onFirstLoad.call(n[0],t,h,p),v.onLoad.call(n[0],t,h,p),v.loadOnce?P.cache.add(a,!0):"string"==typeof v.cacheType&&"dom"===v.cacheType.toLowerCase()&&0<n.children().length?setTimeout(function(){var e=(e=n.children().clone(!0)).not("script");P.cache.add(a,e)},0):P.cache.add(a,n.html())},urlData:{tab:a}},o=n.api("get request")||!1,o=o&&"pending"===o.state();a=a||t,e=P.cache.read(a),v.cache&&e?(P.activate.tab(t),P.debug("Adding cached content",a),v.loadOnce||("once"===v.evaluateScripts?P.update.content(t,e,!1):P.update.content(t,e)),v.onLoad.call(n[0],t,h,p)):o?(P.set.loading(t),P.debug("Content is already loading",a)):void 0!==j.api?(e=j.extend(!0,{},v.apiSettings,i),P.debug("Retrieving remote content",a,e),P.set.loading(t),n.api(e)):P.error(T.api)}},activate:{all:function(e){P.activate.tab(e),P.activate.navigation(e)},tab:function(e){var t=P.get.tabElement(e),a="siblings"===v.deactivate?t.siblings(i):i.not(t),n=t.hasClass(m.active);P.verbose("Showing tab content for",t),n||(t.addClass(m.active),a.removeClass(m.active+" "+m.loading),0<t.length&&v.onVisible.call(t[0],e))},navigation:function(e){var t=P.get.navElement(e),a="siblings"===v.deactivate?t.siblings(d):d.not(t),n=t.hasClass(m.active);P.verbose("Activating tab navigation for",t,e),n||(t.addClass(m.active),a.removeClass(m.active+" "+m.loading))}},deactivate:{all:function(){P.deactivate.navigation(),P.deactivate.tabs()},navigation:function(){d.removeClass(m.active)},tabs:function(){i.removeClass(m.active+" "+m.loading)}},is:{tab:function(e){return void 0!==e&&0<P.get.tabElement(e).length}},get:{initialPath:function(){return d.eq(0).data(y.tab)||i.eq(0).data(y.tab)},path:function(){return j.address.value()},defaultPathArray:function(e){return P.utilities.pathToArray(P.get.defaultPath(e))},defaultPath:function(e){var t=d.filter("[data-"+y.tab+'^="'+P.escape.string(e)+'/"]').eq(0).data(y.tab)||!1;if(t){if(P.debug("Found default tab",t),r<v.maxDepth)return r++,P.get.defaultPath(t);P.error(T.recursion)}else P.debug("No default tabs found for",e,i);return r=0,e},navElement:function(e){return e=e||f,d.filter("[data-"+y.tab+'="'+P.escape.string(e)+'"]')},tabElement:function(e){var t;return e=e||f,t=P.utilities.pathToArray(e),t=P.utilities.last(t),e=i.filter("[data-"+y.tab+'="'+P.escape.string(e)+'"]'),t=i.filter("[data-"+y.tab+'="'+P.escape.string(t)+'"]'),0<e.length?e:t},tab:function(){return f}},determine:{activeTab:function(){var a=null;return i.each(function(e,t){j(t).hasClass(m.active)&&(t=j(this).data(y.tab),d.filter("[data-"+y.tab+'="'+P.escape.string(t)+'"]').hasClass(m.active)&&(a=t))}),a}},utilities:{filterArray:function(e,t){return j.grep(e,function(e){return-1===j.inArray(e,t)})},last:function(e){return!!Array.isArray(e)&&e[e.length-1]},pathToArray:function(e){return"string"==typeof(e=void 0===e?f:e)?e.split("/"):[e]},arrayToPath:function(e){return!!Array.isArray(e)&&e.join("/")}},setting:function(e,t){if(P.debug("Changing setting",e,t),j.isPlainObject(e))j.extend(!0,v,e);else{if(void 0===t)return v[e];j.isPlainObject(v[e])?j.extend(!0,v[e],t):v[e]=t}},internal:function(e,t){if(j.isPlainObject(e))j.extend(!0,P,e);else{if(void 0===t)return P[e];P[e]=t}},debug:function(){!v.silent&&v.debug&&(v.performance?P.performance.log(arguments):(P.debug=Function.prototype.bind.call(console.info,console,v.name+":"),P.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?P.performance.log(arguments):(P.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),P.verbose.apply(console,arguments)))},error:function(){v.silent||(P.error=Function.prototype.bind.call(console.error,console,v.name+":"),P.error.apply(console,arguments))},performance:{log:function(e){var t,a;v.performance&&(a=(t=Date.now())-(g||t),g=t,L.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:x,"Execution Time":a})),clearTimeout(P.performance.timer),P.performance.timer=setTimeout(function(){P.performance.display()},500)},display:function(){var e=v.name+":",a=0;g=!1,clearTimeout(P.performance.timer),j.each(L,function(e,t){a+=t["Execution Time"]}),e+=" "+a+"ms",0<L.length&&(console.groupCollapsed(e),console.table?console.table(L):j.each(L,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),L=[]}},invoke:function(n,e,t){var i,o,a,r=s;return e=e||w,t=t||x,"string"==typeof n&&void 0!==r&&(n=n.split(/[ .]/),i=n.length-1,j.each(n,function(e,t){var a=e!==i?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(j.isPlainObject(r[a])&&e!==i)r=r[a];else{if(void 0!==r[a])return o=r[a],!1;{if(!j.isPlainObject(r[t])||e===i)return void 0!==r[t]?o=r[t]:P.error(T.method,n),!1;r=r[t]}}})),k(o)?a=o.apply(t,e):void 0!==o&&(a=o),Array.isArray(l)?l.push(a):void 0!==l?l=[l,a]:void 0!==a&&(l=a),o}};S?(void 0===s&&P.initialize(),P.invoke(E)):(void 0!==s&&s.invoke("destroy"),P.initialize())}),void 0!==l?l:this},j.tab=function(){j(U).tab.apply(this,arguments)},j.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,loadOnce:!1,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",autoTabActivation:!0,onFirstLoad:function(e,t,a){},onLoad:function(e,t,a){},onVisible:function(e,t,a){},onRequest:function(e,t,a){},onBeforeChange:function(e){},templates:{determineTitle:function(e){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",state:"History requires Asual's Address library <https://github.com/asual/jquery-address>"},regExp:{escape:/[\s#$()*+,.:=?@[\\\]^{|}-]/g},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document);
|
11
|
+
!function(F,j,n){"use strict";function U(e){return"function"==typeof e&&"number"!=typeof e.nodeType}j=void 0!==j&&j.Math===Math?j:globalThis,F.fn.tab=function(r){let c=U(this)?F(j):F(this),l=F(n),d=Date.now(),u=[],g=r,P="string"==typeof g,L=[].slice.call(arguments,1),E=function(e,t){let a;return 0<=[j,n].indexOf(e)?a=F(e):0===(a=F(t.document).find(e)).length&&(a=t.frameElement?E(e,t.parent):j),a},w=!1,O;return c.each(function(){let b=F.isPlainObject(r)?F.extend(!0,{},F.fn.tab.settings,r):F.extend({},F.fn.tab.settings),f=b.className,h=b.metadata,t=b.selector,p=b.error;b.regExp;let a="."+b.namespace,e="module-"+b.namespace,v=F(this),m,i,n={},y=!0,o=0,T=this,s=v.data(e),C,S,A,x;A={initialize:function(){A.debug("Initializing tab menu item",v),A.determineTabs(),A.debug("Determining tabs",b.context,i),b.auto&&A.set.auto(),A.bind.events(),b.history&&!w&&(b.history=A.initializeHistory(),w=!0);let e=A.determine.activeTab();var t;b.autoTabActivation&&void 0===s&&null===e&&(e=!0===b.autoTabActivation?A.get.initialPath():b.autoTabActivation,A.debug("No active tab detected, setting tab active",e),A.changeTab(e)),null!==e&&b.history&&"state"===b.historyType&&(t=F.address.autoUpdate(),F.address.autoUpdate(!1),F.address.value(e),F.address.autoUpdate(t)),A.instantiate()},instantiate:function(){A.verbose("Storing instance of module",A),s=A,v.data(e,A)},destroy:function(){A.debug("Destroying tabs",v),v.removeData(e).off(a)},bind:{events:function(){var e;null!==(e=T)&&e===e.window||(A.debug("Attaching tab activation events to element",v),v.on("click"+a,A.event.click))}},determineTabs:function(){let e;"parent"===b.context?(0<v.closest(t.ui).length?(e=v.closest(t.ui),A.verbose("Using closest UI element as parent",e)):e=v,m=e.parent(),A.verbose("Determined parent element for creating context",m)):b.context?(m=E(b.context,j),A.verbose("Using selector for tab context",b.context,m)):m=F("body"),b.childrenOnly?(i=m.children(t.tabs),A.debug("Searching tab context children for tabs",m,i)):(i=m.find(t.tabs),A.debug("Searching tab context for tabs",m,i))},initializeHistory:function(){if(A.debug("Initializing page state"),void 0===F.address)return A.error(p.state),!1;if("state"===b.historyType){if(A.debug("Using HTML5 to manage state"),!1===b.path)return A.error(p.path),!1;F.address.history(!0).state(b.path),F(j).trigger("popstate")}return F.address.bind("change",A.event.history.change),!0},event:{click:function(e){var t=F(this).data(h.tab);void 0!==t?(b.history?(A.verbose("Updating page state",e),F.address.value(t)):(A.verbose("Changing tab",e),A.changeTab(t)),e.preventDefault()):A.debug("No tab specified")},history:{change:function(e){var t=e.pathNames.join("/")||A.get.initialPath(),a=b.templates.determineTitle(t)||!1;A.performance.display(),A.debug("History change event",t,e),x=e,void 0!==t&&A.changeTab(t),a&&F.address.title(a)}}},refresh:function(){C&&(A.debug("Refreshing tab",C),A.changeTab(C))},cache:{read:function(e){return void 0!==e&&n[e]},add:function(e,t){e=e||C,A.debug("Adding cached content for",e),n[e]=t},remove:function(e){e=e||C,A.debug("Removing cached content for",e),delete n[e]}},set:{auto:function(){var e="string"==typeof b.path?b.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";A.verbose("Setting up automatic tab retrieval from server",e),F.isPlainObject(b.apiSettings)?b.apiSettings.url=e:b.apiSettings={url:e}},loading:function(e){let t=A.get.tabElement(e);t.hasClass(f.loading)||(A.verbose("Setting loading state for",t),t.addClass(f.loading).siblings(i).removeClass(f.active+" "+f.loading),0<t.length&&b.onRequest.call(t[0],e))},state:function(e){F.address.value(e)}},changeTab:function(l){let d=j.history&&j.history.pushState&&b.ignoreFirstLoad&&y,u=b.auto||F.isPlainObject(b.apiSettings),g=u&&!d?A.utilities.pathToArray(l):A.get.defaultPathArray(l);l=A.utilities.arrayToPath(g),F.each(g,function(e,t){var a=g.slice(0,e+1);let n=A.utilities.arrayToPath(a);var i=A.is.tab(n),o=e+1===g.length;let r=A.get.tabElement(n),s,c;return A.verbose("Looking for tab",t),i?(A.verbose("Tab was found",t),C=n,S=A.utilities.filterArray(g,a),o?c=!0:(i=g.slice(0,e+2),t=A.utilities.arrayToPath(i),(c=!A.is.tab(t))&&A.verbose("Tab parameters found",i)),!1===b.onBeforeChange.call(T,n)?(A.debug("onBeforeChange returned false, cancelling tab change",r),!1):c&&u?(d?(A.debug("Ignoring remote content on first tab load",n),y=!1,A.cache.add(l,r.html()),A.activate.all(n),b.onFirstLoad.call(r[0],n,S,x),b.onLoad.call(r[0],n,S,x)):(A.activate.navigation(n),A.fetch.content(n,l)),!1):(A.debug("Opened local tab",n),A.activate.all(n),A.cache.read(n)||(A.cache.add(n,!0),A.debug("First time tab loaded calling tab init"),b.onFirstLoad.call(r[0],n,S,x)),void b.onLoad.call(r[0],n,S,x))):-1!==l.search("/")||""===l?(A.error(p.missingTab,v,m,n),!1):(s=F("#"+CSS.escape(l)+', a[name="'+CSS.escape(l)+'"]'),n=s.closest("[data-tab]").data(h.tab),r=A.get.tabElement(n),s&&0<s.length&&n?(A.debug("Anchor link used, opening parent tab",r,s),!1===b.onBeforeChange.call(T,n)?A.debug("onBeforeChange returned false, cancelling tab change",r):(r.hasClass(f.active)||setTimeout(function(){A.scrollTo(s)},0),A.activate.all(n),A.cache.read(n)||(A.cache.add(n,!0),A.debug("First time tab loaded calling tab init"),b.onFirstLoad.call(r[0],n,S,x)),b.onLoad.call(r[0],n,S,x)),!1):void 0)})},scrollTo:function(e){var t=!!(e&&0<e.length)&&e.offset().top;!1!==t&&(A.debug("Forcing scroll to an in-page link in a hidden tab",t,e),l.scrollTop(t))},update:{content:function(e,t,a){let n=A.get.tabElement(e),i=n[0];a=void 0!==a?a:b.evaluateScripts,"string"==typeof b.cacheType&&"dom"===b.cacheType.toLowerCase()&&"string"!=typeof t?n.empty().append(F(t).clone(!0)):a?(A.debug("Updating HTML and evaluating inline scripts",e,t),n.html(t)):(A.debug("Updating HTML",e,t),i.innerHTML=t)}},fetch:{content:function(t,a){let n=A.get.tabElement(t);var e={dataType:"html",encodeParameters:!1,on:"now",cache:b.alwaysRefresh,onSuccess:function(e){"response"===b.cacheType&&A.cache.add(a,e),A.update.content(t,e),t==C?(A.debug("Content loaded",t),A.activate.tab(t)):A.debug("Content loaded in background",t),b.onFirstLoad.call(n[0],t,S,x),b.onLoad.call(n[0],t,S,x),b.loadOnce?A.cache.add(a,!0):"string"==typeof b.cacheType&&"dom"===b.cacheType.toLowerCase()&&0<n.children().length?setTimeout(function(){let e=n.children().clone(!0);e=e.not("script"),A.cache.add(a,e)},0):A.cache.add(a,n.html())},urlData:{tab:a}};let i=n.api("get request")||!1;var o,r=i&&"pending"===i.state();a=a||t,o=A.cache.read(a),b.cache&&o?(A.activate.tab(t),A.debug("Adding cached content",a),b.loadOnce||("once"===b.evaluateScripts?A.update.content(t,o,!1):A.update.content(t,o)),b.onLoad.call(n[0],t,S,x)):r?(A.set.loading(t),A.debug("Content is already loading",a)):void 0!==F.api?(o=F.extend(!0,{},b.apiSettings,e),A.debug("Retrieving remote content",a,o),A.set.loading(t),n.api(o)):A.error(p.api)}},activate:{all:function(e){A.activate.tab(e),A.activate.navigation(e)},tab:function(e){let t=A.get.tabElement(e),a="siblings"===b.deactivate?t.siblings(i):i.not(t);var n=t.hasClass(f.active);A.verbose("Showing tab content for",t),n||(t.addClass(f.active),a.removeClass(f.active+" "+f.loading),0<t.length&&b.onVisible.call(t[0],e))},navigation:function(e){let t=A.get.navElement(e),a="siblings"===b.deactivate?t.siblings(c):c.not(t);var n=t.hasClass(f.active);A.verbose("Activating tab navigation for",t,e),n||(t.addClass(f.active),a.removeClass(f.active+" "+f.loading))}},deactivate:{all:function(){A.deactivate.navigation(),A.deactivate.tabs()},navigation:function(){c.removeClass(f.active)},tabs:function(){i.removeClass(f.active+" "+f.loading)}},is:{tab:function(e){return void 0!==e&&0<A.get.tabElement(e).length}},get:{initialPath:function(){return c.eq(0).data(h.tab)||i.eq(0).data(h.tab)},path:function(){return F.address.value()},defaultPathArray:function(e){return A.utilities.pathToArray(A.get.defaultPath(e))},defaultPath:function(e){let t=c.filter("[data-"+h.tab+'^="'+CSS.escape(e)+'/"]').eq(0);var a=t.data(h.tab)||!1;if(a){if(A.debug("Found default tab",a),o<b.maxDepth)return o++,A.get.defaultPath(a);A.error(p.recursion)}else A.debug("No default tabs found for",e,i);return o=0,e},navElement:function(e){return e=e||C,c.filter("[data-"+h.tab+'="'+CSS.escape(e)+'"]')},tabElement:function(e){var t;return e=e||C,t=A.utilities.pathToArray(e),t=A.utilities.last(t),e=i.filter("[data-"+h.tab+'="'+CSS.escape(e)+'"]'),t=i.filter("[data-"+h.tab+'="'+CSS.escape(t)+'"]'),0<e.length?e:t},tab:function(){return C}},determine:{activeTab:function(){let n=null;return i.each(function(e,t){let a=F(t);if(a.hasClass(f.active)){t=F(this).data(h.tab);let e=c.filter("[data-"+h.tab+'="'+CSS.escape(t)+'"]');e.hasClass(f.active)&&(n=t)}}),n}},utilities:{filterArray:function(e,t){return F.grep(e,function(e){return-1===F.inArray(e,t)})},last:function(e){return!!Array.isArray(e)&&e[e.length-1]},pathToArray:function(e){return"string"==typeof(e=void 0===e?C:e)?e.split("/"):[e]},arrayToPath:function(e){return!!Array.isArray(e)&&e.join("/")}},setting:function(e,t){if(A.debug("Changing setting",e,t),F.isPlainObject(e))F.extend(!0,b,e);else{if(void 0===t)return b[e];F.isPlainObject(b[e])?F.extend(!0,b[e],t):b[e]=t}},internal:function(e,t){if(F.isPlainObject(e))F.extend(!0,A,e);else{if(void 0===t)return A[e];A[e]=t}},debug:function(){!b.silent&&b.debug&&(b.performance?A.performance.log(arguments):(A.debug=Function.prototype.bind.call(console.info,console,b.name+":"),A.debug.apply(console,arguments)))},verbose:function(){!b.silent&&b.verbose&&b.debug&&(b.performance?A.performance.log(arguments):(A.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),A.verbose.apply(console,arguments)))},error:function(){b.silent||(A.error=Function.prototype.bind.call(console.error,console,b.name+":"),A.error.apply(console,arguments))},performance:{log:function(e){var t,a;b.performance&&(a=(t=Date.now())-(d||t),d=t,u.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:T,"Execution Time":a})),clearTimeout(A.performance.timer),A.performance.timer=setTimeout(function(){A.performance.display()},500)},display:function(){var e=b.name+":";let a=0;d=!1,clearTimeout(A.performance.timer),F.each(u,function(e,t){a+=t["Execution Time"]}),e+=" "+a+"ms",0<u.length&&(console.groupCollapsed(e),console.table?console.table(u):F.each(u,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),u=[]}},invoke:function(n,e,t){let i=s,o,r,a;return e=e||L,t=t||T,"string"==typeof n&&void 0!==i&&(n=n.split(/[ .]/),o=n.length-1,F.each(n,function(e,t){var a=e!==o?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(F.isPlainObject(i[a])&&e!==o)i=i[a];else{if(void 0!==i[a])return r=i[a],!1;{if(!F.isPlainObject(i[t])||e===o)return void 0!==i[t]?r=i[t]:A.error(p.method,n),!1;i=i[t]}}})),U(r)?a=r.apply(t,e):void 0!==r&&(a=r),Array.isArray(O)?O.push(a):void 0!==O?O=[O,a]:void 0!==a&&(O=a),r}},P?(void 0===s&&A.initialize(),A.invoke(g)):(void 0!==s&&s.invoke("destroy"),A.initialize())}),void 0!==O?O:this},F.tab=function(){F(j).tab.apply(this,arguments)},F.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,loadOnce:!1,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",autoTabActivation:!0,onFirstLoad:function(e,t,a){},onLoad:function(e,t,a){},onVisible:function(e,t,a){},onRequest:function(e,t,a){},onBeforeChange:function(e){},templates:{determineTitle:function(e){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",state:"History requires Asual's Address library <https://github.com/asual/jquery-address>"},regExp:{escape:/[\s#$()*+,.:=?@[\\\]^{|}-]/g},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document);
|
package/dist/components/text.css
CHANGED
package/dist/components/toast.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.10.0-beta.
|
2
|
+
* # Fomantic-UI 2.10.0-beta.9+45ac3fe - Toast
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -20,64 +20,60 @@
|
|
20
20
|
: globalThis;
|
21
21
|
|
22
22
|
$.fn.toast = function (parameters) {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
$context = win.frameElement ? contextCheck(context, win.parent) : $body;
|
41
|
-
}
|
23
|
+
let $allModules = $(this);
|
24
|
+
let $body = $('body');
|
25
|
+
|
26
|
+
let time = Date.now();
|
27
|
+
let performance = [];
|
28
|
+
|
29
|
+
let query = arguments[0];
|
30
|
+
let methodInvoked = typeof query === 'string';
|
31
|
+
let queryArguments = [].slice.call(arguments, 1);
|
32
|
+
let contextCheck = function (context, win) {
|
33
|
+
let $context;
|
34
|
+
if ([window, document].indexOf(context) >= 0) {
|
35
|
+
$context = $(context);
|
36
|
+
} else {
|
37
|
+
$context = $(win.document).find(context);
|
38
|
+
if ($context.length === 0) {
|
39
|
+
$context = win.frameElement ? contextCheck(context, win.parent) : $body;
|
42
40
|
}
|
41
|
+
}
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
;
|
43
|
+
return $context;
|
44
|
+
};
|
45
|
+
let returnedValue;
|
48
46
|
$allModules.each(function () {
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
module
|
80
|
-
;
|
47
|
+
let settings = $.isPlainObject(parameters)
|
48
|
+
? $.extend(true, {}, $.fn.toast.settings, parameters)
|
49
|
+
: $.extend({}, $.fn.toast.settings);
|
50
|
+
|
51
|
+
let className = settings.className;
|
52
|
+
let selector = settings.selector;
|
53
|
+
let error = settings.error;
|
54
|
+
let namespace = settings.namespace;
|
55
|
+
let fields = settings.fields;
|
56
|
+
|
57
|
+
let eventNamespace = '.' + namespace;
|
58
|
+
let moduleNamespace = namespace + '-module';
|
59
|
+
|
60
|
+
let $module = $(this);
|
61
|
+
let $toastBox;
|
62
|
+
let $toast;
|
63
|
+
let $actions;
|
64
|
+
let $progress;
|
65
|
+
let $progressBar;
|
66
|
+
let $animationObject;
|
67
|
+
let $close;
|
68
|
+
let $context = settings.context ? contextCheck(settings.context, window) : $body;
|
69
|
+
|
70
|
+
let isToastComponent = $module.hasClass('toast') || $module.hasClass('message') || $module.hasClass('card');
|
71
|
+
|
72
|
+
let element = this;
|
73
|
+
let instance = isToastComponent ? $module.data(moduleNamespace) : undefined;
|
74
|
+
|
75
|
+
let id;
|
76
|
+
let module;
|
81
77
|
module = {
|
82
78
|
|
83
79
|
initialize: function () {
|
@@ -109,8 +105,7 @@
|
|
109
105
|
module.verbose('Storing instance of toast');
|
110
106
|
instance = module;
|
111
107
|
$module
|
112
|
-
.data(moduleNamespace, instance)
|
113
|
-
;
|
108
|
+
.data(moduleNamespace, instance);
|
114
109
|
},
|
115
110
|
|
116
111
|
destroy: function () {
|
@@ -127,8 +122,7 @@
|
|
127
122
|
$close = undefined;
|
128
123
|
}
|
129
124
|
$module
|
130
|
-
.removeData(moduleNamespace)
|
131
|
-
;
|
125
|
+
.removeData(moduleNamespace);
|
132
126
|
},
|
133
127
|
|
134
128
|
show: function (callback) {
|
@@ -170,11 +164,11 @@
|
|
170
164
|
},
|
171
165
|
toast: function () {
|
172
166
|
$toastBox = $('<div/>', { class: className.box });
|
173
|
-
|
167
|
+
let iconClass = module.get.iconClass();
|
174
168
|
if (!isToastComponent) {
|
175
169
|
module.verbose('Creating toast');
|
176
170
|
$toast = $('<div/>', { role: 'alert' });
|
177
|
-
|
171
|
+
let $content = $('<div/>', { class: className.content });
|
178
172
|
if (iconClass !== '') {
|
179
173
|
$toast.append($('<i/>', { class: iconClass + ' ' + className.icon }));
|
180
174
|
}
|
@@ -187,7 +181,7 @@
|
|
187
181
|
}));
|
188
182
|
}
|
189
183
|
if (settings.title !== '') {
|
190
|
-
|
184
|
+
let titleId = '_' + module.get.id() + 'title';
|
191
185
|
$toast.attr('aria-labelledby', titleId);
|
192
186
|
$content.append($('<div/>', {
|
193
187
|
class: className.title,
|
@@ -195,7 +189,7 @@
|
|
195
189
|
html: module.helpers.escape(settings.title, settings),
|
196
190
|
}));
|
197
191
|
}
|
198
|
-
|
192
|
+
let descId = '_' + module.get.id() + 'desc';
|
199
193
|
$toast.attr('aria-describedby', descId);
|
200
194
|
$content.append($('<div/>', {
|
201
195
|
class: className.message,
|
@@ -205,8 +199,7 @@
|
|
205
199
|
|
206
200
|
$toast
|
207
201
|
.addClass(settings.class + ' ' + className.toast)
|
208
|
-
.append($content)
|
209
|
-
;
|
202
|
+
.append($content);
|
210
203
|
$toast.css('opacity', String(settings.opacity));
|
211
204
|
if (settings.closeIcon) {
|
212
205
|
$close = $('<i/>', {
|
@@ -257,24 +250,22 @@
|
|
257
250
|
}
|
258
251
|
}
|
259
252
|
settings.actions.forEach(function (el) {
|
260
|
-
|
261
|
-
|
262
|
-
? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '')
|
253
|
+
let icon = el[fields.icon]
|
254
|
+
? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '')
|
263
255
|
+ ' class="' + module.helpers.escape(el[fields.icon]) + ' icon"></i>'
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
;
|
256
|
+
: '';
|
257
|
+
let text = module.helpers.escape(el[fields.text] || '', settings);
|
258
|
+
let cls = module.helpers.escape(el[fields.class] || '');
|
259
|
+
let click = el[fields.click] && isFunction(el[fields.click])
|
260
|
+
? el[fields.click]
|
261
|
+
: function () {};
|
271
262
|
$actions.append($('<button/>', {
|
272
263
|
html: icon + text,
|
273
264
|
'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g, ''),
|
274
265
|
class: className.button + ' ' + cls,
|
275
266
|
on: {
|
276
267
|
click: function () {
|
277
|
-
|
268
|
+
let $button = $(this);
|
278
269
|
if ($button.is(selector.approve) || $button.is(selector.deny) || click.call(element, $module) === false) {
|
279
270
|
return;
|
280
271
|
}
|
@@ -329,7 +320,7 @@
|
|
329
320
|
element = $toast[0];
|
330
321
|
}
|
331
322
|
if (settings.displayTime > 0) {
|
332
|
-
|
323
|
+
let progressingClass = className.progressing + ' ' + (settings.pauseOnHover ? className.pausable : '');
|
333
324
|
if (settings.showProgress) {
|
334
325
|
$progress = $('<div/>', {
|
335
326
|
class: className.progress + ' ' + (settings.classProgress || settings.class),
|
@@ -345,8 +336,7 @@
|
|
345
336
|
$progressBar = $('<div/>', { class: 'bar ' + (settings.progressUp ? 'up ' : 'down ') + progressingClass });
|
346
337
|
$progress
|
347
338
|
.addClass(settings.showProgress)
|
348
|
-
.append($progressBar)
|
349
|
-
;
|
339
|
+
.append($progressBar);
|
350
340
|
if ($progress.hasClass(className.top)) {
|
351
341
|
$toastBox.prepend($progress);
|
352
342
|
} else {
|
@@ -385,8 +375,7 @@
|
|
385
375
|
}
|
386
376
|
$toastBox
|
387
377
|
.on('click' + eventNamespace, selector.approve, module.event.approve)
|
388
|
-
.on('click' + eventNamespace, selector.deny, module.event.deny)
|
389
|
-
;
|
378
|
+
.on('click' + eventNamespace, selector.deny, module.event.deny);
|
390
379
|
},
|
391
380
|
},
|
392
381
|
|
@@ -401,8 +390,7 @@
|
|
401
390
|
$animationObject.off('animationend' + eventNamespace);
|
402
391
|
}
|
403
392
|
$toastBox
|
404
|
-
.off('click' + eventNamespace)
|
405
|
-
;
|
393
|
+
.off('click' + eventNamespace);
|
406
394
|
},
|
407
395
|
},
|
408
396
|
|
@@ -423,8 +411,7 @@
|
|
423
411
|
callback.call($toastBox, element);
|
424
412
|
settings.onVisible.call($toastBox, element);
|
425
413
|
},
|
426
|
-
})
|
427
|
-
;
|
414
|
+
});
|
428
415
|
}
|
429
416
|
},
|
430
417
|
close: function (callback) {
|
@@ -461,8 +448,7 @@
|
|
461
448
|
settings.onHidden.call($toastBox, element);
|
462
449
|
module.destroy();
|
463
450
|
},
|
464
|
-
})
|
465
|
-
;
|
451
|
+
});
|
466
452
|
} else {
|
467
453
|
module.error(error.noTransition);
|
468
454
|
}
|
@@ -581,10 +567,8 @@
|
|
581
567
|
|
582
568
|
helpers: {
|
583
569
|
toClass: function (selector) {
|
584
|
-
|
585
|
-
|
586
|
-
result = ''
|
587
|
-
;
|
570
|
+
let classes = selector.trim().split(/\s+/);
|
571
|
+
let result = '';
|
588
572
|
|
589
573
|
classes.forEach(function (element) {
|
590
574
|
result += '.' + element;
|
@@ -606,7 +590,7 @@
|
|
606
590
|
'>': '>',
|
607
591
|
};
|
608
592
|
|
609
|
-
return string.replace(badChars, (chr) => escape[chr]);
|
593
|
+
return String(string).replace(badChars, (chr) => escape[chr]);
|
610
594
|
},
|
611
595
|
},
|
612
596
|
|
@@ -672,11 +656,9 @@
|
|
672
656
|
},
|
673
657
|
performance: {
|
674
658
|
log: function (message) {
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
previousTime
|
679
|
-
;
|
659
|
+
let currentTime;
|
660
|
+
let executionTime;
|
661
|
+
let previousTime;
|
680
662
|
if (settings.performance) {
|
681
663
|
currentTime = Date.now();
|
682
664
|
previousTime = time || currentTime;
|
@@ -695,10 +677,8 @@
|
|
695
677
|
}, 500);
|
696
678
|
},
|
697
679
|
display: function () {
|
698
|
-
|
699
|
-
|
700
|
-
totalTime = 0
|
701
|
-
;
|
680
|
+
let title = settings.name + ':';
|
681
|
+
let totalTime = 0;
|
702
682
|
time = false;
|
703
683
|
clearTimeout(module.performance.timer);
|
704
684
|
$.each(performance, function (index, data) {
|
@@ -720,22 +700,19 @@
|
|
720
700
|
},
|
721
701
|
},
|
722
702
|
invoke: function (query, passedArguments, context) {
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
response
|
728
|
-
;
|
703
|
+
let object = instance;
|
704
|
+
let maxDepth;
|
705
|
+
let found;
|
706
|
+
let response;
|
729
707
|
passedArguments = passedArguments || queryArguments;
|
730
708
|
context = context || element;
|
731
709
|
if (typeof query === 'string' && object !== undefined) {
|
732
710
|
query = query.split(/[ .]/);
|
733
711
|
maxDepth = query.length - 1;
|
734
712
|
$.each(query, function (depth, value) {
|
735
|
-
|
713
|
+
let camelCaseValue = depth !== maxDepth
|
736
714
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
737
|
-
: query
|
738
|
-
;
|
715
|
+
: query;
|
739
716
|
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
740
717
|
object = object[camelCaseValue];
|
741
718
|
} else if (object[camelCaseValue] !== undefined) {
|
@@ -923,10 +900,8 @@
|
|
923
900
|
|
924
901
|
$.extend($.easing, {
|
925
902
|
easeOutBounce: function (x) {
|
926
|
-
|
927
|
-
|
928
|
-
d1 = 2.75
|
929
|
-
;
|
903
|
+
let n1 = 7.5625;
|
904
|
+
let d1 = 2.75;
|
930
905
|
if (x < 1 / d1) {
|
931
906
|
return n1 * x * x;
|
932
907
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.10.0-beta.
|
2
|
+
* # Fomantic UI - 2.10.0-beta.9+45ac3fe
|
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(M,z,o){"use strict";function S(e){return"function"==typeof e&&"number"!=typeof e.nodeType}z=void 0!==z&&z.Math===Math?z:globalThis,M.fn.toast=function(k){var x,e=M(this),T=M("body"),I=Date.now(),P=[],O=k,A="string"==typeof O,D=[].slice.call(arguments,1),E=function(e,n){var t;return 0<=[z,o].indexOf(e)?t=M(e):0===(t=M(n.document).find(e)).length&&(t=n.frameElement?E(e,n.parent):T),t};return e.each(function(){var t,o,a,s,i,c,l,e,r=M.isPlainObject(k)?M.extend(!0,{},M.fn.toast.settings,k):M.extend({},M.fn.toast.settings),d=r.className,u=r.selector,p=r.error,n=r.namespace,f=r.fields,m="."+n,g=n+"-module",h=M(this),v=r.context?E(r.context,z):T,b=h.hasClass("toast")||h.hasClass("message")||h.hasClass("card"),C=this,y=b?h.data(g):void 0,w={initialize:function(){w.verbose("Initializing element"),w.create.id(),w.has.container()||w.create.container(),(b||""!==r.message||""!==r.title||""!==w.get.iconClass()||r.showImage||w.has.configActions())&&("string"==typeof r.showProgress&&-1!==[d.top,d.bottom].indexOf(r.showProgress)||(r.showProgress=!1),w.create.toast(),r.closeOnClick&&(r.closeIcon||0<M(o).find(u.input).length||w.has.configActions())&&(r.closeOnClick=!1),r.closeOnClick||t.addClass(d.unclickable),w.bind.events()),w.instantiate(),t&&w.show()},instantiate:function(){w.verbose("Storing instance of toast"),y=w,h.data(g,y)},destroy:function(){t&&(w.debug("Removing toast",t),w.unbind.events(),r.onRemove.call(t,C),t.remove(),l=i=s=c=o=t=void 0),h.removeData(g)},show:function(e){!1===r.onShow.call(t,C)?w.debug("onShow callback returned false, cancelling toast animation"):(e=e||function(){},w.debug("Showing toast"),w.animate.show(e))},close:function(e){!1===r.onHide.call(t,C)?w.debug("onHide callback returned false, cancelling toast animation"):(e=e||function(){},w.debug("Closing toast"),w.remove.visible(),w.unbind.events(),w.animate.close(e))},create:{container:function(){w.verbose("Creating container"),v.append(M("<div/>",{class:r.position+" "+d.container+" "+(r.horizontal?d.horizontal:"")+" "+(r.context&&"body"!==r.context?d.absolute:"")}))},id:function(){e=(Math.random().toString(16)+"000000000").slice(2,10),w.verbose("Creating unique id for element",e)},toast:function(){t=M("<div/>",{class:d.box});var e,n=w.get.iconClass();b?(o=r.cloneModule?h.clone().removeAttr("id"):h,l=o.find("> i"+w.helpers.toClass(d.close)),r.closeIcon=0<l.length,""!==n&&o.find(u.icon).attr("class",n+" "+d.icon),r.showImage&&o.find(u.image).attr("src",r.showImage).attr("alt",r.alt||""),""!==r.title&&o.find(u.title).html(w.helpers.escape(r.title,r)),""!==r.message&&o.find(u.message).html(w.helpers.escape(r.message,r))):(w.verbose("Creating toast"),o=M("<div/>",{role:"alert"}),e=M("<div/>",{class:d.content}),""!==n&&o.append(M("<i/>",{class:n+" "+d.icon})),r.showImage&&o.append(M("<img>",{class:d.image+" "+r.classImage,src:r.showImage,alt:r.alt||""})),""!==r.title&&(n="_"+w.get.id()+"title",o.attr("aria-labelledby",n),e.append(M("<div/>",{class:d.title,id:n,html:w.helpers.escape(r.title,r)}))),n="_"+w.get.id()+"desc",o.attr("aria-describedby",n),e.append(M("<div/>",{class:d.message,id:n,html:w.helpers.escape(r.message,r)})),o.addClass(r.class+" "+d.toast).append(e),o.css("opacity",String(r.opacity)),r.closeIcon&&((l=M("<i/>",{class:d.close+" "+("string"==typeof r.closeIcon?r.closeIcon:""),role:"button",tabindex:0,"aria-label":r.text.close})).hasClass(d.left)?o.prepend(l):o.append(l))),o.hasClass(d.compact)&&(r.compact=!0),o.hasClass("card")&&(r.compact=!1),a=o.find(".actions"),w.has.configActions()&&(0===a.length&&(a=M("<div/>",{class:d.actions+" "+(r.classActions||"")}).appendTo(o)),o.hasClass("card")&&!a.hasClass(d.attached)&&(a.addClass(d.extraContent),a.hasClass(d.vertical)&&(a.removeClass(d.vertical),w.error(p.verticalCard))),r.actions.forEach(function(e){var n=e[f.icon]?"<i "+(e[f.text]?'aria-hidden="true"':"")+' class="'+w.helpers.escape(e[f.icon])+' icon"></i>':"",t=w.helpers.escape(e[f.text]||"",r),o=w.helpers.escape(e[f.class]||""),s=e[f.click]&&S(e[f.click])?e[f.click]:function(){};a.append(M("<button/>",{html:n+t,"aria-label":(e[f.text]||e[f.icon]||"").replace(/<[^>]+(>|$)/g,""),class:d.button+" "+o,on:{click:function(){var e=M(this);e.is(u.approve)||e.is(u.deny)||!1===s.call(C,h)||w.close()}}}))})),a&&a.hasClass(d.vertical)&&o.addClass(d.vertical),0<a.length&&!a.hasClass(d.attached)&&(!a||a.hasClass(d.basic)&&!a.hasClass(d.left)||o.addClass(d.actions)),"auto"===r.displayTime&&(r.displayTime=Math.max(r.minDisplayTime,o.text().split(" ").length/r.wordsPerMinute*6e4)),t.append(o),0<a.length&&a.hasClass(d.attached)&&(a.addClass(d.buttons),a.detach(),o.addClass(d.attached),a.hasClass(d.vertical)?(o.wrap(M("<div/>",{class:d.vertical+" "+d.attached+" "+(r.compact?d.compact:"")})),a.hasClass(d.left)?o.addClass(d.left).parent().addClass(d.left).prepend(a):o.parent().append(a)):a.hasClass(d.top)?(t.prepend(a),o.addClass(d.bottom)):(t.append(a),o.addClass(d.top))),h!==o&&(C=(h=o)[0]),0<r.displayTime&&(n=d.progressing+" "+(r.pauseOnHover?d.pausable:""),r.showProgress&&(s=M("<div/>",{class:d.progress+" "+(r.classProgress||r.class),"data-percent":""}),r.classProgress||(o.hasClass("toast")&&!o.hasClass(d.inverted)?s.addClass(d.inverted):s.removeClass(d.inverted)),i=M("<div/>",{class:"bar "+(r.progressUp?"up ":"down ")+n}),s.addClass(r.showProgress).append(i),s.hasClass(d.top)?t.prepend(s):t.append(s),i.css("animation-duration",r.displayTime/1e3+"s")),(c=M("<span/>",{class:"wait "+n})).css("animation-duration",r.displayTime/1e3+"s"),c.appendTo(o)),r.compact&&(t.addClass(d.compact),o.addClass(d.compact),s&&s.addClass(d.compact)),r.newestOnTop?t.prependTo(w.get.container()):t.appendTo(w.get.container())}},bind:{events:function(){w.debug("Binding events to toast"),r.closeIcon&&l.on("click"+m,w.event.close),o.on("click"+m,w.event.click),c&&c.on("animationend"+m,w.event.close),t.on("click"+m,u.approve,w.event.approve).on("click"+m,u.deny,w.event.deny)}},unbind:{events:function(){w.debug("Unbinding events to toast"),r.closeIcon&&l.off("click"+m),o.off("click"+m),c&&c.off("animationend"+m),t.off("click"+m)}},animate:{show:function(e){e=S(e)?e:function(){},r.transition&&w.can.useElement("transition")&&(w.set.visible(),t.transition({animation:r.transition.showMethod+" in",queue:!1,debug:r.debug,verbose:r.verbose,silent:r.silent,duration:r.transition.showDuration,onComplete:function(){e.call(t,C),r.onVisible.call(t,C)}}))},close:function(e){e=S(e)?e:function(){},r.transition&&void 0!==M.fn.transition?t.transition({animation:r.transition.hideMethod+" out",queue:!1,duration:r.transition.hideDuration,debug:r.debug,verbose:r.verbose,silent:r.silent,interval:50,onBeforeHide:function(e){e=S(e)?e:function(){},""!==r.transition.closeEasing?t&&(t.css("opacity","0"),t.wrap("<div/>").parent().hide(r.transition.closeDuration,r.transition.closeEasing,function(){t&&(t.parent().remove(),e.call(t))})):e.call(t)},onComplete:function(){e.call(t,C),r.onHidden.call(t,C),w.destroy()}}):w.error(p.noTransition)},pause:function(){c.css("animationPlayState","paused"),i&&i.css("animationPlayState","paused")},continue:function(){c.css("animationPlayState","running"),i&&i.css("animationPlayState","running")}},has:{container:function(){return w.verbose("Determining if there is already a container"),0<w.get.containers().length},toast:function(){return!!w.get.toast()},toasts:function(){return 0<w.get.toasts().length},configActions:function(){return Array.isArray(r.actions)&&0<r.actions.length}},get:{id:function(){return e},containers:function(){return v.children(w.helpers.toClass(r.position)+u.container+(r.horizontal?w.helpers.toClass(d.horizontal):":not("+w.helpers.toClass(d.horizontal)+")")+(r.context&&"body"!==r.context?w.helpers.toClass(d.absolute):":not("+w.helpers.toClass(d.absolute)+")"))},container:function(){return w.get.containers()[0]},toastBox:function(){return t||null},toast:function(){return o||null},toasts:function(){return M(w.get.container()).find(u.box)},iconClass:function(){return"string"==typeof r.showIcon?r.showIcon:r.showIcon&&r.icons[r.class]?r.icons[r.class]:""},remainingTime:function(){return c?c.css("opacity")*r.displayTime:0}},set:{visible:function(){o.addClass(d.visible)}},remove:{visible:function(){o.removeClass(d.visible)}},event:{close:function(){w.close()},click:function(e){0===M(e.target).closest(u.clickable).length&&(!1!==r.onClick.call(t,C)&&r.closeOnClick?w.close():w.verbose("Click callback returned false or close denied by setting cancelling close"))},approve:function(){!1===r.onApprove.call(C,h)?w.verbose("Approve callback returned false cancelling close"):w.close()},deny:function(){!1===r.onDeny.call(C,h)?w.verbose("Deny callback returned false cancelling close"):w.close()}},helpers:{toClass:function(e){var e=e.trim().split(/\s+/),n="";return e.forEach(function(e){n+="."+e}),n},escape:function(e,n){if(void 0!==n&&n.preserveHTML)return e;const t={'"':""","&":"&","'":"'","<":"<",">":">"};return e.replace(/["'<>]|&(?![\d#A-Za-z]{1,12};)/g,e=>t[e])}},can:{useElement:function(e){return void 0!==M.fn[e]||(w.error(p.noElement.replace("{element}",e)),!1)}},setting:function(e,n){if(w.debug("Changing setting",e,n),M.isPlainObject(e))M.extend(!0,r,e);else{if(void 0===n)return r[e];M.isPlainObject(r[e])?M.extend(!0,r[e],n):r[e]=n}},internal:function(e,n){if(M.isPlainObject(e))M.extend(!0,w,e);else{if(void 0===n)return w[e];w[e]=n}},debug:function(){!r.silent&&r.debug&&(r.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,r.name+":"),w.debug.apply(console,arguments)))},verbose:function(){!r.silent&&r.verbose&&r.debug&&(r.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,r.name+":"),w.verbose.apply(console,arguments)))},error:function(){r.silent||(w.error=Function.prototype.bind.call(console.error,console,r.name+":"),w.error.apply(console,arguments))},performance:{log:function(e){var n,t;r.performance&&(t=(n=Date.now())-(I||n),I=n,P.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:C,"Execution Time":t})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(function(){w.performance.display()},500)},display:function(){var e=r.name+":",t=0;I=!1,clearTimeout(w.performance.timer),M.each(P,function(e,n){t+=n["Execution Time"]}),e+=" "+t+"ms",0<P.length&&(console.groupCollapsed(e),console.table?console.table(P):M.each(P,function(e,n){console.log(n.Name+": "+n["Execution Time"]+"ms")}),console.groupEnd()),P=[]}},invoke:function(o,e,n){var s,a,t,i=y;return e=e||D,n=n||C,"string"==typeof o&&void 0!==i&&(o=o.split(/[ .]/),s=o.length-1,M.each(o,function(e,n){var t=e!==s?n+o[e+1].charAt(0).toUpperCase()+o[e+1].slice(1):o;if(M.isPlainObject(i[t])&&e!==s)i=i[t];else{if(void 0!==i[t])return a=i[t],!1;{if(!M.isPlainObject(i[n])||e===s)return void 0!==i[n]?a=i[n]:w.error(p.method,o),!1;i=i[n]}}})),S(a)?t=a.apply(n,e):void 0!==a&&(t=a),Array.isArray(x)?x.push(t):void 0!==x?x=[x,t]:void 0!==t&&(x=t),a}};A?(void 0===y&&w.initialize(),w.invoke(O)):(void 0!==y&&y.invoke("destroy"),w.initialize(),x=h)}),void 0!==x?x:this},M.toast=M.fn.toast,M.fn.toast.settings={name:"Toast",namespace:"toast",silent:!1,debug:!1,verbose:!1,performance:!0,context:"body",position:"top right",horizontal:!1,class:"neutral",classProgress:!1,classActions:!1,classImage:"mini",title:"",message:"",displayTime:3e3,minDisplayTime:1e3,wordsPerMinute:120,showIcon:!1,newestOnTop:!1,showProgress:!1,pauseOnHover:!0,progressUp:!1,opacity:1,compact:!0,closeIcon:!1,closeOnClick:!0,cloneModule:!0,actions:!1,preserveHTML:!1,showImage:!1,alt:!1,transition:{showMethod:"scale",showDuration:500,hideMethod:"scale",hideDuration:500,closeEasing:"easeOutCubic",closeDuration:500},error:{method:"The method you called is not defined.",noElement:"This module requires ui {element}",verticalCard:"Vertical but not attached actions are not supported for card layout"},className:{container:"ui toast-container",absolute:"absolute",box:"floating toast-box",progress:"ui attached active progress",toast:"ui toast",icon:"centered icon",visible:"visible",content:"content",title:"ui header",message:"message",actions:"actions",extraContent:"extra content",button:"ui button",buttons:"ui buttons",close:"close icon",image:"ui image",vertical:"vertical",horizontal:"horizontal",attached:"attached",inverted:"inverted",compact:"compact",pausable:"pausable",progressing:"progressing",top:"top",bottom:"bottom",left:"left",basic:"basic",unclickable:"unclickable"},text:{close:"Close"},icons:{info:"info",success:"checkmark",warning:"warning",error:"times"},selector:{container:".ui.toast-container",box:".toast-box",toast:".ui.toast",title:".header",message:".message:not(.ui)",image:"> img.image, > .image > img",icon:"> i.icon",input:'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',clickable:"a, details, .ui.accordion",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel"},fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onClick:function(){},onHide:function(){},onHidden:function(){},onRemove:function(){},onApprove:function(){},onDeny:function(){}},M.extend(M.easing,{easeOutBounce:function(e){var n=7.5625,t=2.75;return e<1/t?n*e*e:e<2/t?n*(e-=1.5/t)*e+.75:e<2.5/t?n*(e-=2.25/t)*e+.9375:n*(e-=2.625/t)*e+.984375},easeOutCubic:function(e){return--e*e*e+1}})}(jQuery,window,document);
|
11
|
+
!function(M,z,o){"use strict";function S(e){return"function"==typeof e&&"number"!=typeof e.nodeType}z=void 0!==z&&z.Math===Math?z:globalThis,M.fn.toast=function(k){let e=M(this),x=M("body"),T=Date.now(),I=[],P=k,O="string"==typeof P,A=[].slice.call(arguments,1),D=function(e,t){let n;return 0<=[z,o].indexOf(e)?n=M(e):0===(n=M(t.document).find(e)).length&&(n=t.frameElement?D(e,t.parent):x),n},E;return e.each(function(){let a=M.isPlainObject(k)?M.extend(!0,{},M.fn.toast.settings,k):M.extend({},M.fn.toast.settings),i=a.className,c=a.selector,l=a.error;var e=a.namespace;let r=a.fields,t="."+e,n=e+"-module",d=M(this),o,s,u,p,f,m,g,h=a.context?D(a.context,z):x,v=d.hasClass("toast")||d.hasClass("message")||d.hasClass("card"),b=this,C=v?d.data(n):void 0,y,w;w={initialize:function(){w.verbose("Initializing element"),w.create.id(),w.has.container()||w.create.container(),(v||""!==a.message||""!==a.title||""!==w.get.iconClass()||a.showImage||w.has.configActions())&&("string"==typeof a.showProgress&&-1!==[i.top,i.bottom].indexOf(a.showProgress)||(a.showProgress=!1),w.create.toast(),a.closeOnClick&&(a.closeIcon||0<M(s).find(c.input).length||w.has.configActions())&&(a.closeOnClick=!1),a.closeOnClick||o.addClass(i.unclickable),w.bind.events()),w.instantiate(),o&&w.show()},instantiate:function(){w.verbose("Storing instance of toast"),C=w,d.data(n,C)},destroy:function(){o&&(w.debug("Removing toast",o),w.unbind.events(),a.onRemove.call(o,b),o.remove(),o=void 0,s=void 0,m=void 0,p=void 0,f=void 0,g=void 0),d.removeData(n)},show:function(e){!1===a.onShow.call(o,b)?w.debug("onShow callback returned false, cancelling toast animation"):(e=e||function(){},w.debug("Showing toast"),w.animate.show(e))},close:function(e){!1===a.onHide.call(o,b)?w.debug("onHide callback returned false, cancelling toast animation"):(e=e||function(){},w.debug("Closing toast"),w.remove.visible(),w.unbind.events(),w.animate.close(e))},create:{container:function(){w.verbose("Creating container"),h.append(M("<div/>",{class:a.position+" "+i.container+" "+(a.horizontal?i.horizontal:"")+" "+(a.context&&"body"!==a.context?i.absolute:"")}))},id:function(){y=(Math.random().toString(16)+"000000000").slice(2,10),w.verbose("Creating unique id for element",y)},toast:function(){o=M("<div/>",{class:i.box});var t=w.get.iconClass();if(v)s=a.cloneModule?d.clone().removeAttr("id"):d,g=s.find("> i"+w.helpers.toClass(i.close)),a.closeIcon=0<g.length,""!==t&&s.find(c.icon).attr("class",t+" "+i.icon),a.showImage&&s.find(c.image).attr("src",a.showImage).attr("alt",a.alt||""),""!==a.title&&s.find(c.title).html(w.helpers.escape(a.title,a)),""!==a.message&&s.find(c.message).html(w.helpers.escape(a.message,a));else{w.verbose("Creating toast"),s=M("<div/>",{role:"alert"});let e=M("<div/>",{class:i.content});""!==t&&s.append(M("<i/>",{class:t+" "+i.icon})),a.showImage&&s.append(M("<img>",{class:i.image+" "+a.classImage,src:a.showImage,alt:a.alt||""})),""!==a.title&&(t="_"+w.get.id()+"title",s.attr("aria-labelledby",t),e.append(M("<div/>",{class:i.title,id:t,html:w.helpers.escape(a.title,a)})));var t="_"+w.get.id()+"desc";s.attr("aria-describedby",t),e.append(M("<div/>",{class:i.message,id:t,html:w.helpers.escape(a.message,a)})),s.addClass(a.class+" "+i.toast).append(e),s.css("opacity",String(a.opacity)),a.closeIcon&&((g=M("<i/>",{class:i.close+" "+("string"==typeof a.closeIcon?a.closeIcon:""),role:"button",tabindex:0,"aria-label":a.text.close})).hasClass(i.left)?s.prepend(g):s.append(g))}s.hasClass(i.compact)&&(a.compact=!0),s.hasClass("card")&&(a.compact=!1),u=s.find(".actions"),w.has.configActions()&&(0===u.length&&(u=M("<div/>",{class:i.actions+" "+(a.classActions||"")}).appendTo(s)),s.hasClass("card")&&!u.hasClass(i.attached)&&(u.addClass(i.extraContent),u.hasClass(i.vertical)&&(u.removeClass(i.vertical),w.error(l.verticalCard))),a.actions.forEach(function(e){var t=e[r.icon]?"<i "+(e[r.text]?'aria-hidden="true"':"")+' class="'+w.helpers.escape(e[r.icon])+' icon"></i>':"",n=w.helpers.escape(e[r.text]||"",a),o=w.helpers.escape(e[r.class]||"");let s=e[r.click]&&S(e[r.click])?e[r.click]:function(){};u.append(M("<button/>",{html:t+n,"aria-label":(e[r.text]||e[r.icon]||"").replace(/<[^>]+(>|$)/g,""),class:i.button+" "+o,on:{click:function(){let e=M(this);e.is(c.approve)||e.is(c.deny)||!1===s.call(b,d)||w.close()}}}))})),u&&u.hasClass(i.vertical)&&s.addClass(i.vertical),0<u.length&&!u.hasClass(i.attached)&&(!u||u.hasClass(i.basic)&&!u.hasClass(i.left)||s.addClass(i.actions)),"auto"===a.displayTime&&(a.displayTime=Math.max(a.minDisplayTime,s.text().split(" ").length/a.wordsPerMinute*6e4)),o.append(s),0<u.length&&u.hasClass(i.attached)&&(u.addClass(i.buttons),u.detach(),s.addClass(i.attached),u.hasClass(i.vertical)?(s.wrap(M("<div/>",{class:i.vertical+" "+i.attached+" "+(a.compact?i.compact:"")})),u.hasClass(i.left)?s.addClass(i.left).parent().addClass(i.left).prepend(u):s.parent().append(u)):u.hasClass(i.top)?(o.prepend(u),s.addClass(i.bottom)):(o.append(u),s.addClass(i.top))),d!==s&&(d=s,b=s[0]),0<a.displayTime&&(t=i.progressing+" "+(a.pauseOnHover?i.pausable:""),a.showProgress&&(p=M("<div/>",{class:i.progress+" "+(a.classProgress||a.class),"data-percent":""}),a.classProgress||(s.hasClass("toast")&&!s.hasClass(i.inverted)?p.addClass(i.inverted):p.removeClass(i.inverted)),f=M("<div/>",{class:"bar "+(a.progressUp?"up ":"down ")+t}),p.addClass(a.showProgress).append(f),p.hasClass(i.top)?o.prepend(p):o.append(p),f.css("animation-duration",a.displayTime/1e3+"s")),(m=M("<span/>",{class:"wait "+t})).css("animation-duration",a.displayTime/1e3+"s"),m.appendTo(s)),a.compact&&(o.addClass(i.compact),s.addClass(i.compact),p&&p.addClass(i.compact)),a.newestOnTop?o.prependTo(w.get.container()):o.appendTo(w.get.container())}},bind:{events:function(){w.debug("Binding events to toast"),a.closeIcon&&g.on("click"+t,w.event.close),s.on("click"+t,w.event.click),m&&m.on("animationend"+t,w.event.close),o.on("click"+t,c.approve,w.event.approve).on("click"+t,c.deny,w.event.deny)}},unbind:{events:function(){w.debug("Unbinding events to toast"),a.closeIcon&&g.off("click"+t),s.off("click"+t),m&&m.off("animationend"+t),o.off("click"+t)}},animate:{show:function(e){e=S(e)?e:function(){},a.transition&&w.can.useElement("transition")&&(w.set.visible(),o.transition({animation:a.transition.showMethod+" in",queue:!1,debug:a.debug,verbose:a.verbose,silent:a.silent,duration:a.transition.showDuration,onComplete:function(){e.call(o,b),a.onVisible.call(o,b)}}))},close:function(e){e=S(e)?e:function(){},a.transition&&void 0!==M.fn.transition?o.transition({animation:a.transition.hideMethod+" out",queue:!1,duration:a.transition.hideDuration,debug:a.debug,verbose:a.verbose,silent:a.silent,interval:50,onBeforeHide:function(e){e=S(e)?e:function(){},""!==a.transition.closeEasing?o&&(o.css("opacity","0"),o.wrap("<div/>").parent().hide(a.transition.closeDuration,a.transition.closeEasing,function(){o&&(o.parent().remove(),e.call(o))})):e.call(o)},onComplete:function(){e.call(o,b),a.onHidden.call(o,b),w.destroy()}}):w.error(l.noTransition)},pause:function(){m.css("animationPlayState","paused"),f&&f.css("animationPlayState","paused")},continue:function(){m.css("animationPlayState","running"),f&&f.css("animationPlayState","running")}},has:{container:function(){return w.verbose("Determining if there is already a container"),0<w.get.containers().length},toast:function(){return!!w.get.toast()},toasts:function(){return 0<w.get.toasts().length},configActions:function(){return Array.isArray(a.actions)&&0<a.actions.length}},get:{id:function(){return y},containers:function(){return h.children(w.helpers.toClass(a.position)+c.container+(a.horizontal?w.helpers.toClass(i.horizontal):":not("+w.helpers.toClass(i.horizontal)+")")+(a.context&&"body"!==a.context?w.helpers.toClass(i.absolute):":not("+w.helpers.toClass(i.absolute)+")"))},container:function(){return w.get.containers()[0]},toastBox:function(){return o||null},toast:function(){return s||null},toasts:function(){return M(w.get.container()).find(c.box)},iconClass:function(){return"string"==typeof a.showIcon?a.showIcon:a.showIcon&&a.icons[a.class]?a.icons[a.class]:""},remainingTime:function(){return m?m.css("opacity")*a.displayTime:0}},set:{visible:function(){s.addClass(i.visible)}},remove:{visible:function(){s.removeClass(i.visible)}},event:{close:function(){w.close()},click:function(e){0===M(e.target).closest(c.clickable).length&&(!1!==a.onClick.call(o,b)&&a.closeOnClick?w.close():w.verbose("Click callback returned false or close denied by setting cancelling close"))},approve:function(){!1===a.onApprove.call(b,d)?w.verbose("Approve callback returned false cancelling close"):w.close()},deny:function(){!1===a.onDeny.call(b,d)?w.verbose("Deny callback returned false cancelling close"):w.close()}},helpers:{toClass:function(e){let t=e.trim().split(/\s+/),n="";return t.forEach(function(e){n+="."+e}),n},escape:function(e,t){if(void 0!==t&&t.preserveHTML)return e;const n={'"':""","&":"&","'":"'","<":"<",">":">"};return String(e).replace(/["'<>]|&(?![\d#A-Za-z]{1,12};)/g,e=>n[e])}},can:{useElement:function(e){return void 0!==M.fn[e]||(w.error(l.noElement.replace("{element}",e)),!1)}},setting:function(e,t){if(w.debug("Changing setting",e,t),M.isPlainObject(e))M.extend(!0,a,e);else{if(void 0===t)return a[e];M.isPlainObject(a[e])?M.extend(!0,a[e],t):a[e]=t}},internal:function(e,t){if(M.isPlainObject(e))M.extend(!0,w,e);else{if(void 0===t)return w[e];w[e]=t}},debug:function(){!a.silent&&a.debug&&(a.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,a.name+":"),w.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),w.verbose.apply(console,arguments)))},error:function(){a.silent||(w.error=Function.prototype.bind.call(console.error,console,a.name+":"),w.error.apply(console,arguments))},performance:{log:function(e){var t,n;a.performance&&(n=(t=Date.now())-(T||t),T=t,I.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:b,"Execution Time":n})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(function(){w.performance.display()},500)},display:function(){var e=a.name+":";let n=0;T=!1,clearTimeout(w.performance.timer),M.each(I,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",0<I.length&&(console.groupCollapsed(e),console.table?console.table(I):M.each(I,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),I=[]}},invoke:function(o,e,t){let s=C,a,i,n;return e=e||A,t=t||b,"string"==typeof o&&void 0!==s&&(o=o.split(/[ .]/),a=o.length-1,M.each(o,function(e,t){var n=e!==a?t+o[e+1].charAt(0).toUpperCase()+o[e+1].slice(1):o;if(M.isPlainObject(s[n])&&e!==a)s=s[n];else{if(void 0!==s[n])return i=s[n],!1;{if(!M.isPlainObject(s[t])||e===a)return void 0!==s[t]?i=s[t]:w.error(l.method,o),!1;s=s[t]}}})),S(i)?n=i.apply(t,e):void 0!==i&&(n=i),Array.isArray(E)?E.push(n):void 0!==E?E=[E,n]:void 0!==n&&(E=n),i}},O?(void 0===C&&w.initialize(),w.invoke(P)):(void 0!==C&&C.invoke("destroy"),w.initialize(),E=d)}),void 0!==E?E:this},M.toast=M.fn.toast,M.fn.toast.settings={name:"Toast",namespace:"toast",silent:!1,debug:!1,verbose:!1,performance:!0,context:"body",position:"top right",horizontal:!1,class:"neutral",classProgress:!1,classActions:!1,classImage:"mini",title:"",message:"",displayTime:3e3,minDisplayTime:1e3,wordsPerMinute:120,showIcon:!1,newestOnTop:!1,showProgress:!1,pauseOnHover:!0,progressUp:!1,opacity:1,compact:!0,closeIcon:!1,closeOnClick:!0,cloneModule:!0,actions:!1,preserveHTML:!1,showImage:!1,alt:!1,transition:{showMethod:"scale",showDuration:500,hideMethod:"scale",hideDuration:500,closeEasing:"easeOutCubic",closeDuration:500},error:{method:"The method you called is not defined.",noElement:"This module requires ui {element}",verticalCard:"Vertical but not attached actions are not supported for card layout"},className:{container:"ui toast-container",absolute:"absolute",box:"floating toast-box",progress:"ui attached active progress",toast:"ui toast",icon:"centered icon",visible:"visible",content:"content",title:"ui header",message:"message",actions:"actions",extraContent:"extra content",button:"ui button",buttons:"ui buttons",close:"close icon",image:"ui image",vertical:"vertical",horizontal:"horizontal",attached:"attached",inverted:"inverted",compact:"compact",pausable:"pausable",progressing:"progressing",top:"top",bottom:"bottom",left:"left",basic:"basic",unclickable:"unclickable"},text:{close:"Close"},icons:{info:"info",success:"checkmark",warning:"warning",error:"times"},selector:{container:".ui.toast-container",box:".toast-box",toast:".ui.toast",title:".header",message:".message:not(.ui)",image:"> img.image, > .image > img",icon:"> i.icon",input:'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',clickable:"a, details, .ui.accordion",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel"},fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onClick:function(){},onHide:function(){},onHidden:function(){},onRemove:function(){},onApprove:function(){},onDeny:function(){}},M.extend(M.easing,{easeOutBounce:function(e){var t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeOutCubic:function(e){return--e*e*e+1}})}(jQuery,window,document);
|