@apexcura/ui-components 0.0.11-Beta160 → 0.0.11-Beta161
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.js +8 -4
- package/dist/index.mjs +8 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -650,15 +650,19 @@ var import_antd15 = require("antd");
|
|
|
650
650
|
var import_icons4 = require("@ant-design/icons");
|
|
651
651
|
var import_moment = __toESM(require("moment"));
|
|
652
652
|
var DatePickerElement = (props) => {
|
|
653
|
-
const [date, setDate] = (0, import_react20.useState)();
|
|
653
|
+
const [date, setDate] = (0, import_react20.useState)("");
|
|
654
654
|
const handleChange = (value, datestring) => {
|
|
655
|
-
|
|
656
|
-
setDate(
|
|
657
|
-
|
|
655
|
+
const formatedDate = (0, import_moment.default)(datestring).format("lll");
|
|
656
|
+
setDate(formatedDate);
|
|
657
|
+
if (props.onChange) {
|
|
658
|
+
props.onChange(date);
|
|
659
|
+
}
|
|
658
660
|
};
|
|
659
661
|
const onHandleDecrement = () => {
|
|
662
|
+
setDate((0, import_moment.default)(date).subtract(1, "days").calendar());
|
|
660
663
|
};
|
|
661
664
|
const onHandleIncrement = () => {
|
|
665
|
+
setDate((0, import_moment.default)(date).add(1, "days").calendar());
|
|
662
666
|
};
|
|
663
667
|
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)));
|
|
664
668
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -599,15 +599,19 @@ import { DatePicker } from "antd";
|
|
|
599
599
|
import { LeftOutlined, RightOutlined } from "@ant-design/icons";
|
|
600
600
|
import moment from "moment";
|
|
601
601
|
var DatePickerElement = (props) => {
|
|
602
|
-
const [date, setDate] = useState5();
|
|
602
|
+
const [date, setDate] = useState5("");
|
|
603
603
|
const handleChange = (value, datestring) => {
|
|
604
|
-
|
|
605
|
-
setDate(
|
|
606
|
-
|
|
604
|
+
const formatedDate = moment(datestring).format("lll");
|
|
605
|
+
setDate(formatedDate);
|
|
606
|
+
if (props.onChange) {
|
|
607
|
+
props.onChange(date);
|
|
608
|
+
}
|
|
607
609
|
};
|
|
608
610
|
const onHandleDecrement = () => {
|
|
611
|
+
setDate(moment(date).subtract(1, "days").calendar());
|
|
609
612
|
};
|
|
610
613
|
const onHandleIncrement = () => {
|
|
614
|
+
setDate(moment(date).add(1, "days").calendar());
|
|
611
615
|
};
|
|
612
616
|
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)));
|
|
613
617
|
};
|