@oliasoft-open-source/react-ui-library 10.7.0-beta-3 → 10.7.0-beta-5
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/global.css +54 -50
- package/dist/index.d.ts +2 -0
- package/dist/index.js +76 -53
- package/package.json +1 -1
package/dist/global.css
CHANGED
|
@@ -2628,90 +2628,90 @@ html[data-theme='dark'] {
|
|
|
2628
2628
|
height: 100%;
|
|
2629
2629
|
align-items: stretch;
|
|
2630
2630
|
}
|
|
2631
|
-
.
|
|
2631
|
+
._inputInTable_1xd1g_1 {
|
|
2632
2632
|
background-color: transparent;
|
|
2633
2633
|
border-radius: inherit !important;
|
|
2634
2634
|
height: var(--size);
|
|
2635
2635
|
min-height: 100%;
|
|
2636
2636
|
}
|
|
2637
|
-
.
|
|
2637
|
+
._inputInTable_1xd1g_1:not(:hover):not([data-error]):not([data-warning]) {
|
|
2638
2638
|
border-color: transparent;
|
|
2639
2639
|
}
|
|
2640
|
-
.
|
|
2640
|
+
._inputInTable_1xd1g_1:not(:focus) {
|
|
2641
2641
|
box-shadow: none;
|
|
2642
2642
|
}
|
|
2643
|
-
.
|
|
2643
|
+
._inputHover_1xd1g_13 {
|
|
2644
2644
|
position: relative;
|
|
2645
2645
|
border-color: var(--color-border-hover);
|
|
2646
2646
|
z-index: 2;
|
|
2647
2647
|
}
|
|
2648
|
-
.
|
|
2648
|
+
._inputFocus_1xd1g_18 {
|
|
2649
2649
|
position: relative;
|
|
2650
2650
|
outline: none !important;
|
|
2651
2651
|
border-color: var(--color-border-focus) !important;
|
|
2652
2652
|
box-shadow: var(--shadow-focus);
|
|
2653
2653
|
z-index: 3;
|
|
2654
2654
|
}
|
|
2655
|
-
.
|
|
2655
|
+
._controlFocusVisible_1xd1g_25 {
|
|
2656
2656
|
outline: none;
|
|
2657
2657
|
box-shadow: var(--shadow-focus);
|
|
2658
2658
|
}
|
|
2659
|
-
.
|
|
2660
|
-
.
|
|
2659
|
+
._inputError_1xd1g_29,
|
|
2660
|
+
._inputWarning_1xd1g_30 {
|
|
2661
2661
|
position: relative;
|
|
2662
2662
|
}
|
|
2663
|
-
.
|
|
2663
|
+
._inputError_1xd1g_29 {
|
|
2664
2664
|
z-index: 2;
|
|
2665
2665
|
border-color: var(--color-border-error);
|
|
2666
2666
|
color: var(--color-text-error) !important;
|
|
2667
2667
|
background-color: var(--color-background-error-muted);
|
|
2668
2668
|
}
|
|
2669
|
-
.
|
|
2669
|
+
._inputError_1xd1g_29:hover {
|
|
2670
2670
|
border-color: var(--color-border-error-hover) !important;
|
|
2671
2671
|
}
|
|
2672
|
-
.
|
|
2672
|
+
._inputError_1xd1g_29:focus {
|
|
2673
2673
|
position: relative;
|
|
2674
2674
|
outline: none !important;
|
|
2675
2675
|
border-color: var(--color-border-focus) !important;
|
|
2676
2676
|
box-shadow: var(--shadow-focus);
|
|
2677
2677
|
z-index: 3;
|
|
2678
2678
|
}
|
|
2679
|
-
.
|
|
2679
|
+
._inputWarning_1xd1g_30 {
|
|
2680
2680
|
z-index: 1;
|
|
2681
2681
|
border-color: var(--color-border-warning);
|
|
2682
2682
|
color: var(--color-text-warning) !important;
|
|
2683
2683
|
background-color: var(--color-background-warning-muted);
|
|
2684
2684
|
}
|
|
2685
|
-
.
|
|
2685
|
+
._inputWarning_1xd1g_30:hover {
|
|
2686
2686
|
border-color: var(--color-border-warning-hover) !important;
|
|
2687
2687
|
}
|
|
2688
|
-
.
|
|
2688
|
+
._inputWarning_1xd1g_30:focus {
|
|
2689
2689
|
position: relative;
|
|
2690
2690
|
outline: none !important;
|
|
2691
2691
|
border-color: var(--color-border-focus) !important;
|
|
2692
2692
|
box-shadow: var(--shadow-focus);
|
|
2693
2693
|
z-index: 3;
|
|
2694
2694
|
}
|
|
2695
|
-
.
|
|
2695
|
+
._inputDisabled_1xd1g_65 {
|
|
2696
2696
|
pointer-events: none;
|
|
2697
2697
|
background-color: var(--color-background-disabled);
|
|
2698
2698
|
color: var(--color-text-muted);
|
|
2699
2699
|
box-shadow: none;
|
|
2700
2700
|
}
|
|
2701
|
-
.
|
|
2701
|
+
._hideScrollbars_1xd1g_71 {
|
|
2702
2702
|
/* Firefox */
|
|
2703
2703
|
scrollbar-width: none;
|
|
2704
2704
|
/* IE 10+ */
|
|
2705
2705
|
-ms-overflow-style: none;
|
|
2706
2706
|
/* Chrome, Safari and Opera */
|
|
2707
2707
|
}
|
|
2708
|
-
.
|
|
2708
|
+
._hideScrollbars_1xd1g_71::-webkit-scrollbar {
|
|
2709
2709
|
display: none;
|
|
2710
2710
|
}
|
|
2711
|
-
.
|
|
2711
|
+
._wrapper_1xd1g_81 {
|
|
2712
2712
|
position: relative;
|
|
2713
2713
|
}
|
|
2714
|
-
.
|
|
2714
|
+
._input_1xd1g_1 {
|
|
2715
2715
|
margin: 0;
|
|
2716
2716
|
outline: 0;
|
|
2717
2717
|
text-align: left;
|
|
@@ -2731,93 +2731,93 @@ html[data-theme='dark'] {
|
|
|
2731
2731
|
position: relative;
|
|
2732
2732
|
font-variant-numeric: tabular-nums;
|
|
2733
2733
|
}
|
|
2734
|
-
.
|
|
2734
|
+
._input_1xd1g_1::placeholder {
|
|
2735
2735
|
color: var(--color-text-placeholder);
|
|
2736
2736
|
}
|
|
2737
|
-
.
|
|
2737
|
+
._input_1xd1g_1._isInTable_1xd1g_107 {
|
|
2738
2738
|
background-color: transparent;
|
|
2739
2739
|
border-radius: inherit !important;
|
|
2740
2740
|
height: var(--size);
|
|
2741
2741
|
min-height: 100%;
|
|
2742
2742
|
}
|
|
2743
|
-
.
|
|
2743
|
+
._input_1xd1g_1._isInTable_1xd1g_107:not(:hover):not([data-error]):not([data-warning]) {
|
|
2744
2744
|
border-color: transparent;
|
|
2745
2745
|
}
|
|
2746
|
-
.
|
|
2746
|
+
._input_1xd1g_1._isInTable_1xd1g_107:not(:focus) {
|
|
2747
2747
|
box-shadow: none;
|
|
2748
2748
|
}
|
|
2749
|
-
.
|
|
2749
|
+
._input_1xd1g_1:hover {
|
|
2750
2750
|
position: relative;
|
|
2751
2751
|
border-color: var(--color-border-hover);
|
|
2752
2752
|
z-index: 2;
|
|
2753
2753
|
}
|
|
2754
|
-
.
|
|
2754
|
+
._input_1xd1g_1:focus {
|
|
2755
2755
|
position: relative;
|
|
2756
2756
|
outline: none !important;
|
|
2757
2757
|
border-color: var(--color-border-focus) !important;
|
|
2758
2758
|
box-shadow: var(--shadow-focus);
|
|
2759
2759
|
z-index: 3;
|
|
2760
2760
|
}
|
|
2761
|
-
.
|
|
2761
|
+
._input_1xd1g_1._small_1xd1g_131 {
|
|
2762
2762
|
font-size: var(--font-size-sm);
|
|
2763
2763
|
height: var(--size-sm);
|
|
2764
2764
|
padding: var(--padding-input-sm);
|
|
2765
2765
|
line-height: var(--size-sm);
|
|
2766
2766
|
}
|
|
2767
|
-
.
|
|
2767
|
+
._input_1xd1g_1[data-warning] {
|
|
2768
2768
|
position: relative;
|
|
2769
2769
|
z-index: 1;
|
|
2770
2770
|
border-color: var(--color-border-warning);
|
|
2771
2771
|
color: var(--color-text-warning) !important;
|
|
2772
2772
|
background-color: var(--color-background-warning-muted);
|
|
2773
2773
|
}
|
|
2774
|
-
.
|
|
2774
|
+
._input_1xd1g_1[data-warning]:hover {
|
|
2775
2775
|
border-color: var(--color-border-warning-hover) !important;
|
|
2776
2776
|
}
|
|
2777
|
-
.
|
|
2777
|
+
._input_1xd1g_1[data-warning]:focus {
|
|
2778
2778
|
position: relative;
|
|
2779
2779
|
outline: none !important;
|
|
2780
2780
|
border-color: var(--color-border-focus) !important;
|
|
2781
2781
|
box-shadow: var(--shadow-focus);
|
|
2782
2782
|
z-index: 3;
|
|
2783
2783
|
}
|
|
2784
|
-
.
|
|
2784
|
+
._input_1xd1g_1[data-error] {
|
|
2785
2785
|
position: relative;
|
|
2786
2786
|
z-index: 2;
|
|
2787
2787
|
border-color: var(--color-border-error);
|
|
2788
2788
|
color: var(--color-text-error) !important;
|
|
2789
2789
|
background-color: var(--color-background-error-muted);
|
|
2790
2790
|
}
|
|
2791
|
-
.
|
|
2791
|
+
._input_1xd1g_1[data-error]:hover {
|
|
2792
2792
|
border-color: var(--color-border-error-hover) !important;
|
|
2793
2793
|
}
|
|
2794
|
-
.
|
|
2794
|
+
._input_1xd1g_1[data-error]:focus {
|
|
2795
2795
|
position: relative;
|
|
2796
2796
|
outline: none !important;
|
|
2797
2797
|
border-color: var(--color-border-focus) !important;
|
|
2798
2798
|
box-shadow: var(--shadow-focus);
|
|
2799
2799
|
z-index: 3;
|
|
2800
2800
|
}
|
|
2801
|
-
.
|
|
2801
|
+
._input_1xd1g_1[disabled] {
|
|
2802
2802
|
pointer-events: none;
|
|
2803
2803
|
background-color: var(--color-background-disabled);
|
|
2804
2804
|
color: var(--color-text-muted);
|
|
2805
2805
|
box-shadow: none;
|
|
2806
2806
|
}
|
|
2807
|
-
.
|
|
2807
|
+
._input_1xd1g_1._right_1xd1g_177 {
|
|
2808
2808
|
text-align: right;
|
|
2809
2809
|
}
|
|
2810
|
-
.
|
|
2811
|
-
.
|
|
2810
|
+
._groupOrderFirst_1xd1g_180 ._input_1xd1g_1,
|
|
2811
|
+
._groupOrderMiddle_1xd1g_181 ._input_1xd1g_1 {
|
|
2812
2812
|
border-top-right-radius: 0 !important;
|
|
2813
2813
|
border-bottom-right-radius: 0 !important;
|
|
2814
2814
|
}
|
|
2815
|
-
.
|
|
2816
|
-
.
|
|
2815
|
+
._groupOrderLast_1xd1g_185 ._input_1xd1g_1,
|
|
2816
|
+
._groupOrderMiddle_1xd1g_181 ._input_1xd1g_1 {
|
|
2817
2817
|
border-top-left-radius: 0 !important;
|
|
2818
2818
|
border-bottom-left-radius: 0 !important;
|
|
2819
2819
|
}
|
|
2820
|
-
.
|
|
2820
|
+
._slot_1xd1g_190 {
|
|
2821
2821
|
position: absolute;
|
|
2822
2822
|
top: 1px;
|
|
2823
2823
|
bottom: 1px;
|
|
@@ -2827,33 +2827,33 @@ html[data-theme='dark'] {
|
|
|
2827
2827
|
overflow: hidden;
|
|
2828
2828
|
pointer-events: none;
|
|
2829
2829
|
}
|
|
2830
|
-
.
|
|
2830
|
+
._slot_1xd1g_190 button {
|
|
2831
2831
|
min-height: 0;
|
|
2832
2832
|
border-radius: 0;
|
|
2833
2833
|
line-height: 1;
|
|
2834
2834
|
}
|
|
2835
|
-
|
|
2835
|
+
._slot_1xd1g_190 > * {
|
|
2836
2836
|
pointer-events: auto;
|
|
2837
2837
|
}
|
|
2838
|
-
.
|
|
2838
|
+
._slotLeft_1xd1g_208 {
|
|
2839
2839
|
left: 1px;
|
|
2840
2840
|
border-top-left-radius: calc(var(--border-radius) - 1px);
|
|
2841
2841
|
border-bottom-left-radius: calc(var(--border-radius) - 1px);
|
|
2842
2842
|
}
|
|
2843
|
-
.
|
|
2843
|
+
._slotRight_1xd1g_213 {
|
|
2844
2844
|
right: 1px;
|
|
2845
2845
|
border-top-right-radius: calc(var(--border-radius) - 1px);
|
|
2846
2846
|
border-bottom-right-radius: calc(var(--border-radius) - 1px);
|
|
2847
2847
|
}
|
|
2848
|
-
.
|
|
2849
|
-
.
|
|
2848
|
+
._groupOrderFirst_1xd1g_180 ._slotRight_1xd1g_213,
|
|
2849
|
+
._groupOrderMiddle_1xd1g_181 ._slotRight_1xd1g_213 {
|
|
2850
2850
|
border-radius: 0;
|
|
2851
2851
|
}
|
|
2852
|
-
.
|
|
2853
|
-
.
|
|
2852
|
+
._groupOrderLast_1xd1g_185 ._slotLeft_1xd1g_208,
|
|
2853
|
+
._groupOrderMiddle_1xd1g_181 ._slotLeft_1xd1g_208 {
|
|
2854
2854
|
border-radius: 0;
|
|
2855
2855
|
}
|
|
2856
|
-
.
|
|
2856
|
+
._icon_1xd1g_226 {
|
|
2857
2857
|
aspect-ratio: 1;
|
|
2858
2858
|
display: flex;
|
|
2859
2859
|
align-items: center;
|
|
@@ -4485,10 +4485,14 @@ tbody ._staticCell_1vfnu_133 ._staticCellContent_1vfnu_136 {
|
|
|
4485
4485
|
display: flex;
|
|
4486
4486
|
justify-content: center;
|
|
4487
4487
|
}
|
|
4488
|
-
.
|
|
4488
|
+
._unitInput_yuqdd_1 {
|
|
4489
|
+
flex: 1 1 auto;
|
|
4490
|
+
min-width: 0;
|
|
4491
|
+
}
|
|
4492
|
+
._predefinedMenuActive_yuqdd_5 input {
|
|
4489
4493
|
color: var(--color-text-faint) !important;
|
|
4490
4494
|
}
|
|
4491
|
-
.
|
|
4495
|
+
._isInTable_yuqdd_8 {
|
|
4492
4496
|
height: 100%;
|
|
4493
4497
|
}
|
|
4494
4498
|
._container_9tr5w_1 {
|
package/dist/index.d.ts
CHANGED
|
@@ -963,6 +963,8 @@ export declare interface IMenuMenu {
|
|
|
963
963
|
trigger: TTriggerType | string;
|
|
964
964
|
title?: string;
|
|
965
965
|
colored?: boolean | string;
|
|
966
|
+
basic?: boolean;
|
|
967
|
+
fontWeight?: default_2.CSSProperties['fontWeight'];
|
|
966
968
|
small?: boolean;
|
|
967
969
|
label?: ReactNode | string;
|
|
968
970
|
component?: ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -1406,7 +1406,7 @@ var Badge = ({ children, color = "", textColor: textColorProp = "", title = null
|
|
|
1406
1406
|
};
|
|
1407
1407
|
//#endregion
|
|
1408
1408
|
//#region src/components/menu/trigger/button.tsx
|
|
1409
|
-
var Button$1 = React.forwardRef(({ trigger, label, colored, small, width, disabled, groupOrder, loading, error, warning, active, tabIndex, testId, ...domProps }, ref) => {
|
|
1409
|
+
var Button$1 = React.forwardRef(({ trigger, label, colored, basic, fontWeight, small, width, disabled, groupOrder, loading, error, warning, active, tabIndex, testId, ...domProps }, ref) => {
|
|
1410
1410
|
const disabledContext = useContext(DisabledContext);
|
|
1411
1411
|
const isDropdown = trigger === TriggerType.DROP_DOWN_BUTTON;
|
|
1412
1412
|
return /* @__PURE__ */ jsx(Button, {
|
|
@@ -1416,6 +1416,8 @@ var Button$1 = React.forwardRef(({ trigger, label, colored, small, width, disabl
|
|
|
1416
1416
|
children: label
|
|
1417
1417
|
}),
|
|
1418
1418
|
colored,
|
|
1419
|
+
basic,
|
|
1420
|
+
fontWeight,
|
|
1419
1421
|
small,
|
|
1420
1422
|
width,
|
|
1421
1423
|
groupOrder,
|
|
@@ -1498,7 +1500,7 @@ var withBadge = (children, { isNested, badgeTitle, badgeDot }) => !isNested && (
|
|
|
1498
1500
|
* Renders the menu trigger control only (Button / Text / Component).
|
|
1499
1501
|
* OverlayTriggerChild owns the Pressable host — do not wrap a focus shell here.
|
|
1500
1502
|
*/
|
|
1501
|
-
var Trigger$1 = React.forwardRef(({ active, disabled, loading, width, trigger, label, title, colored, small, isNested, component, groupOrder, isOpen, error, warning, testId, selected, tabIndex, ...domProps }, ref) => {
|
|
1503
|
+
var Trigger$1 = React.forwardRef(({ active, disabled, loading, width, trigger, label, title, colored, basic, fontWeight, small, isNested, component, groupOrder, isOpen, error, warning, testId, selected, tabIndex, ...domProps }, ref) => {
|
|
1502
1504
|
const isButtonTrigger = trigger === TriggerType.BUTTON || trigger === TriggerType.DROP_DOWN_BUTTON;
|
|
1503
1505
|
const isComponentTrigger = trigger === TriggerType.COMPONENT;
|
|
1504
1506
|
if (isButtonTrigger) return /* @__PURE__ */ jsx(Button$1, {
|
|
@@ -1506,6 +1508,8 @@ var Trigger$1 = React.forwardRef(({ active, disabled, loading, width, trigger, l
|
|
|
1506
1508
|
trigger,
|
|
1507
1509
|
label: label !== null && label !== void 0 ? label : "",
|
|
1508
1510
|
colored,
|
|
1511
|
+
basic,
|
|
1512
|
+
fontWeight,
|
|
1509
1513
|
small,
|
|
1510
1514
|
width,
|
|
1511
1515
|
disabled,
|
|
@@ -1546,7 +1550,7 @@ var Menu = ({ menu, width, disabled = false, badgeTitle, badgeDot = false, loadi
|
|
|
1546
1550
|
const disabledContext = useContext(DisabledContext);
|
|
1547
1551
|
const triggerRef = useRef(null);
|
|
1548
1552
|
const [internalOpen, setInternalOpen] = useState(false);
|
|
1549
|
-
const { label, title, trigger, colored, small, sections, component, placement, showAllButton } = menu;
|
|
1553
|
+
const { label, title, trigger, colored, basic, fontWeight, small, sections, component, placement, showAllButton } = menu;
|
|
1550
1554
|
const isControlled = isBoolean(openProp) && isFunction(setOpenProp);
|
|
1551
1555
|
const isOpen = isControlled ? openProp : internalOpen;
|
|
1552
1556
|
const isDisabled = disabled || isMenuEmpty(menu) || disabledContext;
|
|
@@ -1591,6 +1595,8 @@ var Menu = ({ menu, width, disabled = false, badgeTitle, badgeDot = false, loadi
|
|
|
1591
1595
|
label,
|
|
1592
1596
|
title,
|
|
1593
1597
|
colored,
|
|
1598
|
+
basic,
|
|
1599
|
+
fontWeight,
|
|
1594
1600
|
small,
|
|
1595
1601
|
component,
|
|
1596
1602
|
groupOrder,
|
|
@@ -2740,26 +2746,26 @@ var useElementWidth = (enabled = true) => {
|
|
|
2740
2746
|
return [ref, width];
|
|
2741
2747
|
};
|
|
2742
2748
|
var input_module_default = {
|
|
2743
|
-
inputInTable: "
|
|
2744
|
-
inputHover: "
|
|
2745
|
-
inputFocus: "
|
|
2746
|
-
controlFocusVisible: "
|
|
2747
|
-
inputError: "
|
|
2748
|
-
inputWarning: "
|
|
2749
|
-
inputDisabled: "
|
|
2750
|
-
hideScrollbars: "
|
|
2751
|
-
wrapper: "
|
|
2752
|
-
input: "
|
|
2753
|
-
isInTable: "
|
|
2754
|
-
small: "
|
|
2755
|
-
right: "
|
|
2756
|
-
groupOrderFirst: "
|
|
2757
|
-
groupOrderMiddle: "
|
|
2758
|
-
groupOrderLast: "
|
|
2759
|
-
slot: "
|
|
2760
|
-
slotLeft: "
|
|
2761
|
-
slotRight: "
|
|
2762
|
-
icon: "
|
|
2749
|
+
inputInTable: "_inputInTable_1xd1g_1",
|
|
2750
|
+
inputHover: "_inputHover_1xd1g_13",
|
|
2751
|
+
inputFocus: "_inputFocus_1xd1g_18",
|
|
2752
|
+
controlFocusVisible: "_controlFocusVisible_1xd1g_25",
|
|
2753
|
+
inputError: "_inputError_1xd1g_29",
|
|
2754
|
+
inputWarning: "_inputWarning_1xd1g_30",
|
|
2755
|
+
inputDisabled: "_inputDisabled_1xd1g_65",
|
|
2756
|
+
hideScrollbars: "_hideScrollbars_1xd1g_71",
|
|
2757
|
+
wrapper: "_wrapper_1xd1g_81",
|
|
2758
|
+
input: "_input_1xd1g_1",
|
|
2759
|
+
isInTable: "_isInTable_1xd1g_107",
|
|
2760
|
+
small: "_small_1xd1g_131",
|
|
2761
|
+
right: "_right_1xd1g_177",
|
|
2762
|
+
groupOrderFirst: "_groupOrderFirst_1xd1g_180",
|
|
2763
|
+
groupOrderMiddle: "_groupOrderMiddle_1xd1g_181",
|
|
2764
|
+
groupOrderLast: "_groupOrderLast_1xd1g_185",
|
|
2765
|
+
slot: "_slot_1xd1g_190",
|
|
2766
|
+
slotLeft: "_slotLeft_1xd1g_208",
|
|
2767
|
+
slotRight: "_slotRight_1xd1g_213",
|
|
2768
|
+
icon: "_icon_1xd1g_226"
|
|
2763
2769
|
};
|
|
2764
2770
|
//#endregion
|
|
2765
2771
|
//#region src/components/input/input.tsx
|
|
@@ -4882,14 +4888,20 @@ var NumberInput = ({ name, placeholder = "", disabled = false, error = false, le
|
|
|
4882
4888
|
const stringName = getStringName$1(name);
|
|
4883
4889
|
const { valid, errors } = validateInputValue(displayValue);
|
|
4884
4890
|
const firstError = errors && errors.length && !disableInternalErrorValidationMessages ? errors[0] : null;
|
|
4885
|
-
|
|
4886
|
-
const nextValue = cosmeticRound(toString(value));
|
|
4887
|
-
if (toNum(displayValue) !== toNum(nextValue)) setDisplayValue(nextValue);
|
|
4888
|
-
}, [
|
|
4891
|
+
const [previousInputs, setPreviousInputs] = useState({
|
|
4889
4892
|
value,
|
|
4890
4893
|
enableCosmeticRounding,
|
|
4891
4894
|
enableDisplayRounding
|
|
4892
|
-
|
|
4895
|
+
});
|
|
4896
|
+
if (!Object.is(previousInputs.value, value) || previousInputs.enableCosmeticRounding !== enableCosmeticRounding || previousInputs.enableDisplayRounding !== enableDisplayRounding) {
|
|
4897
|
+
setPreviousInputs({
|
|
4898
|
+
value,
|
|
4899
|
+
enableCosmeticRounding,
|
|
4900
|
+
enableDisplayRounding
|
|
4901
|
+
});
|
|
4902
|
+
const nextValue = cosmeticRound(toString(value));
|
|
4903
|
+
if (toNum(displayValue) !== toNum(nextValue)) setDisplayValue(nextValue);
|
|
4904
|
+
}
|
|
4893
4905
|
useEffect(() => {
|
|
4894
4906
|
if ((disableValidationOnFocus ? true : !focus) && !valid) validationCallback(stringName, firstError);
|
|
4895
4907
|
else validationCallback(stringName, null);
|
|
@@ -5009,15 +5021,6 @@ var useRunAfterUpdate = () => {
|
|
|
5009
5021
|
return runAfterUpdate;
|
|
5010
5022
|
};
|
|
5011
5023
|
//#endregion
|
|
5012
|
-
//#region src/components/unit-input/hooks/use-previous.ts
|
|
5013
|
-
var usePrevious = (value) => {
|
|
5014
|
-
const ref = useRef(void 0);
|
|
5015
|
-
useEffect(() => {
|
|
5016
|
-
ref.current = value;
|
|
5017
|
-
}, [value]);
|
|
5018
|
-
return ref.current;
|
|
5019
|
-
};
|
|
5020
|
-
//#endregion
|
|
5021
5024
|
//#region src/helpers/get-preferred-unit.ts
|
|
5022
5025
|
/**
|
|
5023
5026
|
* Retrieves the preferred unit for a given quantity from a specified unit template or defaults to a standard unit if not found.
|
|
@@ -5187,8 +5190,9 @@ var safeRoundNumbers = (value) => {
|
|
|
5187
5190
|
return !isScientificStringNum(value) ? roundByMagnitude(value) : value;
|
|
5188
5191
|
};
|
|
5189
5192
|
var unit_input_module_default = {
|
|
5190
|
-
|
|
5191
|
-
|
|
5193
|
+
unitInput: "_unitInput_yuqdd_1",
|
|
5194
|
+
predefinedMenuActive: "_predefinedMenuActive_yuqdd_5",
|
|
5195
|
+
isInTable: "_isInTable_yuqdd_8"
|
|
5192
5196
|
};
|
|
5193
5197
|
//#endregion
|
|
5194
5198
|
//#region src/components/unit-input/unit-input.tsx
|
|
@@ -5208,7 +5212,6 @@ var UnitInput = ({ name, placeholder = "", disabled = false, disabledUnit = fals
|
|
|
5208
5212
|
]);
|
|
5209
5213
|
const knownUnit = isKnownUnit(value, preferredUnit);
|
|
5210
5214
|
const initDisplayUnit = initUnit || preferredUnit || propUnit;
|
|
5211
|
-
const previousInitUnit = usePrevious(initDisplayUnit);
|
|
5212
5215
|
const { value: convertedValue } = safeConvertValue({
|
|
5213
5216
|
value,
|
|
5214
5217
|
toUnit: initDisplayUnit,
|
|
@@ -5283,11 +5286,23 @@ var UnitInput = ({ name, placeholder = "", disabled = false, disabledUnit = fals
|
|
|
5283
5286
|
});
|
|
5284
5287
|
if (onSwitchUnit) onSwitchUnit(nextUnit);
|
|
5285
5288
|
};
|
|
5286
|
-
|
|
5289
|
+
const [previousInputs, setPreviousInputs] = useState({
|
|
5290
|
+
initDisplayUnit,
|
|
5291
|
+
value,
|
|
5292
|
+
error,
|
|
5293
|
+
shouldLinkAutomaticly
|
|
5294
|
+
});
|
|
5295
|
+
if (previousInputs.initDisplayUnit !== initDisplayUnit || previousInputs.value !== value || previousInputs.error !== error || previousInputs.shouldLinkAutomaticly !== shouldLinkAutomaticly) {
|
|
5296
|
+
setPreviousInputs({
|
|
5297
|
+
initDisplayUnit,
|
|
5298
|
+
value,
|
|
5299
|
+
error,
|
|
5300
|
+
shouldLinkAutomaticly
|
|
5301
|
+
});
|
|
5287
5302
|
let newValue;
|
|
5288
5303
|
let newUnit = "";
|
|
5289
5304
|
if (initDisplayUnit) {
|
|
5290
|
-
if (
|
|
5305
|
+
if (previousInputs.initDisplayUnit !== initDisplayUnit) {
|
|
5291
5306
|
const { value: resultValue } = safeConvertValue({
|
|
5292
5307
|
value,
|
|
5293
5308
|
toUnit: initDisplayUnit,
|
|
@@ -5316,6 +5331,8 @@ var UnitInput = ({ name, placeholder = "", disabled = false, disabledUnit = fals
|
|
|
5316
5331
|
value: newValue,
|
|
5317
5332
|
unit: newUnit
|
|
5318
5333
|
});
|
|
5334
|
+
}
|
|
5335
|
+
useEffect(() => {
|
|
5319
5336
|
if (predefinedOptions && foundPredefinedMenuOption && shouldLinkAutomaticly) setPredefinedOptionsMenuState(PredefinedOptionsMenuState.PREDEFINED);
|
|
5320
5337
|
else setPredefinedOptionsMenuState(PredefinedOptionsMenuState.CUSTOM);
|
|
5321
5338
|
}, [
|
|
@@ -5397,7 +5414,8 @@ var UnitInput = ({ name, placeholder = "", disabled = false, disabledUnit = fals
|
|
|
5397
5414
|
return placeholder;
|
|
5398
5415
|
};
|
|
5399
5416
|
return /* @__PURE__ */ jsx("div", {
|
|
5400
|
-
className: cx(predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED && unit_input_module_default.predefinedMenuActive, isInTable && unit_input_module_default.isInTable),
|
|
5417
|
+
className: cx(unit_input_module_default.unitInput, predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED && unit_input_module_default.predefinedMenuActive, isInTable && unit_input_module_default.isInTable),
|
|
5418
|
+
style: { width },
|
|
5401
5419
|
children: /* @__PURE__ */ jsx(NumberInput, {
|
|
5402
5420
|
name: stringName,
|
|
5403
5421
|
testId,
|
|
@@ -5417,7 +5435,7 @@ var UnitInput = ({ name, placeholder = "", disabled = false, disabledUnit = fals
|
|
|
5417
5435
|
groupOrder,
|
|
5418
5436
|
disableInternalErrorValidationMessages,
|
|
5419
5437
|
small,
|
|
5420
|
-
width,
|
|
5438
|
+
width: "100%",
|
|
5421
5439
|
isInTable,
|
|
5422
5440
|
selectOnFocus,
|
|
5423
5441
|
tooltip,
|
|
@@ -5449,15 +5467,11 @@ var UnitInput = ({ name, placeholder = "", disabled = false, disabledUnit = fals
|
|
|
5449
5467
|
testId: testId && `${testId}-menu`,
|
|
5450
5468
|
tabIndex: -1,
|
|
5451
5469
|
menu: {
|
|
5452
|
-
trigger:
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
fontWeight: "normal",
|
|
5458
|
-
rightIcon: IconType.CHEVRON_DOWN,
|
|
5459
|
-
small
|
|
5460
|
-
}),
|
|
5470
|
+
trigger: TriggerType.DROP_DOWN_BUTTON,
|
|
5471
|
+
label: displayUnitLabel,
|
|
5472
|
+
colored: Color.MUTED,
|
|
5473
|
+
basic: true,
|
|
5474
|
+
fontWeight: "normal",
|
|
5461
5475
|
placement: "bottom-end",
|
|
5462
5476
|
small,
|
|
5463
5477
|
sections: alternativeUnits.map(([value = "", altUnit = "", label]) => {
|
|
@@ -10866,6 +10880,15 @@ var TreeTable = ({ allowParentReassignment, autoOpenActiveItems = false, canDrop
|
|
|
10866
10880
|
});
|
|
10867
10881
|
};
|
|
10868
10882
|
//#endregion
|
|
10883
|
+
//#region src/components/unit-input/hooks/use-previous.ts
|
|
10884
|
+
var usePrevious = (value) => {
|
|
10885
|
+
const ref = useRef(void 0);
|
|
10886
|
+
useEffect(() => {
|
|
10887
|
+
ref.current = value;
|
|
10888
|
+
}, [value]);
|
|
10889
|
+
return ref.current;
|
|
10890
|
+
};
|
|
10891
|
+
//#endregion
|
|
10869
10892
|
//#region src/translations/enums.ts
|
|
10870
10893
|
var ConfigKeyType = Object.freeze({
|
|
10871
10894
|
Translations: "translations",
|
package/package.json
CHANGED