MCPcopy Create free account
hub / github.com/microsoft/SandDance / SearchTerm

Function SearchTerm

docs/app/js/sanddance-app.js:12955–13027  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

12953 return typeof ex.value === "string" ? ex.value : ex.value == null ? "" : ex.value.toString();
12954}
12955function SearchTerm(props) {
12956 const ex = props.searchExpression;
12957 const possibleValues = getValues(ex, props.column, props.data, props.autoCompleteDistinctValues);
12958 //TODO better date handling with calendar picker
12959 return (0, _base.base).react.createElement("div", null, props.index > 0 && (0, _base.base).react.createElement((0, _dropdown.Dropdown), {
12960 collapseLabel: props.collapseLabels,
12961 className: "search-field",
12962 label: (0, _language.strings).labelSearchClause,
12963 dropdownWidth: 120,
12964 disabled: !ex.unlocked || props.disableOR,
12965 options: getExpressionClauses(ex.clause, props.disableOR),
12966 onChange: (e, o)=>props.onUpdateExpression({
12967 clause: o.data
12968 }, props.index)
12969 }), (0, _base.base).react.createElement((0, _dropdown.Dropdown), {
12970 componentRef: props.dropdownRef,
12971 collapseLabel: props.collapseLabels,
12972 className: "search-field",
12973 label: (0, _language.strings).labelSearchColumn,
12974 options: [
12975 {
12976 key: "",
12977 text: (0, _language.strings).selectAny,
12978 data: null,
12979 selected: ex.name === null
12980 }
12981 ].concat(props.columns.map((c, i)=>({
12982 key: c.name,
12983 text: c.name,
12984 data: c,
12985 selected: c.name === ex.name
12986 }))),
12987 onChange: (e, o)=>props.onUpdateExpression({
12988 name: o.data && o.data.name || null
12989 }, props.index)
12990 }), (0, _base.base).react.createElement((0, _dropdown.Dropdown), {
12991 collapseLabel: props.collapseLabels,
12992 className: "search-field",
12993 label: (0, _language.strings).labelSearchOperator,
12994 dropdownWidth: 120,
12995 options: getOperators(ex, props.column),
12996 onChange: (e, o)=>props.onUpdateExpression({
12997 operator: o.data
12998 }, props.index)
12999 }), possibleValues.length > 0 && (0, _base.base).react.createElement((0, _base.base).fluentUI.ComboBox, {
13000 className: "search-field",
13001 label: props.collapseLabels ? null : (0, _language.strings).labelSearchValue,
13002 placeholder: (0, _language.strings).labelSearchValuePlaceholder,
13003 disabled: ex.operator === "isnullorEmpty",
13004 dropdownWidth: (0, _dropdown.dropdownWidth),
13005 allowFreeform: true,
13006 autoComplete: "on",
13007 errorMessage: ex.errorMessage,
13008 text: getText(ex),
13009 options: getValues(ex, props.column, props.data, props.autoCompleteDistinctValues),
13010 onChange: (e, o, i, value)=>{
13011 if (o) value = o.text;
13012 props.onUpdateExpression({

Callers

nothing calls this directly

Calls 4

getValuesFunction · 0.70
getExpressionClausesFunction · 0.70
getOperatorsFunction · 0.70
getTextFunction · 0.70

Tested by

no test coverage detected