{"code":"import * as tslib_1 from \"tslib\";\r\nimport * as React from 'react';\r\nimport { createRef, classNamesFunction } from 'office-ui-fabric-react/lib/Utilities';\r\nimport { Callout } from 'office-ui-fabric-react/lib/Callout';\r\nimport { SearchBox as FabricSearchBox } from 'office-ui-fabric-react/lib/SearchBox';\r\nimport { GroupedList } from 'office-ui-fabric-react/lib/components/GroupedList/index';\r\nimport { DetailsRow } from 'office-ui-fabric-react/lib/components/DetailsList/DetailsRow';\r\nimport { Selection, SelectionMode } from 'office-ui-fabric-react/lib/utilities/selection/index';\r\nimport './SearchBox.css';\r\nvar getClassNames = classNamesFunction();\r\nvar SearchBoxBase = (function (_super) {\r\n    tslib_1.__extends(SearchBoxBase, _super);\r\n    function SearchBoxBase(props) {\r\n        var _this = _super.call(this, props) || this;\r\n        _this._searchElement = createRef();\r\n        _this.onFocus = function () {\r\n            _this.setState({\r\n                isSearchCalloutVisible: true\r\n            });\r\n            _this.props.onFocus ? _this.props.onFocus() : null;\r\n        };\r\n        _this.onBlur = function () {\r\n            _this.props.onBlur ? _this.props.onBlur() : null;\r\n        };\r\n        _this.onSearch = function (search) {\r\n            _this._onSearchCalloutDismiss();\r\n            _this.props.onSearch(search);\r\n        };\r\n        _this._onSearchCalloutDismiss = function () {\r\n            _this.setState({\r\n                isSearchCalloutVisible: false\r\n            });\r\n        };\r\n        _this.state = {\r\n            isSearchCalloutVisible: false,\r\n            items: [],\r\n            groups: []\r\n        };\r\n        _this._onRenderCell = _this._onRenderCell.bind(_this);\r\n        _this._selection = new Selection({\r\n            onSelectionChanged: function () {\r\n                _this.props.onSelectionChanged ? _this.props.onSelectionChanged(_this._selection.getSelection()) : null;\r\n            }\r\n        });\r\n        return _this;\r\n    }\r\n    SearchBoxBase.getDerivedStateFromProps = function (props, state) {\r\n        var groups = [];\r\n        var items = [];\r\n        var itemIdx = 0;\r\n        if (props.groupItems)\r\n            props.groupItems.forEach(function (element) {\r\n                element.items.forEach(function (item) {\r\n                    item.onItemClick = element.onItemClick;\r\n                });\r\n                groups = groups.concat([{ key: element.key, name: element.name, startIndex: itemIdx, count: element.items.length }]);\r\n                items = items.concat(element.items);\r\n                itemIdx = itemIdx + element.items.length;\r\n            });\r\n        return { groups: groups, items: items };\r\n    };\r\n    SearchBoxBase.prototype.onItemClick = function (item) {\r\n        this.setState({ input: item.input, isSearchCalloutVisible: false });\r\n        item.onItemClick(item);\r\n    };\r\n    SearchBoxBase.prototype.onRenderRow = function (item) {\r\n        return item.onRenderColumns(item);\r\n    };\r\n    SearchBoxBase.prototype._onRenderCell = function (nestingDepth, item, itemIndex) {\r\n        var _this = this;\r\n        var selection = this._selection;\r\n        return (<div onClick={function (event) { return _this.onItemClick(item); }}>\r\n        <DetailsRow columns={this.onRenderRow(item)} groupNestingDepth={nestingDepth} item={item} itemIndex={itemIndex} selection={selection} selectionMode={SelectionMode.none} className=\"sbRows\" indentWidth={this.props.indentWidth}/>\r\n      </div>);\r\n    };\r\n    SearchBoxBase.prototype.render = function () {\r\n        var _a = this.props, className = _a.className, styles = _a.styles, theme = _a.theme;\r\n        var classNames = getClassNames(styles, { theme: theme, className: className });\r\n        return (<div className={\"\" + classNames.root}>\r\n        <div ref={this._searchElement}>\r\n          <FabricSearchBox placeholder={this.props.placeholder ? this.props.placeholder : 'Search'} value={this.state.input ? this.state.input : this.props.value} underlined={this.props.underlined} onFocus={this.onFocus} onBlur={this.onBlur} onChange={this.props.onChange} onClear={this.props.onClear} onSearch={this.onSearch} theme={theme} styles={styles}/>\r\n        </div>\r\n\r\n        <Callout ariaLabelledBy={'callout-label-1'} ariaDescribedBy={'callout-description-1'} role={'alertdialog'} gapSpace={1} isBeakVisible={false} onDismiss={this._onSearchCalloutDismiss} setInitialFocus={true} hidden={!this.state.isSearchCalloutVisible} target={this._searchElement.value} theme={theme} styles={styles}>\r\n          <GroupedList items={this.state.items || []} onRenderCell={this._onRenderCell} selection={this._selection} selectionMode={SelectionMode.none} groups={this.state.groups} groupProps={{\r\n            showEmptyGroups: true\r\n        }} theme={theme} styles={styles}/>\r\n        </Callout>\r\n      </div>);\r\n    };\r\n    return SearchBoxBase;\r\n}(React.PureComponent));\r\nexport { SearchBoxBase };\r\nexport default SearchBoxBase;\r\n//# sourceMappingURL=SearchBox.base.jsx.map","map":"{\"version\":3,\"file\":\"SearchBox.base.jsx\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../src/lib/components/SearchBox/SearchBox.base.tsx\"],\"names\":[],\"mappings\":\";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAErF,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,WAAW,EAAU,MAAM,yDAAyD,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,sDAAsD,CAAC;AAIhG,OAAO,iBAAiB,CAAC;AAUzB,IAAM,aAAa,GAAG,kBAAkB,EAA0C,CAAC;AAEnF;IAAmC,yCAAqD;IAItF,uBAAY,KAAU;QAAtB,YACE,kBAAM,KAAK,CAAC,SAcb;QAlBO,oBAAc,GAAG,SAAS,EAAe,CAAC;QAuC1C,aAAO,GAAG;YAChB,KAAI,CAAC,QAAQ,CAAC;gBACZ,sBAAsB,EAAE,IAAI;aAC7B,CAAC,CAAC;YAEH,KAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACnD,CAAC,CAAC;QAEM,YAAM,GAAG;YACf,KAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,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iBAAiB,CAAC,CAClC,eAAe,CAAC,CAAC,uBAAuB,CAAC,CACzC,IAAI,CAAC,CAAC,aAAa,CAAC,CACpB,QAAQ,CAAC,CAAC,CAAC,CAAC,CACZ,aAAa,CAAC,CAAC,KAAK,CAAC,CACrB,SAAS,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CACxC,eAAe,CAAC,CAAC,IAAI,CAAC,CACtB,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAC3C,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAClC,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;UAAA,CAAC,WAAW,CACV,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAC9B,YAAY,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CACjC,SAAS,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAC3B,aAAa,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAClC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAC1B,UAAU,CAAC,CAAC;YACV,eAAe,EAAE,IAAI;SACtB,CAAC,CACF,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,MAAM,CAAC,CAAC,MAAM,CAAC,EAEnB;QAAA,EAAE,OAAO,CACX;MAAA,EAAE,GAAG,CAAC,CACP,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AA7ID,CAAmC,KAAK,CAAC,aAAa,GA6IrD;;AAED,eAAe,aAAa,CAAC\"}","dts":{"name":"C:/WORK/ImageTag/GIT/enchoice-fabric-react-lib/lib/components/SearchBox/SearchBox.base.d.ts","writeByteOrderMark":false,"text":"import * as React from 'react';\r\nimport { IGroup } from 'office-ui-fabric-react/lib/components/GroupedList/index';\r\nimport { ISearchBoxProps } from './SearchBox.types';\r\nimport './SearchBox.css';\r\nexport interface ISearchBoxState {\r\n    isSearchCalloutVisible: boolean;\r\n    items: any[];\r\n    groups: IGroup[];\r\n    input?: string;\r\n}\r\nexport declare class SearchBoxBase extends React.PureComponent<ISearchBoxProps, ISearchBoxState> {\r\n    private _searchElement;\r\n    private _selection;\r\n    constructor(props: any);\r\n    static getDerivedStateFromProps(props: ISearchBoxProps, state: ISearchBoxState): {\r\n        groups: any[];\r\n        items: any[];\r\n    };\r\n    private onFocus;\r\n    private onBlur;\r\n    private onSearch;\r\n    private _onSearchCalloutDismiss;\r\n    private onItemClick;\r\n    private onRenderRow;\r\n    private _onRenderCell;\r\n    render(): JSX.Element;\r\n}\r\nexport default SearchBoxBase;\r\n"}}
