rails-active-ui 0.2.2 → 0.3.1
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.
- checksums.yaml +4 -4
- data/app/assets/datatables.css +15 -0
- data/app/assets/stylesheets.css +5 -1
- data/app/blocks/resource_list_block.rb +153 -0
- data/app/components/back_button_component.rb +34 -0
- data/app/components/button_component.rb +4 -2
- data/app/components/button_to_component.rb +3 -4
- data/app/components/column_component.rb +1 -1
- data/app/components/container_component.rb +1 -1
- data/app/components/dropdown_component.rb +8 -2
- data/app/components/grid_component.rb +5 -1
- data/app/components/link_to_component.rb +23 -0
- data/app/components/menu_item_component.rb +5 -1
- data/app/components/message_component.rb +3 -1
- data/app/components/modal_component.rb +23 -3
- data/app/components/paragraph_component.rb +13 -0
- data/app/components/row_component.rb +1 -1
- data/app/components/table_row_component.rb +3 -5
- data/app/components/template_component.rb +13 -0
- data/app/helpers/component_helper.rb +122 -76
- data/app/helpers/fui_helper.rb +37 -0
- data/app/javascript/datatables.js +10 -0
- data/app/javascript/ui/controllers/fui_datatable_controller.js +35 -0
- data/app/javascript/ui/controllers/fui_dropdown_controller.js +8 -1
- data/app/javascript/ui/controllers/fui_item_list_controller.js +40 -0
- data/app/javascript/ui/controllers/navigation_controller.js +23 -0
- data/app/javascript/ui/index.js +11 -0
- data/app/lib/component.rb +1 -1
- data/config/importmap.rb +3 -0
- data/config/initializers/ruby_template_handler.rb +4 -1
- data/formantic-ui/components/accordion.css +369 -0
- data/formantic-ui/components/accordion.js +595 -0
- data/formantic-ui/components/accordion.min.css +9 -0
- data/formantic-ui/components/accordion.min.js +11 -0
- data/formantic-ui/components/ad.css +264 -0
- data/formantic-ui/components/ad.min.css +10 -0
- data/formantic-ui/components/api.js +1225 -0
- data/formantic-ui/components/api.min.js +11 -0
- data/formantic-ui/components/breadcrumb.css +135 -0
- data/formantic-ui/components/breadcrumb.min.css +9 -0
- data/formantic-ui/components/button.css +4058 -0
- data/formantic-ui/components/button.min.css +9 -0
- data/formantic-ui/components/calendar.css +327 -0
- data/formantic-ui/components/calendar.js +2045 -0
- data/formantic-ui/components/calendar.min.css +9 -0
- data/formantic-ui/components/calendar.min.js +11 -0
- data/formantic-ui/components/card.css +1881 -0
- data/formantic-ui/components/card.min.css +9 -0
- data/formantic-ui/components/checkbox.css +785 -0
- data/formantic-ui/components/checkbox.js +888 -0
- data/formantic-ui/components/checkbox.min.css +9 -0
- data/formantic-ui/components/checkbox.min.js +11 -0
- data/formantic-ui/components/comment.css +283 -0
- data/formantic-ui/components/comment.min.css +9 -0
- data/formantic-ui/components/container.css +300 -0
- data/formantic-ui/components/container.min.css +9 -0
- data/formantic-ui/components/dimmer.css +367 -0
- data/formantic-ui/components/dimmer.js +732 -0
- data/formantic-ui/components/dimmer.min.css +9 -0
- data/formantic-ui/components/dimmer.min.js +11 -0
- data/formantic-ui/components/divider.css +287 -0
- data/formantic-ui/components/divider.min.css +9 -0
- data/formantic-ui/components/dropdown.css +2087 -0
- data/formantic-ui/components/dropdown.js +4432 -0
- data/formantic-ui/components/dropdown.min.css +9 -0
- data/formantic-ui/components/dropdown.min.js +11 -0
- data/formantic-ui/components/embed.css +155 -0
- data/formantic-ui/components/embed.js +688 -0
- data/formantic-ui/components/embed.min.css +9 -0
- data/formantic-ui/components/embed.min.js +11 -0
- data/formantic-ui/components/emoji.css +15311 -0
- data/formantic-ui/components/emoji.min.css +9 -0
- data/formantic-ui/components/feed.css +799 -0
- data/formantic-ui/components/feed.min.css +9 -0
- data/formantic-ui/components/flag.css +1149 -0
- data/formantic-ui/components/flag.min.css +9 -0
- data/formantic-ui/components/flyout.css +546 -0
- data/formantic-ui/components/flyout.js +1551 -0
- data/formantic-ui/components/flyout.min.css +9 -0
- data/formantic-ui/components/flyout.min.js +11 -0
- data/formantic-ui/components/form.css +1885 -0
- data/formantic-ui/components/form.js +2199 -0
- data/formantic-ui/components/form.min.css +9 -0
- data/formantic-ui/components/form.min.js +11 -0
- data/formantic-ui/components/grid.css +1952 -0
- data/formantic-ui/components/grid.min.css +9 -0
- data/formantic-ui/components/header.css +778 -0
- data/formantic-ui/components/header.min.css +9 -0
- data/formantic-ui/components/icon.css +7066 -0
- data/formantic-ui/components/icon.min.css +9 -0
- data/formantic-ui/components/image.css +315 -0
- data/formantic-ui/components/image.min.css +9 -0
- data/formantic-ui/components/input.css +1566 -0
- data/formantic-ui/components/input.min.css +9 -0
- data/formantic-ui/components/item.css +534 -0
- data/formantic-ui/components/item.min.css +9 -0
- data/formantic-ui/components/label.css +2114 -0
- data/formantic-ui/components/label.min.css +9 -0
- data/formantic-ui/components/list.css +955 -0
- data/formantic-ui/components/list.min.css +9 -0
- data/formantic-ui/components/loader.css +787 -0
- data/formantic-ui/components/loader.min.css +9 -0
- data/formantic-ui/components/menu.css +2131 -0
- data/formantic-ui/components/menu.min.css +9 -0
- data/formantic-ui/components/message.css +619 -0
- data/formantic-ui/components/message.min.css +9 -0
- data/formantic-ui/components/modal.css +779 -0
- data/formantic-ui/components/modal.js +1637 -0
- data/formantic-ui/components/modal.min.css +9 -0
- data/formantic-ui/components/modal.min.js +11 -0
- data/formantic-ui/components/nag.css +290 -0
- data/formantic-ui/components/nag.js +566 -0
- data/formantic-ui/components/nag.min.css +9 -0
- data/formantic-ui/components/nag.min.js +11 -0
- data/formantic-ui/components/placeholder.css +228 -0
- data/formantic-ui/components/placeholder.min.css +9 -0
- data/formantic-ui/components/popup.css +1184 -0
- data/formantic-ui/components/popup.js +1561 -0
- data/formantic-ui/components/popup.min.css +9 -0
- data/formantic-ui/components/popup.min.js +11 -0
- data/formantic-ui/components/progress.css +761 -0
- data/formantic-ui/components/progress.js +979 -0
- data/formantic-ui/components/progress.min.css +9 -0
- data/formantic-ui/components/progress.min.js +11 -0
- data/formantic-ui/components/rail.css +147 -0
- data/formantic-ui/components/rail.min.css +9 -0
- data/formantic-ui/components/rating.css +414 -0
- data/formantic-ui/components/rating.js +540 -0
- data/formantic-ui/components/rating.min.css +9 -0
- data/formantic-ui/components/rating.min.js +11 -0
- data/formantic-ui/components/reset.css +386 -0
- data/formantic-ui/components/reset.min.css +9 -0
- data/formantic-ui/components/reveal.css +277 -0
- data/formantic-ui/components/reveal.min.css +9 -0
- data/formantic-ui/components/search.css +541 -0
- data/formantic-ui/components/search.js +1641 -0
- data/formantic-ui/components/search.min.css +9 -0
- data/formantic-ui/components/search.min.js +11 -0
- data/formantic-ui/components/segment.css +1053 -0
- data/formantic-ui/components/segment.min.css +9 -0
- data/formantic-ui/components/shape.css +144 -0
- data/formantic-ui/components/shape.js +797 -0
- data/formantic-ui/components/shape.min.css +9 -0
- data/formantic-ui/components/shape.min.js +11 -0
- data/formantic-ui/components/sidebar.css +539 -0
- data/formantic-ui/components/sidebar.js +1054 -0
- data/formantic-ui/components/sidebar.min.css +9 -0
- data/formantic-ui/components/sidebar.min.js +11 -0
- data/formantic-ui/components/site.css +286 -0
- data/formantic-ui/components/site.js +455 -0
- data/formantic-ui/components/site.min.css +9 -0
- data/formantic-ui/components/site.min.js +11 -0
- data/formantic-ui/components/slider.css +926 -0
- data/formantic-ui/components/slider.js +1546 -0
- data/formantic-ui/components/slider.min.css +9 -0
- data/formantic-ui/components/slider.min.js +11 -0
- data/formantic-ui/components/state.js +697 -0
- data/formantic-ui/components/state.min.js +11 -0
- data/formantic-ui/components/statistic.css +586 -0
- data/formantic-ui/components/statistic.min.css +9 -0
- data/formantic-ui/components/step.css +1538 -0
- data/formantic-ui/components/step.min.css +9 -0
- data/formantic-ui/components/sticky.css +73 -0
- data/formantic-ui/components/sticky.js +917 -0
- data/formantic-ui/components/sticky.min.css +9 -0
- data/formantic-ui/components/sticky.min.js +11 -0
- data/formantic-ui/components/tab.css +84 -0
- data/formantic-ui/components/tab.js +967 -0
- data/formantic-ui/components/tab.min.css +9 -0
- data/formantic-ui/components/tab.min.js +11 -0
- data/formantic-ui/components/table.css +3473 -0
- data/formantic-ui/components/table.min.css +9 -0
- data/formantic-ui/components/text.css +155 -0
- data/formantic-ui/components/text.min.css +9 -0
- data/formantic-ui/components/toast.css +751 -0
- data/formantic-ui/components/toast.js +964 -0
- data/formantic-ui/components/toast.min.css +9 -0
- data/formantic-ui/components/toast.min.js +11 -0
- data/formantic-ui/components/transition.css +1148 -0
- data/formantic-ui/components/transition.js +1034 -0
- data/formantic-ui/components/transition.min.css +9 -0
- data/formantic-ui/components/transition.min.js +11 -0
- data/formantic-ui/components/visibility.js +1292 -0
- data/formantic-ui/components/visibility.min.js +11 -0
- data/formantic-ui/semantic.css +78485 -0
- data/formantic-ui/semantic.js +31036 -0
- data/formantic-ui/semantic.min.css +11 -0
- data/formantic-ui/semantic.min.js +11 -0
- data/formantic-ui/themes/basic/assets/fonts/LICENSE.txt +91 -0
- data/formantic-ui/themes/basic/assets/fonts/icons.woff +0 -0
- data/formantic-ui/themes/basic/assets/fonts/icons.woff2 +0 -0
- data/formantic-ui/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
- data/formantic-ui/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
- data/formantic-ui/themes/default/assets/fonts/Lato-Bold.woff +0 -0
- data/formantic-ui/themes/default/assets/fonts/Lato-Bold.woff2 +0 -0
- data/formantic-ui/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
- data/formantic-ui/themes/default/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- data/formantic-ui/themes/default/assets/fonts/Lato-Italic.woff +0 -0
- data/formantic-ui/themes/default/assets/fonts/Lato-Italic.woff2 +0 -0
- data/formantic-ui/themes/default/assets/fonts/Lato-Regular.woff +0 -0
- data/formantic-ui/themes/default/assets/fonts/Lato-Regular.woff2 +0 -0
- data/formantic-ui/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
- data/formantic-ui/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
- data/formantic-ui/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
- data/formantic-ui/themes/default/assets/fonts/LatoLatin-BoldItalic.woff2 +0 -0
- data/formantic-ui/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
- data/formantic-ui/themes/default/assets/fonts/LatoLatin-Italic.woff2 +0 -0
- data/formantic-ui/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
- data/formantic-ui/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
- data/formantic-ui/themes/default/assets/fonts/brand-icons.woff +0 -0
- data/formantic-ui/themes/default/assets/fonts/brand-icons.woff2 +0 -0
- data/formantic-ui/themes/default/assets/fonts/icons.woff +0 -0
- data/formantic-ui/themes/default/assets/fonts/icons.woff2 +0 -0
- data/formantic-ui/themes/default/assets/fonts/outline-icons.woff +0 -0
- data/formantic-ui/themes/default/assets/fonts/outline-icons.woff2 +0 -0
- data/formantic-ui/themes/famfamfam/assets/images/flags.png +0 -0
- data/formantic-ui/themes/github/assets/fonts/LICENSE.txt +94 -0
- data/formantic-ui/themes/github/assets/fonts/octicons.woff +0 -0
- data/formantic-ui/themes/github/assets/fonts/octicons.woff2 +0 -0
- data/formantic-ui/themes/material/assets/fonts/LICENSE.txt +202 -0
- data/formantic-ui/themes/material/assets/fonts/icons.woff +0 -0
- data/formantic-ui/themes/material/assets/fonts/icons.woff2 +0 -0
- data/lib/ui/engine.rb +7 -2
- data/lib/ui/version.rb +1 -1
- metadata +205 -7
- data/app/components/link_component.rb +0 -23
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* # Fomantic-UI 2.9.4 - Tab
|
|
3
|
+
* https://github.com/fomantic/Fomantic-UI/
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* Released under the MIT license
|
|
7
|
+
* https://opensource.org/licenses/MIT
|
|
8
|
+
*
|
|
9
|
+
*/.ui.tab{display:none}.ui.tab.active,.ui.tab.open{display:block}.ui.tab.loading{position:relative;overflow:hidden;display:block;min-height:250px}.ui.tab.loading *{position:relative!important;left:-10000px!important}.ui.tab.loading.segment::before,.ui.tab.loading::before{position:absolute;content:"";top:50%;left:50%;margin:-1.25em 0 0 -1.25em;width:2.5em;height:2.5em;border-radius:500rem;border:.2em solid rgba(0,0,0,.1)}.ui.tab.loading.segment::after,.ui.tab.loading::after{position:absolute;content:"";top:50%;left:50%;margin:-1.25em 0 0 -1.25em;width:2.5em;height:2.5em;animation:loader .6s infinite linear;border:.2em solid #767676;border-radius:500rem;box-shadow:0 0 0 1px transparent}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* # Fomantic UI - 2.9.4
|
|
3
|
+
* https://github.com/fomantic/Fomantic-UI
|
|
4
|
+
* https://fomantic-ui.com/
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2025 Contributors
|
|
7
|
+
* Released under the MIT license
|
|
8
|
+
* https://opensource.org/licenses/MIT
|
|
9
|
+
*
|
|
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,headers:{"X-Remote":!0},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);
|