@elliemae/ds-form 3.3.0-next.2 → 3.3.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/CheckboxGroup/DSCheckboxGroup.js +15 -29
- package/dist/cjs/CheckboxGroup/DSCheckboxGroup.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js +24 -65
- package/dist/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueRemove.js +5 -19
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueRemove.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValue.js +3 -15
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValue.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValueRemove.js +7 -20
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValueRemove.js.map +1 -1
- package/dist/cjs/DateInput/DSDateInput.js +14 -46
- package/dist/cjs/DateInput/DSDateInput.js.map +1 -1
- package/dist/cjs/DateInput/components/DateInputImpl.js +4 -17
- package/dist/cjs/DateInput/components/DateInputImpl.js.map +1 -1
- package/dist/cjs/DateInput/components/DateInputs.js +9 -23
- package/dist/cjs/DateInput/components/DateInputs.js.map +1 -1
- package/dist/cjs/DateInputV2/components/DateInputs.js +9 -23
- package/dist/cjs/DateInputV2/components/DateInputs.js.map +1 -1
- package/dist/cjs/ExpandableInput/ExpandableInputImpl.js +3 -19
- package/dist/cjs/ExpandableInput/ExpandableInputImpl.js.map +1 -1
- package/dist/cjs/FloatingLabelInput/FloatingLabelInputImpl.js +4 -17
- package/dist/cjs/FloatingLabelInput/FloatingLabelInputImpl.js.map +1 -1
- package/dist/cjs/FormItem/DSFormItemLayout.js +56 -118
- package/dist/cjs/FormItem/DSFormItemLayout.js.map +1 -1
- package/dist/cjs/FormItem/ValidationFieldWrapper.js +3 -19
- package/dist/cjs/FormItem/ValidationFieldWrapper.js.map +1 -1
- package/dist/cjs/InputGroup/AddonWrapper.js +4 -17
- package/dist/cjs/InputGroup/AddonWrapper.js.map +1 -1
- package/dist/cjs/InputMask/DSInputMask.js +19 -51
- package/dist/cjs/InputMask/DSInputMask.js.map +1 -1
- package/dist/cjs/InputMask/DSInputMaskDeprecated.js +11 -62
- package/dist/cjs/InputMask/DSInputMaskDeprecated.js.map +1 -1
- package/dist/cjs/InputMask/MaskTypes.js +3 -17
- package/dist/cjs/InputMask/MaskTypes.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/DateInputMask.js +37 -97
- package/dist/cjs/InputMask/mask_types/DateInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/DateTimeInputMask.js +37 -97
- package/dist/cjs/InputMask/mask_types/DateTimeInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/DictionaryInputMask.js +40 -103
- package/dist/cjs/InputMask/mask_types/DictionaryInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/NumberInputMask.js +49 -121
- package/dist/cjs/InputMask/mask_types/NumberInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/PhoneInputMask.js +37 -97
- package/dist/cjs/InputMask/mask_types/PhoneInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/PhoneInternationalInputMask.js +37 -97
- package/dist/cjs/InputMask/mask_types/PhoneInternationalInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/SsnInputMask.js +37 -97
- package/dist/cjs/InputMask/mask_types/SsnInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/UsZipCodeInputMask.js +37 -97
- package/dist/cjs/InputMask/mask_types/UsZipCodeInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js +37 -97
- package/dist/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/index.js +79 -119
- package/dist/cjs/InputMask/mask_types/index.js.map +1 -1
- package/dist/cjs/InputProtected/DSInputProtected.js +14 -51
- package/dist/cjs/InputProtected/DSInputProtected.js.map +1 -1
- package/dist/cjs/LargeInputText/DSLargeInputText.js +3 -19
- package/dist/cjs/LargeInputText/DSLargeInputText.js.map +1 -1
- package/dist/cjs/Radio/DSRadio.js +24 -67
- package/dist/cjs/Radio/DSRadio.js.map +1 -1
- package/dist/cjs/RadioGroup/DSRadioGroup.js +15 -29
- package/dist/cjs/RadioGroup/DSRadioGroup.js.map +1 -1
- package/dist/cjs/TimeInput/DSTimeInput.js +8 -40
- package/dist/cjs/TimeInput/DSTimeInput.js.map +1 -1
- package/dist/cjs/TimeInput/TimeInputImpl.js +4 -17
- package/dist/cjs/TimeInput/TimeInputImpl.js.map +1 -1
- package/dist/cjs/TimeInput/TimeInputs.js +12 -25
- package/dist/cjs/TimeInput/TimeInputs.js.map +1 -1
- package/dist/cjs/Toggle/DSToggle.js +25 -66
- package/dist/cjs/Toggle/DSToggle.js.map +1 -1
- package/dist/cjs/Toggle/DSToggleImpl.js +7 -22
- package/dist/cjs/Toggle/DSToggleImpl.js.map +1 -1
- package/dist/cjs/Toggle/DSToggleRender.js +10 -24
- package/dist/cjs/Toggle/DSToggleRender.js.map +1 -1
- package/dist/esm/CheckboxGroup/DSCheckboxGroup.js +15 -31
- package/dist/esm/CheckboxGroup/DSCheckboxGroup.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/ComboBoxFreeSolo.js +24 -67
- package/dist/esm/ComboBoxFreeSolo/ComboBoxFreeSolo.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/components/MultiValueRemove.js +5 -21
- package/dist/esm/ComboBoxFreeSolo/components/MultiValueRemove.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/components/SingleValue.js +3 -17
- package/dist/esm/ComboBoxFreeSolo/components/SingleValue.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/components/SingleValueRemove.js +7 -22
- package/dist/esm/ComboBoxFreeSolo/components/SingleValueRemove.js.map +1 -1
- package/dist/esm/DateInput/DSDateInput.js +14 -48
- package/dist/esm/DateInput/DSDateInput.js.map +1 -1
- package/dist/esm/DateInput/components/DateInputImpl.js +4 -19
- package/dist/esm/DateInput/components/DateInputImpl.js.map +1 -1
- package/dist/esm/DateInput/components/DateInputs.js +9 -25
- package/dist/esm/DateInput/components/DateInputs.js.map +1 -1
- package/dist/esm/DateInputV2/components/DateInputs.js +9 -25
- package/dist/esm/DateInputV2/components/DateInputs.js.map +1 -1
- package/dist/esm/ExpandableInput/ExpandableInputImpl.js +3 -21
- package/dist/esm/ExpandableInput/ExpandableInputImpl.js.map +1 -1
- package/dist/esm/FloatingLabelInput/FloatingLabelInputImpl.js +4 -19
- package/dist/esm/FloatingLabelInput/FloatingLabelInputImpl.js.map +1 -1
- package/dist/esm/FormItem/DSFormItemLayout.js +56 -120
- package/dist/esm/FormItem/DSFormItemLayout.js.map +1 -1
- package/dist/esm/FormItem/ValidationFieldWrapper.js +3 -21
- package/dist/esm/FormItem/ValidationFieldWrapper.js.map +1 -1
- package/dist/esm/InputGroup/AddonWrapper.js +4 -19
- package/dist/esm/InputGroup/AddonWrapper.js.map +1 -1
- package/dist/esm/InputMask/DSInputMask.js +19 -53
- package/dist/esm/InputMask/DSInputMask.js.map +1 -1
- package/dist/esm/InputMask/DSInputMaskDeprecated.js +11 -64
- package/dist/esm/InputMask/DSInputMaskDeprecated.js.map +1 -1
- package/dist/esm/InputMask/MaskTypes.js +3 -19
- package/dist/esm/InputMask/MaskTypes.js.map +1 -1
- package/dist/esm/InputMask/mask_types/DateInputMask.js +37 -99
- package/dist/esm/InputMask/mask_types/DateInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/DateTimeInputMask.js +37 -99
- package/dist/esm/InputMask/mask_types/DateTimeInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/DictionaryInputMask.js +40 -105
- package/dist/esm/InputMask/mask_types/DictionaryInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/NumberInputMask.js +49 -123
- package/dist/esm/InputMask/mask_types/NumberInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/PhoneInputMask.js +37 -99
- package/dist/esm/InputMask/mask_types/PhoneInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/PhoneInternationalInputMask.js +37 -99
- package/dist/esm/InputMask/mask_types/PhoneInternationalInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/SsnInputMask.js +37 -99
- package/dist/esm/InputMask/mask_types/SsnInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/UsZipCodeInputMask.js +37 -99
- package/dist/esm/InputMask/mask_types/UsZipCodeInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/ZipCodeSearchInputMask.js +37 -99
- package/dist/esm/InputMask/mask_types/ZipCodeSearchInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/index.js +79 -121
- package/dist/esm/InputMask/mask_types/index.js.map +1 -1
- package/dist/esm/InputProtected/DSInputProtected.js +14 -53
- package/dist/esm/InputProtected/DSInputProtected.js.map +1 -1
- package/dist/esm/LargeInputText/DSLargeInputText.js +3 -21
- package/dist/esm/LargeInputText/DSLargeInputText.js.map +1 -1
- package/dist/esm/Radio/DSRadio.js +24 -69
- package/dist/esm/Radio/DSRadio.js.map +1 -1
- package/dist/esm/RadioGroup/DSRadioGroup.js +15 -31
- package/dist/esm/RadioGroup/DSRadioGroup.js.map +1 -1
- package/dist/esm/TimeInput/DSTimeInput.js +8 -42
- package/dist/esm/TimeInput/DSTimeInput.js.map +1 -1
- package/dist/esm/TimeInput/TimeInputImpl.js +4 -19
- package/dist/esm/TimeInput/TimeInputImpl.js.map +1 -1
- package/dist/esm/TimeInput/TimeInputs.js +12 -27
- package/dist/esm/TimeInput/TimeInputs.js.map +1 -1
- package/dist/esm/Toggle/DSToggle.js +25 -68
- package/dist/esm/Toggle/DSToggle.js.map +1 -1
- package/dist/esm/Toggle/DSToggleImpl.js +7 -24
- package/dist/esm/Toggle/DSToggleImpl.js.map +1 -1
- package/dist/esm/Toggle/DSToggleRender.js +10 -26
- package/dist/esm/Toggle/DSToggleRender.js.map +1 -1
- package/package.json +12 -12
|
@@ -1,35 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
-
var __objRest = (source, exclude) => {
|
|
22
|
-
var target = {};
|
|
23
|
-
for (var prop in source)
|
|
24
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
if (source != null && __getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
2
|
import * as React from "react";
|
|
34
3
|
import React2, { useCallback, useLayoutEffect, useRef, useState } from "react";
|
|
35
4
|
import { DSTextBox } from "../../TextBox";
|
|
@@ -62,72 +31,40 @@ const conformValue = (rawValue, cursorPos, lastkeycode) => {
|
|
|
62
31
|
}
|
|
63
32
|
return { nextMaskedValue: nextMaskedValue.join(""), maskedPos };
|
|
64
33
|
};
|
|
65
|
-
const ZipCodeSearchInputMask = (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"focus",
|
|
100
|
-
"setFocus",
|
|
101
|
-
"setRawMask",
|
|
102
|
-
"cursorPosition",
|
|
103
|
-
"setCursorPosition",
|
|
104
|
-
"lastkey",
|
|
105
|
-
"setLastkey",
|
|
106
|
-
"setRawValue",
|
|
107
|
-
"style",
|
|
108
|
-
"disabled",
|
|
109
|
-
"className",
|
|
110
|
-
"name",
|
|
111
|
-
"maxLength",
|
|
112
|
-
"minLength",
|
|
113
|
-
"fluidWidth",
|
|
114
|
-
"placeholder",
|
|
115
|
-
"onKeyDown",
|
|
116
|
-
"onClick",
|
|
117
|
-
"onChange",
|
|
118
|
-
"onFocus",
|
|
119
|
-
"onBlur",
|
|
120
|
-
"onPaste",
|
|
121
|
-
"onKeyUp",
|
|
122
|
-
"hasError",
|
|
123
|
-
"readOnly",
|
|
124
|
-
"type",
|
|
125
|
-
"innerRef",
|
|
126
|
-
"clearable",
|
|
127
|
-
"leftComponent",
|
|
128
|
-
"rightComponent",
|
|
129
|
-
"value"
|
|
130
|
-
]);
|
|
34
|
+
const ZipCodeSearchInputMask = ({
|
|
35
|
+
focus,
|
|
36
|
+
setFocus,
|
|
37
|
+
setRawMask,
|
|
38
|
+
cursorPosition,
|
|
39
|
+
setCursorPosition,
|
|
40
|
+
lastkey,
|
|
41
|
+
setLastkey,
|
|
42
|
+
setRawValue,
|
|
43
|
+
style,
|
|
44
|
+
disabled,
|
|
45
|
+
className,
|
|
46
|
+
name,
|
|
47
|
+
maxLength,
|
|
48
|
+
minLength,
|
|
49
|
+
fluidWidth,
|
|
50
|
+
placeholder,
|
|
51
|
+
onKeyDown,
|
|
52
|
+
onClick,
|
|
53
|
+
onChange,
|
|
54
|
+
onFocus,
|
|
55
|
+
onBlur,
|
|
56
|
+
onPaste,
|
|
57
|
+
onKeyUp,
|
|
58
|
+
hasError,
|
|
59
|
+
readOnly,
|
|
60
|
+
type,
|
|
61
|
+
innerRef,
|
|
62
|
+
clearable = false,
|
|
63
|
+
leftComponent,
|
|
64
|
+
rightComponent,
|
|
65
|
+
value,
|
|
66
|
+
...rest
|
|
67
|
+
}) => {
|
|
131
68
|
const inputRef = useRef();
|
|
132
69
|
const [maskedValue, setMaskedValue] = useState(value);
|
|
133
70
|
const conform = useCallback(({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {
|
|
@@ -173,7 +110,8 @@ const ZipCodeSearchInputMask = (_a) => {
|
|
|
173
110
|
setFocus(false);
|
|
174
111
|
onBlur(e);
|
|
175
112
|
}, [onBlur]);
|
|
176
|
-
return /* @__PURE__ */ React2.createElement(DSTextBox,
|
|
113
|
+
return /* @__PURE__ */ React2.createElement(DSTextBox, {
|
|
114
|
+
...rest,
|
|
177
115
|
className,
|
|
178
116
|
clearable,
|
|
179
117
|
disabled,
|
|
@@ -202,7 +140,7 @@ const ZipCodeSearchInputMask = (_a) => {
|
|
|
202
140
|
style,
|
|
203
141
|
type,
|
|
204
142
|
value: maskedValue
|
|
205
|
-
})
|
|
143
|
+
});
|
|
206
144
|
};
|
|
207
145
|
var ZipCodeSearchInputMask_default = ZipCodeSearchInputMask;
|
|
208
146
|
export {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/ZipCodeSearchInputMask.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n const nextMaskedValue = rawValue\n .split('')\n .filter((char) => char >= '0' && char <= '9')\n .slice(0, 9);\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n\n // list of [string to add, position to add]\n const charactersToAdd: TCharsToAdd = [['-', 5]];\n\n charactersToAdd.forEach(([chars, pos]) => {\n if (nextMaskedValue.length > pos) {\n nextMaskedValue.splice(pos, 0, chars);\n if (maskedPos >= pos) maskedPos += chars.length;\n }\n });\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos) maskedPos += chars.length;\n });\n } else if (lastkeycode === 8 && maskedPos) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos + 1) maskedPos -= chars.length;\n });\n }\n return { nextMaskedValue: nextMaskedValue.join(''), maskedPos };\n};\n\nconst ZipCodeSearchInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(\n rawValue,\n cursorPos,\n lastkeycode,\n );\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef && typeof innerRef === 'function') innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nexport { ZipCodeSearchInputMask };\nexport default ZipCodeSearchInputMask;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,32 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
-
var __spreadValues = (a, b) => {
|
|
8
|
-
for (var prop in b || (b = {}))
|
|
9
|
-
if (__hasOwnProp.call(b, prop))
|
|
10
|
-
__defNormalProp(a, prop, b[prop]);
|
|
11
|
-
if (__getOwnPropSymbols)
|
|
12
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
-
if (__propIsEnum.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
}
|
|
16
|
-
return a;
|
|
17
|
-
};
|
|
18
|
-
var __objRest = (source, exclude) => {
|
|
19
|
-
var target = {};
|
|
20
|
-
for (var prop in source)
|
|
21
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
22
|
-
target[prop] = source[prop];
|
|
23
|
-
if (source != null && __getOwnPropSymbols)
|
|
24
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
25
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
26
|
-
target[prop] = source[prop];
|
|
27
|
-
}
|
|
28
|
-
return target;
|
|
29
|
-
};
|
|
30
2
|
import * as React from "react";
|
|
31
3
|
import React2 from "react";
|
|
32
4
|
import { DateInputMask } from "./DateInputMask";
|
|
@@ -44,99 +16,85 @@ const emptyString = "";
|
|
|
44
16
|
const comma = ",";
|
|
45
17
|
const period = ".";
|
|
46
18
|
const OutOfTheBoxMaskTypes = {
|
|
47
|
-
"ds-mask-date": (props) => /* @__PURE__ */ React2.createElement(DateInputMask,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
allowDecimal,
|
|
127
|
-
decimalSymbol,
|
|
128
|
-
decimalLimit,
|
|
129
|
-
requireDecimal,
|
|
130
|
-
allowNegative,
|
|
131
|
-
allowLeadingZeroes,
|
|
132
|
-
integerLimit
|
|
133
|
-
}, rest));
|
|
134
|
-
},
|
|
135
|
-
"ds-mask-phone": (props) => /* @__PURE__ */ React2.createElement(PhoneInputMask, __spreadValues({}, props)),
|
|
136
|
-
"ds-mask-phone-international": (props) => /* @__PURE__ */ React2.createElement(PhoneInternationalInputMask, __spreadValues({}, props)),
|
|
137
|
-
"ds-mask-ssn": (props) => /* @__PURE__ */ React2.createElement(SsnInputMask, __spreadValues({}, props)),
|
|
138
|
-
"ds-mask-us-zip-code": (props) => /* @__PURE__ */ React2.createElement(UsZipCodeInputMask, __spreadValues({}, props)),
|
|
139
|
-
"ds-mask-zip-code-search": (props) => /* @__PURE__ */ React2.createElement(ZipCodeSearchInputMask, __spreadValues({}, props))
|
|
19
|
+
"ds-mask-date": (props) => /* @__PURE__ */ React2.createElement(DateInputMask, {
|
|
20
|
+
...props
|
|
21
|
+
}),
|
|
22
|
+
"ds-mask-date-time": (props) => /* @__PURE__ */ React2.createElement(DateTimeInputMask, {
|
|
23
|
+
...props
|
|
24
|
+
}),
|
|
25
|
+
"ds-mask-dictionary": ({ ignoreCase = true, ...rest }) => /* @__PURE__ */ React2.createElement(DictionaryInputMask, {
|
|
26
|
+
ignoreCase,
|
|
27
|
+
...rest
|
|
28
|
+
}),
|
|
29
|
+
"ds-mask-number": ({
|
|
30
|
+
prefix = dollarSign,
|
|
31
|
+
suffix = emptyString,
|
|
32
|
+
includeThousandsSeparator = true,
|
|
33
|
+
thousandsSeparatorSymbol = comma,
|
|
34
|
+
allowDecimal = false,
|
|
35
|
+
decimalSymbol = period,
|
|
36
|
+
decimalLimit = 2,
|
|
37
|
+
requireDecimal = false,
|
|
38
|
+
allowNegative = false,
|
|
39
|
+
allowLeadingZeroes = false,
|
|
40
|
+
integerLimit = null,
|
|
41
|
+
...rest
|
|
42
|
+
}) => /* @__PURE__ */ React2.createElement(NumberInputMask, {
|
|
43
|
+
prefix,
|
|
44
|
+
suffix,
|
|
45
|
+
includeThousandsSeparator,
|
|
46
|
+
thousandsSeparatorSymbol,
|
|
47
|
+
allowDecimal,
|
|
48
|
+
decimalSymbol,
|
|
49
|
+
decimalLimit,
|
|
50
|
+
requireDecimal,
|
|
51
|
+
allowNegative,
|
|
52
|
+
allowLeadingZeroes,
|
|
53
|
+
integerLimit,
|
|
54
|
+
...rest
|
|
55
|
+
}),
|
|
56
|
+
"ds-mask-percent": ({
|
|
57
|
+
prefix = emptyString,
|
|
58
|
+
suffix = percentSign,
|
|
59
|
+
includeThousandsSeparator = true,
|
|
60
|
+
thousandsSeparatorSymbol = comma,
|
|
61
|
+
allowDecimal = false,
|
|
62
|
+
decimalSymbol = period,
|
|
63
|
+
decimalLimit = 2,
|
|
64
|
+
requireDecimal = false,
|
|
65
|
+
allowNegative = false,
|
|
66
|
+
allowLeadingZeroes = false,
|
|
67
|
+
integerLimit = null,
|
|
68
|
+
...rest
|
|
69
|
+
}) => /* @__PURE__ */ React2.createElement(NumberInputMask, {
|
|
70
|
+
prefix,
|
|
71
|
+
suffix,
|
|
72
|
+
includeThousandsSeparator,
|
|
73
|
+
thousandsSeparatorSymbol,
|
|
74
|
+
allowDecimal,
|
|
75
|
+
decimalSymbol,
|
|
76
|
+
decimalLimit,
|
|
77
|
+
requireDecimal,
|
|
78
|
+
allowNegative,
|
|
79
|
+
allowLeadingZeroes,
|
|
80
|
+
integerLimit,
|
|
81
|
+
...rest
|
|
82
|
+
}),
|
|
83
|
+
"ds-mask-phone": (props) => /* @__PURE__ */ React2.createElement(PhoneInputMask, {
|
|
84
|
+
...props
|
|
85
|
+
}),
|
|
86
|
+
"ds-mask-phone-international": (props) => /* @__PURE__ */ React2.createElement(PhoneInternationalInputMask, {
|
|
87
|
+
...props
|
|
88
|
+
}),
|
|
89
|
+
"ds-mask-ssn": (props) => /* @__PURE__ */ React2.createElement(SsnInputMask, {
|
|
90
|
+
...props
|
|
91
|
+
}),
|
|
92
|
+
"ds-mask-us-zip-code": (props) => /* @__PURE__ */ React2.createElement(UsZipCodeInputMask, {
|
|
93
|
+
...props
|
|
94
|
+
}),
|
|
95
|
+
"ds-mask-zip-code-search": (props) => /* @__PURE__ */ React2.createElement(ZipCodeSearchInputMask, {
|
|
96
|
+
...props
|
|
97
|
+
})
|
|
140
98
|
};
|
|
141
99
|
export {
|
|
142
100
|
OutOfTheBoxMaskTypes
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DateInputMask } from './DateInputMask';\nimport { DateTimeInputMask } from './DateTimeInputMask';\nimport { DictionaryInputMask } from './DictionaryInputMask';\nimport { NumberInputMask } from './NumberInputMask';\nimport { PhoneInputMask } from './PhoneInputMask';\nimport { PhoneInternationalInputMask } from './PhoneInternationalInputMask';\nimport { SsnInputMask } from './SsnInputMask';\nimport { UsZipCodeInputMask } from './UsZipCodeInputMask';\nimport { ZipCodeSearchInputMask } from './ZipCodeSearchInputMask';\n\nconst dollarSign = '$';\nconst percentSign = '%';\nconst emptyString = '';\nconst comma = ',';\nconst period = '.';\n\nexport const OutOfTheBoxMaskTypes = {\n 'ds-mask-date': (props) => <DateInputMask {...props} />,\n 'ds-mask-date-time': (props) => <DateTimeInputMask {...props} />,\n 'ds-mask-dictionary': ({ ignoreCase = true, ...rest }) => (\n <DictionaryInputMask ignoreCase={ignoreCase} {...rest} />\n ),\n 'ds-mask-number': ({\n prefix = dollarSign,\n suffix = emptyString,\n includeThousandsSeparator = true,\n thousandsSeparatorSymbol = comma,\n allowDecimal = false,\n decimalSymbol = period,\n decimalLimit = 2,\n requireDecimal = false,\n allowNegative = false,\n allowLeadingZeroes = false,\n integerLimit = null,\n ...rest\n }) => (\n <NumberInputMask\n prefix={prefix}\n suffix={suffix}\n includeThousandsSeparator={includeThousandsSeparator}\n thousandsSeparatorSymbol={thousandsSeparatorSymbol}\n allowDecimal={allowDecimal}\n decimalSymbol={decimalSymbol}\n decimalLimit={decimalLimit}\n requireDecimal={requireDecimal}\n allowNegative={allowNegative}\n allowLeadingZeroes={allowLeadingZeroes}\n integerLimit={integerLimit}\n {...rest}\n />\n ),\n 'ds-mask-percent': ({\n prefix = emptyString,\n suffix = percentSign,\n includeThousandsSeparator = true,\n thousandsSeparatorSymbol = comma,\n allowDecimal = false,\n decimalSymbol = period,\n decimalLimit = 2,\n requireDecimal = false,\n allowNegative = false,\n allowLeadingZeroes = false,\n integerLimit = null,\n ...rest\n }) => (\n <NumberInputMask\n prefix={prefix}\n suffix={suffix}\n includeThousandsSeparator={includeThousandsSeparator}\n thousandsSeparatorSymbol={thousandsSeparatorSymbol}\n allowDecimal={allowDecimal}\n decimalSymbol={decimalSymbol}\n decimalLimit={decimalLimit}\n requireDecimal={requireDecimal}\n allowNegative={allowNegative}\n allowLeadingZeroes={allowLeadingZeroes}\n integerLimit={integerLimit}\n {...rest}\n />\n ),\n 'ds-mask-phone': (props) => <PhoneInputMask {...props} />,\n 'ds-mask-phone-international': (props) => (\n <PhoneInternationalInputMask {...props} />\n ),\n 'ds-mask-ssn': (props) => <SsnInputMask {...props} />,\n 'ds-mask-us-zip-code': (props) => <UsZipCodeInputMask {...props} />,\n 'ds-mask-zip-code-search': (props) => <ZipCodeSearchInputMask {...props} />,\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,aAAa;AACnB,MAAM,cAAc;AACpB,MAAM,cAAc;AACpB,MAAM,QAAQ;AACd,MAAM,SAAS;AAER,MAAM,uBAAuB;AAAA,EAClC,gBAAgB,CAAC,UAAU,qCAAC;AAAA,IAAe,GAAG;AAAA,GAAO;AAAA,EACrD,qBAAqB,CAAC,UAAU,qCAAC;AAAA,IAAmB,GAAG;AAAA,GAAO;AAAA,EAC9D,sBAAsB,CAAC,EAAE,aAAa,SAAS,WAC7C,qCAAC;AAAA,IAAoB;AAAA,IAAyB,GAAG;AAAA,GAAM;AAAA,EAEzD,kBAAkB,CAAC;AAAA,IACjB,SAAS;AAAA,IACT,SAAS;AAAA,IACT,4BAA4B;AAAA,IAC5B,2BAA2B;AAAA,IAC3B,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,qBAAqB;AAAA,IACrB,eAAe;AAAA,OACZ;AAAA,QAEH,qCAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACC,GAAG;AAAA,GACN;AAAA,EAEF,mBAAmB,CAAC;AAAA,IAClB,SAAS;AAAA,IACT,SAAS;AAAA,IACT,4BAA4B;AAAA,IAC5B,2BAA2B;AAAA,IAC3B,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,qBAAqB;AAAA,IACrB,eAAe;AAAA,OACZ;AAAA,QAEH,qCAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACC,GAAG;AAAA,GACN;AAAA,EAEF,iBAAiB,CAAC,UAAU,qCAAC;AAAA,IAAgB,GAAG;AAAA,GAAO;AAAA,EACvD,+BAA+B,CAAC,UAC9B,qCAAC;AAAA,IAA6B,GAAG;AAAA,GAAO;AAAA,EAE1C,eAAe,CAAC,UAAU,qCAAC;AAAA,IAAc,GAAG;AAAA,GAAO;AAAA,EACnD,uBAAuB,CAAC,UAAU,qCAAC;AAAA,IAAoB,GAAG;AAAA,GAAO;AAAA,EACjE,2BAA2B,CAAC,UAAU,qCAAC;AAAA,IAAwB,GAAG;AAAA,GAAO;AAC3E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,35 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
-
var __objRest = (source, exclude) => {
|
|
22
|
-
var target = {};
|
|
23
|
-
for (var prop in source)
|
|
24
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
if (source != null && __getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
2
|
import * as React from "react";
|
|
34
3
|
import React2, { useState, useCallback, useEffect } from "react";
|
|
35
4
|
import { describe } from "@elliemae/ds-utilities";
|
|
@@ -46,26 +15,17 @@ const ADDON_ICON_OPTIONS = {
|
|
|
46
15
|
VisibleView: /* @__PURE__ */ React2.createElement(VisibleView, null),
|
|
47
16
|
InvisibleHide: /* @__PURE__ */ React2.createElement(InvisibleHide, null)
|
|
48
17
|
};
|
|
49
|
-
const DSInputProtected = (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"leftAddon",
|
|
61
|
-
"rightAddon",
|
|
62
|
-
"onChange",
|
|
63
|
-
"value",
|
|
64
|
-
"readOnly",
|
|
65
|
-
"mask",
|
|
66
|
-
"type",
|
|
67
|
-
"placeholderChar"
|
|
68
|
-
]);
|
|
18
|
+
const DSInputProtected = ({
|
|
19
|
+
leftAddon,
|
|
20
|
+
rightAddon,
|
|
21
|
+
onChange,
|
|
22
|
+
value,
|
|
23
|
+
readOnly,
|
|
24
|
+
mask,
|
|
25
|
+
type,
|
|
26
|
+
placeholderChar = void 0,
|
|
27
|
+
...rest
|
|
28
|
+
}) => {
|
|
69
29
|
const left = leftAddon && ADDON_ICON_OPTIONS[leftAddon];
|
|
70
30
|
const right = rightAddon && ADDON_ICON_OPTIONS[rightAddon];
|
|
71
31
|
const [inputLocked, setLocked] = useState(leftAddon === LEFT_ADDON_OPTIONS.LockLocked);
|
|
@@ -96,14 +56,15 @@ const DSInputProtected = (_a) => {
|
|
|
96
56
|
"data-testid": "inputprotected-show-hide-button"
|
|
97
57
|
}
|
|
98
58
|
}) : void 0
|
|
99
|
-
}, /* @__PURE__ */ React2.createElement(DSInputMask,
|
|
59
|
+
}, /* @__PURE__ */ React2.createElement(DSInputMask, {
|
|
60
|
+
...rest,
|
|
100
61
|
mask,
|
|
101
62
|
placeholderChar,
|
|
102
63
|
onChange,
|
|
103
64
|
disabled: left ? inputLocked : readOnly,
|
|
104
65
|
type: right && inputHidden ? "password" : type,
|
|
105
66
|
value
|
|
106
|
-
})))
|
|
67
|
+
})));
|
|
107
68
|
};
|
|
108
69
|
DSInputProtected.propTypes = inputProtectedProps;
|
|
109
70
|
DSInputProtected.defaultProps = defaultProps;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputProtected/DSInputProtected.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable import/no-unresolved */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useState, useCallback, useEffect } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { LockUnlocked, LockLocked, VisibleView, InvisibleHide } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport { DSInputGroup } from '../InputGroup';\nimport { DSInputMask } from '../InputMask';\nimport { inputProtectedProps } from './props';\nimport { defaultProps } from './defaultProps';\nimport { LEFT_ADDON_OPTIONS, RIGHT_ADDON_OPTIONS } from './options';\n\nconst ADDON_ICON_OPTIONS = {\n LockUnlocked: <LockUnlocked />,\n LockLocked: <LockLocked />,\n VisibleView: <VisibleView />,\n InvisibleHide: <InvisibleHide />,\n};\n\nconst DSInputProtected = ({\n leftAddon,\n rightAddon,\n onChange,\n value,\n readOnly,\n mask,\n type,\n placeholderChar = undefined,\n ...rest\n}) => {\n const left = leftAddon && ADDON_ICON_OPTIONS[leftAddon];\n const right = rightAddon && ADDON_ICON_OPTIONS[rightAddon];\n const [inputLocked, setLocked] = useState(leftAddon === LEFT_ADDON_OPTIONS.LockLocked);\n const [inputHidden, setHidden] = useState(rightAddon === RIGHT_ADDON_OPTIONS.InvisibleHide);\n\n useEffect(() => {\n setLocked(leftAddon === LEFT_ADDON_OPTIONS.LockLocked);\n setHidden(rightAddon === RIGHT_ADDON_OPTIONS.InvisibleHide);\n }, [leftAddon, rightAddon]);\n\n const handleLeft = useCallback(() => {\n setLocked(!inputLocked);\n }, [inputLocked]);\n const handleRight = useCallback(() => {\n setHidden(!inputHidden);\n }, [inputHidden]);\n\n return (\n <div>\n <DSInputGroup\n leftAddon={\n left ? (\n <DSButton\n aria-label={`${inputLocked ? 'Allow' : 'Disallow'} Edition`}\n buttonType=\"secondary\"\n icon={ADDON_ICON_OPTIONS[inputLocked ? LEFT_ADDON_OPTIONS.LockLocked : LEFT_ADDON_OPTIONS.LockUnlocked]}\n onClick={handleLeft}\n />\n ) : undefined\n }\n rightAddon={\n right ? (\n <DSButton\n aria-label={`${inputHidden ? 'Show' : 'Hide'} Characters`}\n buttonType=\"secondary\"\n icon={\n ADDON_ICON_OPTIONS[inputHidden ? RIGHT_ADDON_OPTIONS.InvisibleHide : RIGHT_ADDON_OPTIONS.VisibleView]\n }\n onClick={handleRight}\n containerProps={{\n 'data-testid': 'inputprotected-show-hide-button',\n }}\n />\n ) : undefined\n }\n >\n <DSInputMask\n {...rest}\n mask={mask}\n placeholderChar={placeholderChar}\n onChange={onChange}\n disabled={left ? inputLocked : readOnly}\n type={right && inputHidden ? 'password' : type}\n value={value}\n />\n </DSInputGroup>\n </div>\n );\n};\n\nDSInputProtected.propTypes = inputProtectedProps;\nDSInputProtected.defaultProps = defaultProps;\nDSInputProtected.displayName = 'DSInputProtected';\nconst DSInputProtectedWithSchema = describe(DSInputProtected);\nDSInputProtectedWithSchema.propTypes = inputProtectedProps;\n\nexport { DSInputProtectedWithSchema, DSInputProtected };\nexport default DSInputProtected;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAAA;ACGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,qBAAqB;AAAA,EACzB,cAAc,qCAAC,kBAAa;AAAA,EAC5B,YAAY,qCAAC,gBAAW;AAAA,EACxB,aAAa,qCAAC,iBAAY;AAAA,EAC1B,eAAe,qCAAC,mBAAc;AAChC;AAEA,MAAM,mBAAmB,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,KACf;AAAA,MACC;AACJ,QAAM,OAAO,aAAa,mBAAmB;AAC7C,QAAM,QAAQ,cAAc,mBAAmB;AAC/C,QAAM,CAAC,aAAa,aAAa,SAAS,cAAc,mBAAmB,UAAU;AACrF,QAAM,CAAC,aAAa,aAAa,SAAS,eAAe,oBAAoB,aAAa;AAE1F,YAAU,MAAM;AACd,cAAU,cAAc,mBAAmB,UAAU;AACrD,cAAU,eAAe,oBAAoB,aAAa;AAAA,EAC5D,GAAG,CAAC,WAAW,UAAU,CAAC;AAE1B,QAAM,aAAa,YAAY,MAAM;AACnC,cAAU,CAAC,WAAW;AAAA,EACxB,GAAG,CAAC,WAAW,CAAC;AAChB,QAAM,cAAc,YAAY,MAAM;AACpC,cAAU,CAAC,WAAW;AAAA,EACxB,GAAG,CAAC,WAAW,CAAC;AAEhB,SACE,qCAAC,aACC,qCAAC;AAAA,IACC,WACE,OACE,qCAAC;AAAA,MACC,cAAY,GAAG,cAAc,UAAU;AAAA,MACvC,YAAW;AAAA,MACX,MAAM,mBAAmB,cAAc,mBAAmB,aAAa,mBAAmB;AAAA,MAC1F,SAAS;AAAA,KACX,IACE;AAAA,IAEN,YACE,QACE,qCAAC;AAAA,MACC,cAAY,GAAG,cAAc,SAAS;AAAA,MACtC,YAAW;AAAA,MACX,MACE,mBAAmB,cAAc,oBAAoB,gBAAgB,oBAAoB;AAAA,MAE3F,SAAS;AAAA,MACT,gBAAgB;AAAA,QACd,eAAe;AAAA,MACjB;AAAA,KACF,IACE;AAAA,KAGN,qCAAC;AAAA,IACE,GAAG;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,OAAO,cAAc;AAAA,IAC/B,MAAM,SAAS,cAAc,aAAa;AAAA,IAC1C;AAAA,GACF,CACF,CACF;AAEJ;AAEA,iBAAiB,YAAY;AAC7B,iBAAiB,eAAe;AAChC,iBAAiB,cAAc;AAC/B,MAAM,6BAA6B,SAAS,gBAAgB;AAC5D,2BAA2B,YAAY;AAGvC,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,23 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
2
|
import * as React from "react";
|
|
22
3
|
import React2, { useMemo } from "react";
|
|
23
4
|
import { describe } from "@elliemae/ds-utilities";
|
|
@@ -74,9 +55,10 @@ const DSLargeInputText = ({
|
|
|
74
55
|
const handleKeyUp = (e) => {
|
|
75
56
|
onKeyUp(e);
|
|
76
57
|
};
|
|
77
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("div",
|
|
58
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("div", {
|
|
59
|
+
...containerProps,
|
|
78
60
|
className: `${cssClassName} ${className}`
|
|
79
|
-
}
|
|
61
|
+
}, /* @__PURE__ */ React2.createElement("div", {
|
|
80
62
|
className: classNameBlock("wrapper")
|
|
81
63
|
}, /* @__PURE__ */ React2.createElement("textarea", {
|
|
82
64
|
ref: innerRef,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/LargeInputText/DSLargeInputText.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable jsx-a11y/no-autofocus, react/prop-types */\nimport React, { useMemo } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport {\n convertPropToCssClassName,\n aggregatedClasses,\n} from '@elliemae/ds-classnames';\nimport { props } from './props';\nimport { defaultProps } from './defaultProps';\n\nconst CounterArea = aggregatedClasses('div')(\n 'counter',\n 'textarea',\n ({ limitError }) => ({\n 'limit-error': limitError,\n }),\n);\n\nconst DSLargeInputText = ({\n containerProps,\n autoFocus,\n className,\n disabled,\n name,\n id,\n maxLength,\n minLength,\n placeholder,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onKeyUp,\n onKeyDown,\n onPaste,\n value,\n hasError,\n required,\n readOnly,\n resize,\n innerRef,\n ariaLabel,\n ariaAutocomplete,\n role,\n characterLimitCounter,\n rows,\n errorLimit,\n tabIndex,\n}) => {\n const limitError = useMemo(\n () =>\n characterLimitCounter < String(value).length && characterLimitCounter > 0,\n [characterLimitCounter, value],\n );\n const {\n cssClassName,\n classNameElement,\n classNameBlock,\n } = convertPropToCssClassName('form-element-textarea', 'text', {\n hasError: limitError || hasError,\n readOnly,\n disabled,\n });\n // auto size when user types\n const handleKeyUp = (e) => {\n // const { target } = e\n onKeyUp(e);\n // if (e.key !== 'Enter') return\n // target.style.cssText = 'height:auto; padding:0'\n // target.style.cssText = `height: ${target.scrollHeight}px`\n };\n return (\n <>\n <div {...containerProps} className={`${cssClassName} ${className}`}>\n <div className={classNameBlock('wrapper')}>\n <textarea\n ref={innerRef}\n aria-autocomplete={ariaAutocomplete}\n aria-label={ariaLabel}\n aria-multiline\n aria-placeholder={placeholder}\n aria-required={required}\n autoFocus={autoFocus}\n className={classNameElement('textarea')}\n data-testid=\"ds-large-input_main-component\"\n disabled={disabled}\n id={id}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={onBlur}\n onChange={onChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n onKeyUp={handleKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n role={role}\n rows={String(rows)}\n style={{\n resize,\n }}\n value={value}\n tabIndex={tabIndex}\n />\n </div>\n </div>\n {characterLimitCounter > 0 && (\n <CounterArea classProps={{ limitError }} data-testid=\"counter-area\">\n {`${\n limitError\n ? `${errorLimit} ${characterLimitCounter} characters. `\n : ''\n }${String(value).length} / ${characterLimitCounter}`}\n </CounterArea>\n )}\n </>\n );\n};\n\nDSLargeInputText.propTypes = props;\nDSLargeInputText.defaultProps = defaultProps;\nDSLargeInputText.displayName = 'DSLargeInputText';\nconst DSLargeInputTextWithSchema = describe(DSLargeInputText).description(\n 'A large input',\n);\nDSLargeInputTextWithSchema.propTypes = props;\n\nexport { DSLargeInputTextWithSchema, DSLargeInputText };\n\nexport default DSLargeInputText;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAAA;ACEA;AACA;AACA;AAAA;AAAA;AAAA;AAIA;AACA;AAEA,MAAM,cAAc,kBAAkB,KAAK,EACzC,WACA,YACA,CAAC,EAAE,iBAAkB;AAAA,EACnB,eAAe;AACjB,EACF;AAEA,MAAM,mBAAmB,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;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,aAAa,QACjB,MACE,wBAAwB,OAAO,KAAK,EAAE,UAAU,wBAAwB,GAC1E,CAAC,uBAAuB,KAAK,CAC/B;AACA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,MACE,0BAA0B,yBAAyB,QAAQ;AAAA,IAC7D,UAAU,cAAc;AAAA,IACxB;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,cAAc,CAAC,MAAM;AAEzB,YAAQ,CAAC;AAAA,EAIX;AACA,SACE,4DACE,qCAAC;AAAA,IAAK,GAAG;AAAA,IAAgB,WAAW,GAAG,gBAAgB;AAAA,KACrD,qCAAC;AAAA,IAAI,WAAW,eAAe,SAAS;AAAA,KACtC,qCAAC;AAAA,IACC,KAAK;AAAA,IACL,qBAAmB;AAAA,IACnB,cAAY;AAAA,IACZ,kBAAc;AAAA,IACd,oBAAkB;AAAA,IAClB,iBAAe;AAAA,IACf;AAAA,IACA,WAAW,iBAAiB,UAAU;AAAA,IACtC,eAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM,OAAO,IAAI;AAAA,IACjB,OAAO;AAAA,MACL;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,GACF,CACF,CACF,GACC,wBAAwB,KACvB,qCAAC;AAAA,IAAY,YAAY,EAAE,WAAW;AAAA,IAAG,eAAY;AAAA,KAClD,GACC,aACI,GAAG,cAAc,yCACjB,KACH,OAAO,KAAK,EAAE,YAAY,uBAC/B,CAEJ;AAEJ;AAEA,iBAAiB,YAAY;AAC7B,iBAAiB,eAAe;AAChC,iBAAiB,cAAc;AAC/B,MAAM,6BAA6B,SAAS,gBAAgB,EAAE,YAC5D,eACF;AACA,2BAA2B,YAAY;AAIvC,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|