@shoplflow/base 0.31.14 → 0.31.15

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.cjs CHANGED
@@ -4778,7 +4778,6 @@ var OptionListItem = styled6__default.default.li`
4778
4778
  }
4779
4779
  `;
4780
4780
  var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeight, onClick }) => {
4781
- var _a, _b;
4782
4781
  const optionListRef = React3.useRef([]);
4783
4782
  const parentRef = React3.useRef(null);
4784
4783
  const [isAllRefMounted, setIsAllRefMounted] = React3.useState(false);
@@ -4788,14 +4787,14 @@ var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeig
4788
4787
  React3.useEffect(() => {
4789
4788
  setIsOpened(isOpened);
4790
4789
  }, []);
4791
- const height = Math.min((_b = (_a = parentRef.current) == null ? void 0 : _a.scrollHeight) != null ? _b : 0, Number(parseInt(maxHeight || "0")));
4790
+ const height = Math.min(optionList.length * 32, Number(parseInt(maxHeight || "0")));
4792
4791
  React3.useEffect(() => {
4793
- var _a2, _b2, _c, _d, _e, _f;
4792
+ var _a, _b, _c, _d, _e, _f;
4794
4793
  if (!isAllRefMounted || !activeValue || !maxHeight) {
4795
4794
  return;
4796
4795
  }
4797
4796
  const selectedOptionIndex = optionList.findIndex((option) => (option == null ? void 0 : option.value) === activeValue);
4798
- const heightPerOption = (_b2 = (_a2 = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _a2.offsetHeight) != null ? _b2 : 0;
4797
+ const heightPerOption = (_b = (_a = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _a.offsetHeight) != null ? _b : 0;
4799
4798
  const parentHeight = (_e = (_d = (_c = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _c.closest("ul")) == null ? void 0 : _d.clientHeight) != null ? _e : 0;
4800
4799
  if (heightPerOption * (selectedOptionIndex + 1) >= parentHeight) {
4801
4800
  (_f = parentRef.current) == null ? void 0 : _f.scrollTo({ top: heightPerOption * selectedOptionIndex });
@@ -4957,14 +4956,14 @@ var MonthStepper = ({
4957
4956
  };
4958
4957
  var MonthStepper_default = MonthStepper;
4959
4958
  var DayDatepicker = (_a) => {
4960
- var _b = _a, { sizeVar, children, minDate, maxDate, calendarType } = _b, rest = __objRest(_b, ["sizeVar", "children", "minDate", "maxDate", "calendarType"]);
4959
+ var _b = _a, { sizeVar, children, minDate, maxDate, calendarType, locale } = _b, rest = __objRest(_b, ["sizeVar", "children", "minDate", "maxDate", "calendarType", "locale"]);
4961
4960
  const Wrapper2 = sizeVar === "S" ? SmallStyledDayDatepickerWrapper : StyledDayDatepicker;
4962
4961
  if (calendarType.type === "range") {
4963
4962
  return /* @__PURE__ */ jsxRuntime.jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dayDatepickerArea", children: /* @__PURE__ */ jsxRuntime.jsx(
4964
4963
  DatePicker2__default.default,
4965
4964
  __spreadProps(__spreadValues({
4966
4965
  inline: true,
4967
- renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate })),
4966
+ renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
4968
4967
  renderDayContents: (dayOfMonth) => {
4969
4968
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "each-day", children: dayOfMonth });
4970
4969
  }
@@ -4973,6 +4972,7 @@ var DayDatepicker = (_a) => {
4973
4972
  maxDate,
4974
4973
  selectsRange: true,
4975
4974
  selectsMultiple: void 0,
4975
+ locale,
4976
4976
  onChange: calendarType.handleDayRangeChange,
4977
4977
  children
4978
4978
  })
@@ -4983,13 +4983,14 @@ var DayDatepicker = (_a) => {
4983
4983
  DatePicker2__default.default,
4984
4984
  __spreadProps(__spreadValues({
4985
4985
  inline: true,
4986
- renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate })),
4986
+ renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
4987
4987
  renderDayContents: (dayOfMonth) => {
4988
4988
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "each-day", children: dayOfMonth });
4989
4989
  }
4990
4990
  }, rest), {
4991
4991
  minDate,
4992
4992
  maxDate,
4993
+ locale,
4993
4994
  selectsMultiple: true,
4994
4995
  onChange: calendarType.handleMutlipleDaysChange,
4995
4996
  children
@@ -5000,13 +5001,14 @@ var DayDatepicker = (_a) => {
5000
5001
  DatePicker2__default.default,
5001
5002
  __spreadProps(__spreadValues({
5002
5003
  inline: true,
5003
- renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate })),
5004
+ renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
5004
5005
  renderDayContents: (dayOfMonth) => {
5005
5006
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "each-day", children: dayOfMonth });
5006
5007
  }
5007
5008
  }, rest), {
5008
5009
  minDate,
5009
5010
  maxDate,
5011
+ locale,
5010
5012
  onChange: calendarType.handleDayChange,
5011
5013
  children
5012
5014
  })