@visns-studio/visns-components 5.7.16 → 5.7.17

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/package.json CHANGED
@@ -82,7 +82,7 @@
82
82
  "react-dom": "^17.0.0 || ^18.0.0"
83
83
  },
84
84
  "name": "@visns-studio/visns-components",
85
- "version": "5.7.16",
85
+ "version": "5.7.17",
86
86
  "description": "Various packages to assist in the development of our Custom Applications.",
87
87
  "main": "src/index.js",
88
88
  "files": [
@@ -1717,6 +1717,18 @@ function Field({
1717
1717
  </table>
1718
1718
  );
1719
1719
  case 'textarea':
1720
+ const getTextareaRows = (heightSize) => {
1721
+ switch (heightSize) {
1722
+ case 'small':
1723
+ return 5;
1724
+ case 'large':
1725
+ return 11;
1726
+ case 'normal':
1727
+ default:
1728
+ return 8;
1729
+ }
1730
+ };
1731
+
1720
1732
  return (
1721
1733
  <textarea
1722
1734
  data-name={settings.id}
@@ -1727,7 +1739,7 @@ function Field({
1727
1739
  ? inputValue
1728
1740
  : ''
1729
1741
  }
1730
- style={{ height: '200px' }}
1742
+ rows={getTextareaRows(settings.textareaHeight)}
1731
1743
  ></textarea>
1732
1744
  );
1733
1745
  case 'text':
@@ -40,6 +40,7 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
40
40
  rows: [],
41
41
  size: 'half',
42
42
  required: 'no',
43
+ textareaHeight: 'normal',
43
44
  });
44
45
  const [dataOption, setDataOption] = useState({
45
46
  id: '',
@@ -220,6 +221,7 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
220
221
  rows: [],
221
222
  size: 'half',
222
223
  required: 'no',
224
+ textareaHeight: 'normal',
223
225
  }));
224
226
  setModalType(() => ({
225
227
  type: 'create',
@@ -674,9 +676,23 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
674
676
  </label>
675
677
  );
676
678
  case 'textarea':
679
+ const getTextareaRows = (heightSize) => {
680
+ switch (heightSize) {
681
+ case 'small':
682
+ return 3;
683
+ case 'large':
684
+ return 8;
685
+ case 'normal':
686
+ default:
687
+ return 5;
688
+ }
689
+ };
690
+
677
691
  return (
678
692
  <label className={styles.fi__label}>
679
- <textarea rows="5"></textarea>
693
+ <textarea
694
+ rows={getTextareaRows(field.textareaHeight)}
695
+ ></textarea>
680
696
  <span className={styles.fi__span}>
681
697
  {field.label}{' '}
682
698
  {field.required === 'yes' ? '*' : null}
@@ -1142,6 +1158,35 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
1142
1158
  </label>
1143
1159
  </div>
1144
1160
 
1161
+ {dataField.type === 'textarea' && (
1162
+ <div className={styles.formItem}>
1163
+ <label className={styles.fi__label}>
1164
+ <select
1165
+ name="textareaHeight"
1166
+ value={
1167
+ dataField.textareaHeight
1168
+ }
1169
+ onChange={handleChangeForm}
1170
+ >
1171
+ <option value="small">
1172
+ Small
1173
+ </option>
1174
+ <option value="normal">
1175
+ Normal
1176
+ </option>
1177
+ <option value="large">
1178
+ Large
1179
+ </option>
1180
+ </select>
1181
+ <span
1182
+ className={styles.fi__span}
1183
+ >
1184
+ Height Size
1185
+ </span>
1186
+ </label>
1187
+ </div>
1188
+ )}
1189
+
1145
1190
  {dataField.type === 'image' && (
1146
1191
  <div className={styles.formItem}>
1147
1192
  <label className={styles.fi__label}>