当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript WidgetRole.WidgetRole类代码示例

本文整理汇总了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]);
    }
开发者ID:gurdiga,项目名称:xo,代码行数:7,代码来源:WidgetRoleTest.ts

示例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);
  };
}
开发者ID:gurdiga,项目名称:xo,代码行数:32,代码来源:PersonSection2.ts

示例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);
  }
}
开发者ID:gurdiga,项目名称:xo,代码行数:31,代码来源:ActivitiesSection.ts

示例4: NewCaseButton

export function NewCaseButton() {
  var domElement = createElement();
  WidgetRole.apply(this, [domElement]);

  this.onClick = function(f) {
    domElement.addEventListener('click', f);
  };
}
开发者ID:gurdiga,项目名称:xo,代码行数:8,代码来源:NewCaseButton.ts

示例5: FieldLabel

export function FieldLabel(text, childWidgets) {
  var domElement = createElement();
  WidgetRole.apply(this, [domElement]);

  var textSpan = createTextSpan(text);

  appendWidgets(both(textSpan, childWidgets)).to(domElement);
}
开发者ID:gurdiga,项目名称:xo,代码行数:8,代码来源:FieldLabel.ts

示例6: ActivityDetailsSection

export function ActivityDetailsSection() {
  var domElement = createElement();
  WidgetRole.apply(this, [domElement]);

  this.setChildWidgets = function(childWidgets) {
    resetChildren(domElement, childWidgets);
  };
}
开发者ID:gurdiga,项目名称:xo,代码行数:8,代码来源:ActivityDetailsSection.ts

示例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');
}
开发者ID:gurdiga,项目名称:xo,代码行数:10,代码来源:CompletionLabel.ts

示例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');
}
开发者ID:gurdiga,项目名称:xo,代码行数:11,代码来源:LabeledTextField.ts

示例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');
}
开发者ID:gurdiga,项目名称:xo,代码行数:11,代码来源:DateField.ts

示例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');
}
开发者ID:gurdiga,项目名称:xo,代码行数:11,代码来源:LabeledLargeTextField.ts


注:本文中的app/widgets/WidgetRole.WidgetRole类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。