@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.
Files changed (31) hide show
  1. package/README.md +1 -0
  2. package/dist/applications/schedule-calendar/schedule-calendar.d.ts.map +1 -1
  3. package/dist/applications/schedule-calendar/schedule-calendar.js +24 -22
  4. package/dist/applications/schedule-calendar/utils.d.ts +13 -3
  5. package/dist/applications/schedule-calendar/utils.d.ts.map +1 -1
  6. package/dist/applications/schedule-calendar/utils.js +136 -117
  7. package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
  8. package/dist/patterns/table/TableWrapper.js +776 -661
  9. package/dist/patterns/table/table.d.ts.map +1 -1
  10. package/dist/patterns/table/table.js +44 -43
  11. package/dist/patterns/table/toolbar/AlignDropdown.js +14 -14
  12. package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts +9 -0
  13. package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts.map +1 -1
  14. package/dist/patterns/table/toolbar/ColumnHeaderMenu.js +115 -81
  15. package/dist/patterns/table/toolbar/SummaryFooter.d.ts.map +1 -1
  16. package/dist/patterns/table/toolbar/SummaryFooter.js +34 -27
  17. package/dist/patterns/table/toolbar/index.d.ts +1 -1
  18. package/dist/patterns/table/toolbar/index.d.ts.map +1 -1
  19. package/dist/patterns/table/toolbar/tableToolbarHelpers.js +1 -1
  20. package/dist/primitives/select/searchable-select.d.ts +5 -3
  21. package/dist/primitives/select/searchable-select.d.ts.map +1 -1
  22. package/dist/primitives/select/searchable-select.js +196 -177
  23. package/dist/primitives/select/select-item.d.ts.map +1 -1
  24. package/dist/primitives/select/select-item.js +70 -54
  25. package/dist/primitives/select/select.d.ts +7 -2
  26. package/dist/primitives/select/select.d.ts.map +1 -1
  27. package/dist/primitives/select/select.js +161 -137
  28. package/dist/primitives/tooltip/ellipsis-content.d.ts.map +1 -1
  29. package/dist/primitives/tooltip/ellipsis-content.js +46 -43
  30. package/dist/styles/components.css +1 -1
  31. package/package.json +1 -1
package/README.md CHANGED
@@ -163,6 +163,7 @@ All components are built with accessibility as a priority:
163
163
  - Firefox (latest)
164
164
  - Safari (latest)
165
165
  - Edge (latest)
166
+ - Opera (latest)
166
167
 
167
168
  ## License
168
169
 
@@ -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,2CA6PvB"}
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 i, jsxs as A } from "react/jsx-runtime";
2
- import { useMemo as w, useRef as P, useState as K, useCallback as u, useEffect as q } from "react";
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: m, endHour: y } = Y(F, T), E = w(
16
- () => G(m, y),
17
- [m, y]
15
+ const { startHour: d, endHour: i } = Y(F, T), E = w(
16
+ () => G(d, i),
17
+ [d, i]
18
18
  ), l = w(
19
- () => B(m, y, n),
20
- [m, y, n]
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 = u(
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 = u(
27
+ ), f = y(
28
28
  (e) => {
29
29
  const r = new Set(g);
30
- e(r), v(Q(r, n));
30
+ e(r), v(
31
+ Q(r, n, { startHour: d, endHour: i })
32
+ );
31
33
  },
32
- [n, v, g]
33
- ), D = u(
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 = u(
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
- ), $ = u(() => {
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((d) => d.key === a.day), t = l.findIndex((d) => d === a.hour);
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__ */ i("div", { className: b("w-full overflow-x-auto", j), children: /* @__PURE__ */ A(
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__ */ i(
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__ */ i(
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__ */ i(
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__ */ i(
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: (d) => {
183
- d.preventDefault(), O({ day: e.key, hour: r });
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 cellSetToSchedules(cells: Set<string>, halfHourIntervals?: boolean): DaySchedule[];
12
- export declare function mergeHoursToWindows(hours: number[]): DaySchedule["windows"];
13
- export declare function mergeSlotsToWindows(slots: number[]): DaySchedule["windows"];
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,kBAAk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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 m(t) {
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 [e, n = "0"] = t.split(":");
15
- return Number.parseInt(e, 10) * 60 + Number.parseInt(n, 10);
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 O(t, e) {
21
- if (!e)
22
- return g(t);
23
- const n = Math.floor(t / 60), o = t % 60;
24
- if (o === 0)
25
- return g(n);
26
- const r = n < 12 ? "am" : "pm";
27
- return `${n === 0 ? 12 : n > 12 ? n - 12 : n}:${String(o).padStart(2, "0")}${r}`;
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 M(t, e) {
30
- return `${t}:${e}`;
29
+ function H(t, n) {
30
+ return `${t}:${n}`;
31
31
  }
32
32
  const f = 30;
33
- function b(t, e = !1) {
34
- const n = /* @__PURE__ */ new Set();
35
- for (const o of t)
36
- for (const r of o.windows) {
37
- if (e) {
38
- const u = S(r.start), d = S(r.end);
39
- for (let c = u; c < d; c += f)
40
- n.add(M(o.day_of_week, c));
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 = y(r.start), a = y(r.end);
44
- for (let u = s; u <= a; u++)
45
- n.add(M(o.day_of_week, u));
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 n;
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 D(t, e = !1) {
50
- const n = /* @__PURE__ */ new Map();
51
- for (const r of t) {
52
- const [s, a] = r.split(":"), u = Number.parseInt(a, 10), d = s, c = n.get(d) ?? [];
53
- c.push(u), n.set(d, c);
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 r of h) {
57
- const s = n.get(r.key);
58
- s != null && s.length && o.push({
59
- day_of_week: r.key,
60
- windows: e ? $(s) : I(s)
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 o;
80
+ return s;
64
81
  }
65
- function I(t) {
66
- const e = [...t].sort((s, a) => s - a), n = [];
67
- let o = e[0], r = e[0];
68
- for (let s = 1; s < e.length; s++) {
69
- const a = e[s];
70
- if (a === r + 1) {
71
- r = a;
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
- n.push({
75
- start: m(o),
76
- end: m(r)
77
- }), o = a, r = a;
91
+ e.push({
92
+ start: w(c),
93
+ end: k(s, n)
94
+ }), c = r, s = r;
78
95
  }
79
- return n.push({
80
- start: m(o),
81
- end: m(r)
82
- }), n;
83
- }
84
- function $(t) {
85
- const e = [...t].sort((s, a) => s - a), n = [];
86
- let o = e[0], r = e[0];
87
- for (let s = 1; s < e.length; s++) {
88
- const a = e[s];
89
- if (a === r + f) {
90
- r = a;
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
- n.push({
94
- start: p(o),
95
- end: p(r + f)
96
- }), o = a, r = a;
110
+ e.push({
111
+ start: S(c),
112
+ end: $(s, n)
113
+ }), c = r, s = r;
97
114
  }
98
- return n.push({
99
- start: p(o),
100
- end: p(r + f)
101
- }), n;
102
- }
103
- function T(t, e) {
104
- const n = [];
105
- for (let o = t; o <= e; o++)
106
- n.push(o);
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 N(t, e, n) {
118
- const o = new Map(h.map((i) => [i.key, i.order])), r = new Map(n.map((i, l) => [i, l])), s = o.get(t.day) ?? 0, a = o.get(e.day) ?? 0, u = r.get(t.hour) ?? 0, d = r.get(e.hour) ?? 0, c = Math.min(s, a), x = Math.max(s, a), H = Math.min(u, d), k = Math.max(u, d), w = [];
119
- for (const i of h)
120
- if (!(i.order < c || i.order > x))
121
- for (let l = H; l <= k; l++)
122
- w.push({
123
- day: i.key,
124
- hour: n[l]
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 w;
143
+ return y;
127
144
  }
128
- function R(t, e) {
129
- const n = Math.max(0, Math.min(23, t)), o = Math.max(0, Math.min(23, e));
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(n, o),
132
- endHour: Math.max(n, o)
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
- M as cellKey,
138
- D as cellSetToSchedules,
139
- R as clampHourRange,
140
- m as formatHour,
141
- g as formatHourLabel,
142
- O as formatSlotLabel,
143
- p as formatTime,
144
- T as getHourRange,
145
- N as getRectangleCells,
146
- E as getSlotRange,
147
- I as mergeHoursToWindows,
148
- $ as mergeSlotsToWindows,
149
- y as parseHour,
150
- S as parseTimeToMinutes,
151
- b as schedulesToCellSet
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,EAKR,iBAAiB,EAGpB,MAAM,SAAS,CAAC;AAUjB,YAAY,EACR,iBAAiB,EACjB,YAAY,EACZ,sBAAsB,EACtB,4BAA4B,EAC5B,iBAAiB,EACjB,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,GAC5B,MAAM,SAAS,CAAC;AA4GjB,eAAO,MAAM,YAAY,8GAy7BvB,CAAC"}
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"}