@linzjs/lui 23.6.0 → 23.6.2
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 +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +38 -1
- package/dist/index.js.map +1 -1
- package/dist/lui.esm.js +38 -2
- package/dist/lui.esm.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [23.6.2](https://github.com/linz/lui/compare/v23.6.1...v23.6.2) (2025-07-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* remove console log ([#1237](https://github.com/linz/lui/issues/1237)) ([80e2282](https://github.com/linz/lui/commit/80e2282e03bc1fe474b7582fb8ed69318e9894c5))
|
|
7
|
+
|
|
8
|
+
## [23.6.1](https://github.com/linz/lui/compare/v23.6.0...v23.6.1) (2025-07-07)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* missed export ([#1236](https://github.com/linz/lui/issues/1236)) ([5cb08c0](https://github.com/linz/lui/commit/5cb08c048f85a5a994cf0029dbeb6e8fec3cf90d))
|
|
14
|
+
|
|
1
15
|
# [23.6.0](https://github.com/linz/lui/compare/v23.5.0...v23.6.0) (2025-07-07)
|
|
2
16
|
|
|
3
17
|
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { LuiCheckboxInput } from './components/LuiFormElements/LuiCheckboxInput/
|
|
|
20
20
|
export { LuiFileInputBox } from './components/LuiFormElements/LuiFileInputBox/LuiFileInputBox';
|
|
21
21
|
export { LuiSelectInput } from './components/LuiFormElements/LuiSelectInput/LuiSelectInput';
|
|
22
22
|
export { LuiTextAreaInput } from './components/LuiFormElements/LuiTextAreaInput/LuiTextAreaInput';
|
|
23
|
+
export { LuiAutoExpandTextAreaInput } from './components/LuiFormElements/LuiTextAreaInput/LuiAutoExpandTextAreaInput';
|
|
23
24
|
export { LuiTextInput } from './components/LuiFormElements/LuiTextInput/LuiTextInput';
|
|
24
25
|
export { LuiDateInput } from './components/LuiFormElements/LuiDateInput/LuiDateInput';
|
|
25
26
|
export { LuiMoneyInput } from './components/LuiFormElements/LuiMoneyInput/LuiMoneyInput';
|
package/dist/index.js
CHANGED
|
@@ -7202,7 +7202,6 @@ var LuiTextAreaInput = React__default["default"].forwardRef(function (props, ref
|
|
|
7202
7202
|
var _a, _b;
|
|
7203
7203
|
var id = useGenerateOrDefaultId((_a = props.inputProps) === null || _a === void 0 ? void 0 : _a.id);
|
|
7204
7204
|
var rows = props.rows !== undefined ? props.rows : 5;
|
|
7205
|
-
console.log('🚀 ~ rows:', rows);
|
|
7206
7205
|
return (React__default["default"].createElement("div", { className: clsx('LuiTextAreaInput', ((_b = props.inputProps) === null || _b === void 0 ? void 0 : _b.disabled) ? 'isDisabled' : '', props.error ? 'hasError' : '', props.warning ? 'hasWarning' : '') },
|
|
7207
7206
|
React__default["default"].createElement("label", { htmlFor: id },
|
|
7208
7207
|
props.mandatory && (React__default["default"].createElement("span", { className: "LuiTextAreaInput-mandatory" }, "*")),
|
|
@@ -7217,6 +7216,43 @@ var LuiTextAreaInput = React__default["default"].forwardRef(function (props, ref
|
|
|
7217
7216
|
props.warning))));
|
|
7218
7217
|
});
|
|
7219
7218
|
|
|
7219
|
+
// Example taken from https://codesandbox.io/p/github/philals/auto-size-input/main?file=%2Fsrc%2FApp.tsx%3A54%2C53&import=true&workspaceId=ws_HCohVkSSrGceH2wAjz2JrW
|
|
7220
|
+
// Note soon this can be replaced by the new CSS class field-sizing (https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing)h
|
|
7221
|
+
var LuiAutoExpandTextAreaInput = function (props) {
|
|
7222
|
+
var _a;
|
|
7223
|
+
var handleInputChange = function (e) {
|
|
7224
|
+
if (props.onChange) {
|
|
7225
|
+
props.onChange(e);
|
|
7226
|
+
}
|
|
7227
|
+
adjustHeight(e.target);
|
|
7228
|
+
};
|
|
7229
|
+
var ref = React.useRef(null);
|
|
7230
|
+
var adjustHeight = React.useCallback(function (element) {
|
|
7231
|
+
// Reset height to auto to get proper scrollHeight
|
|
7232
|
+
element.style.height = 'auto';
|
|
7233
|
+
var height = "".concat(element.scrollHeight, "px");
|
|
7234
|
+
// Set the height to match content
|
|
7235
|
+
element.style.height = height;
|
|
7236
|
+
}, []);
|
|
7237
|
+
React.useEffect(function () {
|
|
7238
|
+
if (ref.current) {
|
|
7239
|
+
adjustHeight(ref.current);
|
|
7240
|
+
}
|
|
7241
|
+
}, [props.value, adjustHeight]); // Re-run when value changes
|
|
7242
|
+
// Since we can't directly use refs, we'll use a custom render approach
|
|
7243
|
+
// We'll handle the auto-resize via the onChange and onKeyUp events
|
|
7244
|
+
var customInputProps = __assign(__assign({}, props.inputProps), { onKeyUp: function (e) {
|
|
7245
|
+
var _a;
|
|
7246
|
+
adjustHeight(e.currentTarget);
|
|
7247
|
+
if ((_a = props.inputProps) === null || _a === void 0 ? void 0 : _a.onKeyUp) {
|
|
7248
|
+
props.inputProps.onKeyUp(e);
|
|
7249
|
+
}
|
|
7250
|
+
}, style: __assign({ resize: 'none', overflow: 'hidden', maxHeight: '500px',
|
|
7251
|
+
// boxSizing: 'border-box',
|
|
7252
|
+
minHeight: '1px' }, (_a = props.inputProps) === null || _a === void 0 ? void 0 : _a.style) });
|
|
7253
|
+
return (React__default["default"].createElement(LuiTextAreaInput, __assign({}, props, { rows: 1, onChange: handleInputChange, inputProps: customInputProps, ref: ref })));
|
|
7254
|
+
};
|
|
7255
|
+
|
|
7220
7256
|
var LuiDateInput = React__default["default"].forwardRef(function (_a, ref) {
|
|
7221
7257
|
var inputProps = _a.inputProps, rest = __rest(_a, ["inputProps"]);
|
|
7222
7258
|
var mapped = __assign({ inputProps: __assign(__assign({}, inputProps), { type: 'date' }) }, rest);
|
|
@@ -35359,6 +35395,7 @@ exports.LuiAlertModal = LuiAlertModal;
|
|
|
35359
35395
|
exports.LuiAlertModalButtons = LuiAlertModalButtons;
|
|
35360
35396
|
exports.LuiAlertModalV2 = LuiAlertModalV2;
|
|
35361
35397
|
exports.LuiAppFooterSml = LuiAppFooterSml;
|
|
35398
|
+
exports.LuiAutoExpandTextAreaInput = LuiAutoExpandTextAreaInput;
|
|
35362
35399
|
exports.LuiBadge = LuiBadge;
|
|
35363
35400
|
exports.LuiBanner = LuiBanner;
|
|
35364
35401
|
exports.LuiBannerContent = LuiBannerContent;
|