@7shifts/sous-chef 1.5.6 → 1.5.7
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/index.modern.js
CHANGED
|
@@ -1648,6 +1648,8 @@ var useFieldControllers = function useFieldControllers(_ref) {
|
|
|
1648
1648
|
value = _ref.value,
|
|
1649
1649
|
_onChange = _ref.onChange,
|
|
1650
1650
|
_onBlur = _ref.onBlur,
|
|
1651
|
+
_onFocus = _ref.onFocus,
|
|
1652
|
+
_onKeyDown = _ref.onKeyDown,
|
|
1651
1653
|
error = _ref.error,
|
|
1652
1654
|
_ref$type = _ref.type,
|
|
1653
1655
|
type = _ref$type === void 0 ? 'text' : _ref$type;
|
|
@@ -1668,6 +1670,12 @@ var useFieldControllers = function useFieldControllers(_ref) {
|
|
|
1668
1670
|
},
|
|
1669
1671
|
onBlur: function onBlur(e) {
|
|
1670
1672
|
return _onBlur && _onBlur(e.target.value);
|
|
1673
|
+
},
|
|
1674
|
+
onFocus: function onFocus(e) {
|
|
1675
|
+
return _onFocus && _onFocus(e.target.value);
|
|
1676
|
+
},
|
|
1677
|
+
onKeyDown: function onKeyDown(e) {
|
|
1678
|
+
return _onKeyDown && _onKeyDown(e.key);
|
|
1671
1679
|
}
|
|
1672
1680
|
};
|
|
1673
1681
|
var formikState = getFormikState(name, formik);
|
|
@@ -2076,58 +2084,66 @@ var styles$k = {"text-field":"_20YOA","text-field--invalid":"_3kUSh","text-field
|
|
|
2076
2084
|
var TextField = function TextField(_ref, ref) {
|
|
2077
2085
|
var _classnames;
|
|
2078
2086
|
|
|
2079
|
-
var
|
|
2080
|
-
|
|
2081
|
-
value = _ref.value,
|
|
2082
|
-
onChange = _ref.onChange,
|
|
2083
|
-
onBlur = _ref.onBlur,
|
|
2084
|
-
label = _ref.label,
|
|
2087
|
+
var autoComplete = _ref.autoComplete,
|
|
2088
|
+
autoFocus = _ref.autoFocus,
|
|
2085
2089
|
caption = _ref.caption,
|
|
2090
|
+
defaultValue = _ref.defaultValue,
|
|
2091
|
+
disabled = _ref.disabled,
|
|
2086
2092
|
error = _ref.error,
|
|
2093
|
+
inputId = _ref.id,
|
|
2094
|
+
label = _ref.label,
|
|
2095
|
+
maxLength = _ref.maxLength,
|
|
2096
|
+
name = _ref.name,
|
|
2097
|
+
onBlur = _ref.onBlur,
|
|
2098
|
+
onChange = _ref.onChange,
|
|
2099
|
+
onFocus = _ref.onFocus,
|
|
2100
|
+
onKeyDown = _ref.onKeyDown,
|
|
2087
2101
|
placeholder = _ref.placeholder,
|
|
2088
|
-
disabled = _ref.disabled,
|
|
2089
2102
|
prefix = _ref.prefix,
|
|
2090
2103
|
suffix = _ref.suffix,
|
|
2091
|
-
|
|
2092
|
-
autoFocus = _ref.autoFocus,
|
|
2093
|
-
autoComplete = _ref.autoComplete;
|
|
2104
|
+
value = _ref.value;
|
|
2094
2105
|
var controllers = useFieldControllers({
|
|
2095
|
-
|
|
2106
|
+
error: error,
|
|
2096
2107
|
id: inputId,
|
|
2097
|
-
|
|
2108
|
+
name: name,
|
|
2098
2109
|
onChange: onChange,
|
|
2099
2110
|
onBlur: onBlur,
|
|
2100
|
-
|
|
2111
|
+
onFocus: onFocus,
|
|
2112
|
+
onKeyDown: onKeyDown,
|
|
2113
|
+
value: value
|
|
2101
2114
|
});
|
|
2102
2115
|
var hasError = !!controllers.error;
|
|
2103
2116
|
var fieldProps = {
|
|
2104
|
-
name: name,
|
|
2105
|
-
id: controllers.id,
|
|
2106
|
-
label: label,
|
|
2107
2117
|
caption: caption,
|
|
2108
|
-
error: controllers.error
|
|
2118
|
+
error: controllers.error,
|
|
2119
|
+
label: label,
|
|
2120
|
+
id: controllers.id,
|
|
2121
|
+
name: name
|
|
2109
2122
|
};
|
|
2110
2123
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
|
|
2111
2124
|
prefix: prefix,
|
|
2112
2125
|
suffix: suffix
|
|
2113
2126
|
}, React__default.createElement("input", {
|
|
2114
|
-
name: name,
|
|
2115
|
-
id: controllers.id,
|
|
2116
|
-
className: classnames(styles$k['text-field'], (_classnames = {}, _classnames[styles$k['text-field--invalid']] = hasError, _classnames)),
|
|
2117
|
-
type: "text",
|
|
2118
|
-
"data-testid": "text-field-" + name,
|
|
2119
2127
|
"aria-describedby": hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
2120
2128
|
"aria-invalid": hasError,
|
|
2129
|
+
autoComplete: autoComplete,
|
|
2130
|
+
autoFocus: autoFocus,
|
|
2131
|
+
className: classnames(styles$k['text-field'], (_classnames = {}, _classnames[styles$k['text-field--invalid']] = hasError, _classnames)),
|
|
2132
|
+
"data-testid": "text-field-" + name,
|
|
2121
2133
|
disabled: disabled,
|
|
2122
|
-
placeholder: placeholder,
|
|
2123
2134
|
defaultValue: defaultValue,
|
|
2124
|
-
|
|
2125
|
-
|
|
2135
|
+
id: controllers.id,
|
|
2136
|
+
maxLength: maxLength,
|
|
2137
|
+
name: name,
|
|
2126
2138
|
onBlur: controllers.onBlur,
|
|
2127
|
-
|
|
2139
|
+
onChange: controllers.onChange,
|
|
2140
|
+
onFocus: controllers.onFocus,
|
|
2141
|
+
onKeyDown: controllers.onKeyDown,
|
|
2142
|
+
placeholder: placeholder,
|
|
2128
2143
|
ref: ref,
|
|
2129
|
-
|
|
2130
|
-
|
|
2144
|
+
size: 1,
|
|
2145
|
+
type: "text",
|
|
2146
|
+
value: controllers.value
|
|
2131
2147
|
})));
|
|
2132
2148
|
};
|
|
2133
2149
|
|