@linzjs/lui 21.21.0 → 21.23.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 +14 -0
- package/dist/assets/icons/data_display_threshold_high_urban.svg +9 -1
- package/dist/assets/icons/xml_file.svg +6 -1
- package/dist/assets/svg-content.tsx +12 -4
- package/dist/components/LuiSearchBox/LuiSearchBox.d.ts +1 -1
- package/dist/components/LuiSearchInput/LuiSearchInput.d.ts +6 -16
- package/dist/components/LuiSearchInput/ResultsDisplay.d.ts +15 -5
- package/dist/index.d.ts +2 -1
- package/dist/index.js +12 -10
- package/dist/index.js.map +1 -1
- package/dist/lui.esm.js +12 -10
- package/dist/lui.esm.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [21.23.0](https://github.com/linz/lui/compare/v21.22.0...v21.23.0) (2024-02-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **Extend pros for SearchInput:** TI-1738 ([#1099](https://github.com/linz/lui/issues/1099)) ([794be11](https://github.com/linz/lui/commit/794be111ff52e03a043e043722c0bba0f473bd43))
|
|
7
|
+
|
|
8
|
+
# [21.22.0](https://github.com/linz/lui/compare/v21.21.0...v21.22.0) (2024-02-15)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* fixed icons ([#1096](https://github.com/linz/lui/issues/1096)) ([8c6e6e8](https://github.com/linz/lui/commit/8c6e6e8d82540fa69a57acfef7ab00e41c3d6fa0))
|
|
14
|
+
|
|
1
15
|
# [21.21.0](https://github.com/linz/lui/compare/v21.20.0...v21.21.0) (2024-02-13)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
<svg
|
|
3
|
+
viewBox="0 0 24 24">
|
|
4
|
+
<g>
|
|
5
|
+
<path d="M19,2H7v4.5l2,2V8h3v2h-2v2h2v2h-2v2h2v2h-2v2h4v-9h5V2z M12,6H9V4h3V6z M17,10h-3V8h3V10z M17,6h-3V4h3V6z"/>
|
|
6
|
+
<path d="M3,10v12h6V10L6,7L3,10z M7,20H5v-2h2V20z M7,16H5v-2h2V16z M7,12H5v-2h2V12z"/>
|
|
7
|
+
<path d="M15,12v10h6V12H15z M19,20h-2v-2h2V20z M19,16h-2v-2h2V16z"/>
|
|
8
|
+
</g>
|
|
9
|
+
</svg>
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
<svg viewBox="0 0 24 24"
|
|
1
|
+
<svg viewBox="0 0 24 24">
|
|
2
|
+
<path d="M14,2H6C4.9,2,4,2.9,4,4l0,16c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2V8L14,2z M6,4h7v5h5v3H6V4z M9.5,19H8.1
|
|
3
|
+
l-0.9-1.4L6.5,19H5l1.5-2.5L5,14h1.4l0.9,1.5L8.1,14h1.4L8,16.5L9.5,19z M14.2,19l-0.3-2.7L13.3,19H12l-0.7-2.6L11.1,19H9.8l0.6-5
|
|
4
|
+
h1.2l1,3.5l1-3.5h1.2l0.6,5H14.2z M19,19h-1.8c-0.5,0-0.8-0.1-1-0.3c0,0,0,0,0,0l0,0c0,0,0,0,0,0c-0.2-0.2-0.3-0.5-0.3-1V14h1.3v3.5
|
|
5
|
+
c0,0.2,0.1,0.4,0.3,0.4H19V19z"/>
|
|
6
|
+
</svg>
|
|
@@ -637,8 +637,11 @@ iconMap['ic_data_display_threshold'] = (
|
|
|
637
637
|
|
|
638
638
|
iconMap['ic_data_display_threshold_high_urban'] = (
|
|
639
639
|
<svg viewBox="0 0 24 24">
|
|
640
|
-
<
|
|
641
|
-
|
|
640
|
+
<g>
|
|
641
|
+
<path d="M19,2H7v4.5l2,2V8h3v2h-2v2h2v2h-2v2h2v2h-2v2h4v-9h5V2z M12,6H9V4h3V6z M17,10h-3V8h3V10z M17,6h-3V4h3V6z" />
|
|
642
|
+
<path d="M3,10v12h6V10L6,7L3,10z M7,20H5v-2h2V20z M7,16H5v-2h2V16z M7,12H5v-2h2V12z" />
|
|
643
|
+
<path d="M15,12v10h6V12H15z M19,20h-2v-2h2V20z M19,16h-2v-2h2V16z" />
|
|
644
|
+
</g>
|
|
642
645
|
</svg>
|
|
643
646
|
);
|
|
644
647
|
|
|
@@ -1885,8 +1888,13 @@ iconMap['ic_whats_new_updates'] = (
|
|
|
1885
1888
|
);
|
|
1886
1889
|
|
|
1887
1890
|
iconMap['ic_xml_file'] = (
|
|
1888
|
-
<svg viewBox="0 0 24 24"
|
|
1889
|
-
<path
|
|
1891
|
+
<svg viewBox="0 0 24 24">
|
|
1892
|
+
<path
|
|
1893
|
+
d="M14,2H6C4.9,2,4,2.9,4,4l0,16c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2V8L14,2z M6,4h7v5h5v3H6V4z M9.5,19H8.1
|
|
1894
|
+
l-0.9-1.4L6.5,19H5l1.5-2.5L5,14h1.4l0.9,1.5L8.1,14h1.4L8,16.5L9.5,19z M14.2,19l-0.3-2.7L13.3,19H12l-0.7-2.6L11.1,19H9.8l0.6-5
|
|
1895
|
+
h1.2l1,3.5l1-3.5h1.2l0.6,5H14.2z M19,19h-1.8c-0.5,0-0.8-0.1-1-0.3c0,0,0,0,0,0l0,0c0,0,0,0,0,0c-0.2-0.2-0.3-0.5-0.3-1V14h1.3v3.5
|
|
1896
|
+
c0,0.2,0.1,0.4,0.3,0.4H19V19z"
|
|
1897
|
+
/>
|
|
1890
1898
|
</svg>
|
|
1891
1899
|
);
|
|
1892
1900
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
2
|
import { LuiButtonProps } from '../LuiButton/LuiButton';
|
|
3
|
-
import {
|
|
3
|
+
import { ISearchGroupedResult, ISearchResult } from '../LuiSearchInput/ResultsDisplay';
|
|
4
4
|
export interface ISearchMenuOption {
|
|
5
5
|
name?: string;
|
|
6
6
|
groupTitle?: string;
|
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
2
|
import 'react-loading-skeleton/dist/skeleton.css';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
description: string;
|
|
6
|
-
}
|
|
7
|
-
export interface ISearchGroupedResult {
|
|
8
|
-
id: string;
|
|
9
|
-
description: string;
|
|
10
|
-
label: string;
|
|
11
|
-
items: ISearchResult[];
|
|
12
|
-
}
|
|
13
|
-
export interface ISearchInputProps {
|
|
3
|
+
import { ISearchGroupedResult, ISearchResult } from './ResultsDisplay';
|
|
4
|
+
export interface ISearchInputProps<SearchResult extends ISearchResult = ISearchResult> {
|
|
14
5
|
minCharactersForSearch: number;
|
|
15
6
|
placeholderText: string;
|
|
16
|
-
onSelectOption: (selectedOption:
|
|
17
|
-
getOptions: (inputValue: string) => Promise<
|
|
18
|
-
renderItem: (item:
|
|
7
|
+
onSelectOption: (selectedOption: SearchResult) => void;
|
|
8
|
+
getOptions: (inputValue: string) => Promise<SearchResult[] | ISearchGroupedResult<SearchResult>[]>;
|
|
9
|
+
renderItem: (item: SearchResult) => ReactElement;
|
|
19
10
|
disclaimer?: string;
|
|
20
11
|
initialValue?: string;
|
|
21
12
|
inputTransformer?: (input: string) => string;
|
|
@@ -23,5 +14,4 @@ export interface ISearchInputProps {
|
|
|
23
14
|
focusUpdate?: boolean;
|
|
24
15
|
onClearCallback?: () => void;
|
|
25
16
|
}
|
|
26
|
-
export declare
|
|
27
|
-
export declare const LuiSearchInput: React.FC<React.PropsWithChildren<ISearchInputProps>>;
|
|
17
|
+
export declare const LuiSearchInput: <SearchResult extends ISearchResult = ISearchResult>(props: React.PropsWithChildren<ISearchInputProps<SearchResult>>) => JSX.Element;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import React, { ReactElement, RefObject } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export interface ISearchResult {
|
|
3
|
+
id: string;
|
|
4
|
+
description: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ISearchGroupedResult<SearchResult extends ISearchResult = ISearchResult> {
|
|
7
|
+
id: string;
|
|
8
|
+
description: string;
|
|
9
|
+
label: string;
|
|
10
|
+
items: SearchResult[];
|
|
11
|
+
}
|
|
12
|
+
export interface IResultsProps<SearchResult extends ISearchResult = ISearchResult> {
|
|
4
13
|
selectedId: string;
|
|
5
14
|
isLoading: boolean;
|
|
6
15
|
onClick: (id: string) => void;
|
|
7
16
|
setSelectedId: (id: string) => void;
|
|
8
|
-
renderItem: (item:
|
|
9
|
-
results:
|
|
17
|
+
renderItem: (item: SearchResult) => ReactElement;
|
|
18
|
+
results: SearchResult[] | ISearchGroupedResult<SearchResult>[];
|
|
10
19
|
selectedRef: RefObject<HTMLDivElement>;
|
|
11
20
|
}
|
|
12
|
-
declare
|
|
21
|
+
export declare function isGroupedResult<SearchResult extends ISearchResult = ISearchResult>(result: SearchResult[] | ISearchGroupedResult<SearchResult>[]): result is ISearchGroupedResult<SearchResult>[];
|
|
22
|
+
declare const ResultsDisplay: <SearchResults extends ISearchResult = ISearchResult>({ isLoading, onClick, children, selectedId, selectedRef, setSelectedId, results, renderItem, }: React.PropsWithChildren<IResultsProps<SearchResults>>) => ReactElement;
|
|
13
23
|
export default ResultsDisplay;
|
package/dist/index.d.ts
CHANGED
|
@@ -37,7 +37,8 @@ export * from './components/LuiHeaderMenu/LuiHeaderMenus';
|
|
|
37
37
|
export * from './components/LuiHeaderMenuV2/LuiHeaderMenusV2';
|
|
38
38
|
export { LuiUpdatesSplashModal } from './components/LuiUpdateSplashModal/LuiUpdatesSplashModal';
|
|
39
39
|
export { LuiModal, LuiAlertModal, LuiAlertModalButtons, } from './components/LuiModal/LuiModal';
|
|
40
|
-
export { type ISearchInputProps,
|
|
40
|
+
export { type ISearchInputProps, LuiSearchInput, } from './components/LuiSearchInput/LuiSearchInput';
|
|
41
|
+
export { type ISearchGroupedResult, type ISearchResult, } from './components/LuiSearchInput/ResultsDisplay';
|
|
41
42
|
export { type ISearchMenuOption, type ILuiSearchBoxProps, LuiSearchBox, } from './components/LuiSearchBox/LuiSearchBox';
|
|
42
43
|
export { type ILuiSplitButtonProps, type ILuiSplitButtonMenuItemProps, LuiSplitButtonPosition, LuiSplitButtonMenuItem, LuiSplitButton, } from './components/LuiSplitButton/LuiSplitButton';
|
|
43
44
|
export { LuiErrorPage } from './components/LuiErrorPage/LuiErrorPage';
|
package/dist/index.js
CHANGED
|
@@ -290,8 +290,10 @@ iconMap['ic_data_display_threshold'] = (React__default["default"].createElement(
|
|
|
290
290
|
React__default["default"].createElement("path", { d: "M21 4a1 1 0 0 0-1.371-.928l-4.66 1.863-5.653-1.884a1 1 0 0 0-.687.02l-5 2A1 1 0 0 0 3 6v14a1 1 0 0 0 1.371.928l4.66-1.864 1.153.385a1 1 0 0 0 .632-1.898l-1.473-.49L9 15l-.343 2.06-.028.012L5 18.523V6.677l3.7-1.48L9 7l.307-1.843 5.35 1.783L15 9l.344-2.06.027-.012L19 5.477V10a1 1 0 1 0 2 0V4Z" }),
|
|
291
291
|
React__default["default"].createElement("path", { d: "m21.1 21.5-3.2-3.2c-.35.2-.725.367-1.125.5s-.825.2-1.275.2c-1.25 0-2.313-.438-3.188-1.313C11.438 16.813 11 15.75 11 14.5c0-1.25.438-2.313 1.313-3.188C13.187 10.438 14.25 10 15.5 10c1.25 0 2.313.438 3.188 1.313C19.563 12.187 20 13.25 20 14.5c0 .45-.067.875-.2 1.275-.133.4-.3.775-.5 1.125l3.2 3.2-1.4 1.4ZM15.5 17c.7 0 1.292-.242 1.775-.725.483-.483.725-1.075.725-1.775s-.242-1.292-.725-1.775C16.792 12.242 16.2 12 15.5 12s-1.292.242-1.775.725C13.242 13.208 13 13.8 13 14.5s.242 1.292.725 1.775c.483.483 1.075.725 1.775.725Z" })));
|
|
292
292
|
iconMap['ic_data_display_threshold_high_urban'] = (React__default["default"].createElement("svg", { viewBox: "0 0 24 24" },
|
|
293
|
-
React__default["default"].createElement("
|
|
294
|
-
|
|
293
|
+
React__default["default"].createElement("g", null,
|
|
294
|
+
React__default["default"].createElement("path", { d: "M19,2H7v4.5l2,2V8h3v2h-2v2h2v2h-2v2h2v2h-2v2h4v-9h5V2z M12,6H9V4h3V6z M17,10h-3V8h3V10z M17,6h-3V4h3V6z" }),
|
|
295
|
+
React__default["default"].createElement("path", { d: "M3,10v12h6V10L6,7L3,10z M7,20H5v-2h2V20z M7,16H5v-2h2V16z M7,12H5v-2h2V12z" }),
|
|
296
|
+
React__default["default"].createElement("path", { d: "M15,12v10h6V12H15z M19,20h-2v-2h2V20z M19,16h-2v-2h2V16z" }))));
|
|
295
297
|
iconMap['ic_data_display_threshold_low_large_rural'] = (React__default["default"].createElement("svg", { viewBox: "0 0 24 24" },
|
|
296
298
|
' ',
|
|
297
299
|
React__default["default"].createElement("path", { d: "M8 12h.5c1.4 0 2.5-1.2 2.5-2.7 0-1.1-.6-2-1.5-2.4v-.2C9.5 5.2 8.4 4 7 4S4.5 5.2 4.5 6.7v.2C3.6 7.3 3 8.2 3 9.3 3 10.8 4.1 12 5.5 12H6v2.5c-1.3-.3-2.6-.5-4-.5v2c2.6 0 6.4.9 9 3.4v-2.6c-.9-.7-1.9-1.2-3-1.6V12zM6.1 7.8l-.1-1v-.1c0-.7.5-1.2 1-1.2s1 .4 1 1.2v.1l-.1 1 .9.4c.3.2.6.6.6 1.1 0 .7-.5 1.2-1 1.2h-3c-.5 0-1-.4-1-1.2 0-.5.3-.9.6-1.1l1.1-.4zM21 12V9h-2v1l-2-2-6 6 1 1v6h10v-6l1-1-2-2zm-1 7h-2v-3h-2v3h-2v-5l3-3 3 3v5z" })));
|
|
@@ -748,8 +750,8 @@ iconMap['ic_waves'] = (React__default["default"].createElement("svg", { viewBox:
|
|
|
748
750
|
React__default["default"].createElement("path", { d: "M17 14.9c-1.35 0-2.2.42-2.95.8-.65.33-1.18.6-2.05.6-.9 0-1.4-.25-2.05-.6-.75-.38-1.57-.8-2.95-.8-1.38 0-2.2.42-2.95.8-.65.33-1.17.6-2.05.6v1.95c1.35 0 2.2-.42 2.95-.8.65-.33 1.17-.6 2.05-.6.88 0 1.4.25 2.05.6.75.38 1.57.8 2.95.8 1.38 0 2.2-.42 2.95-.8.65-.33 1.18-.6 2.05-.6.9 0 1.4.25 2.05.6.75.38 1.58.8 2.95.8V16.3c-.9 0-1.4-.25-2.05-.6-.75-.38-1.6-.8-2.95-.8Zm0-4.45c-1.35 0-2.2.43-2.95.8-.65.32-1.18.6-2.05.6-.9 0-1.4-.25-2.05-.6-.75-.38-1.57-.8-2.95-.8-1.38 0-2.2.43-2.95.8-.65.32-1.17.6-2.05.6v1.95c1.35 0 2.2-.43 2.95-.8.65-.35 1.15-.6 2.05-.6.9 0 1.4.25 2.05.6.75.38 1.57.8 2.95.8 1.38 0 2.2-.43 2.95-.8.65-.35 1.15-.6 2.05-.6.9 0 1.4.25 2.05.6.75.38 1.58.8 2.95.8v-1.95c-.9 0-1.4-.25-2.05-.6-.75-.38-1.6-.8-2.95-.8ZM17 6c-1.35 0-2.2.43-2.95.8-.65.35-1.15.6-2.05.6-.9 0-1.4-.25-2.05-.6C9.2 6.42 8.38 6 7 6c-1.38 0-2.2.43-2.95.8-.65.35-1.15.6-2.05.6v1.95c1.35 0 2.2-.43 2.95-.8.65-.32 1.18-.6 2.05-.6.87 0 1.4.25 2.05.6.75.38 1.57.8 2.95.8 1.38 0 2.2-.43 2.95-.8.65-.32 1.18-.6 2.05-.6.9 0 1.4.25 2.05.6.75.38 1.58.8 2.95.8V7.4c-.9 0-1.4-.25-2.05-.6-.75-.38-1.6-.8-2.95-.8Z" })));
|
|
749
751
|
iconMap['ic_whats_new_updates'] = (React__default["default"].createElement("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
|
|
750
752
|
React__default["default"].createElement("path", { d: "m23 12-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12Zm-4.51 2.11.26 2.79-2.74.62-1.43 2.41L12 18.82l-2.58 1.11-1.43-2.41-2.74-.62.26-2.8L3.66 12l1.85-2.12-.26-2.78 2.74-.61 1.43-2.41L12 5.18l2.58-1.11 1.43 2.41 2.74.62-.26 2.79L20.34 12l-1.85 2.11ZM11 15h2v2h-2v-2Zm0-8h2v6h-2V7Z" })));
|
|
751
|
-
iconMap['ic_xml_file'] = (React__default["default"].createElement("svg", { viewBox: "0 0 24 24"
|
|
752
|
-
React__default["default"].createElement("path", { d: "
|
|
753
|
+
iconMap['ic_xml_file'] = (React__default["default"].createElement("svg", { viewBox: "0 0 24 24" },
|
|
754
|
+
React__default["default"].createElement("path", { d: "M14,2H6C4.9,2,4,2.9,4,4l0,16c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2V8L14,2z M6,4h7v5h5v3H6V4z M9.5,19H8.1\n\tl-0.9-1.4L6.5,19H5l1.5-2.5L5,14h1.4l0.9,1.5L8.1,14h1.4L8,16.5L9.5,19z M14.2,19l-0.3-2.7L13.3,19H12l-0.7-2.6L11.1,19H9.8l0.6-5\n\th1.2l1,3.5l1-3.5h1.2l0.6,5H14.2z M19,19h-1.8c-0.5,0-0.8-0.1-1-0.3c0,0,0,0,0,0l0,0c0,0,0,0,0,0c-0.2-0.2-0.3-0.5-0.3-1V14h1.3v3.5\n\tc0,0.2,0.1,0.4,0.3,0.4H19V19z" })));
|
|
753
755
|
iconMap['ic_zoom_centre'] = (React__default["default"].createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" },
|
|
754
756
|
React__default["default"].createElement("path", { d: "M17 12c0-2.76-2.24-5-5-5s-5 2.24-5 5 2.24 5 5 5 5-2.24 5-5zm-5 3c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3zm-7 0H3v4c0 1.1.9 2 2 2h4v-2H5v-4zM5 5h4V3H5c-1.1 0-2 .9-2 2v4h2V5zm14-2h-4v2h4v4h2V5c0-1.1-.9-2-2-2zm0 16h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4z" })));
|
|
755
757
|
iconMap['ic_zoom_out'] = (React__default["default"].createElement("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
|
|
@@ -42334,6 +42336,12 @@ function Skeleton({ count = 1, wrapper: Wrapper, className: customClassName, con
|
|
|
42334
42336
|
}
|
|
42335
42337
|
|
|
42336
42338
|
var SKELETON_COUNT = 3;
|
|
42339
|
+
function isGroupedResult(result) {
|
|
42340
|
+
if (result && result.length) {
|
|
42341
|
+
return (result[0].items !== undefined);
|
|
42342
|
+
}
|
|
42343
|
+
return false;
|
|
42344
|
+
}
|
|
42337
42345
|
var ResultsDisplay = function (_a) {
|
|
42338
42346
|
var isLoading = _a.isLoading, onClick = _a.onClick, children = _a.children, selectedId = _a.selectedId, selectedRef = _a.selectedRef, setSelectedId = _a.setSelectedId, results = _a.results, renderItem = _a.renderItem;
|
|
42339
42347
|
var ResultLine = function (result) {
|
|
@@ -42365,12 +42373,6 @@ var ResultsDisplay = function (_a) {
|
|
|
42365
42373
|
children));
|
|
42366
42374
|
};
|
|
42367
42375
|
|
|
42368
|
-
function isGroupedResult(result) {
|
|
42369
|
-
if (result && result.length) {
|
|
42370
|
-
return result[0].items !== undefined;
|
|
42371
|
-
}
|
|
42372
|
-
return false;
|
|
42373
|
-
}
|
|
42374
42376
|
function flatten(items) {
|
|
42375
42377
|
if (isGroupedResult(items)) {
|
|
42376
42378
|
return items.flatMap(function (item) { return item.items; });
|