@apexcura/ui-components 0.0.14-Beta33 → 0.0.14-Beta34
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -1
- package/dist/index.mjs +29 -17
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -85,7 +85,7 @@ declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
|
85
85
|
|
|
86
86
|
declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
87
87
|
|
|
88
|
-
declare const ButtonElement: React$1.
|
|
88
|
+
declare const ButtonElement: (props: ElementType) => React$1.JSX.Element;
|
|
89
89
|
|
|
90
90
|
declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
|
|
91
91
|
|
package/dist/index.d.ts
CHANGED
|
@@ -85,7 +85,7 @@ declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
|
85
85
|
|
|
86
86
|
declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
87
87
|
|
|
88
|
-
declare const ButtonElement: React$1.
|
|
88
|
+
declare const ButtonElement: (props: ElementType) => React$1.JSX.Element;
|
|
89
89
|
|
|
90
90
|
declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
|
|
91
91
|
|
package/dist/index.js
CHANGED
|
@@ -377,13 +377,25 @@ var MultipleSelectElement = (props) => {
|
|
|
377
377
|
// src/Components/Button.tsx
|
|
378
378
|
var import_react11 = __toESM(require("react"));
|
|
379
379
|
var ButtonElement = (props) => {
|
|
380
|
+
const [svgContent, setSvgContent] = (0, import_react11.useState)(null);
|
|
381
|
+
(0, import_react11.useEffect)(() => {
|
|
382
|
+
if (props.icon) {
|
|
383
|
+
fetch(props.icon).then((response) => response.text()).then((data) => setSvgContent(data)).catch((error) => console.error("Error fetching SVG:", error));
|
|
384
|
+
}
|
|
385
|
+
}, [props.icon]);
|
|
380
386
|
return /* @__PURE__ */ import_react11.default.createElement(
|
|
381
387
|
"button",
|
|
382
388
|
{
|
|
383
389
|
onClick: () => props.onClick && props.onClick(),
|
|
384
390
|
className: `${props.className ? props.className : ""}`
|
|
385
391
|
},
|
|
386
|
-
|
|
392
|
+
svgContent ? /* @__PURE__ */ import_react11.default.createElement(
|
|
393
|
+
"span",
|
|
394
|
+
{
|
|
395
|
+
className: props.iconsClassName,
|
|
396
|
+
dangerouslySetInnerHTML: { __html: svgContent }
|
|
397
|
+
}
|
|
398
|
+
) : props.icon && /* @__PURE__ */ import_react11.default.createElement("img", { className: props.iconsClassName, src: props.icon }),
|
|
387
399
|
props.label
|
|
388
400
|
);
|
|
389
401
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -316,26 +316,38 @@ var MultipleSelectElement = (props) => {
|
|
|
316
316
|
};
|
|
317
317
|
|
|
318
318
|
// src/Components/Button.tsx
|
|
319
|
-
import React11 from "react";
|
|
319
|
+
import React11, { useEffect, useState as useState4 } from "react";
|
|
320
320
|
var ButtonElement = (props) => {
|
|
321
|
+
const [svgContent, setSvgContent] = useState4(null);
|
|
322
|
+
useEffect(() => {
|
|
323
|
+
if (props.icon) {
|
|
324
|
+
fetch(props.icon).then((response) => response.text()).then((data) => setSvgContent(data)).catch((error) => console.error("Error fetching SVG:", error));
|
|
325
|
+
}
|
|
326
|
+
}, [props.icon]);
|
|
321
327
|
return /* @__PURE__ */ React11.createElement(
|
|
322
328
|
"button",
|
|
323
329
|
{
|
|
324
330
|
onClick: () => props.onClick && props.onClick(),
|
|
325
331
|
className: `${props.className ? props.className : ""}`
|
|
326
332
|
},
|
|
327
|
-
|
|
333
|
+
svgContent ? /* @__PURE__ */ React11.createElement(
|
|
334
|
+
"span",
|
|
335
|
+
{
|
|
336
|
+
className: props.iconsClassName,
|
|
337
|
+
dangerouslySetInnerHTML: { __html: svgContent }
|
|
338
|
+
}
|
|
339
|
+
) : props.icon && /* @__PURE__ */ React11.createElement("img", { className: props.iconsClassName, src: props.icon }),
|
|
328
340
|
props.label
|
|
329
341
|
);
|
|
330
342
|
};
|
|
331
343
|
|
|
332
344
|
// src/Components/AddMoreTable.tsx
|
|
333
|
-
import React12, { useEffect, useState as
|
|
345
|
+
import React12, { useEffect as useEffect2, useState as useState5 } from "react";
|
|
334
346
|
import { Table, Button } from "antd";
|
|
335
347
|
import { PlusOutlined, DeleteOutlined } from "@ant-design/icons";
|
|
336
348
|
var AddMoreTable = (props) => {
|
|
337
349
|
const { thead, tbody } = props;
|
|
338
|
-
const [rows, setRows] =
|
|
350
|
+
const [rows, setRows] = useState5(tbody || []);
|
|
339
351
|
const onHandleRows = () => {
|
|
340
352
|
const newId = rows.length > 0 ? rows[rows.length - 1].id + 1 : 1;
|
|
341
353
|
let newRow = {
|
|
@@ -400,7 +412,7 @@ var AddMoreTable = (props) => {
|
|
|
400
412
|
});
|
|
401
413
|
});
|
|
402
414
|
};
|
|
403
|
-
|
|
415
|
+
useEffect2(() => {
|
|
404
416
|
console.log(rows);
|
|
405
417
|
}, [rows]);
|
|
406
418
|
const renderInputElement = (element, value) => {
|
|
@@ -535,7 +547,7 @@ var Navbar = (props) => {
|
|
|
535
547
|
};
|
|
536
548
|
|
|
537
549
|
// src/Components/TableElement.tsx
|
|
538
|
-
import React20, { useState as
|
|
550
|
+
import React20, { useState as useState6 } from "react";
|
|
539
551
|
import { Table as Table2 } from "antd";
|
|
540
552
|
|
|
541
553
|
// src/Components/Model.tsx
|
|
@@ -593,9 +605,9 @@ var ModelElement = (props) => {
|
|
|
593
605
|
// src/Components/TableElement.tsx
|
|
594
606
|
var TableElement = (props) => {
|
|
595
607
|
const { thead, tbody } = props;
|
|
596
|
-
const [selectedRecord, setSelectedRecord] =
|
|
597
|
-
const [model, setModel] =
|
|
598
|
-
const [selectedRowKeys, setSelectedRowKeys] =
|
|
608
|
+
const [selectedRecord, setSelectedRecord] = useState6({});
|
|
609
|
+
const [model, setModel] = useState6(false);
|
|
610
|
+
const [selectedRowKeys, setSelectedRowKeys] = useState6([]);
|
|
599
611
|
const handleChange = (record) => {
|
|
600
612
|
console.log("record", record);
|
|
601
613
|
if (props.onChange) {
|
|
@@ -682,13 +694,13 @@ var TableElement = (props) => {
|
|
|
682
694
|
};
|
|
683
695
|
|
|
684
696
|
// src/Components/DatePicker.tsx
|
|
685
|
-
import React21, { useState as
|
|
697
|
+
import React21, { useState as useState7 } from "react";
|
|
686
698
|
import { DatePicker } from "antd";
|
|
687
699
|
import dayjs from "dayjs";
|
|
688
700
|
import customParseFormat from "dayjs/plugin/customParseFormat.js";
|
|
689
701
|
dayjs.extend(customParseFormat);
|
|
690
702
|
var DatePickerElement = (props) => {
|
|
691
|
-
const [dateState, setDateState] =
|
|
703
|
+
const [dateState, setDateState] = useState7("");
|
|
692
704
|
const handleChange = (date, dateString) => {
|
|
693
705
|
if (date) {
|
|
694
706
|
const formattedDate = date;
|
|
@@ -755,10 +767,10 @@ var SingleCheckbox = (props) => {
|
|
|
755
767
|
};
|
|
756
768
|
|
|
757
769
|
// src/Components/DropDownGroup.tsx
|
|
758
|
-
import React25, { useState as
|
|
770
|
+
import React25, { useState as useState8 } from "react";
|
|
759
771
|
import { Select as Select4 } from "antd";
|
|
760
772
|
var DropDownGroup = (props) => {
|
|
761
|
-
const [selectedValue, setSelectedValue] =
|
|
773
|
+
const [selectedValue, setSelectedValue] = useState8({
|
|
762
774
|
firstValue: {},
|
|
763
775
|
secondValue: {},
|
|
764
776
|
temp: ""
|
|
@@ -810,12 +822,12 @@ var DropDownGroup = (props) => {
|
|
|
810
822
|
};
|
|
811
823
|
|
|
812
824
|
// src/Components/FilesUpload.tsx
|
|
813
|
-
import React26, { useState as
|
|
825
|
+
import React26, { useState as useState9 } from "react";
|
|
814
826
|
import { Upload } from "antd";
|
|
815
827
|
import { InboxOutlined } from "@ant-design/icons";
|
|
816
828
|
var FileUpload = (props) => {
|
|
817
829
|
const { Dragger } = Upload;
|
|
818
|
-
const [files, setFiles] =
|
|
830
|
+
const [files, setFiles] = useState9([]);
|
|
819
831
|
const handleChange = ({ fileList }) => {
|
|
820
832
|
setFiles(fileList);
|
|
821
833
|
if (props.onChange) {
|
|
@@ -869,9 +881,9 @@ var onChange = (checked) => {
|
|
|
869
881
|
var SwitchElement = () => /* @__PURE__ */ React28.createElement(Switch, { defaultChecked: true, onChange });
|
|
870
882
|
|
|
871
883
|
// src/Components/Upload.tsx
|
|
872
|
-
import React29, { useState as
|
|
884
|
+
import React29, { useState as useState10 } from "react";
|
|
873
885
|
var Upload2 = (props) => {
|
|
874
|
-
const [file, setFile] =
|
|
886
|
+
const [file, setFile] = useState10();
|
|
875
887
|
const handleFileChange = (e) => {
|
|
876
888
|
setFile(e.target.files[0]);
|
|
877
889
|
if (props.onChange) {
|