@elliemae/ds-search-field 2.0.0-alpha.11 → 2.0.0-alpha.12
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 +25 -18
- 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 +11 -7
- package/cjs/impl/components/ModalSearchField/ModalSearchField.js +69 -61
- package/esm/DSSearchField.js +61 -58
- package/esm/impl/DSSeachFieldImpl.js +24 -17
- 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 +10 -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/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'),
|
|
@@ -5,10 +5,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
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');
|
|
8
15
|
var react = require('react');
|
|
9
16
|
var reactSelect = require('react-select');
|
|
10
17
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
11
|
-
var
|
|
18
|
+
var dsForm = require('@elliemae/ds-form');
|
|
12
19
|
var ModalSearchField = require('./components/ModalSearchField/ModalSearchField.js');
|
|
13
20
|
var AdvanceSearchOption = require('./components/AdvanceSearchOption/AdvanceSearchOption.js');
|
|
14
21
|
var LookupIndicator = require('./components/LookupIndicator/LookupIndicator.js');
|
|
@@ -39,7 +46,7 @@ class DSSearchFieldImpl extends react.Component {
|
|
|
39
46
|
constructor(props) {
|
|
40
47
|
super(props);
|
|
41
48
|
|
|
42
|
-
|
|
49
|
+
this.onChange = () => {
|
|
43
50
|
const {
|
|
44
51
|
selected: id,
|
|
45
52
|
additionalInfo: [row]
|
|
@@ -48,9 +55,9 @@ class DSSearchFieldImpl extends react.Component {
|
|
|
48
55
|
onChange
|
|
49
56
|
} = this.props;
|
|
50
57
|
onChange(id, row);
|
|
51
|
-
}
|
|
58
|
+
};
|
|
52
59
|
|
|
53
|
-
|
|
60
|
+
this.onChangeDropdown = value => {
|
|
54
61
|
const {
|
|
55
62
|
dropdownOptions
|
|
56
63
|
} = this.props;
|
|
@@ -62,9 +69,9 @@ class DSSearchFieldImpl extends react.Component {
|
|
|
62
69
|
if (selected) onChange(value, {
|
|
63
70
|
[displayProperty]: selected.label
|
|
64
71
|
});
|
|
65
|
-
}
|
|
72
|
+
};
|
|
66
73
|
|
|
67
|
-
|
|
74
|
+
this.onKeyDown = event => {
|
|
68
75
|
setTimeout(() => {
|
|
69
76
|
const {
|
|
70
77
|
keycode
|
|
@@ -74,9 +81,9 @@ class DSSearchFieldImpl extends react.Component {
|
|
|
74
81
|
} = this.props;
|
|
75
82
|
if (value && keycode === 13) this.handleCloseModal();
|
|
76
83
|
}, 0);
|
|
77
|
-
}
|
|
84
|
+
};
|
|
78
85
|
|
|
79
|
-
|
|
86
|
+
this.handleSelect = (selectedRow, rows) => {
|
|
80
87
|
let selected = selectedRow; // fix new datagrid callback format
|
|
81
88
|
|
|
82
89
|
if (!selected) return;
|
|
@@ -86,36 +93,36 @@ class DSSearchFieldImpl extends react.Component {
|
|
|
86
93
|
selected,
|
|
87
94
|
additionalInfo
|
|
88
95
|
});
|
|
89
|
-
}
|
|
96
|
+
};
|
|
90
97
|
|
|
91
|
-
|
|
98
|
+
this.handleConfirm = () => {
|
|
92
99
|
const {
|
|
93
100
|
onConfirmField
|
|
94
101
|
} = this.props;
|
|
95
102
|
this.onChange();
|
|
96
103
|
this.handleCloseModal();
|
|
97
104
|
onConfirmField();
|
|
98
|
-
}
|
|
105
|
+
};
|
|
99
106
|
|
|
100
|
-
|
|
107
|
+
this.handleReject = () => {
|
|
101
108
|
const {
|
|
102
109
|
onRejectField
|
|
103
110
|
} = this.props;
|
|
104
111
|
this.handleCloseModal();
|
|
105
112
|
onRejectField();
|
|
106
|
-
}
|
|
113
|
+
};
|
|
107
114
|
|
|
108
|
-
|
|
115
|
+
this.handleOpenModal = () => {
|
|
109
116
|
this.setState({
|
|
110
117
|
openModal: true
|
|
111
118
|
});
|
|
112
|
-
}
|
|
119
|
+
};
|
|
113
120
|
|
|
114
|
-
|
|
121
|
+
this.handleCloseModal = () => this.setState({
|
|
115
122
|
openModal: false,
|
|
116
123
|
selected: [],
|
|
117
124
|
additionalInfo: []
|
|
118
|
-
})
|
|
125
|
+
});
|
|
119
126
|
|
|
120
127
|
advanceOption.label = props.searchOptionLabel;
|
|
121
128
|
this.state = {
|
|
@@ -193,7 +200,7 @@ class DSSearchFieldImpl extends react.Component {
|
|
|
193
200
|
className: "".concat(cssClassName),
|
|
194
201
|
children: [/*#__PURE__*/_jsx__default["default"]("div", {
|
|
195
202
|
className: "".concat(classNameBlock('container-selector'))
|
|
196
|
-
}, void 0, /*#__PURE__*/jsxRuntime.jsx(
|
|
203
|
+
}, void 0, /*#__PURE__*/jsxRuntime.jsx(dsForm.DSComboBox2, _objectSpread({
|
|
197
204
|
className: "".concat(classNameElement('dropdown-field-selector')),
|
|
198
205
|
components: customComponents,
|
|
199
206
|
onChange: this.onChangeDropdown,
|
|
@@ -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;
|
|
@@ -4,9 +4,14 @@ 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
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');
|
|
7
12
|
var react = require('react');
|
|
8
|
-
var DSToolbar = require('@elliemae/ds-
|
|
9
|
-
var
|
|
13
|
+
var DSToolbar = require('@elliemae/ds-toolbar');
|
|
14
|
+
var dsForm = require('@elliemae/ds-form');
|
|
10
15
|
var dsDatagrids = require('@elliemae/ds-datagrids');
|
|
11
16
|
var uid = require('uid');
|
|
12
17
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -17,7 +22,6 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
17
22
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
18
23
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
19
24
|
var DSToolbar__default = /*#__PURE__*/_interopDefaultLegacy(DSToolbar);
|
|
20
|
-
var DSSearchBox__default = /*#__PURE__*/_interopDefaultLegacy(DSSearchBox);
|
|
21
25
|
|
|
22
26
|
const _excluded = ["onFiltersChange"];
|
|
23
27
|
|
|
@@ -34,14 +38,14 @@ class DataGridSearch extends react.Component {
|
|
|
34
38
|
this.handleFiltersChange = this.handleFiltersChange.bind(this);
|
|
35
39
|
}
|
|
36
40
|
|
|
37
|
-
handleSearch(
|
|
41
|
+
handleSearch() {
|
|
38
42
|
const {
|
|
39
43
|
customDataGridOptions
|
|
40
44
|
} = this.props;
|
|
41
45
|
const {
|
|
42
46
|
property,
|
|
43
47
|
value
|
|
44
|
-
} =
|
|
48
|
+
} = arguments.length <= 0 ? undefined : arguments[0];
|
|
45
49
|
const {
|
|
46
50
|
filters
|
|
47
51
|
} = this.state;
|
|
@@ -53,7 +57,7 @@ class DataGridSearch extends react.Component {
|
|
|
53
57
|
id: uid.uid(16)
|
|
54
58
|
}]
|
|
55
59
|
});
|
|
56
|
-
if (customDataGridOptions.onFiltersChange) customDataGridOptions.onFiltersChange(...
|
|
60
|
+
if (customDataGridOptions.onFiltersChange) customDataGridOptions.onFiltersChange(...arguments);
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
handleFiltersChange(nextFilters) {
|
|
@@ -86,7 +90,7 @@ class DataGridSearch extends react.Component {
|
|
|
86
90
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
87
91
|
children: [/*#__PURE__*/_jsx__default["default"](DSToolbar__default["default"], {
|
|
88
92
|
withDepth: false
|
|
89
|
-
}, 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, {
|
|
90
94
|
cleanOnSearch: true,
|
|
91
95
|
onSearch: this.handleSearch,
|
|
92
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;
|