UNPKG

ng2-bootstrap

Version:
1,081 lines (1,051 loc) 246 kB
!function(e){function r(e,r,o){return 4===arguments.length?t.apply(this,arguments):void n(e,{declarative:!0,deps:r,declare:o})}function t(e,r,t,o){n(e,{declarative:!1,deps:r,executingRequire:t,execute:o})}function n(e,r){r.name=e,e in v||(v[e]=r),r.normalizedDeps=r.deps}function o(e,r){if(r[e.groupIndex]=r[e.groupIndex]||[],-1==g.call(r[e.groupIndex],e)){r[e.groupIndex].push(e);for(var t=0,n=e.normalizedDeps.length;n>t;t++){var a=e.normalizedDeps[t],u=v[a];if(u&&!u.evaluated){var d=e.groupIndex+(u.declarative!=e.declarative);if(void 0===u.groupIndex||u.groupIndex<d){if(void 0!==u.groupIndex&&(r[u.groupIndex].splice(g.call(r[u.groupIndex],u),1),0==r[u.groupIndex].length))throw new TypeError("Mixed dependency cycle detected");u.groupIndex=d}o(u,r)}}}}function a(e){var r=v[e];r.groupIndex=0;var t=[];o(r,t);for(var n=!!r.declarative==t.length%2,a=t.length-1;a>=0;a--){for(var u=t[a],i=0;i<u.length;i++){var s=u[i];n?d(s):l(s)}n=!n}}function u(e){return y[e]||(y[e]={name:e,dependencies:[],exports:{},importers:[]})}function d(r){if(!r.module){var t=r.module=u(r.name),n=r.module.exports,o=r.declare.call(e,function(e,r){if(t.locked=!0,"object"==typeof e)for(var o in e)n[o]=e[o];else n[e]=r;for(var a=0,u=t.importers.length;u>a;a++){var d=t.importers[a];if(!d.locked)for(var i=0;i<d.dependencies.length;++i)d.dependencies[i]===t&&d.setters[i](n)}return t.locked=!1,r},{id:r.name});t.setters=o.setters,t.execute=o.execute;for(var a=0,i=r.normalizedDeps.length;i>a;a++){var l,s=r.normalizedDeps[a],c=v[s],f=y[s];f?l=f.exports:c&&!c.declarative?l=c.esModule:c?(d(c),f=c.module,l=f.exports):l=p(s),f&&f.importers?(f.importers.push(t),t.dependencies.push(f)):t.dependencies.push(null),t.setters[a]&&t.setters[a](l)}}}function i(e){var r,t=v[e];if(t)t.declarative?f(e,[]):t.evaluated||l(t),r=t.module.exports;else if(r=p(e),!r)throw new Error("Unable to load dependency "+e+".");return(!t||t.declarative)&&r&&r.__useDefault?r["default"]:r}function l(r){if(!r.module){var t={},n=r.module={exports:t,id:r.name};if(!r.executingRequire)for(var o=0,a=r.normalizedDeps.length;a>o;o++){var u=r.normalizedDeps[o],d=v[u];d&&l(d)}r.evaluated=!0;var c=r.execute.call(e,function(e){for(var t=0,n=r.deps.length;n>t;t++)if(r.deps[t]==e)return i(r.normalizedDeps[t]);throw new TypeError("Module "+e+" not declared as a dependency.")},t,n);void 0!==typeof c&&(n.exports=c),t=n.exports,t&&t.__esModule?r.esModule=t:r.esModule=s(t)}}function s(r){var t={};if(("object"==typeof r||"function"==typeof r)&&r!==e)if(m)for(var n in r)"default"!==n&&c(t,r,n);else{var o=r&&r.hasOwnProperty;for(var n in r)"default"===n||o&&!r.hasOwnProperty(n)||(t[n]=r[n])}return t["default"]=r,x(t,"__useDefault",{value:!0}),t}function c(e,r,t){try{var n;(n=Object.getOwnPropertyDescriptor(r,t))&&x(e,t,n)}catch(o){return e[t]=r[t],!1}}function f(r,t){var n=v[r];if(n&&!n.evaluated&&n.declarative){t.push(r);for(var o=0,a=n.normalizedDeps.length;a>o;o++){var u=n.normalizedDeps[o];-1==g.call(t,u)&&(v[u]?f(u,t):p(u))}n.evaluated||(n.evaluated=!0,n.module.execute.call(e))}}function p(e){if(I[e])return I[e];if("@node/"==e.substr(0,6))return I[e]=s(D(e.substr(6)));var r=v[e];if(!r)throw"Module "+e+" not present.";return a(e),f(e,[]),v[e]=void 0,r.declarative&&x(r.module.exports,"__esModule",{value:!0}),I[e]=r.declarative?r.module.exports:r.esModule}var v={},g=Array.prototype.indexOf||function(e){for(var r=0,t=this.length;t>r;r++)if(this[r]===e)return r;return-1},m=!0;try{Object.getOwnPropertyDescriptor({a:0},"a")}catch(h){m=!1}var x;!function(){try{Object.defineProperty({},"a",{})&&(x=Object.defineProperty)}catch(e){x=function(e,r,t){try{e[r]=t.value||t.get.call(e)}catch(n){}}}}();var y={},D="undefined"!=typeof System&&System._nodeRequire||"undefined"!=typeof require&&require.resolve&&"undefined"!=typeof process&&require,I={"@empty":{}};return function(e,n,o,a){return function(u){u(function(u){for(var d={_nodeRequire:D,register:r,registerDynamic:t,get:p,set:function(e,r){I[e]=r},newModule:function(e){return e}},i=0;i<n.length;i++)(function(e,r){r&&r.__esModule?I[e]=r:I[e]=s(r)})(n[i],arguments[i]);a(d);var l=p(e[0]);if(e.length>1)for(var i=1;i<e.length;i++)p(e[i]);return o?l["default"]:l})}}}("undefined"!=typeof self?self:global) (["1"], ["4a","46","45","47","59","52","53","54","55","56","57","58"], true, function($__System) { var require = this.require, exports = this.exports, module = this.module; $__System.registerDynamic('2', ['3', '4', '5'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var accordion_group_component_1 = $__require('3'); exports.AccordionPanelComponent = accordion_group_component_1.AccordionPanelComponent; var accordion_component_1 = $__require('4'); exports.AccordionComponent = accordion_component_1.AccordionComponent; var accordion_module_1 = $__require('5'); exports.AccordionModule = accordion_module_1.AccordionModule; return module.exports; }); $__System.registerDynamic('6', ['7', '8'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var alert_component_1 = $__require('7'); exports.AlertComponent = alert_component_1.AlertComponent; var alert_module_1 = $__require('8'); exports.AlertModule = alert_module_1.AlertModule; return module.exports; }); $__System.registerDynamic('9', ['a', 'b', 'c'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var button_checkbox_directive_1 = $__require('a'); exports.ButtonCheckboxDirective = button_checkbox_directive_1.ButtonCheckboxDirective; var button_radio_directive_1 = $__require('b'); exports.ButtonRadioDirective = button_radio_directive_1.ButtonRadioDirective; var buttons_module_1 = $__require('c'); exports.ButtonsModule = buttons_module_1.ButtonsModule; return module.exports; }); $__System.registerDynamic('d', ['e', 'f', '10'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var carousel_component_1 = $__require('e'); exports.CarouselComponent = carousel_component_1.CarouselComponent; var carousel_module_1 = $__require('f'); exports.CarouselModule = carousel_module_1.CarouselModule; var slide_component_1 = $__require('10'); exports.SlideComponent = slide_component_1.SlideComponent; return module.exports; }); $__System.registerDynamic('11', ['12', '13'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var collapse_directive_1 = $__require('12'); exports.CollapseDirective = collapse_directive_1.CollapseDirective; var collapse_module_1 = $__require('13'); exports.CollapseModule = collapse_module_1.CollapseModule; return module.exports; }); $__System.registerDynamic('14', ['15', '16', '17', '18', '19', '1a'], true, function ($__require, exports, module) { "use strict"; /* todo: general: 1. Popup 2. Keyboard support 3. custom-class attribute support 4. date-disabled attribute support 5. template-url attribute support */ var define, global = this || self, GLOBAL = global; var datepicker_component_1 = $__require('15'); exports.DatePickerComponent = datepicker_component_1.DatePickerComponent; var datepicker_module_1 = $__require('16'); exports.DatepickerModule = datepicker_module_1.DatepickerModule; var daypicker_component_1 = $__require('17'); exports.DayPickerComponent = daypicker_component_1.DayPickerComponent; var monthpicker_component_1 = $__require('18'); exports.MonthPickerComponent = monthpicker_component_1.MonthPickerComponent; var yearpicker_component_1 = $__require('19'); exports.YearPickerComponent = yearpicker_component_1.YearPickerComponent; var date_formatter_1 = $__require('1a'); exports.DateFormatter = date_formatter_1.DateFormatter; return module.exports; }); $__System.registerDynamic('1b', ['1c', '1d', '1e', '1f'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; function __export(m) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } __export($__require('1c')); __export($__require('1d')); __export($__require('1e')); var modal_module_1 = $__require('1f'); exports.ModalModule = modal_module_1.ModalModule; return module.exports; }); $__System.registerDynamic('20', ['21', '22', '23', '24', '25'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var dropdown_menu_directive_1 = $__require('21'); exports.DropdownMenuDirective = dropdown_menu_directive_1.DropdownMenuDirective; var dropdown_toggle_directive_1 = $__require('22'); exports.DropdownToggleDirective = dropdown_toggle_directive_1.DropdownToggleDirective; var dropdown_directive_1 = $__require('23'); exports.DropdownDirective = dropdown_directive_1.DropdownDirective; var dropdown_service_1 = $__require('24'); exports.DropdownService = dropdown_service_1.DropdownService; var dropdown_module_1 = $__require('25'); exports.DropdownModule = dropdown_module_1.DropdownModule; return module.exports; }); $__System.registerDynamic('26', ['27', '28', '29'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var pager_component_1 = $__require('27'); exports.PagerComponent = pager_component_1.PagerComponent; var pagination_component_1 = $__require('28'); exports.PaginationComponent = pagination_component_1.PaginationComponent; var pagination_module_1 = $__require('29'); exports.PaginationModule = pagination_module_1.PaginationModule; return module.exports; }); $__System.registerDynamic('2a', ['2b', '2c', '2d', '2e'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var bar_component_1 = $__require('2b'); exports.BarComponent = bar_component_1.BarComponent; var progress_directive_1 = $__require('2c'); exports.ProgressDirective = progress_directive_1.ProgressDirective; var progressbar_component_1 = $__require('2d'); exports.ProgressbarComponent = progressbar_component_1.ProgressbarComponent; var progressbar_module_1 = $__require('2e'); exports.ProgressbarModule = progressbar_module_1.ProgressbarModule; return module.exports; }); $__System.registerDynamic('2f', ['30', '31'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var rating_component_1 = $__require('30'); exports.RatingComponent = rating_component_1.RatingComponent; var rating_module_1 = $__require('31'); exports.RatingModule = rating_module_1.RatingModule; return module.exports; }); $__System.registerDynamic('32', ['33', '34', '35', '36'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var tab_heading_directive_1 = $__require('33'); exports.TabHeadingDirective = tab_heading_directive_1.TabHeadingDirective; var tabset_component_1 = $__require('34'); exports.TabsetComponent = tabset_component_1.TabsetComponent; var tab_directive_1 = $__require('35'); exports.TabDirective = tab_directive_1.TabDirective; var tabs_module_1 = $__require('36'); exports.TabsModule = tabs_module_1.TabsModule; return module.exports; }); $__System.registerDynamic('37', ['38', '39'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var timepicker_component_1 = $__require('38'); exports.TimepickerComponent = timepicker_component_1.TimepickerComponent; var timepicker_module_1 = $__require('39'); exports.TimepickerModule = timepicker_module_1.TimepickerModule; return module.exports; }); $__System.registerDynamic('3a', ['3b', '3c', '3d'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var tooltip_container_component_1 = $__require('3b'); exports.TooltipContainerComponent = tooltip_container_component_1.TooltipContainerComponent; var tooltip_directive_1 = $__require('3c'); exports.TooltipDirective = tooltip_directive_1.TooltipDirective; var tooltip_module_1 = $__require('3d'); exports.TooltipModule = tooltip_module_1.TooltipModule; return module.exports; }); $__System.registerDynamic('3e', ['3f', '40', '41', '42', '43', '44'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var typeahead_match_class_1 = $__require('3f'); exports.TypeaheadMatch = typeahead_match_class_1.TypeaheadMatch; var typeahead_options_class_1 = $__require('40'); exports.TypeaheadOptions = typeahead_options_class_1.TypeaheadOptions; var typeahead_utils_1 = $__require('41'); exports.TypeaheadUtils = typeahead_utils_1.TypeaheadUtils; var typeahead_container_component_1 = $__require('42'); exports.TypeaheadContainerComponent = typeahead_container_component_1.TypeaheadContainerComponent; var typeahead_directive_1 = $__require('43'); exports.TypeaheadDirective = typeahead_directive_1.TypeaheadDirective; var typeahead_module_1 = $__require('44'); exports.TypeaheadModule = typeahead_module_1.TypeaheadModule; return module.exports; }); $__System.registerDynamic('3', ['45', '4'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var core_1 = $__require('45'); var accordion_component_1 = $__require('4'); /* tslint:disable-next-line */ var MouseEvent = global.MouseEvent; /* tslint:disable:component-selector-name */ var AccordionPanelComponent = function () { function AccordionPanelComponent(accordion) { this.accordion = accordion; } Object.defineProperty(AccordionPanelComponent.prototype, "isOpen", { // Questionable, maybe .panel-open should be on child div.panel element? get: function () { return this._isOpen; }, set: function (value) { this._isOpen = value; if (value) { this.accordion.closeOtherPanels(this); } }, enumerable: true, configurable: true }); AccordionPanelComponent.prototype.ngOnInit = function () { this.panelClass = this.panelClass || 'panel-default'; this.accordion.addGroup(this); }; AccordionPanelComponent.prototype.ngOnDestroy = function () { this.accordion.removeGroup(this); }; AccordionPanelComponent.prototype.toggleOpen = function (event) { event.preventDefault(); if (!this.isDisabled) { this.isOpen = !this.isOpen; } }; AccordionPanelComponent.decorators = [{ type: core_1.Component, args: [{ selector: 'accordion-group, accordion-panel', template: "\n <div class=\"panel\" [ngClass]=\"panelClass\">\n <div class=\"panel-heading\" (click)=\"toggleOpen($event)\">\n <h4 class=\"panel-title\">\n <a href tabindex=\"0\" class=\"accordion-toggle\">\n <span *ngIf=\"heading\" [ngClass]=\"{'text-muted': isDisabled}\">{{heading}}</span>\n <ng-content select=\"[accordion-heading]\"></ng-content>\n </a>\n </h4>\n </div>\n <div class=\"panel-collapse collapse\" [collapse]=\"!isOpen\">\n <div class=\"panel-body\">\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n " }] }]; /** @nocollapse */ AccordionPanelComponent.ctorParameters = [{ type: accordion_component_1.AccordionComponent, decorators: [{ type: core_1.Inject, args: [accordion_component_1.AccordionComponent] }] }]; AccordionPanelComponent.propDecorators = { 'heading': [{ type: core_1.Input }], 'panelClass': [{ type: core_1.Input }], 'isDisabled': [{ type: core_1.Input }], 'isOpen': [{ type: core_1.HostBinding, args: ['class.panel-open'] }, { type: core_1.Input }] }; return AccordionPanelComponent; }(); exports.AccordionPanelComponent = AccordionPanelComponent; return module.exports; }); $__System.registerDynamic('4', ['45'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var core_1 = $__require('45'); // todo: support template url var AccordionComponent = function () { function AccordionComponent() { /* tslint:disable:no-unused-variable */ this.addClass = true; /* tslint:enable:no-unused-variable */ this.groups = []; } AccordionComponent.prototype.closeOtherPanels = function (openGroup) { if (!this.closeOthers) { return; } this.groups.forEach(function (group) { if (group !== openGroup) { group.isOpen = false; } }); }; AccordionComponent.prototype.addGroup = function (group) { this.groups.push(group); }; AccordionComponent.prototype.removeGroup = function (group) { var index = this.groups.indexOf(group); if (index !== -1) { this.groups.splice(index, 1); } }; AccordionComponent.decorators = [{ type: core_1.Component, args: [{ selector: 'accordion', template: "<ng-content></ng-content>" }] }]; /** @nocollapse */ AccordionComponent.ctorParameters = []; AccordionComponent.propDecorators = { 'closeOthers': [{ type: core_1.Input }], 'addClass': [{ type: core_1.HostBinding, args: ['class.panel-group'] }] }; return AccordionComponent; }(); exports.AccordionComponent = AccordionComponent; return module.exports; }); $__System.registerDynamic('5', ['46', '45', '13', '3', '4'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var common_1 = $__require('46'); var core_1 = $__require('45'); var collapse_module_1 = $__require('13'); var accordion_group_component_1 = $__require('3'); var accordion_component_1 = $__require('4'); var AccordionModule = function () { function AccordionModule() {} AccordionModule.decorators = [{ type: core_1.NgModule, args: [{ imports: [common_1.CommonModule, collapse_module_1.CollapseModule], declarations: [accordion_component_1.AccordionComponent, accordion_group_component_1.AccordionPanelComponent], exports: [accordion_component_1.AccordionComponent, accordion_group_component_1.AccordionPanelComponent] }] }]; /** @nocollapse */ AccordionModule.ctorParameters = []; return AccordionModule; }(); exports.AccordionModule = AccordionModule; return module.exports; }); $__System.registerDynamic("7", ["45"], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var core_1 = $__require("45"); var ALERT_TEMPLATE = "\n <div class=\"alert\" role=\"alert\" [ngClass]=\"classes\" *ngIf=\"!closed\">\n <button *ngIf=\"dismissible\" type=\"button\" class=\"close\" (click)=\"onClose()\" (touch)=\"onClose()\">\n <span aria-hidden=\"true\">&times;</span>\n <span class=\"sr-only\">Close</span>\n </button>\n <ng-content></ng-content>\n </div>\n "; // TODO: templateUrl var AlertComponent = function () { function AlertComponent() { this.type = 'warning'; this.close = new core_1.EventEmitter(false); this.classes = []; } AlertComponent.prototype.ngOnInit = function () { var _this = this; this.classes[0] = "alert-" + this.type; if (this.dismissible) { this.classes[1] = 'alert-dismissible'; } else { this.classes.length = 1; } if (this.dismissOnTimeout) { setTimeout(function () { return _this.onClose(); }, this.dismissOnTimeout); } }; // todo: mouse event + touch + pointer AlertComponent.prototype.onClose = function () { this.closed = true; this.close.emit(this); }; AlertComponent.decorators = [{ type: core_1.Component, args: [{ selector: 'alert', template: ALERT_TEMPLATE }] }]; /** @nocollapse */ AlertComponent.ctorParameters = []; AlertComponent.propDecorators = { 'type': [{ type: core_1.Input }], 'dismissible': [{ type: core_1.Input }], 'dismissOnTimeout': [{ type: core_1.Input }], 'close': [{ type: core_1.Output }] }; return AlertComponent; }(); exports.AlertComponent = AlertComponent; return module.exports; }); $__System.registerDynamic('8', ['46', '45', '7'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var common_1 = $__require('46'); var core_1 = $__require('45'); var alert_component_1 = $__require('7'); var AlertModule = function () { function AlertModule() {} AlertModule.decorators = [{ type: core_1.NgModule, args: [{ imports: [common_1.CommonModule], declarations: [alert_component_1.AlertComponent], exports: [alert_component_1.AlertComponent] }] }]; /** @nocollapse */ AlertModule.ctorParameters = []; return AlertModule; }(); exports.AlertModule = AlertModule; return module.exports; }); $__System.registerDynamic('a', ['45', '47'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var core_1 = $__require('45'); var forms_1 = $__require('47'); // TODO: config: activeClass - Class to apply to the checked buttons. var ButtonCheckboxDirective = function () { function ButtonCheckboxDirective(cd) { this.state = false; this.onChange = Function.prototype; this.onTouched = Function.prototype; this.cd = cd; // hack ! cd.valueAccessor = this; } // view -> model ButtonCheckboxDirective.prototype.onClick = function () { this.toggle(!this.state); this.cd.viewToModelUpdate(this.value); }; ButtonCheckboxDirective.prototype.ngOnInit = function () { this.toggle(this.trueValue === this.value); }; Object.defineProperty(ButtonCheckboxDirective.prototype, "trueValue", { get: function () { return typeof this.btnCheckboxTrue !== 'undefined' ? this.btnCheckboxTrue : true; }, enumerable: true, configurable: true }); Object.defineProperty(ButtonCheckboxDirective.prototype, "falseValue", { get: function () { return typeof this.btnCheckboxFalse !== 'undefined' ? this.btnCheckboxFalse : false; }, enumerable: true, configurable: true }); ButtonCheckboxDirective.prototype.toggle = function (state) { this.state = state; this.value = this.state ? this.trueValue : this.falseValue; }; // ControlValueAccessor // model -> view ButtonCheckboxDirective.prototype.writeValue = function (value) { this.state = this.trueValue === value; this.value = value; }; ButtonCheckboxDirective.prototype.registerOnChange = function (fn) { this.onChange = fn; }; ButtonCheckboxDirective.prototype.registerOnTouched = function (fn) { this.onTouched = fn; }; ButtonCheckboxDirective.decorators = [{ type: core_1.Directive, args: [{ selector: '[btnCheckbox][ngModel]' }] }]; /** @nocollapse */ ButtonCheckboxDirective.ctorParameters = [{ type: forms_1.NgModel, decorators: [{ type: core_1.Self }] }]; ButtonCheckboxDirective.propDecorators = { 'btnCheckboxTrue': [{ type: core_1.Input }], 'btnCheckboxFalse': [{ type: core_1.Input }], 'state': [{ type: core_1.HostBinding, args: ['class.active'] }], 'onClick': [{ type: core_1.HostListener, args: ['click'] }] }; return ButtonCheckboxDirective; }(); exports.ButtonCheckboxDirective = ButtonCheckboxDirective; return module.exports; }); $__System.registerDynamic('b', ['45', '47'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var core_1 = $__require('45'); var forms_1 = $__require('47'); /* tslint:disable */ exports.RADIO_CONTROL_VALUE_ACCESSOR = { provide: forms_1.NG_VALUE_ACCESSOR, useExisting: core_1.forwardRef(function () { return ButtonRadioDirective; }), multi: true }; /* tslint:enable */ var ButtonRadioDirective = function () { function ButtonRadioDirective(el) { this.el = el; this.onChange = Function.prototype; this.onTouched = Function.prototype; } Object.defineProperty(ButtonRadioDirective.prototype, "isActive", { get: function () { return this.btnRadio === this.value; }, enumerable: true, configurable: true }); ButtonRadioDirective.prototype.onClick = function () { if (this.el.nativeElement.attributes.disabled) { return; } if (this.uncheckable && this.btnRadio === this.value) { this.value = undefined; } else { this.value = this.btnRadio; } this.onTouched(); this.onChange(this.value); }; ButtonRadioDirective.prototype.ngOnInit = function () { this.uncheckable = typeof this.uncheckable !== 'undefined'; }; ButtonRadioDirective.prototype.onBlur = function () { this.onTouched(); }; // ControlValueAccessor // model -> view ButtonRadioDirective.prototype.writeValue = function (value) { this.value = value; }; ButtonRadioDirective.prototype.registerOnChange = function (fn) { this.onChange = fn; }; ButtonRadioDirective.prototype.registerOnTouched = function (fn) { this.onTouched = fn; }; ButtonRadioDirective.decorators = [{ type: core_1.Directive, args: [{ selector: '[btnRadio]', providers: [exports.RADIO_CONTROL_VALUE_ACCESSOR] }] }]; /** @nocollapse */ ButtonRadioDirective.ctorParameters = [{ type: core_1.ElementRef }]; ButtonRadioDirective.propDecorators = { 'btnRadio': [{ type: core_1.Input }], 'uncheckable': [{ type: core_1.Input }], 'value': [{ type: core_1.Input }], 'isActive': [{ type: core_1.HostBinding, args: ['class.active'] }], 'onClick': [{ type: core_1.HostListener, args: ['click'] }] }; return ButtonRadioDirective; }(); exports.ButtonRadioDirective = ButtonRadioDirective; return module.exports; }); $__System.registerDynamic('c', ['45', '47', 'a', 'b'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var core_1 = $__require('45'); var forms_1 = $__require('47'); var button_checkbox_directive_1 = $__require('a'); var button_radio_directive_1 = $__require('b'); var ButtonsModule = function () { function ButtonsModule() {} ButtonsModule.decorators = [{ type: core_1.NgModule, args: [{ imports: [forms_1.FormsModule], declarations: [button_checkbox_directive_1.ButtonCheckboxDirective, button_radio_directive_1.ButtonRadioDirective], exports: [button_checkbox_directive_1.ButtonCheckboxDirective, button_radio_directive_1.ButtonRadioDirective, forms_1.FormsModule] }] }]; /** @nocollapse */ ButtonsModule.ctorParameters = []; return ButtonsModule; }(); exports.ButtonsModule = ButtonsModule; return module.exports; }); $__System.registerDynamic('e', ['45', '48'], true, function ($__require, exports, module) { // todo: add animate "use strict"; var define, global = this || self, GLOBAL = global; var core_1 = $__require('45'); var ng2_bootstrap_config_1 = $__require('48'); (function (Direction) { Direction[Direction["UNKNOWN"] = 0] = "UNKNOWN"; Direction[Direction["NEXT"] = 1] = "NEXT"; Direction[Direction["PREV"] = 2] = "PREV"; })(exports.Direction || (exports.Direction = {})); var Direction = exports.Direction; // todo: // (ng-swipe-right)="prev()" (ng-swipe-left)="next()" /** * Problems: * 1) if we set an active slide via model changes, .active class remains on a current slide. * 2) if we have only one slide, we shouldn't show prev/next nav buttons * 3) if first or last slide is active and noWrap is true, there should be "disabled" class on the nav buttons. * 4) default interval should be equal 5000 */ var CarouselComponent = function () { function CarouselComponent() { this.slides = []; this.destroyed = false; } Object.defineProperty(CarouselComponent.prototype, "interval", { get: function () { return this._interval; }, set: function (value) { this._interval = value; this.restartTimer(); }, enumerable: true, configurable: true }); Object.defineProperty(CarouselComponent.prototype, "isBS4", { get: function () { return ng2_bootstrap_config_1.Ng2BootstrapConfig.theme === ng2_bootstrap_config_1.Ng2BootstrapTheme.BS4; }, enumerable: true, configurable: true }); CarouselComponent.prototype.ngOnDestroy = function () { this.destroyed = true; }; CarouselComponent.prototype.select = function (nextSlide, direction) { if (direction === void 0) { direction = Direction.UNKNOWN; } var nextIndex = nextSlide.index; if (direction === Direction.UNKNOWN) { direction = nextIndex > this.getCurrentIndex() ? Direction.NEXT : Direction.PREV; } // Prevent this user-triggered transition from occurring if there is // already one in progress if (nextSlide && nextSlide !== this.currentSlide) { this.goNext(nextSlide, direction); } }; CarouselComponent.prototype.play = function () { if (!this.isPlaying) { this.isPlaying = true; this.restartTimer(); } }; CarouselComponent.prototype.pause = function () { if (!this.noPause) { this.isPlaying = false; this.resetTimer(); } }; CarouselComponent.prototype.next = function () { var newIndex = (this.getCurrentIndex() + 1) % this.slides.length; if (newIndex === 0 && this.noWrap) { this.pause(); return; } return this.select(this.getSlideByIndex(newIndex), Direction.NEXT); }; CarouselComponent.prototype.prev = function () { var newIndex = this.getCurrentIndex() - 1 < 0 ? this.slides.length - 1 : this.getCurrentIndex() - 1; if (this.noWrap && newIndex === this.slides.length - 1) { this.pause(); return; } return this.select(this.getSlideByIndex(newIndex), Direction.PREV); }; CarouselComponent.prototype.addSlide = function (slide) { slide.index = this.slides.length; this.slides.push(slide); if (this.slides.length === 1 || slide.active) { this.select(this.slides[this.slides.length - 1]); if (this.slides.length === 1) { this.play(); } } else { slide.active = false; } }; CarouselComponent.prototype.removeSlide = function (slide) { this.slides.splice(slide.index, 1); if (this.slides.length === 0) { this.currentSlide = void 0; return; } for (var i = 0; i < this.slides.length; i++) { this.slides[i].index = i; } }; CarouselComponent.prototype.goNext = function (slide, direction) { if (this.destroyed) { return; } slide.direction = direction; slide.active = true; if (this.currentSlide) { this.currentSlide.direction = direction; this.currentSlide.active = false; } this.currentSlide = slide; // every time you change slides, reset the timer this.restartTimer(); }; CarouselComponent.prototype.getSlideByIndex = function (index) { var len = this.slides.length; for (var i = 0; i < len; ++i) { if (this.slides[i].index === index) { return this.slides[i]; } } return void 0; }; CarouselComponent.prototype.getCurrentIndex = function () { return !this.currentSlide ? 0 : this.currentSlide.index; }; CarouselComponent.prototype.restartTimer = function () { var _this = this; this.resetTimer(); var interval = +this.interval; if (!isNaN(interval) && interval > 0) { this.currentInterval = setInterval(function () { var nInterval = +_this.interval; if (_this.isPlaying && !isNaN(_this.interval) && nInterval > 0 && _this.slides.length) { _this.next(); } else { _this.pause(); } }, interval); } }; CarouselComponent.prototype.resetTimer = function () { if (this.currentInterval) { clearInterval(this.currentInterval); this.currentInterval = void 0; } }; CarouselComponent.decorators = [{ type: core_1.Component, args: [{ selector: 'carousel', template: "\n <div (mouseenter)=\"pause()\" (mouseleave)=\"play()\" class=\"carousel slide\">\n <ol class=\"carousel-indicators\" *ngIf=\"slides.length > 1\">\n <li *ngFor=\"let slidez of slides\" [class.active]=\"slidez.active === true\" (click)=\"select(slidez)\"></li>\n </ol>\n <div class=\"carousel-inner\"><ng-content></ng-content></div>\n <a class=\"left carousel-control\" (click)=\"prev()\" *ngIf=\"slides.length\">\n <span class=\"icon-prev\" aria-hidden=\"true\"></span>\n <span *ngIf=\"isBS4\" class=\"sr-only\">Previous</span>\n </a>\n <a class=\"right carousel-control\" (click)=\"next()\" *ngIf=\"slides.length\">\n <span class=\"icon-next\" aria-hidden=\"true\"></span>\n <span *ngIf=\"isBS4\" class=\"sr-only\">Next</span>\n </a>\n </div>\n " }] }]; /** @nocollapse */ CarouselComponent.ctorParameters = []; CarouselComponent.propDecorators = { 'noWrap': [{ type: core_1.Input }], 'noPause': [{ type: core_1.Input }], 'noTransition': [{ type: core_1.Input }], 'interval': [{ type: core_1.Input }] }; return CarouselComponent; }(); exports.CarouselComponent = CarouselComponent; return module.exports; }); $__System.registerDynamic('10', ['45', 'e'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var core_1 = $__require('45'); var carousel_component_1 = $__require('e'); var SlideComponent = function () { function SlideComponent(carousel) { this.addClass = true; this.carousel = carousel; } SlideComponent.prototype.ngOnInit = function () { this.carousel.addSlide(this); }; SlideComponent.prototype.ngOnDestroy = function () { this.carousel.removeSlide(this); }; SlideComponent.decorators = [{ type: core_1.Component, args: [{ selector: 'slide', template: "\n <div [class.active]=\"active\" class=\"item\">\n <ng-content></ng-content>\n </div>\n " }] }]; /** @nocollapse */ SlideComponent.ctorParameters = [{ type: carousel_component_1.CarouselComponent }]; SlideComponent.propDecorators = { 'index': [{ type: core_1.Input }], 'direction': [{ type: core_1.Input }], 'active': [{ type: core_1.HostBinding, args: ['class.active'] }, { type: core_1.Input }], 'addClass': [{ type: core_1.HostBinding, args: ['class.item'] }, { type: core_1.HostBinding, args: ['class.carousel-item'] }] }; return SlideComponent; }(); exports.SlideComponent = SlideComponent; return module.exports; }); $__System.registerDynamic('f', ['46', '45', 'e', '10'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var common_1 = $__require('46'); var core_1 = $__require('45'); var carousel_component_1 = $__require('e'); var slide_component_1 = $__require('10'); var CarouselModule = function () { function CarouselModule() {} CarouselModule.decorators = [{ type: core_1.NgModule, args: [{ imports: [common_1.CommonModule], declarations: [slide_component_1.SlideComponent, carousel_component_1.CarouselComponent], exports: [slide_component_1.SlideComponent, carousel_component_1.CarouselComponent] }] }]; /** @nocollapse */ CarouselModule.ctorParameters = []; return CarouselModule; }(); exports.CarouselModule = CarouselModule; return module.exports; }); $__System.registerDynamic("12", ["45"], true, function ($__require, exports, module) { "use strict"; // FIX: in order to update to rc.1 had to disable animation, sorry var define, global = this || self, GLOBAL = global; var core_1 = $__require("45"); // import {AnimationBuilder} from '@angular/platform-browser/src/animate/animation_builder'; // import {animate, animation, state, style, transition} from '@angular/core'; /*@Directive({ selector: '[collapse]', // templateUrl: 'app/panel.html', // styleUrls: ['app/panel.css'], animations: [ animation('active', [ state('void', style({ height: 0 })), state('closed', style({ height: 0 })), state('open', style({ height: '*' })), transition('void => closed', [ animate(0) ]), transition('closed => open', [ animate('350ms ease-out') ]), transition('open => closed', [ animate('350ms ease-out') ]) ]) ] })*/ // fix: replace with // '@angular/animate'; // when https://github.com/angular/angular/issues/5984 will be fixed // TODO: remove ElementRef // TODO: add on change // TODO: #576 add callbacks: expanding, collapsing after adding animation var CollapseDirective = function () { function CollapseDirective( /*_ab:AnimationBuilder, */_el, _renderer) { // private animation:any; this.collapsed = new core_1.EventEmitter(false); this.expanded = new core_1.EventEmitter(false); // shown this.isExpanded = true; // hidden this.isCollapsed = false; // stale state this.isCollapse = true; // animation state this.isCollapsing = false; // this._ab = _ab; this._el = _el; this._renderer = _renderer; } Object.defineProperty(CollapseDirective.prototype, "collapse", { get: function () { return this.isExpanded; }, // @Input() private transitionDuration:number = 500; // Duration in ms set: function (value) { this.isExpanded = value; this.toggle(); }, enumerable: true, configurable: true }); CollapseDirective.prototype.ngOnInit = function () { // this.animation = this._ab.css(); // this.animation.setDuration(this.transitionDuration); }; CollapseDirective.prototype.toggle = function () { // this.open = !this.open; if (this.isExpanded) { this.hide(); } else { this.show(); } }; CollapseDirective.prototype.hide = function () { this.isCollapse = false; this.isCollapsing = true; this.isExpanded = false; this.isCollapsed = true; this.isCollapse = true; this.isCollapsing = false; this.display = 'none'; this.collapsed.emit(this); /* setTimeout(() => { // this.height = '0'; // this.isCollapse = true; // this.isCollapsing = false; this.animation .setFromStyles({ height: this._el.nativeElement.scrollHeight + 'px' }) .setToStyles({ height: '0', overflow: 'hidden' }); this.animation.start(this._el.nativeElement) .onComplete(() => { if (this._el.nativeElement.offsetHeight === 0) { this.display = 'none'; } this.isCollapse = true; this.isCollapsing = false; }); }, 4);*/ }; CollapseDirective.prototype.show = function () { this.isCollapse = false; this.isCollapsing = true; this.isExpanded = true; this.isCollapsed = false; this.display = 'block'; // this.height = 'auto'; this.isCollapse = true; this.isCollapsing = false; this._renderer.setElementStyle(this._el.nativeElement, 'overflow', 'visible'); this._renderer.setElementStyle(this._el.nativeElement, 'height', 'auto'); this.expanded.emit(this); /*setTimeout(() => { // this.height = 'auto'; // this.isCollapse = true; // this.isCollapsing = false; this.animation .setFromStyles({ height: this._el.nativeElement.offsetHeight, overflow: 'hidden' }) .setToStyles({ height: this._el.nativeElement.scrollHeight + 'px' }); this.animation.start(this._el.nativeElement) .onComplete(() => { this.isCollapse = true; this.isCollapsing = false; this._renderer.setElementStyle(this._el.nativeElement, 'overflow', 'visible'); this._renderer.setElementStyle(this._el.nativeElement, 'height', 'auto'); }); }, 4);*/ }; CollapseDirective.decorators = [{ type: core_1.Directive, args: [{ selector: '[collapse]' }] }]; /** @nocollapse */ CollapseDirective.ctorParameters = [{ type: core_1.ElementRef }, { type: core_1.Renderer }]; CollapseDirective.propDecorators = { 'collapsed': [{ type: core_1.Output }], 'expanded': [{ type: core_1.Output }], 'display': [{ type: core_1.HostBinding, args: ['style.display'] }], 'isExpanded': [{ type: core_1.HostBinding, args: ['class.in'] }, { type: core_1.HostBinding, args: ['attr.aria-expanded'] }], 'isCollapsed': [{ type: core_1.HostBinding, args: ['attr.aria-hidden'] }], 'isCollapse': [{ type: core_1.HostBinding, args: ['class.collapse'] }], 'isCollapsing': [{ type: core_1.HostBinding, args: ['class.collapsing'] }], 'collapse': [{ type: core_1.Input }] }; return CollapseDirective; }(); exports.CollapseDirective = CollapseDirective; return module.exports; }); $__System.registerDynamic('13', ['45', '12'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var core_1 = $__require('45'); var collapse_directive_1 = $__require('12'); var CollapseModule = function () { function CollapseModule() {} CollapseModule.decorators = [{ type: core_1.NgModule, args: [{ declarations: [collapse_directive_1.CollapseDirective], exports: [collapse_directive_1.CollapseDirective] }] }]; /** @nocollapse */ CollapseModule.ctorParameters = []; return CollapseModule; }(); exports.CollapseModule = CollapseModule; return module.exports; }); $__System.registerDynamic('15', ['45', '49', '47'], true, function ($__require, exports, module) { "use strict"; var define, global = this || self, GLOBAL = global; var core_1 = $__require('45'); var datepicker_inner_component_1 = $__require('49'); var forms_1 = $__require('47'); /* tslint:disable:component-selector-name component-selector-type */ /* tslint:enable:component-selector-name component-selector-type */ var DatePickerComponent = function () { function DatePickerComponent(cd) { this.selectionDone = new core_1.EventEmitter(undefined); this.onChange = Function.prototype; this.onTouched = Function.prototype; this._now = new Date(); this.cd = cd; // hack cd.valueAccessor = this; } Object.defineProperty(DatePickerComponent.prototype, "activeDate", { get: function () { return this._activeDate || this._now; }, set: function (value) { this._activeDate = value; }, enumerable: true, configurable: true }); DatePickerComponent.prototype.onUpdate = function (event) { this.cd.viewToModelUpdate(event); }; DatePickerComponent.prototype.onSelectionDone = function (event) { this.selectionDone.emit(event); }; // todo: support null value DatePickerComponent.prototype.writeValue = function (value) { if (this._datePicker.compare(value, this._activeDate) === 0) { return; } if (value && value instanceof Date) { this.activeDate = value; this._datePicker.select(value, false); return; } this.activeDate = value ? new Date(value) : void 0; }; DatePickerComponent.prototype.registerOnChange = function (fn) { this.onChange = fn; }; DatePickerComponent.prototype.registerOnTouched = function (fn) { this.onTouched = fn; }; DatePickerComponent.decorators = [{ type: core_1.Component, args: [{ selector: 'datepicker[ngModel]', template: "\n <datepicker-inner [activeDate]=\"activeDate\"\n (update)=\"onUpdate($event)\"\n [datepickerMode]=\"datepickerMode\"\n [initDate]=\"initDate\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [minMode]=\"minMode\"\n [maxMode]=\"maxMode\"\n [showWeeks]=\"showWeeks\"\n [formatDay]=\"formatDay\"\n [formatMonth]=\"formatMonth\"\n [formatYear]=\"formatYear\"\n [formatDayHeader]=\"formatDayHeader\"\n [formatDayTitle]=\"formatDayTitle\"\n [formatMonthTitle]=\"formatMonthTitle\"\n [startingDay]=\"startingDay\"\n [yearRange]=\"yearRange\"\n [customClass]=\"customClass\"\n