@visns-studio/visns-components 6.3.14 → 6.3.16
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
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
92
92
|
},
|
|
93
93
|
"name": "@visns-studio/visns-components",
|
|
94
|
-
"version": "6.3.
|
|
94
|
+
"version": "6.3.16",
|
|
95
95
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
96
96
|
"main": "src/index.js",
|
|
97
97
|
"files": [
|
package/src/components/Field.jsx
CHANGED
|
@@ -2603,6 +2603,8 @@ function Field({
|
|
|
2603
2603
|
<textarea
|
|
2604
2604
|
value={cell[cellKey] || ''}
|
|
2605
2605
|
data-id={settings.id}
|
|
2606
|
+
rows={3}
|
|
2607
|
+
className={styles.autoGrowCellTextarea}
|
|
2606
2608
|
onChange={(e) =>
|
|
2607
2609
|
onChangeTableRadio(e, rowKey, cellKey)
|
|
2608
2610
|
}
|
|
@@ -2801,6 +2803,8 @@ function Field({
|
|
|
2801
2803
|
<textarea
|
|
2802
2804
|
value={cell || ''}
|
|
2803
2805
|
data-id={settings.id}
|
|
2806
|
+
rows={3}
|
|
2807
|
+
className={styles.autoGrowCellTextarea}
|
|
2804
2808
|
onChange={(e) =>
|
|
2805
2809
|
onChangeTableText(e, rowKey, cellKey)
|
|
2806
2810
|
}
|
|
@@ -2947,7 +2951,7 @@ function Field({
|
|
|
2947
2951
|
<textarea
|
|
2948
2952
|
ref={variableTextareaRef}
|
|
2949
2953
|
data-name={settings.id}
|
|
2950
|
-
className={inputClass[settings.id]}
|
|
2954
|
+
className={`${inputClass[settings.id] || ''} ${styles.autoGrowTextarea}`.trim()}
|
|
2951
2955
|
onChange={onChange}
|
|
2952
2956
|
value={
|
|
2953
2957
|
inputValue && inputValue !== 'null'
|
|
@@ -1764,3 +1764,38 @@ input[type='file']:hover {
|
|
|
1764
1764
|
color: var(--danger-color, #dc3545);
|
|
1765
1765
|
}
|
|
1766
1766
|
}
|
|
1767
|
+
|
|
1768
|
+
/* =========================================================================
|
|
1769
|
+
Auto-growing note/comment textareas
|
|
1770
|
+
|
|
1771
|
+
A fixed `rows` box turns a long note log into a porthole: the reader
|
|
1772
|
+
scrolls a few lines at a time inside a form that has plenty of room.
|
|
1773
|
+
Where the browser supports it (field-sizing), the box sizes itself to
|
|
1774
|
+
its content so a note history reads top to bottom with the page's own
|
|
1775
|
+
scroll; the `rows` attribute stays as the fallback everywhere else.
|
|
1776
|
+
`resize: vertical` keeps a drag handle in both worlds, so a reviewer
|
|
1777
|
+
can pull the box taller regardless of support.
|
|
1778
|
+
|
|
1779
|
+
Two minimums: a standalone Notes/Comments field opens at roughly its
|
|
1780
|
+
old 8-row size so an empty form doesn't collapse to a slit; a
|
|
1781
|
+
table-cell textarea starts near its 3-row fallback so checklist rows
|
|
1782
|
+
stay compact until they have content.
|
|
1783
|
+
========================================================================= */
|
|
1784
|
+
|
|
1785
|
+
.autoGrowTextarea {
|
|
1786
|
+
resize: vertical;
|
|
1787
|
+
|
|
1788
|
+
@supports (field-sizing: content) {
|
|
1789
|
+
field-sizing: content;
|
|
1790
|
+
min-height: 8lh;
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
.autoGrowCellTextarea {
|
|
1795
|
+
resize: vertical;
|
|
1796
|
+
|
|
1797
|
+
@supports (field-sizing: content) {
|
|
1798
|
+
field-sizing: content;
|
|
1799
|
+
min-height: 3lh;
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
@@ -39,6 +39,16 @@ select {
|
|
|
39
39
|
font: inherit;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
/* Floor under every textarea: the browser default (`rows` omitted) is two
|
|
43
|
+
lines, which renders a multi-line field as a slit. Three lines of text
|
|
44
|
+
plus the field's own padding is the least a free-text box can be and
|
|
45
|
+
still read as one. A bare element selector, so any component that sets
|
|
46
|
+
its own height with a class still wins. */
|
|
47
|
+
textarea {
|
|
48
|
+
min-height: 5.5em; /* ~3 lines + padding, for browsers without lh */
|
|
49
|
+
min-height: calc(3lh + 2rem);
|
|
50
|
+
}
|
|
51
|
+
|
|
42
52
|
/* Global radio button styling */
|
|
43
53
|
input[type='radio'],
|
|
44
54
|
.radio-input {
|