@shoplflow/base 0.31.16 → 0.31.18
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 +16 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +16 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5068,7 +5068,7 @@ var getEachDateStyle = (props) => {
|
|
|
5068
5068
|
};
|
|
5069
5069
|
var getEachMonthAreaStyle = (props) => {
|
|
5070
5070
|
const { inRange, isStart, isEnd, isReady, disabled } = props;
|
|
5071
|
-
if (isStart && isReady) {
|
|
5071
|
+
if (isStart && isReady && !isEnd) {
|
|
5072
5072
|
return react$1.css`
|
|
5073
5073
|
&::after {
|
|
5074
5074
|
content: '';
|
|
@@ -5154,10 +5154,10 @@ var MonthDatepicker = ({
|
|
|
5154
5154
|
}) => {
|
|
5155
5155
|
const [currentDate, setCurrentDate] = React3.useState(initStartDate || /* @__PURE__ */ new Date());
|
|
5156
5156
|
const [selectedStartMonthAndYear, setSelectedStartMonthAndYear] = React3.useState(
|
|
5157
|
-
initStartDate ? [initStartDate.getMonth(), initStartDate.getFullYear()] : null
|
|
5157
|
+
initStartDate ? [initStartDate.getMonth() + 1, initStartDate.getFullYear()] : null
|
|
5158
5158
|
);
|
|
5159
5159
|
const [selectedEndMonthAndYear, setSelectedEndMonthAndYear] = React3.useState(
|
|
5160
|
-
initEndDate ? [initEndDate.getMonth(), initEndDate.getFullYear()] : null
|
|
5160
|
+
initEndDate ? [initEndDate.getMonth() + 1, initEndDate.getFullYear()] : null
|
|
5161
5161
|
);
|
|
5162
5162
|
const Months = React3.useMemo(() => {
|
|
5163
5163
|
return Array.from({ length: 12 }).map((_, index) => index + 1);
|
|
@@ -5357,6 +5357,7 @@ var EachYearArea = styled6__default.default.div`
|
|
|
5357
5357
|
justify-content: center;
|
|
5358
5358
|
align-items: center;
|
|
5359
5359
|
position: relative;
|
|
5360
|
+
user-select: none;
|
|
5360
5361
|
|
|
5361
5362
|
${(props) => getEachYearAreaStyle(props)}
|
|
5362
5363
|
`;
|
|
@@ -5372,13 +5373,16 @@ var EachYearDate = styled6__default.default.div`
|
|
|
5372
5373
|
position: absolute;
|
|
5373
5374
|
z-index: 10;
|
|
5374
5375
|
|
|
5376
|
+
user-select: none;
|
|
5377
|
+
|
|
5375
5378
|
${(props) => getEachDateStyle2(props)}
|
|
5376
5379
|
`;
|
|
5377
5380
|
var AnnualDatepicker = ({
|
|
5378
5381
|
startYear = 2e3,
|
|
5379
5382
|
endYear = 2100,
|
|
5380
5383
|
currentYear,
|
|
5381
|
-
handleYearClick
|
|
5384
|
+
handleYearClick,
|
|
5385
|
+
disabledYears
|
|
5382
5386
|
}) => {
|
|
5383
5387
|
const [selectedYear, setSelectedYear] = React3.useState(currentYear || (/* @__PURE__ */ new Date()).getFullYear());
|
|
5384
5388
|
const Years = Array.from({ length: endYear - startYear + 1 }).map((_, index) => startYear + index);
|
|
@@ -5387,14 +5391,20 @@ var AnnualDatepicker = ({
|
|
|
5387
5391
|
handleYearClick(year);
|
|
5388
5392
|
};
|
|
5389
5393
|
return /* @__PURE__ */ jsxRuntime.jsx(YearContainer, { "data-shoplflow": "AnnualDatepicker", children: /* @__PURE__ */ jsxRuntime.jsx(YearArea, { children: Years.map((year) => {
|
|
5394
|
+
const disabled = disabledYears == null ? void 0 : disabledYears.includes(year);
|
|
5390
5395
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5391
5396
|
EachYearArea,
|
|
5392
5397
|
{
|
|
5398
|
+
disabled,
|
|
5393
5399
|
isSelected: selectedYear === year,
|
|
5400
|
+
"aria-disabled": disabled,
|
|
5394
5401
|
onClick: () => {
|
|
5402
|
+
if (disabled) {
|
|
5403
|
+
return;
|
|
5404
|
+
}
|
|
5395
5405
|
clickYear(year);
|
|
5396
5406
|
},
|
|
5397
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(EachYearDate, { isSelected: selectedYear === year, children: year })
|
|
5407
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(EachYearDate, { "aria-disabled": disabled, disabled, isSelected: selectedYear === year, children: year })
|
|
5398
5408
|
},
|
|
5399
5409
|
year
|
|
5400
5410
|
);
|
|
@@ -5429,7 +5439,7 @@ var getEachDateStyle3 = (props) => {
|
|
|
5429
5439
|
};
|
|
5430
5440
|
var getEachWeekAreaStyle = (props) => {
|
|
5431
5441
|
const { inRange, isStart, isEnd, isReady, disabled } = props;
|
|
5432
|
-
if (isStart && isReady) {
|
|
5442
|
+
if (isStart && isReady && !isEnd) {
|
|
5433
5443
|
return react$1.css`
|
|
5434
5444
|
&::after {
|
|
5435
5445
|
content: '';
|