示例#1
0
var Panel = (function () {
    function Panel() {
        this.collapsed = false;
        this.onBeforeToggle = new core_1.EventEmitter();
        this.onAfterToggle = new core_1.EventEmitter();
    }
    Panel.prototype.toggle = function (event) {
        this.onBeforeToggle.emit({ originalEvent: event, collapsed: this.collapsed });
        if (this.toggleable) {
            if (this.collapsed)
                this.expand(event);
            else
                this.collapse(event);
        }
        this.onAfterToggle.emit({ originalEvent: event, collapsed: this.collapsed });
        event.preventDefault();
    };
    Panel.prototype.expand = function (event) {
        this.collapsed = false;
    };
    Panel.prototype.collapse = function (event) {
        this.collapsed = true;
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Boolean)
    ], Panel.prototype, "toggleable", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', String)
    ], Panel.prototype, "header", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Boolean)
    ], Panel.prototype, "collapsed", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Object)
    ], Panel.prototype, "style", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', String)
    ], Panel.prototype, "styleClass", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], Panel.prototype, "onBeforeToggle", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], Panel.prototype, "onAfterToggle", void 0);
    Panel = __decorate([
        core_1.Component({
            selector: 'p-panel',
            template: "\n        <div [ngClass]=\"'ui-panel ui-widget ui-widget-content ui-corner-all'\" [ngStyle]=\"style\" [class]=\"styleClass\">\n            <div class=\"ui-panel-titlebar ui-widget-header ui-helper-clearfix ui-corner-all\">\n                <span class=\"ui-panel-title\" *ngIf=\"header\">{{header}}</span>\n                <ng-content select=\"header\"></ng-content>\n                <a *ngIf=\"toggleable\" class=\"ui-panel-titlebar-icon ui-panel-titlebar-toggler ui-corner-all ui-state-default\" href=\"#\"\n                    [ngClass]=\"{'ui-state-hover':hoverToggler}\" (mouseenter)=\"hoverToggler=true\" (mouseleave)=\"hoverToggler=false\" (click)=\"toggle($event)\">\n                    <span class=\"fa fa-fw\" [ngClass]=\"{'fa-minus': !collapsed,'fa-plus':collapsed}\"></span>\n                </a>\n            </div>\n            <div class=\"ui-panel-content ui-widget-content\" [style.display]=\"collapsed ? 'none' : 'block'\">\n                <ng-content></ng-content>\n            </div>\n        </div>\n    "
        }), 
        __metadata('design:paramtypes', [])
    ], Panel);
    return Panel;
}());
示例#2
0
var TodoItem = (function () {
    function TodoItem(differs) {
        this.editMode = false;
        this.done = new core_1.EventEmitter();
        this.edit = new core_1.EventEmitter();
        this.differ = differs.find([]).create(null);
    }
    TodoItem.prototype.ngDoCheck = function () {
        var changes = this.differ.diff(this._item);
        if (changes) {
            changes.forEachAddedItem(function (r) { return console.log('added', r); });
            changes.forEachRemovedItem(function (r) { return console.log('removed', r); });
            changes.forEachChangedItem(function (r) { return console.log('changed', r); });
        }
    };
    Object.defineProperty(TodoItem.prototype, "item", {
        set: function (value) {
            this._item = value;
        },
        enumerable: true,
        configurable: true
    });
    TodoItem.prototype.doneClicked = function () {
        this.done.next(this._item);
    };
    TodoItem.prototype.editClicked = function () {
        this.editMode = !this.editMode;
        if (this.editMode)
            return;
        this.edit.next(this._item);
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', TodoService_1.TodoItemModel), 
        __metadata('design:paramtypes', [TodoService_1.TodoItemModel])
    ], TodoItem.prototype, "item", null);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', Object)
    ], TodoItem.prototype, "done", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', Object)
    ], TodoItem.prototype, "edit", void 0);
    TodoItem = __decorate([
        core_1.Component({
            selector: 'todo-item',
            template: "\n                <div class=\"view\">\n                    <input [(ngModel)]=\"_item.task\" class=\"editInput\" *ngIf=\"editMode\" value=\"{{_item.task}}\"/>\n                    <label  *ngIf=\"!editMode\">{{_item.getKey('task')}}</label>\n                    <button (click)=\"doneClicked()\"  class=\"fa fa-minus buttonsDone\"></button>\n                    <button (click)=\"editClicked()\" [ngClass]=\"{'fa-check-square': editMode}\" class=\"fa fa-edit buttonsEdit\"></button>\n                </div>\n    ",
            styleUrls: ['../comps/app1/todos/Todoitem.css'],
            changeDetection: core_1.ChangeDetectionStrategy.OnPush
        }), 
        __metadata('design:paramtypes', [core_1.KeyValueDiffers])
    ], TodoItem);
    return TodoItem;
}());
示例#3
0
var MdInput = (function () {
    function MdInput() {
        this.mdChange = new async_1.EventEmitter();
        this.mdFocusChange = new async_1.EventEmitter(false);
    }
    Object.defineProperty(MdInput.prototype, "value", {
        get: function () {
            return !lang_1.isBlank(this._value) ? this._value : '';
        },
        set: function (value) {
            this._value = value;
            async_1.ObservableWrapper.callEmit(this.mdChange, this.value);
        },
        enumerable: true,
        configurable: true
    });
    MdInput.prototype.setHasFocus = function (hasFocus) {
        async_1.ObservableWrapper.callEmit(this.mdFocusChange, hasFocus);
    };
    __decorate([
        core_1.Input('value'), 
        __metadata('design:type', String), 
        __metadata('design:paramtypes', [String])
    ], MdInput.prototype, "value", null);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', String)
    ], MdInput.prototype, "placeholder", void 0);
    __decorate([
        core_1.Output('valueChange'), 
        __metadata('design:type', async_1.EventEmitter)
    ], MdInput.prototype, "mdChange", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', async_1.EventEmitter)
    ], MdInput.prototype, "mdFocusChange", void 0);
    MdInput = __decorate([
        core_1.Directive({
            selector: 'input[md-input],input.md-input,textarea[md-input],textarea.md-input',
            host: {
                'class': 'md-input',
                '[value]': 'value',
                '(input)': 'value=$event.target.value',
                '(focus)': 'setHasFocus(true)',
                '(blur)': 'setHasFocus(false)'
            },
            providers: [common_1.FORM_PROVIDERS]
        }), 
        __metadata('design:paramtypes', [])
    ], MdInput);
    return MdInput;
}());
示例#4
0
var TravelListComponent = (function () {
    function TravelListComponent() {
        this.pagerEvent = new core_1.EventEmitter();
    }
    TravelListComponent.prototype.changePage = function (event) {
        console.log("pageIschangeing", event);
        this.pagerEvent.emit(event);
    };
    TravelListComponent.prototype.ngOnInit = function () {
    };
    __decorate([
        core_1.Input()
    ], TravelListComponent.prototype, "travels", void 0);
    __decorate([
        core_1.Input()
    ], TravelListComponent.prototype, "title", void 0);
    __decorate([
        core_1.Output()
    ], TravelListComponent.prototype, "pagerEvent", void 0);
    TravelListComponent = __decorate([
        core_1.Component({
            // Declare the tag name in index.html to where the component attaches
            selector: 'travel-list',
            // Location of the template for this component
            templateUrl: './app/travel/travel-list.component.html',
            directives: [travel_item_component_1.TravelItemComponent, pagging_component_1.PaggingComponent]
        })
    ], TravelListComponent);
    return TravelListComponent;
}());
var UserList = (function () {
    function UserList() {
        this.selectionChange = new core_1.EventEmitter();
    }
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Array)
    ], UserList.prototype, "users", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', UserModel_1.UserModel)
    ], UserList.prototype, "selectedUser", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], UserList.prototype, "selectionChange", void 0);
    UserList = __decorate([
        core_1.Component({
            selector: "user-list",
            templateUrl: common_1.TemplateUrl("user/templates/user-list.component.html")
        }), 
        __metadata('design:paramtypes', [])
    ], UserList);
    return UserList;
})();
示例#6
0
文件: ink.js 项目: EngineCrew/WebPage
var MdInk = (function () {
    function MdInk(_element) {
        this._element = _element;
        this.inked = new core_1.EventEmitter(false);
    }
    MdInk.prototype.onMousedown = function (event) {
        var _this = this;
        if (this._element && ink_1.Ink.canApply(this._element.nativeElement)) {
            ink_1.Ink.rippleEvent(this._element.nativeElement, event).then(function () {
                _this.inked.emit(_this);
            });
        }
    };
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], MdInk.prototype, "inked", void 0);
    MdInk = __decorate([
        core_1.Directive({
            selector: '[md-ink]',
            host: {
                '(mousedown)': 'onMousedown($event)'
            },
        }), 
        __metadata('design:paramtypes', [core_1.ElementRef])
    ], MdInk);
    return MdInk;
}());
var StarComponent = (function () {
    function StarComponent() {
        this.ratingClicked = new core_1.EventEmitter();
    }
    StarComponent.prototype.ngOnChanges = function () {
        this.starWidth = this.rating * 86 / 5;
    };
    StarComponent.prototype.onClick = function () {
        console.log('StarComponent -> star is clicked');
        this.ratingClicked.emit("The rating " + this.rating + " was clicked!");
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Number)
    ], StarComponent.prototype, "rating", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], StarComponent.prototype, "ratingClicked", void 0);
    StarComponent = __decorate([
        core_1.Component({
            selector: 'ai-star',
            templateUrl: 'app/shared/star.component.html',
            styleUrls: ['app/shared/star.component.css']
        }), 
        __metadata('design:paramtypes', [])
    ], StarComponent);
    return StarComponent;
}());
var MessageComponent = (function () {
    function MessageComponent(_messageService) {
        this._messageService = _messageService;
        this.editClicked = new core_1.EventEmitter();
        this.show = true;
    }
    MessageComponent.prototype.onEdit = function () {
        this._messageService.editMessage(this.message);
    };
    MessageComponent.prototype.onDelete = function () {
        this._messageService.deleteMessage(this.message);
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Message_1.Message)
    ], MessageComponent.prototype, "message", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', Object)
    ], MessageComponent.prototype, "editClicked", void 0);
    MessageComponent = __decorate([
        core_1.Component({
            selector: 'my-message',
            template: "\n        <article class=\"panel panel-default\" *ngIf=\"show\">\n            <div class=\"panel-body\">\n                {{ message.content }}\n            </div>                \n            <footer class=\"panel-footer\">\n                <div class=\"author\">\n                    @{{ message.userName }}\n                </div>\n                <div class=\"config\">\n                    <a href=\"#\" (click)=\"onEdit()\">Edit</a>\n                    <a href=\"#\" (click)=\"onDelete()\" >Delete</a>\n                </div>\n            </footer>\n        </article>\n    ",
            styles: ["\n        .author{\n            display: inline-block;\n            font-style: italic;\n            font-size: 12px;\n            width: 80%;        \n        }\n        .config{\n            display: inline-block;\n            text-align: right;\n            font-size: 12px;\n            width: 19%;      \n        }\n    "]
        }), 
        __metadata('design:paramtypes', [message_service_1.MessageService])
    ], MessageComponent);
    return MessageComponent;
}());
var BookingTypeListComponent = (function () {
    function BookingTypeListComponent() {
        this.rowClicked = new core_1.EventEmitter();
        this.columns = [{ title: 'Booking Type Name', fieldName: 'bookingTypeName' }];
    }
    BookingTypeListComponent.prototype.fireRowClicked = function (row) {
        this.rowClicked.next(row);
    };
    BookingTypeListComponent.prototype.ngOnChanges = function (changes) {
        for (var propName in changes) {
            var prop = changes[propName];
            var cur = JSON.stringify(prop.currentValue);
            var prev = JSON.stringify(prop.previousValue);
            console.log(propName + ": currentValue = " + cur + ", previousValue = " + prev);
        }
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Array)
    ], BookingTypeListComponent.prototype, "bookingTypes", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], BookingTypeListComponent.prototype, "rowClicked", void 0);
    BookingTypeListComponent = __decorate([
        core_1.Component({
            selector: 'bookingtype-list',
            templateUrl: './companies/components/bookingtypelist.component.html',
            providers: [],
            directives: [table_component_1.MyTableComponent]
        }), 
        __metadata('design:paramtypes', [])
    ], BookingTypeListComponent);
    return BookingTypeListComponent;
}());
var UserProfile = (function () {
    function UserProfile() {
        this.addUser = new core_1.EventEmitter();
        this.model = new UserModel_1.UserModel(0, '', '', true, 'Male');
        this.sexList = ['Female', 'Male', 'Not Decided'];
    }
    UserProfile.prototype.onSubmit = function (event) {
        //here i want to update the list in just one click.
        //question is how to do that ?
    };
    Object.defineProperty(UserProfile.prototype, "diagnostic", {
        // TODO: Remove this when we're done
        get: function () { return JSON.stringify(this.model); },
        enumerable: true,
        configurable: true
    });
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], UserProfile.prototype, "addUser", void 0);
    UserProfile = __decorate([
        core_1.Component({
            selector: "user-profile",
            templateUrl: common_1.TemplateUrl("user/templates/user-form.component.html")
        }), 
        __metadata('design:paramtypes', [])
    ], UserProfile);
    return UserProfile;
})();
var ModalFooter = (function () {
    function ModalFooter() {
        /**
         * Emitted when a button was clicked
         * @type {EventEmitter<FooterButtonClickEvent>}
         */
        this.onButtonClick = new core_1.EventEmitter();
    }
    ModalFooter.prototype.onClick = function (btn, $event) {
        this.onButtonClick.emit({ btn: btn, $event: $event });
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', String)
    ], ModalFooter.prototype, "footerClass", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Array)
    ], ModalFooter.prototype, "buttons", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', Object)
    ], ModalFooter.prototype, "onButtonClick", void 0);
    ModalFooter = __decorate([
        core_1.Component({
            selector: 'modal-footer',
            template: "<div [ngClass]=\"footerClass\">\n    <button *ngFor=\"let btn of buttons;\"\n            [ngClass]=\"btn.cssClass\"\n            (click)=\"onClick(btn, $event)\">{{btn.caption}}</button>\n</div>"
        }), 
        __metadata('design:paramtypes', [])
    ], ModalFooter);
    return ModalFooter;
}());
示例#12
0
var NextInput = (function () {
    function NextInput() {
        this.focused = new core_1.EventEmitter();
    }
    NextInput.prototype.receivedFocus = function () {
        this.focused.emit(true);
    };
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], NextInput.prototype, "focused", void 0);
    __decorate([
        core_1.HostListener('focus'), 
        __metadata('design:type', Function), 
        __metadata('design:paramtypes', []), 
        __metadata('design:returntype', void 0)
    ], NextInput.prototype, "receivedFocus", null);
    NextInput = __decorate([
        core_1.Directive({
            selector: '[next-input]'
        }), 
        __metadata('design:paramtypes', [])
    ], NextInput);
    return NextInput;
})();
示例#13
0
var SplitButtonItem = (function () {
    function SplitButtonItem() {
        this.onClick = new core_1.EventEmitter();
    }
    __decorate([
        core_1.Input(), 
        __metadata('design:type', String)
    ], SplitButtonItem.prototype, "icon", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', String)
    ], SplitButtonItem.prototype, "label", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Object)
    ], SplitButtonItem.prototype, "url", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], SplitButtonItem.prototype, "onClick", void 0);
    SplitButtonItem = __decorate([
        core_1.Component({
            selector: 'p-splitButtonItem',
            template: "\n        \n    "
        }), 
        __metadata('design:paramtypes', [])
    ], SplitButtonItem);
    return SplitButtonItem;
})();
示例#14
0
var Pop1 = (function () {
    function Pop1() {
        this.display = false;
        //output �̺�Ʈ ���� ����.
        this.addEvent = new core_1.EventEmitter();
    }
    Pop1.prototype.add = function () {
        this.addEvent.emit('event');
    };
    Pop1.prototype.show = function () {
        console.log('pop1 show');
        this.display = true;
    };
    Pop1.prototype.hide = function () {
        this.display = false;
    };
    __decorate([
        core_1.Output(), 
        __metadata('design:type', Object)
    ], Pop1.prototype, "addEvent", void 0);
    Pop1 = __decorate([
        core_1.Component({
            selector: 'pop1',
            templateUrl: 'showcase/pop/pop1.html',
            directives: [dialog_1.Dialog, button_1.Button]
        }), 
        __metadata('design:paramtypes', [])
    ], Pop1);
    return Pop1;
}());
var TravelViewDaysContainerComponent = (function () {
    function TravelViewDaysContainerComponent() {
        this.showRouteFunction = new core_1.EventEmitter();
    }
    TravelViewDaysContainerComponent.prototype.findRoute = function (travel) {
        this.showRouteFunction.emit(travel.TravelDays);
    };
    TravelViewDaysContainerComponent.prototype.scrollDetails = function (right) {
        var scroll = right ? 300 : -300;
        // this.itemsContainer.scrollLeft += scroll;
        $(this.itemsContainer).animate({ scrollLeft: this.itemsContainer.scrollLeft + scroll }, 500);
    };
    TravelViewDaysContainerComponent.prototype.ngOnInit = function () {
        this.itemsContainer = document.getElementById("travel_days_details");
    };
    __decorate([
        core_1.Output("show-route")
    ], TravelViewDaysContainerComponent.prototype, "showRouteFunction", void 0);
    __decorate([
        core_1.Input("days")
    ], TravelViewDaysContainerComponent.prototype, "days", void 0);
    TravelViewDaysContainerComponent = __decorate([
        core_1.Component({
            selector: 'travel-days-container',
            templateUrl: './app/travel/travel-view-days-container.component.html',
            providers: [],
            directives: [travel_view_days_item_component_1.TravelViewDaysItemComponent]
        })
    ], TravelViewDaysContainerComponent);
    return TravelViewDaysContainerComponent;
}());
示例#16
0
var NameComponent = (function () {
    function NameComponent(friendService) {
        this.nameChange = new core_1.EventEmitter();
        console.log(friendService);
    }
    NameComponent.prototype.changeName = function () {
        this.nameChange.emit(this.testName + '!!!');
    };
    __decorate([
        core_1.Input('name'), 
        __metadata('design:type', String)
    ], NameComponent.prototype, "testName", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], NameComponent.prototype, "nameChange", void 0);
    NameComponent = __decorate([
        core_1.Component({
            selector: 'name-component',
            template: "\n        <div>Hello my name is {{name}}</div>\n        <button (click)=\"changeName()\">Change my name</button>\n    ",
        }), 
        __metadata('design:paramtypes', [friends_1.FriendService])
    ], NameComponent);
    return NameComponent;
}());
示例#17
0
var PartsView = (function () {
    function PartsView() {
        this.parts = [];
        this.partsInCart = [];
        this.partsInCartLookup = {};
        this.addToCart = new core_1.EventEmitter();
    }
    PartsView.prototype.ngOnChanges = function (changeRecord) {
        this.partsInCartLookup = partsInCartLookupSelector(changeRecord);
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Object)
    ], PartsView.prototype, "parts", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Object)
    ], PartsView.prototype, "partsInCart", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], PartsView.prototype, "addToCart", void 0);
    PartsView = __decorate([
        core_1.Component({
            selector: 'parts',
            template: "\n        <table>\n            <tr *ngFor=\"#part of parts\">\n                <td>\n                    <button style=\"margin-right:10px;margin-bottom:3px;margin-top:3px\"\n                        [disabled]=\"partsInCartLookup[part.id]\"\n                        (click)=\"addToCart.next(part.id)\">add\n                    </button>\n                </td>\n                <td>{{part.name}}</td>\n            </tr>\n        </table>\n    ",
            changeDetection: core_1.ChangeDetectionStrategy.OnPush
        }), 
        __metadata('design:paramtypes', [])
    ], PartsView);
    return PartsView;
}());
示例#18
0
var RadioButton = (function () {
    function RadioButton() {
        this.click = new core_1.EventEmitter();
        this.modelChange = new core_1.EventEmitter();
    }
    RadioButton.prototype.onclick = function () {
        this.click.next(null);
        this.modelChange.next(this.value);
    };
    RadioButton.prototype.isChecked = function () {
        return this.value == this.model;
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Object)
    ], RadioButton.prototype, "value", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', String)
    ], RadioButton.prototype, "name", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Boolean)
    ], RadioButton.prototype, "disabled", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Object)
    ], RadioButton.prototype, "model", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], RadioButton.prototype, "click", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], RadioButton.prototype, "modelChange", void 0);
    RadioButton = __decorate([
        core_1.Component({
            selector: 'p-radio',
            template: "\n        <div class=\"ui-radiobutton ui-widget\">\n            <div class=\"ui-helper-hidden-accessible\">\n                <input type=\"radio\" [attr.name]=\"name\" [attr.value]=\"value\" [checked]=\"isChecked()\"/>\n            </div>\n            <div class=\"ui-radiobutton-box ui-widget ui-radiobutton-relative ui-state-default\" (click)=\"onclick()\"\n                        (mouseover)=\"hover=true\" (mouseout)=\"hover=false\" [ngClass]=\"{'ui-state-hover':hover,'ui-state-active':isChecked(),'ui-state-disabled':disabled}\">\n                <span class=\"ui-radiobutton-icon\" [ngClass]=\"{'fa fa-fw fa-circle':isChecked()}\"></span>\n            </div>\n        </div>\n    "
        }), 
        __metadata('design:paramtypes', [])
    ], RadioButton);
    return RadioButton;
})();
示例#19
0
var TabButton = (function (_super) {
    __extends(TabButton, _super);
    function TabButton(config, elementRef) {
        _super.call(this, elementRef);
        this.select = new core_1.EventEmitter();
        this.disHover = (config.get('hoverCSS') === false);
        this._layout = config.get('tabbarLayout');
    }
    TabButton.prototype.ngOnInit = function () {
        this.tab.btn = this;
        this._layout = this.tab.parent.tabbarLayout || this._layout;
        this.hasTitle = !!this.tab.tabTitle;
        this.hasIcon = !!this.tab.tabIcon && this._layout !== 'icon-hide';
        this.hasTitleOnly = (this.hasTitle && !this.hasIcon);
        this.hasIconOnly = (this.hasIcon && !this.hasTitle);
        this.hasBadge = !!this.tab.tabBadge;
    };
    TabButton.prototype.onClick = function () {
        this.select.emit(this.tab);
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', tab_1.Tab)
    ], TabButton.prototype, "tab", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], TabButton.prototype, "select", void 0);
    __decorate([
        core_1.HostListener('click'), 
        __metadata('design:type', Function), 
        __metadata('design:paramtypes', []), 
        __metadata('design:returntype', void 0)
    ], TabButton.prototype, "onClick", null);
    TabButton = __decorate([
        core_1.Directive({
            selector: '.tab-button',
            host: {
                '[attr.id]': 'tab._btnId',
                '[attr.aria-controls]': 'tab._panelId',
                '[attr.aria-selected]': 'tab.isSelected',
                '[class.has-title]': 'hasTitle',
                '[class.has-icon]': 'hasIcon',
                '[class.has-title-only]': 'hasTitleOnly',
                '[class.icon-only]': 'hasIconOnly',
                '[class.has-badge]': 'hasBadge',
                '[class.disable-hover]': 'disHover'
            }
        }), 
        __metadata('design:paramtypes', [config_1.Config, core_1.ElementRef])
    ], TabButton);
    return TabButton;
}(ion_1.Ion));
示例#20
0
var Accordion = (function () {
    function Accordion(el) {
        this.el = el;
        this.onClose = new core_1.EventEmitter();
        this.onOpen = new core_1.EventEmitter();
        this.tabs = [];
    }
    Accordion.prototype.addTab = function (tab) {
        this.tabs.push(tab);
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Boolean)
    ], Accordion.prototype, "multiple", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], Accordion.prototype, "onClose", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], Accordion.prototype, "onOpen", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', String)
    ], Accordion.prototype, "style", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', String)
    ], Accordion.prototype, "styleClass", void 0);
    Accordion = __decorate([
        core_1.Component({
            selector: 'p-accordion',
            template: "\n        <div [ngClass]=\"'ui-accordion ui-widget ui-helper-reset'\" [attr.style]=\"style\" [attr.class]=\"styleClass\">\n            <ng-content></ng-content>\n        </div>\n    ",
        }), 
        __metadata('design:paramtypes', [core_1.ElementRef])
    ], Accordion);
    return Accordion;
})();
var Filterbar = (function () {
    function Filterbar() {
        this.apply = new core_1.EventEmitter();
        this.remove = new core_1.EventEmitter();
        this.filterType = '';
        this.filterValue = '';
    }
    Filterbar.prototype.applyFilter = function () {
        if (!this.filterType || !this.filterValue)
            return;
        var filter = this.filterType + ' like "%' + this.filterValue + '%"';
        this.apply.next(filter);
    };
    Filterbar.prototype.removeFilter = function () {
        this.remove.next();
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Object)
    ], Filterbar.prototype, "dataModel", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], Filterbar.prototype, "apply", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], Filterbar.prototype, "remove", void 0);
    Filterbar = __decorate([
        core_1.Component({
            selector: 'filterbar',
            template: "\n\n    <div class=\"well well-sm\">\n      <div class=\"row\">\n        <div class=\"form-group col-xs-12 col-md-3\">\n          <label>Filter by</label>\n          <select class=\"form-control\" [(ngModel)]=\"filterType\">\n            <option value=\"\">Please Select</option>\n            <option *ngFor=\"#field of dataModel.field\" value=\"{{field.name}}\">{{field.label}}</option>\n          </select>\n        </div>\n        <div class=\"form-group col-xs-12 col-md-3\">\n          <label>Filter value</label>\n          <input class=\"form-control\" [(ngModel)]=\"filterValue\"/>\n        </div>\n        <div class=\"form-group col-xs-12 col-md-3\">\n          <label>&nbsp;</label>\n          <div class=\"btn-group\">\n            <button type=\"button\" class=\"btn btn-default btn-sm\" (click)=\"applyFilter()\">\n              Apply\n            </button>\n            <button type=\"button\" class=\"btn btn-default btn-sm\" (click)=\"removeFilter()\">\n              Remove\n            </button>\n          </div>\n        </div>\n      </div>\n    </div>\n  ",
            styles: ["\n\n  "]
        }), 
        __metadata('design:paramtypes', [])
    ], Filterbar);
    return Filterbar;
})();
示例#22
0
var Alert = (function () {
    function Alert() {
        this.type = 'warning';
        this.close = new core_1.EventEmitter();
        this.classes = [];
    }
    Alert.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
    Alert.prototype.onClose = function () {
        this.closed = true;
        this.close.emit(this);
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', String)
    ], Alert.prototype, "type", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Boolean)
    ], Alert.prototype, "dismissible", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Number)
    ], Alert.prototype, "dismissOnTimeout", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], Alert.prototype, "close", void 0);
    Alert = __decorate([
        core_1.Component({
            selector: 'alert',
            directives: [common_1.NgIf, common_1.NgClass],
            template: ALERT_TEMPLATE
        }), 
        __metadata('design:paramtypes', [])
    ], Alert);
    return Alert;
}());
示例#23
0
var PeopleListComponent = (function () {
    function PeopleListComponent(_log, _router, _peopleService) {
        this._log = _log;
        this._router = _router;
        this._peopleService = _peopleService;
        this.rowClicked = new core_1.EventEmitter();
        this.columns = [{ title: 'First Name', fieldName: 'firstName' },
            { title: 'Last Name', fieldName: 'lastName' },
            { title: 'Mobile', fieldName: 'mobile' },
            { title: 'Address', fieldName: 'address' }];
    }
    PeopleListComponent.prototype.ngOnInit = function () {
        var _this = this;
        this._peopleService.getPeople(this.personIds).subscribe(function (data) { _this.people = data; });
        this._log.log('will view personIds = ', this.personIds);
    };
    PeopleListComponent.prototype.fireRowClicked = function (row) {
        this._log.log("People -> clicked row = ", row);
        this.rowClicked.next(row);
    };
    PeopleListComponent.prototype.setCompanyData = function () {
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', String)
    ], PeopleListComponent.prototype, "tableTitle", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', String)
    ], PeopleListComponent.prototype, "buttonLabel", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Array)
    ], PeopleListComponent.prototype, "personIds", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], PeopleListComponent.prototype, "rowClicked", void 0);
    PeopleListComponent = __decorate([
        core_1.Component({
            selector: 'people-list',
            templateUrl: './people/components/peoplelist.component.html',
            providers: [],
            directives: [table_component_1.MyTableComponent]
        }), 
        __metadata('design:paramtypes', [logging_service_1.MyLogger, router_1.Router, people_services_1.PeopleService])
    ], PeopleListComponent);
    return PeopleListComponent;
}());
示例#24
0
var RadioButton = (function () {
    function RadioButton() {
        this.click = new core_1.EventEmitter();
        this.onModelChange = function () { };
        this.onModelTouched = function () { };
    }
    RadioButton.prototype.onclick = function () {
        this.click.emit(null);
        this.checked = true;
        this.onModelChange(this.value);
    };
    RadioButton.prototype.writeValue = function (model) {
        this.model = model;
        this.checked = (this.model == this.value);
    };
    RadioButton.prototype.registerOnChange = function (fn) {
        this.onModelChange = fn;
    };
    RadioButton.prototype.registerOnTouched = function (fn) {
        this.onModelTouched = fn;
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Object)
    ], RadioButton.prototype, "value", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', String)
    ], RadioButton.prototype, "name", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Boolean)
    ], RadioButton.prototype, "disabled", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], RadioButton.prototype, "click", void 0);
    RadioButton = __decorate([
        core_1.Component({
            selector: 'p-radioButton',
            template: "\n        <div class=\"ui-radiobutton ui-widget\">\n            <div class=\"ui-helper-hidden-accessible\">\n                <input type=\"radio\" [attr.name]=\"name\" [attr.value]=\"value\" [checked]=\"checked\" (blur)=\"onModelTouched()\">\n            </div>\n            <div class=\"ui-radiobutton-box ui-widget ui-radiobutton-relative ui-state-default\" (click)=\"onclick()\"\n                        (mouseover)=\"hover=true\" (mouseout)=\"hover=false\" [ngClass]=\"{'ui-state-hover':hover,'ui-state-active':checked,'ui-state-disabled':disabled}\">\n                <span class=\"ui-radiobutton-icon\" [ngClass]=\"{'fa fa-fw fa-circle':checked}\"></span>\n            </div>\n        </div>\n    ",
            providers: [RADIO_VALUE_ACCESSOR]
        }), 
        __metadata('design:paramtypes', [])
    ], RadioButton);
    return RadioButton;
})();
var EsriSceneViewComponent = (function () {
    function EsriSceneViewComponent(_mapService, _viewCoordinationService, elRef) {
        this._mapService = _mapService;
        this._viewCoordinationService = _viewCoordinationService;
        this.elRef = elRef;
        this.viewCreated = new core_1.EventEmitter();
        this.view = null;
    }
    EsriSceneViewComponent.prototype.ngOnInit = function () {
        this.view = new esri_mods_1.SceneView({
            container: this.elRef.nativeElement.firstChild,
            map: this._mapService.map,
            zoom: this._viewCoordinationService.zoom,
            center: this._viewCoordinationService.center,
            rotation: this._viewCoordinationService.rotation
        });
        this.view.then(function (view) {
            this.viewCreated.next(view);
        }.bind(this));
        this.view.watch('camera', function (newVal, oldVal, propertyName) {
            this._viewCoordinationService.setValue(newVal, propertyName);
        }.bind(this));
    };
    EsriSceneViewComponent.prototype.syncCamera = function (delaySync) {
        if (delaySync) {
            this.view.animateTo(this._viewCoordinationService.camera, {
                delay: 700
            });
        }
        else {
            this.view.camera = this._viewCoordinationService.camera;
        }
    };
    __decorate([
        core_1.Output()
    ], EsriSceneViewComponent.prototype, "viewCreated", void 0);
    EsriSceneViewComponent = __decorate([
        core_1.Component({
            selector: 'esri-scene-view',
            template: '<div></div>',
            providers: [map_service_1.SimpleMapService]
        })
    ], EsriSceneViewComponent);
    return EsriSceneViewComponent;
}());
示例#26
0
var PortletAddDlg = (function () {
    function PortletAddDlg() {
        this.display = false;
        this.addEvent = new core_1.EventEmitter();
    }
    PortletAddDlg.prototype.ngOnInit = function () {
        this.cars = [{ "type": "p01212121", "name": "p01212121" },
            { "type": "p01212121", "name": "p01212121" },
            { "type": "p01212121", "name": "p01212121" },
            { "type": "p01212121", "name": "p01212121" },
            { "type": "p01212121", "name": "p01212121" },
            { "type": "p01212121", "name": "p01212121" },
            { "type": "p01212121", "name": "p01212121" },
            { "type": "p01212121", "name": "p01212121" },
            { "type": "p01212121", "name": "p01212121" },
            { "type": "p01212121", "name": "p01212121" },
            { "type": "p01212121", "name": "p01212121" },
            { "type": "p01212121", "name": "p01212121" },
            { "type": "p01212122", "name": "p01212122" }];
    };
    PortletAddDlg.prototype.add = function () {
        this.addEvent.emit('event');
    };
    PortletAddDlg.prototype.show = function () {
        console.log('pop1 show');
        this.display = true;
    };
    PortletAddDlg.prototype.hide = function () {
        this.display = false;
    };
    __decorate([
        core_1.Output(), 
        __metadata('design:type', Object)
    ], PortletAddDlg.prototype, "addEvent", void 0);
    PortletAddDlg = __decorate([
        core_1.Component({
            selector: 'portlet_add_dlg',
            templateUrl: 'showcase/pop/PortletAddDlg.html',
            directives: [dialog_1.Dialog, button_1.Button, datatable_1.DataTable, column_1.Column, header_1.Header, tabpanel_1.TabPanel, tabview_1.TabView, codehighlighter_1.CodeHighlighter]
        }), 
        __metadata('design:paramtypes', [])
    ], PortletAddDlg);
    return PortletAddDlg;
}());
示例#27
0
var ContactList = (function () {
    function ContactList() {
        this.personSelected = new core_1.EventEmitter();
    }
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Object)
    ], ContactList.prototype, "contactGroups", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', Object)
    ], ContactList.prototype, "personSelected", void 0);
    ContactList = __decorate([
        core_1.Component({
            selector: 'contact-list',
            template: "\n  <h3><span class=\"glyphicon glyphicon-user\" aria-hidden=\"true\"></span> Contacts</h3>\n      <div *ngFor=\"#group of contactGroups\" class=\"contact-list\">\n        <h4 class=\"small\">{{group.letter}}</h4>\n        <div class=\"list-group\">\n          <button\n              *ngFor=\"#contact of group.contacts\"\n              (click)=\"personSelected.emit(contact)\"\n              type=\"button\"\n              class=\"list-group-item\"\n              >{{contact.name.last}}, {{contact.name.first}}</button>\n        </div>\n      </div>"
        }), 
        __metadata('design:paramtypes', [])
    ], ContactList);
    return ContactList;
})();
示例#28
0
var StatusSelector = (function () {
    function StatusSelector() {
        this.select = new core_1.EventEmitter();
        this.statuses = ['Started', 'Completed'];
    }
    StatusSelector.prototype.ngOnInit = function () {
        this.select.emit(this.statuses[0]);
    };
    __decorate([
        core_1.Output(), 
        __metadata('design:type', Object)
    ], StatusSelector.prototype, "select", void 0);
    StatusSelector = __decorate([
        core_1.Component({
            selector: 'status-selector',
            template: "\n        <label>View tasks</label>\n        <select #sel (change)=\"select.emit(sel.value)\">\n            <option *ngFor=\"#status of statuses\" > {{status}}</option>\n        </select>"
        }), 
        __metadata('design:paramtypes', [])
    ], StatusSelector);
    return StatusSelector;
})();
示例#29
0
var TodoListRender = (function () {
    function TodoListRender() {
        this.toggle = new core_1.EventEmitter();
    }
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Object)
    ], TodoListRender.prototype, "todo", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', Object)
    ], TodoListRender.prototype, "toggle", void 0);
    TodoListRender = __decorate([
        core_1.Component({
            selector: 'todo-list-render',
            styles: ["\n        .Completed {\n            text-decoration: line-through;\n        }\n    "],
            template: "\n                <div class=\"todo-container\">\n                    <input type=\"checkbox\" (change)=\"toggle.emit(todo)\">\n                    <span [ngClass]=\"todo.status\">{{todo.title}}</span>\n                </div>\n\n                "
        }), 
        __metadata('design:paramtypes', [])
    ], TodoListRender);
    return TodoListRender;
})();
示例#30
0
var NewTodoInput = (function () {
    function NewTodoInput() {
        this.newTodo = {};
        this.create = new core_1.EventEmitter();
    }
    NewTodoInput.prototype.saveTodo = function () {
        this.newTodo.completed = false;
        this.create.emit(this.newTodo);
        this.newTodo = {};
    };
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], NewTodoInput.prototype, "create", void 0);
    NewTodoInput = __decorate([
        core_1.Component({
            selector: 'new-todo-input',
            template: "\n        <div>\n            <input type=\"text\" [(ngModel)] = \"newTodo.text\" />\n            <button (click)=\"saveTodo()\">Save</button>\n        </div>\n    "
        }), 
        __metadata('design:paramtypes', [])
    ], NewTodoInput);
    return NewTodoInput;
}());