@linzjs/lui 20.0.0 → 20.0.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/components/LuiExpandableBanner/LuiExpandableBanner.d.ts +3 -0
- package/dist/components/LuiFormElements/LuiDateInput/FireDateChange.d.ts +1 -0
- package/dist/index.js +18 -7
- package/dist/index.js.map +1 -1
- package/dist/lui.esm.js +18 -7
- package/dist/lui.esm.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [20.0.2](https://github.com/linz/lui/compare/v20.0.1...v20.0.2) (2023-09-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **LuiExpandableBanner:** configure overflow ([#1013](https://github.com/linz/lui/issues/1013)) ([da054c2](https://github.com/linz/lui/commit/da054c25aa9b0ae194a03c019f4249164823abd5))
|
|
7
|
+
|
|
8
|
+
## [20.0.1](https://github.com/linz/lui/compare/v20.0.0...v20.0.1) (2023-09-20)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **LuiDateInput:** fire onChange upon valid paste ([#1009](https://github.com/linz/lui/issues/1009)) ([3b15b3e](https://github.com/linz/lui/commit/3b15b3e28b13011eacc5a06504733b5280db4c76))
|
|
14
|
+
|
|
1
15
|
# [20.0.0](https://github.com/linz/lui/compare/v19.0.0...v20.0.0) (2023-09-18)
|
|
2
16
|
|
|
3
17
|
# [19.0.0](https://github.com/linz/lui/compare/v18.11.2...v19.0.0) (2023-09-14)
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
declare type OverflowType = 'hidden' | 'auto' | 'inherit' | 'overlay' | 'revert' | 'scroll' | 'unset' | 'visible';
|
|
2
3
|
export interface Expandable {
|
|
3
4
|
className?: string;
|
|
4
5
|
label: ReactNode;
|
|
5
6
|
labelPrefix?: ReactNode;
|
|
6
7
|
start?: 'collapsed' | 'expanded';
|
|
8
|
+
expandedOverflow?: OverflowType;
|
|
7
9
|
}
|
|
8
10
|
export declare const LuiExpandableBanner: React.FC<React.PropsWithChildren<Expandable>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fireDateChange: (e: React.ClipboardEvent<HTMLInputElement>) => void;
|
package/dist/index.js
CHANGED
|
@@ -25701,6 +25701,7 @@ var LuiExpandableBanner = function (props) {
|
|
|
25701
25701
|
React.useEffect(function () {
|
|
25702
25702
|
content.current && setMaxHeight(getMaxHeight(content.current));
|
|
25703
25703
|
}, [content]);
|
|
25704
|
+
var accordionExpandedOverflow = props.expandedOverflow || 'auto';
|
|
25704
25705
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
25705
25706
|
React__default["default"].createElement("div", { className: clsx('lui-expand-container', props.className) },
|
|
25706
25707
|
props.labelPrefix,
|
|
@@ -25716,7 +25717,7 @@ var LuiExpandableBanner = function (props) {
|
|
|
25716
25717
|
: 'lui-expand-icon material-icons-round lui-expand-icon-transform') }, 'expand_more'))),
|
|
25717
25718
|
React__default["default"].createElement("div", { className: "lui-accordion-content", style: {
|
|
25718
25719
|
maxHeight: collapse ? '0px' : maxHeight,
|
|
25719
|
-
overflow: collapse ? 'hidden' :
|
|
25720
|
+
overflow: collapse ? 'hidden' : accordionExpandedOverflow
|
|
25720
25721
|
}, onTransitionEnd: function (e) { return setMaxHeight(getMaxHeight(e.currentTarget)); }, ref: content }, props.children)));
|
|
25721
25722
|
};
|
|
25722
25723
|
|
|
@@ -28263,14 +28264,24 @@ var parseTextDate = function (value, options) {
|
|
|
28263
28264
|
}
|
|
28264
28265
|
};
|
|
28265
28266
|
|
|
28267
|
+
var fireDateChange = function (e) {
|
|
28268
|
+
var input = e.currentTarget;
|
|
28269
|
+
var clipboard = e.clipboardData.getData('text');
|
|
28270
|
+
var parsedValue = parseTextDate(clipboard, { allowTwoDigitYear: true });
|
|
28271
|
+
if (parsedValue) {
|
|
28272
|
+
var change = new InputEvent('change', {
|
|
28273
|
+
bubbles: true,
|
|
28274
|
+
cancelable: true
|
|
28275
|
+
});
|
|
28276
|
+
input.valueAsDate = new Date(parsedValue);
|
|
28277
|
+
input.dispatchEvent(change);
|
|
28278
|
+
}
|
|
28279
|
+
};
|
|
28280
|
+
|
|
28266
28281
|
var DateInput = React.forwardRef(function (props, ref) {
|
|
28267
28282
|
var valueProp = props.value, onChangeProp = props.onChange, onPasteProp = props.onPaste, inputProps = __rest(props, ["value", "onChange", "onPaste"]);
|
|
28268
|
-
return (React__default["default"].createElement("input", __assign({}, inputProps, { ref: ref, pattern: "d{2}/d{2}/d{4}", placeholder: "dd/mm/yyyy", type:
|
|
28269
|
-
|
|
28270
|
-
var parsedValue = parseTextDate(data, { allowTwoDigitYear: true });
|
|
28271
|
-
if (parsedValue) {
|
|
28272
|
-
e.currentTarget.value = parsedValue;
|
|
28273
|
-
}
|
|
28283
|
+
return (React__default["default"].createElement("input", __assign({}, inputProps, { ref: ref, pattern: "d{2}/d{2}/d{4}", placeholder: "dd/mm/yyyy", type: "date", value: valueProp, onChange: onChangeProp, onPaste: function (e) {
|
|
28284
|
+
fireDateChange(e);
|
|
28274
28285
|
onPasteProp === null || onPasteProp === void 0 ? void 0 : onPasteProp(e);
|
|
28275
28286
|
} })));
|
|
28276
28287
|
});
|