@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
|
@@ -66,19 +66,34 @@ var useHoverState = (props = void 0) => {
|
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
+
// src/util/PropsWithFunctionChildren.ts
|
|
70
|
+
var resolve = (children, bag) => {
|
|
71
|
+
if (typeof children === "function") {
|
|
72
|
+
return children(bag);
|
|
73
|
+
}
|
|
74
|
+
return children ?? void 0;
|
|
75
|
+
};
|
|
76
|
+
var BagFunctionUtil = {
|
|
77
|
+
resolve
|
|
78
|
+
};
|
|
79
|
+
|
|
69
80
|
// src/components/user-action/Menu.tsx
|
|
70
81
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
71
82
|
var MenuItem = ({
|
|
72
83
|
children,
|
|
73
84
|
onClick,
|
|
74
85
|
alignment = "left",
|
|
86
|
+
isDisabled = false,
|
|
75
87
|
className
|
|
76
88
|
}) => /* @__PURE__ */ jsx(
|
|
77
89
|
"div",
|
|
78
90
|
{
|
|
79
|
-
className: clsx("block px-3 py-1 bg-menu-background
|
|
91
|
+
className: clsx("block px-3 py-1.5 bg-menu-background first:rounded-t-lg last:rounded-b-lg text-sm font-semibold", {
|
|
80
92
|
"text-right": alignment === "right",
|
|
81
|
-
"text-left": alignment === "left"
|
|
93
|
+
"text-left": alignment === "left",
|
|
94
|
+
"text-disabled-text cursor-not-allowed": isDisabled,
|
|
95
|
+
"text-menu-text hover:bg-primary/20": !isDisabled,
|
|
96
|
+
"cursor-pointer": !!onClick
|
|
82
97
|
}, className),
|
|
83
98
|
onClick,
|
|
84
99
|
children
|
|
@@ -95,6 +110,7 @@ var Menu = ({
|
|
|
95
110
|
const triggerRef = useRef(null);
|
|
96
111
|
const menuRef = useRef(null);
|
|
97
112
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
113
|
+
const bag = { isOpen, close: () => setIsOpen(false) };
|
|
98
114
|
return /* @__PURE__ */ jsxs(
|
|
99
115
|
"div",
|
|
100
116
|
{
|
|
@@ -102,20 +118,25 @@ var Menu = ({
|
|
|
102
118
|
...handlers,
|
|
103
119
|
children: [
|
|
104
120
|
trigger(() => setIsOpen(!isOpen), triggerRef),
|
|
105
|
-
|
|
121
|
+
/* @__PURE__ */ jsx(
|
|
106
122
|
"div",
|
|
107
123
|
{
|
|
108
124
|
ref: menuRef,
|
|
109
125
|
onClick: (e) => e.stopPropagation(),
|
|
110
|
-
className: clsx(
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
126
|
+
className: clsx(
|
|
127
|
+
"absolute top-full mt-1 min-w-40 rounded-lg bg-menu-background text-menu-text shadow-around-md z-10",
|
|
128
|
+
{
|
|
129
|
+
"top-0": alignment[0] === "t",
|
|
130
|
+
"bottom-0": alignment[0] === "b",
|
|
131
|
+
"left-0": alignment[1] === "l",
|
|
132
|
+
"right-0": alignment[1] === "r",
|
|
133
|
+
"hidden": !isOpen
|
|
134
|
+
},
|
|
135
|
+
menuClassName
|
|
136
|
+
),
|
|
137
|
+
children: BagFunctionUtil.resolve(children, bag)
|
|
117
138
|
}
|
|
118
|
-
)
|
|
139
|
+
)
|
|
119
140
|
]
|
|
120
141
|
}
|
|
121
142
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/user-action/Menu.tsx","../../../src/hooks/useOutsideClick.ts","../../../src/hooks/useHoverState.ts"],"sourcesContent":["import { type PropsWithChildren, type ReactNode, type RefObject, useRef } from 'react'\nimport clsx from 'clsx'\nimport { useOutsideClick } from '../../hooks/useOutsideClick'\nimport { useHoverState } from '../../hooks/useHoverState'\
|
|
1
|
+
{"version":3,"sources":["../../../src/components/user-action/Menu.tsx","../../../src/hooks/useOutsideClick.ts","../../../src/hooks/useHoverState.ts","../../../src/util/PropsWithFunctionChildren.ts"],"sourcesContent":["import { type PropsWithChildren, type ReactNode, type RefObject, useRef } from 'react'\nimport clsx from 'clsx'\nimport { useOutsideClick } from '../../hooks/useOutsideClick'\nimport { useHoverState } from '../../hooks/useHoverState'\nimport type { PropsWithBagFunctionOrChildren } from '../../util/PropsWithFunctionChildren'\nimport { BagFunctionUtil } from '../../util/PropsWithFunctionChildren'\n\nexport type MenuItemProps = {\n onClick?: () => void,\n alignment?: 'left' | 'right',\n isDisabled?: boolean,\n className?: string,\n}\nexport const MenuItem = ({\n children,\n onClick,\n alignment = 'left',\n isDisabled = false,\n className\n }: PropsWithChildren<MenuItemProps>) => (\n <div\n className={clsx('block px-3 py-1.5 bg-menu-background first:rounded-t-lg last:rounded-b-lg text-sm font-semibold', {\n 'text-right': alignment === 'right',\n 'text-left': alignment === 'left',\n 'text-disabled-text cursor-not-allowed': isDisabled,\n 'text-menu-text hover:bg-primary/20': !isDisabled,\n 'cursor-pointer': !!onClick,\n }, className)}\n onClick={onClick}\n >\n {children}\n </div>\n)\n\ntype MenuBag = {\n isOpen: boolean,\n close: () => void,\n}\n\nexport type MenuProps<T> = PropsWithBagFunctionOrChildren<MenuBag> & {\n trigger: (onClick: () => void, ref: RefObject<T>) => ReactNode,\n /**\n * @default 'tl'\n */\n alignment?: 'tl' | 'tr' | 'bl' | 'br' | '_l' | '_r' | 't_' | 'b_',\n showOnHover?: boolean,\n menuClassName?: string,\n}\n\n/**\n * A Menu Component to allow the user to see different functions\n */\nexport const Menu = <T extends HTMLElement>({\n trigger,\n children,\n alignment = 'tl',\n showOnHover = false,\n menuClassName = '',\n }: MenuProps<T>) => {\n const { isHovered: isOpen, setIsHovered: setIsOpen, handlers } = useHoverState({ isDisabled: !showOnHover })\n const triggerRef = useRef<T>(null)\n const menuRef = useRef<HTMLDivElement>(null)\n useOutsideClick([triggerRef, menuRef], () => setIsOpen(false))\n\n const bag: MenuBag = { isOpen, close: () => setIsOpen(false) }\n\n return (\n <div\n className=\"relative\"\n {...handlers}\n >\n {trigger(() => setIsOpen(!isOpen), triggerRef)}\n <div\n ref={menuRef}\n onClick={e => e.stopPropagation()}\n className={clsx(\n 'absolute top-full mt-1 min-w-40 rounded-lg bg-menu-background text-menu-text shadow-around-md z-10',\n {\n 'top-0': alignment[0] === 't',\n 'bottom-0': alignment[0] === 'b',\n 'left-0': alignment[1] === 'l',\n 'right-0': alignment[1] === 'r',\n 'hidden': !isOpen,\n },\n menuClassName\n )}\n >\n {BagFunctionUtil.resolve<MenuBag>(children, bag)}\n </div>\n </div>\n )\n}","import type { RefObject } from 'react'\nimport { useEffect } from 'react'\n\nexport const useOutsideClick = <Ts extends RefObject<HTMLElement>[]>(refs: Ts, handler: () => void) => {\n useEffect(() => {\n const listener = (event: MouseEvent | TouchEvent) => {\n // returning means not \"not clicking outside\"\n\n // if no target exists, return\n if (event.target === null) return\n // if the target is a ref's element or descendent thereof, return\n if (refs.some((ref) => !ref.current || ref.current.contains(event.target as Node))) {\n return\n }\n\n handler()\n }\n document.addEventListener('mousedown', listener)\n document.addEventListener('touchstart', listener)\n return () => {\n document.removeEventListener('mousedown', listener)\n document.removeEventListener('touchstart', listener)\n }\n }, [refs, handler])\n}\n","import type { Dispatch, SetStateAction } from 'react'\nimport { useEffect, useState } from 'react'\n\ntype UseHoverStateProps = {\n /**\n * The delay after which the menu is closed in milliseconds\n *\n * default: 200ms\n */\n closingDelay: number,\n /**\n * Whether the hover state management should be disabled\n *\n * default: false\n */\n isDisabled: boolean,\n}\n\ntype UseHoverStateReturnType = {\n /**\n * Whether the element is hovered\n */\n isHovered: boolean,\n /**\n * Function to change the current hover status\n */\n setIsHovered: Dispatch<SetStateAction<boolean>>,\n /**\n * Handlers to pass on to the component that should be hovered\n */\n handlers: {\n onMouseEnter: () => void,\n onMouseLeave: () => void,\n },\n}\n\nconst defaultUseHoverStateProps: UseHoverStateProps = {\n closingDelay: 200,\n isDisabled: false,\n}\n\n/**\n * @param props See UseHoverStateProps\n *\n * A react hook for managing the hover state of a component. The handlers provided should be\n * forwarded to the component which should be hovered over\n */\nexport const useHoverState = (props: Partial<UseHoverStateProps> | undefined = undefined): UseHoverStateReturnType => {\n const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props }\n\n const [isHovered, setIsHovered] = useState(false)\n const [timer, setTimer] = useState<NodeJS.Timeout>()\n\n const onMouseEnter = () => {\n if (isDisabled) {\n return\n }\n clearTimeout(timer)\n setIsHovered(true)\n }\n\n const onMouseLeave = () => {\n if (isDisabled) {\n return\n }\n setTimer(setTimeout(() => {\n setIsHovered(false)\n }, closingDelay))\n }\n\n useEffect(() => {\n if (timer) {\n return () => {\n clearTimeout(timer)\n }\n }\n })\n\n useEffect(() => {\n if (timer) {\n clearTimeout(timer)\n }\n }, [isDisabled]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return {\n isHovered, setIsHovered, handlers: { onMouseEnter, onMouseLeave }\n }\n}\n","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":"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","names":["useEffect"]}
|
|
@@ -2,6 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { PropsForTranslation } from '../../localization/useTranslation.mjs';
|
|
4
4
|
import { LabelProps } from './Label.mjs';
|
|
5
|
+
import { SelectOption } from './Select.mjs';
|
|
5
6
|
import '../../localization/util.mjs';
|
|
6
7
|
|
|
7
8
|
type MultiSelectTranslation = {
|
|
@@ -9,12 +10,8 @@ type MultiSelectTranslation = {
|
|
|
9
10
|
search: string;
|
|
10
11
|
selected: string;
|
|
11
12
|
};
|
|
12
|
-
type MultiSelectOption<T> = {
|
|
13
|
-
label: string;
|
|
14
|
-
value: T;
|
|
13
|
+
type MultiSelectOption<T> = SelectOption<T> & {
|
|
15
14
|
selected: boolean;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
className?: string;
|
|
18
15
|
};
|
|
19
16
|
type SearchProps<T> = {
|
|
20
17
|
initialSearch?: string;
|
|
@@ -22,22 +19,19 @@ type SearchProps<T> = {
|
|
|
22
19
|
};
|
|
23
20
|
type MultiSelectProps<T> = {
|
|
24
21
|
options: MultiSelectOption<T>[];
|
|
25
|
-
onChange: (options: MultiSelectOption<T>[]) => void;
|
|
26
|
-
search?: SearchProps<T>;
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
selectedDisplay?: (props: {
|
|
29
|
-
items: MultiSelectOption<T>[];
|
|
30
|
-
disabled: boolean;
|
|
31
|
-
}) => ReactNode;
|
|
32
22
|
label?: LabelProps;
|
|
23
|
+
onChange: (options: MultiSelectOption<T>[]) => void;
|
|
33
24
|
hintText?: string;
|
|
34
|
-
|
|
25
|
+
isDisabled?: boolean;
|
|
26
|
+
isSearchEnabled?: boolean;
|
|
35
27
|
className?: string;
|
|
36
|
-
|
|
28
|
+
useChipDisplay: boolean;
|
|
29
|
+
selectedDisplayOverwrite?: ReactNode;
|
|
37
30
|
};
|
|
38
31
|
/**
|
|
39
32
|
* A Component for multi selection
|
|
40
33
|
*/
|
|
41
|
-
declare const MultiSelect: <T>({ overwriteTranslation, options,
|
|
34
|
+
declare const MultiSelect: <T>({ overwriteTranslation, options, label, onChange, hintText, isDisabled, isSearchEnabled, selectedDisplayOverwrite, useChipDisplay, className, }: PropsForTranslation<MultiSelectTranslation, MultiSelectProps<T>>) => react_jsx_runtime.JSX.Element;
|
|
35
|
+
declare const MultiSelectUncontrolled: <T>({ options, onChange, ...props }: PropsForTranslation<MultiSelectTranslation, MultiSelectProps<T>>) => react_jsx_runtime.JSX.Element;
|
|
42
36
|
|
|
43
|
-
export { MultiSelect, type MultiSelectOption, type MultiSelectProps, type SearchProps };
|
|
37
|
+
export { MultiSelect, type MultiSelectOption, type MultiSelectProps, MultiSelectUncontrolled, type SearchProps };
|
|
@@ -2,6 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { PropsForTranslation } from '../../localization/useTranslation.js';
|
|
4
4
|
import { LabelProps } from './Label.js';
|
|
5
|
+
import { SelectOption } from './Select.js';
|
|
5
6
|
import '../../localization/util.js';
|
|
6
7
|
|
|
7
8
|
type MultiSelectTranslation = {
|
|
@@ -9,12 +10,8 @@ type MultiSelectTranslation = {
|
|
|
9
10
|
search: string;
|
|
10
11
|
selected: string;
|
|
11
12
|
};
|
|
12
|
-
type MultiSelectOption<T> = {
|
|
13
|
-
label: string;
|
|
14
|
-
value: T;
|
|
13
|
+
type MultiSelectOption<T> = SelectOption<T> & {
|
|
15
14
|
selected: boolean;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
className?: string;
|
|
18
15
|
};
|
|
19
16
|
type SearchProps<T> = {
|
|
20
17
|
initialSearch?: string;
|
|
@@ -22,22 +19,19 @@ type SearchProps<T> = {
|
|
|
22
19
|
};
|
|
23
20
|
type MultiSelectProps<T> = {
|
|
24
21
|
options: MultiSelectOption<T>[];
|
|
25
|
-
onChange: (options: MultiSelectOption<T>[]) => void;
|
|
26
|
-
search?: SearchProps<T>;
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
selectedDisplay?: (props: {
|
|
29
|
-
items: MultiSelectOption<T>[];
|
|
30
|
-
disabled: boolean;
|
|
31
|
-
}) => ReactNode;
|
|
32
22
|
label?: LabelProps;
|
|
23
|
+
onChange: (options: MultiSelectOption<T>[]) => void;
|
|
33
24
|
hintText?: string;
|
|
34
|
-
|
|
25
|
+
isDisabled?: boolean;
|
|
26
|
+
isSearchEnabled?: boolean;
|
|
35
27
|
className?: string;
|
|
36
|
-
|
|
28
|
+
useChipDisplay: boolean;
|
|
29
|
+
selectedDisplayOverwrite?: ReactNode;
|
|
37
30
|
};
|
|
38
31
|
/**
|
|
39
32
|
* A Component for multi selection
|
|
40
33
|
*/
|
|
41
|
-
declare const MultiSelect: <T>({ overwriteTranslation, options,
|
|
34
|
+
declare const MultiSelect: <T>({ overwriteTranslation, options, label, onChange, hintText, isDisabled, isSearchEnabled, selectedDisplayOverwrite, useChipDisplay, className, }: PropsForTranslation<MultiSelectTranslation, MultiSelectProps<T>>) => react_jsx_runtime.JSX.Element;
|
|
35
|
+
declare const MultiSelectUncontrolled: <T>({ options, onChange, ...props }: PropsForTranslation<MultiSelectTranslation, MultiSelectProps<T>>) => react_jsx_runtime.JSX.Element;
|
|
42
36
|
|
|
43
|
-
export { MultiSelect, type MultiSelectOption, type MultiSelectProps, type SearchProps };
|
|
37
|
+
export { MultiSelect, type MultiSelectOption, type MultiSelectProps, MultiSelectUncontrolled, type SearchProps };
|