@povio/ui 2.2.9-rc.3 → 2.2.9-rc.30
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/buttons/Button/Button.d.ts +2 -1
- package/dist/components/buttons/Button/Button.js +41 -32
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +2 -2
- package/dist/components/inputs/Checkbox/Checkbox.js +6 -1
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +8 -3
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +88 -6
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +7 -2
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +91 -6
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +8 -2
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +91 -7
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +2 -1
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +73 -4
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +23 -6
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +3 -3
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/DateField.js +3 -10
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +6 -2
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +65 -55
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +14 -0
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +19 -6
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +4 -2
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +4 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +7 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +13 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +6 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +21 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.js +9 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +35 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +80 -0
- package/dist/components/inputs/File/FileUpload.js +1 -0
- package/dist/components/inputs/File/shared/InputUploadContent.js +1 -0
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormFieldHeader.js +3 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +6 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +11 -0
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +85 -7
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +38 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +318 -0
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +88 -7
- package/dist/components/inputs/Input/shared/InputContent.js +7 -6
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
- package/dist/components/inputs/Inputs/InputItem.d.ts +15 -18
- package/dist/components/inputs/Inputs/InputItem.js +2 -0
- package/dist/components/inputs/RadioGroup/RadioGroup.js +17 -9
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +3 -0
- package/dist/components/inputs/RadioGroup/radio.cva.js +2 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +104 -6
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +15 -10
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +25 -19
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +3 -4
- package/dist/components/inputs/Selection/Select/QuerySelect.js +8 -35
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +119 -4
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +4 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +3 -2
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +8 -4
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +13 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +3 -3
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +5 -3
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +27 -4
- package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +3 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +37 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +68 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +171 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +1 -0
- package/dist/components/inputs/Toggle/Toggle.js +6 -1
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/components/inputs/shared/CheckContent.js +3 -4
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +13 -1
- package/dist/components/inputs/shared/StaticInput.d.ts +38 -0
- package/dist/components/inputs/shared/StaticInput.js +104 -0
- package/dist/components/inputs/shared/TooltipWrapper.js +5 -1
- package/dist/components/inputs/shared/input.cva.d.ts +10 -0
- package/dist/components/inputs/shared/input.cva.js +19 -1
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +4 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
- package/dist/config/uiConfig.context.d.ts +8 -2
- package/dist/config/uiConfig.context.js +12 -1
- package/dist/config/uiStyle.context.d.ts +20 -3
- package/dist/helpers/dynamicInputs.d.ts +1 -1
- package/dist/helpers/dynamicInputs.js +3 -0
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +29 -10
- package/dist/hooks/useQueryAutocomplete.d.ts +5 -16
- package/dist/hooks/useQueryAutocomplete.js +13 -3
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4 -2
- package/dist/utils/date-time.utils.d.ts +30 -9
- package/dist/utils/date-time.utils.js +113 -1
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
|
2
2
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
3
3
|
import { FormFieldError } from "../FormField/FormFieldError.js";
|
|
4
4
|
import { CheckContent } from "../shared/CheckContent.js";
|
|
5
|
-
import { toggle, toggleTypography } from "./toggle.cva.js";
|
|
5
|
+
import { toggle, toggleContentClassName, toggleTypography } from "./toggle.cva.js";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { clsx } from "clsx";
|
|
8
8
|
import { Switch } from "react-aria-components";
|
|
@@ -13,6 +13,7 @@ var ToggleBase = (props) => {
|
|
|
13
13
|
const ui = UIConfig.useConfig();
|
|
14
14
|
const toggleCva = UIStyle.useCva("toggle.cva", toggle);
|
|
15
15
|
const toggleTypographyMap = UIStyle.useMapper("toggle.typography", toggleTypography);
|
|
16
|
+
const toggleContentClassNameMap = UIStyle.useMapper("toggle.contentClassName", toggleContentClassName);
|
|
16
17
|
const { className, children, isDisabled, error, variant = ui.toggle.variant, ...rest } = props;
|
|
17
18
|
const formFieldErrorProps = {
|
|
18
19
|
error,
|
|
@@ -32,6 +33,10 @@ var ToggleBase = (props) => {
|
|
|
32
33
|
variant,
|
|
33
34
|
...rest
|
|
34
35
|
}),
|
|
36
|
+
contentClassName: toggleContentClassNameMap({
|
|
37
|
+
variant,
|
|
38
|
+
...rest
|
|
39
|
+
}),
|
|
35
40
|
children
|
|
36
41
|
})]
|
|
37
42
|
}), /* @__PURE__ */ jsx(FormFieldError, { ...formFieldErrorProps })] });
|
|
@@ -8,3 +8,6 @@ export interface ToggleVariantProps extends VariantProps<typeof toggle> {
|
|
|
8
8
|
export declare const toggleTypography: (props: {
|
|
9
9
|
variant?: "default" | null | undefined;
|
|
10
10
|
}) => TypographyVariantProps | undefined;
|
|
11
|
+
export declare const toggleContentClassName: (props: {
|
|
12
|
+
variant?: "default" | null | undefined;
|
|
13
|
+
}) => string | undefined;
|
|
@@ -26,5 +26,6 @@ var toggleTypography = compoundMapper({ default: {
|
|
|
26
26
|
sizeMobile: "label-1",
|
|
27
27
|
variant: "default"
|
|
28
28
|
} });
|
|
29
|
+
var toggleContentClassName = compoundMapper({ default: "text-text-default-2" });
|
|
29
30
|
//#endregion
|
|
30
|
-
export { toggle, toggleTypography };
|
|
31
|
+
export { toggle, toggleContentClassName, toggleTypography };
|
|
@@ -3,6 +3,7 @@ import { TypographyVariantProps } from '../../text/Typography/typography.cva';
|
|
|
3
3
|
interface CheckContentProps {
|
|
4
4
|
typography?: TypographyVariantProps;
|
|
5
5
|
className?: string;
|
|
6
|
+
contentClassName?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare const CheckContent: ({ children, className, ...props }: PropsWithChildren<CheckContentProps>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const CheckContent: ({ children, className, contentClassName, ...props }: PropsWithChildren<CheckContentProps>) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -3,15 +3,14 @@ import { typography } from "../../text/Typography/typography.cva.js";
|
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import clsx$1 from "clsx";
|
|
5
5
|
//#region src/components/inputs/shared/CheckContent.tsx
|
|
6
|
-
var CheckContent = ({ children, className, ...props }) => {
|
|
6
|
+
var CheckContent = ({ children, className, contentClassName, ...props }) => {
|
|
7
7
|
return /* @__PURE__ */ jsx("div", {
|
|
8
8
|
className: clsx$1(UIStyle.useCva("typography.cva", typography)({
|
|
9
9
|
size: "label-1",
|
|
10
10
|
sizeMobile: "label-1",
|
|
11
11
|
variant: "default",
|
|
12
|
-
...props.typography
|
|
13
|
-
|
|
14
|
-
}), className),
|
|
12
|
+
...props.typography
|
|
13
|
+
}), contentClassName, className),
|
|
15
14
|
children
|
|
16
15
|
});
|
|
17
16
|
};
|
|
@@ -2,8 +2,9 @@ import { CSSProperties } from 'react';
|
|
|
2
2
|
interface InputClearProps {
|
|
3
3
|
onClear: () => void;
|
|
4
4
|
show?: boolean;
|
|
5
|
+
renderStatic?: boolean;
|
|
5
6
|
className?: string;
|
|
6
7
|
style?: CSSProperties;
|
|
7
8
|
}
|
|
8
|
-
export declare const InputClear: ({ onClear, className, style, show }: InputClearProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const InputClear: ({ onClear, className, style, show, renderStatic }: InputClearProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -5,7 +5,19 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import { clsx } from "clsx";
|
|
6
6
|
import { useTranslation } from "react-i18next";
|
|
7
7
|
//#region src/components/inputs/shared/InputClear.tsx
|
|
8
|
-
var InputClear = ({ onClear, className, style, show }) => {
|
|
8
|
+
var InputClear = ({ onClear, className, style, show, renderStatic }) => {
|
|
9
|
+
if (renderStatic) return /* @__PURE__ */ jsx("div", {
|
|
10
|
+
className: clsx("size-6 shrink-0", className),
|
|
11
|
+
style
|
|
12
|
+
});
|
|
13
|
+
return /* @__PURE__ */ jsx(InputClearButton, {
|
|
14
|
+
onClear,
|
|
15
|
+
className,
|
|
16
|
+
style,
|
|
17
|
+
show
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
var InputClearButton = ({ onClear, className, style, show }) => {
|
|
9
21
|
const { t } = useTranslation("ui");
|
|
10
22
|
return /* @__PURE__ */ jsx(InlineIconButton, {
|
|
11
23
|
color: "secondary",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FormFieldProps } from '../FormField/FormField';
|
|
3
|
+
import { TextInputProps } from '../Input/TextInput/TextInput';
|
|
4
|
+
import { InputSizeProps, InputVariantProps } from './input.cva';
|
|
5
|
+
import { TypographyVariantProps } from '../../text/Typography/typography.cva';
|
|
6
|
+
type StaticInputDataAttributes = {
|
|
7
|
+
dataDisabled?: boolean;
|
|
8
|
+
dataHasSearch?: boolean;
|
|
9
|
+
dataHasSelection?: boolean;
|
|
10
|
+
dataInvalid?: boolean;
|
|
11
|
+
dataIsDirty?: boolean;
|
|
12
|
+
dataIsDisabled?: boolean;
|
|
13
|
+
dataIsEmpty?: boolean;
|
|
14
|
+
dataIsFilled?: boolean;
|
|
15
|
+
dataIsRequired?: boolean;
|
|
16
|
+
};
|
|
17
|
+
interface StaticInputProps extends FormFieldProps {
|
|
18
|
+
onInteract: (shouldFocus: boolean) => void;
|
|
19
|
+
as?: TextInputProps["as"];
|
|
20
|
+
typographySize?: TypographyVariantProps["size"];
|
|
21
|
+
size?: InputSizeProps["size"];
|
|
22
|
+
variant?: InputVariantProps["variant"];
|
|
23
|
+
applyMinInputWidth?: boolean;
|
|
24
|
+
placeholder?: ReactNode;
|
|
25
|
+
showPlacholderIfFilled?: boolean;
|
|
26
|
+
displayValue?: ReactNode;
|
|
27
|
+
isEmpty?: boolean;
|
|
28
|
+
leadingVisual?: ReactNode;
|
|
29
|
+
leadingContent?: ReactNode;
|
|
30
|
+
leadingContentClassName?: string;
|
|
31
|
+
hasClearIcon?: boolean;
|
|
32
|
+
trailingContent?: ReactNode;
|
|
33
|
+
contentRowClassName?: string;
|
|
34
|
+
inputClassName?: string;
|
|
35
|
+
dataAttributes?: StaticInputDataAttributes;
|
|
36
|
+
}
|
|
37
|
+
export declare const StaticInput: ({ onInteract, as, typographySize, size, variant, applyMinInputWidth, placeholder, showPlacholderIfFilled, displayValue, isEmpty, leadingVisual, leadingContent, leadingContentClassName, hasClearIcon, trailingContent, contentRowClassName, inputClassName, dataAttributes, className, ...formFieldProps }: StaticInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
2
|
+
import { typography } from "../../text/Typography/typography.cva.js";
|
|
3
|
+
import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
|
|
4
|
+
import { inputBase, inputSize } from "./input.cva.js";
|
|
5
|
+
import { FormField } from "../FormField/FormField.js";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { clsx } from "clsx";
|
|
8
|
+
//#region src/components/inputs/shared/StaticInput.tsx
|
|
9
|
+
var StaticInput = ({ onInteract, as, typographySize, size, variant, applyMinInputWidth, placeholder, showPlacholderIfFilled = false, displayValue, isEmpty, leadingVisual, leadingContent, leadingContentClassName, hasClearIcon, trailingContent, contentRowClassName, inputClassName, dataAttributes, className, ...formFieldProps }) => {
|
|
10
|
+
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
11
|
+
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
12
|
+
const typographyCva = UIStyle.useCva("typography.cva", typography);
|
|
13
|
+
let hasValue = !!displayValue;
|
|
14
|
+
if (isEmpty != null) hasValue = !isEmpty;
|
|
15
|
+
let staticDisplayContent = placeholder;
|
|
16
|
+
if (hasValue) staticDisplayContent = displayValue;
|
|
17
|
+
else if (as === "floating") staticDisplayContent = null;
|
|
18
|
+
const shouldRenderPlaceholderAfterValue = showPlacholderIfFilled && placeholder && hasValue;
|
|
19
|
+
const shouldRenderFloatingLineSpacer = as === "floating" && !hasValue;
|
|
20
|
+
const inputDataAttributes = {
|
|
21
|
+
dataIsEmpty: !hasValue,
|
|
22
|
+
dataDisabled: formFieldProps.isDisabled,
|
|
23
|
+
dataIsDisabled: formFieldProps.isDisabled,
|
|
24
|
+
dataHasSelection: hasValue,
|
|
25
|
+
...dataAttributes
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ jsx(FormField, {
|
|
28
|
+
...formFieldProps,
|
|
29
|
+
as,
|
|
30
|
+
className,
|
|
31
|
+
onMouseEnter: () => onInteract(false),
|
|
32
|
+
tabIndex: as === "inline" ? -1 : void 0,
|
|
33
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
34
|
+
tabIndex: formFieldProps.isDisabled ? -1 : 0,
|
|
35
|
+
onFocus: () => onInteract(true),
|
|
36
|
+
onClick: () => onInteract(true),
|
|
37
|
+
onPointerDown: () => onInteract(true),
|
|
38
|
+
"data-is-empty": inputDataAttributes.dataIsEmpty || void 0,
|
|
39
|
+
"data-disabled": inputDataAttributes.dataDisabled || void 0,
|
|
40
|
+
"data-is-disabled": inputDataAttributes.dataIsDisabled || void 0,
|
|
41
|
+
"data-has-selection": inputDataAttributes.dataHasSelection || void 0,
|
|
42
|
+
"data-has-search": inputDataAttributes.dataHasSearch || void 0,
|
|
43
|
+
"data-invalid": inputDataAttributes.dataInvalid || void 0,
|
|
44
|
+
"data-is-dirty": inputDataAttributes.dataIsDirty || void 0,
|
|
45
|
+
"data-is-filled": inputDataAttributes.dataIsFilled || void 0,
|
|
46
|
+
"data-is-required": inputDataAttributes.dataIsRequired || void 0,
|
|
47
|
+
"data-rac": "",
|
|
48
|
+
className: clsx("group/static-input group/input-content group/select-content relative flex items-center gap-input-gap-input-text-to-elements", applyMinInputWidth && "min-w-input-width-min-width", inputBaseCva({
|
|
49
|
+
as,
|
|
50
|
+
variant
|
|
51
|
+
}), inputClassName),
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsxs("div", {
|
|
54
|
+
className: clsx("group/input-content flex min-w-0 w-full items-center gap-input-gap-input-text-to-elements pr-0!", inputSizeCva({
|
|
55
|
+
size,
|
|
56
|
+
as
|
|
57
|
+
}), typographySize && typographyCva({ size: typographySize }), contentRowClassName),
|
|
58
|
+
children: [
|
|
59
|
+
leadingVisual && /* @__PURE__ */ jsx("div", {
|
|
60
|
+
className: "pointer-events-none shrink-0",
|
|
61
|
+
children: leadingVisual
|
|
62
|
+
}),
|
|
63
|
+
as && ["filter", "floating"].includes(as) && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
64
|
+
as,
|
|
65
|
+
size,
|
|
66
|
+
label: formFieldProps.label,
|
|
67
|
+
isRequired: formFieldProps.isRequired,
|
|
68
|
+
isDisabled: formFieldProps.isDisabled
|
|
69
|
+
}),
|
|
70
|
+
leadingContent && /* @__PURE__ */ jsx("div", {
|
|
71
|
+
className: clsx("ml-input-side-default flex shrink-0 items-center", leadingContentClassName),
|
|
72
|
+
children: leadingContent
|
|
73
|
+
}),
|
|
74
|
+
!hasValue ? /* @__PURE__ */ jsx("div", {
|
|
75
|
+
className: "text-text-default-3",
|
|
76
|
+
children: staticDisplayContent
|
|
77
|
+
}) : staticDisplayContent,
|
|
78
|
+
shouldRenderFloatingLineSpacer && /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }),
|
|
79
|
+
shouldRenderPlaceholderAfterValue && /* @__PURE__ */ jsx("div", {
|
|
80
|
+
className: "shrink-0 text-text-default-3",
|
|
81
|
+
children: placeholder
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
}),
|
|
85
|
+
hasClearIcon && /* @__PURE__ */ jsx("div", {
|
|
86
|
+
className: clsx("flex items-center gap-input-gap-trailing-elements py-0! pl-0!", inputSizeCva({
|
|
87
|
+
size,
|
|
88
|
+
as
|
|
89
|
+
})),
|
|
90
|
+
children: /* @__PURE__ */ jsx("div", { className: "size-6 shrink-0" })
|
|
91
|
+
}),
|
|
92
|
+
trailingContent && /* @__PURE__ */ jsx("div", {
|
|
93
|
+
className: clsx(inputSizeCva({
|
|
94
|
+
size,
|
|
95
|
+
as
|
|
96
|
+
}), "pointer-events-none flex items-center gap-input-gap-trailing-elements py-0! pl-0!"),
|
|
97
|
+
children: trailingContent
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
//#endregion
|
|
104
|
+
export { StaticInput };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
1
2
|
import { Tooltip } from "../../overlays/Tooltip/Tooltip.js";
|
|
3
|
+
import { tooltipWrapperTrigger } from "./tooltipWrapper.cva.js";
|
|
2
4
|
import { jsx } from "react/jsx-runtime";
|
|
3
5
|
//#region src/components/inputs/shared/TooltipWrapper.tsx
|
|
4
6
|
var TooltipWrapper = (props) => {
|
|
7
|
+
const tooltipWrapperTriggerCva = UIStyle.useCva("tooltipWrapper.triggerCva", tooltipWrapperTrigger);
|
|
5
8
|
if (props.as !== "inline") return props.children;
|
|
6
9
|
return /* @__PURE__ */ jsx(Tooltip, {
|
|
7
10
|
text: props.error || void 0,
|
|
@@ -9,10 +12,11 @@ var TooltipWrapper = (props) => {
|
|
|
9
12
|
color: "error",
|
|
10
13
|
hidden: !props.error,
|
|
11
14
|
isNonInteractiveTrigger: true,
|
|
12
|
-
triggerClassName: props.triggerClassName,
|
|
15
|
+
triggerClassName: tooltipWrapperTriggerCva({ className: props.triggerClassName }),
|
|
13
16
|
triggerTabIndex: props.triggerTabIndex,
|
|
14
17
|
children: /* @__PURE__ */ jsx("div", {
|
|
15
18
|
tabIndex: -1,
|
|
19
|
+
className: tooltipWrapperTriggerCva({}),
|
|
16
20
|
children: props.children
|
|
17
21
|
})
|
|
18
22
|
});
|
|
@@ -12,6 +12,16 @@ export declare const inputSize: (props?: ({
|
|
|
12
12
|
} & ClassProp) | undefined) => string;
|
|
13
13
|
export interface InputSizeProps extends VariantProps<typeof inputSize> {
|
|
14
14
|
}
|
|
15
|
+
export declare const inputContentWrapper: (props?: ({
|
|
16
|
+
as?: "filter" | "default" | "floating" | "inline" | null | undefined;
|
|
17
|
+
} & ClassProp) | undefined) => string;
|
|
18
|
+
export interface InputContentWrapperProps extends VariantProps<typeof inputContentWrapper> {
|
|
19
|
+
}
|
|
20
|
+
export declare const inputClearClass: (props?: ({
|
|
21
|
+
as?: "filter" | "default" | "floating" | "inline" | null | undefined;
|
|
22
|
+
} & ClassProp) | undefined) => string;
|
|
23
|
+
export interface InputClearClassProps extends VariantProps<typeof inputClearClass> {
|
|
24
|
+
}
|
|
15
25
|
export declare const inputSide: (props?: ({
|
|
16
26
|
size?: "small" | "default" | "extra-small" | "large" | null | undefined;
|
|
17
27
|
type?: "left" | "right" | "var" | null | undefined;
|
|
@@ -191,6 +191,24 @@ var inputSize = cva("", {
|
|
|
191
191
|
as: "default"
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
|
+
var inputContentWrapper = cva("flex w-full", {
|
|
195
|
+
variants: { as: {
|
|
196
|
+
default: "",
|
|
197
|
+
floating: "flex-col",
|
|
198
|
+
filter: "gap-input-gap-input-text-to-elements",
|
|
199
|
+
inline: ""
|
|
200
|
+
} },
|
|
201
|
+
defaultVariants: { as: "default" }
|
|
202
|
+
});
|
|
203
|
+
var inputClearClass = cva("", {
|
|
204
|
+
variants: { as: {
|
|
205
|
+
default: "",
|
|
206
|
+
floating: "",
|
|
207
|
+
filter: "",
|
|
208
|
+
inline: ""
|
|
209
|
+
} },
|
|
210
|
+
defaultVariants: { as: "default" }
|
|
211
|
+
});
|
|
194
212
|
var inputSide = cva("", {
|
|
195
213
|
variants: {
|
|
196
214
|
size: {
|
|
@@ -277,4 +295,4 @@ var useInputCva = () => {
|
|
|
277
295
|
};
|
|
278
296
|
};
|
|
279
297
|
//#endregion
|
|
280
|
-
export { inputBase, inputSide, inputSize, useInputCva };
|
|
298
|
+
export { inputBase, inputClearClass, inputContentWrapper, inputSide, inputSize, useInputCva };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const tooltipWrapperTrigger: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
3
|
+
export interface TooltipWrapperTriggerVariantProps extends VariantProps<typeof tooltipWrapperTrigger> {
|
|
4
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
2
|
import { ButtonProps } from '../components/buttons/Button/Button';
|
|
3
3
|
import { CheckboxProps } from '../components/inputs/Checkbox/Checkbox';
|
|
4
4
|
import { DatePickerProps } from '../components/inputs/DateTime/DatePicker/DatePicker';
|
|
@@ -19,6 +19,7 @@ export declare namespace UIConfig {
|
|
|
19
19
|
[P in keyof T]-?: T[P] extends object ? DeepRequired<T[P]> : Exclude<T[P], null | undefined>;
|
|
20
20
|
};
|
|
21
21
|
export interface Options {
|
|
22
|
+
renderStaticInput: boolean;
|
|
22
23
|
input: Pick<TextInputProps, "variant" | "isClearable" | "hideLabel" | "as" | "size">;
|
|
23
24
|
button: Pick<ButtonProps, "variant" | "size">;
|
|
24
25
|
numberInput: Pick<NumberInputProps, "formatOptions">;
|
|
@@ -33,7 +34,12 @@ export declare namespace UIConfig {
|
|
|
33
34
|
};
|
|
34
35
|
toggle: Pick<ToggleProps, "variant">;
|
|
35
36
|
slider: Pick<SliderProps, "minValue" | "maxValue">;
|
|
36
|
-
dateInput: Pick<DatePickerProps, "todayIcon" | "shouldForceLeadingZeros" | "disableManualEntry"
|
|
37
|
+
dateInput: Pick<DatePickerProps, "todayIcon" | "todayIconButtonSize" | "todayIconPlacement" | "shouldForceLeadingZeros" | "disableManualEntry" | "autoFixYear"> & {
|
|
38
|
+
calendarIcon?: ReactElement;
|
|
39
|
+
dateTimeIcon?: ReactElement;
|
|
40
|
+
timeIcon?: ReactElement;
|
|
41
|
+
setDateValueOnDateSelection?: boolean;
|
|
42
|
+
};
|
|
37
43
|
actionModal: Pick<ActionModalProps, "titleTypography" | "descriptionTypography">;
|
|
38
44
|
bottomSheet: Pick<BottomSheetProps, "closeDragThreshold" | "closeVelocityThreshold" | "hideThumb" | "headerTypography">;
|
|
39
45
|
tableHeaderText: Pick<HeaderTextProps, "variant" | "size">;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { CalendarIcon } from "../assets/icons/Calendar.js";
|
|
2
|
+
import { ClockIcon } from "../assets/icons/Clock.js";
|
|
3
|
+
import { DateTimeIcon } from "../assets/icons/DateTime.js";
|
|
1
4
|
import { ObjectUtils } from "../utils/object.utils.js";
|
|
2
5
|
import { useDeepCompareMemo } from "../hooks/useDeepCompare.js";
|
|
3
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -6,6 +9,7 @@ import { createContext, use } from "react";
|
|
|
6
9
|
var UIConfig;
|
|
7
10
|
(function(_UIConfig) {
|
|
8
11
|
const DEFAULT_CONFIG = {
|
|
12
|
+
renderStaticInput: true,
|
|
9
13
|
input: {
|
|
10
14
|
variant: "outlined",
|
|
11
15
|
as: "default",
|
|
@@ -43,8 +47,15 @@ var UIConfig;
|
|
|
43
47
|
},
|
|
44
48
|
dateInput: {
|
|
45
49
|
todayIcon: false,
|
|
50
|
+
todayIconButtonSize: "none",
|
|
51
|
+
todayIconPlacement: "content",
|
|
46
52
|
shouldForceLeadingZeros: false,
|
|
47
|
-
disableManualEntry: false
|
|
53
|
+
disableManualEntry: false,
|
|
54
|
+
autoFixYear: false,
|
|
55
|
+
calendarIcon: /* @__PURE__ */ jsx(CalendarIcon, { className: "size-5" }),
|
|
56
|
+
dateTimeIcon: /* @__PURE__ */ jsx(DateTimeIcon, { className: "size-5" }),
|
|
57
|
+
timeIcon: /* @__PURE__ */ jsx(ClockIcon, { className: "size-6 text-interactive-text-secondary-idle" }),
|
|
58
|
+
setDateValueOnDateSelection: false
|
|
48
59
|
},
|
|
49
60
|
actionModal: {
|
|
50
61
|
titleTypography: {
|
|
@@ -4,11 +4,16 @@ import { BreadcrumbChevronVariantProps, BreadcrumbIconVariantProps, BreadcrumbIt
|
|
|
4
4
|
import { ButtonVariantProps } from '../components/buttons/Button/button.cva';
|
|
5
5
|
import { PillButtonVariants } from '../components/buttons/PillButton/pillButton.cva';
|
|
6
6
|
import { CheckboxIconVariantProps, CheckboxVariantProps } from '../components/inputs/Checkbox/checkbox.cva';
|
|
7
|
+
import { DatePickerInputContentRowProps } from '../components/inputs/DateTime/shared/datePickerInput.cva';
|
|
7
8
|
import { FormFieldErrorVariantProps } from '../components/inputs/FormField/formFieldError.cva';
|
|
9
|
+
import { FormFieldHeaderVariantProps } from '../components/inputs/FormField/formFieldHeader.cva';
|
|
8
10
|
import { FormFieldHelperVariantProps } from '../components/inputs/FormField/formFieldHelper.cva';
|
|
9
11
|
import { RadioVariantProps } from '../components/inputs/RadioGroup/radio.cva';
|
|
10
|
-
import {
|
|
12
|
+
import { SelectPopoverCva } from '../components/inputs/Selection/shared/selectDesktop.cva';
|
|
13
|
+
import { SelectListBoxItemCva } from '../components/inputs/Selection/shared/selectItem.cva';
|
|
14
|
+
import { InputBaseProps, InputClearClassProps, InputContentWrapperProps, InputSideProps, InputSizeProps } from '../components/inputs/shared/input.cva';
|
|
11
15
|
import { LabelBaseProps } from '../components/inputs/shared/label.cva';
|
|
16
|
+
import { TooltipWrapperTriggerVariantProps } from '../components/inputs/shared/tooltipWrapper.cva';
|
|
12
17
|
import { ToggleVariantProps } from '../components/inputs/Toggle/toggle.cva';
|
|
13
18
|
import { MenuCvaVariantProps, MenuItemVariantProps, MenuPopoverVariantProps, MenuPopoverWrapperVariantProps } from '../components/Menu/menu.cva';
|
|
14
19
|
import { AccordionChevronVariantProps, AccordionHeadingSubtitleVariantProps, AccordionHeadingTitleVariantProps, AccordionHeadingVariantProps, AccordionIconVariantProps, AccordionItemVariantProps, AccordionPanelContentVariantProps, AccordionPanelVariantProps, AccordionTriggerVariantProps, AccordionVariantProps } from '../components/navigation/Accordion/accordion.cva';
|
|
@@ -24,13 +29,12 @@ import { LinkVariantProps } from '../components/text/Link/link.cva';
|
|
|
24
29
|
import { TagVariantProps } from '../components/text/Tag/tag.cva';
|
|
25
30
|
import { TypographyVariantProps } from '../components/text/Typography/typography.cva';
|
|
26
31
|
import { CompoundMapper, ConfigSchema } from '../utils/compoundMapper';
|
|
27
|
-
import { SelectListBoxItemCva } from '../components/inputs/Selection/shared/selectItem.cva';
|
|
28
32
|
export declare namespace UIStyle {
|
|
29
33
|
export type Cva<T> = (props: (T & ClassProp) | ClassProp) => string;
|
|
30
34
|
type OptionKey = {
|
|
31
35
|
[K in keyof Options]: Options[K] extends object ? `${K & string}.${keyof Options[K] & string}` : never;
|
|
32
36
|
}[keyof Options];
|
|
33
|
-
interface Options {
|
|
37
|
+
export interface Options {
|
|
34
38
|
button: {
|
|
35
39
|
cva?: Cva<ButtonVariantProps>;
|
|
36
40
|
sizeCva?: Cva<ButtonVariantProps>;
|
|
@@ -46,10 +50,12 @@ export declare namespace UIStyle {
|
|
|
46
50
|
cva?: Cva<CheckboxVariantProps>;
|
|
47
51
|
iconCva?: Cva<CheckboxIconVariantProps>;
|
|
48
52
|
typography?: CompoundMapper<TypographyVariantProps, CheckboxVariantProps>;
|
|
53
|
+
contentClassName?: CompoundMapper<string, CheckboxVariantProps>;
|
|
49
54
|
};
|
|
50
55
|
radio: {
|
|
51
56
|
cva?: Cva<RadioVariantProps>;
|
|
52
57
|
typography?: CompoundMapper<TypographyVariantProps, RadioVariantProps>;
|
|
58
|
+
contentClassName?: CompoundMapper<string, RadioVariantProps>;
|
|
53
59
|
};
|
|
54
60
|
status: {
|
|
55
61
|
iconCva?: Cva<ToastVariantProps>;
|
|
@@ -64,9 +70,17 @@ export declare namespace UIStyle {
|
|
|
64
70
|
};
|
|
65
71
|
input: {
|
|
66
72
|
baseCva?: Cva<InputBaseProps>;
|
|
73
|
+
clearClassCva?: Cva<InputClearClassProps>;
|
|
74
|
+
contentWrapperCva?: Cva<InputContentWrapperProps>;
|
|
67
75
|
sizeCva?: Cva<InputSizeProps>;
|
|
68
76
|
sideCva?: Cva<InputSideProps>;
|
|
69
77
|
};
|
|
78
|
+
tooltipWrapper: {
|
|
79
|
+
triggerCva?: Cva<TooltipWrapperTriggerVariantProps>;
|
|
80
|
+
};
|
|
81
|
+
datePickerInput: {
|
|
82
|
+
contentRowCva?: Cva<DatePickerInputContentRowProps>;
|
|
83
|
+
};
|
|
70
84
|
label: {
|
|
71
85
|
cva?: Cva<LabelBaseProps>;
|
|
72
86
|
typography?: CompoundMapper<TypographyVariantProps, LabelBaseProps>;
|
|
@@ -74,6 +88,7 @@ export declare namespace UIStyle {
|
|
|
74
88
|
toggle: {
|
|
75
89
|
cva?: Cva<ToggleVariantProps>;
|
|
76
90
|
typography?: CompoundMapper<TypographyVariantProps, ToggleVariantProps>;
|
|
91
|
+
contentClassName?: CompoundMapper<string, ToggleVariantProps>;
|
|
77
92
|
};
|
|
78
93
|
typography: {
|
|
79
94
|
cva?: Cva<TypographyVariantProps>;
|
|
@@ -145,11 +160,13 @@ export declare namespace UIStyle {
|
|
|
145
160
|
cva?: Cva<PopoverVariantProps>;
|
|
146
161
|
};
|
|
147
162
|
formField: {
|
|
163
|
+
headerCva?: Cva<FormFieldHeaderVariantProps>;
|
|
148
164
|
errorLabelCva?: Cva<FormFieldErrorVariantProps>;
|
|
149
165
|
helperLabelCva?: Cva<FormFieldHelperVariantProps>;
|
|
150
166
|
};
|
|
151
167
|
select: {
|
|
152
168
|
listBoxItemCva?: Cva<SelectListBoxItemCva>;
|
|
169
|
+
popoverCva?: Cva<SelectPopoverCva>;
|
|
153
170
|
};
|
|
154
171
|
}
|
|
155
172
|
interface ProviderProps {
|
|
@@ -23,7 +23,7 @@ export type AllowedComponentType<TZodType extends z.ZodType> = ZodUtils.ZodTypeS
|
|
|
23
23
|
boolean: "toggle" | "checkbox";
|
|
24
24
|
number: "numberInput" | "slider" | "select" | "querySelect" | "autocomplete" | "queryAutocomplete" | "segment";
|
|
25
25
|
enum: "select" | "querySelect" | "autocomplete" | "segment";
|
|
26
|
-
string: "textInput" | "passwordInput" | "textArea" | "select" | "querySelect" | "autocomplete" | "queryAutocomplete" | "segment";
|
|
26
|
+
string: "textInput" | "passwordInput" | "textArea" | "textEditor" | "select" | "querySelect" | "autocomplete" | "queryAutocomplete" | "segment";
|
|
27
27
|
email: "textInput";
|
|
28
28
|
array: "select" | "querySelect" | "autocomplete" | "queryAutocomplete" | "segment";
|
|
29
29
|
object: InputComponentType;
|
|
@@ -81,6 +81,7 @@ var getDefaultProps = (componentType, keyType) => {
|
|
|
81
81
|
].includes(componentType)) props.items = getDefaultSelectionItems(unwrappedType);
|
|
82
82
|
if ([
|
|
83
83
|
"select",
|
|
84
|
+
"querySelect",
|
|
84
85
|
"autocomplete",
|
|
85
86
|
"queryAutocomplete",
|
|
86
87
|
"segment"
|
|
@@ -146,6 +147,8 @@ var populateInputDef = (schema, schemaKey, value, options) => {
|
|
|
146
147
|
const inputWrapper = value.inputWrapper ?? options.globalInputWrapper;
|
|
147
148
|
if ("render" in value) return {
|
|
148
149
|
name,
|
|
150
|
+
label,
|
|
151
|
+
placeholder,
|
|
149
152
|
render: value.render
|
|
150
153
|
};
|
|
151
154
|
const schemaKeyType = schema.shape[schemaKey];
|
|
@@ -3,6 +3,6 @@ type UseIntersectionObserverProps = {
|
|
|
3
3
|
onIntersectionChange?: (entry: IntersectionObserverEntry) => void;
|
|
4
4
|
} & IntersectionObserverInit;
|
|
5
5
|
export declare const useIntersectionObserver: <T extends HTMLElement>({ onIntersection, onIntersectionChange, root, rootMargin, threshold, }: UseIntersectionObserverProps) => {
|
|
6
|
-
ref:
|
|
6
|
+
ref: (element: T | null) => void;
|
|
7
7
|
};
|
|
8
8
|
export {};
|
|
@@ -1,25 +1,44 @@
|
|
|
1
|
-
import { useEffect, useRef } from "react";
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
2
2
|
//#region src/hooks/useIntersectionObserver.ts
|
|
3
3
|
var useIntersectionObserver = ({ onIntersection, onIntersectionChange, root, rootMargin, threshold }) => {
|
|
4
|
-
const
|
|
4
|
+
const elementRef = useRef(null);
|
|
5
|
+
const observerRef = useRef(null);
|
|
6
|
+
const onIntersectionRef = useRef(onIntersection);
|
|
7
|
+
const onIntersectionChangeRef = useRef(onIntersectionChange);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
onIntersectionRef.current = onIntersection;
|
|
10
|
+
}, [onIntersection]);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
onIntersectionChangeRef.current = onIntersectionChange;
|
|
13
|
+
}, [onIntersectionChange]);
|
|
5
14
|
useEffect(() => {
|
|
6
15
|
const observer = new IntersectionObserver((entries) => {
|
|
7
|
-
if (entries.some((entry) => entry.isIntersecting))
|
|
8
|
-
|
|
16
|
+
if (entries.some((entry) => entry.isIntersecting)) onIntersectionRef.current?.();
|
|
17
|
+
onIntersectionChangeRef.current?.(entries[0]);
|
|
9
18
|
}, {
|
|
10
19
|
root,
|
|
11
20
|
rootMargin,
|
|
12
21
|
threshold
|
|
13
22
|
});
|
|
14
|
-
|
|
15
|
-
|
|
23
|
+
observerRef.current = observer;
|
|
24
|
+
if (elementRef.current) observer.observe(elementRef.current);
|
|
25
|
+
return () => {
|
|
26
|
+
if (elementRef.current) observer.unobserve(elementRef.current);
|
|
27
|
+
observer.disconnect();
|
|
28
|
+
observerRef.current = null;
|
|
29
|
+
};
|
|
16
30
|
}, [
|
|
17
|
-
ref,
|
|
18
31
|
root,
|
|
19
|
-
|
|
20
|
-
|
|
32
|
+
rootMargin,
|
|
33
|
+
threshold
|
|
21
34
|
]);
|
|
22
|
-
|
|
35
|
+
const ref = useCallback((element) => {
|
|
36
|
+
if (elementRef.current === element) return;
|
|
37
|
+
if (observerRef.current && elementRef.current) observerRef.current.unobserve(elementRef.current);
|
|
38
|
+
elementRef.current = element;
|
|
39
|
+
if (observerRef.current && elementRef.current) observerRef.current.observe(elementRef.current);
|
|
40
|
+
}, []);
|
|
41
|
+
return useMemo(() => ({ ref }), [ref]);
|
|
23
42
|
};
|
|
24
43
|
//#endregion
|
|
25
44
|
export { useIntersectionObserver };
|
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InfiniteData } from '@tanstack/react-query';
|
|
2
2
|
import { Key } from 'react-aria-components';
|
|
3
|
-
import {
|
|
4
|
-
type QueryResult<TData = any> = UseQueryResult<TData> | UseInfiniteQueryResult<TData>;
|
|
5
|
-
type QueryFn<TData = any> = (...args: any[]) => QueryResult<TData>;
|
|
6
|
-
type QueryDataType<TQueryFn extends QueryFn> = Exclude<ReturnType<TQueryFn>["data"], undefined>;
|
|
7
|
-
interface UseQueryAutocompleteOptions<TQueryFn extends QueryFn, TKey extends Key = Key> {
|
|
8
|
-
query: TQueryFn;
|
|
9
|
-
queryParams?: Parameters<TQueryFn>[0];
|
|
10
|
-
queryOptions?: Parameters<TQueryFn>[1];
|
|
11
|
-
mapItems: (data: QueryDataType<TQueryFn>) => SelectItem<TKey>[];
|
|
12
|
-
initialQueryState?: boolean;
|
|
13
|
-
search?: string;
|
|
14
|
-
}
|
|
3
|
+
import { InfiniteQueryPage, QueryFn, UseQueryAutocompleteOptions } from '../components/inputs/Selection/Autocomplete/queryAutocomplete.types';
|
|
15
4
|
export declare const useQueryAutocomplete: <TQueryFn extends QueryFn, TKey extends Key = Key>({ query, queryParams, queryOptions, mapItems, initialQueryState, search, }: UseQueryAutocompleteOptions<TQueryFn, TKey>) => {
|
|
16
5
|
data: any;
|
|
17
6
|
isLoading: boolean;
|
|
18
7
|
isQueryEnabled: boolean;
|
|
19
8
|
handleEnableQuery: () => void;
|
|
20
|
-
items: SelectItem<TKey>[];
|
|
9
|
+
items: import('..').SelectItem<TKey>[];
|
|
10
|
+
totalItems: number | undefined;
|
|
21
11
|
hasNextPage: boolean;
|
|
22
|
-
fetchNextPage: ((
|
|
12
|
+
fetchNextPage: ((options?: import('@tanstack/react-query').FetchNextPageOptions) => Promise<import('@tanstack/react-query').InfiniteQueryObserverResult<InfiniteData<InfiniteQueryPage<TKey>, unknown>, Error>>) | undefined;
|
|
23
13
|
isFetchingNextPage: boolean;
|
|
24
14
|
};
|
|
25
|
-
export {};
|