@apexcura/ui-components 0.0.11-Beta155 → 0.0.11-Beta157
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.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +16 -8
- package/dist/index.mjs +16 -8
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
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,12 +613,21 @@ 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 =
|
|
616
|
+
const columns = [{
|
|
617
|
+
title: "#",
|
|
618
|
+
dataIndex: "#",
|
|
619
|
+
key: "#"
|
|
620
|
+
}];
|
|
621
|
+
thead && thead.map((col) => ({
|
|
617
622
|
title: col.label,
|
|
618
623
|
dataIndex: col.name,
|
|
619
624
|
key: col.key
|
|
620
625
|
}));
|
|
621
|
-
|
|
626
|
+
const dataSource = tbody && tbody.map((row, index) => ({
|
|
627
|
+
...row,
|
|
628
|
+
[thead && thead[0].key]: index + 1
|
|
629
|
+
}));
|
|
630
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_antd14.Table, { dataSource, columns, bordered: true, pagination: false, size: props.size && props.size });
|
|
622
631
|
};
|
|
623
632
|
|
|
624
633
|
// src/Components/DatePicker.tsx
|
|
@@ -628,12 +637,11 @@ var import_icons4 = require("@ant-design/icons");
|
|
|
628
637
|
var import_addDays = require("date-fns/addDays");
|
|
629
638
|
var import_date_fns = require("date-fns");
|
|
630
639
|
var DatePickerElement = (props) => {
|
|
631
|
-
const [date, setDate] = (0, import_react20.useState)(
|
|
640
|
+
const [date, setDate] = (0, import_react20.useState)();
|
|
632
641
|
const handleChange = (value, datestring) => {
|
|
642
|
+
console.log(datestring);
|
|
633
643
|
setDate(datestring);
|
|
634
|
-
|
|
635
|
-
props.onChange(date);
|
|
636
|
-
}
|
|
644
|
+
console.log(date);
|
|
637
645
|
};
|
|
638
646
|
const onHandleDecrement = () => {
|
|
639
647
|
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,12 +562,21 @@ 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 =
|
|
565
|
+
const columns = [{
|
|
566
|
+
title: "#",
|
|
567
|
+
dataIndex: "#",
|
|
568
|
+
key: "#"
|
|
569
|
+
}];
|
|
570
|
+
thead && thead.map((col) => ({
|
|
566
571
|
title: col.label,
|
|
567
572
|
dataIndex: col.name,
|
|
568
573
|
key: col.key
|
|
569
574
|
}));
|
|
570
|
-
|
|
575
|
+
const dataSource = tbody && tbody.map((row, index) => ({
|
|
576
|
+
...row,
|
|
577
|
+
[thead && thead[0].key]: index + 1
|
|
578
|
+
}));
|
|
579
|
+
return /* @__PURE__ */ React18.createElement(Table2, { dataSource, columns, bordered: true, pagination: false, size: props.size && props.size });
|
|
571
580
|
};
|
|
572
581
|
|
|
573
582
|
// src/Components/DatePicker.tsx
|
|
@@ -577,12 +586,11 @@ import { LeftOutlined, RightOutlined } from "@ant-design/icons";
|
|
|
577
586
|
import { addDays } from "date-fns/addDays";
|
|
578
587
|
import { subDays } from "date-fns";
|
|
579
588
|
var DatePickerElement = (props) => {
|
|
580
|
-
const [date, setDate] = useState5(
|
|
589
|
+
const [date, setDate] = useState5();
|
|
581
590
|
const handleChange = (value, datestring) => {
|
|
591
|
+
console.log(datestring);
|
|
582
592
|
setDate(datestring);
|
|
583
|
-
|
|
584
|
-
props.onChange(date);
|
|
585
|
-
}
|
|
593
|
+
console.log(date);
|
|
586
594
|
};
|
|
587
595
|
const onHandleDecrement = () => {
|
|
588
596
|
setDate((prev) => prev ? subDays(prev, 1) : void 0);
|