@edu-tosel/design 1.0.154 → 1.0.156
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/asset/SVG.d.ts +11 -9
- package/asset/SVG.js +2 -0
- package/asset/SVG.tsx +4 -2
- package/asset/svg/Eye.d.ts +12 -0
- package/asset/svg/Eye.js +13 -0
- package/asset/svg/Eye.tsx +48 -0
- package/asset/svg/Icon.d.ts +7 -6
- package/asset/svg/Icon.js +10 -10
- package/asset/svg/Icon.tsx +17 -16
- package/card/design/Card.design.js +4 -2
- package/card/design/RollCard.design.js +1 -1
- package/card/template/InfoCard/Finance.js +1 -1
- package/card/template/InfoCard/Student.d.ts +2 -2
- package/card/template/InfoCard/Student.js +6 -11
- package/card/template/NavCard.js +1 -1
- package/card/template/ProgressCard/Large.js +1 -1
- package/interface/Property.d.ts +1 -1
- package/layout/design/Row.design/index.js +1 -0
- package/layout/index.d.ts +1 -0
- package/layout/index.js +1 -0
- package/layout/template/Archive/Header.js +66 -41
- package/layout/template/BbsLayout.js +3 -1
- package/layout/template/Event/One.js +39 -1
- package/layout/template/MonthlyProgressReport/Report.d.ts +36 -0
- package/layout/template/MonthlyProgressReport/Report.js +80 -0
- package/layout/template/MonthlyProgressReport/index.d.ts +5 -0
- package/layout/template/MonthlyProgressReport/index.js +5 -0
- package/layout/template/home/layout/Header.js +72 -15
- package/layout/template/home/layout/Navigation.d.ts +4 -2
- package/layout/template/home/layout/Navigation.js +56 -20
- package/package.json +2 -1
- package/tailwind.config.ts +20 -0
- package/util/compareDates.d.ts +4 -0
- package/util/compareDates.js +32 -0
- package/util/convertDateToString.d.ts +1 -0
- package/util/convertDateToString.js +6 -0
- package/util/index.d.ts +2 -0
- package/util/index.js +2 -0
- package/version.txt +1 -1
- package/widget/template/Input/Form.js +10 -2
- package/widget/template/Select/Select.js +30 -17
|
@@ -18,13 +18,14 @@ const heightSize = {
|
|
|
18
18
|
export default function Select({ state, selectOptions: selectOptionsInput, placeholder, option, }) {
|
|
19
19
|
const selectOptions = selectOptionsInput?.map(toSelectOption);
|
|
20
20
|
const id = useId();
|
|
21
|
-
const {
|
|
21
|
+
const { flag } = useActionStore();
|
|
22
22
|
const [value, setValue] = state;
|
|
23
23
|
const [text, setText] = useState("");
|
|
24
24
|
const [search, setSearch] = useState("");
|
|
25
25
|
const [isOpen, setIsOpen] = useState(false);
|
|
26
26
|
const [isHover, setIsHover] = useState(false);
|
|
27
27
|
const [index, setIndex] = useState();
|
|
28
|
+
const [uniqueKey] = useState(Math.floor(Math.random() * 1000000));
|
|
28
29
|
useFlag({ state: [false, setIsOpen], safe: "overlay" });
|
|
29
30
|
// scrollIntoViews
|
|
30
31
|
const listRef = useRef(null);
|
|
@@ -36,33 +37,40 @@ export default function Select({ state, selectOptions: selectOptionsInput, place
|
|
|
36
37
|
}, [index]);
|
|
37
38
|
const isLong = selectOptions && selectOptions.length >= 4;
|
|
38
39
|
const container = {
|
|
39
|
-
positions: "
|
|
40
|
-
displays: "flex flex-col",
|
|
40
|
+
positions: "",
|
|
41
|
+
displays: "flex flex-col gap-2",
|
|
41
42
|
};
|
|
42
43
|
const button = {
|
|
43
44
|
displays: "flex items-center",
|
|
44
45
|
sizes: `${widthSize[option?.width ?? "md"]} ${heightSize[option?.height ?? "sm"]}`,
|
|
45
46
|
styles: "px-1 rounded-md outline-none duration-100 text-gray-400",
|
|
46
|
-
shadow:
|
|
47
|
+
shadow: "hover:shadow-green",
|
|
48
|
+
totalaction: isOpen ? "shadow-main" : "shadow-main-small",
|
|
49
|
+
animations: "duration-300",
|
|
47
50
|
};
|
|
48
51
|
const input = {
|
|
49
|
-
positions: "
|
|
52
|
+
positions: "z-30",
|
|
50
53
|
layouts: cn(button),
|
|
51
|
-
styles: "outline-
|
|
54
|
+
styles: "focus:outline-1 outline-0 outline-green-dark text-xs pl-1.5 text-gray-medium",
|
|
52
55
|
};
|
|
53
56
|
const body = {
|
|
54
|
-
positions: "
|
|
55
|
-
displays: "flex flex-col gap-1",
|
|
56
|
-
sizes: `${widthSize[option?.width ?? "md"]} min-h-6.5 max-h-
|
|
57
|
+
positions: "z-30",
|
|
58
|
+
displays: "flex flex-col gap-1 shadow-main hover:shadow-green",
|
|
59
|
+
sizes: `${widthSize[option?.width ?? "md"]} min-h-6.5 max-h-[170px]`,
|
|
57
60
|
paddings: "px-1 py-1",
|
|
58
|
-
styles: "bg-white
|
|
61
|
+
styles: "bg-white rounded-md overflow-y-scroll",
|
|
62
|
+
};
|
|
63
|
+
const labelCoating = {
|
|
64
|
+
displays: "flex overflow-hidden",
|
|
65
|
+
siezes: "h-fit w-full rounded-md hover:bg-gray-light/50",
|
|
66
|
+
animations: "duration-300",
|
|
59
67
|
};
|
|
60
68
|
const label = {
|
|
61
69
|
displays: "flex",
|
|
62
|
-
sizes: "h-fit w-fit
|
|
63
|
-
paddings: "px-1",
|
|
70
|
+
sizes: "h-fit w-fit",
|
|
71
|
+
paddings: "px-2 py-1",
|
|
64
72
|
styles: "rounded-md duration-500",
|
|
65
|
-
fonts: "text-
|
|
73
|
+
fonts: "text-xs text-gray-dim bg-gray-light",
|
|
66
74
|
};
|
|
67
75
|
const inputTransition = useTransition(isOpen, {
|
|
68
76
|
from: {
|
|
@@ -92,12 +100,17 @@ export default function Select({ state, selectOptions: selectOptionsInput, place
|
|
|
92
100
|
duration: 0,
|
|
93
101
|
},
|
|
94
102
|
});
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
setIsOpen(false);
|
|
105
|
+
}, [flag]);
|
|
106
|
+
return (_jsxs("div", { className: cn(container), id: `select-box-${uniqueKey}`, onClick: (e) => e.stopPropagation(), children: [_jsx("button", { onClick: () => {
|
|
107
|
+
setIsOpen(!isOpen), console.log(uniqueKey);
|
|
108
|
+
}, className: cn(button, "border-1 border-gray-light hover:border-none"), onMouseEnter: () => setIsHover(true), onMouseLeave: () => setIsHover(false), children: value ? (_jsx("div", { className: cn(label, "bg-white/0"), children: selectOptions?.find((option) => value === option.value)?.title })) : (_jsx("div", { className: "text-xs pl-1", children: placeholder ?? "선택해주세요" })) }), inputTransition((styles, item) => isLong &&
|
|
109
|
+
item && (_jsx(animated.input, { style: styles, placeholder: "\uAC80\uC0C9\uC5B4\uB97C \uC785\uB825\uD558\uC138\uC694", className: cn(input, "shadow-main bg-[#f6f6f6]/50"), onChange: (e) => setSearch(e.target.value) }))), bodyTransitions((styles, item) => {
|
|
110
|
+
return (item && (_jsx(animated.div, { style: styles, className: cn(body), ref: listRef, children: selectOptions?.map(({ value, title }, order) => (_jsx("section", { children: _jsx("div", { className: cn(labelCoating), onClick: () => {
|
|
98
111
|
setValue(value);
|
|
99
112
|
setText(String(title));
|
|
100
113
|
return setIsOpen(false);
|
|
101
|
-
}, className: cn(label, order === index ? "w-full" : "w-auto"), children: title }) }, id + value))) })));
|
|
114
|
+
}, children: _jsx("button", { ref: (el) => (itemRefs.current[order] = el), className: cn(label, order === index ? "w-full" : "w-auto"), children: title }) }) }, id + value))) })));
|
|
102
115
|
})] }));
|
|
103
116
|
}
|