@oliasoft-open-source/react-ui-library 5.9.0 → 5.10.0-beta-2
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 +16 -0
- package/dist/index.js +43 -20
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1866,6 +1866,13 @@ export declare interface IUnitTableRow extends Omit<TRowType, 'cells'> {
|
|
|
1866
1866
|
declare interface IUnitTableStaticCell extends IStaticCell, IUnitTableCell {
|
|
1867
1867
|
}
|
|
1868
1868
|
|
|
1869
|
+
export declare interface IUsageTrackerProps {
|
|
1870
|
+
pathName: string;
|
|
1871
|
+
onNavigate: (args: NavigationEventArgs) => void;
|
|
1872
|
+
getAnalyticsModuleName: (pathname: string) => string;
|
|
1873
|
+
onStartNavigationTimeEvent?: () => void;
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1869
1876
|
declare type JsonDelta = Record<string, any>;
|
|
1870
1877
|
|
|
1871
1878
|
export declare const Label: ({ label, width, helpText, helpTextMaxWidth, onClickHelp, lock, info, libraryIcon, labelLeft, textTransform, }: ILabelProps) => JSX_2.Element;
|
|
@@ -1906,6 +1913,13 @@ export declare const Modal: ({ children, visible, centered, width, onEnter, onEs
|
|
|
1906
1913
|
|
|
1907
1914
|
export declare const NativeSelect: ({ disabled, error, warning, tooltip, options, onChange, onFocus, onBlur, right, small, tabIndex, selectedOption, width, groupOrder, testId, isInTable, clearable, placeholder, hasNonExistentValue, maxTooltipWidth, borderRadius, }: INativeSelectProps) => JSX_2.Element;
|
|
1908
1915
|
|
|
1916
|
+
declare interface NavigationEventArgs {
|
|
1917
|
+
moduleName: string;
|
|
1918
|
+
moduleUrl: string;
|
|
1919
|
+
startTime: number;
|
|
1920
|
+
endTime: number;
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1909
1923
|
export declare const NumberInput: ({ name, placeholder, disabled, error, left, small, width, value, onChange, onFocus, onBlur, selectOnFocus, tabIndex, testId, tooltip, warning, validationCallback, allowEmpty, isInTable, groupOrder, enableCosmeticRounding, enableDisplayRounding, roundDisplayValue, disableInternalErrorValidationMessages, disableValidationOnFocus, }: INumberInputProps) => JSX_2.Element;
|
|
1910
1924
|
|
|
1911
1925
|
export declare const OptionDropdown: ({ name, label, options, onChange, small, showHeader, maxHeight, testId, }: IOptionDropdownProps) => ReactElement;
|
|
@@ -2217,6 +2231,8 @@ export declare const UnitInput: ({ name, placeholder, disabled, disabledUnit, er
|
|
|
2217
2231
|
|
|
2218
2232
|
export declare const UnitTable: ({ table, unitConfig, convertBackToStorageUnit, enableCosmeticRounding, enableDisplayRounding, onListReorder, canListReorder, beforeRenderRow: beforeRenderRowProp, }: IUnitTableProps) => JSX_2.Element;
|
|
2219
2233
|
|
|
2234
|
+
export declare const UsageTracker: ({ pathName, onNavigate, getAnalyticsModuleName, onStartNavigationTimeEvent, }: IUsageTrackerProps) => null;
|
|
2235
|
+
|
|
2220
2236
|
export declare const useFocus: () => UseFocusReturnType;
|
|
2221
2237
|
|
|
2222
2238
|
declare type UseFocusReturnType = [MutableRefObject<HTMLInputElement | null>, TEmpty];
|
package/dist/index.js
CHANGED
|
@@ -6611,7 +6611,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6611
6611
|
} : {
|
|
6612
6612
|
value: G,
|
|
6613
6613
|
unit: U
|
|
6614
|
-
}),
|
|
6614
|
+
}), Pd = k || K?.value === void 0, [J, Fd] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), Id = !!(O || n), Y = C && C.find((e) => {
|
|
6615
6615
|
if (!e?.value) return;
|
|
6616
6616
|
if (E) return E === e.valueKey;
|
|
6617
6617
|
let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = l } = convertUnit({
|
|
@@ -6620,7 +6620,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6620
6620
|
toUnit: t
|
|
6621
6621
|
});
|
|
6622
6622
|
return withUnit(n, t) === e.value;
|
|
6623
|
-
}),
|
|
6623
|
+
}), Ld = () => {
|
|
6624
6624
|
let e = l ?? "", t = K.unit;
|
|
6625
6625
|
if (checkConversion({
|
|
6626
6626
|
value: e,
|
|
@@ -6634,7 +6634,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6634
6634
|
return null;
|
|
6635
6635
|
}
|
|
6636
6636
|
} else return getAltUnitsListByQuantity(u)?.map((e) => ["", e?.unit]);
|
|
6637
|
-
},
|
|
6637
|
+
}, Rd = (t) => {
|
|
6638
6638
|
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;
|
|
6639
6639
|
h({ target: {
|
|
6640
6640
|
value: s,
|
|
@@ -6647,7 +6647,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6647
6647
|
}), R(() => {
|
|
6648
6648
|
r.selectionStart = a, r.selectionEnd = a;
|
|
6649
6649
|
});
|
|
6650
|
-
},
|
|
6650
|
+
}, zd = (e, t) => {
|
|
6651
6651
|
t === K.unit || isNaN(Number(e)) || (q({
|
|
6652
6652
|
value: e,
|
|
6653
6653
|
unit: t
|
|
@@ -6678,7 +6678,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6678
6678
|
e !== void 0 && q({
|
|
6679
6679
|
value: e,
|
|
6680
6680
|
unit: t
|
|
6681
|
-
}), C &&
|
|
6681
|
+
}), C && Fd(Y && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
|
|
6682
6682
|
}
|
|
6683
6683
|
}, [
|
|
6684
6684
|
U,
|
|
@@ -6686,7 +6686,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6686
6686
|
i,
|
|
6687
6687
|
T
|
|
6688
6688
|
]);
|
|
6689
|
-
let X =
|
|
6689
|
+
let X = Ld(), Z = label(K.unit) || K.unit || "", Bd = p || !X || X && X.length === 1, Q = getStringName(e), $, Vd = (t) => {
|
|
6690
6690
|
let r = t?.value ? t.value : "", [i = "", a = ""] = isValueWithUnit(r) ? split(r) : [r], o = withPrettyUnitLabel(r);
|
|
6691
6691
|
if (checkConversion({
|
|
6692
6692
|
value: r,
|
|
@@ -6706,7 +6706,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6706
6706
|
type: MenuType.OPTION,
|
|
6707
6707
|
inline: !0,
|
|
6708
6708
|
onClick: () => {
|
|
6709
|
-
validateNumber(i).valid && !n && (
|
|
6709
|
+
validateNumber(i).valid && !n && (Fd(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
|
|
6710
6710
|
value: r,
|
|
6711
6711
|
name: typeof e == "string" ? e : e?.fieldName || "",
|
|
6712
6712
|
predefinedSelected: !0,
|
|
@@ -6733,10 +6733,10 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6733
6733
|
label: "Custom",
|
|
6734
6734
|
selected: J === PredefinedOptionsMenuState.CUSTOM
|
|
6735
6735
|
}], C?.length) {
|
|
6736
|
-
let e = C.map(
|
|
6736
|
+
let e = C.map(Vd);
|
|
6737
6737
|
$ = [...$, ...e];
|
|
6738
6738
|
}
|
|
6739
|
-
let
|
|
6739
|
+
let Hd = (e) => {
|
|
6740
6740
|
if (isValueWithUnit(e)) {
|
|
6741
6741
|
let t = getUnit(e), { value: n } = safeConvertValue({
|
|
6742
6742
|
value: e,
|
|
@@ -6748,7 +6748,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6748
6748
|
return n;
|
|
6749
6749
|
}
|
|
6750
6750
|
return e;
|
|
6751
|
-
},
|
|
6751
|
+
}, Ud = !C && (!F || F === GroupOrder.FIRST) ? GroupOrder.FIRST : GroupOrder.MIDDLE, Wd = !F || F === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
|
|
6752
6752
|
return /* @__PURE__ */ jsx("div", {
|
|
6753
6753
|
className: J === PredefinedOptionsMenuState.PREDEFINED ? cx(unit_input_module_default.predefinedMenuActive) : "",
|
|
6754
6754
|
children: /* @__PURE__ */ jsxs(InputGroup, {
|
|
@@ -6780,31 +6780,31 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6780
6780
|
name: Q,
|
|
6781
6781
|
testId: x,
|
|
6782
6782
|
disabled: n,
|
|
6783
|
-
placeholder:
|
|
6783
|
+
placeholder: Hd(t),
|
|
6784
6784
|
value: K.value,
|
|
6785
|
-
onChange:
|
|
6785
|
+
onChange: Rd,
|
|
6786
6786
|
onFocus: v,
|
|
6787
6787
|
error: i === null ? void 0 : i,
|
|
6788
6788
|
warning: S === null ? void 0 : S,
|
|
6789
6789
|
left: a,
|
|
6790
|
-
allowEmpty:
|
|
6790
|
+
allowEmpty: Pd,
|
|
6791
6791
|
validationCallback: (e, t) => D(Q, t),
|
|
6792
6792
|
enableCosmeticRounding: j,
|
|
6793
6793
|
enableDisplayRounding: M,
|
|
6794
6794
|
roundDisplayValue: N,
|
|
6795
|
-
groupOrder:
|
|
6796
|
-
disableInternalErrorValidationMessages:
|
|
6795
|
+
groupOrder: Ud,
|
|
6796
|
+
disableInternalErrorValidationMessages: Id,
|
|
6797
6797
|
small: o,
|
|
6798
6798
|
selectOnFocus: P,
|
|
6799
6799
|
tooltip: I
|
|
6800
6800
|
}, Q)
|
|
6801
6801
|
}),
|
|
6802
|
-
Z && (
|
|
6803
|
-
groupOrder:
|
|
6802
|
+
Z && (Bd || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
|
|
6803
|
+
groupOrder: Wd,
|
|
6804
6804
|
small: o,
|
|
6805
6805
|
children: Z
|
|
6806
6806
|
}) : /* @__PURE__ */ jsx(Menu, {
|
|
6807
|
-
groupOrder:
|
|
6807
|
+
groupOrder: Wd,
|
|
6808
6808
|
maxHeight: 380,
|
|
6809
6809
|
disabled: r,
|
|
6810
6810
|
testId: x && `${x}-menu`,
|
|
@@ -6820,7 +6820,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6820
6820
|
label: j ? safeRoundNumbers(i) : i,
|
|
6821
6821
|
inline: !0,
|
|
6822
6822
|
onClick: (n) => {
|
|
6823
|
-
n.stopPropagation(),
|
|
6823
|
+
n.stopPropagation(), zd(e, t);
|
|
6824
6824
|
},
|
|
6825
6825
|
description: r,
|
|
6826
6826
|
selected: r === Z,
|
|
@@ -8688,6 +8688,29 @@ const ComparisonViewModal = ({ auditLog: e, auditLogs: t, data: n, isOpen: r, se
|
|
|
8688
8688
|
auditLog: f,
|
|
8689
8689
|
data: t
|
|
8690
8690
|
})] });
|
|
8691
|
+
}, UsageTracker = ({ pathName: e, onNavigate: t, getAnalyticsModuleName: n, onStartNavigationTimeEvent: r }) => {
|
|
8692
|
+
let i = window.location.href, a = n(e), o = useRef(i);
|
|
8693
|
+
return useEffect(() => {
|
|
8694
|
+
o.current = i;
|
|
8695
|
+
let e = Date.now();
|
|
8696
|
+
r && r();
|
|
8697
|
+
let n = () => {
|
|
8698
|
+
t({
|
|
8699
|
+
moduleName: a,
|
|
8700
|
+
moduleUrl: o.current,
|
|
8701
|
+
startTime: e,
|
|
8702
|
+
endTime: Date.now()
|
|
8703
|
+
});
|
|
8704
|
+
};
|
|
8705
|
+
return window.addEventListener("beforeunload", n), () => {
|
|
8706
|
+
window.removeEventListener("beforeunload", n), t({
|
|
8707
|
+
moduleName: a,
|
|
8708
|
+
moduleUrl: o.current,
|
|
8709
|
+
startTime: e,
|
|
8710
|
+
endTime: Date.now()
|
|
8711
|
+
});
|
|
8712
|
+
};
|
|
8713
|
+
}, [e, a]), null;
|
|
8691
8714
|
}, isPrimitiveValue = (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null, initializeGuiLibrary = (e) => {
|
|
8692
8715
|
setConfig(ConfigKeyType.LanguageKey, e.languageKey), Object.entries(e).forEach(([e, t]) => {
|
|
8693
8716
|
if (e === ConfigKeyType.Translations) setConfig(e, getTranslations(t));
|
|
@@ -8697,4 +8720,4 @@ const ComparisonViewModal = ({ auditLog: e, auditLogs: t, data: n, isOpen: r, se
|
|
|
8697
8720
|
}
|
|
8698
8721
|
});
|
|
8699
8722
|
};
|
|
8700
|
-
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 };
|
|
8723
|
+
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, UsageTracker, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth };
|
package/package.json
CHANGED