@elliemae/ds-search-field 2.1.0 → 2.2.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.
Files changed (29) hide show
  1. package/cjs/DSSearchField.js +129 -165
  2. package/cjs/DSSearchField.js.map +7 -0
  3. package/cjs/impl/DSSeachFieldImpl.js +126 -157
  4. package/cjs/impl/DSSeachFieldImpl.js.map +7 -0
  5. package/cjs/impl/components/AdvanceSearchOption/AdvanceSearchOption.js +43 -25
  6. package/cjs/impl/components/AdvanceSearchOption/AdvanceSearchOption.js.map +7 -0
  7. package/cjs/impl/components/LookupIndicator/LookupIndicator.js +49 -33
  8. package/cjs/impl/components/LookupIndicator/LookupIndicator.js.map +7 -0
  9. package/cjs/impl/components/ModalSearchField/DataGridSearch.js +83 -93
  10. package/cjs/impl/components/ModalSearchField/DataGridSearch.js.map +7 -0
  11. package/cjs/impl/components/ModalSearchField/ModalSearchField.js +93 -82
  12. package/cjs/impl/components/ModalSearchField/ModalSearchField.js.map +7 -0
  13. package/cjs/index.js +37 -12
  14. package/cjs/index.js.map +7 -0
  15. package/esm/DSSearchField.js +97 -152
  16. package/esm/DSSearchField.js.map +7 -0
  17. package/esm/impl/DSSeachFieldImpl.js +96 -147
  18. package/esm/impl/DSSeachFieldImpl.js.map +7 -0
  19. package/esm/impl/components/AdvanceSearchOption/AdvanceSearchOption.js +14 -18
  20. package/esm/impl/components/AdvanceSearchOption/AdvanceSearchOption.js.map +7 -0
  21. package/esm/impl/components/LookupIndicator/LookupIndicator.js +20 -26
  22. package/esm/impl/components/LookupIndicator/LookupIndicator.js.map +7 -0
  23. package/esm/impl/components/ModalSearchField/DataGridSearch.js +53 -83
  24. package/esm/impl/components/ModalSearchField/DataGridSearch.js.map +7 -0
  25. package/esm/impl/components/ModalSearchField/ModalSearchField.js +64 -75
  26. package/esm/impl/components/ModalSearchField/ModalSearchField.js.map +7 -0
  27. package/esm/index.js +12 -2
  28. package/esm/index.js.map +7 -0
  29. package/package.json +9 -9
@@ -1,159 +1,104 @@
1
- import _jsx from '@babel/runtime/helpers/esm/jsx';
2
- import 'react';
3
- import { PropTypes, describe } from 'react-desc';
4
- import { TabTypes } from '@elliemae/ds-tabs';
5
- import DSSearchFieldImpl from './impl/DSSeachFieldImpl.js';
6
- export { default as DSModalSearchField } from './impl/components/ModalSearchField/ModalSearchField.js';
7
-
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
- };
68
-
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { describe, PropTypes } from "react-desc";
4
+ import { TabTypes } from "@elliemae/ds-tabs";
5
+ import DSSeachFieldImpl, { DSModalSearchField } from "./impl/DSSeachFieldImpl";
6
+ const DSSearchField = ({
7
+ containerProps = {},
8
+ onChange = () => null,
9
+ searchOptionLabel = "Advanced Search",
10
+ placeholder = "Select field",
11
+ modalSize = "x-large",
12
+ modalTitle = "Search Field ID",
13
+ tabsAnimated = true,
14
+ tabsEnableMouseEvents = true,
15
+ tabType = TabTypes.NORMAL,
16
+ tabData = [],
17
+ searchGrid = false,
18
+ searchFilters = true,
19
+ confirmLabel = "Apply",
20
+ rejectLabel = "Cancel",
21
+ modalType = "confirm",
22
+ onConfirmField = () => null,
23
+ onRejectField = () => null,
24
+ onTabChange = () => null,
25
+ appElement = "#root",
26
+ value = null,
27
+ additionalInfo = null,
28
+ displayProperty = "name",
29
+ dropdownOptions = [],
30
+ customDataGridOptions = {},
31
+ customDropdownOptions = {},
32
+ useLookupIndicator = true,
33
+ searchable = false
34
+ }) => /* @__PURE__ */ React2.createElement(DSSeachFieldImpl, {
35
+ additionalInfo,
36
+ appElement,
37
+ searchable,
38
+ confirmLabel,
39
+ containerProps,
40
+ customDataGridOptions,
41
+ customDropdownOptions,
42
+ displayProperty,
43
+ dropdownOptions,
44
+ modalSize,
45
+ modalTitle,
46
+ modalType,
47
+ onChange,
48
+ onConfirmField,
49
+ onRejectField,
50
+ onTabChange,
51
+ placeholder,
52
+ rejectLabel,
53
+ searchFilters,
54
+ searchGrid,
55
+ searchOptionLabel,
56
+ tabData,
57
+ tabsAnimated,
58
+ tabsEnableMouseEvents,
59
+ tabType,
60
+ useLookupIndicator,
61
+ value
62
+ });
69
63
  const props = {
70
- /*
71
- Enable the user to search on combobox
72
- */
73
- searchable: PropTypes.bool.description('Enable the user to search on combobox'),
74
-
75
- /** inject props to wrapper */
76
- containerProps: PropTypes.object.description('inject props to wrapper'),
77
-
78
- /** change handler */
79
- onChange: PropTypes.func.description('change handler'),
80
-
81
- /** search option label */
82
- searchOptionLabel: PropTypes.string.description('search option label'),
83
-
84
- /** placeholder for search input */
85
- placeholder: PropTypes.string.description('placeholder for search input'),
86
-
87
- /** search modal size */
88
- modalSize: PropTypes.oneOf(['x-large', 'large', 'medium']).description('search modal size'),
89
-
90
- /** search modal title */
91
- modalTitle: PropTypes.string.description('search modal title'),
92
-
93
- /** animate modal tabs */
94
- tabsAnimated: PropTypes.bool.description('animate modal tabs'),
95
-
96
- /** enable mouse event on tabs */
97
- tabsEnableMouseEvents: PropTypes.bool.description('enable mouse event on tabs'),
98
-
99
- /** tab types on modal */
100
- tabType: PropTypes.oneOf([TabTypes.NORMAL, TabTypes.SUBTABS]).description('tab types on modal'),
101
-
102
- /** data for modal tabs */
103
- tabData: PropTypes.array.description('data for modal tabs'),
104
-
105
- /** use search grid */
106
- searchGrid: PropTypes.bool.description('use search grid'),
107
-
108
- /** add search filters */
109
- searchFilters: PropTypes.bool.description('add search filters'),
110
-
111
- /** confirm modal label */
112
- confirmLabel: PropTypes.string.description('confirm modal label'),
113
-
114
- /** reject modal label */
115
- rejectLabel: PropTypes.string.description('reject modal label'),
116
-
117
- /** modal type */
118
- modalType: PropTypes.oneOf(['alert', 'confirm']).description('modal type'),
119
-
120
- /** on confirm handler */
121
- onConfirmField: PropTypes.func.description('on confirm handler'),
122
-
123
- /** on cancel handler */
124
- onRejectField: PropTypes.func.description('on cancel handler'),
125
-
126
- /** tab change handler */
127
- onTabChange: PropTypes.func.description('tab change handler'),
128
-
129
- /** app element */
130
- appElement: PropTypes.string.description('app element'),
131
-
132
- /** value for search */
133
- value: PropTypes.string.description('value for search'),
134
-
135
- /** additional info */
136
- additionalInfo: PropTypes.object.description('additional info'),
137
-
138
- /** display property */
139
- displayProperty: PropTypes.string.description('display property'),
140
-
141
- /** options for dropdown */
64
+ searchable: PropTypes.bool.description("Enable the user to search on combobox"),
65
+ containerProps: PropTypes.object.description("inject props to wrapper"),
66
+ onChange: PropTypes.func.description("change handler"),
67
+ searchOptionLabel: PropTypes.string.description("search option label"),
68
+ placeholder: PropTypes.string.description("placeholder for search input"),
69
+ modalSize: PropTypes.oneOf(["x-large", "large", "medium"]).description("search modal size"),
70
+ modalTitle: PropTypes.string.description("search modal title"),
71
+ tabsAnimated: PropTypes.bool.description("animate modal tabs"),
72
+ tabsEnableMouseEvents: PropTypes.bool.description("enable mouse event on tabs"),
73
+ tabType: PropTypes.oneOf([TabTypes.NORMAL, TabTypes.SUBTABS]).description("tab types on modal"),
74
+ tabData: PropTypes.array.description("data for modal tabs"),
75
+ searchGrid: PropTypes.bool.description("use search grid"),
76
+ searchFilters: PropTypes.bool.description("add search filters"),
77
+ confirmLabel: PropTypes.string.description("confirm modal label"),
78
+ rejectLabel: PropTypes.string.description("reject modal label"),
79
+ modalType: PropTypes.oneOf(["alert", "confirm"]).description("modal type"),
80
+ onConfirmField: PropTypes.func.description("on confirm handler"),
81
+ onRejectField: PropTypes.func.description("on cancel handler"),
82
+ onTabChange: PropTypes.func.description("tab change handler"),
83
+ appElement: PropTypes.string.description("app element"),
84
+ value: PropTypes.string.description("value for search"),
85
+ additionalInfo: PropTypes.object.description("additional info"),
86
+ displayProperty: PropTypes.string.description("display property"),
142
87
  dropdownOptions: PropTypes.arrayOf(PropTypes.shape({
143
88
  label: PropTypes.string,
144
89
  value: PropTypes.string
145
- })).description('options for dropdown'),
146
-
147
- /** pass down props for datagrid in modal */
148
- customDataGridOptions: PropTypes.object.description('pass down props for datagrid in modal'),
149
-
150
- /** custom props for dropdown */
151
- customDropdownOptions: PropTypes.object.description('custom props for dropdown'),
152
-
153
- /** enable lookup */
154
- useLookupIndicator: PropTypes.bool.description('enable lookup')
90
+ })).description("options for dropdown"),
91
+ customDataGridOptions: PropTypes.object.description("pass down props for datagrid in modal"),
92
+ customDropdownOptions: PropTypes.object.description("custom props for dropdown"),
93
+ useLookupIndicator: PropTypes.bool.description("enable lookup")
155
94
  };
95
+ DSSearchField.propTypes = props;
156
96
  const DSSearchFieldWithSchema = describe(DSSearchField);
157
97
  DSSearchFieldWithSchema.propTypes = props;
158
-
159
- export { DSSearchFieldWithSchema, DSSearchField as default };
98
+ var DSSearchField_default = DSSearchField;
99
+ export {
100
+ DSModalSearchField,
101
+ DSSearchFieldWithSchema,
102
+ DSSearchField_default as default
103
+ };
104
+ //# sourceMappingURL=DSSearchField.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSSearchField.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { TabTypes } from '@elliemae/ds-tabs';\nimport DSSeachFieldImpl, { DSModalSearchField } from './impl/DSSeachFieldImpl';\n\nconst DSSearchField = ({\n containerProps = {},\n onChange = () => null,\n searchOptionLabel = 'Advanced Search',\n placeholder = 'Select field',\n modalSize = 'x-large',\n modalTitle = 'Search Field ID',\n tabsAnimated = true,\n tabsEnableMouseEvents = true,\n tabType = TabTypes.NORMAL,\n tabData = [],\n searchGrid = false,\n searchFilters = true,\n confirmLabel = 'Apply',\n rejectLabel = 'Cancel',\n modalType = 'confirm',\n onConfirmField = () => null,\n onRejectField = () => null,\n onTabChange = () => null,\n appElement = '#root',\n value = null,\n additionalInfo = null,\n displayProperty = 'name',\n dropdownOptions = [],\n customDataGridOptions = {},\n customDropdownOptions = {},\n useLookupIndicator = true,\n searchable = false,\n}) => (\n <DSSeachFieldImpl\n additionalInfo={additionalInfo}\n appElement={appElement}\n searchable={searchable}\n confirmLabel={confirmLabel}\n containerProps={containerProps}\n customDataGridOptions={customDataGridOptions}\n customDropdownOptions={customDropdownOptions}\n displayProperty={displayProperty}\n dropdownOptions={dropdownOptions}\n modalSize={modalSize}\n modalTitle={modalTitle}\n modalType={modalType}\n onChange={onChange}\n onConfirmField={onConfirmField}\n onRejectField={onRejectField}\n onTabChange={onTabChange}\n placeholder={placeholder}\n rejectLabel={rejectLabel}\n searchFilters={searchFilters}\n searchGrid={searchGrid}\n searchOptionLabel={searchOptionLabel}\n tabData={tabData}\n tabsAnimated={tabsAnimated}\n tabsEnableMouseEvents={tabsEnableMouseEvents}\n tabType={tabType}\n useLookupIndicator={useLookupIndicator}\n value={value}\n />\n);\n\nconst props = {\n /*\n Enable the user to search on combobox\n */\n searchable: PropTypes.bool.description('Enable the user to search on combobox'),\n /** inject props to wrapper */\n containerProps: PropTypes.object.description('inject props to wrapper'),\n /** change handler */\n onChange: PropTypes.func.description('change handler'),\n /** search option label */\n searchOptionLabel: PropTypes.string.description('search option label'),\n /** placeholder for search input */\n placeholder: PropTypes.string.description('placeholder for search input'),\n /** search modal size */\n modalSize: PropTypes.oneOf(['x-large', 'large', 'medium']).description('search modal size'),\n /** search modal title */\n modalTitle: PropTypes.string.description('search modal title'),\n /** animate modal tabs */\n tabsAnimated: PropTypes.bool.description('animate modal tabs'),\n /** enable mouse event on tabs */\n tabsEnableMouseEvents: PropTypes.bool.description('enable mouse event on tabs'),\n /** tab types on modal */\n tabType: PropTypes.oneOf([TabTypes.NORMAL, TabTypes.SUBTABS]).description('tab types on modal'),\n /** data for modal tabs */\n tabData: PropTypes.array.description('data for modal tabs'),\n /** use search grid */\n searchGrid: PropTypes.bool.description('use search grid'),\n /** add search filters */\n searchFilters: PropTypes.bool.description('add search filters'),\n /** confirm modal label */\n confirmLabel: PropTypes.string.description('confirm modal label'),\n /** reject modal label */\n rejectLabel: PropTypes.string.description('reject modal label'),\n /** modal type */\n modalType: PropTypes.oneOf(['alert', 'confirm']).description('modal type'),\n /** on confirm handler */\n onConfirmField: PropTypes.func.description('on confirm handler'),\n /** on cancel handler */\n onRejectField: PropTypes.func.description('on cancel handler'),\n /** tab change handler */\n onTabChange: PropTypes.func.description('tab change handler'),\n /** app element */\n appElement: PropTypes.string.description('app element'),\n /** value for search */\n value: PropTypes.string.description('value for search'),\n /** additional info */\n additionalInfo: PropTypes.object.description('additional info'),\n /** display property */\n displayProperty: PropTypes.string.description('display property'),\n /** options for dropdown */\n dropdownOptions: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n }),\n ).description('options for dropdown'),\n /** pass down props for datagrid in modal */\n customDataGridOptions: PropTypes.object.description('pass down props for datagrid in modal'),\n /** custom props for dropdown */\n customDropdownOptions: PropTypes.object.description('custom props for dropdown'),\n /** enable lookup */\n useLookupIndicator: PropTypes.bool.description('enable lookup'),\n};\n\nDSSearchField.propTypes = props;\n\nconst DSSearchFieldWithSchema = describe(DSSearchField);\nDSSearchFieldWithSchema.propTypes = props;\n\nexport { DSModalSearchField, DSSearchFieldWithSchema };\nexport default DSSearchField;\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,gBAAgB,CAAC;AAAA,EACrB,iBAAiB;AAAA,EACjB,WAAW,MAAM;AAAA,EACjB,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,eAAe;AAAA,EACf,wBAAwB;AAAA,EACxB,UAAU,SAAS;AAAA,EACnB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,iBAAiB,MAAM;AAAA,EACvB,gBAAgB,MAAM;AAAA,EACtB,cAAc,MAAM;AAAA,EACpB,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,qBAAqB;AAAA,EACrB,aAAa;AAAA,MAEb,qCAAC,kBAAD;AAAA,EACE;AAAA,EACA;AAAA,EACA;A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EAE9C,iBAAiB,UAAU,QACzB,UAAU,MAAM;AAAA,IACd,OAAO,UAAU;AAAA,IACjB,OAAO,UAAU;AAAA,MAEnB,YAAY;AAAA,EAEd,uBAAuB,UAAU,OAAO,YAAY;AAAA,EAEpD,uBAAuB,UAAU,OAAO,YAAY;AAAA,EAEpD,oBAAoB,UAAU,KAAK,YAAY;AAAA;AAGjD,cAAc,YAAY;AAE1B,MAAM,0BAA0B,SAAS;AACzC,wBAAwB,YAAY;AAGpC,IAAO,wBAAQ;",
6
+ "names": []
7
+ }
@@ -1,121 +1,74 @@
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; }
1
+ import * as React from "react";
2
+ import React2, { Component } from "react";
3
+ import { components } from "react-select";
4
+ import { convertPropToCssClassName } from "@elliemae/ds-classnames";
5
+ import { DSComboBox2 } from "@elliemae/ds-form";
6
+ import DSModalSearchField from "./components/ModalSearchField/ModalSearchField";
7
+ import AdvanceSearchOption from "./components/AdvanceSearchOption/AdvanceSearchOption";
8
+ import LookupIndicator from "./components/LookupIndicator/LookupIndicator";
24
9
  const advanceOption = {
25
- className: 'advanced-search-option',
26
- label: 'Advanced search',
27
- value: 'search-field-advance-option',
10
+ className: "advanced-search-option",
11
+ label: "Advanced search",
12
+ value: "search-field-advance-option",
28
13
  isAdvance: true
29
14
  };
30
- const {
31
- cssClassName,
32
- classNameElement,
33
- classNameModifier,
34
- classNameBlock
35
- } = convertPropToCssClassName('query-builder-addon-search-field');
36
-
15
+ const { cssClassName, classNameElement, classNameModifier, classNameBlock } = convertPropToCssClassName("query-builder-addon-search-field");
37
16
  class DSSearchFieldImpl extends Component {
38
17
  constructor(props) {
39
18
  super(props);
40
-
41
19
  this.onChange = () => {
42
20
  const {
43
21
  selected: id,
44
22
  additionalInfo: [row]
45
23
  } = this.state;
46
- const {
47
- onChange
48
- } = this.props;
24
+ const { onChange } = this.props;
49
25
  onChange(id, row);
50
26
  };
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
- });
27
+ this.onChangeDropdown = (value) => {
28
+ const { dropdownOptions } = this.props;
29
+ const selected = dropdownOptions.find((op) => op.value === value);
30
+ const { onChange, displayProperty } = this.props;
31
+ if (selected)
32
+ onChange(value, { [displayProperty]: selected.label });
64
33
  };
65
-
66
- this.onKeyDown = event => {
34
+ this.onKeyDown = (event) => {
67
35
  setTimeout(() => {
68
- const {
69
- keycode
70
- } = event;
71
- const {
72
- value
73
- } = this.props;
74
- if (value && keycode === 13) this.handleCloseModal();
36
+ const { keycode } = event;
37
+ const { value } = this.props;
38
+ if (value && keycode === 13)
39
+ this.handleCloseModal();
75
40
  }, 0);
76
41
  };
77
-
78
42
  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
- });
43
+ let selected = selectedRow;
44
+ if (!selected)
45
+ return;
46
+ if (selected.id)
47
+ selected = selected.id;
48
+ else if (selected[0] && selected[0].id)
49
+ selected = selected[0].id;
50
+ const additionalInfo = rows.filter((row) => selected === row.id);
51
+ this.setState({ selected, additionalInfo });
88
52
  };
89
-
90
53
  this.handleConfirm = () => {
91
- const {
92
- onConfirmField
93
- } = this.props;
54
+ const { onConfirmField } = this.props;
94
55
  this.onChange();
95
56
  this.handleCloseModal();
96
57
  onConfirmField();
97
58
  };
98
-
99
59
  this.handleReject = () => {
100
- const {
101
- onRejectField
102
- } = this.props;
60
+ const { onRejectField } = this.props;
103
61
  this.handleCloseModal();
104
62
  onRejectField();
105
63
  };
106
-
107
64
  this.handleOpenModal = () => {
108
- this.setState({
109
- openModal: true
110
- });
65
+ this.setState({ openModal: true });
111
66
  };
112
-
113
67
  this.handleCloseModal = () => this.setState({
114
68
  openModal: false,
115
69
  selected: [],
116
70
  additionalInfo: []
117
71
  });
118
-
119
72
  advanceOption.label = props.searchOptionLabel;
120
73
  this.state = {
121
74
  openModal: false,
@@ -123,7 +76,6 @@ class DSSearchFieldImpl extends Component {
123
76
  additionalInfo: []
124
77
  };
125
78
  }
126
-
127
79
  render() {
128
80
  const {
129
81
  placeholder,
@@ -151,84 +103,81 @@ class DSSearchFieldImpl extends Component {
151
103
  containerProps,
152
104
  searchable
153
105
  } = this.props;
154
- const {
155
- openModal
156
- } = this.state;
106
+ const { openModal } = this.state;
157
107
  let options = [...dropdownOptions, advanceOption];
158
108
  let displayValue = !value ? placeholder : value;
159
- if (additionalInfo && additionalInfo[displayProperty]) displayValue = additionalInfo[displayProperty];
160
- const defaultoption = {
161
- value,
162
- label: displayValue
163
- };
109
+ if (additionalInfo && additionalInfo[displayProperty])
110
+ displayValue = additionalInfo[displayProperty];
111
+ const defaultoption = { value, label: displayValue };
164
112
  const customComponents = {
165
- Option: props => {
166
- // return <AdvanceSearchOption onAdvanceSearchClick={this.handleOpenModal} />
167
- props.innerProps.className = 'em-ds-combobox__option';
168
-
113
+ Option: (props) => {
114
+ props.innerProps.className = "em-ds-combobox__option";
169
115
  if (props.data.isAdvance) {
170
116
  props.innerProps.onClick = this.handleOpenModal;
171
- props.innerProps.className = "".concat(props.innerProps.className, " ").concat(advanceOption.className);
117
+ props.innerProps.className = `${props.innerProps.className} ${advanceOption.className}`;
172
118
  }
173
-
174
- return /*#__PURE__*/jsx(components.Option, _objectSpread({}, props));
119
+ return /* @__PURE__ */ React2.createElement(components.Option, {
120
+ ...props
121
+ });
175
122
  },
176
123
  IndicatorSeparator: () => null,
177
- NoOptionsMessage: props => /*#__PURE__*/jsx(AdvanceSearchOption, _objectSpread({
124
+ NoOptionsMessage: (props) => /* @__PURE__ */ React2.createElement(AdvanceSearchOption, {
178
125
  advanceSearchLabel: searchOptionLabel,
179
- onAdvanceSearchClick: this.handleOpenModal
180
- }, props))
126
+ onAdvanceSearchClick: this.handleOpenModal,
127
+ ...props
128
+ })
181
129
  };
182
-
183
130
  if (useLookupIndicator) {
184
131
  customComponents.DropdownIndicator = () => null;
185
132
  }
186
-
187
- if (!options.find(o => o.value === defaultoption.value)) {
133
+ if (!options.find((o) => o.value === defaultoption.value)) {
188
134
  options = [defaultoption, ...options];
189
135
  }
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
- })]
136
+ return /* @__PURE__ */ React2.createElement("div", {
137
+ ...containerProps,
138
+ className: `${cssClassName}`
139
+ }, /* @__PURE__ */ React2.createElement("div", {
140
+ className: `${classNameBlock("container-selector")}`
141
+ }, /* @__PURE__ */ React2.createElement(DSComboBox2, {
142
+ className: `${classNameElement("dropdown-field-selector")}`,
143
+ components: customComponents,
144
+ onChange: this.onChangeDropdown,
145
+ onKeyDown: this.onKeyDown,
146
+ options,
147
+ value,
148
+ searchable,
149
+ ...customDropdownOptions
150
+ }), useLookupIndicator && /* @__PURE__ */ React2.createElement(LookupIndicator, {
151
+ buttonType: "text",
152
+ className: `${classNameElement("btn-selector")} ${!value ? classNameModifier("btn-placeholder", "btn-selector") : ""}`,
153
+ onAdvanceSearchClick: this.handleOpenModal
154
+ })), /* @__PURE__ */ React2.createElement(DSModalSearchField, {
155
+ appElement,
156
+ confirmLabel,
157
+ customDataGridOptions,
158
+ handleSelect: this.handleSelect,
159
+ isOpen: openModal,
160
+ modalSize,
161
+ modalTitle,
162
+ modalType,
163
+ onClose: this.handleCloseModal,
164
+ onConfirmField: this.handleConfirm,
165
+ onRejectField: this.handleReject,
166
+ onTabChange,
167
+ placeholder,
168
+ rejectLabel,
169
+ searchFilters,
170
+ searchGrid,
171
+ tabData,
172
+ tabsAnimated,
173
+ tabsEnableMouseEvents,
174
+ tabType
229
175
  }));
230
176
  }
231
-
232
177
  }
233
-
234
- export { DSSearchFieldImpl as default };
178
+ var DSSeachFieldImpl_default = DSSearchFieldImpl;
179
+ export {
180
+ DSModalSearchField,
181
+ DSSeachFieldImpl_default as default
182
+ };
183
+ //# sourceMappingURL=DSSeachFieldImpl.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/impl/DSSeachFieldImpl.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable react/prop-types */\nimport React, { Component } from 'react';\nimport { components } from 'react-select';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSComboBox2 } from '@elliemae/ds-form';\n\nimport DSModalSearchField from './components/ModalSearchField/ModalSearchField';\nimport AdvanceSearchOption from './components/AdvanceSearchOption/AdvanceSearchOption';\nimport LookupIndicator from './components/LookupIndicator/LookupIndicator';\n\nconst advanceOption = {\n className: 'advanced-search-option',\n label: 'Advanced search',\n value: 'search-field-advance-option',\n isAdvance: true,\n};\nconst { cssClassName, classNameElement, classNameModifier, classNameBlock } = convertPropToCssClassName(\n 'query-builder-addon-search-field',\n);\n\nclass DSSearchFieldImpl extends Component {\n constructor(props) {\n super(props);\n advanceOption.label = props.searchOptionLabel;\n this.state = {\n openModal: false,\n selected: null,\n additionalInfo: [],\n };\n }\n\n onChange = () => {\n const {\n selected: id,\n additionalInfo: [row],\n } = this.state;\n const { onChange } = this.props;\n onChange(id, row);\n };\n\n onChangeDropdown = (value) => {\n const { dropdownOptions } = this.props;\n const selected = dropdownOptions.find((op) => op.value === value);\n const { onChange, displayProperty } = this.props;\n if (selected) onChange(value, { [displayProperty]: selected.label });\n };\n\n onKeyDown = (event) => {\n setTimeout(() => {\n const { keycode } = event;\n const { value } = this.props;\n if (value && keycode === 13) this.handleCloseModal();\n }, 0);\n };\n\n handleSelect = (selectedRow, rows) => {\n let selected = selectedRow;\n // fix new datagrid callback format\n if (!selected) return;\n if (selected.id) selected = selected.id;\n else if (selected[0] && selected[0].id) selected = selected[0].id;\n const additionalInfo = rows.filter((row) => selected === row.id);\n this.setState({ selected, additionalInfo });\n };\n\n handleConfirm = () => {\n const { onConfirmField } = this.props;\n this.onChange();\n this.handleCloseModal();\n onConfirmField();\n };\n\n handleReject = () => {\n const { onRejectField } = this.props;\n this.handleCloseModal();\n onRejectField();\n };\n\n handleOpenModal = () => {\n this.setState({ openModal: true });\n };\n\n handleCloseModal = () =>\n this.setState({\n openModal: false,\n selected: [],\n additionalInfo: [],\n });\n\n render() {\n const {\n placeholder,\n modalTitle,\n modalSize,\n tabsAnimated,\n tabsEnableMouseEvents,\n tabType,\n tabData,\n searchFilters,\n searchGrid,\n confirmLabel,\n rejectLabel,\n modalType,\n appElement,\n value,\n additionalInfo,\n displayProperty,\n dropdownOptions,\n searchOptionLabel,\n customDataGridOptions,\n customDropdownOptions,\n useLookupIndicator,\n onTabChange,\n containerProps,\n searchable,\n } = this.props;\n const { openModal } = this.state;\n\n let options = [...dropdownOptions, advanceOption];\n let displayValue = !value ? placeholder : value;\n if (additionalInfo && additionalInfo[displayProperty]) displayValue = additionalInfo[displayProperty];\n\n const defaultoption = { value, label: displayValue };\n\n const customComponents = {\n Option: (props) => {\n // return <AdvanceSearchOption onAdvanceSearchClick={this.handleOpenModal} />\n props.innerProps.className = 'em-ds-combobox__option';\n if (props.data.isAdvance) {\n props.innerProps.onClick = this.handleOpenModal;\n props.innerProps.className = `${props.innerProps.className} ${advanceOption.className}`;\n }\n return <components.Option {...props} />;\n },\n IndicatorSeparator: () => null,\n NoOptionsMessage: (props) => (\n <AdvanceSearchOption\n advanceSearchLabel={searchOptionLabel}\n onAdvanceSearchClick={this.handleOpenModal}\n {...props}\n />\n ),\n };\n if (useLookupIndicator) {\n customComponents.DropdownIndicator = () => null;\n }\n\n if (!options.find((o) => o.value === defaultoption.value)) {\n options = [defaultoption, ...options];\n }\n return (\n <div {...containerProps} className={`${cssClassName}`}>\n <div className={`${classNameBlock('container-selector')}`}>\n <DSComboBox2\n className={`${classNameElement('dropdown-field-selector')}`}\n components={customComponents}\n onChange={this.onChangeDropdown}\n onKeyDown={this.onKeyDown}\n options={options}\n value={value}\n searchable={searchable}\n {...customDropdownOptions}\n />\n {useLookupIndicator && (\n <LookupIndicator\n buttonType=\"text\"\n className={`${classNameElement('btn-selector')} ${\n !value ? classNameModifier('btn-placeholder', 'btn-selector') : ''\n }`}\n onAdvanceSearchClick={this.handleOpenModal}\n />\n )}\n </div>\n <DSModalSearchField\n appElement={appElement}\n confirmLabel={confirmLabel}\n customDataGridOptions={customDataGridOptions}\n handleSelect={this.handleSelect}\n isOpen={openModal}\n modalSize={modalSize}\n modalTitle={modalTitle}\n modalType={modalType}\n onClose={this.handleCloseModal}\n onConfirmField={this.handleConfirm}\n onRejectField={this.handleReject}\n onTabChange={onTabChange}\n placeholder={placeholder}\n rejectLabel={rejectLabel}\n searchFilters={searchFilters}\n searchGrid={searchGrid}\n tabData={tabData}\n tabsAnimated={tabsAnimated}\n tabsEnableMouseEvents={tabsEnableMouseEvents}\n tabType={tabType}\n />\n </div>\n );\n }\n}\n\nexport { DSModalSearchField };\nexport default DSSearchFieldImpl;\n"],
5
+ "mappings": "AAAA;ACEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA,MAAM,gBAAgB;AAAA,EACpB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AAAA,EACP,WAAW;AAAA;AAEb,MAAM,EAAE,cAAc,kBAAkB,mBAAmB,mBAAmB,0BAC5E;AAGF,gCAAgC,UAAU;AAAA,EACxC,YAAY,OAAO;AACjB,UAAM;AASR,oBAAW,MAAM;AACf,YAAM;AAAA,QACJ,UAAU;AAAA,QACV,gBAAgB,CAAC;AAAA,UACf,KAAK;AACT,YAAM,EAAE,aAAa,KAAK;AAC1B,eAAS,IAAI;AAAA;AAGf,4BAAmB,CAAC,UAAU;AAC5B,YAAM,EAAE,oBAAoB,KAAK;AACjC,YAAM,WAAW,gBAAgB,KAAK,CAAC,OAAO,GAAG,UAAU;AAC3D,YAAM,EAAE,UAAU,oBAAoB,KAAK;AAC3C,UAAI;AAAU,iBAAS,OAAO,GAAG,kBAAkB,SAAS;AAAA;AAG9D,qBAAY,CAAC,UAAU;AACrB,iBAAW,MAAM;AACf,cAAM,EAAE,YAAY;AACpB,cAAM,EAAE,UAAU,KAAK;AACvB,YAAI,SAAS,YAAY;AAAI,eAAK;AAAA,SACjC;AAAA;AAGL,wBAAe,CAAC,aAAa,SAAS;AACpC,UAAI,WAAW;AAEf,UAAI,CAAC;AAAU;AACf,UAAI,SAAS;AAAI,mBAAW,SAAS;AAAA,eAC5B,SAAS,MAAM,SAAS,GAAG;AAAI,mBAAW,SAAS,GAAG;AAC/D,YAAM,iBAAiB,KAAK,OAAO,CAAC,QAAQ,aAAa,IAAI;AAC7D,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