@hortiview/shared-components 0.0.11176 → 0.0.11528
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 +41 -8
- package/dist/BigLoadingSpinner-D7H28pr5.js +16 -0
- package/dist/{GenericCard-B8x1DMa8.js → GenericCard-jlt8ZsHi.js} +18 -19
- package/dist/ListAreaService-YS_UUPh5.js +107 -0
- package/dist/assets/HashTabView.css +1 -1
- package/dist/assets/Select.css +1 -0
- package/dist/components/AlertBanner/AlertBanner.d.ts +0 -1
- package/dist/components/AlertBanner/AlertBanner.js +7 -8
- package/dist/components/AlertBanner/AlertBanner.test.js +11 -9
- package/dist/components/BaseView/BaseView.d.ts +1 -1
- package/dist/components/BaseView/BaseView.js +24 -25
- package/dist/components/BaseView/BaseView.test.js +25 -25
- package/dist/components/BasicHeading/BasicHeading.d.ts +1 -0
- package/dist/components/BasicHeading/BasicHeading.js +11 -12
- package/dist/components/BasicHeading/BasicHeading.test.js +3 -3
- 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 +6 -7
- package/dist/components/ChipCard/ChipCard.test.js +2 -2
- package/dist/components/ContextMenu/ContextMenu.d.ts +3 -2
- package/dist/components/ContextMenu/ContextMenu.js +11 -12
- package/dist/components/ContextMenu/ContextMenu.test.js +2 -2
- package/dist/components/DeleteModal/DeleteModal.d.ts +0 -1
- package/dist/components/DeleteModal/DeleteModal.js +30 -31
- package/dist/components/DeleteModal/DeleteModal.test.js +2 -2
- package/dist/components/Disclaimer/Disclaimer.js +9 -10
- package/dist/components/Disclaimer/Disclaimer.test.js +2 -2
- package/dist/components/EmptyView/EmptyView.d.ts +1 -0
- package/dist/components/EmptyView/EmptyView.js +1 -1
- package/dist/components/EmptyView/EmptyView.test.js +2 -2
- package/dist/components/Filter/Filter.d.ts +1 -0
- package/dist/components/Filter/Filter.js +62 -62
- 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 +1 -1
- 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 +629 -630
- 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 +11 -12
- package/dist/components/FormComponents/FormNumber/FormNumber.d.ts +2 -1
- package/dist/components/FormComponents/FormNumber/FormNumber.js +1 -1
- 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 +1 -1
- 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 +5 -5
- package/dist/components/FormComponents/FormSlider/FormSlider.d.ts +1 -0
- package/dist/components/FormComponents/FormSlider/FormSlider.js +1 -1
- 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 +14 -15
- 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 +1 -1
- 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 +23 -24
- 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 +2 -2
- 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 +2 -2
- 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 +53 -53
- package/dist/components/HashTabView/HashTabView.test.js +2 -2
- package/dist/components/HeaderFilter/HeaderFilter.d.ts +3 -2
- package/dist/components/HeaderFilter/HeaderFilter.js +12 -12
- package/dist/components/HeaderFilter/HeaderFilter.test.js +2 -2
- package/dist/components/HealthCheckFailed/HealthCheckFailed.js +7 -8
- package/dist/components/HealthCheckFailed/HealthCheckFailed.test.js +2 -2
- package/dist/components/Iconify/Iconify.d.ts +2 -2
- package/dist/components/Iconify/Iconify.js +4 -5
- package/dist/components/Iconify/Iconify.test.js +2 -2
- package/dist/components/InfoGroup/InfoGroup.d.ts +4 -3
- package/dist/components/InfoGroup/InfoGroup.js +4 -5
- package/dist/components/InfoGroup/InfoGroup.test.js +2 -2
- package/dist/components/ListArea/ListArea.d.ts +1 -1
- package/dist/components/ListArea/ListArea.js +2 -2
- package/dist/components/ListArea/ListArea.test.js +5 -5
- package/dist/components/ListArea/ListAreaService.d.ts +9 -8
- package/dist/components/ListArea/ListAreaService.js +2 -2
- 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 +5 -6
- 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 +5 -6
- package/dist/components/OverflowTooltip/OverflowTooltip.d.ts +0 -1
- package/dist/components/OverflowTooltip/OverflowTooltip.js +10 -11
- 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 +10 -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/hooks/useBreakpoints.test.js +2 -2
- package/dist/hooks/useHelperText.d.ts +1 -0
- package/dist/{index-DzM8o582.js → index-CrcXCSzI.js} +1940 -1796
- package/dist/main.d.ts +2 -0
- package/dist/main.js +33 -31
- package/dist/{react-number-format.es-BD3_OvMU.js → react-number-format.es-BK1EpVXq.js} +151 -151
- package/dist/react-tooltip.min-Czs4RGD1.js +1400 -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/services.test.js +1 -1
- 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/{vi.CjhMlMwf-DWv7vrn7.js → vi.CjhMlMwf-BCJNwXvu.js} +1 -1
- package/package.json +15 -15
- package/dist/BigLoadingSpinner-C3wTbTD0.js +0 -17
- package/dist/ListAreaService-CRX4eEUJ.js +0 -108
- 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-components';
|
|
1
|
+
import { TextfieldProps } from '@element-public/react-components';
|
|
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 { Textfield as d } from "@element/react-components";
|
|
2
|
+
import { Textfield as d } from "@element-public/react-components";
|
|
4
3
|
import { get as u } from "lodash";
|
|
5
|
-
import { useMemo as
|
|
4
|
+
import { useMemo as v } from "react";
|
|
6
5
|
import { useFormContext as g } from "react-hook-form";
|
|
7
|
-
const
|
|
8
|
-
invalid:
|
|
9
|
-
},
|
|
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
|
-
} = g(),
|
|
16
|
-
if (!(!
|
|
14
|
+
} = g(), a = l(e.propertyName), o = v(() => {
|
|
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-components';
|
|
1
|
+
import { TextfieldProps } from '@element-public/react-components';
|
|
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
|
|
@@ -2,7 +2,7 @@ import { jsx as u } from "react/jsx-runtime";
|
|
|
2
2
|
import { g as p } from "../../../get-BiqanC9_.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,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, Fragment as m } from "react/jsx-runtime";
|
|
2
|
-
import { Radio as d } from "@element/react-components";
|
|
2
|
+
import { Radio as d } from "@element-public/react-components";
|
|
3
3
|
import { useFormContext as c, Controller as s } from "react-hook-form";
|
|
4
4
|
const g = ({ propertyName: l, options: t }) => {
|
|
5
5
|
const { control: n, setValue: o } = c(), u = (a) => {
|
|
@@ -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-components';
|
|
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-BiqanC9_.js";
|
|
3
|
+
import { i as z } from "../../../isArray-C_5XvIlE.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-Czs4RGD1.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,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Group as
|
|
3
|
-
const
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Group as n, TypoBody as p } from "@element-public/react-components";
|
|
3
|
+
const m = ({ value: r, textKey: i, valueKey: t }) => {
|
|
4
4
|
if (!(!r || r.length === 0))
|
|
5
|
-
return Array.isArray(r) ? /* @__PURE__ */ n
|
|
5
|
+
return Array.isArray(r) ? /* @__PURE__ */ e(n, { direction: "vertical", gap: "dense", children: r?.map((o) => /* @__PURE__ */ e(p, { level: 2, children: o[i] }, o[t])) }) : r?.[i];
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
m as SelectTooltipText
|
|
9
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { Slider as d } from "@element/react-components";
|
|
2
|
+
import { Slider as d } from "@element-public/react-components";
|
|
3
3
|
import { useFormContext as p, Controller as u } from "react-hook-form";
|
|
4
4
|
const f = ({
|
|
5
5
|
propertyName: e,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as s } 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 { FormSlider as l } from "./FormSlider.js";
|
|
4
|
-
import { v as e, d as m, t as i, g as r } from "../../../vi.CjhMlMwf-
|
|
4
|
+
import { v as e, d as m, t as i, g as r } from "../../../vi.CjhMlMwf-BCJNwXvu.js";
|
|
5
5
|
const o = 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-components';
|
|
1
|
+
import { TextfieldProps } from '@element-public/react-components';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { FieldPath, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* a generic FormText property type. the generic T represents the interface, which is used in the form, like {@link CreateOrganizationDto}
|
|
6
7
|
*/
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import "../../../assets/FormText.css";
|
|
2
1
|
import { jsx as t, Fragment as F, jsxs as D } from "react/jsx-runtime";
|
|
3
|
-
import { Textfield as G, TypoCaption as I } from "@element/react-components";
|
|
2
|
+
import { Textfield as G, TypoCaption as I } from "@element-public/react-components";
|
|
4
3
|
import { g as J } from "../../../get-BiqanC9_.js";
|
|
5
4
|
import { useState as q, useCallback as K, useMemo as T, useEffect as O } from "react";
|
|
6
5
|
import { useFormContext as Q, Controller as H } from "react-hook-form";
|
|
7
6
|
import { useHelperText as U } from "../../../hooks/useHelperText.js";
|
|
8
|
-
const X = "_formTextAreaHelperText_168p8_1", Y = "_invalid_168p8_7", Z = "_required_168p8_11", N = "_formTextArea_168p8_1", y = "_characterCount_168p8_25", p = "_withoutCharacterCount_168p8_31", r = {
|
|
7
|
+
import '../../../assets/FormText.css';const X = "_formTextAreaHelperText_168p8_1", Y = "_invalid_168p8_7", Z = "_required_168p8_11", N = "_formTextArea_168p8_1", y = "_characterCount_168p8_25", p = "_withoutCharacterCount_168p8_31", r = {
|
|
9
8
|
formTextAreaHelperText: X,
|
|
10
9
|
invalid: Y,
|
|
11
10
|
required: Z,
|
|
@@ -24,7 +23,7 @@ const X = "_formTextAreaHelperText_168p8_1", Y = "_invalid_168p8_7", Z = "_requi
|
|
|
24
23
|
className: `${r.formTextAreaHelperText} ${s ? r.invalid : ""} ${n ? r.required : ""}`,
|
|
25
24
|
children: /* @__PURE__ */ t(I, { children: `${e}/${u}` })
|
|
26
25
|
}
|
|
27
|
-
),
|
|
26
|
+
), ue = (e) => e.textarea ? /* @__PURE__ */ t(te, { ...e }) : /* @__PURE__ */ t(ne, { ...e }), te = (e) => /* @__PURE__ */ t("div", { "data-testid": "form-text-area", className: r.formTextArea, children: /* @__PURE__ */ t(L, { ...e }) }), ne = (e) => /* @__PURE__ */ t(
|
|
28
27
|
"div",
|
|
29
28
|
{
|
|
30
29
|
"data-testid": "form-text-field",
|
|
@@ -47,17 +46,17 @@ const X = "_formTextAreaHelperText_168p8_1", Y = "_invalid_168p8_7", Z = "_requi
|
|
|
47
46
|
rules: a,
|
|
48
47
|
...i
|
|
49
48
|
}) => {
|
|
50
|
-
const { control: g, getFieldState: d, trigger: v } = Q(), [b,
|
|
51
|
-
(
|
|
49
|
+
const { control: g, getFieldState: d, trigger: v } = Q(), [b, h] = q(0), [o, z] = q(), m = K(
|
|
50
|
+
(x) => {
|
|
52
51
|
if (o != null) {
|
|
53
|
-
|
|
52
|
+
h(o.length);
|
|
54
53
|
return;
|
|
55
54
|
}
|
|
56
|
-
if (
|
|
57
|
-
|
|
55
|
+
if (x) {
|
|
56
|
+
h(x.length);
|
|
58
57
|
return;
|
|
59
58
|
}
|
|
60
|
-
|
|
59
|
+
h(0);
|
|
61
60
|
},
|
|
62
61
|
[o]
|
|
63
62
|
), l = T(
|
|
@@ -84,15 +83,15 @@ const X = "_formTextAreaHelperText_168p8_1", Y = "_invalid_168p8_7", Z = "_requi
|
|
|
84
83
|
name: e,
|
|
85
84
|
rules: a,
|
|
86
85
|
control: g,
|
|
87
|
-
render: ({ field: { ref:
|
|
86
|
+
render: ({ field: { ref: x, ...f }, formState: { defaultValues: V } }) => {
|
|
88
87
|
const A = J(V, e);
|
|
89
88
|
return !o && A && (c || n) && m(A), /* @__PURE__ */ D(F, { children: [
|
|
90
89
|
/* @__PURE__ */ t(
|
|
91
90
|
G,
|
|
92
91
|
{
|
|
93
92
|
...i,
|
|
94
|
-
...
|
|
95
|
-
value:
|
|
93
|
+
...f,
|
|
94
|
+
value: f.value ?? "",
|
|
96
95
|
type: S,
|
|
97
96
|
fullWidth: !0,
|
|
98
97
|
"data-testid": `textfield-${e}`,
|
|
@@ -112,7 +111,7 @@ const X = "_formTextAreaHelperText_168p8_1", Y = "_invalid_168p8_7", Z = "_requi
|
|
|
112
111
|
C === "onBlur" && v(e), i.onBlur?.();
|
|
113
112
|
},
|
|
114
113
|
onChange: ($) => {
|
|
115
|
-
|
|
114
|
+
f.onChange($);
|
|
116
115
|
const W = $?.target?.value;
|
|
117
116
|
z(W), C === "onChange" && v(e);
|
|
118
117
|
},
|
|
@@ -136,5 +135,5 @@ const X = "_formTextAreaHelperText_168p8_1", Y = "_invalid_168p8_7", Z = "_requi
|
|
|
136
135
|
);
|
|
137
136
|
};
|
|
138
137
|
export {
|
|
139
|
-
|
|
138
|
+
ue as FormText
|
|
140
139
|
};
|