@elliemae/ds-search-field 2.3.1 → 3.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSSearchField.js +133 -0
- package/dist/cjs/DSSearchField.js.map +7 -0
- package/dist/cjs/impl/DSSeachFieldImpl.js +224 -0
- package/dist/cjs/impl/DSSeachFieldImpl.js.map +7 -0
- package/dist/cjs/impl/components/AdvanceSearchOption/AdvanceSearchOption.js +44 -0
- package/dist/cjs/impl/components/AdvanceSearchOption/AdvanceSearchOption.js.map +7 -0
- package/dist/cjs/impl/components/LookupIndicator/LookupIndicator.js +50 -0
- package/dist/cjs/impl/components/LookupIndicator/LookupIndicator.js.map +7 -0
- package/dist/cjs/impl/components/ModalSearchField/DataGridSearch.js +132 -0
- package/dist/cjs/impl/components/ModalSearchField/DataGridSearch.js.map +7 -0
- package/dist/cjs/impl/components/ModalSearchField/ModalSearchField.js +94 -0
- package/dist/cjs/impl/components/ModalSearchField/ModalSearchField.js.map +7 -0
- package/dist/cjs/index.js +37 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/esm/DSSearchField.js +104 -0
- package/dist/esm/DSSearchField.js.map +7 -0
- package/dist/esm/impl/DSSeachFieldImpl.js +197 -0
- package/dist/esm/impl/DSSeachFieldImpl.js.map +7 -0
- package/dist/esm/impl/components/AdvanceSearchOption/AdvanceSearchOption.js +15 -0
- package/dist/esm/impl/components/AdvanceSearchOption/AdvanceSearchOption.js.map +7 -0
- package/dist/esm/impl/components/LookupIndicator/LookupIndicator.js +21 -0
- package/dist/esm/impl/components/LookupIndicator/LookupIndicator.js.map +7 -0
- package/dist/esm/impl/components/ModalSearchField/DataGridSearch.js +105 -0
- package/dist/esm/impl/components/ModalSearchField/DataGridSearch.js.map +7 -0
- package/dist/esm/impl/components/ModalSearchField/ModalSearchField.js +65 -0
- package/dist/esm/impl/components/ModalSearchField/ModalSearchField.js.map +7 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +7 -0
- package/package.json +45 -36
- package/cjs/DSSearchField.js +0 -169
- package/cjs/impl/DSSeachFieldImpl.js +0 -243
- package/cjs/impl/components/AdvanceSearchOption/AdvanceSearchOption.js +0 -26
- package/cjs/impl/components/LookupIndicator/LookupIndicator.js +0 -34
- package/cjs/impl/components/ModalSearchField/DataGridSearch.js +0 -117
- package/cjs/impl/components/ModalSearchField/ModalSearchField.js +0 -83
- package/cjs/index.js +0 -12
- package/esm/DSSearchField.js +0 -159
- package/esm/impl/DSSeachFieldImpl.js +0 -234
- package/esm/impl/components/AdvanceSearchOption/AdvanceSearchOption.js +0 -19
- package/esm/impl/components/LookupIndicator/LookupIndicator.js +0 -27
- package/esm/impl/components/ModalSearchField/DataGridSearch.js +0 -108
- package/esm/impl/components/ModalSearchField/ModalSearchField.js +0 -76
- package/esm/index.js +0 -2
- package/types/DSSearchField.d.ts +0 -231
- package/types/impl/DSSeachFieldImpl.d.ts +0 -16
- package/types/impl/components/AdvanceSearchOption/AdvanceSearchOption.d.ts +0 -6
- package/types/impl/components/LookupIndicator/LookupIndicator.d.ts +0 -6
- package/types/impl/components/ModalSearchField/DataGridSearch.d.ts +0 -7
- package/types/impl/components/ModalSearchField/ModalSearchField.d.ts +0 -23
- package/types/index.d.ts +0 -1
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.find.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.find.js';
|
|
7
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
8
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
9
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
10
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
11
|
-
import { Component } from 'react';
|
|
12
|
-
import { components } from 'react-select';
|
|
13
|
-
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
14
|
-
import { DSComboBox2 } from '@elliemae/ds-form';
|
|
15
|
-
import ModalSearchField from './components/ModalSearchField/ModalSearchField.js';
|
|
16
|
-
export { default as DSModalSearchField } from './components/ModalSearchField/ModalSearchField.js';
|
|
17
|
-
import AdvanceSearchOption from './components/AdvanceSearchOption/AdvanceSearchOption.js';
|
|
18
|
-
import LookupIndicator from './components/LookupIndicator/LookupIndicator.js';
|
|
19
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
20
|
-
|
|
21
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
-
|
|
23
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
|
-
const advanceOption = {
|
|
25
|
-
className: 'advanced-search-option',
|
|
26
|
-
label: 'Advanced search',
|
|
27
|
-
value: 'search-field-advance-option',
|
|
28
|
-
isAdvance: true
|
|
29
|
-
};
|
|
30
|
-
const {
|
|
31
|
-
cssClassName,
|
|
32
|
-
classNameElement,
|
|
33
|
-
classNameModifier,
|
|
34
|
-
classNameBlock
|
|
35
|
-
} = convertPropToCssClassName('query-builder-addon-search-field');
|
|
36
|
-
|
|
37
|
-
class DSSearchFieldImpl extends Component {
|
|
38
|
-
constructor(props) {
|
|
39
|
-
super(props);
|
|
40
|
-
|
|
41
|
-
this.onChange = () => {
|
|
42
|
-
const {
|
|
43
|
-
selected: id,
|
|
44
|
-
additionalInfo: [row]
|
|
45
|
-
} = this.state;
|
|
46
|
-
const {
|
|
47
|
-
onChange
|
|
48
|
-
} = this.props;
|
|
49
|
-
onChange(id, row);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
this.onChangeDropdown = value => {
|
|
53
|
-
const {
|
|
54
|
-
dropdownOptions
|
|
55
|
-
} = this.props;
|
|
56
|
-
const selected = dropdownOptions.find(op => op.value === value);
|
|
57
|
-
const {
|
|
58
|
-
onChange,
|
|
59
|
-
displayProperty
|
|
60
|
-
} = this.props;
|
|
61
|
-
if (selected) onChange(value, {
|
|
62
|
-
[displayProperty]: selected.label
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
this.onKeyDown = event => {
|
|
67
|
-
setTimeout(() => {
|
|
68
|
-
const {
|
|
69
|
-
keycode
|
|
70
|
-
} = event;
|
|
71
|
-
const {
|
|
72
|
-
value
|
|
73
|
-
} = this.props;
|
|
74
|
-
if (value && keycode === 13) this.handleCloseModal();
|
|
75
|
-
}, 0);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
this.handleSelect = (selectedRow, rows) => {
|
|
79
|
-
let selected = selectedRow; // fix new datagrid callback format
|
|
80
|
-
|
|
81
|
-
if (!selected) return;
|
|
82
|
-
if (selected.id) selected = selected.id;else if (selected[0] && selected[0].id) selected = selected[0].id;
|
|
83
|
-
const additionalInfo = rows.filter(row => selected === row.id);
|
|
84
|
-
this.setState({
|
|
85
|
-
selected,
|
|
86
|
-
additionalInfo
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
this.handleConfirm = () => {
|
|
91
|
-
const {
|
|
92
|
-
onConfirmField
|
|
93
|
-
} = this.props;
|
|
94
|
-
this.onChange();
|
|
95
|
-
this.handleCloseModal();
|
|
96
|
-
onConfirmField();
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
this.handleReject = () => {
|
|
100
|
-
const {
|
|
101
|
-
onRejectField
|
|
102
|
-
} = this.props;
|
|
103
|
-
this.handleCloseModal();
|
|
104
|
-
onRejectField();
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
this.handleOpenModal = () => {
|
|
108
|
-
this.setState({
|
|
109
|
-
openModal: true
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
this.handleCloseModal = () => this.setState({
|
|
114
|
-
openModal: false,
|
|
115
|
-
selected: [],
|
|
116
|
-
additionalInfo: []
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
advanceOption.label = props.searchOptionLabel;
|
|
120
|
-
this.state = {
|
|
121
|
-
openModal: false,
|
|
122
|
-
selected: null,
|
|
123
|
-
additionalInfo: []
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
render() {
|
|
128
|
-
const {
|
|
129
|
-
placeholder,
|
|
130
|
-
modalTitle,
|
|
131
|
-
modalSize,
|
|
132
|
-
tabsAnimated,
|
|
133
|
-
tabsEnableMouseEvents,
|
|
134
|
-
tabType,
|
|
135
|
-
tabData,
|
|
136
|
-
searchFilters,
|
|
137
|
-
searchGrid,
|
|
138
|
-
confirmLabel,
|
|
139
|
-
rejectLabel,
|
|
140
|
-
modalType,
|
|
141
|
-
appElement,
|
|
142
|
-
value,
|
|
143
|
-
additionalInfo,
|
|
144
|
-
displayProperty,
|
|
145
|
-
dropdownOptions,
|
|
146
|
-
searchOptionLabel,
|
|
147
|
-
customDataGridOptions,
|
|
148
|
-
customDropdownOptions,
|
|
149
|
-
useLookupIndicator,
|
|
150
|
-
onTabChange,
|
|
151
|
-
containerProps,
|
|
152
|
-
searchable
|
|
153
|
-
} = this.props;
|
|
154
|
-
const {
|
|
155
|
-
openModal
|
|
156
|
-
} = this.state;
|
|
157
|
-
let options = [...dropdownOptions, advanceOption];
|
|
158
|
-
let displayValue = !value ? placeholder : value;
|
|
159
|
-
if (additionalInfo && additionalInfo[displayProperty]) displayValue = additionalInfo[displayProperty];
|
|
160
|
-
const defaultoption = {
|
|
161
|
-
value,
|
|
162
|
-
label: displayValue
|
|
163
|
-
};
|
|
164
|
-
const customComponents = {
|
|
165
|
-
Option: props => {
|
|
166
|
-
// return <AdvanceSearchOption onAdvanceSearchClick={this.handleOpenModal} />
|
|
167
|
-
props.innerProps.className = 'em-ds-combobox__option';
|
|
168
|
-
|
|
169
|
-
if (props.data.isAdvance) {
|
|
170
|
-
props.innerProps.onClick = this.handleOpenModal;
|
|
171
|
-
props.innerProps.className = "".concat(props.innerProps.className, " ").concat(advanceOption.className);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
return /*#__PURE__*/jsx(components.Option, _objectSpread({}, props));
|
|
175
|
-
},
|
|
176
|
-
IndicatorSeparator: () => null,
|
|
177
|
-
NoOptionsMessage: props => /*#__PURE__*/jsx(AdvanceSearchOption, _objectSpread({
|
|
178
|
-
advanceSearchLabel: searchOptionLabel,
|
|
179
|
-
onAdvanceSearchClick: this.handleOpenModal
|
|
180
|
-
}, props))
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
if (useLookupIndicator) {
|
|
184
|
-
customComponents.DropdownIndicator = () => null;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
if (!options.find(o => o.value === defaultoption.value)) {
|
|
188
|
-
options = [defaultoption, ...options];
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
192
|
-
className: "".concat(cssClassName),
|
|
193
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
194
|
-
className: "".concat(classNameBlock('container-selector'))
|
|
195
|
-
}, void 0, /*#__PURE__*/jsx(DSComboBox2, _objectSpread({
|
|
196
|
-
className: "".concat(classNameElement('dropdown-field-selector')),
|
|
197
|
-
components: customComponents,
|
|
198
|
-
onChange: this.onChangeDropdown,
|
|
199
|
-
onKeyDown: this.onKeyDown,
|
|
200
|
-
options: options,
|
|
201
|
-
value: value,
|
|
202
|
-
searchable: searchable
|
|
203
|
-
}, customDropdownOptions)), useLookupIndicator && /*#__PURE__*/_jsx(LookupIndicator, {
|
|
204
|
-
buttonType: "text",
|
|
205
|
-
className: "".concat(classNameElement('btn-selector'), " ").concat(!value ? classNameModifier('btn-placeholder', 'btn-selector') : ''),
|
|
206
|
-
onAdvanceSearchClick: this.handleOpenModal
|
|
207
|
-
})), /*#__PURE__*/_jsx(ModalSearchField, {
|
|
208
|
-
appElement: appElement,
|
|
209
|
-
confirmLabel: confirmLabel,
|
|
210
|
-
customDataGridOptions: customDataGridOptions,
|
|
211
|
-
handleSelect: this.handleSelect,
|
|
212
|
-
isOpen: openModal,
|
|
213
|
-
modalSize: modalSize,
|
|
214
|
-
modalTitle: modalTitle,
|
|
215
|
-
modalType: modalType,
|
|
216
|
-
onClose: this.handleCloseModal,
|
|
217
|
-
onConfirmField: this.handleConfirm,
|
|
218
|
-
onRejectField: this.handleReject,
|
|
219
|
-
onTabChange: onTabChange,
|
|
220
|
-
placeholder: placeholder,
|
|
221
|
-
rejectLabel: rejectLabel,
|
|
222
|
-
searchFilters: searchFilters,
|
|
223
|
-
searchGrid: searchGrid,
|
|
224
|
-
tabData: tabData,
|
|
225
|
-
tabsAnimated: tabsAnimated,
|
|
226
|
-
tabsEnableMouseEvents: tabsEnableMouseEvents,
|
|
227
|
-
tabType: tabType
|
|
228
|
-
})]
|
|
229
|
-
}));
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export { DSSearchFieldImpl as default };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'react';
|
|
3
|
-
import DSButton from '@elliemae/ds-button';
|
|
4
|
-
|
|
5
|
-
const AdvanceSearchOption = _ref => {
|
|
6
|
-
let {
|
|
7
|
-
advanceSearchLabel = 'Advanced Search',
|
|
8
|
-
onAdvanceSearchClick = () => null
|
|
9
|
-
} = _ref;
|
|
10
|
-
return /*#__PURE__*/_jsx(DSButton, {
|
|
11
|
-
className: "advance-search-option-btn",
|
|
12
|
-
labelText: advanceSearchLabel,
|
|
13
|
-
onClick: onAdvanceSearchClick,
|
|
14
|
-
tabIndex: -1,
|
|
15
|
-
type: "button"
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export { AdvanceSearchOption as default };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'react';
|
|
3
|
-
import { Search } from '@elliemae/ds-icons';
|
|
4
|
-
import DSButton from '@elliemae/ds-button';
|
|
5
|
-
|
|
6
|
-
var _Search;
|
|
7
|
-
|
|
8
|
-
const LookupIndicator = _ref => {
|
|
9
|
-
let {
|
|
10
|
-
onAdvanceSearchClick = () => null,
|
|
11
|
-
className = ''
|
|
12
|
-
} = _ref;
|
|
13
|
-
return /*#__PURE__*/_jsx(DSButton, {
|
|
14
|
-
"data-testid": "ds-searchfield-search-btn",
|
|
15
|
-
buttonType: "secondary",
|
|
16
|
-
className: className,
|
|
17
|
-
icon: _Search || (_Search = /*#__PURE__*/_jsx(Search, {})),
|
|
18
|
-
iconSize: "s",
|
|
19
|
-
onClick: e => {
|
|
20
|
-
e.stopPropagation();
|
|
21
|
-
e.preventDefault();
|
|
22
|
-
onAdvanceSearchClick();
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export { LookupIndicator as default };
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
9
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
10
|
-
import { Component } from 'react';
|
|
11
|
-
import DSToolbar, { ToolbarGroup } from '@elliemae/ds-toolbar';
|
|
12
|
-
import { DSSearchBox } from '@elliemae/ds-form';
|
|
13
|
-
import { DSDataGrid } from '@elliemae/ds-datagrids';
|
|
14
|
-
import { uid } from 'uid';
|
|
15
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
16
|
-
|
|
17
|
-
const _excluded = ["onFiltersChange"];
|
|
18
|
-
|
|
19
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
-
|
|
21
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22
|
-
class DataGridSearch extends Component {
|
|
23
|
-
constructor(props) {
|
|
24
|
-
super(props);
|
|
25
|
-
this.state = {
|
|
26
|
-
filters: props.filters || []
|
|
27
|
-
};
|
|
28
|
-
this.handleSearch = this.handleSearch.bind(this);
|
|
29
|
-
this.handleFiltersChange = this.handleFiltersChange.bind(this);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
handleSearch() {
|
|
33
|
-
const {
|
|
34
|
-
customDataGridOptions
|
|
35
|
-
} = this.props;
|
|
36
|
-
const {
|
|
37
|
-
property,
|
|
38
|
-
value
|
|
39
|
-
} = arguments.length <= 0 ? undefined : arguments[0];
|
|
40
|
-
const {
|
|
41
|
-
filters
|
|
42
|
-
} = this.state;
|
|
43
|
-
this.setState({
|
|
44
|
-
filters: [...filters, {
|
|
45
|
-
group: property,
|
|
46
|
-
label: 'All',
|
|
47
|
-
value,
|
|
48
|
-
id: uid(16)
|
|
49
|
-
}]
|
|
50
|
-
});
|
|
51
|
-
if (customDataGridOptions.onFiltersChange) customDataGridOptions.onFiltersChange(...arguments);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
handleFiltersChange(nextFilters) {
|
|
55
|
-
const {
|
|
56
|
-
customDataGridOptions
|
|
57
|
-
} = this.props;
|
|
58
|
-
this.setState({
|
|
59
|
-
filters: nextFilters
|
|
60
|
-
});
|
|
61
|
-
if (customDataGridOptions.onFiltersChange) customDataGridOptions.onFiltersChange(nextFilters);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
render() {
|
|
65
|
-
const {
|
|
66
|
-
id,
|
|
67
|
-
rows,
|
|
68
|
-
columns,
|
|
69
|
-
boundFetchRows,
|
|
70
|
-
searchFilters,
|
|
71
|
-
searchGrid = true,
|
|
72
|
-
customDataGridOptions,
|
|
73
|
-
handleSelect
|
|
74
|
-
} = this.props;
|
|
75
|
-
|
|
76
|
-
const restCustomDataGridOptions = _objectWithoutProperties(customDataGridOptions, _excluded);
|
|
77
|
-
|
|
78
|
-
const {
|
|
79
|
-
filters
|
|
80
|
-
} = this.state;
|
|
81
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
82
|
-
children: [/*#__PURE__*/_jsx(DSToolbar, {
|
|
83
|
-
withDepth: false
|
|
84
|
-
}, void 0, /*#__PURE__*/_jsx(ToolbarGroup, {}, void 0, /*#__PURE__*/_jsx(DSSearchBox, {
|
|
85
|
-
cleanOnSearch: true,
|
|
86
|
-
onSearch: this.handleSearch,
|
|
87
|
-
placeholder: "Search all"
|
|
88
|
-
}))), /*#__PURE__*/_jsx("div", {
|
|
89
|
-
className: "datagrid-tab-content"
|
|
90
|
-
}, void 0, /*#__PURE__*/jsx(DSDataGrid, _objectSpread({
|
|
91
|
-
columns: columns,
|
|
92
|
-
filters: filters,
|
|
93
|
-
fluidHeight: true,
|
|
94
|
-
getData: boundFetchRows,
|
|
95
|
-
id: id,
|
|
96
|
-
onFiltersChange: this.handleFiltersChange,
|
|
97
|
-
onSelectRow: rowId => handleSelect(rowId, rows),
|
|
98
|
-
rows: rows,
|
|
99
|
-
searchFilters: searchFilters,
|
|
100
|
-
searchGrid: searchGrid,
|
|
101
|
-
selectable: true
|
|
102
|
-
}, restCustomDataGridOptions)))]
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export { DataGridSearch as default };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
4
|
-
import 'react';
|
|
5
|
-
import DSModal from '@elliemae/ds-modal';
|
|
6
|
-
import { TabTypes, DSTabs, DSTab } from '@elliemae/ds-tabs';
|
|
7
|
-
import DataGridSearch from './DataGridSearch.js';
|
|
8
|
-
|
|
9
|
-
const ModalSearchField = _ref => {
|
|
10
|
-
let {
|
|
11
|
-
isOpen = false,
|
|
12
|
-
onClose = () => null,
|
|
13
|
-
modalTitle = 'Search Field ID',
|
|
14
|
-
modalSize = 'x-large',
|
|
15
|
-
tabsAnimated = true,
|
|
16
|
-
tabsEnableMouseEvents = true,
|
|
17
|
-
tabType = TabTypes.NORMAL,
|
|
18
|
-
tabData = [],
|
|
19
|
-
searchFilters = true,
|
|
20
|
-
searchGrid = false,
|
|
21
|
-
confirmLabel = 'Apply',
|
|
22
|
-
rejectLabel = 'Cancel',
|
|
23
|
-
modalType = 'confirm',
|
|
24
|
-
onConfirmField = () => null,
|
|
25
|
-
onRejectField = () => null,
|
|
26
|
-
handleSelect = () => null,
|
|
27
|
-
onTabChange = () => null,
|
|
28
|
-
appElement = null,
|
|
29
|
-
customDataGridOptions = {}
|
|
30
|
-
} = _ref;
|
|
31
|
-
return /*#__PURE__*/_jsx(DSModal, {
|
|
32
|
-
dataTestId: "ds-searchfield-modal",
|
|
33
|
-
appElement: appElement,
|
|
34
|
-
centered: false,
|
|
35
|
-
className: "modal-search-field",
|
|
36
|
-
confirmLabel: confirmLabel,
|
|
37
|
-
isOpen: isOpen,
|
|
38
|
-
modalTitle: modalTitle,
|
|
39
|
-
modalType: modalType,
|
|
40
|
-
onClose: onClose,
|
|
41
|
-
onConfirm: onConfirmField,
|
|
42
|
-
onReject: onRejectField,
|
|
43
|
-
rejectLabel: rejectLabel,
|
|
44
|
-
size: modalSize
|
|
45
|
-
}, void 0, tabData.length > 0 && /*#__PURE__*/_jsx(DSTabs, {
|
|
46
|
-
animated: tabsAnimated,
|
|
47
|
-
enableMouseEvents: tabsEnableMouseEvents,
|
|
48
|
-
onlyRenderActiveTab: true,
|
|
49
|
-
onTabChange: onTabChange,
|
|
50
|
-
type: tabType
|
|
51
|
-
}, void 0, tabData.map(_ref2 => {
|
|
52
|
-
let {
|
|
53
|
-
tabId,
|
|
54
|
-
tabTitle,
|
|
55
|
-
columns,
|
|
56
|
-
rows,
|
|
57
|
-
boundFetchRows
|
|
58
|
-
} = _ref2;
|
|
59
|
-
return /*#__PURE__*/_jsx(DSTab, {
|
|
60
|
-
className: "tab-content",
|
|
61
|
-
tabId: tabId,
|
|
62
|
-
title: tabTitle
|
|
63
|
-
}, tabId, /*#__PURE__*/_jsx(DataGridSearch, {
|
|
64
|
-
boundFetchRows: boundFetchRows,
|
|
65
|
-
columns: columns,
|
|
66
|
-
customDataGridOptions: customDataGridOptions,
|
|
67
|
-
handleSelect: handleSelect,
|
|
68
|
-
id: "datagrid_search_field_".concat(tabId),
|
|
69
|
-
rows: rows,
|
|
70
|
-
searchFilters: searchFilters,
|
|
71
|
-
searchGrid: searchGrid
|
|
72
|
-
}));
|
|
73
|
-
})));
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export { ModalSearchField as default };
|
package/esm/index.js
DELETED