@elliemae/ds-search-field 2.0.0-alpha.10 → 2.0.0-alpha.14
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/cjs/DSSearchField.js +62 -59
- package/cjs/impl/DSSeachFieldImpl.js +31 -23
- package/cjs/impl/components/AdvanceSearchOption/AdvanceSearchOption.js +14 -11
- package/cjs/impl/components/LookupIndicator/LookupIndicator.js +20 -18
- package/cjs/impl/components/ModalSearchField/DataGridSearch.js +12 -7
- package/cjs/impl/components/ModalSearchField/ModalSearchField.js +69 -61
- package/esm/DSSearchField.js +61 -58
- package/esm/impl/DSSeachFieldImpl.js +30 -22
- package/esm/impl/components/AdvanceSearchOption/AdvanceSearchOption.js +14 -11
- package/esm/impl/components/LookupIndicator/LookupIndicator.js +20 -17
- package/esm/impl/components/ModalSearchField/DataGridSearch.js +11 -5
- package/esm/impl/components/ModalSearchField/ModalSearchField.js +69 -61
- package/package.json +11 -14
- package/types/DSSearchField.d.ts +197 -29
- package/types/impl/components/AdvanceSearchOption/AdvanceSearchOption.d.ts +1 -1
- package/types/impl/components/LookupIndicator/LookupIndicator.d.ts +1 -1
- package/types/impl/components/ModalSearchField/ModalSearchField.d.ts +1 -1
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
package/cjs/DSSearchField.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
require('react');
|
|
7
7
|
var reactDesc = require('react-desc');
|
|
8
|
-
var
|
|
8
|
+
var dsTabs = require('@elliemae/ds-tabs');
|
|
9
9
|
var DSSeachFieldImpl = require('./impl/DSSeachFieldImpl.js');
|
|
10
10
|
var ModalSearchField = require('./impl/components/ModalSearchField/ModalSearchField.js');
|
|
11
11
|
|
|
@@ -13,63 +13,66 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
13
13
|
|
|
14
14
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
15
15
|
|
|
16
|
-
const DSSearchField =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
16
|
+
const DSSearchField = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
containerProps = {},
|
|
19
|
+
onChange = () => null,
|
|
20
|
+
searchOptionLabel = 'Advanced Search',
|
|
21
|
+
placeholder = 'Select field',
|
|
22
|
+
modalSize = 'x-large',
|
|
23
|
+
modalTitle = 'Search Field ID',
|
|
24
|
+
tabsAnimated = true,
|
|
25
|
+
tabsEnableMouseEvents = true,
|
|
26
|
+
tabType = dsTabs.TabTypes.NORMAL,
|
|
27
|
+
tabData = [],
|
|
28
|
+
searchGrid = false,
|
|
29
|
+
searchFilters = true,
|
|
30
|
+
confirmLabel = 'Apply',
|
|
31
|
+
rejectLabel = 'Cancel',
|
|
32
|
+
modalType = 'confirm',
|
|
33
|
+
onConfirmField = () => null,
|
|
34
|
+
onRejectField = () => null,
|
|
35
|
+
onTabChange = () => null,
|
|
36
|
+
appElement = '#root',
|
|
37
|
+
value = null,
|
|
38
|
+
additionalInfo = null,
|
|
39
|
+
displayProperty = 'name',
|
|
40
|
+
dropdownOptions = [],
|
|
41
|
+
customDataGridOptions = {},
|
|
42
|
+
customDropdownOptions = {},
|
|
43
|
+
useLookupIndicator = true,
|
|
44
|
+
searchable = false
|
|
45
|
+
} = _ref;
|
|
46
|
+
return /*#__PURE__*/_jsx__default["default"](DSSeachFieldImpl["default"], {
|
|
47
|
+
additionalInfo: additionalInfo,
|
|
48
|
+
appElement: appElement,
|
|
49
|
+
searchable: searchable,
|
|
50
|
+
confirmLabel: confirmLabel,
|
|
51
|
+
containerProps: containerProps,
|
|
52
|
+
customDataGridOptions: customDataGridOptions,
|
|
53
|
+
customDropdownOptions: customDropdownOptions,
|
|
54
|
+
displayProperty: displayProperty,
|
|
55
|
+
dropdownOptions: dropdownOptions,
|
|
56
|
+
modalSize: modalSize,
|
|
57
|
+
modalTitle: modalTitle,
|
|
58
|
+
modalType: modalType,
|
|
59
|
+
onChange: onChange,
|
|
60
|
+
onConfirmField: onConfirmField,
|
|
61
|
+
onRejectField: onRejectField,
|
|
62
|
+
onTabChange: onTabChange,
|
|
63
|
+
placeholder: placeholder,
|
|
64
|
+
rejectLabel: rejectLabel,
|
|
65
|
+
searchFilters: searchFilters,
|
|
66
|
+
searchGrid: searchGrid,
|
|
67
|
+
searchOptionLabel: searchOptionLabel,
|
|
68
|
+
tabData: tabData,
|
|
69
|
+
tabsAnimated: tabsAnimated,
|
|
70
|
+
tabsEnableMouseEvents: tabsEnableMouseEvents,
|
|
71
|
+
tabType: tabType,
|
|
72
|
+
useLookupIndicator: useLookupIndicator,
|
|
73
|
+
value: value
|
|
74
|
+
});
|
|
75
|
+
};
|
|
73
76
|
|
|
74
77
|
const props = {
|
|
75
78
|
/*
|
|
@@ -102,7 +105,7 @@ const props = {
|
|
|
102
105
|
tabsEnableMouseEvents: reactDesc.PropTypes.bool.description('enable mouse event on tabs'),
|
|
103
106
|
|
|
104
107
|
/** tab types on modal */
|
|
105
|
-
tabType: reactDesc.PropTypes.oneOf([
|
|
108
|
+
tabType: reactDesc.PropTypes.oneOf([dsTabs.TabTypes.NORMAL, dsTabs.TabTypes.SUBTABS]).description('tab types on modal'),
|
|
106
109
|
|
|
107
110
|
/** data for modal tabs */
|
|
108
111
|
tabData: reactDesc.PropTypes.array.description('data for modal tabs'),
|
|
@@ -4,10 +4,18 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.find.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.find.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
13
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
14
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
7
15
|
var react = require('react');
|
|
8
16
|
var reactSelect = require('react-select');
|
|
9
17
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
10
|
-
var
|
|
18
|
+
var dsForm = require('@elliemae/ds-form');
|
|
11
19
|
var ModalSearchField = require('./components/ModalSearchField/ModalSearchField.js');
|
|
12
20
|
var AdvanceSearchOption = require('./components/AdvanceSearchOption/AdvanceSearchOption.js');
|
|
13
21
|
var LookupIndicator = require('./components/LookupIndicator/LookupIndicator.js');
|
|
@@ -38,7 +46,7 @@ class DSSearchFieldImpl extends react.Component {
|
|
|
38
46
|
constructor(props) {
|
|
39
47
|
super(props);
|
|
40
48
|
|
|
41
|
-
|
|
49
|
+
this.onChange = () => {
|
|
42
50
|
const {
|
|
43
51
|
selected: id,
|
|
44
52
|
additionalInfo: [row]
|
|
@@ -47,9 +55,9 @@ class DSSearchFieldImpl extends react.Component {
|
|
|
47
55
|
onChange
|
|
48
56
|
} = this.props;
|
|
49
57
|
onChange(id, row);
|
|
50
|
-
}
|
|
58
|
+
};
|
|
51
59
|
|
|
52
|
-
|
|
60
|
+
this.onChangeDropdown = value => {
|
|
53
61
|
const {
|
|
54
62
|
dropdownOptions
|
|
55
63
|
} = this.props;
|
|
@@ -61,9 +69,9 @@ class DSSearchFieldImpl extends react.Component {
|
|
|
61
69
|
if (selected) onChange(value, {
|
|
62
70
|
[displayProperty]: selected.label
|
|
63
71
|
});
|
|
64
|
-
}
|
|
72
|
+
};
|
|
65
73
|
|
|
66
|
-
|
|
74
|
+
this.onKeyDown = event => {
|
|
67
75
|
setTimeout(() => {
|
|
68
76
|
const {
|
|
69
77
|
keycode
|
|
@@ -73,9 +81,9 @@ class DSSearchFieldImpl extends react.Component {
|
|
|
73
81
|
} = this.props;
|
|
74
82
|
if (value && keycode === 13) this.handleCloseModal();
|
|
75
83
|
}, 0);
|
|
76
|
-
}
|
|
84
|
+
};
|
|
77
85
|
|
|
78
|
-
|
|
86
|
+
this.handleSelect = (selectedRow, rows) => {
|
|
79
87
|
let selected = selectedRow; // fix new datagrid callback format
|
|
80
88
|
|
|
81
89
|
if (!selected) return;
|
|
@@ -85,36 +93,36 @@ class DSSearchFieldImpl extends react.Component {
|
|
|
85
93
|
selected,
|
|
86
94
|
additionalInfo
|
|
87
95
|
});
|
|
88
|
-
}
|
|
96
|
+
};
|
|
89
97
|
|
|
90
|
-
|
|
98
|
+
this.handleConfirm = () => {
|
|
91
99
|
const {
|
|
92
100
|
onConfirmField
|
|
93
101
|
} = this.props;
|
|
94
102
|
this.onChange();
|
|
95
103
|
this.handleCloseModal();
|
|
96
104
|
onConfirmField();
|
|
97
|
-
}
|
|
105
|
+
};
|
|
98
106
|
|
|
99
|
-
|
|
107
|
+
this.handleReject = () => {
|
|
100
108
|
const {
|
|
101
109
|
onRejectField
|
|
102
110
|
} = this.props;
|
|
103
111
|
this.handleCloseModal();
|
|
104
112
|
onRejectField();
|
|
105
|
-
}
|
|
113
|
+
};
|
|
106
114
|
|
|
107
|
-
|
|
115
|
+
this.handleOpenModal = () => {
|
|
108
116
|
this.setState({
|
|
109
117
|
openModal: true
|
|
110
118
|
});
|
|
111
|
-
}
|
|
119
|
+
};
|
|
112
120
|
|
|
113
|
-
|
|
121
|
+
this.handleCloseModal = () => this.setState({
|
|
114
122
|
openModal: false,
|
|
115
123
|
selected: [],
|
|
116
124
|
additionalInfo: []
|
|
117
|
-
})
|
|
125
|
+
});
|
|
118
126
|
|
|
119
127
|
advanceOption.label = props.searchOptionLabel;
|
|
120
128
|
this.state = {
|
|
@@ -168,7 +176,7 @@ class DSSearchFieldImpl extends react.Component {
|
|
|
168
176
|
|
|
169
177
|
if (props.data.isAdvance) {
|
|
170
178
|
props.innerProps.onClick = this.handleOpenModal;
|
|
171
|
-
props.innerProps.className =
|
|
179
|
+
props.innerProps.className = "".concat(props.innerProps.className, " ").concat(advanceOption.className);
|
|
172
180
|
}
|
|
173
181
|
|
|
174
182
|
return /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.Option, _objectSpread({}, props));
|
|
@@ -189,11 +197,11 @@ class DSSearchFieldImpl extends react.Component {
|
|
|
189
197
|
}
|
|
190
198
|
|
|
191
199
|
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
192
|
-
className:
|
|
200
|
+
className: "".concat(cssClassName),
|
|
193
201
|
children: [/*#__PURE__*/_jsx__default["default"]("div", {
|
|
194
|
-
className:
|
|
195
|
-
}, void 0, /*#__PURE__*/jsxRuntime.jsx(
|
|
196
|
-
className:
|
|
202
|
+
className: "".concat(classNameBlock('container-selector'))
|
|
203
|
+
}, void 0, /*#__PURE__*/jsxRuntime.jsx(dsForm.DSComboBox2, _objectSpread({
|
|
204
|
+
className: "".concat(classNameElement('dropdown-field-selector')),
|
|
197
205
|
components: customComponents,
|
|
198
206
|
onChange: this.onChangeDropdown,
|
|
199
207
|
onKeyDown: this.onKeyDown,
|
|
@@ -202,7 +210,7 @@ class DSSearchFieldImpl extends react.Component {
|
|
|
202
210
|
searchable: searchable
|
|
203
211
|
}, customDropdownOptions)), useLookupIndicator && /*#__PURE__*/_jsx__default["default"](LookupIndicator, {
|
|
204
212
|
buttonType: "text",
|
|
205
|
-
className:
|
|
213
|
+
className: "".concat(classNameElement('btn-selector'), " ").concat(!value ? classNameModifier('btn-placeholder', 'btn-selector') : ''),
|
|
206
214
|
onAdvanceSearchClick: this.handleOpenModal
|
|
207
215
|
})), /*#__PURE__*/_jsx__default["default"](ModalSearchField, {
|
|
208
216
|
appElement: appElement,
|
|
@@ -2,22 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
4
|
require('react');
|
|
5
|
-
var DSButton = require('@elliemae/ds-
|
|
5
|
+
var DSButton = require('@elliemae/ds-button');
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
9
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
10
10
|
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
11
11
|
|
|
12
|
-
const AdvanceSearchOption =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
const AdvanceSearchOption = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
advanceSearchLabel = 'Advanced Search',
|
|
15
|
+
onAdvanceSearchClick = () => null
|
|
16
|
+
} = _ref;
|
|
17
|
+
return /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
|
|
18
|
+
className: "advance-search-option-btn",
|
|
19
|
+
labelText: advanceSearchLabel,
|
|
20
|
+
onClick: onAdvanceSearchClick,
|
|
21
|
+
tabIndex: -1,
|
|
22
|
+
type: "button"
|
|
23
|
+
});
|
|
24
|
+
};
|
|
22
25
|
|
|
23
26
|
module.exports = AdvanceSearchOption;
|
|
@@ -2,31 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
4
|
require('react');
|
|
5
|
-
var
|
|
6
|
-
var DSButton = require('@elliemae/ds-
|
|
5
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
6
|
+
var DSButton = require('@elliemae/ds-button');
|
|
7
7
|
|
|
8
8
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
9
|
|
|
10
10
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
11
|
-
var Search__default = /*#__PURE__*/_interopDefaultLegacy(Search);
|
|
12
11
|
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
13
12
|
|
|
14
13
|
var _Search;
|
|
15
14
|
|
|
16
|
-
const LookupIndicator =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
e
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
const LookupIndicator = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
onAdvanceSearchClick = () => null,
|
|
18
|
+
className = ''
|
|
19
|
+
} = _ref;
|
|
20
|
+
return /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
|
|
21
|
+
"data-testid": "ds-searchfield-search-btn",
|
|
22
|
+
buttonType: "secondary",
|
|
23
|
+
className: className,
|
|
24
|
+
icon: _Search || (_Search = /*#__PURE__*/_jsx__default["default"](dsIcons.Search, {})),
|
|
25
|
+
iconSize: "s",
|
|
26
|
+
onClick: e => {
|
|
27
|
+
e.stopPropagation();
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
onAdvanceSearchClick();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
31
33
|
|
|
32
34
|
module.exports = LookupIndicator;
|
|
@@ -3,9 +3,15 @@
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
5
5
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
7
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
6
12
|
var react = require('react');
|
|
7
|
-
var DSToolbar = require('@elliemae/ds-
|
|
8
|
-
var
|
|
13
|
+
var DSToolbar = require('@elliemae/ds-toolbar');
|
|
14
|
+
var dsForm = require('@elliemae/ds-form');
|
|
9
15
|
var dsDatagrids = require('@elliemae/ds-datagrids');
|
|
10
16
|
var uid = require('uid');
|
|
11
17
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -16,7 +22,6 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
16
22
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
17
23
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
18
24
|
var DSToolbar__default = /*#__PURE__*/_interopDefaultLegacy(DSToolbar);
|
|
19
|
-
var DSSearchBox__default = /*#__PURE__*/_interopDefaultLegacy(DSSearchBox);
|
|
20
25
|
|
|
21
26
|
const _excluded = ["onFiltersChange"];
|
|
22
27
|
|
|
@@ -33,14 +38,14 @@ class DataGridSearch extends react.Component {
|
|
|
33
38
|
this.handleFiltersChange = this.handleFiltersChange.bind(this);
|
|
34
39
|
}
|
|
35
40
|
|
|
36
|
-
handleSearch(
|
|
41
|
+
handleSearch() {
|
|
37
42
|
const {
|
|
38
43
|
customDataGridOptions
|
|
39
44
|
} = this.props;
|
|
40
45
|
const {
|
|
41
46
|
property,
|
|
42
47
|
value
|
|
43
|
-
} =
|
|
48
|
+
} = arguments.length <= 0 ? undefined : arguments[0];
|
|
44
49
|
const {
|
|
45
50
|
filters
|
|
46
51
|
} = this.state;
|
|
@@ -52,7 +57,7 @@ class DataGridSearch extends react.Component {
|
|
|
52
57
|
id: uid.uid(16)
|
|
53
58
|
}]
|
|
54
59
|
});
|
|
55
|
-
if (customDataGridOptions.onFiltersChange) customDataGridOptions.onFiltersChange(...
|
|
60
|
+
if (customDataGridOptions.onFiltersChange) customDataGridOptions.onFiltersChange(...arguments);
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
handleFiltersChange(nextFilters) {
|
|
@@ -85,7 +90,7 @@ class DataGridSearch extends react.Component {
|
|
|
85
90
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
86
91
|
children: [/*#__PURE__*/_jsx__default["default"](DSToolbar__default["default"], {
|
|
87
92
|
withDepth: false
|
|
88
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](DSToolbar.ToolbarGroup, {}, void 0, /*#__PURE__*/_jsx__default["default"](
|
|
93
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](DSToolbar.ToolbarGroup, {}, void 0, /*#__PURE__*/_jsx__default["default"](dsForm.DSSearchBox, {
|
|
89
94
|
cleanOnSearch: true,
|
|
90
95
|
onSearch: this.handleSearch,
|
|
91
96
|
placeholder: "Search all"
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
5
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
4
6
|
require('react');
|
|
5
7
|
var DSModal = require('@elliemae/ds-modal');
|
|
6
|
-
var
|
|
8
|
+
var dsTabs = require('@elliemae/ds-tabs');
|
|
7
9
|
var DataGridSearch = require('./DataGridSearch.js');
|
|
8
10
|
|
|
9
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -11,65 +13,71 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
13
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
12
14
|
var DSModal__default = /*#__PURE__*/_interopDefaultLegacy(DSModal);
|
|
13
15
|
|
|
14
|
-
const ModalSearchField =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
16
|
+
const ModalSearchField = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
isOpen = false,
|
|
19
|
+
onClose = () => null,
|
|
20
|
+
modalTitle = 'Search Field ID',
|
|
21
|
+
modalSize = 'x-large',
|
|
22
|
+
tabsAnimated = true,
|
|
23
|
+
tabsEnableMouseEvents = true,
|
|
24
|
+
tabType = dsTabs.TabTypes.NORMAL,
|
|
25
|
+
tabData = [],
|
|
26
|
+
searchFilters = true,
|
|
27
|
+
searchGrid = false,
|
|
28
|
+
confirmLabel = 'Apply',
|
|
29
|
+
rejectLabel = 'Cancel',
|
|
30
|
+
modalType = 'confirm',
|
|
31
|
+
onConfirmField = () => null,
|
|
32
|
+
onRejectField = () => null,
|
|
33
|
+
handleSelect = () => null,
|
|
34
|
+
onTabChange = () => null,
|
|
35
|
+
appElement = null,
|
|
36
|
+
customDataGridOptions = {}
|
|
37
|
+
} = _ref;
|
|
38
|
+
return /*#__PURE__*/_jsx__default["default"](DSModal__default["default"], {
|
|
39
|
+
dataTestId: "ds-searchfield-modal",
|
|
40
|
+
appElement: appElement,
|
|
41
|
+
centered: false,
|
|
42
|
+
className: "modal-search-field",
|
|
43
|
+
confirmLabel: confirmLabel,
|
|
44
|
+
isOpen: isOpen,
|
|
45
|
+
modalTitle: modalTitle,
|
|
46
|
+
modalType: modalType,
|
|
47
|
+
onClose: onClose,
|
|
48
|
+
onConfirm: onConfirmField,
|
|
49
|
+
onReject: onRejectField,
|
|
50
|
+
rejectLabel: rejectLabel,
|
|
51
|
+
size: modalSize
|
|
52
|
+
}, void 0, tabData.length > 0 && /*#__PURE__*/_jsx__default["default"](dsTabs.DSTabs, {
|
|
53
|
+
animated: tabsAnimated,
|
|
54
|
+
enableMouseEvents: tabsEnableMouseEvents,
|
|
55
|
+
onlyRenderActiveTab: true,
|
|
56
|
+
onTabChange: onTabChange,
|
|
57
|
+
type: tabType
|
|
58
|
+
}, void 0, tabData.map(_ref2 => {
|
|
59
|
+
let {
|
|
60
|
+
tabId,
|
|
61
|
+
tabTitle,
|
|
62
|
+
columns,
|
|
63
|
+
rows,
|
|
64
|
+
boundFetchRows
|
|
65
|
+
} = _ref2;
|
|
66
|
+
return /*#__PURE__*/_jsx__default["default"](dsTabs.DSTab, {
|
|
67
|
+
className: "tab-content",
|
|
68
|
+
tabId: tabId,
|
|
69
|
+
title: tabTitle
|
|
70
|
+
}, tabId, /*#__PURE__*/_jsx__default["default"](DataGridSearch, {
|
|
71
|
+
boundFetchRows: boundFetchRows,
|
|
72
|
+
columns: columns,
|
|
73
|
+
customDataGridOptions: customDataGridOptions,
|
|
74
|
+
handleSelect: handleSelect,
|
|
75
|
+
id: "datagrid_search_field_".concat(tabId),
|
|
76
|
+
rows: rows,
|
|
77
|
+
searchFilters: searchFilters,
|
|
78
|
+
searchGrid: searchGrid
|
|
79
|
+
}));
|
|
80
|
+
})));
|
|
81
|
+
};
|
|
74
82
|
|
|
75
83
|
module.exports = ModalSearchField;
|