@elliemae/ds-zipcode-search 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.
- package/cjs/DSZipCodeSearch.js +98 -92
- package/cjs/DSZipCodeSearch.js.map +7 -0
- package/cjs/components/blocks.js +37 -10
- package/cjs/components/blocks.js.map +7 -0
- package/cjs/components/helper.js +40 -30
- package/cjs/components/helper.js.map +7 -0
- package/cjs/index.js +36 -11
- package/cjs/index.js.map +7 -0
- package/cjs/props.js +57 -55
- package/cjs/props.js.map +7 -0
- package/esm/DSZipCodeSearch.js +56 -67
- package/esm/DSZipCodeSearch.js.map +7 -0
- package/esm/components/blocks.js +8 -6
- package/esm/components/blocks.js.map +7 -0
- package/esm/components/helper.js +11 -21
- package/esm/components/helper.js.map +7 -0
- package/esm/index.js +7 -1
- package/esm/index.js.map +7 -0
- package/esm/props.js +24 -46
- package/esm/props.js.map +7 -0
- package/package.json +4 -4
package/cjs/DSZipCodeSearch.js
CHANGED
|
@@ -1,56 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var DSZipCodeSearch_exports = {};
|
|
29
|
+
__export(DSZipCodeSearch_exports, {
|
|
30
|
+
DSZipCodeSearch: () => DSZipCodeSearch,
|
|
31
|
+
ZipCodeSearchWithSchema: () => ZipCodeSearchWithSchema,
|
|
32
|
+
default: () => DSZipCodeSearch_default
|
|
33
|
+
});
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_react_desc = __toESM(require("react-desc"));
|
|
37
|
+
var import_ds_dropdownmenu = __toESM(require("@elliemae/ds-dropdownmenu"));
|
|
38
|
+
var import_ds_form = __toESM(require("@elliemae/ds-form"));
|
|
39
|
+
var import_blocks = __toESM(require("./components/blocks"));
|
|
40
|
+
var import_helper = __toESM(require("./components/helper"));
|
|
41
|
+
var import_props = __toESM(require("./props"));
|
|
42
|
+
const DSZipCodeSearch = ({
|
|
43
|
+
disabled,
|
|
44
|
+
value,
|
|
45
|
+
placeholder,
|
|
46
|
+
mask,
|
|
47
|
+
onBlur,
|
|
48
|
+
onChange,
|
|
49
|
+
onSearch,
|
|
50
|
+
containerProps,
|
|
51
|
+
selectRightOptions,
|
|
52
|
+
activeCount,
|
|
53
|
+
options,
|
|
54
|
+
tabIndex
|
|
55
|
+
}) => {
|
|
56
|
+
const ref = (0, import_react.useRef)(null);
|
|
57
|
+
const [searchValue, setSearchValue] = (0, import_react.useState)(value);
|
|
58
|
+
const [isOpen, setIsOpen] = (0, import_react.useState)(false);
|
|
59
|
+
const [isActive, setIsActive] = (0, import_react.useState)(false);
|
|
60
|
+
const [isInputFocus, setIsInputFocus] = (0, import_react.useState)(false);
|
|
61
|
+
const [isSelected, setIsSelected] = (0, import_react.useState)(false);
|
|
62
|
+
(0, import_react.useEffect)(() => {
|
|
54
63
|
if (isInputFocus && activeCount <= searchValue.length && !isSelected) {
|
|
55
64
|
setIsOpen(true);
|
|
56
65
|
setIsActive(true);
|
|
@@ -58,26 +67,26 @@ const DSZipCodeSearch = _ref2 => {
|
|
|
58
67
|
setIsOpen(false);
|
|
59
68
|
}
|
|
60
69
|
}, [isInputFocus, isActive, activeCount, searchValue, isSelected]);
|
|
61
|
-
|
|
62
|
-
setSearchValue(value ||
|
|
70
|
+
(0, import_react.useEffect)(() => {
|
|
71
|
+
setSearchValue(value || "");
|
|
63
72
|
}, [value]);
|
|
64
|
-
const onTypeInInput =
|
|
73
|
+
const onTypeInInput = (0, import_react.useCallback)((e) => {
|
|
65
74
|
const finalVal = e.target.value;
|
|
66
75
|
onSearch(finalVal);
|
|
67
76
|
setSearchValue(finalVal);
|
|
68
77
|
setIsSelected(false);
|
|
69
78
|
}, [onSearch]);
|
|
70
|
-
const onFocusInput =
|
|
79
|
+
const onFocusInput = (0, import_react.useCallback)(() => {
|
|
71
80
|
setIsInputFocus(true);
|
|
72
81
|
}, []);
|
|
73
|
-
const onInnerBlur =
|
|
82
|
+
const onInnerBlur = (0, import_react.useCallback)((e) => {
|
|
74
83
|
setIsInputFocus(false);
|
|
75
84
|
onBlur(e);
|
|
76
85
|
}, [onBlur]);
|
|
77
|
-
const onClose =
|
|
86
|
+
const onClose = (0, import_react.useCallback)(() => {
|
|
78
87
|
setIsActive(false);
|
|
79
88
|
}, []);
|
|
80
|
-
const onSelectItem =
|
|
89
|
+
const onSelectItem = (0, import_react.useCallback)((item) => {
|
|
81
90
|
setSearchValue(item.value);
|
|
82
91
|
onChange(item);
|
|
83
92
|
setIsSelected(true);
|
|
@@ -85,37 +94,34 @@ const DSZipCodeSearch = _ref2 => {
|
|
|
85
94
|
setIsOpen(false);
|
|
86
95
|
onClose();
|
|
87
96
|
}, [onChange, onClose]);
|
|
88
|
-
return
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}))
|
|
111
|
-
})
|
|
97
|
+
return /* @__PURE__ */ import_react.default.createElement(import_blocks.InputSearchWrapper, {
|
|
98
|
+
...containerProps
|
|
99
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_ds_dropdownmenu.default, {
|
|
100
|
+
isOpen: isOpen && options.length > 0,
|
|
101
|
+
menuProps: { className: "input-search-menu" },
|
|
102
|
+
onClose,
|
|
103
|
+
onSelectMenuItem: onSelectItem,
|
|
104
|
+
contentStyle: {
|
|
105
|
+
maxHeight: 200
|
|
106
|
+
},
|
|
107
|
+
options: options.length > 0 ? [(0, import_helper.createDisabledOption)(selectRightOptions), ...(0, import_helper.noAddonOptions)(options)] : [],
|
|
108
|
+
triggerComponent: /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSInputMask, {
|
|
109
|
+
disabled,
|
|
110
|
+
innerRef: (_ref) => ref.current = _ref,
|
|
111
|
+
mask,
|
|
112
|
+
onBlur: onInnerBlur,
|
|
113
|
+
onChange: onTypeInInput,
|
|
114
|
+
onFocus: onFocusInput,
|
|
115
|
+
placeholder,
|
|
116
|
+
value: searchValue,
|
|
117
|
+
tabIndex
|
|
118
|
+
}))
|
|
112
119
|
}));
|
|
113
120
|
};
|
|
114
|
-
|
|
115
|
-
DSZipCodeSearch.defaultProps =
|
|
116
|
-
const ZipCodeSearchWithSchema =
|
|
117
|
-
ZipCodeSearchWithSchema.propTypes =
|
|
118
|
-
|
|
119
|
-
exports
|
|
120
|
-
|
|
121
|
-
exports["default"] = DSZipCodeSearch;
|
|
121
|
+
DSZipCodeSearch.propTypes = import_props.zipcodeSearchProps;
|
|
122
|
+
DSZipCodeSearch.defaultProps = import_props.defaultProps;
|
|
123
|
+
const ZipCodeSearchWithSchema = (0, import_react_desc.describe)(DSZipCodeSearch);
|
|
124
|
+
ZipCodeSearchWithSchema.propTypes = import_props.zipcodeSearchProps;
|
|
125
|
+
var DSZipCodeSearch_default = DSZipCodeSearch;
|
|
126
|
+
module.exports = __toCommonJS(DSZipCodeSearch_exports);
|
|
127
|
+
//# sourceMappingURL=DSZipCodeSearch.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSZipCodeSearch.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-useless-escape */\n/* eslint-disable max-lines */\n/* eslint-disable indent */\nimport React, { useState, useEffect, useRef, useCallback } from 'react';\nimport { describe } from 'react-desc';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { DSInputMask } from '@elliemae/ds-form';\nimport { InputSearchWrapper } from './components/blocks';\nimport { createDisabledOption, noAddonOptions } from './components/helper';\nimport { zipcodeSearchProps, defaultProps } from './props';\n\nconst DSZipCodeSearch = ({\n disabled,\n value,\n placeholder,\n mask,\n onBlur,\n onChange,\n onSearch,\n containerProps,\n selectRightOptions,\n activeCount,\n options,\n tabIndex,\n}) => {\n const ref = useRef(null);\n const [searchValue, setSearchValue] = useState(value);\n const [isOpen, setIsOpen] = useState(false);\n const [isActive, setIsActive] = useState(false);\n const [isInputFocus, setIsInputFocus] = useState(false);\n const [isSelected, setIsSelected] = useState(false);\n\n useEffect(() => {\n if (isInputFocus && activeCount <= searchValue.length && !isSelected) {\n setIsOpen(true);\n setIsActive(true);\n } else if (!isActive || activeCount > searchValue.length) {\n setIsOpen(false);\n }\n }, [isInputFocus, isActive, activeCount, searchValue, isSelected]);\n useEffect(() => {\n setSearchValue(value || '');\n }, [value]);\n\n const onTypeInInput = useCallback(\n (e) => {\n const finalVal = e.target.value;\n onSearch(finalVal);\n setSearchValue(finalVal);\n setIsSelected(false);\n },\n [onSearch],\n );\n\n const onFocusInput = useCallback(() => {\n setIsInputFocus(true);\n }, []);\n\n const onInnerBlur = useCallback(\n (e) => {\n setIsInputFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n const onClose = useCallback(() => {\n setIsActive(false);\n }, []);\n const onSelectItem = useCallback(\n (item) => {\n setSearchValue(item.value);\n onChange(item);\n setIsSelected(true);\n ref.current.focus();\n setIsOpen(false);\n onClose();\n },\n [onChange, onClose],\n );\n\n return (\n <InputSearchWrapper {...containerProps}>\n <DSDropdownMenu\n isOpen={isOpen && options.length > 0}\n menuProps={{ className: 'input-search-menu' }}\n onClose={onClose}\n onSelectMenuItem={onSelectItem}\n contentStyle={{\n maxHeight: 200,\n }}\n options={options.length > 0 ? [createDisabledOption(selectRightOptions), ...noAddonOptions(options)] : []}\n triggerComponent={\n <div>\n <DSInputMask\n disabled={disabled}\n innerRef={(_ref) => (ref.current = _ref)}\n mask={mask}\n onBlur={onInnerBlur}\n onChange={onTypeInInput}\n onFocus={onFocusInput}\n placeholder={placeholder}\n value={searchValue}\n tabIndex={tabIndex}\n />\n </div>\n }\n />\n </InputSearchWrapper>\n );\n};\n\nDSZipCodeSearch.propTypes = zipcodeSearchProps;\n\nDSZipCodeSearch.defaultProps = defaultProps;\n\nconst ZipCodeSearchWithSchema = describe(DSZipCodeSearch);\nZipCodeSearchWithSchema.propTypes = zipcodeSearchProps;\n\nexport { DSZipCodeSearch, ZipCodeSearchWithSchema };\nexport default DSZipCodeSearch;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAgE;AAChE,wBAAyB;AACzB,6BAA2B;AAC3B,qBAA4B;AAC5B,oBAAmC;AACnC,oBAAqD;AACrD,mBAAiD;AAEjD,MAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MACI;AACJ,QAAM,MAAM,yBAAO;AACnB,QAAM,CAAC,aAAa,kBAAkB,2BAAS;AAC/C,QAAM,CAAC,QAAQ,aAAa,2BAAS;AACrC,QAAM,CAAC,UAAU,eAAe,2BAAS;AACzC,QAAM,CAAC,cAAc,mBAAmB,2BAAS;AACjD,QAAM,CAAC,YAAY,iBAAiB,2BAAS;AAE7C,8BAAU,MAAM;AACd,QAAI,gBAAgB,eAAe,YAAY,UAAU,CAAC,YAAY;AACpE,gBAAU;AACV,kBAAY;AAAA,eACH,CAAC,YAAY,cAAc,YAAY,QAAQ;AACxD,gBAAU;AAAA;AAAA,KAEX,CAAC,cAAc,UAAU,aAAa,aAAa;AACtD,8BAAU,MAAM;AACd,mBAAe,SAAS;AAAA,KACvB,CAAC;AAEJ,QAAM,gBAAgB,8BACpB,CAAC,MAAM;AACL,UAAM,WAAW,EAAE,OAAO;AAC1B,aAAS;AACT,mBAAe;AACf,kBAAc;AAAA,KAEhB,CAAC;AAGH,QAAM,eAAe,8BAAY,MAAM;AACrC,oBAAgB;AAAA,KACf;AAEH,QAAM,cAAc,8BAClB,CAAC,MAAM;AACL,oBAAgB;AAChB,WAAO;AAAA,KAET,CAAC;AAEH,QAAM,UAAU,8BAAY,MAAM;AAChC,gBAAY;AAAA,KACX;AACH,QAAM,eAAe,8BACnB,CAAC,SAAS;AACR,mBAAe,KAAK;AACpB,aAAS;AACT,kBAAc;AACd,QAAI,QAAQ;AACZ,cAAU;AACV;AAAA,KAEF,CAAC,UAAU;AAGb,SACE,mDAAC,kCAAD;AAAA,OAAwB;AAAA,KACtB,mDAAC,gCAAD;AAAA,IACE,QAAQ,UAAU,QAAQ,SAAS;AAAA,IACnC,WAAW,EAAE,WAAW;AAAA,IACxB;AAAA,IACA,kBAAkB;AAAA,IAClB,cAAc;AAAA,MACZ,WAAW;AAAA;AAAA,IAEb,SAAS,QAAQ,SAAS,IAAI,CAAC,wCAAqB,qBAAqB,GAAG,kCAAe,YAAY;AAAA,IACvG,kBACE,mDAAC,OAAD,MACE,mDAAC,4BAAD;AAAA,MACE;AAAA,MACA,UAAU,CAAC,SAAU,IAAI,UAAU;AAAA,MACnC;AAAA,MACA,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,SAAS;AAAA,MACT;AAAA,MACA,OAAO;AAAA,MACP;AAAA;AAAA;AAAA;AASd,gBAAgB,YAAY;AAE5B,gBAAgB,eAAe;AAE/B,MAAM,0BAA0B,gCAAS;AACzC,wBAAwB,YAAY;AAGpC,IAAO,0BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/components/blocks.js
CHANGED
|
@@ -1,10 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var blocks_exports = {};
|
|
29
|
+
__export(blocks_exports, {
|
|
30
|
+
InputSearchWrapper: () => InputSearchWrapper
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
var import_ds_classnames = __toESM(require("@elliemae/ds-classnames"));
|
|
34
|
+
const blockName = "input-search";
|
|
35
|
+
const InputSearchWrapper = (0, import_ds_classnames.aggregatedClasses)("div")(blockName);
|
|
36
|
+
module.exports = __toCommonJS(blocks_exports);
|
|
37
|
+
//# sourceMappingURL=blocks.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/blocks.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'input-search';\n\nexport const InputSearchWrapper = aggregatedClasses('div')(blockName);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,2BAAkC;AAElC,MAAM,YAAY;AAEX,MAAM,qBAAqB,4CAAkB,OAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/components/helper.js
CHANGED
|
@@ -1,39 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var helper_exports = {};
|
|
29
|
+
__export(helper_exports, {
|
|
30
|
+
createDisabledOption: () => createDisabledOption,
|
|
31
|
+
noAddonOptions: () => noAddonOptions
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
21
34
|
function createDisabledOption(label) {
|
|
22
35
|
return {
|
|
23
|
-
id:
|
|
24
|
-
type:
|
|
36
|
+
id: "no-option",
|
|
37
|
+
type: "disabled",
|
|
25
38
|
label,
|
|
26
39
|
noAddon: true,
|
|
27
|
-
|
|
28
|
-
className:
|
|
40
|
+
"aria-disabled": true,
|
|
41
|
+
className: "no-options",
|
|
29
42
|
tabIndex: -1
|
|
30
43
|
};
|
|
31
44
|
}
|
|
32
45
|
function noAddonOptions(options) {
|
|
33
|
-
return options.map(op =>
|
|
34
|
-
noAddon: true
|
|
35
|
-
}));
|
|
46
|
+
return options.map((op) => ({ ...op, noAddon: true }));
|
|
36
47
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
exports.noAddonOptions = noAddonOptions;
|
|
48
|
+
module.exports = __toCommonJS(helper_exports);
|
|
49
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/helper.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export function createDisabledOption(label) {\n return {\n id: 'no-option',\n type: 'disabled',\n label,\n noAddon: true,\n 'aria-disabled': true,\n className: 'no-options',\n tabIndex: -1,\n };\n}\n\nexport function noAddonOptions(options) {\n return options.map(op => ({ ...op, noAddon: true }));\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,8BAA8B,OAAO;AAC1C,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,MAAM;AAAA,IACN;AAAA,IACA,SAAS;AAAA,IACT,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,UAAU;AAAA;AAAA;AAIP,wBAAwB,SAAS;AACtC,SAAO,QAAQ,IAAI,QAAO,MAAK,IAAI,SAAS;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/index.js
CHANGED
|
@@ -1,11 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var src_exports = {};
|
|
29
|
+
__export(src_exports, {
|
|
30
|
+
default: () => import_DSZipCodeSearch.default
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
__reExport(src_exports, __toESM(require("./DSZipCodeSearch")));
|
|
34
|
+
var import_DSZipCodeSearch = __toESM(require("./DSZipCodeSearch"));
|
|
35
|
+
module.exports = __toCommonJS(src_exports);
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export * from './DSZipCodeSearch';\n\nexport { default } from './DSZipCodeSearch';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc;AAEd,6BAAwB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/props.js
CHANGED
|
@@ -1,66 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var props_exports = {};
|
|
29
|
+
__export(props_exports, {
|
|
30
|
+
defaultProps: () => defaultProps,
|
|
31
|
+
zipcodeSearchProps: () => zipcodeSearchProps
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_react_desc = __toESM(require("react-desc"));
|
|
35
|
+
var import_ds_form = __toESM(require("@elliemae/ds-form"));
|
|
8
36
|
const zipcodeSearchProps = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
onBlur: reactDesc.PropTypes.func.description('function called on blur'),
|
|
26
|
-
|
|
27
|
-
/** function called on change */
|
|
28
|
-
onChange: reactDesc.PropTypes.func.description('function called on change'),
|
|
29
|
-
|
|
30
|
-
/** options to display */
|
|
31
|
-
options: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.shape({
|
|
32
|
-
label: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.number]),
|
|
33
|
-
value: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.number])
|
|
34
|
-
})).description('options to display'),
|
|
35
|
-
|
|
36
|
-
/** placeholder value */
|
|
37
|
-
placeholder: reactDesc.PropTypes.string.description('placeholder value'),
|
|
38
|
-
|
|
39
|
-
/** format mask to apply */
|
|
40
|
-
mask: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.any).description('format mask to apply'),
|
|
41
|
-
|
|
42
|
-
/** function called onsearch */
|
|
43
|
-
onSearch: reactDesc.PropTypes.func.description('function called onsearch'),
|
|
44
|
-
|
|
45
|
-
/** Correction messange */
|
|
46
|
-
selectRightOptions: reactDesc.PropTypes.string.description('Correction messange'),
|
|
47
|
-
|
|
48
|
-
/** current amount */
|
|
49
|
-
activeCount: reactDesc.PropTypes.number.description('current amount')
|
|
37
|
+
className: import_react_desc.PropTypes.string.description("html class attribute"),
|
|
38
|
+
containerProps: import_react_desc.PropTypes.object.description("Set of Properties attached to the main container"),
|
|
39
|
+
tabIndex: import_react_desc.PropTypes.number.description("native tabindex property to handle focus order"),
|
|
40
|
+
disabled: import_react_desc.PropTypes.bool.description("disable component"),
|
|
41
|
+
value: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.string, import_react_desc.PropTypes.number, import_react_desc.PropTypes.object]).description("input value").isRequired,
|
|
42
|
+
onBlur: import_react_desc.PropTypes.func.description("function called on blur"),
|
|
43
|
+
onChange: import_react_desc.PropTypes.func.description("function called on change"),
|
|
44
|
+
options: import_react_desc.PropTypes.arrayOf(import_react_desc.PropTypes.shape({
|
|
45
|
+
label: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.string, import_react_desc.PropTypes.number]),
|
|
46
|
+
value: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.string, import_react_desc.PropTypes.number])
|
|
47
|
+
})).description("options to display"),
|
|
48
|
+
placeholder: import_react_desc.PropTypes.string.description("placeholder value"),
|
|
49
|
+
mask: import_react_desc.PropTypes.arrayOf(import_react_desc.PropTypes.any).description("format mask to apply"),
|
|
50
|
+
onSearch: import_react_desc.PropTypes.func.description("function called onsearch"),
|
|
51
|
+
selectRightOptions: import_react_desc.PropTypes.string.description("Correction messange"),
|
|
52
|
+
activeCount: import_react_desc.PropTypes.number.description("current amount")
|
|
50
53
|
};
|
|
51
54
|
const defaultProps = {
|
|
52
55
|
disabled: false,
|
|
53
|
-
value:
|
|
54
|
-
placeholder:
|
|
55
|
-
mask:
|
|
56
|
+
value: "",
|
|
57
|
+
placeholder: "_____-____",
|
|
58
|
+
mask: import_ds_form.MASK_TYPES.ZIP_CODE_SEARCH,
|
|
56
59
|
onBlur: () => null,
|
|
57
60
|
onChange: () => null,
|
|
58
61
|
onSearch: () => null,
|
|
59
62
|
containerProps: {},
|
|
60
|
-
selectRightOptions:
|
|
63
|
+
selectRightOptions: "Please select the appropriate city",
|
|
61
64
|
activeCount: 5,
|
|
62
65
|
options: []
|
|
63
66
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
exports.zipcodeSearchProps = zipcodeSearchProps;
|
|
67
|
+
module.exports = __toCommonJS(props_exports);
|
|
68
|
+
//# sourceMappingURL=props.js.map
|
package/cjs/props.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/props.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { PropTypes } from 'react-desc';\nimport { MASK_TYPES } from '@elliemae/ds-form';\n\nexport const zipcodeSearchProps = {\n /** html class attribute */\n className: PropTypes.string.description('html class attribute'),\n /** Set of Properties attached to the main container */\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n /** native tabindex property to handle focus order */\n tabIndex: PropTypes.number.description('native tabindex property to handle focus order'),\n /** disable component */\n disabled: PropTypes.bool.description('disable component'),\n /** input value */\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).description('input value')\n .isRequired,\n /** function called on blur */\n onBlur: PropTypes.func.description('function called on blur'),\n /** function called on change */\n onChange: PropTypes.func.description('function called on change'),\n /** options to display */\n options: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n }),\n ).description('options to display'),\n /** placeholder value */\n placeholder: PropTypes.string.description('placeholder value'),\n /** format mask to apply */\n mask: PropTypes.arrayOf(PropTypes.any).description('format mask to apply'),\n /** function called onsearch */\n onSearch: PropTypes.func.description('function called onsearch'),\n /** Correction messange */\n selectRightOptions: PropTypes.string.description('Correction messange'),\n /** current amount */\n activeCount: PropTypes.number.description('current amount'),\n};\n\nexport const defaultProps = {\n disabled: false,\n value: '',\n placeholder: '_____-____',\n mask: MASK_TYPES.ZIP_CODE_SEARCH,\n onBlur: () => null,\n onChange: () => null,\n onSearch: () => null,\n containerProps: {},\n selectRightOptions: 'Please select the appropriate city',\n activeCount: 5,\n options: [],\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA0B;AAC1B,qBAA2B;AAEpB,MAAM,qBAAqB;AAAA,EAEhC,WAAW,4BAAU,OAAO,YAAY;AAAA,EAExC,gBAAgB,4BAAU,OAAO,YAAY;AAAA,EAE7C,UAAU,4BAAU,OAAO,YAAY;AAAA,EAEvC,UAAU,4BAAU,KAAK,YAAY;AAAA,EAErC,OAAO,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,QAAQ,4BAAU,SAAS,YAAY,eAC5F;AAAA,EAEH,QAAQ,4BAAU,KAAK,YAAY;AAAA,EAEnC,UAAU,4BAAU,KAAK,YAAY;AAAA,EAErC,SAAS,4BAAU,QACjB,4BAAU,MAAM;AAAA,IACd,OAAO,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU;AAAA,IACxD,OAAO,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU;AAAA,MAE1D,YAAY;AAAA,EAEd,aAAa,4BAAU,OAAO,YAAY;AAAA,EAE1C,MAAM,4BAAU,QAAQ,4BAAU,KAAK,YAAY;AAAA,EAEnD,UAAU,4BAAU,KAAK,YAAY;AAAA,EAErC,oBAAoB,4BAAU,OAAO,YAAY;AAAA,EAEjD,aAAa,4BAAU,OAAO,YAAY;AAAA;AAGrC,MAAM,eAAe;AAAA,EAC1B,UAAU;AAAA,EACV,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM,0BAAW;AAAA,EACjB,QAAQ,MAAM;AAAA,EACd,UAAU,MAAM;AAAA,EAChB,UAAU,MAAM;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,SAAS;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/DSZipCodeSearch.js
CHANGED
|
@@ -1,39 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
let {
|
|
24
|
-
disabled,
|
|
25
|
-
value,
|
|
26
|
-
placeholder,
|
|
27
|
-
mask,
|
|
28
|
-
onBlur,
|
|
29
|
-
onChange,
|
|
30
|
-
onSearch,
|
|
31
|
-
containerProps,
|
|
32
|
-
selectRightOptions,
|
|
33
|
-
activeCount,
|
|
34
|
-
options,
|
|
35
|
-
tabIndex
|
|
36
|
-
} = _ref2;
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useState, useEffect, useRef, useCallback } from "react";
|
|
3
|
+
import { describe } from "react-desc";
|
|
4
|
+
import DSDropdownMenu from "@elliemae/ds-dropdownmenu";
|
|
5
|
+
import { DSInputMask } from "@elliemae/ds-form";
|
|
6
|
+
import { InputSearchWrapper } from "./components/blocks";
|
|
7
|
+
import { createDisabledOption, noAddonOptions } from "./components/helper";
|
|
8
|
+
import { zipcodeSearchProps, defaultProps } from "./props";
|
|
9
|
+
const DSZipCodeSearch = ({
|
|
10
|
+
disabled,
|
|
11
|
+
value,
|
|
12
|
+
placeholder,
|
|
13
|
+
mask,
|
|
14
|
+
onBlur,
|
|
15
|
+
onChange,
|
|
16
|
+
onSearch,
|
|
17
|
+
containerProps,
|
|
18
|
+
selectRightOptions,
|
|
19
|
+
activeCount,
|
|
20
|
+
options,
|
|
21
|
+
tabIndex
|
|
22
|
+
}) => {
|
|
37
23
|
const ref = useRef(null);
|
|
38
24
|
const [searchValue, setSearchValue] = useState(value);
|
|
39
25
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -49,9 +35,9 @@ const DSZipCodeSearch = _ref2 => {
|
|
|
49
35
|
}
|
|
50
36
|
}, [isInputFocus, isActive, activeCount, searchValue, isSelected]);
|
|
51
37
|
useEffect(() => {
|
|
52
|
-
setSearchValue(value ||
|
|
38
|
+
setSearchValue(value || "");
|
|
53
39
|
}, [value]);
|
|
54
|
-
const onTypeInInput = useCallback(e => {
|
|
40
|
+
const onTypeInInput = useCallback((e) => {
|
|
55
41
|
const finalVal = e.target.value;
|
|
56
42
|
onSearch(finalVal);
|
|
57
43
|
setSearchValue(finalVal);
|
|
@@ -60,14 +46,14 @@ const DSZipCodeSearch = _ref2 => {
|
|
|
60
46
|
const onFocusInput = useCallback(() => {
|
|
61
47
|
setIsInputFocus(true);
|
|
62
48
|
}, []);
|
|
63
|
-
const onInnerBlur = useCallback(e => {
|
|
49
|
+
const onInnerBlur = useCallback((e) => {
|
|
64
50
|
setIsInputFocus(false);
|
|
65
51
|
onBlur(e);
|
|
66
52
|
}, [onBlur]);
|
|
67
53
|
const onClose = useCallback(() => {
|
|
68
54
|
setIsActive(false);
|
|
69
55
|
}, []);
|
|
70
|
-
const onSelectItem = useCallback(item => {
|
|
56
|
+
const onSelectItem = useCallback((item) => {
|
|
71
57
|
setSearchValue(item.value);
|
|
72
58
|
onChange(item);
|
|
73
59
|
setIsSelected(true);
|
|
@@ -75,35 +61,38 @@ const DSZipCodeSearch = _ref2 => {
|
|
|
75
61
|
setIsOpen(false);
|
|
76
62
|
onClose();
|
|
77
63
|
}, [onChange, onClose]);
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}))
|
|
101
|
-
})
|
|
64
|
+
return /* @__PURE__ */ React2.createElement(InputSearchWrapper, {
|
|
65
|
+
...containerProps
|
|
66
|
+
}, /* @__PURE__ */ React2.createElement(DSDropdownMenu, {
|
|
67
|
+
isOpen: isOpen && options.length > 0,
|
|
68
|
+
menuProps: { className: "input-search-menu" },
|
|
69
|
+
onClose,
|
|
70
|
+
onSelectMenuItem: onSelectItem,
|
|
71
|
+
contentStyle: {
|
|
72
|
+
maxHeight: 200
|
|
73
|
+
},
|
|
74
|
+
options: options.length > 0 ? [createDisabledOption(selectRightOptions), ...noAddonOptions(options)] : [],
|
|
75
|
+
triggerComponent: /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(DSInputMask, {
|
|
76
|
+
disabled,
|
|
77
|
+
innerRef: (_ref) => ref.current = _ref,
|
|
78
|
+
mask,
|
|
79
|
+
onBlur: onInnerBlur,
|
|
80
|
+
onChange: onTypeInInput,
|
|
81
|
+
onFocus: onFocusInput,
|
|
82
|
+
placeholder,
|
|
83
|
+
value: searchValue,
|
|
84
|
+
tabIndex
|
|
85
|
+
}))
|
|
102
86
|
}));
|
|
103
87
|
};
|
|
104
|
-
|
|
88
|
+
DSZipCodeSearch.propTypes = zipcodeSearchProps;
|
|
105
89
|
DSZipCodeSearch.defaultProps = defaultProps;
|
|
106
90
|
const ZipCodeSearchWithSchema = describe(DSZipCodeSearch);
|
|
107
91
|
ZipCodeSearchWithSchema.propTypes = zipcodeSearchProps;
|
|
108
|
-
|
|
109
|
-
export {
|
|
92
|
+
var DSZipCodeSearch_default = DSZipCodeSearch;
|
|
93
|
+
export {
|
|
94
|
+
DSZipCodeSearch,
|
|
95
|
+
ZipCodeSearchWithSchema,
|
|
96
|
+
DSZipCodeSearch_default as default
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=DSZipCodeSearch.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSZipCodeSearch.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-useless-escape */\n/* eslint-disable max-lines */\n/* eslint-disable indent */\nimport React, { useState, useEffect, useRef, useCallback } from 'react';\nimport { describe } from 'react-desc';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { DSInputMask } from '@elliemae/ds-form';\nimport { InputSearchWrapper } from './components/blocks';\nimport { createDisabledOption, noAddonOptions } from './components/helper';\nimport { zipcodeSearchProps, defaultProps } from './props';\n\nconst DSZipCodeSearch = ({\n disabled,\n value,\n placeholder,\n mask,\n onBlur,\n onChange,\n onSearch,\n containerProps,\n selectRightOptions,\n activeCount,\n options,\n tabIndex,\n}) => {\n const ref = useRef(null);\n const [searchValue, setSearchValue] = useState(value);\n const [isOpen, setIsOpen] = useState(false);\n const [isActive, setIsActive] = useState(false);\n const [isInputFocus, setIsInputFocus] = useState(false);\n const [isSelected, setIsSelected] = useState(false);\n\n useEffect(() => {\n if (isInputFocus && activeCount <= searchValue.length && !isSelected) {\n setIsOpen(true);\n setIsActive(true);\n } else if (!isActive || activeCount > searchValue.length) {\n setIsOpen(false);\n }\n }, [isInputFocus, isActive, activeCount, searchValue, isSelected]);\n useEffect(() => {\n setSearchValue(value || '');\n }, [value]);\n\n const onTypeInInput = useCallback(\n (e) => {\n const finalVal = e.target.value;\n onSearch(finalVal);\n setSearchValue(finalVal);\n setIsSelected(false);\n },\n [onSearch],\n );\n\n const onFocusInput = useCallback(() => {\n setIsInputFocus(true);\n }, []);\n\n const onInnerBlur = useCallback(\n (e) => {\n setIsInputFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n const onClose = useCallback(() => {\n setIsActive(false);\n }, []);\n const onSelectItem = useCallback(\n (item) => {\n setSearchValue(item.value);\n onChange(item);\n setIsSelected(true);\n ref.current.focus();\n setIsOpen(false);\n onClose();\n },\n [onChange, onClose],\n );\n\n return (\n <InputSearchWrapper {...containerProps}>\n <DSDropdownMenu\n isOpen={isOpen && options.length > 0}\n menuProps={{ className: 'input-search-menu' }}\n onClose={onClose}\n onSelectMenuItem={onSelectItem}\n contentStyle={{\n maxHeight: 200,\n }}\n options={options.length > 0 ? [createDisabledOption(selectRightOptions), ...noAddonOptions(options)] : []}\n triggerComponent={\n <div>\n <DSInputMask\n disabled={disabled}\n innerRef={(_ref) => (ref.current = _ref)}\n mask={mask}\n onBlur={onInnerBlur}\n onChange={onTypeInInput}\n onFocus={onFocusInput}\n placeholder={placeholder}\n value={searchValue}\n tabIndex={tabIndex}\n />\n </div>\n }\n />\n </InputSearchWrapper>\n );\n};\n\nDSZipCodeSearch.propTypes = zipcodeSearchProps;\n\nDSZipCodeSearch.defaultProps = defaultProps;\n\nconst ZipCodeSearchWithSchema = describe(DSZipCodeSearch);\nZipCodeSearchWithSchema.propTypes = zipcodeSearchProps;\n\nexport { DSZipCodeSearch, ZipCodeSearchWithSchema };\nexport default DSZipCodeSearch;\n"],
|
|
5
|
+
"mappings": "AAAA;ACGA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MACI;AACJ,QAAM,MAAM,OAAO;AACnB,QAAM,CAAC,aAAa,kBAAkB,SAAS;AAC/C,QAAM,CAAC,QAAQ,aAAa,SAAS;AACrC,QAAM,CAAC,UAAU,eAAe,SAAS;AACzC,QAAM,CAAC,cAAc,mBAAmB,SAAS;AACjD,QAAM,CAAC,YAAY,iBAAiB,SAAS;AAE7C,YAAU,MAAM;AACd,QAAI,gBAAgB,eAAe,YAAY,UAAU,CAAC,YAAY;AACpE,gBAAU;AACV,kBAAY;AAAA,eACH,CAAC,YAAY,cAAc,YAAY,QAAQ;AACxD,gBAAU;AAAA;AAAA,KAEX,CAAC,cAAc,UAAU,aAAa,aAAa;AACtD,YAAU,MAAM;AACd,mBAAe,SAAS;AAAA,KACvB,CAAC;AAEJ,QAAM,gBAAgB,YACpB,CAAC,MAAM;AACL,UAAM,WAAW,EAAE,OAAO;AAC1B,aAAS;AACT,mBAAe;AACf,kBAAc;AAAA,KAEhB,CAAC;AAGH,QAAM,eAAe,YAAY,MAAM;AACrC,oBAAgB;AAAA,KACf;AAEH,QAAM,cAAc,YAClB,CAAC,MAAM;AACL,oBAAgB;AAChB,WAAO;AAAA,KAET,CAAC;AAEH,QAAM,UAAU,YAAY,MAAM;AAChC,gBAAY;AAAA,KACX;AACH,QAAM,eAAe,YACnB,CAAC,SAAS;AACR,mBAAe,KAAK;AACpB,aAAS;AACT,kBAAc;AACd,QAAI,QAAQ;AACZ,cAAU;AACV;AAAA,KAEF,CAAC,UAAU;AAGb,SACE,qCAAC,oBAAD;AAAA,OAAwB;AAAA,KACtB,qCAAC,gBAAD;AAAA,IACE,QAAQ,UAAU,QAAQ,SAAS;AAAA,IACnC,WAAW,EAAE,WAAW;AAAA,IACxB;AAAA,IACA,kBAAkB;AAAA,IAClB,cAAc;AAAA,MACZ,WAAW;AAAA;AAAA,IAEb,SAAS,QAAQ,SAAS,IAAI,CAAC,qBAAqB,qBAAqB,GAAG,eAAe,YAAY;AAAA,IACvG,kBACE,qCAAC,OAAD,MACE,qCAAC,aAAD;AAAA,MACE;AAAA,MACA,UAAU,CAAC,SAAU,IAAI,UAAU;AAAA,MACnC;AAAA,MACA,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,SAAS;AAAA,MACT;AAAA,MACA,OAAO;AAAA,MACP;AAAA;AAAA;AAAA;AASd,gBAAgB,YAAY;AAE5B,gBAAgB,eAAe;AAE/B,MAAM,0BAA0B,SAAS;AACzC,wBAAwB,YAAY;AAGpC,IAAO,0BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/components/blocks.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const blockName =
|
|
4
|
-
const InputSearchWrapper = aggregatedClasses(
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
3
|
+
const blockName = "input-search";
|
|
4
|
+
const InputSearchWrapper = aggregatedClasses("div")(blockName);
|
|
5
|
+
export {
|
|
6
|
+
InputSearchWrapper
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=blocks.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/blocks.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'input-search';\n\nexport const InputSearchWrapper = aggregatedClasses('div')(blockName);\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEA,MAAM,YAAY;AAEX,MAAM,qBAAqB,kBAAkB,OAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/components/helper.js
CHANGED
|
@@ -1,30 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
7
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
8
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
9
|
-
|
|
10
|
-
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; }
|
|
11
|
-
|
|
12
|
-
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";
|
|
13
2
|
function createDisabledOption(label) {
|
|
14
3
|
return {
|
|
15
|
-
id:
|
|
16
|
-
type:
|
|
4
|
+
id: "no-option",
|
|
5
|
+
type: "disabled",
|
|
17
6
|
label,
|
|
18
7
|
noAddon: true,
|
|
19
|
-
|
|
20
|
-
className:
|
|
8
|
+
"aria-disabled": true,
|
|
9
|
+
className: "no-options",
|
|
21
10
|
tabIndex: -1
|
|
22
11
|
};
|
|
23
12
|
}
|
|
24
13
|
function noAddonOptions(options) {
|
|
25
|
-
return options.map(op =>
|
|
26
|
-
noAddon: true
|
|
27
|
-
}));
|
|
14
|
+
return options.map((op) => ({ ...op, noAddon: true }));
|
|
28
15
|
}
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
export {
|
|
17
|
+
createDisabledOption,
|
|
18
|
+
noAddonOptions
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/helper.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export function createDisabledOption(label) {\n return {\n id: 'no-option',\n type: 'disabled',\n label,\n noAddon: true,\n 'aria-disabled': true,\n className: 'no-options',\n tabIndex: -1,\n };\n}\n\nexport function noAddonOptions(options) {\n return options.map(op => ({ ...op, noAddon: true }));\n}\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,8BAA8B,OAAO;AAC1C,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,MAAM;AAAA,IACN;AAAA,IACA,SAAS;AAAA,IACT,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,UAAU;AAAA;AAAA;AAIP,wBAAwB,SAAS;AACtC,SAAO,QAAQ,IAAI,QAAO,MAAK,IAAI,SAAS;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/index.js
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export * from "./DSZipCodeSearch";
|
|
3
|
+
import { default as default2 } from "./DSZipCodeSearch";
|
|
4
|
+
export {
|
|
5
|
+
default2 as default
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -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 * from './DSZipCodeSearch';\n\nexport { default } from './DSZipCodeSearch';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/props.js
CHANGED
|
@@ -1,61 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes } from "react-desc";
|
|
3
|
+
import { MASK_TYPES } from "@elliemae/ds-form";
|
|
4
4
|
const zipcodeSearchProps = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
tabIndex: PropTypes.number.description('native tabindex property to handle focus order'),
|
|
13
|
-
|
|
14
|
-
/** disable component */
|
|
15
|
-
disabled: PropTypes.bool.description('disable component'),
|
|
16
|
-
|
|
17
|
-
/** input value */
|
|
18
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).description('input value').isRequired,
|
|
19
|
-
|
|
20
|
-
/** function called on blur */
|
|
21
|
-
onBlur: PropTypes.func.description('function called on blur'),
|
|
22
|
-
|
|
23
|
-
/** function called on change */
|
|
24
|
-
onChange: PropTypes.func.description('function called on change'),
|
|
25
|
-
|
|
26
|
-
/** options to display */
|
|
5
|
+
className: PropTypes.string.description("html class attribute"),
|
|
6
|
+
containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
|
|
7
|
+
tabIndex: PropTypes.number.description("native tabindex property to handle focus order"),
|
|
8
|
+
disabled: PropTypes.bool.description("disable component"),
|
|
9
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).description("input value").isRequired,
|
|
10
|
+
onBlur: PropTypes.func.description("function called on blur"),
|
|
11
|
+
onChange: PropTypes.func.description("function called on change"),
|
|
27
12
|
options: PropTypes.arrayOf(PropTypes.shape({
|
|
28
13
|
label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
29
14
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
30
|
-
})).description(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
mask: PropTypes.arrayOf(PropTypes.any).description('format mask to apply'),
|
|
37
|
-
|
|
38
|
-
/** function called onsearch */
|
|
39
|
-
onSearch: PropTypes.func.description('function called onsearch'),
|
|
40
|
-
|
|
41
|
-
/** Correction messange */
|
|
42
|
-
selectRightOptions: PropTypes.string.description('Correction messange'),
|
|
43
|
-
|
|
44
|
-
/** current amount */
|
|
45
|
-
activeCount: PropTypes.number.description('current amount')
|
|
15
|
+
})).description("options to display"),
|
|
16
|
+
placeholder: PropTypes.string.description("placeholder value"),
|
|
17
|
+
mask: PropTypes.arrayOf(PropTypes.any).description("format mask to apply"),
|
|
18
|
+
onSearch: PropTypes.func.description("function called onsearch"),
|
|
19
|
+
selectRightOptions: PropTypes.string.description("Correction messange"),
|
|
20
|
+
activeCount: PropTypes.number.description("current amount")
|
|
46
21
|
};
|
|
47
22
|
const defaultProps = {
|
|
48
23
|
disabled: false,
|
|
49
|
-
value:
|
|
50
|
-
placeholder:
|
|
24
|
+
value: "",
|
|
25
|
+
placeholder: "_____-____",
|
|
51
26
|
mask: MASK_TYPES.ZIP_CODE_SEARCH,
|
|
52
27
|
onBlur: () => null,
|
|
53
28
|
onChange: () => null,
|
|
54
29
|
onSearch: () => null,
|
|
55
30
|
containerProps: {},
|
|
56
|
-
selectRightOptions:
|
|
31
|
+
selectRightOptions: "Please select the appropriate city",
|
|
57
32
|
activeCount: 5,
|
|
58
33
|
options: []
|
|
59
34
|
};
|
|
60
|
-
|
|
61
|
-
|
|
35
|
+
export {
|
|
36
|
+
defaultProps,
|
|
37
|
+
zipcodeSearchProps
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=props.js.map
|
package/esm/props.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/props.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from 'react-desc';\nimport { MASK_TYPES } from '@elliemae/ds-form';\n\nexport const zipcodeSearchProps = {\n /** html class attribute */\n className: PropTypes.string.description('html class attribute'),\n /** Set of Properties attached to the main container */\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n /** native tabindex property to handle focus order */\n tabIndex: PropTypes.number.description('native tabindex property to handle focus order'),\n /** disable component */\n disabled: PropTypes.bool.description('disable component'),\n /** input value */\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).description('input value')\n .isRequired,\n /** function called on blur */\n onBlur: PropTypes.func.description('function called on blur'),\n /** function called on change */\n onChange: PropTypes.func.description('function called on change'),\n /** options to display */\n options: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n }),\n ).description('options to display'),\n /** placeholder value */\n placeholder: PropTypes.string.description('placeholder value'),\n /** format mask to apply */\n mask: PropTypes.arrayOf(PropTypes.any).description('format mask to apply'),\n /** function called onsearch */\n onSearch: PropTypes.func.description('function called onsearch'),\n /** Correction messange */\n selectRightOptions: PropTypes.string.description('Correction messange'),\n /** current amount */\n activeCount: PropTypes.number.description('current amount'),\n};\n\nexport const defaultProps = {\n disabled: false,\n value: '',\n placeholder: '_____-____',\n mask: MASK_TYPES.ZIP_CODE_SEARCH,\n onBlur: () => null,\n onChange: () => null,\n onSearch: () => null,\n containerProps: {},\n selectRightOptions: 'Please select the appropriate city',\n activeCount: 5,\n options: [],\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEO,MAAM,qBAAqB;AAAA,EAEhC,WAAW,UAAU,OAAO,YAAY;AAAA,EAExC,gBAAgB,UAAU,OAAO,YAAY;AAAA,EAE7C,UAAU,UAAU,OAAO,YAAY;AAAA,EAEvC,UAAU,UAAU,KAAK,YAAY;AAAA,EAErC,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,QAAQ,UAAU,SAAS,YAAY,eAC5F;AAAA,EAEH,QAAQ,UAAU,KAAK,YAAY;AAAA,EAEnC,UAAU,UAAU,KAAK,YAAY;AAAA,EAErC,SAAS,UAAU,QACjB,UAAU,MAAM;AAAA,IACd,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU;AAAA,IACxD,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU;AAAA,MAE1D,YAAY;AAAA,EAEd,aAAa,UAAU,OAAO,YAAY;AAAA,EAE1C,MAAM,UAAU,QAAQ,UAAU,KAAK,YAAY;AAAA,EAEnD,UAAU,UAAU,KAAK,YAAY;AAAA,EAErC,oBAAoB,UAAU,OAAO,YAAY;AAAA,EAEjD,aAAa,UAAU,OAAO,YAAY;AAAA;AAGrC,MAAM,eAAe;AAAA,EAC1B,UAAU;AAAA,EACV,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM,WAAW;AAAA,EACjB,QAAQ,MAAM;AAAA,EACd,UAAU,MAAM;AAAA,EAChB,UAAU,MAAM;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,SAAS;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-zipcode-search",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-alpha.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Zipcode Search",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"build": "node ../../scripts/build/build.js"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@elliemae/ds-classnames": "2.
|
|
52
|
-
"@elliemae/ds-dropdownmenu": "2.
|
|
53
|
-
"@elliemae/ds-form": "2.
|
|
51
|
+
"@elliemae/ds-classnames": "2.2.0-alpha.3",
|
|
52
|
+
"@elliemae/ds-dropdownmenu": "2.2.0-alpha.3",
|
|
53
|
+
"@elliemae/ds-form": "2.2.0-alpha.3",
|
|
54
54
|
"react-desc": "~4.1.3"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|