@linzjs/lui 16.0.1 → 16.1.0
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 +7 -0
- package/README.md +2 -2
- package/dist/components/LuiFilterContainer/LuiFilterContainer.d.ts +1 -0
- package/dist/components/LuiFormElements/ClearableLuiTextInput/ClearableLuiTextInput.d.ts +3 -3
- package/dist/components/LuiIcon/LuiIcon.d.ts +2 -2
- package/dist/index.js +23 -3
- package/dist/index.js.map +1 -1
- package/dist/lui.css +2 -2
- package/dist/lui.esm.js +23 -3
- package/dist/lui.esm.js.map +1 -1
- package/dist/scss/Components/LuiFormElements/LuiTextInput/LuiTextInput.scss +1 -1
- package/package.json +1 -1
package/dist/lui.css
CHANGED
|
@@ -4933,12 +4933,12 @@ body.lui-menu-drawer-open {
|
|
|
4933
4933
|
cursor: not-allowed;
|
|
4934
4934
|
}
|
|
4935
4935
|
|
|
4936
|
-
.LuiTextInput-
|
|
4936
|
+
.LuiTextInput-iconPosition {
|
|
4937
4937
|
position: absolute;
|
|
4938
4938
|
right: 7px;
|
|
4939
4939
|
top: 17%;
|
|
4940
4940
|
}
|
|
4941
|
-
.LuiTextInput-
|
|
4941
|
+
.LuiTextInput-iconPosition svg {
|
|
4942
4942
|
fill: #6b6966;
|
|
4943
4943
|
}
|
|
4944
4944
|
|
package/dist/lui.esm.js
CHANGED
|
@@ -55808,6 +55808,23 @@ function setSelectedFirmCache(firmId, firmName) {
|
|
|
55808
55808
|
}
|
|
55809
55809
|
}
|
|
55810
55810
|
|
|
55811
|
+
var ClearableLuiTextInput = function (props) {
|
|
55812
|
+
var _a = useState(props.value ? props.value : ''), currentValue = _a[0], setCurrentValue = _a[1];
|
|
55813
|
+
var clear = function () {
|
|
55814
|
+
setCurrentValue('');
|
|
55815
|
+
if (props.onValueChange) {
|
|
55816
|
+
props.onValueChange('');
|
|
55817
|
+
}
|
|
55818
|
+
};
|
|
55819
|
+
var cancelIcon = currentValue !== '' ? (React__default.createElement(LuiIcon, { alt: "clear", name: "ic_cancel_clear", size: "lg", className: 'LuiTextInput-iconPosition', spanProps: { onClick: clear } })) : undefined;
|
|
55820
|
+
return (React__default.createElement(LuiTextInput, __assign({}, props, { icon: cancelIcon, value: currentValue, onChange: function (e) {
|
|
55821
|
+
setCurrentValue(e.target.value);
|
|
55822
|
+
if (props.onValueChange) {
|
|
55823
|
+
props.onValueChange(e.target.value);
|
|
55824
|
+
}
|
|
55825
|
+
} })));
|
|
55826
|
+
};
|
|
55827
|
+
|
|
55811
55828
|
/**
|
|
55812
55829
|
* Filters options and forwards to internal render function.
|
|
55813
55830
|
* has option for minimum elements to filter
|
|
@@ -55815,11 +55832,14 @@ function setSelectedFirmCache(firmId, firmName) {
|
|
|
55815
55832
|
* @constructor
|
|
55816
55833
|
*/
|
|
55817
55834
|
var LuiFilterContainer = function (props) {
|
|
55818
|
-
var renderFunction = props.renderFunction, filterFunction = props.filterFunction, _a = props.showFilter, showFilter = _a === void 0 ? true : _a;
|
|
55819
|
-
var
|
|
55835
|
+
var renderFunction = props.renderFunction, filterFunction = props.filterFunction, _a = props.showFilter, showFilter = _a === void 0 ? true : _a, _b = props.isFilterClearable, isFilterClearable = _b === void 0 ? true : _b;
|
|
55836
|
+
var _c = useState(''), filter = _c[0], setFilter = _c[1];
|
|
55820
55837
|
return (React__default.createElement("div", null,
|
|
55821
55838
|
showFilter && (React__default.createElement("div", { className: 'LuiFilterContainer-filter-container LuiDeprecatedForms' },
|
|
55822
|
-
React__default.createElement(
|
|
55839
|
+
isFilterClearable && (React__default.createElement(ClearableLuiTextInput, { label: 'Filter', inputProps: {
|
|
55840
|
+
placeholder: 'Type to filter',
|
|
55841
|
+
}, onValueChange: function (value) { return setFilter(value); } })),
|
|
55842
|
+
!isFilterClearable && (React__default.createElement("input", { type: "text", placeholder: "Type to filter", value: filter, onChange: function (e) { return setFilter(e.target.value); } })))),
|
|
55823
55843
|
renderFunction(filterFunction(filter))));
|
|
55824
55844
|
};
|
|
55825
55845
|
|