@dotss/tictoccroc 0.0.6 → 0.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.
@@ -20,13 +20,19 @@ export declare function getDayScheduleEvents(scheduleEvents: ScheduleEventWithRa
20
20
  export declare function resolvePositionedScheduleEventsForDate(scheduleEvents: ScheduleEventWithRange[], date: Dayjs): PositionedScheduleEvent[];
21
21
  export declare function assignColumnsToGroup(group: InternalScheduleEvent[]): PositionedScheduleEvent[];
22
22
  export declare function getMinutesFromMidnight(date: string): number;
23
- export declare function getAvailableDateRange(startDate: string | Date | Dayjs, endDate: string | Date | Dayjs, schedules: {
24
- startTime: number;
25
- endTime: number;
26
- weekDay: string | number;
27
- oneDayDate: string | null;
28
- }[]): {
29
- id: string;
23
+ export declare function getAvailableDateRange(startDate: string | Date | Dayjs, endDate: string | Date | Dayjs, { schedules, mergedTimeBlocks }: {
24
+ schedules: {
25
+ id: string | number;
26
+ startDate: string;
27
+ endDate: string;
28
+ startTime: number;
29
+ endTime: number;
30
+ weekDay: string | number;
31
+ oneDayDate: string | null;
32
+ }[];
33
+ mergedTimeBlocks: boolean;
34
+ }): {
35
+ id: string | number;
30
36
  startDate: string;
31
37
  endDate: string;
32
38
  }[];
@@ -1,92 +1,103 @@
1
1
  import s from "dayjs";
2
2
  import g from "../../utils/getDateRange/getDateRange.mjs";
3
- import v from "../../utils/getTimeRange/getTimeRange.mjs";
4
- function S(a, n = []) {
5
- const r = Array.from({ length: 7 }, (e, u) => a.add(u, "day")), o = a, i = a.add(6, "day").endOf("day"), d = n.map((e) => {
6
- const u = s(e.startDate), t = s(e.endDate).endOf("day"), l = u.isBefore(o) ? o : u, h = t.isAfter(i) ? i : t, c = l.diff(o, "day"), p = h.diff(l, "day") + 1;
3
+ import y from "../../utils/getTimeRange/getTimeRange.mjs";
4
+ function M(u, n = []) {
5
+ const a = Array.from({ length: 7 }, (e, f) => u.add(f, "day")), i = u, o = u.add(6, "day").endOf("day"), m = n.map((e) => {
6
+ const f = s(e.startDate), t = s(e.endDate).endOf("day"), r = f.isBefore(i) ? i : f, c = t.isAfter(o) ? o : t, l = r.diff(i, "day"), p = c.diff(r, "day") + 1;
7
7
  return {
8
8
  ...e,
9
- start: c,
10
- end: c + p - 1
9
+ start: l,
10
+ end: l + p - 1
11
11
  };
12
12
  }).filter((e) => e.start <= 6 && e.end >= 0);
13
- return { days: r.map((e) => e), scheduleEvents: d };
13
+ return { days: a.map((e) => e), scheduleEvents: m };
14
14
  }
15
- function M(a, n) {
16
- return a.filter(
17
- (r) => s(r.startDate).isBefore(n.endOf("day")) && s(r.endDate).isAfter(n.startOf("day"))
15
+ function _(u, n) {
16
+ return u.filter(
17
+ (a) => s(a.startDate).isBefore(n.endOf("day")) && s(a.endDate).isAfter(n.startOf("day"))
18
18
  );
19
19
  }
20
- function _(a, n) {
21
- const r = n.startOf("day"), o = n.endOf("day"), d = [...a.filter(
22
- (t) => s(t.startDate).isBefore(o) && s(t.endDate).isAfter(r)
20
+ function Y(u, n) {
21
+ const a = n.startOf("day"), i = n.endOf("day"), m = [...u.filter(
22
+ (t) => s(t.startDate).isBefore(i) && s(t.endDate).isAfter(a)
23
23
  ).map((t) => ({
24
24
  ...t,
25
25
  _start: Math.max(
26
26
  s(t.startDate).minute() + s(t.startDate).hour() * 60,
27
- r.minute() + r.hour() * 60
27
+ a.minute() + a.hour() * 60
28
28
  ),
29
29
  _end: Math.min(
30
30
  s(t.endDate).minute() + s(t.endDate).hour() * 60,
31
- o.minute() + o.hour() * 60
31
+ i.minute() + i.hour() * 60
32
32
  )
33
- }))].sort((t, l) => t._start - l._start), f = [];
34
- let e = [], u = -1;
35
- for (const t of d)
36
- e.length === 0 || t._start < u ? (e.push(t), u = Math.max(u, t._end)) : (f.push(...m(e)), e = [t], u = t._end);
37
- return e.length > 0 && f.push(...m(e)), f;
33
+ }))].sort((t, r) => t._start - r._start), d = [];
34
+ let e = [], f = -1;
35
+ for (const t of m)
36
+ e.length === 0 || t._start < f ? (e.push(t), f = Math.max(f, t._end)) : (d.push(...D(e)), e = [t], f = t._end);
37
+ return e.length > 0 && d.push(...D(e)), d;
38
38
  }
39
- function m(a) {
40
- const n = [], r = [];
41
- for (const i of a) {
42
- let d = !1;
43
- for (let f = 0; f < n.length; f++) {
44
- const e = n[f];
39
+ function D(u) {
40
+ const n = [], a = [];
41
+ for (const o of u) {
42
+ let m = !1;
43
+ for (let d = 0; d < n.length; d++) {
44
+ const e = n[d];
45
45
  if (!e.some(
46
46
  (t) => !(t._end <= t._start || t._end <= t._start)
47
47
  )) {
48
- e.push(i), r.push({
49
- ...i,
50
- columnIndex: f,
48
+ e.push(o), a.push({
49
+ ...o,
50
+ columnIndex: d,
51
51
  totalColumns: 0
52
- }), d = !0;
52
+ }), m = !0;
53
53
  break;
54
54
  }
55
55
  }
56
- d || (n.push([i]), r.push({
57
- ...i,
56
+ m || (n.push([o]), a.push({
57
+ ...o,
58
58
  columnIndex: n.length - 1,
59
59
  totalColumns: 0
60
60
  }));
61
61
  }
62
- const o = n.length;
63
- return r.forEach((i) => i.totalColumns = o), r;
62
+ const i = n.length;
63
+ return a.forEach((o) => o.totalColumns = i), a;
64
64
  }
65
- function Y(a) {
66
- const n = s(a);
65
+ function C(u) {
66
+ const n = s(u);
67
67
  return n.hour() * 60 + n.minute();
68
68
  }
69
- function C(a, n, r) {
70
- return g(a, n).flatMap(({ value: o }, i) => {
71
- const f = r.filter(({ weekDay: t }) => String(t) === o.getDay().toString()).filter(({ oneDayDate: t }) => t ? s(t).isSame(o, "date") : !0).flatMap(
72
- ({ startTime: t, endTime: l }) => v(Number(t), Number(l), {
73
- pairs: !0
74
- })
75
- ), e = 2, u = [];
76
- for (let t = 0; t < f.length; t += e)
77
- u.push(f.slice(t, t + e));
78
- return u.map(([{ value: t }, { value: l }]) => ({
79
- id: `${i}-${t}-${l}`,
80
- startDate: s(o).hour(Math.floor(t)).minute(t % 1 * 60).format("YYYY-MM-DD HH:mm"),
69
+ function O(u, n, {
70
+ schedules: a,
71
+ mergedTimeBlocks: i = !1
72
+ }) {
73
+ return g(u, n).flatMap(({ value: o }, m) => {
74
+ const e = a.filter(({ startDate: r, endDate: c, weekDay: l }) => {
75
+ const p = s(r), h = s(c);
76
+ return p.isAfter(o) || h.isBefore(o) ? !1 : String(l) === o.getDay().toString();
77
+ }).filter(({ oneDayDate: r }) => r ? s(r).isSame(o, "date") : !0).flatMap(
78
+ ({ id: r, startTime: c, endTime: l }) => y(Number(c), Number(l), {
79
+ step: i ? l - c : void 0,
80
+ pairs: !i
81
+ }).map(({ value: p, label: h }) => ({
82
+ id: r,
83
+ value: p,
84
+ label: h
85
+ }))
86
+ ), f = 2, t = [];
87
+ for (let r = 0; r < e.length; r += f)
88
+ t.push(e.slice(r, r + f));
89
+ return t.map(([{ id: r, value: c }, { value: l }]) => ({
90
+ id: r || `${m}-${c}-${l}`,
91
+ startDate: s(o).hour(Math.floor(c)).minute(c % 1 * 60).format("YYYY-MM-DD HH:mm"),
81
92
  endDate: s(o).hour(Math.floor(l)).minute(l % 1 * 60).format("YYYY-MM-DD HH:mm")
82
93
  }));
83
94
  });
84
95
  }
85
96
  export {
86
- m as assignColumnsToGroup,
87
- S as generateWeek,
88
- C as getAvailableDateRange,
89
- M as getDayScheduleEvents,
90
- Y as getMinutesFromMidnight,
91
- _ as resolvePositionedScheduleEventsForDate
97
+ D as assignColumnsToGroup,
98
+ M as generateWeek,
99
+ O as getAvailableDateRange,
100
+ _ as getDayScheduleEvents,
101
+ C as getMinutesFromMidnight,
102
+ Y as resolvePositionedScheduleEventsForDate
92
103
  };
@@ -1,21 +1,22 @@
1
- import a from "dayjs";
2
- import d from "dayjs/plugin/isSameOrBefore";
3
- a.extend(d);
4
- function u(i, n, f = {}) {
5
- const { format: o = "YYYY-MM-DD" } = f, t = a(i), r = a(n);
6
- if (!t.isValid() || !r.isValid())
1
+ import o from "dayjs";
2
+ function l(t, r, f = {}) {
3
+ const { format: s = "YYYY-MM-DD" } = f, a = o(t), n = o(r);
4
+ if (!a.isValid() || !n.isValid())
7
5
  return [];
8
- if (t.isAfter(r))
6
+ if (a.isAfter(n))
9
7
  return [];
10
- const s = [];
11
- let e = t;
12
- for (; e.isSameOrBefore(r); )
13
- s.push({
14
- label: e.format(o),
8
+ const i = [];
9
+ let e = a;
10
+ for (; u(e, n); )
11
+ i.push({
12
+ label: e.format(s),
15
13
  value: e.toDate()
16
- }), o === "YYYY-MM" ? e = e.add(1, "month") : e = e.add(1, "day");
17
- return s;
14
+ }), s === "YYYY-MM" ? e = e.add(1, "month") : e = e.add(1, "day");
15
+ return i;
16
+ }
17
+ function u(t, r) {
18
+ return t.isBefore(r) || t.isSame(r);
18
19
  }
19
20
  export {
20
- u as default
21
+ l as default
21
22
  };
@@ -1,9 +1,9 @@
1
1
  import { MasonryBlockProps } from '../../../../../shared/components/Masonry/MasonryBlock';
2
- export interface ActivityGalleryItemProps extends MasonryBlockProps {
2
+ export interface ActivityGalleryItemProps extends Omit<MasonryBlockProps, 'id'> {
3
3
  type: 'VIDEO' | 'VIMEO' | 'YOUTUBE' | 'IMAGE';
4
4
  primary: boolean;
5
5
  status: 'VERIFIED' | 'PENDING' | 'REJECTED' | 'DELETED';
6
- id: string;
6
+ id: string | number;
7
7
  }
8
8
  declare function ActivityGalleryItem({ children, type, primary, status, id, ...props }: ActivityGalleryItemProps): import("@emotion/react/jsx-runtime").JSX.Element;
9
9
  export default ActivityGalleryItem;
@@ -6,13 +6,12 @@ import D from "@dotss/ui/Switch";
6
6
  import j from "../../../../shared/components/Image/Image.mjs";
7
7
  import A from "../../../../shared/components/Scheduler/Scheduler.mjs";
8
8
  import "dayjs";
9
- import "../../../../shared/utils/getDateRange/getDateRange.mjs";
10
- const U = w(
9
+ const M = w(
11
10
  function({
12
- children: m,
13
- title: g = "수업 가능 일정",
11
+ children: g,
12
+ title: m = "수업 가능 일정",
14
13
  action: c,
15
- footer: r,
14
+ footer: d,
16
15
  flat: s = !1,
17
16
  schedulerProps: p,
18
17
  enableToggle: h = !0,
@@ -21,9 +20,9 @@ const U = w(
21
20
  }, v) {
22
21
  const {
23
22
  palette: { grey: b, background: f }
24
- } = R(), [t, C] = S(!1), x = () => C((d) => !d), y = (d) => {
23
+ } = R(), [t, C] = S(!1), x = () => C((r) => !r), y = (r) => {
25
24
  var u;
26
- return (u = i.onChange) == null ? void 0 : u.call(i, d);
25
+ return (u = i.onChange) == null ? void 0 : u.call(i, r);
27
26
  };
28
27
  return /* @__PURE__ */ l(
29
28
  n,
@@ -33,14 +32,14 @@ const U = w(
33
32
  flexDirection: "column",
34
33
  gap: 4,
35
34
  "aria-labelledby": "available-schedule-section-title",
36
- "aria-describedby": r ? "available-schedule-section-footer" : void 0,
35
+ "aria-describedby": d ? "available-schedule-section-footer" : void 0,
37
36
  ...a,
38
37
  inlineCSS: {
39
38
  width: "100%",
40
39
  ...a == null ? void 0 : a.inlineCSS
41
40
  },
42
41
  children: [
43
- /* @__PURE__ */ e(o, { id: "available-schedule-section-title", tag: "h2", variant: "h2B", children: g }),
42
+ /* @__PURE__ */ e(o, { id: "available-schedule-section-title", tag: "h2", variant: "h2B", children: m }),
44
43
  i.active && /* @__PURE__ */ l(n, { flexDirection: "column", gap: 2, children: [
45
44
  /* @__PURE__ */ l(
46
45
  n,
@@ -62,7 +61,7 @@ const U = w(
62
61
  id: "available-schedule-section-scheduler",
63
62
  "aria-labelledby": "available-schedule-section-title",
64
63
  ...p,
65
- children: m
64
+ children: g
66
65
  }
67
66
  ),
68
67
  h && /* @__PURE__ */ e(
@@ -88,7 +87,7 @@ const U = w(
88
87
  ]
89
88
  }
90
89
  ),
91
- r && /* @__PURE__ */ e(n, { id: "available-schedule-section-footer", tag: "footer", pl: 12, pr: 2, children: r })
90
+ d && /* @__PURE__ */ e(n, { id: "available-schedule-section-footer", tag: "footer", pl: 12, pr: 2, children: d })
92
91
  ] }),
93
92
  typeof i.onChange == "function" && /* @__PURE__ */ l(
94
93
  n,
@@ -189,5 +188,5 @@ const U = w(
189
188
  }
190
189
  );
191
190
  export {
192
- U as default
191
+ M as default
193
192
  };
@@ -1,79 +1,81 @@
1
- import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as m } from "react";
3
- import { Flexbox as i, Typography as l, Button as s, Icon as h } from "@dotss/ui";
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as s } from "react";
3
+ import { Flexbox as t, Typography as o, Button as h, Icon as c } from "@dotss/ui";
4
4
  import p from "@dotss/ui/core/useTheme";
5
- const v = m(
6
- ({ children: c, totalCount: o, onClickViewAll: a, ...e }, g) => {
5
+ const x = s(
6
+ ({ children: g, totalCount: r, onClickViewAll: l, ...i }, d) => {
7
7
  const {
8
- palette: { grey: d },
9
- spacing: r
8
+ palette: { grey: m },
9
+ spacing: a
10
10
  } = p();
11
11
  return /* @__PURE__ */ n(
12
- i,
12
+ t,
13
13
  {
14
- ref: g,
14
+ ref: d,
15
15
  tag: "section",
16
- pl: 4,
17
- pr: 4,
18
16
  gap: 4,
19
17
  flexDirection: "column",
20
18
  "aria-labelledby": "parent-review-section-title",
21
- ...e,
19
+ ...i,
22
20
  inlineCSS: {
23
21
  width: "100%",
24
- ...e == null ? void 0 : e.inlineCSS
22
+ ...i == null ? void 0 : i.inlineCSS
25
23
  },
26
24
  children: [
27
- /* @__PURE__ */ n(i, { alignItems: "center", justifyContent: "space-between", gap: 1, children: [
28
- /* @__PURE__ */ t(i, { alignItems: "center", gap: 2, children: /* @__PURE__ */ n(l, { id: "parent-review-section-title", tag: "h2", variant: "h2B", children: [
25
+ /* @__PURE__ */ n(t, { alignItems: "center", justifyContent: "space-between", gap: 1, children: [
26
+ /* @__PURE__ */ e(t, { alignItems: "center", gap: 2, children: /* @__PURE__ */ n(o, { id: "parent-review-section-title", tag: "h2", variant: "h2B", children: [
29
27
  "부모님 리뷰",
30
- o > 0 && /* @__PURE__ */ n(
31
- l,
28
+ /* @__PURE__ */ n(
29
+ o,
32
30
  {
33
31
  tag: "span",
34
32
  variant: "h4R",
35
33
  color: "grey.70",
36
- inlineCSS: { marginLeft: r.content(2), verticalAlign: 2 },
34
+ inlineCSS: { marginLeft: a.content(2), verticalAlign: 2 },
37
35
  children: [
38
36
  "(",
39
- o.toLocaleString(),
37
+ r.toLocaleString(),
40
38
  "개)"
41
39
  ]
42
40
  }
43
41
  )
44
42
  ] }) }),
45
- typeof a == "function" && /* @__PURE__ */ t(
46
- s,
43
+ typeof l == "function" && /* @__PURE__ */ e(
44
+ h,
47
45
  {
48
46
  variant: "text",
49
47
  size: "small",
50
48
  color: "secondary",
51
- endAdornment: /* @__PURE__ */ t(h, { name: "ChevronRightLine" }),
52
- onClick: a,
49
+ endAdornment: /* @__PURE__ */ e(c, { name: "ChevronRightLine" }),
50
+ onClick: l,
53
51
  children: "전체보기"
54
52
  }
55
53
  )
56
54
  ] }),
57
- /* @__PURE__ */ t(
58
- i,
55
+ r > 0 && /* @__PURE__ */ e(
56
+ t,
59
57
  {
60
58
  tag: "ul",
61
59
  flexDirection: "column",
62
60
  inlineCSS: {
63
61
  "& > li + li": {
64
- borderTop: `1px solid ${d[10]}`,
65
- marginTop: r.content(5),
66
- paddingTop: r.content(5)
62
+ borderTop: `1px solid ${m[10]}`,
63
+ marginTop: a.content(5),
64
+ paddingTop: a.content(5)
67
65
  }
68
66
  },
69
- children: c
67
+ children: g
70
68
  }
71
- )
69
+ ),
70
+ r <= 0 && /* @__PURE__ */ n(t, { alignItems: "center", justifyContent: "center", gap: 1, pt: 8, pb: 8, children: [
71
+ /* @__PURE__ */ e(c, { name: "OngoingFill", color: "grey.50" }),
72
+ /* @__PURE__ */ e(o, { tag: "p", variant: "b4R", color: "grey.70", children: "아직 작성된 부모님 리뷰가 없어요." })
73
+ ] })
72
74
  ]
73
75
  }
74
76
  );
75
77
  }
76
78
  );
77
79
  export {
78
- v as default
80
+ x as default
79
81
  };
@@ -1,9 +1,9 @@
1
1
  const l = {
2
2
  age1: { label: "~24개월" },
3
- age2: { label: "3~4세" },
4
- age3: { label: "5~7세" },
5
- age4: { label: "8~10세" },
6
- age5: { label: "11~13세" }
3
+ age2: { label: "2~3세" },
4
+ age3: { label: "4~6세" },
5
+ age4: { label: "7~9세" },
6
+ age5: { label: "10~12세" }
7
7
  };
8
8
  function r(a) {
9
9
  return Object.keys(l).filter((e) => a[e] === "Y").map((e) => l[e].label);