@edu-tosel/design 1.0.13 → 1.0.15
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 +3 -3
- 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 +12 -18
- package/board/widget/DataField.d.ts +4 -3
- package/board/widget/DataField.js +19 -13
- package/board/widget/Header.d.ts +1 -1
- package/board/widget/Header.js +11 -9
- 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.d.ts +2 -5
- package/card/template/RowCard.js +16 -18
- 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 +40 -13
- 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 +119 -1
- package/html/index.d.ts +4 -0
- package/html/index.js +4 -0
- package/html/widget/Button.d.ts +2 -0
- package/html/widget/Button.js +15 -0
- package/html/widget/DatePicker.d.ts +3 -0
- package/html/widget/DatePicker.js +23 -0
- package/html/widget/Input.d.ts +2 -0
- package/html/widget/Input.js +22 -0
- package/html/widget/Select.d.ts +2 -0
- package/html/widget/Select.js +160 -0
- package/html/widget/Toggle.d.ts +2 -0
- package/html/widget/Toggle.js +13 -0
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/interface/Board.d.ts +16 -19
- package/interface/Card.d.ts +47 -37
- package/{deck → interface}/Deck.d.ts +4 -7
- package/interface/HTMLElement.d.ts +22 -14
- package/interface/HTMLElement.js +7 -1
- package/interface/Modal.d.ts +6 -1
- package/interface/Overlay.d.ts +20 -0
- package/interface/Overlay.js +1 -0
- package/interface/Property.d.ts +12 -1
- 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 +3 -0
- package/interface/index.js +3 -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 +33 -0
- package/layout/template/report/Header.js +11 -0
- package/layout/widget/Events.d.ts +8 -0
- package/layout/widget/Events.js +44 -0
- package/layout/widget/Shelf.d.ts +2 -0
- package/layout/widget/Shelf.js +25 -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 +21 -17
- package/overlay/index.d.ts +1 -0
- package/overlay/index.js +1 -0
- package/overlay/template/Info.d.ts +2 -0
- package/overlay/template/Info.js +5 -0
- package/overlay/template/Manage.d.ts +2 -0
- package/overlay/template/Manage.js +17 -0
- package/overlay/template/index.d.ts +7 -0
- package/overlay/template/index.js +7 -0
- package/overlay/widget/Overlay.design.d.ts +2 -0
- package/overlay/widget/Overlay.design.js +25 -0
- package/package.json +6 -2
- package/store/index.d.ts +10 -3
- package/store/index.js +38 -11
- package/tailwind.config.ts +56 -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/checkPathMatch.d.ts +2 -0
- package/util/checkPathMatch.js +8 -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/interface/Menu.d.ts +0 -6
- package/layout/dashboard/Header.js +0 -19
- package/layout/dashboard/index.js +0 -10
- package/layout/report/Header.js +0 -11
- package/menu/index.d.ts +0 -1
- package/menu/index.js +0 -1
- package/menu/template/SideMenu.d.ts +0 -2
- package/menu/template/SideMenu.js +0 -20
- package/menu/widget/HTMLElement.d.ts +0 -8
- package/menu/widget/HTMLElement.js +0 -9
- 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/interface/{Menu.js → Deck.js} +0 -0
- /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
|
-
const paddings = "pb-36 xl:pb-0 px-2 xs:px-4 xl:pl-
|
|
7
|
+
const paddings = "pb-36 xl:pb-0 px-2 xs:px-4 xl:pl-7.5 xl:pr-2 pt-2 xs:pt-4 xl:pt-7.5";
|
|
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-12",
|
|
17
|
+
sizes: `h-full ${header ? (dataField ? "xl:h-138.75" : "xl:h-153") : "xl:h-full"}`,
|
|
18
|
+
paddings: `${!noPadding ? "pt-7.5 pb-60 px-2 xs:pl-4 xl:pl-7.5 xl:pb-7.5 " : ""} `,
|
|
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(({ titles, items, renderItem, interaction }, index) => (_jsxs(Shelf.Wrap, { titles: titles, classNames: classNames, children: [items &&
|
|
22
|
+
sortByOrder(items, orders)?.map((item) => renderItem(item)), interaction] }, id + index))) }) })] }));
|
|
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",
|
|
@@ -16,30 +15,25 @@ const heightSize = {
|
|
|
16
15
|
xs: "h-20",
|
|
17
16
|
sm: "h-24",
|
|
18
17
|
md: "h-28",
|
|
19
|
-
lg: "h-full xl:h-
|
|
20
|
-
xl: "h-
|
|
18
|
+
lg: "h-full xl:h-171.5 xl:min-h-0",
|
|
19
|
+
xl: "h-full xl:h-171.5 xl:min-h-0",
|
|
21
20
|
"2xl": "h-40",
|
|
22
21
|
full: "min-h-screen h-full",
|
|
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
|
-
positions: "relative
|
|
36
|
-
sizes: `w-full ${heightSize[height ?? "
|
|
37
|
-
styles: "bg-white",
|
|
33
|
+
positions: "relative",
|
|
34
|
+
sizes: `w-full ${heightSize[height ?? "xl"]} overflow-hidden `,
|
|
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,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { DataField } from "../../interface";
|
|
2
|
+
export default function BoardDataField<T extends Record<string, any>>({ id, dataField, }: {
|
|
3
|
+
id: string;
|
|
2
4
|
dataField: {
|
|
3
|
-
|
|
4
|
-
sizes: Record<string, string>;
|
|
5
|
+
[p in keyof T]?: Partial<DataField>;
|
|
5
6
|
};
|
|
6
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +1,30 @@
|
|
|
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-34 xl:top-0 left-0 xl:relative z-20",
|
|
9
9
|
displays: "flex items-center",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
displays: "flex items-center",
|
|
15
|
-
sizes: "w-full h-12",
|
|
16
|
-
paddings: "px-2 xs:px-4 xl:px-8",
|
|
17
|
-
styles: "bg-white-off",
|
|
10
|
+
sizes: "w-full h-13.75",
|
|
11
|
+
paddings: "px-2 xs:px-4 xl:px-7.5",
|
|
12
|
+
styles: "bg-white",
|
|
13
|
+
test: "box-shadow-sm",
|
|
18
14
|
};
|
|
19
15
|
const block = {
|
|
20
16
|
displays: "xl:hidden block ",
|
|
21
17
|
sizes: container.sizes,
|
|
22
18
|
};
|
|
23
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(container), children:
|
|
19
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(container), children: dataField &&
|
|
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
|
+
if (orderBy === key) {
|
|
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" }) }));
|
|
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" }) }));
|
|
26
|
+
else
|
|
27
|
+
return "";
|
|
28
|
+
}
|
|
29
|
+
}) })] }) }, id + key))) }), _jsx("div", { className: cn(block) })] }));
|
|
24
30
|
}
|
package/board/widget/Header.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { BoardHeaderProps } from "./../../interface/Board";
|
|
2
|
-
export default function BoardHeader({
|
|
2
|
+
export default function BoardHeader({ titles, tags, options, }: BoardHeaderProps): import("react/jsx-runtime").JSX.Element;
|
package/board/widget/Header.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
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 "
|
|
4
|
-
export default function BoardHeader({
|
|
3
|
+
import { Input, Select } from "../../html";
|
|
4
|
+
export default function BoardHeader({ titles, tags, options, }) {
|
|
5
|
+
const { title, icon } = titles ?? {};
|
|
5
6
|
const { selects, inputs } = tags ?? {};
|
|
6
7
|
const { colors } = options ?? {};
|
|
7
8
|
const { bgColor, textColor } = colors ?? {
|
|
8
|
-
bgColor: "
|
|
9
|
+
bgColor: "white",
|
|
9
10
|
textColor: "black",
|
|
10
11
|
};
|
|
11
12
|
const container = {
|
|
12
|
-
positions: "fixed top-
|
|
13
|
-
paddings: "px-
|
|
14
|
-
styles: `bg-${bgColor} text-${textColor}
|
|
15
|
-
sizes: "w-full h-
|
|
13
|
+
positions: "fixed top-15 xl:top-0 left-0 z-20 xl:relative flex items-center",
|
|
14
|
+
paddings: "px-7.5",
|
|
15
|
+
styles: `bg-${bgColor} text-${textColor}`,
|
|
16
|
+
sizes: "w-full h-19",
|
|
17
|
+
border: "border-b-2 border-green-dark",
|
|
16
18
|
};
|
|
17
19
|
const block = {
|
|
18
20
|
displays: "xl:hidden block ",
|
|
19
|
-
sizes:
|
|
21
|
+
sizes: "w-full h-22",
|
|
20
22
|
};
|
|
21
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container), children: [_jsx("div", { className: "text-
|
|
23
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex items-center gap-2.5", children: [icon && _jsx("img", { src: icon, className: "fill-blue-500" }), _jsx("div", { className: "text-2xl font-bold text-green-dark", children: title })] }), _jsxs("div", { className: "flex items-center ml-auto gap-4", children: [selects?.map(({ width, title, options, state }, index) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { children: title }), _jsx(Select, { options: { width }, selectOptions: options, state: state }, title)] }, index))), inputs?.map(({ width, title, placeholder, state }, index) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { children: title }), _jsx(Input, { placeholder: placeholder, state: state, options: { width } })] }, index)))] })] }), _jsx("div", { className: cn(block) })] }));
|
|
22
24
|
}
|
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-4.75 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 justify-between mt-2.5",
|
|
10
|
+
sizes: "h-19.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-xs", children: ["\uC811\uC218\uB9C8\uAC10: ", endDate] }), _jsxs("div", { className: "text-xs", 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 mt-2.5",
|
|
32
|
+
sizes: "h-19.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", { className: "text-sm", children: ["\uC77C\uC2DC: ", date] }), _jsxs("div", { className: "text-sm", children: ["\uC694\uCCAD\uC790: ", requester ?? "No Data"] }), _jsxs("div", { className: "text-sm", 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: "sm",
|
|
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
|
}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
fields: Partial<Record<keyof T, "text" | ["select", [string, string][]]>>;
|
|
4
|
-
sizes: Partial<Record<keyof T, string>>;
|
|
5
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { RowCardProps } from "../../interface";
|
|
2
|
+
export default function RowCard<T extends Record<string, any>>({ onClick, dataSet, dataField, }: RowCardProps<T>): import("react/jsx-runtime").JSX.Element;
|
package/card/template/RowCard.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { cn } from "../../util";
|
|
2
4
|
import { Card } from "../widget/Card";
|
|
3
5
|
import { useWidgetStore } from "../../store";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
6
|
+
export default function RowCard({ onClick, dataSet, dataField, }) {
|
|
7
|
+
const id = useId();
|
|
8
|
+
const { flag, setIsOwn } = useWidgetStore();
|
|
9
|
+
const container = {
|
|
10
|
+
displays: "flex items-center ",
|
|
11
|
+
sizes: "h-full",
|
|
12
|
+
paddings: "px-2 xs:px-4 xl:px-7.5 ",
|
|
13
|
+
styles: "text-xl hover:bg-gray-100 duration-100",
|
|
14
|
+
};
|
|
9
15
|
return (_jsx(Card, { options: {
|
|
16
|
+
onClick,
|
|
17
|
+
classNames: cn(container),
|
|
10
18
|
width: "full",
|
|
11
19
|
height: "xs",
|
|
12
20
|
boundary: "none",
|
|
13
21
|
rounded: "none",
|
|
14
|
-
}, children:
|
|
15
|
-
|
|
16
|
-
setView("sideMenu");
|
|
17
|
-
}, children: "click" })] }) }));
|
|
18
|
-
}
|
|
19
|
-
function Select({ type, entry, row, setRow, }) {
|
|
20
|
-
const id = useId();
|
|
21
|
-
const [key, value] = entry;
|
|
22
|
-
return (_jsx("select", { value: value, onChange: (e) => setRow({
|
|
23
|
-
...row,
|
|
24
|
-
[key]: e.target.value,
|
|
25
|
-
}), children: type[1].map(([value, title]) => (_jsx("option", { value: value, children: title }, id + value))) }, id));
|
|
22
|
+
}, children: dataField &&
|
|
23
|
+
Object.keys(dataField).map((key) => (_jsx("div", { className: `w-${dataField[key]?.size}/100 truncate`, children: dataSet[key] }, id + key))) }));
|
|
26
24
|
}
|
|
@@ -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
|
}
|