@oliasoft-open-source/react-ui-library 5.13.5 → 5.13.6-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 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
@@ -3587,7 +3587,55 @@ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOn
3587
3587
  })
3588
3588
  })
3589
3589
  });
3590
- }, CellWrapper = ({ cell: e, isHeader: t, columnAlignment: n, testId: r }) => {
3590
+ };
3591
+ var radio_button_module_default = {
3592
+ wrapper: "_wrapper_1homz_1",
3593
+ inline: "_inline_1homz_1",
3594
+ radio: "_radio_1homz_5",
3595
+ labelMargin: "_labelMargin_1homz_8",
3596
+ small: "_small_1homz_27",
3597
+ noMargin: "_noMargin_1homz_32",
3598
+ noLabel: "_noLabel_1homz_36",
3599
+ disabled: "_disabled_1homz_96",
3600
+ isInTable: "_isInTable_1homz_112",
3601
+ helpIconEnabled: "_helpIconEnabled_1homz_117"
3602
+ };
3603
+ 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 }) => {
3604
+ let f = l || u;
3605
+ return /* @__PURE__ */ jsxs("div", {
3606
+ 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),
3607
+ onClick: o,
3608
+ "data-testid": c,
3609
+ children: [
3610
+ /* @__PURE__ */ jsx("input", {
3611
+ type: InputType.RADIO,
3612
+ value: n,
3613
+ checked: r,
3614
+ onChange: () => {},
3615
+ disabled: i
3616
+ }),
3617
+ /* @__PURE__ */ jsx("label", {
3618
+ "data-name": e,
3619
+ "data-value": n,
3620
+ style: { textTransform: d },
3621
+ children: t
3622
+ }),
3623
+ f && /* @__PURE__ */ jsx("div", {
3624
+ className: radio_button_module_default.helpIconEnabled,
3625
+ onClick: u,
3626
+ children: /* @__PURE__ */ jsx(HelpIcon, { text: l })
3627
+ })
3628
+ ]
3629
+ });
3630
+ }, RadioCell = ({ cell: e, testId: t }) => /* @__PURE__ */ jsx(RadioInput, {
3631
+ selected: e.selected,
3632
+ name: e.name,
3633
+ value: e.value,
3634
+ noMargin: !0,
3635
+ disabled: e.disabled,
3636
+ onChange: (t) => e.onChange(t),
3637
+ testId: t
3638
+ }), CellWrapper = ({ cell: e, isHeader: t, columnAlignment: n, testId: r }) => {
3591
3639
  if (!e) return null;
3592
3640
  switch (e.type) {
3593
3641
  case "Input":
@@ -3606,6 +3654,10 @@ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOn
3606
3654
  cell: e,
3607
3655
  testId: r
3608
3656
  });
3657
+ case "Radio": return /* @__PURE__ */ jsx(RadioCell, {
3658
+ cell: e,
3659
+ testId: r
3660
+ });
3609
3661
  case "Slider": return /* @__PURE__ */ jsx(SliderCell, { cell: e });
3610
3662
  case "Icon": return /* @__PURE__ */ jsx(IconCell, { cell: e });
3611
3663
  case "Actions": return /* @__PURE__ */ jsx(ActionsCell, { cell: e });
@@ -3618,7 +3670,7 @@ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOn
3618
3670
  }
3619
3671
  };
3620
3672
  let CellType = /* @__PURE__ */ function(e) {
3621
- 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;
3673
+ 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;
3622
3674
  }({});
3623
3675
  const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment: r = Align.LEFT, width: i, testId: a }) => {
3624
3676
  var o;
@@ -3627,7 +3679,7 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
3627
3679
  bodyAlignment: r,
3628
3680
  headerAlignment: n,
3629
3681
  isHeader: t
3630
- }, 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 = {
3682
+ }, 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 = {
3631
3683
  width: y,
3632
3684
  minWidth: y,
3633
3685
  textTransform: t && b ? TextTransform.CAPITALIZE : void 0,
@@ -5926,46 +5978,7 @@ const PrintHeader = ({ logo: e, alt: t, logoWidth: n = "100px" }) => /* @__PURE_
5926
5978
  alt: t,
5927
5979
  className: print_header_module_default.printHeader,
5928
5980
  style: { width: n }
5929
- });
5930
- var radio_button_module_default = {
5931
- wrapper: "_wrapper_1fbik_1",
5932
- inline: "_inline_1fbik_1",
5933
- radio: "_radio_1fbik_5",
5934
- labelMargin: "_labelMargin_1fbik_8",
5935
- small: "_small_1fbik_27",
5936
- noMargin: "_noMargin_1fbik_32",
5937
- disabled: "_disabled_1fbik_90",
5938
- isInTable: "_isInTable_1fbik_106",
5939
- helpIconEnabled: "_helpIconEnabled_1fbik_111"
5940
- };
5941
- 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 }) => {
5942
- let f = l || u;
5943
- return /* @__PURE__ */ jsxs("div", {
5944
- 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),
5945
- onClick: o,
5946
- "data-testid": c,
5947
- children: [
5948
- /* @__PURE__ */ jsx("input", {
5949
- type: InputType.RADIO,
5950
- value: n,
5951
- checked: r,
5952
- onChange: () => {},
5953
- disabled: i
5954
- }),
5955
- /* @__PURE__ */ jsx("label", {
5956
- "data-name": e,
5957
- "data-value": n,
5958
- style: { textTransform: d },
5959
- children: t
5960
- }),
5961
- f && /* @__PURE__ */ jsx("div", {
5962
- className: radio_button_module_default.helpIconEnabled,
5963
- onClick: u,
5964
- children: /* @__PURE__ */ jsx(HelpIcon, { text: l })
5965
- })
5966
- ]
5967
- });
5968
- }, 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" }) => {
5981
+ }), 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" }) => {
5969
5982
  let m = useContext(DisabledContext), h = f !== void 0, { simpleInputs: _, options: v, selectedOptions: y } = h ? {
5970
5983
  simpleInputs: !1,
5971
5984
  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.5",
3
+ "version": "5.13.6-beta-2",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {