@tipp/ui 1.0.7 → 1.0.8
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/dist/atoms/field-error-wrapper.js +2 -2
- package/dist/atoms/index.js +45 -45
- package/dist/atoms/pagination.js +2 -2
- package/dist/charts/chart.cjs +227 -0
- package/dist/charts/chart.cjs.map +1 -0
- package/dist/charts/chart.d.cts +179 -0
- package/dist/charts/chart.d.ts +179 -0
- package/dist/charts/chart.js +10 -0
- package/dist/charts/chart.js.map +1 -0
- package/dist/charts/horizontal-bar-chart.cjs +42 -0
- package/dist/charts/horizontal-bar-chart.cjs.map +1 -0
- package/dist/charts/horizontal-bar-chart.d.cts +17 -0
- package/dist/charts/horizontal-bar-chart.d.ts +17 -0
- package/dist/charts/horizontal-bar-chart.js +8 -0
- package/dist/charts/horizontal-bar-chart.js.map +1 -0
- package/dist/charts/index.cjs +245 -0
- package/dist/charts/index.cjs.map +1 -0
- package/dist/charts/index.d.cts +5 -0
- package/dist/charts/index.d.ts +5 -0
- package/dist/charts/index.js +14 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/charts/vertical-bar-chart.cjs +48 -0
- package/dist/charts/vertical-bar-chart.cjs.map +1 -0
- package/dist/charts/vertical-bar-chart.d.cts +17 -0
- package/dist/charts/vertical-bar-chart.d.ts +17 -0
- package/dist/charts/vertical-bar-chart.js +8 -0
- package/dist/charts/vertical-bar-chart.js.map +1 -0
- package/dist/chunk-7QVMAHXH.js +24 -0
- package/dist/chunk-7QVMAHXH.js.map +1 -0
- package/dist/chunk-EUS56L3L.js +180 -0
- package/dist/chunk-EUS56L3L.js.map +1 -0
- package/dist/chunk-GKHTWD7W.js +24 -0
- package/dist/chunk-GKHTWD7W.js.map +1 -0
- package/dist/chunk-KD2BVMEX.js +119 -0
- package/dist/chunk-KD2BVMEX.js.map +1 -0
- package/dist/chunk-QOY42XM2.js +59 -0
- package/dist/chunk-QOY42XM2.js.map +1 -0
- package/dist/chunk-R6PYUH56.js +104 -0
- package/dist/chunk-R6PYUH56.js.map +1 -0
- package/dist/chunk-SDAJ6NLJ.js +24 -0
- package/dist/chunk-SDAJ6NLJ.js.map +1 -0
- package/dist/chunk-TG7PURWS.js +18 -0
- package/dist/chunk-TG7PURWS.js.map +1 -0
- package/dist/index.css +27 -0
- package/dist/index.js +51 -51
- package/dist/molecules/expand-table/index.js +21 -21
- package/dist/molecules/expand-table/row.js +19 -19
- package/dist/molecules/index.js +22 -22
- package/dist/molecules/navigation.js +20 -20
- package/package.json +16 -16
- package/src/charts/horizontal-bar-chart.tsx +30 -0
- package/src/charts/index.ts +2 -0
- /package/src/{chart → charts}/chart-theme.json +0 -0
- /package/src/{chart → charts}/chart.tsx +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
interface VerticalBarChartProps {
|
|
4
|
+
/** 100% 바가 뜻하는 전체 값 */
|
|
5
|
+
total: number;
|
|
6
|
+
/** 화면에 채워져보이는 값 */
|
|
7
|
+
value: number;
|
|
8
|
+
/** 배경 색상 */
|
|
9
|
+
backgroundColor?: string;
|
|
10
|
+
/** 바의 색상 */
|
|
11
|
+
barColor?: string;
|
|
12
|
+
/** 바의 높이 */
|
|
13
|
+
height?: number;
|
|
14
|
+
}
|
|
15
|
+
declare function VerticalBarChart(props: VerticalBarChartProps): React__default.ReactNode;
|
|
16
|
+
|
|
17
|
+
export { VerticalBarChart, type VerticalBarChartProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// src/charts/vertical-bar-chart.tsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
function VerticalBarChart(props) {
|
|
4
|
+
const { total, value, backgroundColor, barColor, height } = props;
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
className: "tipp_vertical-bar-chart bar-wrapper",
|
|
9
|
+
style: { height, backgroundColor },
|
|
10
|
+
children: /* @__PURE__ */ jsx("div", { style: { width: `${Math.round(value / total * 100)}%`, height }, children: /* @__PURE__ */ jsx(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: "tipp_vertical-bar-chart bar",
|
|
14
|
+
style: { backgroundColor: barColor }
|
|
15
|
+
}
|
|
16
|
+
) })
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
VerticalBarChart
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=chunk-7QVMAHXH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/vertical-bar-chart.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface VerticalBarChartProps {\n /** 100% 바가 뜻하는 전체 값 */\n total: number;\n /** 화면에 채워져보이는 값 */\n value: number;\n /** 배경 색상 */\n backgroundColor?: string;\n /** 바의 색상 */\n barColor?: string;\n /** 바의 높이 */\n height?: number;\n}\n\nexport function VerticalBarChart(\n props: VerticalBarChartProps\n): React.ReactNode {\n const { total, value, backgroundColor, barColor, height } = props;\n return (\n <div\n className=\"tipp_vertical-bar-chart bar-wrapper\"\n style={{ height, backgroundColor }}\n >\n <div style={{ width: `${Math.round((value / total) * 100)}%`, height }}>\n <div\n className=\"tipp_vertical-bar-chart bar\"\n style={{ backgroundColor: barColor }}\n />\n </div>\n </div>\n );\n}\n"],"mappings":";AAyBQ;AAVD,SAAS,iBACd,OACiB;AACjB,QAAM,EAAE,OAAO,OAAO,iBAAiB,UAAU,OAAO,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,EAAE,QAAQ,gBAAgB;AAAA,MAEjC,8BAAC,SAAI,OAAO,EAAE,OAAO,GAAG,KAAK,MAAO,QAAQ,QAAS,GAAG,CAAC,KAAK,OAAO,GACnE;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAO,EAAE,iBAAiB,SAAS;AAAA;AAAA,MACrC,GACF;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "./chunk-N552FDTV.js";
|
|
5
|
+
|
|
6
|
+
// src/charts/chart.tsx
|
|
7
|
+
import { useMemo } from "react";
|
|
8
|
+
import { useResizeDetector } from "react-resize-detector";
|
|
9
|
+
import ReactECharts from "echarts-for-react";
|
|
10
|
+
import { merge } from "lodash-es";
|
|
11
|
+
|
|
12
|
+
// src/charts/chart-theme.json
|
|
13
|
+
var chart_theme_default = {
|
|
14
|
+
version: 1,
|
|
15
|
+
themeName: "customed",
|
|
16
|
+
theme: {
|
|
17
|
+
seriesCnt: "5",
|
|
18
|
+
backgroundColor: "rgba(0,0,0,0)",
|
|
19
|
+
titleColor: "#1c2024",
|
|
20
|
+
subtitleColor: "#8d8d8d",
|
|
21
|
+
textColorShow: false,
|
|
22
|
+
textColor: "#333",
|
|
23
|
+
markTextColor: "#ffffff",
|
|
24
|
+
color: [
|
|
25
|
+
"#ffe629",
|
|
26
|
+
"#3e63dd",
|
|
27
|
+
"#ec9455",
|
|
28
|
+
"#5bb98b",
|
|
29
|
+
"#cb1d63",
|
|
30
|
+
"#3ba272",
|
|
31
|
+
"#fc8452",
|
|
32
|
+
"#9a60b4",
|
|
33
|
+
"#ea7ccc"
|
|
34
|
+
],
|
|
35
|
+
borderColor: "#8d8d8d",
|
|
36
|
+
borderWidth: 0,
|
|
37
|
+
visualMapColor: ["#bf444c", "#d88273", "#f6efa6"],
|
|
38
|
+
legendTextColor: "#1c2024",
|
|
39
|
+
kColor: "#eb5454",
|
|
40
|
+
kColor0: "#47b262",
|
|
41
|
+
kBorderColor: "#eb5454",
|
|
42
|
+
kBorderColor0: "#47b262",
|
|
43
|
+
kBorderWidth: 1,
|
|
44
|
+
lineWidth: 2,
|
|
45
|
+
symbolSize: 4,
|
|
46
|
+
symbol: "emptyCircle",
|
|
47
|
+
symbolBorderWidth: 1,
|
|
48
|
+
lineSmooth: false,
|
|
49
|
+
graphLineWidth: 1,
|
|
50
|
+
graphLineColor: "#aaa",
|
|
51
|
+
mapLabelColor: "#000",
|
|
52
|
+
mapLabelColorE: "rgb(100,0,0)",
|
|
53
|
+
mapBorderColor: "#444",
|
|
54
|
+
mapBorderColorE: "#444",
|
|
55
|
+
mapBorderWidth: 0.5,
|
|
56
|
+
mapBorderWidthE: 1,
|
|
57
|
+
mapAreaColor: "#eee",
|
|
58
|
+
mapAreaColorE: "rgba(255,215,0,0.8)",
|
|
59
|
+
axes: [
|
|
60
|
+
{
|
|
61
|
+
type: "all",
|
|
62
|
+
name: "\u901A\u7528\u5750\u6807\u8F74",
|
|
63
|
+
axisLineShow: true,
|
|
64
|
+
axisLineColor: "#6E7079",
|
|
65
|
+
axisTickShow: true,
|
|
66
|
+
axisTickColor: "#6E7079",
|
|
67
|
+
axisLabelShow: true,
|
|
68
|
+
axisLabelColor: "#6E7079",
|
|
69
|
+
splitLineShow: true,
|
|
70
|
+
splitLineColor: ["#E0E6F1"],
|
|
71
|
+
splitAreaShow: false,
|
|
72
|
+
splitAreaColor: ["rgba(250,250,250,0.2)", "rgba(210,219,238,0.2)"]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: "category",
|
|
76
|
+
name: "\u7C7B\u76EE\u5750\u6807\u8F74",
|
|
77
|
+
axisLineShow: true,
|
|
78
|
+
axisLineColor: "#6E7079",
|
|
79
|
+
axisTickShow: true,
|
|
80
|
+
axisTickColor: "#6E7079",
|
|
81
|
+
axisLabelShow: true,
|
|
82
|
+
axisLabelColor: "#6E7079",
|
|
83
|
+
splitLineShow: false,
|
|
84
|
+
splitLineColor: ["#E0E6F1"],
|
|
85
|
+
splitAreaShow: false,
|
|
86
|
+
splitAreaColor: ["rgba(250,250,250,0.2)", "rgba(210,219,238,0.2)"]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: "value",
|
|
90
|
+
name: "\u6570\u503C\u5750\u6807\u8F74",
|
|
91
|
+
axisLineShow: false,
|
|
92
|
+
axisLineColor: "#6E7079",
|
|
93
|
+
axisTickShow: false,
|
|
94
|
+
axisTickColor: "#6E7079",
|
|
95
|
+
axisLabelShow: true,
|
|
96
|
+
axisLabelColor: "#6E7079",
|
|
97
|
+
splitLineShow: true,
|
|
98
|
+
splitLineColor: ["#E0E6F1"],
|
|
99
|
+
splitAreaShow: false,
|
|
100
|
+
splitAreaColor: ["rgba(250,250,250,0.2)", "rgba(210,219,238,0.2)"]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
type: "log",
|
|
104
|
+
name: "\u5BF9\u6570\u5750\u6807\u8F74",
|
|
105
|
+
axisLineShow: false,
|
|
106
|
+
axisLineColor: "#6E7079",
|
|
107
|
+
axisTickShow: false,
|
|
108
|
+
axisTickColor: "#6E7079",
|
|
109
|
+
axisLabelShow: true,
|
|
110
|
+
axisLabelColor: "#6E7079",
|
|
111
|
+
splitLineShow: true,
|
|
112
|
+
splitLineColor: ["#E0E6F1"],
|
|
113
|
+
splitAreaShow: false,
|
|
114
|
+
splitAreaColor: ["rgba(250,250,250,0.2)", "rgba(210,219,238,0.2)"]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
type: "time",
|
|
118
|
+
name: "\u65F6\u95F4\u5750\u6807\u8F74",
|
|
119
|
+
axisLineShow: true,
|
|
120
|
+
axisLineColor: "#6E7079",
|
|
121
|
+
axisTickShow: true,
|
|
122
|
+
axisTickColor: "#6E7079",
|
|
123
|
+
axisLabelShow: true,
|
|
124
|
+
axisLabelColor: "#6E7079",
|
|
125
|
+
splitLineShow: false,
|
|
126
|
+
splitLineColor: ["#E0E6F1"],
|
|
127
|
+
splitAreaShow: false,
|
|
128
|
+
splitAreaColor: ["rgba(250,250,250,0.2)", "rgba(210,219,238,0.2)"]
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
axisSeperateSetting: true,
|
|
132
|
+
toolboxColor: "#8d8d8d",
|
|
133
|
+
toolboxEmphasisColor: "#1c2024",
|
|
134
|
+
tooltipAxisColor: "#cccccc",
|
|
135
|
+
tooltipAxisWidth: 1,
|
|
136
|
+
timelineLineColor: "#dae1f5",
|
|
137
|
+
timelineLineWidth: 2,
|
|
138
|
+
timelineItemColor: "#a4b1d7",
|
|
139
|
+
timelineItemColorE: "#ffffff",
|
|
140
|
+
timelineCheckColor: "#316bf3",
|
|
141
|
+
timelineCheckBorderColor: "#ffffff",
|
|
142
|
+
timelineItemBorderWidth: 1,
|
|
143
|
+
timelineControlColor: "#a4b1d7",
|
|
144
|
+
timelineControlBorderColor: "#a4b1d7",
|
|
145
|
+
timelineControlBorderWidth: 1,
|
|
146
|
+
timelineLabelColor: "#a4b1d7"
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
// src/charts/chart.tsx
|
|
151
|
+
import { jsx } from "react/jsx-runtime";
|
|
152
|
+
function Chart(props) {
|
|
153
|
+
const { width, height, ref } = useResizeDetector({
|
|
154
|
+
handleHeight: false,
|
|
155
|
+
refreshMode: "debounce",
|
|
156
|
+
refreshRate: 100
|
|
157
|
+
});
|
|
158
|
+
const option = useMemo(() => {
|
|
159
|
+
const baseOption = {
|
|
160
|
+
textStyle: { fontFamily: "Noto Sans KR" },
|
|
161
|
+
tooltip: { textStyle: { fontSize: 16 } }
|
|
162
|
+
};
|
|
163
|
+
return merge(baseOption, props.option);
|
|
164
|
+
}, [props.option]);
|
|
165
|
+
return /* @__PURE__ */ jsx("div", { ref, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(
|
|
166
|
+
ReactECharts,
|
|
167
|
+
__spreadProps(__spreadValues({
|
|
168
|
+
style: { width, height },
|
|
169
|
+
theme: chart_theme_default
|
|
170
|
+
}, props), {
|
|
171
|
+
option
|
|
172
|
+
})
|
|
173
|
+
) });
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export {
|
|
177
|
+
chart_theme_default,
|
|
178
|
+
Chart
|
|
179
|
+
};
|
|
180
|
+
//# sourceMappingURL=chunk-EUS56L3L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/chart.tsx","../src/charts/chart-theme.json"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\nimport ReactECharts from 'echarts-for-react';\nimport type { EChartOption } from 'echarts';\nimport { merge } from 'lodash-es';\nimport chartTheme from './chart-theme.json';\n\nexport { chartTheme };\n\nexport type ChartProps = Omit<\n React.ComponentProps<typeof ReactECharts>,\n 'option'\n> & {\n option: EChartOption;\n};\n\nexport function Chart(props: ChartProps): JSX.Element {\n const { width, height, ref } = useResizeDetector({\n handleHeight: false,\n refreshMode: 'debounce',\n refreshRate: 100,\n });\n\n const option = useMemo(() => {\n const baseOption: EChartOption = {\n textStyle: { fontFamily: 'Noto Sans KR' },\n tooltip: { textStyle: { fontSize: 16 } },\n };\n return merge(baseOption, props.option);\n }, [props.option]);\n\n return (\n <div ref={ref} style={{ width: '100%', height: '100%' }}>\n <ReactECharts\n style={{ width, height }}\n theme={chartTheme}\n {...props}\n option={option}\n />\n </div>\n );\n}\n","{\n \"version\": 1,\n \"themeName\": \"customed\",\n \"theme\": {\n \"seriesCnt\": \"5\",\n \"backgroundColor\": \"rgba(0,0,0,0)\",\n \"titleColor\": \"#1c2024\",\n \"subtitleColor\": \"#8d8d8d\",\n \"textColorShow\": false,\n \"textColor\": \"#333\",\n \"markTextColor\": \"#ffffff\",\n \"color\": [\n \"#ffe629\",\n \"#3e63dd\",\n \"#ec9455\",\n \"#5bb98b\",\n \"#cb1d63\",\n \"#3ba272\",\n \"#fc8452\",\n \"#9a60b4\",\n \"#ea7ccc\"\n ],\n \"borderColor\": \"#8d8d8d\",\n \"borderWidth\": 0,\n \"visualMapColor\": [\"#bf444c\", \"#d88273\", \"#f6efa6\"],\n \"legendTextColor\": \"#1c2024\",\n \"kColor\": \"#eb5454\",\n \"kColor0\": \"#47b262\",\n \"kBorderColor\": \"#eb5454\",\n \"kBorderColor0\": \"#47b262\",\n \"kBorderWidth\": 1,\n \"lineWidth\": 2,\n \"symbolSize\": 4,\n \"symbol\": \"emptyCircle\",\n \"symbolBorderWidth\": 1,\n \"lineSmooth\": false,\n \"graphLineWidth\": 1,\n \"graphLineColor\": \"#aaa\",\n \"mapLabelColor\": \"#000\",\n \"mapLabelColorE\": \"rgb(100,0,0)\",\n \"mapBorderColor\": \"#444\",\n \"mapBorderColorE\": \"#444\",\n \"mapBorderWidth\": 0.5,\n \"mapBorderWidthE\": 1,\n \"mapAreaColor\": \"#eee\",\n \"mapAreaColorE\": \"rgba(255,215,0,0.8)\",\n \"axes\": [\n {\n \"type\": \"all\",\n \"name\": \"通用坐标轴\",\n \"axisLineShow\": true,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": true,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": true,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n },\n {\n \"type\": \"category\",\n \"name\": \"类目坐标轴\",\n \"axisLineShow\": true,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": true,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": false,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n },\n {\n \"type\": \"value\",\n \"name\": \"数值坐标轴\",\n \"axisLineShow\": false,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": false,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": true,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n },\n {\n \"type\": \"log\",\n \"name\": \"对数坐标轴\",\n \"axisLineShow\": false,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": false,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": true,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n },\n {\n \"type\": \"time\",\n \"name\": \"时间坐标轴\",\n \"axisLineShow\": true,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": true,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": false,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n }\n ],\n \"axisSeperateSetting\": true,\n \"toolboxColor\": \"#8d8d8d\",\n \"toolboxEmphasisColor\": \"#1c2024\",\n \"tooltipAxisColor\": \"#cccccc\",\n \"tooltipAxisWidth\": 1,\n \"timelineLineColor\": \"#dae1f5\",\n \"timelineLineWidth\": 2,\n \"timelineItemColor\": \"#a4b1d7\",\n \"timelineItemColorE\": \"#ffffff\",\n \"timelineCheckColor\": \"#316bf3\",\n \"timelineCheckBorderColor\": \"#ffffff\",\n \"timelineItemBorderWidth\": 1,\n \"timelineControlColor\": \"#a4b1d7\",\n \"timelineControlBorderColor\": \"#a4b1d7\",\n \"timelineControlBorderWidth\": 1,\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;AAAA,IACxB,kBAAoB;AAAA,IACpB,kBAAoB;AAAA,IACpB,mBAAqB;AAAA,IACrB,mBAAqB;AAAA,IACrB,mBAAqB;AAAA,IACrB,oBAAsB;AAAA,IACtB,oBAAsB;AAAA,IACtB,0BAA4B;AAAA,IAC5B,yBAA2B;AAAA,IAC3B,sBAAwB;AAAA,IACxB,4BAA8B;AAAA,IAC9B,4BAA8B;AAAA,IAC9B,oBAAsB;AAAA,EACxB;AACF;;;ADtGM;AAjBC,SAAS,MAAM,OAAgC;AACpD,QAAM,EAAE,OAAO,QAAQ,IAAI,IAAI,kBAAkB;AAAA,IAC/C,cAAc;AAAA,IACd,aAAa;AAAA,IACb,aAAa;AAAA,EACf,CAAC;AAED,QAAM,SAAS,QAAQ,MAAM;AAC3B,UAAM,aAA2B;AAAA,MAC/B,WAAW,EAAE,YAAY,eAAe;AAAA,MACxC,SAAS,EAAE,WAAW,EAAE,UAAU,GAAG,EAAE;AAAA,IACzC;AACA,WAAO,MAAM,YAAY,MAAM,MAAM;AAAA,EACvC,GAAG,CAAC,MAAM,MAAM,CAAC;AAEjB,SACE,oBAAC,SAAI,KAAU,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAO,GACpD;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,EAAE,OAAO,OAAO;AAAA,MACvB,OAAO;AAAA,OACH,QAHL;AAAA,MAIC;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// src/charts/vertical-bar-chart.tsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
function VerticalBarChart(props) {
|
|
4
|
+
const { total, value, backgroundColor, barColor, height } = props;
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
className: "tipp_vertical-bar-chart bar-wrapper",
|
|
9
|
+
style: { height, backgroundColor },
|
|
10
|
+
children: /* @__PURE__ */ jsx("div", { style: { width: `${value / total}%` }, children: /* @__PURE__ */ jsx(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: "tipp_vertical-bar-chart bar",
|
|
14
|
+
style: { backgroundColor: barColor }
|
|
15
|
+
}
|
|
16
|
+
) })
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
VerticalBarChart
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=chunk-GKHTWD7W.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/vertical-bar-chart.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface VerticalBarChartProps {\n /** 100% 바가 뜻하는 전체 값 */\n total: number;\n /** 화면에 채워져보이는 값 */\n value: number;\n /** 배경 색상 */\n backgroundColor?: string;\n /** 바의 색상 */\n barColor?: string;\n /** 바의 높이 */\n height?: number;\n}\n\nexport function VerticalBarChart(\n props: VerticalBarChartProps\n): React.ReactNode {\n const { total, value, backgroundColor, barColor, height } = props;\n return (\n <div\n className=\"tipp_vertical-bar-chart bar-wrapper\"\n style={{ height, backgroundColor }}\n >\n <div style={{ width: `${value / total}%` }}>\n <div\n className=\"tipp_vertical-bar-chart bar\"\n style={{ backgroundColor: barColor }}\n />\n </div>\n </div>\n );\n}\n"],"mappings":";AAyBQ;AAVD,SAAS,iBACd,OACiB;AACjB,QAAM,EAAE,OAAO,OAAO,iBAAiB,UAAU,OAAO,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,EAAE,QAAQ,gBAAgB;AAAA,MAEjC,8BAAC,SAAI,OAAO,EAAE,OAAO,GAAG,QAAQ,KAAK,IAAI,GACvC;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAO,EAAE,iBAAiB,SAAS;AAAA;AAAA,MACrC,GACF;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Row
|
|
3
|
+
} from "./chunk-PBPRWY2V.js";
|
|
4
|
+
import {
|
|
5
|
+
Flex
|
|
6
|
+
} from "./chunk-25HMMI7R.js";
|
|
7
|
+
import {
|
|
8
|
+
Typo
|
|
9
|
+
} from "./chunk-O3XTRD7R.js";
|
|
10
|
+
import {
|
|
11
|
+
TriangleArrowDownIcon
|
|
12
|
+
} from "./chunk-BSTJBBEX.js";
|
|
13
|
+
import {
|
|
14
|
+
TriangleArrowUpIcon
|
|
15
|
+
} from "./chunk-NDUKDKGB.js";
|
|
16
|
+
|
|
17
|
+
// src/molecules/expand-table/index.tsx
|
|
18
|
+
import {
|
|
19
|
+
flexRender,
|
|
20
|
+
getCoreRowModel,
|
|
21
|
+
useReactTable,
|
|
22
|
+
getSortedRowModel,
|
|
23
|
+
createColumnHelper
|
|
24
|
+
} from "@tanstack/react-table";
|
|
25
|
+
import { useMemo, useState } from "react";
|
|
26
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
27
|
+
function ExpandTable(props) {
|
|
28
|
+
const { data, columns, ExpandComp, placeholder, onRowClick } = props;
|
|
29
|
+
const [sorting, setSorting] = useState([]);
|
|
30
|
+
const { getRowModel, getHeaderGroups } = useReactTable({
|
|
31
|
+
data: data || [],
|
|
32
|
+
columns,
|
|
33
|
+
getCoreRowModel: getCoreRowModel(),
|
|
34
|
+
getSortedRowModel: getSortedRowModel(),
|
|
35
|
+
state: {
|
|
36
|
+
sorting
|
|
37
|
+
},
|
|
38
|
+
onSortingChange: setSorting
|
|
39
|
+
});
|
|
40
|
+
const gridColTemp = useMemo(() => {
|
|
41
|
+
return columns.map((col) => {
|
|
42
|
+
var _a;
|
|
43
|
+
if ((_a = col.meta) == null ? void 0 : _a.autoSize)
|
|
44
|
+
return "1fr";
|
|
45
|
+
return `${col.size || 150}px`;
|
|
46
|
+
}).join(" ");
|
|
47
|
+
}, [columns]);
|
|
48
|
+
const rowModels = getRowModel();
|
|
49
|
+
return /* @__PURE__ */ jsxs("div", { className: "expand-table", children: [
|
|
50
|
+
/* @__PURE__ */ jsx("div", { className: "thead", children: getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: "tr",
|
|
54
|
+
style: { gridTemplateColumns: gridColTemp },
|
|
55
|
+
children: headerGroup.headers.map((header) => {
|
|
56
|
+
const sortable = header.column.getCanSort();
|
|
57
|
+
const sortedState = header.column.getIsSorted();
|
|
58
|
+
return /* @__PURE__ */ jsx("div", { className: "th", children: /* @__PURE__ */ jsxs(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
onClick: header.column.getToggleSortingHandler(),
|
|
62
|
+
style: sortable ? { cursor: "pointer" } : void 0,
|
|
63
|
+
type: "button",
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ jsx(Typo, { variant: "body", children: flexRender(
|
|
66
|
+
header.column.columnDef.header,
|
|
67
|
+
header.getContext()
|
|
68
|
+
) }),
|
|
69
|
+
sortable ? /* @__PURE__ */ jsxs(
|
|
70
|
+
Flex,
|
|
71
|
+
{
|
|
72
|
+
direction: "column",
|
|
73
|
+
style: { marginLeft: "var(--space-2)" },
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ jsx(
|
|
76
|
+
TriangleArrowUpIcon,
|
|
77
|
+
{
|
|
78
|
+
color: sortedState === "asc" ? "var(--iris-10)" : "var(--iris-6)"
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
TriangleArrowDownIcon,
|
|
83
|
+
{
|
|
84
|
+
color: sortedState === "desc" ? "var(--iris-10)" : "var(--iris-6)"
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
) : null
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
) }, header.id);
|
|
93
|
+
})
|
|
94
|
+
},
|
|
95
|
+
headerGroup.id
|
|
96
|
+
)) }),
|
|
97
|
+
/* @__PURE__ */ jsxs("div", { className: "tbody", children: [
|
|
98
|
+
rowModels.rows.length === 0 && /* @__PURE__ */ jsx("div", { className: "tr", children: /* @__PURE__ */ jsx(Flex, { align: "center", justify: "center", children: placeholder || /* @__PURE__ */ jsx(Typo, { color: "gray", mb: "6", mt: "6", variant: "body", children: "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4" }) }) }, "expand_placeholder"),
|
|
99
|
+
rowModels.rows.map((row) => {
|
|
100
|
+
return /* @__PURE__ */ jsx(
|
|
101
|
+
Row,
|
|
102
|
+
{
|
|
103
|
+
ExpandComp,
|
|
104
|
+
gridColTemp,
|
|
105
|
+
onRowClick,
|
|
106
|
+
row
|
|
107
|
+
},
|
|
108
|
+
`row_${row.id}`
|
|
109
|
+
);
|
|
110
|
+
})
|
|
111
|
+
] })
|
|
112
|
+
] });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export {
|
|
116
|
+
createColumnHelper,
|
|
117
|
+
ExpandTable
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=chunk-KD2BVMEX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/expand-table/index.tsx"],"sourcesContent":["import type { ColumnDef, SortingState, RowData } from '@tanstack/react-table';\nimport type { CSSProperties } from 'react';\nimport {\n flexRender,\n getCoreRowModel,\n useReactTable,\n getSortedRowModel,\n createColumnHelper,\n} from '@tanstack/react-table';\nimport React, { useMemo, useState } from 'react';\nimport { Flex, Typo } from '../../atoms';\nimport { TriangleArrowDownIcon } from '../../icons/down';\nimport { TriangleArrowUpIcon } from '../../icons/up';\nimport { Row, type ExpandComp, type OnRowClick } from './row';\n\nexport type { ExpandComp, OnRowClick, ColumnDef };\nexport { createColumnHelper };\n\nexport interface ExpandTableProps<Datum extends RowData> {\n /** 렌더할 데이터 배열 */\n data?: Datum[];\n /** 테이블 컬럼의 메타 데이터 */\n columns: ColumnDef<Datum>[];\n /** Row의 open이 true인 경우 하단의 collapse에 렌더할 컴포넌트 */\n ExpandComp?: ExpandComp<Datum>;\n /** 데이테가 없을 시 화면에 표시할 컴포넌트 */\n placeholder?: React.ReactNode;\n /** 행 클릭 시 실행할 콜백 */\n onRowClick?: OnRowClick<Datum>;\n rowStyle?: CSSProperties;\n}\n\nexport function ExpandTable<Datum extends RowData>(\n props: ExpandTableProps<Datum>\n): React.ReactNode {\n const { data, columns, ExpandComp, placeholder, onRowClick } = props;\n\n const [sorting, setSorting] = useState<SortingState>([]);\n const { getRowModel, getHeaderGroups } = useReactTable({\n data: data || [],\n columns,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n state: {\n sorting,\n },\n onSortingChange: setSorting,\n });\n\n const gridColTemp = useMemo<string>(() => {\n return columns\n .map((col) => {\n if (col.meta?.autoSize) return '1fr';\n return `${col.size || 150}px`;\n })\n .join(' ');\n }, [columns]);\n\n const rowModels = getRowModel();\n\n return (\n <div className=\"expand-table\">\n <div className=\"thead\">\n {getHeaderGroups().map((headerGroup) => (\n <div\n className=\"tr\"\n key={headerGroup.id}\n style={{ gridTemplateColumns: gridColTemp }}\n >\n {headerGroup.headers.map((header) => {\n const sortable = header.column.getCanSort();\n const sortedState = header.column.getIsSorted();\n\n return (\n <div className=\"th\" key={header.id}>\n <button\n onClick={header.column.getToggleSortingHandler()}\n style={sortable ? { cursor: 'pointer' } : undefined}\n type=\"button\"\n >\n <Typo variant=\"body\">\n {flexRender(\n header.column.columnDef.header,\n header.getContext()\n )}\n </Typo>\n {sortable ? (\n <Flex\n direction=\"column\"\n style={{ marginLeft: 'var(--space-2)' }}\n >\n <TriangleArrowUpIcon\n color={\n sortedState === 'asc'\n ? 'var(--iris-10)'\n : 'var(--iris-6)'\n }\n />\n <TriangleArrowDownIcon\n color={\n sortedState === 'desc'\n ? 'var(--iris-10)'\n : 'var(--iris-6)'\n }\n />\n </Flex>\n ) : null}\n </button>\n </div>\n );\n })}\n </div>\n ))}\n </div>\n <div className=\"tbody\">\n {/* 데이터가 없을 시 표시되는 노드 */}\n {rowModels.rows.length === 0 && (\n <div className=\"tr\" key=\"expand_placeholder\">\n <Flex align=\"center\" justify=\"center\">\n {placeholder || (\n <Typo color=\"gray\" mb=\"6\" mt=\"6\" variant=\"body\">\n 데이터가 없습니다\n </Typo>\n )}\n </Flex>\n </div>\n )}\n\n {/* 행을 렌더하는 로직 */}\n {rowModels.rows.map((row) => {\n return (\n <Row\n ExpandComp={ExpandComp}\n gridColTemp={gridColTemp}\n key={`row_${row.id}`}\n onRowClick={onRowClick}\n row={row}\n />\n );\n })}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAgB,SAAS,gBAAgB;AAuErB,cAOE,YAPF;AAhDb,SAAS,YACd,OACiB;AACjB,QAAM,EAAE,MAAM,SAAS,YAAY,aAAa,WAAW,IAAI;AAE/D,QAAM,CAAC,SAAS,UAAU,IAAI,SAAuB,CAAC,CAAC;AACvD,QAAM,EAAE,aAAa,gBAAgB,IAAI,cAAc;AAAA,IACrD,MAAM,QAAQ,CAAC;AAAA,IACf;AAAA,IACA,iBAAiB,gBAAgB;AAAA,IACjC,mBAAmB,kBAAkB;AAAA,IACrC,OAAO;AAAA,MACL;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,EACnB,CAAC;AAED,QAAM,cAAc,QAAgB,MAAM;AACxC,WAAO,QACJ,IAAI,CAAC,QAAQ;AAnDpB;AAoDQ,WAAI,SAAI,SAAJ,mBAAU;AAAU,eAAO;AAC/B,aAAO,GAAG,IAAI,QAAQ,GAAG;AAAA,IAC3B,CAAC,EACA,KAAK,GAAG;AAAA,EACb,GAAG,CAAC,OAAO,CAAC;AAEZ,QAAM,YAAY,YAAY;AAE9B,SACE,qBAAC,S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,CAAC,QAAQ;AAC3B,eACE;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YAEA;AAAA,YACA;AAAA;AAAA,UAFK,OAAO,IAAI,EAAE;AAAA,QAGpB;AAAA,MAEJ,CAAC;AAAA,OACH;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Flex
|
|
3
|
+
} from "./chunk-25HMMI7R.js";
|
|
4
|
+
import {
|
|
5
|
+
Typo
|
|
6
|
+
} from "./chunk-O3XTRD7R.js";
|
|
7
|
+
import {
|
|
8
|
+
Button
|
|
9
|
+
} from "./chunk-AQX7DQLI.js";
|
|
10
|
+
|
|
11
|
+
// src/molecules/navigation.tsx
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
function Navigation({
|
|
14
|
+
items,
|
|
15
|
+
fontColor,
|
|
16
|
+
backgroundColor,
|
|
17
|
+
activeKey
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
Flex,
|
|
21
|
+
{
|
|
22
|
+
direction: "column",
|
|
23
|
+
gap: "4",
|
|
24
|
+
pr: "3",
|
|
25
|
+
style: {
|
|
26
|
+
color: fontColor || "var(--white-a12)",
|
|
27
|
+
backgroundColor: backgroundColor || "var(--black-a12)"
|
|
28
|
+
},
|
|
29
|
+
children: items == null ? void 0 : items.map((item) => {
|
|
30
|
+
const { key, title, icon, itemRender, onClick, children } = item;
|
|
31
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", onClick, children: [
|
|
32
|
+
itemRender ? itemRender(item) : /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "3", height: "36px", pl: "4", pr: "4", children: [
|
|
33
|
+
icon,
|
|
34
|
+
/* @__PURE__ */ jsx(Typo, { variant: "subtitle", children: title })
|
|
35
|
+
] }),
|
|
36
|
+
children == null ? void 0 : children.map((menu) => {
|
|
37
|
+
return menu.itemRender ? menu.itemRender(menu) : /* @__PURE__ */ jsx(
|
|
38
|
+
Button,
|
|
39
|
+
{
|
|
40
|
+
className: `tipp-navigation-button ${activeKey === menu.key ? "active" : ""}`,
|
|
41
|
+
ml: "6",
|
|
42
|
+
onClick: menu.onClick,
|
|
43
|
+
size: "large",
|
|
44
|
+
style: { color: "var(--white-a12)" },
|
|
45
|
+
children: menu.title
|
|
46
|
+
},
|
|
47
|
+
menu.key
|
|
48
|
+
);
|
|
49
|
+
})
|
|
50
|
+
] }, key);
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
Navigation
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=chunk-QOY42XM2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/navigation.tsx"],"sourcesContent":["import React from 'react';\nimport { Button, Flex, Typo } from '../atoms';\n\ninterface Item {\n itemRender?: (item: Item) => React.ReactNode;\n key: string;\n onClick?: () => void;\n title: string;\n icon?: React.ReactNode;\n children?: Item[];\n}\n\nexport interface NavigationProps {\n items?: Item[];\n fontColor?: string;\n backgroundColor?: string;\n activeKey?: string;\n}\n\nexport function Navigation({\n items,\n fontColor,\n backgroundColor,\n activeKey,\n}: NavigationProps): React.ReactNode {\n return (\n <Flex\n direction=\"column\"\n gap=\"4\"\n pr=\"3\"\n style={{\n color: fontColor || 'var(--white-a12)',\n backgroundColor: backgroundColor || 'var(--black-a12)',\n }}\n >\n {items?.map((item) => {\n const { key, title, icon, itemRender, onClick, children } = item;\n return (\n <Flex direction=\"column\" key={key} onClick={onClick}>\n {itemRender ? (\n itemRender(item)\n ) : (\n <Flex align=\"center\" gap=\"3\" height=\"36px\" pl=\"4\" pr=\"4\">\n {icon}\n <Typo variant=\"subtitle\">{title}</Typo>\n </Flex>\n )}\n {children?.map((menu) => {\n return menu.itemRender ? (\n menu.itemRender(menu)\n ) : (\n <Button\n className={`tipp-navigation-button ${activeKey === menu.key ? 'active' : ''}`}\n key={menu.key}\n ml=\"6\"\n onClick={menu.onClick}\n size=\"large\"\n style={{ color: 'var(--white-a12)' }}\n >\n {menu.title}\n </Button>\n );\n })}\n </Flex>\n );\n })}\n </Flex>\n );\n}\n"],"mappings":";;;;;;;;;;;AA0Cc,SAEE,KAFF;AAvBP,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAqC;AACnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,KAAI;AAAA,MACJ,IAAG;AAAA,MACH,OAAO;AAAA,QACL,OAAO,aAAa;AAAA,QACpB,iBAAiB,mBAAmB;AAAA,MACtC;AAAA,MAEC,yCAAO,IAAI,CAAC,SAAS;AACpB,cAAM,EAAE,KAAK,OAAO,MAAM,YAAY,SAAS,SAAS,IAAI;AAC5D,eACE,qBAAC,QAAK,WAAU,UAAmB,SAChC;AAAA,uBACC,WAAW,IAAI,IAEf,qBAAC,QAAK,OAAM,UAAS,KAAI,KAAI,QAAO,QAAO,IAAG,KAAI,IAAG,KAClD;AAAA;AAAA,YACD,oBAAC,QAAK,SAAQ,YAAY,iBAAM;AAAA,aAClC;AAAA,UAED,qCAAU,IAAI,CAAC,SAAS;AACvB,mBAAO,KAAK,aACV,KAAK,WAAW,IAAI,IAEpB;AAAA,cAAC;AAAA;AAAA,gBACC,WAAW,0BAA0B,cAAc,KAAK,MAAM,WAAW,EAAE;AAAA,gBAE3E,IAAG;AAAA,gBACH,SAAS,KAAK;AAAA,gBACd,MAAK;AAAA,gBACL,OAAO,EAAE,OAAO,mBAAmB;AAAA,gBAElC,eAAK;AAAA;AAAA,cAND,KAAK;AAAA,YAOZ;AAAA,UAEJ;AAAA,aAxB4B,GAyB9B;AAAA,MAEJ;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Flex
|
|
3
|
+
} from "./chunk-25HMMI7R.js";
|
|
4
|
+
import {
|
|
5
|
+
IconButton
|
|
6
|
+
} from "./chunk-O3DNDMV3.js";
|
|
7
|
+
import {
|
|
8
|
+
Typo
|
|
9
|
+
} from "./chunk-O3XTRD7R.js";
|
|
10
|
+
import {
|
|
11
|
+
ChevronLeftIcon,
|
|
12
|
+
ChevronRightIcon
|
|
13
|
+
} from "./chunk-EK4ZFDYD.js";
|
|
14
|
+
import {
|
|
15
|
+
__spreadProps,
|
|
16
|
+
__spreadValues
|
|
17
|
+
} from "./chunk-N552FDTV.js";
|
|
18
|
+
|
|
19
|
+
// src/atoms/pagination.tsx
|
|
20
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
21
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
function Pagination(props) {
|
|
23
|
+
const { onChange, count = 0 } = props;
|
|
24
|
+
const siblingCount = 2;
|
|
25
|
+
const [page, setPage] = useState(() => props.page || props.defaultPage || 1);
|
|
26
|
+
const visibleItems = useMemo(() => {
|
|
27
|
+
let start = Math.max(1, page - siblingCount);
|
|
28
|
+
let end = Math.min(count, page + siblingCount);
|
|
29
|
+
if (page - siblingCount <= 0 && end < count) {
|
|
30
|
+
end = Math.min(count, end + Math.abs(page - siblingCount) + 1);
|
|
31
|
+
} else if (page + siblingCount > count && start > 1) {
|
|
32
|
+
start = Math.max(1, start - (page + siblingCount - count));
|
|
33
|
+
}
|
|
34
|
+
return Array.from({ length: end - start + 1 }, (_, i) => i + start);
|
|
35
|
+
}, [count, page]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
onChange == null ? void 0 : onChange(page);
|
|
38
|
+
}, [onChange, page]);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (props.page) {
|
|
41
|
+
setPage(props.page);
|
|
42
|
+
}
|
|
43
|
+
}, [props.page]);
|
|
44
|
+
const onClickPrev = useCallback(() => {
|
|
45
|
+
setPage((prev) => Math.max(1, prev - 1));
|
|
46
|
+
}, []);
|
|
47
|
+
const onClickNext = useCallback(() => {
|
|
48
|
+
setPage((prev) => Math.min(count, prev + 1));
|
|
49
|
+
}, [count]);
|
|
50
|
+
const moveButtonProps = {
|
|
51
|
+
variant: "ghost",
|
|
52
|
+
size: "3",
|
|
53
|
+
style: { borderRadius: "50%" }
|
|
54
|
+
};
|
|
55
|
+
const iconSize = {
|
|
56
|
+
height: 24,
|
|
57
|
+
width: 24
|
|
58
|
+
};
|
|
59
|
+
const prevDisabled = useMemo(() => {
|
|
60
|
+
return page - siblingCount <= 1;
|
|
61
|
+
}, [page]);
|
|
62
|
+
const nextDisabled = useMemo(() => {
|
|
63
|
+
return page + siblingCount >= count;
|
|
64
|
+
}, [count, page]);
|
|
65
|
+
return /* @__PURE__ */ jsxs(Flex, { align: "center", className: "tipp-pagination", gap: "4", children: [
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
IconButton,
|
|
68
|
+
__spreadProps(__spreadValues({
|
|
69
|
+
disabled: prevDisabled,
|
|
70
|
+
onClick: onClickPrev
|
|
71
|
+
}, moveButtonProps), {
|
|
72
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, __spreadValues({}, iconSize))
|
|
73
|
+
})
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ jsx(Flex, { gap: "1", children: visibleItems.map((item) => {
|
|
76
|
+
return /* @__PURE__ */ jsx(
|
|
77
|
+
"button",
|
|
78
|
+
{
|
|
79
|
+
className: `page-button ${item === page ? "active" : ""}`,
|
|
80
|
+
onClick: () => {
|
|
81
|
+
setPage(item);
|
|
82
|
+
},
|
|
83
|
+
type: "button",
|
|
84
|
+
children: /* @__PURE__ */ jsx(Typo, { variant: "body", children: item })
|
|
85
|
+
},
|
|
86
|
+
item
|
|
87
|
+
);
|
|
88
|
+
}) }),
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
IconButton,
|
|
91
|
+
__spreadProps(__spreadValues({
|
|
92
|
+
disabled: nextDisabled,
|
|
93
|
+
onClick: onClickNext
|
|
94
|
+
}, moveButtonProps), {
|
|
95
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, __spreadValues({}, iconSize))
|
|
96
|
+
})
|
|
97
|
+
)
|
|
98
|
+
] });
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export {
|
|
102
|
+
Pagination
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=chunk-R6PYUH56.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/pagination.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { ChevronLeftIcon, ChevronRightIcon } from '../icon';\nimport type { IconButtonProps } from './icon-button';\nimport { IconButton } from './icon-button';\nimport { Flex } from './flex';\nimport { Typo } from './typo';\n\nexport interface PaginationProps {\n /** 현재 선택된 페이지 */\n page?: number;\n /** 기본 선택 페이지, page보다 낮은 우선 순위를 갖는다 */\n defaultPage?: number;\n /** 선택한 페이지 변경 이벤트 cb */\n onChange?: (page: number) => void;\n /** 전체 페이지의 수 */\n count?: number;\n}\n\nexport function Pagination(props: PaginationProps): React.ReactNode {\n const { onChange, count = 0 } = props;\n const siblingCount = 2;\n\n const [page, setPage] = useState(() => props.page || props.defaultPage || 1);\n\n const visibleItems = useMemo(() => {\n let start = Math.max(1, page - siblingCount);\n let end = Math.min(count, page + siblingCount);\n if (page - siblingCount <= 0 && end < count) {\n end = Math.min(count, end + Math.abs(page - siblingCount) + 1);\n } else if (page + siblingCount > count && start > 1) {\n start = Math.max(1, start - (page + siblingCount - count));\n }\n\n return Array.from({ length: end - start + 1 }, (_, i) => i + start);\n }, [count, page]);\n\n useEffect(() => {\n onChange?.(page);\n }, [onChange, page]);\n\n useEffect(() => {\n if (props.page) {\n setPage(props.page);\n }\n }, [props.page]);\n\n const onClickPrev = useCallback(() => {\n setPage((prev) => Math.max(1, prev - 1));\n }, []);\n\n const onClickNext = useCallback(() => {\n setPage((prev) => Math.min(count, prev + 1));\n }, [count]);\n\n const moveButtonProps: IconButtonProps = {\n variant: 'ghost',\n size: '3',\n style: { borderRadius: '50%' },\n };\n\n const iconSize = {\n height: 24,\n width: 24,\n };\n\n const prevDisabled = useMemo(() => {\n return page - siblingCount <= 1;\n }, [page]);\n\n const nextDisabled = useMemo(() => {\n return page + siblingCount >= count;\n }, [count, page]);\n\n return (\n <Flex align=\"center\" className=\"tipp-pagination\" gap=\"4\">\n <IconButton\n disabled={prevDisabled}\n onClick={onClickPrev}\n {...moveButtonProps}\n >\n <ChevronLeftIcon {...iconSize} />\n </IconButton>\n <Flex gap=\"1\">\n {visibleItems.map((item) => {\n return (\n <button\n className={`page-button ${item === page ? 'active' : ''}`}\n key={item}\n onClick={() => {\n setPage(item);\n }}\n type=\"button\"\n >\n <Typo variant=\"body\">{item}</Typo>\n </button>\n );\n })}\n </Flex>\n <IconButton\n disabled={nextDisabled}\n onClick={onClickNext}\n {...moveButtonProps}\n >\n <ChevronRightIcon {...iconSize} />\n </IconButton>\n </Flex>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,SAAgB,aAAa,WAAW,SAAS,gBAAgB;AA0E7D,SAMI,KANJ;AAxDG,SAAS,WAAW,OAAyC;AAClE,QAAM,EAAE,UAAU,QAAQ,EAAE,IAAI;AAChC,QAAM,eAAe;AAErB,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,MAAM,MAAM,QAAQ,MAAM,eAAe,CAAC;AAE3E,QAAM,eAAe,QAAQ,MAAM;AACjC,QAAI,QAAQ,KAAK,IAAI,GAAG,OAAO,YAAY;AAC3C,QAAI,MAAM,KAAK,IAAI,OAAO,OAAO,YAAY;AAC7C,QAAI,OAAO,gBAAgB,KAAK,MAAM,OAAO;AAC3C,YAAM,KAAK,IAAI,OAAO,MAAM,KAAK,IAAI,OAAO,YAAY,IAAI,CAAC;AAAA,IAC/D,WAAW,OAAO,eAAe,SAAS,QAAQ,GAAG;AACnD,cAAQ,KAAK,IAAI,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AC1B,aACE;AAAA,QAAC;AAAA;AAAA,UACC,WAAW,eAAe,SAAS,OAAO,WAAW,EAAE;AAAA,UAEvD,SAAS,MAAM;AACb,oBAAQ,IAAI;AAAA,UACd;AAAA,UACA,MAAK;AAAA,UAEL,8BAAC,QAAK,SAAQ,QAAQ,gBAAK;AAAA;AAAA,QANtB;AAAA,MAOP;AAAA,IAEJ,CAAC,GACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV,SAAS;AAAA,SACL,kBAHL;AAAA,QAKC,8BAAC,qCAAqB,SAAU;AAAA;AAAA,IAClC;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// src/charts/vertical-bar-chart.tsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
function VerticalBarChart(props) {
|
|
4
|
+
const { total, value, backgroundColor, barColor, height } = props;
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
className: "tipp_vertical-bar-chart bar-wrapper",
|
|
9
|
+
style: { height, backgroundColor },
|
|
10
|
+
children: /* @__PURE__ */ jsx("div", { style: { width: `${value / total}%`, height }, children: /* @__PURE__ */ jsx(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: "tipp_vertical-bar-chart bar",
|
|
14
|
+
style: { backgroundColor: barColor }
|
|
15
|
+
}
|
|
16
|
+
) })
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
VerticalBarChart
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=chunk-SDAJ6NLJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/vertical-bar-chart.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface VerticalBarChartProps {\n /** 100% 바가 뜻하는 전체 값 */\n total: number;\n /** 화면에 채워져보이는 값 */\n value: number;\n /** 배경 색상 */\n backgroundColor?: string;\n /** 바의 색상 */\n barColor?: string;\n /** 바의 높이 */\n height?: number;\n}\n\nexport function VerticalBarChart(\n props: VerticalBarChartProps\n): React.ReactNode {\n const { total, value, backgroundColor, barColor, height } = props;\n return (\n <div\n className=\"tipp_vertical-bar-chart bar-wrapper\"\n style={{ height, backgroundColor }}\n >\n <div style={{ width: `${value / total}%`, height }}>\n <div\n className=\"tipp_vertical-bar-chart bar\"\n style={{ backgroundColor: barColor }}\n />\n </div>\n </div>\n );\n}\n"],"mappings":";AAyBQ;AAVD,SAAS,iBACd,OACiB;AACjB,QAAM,EAAE,OAAO,OAAO,iBAAiB,UAAU,OAAO,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,EAAE,QAAQ,gBAAgB;AAAA,MAEjC,8BAAC,SAAI,OAAO,EAAE,OAAO,GAAG,QAAQ,KAAK,KAAK,OAAO,GAC/C;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAO,EAAE,iBAAiB,SAAS;AAAA;AAAA,MACrC,GACF;AAAA;AAAA,EACF;AAEJ;","names":[]}
|