@linzjs/lui 24.5.0 → 24.6.1
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/contexts/LuiFilterCharactersProvider.d.ts +2 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/lui.esm.js +4 -4
- package/dist/lui.esm.js.map +1 -1
- package/package.json +2 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@
|
|
|
5
5
|
|
|
6
6
|
* **LuiComboSelect:** restore interface to support styling of the input element. ([#1270](https://github.com/linz/lui/issues/1270)) ([7ce6a13](https://github.com/linz/lui/commit/7ce6a137c7f16ffa3acbe4357569a6eb59ef47db))
|
|
7
7
|
|
|
8
|
+
## [24.6.1](https://github.com/linz/Lui/compare/lui-v24.6.0...lui-v24.6.1) (2026-01-26)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* removes some unused deps that were SNYK ([#1310](https://github.com/linz/Lui/issues/1310)) ([e9f28ac](https://github.com/linz/Lui/commit/e9f28acdfd9b672789af38b0fcb6b1039cbcbe02))
|
|
14
|
+
|
|
15
|
+
## [24.6.0](https://github.com/linz/Lui/compare/lui-v24.5.0...lui-v24.6.0) (2026-01-25)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* Add enabled flag to LuiFilterCharactersProvider ([#1307](https://github.com/linz/Lui/issues/1307)) ([d7fdfeb](https://github.com/linz/Lui/commit/d7fdfeb482e7de6b0e206c030555d049f3d8842d))
|
|
21
|
+
|
|
8
22
|
## [24.5.0](https://github.com/linz/Lui/compare/lui-v24.4.4...lui-v24.5.0) (2026-01-21)
|
|
9
23
|
|
|
10
24
|
|
|
@@ -7,5 +7,6 @@ export declare const LuiFilterCharactersContext: React.Context<LuiFilterCharacte
|
|
|
7
7
|
export declare function useFilterCharacters(): LuiFilterCharactersContext;
|
|
8
8
|
export type LuiFilterCharactersProviderProps = {
|
|
9
9
|
filterFunction?: (input: string) => string;
|
|
10
|
+
enabled?: boolean;
|
|
10
11
|
};
|
|
11
|
-
export declare const LuiFilterCharactersProvider: ({ children, filterFunction, }: PropsWithChildren<LuiFilterCharactersProviderProps>) => React.JSX.Element;
|
|
12
|
+
export declare const LuiFilterCharactersProvider: ({ children, filterFunction, enabled, }: PropsWithChildren<LuiFilterCharactersProviderProps>) => React.JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -7134,16 +7134,16 @@ function useFilterCharacters() {
|
|
|
7134
7134
|
return React.useContext(LuiFilterCharactersContext);
|
|
7135
7135
|
}
|
|
7136
7136
|
var LuiFilterCharactersProvider = function (_a) {
|
|
7137
|
-
var children = _a.children, filterFunction = _a.filterFunction;
|
|
7137
|
+
var children = _a.children, filterFunction = _a.filterFunction, _b = _a.enabled, enabled = _b === void 0 ? true : _b;
|
|
7138
7138
|
var filterCharacters = React.useCallback(function (input) {
|
|
7139
|
-
if (input === undefined) {
|
|
7139
|
+
if (input === undefined || !enabled) {
|
|
7140
7140
|
return input;
|
|
7141
7141
|
}
|
|
7142
7142
|
var filter = typeof filterFunction === 'function'
|
|
7143
7143
|
? filterFunction
|
|
7144
7144
|
: LinzFreeTextFilter;
|
|
7145
7145
|
return filter(input);
|
|
7146
|
-
}, [filterFunction]);
|
|
7146
|
+
}, [filterFunction, enabled]);
|
|
7147
7147
|
var filterInputEvent = React.useCallback(function (event) {
|
|
7148
7148
|
var value = event.target.value;
|
|
7149
7149
|
var filteredValue = filterCharacters(value);
|
|
@@ -7156,7 +7156,7 @@ var LuiFilterCharactersProvider = function (_a) {
|
|
|
7156
7156
|
event.target.setSelectionRange(newCaretPosition, newCaretPosition);
|
|
7157
7157
|
}
|
|
7158
7158
|
}
|
|
7159
|
-
}, [filterFunction]);
|
|
7159
|
+
}, [filterFunction, filterCharacters]);
|
|
7160
7160
|
return (React__default["default"].createElement(LuiFilterCharactersContext.Provider, { value: { filterCharacters: filterCharacters, filterInputEvent: filterInputEvent } }, children));
|
|
7161
7161
|
};
|
|
7162
7162
|
|