@pibit.ai/cure-design-system 0.3.20 → 0.4.0
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/README.md +1 -0
- package/dist/applications/schedule-calendar/schedule-calendar.d.ts.map +1 -1
- package/dist/applications/schedule-calendar/schedule-calendar.js +24 -22
- package/dist/applications/schedule-calendar/utils.d.ts +13 -3
- package/dist/applications/schedule-calendar/utils.d.ts.map +1 -1
- package/dist/applications/schedule-calendar/utils.js +136 -117
- package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
- package/dist/patterns/table/TableWrapper.js +776 -661
- package/dist/patterns/table/table.d.ts.map +1 -1
- package/dist/patterns/table/table.js +44 -43
- package/dist/patterns/table/toolbar/AlignDropdown.js +14 -14
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts +9 -0
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.js +115 -81
- package/dist/patterns/table/toolbar/SummaryFooter.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/SummaryFooter.js +34 -27
- package/dist/patterns/table/toolbar/index.d.ts +1 -1
- package/dist/patterns/table/toolbar/index.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/tableToolbarHelpers.js +1 -1
- package/dist/primitives/select/searchable-select.d.ts +5 -3
- package/dist/primitives/select/searchable-select.d.ts.map +1 -1
- package/dist/primitives/select/searchable-select.js +196 -177
- package/dist/primitives/select/select-item.d.ts.map +1 -1
- package/dist/primitives/select/select-item.js +70 -54
- package/dist/primitives/select/select.d.ts +7 -2
- package/dist/primitives/select/select.d.ts.map +1 -1
- package/dist/primitives/select/select.js +161 -137
- package/dist/primitives/tooltip/ellipsis-content.d.ts.map +1 -1
- package/dist/primitives/tooltip/ellipsis-content.js +46 -43
- package/dist/styles/components.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule-calendar.d.ts","sourceRoot":"","sources":["../../../src/applications/schedule-calendar/schedule-calendar.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAIL,KAAK,qBAAqB,EAE3B,MAAM,SAAS,CAAC;AAQjB,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,SAAS,EAAE,aAAiB,EAC5B,OAAO,EAAE,WAAgB,EACzB,iBAAyB,EACzB,SAAS,EACT,QAAgB,GACjB,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"schedule-calendar.d.ts","sourceRoot":"","sources":["../../../src/applications/schedule-calendar/schedule-calendar.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAIL,KAAK,qBAAqB,EAE3B,MAAM,SAAS,CAAC;AAQjB,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,SAAS,EAAE,aAAiB,EAC5B,OAAO,EAAE,WAAgB,EACzB,iBAAyB,EACzB,SAAS,EACT,QAAgB,GACjB,EAAE,qBAAqB,2CA+PvB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as w, useRef as P, useState as K, useCallback as
|
|
1
|
+
import { jsx as m, jsxs as A } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as w, useRef as P, useState as K, useCallback as y, useEffect as q } from "react";
|
|
3
3
|
import { cn as b } from "../../utils/cn.js";
|
|
4
4
|
import { getHourRange as G, clampHourRange as Y, getSlotRange as B, schedulesToCellSet as J, cellKey as C, cellSetToSchedules as Q, formatHourLabel as V, formatSlotLabel as X, getRectangleCells as Z } from "./utils.js";
|
|
5
5
|
import { WEEKDAYS as p } from "./types.js";
|
|
@@ -12,25 +12,27 @@ function oe({
|
|
|
12
12
|
className: j,
|
|
13
13
|
disabled: c = !1
|
|
14
14
|
}) {
|
|
15
|
-
const { startHour:
|
|
16
|
-
() => G(
|
|
17
|
-
[
|
|
15
|
+
const { startHour: d, endHour: i } = Y(F, T), E = w(
|
|
16
|
+
() => G(d, i),
|
|
17
|
+
[d, i]
|
|
18
18
|
), l = w(
|
|
19
|
-
() => B(
|
|
20
|
-
[
|
|
19
|
+
() => B(d, i, n),
|
|
20
|
+
[d, i, n]
|
|
21
21
|
), g = w(
|
|
22
22
|
() => J(k, n),
|
|
23
23
|
[k, n]
|
|
24
|
-
), h = P(null), [R, N] = K(!1), [a, x] = K(null), L = P(null), M =
|
|
24
|
+
), h = P(null), [R, N] = K(!1), [a, x] = K(null), L = P(null), M = y(
|
|
25
25
|
(e, r) => g.has(C(e, r)),
|
|
26
26
|
[g]
|
|
27
|
-
), f =
|
|
27
|
+
), f = y(
|
|
28
28
|
(e) => {
|
|
29
29
|
const r = new Set(g);
|
|
30
|
-
e(r), v(
|
|
30
|
+
e(r), v(
|
|
31
|
+
Q(r, n, { startHour: d, endHour: i })
|
|
32
|
+
);
|
|
31
33
|
},
|
|
32
|
-
[n, v, g]
|
|
33
|
-
), D =
|
|
34
|
+
[i, n, v, g, d]
|
|
35
|
+
), D = y(
|
|
34
36
|
(e) => {
|
|
35
37
|
const r = C(e.day, e.hour);
|
|
36
38
|
f((t) => {
|
|
@@ -38,7 +40,7 @@ function oe({
|
|
|
38
40
|
});
|
|
39
41
|
},
|
|
40
42
|
[f]
|
|
41
|
-
), z =
|
|
43
|
+
), z = y(
|
|
42
44
|
(e, r) => {
|
|
43
45
|
f((t) => {
|
|
44
46
|
for (const s of e) {
|
|
@@ -48,7 +50,7 @@ function oe({
|
|
|
48
50
|
});
|
|
49
51
|
},
|
|
50
52
|
[f]
|
|
51
|
-
), $ =
|
|
53
|
+
), $ = y(() => {
|
|
52
54
|
const e = h.current;
|
|
53
55
|
e && !e.moved && D(e.anchor), h.current = null, N(!1);
|
|
54
56
|
}, [D]);
|
|
@@ -86,7 +88,7 @@ function oe({
|
|
|
86
88
|
r == null || r.focus();
|
|
87
89
|
}, _ = (e) => {
|
|
88
90
|
if (c || !a) return;
|
|
89
|
-
const r = p.findIndex((
|
|
91
|
+
const r = p.findIndex((u) => u.key === a.day), t = l.findIndex((u) => u === a.hour);
|
|
90
92
|
let s = r, o = t;
|
|
91
93
|
switch (e.key) {
|
|
92
94
|
case "ArrowLeft":
|
|
@@ -115,7 +117,7 @@ function oe({
|
|
|
115
117
|
};
|
|
116
118
|
W(S);
|
|
117
119
|
};
|
|
118
|
-
return /* @__PURE__ */
|
|
120
|
+
return /* @__PURE__ */ m("div", { className: b("w-full overflow-x-auto", j), children: /* @__PURE__ */ A(
|
|
119
121
|
"div",
|
|
120
122
|
{
|
|
121
123
|
ref: L,
|
|
@@ -131,7 +133,7 @@ function oe({
|
|
|
131
133
|
},
|
|
132
134
|
onKeyDown: _,
|
|
133
135
|
children: [
|
|
134
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ m(
|
|
135
137
|
"div",
|
|
136
138
|
{
|
|
137
139
|
role: "columnheader",
|
|
@@ -139,7 +141,7 @@ function oe({
|
|
|
139
141
|
children: "Days"
|
|
140
142
|
}
|
|
141
143
|
),
|
|
142
|
-
E.map((e, r) => /* @__PURE__ */
|
|
144
|
+
E.map((e, r) => /* @__PURE__ */ m(
|
|
143
145
|
"div",
|
|
144
146
|
{
|
|
145
147
|
role: "columnheader",
|
|
@@ -153,7 +155,7 @@ function oe({
|
|
|
153
155
|
e
|
|
154
156
|
)),
|
|
155
157
|
p.map((e) => /* @__PURE__ */ A("div", { role: "row", className: "contents", children: [
|
|
156
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ m(
|
|
157
159
|
"div",
|
|
158
160
|
{
|
|
159
161
|
role: "rowheader",
|
|
@@ -163,7 +165,7 @@ function oe({
|
|
|
163
165
|
),
|
|
164
166
|
l.map((r, t) => {
|
|
165
167
|
const s = M(e.key, r), o = (a == null ? void 0 : a.day) === e.key && a.hour === r, S = t === l.length - 1;
|
|
166
|
-
return /* @__PURE__ */
|
|
168
|
+
return /* @__PURE__ */ m(
|
|
167
169
|
"div",
|
|
168
170
|
{
|
|
169
171
|
role: "gridcell",
|
|
@@ -179,8 +181,8 @@ function oe({
|
|
|
179
181
|
s ? "bg-brand-solid" : "bg-primary",
|
|
180
182
|
o && "ring-2 ring-focus-ring ring-inset"
|
|
181
183
|
),
|
|
182
|
-
onPointerDown: (
|
|
183
|
-
|
|
184
|
+
onPointerDown: (u) => {
|
|
185
|
+
u.preventDefault(), O({ day: e.key, hour: r });
|
|
184
186
|
},
|
|
185
187
|
onPointerEnter: () => {
|
|
186
188
|
U({ day: e.key, hour: r });
|
|
@@ -8,9 +8,19 @@ export declare function formatSlotLabel(slotValue: number, halfHourIntervals: bo
|
|
|
8
8
|
export declare function cellKey(day: WeekdayKey, slotValue: number): string;
|
|
9
9
|
export declare const HALF_HOUR_SLOT_MINUTES = 30;
|
|
10
10
|
export declare function schedulesToCellSet(value: DaySchedule[], halfHourIntervals?: boolean): Set<string>;
|
|
11
|
-
export declare function
|
|
12
|
-
export
|
|
13
|
-
|
|
11
|
+
export declare function formatDomainEnd(endHour: number): string;
|
|
12
|
+
export type DomainBoundary = {
|
|
13
|
+
endHour: number;
|
|
14
|
+
lastSlot: number;
|
|
15
|
+
exclusiveEnd: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare function getDomainBoundary(startHour: number, endHour: number, halfHourIntervals: boolean): DomainBoundary | null;
|
|
18
|
+
export declare function cellSetToSchedules(cells: Set<string>, halfHourIntervals?: boolean, domain?: {
|
|
19
|
+
startHour: number;
|
|
20
|
+
endHour: number;
|
|
21
|
+
}): DaySchedule[];
|
|
22
|
+
export declare function mergeHoursToWindows(hours: number[], domain?: DomainBoundary | null): DaySchedule["windows"];
|
|
23
|
+
export declare function mergeSlotsToWindows(slots: number[], domain?: DomainBoundary | null): DaySchedule["windows"];
|
|
14
24
|
export declare function getHourRange(startHour: number, endHour: number): number[];
|
|
15
25
|
export declare function getSlotRange(startHour: number, endHour: number, halfHourIntervals: boolean): number[];
|
|
16
26
|
export declare function getRectangleCells(anchor: CellCoordinate, current: CellCoordinate, hours: number[]): CellCoordinate[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/applications/schedule-calendar/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAE3F,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,UAAU,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAI9D;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG9C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKpD;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,GAAG,MAAM,CAerF;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,WAAW,EAAE,EACpB,iBAAiB,UAAQ,GACxB,GAAG,CAAC,MAAM,CAAC,CAyBb;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,EAClB,iBAAiB,UAAQ,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/applications/schedule-calendar/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAE3F,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,UAAU,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAI9D;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG9C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKpD;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,GAAG,MAAM,CAerF;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,WAAW,EAAE,EACpB,iBAAiB,UAAQ,GACxB,GAAG,CAAC,MAAM,CAAC,CAyBb;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,OAAO,GACzB,cAAc,GAAG,IAAI,CAYvB;AAkBD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,EAClB,iBAAiB,UAAQ,EACzB,MAAM,CAAC,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC9C,WAAW,EAAE,CA+Bf;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,GAAE,cAAc,GAAG,IAAW,GACnC,WAAW,CAAC,SAAS,CAAC,CA6BxB;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,GAAE,cAAc,GAAG,IAAW,GACnC,WAAW,CAAC,SAAS,CAAC,CA6BxB;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAQzE;AAED,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,OAAO,GACzB,MAAM,EAAE,CAcV;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,MAAM,EAAE,GACd,cAAc,EAAE,CA4BlB;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAOzG"}
|
|
@@ -1,152 +1,171 @@
|
|
|
1
1
|
import { WEEKDAYS as h } from "./types.js";
|
|
2
|
-
function
|
|
2
|
+
function w(t) {
|
|
3
3
|
return `${String(t).padStart(2, "0")}:00`;
|
|
4
4
|
}
|
|
5
|
-
function p(t) {
|
|
6
|
-
const e = Math.floor(t / 60), n = t % 60;
|
|
7
|
-
return `${String(e).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
8
|
-
}
|
|
9
|
-
function y(t) {
|
|
10
|
-
const [e] = t.split(":");
|
|
11
|
-
return Number.parseInt(e, 10);
|
|
12
|
-
}
|
|
13
5
|
function S(t) {
|
|
14
|
-
const
|
|
15
|
-
return
|
|
6
|
+
const n = Math.floor(t / 60), o = t % 60;
|
|
7
|
+
return `${String(n).padStart(2, "0")}:${String(o).padStart(2, "0")}`;
|
|
16
8
|
}
|
|
17
9
|
function g(t) {
|
|
10
|
+
const [n] = t.split(":");
|
|
11
|
+
return Number.parseInt(n, 10);
|
|
12
|
+
}
|
|
13
|
+
function M(t) {
|
|
14
|
+
const [n, o = "0"] = t.split(":");
|
|
15
|
+
return Number.parseInt(n, 10) * 60 + Number.parseInt(o, 10);
|
|
16
|
+
}
|
|
17
|
+
function x(t) {
|
|
18
18
|
return t === 0 ? "12am" : t < 12 ? `${t}am` : t === 12 ? "12pm" : `${t - 12}pm`;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
if (!
|
|
22
|
-
return
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
return
|
|
26
|
-
const
|
|
27
|
-
return `${
|
|
20
|
+
function R(t, n) {
|
|
21
|
+
if (!n)
|
|
22
|
+
return x(t);
|
|
23
|
+
const o = Math.floor(t / 60), e = t % 60;
|
|
24
|
+
if (e === 0)
|
|
25
|
+
return x(o);
|
|
26
|
+
const c = o < 12 ? "am" : "pm";
|
|
27
|
+
return `${o === 0 ? 12 : o > 12 ? o - 12 : o}:${String(e).padStart(2, "0")}${c}`;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return `${t}:${
|
|
29
|
+
function H(t, n) {
|
|
30
|
+
return `${t}:${n}`;
|
|
31
31
|
}
|
|
32
32
|
const f = 30;
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
for (const
|
|
36
|
-
for (const
|
|
37
|
-
if (
|
|
38
|
-
const
|
|
39
|
-
for (let
|
|
40
|
-
|
|
33
|
+
function W(t, n = !1) {
|
|
34
|
+
const o = /* @__PURE__ */ new Set();
|
|
35
|
+
for (const e of t)
|
|
36
|
+
for (const c of e.windows) {
|
|
37
|
+
if (n) {
|
|
38
|
+
const r = M(c.start), d = M(c.end);
|
|
39
|
+
for (let i = r; i < d; i += f)
|
|
40
|
+
o.add(H(e.day_of_week, i));
|
|
41
41
|
continue;
|
|
42
42
|
}
|
|
43
|
-
const s =
|
|
44
|
-
for (let
|
|
45
|
-
|
|
43
|
+
const s = g(c.start), u = g(c.end);
|
|
44
|
+
for (let r = s; r <= u; r++)
|
|
45
|
+
o.add(H(e.day_of_week, r));
|
|
46
46
|
}
|
|
47
|
-
return
|
|
47
|
+
return o;
|
|
48
|
+
}
|
|
49
|
+
function E(t) {
|
|
50
|
+
return `${String(t).padStart(2, "0")}:59`;
|
|
51
|
+
}
|
|
52
|
+
function T(t, n, o) {
|
|
53
|
+
const e = b(t, n, o), s = n - t + 1 === 24 || e.length === 24;
|
|
54
|
+
return s ? {
|
|
55
|
+
endHour: n,
|
|
56
|
+
lastSlot: e[e.length - 1],
|
|
57
|
+
exclusiveEnd: s
|
|
58
|
+
} : null;
|
|
48
59
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
60
|
+
function k(t, n) {
|
|
61
|
+
return n && t === n.lastSlot ? E(n.endHour) : w(t);
|
|
62
|
+
}
|
|
63
|
+
function $(t, n) {
|
|
64
|
+
return n && t === n.lastSlot ? E(n.endHour) : S(t + f);
|
|
65
|
+
}
|
|
66
|
+
function L(t, n = !1, o) {
|
|
67
|
+
const e = /* @__PURE__ */ new Map();
|
|
68
|
+
for (const u of t) {
|
|
69
|
+
const [r, d] = u.split(":"), i = Number.parseInt(d, 10), m = r, p = e.get(m) ?? [];
|
|
70
|
+
p.push(i), e.set(m, p);
|
|
54
71
|
}
|
|
55
|
-
const o = [];
|
|
56
|
-
for (const
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
day_of_week:
|
|
60
|
-
windows:
|
|
72
|
+
const c = o ? T(o.startHour, o.endHour, n) : null, s = [];
|
|
73
|
+
for (const u of h) {
|
|
74
|
+
const r = e.get(u.key);
|
|
75
|
+
r != null && r.length && s.push({
|
|
76
|
+
day_of_week: u.key,
|
|
77
|
+
windows: n ? D(r, c) : _(r, c)
|
|
61
78
|
});
|
|
62
79
|
}
|
|
63
|
-
return
|
|
80
|
+
return s;
|
|
64
81
|
}
|
|
65
|
-
function
|
|
66
|
-
const
|
|
67
|
-
let
|
|
68
|
-
for (let
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
|
|
82
|
+
function _(t, n = null) {
|
|
83
|
+
const o = [...t].sort((u, r) => u - r), e = [];
|
|
84
|
+
let c = o[0], s = o[0];
|
|
85
|
+
for (let u = 1; u < o.length; u++) {
|
|
86
|
+
const r = o[u];
|
|
87
|
+
if (r === s + 1) {
|
|
88
|
+
s = r;
|
|
72
89
|
continue;
|
|
73
90
|
}
|
|
74
|
-
|
|
75
|
-
start:
|
|
76
|
-
end:
|
|
77
|
-
}),
|
|
91
|
+
e.push({
|
|
92
|
+
start: w(c),
|
|
93
|
+
end: k(s, n)
|
|
94
|
+
}), c = r, s = r;
|
|
78
95
|
}
|
|
79
|
-
return
|
|
80
|
-
start:
|
|
81
|
-
end:
|
|
82
|
-
}),
|
|
83
|
-
}
|
|
84
|
-
function
|
|
85
|
-
const
|
|
86
|
-
let
|
|
87
|
-
for (let
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
|
|
96
|
+
return e.push({
|
|
97
|
+
start: w(c),
|
|
98
|
+
end: k(s, n)
|
|
99
|
+
}), e;
|
|
100
|
+
}
|
|
101
|
+
function D(t, n = null) {
|
|
102
|
+
const o = [...t].sort((u, r) => u - r), e = [];
|
|
103
|
+
let c = o[0], s = o[0];
|
|
104
|
+
for (let u = 1; u < o.length; u++) {
|
|
105
|
+
const r = o[u];
|
|
106
|
+
if (r === s + f) {
|
|
107
|
+
s = r;
|
|
91
108
|
continue;
|
|
92
109
|
}
|
|
93
|
-
|
|
94
|
-
start:
|
|
95
|
-
end:
|
|
96
|
-
}),
|
|
110
|
+
e.push({
|
|
111
|
+
start: S(c),
|
|
112
|
+
end: $(s, n)
|
|
113
|
+
}), c = r, s = r;
|
|
97
114
|
}
|
|
98
|
-
return
|
|
99
|
-
start:
|
|
100
|
-
end:
|
|
101
|
-
}),
|
|
102
|
-
}
|
|
103
|
-
function
|
|
104
|
-
const
|
|
105
|
-
for (let
|
|
106
|
-
|
|
107
|
-
return n;
|
|
108
|
-
}
|
|
109
|
-
function E(t, e, n) {
|
|
110
|
-
if (!n)
|
|
111
|
-
return T(t, e);
|
|
112
|
-
const o = [], r = t * 60, s = e * 60 + f;
|
|
113
|
-
for (let a = r; a <= s; a += f)
|
|
114
|
-
o.push(a);
|
|
115
|
+
return e.push({
|
|
116
|
+
start: S(c),
|
|
117
|
+
end: $(s, n)
|
|
118
|
+
}), e;
|
|
119
|
+
}
|
|
120
|
+
function O(t, n) {
|
|
121
|
+
const o = [];
|
|
122
|
+
for (let e = t; e <= n; e++)
|
|
123
|
+
o.push(e);
|
|
115
124
|
return o;
|
|
116
125
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
function b(t, n, o) {
|
|
127
|
+
if (!o)
|
|
128
|
+
return O(t, n);
|
|
129
|
+
const e = [], c = t * 60, s = n * 60 + f;
|
|
130
|
+
for (let u = c; u <= s; u += f)
|
|
131
|
+
e.push(u);
|
|
132
|
+
return e;
|
|
133
|
+
}
|
|
134
|
+
function B(t, n, o) {
|
|
135
|
+
const e = new Map(h.map((a) => [a.key, a.order])), c = new Map(o.map((a, l) => [a, l])), s = e.get(t.day) ?? 0, u = e.get(n.day) ?? 0, r = c.get(t.hour) ?? 0, d = c.get(n.hour) ?? 0, i = Math.min(s, u), m = Math.max(s, u), p = Math.min(r, d), I = Math.max(r, d), y = [];
|
|
136
|
+
for (const a of h)
|
|
137
|
+
if (!(a.order < i || a.order > m))
|
|
138
|
+
for (let l = p; l <= I; l++)
|
|
139
|
+
y.push({
|
|
140
|
+
day: a.key,
|
|
141
|
+
hour: o[l]
|
|
125
142
|
});
|
|
126
|
-
return
|
|
143
|
+
return y;
|
|
127
144
|
}
|
|
128
|
-
function
|
|
129
|
-
const
|
|
145
|
+
function K(t, n) {
|
|
146
|
+
const o = Math.max(0, Math.min(23, t)), e = Math.max(0, Math.min(23, n));
|
|
130
147
|
return {
|
|
131
|
-
startHour: Math.min(
|
|
132
|
-
endHour: Math.max(
|
|
148
|
+
startHour: Math.min(o, e),
|
|
149
|
+
endHour: Math.max(o, e)
|
|
133
150
|
};
|
|
134
151
|
}
|
|
135
152
|
export {
|
|
136
153
|
f as HALF_HOUR_SLOT_MINUTES,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
154
|
+
H as cellKey,
|
|
155
|
+
L as cellSetToSchedules,
|
|
156
|
+
K as clampHourRange,
|
|
157
|
+
E as formatDomainEnd,
|
|
158
|
+
w as formatHour,
|
|
159
|
+
x as formatHourLabel,
|
|
160
|
+
R as formatSlotLabel,
|
|
161
|
+
S as formatTime,
|
|
162
|
+
T as getDomainBoundary,
|
|
163
|
+
O as getHourRange,
|
|
164
|
+
B as getRectangleCells,
|
|
165
|
+
b as getSlotRange,
|
|
166
|
+
_ as mergeHoursToWindows,
|
|
167
|
+
D as mergeSlotsToWindows,
|
|
168
|
+
g as parseHour,
|
|
169
|
+
M as parseTimeToMinutes,
|
|
170
|
+
W as schedulesToCellSet
|
|
152
171
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableWrapper.d.ts","sourceRoot":"","sources":["../../../src/patterns/table/TableWrapper.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"TableWrapper.d.ts","sourceRoot":"","sources":["../../../src/patterns/table/TableWrapper.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAKV,iBAAiB,EAGlB,MAAM,SAAS,CAAC;AAUjB,YAAY,EACV,iBAAiB,EACjB,YAAY,EACZ,sBAAsB,EACtB,4BAA4B,EAC5B,iBAAiB,EACjB,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AA0HjB,eAAO,MAAM,YAAY,8GA2kCxB,CAAC"}
|