@apexcura/ui-components 0.0.12-Beta100 → 0.0.12-Beta102

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
@@ -11,7 +11,7 @@ type ElementType = {
11
11
  disabled?: boolean;
12
12
  prefix?: React.ReactNode;
13
13
  type?: string;
14
- value?: string | number | boolean | any[] | null;
14
+ value?: string | number | boolean | any[] | null | undefined;
15
15
  status?: "error" | "warning";
16
16
  styles?: React.CSSProperties;
17
17
  variant?: "outlined" | "borderless" | "filled";
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ type ElementType = {
11
11
  disabled?: boolean;
12
12
  prefix?: React.ReactNode;
13
13
  type?: string;
14
- value?: string | number | boolean | any[] | null;
14
+ value?: string | number | boolean | any[] | null | undefined;
15
15
  status?: "error" | "warning";
16
16
  styles?: React.CSSProperties;
17
17
  variant?: "outlined" | "borderless" | "filled";
package/dist/index.js CHANGED
@@ -628,13 +628,22 @@ var TableElement = (props) => {
628
628
  var import_react20 = __toESM(require("react"));
629
629
  var import_antd15 = require("antd");
630
630
  var import_icons4 = require("@ant-design/icons");
631
+ var import_date_fns = require("date-fns");
631
632
  var DatePickerElement = (props) => {
633
+ const [date, setDate] = (0, import_react20.useState)(void 0);
632
634
  const handleChange = (value) => {
635
+ setDate(value);
633
636
  if (props.onChange) {
634
- props.onChange(value);
637
+ props.onChange(date);
635
638
  }
636
639
  };
637
- return /* @__PURE__ */ import_react20.default.createElement("div", null, /* @__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, nextIcon: /* @__PURE__ */ import_react20.default.createElement(import_icons4.LeftOutlined, null), prevIcon: true, superPrevIcon: true, onChange: handleChange }), /* @__PURE__ */ import_react20.default.createElement(import_icons4.RightOutlined, null));
640
+ const onHandleDecrement = () => {
641
+ setDate((prevDate) => prevDate ? (0, import_date_fns.subDays)(prevDate, 1) : void 0);
642
+ };
643
+ const onHandleIncrement = () => {
644
+ setDate((prevDate) => prevDate ? (0, import_date_fns.addDays)(prevDate, 1) : void 0);
645
+ };
646
+ return /* @__PURE__ */ import_react20.default.createElement("div", null, /* @__PURE__ */ import_react20.default.createElement(import_icons4.LeftOutlined, { onClick: onHandleDecrement }), /* @__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(import_icons4.RightOutlined, { onClick: onHandleIncrement }));
638
647
  };
639
648
  // Annotate the CommonJS export names for ESM import in node:
640
649
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -574,16 +574,25 @@ var TableElement = (props) => {
574
574
  };
575
575
 
576
576
  // src/Components/DatePicker.tsx
577
- import React19 from "react";
577
+ import React19, { useState as useState5 } from "react";
578
578
  import { DatePicker } from "antd";
579
579
  import { LeftOutlined, RightOutlined } from "@ant-design/icons";
580
+ import { addDays, subDays } from "date-fns";
580
581
  var DatePickerElement = (props) => {
582
+ const [date, setDate] = useState5(void 0);
581
583
  const handleChange = (value) => {
584
+ setDate(value);
582
585
  if (props.onChange) {
583
- props.onChange(value);
586
+ props.onChange(date);
584
587
  }
585
588
  };
586
- return /* @__PURE__ */ React19.createElement("div", null, /* @__PURE__ */ React19.createElement(LeftOutlined, null), /* @__PURE__ */ React19.createElement(DatePicker, { placeholder: props.placeholder, variant: "borderless", value: props.value, nextIcon: /* @__PURE__ */ React19.createElement(LeftOutlined, null), prevIcon: true, superPrevIcon: true, onChange: handleChange }), /* @__PURE__ */ React19.createElement(RightOutlined, null));
589
+ const onHandleDecrement = () => {
590
+ setDate((prevDate) => prevDate ? subDays(prevDate, 1) : void 0);
591
+ };
592
+ const onHandleIncrement = () => {
593
+ setDate((prevDate) => prevDate ? addDays(prevDate, 1) : void 0);
594
+ };
595
+ return /* @__PURE__ */ React19.createElement("div", null, /* @__PURE__ */ React19.createElement(LeftOutlined, { onClick: onHandleDecrement }), /* @__PURE__ */ React19.createElement(DatePicker, { placeholder: props.placeholder, variant: "borderless", value: props.value, defaultValue: true, onChange: handleChange }), /* @__PURE__ */ React19.createElement(RightOutlined, { onClick: onHandleIncrement }));
587
596
  };
588
597
  export {
589
598
  AddMoreTable,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.12-Beta100",
3
+ "version": "0.0.12-Beta102",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",
@@ -50,7 +50,9 @@
50
50
  "dependencies": {
51
51
  "@tinymce/tinymce-react": "^5.0.1",
52
52
  "autoprefixer": "^10.4.19",
53
+ "date-fns": "^3.6.0",
53
54
  "esbuild": "^0.21.4",
55
+ "moment": "^2.30.1",
54
56
  "postcss": "^8.4.38",
55
57
  "postcss-import": "^16.1.0",
56
58
  "react-icons": "^5.2.1",