@elliemae/ds-search-field 2.3.0-next.3 → 3.0.0-alpha.0

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 (50) hide show
  1. package/dist/cjs/DSSearchField.js +133 -0
  2. package/dist/cjs/DSSearchField.js.map +7 -0
  3. package/dist/cjs/impl/DSSeachFieldImpl.js +212 -0
  4. package/dist/cjs/impl/DSSeachFieldImpl.js.map +7 -0
  5. package/dist/cjs/impl/components/AdvanceSearchOption/AdvanceSearchOption.js +44 -0
  6. package/dist/cjs/impl/components/AdvanceSearchOption/AdvanceSearchOption.js.map +7 -0
  7. package/dist/cjs/impl/components/LookupIndicator/LookupIndicator.js +50 -0
  8. package/dist/cjs/impl/components/LookupIndicator/LookupIndicator.js.map +7 -0
  9. package/dist/cjs/impl/components/ModalSearchField/DataGridSearch.js +107 -0
  10. package/dist/cjs/impl/components/ModalSearchField/DataGridSearch.js.map +7 -0
  11. package/dist/cjs/impl/components/ModalSearchField/ModalSearchField.js +94 -0
  12. package/dist/cjs/impl/components/ModalSearchField/ModalSearchField.js.map +7 -0
  13. package/dist/cjs/index.js +37 -0
  14. package/dist/cjs/index.js.map +7 -0
  15. package/dist/esm/DSSearchField.js +104 -0
  16. package/dist/esm/DSSearchField.js.map +7 -0
  17. package/dist/esm/impl/DSSeachFieldImpl.js +183 -0
  18. package/dist/esm/impl/DSSeachFieldImpl.js.map +7 -0
  19. package/dist/esm/impl/components/AdvanceSearchOption/AdvanceSearchOption.js +15 -0
  20. package/dist/esm/impl/components/AdvanceSearchOption/AdvanceSearchOption.js.map +7 -0
  21. package/dist/esm/impl/components/LookupIndicator/LookupIndicator.js +21 -0
  22. package/dist/esm/impl/components/LookupIndicator/LookupIndicator.js.map +7 -0
  23. package/dist/esm/impl/components/ModalSearchField/DataGridSearch.js +78 -0
  24. package/dist/esm/impl/components/ModalSearchField/DataGridSearch.js.map +7 -0
  25. package/dist/esm/impl/components/ModalSearchField/ModalSearchField.js +65 -0
  26. package/dist/esm/impl/components/ModalSearchField/ModalSearchField.js.map +7 -0
  27. package/dist/esm/index.js +12 -0
  28. package/dist/esm/index.js.map +7 -0
  29. package/{types → dist/types}/DSSearchField.d.ts +0 -0
  30. package/{types → dist/types}/impl/DSSeachFieldImpl.d.ts +0 -0
  31. package/{types → dist/types}/impl/components/AdvanceSearchOption/AdvanceSearchOption.d.ts +0 -0
  32. package/{types → dist/types}/impl/components/LookupIndicator/LookupIndicator.d.ts +0 -0
  33. package/{types → dist/types}/impl/components/ModalSearchField/DataGridSearch.d.ts +0 -0
  34. package/{types → dist/types}/impl/components/ModalSearchField/ModalSearchField.d.ts +0 -0
  35. package/{types → dist/types}/index.d.ts +0 -0
  36. package/package.json +44 -36
  37. package/cjs/DSSearchField.js +0 -169
  38. package/cjs/impl/DSSeachFieldImpl.js +0 -243
  39. package/cjs/impl/components/AdvanceSearchOption/AdvanceSearchOption.js +0 -26
  40. package/cjs/impl/components/LookupIndicator/LookupIndicator.js +0 -34
  41. package/cjs/impl/components/ModalSearchField/DataGridSearch.js +0 -117
  42. package/cjs/impl/components/ModalSearchField/ModalSearchField.js +0 -83
  43. package/cjs/index.js +0 -12
  44. package/esm/DSSearchField.js +0 -159
  45. package/esm/impl/DSSeachFieldImpl.js +0 -234
  46. package/esm/impl/components/AdvanceSearchOption/AdvanceSearchOption.js +0 -19
  47. package/esm/impl/components/LookupIndicator/LookupIndicator.js +0 -27
  48. package/esm/impl/components/ModalSearchField/DataGridSearch.js +0 -108
  49. package/esm/impl/components/ModalSearchField/ModalSearchField.js +0 -76
  50. package/esm/index.js +0 -2
@@ -0,0 +1,65 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import DSModal from "@elliemae/ds-modal";
4
+ import { DSTabs, DSTab, TabTypes } from "@elliemae/ds-tabs";
5
+ import DataGridSearch from "./DataGridSearch";
6
+ const ModalSearchField = ({
7
+ isOpen = false,
8
+ onClose = () => null,
9
+ modalTitle = "Search Field ID",
10
+ modalSize = "x-large",
11
+ tabsAnimated = true,
12
+ tabsEnableMouseEvents = true,
13
+ tabType = TabTypes.NORMAL,
14
+ tabData = [],
15
+ searchFilters = true,
16
+ searchGrid = false,
17
+ confirmLabel = "Apply",
18
+ rejectLabel = "Cancel",
19
+ modalType = "confirm",
20
+ onConfirmField = () => null,
21
+ onRejectField = () => null,
22
+ handleSelect = () => null,
23
+ onTabChange = () => null,
24
+ appElement = null,
25
+ customDataGridOptions = {}
26
+ }) => /* @__PURE__ */ React2.createElement(DSModal, {
27
+ dataTestId: "ds-searchfield-modal",
28
+ appElement,
29
+ centered: false,
30
+ className: "modal-search-field",
31
+ confirmLabel,
32
+ isOpen,
33
+ modalTitle,
34
+ modalType,
35
+ onClose,
36
+ onConfirm: onConfirmField,
37
+ onReject: onRejectField,
38
+ rejectLabel,
39
+ size: modalSize
40
+ }, tabData.length > 0 && /* @__PURE__ */ React2.createElement(DSTabs, {
41
+ animated: tabsAnimated,
42
+ enableMouseEvents: tabsEnableMouseEvents,
43
+ onlyRenderActiveTab: true,
44
+ onTabChange,
45
+ type: tabType
46
+ }, tabData.map(({ tabId, tabTitle, columns, rows, boundFetchRows }) => /* @__PURE__ */ React2.createElement(DSTab, {
47
+ key: tabId,
48
+ className: "tab-content",
49
+ tabId,
50
+ title: tabTitle
51
+ }, /* @__PURE__ */ React2.createElement(DataGridSearch, {
52
+ boundFetchRows,
53
+ columns,
54
+ customDataGridOptions,
55
+ handleSelect,
56
+ id: `datagrid_search_field_${tabId}`,
57
+ rows,
58
+ searchFilters,
59
+ searchGrid
60
+ })))));
61
+ var ModalSearchField_default = ModalSearchField;
62
+ export {
63
+ ModalSearchField_default as default
64
+ };
65
+ //# sourceMappingURL=ModalSearchField.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/impl/components/ModalSearchField/ModalSearchField.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport DSModal from '@elliemae/ds-modal';\nimport { DSTabs, DSTab, TabTypes } from '@elliemae/ds-tabs';\nimport DataGridSearch from './DataGridSearch';\n\nconst ModalSearchField = ({\n isOpen = false,\n onClose = () => null,\n modalTitle = 'Search Field ID',\n modalSize = 'x-large',\n tabsAnimated = true,\n tabsEnableMouseEvents = true,\n tabType = TabTypes.NORMAL,\n tabData = [],\n searchFilters = true,\n searchGrid = false,\n confirmLabel = 'Apply',\n rejectLabel = 'Cancel',\n modalType = 'confirm',\n onConfirmField = () => null,\n onRejectField = () => null,\n handleSelect = () => null,\n onTabChange = () => null,\n appElement = null,\n customDataGridOptions = {},\n}) => (\n <DSModal\n dataTestId=\"ds-searchfield-modal\"\n appElement={appElement}\n centered={false}\n className=\"modal-search-field\"\n confirmLabel={confirmLabel}\n isOpen={isOpen}\n modalTitle={modalTitle}\n modalType={modalType}\n onClose={onClose}\n onConfirm={onConfirmField}\n onReject={onRejectField}\n rejectLabel={rejectLabel}\n size={modalSize}\n >\n {tabData.length > 0 && (\n <DSTabs\n animated={tabsAnimated}\n enableMouseEvents={tabsEnableMouseEvents}\n onlyRenderActiveTab\n onTabChange={onTabChange}\n type={tabType}\n >\n {tabData.map(({ tabId, tabTitle, columns, rows, boundFetchRows }) => (\n <DSTab key={tabId} className=\"tab-content\" tabId={tabId} title={tabTitle}>\n <DataGridSearch\n boundFetchRows={boundFetchRows}\n columns={columns}\n customDataGridOptions={customDataGridOptions}\n handleSelect={handleSelect}\n id={`datagrid_search_field_${tabId}`}\n rows={rows}\n searchFilters={searchFilters}\n searchGrid={searchGrid}\n />\n </DSTab>\n ))}\n </DSTabs>\n )}\n </DSModal>\n);\n\nexport default ModalSearchField;\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,mBAAmB,CAAC;AAAA,EACxB,SAAS;AAAA,EACT,UAAU,MAAM;AAAA,EAChB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,wBAAwB;AAAA,EACxB,UAAU,SAAS;AAAA,EACnB,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,eAAe;AAAA,EACf,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,iBAAiB,MAAM;AAAA,EACvB,gBAAgB,MAAM;AAAA,EACtB,eAAe,MAAM;AAAA,EACrB,cAAc,MAAM;AAAA,EACpB,aAAa;AAAA,EACb,wBAAwB;AAAA,MAExB,qCAAC,SAAD;AAAA,EACE,YAAW;AAAA,EACX;AAAA,EACA,UAAU;AAAA,EACV,WAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,UAAU;AAAA,EACV;AAAA,EACA,MAAM;AAAA,GAEL,QAAQ,SAAS,KAChB,qCAAC,QAAD;AAAA,EACE,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,qBAAmB;AAAA,EACnB;AAAA,EACA,MAAM;AAAA,GAEL,QAAQ,IAAI,CAAC,EAAE,OAAO,UAAU,SAAS,MAAM,qBAC9C,qCAAC,OAAD;AAAA,EAAO,KAAK;AAAA,EAAO,WAAU;AAAA,EAAc;AAAA,EAAc,OAAO;AAAA,GAC9D,qCAAC,gBAAD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,IAAI,yBAAyB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA;AASd,IAAO,2BAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import {
3
+ default as default2,
4
+ DSModalSearchField,
5
+ DSSearchFieldWithSchema
6
+ } from "./DSSearchField";
7
+ export {
8
+ DSModalSearchField,
9
+ DSSearchFieldWithSchema,
10
+ default2 as default
11
+ };
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export {\n default,\n DSModalSearchField,\n DSSearchFieldWithSchema,\n} from './DSSearchField';\n"],
5
+ "mappings": "AAAA;ACAA;AAAA;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,39 +1,42 @@
1
1
  {
2
2
  "name": "@elliemae/ds-search-field",
3
- "version": "2.3.0-next.3",
3
+ "version": "3.0.0-alpha.0",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Search Field",
6
- "module": "./esm/index.js",
7
- "main": "./cjs/index.js",
8
- "types": "./types/index.d.ts",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "module": "./dist/esm/index.js",
10
+ "main": "./dist/cjs/index.js",
11
+ "types": "./dist/types/index.d.ts",
9
12
  "exports": {
10
13
  ".": {
11
- "import": "./esm/index.js",
12
- "require": "./cjs/index.js"
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
13
16
  },
14
17
  "./impl/DSSeachFieldImpl": {
15
- "import": "./esm/impl/DSSeachFieldImpl.js",
16
- "require": "./cjs/impl/DSSeachFieldImpl.js"
18
+ "import": "./dist/esm/impl/DSSeachFieldImpl.js",
19
+ "require": "./dist/cjs/impl/DSSeachFieldImpl.js"
17
20
  },
18
21
  "./impl/components/ModalSearchField/ModalSearchField": {
19
- "import": "./esm/impl/components/ModalSearchField/ModalSearchField.js",
20
- "require": "./cjs/impl/components/ModalSearchField/ModalSearchField.js"
22
+ "import": "./dist/esm/impl/components/ModalSearchField/ModalSearchField.js",
23
+ "require": "./dist/cjs/impl/components/ModalSearchField/ModalSearchField.js"
21
24
  },
22
25
  "./impl/components/ModalSearchField/DataGridSearch": {
23
- "import": "./esm/impl/components/ModalSearchField/DataGridSearch.js",
24
- "require": "./cjs/impl/components/ModalSearchField/DataGridSearch.js"
26
+ "import": "./dist/esm/impl/components/ModalSearchField/DataGridSearch.js",
27
+ "require": "./dist/cjs/impl/components/ModalSearchField/DataGridSearch.js"
25
28
  },
26
29
  "./impl/components/LookupIndicator/LookupIndicator": {
27
- "import": "./esm/impl/components/LookupIndicator/LookupIndicator.js",
28
- "require": "./cjs/impl/components/LookupIndicator/LookupIndicator.js"
30
+ "import": "./dist/esm/impl/components/LookupIndicator/LookupIndicator.js",
31
+ "require": "./dist/cjs/impl/components/LookupIndicator/LookupIndicator.js"
29
32
  },
30
33
  "./impl/components/AdvanceSearchOption/AdvanceSearchOption": {
31
- "import": "./esm/impl/components/AdvanceSearchOption/AdvanceSearchOption.js",
32
- "require": "./cjs/impl/components/AdvanceSearchOption/AdvanceSearchOption.js"
34
+ "import": "./dist/esm/impl/components/AdvanceSearchOption/AdvanceSearchOption.js",
35
+ "require": "./dist/cjs/impl/components/AdvanceSearchOption/AdvanceSearchOption.js"
33
36
  },
34
37
  "./DSSearchField": {
35
- "import": "./esm/DSSearchField.js",
36
- "require": "./cjs/DSSearchField.js"
38
+ "import": "./dist/esm/DSSearchField.js",
39
+ "require": "./dist/cjs/DSSearchField.js"
37
40
  }
38
41
  },
39
42
  "sideEffects": [
@@ -45,37 +48,42 @@
45
48
  "url": "https://git.elliemae.io/platform-ui/dimsum.git"
46
49
  },
47
50
  "engines": {
48
- "npm": ">=7",
49
- "node": ">=14"
51
+ "pnpm": ">=6",
52
+ "node": ">=16"
50
53
  },
51
54
  "author": "ICE MT",
52
- "scripts": {
53
- "dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
54
- "prebuild": "exit 0",
55
- "predev": "exit 0",
56
- "build": "node ../../scripts/build/build.js"
55
+ "jestSonar": {
56
+ "sonar56x": true,
57
+ "reportPath": "reports",
58
+ "reportFile": "tests.xml",
59
+ "indent": 4
57
60
  },
58
61
  "dependencies": {
59
- "@elliemae/ds-button": "2.3.0-next.3",
60
- "@elliemae/ds-classnames": "2.3.0-next.3",
61
- "@elliemae/ds-datagrids": "2.3.0-next.3",
62
- "@elliemae/ds-form": "2.3.0-next.3",
63
- "@elliemae/ds-icons": "2.3.0-next.3",
64
- "@elliemae/ds-modal": "2.3.0-next.3",
65
- "@elliemae/ds-tabs": "2.3.0-next.3",
66
- "@elliemae/ds-toolbar": "2.3.0-next.3",
62
+ "@elliemae/ds-button": "3.0.0-alpha.0",
63
+ "@elliemae/ds-classnames": "3.0.0-alpha.0",
64
+ "@elliemae/ds-datagrids": "3.0.0-alpha.0",
65
+ "@elliemae/ds-form": "3.0.0-alpha.0",
66
+ "@elliemae/ds-icons": "3.0.0-alpha.0",
67
+ "@elliemae/ds-modal": "3.0.0-alpha.0",
68
+ "@elliemae/ds-tabs": "3.0.0-alpha.0",
69
+ "@elliemae/ds-toolbar": "3.0.0-alpha.0",
67
70
  "react-desc": "~4.1.3",
68
- "react-select": "~4.3.0",
71
+ "react-select": "~4.3.1",
69
72
  "uid": "~2.0.0"
70
73
  },
71
74
  "publishConfig": {
72
75
  "access": "public",
73
- "directory": "dist",
74
- "generateSubmodules": true
76
+ "typeSafety": false
75
77
  },
76
78
  "peerDependencies": {
77
79
  "lodash": "^4.17.21",
78
80
  "react": "~17.0.2",
79
81
  "react-dom": "^17.0.2"
82
+ },
83
+ "scripts": {
84
+ "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
85
+ "test": "node ../../scripts/testing/test.mjs",
86
+ "lint": "node ../../scripts/lint.mjs",
87
+ "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
80
88
  }
81
89
  }
@@ -1,169 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- require('react');
7
- var reactDesc = require('react-desc');
8
- var dsTabs = require('@elliemae/ds-tabs');
9
- var DSSeachFieldImpl = require('./impl/DSSeachFieldImpl.js');
10
- var ModalSearchField = require('./impl/components/ModalSearchField/ModalSearchField.js');
11
-
12
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
-
14
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
15
-
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
- };
76
-
77
- const props = {
78
- /*
79
- Enable the user to search on combobox
80
- */
81
- searchable: reactDesc.PropTypes.bool.description('Enable the user to search on combobox'),
82
-
83
- /** inject props to wrapper */
84
- containerProps: reactDesc.PropTypes.object.description('inject props to wrapper'),
85
-
86
- /** change handler */
87
- onChange: reactDesc.PropTypes.func.description('change handler'),
88
-
89
- /** search option label */
90
- searchOptionLabel: reactDesc.PropTypes.string.description('search option label'),
91
-
92
- /** placeholder for search input */
93
- placeholder: reactDesc.PropTypes.string.description('placeholder for search input'),
94
-
95
- /** search modal size */
96
- modalSize: reactDesc.PropTypes.oneOf(['x-large', 'large', 'medium']).description('search modal size'),
97
-
98
- /** search modal title */
99
- modalTitle: reactDesc.PropTypes.string.description('search modal title'),
100
-
101
- /** animate modal tabs */
102
- tabsAnimated: reactDesc.PropTypes.bool.description('animate modal tabs'),
103
-
104
- /** enable mouse event on tabs */
105
- tabsEnableMouseEvents: reactDesc.PropTypes.bool.description('enable mouse event on tabs'),
106
-
107
- /** tab types on modal */
108
- tabType: reactDesc.PropTypes.oneOf([dsTabs.TabTypes.NORMAL, dsTabs.TabTypes.SUBTABS]).description('tab types on modal'),
109
-
110
- /** data for modal tabs */
111
- tabData: reactDesc.PropTypes.array.description('data for modal tabs'),
112
-
113
- /** use search grid */
114
- searchGrid: reactDesc.PropTypes.bool.description('use search grid'),
115
-
116
- /** add search filters */
117
- searchFilters: reactDesc.PropTypes.bool.description('add search filters'),
118
-
119
- /** confirm modal label */
120
- confirmLabel: reactDesc.PropTypes.string.description('confirm modal label'),
121
-
122
- /** reject modal label */
123
- rejectLabel: reactDesc.PropTypes.string.description('reject modal label'),
124
-
125
- /** modal type */
126
- modalType: reactDesc.PropTypes.oneOf(['alert', 'confirm']).description('modal type'),
127
-
128
- /** on confirm handler */
129
- onConfirmField: reactDesc.PropTypes.func.description('on confirm handler'),
130
-
131
- /** on cancel handler */
132
- onRejectField: reactDesc.PropTypes.func.description('on cancel handler'),
133
-
134
- /** tab change handler */
135
- onTabChange: reactDesc.PropTypes.func.description('tab change handler'),
136
-
137
- /** app element */
138
- appElement: reactDesc.PropTypes.string.description('app element'),
139
-
140
- /** value for search */
141
- value: reactDesc.PropTypes.string.description('value for search'),
142
-
143
- /** additional info */
144
- additionalInfo: reactDesc.PropTypes.object.description('additional info'),
145
-
146
- /** display property */
147
- displayProperty: reactDesc.PropTypes.string.description('display property'),
148
-
149
- /** options for dropdown */
150
- dropdownOptions: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.shape({
151
- label: reactDesc.PropTypes.string,
152
- value: reactDesc.PropTypes.string
153
- })).description('options for dropdown'),
154
-
155
- /** pass down props for datagrid in modal */
156
- customDataGridOptions: reactDesc.PropTypes.object.description('pass down props for datagrid in modal'),
157
-
158
- /** custom props for dropdown */
159
- customDropdownOptions: reactDesc.PropTypes.object.description('custom props for dropdown'),
160
-
161
- /** enable lookup */
162
- useLookupIndicator: reactDesc.PropTypes.bool.description('enable lookup')
163
- };
164
- const DSSearchFieldWithSchema = reactDesc.describe(DSSearchField);
165
- DSSearchFieldWithSchema.propTypes = props;
166
-
167
- exports.DSModalSearchField = ModalSearchField;
168
- exports.DSSearchFieldWithSchema = DSSearchFieldWithSchema;
169
- exports["default"] = DSSearchField;
@@ -1,243 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
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');
15
- var react = require('react');
16
- var reactSelect = require('react-select');
17
- var dsClassnames = require('@elliemae/ds-classnames');
18
- var dsForm = require('@elliemae/ds-form');
19
- var ModalSearchField = require('./components/ModalSearchField/ModalSearchField.js');
20
- var AdvanceSearchOption = require('./components/AdvanceSearchOption/AdvanceSearchOption.js');
21
- var LookupIndicator = require('./components/LookupIndicator/LookupIndicator.js');
22
- var jsxRuntime = require('react/jsx-runtime');
23
-
24
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
25
-
26
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
27
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
28
-
29
- 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; }
30
-
31
- 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__default["default"](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; }
32
- const advanceOption = {
33
- className: 'advanced-search-option',
34
- label: 'Advanced search',
35
- value: 'search-field-advance-option',
36
- isAdvance: true
37
- };
38
- const {
39
- cssClassName,
40
- classNameElement,
41
- classNameModifier,
42
- classNameBlock
43
- } = dsClassnames.convertPropToCssClassName('query-builder-addon-search-field');
44
-
45
- class DSSearchFieldImpl extends react.Component {
46
- constructor(props) {
47
- super(props);
48
-
49
- this.onChange = () => {
50
- const {
51
- selected: id,
52
- additionalInfo: [row]
53
- } = this.state;
54
- const {
55
- onChange
56
- } = this.props;
57
- onChange(id, row);
58
- };
59
-
60
- this.onChangeDropdown = value => {
61
- const {
62
- dropdownOptions
63
- } = this.props;
64
- const selected = dropdownOptions.find(op => op.value === value);
65
- const {
66
- onChange,
67
- displayProperty
68
- } = this.props;
69
- if (selected) onChange(value, {
70
- [displayProperty]: selected.label
71
- });
72
- };
73
-
74
- this.onKeyDown = event => {
75
- setTimeout(() => {
76
- const {
77
- keycode
78
- } = event;
79
- const {
80
- value
81
- } = this.props;
82
- if (value && keycode === 13) this.handleCloseModal();
83
- }, 0);
84
- };
85
-
86
- this.handleSelect = (selectedRow, rows) => {
87
- let selected = selectedRow; // fix new datagrid callback format
88
-
89
- if (!selected) return;
90
- if (selected.id) selected = selected.id;else if (selected[0] && selected[0].id) selected = selected[0].id;
91
- const additionalInfo = rows.filter(row => selected === row.id);
92
- this.setState({
93
- selected,
94
- additionalInfo
95
- });
96
- };
97
-
98
- this.handleConfirm = () => {
99
- const {
100
- onConfirmField
101
- } = this.props;
102
- this.onChange();
103
- this.handleCloseModal();
104
- onConfirmField();
105
- };
106
-
107
- this.handleReject = () => {
108
- const {
109
- onRejectField
110
- } = this.props;
111
- this.handleCloseModal();
112
- onRejectField();
113
- };
114
-
115
- this.handleOpenModal = () => {
116
- this.setState({
117
- openModal: true
118
- });
119
- };
120
-
121
- this.handleCloseModal = () => this.setState({
122
- openModal: false,
123
- selected: [],
124
- additionalInfo: []
125
- });
126
-
127
- advanceOption.label = props.searchOptionLabel;
128
- this.state = {
129
- openModal: false,
130
- selected: null,
131
- additionalInfo: []
132
- };
133
- }
134
-
135
- render() {
136
- const {
137
- placeholder,
138
- modalTitle,
139
- modalSize,
140
- tabsAnimated,
141
- tabsEnableMouseEvents,
142
- tabType,
143
- tabData,
144
- searchFilters,
145
- searchGrid,
146
- confirmLabel,
147
- rejectLabel,
148
- modalType,
149
- appElement,
150
- value,
151
- additionalInfo,
152
- displayProperty,
153
- dropdownOptions,
154
- searchOptionLabel,
155
- customDataGridOptions,
156
- customDropdownOptions,
157
- useLookupIndicator,
158
- onTabChange,
159
- containerProps,
160
- searchable
161
- } = this.props;
162
- const {
163
- openModal
164
- } = this.state;
165
- let options = [...dropdownOptions, advanceOption];
166
- let displayValue = !value ? placeholder : value;
167
- if (additionalInfo && additionalInfo[displayProperty]) displayValue = additionalInfo[displayProperty];
168
- const defaultoption = {
169
- value,
170
- label: displayValue
171
- };
172
- const customComponents = {
173
- Option: props => {
174
- // return <AdvanceSearchOption onAdvanceSearchClick={this.handleOpenModal} />
175
- props.innerProps.className = 'em-ds-combobox__option';
176
-
177
- if (props.data.isAdvance) {
178
- props.innerProps.onClick = this.handleOpenModal;
179
- props.innerProps.className = "".concat(props.innerProps.className, " ").concat(advanceOption.className);
180
- }
181
-
182
- return /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.Option, _objectSpread({}, props));
183
- },
184
- IndicatorSeparator: () => null,
185
- NoOptionsMessage: props => /*#__PURE__*/jsxRuntime.jsx(AdvanceSearchOption, _objectSpread({
186
- advanceSearchLabel: searchOptionLabel,
187
- onAdvanceSearchClick: this.handleOpenModal
188
- }, props))
189
- };
190
-
191
- if (useLookupIndicator) {
192
- customComponents.DropdownIndicator = () => null;
193
- }
194
-
195
- if (!options.find(o => o.value === defaultoption.value)) {
196
- options = [defaultoption, ...options];
197
- }
198
-
199
- return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({}, containerProps), {}, {
200
- className: "".concat(cssClassName),
201
- children: [/*#__PURE__*/_jsx__default["default"]("div", {
202
- className: "".concat(classNameBlock('container-selector'))
203
- }, void 0, /*#__PURE__*/jsxRuntime.jsx(dsForm.DSComboBox2, _objectSpread({
204
- className: "".concat(classNameElement('dropdown-field-selector')),
205
- components: customComponents,
206
- onChange: this.onChangeDropdown,
207
- onKeyDown: this.onKeyDown,
208
- options: options,
209
- value: value,
210
- searchable: searchable
211
- }, customDropdownOptions)), useLookupIndicator && /*#__PURE__*/_jsx__default["default"](LookupIndicator, {
212
- buttonType: "text",
213
- className: "".concat(classNameElement('btn-selector'), " ").concat(!value ? classNameModifier('btn-placeholder', 'btn-selector') : ''),
214
- onAdvanceSearchClick: this.handleOpenModal
215
- })), /*#__PURE__*/_jsx__default["default"](ModalSearchField, {
216
- appElement: appElement,
217
- confirmLabel: confirmLabel,
218
- customDataGridOptions: customDataGridOptions,
219
- handleSelect: this.handleSelect,
220
- isOpen: openModal,
221
- modalSize: modalSize,
222
- modalTitle: modalTitle,
223
- modalType: modalType,
224
- onClose: this.handleCloseModal,
225
- onConfirmField: this.handleConfirm,
226
- onRejectField: this.handleReject,
227
- onTabChange: onTabChange,
228
- placeholder: placeholder,
229
- rejectLabel: rejectLabel,
230
- searchFilters: searchFilters,
231
- searchGrid: searchGrid,
232
- tabData: tabData,
233
- tabsAnimated: tabsAnimated,
234
- tabsEnableMouseEvents: tabsEnableMouseEvents,
235
- tabType: tabType
236
- })]
237
- }));
238
- }
239
-
240
- }
241
-
242
- exports.DSModalSearchField = ModalSearchField;
243
- exports["default"] = DSSearchFieldImpl;