@oliasoft-open-source/react-ui-library 3.1.7 → 3.1.8

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 +49 -22
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1365,7 +1365,7 @@ Accordion.defaultProps = {
1365
1365
  expanded: false,
1366
1366
  onClick: null,
1367
1367
  squareBottom: false,
1368
- testId: ""
1368
+ testId: null
1369
1369
  };
1370
1370
  Accordion.propTypes = {
1371
1371
  heading: propTypes$1.exports.node.isRequired,
@@ -7698,7 +7698,7 @@ const Icon = ({
7698
7698
  Icon.defaultProps = {
7699
7699
  clickable: false,
7700
7700
  onClick: null,
7701
- testId: ""
7701
+ testId: null
7702
7702
  };
7703
7703
  Icon.propTypes = {
7704
7704
  icon: propTypes$1.exports.oneOfType([
@@ -10720,7 +10720,8 @@ const Actions = (props) => {
10720
10720
  basic: true,
10721
10721
  small: true,
10722
10722
  icon: action2.childComponent,
10723
- testId: action2.testId
10723
+ testId: action2.testId,
10724
+ width: "auto"
10724
10725
  }, index2);
10725
10726
  } else if (action2.subActions) {
10726
10727
  return /* @__PURE__ */ jsx(SubmenuActions, {
@@ -12424,7 +12425,7 @@ Column.defaultProps = {
12424
12425
  width: null,
12425
12426
  widthMobile: null,
12426
12427
  widthTablet: null,
12427
- testId: ""
12428
+ testId: null
12428
12429
  };
12429
12430
  Column.propTypes = {
12430
12431
  background: propTypes$1.exports.string,
@@ -28362,7 +28363,7 @@ Row$1.defaultProps = {
28362
28363
  marginTop: "0",
28363
28364
  spacing: 20,
28364
28365
  wrap: false,
28365
- testId: ""
28366
+ testId: null
28366
28367
  };
28367
28368
  Row$1.propTypes = {
28368
28369
  alignItems: propTypes$1.exports.string,
@@ -34816,34 +34817,55 @@ const Title$1 = (props) => {
34816
34817
  const {
34817
34818
  colSpan,
34818
34819
  name: name2,
34819
- actions: actions2
34820
+ actions: actions2,
34821
+ actionsRight,
34822
+ testId
34820
34823
  } = props;
34821
- return name2 ? /* @__PURE__ */ jsx("tr", {
34824
+ const isNameDefined = name2 !== null;
34825
+ const isActionsDefined = actions2 !== null;
34826
+ if (!isNameDefined && !isActionsDefined) {
34827
+ return null;
34828
+ }
34829
+ const actionsContainer = () => {
34830
+ if (!isActionsDefined) {
34831
+ return null;
34832
+ }
34833
+ const actionsComponent = /* @__PURE__ */ jsx(Actions, {
34834
+ actions: actions2
34835
+ });
34836
+ if (actionsRight) {
34837
+ return actionsComponent;
34838
+ }
34839
+ return /* @__PURE__ */ jsx("div", {
34840
+ children: actionsComponent
34841
+ });
34842
+ };
34843
+ return /* @__PURE__ */ jsx("tr", {
34822
34844
  children: /* @__PURE__ */ jsx("th", {
34823
34845
  colSpan,
34824
34846
  className: styles$9.cellWrapper,
34825
34847
  children: /* @__PURE__ */ jsxs("div", {
34826
34848
  className: styles$9.title,
34827
- children: [/* @__PURE__ */ jsx("div", {
34849
+ children: [isNameDefined ? /* @__PURE__ */ jsx("span", {
34850
+ "data-testid": testId,
34828
34851
  children: name2
34829
- }), /* @__PURE__ */ jsx("div", {
34830
- children: actions2 && /* @__PURE__ */ jsx(Actions, {
34831
- actions: actions2,
34832
- isBlockElement: true
34833
- })
34834
- })]
34852
+ }) : null, actionsContainer()]
34835
34853
  })
34836
34854
  })
34837
- }) : null;
34855
+ });
34838
34856
  };
34839
34857
  Title$1.defaultProps = {
34840
34858
  name: null,
34841
- actions: null
34859
+ actions: null,
34860
+ actionsRight: false,
34861
+ testId: null
34842
34862
  };
34843
34863
  Title$1.propTypes = {
34844
34864
  actions: actionsShape,
34865
+ actionsRight: propTypes$1.exports.bool,
34845
34866
  colSpan: propTypes$1.exports.number.isRequired,
34846
- name: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.number])
34867
+ name: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.number]),
34868
+ testId: propTypes$1.exports.string
34847
34869
  };
34848
34870
  const cellWrapperPadding$1 = "_cellWrapperPadding_1i1hr_326";
34849
34871
  const flexBlock$1 = "_flexBlock_1i1hr_329";
@@ -34896,8 +34918,7 @@ const Footer = (props) => {
34896
34918
  pagination: pagination2
34897
34919
  }) : /* @__PURE__ */ jsx("div", {}), /* @__PURE__ */ jsx("div", {
34898
34920
  children: /* @__PURE__ */ jsx(Actions, {
34899
- actions: actions2,
34900
- isBlockElement: true
34921
+ actions: actions2
34901
34922
  })
34902
34923
  })]
34903
34924
  })
@@ -35538,7 +35559,7 @@ Cell.defaultProps = {
35538
35559
  isHeader: false,
35539
35560
  style: {},
35540
35561
  cell: {},
35541
- testId: ""
35562
+ testId: null
35542
35563
  };
35543
35564
  Cell.propTypes = {
35544
35565
  isHeader: propTypes$1.exports.bool,
@@ -35819,6 +35840,7 @@ const Table = (props) => {
35819
35840
  name: name2,
35820
35841
  rows,
35821
35842
  actions: actions2,
35843
+ actionsRight,
35822
35844
  columnHeaderAlignments,
35823
35845
  columnAlignment,
35824
35846
  stickyHeaders,
@@ -35873,8 +35895,10 @@ const Table = (props) => {
35873
35895
  children: [/* @__PURE__ */ jsxs("thead", {
35874
35896
  children: [/* @__PURE__ */ jsx(Title$1, {
35875
35897
  actions: actions2,
35898
+ actionsRight,
35876
35899
  name: name2,
35877
- colSpan
35900
+ colSpan,
35901
+ testId: testId && `${testId}-title`
35878
35902
  }), headers.map((row2, rowIndex) => {
35879
35903
  return /* @__PURE__ */ jsx(Row, {
35880
35904
  rowIndex,
@@ -35934,8 +35958,10 @@ const Table = (props) => {
35934
35958
  children: [/* @__PURE__ */ jsxs("thead", {
35935
35959
  children: [/* @__PURE__ */ jsx(Title$1, {
35936
35960
  actions: actions2,
35961
+ actionsRight,
35937
35962
  name: name2,
35938
- colSpan
35963
+ colSpan,
35964
+ testId: testId && `${testId}-title`
35939
35965
  }), headers.map((row2, rowIndex) => {
35940
35966
  return /* @__PURE__ */ jsx(Row, {
35941
35967
  rowIndex,
@@ -35978,6 +36004,7 @@ Table.propTypes = {
35978
36004
  table: propTypes$1.exports.shape({
35979
36005
  name: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.number]),
35980
36006
  actions: actionsShape,
36007
+ actionsRight: propTypes$1.exports.bool,
35981
36008
  fixedWidth: propTypes$1.exports.string,
35982
36009
  maxHeight: propTypes$1.exports.string,
35983
36010
  columnWidths: propTypes$1.exports.arrayOf(propTypes$1.exports.string),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "3.1.7",
3
+ "version": "3.1.8",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "module": "./dist/index.js",
6
6
  "main": "./dist/index.js",