UNPKG

ferngully-aurelia-tools

Version:

Ferngully Tools for Aurelia

88 lines 4.76 kB
System.register(["aurelia-framework", "../editable-input-element-service", "./editable-inline-input.css"], function (exports_1, context_1) { "use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __moduleName = context_1 && context_1.id; var aurelia_framework_1, editable_input_element_service_1, EditableInlineInput; return { setters: [ function (aurelia_framework_1_1) { aurelia_framework_1 = aurelia_framework_1_1; }, function (editable_input_element_service_1_1) { editable_input_element_service_1 = editable_input_element_service_1_1; }, function (_1) { } ], execute: function () { EditableInlineInput = (function () { function EditableInlineInput(editableInputElementService) { this.editableInputElementService = editableInputElementService; this.classEx = null; } EditableInlineInput.prototype.bind = function () { this.editableInputElementService.editor = $(this.textbox); if (this.classEx) { this.editableInputElementService.editor.addClass(this.classEx); } }; EditableInlineInput.prototype.show = function (element, data, currentValue, onKeyPress, onSave) { this.editableInputElementService._show(element); this.editableInputElementService.value = currentValue; var textbox = $(this.textbox); textbox.focus(); textbox.select(); textbox.on("keydown.editable-inline-input", onKeyPress); textbox.on("blur.editable-inline-input", onSave); }; EditableInlineInput.prototype.hide = function () { this.editableInputElementService._hide(); var textbox = $(this.textbox); textbox.off("keydown.editable-inline-input"); textbox.off("blur.editable-inline-input"); }; Object.defineProperty(EditableInlineInput.prototype, "value", { get: function () { return this.editableInputElementService.value; }, enumerable: true, configurable: true }); Object.defineProperty(EditableInlineInput.prototype, "maxLength", { get: function () { return this.editableInputElementService.maxLength; }, enumerable: true, configurable: true }); EditableInlineInput.prototype.detached = function () { this.editableInputElementService.detached(); }; EditableInlineInput.prototype.attached = function () { this.editableInputElementService.attached(); }; __decorate([ aurelia_framework_1.bindable, __metadata("design:type", Object) ], EditableInlineInput.prototype, "classEx", void 0); EditableInlineInput = __decorate([ aurelia_framework_1.containerless, aurelia_framework_1.autoinject, aurelia_framework_1.customElement('editable-inline-input'), __metadata("design:paramtypes", [editable_input_element_service_1.EditableInputElementService]) ], EditableInlineInput); return EditableInlineInput; }()); exports_1("EditableInlineInput", EditableInlineInput); } }; }); //# sourceMappingURL=editable-inline-input.js.map