dibk-design 0.4.38 → 0.4.39

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.
@@ -84,6 +84,7 @@ var Textarea = /*#__PURE__*/function (_React$Component) {
84
84
  var _this$props$width, _this$props$resize, _props;
85
85
 
86
86
  var defaultValue = !this.props.value && this.props.defaultValue ? this.props.defaultValue : false;
87
+ var defaultKey = this.props.elementKey || null;
87
88
 
88
89
  var styleRules = _objectSpread(_objectSpread(_objectSpread({}, this.props.hasErrors ? this.getThemeErrorInputStyle(this.props.theme) : null), ((_this$props$width = this.props.width) === null || _this$props$width === void 0 ? void 0 : _this$props$width.length) && {
89
90
  maxWidth: this.props.width
@@ -97,7 +98,7 @@ var Textarea = /*#__PURE__*/function (_React$Component) {
97
98
  disabled: this.props.disabled,
98
99
  type: this.props.type,
99
100
  id: this.props.id,
100
- key: "".concat(this.props.id, "-").concat((0, _generators.generateRandomString)(6)),
101
+ key: defaultKey || "".concat(this.props.id, "-").concat((0, _generators.generateRandomString)(6)),
101
102
  onChange: this.props.onChange,
102
103
  onBlur: this.props.onBlur
103
104
  }, _defineProperty(_props, defaultValue ? 'defaultValue' : 'value', defaultValue || this.props.value), _defineProperty(_props, "placeholder", this.props.placeholder), _defineProperty(_props, "rows", this.props.rows), _defineProperty(_props, "className", this.props.hasErrors ? _TextareaModule.default.hasErrors : ''), _defineProperty(_props, 'aria-required', this.props.mandatory), _defineProperty(_props, "style", styleRules), _props);
@@ -131,6 +132,7 @@ Textarea.propTypes = {
131
132
  resize: _propTypes.default.string,
132
133
  value: _propTypes.default.string,
133
134
  defaultValue: _propTypes.default.string,
135
+ elementKey: _propTypes.default.string,
134
136
  rows: _propTypes.default.string,
135
137
  label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))]),
136
138
  contentOnly: _propTypes.default.bool,
@@ -13,6 +13,7 @@ Input field example:
13
13
  <Textarea id="textInput10" onChange={() => {console.log('onChange')}} label="Textarea without value, contentOnly set to true and defaultContent" contentOnly={true} defaultContent="Please insert a value" />
14
14
  <Textarea id="textInput11" onChange={()=>{console.log('onchange')}} value="Textarea with custom width" width="320px" />
15
15
  <Textarea id="textInput11" onChange={()=>{console.log('onchange')}} value="Textarea with custom width and vertical resizing" width="450px" resize="vertical" />
16
+ <Textarea id="textInput11" onChange={()=>{console.log('onchange')}} value="Textarea with a not auto generated key" elementKey="textareaKeyHere" />
16
17
  ```
17
18
 
18
19
  Themed Input field example:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dibk-design",
3
- "version": "0.4.38",
3
+ "version": "0.4.39",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",