@oliasoft-open-source/react-ui-library 5.6.5-beta-2 → 5.7.4-beta-1
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 -5
- package/dist/index.js +20 -26
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export declare enum ButtonType {
|
|
|
62
62
|
|
|
63
63
|
export declare const Card: ({ bordered, heading, children, margin, padding, raised, }: ICardProps) => JSX_2.Element;
|
|
64
64
|
|
|
65
|
-
export declare const CheckBox: ({ noMargin, dataix, isInTable, tabIndex, checked, indeterminate, name, label, disabled, small, onChange, testId, value, helpText, onClickHelp,
|
|
65
|
+
export declare const CheckBox: ({ noMargin, dataix, isInTable, tabIndex, checked, indeterminate, name, label, disabled, small, onChange, testId, value, helpText, onClickHelp, }: ICheckBoxProps) => JSX_2.Element;
|
|
66
66
|
|
|
67
67
|
export declare const Chevron: ({ expanded }: IChevronProps) => JSX_2.Element;
|
|
68
68
|
|
|
@@ -278,7 +278,6 @@ export declare interface ICheckBoxProps {
|
|
|
278
278
|
value?: string;
|
|
279
279
|
helpText?: string;
|
|
280
280
|
onClickHelp?: TEmpty;
|
|
281
|
-
textTransform?: TTextTransform;
|
|
282
281
|
}
|
|
283
282
|
|
|
284
283
|
export declare interface IChevronProps {
|
|
@@ -1164,7 +1163,6 @@ declare interface IRadioButtonOption {
|
|
|
1164
1163
|
name?: string;
|
|
1165
1164
|
checked?: boolean;
|
|
1166
1165
|
disabled?: boolean;
|
|
1167
|
-
textTransform?: TTextTransform;
|
|
1168
1166
|
}
|
|
1169
1167
|
|
|
1170
1168
|
export declare interface IRadioButtonProps {
|
|
@@ -1624,7 +1622,6 @@ export declare interface IToggleProps {
|
|
|
1624
1622
|
testId?: string;
|
|
1625
1623
|
helpText?: string;
|
|
1626
1624
|
onClickHelp?: (evt: any) => void;
|
|
1627
|
-
textTransform?: TTextTransform;
|
|
1628
1625
|
}
|
|
1629
1626
|
|
|
1630
1627
|
export declare interface ITooltipProps {
|
|
@@ -2027,7 +2024,7 @@ export declare const toast: ({ id, message, autoClose, onClose, }: IToastProps)
|
|
|
2027
2024
|
|
|
2028
2025
|
export { Toaster }
|
|
2029
2026
|
|
|
2030
|
-
export declare const Toggle: ({ name, label, checked, disabled, display, small, onChange, noMargin, testId, helpText, onClickHelp,
|
|
2027
|
+
export declare const Toggle: ({ name, label, checked, disabled, display, small, onChange, noMargin, testId, helpText, onClickHelp, }: IToggleProps) => JSX_2.Element;
|
|
2031
2028
|
|
|
2032
2029
|
export declare type TOnChangeEvent = {
|
|
2033
2030
|
target: TOnChangeEventTarget;
|
package/dist/index.js
CHANGED
|
@@ -385,15 +385,15 @@ const HelpIcon = ({ text: e, onClick: t, icon: n = "help", active: r = !1, maxWi
|
|
|
385
385
|
maxWidth: i,
|
|
386
386
|
children: /* @__PURE__ */ jsx(Icon, { icon: n })
|
|
387
387
|
})
|
|
388
|
-
}), CheckBox = ({ noMargin: e = !1, dataix: t = 0, isInTable: n = !1, tabIndex: r = 0, checked: i = !1, indeterminate: a = !1, name: o, label: l = "", disabled: u = !1, small: d = !1, onChange: f, testId: m, value: h, helpText: _, onClickHelp: v
|
|
389
|
-
let
|
|
388
|
+
}), CheckBox = ({ noMargin: e = !1, dataix: t = 0, isInTable: n = !1, tabIndex: r = 0, checked: i = !1, indeterminate: a = !1, name: o, label: l = "", disabled: u = !1, small: d = !1, onChange: f, testId: m, value: h, helpText: _, onClickHelp: v }) => {
|
|
389
|
+
let y = useContext(DisabledContext), b = _ || v, x = u || y, S = useRef(null);
|
|
390
390
|
return useEffect(() => {
|
|
391
|
-
|
|
391
|
+
S.current && (S.current.indeterminate = a);
|
|
392
392
|
}, [a]), /* @__PURE__ */ jsxs("div", {
|
|
393
|
-
className: cx(check_box_module_default.checkbox, e && check_box_module_default.noMargin, n && check_box_module_default.isInTable,
|
|
393
|
+
className: cx(check_box_module_default.checkbox, e && check_box_module_default.noMargin, n && check_box_module_default.isInTable, x && check_box_module_default.disabled, d && check_box_module_default.small, !l && check_box_module_default.noLabel),
|
|
394
394
|
"data-ix": t,
|
|
395
395
|
onClick: (e) => {
|
|
396
|
-
if (!
|
|
396
|
+
if (!x) {
|
|
397
397
|
let t = e.target;
|
|
398
398
|
t.name = o, t.checked = !i, f({
|
|
399
399
|
...e,
|
|
@@ -407,24 +407,23 @@ const HelpIcon = ({ text: e, onClick: t, icon: n = "help", active: r = !1, maxWi
|
|
|
407
407
|
"data-testid": m,
|
|
408
408
|
children: [
|
|
409
409
|
/* @__PURE__ */ jsx("input", {
|
|
410
|
-
ref:
|
|
410
|
+
ref: S,
|
|
411
411
|
type: "checkbox",
|
|
412
412
|
tabIndex: r,
|
|
413
413
|
checked: i,
|
|
414
414
|
name: o,
|
|
415
415
|
onChange: () => {},
|
|
416
|
-
disabled:
|
|
416
|
+
disabled: x,
|
|
417
417
|
"data-indeterminate": a
|
|
418
418
|
}),
|
|
419
419
|
/* @__PURE__ */ jsxs("label", {
|
|
420
420
|
htmlFor: o,
|
|
421
|
-
style: { textTransform: y },
|
|
422
421
|
children: [/* @__PURE__ */ jsx("span", {
|
|
423
422
|
className: check_box_module_default.checkmark,
|
|
424
423
|
children: /* @__PURE__ */ jsx(Icon, { icon: IconType.CHECK })
|
|
425
424
|
}), l]
|
|
426
425
|
}),
|
|
427
|
-
|
|
426
|
+
b && /* @__PURE__ */ jsx("div", {
|
|
428
427
|
className: check_box_module_default.helpIconEnabled,
|
|
429
428
|
onClick: v,
|
|
430
429
|
children: /* @__PURE__ */ jsx(HelpIcon, { text: _ })
|
|
@@ -4288,13 +4287,13 @@ var toggle_module_default = {
|
|
|
4288
4287
|
noMargin: "_noMargin_1c9wf_110",
|
|
4289
4288
|
helpIconEnabled: "_helpIconEnabled_1c9wf_113"
|
|
4290
4289
|
};
|
|
4291
|
-
const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, small: a = !1, onChange: o, noMargin: c = !1, testId: l, helpText: u, onClickHelp: d
|
|
4292
|
-
let
|
|
4290
|
+
const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, small: a = !1, onChange: o, noMargin: c = !1, testId: l, helpText: u, onClickHelp: d }) => {
|
|
4291
|
+
let f = useContext(DisabledContext), p = u || d, m = r || f;
|
|
4293
4292
|
return /* @__PURE__ */ jsxs("div", {
|
|
4294
|
-
className: cx(toggle_module_default.toggle,
|
|
4293
|
+
className: cx(toggle_module_default.toggle, m ? toggle_module_default.disabled : null, a ? toggle_module_default.small : null, c ? toggle_module_default.noMargin : null),
|
|
4295
4294
|
style: { display: i },
|
|
4296
4295
|
onClick: (t) => {
|
|
4297
|
-
|
|
4296
|
+
m || (t.target.name = e, t.target.checked = !n, t.target.value = !n, o(t));
|
|
4298
4297
|
},
|
|
4299
4298
|
"data-testid": l,
|
|
4300
4299
|
children: [
|
|
@@ -4302,15 +4301,12 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
|
|
|
4302
4301
|
type: InputType.CHECKBOX,
|
|
4303
4302
|
name: e,
|
|
4304
4303
|
value: n?.toString(),
|
|
4305
|
-
disabled:
|
|
4304
|
+
disabled: m,
|
|
4306
4305
|
checked: n,
|
|
4307
4306
|
onChange: () => {}
|
|
4308
4307
|
}),
|
|
4309
|
-
/* @__PURE__ */ jsx("label", {
|
|
4310
|
-
|
|
4311
|
-
children: t
|
|
4312
|
-
}),
|
|
4313
|
-
m && /* @__PURE__ */ jsx("div", {
|
|
4308
|
+
/* @__PURE__ */ jsx("label", { children: t }),
|
|
4309
|
+
p && /* @__PURE__ */ jsx("div", {
|
|
4314
4310
|
className: toggle_module_default.helpIconEnabled,
|
|
4315
4311
|
onClick: d,
|
|
4316
4312
|
children: /* @__PURE__ */ jsx(HelpIcon, { text: u })
|
|
@@ -5686,9 +5682,9 @@ var radio_button_module_default = {
|
|
|
5686
5682
|
isInTable: "_isInTable_1fbik_106",
|
|
5687
5683
|
helpIconEnabled: "_helpIconEnabled_1fbik_111"
|
|
5688
5684
|
};
|
|
5689
|
-
const RadioInput = ({ name: e, label: t, value: n, selected: r, disabled: i = !1, small: a = !1, onChange: o, noMargin: s = !1, testId: c, helpText: l, onClickHelp: u
|
|
5690
|
-
let
|
|
5691
|
-
return
|
|
5685
|
+
const RadioInput = ({ name: e, label: t, value: n, selected: r, disabled: i = !1, small: a = !1, onChange: o, noMargin: s = !1, testId: c, helpText: l, onClickHelp: u }) => {
|
|
5686
|
+
let d = l || u;
|
|
5687
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
5692
5688
|
className: cx(radio_button_module_default.radio, i ? radio_button_module_default.disabled : null, a ? radio_button_module_default.small : null, s ? radio_button_module_default.noMargin : null),
|
|
5693
5689
|
onClick: o,
|
|
5694
5690
|
"data-testid": c,
|
|
@@ -5703,10 +5699,9 @@ const RadioInput = ({ name: e, label: t, value: n, selected: r, disabled: i = !1
|
|
|
5703
5699
|
/* @__PURE__ */ jsx("label", {
|
|
5704
5700
|
"data-name": e,
|
|
5705
5701
|
"data-value": n,
|
|
5706
|
-
style: { textTransform: d },
|
|
5707
5702
|
children: t
|
|
5708
5703
|
}),
|
|
5709
|
-
|
|
5704
|
+
d && /* @__PURE__ */ jsx("div", {
|
|
5710
5705
|
className: radio_button_module_default.helpIconEnabled,
|
|
5711
5706
|
onClick: u,
|
|
5712
5707
|
children: /* @__PURE__ */ jsx(HelpIcon, { text: l })
|
|
@@ -5739,8 +5734,7 @@ const RadioInput = ({ name: e, label: t, value: n, selected: r, disabled: i = !1
|
|
|
5739
5734
|
},
|
|
5740
5735
|
testId: t.testId,
|
|
5741
5736
|
helpText: t.helpText,
|
|
5742
|
-
onClickHelp: t.onClickHelp
|
|
5743
|
-
textTransform: t.textTransform
|
|
5737
|
+
onClickHelp: t.onClickHelp
|
|
5744
5738
|
}, n);
|
|
5745
5739
|
})]
|
|
5746
5740
|
});
|
package/package.json
CHANGED