@elliemae/ds-search-field 2.0.0-alpha.1 → 2.0.0-alpha.13

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.
@@ -1,67 +1,70 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import 'react';
3
3
  import { PropTypes, describe } from 'react-desc';
4
- import { TabTypes } from '@elliemae/ds-basic/Tabs';
4
+ import { TabTypes } from '@elliemae/ds-tabs';
5
5
  import DSSearchFieldImpl from './impl/DSSeachFieldImpl.js';
6
6
  export { default as DSModalSearchField } from './impl/components/ModalSearchField/ModalSearchField.js';
7
7
 
8
- const DSSearchField = ({
9
- containerProps = {},
10
- onChange = () => null,
11
- searchOptionLabel = 'Advanced Search',
12
- placeholder = 'Select field',
13
- modalSize = 'x-large',
14
- modalTitle = 'Search Field ID',
15
- tabsAnimated = true,
16
- tabsEnableMouseEvents = true,
17
- tabType = TabTypes.NORMAL,
18
- tabData = [],
19
- searchGrid = false,
20
- searchFilters = true,
21
- confirmLabel = 'Apply',
22
- rejectLabel = 'Cancel',
23
- modalType = 'confirm',
24
- onConfirmField = () => null,
25
- onRejectField = () => null,
26
- onTabChange = () => null,
27
- appElement = '#root',
28
- value = null,
29
- additionalInfo = null,
30
- displayProperty = 'name',
31
- dropdownOptions = [],
32
- customDataGridOptions = {},
33
- customDropdownOptions = {},
34
- useLookupIndicator = true,
35
- searchable = false
36
- }) => /*#__PURE__*/_jsx(DSSearchFieldImpl, {
37
- additionalInfo: additionalInfo,
38
- appElement: appElement,
39
- searchable: searchable,
40
- confirmLabel: confirmLabel,
41
- containerProps: containerProps,
42
- customDataGridOptions: customDataGridOptions,
43
- customDropdownOptions: customDropdownOptions,
44
- displayProperty: displayProperty,
45
- dropdownOptions: dropdownOptions,
46
- modalSize: modalSize,
47
- modalTitle: modalTitle,
48
- modalType: modalType,
49
- onChange: onChange,
50
- onConfirmField: onConfirmField,
51
- onRejectField: onRejectField,
52
- onTabChange: onTabChange,
53
- placeholder: placeholder,
54
- rejectLabel: rejectLabel,
55
- searchFilters: searchFilters,
56
- searchGrid: searchGrid,
57
- searchOptionLabel: searchOptionLabel,
58
- tabData: tabData,
59
- tabsAnimated: tabsAnimated,
60
- tabsEnableMouseEvents: tabsEnableMouseEvents,
61
- tabType: tabType,
62
- useLookupIndicator: useLookupIndicator,
63
- value: value
64
- });
8
+ const DSSearchField = _ref => {
9
+ let {
10
+ containerProps = {},
11
+ onChange = () => null,
12
+ searchOptionLabel = 'Advanced Search',
13
+ placeholder = 'Select field',
14
+ modalSize = 'x-large',
15
+ modalTitle = 'Search Field ID',
16
+ tabsAnimated = true,
17
+ tabsEnableMouseEvents = true,
18
+ tabType = TabTypes.NORMAL,
19
+ tabData = [],
20
+ searchGrid = false,
21
+ searchFilters = true,
22
+ confirmLabel = 'Apply',
23
+ rejectLabel = 'Cancel',
24
+ modalType = 'confirm',
25
+ onConfirmField = () => null,
26
+ onRejectField = () => null,
27
+ onTabChange = () => null,
28
+ appElement = '#root',
29
+ value = null,
30
+ additionalInfo = null,
31
+ displayProperty = 'name',
32
+ dropdownOptions = [],
33
+ customDataGridOptions = {},
34
+ customDropdownOptions = {},
35
+ useLookupIndicator = true,
36
+ searchable = false
37
+ } = _ref;
38
+ return /*#__PURE__*/_jsx(DSSearchFieldImpl, {
39
+ additionalInfo: additionalInfo,
40
+ appElement: appElement,
41
+ searchable: searchable,
42
+ confirmLabel: confirmLabel,
43
+ containerProps: containerProps,
44
+ customDataGridOptions: customDataGridOptions,
45
+ customDropdownOptions: customDropdownOptions,
46
+ displayProperty: displayProperty,
47
+ dropdownOptions: dropdownOptions,
48
+ modalSize: modalSize,
49
+ modalTitle: modalTitle,
50
+ modalType: modalType,
51
+ onChange: onChange,
52
+ onConfirmField: onConfirmField,
53
+ onRejectField: onRejectField,
54
+ onTabChange: onTabChange,
55
+ placeholder: placeholder,
56
+ rejectLabel: rejectLabel,
57
+ searchFilters: searchFilters,
58
+ searchGrid: searchGrid,
59
+ searchOptionLabel: searchOptionLabel,
60
+ tabData: tabData,
61
+ tabsAnimated: tabsAnimated,
62
+ tabsEnableMouseEvents: tabsEnableMouseEvents,
63
+ tabType: tabType,
64
+ useLookupIndicator: useLookupIndicator,
65
+ value: value
66
+ });
67
+ };
65
68
 
66
69
  const props = {
67
70
  /*
@@ -1,9 +1,17 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
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';
3
11
  import { Component } from 'react';
4
12
  import { components } from 'react-select';
5
13
  import { convertPropToCssClassName } from '@elliemae/ds-classnames';
6
- import { DSComboBox2 } from '@elliemae/ds-basic/form/ComboBox';
14
+ import { DSComboBox2 } from '@elliemae/ds-form';
7
15
  import ModalSearchField from './components/ModalSearchField/ModalSearchField.js';
8
16
  export { default as DSModalSearchField } from './components/ModalSearchField/ModalSearchField.js';
9
17
  import AdvanceSearchOption from './components/AdvanceSearchOption/AdvanceSearchOption.js';
@@ -30,7 +38,7 @@ class DSSearchFieldImpl extends Component {
30
38
  constructor(props) {
31
39
  super(props);
32
40
 
33
- _defineProperty(this, "onChange", () => {
41
+ this.onChange = () => {
34
42
  const {
35
43
  selected: id,
36
44
  additionalInfo: [row]
@@ -39,9 +47,9 @@ class DSSearchFieldImpl extends Component {
39
47
  onChange
40
48
  } = this.props;
41
49
  onChange(id, row);
42
- });
50
+ };
43
51
 
44
- _defineProperty(this, "onChangeDropdown", value => {
52
+ this.onChangeDropdown = value => {
45
53
  const {
46
54
  dropdownOptions
47
55
  } = this.props;
@@ -53,9 +61,9 @@ class DSSearchFieldImpl extends Component {
53
61
  if (selected) onChange(value, {
54
62
  [displayProperty]: selected.label
55
63
  });
56
- });
64
+ };
57
65
 
58
- _defineProperty(this, "onKeyDown", event => {
66
+ this.onKeyDown = event => {
59
67
  setTimeout(() => {
60
68
  const {
61
69
  keycode
@@ -65,9 +73,9 @@ class DSSearchFieldImpl extends Component {
65
73
  } = this.props;
66
74
  if (value && keycode === 13) this.handleCloseModal();
67
75
  }, 0);
68
- });
76
+ };
69
77
 
70
- _defineProperty(this, "handleSelect", (selectedRow, rows) => {
78
+ this.handleSelect = (selectedRow, rows) => {
71
79
  let selected = selectedRow; // fix new datagrid callback format
72
80
 
73
81
  if (!selected) return;
@@ -77,36 +85,36 @@ class DSSearchFieldImpl extends Component {
77
85
  selected,
78
86
  additionalInfo
79
87
  });
80
- });
88
+ };
81
89
 
82
- _defineProperty(this, "handleConfirm", () => {
90
+ this.handleConfirm = () => {
83
91
  const {
84
92
  onConfirmField
85
93
  } = this.props;
86
94
  this.onChange();
87
95
  this.handleCloseModal();
88
96
  onConfirmField();
89
- });
97
+ };
90
98
 
91
- _defineProperty(this, "handleReject", () => {
99
+ this.handleReject = () => {
92
100
  const {
93
101
  onRejectField
94
102
  } = this.props;
95
103
  this.handleCloseModal();
96
104
  onRejectField();
97
- });
105
+ };
98
106
 
99
- _defineProperty(this, "handleOpenModal", () => {
107
+ this.handleOpenModal = () => {
100
108
  this.setState({
101
109
  openModal: true
102
110
  });
103
- });
111
+ };
104
112
 
105
- _defineProperty(this, "handleCloseModal", () => this.setState({
113
+ this.handleCloseModal = () => this.setState({
106
114
  openModal: false,
107
115
  selected: [],
108
116
  additionalInfo: []
109
- }));
117
+ });
110
118
 
111
119
  advanceOption.label = props.searchOptionLabel;
112
120
  this.state = {
@@ -160,7 +168,7 @@ class DSSearchFieldImpl extends Component {
160
168
 
161
169
  if (props.data.isAdvance) {
162
170
  props.innerProps.onClick = this.handleOpenModal;
163
- props.innerProps.className = `${props.innerProps.className} ${advanceOption.className}`;
171
+ props.innerProps.className = "".concat(props.innerProps.className, " ").concat(advanceOption.className);
164
172
  }
165
173
 
166
174
  return /*#__PURE__*/jsx(components.Option, _objectSpread({}, props));
@@ -181,11 +189,11 @@ class DSSearchFieldImpl extends Component {
181
189
  }
182
190
 
183
191
  return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({}, containerProps), {}, {
184
- className: `${cssClassName}`,
192
+ className: "".concat(cssClassName),
185
193
  children: [/*#__PURE__*/_jsx("div", {
186
- className: `${classNameBlock('container-selector')}`
194
+ className: "".concat(classNameBlock('container-selector'))
187
195
  }, void 0, /*#__PURE__*/jsx(DSComboBox2, _objectSpread({
188
- className: `${classNameElement('dropdown-field-selector')}`,
196
+ className: "".concat(classNameElement('dropdown-field-selector')),
189
197
  components: customComponents,
190
198
  onChange: this.onChangeDropdown,
191
199
  onKeyDown: this.onKeyDown,
@@ -194,7 +202,7 @@ class DSSearchFieldImpl extends Component {
194
202
  searchable: searchable
195
203
  }, customDropdownOptions)), useLookupIndicator && /*#__PURE__*/_jsx(LookupIndicator, {
196
204
  buttonType: "text",
197
- className: `${classNameElement('btn-selector')} ${!value ? classNameModifier('btn-placeholder', 'btn-selector') : ''}`,
205
+ className: "".concat(classNameElement('btn-selector'), " ").concat(!value ? classNameModifier('btn-placeholder', 'btn-selector') : ''),
198
206
  onAdvanceSearchClick: this.handleOpenModal
199
207
  })), /*#__PURE__*/_jsx(ModalSearchField, {
200
208
  appElement: appElement,
@@ -1,16 +1,19 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import 'react';
3
- import DSButton from '@elliemae/ds-basic/Button';
3
+ import DSButton from '@elliemae/ds-button';
4
4
 
5
- const AdvanceSearchOption = ({
6
- advanceSearchLabel = 'Advanced Search',
7
- onAdvanceSearchClick = () => null
8
- }) => /*#__PURE__*/_jsx(DSButton, {
9
- className: "advance-search-option-btn",
10
- labelText: advanceSearchLabel,
11
- onClick: onAdvanceSearchClick,
12
- tabIndex: -1,
13
- type: "button"
14
- });
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
+ };
15
18
 
16
19
  export { AdvanceSearchOption as default };
@@ -1,24 +1,27 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import 'react';
3
- import Search from '@elliemae/ds-icons/Search';
4
- import DSButton from '@elliemae/ds-basic/Button';
3
+ import { Search } from '@elliemae/ds-icons';
4
+ import DSButton from '@elliemae/ds-button';
5
5
 
6
6
  var _Search;
7
7
 
8
- const LookupIndicator = ({
9
- onAdvanceSearchClick = () => null,
10
- className = ''
11
- }) => /*#__PURE__*/_jsx(DSButton, {
12
- "data-testid": "ds-searchfield-search-btn",
13
- buttonType: "secondary",
14
- className: className,
15
- icon: _Search || (_Search = /*#__PURE__*/_jsx(Search, {})),
16
- iconSize: "s",
17
- onClick: e => {
18
- e.stopPropagation();
19
- e.preventDefault();
20
- onAdvanceSearchClick();
21
- }
22
- });
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
+ };
23
26
 
24
27
  export { LookupIndicator as default };
@@ -1,9 +1,15 @@
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';
1
6
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
7
  import _jsx from '@babel/runtime/helpers/esm/jsx';
3
8
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
9
+ import 'core-js/modules/web.dom-collections.iterator.js';
4
10
  import { Component } from 'react';
5
- import DSToolbar, { ToolbarGroup } from '@elliemae/ds-basic/Toolbar';
6
- import DSSearchBox from '@elliemae/ds-basic/form/SearchBox';
11
+ import DSToolbar, { ToolbarGroup } from '@elliemae/ds-toolbar';
12
+ import { DSSearchBox } from '@elliemae/ds-form';
7
13
  import { DSDataGrid } from '@elliemae/ds-datagrids';
8
14
  import { uid } from 'uid';
9
15
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
@@ -23,14 +29,14 @@ class DataGridSearch extends Component {
23
29
  this.handleFiltersChange = this.handleFiltersChange.bind(this);
24
30
  }
25
31
 
26
- handleSearch(...args) {
32
+ handleSearch() {
27
33
  const {
28
34
  customDataGridOptions
29
35
  } = this.props;
30
36
  const {
31
37
  property,
32
38
  value
33
- } = args[0];
39
+ } = arguments.length <= 0 ? undefined : arguments[0];
34
40
  const {
35
41
  filters
36
42
  } = this.state;
@@ -42,7 +48,7 @@ class DataGridSearch extends Component {
42
48
  id: uid(16)
43
49
  }]
44
50
  });
45
- if (customDataGridOptions.onFiltersChange) customDataGridOptions.onFiltersChange(...args);
51
+ if (customDataGridOptions.onFiltersChange) customDataGridOptions.onFiltersChange(...arguments);
46
52
  }
47
53
 
48
54
  handleFiltersChange(nextFilters) {
@@ -1,68 +1,76 @@
1
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';
2
4
  import 'react';
3
5
  import DSModal from '@elliemae/ds-modal';
4
- import { TabTypes, DSTabs, DSTab } from '@elliemae/ds-basic/Tabs';
6
+ import { TabTypes, DSTabs, DSTab } from '@elliemae/ds-tabs';
5
7
  import DataGridSearch from './DataGridSearch.js';
6
8
 
7
- const ModalSearchField = ({
8
- isOpen = false,
9
- onClose = () => null,
10
- modalTitle = 'Search Field ID',
11
- modalSize = 'x-large',
12
- tabsAnimated = true,
13
- tabsEnableMouseEvents = true,
14
- tabType = TabTypes.NORMAL,
15
- tabData = [],
16
- searchFilters = true,
17
- searchGrid = false,
18
- confirmLabel = 'Apply',
19
- rejectLabel = 'Cancel',
20
- modalType = 'confirm',
21
- onConfirmField = () => null,
22
- onRejectField = () => null,
23
- handleSelect = () => null,
24
- onTabChange = () => null,
25
- appElement = null,
26
- customDataGridOptions = {}
27
- }) => /*#__PURE__*/_jsx(DSModal, {
28
- dataTestId: "ds-searchfield-modal",
29
- appElement: appElement,
30
- centered: false,
31
- className: "modal-search-field",
32
- confirmLabel: confirmLabel,
33
- isOpen: isOpen,
34
- modalTitle: modalTitle,
35
- modalType: modalType,
36
- onClose: onClose,
37
- onConfirm: onConfirmField,
38
- onReject: onRejectField,
39
- rejectLabel: rejectLabel,
40
- size: modalSize
41
- }, void 0, tabData.length > 0 && /*#__PURE__*/_jsx(DSTabs, {
42
- animated: tabsAnimated,
43
- enableMouseEvents: tabsEnableMouseEvents,
44
- onlyRenderActiveTab: true,
45
- onTabChange: onTabChange,
46
- type: tabType
47
- }, void 0, tabData.map(({
48
- tabId,
49
- tabTitle,
50
- columns,
51
- rows,
52
- boundFetchRows
53
- }) => /*#__PURE__*/_jsx(DSTab, {
54
- className: "tab-content",
55
- tabId: tabId,
56
- title: tabTitle
57
- }, tabId, /*#__PURE__*/_jsx(DataGridSearch, {
58
- boundFetchRows: boundFetchRows,
59
- columns: columns,
60
- customDataGridOptions: customDataGridOptions,
61
- handleSelect: handleSelect,
62
- id: `datagrid_search_field_${tabId}`,
63
- rows: rows,
64
- searchFilters: searchFilters,
65
- searchGrid: searchGrid
66
- })))));
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
+ };
67
75
 
68
76
  export { ModalSearchField as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-search-field",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.13",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Search Field",
6
6
  "module": "./esm/index.js",
@@ -56,19 +56,16 @@
56
56
  "build": "node ../../scripts/build/build.js"
57
57
  },
58
58
  "dependencies": {
59
- "@elliemae/ds-basic": "2.0.0-alpha.1",
60
- "@elliemae/ds-classnames": "2.0.0-alpha.1",
61
- "@elliemae/ds-utilities": "2.0.0-alpha.1",
62
- "react-edit": "~6.4.1",
63
- "react-scroll-sync": "~0.8.0",
64
- "react-select": "4.3.1",
65
- "reactabular": "~8.3.0",
66
- "reactabular-resizable": "~8.18.0",
67
- "reactabular-table": "~8.14.0",
68
- "searchtabular": "~1.9.0",
69
- "sortabular": "~1.6.0",
70
- "table-resolver": "~4.1.1",
71
- "treetabular": "~3.6.0",
59
+ "@elliemae/ds-button": "2.0.0-alpha.13",
60
+ "@elliemae/ds-classnames": "2.0.0-alpha.13",
61
+ "@elliemae/ds-datagrids": "2.0.0-alpha.13",
62
+ "@elliemae/ds-form": "2.0.0-alpha.13",
63
+ "@elliemae/ds-icons": "2.0.0-alpha.13",
64
+ "@elliemae/ds-modal": "2.0.0-alpha.13",
65
+ "@elliemae/ds-tabs": "2.0.0-alpha.13",
66
+ "@elliemae/ds-toolbar": "2.0.0-alpha.13",
67
+ "react-desc": "~4.1.3",
68
+ "react-select": "~4.3.0",
72
69
  "uid": "~2.0.0"
73
70
  },
74
71
  "publishConfig": {