@oliasoft-open-source/react-ui-library 5.13.6 → 5.13.7-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 CHANGED
@@ -1239,6 +1239,17 @@ export declare interface IRadioButtonProps {
1239
1239
  classForContainer?: 'grouped fields' | 'inline fields';
1240
1240
  }
1241
1241
 
1242
+ declare interface IRadioCell extends TCommonCell {
1243
+ type: TCellType;
1244
+ name: TStringOrNumber;
1245
+ value: TStringOrNumber;
1246
+ selected: boolean;
1247
+ disabled?: boolean;
1248
+ small?: boolean;
1249
+ onChange: (evt: default_2.MouseEvent<HTMLDivElement, MouseEvent>) => void;
1250
+ testId?: string;
1251
+ }
1252
+
1242
1253
  declare interface IReorderData {
1243
1254
  from?: number;
1244
1255
  to?: number;
@@ -2021,9 +2032,9 @@ export declare type TButtonPosition = 'top' | 'bottom';
2021
2032
 
2022
2033
  export declare type TButtonType = 'submit' | 'button' | 'reset';
2023
2034
 
2024
- declare type TCellShape = IPopoverCell | IStaticCell | ISelectCell | IHelpIconCell | ILibraryIconCell | ICheckBoxCell | IIconCell | IInputCell | ILinkCell | INumberInputCell | IActionCell | ISortCell | ISliderCell | ISimpleCell;
2035
+ declare type TCellShape = IPopoverCell | IStaticCell | ISelectCell | IHelpIconCell | ILibraryIconCell | ICheckBoxCell | IIconCell | IInputCell | ILinkCell | INumberInputCell | IActionCell | IRadioCell | ISortCell | ISliderCell | ISimpleCell;
2025
2036
 
2026
- declare type TCellType = 'Static' | 'Icon' | 'Select' | 'Input' | 'NumberInput' | 'Popover' | 'CheckBox' | 'Actions' | 'Link' | 'Slider' | 'Unit' | string;
2037
+ declare type TCellType = 'Static' | 'Icon' | 'Select' | 'Input' | 'NumberInput' | 'Popover' | 'CheckBox' | 'Radio' | 'Actions' | 'Link' | 'Slider' | 'Unit' | string;
2027
2038
 
2028
2039
  export declare type TChangeEvent<T extends HTMLElement = HTMLInputElement> = ChangeEvent<T> & {
2029
2040
  target: T | {
package/dist/index.js CHANGED
@@ -3586,7 +3586,55 @@ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOn
3586
3586
  })
3587
3587
  })
3588
3588
  });
3589
- }, CellWrapper = ({ cell: e, isHeader: t, columnAlignment: n, testId: r }) => {
3589
+ };
3590
+ var radio_button_module_default = {
3591
+ wrapper: "_wrapper_1homz_1",
3592
+ inline: "_inline_1homz_1",
3593
+ radio: "_radio_1homz_5",
3594
+ labelMargin: "_labelMargin_1homz_8",
3595
+ small: "_small_1homz_27",
3596
+ noMargin: "_noMargin_1homz_32",
3597
+ noLabel: "_noLabel_1homz_36",
3598
+ disabled: "_disabled_1homz_96",
3599
+ isInTable: "_isInTable_1homz_112",
3600
+ helpIconEnabled: "_helpIconEnabled_1homz_117"
3601
+ };
3602
+ 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, textTransform: d = TextTransform.CAPITALIZE }) => {
3603
+ let f = l || u;
3604
+ return /* @__PURE__ */ jsxs("div", {
3605
+ 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, t ? null : radio_button_module_default.noLabel),
3606
+ onClick: o,
3607
+ "data-testid": c,
3608
+ children: [
3609
+ /* @__PURE__ */ jsx("input", {
3610
+ type: InputType.RADIO,
3611
+ value: n,
3612
+ checked: r,
3613
+ onChange: () => {},
3614
+ disabled: i
3615
+ }),
3616
+ /* @__PURE__ */ jsx("label", {
3617
+ "data-name": e,
3618
+ "data-value": n,
3619
+ style: { textTransform: d },
3620
+ children: t
3621
+ }),
3622
+ f && /* @__PURE__ */ jsx("div", {
3623
+ className: radio_button_module_default.helpIconEnabled,
3624
+ onClick: u,
3625
+ children: /* @__PURE__ */ jsx(HelpIcon, { text: l })
3626
+ })
3627
+ ]
3628
+ });
3629
+ }, RadioCell = ({ cell: e, testId: t }) => /* @__PURE__ */ jsx(RadioInput, {
3630
+ selected: e.selected,
3631
+ name: e.name,
3632
+ value: e.value,
3633
+ noMargin: !0,
3634
+ disabled: e.disabled,
3635
+ onChange: (t) => e.onChange(t),
3636
+ testId: t
3637
+ }), CellWrapper = ({ cell: e, isHeader: t, columnAlignment: n, testId: r }) => {
3590
3638
  if (!e) return null;
3591
3639
  switch (e.type) {
3592
3640
  case "Input":
@@ -3605,6 +3653,10 @@ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOn
3605
3653
  cell: e,
3606
3654
  testId: r
3607
3655
  });
3656
+ case "Radio": return /* @__PURE__ */ jsx(RadioCell, {
3657
+ cell: e,
3658
+ testId: r
3659
+ });
3608
3660
  case "Slider": return /* @__PURE__ */ jsx(SliderCell, { cell: e });
3609
3661
  case "Icon": return /* @__PURE__ */ jsx(IconCell, { cell: e });
3610
3662
  case "Actions": return /* @__PURE__ */ jsx(ActionsCell, { cell: e });
@@ -3617,7 +3669,7 @@ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOn
3617
3669
  }
3618
3670
  };
3619
3671
  let CellType = /* @__PURE__ */ function(e) {
3620
- return e.INPUT = "Input", e.NUMBER_INPUT = "NumberInput", e.SELECT = "Select", e.POPOVER = "Popover", e.SLIDER = "Slider", e.CHECKBOX = "CheckBox", e.ACTIONS = "Actions", e.AUTO_UNIT = "AutoUnit", e.UNIT = "Unit", e.STATIC = "Static", e;
3672
+ return e.INPUT = "Input", e.NUMBER_INPUT = "NumberInput", e.SELECT = "Select", e.POPOVER = "Popover", e.SLIDER = "Slider", e.CHECKBOX = "CheckBox", e.RADIO = "Radio", e.ACTIONS = "Actions", e.AUTO_UNIT = "AutoUnit", e.UNIT = "Unit", e.STATIC = "Static", e;
3621
3673
  }({});
3622
3674
  const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment: r = Align.LEFT, width: i, testId: a }) => {
3623
3675
  var o;
@@ -3626,7 +3678,7 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
3626
3678
  bodyAlignment: r,
3627
3679
  headerAlignment: n,
3628
3680
  isHeader: t
3629
- }, m = getCellAlignment(f, cell_module_default), h = getCellAlignment(f, cell_module_default, !0), _ = e.type === CellType.INPUT || e.type === CellType.NUMBER_INPUT || e.type === CellType.SELECT || e.type === CellType.POPOVER ? cell_module_default.inputCell : e.type === CellType.SLIDER ? cell_module_default.sliderCell : e.type === CellType.CHECKBOX ? cell_module_default.checkBoxCell : e.type === CellType.ACTIONS ? cell_module_default.actionsCell : cell_module_default.staticCell, v = cx(cell_module_default.cell, _, e.hasSort ? cell_module_default.sortingCell : null, m, e.breakWord ? cell_module_default.breakWord : ""), y = (o = u == null ? i : u) == null ? void 0 : o, b = e.type === CellType.STATIC || !e.type, x = {
3681
+ }, m = getCellAlignment(f, cell_module_default), h = getCellAlignment(f, cell_module_default, !0), _ = e.type === CellType.INPUT || e.type === CellType.NUMBER_INPUT || e.type === CellType.SELECT || e.type === CellType.POPOVER ? cell_module_default.inputCell : e.type === CellType.SLIDER ? cell_module_default.sliderCell : e.type === CellType.CHECKBOX || e.type === CellType.RADIO ? cell_module_default.checkBoxCell : e.type === CellType.ACTIONS ? cell_module_default.actionsCell : cell_module_default.staticCell, v = cx(cell_module_default.cell, _, e.hasSort ? cell_module_default.sortingCell : null, m, e.breakWord ? cell_module_default.breakWord : ""), y = (o = u == null ? i : u) == null ? void 0 : o, b = e.type === CellType.STATIC || !e.type, x = {
3630
3682
  width: y,
3631
3683
  minWidth: y,
3632
3684
  textTransform: t && b ? TextTransform.CAPITALIZE : void 0,
@@ -5925,46 +5977,7 @@ const PrintHeader = ({ logo: e, alt: t, logoWidth: n = "100px" }) => /* @__PURE_
5925
5977
  alt: t,
5926
5978
  className: print_header_module_default.printHeader,
5927
5979
  style: { width: n }
5928
- });
5929
- var radio_button_module_default = {
5930
- wrapper: "_wrapper_1fbik_1",
5931
- inline: "_inline_1fbik_1",
5932
- radio: "_radio_1fbik_5",
5933
- labelMargin: "_labelMargin_1fbik_8",
5934
- small: "_small_1fbik_27",
5935
- noMargin: "_noMargin_1fbik_32",
5936
- disabled: "_disabled_1fbik_90",
5937
- isInTable: "_isInTable_1fbik_106",
5938
- helpIconEnabled: "_helpIconEnabled_1fbik_111"
5939
- };
5940
- 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, textTransform: d = TextTransform.CAPITALIZE }) => {
5941
- let f = l || u;
5942
- return /* @__PURE__ */ jsxs("div", {
5943
- 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),
5944
- onClick: o,
5945
- "data-testid": c,
5946
- children: [
5947
- /* @__PURE__ */ jsx("input", {
5948
- type: InputType.RADIO,
5949
- value: n,
5950
- checked: r,
5951
- onChange: () => {},
5952
- disabled: i
5953
- }),
5954
- /* @__PURE__ */ jsx("label", {
5955
- "data-name": e,
5956
- "data-value": n,
5957
- style: { textTransform: d },
5958
- children: t
5959
- }),
5960
- f && /* @__PURE__ */ jsx("div", {
5961
- className: radio_button_module_default.helpIconEnabled,
5962
- onClick: u,
5963
- children: /* @__PURE__ */ jsx(HelpIcon, { text: l })
5964
- })
5965
- ]
5966
- });
5967
- }, RadioButton = ({ name: e, label: t, options: n, value: r, onChange: i, disabled: a = !1, small: o = !1, noMargin: c = !1, onClick: l = () => {}, inline: u = !1, mainLabel: d = "", radioButtonsData: f, classForContainer: p = "grouped fields" }) => {
5980
+ }), RadioButton = ({ name: e, label: t, options: n, value: r, onChange: i, disabled: a = !1, small: o = !1, noMargin: c = !1, onClick: l = () => {}, inline: u = !1, mainLabel: d = "", radioButtonsData: f, classForContainer: p = "grouped fields" }) => {
5968
5981
  let m = useContext(DisabledContext), h = f !== void 0, { simpleInputs: _, options: v, selectedOptions: y } = h ? {
5969
5982
  simpleInputs: !1,
5970
5983
  options: f,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "5.13.6",
3
+ "version": "5.13.7-beta-1",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {