@edu-tosel/design 1.0.23 → 1.0.25
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/card/widget/Card.design.js +1 -5
- package/html/widget/Input.js +11 -4
- package/html/widget/Label.design.js +1 -1
- package/html/widget/Obstacle.d.ts +4 -0
- package/html/widget/Obstacle.js +10 -0
- package/interface/Card.d.ts +2 -2
- package/interface/HTMLElement.d.ts +2 -2
- package/interface/Overlay.d.ts +14 -11
- package/interface/Property.d.ts +1 -0
- package/layout/template/Shelf.js +1 -1
- package/layout/widget/DataField.design.js +2 -2
- package/overlay/template/Manage.d.ts +1 -1
- package/overlay/template/Manage.js +26 -12
- package/overlay/widget/Frame.design.d.ts +4 -0
- package/overlay/widget/Frame.design.js +4 -0
- package/overlay/widget/Overlay.design.js +11 -5
- package/package.json +1 -1
- package/store/index.js +1 -0
- package/version.txt +1 -1
|
@@ -52,9 +52,5 @@ export default function CardDesign({ header, children, options, debug, }) {
|
|
|
52
52
|
overflow: `overflow-${overflow ?? "hidden"}`,
|
|
53
53
|
classNames,
|
|
54
54
|
};
|
|
55
|
-
return (_jsxs("div", { className: cn(container), children: [header && _jsx(_Fragment, { children: header }), _jsx("div", { onClick: onClick &&
|
|
56
|
-
(() => {
|
|
57
|
-
setIsOwn(true);
|
|
58
|
-
return onClick();
|
|
59
|
-
}), className: cn(body), children: children })] }));
|
|
55
|
+
return (_jsxs("div", { className: cn(container), children: [header && _jsx(_Fragment, { children: header }), _jsx("div", { onClick: onClick && onClick, className: cn(body), children: children })] }));
|
|
60
56
|
}
|
package/html/widget/Input.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
3
|
import { cn } from "../../util";
|
|
4
|
+
import Obstacle from "./Obstacle";
|
|
4
5
|
const widthSize = {
|
|
5
6
|
xs: "w-28",
|
|
6
7
|
sm: "w-48",
|
|
@@ -11,14 +12,20 @@ const widthSize = {
|
|
|
11
12
|
full: "w-full",
|
|
12
13
|
};
|
|
13
14
|
export default function Input({ state, onKeyDown, placeholder, options, }) {
|
|
14
|
-
const { width } = options ?? {};
|
|
15
|
+
const { width, disabled } = options ?? {};
|
|
15
16
|
const id = useId();
|
|
16
17
|
const [value, setValue] = state;
|
|
17
18
|
const container = {
|
|
19
|
+
positions: "relative",
|
|
18
20
|
width: `${widthSize[width ?? "xs"]} h-8`,
|
|
19
|
-
|
|
21
|
+
displays: "flex items-center",
|
|
22
|
+
};
|
|
23
|
+
const body = {
|
|
24
|
+
styles: "rounded-md bg-slate-200 text-xs",
|
|
25
|
+
sizes: "w-full h-full",
|
|
26
|
+
paddings: "pl-4",
|
|
20
27
|
pseudo: "focus:outline-none focus:bg-white focus:text-black box-shadow-focus",
|
|
21
28
|
effect: `transition-all`,
|
|
22
29
|
};
|
|
23
|
-
return (_jsx("input", { className: cn(
|
|
30
|
+
return (_jsxs("div", { className: cn(container), children: [_jsx("input", { className: cn(body), id: id, type: "text", value: value, placeholder: placeholder ?? "입력해주세요", onKeyDown: onKeyDown, onChange: (e) => setValue(e.target.value) }), _jsx(Obstacle, { disabled: disabled })] }));
|
|
24
31
|
}
|
|
@@ -32,7 +32,7 @@ export default function LabelDesign({ title, onClick, options, }) {
|
|
|
32
32
|
const obstacle = {
|
|
33
33
|
positions: "absolute",
|
|
34
34
|
sizes: "w-full h-full",
|
|
35
|
-
background: "bg-white/80
|
|
35
|
+
background: "bg-white/80 ",
|
|
36
36
|
};
|
|
37
37
|
return (_jsx("div", { className: className, children: _jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(body), onClick: onClick, onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), children: title }), disabled && (_jsx("div", { onClick: typeof disabled === "function" ? disabled : undefined, className: cn(obstacle) }))] }) }));
|
|
38
38
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../util";
|
|
3
|
+
export default function Obstacle({ disabled }) {
|
|
4
|
+
const obstacle = {
|
|
5
|
+
positions: "absolute",
|
|
6
|
+
sizes: "w-full h-full",
|
|
7
|
+
background: "bg-white/80 ",
|
|
8
|
+
};
|
|
9
|
+
return (disabled && (_jsx("div", { onClick: typeof disabled === "function" ? disabled : undefined, className: cn(obstacle) })));
|
|
10
|
+
}
|
package/interface/Card.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button, DataField, ImageSize, OnClick, Size, Titles } from "./Property";
|
|
1
|
+
import { Button, DataField, Disabled, ImageSize, OnClick, Size, Titles } from "./Property";
|
|
2
2
|
import { Replace } from "./Widget";
|
|
3
3
|
interface CardOptions {
|
|
4
4
|
classNames?: string;
|
|
@@ -45,7 +45,7 @@ export interface ChartCardProps extends Omit<CardProps, "children"> {
|
|
|
45
45
|
interface ButtonInLay {
|
|
46
46
|
title: string;
|
|
47
47
|
onClick: OnClick;
|
|
48
|
-
disabled?:
|
|
48
|
+
disabled?: Disabled;
|
|
49
49
|
width?: Size;
|
|
50
50
|
height?: Size;
|
|
51
51
|
background?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnClick, Size, State } from "./Property";
|
|
1
|
+
import { Disabled, OnClick, Size, State } from "./Property";
|
|
2
2
|
export declare const HTMLElementType: {
|
|
3
3
|
readonly TEXT: "text";
|
|
4
4
|
readonly BUTTON: "button";
|
|
@@ -14,7 +14,7 @@ export interface HTMLElement {
|
|
|
14
14
|
height?: Size;
|
|
15
15
|
background?: string;
|
|
16
16
|
text?: string;
|
|
17
|
-
disabled?:
|
|
17
|
+
disabled?: Disabled;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
export interface HTMLLabelElement extends HTMLElement {
|
package/interface/Overlay.d.ts
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { HTMLElementType } from "./HTMLElement";
|
|
2
|
-
import { State, Titles } from "./Property";
|
|
1
|
+
import { HTMLElementType, HTMLLabelElement } from "./HTMLElement";
|
|
2
|
+
import { Disabled, OnClick, State, Titles } from "./Property";
|
|
3
3
|
export interface OverlayProps {
|
|
4
4
|
titles: Titles;
|
|
5
5
|
isVisible?: boolean;
|
|
6
6
|
event?: string;
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
}
|
|
9
|
+
export interface HTMLElementFrame {
|
|
10
|
+
title: string;
|
|
11
|
+
type: HTMLElementType;
|
|
12
|
+
state: State<string> | State<boolean>;
|
|
13
|
+
selectOptions?: [string | number, string][];
|
|
14
|
+
labels?: [string | boolean, string][];
|
|
15
|
+
disabled?: Disabled;
|
|
16
|
+
onClick?: OnClick;
|
|
17
|
+
}
|
|
9
18
|
export interface InfoOverlayProps extends OverlayProps {
|
|
10
19
|
}
|
|
11
|
-
export interface ManageOverlayProps extends
|
|
12
|
-
elements?:
|
|
13
|
-
|
|
14
|
-
state: State<string> | State<boolean>;
|
|
15
|
-
type: HTMLElementType;
|
|
16
|
-
selectOptions?: [string | number, string][];
|
|
17
|
-
labels?: [string | boolean, string][];
|
|
18
|
-
isDisabled?: boolean;
|
|
19
|
-
}[];
|
|
20
|
+
export interface ManageOverlayProps extends OverlayProps {
|
|
21
|
+
elements?: HTMLElementFrame[];
|
|
22
|
+
buttons?: HTMLLabelElement[];
|
|
20
23
|
}
|
package/interface/Property.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export type Size = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "auto";
|
|
|
36
36
|
*/
|
|
37
37
|
export type OnClick<T = unknown> = (prop?: T) => unknown | ((prop?: T) => Promise<unknown>);
|
|
38
38
|
export type Button = [string, OnClick];
|
|
39
|
+
export type Disabled = boolean | OnClick;
|
|
39
40
|
export type Scripts = {
|
|
40
41
|
script: string;
|
|
41
42
|
subScript?: string;
|
package/layout/template/Shelf.js
CHANGED
|
@@ -9,7 +9,7 @@ function Shelf({ titles, debug, children }) {
|
|
|
9
9
|
}
|
|
10
10
|
function Wrap({ classNames, titles, children, debug, }) {
|
|
11
11
|
const container = {
|
|
12
|
-
displays: "flex flex-
|
|
12
|
+
displays: "flex flex-row flex-wrap gap-x-7.5",
|
|
13
13
|
classNames,
|
|
14
14
|
};
|
|
15
15
|
return (_jsx(ShelfDesign, { titles: titles, classNames: cn(container), options: {
|
|
@@ -20,9 +20,9 @@ export default function DataFieldDesign({ id, dataField, options, }) {
|
|
|
20
20
|
Object.keys(dataField).map((key) => (_jsx("div", { className: `w-${dataField[key]?.size}/100`, children: _jsxs("button", { onClick: () => setOrder(id, key), className: "flex items-center", children: [_jsx("div", { children: dataField[key]?.title }), _jsx("div", { className: "text-xs", children: orders?.map(({ orderBy, orderHow }) => {
|
|
21
21
|
if (orderBy === key) {
|
|
22
22
|
if (orderHow === "asc")
|
|
23
|
-
return (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M7.15859 15.0437C6.7079 15.9134 7.27152 17 8.17239 17H15.8279C16.7282 17 17.2919 15.9134 16.8417 15.0437L13.0145 7.65229C12.5638 6.78257 11.4365 6.78257 10.9858 7.65229L7.15859 15.0437Z", fill: "#105652" }) }));
|
|
23
|
+
return (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M7.15859 15.0437C6.7079 15.9134 7.27152 17 8.17239 17H15.8279C16.7282 17 17.2919 15.9134 16.8417 15.0437L13.0145 7.65229C12.5638 6.78257 11.4365 6.78257 10.9858 7.65229L7.15859 15.0437Z", fill: "#105652" }) }, id + key + "asc"));
|
|
24
24
|
else if (orderHow === "desc")
|
|
25
|
-
return (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M16.8414 8.95628C17.2921 8.08657 16.7285 7 15.8276 7L8.1721 7C7.27176 7 6.70813 8.08657 7.15831 8.95628L10.9855 16.3477C11.4362 17.2174 12.5635 17.2174 13.0142 16.3477L16.8414 8.95628Z", fill: "#105652" }) }));
|
|
25
|
+
return (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M16.8414 8.95628C17.2921 8.08657 16.7285 7 15.8276 7L8.1721 7C7.27176 7 6.70813 8.08657 7.15831 8.95628L10.9855 16.3477C11.4362 17.2174 12.5635 17.2174 13.0142 16.3477L16.8414 8.95628Z", fill: "#105652" }) }, id + key + "asc"));
|
|
26
26
|
else
|
|
27
27
|
return "";
|
|
28
28
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ManageOverlayProps } from "../../interface";
|
|
2
|
-
export default function Manage({ titles, isVisible, event, elements, }: ManageOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function Manage({ titles, isVisible, event, elements, buttons, }: ManageOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Select, Toggle } from "../..";
|
|
2
|
+
import { Input, Label, Select, Toggle } from "../..";
|
|
3
3
|
import OverlayDesign from "../widget/Overlay.design";
|
|
4
|
+
import Frame from "../widget/Frame.design";
|
|
4
5
|
import { useId } from "react";
|
|
5
|
-
|
|
6
|
+
import { cn } from "../../util";
|
|
7
|
+
export default function Manage({ titles, isVisible, event, elements, buttons, }) {
|
|
6
8
|
const id = useId();
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
const body = {
|
|
10
|
+
sizes: "w-full xl:h-120 ",
|
|
11
|
+
styles: "overflow-y-scroll",
|
|
12
|
+
};
|
|
13
|
+
return (_jsxs(OverlayDesign, { titles: titles, event: event, isVisible: isVisible, children: [_jsx("div", { className: cn(body), children: elements?.map(({ title, type, labels, state, selectOptions, disabled }) => {
|
|
14
|
+
if (type === "select")
|
|
15
|
+
return (_jsx(Frame, { title: title, children: _jsx(Select, { state: state, selectOptions: selectOptions }) }, id + title));
|
|
16
|
+
if (type === "toggle")
|
|
17
|
+
return (_jsx(Frame, { title: title, children: _jsx(Toggle, { state: state, labels: labels, options: { disabled } }) }, id + title));
|
|
18
|
+
if (type === "input")
|
|
19
|
+
return (_jsx(Frame, { title: title, children: _jsx(Input, { state: state, options: {
|
|
20
|
+
width: "md",
|
|
21
|
+
disabled,
|
|
22
|
+
} }) }, id + title));
|
|
23
|
+
return null;
|
|
24
|
+
}) }), _jsx("div", { className: "absolute bottom-12 right-12 flex gap-4", children: buttons?.map(({ title, onClick, options }) => (_jsx(Label.Button, { title: title, onClick: onClick, options: {
|
|
25
|
+
width: "sm",
|
|
26
|
+
height: "xs",
|
|
27
|
+
background: options?.background ?? "bg-crimson-dark",
|
|
28
|
+
text: options?.text ?? "text-white",
|
|
29
|
+
disabled: !onClick ? true : false,
|
|
30
|
+
} }, id + title))) })] }));
|
|
17
31
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export default function Frame({ title, children, }) {
|
|
3
|
+
return (_jsxs("div", { className: "flex items-center gap-3.75 h-9 ", children: [_jsx("div", { className: "w-20 text-sm font-pretendard-bold text-gray-dim", children: title }), children] }));
|
|
4
|
+
}
|
|
@@ -7,19 +7,25 @@ export default function OverlayDesign({ titles, children, event, isVisible, }) {
|
|
|
7
7
|
const { title } = titles;
|
|
8
8
|
const container = {
|
|
9
9
|
positions: "absolute top-0 right-0 z-30",
|
|
10
|
-
sizes: "h-full
|
|
10
|
+
sizes: "h-full",
|
|
11
11
|
styles: "box-shadow-sm bg-white",
|
|
12
12
|
};
|
|
13
13
|
const body = {
|
|
14
14
|
positions: "relative",
|
|
15
|
+
sizes: "h-full",
|
|
15
16
|
paddings: "pt-12 pl-12",
|
|
16
17
|
displays: "flex flex-col gap-3.5",
|
|
17
18
|
};
|
|
19
|
+
const button = {
|
|
20
|
+
positions: "absolute top-2 left-2",
|
|
21
|
+
displays: "flex justify-center items-center ",
|
|
22
|
+
sizes: "w-7 h-7",
|
|
23
|
+
};
|
|
18
24
|
const transitions = useTransition(isVisible, {
|
|
19
|
-
from: { width: "
|
|
20
|
-
enter: { width: "80%", maxWidth: "540px" },
|
|
21
|
-
leave: { width: "
|
|
25
|
+
from: { width: "10%", opacity: 0 },
|
|
26
|
+
enter: { width: "80%", maxWidth: "540px", opacity: 1 },
|
|
27
|
+
leave: { width: "10%", opacity: 0 },
|
|
22
28
|
config: { duration: 300 },
|
|
23
29
|
});
|
|
24
|
-
return transitions((styles, item) => item && (_jsxs(animated.div, { style: styles, className: cn(container), onClick: () => setIsOwn(true), children: [_jsxs("div", { className: cn(body), children: [_jsx("div", { className: "font-pretendard-bold text-2xl", children: title }), _jsx("div", { className: "flex flex-col gap-3", children: children })] }), event && (_jsx("button", { className: "
|
|
30
|
+
return transitions((styles, item) => item && (_jsxs(animated.div, { style: styles, className: cn(container), onClick: () => setIsOwn(true), children: [_jsxs("div", { className: cn(body), children: [_jsx("div", { className: "font-pretendard-bold text-2xl", children: title }), _jsx("div", { className: "flex flex-col gap-3", children: children })] }), event && (_jsx("button", { onClick: () => removeView(event), className: cn(button), children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: _jsx("path", { d: "M6.28003 5.22C6.13786 5.08752 5.94981 5.0154 5.75551 5.01882C5.56121 5.02225 5.37582 5.10096 5.23841 5.23838C5.101 5.37579 5.02228 5.56118 5.01886 5.75548C5.01543 5.94978 5.08755 6.13782 5.22003 6.28L8.94003 10L5.22003 13.72C5.14634 13.7887 5.08724 13.8715 5.04625 13.9635C5.00526 14.0555 4.98322 14.1548 4.98144 14.2555C4.97966 14.3562 4.99819 14.4562 5.03591 14.5496C5.07363 14.643 5.12977 14.7278 5.20099 14.799C5.27221 14.8703 5.35705 14.9264 5.45043 14.9641C5.54382 15.0018 5.64385 15.0204 5.74455 15.0186C5.84526 15.0168 5.94457 14.9948 6.03657 14.9538C6.12857 14.9128 6.21137 14.8537 6.28003 14.78L10 11.06L13.72 14.78C13.7887 14.8537 13.8715 14.9128 13.9635 14.9538C14.0555 14.9948 14.1548 15.0168 14.2555 15.0186C14.3562 15.0204 14.4562 15.0018 14.5496 14.9641C14.643 14.9264 14.7279 14.8703 14.7991 14.799C14.8703 14.7278 14.9264 14.643 14.9642 14.5496C15.0019 14.4562 15.0204 14.3562 15.0186 14.2555C15.0168 14.1548 14.9948 14.0555 14.9538 13.9635C14.9128 13.8715 14.8537 13.7887 14.78 13.72L11.06 10L14.78 6.28C14.9125 6.13782 14.9846 5.94978 14.9812 5.75548C14.9778 5.56118 14.8991 5.37579 14.7617 5.23838C14.6242 5.10096 14.4389 5.02225 14.2446 5.01882C14.0503 5.0154 13.8622 5.08752 13.72 5.22L10 8.94L6.28003 5.22Z", fill: "#7F7F7F" }) }) }))] })));
|
|
25
31
|
}
|
package/package.json
CHANGED
package/store/index.js
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.25
|