@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.
Files changed (190) hide show
  1. package/README.md +58 -8
  2. package/dist/BigLoadingSpinner-iegTbDcD.js +16 -0
  3. package/dist/GenericCard-6J558OgP.js +350 -0
  4. package/dist/ListAreaService-DOwtdRa4.js +109 -0
  5. package/dist/_MapCache-B75yWNNd.js +376 -0
  6. package/dist/_baseIsEqual-D0Dsajdb.js +317 -0
  7. package/dist/_getTag-BCf9b56Z.js +81 -0
  8. package/dist/animationframe-EMBh6XeO.js +54 -0
  9. package/dist/assets/HashTabView.css +1 -1
  10. package/dist/assets/Select.css +1 -0
  11. package/dist/component-DsB0poTj.js +571 -0
  12. package/dist/component-neHBNHRu.js +114 -0
  13. package/dist/components/AlertBanner/AlertBanner.d.ts +0 -1
  14. package/dist/components/AlertBanner/AlertBanner.js +15 -15
  15. package/dist/components/AlertBanner/AlertBanner.test.js +11 -9
  16. package/dist/components/BaseView/BaseView.d.ts +1 -1
  17. package/dist/components/BaseView/BaseView.js +27 -28
  18. package/dist/components/BaseView/BaseView.test.js +25 -25
  19. package/dist/components/BasicHeading/BasicHeading.d.ts +1 -0
  20. package/dist/components/BasicHeading/BasicHeading.js +17 -17
  21. package/dist/components/BasicHeading/BasicHeading.test.js +10 -10
  22. package/dist/components/BlockView/BlockView.d.ts +1 -0
  23. package/dist/components/BlockView/BlockView.js +24 -25
  24. package/dist/components/BlockView/BlockView.test.js +2 -2
  25. package/dist/components/ChipCard/ChipCard.js +1765 -15
  26. package/dist/components/ChipCard/ChipCard.test.js +2 -2
  27. package/dist/components/ContextMenu/ContextMenu.d.ts +3 -2
  28. package/dist/components/ContextMenu/ContextMenu.js +28 -28
  29. package/dist/components/ContextMenu/ContextMenu.test.js +2 -2
  30. package/dist/components/DeleteModal/DeleteModal.d.ts +0 -1
  31. package/dist/components/DeleteModal/DeleteModal.js +53 -51
  32. package/dist/components/DeleteModal/DeleteModal.test.js +2 -2
  33. package/dist/components/Disclaimer/Disclaimer.js +12 -11
  34. package/dist/components/Disclaimer/Disclaimer.test.js +2 -2
  35. package/dist/components/EmptyView/EmptyView.d.ts +1 -0
  36. package/dist/components/EmptyView/EmptyView.js +258 -19
  37. package/dist/components/EmptyView/EmptyView.test.js +2 -2
  38. package/dist/components/Filter/Filter.d.ts +1 -0
  39. package/dist/components/Filter/Filter.js +81 -77
  40. package/dist/components/Filter/Filter.test.js +2 -2
  41. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.d.ts +1 -0
  42. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +13 -11
  43. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +2 -2
  44. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.d.ts +3 -2
  45. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +5975 -6389
  46. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +2 -2
  47. package/dist/components/FormComponents/FormNumber/CustomTextField.d.ts +2 -1
  48. package/dist/components/FormComponents/FormNumber/CustomTextField.js +13 -14
  49. package/dist/components/FormComponents/FormNumber/FormNumber.d.ts +2 -1
  50. package/dist/components/FormComponents/FormNumber/FormNumber.js +2 -2
  51. package/dist/components/FormComponents/FormNumber/FormNumber.test.js +4 -4
  52. package/dist/components/FormComponents/FormRadio/FormRadio.d.ts +1 -0
  53. package/dist/components/FormComponents/FormRadio/FormRadio.js +4 -4
  54. package/dist/components/FormComponents/FormRadio/FormRadio.test.js +2 -2
  55. package/dist/components/FormComponents/FormSelect/FormSelect.d.ts +4 -7
  56. package/dist/components/FormComponents/FormSelect/FormSelect.js +100 -110
  57. package/dist/components/FormComponents/FormSelect/FormSelect.test.js +3 -3
  58. package/dist/components/FormComponents/FormSelect/SelectTooltipText.d.ts +1 -0
  59. package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +6 -5
  60. package/dist/components/FormComponents/FormSlider/FormSlider.d.ts +1 -0
  61. package/dist/components/FormComponents/FormSlider/FormSlider.js +1155 -27
  62. package/dist/components/FormComponents/FormSlider/FormSlider.test.js +2 -2
  63. package/dist/components/FormComponents/FormText/FormText.d.ts +2 -1
  64. package/dist/components/FormComponents/FormText/FormText.js +28 -28
  65. package/dist/components/FormComponents/FormText/FormText.test.js +13 -13
  66. package/dist/components/FormComponents/FormToggle/FormToggle.d.ts +2 -1
  67. package/dist/components/FormComponents/FormToggle/FormToggle.js +17 -15
  68. package/dist/components/FormComponents/FormToggle/FormToggle.test.js +2 -2
  69. package/dist/components/FormattedNumberDisplay/FormattedNumberDisplay.d.ts +2 -1
  70. package/dist/components/FormattedNumberDisplay/FormattedNumberDisplay.js +1 -1
  71. package/dist/components/GenericTable/GenericTable.d.ts +1 -0
  72. package/dist/components/GenericTable/GenericTable.js +10487 -76
  73. package/dist/components/GenericTable/GenericTable.test.js +2 -2
  74. package/dist/components/GenericTable/GenericTableService.d.ts +1 -0
  75. package/dist/components/GenericTable/GenericTableService.js +41 -41
  76. package/dist/components/GenericTable/Mobile/GenericCard.d.ts +1 -1
  77. package/dist/components/GenericTable/Mobile/GenericCard.js +4 -3
  78. package/dist/components/GenericTable/Mobile/GenericCard.test.js +3 -3
  79. package/dist/components/GenericTable/Mobile/GenericCardList.d.ts +1 -1
  80. package/dist/components/GenericTable/Mobile/GenericCardList.js +10 -8
  81. package/dist/components/GenericTable/Mobile/GenericCardList.test.js +2 -2
  82. package/dist/components/HashTabView/HashTabView.d.ts +6 -1
  83. package/dist/components/HashTabView/HashTabView.js +1805 -72
  84. package/dist/components/HashTabView/HashTabView.test.js +2 -2
  85. package/dist/components/HeaderFilter/HeaderFilter.d.ts +3 -2
  86. package/dist/components/HeaderFilter/HeaderFilter.js +14 -14
  87. package/dist/components/HeaderFilter/HeaderFilter.test.js +2 -2
  88. package/dist/components/HealthCheckFailed/HealthCheckFailed.js +19 -17
  89. package/dist/components/HealthCheckFailed/HealthCheckFailed.test.js +2 -2
  90. package/dist/components/Iconify/Iconify.d.ts +2 -3
  91. package/dist/components/Iconify/Iconify.js +44 -45
  92. package/dist/components/Iconify/Iconify.test.js +2 -2
  93. package/dist/components/InfoGroup/InfoGroup.d.ts +4 -3
  94. package/dist/components/InfoGroup/InfoGroup.js +30 -29
  95. package/dist/components/InfoGroup/InfoGroup.test.js +2 -2
  96. package/dist/components/ListArea/ListArea.d.ts +1 -1
  97. package/dist/components/ListArea/ListArea.js +29 -27
  98. package/dist/components/ListArea/ListArea.test.js +5 -5
  99. package/dist/components/ListArea/ListAreaService.d.ts +9 -8
  100. package/dist/components/ListArea/ListAreaService.js +7 -5
  101. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +2 -2
  102. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +3 -3
  103. package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +506 -38
  104. package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.js +2 -2
  105. package/dist/components/Modal/Modal.d.ts +2 -1
  106. package/dist/components/Modal/Modal.js +926 -10
  107. package/dist/components/ModulePadding/ModulePadding.d.ts +7 -0
  108. package/dist/components/ModulePadding/ModulePadding.js +28 -0
  109. package/dist/components/ModulePadding/ModulePadding.test.d.ts +1 -0
  110. package/dist/components/ModulePadding/ModulePadding.test.js +22 -0
  111. package/dist/components/OverflowTooltip/OverflowTooltip.d.ts +0 -1
  112. package/dist/components/OverflowTooltip/OverflowTooltip.js +13 -14
  113. package/dist/components/OverflowTooltip/OverflowTooltip.test.js +4 -4
  114. package/dist/components/Scrollbar/Scrollbar.js +5 -6
  115. package/dist/components/Scrollbar/scrollbar.test.js +2 -2
  116. package/dist/components/SearchBar/SearchBar.js +11 -11
  117. package/dist/components/SearchBar/SearchBar.test.js +2 -2
  118. package/dist/components/Select/Select.d.ts +14 -0
  119. package/dist/components/Select/Select.js +34 -0
  120. package/dist/components/Select/Select.test.d.ts +1 -0
  121. package/dist/components/Select/Select.test.js +28 -0
  122. package/dist/components/VerticalDivider/VerticalDivider.js +4 -5
  123. package/dist/components/VerticalDivider/VerticalDivider.test.js +2 -2
  124. package/dist/floating-ui.dom-CeD8zknG.js +978 -0
  125. package/dist/get-7ACccM2X.js +114 -0
  126. package/dist/{get-BiqanC9_.js → get-DFv1gXfq.js} +1 -1
  127. package/dist/hooks/useBreakpoints.test.js +2 -2
  128. package/dist/hooks/useHelperText.d.ts +1 -0
  129. package/dist/hooks/useHelperText.js +1 -1
  130. package/dist/identity-DLWZln-X.js +1763 -0
  131. package/dist/{index-DzM8o582.js → index-CrcXCSzI.js} +1940 -1796
  132. package/dist/index.es-0lQcz8m1.js +444 -0
  133. package/dist/index.es-25EARqhH.js +2027 -0
  134. package/dist/index.es-3043KTnb.js +1066 -0
  135. package/dist/index.es-41ztjcFT.js +724 -0
  136. package/dist/index.es-6TJ1S8Jr.js +954 -0
  137. package/dist/index.es-8GOVkuo-.js +374 -0
  138. package/dist/index.es-B-_jXDuz.js +216 -0
  139. package/dist/index.es-BWgXLqXn.js +102 -0
  140. package/dist/index.es-BtjV0oNv.js +360 -0
  141. package/dist/index.es-BvrQnJ3j.js +509 -0
  142. package/dist/index.es-CF_xy2ns.js +674 -0
  143. package/dist/index.es-CL_Heu1n.js +54 -0
  144. package/dist/index.es-CiqbARoC.js +306 -0
  145. package/dist/index.es-D-CKRzIB.js +63 -0
  146. package/dist/index.es-D6N-XWHe.js +56 -0
  147. package/dist/index.es-DKDgy7Kt.js +45 -0
  148. package/dist/index.es-DntoATwO.js +159 -0
  149. package/dist/index.es-UHKFl8Da.js +7075 -0
  150. package/dist/index.es-d5xhUpJZ.js +3242 -0
  151. package/dist/index.es-da0cf7oE.js +569 -0
  152. package/dist/index.es-h2lMdt7G.js +107 -0
  153. package/dist/index.es-zr101OF5.js +4853 -0
  154. package/dist/{isArray-2zMxXFEr.js → isArray-DN9s620O.js} +3 -3
  155. package/dist/{isArray-C_5XvIlE.js → isArray-Dub1wGJM.js} +1 -1
  156. package/dist/isEmpty-B4GG2s-V.js +31 -0
  157. package/dist/isPlainObject-C273y67K.js +40 -0
  158. package/dist/isString-BW9UHONv.js +21 -0
  159. package/dist/keyboard-Bpt0aBqQ.js +107 -0
  160. package/dist/main.d.ts +3 -0
  161. package/dist/main.js +58 -54
  162. package/dist/orderBy-Bd48bw88.js +316 -0
  163. package/dist/{react-number-format.es-BD3_OvMU.js → react-number-format.es-BK1EpVXq.js} +151 -151
  164. package/dist/react-tooltip.min-DSY6KDqS.js +431 -0
  165. package/dist/{react.esm-FR1-H8iU.js → react.esm-DNwojocF.js} +5289 -4990
  166. package/dist/services/BlockService.d.ts +1 -0
  167. package/dist/services/NumberService.d.ts +1 -0
  168. package/dist/services/UtilService.d.ts +1 -0
  169. package/dist/services/UtilService.js +2 -2
  170. package/dist/services/services.test.js +1 -1
  171. package/dist/toString-CrgB_7Pe.js +54 -0
  172. package/dist/tslib.es6-BDCynO9F.js +162 -0
  173. package/dist/types/GenericTable.d.ts +2 -2
  174. package/dist/types/HashTab.d.ts +0 -1
  175. package/dist/types/ListElement.d.ts +0 -1
  176. package/dist/types/internal/ReactRouterTypes.d.ts +0 -1
  177. package/dist/uniqueId-NU3-C36A.js +18 -0
  178. package/dist/util-DA21pZXj.js +78 -0
  179. package/dist/{vi.CjhMlMwf-DWv7vrn7.js → vi.CjhMlMwf-BCJNwXvu.js} +1 -1
  180. package/package.json +15 -15
  181. package/dist/BigLoadingSpinner-C3wTbTD0.js +0 -17
  182. package/dist/GenericCard-B8x1DMa8.js +0 -81
  183. package/dist/ListAreaService-CRX4eEUJ.js +0 -108
  184. package/dist/_Map-Dtlps7IZ.js +0 -113
  185. package/dist/_overArg-_0pUmCsX.js +0 -14
  186. package/dist/get-P-5PYZOE.js +0 -426
  187. package/dist/isEmpty-BimaZd5G.js +0 -225
  188. package/dist/isString-BOHPtrlm.js +0 -44
  189. package/dist/orderBy-BVQIswlJ.js +0 -765
  190. 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-FR1-H8iU.js";
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-DWv7vrn7.js";
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-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 { Textfield as d } from "@element/react-components";
4
- import { get as u } from "lodash";
5
- import { useMemo as f } from "react";
6
- import { useFormContext as g } from "react-hook-form";
7
- const v = "_invalid_1dsbr_1", c = {
8
- invalid: v
9
- }, C = ({ ...e }) => {
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: a },
11
+ formState: { errors: n },
13
12
  trigger: i,
14
13
  watch: l
15
- } = g(), n = l(e.propertyName), o = f(() => {
16
- if (!(!n || e.value === null))
14
+ } = v(), a = l(e.propertyName), o = g(() => {
15
+ if (!(!a || e.value === null))
17
16
  return e.value;
18
- }, [n, e.value]);
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(a, e.propertyName) !== void 0 || e.helperTextPersistent,
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
- C as CustomTextField
40
+ T as CustomTextField
42
41
  };
@@ -1,7 +1,8 @@
1
- import { TextfieldProps } from '@element/react-components';
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-BiqanC9_.js";
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-BD3_OvMU.js";
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-FR1-H8iU.js";
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-DWv7vrn7.js";
5
- const u = e.fn();
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: u,
13
+ onChange: l,
14
14
  value: 12345
15
15
  },
16
16
  formState: { defaultValue: { "de-DE": 234 } }
@@ -1,4 +1,5 @@
1
1
  import { FieldValues, Path } from 'react-hook-form';
2
+
2
3
  type FormRadioProps<T extends FieldValues> = {
3
4
  /** The name of the property that this radio button represents. */
4
5
  propertyName: Path<T>;
@@ -1,13 +1,13 @@
1
1
  import { jsx as r, Fragment as m } from "react/jsx-runtime";
2
- import { Radio as d } from "@element/react-components";
3
- import { useFormContext as c, Controller as s } from "react-hook-form";
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 } = c(), u = (a) => {
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
- s,
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-FR1-H8iU.js";
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-DWv7vrn7.js";
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
- /// <reference types="react" />
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 "../../../assets/FormSelect.css";
2
- import { jsx as l, Fragment as I, jsxs as G } from "react/jsx-runtime";
3
- import { Select as J } from "@element/react-components";
4
- import { g as p } from "../../../get-BiqanC9_.js";
5
- import { i as Q } from "../../../isArray-C_5XvIlE.js";
6
- import { useEffect as R, useMemo as $ } from "react";
7
- import { useFormContext as U, Controller as w } from "react-hook-form";
8
- import { H as W } from "../../../react-tooltip.min-c2wVkjF2.js";
9
- import { useHelperText as X } from "../../../hooks/useHelperText.js";
10
- import { SelectTooltipText as Y } from "./SelectTooltipText.js";
11
- const Z = "_invalidHelperText_ht9kd_1", y = "_invalidBorder_ht9kd_5", N = "_invalidPlaceholder_ht9kd_9", K = "_invalidDropdownIcon_ht9kd_13", ee = "_formSelectContainer_ht9kd_18", te = "_formSelect_ht9kd_18", ie = "_multiText_ht9kd_44", le = "_tooltip_ht9kd_53", ne = "_disabled_ht9kd_58", t = {
12
- invalidHelperText: Z,
13
- invalidBorder: y,
14
- invalidPlaceholder: N,
15
- invalidDropdownIcon: K,
16
- formSelectContainer: ee,
17
- formSelect: te,
18
- multiText: ie,
19
- tooltip: le,
20
- disabled: ne
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: h,
24
- options: r,
25
- multi: a = !1,
26
- disabled: T = !1,
27
- hoisted: _ = !1,
28
- hidden: B = !1,
29
- valueKey: n = "value",
30
- textKey: v = "text",
31
- clearable: D = !1,
32
- searchable: F = !0,
33
- noOptionsMessage: b = "",
34
- rules: u,
35
- menuPosition: d = "auto",
36
- ...o
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: C,
40
- getFieldState: E,
41
- formState: { errors: g, isValidating: k }
42
- } = U(), c = CSS.escape(i) + "-select-container", M = '[id="' + CSS.escape(c) + '"]';
43
- R(() => {
44
- if (!(!_ || d === "auto") && !document.getElementById(c)) {
45
- const s = document.createElement("div");
46
- s.id = c, s.classList.add(d), document.body.appendChild(s);
47
- }
48
- }, [_, d, c]);
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: o.helperText,
58
- requiredText: j,
49
+ helperText: r.helperText,
50
+ requiredText: M,
59
51
  hasCharacterCount: !1
60
52
  });
61
- return B ? /* @__PURE__ */ l(w, { name: i, control: C, render: () => /* @__PURE__ */ l(I, {}) }) : /* @__PURE__ */ l(
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: t.formSelectContainer,
66
- "data-tooltip-id": h,
67
- children: /* @__PURE__ */ l(
68
- w,
57
+ className: e.formSelectContainer,
58
+ "data-tooltip-id": c,
59
+ children: /* @__PURE__ */ o(
60
+ C,
69
61
  {
70
62
  name: i,
71
- rules: u,
72
- control: C,
73
- render: ({ field: { ref: s, onChange: x, value: H, ...L } }) => {
74
- let S = r;
75
- Q(r) && p(r[0], "options") !== void 0 && (S = r.flatMap((e) => p(e, "options") ?? []));
76
- const f = a ? S?.filter(
77
- (e) => H?.includes(e[n])
78
- ) : S?.find((e) => e[n] === H), O = a && o.multiDisplayType === "text" && o.fixedHeightInput, m = E(i).invalid, V = `
79
- ${t.formSelect}
80
- ${m ? t.invalidHelperText : ""}
81
- ${m ? t.invalidDropdownIcon : ""}
82
- ${m ? t.invalidBorder : ""}
83
- ${m ? t.invalidPlaceholder : ""}
84
- ${O ? t.multiText : ""}
85
- ${T ? t.disabled : ""}`;
86
- return /* @__PURE__ */ G(I, { children: [
87
- /* @__PURE__ */ l(
88
- J,
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
- ...L,
91
- ...o,
92
- value: f ?? [],
93
- label: h,
82
+ ...q,
83
+ ...r,
84
+ value: a ?? [],
85
+ label: c,
94
86
  variant: "outlined",
95
- helperText: A,
96
- helperTextPersistent: P,
97
- options: r,
98
- valid: !q,
87
+ helperText: b,
88
+ helperTextPersistent: j,
89
+ options: n,
90
+ valid: !F,
99
91
  "data-testid": `select-${i}`,
100
- multiSelect: a,
101
- className: V,
102
- disabled: T,
103
- valueKey: n,
104
- textKey: v,
105
- onChange: (e) => {
106
- if (e == null) {
107
- x(e);
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 (a) {
111
- x(e.map((z) => z[n]));
102
+ if (d) {
103
+ f(t.map((O) => O[l]));
112
104
  return;
113
105
  }
114
- x(e[n]), o?.onChange?.(e);
106
+ f(t[l]), r?.onChange?.(t);
115
107
  },
116
- hoisted: _,
117
- noOptionsMessage: b,
118
- searchable: F,
119
- clearable: D,
120
- menuMaxHeight: "15rem",
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__ */ l(
126
- W,
115
+ /* @__PURE__ */ o(
116
+ J,
127
117
  {
128
- id: h,
118
+ id: c,
129
119
  noArrow: !0,
130
120
  place: "bottom",
131
121
  delayShow: 420,
132
- className: t.tooltip,
133
- hidden: !f || f.length === 0 || !o.fixedHeightInput,
134
- children: /* @__PURE__ */ l(Y, { value: f, textKey: v, valueKey: n })
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
- ue as FormSelect
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-FR1-H8iU.js";
3
- import { u as B } from "../../../index-DzM8o582.js";
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-DWv7vrn7.js";
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,4 +1,5 @@
1
1
  import { ChangeValueType } from '../../../types/internal/ChangeValueType';
2
+
2
3
  type TooltipTextProps = {
3
4
  /**
4
5
  * the selected option(s) of the select
@@ -1,9 +1,10 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { Group as t, TypoBody as d } from "@element/react-components";
3
- const f = ({ value: r, textKey: e, valueKey: o }) => {
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(t, { direction: "vertical", gap: "dense", children: r?.map((i) => /* @__PURE__ */ n(d, { level: 2, children: i[e] }, i[o])) }) : r?.[e];
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
- f as SelectTooltipText
9
+ s as SelectTooltipText
9
10
  };
@@ -1,4 +1,5 @@
1
1
  import { FieldValues, Path } from 'react-hook-form';
2
+
2
3
  type FormSliderProps<T extends FieldValues> = {
3
4
  /** the path to the property, like Address.AddressLine1 */
4
5
  propertyName: Path<T>;