@edu-tosel/design 1.0.281 → 1.0.283

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.
@@ -23,5 +23,8 @@ function HeaderWidgetRender(props) {
23
23
  if (props.type === "select") {
24
24
  return _jsx(Select, { ...props.data });
25
25
  }
26
+ if (props.type === "selectToggle") {
27
+ return _jsx(Select.Toggle, { ...props.data });
28
+ }
26
29
  return null;
27
30
  }
@@ -1,7 +1,7 @@
1
1
  import { Size, Titles } from "./Property";
2
2
  import { DataSet, DataField } from "./Data";
3
3
  import { ActionProps } from "./Action";
4
- import { InputWidget, LabelWidget, SelectWidget } from "./widget";
4
+ import { InputWidget, LabelWidget, SelectToggleProps, SelectWidget } from "./widget";
5
5
  interface BoardOption {
6
6
  className?: string;
7
7
  width?: Size;
@@ -31,7 +31,11 @@ interface HeaderSelectWidget<B> {
31
31
  type: "select";
32
32
  data: SelectWidget<B>;
33
33
  }
34
- export type HeaderWidgetType<B> = HeaderInputWidget | HeaderSelectWidget<B>;
34
+ interface HeaderSelectToggleWidget<T> {
35
+ type: "selectToggle";
36
+ data: SelectToggleProps<T>;
37
+ }
38
+ export type HeaderWidgetType<B> = HeaderInputWidget | HeaderSelectWidget<B> | HeaderSelectToggleWidget<B>;
35
39
  export interface BoardHeaderProps<B> {
36
40
  titles?: Omit<Titles, "subtitle"> & {
37
41
  icon?: string;
@@ -146,12 +146,12 @@ function NavigationItem({ type, calendar, notice, event, }) {
146
146
  //scroll action
147
147
  const scrollWrapper = {
148
148
  displays: "flex flex-row md:flex-col",
149
- sizss: "h-fit md:h-full",
150
- scrollActions: "scrollbar-hidden overflow-x-scroll md:overflow-y-scroll snap-x md:snap-none",
149
+ sizes: "h-fit md:h-full min-w-0 min-h-0",
150
+ scrollActions: "scrollbar-hidden overflow-x-scroll md:overflow-y-scroll snap-x md:snap-none -webkit-overflow-scrolling-touch",
151
151
  spacings: "p-5 gap-5 scroll-pl-5",
152
152
  };
153
153
  const softBox = {
154
- displays: "absolute top-0 left-0",
154
+ displays: "absolute top-0 left-0 pointer-events-none",
155
155
  sizes: "w-full h-5",
156
156
  backgrounds: "bg-gradient-to-b from-white to-white/0",
157
157
  };
@@ -237,6 +237,12 @@ function SearchComponent() {
237
237
  if (inputRef.current)
238
238
  inputRef.current.focus();
239
239
  };
240
+ const handleKeyDown = (event) => {
241
+ if (event.key === "Enter") {
242
+ event.preventDefault();
243
+ inputRef.current?.blur();
244
+ }
245
+ };
240
246
  const [searchText, setSearchText] = useState("");
241
247
  const isEmpty = "" === searchText;
242
248
  const { choseongMatch, entireMatch } = search(searchText);
@@ -245,12 +251,12 @@ function SearchComponent() {
245
251
  };
246
252
  const scrollWrapper = {
247
253
  displays: "flex flex-col",
248
- sizss: "h-full",
249
- scrollActions: "scrollbar-hidden overflow-y-scroll snap-none",
254
+ sizes: "h-full min-h-0 min-w-0",
255
+ scrollActions: "scrollbar-hidden overflow-y-scroll snap-none -webkit-overflow-scrolling-touch",
250
256
  spacings: "py-5 gap-5 scroll-pl-5",
251
257
  };
252
258
  const softBox = {
253
- displays: "absolute top-[61px] left-0",
259
+ displays: "absolute top-[61px] left-0 pointer-events-none",
254
260
  sizes: "w-full h-5",
255
261
  backgrounds: "bg-gradient-to-b from-white to-white/0",
256
262
  };
@@ -286,5 +292,5 @@ function SearchComponent() {
286
292
  };
287
293
  return (_jsxs("div", { className: "h-[calc(100vh-300px)] md:h-full w-full", children: [_jsxs("header", { className: cn(searchBarHeader), children: [!isEmpty && (_jsx("div", { className: "absolute w-[calc(100%-40px)] flex justify-end text-gray-medium pointer-events-none", children: _jsx("div", { className: "h-fit w-fit p-1 pointer-events-auto cursor-pointer", onClick: handleClear, children: _jsx(SVG.MiniClose, {}) }) })), _jsxs("form", { className: "flex flex-auto gap-4 min-w-0 w-full", children: [_jsx("label", { className: "h-6 w-6 mt-0.5 text-green-dark", children: _jsx(SVG.Search, {}) }), _jsx("input", { type: "text", className: cn(inputBox), placeholder: "\uBB34\uC5C7\uC774\uB4E0 \uCC3E\uC544\uBCF4\uC138\uC694", value: searchText, ref: inputRef, onChange: (e) => {
288
294
  setSearchText(e.target.value);
289
- } })] })] }), _jsx("div", { className: cn(scrollWrapper), children: !isEmpty ? (choseongMatch.length === 0 && entireMatch.length === 0 ? (_jsxs("div", { className: cn(noResultWrapper), children: [_jsx("div", { className: cn(noResultImg), children: _jsx("img", { src: "https://resource.tosel.co.kr/images/images/no-result.png", alt: "\uACB0\uACFC \uC5C6\uC74C" }) }), _jsx("div", { className: "text-sm text-center w-full font-medium text-green-dark", children: "\uC774\uB7F0, \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC5B4\uC694" }), _jsxs("div", { className: "text-sm text-center w-full font-medium text-green-dark", children: ["'", searchText, "'\uC5D0 \uB300\uD55C \uACB0\uACFC\uAC00 \uD544\uC694\uD55C\uAC00\uC694?"] })] })) : (_jsxs("div", { className: "flex flex-col w-full", children: [entireMatch.map((e) => (_jsxs("div", { className: cn(linkBox), onClick: () => handleItemClick(e[0]), children: [_jsxs("div", { className: "w-full flex justify-start items-center gap-2", children: [_jsx("div", { className: "text-base text-gray-dark font-medium", children: e[1] }), _jsxs("div", { className: "text-sm text-green-dark", children: ["\"", e[2], "\""] })] }), _jsx("div", { className: "w-fit rounded-md shrink-0 text-xs bg-green-dark text-white py-1 px-2", children: "\uC815\uD655\uD788 \uC77C\uCE58!" })] }))), choseongMatch.map((e) => (_jsx("div", { className: cn(linkBox), onClick: () => handleItemClick(e[0]), children: _jsxs("div", { className: "w-full flex justify-start items-center gap-2", children: [_jsx("div", { className: "text-base text-gray-dark font-medium", children: e[1] }), _jsx("div", { className: "text-sm text-gray-medium", children: e[2] })] }) })))] }))) : (_jsxs("div", { className: "flex flex-col w-full justify-center items-start px-5", children: [_jsx("div", { className: "w-full text-green-dark text-base", children: "\uAC80\uC0C9\uC5B4\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694" }), _jsx("div", { className: "text-green-dark/50 text-sm", children: "\uCD08\uC131\uC73C\uB85C\uB3C4 \uAC80\uC0C9\uD560 \uC218 \uC788\uC5B4\uC694!" })] })) }), _jsx("div", { className: cn(softBox) })] }));
295
+ }, onKeyDown: handleKeyDown })] })] }), _jsx("div", { className: cn(scrollWrapper), children: !isEmpty ? (choseongMatch.length === 0 && entireMatch.length === 0 ? (_jsxs("div", { className: cn(noResultWrapper), children: [_jsx("div", { className: cn(noResultImg), children: _jsx("img", { src: "https://resource.tosel.co.kr/images/images/no-result.png", alt: "\uACB0\uACFC \uC5C6\uC74C" }) }), _jsx("div", { className: "text-sm text-center w-full font-medium text-green-dark", children: "\uC774\uB7F0, \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC5B4\uC694" }), _jsxs("div", { className: "text-sm text-center w-full font-medium text-green-dark", children: ["'", searchText, "'\uC5D0 \uB300\uD55C \uACB0\uACFC\uAC00 \uD544\uC694\uD55C\uAC00\uC694?"] })] })) : (_jsxs("div", { className: "flex flex-col w-full", children: [entireMatch.map((e) => (_jsxs("div", { className: cn(linkBox), onClick: () => handleItemClick(e[0]), children: [_jsxs("div", { className: "w-full flex justify-start items-center gap-2", children: [_jsx("div", { className: "text-base text-gray-dark font-medium", children: e[1] }), _jsxs("div", { className: "text-sm text-green-dark", children: ["\"", e[2], "\""] })] }), _jsx("div", { className: "w-fit rounded-md shrink-0 text-xs bg-green-dark text-white py-1 px-2", children: "\uC815\uD655\uD788 \uC77C\uCE58!" })] }))), choseongMatch.map((e) => (_jsx("div", { className: cn(linkBox), onClick: () => handleItemClick(e[0]), children: _jsxs("div", { className: "w-full flex justify-start items-center gap-2", children: [_jsx("div", { className: "text-base text-gray-dark font-medium", children: e[1] }), _jsx("div", { className: "text-sm text-gray-medium", children: e[2] })] }) })))] }))) : (_jsxs("div", { className: "flex flex-col w-full justify-center items-start px-5", children: [_jsx("div", { className: "w-full text-green-dark text-base", children: "\uAC80\uC0C9\uC5B4\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694" }), _jsx("div", { className: "text-green-dark/50 text-sm", children: "\uCD08\uC131\uC73C\uB85C\uB3C4 \uAC80\uC0C9\uD560 \uC218 \uC788\uC5B4\uC694!" })] })) }), _jsx("div", { className: cn(softBox) })] }));
290
296
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.281",
3
+ "version": "1.0.283",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.281
1
+ 1.0.283