cecomponent 1.0.104 → 1.0.106

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.
@@ -15500,9 +15500,10 @@ const CloudUploadIcon = createSvgIcon(/* @__PURE__ */ jsxRuntimeExports$1.jsx("p
15500
15500
  className: "ce-step",
15501
15501
  style: {
15502
15502
  gridColumn: u * 2 + 1,
15503
- cursor: a ? "pointer" : "default"
15503
+ cursor: "default"
15504
+ },
15505
+ onClick: () => {
15504
15506
  },
15505
- onClick: () => a == null ? void 0 : a(u),
15506
15507
  children: l(u)
15507
15508
  }
15508
15509
  ),
@@ -52542,30 +52543,46 @@ const CEInputBox$1 = ({
52542
52543
  onChange: t,
52543
52544
  size: i = "medium",
52544
52545
  style: n,
52545
- inputGroupStyle: s
52546
+ inputGroupStyle: s,
52547
+ mode: a = "range"
52546
52548
  }) => {
52547
- const [a, o] = useState(""), [l, c] = useState(""), [f, u] = useState(!1), [y, d] = useState(""), g = (x) => {
52548
- !x.currentTarget.value && !a && !l && u(!1);
52549
- }, m = (x, _) => {
52550
- x && _ && new Date(_) < new Date(x) ? d("End date must be after or equal to start date") : (d(""), t == null || t({ startDate: x, endDate: _ }));
52551
- }, p = (x) => {
52552
- const _ = x.target.value;
52553
- o(_), m(_, l);
52554
- }, S = (x) => {
52555
- const _ = x.target.value;
52556
- c(_), m(a, _);
52549
+ const [o, l] = useState(""), [c, f] = useState(""), [u, y] = useState(!1), [d, g] = useState(""), m = (_) => {
52550
+ !_.currentTarget.value && !o && !c && y(!1);
52551
+ }, p = (_, E) => {
52552
+ _ && E && new Date(E) < new Date(_) ? g("End date must be after or equal to start date") : (g(""), t == null || t({ startDate: _, endDate: E }));
52553
+ }, S = (_) => {
52554
+ const E = _.target.value;
52555
+ l(E), p(E, c);
52556
+ }, x = (_) => {
52557
+ const E = _.target.value;
52558
+ f(E), p(o, E);
52557
52559
  };
52558
52560
  return /* @__PURE__ */ jsxRuntimeExports$1.jsxs("div", { className: "date-range-picker", style: n, children: [
52559
- /* @__PURE__ */ jsxRuntimeExports$1.jsxs("div", { className: "date-range-field-group", style: s, children: [
52561
+ /* @__PURE__ */ jsxRuntimeExports$1.jsx("div", { className: "date-range-field-group", style: s, children: a === "single" ? /* @__PURE__ */ jsxRuntimeExports$1.jsxs("div", { className: "field-box float", children: [
52562
+ /* @__PURE__ */ jsxRuntimeExports$1.jsx(
52563
+ "input",
52564
+ {
52565
+ type: "date",
52566
+ value: o,
52567
+ onChange: (_) => {
52568
+ const E = _.target.value;
52569
+ l(E), t == null || t({ startDate: E, endDate: "" });
52570
+ },
52571
+ onFocus: () => y(!0),
52572
+ onBlur: (_) => m(_)
52573
+ }
52574
+ ),
52575
+ /* @__PURE__ */ jsxRuntimeExports$1.jsx("label", { className: "floating-label-box", children: e || "Select Date" })
52576
+ ] }) : /* @__PURE__ */ jsxRuntimeExports$1.jsxs(jsxRuntimeExports$1.Fragment, { children: [
52560
52577
  /* @__PURE__ */ jsxRuntimeExports$1.jsxs("div", { className: "field-box float", children: [
52561
52578
  /* @__PURE__ */ jsxRuntimeExports$1.jsx(
52562
52579
  "input",
52563
52580
  {
52564
52581
  type: "date",
52565
- value: a,
52566
- onChange: p,
52567
- onFocus: () => u(!0),
52568
- onBlur: (x) => g(x)
52582
+ value: o,
52583
+ onChange: S,
52584
+ onFocus: () => y(!0),
52585
+ onBlur: (_) => m(_)
52569
52586
  }
52570
52587
  ),
52571
52588
  /* @__PURE__ */ jsxRuntimeExports$1.jsx("label", { className: "floating-label-box", children: "From" })
@@ -52576,16 +52593,16 @@ const CEInputBox$1 = ({
52576
52593
  "input",
52577
52594
  {
52578
52595
  type: "date",
52579
- value: l,
52580
- onChange: S,
52581
- onFocus: () => u(!0),
52582
- onBlur: (x) => g(x)
52596
+ value: c,
52597
+ onChange: x,
52598
+ onFocus: () => y(!0),
52599
+ onBlur: (_) => m(_)
52583
52600
  }
52584
52601
  ),
52585
52602
  /* @__PURE__ */ jsxRuntimeExports$1.jsx("label", { className: "floating-label-box", children: "To" })
52586
52603
  ] })
52587
- ] }),
52588
- y && /* @__PURE__ */ jsxRuntimeExports$1.jsx("div", { className: "error-text", children: y })
52604
+ ] }) }),
52605
+ d && a !== "single" && /* @__PURE__ */ jsxRuntimeExports$1.jsx("div", { className: "error-text", children: d })
52589
52606
  ] });
52590
52607
  }, FieldsInput = ({
52591
52608
  label: e,
@@ -10,6 +10,7 @@ interface CEDateRangePickerProps {
10
10
  size?: Size;
11
11
  style?: React.CSSProperties;
12
12
  inputGroupStyle?: React.CSSProperties;
13
+ mode?: "range" | "single";
13
14
  }
14
15
  declare const CEDateRangePicker: React.FC<CEDateRangePickerProps>;
15
16
  export default CEDateRangePicker;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cecomponent",
3
3
  "description": "A React component library for building modern UIs for Cleanearth",
4
- "version": "1.0.104",
4
+ "version": "1.0.106",
5
5
  "main": "dist/ce-component-lib.js",
6
6
  "module": "dist/ce-component-lib.mjs",
7
7
  "types": "dist/index.d.ts",