@helpdice/ui 2.3.2 → 2.3.3
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/auto-complete/index.js +9 -2
- package/dist/avatar/index.js +5 -0
- package/dist/index.js +14 -2
- package/dist/input/index.js +9 -2
- package/dist/input/input-props.d.ts +1 -0
- package/dist/table/index.js +9 -2
- package/dist/user/index.js +5 -0
- package/esm/avatar/avatar.js +5 -0
- package/esm/input/input-field.js +9 -2
- package/esm/input/input-props.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1038,7 +1038,7 @@ var withScale = function withScale(Render) {
|
|
|
1038
1038
|
return ScaleFC;
|
|
1039
1039
|
};
|
|
1040
1040
|
|
|
1041
|
-
var _excluded$5 = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1041
|
+
var _excluded$5 = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "onEnter", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1042
1042
|
var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
1043
1043
|
return _objectSpread2(_objectSpread2({}, event), {}, {
|
|
1044
1044
|
target: el,
|
|
@@ -1074,6 +1074,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1074
1074
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1075
1075
|
onBlur = _ref.onBlur,
|
|
1076
1076
|
onFocus = _ref.onFocus,
|
|
1077
|
+
onEnter = _ref.onEnter,
|
|
1077
1078
|
_ref$autoComplete = _ref.autoComplete,
|
|
1078
1079
|
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
1079
1080
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -1153,6 +1154,11 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1153
1154
|
setSelfValue(value);
|
|
1154
1155
|
}
|
|
1155
1156
|
});
|
|
1157
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
1158
|
+
if (e.key === "Enter") {
|
|
1159
|
+
onEnter && onEnter(e);
|
|
1160
|
+
}
|
|
1161
|
+
};
|
|
1156
1162
|
var controlledValue = isControlledComponent ? {
|
|
1157
1163
|
value: selfValue
|
|
1158
1164
|
} : {
|
|
@@ -1180,7 +1186,8 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1180
1186
|
onFocus: focusHandler,
|
|
1181
1187
|
onBlur: blurHandler,
|
|
1182
1188
|
onChange: changeHandler,
|
|
1183
|
-
autoComplete: autoComplete
|
|
1189
|
+
autoComplete: autoComplete,
|
|
1190
|
+
onKeyDown: handleKeyDown
|
|
1184
1191
|
}, inputProps, {
|
|
1185
1192
|
className: _JSXStyle.dynamic([["2582554466", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || theme.useClasses({
|
|
1186
1193
|
disabled: disabled
|
package/dist/avatar/index.js
CHANGED
|
@@ -857,6 +857,11 @@ var AvatarComponent = function AvatarComponent(_ref) {
|
|
|
857
857
|
src: src,
|
|
858
858
|
draggable: false
|
|
859
859
|
}, props, {
|
|
860
|
+
onError: function onError(e) {
|
|
861
|
+
var target = e.currentTarget;
|
|
862
|
+
target.onerror = null; // prevent loop
|
|
863
|
+
target.src = "https://helpdice.com/avatar.webp";
|
|
864
|
+
},
|
|
860
865
|
className: _JSXStyle.dynamic([["2295275975", [theme$1.palette.accents_2, radius, theme$1.palette.background, SCALES.width(1.75) || SCALES.height(1.75), SCALES.height(1.75) || SCALES.width(1.75), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), marginLeft, radius, SCALES.font(1)]]]) + " " + (props && props.className != null && props.className || "avatar-img")
|
|
861
866
|
})), showText && /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
862
867
|
className: _JSXStyle.dynamic([["2295275975", [theme$1.palette.accents_2, radius, theme$1.palette.background, SCALES.width(1.75) || SCALES.height(1.75), SCALES.height(1.75) || SCALES.width(1.75), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), marginLeft, radius, SCALES.font(1)]]]) + " " + (props && props.className != null && props.className || "avatar-text")
|
package/dist/index.js
CHANGED
|
@@ -1368,7 +1368,7 @@ var withScale = function withScale(Render) {
|
|
|
1368
1368
|
return ScaleFC;
|
|
1369
1369
|
};
|
|
1370
1370
|
|
|
1371
|
-
var _excluded$1o = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1371
|
+
var _excluded$1o = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "onEnter", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1372
1372
|
var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
1373
1373
|
return _objectSpread2(_objectSpread2({}, event), {}, {
|
|
1374
1374
|
target: el,
|
|
@@ -1404,6 +1404,7 @@ var InputComponent = /*#__PURE__*/React$1.forwardRef(function (_ref, ref) {
|
|
|
1404
1404
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1405
1405
|
onBlur = _ref.onBlur,
|
|
1406
1406
|
onFocus = _ref.onFocus,
|
|
1407
|
+
onEnter = _ref.onEnter,
|
|
1407
1408
|
_ref$autoComplete = _ref.autoComplete,
|
|
1408
1409
|
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
1409
1410
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -1483,6 +1484,11 @@ var InputComponent = /*#__PURE__*/React$1.forwardRef(function (_ref, ref) {
|
|
|
1483
1484
|
setSelfValue(value);
|
|
1484
1485
|
}
|
|
1485
1486
|
});
|
|
1487
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
1488
|
+
if (e.key === "Enter") {
|
|
1489
|
+
onEnter && onEnter(e);
|
|
1490
|
+
}
|
|
1491
|
+
};
|
|
1486
1492
|
var controlledValue = isControlledComponent ? {
|
|
1487
1493
|
value: selfValue
|
|
1488
1494
|
} : {
|
|
@@ -1510,7 +1516,8 @@ var InputComponent = /*#__PURE__*/React$1.forwardRef(function (_ref, ref) {
|
|
|
1510
1516
|
onFocus: focusHandler,
|
|
1511
1517
|
onBlur: blurHandler,
|
|
1512
1518
|
onChange: changeHandler,
|
|
1513
|
-
autoComplete: autoComplete
|
|
1519
|
+
autoComplete: autoComplete,
|
|
1520
|
+
onKeyDown: handleKeyDown
|
|
1514
1521
|
}, inputProps, {
|
|
1515
1522
|
className: _JSXStyle.dynamic([["2582554466", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || theme.useClasses({
|
|
1516
1523
|
disabled: disabled
|
|
@@ -4263,6 +4270,11 @@ var AvatarComponent = function AvatarComponent(_ref) {
|
|
|
4263
4270
|
src: src,
|
|
4264
4271
|
draggable: false
|
|
4265
4272
|
}, props, {
|
|
4273
|
+
onError: function onError(e) {
|
|
4274
|
+
var target = e.currentTarget;
|
|
4275
|
+
target.onerror = null; // prevent loop
|
|
4276
|
+
target.src = "https://helpdice.com/avatar.webp";
|
|
4277
|
+
},
|
|
4266
4278
|
className: _JSXStyle.dynamic([["2295275975", [theme$1.palette.accents_2, radius, theme$1.palette.background, SCALES.width(1.75) || SCALES.height(1.75), SCALES.height(1.75) || SCALES.width(1.75), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), marginLeft, radius, SCALES.font(1)]]]) + " " + (props && props.className != null && props.className || "avatar-img")
|
|
4267
4279
|
})), showText && /*#__PURE__*/React$1.createElement("span", _extends({}, props, {
|
|
4268
4280
|
className: _JSXStyle.dynamic([["2295275975", [theme$1.palette.accents_2, radius, theme$1.palette.background, SCALES.width(1.75) || SCALES.height(1.75), SCALES.height(1.75) || SCALES.width(1.75), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), marginLeft, radius, SCALES.font(1)]]]) + " " + (props && props.className != null && props.className || "avatar-text")
|
package/dist/input/index.js
CHANGED
|
@@ -1024,7 +1024,7 @@ var withScale = function withScale(Render) {
|
|
|
1024
1024
|
return ScaleFC;
|
|
1025
1025
|
};
|
|
1026
1026
|
|
|
1027
|
-
var _excluded$3 = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1027
|
+
var _excluded$3 = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "onEnter", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1028
1028
|
var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
1029
1029
|
return _objectSpread2(_objectSpread2({}, event), {}, {
|
|
1030
1030
|
target: el,
|
|
@@ -1060,6 +1060,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1060
1060
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1061
1061
|
onBlur = _ref.onBlur,
|
|
1062
1062
|
onFocus = _ref.onFocus,
|
|
1063
|
+
onEnter = _ref.onEnter,
|
|
1063
1064
|
_ref$autoComplete = _ref.autoComplete,
|
|
1064
1065
|
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
1065
1066
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -1139,6 +1140,11 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1139
1140
|
setSelfValue(value);
|
|
1140
1141
|
}
|
|
1141
1142
|
});
|
|
1143
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
1144
|
+
if (e.key === "Enter") {
|
|
1145
|
+
onEnter && onEnter(e);
|
|
1146
|
+
}
|
|
1147
|
+
};
|
|
1142
1148
|
var controlledValue = isControlledComponent ? {
|
|
1143
1149
|
value: selfValue
|
|
1144
1150
|
} : {
|
|
@@ -1166,7 +1172,8 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1166
1172
|
onFocus: focusHandler,
|
|
1167
1173
|
onBlur: blurHandler,
|
|
1168
1174
|
onChange: changeHandler,
|
|
1169
|
-
autoComplete: autoComplete
|
|
1175
|
+
autoComplete: autoComplete,
|
|
1176
|
+
onKeyDown: handleKeyDown
|
|
1170
1177
|
}, inputProps, {
|
|
1171
1178
|
className: _JSXStyle.dynamic([["2582554466", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || theme.useClasses({
|
|
1172
1179
|
disabled: disabled
|
|
@@ -24,6 +24,7 @@ export interface Props {
|
|
|
24
24
|
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
25
25
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
26
26
|
onIconClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
27
|
+
onEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
27
28
|
autoComplete?: string;
|
|
28
29
|
crossOrigin?: any;
|
|
29
30
|
onPointerEnterCapture?: any;
|
package/dist/table/index.js
CHANGED
|
@@ -1073,7 +1073,7 @@ var withScale = function withScale(Render) {
|
|
|
1073
1073
|
return ScaleFC;
|
|
1074
1074
|
};
|
|
1075
1075
|
|
|
1076
|
-
var _excluded$i = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1076
|
+
var _excluded$i = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "onEnter", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1077
1077
|
var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
1078
1078
|
return _objectSpread2(_objectSpread2({}, event), {}, {
|
|
1079
1079
|
target: el,
|
|
@@ -1109,6 +1109,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1109
1109
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1110
1110
|
onBlur = _ref.onBlur,
|
|
1111
1111
|
onFocus = _ref.onFocus,
|
|
1112
|
+
onEnter = _ref.onEnter,
|
|
1112
1113
|
_ref$autoComplete = _ref.autoComplete,
|
|
1113
1114
|
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
1114
1115
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -1188,6 +1189,11 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1188
1189
|
setSelfValue(value);
|
|
1189
1190
|
}
|
|
1190
1191
|
});
|
|
1192
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
1193
|
+
if (e.key === "Enter") {
|
|
1194
|
+
onEnter && onEnter(e);
|
|
1195
|
+
}
|
|
1196
|
+
};
|
|
1191
1197
|
var controlledValue = isControlledComponent ? {
|
|
1192
1198
|
value: selfValue
|
|
1193
1199
|
} : {
|
|
@@ -1215,7 +1221,8 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1215
1221
|
onFocus: focusHandler,
|
|
1216
1222
|
onBlur: blurHandler,
|
|
1217
1223
|
onChange: changeHandler,
|
|
1218
|
-
autoComplete: autoComplete
|
|
1224
|
+
autoComplete: autoComplete,
|
|
1225
|
+
onKeyDown: handleKeyDown
|
|
1219
1226
|
}, inputProps, {
|
|
1220
1227
|
className: _JSXStyle.dynamic([["2582554466", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || theme.useClasses({
|
|
1221
1228
|
disabled: disabled
|
package/dist/user/index.js
CHANGED
|
@@ -890,6 +890,11 @@ var AvatarComponent = function AvatarComponent(_ref) {
|
|
|
890
890
|
src: src,
|
|
891
891
|
draggable: false
|
|
892
892
|
}, props, {
|
|
893
|
+
onError: function onError(e) {
|
|
894
|
+
var target = e.currentTarget;
|
|
895
|
+
target.onerror = null; // prevent loop
|
|
896
|
+
target.src = "https://helpdice.com/avatar.webp";
|
|
897
|
+
},
|
|
893
898
|
className: _JSXStyle.dynamic([["2295275975", [theme$1.palette.accents_2, radius, theme$1.palette.background, SCALES.width(1.75) || SCALES.height(1.75), SCALES.height(1.75) || SCALES.width(1.75), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), marginLeft, radius, SCALES.font(1)]]]) + " " + (props && props.className != null && props.className || "avatar-img")
|
|
894
899
|
})), showText && /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
895
900
|
className: _JSXStyle.dynamic([["2295275975", [theme$1.palette.accents_2, radius, theme$1.palette.background, SCALES.width(1.75) || SCALES.height(1.75), SCALES.height(1.75) || SCALES.width(1.75), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), marginLeft, radius, SCALES.font(1)]]]) + " " + (props && props.className != null && props.className || "avatar-text")
|
package/esm/avatar/avatar.js
CHANGED
|
@@ -43,6 +43,11 @@ var AvatarComponent = function AvatarComponent(_ref) {
|
|
|
43
43
|
src: src,
|
|
44
44
|
draggable: false
|
|
45
45
|
}, props, {
|
|
46
|
+
onError: function onError(e) {
|
|
47
|
+
var target = e.currentTarget;
|
|
48
|
+
target.onerror = null; // prevent loop
|
|
49
|
+
target.src = "https://helpdice.com/avatar.webp";
|
|
50
|
+
},
|
|
46
51
|
className: _JSXStyle.dynamic([["2295275975", [theme.palette.accents_2, radius, theme.palette.background, SCALES.width(1.75) || SCALES.height(1.75), SCALES.height(1.75) || SCALES.width(1.75), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), marginLeft, radius, SCALES.font(1)]]]) + " " + (props && props.className != null && props.className || "avatar-img")
|
|
47
52
|
})), showText && /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
48
53
|
className: _JSXStyle.dynamic([["2295275975", [theme.palette.accents_2, radius, theme.palette.background, SCALES.width(1.75) || SCALES.height(1.75), SCALES.height(1.75) || SCALES.width(1.75), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), marginLeft, radius, SCALES.font(1)]]]) + " " + (props && props.className != null && props.className || "avatar-text")
|
package/esm/input/input-field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
var _excluded = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
4
|
+
var _excluded = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "onEnter", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
5
5
|
import _JSXStyle from "../styled-jsx.es.js";
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
7
7
|
/* eslint-disable react/jsx-no-undef */
|
|
@@ -50,6 +50,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
50
50
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
51
51
|
onBlur = _ref.onBlur,
|
|
52
52
|
onFocus = _ref.onFocus,
|
|
53
|
+
onEnter = _ref.onEnter,
|
|
53
54
|
_ref$autoComplete = _ref.autoComplete,
|
|
54
55
|
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
55
56
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -129,6 +130,11 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
129
130
|
setSelfValue(value);
|
|
130
131
|
}
|
|
131
132
|
});
|
|
133
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
134
|
+
if (e.key === "Enter") {
|
|
135
|
+
onEnter && onEnter(e);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
132
138
|
var controlledValue = isControlledComponent ? {
|
|
133
139
|
value: selfValue
|
|
134
140
|
} : {
|
|
@@ -156,7 +162,8 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
156
162
|
onFocus: focusHandler,
|
|
157
163
|
onBlur: blurHandler,
|
|
158
164
|
onChange: changeHandler,
|
|
159
|
-
autoComplete: autoComplete
|
|
165
|
+
autoComplete: autoComplete,
|
|
166
|
+
onKeyDown: handleKeyDown
|
|
160
167
|
}, inputProps, {
|
|
161
168
|
className: _JSXStyle.dynamic([["2582554466", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, defaultWidth), variant === 'normal' ? theme.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || useClasses({
|
|
162
169
|
disabled: disabled
|
|
@@ -24,6 +24,7 @@ export interface Props {
|
|
|
24
24
|
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
25
25
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
26
26
|
onIconClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
27
|
+
onEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
27
28
|
autoComplete?: string;
|
|
28
29
|
crossOrigin?: any;
|
|
29
30
|
onPointerEnterCapture?: any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helpdice/ui",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "esm/index.d.ts",
|
|
6
6
|
"unpkg": "dist/index.min.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@helpdice/icons": "^1.2.5",
|
|
66
66
|
"@helpdice/sdk": "^0.4.3",
|
|
67
67
|
"@helpdice/utils": "^0.1.4",
|
|
68
|
-
"@helpdice/pro": "2.0.
|
|
68
|
+
"@helpdice/pro": "2.0.6",
|
|
69
69
|
"@mapbox/rehype-prism": "^0.9.0",
|
|
70
70
|
"@mdx-js/loader": "^3.1.0",
|
|
71
71
|
"@mdx-js/react": "^3.1.0",
|