本文整理汇总了TypeScript中app/widgets/WidgetRole.WidgetRole类的典型用法代码示例。如果您正苦于以下问题:TypeScript WidgetRole类的具体用法?TypeScript WidgetRole怎么用?TypeScript WidgetRole使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WidgetRole类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Field
function Field() {
var domElement = createDOMElement('field');
this.domElement = domElement;
WidgetRole.apply(this, [domElement]);
}
示例2: PersonSection2
export function PersonSection2(titleText, fieldValues) {
var domElement = createTitledContainer(titleText);
WidgetRole.apply(this, [domElement]);
var FieldList = IndividualFieldList;
var defaultPersonTypeName = fieldValues['gen-persoană'] || FieldList.PERSON_TYPE_NAME;
var personTypeField = createPersonTypeField(defaultPersonTypeName);
personTypeField.appendTo(domElement);
personTypeField.onChange(function(newPersonTypeName) {
personTypeSpecificFieldList.remove();
FieldList = newPersonTypeName === IndividualFieldList.PERSON_TYPE_NAME ?
IndividualFieldList : CompanyFieldList;
personTypeSpecificFieldList = new FieldList(fieldValues);
personTypeSpecificFieldList.appendTo(domElement);
});
var personTypeSpecificFieldList = new FieldList(fieldValues);
personTypeSpecificFieldList.appendTo(domElement);
this.getFieldValues = function() {
var personTypeSpecificFieldValues = personTypeSpecificFieldList.getFieldValues();
var ownFieldValues = {
'gen-persoană': personTypeField.getValue()
};
return _.extend(ownFieldValues, personTypeSpecificFieldValues);
};
}
示例3: ActivitiesSection
export function ActivitiesSection() {
var domElement = createElement();
WidgetRole.apply(this, [domElement]);
var activityListContainer = createActivityListContainer();
var addActivityButton = createAddActivityButton(addActivity);
var section = new Section('Acţiuni procedurale');
section.appendWidgets([
activityListContainer,
addActivityButton
]);
section.appendTo(domElement);
this.setActivities = function(activitiesArray) {
activitiesArray.forEach(addActivityFromData);
};
function addActivityFromData(activityData) {
var ActivityWidgetClass = ActivityWidgetClasses[activityData.widgetClassName];
var activityWidget = ActivityWidgetClass.createWithData(activityData);
addActivity(activityWidget);
}
function addActivity(activityWidget) {
activityWidget.appendTo(activityListContainer);
}
}
示例4: NewCaseButton
export function NewCaseButton() {
var domElement = createElement();
WidgetRole.apply(this, [domElement]);
this.onClick = function(f) {
domElement.addEventListener('click', f);
};
}
示例5: FieldLabel
export function FieldLabel(text, childWidgets) {
var domElement = createElement();
WidgetRole.apply(this, [domElement]);
var textSpan = createTextSpan(text);
appendWidgets(both(textSpan, childWidgets)).to(domElement);
}
示例6: ActivityDetailsSection
export function ActivityDetailsSection() {
var domElement = createElement();
WidgetRole.apply(this, [domElement]);
this.setChildWidgets = function(childWidgets) {
resetChildren(domElement, childWidgets);
};
}
示例7: CompletionLabel
export function CompletionLabel(completionTime) {
assert(_.isDate(completionTime), 'CompletionLabel expects the completionTime argument to be a Date object');
var domElement = createElement();
WidgetRole.apply(this, [domElement]);
addContent(domElement, completionTime);
this.getData = delegateTo(completionTime, 'toISOString');
}
示例8: 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');
}
示例9: 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');
}
示例10: 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');
}