@elliemae/ds-search-field 3.27.0-next.1 → 3.27.0-next.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.
- package/dist/cjs/index.js +4 -5
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/index.js +2 -4
- package/dist/esm/index.js.map +2 -2
- package/dist/types/index.d.ts +2 -1
- package/package.json +8 -42
- package/dist/cjs/DSSearchField.js +0 -170
- package/dist/cjs/DSSearchField.js.map +0 -7
- package/dist/cjs/impl/DSSeachFieldImpl.js +0 -229
- package/dist/cjs/impl/DSSeachFieldImpl.js.map +0 -7
- package/dist/cjs/impl/components/AdvanceSearchOption/AdvanceSearchOption.js +0 -48
- package/dist/cjs/impl/components/AdvanceSearchOption/AdvanceSearchOption.js.map +0 -7
- package/dist/cjs/impl/components/LookupIndicator/LookupIndicator.js +0 -54
- package/dist/cjs/impl/components/LookupIndicator/LookupIndicator.js.map +0 -7
- package/dist/cjs/impl/components/ModalSearchField/DataGridSearch.js +0 -107
- package/dist/cjs/impl/components/ModalSearchField/DataGridSearch.js.map +0 -7
- package/dist/cjs/impl/components/ModalSearchField/ModalSearchField.js +0 -101
- package/dist/cjs/impl/components/ModalSearchField/ModalSearchField.js.map +0 -7
- package/dist/esm/DSSearchField.js +0 -140
- package/dist/esm/DSSearchField.js.map +0 -7
- package/dist/esm/impl/DSSeachFieldImpl.js +0 -199
- package/dist/esm/impl/DSSeachFieldImpl.js.map +0 -7
- package/dist/esm/impl/components/AdvanceSearchOption/AdvanceSearchOption.js +0 -18
- package/dist/esm/impl/components/AdvanceSearchOption/AdvanceSearchOption.js.map +0 -7
- package/dist/esm/impl/components/LookupIndicator/LookupIndicator.js +0 -24
- package/dist/esm/impl/components/LookupIndicator/LookupIndicator.js.map +0 -7
- package/dist/esm/impl/components/ModalSearchField/DataGridSearch.js +0 -77
- package/dist/esm/impl/components/ModalSearchField/DataGridSearch.js.map +0 -7
- package/dist/esm/impl/components/ModalSearchField/ModalSearchField.js +0 -71
- package/dist/esm/impl/components/ModalSearchField/ModalSearchField.js.map +0 -7
- package/dist/types/DSSearchField.d.ts +0 -119
- package/dist/types/impl/DSSeachFieldImpl.d.ts +0 -16
- package/dist/types/impl/components/AdvanceSearchOption/AdvanceSearchOption.d.ts +0 -5
- package/dist/types/impl/components/LookupIndicator/LookupIndicator.d.ts +0 -5
- package/dist/types/impl/components/ModalSearchField/DataGridSearch.d.ts +0 -7
- package/dist/types/impl/components/ModalSearchField/ModalSearchField.d.ts +0 -22
package/dist/cjs/index.js
CHANGED
|
@@ -17,6 +17,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
21
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
22
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
23
|
// file that has been converted to a CommonJS file using a Babel-
|
|
@@ -28,12 +29,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
30
|
var src_exports = {};
|
|
30
31
|
__export(src_exports, {
|
|
31
|
-
|
|
32
|
-
DSSearchField: () => import_DSSearchField.DSSearchField,
|
|
33
|
-
DSSearchFieldWithSchema: () => import_DSSearchField.DSSearchFieldWithSchema,
|
|
34
|
-
default: () => import_DSSearchField.default
|
|
32
|
+
default: () => import_ds_legacy_search_field.default
|
|
35
33
|
});
|
|
36
34
|
module.exports = __toCommonJS(src_exports);
|
|
37
35
|
var React = __toESM(require("react"));
|
|
38
|
-
|
|
36
|
+
__reExport(src_exports, require("@elliemae/ds-legacy-search-field"), module.exports);
|
|
37
|
+
var import_ds_legacy_search_field = __toESM(require("@elliemae/ds-legacy-search-field"));
|
|
39
38
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export * from '@elliemae/ds-legacy-search-field';\nexport { default } from '@elliemae/ds-legacy-search-field';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,6CAAd;AACA,oCAAwB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
export * from "@elliemae/ds-legacy-search-field";
|
|
3
|
+
import { default as default2 } from "@elliemae/ds-legacy-search-field";
|
|
3
4
|
export {
|
|
4
|
-
DSModalSearchField,
|
|
5
|
-
DSSearchField,
|
|
6
|
-
DSSearchFieldWithSchema,
|
|
7
5
|
default2 as default
|
|
8
6
|
};
|
|
9
7
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAAA,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from '@elliemae/ds-legacy-search-field';\nexport { default } from '@elliemae/ds-legacy-search-field';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,SAAS,WAAAA,gBAAe;",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from '@elliemae/ds-legacy-search-field';
|
|
2
|
+
export { default } from '@elliemae/ds-legacy-search-field';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-search-field",
|
|
3
|
-
"version": "3.27.0-next.
|
|
3
|
+
"version": "3.27.0-next.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Search Field",
|
|
6
6
|
"files": [
|
|
@@ -13,30 +13,6 @@
|
|
|
13
13
|
".": {
|
|
14
14
|
"import": "./dist/esm/index.js",
|
|
15
15
|
"require": "./dist/cjs/index.js"
|
|
16
|
-
},
|
|
17
|
-
"./impl/DSSeachFieldImpl": {
|
|
18
|
-
"import": "./dist/esm/impl/DSSeachFieldImpl.js",
|
|
19
|
-
"require": "./dist/cjs/impl/DSSeachFieldImpl.js"
|
|
20
|
-
},
|
|
21
|
-
"./impl/components/ModalSearchField/ModalSearchField": {
|
|
22
|
-
"import": "./dist/esm/impl/components/ModalSearchField/ModalSearchField.js",
|
|
23
|
-
"require": "./dist/cjs/impl/components/ModalSearchField/ModalSearchField.js"
|
|
24
|
-
},
|
|
25
|
-
"./impl/components/ModalSearchField/DataGridSearch": {
|
|
26
|
-
"import": "./dist/esm/impl/components/ModalSearchField/DataGridSearch.js",
|
|
27
|
-
"require": "./dist/cjs/impl/components/ModalSearchField/DataGridSearch.js"
|
|
28
|
-
},
|
|
29
|
-
"./impl/components/LookupIndicator/LookupIndicator": {
|
|
30
|
-
"import": "./dist/esm/impl/components/LookupIndicator/LookupIndicator.js",
|
|
31
|
-
"require": "./dist/cjs/impl/components/LookupIndicator/LookupIndicator.js"
|
|
32
|
-
},
|
|
33
|
-
"./impl/components/AdvanceSearchOption/AdvanceSearchOption": {
|
|
34
|
-
"import": "./dist/esm/impl/components/AdvanceSearchOption/AdvanceSearchOption.js",
|
|
35
|
-
"require": "./dist/cjs/impl/components/AdvanceSearchOption/AdvanceSearchOption.js"
|
|
36
|
-
},
|
|
37
|
-
"./DSSearchField": {
|
|
38
|
-
"import": "./dist/esm/DSSearchField.js",
|
|
39
|
-
"require": "./dist/cjs/DSSearchField.js"
|
|
40
16
|
}
|
|
41
17
|
},
|
|
42
18
|
"sideEffects": [
|
|
@@ -59,22 +35,12 @@
|
|
|
59
35
|
"indent": 4
|
|
60
36
|
},
|
|
61
37
|
"dependencies": {
|
|
62
|
-
"
|
|
63
|
-
"uid": "~2.0.1",
|
|
64
|
-
"@elliemae/ds-classnames": "3.27.0-next.1",
|
|
65
|
-
"@elliemae/ds-button": "3.27.0-next.1",
|
|
66
|
-
"@elliemae/ds-datagrids": "3.27.0-next.1",
|
|
67
|
-
"@elliemae/ds-form": "3.27.0-next.1",
|
|
68
|
-
"@elliemae/ds-icons": "3.27.0-next.1",
|
|
69
|
-
"@elliemae/ds-props-helpers": "3.27.0-next.1",
|
|
70
|
-
"@elliemae/ds-modal": "3.27.0-next.1",
|
|
71
|
-
"@elliemae/ds-tabs": "3.27.0-next.1",
|
|
72
|
-
"@elliemae/ds-toolbar": "3.27.0-next.1"
|
|
38
|
+
"@elliemae/ds-legacy-search-field": "1.0.1"
|
|
73
39
|
},
|
|
74
40
|
"devDependencies": {
|
|
75
41
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
76
42
|
"styled-components": "~5.3.9",
|
|
77
|
-
"@elliemae/ds-monorepo-devops": "3.27.0-next.
|
|
43
|
+
"@elliemae/ds-monorepo-devops": "3.27.0-next.3"
|
|
78
44
|
},
|
|
79
45
|
"publishConfig": {
|
|
80
46
|
"access": "public",
|
|
@@ -87,13 +53,13 @@
|
|
|
87
53
|
},
|
|
88
54
|
"scripts": {
|
|
89
55
|
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
90
|
-
"test": "
|
|
91
|
-
"lint": "
|
|
92
|
-
"eslint:fix": "
|
|
93
|
-
"dts": "
|
|
56
|
+
"test": "exit 0 | echo",
|
|
57
|
+
"lint": "exit 0 | echo",
|
|
58
|
+
"eslint:fix": "exit 0 | echo",
|
|
59
|
+
"dts": "exit 0 | echo",
|
|
94
60
|
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
95
61
|
"dev:build": "pnpm --filter {.}... build",
|
|
96
62
|
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
97
|
-
"checkDeps": "
|
|
63
|
+
"checkDeps": "exit 0 | echo"
|
|
98
64
|
}
|
|
99
65
|
}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var DSSearchField_exports = {};
|
|
30
|
-
__export(DSSearchField_exports, {
|
|
31
|
-
DSModalSearchField: () => import_DSSeachFieldImpl.DSModalSearchField,
|
|
32
|
-
DSSearchField: () => DSSearchField,
|
|
33
|
-
DSSearchFieldWithSchema: () => DSSearchFieldWithSchema,
|
|
34
|
-
default: () => DSSearchField_default
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(DSSearchField_exports);
|
|
37
|
-
var React = __toESM(require("react"));
|
|
38
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
-
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
40
|
-
var import_ds_tabs = require("@elliemae/ds-tabs");
|
|
41
|
-
var import_DSSeachFieldImpl = __toESM(require("./impl/DSSeachFieldImpl.js"));
|
|
42
|
-
const DSSearchField = ({
|
|
43
|
-
containerProps = {},
|
|
44
|
-
onChange = () => null,
|
|
45
|
-
searchOptionLabel = "Advanced Search",
|
|
46
|
-
placeholder = "Select field",
|
|
47
|
-
modalSize = "x-large",
|
|
48
|
-
modalTitle = "Search Field ID",
|
|
49
|
-
tabsAnimated = true,
|
|
50
|
-
tabsEnableMouseEvents = true,
|
|
51
|
-
tabType = import_ds_tabs.TabTypes.NORMAL,
|
|
52
|
-
tabData = [],
|
|
53
|
-
searchGrid = false,
|
|
54
|
-
searchFilters = true,
|
|
55
|
-
confirmLabel = "Apply",
|
|
56
|
-
rejectLabel = "Cancel",
|
|
57
|
-
modalType = "confirm",
|
|
58
|
-
onConfirmField = () => null,
|
|
59
|
-
onRejectField = () => null,
|
|
60
|
-
onTabChange = () => null,
|
|
61
|
-
appElement = "body",
|
|
62
|
-
value = null,
|
|
63
|
-
additionalInfo = null,
|
|
64
|
-
displayProperty = "name",
|
|
65
|
-
dropdownOptions = [],
|
|
66
|
-
customDataGridOptions = {},
|
|
67
|
-
customDropdownOptions = {},
|
|
68
|
-
useLookupIndicator = true,
|
|
69
|
-
searchable = false
|
|
70
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
-
import_DSSeachFieldImpl.default,
|
|
72
|
-
{
|
|
73
|
-
additionalInfo,
|
|
74
|
-
appElement,
|
|
75
|
-
searchable,
|
|
76
|
-
confirmLabel,
|
|
77
|
-
containerProps,
|
|
78
|
-
customDataGridOptions,
|
|
79
|
-
customDropdownOptions,
|
|
80
|
-
displayProperty,
|
|
81
|
-
dropdownOptions,
|
|
82
|
-
modalSize,
|
|
83
|
-
modalTitle,
|
|
84
|
-
modalType,
|
|
85
|
-
onChange,
|
|
86
|
-
onConfirmField,
|
|
87
|
-
onRejectField,
|
|
88
|
-
onTabChange,
|
|
89
|
-
placeholder,
|
|
90
|
-
rejectLabel,
|
|
91
|
-
searchFilters,
|
|
92
|
-
searchGrid,
|
|
93
|
-
searchOptionLabel,
|
|
94
|
-
tabData,
|
|
95
|
-
tabsAnimated,
|
|
96
|
-
tabsEnableMouseEvents,
|
|
97
|
-
tabType,
|
|
98
|
-
useLookupIndicator,
|
|
99
|
-
value
|
|
100
|
-
}
|
|
101
|
-
);
|
|
102
|
-
const props = {
|
|
103
|
-
/*
|
|
104
|
-
Enable the user to search on combobox
|
|
105
|
-
*/
|
|
106
|
-
searchable: import_ds_props_helpers.PropTypes.bool.description("Enable the user to search on combobox"),
|
|
107
|
-
/** inject props to wrapper */
|
|
108
|
-
containerProps: import_ds_props_helpers.PropTypes.object.description("inject props to wrapper"),
|
|
109
|
-
/** change handler */
|
|
110
|
-
onChange: import_ds_props_helpers.PropTypes.func.description("change handler"),
|
|
111
|
-
/** search option label */
|
|
112
|
-
searchOptionLabel: import_ds_props_helpers.PropTypes.string.description("search option label"),
|
|
113
|
-
/** placeholder for search input */
|
|
114
|
-
placeholder: import_ds_props_helpers.PropTypes.string.description("placeholder for search input"),
|
|
115
|
-
/** search modal size */
|
|
116
|
-
modalSize: import_ds_props_helpers.PropTypes.oneOf(["x-large", "large", "medium"]).description("search modal size"),
|
|
117
|
-
/** search modal title */
|
|
118
|
-
modalTitle: import_ds_props_helpers.PropTypes.string.description("search modal title"),
|
|
119
|
-
/** animate modal tabs */
|
|
120
|
-
tabsAnimated: import_ds_props_helpers.PropTypes.bool.description("animate modal tabs"),
|
|
121
|
-
/** enable mouse event on tabs */
|
|
122
|
-
tabsEnableMouseEvents: import_ds_props_helpers.PropTypes.bool.description("enable mouse event on tabs"),
|
|
123
|
-
/** tab types on modal */
|
|
124
|
-
tabType: import_ds_props_helpers.PropTypes.oneOf([import_ds_tabs.TabTypes.NORMAL, import_ds_tabs.TabTypes.SUBTABS]).description("tab types on modal"),
|
|
125
|
-
/** data for modal tabs */
|
|
126
|
-
tabData: import_ds_props_helpers.PropTypes.array.description("data for modal tabs"),
|
|
127
|
-
/** use search grid */
|
|
128
|
-
searchGrid: import_ds_props_helpers.PropTypes.bool.description("use search grid"),
|
|
129
|
-
/** add search filters */
|
|
130
|
-
searchFilters: import_ds_props_helpers.PropTypes.bool.description("add search filters"),
|
|
131
|
-
/** confirm modal label */
|
|
132
|
-
confirmLabel: import_ds_props_helpers.PropTypes.string.description("confirm modal label"),
|
|
133
|
-
/** reject modal label */
|
|
134
|
-
rejectLabel: import_ds_props_helpers.PropTypes.string.description("reject modal label"),
|
|
135
|
-
/** modal type */
|
|
136
|
-
modalType: import_ds_props_helpers.PropTypes.oneOf(["alert", "confirm"]).description("modal type"),
|
|
137
|
-
/** on confirm handler */
|
|
138
|
-
onConfirmField: import_ds_props_helpers.PropTypes.func.description("on confirm handler"),
|
|
139
|
-
/** on cancel handler */
|
|
140
|
-
onRejectField: import_ds_props_helpers.PropTypes.func.description("on cancel handler"),
|
|
141
|
-
/** tab change handler */
|
|
142
|
-
onTabChange: import_ds_props_helpers.PropTypes.func.description("tab change handler"),
|
|
143
|
-
/** app element */
|
|
144
|
-
appElement: import_ds_props_helpers.PropTypes.string.description("app element"),
|
|
145
|
-
/** value for search */
|
|
146
|
-
value: import_ds_props_helpers.PropTypes.string.description("value for search"),
|
|
147
|
-
/** additional info */
|
|
148
|
-
additionalInfo: import_ds_props_helpers.PropTypes.object.description("additional info"),
|
|
149
|
-
/** display property */
|
|
150
|
-
displayProperty: import_ds_props_helpers.PropTypes.string.description("display property"),
|
|
151
|
-
/** options for dropdown */
|
|
152
|
-
dropdownOptions: import_ds_props_helpers.PropTypes.arrayOf(
|
|
153
|
-
import_ds_props_helpers.PropTypes.shape({
|
|
154
|
-
label: import_ds_props_helpers.PropTypes.string,
|
|
155
|
-
value: import_ds_props_helpers.PropTypes.string
|
|
156
|
-
})
|
|
157
|
-
).description("options for dropdown"),
|
|
158
|
-
/** pass down props for datagrid in modal */
|
|
159
|
-
customDataGridOptions: import_ds_props_helpers.PropTypes.object.description("pass down props for datagrid in modal"),
|
|
160
|
-
/** custom props for dropdown */
|
|
161
|
-
customDropdownOptions: import_ds_props_helpers.PropTypes.object.description("custom props for dropdown"),
|
|
162
|
-
/** enable lookup */
|
|
163
|
-
useLookupIndicator: import_ds_props_helpers.PropTypes.bool.description("enable lookup")
|
|
164
|
-
};
|
|
165
|
-
DSSearchField.propTypes = props;
|
|
166
|
-
DSSearchField.displayName = "DSSearchField";
|
|
167
|
-
const DSSearchFieldWithSchema = (0, import_ds_props_helpers.describe)(DSSearchField);
|
|
168
|
-
DSSearchFieldWithSchema.propTypes = props;
|
|
169
|
-
var DSSearchField_default = DSSearchField;
|
|
170
|
-
//# sourceMappingURL=DSSearchField.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/DSSearchField.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-props-helpers';\nimport { TabTypes } from '@elliemae/ds-tabs';\nimport DSSeachFieldImpl, { DSModalSearchField } from './impl/DSSeachFieldImpl.js';\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 = 'body',\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;\nDSSearchField.displayName = 'DSSearchField';\nconst DSSearchFieldWithSchema = describe(DSSearchField);\nDSSearchFieldWithSchema.propTypes = props;\n\nexport { DSSearchField, DSModalSearchField, DSSearchFieldWithSchema };\nexport default DSSearchField;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkCrB;AAjCF,8BAAoC;AACpC,qBAAyB;AACzB,8BAAqD;AAErD,MAAM,gBAAgB,CAAC;AAAA,EACrB,iBAAiB,CAAC;AAAA,EAClB,WAAW,MAAM;AAAA,EACjB,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,eAAe;AAAA,EACf,wBAAwB;AAAA,EACxB,UAAU,wBAAS;AAAA,EACnB,UAAU,CAAC;AAAA,EACX,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,CAAC;AAAA,EACnB,wBAAwB,CAAC;AAAA,EACzB,wBAAwB,CAAC;AAAA,EACzB,qBAAqB;AAAA,EACrB,aAAa;AACf,MACE;AAAA,EAAC,wBAAAA;AAAA,EAAA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA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AAA;AAAA,EAE7D,aAAa,kCAAU,KAAK,YAAY,oBAAoB;AAAA;AAAA,EAE5D,YAAY,kCAAU,OAAO,YAAY,aAAa;AAAA;AAAA,EAEtD,OAAO,kCAAU,OAAO,YAAY,kBAAkB;AAAA;AAAA,EAEtD,gBAAgB,kCAAU,OAAO,YAAY,iBAAiB;AAAA;AAAA,EAE9D,iBAAiB,kCAAU,OAAO,YAAY,kBAAkB;AAAA;AAAA,EAEhE,iBAAiB,kCAAU;AAAA,IACzB,kCAAU,MAAM;AAAA,MACd,OAAO,kCAAU;AAAA,MACjB,OAAO,kCAAU;AAAA,IACnB,CAAC;AAAA,EACH,EAAE,YAAY,sBAAsB;AAAA;AAAA,EAEpC,uBAAuB,kCAAU,OAAO,YAAY,uCAAuC;AAAA;AAAA,EAE3F,uBAAuB,kCAAU,OAAO,YAAY,2BAA2B;AAAA;AAAA,EAE/E,oBAAoB,kCAAU,KAAK,YAAY,eAAe;AAChE;AAEA,cAAc,YAAY;AAC1B,cAAc,cAAc;AAC5B,MAAM,8BAA0B,kCAAS,aAAa;AACtD,wBAAwB,YAAY;AAGpC,IAAO,wBAAQ;",
|
|
6
|
-
"names": ["DSSeachFieldImpl"]
|
|
7
|
-
}
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var DSSeachFieldImpl_exports = {};
|
|
30
|
-
__export(DSSeachFieldImpl_exports, {
|
|
31
|
-
DSModalSearchField: () => import_ModalSearchField.default,
|
|
32
|
-
default: () => DSSeachFieldImpl_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(DSSeachFieldImpl_exports);
|
|
35
|
-
var React = __toESM(require("react"));
|
|
36
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
-
var import_react = require("react");
|
|
38
|
-
var import_react_select = require("react-select");
|
|
39
|
-
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
40
|
-
var import_ds_form = require("@elliemae/ds-form");
|
|
41
|
-
var import_ModalSearchField = __toESM(require("./components/ModalSearchField/ModalSearchField.js"));
|
|
42
|
-
var import_AdvanceSearchOption = __toESM(require("./components/AdvanceSearchOption/AdvanceSearchOption.js"));
|
|
43
|
-
var import_LookupIndicator = __toESM(require("./components/LookupIndicator/LookupIndicator.js"));
|
|
44
|
-
const advanceOption = {
|
|
45
|
-
className: "advanced-search-option",
|
|
46
|
-
label: "Advanced search",
|
|
47
|
-
value: "search-field-advance-option",
|
|
48
|
-
isAdvance: true
|
|
49
|
-
};
|
|
50
|
-
const { cssClassName, classNameElement, classNameModifier, classNameBlock } = (0, import_ds_classnames.convertPropToCssClassName)(
|
|
51
|
-
"query-builder-addon-search-field"
|
|
52
|
-
);
|
|
53
|
-
class DSSearchFieldImpl extends import_react.Component {
|
|
54
|
-
constructor(props) {
|
|
55
|
-
super(props);
|
|
56
|
-
this.onChange = () => {
|
|
57
|
-
const {
|
|
58
|
-
selected: id,
|
|
59
|
-
additionalInfo: [row]
|
|
60
|
-
} = this.state;
|
|
61
|
-
const { onChange } = this.props;
|
|
62
|
-
onChange(id, row);
|
|
63
|
-
};
|
|
64
|
-
this.onChangeDropdown = (value) => {
|
|
65
|
-
const { dropdownOptions } = this.props;
|
|
66
|
-
const selected = dropdownOptions.find((op) => op.value === value);
|
|
67
|
-
const { onChange, displayProperty } = this.props;
|
|
68
|
-
if (selected)
|
|
69
|
-
onChange(value, { [displayProperty]: selected.label });
|
|
70
|
-
};
|
|
71
|
-
this.onKeyDown = (event) => {
|
|
72
|
-
setTimeout(() => {
|
|
73
|
-
const { keycode } = event;
|
|
74
|
-
const { value } = this.props;
|
|
75
|
-
if (value && keycode === 13)
|
|
76
|
-
this.handleCloseModal();
|
|
77
|
-
}, 0);
|
|
78
|
-
};
|
|
79
|
-
this.handleSelect = (selectedRow, rows) => {
|
|
80
|
-
let selected = selectedRow;
|
|
81
|
-
if (!selected)
|
|
82
|
-
return;
|
|
83
|
-
if (selected.id)
|
|
84
|
-
selected = selected.id;
|
|
85
|
-
else if (selected[0] && selected[0].id)
|
|
86
|
-
selected = selected[0].id;
|
|
87
|
-
const additionalInfo = rows.filter((row) => selected === row.id);
|
|
88
|
-
this.setState({ selected, additionalInfo });
|
|
89
|
-
};
|
|
90
|
-
this.handleConfirm = () => {
|
|
91
|
-
const { onConfirmField } = this.props;
|
|
92
|
-
this.onChange();
|
|
93
|
-
this.handleCloseModal();
|
|
94
|
-
onConfirmField();
|
|
95
|
-
};
|
|
96
|
-
this.handleReject = () => {
|
|
97
|
-
const { onRejectField } = this.props;
|
|
98
|
-
this.handleCloseModal();
|
|
99
|
-
onRejectField();
|
|
100
|
-
};
|
|
101
|
-
this.handleOpenModal = () => {
|
|
102
|
-
this.setState({ openModal: true });
|
|
103
|
-
};
|
|
104
|
-
this.handleCloseModal = () => this.setState({
|
|
105
|
-
openModal: false,
|
|
106
|
-
selected: [],
|
|
107
|
-
additionalInfo: []
|
|
108
|
-
});
|
|
109
|
-
advanceOption.label = props.searchOptionLabel;
|
|
110
|
-
this.state = {
|
|
111
|
-
openModal: false,
|
|
112
|
-
selected: null,
|
|
113
|
-
additionalInfo: []
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
render() {
|
|
117
|
-
const {
|
|
118
|
-
placeholder,
|
|
119
|
-
modalTitle,
|
|
120
|
-
modalSize,
|
|
121
|
-
tabsAnimated,
|
|
122
|
-
tabsEnableMouseEvents,
|
|
123
|
-
tabType,
|
|
124
|
-
tabData,
|
|
125
|
-
searchFilters,
|
|
126
|
-
searchGrid,
|
|
127
|
-
confirmLabel,
|
|
128
|
-
rejectLabel,
|
|
129
|
-
modalType,
|
|
130
|
-
appElement,
|
|
131
|
-
value,
|
|
132
|
-
additionalInfo,
|
|
133
|
-
displayProperty,
|
|
134
|
-
dropdownOptions,
|
|
135
|
-
searchOptionLabel,
|
|
136
|
-
customDataGridOptions,
|
|
137
|
-
customDropdownOptions,
|
|
138
|
-
useLookupIndicator,
|
|
139
|
-
onTabChange,
|
|
140
|
-
containerProps,
|
|
141
|
-
searchable
|
|
142
|
-
} = this.props;
|
|
143
|
-
const { openModal } = this.state;
|
|
144
|
-
let options = [...dropdownOptions, advanceOption];
|
|
145
|
-
let displayValue = !value ? placeholder : value;
|
|
146
|
-
if (additionalInfo && additionalInfo[displayProperty])
|
|
147
|
-
displayValue = additionalInfo[displayProperty];
|
|
148
|
-
const defaultoption = { value, label: displayValue };
|
|
149
|
-
const customComponents = {
|
|
150
|
-
Option: (props) => {
|
|
151
|
-
props.innerProps.className = "em-ds-combobox__option";
|
|
152
|
-
if (props.data.isAdvance) {
|
|
153
|
-
props.innerProps.onClick = this.handleOpenModal;
|
|
154
|
-
props.innerProps.className = `${props.innerProps.className} ${advanceOption.className}`;
|
|
155
|
-
}
|
|
156
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_select.components.Option, { ...props });
|
|
157
|
-
},
|
|
158
|
-
IndicatorSeparator: () => null,
|
|
159
|
-
NoOptionsMessage: (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
160
|
-
import_AdvanceSearchOption.default,
|
|
161
|
-
{
|
|
162
|
-
advanceSearchLabel: searchOptionLabel,
|
|
163
|
-
onAdvanceSearchClick: this.handleOpenModal,
|
|
164
|
-
...props
|
|
165
|
-
}
|
|
166
|
-
)
|
|
167
|
-
};
|
|
168
|
-
if (useLookupIndicator) {
|
|
169
|
-
customComponents.DropdownIndicator = function() {
|
|
170
|
-
return null;
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
if (!options.find((o) => o.value === defaultoption.value)) {
|
|
174
|
-
options = [defaultoption, ...options];
|
|
175
|
-
}
|
|
176
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ...containerProps, className: `${cssClassName}`, children: [
|
|
177
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${classNameBlock("container-selector")}`, children: [
|
|
178
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
179
|
-
import_ds_form.DSComboBox2,
|
|
180
|
-
{
|
|
181
|
-
className: `${classNameElement("dropdown-field-selector")}`,
|
|
182
|
-
components: customComponents,
|
|
183
|
-
onChange: this.onChangeDropdown,
|
|
184
|
-
onKeyDown: this.onKeyDown,
|
|
185
|
-
options,
|
|
186
|
-
value,
|
|
187
|
-
searchable,
|
|
188
|
-
...customDropdownOptions
|
|
189
|
-
}
|
|
190
|
-
),
|
|
191
|
-
useLookupIndicator && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
192
|
-
import_LookupIndicator.default,
|
|
193
|
-
{
|
|
194
|
-
buttonType: "text",
|
|
195
|
-
className: `${classNameElement("btn-selector")} ${!value ? classNameModifier("btn-placeholder", "btn-selector") : ""}`,
|
|
196
|
-
onAdvanceSearchClick: this.handleOpenModal
|
|
197
|
-
}
|
|
198
|
-
)
|
|
199
|
-
] }),
|
|
200
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
201
|
-
import_ModalSearchField.default,
|
|
202
|
-
{
|
|
203
|
-
appElement,
|
|
204
|
-
confirmLabel,
|
|
205
|
-
customDataGridOptions,
|
|
206
|
-
handleSelect: this.handleSelect,
|
|
207
|
-
isOpen: openModal,
|
|
208
|
-
modalSize,
|
|
209
|
-
modalTitle,
|
|
210
|
-
modalType,
|
|
211
|
-
onClose: this.handleCloseModal,
|
|
212
|
-
onConfirmField: this.handleConfirm,
|
|
213
|
-
onRejectField: this.handleReject,
|
|
214
|
-
onTabChange,
|
|
215
|
-
placeholder,
|
|
216
|
-
rejectLabel,
|
|
217
|
-
searchFilters,
|
|
218
|
-
searchGrid,
|
|
219
|
-
tabData,
|
|
220
|
-
tabsAnimated,
|
|
221
|
-
tabsEnableMouseEvents,
|
|
222
|
-
tabType
|
|
223
|
-
}
|
|
224
|
-
)
|
|
225
|
-
] });
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
var DSSeachFieldImpl_default = DSSearchFieldImpl;
|
|
229
|
-
//# sourceMappingURL=DSSeachFieldImpl.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/impl/DSSeachFieldImpl.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* 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';\nimport DSModalSearchField from './components/ModalSearchField/ModalSearchField.js';\nimport AdvanceSearchOption from './components/AdvanceSearchOption/AdvanceSearchOption.js';\nimport LookupIndicator from './components/LookupIndicator/LookupIndicator.js';\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 = function () {\n return null;\n };\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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,oDAAAA;AAAA,EAAA;AAAA;AAAA;ACAA,YAAuB;ADoIR;AAlIf,mBAAiC;AACjC,0BAA2B;AAC3B,2BAA0C;AAC1C,qBAA4B;AAC5B,8BAA+B;AAC/B,iCAAgC;AAChC,6BAA4B;AAE5B,MAAM,gBAAgB;AAAA,EACpB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AAAA,EACP,WAAW;AACb;AACA,MAAM,EAAE,cAAc,kBAAkB,mBAAmB,eAAe,QAAI;AAAA,EAC5E;AACF;AAEA,MAAM,0BAA0B,uBAAU;AAAA,EACxC,YAAY,OAAO;AACjB,UAAM,KAAK;AASb,oBAAW,MAAM;AACf,YAAM;AAAA,QACJ,UAAU;AAAA,QACV,gBAAgB,CAAC,GAAG;AAAA,MACtB,IAAI,KAAK;AACT,YAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,eAAS,IAAI,GAAG;AAAA,IAClB;AAEA,4BAAmB,CAAC,UAAU;AAC5B,YAAM,EAAE,gBAAgB,IAAI,KAAK;AACjC,YAAM,WAAW,gBAAgB,KAAK,CAAC,OAAO,GAAG,UAAU,KAAK;AAChE,YAAM,EA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ACpD;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,GAAG,iBAAiB,yBAAyB;AAAA,YACxD,YAAY;AAAA,YACZ,UAAU,KAAK;AAAA,YACf,WAAW,KAAK;AAAA,YAChB;AAAA,YACA;AAAA,YACA;AAAA,YACC,GAAG;AAAA;AAAA,QACN;AAAA,QACC,sBACC;AAAA,UAAC,uBAAAC;AAAA,UAAA;AAAA,YACC,YAAW;AAAA,YACX,WAAW,GAAG,iBAAiB,cAAc,KAC3C,CAAC,QAAQ,kBAAkB,mBAAmB,cAAc,IAAI;AAAA,YAElE,sBAAsB,KAAK;AAAA;AAAA,QAC7B;AAAA,SAEJ;AAAA,MACA;AAAA,QAAC,wBAAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA,cAAc,KAAK;AAAA,UACnB,QAAQ;AAAA,UACR;AAAA,UACA;AAAA,UACA;AAAA,UACA,SAAS,KAAK;AAAA,UACd,gBAAgB,KAAK;AAAA,UACrB,eAAe,KAAK;AAAA,UACpB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACF;AAAA,OACF;AAAA,EAEJ;AACF;AAGA,IAAO,2BAAQ;",
|
|
6
|
-
"names": ["DSModalSearchField", "AdvanceSearchOption", "LookupIndicator", "DSModalSearchField"]
|
|
7
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var AdvanceSearchOption_exports = {};
|
|
30
|
-
__export(AdvanceSearchOption_exports, {
|
|
31
|
-
default: () => AdvanceSearchOption_default
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(AdvanceSearchOption_exports);
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var import_ds_button = __toESM(require("@elliemae/ds-button"));
|
|
37
|
-
const AdvanceSearchOption = ({ advanceSearchLabel = "Advanced Search", onAdvanceSearchClick = () => null }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
38
|
-
import_ds_button.default,
|
|
39
|
-
{
|
|
40
|
-
className: "advance-search-option-btn",
|
|
41
|
-
labelText: advanceSearchLabel,
|
|
42
|
-
onClick: onAdvanceSearchClick,
|
|
43
|
-
tabIndex: -1,
|
|
44
|
-
type: "button"
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
var AdvanceSearchOption_default = AdvanceSearchOption;
|
|
48
|
-
//# sourceMappingURL=AdvanceSearchOption.js.map
|