@terraware/web-components 2.0.45 → 2.0.46
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.
|
@@ -18,10 +18,11 @@ export interface Props {
|
|
|
18
18
|
hideClearIcon?: boolean;
|
|
19
19
|
isEqual?: (option: ValueType, value: ValueType) => void;
|
|
20
20
|
placeholder?: string;
|
|
21
|
+
errorText?: string;
|
|
21
22
|
}
|
|
22
23
|
export declare type DropdownItem = {
|
|
23
24
|
label: string;
|
|
24
25
|
value: string;
|
|
25
26
|
};
|
|
26
|
-
export default function Autocomplete({ id, label, values, onChange, selected, freeSolo, disabled, className, hideClearIcon, isEqual, placeholder, }: Props): JSX.Element;
|
|
27
|
+
export default function Autocomplete({ id, label, values, onChange, selected, freeSolo, disabled, className, hideClearIcon, isEqual, placeholder, errorText, }: Props): JSX.Element;
|
|
27
28
|
//# sourceMappingURL=Autocomplete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":";AAGA,OAAO,uBAAuB,CAAC;AAC/B,OAAO,eAAe,CAAC;AAEvB,oBAAY,MAAM,GAAG;IACnB,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAExC,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACjD,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAA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R,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,aAAa,EACb,OAAO,EACP,WAAW,EACX,SAAS,GACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAwErB"}
|
|
@@ -28,7 +28,8 @@ function Autocomplete(_ref) {
|
|
|
28
28
|
className = _ref.className,
|
|
29
29
|
hideClearIcon = _ref.hideClearIcon,
|
|
30
30
|
isEqual = _ref.isEqual,
|
|
31
|
-
placeholder = _ref.placeholder
|
|
31
|
+
placeholder = _ref.placeholder,
|
|
32
|
+
errorText = _ref.errorText;
|
|
32
33
|
|
|
33
34
|
var onChangeHandler = function onChangeHandler(event, value) {
|
|
34
35
|
if (event) {
|
|
@@ -50,7 +51,14 @@ function Autocomplete(_ref) {
|
|
|
50
51
|
variant: "outlined",
|
|
51
52
|
size: "small",
|
|
52
53
|
placeholder: placeholder
|
|
53
|
-
}))
|
|
54
|
+
})), errorText && /*#__PURE__*/_react.default.createElement("div", {
|
|
55
|
+
className: "textfield-label-container"
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
57
|
+
name: "error",
|
|
58
|
+
className: "textfield-error-text--icon"
|
|
59
|
+
}), /*#__PURE__*/_react.default.createElement("label", {
|
|
60
|
+
className: "textfield-error-text"
|
|
61
|
+
}, errorText)));
|
|
54
62
|
};
|
|
55
63
|
|
|
56
64
|
var optionalArgs = {};
|
|
@@ -86,4 +86,28 @@
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
+
|
|
90
|
+
.textfield-label-container {
|
|
91
|
+
display: flex;
|
|
92
|
+
width: 100%;
|
|
93
|
+
margin-top: $tw-spc-base-xx-small;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.textfield-error-text {
|
|
97
|
+
font-family: $tw-fnt-frm-fld-error-text-font-family;
|
|
98
|
+
font-size: $tw-fnt-frm-fld-error-text-font-size;
|
|
99
|
+
font-weight: $tw-fnt-frm-fld-error-text-font-weight;
|
|
100
|
+
line-height: $tw-fnt-frm-fld-error-text-line-height;
|
|
101
|
+
color: $tw-clr-txt-danger;
|
|
102
|
+
display: block;
|
|
103
|
+
width: 100%;
|
|
104
|
+
max-width: 100%;
|
|
105
|
+
|
|
106
|
+
&--icon {
|
|
107
|
+
fill: $tw-clr-icn-danger;
|
|
108
|
+
width: $tw-fnt-frm-fld-error-text-line-height;
|
|
109
|
+
height: $tw-fnt-frm-fld-error-text-line-height;
|
|
110
|
+
margin-right: $tw-spc-base-x-small;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
89
113
|
}
|