@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
40 lines (38 loc) • 2.87 kB
JavaScript
/**
* CodeAnalizerComment: Updated 1 imports on 2024-09-22 14:49:52
* Update:: import { IAnySourceItem } to '@mikezimm/fps-core-v7/lib/components/molecules/AnyContent/IAnyContent;'
*/
/**
* CodeAnalizerComment: Updated 1 imports on 2024-09-21 23:07:24
* Update:: import { IAnySourceItem } to '@mikezimm/fps-core-v7/lib/components/molecules/AnyContent/IAnyContent;'
*/
import * as React from 'react';
// import styles from './SourceSearch.module.scss';
import { SearchBox } from '@fluentui/react/lib/SearchBox';
import PageArrows from '../../Arrows/PageArrows';
// import { IAnySourceItem, } from '@mikezimm/fps-core-v7/lib/components/molecules/AnyContent/IAnyContent'; // ./../AnyContent/IAnyContent';
require('@mikezimm/fps-styles/dist/searchBoxRow.css');
const SourceSearchAgeHook = (props) => {
const { searchText, searchTime, _onSearchChange, _updateFirstLastVisible, debugMode, resetArrows, itemsPerPage, itemCount, disabled } = props;
// I don't think checking counts will work here as
// NOTE this itemCount <= itemsPerPage should be verified with -1, -= +1 actual items.
// const pageArrows = itemCount <= itemsPerPage ? undefined : <PageArrows
const pageArrows = React.createElement(PageArrows, { disabled: disabled, itemCount: itemCount, itemsPerPage: itemsPerPage, setParentStateFirstLast: _updateFirstLastVisible.bind(this), debugMode: debugMode, fontSize: 20, resetArrows: resetArrows, pageArrowStyles: props.layout === 'block' ? { paddingLeft: '0px' } : {} });
const containerClass = props.layout === 'block' ? 'searchContainerBlock' : props.layout === 'flex' ? 'searchContainerFlex' : 'searchContainerGrid';
/*https://developer.microsoft.com/en-us/fabric#/controls/web/searchbox*/
const searchBox = React.createElement("div", { className: [containerClass].join(' ') },
React.createElement(SearchBox, { className: 'searchBox', styles: { root: { maxWidth: 250 } }, placeholder: "Search", value: searchText, onSearch: _onSearchChange, onFocus: () => console.log('onFocus called'), onBlur: () => console.log('onBlur called'), onChange: _onSearchChange, onClear: _onSearchChange }),
React.createElement("div", { className: 'searchStatus forceColorWhiteOnDefWhite' },
'Searching ' + itemCount + ' items',
searchTime === null ? '' : ' ~ ' + searchTime + ' ms'),
props.farLeftEle ? props.farLeftEle : undefined,
React.createElement("div", null,
props.preArrowsEle ? props.preArrowsEle : undefined,
pageArrows,
props.postArrowsEle ? props.postArrowsEle : undefined),
props.ageElement ? props.ageElement : undefined,
props.farRightEle ? props.farRightEle : undefined);
return (searchBox);
};
export default SourceSearchAgeHook;
//# sourceMappingURL=SearchBoxRowAge.js.map