-
Notifications
You must be signed in to change notification settings - Fork 28
/
angular-semantic-ui.min.js
11 lines (11 loc) · 38.1 KB
/
angular-semantic-ui.min.js
1
2
3
4
5
6
7
8
9
10
11
/**
* semantic-ui-angular-jquery - 0.2.4
* Angular Directives for Semantic UI
*
* https://github.com/ClickerMonkey/SemanticUI-Angular
* Released under the MIT license.
* Copyright 2017 Philip Diffenderfer and contributors.
*/
angular.module("semantic-ui",["semantic-ui-core","semantic-ui-accordion","semantic-ui-checkbox","semantic-ui-radio","semantic-ui-comment","semantic-ui-dimmer","semantic-ui-dropdown","semantic-ui-embed","semantic-ui-list","semantic-ui-menu","semantic-ui-modal","semantic-ui-popup","semantic-ui-progress","semantic-ui-rating","semantic-ui-search","semantic-ui-shape","semantic-ui-sidebar","semantic-ui-sticky","semantic-ui-tab","semantic-ui-transition","semantic-ui-timeago"]),function(e){function n(e){var n={setDefaultFunction:function(e,n,i,t){i[n]||(e[n]=t)},triggerChange:function(e,n,i,t){e.$watch(n,function(n){t&&e.$evalAsync(function(){i.trigger("change")}),t=!0})},bindAttribute:function(e,n,i,t){e.$watch(n,function(e){i.attr(t,e)})},onEvent:function(e,n,i){e[n]=function(e,n){return function(){var t=n;angular.isFunction(e)&&(t=e.apply(this,arguments));var o=i.apply(this,arguments);return t!==n?t:o}}(e[n])},linkEvents:function(e,i,t,o){for(var a in o)!function(o,a){n.onEvent(i,a,function(){var n=e[o];return angular.isFunction(n)?n.apply(this,arguments):angular.isFunction(t[a])?t[a].apply(this,arguments):void 0})}(o[a],a)},linkSettings:function(e,n,i,t,o,a){var c=a||"settings";c in i&&e.$watch(c,function(e){o&&angular.forEach(e,function(e,i){n[t]("setting",i,e)}),o=!0},!0)},createBind:function(e,i){return{restrict:"A",link:function(t,o,a){n.linkSettings(t,o,a,i,!1,e),n.initBind(t,o,a,e,i)}}},initBind:function(e,n,i,t,o){n.ready(function(){var a={},c=i[t];c&&(a=e.$eval(c)),n[o](a)})},createBehavior:function(e,i,t){return{restrict:"A",link:function(o,a,c){n.initBehavior(o,c,e,a,i,t)}}},initBehavior:function(e,n,i,t,o,a){var c={$:void 0,evt:"click",enabled:!0,value:void 0},s=function(){c.enabled&&$(c.$)[o](a,c.value)},r=!1;e.$watch(n[i],function(e){angular.isString(e)?c.$=e:angular.isObject(e)&&(angular.isString(e.evt)||(e.evt=c.evt),angular.isDefined(e.enabled)||(e.enabled=c.enabled),c=e),r&&t.off(r,s),t.on(r=c.evt,s)},!0)},watcher:function(e,n,i,t,o,a){var c=angular.copy(e[n]);return e.$watch(n,function(e){"model"==n&&angular.equals(c,e)||i.call(t,e)},a),{set:function(i){(e[n]!=i||o)&&e.$evalAsync(function(){e[n]=i,c=angular.copy(e[n])})},update:function(){e.$evalAsync(function(){})}}},RecursiveCompiler:function(n){return function(i,t){angular.isFunction(t)&&(t={post:t});var o,a=i.contents().remove();return{pre:t&&t.pre?t.pre:null,post:function(i,c){o||(o=e(a)),o(i,function(e){c.append(e)}),t&&t.post&&t.post.apply(null,arguments),angular.isFunction(n)&&n.apply(null,arguments)}}}}};return n}function i(){return{restrict:"E",replace:!0,transclude:!0,template:'<button class="ui button" ng-transclude></button>'}}function t(){return{restrict:"E",replace:!0,transclude:!0,scope:{icon:"@"},template:'<a class="item"><i class="{{ icon }} icon" ng-if="icon"></i><span ng-transclude></span></a>'}}function o(){return{restrict:"E",replace:!0,template:['<div class="menu">',' <div class="item" ng-repeat="item in items" data-value="{{ getValue(item) }}" sm-html="label({item:item})"></div>',"</div>"].join("\n")}}function a(e){var n=function(e){return e};try{$sce=e.get("$sce"),n=function(e){return $sce.getTrustedHtml($sce.trustAsHtml(e))}}catch(i){}return function(e,i,t){e.$watch(t.smHtml,function(e){i.html(n(e||""))})}}e.factory("SemanticUI",["$compile",n]).directive("smButton",i).directive("smMenuItem",t).directive("smFlatMenu",o).directive("smHtml",["$injector",a])}(angular.module("semantic-ui-core",[])),function(e){function n(e){return e.createBind("smCheckboxBind","checkbox")}function i(e){return{restrict:"E",replace:!0,transclude:!0,scope:{model:"=",label:"@",settings:"=",enabled:"=",indeterminateValue:"=",checkedValue:"=",uncheckedValue:"=",children:"@",onInit:"=",onChange:"=",onChecked:"=",onIndeterminate:"=",onDeterminate:"=",onUnchecked:"=",onEnable:"=",onDisable:"="},template:['<div class="ui checkbox">',' <input type="checkbox">'," <label>{{ label }}</label>","</div>"].join("\n"),link:e}}function t(e){return function(n,i,t){i.ready(function(){var o=n.settings||{};e.linkSettings(n,i,t,"checkbox",!0),e.triggerChange(n,"model",i,!0);var a=function(){return!angular.isDefined(n.checkedValue)||n.checkedValue},c=function(){return!!angular.isDefined(n.uncheckedValue)&&n.uncheckedValue},s=function(){return angular.isDefined(n.indeterminateValue)?n.indeterminateValue:void 0};if(t.enabled){var r=e.watcher(n,"enabled",function(e){angular.isDefined(e)&&i.checkbox(e?"set enabled":"set disabled")});e.onEvent(o,"onEnable",function(e){r.set(!0)}),e.onEvent(o,"onDisable",function(e){r.set(!1)})}var l=e.watcher(n,"model",function(e){angular.isDefined(e)&&i.checkbox(e?"set checked":"set unchecked")});if(e.onEvent(o,"onChecked",function(){l.set(a())}),e.onEvent(o,"onUnchecked",function(){l.set(c())}),e.onEvent(o,"onIndeterminate",function(){l.set(s())}),e.linkEvents(n,o,$.fn.checkbox.settings,{onChange:"onChange",onChecked:"onChecked",onIndeterminate:"onIndeterminate",onDeterminate:"onDeterminate",onUnchecked:"onUnchecked",onEnable:"onEnable",onDisable:"onDisable"}),n.children){var u=$(n.children),d=!1;e.onEvent(o,"onChecked",function(){d=!0,u.checkbox("check"),d=!1}),e.onEvent(o,"onUnchecked",function(){d=!0,u.checkbox("uncheck"),d=!1}),u.children("input[type=checkbox], input[type=radio]").change(function(){if(!d){var e=0;u.each(function(n,i){$(i).checkbox("is checked")&&e++}),0===e?i.checkbox("uncheck"):e===u.length?i.checkbox("check"):i.checkbox("indeterminate")}})}i.checkbox(o),n.model==a()?i.checkbox("set checked"):n.model===s()&&i.checkbox("set indeterminate"),angular.isDefined(n.enabled)&&!n.enabled&&i.checkbox("set disabled"),angular.isFunction(n.onInit)&&n.onInit(i)})}}e.factory("SemanticCheckboxLink",["SemanticUI",t]).directive("smCheckboxBind",["SemanticUI",n]).directive("smCheckbox",["SemanticCheckboxLink",i]);var o={smCheckboxToggle:"toggle",smCheckboxCheck:"check",smCheckboxUncheck:"uncheck",smCheckboxIndeterminate:"indeterminate",smCheckboxDeterminate:"determinate",smCheckboxEnable:"enable",smCheckboxDisable:"disable"};angular.forEach(o,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"checkbox",n)}])})}(angular.module("semantic-ui-checkbox",["semantic-ui-core"])),function(e){function n(e){return e.createBind("smRadioBind","checkbox")}function i(e){return{restrict:"E",replace:!0,transclude:!0,scope:{model:"=",label:"@",name:"@",value:"=",settings:"=",enabled:"=",onInit:"=",onChange:"=",onChecked:"=",onUnchecked:"=",onEnable:"=",onDisable:"="},template:['<div class="ui radio checkbox">',' <input name="{{ name }}" type="radio">'," <label>{{ label }}</label>","</div>"].join("\n"),link:e}}function t(e){return function(n,i,t){i.ready(function(){var o=n.settings||{};if(e.linkSettings(n,i,t,"checkbox",!0),e.triggerChange(n,"model",i,!0),t.enabled){var a=e.watcher(n,"enabled",function(e){angular.isDefined(e)&&i.checkbox(e?"set enabled":"set disabled")});e.onEvent(o,"onEnable",function(e){a.set(!0)}),e.onEvent(o,"onDisable",function(e){a.set(!1)})}var c=e.watcher(n,"model",function(e){e===n.value&&i.checkbox("set checked")});e.onEvent(o,"onChecked",function(){c.set(n.value)}),e.linkEvents(n,o,$.fn.checkbox.settings,{onChange:"onChange",onChecked:"onChecked",onUnchecked:"onUnchecked",onEnable:"onEnable",onDisable:"onDisable"}),i.checkbox(o),n.model===n.value&&i.checkbox("set checked"),i.hasClass("slider")&&i.removeClass("radio"),angular.isDefined(n.enabled)&&!n.enabled&&i.checkbox("set disabled"),angular.isFunction(n.onInit)&&n.onInit(i)})}}e.factory("SemanticRadioLink",["SemanticUI",t]).directive("smRadioBind",["SemanticUI",n]).directive("smRadio",["SemanticRadioLink",i]);var o={smRadioCheck:"check",smRadioEnable:"enable",smRadioDisable:"disable"};angular.forEach(o,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"checkbox",n)}])})}(angular.module("semantic-ui-radio",["semantic-ui-core"])),function(e){function n(e){return e.createBind("smAccordionBind","accordion")}function i(e){return{restrict:"E",replace:!0,transclude:!0,scope:{settings:"=",onInit:"=",onOpening:"=",onOpen:"=",onClosing:"=",onClose:"=",onChange:"="},template:'<div class="ui accordion" ng-transclude></div>',link:e}}function t(e){return function(n,i,t){i.ready(function(){var o=n.settings||{};e.linkSettings(n,i,t,"accordion",!0),e.linkEvents(n,o,$.fn.accordion.settings,{onOpening:"onOpening",onOpen:"onOpen",onClosing:"onClosing",onClose:"onClose",onChange:"onChange"}),i.accordion(o),angular.isFunction(n.onInit)&&n.onInit(i)})}}function o(){return{restrict:"E",required:"title",transclude:!0,scope:{title:"=",active:"="},template:['<div class="title" ng-class="{active: active}">',' <i class="dropdown icon"></i>'," {{ title }}","</div>",'<div class="content" ng-class="{active: active}" ng-transclude>',"</div>"].join("\n")}}e.factory("SemanticAccordionLink",["SemanticUI",t]).directive("smAccordionBind",["SemanticUI",n]).directive("smAccordion",["SemanticAccordionLink",i]).directive("smAccordionGroup",o);var a={smAccordionOpen:"open",smAccordionCloseOthers:"close others",smAccordionClose:"close",smAccordionToggle:"toggle"};angular.forEach(a,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"accordion",n)}])})}(angular.module("semantic-ui-accordion",["semantic-ui-core"])),function(e){function n(e){return{restrict:"E",replace:!0,scope:{comments:"=",content:"&",avatar:"&",author:"&",date:"&",replies:"&",reply:"=",collapsible:"=",onAuthor:"&",onReply:"&",onShowReplies:"&",onHideReplies:"&"},template:['<div class="ui comments">',' <div class="comment" ng-repeat="c in comments" ng-init="$ = {comment: c}; c.$isCollapsed = true;">',' <a ng-if="avatar($)" class="avatar" ng-click="onAuthor({comment: c, $event: $event})">',' <img ng-src="{{ avatar($) }}">'," </a>",' <div class="content">',' <a class="author" ng-click="onAuthor({comment: c, $event: $event})" sm-html="author($)"></a>',' <div class="metadata">',' <span class="date" sm-time-ago="date($)"></span>'," </div>",' <div class="text" sm-html="content($)"></div>',' <div class="actions">',' <a class="reply" ng-click="onReply({comment: c, $event: $event})" ng-if="reply">Reply</a>',' <a class="show-replies" ng-if="reply && collapsible && c.$isCollapsed" href ng-click="setCollapsed(c, $event, false)" sm-html="getShowRepliesText($)"></a>',' <a class="hide-replies" ng-if="reply && collapsible && !c.$isCollapsed" href ng-click="setCollapsed(c, $event, true)" sm-html="getHideRepliesText($)"></a>'," </div>"," </div>",' <sm-comments ng-if="hasReplies($)" ng-class="{collapsed: collapsible && c.$isCollapsed}" comments="replies($)" content="content({comment: comment})" avatar="avatar({comment: comment})" author="author({comment: comment})" date="date({comment: comment})" replies="replies({comment: comment})" reply="reply" collapsible="collapsible"',' on-author="onAuthor({comment: comment, $event: $event})" on-reply="onReply({comment: comment, $event: $event})" on-show-replies="onShowReplies({comment: comment, $event: $event})" on-hide-replies="onHideReplies({comment: comment, $event: $event})"></sm-comments>'," </div>","</div>"].join("\n"),controller:"SemanticCommentsController",compile:e.RecursiveCompiler()}}function i(e){e.setCollapsed=function(n,i,t){var o={comment:n,$event:i};n.$isCollapsed!=t&&(n.$isCollapsed?e.onShowReplies(o)!==!1&&(n.$isCollapsed=!1):e.onHideReplies(o)!==!1&&(n.$isCollapsed=!0))},e.hasReplies=function(n){if(!e.reply)return!1;var i=e.replies(n);return i&&i.length},e.getReplyCount=function(n){if(!e.reply)return!1;var i=e.replies(n);return i?i.length:0},e.getShowRepliesText=function(n){var i=e.getReplyCount(n);return 0===i?"":1===i?"Show Reply":"Show Replies ("+i+")"},e.getHideRepliesText=function(n){var i=e.getReplyCount(n);return 0===i?"":1===i?"Hide Reply":"Hide Replies ("+i+")"}}e.controller("SemanticCommentsController",["$scope",i]).directive("smComments",["SemanticUI",n])}(angular.module("semantic-ui-comment",["semantic-ui-core","semantic-ui-timeago"])),function(e){function n(e){return e.createBind("smDropdownBind","dropdown")}function i(e){return{restrict:"E",replace:!0,transclude:!0,scope:{model:"=",items:"=",label:"&",value:"&",settings:"=",defaultText:"=",onInit:"=",emptyValue:"=",onChange:"=",onAdd:"=",onRemove:"=",onLabelCreate:"=",onLabelSelect:"=",onNoResults:"=",onShow:"=",onHide:"="},template:['<div class="ui dropdown">','<i class="dropdown icon"></i>','<div class="text" ng-class="::{default: hasDefault()}" sm-html="::getDefaultText()"></div>',"<sm-flat-menu></sm-flat-menu>","</div>"].join("\n"),controller:"SemanticDropdownController",link:e}}function t(e){var n={};e.getValue=function(n){return e.getKey(e.value({item:n}))},e.getKey=function(e){return(e?e.$$hashKey||e:e)+""},e.isEmpty=function(){return!e.model||0===e.model.length},e.translateValue=function(n){var i=e.getKey(n),t=e.findMatchingItem(i);if(angular.isDefined(t))return e.getValue(t)},e.hasDefault=function(){return e.defaultText&&e.isEmpty()},e.getDefaultText=function(){var n=e.defaultText?e.defaultText:"";return e.isEmpty()?n:e.translateValue(e.findMatchingItem(e.model))},e.findMatchingItem=function(e){return n[e]},e.updateHashMap=function(i){n={},angular.forEach(i,function(i){n[e.getValue(i)]=i})}}function o(e,n){return function(i,t,o){var a=function(e){n(function(){if(null===e)t.dropdown("clear");else if(e===!1);else if(t.dropdown("is multiple")){if(e instanceof Array){for(var n=[],o=0;o<e.length;o++){var a=i.translateValue(e[o]);angular.isDefined(a)&&n.push(a)}t.dropdown("set exactly",n)}}else t.dropdown("set selected",i.translateValue(e))},0)};e.setDefaultFunction(i,"label",o,function(e){return e.item}),e.setDefaultFunction(i,"value",o,function(e){return e.item}),t.ready(function(){var n=i.settings||{},c=!0;e.linkSettings(i,t,o,"dropdown",!0),e.triggerChange(i,"model",t,!0);var s=function(){return i.model instanceof Array||(i.model=i.model?[i.model]:[]),i.model},r=e.watcher(i,"model",function(e){a(e)},null,!0,!0);e.onEvent(n,"onChange",function(e){if(!c&&!t.dropdown("is multiple")){var n=i.findMatchingItem(e);if(angular.isDefined(n)){var o=i.value({item:n});r.set(o)}else t.dropdown("setting","allowAdditions")?r.set(e):r.set(i.emptyValue)}}),e.onEvent(n,"onAdd",function(e){if(!c){var n=i.findMatchingItem(e);if(angular.isDefined(n)){var o=i.value({item:n}),a=$.inArray(o,s());a===-1&&(i.model.push(o),r.update())}else t.dropdown("setting","allowAdditions")&&(i.model.push(e),r.update())}}),e.onEvent(n,"onRemove",function(e){if(!c){var n=i.findMatchingItem(e);if(angular.isDefined(n)){var t=i.value({item:n}),o=$.inArray(t,s());o!==-1&&(i.model.splice(o,1),r.update())}else{var o=$.inArray(e,s());o!==-1&&(i.model.splice(o,1),r.update())}}}),e.linkEvents(i,n,$.fn.dropdown.settings,{onChange:"onChange",onAdd:"onAdd",onRemove:"onRemove",onLabelCreate:"onLabelCreate",onLabelSelect:"onLabelSelect",onNoResults:"onNoResults",onShow:"onShow",onHide:"onHide"}),i.$watch("items",function(e){i.updateHashMap(i.items),a(i.model)},!0),t.dropdown(n),i.updateHashMap(i.items),a(i.model),t.dropdown("save defaults"),c=!1,angular.isFunction(i.onInit)&&i.onInit(t)})}}e.controller("SemanticDropdownController",["$scope",t]).factory("SemanticDropdownLink",["SemanticUI","$timeout",o]).directive("smDropdownBind",["SemanticUI",n]).directive("smDropdown",["SemanticDropdownLink",i]);var a={smDropdownToggle:"toggle",smDropdownShow:"show",smDropdownHide:"hide",smDropdownClear:"clear",smDropdownHideOthers:"hide others",smDropdownRestoreDefaults:"restore defaults",smDropdownRestoreDefaultText:"restore default text",smDropdownRestoreDefaultValue:"restore default value",smDropdownSaveDefaults:"save defaults",smDropdownSetSelected:"set selected",smDropdownSetText:"set text",smDropdownSetValue:"set value",smDropdownBindTouchEvents:"bind touch events",smDropdownMouseEvents:"mouse events",smDropdownBindIntent:"bind intent",smDropdownUnbindIntent:"unbind intent",smDropdownSetActive:"set active",smDropdownSetVisible:"set visible",smDropdownRemoveActive:"remove active",smDropdownRemoveVisible:"remove visible"};angular.forEach(a,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"dropdown",n)}])})}(angular.module("semantic-ui-dropdown",["semantic-ui-core"])),function(e){function n(e){return e.createBind("smEmbedBind","embed")}function i(e){return{restrict:"E",replace:!0,transclude:!0,scope:{source:"@",sourceId:"@",url:"@",placeholder:"@",icon:"@",settings:"=",onInit:"=",onCreate:"=",onDisplay:"=",onPlaceholderDisplay:"=",onEmbed:"="},template:'<div class="ui embed"></div>',link:e}}function t(e){return function(n,i,t){var o=n.settings||{};e.linkSettings(n,i,t,"embed"),n.source&&(o.source=n.source),n.sourceId&&(o.id=n.sourceId),n.placeholder&&(o.placeholder=n.placeholder),n.icon&&(o.icon=n.icon),n.url&&(o.url=n.url),e.linkEvents(n,o,$.fn.embed.settings,{onCreate:"onCreate",onDisplay:"onDisplay",onPlaceholderDisplay:"onPlaceholderDisplay",onEmbed:"onEmbed"}),i.embed(o),angular.isFunction(n.onInit)&&n.onInit(i)}}e.factory("SemanticEmbedLink",["SemanticUI",t]).directive("smEmbedBind",["SemanticUI",n]).directive("smEmbed",["SemanticEmbedLink",i]);var o={smEmbedReset:"reset",smEmbedShow:"show",smEmbedHide:"hide",smEmbedDestroy:"destroy"};angular.forEach(o,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"embed",n)}])})}(angular.module("semantic-ui-embed",["semantic-ui-core"])),function(e){function n(e,n){return{restrict:"E",replace:!0,scope:{items:"=",description:"&",icon:"&",image:"&",header:"&",headerHref:"&",children:"&",onHeader:"&",has:"=?"},template:['<div class="ui list">',' <div class="item" ng-repeat="i in items" ng-init="$ = {item: i}">',' <i ng-if="has.icon" class="icon {{ icon($) }}"></i>',' <img ng-if="has.image" class="ui avatar image" ng-src="{{ image($) }}">',' <div ng-if="has.header || has.children" class="content">',' <div ng-if="!has.headerLink" class="header" sm-html="header($)"></div>',' <a ng-if="has.headerLink" class="header" ng-href="{{ headerHref($) }}" ng-click="onHeader($)" sm-html="header($)"></a>',' <div class="description" sm-html="description($)"></div>',' <sm-list ng-if="has.children && getChildCount($)" has="has" items="children($)" description="description({item: item})" icon="icon({item: item})" header="header({item: item})" header-href="headerHref({item: item})" children="children({item: item})" on-header="onHeader({item: item})"></sm-list>'," </div>",' <div ng-if="!has.header && !has.children" class="content" sm-html="description($)"></div>'," </div>","</div>"].join("\n"),compile:e.RecursiveCompiler(n)}}function i(e){return function(n,i,t){n.has||(n.has={icon:!!t.icon,image:!!t.image,header:!!t.header,headerLink:!!t.headerHref,description:!!t.description,children:!!t.children}),n.getChildCount=function(e){var i=n.children(e);return i?i.length:0},e.setDefaultFunction(n,"description",t,function(e){return e.item}),e.setDefaultFunction(n,"icon",t,function(e){return e.item.icon}),e.setDefaultFunction(n,"header",t,function(e){return e.item.header}),e.setDefaultFunction(n,"children",t,function(e){return e.item.children})}}e.factory("SemanticListLink",["SemanticUI",i]).directive("smList",["SemanticUI","SemanticListLink",n])}(angular.module("semantic-ui-list",["semantic-ui-core"])),function(e){function n(e){return{restrict:"E",replace:!0,scope:{items:"=",label:"&",onClick:"&",children:"&",description:"&",icon:"&",hidden:"&",divider:"&"},template:['<div class="menu">','<div ng-repeat="i in items" ng-hide="isHidden( i )" ng-class="{item: !isDivider( i ), divider: isDivider( i )}" ng-click="onClick({item: i, $event:$event})">','<i class="{{ getIcon( i ) }} icon" ng-if="getIcon( i )"></i>','<span class="description" ng-if="getDescription( i )">{{ getDescription( i ) }}</span>',"{{ getLabel( i ) }}",'<sm-menu ng-if="hasChildren( i )" items="getChildren( i )" label="getLabel( item )" children="getChildren( item )" description="getDescription( item )" icon="getIcon( item )" hidden="isHidden( item )" divider="isDivider( item )" on-click="onClick({item: item, $event: $event})"></sm-menu>',"</div>","</div>"].join("\n"),controller:"SemanticMenuController",compile:e.RecursiveCompiler()}}function i(e){e.hasChildren=function(n){var i=e.children({item:n});return i&&i.length},e.getChildren=function(n){return e.children({item:n})},e.getLabel=function(n){return e.label({item:n})},e.getIcon=function(n){return e.icon({item:n})},e.getDescription=function(n){return e.description({item:n})},e.isHidden=function(n){return e.hidden({item:n})},e.isDivider=function(n){return e.divider({item:n})}}e.controller("SemanticMenuController",["$scope",i]).directive("smMenu",["SemanticUI",n])}(angular.module("semantic-ui-menu",["semantic-ui-core"])),function(e){function n(e){return e.createBind("smModalBind","modal")}function i(e){return{restrict:"E",replace:!0,transclude:!0,scope:{visible:"=",settings:"=",onInit:"=",onShow:"=",onVisible:"=",onHide:"=",onHidden:"=",onApprove:"=",onDeny:"="},template:'<div class="ui modal" ng-transclude></div>',link:e}}function t(e){return function(n,i,t){var o=n.settings||{};if(e.linkSettings(n,i,t,"modal"),t.visible){var a=e.watcher(n,"visible",function(e){i.modal(e?"show":"hide")});e.onEvent(o,"onHide",function(){a.set(!1)}),e.onEvent(o,"onShow",function(){a.set(!0)})}e.linkEvents(n,o,$.fn.modal.settings,{onShow:"onShow",onVisible:"onVisible",onHide:"onHide",onHidden:"onHidden",onApprove:"onApprove",onDeny:"onDeny"}),i.modal(o),angular.isFunction(n.onInit)&&n.onInit(i)}}e.factory("SemanticModalLink",["SemanticUI",t]).directive("smModalBind",["SemanticUI",n]).directive("smModal",["SemanticModalLink",i]);var o={smModalShow:"show",smModalHide:"hide",smModalToggle:"toggle",smModalRefresh:"refresh",smModalShowDimmer:"show dimmer",smModalHideDimmer:"hide dimmer",smModalHideOthers:"hide others",smModalHideAll:"hide all",smModalCacheSizes:"cache sizes",smModalSetActive:"set active"};angular.forEach(o,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"modal",n)}])})}(angular.module("semantic-ui-modal",["semantic-ui-core"])),function(e){function n(e){return e.createBind("smPopupBind","popup")}function i(e){return{restrict:"A",scope:{smPopup:"=",smPopupTitle:"=",smPopupHtml:"=",smPopupPosition:"@",smPopupVariation:"@",smPopupSettings:"=",smPopupOnInit:"=",smPopupOnCreate:"=",smPopupOnRemove:"=",smPopupOnShow:"=",smPopupOnVisible:"=",smPopupOnHide:"=",smPopupOnHidden:"="},link:e}}function t(e){return function(n,i,t){var o=n.smPopupSettings||{};e.linkSettings(n,i,t,"popup",!1,"smPopupSettings"),e.bindAttribute(n,"smPopup",i,"data-content"),e.bindAttribute(n,"smPopupTitle",i,"data-title"),e.bindAttribute(n,"smPopupHtml",i,"data-html"),e.bindAttribute(n,"smPopupPosition",i,"data-position"),e.bindAttribute(n,"smPopupVariation",i,"data-variation"),e.linkEvents(n,o,{onCreate:"smPopupOnCreate",onRemove:"smPopupOnRemove",onShow:"smPopupOnShow",onVisible:"smPopupOnVisible",onHide:"smPopupOnHide",onHidden:"smPopupOnHidden"}),i.popup(o),angular.isFunction(n.smPopupOnInit)&&n.smPopupOnInit(i)}}function o(e){return{restrict:"A",scope:{smPopupInline:"=",smPopupInlineOnInit:"=",smPopupInlineOnCreate:"=",smPopupInlineOnRemove:"=",smPopupInlineOnShow:"=",smPopupInlineOnVisible:"=",smPopupInlineOnHide:"=",smPopupInlineOnHidden:"="},link:e}}function a(e){return function(n,i,t){var o=n.smPopupInline||{};e.linkSettings(n,i,t,"popup",!1,"smPopupInline"),e.linkEvents(n,o,{onCreate:"smPopupInlineOnCreate",onRemove:"smPopupInlineOnRemove",onShow:"smPopupInlineOnShow",onVisible:"smPopupInlineOnVisible",onHide:"smPopupInlineOnHide",onHidden:"smPopupInlineOnHidden"}),o.inline=!0,i.popup(o),angular.isFunction(n.smPopupInlineOnInit)&&n.smPopupInlineOnInit(i)}}function c(e){return{restrict:"A",scope:{smPopupDisplay:"@",smPopupDisplaySettings:"=",smPopupDisplayOnInit:"=",smPopupDisplayOnCreate:"=",smPopupDisplayOnRemove:"=",smPopupDisplayOnShow:"=",smPopupDisplayOnVisible:"=",smPopupDisplayOnHide:"=",smPopupDisplayOnHidden:"="},link:e}}function s(e){return function(n,i,t){var o=n.smPopupDisplaySettings||{};e.linkSettings(n,i,t,"popup",!1,"smPopupDisplaySettings"),e.linkEvents(n,o,$.fn.popup.settings,{onCreate:"smPopupDisplayOnCreate",onRemove:"smPopupDisplayOnRemove",onShow:"smPopupDisplayOnShow",onVisible:"smPopupDisplayOnVisible",onHide:"smPopupDisplayOnHide",onHidden:"smPopupDisplayOnHidden"}),o.popup='[data-popup-named="'+t.smPopupDisplay+'"]',i.popup(o),angular.isFunction(n.smPopupDisplayOnInit)&&n.smPopupDisplayOnInit(i)}}function r(){return{restrict:"E",replace:!0,transclude:!0,scope:{name:"@"},template:'<div class="ui popup" data-popup-named="{{ name }}" ng-transclude></div>'}}e.factory("SemanticPopupLink",["SemanticUI",t]).factory("SemanticPopupInlineLink",["SemanticUI",a]).factory("SemanticPopupDisplayLink",["SemanticUI",s]).directive("smPopupBind",["SemanticUI",n]).directive("smPopup",["SemanticPopupLink",i]).directive("smPopupInline",["SemanticPopupInlineLink",o]).directive("smPopupDisplay",["SemanticPopupDisplayLink",c]).directive("smPopupDetached",[r]);var l={smPopupShow:"show",smPopupHide:"hide",smPopupHideAll:"hide all",smPopupToggle:"toggle",smPopupReposition:"reposition",smPopupDestroy:"destroy",smPopupRemove:"remove popup"};angular.forEach(l,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"popup",n)}])})}(angular.module("semantic-ui-popup",["semantic-ui-core"])),function(e){function n(e){return e.createBind("smProgressBind","progress")}function i(e){return{restrict:"E",replace:!0,transclude:!0,scope:{model:"=",total:"=",label:"@",activeText:"@",successText:"@",errorText:"@",warningText:"@",duration:"@",onInit:"=",onChange:"=",onSuccess:"=",onActive:"=",onError:"=",onWarning:"="},template:['<div class="ui progress">',' <div class="bar">',' <div class="progress" ng-show="label"></div>'," </div>",' <div class="label" ng-transclude></div>',"</div>"].join("\n"),link:e}}function t(e){var n=function(e,n,i,t,o){angular.isDefined(n[t])&&(i.text=i.text||{},i.text[o]=e[t])};return function(i,t,o){var a=i.settings||{};e.linkSettings(i,t,o,"progress"),e.linkEvents(i,a,$.fn.progress.settings,{onChange:"onChange",onSuccess:"onSuccess",onActive:"onActive",onError:"onError",onWarning:"onWarning"}),angular.isDefined(a.showActivity)||(a.showActivity=!1),angular.isDefined(o.label)&&(a.label=i.label),angular.isDefined(o.total)?a.total=i.total:a.total=100,angular.isDefined(o.model)&&(a.value=i.model),n(i,o,a,"activeText","active"),n(i,o,a,"successText","success"),n(i,o,a,"errorText","error"),n(i,o,a,"warningText","warning"),t.progress(a),e.watcher(i,"model",function(e){var n=t.progress("get total")||100;t.progress("set percent",100*e/n),t.progress("set value",e)}),angular.isDefined(o.duration)&&e.watcher(i,"duration",function(e){t.progress("set duration",e)}),angular.isDefined(o.total)&&e.watcher(i,"total",function(e){t.progress("set total",e)}),angular.isFunction(i.onInit)&&i.onInit(t)}}e.factory("SemanticProgressLink",["SemanticUI",t]).directive("smProgressBind",["SemanticUI",n]).directive("smProgress",["SemanticProgressLink",i]);var o={smProgressIncrement:"increment"};angular.forEach(o,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"progress",n)}])})}(angular.module("semantic-ui-progress",["semantic-ui-core"])),function(e){function n(e){return e.createBind("smRatingBind","rating")}function i(e){return{restrict:"E",replace:!0,scope:{model:"=",total:"=",type:"@",disabled:"=",settings:"=",onInit:"=",onRate:"="},template:'<div class="ui rating {{ type }}" data-rating="{{ model }}" data-max-rating="{{ total }}"></div>',link:e}}function t(e){return function(n,i,t){i.ready(function(){var o=n.settings||{};if(e.linkSettings(n,i,t,"rating",!0),e.triggerChange(n,"model",i,!0),t.disabled){e.watcher(n,"disabled",function(e){i.rating(e?"disable":"enable")})}var a=e.watcher(n,"model",function(e){i.rating("set rating",e)});e.onEvent(o,"onRate",function(e){a.set(e)}),e.linkEvents(n,o,$.fn.rating.settings,{onRate:"onRate"}),i.rating(o),n.disabled&&i.rating("disable"),angular.isFunction(n.onInit)&&n.onInit(i)})}}e.factory("SemanticRatingLink",["SemanticUI",t]).directive("smRatingBind",["SemanticUI",n]).directive("smRating",["SemanticRatingLink",i]);var o={smRatingSet:"set rating",smRatingDisable:"disable",smRatingEnable:"enable",smRatingClear:"clear rating"};angular.forEach(o,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"rating",n)}])})}(angular.module("semantic-ui-rating",["semantic-ui-core"])),function(e){function n(e){return e.createBind("smSearchBind","search")}function i(e){return{restrict:"E",replace:!0,scope:{model:"=",text:"=?",icon:"@",placeholder:"@",category:"@",local:"=",remote:"@",settings:"=",onInit:"=",onSelect:"=",onResultsAdd:"=",onSearchQuery:"=",onResults:"=",onResultsOpen:"=",onResultsClose:"="},template:['<div class="ui search" ng-class="{category: category}">',' <div class="ui input" ng-class="{icon: icon}">',' <input class="prompt" type="text" placeholder="{{ placeholder }}" ng-model="text">',' <i ng-if="icon" class="{{ icon }} icon"></i>'," </div>",' <div class="results"></div>',"</div>"].join("\n"),link:e}}function t(e){var n=$.fn.search&&$.fn.search.settings&&$.fn.search.settings.fields?$.fn.search.settings.fields.title:"";return function(i,t,o){var a=i.settings||{},c=a.fields&&a.fields.title?a.fields.title:n;e.linkSettings(i,t,o,"search"),i.local&&(a.source=i.local),i.remote&&(a.apiSettings={url:i.remote}),i.category&&(a.type="category");var s=e.watcher(i,"model",function(e){t.search("set value",e&&c in e?e[c]:e)});e.onEvent(a,"onSelect",function(e,n){s.set(e),o.text&&i.$evalAsync(function(){i.text=e[c]})}),e.linkEvents(i,a,$.fn.search.settings,{onSelect:"onSelect",onResultsAdd:"onResultsAdd",onSearchQuery:"onSearchQuery",onResults:"onResults",onResultsOpen:"onResultsOpen",onResultsClose:"onResultsClose"}),t.search(a),angular.isFunction(i.onInit)&&i.onInit(t),i.model&&o.text&&c in i.model&&(i.text=i.model[c])}}e.factory("SemanticSearchLink",["SemanticUI",t]).directive("smSearchBind",["SemanticUI",n]).directive("smSearch",["SemanticSearchLink",i]);var o={smSearchQuery:"query",smSearchCancelQuery:"cancel query",smSearchSearchLocal:"search local",smSearchSearchRemote:"search remote",smSearchSet:"set value",smSearchShowResults:"show results",smSearchHideResults:"hide results",smSearchDestroy:"destroy"};angular.forEach(o,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"search",n)}])})}(angular.module("semantic-ui-search",["semantic-ui-core"])),function(e){function n(e){return e.createBind("smDimmerBind","dimmer")}function i(e){return{restrict:"E",replace:!0,transclude:!0,scope:{visible:"=",settings:"=",onInit:"=",onShow:"=",onHide:"=",onChange:"="},template:'<div class="ui dimmer" ng-transclude></div>',link:e}}function t(e){return function(n,i,t){var o=n.settings||{};if(e.linkSettings(n,i,t,"dimmer"),t.visible){var a=e.watcher(n,"visible",function(e){i.dimmer(e?"show":"hide")});e.onEvent(o,"onShow",function(e){a.set(!0)}),e.onEvent(o,"onHide",function(e){a.set(!1)})}e.linkEvents(n,o,$.fn.dimmer.settings,{onShow:"onShow",onHide:"onHide",onChange:"onChange"}),i.dimmer(o),angular.isFunction(n.onInit)&&n.onInit(i)}}e.factory("SemanticDimmerLink",["SemanticUI",t]).directive("smDimmerBind",["SemanticUI",n]).directive("smDimmer",["SemanticDimmerLink",i]);var o={smDimmerShow:"show",smDimmerHide:"hide",smDimmerToggle:"toggle"};angular.forEach(o,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"dimmer",n)}])})}(angular.module("semantic-ui-dimmer",["semantic-ui-core"])),function(e){function n(e){return e.createBind("smShapeBind","shape")}function i(e){return{restrict:"E",replace:!0,transclude:!0,scope:{settings:"=",onInit:"=",onBeforeChange:"=",onChange:"="},template:['<div class="ui shape">',' <div class="sides" ng-transclude>'," </div>","</div>"].join("\n"),link:e}}function t(e){
return function(n,i,t){var o=n.settings||{};e.linkSettings(n,i,t,"shape"),e.linkEvents(n,o,$.fn.shape.settings,{onBeforeChange:"onBeforeChange",onChange:"onChange"}),i.shape(o),angular.isFunction(n.onInit)&&n.onInit(i)}}e.factory("SemanticShapeLink",["SemanticUI",t]).directive("smShapeBind",["SemanticUI",n]).directive("smShape",["SemanticShapeLink",i]);var o={smShapeFlipUp:"flip up",smShapeFlipDown:"flip down",smShapeFlipLeft:"flip left",smShapeFlipRight:"flip right",smShapeFlipOver:"flip over",smShapeFlipBack:"flip back",smShapeSetNextSide:"set next side",smShapeReset:"reset",smShapeQueue:"queue",smShapeRepaint:"repaint",smShapeSetDefaultSide:"set default side",smShapeSetStageSize:"set stage size",smShapeRefresh:"refresh"};angular.forEach(o,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"shape",n)}])})}(angular.module("semantic-ui-shape",["semantic-ui-core"])),function(e){function n(e){return e.createBind("smSidebarBind","sidebar")}function i(e){return{restrict:"E",replace:!0,scope:{items:"=",label:"&",onClick:"&",visible:"=",settings:"=",onInit:"=",onVisible:"=",onShow:"=",onChange:"=",onHide:"=",onHidden:"="},template:['<div class="ui sidebar">',' <a class="item" ng-repeat="i in items" sm-html="label({item:i})" ng-click="onClick({item:i, $event:$event})"></a>',"</div>"].join("\n"),link:e}}function t(e){return function(n,i,t){var o=n.settings||{};if(e.setDefaultFunction(n,"label",t,function(e){return e.item}),e.linkSettings(n,i,t,"sidebar"),t.visible){var a=e.watcher(n,"visible",function(e){i.sidebar(e?"show":"hide")});e.onEvent(o,"onHide",function(){a.set(!1)}),e.onEvent(o,"onShow",function(){a.set(!0)})}e.linkEvents(n,o,$.fn.sidebar.settings,{onVisible:"onVisible",onShow:"onShow",onChange:"onChange",onHide:"onHide",onHidden:"onHidden"});var c=$(".pusher");c.length&&i.insertBefore(c),i.sidebar(o),n.visible&&i.sidebar("show"),angular.isFunction(n.onInit)&&n.onInit(i)}}e.factory("SemanticSidebarLink",["SemanticUI",t]).directive("smSidebarBind",["SemanticUI",n]).directive("smSidebar",["SemanticSidebarLink",i]);var o={smSidebarShow:"show",smSidebarHide:"hide",smSidebarToggle:"toggle",smSidebarPushPage:"push page",smSidebarPullPage:"pull page",smSidebarAddBodyCss:"add body css",smSidebarRemoveBodyCss:"remove body css"};angular.forEach(o,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"sidebar",n)}])})}(angular.module("semantic-ui-sidebar",["semantic-ui-core"])),function(e){function n(e){return e.createBind("smStickyBind","sticky")}function i(e){return{restrict:"E",replace:!0,transclude:!0,scope:{context:"@",settings:"=",onInit:"=",onReposition:"=",onScroll:"=",onStick:"=",onUnstick:"=",onTop:"=",onBottom:"="},template:'<div class="ui sticky" ng-transclude></div>',link:e}}function t(e){return function(n,i,t){i.ready(function(){var o=n.settings||{};e.linkSettings(n,i,t,"sticky",!0),e.linkEvents(n,o,$.fn.sticky.settings,{onReposition:"onReposition",onScroll:"onScroll",onStick:"onStick",onStick:"onStick",onTop:"onTop",onBottom:"onBottom"}),o.context||(o.context=n.context),i.sticky(o),angular.isFunction(n.onInit)&&n.onInit(i)})}}e.factory("SemanticStickyLink",["SemanticUI",t]).directive("smStickyBind",["SemanticUI",n]).directive("smSticky",["SemanticStickyLink",i]);var o={smStickyRefresh:"refresh"};angular.forEach(o,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"sticky",n)}])})}(angular.module("semantic-ui-sticky",["semantic-ui-core"])),function(e){function n(e){return e.createBind("smTabBind","tab")}function i(e){return{restrict:"E",replace:!0,scope:{tabs:"=",active:"=?",settings:"="},template:['<div class="ui menu">',' <a class="item" ng-repeat="(name, title) in tabs" ng-class="{active: name === active}" data-tab="{{ name }}" sm-html="title"></a>',"</div>"].join("\n"),link:e}}function t(e,n){return function(i,t,o){var a=function(e){e&&t.tab("change tab",e)};n(function(){var n=i.settings||{},c=t.children(".item"),s=!!o.active;if(e.linkSettings(i,c,o,"tab",!0),s){var r=e.watcher(i,"active",function(e){a(e)});e.onEvent(n,"onVisible",function(e){r.set(e)})}c.tab(n),s&&a(i.active)})}}function o(e){return{restrict:"E",replace:!0,transclude:!0,scope:{name:"@"},template:'<div class="ui tab" data-tab="{{ name }}" ng-transclude></div>'}}e.factory("SemanticTabMenuLink",["SemanticUI","$timeout",t]).directive("smTabBind",["SemanticUI",n]).directive("smTabMenu",["SemanticTabMenuLink",i]).directive("smTab",["SemanticUI",o]);var a={smTabSet:"change tab"};angular.forEach(a,function(n,i){e.directive(i,["SemanticUI",function(e){return e.createBehavior(i,"tab",n)}])})}(angular.module("semantic-ui-tab",["semantic-ui-core"])),function(e){function n(){function e(e){var n=e.getHours(),i=e.getMinutes(),t=i<10?"0"+i:i;return a[n%a.length]+":"+t+(n<12?"AM":"PM")}function n(e){return e>=11&&e<=13?e+"th":e+o[e%o.length]}function i(e){return Math.ceil(((new Date).getTime()-e.getTime())/864e5)}var t=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["th","st","nd","rd","th","th","th","th","th","th"],a=["12","1","2","3","4","5","6","7","8","9","10","11"];return{restrict:"A",link:function(o,a,c){var s=!1,r=!1,l=function(){var o=new Date,c=new Date(o.getFullYear(),o.getMonth(),o.getDate()),u=new Date(o.getFullYear(),o.getMonth(),o.getDate()-1),d=o.getTime()-r.getTime(),m="",p=!1;if(d<6e4)m="Just now",p=6e4-d;else if(d<36e5){var h=Math.floor(d/6e4);m=1===h?"1 minute ago":h+" minutes ago",p=d%6e4}else if(r.getTime()>c.getTime())m="Today at "+e(r),p=d%36e5;else if(r.getTime()>u.getTime())m="Yesterday at "+e(r),p=d%36e5;else if(r.getMonth()===o.getMonth()&&r.getFullYear()===o.getFullYear())m+="The "+n(r.getDate()),m+=" at "+e(r),m+=" ("+i(r)+" days ago)",p=864e5;else{m+=t[r.getMonth()]+" "+n(r.getDate()),r.getFullYear()!==o.getFullYear()&&(m+=" "+r.getFullYear()),m+=" at "+e(r);var g=i(r);g<=60&&(m+=" ("+i(r)+" days ago)")}a.text(m),s&&(clearTimeout(s),s=!1),p&&(s=setTimeout(function(){s=!1,l()},p))};o.$watch(c.smTimeAgo,function(e){r=new Date(e),l()})}}}e.directive("smTimeAgo",n)}(angular.module("semantic-ui-timeago",["semantic-ui-core"])),function(e){function n(e){return{restrict:"A",scope:{smTransition:"@",smTransitionEvents:"@",smTransitionOther:"@"},link:e}}function i(e){return function(e,n,i){e.smTransitionEvents=e.smTransitionEvents||"click",n.on(e.smTransitionEvents,function(){(e.smTransitionOther?$(e.smTransitionOther):n).transition(e.smTransition)})}}e.factory("SemanticTransitionLink",["SemanticUI",i]).directive("smTransition",["SemanticTransitionLink",n])}(angular.module("semantic-ui-transition",["semantic-ui-core"]));
//# sourceMappingURL=angular-semantic-ui.min.js.map