@oliasoft-open-source/react-ui-library 3.1.11 → 3.1.12

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.
Files changed (2) hide show
  1. package/dist/index.js +29 -14
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9892,7 +9892,8 @@ const Layer$2 = ({
9892
9892
  tree: tree2,
9893
9893
  path,
9894
9894
  maxHeight: maxHeight2,
9895
- showAllButton
9895
+ showAllButton,
9896
+ testId
9896
9897
  }) => {
9897
9898
  var _a, _b;
9898
9899
  if (isValidElement(sections)) {
@@ -9932,6 +9933,7 @@ const Layer$2 = ({
9932
9933
  maxHeight: maxHeight2 || "auto",
9933
9934
  overflowY: maxHeight2 ? "auto" : "default"
9934
9935
  },
9936
+ "data-testid": testId,
9935
9937
  children: /* @__PURE__ */ jsx("ul", {
9936
9938
  children: localSections.map((section, i) => /* @__PURE__ */ jsx("li", {
9937
9939
  children: /* @__PURE__ */ jsx(Section$1, {
@@ -10405,7 +10407,8 @@ const useContextMenu = (sections, width, placement, possiblePlacements, closeOnO
10405
10407
  tree: tree2,
10406
10408
  path,
10407
10409
  groupOrder,
10408
- maxHeight: maxHeight2
10410
+ maxHeight: maxHeight2,
10411
+ testId: testId && `${testId}-layer`
10409
10412
  })
10410
10413
  }));
10411
10414
  return [layer2, handleMouseEvent];
@@ -10553,7 +10556,8 @@ const DropDownMenu = ({
10553
10556
  path,
10554
10557
  groupOrder,
10555
10558
  maxHeight: maxHeight2,
10556
- showAllButton
10559
+ showAllButton,
10560
+ testId: testId && `${testId}-layer`
10557
10561
  })
10558
10562
  }))]
10559
10563
  });
@@ -26804,7 +26808,8 @@ const Layer = ({
26804
26808
  focusedOptionIndex,
26805
26809
  width,
26806
26810
  firstSelectedOptionIndex,
26807
- closeLayer
26811
+ closeLayer,
26812
+ testId
26808
26813
  }) => {
26809
26814
  useEffect(() => {
26810
26815
  if (firstSelectedOptionIndex !== null && listRef.current !== null) {
@@ -26813,6 +26818,7 @@ const Layer = ({
26813
26818
  }, []);
26814
26819
  const optionHeight = 38;
26815
26820
  return /* @__PURE__ */ jsx("div", {
26821
+ "data-testid": testId,
26816
26822
  className: cx(styles$k.layer),
26817
26823
  children: !sections.length ? /* @__PURE__ */ jsx("ul", {
26818
26824
  children: /* @__PURE__ */ jsx("li", {
@@ -26842,7 +26848,8 @@ const Layer = ({
26842
26848
  focused: focusedOptionIndex === index2,
26843
26849
  onSelectOption: (evt) => {
26844
26850
  onSelectOption(evt, sections[index2]);
26845
- }
26851
+ },
26852
+ testId: testId && (sections[index2].description ? `${testId}-${sections[index2].description}` : `${testId}-${sections[index2].label}`)
26846
26853
  })
26847
26854
  })
26848
26855
  })
@@ -27511,7 +27518,8 @@ const CustomSelect = ({
27511
27518
  triggerRect: triggerBounds,
27512
27519
  width: `max(${layerWidth}, ${triggerBounds.width}px)`,
27513
27520
  focusedOptionIndex: state.layerFocus.current,
27514
- firstSelectedOptionIndex
27521
+ firstSelectedOptionIndex,
27522
+ testId: testId && `${testId}-layer`
27515
27523
  })
27516
27524
  }))]
27517
27525
  });
@@ -35616,7 +35624,8 @@ const Row = (props) => {
35616
35624
  provided,
35617
35625
  snapshot,
35618
35626
  draggableTable,
35619
- width
35627
+ width,
35628
+ testId
35620
35629
  } = props;
35621
35630
  const targetRef = useRef();
35622
35631
  const columnHeaderAlignment = getHeaderAlignment(columnHeaderAlignments, isHeader, rowIndex);
@@ -35652,7 +35661,7 @@ const Row = (props) => {
35652
35661
  columnHeaderAlignment: columnHeaderAlignment[i],
35653
35662
  width: columnWidths ? columnWidths[i] : void 0,
35654
35663
  snapshot,
35655
- testId: c.testId
35664
+ testId: testId ? `${testId}-${i}` : c.testId
35656
35665
  }, key);
35657
35666
  });
35658
35667
  const rowActions = hasRowActions2 && /* @__PURE__ */ jsx(Cell, {
@@ -35755,7 +35764,8 @@ Row.defaultProps = {
35755
35764
  columnHeaderAlignments: [],
35756
35765
  draggableTable: false,
35757
35766
  snapshot: null,
35758
- provided: null
35767
+ provided: null,
35768
+ testId: void 0
35759
35769
  };
35760
35770
  Row.propTypes = {
35761
35771
  row: rowShape.isRequired,
@@ -35768,7 +35778,8 @@ Row.propTypes = {
35768
35778
  hasRowActions: propTypes$1.exports.bool.isRequired,
35769
35779
  draggableTable: propTypes$1.exports.bool,
35770
35780
  snapshot: propTypes$1.exports.object,
35771
- provided: propTypes$1.exports.object
35781
+ provided: propTypes$1.exports.object,
35782
+ testId: propTypes$1.exports.string
35772
35783
  };
35773
35784
  const getMaxCellCount = (rows) => {
35774
35785
  const count2 = Math.max(
@@ -35916,7 +35927,8 @@ const Table = (props) => {
35916
35927
  columnHeaderAlignments,
35917
35928
  rowsMetaData: stickyHeaders ? rowsMetaData : void 0,
35918
35929
  setRowsMetaData: stickyHeaders ? setRowsMetaData : void 0,
35919
- draggableTable: draggable2
35930
+ draggableTable: draggable2,
35931
+ testId: testId && `${testId}-${rowIndex}`
35920
35932
  }, `0_${rowIndex}`);
35921
35933
  })]
35922
35934
  }), /* @__PURE__ */ jsxs("tbody", {
@@ -35935,7 +35947,8 @@ const Table = (props) => {
35935
35947
  provided: provided2,
35936
35948
  snapshot,
35937
35949
  draggableTable: draggable2,
35938
- width: dimensions.width
35950
+ width: dimensions.width,
35951
+ testId: testId && `${testId}-${rowIndex + 1}`
35939
35952
  }, `1_${rowIndex}`)
35940
35953
  }, `index_${rowIndex}`)), provided.placeholder]
35941
35954
  }), footer2 && /* @__PURE__ */ jsx(Footer, {
@@ -35978,7 +35991,8 @@ const Table = (props) => {
35978
35991
  columnAlignment,
35979
35992
  columnHeaderAlignments,
35980
35993
  rowsMetaData: stickyHeaders ? rowsMetaData : void 0,
35981
- setRowsMetaData: stickyHeaders ? setRowsMetaData : void 0
35994
+ setRowsMetaData: stickyHeaders ? setRowsMetaData : void 0,
35995
+ testId: testId && `${testId}-${rowIndex}`
35982
35996
  }, `0_${rowIndex}`);
35983
35997
  })]
35984
35998
  }), /* @__PURE__ */ jsx("tbody", {
@@ -35989,7 +36003,8 @@ const Table = (props) => {
35989
36003
  columnWidths,
35990
36004
  colSpan,
35991
36005
  hasRowActions: rowActions,
35992
- columnAlignment
36006
+ columnAlignment,
36007
+ testId: testId && `${testId}-${rowIndex + 1}`
35993
36008
  }, `1_${rowIndex}`))
35994
36009
  }), footer2 && /* @__PURE__ */ jsx(Footer, {
35995
36010
  colSpan,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "3.1.11",
3
+ "version": "3.1.12",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "module": "./dist/index.js",
6
6
  "main": "./dist/index.js",