本文整理汇总了TypeScript中app/utils/getFieldValueCollector.getFieldValueCollector函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getFieldValueCollector函数的具体用法?TypeScript getFieldValueCollector怎么用?TypeScript getFieldValueCollector使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getFieldValueCollector函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('works with an array of fields', function() {
getValue = getFieldValueCollector([field1, field2]);
assert.deepEqual(getValue(), {
'name': 'John Doe',
'date-of-birth': '01.01.1970'
}, 'the returned function returns the values of the fields keyed by their internalName');
});
示例2: PersonSection
export function PersonSection(labelText, fieldValues) {
fieldValues = fieldValues || {};
var domElement = createElement();
WidgetRole.apply(this, [domElement]);
var personTypeField = createPersonTypeField(fieldValues);
var personTypeSpecificFields = createPersonTypeSpecificFields(fieldValues);
personTypeField.onChange(renderPersonTypeSpecificFields);
var section = new Section(labelText);
section.appendWidgets(getAllFields());
section.appendTo(domElement);
this.makeRemovable = function(onRemoveCallback) {
var buttonStyle = {
top: '10px',
fontSize: '20px',
color: 'black'
};
makeRemovable(domElement, onRemoveCallback, buttonStyle);
hideRemoveButtonUnlessOver();
};
this.getValue = getFieldValueCollector(getAllFields);
function getAllFields() {
return [personTypeField].concat(personTypeSpecificFields);
}
function renderPersonTypeSpecificFields(personType) {
personTypeSpecificFields.forEach(removeField);
fieldValues[PERSON_TYPE_INTERNAL_NAME] = personType;
personTypeSpecificFields = createPersonTypeSpecificFields(fieldValues);
section.appendWidgets(personTypeSpecificFields);
personTypeSpecificFields[0].focus();
}
function hideRemoveButtonUnlessOver() {
var removeButton = domElement.querySelector('button[type="remove"]');
var initialOpacity = removeButton.style.opacity;
removeButton.style.opacity = '0';
domElement.addEventListener('mouseenter', function() {
removeButton.style.opacity = initialOpacity;
});
domElement.addEventListener('mouseleave', function() {
removeButton.style.opacity = '0';
});
}
}
示例3: SentenceSection
export function SentenceSection(fieldValues) {
var domElement = createElement();
WidgetRole.apply(this, [domElement]);
var fields = createFields(fieldValues);
var section = new Section('Document executoriu');
section.appendWidgets(fields);
section.appendTo(domElement);
this.getValue = getFieldValueCollector(fields);
}
示例4: InquirySection
export function InquirySection(fieldValues) {
var domElement = createDOMElement('INQUIRY-SECTION');
var childWidgets = [
createField(LabeledTextField, 'Numărul de înregistrare', 'numărul-de-înregistrare', fieldValues),
createField(LabeledDateField, 'Data depunerii cererii', 'data-depunerii', fieldValues)
];
var section = createSection(childWidgets);
section.appendTo(domElement);
this.getValue = getFieldValueCollector(childWidgets);
this.appendTo = getAppenderOf(domElement);
this.setStyle = getStylerOf(domElement);
}
示例5: IndividualFieldList
export function IndividualFieldList(fieldValues) {
var domElement = createDOMElement('person-field-list');
WidgetRole.apply(this, [domElement]);
var fields = [
createField(LabeledTextField, 'Nume', 'nume', fieldValues),
createField(LabeledTextField, 'IDNP', 'idnp', fieldValues),
createField(LabeledDateField, 'Data nașterii', 'data-nașterii', fieldValues),
createField(LabeledLargeTextField, 'Domiciliu', 'domiciliu', fieldValues),
createField(LabeledLargeTextField, 'Note', 'note', fieldValues)
];
appendWidgets(fields).to(domElement);
this.getFieldValues = getFieldValueCollector(fields);
}
示例6: CompanyFieldList
export function CompanyFieldList(fieldValues) {
var domElement = createDOMElement('company-field-list');
WidgetRole.apply(this, [domElement]);
var fields = [
createField(LabeledTextField, 'Denumire', 'denumire', fieldValues),
createField(LabeledTextField, 'IDNO', 'idno', fieldValues),
createField(LabeledLargeTextField, 'Sediu', 'sediu', fieldValues),
createField(LabeledTextField, 'Persoană de contact', 'persoană-de-contact', fieldValues),
createField(LabeledLargeTextField, 'Note', 'note', fieldValues)
];
appendWidgets(fields).to(domElement);
this.getFieldValues = getFieldValueCollector(fields);
}
示例7: getFieldValueCollector
assert.throws(function() {
var getValue = getFieldValueCollector([field1, field2, { internalName: 'yes' }]);
getValue();
},