@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.
Files changed (158) hide show
  1. package/asset/fonts/TimesNewerRoman-Bold.otf +0 -0
  2. package/asset/fonts/TimesNewerRoman-BoldItalic.otf +0 -0
  3. package/board/template/CanvasBoard.d.ts +1 -1
  4. package/board/template/CanvasBoard.js +3 -3
  5. package/board/template/ManageBoard.d.ts +3 -3
  6. package/board/template/ManageBoard.js +17 -21
  7. package/board/template/PaperBoard.d.ts +1 -1
  8. package/board/template/PaperBoard.js +4 -4
  9. package/board/widget/Board.js +12 -18
  10. package/board/widget/DataField.d.ts +4 -3
  11. package/board/widget/DataField.js +19 -13
  12. package/board/widget/Header.d.ts +1 -1
  13. package/board/widget/Header.js +11 -9
  14. package/board/widget/Tags.d.ts +14 -3
  15. package/card/index.d.ts +1 -0
  16. package/card/index.js +1 -0
  17. package/card/template/AddCard.d.ts +2 -0
  18. package/card/template/AddCard.js +11 -0
  19. package/card/template/ChartCard.js +1 -1
  20. package/card/template/InfoCard.d.ts +32 -2
  21. package/card/template/InfoCard.design.d.ts +2 -0
  22. package/card/template/InfoCard.design.js +23 -0
  23. package/card/template/InfoCard.js +72 -8
  24. package/card/template/ReportCard.d.ts +1 -1
  25. package/card/template/ReportCard.js +3 -11
  26. package/card/template/RowCard.d.ts +2 -5
  27. package/card/template/RowCard.js +16 -18
  28. package/card/template/TableCard.d.ts +4 -2
  29. package/card/template/TableCard.js +22 -9
  30. package/card/template/TrumpCard.js +2 -2
  31. package/card/widget/Card.d.ts +1 -1
  32. package/card/widget/Card.js +40 -13
  33. package/deck/index.d.ts +1 -1
  34. package/deck/index.js +1 -1
  35. package/deck/template/Deck.d.ts +6 -0
  36. package/deck/template/Deck.design.d.ts +2 -0
  37. package/deck/template/Deck.design.js +21 -0
  38. package/deck/template/Deck.js +11 -0
  39. package/deck/widget/Deck.d.ts +2 -0
  40. package/deck/widget/Deck.js +14 -0
  41. package/globals.css +119 -1
  42. package/html/index.d.ts +4 -0
  43. package/html/index.js +4 -0
  44. package/html/widget/Button.d.ts +2 -0
  45. package/html/widget/Button.js +15 -0
  46. package/html/widget/DatePicker.d.ts +3 -0
  47. package/html/widget/DatePicker.js +23 -0
  48. package/html/widget/Input.d.ts +2 -0
  49. package/html/widget/Input.js +22 -0
  50. package/html/widget/Select.d.ts +2 -0
  51. package/html/widget/Select.js +160 -0
  52. package/html/widget/Toggle.d.ts +2 -0
  53. package/html/widget/Toggle.js +13 -0
  54. package/index.d.ts +2 -2
  55. package/index.js +2 -2
  56. package/interface/Board.d.ts +16 -19
  57. package/interface/Card.d.ts +47 -37
  58. package/{deck → interface}/Deck.d.ts +4 -7
  59. package/interface/HTMLElement.d.ts +22 -14
  60. package/interface/HTMLElement.js +7 -1
  61. package/interface/Modal.d.ts +6 -1
  62. package/interface/Overlay.d.ts +20 -0
  63. package/interface/Overlay.js +1 -0
  64. package/interface/Property.d.ts +12 -1
  65. package/interface/Shelf.d.ts +22 -0
  66. package/interface/Shelf.js +1 -0
  67. package/interface/Widget.d.ts +19 -0
  68. package/interface/index.d.ts +3 -0
  69. package/interface/index.js +3 -0
  70. package/layout/index.d.ts +4 -1
  71. package/layout/index.js +4 -1
  72. package/layout/template/Gallery.d.ts +7 -0
  73. package/layout/template/Gallery.js +6 -0
  74. package/layout/template/Shelf.d.ts +8 -0
  75. package/layout/template/Shelf.js +41 -0
  76. package/layout/{dashboard → template/dashboard}/Header.d.ts +0 -1
  77. package/layout/template/dashboard/Header.js +17 -0
  78. package/layout/{dashboard → template/dashboard}/index.d.ts +5 -1
  79. package/layout/template/dashboard/index.js +33 -0
  80. package/layout/template/report/Header.js +11 -0
  81. package/layout/widget/Events.d.ts +8 -0
  82. package/layout/widget/Events.js +44 -0
  83. package/layout/widget/Shelf.d.ts +2 -0
  84. package/layout/widget/Shelf.js +25 -0
  85. package/{board → layout}/widget/Tab.js +6 -8
  86. package/modal/index.d.ts +1 -3
  87. package/modal/index.js +1 -3
  88. package/modal/template/Alert.d.ts +2 -0
  89. package/modal/template/Alert.js +8 -0
  90. package/modal/template/Input.d.ts +6 -0
  91. package/modal/template/Input.js +6 -0
  92. package/modal/template/index.d.ts +7 -0
  93. package/modal/template/index.js +7 -0
  94. package/modal/widget/Modal.design.d.ts +2 -0
  95. package/modal/widget/Modal.design.js +64 -0
  96. package/navigation/Navigation.d.ts +1 -1
  97. package/navigation/Navigation.js +21 -17
  98. package/overlay/index.d.ts +1 -0
  99. package/overlay/index.js +1 -0
  100. package/overlay/template/Info.d.ts +2 -0
  101. package/overlay/template/Info.js +5 -0
  102. package/overlay/template/Manage.d.ts +2 -0
  103. package/overlay/template/Manage.js +17 -0
  104. package/overlay/template/index.d.ts +7 -0
  105. package/overlay/template/index.js +7 -0
  106. package/overlay/widget/Overlay.design.d.ts +2 -0
  107. package/overlay/widget/Overlay.design.js +25 -0
  108. package/package.json +6 -2
  109. package/store/index.d.ts +10 -3
  110. package/store/index.js +38 -11
  111. package/tailwind.config.ts +56 -0
  112. package/text/Formatter.d.ts +3 -0
  113. package/text/Formatter.js +18 -0
  114. package/text/index.d.ts +1 -0
  115. package/text/index.js +1 -0
  116. package/util/checkPathMatch.d.ts +2 -0
  117. package/util/checkPathMatch.js +8 -0
  118. package/util/colors.d.ts +2 -1
  119. package/util/colors.js +2 -1
  120. package/util/convertUnixTimestampToDate.d.ts +1 -0
  121. package/util/convertUnixTimestampToDate.js +5 -0
  122. package/util/index.d.ts +3 -0
  123. package/util/index.js +3 -0
  124. package/util/isDebug.d.ts +1 -0
  125. package/util/isDebug.js +5 -0
  126. package/util/sortByOrder.d.ts +4 -0
  127. package/util/sortByOrder.js +20 -0
  128. package/version.txt +1 -1
  129. package/card/template/InfoCardCssCase.d.ts +0 -25
  130. package/card/template/InfoCardCssCase.js +0 -32
  131. package/card/template/PropfileCard.d.ts +0 -2
  132. package/card/template/PropfileCard.js +0 -6
  133. package/deck/Deck.js +0 -22
  134. package/interface/Menu.d.ts +0 -6
  135. package/layout/dashboard/Header.js +0 -19
  136. package/layout/dashboard/index.js +0 -10
  137. package/layout/report/Header.js +0 -11
  138. package/menu/index.d.ts +0 -1
  139. package/menu/index.js +0 -1
  140. package/menu/template/SideMenu.d.ts +0 -2
  141. package/menu/template/SideMenu.js +0 -20
  142. package/menu/widget/HTMLElement.d.ts +0 -8
  143. package/menu/widget/HTMLElement.js +0 -9
  144. package/modal/AlertModal.d.ts +0 -2
  145. package/modal/AlertModal.js +0 -8
  146. package/modal/ControllerModal.d.ts +0 -6
  147. package/modal/ControllerModal.js +0 -6
  148. package/modal/Modal.d.ts +0 -2
  149. package/modal/Modal.js +0 -31
  150. package/modal/TestModal.d.ts +0 -7
  151. package/modal/TestModal.js +0 -6
  152. package/shelf/Shelf.d.ts +0 -3
  153. package/shelf/Shelf.js +0 -4
  154. package/shelf/index.d.ts +0 -1
  155. package/shelf/index.js +0 -1
  156. /package/interface/{Menu.js → Deck.js} +0 -0
  157. /package/layout/{report → template/report}/Header.d.ts +0 -0
  158. /package/{board → layout}/widget/Tab.d.ts +0 -0
@@ -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-8 xl:pr-2 pt-2 xs:pt-4 xl:pt-8";
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
- type Item = Record<string, any>;
3
- export default function ManageBoard<T extends Item>({ header, data, widgets, }: ManageBoardProps<T>): import("react/jsx-runtime").JSX.Element;
4
- export {};
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 { Deck } from "../../deck";
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 { Exception } from "../../interaction";
9
- export default function ManageBoard({ header, data, widgets, }) {
10
- const { order: [orderBy, orderHow], } = useWidgetStore();
11
- const { dataSets, dataField, gap } = data;
12
- const positions = `flex flex-col gap-${gap ?? 0}`;
13
- const sizes = `h-full ${dataField ? "xl:h-135" : "xl:h-158"}`;
14
- const paddings = "pb-60 xl:pb-0 px-2 xs:px-4 xl:px-8";
15
- const styles = "overflow-y-scroll";
16
- return (_jsxs(Board, { widgets: widgets, options: { isRounded: true }, children: [_jsx(BoardHeader, { ...header }), dataField && _jsx(BoardDataField, { dataField: dataField }), _jsx("div", { className: cn(positions, sizes, paddings, styles), children: _jsx(Exception, { exceptions: widgets?.exceptions, children: dataSets.map(({ title: deckTitle, items, renderItem }) => deckTitle ? (_jsx("div", { className: "pt-4", children: _jsx(Deck, { titles: { title: deckTitle ?? "" }, children: items?.map((item) => renderItem(item)) }) }, deckTitle)) : (items
17
- ?.slice()
18
- .sort((a, b) => {
19
- if (orderBy) {
20
- if (orderHow === "asc")
21
- return a[orderBy] > b[orderBy] ? 1 : -1;
22
- return a[orderBy] < b[orderBy] ? 1 : -1;
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 items-center gap-7.5",
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
  }
@@ -1,7 +1,6 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useWidgetStore } from "../../store";
3
- import Tab from "./Tab";
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-178 xl:min-h-0",
20
- xl: "h-36",
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 { events } = useWidgetStore();
27
- const { components, tabs } = widgets ?? {};
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 && import.meta.env.MODE && `border-2 border-${debug}`,
30
+ debug: debug && isDebug(`border-2 border-${debug}`),
33
31
  };
34
32
  const body = {
35
- positions: "relative z-10 ",
36
- sizes: `w-full ${heightSize[height ?? "lg"]} overflow-hidden `,
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 (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: cn(body), children: [children, components?.map(([flag, Component]) => {
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
- export default function BoardDataField({ dataField, }: {
1
+ import { DataField } from "../../interface";
2
+ export default function BoardDataField<T extends Record<string, any>>({ id, dataField, }: {
3
+ id: string;
2
4
  dataField: {
3
- fields: Record<string, string>;
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: [orderBy, orderHow], setOrder, } = useWidgetStore();
6
- const { fields, sizes } = dataField;
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-40 left-0 xl:static",
8
+ positions: "fixed top-34 xl:top-0 left-0 xl:relative z-20",
9
9
  displays: "flex items-center",
10
- styles: `bg-gray-200`,
11
- sizes: "w-full h-23",
12
- };
13
- const dataFieldContainer = {
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: _jsx("div", { className: cn(dataFieldContainer), children: Object.entries(fields).map(([key, value]) => (_jsx("div", { className: `w-${`${sizes[key]}/100` ?? "auto"}`, children: _jsxs("button", { onClick: () => setOrder(key), className: "flex items-center gap-1", children: [_jsx("div", { children: value }), _jsx("div", { className: "text-xs", children: orderBy === key ? (orderHow === "asc" ? "▼" : "▲") : "" })] }) }, key))) }) }), _jsx("div", { className: cn(block) })] }));
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
  }
@@ -1,2 +1,2 @@
1
1
  import { BoardHeaderProps } from "./../../interface/Board";
2
- export default function BoardHeader({ title, tags, options, }: BoardHeaderProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function BoardHeader({ titles, tags, options, }: BoardHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -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 "./Tags";
4
- export default function BoardHeader({ title, tags, options, }) {
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: "gray-200",
9
+ bgColor: "white",
9
10
  textColor: "black",
10
11
  };
11
12
  const container = {
12
- positions: "fixed top-20 left-0 xl:static flex items-center",
13
- paddings: "px-12",
14
- styles: `bg-${bgColor} text-${textColor} pl-12 pr-9`,
15
- sizes: "w-full h-20",
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: container.sizes,
21
+ sizes: "w-full h-22",
20
22
  };
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 }) => (_jsx(Select, { width: width, title: title, selectOptions: options, onChange: onChange }, title))), inputs?.map(({ width, title, placeholder, onChange }) => (_jsx(Input, { width: width, title: title, placeholder: placeholder, onChange: onChange }, title + placeholder)))] })] }), _jsx("div", { className: cn(block) })] }));
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
  }
@@ -1,3 +1,14 @@
1
- import { HTMLInputElement, HTMLSelectElement } from "../../interface/HTMLElement";
2
- export declare function Select({ title, width, onChange, selectOptions, }: HTMLSelectElement): import("react/jsx-runtime").JSX.Element;
3
- export declare function Input({ title, onChange, placeholder, width, }: HTMLInputElement): import("react/jsx-runtime").JSX.Element;
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
@@ -1,3 +1,4 @@
1
+ export { default as AddCard } from "./template/AddCard";
1
2
  export { default as ProfileCard } from "./template/ProfileCard";
2
3
  export { default as TrumpCard } from "./template/TrumpCard";
3
4
  export { default as ChartCard } from "./template/ChartCard";
package/card/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export { default as AddCard } from "./template/AddCard";
1
2
  export { default as ProfileCard } from "./template/ProfileCard";
2
3
  export { default as TrumpCard } from "./template/TrumpCard";
3
4
  export { default as ChartCard } from "./template/ChartCard";
@@ -0,0 +1,2 @@
1
+ import { AddCardProps } from "../../interface";
2
+ export default function AddCard({ onClick, options }: AddCardProps): import("react/jsx-runtime").JSX.Element;
@@ -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 ?? "xl",
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/Card";
2
- export default function InfoCard({ type, titles, button }: InfoCardProps): import("react/jsx-runtime").JSX.Element;
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,2 @@
1
+ import { InfoCardProps } from "../../interface/Card";
2
+ export declare function InfoCardDesign({ titles: { title, subtitle }, debug, options, children, }: InfoCardProps): import("react/jsx-runtime").JSX.Element;
@@ -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, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Card } from "../widget/Card";
3
- import { sizeBySetting, bgColorBySetting, lineColorBySetting, fontColorBySetting, btnSizeBySetting, } from "./InfoCardCssCase";
4
- export default function InfoCard({ type, titles, button }) {
5
- return (_jsx(Card, { options: {
6
- width: sizeBySetting.widthSize[type],
7
- height: sizeBySetting.heightSize[type],
8
- }, children: _jsxs("div", { className: "relative w-full h-full p-5 bg-" + `${bgColorBySetting[type]}`, children: [_jsxs("div", { className: `h-18 w-full border-b-2 border-[${lineColorBySetting[type]}] flex justify-between`, children: [_jsxs("div", { className: "w-auto", children: [_jsx("div", { className: "h-9 font-bold text-xl text-" + `${titles.color}`, children: titles.title }), _jsx("div", { className: "h-8 text-md font-thin ", children: titles.subTitle })] }), _jsx("div", { className: `w-auto flex flex-col-reverse text-${fontColorBySetting} p-2`, children: _jsx("span", { className: `text-xs font-thin font-semibold inline-block align-bottom `, children: "\uC218\uC815\uD558\uAE30" }) })] }), _jsx("div", {}), _jsx("div", { className: `absolute bottom-4 right-4 ${button.display}`, children: _jsx("button", { className: `text-white rounded-md bg-${button.color} ${btnSizeBySetting[type]} flex justify-center items-center`, children: button.title }) })] }) }));
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,5 +1,5 @@
1
1
  import { Titles } from "../../interface";
2
- export default function ReportCard({ titles, type, dataSets, dataField, }: {
2
+ export default function ReportCard({ titles, dataField, }: {
3
3
  titles: Titles;
4
4
  type: "text" | "table" | "chart";
5
5
  dataSets: {
@@ -1,9 +1,6 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { LineBreaks } from "../../text";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
3
2
  import { cn } from "../../util";
4
- import ChartCard from "./ChartCard";
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 (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: cn(titleBox.container), children: [_jsx("div", { className: cn(titleBox.title), children: title }), _jsx(LineBreaks, { className: cn(titleBox.subtitle), texts: subtitle })] }), type === "text" ? (_jsx("div", { children: "text" })) : type === "table" && sizes ? (_jsx(TableCard, { sizes: sizes, fields: fields, data: dataSets.items, options: {
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
- export default function RowCard<T extends Record<string, any>>({ row, fields, sizes, }: {
2
- row: T;
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;
@@ -1,26 +1,24 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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
- import { useId, useState } from "react";
5
- export default function RowCard({ row, fields, sizes, }) {
6
- const [rowState, setRowState] = useState(row);
7
- const { setView, setTempData } = useWidgetStore();
8
- const entries = Object.entries(fields).map(([key, type]) => [type, key, rowState[key]]);
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: _jsxs("div", { className: "flex items-center h-full", 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)) }, key))), _jsx("button", { onClick: () => {
15
- setTempData(row);
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/Card";
2
- export default function TableCard({ data, fields, sizes, options, }: TableCardProps): import("react/jsx-runtime").JSX.Element;
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 { cn } from "../../util";
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({ data, fields, sizes, options, }) {
5
- const { width, height, background, text, overflow } = options ?? {};
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 keys = Object.keys(fields);
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
- const fieldsClassNames = [
13
- `flex h-11 items-center font-bold pl-4`,
14
- `bg-${bgColor ?? "gray-300"} text-${textColor ?? "black"}`,
15
- ].join(" ");
16
- return (_jsx(Card, { options: { width: width ?? "lg", height: height ?? "lg", overflow }, children: _jsxs("div", { className: cn(container), children: [_jsx("div", { className: fieldsClassNames, children: keys.map((key) => (_jsx("div", { className: `w-${sizes[key]}/100`, children: fields[key] }, key))) }), data.map((row, index) => (_jsx("div", { className: "flex items-center pl-4 h-11 ", children: keys.map((key) => (_jsx("div", { className: `truncate w-${`${sizes[key]}/100` ?? "auto"}`, children: row[key] }, key))) }, index)))] }) }));
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
  }