@apexcura/ui-components 0.0.11-Beta156 → 0.0.11-Beta158

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.js CHANGED
@@ -53,7 +53,7 @@ module.exports = __toCommonJS(src_exports);
53
53
  var import_react = __toESM(require("react"));
54
54
  var import_antd = require("antd");
55
55
  var TextElement = (props) => {
56
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ import_react.default.createElement(
56
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, props.label && /* @__PURE__ */ import_react.default.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ import_react.default.createElement(
57
57
  import_antd.Input,
58
58
  {
59
59
  placeholder: props.placeholder,
@@ -209,7 +209,7 @@ var RadioElement = (props) => {
209
209
  const getButtonStyle = (option) => {
210
210
  return selectedValue === option.value ? `${radioSelectedDefaultStyle} ${props.activeClassName}` : `${radioDefaultStyle} ${props.className}`;
211
211
  };
212
- return /* @__PURE__ */ import_react6.default.createElement("div", { className: props.containerClassName }, /* @__PURE__ */ import_react6.default.createElement("p", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react6.default.createElement(
212
+ return /* @__PURE__ */ import_react6.default.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ import_react6.default.createElement("p", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react6.default.createElement(
213
213
  import_antd6.Radio.Group,
214
214
  {
215
215
  onChange: handleChange,
@@ -613,16 +613,35 @@ var import_react19 = __toESM(require("react"));
613
613
  var import_antd14 = require("antd");
614
614
  var TableElement = (props) => {
615
615
  const { thead, tbody } = props;
616
- const columns = thead && thead.map((col) => ({
617
- title: col.label,
618
- dataIndex: col.name,
619
- key: col.key
620
- }));
616
+ let columns = [];
617
+ if (thead) {
618
+ columns = [
619
+ {
620
+ title: "#",
621
+ dataIndex: "#",
622
+ key: "#"
623
+ },
624
+ ...thead.map((col) => ({
625
+ title: col.label,
626
+ dataIndex: col.name,
627
+ key: col.key
628
+ }))
629
+ ];
630
+ }
621
631
  const dataSource = tbody && tbody.map((row, index) => ({
622
632
  ...row,
623
633
  [thead && thead[0].key]: index + 1
624
634
  }));
625
- return /* @__PURE__ */ import_react19.default.createElement(import_antd14.Table, { dataSource, columns, bordered: true, pagination: false, size: props.size && props.size });
635
+ return /* @__PURE__ */ import_react19.default.createElement(
636
+ import_antd14.Table,
637
+ {
638
+ dataSource,
639
+ columns,
640
+ bordered: true,
641
+ pagination: false,
642
+ size: props.size && props.size
643
+ }
644
+ );
626
645
  };
627
646
 
628
647
  // src/Components/DatePicker.tsx
@@ -632,12 +651,11 @@ var import_icons4 = require("@ant-design/icons");
632
651
  var import_addDays = require("date-fns/addDays");
633
652
  var import_date_fns = require("date-fns");
634
653
  var DatePickerElement = (props) => {
635
- const [date, setDate] = (0, import_react20.useState)(void 0);
654
+ const [date, setDate] = (0, import_react20.useState)();
636
655
  const handleChange = (value, datestring) => {
656
+ console.log(datestring);
637
657
  setDate(datestring);
638
- if (props.onChange) {
639
- props.onChange(date);
640
- }
658
+ console.log(date);
641
659
  };
642
660
  const onHandleDecrement = () => {
643
661
  setDate((prev) => prev ? (0, import_date_fns.subDays)(prev, 1) : void 0);
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import React from "react";
3
3
  import { Input as AntInput } from "antd";
4
4
  var TextElement = (props) => {
5
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ React.createElement(
5
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, props.label && /* @__PURE__ */ React.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ React.createElement(
6
6
  AntInput,
7
7
  {
8
8
  placeholder: props.placeholder,
@@ -158,7 +158,7 @@ var RadioElement = (props) => {
158
158
  const getButtonStyle = (option) => {
159
159
  return selectedValue === option.value ? `${radioSelectedDefaultStyle} ${props.activeClassName}` : `${radioDefaultStyle} ${props.className}`;
160
160
  };
161
- return /* @__PURE__ */ React6.createElement("div", { className: props.containerClassName }, /* @__PURE__ */ React6.createElement("p", { className: props.labelClassName }, props.label), /* @__PURE__ */ React6.createElement(
161
+ return /* @__PURE__ */ React6.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React6.createElement("p", { className: props.labelClassName }, props.label), /* @__PURE__ */ React6.createElement(
162
162
  Radio.Group,
163
163
  {
164
164
  onChange: handleChange,
@@ -562,16 +562,35 @@ import React18 from "react";
562
562
  import { Table as Table2 } from "antd";
563
563
  var TableElement = (props) => {
564
564
  const { thead, tbody } = props;
565
- const columns = thead && thead.map((col) => ({
566
- title: col.label,
567
- dataIndex: col.name,
568
- key: col.key
569
- }));
565
+ let columns = [];
566
+ if (thead) {
567
+ columns = [
568
+ {
569
+ title: "#",
570
+ dataIndex: "#",
571
+ key: "#"
572
+ },
573
+ ...thead.map((col) => ({
574
+ title: col.label,
575
+ dataIndex: col.name,
576
+ key: col.key
577
+ }))
578
+ ];
579
+ }
570
580
  const dataSource = tbody && tbody.map((row, index) => ({
571
581
  ...row,
572
582
  [thead && thead[0].key]: index + 1
573
583
  }));
574
- return /* @__PURE__ */ React18.createElement(Table2, { dataSource, columns, bordered: true, pagination: false, size: props.size && props.size });
584
+ return /* @__PURE__ */ React18.createElement(
585
+ Table2,
586
+ {
587
+ dataSource,
588
+ columns,
589
+ bordered: true,
590
+ pagination: false,
591
+ size: props.size && props.size
592
+ }
593
+ );
575
594
  };
576
595
 
577
596
  // src/Components/DatePicker.tsx
@@ -581,12 +600,11 @@ import { LeftOutlined, RightOutlined } from "@ant-design/icons";
581
600
  import { addDays } from "date-fns/addDays";
582
601
  import { subDays } from "date-fns";
583
602
  var DatePickerElement = (props) => {
584
- const [date, setDate] = useState5(void 0);
603
+ const [date, setDate] = useState5();
585
604
  const handleChange = (value, datestring) => {
605
+ console.log(datestring);
586
606
  setDate(datestring);
587
- if (props.onChange) {
588
- props.onChange(date);
589
- }
607
+ console.log(date);
590
608
  };
591
609
  const onHandleDecrement = () => {
592
610
  setDate((prev) => prev ? subDays(prev, 1) : void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta156",
3
+ "version": "0.0.11-Beta158",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",