@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.
Files changed (175) hide show
  1. package/dist/components/branding/HelpwaveBadge.js +30 -8
  2. package/dist/components/branding/HelpwaveBadge.js.map +1 -1
  3. package/dist/components/branding/HelpwaveBadge.mjs +30 -8
  4. package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
  5. package/dist/components/date/DatePicker.js +18 -20
  6. package/dist/components/date/DatePicker.js.map +1 -1
  7. package/dist/components/date/DatePicker.mjs +18 -20
  8. package/dist/components/date/DatePicker.mjs.map +1 -1
  9. package/dist/components/date/DayPicker.d.mts +1 -1
  10. package/dist/components/date/DayPicker.d.ts +1 -1
  11. package/dist/components/date/DayPicker.js +23 -11
  12. package/dist/components/date/DayPicker.js.map +1 -1
  13. package/dist/components/date/DayPicker.mjs +23 -11
  14. package/dist/components/date/DayPicker.mjs.map +1 -1
  15. package/dist/components/date/YearMonthPicker.js +106 -22
  16. package/dist/components/date/YearMonthPicker.js.map +1 -1
  17. package/dist/components/date/YearMonthPicker.mjs +106 -22
  18. package/dist/components/date/YearMonthPicker.mjs.map +1 -1
  19. package/dist/components/dialogs/ConfirmDialog.js +2 -2
  20. package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
  21. package/dist/components/dialogs/ConfirmDialog.mjs +2 -2
  22. package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
  23. package/dist/components/icons-and-geometry/Avatar.js +2 -2
  24. package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
  25. package/dist/components/icons-and-geometry/Avatar.mjs +2 -2
  26. package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
  27. package/dist/components/layout-and-navigation/Carousel.d.mts +1 -1
  28. package/dist/components/layout-and-navigation/Carousel.d.ts +1 -1
  29. package/dist/components/layout-and-navigation/Carousel.js +86 -28
  30. package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
  31. package/dist/components/layout-and-navigation/Carousel.mjs +86 -28
  32. package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
  33. package/dist/components/layout-and-navigation/Expandable.d.mts +3 -0
  34. package/dist/components/layout-and-navigation/Expandable.d.ts +3 -0
  35. package/dist/components/layout-and-navigation/Expandable.js +4 -3
  36. package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
  37. package/dist/components/layout-and-navigation/Expandable.mjs +4 -3
  38. package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
  39. package/dist/components/layout-and-navigation/FAQSection.js +4 -3
  40. package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
  41. package/dist/components/layout-and-navigation/FAQSection.mjs +4 -3
  42. package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
  43. package/dist/components/layout-and-navigation/Overlay.js +2 -2
  44. package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
  45. package/dist/components/layout-and-navigation/Overlay.mjs +2 -2
  46. package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
  47. package/dist/components/layout-and-navigation/SearchableList.d.mts +7 -6
  48. package/dist/components/layout-and-navigation/SearchableList.d.ts +7 -6
  49. package/dist/components/layout-and-navigation/SearchableList.js +114 -21
  50. package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
  51. package/dist/components/layout-and-navigation/SearchableList.mjs +114 -21
  52. package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
  53. package/dist/components/layout-and-navigation/StepperBar.js +6 -6
  54. package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
  55. package/dist/components/layout-and-navigation/StepperBar.mjs +6 -6
  56. package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
  57. package/dist/components/layout-and-navigation/Table.js +1 -1
  58. package/dist/components/layout-and-navigation/Table.js.map +1 -1
  59. package/dist/components/layout-and-navigation/Table.mjs +1 -1
  60. package/dist/components/layout-and-navigation/Table.mjs.map +1 -1
  61. package/dist/components/layout-and-navigation/Tile.d.mts +10 -15
  62. package/dist/components/layout-and-navigation/Tile.d.ts +10 -15
  63. package/dist/components/layout-and-navigation/Tile.js +30 -8
  64. package/dist/components/layout-and-navigation/Tile.js.map +1 -1
  65. package/dist/components/layout-and-navigation/Tile.mjs +30 -8
  66. package/dist/components/layout-and-navigation/Tile.mjs.map +1 -1
  67. package/dist/components/loading-states/ProgressIndicator.js +2 -2
  68. package/dist/components/loading-states/ProgressIndicator.js.map +1 -1
  69. package/dist/components/loading-states/ProgressIndicator.mjs +2 -2
  70. package/dist/components/loading-states/ProgressIndicator.mjs.map +1 -1
  71. package/dist/components/modals/ConfirmModal.js +2 -2
  72. package/dist/components/modals/ConfirmModal.js.map +1 -1
  73. package/dist/components/modals/ConfirmModal.mjs +2 -2
  74. package/dist/components/modals/ConfirmModal.mjs.map +1 -1
  75. package/dist/components/modals/DiscardChangesModal.js +2 -2
  76. package/dist/components/modals/DiscardChangesModal.js.map +1 -1
  77. package/dist/components/modals/DiscardChangesModal.mjs +2 -2
  78. package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
  79. package/dist/components/modals/InputModal.js +2 -2
  80. package/dist/components/modals/InputModal.js.map +1 -1
  81. package/dist/components/modals/InputModal.mjs +2 -2
  82. package/dist/components/modals/InputModal.mjs.map +1 -1
  83. package/dist/components/modals/LanguageModal.js +384 -150
  84. package/dist/components/modals/LanguageModal.js.map +1 -1
  85. package/dist/components/modals/LanguageModal.mjs +383 -149
  86. package/dist/components/modals/LanguageModal.mjs.map +1 -1
  87. package/dist/components/modals/ThemeModal.js +385 -154
  88. package/dist/components/modals/ThemeModal.js.map +1 -1
  89. package/dist/components/modals/ThemeModal.mjs +382 -151
  90. package/dist/components/modals/ThemeModal.mjs.map +1 -1
  91. package/dist/components/properties/CheckboxProperty.js +1 -1
  92. package/dist/components/properties/CheckboxProperty.js.map +1 -1
  93. package/dist/components/properties/CheckboxProperty.mjs +1 -1
  94. package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
  95. package/dist/components/properties/DateProperty.js +1 -1
  96. package/dist/components/properties/DateProperty.js.map +1 -1
  97. package/dist/components/properties/DateProperty.mjs +1 -1
  98. package/dist/components/properties/DateProperty.mjs.map +1 -1
  99. package/dist/components/properties/MultiSelectProperty.d.mts +1 -0
  100. package/dist/components/properties/MultiSelectProperty.d.ts +1 -0
  101. package/dist/components/properties/MultiSelectProperty.js +482 -430
  102. package/dist/components/properties/MultiSelectProperty.js.map +1 -1
  103. package/dist/components/properties/MultiSelectProperty.mjs +478 -426
  104. package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
  105. package/dist/components/properties/NumberProperty.js +1 -1
  106. package/dist/components/properties/NumberProperty.js.map +1 -1
  107. package/dist/components/properties/NumberProperty.mjs +1 -1
  108. package/dist/components/properties/NumberProperty.mjs.map +1 -1
  109. package/dist/components/properties/PropertyBase.js +1 -1
  110. package/dist/components/properties/PropertyBase.js.map +1 -1
  111. package/dist/components/properties/PropertyBase.mjs +1 -1
  112. package/dist/components/properties/PropertyBase.mjs.map +1 -1
  113. package/dist/components/properties/SelectProperty.d.mts +3 -3
  114. package/dist/components/properties/SelectProperty.d.ts +3 -3
  115. package/dist/components/properties/SelectProperty.js +404 -263
  116. package/dist/components/properties/SelectProperty.js.map +1 -1
  117. package/dist/components/properties/SelectProperty.mjs +404 -263
  118. package/dist/components/properties/SelectProperty.mjs.map +1 -1
  119. package/dist/components/properties/TextProperty.js +1 -1
  120. package/dist/components/properties/TextProperty.js.map +1 -1
  121. package/dist/components/properties/TextProperty.mjs +1 -1
  122. package/dist/components/properties/TextProperty.mjs.map +1 -1
  123. package/dist/components/user-action/DateAndTimePicker.js +18 -20
  124. package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
  125. package/dist/components/user-action/DateAndTimePicker.mjs +18 -20
  126. package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
  127. package/dist/components/user-action/Menu.d.mts +14 -8
  128. package/dist/components/user-action/Menu.d.ts +14 -8
  129. package/dist/components/user-action/Menu.js +32 -11
  130. package/dist/components/user-action/Menu.js.map +1 -1
  131. package/dist/components/user-action/Menu.mjs +32 -11
  132. package/dist/components/user-action/Menu.mjs.map +1 -1
  133. package/dist/components/user-action/MultiSelect.d.mts +10 -16
  134. package/dist/components/user-action/MultiSelect.d.ts +10 -16
  135. package/dist/components/user-action/MultiSelect.js +485 -312
  136. package/dist/components/user-action/MultiSelect.js.map +1 -1
  137. package/dist/components/user-action/MultiSelect.mjs +482 -310
  138. package/dist/components/user-action/MultiSelect.mjs.map +1 -1
  139. package/dist/components/user-action/Select.d.mts +5 -18
  140. package/dist/components/user-action/Select.d.ts +5 -18
  141. package/dist/components/user-action/Select.js +309 -113
  142. package/dist/components/user-action/Select.js.map +1 -1
  143. package/dist/components/user-action/Select.mjs +304 -107
  144. package/dist/components/user-action/Select.mjs.map +1 -1
  145. package/dist/components/user-action/Tooltip.js +2 -2
  146. package/dist/components/user-action/Tooltip.js.map +1 -1
  147. package/dist/components/user-action/Tooltip.mjs +2 -2
  148. package/dist/components/user-action/Tooltip.mjs.map +1 -1
  149. package/dist/css/globals.css +213 -205
  150. package/dist/css/uncompiled/globals.css +136 -72
  151. package/dist/hooks/useSearch.d.mts +17 -0
  152. package/dist/hooks/useSearch.d.ts +17 -0
  153. package/dist/hooks/useSearch.js +66 -0
  154. package/dist/hooks/useSearch.js.map +1 -0
  155. package/dist/hooks/useSearch.mjs +42 -0
  156. package/dist/hooks/useSearch.mjs.map +1 -0
  157. package/dist/index.d.mts +7 -5
  158. package/dist/index.d.ts +7 -5
  159. package/dist/index.js +555 -463
  160. package/dist/index.js.map +1 -1
  161. package/dist/index.mjs +517 -427
  162. package/dist/index.mjs.map +1 -1
  163. package/dist/util/PropsWithFunctionChildren.d.mts +14 -0
  164. package/dist/util/PropsWithFunctionChildren.d.ts +14 -0
  165. package/dist/util/PropsWithFunctionChildren.js +38 -0
  166. package/dist/util/PropsWithFunctionChildren.js.map +1 -0
  167. package/dist/util/PropsWithFunctionChildren.mjs +14 -0
  168. package/dist/util/PropsWithFunctionChildren.mjs.map +1 -0
  169. package/dist/util/simpleSearch.d.mts +2 -2
  170. package/dist/util/simpleSearch.d.ts +2 -2
  171. package/dist/util/simpleSearch.js +4 -1
  172. package/dist/util/simpleSearch.js.map +1 -1
  173. package/dist/util/simpleSearch.mjs +4 -1
  174. package/dist/util/simpleSearch.mjs.map +1 -1
  175. 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).map((value) => value.toLowerCase().trim());
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).map(value => value.toLowerCase().trim())\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,YAAoC;AAC1G,SAAO,QAAQ,OAAO,YAAU;AAC9B,UAAM,uBAAuB,QAAQ,MAAM,EAAE,IAAI,WAAS,MAAM,YAAY,EAAE,KAAK,CAAC;AACpF,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":[]}
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).map((value) => value.toLowerCase().trim());
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).map(value => value.toLowerCase().trim())\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,YAAoC;AAC1G,SAAO,QAAQ,OAAO,YAAU;AAC9B,UAAM,uBAAuB,QAAQ,MAAM,EAAE,IAAI,WAAS,MAAM,YAAY,EAAE,KAAK,CAAC;AACpF,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":[]}
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.7",
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",