@widergy/energy-ui 2.7.6 → 2.8.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [2.8.0](https://github.com/widergy/energy-ui/compare/v2.7.6...v2.8.0) (2023-10-09)
2
+
3
+
4
+ ### Features
5
+
6
+ * added disable focus ([#384](https://github.com/widergy/energy-ui/issues/384)) ([39d112e](https://github.com/widergy/energy-ui/commit/39d112ec7d59787c7c1731643b70d849a222c50e))
7
+
1
8
  ## [2.7.6](https://github.com/widergy/energy-ui/compare/v2.7.5...v2.7.6) (2023-10-03)
2
9
 
3
10
 
@@ -20,7 +20,7 @@ var _UTLabel = _interopRequireDefault(require("../UTLabel"));
20
20
  var _constants = require("./constants");
21
21
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
22
22
  var _theme = require("./theme");
23
- var _excluded = ["adornmentInside", "autofocus", "bigInput", "captionLabel", "classes", "containerClassName", "disabled", "field", "id", "input", "inputClassName", "inputObjectKey", "label", "labelRootClassName", "meta", "onChangeText", "PasswordInvisibleIcon", "PasswordVisibleIcon", "placeholder", "preventEnterSubmit", "tippyProps", "tooltip", "type", "variant"],
23
+ var _excluded = ["adornmentInside", "autofocus", "bigInput", "captionLabel", "classes", "containerClassName", "disabled", "field", "id", "input", "inputClassName", "inputObjectKey", "label", "labelRootClassName", "meta", "onChangeText", "PasswordInvisibleIcon", "PasswordVisibleIcon", "placeholder", "preventEnterSubmit", "preventFocus", "tippyProps", "tooltip", "type", "variant"],
24
24
  _excluded2 = ["base", "selectedOptionsIds", "retrieveStyle", "retrieveMuiTheme", "Component", "muiTheme"];
25
25
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26
26
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -93,13 +93,21 @@ var UTTextInput = /*#__PURE__*/function (_PureComponent) {
93
93
  PasswordVisibleIcon = _this$props.PasswordVisibleIcon,
94
94
  placeholder = _this$props.placeholder,
95
95
  preventEnterSubmit = _this$props.preventEnterSubmit,
96
+ preventFocus = _this$props.preventFocus,
96
97
  tippyProps = _this$props.tippyProps,
97
98
  tooltip = _this$props.tooltip,
98
99
  type = _this$props.type,
99
100
  variant = _this$props.variant,
100
101
  others = _objectWithoutProperties(_this$props, _excluded);
101
102
  var handleChange = function handleChange(event) {
102
- return input.onChange(onChangeText(event.target.value));
103
+ if (preventFocus) event.preventDefault();
104
+ input.onChange(onChangeText(event.target.value));
105
+ };
106
+ var handleClick = function handleClick(event) {
107
+ if (preventFocus) {
108
+ event.preventDefault();
109
+ event.target.blur();
110
+ }
103
111
  };
104
112
  var _ref = (field === null || field === void 0 ? void 0 : field.configuration) || {},
105
113
  Icon = _ref.icon,
@@ -146,6 +154,7 @@ var UTTextInput = /*#__PURE__*/function (_PureComponent) {
146
154
  }, errorMessage) : undefined,
147
155
  disabled: disabled,
148
156
  onChange: handleChange,
157
+ onClick: handleClick,
149
158
  value: value,
150
159
  fullWidth: true,
151
160
  autoFocus: autofocus,
@@ -204,6 +213,7 @@ UTTextInput.propTypes = {
204
213
  PasswordVisibleIcon: _propTypes.elementType,
205
214
  placeholder: _propTypes.string,
206
215
  preventEnterSubmit: _propTypes.bool,
216
+ preventFocus: _propTypes.bool,
207
217
  tippyProps: _propTypes.object,
208
218
  tooltip: _propTypes.string,
209
219
  type: _propTypes.string,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "2.7.6",
3
+ "version": "2.8.0",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",