@edu-tosel/design 1.0.13 → 1.0.14
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/fonts/TimesNewerRoman-Bold.otf +0 -0
- package/asset/fonts/TimesNewerRoman-BoldItalic.otf +0 -0
- package/board/template/CanvasBoard.d.ts +1 -1
- package/board/template/CanvasBoard.js +2 -2
- package/board/template/ManageBoard.d.ts +3 -3
- package/board/template/ManageBoard.js +17 -21
- package/board/template/PaperBoard.d.ts +1 -1
- package/board/template/PaperBoard.js +4 -4
- package/board/widget/Board.js +8 -14
- package/board/widget/DataField.d.ts +7 -4
- package/board/widget/DataField.js +15 -5
- package/board/widget/Header.js +3 -3
- package/board/widget/Tags.d.ts +14 -3
- package/card/index.d.ts +1 -0
- package/card/index.js +1 -0
- package/card/template/AddCard.d.ts +2 -0
- package/card/template/AddCard.js +11 -0
- package/card/template/ChartCard.js +1 -1
- package/card/template/InfoCard.d.ts +32 -2
- package/card/template/InfoCard.design.d.ts +2 -0
- package/card/template/InfoCard.design.js +23 -0
- package/card/template/InfoCard.js +72 -8
- package/card/template/ReportCard.d.ts +1 -1
- package/card/template/ReportCard.js +3 -11
- package/card/template/RowCard.js +3 -7
- package/card/template/TableCard.d.ts +4 -2
- package/card/template/TableCard.js +22 -9
- package/card/template/TrumpCard.js +2 -2
- package/card/widget/Card.d.ts +1 -1
- package/card/widget/Card.js +31 -10
- package/deck/index.d.ts +1 -1
- package/deck/index.js +1 -1
- package/deck/template/Deck.d.ts +6 -0
- package/deck/template/Deck.design.d.ts +2 -0
- package/deck/template/Deck.design.js +21 -0
- package/deck/template/Deck.js +11 -0
- package/deck/widget/Deck.d.ts +2 -0
- package/deck/widget/Deck.js +14 -0
- package/globals.css +27 -1
- package/html/index.d.ts +3 -0
- package/html/index.js +3 -0
- package/html/widget/Button.d.ts +2 -0
- package/html/widget/Button.js +15 -0
- package/html/widget/Input.d.ts +2 -0
- package/html/widget/Input.js +21 -0
- package/html/widget/Select.d.ts +2 -0
- package/html/widget/Select.js +161 -0
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/interface/Board.d.ts +12 -16
- package/interface/Card.d.ts +41 -38
- package/{deck → interface}/Deck.d.ts +4 -7
- package/interface/Deck.js +1 -0
- package/interface/HTMLElement.d.ts +11 -5
- package/interface/Modal.d.ts +6 -1
- package/interface/Overlay.d.ts +3 -0
- package/interface/Overlay.js +1 -0
- package/interface/Property.d.ts +9 -0
- package/interface/Shelf.d.ts +22 -0
- package/interface/Shelf.js +1 -0
- package/interface/Widget.d.ts +19 -0
- package/interface/index.d.ts +2 -0
- package/interface/index.js +2 -0
- package/layout/index.d.ts +4 -1
- package/layout/index.js +4 -1
- package/layout/template/Gallery.d.ts +7 -0
- package/layout/template/Gallery.js +6 -0
- package/layout/template/Shelf.d.ts +8 -0
- package/layout/template/Shelf.js +41 -0
- package/layout/{dashboard → template/dashboard}/Header.d.ts +0 -1
- package/layout/template/dashboard/Header.js +17 -0
- package/layout/{dashboard → template/dashboard}/index.d.ts +5 -1
- package/layout/template/dashboard/index.js +27 -0
- package/layout/template/report/Header.js +11 -0
- package/layout/widget/Events.d.ts +8 -0
- package/layout/widget/Events.js +38 -0
- package/layout/widget/Shelf.d.ts +2 -0
- package/layout/widget/Shelf.js +24 -0
- package/{board → layout}/widget/Tab.js +6 -8
- package/modal/index.d.ts +1 -3
- package/modal/index.js +1 -3
- package/modal/template/Alert.d.ts +2 -0
- package/modal/template/Alert.js +8 -0
- package/modal/template/Input.d.ts +6 -0
- package/modal/template/Input.js +6 -0
- package/modal/template/index.d.ts +7 -0
- package/modal/template/index.js +7 -0
- package/modal/widget/Modal.design.d.ts +2 -0
- package/modal/widget/Modal.design.js +64 -0
- package/navigation/Navigation.d.ts +1 -1
- package/navigation/Navigation.js +19 -10
- package/overlay/index.d.ts +1 -0
- package/overlay/index.js +1 -0
- package/overlay/template/Overlay.design.d.ts +2 -0
- package/overlay/template/Overlay.design.js +5 -0
- package/overlay/template/index.d.ts +3 -0
- package/overlay/template/index.js +6 -0
- package/overlay/widget/Overlay.d.ts +2 -0
- package/overlay/widget/Overlay.js +17 -0
- package/package.json +3 -2
- package/store/index.d.ts +7 -3
- package/store/index.js +26 -8
- package/tailwind.config.ts +37 -0
- package/text/Formatter.d.ts +3 -0
- package/text/Formatter.js +18 -0
- package/text/index.d.ts +1 -0
- package/text/index.js +1 -0
- package/util/colors.d.ts +2 -1
- package/util/colors.js +2 -1
- package/util/convertUnixTimestampToDate.d.ts +1 -0
- package/util/convertUnixTimestampToDate.js +5 -0
- package/util/index.d.ts +3 -0
- package/util/index.js +3 -0
- package/util/isDebug.d.ts +1 -0
- package/util/isDebug.js +5 -0
- package/util/sortByOrder.d.ts +4 -0
- package/util/sortByOrder.js +20 -0
- package/version.txt +1 -1
- package/card/template/InfoCardCssCase.d.ts +0 -25
- package/card/template/InfoCardCssCase.js +0 -32
- package/card/template/PropfileCard.d.ts +0 -2
- package/card/template/PropfileCard.js +0 -6
- package/deck/Deck.js +0 -22
- package/layout/dashboard/Header.js +0 -19
- package/layout/dashboard/index.js +0 -10
- package/layout/report/Header.js +0 -11
- package/modal/AlertModal.d.ts +0 -2
- package/modal/AlertModal.js +0 -8
- package/modal/ControllerModal.d.ts +0 -6
- package/modal/ControllerModal.js +0 -6
- package/modal/Modal.d.ts +0 -2
- package/modal/Modal.js +0 -31
- package/modal/TestModal.d.ts +0 -7
- package/modal/TestModal.js +0 -6
- package/shelf/Shelf.d.ts +0 -3
- package/shelf/Shelf.js +0 -4
- package/shelf/index.d.ts +0 -1
- package/shelf/index.js +0 -1
- /package/layout/{report → template/report}/Header.d.ts +0 -0
- /package/{board → layout}/widget/Tab.d.ts +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { BoardProps } from "../../interface/Board";
|
|
2
|
-
export default function CanvasBoard({ children, options }: BoardProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function CanvasBoard({ children, options, widgets, }: BoardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
3
|
import { Board } from "../widget/Board";
|
|
4
|
-
export default function CanvasBoard({ children, options }) {
|
|
4
|
+
export default function CanvasBoard({ children, options, widgets, }) {
|
|
5
5
|
const layouts = "flex flex-col lg:flex-row lg:flex-wrap gap-7.5 ";
|
|
6
6
|
const sizes = "h-full ";
|
|
7
7
|
const paddings = "pb-36 xl:pb-0 px-2 xs:px-4 xl:pl-8 xl:pr-2 pt-2 xs:pt-4 xl:pt-8";
|
|
8
8
|
const styles = "overflow-y-scroll ";
|
|
9
|
-
return (_jsx(Board, { options: { ...options, isRounded: true }, children: _jsx("div", { className: cn(layouts, sizes, paddings, styles), children: children }) }));
|
|
9
|
+
return (_jsx(Board, { widgets: widgets, options: { ...options, isRounded: true }, children: _jsx("div", { className: cn(layouts, sizes, paddings, styles), children: children }) }));
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ManageBoardProps } from "../../interface/Board";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export default function ManageBoard<K extends string, T extends {
|
|
3
|
+
[p in K]: any;
|
|
4
|
+
}>({ header, data, widgets, options }: ManageBoardProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { cn } from "../../util";
|
|
2
|
+
import { Events, Shelf } from "../..";
|
|
4
3
|
import { Board } from "../widget/Board";
|
|
5
4
|
import BoardHeader from "../widget/Header";
|
|
6
5
|
import BoardDataField from "../widget/DataField";
|
|
6
|
+
import { cn, sortByOrder } from "../../util";
|
|
7
7
|
import { useWidgetStore } from "../../store";
|
|
8
|
-
import {
|
|
9
|
-
export default function ManageBoard({ header, data, widgets, }) {
|
|
10
|
-
const {
|
|
11
|
-
const { dataSets, dataField
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return 0;
|
|
25
|
-
})
|
|
26
|
-
.map((item) => renderItem(item)))) }) }), widgets?.menu] }));
|
|
8
|
+
import { useId } from "react";
|
|
9
|
+
export default function ManageBoard({ header, data, widgets, options }) {
|
|
10
|
+
const { classNames, noPadding } = options ?? {};
|
|
11
|
+
const { dataSets, dataField } = data;
|
|
12
|
+
const { order } = useWidgetStore();
|
|
13
|
+
const id = useId();
|
|
14
|
+
const orders = order[id] ?? [];
|
|
15
|
+
const container = {
|
|
16
|
+
displays: "flex flex-col gap-8",
|
|
17
|
+
sizes: `h-full ${header ? (dataField ? "xl:h-135" : "xl:h-158") : "xl:h-full"}`,
|
|
18
|
+
paddings: `${!noPadding ? "pt-8 pb-60 px-2 xs:px-4 xl:px-8 xl:pb-6 " : ""}`,
|
|
19
|
+
styles: "overflow-y-scroll",
|
|
20
|
+
};
|
|
21
|
+
return (_jsxs(Board, { widgets: widgets, options: { isRounded: true }, children: [header && _jsx(BoardHeader, { ...header }), dataField && _jsx(BoardDataField, { id: id, dataField: dataField }), _jsx("div", { className: cn(container), children: _jsx(Events.Replace, { widgets: widgets?.replaces, children: dataSets.map(({ title, subtitle, items, renderItem, interaction }) => (_jsxs(Shelf.Wrap, { titles: { title: title ?? "", subtitle: subtitle }, classNames: classNames, children: [items &&
|
|
22
|
+
sortByOrder(items, orders)?.map((item) => renderItem(item)), interaction] }, id + title))) }) })] }));
|
|
27
23
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PaperBoardProps } from "../../interface/Board";
|
|
2
|
-
export default function PaperBoard({ children, debug }: PaperBoardProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function PaperBoard({ children, debug, options, }: PaperBoardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
3
|
import { Board } from "../widget/Board";
|
|
4
|
-
export default function PaperBoard({ children, debug }) {
|
|
4
|
+
export default function PaperBoard({ children, debug, options, }) {
|
|
5
|
+
const { classNames } = options ?? {};
|
|
5
6
|
const container = {
|
|
6
|
-
displays: "flex flex-col
|
|
7
|
-
paddings: "px-4 pt-5 pb-16",
|
|
7
|
+
displays: "flex flex-col gap-7.5",
|
|
8
8
|
};
|
|
9
|
-
return (_jsx(Board, { options: { width: "lg", height: "full", isRounded: false }, debug: debug, children: _jsx("div", { className: cn(container), children: children }) }));
|
|
9
|
+
return (_jsx(Board, { options: { width: "lg", height: "full", isRounded: false, classNames }, debug: debug, children: _jsx("div", { className: cn(container), children: children }) }));
|
|
10
10
|
}
|
package/board/widget/Board.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { cn } from "../../util";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn, isDebug } from "../../util";
|
|
3
|
+
import { Events } from "../../layout";
|
|
5
4
|
const widthSize = {
|
|
6
5
|
xs: "w-20",
|
|
7
6
|
sm: "w-24",
|
|
@@ -23,23 +22,18 @@ const heightSize = {
|
|
|
23
22
|
auto: "h-auto",
|
|
24
23
|
};
|
|
25
24
|
export function Board({ children, widgets, options, debug }) {
|
|
26
|
-
const {
|
|
27
|
-
const {
|
|
28
|
-
const { width, height, isRounded } = options ?? {};
|
|
25
|
+
const { shows } = widgets ?? {};
|
|
26
|
+
const { width, height, isRounded, classNames } = options ?? {};
|
|
29
27
|
const container = {
|
|
30
28
|
positions: "relative",
|
|
31
29
|
width: widthSize[width ?? "full"],
|
|
32
|
-
debug: debug &&
|
|
30
|
+
debug: debug && isDebug(`border-2 border-${debug}`),
|
|
33
31
|
};
|
|
34
32
|
const body = {
|
|
35
33
|
positions: "relative z-10 ",
|
|
36
34
|
sizes: `w-full ${heightSize[height ?? "lg"]} overflow-hidden `,
|
|
37
|
-
styles: "bg-white",
|
|
35
|
+
styles: "bg-white text-black",
|
|
38
36
|
rounded: `rounded-none ${isRounded ? "xl:rounded-xl" : ""}`,
|
|
39
37
|
};
|
|
40
|
-
return (
|
|
41
|
-
if (typeof flag === "boolean")
|
|
42
|
-
return flag ? _jsx(_Fragment, { children: Component }) : null;
|
|
43
|
-
return events?.some(({ event }) => event === flag) ? (_jsx(_Fragment, { children: Component })) : null;
|
|
44
|
-
})] }), tabs && _jsx(Tab, { tabs: tabs })] }));
|
|
38
|
+
return (_jsx("div", { className: cn(container), children: _jsx("div", { className: cn(body), children: _jsx(Events.Show, { widgets: shows, children: _jsx("div", { className: "h-full " + classNames, children: children }) }) }) }));
|
|
45
39
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { DataField } from "../../interface";
|
|
2
|
+
export default function BoardDataField<K extends string, T extends {
|
|
3
|
+
[p in K]: any;
|
|
4
|
+
}>({ id, dataField, }: {
|
|
5
|
+
id: string;
|
|
6
|
+
dataField?: {
|
|
7
|
+
[p in keyof T]: DataField;
|
|
5
8
|
};
|
|
6
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
3
|
import { useWidgetStore } from "./../../store";
|
|
4
|
-
export default function BoardDataField({ dataField, }) {
|
|
5
|
-
const { order
|
|
6
|
-
const
|
|
4
|
+
export default function BoardDataField({ id, dataField, }) {
|
|
5
|
+
const { order, setOrder } = useWidgetStore();
|
|
6
|
+
const orders = order[id] ?? [];
|
|
7
7
|
const container = {
|
|
8
|
-
positions: "fixed top-
|
|
8
|
+
positions: "fixed top-35 left-0 xl:static z-20",
|
|
9
9
|
displays: "flex items-center",
|
|
10
10
|
styles: `bg-gray-200`,
|
|
11
11
|
sizes: "w-full h-23",
|
|
@@ -20,5 +20,15 @@ export default function BoardDataField({ dataField, }) {
|
|
|
20
20
|
displays: "xl:hidden block ",
|
|
21
21
|
sizes: container.sizes,
|
|
22
22
|
};
|
|
23
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(container), children: _jsx("div", { className: cn(dataFieldContainer), children:
|
|
23
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(container), children: _jsx("div", { className: cn(dataFieldContainer), children: dataField &&
|
|
24
|
+
Object.entries(dataField).map(([key, { title, size }]) => (_jsx("div", { className: `w-${size}/100`, children: _jsxs("button", { onClick: () => setOrder(id, key), className: "flex items-center gap-1", children: [_jsx("div", { children: title }), _jsx("div", { className: "text-xs", children: orders?.map(({ orderBy, orderHow }) => {
|
|
25
|
+
if (orderBy === key) {
|
|
26
|
+
if (orderHow === "asc")
|
|
27
|
+
return "▲";
|
|
28
|
+
else if (orderHow === "desc")
|
|
29
|
+
return "▼";
|
|
30
|
+
else
|
|
31
|
+
return "";
|
|
32
|
+
}
|
|
33
|
+
}) })] }) }, id + key))) }) }), _jsx("div", { className: cn(block) })] }));
|
|
24
34
|
}
|
package/board/widget/Header.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
|
-
import { Input, Select } from "
|
|
3
|
+
import { Input, Select } from "../../html";
|
|
4
4
|
export default function BoardHeader({ title, tags, options, }) {
|
|
5
5
|
const { selects, inputs } = tags ?? {};
|
|
6
6
|
const { colors } = options ?? {};
|
|
@@ -9,7 +9,7 @@ export default function BoardHeader({ title, tags, options, }) {
|
|
|
9
9
|
textColor: "black",
|
|
10
10
|
};
|
|
11
11
|
const container = {
|
|
12
|
-
positions: "fixed top-
|
|
12
|
+
positions: "fixed top-15 left-0 z-20 xl:static flex items-center",
|
|
13
13
|
paddings: "px-12",
|
|
14
14
|
styles: `bg-${bgColor} text-${textColor} pl-12 pr-9`,
|
|
15
15
|
sizes: "w-full h-20",
|
|
@@ -18,5 +18,5 @@ export default function BoardHeader({ title, tags, options, }) {
|
|
|
18
18
|
displays: "xl:hidden block ",
|
|
19
19
|
sizes: container.sizes,
|
|
20
20
|
};
|
|
21
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container), children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsxs("div", { className: "flex items-center ml-auto gap-4", children: [selects?.map(({ width, title, options, onChange }) => (
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container), children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsxs("div", { className: "flex items-center ml-auto gap-4", children: [selects?.map(({ width, title, options, onChange }, index) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { children: title }), _jsx(Select, { options: { width }, selectOptions: options, onChange: onChange }, title)] }, index))), inputs?.map(({ width, title, placeholder, onChange }, index) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { children: title }), _jsx(Input, { placeholder: placeholder, onChange: onChange, options: { width } })] }, index)))] })] }), _jsx("div", { className: cn(block) })] }));
|
|
22
22
|
}
|
package/board/widget/Tags.d.ts
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
1
|
+
import { Dispatch } from "react";
|
|
2
|
+
import { Size } from "../../interface";
|
|
3
|
+
export declare function Select({ title, width, onChange, selectOptions, }: {
|
|
4
|
+
title: string;
|
|
5
|
+
width?: Size;
|
|
6
|
+
onChange: Dispatch<string>;
|
|
7
|
+
selectOptions?: [string | number, string][];
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function Input({ title, onChange, placeholder, width, }: {
|
|
10
|
+
title: string;
|
|
11
|
+
onChange: Dispatch<string>;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
width?: Size;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/card/index.d.ts
CHANGED
package/card/index.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../util";
|
|
3
|
+
import { Card } from "../widget/Card";
|
|
4
|
+
export default function AddCard({ onClick, options }) {
|
|
5
|
+
const { width } = options ?? {};
|
|
6
|
+
const container = {
|
|
7
|
+
displays: "flex justify-center items-center",
|
|
8
|
+
text: "text-3xl",
|
|
9
|
+
};
|
|
10
|
+
return _jsx(Card, { options: { width, classNames: cn(container), onClick }, children: "+" });
|
|
11
|
+
}
|
|
@@ -5,7 +5,7 @@ export default function ChartCard({ data, xAxis, yAxis, lines, bars, areas, opti
|
|
|
5
5
|
const { width, height } = options ?? {};
|
|
6
6
|
return (_jsxs(Card, { options: {
|
|
7
7
|
classNames: "pt-4 pr-4",
|
|
8
|
-
width: width ?? "
|
|
8
|
+
width: width ?? "full",
|
|
9
9
|
height: height ?? "lg",
|
|
10
10
|
text: { size: "xs" },
|
|
11
11
|
}, children: [_jsx(ResponsiveContainer, { width: "100%", height: "100%", children: _jsxs(ComposedChart, { data: data, children: [_jsx(XAxis, { dataKey: xAxis }), _jsx(YAxis, { dataKey: yAxis }), _jsx(Tooltip, {}), _jsx(Legend, {}), lines?.map((line) => (_jsx(Line, { ...line }, line.dataKey))), bars?.map((bar) => (_jsx(Bar, { ...bar }, bar.dataKey))), areas?.map((area) => (_jsx(Area, { ...area }, area.dataKey))), average && (_jsx(_Fragment, { children: _jsx(ReferenceLine, { x: average.x, stroke: "#ff0000" }) }))] }) }), average && (_jsxs("div", { className: "absolute top-0 left-0 w-full h-full flex justify-center items-center text-3xl text-gray-300 font-bold", children: ["\uD3C9\uADE0: ", average?.score, "\uC810"] }))] }));
|
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
import { InfoCardProps } from "../../interface
|
|
2
|
-
|
|
1
|
+
import { InfoCardProps, Button } from "../../interface";
|
|
2
|
+
declare function Exam({ titles, data, }: Omit<InfoCardProps, "children"> & {
|
|
3
|
+
data: {
|
|
4
|
+
status: string;
|
|
5
|
+
examDate: string;
|
|
6
|
+
endDate: string;
|
|
7
|
+
manager: string;
|
|
8
|
+
isPublic: boolean;
|
|
9
|
+
};
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function Product({ titles, data, }: Omit<InfoCardProps, "children"> & {
|
|
12
|
+
data: {
|
|
13
|
+
date?: string;
|
|
14
|
+
status?: string;
|
|
15
|
+
receiver?: string | null;
|
|
16
|
+
requester?: string | null;
|
|
17
|
+
button?: Button;
|
|
18
|
+
};
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function Item({ titles, data, }: Omit<InfoCardProps, "children"> & {
|
|
21
|
+
data: {
|
|
22
|
+
item: string;
|
|
23
|
+
};
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare function Profile(props: Partial<InfoCardProps>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare const InfoCard: {
|
|
27
|
+
Exam: typeof Exam;
|
|
28
|
+
Product: typeof Product;
|
|
29
|
+
Item: typeof Item;
|
|
30
|
+
Profile: typeof Profile;
|
|
31
|
+
};
|
|
32
|
+
export default InfoCard;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../util";
|
|
3
|
+
import { Card } from "../widget/Card";
|
|
4
|
+
export function InfoCardDesign({ titles: { title, subtitle }, debug, options, children, }) {
|
|
5
|
+
const { titleBorderColor, rightTextColor } = options ?? {};
|
|
6
|
+
const container = {
|
|
7
|
+
paddings: "pt-5 px-5",
|
|
8
|
+
};
|
|
9
|
+
const topBox = {
|
|
10
|
+
container: {
|
|
11
|
+
displays: "flex justify-between",
|
|
12
|
+
sizes: "w-full h-13.25",
|
|
13
|
+
styles: `border-${titleBorderColor} border-b-2 pb-2.5`,
|
|
14
|
+
},
|
|
15
|
+
titleText: "h-6 font-bold text-lg ",
|
|
16
|
+
subtitleText: "h-5 text-sm font-extralight",
|
|
17
|
+
right: {
|
|
18
|
+
fontColor: `text-${rightTextColor ?? "black"}`,
|
|
19
|
+
displays: "flex flex-col-reverse",
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
return (_jsxs(Card, { options: { ...options, classNames: cn(container) }, debug: debug, children: [_jsx("div", { className: cn(topBox.container), children: _jsxs("div", { children: [_jsx("div", { className: cn(topBox.titleText), children: title }), _jsx("div", { className: cn(topBox.subtitleText), children: subtitle ?? "No Data" })] }) }), children] }));
|
|
23
|
+
}
|
|
@@ -1,9 +1,73 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { cn } from "../../util";
|
|
4
|
+
import { InfoCardDesign } from "./InfoCard.design";
|
|
5
|
+
function Exam({ titles, data, }) {
|
|
6
|
+
const { status, isPublic, manager, examDate, endDate } = data;
|
|
7
|
+
const container = {
|
|
8
|
+
positions: "relative",
|
|
9
|
+
displays: "flex flex-col gap-6.5 pt-2.5",
|
|
10
|
+
sizes: "h-25 w-full",
|
|
11
|
+
};
|
|
12
|
+
const style = {
|
|
13
|
+
positions: "absolute bottom-0 right-0",
|
|
14
|
+
sizes: "w-22 h-6",
|
|
15
|
+
displays: "flex justify-center items-center",
|
|
16
|
+
styles: "text-black rounded-md text-sm",
|
|
17
|
+
background: `bg-gray-light`,
|
|
18
|
+
};
|
|
19
|
+
return (_jsx(InfoCardDesign, { titles: titles, options: {
|
|
20
|
+
titleBorderColor: "red-crimson",
|
|
21
|
+
rightTextColor: "red-crimson",
|
|
22
|
+
width: "sm",
|
|
23
|
+
height: "sm",
|
|
24
|
+
buttonBackgroundColor: "gray-light",
|
|
25
|
+
}, children: _jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex gap-4 font-bold", children: [manager, " / ", isPublic ? "공개시험" : "비공개시험"] }), _jsxs("div", { children: [_jsxs("div", { className: "text-sm", children: ["\uC811\uC218\uB9C8\uAC10: ", endDate] }), _jsxs("div", { className: "text-sm", children: ["\uC2DC\uD5D8\uC77C: ", examDate] })] }), _jsx("div", { className: cn(style), children: status })] }) }));
|
|
9
26
|
}
|
|
27
|
+
function Product({ titles, data, }) {
|
|
28
|
+
const { date, status, receiver, requester, button } = data;
|
|
29
|
+
const container = {
|
|
30
|
+
positions: "relative",
|
|
31
|
+
displays: "flex flex-col pt-2.5",
|
|
32
|
+
sizes: "h-25 w-full",
|
|
33
|
+
};
|
|
34
|
+
const style = {
|
|
35
|
+
positions: "absolute bottom-0 right-0",
|
|
36
|
+
sizes: "w-22 h-6",
|
|
37
|
+
displays: "flex justify-center items-center",
|
|
38
|
+
styles: "rounded-md text-sm",
|
|
39
|
+
animation: "text-black bg-gray-light hover:bg-blue-sky hover:text-white duration-500",
|
|
40
|
+
};
|
|
41
|
+
const [hover, setHover] = useState(false);
|
|
42
|
+
return (_jsx(InfoCardDesign, { titles: titles, options: {
|
|
43
|
+
titleBorderColor: "jr-blue",
|
|
44
|
+
rightTextColor: "red-crimson",
|
|
45
|
+
width: "sm",
|
|
46
|
+
height: "sm",
|
|
47
|
+
buttonBackgroundColor: "gray-light",
|
|
48
|
+
}, children: _jsxs("div", { className: cn(container), children: [_jsxs("div", { children: ["\uC77C\uC2DC: ", date] }), _jsxs("div", { children: ["\uC694\uCCAD\uC790: ", requester ?? "No Data"] }), _jsxs("div", { children: ["\uC218\uC2E0\uC790: ", receiver ?? "No Data"] }), _jsx("button", { className: cn(style), onClick: () => button?.[1](), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), children: !hover ? status : button?.[0] ?? "완료" })] }) }));
|
|
49
|
+
}
|
|
50
|
+
function Item({ titles, data, }) {
|
|
51
|
+
const { item } = data;
|
|
52
|
+
return (_jsx(InfoCardDesign, { titles: titles, options: {
|
|
53
|
+
titleBorderColor: "blue-navy",
|
|
54
|
+
rightTextColor: "blue-navy",
|
|
55
|
+
width: "xs",
|
|
56
|
+
height: "md",
|
|
57
|
+
}, children: _jsx("div", { children: item }) }));
|
|
58
|
+
}
|
|
59
|
+
function Profile(props) {
|
|
60
|
+
return (_jsx(InfoCardDesign, { titles: { title: "ㅎㅇ" }, options: {
|
|
61
|
+
titleBorderColor: "blue-navy",
|
|
62
|
+
rightTextColor: "blue-navy",
|
|
63
|
+
width: "sm",
|
|
64
|
+
height: "md",
|
|
65
|
+
}, ...props, children: _jsx(_Fragment, {}) }));
|
|
66
|
+
}
|
|
67
|
+
const InfoCard = {
|
|
68
|
+
Exam,
|
|
69
|
+
Product,
|
|
70
|
+
Item,
|
|
71
|
+
Profile,
|
|
72
|
+
};
|
|
73
|
+
export default InfoCard;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { LineBreaks } from "../../text";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { cn } from "../../util";
|
|
4
|
-
|
|
5
|
-
import TableCard from "./TableCard";
|
|
6
|
-
export default function ReportCard({ titles, type, dataSets, dataField, }) {
|
|
3
|
+
export default function ReportCard({ titles, dataField, }) {
|
|
7
4
|
const { title, subtitle } = titles;
|
|
8
5
|
const { axis, fields, lines, bars, areas, sizes } = dataField;
|
|
9
6
|
const container = {
|
|
@@ -14,10 +11,5 @@ export default function ReportCard({ titles, type, dataSets, dataField, }) {
|
|
|
14
11
|
title: "text-lg font-bold",
|
|
15
12
|
subtitle: "text-sm",
|
|
16
13
|
};
|
|
17
|
-
return (
|
|
18
|
-
width: "full",
|
|
19
|
-
height: "auto",
|
|
20
|
-
} })) : axis && type === "chart" ? (_jsx(ChartCard, { data: dataSets.items, xAxis: axis.x, yAxis: axis.y, lines: lines, bars: bars, areas: areas, average: dataSets.average, options: {
|
|
21
|
-
width: "full",
|
|
22
|
-
} })) : null] }));
|
|
14
|
+
return (_jsx("div", { className: cn(container) }));
|
|
23
15
|
}
|
package/card/template/RowCard.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Card } from "../widget/Card";
|
|
3
|
-
import { useWidgetStore } from "../../store";
|
|
4
3
|
import { useId, useState } from "react";
|
|
5
4
|
export default function RowCard({ row, fields, sizes, }) {
|
|
5
|
+
const id = useId();
|
|
6
6
|
const [rowState, setRowState] = useState(row);
|
|
7
|
-
const { setView, setTempData } = useWidgetStore();
|
|
8
7
|
const entries = Object.entries(fields).map(([key, type]) => [type, key, rowState[key]]);
|
|
9
8
|
return (_jsx(Card, { options: {
|
|
10
9
|
width: "full",
|
|
11
10
|
height: "xs",
|
|
12
11
|
boundary: "none",
|
|
13
12
|
rounded: "none",
|
|
14
|
-
}, children:
|
|
15
|
-
setTempData(row);
|
|
16
|
-
setView("sideMenu");
|
|
17
|
-
}, children: "click" })] }) }));
|
|
13
|
+
}, children: _jsx("div", { className: "flex items-center h-full px-2 xs:px-4 xl:px-8", children: entries.map(([type, key, value]) => (_jsx("div", { className: `w-${`${sizes[key]}/100` ?? "auto"}`, children: Array.isArray(type) && type[0] === "select" ? (_jsx(Select, { type: type, entry: [key, value], row: rowState, setRow: setRowState }, key + type + value.toString())) : (_jsx("div", { className: "w-full truncate", children: value ?? "No Data" }, key)) }, id + key))) }) }));
|
|
18
14
|
}
|
|
19
15
|
function Select({ type, entry, row, setRow, }) {
|
|
20
16
|
const id = useId();
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { TableCardProps } from "../../interface
|
|
2
|
-
export default function TableCard
|
|
1
|
+
import { TableCardProps } from "../../interface";
|
|
2
|
+
export default function TableCard<K extends string, T extends {
|
|
3
|
+
[p in K]: any;
|
|
4
|
+
}>({ dataSets, dataField, options }: TableCardProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { useWidgetStore } from "../../store";
|
|
4
|
+
import { cn, sortByOrder } from "../../util";
|
|
3
5
|
import { Card } from "../widget/Card";
|
|
4
|
-
export default function TableCard({
|
|
5
|
-
const { width, height, background, text
|
|
6
|
+
export default function TableCard({ dataSets, dataField, options }) {
|
|
7
|
+
const { width, height, background, text } = options ?? {};
|
|
6
8
|
const { color: bgColor } = background ?? {};
|
|
7
9
|
const { color: textColor } = text ?? {};
|
|
8
|
-
const
|
|
10
|
+
const { order, setOrder } = useWidgetStore();
|
|
11
|
+
const id = useId();
|
|
12
|
+
const orders = order[id] ?? [];
|
|
9
13
|
const container = {
|
|
10
14
|
text: "text-xs xs:text-sm sm:text-base",
|
|
11
15
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
return (_jsx(Card, { header: Object.entries(dataField).map(([key, { title, size }]) => (_jsx("div", { className: `w-${size}/100`, children: _jsxs("button", { onClick: () => setOrder(id, key), className: "flex items-center gap-1", children: [_jsx("div", { children: title }), _jsx("div", { className: "text-xs", children: orders?.map(({ orderBy, orderHow }) => {
|
|
17
|
+
if (orderBy === key) {
|
|
18
|
+
if (orderHow === "asc")
|
|
19
|
+
return "▲";
|
|
20
|
+
else if (orderHow === "desc")
|
|
21
|
+
return "▼";
|
|
22
|
+
else
|
|
23
|
+
return "";
|
|
24
|
+
}
|
|
25
|
+
}) })] }) }, id + key))), options: {
|
|
26
|
+
width: width ?? "full",
|
|
27
|
+
height: height ?? "lg",
|
|
28
|
+
overflow: "y-scroll",
|
|
29
|
+
}, children: _jsx("div", { className: cn(container), children: sortByOrder(dataSets, orders).map((data, index) => (_jsx("div", { className: "flex items-center pl-4 h-11 ", children: Object.entries(data).map(([key, value]) => (_jsx("div", { className: `w-${dataField[key].size}/100`, children: String(value) }, id + key))) }, id + index))) }) }));
|
|
17
30
|
}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { LineBreaks } from "../../text";
|
|
3
3
|
import { Card } from "../widget/Card";
|
|
4
4
|
export default function TrumpCard({ titles, options }) {
|
|
5
|
-
const { title,
|
|
5
|
+
const { title, subtitle, color: titleColor } = titles;
|
|
6
6
|
const { onClick, width, image, subButton } = options ?? {};
|
|
7
7
|
const [buttonText, buttonBgColor, buttonAction] = subButton ?? [
|
|
8
8
|
null,
|
|
@@ -15,5 +15,5 @@ export default function TrumpCard({ titles, options }) {
|
|
|
15
15
|
return "w-full h-full object-cover";
|
|
16
16
|
return "absolute bottom-0 right-0 w-full xs:w-auto max-w-120 z-0 max-h-44 object-contain";
|
|
17
17
|
};
|
|
18
|
-
return (_jsxs(Card, { options: { width: width ?? "xs", onClick }, children: [_jsxs("div", { className: `absolute top-8 left-8 w-48 flex flex-col gap-2 z-10 text-${titleColor}`, children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsx(LineBreaks, { texts:
|
|
18
|
+
return (_jsxs(Card, { options: { width: width ?? "xs", onClick }, children: [_jsxs("div", { className: `absolute top-8 left-8 w-48 flex flex-col gap-2 z-10 text-${titleColor}`, children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsx(LineBreaks, { texts: subtitle ?? "" }), subButton ? (_jsx("button", { className: `text-white rounded-md bg-${buttonBgColor} w-45 h-11 flex justify-center items-center`, onClick: buttonAction, children: buttonText })) : null] }), path ? (_jsx("img", { src: path, alt: "trump-image", loading: "lazy", className: imageClassNames() })) : null] }));
|
|
19
19
|
}
|
package/card/widget/Card.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CardProps } from "../../interface/Card";
|
|
2
|
-
export declare function Card({ children, options, debug }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function Card({ header, children, options, debug }: CardProps): import("react/jsx-runtime").JSX.Element;
|