@shoplflow/base 0.46.17 → 0.46.20
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 +101 -23
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +102 -24
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5038,6 +5038,11 @@ var PaginationWrapper = styled6__default.default.div`
|
|
|
5038
5038
|
transform: translate(-50%, -50%);
|
|
5039
5039
|
width: max-content;
|
|
5040
5040
|
max-width: 100%;
|
|
5041
|
+
pointer-events: none;
|
|
5042
|
+
|
|
5043
|
+
& > * {
|
|
5044
|
+
pointer-events: auto;
|
|
5045
|
+
}
|
|
5041
5046
|
}
|
|
5042
5047
|
& > *:nth-child(3) {
|
|
5043
5048
|
position: relative;
|
|
@@ -5459,7 +5464,7 @@ var SmallStyledDayDatepickerWrapper = styled6__default.default.div`
|
|
|
5459
5464
|
&__day-names {
|
|
5460
5465
|
width: 100%;
|
|
5461
5466
|
height: 18px;
|
|
5462
|
-
margin: 8px 0 0;
|
|
5467
|
+
margin: 8px 0 8px 0;
|
|
5463
5468
|
display: flex;
|
|
5464
5469
|
justify-content: space-between;
|
|
5465
5470
|
align-items: center;
|
|
@@ -5860,8 +5865,7 @@ var Header = styled6__default.default.div`
|
|
|
5860
5865
|
gap: 8px;
|
|
5861
5866
|
`;
|
|
5862
5867
|
var Month = styled6__default.default.p`
|
|
5863
|
-
|
|
5864
|
-
color: ${exports.colorTokens.neutral700};
|
|
5868
|
+
display: flex;
|
|
5865
5869
|
cursor: pointer;
|
|
5866
5870
|
`;
|
|
5867
5871
|
var DatePickerWrapper = styled6__default.default.div`
|
|
@@ -6013,6 +6017,7 @@ var YearStepper = ({
|
|
|
6013
6017
|
changeYear,
|
|
6014
6018
|
minDate,
|
|
6015
6019
|
maxDate,
|
|
6020
|
+
sizeVar = "M",
|
|
6016
6021
|
className
|
|
6017
6022
|
}) => {
|
|
6018
6023
|
const [isOpen, setIsOpen] = utils.useOutsideClick({
|
|
@@ -6029,10 +6034,17 @@ var YearStepper = ({
|
|
|
6029
6034
|
exports.IconButton,
|
|
6030
6035
|
{
|
|
6031
6036
|
styleVar: "GHOST",
|
|
6032
|
-
sizeVar: "S",
|
|
6037
|
+
sizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6033
6038
|
onClick: decreaseYear,
|
|
6034
6039
|
disabled: prevYearButtonDisabled || date.getFullYear() === startYear,
|
|
6035
|
-
|
|
6040
|
+
iconSizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6041
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6042
|
+
exports.Icon,
|
|
6043
|
+
{
|
|
6044
|
+
iconSource: sizeVar === "S" ? ShoplAssets.LeftArrowXsmallIcon : ShoplAssets.LeftArrowIcon,
|
|
6045
|
+
color: prevYearButtonDisabled ? "neutral200" : "neutral700"
|
|
6046
|
+
}
|
|
6047
|
+
)
|
|
6036
6048
|
}
|
|
6037
6049
|
),
|
|
6038
6050
|
/* @__PURE__ */ jsxRuntime.jsxs(exports.Popper, { placement: "bottom", middlewares: [core.flip(), core.shift({ padding: 5 })], children: [
|
|
@@ -6044,7 +6056,7 @@ var YearStepper = ({
|
|
|
6044
6056
|
event.stopPropagation();
|
|
6045
6057
|
setIsOpen((prev) => !prev);
|
|
6046
6058
|
},
|
|
6047
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "title1_700", children: `${date.getFullYear()}` })
|
|
6059
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: sizeVar === "M" ? "title1_700" : "body1_700", children: `${date.getFullYear()}` })
|
|
6048
6060
|
}
|
|
6049
6061
|
) }),
|
|
6050
6062
|
/* @__PURE__ */ jsxRuntime.jsx(exports.Popper.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6066,10 +6078,17 @@ var YearStepper = ({
|
|
|
6066
6078
|
exports.IconButton,
|
|
6067
6079
|
{
|
|
6068
6080
|
styleVar: "GHOST",
|
|
6069
|
-
sizeVar: "S",
|
|
6081
|
+
sizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6070
6082
|
onClick: increaseYear,
|
|
6071
6083
|
disabled: nextYearButtonDisabled || date.getFullYear() === endYear,
|
|
6072
|
-
|
|
6084
|
+
iconSizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6085
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6086
|
+
exports.Icon,
|
|
6087
|
+
{
|
|
6088
|
+
iconSource: sizeVar === "S" ? ShoplAssets.RightArrowXsmallIcon : ShoplAssets.RightArrowIcon,
|
|
6089
|
+
color: nextYearButtonDisabled ? "neutral200" : "neutral700"
|
|
6090
|
+
}
|
|
6091
|
+
)
|
|
6073
6092
|
}
|
|
6074
6093
|
)
|
|
6075
6094
|
] });
|
|
@@ -6697,42 +6716,98 @@ var getEachWeekAreaStyle = (props) => {
|
|
|
6697
6716
|
`;
|
|
6698
6717
|
}
|
|
6699
6718
|
};
|
|
6719
|
+
var getWeekContainerStyleBySizeVar = (sizeVar) => {
|
|
6720
|
+
if (sizeVar === "S") {
|
|
6721
|
+
return react$1.css`
|
|
6722
|
+
width: 280px;
|
|
6723
|
+
max-width: 280px;
|
|
6724
|
+
gap: 8px;
|
|
6725
|
+
padding: 16px;
|
|
6726
|
+
`;
|
|
6727
|
+
}
|
|
6728
|
+
return react$1.css`
|
|
6729
|
+
width: 400px;
|
|
6730
|
+
max-width: 400px;
|
|
6731
|
+
gap: 16px;
|
|
6732
|
+
padding: 16px 24px 24px;
|
|
6733
|
+
`;
|
|
6734
|
+
};
|
|
6735
|
+
var getWeekAreaStyleBySizeVar = (sizeVar) => {
|
|
6736
|
+
if (sizeVar === "S") {
|
|
6737
|
+
return react$1.css`
|
|
6738
|
+
grid-row-gap: 0;
|
|
6739
|
+
background-color: ${exports.colorTokens.neutral100};
|
|
6740
|
+
`;
|
|
6741
|
+
}
|
|
6742
|
+
return react$1.css`
|
|
6743
|
+
grid-row-gap: 8px;
|
|
6744
|
+
background-color: ${exports.colorTokens.neutral0};
|
|
6745
|
+
`;
|
|
6746
|
+
};
|
|
6747
|
+
var getEachWeekAreaStyleBySizeVar = (sizeVar) => {
|
|
6748
|
+
if (sizeVar === "S") {
|
|
6749
|
+
return react$1.css`
|
|
6750
|
+
height: 32px;
|
|
6751
|
+
`;
|
|
6752
|
+
}
|
|
6753
|
+
return react$1.css`
|
|
6754
|
+
height: 48px;
|
|
6755
|
+
`;
|
|
6756
|
+
};
|
|
6757
|
+
var getEachWeekDateStyleBySizeVar = (sizeVar) => {
|
|
6758
|
+
if (sizeVar === "S") {
|
|
6759
|
+
return react$1.css`
|
|
6760
|
+
width: 100%;
|
|
6761
|
+
height: 32px;
|
|
6762
|
+
font-size: 12px;
|
|
6763
|
+
line-height: 16px;
|
|
6764
|
+
border-radius: 0;
|
|
6765
|
+
`;
|
|
6766
|
+
}
|
|
6767
|
+
return react$1.css`
|
|
6768
|
+
width: 48px;
|
|
6769
|
+
height: 48px;
|
|
6770
|
+
font-size: 14px;
|
|
6771
|
+
line-height: 48px;
|
|
6772
|
+
border-radius: 50%;
|
|
6773
|
+
`;
|
|
6774
|
+
};
|
|
6700
6775
|
var WeekContainer = styled6__default.default.div`
|
|
6701
6776
|
display: flex;
|
|
6702
6777
|
flex-direction: column;
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
gap: 16px;
|
|
6706
|
-
padding: 16px 24px 24px;
|
|
6778
|
+
|
|
6779
|
+
${({ sizeVar }) => getWeekContainerStyleBySizeVar(sizeVar)}
|
|
6707
6780
|
`;
|
|
6708
6781
|
var WeekArea = styled6__default.default.div`
|
|
6709
6782
|
width: 100%;
|
|
6710
6783
|
display: grid;
|
|
6711
6784
|
grid-template-columns: repeat(7, 1fr);
|
|
6712
|
-
|
|
6785
|
+
border-radius: 4px;
|
|
6786
|
+
overflow: hidden;
|
|
6787
|
+
|
|
6788
|
+
${({ sizeVar }) => getWeekAreaStyleBySizeVar(sizeVar)}
|
|
6713
6789
|
`;
|
|
6714
6790
|
var EachWeekArea = styled6__default.default.div`
|
|
6715
6791
|
width: 100%;
|
|
6716
|
-
height: 48px;
|
|
6717
6792
|
display: flex;
|
|
6718
6793
|
justify-content: center;
|
|
6719
6794
|
align-items: center;
|
|
6720
6795
|
position: relative;
|
|
6721
6796
|
|
|
6797
|
+
${({ sizeVar }) => getEachWeekAreaStyleBySizeVar(sizeVar)}
|
|
6722
6798
|
${(props) => getEachWeekAreaStyle(props)}
|
|
6723
6799
|
`;
|
|
6724
6800
|
var EachWeekDate = styled6__default.default.div`
|
|
6725
|
-
|
|
6726
|
-
|
|
6801
|
+
display: flex;
|
|
6802
|
+
justify-content: center;
|
|
6803
|
+
align-items: center;
|
|
6727
6804
|
text-align: center;
|
|
6728
|
-
font-size: 14px;
|
|
6729
|
-
line-height: 48px;
|
|
6730
6805
|
padding: 0;
|
|
6731
|
-
border-radius: 50%;
|
|
6732
6806
|
cursor: pointer;
|
|
6733
6807
|
position: absolute;
|
|
6734
6808
|
z-index: 10;
|
|
6735
6809
|
|
|
6810
|
+
${({ sizeVar }) => getEachWeekDateStyleBySizeVar(sizeVar)}
|
|
6736
6811
|
${(props) => getEachDateStyle3(props)}
|
|
6737
6812
|
`;
|
|
6738
6813
|
function getWeeksInYear(year) {
|
|
@@ -6757,7 +6832,8 @@ var WeekDatepicker = ({
|
|
|
6757
6832
|
initEndDate,
|
|
6758
6833
|
minDate,
|
|
6759
6834
|
maxDate,
|
|
6760
|
-
onlySingleWeek
|
|
6835
|
+
onlySingleWeek,
|
|
6836
|
+
sizeVar = "M"
|
|
6761
6837
|
}) => {
|
|
6762
6838
|
const year = initStartDate ? dateFns.getISOWeekYear(initStartDate) : dateFns.getISOWeekYear(/* @__PURE__ */ new Date());
|
|
6763
6839
|
const [currentDate, setCurrentDate] = React.useState(new Date(year, 5, 5));
|
|
@@ -6824,10 +6900,11 @@ var WeekDatepicker = ({
|
|
|
6824
6900
|
});
|
|
6825
6901
|
}
|
|
6826
6902
|
};
|
|
6827
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(WeekContainer, { children: [
|
|
6903
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(WeekContainer, { sizeVar, children: [
|
|
6828
6904
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6829
6905
|
YearStepper_default,
|
|
6830
6906
|
{
|
|
6907
|
+
sizeVar,
|
|
6831
6908
|
date: currentDate,
|
|
6832
6909
|
decreaseYear: () => {
|
|
6833
6910
|
setCurrentDate(new Date(currentDate.getFullYear() - 1, currentDate.getMonth(), currentDate.getDate()));
|
|
@@ -6844,7 +6921,7 @@ var WeekDatepicker = ({
|
|
|
6844
6921
|
}
|
|
6845
6922
|
}
|
|
6846
6923
|
),
|
|
6847
|
-
/* @__PURE__ */ jsxRuntime.jsx(WeekArea, { children: Years.map((each, index) => {
|
|
6924
|
+
/* @__PURE__ */ jsxRuntime.jsx(WeekArea, { sizeVar, children: Years.map((each, index) => {
|
|
6848
6925
|
const currentYear = currentDate.getFullYear();
|
|
6849
6926
|
const currentWeek = Number(each);
|
|
6850
6927
|
const isStart = currentYear === (selectedStartWeekAndYear == null ? void 0 : selectedStartWeekAndYear[1]) && currentWeek === (selectedStartWeekAndYear == null ? void 0 : selectedStartWeekAndYear[0]);
|
|
@@ -6901,6 +6978,7 @@ var WeekDatepicker = ({
|
|
|
6901
6978
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6902
6979
|
EachWeekArea,
|
|
6903
6980
|
{
|
|
6981
|
+
sizeVar,
|
|
6904
6982
|
inRange,
|
|
6905
6983
|
isStart,
|
|
6906
6984
|
isReady,
|
|
@@ -6912,7 +6990,7 @@ var WeekDatepicker = ({
|
|
|
6912
6990
|
}
|
|
6913
6991
|
clickWeek(Number(each), currentDate.getFullYear());
|
|
6914
6992
|
},
|
|
6915
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(EachWeekDate, { inRange, isStart, isEnd, disabled, children: [
|
|
6993
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(EachWeekDate, { sizeVar, inRange, isStart, isEnd, disabled, children: [
|
|
6916
6994
|
"W",
|
|
6917
6995
|
each
|
|
6918
6996
|
] })
|
package/dist/index.d.cts
CHANGED
|
@@ -1581,6 +1581,10 @@ type WeekDatepickerProps = {
|
|
|
1581
1581
|
* 하나의 주만 선택 여부
|
|
1582
1582
|
*/
|
|
1583
1583
|
onlySingleWeek?: boolean;
|
|
1584
|
+
/**
|
|
1585
|
+
* 사이즈 - 기본값: M
|
|
1586
|
+
*/
|
|
1587
|
+
sizeVar?: 'S' | 'M';
|
|
1584
1588
|
};
|
|
1585
1589
|
type WeekDatepickerStyleType = {
|
|
1586
1590
|
inRange: boolean;
|
|
@@ -1589,7 +1593,7 @@ type WeekDatepickerStyleType = {
|
|
|
1589
1593
|
disabled: boolean;
|
|
1590
1594
|
};
|
|
1591
1595
|
|
|
1592
|
-
declare const WeekDatepicker: ({ handleWeekClick, initStartDate, initEndDate, minDate, maxDate, onlySingleWeek, }: WeekDatepickerProps) => react_jsx_runtime.JSX.Element;
|
|
1596
|
+
declare const WeekDatepicker: ({ handleWeekClick, initStartDate, initEndDate, minDate, maxDate, onlySingleWeek, sizeVar, }: WeekDatepickerProps) => react_jsx_runtime.JSX.Element;
|
|
1593
1597
|
|
|
1594
1598
|
type YearSelectProps = {
|
|
1595
1599
|
optionList: Array<{
|
package/dist/index.d.ts
CHANGED
|
@@ -1581,6 +1581,10 @@ type WeekDatepickerProps = {
|
|
|
1581
1581
|
* 하나의 주만 선택 여부
|
|
1582
1582
|
*/
|
|
1583
1583
|
onlySingleWeek?: boolean;
|
|
1584
|
+
/**
|
|
1585
|
+
* 사이즈 - 기본값: M
|
|
1586
|
+
*/
|
|
1587
|
+
sizeVar?: 'S' | 'M';
|
|
1584
1588
|
};
|
|
1585
1589
|
type WeekDatepickerStyleType = {
|
|
1586
1590
|
inRange: boolean;
|
|
@@ -1589,7 +1593,7 @@ type WeekDatepickerStyleType = {
|
|
|
1589
1593
|
disabled: boolean;
|
|
1590
1594
|
};
|
|
1591
1595
|
|
|
1592
|
-
declare const WeekDatepicker: ({ handleWeekClick, initStartDate, initEndDate, minDate, maxDate, onlySingleWeek, }: WeekDatepickerProps) => react_jsx_runtime.JSX.Element;
|
|
1596
|
+
declare const WeekDatepicker: ({ handleWeekClick, initStartDate, initEndDate, minDate, maxDate, onlySingleWeek, sizeVar, }: WeekDatepickerProps) => react_jsx_runtime.JSX.Element;
|
|
1593
1597
|
|
|
1594
1598
|
type YearSelectProps = {
|
|
1595
1599
|
optionList: Array<{
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { FloatingPortal, autoUpdate, offset, autoPlacement } from '@floating-ui/
|
|
|
11
11
|
export { arrow, flip, hide, inline, offset, shift, size } from '@floating-ui/react';
|
|
12
12
|
import { useFloating } from '@floating-ui/react-dom';
|
|
13
13
|
import * as ShoplAssets from '@shoplflow/shopl-assets';
|
|
14
|
-
import { DeleteIcon, DownArrowSolidXsmallIcon, RightArrowSolidXsmallIcon, FirstPageIcon, LeftArrowIcon, RightArrowIcon, EndPageIcon, SearchIcon } from '@shoplflow/shopl-assets';
|
|
14
|
+
import { DeleteIcon, DownArrowSolidXsmallIcon, RightArrowSolidXsmallIcon, FirstPageIcon, LeftArrowIcon, RightArrowIcon, EndPageIcon, SearchIcon, LeftArrowXsmallIcon, RightArrowXsmallIcon } from '@shoplflow/shopl-assets';
|
|
15
15
|
import { shift, flip, offset as offset$1 } from '@floating-ui/core';
|
|
16
16
|
import * as HadaAssets from '@shoplflow/hada-assets';
|
|
17
17
|
import DatePicker2 from 'react-datepicker';
|
|
@@ -5011,6 +5011,11 @@ var PaginationWrapper = styled6.div`
|
|
|
5011
5011
|
transform: translate(-50%, -50%);
|
|
5012
5012
|
width: max-content;
|
|
5013
5013
|
max-width: 100%;
|
|
5014
|
+
pointer-events: none;
|
|
5015
|
+
|
|
5016
|
+
& > * {
|
|
5017
|
+
pointer-events: auto;
|
|
5018
|
+
}
|
|
5014
5019
|
}
|
|
5015
5020
|
& > *:nth-child(3) {
|
|
5016
5021
|
position: relative;
|
|
@@ -5432,7 +5437,7 @@ var SmallStyledDayDatepickerWrapper = styled6.div`
|
|
|
5432
5437
|
&__day-names {
|
|
5433
5438
|
width: 100%;
|
|
5434
5439
|
height: 18px;
|
|
5435
|
-
margin: 8px 0 0;
|
|
5440
|
+
margin: 8px 0 8px 0;
|
|
5436
5441
|
display: flex;
|
|
5437
5442
|
justify-content: space-between;
|
|
5438
5443
|
align-items: center;
|
|
@@ -5833,8 +5838,7 @@ var Header = styled6.div`
|
|
|
5833
5838
|
gap: 8px;
|
|
5834
5839
|
`;
|
|
5835
5840
|
var Month = styled6.p`
|
|
5836
|
-
|
|
5837
|
-
color: ${colorTokens.neutral700};
|
|
5841
|
+
display: flex;
|
|
5838
5842
|
cursor: pointer;
|
|
5839
5843
|
`;
|
|
5840
5844
|
var DatePickerWrapper = styled6.div`
|
|
@@ -5986,6 +5990,7 @@ var YearStepper = ({
|
|
|
5986
5990
|
changeYear,
|
|
5987
5991
|
minDate,
|
|
5988
5992
|
maxDate,
|
|
5993
|
+
sizeVar = "M",
|
|
5989
5994
|
className
|
|
5990
5995
|
}) => {
|
|
5991
5996
|
const [isOpen, setIsOpen] = useOutsideClick({
|
|
@@ -6002,10 +6007,17 @@ var YearStepper = ({
|
|
|
6002
6007
|
IconButton_default,
|
|
6003
6008
|
{
|
|
6004
6009
|
styleVar: "GHOST",
|
|
6005
|
-
sizeVar: "S",
|
|
6010
|
+
sizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6006
6011
|
onClick: decreaseYear,
|
|
6007
6012
|
disabled: prevYearButtonDisabled || date.getFullYear() === startYear,
|
|
6008
|
-
|
|
6013
|
+
iconSizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6014
|
+
children: /* @__PURE__ */ jsx(
|
|
6015
|
+
Icon_default,
|
|
6016
|
+
{
|
|
6017
|
+
iconSource: sizeVar === "S" ? LeftArrowXsmallIcon : LeftArrowIcon,
|
|
6018
|
+
color: prevYearButtonDisabled ? "neutral200" : "neutral700"
|
|
6019
|
+
}
|
|
6020
|
+
)
|
|
6009
6021
|
}
|
|
6010
6022
|
),
|
|
6011
6023
|
/* @__PURE__ */ jsxs(Popper_default, { placement: "bottom", middlewares: [flip(), shift({ padding: 5 })], children: [
|
|
@@ -6017,7 +6029,7 @@ var YearStepper = ({
|
|
|
6017
6029
|
event.stopPropagation();
|
|
6018
6030
|
setIsOpen((prev) => !prev);
|
|
6019
6031
|
},
|
|
6020
|
-
children: /* @__PURE__ */ jsx(Text_default, { typography: "title1_700", children: `${date.getFullYear()}` })
|
|
6032
|
+
children: /* @__PURE__ */ jsx(Text_default, { typography: sizeVar === "M" ? "title1_700" : "body1_700", children: `${date.getFullYear()}` })
|
|
6021
6033
|
}
|
|
6022
6034
|
) }),
|
|
6023
6035
|
/* @__PURE__ */ jsx(Popper_default.Portal, { children: /* @__PURE__ */ jsx(
|
|
@@ -6039,10 +6051,17 @@ var YearStepper = ({
|
|
|
6039
6051
|
IconButton_default,
|
|
6040
6052
|
{
|
|
6041
6053
|
styleVar: "GHOST",
|
|
6042
|
-
sizeVar: "S",
|
|
6054
|
+
sizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6043
6055
|
onClick: increaseYear,
|
|
6044
6056
|
disabled: nextYearButtonDisabled || date.getFullYear() === endYear,
|
|
6045
|
-
|
|
6057
|
+
iconSizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6058
|
+
children: /* @__PURE__ */ jsx(
|
|
6059
|
+
Icon_default,
|
|
6060
|
+
{
|
|
6061
|
+
iconSource: sizeVar === "S" ? RightArrowXsmallIcon : RightArrowIcon,
|
|
6062
|
+
color: nextYearButtonDisabled ? "neutral200" : "neutral700"
|
|
6063
|
+
}
|
|
6064
|
+
)
|
|
6046
6065
|
}
|
|
6047
6066
|
)
|
|
6048
6067
|
] });
|
|
@@ -6670,42 +6689,98 @@ var getEachWeekAreaStyle = (props) => {
|
|
|
6670
6689
|
`;
|
|
6671
6690
|
}
|
|
6672
6691
|
};
|
|
6692
|
+
var getWeekContainerStyleBySizeVar = (sizeVar) => {
|
|
6693
|
+
if (sizeVar === "S") {
|
|
6694
|
+
return css`
|
|
6695
|
+
width: 280px;
|
|
6696
|
+
max-width: 280px;
|
|
6697
|
+
gap: 8px;
|
|
6698
|
+
padding: 16px;
|
|
6699
|
+
`;
|
|
6700
|
+
}
|
|
6701
|
+
return css`
|
|
6702
|
+
width: 400px;
|
|
6703
|
+
max-width: 400px;
|
|
6704
|
+
gap: 16px;
|
|
6705
|
+
padding: 16px 24px 24px;
|
|
6706
|
+
`;
|
|
6707
|
+
};
|
|
6708
|
+
var getWeekAreaStyleBySizeVar = (sizeVar) => {
|
|
6709
|
+
if (sizeVar === "S") {
|
|
6710
|
+
return css`
|
|
6711
|
+
grid-row-gap: 0;
|
|
6712
|
+
background-color: ${colorTokens.neutral100};
|
|
6713
|
+
`;
|
|
6714
|
+
}
|
|
6715
|
+
return css`
|
|
6716
|
+
grid-row-gap: 8px;
|
|
6717
|
+
background-color: ${colorTokens.neutral0};
|
|
6718
|
+
`;
|
|
6719
|
+
};
|
|
6720
|
+
var getEachWeekAreaStyleBySizeVar = (sizeVar) => {
|
|
6721
|
+
if (sizeVar === "S") {
|
|
6722
|
+
return css`
|
|
6723
|
+
height: 32px;
|
|
6724
|
+
`;
|
|
6725
|
+
}
|
|
6726
|
+
return css`
|
|
6727
|
+
height: 48px;
|
|
6728
|
+
`;
|
|
6729
|
+
};
|
|
6730
|
+
var getEachWeekDateStyleBySizeVar = (sizeVar) => {
|
|
6731
|
+
if (sizeVar === "S") {
|
|
6732
|
+
return css`
|
|
6733
|
+
width: 100%;
|
|
6734
|
+
height: 32px;
|
|
6735
|
+
font-size: 12px;
|
|
6736
|
+
line-height: 16px;
|
|
6737
|
+
border-radius: 0;
|
|
6738
|
+
`;
|
|
6739
|
+
}
|
|
6740
|
+
return css`
|
|
6741
|
+
width: 48px;
|
|
6742
|
+
height: 48px;
|
|
6743
|
+
font-size: 14px;
|
|
6744
|
+
line-height: 48px;
|
|
6745
|
+
border-radius: 50%;
|
|
6746
|
+
`;
|
|
6747
|
+
};
|
|
6673
6748
|
var WeekContainer = styled6.div`
|
|
6674
6749
|
display: flex;
|
|
6675
6750
|
flex-direction: column;
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
gap: 16px;
|
|
6679
|
-
padding: 16px 24px 24px;
|
|
6751
|
+
|
|
6752
|
+
${({ sizeVar }) => getWeekContainerStyleBySizeVar(sizeVar)}
|
|
6680
6753
|
`;
|
|
6681
6754
|
var WeekArea = styled6.div`
|
|
6682
6755
|
width: 100%;
|
|
6683
6756
|
display: grid;
|
|
6684
6757
|
grid-template-columns: repeat(7, 1fr);
|
|
6685
|
-
|
|
6758
|
+
border-radius: 4px;
|
|
6759
|
+
overflow: hidden;
|
|
6760
|
+
|
|
6761
|
+
${({ sizeVar }) => getWeekAreaStyleBySizeVar(sizeVar)}
|
|
6686
6762
|
`;
|
|
6687
6763
|
var EachWeekArea = styled6.div`
|
|
6688
6764
|
width: 100%;
|
|
6689
|
-
height: 48px;
|
|
6690
6765
|
display: flex;
|
|
6691
6766
|
justify-content: center;
|
|
6692
6767
|
align-items: center;
|
|
6693
6768
|
position: relative;
|
|
6694
6769
|
|
|
6770
|
+
${({ sizeVar }) => getEachWeekAreaStyleBySizeVar(sizeVar)}
|
|
6695
6771
|
${(props) => getEachWeekAreaStyle(props)}
|
|
6696
6772
|
`;
|
|
6697
6773
|
var EachWeekDate = styled6.div`
|
|
6698
|
-
|
|
6699
|
-
|
|
6774
|
+
display: flex;
|
|
6775
|
+
justify-content: center;
|
|
6776
|
+
align-items: center;
|
|
6700
6777
|
text-align: center;
|
|
6701
|
-
font-size: 14px;
|
|
6702
|
-
line-height: 48px;
|
|
6703
6778
|
padding: 0;
|
|
6704
|
-
border-radius: 50%;
|
|
6705
6779
|
cursor: pointer;
|
|
6706
6780
|
position: absolute;
|
|
6707
6781
|
z-index: 10;
|
|
6708
6782
|
|
|
6783
|
+
${({ sizeVar }) => getEachWeekDateStyleBySizeVar(sizeVar)}
|
|
6709
6784
|
${(props) => getEachDateStyle3(props)}
|
|
6710
6785
|
`;
|
|
6711
6786
|
function getWeeksInYear(year) {
|
|
@@ -6730,7 +6805,8 @@ var WeekDatepicker = ({
|
|
|
6730
6805
|
initEndDate,
|
|
6731
6806
|
minDate,
|
|
6732
6807
|
maxDate,
|
|
6733
|
-
onlySingleWeek
|
|
6808
|
+
onlySingleWeek,
|
|
6809
|
+
sizeVar = "M"
|
|
6734
6810
|
}) => {
|
|
6735
6811
|
const year = initStartDate ? getISOWeekYear(initStartDate) : getISOWeekYear(/* @__PURE__ */ new Date());
|
|
6736
6812
|
const [currentDate, setCurrentDate] = useState(new Date(year, 5, 5));
|
|
@@ -6797,10 +6873,11 @@ var WeekDatepicker = ({
|
|
|
6797
6873
|
});
|
|
6798
6874
|
}
|
|
6799
6875
|
};
|
|
6800
|
-
return /* @__PURE__ */ jsxs(WeekContainer, { children: [
|
|
6876
|
+
return /* @__PURE__ */ jsxs(WeekContainer, { sizeVar, children: [
|
|
6801
6877
|
/* @__PURE__ */ jsx(
|
|
6802
6878
|
YearStepper_default,
|
|
6803
6879
|
{
|
|
6880
|
+
sizeVar,
|
|
6804
6881
|
date: currentDate,
|
|
6805
6882
|
decreaseYear: () => {
|
|
6806
6883
|
setCurrentDate(new Date(currentDate.getFullYear() - 1, currentDate.getMonth(), currentDate.getDate()));
|
|
@@ -6817,7 +6894,7 @@ var WeekDatepicker = ({
|
|
|
6817
6894
|
}
|
|
6818
6895
|
}
|
|
6819
6896
|
),
|
|
6820
|
-
/* @__PURE__ */ jsx(WeekArea, { children: Years.map((each, index) => {
|
|
6897
|
+
/* @__PURE__ */ jsx(WeekArea, { sizeVar, children: Years.map((each, index) => {
|
|
6821
6898
|
const currentYear = currentDate.getFullYear();
|
|
6822
6899
|
const currentWeek = Number(each);
|
|
6823
6900
|
const isStart = currentYear === (selectedStartWeekAndYear == null ? void 0 : selectedStartWeekAndYear[1]) && currentWeek === (selectedStartWeekAndYear == null ? void 0 : selectedStartWeekAndYear[0]);
|
|
@@ -6874,6 +6951,7 @@ var WeekDatepicker = ({
|
|
|
6874
6951
|
return /* @__PURE__ */ jsx(
|
|
6875
6952
|
EachWeekArea,
|
|
6876
6953
|
{
|
|
6954
|
+
sizeVar,
|
|
6877
6955
|
inRange,
|
|
6878
6956
|
isStart,
|
|
6879
6957
|
isReady,
|
|
@@ -6885,7 +6963,7 @@ var WeekDatepicker = ({
|
|
|
6885
6963
|
}
|
|
6886
6964
|
clickWeek(Number(each), currentDate.getFullYear());
|
|
6887
6965
|
},
|
|
6888
|
-
children: /* @__PURE__ */ jsxs(EachWeekDate, { inRange, isStart, isEnd, disabled, children: [
|
|
6966
|
+
children: /* @__PURE__ */ jsxs(EachWeekDate, { sizeVar, inRange, isStart, isEnd, disabled, children: [
|
|
6889
6967
|
"W",
|
|
6890
6968
|
each
|
|
6891
6969
|
] })
|