@shoplflow/base 0.31.14 → 0.31.16

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,30 @@ 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, {
4960
+ sizeVar,
4961
+ children,
4962
+ minDate,
4963
+ maxDate,
4964
+ calendarType,
4965
+ locale,
4966
+ fixedHeight = true
4967
+ } = _b, rest = __objRest(_b, [
4968
+ "sizeVar",
4969
+ "children",
4970
+ "minDate",
4971
+ "maxDate",
4972
+ "calendarType",
4973
+ "locale",
4974
+ "fixedHeight"
4975
+ ]);
4961
4976
  const Wrapper2 = sizeVar === "S" ? SmallStyledDayDatepickerWrapper : StyledDayDatepicker;
4962
4977
  if (calendarType.type === "range") {
4963
4978
  return /* @__PURE__ */ jsxRuntime.jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dayDatepickerArea", children: /* @__PURE__ */ jsxRuntime.jsx(
4964
4979
  DatePicker2__default.default,
4965
4980
  __spreadProps(__spreadValues({
4966
4981
  inline: true,
4967
- renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate })),
4982
+ renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
4968
4983
  renderDayContents: (dayOfMonth) => {
4969
4984
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "each-day", children: dayOfMonth });
4970
4985
  }
@@ -4973,7 +4988,9 @@ var DayDatepicker = (_a) => {
4973
4988
  maxDate,
4974
4989
  selectsRange: true,
4975
4990
  selectsMultiple: void 0,
4991
+ locale,
4976
4992
  onChange: calendarType.handleDayRangeChange,
4993
+ fixedHeight,
4977
4994
  children
4978
4995
  })
4979
4996
  ) }) });
@@ -4983,15 +5000,17 @@ var DayDatepicker = (_a) => {
4983
5000
  DatePicker2__default.default,
4984
5001
  __spreadProps(__spreadValues({
4985
5002
  inline: true,
4986
- renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate })),
5003
+ renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
4987
5004
  renderDayContents: (dayOfMonth) => {
4988
5005
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "each-day", children: dayOfMonth });
4989
5006
  }
4990
5007
  }, rest), {
4991
5008
  minDate,
4992
5009
  maxDate,
5010
+ locale,
4993
5011
  selectsMultiple: true,
4994
5012
  onChange: calendarType.handleMutlipleDaysChange,
5013
+ fixedHeight,
4995
5014
  children
4996
5015
  })
4997
5016
  ) }) });
@@ -5000,14 +5019,16 @@ var DayDatepicker = (_a) => {
5000
5019
  DatePicker2__default.default,
5001
5020
  __spreadProps(__spreadValues({
5002
5021
  inline: true,
5003
- renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate })),
5022
+ renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
5004
5023
  renderDayContents: (dayOfMonth) => {
5005
5024
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "each-day", children: dayOfMonth });
5006
5025
  }
5007
5026
  }, rest), {
5008
5027
  minDate,
5009
5028
  maxDate,
5029
+ locale,
5010
5030
  onChange: calendarType.handleDayChange,
5031
+ fixedHeight,
5011
5032
  children
5012
5033
  })
5013
5034
  ) }) });