@oliasoft-open-source/react-ui-library 10.7.0-beta-4 → 10.7.0-beta-6
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.d.ts +2 -0
- package/dist/index.js +16 -17
- package/package.json +1 -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,
|
|
@@ -5213,12 +5219,9 @@ var UnitInput = ({ name, placeholder = "", disabled = false, disabledUnit = fals
|
|
|
5213
5219
|
defaultFromUnit: propUnit,
|
|
5214
5220
|
doNotConvertValue: noConversion
|
|
5215
5221
|
});
|
|
5216
|
-
const [displayLayer, setDisplayLayer] = useState(
|
|
5217
|
-
value: convertedValue,
|
|
5222
|
+
const [displayLayer, setDisplayLayer] = useState({
|
|
5223
|
+
value: convertedValue !== "" ? convertedValue : propValue,
|
|
5218
5224
|
unit: initDisplayUnit
|
|
5219
|
-
} : {
|
|
5220
|
-
value: propValue,
|
|
5221
|
-
unit: propUnit
|
|
5222
5225
|
});
|
|
5223
5226
|
const derivedAllowEmpty = allowEmpty || (displayLayer === null || displayLayer === void 0 ? void 0 : displayLayer.value) === void 0;
|
|
5224
5227
|
const [predefinedOptionsMenuState, setPredefinedOptionsMenuState] = useState(initialPredefinedOption ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
|
|
@@ -5461,15 +5464,11 @@ var UnitInput = ({ name, placeholder = "", disabled = false, disabledUnit = fals
|
|
|
5461
5464
|
testId: testId && `${testId}-menu`,
|
|
5462
5465
|
tabIndex: -1,
|
|
5463
5466
|
menu: {
|
|
5464
|
-
trigger:
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
fontWeight: "normal",
|
|
5470
|
-
rightIcon: IconType.CHEVRON_DOWN,
|
|
5471
|
-
small
|
|
5472
|
-
}),
|
|
5467
|
+
trigger: TriggerType.DROP_DOWN_BUTTON,
|
|
5468
|
+
label: displayUnitLabel,
|
|
5469
|
+
colored: Color.MUTED,
|
|
5470
|
+
basic: true,
|
|
5471
|
+
fontWeight: "normal",
|
|
5473
5472
|
placement: "bottom-end",
|
|
5474
5473
|
small,
|
|
5475
5474
|
sections: alternativeUnits.map(([value = "", altUnit = "", label]) => {
|
package/package.json
CHANGED