@apexcura/ui-components 0.0.11-Beta154 → 0.0.11-Beta156
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 +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +11 -10
- package/dist/index.mjs +11 -10
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React$1 from 'react';
|
|
2
|
+
import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
2
3
|
|
|
3
4
|
type ElementType = {
|
|
4
5
|
[x: string]: any;
|
|
@@ -11,6 +12,7 @@ type ElementType = {
|
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
prefix?: React.ReactNode;
|
|
13
14
|
type?: string;
|
|
15
|
+
size?: SizeType;
|
|
14
16
|
value?: string | number | boolean | any[] | null | undefined;
|
|
15
17
|
status?: "error" | "warning";
|
|
16
18
|
styles?: React.CSSProperties;
|
|
@@ -48,6 +50,8 @@ type ElementType = {
|
|
|
48
50
|
element?: string;
|
|
49
51
|
secondTextClassName?: string;
|
|
50
52
|
iconsClassName?: string;
|
|
53
|
+
labelClassName?: string;
|
|
54
|
+
containerClassName?: string;
|
|
51
55
|
};
|
|
52
56
|
|
|
53
57
|
interface ElementExecuterProps$3 extends ElementType {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React$1 from 'react';
|
|
2
|
+
import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
2
3
|
|
|
3
4
|
type ElementType = {
|
|
4
5
|
[x: string]: any;
|
|
@@ -11,6 +12,7 @@ type ElementType = {
|
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
prefix?: React.ReactNode;
|
|
13
14
|
type?: string;
|
|
15
|
+
size?: SizeType;
|
|
14
16
|
value?: string | number | boolean | any[] | null | undefined;
|
|
15
17
|
status?: "error" | "warning";
|
|
16
18
|
styles?: React.CSSProperties;
|
|
@@ -48,6 +50,8 @@ type ElementType = {
|
|
|
48
50
|
element?: string;
|
|
49
51
|
secondTextClassName?: string;
|
|
50
52
|
iconsClassName?: string;
|
|
53
|
+
labelClassName?: string;
|
|
54
|
+
containerClassName?: string;
|
|
51
55
|
};
|
|
52
56
|
|
|
53
57
|
interface ElementExecuterProps$3 extends ElementType {
|
package/dist/index.js
CHANGED
|
@@ -189,7 +189,6 @@ var SelectElement = (props) => {
|
|
|
189
189
|
// src/Components/RadioElement.tsx
|
|
190
190
|
var import_react6 = __toESM(require("react"));
|
|
191
191
|
var import_antd6 = require("antd");
|
|
192
|
-
var containerClassName = " ";
|
|
193
192
|
var radioDefaultStyle = "bg-[#F2F2F2] border border-[#919191] rounded-[8px] m-[10px] hover:bg-[#F2F2F2] text-center text-black shadow-[0px_0px_1px_1px_#919191]";
|
|
194
193
|
var radioSelectedDefaultStyle = "bg-[#E2D6F8] border border-[#B8A4DE] rounded-[8px] p-[6px] m-[10px] shadow-[0px_0px_1px_1px_#B8A4DE] text-center text-black shadow-[0px_0px_1px_1px_#919191]";
|
|
195
194
|
var RadioElement = (props) => {
|
|
@@ -208,14 +207,14 @@ var RadioElement = (props) => {
|
|
|
208
207
|
}
|
|
209
208
|
};
|
|
210
209
|
const getButtonStyle = (option) => {
|
|
211
|
-
return selectedValue === option.value ? `${radioSelectedDefaultStyle} ${
|
|
210
|
+
return selectedValue === option.value ? `${radioSelectedDefaultStyle} ${props.activeClassName}` : `${radioDefaultStyle} ${props.className}`;
|
|
212
211
|
};
|
|
213
|
-
return /* @__PURE__ */ import_react6.default.createElement("div", { className: containerClassName }, /* @__PURE__ */ import_react6.default.createElement("p",
|
|
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(
|
|
214
213
|
import_antd6.Radio.Group,
|
|
215
214
|
{
|
|
216
215
|
onChange: handleChange,
|
|
217
216
|
optionType,
|
|
218
|
-
className: props.
|
|
217
|
+
className: props.radioGroupClassName,
|
|
219
218
|
value: selectedValue
|
|
220
219
|
},
|
|
221
220
|
props.options && props.options.map((option) => /* @__PURE__ */ import_react6.default.createElement(
|
|
@@ -619,7 +618,11 @@ var TableElement = (props) => {
|
|
|
619
618
|
dataIndex: col.name,
|
|
620
619
|
key: col.key
|
|
621
620
|
}));
|
|
622
|
-
|
|
621
|
+
const dataSource = tbody && tbody.map((row, index) => ({
|
|
622
|
+
...row,
|
|
623
|
+
[thead && thead[0].key]: index + 1
|
|
624
|
+
}));
|
|
625
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_antd14.Table, { dataSource, columns, bordered: true, pagination: false, size: props.size && props.size });
|
|
623
626
|
};
|
|
624
627
|
|
|
625
628
|
// src/Components/DatePicker.tsx
|
|
@@ -627,16 +630,17 @@ var import_react20 = __toESM(require("react"));
|
|
|
627
630
|
var import_antd15 = require("antd");
|
|
628
631
|
var import_icons4 = require("@ant-design/icons");
|
|
629
632
|
var import_addDays = require("date-fns/addDays");
|
|
633
|
+
var import_date_fns = require("date-fns");
|
|
630
634
|
var DatePickerElement = (props) => {
|
|
631
635
|
const [date, setDate] = (0, import_react20.useState)(void 0);
|
|
632
636
|
const handleChange = (value, datestring) => {
|
|
633
|
-
setDate(
|
|
637
|
+
setDate(datestring);
|
|
634
638
|
if (props.onChange) {
|
|
635
639
|
props.onChange(date);
|
|
636
640
|
}
|
|
637
641
|
};
|
|
638
642
|
const onHandleDecrement = () => {
|
|
639
|
-
setDate((prev) => prev ?
|
|
643
|
+
setDate((prev) => prev ? (0, import_date_fns.subDays)(prev, 1) : void 0);
|
|
640
644
|
};
|
|
641
645
|
const onHandleIncrement = () => {
|
|
642
646
|
setDate((prev) => prev ? (0, import_addDays.addDays)(prev, 1) : void 0);
|
|
@@ -644,9 +648,6 @@ var DatePickerElement = (props) => {
|
|
|
644
648
|
};
|
|
645
649
|
return /* @__PURE__ */ import_react20.default.createElement("div", null, /* @__PURE__ */ import_react20.default.createElement("button", { onClick: onHandleDecrement }, /* @__PURE__ */ import_react20.default.createElement(import_icons4.LeftOutlined, null)), /* @__PURE__ */ import_react20.default.createElement(import_antd15.DatePicker, { placeholder: props.placeholder, variant: "borderless", value: props.value, defaultValue: true, onChange: handleChange }), /* @__PURE__ */ import_react20.default.createElement("button", { onClick: onHandleIncrement }, /* @__PURE__ */ import_react20.default.createElement(import_icons4.RightOutlined, null)));
|
|
646
650
|
};
|
|
647
|
-
function subDaya(prev, p0) {
|
|
648
|
-
throw new Error("Function not implemented.");
|
|
649
|
-
}
|
|
650
651
|
// Annotate the CommonJS export names for ESM import in node:
|
|
651
652
|
0 && (module.exports = {
|
|
652
653
|
AddMoreTable,
|
package/dist/index.mjs
CHANGED
|
@@ -138,7 +138,6 @@ var SelectElement = (props) => {
|
|
|
138
138
|
// src/Components/RadioElement.tsx
|
|
139
139
|
import React6, { useState as useState2 } from "react";
|
|
140
140
|
import { Radio } from "antd";
|
|
141
|
-
var containerClassName = " ";
|
|
142
141
|
var radioDefaultStyle = "bg-[#F2F2F2] border border-[#919191] rounded-[8px] m-[10px] hover:bg-[#F2F2F2] text-center text-black shadow-[0px_0px_1px_1px_#919191]";
|
|
143
142
|
var radioSelectedDefaultStyle = "bg-[#E2D6F8] border border-[#B8A4DE] rounded-[8px] p-[6px] m-[10px] shadow-[0px_0px_1px_1px_#B8A4DE] text-center text-black shadow-[0px_0px_1px_1px_#919191]";
|
|
144
143
|
var RadioElement = (props) => {
|
|
@@ -157,14 +156,14 @@ var RadioElement = (props) => {
|
|
|
157
156
|
}
|
|
158
157
|
};
|
|
159
158
|
const getButtonStyle = (option) => {
|
|
160
|
-
return selectedValue === option.value ? `${radioSelectedDefaultStyle} ${
|
|
159
|
+
return selectedValue === option.value ? `${radioSelectedDefaultStyle} ${props.activeClassName}` : `${radioDefaultStyle} ${props.className}`;
|
|
161
160
|
};
|
|
162
|
-
return /* @__PURE__ */ React6.createElement("div", { className: containerClassName }, /* @__PURE__ */ React6.createElement("p",
|
|
161
|
+
return /* @__PURE__ */ React6.createElement("div", { className: props.containerClassName }, /* @__PURE__ */ React6.createElement("p", { className: props.labelClassName }, props.label), /* @__PURE__ */ React6.createElement(
|
|
163
162
|
Radio.Group,
|
|
164
163
|
{
|
|
165
164
|
onChange: handleChange,
|
|
166
165
|
optionType,
|
|
167
|
-
className: props.
|
|
166
|
+
className: props.radioGroupClassName,
|
|
168
167
|
value: selectedValue
|
|
169
168
|
},
|
|
170
169
|
props.options && props.options.map((option) => /* @__PURE__ */ React6.createElement(
|
|
@@ -568,7 +567,11 @@ var TableElement = (props) => {
|
|
|
568
567
|
dataIndex: col.name,
|
|
569
568
|
key: col.key
|
|
570
569
|
}));
|
|
571
|
-
|
|
570
|
+
const dataSource = tbody && tbody.map((row, index) => ({
|
|
571
|
+
...row,
|
|
572
|
+
[thead && thead[0].key]: index + 1
|
|
573
|
+
}));
|
|
574
|
+
return /* @__PURE__ */ React18.createElement(Table2, { dataSource, columns, bordered: true, pagination: false, size: props.size && props.size });
|
|
572
575
|
};
|
|
573
576
|
|
|
574
577
|
// src/Components/DatePicker.tsx
|
|
@@ -576,16 +579,17 @@ import React19, { useState as useState5 } from "react";
|
|
|
576
579
|
import { DatePicker } from "antd";
|
|
577
580
|
import { LeftOutlined, RightOutlined } from "@ant-design/icons";
|
|
578
581
|
import { addDays } from "date-fns/addDays";
|
|
582
|
+
import { subDays } from "date-fns";
|
|
579
583
|
var DatePickerElement = (props) => {
|
|
580
584
|
const [date, setDate] = useState5(void 0);
|
|
581
585
|
const handleChange = (value, datestring) => {
|
|
582
|
-
setDate(
|
|
586
|
+
setDate(datestring);
|
|
583
587
|
if (props.onChange) {
|
|
584
588
|
props.onChange(date);
|
|
585
589
|
}
|
|
586
590
|
};
|
|
587
591
|
const onHandleDecrement = () => {
|
|
588
|
-
setDate((prev) => prev ?
|
|
592
|
+
setDate((prev) => prev ? subDays(prev, 1) : void 0);
|
|
589
593
|
};
|
|
590
594
|
const onHandleIncrement = () => {
|
|
591
595
|
setDate((prev) => prev ? addDays(prev, 1) : void 0);
|
|
@@ -593,9 +597,6 @@ var DatePickerElement = (props) => {
|
|
|
593
597
|
};
|
|
594
598
|
return /* @__PURE__ */ React19.createElement("div", null, /* @__PURE__ */ React19.createElement("button", { onClick: onHandleDecrement }, /* @__PURE__ */ React19.createElement(LeftOutlined, null)), /* @__PURE__ */ React19.createElement(DatePicker, { placeholder: props.placeholder, variant: "borderless", value: props.value, defaultValue: true, onChange: handleChange }), /* @__PURE__ */ React19.createElement("button", { onClick: onHandleIncrement }, /* @__PURE__ */ React19.createElement(RightOutlined, null)));
|
|
595
599
|
};
|
|
596
|
-
function subDaya(prev, p0) {
|
|
597
|
-
throw new Error("Function not implemented.");
|
|
598
|
-
}
|
|
599
600
|
export {
|
|
600
601
|
AddMoreTable,
|
|
601
602
|
ButtonElement,
|