@elliemae/ds-zipcode-search 2.2.0-alpha.3 → 3.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DSZipCodeSearch.js +92 -98
- package/cjs/components/blocks.js +10 -37
- package/cjs/components/helper.js +30 -40
- package/cjs/index.js +11 -36
- package/cjs/props.js +55 -57
- package/esm/DSZipCodeSearch.js +67 -56
- package/esm/components/blocks.js +6 -8
- package/esm/components/helper.js +21 -11
- package/esm/index.js +1 -7
- package/esm/props.js +46 -24
- package/package.json +4 -4
- package/cjs/DSZipCodeSearch.js.map +0 -7
- package/cjs/components/blocks.js.map +0 -7
- package/cjs/components/helper.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/props.js.map +0 -7
- package/esm/DSZipCodeSearch.js.map +0 -7
- package/esm/components/blocks.js.map +0 -7
- package/esm/components/helper.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/props.js.map +0 -7
package/cjs/DSZipCodeSearch.js
CHANGED
|
@@ -1,65 +1,56 @@
|
|
|
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
|
-
var
|
|
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
|
-
|
|
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)(() => {
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
13
|
+
var react = require('react');
|
|
14
|
+
var reactDesc = require('react-desc');
|
|
15
|
+
var DSDropdownMenu = require('@elliemae/ds-dropdownmenu');
|
|
16
|
+
var dsForm = require('@elliemae/ds-form');
|
|
17
|
+
var blocks = require('./components/blocks.js');
|
|
18
|
+
var helper = require('./components/helper.js');
|
|
19
|
+
var props = require('./props.js');
|
|
20
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
21
|
+
|
|
22
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
|
+
|
|
24
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
25
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
26
|
+
var DSDropdownMenu__default = /*#__PURE__*/_interopDefaultLegacy(DSDropdownMenu);
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
31
|
+
|
|
32
|
+
const DSZipCodeSearch = _ref2 => {
|
|
33
|
+
let {
|
|
34
|
+
disabled,
|
|
35
|
+
value,
|
|
36
|
+
placeholder,
|
|
37
|
+
mask,
|
|
38
|
+
onBlur,
|
|
39
|
+
onChange,
|
|
40
|
+
onSearch,
|
|
41
|
+
containerProps,
|
|
42
|
+
selectRightOptions,
|
|
43
|
+
activeCount,
|
|
44
|
+
options,
|
|
45
|
+
tabIndex
|
|
46
|
+
} = _ref2;
|
|
47
|
+
const ref = react.useRef(null);
|
|
48
|
+
const [searchValue, setSearchValue] = react.useState(value);
|
|
49
|
+
const [isOpen, setIsOpen] = react.useState(false);
|
|
50
|
+
const [isActive, setIsActive] = react.useState(false);
|
|
51
|
+
const [isInputFocus, setIsInputFocus] = react.useState(false);
|
|
52
|
+
const [isSelected, setIsSelected] = react.useState(false);
|
|
53
|
+
react.useEffect(() => {
|
|
63
54
|
if (isInputFocus && activeCount <= searchValue.length && !isSelected) {
|
|
64
55
|
setIsOpen(true);
|
|
65
56
|
setIsActive(true);
|
|
@@ -67,26 +58,26 @@ const DSZipCodeSearch = ({
|
|
|
67
58
|
setIsOpen(false);
|
|
68
59
|
}
|
|
69
60
|
}, [isInputFocus, isActive, activeCount, searchValue, isSelected]);
|
|
70
|
-
|
|
71
|
-
setSearchValue(value ||
|
|
61
|
+
react.useEffect(() => {
|
|
62
|
+
setSearchValue(value || '');
|
|
72
63
|
}, [value]);
|
|
73
|
-
const onTypeInInput =
|
|
64
|
+
const onTypeInInput = react.useCallback(e => {
|
|
74
65
|
const finalVal = e.target.value;
|
|
75
66
|
onSearch(finalVal);
|
|
76
67
|
setSearchValue(finalVal);
|
|
77
68
|
setIsSelected(false);
|
|
78
69
|
}, [onSearch]);
|
|
79
|
-
const onFocusInput =
|
|
70
|
+
const onFocusInput = react.useCallback(() => {
|
|
80
71
|
setIsInputFocus(true);
|
|
81
72
|
}, []);
|
|
82
|
-
const onInnerBlur =
|
|
73
|
+
const onInnerBlur = react.useCallback(e => {
|
|
83
74
|
setIsInputFocus(false);
|
|
84
75
|
onBlur(e);
|
|
85
76
|
}, [onBlur]);
|
|
86
|
-
const onClose =
|
|
77
|
+
const onClose = react.useCallback(() => {
|
|
87
78
|
setIsActive(false);
|
|
88
79
|
}, []);
|
|
89
|
-
const onSelectItem =
|
|
80
|
+
const onSelectItem = react.useCallback(item => {
|
|
90
81
|
setSearchValue(item.value);
|
|
91
82
|
onChange(item);
|
|
92
83
|
setIsSelected(true);
|
|
@@ -94,34 +85,37 @@ const DSZipCodeSearch = ({
|
|
|
94
85
|
setIsOpen(false);
|
|
95
86
|
onClose();
|
|
96
87
|
}, [onChange, onClose]);
|
|
97
|
-
return
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
88
|
+
return /*#__PURE__*/jsxRuntime.jsx(blocks.InputSearchWrapper, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
89
|
+
children: /*#__PURE__*/_jsx__default["default"](DSDropdownMenu__default["default"], {
|
|
90
|
+
isOpen: isOpen && options.length > 0,
|
|
91
|
+
menuProps: {
|
|
92
|
+
className: 'input-search-menu'
|
|
93
|
+
},
|
|
94
|
+
onClose: onClose,
|
|
95
|
+
onSelectMenuItem: onSelectItem,
|
|
96
|
+
contentStyle: {
|
|
97
|
+
maxHeight: 200
|
|
98
|
+
},
|
|
99
|
+
options: options.length > 0 ? [helper.createDisabledOption(selectRightOptions), ...helper.noAddonOptions(options)] : [],
|
|
100
|
+
triggerComponent: /*#__PURE__*/_jsx__default["default"]("div", {}, void 0, /*#__PURE__*/_jsx__default["default"](dsForm.DSInputMask, {
|
|
101
|
+
disabled: disabled,
|
|
102
|
+
innerRef: _ref => ref.current = _ref,
|
|
103
|
+
mask: mask,
|
|
104
|
+
onBlur: onInnerBlur,
|
|
105
|
+
onChange: onTypeInInput,
|
|
106
|
+
onFocus: onFocusInput,
|
|
107
|
+
placeholder: placeholder,
|
|
108
|
+
value: searchValue,
|
|
109
|
+
tabIndex: tabIndex
|
|
110
|
+
}))
|
|
111
|
+
})
|
|
119
112
|
}));
|
|
120
113
|
};
|
|
121
|
-
|
|
122
|
-
DSZipCodeSearch.defaultProps =
|
|
123
|
-
const ZipCodeSearchWithSchema =
|
|
124
|
-
ZipCodeSearchWithSchema.propTypes =
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
114
|
+
|
|
115
|
+
DSZipCodeSearch.defaultProps = props.defaultProps;
|
|
116
|
+
const ZipCodeSearchWithSchema = reactDesc.describe(DSZipCodeSearch);
|
|
117
|
+
ZipCodeSearchWithSchema.propTypes = props.zipcodeSearchProps;
|
|
118
|
+
|
|
119
|
+
exports.DSZipCodeSearch = DSZipCodeSearch;
|
|
120
|
+
exports.ZipCodeSearchWithSchema = ZipCodeSearchWithSchema;
|
|
121
|
+
exports["default"] = DSZipCodeSearch;
|
package/cjs/components/blocks.js
CHANGED
|
@@ -1,37 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dsClassnames = require('@elliemae/ds-classnames');
|
|
6
|
+
|
|
7
|
+
const blockName = 'input-search';
|
|
8
|
+
const InputSearchWrapper = dsClassnames.aggregatedClasses('div')(blockName);
|
|
9
|
+
|
|
10
|
+
exports.InputSearchWrapper = InputSearchWrapper;
|
package/cjs/components/helper.js
CHANGED
|
@@ -1,49 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
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"));
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
13
|
+
|
|
14
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
+
|
|
16
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
34
21
|
function createDisabledOption(label) {
|
|
35
22
|
return {
|
|
36
|
-
id:
|
|
37
|
-
type:
|
|
23
|
+
id: 'no-option',
|
|
24
|
+
type: 'disabled',
|
|
38
25
|
label,
|
|
39
26
|
noAddon: true,
|
|
40
|
-
|
|
41
|
-
className:
|
|
27
|
+
'aria-disabled': true,
|
|
28
|
+
className: 'no-options',
|
|
42
29
|
tabIndex: -1
|
|
43
30
|
};
|
|
44
31
|
}
|
|
45
32
|
function noAddonOptions(options) {
|
|
46
|
-
return options.map(
|
|
33
|
+
return options.map(op => _objectSpread(_objectSpread({}, op), {}, {
|
|
34
|
+
noAddon: true
|
|
35
|
+
}));
|
|
47
36
|
}
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
|
|
38
|
+
exports.createDisabledOption = createDisabledOption;
|
|
39
|
+
exports.noAddonOptions = noAddonOptions;
|
package/cjs/index.js
CHANGED
|
@@ -1,36 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var DSZipCodeSearch = require('./DSZipCodeSearch.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.DSZipCodeSearch = DSZipCodeSearch.DSZipCodeSearch;
|
|
10
|
+
exports.ZipCodeSearchWithSchema = DSZipCodeSearch.ZipCodeSearchWithSchema;
|
|
11
|
+
exports["default"] = DSZipCodeSearch.DSZipCodeSearch;
|
package/cjs/props.js
CHANGED
|
@@ -1,68 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
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"));
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var reactDesc = require('react-desc');
|
|
6
|
+
var dsForm = require('@elliemae/ds-form');
|
|
7
|
+
|
|
36
8
|
const zipcodeSearchProps = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
9
|
+
/** html class attribute */
|
|
10
|
+
className: reactDesc.PropTypes.string.description('html class attribute'),
|
|
11
|
+
|
|
12
|
+
/** Set of Properties attached to the main container */
|
|
13
|
+
containerProps: reactDesc.PropTypes.object.description('Set of Properties attached to the main container'),
|
|
14
|
+
|
|
15
|
+
/** native tabindex property to handle focus order */
|
|
16
|
+
tabIndex: reactDesc.PropTypes.number.description('native tabindex property to handle focus order'),
|
|
17
|
+
|
|
18
|
+
/** disable component */
|
|
19
|
+
disabled: reactDesc.PropTypes.bool.description('disable component'),
|
|
20
|
+
|
|
21
|
+
/** input value */
|
|
22
|
+
value: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.number, reactDesc.PropTypes.object]).description('input value').isRequired,
|
|
23
|
+
|
|
24
|
+
/** function called on blur */
|
|
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')
|
|
53
50
|
};
|
|
54
51
|
const defaultProps = {
|
|
55
52
|
disabled: false,
|
|
56
|
-
value:
|
|
57
|
-
placeholder:
|
|
58
|
-
mask:
|
|
53
|
+
value: '',
|
|
54
|
+
placeholder: '_____-____',
|
|
55
|
+
mask: dsForm.MASK_TYPES.ZIP_CODE_SEARCH,
|
|
59
56
|
onBlur: () => null,
|
|
60
57
|
onChange: () => null,
|
|
61
58
|
onSearch: () => null,
|
|
62
59
|
containerProps: {},
|
|
63
|
-
selectRightOptions:
|
|
60
|
+
selectRightOptions: 'Please select the appropriate city',
|
|
64
61
|
activeCount: 5,
|
|
65
62
|
options: []
|
|
66
63
|
};
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
|
|
65
|
+
exports.defaultProps = defaultProps;
|
|
66
|
+
exports.zipcodeSearchProps = zipcodeSearchProps;
|
package/esm/DSZipCodeSearch.js
CHANGED
|
@@ -1,25 +1,39 @@
|
|
|
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
|
-
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
9
|
+
import { useRef, useState, useEffect, useCallback } from 'react';
|
|
10
|
+
import { describe } from 'react-desc';
|
|
11
|
+
import DSDropdownMenu from '@elliemae/ds-dropdownmenu';
|
|
12
|
+
import { DSInputMask } from '@elliemae/ds-form';
|
|
13
|
+
import { InputSearchWrapper } from './components/blocks.js';
|
|
14
|
+
import { createDisabledOption, noAddonOptions } from './components/helper.js';
|
|
15
|
+
import { zipcodeSearchProps, defaultProps } from './props.js';
|
|
16
|
+
import { jsx } from 'react/jsx-runtime';
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
const DSZipCodeSearch = _ref2 => {
|
|
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;
|
|
23
37
|
const ref = useRef(null);
|
|
24
38
|
const [searchValue, setSearchValue] = useState(value);
|
|
25
39
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -35,9 +49,9 @@ const DSZipCodeSearch = ({
|
|
|
35
49
|
}
|
|
36
50
|
}, [isInputFocus, isActive, activeCount, searchValue, isSelected]);
|
|
37
51
|
useEffect(() => {
|
|
38
|
-
setSearchValue(value ||
|
|
52
|
+
setSearchValue(value || '');
|
|
39
53
|
}, [value]);
|
|
40
|
-
const onTypeInInput = useCallback(
|
|
54
|
+
const onTypeInInput = useCallback(e => {
|
|
41
55
|
const finalVal = e.target.value;
|
|
42
56
|
onSearch(finalVal);
|
|
43
57
|
setSearchValue(finalVal);
|
|
@@ -46,14 +60,14 @@ const DSZipCodeSearch = ({
|
|
|
46
60
|
const onFocusInput = useCallback(() => {
|
|
47
61
|
setIsInputFocus(true);
|
|
48
62
|
}, []);
|
|
49
|
-
const onInnerBlur = useCallback(
|
|
63
|
+
const onInnerBlur = useCallback(e => {
|
|
50
64
|
setIsInputFocus(false);
|
|
51
65
|
onBlur(e);
|
|
52
66
|
}, [onBlur]);
|
|
53
67
|
const onClose = useCallback(() => {
|
|
54
68
|
setIsActive(false);
|
|
55
69
|
}, []);
|
|
56
|
-
const onSelectItem = useCallback(
|
|
70
|
+
const onSelectItem = useCallback(item => {
|
|
57
71
|
setSearchValue(item.value);
|
|
58
72
|
onChange(item);
|
|
59
73
|
setIsSelected(true);
|
|
@@ -61,38 +75,35 @@ const DSZipCodeSearch = ({
|
|
|
61
75
|
setIsOpen(false);
|
|
62
76
|
onClose();
|
|
63
77
|
}, [onChange, onClose]);
|
|
64
|
-
return
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
return /*#__PURE__*/jsx(InputSearchWrapper, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
79
|
+
children: /*#__PURE__*/_jsx(DSDropdownMenu, {
|
|
80
|
+
isOpen: isOpen && options.length > 0,
|
|
81
|
+
menuProps: {
|
|
82
|
+
className: 'input-search-menu'
|
|
83
|
+
},
|
|
84
|
+
onClose: onClose,
|
|
85
|
+
onSelectMenuItem: onSelectItem,
|
|
86
|
+
contentStyle: {
|
|
87
|
+
maxHeight: 200
|
|
88
|
+
},
|
|
89
|
+
options: options.length > 0 ? [createDisabledOption(selectRightOptions), ...noAddonOptions(options)] : [],
|
|
90
|
+
triggerComponent: /*#__PURE__*/_jsx("div", {}, void 0, /*#__PURE__*/_jsx(DSInputMask, {
|
|
91
|
+
disabled: disabled,
|
|
92
|
+
innerRef: _ref => ref.current = _ref,
|
|
93
|
+
mask: mask,
|
|
94
|
+
onBlur: onInnerBlur,
|
|
95
|
+
onChange: onTypeInInput,
|
|
96
|
+
onFocus: onFocusInput,
|
|
97
|
+
placeholder: placeholder,
|
|
98
|
+
value: searchValue,
|
|
99
|
+
tabIndex: tabIndex
|
|
100
|
+
}))
|
|
101
|
+
})
|
|
86
102
|
}));
|
|
87
103
|
};
|
|
88
|
-
|
|
104
|
+
|
|
89
105
|
DSZipCodeSearch.defaultProps = defaultProps;
|
|
90
106
|
const ZipCodeSearchWithSchema = describe(DSZipCodeSearch);
|
|
91
107
|
ZipCodeSearchWithSchema.propTypes = zipcodeSearchProps;
|
|
92
|
-
|
|
93
|
-
export {
|
|
94
|
-
DSZipCodeSearch,
|
|
95
|
-
ZipCodeSearchWithSchema,
|
|
96
|
-
DSZipCodeSearch_default as default
|
|
97
|
-
};
|
|
98
|
-
//# sourceMappingURL=DSZipCodeSearch.js.map
|
|
108
|
+
|
|
109
|
+
export { DSZipCodeSearch, ZipCodeSearchWithSchema, DSZipCodeSearch as default };
|
package/esm/components/blocks.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const blockName =
|
|
4
|
-
const InputSearchWrapper = aggregatedClasses(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=blocks.js.map
|
|
1
|
+
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
2
|
+
|
|
3
|
+
const blockName = 'input-search';
|
|
4
|
+
const InputSearchWrapper = aggregatedClasses('div')(blockName);
|
|
5
|
+
|
|
6
|
+
export { InputSearchWrapper };
|
package/esm/components/helper.js
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
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; }
|
|
2
13
|
function createDisabledOption(label) {
|
|
3
14
|
return {
|
|
4
|
-
id:
|
|
5
|
-
type:
|
|
15
|
+
id: 'no-option',
|
|
16
|
+
type: 'disabled',
|
|
6
17
|
label,
|
|
7
18
|
noAddon: true,
|
|
8
|
-
|
|
9
|
-
className:
|
|
19
|
+
'aria-disabled': true,
|
|
20
|
+
className: 'no-options',
|
|
10
21
|
tabIndex: -1
|
|
11
22
|
};
|
|
12
23
|
}
|
|
13
24
|
function noAddonOptions(options) {
|
|
14
|
-
return options.map(
|
|
25
|
+
return options.map(op => _objectSpread(_objectSpread({}, op), {}, {
|
|
26
|
+
noAddon: true
|
|
27
|
+
}));
|
|
15
28
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
noAddonOptions
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=helper.js.map
|
|
29
|
+
|
|
30
|
+
export { createDisabledOption, noAddonOptions };
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./DSZipCodeSearch";
|
|
3
|
-
import { default as default2 } from "./DSZipCodeSearch";
|
|
4
|
-
export {
|
|
5
|
-
default2 as default
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { DSZipCodeSearch, ZipCodeSearchWithSchema, DSZipCodeSearch as default } from './DSZipCodeSearch.js';
|
package/esm/props.js
CHANGED
|
@@ -1,39 +1,61 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { PropTypes } from 'react-desc';
|
|
2
|
+
import { MASK_TYPES } from '@elliemae/ds-form';
|
|
3
|
+
|
|
4
4
|
const zipcodeSearchProps = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
/** html class attribute */
|
|
6
|
+
className: PropTypes.string.description('html class attribute'),
|
|
7
|
+
|
|
8
|
+
/** Set of Properties attached to the main container */
|
|
9
|
+
containerProps: PropTypes.object.description('Set of Properties attached to the main container'),
|
|
10
|
+
|
|
11
|
+
/** native tabindex property to handle focus order */
|
|
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 */
|
|
12
27
|
options: PropTypes.arrayOf(PropTypes.shape({
|
|
13
28
|
label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
14
29
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
15
|
-
})).description(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
30
|
+
})).description('options to display'),
|
|
31
|
+
|
|
32
|
+
/** placeholder value */
|
|
33
|
+
placeholder: PropTypes.string.description('placeholder value'),
|
|
34
|
+
|
|
35
|
+
/** format mask to apply */
|
|
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')
|
|
21
46
|
};
|
|
22
47
|
const defaultProps = {
|
|
23
48
|
disabled: false,
|
|
24
|
-
value:
|
|
25
|
-
placeholder:
|
|
49
|
+
value: '',
|
|
50
|
+
placeholder: '_____-____',
|
|
26
51
|
mask: MASK_TYPES.ZIP_CODE_SEARCH,
|
|
27
52
|
onBlur: () => null,
|
|
28
53
|
onChange: () => null,
|
|
29
54
|
onSearch: () => null,
|
|
30
55
|
containerProps: {},
|
|
31
|
-
selectRightOptions:
|
|
56
|
+
selectRightOptions: 'Please select the appropriate city',
|
|
32
57
|
activeCount: 5,
|
|
33
58
|
options: []
|
|
34
59
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
zipcodeSearchProps
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=props.js.map
|
|
60
|
+
|
|
61
|
+
export { defaultProps, zipcodeSearchProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-zipcode-search",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-next.0",
|
|
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": "
|
|
52
|
-
"@elliemae/ds-dropdownmenu": "
|
|
53
|
-
"@elliemae/ds-form": "
|
|
51
|
+
"@elliemae/ds-classnames": "3.0.0-next.0",
|
|
52
|
+
"@elliemae/ds-dropdownmenu": "3.0.0-next.0",
|
|
53
|
+
"@elliemae/ds-form": "3.0.0-next.0",
|
|
54
54
|
"react-desc": "~4.1.3"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|