@oliasoft-open-source/react-ui-library 5.8.11-beta-2 → 5.8.11-beta-3

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/index.js CHANGED
@@ -5,7 +5,6 @@ import { TbAlertTriangle, TbArrowDown, TbArrowLeft, TbArrowRight, TbArrowUp, TbA
5
5
  import { VscCollapseAll, VscExpandAll } from "react-icons/vsc";
6
6
  import { AiOutlineMinusSquare, AiOutlinePlusSquare } from "react-icons/ai";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
- import { CSSTransition } from "react-transition-group";
9
8
  import ResizeObserver$1 from "resize-observer-polyfill";
10
9
  import { Arrow, mergeRefs, useHover, useLayer, useMousePositionAsTrigger } from "react-laag";
11
10
  import { cloneDeep, cloneDeepWith, debounce, get, isArray, isBoolean, isEmpty, isEqual, isFunction, isNil, isNumber, isObject, isPlainObject, isString, noop, set, toLower, toNumber } from "lodash";
@@ -51,8 +50,8 @@ let TriggerType = /* @__PURE__ */ function(e) {
51
50
  return e.TEXT = "text", e.RADIO = "radio", e.CHECKBOX = "checkbox", e;
52
51
  }({});
53
52
  var chevron_module_default = {
54
- chevron: "_chevron_dd6mn_1",
55
- expanded: "_expanded_dd6mn_9"
53
+ chevron: "_chevron_1kw4m_1",
54
+ expanded: "_expanded_1kw4m_9"
56
55
  };
57
56
  const DisabledContext = React.createContext(!1);
58
57
  var icon_module_default = {
@@ -254,32 +253,8 @@ var accordion_module_default = {
254
253
  expanded: "_expanded_15p8j_36",
255
254
  padding: "_padding_15p8j_44",
256
255
  squareBottom: "_squareBottom_15p8j_47"
257
- }, collapse_module_default = {
258
- collapse: "_collapse_1m1n2_5",
259
- enter: "_enter_1m1n2_9",
260
- enterActive: "_enterActive_1m1n2_12",
261
- exit: "_exit_1m1n2_15",
262
- exitActive: "_exitActive_1m1n2_18",
263
- collapseInner: "_collapseInner_1m1n2_21"
264
- };
265
- const Collapse = ({ children: e, expanded: t }) => /* @__PURE__ */ jsx(CSSTransition, {
266
- in: t,
267
- timeout: 100,
268
- classNames: {
269
- enter: collapse_module_default.enter,
270
- enterActive: collapse_module_default.enterActive,
271
- exit: collapse_module_default.exit,
272
- exitActive: collapse_module_default.exitActive
273
- },
274
- unmountOnExit: !0,
275
- children: /* @__PURE__ */ jsx("div", {
276
- className: collapse_module_default.collapse,
277
- children: /* @__PURE__ */ jsx("div", {
278
- className: collapse_module_default.collapseInner,
279
- children: /* @__PURE__ */ jsx("div", { children: e })
280
- })
281
- })
282
- }), AccordionBase = ({ heading: e, expanded: t = !1, bordered: n = !1, padding: r = !0, children: i, squareBottom: a = !1, onClick: o, testId: s }) => /* @__PURE__ */ jsxs("div", {
256
+ };
257
+ const AccordionBase = ({ heading: e, expanded: t = !1, bordered: n = !1, padding: r = !0, children: i, squareBottom: a = !1, onClick: o, testId: s }) => /* @__PURE__ */ jsxs("div", {
283
258
  className: cx(accordion_module_default.accordion, n ? accordion_module_default.bordered : "", t ? accordion_module_default.expanded : "", a ? accordion_module_default.squareBottom : ""),
284
259
  children: [/* @__PURE__ */ jsxs("div", {
285
260
  className: cx(accordion_module_default.accordionHeader, o ? accordion_module_default.clickable : ""),
@@ -289,12 +264,9 @@ const Collapse = ({ children: e, expanded: t }) => /* @__PURE__ */ jsx(CSSTransi
289
264
  className: accordion_module_default.heading,
290
265
  children: e
291
266
  })]
292
- }), /* @__PURE__ */ jsx(Collapse, {
293
- expanded: t,
294
- children: /* @__PURE__ */ jsx("div", {
295
- className: cx(accordion_module_default.accordionContent, n && r ? accordion_module_default.padding : ""),
296
- children: i
297
- })
267
+ }), t && i && /* @__PURE__ */ jsx("div", {
268
+ className: cx(accordion_module_default.accordionContent, n && r ? accordion_module_default.padding : ""),
269
+ children: i
298
270
  })]
299
271
  }), AccordionManaged = ({ heading: t, bordered: n, padding: r, expanded: i = !1, children: a, testId: o }) => {
300
272
  let [s, c] = React.useState(i);
@@ -329,11 +301,9 @@ var check_box_module_default = {
329
301
  isInTable: "_isInTable_oo4mp_99",
330
302
  helpIconEnabled: "_helpIconEnabled_oo4mp_102"
331
303
  }, tooltip_module_default = {
332
- tooltip: "_tooltip_hixsm_1",
333
- error: "_error_hixsm_15",
334
- warning: "_warning_hixsm_19",
335
- enter: "_enter_hixsm_23",
336
- enterActive: "_enterActive_hixsm_26"
304
+ tooltip: "_tooltip_wli9z_1",
305
+ error: "_error_wli9z_15",
306
+ warning: "_warning_wli9z_19"
337
307
  };
338
308
  const TooltipLayer = ({ text: e = "", error: t = !1, warning: n = !1, maxWidth: r = "none", fontSize: i = "inherit", padding: a = "var(--padding-xxs) var(--padding-xs)", layerProps: o = { style: { position: "fixed" } }, arrowProps: s = { style: {
339
309
  top: "100%",
@@ -374,25 +344,16 @@ const TooltipLayer = ({ text: e = "", error: t = !1, warning: n = !1, maxWidth:
374
344
  possiblePlacements: a,
375
345
  onParentClose: v
376
346
  });
377
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(CSSTransition, {
378
- in: y,
379
- timeout: 100,
380
- classNames: {
381
- enter: tooltip_module_default.enter,
382
- enterActive: tooltip_module_default.enterActive
383
- },
384
- unmountOnExit: !0,
385
- children: /* @__PURE__ */ jsx(Fragment$1, { children: y && b(/* @__PURE__ */ jsx(TooltipLayer, {
386
- text: t,
387
- error: n,
388
- warning: s,
389
- padding: d,
390
- maxWidth: c,
391
- fontSize: u,
392
- layerProps: S,
393
- arrowProps: C
394
- })) })
395
- }), /* @__PURE__ */ jsx("span", {
347
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [y && b(/* @__PURE__ */ jsx(TooltipLayer, {
348
+ text: t,
349
+ error: n,
350
+ warning: s,
351
+ padding: d,
352
+ maxWidth: c,
353
+ fontSize: u,
354
+ layerProps: S,
355
+ arrowProps: C
356
+ })), /* @__PURE__ */ jsx("span", {
396
357
  ...x,
397
358
  ..._,
398
359
  style: {
@@ -625,37 +586,35 @@ var actions_module_default = {
625
586
  actionComponentContainer: "_actionComponentContainer_1t7vd_14",
626
587
  active: "_active_1t7vd_36"
627
588
  }, menu_module_default = {
628
- wrapper: "_wrapper_15ymr_1",
629
- layer: "_layer_15ymr_5",
630
- layerContainer: "_layerContainer_15ymr_8",
631
- enter: "_enter_15ymr_24",
632
- enterActive: "_enterActive_15ymr_28",
633
- nested: "_nested_15ymr_33",
634
- fileInput: "_fileInput_15ymr_54",
635
- trigger: "_trigger_15ymr_59",
636
- middleAlignedInline: "_middleAlignedInline_15ymr_68",
637
- heading: "_heading_15ymr_74",
638
- headingIcon: "_headingIcon_15ymr_80",
639
- clickable: "_clickable_15ymr_87",
640
- option: "_option_15ymr_91",
641
- active: "_active_15ymr_110",
642
- disabled: "_disabled_15ymr_115",
643
- selected: "_selected_15ymr_119",
644
- optionContent: "_optionContent_15ymr_126",
645
- inline: "_inline_15ymr_130",
646
- icon: "_icon_15ymr_135",
647
- check: "_check_15ymr_136",
648
- text: "_text_15ymr_162",
649
- label: "_label_15ymr_167",
650
- description: "_description_15ymr_178",
651
- arrow: "_arrow_15ymr_182",
652
- divider: "_divider_15ymr_186",
653
- deprecatedSemanticIcon: "_deprecatedSemanticIcon_15ymr_190",
654
- buttonLabel: "_buttonLabel_15ymr_198",
655
- buttonCaret: "_buttonCaret_15ymr_204",
656
- component: "_component_15ymr_208",
657
- right: "_right_15ymr_214",
658
- actions: "_actions_15ymr_219"
589
+ wrapper: "_wrapper_9g7i6_1",
590
+ layer: "_layer_9g7i6_5",
591
+ layerContainer: "_layerContainer_9g7i6_8",
592
+ nested: "_nested_9g7i6_24",
593
+ fileInput: "_fileInput_9g7i6_36",
594
+ trigger: "_trigger_9g7i6_41",
595
+ middleAlignedInline: "_middleAlignedInline_9g7i6_50",
596
+ heading: "_heading_9g7i6_56",
597
+ headingIcon: "_headingIcon_9g7i6_62",
598
+ clickable: "_clickable_9g7i6_69",
599
+ option: "_option_9g7i6_73",
600
+ active: "_active_9g7i6_92",
601
+ disabled: "_disabled_9g7i6_97",
602
+ selected: "_selected_9g7i6_101",
603
+ optionContent: "_optionContent_9g7i6_108",
604
+ inline: "_inline_9g7i6_112",
605
+ icon: "_icon_9g7i6_117",
606
+ check: "_check_9g7i6_118",
607
+ text: "_text_9g7i6_144",
608
+ label: "_label_9g7i6_149",
609
+ description: "_description_9g7i6_160",
610
+ arrow: "_arrow_9g7i6_164",
611
+ divider: "_divider_9g7i6_168",
612
+ deprecatedSemanticIcon: "_deprecatedSemanticIcon_9g7i6_172",
613
+ buttonLabel: "_buttonLabel_9g7i6_180",
614
+ buttonCaret: "_buttonCaret_9g7i6_186",
615
+ component: "_component_9g7i6_190",
616
+ right: "_right_9g7i6_196",
617
+ actions: "_actions_9g7i6_201"
659
618
  };
660
619
  const Heading$3 = ({ label: e, onClick: t, icon: n, testId: r }) => /* @__PURE__ */ jsxs("div", {
661
620
  onClick: (e) => e.stopPropagation(),
@@ -1064,33 +1023,24 @@ const DropDownMenu = ({ menu: e, width: t, disabled: n = !1, badgeTitle: r, badg
1064
1023
  testId: g,
1065
1024
  selected: S,
1066
1025
  tabIndex: C
1067
- }), /* @__PURE__ */ jsx(CSSTransition, {
1068
- in: L,
1069
- timeout: 100,
1070
- classNames: {
1071
- enter: menu_module_default.enter,
1072
- enterActive: menu_module_default.enterActive
1073
- },
1074
- unmountOnExit: !0,
1075
- children: /* @__PURE__ */ jsx(Fragment$1, { children: L && U(/* @__PURE__ */ jsx("div", {
1076
- ...H,
1077
- className: menu_module_default.layerContainer,
1078
- "data-testid": e.testId,
1079
- onClick: (e) => e.stopPropagation(),
1080
- children: /* @__PURE__ */ jsx(Layer$2, {
1081
- sections: M,
1082
- isNested: o,
1083
- width: t,
1084
- closeOnOptionClick: c,
1085
- close: l || z,
1086
- tree: u,
1087
- path: d,
1088
- maxHeight: h,
1089
- showAllButton: F,
1090
- testId: g && `${g}-layer`
1091
- })
1092
- })) })
1093
- })] });
1026
+ }), L && U(/* @__PURE__ */ jsx("div", {
1027
+ ...H,
1028
+ className: menu_module_default.layerContainer,
1029
+ "data-testid": e.testId,
1030
+ onClick: (e) => e.stopPropagation(),
1031
+ children: /* @__PURE__ */ jsx(Layer$2, {
1032
+ sections: M,
1033
+ isNested: o,
1034
+ width: t,
1035
+ closeOnOptionClick: c,
1036
+ close: l || z,
1037
+ tree: u,
1038
+ path: d,
1039
+ maxHeight: h,
1040
+ showAllButton: F,
1041
+ testId: g && `${g}-layer`
1042
+ })
1043
+ }))] });
1094
1044
  }, Menu = (e) => e.contextMenu ? /* @__PURE__ */ jsx(ContextMenu, {
1095
1045
  ...e,
1096
1046
  tree: {},
@@ -1760,37 +1710,22 @@ const FileInput = ({ label: e = "Select", loading: t = !1, placeholder: n = "No
1760
1710
  }, [e]), n ? createPortal(t, n) : null;
1761
1711
  };
1762
1712
  var modal_module_default = {
1763
- wrapper: "_wrapper_1sv3a_1",
1764
- enter: "_enter_1sv3a_15",
1765
- enterActive: "_enterActive_1sv3a_18",
1766
- exit: "_exit_1sv3a_22",
1767
- exitActive: "_exitActive_1sv3a_25",
1768
- contentContainer: "_contentContainer_1sv3a_29",
1769
- centered: "_centered_1sv3a_52",
1770
- newLine: "_newLine_1sv3a_56"
1771
- }, Wrapper = ({ children: e, visible: t }) => {
1772
- let n = useRef(null);
1713
+ wrapper: "_wrapper_sb0hc_1",
1714
+ contentContainer: "_contentContainer_sb0hc_15",
1715
+ centered: "_centered_sb0hc_24",
1716
+ newLine: "_newLine_sb0hc_28"
1717
+ }, Wrapper = ({ children: e }) => {
1718
+ let t = useRef(null);
1773
1719
  return useEffect(() => {
1774
- if (n.current) {
1775
- let e = n.current.querySelector("[tabindex=\"0\"]");
1776
- e ? e.focus() : n.current.focus();
1720
+ if (t.current) {
1721
+ let e = t.current.querySelector("[tabindex=\"0\"]");
1722
+ e ? e.focus() : t.current.focus();
1777
1723
  }
1778
- }, []), /* @__PURE__ */ jsx(CSSTransition, {
1779
- in: t,
1780
- timeout: 100,
1781
- classNames: {
1782
- enter: modal_module_default.enter,
1783
- enterActive: modal_module_default.enterActive,
1784
- exit: modal_module_default.exit,
1785
- exitActive: modal_module_default.exitActive
1786
- },
1787
- unmountOnExit: !0,
1788
- children: /* @__PURE__ */ jsx("div", {
1789
- ref: n,
1790
- tabIndex: -1,
1791
- className: cx(modal_module_default.wrapper),
1792
- children: t && e
1793
- })
1724
+ }, []), /* @__PURE__ */ jsx("div", {
1725
+ ref: t,
1726
+ tabIndex: -1,
1727
+ className: cx(modal_module_default.wrapper),
1728
+ children: e
1794
1729
  });
1795
1730
  }, Content$2 = ({ children: e, width: t, centered: n }) => /* @__PURE__ */ jsx("div", {
1796
1731
  className: cx(modal_module_default.contentContainer, n ? modal_module_default.centered : ""),
@@ -1809,17 +1744,14 @@ const Modal = ({ children: e, visible: t = !1, centered: n = !1, width: r = "100
1809
1744
  t && i && i();
1810
1745
  }, [t, i]), useKeyboardEvent("Escape", () => {
1811
1746
  t && a && a();
1812
- }, [t, a]), /* @__PURE__ */ jsx(Portal, {
1747
+ }, [t, a]), /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Portal, {
1813
1748
  id: o,
1814
- children: /* @__PURE__ */ jsx(Wrapper, {
1815
- visible: t,
1816
- children: /* @__PURE__ */ jsx(Content$2, {
1817
- width: r,
1818
- centered: n,
1819
- children: e
1820
- })
1821
- })
1822
- });
1749
+ children: t ? /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsx(Content$2, {
1750
+ width: r,
1751
+ centered: n,
1752
+ children: e
1753
+ }) }) : null
1754
+ }) });
1823
1755
  };
1824
1756
  var progress_bar_module_default = {
1825
1757
  progress: "_progress_23ror_1",
@@ -2034,13 +1966,10 @@ var reducer$1 = (e, t) => {
2034
1966
  className: cx(message_module_default.legendToggle),
2035
1967
  onClick: n,
2036
1968
  children: t ? "Hide details" : "Show details"
2037
- }), /* @__PURE__ */ jsx(Collapse, {
2038
- expanded: t,
2039
- children: /* @__PURE__ */ jsx("div", {
2040
- className: message_module_default.detailsText,
2041
- children: e
2042
- })
2043
- })] }), DialogIcon = ({ type: e }) => {
1969
+ }), t ? /* @__PURE__ */ jsx("div", {
1970
+ className: message_module_default.detailsText,
1971
+ children: e
1972
+ }) : null] }), DialogIcon = ({ type: e }) => {
2044
1973
  switch (e) {
2045
1974
  case MessageType.SUCCESS: return /* @__PURE__ */ jsx(Icon, {
2046
1975
  icon: IconType.SUCCESS,
@@ -2225,22 +2154,20 @@ const useWindowWidth = () => {
2225
2154
  }), []), e;
2226
2155
  };
2227
2156
  var custom_select_module_default = {
2228
- layerContainer: "_layerContainer_q5iac_1",
2229
- layer: "_layer_q5iac_1",
2230
- enter: "_enter_q5iac_14",
2231
- enterActive: "_enterActive_q5iac_18",
2232
- small: "_small_q5iac_32",
2233
- heading: "_heading_q5iac_35",
2234
- option: "_option_q5iac_36",
2235
- message: "_message_q5iac_37",
2236
- focused: "_focused_q5iac_76",
2237
- selected: "_selected_q5iac_80",
2238
- disabled: "_disabled_q5iac_83",
2239
- check: "_check_q5iac_87",
2240
- optionContent: "_optionContent_q5iac_104",
2241
- label: "_label_q5iac_109",
2242
- icon: "_icon_q5iac_116",
2243
- details: "_details_q5iac_121"
2157
+ layerContainer: "_layerContainer_41zze_1",
2158
+ layer: "_layer_41zze_1",
2159
+ small: "_small_41zze_23",
2160
+ heading: "_heading_41zze_26",
2161
+ option: "_option_41zze_27",
2162
+ message: "_message_41zze_28",
2163
+ focused: "_focused_41zze_67",
2164
+ selected: "_selected_41zze_71",
2165
+ disabled: "_disabled_41zze_74",
2166
+ check: "_check_41zze_78",
2167
+ optionContent: "_optionContent_41zze_95",
2168
+ label: "_label_41zze_100",
2169
+ icon: "_icon_41zze_107",
2170
+ details: "_details_41zze_112"
2244
2171
  };
2245
2172
  const Heading$2 = ({ label: e }) => /* @__PURE__ */ jsx("div", {
2246
2173
  onClick: (e) => e.stopPropagation(),
@@ -2783,36 +2710,27 @@ const useCustomSelectLogic = ({ state: e, dispatch: t, options: n, setTriggerFoc
2783
2710
  placeholder: u,
2784
2711
  right: w,
2785
2712
  testId: T
2786
- }), /* @__PURE__ */ jsx(CSSTransition, {
2787
- in: M.isLayerOpen,
2788
- timeout: 100,
2789
- classNames: {
2790
- enter: custom_select_module_default.enter,
2791
- enterActive: custom_select_module_default.enterActive
2792
- },
2793
- unmountOnExit: !0,
2794
- children: /* @__PURE__ */ jsx(Fragment$1, { children: M.isLayerOpen && H(/* @__PURE__ */ jsx("div", {
2795
- ...U,
2796
- className: custom_select_module_default.layerContainer,
2797
- children: /* @__PURE__ */ jsx(Layer$1, {
2798
- listRef: O,
2799
- isMulti: t,
2800
- sections: M.visibleOptions,
2801
- selectedOptions: c,
2802
- onSelectOption: (e, n) => {
2803
- G(e, n, t ? void 0 : W);
2804
- },
2805
- closeLayer: () => {
2806
- b && W();
2807
- },
2808
- width: K(q),
2809
- small: d,
2810
- focusedOptionIndex: M.layerFocus.current,
2811
- firstSelectedOptionIndex: C ?? 0,
2812
- testId: T && `${T}-layer`
2813
- })
2814
- })) })
2815
- })]
2713
+ }), M.isLayerOpen && H(/* @__PURE__ */ jsx("div", {
2714
+ ...U,
2715
+ className: custom_select_module_default.layerContainer,
2716
+ children: /* @__PURE__ */ jsx(Layer$1, {
2717
+ listRef: O,
2718
+ isMulti: t,
2719
+ sections: M.visibleOptions,
2720
+ selectedOptions: c,
2721
+ onSelectOption: (e, n) => {
2722
+ G(e, n, t ? void 0 : W);
2723
+ },
2724
+ closeLayer: () => {
2725
+ b && W();
2726
+ },
2727
+ width: K(q),
2728
+ small: d,
2729
+ focusedOptionIndex: M.layerFocus.current,
2730
+ firstSelectedOptionIndex: C ?? 0,
2731
+ testId: T && `${T}-layer`
2732
+ })
2733
+ }))]
2816
2734
  });
2817
2735
  }, isEmptyNullOrUndefined = (e) => e == null || e === "", isNumericLike = (e) => /^-?\d+(\.\d+)?$/.test(e.trim()), isMulti = (e) => e instanceof Array, standardizeOptions = (e, t) => t && Array.isArray(e) ? e.map((e) => typeof e == "string" || typeof e == "number" ? {
2818
2736
  label: e,
@@ -3409,11 +3327,9 @@ const Slider = ({ name: e, label: t, width: n = "100%", labelWidth: r = "auto",
3409
3327
  });
3410
3328
  }, ActionsCell = ({ cell: e }) => /* @__PURE__ */ jsx(Actions, { actions: e.actions });
3411
3329
  var popover_module_default = {
3412
- toggleBox: "_toggleBox_rwod1_1",
3413
- enter: "_enter_rwod1_8",
3414
- enterActive: "_enterActive_rwod1_12",
3415
- fullWidthStyleFix: "_fullWidthStyleFix_rwod1_17",
3416
- dismiss: "_dismiss_rwod1_22"
3330
+ toggleBox: "_toggleBox_lhie5_1",
3331
+ fullWidthStyleFix: "_fullWidthStyleFix_lhie5_8",
3332
+ dismiss: "_dismiss_lhie5_13"
3417
3333
  };
3418
3334
  const Popover = ({ children: t, content: n, placement: r = "top-center", closeOnOutsideClick: i = !0, fullWidth: a = !1, showCloseButton: o = !1, testId: l, disabled: u = !1, overflowContainer: d = !1, isOpen: f, onToggle: p }) => {
3419
3335
  let h = useContext(DisabledContext), [_, v] = f === void 0 ? useState(!1) : [f, p], y = () => {
@@ -3438,34 +3354,25 @@ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOn
3438
3354
  onClick: b,
3439
3355
  "data-testid": l,
3440
3356
  children: t
3441
- }), /* @__PURE__ */ jsx(CSSTransition, {
3442
- in: _,
3443
- timeout: 100,
3444
- classNames: {
3445
- enter: popover_module_default.enter,
3446
- enterActive: popover_module_default.enterActive
3447
- },
3448
- unmountOnExit: !0,
3449
- children: /* @__PURE__ */ jsx(Fragment$1, { children: _ && x(/* @__PURE__ */ jsxs("div", {
3450
- className: a ? cx(popover_module_default.toggleBox, popover_module_default.fullWidthStyleFix) : cx(popover_module_default.toggleBox),
3451
- ...C,
3452
- children: [/* @__PURE__ */ jsxs("div", { children: [React.isValidElement(n) ? React.cloneElement(n, { close: y }) : n, o && /* @__PURE__ */ jsx("div", {
3453
- className: popover_module_default.dismiss,
3454
- children: /* @__PURE__ */ jsx(Button, {
3455
- small: !0,
3456
- round: !0,
3457
- onClick: y,
3458
- icon: IconType.CLOSE
3459
- })
3460
- })] }), /* @__PURE__ */ jsx(Arrow, {
3461
- ...S,
3462
- backgroundColor: "var(--color-background-layer)",
3463
- borderColor: "var(--color-border)",
3464
- borderWidth: 1,
3465
- size: 6
3466
- })]
3467
- })) })
3468
- })] });
3357
+ }), _ && x(/* @__PURE__ */ jsxs("div", {
3358
+ className: a ? cx(popover_module_default.toggleBox, popover_module_default.fullWidthStyleFix) : cx(popover_module_default.toggleBox),
3359
+ ...C,
3360
+ children: [/* @__PURE__ */ jsxs("div", { children: [React.isValidElement(n) ? React.cloneElement(n, { close: y }) : n, o && /* @__PURE__ */ jsx("div", {
3361
+ className: popover_module_default.dismiss,
3362
+ children: /* @__PURE__ */ jsx(Button, {
3363
+ small: !0,
3364
+ round: !0,
3365
+ onClick: y,
3366
+ icon: IconType.CLOSE
3367
+ })
3368
+ })] }), /* @__PURE__ */ jsx(Arrow, {
3369
+ ...S,
3370
+ backgroundColor: "var(--color-background-layer)",
3371
+ borderColor: "var(--color-border)",
3372
+ borderWidth: 1,
3373
+ size: 6
3374
+ })]
3375
+ }))] });
3469
3376
  }, CellHelpIcon = ({ cell: e }) => {
3470
3377
  let { helpIcon: t } = e;
3471
3378
  return t ? /* @__PURE__ */ jsx("div", {
@@ -4777,8 +4684,12 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
4777
4684
  units: [],
4778
4685
  errors: []
4779
4686
  }
4780
- })), m && m?.("all");
4781
- }, [t.modalVisibility, y]), S = useCallback((e, n) => {
4687
+ })), m?.("all");
4688
+ }, [
4689
+ i,
4690
+ y,
4691
+ m
4692
+ ]), S = useCallback((e, n) => {
4782
4693
  y({ modalVisibility: {
4783
4694
  ...t.modalVisibility,
4784
4695
  [e]: n
@@ -6689,7 +6600,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6689
6600
  } : {
6690
6601
  value: G,
6691
6602
  unit: U
6692
- }), Nd = k || K?.value === void 0, [J, Pd] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), Fd = !!(O || n), Y = C && C.find((e) => {
6603
+ }), Ad = k || K?.value === void 0, [J, jd] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), Md = !!(O || n), Y = C && C.find((e) => {
6693
6604
  if (!e?.value) return;
6694
6605
  if (E) return E === e.valueKey;
6695
6606
  let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = l } = convertUnit({
@@ -6698,7 +6609,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6698
6609
  toUnit: t
6699
6610
  });
6700
6611
  return withUnit(n, t) === e.value;
6701
- }), Id = () => {
6612
+ }), Nd = () => {
6702
6613
  let e = l ?? "", t = K.unit;
6703
6614
  if (checkConversion({
6704
6615
  value: e,
@@ -6712,7 +6623,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6712
6623
  return null;
6713
6624
  }
6714
6625
  } else return getAltUnitsListByQuantity(u)?.map((e) => ["", e?.unit]);
6715
- }, Ld = (t) => {
6626
+ }, Pd = (t) => {
6716
6627
  let n = getStringName(e), r = t.target, { value: i, selectionStart: a } = r, o = withUnit(i, K?.unit || ""), s = A ? withUnit(convertAndGetValue(o, B), B) : o;
6717
6628
  h({ target: {
6718
6629
  value: s,
@@ -6725,7 +6636,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6725
6636
  }), R(() => {
6726
6637
  r.selectionStart = a, r.selectionEnd = a;
6727
6638
  });
6728
- }, Rd = (e, t) => {
6639
+ }, Fd = (e, t) => {
6729
6640
  t === K.unit || isNaN(Number(e)) || (q({
6730
6641
  value: e,
6731
6642
  unit: t
@@ -6756,7 +6667,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6756
6667
  e !== void 0 && q({
6757
6668
  value: e,
6758
6669
  unit: t
6759
- }), C && Pd(Y && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
6670
+ }), C && jd(Y && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
6760
6671
  }
6761
6672
  }, [
6762
6673
  U,
@@ -6764,7 +6675,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6764
6675
  i,
6765
6676
  T
6766
6677
  ]);
6767
- let X = Id(), Z = label(K.unit) || K.unit || "", zd = p || !X || X && X.length === 1, Q = getStringName(e), $, Bd = (t) => {
6678
+ let X = Nd(), Z = label(K.unit) || K.unit || "", Id = p || !X || X && X.length === 1, Q = getStringName(e), $, Ld = (t) => {
6768
6679
  let r = t?.value ? t.value : "", [i = "", a = ""] = isValueWithUnit(r) ? split(r) : [r], o = withPrettyUnitLabel(r);
6769
6680
  if (checkConversion({
6770
6681
  value: r,
@@ -6784,7 +6695,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6784
6695
  type: MenuType.OPTION,
6785
6696
  inline: !0,
6786
6697
  onClick: () => {
6787
- validateNumber(i).valid && !n && (Pd(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
6698
+ validateNumber(i).valid && !n && (jd(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
6788
6699
  value: r,
6789
6700
  name: typeof e == "string" ? e : e?.fieldName || "",
6790
6701
  predefinedSelected: !0,
@@ -6811,10 +6722,10 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6811
6722
  label: "Custom",
6812
6723
  selected: J === PredefinedOptionsMenuState.CUSTOM
6813
6724
  }], C?.length) {
6814
- let e = C.map(Bd);
6725
+ let e = C.map(Ld);
6815
6726
  $ = [...$, ...e];
6816
6727
  }
6817
- let Vd = (e) => {
6728
+ let Rd = (e) => {
6818
6729
  if (isValueWithUnit(e)) {
6819
6730
  let t = getUnit(e), { value: n } = safeConvertValue({
6820
6731
  value: e,
@@ -6826,7 +6737,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6826
6737
  return n;
6827
6738
  }
6828
6739
  return e;
6829
- }, Hd = !C && (!F || F === GroupOrder.FIRST) ? GroupOrder.FIRST : GroupOrder.MIDDLE, Ud = !F || F === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
6740
+ }, zd = !C && (!F || F === GroupOrder.FIRST) ? GroupOrder.FIRST : GroupOrder.MIDDLE, Bd = !F || F === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
6830
6741
  return /* @__PURE__ */ jsx("div", {
6831
6742
  className: J === PredefinedOptionsMenuState.PREDEFINED ? cx(unit_input_module_default.predefinedMenuActive) : "",
6832
6743
  children: /* @__PURE__ */ jsxs(InputGroup, {
@@ -6858,31 +6769,31 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6858
6769
  name: Q,
6859
6770
  testId: x,
6860
6771
  disabled: n,
6861
- placeholder: Vd(t),
6772
+ placeholder: Rd(t),
6862
6773
  value: K.value,
6863
- onChange: Ld,
6774
+ onChange: Pd,
6864
6775
  onFocus: v,
6865
6776
  error: i === null ? void 0 : i,
6866
6777
  warning: S === null ? void 0 : S,
6867
6778
  left: a,
6868
- allowEmpty: Nd,
6779
+ allowEmpty: Ad,
6869
6780
  validationCallback: (e, t) => D(Q, t),
6870
6781
  enableCosmeticRounding: j,
6871
6782
  enableDisplayRounding: M,
6872
6783
  roundDisplayValue: N,
6873
- groupOrder: Hd,
6874
- disableInternalErrorValidationMessages: Fd,
6784
+ groupOrder: zd,
6785
+ disableInternalErrorValidationMessages: Md,
6875
6786
  small: o,
6876
6787
  selectOnFocus: P,
6877
6788
  tooltip: I
6878
6789
  }, Q)
6879
6790
  }),
6880
- Z && (zd || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
6881
- groupOrder: Ud,
6791
+ Z && (Id || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
6792
+ groupOrder: Bd,
6882
6793
  small: o,
6883
6794
  children: Z
6884
6795
  }) : /* @__PURE__ */ jsx(Menu, {
6885
- groupOrder: Ud,
6796
+ groupOrder: Bd,
6886
6797
  maxHeight: 380,
6887
6798
  disabled: r,
6888
6799
  testId: x && `${x}-menu`,
@@ -6898,7 +6809,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6898
6809
  label: j ? safeRoundNumbers(i) : i,
6899
6810
  inline: !0,
6900
6811
  onClick: (n) => {
6901
- n.stopPropagation(), Rd(e, t);
6812
+ n.stopPropagation(), Fd(e, t);
6902
6813
  },
6903
6814
  description: r,
6904
6815
  selected: r === Z,
@@ -8775,4 +8686,4 @@ const ComparisonViewModal = ({ auditLog: e, auditLogs: t, data: n, isOpen: r, se
8775
8686
  }
8776
8687
  });
8777
8688
  };
8778
- export { Accordion, AccordionWithDefaultToggle, Actions, Align, AuditLog, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Collapse, Color, Column, Dialog, DiffViewer, DisabledContext, Divider, Drawer, ElementType, Empty, Field, FileButton, FileInput, Flex, FormRow, Grid, GroupOrder, Heading, HelpIcon, Icon, IconType, Input, InputGroup, InputGroupAddon, InputReaderMethods, InputType, Label, List, ListHeading, ListSubheading, Loader, Menu, MenuCarat, MenuType, Message, MessageType, Modal, NativeSelect, NumberInput, OptionDropdown, Page, Pagination, PopConfirm, Popover, Portal, PrintHeader, ProgressBar, RadioButton, RichTextInput, Row, Select, SettingField, SideBar, Slider, SmartUploadModal, Spacer, Spinner, Table, TableImportExport, Tabs, Text, TextArea, TextLink, TextTransform, Theme, Toaster, Toggle, Tooltip, TopBar, Tree, TriggerType, UnitInput, UnitTable, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth };
8689
+ export { Accordion, AccordionWithDefaultToggle, Actions, Align, AuditLog, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Color, Column, Dialog, DiffViewer, DisabledContext, Divider, Drawer, ElementType, Empty, Field, FileButton, FileInput, Flex, FormRow, Grid, GroupOrder, Heading, HelpIcon, Icon, IconType, Input, InputGroup, InputGroupAddon, InputReaderMethods, InputType, Label, List, ListHeading, ListSubheading, Loader, Menu, MenuCarat, MenuType, Message, MessageType, Modal, NativeSelect, NumberInput, OptionDropdown, Page, Pagination, PopConfirm, Popover, Portal, PrintHeader, ProgressBar, RadioButton, RichTextInput, Row, Select, SettingField, SideBar, Slider, SmartUploadModal, Spacer, Spinner, Table, TableImportExport, Tabs, Text, TextArea, TextLink, TextTransform, Theme, Toaster, Toggle, Tooltip, TopBar, Tree, TriggerType, UnitInput, UnitTable, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth };