@apexcura/ui-components 0.0.14-Beta32 → 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 CHANGED
@@ -26,8 +26,9 @@ type ElementType = {
26
26
  fields?: any[];
27
27
  schema?: any[];
28
28
  options?: any[];
29
- firstOptions: any[];
30
- secondOptions: any[];
29
+ firstOptions?: any[];
30
+ secondOptions?: any[];
31
+ view?: boolean;
31
32
  onChange?: (value: string | number | boolean | object | any[] | undefined) => void;
32
33
  onClick?: () => void;
33
34
  dropDownOptions?: any[];
@@ -84,7 +85,7 @@ declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
84
85
 
85
86
  declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
86
87
 
87
- declare const ButtonElement: React$1.FC<ElementType>;
88
+ declare const ButtonElement: (props: ElementType) => React$1.JSX.Element;
88
89
 
89
90
  declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
90
91
 
package/dist/index.d.ts CHANGED
@@ -26,8 +26,9 @@ type ElementType = {
26
26
  fields?: any[];
27
27
  schema?: any[];
28
28
  options?: any[];
29
- firstOptions: any[];
30
- secondOptions: any[];
29
+ firstOptions?: any[];
30
+ secondOptions?: any[];
31
+ view?: boolean;
31
32
  onChange?: (value: string | number | boolean | object | any[] | undefined) => void;
32
33
  onClick?: () => void;
33
34
  dropDownOptions?: any[];
@@ -84,7 +85,7 @@ declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
84
85
 
85
86
  declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
86
87
 
87
- declare const ButtonElement: React$1.FC<ElementType>;
88
+ declare const ButtonElement: (props: ElementType) => React$1.JSX.Element;
88
89
 
89
90
  declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
90
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
- props.icon && /* @__PURE__ */ import_react11.default.createElement("img", { className: props.iconsClassName, src: props.icon }),
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
  };
@@ -683,8 +695,10 @@ var TableElement = (props) => {
683
695
  }
684
696
  }
685
697
  }
686
- })),
687
- {
698
+ }))
699
+ ];
700
+ if (props.view) {
701
+ columns.push({
688
702
  title: "View",
689
703
  dataIndex: "View",
690
704
  key: "View",
@@ -699,8 +713,8 @@ var TableElement = (props) => {
699
713
  },
700
714
  "View"
701
715
  )
702
- }
703
- ];
716
+ });
717
+ }
704
718
  }
705
719
  const dataSource = tbody && tbody.map((row, index) => ({
706
720
  ...row,
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
- props.icon && /* @__PURE__ */ React11.createElement("img", { className: props.iconsClassName, src: props.icon }),
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 useState4 } from "react";
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] = useState4(tbody || []);
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
- useEffect(() => {
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 useState5 } from "react";
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] = useState5({});
597
- const [model, setModel] = useState5(false);
598
- const [selectedRowKeys, setSelectedRowKeys] = useState5([]);
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) {
@@ -624,8 +636,10 @@ var TableElement = (props) => {
624
636
  }
625
637
  }
626
638
  }
627
- })),
628
- {
639
+ }))
640
+ ];
641
+ if (props.view) {
642
+ columns.push({
629
643
  title: "View",
630
644
  dataIndex: "View",
631
645
  key: "View",
@@ -640,8 +654,8 @@ var TableElement = (props) => {
640
654
  },
641
655
  "View"
642
656
  )
643
- }
644
- ];
657
+ });
658
+ }
645
659
  }
646
660
  const dataSource = tbody && tbody.map((row, index) => ({
647
661
  ...row,
@@ -680,13 +694,13 @@ var TableElement = (props) => {
680
694
  };
681
695
 
682
696
  // src/Components/DatePicker.tsx
683
- import React21, { useState as useState6 } from "react";
697
+ import React21, { useState as useState7 } from "react";
684
698
  import { DatePicker } from "antd";
685
699
  import dayjs from "dayjs";
686
700
  import customParseFormat from "dayjs/plugin/customParseFormat.js";
687
701
  dayjs.extend(customParseFormat);
688
702
  var DatePickerElement = (props) => {
689
- const [dateState, setDateState] = useState6("");
703
+ const [dateState, setDateState] = useState7("");
690
704
  const handleChange = (date, dateString) => {
691
705
  if (date) {
692
706
  const formattedDate = date;
@@ -753,10 +767,10 @@ var SingleCheckbox = (props) => {
753
767
  };
754
768
 
755
769
  // src/Components/DropDownGroup.tsx
756
- import React25, { useState as useState7 } from "react";
770
+ import React25, { useState as useState8 } from "react";
757
771
  import { Select as Select4 } from "antd";
758
772
  var DropDownGroup = (props) => {
759
- const [selectedValue, setSelectedValue] = useState7({
773
+ const [selectedValue, setSelectedValue] = useState8({
760
774
  firstValue: {},
761
775
  secondValue: {},
762
776
  temp: ""
@@ -808,12 +822,12 @@ var DropDownGroup = (props) => {
808
822
  };
809
823
 
810
824
  // src/Components/FilesUpload.tsx
811
- import React26, { useState as useState8 } from "react";
825
+ import React26, { useState as useState9 } from "react";
812
826
  import { Upload } from "antd";
813
827
  import { InboxOutlined } from "@ant-design/icons";
814
828
  var FileUpload = (props) => {
815
829
  const { Dragger } = Upload;
816
- const [files, setFiles] = useState8([]);
830
+ const [files, setFiles] = useState9([]);
817
831
  const handleChange = ({ fileList }) => {
818
832
  setFiles(fileList);
819
833
  if (props.onChange) {
@@ -867,9 +881,9 @@ var onChange = (checked) => {
867
881
  var SwitchElement = () => /* @__PURE__ */ React28.createElement(Switch, { defaultChecked: true, onChange });
868
882
 
869
883
  // src/Components/Upload.tsx
870
- import React29, { useState as useState9 } from "react";
884
+ import React29, { useState as useState10 } from "react";
871
885
  var Upload2 = (props) => {
872
- const [file, setFile] = useState9();
886
+ const [file, setFile] = useState10();
873
887
  const handleFileChange = (e) => {
874
888
  setFile(e.target.files[0]);
875
889
  if (props.onChange) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.14-Beta32",
3
+ "version": "0.0.14-Beta34",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",