@elliemae/ds-form-input-text 3.5.0-rc.7 → 3.5.1-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/dist/cjs/DSInputText.js +28 -22
- package/dist/cjs/DSInputText.js.map +2 -2
- package/dist/esm/DSInputText.js +28 -22
- package/dist/esm/DSInputText.js.map +2 -2
- package/package.json +7 -7
package/dist/cjs/DSInputText.js
CHANGED
|
@@ -29,7 +29,8 @@ __export(DSInputText_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(DSInputText_exports);
|
|
31
31
|
var React = __toESM(require("react"));
|
|
32
|
-
var
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
var import_react = require("react");
|
|
33
34
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
34
35
|
var import_ds_icon = require("@elliemae/ds-icon");
|
|
35
36
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
@@ -52,7 +53,7 @@ const DSInputText = (props) => {
|
|
|
52
53
|
onClear();
|
|
53
54
|
inputRef?.current?.focus();
|
|
54
55
|
}, [onClear]);
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.StyledInputWrapper, {
|
|
56
57
|
className,
|
|
57
58
|
cols: shouldDisplayClearButton ? ["auto", "min-content"] : ["auto"],
|
|
58
59
|
isDisabled: disabled,
|
|
@@ -60,26 +61,31 @@ const DSInputText = (props) => {
|
|
|
60
61
|
hasError,
|
|
61
62
|
hasFocus,
|
|
62
63
|
inputSize,
|
|
63
|
-
...xstyledProps
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
64
|
+
...xstyledProps,
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.StyledInput, {
|
|
67
|
+
"data-testid": import_data_test_ids.DSInputTextDataTestIds.INPUT,
|
|
68
|
+
disabled,
|
|
69
|
+
placeholder,
|
|
70
|
+
readOnly,
|
|
71
|
+
ref: (0, import_ds_utilities.mergeRefs)(innerRef, inputRef),
|
|
72
|
+
value,
|
|
73
|
+
"aria-describedby": id !== void 0 ? `${id}_feedback_message` : void 0,
|
|
74
|
+
id,
|
|
75
|
+
...handlers,
|
|
76
|
+
...otherGlobalAttributes
|
|
77
|
+
}),
|
|
78
|
+
shouldDisplayClearButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.StyledClearButton, {
|
|
79
|
+
"aria-label": "Clear input value",
|
|
80
|
+
buttonType: "icon",
|
|
81
|
+
"data-testid": import_data_test_ids.DSInputTextDataTestIds.CLEAR_BUTTON,
|
|
82
|
+
onClick: handleClear,
|
|
83
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.CloseMedium, {
|
|
84
|
+
color: import_ds_icon.DSIconColors.PRIMARY
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
]
|
|
88
|
+
});
|
|
83
89
|
};
|
|
84
90
|
DSInputText.propTypes = import_react_desc_prop_types.DSInputTextPropTypes;
|
|
85
91
|
DSInputText.displayName = "DSInputText";
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSInputText.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { useCallback, useRef } from 'react';\nimport { CloseMedium } from '@elliemae/ds-icons';\nimport { DSIconColors } from '@elliemae/ds-icon';\nimport { describe, mergeRefs } from '@elliemae/ds-utilities';\nimport { useInputText } from './config/useInputText';\nimport { DSInputTextDataTestIds } from './exported-related/data-test-ids';\nimport { DSInputTextPropTypes, DSInputTextT } from './react-desc-prop-types';\nimport { StyledClearButton, StyledInput, StyledInputWrapper } from './styled/components';\n\nexport const DSInputText: React.ComponentType<DSInputTextT.Props> = (props) => {\n const {\n globalAttributes: { className, id, ...otherGlobalAttributes },\n hasFocus,\n handlers,\n propsWithDefault,\n xstyledProps,\n } = useInputText(props);\n\n const { clearable, disabled, hasError, innerRef, placeholder, readOnly, inputSize, onClear, value } =\n propsWithDefault;\n\n const inputRef = useRef<HTMLInputElement>(null);\n const shouldDisplayClearButton = clearable && value !== '';\n\n const handleClear = useCallback(() => {\n onClear();\n inputRef?.current?.focus();\n }, [onClear]);\n\n return (\n <StyledInputWrapper\n className={className}\n cols={shouldDisplayClearButton ? ['auto', 'min-content'] : ['auto']}\n isDisabled={disabled}\n isReadOnly={readOnly}\n hasError={hasError}\n hasFocus={hasFocus}\n inputSize={inputSize}\n {...xstyledProps}\n >\n <StyledInput\n data-testid={DSInputTextDataTestIds.INPUT}\n disabled={disabled}\n placeholder={placeholder}\n readOnly={readOnly}\n ref={mergeRefs(innerRef, inputRef)}\n value={value}\n aria-describedby={id !== undefined ? `${id}_feedback_message` : undefined}\n id={id}\n {...handlers}\n {...otherGlobalAttributes}\n />\n {shouldDisplayClearButton && (\n <StyledClearButton\n aria-label=\"Clear input value\"\n buttonType=\"icon\"\n data-testid={DSInputTextDataTestIds.CLEAR_BUTTON}\n onClick={handleClear}\n >\n <CloseMedium color={DSIconColors.PRIMARY} />\n </StyledClearButton>\n )}\n </StyledInputWrapper>\n );\n};\n\nDSInputText.propTypes = DSInputTextPropTypes;\nDSInputText.displayName = 'DSInputText';\nexport const DSInputTextWithSchema = describe(DSInputText);\nDSInputTextWithSchema.propTypes = DSInputTextPropTypes;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAv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AAAA,IACC;AAAA,IACA,MAAM,2BAA2B,CAAC,QAAQ,aAAa,IAAI,CAAC,MAAM;AAAA,IAClE,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACC,GAAG;AAAA,IAEJ;AAAA,kDAAC;AAAA,QACC,eAAa,4CAAuB;AAAA,QACpC;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAK,+BAAU,UAAU,QAAQ;AAAA,QACjC;AAAA,QACA,oBAAkB,OAAO,SAAY,GAAG,wBAAwB;AAAA,QAChE;AAAA,QACC,GAAG;AAAA,QACH,GAAG;AAAA,OACN;AAAA,MACC,4BACC,4CAAC;AAAA,QACC,cAAW;AAAA,QACX,YAAW;AAAA,QACX,eAAa,4CAAuB;AAAA,QACpC,SAAS;AAAA,QAET,sDAAC;AAAA,UAAY,OAAO,4BAAa;AAAA,SAAS;AAAA,OAC5C;AAAA;AAAA,GAEJ;AAEJ;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AACnB,MAAM,4BAAwB,8BAAS,WAAW;AACzD,sBAAsB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/esm/DSInputText.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useRef } from "react";
|
|
3
4
|
import { CloseMedium } from "@elliemae/ds-icons";
|
|
4
5
|
import { DSIconColors } from "@elliemae/ds-icon";
|
|
5
6
|
import { describe, mergeRefs } from "@elliemae/ds-utilities";
|
|
@@ -22,7 +23,7 @@ const DSInputText = (props) => {
|
|
|
22
23
|
onClear();
|
|
23
24
|
inputRef?.current?.focus();
|
|
24
25
|
}, [onClear]);
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ jsxs(StyledInputWrapper, {
|
|
26
27
|
className,
|
|
27
28
|
cols: shouldDisplayClearButton ? ["auto", "min-content"] : ["auto"],
|
|
28
29
|
isDisabled: disabled,
|
|
@@ -30,26 +31,31 @@ const DSInputText = (props) => {
|
|
|
30
31
|
hasError,
|
|
31
32
|
hasFocus,
|
|
32
33
|
inputSize,
|
|
33
|
-
...xstyledProps
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
34
|
+
...xstyledProps,
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsx(StyledInput, {
|
|
37
|
+
"data-testid": DSInputTextDataTestIds.INPUT,
|
|
38
|
+
disabled,
|
|
39
|
+
placeholder,
|
|
40
|
+
readOnly,
|
|
41
|
+
ref: mergeRefs(innerRef, inputRef),
|
|
42
|
+
value,
|
|
43
|
+
"aria-describedby": id !== void 0 ? `${id}_feedback_message` : void 0,
|
|
44
|
+
id,
|
|
45
|
+
...handlers,
|
|
46
|
+
...otherGlobalAttributes
|
|
47
|
+
}),
|
|
48
|
+
shouldDisplayClearButton && /* @__PURE__ */ jsx(StyledClearButton, {
|
|
49
|
+
"aria-label": "Clear input value",
|
|
50
|
+
buttonType: "icon",
|
|
51
|
+
"data-testid": DSInputTextDataTestIds.CLEAR_BUTTON,
|
|
52
|
+
onClick: handleClear,
|
|
53
|
+
children: /* @__PURE__ */ jsx(CloseMedium, {
|
|
54
|
+
color: DSIconColors.PRIMARY
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
});
|
|
53
59
|
};
|
|
54
60
|
DSInputText.propTypes = DSInputTextPropTypes;
|
|
55
61
|
DSInputText.displayName = "DSInputText";
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSInputText.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useRef } from 'react';\nimport { CloseMedium } from '@elliemae/ds-icons';\nimport { DSIconColors } from '@elliemae/ds-icon';\nimport { describe, mergeRefs } from '@elliemae/ds-utilities';\nimport { useInputText } from './config/useInputText';\nimport { DSInputTextDataTestIds } from './exported-related/data-test-ids';\nimport { DSInputTextPropTypes, DSInputTextT } from './react-desc-prop-types';\nimport { StyledClearButton, StyledInput, StyledInputWrapper } from './styled/components';\n\nexport const DSInputText: React.ComponentType<DSInputTextT.Props> = (props) => {\n const {\n globalAttributes: { className, id, ...otherGlobalAttributes },\n hasFocus,\n handlers,\n propsWithDefault,\n xstyledProps,\n } = useInputText(props);\n\n const { clearable, disabled, hasError, innerRef, placeholder, readOnly, inputSize, onClear, value } =\n propsWithDefault;\n\n const inputRef = useRef<HTMLInputElement>(null);\n const shouldDisplayClearButton = clearable && value !== '';\n\n const handleClear = useCallback(() => {\n onClear();\n inputRef?.current?.focus();\n }, [onClear]);\n\n return (\n <StyledInputWrapper\n className={className}\n cols={shouldDisplayClearButton ? ['auto', 'min-content'] : ['auto']}\n isDisabled={disabled}\n isReadOnly={readOnly}\n hasError={hasError}\n hasFocus={hasFocus}\n inputSize={inputSize}\n {...xstyledProps}\n >\n <StyledInput\n data-testid={DSInputTextDataTestIds.INPUT}\n disabled={disabled}\n placeholder={placeholder}\n readOnly={readOnly}\n ref={mergeRefs(innerRef, inputRef)}\n value={value}\n aria-describedby={id !== undefined ? `${id}_feedback_message` : undefined}\n id={id}\n {...handlers}\n {...otherGlobalAttributes}\n />\n {shouldDisplayClearButton && (\n <StyledClearButton\n aria-label=\"Clear input value\"\n buttonType=\"icon\"\n data-testid={DSInputTextDataTestIds.CLEAR_BUTTON}\n onClick={handleClear}\n >\n <CloseMedium color={DSIconColors.PRIMARY} />\n </StyledClearButton>\n )}\n </StyledInputWrapper>\n );\n};\n\nDSInputText.propTypes = DSInputTextPropTypes;\nDSInputText.displayName = 'DSInputText';\nexport const DSInputTextWithSchema = describe(DSInputText);\nDSInputTextWithSchema.propTypes = DSInputTextPropTypes;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,SAAgB,aAAa,cAAc;AAC3C,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,UAAU,iBAAiB;AACpC,SAAS,oBAAoB;AAC7B,SAAS,8BAA8B;AACvC,SAAS,4BAA0C;AACnD,SAAS,mBAAmB,aAAa,0BAA0B;AAE5D,MAAM,cAAuD,CAAC,UAAU;AAC7E,QAAM;AAAA,IACJ,kBAAkB,EAAE,WAAW,OAAO,sBAAsB;AAAA,IAC5D;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,aAAa,KAAK;AAEtB,QAAM,EAAE,WAAW,UAAU,UAAU,UAAU,aAAa,UAAU,WAAW,SAAS,MAAM,IAChG;AAEF,QAAM,WAAW,OAAyB,IAAI;AAC9C,QAAM,2BAA2B,aAAa,UAAU;AAExD,QAAM,cAAc,YAAY,MAAM;AACpC,YAAQ;AACR,cAAU,SAAS,MAAM;AAAA,EAC3B,GAAG,CAAC,OAAO,CAAC;AAEZ,SACE,qBAAC;AAAA,IACC;AAAA,IACA,MAAM,2BAA2B,CAAC,QAAQ,aAAa,IAAI,CAAC,MAAM;AAAA,IAClE,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACC,GAAG;AAAA,IAEJ;AAAA,0BAAC;AAAA,QACC,eAAa,uBAAuB;AAAA,QACpC;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,UAAU,UAAU,QAAQ;AAAA,QACjC;AAAA,QACA,oBAAkB,OAAO,SAAY,GAAG,wBAAwB;AAAA,QAChE;AAAA,QACC,GAAG;AAAA,QACH,GAAG;AAAA,OACN;AAAA,MACC,4BACC,oBAAC;AAAA,QACC,cAAW;AAAA,QACX,YAAW;AAAA,QACX,eAAa,uBAAuB;AAAA,QACpC,SAAS;AAAA,QAET,8BAAC;AAAA,UAAY,OAAO,aAAa;AAAA,SAAS;AAAA,OAC5C;AAAA;AAAA,GAEJ;AAEJ;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AACnB,MAAM,wBAAwB,SAAS,WAAW;AACzD,sBAAsB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-form-input-text",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Controlled Form Input Text",
|
|
6
6
|
"files": [
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"indent": 4
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@elliemae/ds-button": "3.5.
|
|
39
|
-
"@elliemae/ds-grid": "3.5.
|
|
40
|
-
"@elliemae/ds-icon": "3.5.
|
|
41
|
-
"@elliemae/ds-icons": "3.5.
|
|
42
|
-
"@elliemae/ds-system": "3.5.
|
|
43
|
-
"@elliemae/ds-utilities": "3.5.
|
|
38
|
+
"@elliemae/ds-button": "3.5.1-next.0",
|
|
39
|
+
"@elliemae/ds-grid": "3.5.1-next.0",
|
|
40
|
+
"@elliemae/ds-icon": "3.5.1-next.0",
|
|
41
|
+
"@elliemae/ds-icons": "3.5.1-next.0",
|
|
42
|
+
"@elliemae/ds-system": "3.5.1-next.0",
|
|
43
|
+
"@elliemae/ds-utilities": "3.5.1-next.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@elliemae/pui-theme": "~2.6.0",
|