@helpwave/hightide 0.1.7 → 0.1.8
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/dist/components/branding/HelpwaveBadge.js +30 -8
- package/dist/components/branding/HelpwaveBadge.js.map +1 -1
- package/dist/components/branding/HelpwaveBadge.mjs +30 -8
- package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
- package/dist/components/date/DatePicker.js +18 -20
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +18 -20
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.d.mts +1 -1
- package/dist/components/date/DayPicker.d.ts +1 -1
- package/dist/components/date/DayPicker.js +23 -11
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs +23 -11
- package/dist/components/date/DayPicker.mjs.map +1 -1
- package/dist/components/date/YearMonthPicker.js +106 -22
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +106 -22
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.js +2 -2
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +2 -2
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.js +2 -2
- package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.mjs +2 -2
- package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.d.mts +1 -1
- package/dist/components/layout-and-navigation/Carousel.d.ts +1 -1
- package/dist/components/layout-and-navigation/Carousel.js +86 -28
- package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.mjs +86 -28
- package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.d.mts +3 -0
- package/dist/components/layout-and-navigation/Expandable.d.ts +3 -0
- package/dist/components/layout-and-navigation/Expandable.js +4 -3
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs +4 -3
- package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js +4 -3
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs +4 -3
- package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.js +2 -2
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +2 -2
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.d.mts +7 -6
- package/dist/components/layout-and-navigation/SearchableList.d.ts +7 -6
- package/dist/components/layout-and-navigation/SearchableList.js +114 -21
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +114 -21
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.js +6 -6
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +6 -6
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Table.js +1 -1
- package/dist/components/layout-and-navigation/Table.js.map +1 -1
- package/dist/components/layout-and-navigation/Table.mjs +1 -1
- package/dist/components/layout-and-navigation/Table.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Tile.d.mts +10 -15
- package/dist/components/layout-and-navigation/Tile.d.ts +10 -15
- package/dist/components/layout-and-navigation/Tile.js +30 -8
- package/dist/components/layout-and-navigation/Tile.js.map +1 -1
- package/dist/components/layout-and-navigation/Tile.mjs +30 -8
- package/dist/components/layout-and-navigation/Tile.mjs.map +1 -1
- package/dist/components/loading-states/ProgressIndicator.js +2 -2
- package/dist/components/loading-states/ProgressIndicator.js.map +1 -1
- package/dist/components/loading-states/ProgressIndicator.mjs +2 -2
- package/dist/components/loading-states/ProgressIndicator.mjs.map +1 -1
- package/dist/components/modals/ConfirmModal.js +2 -2
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +2 -2
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.js +2 -2
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +2 -2
- package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
- package/dist/components/modals/InputModal.js +2 -2
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +2 -2
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.js +384 -150
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +383 -149
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +385 -154
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +382 -151
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js +1 -1
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +1 -1
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js +1 -1
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +1 -1
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.d.mts +1 -0
- package/dist/components/properties/MultiSelectProperty.d.ts +1 -0
- package/dist/components/properties/MultiSelectProperty.js +482 -430
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +478 -426
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js +1 -1
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +1 -1
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js +1 -1
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +1 -1
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.d.mts +3 -3
- package/dist/components/properties/SelectProperty.d.ts +3 -3
- package/dist/components/properties/SelectProperty.js +404 -263
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +404 -263
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js +1 -1
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +1 -1
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js +18 -20
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +18 -20
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Menu.d.mts +14 -8
- package/dist/components/user-action/Menu.d.ts +14 -8
- package/dist/components/user-action/Menu.js +32 -11
- package/dist/components/user-action/Menu.js.map +1 -1
- package/dist/components/user-action/Menu.mjs +32 -11
- package/dist/components/user-action/Menu.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +10 -16
- package/dist/components/user-action/MultiSelect.d.ts +10 -16
- package/dist/components/user-action/MultiSelect.js +485 -312
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +482 -310
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/Select.d.mts +5 -18
- package/dist/components/user-action/Select.d.ts +5 -18
- package/dist/components/user-action/Select.js +309 -113
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +304 -107
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/components/user-action/Tooltip.js +2 -2
- package/dist/components/user-action/Tooltip.js.map +1 -1
- package/dist/components/user-action/Tooltip.mjs +2 -2
- package/dist/components/user-action/Tooltip.mjs.map +1 -1
- package/dist/css/globals.css +213 -205
- package/dist/css/uncompiled/globals.css +136 -72
- package/dist/hooks/useSearch.d.mts +17 -0
- package/dist/hooks/useSearch.d.ts +17 -0
- package/dist/hooks/useSearch.js +66 -0
- package/dist/hooks/useSearch.js.map +1 -0
- package/dist/hooks/useSearch.mjs +42 -0
- package/dist/hooks/useSearch.mjs.map +1 -0
- package/dist/index.d.mts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +555 -463
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +517 -427
- package/dist/index.mjs.map +1 -1
- package/dist/util/PropsWithFunctionChildren.d.mts +14 -0
- package/dist/util/PropsWithFunctionChildren.d.ts +14 -0
- package/dist/util/PropsWithFunctionChildren.js +38 -0
- package/dist/util/PropsWithFunctionChildren.js.map +1 -0
- package/dist/util/PropsWithFunctionChildren.mjs +14 -0
- package/dist/util/PropsWithFunctionChildren.mjs.map +1 -0
- package/dist/util/simpleSearch.d.mts +2 -2
- package/dist/util/simpleSearch.d.ts +2 -2
- package/dist/util/simpleSearch.js +4 -1
- package/dist/util/simpleSearch.js.map +1 -1
- package/dist/util/simpleSearch.mjs +4 -1
- package/dist/util/simpleSearch.mjs.map +1 -1
- package/package.json +1 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type BagFunction<T> = (bag: T) => ReactNode;
|
|
4
|
+
type PropsWithBagFunction<T, P = unknown> = P & {
|
|
5
|
+
children?: BagFunction<T>;
|
|
6
|
+
};
|
|
7
|
+
type PropsWithBagFunctionOrChildren<T, P = unknown> = P & {
|
|
8
|
+
children?: BagFunction<T> | ReactNode;
|
|
9
|
+
};
|
|
10
|
+
declare const BagFunctionUtil: {
|
|
11
|
+
resolve: <T>(children: BagFunction<T> | ReactNode, bag: T) => ReactNode;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { type BagFunction, BagFunctionUtil, type PropsWithBagFunction, type PropsWithBagFunctionOrChildren };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type BagFunction<T> = (bag: T) => ReactNode;
|
|
4
|
+
type PropsWithBagFunction<T, P = unknown> = P & {
|
|
5
|
+
children?: BagFunction<T>;
|
|
6
|
+
};
|
|
7
|
+
type PropsWithBagFunctionOrChildren<T, P = unknown> = P & {
|
|
8
|
+
children?: BagFunction<T> | ReactNode;
|
|
9
|
+
};
|
|
10
|
+
declare const BagFunctionUtil: {
|
|
11
|
+
resolve: <T>(children: BagFunction<T> | ReactNode, bag: T) => ReactNode;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { type BagFunction, BagFunctionUtil, type PropsWithBagFunction, type PropsWithBagFunctionOrChildren };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/util/PropsWithFunctionChildren.ts
|
|
20
|
+
var PropsWithFunctionChildren_exports = {};
|
|
21
|
+
__export(PropsWithFunctionChildren_exports, {
|
|
22
|
+
BagFunctionUtil: () => BagFunctionUtil
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(PropsWithFunctionChildren_exports);
|
|
25
|
+
var resolve = (children, bag) => {
|
|
26
|
+
if (typeof children === "function") {
|
|
27
|
+
return children(bag);
|
|
28
|
+
}
|
|
29
|
+
return children ?? void 0;
|
|
30
|
+
};
|
|
31
|
+
var BagFunctionUtil = {
|
|
32
|
+
resolve
|
|
33
|
+
};
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
BagFunctionUtil
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=PropsWithFunctionChildren.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/util/PropsWithFunctionChildren.ts"],"sourcesContent":["import type { ReactNode } from 'react'\n\nexport type BagFunction<T> = (bag: T) => ReactNode\n\nexport type PropsWithBagFunction<T, P = unknown> = P & { children?: BagFunction<T> }\n\nexport type PropsWithBagFunctionOrChildren<T, P = unknown> = P & { children?: BagFunction<T> | ReactNode }\n\nconst resolve = <T>(children: BagFunction<T> | ReactNode, bag: T): ReactNode => {\n if (typeof children === 'function') {\n return (children as BagFunction<T>)(bag)\n }\n\n return children ?? undefined\n}\n\nexport const BagFunctionUtil = {\n resolve\n}"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,IAAM,UAAU,CAAI,UAAsC,QAAsB;AAC9E,MAAI,OAAO,aAAa,YAAY;AAClC,WAAQ,SAA4B,GAAG;AAAA,EACzC;AAEA,SAAO,YAAY;AACrB;AAEO,IAAM,kBAAkB;AAAA,EAC7B;AACF;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/util/PropsWithFunctionChildren.ts
|
|
2
|
+
var resolve = (children, bag) => {
|
|
3
|
+
if (typeof children === "function") {
|
|
4
|
+
return children(bag);
|
|
5
|
+
}
|
|
6
|
+
return children ?? void 0;
|
|
7
|
+
};
|
|
8
|
+
var BagFunctionUtil = {
|
|
9
|
+
resolve
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
BagFunctionUtil
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=PropsWithFunctionChildren.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/util/PropsWithFunctionChildren.ts"],"sourcesContent":["import type { ReactNode } from 'react'\n\nexport type BagFunction<T> = (bag: T) => ReactNode\n\nexport type PropsWithBagFunction<T, P = unknown> = P & { children?: BagFunction<T> }\n\nexport type PropsWithBagFunctionOrChildren<T, P = unknown> = P & { children?: BagFunction<T> | ReactNode }\n\nconst resolve = <T>(children: BagFunction<T> | ReactNode, bag: T): ReactNode => {\n if (typeof children === 'function') {\n return (children as BagFunction<T>)(bag)\n }\n\n return children ?? undefined\n}\n\nexport const BagFunctionUtil = {\n resolve\n}"],"mappings":";AAQA,IAAM,UAAU,CAAI,UAAsC,QAAsB;AAC9E,MAAI,OAAO,aAAa,YAAY;AAClC,WAAQ,SAA4B,GAAG;AAAA,EACzC;AAEA,SAAO,YAAY;AACrB;AAEO,IAAM,kBAAkB;AAAA,EAC7B;AACF;","names":[]}
|
|
@@ -19,11 +19,11 @@ declare const MultiSubjectSearchWithMapping: <T>(search: string[], objects: T[],
|
|
|
19
19
|
*
|
|
20
20
|
* @param objects The list of objects to be searched in
|
|
21
21
|
*
|
|
22
|
-
* @param mapping The mapping of objects to the string properties they fulfil
|
|
22
|
+
* @param mapping The mapping of objects to the string properties they fulfil, if undefined it is always fulfilled
|
|
23
23
|
*
|
|
24
24
|
* @return The list of objects that match the search string
|
|
25
25
|
*/
|
|
26
|
-
declare const MultiSearchWithMapping: <T>(search: string, objects: T[], mapping: (value: T) => string[]) => T[];
|
|
26
|
+
declare const MultiSearchWithMapping: <T>(search: string, objects: T[], mapping: (value: T) => (string[] | undefined)) => T[];
|
|
27
27
|
/**
|
|
28
28
|
* Finds all values matching the search value by first mapping the values to a string and returns the list of all matches.
|
|
29
29
|
*
|
|
@@ -19,11 +19,11 @@ declare const MultiSubjectSearchWithMapping: <T>(search: string[], objects: T[],
|
|
|
19
19
|
*
|
|
20
20
|
* @param objects The list of objects to be searched in
|
|
21
21
|
*
|
|
22
|
-
* @param mapping The mapping of objects to the string properties they fulfil
|
|
22
|
+
* @param mapping The mapping of objects to the string properties they fulfil, if undefined it is always fulfilled
|
|
23
23
|
*
|
|
24
24
|
* @return The list of objects that match the search string
|
|
25
25
|
*/
|
|
26
|
-
declare const MultiSearchWithMapping: <T>(search: string, objects: T[], mapping: (value: T) => string[]) => T[];
|
|
26
|
+
declare const MultiSearchWithMapping: <T>(search: string, objects: T[], mapping: (value: T) => (string[] | undefined)) => T[];
|
|
27
27
|
/**
|
|
28
28
|
* Finds all values matching the search value by first mapping the values to a string and returns the list of all matches.
|
|
29
29
|
*
|
|
@@ -33,7 +33,10 @@ var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
|
33
33
|
};
|
|
34
34
|
var MultiSearchWithMapping = (search, objects, mapping) => {
|
|
35
35
|
return objects.filter((object) => {
|
|
36
|
-
const mappedSearchKeywords = mapping(object)
|
|
36
|
+
const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
|
|
37
|
+
if (!mappedSearchKeywords) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
37
40
|
return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
|
|
38
41
|
});
|
|
39
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/util/simpleSearch.ts"],"sourcesContent":["/**\n * Finds all values matching the search values by first mapping the values to a string array and then checking each entry for matches.\n * Returns the list of all matches.\n *\n * @param search The list of search strings e.g. `[name, type]`\n *\n * @param objects The list of objects to be searched in\n *\n * @param mapping The mapping of objects to the string properties they fulfil\n *\n * @return The list of objects that match all search strings\n */\nexport const MultiSubjectSearchWithMapping = <T>(search: string[], objects: T[], mapping: (value: T) => (string | undefined)[]) => {\n return objects.filter(object => {\n const mappedSearchKeywords = mapping(object).map(value => value ? value.toLowerCase().trim() : undefined)\n return search.every(searchValue => !!mappedSearchKeywords.find(value => !!value && value.includes(searchValue.toLowerCase().trim())))\n })\n}\n\n/**\n * Finds all values matching the search value by first mapping the values to a string array and then checking each entry for matches.\n * Returns the list of all matches.\n *\n * @param search The search string e.g `name`\n *\n * @param objects The list of objects to be searched in\n *\n * @param mapping The mapping of objects to the string properties they fulfil\n *\n * @return The list of objects that match the search string\n */\nexport const MultiSearchWithMapping = <T>(search: string, objects: T[], mapping: (value: T) => string[]) => {\n return objects.filter(object => {\n const mappedSearchKeywords = mapping(object)
|
|
1
|
+
{"version":3,"sources":["../../src/util/simpleSearch.ts"],"sourcesContent":["/**\n * Finds all values matching the search values by first mapping the values to a string array and then checking each entry for matches.\n * Returns the list of all matches.\n *\n * @param search The list of search strings e.g. `[name, type]`\n *\n * @param objects The list of objects to be searched in\n *\n * @param mapping The mapping of objects to the string properties they fulfil\n *\n * @return The list of objects that match all search strings\n */\nexport const MultiSubjectSearchWithMapping = <T>(search: string[], objects: T[], mapping: (value: T) => (string | undefined)[]) => {\n return objects.filter(object => {\n const mappedSearchKeywords = mapping(object).map(value => value ? value.toLowerCase().trim() : undefined)\n return search.every(searchValue => !!mappedSearchKeywords.find(value => !!value && value.includes(searchValue.toLowerCase().trim())))\n })\n}\n\n/**\n * Finds all values matching the search value by first mapping the values to a string array and then checking each entry for matches.\n * Returns the list of all matches.\n *\n * @param search The search string e.g `name`\n *\n * @param objects The list of objects to be searched in\n *\n * @param mapping The mapping of objects to the string properties they fulfil, if undefined it is always fulfilled\n *\n * @return The list of objects that match the search string\n */\nexport const MultiSearchWithMapping = <T>(search: string, objects: T[], mapping: (value: T) => (string[] | undefined)) => {\n return objects.filter(object => {\n const mappedSearchKeywords = mapping(object)?.map(value => value.toLowerCase().trim())\n if(!mappedSearchKeywords) {\n return true\n }\n return !!mappedSearchKeywords.find(value => value.includes(search.toLowerCase().trim()))\n })\n}\n\n/**\n * Finds all values matching the search value by first mapping the values to a string and returns the list of all matches.\n *\n * @param search The search string e.g `name`\n *\n * @param objects The list of objects to be searched in\n *\n * @param mapping The mapping of objects to a string that is compared to the search\n *\n * @return The list of objects that match the search string\n */\nexport const SimpleSearchWithMapping = <T>(search: string, objects: T[], mapping: (value: T) => string) => {\n return MultiSearchWithMapping(search, objects, value => [mapping(value)])\n}\n\n/**\n * Finds all values matching the search value and returns the list of all matches.\n *\n * @param search The search string e.g `name`\n *\n * @param objects The list of objects to be searched in\n *\n * @return The list of objects that match the search string\n */\nexport const SimpleSearch = (search: string, objects: string[]) => {\n return SimpleSearchWithMapping(search, objects, value => value)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,IAAM,gCAAgC,CAAI,QAAkB,SAAc,YAAkD;AACjI,SAAO,QAAQ,OAAO,YAAU;AAC9B,UAAM,uBAAuB,QAAQ,MAAM,EAAE,IAAI,WAAS,QAAQ,MAAM,YAAY,EAAE,KAAK,IAAI,MAAS;AACxG,WAAO,OAAO,MAAM,iBAAe,CAAC,CAAC,qBAAqB,KAAK,WAAS,CAAC,CAAC,SAAS,MAAM,SAAS,YAAY,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;AAAA,EACtI,CAAC;AACH;AAcO,IAAM,yBAAyB,CAAI,QAAgB,SAAc,YAAkD;AACxH,SAAO,QAAQ,OAAO,YAAU;AAC9B,UAAM,uBAAuB,QAAQ,MAAM,GAAG,IAAI,WAAS,MAAM,YAAY,EAAE,KAAK,CAAC;AACrF,QAAG,CAAC,sBAAsB;AACxB,aAAO;AAAA,IACT;AACA,WAAO,CAAC,CAAC,qBAAqB,KAAK,WAAS,MAAM,SAAS,OAAO,YAAY,EAAE,KAAK,CAAC,CAAC;AAAA,EACzF,CAAC;AACH;AAaO,IAAM,0BAA0B,CAAI,QAAgB,SAAc,YAAkC;AACzG,SAAO,uBAAuB,QAAQ,SAAS,WAAS,CAAC,QAAQ,KAAK,CAAC,CAAC;AAC1E;AAWO,IAAM,eAAe,CAAC,QAAgB,YAAsB;AACjE,SAAO,wBAAwB,QAAQ,SAAS,WAAS,KAAK;AAChE;","names":[]}
|
|
@@ -7,7 +7,10 @@ var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
|
7
7
|
};
|
|
8
8
|
var MultiSearchWithMapping = (search, objects, mapping) => {
|
|
9
9
|
return objects.filter((object) => {
|
|
10
|
-
const mappedSearchKeywords = mapping(object)
|
|
10
|
+
const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
|
|
11
|
+
if (!mappedSearchKeywords) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
11
14
|
return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
|
|
12
15
|
});
|
|
13
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/util/simpleSearch.ts"],"sourcesContent":["/**\n * Finds all values matching the search values by first mapping the values to a string array and then checking each entry for matches.\n * Returns the list of all matches.\n *\n * @param search The list of search strings e.g. `[name, type]`\n *\n * @param objects The list of objects to be searched in\n *\n * @param mapping The mapping of objects to the string properties they fulfil\n *\n * @return The list of objects that match all search strings\n */\nexport const MultiSubjectSearchWithMapping = <T>(search: string[], objects: T[], mapping: (value: T) => (string | undefined)[]) => {\n return objects.filter(object => {\n const mappedSearchKeywords = mapping(object).map(value => value ? value.toLowerCase().trim() : undefined)\n return search.every(searchValue => !!mappedSearchKeywords.find(value => !!value && value.includes(searchValue.toLowerCase().trim())))\n })\n}\n\n/**\n * Finds all values matching the search value by first mapping the values to a string array and then checking each entry for matches.\n * Returns the list of all matches.\n *\n * @param search The search string e.g `name`\n *\n * @param objects The list of objects to be searched in\n *\n * @param mapping The mapping of objects to the string properties they fulfil\n *\n * @return The list of objects that match the search string\n */\nexport const MultiSearchWithMapping = <T>(search: string, objects: T[], mapping: (value: T) => string[]) => {\n return objects.filter(object => {\n const mappedSearchKeywords = mapping(object)
|
|
1
|
+
{"version":3,"sources":["../../src/util/simpleSearch.ts"],"sourcesContent":["/**\n * Finds all values matching the search values by first mapping the values to a string array and then checking each entry for matches.\n * Returns the list of all matches.\n *\n * @param search The list of search strings e.g. `[name, type]`\n *\n * @param objects The list of objects to be searched in\n *\n * @param mapping The mapping of objects to the string properties they fulfil\n *\n * @return The list of objects that match all search strings\n */\nexport const MultiSubjectSearchWithMapping = <T>(search: string[], objects: T[], mapping: (value: T) => (string | undefined)[]) => {\n return objects.filter(object => {\n const mappedSearchKeywords = mapping(object).map(value => value ? value.toLowerCase().trim() : undefined)\n return search.every(searchValue => !!mappedSearchKeywords.find(value => !!value && value.includes(searchValue.toLowerCase().trim())))\n })\n}\n\n/**\n * Finds all values matching the search value by first mapping the values to a string array and then checking each entry for matches.\n * Returns the list of all matches.\n *\n * @param search The search string e.g `name`\n *\n * @param objects The list of objects to be searched in\n *\n * @param mapping The mapping of objects to the string properties they fulfil, if undefined it is always fulfilled\n *\n * @return The list of objects that match the search string\n */\nexport const MultiSearchWithMapping = <T>(search: string, objects: T[], mapping: (value: T) => (string[] | undefined)) => {\n return objects.filter(object => {\n const mappedSearchKeywords = mapping(object)?.map(value => value.toLowerCase().trim())\n if(!mappedSearchKeywords) {\n return true\n }\n return !!mappedSearchKeywords.find(value => value.includes(search.toLowerCase().trim()))\n })\n}\n\n/**\n * Finds all values matching the search value by first mapping the values to a string and returns the list of all matches.\n *\n * @param search The search string e.g `name`\n *\n * @param objects The list of objects to be searched in\n *\n * @param mapping The mapping of objects to a string that is compared to the search\n *\n * @return The list of objects that match the search string\n */\nexport const SimpleSearchWithMapping = <T>(search: string, objects: T[], mapping: (value: T) => string) => {\n return MultiSearchWithMapping(search, objects, value => [mapping(value)])\n}\n\n/**\n * Finds all values matching the search value and returns the list of all matches.\n *\n * @param search The search string e.g `name`\n *\n * @param objects The list of objects to be searched in\n *\n * @return The list of objects that match the search string\n */\nexport const SimpleSearch = (search: string, objects: string[]) => {\n return SimpleSearchWithMapping(search, objects, value => value)\n}\n"],"mappings":";AAYO,IAAM,gCAAgC,CAAI,QAAkB,SAAc,YAAkD;AACjI,SAAO,QAAQ,OAAO,YAAU;AAC9B,UAAM,uBAAuB,QAAQ,MAAM,EAAE,IAAI,WAAS,QAAQ,MAAM,YAAY,EAAE,KAAK,IAAI,MAAS;AACxG,WAAO,OAAO,MAAM,iBAAe,CAAC,CAAC,qBAAqB,KAAK,WAAS,CAAC,CAAC,SAAS,MAAM,SAAS,YAAY,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;AAAA,EACtI,CAAC;AACH;AAcO,IAAM,yBAAyB,CAAI,QAAgB,SAAc,YAAkD;AACxH,SAAO,QAAQ,OAAO,YAAU;AAC9B,UAAM,uBAAuB,QAAQ,MAAM,GAAG,IAAI,WAAS,MAAM,YAAY,EAAE,KAAK,CAAC;AACrF,QAAG,CAAC,sBAAsB;AACxB,aAAO;AAAA,IACT;AACA,WAAO,CAAC,CAAC,qBAAqB,KAAK,WAAS,MAAM,SAAS,OAAO,YAAY,EAAE,KAAK,CAAC,CAAC;AAAA,EACzF,CAAC;AACH;AAaO,IAAM,0BAA0B,CAAI,QAAgB,SAAc,YAAkC;AACzG,SAAO,uBAAuB,QAAQ,SAAS,WAAS,CAAC,QAAQ,KAAK,CAAC,CAAC;AAC1E;AAWO,IAAM,eAAe,CAAC,QAAgB,YAAsB;AACjE,SAAO,wBAAwB,QAAQ,SAAS,WAAS,KAAK;AAChE;","names":[]}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"url": "git+https://github.com/helpwave/hightide.git"
|
|
8
8
|
},
|
|
9
9
|
"license": "MPL-2.0",
|
|
10
|
-
"version": "0.1.
|
|
10
|
+
"version": "0.1.8",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"generate-barrels": "barrelsby -c ./barrelsby-config.json -S -q"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@headlessui/react": "1.7.19",
|
|
36
35
|
"@radix-ui/react-checkbox": "1.1.3",
|
|
37
36
|
"@tailwindcss/cli": "^4.1.7",
|
|
38
37
|
"clsx": "^2.1.1",
|