@tipp/ui 1.6.27 → 1.6.28
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/app/index.cjs +1 -1
- package/dist/app/index.cjs.map +1 -1
- package/dist/app/index.js +47 -47
- package/dist/app/platform/coach-question-list.cjs.map +1 -1
- package/dist/app/platform/coach-question-list.js +30 -30
- package/dist/app/platform/contents-card.cjs.map +1 -1
- package/dist/app/platform/contents-card.js +30 -30
- package/dist/app/platform/curriculum-card.js +5 -5
- package/dist/app/platform/edit-coaching-time.cjs +1 -1
- package/dist/app/platform/edit-coaching-time.cjs.map +1 -1
- package/dist/app/platform/edit-coaching-time.js +34 -34
- package/dist/app/platform/edit-service-type.cjs +1 -1
- package/dist/app/platform/edit-service-type.cjs.map +1 -1
- package/dist/app/platform/edit-service-type.js +34 -34
- package/dist/app/platform/goal-manage-card-edit.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-edit.js +34 -34
- package/dist/app/platform/goal-manage-card-read.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-read.js +30 -30
- package/dist/app/platform/on-offline-radio-card.cjs.map +1 -1
- package/dist/app/platform/on-offline-radio-card.js +33 -33
- package/dist/app/platform/report-card.cjs.map +1 -1
- package/dist/app/platform/report-card.js +30 -30
- package/dist/app/platform/reservation-card.cjs.map +1 -1
- package/dist/app/platform/reservation-card.js +34 -34
- package/dist/app/platform/session-card.cjs +1 -1
- package/dist/app/platform/session-card.cjs.map +1 -1
- package/dist/app/platform/session-card.js +36 -36
- package/dist/app/platform/session-review-simple-read.cjs.map +1 -1
- package/dist/app/platform/session-review-simple-read.js +30 -30
- package/dist/app/platform/userInfos/coaching-customer-info/index.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/index.js +32 -32
- package/dist/app/platform/userInfos/coaching-customer-info/large.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/large.js +30 -30
- package/dist/app/platform/userInfos/coaching-customer-info/medium.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/medium.js +30 -30
- package/dist/app/platform/userInfos/coaching-customer-info/small.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/small.js +29 -29
- package/dist/app/platform/userInfos/session-user-info-detail.cjs.map +1 -1
- package/dist/app/platform/userInfos/session-user-info-detail.js +29 -29
- package/dist/app/platform/userInfos/utils.cjs.map +1 -1
- package/dist/app/platform/userInfos/utils.js +29 -29
- package/dist/atoms/dialog.cjs +1 -1
- package/dist/atoms/dialog.cjs.map +1 -1
- package/dist/atoms/dialog.js +1 -1
- package/dist/atoms/index.cjs +1 -1
- package/dist/atoms/index.cjs.map +1 -1
- package/dist/atoms/index.js +65 -65
- package/dist/atoms/pagination.js +3 -3
- package/dist/charts/index.js +3 -3
- package/dist/chunk-5L3GY3OV.js +106 -0
- package/dist/chunk-5L3GY3OV.js.map +1 -0
- package/dist/chunk-B3TMWAJI.js +145 -0
- package/dist/chunk-B3TMWAJI.js.map +1 -0
- package/dist/chunk-B6JJT4VK.js +174 -0
- package/dist/chunk-B6JJT4VK.js.map +1 -0
- package/dist/chunk-DDXBIVPL.js +54 -0
- package/dist/chunk-DDXBIVPL.js.map +1 -0
- package/dist/chunk-ME5XT4JY.js +145 -0
- package/dist/chunk-ME5XT4JY.js.map +1 -0
- package/dist/icon.js +9 -9
- package/dist/icons/index.js +9 -9
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +97 -97
- package/dist/molecules/date-picker/date-picker-button.cjs.map +1 -1
- package/dist/molecules/date-picker/date-picker-button.js +29 -29
- package/dist/molecules/date-picker/index.js +3 -3
- package/dist/molecules/expand-table/index.cjs.map +1 -1
- package/dist/molecules/expand-table/index.js +30 -30
- package/dist/molecules/expand-table/row.cjs.map +1 -1
- package/dist/molecules/expand-table/row.js +29 -29
- package/dist/molecules/index.cjs.map +1 -1
- package/dist/molecules/index.js +33 -33
- package/dist/molecules/learning-post.js +2 -2
- package/dist/molecules/navigation.cjs.map +1 -1
- package/dist/molecules/navigation.js +29 -29
- package/dist/molecules/radio-button-card.cjs.map +1 -1
- package/dist/molecules/radio-button-card.js +29 -29
- package/dist/molecules/stepper.js +5 -5
- package/dist/molecules/tag-selector.cjs.map +1 -1
- package/dist/molecules/tag-selector.js +30 -30
- package/dist/molecules/time-select.cjs.map +1 -1
- package/dist/molecules/time-select.js +29 -29
- package/package.json +1 -1
- package/src/atoms/dialog.tsx +1 -1
package/dist/atoms/index.js
CHANGED
|
@@ -3,6 +3,15 @@ import {
|
|
|
3
3
|
Form,
|
|
4
4
|
FormItem
|
|
5
5
|
} from "../chunk-4JBL5FRI.js";
|
|
6
|
+
import {
|
|
7
|
+
TabNav
|
|
8
|
+
} from "../chunk-YJ7ZFOYL.js";
|
|
9
|
+
import {
|
|
10
|
+
Tabs
|
|
11
|
+
} from "../chunk-5ZITU5L7.js";
|
|
12
|
+
import {
|
|
13
|
+
TextArea
|
|
14
|
+
} from "../chunk-EW6OPYEW.js";
|
|
6
15
|
import {
|
|
7
16
|
TextField
|
|
8
17
|
} from "../chunk-VOQU7ZOV.js";
|
|
@@ -10,6 +19,15 @@ import {
|
|
|
10
19
|
ToastContainer,
|
|
11
20
|
toast
|
|
12
21
|
} from "../chunk-CYYWMYE7.js";
|
|
22
|
+
import {
|
|
23
|
+
Section
|
|
24
|
+
} from "../chunk-MUNMDHRF.js";
|
|
25
|
+
import {
|
|
26
|
+
SegmentedControl
|
|
27
|
+
} from "../chunk-TVDKGMBI.js";
|
|
28
|
+
import {
|
|
29
|
+
Select
|
|
30
|
+
} from "../chunk-ZZYFULUQ.js";
|
|
13
31
|
import {
|
|
14
32
|
Skeleton
|
|
15
33
|
} from "../chunk-5H3YPCZK.js";
|
|
@@ -23,14 +41,14 @@ import {
|
|
|
23
41
|
Switch
|
|
24
42
|
} from "../chunk-OYM4XCHQ.js";
|
|
25
43
|
import {
|
|
26
|
-
|
|
27
|
-
} from "../chunk-
|
|
44
|
+
Pagination
|
|
45
|
+
} from "../chunk-DONK6DLV.js";
|
|
28
46
|
import {
|
|
29
|
-
|
|
30
|
-
} from "../chunk-
|
|
47
|
+
Popover
|
|
48
|
+
} from "../chunk-5AVBYDPB.js";
|
|
31
49
|
import {
|
|
32
|
-
|
|
33
|
-
} from "../chunk-
|
|
50
|
+
Progress
|
|
51
|
+
} from "../chunk-365QMK4D.js";
|
|
34
52
|
import {
|
|
35
53
|
Quote
|
|
36
54
|
} from "../chunk-YO3BQW6S.js";
|
|
@@ -47,14 +65,11 @@ import {
|
|
|
47
65
|
ScrollArea
|
|
48
66
|
} from "../chunk-MUPK4L3U.js";
|
|
49
67
|
import {
|
|
50
|
-
|
|
51
|
-
} from "../chunk-
|
|
52
|
-
import {
|
|
53
|
-
SegmentedControl
|
|
54
|
-
} from "../chunk-TVDKGMBI.js";
|
|
68
|
+
Grid
|
|
69
|
+
} from "../chunk-EGEQY3KT.js";
|
|
55
70
|
import {
|
|
56
|
-
|
|
57
|
-
} from "../chunk-
|
|
71
|
+
HoverCard
|
|
72
|
+
} from "../chunk-O3T3TM3V.js";
|
|
58
73
|
import {
|
|
59
74
|
Inset
|
|
60
75
|
} from "../chunk-XQOL7UBI.js";
|
|
@@ -65,14 +80,29 @@ import {
|
|
|
65
80
|
Link
|
|
66
81
|
} from "../chunk-SIM6HKVI.js";
|
|
67
82
|
import {
|
|
68
|
-
|
|
69
|
-
} from "../chunk-
|
|
83
|
+
DataList
|
|
84
|
+
} from "../chunk-VTJZMOSP.js";
|
|
70
85
|
import {
|
|
71
|
-
|
|
72
|
-
} from "../chunk-
|
|
86
|
+
Dialog
|
|
87
|
+
} from "../chunk-5L3GY3OV.js";
|
|
73
88
|
import {
|
|
74
|
-
|
|
75
|
-
} from "../chunk-
|
|
89
|
+
Heading
|
|
90
|
+
} from "../chunk-HJB3AASV.js";
|
|
91
|
+
import "../chunk-LDBWASUA.js";
|
|
92
|
+
import {
|
|
93
|
+
Content,
|
|
94
|
+
Drawer,
|
|
95
|
+
Root,
|
|
96
|
+
Trigger
|
|
97
|
+
} from "../chunk-57F5B7FE.js";
|
|
98
|
+
import "../chunk-UNTA4JJU.js";
|
|
99
|
+
import {
|
|
100
|
+
Separator
|
|
101
|
+
} from "../chunk-HYITAA4J.js";
|
|
102
|
+
import "../chunk-TD45ZF7D.js";
|
|
103
|
+
import {
|
|
104
|
+
IconButton
|
|
105
|
+
} from "../chunk-O3DNDMV3.js";
|
|
76
106
|
import {
|
|
77
107
|
DropdownMenu
|
|
78
108
|
} from "../chunk-4WFMOFN2.js";
|
|
@@ -89,11 +119,14 @@ import {
|
|
|
89
119
|
FieldErrorWrapper
|
|
90
120
|
} from "../chunk-QDZS4B6A.js";
|
|
91
121
|
import {
|
|
92
|
-
|
|
93
|
-
} from "../chunk-
|
|
122
|
+
Callout
|
|
123
|
+
} from "../chunk-B6XJN6EC.js";
|
|
94
124
|
import {
|
|
95
|
-
|
|
96
|
-
} from "../chunk-
|
|
125
|
+
Card
|
|
126
|
+
} from "../chunk-2ZQK7NTN.js";
|
|
127
|
+
import {
|
|
128
|
+
CheckboxCards
|
|
129
|
+
} from "../chunk-MIMJ7LON.js";
|
|
97
130
|
import {
|
|
98
131
|
CheckboxGroup
|
|
99
132
|
} from "../chunk-JBD6YTS2.js";
|
|
@@ -110,29 +143,14 @@ import {
|
|
|
110
143
|
Container
|
|
111
144
|
} from "../chunk-Q37G2GS6.js";
|
|
112
145
|
import {
|
|
113
|
-
|
|
114
|
-
} from "../chunk-
|
|
115
|
-
import {
|
|
116
|
-
Dialog
|
|
117
|
-
} from "../chunk-L75KKLZS.js";
|
|
118
|
-
import {
|
|
119
|
-
Heading
|
|
120
|
-
} from "../chunk-HJB3AASV.js";
|
|
121
|
-
import "../chunk-LDBWASUA.js";
|
|
122
|
-
import {
|
|
123
|
-
Content,
|
|
124
|
-
Drawer,
|
|
125
|
-
Root,
|
|
126
|
-
Trigger
|
|
127
|
-
} from "../chunk-57F5B7FE.js";
|
|
128
|
-
import "../chunk-UNTA4JJU.js";
|
|
146
|
+
AutoSizingInput
|
|
147
|
+
} from "../chunk-YJCCE5WP.js";
|
|
129
148
|
import {
|
|
130
|
-
|
|
131
|
-
} from "../chunk-
|
|
132
|
-
import "../chunk-TD45ZF7D.js";
|
|
149
|
+
Avatar
|
|
150
|
+
} from "../chunk-JYJA2PMG.js";
|
|
133
151
|
import {
|
|
134
|
-
|
|
135
|
-
} from "../chunk-
|
|
152
|
+
Badge
|
|
153
|
+
} from "../chunk-EWD4AO5N.js";
|
|
136
154
|
import {
|
|
137
155
|
Blockquote
|
|
138
156
|
} from "../chunk-YGL6SWKN.js";
|
|
@@ -153,39 +171,21 @@ import {
|
|
|
153
171
|
} from "../chunk-Q5AFRGVP.js";
|
|
154
172
|
import "../chunk-LQY4RKWI.js";
|
|
155
173
|
import "../chunk-ZD7MNMED.js";
|
|
156
|
-
import {
|
|
157
|
-
Callout
|
|
158
|
-
} from "../chunk-B6XJN6EC.js";
|
|
159
|
-
import {
|
|
160
|
-
Card
|
|
161
|
-
} from "../chunk-2ZQK7NTN.js";
|
|
162
|
-
import {
|
|
163
|
-
CheckboxCards
|
|
164
|
-
} from "../chunk-MIMJ7LON.js";
|
|
165
174
|
import "../chunk-HLFG5ZTU.js";
|
|
166
175
|
import "../chunk-7WVKYXIG.js";
|
|
176
|
+
import "../chunk-NDUKDKGB.js";
|
|
177
|
+
import "../chunk-T6CF4F7J.js";
|
|
178
|
+
import "../chunk-A75U32HT.js";
|
|
167
179
|
import "../chunk-BSTJBBEX.js";
|
|
168
180
|
import "../chunk-3WSZRTAF.js";
|
|
169
181
|
import "../chunk-UZMOWHC3.js";
|
|
170
182
|
import "../chunk-UFYNSPJQ.js";
|
|
171
|
-
import "../chunk-NDUKDKGB.js";
|
|
172
|
-
import "../chunk-T6CF4F7J.js";
|
|
173
|
-
import "../chunk-A75U32HT.js";
|
|
174
183
|
import {
|
|
175
184
|
AlertDialog
|
|
176
185
|
} from "../chunk-J242TTFH.js";
|
|
177
186
|
import {
|
|
178
187
|
AspectRatio
|
|
179
188
|
} from "../chunk-EAXUQEO5.js";
|
|
180
|
-
import {
|
|
181
|
-
AutoSizingInput
|
|
182
|
-
} from "../chunk-YJCCE5WP.js";
|
|
183
|
-
import {
|
|
184
|
-
Avatar
|
|
185
|
-
} from "../chunk-JYJA2PMG.js";
|
|
186
|
-
import {
|
|
187
|
-
Badge
|
|
188
|
-
} from "../chunk-EWD4AO5N.js";
|
|
189
189
|
import "../chunk-N552FDTV.js";
|
|
190
190
|
export {
|
|
191
191
|
AlertDialog,
|
package/dist/atoms/pagination.js
CHANGED
|
@@ -6,13 +6,13 @@ import "../chunk-52MVZ6AN.js";
|
|
|
6
6
|
import "../chunk-25HMMI7R.js";
|
|
7
7
|
import "../chunk-HLFG5ZTU.js";
|
|
8
8
|
import "../chunk-7WVKYXIG.js";
|
|
9
|
+
import "../chunk-NDUKDKGB.js";
|
|
10
|
+
import "../chunk-T6CF4F7J.js";
|
|
11
|
+
import "../chunk-A75U32HT.js";
|
|
9
12
|
import "../chunk-BSTJBBEX.js";
|
|
10
13
|
import "../chunk-3WSZRTAF.js";
|
|
11
14
|
import "../chunk-UZMOWHC3.js";
|
|
12
15
|
import "../chunk-UFYNSPJQ.js";
|
|
13
|
-
import "../chunk-NDUKDKGB.js";
|
|
14
|
-
import "../chunk-T6CF4F7J.js";
|
|
15
|
-
import "../chunk-A75U32HT.js";
|
|
16
16
|
import "../chunk-N552FDTV.js";
|
|
17
17
|
export {
|
|
18
18
|
Pagination
|
package/dist/charts/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../chunk-PSINRHYW.js";
|
|
2
|
-
import {
|
|
3
|
-
HorizontalBarChart
|
|
4
|
-
} from "../chunk-SGMO4KBC.js";
|
|
5
2
|
import {
|
|
6
3
|
EchartDefaultProps
|
|
7
4
|
} from "../chunk-2QFSCWES.js";
|
|
5
|
+
import {
|
|
6
|
+
HorizontalBarChart
|
|
7
|
+
} from "../chunk-SGMO4KBC.js";
|
|
8
8
|
import "../chunk-N552FDTV.js";
|
|
9
9
|
export {
|
|
10
10
|
EchartDefaultProps,
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Heading
|
|
3
|
+
} from "./chunk-HJB3AASV.js";
|
|
4
|
+
import {
|
|
5
|
+
usePortalContainer
|
|
6
|
+
} from "./chunk-TD45ZF7D.js";
|
|
7
|
+
import {
|
|
8
|
+
IconButton
|
|
9
|
+
} from "./chunk-O3DNDMV3.js";
|
|
10
|
+
import {
|
|
11
|
+
__objRest,
|
|
12
|
+
__spreadProps,
|
|
13
|
+
__spreadValues
|
|
14
|
+
} from "./chunk-N552FDTV.js";
|
|
15
|
+
|
|
16
|
+
// src/atoms/dialog.tsx
|
|
17
|
+
import * as RadixDialog from "@radix-ui/react-dialog";
|
|
18
|
+
import { Cross1Icon } from "@radix-ui/react-icons";
|
|
19
|
+
import { Flex, Theme } from "@radix-ui/themes";
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
var preventDefault = (e) => {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
};
|
|
24
|
+
function Content2(props) {
|
|
25
|
+
const _a = props, {
|
|
26
|
+
children,
|
|
27
|
+
style = {},
|
|
28
|
+
width,
|
|
29
|
+
maxWidth,
|
|
30
|
+
minWidth,
|
|
31
|
+
maxHeight,
|
|
32
|
+
height,
|
|
33
|
+
minHeight,
|
|
34
|
+
title,
|
|
35
|
+
buttons,
|
|
36
|
+
hideCloseButton,
|
|
37
|
+
className
|
|
38
|
+
} = _a, rest = __objRest(_a, [
|
|
39
|
+
"children",
|
|
40
|
+
"style",
|
|
41
|
+
"width",
|
|
42
|
+
"maxWidth",
|
|
43
|
+
"minWidth",
|
|
44
|
+
"maxHeight",
|
|
45
|
+
"height",
|
|
46
|
+
"minHeight",
|
|
47
|
+
"title",
|
|
48
|
+
"buttons",
|
|
49
|
+
"hideCloseButton",
|
|
50
|
+
"className"
|
|
51
|
+
]);
|
|
52
|
+
const { dialogContainerRef } = usePortalContainer();
|
|
53
|
+
return /* @__PURE__ */ jsx(RadixDialog.Portal, { container: dialogContainerRef.current, children: /* @__PURE__ */ jsx(Theme, { asChild: true, children: /* @__PURE__ */ jsx(RadixDialog.Overlay, { className: "DialogOverlay", children: /* @__PURE__ */ jsxs(
|
|
54
|
+
RadixDialog.Content,
|
|
55
|
+
__spreadProps(__spreadValues({
|
|
56
|
+
className: `DialogContent ${className || ""}`,
|
|
57
|
+
onPointerDownOutside: preventDefault,
|
|
58
|
+
style: __spreadValues({
|
|
59
|
+
width,
|
|
60
|
+
maxWidth,
|
|
61
|
+
minWidth,
|
|
62
|
+
maxHeight,
|
|
63
|
+
height,
|
|
64
|
+
minHeight
|
|
65
|
+
}, style)
|
|
66
|
+
}, rest), {
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "2", justify: "between", width: "100%", children: [
|
|
69
|
+
/* @__PURE__ */ jsx(RadixDialog.Title, { asChild: true, children: typeof title === "string" ? /* @__PURE__ */ jsx(Heading, { mb: "2", variant: "heading3", children: title }) : title }),
|
|
70
|
+
!hideCloseButton && /* @__PURE__ */ jsx(RadixDialog.Close, { asChild: true, className: "DialogClose", children: /* @__PURE__ */ jsx(IconButton, { color: "gray", variant: "ghost", children: /* @__PURE__ */ jsx(Cross1Icon, {}) }) })
|
|
71
|
+
] }),
|
|
72
|
+
children,
|
|
73
|
+
buttons ? /* @__PURE__ */ jsx(Flex, { gap: "3", justify: "end", mt: "3", width: "100%", children: buttons }) : null
|
|
74
|
+
]
|
|
75
|
+
})
|
|
76
|
+
) }) }) });
|
|
77
|
+
}
|
|
78
|
+
function Close2(_a) {
|
|
79
|
+
var _b = _a, {
|
|
80
|
+
children
|
|
81
|
+
} = _b, rest = __objRest(_b, [
|
|
82
|
+
"children"
|
|
83
|
+
]);
|
|
84
|
+
return /* @__PURE__ */ jsx(RadixDialog.Close, __spreadProps(__spreadValues({ asChild: true }, rest), { children }));
|
|
85
|
+
}
|
|
86
|
+
function Trigger2(_a) {
|
|
87
|
+
var _b = _a, {
|
|
88
|
+
children
|
|
89
|
+
} = _b, rest = __objRest(_b, [
|
|
90
|
+
"children"
|
|
91
|
+
]);
|
|
92
|
+
return /* @__PURE__ */ jsx(RadixDialog.Trigger, __spreadProps(__spreadValues({ asChild: true }, rest), { children }));
|
|
93
|
+
}
|
|
94
|
+
var Dialog = {
|
|
95
|
+
Root: RadixDialog.Root,
|
|
96
|
+
Trigger: Trigger2,
|
|
97
|
+
Content: Content2,
|
|
98
|
+
Close: Close2,
|
|
99
|
+
Description: RadixDialog.Description,
|
|
100
|
+
Title: RadixDialog.Title
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
Dialog
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=chunk-5L3GY3OV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/dialog.tsx"],"sourcesContent":["import * as RadixDialog from '@radix-ui/react-dialog';\nimport { Cross1Icon } from '@radix-ui/react-icons';\nimport { Flex, Theme } from '@radix-ui/themes';\nimport { usePortalContainer } from '@/theme/portal-provider';\nimport { Heading } from './heading';\nimport { IconButton } from './icon-button';\n\ntype ContentProps = RadixDialog.DialogContentProps & {\n width?: string;\n maxWidth?: string;\n minWidth?: string;\n height?: string;\n maxHeight?: string;\n minHeight?: string;\n title?: string;\n hideCloseButton?: boolean;\n buttons?: React.ReactElement;\n};\n\nconst preventDefault: RadixDialog.DialogContentProps['onPointerDownOutside'] = (\n e\n) => {\n e.preventDefault();\n};\n\nfunction Content(props: ContentProps): React.ReactElement {\n const {\n children,\n style = {},\n width,\n maxWidth,\n minWidth,\n maxHeight,\n height,\n minHeight,\n title,\n buttons,\n hideCloseButton,\n className,\n ...rest\n } = props;\n const { dialogContainerRef } = usePortalContainer();\n\n return (\n <RadixDialog.Portal container={dialogContainerRef.current}>\n <Theme asChild>\n <RadixDialog.Overlay className=\"DialogOverlay\">\n <RadixDialog.Content\n className={`DialogContent ${className || ''}`}\n onPointerDownOutside={preventDefault}\n style={{\n width,\n maxWidth,\n minWidth,\n maxHeight,\n height,\n minHeight,\n ...style,\n }}\n {...rest}\n >\n <Flex gap=\"2\" justify=\"between\" width=\"100%\">\n <RadixDialog.Title asChild>\n {typeof title === 'string' ? (\n <Heading mb=\"2\" variant=\"heading3\">\n {title}\n </Heading>\n ) : (\n title\n )}\n </RadixDialog.Title>\n {!hideCloseButton && (\n <RadixDialog.Close asChild className=\"DialogClose\">\n <IconButton color=\"gray\" variant=\"ghost\">\n <Cross1Icon />\n </IconButton>\n </RadixDialog.Close>\n )}\n </Flex>\n {children}\n {buttons ? (\n <Flex gap=\"3\" justify=\"end\" mt=\"3\" width=\"100%\">\n {buttons}\n </Flex>\n ) : null}\n </RadixDialog.Content>\n </RadixDialog.Overlay>\n </Theme>\n </RadixDialog.Portal>\n );\n}\n\nfunction Close({\n children,\n ...rest\n}: RadixDialog.DialogCloseProps): React.ReactElement {\n return (\n <RadixDialog.Close asChild {...rest}>\n {children}\n </RadixDialog.Close>\n );\n}\n\nfunction Trigger({\n children,\n ...rest\n}: RadixDialog.DialogTriggerProps): React.ReactElement {\n return (\n <RadixDialog.Trigger asChild {...rest}>\n {children}\n </RadixDialog.Trigger>\n );\n}\n\nexport const Dialog = {\n Root: RadixDialog.Root,\n Trigger,\n Content,\n Close,\n Description: RadixDialog.Description,\n Title: RadixDialog.Title,\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,YAAY,iBAAiB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,MAAM,aAAa;AA2DhB,SAGM,KAHN;AA1CZ,IAAM,iBAAyE,CAC7E,MACG;AACH,IAAE,eAAe;AACnB;AAEA,SAASA,SAAQ,OAAyC;AACxD,QAcI,YAbF;AAAA;AAAA,IACA,QAAQ,CAAC;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAtCJ,IAwCM,IADC,iBACD,IADC;AAAA,IAZH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGF,QAAM,EAAE,mBAAmB,IAAI,mBAAmB;AAElD,SACE,oBAAa,oBAAZ,EAAmB,WAAW,mBAAmB,SAChD,8BAAC,SAAM,SAAO,MACZ,8BAAa,qBAAZ,EAAoB,WAAU,iBAC7B;AAAA,IAAa;AAAA,IAAZ;AAAA,MACC,WAAW,iBAAiB,aAAa,EAAE;AAAA,MAC3C,sBAAsB;AAAA,MACtB,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,SACG;AAAA,OAED,OAZL;AAAA,MAcC;AAAA,6BAAC,QAAK,KAAI,KAAI,SAAQ,WAAU,OAAM,QACpC;AAAA,8BAAa,mBAAZ,EAAkB,SAAO,MACvB,iBAAO,UAAU,WAChB,oBAAC,WAAQ,IAAG,KAAI,SAAQ,YACrB,iBACH,IAEA,OAEJ;AAAA,UACC,CAAC,mBACA,oBAAa,mBAAZ,EAAkB,SAAO,MAAC,WAAU,eACnC,8BAAC,cAAW,OAAM,QAAO,SAAQ,SAC/B,8BAAC,cAAW,GACd,GACF;AAAA,WAEJ;AAAA,QACC;AAAA,QACA,UACC,oBAAC,QAAK,KAAI,KAAI,SAAQ,OAAM,IAAG,KAAI,OAAM,QACtC,mBACH,IACE;AAAA;AAAA;AAAA,EACN,GACF,GACF,GACF;AAEJ;AAEA,SAASC,OAAM,IAGsC;AAHtC,eACb;AAAA;AAAA,EA7FF,IA4Fe,IAEV,iBAFU,IAEV;AAAA,IADH;AAAA;AAGA,SACE,oBAAa,mBAAZ,+BAAkB,SAAO,QAAK,OAA9B,EACE,WACH;AAEJ;AAEA,SAASC,SAAQ,IAGsC;AAHtC,eACf;AAAA;AAAA,EAxGF,IAuGiB,IAEZ,iBAFY,IAEZ;AAAA,IADH;AAAA;AAGA,SACE,oBAAa,qBAAZ,+BAAoB,SAAO,QAAK,OAAhC,EACE,WACH;AAEJ;AAEO,IAAM,SAAS;AAAA,EACpB,MAAkB;AAAA,EAClB,SAAAA;AAAA,EACA,SAAAF;AAAA,EACA,OAAAC;AAAA,EACA,aAAyB;AAAA,EACzB,OAAmB;AACrB;","names":["Content","Close","Trigger"]}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EditCoachingTime
|
|
3
|
+
} from "./chunk-UAUXUQWQ.js";
|
|
4
|
+
import {
|
|
5
|
+
EditServiceType
|
|
6
|
+
} from "./chunk-7QGUMO7V.js";
|
|
7
|
+
import {
|
|
8
|
+
Grid
|
|
9
|
+
} from "./chunk-EGEQY3KT.js";
|
|
10
|
+
import {
|
|
11
|
+
DataList
|
|
12
|
+
} from "./chunk-VTJZMOSP.js";
|
|
13
|
+
import {
|
|
14
|
+
Dialog
|
|
15
|
+
} from "./chunk-L75KKLZS.js";
|
|
16
|
+
import {
|
|
17
|
+
Heading
|
|
18
|
+
} from "./chunk-HJB3AASV.js";
|
|
19
|
+
import {
|
|
20
|
+
Card
|
|
21
|
+
} from "./chunk-2ZQK7NTN.js";
|
|
22
|
+
import {
|
|
23
|
+
BulletText
|
|
24
|
+
} from "./chunk-NAL2USH5.js";
|
|
25
|
+
import {
|
|
26
|
+
Flex
|
|
27
|
+
} from "./chunk-25HMMI7R.js";
|
|
28
|
+
import {
|
|
29
|
+
Button
|
|
30
|
+
} from "./chunk-Q5AFRGVP.js";
|
|
31
|
+
import {
|
|
32
|
+
Pencil1Icon
|
|
33
|
+
} from "./chunk-HLFG5ZTU.js";
|
|
34
|
+
import {
|
|
35
|
+
__objRest,
|
|
36
|
+
__spreadProps,
|
|
37
|
+
__spreadValues
|
|
38
|
+
} from "./chunk-N552FDTV.js";
|
|
39
|
+
|
|
40
|
+
// src/app/platform/session-card.tsx
|
|
41
|
+
import { useCallback, useMemo } from "react";
|
|
42
|
+
import { format } from "date-fns";
|
|
43
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
44
|
+
var preventDefault = (e) => {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
};
|
|
47
|
+
function SessionCard(props) {
|
|
48
|
+
const _a = props, {
|
|
49
|
+
sessionNumber,
|
|
50
|
+
userName,
|
|
51
|
+
error,
|
|
52
|
+
ExtraButtons,
|
|
53
|
+
TitleExtra,
|
|
54
|
+
editable,
|
|
55
|
+
onSaveDate,
|
|
56
|
+
onSaveSessionType,
|
|
57
|
+
startAt,
|
|
58
|
+
endAt,
|
|
59
|
+
sessionType
|
|
60
|
+
} = _a, rest = __objRest(_a, [
|
|
61
|
+
"sessionNumber",
|
|
62
|
+
"userName",
|
|
63
|
+
"error",
|
|
64
|
+
"ExtraButtons",
|
|
65
|
+
"TitleExtra",
|
|
66
|
+
"editable",
|
|
67
|
+
"onSaveDate",
|
|
68
|
+
"onSaveSessionType",
|
|
69
|
+
"startAt",
|
|
70
|
+
"endAt",
|
|
71
|
+
"sessionType"
|
|
72
|
+
]);
|
|
73
|
+
const renderEditButton = useCallback(() => {
|
|
74
|
+
return /* @__PURE__ */ jsx(Button, { color: "gray", ml: "2", variant: "transparent", children: /* @__PURE__ */ jsx(Pencil1Icon, {}) });
|
|
75
|
+
}, []);
|
|
76
|
+
const sessionTimeStr = useMemo(() => {
|
|
77
|
+
if (!startAt || !endAt)
|
|
78
|
+
return "\uC54C \uC218 \uC5C6\uC74C";
|
|
79
|
+
return `${format(startAt, "yyyy\uB144 MM\uC6D4 dd\uC77C HH\uC2DC mm\uBD84")} ~ ${format(endAt, "HH\uC2DC mm\uBD84")}`;
|
|
80
|
+
}, [startAt, endAt]);
|
|
81
|
+
return /* @__PURE__ */ jsx(Card, __spreadProps(__spreadValues({ error: Boolean(error) }, rest), { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "3", children: [
|
|
82
|
+
/* @__PURE__ */ jsxs(Flex, { align: "center", width: "100%", children: [
|
|
83
|
+
/* @__PURE__ */ jsx(Heading, { variant: "heading4", children: `${userName || "\uC54C \uC218 \uC5C6\uC74C"}\uB2D8 ${sessionNumber || "-"}\uD68C\uCC28` }),
|
|
84
|
+
TitleExtra,
|
|
85
|
+
error ? /* @__PURE__ */ jsx(BulletText, { as: "p", color: "red", variant: "caption", children: error }) : null
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ jsxs(DataList.Root, { children: [
|
|
88
|
+
/* @__PURE__ */ jsxs(DataList.Item, { children: [
|
|
89
|
+
/* @__PURE__ */ jsx(DataList.Label, { children: "\uCF54\uCE6D \uC77C\uC2DC" }),
|
|
90
|
+
/* @__PURE__ */ jsxs(DataList.Value, { children: [
|
|
91
|
+
sessionTimeStr,
|
|
92
|
+
editable ? /* @__PURE__ */ jsxs(Dialog.Root, { children: [
|
|
93
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { children: renderEditButton() }),
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
Dialog.Content,
|
|
96
|
+
{
|
|
97
|
+
onOpenAutoFocus: preventDefault,
|
|
98
|
+
style: { overflow: "visible" },
|
|
99
|
+
title: `${sessionNumber}\uD68C\uCC28 \uC138\uC158 \uC77C\uC2DC \uBCC0\uACBD\uD558\uAE30`,
|
|
100
|
+
children: /* @__PURE__ */ jsx(
|
|
101
|
+
EditCoachingTime,
|
|
102
|
+
{
|
|
103
|
+
defaultEndAt: endAt,
|
|
104
|
+
defaultStartAt: startAt,
|
|
105
|
+
onClickSave: onSaveDate
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
] }) : null
|
|
111
|
+
] })
|
|
112
|
+
] }),
|
|
113
|
+
/* @__PURE__ */ jsxs(Grid, { columns: { initial: "1", xs: "2" }, style: { gap: "inherit" }, children: [
|
|
114
|
+
/* @__PURE__ */ jsxs(DataList.Item, { children: [
|
|
115
|
+
/* @__PURE__ */ jsx(DataList.Label, { children: "\uC138\uC158 \uCC38\uC5EC \uBC29\uC2DD" }),
|
|
116
|
+
/* @__PURE__ */ jsxs(DataList.Value, { children: [
|
|
117
|
+
sessionType === "offlineCoaching" ? "\uC624\uD504\uB77C\uC778" : "\uC628\uB77C\uC778",
|
|
118
|
+
editable ? /* @__PURE__ */ jsxs(Dialog.Root, { children: [
|
|
119
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { children: renderEditButton() }),
|
|
120
|
+
/* @__PURE__ */ jsx(
|
|
121
|
+
Dialog.Content,
|
|
122
|
+
{
|
|
123
|
+
title: `${sessionNumber}\uD68C\uCC28 \uC138\uC158 \uC9C4\uD589 \uBC29\uC2DD \uBCC0\uACBD\uD558\uAE30`,
|
|
124
|
+
children: /* @__PURE__ */ jsx(
|
|
125
|
+
EditServiceType,
|
|
126
|
+
{
|
|
127
|
+
defaultServiceType: sessionType,
|
|
128
|
+
onClickSave: onSaveSessionType
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
] }) : null
|
|
134
|
+
] })
|
|
135
|
+
] }),
|
|
136
|
+
/* @__PURE__ */ jsx(Flex, { gap: "2", justify: "end", children: ExtraButtons })
|
|
137
|
+
] })
|
|
138
|
+
] })
|
|
139
|
+
] }) }));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export {
|
|
143
|
+
SessionCard
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=chunk-B3TMWAJI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/app/platform/session-card.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from 'react';\nimport { format } from 'date-fns';\nimport type { ServiceType } from '@/types/biz.type';\nimport type { CardProps } from '../../atoms';\nimport {\n BulletText,\n Button,\n Card,\n DataList,\n Dialog,\n Flex,\n Grid,\n Heading,\n} from '../../atoms';\nimport { Pencil1Icon } from '../../icon';\nimport { EditCoachingTime } from './edit-coaching-time';\nimport { EditServiceType } from './edit-service-type';\n\nconst preventDefault = (e: Event): void => {\n e.preventDefault();\n};\nexport type SessionCardProps = Omit<CardProps, 'error'> & {\n error?: string;\n startAt?: Date;\n endAt?: Date;\n sessionType?: ServiceType;\n userName?: string;\n sessionNumber?: number;\n ExtraButtons?: React.ReactNode;\n editable?: boolean;\n TitleExtra?: React.ReactNode;\n onSaveDate?: (startTime: Date, endTime: Date) => void;\n onSaveSessionType?: (sessionType: string) => void;\n};\n\nexport function SessionCard(props: SessionCardProps): React.ReactElement {\n const {\n sessionNumber,\n userName,\n error,\n ExtraButtons,\n TitleExtra,\n editable,\n onSaveDate,\n onSaveSessionType,\n startAt,\n endAt,\n sessionType,\n ...rest\n } = props;\n\n const renderEditButton = useCallback((): JSX.Element => {\n return (\n <Button color=\"gray\" ml=\"2\" variant=\"transparent\">\n <Pencil1Icon />\n </Button>\n );\n }, []);\n\n const sessionTimeStr = useMemo(() => {\n if (!startAt || !endAt) return '알 수 없음';\n\n return `${format(startAt, 'yyyy년 MM월 dd일 HH시 mm분')} ~ ${format(endAt, 'HH시 mm분')}`;\n }, [startAt, endAt]);\n\n return (\n <Card error={Boolean(error)} {...rest}>\n <Flex direction=\"column\" gap=\"3\">\n <Flex align=\"center\" width=\"100%\">\n <Heading variant=\"heading4\">\n {`${userName || '알 수 없음'}님 ${sessionNumber || '-'}회차`}\n </Heading>\n {TitleExtra}\n {error ? (\n <BulletText as=\"p\" color=\"red\" variant=\"caption\">\n {error}\n </BulletText>\n ) : null}\n </Flex>\n <DataList.Root>\n <DataList.Item>\n <DataList.Label>코칭 일시</DataList.Label>\n <DataList.Value>\n {sessionTimeStr}\n {editable ? (\n <Dialog.Root>\n <Dialog.Trigger>{renderEditButton()}</Dialog.Trigger>\n <Dialog.Content\n onOpenAutoFocus={preventDefault}\n style={{ overflow: 'visible' }}\n title={`${sessionNumber}회차 세션 일시 변경하기`}\n >\n <EditCoachingTime\n defaultEndAt={endAt}\n defaultStartAt={startAt}\n onClickSave={onSaveDate}\n />\n </Dialog.Content>\n </Dialog.Root>\n ) : null}\n </DataList.Value>\n </DataList.Item>\n <Grid columns={{ initial: '1', xs: '2' }} style={{ gap: 'inherit' }}>\n <DataList.Item>\n <DataList.Label>세션 참여 방식</DataList.Label>\n <DataList.Value>\n {sessionType === 'offlineCoaching' ? '오프라인' : '온라인'}\n {editable ? (\n <Dialog.Root>\n <Dialog.Trigger>{renderEditButton()}</Dialog.Trigger>\n <Dialog.Content\n title={`${sessionNumber}회차 세션 진행 방식 변경하기`}\n >\n <EditServiceType\n defaultServiceType={sessionType}\n onClickSave={onSaveSessionType}\n />\n </Dialog.Content>\n </Dialog.Root>\n ) : null}\n </DataList.Value>\n </DataList.Item>\n\n <Flex gap=\"2\" justify=\"end\">\n {ExtraButtons}\n </Flex>\n </Grid>\n </DataList.Root>\n </Flex>\n </Card>\n );\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DatePickerButton
|
|
3
|
+
} from "./chunk-6ZAP57FO.js";
|
|
4
|
+
import {
|
|
5
|
+
TimeSelect
|
|
6
|
+
} from "./chunk-YPYQISJB.js";
|
|
7
|
+
import {
|
|
8
|
+
getTimeOption,
|
|
9
|
+
parseTimeOption
|
|
10
|
+
} from "./chunk-VGIX3A5R.js";
|
|
11
|
+
import {
|
|
12
|
+
Form
|
|
13
|
+
} from "./chunk-4JBL5FRI.js";
|
|
14
|
+
import {
|
|
15
|
+
toast
|
|
16
|
+
} from "./chunk-CYYWMYE7.js";
|
|
17
|
+
import {
|
|
18
|
+
Grid
|
|
19
|
+
} from "./chunk-EGEQY3KT.js";
|
|
20
|
+
import {
|
|
21
|
+
Dialog
|
|
22
|
+
} from "./chunk-5L3GY3OV.js";
|
|
23
|
+
import {
|
|
24
|
+
Separator
|
|
25
|
+
} from "./chunk-HYITAA4J.js";
|
|
26
|
+
import {
|
|
27
|
+
Box
|
|
28
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
29
|
+
import {
|
|
30
|
+
Flex
|
|
31
|
+
} from "./chunk-25HMMI7R.js";
|
|
32
|
+
import {
|
|
33
|
+
Button
|
|
34
|
+
} from "./chunk-Q5AFRGVP.js";
|
|
35
|
+
import {
|
|
36
|
+
__spreadProps,
|
|
37
|
+
__spreadValues
|
|
38
|
+
} from "./chunk-N552FDTV.js";
|
|
39
|
+
|
|
40
|
+
// src/app/platform/edit-coaching-time.tsx
|
|
41
|
+
import { useCallback, useState } from "react";
|
|
42
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
43
|
+
var getValueFromDefaultValue = (args) => {
|
|
44
|
+
return {
|
|
45
|
+
startTime: args.startAt ? getTimeOption(args.startAt) : "00:00",
|
|
46
|
+
endTime: args.endAt ? getTimeOption(args.endAt) : "00:00",
|
|
47
|
+
date: args.startAt || /* @__PURE__ */ new Date()
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
var getDateFromValue = (date, time) => {
|
|
51
|
+
const { hour, minute } = parseTimeOption(time);
|
|
52
|
+
return new Date(
|
|
53
|
+
date.getFullYear(),
|
|
54
|
+
date.getMonth(),
|
|
55
|
+
date.getDate(),
|
|
56
|
+
hour,
|
|
57
|
+
minute
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
function EditCoachingTime(props) {
|
|
61
|
+
const { defaultEndAt, defaultStartAt, onClickCancel } = props;
|
|
62
|
+
const [values, setValues] = useState(() => {
|
|
63
|
+
return getValueFromDefaultValue({
|
|
64
|
+
startAt: defaultStartAt,
|
|
65
|
+
endAt: defaultEndAt
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
const [timeError, setTimeError] = useState("");
|
|
69
|
+
const checkTimeError = useCallback(
|
|
70
|
+
(startTime, endTime) => {
|
|
71
|
+
const error = startTime >= endTime ? "\uC2DC\uC791\uC2DC\uAC04\uC744 \uC885\uB8CC\uC2DC\uAC04\uBCF4\uB2E4 \uBE60\uB974\uAC8C \uC120\uD0DD\uD574\uC8FC\uC138\uC694." : "";
|
|
72
|
+
if (error) {
|
|
73
|
+
setTimeError(error);
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
return true;
|
|
77
|
+
},
|
|
78
|
+
[]
|
|
79
|
+
);
|
|
80
|
+
const onChangeStartTime = useCallback(
|
|
81
|
+
(v) => {
|
|
82
|
+
checkTimeError(v, values.endTime);
|
|
83
|
+
setValues((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
84
|
+
startTime: v
|
|
85
|
+
}));
|
|
86
|
+
},
|
|
87
|
+
[checkTimeError, values.endTime]
|
|
88
|
+
);
|
|
89
|
+
const onChangeEndTime = useCallback(
|
|
90
|
+
(v) => {
|
|
91
|
+
checkTimeError(values.startTime, v);
|
|
92
|
+
setValues((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
93
|
+
endTime: v
|
|
94
|
+
}));
|
|
95
|
+
},
|
|
96
|
+
[checkTimeError, values.startTime]
|
|
97
|
+
);
|
|
98
|
+
const onChangeDate = useCallback((date) => {
|
|
99
|
+
date && setValues((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
100
|
+
date
|
|
101
|
+
}));
|
|
102
|
+
}, []);
|
|
103
|
+
const onClickSave = useCallback(() => {
|
|
104
|
+
if (checkTimeError(values.startTime, values.endTime)) {
|
|
105
|
+
const startAt = getDateFromValue(values.date, values.startTime);
|
|
106
|
+
const endAt = getDateFromValue(values.date, values.endTime);
|
|
107
|
+
props.onClickSave && props.onClickSave(startAt, endAt);
|
|
108
|
+
} else {
|
|
109
|
+
toast.error("\uC785\uB825 \uAC12\uC774 \uC720\uD6A8\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.");
|
|
110
|
+
}
|
|
111
|
+
}, [checkTimeError, props, values.date, values.endTime, values.startTime]);
|
|
112
|
+
return /* @__PURE__ */ jsx(Box, { width: { initial: "100%" }, children: /* @__PURE__ */ jsxs(Form.Root, { children: [
|
|
113
|
+
/* @__PURE__ */ jsxs(Form.Field, { name: "date", children: [
|
|
114
|
+
/* @__PURE__ */ jsx(Form.Label, { variant: "caption", children: "\uB0A0\uC9DC" }),
|
|
115
|
+
/* @__PURE__ */ jsx(
|
|
116
|
+
DatePickerButton,
|
|
117
|
+
{
|
|
118
|
+
maxDate: /* @__PURE__ */ new Date(),
|
|
119
|
+
onChange: onChangeDate,
|
|
120
|
+
selected: values.date,
|
|
121
|
+
size: { initial: "large", xs: "medium" }
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] }),
|
|
125
|
+
/* @__PURE__ */ jsxs(
|
|
126
|
+
Grid,
|
|
127
|
+
{
|
|
128
|
+
align: "center",
|
|
129
|
+
columns: {
|
|
130
|
+
initial: "1fr 0 1fr",
|
|
131
|
+
xs: "1fr auto 1fr"
|
|
132
|
+
},
|
|
133
|
+
gapX: "3",
|
|
134
|
+
gapY: "2",
|
|
135
|
+
justify: "center",
|
|
136
|
+
mb: { initial: "5", xs: "4" },
|
|
137
|
+
mt: "5",
|
|
138
|
+
width: "100%",
|
|
139
|
+
children: [
|
|
140
|
+
/* @__PURE__ */ jsx(Form.Field, { name: "startTime", children: /* @__PURE__ */ jsx(Form.Label, { variant: "caption", children: "\uC2DC\uC791 \uC2DC\uAC04" }) }),
|
|
141
|
+
/* @__PURE__ */ jsx("div", {}),
|
|
142
|
+
/* @__PURE__ */ jsx(Form.Field, { name: "endTime", children: /* @__PURE__ */ jsx(Form.Label, { variant: "caption", children: "\uC885\uB8CC \uC2DC\uAC04" }) }),
|
|
143
|
+
/* @__PURE__ */ jsx(
|
|
144
|
+
TimeSelect,
|
|
145
|
+
{
|
|
146
|
+
onValueChange: onChangeStartTime,
|
|
147
|
+
size: { initial: "3", xs: "2" },
|
|
148
|
+
value: values.startTime
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
/* @__PURE__ */ jsx(Box, { overflow: "hidden", children: /* @__PURE__ */ jsx(Separator, {}) }),
|
|
152
|
+
/* @__PURE__ */ jsx(
|
|
153
|
+
TimeSelect,
|
|
154
|
+
{
|
|
155
|
+
onValueChange: onChangeEndTime,
|
|
156
|
+
size: { initial: "3", xs: "2" },
|
|
157
|
+
value: values.endTime
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
/* @__PURE__ */ jsx(Form.Field, { name: "startEndTime", style: { gridColumn: "1/span 3" }, children: /* @__PURE__ */ jsx(Form.Message, { forceMatch: Boolean(timeError), children: timeError }) })
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "3", justify: "end", children: [
|
|
165
|
+
/* @__PURE__ */ jsx(Dialog.Close, { children: /* @__PURE__ */ jsx(Button, { onClick: onClickCancel, type: "button", variant: "outline", children: "\uCDE8\uC18C\uD558\uAE30" }) }),
|
|
166
|
+
/* @__PURE__ */ jsx(Dialog.Close, { children: /* @__PURE__ */ jsx(Button, { onClick: onClickSave, type: "button", children: "\uC800\uC7A5\uD558\uAE30" }) })
|
|
167
|
+
] })
|
|
168
|
+
] }) });
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export {
|
|
172
|
+
EditCoachingTime
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=chunk-B6JJT4VK.js.map
|