office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
18 lines (16 loc) • 1.89 kB
JavaScript
define(["require", "exports", "tslib", "react", "../../../../Utilities", "../../../../Persona", "../../BasePicker.Props", "../../../../Button", "./PickerItemsDefault.scss"], function (require, exports, tslib_1, React, Utilities_1, Persona_1, BasePicker_Props_1, Button_1, stylesImport) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var styles = stylesImport;
exports.SelectedItemDefault = function (peoplePickerItemProps) {
var item = peoplePickerItemProps.item, onRemoveItem = peoplePickerItemProps.onRemoveItem, index = peoplePickerItemProps.index, selected = peoplePickerItemProps.selected, removeButtonAriaLabel = peoplePickerItemProps.removeButtonAriaLabel;
return (React.createElement("div", { className: Utilities_1.css('ms-PickerPersona-container', styles.personaContainer, (_a = {}, _a['is-selected ' + styles.personaContainerIsSelected] = selected, _a), (_b = {}, _b['is-invalid ' + styles.validationError] = item.ValidationState === BasePicker_Props_1.ValidationState.warning, _b)), "data-is-focusable": true, "data-selection-index": index },
React.createElement("div", { className: Utilities_1.css('ms-PickerItem-content', styles.itemContent) },
React.createElement(Persona_1.Persona, tslib_1.__assign({}, item, { presence: item.presence !== undefined ? item.presence : Persona_1.PersonaPresence.none, size: Persona_1.PersonaSize.size28 }))),
React.createElement(Button_1.IconButton, { onClick: function () { if (onRemoveItem) {
onRemoveItem();
} }, iconProps: { iconName: 'Cancel', style: { fontSize: '12px' } }, className: Utilities_1.css('ms-PickerItem-removeButton', styles.removeButton), "data-is-focusable": false, ariaLabel: removeButtonAriaLabel })));
var _a, _b;
};
});
//# sourceMappingURL=SelectedItemDefault.js.map