@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.d.cts CHANGED
@@ -1295,7 +1295,7 @@ declare type DayDatepickerHeaderCustomProps = ReactDatePickerCustomHeaderProps &
1295
1295
  locale?: Locale;
1296
1296
  };
1297
1297
 
1298
- declare const DayDatepicker: ({ sizeVar, children, minDate, maxDate, calendarType, ...rest }: DayDatepickerProps) => react_jsx_runtime.JSX.Element;
1298
+ declare const DayDatepicker: ({ sizeVar, children, minDate, maxDate, calendarType, locale, ...rest }: DayDatepickerProps) => react_jsx_runtime.JSX.Element;
1299
1299
 
1300
1300
  declare type MonthClickDateInfo = {
1301
1301
  startDate?: Date;
package/dist/index.d.ts CHANGED
@@ -1295,7 +1295,7 @@ declare type DayDatepickerHeaderCustomProps = ReactDatePickerCustomHeaderProps &
1295
1295
  locale?: Locale;
1296
1296
  };
1297
1297
 
1298
- declare const DayDatepicker: ({ sizeVar, children, minDate, maxDate, calendarType, ...rest }: DayDatepickerProps) => react_jsx_runtime.JSX.Element;
1298
+ declare const DayDatepicker: ({ sizeVar, children, minDate, maxDate, calendarType, locale, ...rest }: DayDatepickerProps) => react_jsx_runtime.JSX.Element;
1299
1299
 
1300
1300
  declare type MonthClickDateInfo = {
1301
1301
  startDate?: Date;
package/dist/index.js CHANGED
@@ -4751,7 +4751,6 @@ var OptionListItem = styled6.li`
4751
4751
  }
4752
4752
  `;
4753
4753
  var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeight, onClick }) => {
4754
- var _a, _b;
4755
4754
  const optionListRef = useRef([]);
4756
4755
  const parentRef = useRef(null);
4757
4756
  const [isAllRefMounted, setIsAllRefMounted] = useState(false);
@@ -4761,14 +4760,14 @@ var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeig
4761
4760
  useEffect(() => {
4762
4761
  setIsOpened(isOpened);
4763
4762
  }, []);
4764
- const height = Math.min((_b = (_a = parentRef.current) == null ? void 0 : _a.scrollHeight) != null ? _b : 0, Number(parseInt(maxHeight || "0")));
4763
+ const height = Math.min(optionList.length * 32, Number(parseInt(maxHeight || "0")));
4765
4764
  useEffect(() => {
4766
- var _a2, _b2, _c, _d, _e, _f;
4765
+ var _a, _b, _c, _d, _e, _f;
4767
4766
  if (!isAllRefMounted || !activeValue || !maxHeight) {
4768
4767
  return;
4769
4768
  }
4770
4769
  const selectedOptionIndex = optionList.findIndex((option) => (option == null ? void 0 : option.value) === activeValue);
4771
- const heightPerOption = (_b2 = (_a2 = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _a2.offsetHeight) != null ? _b2 : 0;
4770
+ const heightPerOption = (_b = (_a = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _a.offsetHeight) != null ? _b : 0;
4772
4771
  const parentHeight = (_e = (_d = (_c = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _c.closest("ul")) == null ? void 0 : _d.clientHeight) != null ? _e : 0;
4773
4772
  if (heightPerOption * (selectedOptionIndex + 1) >= parentHeight) {
4774
4773
  (_f = parentRef.current) == null ? void 0 : _f.scrollTo({ top: heightPerOption * selectedOptionIndex });
@@ -4930,14 +4929,14 @@ var MonthStepper = ({
4930
4929
  };
4931
4930
  var MonthStepper_default = MonthStepper;
4932
4931
  var DayDatepicker = (_a) => {
4933
- var _b = _a, { sizeVar, children, minDate, maxDate, calendarType } = _b, rest = __objRest(_b, ["sizeVar", "children", "minDate", "maxDate", "calendarType"]);
4932
+ var _b = _a, { sizeVar, children, minDate, maxDate, calendarType, locale } = _b, rest = __objRest(_b, ["sizeVar", "children", "minDate", "maxDate", "calendarType", "locale"]);
4934
4933
  const Wrapper2 = sizeVar === "S" ? SmallStyledDayDatepickerWrapper : StyledDayDatepicker;
4935
4934
  if (calendarType.type === "range") {
4936
4935
  return /* @__PURE__ */ jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsx("div", { className: "dayDatepickerArea", children: /* @__PURE__ */ jsx(
4937
4936
  DatePicker2,
4938
4937
  __spreadProps(__spreadValues({
4939
4938
  inline: true,
4940
- renderCustomHeader: (props) => /* @__PURE__ */ jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate })),
4939
+ renderCustomHeader: (props) => /* @__PURE__ */ jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
4941
4940
  renderDayContents: (dayOfMonth) => {
4942
4941
  return /* @__PURE__ */ jsx("div", { className: "each-day", children: dayOfMonth });
4943
4942
  }
@@ -4946,6 +4945,7 @@ var DayDatepicker = (_a) => {
4946
4945
  maxDate,
4947
4946
  selectsRange: true,
4948
4947
  selectsMultiple: void 0,
4948
+ locale,
4949
4949
  onChange: calendarType.handleDayRangeChange,
4950
4950
  children
4951
4951
  })
@@ -4956,13 +4956,14 @@ var DayDatepicker = (_a) => {
4956
4956
  DatePicker2,
4957
4957
  __spreadProps(__spreadValues({
4958
4958
  inline: true,
4959
- renderCustomHeader: (props) => /* @__PURE__ */ jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate })),
4959
+ renderCustomHeader: (props) => /* @__PURE__ */ jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
4960
4960
  renderDayContents: (dayOfMonth) => {
4961
4961
  return /* @__PURE__ */ jsx("div", { className: "each-day", children: dayOfMonth });
4962
4962
  }
4963
4963
  }, rest), {
4964
4964
  minDate,
4965
4965
  maxDate,
4966
+ locale,
4966
4967
  selectsMultiple: true,
4967
4968
  onChange: calendarType.handleMutlipleDaysChange,
4968
4969
  children
@@ -4973,13 +4974,14 @@ var DayDatepicker = (_a) => {
4973
4974
  DatePicker2,
4974
4975
  __spreadProps(__spreadValues({
4975
4976
  inline: true,
4976
- renderCustomHeader: (props) => /* @__PURE__ */ jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate })),
4977
+ renderCustomHeader: (props) => /* @__PURE__ */ jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
4977
4978
  renderDayContents: (dayOfMonth) => {
4978
4979
  return /* @__PURE__ */ jsx("div", { className: "each-day", children: dayOfMonth });
4979
4980
  }
4980
4981
  }, rest), {
4981
4982
  minDate,
4982
4983
  maxDate,
4984
+ locale,
4983
4985
  onChange: calendarType.handleDayChange,
4984
4986
  children
4985
4987
  })