(props)
| 19064 | var _iconButton = require("../controls/iconButton"); |
| 19065 | var _language = require("../language"); |
| 19066 | function DataBrowser(props) { |
| 19067 | function activateRecord(newIndex) { |
| 19068 | props.onActivate(props.data[newIndex], newIndex); |
| 19069 | } |
| 19070 | const { index } = props; |
| 19071 | const length = props.data && props.data.length || 0; |
| 19072 | const dropdownRef = (0, _base.base).react.createRef(); |
| 19073 | props.explorer.dialogFocusHandler.focus = ()=>{ |
| 19074 | var _a; |
| 19075 | return (_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.focus(); |
| 19076 | }; |
| 19077 | return (0, _base.base).react.createElement((0, _group.Group), { |
| 19078 | label: (0, _language.strings).labelDataBrowser, |
| 19079 | className: "sanddance-dataIndex" |
| 19080 | }, (0, _base.base).react.createElement((0, _dropdown.Dropdown), { |
| 19081 | componentRef: dropdownRef, |
| 19082 | label: (0, _language.strings).labelDataScope, |
| 19083 | collapseLabel: true, |
| 19084 | options: [ |
| 19085 | { |
| 19086 | key: (0, _dataScope.DataScopeId).AllData, |
| 19087 | text: (0, _language.strings).selectDataSpanAll, |
| 19088 | isSelected: props.selectedDataScope === (0, _dataScope.DataScopeId).AllData |
| 19089 | }, |
| 19090 | { |
| 19091 | key: (0, _dataScope.DataScopeId).FilteredData, |
| 19092 | text: (0, _language.strings).selectDataSpanFilter, |
| 19093 | isSelected: props.selectedDataScope === (0, _dataScope.DataScopeId).FilteredData |
| 19094 | }, |
| 19095 | { |
| 19096 | key: (0, _dataScope.DataScopeId).SelectedData, |
| 19097 | text: (0, _language.strings).selectDataSpanSelection, |
| 19098 | isSelected: props.selectedDataScope === (0, _dataScope.DataScopeId).SelectedData |
| 19099 | } |
| 19100 | ], |
| 19101 | onChange: (e, o)=>{ |
| 19102 | props.onDataScopeClick(o.key); |
| 19103 | } |
| 19104 | }), !props.data && (0, _base.base).react.createElement("div", { |
| 19105 | dangerouslySetInnerHTML: { |
| 19106 | __html: props.nullMessage |
| 19107 | } |
| 19108 | }), props.data && !props.data.length && (0, _base.base).react.createElement("div", null, props.zeroMessage), !!length && (0, _base.base).react.createElement("div", null, (0, _base.base).react.createElement("div", { |
| 19109 | className: "index" |
| 19110 | }, (0, _base.base).react.createElement((0, _iconButton.IconButton), { |
| 19111 | themePalette: props.themePalette, |
| 19112 | iconName: "ChevronLeftMed", |
| 19113 | onClick: (e)=>activateRecord(index <= 0 ? length - 1 : index - 1), |
| 19114 | disabled: props.disabled || length === 1, |
| 19115 | title: (0, _language.strings).buttonPrevDataItem |
| 19116 | }), (0, _base.base).react.createElement("span", null, (0, _language.strings).record(index + 1, length)), (0, _base.base).react.createElement((0, _iconButton.IconButton), { |
| 19117 | themePalette: props.themePalette, |
| 19118 | iconName: "ChevronRightMed", |
| 19119 | onClick: (e)=>activateRecord(index >= length - 1 ? 0 : index + 1), |
| 19120 | disabled: props.disabled || length === 1, |
| 19121 | title: (0, _language.strings).buttonNextDataItem |
| 19122 | })), !props.itemVisible && (0, _base.base).react.createElement("div", { |
| 19123 | className: "item-filtered" |
nothing calls this directly
no test coverage detected