@hortiview/shared-components 0.0.11176 → 0.0.11587
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/README.md +58 -8
- package/dist/BigLoadingSpinner-iegTbDcD.js +16 -0
- package/dist/GenericCard-6J558OgP.js +350 -0
- package/dist/ListAreaService-DOwtdRa4.js +109 -0
- package/dist/_MapCache-B75yWNNd.js +376 -0
- package/dist/_baseIsEqual-D0Dsajdb.js +317 -0
- package/dist/_getTag-BCf9b56Z.js +81 -0
- package/dist/animationframe-EMBh6XeO.js +54 -0
- package/dist/assets/HashTabView.css +1 -1
- package/dist/assets/Select.css +1 -0
- package/dist/component-DsB0poTj.js +571 -0
- package/dist/component-neHBNHRu.js +114 -0
- package/dist/components/AlertBanner/AlertBanner.d.ts +0 -1
- package/dist/components/AlertBanner/AlertBanner.js +15 -15
- package/dist/components/AlertBanner/AlertBanner.test.js +11 -9
- package/dist/components/BaseView/BaseView.d.ts +1 -1
- package/dist/components/BaseView/BaseView.js +27 -28
- package/dist/components/BaseView/BaseView.test.js +25 -25
- package/dist/components/BasicHeading/BasicHeading.d.ts +1 -0
- package/dist/components/BasicHeading/BasicHeading.js +17 -17
- package/dist/components/BasicHeading/BasicHeading.test.js +10 -10
- package/dist/components/BlockView/BlockView.d.ts +1 -0
- package/dist/components/BlockView/BlockView.js +24 -25
- package/dist/components/BlockView/BlockView.test.js +2 -2
- package/dist/components/ChipCard/ChipCard.js +1765 -15
- package/dist/components/ChipCard/ChipCard.test.js +2 -2
- package/dist/components/ContextMenu/ContextMenu.d.ts +3 -2
- package/dist/components/ContextMenu/ContextMenu.js +28 -28
- package/dist/components/ContextMenu/ContextMenu.test.js +2 -2
- package/dist/components/DeleteModal/DeleteModal.d.ts +0 -1
- package/dist/components/DeleteModal/DeleteModal.js +53 -51
- package/dist/components/DeleteModal/DeleteModal.test.js +2 -2
- package/dist/components/Disclaimer/Disclaimer.js +12 -11
- package/dist/components/Disclaimer/Disclaimer.test.js +2 -2
- package/dist/components/EmptyView/EmptyView.d.ts +1 -0
- package/dist/components/EmptyView/EmptyView.js +258 -19
- package/dist/components/EmptyView/EmptyView.test.js +2 -2
- package/dist/components/Filter/Filter.d.ts +1 -0
- package/dist/components/Filter/Filter.js +81 -77
- package/dist/components/Filter/Filter.test.js +2 -2
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.d.ts +1 -0
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +13 -11
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +2 -2
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.d.ts +3 -2
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +5975 -6389
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +2 -2
- package/dist/components/FormComponents/FormNumber/CustomTextField.d.ts +2 -1
- package/dist/components/FormComponents/FormNumber/CustomTextField.js +13 -14
- package/dist/components/FormComponents/FormNumber/FormNumber.d.ts +2 -1
- package/dist/components/FormComponents/FormNumber/FormNumber.js +2 -2
- package/dist/components/FormComponents/FormNumber/FormNumber.test.js +4 -4
- package/dist/components/FormComponents/FormRadio/FormRadio.d.ts +1 -0
- package/dist/components/FormComponents/FormRadio/FormRadio.js +4 -4
- package/dist/components/FormComponents/FormRadio/FormRadio.test.js +2 -2
- package/dist/components/FormComponents/FormSelect/FormSelect.d.ts +4 -7
- package/dist/components/FormComponents/FormSelect/FormSelect.js +100 -110
- package/dist/components/FormComponents/FormSelect/FormSelect.test.js +3 -3
- package/dist/components/FormComponents/FormSelect/SelectTooltipText.d.ts +1 -0
- package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +6 -5
- package/dist/components/FormComponents/FormSlider/FormSlider.d.ts +1 -0
- package/dist/components/FormComponents/FormSlider/FormSlider.js +1155 -27
- package/dist/components/FormComponents/FormSlider/FormSlider.test.js +2 -2
- package/dist/components/FormComponents/FormText/FormText.d.ts +2 -1
- package/dist/components/FormComponents/FormText/FormText.js +28 -28
- package/dist/components/FormComponents/FormText/FormText.test.js +13 -13
- package/dist/components/FormComponents/FormToggle/FormToggle.d.ts +2 -1
- package/dist/components/FormComponents/FormToggle/FormToggle.js +17 -15
- package/dist/components/FormComponents/FormToggle/FormToggle.test.js +2 -2
- package/dist/components/FormattedNumberDisplay/FormattedNumberDisplay.d.ts +2 -1
- package/dist/components/FormattedNumberDisplay/FormattedNumberDisplay.js +1 -1
- package/dist/components/GenericTable/GenericTable.d.ts +1 -0
- package/dist/components/GenericTable/GenericTable.js +10487 -76
- package/dist/components/GenericTable/GenericTable.test.js +2 -2
- package/dist/components/GenericTable/GenericTableService.d.ts +1 -0
- package/dist/components/GenericTable/GenericTableService.js +41 -41
- package/dist/components/GenericTable/Mobile/GenericCard.d.ts +1 -1
- package/dist/components/GenericTable/Mobile/GenericCard.js +4 -3
- package/dist/components/GenericTable/Mobile/GenericCard.test.js +3 -3
- package/dist/components/GenericTable/Mobile/GenericCardList.d.ts +1 -1
- package/dist/components/GenericTable/Mobile/GenericCardList.js +10 -8
- package/dist/components/GenericTable/Mobile/GenericCardList.test.js +2 -2
- package/dist/components/HashTabView/HashTabView.d.ts +6 -1
- package/dist/components/HashTabView/HashTabView.js +1805 -72
- package/dist/components/HashTabView/HashTabView.test.js +2 -2
- package/dist/components/HeaderFilter/HeaderFilter.d.ts +3 -2
- package/dist/components/HeaderFilter/HeaderFilter.js +14 -14
- package/dist/components/HeaderFilter/HeaderFilter.test.js +2 -2
- package/dist/components/HealthCheckFailed/HealthCheckFailed.js +19 -17
- package/dist/components/HealthCheckFailed/HealthCheckFailed.test.js +2 -2
- package/dist/components/Iconify/Iconify.d.ts +2 -3
- package/dist/components/Iconify/Iconify.js +44 -45
- package/dist/components/Iconify/Iconify.test.js +2 -2
- package/dist/components/InfoGroup/InfoGroup.d.ts +4 -3
- package/dist/components/InfoGroup/InfoGroup.js +30 -29
- package/dist/components/InfoGroup/InfoGroup.test.js +2 -2
- package/dist/components/ListArea/ListArea.d.ts +1 -1
- package/dist/components/ListArea/ListArea.js +29 -27
- package/dist/components/ListArea/ListArea.test.js +5 -5
- package/dist/components/ListArea/ListAreaService.d.ts +9 -8
- package/dist/components/ListArea/ListAreaService.js +7 -5
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +2 -2
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +3 -3
- package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +506 -38
- package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.js +2 -2
- package/dist/components/Modal/Modal.d.ts +2 -1
- package/dist/components/Modal/Modal.js +926 -10
- package/dist/components/ModulePadding/ModulePadding.d.ts +7 -0
- package/dist/components/ModulePadding/ModulePadding.js +28 -0
- package/dist/components/ModulePadding/ModulePadding.test.d.ts +1 -0
- package/dist/components/ModulePadding/ModulePadding.test.js +22 -0
- package/dist/components/OverflowTooltip/OverflowTooltip.d.ts +0 -1
- package/dist/components/OverflowTooltip/OverflowTooltip.js +13 -14
- package/dist/components/OverflowTooltip/OverflowTooltip.test.js +4 -4
- package/dist/components/Scrollbar/Scrollbar.js +5 -6
- package/dist/components/Scrollbar/scrollbar.test.js +2 -2
- package/dist/components/SearchBar/SearchBar.js +11 -11
- package/dist/components/SearchBar/SearchBar.test.js +2 -2
- package/dist/components/Select/Select.d.ts +14 -0
- package/dist/components/Select/Select.js +34 -0
- package/dist/components/Select/Select.test.d.ts +1 -0
- package/dist/components/Select/Select.test.js +28 -0
- package/dist/components/VerticalDivider/VerticalDivider.js +4 -5
- package/dist/components/VerticalDivider/VerticalDivider.test.js +2 -2
- package/dist/floating-ui.dom-CeD8zknG.js +978 -0
- package/dist/get-7ACccM2X.js +114 -0
- package/dist/{get-BiqanC9_.js → get-DFv1gXfq.js} +1 -1
- package/dist/hooks/useBreakpoints.test.js +2 -2
- package/dist/hooks/useHelperText.d.ts +1 -0
- package/dist/hooks/useHelperText.js +1 -1
- package/dist/identity-DLWZln-X.js +1763 -0
- package/dist/{index-DzM8o582.js → index-CrcXCSzI.js} +1940 -1796
- package/dist/index.es-0lQcz8m1.js +444 -0
- package/dist/index.es-25EARqhH.js +2027 -0
- package/dist/index.es-3043KTnb.js +1066 -0
- package/dist/index.es-41ztjcFT.js +724 -0
- package/dist/index.es-6TJ1S8Jr.js +954 -0
- package/dist/index.es-8GOVkuo-.js +374 -0
- package/dist/index.es-B-_jXDuz.js +216 -0
- package/dist/index.es-BWgXLqXn.js +102 -0
- package/dist/index.es-BtjV0oNv.js +360 -0
- package/dist/index.es-BvrQnJ3j.js +509 -0
- package/dist/index.es-CF_xy2ns.js +674 -0
- package/dist/index.es-CL_Heu1n.js +54 -0
- package/dist/index.es-CiqbARoC.js +306 -0
- package/dist/index.es-D-CKRzIB.js +63 -0
- package/dist/index.es-D6N-XWHe.js +56 -0
- package/dist/index.es-DKDgy7Kt.js +45 -0
- package/dist/index.es-DntoATwO.js +159 -0
- package/dist/index.es-UHKFl8Da.js +7075 -0
- package/dist/index.es-d5xhUpJZ.js +3242 -0
- package/dist/index.es-da0cf7oE.js +569 -0
- package/dist/index.es-h2lMdt7G.js +107 -0
- package/dist/index.es-zr101OF5.js +4853 -0
- package/dist/{isArray-2zMxXFEr.js → isArray-DN9s620O.js} +3 -3
- package/dist/{isArray-C_5XvIlE.js → isArray-Dub1wGJM.js} +1 -1
- package/dist/isEmpty-B4GG2s-V.js +31 -0
- package/dist/isPlainObject-C273y67K.js +40 -0
- package/dist/isString-BW9UHONv.js +21 -0
- package/dist/keyboard-Bpt0aBqQ.js +107 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.js +58 -54
- package/dist/orderBy-Bd48bw88.js +316 -0
- package/dist/{react-number-format.es-BD3_OvMU.js → react-number-format.es-BK1EpVXq.js} +151 -151
- package/dist/react-tooltip.min-DSY6KDqS.js +431 -0
- package/dist/{react.esm-FR1-H8iU.js → react.esm-DNwojocF.js} +5289 -4990
- package/dist/services/BlockService.d.ts +1 -0
- package/dist/services/NumberService.d.ts +1 -0
- package/dist/services/UtilService.d.ts +1 -0
- package/dist/services/UtilService.js +2 -2
- package/dist/services/services.test.js +1 -1
- package/dist/toString-CrgB_7Pe.js +54 -0
- package/dist/tslib.es6-BDCynO9F.js +162 -0
- package/dist/types/GenericTable.d.ts +2 -2
- package/dist/types/HashTab.d.ts +0 -1
- package/dist/types/ListElement.d.ts +0 -1
- package/dist/types/internal/ReactRouterTypes.d.ts +0 -1
- package/dist/uniqueId-NU3-C36A.js +18 -0
- package/dist/util-DA21pZXj.js +78 -0
- package/dist/{vi.CjhMlMwf-DWv7vrn7.js → vi.CjhMlMwf-BCJNwXvu.js} +1 -1
- package/package.json +15 -15
- package/dist/BigLoadingSpinner-C3wTbTD0.js +0 -17
- package/dist/GenericCard-B8x1DMa8.js +0 -81
- package/dist/ListAreaService-CRX4eEUJ.js +0 -108
- package/dist/_Map-Dtlps7IZ.js +0 -113
- package/dist/_overArg-_0pUmCsX.js +0 -14
- package/dist/get-P-5PYZOE.js +0 -426
- package/dist/isEmpty-BimaZd5G.js +0 -225
- package/dist/isString-BOHPtrlm.js +0 -44
- package/dist/orderBy-BVQIswlJ.js +0 -765
- package/dist/react-tooltip.min-c2wVkjF2.js +0 -1354
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { a as s, s as a, f as m } from "../../../react.esm-
|
|
2
|
+
import { a as s, s as a, f as m } from "../../../react.esm-DNwojocF.js";
|
|
3
3
|
import { FormDatePicker as c } from "./FormDatePicker.js";
|
|
4
|
-
import { v as e, d as f, t as l, g as r } from "../../../vi.CjhMlMwf-
|
|
4
|
+
import { v as e, d as f, t as l, g as r } from "../../../vi.CjhMlMwf-BCJNwXvu.js";
|
|
5
5
|
const i = e.fn();
|
|
6
6
|
e.mock("react-hook-form", () => ({
|
|
7
7
|
...e.importActual("react-hook-form"),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { TextfieldProps } from '@element/react-
|
|
1
|
+
import { TextfieldProps } from '@element-public/react-textfield';
|
|
2
2
|
import { ControllerRenderProps, FieldValues, Path } from 'react-hook-form';
|
|
3
3
|
import { InputAttributes, NumericFormatProps } from 'react-number-format';
|
|
4
|
+
|
|
4
5
|
type CustomTextFieldProps<T extends FieldValues> = Pick<TextfieldProps, 'className' | 'disabled' | 'fullWidth' | 'helperText' | 'helperTextPersistent' | 'helperTextValidation' | 'label' | 'leadingIcon' | 'placeholder' | 'trailingIcon' | 'variant'> & {
|
|
5
6
|
/**
|
|
6
7
|
* the path to the property
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import "../../../assets/CustomTextField.css";
|
|
2
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useMemo as
|
|
6
|
-
import { useFormContext as
|
|
7
|
-
const
|
|
8
|
-
invalid:
|
|
9
|
-
},
|
|
2
|
+
import { T as d } from "../../../index.es-25EARqhH.js";
|
|
3
|
+
import { g as u } from "../../../get-DFv1gXfq.js";
|
|
4
|
+
import { useMemo as g } from "react";
|
|
5
|
+
import { useFormContext as v } from "react-hook-form";
|
|
6
|
+
import '../../../assets/CustomTextField.css';const f = "_invalid_1dsbr_1", c = {
|
|
7
|
+
invalid: f
|
|
8
|
+
}, T = ({ ...e }) => {
|
|
10
9
|
const {
|
|
11
10
|
getFieldState: r,
|
|
12
|
-
formState: { errors:
|
|
11
|
+
formState: { errors: n },
|
|
13
12
|
trigger: i,
|
|
14
13
|
watch: l
|
|
15
|
-
} =
|
|
16
|
-
if (!(!
|
|
14
|
+
} = v(), a = l(e.propertyName), o = g(() => {
|
|
15
|
+
if (!(!a || e.value === null))
|
|
17
16
|
return e.value;
|
|
18
|
-
}, [
|
|
17
|
+
}, [a, e.value]);
|
|
19
18
|
return /* @__PURE__ */ m(
|
|
20
19
|
d,
|
|
21
20
|
{
|
|
@@ -32,11 +31,11 @@ const v = "_invalid_1dsbr_1", c = {
|
|
|
32
31
|
e.onChange?.(t), e.additionalTrigger === "onChange" && i(e.propertyName);
|
|
33
32
|
},
|
|
34
33
|
valid: !r(e.propertyName).invalid,
|
|
35
|
-
helperTextPersistent: u(
|
|
34
|
+
helperTextPersistent: u(n, e.propertyName) !== void 0 || e.helperTextPersistent,
|
|
36
35
|
className: r(e.propertyName).invalid ? c.invalid : ""
|
|
37
36
|
}
|
|
38
37
|
);
|
|
39
38
|
};
|
|
40
39
|
export {
|
|
41
|
-
|
|
40
|
+
T as CustomTextField
|
|
42
41
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { TextfieldProps } from '@element/react-
|
|
1
|
+
import { TextfieldProps } from '@element-public/react-textfield';
|
|
2
2
|
import { FieldValues, Path } from 'react-hook-form';
|
|
3
3
|
import { NumericFormatProps } from 'react-number-format';
|
|
4
4
|
import { LANGUAGE_COUNTRY_CODES } from '../../../types/Languages';
|
|
5
|
+
|
|
5
6
|
export type FormNumberProps<T extends FieldValues> = {
|
|
6
7
|
/**
|
|
7
8
|
* the language code to use for formatting the number
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { g as p } from "../../../get-
|
|
2
|
+
import { g as p } from "../../../get-DFv1gXfq.js";
|
|
3
3
|
import { useMemo as h } from "react";
|
|
4
4
|
import { useFormContext as S, Controller as T } from "react-hook-form";
|
|
5
|
-
import { N as g } from "../../../react-number-format.es-
|
|
5
|
+
import { N as g } from "../../../react-number-format.es-BK1EpVXq.js";
|
|
6
6
|
import { useDecimalSeparator as y, useThousandSeparator as F } from "../../../services/NumberService.js";
|
|
7
7
|
import { CustomTextField as V } from "./CustomTextField.js";
|
|
8
8
|
const B = ({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { a, s as n } from "../../../react.esm-
|
|
2
|
+
import { a, s as n } from "../../../react.esm-DNwojocF.js";
|
|
3
3
|
import { FormNumber as s } from "./FormNumber.js";
|
|
4
|
-
import { v as e, d as m, t as f, g as r } from "../../../vi.CjhMlMwf-
|
|
5
|
-
const
|
|
4
|
+
import { v as e, d as m, t as f, g as r } from "../../../vi.CjhMlMwf-BCJNwXvu.js";
|
|
5
|
+
const l = e.fn();
|
|
6
6
|
e.mock("react-hook-form", () => ({
|
|
7
7
|
...e.importActual("react-hook-form"),
|
|
8
8
|
Controller: ({
|
|
@@ -10,7 +10,7 @@ e.mock("react-hook-form", () => ({
|
|
|
10
10
|
}) => t({
|
|
11
11
|
field: {
|
|
12
12
|
ref: void 0,
|
|
13
|
-
onChange:
|
|
13
|
+
onChange: l,
|
|
14
14
|
value: 12345
|
|
15
15
|
},
|
|
16
16
|
formState: { defaultValue: { "de-DE": 234 } }
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as r, Fragment as m } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useFormContext as
|
|
2
|
+
import { R as d } from "../../../index.es-BtjV0oNv.js";
|
|
3
|
+
import { useFormContext as s, Controller as c } from "react-hook-form";
|
|
4
4
|
const g = ({ propertyName: l, options: t }) => {
|
|
5
|
-
const { control: n, setValue: o } =
|
|
5
|
+
const { control: n, setValue: o } = s(), u = (a) => {
|
|
6
6
|
const e = a.target.value;
|
|
7
7
|
o(l, e);
|
|
8
8
|
};
|
|
9
9
|
return /* @__PURE__ */ r(
|
|
10
|
-
|
|
10
|
+
c,
|
|
11
11
|
{
|
|
12
12
|
name: l,
|
|
13
13
|
control: n,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { a as s, s as t, f as m } from "../../../react.esm-
|
|
2
|
+
import { a as s, s as t, f as m } from "../../../react.esm-DNwojocF.js";
|
|
3
3
|
import { FormRadio as l } from "./FormRadio.js";
|
|
4
|
-
import { v as e, d as c, t as i, g as o } from "../../../vi.CjhMlMwf-
|
|
4
|
+
import { v as e, d as c, t as i, g as o } from "../../../vi.CjhMlMwf-BCJNwXvu.js";
|
|
5
5
|
const r = e.fn();
|
|
6
6
|
e.mock("react-hook-form", () => ({
|
|
7
7
|
...e.importActual("react-hook-form"),
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import { SelectProps } from '@element/react-components';
|
|
1
|
+
import { SelectProps } from '@element-public/react-select';
|
|
3
2
|
import { FieldPath, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
import { ExtendedSelectProps } from '../../Select/Select';
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* a generic FormSelector property type. the generic T represents the interface, which is used in the form, like {@link CreateOrganizationDto}
|
|
6
7
|
*/
|
|
7
|
-
type FormSelectProps<T extends FieldValues> = Omit<SelectProps, 'className' | 'clearable' | 'disabled' | 'helperTextPersistent' | 'hidden' | 'hoisted' | 'label' | 'menuMaxHeight' | 'multi' | 'multiSelect' | 'options' | 'searchable' | 'textKey' | 'valid' | 'value' | 'valueKey' | 'variant'> & {
|
|
8
|
+
type FormSelectProps<T extends FieldValues> = Omit<SelectProps, 'className' | 'clearable' | 'disabled' | 'helperTextPersistent' | 'hidden' | 'hoisted' | 'label' | 'menuMaxHeight' | 'multi' | 'multiSelect' | 'options' | 'searchable' | 'textKey' | 'valid' | 'value' | 'valueKey' | 'variant'> & Pick<ExtendedSelectProps, 'portalClassName'> & {
|
|
8
9
|
/** the name of the property in the form */
|
|
9
10
|
propertyName: Path<T>;
|
|
10
11
|
/** the label of the select */
|
|
@@ -34,10 +35,6 @@ type FormSelectProps<T extends FieldValues> = Omit<SelectProps, 'className' | 'c
|
|
|
34
35
|
* @example { validate: (value) => value === 'admin' }
|
|
35
36
|
*/
|
|
36
37
|
rules?: Omit<RegisterOptions<T, FieldPath<T>>, 'disabled' | 'valueAsNumber' | 'valueAsDate' | 'setValueAs'> | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* if auto no portal container will be rendered
|
|
39
|
-
*/
|
|
40
|
-
menuPosition?: 'auto' | 'top' | 'bottom';
|
|
41
38
|
};
|
|
42
39
|
/**
|
|
43
40
|
* the base option type of the selector, you can also use your own custom objects, by defining the {@link FormSelectProps} valueKey and textKey
|
|
@@ -1,137 +1,127 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, ue = ({
|
|
1
|
+
import { jsx as o, Fragment as g, jsxs as V } from "react/jsx-runtime";
|
|
2
|
+
import { g as _ } from "../../../get-DFv1gXfq.js";
|
|
3
|
+
import { i as z } from "../../../isArray-Dub1wGJM.js";
|
|
4
|
+
import { useMemo as k } from "react";
|
|
5
|
+
import { useFormContext as G, Controller as C } from "react-hook-form";
|
|
6
|
+
import { M as J } from "../../../react-tooltip.min-DSY6KDqS.js";
|
|
7
|
+
import { useHelperText as L } from "../../../hooks/useHelperText.js";
|
|
8
|
+
import { Select as Q } from "../../Select/Select.js";
|
|
9
|
+
import { SelectTooltipText as R } from "./SelectTooltipText.js";
|
|
10
|
+
import '../../../assets/FormSelect.css';const U = "_invalidHelperText_ht9kd_1", W = "_invalidBorder_ht9kd_5", X = "_invalidPlaceholder_ht9kd_9", Y = "_invalidDropdownIcon_ht9kd_13", Z = "_formSelectContainer_ht9kd_18", N = "_formSelect_ht9kd_18", y = "_multiText_ht9kd_44", K = "_tooltip_ht9kd_53", tt = "_disabled_ht9kd_58", e = {
|
|
11
|
+
invalidHelperText: U,
|
|
12
|
+
invalidBorder: W,
|
|
13
|
+
invalidPlaceholder: X,
|
|
14
|
+
invalidDropdownIcon: Y,
|
|
15
|
+
formSelectContainer: Z,
|
|
16
|
+
formSelect: N,
|
|
17
|
+
multiText: y,
|
|
18
|
+
tooltip: K,
|
|
19
|
+
disabled: tt
|
|
20
|
+
}, mt = ({
|
|
22
21
|
propertyName: i,
|
|
23
|
-
label:
|
|
24
|
-
options:
|
|
25
|
-
multi:
|
|
26
|
-
disabled:
|
|
27
|
-
hoisted:
|
|
28
|
-
hidden:
|
|
29
|
-
valueKey:
|
|
30
|
-
textKey:
|
|
31
|
-
clearable:
|
|
32
|
-
searchable:
|
|
33
|
-
noOptionsMessage:
|
|
34
|
-
rules:
|
|
35
|
-
menuPosition:
|
|
36
|
-
...
|
|
22
|
+
label: c,
|
|
23
|
+
options: n,
|
|
24
|
+
multi: d = !1,
|
|
25
|
+
disabled: x = !1,
|
|
26
|
+
hoisted: $ = !1,
|
|
27
|
+
hidden: H = !1,
|
|
28
|
+
valueKey: l = "value",
|
|
29
|
+
textKey: u = "text",
|
|
30
|
+
clearable: I = !1,
|
|
31
|
+
searchable: w = !0,
|
|
32
|
+
noOptionsMessage: D = "",
|
|
33
|
+
rules: m,
|
|
34
|
+
menuPosition: P = "auto",
|
|
35
|
+
...r
|
|
37
36
|
}) => {
|
|
38
37
|
const {
|
|
39
|
-
control:
|
|
40
|
-
getFieldState:
|
|
41
|
-
formState: { errors:
|
|
42
|
-
} =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const q = $(
|
|
50
|
-
() => !k && p(g, i) !== void 0,
|
|
51
|
-
[g, i, k]
|
|
52
|
-
), j = $(
|
|
53
|
-
() => u?.required?.message,
|
|
54
|
-
[u]
|
|
55
|
-
), { helperText: A, helperTextPersistent: P } = X({
|
|
38
|
+
control: T,
|
|
39
|
+
getFieldState: B,
|
|
40
|
+
formState: { errors: v, isValidating: S }
|
|
41
|
+
} = G(), F = k(
|
|
42
|
+
() => !S && _(v, i) !== void 0,
|
|
43
|
+
[v, i, S]
|
|
44
|
+
), M = k(
|
|
45
|
+
() => m?.required?.message,
|
|
46
|
+
[m]
|
|
47
|
+
), { helperText: b, helperTextPersistent: j } = L({
|
|
56
48
|
propertyName: i,
|
|
57
|
-
helperText:
|
|
58
|
-
requiredText:
|
|
49
|
+
helperText: r.helperText,
|
|
50
|
+
requiredText: M,
|
|
59
51
|
hasCharacterCount: !1
|
|
60
52
|
});
|
|
61
|
-
return
|
|
53
|
+
return H ? /* @__PURE__ */ o(C, { name: i, control: T, render: () => /* @__PURE__ */ o(g, {}) }) : /* @__PURE__ */ o(
|
|
62
54
|
"div",
|
|
63
55
|
{
|
|
64
56
|
"data-testid": "form-select-container",
|
|
65
|
-
className:
|
|
66
|
-
"data-tooltip-id":
|
|
67
|
-
children: /* @__PURE__ */
|
|
68
|
-
|
|
57
|
+
className: e.formSelectContainer,
|
|
58
|
+
"data-tooltip-id": c,
|
|
59
|
+
children: /* @__PURE__ */ o(
|
|
60
|
+
C,
|
|
69
61
|
{
|
|
70
62
|
name: i,
|
|
71
|
-
rules:
|
|
72
|
-
control:
|
|
73
|
-
render: ({ field: { ref:
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
(
|
|
78
|
-
) :
|
|
79
|
-
${
|
|
80
|
-
${
|
|
81
|
-
${
|
|
82
|
-
${
|
|
83
|
-
${
|
|
84
|
-
${
|
|
85
|
-
${
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
63
|
+
rules: m,
|
|
64
|
+
control: T,
|
|
65
|
+
render: ({ field: { ref: et, onChange: f, value: p, ...q } }) => {
|
|
66
|
+
let h = n;
|
|
67
|
+
z(n) && _(n[0], "options") !== void 0 && (h = n.flatMap((t) => _(t, "options") ?? []));
|
|
68
|
+
const a = d ? h?.filter(
|
|
69
|
+
(t) => p?.includes(t[l])
|
|
70
|
+
) : h?.find((t) => t[l] === p), A = d && r.multiDisplayType === "text" && r.fixedHeightInput, s = B(i).invalid, E = `
|
|
71
|
+
${e.formSelect}
|
|
72
|
+
${s ? e.invalidHelperText : ""}
|
|
73
|
+
${s ? e.invalidDropdownIcon : ""}
|
|
74
|
+
${s ? e.invalidBorder : ""}
|
|
75
|
+
${s ? e.invalidPlaceholder : ""}
|
|
76
|
+
${A ? e.multiText : ""}
|
|
77
|
+
${x ? e.disabled : ""}`;
|
|
78
|
+
return /* @__PURE__ */ V(g, { children: [
|
|
79
|
+
/* @__PURE__ */ o(
|
|
80
|
+
Q,
|
|
89
81
|
{
|
|
90
|
-
...
|
|
91
|
-
...
|
|
92
|
-
value:
|
|
93
|
-
label:
|
|
82
|
+
...q,
|
|
83
|
+
...r,
|
|
84
|
+
value: a ?? [],
|
|
85
|
+
label: c,
|
|
94
86
|
variant: "outlined",
|
|
95
|
-
helperText:
|
|
96
|
-
helperTextPersistent:
|
|
97
|
-
options:
|
|
98
|
-
valid: !
|
|
87
|
+
helperText: b,
|
|
88
|
+
helperTextPersistent: j,
|
|
89
|
+
options: n,
|
|
90
|
+
valid: !F,
|
|
99
91
|
"data-testid": `select-${i}`,
|
|
100
|
-
multiSelect:
|
|
101
|
-
className:
|
|
102
|
-
disabled:
|
|
103
|
-
valueKey:
|
|
104
|
-
textKey:
|
|
105
|
-
onChange: (
|
|
106
|
-
if (
|
|
107
|
-
|
|
92
|
+
multiSelect: d,
|
|
93
|
+
className: E,
|
|
94
|
+
disabled: x,
|
|
95
|
+
valueKey: l,
|
|
96
|
+
textKey: u,
|
|
97
|
+
onChange: (t) => {
|
|
98
|
+
if (t == null) {
|
|
99
|
+
f(t);
|
|
108
100
|
return;
|
|
109
101
|
}
|
|
110
|
-
if (
|
|
111
|
-
|
|
102
|
+
if (d) {
|
|
103
|
+
f(t.map((O) => O[l]));
|
|
112
104
|
return;
|
|
113
105
|
}
|
|
114
|
-
|
|
106
|
+
f(t[l]), r?.onChange?.(t);
|
|
115
107
|
},
|
|
116
|
-
hoisted:
|
|
117
|
-
noOptionsMessage:
|
|
118
|
-
searchable:
|
|
119
|
-
clearable:
|
|
120
|
-
|
|
121
|
-
menuPosition: d,
|
|
122
|
-
portalContainer: d !== "auto" && M
|
|
108
|
+
hoisted: $,
|
|
109
|
+
noOptionsMessage: D,
|
|
110
|
+
searchable: w,
|
|
111
|
+
clearable: I,
|
|
112
|
+
menuPosition: P
|
|
123
113
|
}
|
|
124
114
|
),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
|
|
115
|
+
/* @__PURE__ */ o(
|
|
116
|
+
J,
|
|
127
117
|
{
|
|
128
|
-
id:
|
|
118
|
+
id: c,
|
|
129
119
|
noArrow: !0,
|
|
130
120
|
place: "bottom",
|
|
131
121
|
delayShow: 420,
|
|
132
|
-
className:
|
|
133
|
-
hidden: !
|
|
134
|
-
children: /* @__PURE__ */
|
|
122
|
+
className: e.tooltip,
|
|
123
|
+
hidden: !a || a.length === 0 || !r.fixedHeightInput,
|
|
124
|
+
children: /* @__PURE__ */ o(R, { value: a, textKey: u, valueKey: l })
|
|
135
125
|
}
|
|
136
126
|
)
|
|
137
127
|
] });
|
|
@@ -142,5 +132,5 @@ const Z = "_invalidHelperText_ht9kd_1", y = "_invalidBorder_ht9kd_5", N = "_inva
|
|
|
142
132
|
);
|
|
143
133
|
};
|
|
144
134
|
export {
|
|
145
|
-
|
|
135
|
+
mt as FormSelect
|
|
146
136
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { a, s as t, f as T, w as p } from "../../../react.esm-
|
|
3
|
-
import { u as B } from "../../../index-
|
|
2
|
+
import { a, s as t, f as T, w as p } from "../../../react.esm-DNwojocF.js";
|
|
3
|
+
import { u as B } from "../../../index-CrcXCSzI.js";
|
|
4
4
|
import { FormSelect as i } from "./FormSelect.js";
|
|
5
5
|
import { SelectTooltipText as d } from "./SelectTooltipText.js";
|
|
6
|
-
import { v as n, d as f, t as u, g as e } from "../../../vi.CjhMlMwf-
|
|
6
|
+
import { v as n, d as f, t as u, g as e } from "../../../vi.CjhMlMwf-BCJNwXvu.js";
|
|
7
7
|
const g = n.fn();
|
|
8
8
|
n.mock("react-hook-form", () => ({
|
|
9
9
|
...n.importActual("react-hook-form"),
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { G as n } from "../../../index.es-DntoATwO.js";
|
|
3
|
+
import { b as p } from "../../../index.es-CF_xy2ns.js";
|
|
4
|
+
const s = ({ value: r, textKey: o, valueKey: e }) => {
|
|
4
5
|
if (!(!r || r.length === 0))
|
|
5
|
-
return Array.isArray(r) ? /* @__PURE__ */ n
|
|
6
|
+
return Array.isArray(r) ? /* @__PURE__ */ t(n, { direction: "vertical", gap: "dense", children: r?.map((i) => /* @__PURE__ */ t(p, { level: 2, children: i[o] }, i[e])) }) : r?.[o];
|
|
6
7
|
};
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
+
s as SelectTooltipText
|
|
9
10
|
};
|