本文整理汇总了TypeScript中app/utils/delegateTo.delegateTo函数的典型用法代码示例。如果您正苦于以下问题:TypeScript delegateTo函数的具体用法?TypeScript delegateTo怎么用?TypeScript delegateTo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了delegateTo函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: DateFieldInput
export function DateFieldInput(value) {
var input = new TextFieldInput(value);
var datePickerButton = createDatePickerButton(this);
this.getValue = delegateTo(input, 'getValue');
this.setValue = delegateTo(input, 'setValue');
this.focus = delegateTo(input, 'focus');
this.addDatePicker = delegateTo(input, 'precedeWith');
this.setStyle = delegateTo(input, 'setStyle');
this.appendTo = function(parentDomElement) {
input.appendTo(parentDomElement);
parentDomElement.appendChild(datePickerButton);
};
this.getDate = function() {
var text = input.getValue();
return text ? DateFormatting.parse(text, DateFieldInput.DATE_FORMAT) : new Date();
};
this.setDate = function(date) {
var formattedDate = DateFormatting.format(date, DateFieldInput.DATE_FORMAT);
input.setValue(formattedDate);
};
}
示例2: Section
export function Section(labelText) {
var container = createContainer(labelText);
this.appendTo = delegateTo(container, 'appendTo');
this.setStyle = delegateTo(container, 'setStyle');
this.appendWidgets = delegateTo(container, 'appendWidgets');
}
示例3: DateField
export function DateField(defaultValue) {
var domElement = createDOMElement('date-field');
WidgetRole.apply(this, [domElement]);
var dateFieldInput = new DateFieldInput(defaultValue);
dateFieldInput.appendTo(domElement);
this.getValue = delegateTo(dateFieldInput, 'getValue');
this.focus = delegateTo(dateFieldInput, 'focus');
this.setStyle = delegateTo(dateFieldInput, 'setStyle');
}
示例4: LabeledLargeTextField
export function LabeledLargeTextField(labelText, value) {
var domElement = createElement();
WidgetRole.apply(this, [domElement]);
var textarea = createTextareaElement(value);
var label = new FieldLabel(labelText, [textarea]);
label.appendTo(domElement);
this.focus = delegateTo(textarea, 'focus');
this.getValue = delegateTo(textarea, 'value');
}
示例5: before
before(function() {
date = new Date();
date.format = 'YY-MM-DD';
date.falsyProperty = '';
dateWrapper = {
toString: delegateTo(date, 'toString'),
getFormat: delegateTo(date, 'format'),
getFalsyProperty: delegateTo(date, 'falsyProperty')
};
});
示例6: LabeledTextField
export function LabeledTextField(labelText, value) {
var domElement = createElement();
WidgetRole.apply(this, [domElement]);
var input = new TextFieldInput(value);
addLabel(domElement, labelText, input);
this.getValue = delegateTo(input, 'getValue');
this.focus = delegateTo(input, 'focus');
}
示例7: LabeledDateField
export function LabeledDateField(labelText, value) {
var domElement = createElement();
WidgetRole.apply(this, [domElement]);
var input = new DateField(value);
var label = new FieldLabel(labelText, [input]);
label.appendTo(domElement);
this.getValue = delegateTo(input, 'getValue');
this.focus = delegateTo(input, 'focus');
this.setStyle = delegateTo(input, 'setStyle');
}
示例8: InstitutionActivity
export function InstitutionActivity() {
var descriptionText = 'Intentarea';
var activity = new Activity('InstitutionActivity', descriptionText);
var todoList = new TodoList();
activity.setDetailWidgets([todoList]);
this.getDescription = delegateTo(activity, 'getDescription');
this.appendTo = delegateTo(activity, 'appendTo');
this.setDetailWidgets = delegateTo(activity, 'setDetailWidgets');
this.setData = function(data) {
todoList.setData(data['todo-items']);
};
}
示例9: RefusalActivity
export function RefusalActivity() {
var descriptionText = 'Refuz';
var activity = new Activity('RefusalActivity', descriptionText);
activity.setDetailWidgets([
document.createTextNode('RefusalActivity TODO')
]);
this.getDescription = delegateTo(activity, 'getDescription');
this.appendTo = delegateTo(activity, 'appendTo');
this.setData = function() {
// TODO
};
}
示例10: TextFieldInput
export function TextFieldInput(value) {
var domElement = createElement(value);
WidgetRole.apply(this, [domElement]);
this.getValue = delegateTo(domElement, 'value');
this.setValue = function(value) {
domElement.value = value;
};
this.focus = delegateTo(domElement, 'focus');
this.precedeWith = function(elementToInsert) {
domElement.parentNode.insertBefore(elementToInsert, domElement);
};
}